diff --git a/assets/AltairPlot-DvtXjkKK.js b/assets/AltairPlot-Dr6gM0_X.js similarity index 99% rename from assets/AltairPlot-DvtXjkKK.js rename to assets/AltairPlot-Dr6gM0_X.js index 6633325053509c3eb43ecb77e00aa5595eb47d6e..18dcc9c1aa2cc8af32d31f7254a9e4c6a5126f51 100644 --- a/assets/AltairPlot-DvtXjkKK.js +++ b/assets/AltairPlot-Dr6gM0_X.js @@ -1,4 +1,4 @@ -import{V as eh,p as Y3,a as K3,d as Jb,i as J3}from"./i18n-CPHyzK9b.js";import{M as Q3,Z as on,ac as Z3,S as eR,a as Qb,O as tR,a2 as th,v as nR,$ as Zb,Q as ex,R as h2,aa as tx,T as nx,t as iR,X as rR}from"./index-DydPgVMC.js";import{g as sR}from"./color-Be3KLOYu.js";import{f as aR,m as oR,a as uR,d as lR,b as p2,q as ix,c as cR,i as fR,l as dR,e as hR,s as pR,g as gR,u as mR,h as g2,j as yR,k as bR,n as xR,o as vR,r as ER,t as AR,v as CR,w as wR,x as FR,y as SR,z as $R,A as kR,B as DR,C as OR,D as RR,E as _R,F as TR,G as NR,H as MR,I as LR,J as BR,K as PR,p as IR,$ as zR,L as m2,S as UR,M as y2,a4 as b2,N as jR,O as qR,P as WR,Q as GR,R as HR,T as VR,U as XR,V as YR,W as KR,X as JR,Y as QR,Z as ZR,_ as e5,a0 as t5,a1 as n5,a2 as i5,a3 as r5,a5 as s5,a6 as a5,a7 as o5,a8 as u5,a9 as l5,aa as c5,ab as f5,ac as d5,ad as h5,ae as p5,af as rx,ag as g5,ah as m5,ai as y5,aj as b5,ak as x5,al as v5,am as E5,an as A5,ao as C5,ap as w5,aq as F5,ar as S5,as as $5,at as nh}from"./mollweide-XXUPULVr.js";import{c as sx,x as ax,v as Gl,l as Hl,w as x2,d as v2,p as E2,s as A2,o as k5,n as D5,q as O5,u as R5,r as _5,y as T5,z as N5,b as M5,A as L5,B as B5,C as P5,a as Yo,m as I5,t as z5,D as U5,E as j5}from"./time-BMaLdJ6b.js";import{b as em,t as au,p as q5,d as W5,e as G5,f as C2,l as H5,g as V5,h as mc,i as X5,j as Y5,k as K5}from"./linear-8mDBZVC7.js";import{c as J5,a as ox,f as Q5,b as Z5}from"./defaultLocale-CzDG__Ur.js";import{d as e_}from"./dsv-DB8NKgIY.js";import{r as Ms}from"./range-OtVwhkKS.js";import{o as w2,i as t_}from"./ordinal-BeghXfj9.js";import{d as n_}from"./arc-Bt_eNeYl.js";import{l as i_,V as tm,D as r_,E as s_,F as a_,G as o_,H as u_,I as l_,J as c_,K as f_,L as d_,M as h_,N as p_,O as g_,P as m_,Q as y_,S as b_,T as x_,U as v_,k as E_,W as yc,X as A_}from"./step-B-Gbak1k.js";import{h as C_,t as w_,a as F_,b as S_,c as $_}from"./index-BU4IRnz1.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./colors-Cc3OSVma.js";function k_(e,t,n,i){let r=t.getPropertyValue("--color-accent"),s=t.getPropertyValue("--body-text-color"),a=t.getPropertyValue("--border-color-primary"),o=t.fontFamily,u=t.getPropertyValue("--block-title-text-weight");const l=g=>g.endsWith("px")?parseFloat(g.slice(0,-2)):12;let c=l(t.getPropertyValue("--text-md")),f=l(t.getPropertyValue("--text-sm")),d={autosize:{type:"fit",contains:"padding"},axis:{labelFont:o,labelColor:s,titleFont:o,titleColor:s,tickColor:a,labelFontSize:f,gridColor:a,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",domain:!1,labelAngle:0},legend:{labelColor:s,labelFont:o,titleColor:s,titleFont:o,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",offset:2},title:{color:s,font:o,fontSize:c,fontWeight:u,anchor:"middle"},view:{stroke:a}};e.config=d;let p=e.encoding,h=e.layer;switch(n){case"scatter":e.config.mark={stroke:r},p.color&&p.color.type=="nominal"?p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)):p.color&&p.color.type=="quantitative"&&(p.color.scale.range=["#eff6ff","#1e3a8a"],p.color.scale.range.interpolate="hsl");break;case"line":e.config.mark={stroke:r,cursor:"crosshair"},h.forEach(g=>{g.encoding.color&&(g.encoding.color.scale.range=g.encoding.color.scale.range.map((m,y)=>ih(i,y)))});break;case"bar":e.config.mark={opacity:.8,fill:r},p.color&&(p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)));break}return e}function ih(e,t){let n=e[t%e.length];return n&&n in eh?eh[n]?.primary:n||eh[sR(t)].primary}function Vt(e,t,n){return e.fields=t||[],e.fname=n,e}function ze(e){return e==null?null:e.fname}function Et(e){return e==null?null:e.fields}function F2(e){return e.length===1?D_(e[0]):O_(e)}const D_=e=>function(t){return t[e]},O_=e=>{const t=e.length;return function(n){for(let i=0;ia?l():a=o+1:u==="["?(o>a&&l(),r=a=o+1):u==="]"&&(r||S("Access path missing open bracket: "+e),r>0&&l(),r=0,a=o+1)}return r&&S("Access path missing closing bracket: "+e),i&&S("Access path missing closing quote: "+e),o>a&&(o++,l()),t}function gn(e,t,n){const i=bi(e);return e=i.length===1?i[0]:e,Vt((n&&n.get||F2)(i),[e],t||e)}const Ru=gn("id"),$t=Vt(e=>e,[],"identity"),cr=Vt(()=>0,[],"zero"),Ha=Vt(()=>1,[],"one"),mn=Vt(()=>!0,[],"true"),ir=Vt(()=>!1,[],"false"),nm=new Set(Object.getOwnPropertyNames(Object.prototype));function R_(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const S2=0,im=1,rm=2,$2=3,k2=4;function sm(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R_,i=e||S2;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=im&&n(t||"error","ERROR",arguments),this},warn(){return i>=rm&&n(t||"warn","WARN",arguments),this},info(){return i>=$2&&n(t||"log","INFO",arguments),this},debug(){return i>=k2&&n(t||"log","DEBUG",arguments),this}}}var D=Array.isArray;function j(e){return e===Object(e)}const ux=e=>e!=="__proto__";function Va(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=__(i.signals,r.signals);else{const a=s==="legend"?{layout:1}:s==="style"?!0:null;Xa(i,s,r[s],a)}return i},{})}function Xa(e,t,n,i){if(!ux(t))return;let r,s;if(j(n)&&!D(n)){s=j(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Xa(s,r,n[r]):ux(r)&&(s[r]=n[r])}else e[t]=n}function __(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function ce(e){return e[e.length-1]}function xt(e){return e==null||e===""?null:+e}const D2=e=>t=>e*Math.exp(t),O2=e=>t=>Math.log(e*t),R2=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),_2=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,bc=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function cf(e,t,n,i){const r=n(e[0]),s=n(ce(e)),a=(s-r)*t;return[i(r-a),i(s-a)]}function T2(e,t){return cf(e,t,xt,$t)}function N2(e,t){var n=Math.sign(e[0]);return cf(e,t,O2(n),D2(n))}function M2(e,t,n){return cf(e,t,bc(n),bc(1/n))}function L2(e,t,n){return cf(e,t,R2(n),_2(n))}function ff(e,t,n,i,r){const s=i(e[0]),a=i(ce(e)),o=t!=null?i(t):(s+a)/2;return[r(o+(s-o)*n),r(o+(a-o)*n)]}function am(e,t,n){return ff(e,t,n,xt,$t)}function om(e,t,n){const i=Math.sign(e[0]);return ff(e,t,n,O2(i),D2(i))}function xc(e,t,n,i){return ff(e,t,n,bc(i),bc(1/i))}function um(e,t,n,i){return ff(e,t,n,R2(i),_2(i))}function B2(e){return 1+~~(new Date(e).getMonth()/3)}function P2(e){return 1+~~(new Date(e).getUTCMonth()/3)}function W(e){return e!=null?D(e)?e:[e]:[]}function I2(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ae(e){return typeof e=="function"}const T_="descending";function lm(e,t,n){n=n||{},t=W(t)||[];const i=[],r=[],s={},a=n.comparator||N_;return W(e).forEach((o,u)=>{o!=null&&(i.push(t[u]===T_?-1:1),r.push(o=ae(o)?o:gn(o,null,n)),(Et(o)||[]).forEach(l=>s[l]=1))}),r.length===0?null:Vt(a(r,i),Object.keys(s))}const Ya=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),N_=(e,t)=>e.length===1?M_(e[0],t[0]):L_(e,t,e.length),M_=(e,t)=>function(n,i){return Ya(e(n),e(i))*t},L_=(e,t,n)=>(t.push(0),function(i,r){let s,a=0,o=-1;for(;a===0&&++oe}function cm(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function se(e){for(let t,n,i=1,r=arguments.length;ia&&(a=r))}else{for(r=t(e[n]);na&&(a=r))}return[s,a]}function z2(e,t){const n=e.length;let i=-1,r,s,a,o,u;if(t==null){for(;++i=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++is&&(r=s,o=i),a=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++is&&(r=s,o=i),a{r.set(s,e[s])}),r}function U2(e,t,n,i,r,s){if(!n&&n!==0)return s;const a=+n;let o=e[0],u=ce(e),l;us&&(a=r,r=s,s=a),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ro.replace(/\\(.)/g,"$1")):W(e));const i=e&&e.length,r=n&&n.get||F2,s=o=>r(t?[o]:bi(o));let a;if(!i)a=function(){return""};else if(i===1){const o=s(e[0]);a=function(u){return""+o(u)}}else{const o=e.map(s);a=function(u){let l=""+o[0](u),c=0;for(;++c{t={},n={},i=0},s=(a,o)=>(++i>e&&(n=t,t={},i=1),t[a]=o);return r(),{clear:r,has:a=>H(t,a)||H(n,a),get:a=>H(t,a)?t[a]:H(n,a)?s(a,n[a]):void 0,set:(a,o)=>H(t,a)?t[a]=o:s(a,o)}}function G2(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const a=i||new t.constructor(r+s);let o=0,u=0,l=0;for(;o0?n[u++]:t[o++];for(;o=0;)n+=e;return n}function H2(e,t,n,i){const r=n||" ",s=e+"",a=t-s.length;return a<=0?s:i==="left"?To(r,a)+s:i==="center"?To(r,~~(a/2))+s+To(r,Math.ceil(a/2)):s+To(r,a)}function _u(e){return e&&ce(e)-e[0]||0}function P(e){return D(e)?"["+e.map(P)+"]":j(e)||q(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function hm(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const P_=e=>ge(e)||xr(e)?e:Date.parse(e);function pm(e,t){return t=t||P_,e==null||e===""?null:t(e)}function gm(e){return e==null||e===""?null:e+""}function Ln(e){const t={},n=e.length;for(let i=0;i(e[t]=1+n,e),{});function ym(e){const t=W(e).slice(),n={};return t.length||S("Missing time unit."),t.forEach(r=>{H(rh,r)?n[r]=1:S(`Invalid time unit: ${r}.`)}),(n[Ve]||n[bt]?1:0)+(n[jt]||n[At]||n[qt]?1:0)+(n[hi]?1:0)>1&&S(`Incompatible time units: ${e}`),t.sort((r,s)=>rh[r]-rh[s]),t}const I_={[ft]:"%Y ",[jt]:"Q%q ",[At]:"%b ",[qt]:"%d ",[Ve]:"W%U ",[bt]:"%a ",[hi]:"%j ",[nn]:"%H:00",[rn]:"00:%M",[yn]:":%S",[Bn]:".%L",[`${ft}-${At}`]:"%Y-%m ",[`${ft}-${At}-${qt}`]:"%Y-%m-%d ",[`${nn}-${rn}`]:"%H:%M"};function X2(e,t){const n=se({},I_,t),i=ym(e),r=i.length;let s="",a=0,o,u;for(a=0;aa;--o)if(u=i.slice(a,o).join("-"),n[u]!=null){s+=n[u],a=o;break}return s.trim()}const rs=new Date;function bm(e){return rs.setFullYear(e),rs.setMonth(0),rs.setDate(1),rs.setHours(0,0,0,0),rs}function Y2(e){return J2(new Date(e))}function K2(e){return Ap(new Date(e))}function J2(e){return Hl.count(bm(e.getFullYear())-1,e)}function Ap(e){return v2.count(bm(e.getFullYear())-1,e)}function Cp(e){return bm(e).getDay()}function z_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(-1,t,n,i,r,s,a);return o.setFullYear(e),o}return new Date(e,t,n,i,r,s,a)}function Q2(e){return eC(new Date(e))}function Z2(e){return wp(new Date(e))}function eC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Gl.count(t-1,e)}function wp(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return x2.count(t-1,e)}function Fp(e){return rs.setTime(Date.UTC(e,0,1)),rs.getUTCDay()}function U_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(Date.UTC(-1,t,n,i,r,s,a));return o.setUTCFullYear(n.y),o}return new Date(Date.UTC(e,t,n,i,r,s,a))}function tC(e,t,n,i,r){const s=t||1,a=ce(e),o=(y,b,v)=>(v=v||y,j_(n[v],i[v],y===a&&s,b)),u=new Date,l=Ln(e),c=l[ft]?o(ft):kt(2012),f=l[At]?o(At):l[jt]?o(jt):cr,d=l[Ve]&&l[bt]?o(bt,1,Ve+bt):l[Ve]?o(Ve,1):l[bt]?o(bt,1):l[qt]?o(qt,1):l[hi]?o(hi,1):Ha,p=l[nn]?o(nn):cr,h=l[rn]?o(rn):cr,g=l[yn]?o(yn):cr,m=l[Bn]?o(Bn):cr;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),p(u),h(u),g(u),m(u))}}function j_(e,t,n,i){const r=n<=1?e:i?(s,a)=>i+n*Math.floor((e(s,a)-i)/n):(s,a)=>n*Math.floor(e(s,a)/n);return t?(s,a)=>t(r(s,a),a):r}function Ea(e,t,n){return t+e*7-(n+6)%7}const q_={[ft]:e=>e.getFullYear(),[jt]:e=>Math.floor(e.getMonth()/3),[At]:e=>e.getMonth(),[qt]:e=>e.getDate(),[nn]:e=>e.getHours(),[rn]:e=>e.getMinutes(),[yn]:e=>e.getSeconds(),[Bn]:e=>e.getMilliseconds(),[hi]:e=>J2(e),[Ve]:e=>Ap(e),[Ve+bt]:(e,t)=>Ea(Ap(e),e.getDay(),Cp(t)),[bt]:(e,t)=>Ea(1,e.getDay(),Cp(t))},W_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Cp(t))};function nC(e,t){return tC(e,t||1,q_,W_,z_)}const G_={[ft]:e=>e.getUTCFullYear(),[jt]:e=>Math.floor(e.getUTCMonth()/3),[At]:e=>e.getUTCMonth(),[qt]:e=>e.getUTCDate(),[nn]:e=>e.getUTCHours(),[rn]:e=>e.getUTCMinutes(),[yn]:e=>e.getUTCSeconds(),[Bn]:e=>e.getUTCMilliseconds(),[hi]:e=>eC(e),[Ve]:e=>wp(e),[bt]:(e,t)=>Ea(1,e.getUTCDay(),Fp(t)),[Ve+bt]:(e,t)=>Ea(wp(e),e.getUTCDay(),Fp(t))},H_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Fp(t))};function iC(e,t){return tC(e,t||1,G_,H_,U_)}const V_={[ft]:O5,[jt]:sx.every(3),[At]:sx,[Ve]:v2,[qt]:Hl,[bt]:Hl,[hi]:Hl,[nn]:D5,[rn]:k5,[yn]:A2,[Bn]:E2},X_={[ft]:T5,[jt]:ax.every(3),[At]:ax,[Ve]:x2,[qt]:Gl,[bt]:Gl,[hi]:Gl,[nn]:_5,[rn]:R5,[yn]:A2,[Bn]:E2};function Ja(e){return V_[e]}function Qa(e){return X_[e]}function rC(e,t,n){return e?e.offset(t,n):void 0}function sC(e,t,n){return rC(Ja(e),t,n)}function aC(e,t,n){return rC(Qa(e),t,n)}function oC(e,t,n,i){return e?e.range(t,n,i):void 0}function uC(e,t,n,i){return oC(Ja(e),t,n,i)}function lC(e,t,n,i){return oC(Qa(e),t,n,i)}const No=1e3,Mo=No*60,Lo=Mo*60,df=Lo*24,Y_=df*7,lx=df*30,Sp=df*365,cC=[ft,At,qt,nn,rn,yn,Bn],Bo=cC.slice(0,-1),Po=Bo.slice(0,-1),Io=Po.slice(0,-1),K_=Io.slice(0,-1),J_=[ft,Ve],cx=[ft,At],fC=[ft],go=[[Bo,1,No],[Bo,5,5*No],[Bo,15,15*No],[Bo,30,30*No],[Po,1,Mo],[Po,5,5*Mo],[Po,15,15*Mo],[Po,30,30*Mo],[Io,1,Lo],[Io,3,3*Lo],[Io,6,6*Lo],[Io,12,12*Lo],[K_,1,df],[J_,1,Y_],[cx,1,lx],[cx,3,3*lx],[fC,1,Sp]];function dC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(_u(t))/n;let r=em(o=>o[2]).right(go,i),s,a;return r===go.length?(s=fC,a=au(t[0]/Sp,t[1]/Sp,n)):r?(r=go[i/go[r-1][2]t[n]||(t[n]=e(n))}function Q_(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=Z_(i,r);const a=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+a}}function Z_(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function hC(e){const t=zo(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=ox(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return Q_(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,a){a=ox(a??",f");const o=au(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(a.precision==null)switch(a.type){case"s":return isNaN(l=G5(o,u))||(a.precision=l),n(a,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=W5(o,u))||(a.precision=l-(a.type==="e"));break}case"f":case"%":{isNaN(l=q5(o))||(a.precision=l-(a.type==="%")*2);break}}return t(a)}}}let $p;pC();function pC(){return $p=hC({format:Q5,formatPrefix:Z5})}function gC(e){return hC(J5(e))}function vc(e){return arguments.length?$p=gC(e):$p}function fx(e,t,n){n=n||{},j(n)||S(`Invalid time multi-format specifier: ${n}`);const i=t(yn),r=t(rn),s=t(nn),a=t(qt),o=t(Ve),u=t(At),l=t(jt),c=t(ft),f=e(n[Bn]||".%L"),d=e(n[yn]||":%S"),p=e(n[rn]||"%I:%M"),h=e(n[nn]||"%I %p"),g=e(n[qt]||n[bt]||"%a %d"),m=e(n[Ve]||"%b %d"),y=e(n[At]||"%B"),b=e(n[jt]||"%B"),v=e(n[ft]||"%Y");return A=>(i(A)q(i)?t(i):fx(t,Ja,i),utcFormat:i=>q(i)?n(i):fx(n,Qa,i),timeParse:zo(e.parse),utcParse:zo(e.utcParse)}}let kp;yC();function yC(){return kp=mC({format:M5,parse:P5,utcFormat:L5,utcParse:B5})}function bC(e){return mC(N5(e))}function ou(e){return arguments.length?kp=bC(e):kp}const Dp=(e,t)=>se({},e,t);function xC(e,t){const n=e?gC(e):vc(),i=t?bC(t):ou();return Dp(n,i)}function xm(e,t){const n=arguments.length;return n&&n!==2&&S("defaultLocale expects either zero or two arguments."),n?Dp(vc(e),ou(t)):Dp(vc(),ou())}function eT(){return pC(),yC(),xm()}const tT=/^(data:|([A-Za-z]+:)?\/\/)/,nT=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,iT=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,dx="file://";function rT(e,t){return n=>({options:n||{},sanitize:aT,load:sT,fileAccess:!1,file:oT(),http:lT(e)})}async function sT(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function aT(e,t){t=se({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,a;const o=nT.test(e.replace(iT,""));(e==null||typeof e!="string"||!o)&&S("Sanitize failure, invalid URI: "+P(e));const u=tT.test(e);return(a=t.baseURL)&&!u&&(!e.startsWith("/")&&!a.endsWith("/")&&(e="/"+e),e=a+e),s=(r=e.startsWith(dx))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(dx.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function oT(e){return uT}async function uT(){S("No file system access.")}function lT(e){return e?async function(t,n){const i=se({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?ae(s[r])?s[r]():s.text():S(s.status+""+s.statusText)}:cT}async function cT(){S("No HTTP fetch method available.")}const fT=e=>e!=null&&e===e,dT=e=>e==="true"||e==="false"||e===!0||e===!1,hT=e=>!Number.isNaN(Date.parse(e)),vC=e=>!Number.isNaN(+e)&&!(e instanceof Date),pT=e=>vC(e)&&Number.isInteger(+e),Op={boolean:hm,integer:xt,number:xt,date:pm,string:gm,unknown:$t},El=[dT,pT,vC,hT],gT=["boolean","integer","number","date"];function EC(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=El.length,r=El.map((s,a)=>a+1);for(let s=0,a=0,o,u;ss===0?a:s,0)-1]}function AC(e,t){return t.reduce((n,i)=>(n[i]=EC(e,i),n),{})}function hx(e){const t=function(n,i){const r={delimiter:e};return vm(n,i?se(i,r):r)};return t.responseType="text",t}function vm(e,t){return t.header&&(e=t.header.map(P).join(t.delimiter)+` +import{V as eh,p as Y3,a as K3,d as Jb,i as J3}from"./i18n-DtG3MAQ1.js";import{M as Q3,Z as on,ac as Z3,S as eR,a as Qb,O as tR,a2 as th,v as nR,$ as Zb,Q as ex,R as h2,aa as tx,T as nx,t as iR,X as rR}from"./index-BeNBoC9J.js";import{g as sR}from"./color-B9Nbxwff.js";import{f as aR,m as oR,a as uR,d as lR,b as p2,q as ix,c as cR,i as fR,l as dR,e as hR,s as pR,g as gR,u as mR,h as g2,j as yR,k as bR,n as xR,o as vR,r as ER,t as AR,v as CR,w as wR,x as FR,y as SR,z as $R,A as kR,B as DR,C as OR,D as RR,E as _R,F as TR,G as NR,H as MR,I as LR,J as BR,K as PR,p as IR,$ as zR,L as m2,S as UR,M as y2,a4 as b2,N as jR,O as qR,P as WR,Q as GR,R as HR,T as VR,U as XR,V as YR,W as KR,X as JR,Y as QR,Z as ZR,_ as e5,a0 as t5,a1 as n5,a2 as i5,a3 as r5,a5 as s5,a6 as a5,a7 as o5,a8 as u5,a9 as l5,aa as c5,ab as f5,ac as d5,ad as h5,ae as p5,af as rx,ag as g5,ah as m5,ai as y5,aj as b5,ak as x5,al as v5,am as E5,an as A5,ao as C5,ap as w5,aq as F5,ar as S5,as as $5,at as nh}from"./mollweide-XXUPULVr.js";import{c as sx,x as ax,v as Gl,l as Hl,w as x2,d as v2,p as E2,s as A2,o as k5,n as D5,q as O5,u as R5,r as _5,y as T5,z as N5,b as M5,A as L5,B as B5,C as P5,a as Yo,m as I5,t as z5,D as U5,E as j5}from"./time-BMaLdJ6b.js";import{b as em,t as au,p as q5,d as W5,e as G5,f as C2,l as H5,g as V5,h as mc,i as X5,j as Y5,k as K5}from"./linear-8mDBZVC7.js";import{c as J5,a as ox,f as Q5,b as Z5}from"./defaultLocale-CzDG__Ur.js";import{d as e_}from"./dsv-DB8NKgIY.js";import{r as Ms}from"./range-OtVwhkKS.js";import{o as w2,i as t_}from"./ordinal-BeghXfj9.js";import{d as n_}from"./arc-Bt_eNeYl.js";import{l as i_,V as tm,D as r_,E as s_,F as a_,G as o_,H as u_,I as l_,J as c_,K as f_,L as d_,M as h_,N as p_,O as g_,P as m_,Q as y_,S as b_,T as x_,U as v_,k as E_,W as yc,X as A_}from"./step-B-Gbak1k.js";import{h as C_,t as w_,a as F_,b as S_,c as $_}from"./index-BU4IRnz1.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./colors-Cc3OSVma.js";function k_(e,t,n,i){let r=t.getPropertyValue("--color-accent"),s=t.getPropertyValue("--body-text-color"),a=t.getPropertyValue("--border-color-primary"),o=t.fontFamily,u=t.getPropertyValue("--block-title-text-weight");const l=g=>g.endsWith("px")?parseFloat(g.slice(0,-2)):12;let c=l(t.getPropertyValue("--text-md")),f=l(t.getPropertyValue("--text-sm")),d={autosize:{type:"fit",contains:"padding"},axis:{labelFont:o,labelColor:s,titleFont:o,titleColor:s,tickColor:a,labelFontSize:f,gridColor:a,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",domain:!1,labelAngle:0},legend:{labelColor:s,labelFont:o,titleColor:s,titleFont:o,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",offset:2},title:{color:s,font:o,fontSize:c,fontWeight:u,anchor:"middle"},view:{stroke:a}};e.config=d;let p=e.encoding,h=e.layer;switch(n){case"scatter":e.config.mark={stroke:r},p.color&&p.color.type=="nominal"?p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)):p.color&&p.color.type=="quantitative"&&(p.color.scale.range=["#eff6ff","#1e3a8a"],p.color.scale.range.interpolate="hsl");break;case"line":e.config.mark={stroke:r,cursor:"crosshair"},h.forEach(g=>{g.encoding.color&&(g.encoding.color.scale.range=g.encoding.color.scale.range.map((m,y)=>ih(i,y)))});break;case"bar":e.config.mark={opacity:.8,fill:r},p.color&&(p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)));break}return e}function ih(e,t){let n=e[t%e.length];return n&&n in eh?eh[n]?.primary:n||eh[sR(t)].primary}function Vt(e,t,n){return e.fields=t||[],e.fname=n,e}function ze(e){return e==null?null:e.fname}function Et(e){return e==null?null:e.fields}function F2(e){return e.length===1?D_(e[0]):O_(e)}const D_=e=>function(t){return t[e]},O_=e=>{const t=e.length;return function(n){for(let i=0;ia?l():a=o+1:u==="["?(o>a&&l(),r=a=o+1):u==="]"&&(r||S("Access path missing open bracket: "+e),r>0&&l(),r=0,a=o+1)}return r&&S("Access path missing closing bracket: "+e),i&&S("Access path missing closing quote: "+e),o>a&&(o++,l()),t}function gn(e,t,n){const i=bi(e);return e=i.length===1?i[0]:e,Vt((n&&n.get||F2)(i),[e],t||e)}const Ru=gn("id"),$t=Vt(e=>e,[],"identity"),cr=Vt(()=>0,[],"zero"),Ha=Vt(()=>1,[],"one"),mn=Vt(()=>!0,[],"true"),ir=Vt(()=>!1,[],"false"),nm=new Set(Object.getOwnPropertyNames(Object.prototype));function R_(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const S2=0,im=1,rm=2,$2=3,k2=4;function sm(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R_,i=e||S2;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=im&&n(t||"error","ERROR",arguments),this},warn(){return i>=rm&&n(t||"warn","WARN",arguments),this},info(){return i>=$2&&n(t||"log","INFO",arguments),this},debug(){return i>=k2&&n(t||"log","DEBUG",arguments),this}}}var D=Array.isArray;function j(e){return e===Object(e)}const ux=e=>e!=="__proto__";function Va(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=__(i.signals,r.signals);else{const a=s==="legend"?{layout:1}:s==="style"?!0:null;Xa(i,s,r[s],a)}return i},{})}function Xa(e,t,n,i){if(!ux(t))return;let r,s;if(j(n)&&!D(n)){s=j(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Xa(s,r,n[r]):ux(r)&&(s[r]=n[r])}else e[t]=n}function __(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function ce(e){return e[e.length-1]}function xt(e){return e==null||e===""?null:+e}const D2=e=>t=>e*Math.exp(t),O2=e=>t=>Math.log(e*t),R2=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),_2=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,bc=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function cf(e,t,n,i){const r=n(e[0]),s=n(ce(e)),a=(s-r)*t;return[i(r-a),i(s-a)]}function T2(e,t){return cf(e,t,xt,$t)}function N2(e,t){var n=Math.sign(e[0]);return cf(e,t,O2(n),D2(n))}function M2(e,t,n){return cf(e,t,bc(n),bc(1/n))}function L2(e,t,n){return cf(e,t,R2(n),_2(n))}function ff(e,t,n,i,r){const s=i(e[0]),a=i(ce(e)),o=t!=null?i(t):(s+a)/2;return[r(o+(s-o)*n),r(o+(a-o)*n)]}function am(e,t,n){return ff(e,t,n,xt,$t)}function om(e,t,n){const i=Math.sign(e[0]);return ff(e,t,n,O2(i),D2(i))}function xc(e,t,n,i){return ff(e,t,n,bc(i),bc(1/i))}function um(e,t,n,i){return ff(e,t,n,R2(i),_2(i))}function B2(e){return 1+~~(new Date(e).getMonth()/3)}function P2(e){return 1+~~(new Date(e).getUTCMonth()/3)}function W(e){return e!=null?D(e)?e:[e]:[]}function I2(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ae(e){return typeof e=="function"}const T_="descending";function lm(e,t,n){n=n||{},t=W(t)||[];const i=[],r=[],s={},a=n.comparator||N_;return W(e).forEach((o,u)=>{o!=null&&(i.push(t[u]===T_?-1:1),r.push(o=ae(o)?o:gn(o,null,n)),(Et(o)||[]).forEach(l=>s[l]=1))}),r.length===0?null:Vt(a(r,i),Object.keys(s))}const Ya=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),N_=(e,t)=>e.length===1?M_(e[0],t[0]):L_(e,t,e.length),M_=(e,t)=>function(n,i){return Ya(e(n),e(i))*t},L_=(e,t,n)=>(t.push(0),function(i,r){let s,a=0,o=-1;for(;a===0&&++oe}function cm(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function se(e){for(let t,n,i=1,r=arguments.length;ia&&(a=r))}else{for(r=t(e[n]);na&&(a=r))}return[s,a]}function z2(e,t){const n=e.length;let i=-1,r,s,a,o,u;if(t==null){for(;++i=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++is&&(r=s,o=i),a=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++is&&(r=s,o=i),a{r.set(s,e[s])}),r}function U2(e,t,n,i,r,s){if(!n&&n!==0)return s;const a=+n;let o=e[0],u=ce(e),l;us&&(a=r,r=s,s=a),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ro.replace(/\\(.)/g,"$1")):W(e));const i=e&&e.length,r=n&&n.get||F2,s=o=>r(t?[o]:bi(o));let a;if(!i)a=function(){return""};else if(i===1){const o=s(e[0]);a=function(u){return""+o(u)}}else{const o=e.map(s);a=function(u){let l=""+o[0](u),c=0;for(;++c{t={},n={},i=0},s=(a,o)=>(++i>e&&(n=t,t={},i=1),t[a]=o);return r(),{clear:r,has:a=>H(t,a)||H(n,a),get:a=>H(t,a)?t[a]:H(n,a)?s(a,n[a]):void 0,set:(a,o)=>H(t,a)?t[a]=o:s(a,o)}}function G2(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const a=i||new t.constructor(r+s);let o=0,u=0,l=0;for(;o0?n[u++]:t[o++];for(;o=0;)n+=e;return n}function H2(e,t,n,i){const r=n||" ",s=e+"",a=t-s.length;return a<=0?s:i==="left"?To(r,a)+s:i==="center"?To(r,~~(a/2))+s+To(r,Math.ceil(a/2)):s+To(r,a)}function _u(e){return e&&ce(e)-e[0]||0}function P(e){return D(e)?"["+e.map(P)+"]":j(e)||q(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function hm(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const P_=e=>ge(e)||xr(e)?e:Date.parse(e);function pm(e,t){return t=t||P_,e==null||e===""?null:t(e)}function gm(e){return e==null||e===""?null:e+""}function Ln(e){const t={},n=e.length;for(let i=0;i(e[t]=1+n,e),{});function ym(e){const t=W(e).slice(),n={};return t.length||S("Missing time unit."),t.forEach(r=>{H(rh,r)?n[r]=1:S(`Invalid time unit: ${r}.`)}),(n[Ve]||n[bt]?1:0)+(n[jt]||n[At]||n[qt]?1:0)+(n[hi]?1:0)>1&&S(`Incompatible time units: ${e}`),t.sort((r,s)=>rh[r]-rh[s]),t}const I_={[ft]:"%Y ",[jt]:"Q%q ",[At]:"%b ",[qt]:"%d ",[Ve]:"W%U ",[bt]:"%a ",[hi]:"%j ",[nn]:"%H:00",[rn]:"00:%M",[yn]:":%S",[Bn]:".%L",[`${ft}-${At}`]:"%Y-%m ",[`${ft}-${At}-${qt}`]:"%Y-%m-%d ",[`${nn}-${rn}`]:"%H:%M"};function X2(e,t){const n=se({},I_,t),i=ym(e),r=i.length;let s="",a=0,o,u;for(a=0;aa;--o)if(u=i.slice(a,o).join("-"),n[u]!=null){s+=n[u],a=o;break}return s.trim()}const rs=new Date;function bm(e){return rs.setFullYear(e),rs.setMonth(0),rs.setDate(1),rs.setHours(0,0,0,0),rs}function Y2(e){return J2(new Date(e))}function K2(e){return Ap(new Date(e))}function J2(e){return Hl.count(bm(e.getFullYear())-1,e)}function Ap(e){return v2.count(bm(e.getFullYear())-1,e)}function Cp(e){return bm(e).getDay()}function z_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(-1,t,n,i,r,s,a);return o.setFullYear(e),o}return new Date(e,t,n,i,r,s,a)}function Q2(e){return eC(new Date(e))}function Z2(e){return wp(new Date(e))}function eC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Gl.count(t-1,e)}function wp(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return x2.count(t-1,e)}function Fp(e){return rs.setTime(Date.UTC(e,0,1)),rs.getUTCDay()}function U_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(Date.UTC(-1,t,n,i,r,s,a));return o.setUTCFullYear(n.y),o}return new Date(Date.UTC(e,t,n,i,r,s,a))}function tC(e,t,n,i,r){const s=t||1,a=ce(e),o=(y,b,v)=>(v=v||y,j_(n[v],i[v],y===a&&s,b)),u=new Date,l=Ln(e),c=l[ft]?o(ft):kt(2012),f=l[At]?o(At):l[jt]?o(jt):cr,d=l[Ve]&&l[bt]?o(bt,1,Ve+bt):l[Ve]?o(Ve,1):l[bt]?o(bt,1):l[qt]?o(qt,1):l[hi]?o(hi,1):Ha,p=l[nn]?o(nn):cr,h=l[rn]?o(rn):cr,g=l[yn]?o(yn):cr,m=l[Bn]?o(Bn):cr;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),p(u),h(u),g(u),m(u))}}function j_(e,t,n,i){const r=n<=1?e:i?(s,a)=>i+n*Math.floor((e(s,a)-i)/n):(s,a)=>n*Math.floor(e(s,a)/n);return t?(s,a)=>t(r(s,a),a):r}function Ea(e,t,n){return t+e*7-(n+6)%7}const q_={[ft]:e=>e.getFullYear(),[jt]:e=>Math.floor(e.getMonth()/3),[At]:e=>e.getMonth(),[qt]:e=>e.getDate(),[nn]:e=>e.getHours(),[rn]:e=>e.getMinutes(),[yn]:e=>e.getSeconds(),[Bn]:e=>e.getMilliseconds(),[hi]:e=>J2(e),[Ve]:e=>Ap(e),[Ve+bt]:(e,t)=>Ea(Ap(e),e.getDay(),Cp(t)),[bt]:(e,t)=>Ea(1,e.getDay(),Cp(t))},W_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Cp(t))};function nC(e,t){return tC(e,t||1,q_,W_,z_)}const G_={[ft]:e=>e.getUTCFullYear(),[jt]:e=>Math.floor(e.getUTCMonth()/3),[At]:e=>e.getUTCMonth(),[qt]:e=>e.getUTCDate(),[nn]:e=>e.getUTCHours(),[rn]:e=>e.getUTCMinutes(),[yn]:e=>e.getUTCSeconds(),[Bn]:e=>e.getUTCMilliseconds(),[hi]:e=>eC(e),[Ve]:e=>wp(e),[bt]:(e,t)=>Ea(1,e.getUTCDay(),Fp(t)),[Ve+bt]:(e,t)=>Ea(wp(e),e.getUTCDay(),Fp(t))},H_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Fp(t))};function iC(e,t){return tC(e,t||1,G_,H_,U_)}const V_={[ft]:O5,[jt]:sx.every(3),[At]:sx,[Ve]:v2,[qt]:Hl,[bt]:Hl,[hi]:Hl,[nn]:D5,[rn]:k5,[yn]:A2,[Bn]:E2},X_={[ft]:T5,[jt]:ax.every(3),[At]:ax,[Ve]:x2,[qt]:Gl,[bt]:Gl,[hi]:Gl,[nn]:_5,[rn]:R5,[yn]:A2,[Bn]:E2};function Ja(e){return V_[e]}function Qa(e){return X_[e]}function rC(e,t,n){return e?e.offset(t,n):void 0}function sC(e,t,n){return rC(Ja(e),t,n)}function aC(e,t,n){return rC(Qa(e),t,n)}function oC(e,t,n,i){return e?e.range(t,n,i):void 0}function uC(e,t,n,i){return oC(Ja(e),t,n,i)}function lC(e,t,n,i){return oC(Qa(e),t,n,i)}const No=1e3,Mo=No*60,Lo=Mo*60,df=Lo*24,Y_=df*7,lx=df*30,Sp=df*365,cC=[ft,At,qt,nn,rn,yn,Bn],Bo=cC.slice(0,-1),Po=Bo.slice(0,-1),Io=Po.slice(0,-1),K_=Io.slice(0,-1),J_=[ft,Ve],cx=[ft,At],fC=[ft],go=[[Bo,1,No],[Bo,5,5*No],[Bo,15,15*No],[Bo,30,30*No],[Po,1,Mo],[Po,5,5*Mo],[Po,15,15*Mo],[Po,30,30*Mo],[Io,1,Lo],[Io,3,3*Lo],[Io,6,6*Lo],[Io,12,12*Lo],[K_,1,df],[J_,1,Y_],[cx,1,lx],[cx,3,3*lx],[fC,1,Sp]];function dC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(_u(t))/n;let r=em(o=>o[2]).right(go,i),s,a;return r===go.length?(s=fC,a=au(t[0]/Sp,t[1]/Sp,n)):r?(r=go[i/go[r-1][2]t[n]||(t[n]=e(n))}function Q_(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=Z_(i,r);const a=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+a}}function Z_(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function hC(e){const t=zo(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=ox(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return Q_(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,a){a=ox(a??",f");const o=au(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(a.precision==null)switch(a.type){case"s":return isNaN(l=G5(o,u))||(a.precision=l),n(a,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=W5(o,u))||(a.precision=l-(a.type==="e"));break}case"f":case"%":{isNaN(l=q5(o))||(a.precision=l-(a.type==="%")*2);break}}return t(a)}}}let $p;pC();function pC(){return $p=hC({format:Q5,formatPrefix:Z5})}function gC(e){return hC(J5(e))}function vc(e){return arguments.length?$p=gC(e):$p}function fx(e,t,n){n=n||{},j(n)||S(`Invalid time multi-format specifier: ${n}`);const i=t(yn),r=t(rn),s=t(nn),a=t(qt),o=t(Ve),u=t(At),l=t(jt),c=t(ft),f=e(n[Bn]||".%L"),d=e(n[yn]||":%S"),p=e(n[rn]||"%I:%M"),h=e(n[nn]||"%I %p"),g=e(n[qt]||n[bt]||"%a %d"),m=e(n[Ve]||"%b %d"),y=e(n[At]||"%B"),b=e(n[jt]||"%B"),v=e(n[ft]||"%Y");return A=>(i(A)q(i)?t(i):fx(t,Ja,i),utcFormat:i=>q(i)?n(i):fx(n,Qa,i),timeParse:zo(e.parse),utcParse:zo(e.utcParse)}}let kp;yC();function yC(){return kp=mC({format:M5,parse:P5,utcFormat:L5,utcParse:B5})}function bC(e){return mC(N5(e))}function ou(e){return arguments.length?kp=bC(e):kp}const Dp=(e,t)=>se({},e,t);function xC(e,t){const n=e?gC(e):vc(),i=t?bC(t):ou();return Dp(n,i)}function xm(e,t){const n=arguments.length;return n&&n!==2&&S("defaultLocale expects either zero or two arguments."),n?Dp(vc(e),ou(t)):Dp(vc(),ou())}function eT(){return pC(),yC(),xm()}const tT=/^(data:|([A-Za-z]+:)?\/\/)/,nT=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,iT=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,dx="file://";function rT(e,t){return n=>({options:n||{},sanitize:aT,load:sT,fileAccess:!1,file:oT(),http:lT(e)})}async function sT(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function aT(e,t){t=se({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,a;const o=nT.test(e.replace(iT,""));(e==null||typeof e!="string"||!o)&&S("Sanitize failure, invalid URI: "+P(e));const u=tT.test(e);return(a=t.baseURL)&&!u&&(!e.startsWith("/")&&!a.endsWith("/")&&(e="/"+e),e=a+e),s=(r=e.startsWith(dx))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(dx.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function oT(e){return uT}async function uT(){S("No file system access.")}function lT(e){return e?async function(t,n){const i=se({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?ae(s[r])?s[r]():s.text():S(s.status+""+s.statusText)}:cT}async function cT(){S("No HTTP fetch method available.")}const fT=e=>e!=null&&e===e,dT=e=>e==="true"||e==="false"||e===!0||e===!1,hT=e=>!Number.isNaN(Date.parse(e)),vC=e=>!Number.isNaN(+e)&&!(e instanceof Date),pT=e=>vC(e)&&Number.isInteger(+e),Op={boolean:hm,integer:xt,number:xt,date:pm,string:gm,unknown:$t},El=[dT,pT,vC,hT],gT=["boolean","integer","number","date"];function EC(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=El.length,r=El.map((s,a)=>a+1);for(let s=0,a=0,o,u;ss===0?a:s,0)-1]}function AC(e,t){return t.reduce((n,i)=>(n[i]=EC(e,i),n),{})}function hx(e){const t=function(n,i){const r={delimiter:e};return vm(n,i?se(i,r):r)};return t.responseType="text",t}function vm(e,t){return t.header&&(e=t.header.map(P).join(t.delimiter)+` `+e),e_(t.delimiter).parse(e+"")}vm.responseType="text";function mT(e){return typeof Buffer=="function"&&ae(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Em(e,t){const n=t&&t.property?gn(t.property):$t;return j(e)&&!mT(e)?yT(n(e),t):n(JSON.parse(e))}Em.responseType="json";function yT(e,t){return!D(e)&&j2(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const bT={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function CC(e,t){let n,i,r,s;return e=Em(e,t),t&&t.feature?(n=aR,r=t.feature):t&&t.mesh?(n=oR,r=t.mesh,s=bT[t.filter]):S("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):S("Invalid TopoJSON object: "+r),i&&i.features||[i]}CC.responseType="json";const Vl={dsv:vm,csv:hx(","),tsv:hx(" "),json:Em,topojson:CC};function Am(e,t){return arguments.length>1?(Vl[e]=t,this):H(Vl,e)?Vl[e]:null}function wC(e){const t=Am(e);return t&&t.responseType||"text"}function FC(e,t,n,i){t=t||{};const r=Am(t.type||"json");return r||S("Unknown data format type: "+t.type),e=r(e,t),t.parse&&xT(e,t.parse,n,i),H(e,"columns")&&delete e.columns,e}function xT(e,t,n,i){if(!e.length)return;const r=ou();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),a,o,u,l,c,f;t==="auto"&&(t=AC(e,s)),s=Object.keys(t);const d=s.map(p=>{const h=t[p];let g,m;if(h&&(h.startsWith("date:")||h.startsWith("utc:")))return g=h.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!Op[h])throw Error("Illegal format pattern: "+p+":"+h);return Op[h]});for(u=0,c=e.length,f=s.length;u{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const a=n.indexOf(r);a>=0&&n.splice(a,1)}return n},n}async function Xl(e,t){try{await t(e)}catch(n){e.error(n)}}const SC=Symbol("vega_id");let vT=1;function gf(e){return!!(e&&ee(e))}function ee(e){return e[SC]}function $C(e,t){return e[SC]=t,e}function be(e){const t=e===Object(e)?e:{data:e};return ee(t)?t:$C(t,vT++)}function Cm(e){return mf(e,be({}))}function mf(e,t){for(const n in e)t[n]=e[n];return t}function kC(e,t){return $C(t,ee(e))}function Ls(e,t){return e?t?(n,i)=>e(n,i)||ee(t(n))-ee(t(i)):(n,i)=>e(n,i)||ee(n)-ee(i):null}function DC(e){return e&&e.constructor===Bs}function Bs(){const e=[],t=[],n=[],i=[],r=[];let s=null,a=!1;return{constructor:Bs,insert(o){const u=W(o),l=u.length;for(let c=0;c{h(b)&&(l[ee(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,h,p.value),o.modifies(h));for(f=0,d=r.length;f{h(b)&&l[ee(b)]>0&&y(b,p.field,p.value)}),o.modifies(p.field);if(a)o.mod=t.length||i.length?u.filter(b=>l[ee(b)]>0):u.slice();else for(m in c)o.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&o.clean(!0),o}}}const Yl="_:mod:_";function yf(){Object.defineProperty(this,Yl,{writable:!0,value:{}})}yf.prototype={set(e,t,n,i){const r=this,s=r[e],a=r[Yl];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,a[t+":"+e]=-1,a[e]=-1):(s!==n||i)&&(r[e]=n,a[e]=D(n)?1+n.length:-1),r},modified(e,t){const n=this[Yl];if(arguments.length){if(D(e)){for(let i=0;i=0?t+1{p instanceof $e?(p!==this&&(t&&p.targets().add(this),s.push(p)),r.push({op:p,name:f,index:d})):i.set(f,d,p)};for(a in e)if(o=e[a],a===AT)W(o).forEach(f=>{f instanceof $e?f!==this&&(f.targets().add(this),s.push(f)):S("Pulse parameters must be operator instances.")}),this.source=o;else if(D(o))for(i.set(a,-1,Array(u=o.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=rr();return this.targets().add(rr(null,null,cm(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(rr(null,null,()=>n=!0)),t.targets().add(rr(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=mn,this._targets=null}};function DT(e,t,n,i){const r=this,s=rr(n,i),a=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let o;typeof e=="string"&&typeof document<"u"?o=document.querySelectorAll(e):o=W(e);const u=o.length;for(let l=0;lt=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const MT={skip:!0};function LT(e,t,n,i,r){return(e instanceof $e?PT:BT)(this,e,t,n,i,r),this}function BT(e,t,n,i,r,s){const a=se({},s,MT);let o,u;ae(n)||(n=kt(n)),i===void 0?o=l=>e.touch(n(l)):ae(i)?(u=new $e(null,i,r,!1),o=l=>{u.evaluate(l);const c=n(l),f=u.value;DC(f)?e.pulse(c,f,s):e.update(c,f,a)}):o=l=>e.update(n(l),i,a),t.apply(o)}function PT(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const a=s||{},o=new $e(null,IT(n,i),r,!1);o.modified(a.force),o.rank=t.rank,t.targets().add(o),n&&(o.skip(!0),o.value=n.value,o.targets().add(n),e.connect(n,[o]))}}function IT(e,t){return t=ae(t)?t:kt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function zT(e){e.rank=++this._rank}function UT(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&S("Cycle detected in dataflow graph.")}const Ec={},ni=1,or=2,Ti=4,jT=ni|or,gx=ni|Ti,Qs=ni|or|Ti,mx=8,mo=16,yx=32,bx=64;function vr(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function sh(e,t){const n=[];return ar(e,t,i=>n.push(i)),n}function xx(e,t){const n={};return e.visit(t,i=>{n[ee(i)]=1}),i=>n[ee(i)]?null:i}function Al(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}vr.prototype={StopPropagation:Ec,ADD:ni,REM:or,MOD:Ti,ADD_REM:jT,ADD_MOD:gx,ALL:Qs,REFLOW:mx,SOURCE:mo,NO_SOURCE:yx,NO_FIELDS:bx,fork(e){return new vr(this.dataflow).init(this,e)},clone(){const e=this.fork(Qs);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(Qs|mo)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new vr(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&bx)&&(n.fields=e.fields),t&ni?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&or?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Ti?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&yx?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||Qs;return t&ni&&this.add.length||t&or&&this.rem.length||t&Ti&&this.mod.length},reflow(e){if(e)return this.fork(Qs).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ti,xx(this,ni))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return D(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?D(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&ni&&(n.addF=Al(n.addF,t)),e&or&&(n.remF=Al(n.remF,t)),e&Ti&&(n.modF=Al(n.modF,t)),e&mo&&(n.srcF=Al(n.srcF,t)),n},materialize(e){e=e||Qs;const t=this;return e&ni&&t.addF&&(t.add=sh(t.add,t.addF),t.addF=null),e&or&&t.remF&&(t.rem=sh(t.rem,t.remF),t.remF=null),e&Ti&&t.modF&&(t.mod=sh(t.mod,t.modF),t.modF=null),e&mo&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&mo)return ar(n.source,n.srcF,i),n;e&ni&&ar(n.add,n.addF,i),e&or&&ar(n.rem,n.remF,i),e&Ti&&ar(n.mod,n.modF,i);const r=n.source;if(e&mx&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ar(r,xx(n,gx),i):ar(r,n.srcF,i))}return n}};function wm(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===t){if(a.fields){const o=r.fields||(r.fields={});for(const u in a.fields)o[u]=1}a.changed(r.ADD)&&(s|=r.ADD),a.changed(r.REM)&&(s|=r.REM),a.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}z(wm,vr,{fork(e){const t=new vr(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?D(e)?e.some(i=>n[i]):n[e]:0},filter(){S("MultiPulse does not support filtering.")},materialize(){S("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=pf(Ru);let a=0,o,u,l;try{for(;i._heap.size()>0;){if(o=i._heap.pop(),o.rank!==o.qrank){i._enqueue(o,!0);continue}u=o.run(i._getPulse(o,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Ec),u!==Ec&&o._targets&&o._targets.forEach(c=>i._enqueue(c)),++a}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${a} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function WT(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function GT(e,t,n){return this._pulse?OC(this):(this.evaluate(e,t,n),this)}function HT(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function OC(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function VT(e,t){const n=e.stampr.pulse),t):this._input[e.id]||YT(this._pulse,n&&n.pulse)}function YT(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ec&&(e.source=t.source),e)}const Fm={skip:!1,force:!1};function KT(e,t){const n=t||Fm;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function JT(e,t,n){const i=n||Fm;return(e.set(t)||i.force)&&this.touch(e,i),this}function QT(e,t,n){this.touch(e,n||Fm);const i=new vr(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function ZT(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),RC(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,eN(t,0,e)):i=n,i}}}function RC(e,t,n,i){let r,s;const a=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(a,r)<0){e[n]=r,n=s;continue}break}return e[n]=a}function eN(e,t,n){const i=t,r=e.length,s=e[t];let a=(t<<1)+1,o;for(;a=0&&(a=o),e[t]=e[a],t=a,a=(t<<1)+1;return e[t]=s,RC(e,i,t,n)}function pa(){this.logger(sm()),this.logLevel(im),this._clock=0,this._rank=0,this._locale=xm();try{this._loader=hf()}catch{}this._touched=pf(Ru),this._input={},this._pulse=null,this._heap=ZT((e,t)=>e.qrank-t.qrank),this._postrun=[]}function yo(e){return function(){return this._log[e].apply(this,arguments)}}pa.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:yo("error"),warn:yo("warn"),info:yo("info"),debug:yo("debug"),logLevel:yo("level"),cleanThreshold:1e4,add:ST,connect:$T,rank:zT,rerank:UT,pulse:QT,touch:KT,update:JT,changeset:Bs,ingest:RT,parse:OT,preload:TT,request:_T,events:DT,on:LT,evaluate:qT,run:GT,runAsync:WT,runAfter:HT,_enqueue:VT,_getPulse:XT};function F(e,t){$e.call(this,e,null,t)}z(F,$e,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Aa={};function _C(e){const t=TC(e);return t&&t.Definition||null}function TC(e){return e=e&&e.toLowerCase(),H(Aa,e)?Aa[e]:null}function*NC(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Sm(e,t,n){const i=Float64Array.from(NC(e,n));return i.sort(C2),t.map(r=>uR(i,r))}function $m(e,t){return Sm(e,[.25,.5,.75],t)}function km(e,t){const n=e.length,i=lR(e,t),r=$m(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function MC(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],a=e.extent[1],o,u,l,c,f,d;const p=e.span||a-s||Math.abs(s)||1;if(e.step)o=e.step;else if(e.steps){for(c=p/t,f=0,d=e.steps.length;ft;)o*=n;for(f=0,d=r.length;f=l&&p/c<=t&&(o=c)}c=Math.log(o);const h=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-h-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/o+g)*o,s=sd);const r=e.length,s=new Float64Array(r);let a=0,o=1,u=i(e[0]),l=u,c=u+t,f;for(;o=c){for(l=(u+l)/2;a>1);ar;)e[a--]=e[i]}i=r,r=s}return e}function iN(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function rN(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(a){return arguments.length?(n=a||0,r=i-n,s):n},max(a){return arguments.length?(i=a||0,r=i-n,s):i},sample(){return n+Math.floor(r*bn())},pdf(a){return a===Math.floor(a)&&a>=n&&a=i?1:(o-n+1)/r},icdf(a){return a>=0&&a<=1?n-1+Math.floor(a*r):NaN}};return s.min(e).max(t)}const PC=Math.sqrt(2*Math.PI),sN=Math.SQRT2;let bo=NaN;function xf(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(bo===bo)n=bo,bo=NaN;else{do n=bn()*2-1,i=bn()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,bo=i*s}return e+n*t}function Dm(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*PC)}function vf(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const a=Math.exp(-r*r/2);let o;r<7.07106781186547?(o=.0352624965998911*r+.700383064443688,o=o*r+6.37396220353165,o=o*r+33.912866078383,o=o*r+112.079291497871,o=o*r+221.213596169931,o=o*r+220.206867912376,s=a*o,o=.0883883476483184*r+1.75566716318264,o=o*r+16.064177579207,o=o*r+86.7807322029461,o=o*r+296.564248779674,o=o*r+637.333633378831,o=o*r+793.826512519948,o=o*r+440.413735824752,s=s/o):(o=r+.65,o=r+4/o,o=r+3/o,o=r+2/o,o=r+1/o,s=a/o/2.506628274631)}return i>0?1-s:s}function Ef(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*sN*aN(2*e-1)}function aN(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Om(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>xf(n,i),pdf:s=>Dm(s,n,i),cdf:s=>vf(s,n,i),icdf:s=>Ef(s,n,i)};return r.mean(e).stdev(t)}function Rm(e,t){const n=Om();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=km(e)),r):t},sample(){return e[~~(bn()*i)]+t*n.sample()},pdf(s){let a=0,o=0;for(;o_m(n,i),pdf:s=>Tm(s,n,i),cdf:s=>Nm(s,n,i),icdf:s=>Mm(s,n,i)};return r.mean(e).stdev(t)}function zC(e,t){let n=0,i;function r(a){const o=[];let u=0,l;for(l=0;l=t&&e<=n?1/(n-t):0}function Pm(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function Im(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function UC(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Lm(n,i),pdf:s=>Bm(s,n,i),cdf:s=>Pm(s,n,i),icdf:s=>Im(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function zm(e,t,n){let i=0,r=0;for(const s of e){const a=n(s);t(s)==null||a==null||isNaN(a)||(i+=(a-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Tu(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Af(e,t,n,i){e=e.filter(p=>{let h=t(p),g=n(p);return h!=null&&(h=+h)>=h&&g!=null&&(g=+g)>=g}),i&&e.sort((p,h)=>t(p)-t(h));const r=e.length,s=new Float64Array(r),a=new Float64Array(r);let o=0,u=0,l=0,c,f,d;for(d of e)s[o]=c=+t(d),a[o]=f=+n(d),++o,u+=(c-u)/o,l+=(f-l)/o;for(o=0;o=s&&a!=null&&(a=+a)>=a&&i(s,a,++r)}function Za(e,t,n,i,r){let s=0,a=0;return Nu(e,t,n,(o,u)=>{const l=u-r(o),c=u-i;s+=l*l,a+=c*c}),1-s/a}function Um(e,t,n){let i=0,r=0,s=0,a=0,o=0;Nu(e,t,n,(c,f)=>{++o,i+=(c-i)/o,r+=(f-r)/o,s+=(c*f-s)/o,a+=(c*c-a)/o});const u=Tu(i,r,s,a),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Za(e,t,n,r,l)}}function jC(e,t,n){let i=0,r=0,s=0,a=0,o=0;Nu(e,t,n,(c,f)=>{++o,c=Math.log(c),i+=(c-i)/o,r+=(f-r)/o,s+=(c*f-s)/o,a+=(c*c-a)/o});const u=Tu(i,r,s,a),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Za(e,t,n,r,l)}}function qC(e,t,n){const[i,r,s,a]=Af(e,t,n);let o=0,u=0,l=0,c=0,f=0,d,p,h;Nu(e,t,n,(b,v)=>{d=i[f++],p=Math.log(v),h=d*v,o+=(v*p-o)/f,u+=(h-u)/f,l+=(h*p-l)/f,c+=(d*h-c)/f});const[g,m]=Tu(u/a,o/a,l/a,c/a),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Za(e,t,n,a,y)}}function WC(e,t,n){let i=0,r=0,s=0,a=0,o=0,u=0;Nu(e,t,n,(f,d)=>{const p=Math.log(f),h=Math.log(d);++u,i+=(p-i)/u,r+=(h-r)/u,s+=(p*h-s)/u,a+=(p*p-a)/u,o+=(d-o)/u});const l=Tu(i,r,s,a),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Za(e,t,n,o,c)}}function jm(e,t,n){const[i,r,s,a]=Af(e,t,n),o=i.length;let u=0,l=0,c=0,f=0,d=0,p,h,g,m;for(p=0;p(x=x-s,v*x*x+A*x+E+a);return{coef:[E-A*s+v*s*s+a,A-2*v*s,v],predict:C,rSquared:Za(e,t,n,a,C)}}function GC(e,t,n,i){if(i===0)return zm(e,t,n);if(i===1)return Um(e,t,n);if(i===2)return jm(e,t,n);const[r,s,a,o]=Af(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,p,h,g,m;for(d=0;d{v-=a;let A=o+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(o=t[s],u=1,r[s]+=o,a=1;a<=s;++a)u*=(s+1-a)/a,r[s-a]+=o*Math.pow(n,a)*u;return r[0]+=i,r}function uN(e){const t=e.length-1,n=[];let i,r,s,a,o;for(i=0;iMath.abs(e[i][a])&&(a=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(o=0,s=r+1;sr[v]-y?b:v;let E=0,C=0,x=0,w=0,R=0;const L=1/Math.abs(r[A]-y||1);for(let de=b;de<=v;++de){const N=r[de],O=s[de],I=lN(Math.abs(y-N)*L)*d[de],G=N*I;E+=I,C+=G,x+=O*I,w+=O*G,R+=N*G}const[J,ne]=Tu(C/E,x/E,w/E,R/E);c[m]=J+ne*y,f[m]=Math.abs(s[m]-c[m]),cN(r,m+1,h)}if(p===vx)break;const g=p2(f);if(Math.abs(g)=1?Ex:(b=1-y*y)*b}return fN(r,c,a,o)}function lN(e){return(e=1-e*e*e)*e*e}function cN(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function fN(e,t,n,i){const r=e.length,s=[];let a=0,o=0,u=[],l;for(;a[g,e(g)],s=t[0],a=t[1],o=a-s,u=o/i,l=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*o))}let f=l[0],d=c[c.length-1];const p=1/o,h=hN(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&pN(f,g,d,p,h)>dN?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function hN(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=a)}return 1/(i-n)}function pN(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),a=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-a)}function gN(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},mN={init:ah,add:ah,rem:ah,idx:0},uu={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Mu=Object.keys(uu).filter(e=>e!=="__count__");function yN(e,t){return(n,i)=>se({name:e,aggregate_param:i,out:n||e},mN,t)}[...Mu,"__count__"].forEach(e=>{uu[e]=yN(e,uu[e])});function XC(e,t,n){return uu[e](n,t)}function YC(e,t){return e.idx-t.idx}function bN(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=uu[r]())})};return e.forEach(n),Object.values(t).sort(YC)}function xN(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function vN(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function EN(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function AN(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function KC(e,t){const n=t||$t,i=bN(e),r=e.slice().sort(YC);function s(a){this._ops=i,this._out=r,this.cell=a,this.init()}return s.prototype.init=xN,s.prototype.add=vN,s.prototype.rem=EN,s.prototype.set=AN,s.prototype.get=n,s.fields=e.map(a=>a.out),s}function qm(e){this._key=e?gn(e):ee,this.reset()}const pt=qm.prototype;pt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};pt.add=function(e){this._add.push(e)};pt.rem=function(e){this._rem.push(e)};pt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),a={};let o,u,l;for(o=0;o=0;)s=e(t[i])+"",H(n,s)||(n[s]=1,++r);return r};pt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=z2(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};pt.argmin=function(e){return this.extent(e)[0]||{}};pt.argmax=function(e){return this.extent(e)[1]||{}};pt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};pt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};pt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=$m(this.values(),e),this._get=e),this._q};pt.q1=function(e){return this.quartile(e)[0]};pt.q2=function(e){return this.quartile(e)[1]};pt.q3=function(e){return this.quartile(e)[2]};pt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=LC(this.values(),1e3,.05,e),this._get=e),this._ci};pt.ci0=function(e){return this.ci(e)[0]};pt.ci1=function(e){return this.ci(e)[1]};function wr(e){F.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}wr.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Mu},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};z(wr,F,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(o){let u,l,c,f;for(u in o)for(c=o[u].tuple,l=0;l{const v=ze(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Rp(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],a=e.ops||["count"],o=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,p,h,g,m,y;for(l!==a.length&&S("Unmatched number of fields and aggregate ops."),y=0;yKC(b,b.field)),Object.create(null)},cellkey:Rp(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[o]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[o]=i(c)),t.modifies(n?a:o)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=MC(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,a,o;(a=e.anchor)!=null&&(o=a-(r+i*Math.floor((a-r)/i)),r+=o,s+=o);const u=function(l){let c=xt(t(l));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(CN+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=Vt(u,Et(t),e.name||"bin_"+ze(t))}});function JC(e,t,n){const i=e;let r=t||[],s=n||[],a={},o=0;return{add:u=>s.push(u),remove:u=>a[i(u)]=++o,size:()=>r.length,data:(u,l)=>(o&&(r=r.filter(c=>!a[i(c)]),a={},o=0),l&&u&&r.sort(u),s.length&&(r=u?G2(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Gm(e){F.call(this,[],e)}Gm.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};z(Gm,F,{transform(e,t){const n=t.fork(t.ALL),i=JC(ee,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(Ls(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function QC(e){$e.call(this,null,wN,e)}z(QC,$e);function wN(e){return this.value&&!e.modified()?this.value:lm(e.fields,e.orders)}function Hm(e){F.call(this,null,e)}Hm.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function FN(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}z(Hm,F,{transform(e,t){const n=f=>d=>{for(var p=FN(o(d),e.case,s)||[],h,g=0,m=p.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let o,u,l;for(o in n)u=i[o],l=n[o]||0,!u&&l?(i[o]=u=be({}),u[r]=o,u[s]=l,a.add.push(u)):l===0?(u&&a.rem.push(u),n[o]=null,i[o]=null):u[s]!==l&&(u[s]=l,a.mod.push(u));return a.modifies(t)}});function Vm(e){F.call(this,null,e)}Vm.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};z(Vm,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let o=this.value;return a?(o&&(n.rem=o),o=t.materialize(t.SOURCE).source,n.add=this.value=SN(o,r,s,e.filter||mn)):n.mod=o,n.source=this.value,n.modifies(i)}});function SN(e,t,n,i){for(var r=[],s={},a=e.length,o=0,u,l;oZC(s,t))):typeof i[r]===Cx&&i[r](e[r]);return i}function Xm(e){F.call(this,null,e)}const ew=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],DN={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:ew},{name:"weights",type:"number",array:!0}]};Xm.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:ew.concat(DN)},{name:"as",type:"string",array:!0,default:["value","density"]}]};z(Xm,F,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ZC(e.distribution,ON(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let a=e.method||"pdf";a!=="pdf"&&a!=="cdf"&&S("Invalid density method: "+a),!e.extent&&!i.data&&S("Missing density extent parameter."),a=i[a];const o=e.as||["value","density"],u=e.extent||di(i.data()),l=Cf(a,u,r,s).map(c=>{const f={};return f[o[0]]=c[0],f[o[1]]=c[1],be(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function ON(e){return()=>e.materialize(e.SOURCE).source}function tw(e,t){return e?e.map((n,i)=>t[i]||ze(n)):null}function Ym(e,t,n){const i=[],r=f=>f(u);let s,a,o,u,l,c;if(t==null)i.push(e.map(n));else for(s={},a=0,o=e.length;a_u(di(e,t))/30;z(Km,F,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Ym(t.source,e.groupby,$t),r=e.smooth||!1,s=e.field,a=e.step||RN(n,s),o=Ls((h,g)=>s(h)-s(g)),u=e.as||nw,l=i.length;let c=1/0,f=-1/0,d=0,p;for(;df&&(f=g),h[++p][u]=g}return this.value={start:c,stop:f,step:a},t.reflow(!0).modifies(u)}});function iw(e){$e.call(this,null,_N,e),this.modified(!0)}z(iw,$e);function _N(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Vt(n=>t(n,e),Et(t),ze(t))}function Jm(e){F.call(this,[void 0,void 0],e)}Jm.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};z(Jm,F,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],a=n[1];if((r||s==null)&&(s=1/0,a=-1/0),t.visit(r?t.SOURCE:t.ADD,o=>{const u=xt(i(o));u!=null&&(ua&&(a=u))}),!Number.isFinite(s)||!Number.isFinite(a)){let o=ze(i);o&&(o=` for field "${o}"`),t.dataflow.warn(`Infinite extent${o}: [${s}, ${a}]`),s=a=void 0}this.value=[s,a]}});function Qm(e,t){$e.call(this,e),this.parent=t,this.count=0}z(Qm,$e,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function wf(e){F.call(this,{},e),this._keys=Ka();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ee(u),c=s.get(l);c!==void 0&&(s.delete(l),o(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(ee(u),l),o(l).add(u)}),a||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ee(u),c=s.get(l),f=i(u);c===f?o(f).mod(u):(s.set(l,f),o(c).rem(u),o(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{o(s.get(ee(u))).mod(u)}),a&&t.visit(t.REFLOW,u=>{const l=ee(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),o(c).rem(u),o(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function rw(e){$e.call(this,null,TN,e)}z(rw,$e);function TN(e){return this.value&&!e.modified()?this.value:D(e.name)?W(e.name).map(t=>gn(t)):gn(e.name,e.as)}function Zm(e){F.call(this,Ka(),e)}Zm.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};z(Zm,F,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,a=r.rem,o=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ee(f);i.has(d)?i.delete(d):a.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(ee(f),1)});function c(f){const d=ee(f),p=u(f,e),h=i.get(d);p&&h?(i.delete(d),s.push(f)):!p&&!h?(i.set(d,1),a.push(f)):l&&p&&!h&&o.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function e0(e){F.call(this,[],e)}e0.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};z(e0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=tw(i,e.as||[]),s=e.index||null,a=r.length;return n.rem=this.value,t.visit(t.SOURCE,o=>{const u=i.map(h=>h(o)),l=u.reduce((h,g)=>Math.max(h,g.length),0);let c=0,f,d,p;for(;c{for(let c=0,f;ca[i]=n(a,e))}});function sw(e){F.call(this,[],e)}z(sw,F,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,a,o,u;if(s>0){for(a=[];--s>=0;)a.push(u=be(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(a):a}else o=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,r=r.slice(-s);return n.source=this.value=r,n}});const Cl={value:"value",median:p2,mean:cR,min:I5,max:Yo},NN=[];function i0(e){F.call(this,[],e)}i0.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function MN(e){var t=e.method||Cl.value,n;if(Cl[t]==null)S("Unrecognized imputation method: "+t);else return t===Cl.value?(n=e.value!==void 0?e.value:0,()=>n):Cl[t]}function LN(e){const t=e.field;return n=>n?t(n):NaN}z(i0,F,{transform(e,t){var n=t.fork(t.ALL),i=MN(e),r=LN(e),s=ze(e.field),a=ze(e.key),o=(e.groupby||[]).map(ze),u=BN(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,p,h,g,m,y,b,v,A,E;for(m=0,v=u.length;my(m),s=[],a=i?i.slice():[],o={},u={},l,c,f,d,p,h,g,m;for(a.forEach((y,b)=>o[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{se(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const h=Rm(p,a)[o],g=e.counts?p.length:1,m=c||di(p);Cf(h,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=W(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>oh(this,t,W(i.data)))}});function IN(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function oh(e,t,n){n.forEach(be);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function a0(e){F.call(this,{},e)}a0.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};z(a0,F,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,a=e.modified(),o=n.length;let u=a?t.SOURCE:t.ADD,l=t,c=e.as,f,d,p;return r?(d=r.length,o>1&&!c&&S('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==o*d&&S('The "as" parameter has too few output field names.'),c=c||r.map(ze),f=function(h){for(var g=0,m=0,y,b;gt.modified(h.fields)),u|=p?t.MOD:0),t.visit(u,f),l.modifies(c)}});function uw(e){$e.call(this,null,zN,e)}z(uw,$e);function zN(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,a;for(s=0;sr&&(r=a[1]);return[i,r]}function lw(e){$e.call(this,null,UN,e)}z(lw,$e);function UN(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function cw(e){F.call(this,null,e)}z(cw,F,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function o0(e){wr.call(this,e)}o0.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Mu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};z(o0,wr,{_transform:wr.prototype.transform,transform(e,t){return this._transform(jN(e,t),t)}});function jN(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Et(n).concat(Et(i)),a=WN(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map(()=>r),fields:a.map(o=>qN(o,n,i,s)),as:a.map(o=>o+""),modified:e.modified.bind(e)}}function qN(e,t,n,i){return Vt(r=>t(r)===e?n(r):NaN,i,e+"")}function WN(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const a=e(s);i[a]||(i[a]=1,r.push(a))}),r.sort(Ya),t?r.slice(0,t):r}function fw(e){wf.call(this,e)}z(fw,wf,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(ee(s),n,t,s);return(e.modified("field")||i&&t.modified(Et(i)))&&S("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const a=r(s);i(s).forEach(o=>a.mod(o))}),t.visit(t.ADD,s=>{const a=r(s);i(s).forEach(o=>a.add(be(o)))}),t.visit(t.REM,s=>{const a=r(s);i(s).forEach(o=>a.rem(o))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function u0(e){F.call(this,null,e)}u0.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};z(u0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=tw(e.fields,e.as||[]),s=i?(o,u)=>GN(o,u,i,r):mf;let a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,o=>{const u=ee(o);n.rem.push(a[u]),a[u]=null}),t.visit(t.ADD,o=>{const u=s(o,be({}));a[ee(o)]=u,n.add.push(u)}),t.visit(t.MOD,o=>{n.mod.push(s(o,a[ee(o)]))}),n}});function GN(e,t,n,i){for(let r=0,s=n.length;r{const d=Sm(f,l);for(let p=0;p{const s=ee(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Cm(r);i[ee(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[ee(r)];for(const a in r)s[a]=r[a],n.modifies(a);n.mod.push(s)})),n}});function c0(e){F.call(this,[],e),this.count=0}c0.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};z(c0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[ee(f)]=1,c),{});let a=this.value,o=this.count,u=0;function l(c){let f,d;a.length=u&&(f=a[d],s[ee(f)]&&n.rem.push(f),a[d]=c)),++o}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ee(c);s[f]&&(s[f]=-1,n.rem.push(c)),--o}),a=a.filter(c=>s[ee(c)]!==-1)),(t.rem.length||i)&&a.length{s[ee(c)]||l(c)}),u=-1),i&&a.length>r){const c=a.length-r;for(let f=0;f{s[ee(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(c=>!s[ee(c)])),this.count=o,this.value=n.source=a,n}});function f0(e){F.call(this,null,e)}f0.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};z(f0,F,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ms(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,be(s)}),n.add=t.add.concat(this.value),n}});function pw(e){F.call(this,null,e),this.modified(!0)}z(pw,F,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function d0(e){F.call(this,null,e)}const gw=["unit0","unit1"];d0.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:mm,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:gw}]};z(d0,F,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),a=(r?Qa:Ja)(s.unit).offset,o=e.as||gw,u=o[0],l=o[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,p=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Et(n)))&&(t=t.reflow(!0),p=t.SOURCE,f=1/0,d=-1/0),t.visit(p,h=>{const g=n(h);let m,y;g==null?(h[u]=null,i&&(h[l]=null)):(h[u]=m=y=s(g),i&&(h[l]=y=a(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?o:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:dC({extent:e.extent||di(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=ym(i),a=this.value||{},o=(n?iC:nC)(s,r);return o.unit=ce(s),o.units=s,o.step=r,o.start=a.start,o.stop=a.stop,this.value=o}});function mw(e){F.call(this,Ka(),e)}z(mw,F,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=o=>r.set(i(o),o);let a=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,o=>r.delete(i(o))),t.visit(t.ADD,s)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function yw(e){F.call(this,null,e)}z(yw,F,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ls(e.sort)):t.source).map(e.field))}});function VN(e,t,n,i){const r=lu[e](t,n);return{init:r.init||cr,update:function(s,a){a[i]=r.next(s)}}}const lu={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lu.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||S("ntile num must be greater than zero.");const n=lu.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||S("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=XN(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function XN(e,t,n){for(let i=t.length;nu[g]=1)}p(e.sort),t.forEach((h,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=ze(m),A=VC(h,v,s[g]);if(p(m),a.push(A),H(lu,h))o.push(VN(h,m,y,A));else{if(m==null&&h!=="count"&&S("Null aggregate field specified."),h==="count"){c.push(A);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(XC(h,b,A))}}),(c.length||f.length)&&(this.cell=KN(f,c,d)),this.inputs=Object.keys(u)}const xw=bw.prototype;xw.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};xw.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let a;if(n){for(a=e.p0;aKC(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),a=0;athis.group(r(o));let a=this.state;(!a||n)&&(a=this.state=new bw(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,o=>s(o).add(o))):(t.visit(t.REM,o=>s(o).remove(o)),t.visit(t.ADD,o=>s(o).add(o)));for(let o=0,u=this._mlen;o0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),itypeof Image<"u"?Image:null;function p0(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const n6="identity",Ca="linear",qi="log",Lu="pow",Bu="sqrt",Ff="symlog",ms="time",ys="utc",ui="sequential",eo="diverging",wa="quantile",Sf="quantize",$f="threshold",g0="ordinal",_p="point",vw="band",m0="bin-ordinal",Ke="continuous",Pu="discrete",Iu="discretizing",En="interpolating",y0="temporal";function i6(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[u]<=r&&(s<0&&(s=u),a=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[a]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function b0(){const e=w2().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,a=!1,o=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],a=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(a=!!f,c()):a},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),o=u,c()):o},e.paddingInner=function(f){return arguments.length?(o=Math.max(0,Math.min(1,f)),c()):o},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,mc(p,g)-1),b=g===m?y:mc(p,m)-1,g-p[y]>s+1e-10&&++y,d&&(v=y,y=h-b,b=h-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return b0().domain(t()).range(i).round(a).paddingInner(o).paddingOuter(u).align(l)},c()}function Ew(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Ew(t())},e}function s6(){return Ew(b0().paddingInner(1))}var a6=Array.prototype.map;function o6(e){return a6.call(e,xt)}const u6=Array.prototype.slice;function Aw(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(mc(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=o6(i),n):e.slice()},n.range=function(i){return arguments.length?(t=u6.call(i),n):t.slice()},n.tickFormat=function(i,r){return V5(e[0],ce(e),i??10,r)},n.copy=function(){return Aw().domain(n.domain()).range(n.range())},n}const Ac=new Map,Cw=Symbol("vega_scale");function ww(e){return e[Cw]=!0,e}function wx(e){return e&&e[Cw]===!0}function l6(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?i6(s):s.invertExtent?r6(s):void 0),s.type=e,ww(s)};return i.metadata=Ln(W(n)),i}function me(e,t,n){return arguments.length>1?(Ac.set(e,l6(e,t,n)),this):Fw(e)?Ac.get(e):void 0}me(n6,fR);me(Ca,H5,Ke);me(qi,dR,[Ke,qi]);me(Lu,hR,Ke);me(Bu,pR,Ke);me(Ff,gR,Ke);me(ms,z5,[Ke,y0]);me(ys,mR,[Ke,y0]);me(ui,g2,[Ke,En]);me(`${ui}-${Ca}`,g2,[Ke,En]);me(`${ui}-${qi}`,yR,[Ke,En,qi]);me(`${ui}-${Lu}`,bR,[Ke,En]);me(`${ui}-${Bu}`,xR,[Ke,En]);me(`${ui}-${Ff}`,vR,[Ke,En]);me(`${eo}-${Ca}`,ER,[Ke,En]);me(`${eo}-${qi}`,AR,[Ke,En,qi]);me(`${eo}-${Lu}`,CR,[Ke,En]);me(`${eo}-${Bu}`,wR,[Ke,En]);me(`${eo}-${Ff}`,FR,[Ke,En]);me(wa,SR,[Iu,wa]);me(Sf,$R,Iu);me($f,kR,Iu);me(m0,Aw,[Pu,Iu]);me(g0,w2,Pu);me(vw,b0,Pu);me(_p,s6,Pu);function Fw(e){return Ac.has(e)}function Ps(e,t){const n=Ac.get(e);return n&&n.metadata[t]}function x0(e){return Ps(e,Ke)}function Fa(e){return Ps(e,Pu)}function Tp(e){return Ps(e,Iu)}function Sw(e){return Ps(e,qi)}function c6(e){return Ps(e,y0)}function $w(e){return Ps(e,En)}function kw(e){return Ps(e,wa)}const f6=["clamp","base","constant","exponent"];function Dw(e,t){const n=t[0],i=ce(t)-n;return function(r){return e(n+r*i)}}function kf(e,t,n){return IR(v0(t||"rgb",n),e)}function Ow(e,t){const n=new Array(t),i=t+1;for(let r=0;re[o]?a[o](e[o]()):0),a)}function v0(e,t){const n=zR[d6(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function d6(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const h6={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},p6={accent:PR,category10:BR,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:LR,observable10:MR,paired:NR,pastel1:TR,pastel2:_R,set1:RR,set2:OR,set3:DR,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function _w(e){if(D(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;ikf(_w(e)));function E0(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Fx[e]=t,this):Fx[e]}const Kl="symbol",g6="discrete",m6="gradient",y6=e=>D(e)?e.map(t=>String(t)):String(e),b6=(e,t)=>e[1]-t[1],x6=(e,t)=>t[1]-e[1];function A0(e,t,n){let i;return ge(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(_u(e.domain())/n||1)+1))),j(t)&&(i=t.step,t=t.interval),q(t)&&(t=e.type===ms?Ja(t):e.type==ys?Qa(t):S("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function Nw(e,t,n){let i=e.range(),r=i[0],s=ce(i),a=b6;if(r>s&&(i=s,s=r,r=i,a=x6),r=Math.floor(r),s=Math.ceil(s),t=t.map(o=>[o,e(o)]).filter(o=>r<=o[1]&&o[1]<=s).sort(a).map(o=>o[0]),n>0&&t.length>1){const o=[t[0],ce(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=o)}return t}function C0(e,t){return e.bins?Nw(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Mw(e,t,n,i,r,s){const a=t.type;let o=y6;if(a===ms||r===ms)o=e.timeFormat(i);else if(a===ys||r===ys)o=e.utcFormat(i);else if(Sw(a)){const u=e.formatFloat(i);if(s||t.bins)o=u;else{const l=Lw(t,n,!1);o=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();o=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(o=e.format(i));return o}function Lw(e,t,n){const i=C0(e,t),r=e.base(),s=Math.log(r),a=Math.max(1,r*t/i.length),o=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r1?i[1]-i[0]:i[0],a;for(a=1;aNp[e.type]||e.bins;function Iw(e,t,n,i,r,s,a){const o=Bw[t.type]&&s!==ms&&s!==ys?v6(e,t,r):Mw(e,t,n,r,s,a);return i===Kl&&C6(t)?w6(o):i===g6?F6(o):S6(o)}const w6=e=>(t,n,i)=>{const r=Sx(i[n+1],Sx(i.max,1/0)),s=$x(t,e),a=$x(r,e);return s&&a?s+" – "+a:a?"< "+a:"≥ "+s},Sx=(e,t)=>e??t,F6=e=>(t,n)=>n?e(t):null,S6=e=>t=>e(t),$x=(e,t)=>Number.isFinite(e)?t(e):null;function $6(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ce(t),s=r-i;if(e.type===$f){const a=n?s/n:.1;i-=a,r+=a,s=r-i}return a=>(a-i)/s}function k6(e,t,n,i){const r=i||t.type;return q(n)&&c6(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===ms?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===ys?e.utcFormat("%A, %d %B %Y, %X UTC"):Iw(e,t,5,null,n,i,!0)}function zw(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=k6(e,t,n.format,n.formatType);if(Tp(t.type)){const s=Pw(t).slice(1).map(r),a=s.length;return`${a} boundar${a===1?"y":"ies"}: ${s.join(", ")}`}else if(Fa(t.type)){const s=t.domain(),a=s.length,o=a>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${a} value${a===1?"":"s"}: ${o}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(ce(s))}`}}let Uw=0;function D6(){Uw=0}const Cc="p_";function w0(e){return e&&e.gradient}function jw(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Cc:"";return r||(r=e.id="gradient_"+Uw++,i==="radial"?(e.x1=Zn(e.x1,.5),e.y1=Zn(e.y1,.5),e.r1=Zn(e.r1,0),e.x2=Zn(e.x2,.5),e.y2=Zn(e.y2,.5),e.r2=Zn(e.r2,.5),s=Cc):(e.x1=Zn(e.x1,0),e.y1=Zn(e.y1,0),e.x2=Zn(e.x2,1),e.y2=Zn(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Zn(e,t){return e??t}function qw(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const kx={basis:{curve:E_},"basis-closed":{curve:v_},"basis-open":{curve:x_},bundle:{curve:b_,tension:"beta",value:.85},cardinal:{curve:y_,tension:"tension",value:0},"cardinal-open":{curve:m_,tension:"tension",value:0},"cardinal-closed":{curve:g_,tension:"tension",value:0},"catmull-rom":{curve:p_,tension:"alpha",value:.5},"catmull-rom-closed":{curve:h_,tension:"alpha",value:.5},"catmull-rom-open":{curve:d_,tension:"alpha",value:.5},linear:{curve:f_},"linear-closed":{curve:c_},monotone:{horizontal:l_,vertical:u_},natural:{curve:o_},step:{curve:a_},"step-after":{curve:s_},"step-before":{curve:r_}};function F0(e,t,n){var i=H(kx,e)&&kx[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const O6={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},R6=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,_6=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,T6=/^((\s+,?\s*)|(,\s*))/,N6=/^[01]/;function Sa(e){const t=[];return(e.match(R6)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),a=O6[s],o=M6(s,a,i.slice(1).trim()),u=o.length;if(u1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,A=m*o+y*u,E=b*o+v*u,C=m*e+y*t,x=b*e+v*t;let R=1/((C-A)*(C-A)+(x-E)*(x-E))-.25;R<0&&(R=0);let L=Math.sqrt(R);s==r&&(L=-L);const J=.5*(A+C)-L*(x-E),ne=.5*(E+x)+L*(C-A),de=Math.atan2(E-ne,A-J);let O=Math.atan2(x-ne,C-J)-de;O<0&&s===1?O+=si:O>0&&s===0&&(O-=si);const I=Math.ceil(Math.abs(O/(ss+.001))),G=[];for(let X=0;X+e}function wl(e,t,n){return Math.max(t,Math.min(e,n))}function Hw(){var e=U6,t=j6,n=q6,i=W6,r=Di(0),s=r,a=r,o=r,u=null;function l(c,f,d){var p,h=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=wl(+r.call(this,c),0,b),A=wl(+s.call(this,c),0,b),E=wl(+a.call(this,c),0,b),C=wl(+o.call(this,c),0,b);if(u||(u=p=tm()),v<=0&&A<=0&&E<=0&&C<=0)u.rect(h,g,m,y);else{var x=h+m,w=g+y;u.moveTo(h+v,g),u.lineTo(x-A,g),u.bezierCurveTo(x-nr*A,g,x,g+nr*A,x,g+A),u.lineTo(x,w-C),u.bezierCurveTo(x,w-nr*C,x-nr*C,w,x-C,w),u.lineTo(h+E,w),u.bezierCurveTo(h+nr*E,w,h,w-nr*E,h,w-E),u.lineTo(h,g+v),u.bezierCurveTo(h,g+nr*v,h+nr*v,g,h+v,g),u.closePath()}if(p)return u=null,p+""||null}return l.x=function(c){return arguments.length?(e=Di(c),l):e},l.y=function(c){return arguments.length?(t=Di(c),l):t},l.width=function(c){return arguments.length?(n=Di(c),l):n},l.height=function(c){return arguments.length?(i=Di(c),l):i},l.cornerRadius=function(c,f,d,p){return arguments.length?(r=Di(c),s=f!=null?Di(f):r,o=d!=null?Di(d):r,a=p!=null?Di(p):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function Vw(){var e,t,n,i,r=null,s,a,o,u;function l(f,d,p){const h=p/2;if(s){var g=o-d,m=f-a;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,A=Math.atan2(m,g);r.moveTo(a-b,o-v),r.lineTo(f-g*h,d-m*h),r.arc(f,d,h,A-Math.PI,A),r.lineTo(a+b,o+v),r.arc(a,o,u,A,A+Math.PI)}else r.arc(f,d,h,0,si);r.closePath()}else s=1;a=f,o=d,u=h}function c(f){var d,p=f.length,h,g=!1,m;for(r==null&&(r=m=tm()),d=0;d<=p;++d)!(de.x||0,ju=e=>e.y||0,G6=e=>e.width||0,H6=e=>e.height||0,V6=e=>(e.x||0)+(e.width||0),X6=e=>(e.y||0)+(e.height||0),Y6=e=>e.startAngle||0,K6=e=>e.endAngle||0,J6=e=>e.padAngle||0,Q6=e=>e.innerRadius||0,Z6=e=>e.outerRadius||0,eM=e=>e.cornerRadius||0,tM=e=>zu(e.cornerRadiusTopLeft,e.cornerRadius)||0,nM=e=>zu(e.cornerRadiusTopRight,e.cornerRadius)||0,iM=e=>zu(e.cornerRadiusBottomRight,e.cornerRadius)||0,rM=e=>zu(e.cornerRadiusBottomLeft,e.cornerRadius)||0,sM=e=>zu(e.size,64),aM=e=>e.size||1,Df=e=>e.defined!==!1,oM=e=>Gw(e.shape||"circle"),uM=n_().startAngle(Y6).endAngle(K6).padAngle(J6).innerRadius(Q6).outerRadius(Z6).cornerRadius(eM),lM=m2().x(Uu).y1(ju).y0(X6).defined(Df),cM=m2().y(ju).x1(Uu).x0(V6).defined(Df),fM=i_().x(Uu).y(ju).defined(Df),dM=Hw().x(Uu).y(ju).width(G6).height(H6).cornerRadius(tM,nM,iM,rM),hM=UR().type(oM).size(sM),pM=Vw().x(Uu).y(ju).defined(Df).size(aM);function S0(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function gM(e,t){return uM.context(e)(t)}function mM(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?cM:lM).curve(F0(i,n.orient,n.tension)).context(e)(t)}function yM(e,t){const n=t[0],i=n.interpolate||"linear";return fM.curve(F0(i,n.orient,n.tension)).context(e)(t)}function to(e,t,n,i){return dM.context(e)(t,n,i)}function bM(e,t){return(t.mark.shape||t.shape).context(e)(t)}function xM(e,t){return hM.context(e)(t)}function vM(e,t){return pM.context(e)(t)}var Xw=1;function Yw(){Xw=1}function $0(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+Xw++),a=r.clipping[s]||(r.clipping[s]={id:s});return ae(i)?a.path=i(null):S0(n)?a.path=to(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+s+")"}function We(e){this.clear(),e&&this.union(e)}We.prototype={clone(){return new We(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(e),u=Math.sin(e),l=t-t*o+n*u,c=n-t*u-n*o;return[o*i-u*r+l,u*i+o*r+c,o*i-u*a+l,u*i+o*a+c,o*s-u*r+l,u*s+o*r+c,o*s-u*a+l,u*s+o*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Of(e){this.mark=e,this.bounds=this.bounds||new We}function Rf(e){Of.call(this,e),this.items=this.items||[]}z(Rf,Of);class Kw{constructor(t){this._pending=0,this._loader=t||hf()}pending(){return this._pending}sanitizeURL(t){const n=this;return _x(n),n._loader.sanitize(t,{context:"href"}).then(i=>(xo(n),i)).catch(()=>(xo(n),null))}loadImage(t){const n=this,i=t6();return _x(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const a=new i,o=H(r,"crossOrigin")?r.crossOrigin:"anonymous";return o!=null&&(a.crossOrigin=o),a.onload=()=>xo(n),a.onerror=()=>xo(n),a.src=s,a}).catch(r=>(xo(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function _x(e){e._pending+=1}function xo(e){e._pending-=1}function Vi(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?EM(t,i):0))}return e}function EM(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const AM=si-1e-8;let _f,Jl,Ql,us,Mp,Zl,Lp,Bp;const fr=(e,t)=>_f.add(e,t),ec=(e,t)=>fr(Jl=e,Ql=t),Tx=e=>fr(e,_f.y1),Nx=e=>fr(_f.x1,e),as=(e,t)=>Mp*e+Lp*t,os=(e,t)=>Zl*e+Bp*t,fh=(e,t)=>fr(as(e,t),os(e,t)),dh=(e,t)=>ec(as(e,t),os(e,t));function qu(e,t){return _f=e,t?(us=t*Fr,Mp=Bp=Math.cos(us),Zl=Math.sin(us),Lp=-Zl):(Mp=Bp=1,us=Zl=Lp=0),CM}const CM={beginPath(){},closePath(){},moveTo:dh,lineTo:dh,rect(e,t,n,i){us?(fh(e+n,t),fh(e+n,t+i),fh(e,t+i),dh(e,t)):(fr(e+n,t+i),ec(e,t))},quadraticCurveTo(e,t,n,i){const r=as(e,t),s=os(e,t),a=as(n,i),o=os(n,i);Mx(Jl,r,a,Tx),Mx(Ql,s,o,Nx),ec(a,o)},bezierCurveTo(e,t,n,i,r,s){const a=as(e,t),o=os(e,t),u=as(n,i),l=os(n,i),c=as(r,s),f=os(r,s);Lx(Jl,a,u,c,Tx),Lx(Ql,o,l,f,Nx),ec(c,f)},arc(e,t,n,i,r,s){if(i+=us,r+=us,Jl=n*Math.cos(r)+e,Ql=n*Math.sin(r)+t,Math.abs(r-i)>AM)fr(e-n,t-n),fr(e+n,t+n);else{const a=l=>fr(n*Math.cos(l)+e,n*Math.sin(l)+t);let o,u;if(a(i),a(r),r!==i)if(i=i%si,i<0&&(i+=si),r=r%si,r<0&&(r+=si),rr;++u,o-=ss)a(o);else for(o=i-i%ss+ss,u=0;u<4&&oL6?(c=a*a+o*s,c>=0&&(c=Math.sqrt(c),u=(-a+c)/s,l=(-a-c)/s)):u=.5*o/a,0d)return!1;g>f&&(f=g)}else if(p>0){if(g0?(e.globalAlpha=n,e.fillStyle=Zw(e,t,t.fill),!0):!1}var FM=[];function ka(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=Zw(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||FM),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function SM(e,t){return e.zindex-t.zindex||e.index-t.index}function O0(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function R0(e){return function(t,n,i){Pn(n,r=>{(!i||i.intersects(r.bounds))&&eF(e,t,r,r)})}}function $M(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&eF(e,t,n.items[0],n.items)}}function eF(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||($a(t,n),n.fill&&wc(t,n,r)&&t.fill(),n.stroke&&ka(t,n,r)&&t.stroke()))}function Tf(e){return e=e||mn,function(t,n,i,r,s,a){return i*=t.pixelRatio,r*=t.pixelRatio,Fc(n,o=>{const u=o.bounds;if(!(u&&!u.contains(s,a)||!u)&&e(t,o,i,r,s,a))return o})}}function Wu(e,t){return function(n,i,r,s){var a=Array.isArray(i)?i[0]:i,o=t??a.fill,u=a.stroke&&n.isPointInStroke,l,c;return u&&(l=a.strokeWidth,c=a.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:o&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function _0(e){return Tf(Wu(e))}function ls(e,t){return"translate("+e+","+t+")"}function T0(e){return"rotate("+e+")"}function kM(e,t){return"scale("+e+","+t+")"}function tF(e){return ls(e.x||0,e.y||0)}function DM(e){return ls(e.x||0,e.y||0)+(e.angle?" "+T0(e.angle):"")}function OM(e){return ls(e.x||0,e.y||0)+(e.angle?" "+T0(e.angle):"")+(e.scaleX||e.scaleY?" "+kM(e.scaleX||1,e.scaleY||1):"")}function N0(e,t,n){function i(a,o){a("transform",DM(o)),a("d",t(null,o))}function r(a,o){return t(qu(a,o.angle),o),Vi(a,o).translate(o.x||0,o.y||0)}function s(a,o){var u=o.x||0,l=o.y||0,c=o.angle||0;a.translate(u,l),c&&a.rotate(c*=Fr),a.beginPath(),t(a,o),c&&a.rotate(-c),a.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:R0(s),pick:_0(s),isect:n||k0(s)}}var RM=N0("arc",gM);function _M(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,a,o;--r>=0;)e[r].defined!==!1&&(o=Math.abs(e[r][i]-n),o=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],a=r*r+s*s,a=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function BM(e,t){e("transform",tF(t))}function rF(e,t){const n=iF(t);e("d",to(null,t,n,n))}function PM(e,t){e("class","background"),e("aria-hidden",!0),rF(e,t)}function IM(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?rF(e,t):e("d","")}function zM(e,t,n){const i=t.clip?$0(n,t,t):null;e("clip-path",i)}function UM(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,a=r.y||0,o=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(fu(e,r,s,a),$a(e,r),r.fill&&wc(e,r,u)&&e.fill(),r.stroke&&!o&&ka(e,r,u)&&e.stroke()),e.save(),e.translate(s,a),r.clip&&nF(e,r),n&&n.translate(-s,-a),Pn(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,a),e.restore(),o&&r.stroke&&u&&(fu(e,r,s,a),$a(e,r),ka(e,r,u)&&e.stroke())})}function HM(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const a=n*e.pixelRatio,o=i*e.pixelRatio;return Fc(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const p=c+(u.width||0),h=f+(u.height||0),g=u.clip;if(g&&(rp||sh))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&S0(u)&&!WM(e,u,a,o))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&qM(e,u,a,o)?(e.restore(),u):(l=Fc(u,b=>VM(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&jM(e,u,a,o)&&(l=u),e.restore(),l||null)})}function VM(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var XM={type:"group",tag:"g",nested:!1,attr:BM,bound:UM,draw:GM,pick:HM,isect:Jw,content:zM,background:PM,foreground:IM},du={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function L0(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function B0(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function P0(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Nf(e,t){return e==="center"?t/2:e==="right"?t:0}function Mf(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function YM(e,t,n){const i=L0(t,n),r=B0(t,i),s=P0(t,i),a=(t.x||0)-Nf(t.align,r),o=(t.y||0)-Mf(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,du["xmlns:xlink"],"xlink:href"),e("transform",ls(a,o)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function KM(e,t){const n=t.image,i=B0(t,n),r=P0(t,n),s=(t.x||0)-Nf(t.align,i),a=(t.y||0)-Mf(t.baseline,r);return e.set(s,a,s+i,a+r)}function JM(e,t,n){Pn(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=L0(i,this);let s=B0(i,r),a=P0(i,r);if(s===0||a===0)return;let o=(i.x||0)-Nf(i.align,s),u=(i.y||0)-Mf(i.baseline,a),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&sF(e,i,r)&&($a(e,i),e.stroke())}})}function l8(e,t,n,i){return e.isPointInStroke?sF(e,t,1)&&e.isPointInStroke(n,i):!1}var c8={type:"rule",tag:"line",nested:!1,attr:a8,bound:o8,draw:u8,pick:Tf(l8),isect:Qw},f8=N0("shape",bM),d8=N0("symbol",xM,D0);const zx=W2();var Zt={height:xi,measureWidth:I0,estimateWidth:Sc,width:Sc,canvas:aF};aF(!0);function aF(e){Zt.width=e&&Ar?I0:Sc}function Sc(e,t){return oF($r(e,t),xi(e))}function oF(e,t){return~~(.8*e.length*t)}function I0(e,t){return xi(e)<=0||!(t=$r(e,t))?0:uF(t,Lf(e))}function uF(e,t){const n=`(${t}) ${e}`;let i=zx.get(n);return i===void 0&&(Ar.font=t,i=Ar.measureText(e).width,zx.set(n,i)),i}function xi(e){return e.fontSize!=null?+e.fontSize||0:11}function Sr(e){return e.lineHeight!=null?e.lineHeight:xi(e)+2}function h8(e){return D(e)?e.length>1?e:e[0]:e}function Gu(e){return h8(e.lineBreak&&e.text&&!D(e.text)?e.text.split(e.lineBreak):e.text)}function z0(e){const t=Gu(e);return(D(t)?t.length-1:0)*Sr(e)}function $r(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?g8(e,n):n}function p8(e){if(Zt.width===I0){const t=Lf(e);return n=>uF(n,t)}else if(Zt.width===Sc){const t=xi(e);return n=>oF(n,t)}else return t=>Zt.width(e,t)}function g8(e,t){var n=+e.limit,i=p8(e);if(i(t)>>1,i(t.slice(u))>n?a=u+1:o=u;return r+t.slice(a)}else{for(;a>>1),i(t.slice(0,u))Math.max(d,Zt.width(t,p)),0)):f=Zt.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=a,l+=o,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Fr,a,o);else if(n===2)return e.rotatedPoints(t.angle*Fr,a,o);return e}function b8(e,t,n){Pn(t,i=>{var r=i.opacity==null?1:i.opacity,s,a,o,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Lf(i),e.textAlign=i.align||"left",s=Bf(i),a=s.x1,o=s.y1,i.angle&&(e.save(),e.translate(a,o),e.rotate(i.angle*Fr),a=o=0),a+=i.dx||0,o+=(i.dy||0)+U0(i),c=Gu(i),$a(e,i),D(c))for(l=Sr(i),u=0;ut;)e.removeChild(n[--i]);return e}function pF(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Pf(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function w8(e,t,n,i){var r=e&&e.mark,s,a;if(r&&(s=sn[r.marktype]).tip){for(a=Pf(t,n),a[0]-=i[0],a[1]-=i[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=s.tip(r.items,a)}return e}let W0=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||hf(),this._tooltip=n||F8}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),a=dr(null,"a");for(const o in r)a.setAttribute(o,r[o]);a.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=w8(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,a=s.width(),o=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:a,height:o,left:u,top:l,right:u+a,bottom:l+o}}};function F8(e,t,n,i){e.element().setAttribute("title",i||"")}class Vu{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Kw(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(a=>{a&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const S8="keydown",$8="keypress",k8="keyup",gF="dragenter",nc="dragleave",mF="dragover",zp="pointerdown",D8="pointerup",$c="pointermove",ic="pointerout",yF="pointerover",Up="mousedown",O8="mouseup",bF="mousemove",kc="mouseout",xF="mouseover",Dc="click",R8="dblclick",_8="wheel",vF="mousewheel",Oc="touchstart",Rc="touchmove",_c="touchend",T8=[S8,$8,k8,gF,nc,mF,zp,D8,$c,ic,yF,Up,O8,bF,kc,xF,Dc,R8,_8,vF,Oc,Rc,_c],jp=$c,Jo=kc,qp=Dc;class Xu extends W0{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=T8,this.pointermove=Wx([$c,bF],[yF,xF],[ic,kc]),this.dragover=Wx([mF],[gF],[nc]),this.pointerout=Gx([ic,kc]),this.dragleave=Gx([nc])}initialize(t,n,i){return this._canvas=t&&q0(t,"canvas"),[Dc,Up,zp,$c,ic,nc].forEach(r=>qx(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(vF,t)}pointerdown(t){this._down=this._active,this.fire(zp,t)}mousedown(t){this._down=this._active,this.fire(Up,t)}click(t){this._down===this._active&&(this.fire(Dc,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Oc,t,!0)}touchmove(t){this.fire(Rc,t,!0)}touchend(t){this.fire(_c,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===qp&&r&&r.href?this.handleHref(n,r,r.href):(t===jp||t===Jo)&&this.handleTooltip(n,r,t!==Jo),s)for(let a=0,o=s.length;a=0&&r.splice(s,1),this}pickEvent(t){const n=Pf(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const a=this.context();return sn[t.marktype].pick.call(this,a,t,n,i,r,s)}}const N8=e=>e===Oc||e===Rc||e===_c?[Oc,Rc,_c]:[e];function qx(e,t){N8(t).forEach(n=>M8(e,n))}function M8(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Uo(e,t,n){t.forEach(i=>e.fire(i,n))}function Wx(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Uo(this,e,i):((!r||!r.exit)&&Uo(this,n,i),this._active=s,Uo(this,t,i),Uo(this,e,i))}}function Gx(e){return function(t){Uo(this,e,t),this._active=null}}function L8(){return typeof window<"u"&&window.devicePixelRatio||1}function B8(e,t,n,i,r,s){const a=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,o=e.getContext("2d"),u=a?L8():r;e.width=t*u,e.height=n*u;for(const l in s)o[l]=s[l];return a&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),o.pixelRatio=u,o.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Tc extends Vu{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new We,this._tempb=new We}initialize(t,n,i,r,s,a){return this._options=a||{},this._canvas=this._options.externalContext?null:Er(1,1,this._options.type),t&&this._canvas&&(cn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)B8(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||S("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,a=this._height,o=this._dirty,u=P8(r,s,a);i.save();const l=this._redraw||o.empty()?(this._redraw=!1,u.expand(1)):I8(i,u.intersect(o),r);return this.clear(-r[0],-r[1],s,a),this.draw(i,t,l,n),i.restore(),o.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=sn[n.marktype];n.clip&&LM(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,a=this.context();s.type!=="pdf"&&!s.externalContext&&a.clearRect(t,n,i,r),this._bgcolor!=null&&(a.fillStyle=this._bgcolor,a.fillRect(t,n,i,r))}}const P8=(e,t,n)=>new We().set(0,0,t,n).translate(-e[0],-e[1]);function I8(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class EF extends W0{constructor(t,n){super(t,n);const i=this;i._hrefHandler=hh(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=hh(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Jo)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(qp,this._hrefHandler),r.removeEventListener(jp,this._tooltipHandler),r.removeEventListener(Jo,this._tooltipHandler)),this._svg=r=t&&q0(t,"svg"),r&&(r.addEventListener(qp,this._hrefHandler),r.addEventListener(jp,this._tooltipHandler),r.addEventListener(Jo,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const a={type:t,handler:n,listener:hh(this,n)};(r[i]||(r[i]=[])).push(a),this._svg&&this._svg.addEventListener(i,a.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const hh=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},AF="aria-hidden",G0="aria-label",H0="role",V0="aria-roledescription",CF="graphics-object",X0="graphics-symbol",wF=(e,t,n)=>({[H0]:e,[V0]:t,[G0]:n||void 0}),z8=Ln(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Hx={axis:{desc:"axis",caption:q8},legend:{desc:"legend",caption:W8},"title-text":{desc:"title",caption:e=>`Title text '${Xx(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${Xx(e)}'`}},Vx={ariaRole:H0,ariaRoleDescription:V0,description:G0};function FF(e,t){const n=t.aria===!1;if(e(AF,n||void 0),n||t.description==null)for(const i in Vx)e(Vx[i],void 0);else{const i=t.mark.marktype;e(G0,t.description),e(H0,t.ariaRole||(i==="group"?CF:X0)),e(V0,t.ariaRoleDescription||`${i} mark`)}}function SF(e){return e.aria===!1?{[AF]:!0}:z8[e.role]?null:Hx[e.role]?j8(e,Hx[e.role]):U8(e)}function U8(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return wF(n?CF:X0,`${t} mark container`,e.description)}function j8(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return wF(t.role||X0,t.desc,n.description||i(n))}catch{return null}}function Xx(e){return W(e.text).join(" ")}function q8(e){const t=e.datum,n=e.orient,i=t.title?$F(e):null,r=e.context,s=r.scales[t.scale].value,a=r.dataflow.locale(),o=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Fa(o)?"discrete":o} scale with ${zw(a,s,e)}`}function W8(e){const t=e.datum,n=t.title?$F(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),a=e.context,o=a.scales[r[s[0]]].value,u=a.dataflow.locale();return H8(i)+(n?` titled '${n}'`:"")+` for ${G8(s)} with ${zw(u,o,e)}`}function $F(e){try{return W(ce(e.items).items[0].text).join(" ")}catch{return null}}function G8(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ce(e)}function H8(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const kF=e=>(e+"").replace(/&/g,"&").replace(//g,">"),V8=e=>kF(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Y0(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},a=(u,l)=>(l!=null&&(t+=` ${u}="${V8(l)}"`),o),o={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f${n}`:"/>"):e+=``,r(),o},attr:a,text:u=>(n+=kF(u),o),toString:()=>e};return o}const DF=e=>OF(Y0(),e)+"";function OF(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{c.dirty=n})),!r.zdirty){if(i.exit){a.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(a,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=a.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,Kx(i,n)):this._update(a,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,a=n.marktype,o=sn[a],u=n.interactive===!1?"none":null,l=o.tag==="g",c=Jx(n,t,i,"g",s);if(a!=="group"&&r!=null&&!r.includes(a))return cn(c,0),n._svg;c.setAttribute("class",pF(n));const f=SF(n);for(const g in f)Ot(c,g,f[g]);l||Ot(c,"pointer-events",u),Ot(c,"clip-path",n.clip?$0(this,n,n.group):null);let d=null,p=0;const h=g=>{const m=this.isDirty(g),y=Jx(g,c,d,o.tag,s);m&&(this._update(o,y,g),l&&K8(this,y,g,r)),d=y,++p};return o.nested?n.items.length&&h(n.items[0]):Pn(n,h),cn(c,p),c}_update(t,n,i){Li=n,yt=n.__values__,FF(Qo,i),t.attr(Qo,i,this);const r=Q8[t.type];r&&r.call(this,t,n,i),Li&&this.style(Li,i)}style(t,n){if(n!=null){for(const i in Nc){let r=i==="font"?Hu(n):n[i];if(r===yt[i])continue;const s=Nc[i];r==null?t.removeAttribute(s):(w0(r)&&(r=jw(r,this._defs.gradient,_F())),t.setAttribute(s,r+"")),yt[i]=r}for(const i in Mc)rc(t,Mc[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=He(t,vo+1,"defs",Ge)),r=X8(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=He(t,vo+1,"defs",Ge)),r=Y8(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):cn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function Kx(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function X8(e,t,n){let i,r,s;if(t.gradient==="radial"){let a=He(e,n++,"pattern",Ge);hr(a,{id:Cc+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a=He(a,0,"rect",Ge),hr(a,{width:1,height:1,fill:`url(${_F()}#${t.id})`}),e=He(e,n++,"radialGradient",Ge),hr(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=He(e,n++,"linearGradient",Ge),hr(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,a,r,i),++s}),cn(t,1+s)}function Jx(e,t,n,i,r){let s=e._svg,a;if(!s&&(a=t.ownerDocument,s=dr(a,i,Ge),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const o=dr(a,"path",Ge);s.appendChild(o),o.__data__=e;const u=dr(a,"g",Ge);s.appendChild(u),u.__data__=e;const l=dr(a,"path",Ge);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||J8(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function J8(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Li=null,yt=null;const Q8={group(e,t,n){const i=Li=t.childNodes[2];yt=i.__values__,e.foreground(Qo,n,this),yt=t.__values__,Li=t.childNodes[1],e.content(Qo,n,this);const r=Li=t.childNodes[0];e.background(Qo,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==yt.events&&(Ot(i,"pointer-events",s),Ot(r,"pointer-events",s),yt.events=s),n.strokeForeground&&n.stroke){const a=n.fill;Ot(i,"display",null),this.style(r,n),Ot(r,"stroke",null),a&&(n.fill=null),yt=i.__values__,this.style(i,n),a&&(n.fill=a),Li=null}else Ot(i,"display","none")},image(e,t,n){n.smooth===!1?(rc(t,"image-rendering","optimizeSpeed"),rc(t,"image-rendering","pixelated")):rc(t,"image-rendering",null)},text(e,t,n){const i=Gu(n);let r,s,a,o;D(i)?(s=i.map(u=>$r(n,u)),r=s.join(` `),r!==yt.text&&(cn(t,0),a=t.ownerDocument,o=Sr(n),s.forEach((u,l)=>{const c=dr(a,"tspan",Ge);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",o)),t.appendChild(c)}),yt.text=r)):(s=$r(n,i),s!==yt.text&&(t.textContent=s,yt.text=s)),Ot(t,"font-family",Hu(n)),Ot(t,"font-size",xi(n)+"px"),Ot(t,"font-style",n.fontStyle),Ot(t,"font-variant",n.fontVariant),Ot(t,"font-weight",n.fontWeight)}};function Qo(e,t,n){t!==yt[e]&&(n?Z8(Li,e,t,n):Ot(Li,e,t),yt[e]=t)}function rc(e,t,n){n!==yt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),yt[t]=n)}function hr(e,t){for(const n in t)Ot(e,n,t[n])}function Ot(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Z8(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function _F(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class TF extends Vu{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=Y0();n.open("svg",se({},du,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",RF,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=sn[n.marktype],r=i.tag,s=[FF,i.attr];t.open("g",{class:pF(n),"clip-path":n.clip?$0(this,n,n.group):null},SF(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const a=o=>{const u=this.href(o);if(u&&t.open("a",u),t.open(r,this.attr(n,o,s,r!=="g"?r:null)),r==="text"){const l=Gu(o);if(D(l)){const c={x:0,dy:Sr(o)};for(let f=0;fthis.mark(t,d)),t.close(),l&&f?(c&&(o.fill=null),o.stroke=f,t.open("path",this.attr(n,o,i.foreground,"bgrect")).close(),c&&(o.fill=c)):t.open("path",this.attr(n,o,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&a(n.items[0]):Pn(n,a),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},a=(o,u,l,c)=>{s[c||o]=u};return Array.isArray(i)?i.forEach(o=>o(a,n,this)):i(a,n,this),r&&e9(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const a=n[s],o=a.stops;a.gradient==="radial"?(t.open("pattern",{id:Cc+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:a.x1,fy:a.y1,fr:a.r1,cx:a.x2,cy:a.y2,r:a.r2})):t.open("linearGradient",{id:s,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2});for(let u=0;u!$n.svgMarkTypes.includes(s));this._svgRenderer.render(t,$n.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return $n.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class NF extends Xu{constructor(t,n){super(t,n)}initialize(t,n,i){const r=He(He(t,0,"div"),$n.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const MF="canvas",LF="hybrid",BF="png",PF="svg",IF="none",pr={Canvas:MF,PNG:BF,SVG:PF,Hybrid:LF,None:IF},bs={};bs[MF]=bs[BF]={renderer:Tc,headless:Tc,handler:Xu};bs[PF]={renderer:K0,headless:TF,handler:EF};bs[LF]={renderer:Wp,headless:Wp,handler:NF};bs[IF]={};function If(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(bs[e]=t,this):bs[e]}function zF(e,t,n){const i=[],r=new We().union(t),s=e.marktype;return s?UF(e,r,n,i):s==="group"?jF(e,r,n,i):S("Intersect scene must be mark node or group item.")}function UF(e,t,n,i){if(n9(e,t,n)){const r=e.items,s=e.marktype,a=r.length;let o=0;if(s==="group")for(;o=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!J0(e[r],t[r],r))return!1;return typeof e==typeof t}function s9(){Yw(),D6()}const Da="top",On="left",Rn="right",kr="bottom",a9="top-left",o9="top-right",u9="bottom-left",l9="bottom-right",Q0="start",Gp="middle",Rt="end",c9="x",f9="y",zf="group",Z0="axis",e1="title",d9="frame",h9="scope",t1="legend",HF="row-header",VF="row-footer",XF="row-title",YF="column-header",KF="column-footer",JF="column-title",p9="padding",g9="symbol",QF="fit",ZF="fit-x",eS="fit-y",m9="pad",n1="none",Fl="all",Hp="each",i1="flush",gr="column",mr="row";function tS(e){F.call(this,null,e)}z(tS,F,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=sn[r],a=s.bound;let o=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),o=Sl(i,a),i.items.forEach(l=>{l.bounds.clear().union(o)});else if(r===zf||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),o.clear(),i.items.forEach(l=>o.union(Sl(l,a))),i.role){case Z0:case t1:case e1:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{o.union(Sl(l,a))}),t.visit(t.MOD,l=>{u=u||o.alignsWith(l.bounds),n.dirty(l),o.union(Sl(l,a))}),u&&(o.clear(),i.items.forEach(l=>o.union(l.bounds)));return WF(i),t.modifies("bounds")}});function Sl(e,t,n){return t(e.bounds.clear(),e,n)}const Qx=":vega_identifier:";function r1(e){F.call(this,0,e)}r1.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};z(r1,F,{transform(e,t){const n=y9(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function y9(e){return e._signals[Qx]||(e._signals[Qx]=e.add(0))}function nS(e){F.call(this,null,e)}z(nS,F,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,b9(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===zf?Rf:Of;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function b9(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function iS(e){F.call(this,null,e)}const Zx={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!rS(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},rS=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),ev=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},v9=(e,t,n)=>{var i=e.range(),r=new We;return t===Da||t===kr?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},tv=e=>(e.forEach(t=>t.opacity=1),e),nv=(e,t)=>e.reflow(t.modified()).modifies("opacity");z(iS,F,{transform(e,t){const n=Zx[e.method]||Zx.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,a;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(tv(r),t=nv(t,e)),t;if(r=r.filter(x9),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=tv(r),t=nv(t,e),s.length>=3&&ev(s,i)){do s=n(s,i);while(s.length>=3&&ev(s,i));s.length<3&&!ce(r).opacity&&(s.length>1&&(ce(s).opacity=0),ce(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(a=v9(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{a(u)||(u.opacity=0)}));const o=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&o.union(u.bounds)}),t}});function sS(e){F.call(this,null,e)}z(sS,F,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const mt=new We;function fa(e,t,n){return e[t]===n?0:(e[t]=n,1)}function E9(e){var t=e.items[0].orient;return t===On||t===Rn}function A9(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function C9(e,t,n,i){var r=t.items[0],s=r.datum,a=r.translate!=null?r.translate:.5,o=r.orient,u=A9(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,p=r.maxExtent,h=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=h&&z0(h),b=0,v=0,A,E;switch(mt.clear().union(m),m.clear(),(A=u[0])>-1&&m.union(r.items[A].bounds),(A=u[1])>-1&&m.union(r.items[A].bounds),o){case Da:b=f||0,v=-c,E=Math.max(d,Math.min(p,-m.y1)),m.add(0,-E).add(l,0),h&&$l(e,h,E,g,y,0,-1,m);break;case On:b=-c,v=f||0,E=Math.max(d,Math.min(p,-m.x1)),m.add(-E,0).add(0,l),h&&$l(e,h,E,g,y,1,-1,m);break;case Rn:b=n+c,v=f||0,E=Math.max(d,Math.min(p,m.x2)),m.add(0,0).add(E,l),h&&$l(e,h,E,g,y,1,1,m);break;case kr:b=f||0,v=i+c,E=Math.max(d,Math.min(p,m.y2)),m.add(0,0).add(l,E),h&&$l(e,h,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return Vi(m.translate(b,v),r),fa(r,"x",b+a)|fa(r,"y",v+a)&&(r.bounds=mt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function $l(e,t,n,i,r,s,a,o){const u=t.bounds;if(t.auto){const l=a*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}o.union(u)}const iv=(e,t)=>Math.floor(Math.min(e,t)),rv=(e,t)=>Math.ceil(Math.max(e,t));function w9(e){var t=e.items,n=t.length,i=0,r,s;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(x=0;x0&&(v[x]+=N/2);if(o&&Te(n.center,mr)&&c!==1)for(x=0;x0&&(A[x]+=O/2);for(x=0;xr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,A=t.length;b=0&&(x=n[v])==null;v-=d);o?(w=p==null?x.x:Math.round(x.bounds.x1+p*x.bounds.width()),R=g):(w=g,R=p==null?x.y:Math.round(x.bounds.y1+p*x.bounds.height())),E.union(C.bounds.translate(w-(C.x||0),R-(C.y||0))),C.x=w,C.y=R,e.dirty(C),m=a(m,E[l])}return m}function av(e,t,n,i,r,s){if(t){e.dirty(t);var a=n,o=n;i?a=Math.round(r.x1+s*r.width()):o=Math.round(r.y1+s*r.height()),t.bounds.translate(a-(t.x||0),o-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=o,e.dirty(t)}}function O9(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function R9(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function _9(e,t,n,i,r,s,a){const o=O9(n,t),u=R9(e,o("offset",0)),l=o("anchor",Q0),c=l===Rt?1:l===Gp?.5:0,f={align:Hp,bounds:o("bounds",i1),columns:o("direction")==="vertical"?1:e.length,padding:o("margin",8),center:o("center"),nodirty:!0};switch(t){case On:f.anchor={x:Math.floor(i.x1)-u,column:Rt,y:c*(a||i.height()+2*i.y1),row:l};break;case Rn:f.anchor={x:Math.ceil(i.x2)+u,y:c*(a||i.height()+2*i.y1),row:l};break;case Da:f.anchor={y:Math.floor(r.y1)-u,row:Rt,x:c*(s||r.width()+2*r.x1),column:l};break;case kr:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case a9:f.anchor={x:u,y:u};break;case o9:f.anchor={x:s-u,y:u,column:Rt};break;case u9:f.anchor={x:u,y:a-u,row:Rt};break;case l9:f.anchor={x:s-u,y:a-u,column:Rt,row:Rt};break}return f}function T9(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,a=n.x,o=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),M9(e,n,n.items[0].items[0]),s=N9(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===g9&&L9(n.items[0].items[0].items[0].items),r!==n1&&(n.x=a=0,n.y=o=0),n.width=u,n.height=l,Vi(s.set(a,o,a+u,o+l),n),n.mark.bounds.clear().union(s),n}function N9(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function M9(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Eo(e,n,r,s);else{var a=t.items[1].items[0],o=a.anchor,u=t.titlePadding||0,l=i-a.x,c=i-a.y;switch(a.orient){case On:r+=Math.ceil(a.bounds.width())+u;break;case Rn:case kr:break;default:s+=a.bounds.height()+u}switch((r||s)&&Eo(e,n,r,s),a.orient){case On:c+=ea(t,n,a,o,1,1);break;case Rn:l+=ea(t,n,a,Rt,0,0)+u,c+=ea(t,n,a,o,1,1);break;case kr:l+=ea(t,n,a,o,0,0),c+=ea(t,n,a,Rt,-1,0,1)+u;break;default:l+=ea(t,n,a,o,0,0)}(l||c)&&Eo(e,a,l,c),(l=Math.round(a.bounds.x1-i))<0&&(Eo(e,n,-l,0),Eo(e,a,-l,0))}}function ea(e,t,n,i,r,s,a){const o=e.datum.type!=="symbol",u=n.datum.vgrad,l=o&&(s||!u)&&!a?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,p=r<=0?0:z0(n);return Math.round(i===Q0?f:i===Rt?d-p:.5*(c-p))}function Eo(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function L9(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function B9(e,t,n,i,r){var s=t.items[0],a=s.frame,o=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],p=o===On||o===Rn?i:n,h=0,g=0,m=0,y=0,b=0,v;if(a!==zf?o===On?(h=r.y2,p=r.y1):o===Rn?(h=r.y1,p=r.y2):(h=r.x1,p=r.x2):o===On&&(h=i,p=0),v=u===Q0?h:u===Rt?p:(h+p)/2,d&&d.text){switch(o){case Da:case kr:b=f.bounds.height()+c;break;case On:y=f.bounds.width()+c;break;case Rn:y=-f.bounds.width()-c;break}mt.clear().union(d.bounds),mt.translate(y-(d.x||0),b-(d.y||0)),fa(d,"x",y)|fa(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(mt),d.mark.bounds.clear().union(mt),e.dirty(d)),mt.clear().union(d.bounds)}else mt.clear();switch(mt.union(f.bounds),o){case Da:g=v,m=r.y1-mt.height()-l;break;case On:g=r.x1-mt.width()-l,m=v;break;case Rn:g=r.x2+mt.width()+l,m=v;break;case kr:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return fa(s,"x",g)|fa(s,"y",m)&&(mt.translate(g,m),e.dirty(s),s.bounds.clear().union(mt),t.bounds.clear().union(mt),e.dirty(s)),s.bounds}function oS(e){F.call(this,null,e)}z(oS,F,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&$9(n,i,e.layout),I9(n,i,e)}),P9(e.mark.group)?t.reflow():t}});function P9(e){return e&&e.mark.role!=="legend-entry"}function I9(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),a=new We().set(0,0,r,s),o=a.clone(),u=a.clone(),l=[],c,f,d,p,h,g;for(h=0,g=i.length;h{d=y.orient||Rn,d!==n1&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];aS(e,b,_9(b,y,n.legends,o,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===QF||n.autosize.type===ZF||n.autosize.type===eS))switch(y.orient){case On:case Rn:a.add(b.x1,0).add(b.x2,0);break;case Da:case kr:a.add(0,b.y1).add(0,b.y2)}else a.union(b)})}a.union(o).union(u),c&&a.union(B9(e,c,r,s,a)),t.clip&&a.set(0,0,t.width||0,t.height||0),z9(e,t,a,n)}function z9(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let a=e._width,o=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),p=Math.max(0,Math.ceil(n.y2-c));if(r.contains===p9){const h=e.padding();a-=h.left+h.right,o-=h.top+h.bottom}s===n1?(l=0,f=0,u=a,c=o):s===QF?(u=Math.max(0,a-l-d),c=Math.max(0,o-f-p)):s===ZF?(u=Math.max(0,a-l-d),o=c+f+p):s===eS?(a=u+l+d,c=Math.max(0,o-f-p)):s===m9&&(a=u+l+d,o=c+f+p),e._resizeView(a,o,u,c,[l,f],r.resize)}const U9=Object.freeze(Object.defineProperty({__proto__:null,bound:tS,identifier:r1,mark:nS,overlap:iS,render:sS,viewlayout:oS},Symbol.toStringTag,{value:"Module"}));function uS(e){F.call(this,null,e)}z(uS,F,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,a=e.count==null?e.values?e.values.length:10:e.count,o=A0(s,a,e.minstep),u=e.format||Mw(n,s,o,e.formatSpecifier,e.formatType,!!e.values),l=e.values?Nw(s,e.values,o):C0(s,o);return r&&(i.rem=r),r=l.map((c,f)=>be({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(be({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function lS(e){F.call(this,null,e)}function j9(){return be({})}function q9(e){const t=Ka().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}z(lS,F,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||j9,s=e.key||ee,a=this.value;return D(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(s))&&S("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=q9(s)),t.visit(t.ADD,o=>{const u=s(o);let l=a.get(u);l?l.exit?(a.empty--,i.add.push(l)):i.mod.push(l):(l=r(o),a.set(u,l),i.add.push(l)),l.datum=o,l.exit=!1}),t.visit(t.MOD,o=>{const u=s(o),l=a.get(u);l&&(l.datum=o,i.mod.push(l))}),t.visit(t.REM,o=>{const u=s(o),l=a.get(u);o===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}});function cS(e){F.call(this,null,e)}z(cS,F,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(D(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var a=s==="enter",o=r.update||ir,u=r.enter||ir,l=r.exit||ir,c=(s&&!a?r[s]:o)||ir;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),o(f,e)}),n.modifies(u.output),n.modifies(o.output),c!==ir&&c!==o&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ir&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),a||c!==ir){const f=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(f,d=>{const p=u(d,e)||i;(c(d,e)||p)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function fS(e){F.call(this,[],e)}z(fS,F,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Kl,a=e.scale,o=+e.limit,u=A0(a,e.count==null?5:e.count,e.minstep),l=!!e.values||s===Kl,c=e.format||Iw(n,a,u,s,e.formatSpecifier,e.formatType,l),f=e.values||Pw(a,u),d,p,h,g,m;return r&&(i.rem=r),s===Kl?(o&&f.length>o?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,o-1),m=!0):r=f,ae(h=e.size)?(!e.values&&a(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,h(b,e)),0)):h=kt(g=h||8),r=r.map((y,b)=>be({index:b,label:c(y,b,r),value:y,offset:g,size:h(y,e)})),m&&(m=f[r.length],r.push(be({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:h(m,e)})))):s===m6?(d=a.domain(),p=Rw(a,d[0],ce(d)),f.length<3&&!e.values&&d[0]!==ce(d)&&(f=[d[0],ce(d)]),r=f.map((y,b)=>be({index:b,label:c(y,b,f),value:y,perc:p(y)}))):(h=f.length-1,p=$6(a),r=f.map((y,b)=>be({index:b,label:c(y,b,f),value:y,perc:b?p(y):0,perc2:b===h?1:p(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const W9=e=>e.source.x,G9=e=>e.source.y,H9=e=>e.target.x,V9=e=>e.target.y;function s1(e){F.call(this,{},e)}s1.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};z(s1,F,{transform(e,t){var n=e.sourceX||W9,i=e.sourceY||G9,r=e.targetX||H9,s=e.targetY||V9,a=e.as||"path",o=e.orient||"vertical",u=e.shape||"line",l=ov.get(u+"-"+o)||ov.get(u);return l||S("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[a]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(a)}});const dS=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,X9=(e,t,n,i)=>dS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),hS=(e,t,n,i)=>{var r=n-e,s=i-t,a=Math.hypot(r,s)/2,o=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+a+","+a+" "+o+" 0 1 "+n+","+i},Y9=(e,t,n,i)=>hS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),pS=(e,t,n,i)=>{const r=n-e,s=i-t,a=.2*(r+s),o=.2*(s-r);return"M"+e+","+t+"C"+(e+a)+","+(t+o)+" "+(n+o)+","+(i-a)+" "+n+","+i},K9=(e,t,n,i)=>pS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),J9=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Q9=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Z9=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),a=Math.cos(n),o=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*a+","+t*o+"L"+i*a+","+i*o},eL=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},tL=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},nL=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),a=Math.cos(n),o=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*a+","+u*o+" "+i*a+","+i*o},ov=Ka({line:dS,"line-radial":X9,arc:hS,"arc-radial":Y9,curve:pS,"curve-radial":K9,"orthogonal-horizontal":J9,"orthogonal-vertical":Q9,"orthogonal-radial":Z9,"diagonal-horizontal":eL,"diagonal-vertical":tL,"diagonal-radial":nL});function a1(e){F.call(this,null,e)}a1.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};z(a1,F,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Ha,a=e.startAngle||0,o=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=a,d=(o-a)/y2(l),p=Ms(c),h,g,m;for(e.sort&&p.sort((y,b)=>l[y]-l[b]),h=0;h-1)return i;var r=t.domain,s=e.type,a=t.zero||t.zero===void 0&&rL(e),o,u;if(!r)return 0;if((a||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(o=(r=r.slice()).length-1||1,a&&(r[0]>0&&(r[0]=0),r[o]<0&&(r[o]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[o]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[o]?o+1:ur+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+P(t))}return t}function fL(e,t,n){let i=t.bins;if(i&&!D(i)){const r=e.domain(),s=r[0],a=ce(r),o=i.step;let u=i.start==null?s:i.start,l=i.stop==null?a:i.stop;o||S("Scale bins parameter missing step property."),ua&&(l=o*Math.floor(a/o)),i=Ms(u,l+o/2,o)}return i?e.bins=i:e.bins&&delete e.bins,e.type===m0&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function dL(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=hL(i,t,n);else if(t.scheme&&(s=pL(i,t,n),ae(s))){if(e.interpolator)return e.interpolator(s);S(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&$w(i))return e.interpolator(kf(Vp(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(v0(t.interpolate,t.interpolateGamma)):ae(e.round)?e.round(r):ae(e.rangeRound)&&e.interpolate(r?X5:Y5),s&&e.range(Vp(s,t.reverse))}function hL(e,t,n){e!==vw&&e!==_p&&S("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===_p?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*p0(n,r,i)]}function pL(e,t,n){var i=t.schemeExtent,r,s;return D(t.scheme)?s=kf(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=E0(r),s||S(`Unrecognized scheme name: ${t.scheme}`)),n=e===$f?n+1:e===m0?n-1:e===wa||e===Sf?+t.schemeCount||iL:n,$w(e)?uv(s,i,t.reverse):ae(s)?Ow(uv(s,i),n):e===g0?s:s.slice(0,n)}function uv(e,t,n){return ae(e)&&(t||n)?Dw(e,Vp(t||[0,1],n)):e}function Vp(e,t){return t?e.slice().reverse():e}function bS(e){F.call(this,null,e)}z(bS,F,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Ls(e.sort)),this.modified(n),t}});const lv="zero",xS="center",vS="normalize",ES=["y0","y1"];function o1(e){F.call(this,null,e)}o1.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:lv,values:[lv,xS,vS]},{name:"as",type:"string",array:!0,length:2,default:ES}]};z(o1,F,{transform(e,t){var n=e.as||ES,i=n[0],r=n[1],s=Ls(e.sort),a=e.field||Ha,o=e.offset===xS?gL:e.offset===vS?mL:yL,u,l,c,f;for(u=bL(t.source,e.groupby,s,a),l=0,c=u.length,f=u.max;lg(c),a,o,u,l,c,f,d,p,h;if(t==null)r.push(e.slice());else for(a={},o=0,u=e.length;oh&&(h=p),n&&d.sort(n)}return r.max=h,r}const xL=Object.freeze(Object.defineProperty({__proto__:null,axisticks:uS,datajoin:lS,encode:cS,legendentries:fS,linkpath:s1,pie:a1,scale:mS,sortitems:bS,stack:o1},Symbol.toStringTag,{value:"Module"})),vL=b2(),Xp=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function EL(e,t){return function n(){const i=t();return i.type=e,i.path=b2().projection(i),i.copy=i.copy||function(){const r=n();return Xp.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},ww(i)}}function u1(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Lc[e]=EL(e,t),this):Lc[e]||null}function AS(e){return e&&e.path||vL}const Lc={albers:r5,albersusa:i5,azimuthalequalarea:n5,azimuthalequidistant:t5,conicconformal:e5,conicequalarea:ZR,conicequidistant:QR,equalEarth:JR,equirectangular:KR,gnomonic:YR,identity:XR,mercator:VR,mollweide:HR,naturalEarth1:GR,orthographic:WR,stereographic:qR,transversemercator:jR};for(const e in Lc)u1(e,Lc[e]);function AL(){}const Oi=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function CS(){var e=1,t=1,n=o;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),CL(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var p=0,h=c.length,g;p=l,Oi[m<<1].forEach(v);++p=l,Oi[g|m<<1].forEach(v);for(Oi[m<<0].forEach(v);++h=l,y=u[h*e]>=l,Oi[m<<1|y<<2].forEach(v);++p=l,b=y,y=u[h*e+p+1]>=l,Oi[g|m<<1|y<<2|b<<3].forEach(v);Oi[m|y<<3].forEach(v)}for(p=-1,y=u[h*e]>=l,Oi[y<<2].forEach(v);++p=l,Oi[y<<2|b<<3].forEach(v);Oi[y<<3].forEach(v);function v(A){var E=[A[0][0]+p,A[0][1]+h],C=[A[1][0]+p,A[1][1]+h],x=a(E),w=a(C),R,L;(R=d[x])?(L=f[w])?(delete d[R.end],delete f[L.start],R===L?(R.ring.push(C),c(R.ring)):f[R.start]=d[L.end]={start:R.start,end:L.end,ring:R.ring.concat(L.ring)}):(delete d[R.end],R.ring.push(C),d[R.end=w]=R):(R=f[w])?(L=d[x])?(delete f[R.start],delete d[L.end],R===L?(R.ring.push(C),c(R.ring)):f[L.start]=d[R.end]={start:L.start,end:R.end,ring:L.ring.concat(R.ring)}):(delete f[R.start],R.ring.unshift(E),f[R.start=x]=R):f[x]=d[w]={start:x,end:w,ring:[E,C]}}}function a(u){return u[0]*2+u[1]*(e+1)*4}function o(u,l,c){u.forEach(f=>{var d=f[0],p=f[1],h=d|0,g=p|0,m,y=l[g*e+h];d>0&&d0&&p=0&&c>=0||S("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?o:AL,i):n===o},i}function CL(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=p>i&&n<(d-l)*(i-c)/(p-c)+l&&(r=-r)}return r}function SL(e,t,n){var i;return $L(e,t,n)&&kL(e[i=+(e[0]===t[0])],n[i],t[i])}function $L(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function kL(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function wS(e,t,n){return function(i){var r=di(i),s=n?Math.min(r[0],0):r[0],a=r[1],o=a-s,u=t?au(s,a,e):o/(e+1);return Ms(s+u,a,u)}}function l1(e){F.call(this,null,e)}l1.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};z(l1,F,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||$t,s=CS().smooth(e.smooth!==!1),a=e.thresholds||DL(i,r,e),o=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,D(a)?a:a(c.values));OL(f,c,l,e),f.forEach(d=>{u.push(mf(l,be(o!=null?{[o]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function DL(e,t,n){const i=wS(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Yo(t(r).values)))}function OL(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(ae(r)&&(r=r(n,i)),ae(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const a=(ge(r)?r:r[0])||1,o=(ge(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(FS(t,a,o,u,l))}function FS(e,t,n,i,r){const s=e.x1||0,a=e.y1||0,o=t*n<0;function u(f){f.forEach(l)}function l(f){o&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-a)*n+r}return function(f){return f.coordinates.forEach(u),f}}function cv(e,t,n){const i=e>=0?e:km(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function gh(e){return ae(e)?e:kt(+e)}function SS(){var e=u=>u[0],t=u=>u[1],n=Ha,i=[-1,-1],r=960,s=500,a=2;function o(u,l){const c=cv(i[0],u,e)>>a,f=cv(i[1],u,t)>>a,d=c?c+2:0,p=f?f+2:0,h=2*d+(r>>a),g=2*p+(s>>a),m=new Float32Array(h*g),y=new Float32Array(h*g);let b=m;u.forEach(A=>{const E=d+(+e(A)>>a),C=p+(+t(A)>>a);E>=0&&E=0&&C0&&f>0?(ta(h,g,m,y,c),na(h,g,y,m,f),ta(h,g,m,y,c),na(h,g,y,m,f),ta(h,g,m,y,c),na(h,g,y,m,f)):c>0?(ta(h,g,m,y,c),ta(h,g,y,m,c),ta(h,g,m,y,c),b=y):f>0&&(na(h,g,m,y,f),na(h,g,y,m,f),na(h,g,m,y,f),b=y);const v=l?Math.pow(2,-2*a):1/y2(b);for(let A=0,E=h*g;A>a),y2:p+(s>>a)}}return o.x=function(u){return arguments.length?(e=gh(u),o):e},o.y=function(u){return arguments.length?(t=gh(u),o):t},o.weight=function(u){return arguments.length?(n=gh(u),o):n},o.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||S("invalid size"),r=l,s=c,o},o.cellSize=function(u){return arguments.length?((u=+u)>=1||S("invalid cell size"),a=Math.floor(Math.log(u)/Math.LN2),o):1<=r&&(o>=s&&(u-=n[o-s+a*e]),i[o-r+a*e]=u/Math.min(o+1,e-1+s-o,s))}function na(e,t,n,i,r){const s=(r<<1)+1;for(let a=0;a=r&&(o>=s&&(u-=n[a+(o-s)*e]),i[a+(o-r)*e]=u/Math.min(o+1,t-1+s-o,s))}function c1(e){F.call(this,null,e)}c1.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const RL=["x","y","weight","size","cellSize","bandwidth"];function $S(e,t){return RL.forEach(n=>t[n]!=null?e[n](t[n]):0),e}z(c1,F,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=_L(i,e.groupby),s=(e.groupby||[]).map(ze),a=$S(SS(),e),o=e.as||"grid",u=[];function l(c,f){for(let d=0;dbe(l({[o]:a(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function _L(e,t){var n=[],i=c=>c(o),r,s,a,o,u,l;if(t==null)n.push(e);else for(r={},s=0,a=e.length;sn.push(o(c))),s&&a&&(t.visit(u,c=>{var f=s(c),d=a(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Yp,geometry:{type:TL,coordinates:i}})),this.value={type:d1,features:n}}});function p1(e){F.call(this,null,e)}p1.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};z(p1,F,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||$t,s=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=AS(e.projection),n.materialize().reflow()):a=r===$t||t.modified(r.fields)?n.ADD_MOD:n.ADD;const o=NL(i,e.pointRadius);return n.visit(a,u=>u[s]=i(r(u))),i.pointRadius(o),n.modifies(s)}});function NL(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function g1(e){F.call(this,null,e)}g1.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};z(g1,F,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],a=s[0],o=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[a]=f[0],c[o]=f[1]):(c[a]=void 0,c[o]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function m1(e){F.call(this,null,e)}m1.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};z(m1,F,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=ML(AS(e.projection),e.field||gn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,a=>a[r]=i),n.modifies(r)}});function ML(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),a=e.pointRadius(n)(t(r));return e.pointRadius(s),a};return i.context=r=>(e.context(r),i),i}function y1(e){F.call(this,[],e),this.generator=s5()}y1.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};z(y1,F,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)ae(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(kC(n[0],r)):t.add.push(be(r)),n[0]=r,t}});function b1(e){F.call(this,null,e)}b1.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};z(b1,F,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||$t,s=BL(e.opacity,e),a=LL(e.color,e),o=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Yo(n.map(l=>Yo(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=se({},l,u);i||(f.$max=Yo(c.values||[])),l[o]=PL(c,f,a.dep?a:kt(a(f)),s.dep?s:kt(s(f)))}),t.reflow(!0).modifies(o)}});function LL(e,t){let n;return ae(e)?(n=i=>yc(e(i,t)),n.dep=kS(e)):n=kt(yc(e||"#888")),n}function BL(e,t){let n;return ae(e)?(n=i=>e(i,t),n.dep=kS(e)):e?n=kt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function kS(e){if(!ae(e))return!1;const t=Ln(Et(e));return t.$x||t.$y||t.$value||t.$max}function PL(e,t,n,i){const r=e.width,s=e.height,a=e.x1||0,o=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:cr,d=Er(u-a,l-o),p=d.getContext("2d"),h=p.getImageData(0,0,u-a,l-o),g=h.data;for(let m=o,y=0;m{e[i]!=null&&fv(n,i,e[i])})):Xp.forEach(i=>{e.modified(i)&&fv(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&IL(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function IL(e,t){const n=UL(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function zL(e){const t=u1((e||"mercator").toLowerCase());return t||S("Unrecognized projection type: "+e),t()}function fv(e,t,n){ae(e[t])&&e[t](n)}function UL(e){return e=W(e),e.length===1?e[0]:{type:d1,features:e.reduce((t,n)=>t.concat(jL(n)),[])}}function jL(e){return e.type===d1?e.features:W(e).filter(t=>t!=null).map(t=>t.type===Yp?t:{type:Yp,geometry:t})}const qL=Object.freeze(Object.defineProperty({__proto__:null,contour:f1,geojson:h1,geopath:p1,geopoint:g1,geoshape:m1,graticule:y1,heatmap:b1,isocontour:l1,kde2d:c1,projection:DS},Symbol.toStringTag,{value:"Module"})),dv={center:d5,collide:f5,nbody:c5,link:l5,x:u5,y:o5},jo="forces",Kp=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],WL=["static","iterations"],OS=["x","y","vx","vy"];function x1(e){F.call(this,null,e)}x1.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:OS}]};z(x1,F,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Kp),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&RS(n,e,0,t)):(this.value=n=HL(t.source,e),n.on("tick",GL(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(WL)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let o=this._argops,u=0,l=o.length,c;ue.touch(t).run()}function HL(e,t){const n=a5(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),RS(n,t,!0).on("end",()=>s=!0)}function RS(e,t,n,i){var r=W(t.forces),s,a,o,u;for(s=0,a=Kp.length;st(i,n):t)}const KL=Object.freeze(Object.defineProperty({__proto__:null,force:x1},Symbol.toStringTag,{value:"Module"}));function Jp(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function v1(e){F.call(this,null,e)}v1.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const JL=e=>e.values;z(v1,F,{transform(e,t){t.source||S("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(a=>{a.children&&gf(a.data)&&r.rem.push(a.data)}),this.value=s=C_({values:W(e.keys).reduce((a,o)=>(a.key(o),a),QL()).entries(r.source)},JL),n&&s.each(a=>{a.children&&(a=be(a.data),r.add.push(a),r.source.push(a))}),Jp(s,ee,ee)),r.source.root=s,r}});function QL(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const a=r.length,o=e[s++],u={},l={};let c=-1,f,d,p;for(;++ce.length)return r;const a=[];for(const o in r)a.push({key:o,values:i(r[o],s)});return a}return t}function Xi(e){F.call(this,null,e)}const ZL=(e,t)=>e.parent===t.parent?1:2;z(Xi,F,{transform(e,t){(!t.source||!t.source.root)&&S(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Ls(e.sort,a=>a.data)),eB(n,this.params,e),n.separation&&n.separation(e.separation!==!1?ZL:Ha);try{this.value=n(r)}catch(a){S(a)}return r.each(a=>tB(a,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function eB(e,t,n){for(let i,r=0,s=t.length;rs[ee(a)]=1),i.each(a=>{const o=a.data,u=a.parent&&a.parent.data;u&&s[ee(o)]&&s[ee(u)]&&r.add.push(be({source:u,target:o}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,a=>s[ee(a)]=1),n.forEach(a=>{(s[ee(a.source)]||s[ee(a.target)])&&r.mod.push(a)})),r}});const pv={binary:x5,dice:$_,slice:S_,slicedice:b5,squarify:F_,resquarify:y5},tg=["x0","y0","x1","y1","depth","children"];function S1(e){Xi.call(this,e)}S1.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:tg.length,default:tg}]};z(S1,Xi,{layout(){const e=w_();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{H(pv,t)?e.tile(pv[t]):S("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:tg});const nB=Object.freeze(Object.defineProperty({__proto__:null,nest:v1,pack:E1,partition:A1,stratify:C1,tree:w1,treelinks:F1,treemap:S1},Symbol.toStringTag,{value:"Module"})),mh=4278190080;function iB(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function rB(e,t,n,i,r){const s=e.width,a=e.height,o=i||r,u=Er(s,a).getContext("2d"),l=Er(s,a).getContext("2d"),c=o&&Er(s,a).getContext("2d");n.forEach(w=>sc(u,w,!1)),sc(l,t,!1),o&&sc(c,t,!0);const f=yh(u,s,a),d=yh(l,s,a),p=o&&yh(c,s,a),h=e.bitmap(),g=o&&e.bitmap();let m,y,b,v,A,E,C,x;for(y=0;y{r.items.forEach(s=>sc(e,s.items,n))}):sn[i].draw(e,{items:n?t.map(sB):t})}function sB(e){const t=mf(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ri=5,Dt=31,hu=32,ur=new Uint32Array(hu+1),Dn=new Uint32Array(hu+1);Dn[0]=0;ur[0]=~Dn[0];for(let e=1;e<=hu;++e)Dn[e]=Dn[e-1]<<1|1,ur[e]=~Dn[e];function aB(e,t){const n=new Uint32Array(~~((e*t+hu)/hu));function i(s,a){n[s]|=a}function r(s,a){n[s]&=a}return{array:n,get:(s,a)=>{const o=a*e+s;return n[o>>>Ri]&1<<(o&Dt)},set:(s,a)=>{const o=a*e+s;i(o>>>Ri,1<<(o&Dt))},clear:(s,a)=>{const o=a*e+s;r(o>>>Ri,~(1<<(o&Dt)))},getRange:(s,a,o,u)=>{let l=u,c,f,d,p;for(;l>=a;--l)if(c=l*e+s,f=l*e+o,d=c>>>Ri,p=f>>>Ri,d===p){if(n[d]&ur[c&Dt]&Dn[(f&Dt)+1])return!0}else{if(n[d]&ur[c&Dt]||n[p]&Dn[(f&Dt)+1])return!0;for(let h=d+1;h{let l,c,f,d,p;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Ri,d=c>>>Ri,f===d)i(f,ur[l&Dt]&Dn[(c&Dt)+1]);else for(i(f,ur[l&Dt]),i(d,Dn[(c&Dt)+1]),p=f+1;p{let l,c,f,d,p;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Ri,d=c>>>Ri,f===d)r(f,Dn[l&Dt]|ur[(c&Dt)+1]);else for(r(f,Dn[l&Dt]),r(d,ur[(c&Dt)+1]),p=f+1;ps<0||a<0||u>=t||o>=e}}function oB(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),a=o=>~~((o+n)/i);return a.invert=o=>o*i-n,a.bitmap=()=>aB(r,s),a.ratio=i,a.padding=n,a.width=e,a.height=t,a}function uB(e,t,n,i){const r=e.width,s=e.height;return function(a){const o=a.datum.datum.items[i].items,u=o.length,l=a.datum.fontSize,c=Zt.width(a.datum,a.datum.text);let f=0,d,p,h,g,m,y,b;for(let v=0;v=f&&(f=b,a.x=m,a.y=y);return m=c/2,y=l/2,d=a.x-m,p=a.x+m,h=a.y-y,g=a.y+y,a.align="center",d<0&&p<=r?a.align="left":0<=d&&rr||t-(a=i/2)<0||t+a>s}function yr(e,t,n,i,r,s,a,o){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||o&&o.getRange(l,f,c,d)}function lB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1];function u(l,c,f,d,p){const h=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Bc(h,g,d,p,r,s)&&!yr(e,h,g,p,d,m,a,o)&&!yr(e,h,g,p,d,p,a,null)){for(;y-m>=1;)b=(m+y)/2,yr(e,h,g,p,d,b,a,o)?y=b:m=b;if(m>f)return[h,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=Zt.width(l.datum,l.datum.text);let h=n?d:0,g=!1,m=!1,y=0,b,v,A,E,C,x,w,R,L,J,ne,de,N,O,I,G,X;for(let V=0;Vv&&(X=b,b=v,v=X),A>E&&(X=A,A=E,E=X),L=e(b),ne=e(v),J=~~((L+ne)/2),de=e(A),O=e(E),N=~~((de+O)/2),w=J;w>=L;--w)for(R=N;R>=de;--R)G=u(w,R,h,p,d),G&&([l.x,l.y,h,g]=G);for(w=J;w<=ne;++w)for(R=N;R<=O;++R)G=u(w,R,h,p,d),G&&([l.x,l.y,h,g]=G);!g&&!n&&(I=Math.abs(v-b+E-A),C=(b+v)/2,x=(A+E)/2,I>=y&&!Bc(C,x,p,d,r,s)&&!yr(e,C,x,d,p,d,a,null)&&(y=I,l.x=C,l.y=x,m=!0))}return g||m?(C=p/2,x=d/2,a.setRange(e(l.x-C),e(l.y-x),e(l.x+C),e(l.y+x)),l.align="center",l.baseline="middle",!0):!1}}const cB=[-1,-1,1,1],fB=[-1,1,-1,1];function dB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=Zt.width(l.datum,l.datum.text),h=[];let g=n?d:0,m=!1,y=!1,b=0,v,A,E,C,x,w,R,L,J,ne,de,N;for(let O=0;O=1;)de=(J+ne)/2,yr(e,x,w,d,p,de,a,o)?ne=de:J=de;J>g&&(l.x=x,l.y=w,g=J,m=!0)}}!m&&!n&&(N=Math.abs(A-v+C-E),x=(v+A)/2,w=(E+C)/2,N>=b&&!Bc(x,w,p,d,r,s)&&!yr(e,x,w,d,p,d,a,null)&&(b=N,l.x=x,l.y=w,y=!0))}return m||y?(x=p/2,w=d/2,a.setRange(e(l.x-x),e(l.y-w),e(l.x+x),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const hB=["right","center","left"],pB=["bottom","middle","top"];function gB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,p,h,g,m,y,b,v,A,E,C,x,w,R,L,J;for(let ne=0;ne>>2&3)-1,g=p===0&&h===0||i[ne]<0,m=p&&h?Math.SQRT1_2:1,y=i[ne]<0?-1:1,b=c[1+p]+i[ne]*p*m,x=c[4+h]+y*f*h/2+i[ne]*h*m,A=x-f/2,E=x+f/2,w=e(b),L=e(A),J=e(E),!d)if(gv(w,w,L,J,a,o,b,b,A,E,c,g))d=Zt.width(l.datum,l.datum.text);else continue;if(C=b+y*d*p/2,b=C-d/2,v=C+d/2,w=e(b),R=e(v),gv(w,R,L,J,a,o,b,v,A,E,c,g))return l.x=p?p*y<0?v:b:C,l.y=h?h*y<0?E:A:x,l.align=hB[p*y+1],l.baseline=pB[h*y+1],a.setRange(w,L,R,J),!0}return!1}}function gv(e,t,n,i,r,s,a,o,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const bh=0,xh=4,vh=8,Eh=0,Ah=1,Ch=2,mB={"top-left":bh+Eh,top:bh+Ah,"top-right":bh+Ch,left:xh+Eh,middle:xh+Ah,right:xh+Ch,"bottom-left":vh+Eh,bottom:vh+Ah,"bottom-right":vh+Ch},yB={naive:uB,"reduced-search":lB,floodfill:dB};function bB(e,t,n,i,r,s,a,o,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=xB(i,f),p=vB(r,f),h=EB(e[0].datum),g=h==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=AB(h,g,o,u),b=l===null||l===1/0,v=m&&c==="naive";let A=-1,E=-1;const C=e.map(L=>{const J=b?Zt.width(L,L.text):void 0;return A=Math.max(A,J),E=Math.max(E,L.fontSize),{datum:L,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(L),textWidth:J}});l=l===null||l===1/0?Math.max(A,E)+Math.max(...i):l;const x=oB(t[0],t[1],l);let w;if(!v){n&&C.sort((ne,de)=>n(ne.datum,de.datum));let L=!1;for(let ne=0;nene.datum);w=s.length||J?rB(x,J||[],s,L,m):iB(x,a&&C)}const R=m?yB[c](x,w,a,u):gB(x,w,p,d);return C.forEach(L=>L.opacity=+R(L)),C}function xB(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const a=s.datum.items[i].items;return r(a.length?a[n==="start"?0:a.length-1]:{x:NaN,y:NaN})}:s=>{const a=s.datum.bounds;return[a.x1,(a.x1+a.x2)/2,a.x2,a.y1,(a.y1+a.y2)/2,a.y2]}:r}const ng=["x","y","opacity","align","baseline"],_S=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $1(e){F.call(this,null,e)}$1.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:_S},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:ng.length,default:ng}]};z($1,F,{transform(e,t){function n(s){const a=e[s];return ae(a)&&t.modified(a.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&S("Size parameter should be specified as a [width, height] array.");const r=e.as||ng;return bB(t.materialize(t.SOURCE).source||[],e.size,e.sort,W(e.offset==null?1:e.offset),W(e.anchor||_S),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const a=s.datum;a[r[0]]=s.x,a[r[1]]=s.y,a[r[2]]=s.opacity,a[r[3]]=s.align,a[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const CB=Object.freeze(Object.defineProperty({__proto__:null,label:$1},Symbol.toStringTag,{value:"Module"}));function TS(e,t){var n=[],i=function(c){return c(o)},r,s,a,o,u,l;if(t==null)n.push(e);else for(r={},s=0,a=e.length;s{HC(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function D1(e){F.call(this,null,e)}D1.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(ig)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};z(D1,F,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=TS(i,e.groupby),s=(e.groupby||[]).map(ze),a=e.method||"linear",o=e.order==null?3:e.order,u=wB(a,o),l=e.as||[ze(e.x),ze(e.y)],c=ig[a],f=[];let d=e.extent;H(ig,a)||S("Invalid regression method: "+a),d!=null&&a==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(p=>{if(p.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(p,e.x,e.y,o);if(e.params){f.push(be({keys:p.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||di(p,e.x),y=b=>{const v={};for(let A=0;Ay([b,g.predict(b)])):Cf(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const FB=Object.freeze(Object.defineProperty({__proto__:null,loess:k1,regression:D1},Symbol.toStringTag,{value:"Module"}));function O1(e){F.call(this,null,e)}O1.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const SB=[-1e5,-1e5,1e5,1e5];z(O1,F,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:SB;const s=this.value=v5.from(i,e.x,e.y).voronoi(r);for(let a=0,o=i.length;a>5)*e[1]),m=null,y=l.length,b=-1,v=[],A=l.map(C=>({text:t(C),font:n(C),style:r(C),weight:s(C),rotate:a(C),size:~~(i(C)+1e-14),padding:o(C),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:C})).sort((C,x)=>x.size-C.size);++b>1,E.y=e[1]*(c()+.5)>>1,RB(h,E,A,b),E.hasText&&p(g,E,m)&&(v.push(E),m?TB(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(h){h.width=h.height=1;var g=Math.sqrt(h.getContext("2d").getImageData(0,0,1,1).data.length>>2);h.width=(qo<<5)/g,h.height=ac/g;var m=h.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function p(h,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),A=u(e),E=c()<.5?1:-1,C=-E,x,w,R;(x=A(C+=E))&&(w=~~x[0],R=~~x[1],!(Math.min(Math.abs(w),Math.abs(R))>=v));)if(g.x=y+w,g.y=b+R,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!_B(g,h,e[0]))&&(!m||NB(g,m))){for(var L=g.sprite,J=g.width>>5,ne=e[0]>>5,de=g.x-(J<<4),N=de&127,O=32-N,I=g.y1-g.y0,G=(g.y+g.y0)*ne+(de>>5),X,V=0;V>>N:0);G+=ne}return g.sprite=null,!0}return!1}return f.words=function(h){return arguments.length?(l=h,f):l},f.size=function(h){return arguments.length?(e=[+h[0],+h[1]],f):e},f.font=function(h){return arguments.length?(n=Vr(h),f):n},f.fontStyle=function(h){return arguments.length?(r=Vr(h),f):r},f.fontWeight=function(h){return arguments.length?(s=Vr(h),f):s},f.rotate=function(h){return arguments.length?(a=Vr(h),f):a},f.text=function(h){return arguments.length?(t=Vr(h),f):t},f.spiral=function(h){return arguments.length?(u=BB[h]||h,f):u},f.fontSize=function(h){return arguments.length?(i=Vr(h),f):i},f.padding=function(h){return arguments.length?(o=Vr(h),f):o},f.random=function(h){return arguments.length?(c=h,f):c},f}function RB(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(qo<<5)/s,ac/s);var a=0,o=0,u=0,l=n.length,c,f,d,p,h;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),a+c>=qo<<5&&(a=0,o+=u,u=0),o+d>=ac)break;r.translate((a+(c>>1))/s,(o+(d>>1))/s),t.rotate&&r.rotate(t.rotate*wh),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=a,t.yoff=o,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=c}for(var E=r.getImageData(0,0,(qo<<5)/s,ac/s).data,C=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,p=0;p>5),L=E[(o+h)*(qo<<5)+(a+p)<<2]?1<<31-p%32:0;C[R]|=L,x|=L}x?w=h:(t.y0++,d--,h--,o++)}t.y1=t.y0+w,t.sprite=C.slice(0,(t.y1-t.y0)*f)}}}function _B(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),a=s&127,o=32-a,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f>>a:0))&t[l+d])return!0;l+=n}return!1}function TB(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function NB(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(h(m))}r.forEach(h=>{h[a[0]]=NaN,h[a[1]]=NaN,h[a[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(o).random(bn).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,p=l.length;for(let h=0,g,m;hnew Uint8Array(e),UB=e=>new Uint16Array(e),Zo=e=>new Uint32Array(e);function jB(){let e=8,t=[],n=Zo(0),i=Dl(0,e),r=Dl(0,e);return{data:()=>t,seen:()=>n=qB(n,t.length),add(s){for(let a=0,o=t.length,u=s.length,l;at.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,a){i[s]|=a},clear(s,a){i[s]&=~a},resize(s,a){const o=i.length;(s>o||a>e)&&(e=Math.max(a,e),i=Dl(s,e,i),r=Dl(s,e))}}}function qB(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Dl(e,t,n){const i=(t<257?zB:t<65537?UB:Zo)(e);return n&&i.set(n),i}function mv(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function WB(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),E5(e,t)}function GB(e,t,n,i,r,s,a,o,u){let l=0,c=0,f;for(f=0;lt.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],a=i.length;let o=0,u,l;for(;o{const s=r.remove(t,n);for(const a in i)i[a].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,a=i.length;let o=0,u,l;for(n.filters=0,l=0;lp)for(m=p,y=Math.min(f,h);mh)for(m=Math.max(f,h),y=d;mf)for(h=f,g=Math.min(l,d);hd)for(h=Math.max(l,d),g=c;ho[c]&n?null:a[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=o[c]&n;return!f&&f^u[c]&n?a[c]:null}),s.filter(s.REM,c=>{const f=o[c]&n;return f&&!(f^(f^u[c]&n))?a[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(o[c]&n)===r?a[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const HB=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:_1,resolvefilter:T1},Symbol.toStringTag,{value:"Module"})),VB="RawCode",xs="Literal",XB="Property",YB="Identifier",KB="ArrayExpression",JB="BinaryExpression",LS="CallExpression",QB="ConditionalExpression",ZB="LogicalExpression",e7="MemberExpression",t7="ObjectExpression",n7="UnaryExpression";function qn(e){this.type=e}qn.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=i7(this),n=0,i=t.length;n";vi[vs]="Identifier";vi[Lr]="Keyword";vi[jf]="Null";vi[Is]="Numeric";vi[Lt]="Punctuator";vi[Ku]="String";vi[r7]="RegularExpression";var s7="ArrayExpression",a7="BinaryExpression",o7="CallExpression",u7="ConditionalExpression",BS="Identifier",l7="Literal",c7="LogicalExpression",f7="MemberExpression",d7="ObjectExpression",h7="Property",p7="UnaryExpression",Qe="Unexpected token %0",g7="Unexpected number",m7="Unexpected string",y7="Unexpected identifier",b7="Unexpected reserved word",x7="Unexpected end of input",rg="Invalid regular expression",Fh="Invalid regular expression: missing /",PS="Octal literals are not allowed in strict mode.",v7="Duplicate data property in object literal not allowed in strict mode",lt="ILLEGAL",pu="Disabled.",E7=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),A7=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function qf(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ni(e){return e>=48&&e<=57}function N1(e){return"0123456789abcdefABCDEF".includes(e)}function eu(e){return"01234567".includes(e)}function C7(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function gu(e){return e===10||e===13||e===8232||e===8233}function Ju(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&E7.test(String.fromCharCode(e))}function Pc(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&A7.test(String.fromCharCode(e))}const w7={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function IS(){for(;$1114111||e!=="}")&&he({},Qe,lt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function zS(){var e,t;for(e=Y.charCodeAt($++),t=String.fromCharCode(e),e===92&&(Y.charCodeAt($)!==117&&he({},Qe,lt),++$,e=sg("u"),(!e||e==="\\"||!Ju(e.charCodeAt(0)))&&he({},Qe,lt),t=e);$>>=")return $+=4,{type:Lt,value:a,start:e,end:$};if(s=a.substr(0,3),s===">>>"||s==="<<="||s===">>=")return $+=3,{type:Lt,value:s,start:e,end:$};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return $+=2,{type:Lt,value:r,start:e,end:$};if(r==="//"&&he({},Qe,lt),"<>=!+-*%&|^/".includes(i))return++$,{type:Lt,value:i,start:e,end:$};he({},Qe,lt)}function k7(e){let t="";for(;$');function Et(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=ra();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var na=gt('');function Zt(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=na();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var ia=gt('');function Ht(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=ia();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var la=w('

API Docs

No API Routes found for

To expose an API endpoint of your app in this page, set the api_name parameter of the event listener.
For more information, visit the API Page guide . To hide the API documentation button and this page, set footer_links=["gradio", "settings"] in the Blocks.launch() method.

',1);function oa(d,s){$e(s,!1);const i=Lt();let c=m(s,"root",12);var v={get root(){return c()},set root(E){c(E),h()}};st();var _=la(),H=re(_),O=n(a(H),2),Z=n(a(O)),M=a(Z,!0);t(Z),t(O),be(2),t(H);var x=n(H,2),b=a(x);return Ft(b),t(x),R(()=>V(M,c())),Te("click",x,()=>i("close")),l(d,_),ke(v)}var ca=w('

API Recorder

',1),da=w('

documentation


',1);function pa(d,s){$e(s,!1);let i=m(s,"root",12),c=m(s,"api_count",12),v=m(s,"current_language",12,"python");const _=Lt();var H={get root(){return i()},set root(y){i(y),h()},get api_count(){return c()},set api_count(y){c(y),h()},get current_language(){return v()},set current_language(y){v(y),h()}};st();var O=da(),Z=re(O),M=a(Z),x=n(M,2),b=a(x);{var E=y=>{var Y=xe("MCP");l(y,Y)},ce=y=>{var Y=Ge(),le=re(Y);{var te=$=>{var K=xe("CLI");l($,K)},C=$=>{var K=xe("API");l($,K)};G(le,$=>{v()==="cli"?$(te):$(C,!1)},!0)}l(y,Y)};G(b,y=>{v()==="mcp"?y(E):y(ce,!1)})}var ee=n(b,2),q=a(ee,!0);t(ee),t(x);var g=n(x,2),o=a(g);{var P=y=>{Yt(y,{size:"sm",variant:"secondary",elem_id:"start-api-recorder",onclick:()=>_("close",{api_recorder_visible:!0}),children:(Y,le)=>{var te=ca();be(2),l(Y,te)},$$slots:{default:!0}})};G(o,y=>{v()!=="mcp"&&v()!=="cli"&&y(P)})}var U=n(o,2),T=a(U),F=a(T,!0);t(T);var k=n(T,2);{var f=y=>{var Y=xe("MCP Tool");l(y,Y)},L=y=>{var Y=Ge(),le=re(Y);{var te=$=>{var K=xe(`CLI +import{p as m,a as Ee,e as st,i as G,q as ot,w as ct,b as Ie,j as qt,f as Pt,d as Tt,v as St,y as Xt,J as Kt}from"./i18n-DtG3MAQ1.js";import{M as $e,t as R,a as l,O as ke,P as h,f as gt,a1 as Lt,N as re,S as n,Q as a,T as t,a5 as be,X as V,U as Te,R as w,a4 as xe,a3 as Ge,v as I,x as p,Z as e,Y as ve,_ as _t,a0 as B,$ as z,ad as Me,a7 as Bt,G as Vt,b1 as ea,a2 as Mt,ar as At,aq as jt,au as zt}from"./index-BeNBoC9J.js";import{b as Gt}from"./misc-D-Y84gKJ.js";import{C as Ft}from"./clear-Dx2v97Qg.js";import{a as ta,g as aa}from"./Blocks-C4lA_Loz.js";import{B as Yt}from"./Button-j0-_VC-G.js";import{L as Wt}from"./index-1YthqPsU.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as Le}from"./Block-DkzyQHli.js";import{h as Nt}from"./html-DE4EmiOG.js";import{a as sa}from"./input-BLFxNjIx.js";import"./size-ChvveZyb.js";import"./state.svelte-COyO-AzF.js";import"./index-DCGrAb1j.js";import"./index-tFQomdd2.js";import"./snippet-BRIBYCwB.js";import"./Image-ALBOEs1f.js";/* empty css *//* empty css */import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";var ra=gt('');function Et(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=ra();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var na=gt('');function Zt(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=na();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var ia=gt('');function Ht(d,s){$e(s,!1);let i=m(s,"icon_size",12,16);var c={get icon_size(){return i()},set icon_size(_){i(_),h()}},v=ia();return R(()=>{Ee(v,"width",i()),Ee(v,"height",i())}),l(d,v),ke(c)}var la=w('

API Docs

No API Routes found for

To expose an API endpoint of your app in this page, set the api_name parameter of the event listener.
For more information, visit the API Page guide . To hide the API documentation button and this page, set footer_links=["gradio", "settings"] in the Blocks.launch() method.

',1);function oa(d,s){$e(s,!1);const i=Lt();let c=m(s,"root",12);var v={get root(){return c()},set root(E){c(E),h()}};st();var _=la(),H=re(_),O=n(a(H),2),Z=n(a(O)),M=a(Z,!0);t(Z),t(O),be(2),t(H);var x=n(H,2),b=a(x);return Ft(b),t(x),R(()=>V(M,c())),Te("click",x,()=>i("close")),l(d,_),ke(v)}var ca=w('

API Recorder

',1),da=w('

documentation


',1);function pa(d,s){$e(s,!1);let i=m(s,"root",12),c=m(s,"api_count",12),v=m(s,"current_language",12,"python");const _=Lt();var H={get root(){return i()},set root(y){i(y),h()},get api_count(){return c()},set api_count(y){c(y),h()},get current_language(){return v()},set current_language(y){v(y),h()}};st();var O=da(),Z=re(O),M=a(Z),x=n(M,2),b=a(x);{var E=y=>{var Y=xe("MCP");l(y,Y)},ce=y=>{var Y=Ge(),le=re(Y);{var te=$=>{var K=xe("CLI");l($,K)},C=$=>{var K=xe("API");l($,K)};G(le,$=>{v()==="cli"?$(te):$(C,!1)},!0)}l(y,Y)};G(b,y=>{v()==="mcp"?y(E):y(ce,!1)})}var ee=n(b,2),q=a(ee,!0);t(ee),t(x);var g=n(x,2),o=a(g);{var P=y=>{Yt(y,{size:"sm",variant:"secondary",elem_id:"start-api-recorder",onclick:()=>_("close",{api_recorder_visible:!0}),children:(Y,le)=>{var te=ca();be(2),l(Y,te)},$$slots:{default:!0}})};G(o,y=>{v()!=="mcp"&&v()!=="cli"&&y(P)})}var U=n(o,2),T=a(U),F=a(T,!0);t(T);var k=n(T,2);{var f=y=>{var Y=xe("MCP Tool");l(y,Y)},L=y=>{var Y=Ge(),le=re(Y);{var te=$=>{var K=xe(`CLI endpoint`);l($,K)},C=$=>{var K=xe("API endpoint");l($,K)};G(le,$=>{v()==="cli"?$(te):$(C,!1)},!0)}l(y,Y)};G(k,y=>{v()==="mcp"?y(f):y(L,!1)})}var de=n(k);{var j=y=>{var Y=xe("s");l(y,Y)};G(de,y=>{c()>1&&y(j)})}be(),t(U),t(g),t(Z);var S=n(Z,2),X=a(S);return Ft(X),t(S),R(()=>{Ee(M,"src",ta),V(q,i()),V(F,c())}),Te("click",S,()=>_("close")),l(d,O),ke(H)}function ut(d,s,i=null){return s===void 0?i==="py"?"None":null:d===null&&i==="py"?"None":s==="string"||s==="str"?i===null?d:'"'+d+'"':s==="number"?i===null?parseFloat(d):d:s==="boolean"||s=="bool"?i==="py"?(d=String(d),d==="true"?"True":"False"):i==="js"||i==="bash"?d:d==="true":s==="List[str]"?(d=JSON.stringify(d),d):s.startsWith("Literal['")?'"'+d+'"':i===null?d===""?null:JSON.parse(d):typeof d=="string"?d===""?i==="py"?"None":"null":d:(i==="bash"&&(d=Dt(d)),i==="py"&&(d=Rt(d)),va(d))}function Dt(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)&&"url"in d&&d.url&&"meta"in d&&d.meta?._type==="gradio.FileData"?{path:d.url,meta:{_type:"gradio.FileData"}}:(Array.isArray(d)?d.forEach((s,i)=>{typeof s=="object"&&s!==null&&(d[i]=Dt(s))}):typeof d=="object"&&d!==null&&Object.keys(d).forEach(s=>{d[s]=Dt(d[s])}),d)}function Rt(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)&&"url"in d&&d.url&&"meta"in d&&d.meta?._type==="gradio.FileData"?`handle_file('${d.url}')`:(Array.isArray(d)?d.forEach((s,i)=>{typeof s=="object"&&s!==null&&(d[i]=Rt(s))}):typeof d=="object"&&d!==null&&Object.keys(d).forEach(s=>{d[s]=Rt(d[s])}),d)}function va(d){let s=JSON.stringify(d,(v,_)=>_===null?"UNQUOTEDNone":typeof _=="string"&&_.startsWith("handle_file(")&&_.endsWith(")")?`UNQUOTED${_}`:_);const i=/"UNQUOTEDhandle_file\(([^)]*)\)"/g;s=s.replace(i,(v,_)=>`handle_file(${_})`);const c=/"UNQUOTEDNone"/g;return s.replace(c,"None")}function lt(d){return d<1?`${Math.round(d*1e3)} ms`:`${d.toFixed(2)} s`}var _a=w(" :",1),ua=w(" :",1),ga=w(" ",1),ma=w('Required'),ha=w('Default: ',1),fa=w('

',1),ya=w('
'),wa=w('

',1);function ba(d,s){$e(s,!1);let i=m(s,"is_running",12),c=m(s,"endpoint_returns",12),v=m(s,"js_returns",12),_=m(s,"current_language",12);var H={get is_running(){return i()},set is_running(g){i(g),h()},get endpoint_returns(){return c()},set endpoint_returns(g){c(g),h()},get js_returns(){return v()},set js_returns(g){v(g),h()},get current_language(){return _()},set current_language(g){_(g),h()}};st();var O=wa(),Z=re(O),M=n(a(Z),2);{var x=g=>{var o=_a(),P=re(o),U=n(P);{var T=F=>{var k=xe("s");l(F,k)};G(U,F=>{p(c()),I(()=>c().length!=1)&&F(T)})}be(),R(()=>V(P,`Accepts a JSON object with ${p(c()),I(()=>c().length)??""} key`)),l(g,o)},b=g=>{var o=ua(),P=re(o),U=n(P);{var T=F=>{var k=xe("s");l(F,k)};G(U,F=>{p(c()),I(()=>c().length!=1)&&F(T)})}be(),R(()=>V(P,`Accepts ${p(c()),I(()=>c().length)??""} parameter`)),l(g,o)};G(M,g=>{_()==="bash"?g(x):g(b,!1)})}t(Z);var E=n(Z,2);let ce;ot(E,5,c,ct,(g,o,P)=>{let U=()=>e(o).label,T=()=>e(o).python_type,F=()=>e(o).component,k=()=>e(o).parameter_name,f=()=>e(o).parameter_has_default,L=()=>e(o).parameter_default;var de=fa(),j=n(re(de),2),S=a(j),X=a(S),y=a(X,!0);t(X);var Y=n(X,2),le=a(Y);{var te=A=>{var W=ga(),ie=re(W,!0),_e=n(ie);{var fe=oe=>{var ue=xe(` | diff --git a/assets/ApiRecorder-Bl4Lwcui.js b/assets/ApiRecorder-D0-fBJqr.js similarity index 78% rename from assets/ApiRecorder-Bl4Lwcui.js rename to assets/ApiRecorder-D0-fBJqr.js index e0b24ffa2b709907d7207c995fe1729b54699f0a..134162327b7d3b8ed06aefad044cfb584b3d23ae 100644 --- a/assets/ApiRecorder-Bl4Lwcui.js +++ b/assets/ApiRecorder-D0-fBJqr.js @@ -1 +1 @@ -import{p as u,e as S,i as z}from"./i18n-CPHyzK9b.js";import{M as C,Q as t,S as g,N as I,T as r,x as l,v as c,t as h,X as k,a as v,O as M,P as x,R as f}from"./index-DydPgVMC.js";import{B as N}from"./Button-CV36sOqf.js";import"./snippet-BtHMuX3s.js";import"./Image-CZ1Hb99p.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */var O=f(' '),Q=f('

Recording API Calls:

',1),T=f('
');function K(b,i){C(i,!1);let e=u(i,"api_calls",28,()=>[]),s=u(i,"dependencies",12);var $={get api_calls(){return e()},set api_calls(a){e(a),x()},get dependencies(){return s()},set dependencies(a){s(a),x()}};S();var n=T(),P=t(n);return N(P,{size:"sm",variant:"secondary",children:(a,X)=>{var m=Q(),_=g(I(m),4),p=t(_),R=t(p);r(p);var y=g(p,2);{var A=o=>{var d=O(),B=t(d);r(d),h(()=>k(B,`/${l(s()),l(e()),c(()=>s()[e()[e().length-1].fn_index].api_name)??""}`)),v(o,d)};z(y,o=>{l(e()),c(()=>e().length>0)&&o(A)})}r(_),h(()=>k(R,`[${l(e()),c(()=>e().length)??""}]`)),v(a,m)},$$slots:{default:!0}}),r(n),v(b,n),M($)}export{K as default}; +import{p as u,e as S,i as z}from"./i18n-DtG3MAQ1.js";import{M as C,Q as t,S as g,N as I,T as r,x as l,v as c,t as h,X as k,a as v,O as M,P as x,R as f}from"./index-BeNBoC9J.js";import{B as N}from"./Button-j0-_VC-G.js";import"./snippet-BRIBYCwB.js";import"./Image-ALBOEs1f.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */var O=f(' '),Q=f('

Recording API Calls:

',1),T=f('
');function K(b,i){C(i,!1);let e=u(i,"api_calls",28,()=>[]),s=u(i,"dependencies",12);var $={get api_calls(){return e()},set api_calls(a){e(a),x()},get dependencies(){return s()},set dependencies(a){s(a),x()}};S();var n=T(),P=t(n);return N(P,{size:"sm",variant:"secondary",children:(a,X)=>{var m=Q(),_=g(I(m),4),p=t(_),R=t(p);r(p);var y=g(p,2);{var A=o=>{var d=O(),B=t(d);r(d),h(()=>k(B,`/${l(s()),l(e()),c(()=>s()[e()[e().length-1].fn_index].api_name)??""}`)),v(o,d)};z(y,o=>{l(e()),c(()=>e().length>0)&&o(A)})}r(_),h(()=>k(R,`[${l(e()),c(()=>e().length)??""}]`)),v(a,m)},$$slots:{default:!0}}),r(n),v(b,n),M($)}export{K as default}; diff --git a/assets/ArrowUp-aILrPIpo.js b/assets/ArrowUp-BNDE3Ai4.js similarity index 69% rename from assets/ArrowUp-aILrPIpo.js rename to assets/ArrowUp-BNDE3Ai4.js index 00b5f3216991f5423ce6be8bdac4e976da21bd17..f984835c693aba0ffa269a620f5948b948442176 100644 --- a/assets/ArrowUp-aILrPIpo.js +++ b/assets/ArrowUp-BNDE3Ai4.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as n,f as e}from"./index-DydPgVMC.js";var i=e('');function l(o){var r=i();n(o,r)}export{l as A}; +import"./i18n-DtG3MAQ1.js";import{a as n,f as e}from"./index-BeNBoC9J.js";var i=e('');function l(o){var r=i();n(o,r)}export{l as A}; diff --git a/assets/BaseForm-DAripPNq.js b/assets/BaseForm-CgXgHXvl.js similarity index 65% rename from assets/BaseForm-DAripPNq.js rename to assets/BaseForm-CgXgHXvl.js index d21350c31bc1a4c59fa1989b017a44f4333544dc..6d80911cb3a0305b1d98d6d051300e1b9491b4e8 100644 --- a/assets/BaseForm-DAripPNq.js +++ b/assets/BaseForm-CgXgHXvl.js @@ -1 +1 @@ -import{p as l,s as c,b as h,a as n,f as u}from"./i18n-CPHyzK9b.js";import{t as v,a as b,Q as _,R as w,T as p}from"./index-DydPgVMC.js";var x=w("
");function B(r,a){let s=l(a,"visible",3,!0),f=l(a,"scale",3,null),m=l(a,"min_width",3,0),t=l(a,"label",3,void 0);var e=x();let i,d;var o=_(e);c(o,a,"default",{}),p(e),v(()=>{i=h(e,1,"form svelte-1rhwncb",null,i,{hidden:s()===!1,"hidden-css":s()==="hidden"}),n(e,"role",t()?"group":void 0),n(e,"aria-label",t()),d=u(e,"",d,{"flex-grow":f(),"min-width":`calc(min(${m()}px, 100%))`})}),b(r,e)}export{B}; +import{p as l,s as c,b as h,a as n,f as u}from"./i18n-DtG3MAQ1.js";import{t as v,a as b,Q as _,R as w,T as p}from"./index-BeNBoC9J.js";var x=w("
");function B(r,a){let s=l(a,"visible",3,!0),f=l(a,"scale",3,null),m=l(a,"min_width",3,0),t=l(a,"label",3,void 0);var e=x();let i,d;var o=_(e);c(o,a,"default",{}),p(e),v(()=>{i=h(e,1,"form svelte-1rhwncb",null,i,{hidden:s()===!1,"hidden-css":s()==="hidden"}),n(e,"role",t()?"group":void 0),n(e,"aria-label",t()),d=u(e,"",d,{"flex-grow":f(),"min-width":`calc(min(${m()}px, 100%))`})}),b(r,e)}export{B}; diff --git a/assets/Block-WPcVj6Bq.js b/assets/Block-DkzyQHli.js similarity index 96% rename from assets/Block-WPcVj6Bq.js rename to assets/Block-DkzyQHli.js index 328f1ae8d04cfd4bf7b93f42b3d57c0fb5163642..f4802470d0848c9daa37f585608e4b0ceb266ff7 100644 --- a/assets/Block-WPcVj6Bq.js +++ b/assets/Block-DkzyQHli.js @@ -1 +1 @@ -import{B as ve,p as l,e as me,i as Z,d as we,c as xe,S as be,C as ye,s as ke,f as pe}from"./i18n-CPHyzK9b.js";import{p as Ee,E as Se,ak as O,al as Le,d as Be,am as Ce,b as Me,I as Ne,i as J,h as u,e as ie,an as ze,ao as Te,g as Ye,ap as re,s as Q,M as Ae,a0 as N,Y as se,x as o,Z as a,_ as Re,a3 as Pe,N as X,a as z,O as Fe,P as n,$ as p,S as de,R as $,v as _,U as He,t as Oe,f as Ue,aq as je}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";function qe(U,t,E,c,S,g){let L=u;u&&ie();var r=null;u&&J.nodeType===ze&&(r=J,ie());var b=u?J:U,v=new ve(b,!1);Ee(()=>{const d=t()||null;var y=d==="svg"?Le:null;if(d===null){v.ensure(null,null),O(!0);return}return v.ensure(d,k=>{if(d){if(r=u?r:y?document.createElementNS(y,d):document.createElement(d),Be(r,r),c){u&&Te(d)&&r.append(document.createComment(""));var m=u?Ye(r):r.appendChild(Ce());u&&(m===null?re(!1):Q(m)),c(r,m)}Me.nodes.end=r,k.before(r)}u&&Q(k)}),O(!0),()=>{d&&O(!1)}},Se),Ne(()=>{O(!0)}),L&&(re(!0),Q(b))}var De=Ue(''),Ge=$(" ",1),Ie=$('
'),Ke=$(" ",1);function Je(U,t){Ae(t,!1);let E=l(t,"height",12,void 0),c=l(t,"min_height",12,void 0),S=l(t,"max_height",12,void 0),g=l(t,"width",12,void 0),L=l(t,"elem_id",12,""),r=l(t,"elem_classes",28,()=>[]),b=l(t,"variant",12,"solid"),v=l(t,"border_mode",12,"base"),d=l(t,"padding",12,!0),y=l(t,"type",12,"normal"),k=l(t,"test_id",12,void 0),m=l(t,"explicit_call",12,!1),j=l(t,"container",12,!0),w=l(t,"visible",12,!0),q=l(t,"allow_overflow",12,!0),D=l(t,"overflow_behavior",12,"auto"),T=l(t,"scale",12,null),G=l(t,"min_width",12,0),Y=l(t,"flex",12,!1),I=l(t,"resizable",12,!1),K=l(t,"rtl",12,!1),i=l(t,"fullscreen",12,!1),V=l(t,"label",12,void 0),W=N(i()),f=N(),oe=y()==="fieldset"?"fieldset":"div",ee=N(0),te=N(0),s=N(null);function ae(e){i()&&e.key==="Escape"&&i(!1)}const A=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}},fe=e=>{let B=e.clientY;const C=P=>{const h=P.clientY-B;B=P.clientY,je(f,a(f).style.height=`${a(f).offsetHeight+h}px`)},R=()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",C),window.addEventListener("mouseup",R)};se(()=>(o(i()),a(W),a(f)),()=>{i()!==a(W)&&(p(W,i()),i()?(p(s,a(f).getBoundingClientRect()),p(ee,a(f).offsetHeight),p(te,a(f).offsetWidth),window.addEventListener("keydown",ae)):(p(s,null),window.removeEventListener("keydown",ae)))}),se(()=>o(w()),()=>{w()||Y(!1)}),Re();var ue={get height(){return E()},set height(e){E(e),n()},get min_height(){return c()},set min_height(e){c(e),n()},get max_height(){return S()},set max_height(e){S(e),n()},get width(){return g()},set width(e){g(e),n()},get elem_id(){return L()},set elem_id(e){L(e),n()},get elem_classes(){return r()},set elem_classes(e){r(e),n()},get variant(){return b()},set variant(e){b(e),n()},get border_mode(){return v()},set border_mode(e){v(e),n()},get padding(){return d()},set padding(e){d(e),n()},get type(){return y()},set type(e){y(e),n()},get test_id(){return k()},set test_id(e){k(e),n()},get explicit_call(){return m()},set explicit_call(e){m(e),n()},get container(){return j()},set container(e){j(e),n()},get visible(){return w()},set visible(e){w(e),n()},get allow_overflow(){return q()},set allow_overflow(e){q(e),n()},get overflow_behavior(){return D()},set overflow_behavior(e){D(e),n()},get scale(){return T()},set scale(e){T(e),n()},get min_width(){return G()},set min_width(e){G(e),n()},get flex(){return Y()},set flex(e){Y(e),n()},get resizable(){return I()},set resizable(e){I(e),n()},get rtl(){return K()},set rtl(e){K(e),n()},get fullscreen(){return i()},set fullscreen(e){i(e),n()},get label(){return V()},set label(e){V(e),n()}};me();var le=Pe(),_e=X(le);{var he=e=>{var B=Ke(),C=X(B);qe(C,()=>oe,!1,(h,F)=>{we(h,x=>p(f,x),()=>a(f)),xe(h,(x,H)=>({"data-testid":k(),id:L(),class:`block ${x??""}`,dir:K()?"rtl":"ltr","aria-label":V(),style:"",[ye]:{hidden:w()==="hidden",padded:d(),flex:Y(),border_focus:v()==="focus",border_contrast:v()==="contrast","hide-container":!m()&&!j(),fullscreen:i(),animating:i()&&a(s)!==null,"auto-margin":T()===null},[be]:H}),[()=>(o(r()),_(()=>r()?.join(" ")||"")),()=>({height:(o(i()),o(E()),_(()=>i()?void 0:A(E()))),"min-height":(o(i()),o(c()),_(()=>i()?void 0:A(c()))),"max-height":(o(i()),o(S()),_(()=>i()?void 0:A(S()))),"--start-top":(a(s),_(()=>a(s)?`${a(s).top}px`:"0px")),"--start-left":(a(s),_(()=>a(s)?`${a(s).left}px`:"0px")),"--start-width":(a(s),_(()=>a(s)?`${a(s).width}px`:"0px")),"--start-height":(a(s),_(()=>a(s)?`${a(s).height}px`:"0px")),width:(o(i()),o(g()),_(()=>i()?void 0:typeof g()=="number"?`calc(min(${g()}px, 100%))`:A(g()))),"border-style":b(),overflow:q()?D():"hidden","flex-grow":T(),"min-width":`calc(min(${G()}px, 100%))`})],void 0,void 0,"svelte-alkeak");var M=Ge(),ne=X(M);ke(ne,t,"default",{});var ce=de(ne,2);{var ge=x=>{var H=De();He("mousedown",H,fe),z(x,H)};Z(ce,x=>{I()&&x(ge)})}z(F,M)});var R=de(C,2);{var P=h=>{var F=Ie();let M;Oe(()=>M=pe(F,"",M,{height:a(ee)+"px",width:a(te)+"px"})),z(h,F)};Z(R,h=>{i()&&h(P)})}z(e,B)};Z(_e,e=>{(w()===!0||w()==="hidden")&&e(he)})}return z(U,le),Fe(ue)}export{Je as B}; +import{B as ve,p as l,e as me,i as Z,d as we,c as xe,S as be,C as ye,s as ke,f as pe}from"./i18n-DtG3MAQ1.js";import{p as Ee,E as Se,ak as O,al as Le,d as Be,am as Ce,b as Me,I as Ne,i as J,h as u,e as ie,an as ze,ao as Te,g as Ye,ap as re,s as Q,M as Ae,a0 as N,Y as se,x as o,Z as a,_ as Re,a3 as Pe,N as X,a as z,O as Fe,P as n,$ as p,S as de,R as $,v as _,U as He,t as Oe,f as Ue,aq as je}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";function qe(U,t,E,c,S,g){let L=u;u&&ie();var r=null;u&&J.nodeType===ze&&(r=J,ie());var b=u?J:U,v=new ve(b,!1);Ee(()=>{const d=t()||null;var y=d==="svg"?Le:null;if(d===null){v.ensure(null,null),O(!0);return}return v.ensure(d,k=>{if(d){if(r=u?r:y?document.createElementNS(y,d):document.createElement(d),Be(r,r),c){u&&Te(d)&&r.append(document.createComment(""));var m=u?Ye(r):r.appendChild(Ce());u&&(m===null?re(!1):Q(m)),c(r,m)}Me.nodes.end=r,k.before(r)}u&&Q(k)}),O(!0),()=>{d&&O(!1)}},Se),Ne(()=>{O(!0)}),L&&(re(!0),Q(b))}var De=Ue(''),Ge=$(" ",1),Ie=$('
'),Ke=$(" ",1);function Je(U,t){Ae(t,!1);let E=l(t,"height",12,void 0),c=l(t,"min_height",12,void 0),S=l(t,"max_height",12,void 0),g=l(t,"width",12,void 0),L=l(t,"elem_id",12,""),r=l(t,"elem_classes",28,()=>[]),b=l(t,"variant",12,"solid"),v=l(t,"border_mode",12,"base"),d=l(t,"padding",12,!0),y=l(t,"type",12,"normal"),k=l(t,"test_id",12,void 0),m=l(t,"explicit_call",12,!1),j=l(t,"container",12,!0),w=l(t,"visible",12,!0),q=l(t,"allow_overflow",12,!0),D=l(t,"overflow_behavior",12,"auto"),T=l(t,"scale",12,null),G=l(t,"min_width",12,0),Y=l(t,"flex",12,!1),I=l(t,"resizable",12,!1),K=l(t,"rtl",12,!1),i=l(t,"fullscreen",12,!1),V=l(t,"label",12,void 0),W=N(i()),f=N(),oe=y()==="fieldset"?"fieldset":"div",ee=N(0),te=N(0),s=N(null);function ae(e){i()&&e.key==="Escape"&&i(!1)}const A=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}},fe=e=>{let B=e.clientY;const C=P=>{const h=P.clientY-B;B=P.clientY,je(f,a(f).style.height=`${a(f).offsetHeight+h}px`)},R=()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",C),window.addEventListener("mouseup",R)};se(()=>(o(i()),a(W),a(f)),()=>{i()!==a(W)&&(p(W,i()),i()?(p(s,a(f).getBoundingClientRect()),p(ee,a(f).offsetHeight),p(te,a(f).offsetWidth),window.addEventListener("keydown",ae)):(p(s,null),window.removeEventListener("keydown",ae)))}),se(()=>o(w()),()=>{w()||Y(!1)}),Re();var ue={get height(){return E()},set height(e){E(e),n()},get min_height(){return c()},set min_height(e){c(e),n()},get max_height(){return S()},set max_height(e){S(e),n()},get width(){return g()},set width(e){g(e),n()},get elem_id(){return L()},set elem_id(e){L(e),n()},get elem_classes(){return r()},set elem_classes(e){r(e),n()},get variant(){return b()},set variant(e){b(e),n()},get border_mode(){return v()},set border_mode(e){v(e),n()},get padding(){return d()},set padding(e){d(e),n()},get type(){return y()},set type(e){y(e),n()},get test_id(){return k()},set test_id(e){k(e),n()},get explicit_call(){return m()},set explicit_call(e){m(e),n()},get container(){return j()},set container(e){j(e),n()},get visible(){return w()},set visible(e){w(e),n()},get allow_overflow(){return q()},set allow_overflow(e){q(e),n()},get overflow_behavior(){return D()},set overflow_behavior(e){D(e),n()},get scale(){return T()},set scale(e){T(e),n()},get min_width(){return G()},set min_width(e){G(e),n()},get flex(){return Y()},set flex(e){Y(e),n()},get resizable(){return I()},set resizable(e){I(e),n()},get rtl(){return K()},set rtl(e){K(e),n()},get fullscreen(){return i()},set fullscreen(e){i(e),n()},get label(){return V()},set label(e){V(e),n()}};me();var le=Pe(),_e=X(le);{var he=e=>{var B=Ke(),C=X(B);qe(C,()=>oe,!1,(h,F)=>{we(h,x=>p(f,x),()=>a(f)),xe(h,(x,H)=>({"data-testid":k(),id:L(),class:`block ${x??""}`,dir:K()?"rtl":"ltr","aria-label":V(),style:"",[ye]:{hidden:w()==="hidden",padded:d(),flex:Y(),border_focus:v()==="focus",border_contrast:v()==="contrast","hide-container":!m()&&!j(),fullscreen:i(),animating:i()&&a(s)!==null,"auto-margin":T()===null},[be]:H}),[()=>(o(r()),_(()=>r()?.join(" ")||"")),()=>({height:(o(i()),o(E()),_(()=>i()?void 0:A(E()))),"min-height":(o(i()),o(c()),_(()=>i()?void 0:A(c()))),"max-height":(o(i()),o(S()),_(()=>i()?void 0:A(S()))),"--start-top":(a(s),_(()=>a(s)?`${a(s).top}px`:"0px")),"--start-left":(a(s),_(()=>a(s)?`${a(s).left}px`:"0px")),"--start-width":(a(s),_(()=>a(s)?`${a(s).width}px`:"0px")),"--start-height":(a(s),_(()=>a(s)?`${a(s).height}px`:"0px")),width:(o(i()),o(g()),_(()=>i()?void 0:typeof g()=="number"?`calc(min(${g()}px, 100%))`:A(g()))),"border-style":b(),overflow:q()?D():"hidden","flex-grow":T(),"min-width":`calc(min(${G()}px, 100%))`})],void 0,void 0,"svelte-alkeak");var M=Ge(),ne=X(M);ke(ne,t,"default",{});var ce=de(ne,2);{var ge=x=>{var H=De();He("mousedown",H,fe),z(x,H)};Z(ce,x=>{I()&&x(ge)})}z(F,M)});var R=de(C,2);{var P=h=>{var F=Ie();let M;Oe(()=>M=pe(F,"",M,{height:a(ee)+"px",width:a(te)+"px"})),z(h,F)};Z(R,h=>{i()&&h(P)})}z(e,B)};Z(_e,e=>{(w()===!0||w()==="hidden")&&e(he)})}return z(U,le),Fe(ue)}export{Je as B}; diff --git a/assets/BlockLabel-BzVeVrtL.js b/assets/BlockLabel-CEOjqpu7.js similarity index 81% rename from assets/BlockLabel-BzVeVrtL.js rename to assets/BlockLabel-CEOjqpu7.js index c31a9db36106020382fb9764ae8f0cde69731a34..f8af9f3b7dea78112ca30baedfad70317103bb41 100644 --- a/assets/BlockLabel-BzVeVrtL.js +++ b/assets/BlockLabel-CEOjqpu7.js @@ -1 +1 @@ -import{p as a,a as x,b as p}from"./i18n-CPHyzK9b.js";import{M as w,t as I,a as k,O as y,P as s,Q as c,R as B,S,X as L,T as h}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var M=B('');function R(_,l){w(l,!1);let o=a(l,"label",12,null),n=a(l,"Icon",12),r=a(l,"show_label",12,!0),b=a(l,"disable",12,!1),i=a(l,"float",12,!0),f=a(l,"rtl",12,!1);var m={get label(){return o()},set label(e){o(e),s()},get Icon(){return n()},set Icon(e){n(e),s()},get show_label(){return r()},set show_label(e){r(e),s()},get disable(){return b()},set disable(e){b(e),s()},get float(){return i()},set float(e){i(e),s()},get rtl(){return f()},set rtl(e){f(e),s()}},t=M();let d;var u=c(t),v=c(u);n()(v,{}),h(u);var g=S(u);return h(t),I(()=>{x(t,"dir",f()?"rtl":"ltr"),d=p(t,1,"svelte-e9xhe",null,d,{hide:!r(),"sr-only":!r(),float:i(),"hide-label":b()}),L(g,` ${o()??""}`),t.dir=t.dir}),k(_,t),y(m)}export{R as B}; +import{p as a,a as x,b as p}from"./i18n-DtG3MAQ1.js";import{M as w,t as I,a as k,O as y,P as s,Q as c,R as B,S,X as L,T as h}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var M=B('');function R(_,l){w(l,!1);let o=a(l,"label",12,null),n=a(l,"Icon",12),r=a(l,"show_label",12,!0),b=a(l,"disable",12,!1),i=a(l,"float",12,!0),f=a(l,"rtl",12,!1);var m={get label(){return o()},set label(e){o(e),s()},get Icon(){return n()},set Icon(e){n(e),s()},get show_label(){return r()},set show_label(e){r(e),s()},get disable(){return b()},set disable(e){b(e),s()},get float(){return i()},set float(e){i(e),s()},get rtl(){return f()},set rtl(e){f(e),s()}},t=M();let d;var u=c(t),v=c(u);n()(v,{}),h(u);var g=S(u);return h(t),I(()=>{x(t,"dir",f()?"rtl":"ltr"),d=p(t,1,"svelte-e9xhe",null,d,{hide:!r(),"sr-only":!r(),float:i(),"hide-label":b()}),L(g,` ${o()??""}`),t.dir=t.dir}),k(_,t),y(m)}export{R as B}; diff --git a/assets/BlockTitle-DNiCHWOR.js b/assets/BlockTitle-B6Pgijwb.js similarity index 70% rename from assets/BlockTitle-DNiCHWOR.js rename to assets/BlockTitle-B6Pgijwb.js index a110fc8dc2638336ece3489f75316c784bd93f7c..c7e82bdf925174312bd16e402c68b38fcdeaf1ee 100644 --- a/assets/BlockTitle-DNiCHWOR.js +++ b/assets/BlockTitle-B6Pgijwb.js @@ -1 +1 @@ -import{p as o,s as c,i as p,a as b,b as v}from"./i18n-CPHyzK9b.js";import{M as g,N as w,t as k,a as x,O as y,P as i,Q as B,R as I,S,T}from"./index-DydPgVMC.js";import{I as M}from"./Info-DfrMwI06.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var N=I(' ',1);function j(d,a){g(a,!1);let l=o(a,"show_label",12,!0),s=o(a,"info",12,void 0),r=o(a,"rtl",12,!1);var u={get show_label(){return l()},set show_label(t){l(t),i()},get info(){return s()},set info(t){s(t),i()},get rtl(){return r()},set rtl(t){r(t),i()}},n=N(),e=w(n);let f;var h=B(e);c(h,a,"default",{}),T(e);var m=S(e,2);{var _=t=>{M(t,{get info(){return s()}})};p(m,t=>{s()&&t(_)})}return k(()=>{b(e,"dir",r()?"rtl":"ltr"),f=v(e,1,"svelte-e0ig2",null,f,{hide:!l(),"has-info":s()!=null,"sr-only":!l()}),e.dir=e.dir}),x(d,n),y(u)}export{j as B}; +import{p as o,s as c,i as p,a as b,b as v}from"./i18n-DtG3MAQ1.js";import{M as g,N as w,t as k,a as x,O as y,P as i,Q as B,R as I,S,T}from"./index-BeNBoC9J.js";import{I as M}from"./Info-BjDIKIgf.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var N=I(' ',1);function j(d,a){g(a,!1);let l=o(a,"show_label",12,!0),s=o(a,"info",12,void 0),r=o(a,"rtl",12,!1);var u={get show_label(){return l()},set show_label(t){l(t),i()},get info(){return s()},set info(t){s(t),i()},get rtl(){return r()},set rtl(t){r(t),i()}},n=N(),e=w(n);let f;var h=B(e);c(h,a,"default",{}),T(e);var m=S(e,2);{var _=t=>{M(t,{get info(){return s()}})};p(m,t=>{s()&&t(_)})}return k(()=>{b(e,"dir",r()?"rtl":"ltr"),f=v(e,1,"svelte-e0ig2",null,f,{hide:!l(),"has-info":s()!=null,"sr-only":!l()}),e.dir=e.dir}),x(d,n),y(u)}export{j as B}; diff --git a/assets/Blocks-C9ppI-He.js b/assets/Blocks-C4lA_Loz.js similarity index 93% rename from assets/Blocks-C9ppI-He.js rename to assets/Blocks-C4lA_Loz.js index 0ad00ac6eef64871d2232cc3424116089f0c5754..b5d157a7e2168abd0acf67c95443f20c41a5bada 100644 --- a/assets/Blocks-C9ppI-He.js +++ b/assets/Blocks-C4lA_Loz.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ApiDocs-dJKk0kqa.js","./i18n-CPHyzK9b.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./misc-Dkc5KZ-v.js","./clear-DRfgZ-Qi.js","./Button-CV36sOqf.js","./snippet-BtHMuX3s.js","./Image-CZ1Hb99p.js","./Image-dcYq_y3_.css","./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js","./ScrollFade-FmR1tTNV.css","./Button-hbTB5kNr.css","./ImagePreview-BZaoS7p0.css","./index-CfM_uZQa.js","./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js","./html-BZIV6tyB.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BR8cTgGu.js","./Block-WPcVj6Bq.js","./input-BtIxlP_B.js","./size-D4lmUoTq.js","./state.svelte-DpHZj3x1.js","./index-CMKhGNWj.js","./index-tFQomdd2.js","./ApiDocs-Us1VUfyb.css","./ApiRecorder-Bl4Lwcui.js","./ApiRecorder-BIe6qN0x.css","./Settings-C5X1Bk7G.js","./Dropdown-CVRP4i7q.js","./window-D5YXrKnH.js","./BlockTitle-DNiCHWOR.js","./Info-DfrMwI06.js","./DropdownArrow-Cq3QAKSv.js","./IconButtonWrapper-PnNNNvqI.js","./Dropdown-DBcOp-Nh.css","./Checkbox-Bh_yH8eu.js","./universal-C9tCO36V.js","./Checkbox-CeUlgVWK.css","./Settings-BUk_hNi0.css","./Example-nXsgr46n.css","./Index-9wedEojI.js","./Code-Bhm2YgEI.js","./Code-C-hu7Aas.css","./Index.svelte_svelte_type_style_lang-C-orki39.js","./actions-4RaHFoGI.js","./Check-2f8HlfSn.js","./Copy-B3jzejpA.js","./MarkdownCode-BTj729_f.js","./prism-python-BGiTAEDL.js","./MarkdownCode-IpEvB2op.css","./Index-D-Qschx6.css","./Index-DfYZbHJT.css","./Example-DJcb6y4A.css","./Example--4J3Orww.css"])))=>i.map(i=>d[i]); -import{aM as Et,B as Ct,aN as St,h as Se,ap as Le,s as Oe,i as ot,Z as d,e as Lt,aH as Ot,am as Mt,p as Rt,aO as At,C as Dt,j as Je,g as Tt,M as Pe,aP as dt,aQ as Te,aa as be,ac as lt,aR as Ft,a as v,O as ze,R as H,$ as P,a3 as Z,N as D,ab as Ye,v as jt,a7 as Pt,S as y,t as K,a2 as Ae,af as pe,Q as q,X as me,U as ie,aS as zt,T as I,aT as qt,a4 as Ke}from"./index-DydPgVMC.js";import{d as ct,q as $e,w as et,i as x,g as It,r as Ut,X as _t,p as Ce,Y as tt,f as it,u as at,t as Gt,b as st,a as V,F as Bt,H as Nt}from"./i18n-CPHyzK9b.js";import{h as Vt}from"./html-BZIV6tyB.js";import{c as we}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{b as Zt}from"./size-D4lmUoTq.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{L as Ht,T as Qt}from"./state.svelte-DpHZj3x1.js";import{AppTree as Wt}from"./index-CMKhGNWj.js";function $(l,e=[],i=[],a){var t=Et(),n=Ct,o=t.is_rendered();t.update_pending_count(1),n.increment(o);var c=Se;if(c){Lt();var g=ot,h=Ot(!1);Oe(h)}St(e,[],i,w=>{c&&(Le(!0),Oe(g));try{for(const E of w)d(E);a(l,...w)}finally{c&&Le(!1),t.update_pending_count(-1),n.decrement(o)}})}function Xt(l,e){let i=null,a=Se;var t;if(Se){i=ot;for(var n=Tt(document.head);n!==null&&(n.nodeType!==Dt||n.data!==l);)n=Je(n);if(n===null)Le(!1);else{var o=Je(n);n.remove(),Oe(o)}}Se||(t=document.head.appendChild(Mt()));try{Rt(()=>e(t),At)}finally{a&&(Le(!0),Oe(i))}}var Jt=H("");function Yt(l,e){Pe(e,!0);var i,a,t,n=dt([async()=>i=await Te(()=>e.node.component),async()=>a=await Te(()=>e.node.runtime),()=>t=be(null),()=>{lt(()=>{if(!d(t)||!d(a)||!d(i))return;const c=e.node.props.shared_props,g=e.node.props.props,h=d(a),w=h.mount(d(i).default,{target:d(t),props:{shared_props:c,props:g,children:e.children}});return()=>{h.unmount(w)}})}]),o=Jt();Ft([n[2]],()=>{ct(o,c=>P(t,c),()=>d(t))}),v(l,o),ze()}function Fe(l,e){Pe(e,!0);let i=Ut(e,["$$slots","$$events","$$legacy","node"]);var a,t=dt([async()=>a=await Te(()=>e.node.component)]),n=Z(),o=D(n);$(o,[t[0]],[()=>e.node&&d(a)],(c,g)=>{var h=w=>{var E=Z(),u=D(E);$(u,[t[0]],[()=>e.node.props.shared_props.visible&&!e.node.runtime],(C,z)=>{var _=m=>{var b=Z(),k=D(b);$(k,[t[0]],void 0,S=>{we(k,()=>d(a).default,(G,T)=>{T(G,{get shared_props(){return e.node.props.shared_props},get props(){return e.node.props.props},children:(L,ae)=>{var B=Z(),N=D(B);$(N,[t[0]],[()=>e.node.children&&e.node.children.length],(W,ee)=>{var fe=se=>{var ne=Z(),re=D(ne);$(re,[t[0]],[()=>e.node.children],(X,oe)=>{$e(X,17,()=>d(oe),et,(J,de)=>{Fe(J,{get node(){return d(de)}})})}),v(se,ne)};x(W,se=>{d(ee)&&se(fe)})}),v(L,B)},$$slots:{default:!0}})})}),v(m,b)},Q=m=>{var b=Z(),k=D(b);$(k,[t[0]],[()=>e.node.props.shared_props.visible&&e.node.runtime],(S,G)=>{var T=L=>{$(L,[t[0]],void 0,ae=>{Yt(ae,It(()=>i,{get node(){return e.node},children:(B,N)=>{var W=Z(),ee=D(W);$(ee,[t[0]],[()=>e.node.children&&e.node.children.length],(fe,se)=>{var ne=re=>{var X=Z(),oe=D(X);$(oe,[t[0]],[()=>e.node.children],(J,de)=>{$e(J,17,()=>d(de),et,(Me,Re)=>{Fe(Me,{get node(){return d(Re)}})})}),v(re,X)};x(fe,re=>{d(se)&&re(ne)})}),v(B,W)},$$slots:{default:!0}}))})};x(S,L=>{d(G)&&L(T)},!0)}),v(m,b)};x(C,m=>{d(z)?m(_):m(Q,!1)})}),v(w,E)};x(c,w=>{d(g)&&w(h)})}),v(l,n),ze()}const Kt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='576'%20height='576'%20viewBox='0%200%20576%20576'%20fill='none'%3e%3cpath%20d='M287.5%20229L86%20344.5L287.5%20460L489%20344.5L287.5%20229Z'%20stroke='url(%23paint0_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M287.5%20116L86%20231.5L287.5%20347L489%20231.5L287.5%20116Z'%20stroke='url(%23paint1_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M86%20344L288%20229'%20stroke='url(%23paint2_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='bevel'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_102_7'%20x1='60'%20y1='341'%20x2='429.5'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_102_7'%20x1='513.5'%20y1='231'%20x2='143.5'%20y2='231'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_102_7'%20x1='60'%20y1='344'%20x2='428.987'%20y2='341.811'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",$t="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9425%202.94265C27.4632%202.42195%2027.4632%201.57773%2026.9425%201.05703C26.4218%200.536329%2025.5776%200.536329%2025.0569%201.05703L22.5713%203.54256C21.1213%202.59333%2019.5367%202.43378%2018.1753%202.64006C16.5495%202.88638%2015.1127%203.66838%2014.3905%204.39053L12.3905%206.39053C12.1405%206.64058%2012%206.97972%2012%207.33334C12%207.68697%2012.1405%208.0261%2012.3905%208.27615L19.7239%2015.6095C20.2446%2016.1302%2021.0888%2016.1302%2021.6095%2015.6095L23.6095%2013.6095C24.3316%2012.8873%2025.1136%2011.4505%2025.36%209.82475C25.5663%208.46312%2025.4066%206.87827%2024.4571%205.42807L26.9425%202.94265Z'%20fill='%233c4555'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.276%2012.9426C12.7967%2012.4219%2012.7967%2011.5777%2012.276%2011.057C11.7553%2010.5363%2010.9111%2010.5363%2010.3904%2011.057L8.66651%2012.7809L8.27615%2012.3905C8.0261%2012.1405%207.68697%2012%207.33334%2012C6.97972%2012%206.64058%2012.1405%206.39053%2012.3905L4.39053%2014.3905C3.66838%2015.1127%202.88638%2016.5495%202.64006%2018.1753C2.43377%2019.5367%202.59333%2021.1214%203.54262%2022.5714L1.05703%2025.057C0.536329%2025.5777%200.536329%2026.4219%201.05703%2026.9426C1.57773%2027.4633%202.42195%2027.4633%202.94265%2026.9426L5.42817%2024.4571C6.87835%2025.4066%208.46315%2025.5663%209.82475%2025.36C11.4505%2025.1136%2012.8873%2024.3316%2013.6095%2023.6095L15.6095%2021.6095C16.1302%2021.0888%2016.1302%2020.2446%2015.6095%2019.7239L15.2188%2019.3332L16.9426%2017.6093C17.4633%2017.0886%2017.4633%2016.2444%2016.9426%2015.7237C16.4219%2015.203%2015.5777%2015.203%2015.057%2015.7237L13.3332%2017.4475L10.5521%2014.6665L12.276%2012.9426Z'%20fill='%23FF7C00'/%3e%3c/svg%3e",ei="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Outer%20gear%20teeth%20(gray)%20--%3e%3cpath%20d='M19.14%2012.94c.04-.3.06-.61.06-.94%200-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24%200-.43.17-.47.41l-.36%202.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47%200-.59.22L2.74%208.87c-.12.21-.08.47.12.61l2.03%201.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03%201.58c-.18.14-.23.41-.12.61l1.92%203.32c.12.22.37.29.59.22l2.39-.96c.5.38%201.03.7%201.62.94l.36%202.54c.05.24.24.41.48.41h3.84c.24%200%20.44-.17.47-.41l.36-2.54c.59-.24%201.13-.56%201.62-.94l2.39.96c.22.08.47%200%20.59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12%2015.6c-1.98%200-3.6-1.62-3.6-3.6s1.62-3.6%203.6-3.6%203.6%201.62%203.6%203.6-1.62%203.6-3.6%203.6z'%20fill='%23808080'/%3e%3c!--%20Inner%20circle%20(now%20gray)%20--%3e%3ccircle%20cx='12'%20cy='12'%20r='2.5'%20fill='%23808080'/%3e%3c/svg%3e",ti="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23FF0000'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";let ke=!1,ue=null,qe=[],ii=0,ye={},ai,je,si=null,De=[];async function ni(){if(!ke)try{const l=document.title;document.title="[Sharing] Gradio Tab";const e=await navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!0,selfBrowserSurface:"include"});document.title=l;const i={videoBitsPerSecond:5e6};ue=new MediaRecorder(e,i),qe=[],ye={},ue.ondataavailable=oi,ue.onstop=di,ue.start(1e3),ke=!0,ii=Date.now()}catch(l){je("Recording Error","Failed to start recording: "+l.message,"error")}}function ri(){!ke||!ue||(ue.stop(),ke=!1)}function oi(l){l.data.size>0&&qe.push(l.data)}function di(){ke=!1;const l=new Blob(qe,{type:"video/mp4"});li(l),(ue?.stream?.getTracks()||[]).forEach(i=>i.stop())}async function li(l){try{je("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",l,"recording.mp4"),ye.start!==void 0&&ye.end!==void 0&&(e.append("remove_segment_start",ye.start.toString()),e.append("remove_segment_end",ye.end.toString())),De.length>0&&e.append("zoom_effects",JSON.stringify(De));const i=await fetch(ai+"/gradio_api/process_recording",{method:"POST",body:e});if(!i.ok)throw new Error(`Server returned ${i.status}: ${i.statusText}`);const a=await i.blob(),t=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;nt(a,t),De=[]}catch{je("Processing Error","Failed to process recording. Saving original version.","warning");const i=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;nt(l,i)}}function nt(l,e){const i=URL.createObjectURL(l),a=document.createElement("a");a.style.display="none",a.href=i,a.download=e,document.body.appendChild(a),a.click(),setTimeout(()=>{document.body.removeChild(a),URL.revokeObjectURL(i)},100)}const ci=/^'([^]+)'$/,rt=Symbol("NOVALUE");class _i{id;inputs;outputs;cancels;pending=!1;trigger_modes;event_args={};targets=[];connection_type;triggers=[];original_trigger_id=null;show_progress_on=null;component_prop_inputs=[];show_progress;functions;constructor(e){this.id=e.id,this.original_trigger_id=e.id,this.inputs=e.inputs,this.outputs=e.outputs,this.connection_type=e.connection,this.show_progress=e.show_progress,this.functions={frontend:e.js?hi(e.js,e.backend_fn,e.inputs.length,e.outputs.length):void 0,backend:e.backend_fn,backend_js:e.js_implementation?new _t(`let result = await (${e.js_implementation})(...arguments); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ApiDocs-CseUrmNn.js","./i18n-DtG3MAQ1.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./misc-D-Y84gKJ.js","./clear-Dx2v97Qg.js","./Button-j0-_VC-G.js","./snippet-BRIBYCwB.js","./Image-ALBOEs1f.js","./Image-dcYq_y3_.css","./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js","./ScrollFade-FmR1tTNV.css","./Button-hbTB5kNr.css","./ImagePreview-BZaoS7p0.css","./index-1YthqPsU.js","./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js","./html-DE4EmiOG.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BiKSVifk.js","./Block-DkzyQHli.js","./input-BLFxNjIx.js","./size-ChvveZyb.js","./state.svelte-COyO-AzF.js","./index-DCGrAb1j.js","./index-tFQomdd2.js","./ApiDocs-Us1VUfyb.css","./ApiRecorder-D0-fBJqr.js","./ApiRecorder-BIe6qN0x.css","./Settings-D-eohf8z.js","./Dropdown-D5-31HWl.js","./window-ChwzOWAi.js","./BlockTitle-B6Pgijwb.js","./Info-BjDIKIgf.js","./DropdownArrow-C0w6FgSo.js","./IconButtonWrapper-Ce5bzAyh.js","./Dropdown-DBcOp-Nh.css","./Checkbox-DdDaw1pY.js","./universal-DqSjxxHG.js","./Checkbox-CeUlgVWK.css","./Settings-BUk_hNi0.css","./Example-nXsgr46n.css","./Index-MykHl5RI.js","./Code-D0Kw4ylG.js","./Code-C-hu7Aas.css","./Index.svelte_svelte_type_style_lang-CZFWgj20.js","./actions-BbCJS635.js","./Check-DjGw_9dO.js","./Copy-eBznHIlR.js","./MarkdownCode-QLelNkfo.js","./prism-python-DV2ZTlpc.js","./MarkdownCode-IpEvB2op.css","./Index-D-Qschx6.css","./Index-DfYZbHJT.css","./Example-DJcb6y4A.css","./Example--4J3Orww.css"])))=>i.map(i=>d[i]); +import{aM as Et,B as Ct,aN as St,h as Se,ap as Le,s as Oe,i as ot,Z as d,e as Lt,aH as Ot,am as Mt,p as Rt,aO as At,C as Dt,j as Je,g as Tt,M as Pe,aP as dt,aQ as Te,aa as be,ac as lt,aR as Ft,a as v,O as ze,R as H,$ as P,a3 as Z,N as D,ab as Ye,v as jt,a7 as Pt,S as y,t as K,a2 as Ae,af as pe,Q as q,X as me,U as ie,aS as zt,T as I,aT as qt,a4 as Ke}from"./index-BeNBoC9J.js";import{d as ct,q as $e,w as et,i as x,g as It,r as Ut,X as _t,p as Ce,Y as tt,f as it,u as at,t as Gt,b as st,a as V,F as Bt,H as Nt}from"./i18n-DtG3MAQ1.js";import{h as Vt}from"./html-DE4EmiOG.js";import{c as we}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{b as Zt}from"./size-ChvveZyb.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{L as Ht,T as Qt}from"./state.svelte-COyO-AzF.js";import{AppTree as Wt}from"./index-DCGrAb1j.js";function $(l,e=[],i=[],a){var t=Et(),n=Ct,o=t.is_rendered();t.update_pending_count(1),n.increment(o);var c=Se;if(c){Lt();var g=ot,h=Ot(!1);Oe(h)}St(e,[],i,w=>{c&&(Le(!0),Oe(g));try{for(const E of w)d(E);a(l,...w)}finally{c&&Le(!1),t.update_pending_count(-1),n.decrement(o)}})}function Xt(l,e){let i=null,a=Se;var t;if(Se){i=ot;for(var n=Tt(document.head);n!==null&&(n.nodeType!==Dt||n.data!==l);)n=Je(n);if(n===null)Le(!1);else{var o=Je(n);n.remove(),Oe(o)}}Se||(t=document.head.appendChild(Mt()));try{Rt(()=>e(t),At)}finally{a&&(Le(!0),Oe(i))}}var Jt=H("");function Yt(l,e){Pe(e,!0);var i,a,t,n=dt([async()=>i=await Te(()=>e.node.component),async()=>a=await Te(()=>e.node.runtime),()=>t=be(null),()=>{lt(()=>{if(!d(t)||!d(a)||!d(i))return;const c=e.node.props.shared_props,g=e.node.props.props,h=d(a),w=h.mount(d(i).default,{target:d(t),props:{shared_props:c,props:g,children:e.children}});return()=>{h.unmount(w)}})}]),o=Jt();Ft([n[2]],()=>{ct(o,c=>P(t,c),()=>d(t))}),v(l,o),ze()}function Fe(l,e){Pe(e,!0);let i=Ut(e,["$$slots","$$events","$$legacy","node"]);var a,t=dt([async()=>a=await Te(()=>e.node.component)]),n=Z(),o=D(n);$(o,[t[0]],[()=>e.node&&d(a)],(c,g)=>{var h=w=>{var E=Z(),u=D(E);$(u,[t[0]],[()=>e.node.props.shared_props.visible&&!e.node.runtime],(C,z)=>{var _=m=>{var b=Z(),k=D(b);$(k,[t[0]],void 0,S=>{we(k,()=>d(a).default,(G,T)=>{T(G,{get shared_props(){return e.node.props.shared_props},get props(){return e.node.props.props},children:(L,ae)=>{var B=Z(),N=D(B);$(N,[t[0]],[()=>e.node.children&&e.node.children.length],(W,ee)=>{var fe=se=>{var ne=Z(),re=D(ne);$(re,[t[0]],[()=>e.node.children],(X,oe)=>{$e(X,17,()=>d(oe),et,(J,de)=>{Fe(J,{get node(){return d(de)}})})}),v(se,ne)};x(W,se=>{d(ee)&&se(fe)})}),v(L,B)},$$slots:{default:!0}})})}),v(m,b)},Q=m=>{var b=Z(),k=D(b);$(k,[t[0]],[()=>e.node.props.shared_props.visible&&e.node.runtime],(S,G)=>{var T=L=>{$(L,[t[0]],void 0,ae=>{Yt(ae,It(()=>i,{get node(){return e.node},children:(B,N)=>{var W=Z(),ee=D(W);$(ee,[t[0]],[()=>e.node.children&&e.node.children.length],(fe,se)=>{var ne=re=>{var X=Z(),oe=D(X);$(oe,[t[0]],[()=>e.node.children],(J,de)=>{$e(J,17,()=>d(de),et,(Me,Re)=>{Fe(Me,{get node(){return d(Re)}})})}),v(re,X)};x(fe,re=>{d(se)&&re(ne)})}),v(B,W)},$$slots:{default:!0}}))})};x(S,L=>{d(G)&&L(T)},!0)}),v(m,b)};x(C,m=>{d(z)?m(_):m(Q,!1)})}),v(w,E)};x(c,w=>{d(g)&&w(h)})}),v(l,n),ze()}const Kt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='576'%20height='576'%20viewBox='0%200%20576%20576'%20fill='none'%3e%3cpath%20d='M287.5%20229L86%20344.5L287.5%20460L489%20344.5L287.5%20229Z'%20stroke='url(%23paint0_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M287.5%20116L86%20231.5L287.5%20347L489%20231.5L287.5%20116Z'%20stroke='url(%23paint1_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M86%20344L288%20229'%20stroke='url(%23paint2_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='bevel'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_102_7'%20x1='60'%20y1='341'%20x2='429.5'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_102_7'%20x1='513.5'%20y1='231'%20x2='143.5'%20y2='231'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_102_7'%20x1='60'%20y1='344'%20x2='428.987'%20y2='341.811'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",$t="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9425%202.94265C27.4632%202.42195%2027.4632%201.57773%2026.9425%201.05703C26.4218%200.536329%2025.5776%200.536329%2025.0569%201.05703L22.5713%203.54256C21.1213%202.59333%2019.5367%202.43378%2018.1753%202.64006C16.5495%202.88638%2015.1127%203.66838%2014.3905%204.39053L12.3905%206.39053C12.1405%206.64058%2012%206.97972%2012%207.33334C12%207.68697%2012.1405%208.0261%2012.3905%208.27615L19.7239%2015.6095C20.2446%2016.1302%2021.0888%2016.1302%2021.6095%2015.6095L23.6095%2013.6095C24.3316%2012.8873%2025.1136%2011.4505%2025.36%209.82475C25.5663%208.46312%2025.4066%206.87827%2024.4571%205.42807L26.9425%202.94265Z'%20fill='%233c4555'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.276%2012.9426C12.7967%2012.4219%2012.7967%2011.5777%2012.276%2011.057C11.7553%2010.5363%2010.9111%2010.5363%2010.3904%2011.057L8.66651%2012.7809L8.27615%2012.3905C8.0261%2012.1405%207.68697%2012%207.33334%2012C6.97972%2012%206.64058%2012.1405%206.39053%2012.3905L4.39053%2014.3905C3.66838%2015.1127%202.88638%2016.5495%202.64006%2018.1753C2.43377%2019.5367%202.59333%2021.1214%203.54262%2022.5714L1.05703%2025.057C0.536329%2025.5777%200.536329%2026.4219%201.05703%2026.9426C1.57773%2027.4633%202.42195%2027.4633%202.94265%2026.9426L5.42817%2024.4571C6.87835%2025.4066%208.46315%2025.5663%209.82475%2025.36C11.4505%2025.1136%2012.8873%2024.3316%2013.6095%2023.6095L15.6095%2021.6095C16.1302%2021.0888%2016.1302%2020.2446%2015.6095%2019.7239L15.2188%2019.3332L16.9426%2017.6093C17.4633%2017.0886%2017.4633%2016.2444%2016.9426%2015.7237C16.4219%2015.203%2015.5777%2015.203%2015.057%2015.7237L13.3332%2017.4475L10.5521%2014.6665L12.276%2012.9426Z'%20fill='%23FF7C00'/%3e%3c/svg%3e",ei="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Outer%20gear%20teeth%20(gray)%20--%3e%3cpath%20d='M19.14%2012.94c.04-.3.06-.61.06-.94%200-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24%200-.43.17-.47.41l-.36%202.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47%200-.59.22L2.74%208.87c-.12.21-.08.47.12.61l2.03%201.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03%201.58c-.18.14-.23.41-.12.61l1.92%203.32c.12.22.37.29.59.22l2.39-.96c.5.38%201.03.7%201.62.94l.36%202.54c.05.24.24.41.48.41h3.84c.24%200%20.44-.17.47-.41l.36-2.54c.59-.24%201.13-.56%201.62-.94l2.39.96c.22.08.47%200%20.59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12%2015.6c-1.98%200-3.6-1.62-3.6-3.6s1.62-3.6%203.6-3.6%203.6%201.62%203.6%203.6-1.62%203.6-3.6%203.6z'%20fill='%23808080'/%3e%3c!--%20Inner%20circle%20(now%20gray)%20--%3e%3ccircle%20cx='12'%20cy='12'%20r='2.5'%20fill='%23808080'/%3e%3c/svg%3e",ti="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23FF0000'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";let ke=!1,ue=null,qe=[],ii=0,ye={},ai,je,si=null,De=[];async function ni(){if(!ke)try{const l=document.title;document.title="[Sharing] Gradio Tab";const e=await navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!0,selfBrowserSurface:"include"});document.title=l;const i={videoBitsPerSecond:5e6};ue=new MediaRecorder(e,i),qe=[],ye={},ue.ondataavailable=oi,ue.onstop=di,ue.start(1e3),ke=!0,ii=Date.now()}catch(l){je("Recording Error","Failed to start recording: "+l.message,"error")}}function ri(){!ke||!ue||(ue.stop(),ke=!1)}function oi(l){l.data.size>0&&qe.push(l.data)}function di(){ke=!1;const l=new Blob(qe,{type:"video/mp4"});li(l),(ue?.stream?.getTracks()||[]).forEach(i=>i.stop())}async function li(l){try{je("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",l,"recording.mp4"),ye.start!==void 0&&ye.end!==void 0&&(e.append("remove_segment_start",ye.start.toString()),e.append("remove_segment_end",ye.end.toString())),De.length>0&&e.append("zoom_effects",JSON.stringify(De));const i=await fetch(ai+"/gradio_api/process_recording",{method:"POST",body:e});if(!i.ok)throw new Error(`Server returned ${i.status}: ${i.statusText}`);const a=await i.blob(),t=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;nt(a,t),De=[]}catch{je("Processing Error","Failed to process recording. Saving original version.","warning");const i=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;nt(l,i)}}function nt(l,e){const i=URL.createObjectURL(l),a=document.createElement("a");a.style.display="none",a.href=i,a.download=e,document.body.appendChild(a),a.click(),setTimeout(()=>{document.body.removeChild(a),URL.revokeObjectURL(i)},100)}const ci=/^'([^]+)'$/,rt=Symbol("NOVALUE");class _i{id;inputs;outputs;cancels;pending=!1;trigger_modes;event_args={};targets=[];connection_type;triggers=[];original_trigger_id=null;show_progress_on=null;component_prop_inputs=[];show_progress;functions;constructor(e){this.id=e.id,this.original_trigger_id=e.id,this.inputs=e.inputs,this.outputs=e.outputs,this.connection_type=e.connection,this.show_progress=e.show_progress,this.functions={frontend:e.js?hi(e.js,e.backend_fn,e.inputs.length,e.outputs.length):void 0,backend:e.backend_fn,backend_js:e.js_implementation?new _t(`let result = await (${e.js_implementation})(...arguments); return (!Array.isArray(result)) ? [result] : result;`):void 0},this.targets=e.targets,this.cancels=e.cancels,this.trigger_modes=e.trigger_mode,this.show_progress_on=e.show_progress_on||null,this.component_prop_inputs=e.component_prop_inputs||[];for(let i=0;ie==="success").map(([e])=>e),failure:this.triggers.filter(([,e])=>e==="failure").map(([e])=>e),all:this.triggers.filter(([,e])=>e==="all").map(([e])=>e)}}}class ui{dependencies_by_fn=new Map;dependencies_by_event=new Map;render_id_deps=new Map;submissions=new Map;client;queue=new Set;add_to_api_calls;update_state_cb;get_state_cb;rerender_cb;log_cb;on_connection_lost_cb;loading_stati=new Ht;connection_lost=!1;constructor(e,i,a,t,n,o,c,g){this.add_to_api_calls=c,this.log_cb=o,this.update_state_cb=a,this.get_state_cb=t,this.rerender_cb=n,this.on_connection_lost_cb=g,this.client=i,this.reload(e,a,t,n,i)}reload(e,i,a,t,n){const{by_id:o,by_event:c}=this.create(e);this.dependencies_by_event=c,this.dependencies_by_fn=o,this.client=n,this.update_state_cb=i,this.get_state_cb=a,this.rerender_cb=t;for(const[g,h]of this.dependencies_by_fn)for(const[w]of h.targets)this.set_event_args(w,h.event_args);this.register_loading_stati(o)}register_loading_stati(e){for(const[i,a]of e)this.loading_stati.register(a.id,a.show_progress_on||a.outputs,a.inputs,a.show_progress)}clear_loading_status(e){this.loading_stati.clear(e)}async update_loading_stati_state(){for(const[e,i]of Object.entries(this.loading_stati.current))this.update_state_cb(Number(e),{loading_status:i},!1)}dispatch_state_change_events(e){if(e.changed_state_ids)for(const i of e.changed_state_ids)this.dependencies_by_event.get("change-"+i)?.forEach(t=>{this.dispatch({type:"fn",fn_index:t.id,target_id:i,event_data:null})})}async dispatch(e){if(this.connection_lost)return;let i;if(e.type==="fn"){const a=this.dependencies_by_fn.get(e.fn_index);a&&(i=[a])}else i=this.dependencies_by_event.get(`${e.event_name}-${e.target_id}`);for(let a=0;a<(i?.length||0);a++){const t=i?i[a]:void 0;if(t){this.cancel(t.cancels);const n=gi(t.trigger_modes,this.submissions.has(t.id));if(n==="skip")continue;if(n==="defer"){this.queue.add(t.id);continue}t.functions.backend&&(this.loading_stati.update({status:"pending",fn_index:t.id,stream_state:null}),this.update_loading_stati_state());const o=await this.gather_state(t.inputs,t.component_prop_inputs),c=await Promise.all(t.targets.map(([E])=>this.set_event_args(E,t.event_args))),{success:g,failure:h,all:w}=t.get_triggers();try{let E=null;if(e.target_id!==void 0||e.type==="event"?E=e.target_id||null:E=t.original_trigger_id,t.connection_type==="stream"&&this.submissions.has(t.id)){const C=this.submissions.get(t.id);let z={fn_index:t.id,data:o,event_data:e.event_data};C.send_chunk(z),c.forEach(_=>_());continue}this.add_to_api_calls({fn_index:t.id,data:o,event_data:e.event_data,trigger_id:E});const u=await t.run(this.client,o,e.event_data,E);if(u.type==="void")c.forEach(C=>C());else if(u.type==="data")await this.handle_data(t.outputs,u.data),c.forEach(C=>C());else{let C=null;t.connection_type==="stream"&&!this.submissions.has(t.id)&&(C="waiting"),this.submissions.set(t.id,u.data);let z=0;e:for await(const _ of u.data)if(z===0&&t.inputs.forEach(Q=>{this.update_state_cb(Q,{loading_status:{validation_error:null}},!1)}),z+=1,_!==null){if(_.type==="data"&&await this.handle_data(t.outputs,_.data),_.type==="status"){_.original_msg==="process_starts"&&t.connection_type==="stream"&&(C="open");const{fn_index:Q,...m}=_;if(_.stage==="complete"){C="closed",g.forEach(b=>{this.dispatch({type:"fn",fn_index:b,event_data:null,target_id:E})}),this.dispatch_state_change_events(_),this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state();break e}else if(_.stage==="generating")this.dispatch_state_change_events(_),this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state();else if(_.stage==="error"){if(_.broken||_.session_not_found){this.connection_lost||(this.connection_lost=!0,this.on_connection_lost_cb()),this.loading_stati.update({status:"complete",fn_index:t.id,stream_state:null}),this.update_loading_stati_state();break e}if(Array.isArray(_?.message)){_.message.forEach((k,S)=>{this.update_state_cb(t.inputs[S],{loading_status:{validation_error:k.is_valid?null:k.message,show_validation_error:!0}},!1)}),t.outputs.forEach(k=>{t.inputs.includes(k)||this.update_state_cb(k,{loading_status:{status:null}},!1)}),c.forEach(k=>k()),this.submissions.delete(t.id),this.queue.has(t.id)&&(this.queue.delete(t.id),this.dispatch(e));return}const b=_?.message?.replace(ci,(k,S)=>S);throw this.log_cb(_?._title??"Error",b||"",Q,"error",m.duration,m.visible),new Error("Dependency function failed")}else this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state()}if(_.type==="render"){this.loading_stati.update({status:"complete",fn_index:t.id,stream_state:null}),this.update_loading_stati_state();const{layout:Q,components:m,render_id:b,dependencies:k}=_.data;this.rerender_cb(m,Q);const{by_id:S,by_event:G}=this.create(k);this.register_loading_stati(S),S.forEach(L=>this.dependencies_by_fn.set(L.id,L)),G.forEach((L,ae)=>this.dependencies_by_event.set(ae,L));const T=this.render_id_deps.get(b);T&&T.forEach(L=>{S.has(L)||this.dependencies_by_fn.delete(L)}),this.render_id_deps.set(b,new Set(Array.from(S.keys()))),this.register_loading_stati(S);break e}_.type==="log"&&this.handle_log(_)}w.forEach(_=>{this.dispatch({type:"fn",fn_index:_,event_data:null,target_id:E})}),c.forEach(_=>_()),this.submissions.delete(t.id),this.queue.has(t.id)&&(this.queue.delete(t.id),this.dispatch(e))}}catch{this.loading_stati.update({status:"error",fn_index:t.id,eta:0,queue:!1,stream_state:null}),this.update_loading_stati_state(),this.submissions.delete(t.id),h.forEach(u=>{this.dispatch({type:"fn",fn_index:u,event_data:null})})}}}}create(e){const i=new Map,a=new Map,t=[];for(const n of e){const o=new _i(n);for(const[c,g]of n.targets)a.has(`${g}-${c}`)||a.set(`${g}-${c}`,[]),a.get(`${g}-${c}`)?.push(o);if(i.set(n.id,o),n.trigger_after!==void 0){const c=n.trigger_only_on_failure?"failure":n.trigger_only_on_success?"success":"all";t.push([n.id,n.trigger_after,c])}}for(const[n,o,c]of t){const g=i.get(o);g&&(g.add_trigger(n,c),g.original_trigger_id=vi(e,o))}return{by_id:i,by_event:a}}handle_log(e){const{title:i,log:a,fn_index:t,level:n,duration:o,visible:c}=e;this.log_cb(i,a,t,n,o,c)}async handle_data(e,i){await Promise.all(e.map(async(a,t)=>{const n=i[t]===void 0?rt:i[t];if(n!==rt)if(fi(n)){let o=!1,c=null;for(const[g,h]of Object.entries(n))if(g!=="__type__"){if(g==="visible"){o=!0,c=h;continue}await this.update_state_cb(e[t],{[g]:h},!1)}o&&await this.update_state_cb(e[t],{visible:c},!0)}else await this.update_state_cb(a,{value:n},!1)}))}async gather_state(e,i=[]){return(await Promise.all(e.map(a=>this.get_state_cb(a)))).map((a,t)=>i.includes(t)?a??null:a?.value??null)}async set_event_args(e,i){let a={};const t=await this.get_state_cb?.(e);if(!t)return()=>{};for(const[n]of Object.entries(i))a[n]=t?.[n]??null;return Object.keys(i).length===0?()=>{}:(await this.update_state_cb(e,i,!1),()=>{this.update_state_cb(e,a,!1)})}async cancel(e){if(e)for(const i of e){const a=this.submissions.get(i);if(a){await a.cancel(),this.loading_stati.update({status:"complete",fn_index:i,eta:0,queue:!1,stream_state:null}),this.update_loading_stati_state(),this.submissions.delete(i);const{failure:t,all:n}=this.dependencies_by_fn.get(i)?.get_triggers()||{failure:[],all:[]};t.forEach(o=>{this.dispatch({type:"fn",fn_index:o,event_data:null,target_id:i})}),n.forEach(o=>{this.dispatch({type:"fn",fn_index:o,event_data:null,target_id:i})})}}}dispatch_load_events(){this.dependencies_by_fn.forEach(e=>{e.targets.forEach(([i,a])=>{a==="load"&&this.dispatch({type:"fn",fn_index:e.id,event_data:null,target_id:i})})})}get_fns_from_targets(e){const i=[];return this.dependencies_by_event.forEach((a,t)=>{const[,n]=t.split("-");Number(n)===e&&a.forEach(o=>{i.push(o.id)})}),i}close_stream(e){const i=this.get_fns_from_targets(e);for(const a of i){const t=this.submissions.get(a);t&&(t.close_stream(),this.submissions.delete(a)),this.loading_stati.update({status:"complete",fn_index:a,eta:0,queue:!1,stream_state:"closed"})}this.update_loading_stati_state()}}function fi(l){return typeof l=="object"&&l!==null&&"__type__"in l&&l?.__type__==="update"}function gi(l,e){return e?l==="always_last"?"defer":l==="multiple"?"run":l==="once"?"skip":"run":"run"}function hi(l,e,i,a){const t=e?i===1:a===1;try{return new _t("__fn_args",` let result = await (${l})(...__fn_args); if (typeof result === "undefined") return []; - return (${t} && !Array.isArray(result)) ? [result] : result;`)}catch(n){throw n}}function vi(l,e){let i=new Map,a=e,t=0;for(;t<100;){const n=i.get(a)||l.find(o=>o.id===a);if(!n||(i.set(n.id,n),n.trigger_after===null||n.trigger_after===void 0))break;a=n.trigger_after,t+=1}return a}var pi=H(" ",1),mi=H(''),bi=H('
·
',1),wi=H('
·
',1),yi=H('
·
'),ki=H('
'),xi=H(''),Ei=H(''),Ci=H('
',1);function Si(l,e){Pe(e,!0);const i=()=>at(tt,"$reactive_formatter",t),a=()=>at(Re,"$is_screen_recording",t),[t,n]=Gt();Ce(e,"render_complete",11,!1);let o=Ce(e,"ready",15,!1),c=Ce(e,"reload_count",11,0),g=Ce(e,"add_new_message",15);e.components.forEach(s=>{s.props.i18n||(s.props.i18n=i()),s.props.i18n_store=tt});let h=be(Ye([])),w=null;function E(s,r,f){if(r==="share"){const{title:p,description:M}=f}else if(r==="error")J("Error",f,-1,r,10,!0);else if(r==="warning")J("Warning",f,-1,r,10,!0);else if(r==="info")J("Info",f,-1,r,10,!0);else if(r==="gradio_expand"||r==="gradio_tab_select"){const p=r==="gradio_expand"?s:f.component_id;u.render_previously_invisible_children(p)}else if(r=="clear_status")u.update_state(s,{loading_status:{}},!1),b.clear_loading_status(s);else if(r=="close_stream")b.close_stream(s);else if(r==="custom_button_click"){const p=f.id;C(p,"click",null)}else r==="select"&&s in u.initial_tabs&&(s=f.id),b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let u=new Wt(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height},e.app,i(),E);function C(s,r,f){b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let z=be(Ye([])),_=be(null),Q=s=>{P(_,s,!0),d(T)&&P(z,[...d(z),d(_)],!0)};function m(){P(h,d(h).filter(s=>s.type!=="error"),!0),++de,d(h).push({title:"Connection Lost",message:Me,fn_index:-1,type:"error",id:de,duration:null,visible:!0}),w=setInterval(async()=>{try{const s=await e.app.reconnect();(s==="connected"||s==="changed")&&(clearInterval(w),w=null,window.location.reload())}catch(s){console.debug(s)}},2e3)}let b=new ui(e.dependencies,e.app,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),J,Q,m);lt(()=>{c(),jt(()=>{u.reload(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height}),b.reload(e.dependencies,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),e.app)})});let k=350,S=Ae(()=>e.search_params.get("view")==="api"&&e.footer_links.includes("api")),G=Ae(()=>e.search_params.get("view")==="settings"),T=Ae(()=>e.search_params.get("view")==="api-recorder"&&e.footer_links.includes("api")),L=!0,ae=!0,B=null,N=null,W=null,ee=be(null);async function fe(){if(!B||!N){const s=await pe(()=>import("./ApiDocs-dJKk0kqa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url),r=await pe(()=>import("./ApiRecorder-Bl4Lwcui.js"),__vite__mapDeps([28,1,2,3,4,7,8,9,5,10,11,12,13,14,29]),import.meta.url);B||(B=s?.default),N||(N=r?.default)}}async function se(){N||(N=(await pe(()=>import("./ApiRecorder-Bl4Lwcui.js"),__vite__mapDeps([28,1,2,3,4,7,8,9,5,10,11,12,13,14,29]),import.meta.url)).default)}async function ne(){W||(W=(await pe(()=>import("./Settings-C5X1Bk7G.js"),__vite__mapDeps([30,1,2,3,4,6,11,8,12,31,22,16,17,18,19,32,33,34,35,36,37,38,39,40,23,24,15,20,25,26,41,42]),import.meta.url)).default)}async function re(){if(!d(ee)){const s=await pe(()=>import("./Index-9wedEojI.js"),__vite__mapDeps([43,1,2,3,4,22,16,17,11,8,12,18,19,44,45,46,47,48,49,36,50,51,52,53,54,55,56]),import.meta.url);P(ee,s.default,!0)}}async function X(s){P(T,!1),s&&await fe(),P(S,s);let r=new URLSearchParams(window.location.search);s?r.set("view","api"):r.delete("view"),history.replaceState(null,"","?"+r.toString())}async function oe(s){s&&await ne();let r=new URLSearchParams(window.location.search);s?r.set("view","settings"):r.delete("view"),history.replaceState(null,"","?"+r.toString()),P(G,!d(G))}function J(s,r,f,p,M=10,A=!1){A&&d(h).push({title:s,message:r,fn_index:f,type:p,id:++de,duration:M,visible:A})}g(J);let de=-1;i()("blocks.long_requests_queue"),i()("blocks.connection_can_break");const Me="Connection to the server was lost. Attempting reconnection...";i()("blocks.waiting_for_inputs");let Re=Bt(!1),Ie=0,ge;function Ue(){if("parentIFrame"in window){const s=ge.children[0].getBoundingClientRect();if(!s)return;window.parentIFrame?.size(s.bottom+Ie+32)}}function Ge(){a()?ri():ni()}Pt(()=>{"parentIFrame"in window&&window.parentIFrame?.autoResize(!1);const s=new MutationObserver(Ue),r=new ResizeObserver(Ue);return s.observe(ge,{childList:!0,subtree:!0,attributes:!0}),r.observe(ge),u.ready.then(()=>{o(!0),b.dispatch_load_events()}),e.vibe_mode&&re(),()=>{s.disconnect(),r.disconnect(),w&&clearInterval(w)}});function ut(s){P(h,d(h).filter(r=>r.id!==s),!0)}var Be=Ci();Xt("1vd13eo",s=>{var r=pi(),f=D(r);{var p=O=>{zt(()=>{qt.title=e.title??""})};x(f,O=>{e.control_page_title&&O(p)})}var M=y(f,2);{var A=O=>{var U=Z(),Ee=D(U);Vt(Ee,()=>``),v(O,U)};x(M,O=>{e.css&&O(A)})}v(s,r)});var xe=D(Be);let Ne;var he=q(xe);let Ve;var ft=q(he);Fe(ft,{get node(){return u.root}}),I(he),ct(he,s=>ge=s,()=>ge);var Ze=y(he,2);{var gt=s=>{var r=yi(),f=q(r);{var p=R=>{var F=mi(),te=q(F);{var le=j=>{var _e=Ke();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api_or_mcp")]),v(j,_e)},Y=j=>{var _e=Ke();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api")]),v(j,_e)};x(te,j=>{e.app.config?.mcp_server?j(le):j(Y,!1)})}var ce=y(te,2);I(F),K(j=>{V(ce,"src",$t),V(ce,"alt",j)},[()=>i()("common.logo")]),ie("click",F,()=>{X(!d(S))}),ie("mouseenter",F,()=>{fe(),se()}),v(R,F)};x(f,R=>{e.footer_links.includes("api")&&R(p)})}var M=y(f,2);{var A=R=>{var F=bi(),te=y(D(F),2),le=q(te),Y=y(le);I(te),K((ce,j)=>{me(le,`${ce??""} `),V(Y,"src",Kt),V(Y,"alt",j)},[()=>i()("common.built_with_gradio"),()=>i()("common.logo")]),v(R,F)};x(M,R=>{e.footer_links.includes("gradio")&&R(A)})}var O=y(M,2);let U;var Ee=q(O),Xe=y(Ee);I(O);var kt=y(O,4);{var xt=R=>{var F=wi(),te=D(F);let le;var Y=y(te,2),ce=q(Y),j=y(ce);I(Y),K((_e,ve)=>{le=st(te,1,"divider svelte-1vd13eo",null,le,{hidden:!a()}),me(ce,`${_e??""} `),V(j,"src",ei),V(j,"alt",ve)},[()=>i()("common.settings"),()=>i()("common.settings")]),ie("click",Y,()=>{oe(!d(G))}),ie("mouseenter",Y,()=>{ne()}),v(R,F)};x(kt,R=>{e.footer_links.includes("settings")&&R(xt)})}I(r),K((R,F)=>{U=st(O,1,"record svelte-1vd13eo",null,U,{hidden:!a()}),me(Ee,`${R??""} `),V(Xe,"src",ti),V(Xe,"alt",F)},[()=>i()("common.stop_recording"),()=>i()("common.stop_recording")]),ie("click",O,()=>{Ge()}),Zt(r,"clientHeight",R=>Ie=R),v(s,r)};x(Ze,s=>{e.footer_links.length>0&&s(gt)})}var He=y(Ze,2);{var ht=s=>{var r=ki(),f=q(r);we(f,()=>N,(p,M)=>{M(p,{get api_calls(){return d(z)},get dependencies(){return e.dependencies}})}),I(r),ie("click",r,()=>{X(!0),P(T,!1)}),v(s,r)};x(He,s=>{d(T)&&N&&s(ht)})}var Qe=y(He,2);{var vt=s=>{var r=xi(),f=q(r),p=y(f,2),M=q(p);we(M,()=>B,(A,O)=>{O(A,{get root_node(){return u.root},get dependencies(){return e.dependencies},get root(){return e.root},get app(){return e.app},get space_id(){return e.space_id},get api_calls(){return d(z)},get username(){return e.username},get last_api_call(){return d(_)},$$events:{close:U=>{X(!1),P(z,[],!0),P(T,P(T,U.detail?.api_recorder_visible))}}})}),I(p),I(r),K(A=>V(r,"aria-label",A),[()=>i()("errors.use_via_api")]),ie("click",f,()=>{X(!1)}),v(s,r)};x(Qe,s=>{d(S)&&u.root&&B&&s(vt)})}var We=y(Qe,2);{var pt=s=>{var r=Ei(),f=q(r),p=y(f,2),M=q(p);we(M,()=>W,(A,O)=>{O(A,{onclose:()=>{oe(!1)},start_recording:()=>{Ge()},get pwa_enabled(){return e.app.config.pwa},get root(){return e.root},get space_id(){return e.space_id},get i18n(){return i()},get allow_zoom(){return L},set allow_zoom(U){L=U},get allow_video_trim(){return ae},set allow_video_trim(U){ae=U}})}),I(p),I(r),K(A=>V(r,"aria-label",A),[()=>i()("common.settings")]),ie("click",f,()=>{oe(!1)}),v(s,r)};x(We,s=>{d(G)&&e.app.config&&u.root&&W&&s(pt)})}var mt=y(We,2);{var bt=s=>{var r=Z(),f=D(r);we(f,()=>d(ee),(p,M)=>{M(p,{get app(){return e.app},get root(){return e.root}})}),v(s,r)};x(mt,s=>{e.vibe_mode&&d(ee)&&s(bt)})}I(xe);var wt=y(xe,2);{var yt=s=>{Qt(s,{get messages(){return d(h)},on_close:ut})};x(wt,s=>{d(h)&&s(yt)})}K(()=>{Ne=it(xe,"",Ne,{"min-height":e.app_mode?"100%":"auto"}),Ve=it(he,"",Ve,{"flex-grow":e.app_mode?"1":"auto","margin-right":e.vibe_mode?`${k}px`:"0"})}),v(l,Be),ze(),n()}const ji=Object.freeze(Object.defineProperty({__proto__:null,default:Si},Symbol.toStringTag,{value:"Module"}));export{ji as B,$t as a,Kt as g,ei as s}; + return (${t} && !Array.isArray(result)) ? [result] : result;`)}catch(n){throw n}}function vi(l,e){let i=new Map,a=e,t=0;for(;t<100;){const n=i.get(a)||l.find(o=>o.id===a);if(!n||(i.set(n.id,n),n.trigger_after===null||n.trigger_after===void 0))break;a=n.trigger_after,t+=1}return a}var pi=H(" ",1),mi=H(''),bi=H('
·
',1),wi=H('
·
',1),yi=H('
·
'),ki=H('
'),xi=H(''),Ei=H(''),Ci=H('
',1);function Si(l,e){Pe(e,!0);const i=()=>at(tt,"$reactive_formatter",t),a=()=>at(Re,"$is_screen_recording",t),[t,n]=Gt();Ce(e,"render_complete",11,!1);let o=Ce(e,"ready",15,!1),c=Ce(e,"reload_count",11,0),g=Ce(e,"add_new_message",15);e.components.forEach(s=>{s.props.i18n||(s.props.i18n=i()),s.props.i18n_store=tt});let h=be(Ye([])),w=null;function E(s,r,f){if(r==="share"){const{title:p,description:M}=f}else if(r==="error")J("Error",f,-1,r,10,!0);else if(r==="warning")J("Warning",f,-1,r,10,!0);else if(r==="info")J("Info",f,-1,r,10,!0);else if(r==="gradio_expand"||r==="gradio_tab_select"){const p=r==="gradio_expand"?s:f.component_id;u.render_previously_invisible_children(p)}else if(r=="clear_status")u.update_state(s,{loading_status:{}},!1),b.clear_loading_status(s);else if(r=="close_stream")b.close_stream(s);else if(r==="custom_button_click"){const p=f.id;C(p,"click",null)}else r==="select"&&s in u.initial_tabs&&(s=f.id),b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let u=new Wt(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height},e.app,i(),E);function C(s,r,f){b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let z=be(Ye([])),_=be(null),Q=s=>{P(_,s,!0),d(T)&&P(z,[...d(z),d(_)],!0)};function m(){P(h,d(h).filter(s=>s.type!=="error"),!0),++de,d(h).push({title:"Connection Lost",message:Me,fn_index:-1,type:"error",id:de,duration:null,visible:!0}),w=setInterval(async()=>{try{const s=await e.app.reconnect();(s==="connected"||s==="changed")&&(clearInterval(w),w=null,window.location.reload())}catch(s){console.debug(s)}},2e3)}let b=new ui(e.dependencies,e.app,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),J,Q,m);lt(()=>{c(),jt(()=>{u.reload(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height}),b.reload(e.dependencies,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),e.app)})});let k=350,S=Ae(()=>e.search_params.get("view")==="api"&&e.footer_links.includes("api")),G=Ae(()=>e.search_params.get("view")==="settings"),T=Ae(()=>e.search_params.get("view")==="api-recorder"&&e.footer_links.includes("api")),L=!0,ae=!0,B=null,N=null,W=null,ee=be(null);async function fe(){if(!B||!N){const s=await pe(()=>import("./ApiDocs-CseUrmNn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url),r=await pe(()=>import("./ApiRecorder-D0-fBJqr.js"),__vite__mapDeps([28,1,2,3,4,7,8,9,5,10,11,12,13,14,29]),import.meta.url);B||(B=s?.default),N||(N=r?.default)}}async function se(){N||(N=(await pe(()=>import("./ApiRecorder-D0-fBJqr.js"),__vite__mapDeps([28,1,2,3,4,7,8,9,5,10,11,12,13,14,29]),import.meta.url)).default)}async function ne(){W||(W=(await pe(()=>import("./Settings-D-eohf8z.js"),__vite__mapDeps([30,1,2,3,4,6,11,8,12,31,22,16,17,18,19,32,33,34,35,36,37,38,39,40,23,24,15,20,25,26,41,42]),import.meta.url)).default)}async function re(){if(!d(ee)){const s=await pe(()=>import("./Index-MykHl5RI.js"),__vite__mapDeps([43,1,2,3,4,22,16,17,11,8,12,18,19,44,45,46,47,48,49,36,50,51,52,53,54,55,56]),import.meta.url);P(ee,s.default,!0)}}async function X(s){P(T,!1),s&&await fe(),P(S,s);let r=new URLSearchParams(window.location.search);s?r.set("view","api"):r.delete("view"),history.replaceState(null,"","?"+r.toString())}async function oe(s){s&&await ne();let r=new URLSearchParams(window.location.search);s?r.set("view","settings"):r.delete("view"),history.replaceState(null,"","?"+r.toString()),P(G,!d(G))}function J(s,r,f,p,M=10,A=!1){A&&d(h).push({title:s,message:r,fn_index:f,type:p,id:++de,duration:M,visible:A})}g(J);let de=-1;i()("blocks.long_requests_queue"),i()("blocks.connection_can_break");const Me="Connection to the server was lost. Attempting reconnection...";i()("blocks.waiting_for_inputs");let Re=Bt(!1),Ie=0,ge;function Ue(){if("parentIFrame"in window){const s=ge.children[0].getBoundingClientRect();if(!s)return;window.parentIFrame?.size(s.bottom+Ie+32)}}function Ge(){a()?ri():ni()}Pt(()=>{"parentIFrame"in window&&window.parentIFrame?.autoResize(!1);const s=new MutationObserver(Ue),r=new ResizeObserver(Ue);return s.observe(ge,{childList:!0,subtree:!0,attributes:!0}),r.observe(ge),u.ready.then(()=>{o(!0),b.dispatch_load_events()}),e.vibe_mode&&re(),()=>{s.disconnect(),r.disconnect(),w&&clearInterval(w)}});function ut(s){P(h,d(h).filter(r=>r.id!==s),!0)}var Be=Ci();Xt("1vd13eo",s=>{var r=pi(),f=D(r);{var p=O=>{zt(()=>{qt.title=e.title??""})};x(f,O=>{e.control_page_title&&O(p)})}var M=y(f,2);{var A=O=>{var U=Z(),Ee=D(U);Vt(Ee,()=>``),v(O,U)};x(M,O=>{e.css&&O(A)})}v(s,r)});var xe=D(Be);let Ne;var he=q(xe);let Ve;var ft=q(he);Fe(ft,{get node(){return u.root}}),I(he),ct(he,s=>ge=s,()=>ge);var Ze=y(he,2);{var gt=s=>{var r=yi(),f=q(r);{var p=R=>{var F=mi(),te=q(F);{var le=j=>{var _e=Ke();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api_or_mcp")]),v(j,_e)},Y=j=>{var _e=Ke();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api")]),v(j,_e)};x(te,j=>{e.app.config?.mcp_server?j(le):j(Y,!1)})}var ce=y(te,2);I(F),K(j=>{V(ce,"src",$t),V(ce,"alt",j)},[()=>i()("common.logo")]),ie("click",F,()=>{X(!d(S))}),ie("mouseenter",F,()=>{fe(),se()}),v(R,F)};x(f,R=>{e.footer_links.includes("api")&&R(p)})}var M=y(f,2);{var A=R=>{var F=bi(),te=y(D(F),2),le=q(te),Y=y(le);I(te),K((ce,j)=>{me(le,`${ce??""} `),V(Y,"src",Kt),V(Y,"alt",j)},[()=>i()("common.built_with_gradio"),()=>i()("common.logo")]),v(R,F)};x(M,R=>{e.footer_links.includes("gradio")&&R(A)})}var O=y(M,2);let U;var Ee=q(O),Xe=y(Ee);I(O);var kt=y(O,4);{var xt=R=>{var F=wi(),te=D(F);let le;var Y=y(te,2),ce=q(Y),j=y(ce);I(Y),K((_e,ve)=>{le=st(te,1,"divider svelte-1vd13eo",null,le,{hidden:!a()}),me(ce,`${_e??""} `),V(j,"src",ei),V(j,"alt",ve)},[()=>i()("common.settings"),()=>i()("common.settings")]),ie("click",Y,()=>{oe(!d(G))}),ie("mouseenter",Y,()=>{ne()}),v(R,F)};x(kt,R=>{e.footer_links.includes("settings")&&R(xt)})}I(r),K((R,F)=>{U=st(O,1,"record svelte-1vd13eo",null,U,{hidden:!a()}),me(Ee,`${R??""} `),V(Xe,"src",ti),V(Xe,"alt",F)},[()=>i()("common.stop_recording"),()=>i()("common.stop_recording")]),ie("click",O,()=>{Ge()}),Zt(r,"clientHeight",R=>Ie=R),v(s,r)};x(Ze,s=>{e.footer_links.length>0&&s(gt)})}var He=y(Ze,2);{var ht=s=>{var r=ki(),f=q(r);we(f,()=>N,(p,M)=>{M(p,{get api_calls(){return d(z)},get dependencies(){return e.dependencies}})}),I(r),ie("click",r,()=>{X(!0),P(T,!1)}),v(s,r)};x(He,s=>{d(T)&&N&&s(ht)})}var Qe=y(He,2);{var vt=s=>{var r=xi(),f=q(r),p=y(f,2),M=q(p);we(M,()=>B,(A,O)=>{O(A,{get root_node(){return u.root},get dependencies(){return e.dependencies},get root(){return e.root},get app(){return e.app},get space_id(){return e.space_id},get api_calls(){return d(z)},get username(){return e.username},get last_api_call(){return d(_)},$$events:{close:U=>{X(!1),P(z,[],!0),P(T,P(T,U.detail?.api_recorder_visible))}}})}),I(p),I(r),K(A=>V(r,"aria-label",A),[()=>i()("errors.use_via_api")]),ie("click",f,()=>{X(!1)}),v(s,r)};x(Qe,s=>{d(S)&&u.root&&B&&s(vt)})}var We=y(Qe,2);{var pt=s=>{var r=Ei(),f=q(r),p=y(f,2),M=q(p);we(M,()=>W,(A,O)=>{O(A,{onclose:()=>{oe(!1)},start_recording:()=>{Ge()},get pwa_enabled(){return e.app.config.pwa},get root(){return e.root},get space_id(){return e.space_id},get i18n(){return i()},get allow_zoom(){return L},set allow_zoom(U){L=U},get allow_video_trim(){return ae},set allow_video_trim(U){ae=U}})}),I(p),I(r),K(A=>V(r,"aria-label",A),[()=>i()("common.settings")]),ie("click",f,()=>{oe(!1)}),v(s,r)};x(We,s=>{d(G)&&e.app.config&&u.root&&W&&s(pt)})}var mt=y(We,2);{var bt=s=>{var r=Z(),f=D(r);we(f,()=>d(ee),(p,M)=>{M(p,{get app(){return e.app},get root(){return e.root}})}),v(s,r)};x(mt,s=>{e.vibe_mode&&d(ee)&&s(bt)})}I(xe);var wt=y(xe,2);{var yt=s=>{Qt(s,{get messages(){return d(h)},on_close:ut})};x(wt,s=>{d(h)&&s(yt)})}K(()=>{Ne=it(xe,"",Ne,{"min-height":e.app_mode?"100%":"auto"}),Ve=it(he,"",Ve,{"flex-grow":e.app_mode?"1":"auto","margin-right":e.vibe_mode?`${k}px`:"0"})}),v(l,Be),ze(),n()}const ji=Object.freeze(Object.defineProperty({__proto__:null,default:Si},Symbol.toStringTag,{value:"Module"}));export{ji as B,$t as a,Kt as g,ei as s}; diff --git a/assets/BokehPlot-B0xAqoU-.js b/assets/BokehPlot-IYUvpdLF.js similarity index 94% rename from assets/BokehPlot-B0xAqoU-.js rename to assets/BokehPlot-IYUvpdLF.js index a705f58379c3686828139f9a3c98bf5bb055fc66..7084a07080cca9160482cf28d835b4cf4994a282 100644 --- a/assets/BokehPlot-B0xAqoU-.js +++ b/assets/BokehPlot-IYUvpdLF.js @@ -1 +1 @@ -import{a as y}from"./i18n-CPHyzK9b.js";import{M as q,aa as E,ab as D,ac as B,Z as s,t as H,a as I,O as J,a2 as L,R as N,$ as C}from"./index-DydPgVMC.js";var R=N('
');function z(F,e){q(e,!0);const d=`bokehDiv-${Math.random().toString(5).substring(2)}`;let b=L(()=>e.value?.plot);function M(o){return`${typeof window<"u"&&window.gradio_config?.root||""}/static/bokeh/${o}`}function t(o,n){return`${M(o)}/${n}`}function i(o,n){return n===`bokeh-${o}.min.js`?`https://cdn.bokeh.org/bokeh/release/${n}`:`https://cdn.pydata.org/bokeh/release/${n}`}function _(o,n){return new Promise((w,j)=>{const a=document.createElement("script");a.onload=()=>w(a),a.onerror=()=>{if(n){const r=document.createElement("script");r.onload=()=>w(r),r.onerror=()=>{console.error(`Failed to load Bokeh script: ${o}`),j(new Error(`Failed to load ${o}`))},r.src=n,document.head.appendChild(r)}else console.error(`Failed to load Bokeh script: ${o}`),j(new Error(`Failed to load ${o}`))},a.src=o,document.head.appendChild(a)})}async function O(o){if(document){const n=document.getElementById(d);n&&(n.innerHTML="")}if(window.Bokeh){g();let n=JSON.parse(o);await window.Bokeh.embed.embed_item(n,d)}}const k=e.bokeh_version?t(e.bokeh_version,`bokeh-${e.bokeh_version}.min.js`):null,u=e.bokeh_version?i(e.bokeh_version,`bokeh-${e.bokeh_version}.min.js`):null,P=e.bokeh_version?[t(e.bokeh_version,`bokeh-widgets-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-tables-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-gl-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-api-${e.bokeh_version}.min.js`)]:[],S=e.bokeh_version?[i(e.bokeh_version,`bokeh-widgets-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-tables-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-gl-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-api-${e.bokeh_version}.min.js`)]:[];let m=E(!1),v=E(D([]));async function x(){C(v,await Promise.all(P.map((o,n)=>_(o,S[n]))),!0),C(m,!0)}function h(){x()}let f=!1;function g(){const o=document.createElement("script");return o.onload=h,o.onerror=()=>{u&&_(u).then(h).catch(()=>{})},o.src=k,document.head.querySelector(`script[src="${k}"]`)?(h(),null):(document.head.appendChild(o),f=!0,o)}const c=e.bokeh_version?g():null;B(()=>{s(m)&&s(b)&&O(s(b))}),B(()=>()=>{f&&c&&document.head.contains(c)&&document.head.removeChild(c),s(v).forEach(o=>{document.head.contains(o)&&document.head.removeChild(o)})});var l=R();y(l,"data-testid","bokeh"),H(()=>y(l,"id",d)),I(F,l),J()}export{z as default}; +import{a as y}from"./i18n-DtG3MAQ1.js";import{M as q,aa as E,ab as D,ac as B,Z as s,t as H,a as I,O as J,a2 as L,R as N,$ as C}from"./index-BeNBoC9J.js";var R=N('
');function z(F,e){q(e,!0);const d=`bokehDiv-${Math.random().toString(5).substring(2)}`;let b=L(()=>e.value?.plot);function M(o){return`${typeof window<"u"&&window.gradio_config?.root||""}/static/bokeh/${o}`}function t(o,n){return`${M(o)}/${n}`}function i(o,n){return n===`bokeh-${o}.min.js`?`https://cdn.bokeh.org/bokeh/release/${n}`:`https://cdn.pydata.org/bokeh/release/${n}`}function _(o,n){return new Promise((w,j)=>{const a=document.createElement("script");a.onload=()=>w(a),a.onerror=()=>{if(n){const r=document.createElement("script");r.onload=()=>w(r),r.onerror=()=>{console.error(`Failed to load Bokeh script: ${o}`),j(new Error(`Failed to load ${o}`))},r.src=n,document.head.appendChild(r)}else console.error(`Failed to load Bokeh script: ${o}`),j(new Error(`Failed to load ${o}`))},a.src=o,document.head.appendChild(a)})}async function O(o){if(document){const n=document.getElementById(d);n&&(n.innerHTML="")}if(window.Bokeh){g();let n=JSON.parse(o);await window.Bokeh.embed.embed_item(n,d)}}const k=e.bokeh_version?t(e.bokeh_version,`bokeh-${e.bokeh_version}.min.js`):null,u=e.bokeh_version?i(e.bokeh_version,`bokeh-${e.bokeh_version}.min.js`):null,P=e.bokeh_version?[t(e.bokeh_version,`bokeh-widgets-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-tables-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-gl-${e.bokeh_version}.min.js`),t(e.bokeh_version,`bokeh-api-${e.bokeh_version}.min.js`)]:[],S=e.bokeh_version?[i(e.bokeh_version,`bokeh-widgets-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-tables-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-gl-${e.bokeh_version}.min.js`),i(e.bokeh_version,`bokeh-api-${e.bokeh_version}.min.js`)]:[];let m=E(!1),v=E(D([]));async function x(){C(v,await Promise.all(P.map((o,n)=>_(o,S[n]))),!0),C(m,!0)}function h(){x()}let f=!1;function g(){const o=document.createElement("script");return o.onload=h,o.onerror=()=>{u&&_(u).then(h).catch(()=>{})},o.src=k,document.head.querySelector(`script[src="${k}"]`)?(h(),null):(document.head.appendChild(o),f=!0,o)}const c=e.bokeh_version?g():null;B(()=>{s(m)&&s(b)&&O(s(b))}),B(()=>()=>{f&&c&&document.head.contains(c)&&document.head.removeChild(c),s(v).forEach(o=>{document.head.contains(o)&&document.head.removeChild(o)})});var l=R();y(l,"data-testid","bokeh"),H(()=>y(l,"id",d)),I(F,l),J()}export{z as default}; diff --git a/assets/Button-CV36sOqf.js b/assets/Button-j0-_VC-G.js similarity index 86% rename from assets/Button-CV36sOqf.js rename to assets/Button-j0-_VC-G.js index da78bc16a033c1532ea4da67c0775f37f1340749..1b807d3f573ec47956e6295e0d3e56640eadcc88 100644 --- a/assets/Button-CV36sOqf.js +++ b/assets/Button-j0-_VC-G.js @@ -1 +1 @@ -import{p as l,i as m,a as s,b as M,f as N}from"./i18n-CPHyzK9b.js";import{M as J,a3 as x,N as j,a as o,O as K,ah as L,Q as O,S as Q,T as R,t as S,R as A,Z as _,a2 as u}from"./index-DydPgVMC.js";import{s as T}from"./snippet-BtHMuX3s.js";import{I as Z}from"./Image-CZ1Hb99p.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */var U=A(" "),V=A("");function te(C,e){J(e,!0);let q=l(e,"elem_classes",19,()=>[]),v=l(e,"visible",3,!0),z=l(e,"variant",3,"secondary"),B=l(e,"size",3,"md"),g=l(e,"value",3,null),I=l(e,"link_target",3,"_self"),h=l(e,"disabled",3,!1),b=l(e,"scale",3,null),D=l(e,"onclick",3,()=>{});var P=x(),E=j(P);{var F=r=>{var a=U();let d,c;var f=O(a);{var k=t=>{{let i=u(()=>e.icon.url??""),n=u(()=>({alt:`${g()} icon`,class:"button-icon"}));Z(t,{get src(){return _(i)},get restProps(){return _(n)}})}};m(f,t=>{e.icon&&t(k)})}var w=Q(f,2);{var y=t=>{var i=x(),n=j(i);T(n,()=>e.children),o(t,i)};m(w,t=>{e.children&&t(y)})}R(a),S(t=>{s(a,"href",e.link),s(a,"target",I()),s(a,"rel",I()==="_blank"?"noopener noreferrer":void 0),s(a,"aria-disabled",h()),d=M(a,1,`${B()??""} ${z()??""} ${t??""}`,"svelte-7f1dq6",d,{hidden:v()===!1||v()==="hidden",disabled:h()}),s(a,"id",e.elem_id),c=N(a,"",c,{"flex-grow":b(),"pointer-events":h()?"none":null,width:b()===0?"fit-content":null,"min-width":typeof e.min_width=="number"?`calc(min(${e.min_width}px, 100%))`:null})},[()=>(q()??[]).join(" ")]),o(r,a)},G=r=>{var a=V();a.__click=function(...t){D()?.apply(this,t)};let d,c;var f=O(a);{var k=t=>{{let i=u(()=>({alt:`${g()} icon`})),n=u(()=>[`button-icon ${g()?"right-padded":""}`]),H=u(()=>e.icon.url??"");Z(t,{get restProps(){return _(i)},get class_names(){return _(n)},get src(){return _(H)}})}};m(f,t=>{e.icon&&t(k)})}var w=Q(f,2);{var y=t=>{var i=x(),n=j(i);T(n,()=>e.children),o(t,i)};m(w,t=>{e.children&&t(y)})}R(a),S(t=>{d=M(a,1,`${B()??""} ${z()??""} ${t??""}`,"svelte-7f1dq6",d,{hidden:v()===!1||v()==="hidden"}),s(a,"id",e.elem_id),a.disabled=h(),c=N(a,"",c,{"flex-grow":b(),width:b()===0?"fit-content":null,"min-width":typeof e.min_width=="number"?`calc(min(${e.min_width}px, 100%))`:null})},[()=>(q()??[]).join(" ")]),o(r,a)};m(E,r=>{e.link&&e.link.length>0?r(F):r(G,!1)})}o(C,P),K()}L(["click"]);export{te as B}; +import{p as l,i as m,a as s,b as M,f as N}from"./i18n-DtG3MAQ1.js";import{M as J,a3 as x,N as j,a as o,O as K,ah as L,Q as O,S as Q,T as R,t as S,R as A,Z as _,a2 as u}from"./index-BeNBoC9J.js";import{s as T}from"./snippet-BRIBYCwB.js";import{I as Z}from"./Image-ALBOEs1f.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */var U=A(" "),V=A("");function te(C,e){J(e,!0);let q=l(e,"elem_classes",19,()=>[]),v=l(e,"visible",3,!0),z=l(e,"variant",3,"secondary"),B=l(e,"size",3,"md"),g=l(e,"value",3,null),I=l(e,"link_target",3,"_self"),h=l(e,"disabled",3,!1),b=l(e,"scale",3,null),D=l(e,"onclick",3,()=>{});var P=x(),E=j(P);{var F=r=>{var a=U();let d,c;var f=O(a);{var k=t=>{{let i=u(()=>e.icon.url??""),n=u(()=>({alt:`${g()} icon`,class:"button-icon"}));Z(t,{get src(){return _(i)},get restProps(){return _(n)}})}};m(f,t=>{e.icon&&t(k)})}var w=Q(f,2);{var y=t=>{var i=x(),n=j(i);T(n,()=>e.children),o(t,i)};m(w,t=>{e.children&&t(y)})}R(a),S(t=>{s(a,"href",e.link),s(a,"target",I()),s(a,"rel",I()==="_blank"?"noopener noreferrer":void 0),s(a,"aria-disabled",h()),d=M(a,1,`${B()??""} ${z()??""} ${t??""}`,"svelte-7f1dq6",d,{hidden:v()===!1||v()==="hidden",disabled:h()}),s(a,"id",e.elem_id),c=N(a,"",c,{"flex-grow":b(),"pointer-events":h()?"none":null,width:b()===0?"fit-content":null,"min-width":typeof e.min_width=="number"?`calc(min(${e.min_width}px, 100%))`:null})},[()=>(q()??[]).join(" ")]),o(r,a)},G=r=>{var a=V();a.__click=function(...t){D()?.apply(this,t)};let d,c;var f=O(a);{var k=t=>{{let i=u(()=>({alt:`${g()} icon`})),n=u(()=>[`button-icon ${g()?"right-padded":""}`]),H=u(()=>e.icon.url??"");Z(t,{get restProps(){return _(i)},get class_names(){return _(n)},get src(){return _(H)}})}};m(f,t=>{e.icon&&t(k)})}var w=Q(f,2);{var y=t=>{var i=x(),n=j(i);T(n,()=>e.children),o(t,i)};m(w,t=>{e.children&&t(y)})}R(a),S(t=>{d=M(a,1,`${B()??""} ${z()??""} ${t??""}`,"svelte-7f1dq6",d,{hidden:v()===!1||v()==="hidden"}),s(a,"id",e.elem_id),a.disabled=h(),c=N(a,"",c,{"flex-grow":b(),width:b()===0?"fit-content":null,"min-width":typeof e.min_width=="number"?`calc(min(${e.min_width}px, 100%))`:null})},[()=>(q()??[]).join(" ")]),o(r,a)};m(E,r=>{e.link&&e.link.length>0?r(F):r(G,!1)})}o(C,P),K()}L(["click"]);export{te as B}; diff --git a/assets/Canvas3D-TG45VLbi.js b/assets/Canvas3D-BbKV2SzE.js similarity index 85% rename from assets/Canvas3D-TG45VLbi.js rename to assets/Canvas3D-BbKV2SzE.js index c61363c28ef8c85c5b52c8f6038b25cbe7fe31a9..36ec2738459dea74a9a5d975fe7254f0ac7a571c 100644 --- a/assets/Canvas3D-TG45VLbi.js +++ b/assets/Canvas3D-BbKV2SzE.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css"])))=>i.map(i=>d[i]); -import{M as V,a7 as M,ac as P,Z as a,a as I,O,a2 as R,aa as f,R as g,$ as u,af as A}from"./index-DydPgVMC.js";import{d as x}from"./i18n-CPHyzK9b.js";var E=g("");function S(h,i){V(i,!0);let c,p=R(()=>i.value.url),d,n=f(void 0),s=f(void 0),l=f(!1);M(()=>{let e=!0;return(async()=>{c=await A(()=>import("./index-GY9JDBGV.js").then(t=>t.cx),__vite__mapDeps([0,1,2]),import.meta.url);const o=await c.CreateViewerForCanvas(d,{clearColor:i.clear_color,useRightHandedSystem:!0,animationAutoPlay:!0,cameraAutoOrbit:{enabled:!1},onInitialized:t=>{u(s,t,!0)}});if(!e){o.dispose();return}u(n,o,!0),u(l,!0)})(),()=>{e=!1,u(l,!1),a(n)?.dispose(),u(n,void 0)}}),P(()=>{a(l)&&b(a(p))});function m(e,r){a(s)&&(a(s).scene.forcePointsCloud=e,a(s).scene.forceWireframe=r)}async function b(e){const r=a(n);if(r)if(e){try{await r.loadModel(e,{pluginOptions:{obj:{importVertexColors:!0}}})}catch(o){a(l)&&r===a(n)&&console.error(o);return}if(!a(l)||r!==a(n))return;i.display_mode==="point_cloud"?m(!0,!1):i.display_mode==="wireframe"?m(!1,!0):v(i.camera_position,i.zoom_speed,i.pan_speed)}else r.resetModel()}function v(e,r,o){if(!a(s))return;const t=a(s).camera;e[0]!==null&&(t.alpha=e[0]*Math.PI/180),e[1]!==null&&(t.beta=e[1]*Math.PI/180),e[2]!==null&&(t.radius=e[2]),t.lowerRadiusLimit=.1;const w=()=>{t.wheelPrecision=250/(t.radius*r),t.panningSensibility=1e4*o/t.radius};w(),t.onAfterCheckInputsObservable.add(w)}function y(){a(s)&&a(n)&&a(n).resetCamera()}var C={update_camera:v,reset_camera_position:y},_=E();return x(_,e=>d=e,()=>d),I(h,_),O(C)}export{S as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DmfQKmJL.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css"])))=>i.map(i=>d[i]); +import{M as V,a7 as M,ac as P,Z as a,a as I,O,a2 as R,aa as f,R as g,$ as u,af as A}from"./index-BeNBoC9J.js";import{d as x}from"./i18n-DtG3MAQ1.js";var E=g("");function S(h,i){V(i,!0);let c,p=R(()=>i.value.url),d,n=f(void 0),s=f(void 0),l=f(!1);M(()=>{let e=!0;return(async()=>{c=await A(()=>import("./index-DmfQKmJL.js").then(t=>t.cx),__vite__mapDeps([0,1,2]),import.meta.url);const o=await c.CreateViewerForCanvas(d,{clearColor:i.clear_color,useRightHandedSystem:!0,animationAutoPlay:!0,cameraAutoOrbit:{enabled:!1},onInitialized:t=>{u(s,t,!0)}});if(!e){o.dispose();return}u(n,o,!0),u(l,!0)})(),()=>{e=!1,u(l,!1),a(n)?.dispose(),u(n,void 0)}}),P(()=>{a(l)&&b(a(p))});function m(e,r){a(s)&&(a(s).scene.forcePointsCloud=e,a(s).scene.forceWireframe=r)}async function b(e){const r=a(n);if(r)if(e){try{await r.loadModel(e,{pluginOptions:{obj:{importVertexColors:!0}}})}catch(o){a(l)&&r===a(n)&&console.error(o);return}if(!a(l)||r!==a(n))return;i.display_mode==="point_cloud"?m(!0,!1):i.display_mode==="wireframe"?m(!1,!0):v(i.camera_position,i.zoom_speed,i.pan_speed)}else r.resetModel()}function v(e,r,o){if(!a(s))return;const t=a(s).camera;e[0]!==null&&(t.alpha=e[0]*Math.PI/180),e[1]!==null&&(t.beta=e[1]*Math.PI/180),e[2]!==null&&(t.radius=e[2]),t.lowerRadiusLimit=.1;const w=()=>{t.wheelPrecision=250/(t.radius*r),t.panningSensibility=1e4*o/t.radius};w(),t.onAfterCheckInputsObservable.add(w)}function y(){a(s)&&a(n)&&a(n).resetCamera()}var C={update_camera:v,reset_camera_position:y},_=E();return x(_,e=>d=e,()=>d),I(h,_),O(C)}export{S as default}; diff --git a/assets/Canvas3DGS-CSEUG3T9.js b/assets/Canvas3DGS-CPiRrZLZ.js similarity index 99% rename from assets/Canvas3DGS-CSEUG3T9.js rename to assets/Canvas3DGS-CPiRrZLZ.js index 1dc5251b305726d123646b9ffdc6c50aca76a7aa..acae472f4bdb83ce178e5b56a655a3d318943227 100644 --- a/assets/Canvas3DGS-CSEUG3T9.js +++ b/assets/Canvas3DGS-CPiRrZLZ.js @@ -1,4 +1,4 @@ -import{d as It}from"./i18n-CPHyzK9b.js";import{M as lt,a7 as dt,ac as ht,a as Rt,O as ct,R as Et,$ as St,aa as Jt,Z as tt,a2 as At}from"./index-DydPgVMC.js";class h{constructor(t=0,e=0,A=0){this.x=t,this.y=e,this.z=A}equals(t){return!(this.x!==t.x||this.y!==t.y||this.z!==t.z)}add(t){return typeof t=="number"?new h(this.x+t,this.y+t,this.z+t):new h(this.x+t.x,this.y+t.y,this.z+t.z)}subtract(t){return typeof t=="number"?new h(this.x-t,this.y-t,this.z-t):new h(this.x-t.x,this.y-t.y,this.z-t.z)}multiply(t){return typeof t=="number"?new h(this.x*t,this.y*t,this.z*t):t instanceof h?new h(this.x*t.x,this.y*t.y,this.z*t.z):new h(this.x*t.buffer[0]+this.y*t.buffer[4]+this.z*t.buffer[8]+t.buffer[12],this.x*t.buffer[1]+this.y*t.buffer[5]+this.z*t.buffer[9]+t.buffer[13],this.x*t.buffer[2]+this.y*t.buffer[6]+this.z*t.buffer[10]+t.buffer[14])}divide(t){return typeof t=="number"?new h(this.x/t,this.y/t,this.z/t):new h(this.x/t.x,this.y/t.y,this.z/t.z)}cross(t){const e=this.y*t.z-this.z*t.y,A=this.z*t.x-this.x*t.z,Q=this.x*t.y-this.y*t.x;return new h(e,A,Q)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lerp(t,e){return new h(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e,this.z+(t.z-this.z)*e)}min(t){return new h(Math.min(this.x,t.x),Math.min(this.y,t.y),Math.min(this.z,t.z))}max(t){return new h(Math.max(this.x,t.x),Math.max(this.y,t.y),Math.max(this.z,t.z))}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error(`Invalid component index: ${t}`)}}minComponent(){return this.xthis.y&&this.x>this.z?0:this.y>this.z?1:2}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distanceTo(t){return Math.sqrt((this.x-t.x)**2+(this.y-t.y)**2+(this.z-t.z)**2)}normalize(){const t=this.magnitude();return new h(this.x/t,this.y/t,this.z/t)}flat(){return[this.x,this.y,this.z]}clone(){return new h(this.x,this.y,this.z)}toString(){return`[${this.flat().join(", ")}]`}static One(t=1){return new h(t,t,t)}}class f{constructor(t=0,e=0,A=0,Q=1){this.x=t,this.y=e,this.z=A,this.w=Q}equals(t){return!(this.x!==t.x||this.y!==t.y||this.z!==t.z||this.w!==t.w)}normalize(){const t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return new f(this.x/t,this.y/t,this.z/t,this.w/t)}multiply(t){const e=this.w,A=this.x,Q=this.y,s=this.z,n=t.w,U=t.x,F=t.y,i=t.z;return new f(e*U+A*n+Q*i-s*F,e*F-A*i+Q*n+s*U,e*i+A*F-Q*U+s*n,e*n-A*U-Q*F-s*i)}inverse(){const t=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;return new f(-this.x/t,-this.y/t,-this.z/t,this.w/t)}apply(t){const e=new f(t.x,t.y,t.z,0),A=new f(-this.x,-this.y,-this.z,this.w),Q=this.multiply(e).multiply(A);return new h(Q.x,Q.y,Q.z)}flat(){return[this.x,this.y,this.z,this.w]}clone(){return new f(this.x,this.y,this.z,this.w)}static FromEuler(t){const e=t.x/2,A=t.y/2,Q=t.z/2,s=Math.cos(A),n=Math.sin(A),U=Math.cos(e),F=Math.sin(e),i=Math.cos(Q),l=Math.sin(Q);return new f(s*F*i+n*U*l,n*U*i-s*F*l,s*U*l-n*F*i,s*U*i+n*F*l)}toEuler(){const t=2*(this.w*this.x+this.y*this.z),e=1-2*(this.x*this.x+this.y*this.y),A=Math.atan2(t,e);let Q;const s=2*(this.w*this.y-this.z*this.x);Math.abs(s)>=1?Q=Math.sign(s)*Math.PI/2:Q=Math.asin(s);const n=2*(this.w*this.z+this.x*this.y),U=1-2*(this.y*this.y+this.z*this.z),F=Math.atan2(n,U);return new h(A,Q,F)}static FromMatrix3(t){const e=t.buffer,A=e[0]+e[4]+e[8];let Q,s,n,U;if(A>0){const F=.5/Math.sqrt(A+1);U=.25/F,Q=(e[7]-e[5])*F,s=(e[2]-e[6])*F,n=(e[3]-e[1])*F}else if(e[0]>e[4]&&e[0]>e[8]){const F=2*Math.sqrt(1+e[0]-e[4]-e[8]);U=(e[7]-e[5])/F,Q=.25*F,s=(e[1]+e[3])/F,n=(e[2]+e[6])/F}else if(e[4]>e[8]){const F=2*Math.sqrt(1+e[4]-e[0]-e[8]);U=(e[2]-e[6])/F,Q=(e[1]+e[3])/F,s=.25*F,n=(e[5]+e[7])/F}else{const F=2*Math.sqrt(1+e[8]-e[0]-e[4]);U=(e[3]-e[1])/F,Q=(e[2]+e[6])/F,s=(e[5]+e[7])/F,n=.25*F}return new f(Q,s,n,U)}static FromAxisAngle(t,e){const A=e/2,Q=Math.sin(A),s=Math.cos(A);return new f(t.x*Q,t.y*Q,t.z*Q,s)}static LookRotation(t){const e=new h(0,0,1),A=e.dot(t);if(Math.abs(A- -1)<1e-6)return new f(0,1,0,Math.PI);if(Math.abs(A-1)<1e-6)return new f;const Q=Math.acos(A),s=e.cross(t).normalize();return f.FromAxisAngle(s,Q)}toString(){return`[${this.flat().join(", ")}]`}}class it{constructor(){const t=new Map;this.addEventListener=(e,A)=>{t.has(e)||t.set(e,new Set),t.get(e).add(A)},this.removeEventListener=(e,A)=>{t.has(e)&&t.get(e).delete(A)},this.hasEventListener=(e,A)=>t.has(e)?t.get(e).has(A):!1,this.dispatchEvent=e=>{if(t.has(e.type))for(const A of t.get(e.type))A(e)}}}class X{constructor(t=1,e=0,A=0,Q=0,s=0,n=1,U=0,F=0,i=0,l=0,d=1,B=0,r=0,C=0,I=0,a=1){this.buffer=[t,e,A,Q,s,n,U,F,i,l,d,B,r,C,I,a]}equals(t){if(this.buffer.length!==t.buffer.length)return!1;if(this.buffer===t.buffer)return!0;for(let e=0;e{},this.applyPosition=()=>{this.position=new h},this.applyRotation=()=>{this.rotation=new f},this.applyScale=()=>{this.scale=new h(1,1,1)},this.raiseChangeEvent=()=>{this.dispatchEvent(this._changeEvent)}}_updateMatrix(){this._transform=X.Compose(this._position,this._rotation,this._scale)}get position(){return this._position}set position(t){this._position.equals(t)||(this._position=t,this.positionChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get rotation(){return this._rotation}set rotation(t){this._rotation.equals(t)||(this._rotation=t,this.rotationChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get scale(){return this._scale}set scale(t){this._scale.equals(t)||(this._scale=t,this.scaleChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get forward(){let t=new h(0,0,1);return t=this.rotation.apply(t),t}get transform(){return this._transform}}class j{constructor(t=1,e=0,A=0,Q=0,s=1,n=0,U=0,F=0,i=1){this.buffer=[t,e,A,Q,s,n,U,F,i]}equals(t){if(this.buffer.length!==t.buffer.length)return!1;if(this.buffer===t.buffer)return!0;for(let e=0;e{for(let U=0;U{const U=j.RotationFromQuaternion(n).buffer;for(let F=0;F{for(let U=0;U{const n=new Uint8Array(this.vertexCount*K.RowLength),U=new Float32Array(n.buffer),F=new Uint8Array(n.buffer);for(let i=0;i{console.assert(n.byteLength===this.vertexCount*3*4,`Expected ${this.vertexCount*3*4} bytes, got ${n.byteLength} bytes`),this._positions=new Float32Array(n),this._rotations=new Float32Array(U),this._scales=new Float32Array(F),this._colors=new Uint8Array(i),this._selection=new Uint8Array(l),this.detached=!1}}static{this.RowLength=32}static Deserialize(t){const e=t.length/K.RowLength,A=new Float32Array(3*e),Q=new Float32Array(4*e),s=new Float32Array(3*e),n=new Uint8Array(4*e),U=new Float32Array(t.buffer),F=new Uint8Array(t.buffer);for(let i=0;ithis.y&&this.x>this.z?0:this.y>this.z?1:2}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distanceTo(t){return Math.sqrt((this.x-t.x)**2+(this.y-t.y)**2+(this.z-t.z)**2)}normalize(){const t=this.magnitude();return new h(this.x/t,this.y/t,this.z/t)}flat(){return[this.x,this.y,this.z]}clone(){return new h(this.x,this.y,this.z)}toString(){return`[${this.flat().join(", ")}]`}static One(t=1){return new h(t,t,t)}}class f{constructor(t=0,e=0,A=0,Q=1){this.x=t,this.y=e,this.z=A,this.w=Q}equals(t){return!(this.x!==t.x||this.y!==t.y||this.z!==t.z||this.w!==t.w)}normalize(){const t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return new f(this.x/t,this.y/t,this.z/t,this.w/t)}multiply(t){const e=this.w,A=this.x,Q=this.y,s=this.z,n=t.w,U=t.x,F=t.y,i=t.z;return new f(e*U+A*n+Q*i-s*F,e*F-A*i+Q*n+s*U,e*i+A*F-Q*U+s*n,e*n-A*U-Q*F-s*i)}inverse(){const t=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;return new f(-this.x/t,-this.y/t,-this.z/t,this.w/t)}apply(t){const e=new f(t.x,t.y,t.z,0),A=new f(-this.x,-this.y,-this.z,this.w),Q=this.multiply(e).multiply(A);return new h(Q.x,Q.y,Q.z)}flat(){return[this.x,this.y,this.z,this.w]}clone(){return new f(this.x,this.y,this.z,this.w)}static FromEuler(t){const e=t.x/2,A=t.y/2,Q=t.z/2,s=Math.cos(A),n=Math.sin(A),U=Math.cos(e),F=Math.sin(e),i=Math.cos(Q),l=Math.sin(Q);return new f(s*F*i+n*U*l,n*U*i-s*F*l,s*U*l-n*F*i,s*U*i+n*F*l)}toEuler(){const t=2*(this.w*this.x+this.y*this.z),e=1-2*(this.x*this.x+this.y*this.y),A=Math.atan2(t,e);let Q;const s=2*(this.w*this.y-this.z*this.x);Math.abs(s)>=1?Q=Math.sign(s)*Math.PI/2:Q=Math.asin(s);const n=2*(this.w*this.z+this.x*this.y),U=1-2*(this.y*this.y+this.z*this.z),F=Math.atan2(n,U);return new h(A,Q,F)}static FromMatrix3(t){const e=t.buffer,A=e[0]+e[4]+e[8];let Q,s,n,U;if(A>0){const F=.5/Math.sqrt(A+1);U=.25/F,Q=(e[7]-e[5])*F,s=(e[2]-e[6])*F,n=(e[3]-e[1])*F}else if(e[0]>e[4]&&e[0]>e[8]){const F=2*Math.sqrt(1+e[0]-e[4]-e[8]);U=(e[7]-e[5])/F,Q=.25*F,s=(e[1]+e[3])/F,n=(e[2]+e[6])/F}else if(e[4]>e[8]){const F=2*Math.sqrt(1+e[4]-e[0]-e[8]);U=(e[2]-e[6])/F,Q=(e[1]+e[3])/F,s=.25*F,n=(e[5]+e[7])/F}else{const F=2*Math.sqrt(1+e[8]-e[0]-e[4]);U=(e[3]-e[1])/F,Q=(e[2]+e[6])/F,s=(e[5]+e[7])/F,n=.25*F}return new f(Q,s,n,U)}static FromAxisAngle(t,e){const A=e/2,Q=Math.sin(A),s=Math.cos(A);return new f(t.x*Q,t.y*Q,t.z*Q,s)}static LookRotation(t){const e=new h(0,0,1),A=e.dot(t);if(Math.abs(A- -1)<1e-6)return new f(0,1,0,Math.PI);if(Math.abs(A-1)<1e-6)return new f;const Q=Math.acos(A),s=e.cross(t).normalize();return f.FromAxisAngle(s,Q)}toString(){return`[${this.flat().join(", ")}]`}}class it{constructor(){const t=new Map;this.addEventListener=(e,A)=>{t.has(e)||t.set(e,new Set),t.get(e).add(A)},this.removeEventListener=(e,A)=>{t.has(e)&&t.get(e).delete(A)},this.hasEventListener=(e,A)=>t.has(e)?t.get(e).has(A):!1,this.dispatchEvent=e=>{if(t.has(e.type))for(const A of t.get(e.type))A(e)}}}class X{constructor(t=1,e=0,A=0,Q=0,s=0,n=1,U=0,F=0,i=0,l=0,d=1,B=0,r=0,C=0,I=0,a=1){this.buffer=[t,e,A,Q,s,n,U,F,i,l,d,B,r,C,I,a]}equals(t){if(this.buffer.length!==t.buffer.length)return!1;if(this.buffer===t.buffer)return!0;for(let e=0;e{},this.applyPosition=()=>{this.position=new h},this.applyRotation=()=>{this.rotation=new f},this.applyScale=()=>{this.scale=new h(1,1,1)},this.raiseChangeEvent=()=>{this.dispatchEvent(this._changeEvent)}}_updateMatrix(){this._transform=X.Compose(this._position,this._rotation,this._scale)}get position(){return this._position}set position(t){this._position.equals(t)||(this._position=t,this.positionChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get rotation(){return this._rotation}set rotation(t){this._rotation.equals(t)||(this._rotation=t,this.rotationChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get scale(){return this._scale}set scale(t){this._scale.equals(t)||(this._scale=t,this.scaleChanged=!0,this._updateMatrix(),this.dispatchEvent(this._changeEvent))}get forward(){let t=new h(0,0,1);return t=this.rotation.apply(t),t}get transform(){return this._transform}}class j{constructor(t=1,e=0,A=0,Q=0,s=1,n=0,U=0,F=0,i=1){this.buffer=[t,e,A,Q,s,n,U,F,i]}equals(t){if(this.buffer.length!==t.buffer.length)return!1;if(this.buffer===t.buffer)return!0;for(let e=0;e{for(let U=0;U{const U=j.RotationFromQuaternion(n).buffer;for(let F=0;F{for(let U=0;U{const n=new Uint8Array(this.vertexCount*K.RowLength),U=new Float32Array(n.buffer),F=new Uint8Array(n.buffer);for(let i=0;i{console.assert(n.byteLength===this.vertexCount*3*4,`Expected ${this.vertexCount*3*4} bytes, got ${n.byteLength} bytes`),this._positions=new Float32Array(n),this._rotations=new Float32Array(U),this._scales=new Float32Array(F),this._colors=new Uint8Array(i),this._selection=new Uint8Array(l),this.detached=!1}}static{this.RowLength=32}static Deserialize(t){const e=t.length/K.RowLength,A=new Float32Array(3*e),Q=new Float32Array(4*e),s=new Float32Array(3*e),n=new Uint8Array(4*e),U=new Float32Array(t.buffer),F=new Uint8Array(t.buffer);for(let i=0;i');function a(o){var r=s();t(o,r)}export{a as C}; +import"./i18n-DtG3MAQ1.js";import{a as t,f as e}from"./index-BeNBoC9J.js";var s=e('');function a(o){var r=s();t(o,r)}export{a as C}; diff --git a/assets/Checkbox-Bh_yH8eu.js b/assets/Checkbox-DdDaw1pY.js similarity index 85% rename from assets/Checkbox-Bh_yH8eu.js rename to assets/Checkbox-DdDaw1pY.js index a261f1eea60c9b46110578418ffb2a4ec54a1c6a..8a894bc0c2cce853195133f63dcb0df5585e19fa 100644 --- a/assets/Checkbox-Bh_yH8eu.js +++ b/assets/Checkbox-DdDaw1pY.js @@ -1 +1 @@ -import{p as l,m as M,i as O,b as Q,v as R}from"./i18n-CPHyzK9b.js";import{M as S,aa as U,ab as X,ac as Z,Z as r,$ as j,t as b,U as _,a as f,O as q,Q as h,S as z,R as m,a2 as A,T as v,X as B}from"./index-DydPgVMC.js";import{a as D}from"./input-BtIxlP_B.js";import{b as F}from"./universal-C9tCO36V.js";var G=m(' '),H=m('');function N(k,a){S(a,!0);let y=l(a,"label",3,"Checkbox"),t=l(a,"value",15),i=l(a,"indeterminate",7,!1),x=l(a,"interactive",3,!0),p=l(a,"show_label",3,!0),d=A(()=>!x()),o=U(X(t()));Z(()=>{r(o)!==t()&&(j(o,t(),!0),a.on_change?.(M(t())))});async function g(e){e.key==="Enter"&&(t(!t()),a.on_select?.({index:0,value:e.currentTarget.checked,selected:e.currentTarget.checked}))}async function T(e){t(e.currentTarget.checked),a.on_select?.({index:0,value:e.currentTarget.checked,selected:e.currentTarget.checked}),a.on_input?.()}var n=H();let u;var s=h(n);R(s);var w=z(s,2);{var C=e=>{var c=G(),E=h(c,!0);v(c),b(()=>B(E,y())),f(e,c)};O(w,e=>{p()&&e(C)})}v(n),b(()=>{u=Q(n,1,"checkbox-container svelte-1fynlvy",null,u,{disabled:r(d)}),s.disabled=r(d)}),D(s,t),F("indeterminate","change",s,i,i),_("keydown",s,g),_("input",s,T),f(k,n),q()}export{N as C}; +import{p as l,m as M,i as O,b as Q,v as R}from"./i18n-DtG3MAQ1.js";import{M as S,aa as U,ab as X,ac as Z,Z as r,$ as j,t as b,U as _,a as f,O as q,Q as h,S as z,R as m,a2 as A,T as v,X as B}from"./index-BeNBoC9J.js";import{a as D}from"./input-BLFxNjIx.js";import{b as F}from"./universal-DqSjxxHG.js";var G=m(' '),H=m('');function N(k,a){S(a,!0);let y=l(a,"label",3,"Checkbox"),t=l(a,"value",15),i=l(a,"indeterminate",7,!1),x=l(a,"interactive",3,!0),p=l(a,"show_label",3,!0),d=A(()=>!x()),o=U(X(t()));Z(()=>{r(o)!==t()&&(j(o,t(),!0),a.on_change?.(M(t())))});async function g(e){e.key==="Enter"&&(t(!t()),a.on_select?.({index:0,value:e.currentTarget.checked,selected:e.currentTarget.checked}))}async function T(e){t(e.currentTarget.checked),a.on_select?.({index:0,value:e.currentTarget.checked,selected:e.currentTarget.checked}),a.on_input?.()}var n=H();let u;var s=h(n);R(s);var w=z(s,2);{var C=e=>{var c=G(),E=h(c,!0);v(c),b(()=>B(E,y())),f(e,c)};O(w,e=>{p()&&e(C)})}v(n),b(()=>{u=Q(n,1,"checkbox-container svelte-1fynlvy",null,u,{disabled:r(d)}),s.disabled=r(d)}),D(s,t),F("indeterminate","change",s,i,i),_("keydown",s,g),_("input",s,T),f(k,n),q()}export{N as C}; diff --git a/assets/Clear-BR8cTgGu.js b/assets/Clear-BiKSVifk.js similarity index 81% rename from assets/Clear-BR8cTgGu.js rename to assets/Clear-BiKSVifk.js index 5548d922341f553c7c44b09e81b42f4260b2c454..a6a873ded2c3b5b370ff512e0f91f30954d9c7a3 100644 --- a/assets/Clear-BR8cTgGu.js +++ b/assets/Clear-BiKSVifk.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as o,f as t}from"./index-DydPgVMC.js";var l=t('');function i(e){var r=l();o(e,r)}export{i as C}; +import"./i18n-DtG3MAQ1.js";import{a as o,f as t}from"./index-BeNBoC9J.js";var l=t('');function i(e){var r=l();o(e,r)}export{i as C}; diff --git a/assets/Code-D1inKIZZ.js b/assets/Code-B0D7Zxt1.js similarity index 65% rename from assets/Code-D1inKIZZ.js rename to assets/Code-B0D7Zxt1.js index b39255c8e9a5b4718556cc565e2dada5761f4e1e..a5095229adc159938b4654ef5299283933f5424e 100644 --- a/assets/Code-D1inKIZZ.js +++ b/assets/Code-B0D7Zxt1.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as r,f as t}from"./index-DydPgVMC.js";var a=t('');function s(l){var o=a();r(l,o)}export{s as C}; +import"./i18n-DtG3MAQ1.js";import{a as r,f as t}from"./index-BeNBoC9J.js";var a=t('');function s(l){var o=a();r(l,o)}export{s as C}; diff --git a/assets/Code-Bhm2YgEI.js b/assets/Code-D0Kw4ylG.js similarity index 99% rename from assets/Code-Bhm2YgEI.js rename to assets/Code-D0Kw4ylG.js index be771501e855bf6445d05f6b96ae36ea1582981c..bb8ad6e7d87931c84fd8eda9de7ab778df9a90f4 100644 --- a/assets/Code-Bhm2YgEI.js +++ b/assets/Code-D0Kw4ylG.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-5qCM2tFq.js","./index-CBtYSz1X.js","./i18n-CPHyzK9b.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./index-XumPGXes.js","./index-Bmu7HJDW.js","./index-D-RUc-cS.js","./index-eP3_EJ4x.js","./frontmatter-FN0veR8a.js","./yaml-DsCXHVTH.js","./index-BhQi-Oea.js"])))=>i.map(i=>d[i]); -import{p as Ee,d as gf,b as bf}from"./i18n-CPHyzK9b.js";import{af as se,M as yf,ac as us,Z as To,a7 as xf,t as wf,a as kf,O as vf,aa as Sf,$ as Cf,Q as Af,R as Mf,T as Tf}from"./index-DydPgVMC.js";let js=[],Ma=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(n=Ma[i])e=i+1;else return!0;if(e==t)return!1}}function Do(n){return n>=127462&&n<=127487}const Oo=8205;function Of(n,e,t=!0,i=!0){return(t?Ta:Bf)(n,e,i)}function Ta(n,e,t){if(e==n.length)return e;e&&Da(n.charCodeAt(e))&&Oa(n.charCodeAt(e-1))&&e--;let i=ds(n,e);for(e+=Bo(i);e=0&&Do(ds(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Bf(n,e,t){for(;e>0;){let i=Ta(n,e-2,t);if(i=56320&&n<57344}function Oa(n){return n>=55296&&n<56320}function Bo(n){return n<65536?1:2}class z{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=ii(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),tt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ii(this,e,t);let i=[];return this.decompose(e,t,i,0),tt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ci(this),r=new Ci(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ci(this,e)}iterRange(e,t=this.length){return new Ba(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new La(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):tt.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Lf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Ef(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(Lo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Tn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let a=l.length>>1;i.push(new Q(l.slice(0,a)),new Q(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);[e,t]=ii(this,e,t);let s=Tn(this.text,Tn(i.text,Lo(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):tt.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Da12lcVQ.js","./index-BM8994Qr.js","./i18n-DtG3MAQ1.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./index-CMkuetrL.js","./index-CT3x8rMt.js","./index-1sy099a6.js","./index-DUkLrOoz.js","./frontmatter-DFhL0tR6.js","./yaml-DsCXHVTH.js","./index-CS53mDTO.js"])))=>i.map(i=>d[i]); +import{p as Ee,d as gf,b as bf}from"./i18n-DtG3MAQ1.js";import{af as se,M as yf,ac as us,Z as To,a7 as xf,t as wf,a as kf,O as vf,aa as Sf,$ as Cf,Q as Af,R as Mf,T as Tf}from"./index-BeNBoC9J.js";let js=[],Ma=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(n=Ma[i])e=i+1;else return!0;if(e==t)return!1}}function Do(n){return n>=127462&&n<=127487}const Oo=8205;function Of(n,e,t=!0,i=!0){return(t?Ta:Bf)(n,e,i)}function Ta(n,e,t){if(e==n.length)return e;e&&Da(n.charCodeAt(e))&&Oa(n.charCodeAt(e-1))&&e--;let i=ds(n,e);for(e+=Bo(i);e=0&&Do(ds(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Bf(n,e,t){for(;e>0;){let i=Ta(n,e-2,t);if(i=56320&&n<57344}function Oa(n){return n>=55296&&n<56320}function Bo(n){return n<65536?1:2}class z{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=ii(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),tt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ii(this,e,t);let i=[];return this.decompose(e,t,i,0),tt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ci(this),r=new Ci(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ci(this,e)}iterRange(e,t=this.length){return new Ba(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new La(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):tt.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Lf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Ef(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(Lo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Tn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let a=l.length>>1;i.push(new Q(l.slice(0,a)),new Q(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);[e,t]=ii(this,e,t);let s=Tn(this.text,Tn(i.text,Lo(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):tt.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=` `){[e,t]=ii(this,e,t);let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new Q(i,s)),i=[],s=-1);return s>-1&&t.push(new Q(i,s)),t}}class tt extends z{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=ii(this,e,t),i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new tt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){[e,t]=ii(this,e,t);let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof tt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new Q(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof tt)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof Q&&a&&(p=c[c.length-1])instanceof Q&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new Q(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:tt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new tt(l,t)}}z.empty=new Q([""],0);function Lf(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Tn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof Q?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof Q?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof Q){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Q?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ba{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Ci(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class La{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},Ci.prototype[Symbol.iterator]=Ba.prototype[Symbol.iterator]=La.prototype[Symbol.iterator]=function(){return this});class Ef{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function ii(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function ce(n,e,t=!0,i=!0){return Of(n,e,t,i)}function Pf(n){return n>=56320&&n<57344}function Rf(n){return n>=55296&&n<56320}function Be(n,e){let t=n.charCodeAt(e);if(!Rf(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Pf(i)?(t-55296<<10)+(i-56320)+65536:t}function Ea(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function lt(n){return n<65536?1:2}const Us=/\r\n?|\n/;var he=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(he||(he={}));class ot{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ot(e)}static create(e){return new ot(e)}}class ie extends ot{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gs(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Js(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&bt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?z.of(d.split(i||Us)):d:z.empty,m=p.length;if(f==u&&m==0)return;fo&&pe(s,f-o,-1),pe(s,u-f,m),bt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new ie(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function bt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function Js(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Ei(n),l=new Ei(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);pe(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Ei{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?z.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?z.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Pt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Pt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(e.anchor,e.head)}static create(e,t,i){return new Pt(e,t,i)}}class x{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:x.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new x(e.ranges.map(t=>Pt.fromJSON(t)),e.main)}static single(e,t=e){return new x([x.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?x.range(a,l):x.range(l,a))}}return new x(e,t)}}function Ra(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Vr=0;class O{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Vr++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new O(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:zr),!!e.static,e.enables)}of(e){return new Dn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function zr(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Dn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Vr++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Ys(f,c)){let d=i(f);if(l?!Eo(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=Rn(u,p);if(this.dependencies.every(b=>b instanceof O?u.facet(b)===f.facet(b):b instanceof Te?u.field(b,!1)==f.field(b,!1):!0)||(l?Eo(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Eo(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(nn).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(nn),o=s.facet(nn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,nn.of({field:this,create:e})]}get extension(){return this}}const Lt={lowest:4,low:3,default:2,high:1,highest:0};function pi(n){return e=>new Ia(e,n)}const qt={highest:pi(Lt.highest),high:pi(Lt.high),default:pi(Lt.default),low:pi(Lt.low),lowest:pi(Lt.lowest)};class Ia{constructor(e,t){this.inner=e,this.prec=t}}class Xn{of(e){return new Xs(this,e)}reconfigure(e){return Xn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Xs{constructor(e,t){this.compartment=e,this.inner=t}}class Pn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Nf(e,t,o))u instanceof Te?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,zr(m,d))a.push(i.facet(p));else{let b=p.combine(d.map(y=>y.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=h.length<<1,h.push(y=>b.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(b=>If(b,p,d))}}let f=h.map(u=>u(l));return new Pn(e,o,f,l,a,r)}}function Nf(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Xs&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Xs){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Ia)r(o.inner,o.prec);else if(o instanceof Te)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Dn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Lt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Lt.default),i.reduce((o,l)=>o.concat(l))}function Ai(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Rn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Na=O.define(),Qs=O.define({combine:n=>n.some(e=>e),static:!0}),Fa=O.define({combine:n=>n.length?n[0]:void 0,static:!0}),Wa=O.define(),Ha=O.define(),Va=O.define(),za=O.define({combine:n=>n.length?n[0]:!1});class ut{constructor(e,t){this.type=e,this.value=t}static define(){return new Ff}}class Ff{of(e){return new ut(this,e)}}class Wf{constructor(e){this.map=e}of(e){return new R(this,e)}}class R{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new R(this.type,t)}is(e){return this.type==e}static define(e={}){return new Wf(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}R.reconfigure=R.define();R.appendConfig=R.define();class Z{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Ra(i,t.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(e,t,i,s,r,o){return new Z(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Z.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Z.time=ut.define();Z.userEvent=ut.define();Z.addToHistory=ut.define();Z.remote=ut.define();function Hf(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=qa(e,Yt(r),!1)}return n}function zf(n){let e=n.startState,t=e.facet(Va),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=_a(i,Zs(e,r,n.changes.newLength),!0))}return i==n?n:Z.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const _f=[];function Yt(n){return n==null?_f:Array.isArray(n)?n:[n]}var Ie=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Ie||(Ie={}));const qf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let er;try{er=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Kf(n){if(er)return er.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||qf.test(t)))return!0}return!1}function $f(n){return e=>{if(!/\S/.test(e))return Ie.Space;if(Kf(e))return Ie.Word;for(let t=0;t-1)return Ie.Word;return Ie.Other}}class V{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(R.reconfigure)?(t=null,i=l.value):l.is(R.appendConfig)&&(t=null,i=Yt(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=Pn.resolve(i,s,this),r=new V(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Qs)?e.newSelection:e.newSelection.asSingle();new V(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Yt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return V.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Pn.resolve(e.extensions||[],new Map),i=e.doc instanceof z?e.doc:z.of((e.doc||"").split(t.staticFacet(V.lineSeparator)||Us)),s=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return Ra(s,i.length),t.staticFacet(Qs)||(s=s.asSingle()),new V(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(V.tabSize)}get lineBreak(){return this.facet(V.lineSeparator)||` @@ -11,4 +11,4 @@ import{p as Ee,d as gf,b as bf}from"./i18n-CPHyzK9b.js";import{af as se,M as yf, `))};if((T.mac||T.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:z.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Qr(e,f,x.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=ni(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(h)){s=this.pendingContextChange=null,t+=c,this.to+=c;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class D{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||ru(e.parent)||document,this.viewState=new ll(e.state||V.create(e)),e.scrollTo&&e.scrollTo.is(on)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(jt).map(s=>new bs(s));for(let s of this.plugins)s.update(this);this.observer=new Td(this),this.inputState=new Yu(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Uo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Z?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Lh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Eh(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(V.phrases)!=this.state.facet(V.phrases))return this.setState(r);s=Fn.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Zt(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(on)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=_n.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ki)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(un)!=s.state.facet(un)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(mr))try{u(s)}catch(d){Ae(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Ch(this,c)&&h.force&&Qt(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new ll(e),this.plugins=e.facet(jt).map(i=>new bs(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Uo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(jt),i=e.state.facet(jt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new bs(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Xa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ae(this.state,p),ul}}),f=Fn.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(mr))l(t)}get themeClasses(){return kr+" "+(this.state.facet(wr)?Nh:Ih)+" "+this.state.facet(un)}updateAttrs(){let e=dl(this,mh,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(at)?"true":"false",class:"cm-content",style:`${T.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),dl(this,Jr,t);let i=this.observer.ignore(()=>{let s=zo(this.contentDOM,this.contentAttrs,t),r=zo(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(D.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ki);let e=this.state.facet(D.cspNonce);kt.mount(this.root,this.styleModules.concat(Ad).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return ks(this,e,Go(this,e,t,i))}moveByGroup(e,t){return ks(this,e,Go(this,e,t,i=>zu(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return x.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return Vu(this,e,t,i)}moveVertically(e,t,i){return ks(this,e,_u(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=yr(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),yr(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ht.find(r,e-s.from,-1,t)];return Ni(i,o.dir==G.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(fh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Bd)return nh(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ih(r.isolates,i=Ko(this,e))))return r.order;i||(i=Ko(this,e));let s=du(e.text,t,i);return this.bidiCache.push(new _n(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||T.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ya(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return on.of(new Zt(typeof e=="number"?x.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return on.of(new Zt(x.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ue.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ue.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=kt.newName(),s=[un.of(i),ki.of(vr(`.${i}`,e))];return t&&t.dark&&s.push(wr.of(!0)),s}static baseTheme(e){return qt.lowest(ki.of(vr("."+kr,e,Fh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&te.get(i)||te.get(e);return((t=s?.root)===null||t===void 0?void 0:t.view)||null}}D.styleModule=ki;D.inputHandler=hh;D.clipboardInputFilter=Ur;D.clipboardOutputFilter=Gr;D.scrollHandler=dh;D.focusChangeEffect=ch;D.perLineTextDirection=fh;D.exceptionSink=ah;D.updateListener=mr;D.editable=at;D.mouseSelectionStyle=lh;D.dragMovesSelection=oh;D.clickAddsSelectionRange=rh;D.decorations=Zn;D.blockWrappers=gh;D.outerDecorations=Yr;D.atomicRanges=Yi;D.bidiIsolatedRanges=bh;D.scrollMargins=yh;D.darkTheme=wr;D.cspNonce=O.define({combine:n=>n.length?n[0]:""});D.contentAttributes=Jr;D.editorAttributes=mh;D.lineWrapping=D.contentAttributes.of({class:"cm-lineWrapping"});D.announce=R.define();const Bd=4096,ul={};class _n{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:G.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Kr(o,t)}return t}const Ld=T.mac?"mac":T.windows?"win":T.linux?"linux":"key";function Ed(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}let gt=null;const Id=4e3;function Nd(n,e=Ld){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Ed(y,e));for(let y=1;y{let M=gt={view:w,prefix:k,scope:o};return setTimeout(()=>{gt==M&&(gt=null)},Id),!0}]})}let m=p.join(" ");s(m,!1);let b=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&b.run.push(a),h&&(b.preventDefault=!0),c&&(b.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Sr))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Sr=null;function Fd(n,e,t,i){Sr=e;let s=Yf(e),r=Be(s,0),o=lt(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;gt&>.view==t&>.scope==i&&(l=gt.prefix+" ",Th.indexOf(e.keyCode)<0&&(h=!0,gt=null));let f=new Set,u=b=>{if(b){for(let y of b.run)if(!f.has(y)&&(f.add(y),y(t)))return b.stopPropagation&&(c=!0),!0;b.preventDefault&&(b.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+dn(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(T.windows&&e.ctrlKey&&e.altKey)&&!(T.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=vt[e.keyCode])&&p!=s?(u(d[l+dn(p,e,!0)])||e.shiftKey&&(m=Ri[e.keyCode])!=s&&m!=p&&u(d[l+dn(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+dn(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Sr=null,a}class Qi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Wh(e);return[new Qi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Wd(e,t,i)}}function Wh(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==G.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function ml(n,e,t,i){let s=n.coordsAtPos(e,t*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Wd(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==G.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Wh(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=br(n,i,1),p=br(n,s,-1),m=d.type==fe.Text?d:null,b=p.type==fe.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=ml(n,i,1,m)),b&&(n.lineWrapping||p.widgetLineBreaks)&&(b=ml(n,s,-1,b)),m&&b&&m.from==b.from&&m.to==b.to)return k(w(t.from,t.to,m));{let v=m?w(t.from,null,m):M(d,!1),C=b?w(null,t.to,b):M(p,!0),S=[];return(m||d).to<(b||p).from-(m&&b?1:0)||d.widgetLineBreaks>1&&v.bottom+n.defaultLineHeight/2B&&H.from<_)for(let K=Math.max(H.from,B),oe=Math.min(H.to,_);;){let be=n.state.doc.lineAt(K);for(let ve of n.bidiSpans(be)){let ee=ve.from+be.from,E=ve.to+be.from;if(ee>=oe)break;E>K&&P(Math.max(ee,K),v==null&&ee<=B,Math.min(E,oe),C==null&&E>=_,ve.dir)}if(K=be.to+1,K>=oe)break}return q.length==0&&P(B,v==null,_,C==null,n.textDirection),{top:L,bottom:F,horizontal:q}}function M(v,C){let S=l.top+(C?v.top:v.bottom);return{top:S,bottom:S,horizontal:[]}}}function Hd(n,e){return n.constructor==e.constructor&&n.eq(e)}class Vd{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Bn)!=e.state.facet(Bn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Bn);for(;t!Hd(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e,T.safari&&T.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Bn=O.define();function Hh(n){return[ue.define(e=>new Vd(e,n)),Bn.of(n)]}const Wi=O.define({combine(n){return Kt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function zd(n={}){return[Wi.of(n),_d,qd,Kd,uh.of(!0)]}function Vh(n){return n.startState.facet(Wi)!=n.state.facet(Wi)}const _d=Hh({above:!0,markers(n){let{state:e}=n,t=e.facet(Wi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:x.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Qi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Vh(n);return t&&gl(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){gl(e.state,n)},class:"cm-cursorLayer"});function gl(n,e){e.style.animationDuration=n.facet(Wi).cursorBlinkRate+"ms"}const qd=Hh({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Qi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Vh(n)},class:"cm-selectionLayer"}),Kd=qt.highest(D.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function bl(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function $d(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class jd{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new wt,i=t.add.bind(t);for(let{from:s,to:r}of $d(e,this.maxLength))bl(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),e.viewportMoved||s-i>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>=o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,b));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(b,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,b)=>mf,add:u})}}return t}}const Cr=/x/.unicode!=null?"gu":"g",Ud=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Cr),Gd={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Cs=null;function Jd(){var n;if(Cs==null&&typeof document<"u"&&document.body){let e=document.body.style;Cs=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Cs||!1}const Ln=O.define({combine(n){let e=Kt(n,{render:null,specialChars:Ud,addSpecialChars:null});return(e.replaceTabs=!Jd())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Cr)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Cr)),e}});function Yd(n={}){return[Ln.of(n),Xd()]}let yl=null;function Xd(){return yl||(yl=ue.fromClass(class{constructor(n){this.view=n,this.decorations=I.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ln)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new jd({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=Be(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=ci(o.text,l,i-o.from);return I.replace({widget:new tp((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=I.replace({widget:new ep(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ln);n.startState.facet(Ln)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Qd="•";function Zd(n){return n>=32?Qd:n==10?"␤":String.fromCharCode(9216+n)}class ep extends Ue{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Zd(this.code),i=e.state.phrase("Control character")+" "+(Gd[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class tp extends Ue{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class ip extends Ue{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Ti(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Ni(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function np(n){let e=ue.fromClass(class{constructor(t){this.view=t,this.placeholder=n?I.set([I.widget({widget:new ip(n),side:1}).range(0)]):I.none}get decorations(){return this.view.state.doc.length?I.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,D.contentAttributes.of({"aria-placeholder":n})]:e}const Ar=2e3;function sp(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Ar||t.off>Ar||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(x.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=sr(h.text,o,n.tabSize,!0);if(c<0)r.push(x.cursor(h.to));else{let f=sr(h.text,l,n.tabSize);r.push(x.range(h.from+c,h.from+f))}}}return r}function rp(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function xl(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Ar?-1:s==i.length?rp(n,e.clientX):ci(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function op(n,e){let t=xl(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=xl(n,s);if(!l)return i;let a=sp(n.state,t,l);return a.length?o?x.create(a.concat(i.ranges)):x.create(a):i}}:null}function lp(n){let e=(t=>t.altKey&&t.button==0);return D.mouseSelectionStyle.of((t,i)=>e(i)?op(t,i):null)}const ap={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},hp={style:"cursor: crosshair"};function cp(n={}){let[e,t]=ap[n.key||"Alt"],i=ue.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,D.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?hp:null})]}const pn="-10000px";class zh{constructor(e,t,i,s){this.facet=t,this.createTooltipView=i,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function fp(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const As=O.define({combine:n=>{var e,t,i;return{position:T.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||fp}}}),wl=new WeakMap,to=ue.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(As);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new zh(n,io,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(As);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=pn,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(T.safari){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=Xr(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(As).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1)){c.style.top=pn;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,b=(e=wl.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||dp,k=this.view.textDirection==G.LTR,w=u.width>i.right-i.left?k?i.left:i.right-u.width:k?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,f.left-m+(d?14:0)-y.x),i.right-m),M=this.above[l];!a.strictSide&&(M?f.top-b-p-y.yi.bottom)&&M==i.bottom-f.bottom>f.top-i.top&&(M=this.above[l]=!M);let v=(M?f.top-i.top:i.bottom-f.bottom)-p;if(vw&&L.topC&&(C=M?L.top-b-2-p:L.bottom+p+2);if(this.position=="absolute"?(c.style.top=(C-n.parent.top)/r+"px",kl(c,(w-n.parent.left)/s)):(c.style.top=C/r+"px",kl(c,w/s)),d){let L=f.left+(k?y.x:-y.x)-(w+14-7);d.style.left=L/s+"px"}h.overlap!==!0&&o.push({left:w,top:C,right:S,bottom:C+b}),c.classList.toggle("cm-tooltip-above",M),c.classList.toggle("cm-tooltip-below",!M),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=pn}},{eventObservers:{scroll(){this.maybeMeasure()}}});function kl(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const up=D.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),dp={x:0,y:0},io=O.define({enables:[to,up]}),qn=O.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class ns{static create(e){return new ns(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new zh(e,qn,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let s=i[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const pp=io.compute([qn],n=>{let e=n.facet(qn);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:ns.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class mp{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(c=>c.from<=s&&c.to>=s),h=a&&a.dir==G.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Ae(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(to),t=e?e.manager.tooltips.findIndex(i=>i.create==ns.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!gp(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!bp(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const mn=4;function gp(n,e){let{left:t,right:i,top:s,bottom:r}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-mn&&e.clientX<=i+mn&&e.clientY>=s-mn&&e.clientY<=r+mn}function bp(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rights||Math.min(o.bottom,l)=e&&a<=t}function yp(n,e={}){let t=R.define(),i=Te.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,he.TrackDel);if(a!=null){let h=Object.assign(Object.create(null),l);h.pos=a,h.end!=null&&(h.end=r.changes.mapPos(h.end)),o.push(h)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(xp)&&(s=[]);return s},provide:s=>qn.from(s)});return{active:i,extension:[i,ue.define(s=>new mp(s,n,i,t,e.hoverTime||300)),pp]}}function _h(n,e){let t=n.plugin(to);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const xp=R.define(),vl=O.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function wp(n,e){let t=n.plugin(qh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const qh=ue.fromClass(class{constructor(n){this.input=n.state.facet(Mr),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(vl);this.top=new gn(n,!0,e.topContainer),this.bottom=new gn(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(vl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new gn(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new gn(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Mr);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>D.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class gn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Sl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Sl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Sl(n){let e=n.nextSibling;return n.remove(),e}const Mr=O.define({enables:qh});class Ct extends xt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ct.prototype.elementClass="";Ct.prototype.toDOM=void 0;Ct.prototype.mapMode=he.TrackBefore;Ct.prototype.startSide=Ct.prototype.endSide=-1;Ct.prototype.point=!0;const Ms=O.define(),kp=O.define(),vp={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>W.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Bi=O.define();function Sp(n){return[Kh(),Bi.of({...vp,...n})]}const Cl=O.define({combine:n=>n.some(e=>e)});function Kh(n){return[Cp]}const Cp=ue.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Bi).map(e=>new Ml(n,e)),this.fixed=!n.state.facet(Cl);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Cl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=W.iter(this.view.state.facet(Ms),this.view.viewport.from),i=[],s=this.gutters.map(r=>new Ap(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==fe.Text&&o){Tr(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==fe.Text){Tr(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(Bi),t=n.state.facet(Bi),i=n.docChanged||n.heightChanged||n.viewportChanged||!W.eq(n.startState.facet(Ms),n.state.facet(Ms),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Ml(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>D.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==G.LTR?{left:i,right:s}:{right:i,left:s}})});function Al(n){return Array.isArray(n)?n:[n]}function Tr(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class Ap{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=W.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new $h(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Tr(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),s=i?[i]:null;for(let r of e.state.facet(kp)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ml{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=Al(t.markers(e)),t.initialSpacer&&(this.spacer=new $h(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Al(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!W.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class $h{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Mp(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class Ts extends Ct{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Ds(n,e){return n.state.facet(Ut).formatNumber(e,n.state)}const Op=Bi.compute([Ut],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Tp)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new Ts(Ds(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let s of e.state.facet(Dp)){let r=s(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Ut)!=e.state.facet(Ut),initialSpacer(e){return new Ts(Ds(e,Tl(e.state.doc.lines)))},updateSpacer(e,t){let i=Ds(t.view,Tl(t.view.state.doc.lines));return i==e.number?e:new Ts(i)},domEventHandlers:n.facet(Ut).domEventHandlers,side:"before"}));function Bp(n={}){return[Ut.of(n),Kh(),Op]}function Tl(n){let e=9;for(;e{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ke.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}N.closedBy=new N({deserialize:n=>n.split(" ")});N.openedBy=new N({deserialize:n=>n.split(" ")});N.group=new N({deserialize:n=>n.split(" ")});N.isolate=new N({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});N.contextHash=new N({perNode:!0});N.lookAhead=new N({perNode:!0});N.mounted=new N({perNode:!0});class ei{constructor(e,t,i,s=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=s}static get(e){return e&&e.props&&e.props[N.mounted.id]}}const Pp=Object.create(null);class ke{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Pp,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ke(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(N.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(N.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ke.none=new ke("",Object.create(null),0,8);class no{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|U.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:oo(ke.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new J(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new J(ke.none,t,i,s)))}static build(e){return Fp(e)}}J.empty=new J(ke.none,[],[],0);class so{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new so(this.buffer,this.index)}}class At{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ke.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Hi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?a.length:-1;e!=c;e+=t){let f=a[e],u=h[e]+l.from;if(!(!(r&U.EnterBracketed&&f instanceof J&&((o=ei.get(f))===null||o===void 0?void 0:o.overlay)===null&&(u>=i||u+f.length<=i))&&!jh(s,i,u,u+f.length))){if(f instanceof At){if(r&U.ExcludeBuffers)continue;let d=f.findChild(0,f.buffer.length,t,i-u,s);if(d>-1)return new st(new Rp(l,f,e,u),null,d)}else if(r&U.IncludeAnonymous||!f.type.isAnonymous||ro(f)){let d;if(!(r&U.IgnoreMounts)&&(d=ei.get(f))&&!d.overlay)return new me(d.tree,u,e,l);let p=new me(f,u,e,l);return r&U.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?f.children.length-1:0,t,i,s,r)}}}if(r&U.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let s;if(!(i&U.IgnoreOverlays)&&(s=ei.get(this._tree))&&s.overlay){let r=e-this.from,o=i&U.EnterBracketed&&s.bracketed;for(let{from:l,to:a}of s.overlay)if((t>0||o?l<=r:l=r:a>r))return new me(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Ol(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Dr(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Rp{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class st extends Uh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new st(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&U.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new st(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new st(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new st(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new J(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Gh(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new me(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Hi(l,e,t,!1))}}return s?Gh(s):i}class Kn{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~U.EnterBracketed,e instanceof me)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof me?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&U.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&U.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&U.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&U.IncludeAnonymous||l instanceof At||!l.type.isAnonymous||ro(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return Dr(this._tree,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function ro(n){return n.children.some(e=>e instanceof At||!e.type.isAnonymous||ro(e))}function Fp(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Lp,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new so(t,t.length):t,a=i.types,h=0,c=0;function f(v,C,S,L,F,q){let{id:P,start:B,end:_,size:H}=l,K=c,oe=h;if(H<0)if(l.next(),H==-1){let X=r[P];S.push(X),L.push(B-v);return}else if(H==-3){h=P;return}else if(H==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${H}`);let be=a[P],ve,ee,E=B-v;if(_-B<=s&&(ee=b(l.pos-C,F))){let X=new Uint16Array(ee.size-ee.skip),$=l.pos-ee.size,ne=X.length;for(;l.pos>$;)ne=y(ee.start,X,ne);ve=new At(X,_-ee.start,i),E=ee.start-v}else{let X=l.pos-H;l.next();let $=[],ne=[],De=P>=o?P:-1,dt=0,ye=_;for(;l.pos>X;)De>=0&&l.id==De&&l.size>=0?(l.end<=ye-s&&(p($,ne,B,dt,l.end,ye,De,K,oe),dt=$.length,ye=l.end),l.next()):q>2500?u(B,X,$,ne):f(B,X,$,ne,De,q+1);if(De>=0&&dt>0&&dt<$.length&&p($,ne,B,dt,B,ye,De,K,oe),$.reverse(),ne.reverse(),De>-1&&dt>0){let Mo=d(be,oe);ve=oo(be,$,ne,0,$.length,0,_-B,Mo,Mo)}else ve=m(be,$,ne,_-B,K-_,oe)}S.push(ve),L.push(E)}function u(v,C,S,L){let F=[],q=0,P=-1;for(;l.pos>C;){let{id:B,start:_,end:H,size:K}=l;if(K>4)l.next();else{if(P>-1&&_=0;H-=3)B[K++]=F[H],B[K++]=F[H+1]-_,B[K++]=F[H+2]-_,B[K++]=K;S.push(new At(B,F[2]-_,i)),L.push(_-v)}}function d(v,C){return(S,L,F)=>{let q=0,P=S.length-1,B,_;if(P>=0&&(B=S[P])instanceof J){if(!P&&B.type==v&&B.length==F)return B;(_=B.prop(N.lookAhead))&&(q=L[P]+B.length+_)}return m(v,S,L,F,q,C)}}function p(v,C,S,L,F,q,P,B,_){let H=[],K=[];for(;v.length>L;)H.push(v.pop()),K.push(C.pop()+S-F);v.push(m(i.types[P],H,K,q-F,B-q,_)),C.push(F-S)}function m(v,C,S,L,F,q,P){if(q){let B=[N.contextHash,q];P=P?[B].concat(P):[B]}if(F>25){let B=[N.lookAhead,F];P=P?[B].concat(P):[B]}return new J(v,C,S,L,P)}function b(v,C){let S=l.fork(),L=0,F=0,q=0,P=S.end-s,B={size:0,start:0,skip:0};e:for(let _=S.pos-v;S.pos>_;){let H=S.size;if(S.id==C&&H>=0){B.size=L,B.start=F,B.skip=q,q+=4,L+=4,S.next();continue}let K=S.pos-H;if(H<0||K<_||S.start=o?4:0,be=S.start;for(S.next();S.pos>K;){if(S.size<0)if(S.size==-3||S.size==-4)oe+=4;else break e;else S.id>=o&&(oe+=4);S.next()}F=be,L+=H,q+=oe}return(C<0||L==v)&&(B.size=L,B.start=F,B.skip=q),B.size>4?B:void 0}function y(v,C,S){let{id:L,start:F,end:q,size:P}=l;if(l.next(),P>=0&&L4){let _=l.pos-(P-4);for(;l.pos>_;)S=y(v,C,S)}C[--S]=B,C[--S]=q-v,C[--S]=F-v,C[--S]=L}else P==-3?h=L:P==-4&&(c=L);return S}let k=[],w=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,k,w,-1,0);let M=(e=n.length)!==null&&e!==void 0?e:k.length?w[0]+k[0].length:0;return new J(a[n.topID],k.reverse(),w.reverse(),M)}const Bl=new WeakMap;function En(n,e){if(!n.isAnonymous||e instanceof At||e.type!=n)return 1;let t=Bl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof J)){t=1;break}t+=En(n,i)}Bl.set(e,t)}return t}function oo(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;C+=S}if(w==M+1){if(C>c){let S=p[M];d(S.children,S.positions,0,S.children.length,m[M]+k);continue}f.push(p[M])}else{let S=m[w-1]+p[w-1].length-v;f.push(oo(n,p,m,M,w,v,S,null,a))}u.push(v+k-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Ib{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof st?this.setBuffer(e.context.buffer,e.index,t):e instanceof me&&this.map.set(e.tree,t)}get(e){return e instanceof st?this.getBuffer(e.context.buffer,e.index):e instanceof me?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ct{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new ct(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new ct(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Fe(s.from,s.to)):[new Fe(0,0)]:[new Fe(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Wp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Nb(n){return(e,t,i,s)=>new Vp(e,n,t,i,s)}class Ll{constructor(e,t,i,s,r,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=s,this.target=r,this.from=o}}function El(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class Hp{constructor(e,t,i,s,r,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Or=new N({perNode:!0});class Vp{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new J(i.type,i.children,i.positions,i.length,i.propValues.concat([[Or,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[N.mounted.id]=new ei(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(t){let h=t.mounts.find(c=>c.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=zp(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew Fe(f.from-s.from,f.to-s.from)):null,!!r.bracketed,s.tree,c.length?c[0].from:s.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(s))&&(a===!0&&(a=new Fe(s.from,s.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&s.firstChild())t&&t.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let h=Il(this.ranges,t.ranges);h.length&&(El(h),this.inner.splice(t.index,0,new Ll(t.parser,t.parser.startParse(this.input,Nl(t.mounts,h),h),t.ranges.map(c=>new Fe(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function zp(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Pl(n,e,t,i,s,r){if(e=e&&t.enter(i,1,U.IgnoreOverlays|U.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof J)t=t.children[0];else break}return!1}}class qp{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Or))!==null&&t!==void 0?t:i.to,this.inner=new Rl(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Or))!==null&&e!==void 0?e:t.to,this.inner=new Rl(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(N.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Il(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Fe(l,a.to))):a.to>l?t[r--]=new Fe(l,a.to):t.splice(r--,1))}}return i}function Kp(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Fe(u.from+i,u.to+i)),f=Kp(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new ct(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new ct(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let $p=0;class Re{constructor(e,t,i,s){this.name=e,this.set=t,this.base=i,this.modified=s,this.id=$p++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Re&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new Re(i,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new $n(e);return i=>i.modified.indexOf(t)>-1?i:$n.get(i.base||i,i.modified.concat(t).sort((s,r)=>s.id-r.id))}}let jp=0;class $n{constructor(e){this.name=e,this.instances=[],this.id=jp++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Up(t,l.modified));if(i)return i;let s=[],r=new Re(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=Gp(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push($n.get(l,a));return r}}function Up(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Gp(n){let e=[[]];for(let t=0;ti.length-t.length)}function Jp(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new Vi(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Yh.add(e)}const Yh=new N({combine(n,e){let t,i,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let r=new Vi(s.tags,s.mode,s.context);t?t.next=r:i=r,t=r}return i}});class Vi{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Yp(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Xp(n,e,t,i=0,s=n.length){let r=new Qp(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Qp{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Zp(e)||Vi.empty,f=Yp(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(N.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(b=>!b.scope||b.scope(u.tree.type)),m=e.firstChild();for(let b=0,y=l;;b++){let k=b=w||!e.nextSibling())););if(!k||w>i)break;y=k.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,k.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Zp(n){let e=n.type.prop(Yh);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const A=Re.define,yn=A(),pt=A(),Fl=A(pt),Wl=A(pt),mt=A(),xn=A(mt),Os=A(mt),Ze=A(),Dt=A(Ze),Xe=A(),Qe=A(),Br=A(),gi=A(Br),wn=A(),g={comment:yn,lineComment:A(yn),blockComment:A(yn),docComment:A(yn),name:pt,variableName:A(pt),typeName:Fl,tagName:A(Fl),propertyName:Wl,attributeName:A(Wl),className:A(pt),labelName:A(pt),namespace:A(pt),macroName:A(pt),literal:mt,string:xn,docString:A(xn),character:A(xn),attributeValue:A(xn),number:Os,integer:A(Os),float:A(Os),bool:A(mt),regexp:A(mt),escape:A(mt),color:A(mt),url:A(mt),keyword:Xe,self:A(Xe),null:A(Xe),atom:A(Xe),unit:A(Xe),modifier:A(Xe),operatorKeyword:A(Xe),controlKeyword:A(Xe),definitionKeyword:A(Xe),moduleKeyword:A(Xe),operator:Qe,derefOperator:A(Qe),arithmeticOperator:A(Qe),logicOperator:A(Qe),bitwiseOperator:A(Qe),compareOperator:A(Qe),updateOperator:A(Qe),definitionOperator:A(Qe),typeOperator:A(Qe),controlOperator:A(Qe),punctuation:Br,separator:A(Br),bracket:gi,angleBracket:A(gi),squareBracket:A(gi),paren:A(gi),brace:A(gi),content:Ze,heading:Dt,heading1:A(Dt),heading2:A(Dt),heading3:A(Dt),heading4:A(Dt),heading5:A(Dt),heading6:A(Dt),contentSeparator:A(Ze),list:A(Ze),quote:A(Ze),emphasis:A(Ze),strong:A(Ze),link:A(Ze),monospace:A(Ze),strikethrough:A(Ze),inserted:A(),deleted:A(),changed:A(),invalid:A(),meta:wn,documentMeta:A(wn),annotation:A(wn),processingInstruction:A(wn),definition:Re.defineModifier("definition"),constant:Re.defineModifier("constant"),function:Re.defineModifier("function"),standard:Re.defineModifier("standard"),local:Re.defineModifier("local"),special:Re.defineModifier("special")};for(let n in g){let e=g[n];e instanceof Re&&(e.name=n)}Xh([{tag:g.link,class:"tok-link"},{tag:g.heading,class:"tok-heading"},{tag:g.emphasis,class:"tok-emphasis"},{tag:g.strong,class:"tok-strong"},{tag:g.keyword,class:"tok-keyword"},{tag:g.atom,class:"tok-atom"},{tag:g.bool,class:"tok-bool"},{tag:g.url,class:"tok-url"},{tag:g.labelName,class:"tok-labelName"},{tag:g.inserted,class:"tok-inserted"},{tag:g.deleted,class:"tok-deleted"},{tag:g.literal,class:"tok-literal"},{tag:g.string,class:"tok-string"},{tag:g.number,class:"tok-number"},{tag:[g.regexp,g.escape,g.special(g.string)],class:"tok-string2"},{tag:g.variableName,class:"tok-variableName"},{tag:g.local(g.variableName),class:"tok-variableName tok-local"},{tag:g.definition(g.variableName),class:"tok-variableName tok-definition"},{tag:g.special(g.variableName),class:"tok-variableName2"},{tag:g.definition(g.propertyName),class:"tok-propertyName tok-definition"},{tag:g.typeName,class:"tok-typeName"},{tag:g.namespace,class:"tok-namespace"},{tag:g.className,class:"tok-className"},{tag:g.macroName,class:"tok-macroName"},{tag:g.propertyName,class:"tok-propertyName"},{tag:g.operator,class:"tok-operator"},{tag:g.comment,class:"tok-comment"},{tag:g.meta,class:"tok-meta"},{tag:g.invalid,class:"tok-invalid"},{tag:g.punctuation,class:"tok-punctuation"}]);var Bs;const It=new N;function Qh(n){return O.define({combine:n?e=>e.concat(n):void 0})}const em=new N;class We{constructor(e,t,i=[],s=""){this.data=e,this.name=s,V.prototype.hasOwnProperty("tree")||Object.defineProperty(V.prototype,"tree",{get(){return de(this)}}),this.parser=t,this.extension=[Mt.of(this),V.languageData.of((r,o,l)=>{let a=Hl(r,o,l),h=a.type.prop(It);if(!h)return[];let c=r.facet(h),f=a.type.prop(em);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Hl(e,t,i).type.prop(It)==this.data}findRegions(e){let t=e.facet(Mt);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(It)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(N.mounted);if(l){if(l.tree.prop(It)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Lr(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function de(n){let e=n.field(We.state,!1);return e?e.tree:J.empty}class tm{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let bi=null;class li{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new li(e,t,[],J.empty,0,i,[],null)}startParse(){return this.parser.startParse(new tm(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=J.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ct.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=bi;bi=this;try{return e()}finally{bi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Vl(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=ct.applyChanges(i,a),s=J.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Vl(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Jh{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=bi;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new J(ke.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return bi}}function Vl(n,e,t){return ct.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class ai{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new ai(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=li.create(e.facet(Mt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new ai(i)}}We.state=Te.define({create:ai.init,update(n,e){for(let t of e.effects)if(t.is(We.setState))return t.value;return e.startState.facet(Mt)!=e.state.facet(Mt)?ai.init(e.state):n.apply(e)}});let Zh=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Zh=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Ls=typeof navigator<"u"&&(!((Bs=navigator.scheduling)===null||Bs===void 0)&&Bs.isInputPending)?()=>navigator.scheduling.isInputPending():null,im=ue.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(We.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(We.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Zh(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Ls&&Ls()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:We.setState.of(new ai(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ae(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Mt=O.define({combine(n){return n.length?n[0]:null},enables:n=>[We.state,im,D.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Wb{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class ec{constructor(e,t,i,s,r,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=s,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new ec(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let s of e)if(s.filename&&s.filename.test(t))return s;let i=/\.([^.]+)$/.exec(t);if(i){for(let s of e)if(s.extensions.indexOf(i[1])>-1)return s}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let s of e)if(s.alias.some(r=>r==t))return s;if(i)for(let s of e)for(let r of s.alias){let o=t.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+r.length])))return s}return null}}const nm=O.define(),ss=O.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function zt(n){let e=n.facet(ss);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function zi(n,e){let t="",i=n.tabSize,s=n.facet(ss)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?sm(n,t,e):null}class rs{constructor(e,t={}){this.state=e,this.options=t,this.unit=zt(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return ci(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const tc=new N;function sm(n,e,t){let i=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return ic(i,n,t)}function ic(n,e,t){for(let i=n;i;i=i.next){let s=om(i.node);if(s)return s(ao.create(e,t,i))}return 0}function rm(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function om(n){let e=n.type.prop(tc);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(N.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>nc(o,!0,1,void 0,r&&!rm(o)?s.from:void 0)}return n.parent==null?lm:null}function lm(){return 0}class ao extends rs{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new ao(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(am(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return ic(this.context.next,this.base,this.pos)}}function am(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function hm(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function Hb({closing:n,align:e=!0,units:t=1}){return i=>nc(i,e,t,n)}function nc(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?hm(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Vb=n=>n.baseIndent;function zb({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const cm=200;function fm(){return V.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+cm)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=lo(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=zi(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const um=O.define(),dm=new N;function _b(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function mm(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function jn(n,e,t){for(let i of n.facet(um)){let s=i(n,e,t);if(s)return s}return pm(n,e,t)}function sc(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const os=R.define({map:sc}),Zi=R.define({map:sc});function rc(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const _t=Te.define({create(){return I.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=zl(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(os)&&!gm(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(ac),s=i?I.replace({widget:new Sm(i(e.state,t.value))}):_l;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(Zi)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=zl(n,e.selection.main.head)),n},provide:n=>D.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{se&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(s,r)=>s>=t||r<=e}):n}function Un(n,e,t){var i;let s=null;return(i=n.field(_t,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function gm(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function oc(n,e){return n.field(_t,!1)?e:e.concat(R.appendConfig.of(hc()))}const bm=n=>{for(let e of rc(n)){let t=jn(n.state,e.from,e.to);if(t)return n.dispatch({effects:oc(n.state,[os.of(t),lc(n,t)])}),!0}return!1},ym=n=>{if(!n.state.field(_t,!1))return!1;let e=[];for(let t of rc(n)){let i=Un(n.state,t.from,t.to);i&&e.push(Zi.of(i),lc(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function lc(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return D.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const xm=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(_t,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(Zi.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},km=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:bm},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ym},{key:"Ctrl-Alt-[",run:xm},{key:"Ctrl-Alt-]",run:wm}],vm={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ac=O.define({combine(n){return Kt(n,vm)}});function hc(n){return[_t,Mm]}function cc(n,e){let{state:t}=n,i=t.facet(ac),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=Un(n.state,l.from,l.to);a&&n.dispatch({effects:Zi.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const _l=I.replace({widget:new class extends Ue{toDOM(n){return cc(n,null)}}});class Sm extends Ue{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return cc(e,this.value)}}const Cm={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Es extends Ct{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Am(n={}){let e={...Cm,...n},t=new Es(e,!0),i=new Es(e,!1),s=ue.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Mt)!=o.state.facet(Mt)||o.startState.field(_t,!1)!=o.state.field(_t,!1)||de(o.startState)!=de(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new wt;for(let a of o.viewportLineBlocks){let h=Un(o.state,a.from,a.to)?i:jn(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,Sp({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||W.empty},initialSpacer(){return new Es(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=Un(o.state,l.from,l.to);if(h)return o.dispatch({effects:Zi.of(h)}),!0;let c=jn(o.state,l.from,l.to);return c?(o.dispatch({effects:os.of(c)}),!0):!1}}}),hc()]}const Mm=D.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class fi{constructor(e,t){this.specs=e;let i;function s(l){let a=kt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof We?l=>l.prop(It)==o.data:o?l=>l==o:void 0,this.style=Xh(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new kt(i):null,this.themeType=t.themeType}static define(e,t){return new fi(e,t||{})}}const Er=O.define(),fc=O.define({combine(n){return n.length?[n[0]]:null}});function Ps(n){let e=n.facet(Er);return e.length?e:n.facet(fc)}function ho(n,e){let t=[Dm],i;return n instanceof fi&&(n.module&&t.push(D.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(fc.of(n)):i?t.push(Er.computeN([D.darkTheme],s=>s.facet(D.darkTheme)==(i=="dark")?[n]:[])):t.push(Er.of(n)),t}class Tm{constructor(e){this.markCache=Object.create(null),this.tree=de(e.state),this.decorations=this.buildDeco(e,Ps(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=de(e.state),i=Ps(e.state),s=i!=Ps(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return I.none;let i=new wt;for(let{from:s,to:r}of e.visibleRanges)Xp(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=I.mark({class:a})))},s,r);return i.finish()}}const Dm=qt.high(ue.fromClass(Tm,{decorations:n=>n.decorations})),Om=fi.define([{tag:g.meta,color:"#404740"},{tag:g.link,textDecoration:"underline"},{tag:g.heading,textDecoration:"underline",fontWeight:"bold"},{tag:g.emphasis,fontStyle:"italic"},{tag:g.strong,fontWeight:"bold"},{tag:g.strikethrough,textDecoration:"line-through"},{tag:g.keyword,color:"#708"},{tag:[g.atom,g.bool,g.url,g.contentSeparator,g.labelName],color:"#219"},{tag:[g.literal,g.inserted],color:"#164"},{tag:[g.string,g.deleted],color:"#a11"},{tag:[g.regexp,g.escape,g.special(g.string)],color:"#e40"},{tag:g.definition(g.variableName),color:"#00f"},{tag:g.local(g.variableName),color:"#30a"},{tag:[g.typeName,g.namespace],color:"#085"},{tag:g.className,color:"#167"},{tag:[g.special(g.variableName),g.macroName],color:"#256"},{tag:g.definition(g.propertyName),color:"#00c"},{tag:g.comment,color:"#940"},{tag:g.invalid,color:"#f00"}]),Bm=1e4,Lm="()[]{}",Em=new N;function Pr(n,e,t){let i=n.prop(e<0?N.openedBy:N.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Rr(n){let e=n.type.prop(Em);return e?e(n.node):n}function Gt(n,e,t,i={}){let s=i.maxScanDistance||Bm,r=i.brackets||Lm,o=de(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Pr(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Pm(n,e,t,a,c,h,r)}}return Rm(n,e,t,o,l.type,s,r)}function Pm(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,b=t>0?d.length:-1;m!=b;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function ql(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Im(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Nm,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||fo,mergeTokens:n.mergeTokens!==!1}}function Nm(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Kl=new WeakMap;class Pe extends We{constructor(e){let t=Qh(e.languageData),i=Im(e),s,r=new class extends Jh{createParse(o,l,a){return new Wm(s,o,l,a)}};super(t,r,[],e.name),this.topNode=zm(t,this),s=this,this.streamParser=i,this.stateAfter=new N({perNode:!0}),this.tokenTable=e.tokenTable?new gc(i.tokenTable):Vm}static define(e){return new Pe(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=Kl.get(e.state),t!=null&&t1e4)return null;for(;r=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof J&&a=e.length)return e;!s&&t==0&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&co(n,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=dc(n,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:n.streamParser.startState(s?zt(s):4),tree:J.empty}}class Wm{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=li.get(),o=s[0].from,{state:l,tree:a}=Fm(e,i,o,this.to,r?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;hh.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(zt(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=li.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` `&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new uc(t,e?e.state.tabSize:4,e?zt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=pc(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const fo=Object.create(null),_i=[ke.none],Hm=new no(_i),$l=[],jl=Object.create(null),mc=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])mc[n]=bc(fo,e);class gc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),mc)}resolve(e){return e?this.table[e]||(this.table[e]=bc(this.extra,e)):0}}const Vm=new gc(fo);function Rs(n,e){$l.indexOf(n)>-1||($l.push(n),console.warn(e))}function bc(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=n[h]||g[h];c?typeof c=="function"?a.length?a=a.map(c):Rs(h,`Modifier ${h} used at start of tag`):a.length?Rs(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Rs(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=jl[s];if(r)return r.id;let o=jl[s]=ke.define({id:_i.length,name:i,props:[Jp({[i]:t})]});return _i.push(o),o.id}function zm(n,e){let t=ke.define({id:_i.length,name:"Document",props:[It.add(()=>n),tc.add(()=>i=>e.getIndent(i))],top:!0});return _i.push(t),t}G.RTL,G.LTR;const _m=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=po(n.state,t.from);return i.line?qm(n):i.block?$m(n):!1};function uo(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const qm=uo(Gm,0),Km=uo(yc,0),$m=uo((n,e)=>yc(n,e,Um(e)),0);function po(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const yi=50;function jm(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-yi,i),o=n.sliceDoc(s,s+yi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*yi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+yi),f=n.sliceDoc(s-yi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Um(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function yc(n,e,t=e.selection.ranges){let i=t.map(r=>po(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>jm(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Ir=ut.define(),Jm=ut.define(),Ym=O.define(),xc=O.define({combine(n){return Kt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),wc=Te.define({create(){return rt.empty},update(n,e){let t=e.state.facet(xc),i=e.annotation(Ir);if(i){let a=Me.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=Gn(c,c.length,t.minDepth,a):c=Sc(c,e.startState.selection),new rt(h==0?i.rest:c,h==0?c:i.rest)}let s=e.annotation(Jm);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Z.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Me.fromTransaction(e),o=e.annotation(Z.time),l=e.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new rt(n.done.map(Me.fromJSON),n.undone.map(Me.fromJSON))}});function Xm(n={}){return[wc,xc.of(n),D.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?kc:e.inputType=="historyRedo"?Nr:null;return i?(e.preventDefault(),i(t)):!1}})]}function ls(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(wc,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const kc=ls(0,!1),Nr=ls(1,!1),Qm=ls(0,!0),Zm=ls(1,!0);class Me{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Me(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Me(e.changes&&ie.fromJSON(e.changes),[],e.mapped&&ot.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=He;for(let s of e.startState.facet(Ym)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Me(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,He)}static selection(e){return new Me(void 0,He,void 0,void 0,e)}}function Gn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function eg(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function tg(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function vc(n,e){return n.length?e.length?n.concat(e):n:e}const He=[],ig=200;function Sc(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-ig));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Gn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Me.selection([e])]}function ng(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Is(n,e){if(!n.length)return n;let t=n.length,i=He;for(;t;){let s=sg(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Me.selection(i)]:He}function sg(n,e,t){let i=vc(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):He,t);if(!n.changes)return Me.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Me(s,R.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const rg=/^(input\.type|delete)($|\.)/;class rt{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new rt(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||rg.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):as(t,e))}function ge(n){return n.textDirectionAt(n.state.selection.main.head)==G.LTR}const Ac=n=>Cc(n,!ge(n)),Mc=n=>Cc(n,ge(n));function Tc(n,e){return Je(n,t=>t.empty?n.moveByGroup(t,e):as(t,e))}const lg=n=>Tc(n,!ge(n)),ag=n=>Tc(n,ge(n));function hg(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function hs(n,e,t){let i=de(n).resolveInner(e.head),s=t?N.closedBy:N.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;hg(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Gt(n,i.from,1):Gt(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}const cg=n=>Je(n,e=>hs(n.state,e,!ge(n))),fg=n=>Je(n,e=>hs(n.state,e,ge(n)));function Dc(n,e){return Je(n,t=>{if(!t.empty)return as(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const Oc=n=>Dc(n,!1),Bc=n=>Dc(n,!0);function Lc(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):as(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomEc(n,!1),Fr=n=>Ec(n,!0);function Tt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=x.cursor(i.from+r))}return s}const ug=n=>Je(n,e=>Tt(n,e,!0)),dg=n=>Je(n,e=>Tt(n,e,!1)),pg=n=>Je(n,e=>Tt(n,e,!ge(n))),mg=n=>Je(n,e=>Tt(n,e,ge(n))),gg=n=>Je(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),bg=n=>Je(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function yg(n,e,t){let i=!1,s=ui(n.selection,r=>{let o=Gt(n,r.head,-1)||Gt(n,r.head,1)||r.head>0&&Gt(n,r.head-1,1)||r.headyg(n,e);function _e(n,e){let t=ui(n.state.selection,i=>{let s=e(i);return x.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ge(n.state,t)),!0)}function Pc(n,e){return _e(n,t=>n.moveByChar(t,e))}const Rc=n=>Pc(n,!ge(n)),Ic=n=>Pc(n,ge(n));function Nc(n,e){return _e(n,t=>n.moveByGroup(t,e))}const wg=n=>Nc(n,!ge(n)),kg=n=>Nc(n,ge(n)),vg=n=>_e(n,e=>hs(n.state,e,!ge(n))),Sg=n=>_e(n,e=>hs(n.state,e,ge(n)));function Fc(n,e){return _e(n,t=>n.moveVertically(t,e))}const Wc=n=>Fc(n,!1),Hc=n=>Fc(n,!0);function Vc(n,e){return _e(n,t=>n.moveVertically(t,e,Lc(n).height))}const Gl=n=>Vc(n,!1),Jl=n=>Vc(n,!0),Cg=n=>_e(n,e=>Tt(n,e,!0)),Ag=n=>_e(n,e=>Tt(n,e,!1)),Mg=n=>_e(n,e=>Tt(n,e,!ge(n))),Tg=n=>_e(n,e=>Tt(n,e,ge(n))),Dg=n=>_e(n,e=>x.cursor(n.lineBlockAt(e.head).from)),Og=n=>_e(n,e=>x.cursor(n.lineBlockAt(e.head).to)),Yl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:0})),!0),Xl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.doc.length})),!0),Ql=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:0})),!0),Zl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Bg=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Lg=({state:n,dispatch:e})=>{let t=cs(n).map(({from:i,to:s})=>x.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:"select"})),!0},Eg=({state:n,dispatch:e})=>{let t=ui(n.selection,i=>{let s=de(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.range(l.to,l.from)}return i});return t.eq(n.selection)?!1:(e(Ge(n,t)),!0)};function zc(n,e){let{state:t}=n,i=t.selection,s=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=n.moveVertically(l,e);if(a.heado.to){s.some(h=>h.head==a.head)||s.push(a);break}else{if(a.head==l.head)break;l=a}}}return s.length==i.ranges.length?!1:(n.dispatch(Ge(t,x.create(s,s.length-1))),!0)}const Pg=n=>zc(n,!1),Rg=n=>zc(n,!0),Ig=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Ge(n,i)),!0):!1};function en(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=kn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=kn(n,o,!1),l=kn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:x.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const _c=(n,e,t)=>en(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&s_c(n,!1,!0),qc=n=>_c(n,!0,!1),Kc=(n,e)=>en(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),$c=n=>Kc(n,!1),Ng=n=>Kc(n,!0),Fg=n=>en(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headen(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Hg=n=>en(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:z.of(["",""])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},zg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cs(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function jc(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of cs(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _g=({state:n,dispatch:e})=>jc(n,e,!1),qg=({state:n,dispatch:e})=>jc(n,e,!0);function Uc(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of cs(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let s=n.changes(i);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Kg=({state:n,dispatch:e})=>Uc(n,e,!1),$g=({state:n,dispatch:e})=>Uc(n,e,!0),jg=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(cs(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Ug(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=de(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(N.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const ea=Gc(!1),Gg=Gc(!0);function Gc(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Ug(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new rs(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=lo(h,r);for(c==null&&(c=ci(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:x.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Jg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new rs(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=mo(n,(r,o,l)=>{let a=lo(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=zi(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(mo(n,(t,i)=>{i.push({from:t.from,insert:n.facet(ss)})}),{userEvent:"input.indent"})),!0),Yc=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(mo(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=ci(s,n.tabSize),o=0,l=zi(n,Math.max(0,r-zt(n)));for(;o(n.setTabFocusMode(),!0),Xg=[{key:"Ctrl-b",run:Ac,shift:Rc,preventDefault:!0},{key:"Ctrl-f",run:Mc,shift:Ic},{key:"Ctrl-p",run:Oc,shift:Wc},{key:"Ctrl-n",run:Bc,shift:Hc},{key:"Ctrl-a",run:gg,shift:Dg},{key:"Ctrl-e",run:bg,shift:Og},{key:"Ctrl-d",run:qc},{key:"Ctrl-h",run:Wr},{key:"Ctrl-k",run:Fg},{key:"Ctrl-Alt-h",run:$c},{key:"Ctrl-o",run:Vg},{key:"Ctrl-t",run:zg},{key:"Ctrl-v",run:Fr}],Qg=[{key:"ArrowLeft",run:Ac,shift:Rc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:lg,shift:wg,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:pg,shift:Mg,preventDefault:!0},{key:"ArrowRight",run:Mc,shift:Ic,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ag,shift:kg,preventDefault:!0},{mac:"Cmd-ArrowRight",run:mg,shift:Tg,preventDefault:!0},{key:"ArrowUp",run:Oc,shift:Wc,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Yl,shift:Ql},{mac:"Ctrl-ArrowUp",run:Ul,shift:Gl},{key:"ArrowDown",run:Bc,shift:Hc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Xl,shift:Zl},{mac:"Ctrl-ArrowDown",run:Fr,shift:Jl},{key:"PageUp",run:Ul,shift:Gl},{key:"PageDown",run:Fr,shift:Jl},{key:"Home",run:dg,shift:Ag,preventDefault:!0},{key:"Mod-Home",run:Yl,shift:Ql},{key:"End",run:ug,shift:Cg,preventDefault:!0},{key:"Mod-End",run:Xl,shift:Zl},{key:"Enter",run:ea,shift:ea},{key:"Mod-a",run:Bg},{key:"Backspace",run:Wr,shift:Wr,preventDefault:!0},{key:"Delete",run:qc,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$c,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Ng,preventDefault:!0},{mac:"Mod-Backspace",run:Wg,preventDefault:!0},{mac:"Mod-Delete",run:Hg,preventDefault:!0}].concat(Xg.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Zg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cg,shift:vg},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:fg,shift:Sg},{key:"Alt-ArrowUp",run:_g},{key:"Shift-Alt-ArrowUp",run:Kg},{key:"Alt-ArrowDown",run:qg},{key:"Shift-Alt-ArrowDown",run:$g},{key:"Mod-Alt-ArrowUp",run:Pg},{key:"Mod-Alt-ArrowDown",run:Rg},{key:"Escape",run:Ig},{key:"Mod-Enter",run:Gg},{key:"Alt-l",mac:"Ctrl-l",run:Lg},{key:"Mod-i",run:Eg,preventDefault:!0},{key:"Mod-[",run:Yc},{key:"Mod-]",run:Jc},{key:"Mod-Alt-\\",run:Jg},{key:"Shift-Mod-k",run:jg},{key:"Shift-Mod-\\",run:xg},{key:"Mod-/",run:_m},{key:"Alt-A",run:Km},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yg}].concat(Qg),e0={key:"Tab",run:Jc,shift:Yc};class Xc{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=de(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Qc(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function ta(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function t0(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:t0(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function qb(n,e){return t=>{for(let i=de(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class ia{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function Ft(n){return n.selection.main.from}function Qc(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const go=ut.define();function n0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:x.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const na=new WeakMap;function s0(n){if(!Array.isArray(n))return n;let e=na.get(n);return e||na.set(n,e=i0(n)),e}const Jn=R.define(),qi=R.define();class r0{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:(C=Ea(v))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!k||S==1&&b||M==0&&S!=0)&&(t[f]==v||i[f]==v&&(u=!0)?o[f++]=k:o.length&&(y=!1)),M=S,k+=lt(v)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?lt(Be(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class o0{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:l0,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>sa(e(i),t(i)),optionClass:(e,t)=>i=>sa(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function sa(n,e){return n?e?n+" "+e:n:e}function l0(n,e,t,i,s,r){let o=n.textDirection==G.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||k>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let b=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/b}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function a0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return at.position-i.position).map(t=>t.render)}function Ns(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class h0{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(re);this.optionContent=a0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Ns(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(re).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:qi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=Ns(r.length,o,e.state.facet(re).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected=this.range.to)&&(this.range=Ns(t.options.length,t.selected,this.view.state.facet(re).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>Ae(this.view.state,l,"completion info")):(this.addInfoPane(o,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&f0(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;oi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew h0(t,n,e)}function f0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function ra(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function u0(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f=="string"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f=="string"?{name:u}:f)}},o=e.facet(re);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new ia(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new o0(u):new r0(u);for(let m of c.result.options)if(d=p.match(m.label)){let b=m.displayLabel?f?f(m,d.matched):[]:d.matched,y=d.score+(m.boost||0);if(r(new ia(m,c.source,b,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:k}=m.section;s||(s=Object.create(null)),s[k]=Math.max(y,s[k]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?s[p.name]-s[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.nameu.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):ra(c.completion)>ra(a)&&(l[l.length-1]=c),a=c.completion}return l}class Jt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Jt(this.options,oa(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=u0(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(re).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;cc.hasResult()?Math.min(h,c.from):h,1e8),create:y0,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new Jt(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Jt(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Yn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Yn(g0,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(re),r=(i.override||t.languageDataAt("autocomplete",Ft(t)).map(s0)).map(a=>(this.active.find(c=>c.source==a)||new Ve(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(bo));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!d0(r,this.active)||l?o=Jt.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Ve(a.source,0):a));for(let a of e.effects)a.is(ef)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Yn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?p0:m0}}function d0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const g0=[];function Zc(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(go);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ve{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=Zc(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Ve(s.source,0)),i&4&&s.state==0&&(s=new Ve(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(Jn))s=new Ve(s.source,1,r.value);else if(r.is(qi))s=new Ve(s.source,0);else if(r.is(bo))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Ft(e.state))}}class ti extends Ve{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Ft(e.state);if(l>o||!s||t&2&&(Ft(e.startState)==this.from||lt.map(e))}}),ef=R.define(),Se=Te.define({create(){return Yn.start()},update(n,e){return n.update(e)},provide:n=>[io.from(n,e=>e.tooltip),D.contentAttributes.from(n,e=>e.attrs)]});function yo(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Se).active.find(s=>s.source==e.source);return i instanceof ti?(typeof t=="string"?n.dispatch({...n0(n.state,t,i.from,i.to),annotations:go.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const y0=c0(Se,yo);function vn(n,e="option"){return t=>{let i=t.state.field(Se,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:ef.of(l)}),!0}}const tf=n=>{let e=n.state.field(Se,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Se,!1)?(n.dispatch({effects:Jn.of(!0)}),!0):!1,x0=n=>{let e=n.state.field(Se,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:qi.of(null)}),!0)};class w0{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const k0=50,v0=1e3,S0=ue.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Se).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Se),t=n.state.facet(re);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Se)==e)return;let i=n.transactions.some(r=>{let o=Zc(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rk0&&Date.now()-o.time>v0){for(let l of o.context.abortListeners)try{l()}catch(a){Ae(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Jn)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Se);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(re).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Ft(e),i=new Xc(e,t,n.explicit,this.view),s=new w0(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qi.of(null)}),Ae(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(re).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(re),i=this.view.state.field(Se);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ve(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:bo.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Se,!1);if(e&&e.tooltip&&this.view.state.facet(re).closeOnBlur){let t=e.open&&_h(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Jn.of(!1)}),20),this.composing=0}}}),C0=typeof navigator=="object"&&/Win/.test(navigator.platform),A0=qt.highest(D.domEventHandlers({keydown(n,e){let t=e.state.field(Se,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(C0&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&yo(e,i),!1}})),nf=D.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class M0{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class xo{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new xo(this.field,t,i)}}class wo{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew xo(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1,c=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||"").length:2;f.from-=u,f.to-=u}s.push(new M0(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new wo(i,s)}}let T0=I.widget({widget:new class extends Ue{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),D0=I.mark({class:"cm-snippetField"});class di{constructor(e,t){this.ranges=e,this.active=t,this.deco=I.set(e.map(i=>(i.from==i.to?T0:D0).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new di(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const tn=R.define({map(n,e){return n&&n.map(e)}}),O0=R.define(),Ki=Te.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(tn))return t.value;if(t.is(O0)&&n)return new di(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>D.decorations.from(n,e=>e?e.deco:I.none)});function ko(n,e){return x.create(n.filter(t=>t.field==e).map(t=>x.range(t.from,t.to)))}function B0(n){let e=wo.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:z.of(o)},scrollIntoView:!0,annotations:i?[go.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=ko(l,0)),l.some(c=>c.field>0)){let c=new di(l,0),f=h.effects=[tn.of(c)];t.state.field(Ki,!1)===void 0&&f.push(R.appendConfig.of([Ki,I0,N0,nf]))}t.dispatch(t.state.update(h))}}function sf(n){return({state:e,dispatch:t})=>{let i=e.field(Ki,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:ko(i.ranges,s),effects:tn.of(r?null:new di(i.ranges,s)),scrollIntoView:!0})),!0}}const L0=({state:n,dispatch:e})=>n.field(Ki,!1)?(e(n.update({effects:tn.of(null)})),!0):!1,E0=sf(1),P0=sf(-1),R0=[{key:"Tab",run:E0,shift:P0},{key:"Escape",run:L0}],la=O.define({combine(n){return n.length?n[0]:R0}}),I0=qt.highest(Xi.compute([la],n=>n.facet(la)));function Kb(n,e){return{...e,apply:B0(n)}}const N0=D.domEventHandlers({mousedown(n,e){let t=e.state.field(Ki,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:ko(t.ranges,s.field),effects:tn.of(t.ranges.some(r=>r.field>s.field)?new di(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),$i={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Nt=R.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),vo=new class extends xt{};vo.startSide=1;vo.endSide=-1;const rf=Te.define({create(){return W.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(Nt)&&(n=n.update({add:[vo.range(t.value,t.value+1)]}));return n}});function F0(){return[H0,rf]}const Ws="()[]{}<>«»»«[]{}";function of(n){for(let e=0;e{if((W0?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&<(Be(i,0))==1||e!=s.from||t!=s.to)return!1;let r=_0(n.state,i);return r?(n.dispatch(r),!0):!1}),V0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=lf(n,n.selection.main.head).brackets||$i.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=q0(n.doc,o.head);for(let a of i)if(a==l&&fs(n.doc,o.head)==of(Be(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:x.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},z0=[{key:"Backspace",run:V0}];function _0(n,e){let t=lf(n,n.selection.main.head),i=t.brackets||$i.brackets;for(let s of i){let r=of(Be(s,0));if(e==s)return r==s?j0(n,s,i.indexOf(s+s+s)>-1,t):K0(n,s,r,t.before||$i.before);if(e==r&&af(n,n.selection.main.from))return $0(n,s,r)}return null}function af(n,e){let t=!1;return n.field(rf).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function fs(n,e){let t=n.sliceString(e,e+2);return t.slice(0,lt(Be(t,0)))}function q0(n,e){let t=n.sliceString(e-2,e);return lt(Be(t,0))==t.length?t:t.slice(1)}function K0(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Nt.of(o.to+e.length),range:x.range(o.anchor+e.length,o.head+e.length)};let l=fs(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Nt.of(o.head+e.length),range:x.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function $0(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&fs(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:x.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function j0(n,e,t,i){let s=i.stringPrefixes||$i.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Nt.of(l.to+e.length),range:x.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=fs(n.doc,a),c;if(h==e){if(aa(n,a))return{changes:{insert:e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)};if(af(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:x.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=ha(n,a-2*e.length,s))>-1&&aa(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=Ie.Word&&ha(n,a,s)>-1&&!U0(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function aa(n,e){let t=de(n).resolveInner(e+1);return t.parent&&t.from==e}function U0(n,e,t,i){let s=de(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function ha(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Ie.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=Ie.Word)return r}return-1}function G0(n={}){return[A0,Se,re.of(n),S0,J0,nf]}const hf=[{key:"Ctrl-Space",run:Fs},{mac:"Alt-`",run:Fs},{mac:"Alt-i",run:Fs},{key:"Escape",run:x0},{key:"ArrowDown",run:vn(!0)},{key:"ArrowUp",run:vn(!1)},{key:"PageDown",run:vn(!0,"page")},{key:"PageUp",run:vn(!1,"page")},{key:"Enter",run:tf}],J0=qt.highest(Xi.computeN([re],n=>n.facet(re).defaultKeymap?[hf]:[])),Y0="#2E3235",et="#DDDDDD",Li="#B9D2FF",Sn="#b0b0b0",X0="#e0e0e0",cf="#808080",Hs="#000000",Q0="#A54543",ff="#fc6d24",Ot="#fda331",Vs="#8abeb7",ca="#b5bd68",xi="#6fb3d2",wi="#cc99cc",Z0="#6987AF",fa=ff,ua="#292d30",Cn=Li+"30",eb=Y0,zs=et,tb="#202325",da=et,ib=D.theme({"&":{color:et,backgroundColor:eb},".cm-content":{caretColor:da},".cm-cursor, .cm-dropCursor":{borderLeftColor:da},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:tb},".cm-panels":{backgroundColor:ua,color:Sn},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Li,outline:`1px solid ${Sn}`,color:Hs},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:X0,color:Hs},".cm-activeLine":{backgroundColor:Cn},".cm-selectionMatch":{backgroundColor:Cn},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Sn}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Li,color:Hs},".cm-gutters":{borderRight:"1px solid #ffffff10",color:cf,backgroundColor:ua},".cm-activeLineGutter":{backgroundColor:Cn},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Li},".cm-tooltip":{border:"none",backgroundColor:zs},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:zs,borderBottomColor:zs},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Cn,color:Sn}}},{dark:!0}),nb=fi.define([{tag:g.keyword,color:Ot},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:ca},{tag:[g.variableName],color:xi},{tag:[g.function(g.variableName)],color:Ot},{tag:[g.labelName],color:ff},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:Ot},{tag:[g.definition(g.name),g.separator],color:wi},{tag:[g.brace],color:wi},{tag:[g.annotation],color:fa},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:Ot},{tag:[g.typeName,g.className],color:xi},{tag:[g.operator,g.operatorKeyword],color:wi},{tag:[g.tagName],color:Ot},{tag:[g.squareBracket],color:wi},{tag:[g.angleBracket],color:wi},{tag:[g.attributeName],color:xi},{tag:[g.regexp],color:Ot},{tag:[g.quote],color:et},{tag:[g.string],color:ca},{tag:g.link,color:Z0,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[g.url,g.escape,g.special(g.string)],color:Vs},{tag:[g.meta],color:Q0},{tag:[g.comment],color:cf,fontStyle:"italic"},{tag:g.monospace,color:et},{tag:g.strong,fontWeight:"bold",color:Ot},{tag:g.emphasis,fontStyle:"italic",color:xi},{tag:g.strikethrough,textDecoration:"line-through"},{tag:g.heading,fontWeight:"bold",color:et},{tag:g.special(g.heading1),fontWeight:"bold",color:et},{tag:g.heading1,fontWeight:"bold",color:et},{tag:[g.heading2,g.heading3,g.heading4],fontWeight:"bold",color:et},{tag:[g.heading5,g.heading6],color:et},{tag:[g.atom,g.bool,g.special(g.variableName)],color:Vs},{tag:[g.processingInstruction,g.inserted],color:Vs},{tag:[g.contentSeparator],color:xi},{tag:g.invalid,color:Li,borderBottom:`1px dotted ${fa}`}]),sb=[ib,ho(nb)],pa="#2e3440",So="#3b4252",ma="#434c5e",An="#4c566a",ga="#e5e9f0",Hr="#eceff4",_s="#8fbcbb",ba="#88c0d0",rb="#81a1c1",qe="#5e81ac",ob="#bf616a",$t="#d08770",qs="#ebcb8b",ya="#a3be8c",lb="#b48ead",xa="#d30102",Co=Hr,Ks=Co,ab="#ffffff",$s=So,hb=Co,wa=So,cb=D.theme({"&":{color:pa,backgroundColor:ab},".cm-content":{caretColor:wa},".cm-cursor, .cm-dropCursor":{borderLeftColor:wa},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:hb},".cm-panels":{backgroundColor:Co,color:An},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${An}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ga},".cm-activeLine":{backgroundColor:Ks},".cm-selectionMatch":{backgroundColor:ga},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${An}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Hr},".cm-gutters":{backgroundColor:Hr,color:pa,border:"none"},".cm-activeLineGutter":{backgroundColor:Ks},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:$s},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:$s,borderBottomColor:$s},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ks,color:An}}},{dark:!1}),fb=fi.define([{tag:g.keyword,color:qe},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:$t},{tag:[g.variableName],color:$t},{tag:[g.function(g.variableName)],color:qe},{tag:[g.labelName],color:rb},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:qe},{tag:[g.definition(g.name),g.separator],color:ya},{tag:[g.brace],color:_s},{tag:[g.annotation],color:xa},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:ba},{tag:[g.typeName,g.className],color:qs},{tag:[g.operator,g.operatorKeyword],color:ya},{tag:[g.tagName],color:lb},{tag:[g.squareBracket],color:ob},{tag:[g.angleBracket],color:$t},{tag:[g.attributeName],color:qs},{tag:[g.regexp],color:qe},{tag:[g.quote],color:So},{tag:[g.string],color:$t},{tag:g.link,color:_s,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[g.url,g.escape,g.special(g.string)],color:$t},{tag:[g.meta],color:ba},{tag:[g.comment],color:ma,fontStyle:"italic"},{tag:g.strong,fontWeight:"bold",color:qe},{tag:g.emphasis,fontStyle:"italic",color:qe},{tag:g.strikethrough,textDecoration:"line-through"},{tag:g.heading,fontWeight:"bold",color:qe},{tag:g.special(g.heading1),fontWeight:"bold",color:qe},{tag:g.heading1,fontWeight:"bold",color:qe},{tag:[g.heading2,g.heading3,g.heading4],fontWeight:"bold",color:qe},{tag:[g.heading5,g.heading6],color:qe},{tag:[g.atom,g.bool,g.special(g.variableName)],color:$t},{tag:[g.processingInstruction,g.inserted],color:_s},{tag:[g.contentSeparator],color:qs},{tag:g.invalid,color:ma,borderBottom:`1px dotted ${xa}`}]),ub=[cb,ho(fb)];class ka{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Et{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(ji).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new wt,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let m,b;if(l.length)m=a,b=l.reduce((w,M)=>Math.min(w,M.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;b=p.to,l.push(p),d++}for(;dw.from||w.to==m))l.push(w),d++,b=Math.min(w.to,b);else{b=Math.min(w.from,b);break}}b=Math.min(b,f);let y=!1;if(l.some(w=>w.from==m&&(w.to==b||b==f))&&(y=m==b,!y&&b-m<10)){let w=m-(c+h.value.length);w>0&&(h.next(w),c=m);for(let M=m;;){if(M>=b){y=!0;break}if(!h.lineBreak&&c+h.value.length>M)break;M=c+h.value.length,c+=h.value.length,h.next()}}let k=Ab(l);if(y)o.add(m,m,I.widget({widget:new kb(k),diagnostics:l.slice()}));else{let w=l.reduce((M,v)=>v.markClass?M+" "+v.markClass:M,"");o.add(m,b,I.mark({class:"cm-lintRange cm-lintRange-"+k+w,diagnostics:l.slice(),inclusiveEnd:l.some(M=>M.to>b)}))}if(a=b,a==f)break;for(let w=0;w{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new ka(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new ka(i.from,r,i.diagnostic)}}),i}function db(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(ji).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(uf))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function pb(n,e){return n.field(Le,!1)?e:e.concat(R.appendConfig.of(Mb))}const uf=R.define(),Ao=R.define(),df=R.define(),Le=Te.define({create(){return new Et(I.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=hi(t,n.selected.diagnostic,r)||hi(t,null,r)}!t.size&&s&&e.state.facet(ji).autoPanel&&(s=null),n=new Et(t,s,i)}for(let t of e.effects)if(t.is(uf)){let i=e.state.facet(ji).autoPanel?t.value.length?Ui.open:null:n.panel;n=Et.init(t.value,i,e.state)}else t.is(Ao)?n=new Et(n.diagnostics,t.value?Ui.open:null,n.selected):t.is(df)&&(n=new Et(n.diagnostics,n.panel,t.value));return n},provide:n=>[Mr.from(n,e=>e.panel),D.decorations.from(n,e=>e.diagnostics)]}),mb=I.mark({class:"cm-lintRange cm-lintRange-active"});function gb(n,e,t){let{diagnostics:i}=n.state.field(Le),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(emf(n,t,!1)))}const yb=n=>{let e=n.state.field(Le,!1);(!e||!e.panel)&&n.dispatch({effects:pb(n.state,[Ao.of(!0)])});let t=wp(n,Ui.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},va=n=>{let e=n.state.field(Le,!1);return!e||!e.panel?!1:(n.dispatch({effects:Ao.of(!1)}),!0)},xb=n=>{let e=n.state.field(Le,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},wb=[{key:"Mod-Shift-m",run:yb,preventDefault:!0},{key:"F8",run:xb}],ji=O.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Kt(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Sa,tooltipFilter:Sa,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function Sa(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function pf(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function mf(n,e,t){var i;let s=t?pf(e.actions):[];return it("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},it("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=hi(n.state.field(Le).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),it("u",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?" "+r.markClass:"";return it("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&it("div",{class:"cm-diagnosticSource"},e.source))}class kb extends Ue{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return it("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Ca{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=mf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ui{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)va(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=pf(r.actions);for(let l=0;l{for(let r=0;rva(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Le).selected;if(!e)return-1;for(let t=0;t{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;di&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Le),i=hi(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:df.of(i)})}static open(e){return new Ui(e)}}function vb(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function Mn(n){return vb(``,'width="6" height="3"')}const Sb=D.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Mn("#d11")},".cm-lintRange-warning":{backgroundImage:Mn("orange")},".cm-lintRange-info":{backgroundImage:Mn("#999")},".cm-lintRange-hint":{backgroundImage:Mn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Cb(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function Ab(n){let e="hint",t=1;for(let i of n){let s=Cb(i.severity);s>t&&(t=s,e=i.severity)}return e}const Mb=[Le,D.decorations.compute([Le],n=>{let{selected:e,panel:t}=n.field(Le);return!e||!t||e.from==e.to?I.none:I.set([mb.range(e.from,e.to)])}),yp(gb,{hideOn:db}),Sb],Tb=[Yd(),Xm(),Am(),zd(),V.allowMultipleSelections.of(!0),fm(),ho(Om,{fallback:!0}),F0(),lp(),cp(),Xi.of([...z0,...Zg,...og,...km,...hf,...wb])],Db=["standardSQL","msSQL","mySQL","mariaDB","sqlite","cassandra","plSQL","hive","pgSQL","gql","gpSQL","sparkSQL","esper"],Aa={python:()=>se(()=>import("./index-5qCM2tFq.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(n=>n.python()),c:()=>se(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>Pe.define(n.c)),cpp:()=>se(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>Pe.define(n.cpp)),markdown:async()=>{const[n,e]=await Promise.all([se(()=>import("./index-XumPGXes.js"),__vite__mapDeps([6,7,1,8,2,3,4,5,9]),import.meta.url),se(()=>import("./frontmatter-FN0veR8a.js"),__vite__mapDeps([10,11,2,3,4,5]),import.meta.url)]);return n.markdown({extensions:[e.frontmatter]})},latex:()=>se(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>Pe.define(n.stex)),json:()=>se(()=>import("./index-BhQi-Oea.js"),__vite__mapDeps([12,1,2,3,4,5]),import.meta.url).then(n=>n.json()),html:()=>se(()=>import("./index-Bmu7HJDW.js"),__vite__mapDeps([7,1,8,2,3,4,5,9]),import.meta.url).then(n=>n.html()),css:()=>se(()=>import("./index-D-RUc-cS.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url).then(n=>n.css()),javascript:()=>se(()=>import("./index-eP3_EJ4x.js"),__vite__mapDeps([9,1,2,3,4,5]),import.meta.url).then(n=>n.javascript()),jinja2:()=>se(()=>import("./jinja2-C4DGRd-O.js"),[],import.meta.url).then(n=>Pe.define(n.jinja2)),typescript:()=>se(()=>import("./index-eP3_EJ4x.js"),__vite__mapDeps([9,1,2,3,4,5]),import.meta.url).then(n=>n.javascript({typescript:!0})),yaml:()=>se(()=>import("./yaml-DsCXHVTH.js"),[],import.meta.url).then(n=>Pe.define(n.yaml)),dockerfile:()=>se(()=>import("./dockerfile-ZL4hHokT.js"),[],import.meta.url).then(n=>Pe.define(n.dockerFile)),shell:()=>se(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>Pe.define(n.shell)),r:()=>se(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>Pe.define(n.r)),sql:()=>se(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>Pe.define(n.standardSQL)),...Object.fromEntries(Db.map(n=>["sql-"+n,()=>se(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>Pe.define(e[n]))]))},Ob={py:"python",md:"markdown",js:"javascript",ts:"typescript",sh:"shell"};async function Bb(n){const e=Aa[n]||Aa[Ob[n]]||void 0;if(e)return e()}var Lb=Mf('
');function $b(n,e){yf(e,!0);let t=Ee(e,"class_names",3,""),i=Ee(e,"value",15,""),s=Ee(e,"basic",3,!0),r=Ee(e,"lines",3,5),o=Ee(e,"max_lines",3,null),l=Ee(e,"extensions",19,()=>[]),a=Ee(e,"use_tab",3,!0),h=Ee(e,"readonly",3,!1),c=Ee(e,"placeholder",3,void 0),f=Ee(e,"wrap_lines",3,!1),u=Ee(e,"show_line_numbers",3,!0),d=Ee(e,"autocomplete",3,!1),p=Sf(void 0),m,b;async function y(E){const X=await Bb(E);Cf(p,X,!0)}us(()=>{y(e.language)}),us(()=>{To(p),h(),be()}),us(()=>{k(i())}),w();function k(E){b&&E!==b.state.doc.toString()&&b.dispatch({changes:{from:0,to:b.state.doc.length,insert:E}})}function w(){b&&b.requestMeasure({read:L})}function M(){const E=new D({parent:m,state:H(i())});return E.dom.addEventListener("focus",v,!0),E.dom.addEventListener("blur",C,!0),E}function v(){e.onfocus?.()}function C(){e.onblur?.()}function S(E){let X=E.dom.querySelectorAll(".cm-gutterElement");if(X.length===0)return null;for(var $=0;$X.annotation(Z.userEvent)!=null)}function q(E){if(!E.docChanged)return;const $=E.state.doc.toString();i($),F(E)?(e.onchange?.($),e.oninput?.()):e.onchange?.($),b.requestMeasure({read:L})}function P(){return[...K(s(),a(),c(),h(),To(p),u()),B,...oe(),...l()]}const B=D.theme({"&":{fontSize:"var(--text-sm)",backgroundColor:"var(--border-color-secondary)"},".cm-content":{paddingTop:"5px",paddingBottom:"5px",color:"var(--body-text-color)",fontFamily:"var(--font-mono)",minHeight:"100%"},".cm-gutterElement":{marginRight:"var(--spacing-xs)"},".cm-gutters":{marginRight:"1px",borderRight:"1px solid var(--border-color-primary)",backgroundColor:"var(--block-background-fill);",color:"var(--body-text-color-subdued)"},".cm-focused":{outline:"none"},".cm-scroller":{height:"auto"},".cm-cursor":{borderLeftColor:"var(--body-text-color)"}}),_=D.theme({".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:"var(--background-fill-primary)",color:"var(--body-text-color)"},"& > ul > li[aria-selected]":{backgroundColor:"var(--color-accent-soft)",color:"var(--body-text-color)"}}});function H(E){return V.create({doc:E??void 0,extensions:P()})}function K(E,X,$,ne,De,dt){const ye=[D.editable.of(!ne),V.readOnly.of(ne),D.contentAttributes.of({"aria-label":"Code input container"})];return E&&ye.push(Tb),X&&ye.push(Xi.of([{key:"Tab",run:tf},e0])),$&&ye.push(np($)),De&&ye.push(De),dt&&ye.push(Bp()),d()&&(ye.push(G0()),ye.push(_)),ye.push(D.updateListener.of(q)),f()&&ye.push(D.lineWrapping),ye}function oe(){const E=[];return e.dark_mode?E.push(sb):E.push(ub),E}function be(){b?.dispatch({effects:R.reconfigure.of(P())})}xf(()=>(b=M(),()=>b?.destroy()));var ve=Lb(),ee=Af(ve);gf(ee,E=>m=E,()=>m),Tf(ve),wf(()=>bf(ee,1,`codemirror-wrapper ${t()??""}`,"svelte-1k1wn0u")),kf(n,ve),vf()}export{It as A,ec as B,$b as C,Lp as D,x as E,li as F,Em as G,zb as H,U as I,Vb as J,em as K,Wb as L,no as N,Jh as P,Pe as S,J as T,ke as a,N as b,_b as c,de as d,Lr as e,dm as f,tc as g,Hb as h,qb as i,Ib as j,i0 as k,Kb as l,Re as m,ci as n,qt as o,Nb as p,Xi as q,D as r,Jp as s,g as t,We as u,ss as v,um as w,Qh as x,Xc as y,V as z}; +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new uc(t,e?e.state.tabSize:4,e?zt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=pc(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const fo=Object.create(null),_i=[ke.none],Hm=new no(_i),$l=[],jl=Object.create(null),mc=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])mc[n]=bc(fo,e);class gc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),mc)}resolve(e){return e?this.table[e]||(this.table[e]=bc(this.extra,e)):0}}const Vm=new gc(fo);function Rs(n,e){$l.indexOf(n)>-1||($l.push(n),console.warn(e))}function bc(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=n[h]||g[h];c?typeof c=="function"?a.length?a=a.map(c):Rs(h,`Modifier ${h} used at start of tag`):a.length?Rs(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Rs(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=jl[s];if(r)return r.id;let o=jl[s]=ke.define({id:_i.length,name:i,props:[Jp({[i]:t})]});return _i.push(o),o.id}function zm(n,e){let t=ke.define({id:_i.length,name:"Document",props:[It.add(()=>n),tc.add(()=>i=>e.getIndent(i))],top:!0});return _i.push(t),t}G.RTL,G.LTR;const _m=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=po(n.state,t.from);return i.line?qm(n):i.block?$m(n):!1};function uo(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const qm=uo(Gm,0),Km=uo(yc,0),$m=uo((n,e)=>yc(n,e,Um(e)),0);function po(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const yi=50;function jm(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-yi,i),o=n.sliceDoc(s,s+yi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*yi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+yi),f=n.sliceDoc(s-yi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Um(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function yc(n,e,t=e.selection.ranges){let i=t.map(r=>po(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>jm(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Ir=ut.define(),Jm=ut.define(),Ym=O.define(),xc=O.define({combine(n){return Kt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),wc=Te.define({create(){return rt.empty},update(n,e){let t=e.state.facet(xc),i=e.annotation(Ir);if(i){let a=Me.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=Gn(c,c.length,t.minDepth,a):c=Sc(c,e.startState.selection),new rt(h==0?i.rest:c,h==0?c:i.rest)}let s=e.annotation(Jm);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Z.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Me.fromTransaction(e),o=e.annotation(Z.time),l=e.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new rt(n.done.map(Me.fromJSON),n.undone.map(Me.fromJSON))}});function Xm(n={}){return[wc,xc.of(n),D.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?kc:e.inputType=="historyRedo"?Nr:null;return i?(e.preventDefault(),i(t)):!1}})]}function ls(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(wc,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const kc=ls(0,!1),Nr=ls(1,!1),Qm=ls(0,!0),Zm=ls(1,!0);class Me{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Me(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Me(e.changes&&ie.fromJSON(e.changes),[],e.mapped&&ot.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=He;for(let s of e.startState.facet(Ym)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Me(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,He)}static selection(e){return new Me(void 0,He,void 0,void 0,e)}}function Gn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function eg(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function tg(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function vc(n,e){return n.length?e.length?n.concat(e):n:e}const He=[],ig=200;function Sc(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-ig));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Gn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Me.selection([e])]}function ng(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Is(n,e){if(!n.length)return n;let t=n.length,i=He;for(;t;){let s=sg(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Me.selection(i)]:He}function sg(n,e,t){let i=vc(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):He,t);if(!n.changes)return Me.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Me(s,R.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const rg=/^(input\.type|delete)($|\.)/;class rt{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new rt(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||rg.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):as(t,e))}function ge(n){return n.textDirectionAt(n.state.selection.main.head)==G.LTR}const Ac=n=>Cc(n,!ge(n)),Mc=n=>Cc(n,ge(n));function Tc(n,e){return Je(n,t=>t.empty?n.moveByGroup(t,e):as(t,e))}const lg=n=>Tc(n,!ge(n)),ag=n=>Tc(n,ge(n));function hg(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function hs(n,e,t){let i=de(n).resolveInner(e.head),s=t?N.closedBy:N.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;hg(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Gt(n,i.from,1):Gt(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}const cg=n=>Je(n,e=>hs(n.state,e,!ge(n))),fg=n=>Je(n,e=>hs(n.state,e,ge(n)));function Dc(n,e){return Je(n,t=>{if(!t.empty)return as(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const Oc=n=>Dc(n,!1),Bc=n=>Dc(n,!0);function Lc(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):as(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomEc(n,!1),Fr=n=>Ec(n,!0);function Tt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=x.cursor(i.from+r))}return s}const ug=n=>Je(n,e=>Tt(n,e,!0)),dg=n=>Je(n,e=>Tt(n,e,!1)),pg=n=>Je(n,e=>Tt(n,e,!ge(n))),mg=n=>Je(n,e=>Tt(n,e,ge(n))),gg=n=>Je(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),bg=n=>Je(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function yg(n,e,t){let i=!1,s=ui(n.selection,r=>{let o=Gt(n,r.head,-1)||Gt(n,r.head,1)||r.head>0&&Gt(n,r.head-1,1)||r.headyg(n,e);function _e(n,e){let t=ui(n.state.selection,i=>{let s=e(i);return x.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ge(n.state,t)),!0)}function Pc(n,e){return _e(n,t=>n.moveByChar(t,e))}const Rc=n=>Pc(n,!ge(n)),Ic=n=>Pc(n,ge(n));function Nc(n,e){return _e(n,t=>n.moveByGroup(t,e))}const wg=n=>Nc(n,!ge(n)),kg=n=>Nc(n,ge(n)),vg=n=>_e(n,e=>hs(n.state,e,!ge(n))),Sg=n=>_e(n,e=>hs(n.state,e,ge(n)));function Fc(n,e){return _e(n,t=>n.moveVertically(t,e))}const Wc=n=>Fc(n,!1),Hc=n=>Fc(n,!0);function Vc(n,e){return _e(n,t=>n.moveVertically(t,e,Lc(n).height))}const Gl=n=>Vc(n,!1),Jl=n=>Vc(n,!0),Cg=n=>_e(n,e=>Tt(n,e,!0)),Ag=n=>_e(n,e=>Tt(n,e,!1)),Mg=n=>_e(n,e=>Tt(n,e,!ge(n))),Tg=n=>_e(n,e=>Tt(n,e,ge(n))),Dg=n=>_e(n,e=>x.cursor(n.lineBlockAt(e.head).from)),Og=n=>_e(n,e=>x.cursor(n.lineBlockAt(e.head).to)),Yl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:0})),!0),Xl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.doc.length})),!0),Ql=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:0})),!0),Zl=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Bg=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Lg=({state:n,dispatch:e})=>{let t=cs(n).map(({from:i,to:s})=>x.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:"select"})),!0},Eg=({state:n,dispatch:e})=>{let t=ui(n.selection,i=>{let s=de(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.range(l.to,l.from)}return i});return t.eq(n.selection)?!1:(e(Ge(n,t)),!0)};function zc(n,e){let{state:t}=n,i=t.selection,s=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=n.moveVertically(l,e);if(a.heado.to){s.some(h=>h.head==a.head)||s.push(a);break}else{if(a.head==l.head)break;l=a}}}return s.length==i.ranges.length?!1:(n.dispatch(Ge(t,x.create(s,s.length-1))),!0)}const Pg=n=>zc(n,!1),Rg=n=>zc(n,!0),Ig=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Ge(n,i)),!0):!1};function en(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=kn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=kn(n,o,!1),l=kn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:x.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const _c=(n,e,t)=>en(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&s_c(n,!1,!0),qc=n=>_c(n,!0,!1),Kc=(n,e)=>en(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),$c=n=>Kc(n,!1),Ng=n=>Kc(n,!0),Fg=n=>en(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headen(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Hg=n=>en(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:z.of(["",""])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},zg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cs(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function jc(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of cs(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _g=({state:n,dispatch:e})=>jc(n,e,!1),qg=({state:n,dispatch:e})=>jc(n,e,!0);function Uc(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of cs(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let s=n.changes(i);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Kg=({state:n,dispatch:e})=>Uc(n,e,!1),$g=({state:n,dispatch:e})=>Uc(n,e,!0),jg=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(cs(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Ug(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=de(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(N.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const ea=Gc(!1),Gg=Gc(!0);function Gc(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Ug(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new rs(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=lo(h,r);for(c==null&&(c=ci(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:x.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Jg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new rs(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=mo(n,(r,o,l)=>{let a=lo(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=zi(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(mo(n,(t,i)=>{i.push({from:t.from,insert:n.facet(ss)})}),{userEvent:"input.indent"})),!0),Yc=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(mo(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=ci(s,n.tabSize),o=0,l=zi(n,Math.max(0,r-zt(n)));for(;o(n.setTabFocusMode(),!0),Xg=[{key:"Ctrl-b",run:Ac,shift:Rc,preventDefault:!0},{key:"Ctrl-f",run:Mc,shift:Ic},{key:"Ctrl-p",run:Oc,shift:Wc},{key:"Ctrl-n",run:Bc,shift:Hc},{key:"Ctrl-a",run:gg,shift:Dg},{key:"Ctrl-e",run:bg,shift:Og},{key:"Ctrl-d",run:qc},{key:"Ctrl-h",run:Wr},{key:"Ctrl-k",run:Fg},{key:"Ctrl-Alt-h",run:$c},{key:"Ctrl-o",run:Vg},{key:"Ctrl-t",run:zg},{key:"Ctrl-v",run:Fr}],Qg=[{key:"ArrowLeft",run:Ac,shift:Rc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:lg,shift:wg,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:pg,shift:Mg,preventDefault:!0},{key:"ArrowRight",run:Mc,shift:Ic,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ag,shift:kg,preventDefault:!0},{mac:"Cmd-ArrowRight",run:mg,shift:Tg,preventDefault:!0},{key:"ArrowUp",run:Oc,shift:Wc,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Yl,shift:Ql},{mac:"Ctrl-ArrowUp",run:Ul,shift:Gl},{key:"ArrowDown",run:Bc,shift:Hc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Xl,shift:Zl},{mac:"Ctrl-ArrowDown",run:Fr,shift:Jl},{key:"PageUp",run:Ul,shift:Gl},{key:"PageDown",run:Fr,shift:Jl},{key:"Home",run:dg,shift:Ag,preventDefault:!0},{key:"Mod-Home",run:Yl,shift:Ql},{key:"End",run:ug,shift:Cg,preventDefault:!0},{key:"Mod-End",run:Xl,shift:Zl},{key:"Enter",run:ea,shift:ea},{key:"Mod-a",run:Bg},{key:"Backspace",run:Wr,shift:Wr,preventDefault:!0},{key:"Delete",run:qc,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$c,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Ng,preventDefault:!0},{mac:"Mod-Backspace",run:Wg,preventDefault:!0},{mac:"Mod-Delete",run:Hg,preventDefault:!0}].concat(Xg.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Zg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cg,shift:vg},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:fg,shift:Sg},{key:"Alt-ArrowUp",run:_g},{key:"Shift-Alt-ArrowUp",run:Kg},{key:"Alt-ArrowDown",run:qg},{key:"Shift-Alt-ArrowDown",run:$g},{key:"Mod-Alt-ArrowUp",run:Pg},{key:"Mod-Alt-ArrowDown",run:Rg},{key:"Escape",run:Ig},{key:"Mod-Enter",run:Gg},{key:"Alt-l",mac:"Ctrl-l",run:Lg},{key:"Mod-i",run:Eg,preventDefault:!0},{key:"Mod-[",run:Yc},{key:"Mod-]",run:Jc},{key:"Mod-Alt-\\",run:Jg},{key:"Shift-Mod-k",run:jg},{key:"Shift-Mod-\\",run:xg},{key:"Mod-/",run:_m},{key:"Alt-A",run:Km},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yg}].concat(Qg),e0={key:"Tab",run:Jc,shift:Yc};class Xc{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=de(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Qc(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function ta(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function t0(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:t0(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function qb(n,e){return t=>{for(let i=de(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class ia{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function Ft(n){return n.selection.main.from}function Qc(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const go=ut.define();function n0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:x.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const na=new WeakMap;function s0(n){if(!Array.isArray(n))return n;let e=na.get(n);return e||na.set(n,e=i0(n)),e}const Jn=R.define(),qi=R.define();class r0{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:(C=Ea(v))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!k||S==1&&b||M==0&&S!=0)&&(t[f]==v||i[f]==v&&(u=!0)?o[f++]=k:o.length&&(y=!1)),M=S,k+=lt(v)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?lt(Be(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class o0{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:l0,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>sa(e(i),t(i)),optionClass:(e,t)=>i=>sa(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function sa(n,e){return n?e?n+" "+e:n:e}function l0(n,e,t,i,s,r){let o=n.textDirection==G.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||k>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let b=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/b}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function a0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return at.position-i.position).map(t=>t.render)}function Ns(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class h0{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(re);this.optionContent=a0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Ns(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(re).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:qi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=Ns(r.length,o,e.state.facet(re).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected=this.range.to)&&(this.range=Ns(t.options.length,t.selected,this.view.state.facet(re).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>Ae(this.view.state,l,"completion info")):(this.addInfoPane(o,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&f0(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;oi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew h0(t,n,e)}function f0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function ra(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function u0(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f=="string"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f=="string"?{name:u}:f)}},o=e.facet(re);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new ia(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new o0(u):new r0(u);for(let m of c.result.options)if(d=p.match(m.label)){let b=m.displayLabel?f?f(m,d.matched):[]:d.matched,y=d.score+(m.boost||0);if(r(new ia(m,c.source,b,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:k}=m.section;s||(s=Object.create(null)),s[k]=Math.max(y,s[k]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?s[p.name]-s[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.nameu.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):ra(c.completion)>ra(a)&&(l[l.length-1]=c),a=c.completion}return l}class Jt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Jt(this.options,oa(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=u0(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(re).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;cc.hasResult()?Math.min(h,c.from):h,1e8),create:y0,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new Jt(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Jt(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Yn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Yn(g0,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(re),r=(i.override||t.languageDataAt("autocomplete",Ft(t)).map(s0)).map(a=>(this.active.find(c=>c.source==a)||new Ve(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(bo));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!d0(r,this.active)||l?o=Jt.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Ve(a.source,0):a));for(let a of e.effects)a.is(ef)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Yn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?p0:m0}}function d0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const g0=[];function Zc(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(go);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ve{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=Zc(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Ve(s.source,0)),i&4&&s.state==0&&(s=new Ve(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(Jn))s=new Ve(s.source,1,r.value);else if(r.is(qi))s=new Ve(s.source,0);else if(r.is(bo))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Ft(e.state))}}class ti extends Ve{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Ft(e.state);if(l>o||!s||t&2&&(Ft(e.startState)==this.from||lt.map(e))}}),ef=R.define(),Se=Te.define({create(){return Yn.start()},update(n,e){return n.update(e)},provide:n=>[io.from(n,e=>e.tooltip),D.contentAttributes.from(n,e=>e.attrs)]});function yo(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Se).active.find(s=>s.source==e.source);return i instanceof ti?(typeof t=="string"?n.dispatch({...n0(n.state,t,i.from,i.to),annotations:go.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const y0=c0(Se,yo);function vn(n,e="option"){return t=>{let i=t.state.field(Se,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:ef.of(l)}),!0}}const tf=n=>{let e=n.state.field(Se,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Se,!1)?(n.dispatch({effects:Jn.of(!0)}),!0):!1,x0=n=>{let e=n.state.field(Se,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:qi.of(null)}),!0)};class w0{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const k0=50,v0=1e3,S0=ue.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Se).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Se),t=n.state.facet(re);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Se)==e)return;let i=n.transactions.some(r=>{let o=Zc(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rk0&&Date.now()-o.time>v0){for(let l of o.context.abortListeners)try{l()}catch(a){Ae(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Jn)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Se);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(re).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Ft(e),i=new Xc(e,t,n.explicit,this.view),s=new w0(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qi.of(null)}),Ae(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(re).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(re),i=this.view.state.field(Se);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ve(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:bo.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Se,!1);if(e&&e.tooltip&&this.view.state.facet(re).closeOnBlur){let t=e.open&&_h(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Jn.of(!1)}),20),this.composing=0}}}),C0=typeof navigator=="object"&&/Win/.test(navigator.platform),A0=qt.highest(D.domEventHandlers({keydown(n,e){let t=e.state.field(Se,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(C0&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&yo(e,i),!1}})),nf=D.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class M0{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class xo{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new xo(this.field,t,i)}}class wo{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew xo(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1,c=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||"").length:2;f.from-=u,f.to-=u}s.push(new M0(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new wo(i,s)}}let T0=I.widget({widget:new class extends Ue{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),D0=I.mark({class:"cm-snippetField"});class di{constructor(e,t){this.ranges=e,this.active=t,this.deco=I.set(e.map(i=>(i.from==i.to?T0:D0).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new di(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const tn=R.define({map(n,e){return n&&n.map(e)}}),O0=R.define(),Ki=Te.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(tn))return t.value;if(t.is(O0)&&n)return new di(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>D.decorations.from(n,e=>e?e.deco:I.none)});function ko(n,e){return x.create(n.filter(t=>t.field==e).map(t=>x.range(t.from,t.to)))}function B0(n){let e=wo.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:z.of(o)},scrollIntoView:!0,annotations:i?[go.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=ko(l,0)),l.some(c=>c.field>0)){let c=new di(l,0),f=h.effects=[tn.of(c)];t.state.field(Ki,!1)===void 0&&f.push(R.appendConfig.of([Ki,I0,N0,nf]))}t.dispatch(t.state.update(h))}}function sf(n){return({state:e,dispatch:t})=>{let i=e.field(Ki,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:ko(i.ranges,s),effects:tn.of(r?null:new di(i.ranges,s)),scrollIntoView:!0})),!0}}const L0=({state:n,dispatch:e})=>n.field(Ki,!1)?(e(n.update({effects:tn.of(null)})),!0):!1,E0=sf(1),P0=sf(-1),R0=[{key:"Tab",run:E0,shift:P0},{key:"Escape",run:L0}],la=O.define({combine(n){return n.length?n[0]:R0}}),I0=qt.highest(Xi.compute([la],n=>n.facet(la)));function Kb(n,e){return{...e,apply:B0(n)}}const N0=D.domEventHandlers({mousedown(n,e){let t=e.state.field(Ki,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:ko(t.ranges,s.field),effects:tn.of(t.ranges.some(r=>r.field>s.field)?new di(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),$i={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Nt=R.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),vo=new class extends xt{};vo.startSide=1;vo.endSide=-1;const rf=Te.define({create(){return W.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(Nt)&&(n=n.update({add:[vo.range(t.value,t.value+1)]}));return n}});function F0(){return[H0,rf]}const Ws="()[]{}<>«»»«[]{}";function of(n){for(let e=0;e{if((W0?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&<(Be(i,0))==1||e!=s.from||t!=s.to)return!1;let r=_0(n.state,i);return r?(n.dispatch(r),!0):!1}),V0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=lf(n,n.selection.main.head).brackets||$i.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=q0(n.doc,o.head);for(let a of i)if(a==l&&fs(n.doc,o.head)==of(Be(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:x.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},z0=[{key:"Backspace",run:V0}];function _0(n,e){let t=lf(n,n.selection.main.head),i=t.brackets||$i.brackets;for(let s of i){let r=of(Be(s,0));if(e==s)return r==s?j0(n,s,i.indexOf(s+s+s)>-1,t):K0(n,s,r,t.before||$i.before);if(e==r&&af(n,n.selection.main.from))return $0(n,s,r)}return null}function af(n,e){let t=!1;return n.field(rf).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function fs(n,e){let t=n.sliceString(e,e+2);return t.slice(0,lt(Be(t,0)))}function q0(n,e){let t=n.sliceString(e-2,e);return lt(Be(t,0))==t.length?t:t.slice(1)}function K0(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Nt.of(o.to+e.length),range:x.range(o.anchor+e.length,o.head+e.length)};let l=fs(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Nt.of(o.head+e.length),range:x.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function $0(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&fs(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:x.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function j0(n,e,t,i){let s=i.stringPrefixes||$i.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Nt.of(l.to+e.length),range:x.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=fs(n.doc,a),c;if(h==e){if(aa(n,a))return{changes:{insert:e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)};if(af(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:x.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=ha(n,a-2*e.length,s))>-1&&aa(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=Ie.Word&&ha(n,a,s)>-1&&!U0(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Nt.of(a+e.length),range:x.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function aa(n,e){let t=de(n).resolveInner(e+1);return t.parent&&t.from==e}function U0(n,e,t,i){let s=de(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function ha(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Ie.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=Ie.Word)return r}return-1}function G0(n={}){return[A0,Se,re.of(n),S0,J0,nf]}const hf=[{key:"Ctrl-Space",run:Fs},{mac:"Alt-`",run:Fs},{mac:"Alt-i",run:Fs},{key:"Escape",run:x0},{key:"ArrowDown",run:vn(!0)},{key:"ArrowUp",run:vn(!1)},{key:"PageDown",run:vn(!0,"page")},{key:"PageUp",run:vn(!1,"page")},{key:"Enter",run:tf}],J0=qt.highest(Xi.computeN([re],n=>n.facet(re).defaultKeymap?[hf]:[])),Y0="#2E3235",et="#DDDDDD",Li="#B9D2FF",Sn="#b0b0b0",X0="#e0e0e0",cf="#808080",Hs="#000000",Q0="#A54543",ff="#fc6d24",Ot="#fda331",Vs="#8abeb7",ca="#b5bd68",xi="#6fb3d2",wi="#cc99cc",Z0="#6987AF",fa=ff,ua="#292d30",Cn=Li+"30",eb=Y0,zs=et,tb="#202325",da=et,ib=D.theme({"&":{color:et,backgroundColor:eb},".cm-content":{caretColor:da},".cm-cursor, .cm-dropCursor":{borderLeftColor:da},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:tb},".cm-panels":{backgroundColor:ua,color:Sn},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Li,outline:`1px solid ${Sn}`,color:Hs},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:X0,color:Hs},".cm-activeLine":{backgroundColor:Cn},".cm-selectionMatch":{backgroundColor:Cn},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Sn}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Li,color:Hs},".cm-gutters":{borderRight:"1px solid #ffffff10",color:cf,backgroundColor:ua},".cm-activeLineGutter":{backgroundColor:Cn},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Li},".cm-tooltip":{border:"none",backgroundColor:zs},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:zs,borderBottomColor:zs},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Cn,color:Sn}}},{dark:!0}),nb=fi.define([{tag:g.keyword,color:Ot},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:ca},{tag:[g.variableName],color:xi},{tag:[g.function(g.variableName)],color:Ot},{tag:[g.labelName],color:ff},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:Ot},{tag:[g.definition(g.name),g.separator],color:wi},{tag:[g.brace],color:wi},{tag:[g.annotation],color:fa},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:Ot},{tag:[g.typeName,g.className],color:xi},{tag:[g.operator,g.operatorKeyword],color:wi},{tag:[g.tagName],color:Ot},{tag:[g.squareBracket],color:wi},{tag:[g.angleBracket],color:wi},{tag:[g.attributeName],color:xi},{tag:[g.regexp],color:Ot},{tag:[g.quote],color:et},{tag:[g.string],color:ca},{tag:g.link,color:Z0,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[g.url,g.escape,g.special(g.string)],color:Vs},{tag:[g.meta],color:Q0},{tag:[g.comment],color:cf,fontStyle:"italic"},{tag:g.monospace,color:et},{tag:g.strong,fontWeight:"bold",color:Ot},{tag:g.emphasis,fontStyle:"italic",color:xi},{tag:g.strikethrough,textDecoration:"line-through"},{tag:g.heading,fontWeight:"bold",color:et},{tag:g.special(g.heading1),fontWeight:"bold",color:et},{tag:g.heading1,fontWeight:"bold",color:et},{tag:[g.heading2,g.heading3,g.heading4],fontWeight:"bold",color:et},{tag:[g.heading5,g.heading6],color:et},{tag:[g.atom,g.bool,g.special(g.variableName)],color:Vs},{tag:[g.processingInstruction,g.inserted],color:Vs},{tag:[g.contentSeparator],color:xi},{tag:g.invalid,color:Li,borderBottom:`1px dotted ${fa}`}]),sb=[ib,ho(nb)],pa="#2e3440",So="#3b4252",ma="#434c5e",An="#4c566a",ga="#e5e9f0",Hr="#eceff4",_s="#8fbcbb",ba="#88c0d0",rb="#81a1c1",qe="#5e81ac",ob="#bf616a",$t="#d08770",qs="#ebcb8b",ya="#a3be8c",lb="#b48ead",xa="#d30102",Co=Hr,Ks=Co,ab="#ffffff",$s=So,hb=Co,wa=So,cb=D.theme({"&":{color:pa,backgroundColor:ab},".cm-content":{caretColor:wa},".cm-cursor, .cm-dropCursor":{borderLeftColor:wa},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:hb},".cm-panels":{backgroundColor:Co,color:An},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${An}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ga},".cm-activeLine":{backgroundColor:Ks},".cm-selectionMatch":{backgroundColor:ga},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${An}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Hr},".cm-gutters":{backgroundColor:Hr,color:pa,border:"none"},".cm-activeLineGutter":{backgroundColor:Ks},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:$s},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:$s,borderBottomColor:$s},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ks,color:An}}},{dark:!1}),fb=fi.define([{tag:g.keyword,color:qe},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:$t},{tag:[g.variableName],color:$t},{tag:[g.function(g.variableName)],color:qe},{tag:[g.labelName],color:rb},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:qe},{tag:[g.definition(g.name),g.separator],color:ya},{tag:[g.brace],color:_s},{tag:[g.annotation],color:xa},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:ba},{tag:[g.typeName,g.className],color:qs},{tag:[g.operator,g.operatorKeyword],color:ya},{tag:[g.tagName],color:lb},{tag:[g.squareBracket],color:ob},{tag:[g.angleBracket],color:$t},{tag:[g.attributeName],color:qs},{tag:[g.regexp],color:qe},{tag:[g.quote],color:So},{tag:[g.string],color:$t},{tag:g.link,color:_s,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[g.url,g.escape,g.special(g.string)],color:$t},{tag:[g.meta],color:ba},{tag:[g.comment],color:ma,fontStyle:"italic"},{tag:g.strong,fontWeight:"bold",color:qe},{tag:g.emphasis,fontStyle:"italic",color:qe},{tag:g.strikethrough,textDecoration:"line-through"},{tag:g.heading,fontWeight:"bold",color:qe},{tag:g.special(g.heading1),fontWeight:"bold",color:qe},{tag:g.heading1,fontWeight:"bold",color:qe},{tag:[g.heading2,g.heading3,g.heading4],fontWeight:"bold",color:qe},{tag:[g.heading5,g.heading6],color:qe},{tag:[g.atom,g.bool,g.special(g.variableName)],color:$t},{tag:[g.processingInstruction,g.inserted],color:_s},{tag:[g.contentSeparator],color:qs},{tag:g.invalid,color:ma,borderBottom:`1px dotted ${xa}`}]),ub=[cb,ho(fb)];class ka{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Et{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(ji).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new wt,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let m,b;if(l.length)m=a,b=l.reduce((w,M)=>Math.min(w,M.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;b=p.to,l.push(p),d++}for(;dw.from||w.to==m))l.push(w),d++,b=Math.min(w.to,b);else{b=Math.min(w.from,b);break}}b=Math.min(b,f);let y=!1;if(l.some(w=>w.from==m&&(w.to==b||b==f))&&(y=m==b,!y&&b-m<10)){let w=m-(c+h.value.length);w>0&&(h.next(w),c=m);for(let M=m;;){if(M>=b){y=!0;break}if(!h.lineBreak&&c+h.value.length>M)break;M=c+h.value.length,c+=h.value.length,h.next()}}let k=Ab(l);if(y)o.add(m,m,I.widget({widget:new kb(k),diagnostics:l.slice()}));else{let w=l.reduce((M,v)=>v.markClass?M+" "+v.markClass:M,"");o.add(m,b,I.mark({class:"cm-lintRange cm-lintRange-"+k+w,diagnostics:l.slice(),inclusiveEnd:l.some(M=>M.to>b)}))}if(a=b,a==f)break;for(let w=0;w{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new ka(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new ka(i.from,r,i.diagnostic)}}),i}function db(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(ji).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(uf))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function pb(n,e){return n.field(Le,!1)?e:e.concat(R.appendConfig.of(Mb))}const uf=R.define(),Ao=R.define(),df=R.define(),Le=Te.define({create(){return new Et(I.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=hi(t,n.selected.diagnostic,r)||hi(t,null,r)}!t.size&&s&&e.state.facet(ji).autoPanel&&(s=null),n=new Et(t,s,i)}for(let t of e.effects)if(t.is(uf)){let i=e.state.facet(ji).autoPanel?t.value.length?Ui.open:null:n.panel;n=Et.init(t.value,i,e.state)}else t.is(Ao)?n=new Et(n.diagnostics,t.value?Ui.open:null,n.selected):t.is(df)&&(n=new Et(n.diagnostics,n.panel,t.value));return n},provide:n=>[Mr.from(n,e=>e.panel),D.decorations.from(n,e=>e.diagnostics)]}),mb=I.mark({class:"cm-lintRange cm-lintRange-active"});function gb(n,e,t){let{diagnostics:i}=n.state.field(Le),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(emf(n,t,!1)))}const yb=n=>{let e=n.state.field(Le,!1);(!e||!e.panel)&&n.dispatch({effects:pb(n.state,[Ao.of(!0)])});let t=wp(n,Ui.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},va=n=>{let e=n.state.field(Le,!1);return!e||!e.panel?!1:(n.dispatch({effects:Ao.of(!1)}),!0)},xb=n=>{let e=n.state.field(Le,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},wb=[{key:"Mod-Shift-m",run:yb,preventDefault:!0},{key:"F8",run:xb}],ji=O.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Kt(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Sa,tooltipFilter:Sa,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function Sa(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function pf(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function mf(n,e,t){var i;let s=t?pf(e.actions):[];return it("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},it("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=hi(n.state.field(Le).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),it("u",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?" "+r.markClass:"";return it("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&it("div",{class:"cm-diagnosticSource"},e.source))}class kb extends Ue{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return it("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Ca{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=mf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ui{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)va(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=pf(r.actions);for(let l=0;l{for(let r=0;rva(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Le).selected;if(!e)return-1;for(let t=0;t{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;di&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Le),i=hi(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:df.of(i)})}static open(e){return new Ui(e)}}function vb(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function Mn(n){return vb(``,'width="6" height="3"')}const Sb=D.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Mn("#d11")},".cm-lintRange-warning":{backgroundImage:Mn("orange")},".cm-lintRange-info":{backgroundImage:Mn("#999")},".cm-lintRange-hint":{backgroundImage:Mn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Cb(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function Ab(n){let e="hint",t=1;for(let i of n){let s=Cb(i.severity);s>t&&(t=s,e=i.severity)}return e}const Mb=[Le,D.decorations.compute([Le],n=>{let{selected:e,panel:t}=n.field(Le);return!e||!t||e.from==e.to?I.none:I.set([mb.range(e.from,e.to)])}),yp(gb,{hideOn:db}),Sb],Tb=[Yd(),Xm(),Am(),zd(),V.allowMultipleSelections.of(!0),fm(),ho(Om,{fallback:!0}),F0(),lp(),cp(),Xi.of([...z0,...Zg,...og,...km,...hf,...wb])],Db=["standardSQL","msSQL","mySQL","mariaDB","sqlite","cassandra","plSQL","hive","pgSQL","gql","gpSQL","sparkSQL","esper"],Aa={python:()=>se(()=>import("./index-Da12lcVQ.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(n=>n.python()),c:()=>se(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>Pe.define(n.c)),cpp:()=>se(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>Pe.define(n.cpp)),markdown:async()=>{const[n,e]=await Promise.all([se(()=>import("./index-CMkuetrL.js"),__vite__mapDeps([6,7,1,8,2,3,4,5,9]),import.meta.url),se(()=>import("./frontmatter-DFhL0tR6.js"),__vite__mapDeps([10,11,2,3,4,5]),import.meta.url)]);return n.markdown({extensions:[e.frontmatter]})},latex:()=>se(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>Pe.define(n.stex)),json:()=>se(()=>import("./index-CS53mDTO.js"),__vite__mapDeps([12,1,2,3,4,5]),import.meta.url).then(n=>n.json()),html:()=>se(()=>import("./index-CT3x8rMt.js"),__vite__mapDeps([7,1,8,2,3,4,5,9]),import.meta.url).then(n=>n.html()),css:()=>se(()=>import("./index-1sy099a6.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url).then(n=>n.css()),javascript:()=>se(()=>import("./index-DUkLrOoz.js"),__vite__mapDeps([9,1,2,3,4,5]),import.meta.url).then(n=>n.javascript()),jinja2:()=>se(()=>import("./jinja2-C4DGRd-O.js"),[],import.meta.url).then(n=>Pe.define(n.jinja2)),typescript:()=>se(()=>import("./index-DUkLrOoz.js"),__vite__mapDeps([9,1,2,3,4,5]),import.meta.url).then(n=>n.javascript({typescript:!0})),yaml:()=>se(()=>import("./yaml-DsCXHVTH.js"),[],import.meta.url).then(n=>Pe.define(n.yaml)),dockerfile:()=>se(()=>import("./dockerfile-ZL4hHokT.js"),[],import.meta.url).then(n=>Pe.define(n.dockerFile)),shell:()=>se(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>Pe.define(n.shell)),r:()=>se(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>Pe.define(n.r)),sql:()=>se(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>Pe.define(n.standardSQL)),...Object.fromEntries(Db.map(n=>["sql-"+n,()=>se(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>Pe.define(e[n]))]))},Ob={py:"python",md:"markdown",js:"javascript",ts:"typescript",sh:"shell"};async function Bb(n){const e=Aa[n]||Aa[Ob[n]]||void 0;if(e)return e()}var Lb=Mf('
');function $b(n,e){yf(e,!0);let t=Ee(e,"class_names",3,""),i=Ee(e,"value",15,""),s=Ee(e,"basic",3,!0),r=Ee(e,"lines",3,5),o=Ee(e,"max_lines",3,null),l=Ee(e,"extensions",19,()=>[]),a=Ee(e,"use_tab",3,!0),h=Ee(e,"readonly",3,!1),c=Ee(e,"placeholder",3,void 0),f=Ee(e,"wrap_lines",3,!1),u=Ee(e,"show_line_numbers",3,!0),d=Ee(e,"autocomplete",3,!1),p=Sf(void 0),m,b;async function y(E){const X=await Bb(E);Cf(p,X,!0)}us(()=>{y(e.language)}),us(()=>{To(p),h(),be()}),us(()=>{k(i())}),w();function k(E){b&&E!==b.state.doc.toString()&&b.dispatch({changes:{from:0,to:b.state.doc.length,insert:E}})}function w(){b&&b.requestMeasure({read:L})}function M(){const E=new D({parent:m,state:H(i())});return E.dom.addEventListener("focus",v,!0),E.dom.addEventListener("blur",C,!0),E}function v(){e.onfocus?.()}function C(){e.onblur?.()}function S(E){let X=E.dom.querySelectorAll(".cm-gutterElement");if(X.length===0)return null;for(var $=0;$X.annotation(Z.userEvent)!=null)}function q(E){if(!E.docChanged)return;const $=E.state.doc.toString();i($),F(E)?(e.onchange?.($),e.oninput?.()):e.onchange?.($),b.requestMeasure({read:L})}function P(){return[...K(s(),a(),c(),h(),To(p),u()),B,...oe(),...l()]}const B=D.theme({"&":{fontSize:"var(--text-sm)",backgroundColor:"var(--border-color-secondary)"},".cm-content":{paddingTop:"5px",paddingBottom:"5px",color:"var(--body-text-color)",fontFamily:"var(--font-mono)",minHeight:"100%"},".cm-gutterElement":{marginRight:"var(--spacing-xs)"},".cm-gutters":{marginRight:"1px",borderRight:"1px solid var(--border-color-primary)",backgroundColor:"var(--block-background-fill);",color:"var(--body-text-color-subdued)"},".cm-focused":{outline:"none"},".cm-scroller":{height:"auto"},".cm-cursor":{borderLeftColor:"var(--body-text-color)"}}),_=D.theme({".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:"var(--background-fill-primary)",color:"var(--body-text-color)"},"& > ul > li[aria-selected]":{backgroundColor:"var(--color-accent-soft)",color:"var(--body-text-color)"}}});function H(E){return V.create({doc:E??void 0,extensions:P()})}function K(E,X,$,ne,De,dt){const ye=[D.editable.of(!ne),V.readOnly.of(ne),D.contentAttributes.of({"aria-label":"Code input container"})];return E&&ye.push(Tb),X&&ye.push(Xi.of([{key:"Tab",run:tf},e0])),$&&ye.push(np($)),De&&ye.push(De),dt&&ye.push(Bp()),d()&&(ye.push(G0()),ye.push(_)),ye.push(D.updateListener.of(q)),f()&&ye.push(D.lineWrapping),ye}function oe(){const E=[];return e.dark_mode?E.push(sb):E.push(ub),E}function be(){b?.dispatch({effects:R.reconfigure.of(P())})}xf(()=>(b=M(),()=>b?.destroy()));var ve=Lb(),ee=Af(ve);gf(ee,E=>m=E,()=>m),Tf(ve),wf(()=>bf(ee,1,`codemirror-wrapper ${t()??""}`,"svelte-1k1wn0u")),kf(n,ve),vf()}export{It as A,ec as B,$b as C,Lp as D,x as E,li as F,Em as G,zb as H,U as I,Vb as J,em as K,Wb as L,no as N,Jh as P,Pe as S,J as T,ke as a,N as b,_b as c,de as d,Lr as e,dm as f,tc as g,Hb as h,qb as i,Ib as j,i0 as k,Kb as l,Re as m,ci as n,qt as o,Nb as p,Xi as q,D as r,Jp as s,g as t,We as u,ss as v,um as w,Qh as x,Xc as y,V as z}; diff --git a/assets/Copy-B3jzejpA.js b/assets/Copy-eBznHIlR.js similarity index 86% rename from assets/Copy-B3jzejpA.js rename to assets/Copy-eBznHIlR.js index efa3b1bcc7d1e5b1695c53b0648ef298026a2863..b8dba3ff30afaec9760cfed26e6964042209740b 100644 --- a/assets/Copy-B3jzejpA.js +++ b/assets/Copy-eBznHIlR.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a,f as t}from"./index-DydPgVMC.js";var h=t('');function i(r){var o=h();a(r,o)}export{i as C}; +import"./i18n-DtG3MAQ1.js";import{a,f as t}from"./index-BeNBoC9J.js";var h=t('');function i(r){var o=h();a(r,o)}export{i as C}; diff --git a/assets/Download-DWSaBiea.js b/assets/Download-0gCL6VXM.js similarity index 82% rename from assets/Download-DWSaBiea.js rename to assets/Download-0gCL6VXM.js index 3f25028f83ea825d79d580cb1830c7bb07d57b69..7e7e89432509455fec15484dfc3ea81a8a4850af 100644 --- a/assets/Download-DWSaBiea.js +++ b/assets/Download-0gCL6VXM.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a,f as r}from"./index-DydPgVMC.js";var t=r('');function h(o){var v=t();a(o,v)}export{h as D}; +import"./i18n-DtG3MAQ1.js";import{a,f as r}from"./index-BeNBoC9J.js";var t=r('');function h(o){var v=t();a(o,v)}export{h as D}; diff --git a/assets/DownloadLink-DM2QmhDx.js b/assets/DownloadLink-Dk6GrGSA.js similarity index 73% rename from assets/DownloadLink-DM2QmhDx.js rename to assets/DownloadLink-Dk6GrGSA.js index 4359b754038c2fdbd1cdda24f341bef6e6c97f1e..c606d8c472ccc3f6edd9f42a5640d093c8b5ac11 100644 --- a/assets/DownloadLink-DM2QmhDx.js +++ b/assets/DownloadLink-Dk6GrGSA.js @@ -1 +1 @@ -import{l as s,p as r,e as h,c as w,s as _,S as m}from"./i18n-CPHyzK9b.js";import{M as k,a1 as g,U as y,a as b,O as $,P as d,v as D,Q as S,R as x,Z as E,a2 as L,T as P}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var T=x("");function Q(l,e){const i=s(e,["children","$$slots","$$events","$$legacy"]),c=s(i,["href","download"]);k(e,!1);let o=r(e,"href",12,void 0),n=r(e,"download",12);const f=g();var p={get href(){return o()},set href(t){o(t),d()},get download(){return n()},set download(t){n(t),d()}};h();var a=T(),u=L(()=>f.bind(null,"click"));w(a,()=>({class:"download-link","data-testid":"download-link",href:o(),target:D(()=>typeof window<"u"&&window.__is_colab__?"_blank":null),rel:"noopener noreferrer",download:n(),...c,[m]:{position:"relative"}}),void 0,void 0,void 0,"svelte-m62ue3");var v=S(a);return _(v,e,"default",{}),P(a),y("click",a,function(...t){E(u)?.apply(this,t)}),b(l,a),$(p)}export{Q as D}; +import{l as s,p as r,e as h,c as w,s as _,S as m}from"./i18n-DtG3MAQ1.js";import{M as k,a1 as g,U as y,a as b,O as $,P as d,v as D,Q as S,R as x,Z as E,a2 as L,T as P}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var T=x("");function Q(l,e){const i=s(e,["children","$$slots","$$events","$$legacy"]),c=s(i,["href","download"]);k(e,!1);let o=r(e,"href",12,void 0),n=r(e,"download",12);const f=g();var p={get href(){return o()},set href(t){o(t),d()},get download(){return n()},set download(t){n(t),d()}};h();var a=T(),u=L(()=>f.bind(null,"click"));w(a,()=>({class:"download-link","data-testid":"download-link",href:o(),target:D(()=>typeof window<"u"&&window.__is_colab__?"_blank":null),rel:"noopener noreferrer",download:n(),...c,[m]:{position:"relative"}}),void 0,void 0,void 0,"svelte-m62ue3");var v=S(a);return _(v,e,"default",{}),P(a),y("click",a,function(...t){E(u)?.apply(this,t)}),b(l,a),$(p)}export{Q as D}; diff --git a/assets/Dropdown-CVRP4i7q.js b/assets/Dropdown-D5-31HWl.js similarity index 92% rename from assets/Dropdown-CVRP4i7q.js rename to assets/Dropdown-D5-31HWl.js index 52134dd4480ed6d6e49bbf5f2f44df1dfc6ea517..8e66056c1390d8f8217fd412ae39d6d384ee9693 100644 --- a/assets/Dropdown-CVRP4i7q.js +++ b/assets/Dropdown-D5-31HWl.js @@ -1 +1 @@ -import{p as s,d as ue,i as de,q as xe,b as K,a as O,f as _e,w as Ae,v as ze}from"./i18n-CPHyzK9b.js";import{M as be,ac as ae,Z as e,$ as t,U as oe,N as De,a as Q,O as he,aa as v,au as Oe,S as P,R as V,ah as we,Q as M,T as S,t as ie,X as ge,av as Te,ab as ve,a4 as Ee,a2 as J,G as Be,ar as Ce,a5 as Ue}from"./index-DydPgVMC.js";import{b as Ie}from"./input-BtIxlP_B.js";import{t as Ne,a as Re}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{b as Se}from"./window-D5YXrKnH.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as qe}from"./BlockTitle-DNiCHWOR.js";import{D as He}from"./DropdownArrow-Cq3QAKSv.js";import{I as Le}from"./IconButtonWrapper-PnNNNvqI.js";var Ge=V('
  • '),Me=V('
      '),Pe=V('
      ',1);function Qe(p,l){be(l,!0);let u=s(l,"show_options",3,!1),B=s(l,"disabled",3,!1),k=s(l,"selected_indices",19,()=>[]),W=s(l,"active_index",3,null),m=s(l,"remember_scroll",3,!1),b=s(l,"offset_from_top",3,0),Y=s(l,"from_top",3,!1),q=s(l,"listbox_id",3,void 0),C=v(0),T=v(0),H=v(0),U=v(0),I,h,N=v(null),c=v(null),A=v(0),E=v(0),a=0;function o(){const{top:w,bottom:_}=I.getBoundingClientRect();Y()?t(C,b()):t(C,w,!0),t(T,e(E)-_)}let z=null;function X(){u()&&(z!==null&&clearTimeout(z),z=setTimeout(()=>{o(),z=null},10))}function re(){h?.scrollTo?.(0,a)}ae(()=>{if(u()&&I){if(m())re();else if(h&&k().length>0){let _=h.querySelectorAll("li");for(const R of Array.from(_))if(R.getAttribute("data-index")===k()[0].toString()){h?.scrollTo?.(0,R.offsetTop);break}}o();const w=I.parentElement?.getBoundingClientRect();t(H,w?.height||0,!0),t(U,w?.width||0,!0),l.onload?.()}e(T)>e(C)||Y()?(t(N,`${e(C)}px`),t(A,e(T),!0),t(c,null)):(t(c,`${e(T)+e(H)}px`),t(A,e(C)-e(H)),t(N,null))});var L=Pe();oe("scroll",Oe,X);var f=De(L);ue(f,w=>I=w,()=>I);var i=P(f,2);{var se=w=>{var _=Me();_.__mousedown=D=>{D.preventDefault(),l.onchange?.(D.target.dataset.index)};let R;xe(_,21,()=>l.filtered_indices,Ae,(D,y)=>{var g=Ge();let Z,j;var $=M(g);let F;var ee=P($);S(g),ie((G,te,le)=>{Z=K(g,1,"item svelte-1auz4p0",null,Z,G),O(g,"data-index",e(y)),O(g,"id",q()?`${q()}-option-${e(y)}`:void 0),O(g,"aria-label",l.choices[e(y)][0]),O(g,"aria-selected",te),j=_e(g,"",j,{width:e(U)+"px"}),F=K($,1,"inner-item svelte-1auz4p0",null,F,le),ge(ee,` ${l.choices[e(y)][0]??""}`)},[()=>({selected:k().includes(e(y)),active:e(y)===W(),"bg-gray-100":e(y)===W(),"dark:bg-gray-600":e(y)===W()}),()=>k().includes(e(y)),()=>({hide:!k().includes(e(y))})]),Q(D,g)}),S(_),ue(_,D=>h=D,()=>h),ie(()=>{O(_,"id",q()),R=_e(_,"",R,{top:e(N),bottom:e(c),"max-height":`calc(${e(A)}px - var(--window-padding))`,width:e(U)+"px"})}),oe("scroll",_,D=>a=D.currentTarget.scrollTop),Ne(3,_,()=>Re,()=>({duration:200,y:5})),Q(w,_)};de(i,w=>{u()&&!B()&&w(se)})}Se("innerHeight",w=>t(E,w,!0)),Q(p,L),he()}we(["mousedown"]);function We(p,l){return(p%l+l)%l}function me(p,l){return p.reduce((u,B,k)=>((!l||B[0].toLowerCase().includes(l.toLowerCase()))&&u.push(k),u),[])}function Xe(p,l,u){if(p.key==="Escape")return[!1,l];if((p.key==="ArrowDown"||p.key==="ArrowUp")&&u.length>0)if(l===null)l=p.key==="ArrowDown"?u[0]:u[u.length-1];else{const B=u.indexOf(l),k=p.key==="ArrowUp"?-1:1;l=u[We(B+k,u.length)]}return[!0,l]}var Ze=V('
      '),je=V('
      ');function nt(p,l){const u=Te();be(l,!0);const B=typeof window<"u";let k=s(l,"label",3,"Dropdown"),W=s(l,"info",3,void 0),m=s(l,"value",15),b=s(l,"choices",19,()=>[]),Y=s(l,"interactive",3,!0),q=s(l,"show_label",3,!0),C=s(l,"container",3,!0),T=s(l,"allow_custom_value",3,!1),H=s(l,"filterable",3,!0),U=s(l,"buttons",3,null),I=s(l,"oncustom_button_click",3,null),h;const N=`${u}-options`;let c=J(()=>B&&h===document.activeElement),A=J(()=>b().map(n=>n[0])),E=J(()=>b().map(n=>n[1])),a=v(""),o=v(null),z=e(a),X=v(!1);ae(()=>{const n=m(),r=e(E),x=e(A);e(X)||(n==null||Array.isArray(n)&&n.length===0?(t(a,""),t(o,null)):r.includes(n)?(t(a,x[r.indexOf(n)],!0),t(o,r.indexOf(n),!0)):T()?(t(a,n,!0),t(o,null)):(t(a,""),t(o,null)),z=e(a))});let re=v(!1),L=J(()=>!Y()),f=v(ve(b().map((n,r)=>r))),i=v(null),se=J(()=>e(o)===null?[]:[e(o)]);ae(()=>{b(),t(f,b().map((n,r)=>r),!0)});function w(n){if(t(o,parseInt(n),!0),isNaN(e(o))){t(o,null);return}let[r,x]=b()[e(o)];t(a,r,!0),z=e(a),m(x),l.on_select?.({index:e(o),value:e(E)[e(o)],selected:!0}),t(c,!1),t(i,null),l.on_input?.(),h.blur()}function _(n){t(X,!0),t(f,b().map((r,x)=>x),!0),t(i,e(o),!0),t(c,!0),l.on_focus?.()}function R(){T()?e(a)!==z&&(e(A).includes(e(a))?(t(o,e(A).indexOf(e(a)),!0),m(e(E)[e(o)])):(m(e(a)),t(o,null))):t(a,e(A)[e(E).indexOf(m())],!0),t(c,!1),t(i,null),t(f,b().map((n,r)=>r),!0),t(X,!1),l.on_blur?.(),l.on_input?.()}async function D(n){await Be();const r=n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Enter"||n.key==="Escape",x=e(a)!==z;r?(t(f,x?me(b(),e(a)):b().map((fe,ne)=>ne),!0),e(i)!==null&&!e(f).includes(e(i))&&t(i,e(f).length>0?e(f)[0]:null,!0)):(t(f,me(b(),e(a)),!0),t(i,e(f).length>0?e(f)[0]:null,!0)),(fe=>{var ne=Ce(fe,2);t(c,ne[0]),t(i,ne[1],!0)})(Xe(n,e(i),e(f))),n.key==="Enter"&&(z=e(a),e(i)!==null?(t(o,e(i),!0),m(e(E)[e(i)]),t(c,!1),h.blur(),t(i,null)):e(A).includes(e(a))?(t(o,e(A).indexOf(e(a)),!0),m(e(E)[e(o)]),t(c,!1),t(i,null),h.blur()):T()&&(m(e(a)),t(o,null),t(c,!1),t(i,null),h.blur()))}let y=v(ve(m()));ae(()=>{e(y)!==m()&&(t(y,m(),!0),l.on_change?.(m()))});var g=je();let Z;var j=M(g);{var $=n=>{Le(n,{get buttons(){return U()},get on_custom_button_click(){return I()}})};de(j,n=>{q()&&U()&&U().length>0&&n($)})}var F=P(j,2);qe(F,{get show_label(){return q()},get info(){return W()},children:(n,r)=>{Ue();var x=Ee();ie(()=>ge(x,k())),Q(n,x)},$$slots:{default:!0}});var ee=P(F,2),G=M(ee);let te;var le=M(G),d=M(le);ze(d);let ce;d.__keydown=D,d.__keyup=n=>{l.on_key_up?.({key:n.key,input_value:e(a)})},ue(d,n=>h=n,()=>h);var pe=P(d,2);{var ye=n=>{var r=Ze(),x=M(r);He(x),S(r),Q(n,r)};de(pe,n=>{e(L)||n(ye)})}S(le),S(G);var ke=P(G,2);Qe(ke,{get show_options(){return e(c)},get choices(){return b()},get filtered_indices(){return e(f)},get disabled(){return e(L)},get selected_indices(){return e(se)},get active_index(){return e(i)},get listbox_id(){return N},onchange:w,onload:()=>t(re,!0)}),S(ee),S(g),ie(n=>{Z=K(g,1,"svelte-zf372m",null,Z,{container:C()}),te=K(G,1,"wrap-inner svelte-zf372m",null,te,{show_options:e(c)}),O(d,"aria-controls",N),O(d,"aria-expanded",e(c)),O(d,"aria-activedescendant",e(c)&&e(i)!==null?`${N}-option-${e(i)}`:void 0),O(d,"aria-autocomplete",H()?"list":"none"),O(d,"aria-label",k()),ce=K(d,1,"border-none svelte-zf372m",null,ce,n),d.disabled=e(L),d.readOnly=!H()},[()=>({subdued:!e(A).includes(e(a))&&!T()})]),oe("blur",d,R),oe("focus",d,_),Ie(d,()=>e(a),n=>t(a,n)),Q(p,g),he()}we(["keydown","keyup"]);export{Qe as D,me as a,nt as b,Xe as h}; +import{p as s,d as ue,i as de,q as xe,b as K,a as O,f as _e,w as Ae,v as ze}from"./i18n-DtG3MAQ1.js";import{M as be,ac as ae,Z as e,$ as t,U as oe,N as De,a as Q,O as he,aa as v,au as Oe,S as P,R as V,ah as we,Q as M,T as S,t as ie,X as ge,av as Te,ab as ve,a4 as Ee,a2 as J,G as Be,ar as Ce,a5 as Ue}from"./index-BeNBoC9J.js";import{b as Ie}from"./input-BLFxNjIx.js";import{t as Ne,a as Re}from"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{b as Se}from"./window-ChwzOWAi.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as qe}from"./BlockTitle-B6Pgijwb.js";import{D as He}from"./DropdownArrow-C0w6FgSo.js";import{I as Le}from"./IconButtonWrapper-Ce5bzAyh.js";var Ge=V('
    • '),Me=V('
        '),Pe=V('
        ',1);function Qe(p,l){be(l,!0);let u=s(l,"show_options",3,!1),B=s(l,"disabled",3,!1),k=s(l,"selected_indices",19,()=>[]),W=s(l,"active_index",3,null),m=s(l,"remember_scroll",3,!1),b=s(l,"offset_from_top",3,0),Y=s(l,"from_top",3,!1),q=s(l,"listbox_id",3,void 0),C=v(0),T=v(0),H=v(0),U=v(0),I,h,N=v(null),c=v(null),A=v(0),E=v(0),a=0;function o(){const{top:w,bottom:_}=I.getBoundingClientRect();Y()?t(C,b()):t(C,w,!0),t(T,e(E)-_)}let z=null;function X(){u()&&(z!==null&&clearTimeout(z),z=setTimeout(()=>{o(),z=null},10))}function re(){h?.scrollTo?.(0,a)}ae(()=>{if(u()&&I){if(m())re();else if(h&&k().length>0){let _=h.querySelectorAll("li");for(const R of Array.from(_))if(R.getAttribute("data-index")===k()[0].toString()){h?.scrollTo?.(0,R.offsetTop);break}}o();const w=I.parentElement?.getBoundingClientRect();t(H,w?.height||0,!0),t(U,w?.width||0,!0),l.onload?.()}e(T)>e(C)||Y()?(t(N,`${e(C)}px`),t(A,e(T),!0),t(c,null)):(t(c,`${e(T)+e(H)}px`),t(A,e(C)-e(H)),t(N,null))});var L=Pe();oe("scroll",Oe,X);var f=De(L);ue(f,w=>I=w,()=>I);var i=P(f,2);{var se=w=>{var _=Me();_.__mousedown=D=>{D.preventDefault(),l.onchange?.(D.target.dataset.index)};let R;xe(_,21,()=>l.filtered_indices,Ae,(D,y)=>{var g=Ge();let Z,j;var $=M(g);let F;var ee=P($);S(g),ie((G,te,le)=>{Z=K(g,1,"item svelte-1auz4p0",null,Z,G),O(g,"data-index",e(y)),O(g,"id",q()?`${q()}-option-${e(y)}`:void 0),O(g,"aria-label",l.choices[e(y)][0]),O(g,"aria-selected",te),j=_e(g,"",j,{width:e(U)+"px"}),F=K($,1,"inner-item svelte-1auz4p0",null,F,le),ge(ee,` ${l.choices[e(y)][0]??""}`)},[()=>({selected:k().includes(e(y)),active:e(y)===W(),"bg-gray-100":e(y)===W(),"dark:bg-gray-600":e(y)===W()}),()=>k().includes(e(y)),()=>({hide:!k().includes(e(y))})]),Q(D,g)}),S(_),ue(_,D=>h=D,()=>h),ie(()=>{O(_,"id",q()),R=_e(_,"",R,{top:e(N),bottom:e(c),"max-height":`calc(${e(A)}px - var(--window-padding))`,width:e(U)+"px"})}),oe("scroll",_,D=>a=D.currentTarget.scrollTop),Ne(3,_,()=>Re,()=>({duration:200,y:5})),Q(w,_)};de(i,w=>{u()&&!B()&&w(se)})}Se("innerHeight",w=>t(E,w,!0)),Q(p,L),he()}we(["mousedown"]);function We(p,l){return(p%l+l)%l}function me(p,l){return p.reduce((u,B,k)=>((!l||B[0].toLowerCase().includes(l.toLowerCase()))&&u.push(k),u),[])}function Xe(p,l,u){if(p.key==="Escape")return[!1,l];if((p.key==="ArrowDown"||p.key==="ArrowUp")&&u.length>0)if(l===null)l=p.key==="ArrowDown"?u[0]:u[u.length-1];else{const B=u.indexOf(l),k=p.key==="ArrowUp"?-1:1;l=u[We(B+k,u.length)]}return[!0,l]}var Ze=V('
        '),je=V('
        ');function nt(p,l){const u=Te();be(l,!0);const B=typeof window<"u";let k=s(l,"label",3,"Dropdown"),W=s(l,"info",3,void 0),m=s(l,"value",15),b=s(l,"choices",19,()=>[]),Y=s(l,"interactive",3,!0),q=s(l,"show_label",3,!0),C=s(l,"container",3,!0),T=s(l,"allow_custom_value",3,!1),H=s(l,"filterable",3,!0),U=s(l,"buttons",3,null),I=s(l,"oncustom_button_click",3,null),h;const N=`${u}-options`;let c=J(()=>B&&h===document.activeElement),A=J(()=>b().map(n=>n[0])),E=J(()=>b().map(n=>n[1])),a=v(""),o=v(null),z=e(a),X=v(!1);ae(()=>{const n=m(),r=e(E),x=e(A);e(X)||(n==null||Array.isArray(n)&&n.length===0?(t(a,""),t(o,null)):r.includes(n)?(t(a,x[r.indexOf(n)],!0),t(o,r.indexOf(n),!0)):T()?(t(a,n,!0),t(o,null)):(t(a,""),t(o,null)),z=e(a))});let re=v(!1),L=J(()=>!Y()),f=v(ve(b().map((n,r)=>r))),i=v(null),se=J(()=>e(o)===null?[]:[e(o)]);ae(()=>{b(),t(f,b().map((n,r)=>r),!0)});function w(n){if(t(o,parseInt(n),!0),isNaN(e(o))){t(o,null);return}let[r,x]=b()[e(o)];t(a,r,!0),z=e(a),m(x),l.on_select?.({index:e(o),value:e(E)[e(o)],selected:!0}),t(c,!1),t(i,null),l.on_input?.(),h.blur()}function _(n){t(X,!0),t(f,b().map((r,x)=>x),!0),t(i,e(o),!0),t(c,!0),l.on_focus?.()}function R(){T()?e(a)!==z&&(e(A).includes(e(a))?(t(o,e(A).indexOf(e(a)),!0),m(e(E)[e(o)])):(m(e(a)),t(o,null))):t(a,e(A)[e(E).indexOf(m())],!0),t(c,!1),t(i,null),t(f,b().map((n,r)=>r),!0),t(X,!1),l.on_blur?.(),l.on_input?.()}async function D(n){await Be();const r=n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Enter"||n.key==="Escape",x=e(a)!==z;r?(t(f,x?me(b(),e(a)):b().map((fe,ne)=>ne),!0),e(i)!==null&&!e(f).includes(e(i))&&t(i,e(f).length>0?e(f)[0]:null,!0)):(t(f,me(b(),e(a)),!0),t(i,e(f).length>0?e(f)[0]:null,!0)),(fe=>{var ne=Ce(fe,2);t(c,ne[0]),t(i,ne[1],!0)})(Xe(n,e(i),e(f))),n.key==="Enter"&&(z=e(a),e(i)!==null?(t(o,e(i),!0),m(e(E)[e(i)]),t(c,!1),h.blur(),t(i,null)):e(A).includes(e(a))?(t(o,e(A).indexOf(e(a)),!0),m(e(E)[e(o)]),t(c,!1),t(i,null),h.blur()):T()&&(m(e(a)),t(o,null),t(c,!1),t(i,null),h.blur()))}let y=v(ve(m()));ae(()=>{e(y)!==m()&&(t(y,m(),!0),l.on_change?.(m()))});var g=je();let Z;var j=M(g);{var $=n=>{Le(n,{get buttons(){return U()},get on_custom_button_click(){return I()}})};de(j,n=>{q()&&U()&&U().length>0&&n($)})}var F=P(j,2);qe(F,{get show_label(){return q()},get info(){return W()},children:(n,r)=>{Ue();var x=Ee();ie(()=>ge(x,k())),Q(n,x)},$$slots:{default:!0}});var ee=P(F,2),G=M(ee);let te;var le=M(G),d=M(le);ze(d);let ce;d.__keydown=D,d.__keyup=n=>{l.on_key_up?.({key:n.key,input_value:e(a)})},ue(d,n=>h=n,()=>h);var pe=P(d,2);{var ye=n=>{var r=Ze(),x=M(r);He(x),S(r),Q(n,r)};de(pe,n=>{e(L)||n(ye)})}S(le),S(G);var ke=P(G,2);Qe(ke,{get show_options(){return e(c)},get choices(){return b()},get filtered_indices(){return e(f)},get disabled(){return e(L)},get selected_indices(){return e(se)},get active_index(){return e(i)},get listbox_id(){return N},onchange:w,onload:()=>t(re,!0)}),S(ee),S(g),ie(n=>{Z=K(g,1,"svelte-zf372m",null,Z,{container:C()}),te=K(G,1,"wrap-inner svelte-zf372m",null,te,{show_options:e(c)}),O(d,"aria-controls",N),O(d,"aria-expanded",e(c)),O(d,"aria-activedescendant",e(c)&&e(i)!==null?`${N}-option-${e(i)}`:void 0),O(d,"aria-autocomplete",H()?"list":"none"),O(d,"aria-label",k()),ce=K(d,1,"border-none svelte-zf372m",null,ce,n),d.disabled=e(L),d.readOnly=!H()},[()=>({subdued:!e(A).includes(e(a))&&!T()})]),oe("blur",d,R),oe("focus",d,_),Ie(d,()=>e(a),n=>t(a,n)),Q(p,g),he()}we(["keydown","keyup"]);export{Qe as D,me as a,nt as b,Xe as h}; diff --git a/assets/DropdownArrow-C0w6FgSo.js b/assets/DropdownArrow-C0w6FgSo.js new file mode 100644 index 0000000000000000000000000000000000000000..e7458b1936997fc6fd5937b97c15c4031307634d --- /dev/null +++ b/assets/DropdownArrow-C0w6FgSo.js @@ -0,0 +1 @@ +import"./i18n-DtG3MAQ1.js";import{a as s,f as t}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var a=t('');function i(o){var r=a();s(o,r)}export{i as D}; diff --git a/assets/DropdownArrow-Cq3QAKSv.js b/assets/DropdownArrow-Cq3QAKSv.js deleted file mode 100644 index fdccfd376c539b6cbd685ea46a01c6cd4a1e29f5..0000000000000000000000000000000000000000 --- a/assets/DropdownArrow-Cq3QAKSv.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as s,f as t}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var a=t('');function i(o){var r=a();s(o,r)}export{i as D}; diff --git a/assets/EXT_lights_area-CrwQ8aUg.js b/assets/EXT_lights_area-DR-enfJq.js similarity index 93% rename from assets/EXT_lights_area-CrwQ8aUg.js rename to assets/EXT_lights_area-DR-enfJq.js index 742c13a1b6051a108f4bdbc1c056dd0bbff99e9f..ac488ddec24247ac5e1d371e052e0132caa06b6d 100644 --- a/assets/EXT_lights_area-CrwQ8aUg.js +++ b/assets/EXT_lights_area-DR-enfJq.js @@ -1 +1 @@ -import{d as L,aI as g,T as u,L as w,V as n,an as R,_ as b,s as E,R as D,C as y,bh as S,ao as B,aG as z,aH as F}from"./index-GY9JDBGV.js";import{R as x}from"./rawTexture-BDsvmix4.js";import{ArrayItem as A,GLTFLoader as C}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";async function M(){const i=new Uint16Array(16384),t=new Uint16Array(4096*4),s=await L.LoadFileAsync(L.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin")),e=new Uint16Array(s),a=e.length/8;for(let r=0;r{i._ltcTextures&&((i._ltcTextures?.LTC1).update(e[0]),(i._ltcTextures?.LTC2).update(e[1]),i.onDisposeObservable.addOnce(()=>{i._ltcTextures?.LTC1.dispose(),i._ltcTextures?.LTC2.dispose()}))}).catch(e=>{w.Error(`Area Light fail to get LTC textures data. Error: ${e}`)})}class U extends g{constructor(t,s,e,a){super(t,e,a),this.position=s,this._scene._ltcTextures||P(this._scene)}transferTexturesToEffect(t){return this._scene._ltcTextures&&(t.setTexture("areaLightsLTC1Sampler",this._scene._ltcTextures.LTC1),t.setTexture("areaLightsLTC2Sampler",this._scene._ltcTextures.LTC2)),this}prepareLightSpecificDefines(t,s){t["AREALIGHT"+s]=!0,t.AREALIGHTUSED=!0}_isReady(){return this._scene._ltcTextures?this._scene._ltcTextures.LTC1.isReady()&&this._scene._ltcTextures.LTC2.isReady():!1}}R.AddNodeConstructor("Light_Type_4",(i,t)=>()=>new l(i,n.Zero(),1,1,t));class l extends U{get width(){return this._width.x}set width(t){this._width.x=t}get height(){return this._height.y}set height(t){this._height.y=t}constructor(t,s,e,a,r,f){super(t,s,r,f),this._width=new n(e,0,0),this._height=new n(0,a,0),this._pointTransformedPosition=n.Zero(),this._pointTransformedWidth=n.Zero(),this._pointTransformedHeight=n.Zero()}getClassName(){return"RectAreaLight"}getTypeID(){return g.LIGHTTYPEID_RECT_AREALIGHT}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightWidth",4),this._uniformBuffer.addUniform("vLightHeight",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(n.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this._pointTransformedPosition),n.TransformNormalToRef(this._width,this.parent.getWorldMatrix(),this._pointTransformedWidth),n.TransformNormalToRef(this._height,this.parent.getWorldMatrix(),this._pointTransformedHeight),!0):!1}transferToEffect(t,s){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z,0,s),this._uniformBuffer.updateFloat4("vLightWidth",this._pointTransformedWidth.x/2,this._pointTransformedWidth.y/2,this._pointTransformedWidth.z/2,0,s),this._uniformBuffer.updateFloat4("vLightHeight",this._pointTransformedHeight.x/2,this._pointTransformedHeight.y/2,this._pointTransformedHeight.z/2,0,s)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-e.x,this.position.y-e.y,this.position.z-e.z,0,s),this._uniformBuffer.updateFloat4("vLightWidth",this._width.x/2,this._width.y/2,this._width.z/2,0,s),this._uniformBuffer.updateFloat4("vLightHeight",this._height.x/2,this._height.y/2,this._height.z/2,0,s)),this}transferToNodeMaterialEffect(t,s){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?t.setFloat3(s,this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z):t.setFloat3(s,this.position.x-e.x,this.position.y-e.y,this.position.z-e.z),this}}b([E()],l.prototype,"width",null);b([E()],l.prototype,"height",null);D("BABYLON.RectAreaLight",l);const c="EXT_lights_area";class v{constructor(t){this.name=c,this._loader=t,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const s=t[this.name];this._lights=s.lights,A.Assign(this._lights)}}loadNodeAsync(t,s,e){return C.LoadExtensionAsync(t,s,this.name,async(a,r)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(t,s,f=>{let h;const o=A.Get(a,this._lights,r.light),T=o.name||f.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer;const d=o.size!==void 0?o.size:1;switch(o.type){case"rect":{const _=o.rect?.aspect!==void 0?o.rect.aspect*d:d,m=d;h=new l(T,n.Zero(),_,m,this._loader.babylonScene);break}case"disk":{const _=Math.sqrt(d*d*.25*Math.PI);h=new l(T,n.Zero(),_,_,this._loader.babylonScene);break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${a}: Invalid area light type (${o.type})`)}h._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,o._babylonLight=h,h.falloffType=g.FALLOFF_GLTF,h.diffuse=o.color?y.FromArray(o.color):y.White(),h.intensity=o.intensity==null?1:o.intensity;const p=new S(`${T}_orientation`,this._loader.babylonScene);p.rotationQuaternion=B.RotationAxis(n.Up(),Math.PI),p.parent=f,h.parent=p,this._loader._babylonLights.push(h),C.AddPointerMetadata(h,a),e(f)})))}}z(c);F(c,!0,i=>new v(i));export{v as EXT_lights_area}; +import{d as L,aI as g,T as u,L as w,V as n,an as R,_ as b,s as E,R as D,C as y,bh as S,ao as B,aG as z,aH as F}from"./index-DmfQKmJL.js";import{R as x}from"./rawTexture-3EXxZD4a.js";import{ArrayItem as A,GLTFLoader as C}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";async function M(){const i=new Uint16Array(16384),t=new Uint16Array(4096*4),s=await L.LoadFileAsync(L.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin")),e=new Uint16Array(s),a=e.length/8;for(let r=0;r{i._ltcTextures&&((i._ltcTextures?.LTC1).update(e[0]),(i._ltcTextures?.LTC2).update(e[1]),i.onDisposeObservable.addOnce(()=>{i._ltcTextures?.LTC1.dispose(),i._ltcTextures?.LTC2.dispose()}))}).catch(e=>{w.Error(`Area Light fail to get LTC textures data. Error: ${e}`)})}class U extends g{constructor(t,s,e,a){super(t,e,a),this.position=s,this._scene._ltcTextures||P(this._scene)}transferTexturesToEffect(t){return this._scene._ltcTextures&&(t.setTexture("areaLightsLTC1Sampler",this._scene._ltcTextures.LTC1),t.setTexture("areaLightsLTC2Sampler",this._scene._ltcTextures.LTC2)),this}prepareLightSpecificDefines(t,s){t["AREALIGHT"+s]=!0,t.AREALIGHTUSED=!0}_isReady(){return this._scene._ltcTextures?this._scene._ltcTextures.LTC1.isReady()&&this._scene._ltcTextures.LTC2.isReady():!1}}R.AddNodeConstructor("Light_Type_4",(i,t)=>()=>new l(i,n.Zero(),1,1,t));class l extends U{get width(){return this._width.x}set width(t){this._width.x=t}get height(){return this._height.y}set height(t){this._height.y=t}constructor(t,s,e,a,r,f){super(t,s,r,f),this._width=new n(e,0,0),this._height=new n(0,a,0),this._pointTransformedPosition=n.Zero(),this._pointTransformedWidth=n.Zero(),this._pointTransformedHeight=n.Zero()}getClassName(){return"RectAreaLight"}getTypeID(){return g.LIGHTTYPEID_RECT_AREALIGHT}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightWidth",4),this._uniformBuffer.addUniform("vLightHeight",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(n.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this._pointTransformedPosition),n.TransformNormalToRef(this._width,this.parent.getWorldMatrix(),this._pointTransformedWidth),n.TransformNormalToRef(this._height,this.parent.getWorldMatrix(),this._pointTransformedHeight),!0):!1}transferToEffect(t,s){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z,0,s),this._uniformBuffer.updateFloat4("vLightWidth",this._pointTransformedWidth.x/2,this._pointTransformedWidth.y/2,this._pointTransformedWidth.z/2,0,s),this._uniformBuffer.updateFloat4("vLightHeight",this._pointTransformedHeight.x/2,this._pointTransformedHeight.y/2,this._pointTransformedHeight.z/2,0,s)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-e.x,this.position.y-e.y,this.position.z-e.z,0,s),this._uniformBuffer.updateFloat4("vLightWidth",this._width.x/2,this._width.y/2,this._width.z/2,0,s),this._uniformBuffer.updateFloat4("vLightHeight",this._height.x/2,this._height.y/2,this._height.z/2,0,s)),this}transferToNodeMaterialEffect(t,s){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?t.setFloat3(s,this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z):t.setFloat3(s,this.position.x-e.x,this.position.y-e.y,this.position.z-e.z),this}}b([E()],l.prototype,"width",null);b([E()],l.prototype,"height",null);D("BABYLON.RectAreaLight",l);const c="EXT_lights_area";class v{constructor(t){this.name=c,this._loader=t,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const s=t[this.name];this._lights=s.lights,A.Assign(this._lights)}}loadNodeAsync(t,s,e){return C.LoadExtensionAsync(t,s,this.name,async(a,r)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(t,s,f=>{let h;const o=A.Get(a,this._lights,r.light),T=o.name||f.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer;const d=o.size!==void 0?o.size:1;switch(o.type){case"rect":{const _=o.rect?.aspect!==void 0?o.rect.aspect*d:d,m=d;h=new l(T,n.Zero(),_,m,this._loader.babylonScene);break}case"disk":{const _=Math.sqrt(d*d*.25*Math.PI);h=new l(T,n.Zero(),_,_,this._loader.babylonScene);break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${a}: Invalid area light type (${o.type})`)}h._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,o._babylonLight=h,h.falloffType=g.FALLOFF_GLTF,h.diffuse=o.color?y.FromArray(o.color):y.White(),h.intensity=o.intensity==null?1:o.intensity;const p=new S(`${T}_orientation`,this._loader.babylonScene);p.rotationQuaternion=B.RotationAxis(n.Up(),Math.PI),p.parent=f,h.parent=p,this._loader._babylonLights.push(h),C.AddPointerMetadata(h,a),e(f)})))}}z(c);F(c,!0,i=>new v(i));export{v as EXT_lights_area}; diff --git a/assets/EXT_lights_ies-C2q7BoCe.js b/assets/EXT_lights_ies-zmsFevvJ.js similarity index 82% rename from assets/EXT_lights_ies-C2q7BoCe.js rename to assets/EXT_lights_ies-zmsFevvJ.js index c5089a54115013fc5aa32d0358a01f13b09761a1..55f4ad67b6be454d8574fbc1d20e53de18fcbf05 100644 --- a/assets/EXT_lights_ies-C2q7BoCe.js +++ b/assets/EXT_lights_ies-zmsFevvJ.js @@ -1 +1 @@ -import{V as f,aI as b,C as _,T as y,aG as p,aH as L}from"./index-GY9JDBGV.js";import{a as A}from"./objectModelMapping-CpTIXcMS.js";import{ArrayItem as l,GLTFLoader as u}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";const n="EXT_lights_ies";class w{constructor(i){this.name=n,this._loader=i,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null,delete this._lights}onLoading(){const i=this._loader.gltf.extensions;if(i&&i[this.name]){const r=i[this.name];this._lights=r.lights,l.Assign(this._lights)}}loadNodeAsync(i,r,c){return u.LoadExtensionAsync(i,r,this.name,async(h,a)=>{this._loader._allMaterialsDirtyRequired=!0;let e,t;const m=await this._loader.loadNodeAsync(i,r,s=>{t=l.Get(h,this._lights,a.light);const g=t.name||s.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,e=new A(g,f.Zero(),f.Backward(),0,1,this._loader.babylonScene),e.angle=Math.PI/2,e.innerAngle=0,e._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,t._babylonLight=e,e.falloffType=b.FALLOFF_GLTF,e.diffuse=a.color?_.FromArray(a.color):_.White(),e.intensity=a.multiplier||1,e.range=Number.MAX_VALUE,e.parent=s,this._loader._babylonLights.push(e),u.AddPointerMetadata(e,h),c(s)});let o;if(t.uri)o=await this._loader.loadUriAsync(i,t,t.uri);else{const s=l.Get(`${i}/bufferView`,this._loader.gltf.bufferViews,t.bufferView);o=await this._loader.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}return e.iesProfileTexture=new y(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,o,!0,void 0,void 0,void 0,void 0,".ies"),m})}}p(n);L(n,!0,d=>new w(d));export{w as EXT_lights_ies}; +import{V as f,aI as b,C as _,T as y,aG as p,aH as L}from"./index-DmfQKmJL.js";import{a as A}from"./objectModelMapping-BHbejOcH.js";import{ArrayItem as l,GLTFLoader as u}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";const n="EXT_lights_ies";class w{constructor(i){this.name=n,this._loader=i,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null,delete this._lights}onLoading(){const i=this._loader.gltf.extensions;if(i&&i[this.name]){const r=i[this.name];this._lights=r.lights,l.Assign(this._lights)}}loadNodeAsync(i,r,c){return u.LoadExtensionAsync(i,r,this.name,async(h,a)=>{this._loader._allMaterialsDirtyRequired=!0;let e,t;const m=await this._loader.loadNodeAsync(i,r,s=>{t=l.Get(h,this._lights,a.light);const g=t.name||s.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,e=new A(g,f.Zero(),f.Backward(),0,1,this._loader.babylonScene),e.angle=Math.PI/2,e.innerAngle=0,e._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,t._babylonLight=e,e.falloffType=b.FALLOFF_GLTF,e.diffuse=a.color?_.FromArray(a.color):_.White(),e.intensity=a.multiplier||1,e.range=Number.MAX_VALUE,e.parent=s,this._loader._babylonLights.push(e),u.AddPointerMetadata(e,h),c(s)});let o;if(t.uri)o=await this._loader.loadUriAsync(i,t,t.uri);else{const s=l.Get(`${i}/bufferView`,this._loader.gltf.bufferViews,t.bufferView);o=await this._loader.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}return e.iesProfileTexture=new y(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,o,!0,void 0,void 0,void 0,void 0,".ies"),m})}}p(n);L(n,!0,d=>new w(d));export{w as EXT_lights_ies}; diff --git a/assets/EXT_lights_image_based-VXkLlHnK.js b/assets/EXT_lights_image_based-QdF5w0Gc.js similarity index 84% rename from assets/EXT_lights_image_based-VXkLlHnK.js rename to assets/EXT_lights_image_based-QdF5w0Gc.js index 5bf8eb019928bd838e1c905f15a4062f9da8dc9a..311e0776ee6d59f96f61553c43ee910fad720dcc 100644 --- a/assets/EXT_lights_image_based-VXkLlHnK.js +++ b/assets/EXT_lights_image_based-QdF5w0Gc.js @@ -1 +1 @@ -import{e as y,ao as u,M as g,bj as f,ay as x,aG as b,aH as A}from"./index-GY9JDBGV.js";import{_ as w}from"./environmentTextureTools-4Y2q4Eto.js";import{CubeTexture as T}from"./cubeTexture-C4jc6f6g.js";import{GLTFLoader as S,ArrayItem as h}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./dumpTools-CmFNDulw.js";import"./abstractEngine.cubeTexture-BED8U2gm.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";class m extends T{constructor(t,e,a,n=5,r=0,s=!1,o=!1,l=3,i=null){super("",t),this._texture=t.getEngine().createRawCubeTexture(e,a,n,r,s,o,l,i)}update(t,e,a,n,r=null){this._texture.getEngine().updateRawCubeTexture(this._texture,t,e,a,n,r)}updateRGBDAsync(t,e=null,a=.8,n=0){return w(this._texture,t,e,a,n).then(()=>{})}clone(){return y.Clone(()=>{const t=this.getScene(),e=this._texture,a=new m(t,e._bufferViewArray,e.width,e.format,e.type,e.generateMipMaps,e.invertY,e.samplingMode,e._compression);return e.source===13&&a.updateRGBDAsync(e._bufferViewArrayArray,e._sphericalPolynomial,e._lodGenerationScale,e._lodGenerationOffset),a},this)}}const c="EXT_lights_image_based";class G{constructor(t){this.name=c,this._loader=t,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._lights=e.lights}}loadSceneAsync(t,e){return S.LoadExtensionAsync(t,e,this.name,async(a,n)=>{this._loader._allMaterialsDirtyRequired=!0;const r=new Array;r.push(this._loader.loadSceneAsync(t,e)),this._loader.logOpen(`${a}`);const s=h.Get(`${a}/light`,this._lights,n.light);return r.push(this._loadLightAsync(`/extensions/${this.name}/lights/${n.light}`,s).then(o=>{this._loader.babylonScene.environmentTexture=o})),this._loader.logClose(),await Promise.all(r).then(()=>{})})}_loadLightAsync(t,e){if(!e._loaded){const a=new Array;this._loader.logOpen(`${t}`);const n=new Array(e.specularImages.length);for(let r=0;r{n[r][o]=_})),this._loader.logClose()}}this._loader.logClose(),e._loaded=Promise.all(a).then(async()=>{const r=new m(this._loader.babylonScene,null,e.specularImageSize);if(r.name=e.name||"environment",e._babylonTexture=r,e.intensity!=null&&(r.level=e.intensity),e.rotation){let i=u.FromArray(e.rotation);this._loader.babylonScene.useRightHandedSystem||(i=u.Inverse(i)),g.FromQuaternionToRef(i,r.getReflectionTextureMatrix())}if(!e.irradianceCoefficients)throw new Error(`${t}: Irradiance coefficients are missing`);const s=f.FromArray(e.irradianceCoefficients);s.scaleInPlace(e.intensity),s.convertIrradianceToLambertianRadiance();const o=x.FromHarmonics(s),l=(n.length-1)/Math.log2(e.specularImageSize);return await r.updateRGBDAsync(n,o,l)})}return e._loaded.then(()=>e._babylonTexture)}}b(c);A(c,!0,d=>new G(d));export{G as EXT_lights_image_based}; +import{e as y,ao as u,M as g,bj as f,ay as x,aG as b,aH as A}from"./index-DmfQKmJL.js";import{_ as w}from"./environmentTextureTools-CZ2Js-0F.js";import{CubeTexture as T}from"./cubeTexture-_waJYc-4.js";import{GLTFLoader as S,ArrayItem as h}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./dumpTools-lUQLjcLM.js";import"./abstractEngine.cubeTexture-BIRfp8hN.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";class m extends T{constructor(t,e,a,n=5,r=0,s=!1,o=!1,l=3,i=null){super("",t),this._texture=t.getEngine().createRawCubeTexture(e,a,n,r,s,o,l,i)}update(t,e,a,n,r=null){this._texture.getEngine().updateRawCubeTexture(this._texture,t,e,a,n,r)}updateRGBDAsync(t,e=null,a=.8,n=0){return w(this._texture,t,e,a,n).then(()=>{})}clone(){return y.Clone(()=>{const t=this.getScene(),e=this._texture,a=new m(t,e._bufferViewArray,e.width,e.format,e.type,e.generateMipMaps,e.invertY,e.samplingMode,e._compression);return e.source===13&&a.updateRGBDAsync(e._bufferViewArrayArray,e._sphericalPolynomial,e._lodGenerationScale,e._lodGenerationOffset),a},this)}}const c="EXT_lights_image_based";class G{constructor(t){this.name=c,this._loader=t,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._lights=e.lights}}loadSceneAsync(t,e){return S.LoadExtensionAsync(t,e,this.name,async(a,n)=>{this._loader._allMaterialsDirtyRequired=!0;const r=new Array;r.push(this._loader.loadSceneAsync(t,e)),this._loader.logOpen(`${a}`);const s=h.Get(`${a}/light`,this._lights,n.light);return r.push(this._loadLightAsync(`/extensions/${this.name}/lights/${n.light}`,s).then(o=>{this._loader.babylonScene.environmentTexture=o})),this._loader.logClose(),await Promise.all(r).then(()=>{})})}_loadLightAsync(t,e){if(!e._loaded){const a=new Array;this._loader.logOpen(`${t}`);const n=new Array(e.specularImages.length);for(let r=0;r{n[r][o]=_})),this._loader.logClose()}}this._loader.logClose(),e._loaded=Promise.all(a).then(async()=>{const r=new m(this._loader.babylonScene,null,e.specularImageSize);if(r.name=e.name||"environment",e._babylonTexture=r,e.intensity!=null&&(r.level=e.intensity),e.rotation){let i=u.FromArray(e.rotation);this._loader.babylonScene.useRightHandedSystem||(i=u.Inverse(i)),g.FromQuaternionToRef(i,r.getReflectionTextureMatrix())}if(!e.irradianceCoefficients)throw new Error(`${t}: Irradiance coefficients are missing`);const s=f.FromArray(e.irradianceCoefficients);s.scaleInPlace(e.intensity),s.convertIrradianceToLambertianRadiance();const o=x.FromHarmonics(s),l=(n.length-1)/Math.log2(e.specularImageSize);return await r.updateRGBDAsync(n,o,l)})}return e._loaded.then(()=>e._babylonTexture)}}b(c);A(c,!0,d=>new G(d));export{G as EXT_lights_image_based}; diff --git a/assets/EXT_mesh_gpu_instancing-_XEhXaiJ.js b/assets/EXT_mesh_gpu_instancing-BBagtG9m.js similarity index 81% rename from assets/EXT_mesh_gpu_instancing-_XEhXaiJ.js rename to assets/EXT_mesh_gpu_instancing-BBagtG9m.js index 6309d7a08476e0b06a39a03987121a676c98ab8f..2d4372d3e127681101a7177dd02deaa5e78d24f1 100644 --- a/assets/EXT_mesh_gpu_instancing-_XEhXaiJ.js +++ b/assets/EXT_mesh_gpu_instancing-BBagtG9m.js @@ -1 +1 @@ -import{c as r,V as A,ao as F,M as b,L as g,aG as L,aH as M}from"./index-GY9JDBGV.js";import{GLTFLoader as V,ArrayItem as w}from"./glTFLoader-CdfQ_yvy.js";import"./thinInstanceMesh-B_Va_jLC.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const c="EXT_mesh_gpu_instancing";class B{constructor(l){this.name=c,this._loader=l,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null}loadNodeAsync(l,s,T){return V.LoadExtensionAsync(l,s,this.name,async(m,h)=>{this._loader._disableInstancedMesh++;const p=this._loader.loadNodeAsync(`/nodes/${s.index}`,s,T);if(this._loader._disableInstancedMesh--,!s._primitiveBabylonMeshes)return await p;const u=new Array;let t=0;const i=a=>{if(h.attributes[a]==null){u.push(Promise.resolve(null));return}const o=w.Get(`${m}/attributes/${a}`,this._loader.gltf.accessors,h.attributes[a]);if(u.push(this._loader._loadFloatAccessorAsync(`/accessors/${o.bufferView}`,o)),t===0)t=o.count;else if(t!==o.count)throw new Error(`${m}/attributes: Instance buffer accessors do not have the same count.`)};return i("TRANSLATION"),i("ROTATION"),i("SCALE"),i("_COLOR_0"),await p.then(async a=>{const[o,d,_,n]=await Promise.all(u),y=new Float32Array(t*16);r.Vector3[0].copyFromFloats(0,0,0),r.Quaternion[0].copyFromFloats(0,0,0,1),r.Vector3[1].copyFromFloats(1,1,1);for(let e=0;enew B(f));export{B as EXT_mesh_gpu_instancing}; +import{c as r,V as A,ao as F,M as b,L as g,aG as L,aH as M}from"./index-DmfQKmJL.js";import{GLTFLoader as V,ArrayItem as w}from"./glTFLoader-BBmdTKVx.js";import"./thinInstanceMesh-CzFstZ7V.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const c="EXT_mesh_gpu_instancing";class B{constructor(l){this.name=c,this._loader=l,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null}loadNodeAsync(l,s,T){return V.LoadExtensionAsync(l,s,this.name,async(m,h)=>{this._loader._disableInstancedMesh++;const p=this._loader.loadNodeAsync(`/nodes/${s.index}`,s,T);if(this._loader._disableInstancedMesh--,!s._primitiveBabylonMeshes)return await p;const u=new Array;let t=0;const i=a=>{if(h.attributes[a]==null){u.push(Promise.resolve(null));return}const o=w.Get(`${m}/attributes/${a}`,this._loader.gltf.accessors,h.attributes[a]);if(u.push(this._loader._loadFloatAccessorAsync(`/accessors/${o.bufferView}`,o)),t===0)t=o.count;else if(t!==o.count)throw new Error(`${m}/attributes: Instance buffer accessors do not have the same count.`)};return i("TRANSLATION"),i("ROTATION"),i("SCALE"),i("_COLOR_0"),await p.then(async a=>{const[o,d,_,n]=await Promise.all(u),y=new Float32Array(t*16);r.Vector3[0].copyFromFloats(0,0,0),r.Quaternion[0].copyFromFloats(0,0,0,1),r.Vector3[1].copyFromFloats(1,1,1);for(let e=0;enew B(f));export{B as EXT_mesh_gpu_instancing}; diff --git a/assets/EXT_meshopt_compression-CNfYzYbj.js b/assets/EXT_meshopt_compression-uVDTMCPr.js similarity index 79% rename from assets/EXT_meshopt_compression-CNfYzYbj.js rename to assets/EXT_meshopt_compression-uVDTMCPr.js index 1b9b0b2faf1fd03a10767af4a9d558971e297a27..75ed2f780d3436d5c59b1841e787a4b95355273b 100644 --- a/assets/EXT_meshopt_compression-CNfYzYbj.js +++ b/assets/EXT_meshopt_compression-uVDTMCPr.js @@ -1 +1 @@ -import{GLTFLoader as m,ArrayItem as h}from"./glTFLoader-CdfQ_yvy.js";import{d as n,aG as p,aH as y}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";let i=0,u=null;class r{static get Default(){return r._Default||(r._Default=new r),r._Default}constructor(){const e=r.Configuration.decoder;this._decoderModulePromise=n.LoadBabylonScriptAsync(e.url).then(()=>MeshoptDecoder.ready)}dispose(){delete this._decoderModulePromise}async decodeGltfBufferAsync(e,s,l,t,o){await this._decoderModulePromise,i===0&&(MeshoptDecoder.useWorkers(1),i=1);const a=await MeshoptDecoder.decodeGltfBufferAsync(s,l,e,t,o);return u!==null&&clearTimeout(u),u=setTimeout(()=>{MeshoptDecoder.useWorkers(0),i=0,u=null},1e3),a}}r.Configuration={decoder:{url:`${n._DefaultCdnUrl}/meshopt_decoder.js`}};r._Default=null;const d="EXT_meshopt_compression";class _{constructor(e){this.name=d,this.enabled=e.isExtensionUsed(d),this._loader=e}dispose(){this._loader=null}loadBufferViewAsync(e,s){return m.LoadExtensionAsync(e,s,this.name,async(l,t)=>{const o=s;if(o._meshOptData)return await o._meshOptData;const a=h.Get(`${e}/buffer`,this._loader.gltf.buffers,t.buffer);return o._meshOptData=this._loader.loadBufferAsync(`/buffers/${a.index}`,a,t.byteOffset||0,t.byteLength).then(async c=>await r.Default.decodeGltfBufferAsync(c,t.count,t.byteStride,t.mode,t.filter)),await o._meshOptData})}}p(d);y(d,!0,f=>new _(f));export{_ as EXT_meshopt_compression}; +import{GLTFLoader as m,ArrayItem as h}from"./glTFLoader-BBmdTKVx.js";import{d as n,aG as p,aH as y}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";let i=0,u=null;class r{static get Default(){return r._Default||(r._Default=new r),r._Default}constructor(){const e=r.Configuration.decoder;this._decoderModulePromise=n.LoadBabylonScriptAsync(e.url).then(()=>MeshoptDecoder.ready)}dispose(){delete this._decoderModulePromise}async decodeGltfBufferAsync(e,s,l,t,o){await this._decoderModulePromise,i===0&&(MeshoptDecoder.useWorkers(1),i=1);const a=await MeshoptDecoder.decodeGltfBufferAsync(s,l,e,t,o);return u!==null&&clearTimeout(u),u=setTimeout(()=>{MeshoptDecoder.useWorkers(0),i=0,u=null},1e3),a}}r.Configuration={decoder:{url:`${n._DefaultCdnUrl}/meshopt_decoder.js`}};r._Default=null;const d="EXT_meshopt_compression";class _{constructor(e){this.name=d,this.enabled=e.isExtensionUsed(d),this._loader=e}dispose(){this._loader=null}loadBufferViewAsync(e,s){return m.LoadExtensionAsync(e,s,this.name,async(l,t)=>{const o=s;if(o._meshOptData)return await o._meshOptData;const a=h.Get(`${e}/buffer`,this._loader.gltf.buffers,t.buffer);return o._meshOptData=this._loader.loadBufferAsync(`/buffers/${a.index}`,a,t.byteOffset||0,t.byteLength).then(async c=>await r.Default.decodeGltfBufferAsync(c,t.count,t.byteStride,t.mode,t.filter)),await o._meshOptData})}}p(d);y(d,!0,f=>new _(f));export{_ as EXT_meshopt_compression}; diff --git a/assets/EXT_texture_avif-8t8_Kyul.js b/assets/EXT_texture_avif-5a0PhMZm.js similarity index 62% rename from assets/EXT_texture_avif-8t8_Kyul.js rename to assets/EXT_texture_avif-5a0PhMZm.js index 98866f8e25a3b4ce1ce5916de1408ee4d71e881e..d2165d8c80f1c4dce86a708eb1c1e8b03c3f7b3d 100644 --- a/assets/EXT_texture_avif-8t8_Kyul.js +++ b/assets/EXT_texture_avif-5a0PhMZm.js @@ -1 +1 @@ -import{GLTFLoader as a,ArrayItem as o}from"./glTFLoader-CdfQ_yvy.js";import{aG as u,aH as _}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const s="EXT_texture_avif";class c{constructor(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}dispose(){this._loader=null}_loadTextureAsync(e,r,i){return a.LoadExtensionAsync(e,r,this.name,async(n,m)=>{const l=r.sampler==null?a.DefaultSampler:o.Get(`${e}/sampler`,this._loader.gltf.samplers,r.sampler),p=o.Get(`${n}/source`,this._loader.gltf.images,m.source);return await this._loader._createTextureAsync(e,l,p,d=>{i(d)},void 0,!r._textureInfo.nonColorData)})}}u(s);_(s,!0,t=>new c(t));export{c as EXT_texture_avif}; +import{GLTFLoader as a,ArrayItem as o}from"./glTFLoader-BBmdTKVx.js";import{aG as u,aH as _}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const s="EXT_texture_avif";class c{constructor(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}dispose(){this._loader=null}_loadTextureAsync(e,r,i){return a.LoadExtensionAsync(e,r,this.name,async(n,m)=>{const l=r.sampler==null?a.DefaultSampler:o.Get(`${e}/sampler`,this._loader.gltf.samplers,r.sampler),p=o.Get(`${n}/source`,this._loader.gltf.images,m.source);return await this._loader._createTextureAsync(e,l,p,d=>{i(d)},void 0,!r._textureInfo.nonColorData)})}}u(s);_(s,!0,t=>new c(t));export{c as EXT_texture_avif}; diff --git a/assets/EXT_texture_webp-2Si9vGim.js b/assets/EXT_texture_webp-3jsgTjRP.js similarity index 62% rename from assets/EXT_texture_webp-2Si9vGim.js rename to assets/EXT_texture_webp-3jsgTjRP.js index 779d47e6a098b6459b25b7190af5f85083deb2c5..36cf397eb46e22ca013dc2e2d144e352ae544b46 100644 --- a/assets/EXT_texture_webp-2Si9vGim.js +++ b/assets/EXT_texture_webp-3jsgTjRP.js @@ -1 +1 @@ -import{GLTFLoader as o,ArrayItem as a}from"./glTFLoader-CdfQ_yvy.js";import{aG as u,aH as _}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const s="EXT_texture_webp";class c{constructor(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}dispose(){this._loader=null}_loadTextureAsync(e,r,i){return o.LoadExtensionAsync(e,r,this.name,async(n,m)=>{const l=r.sampler==null?o.DefaultSampler:a.Get(`${e}/sampler`,this._loader.gltf.samplers,r.sampler),p=a.Get(`${n}/source`,this._loader.gltf.images,m.source);return await this._loader._createTextureAsync(e,l,p,d=>{i(d)},void 0,!r._textureInfo.nonColorData)})}}u(s);_(s,!0,t=>new c(t));export{c as EXT_texture_webp}; +import{GLTFLoader as o,ArrayItem as a}from"./glTFLoader-BBmdTKVx.js";import{aG as u,aH as _}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const s="EXT_texture_webp";class c{constructor(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}dispose(){this._loader=null}_loadTextureAsync(e,r,i){return o.LoadExtensionAsync(e,r,this.name,async(n,m)=>{const l=r.sampler==null?o.DefaultSampler:a.Get(`${e}/sampler`,this._loader.gltf.samplers,r.sampler),p=a.Get(`${n}/source`,this._loader.gltf.images,m.source);return await this._loader._createTextureAsync(e,l,p,d=>{i(d)},void 0,!r._textureInfo.nonColorData)})}}u(s);_(s,!0,t=>new c(t));export{c as EXT_texture_webp}; diff --git a/assets/Edit-G5CCT_vc.js b/assets/Edit-DfYRtNtw.js similarity index 70% rename from assets/Edit-G5CCT_vc.js rename to assets/Edit-DfYRtNtw.js index c30ba5b7efda9e28bee9cce01223f7a74e747e7e..fad648f4fd1860e934a102d34001397d6d00a64e 100644 --- a/assets/Edit-G5CCT_vc.js +++ b/assets/Edit-DfYRtNtw.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as r,f as e}from"./index-DydPgVMC.js";var s=e('');function n(t){var o=s();r(t,o)}export{n as E}; +import"./i18n-DtG3MAQ1.js";import{a as r,f as e}from"./index-BeNBoC9J.js";var s=e('');function n(t){var o=s();r(t,o)}export{n as E}; diff --git a/assets/Empty-B15ItVsj.js b/assets/Empty-Clj0ErcW.js similarity index 80% rename from assets/Empty-B15ItVsj.js rename to assets/Empty-Clj0ErcW.js index 44bf02a2ec1dcd317f62f4c50d8c67d2eb4c0ebf..dc6464d58c440a4d8d07fa93fb457821128f2cf2 100644 --- a/assets/Empty-B15ItVsj.js +++ b/assets/Empty-Clj0ErcW.js @@ -1 +1 @@ -import{p as _,s as z,d as E,b as R}from"./i18n-CPHyzK9b.js";import{M as k,Y as B,Z as r,_ as C,$ as u,t as M,a as O,O as P,a0 as c,P as m,Q as f,R as Q,T as g}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var S=Q('
        ');function j(h,a){k(a,!1);const i=c();let s=_(a,"size",12,"small"),n=_(a,"unpadded_box",12,!1),l=c();function v(e){if(!e)return!1;const{height:p}=e.getBoundingClientRect(),{height:y}=e.parentElement?.getBoundingClientRect()||{height:p};return p>y+2}B(()=>r(l),()=>{u(i,v(r(l)))}),C();var b={get size(){return s()},set size(e){s(e),m()},get unpadded_box(){return n()},set unpadded_box(e){n(e),m()}},t=S();let d;var o=f(t),x=f(o);return z(x,a,"default",{}),g(o),g(t),E(t,e=>u(l,e),()=>r(l)),M(()=>d=R(t,1,"empty svelte-1p786k8",null,d,{small:s()==="small",large:s()==="large",unpadded_box:n(),small_parent:r(i)})),O(h,t),P(b)}export{j as E}; +import{p as _,s as z,d as E,b as R}from"./i18n-DtG3MAQ1.js";import{M as k,Y as B,Z as r,_ as C,$ as u,t as M,a as O,O as P,a0 as c,P as m,Q as f,R as Q,T as g}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var S=Q('
        ');function j(h,a){k(a,!1);const i=c();let s=_(a,"size",12,"small"),n=_(a,"unpadded_box",12,!1),l=c();function v(e){if(!e)return!1;const{height:p}=e.getBoundingClientRect(),{height:y}=e.parentElement?.getBoundingClientRect()||{height:p};return p>y+2}B(()=>r(l),()=>{u(i,v(r(l)))}),C();var b={get size(){return s()},set size(e){s(e),m()},get unpadded_box(){return n()},set unpadded_box(e){n(e),m()}},t=S();let d;var o=f(t),x=f(o);return z(x,a,"default",{}),g(o),g(t),E(t,e=>u(l,e),()=>r(l)),M(()=>d=R(t,1,"empty svelte-1p786k8",null,d,{small:s()==="small",large:s()==="large",unpadded_box:n(),small_parent:r(i)})),O(h,t),P(b)}export{j as E}; diff --git a/assets/Example-DT5PcEOk.js b/assets/Example-5TvjAuj2.js similarity index 54% rename from assets/Example-DT5PcEOk.js rename to assets/Example-5TvjAuj2.js index 961d3bf37e0020176b7c736d8a218dc29f3b60b7..cabe5d2322d01822bd1f74ab359740782c417696 100644 --- a/assets/Example-DT5PcEOk.js +++ b/assets/Example-5TvjAuj2.js @@ -1 +1 @@ -import{p as r,i as n,b as v}from"./i18n-CPHyzK9b.js";import{t as _,a as u,R as h,Q as p,T as b}from"./index-DydPgVMC.js";import{J as y}from"./JSON-DVsUg528.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./Empty-B15ItVsj.js";import"./IconButtonWrapper-PnNNNvqI.js";var g=h("
        ");function R(s,e){let o=r(e,"theme_mode",3,"system"),i=r(e,"selected",3,!1),m=!1,d=0;var t=g();let l;var f=p(t);{var c=a=>{y(a,{get value(){return e.value},open:!0,get theme_mode(){return o()},show_indices:m,label_height:d,interactive:!1,show_copy_button:!1})};n(f,a=>{e.value&&a(c)})}b(t),_(()=>l=v(t,1,"container svelte-1skdjd4",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:i(),border:e.value})),u(s,t)}export{R as default}; +import{p as r,i as n,b as v}from"./i18n-DtG3MAQ1.js";import{t as _,a as u,R as h,Q as p,T as b}from"./index-BeNBoC9J.js";import{J as y}from"./JSON-BMd6yQaN.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./Empty-Clj0ErcW.js";import"./IconButtonWrapper-Ce5bzAyh.js";var g=h("
        ");function R(s,e){let o=r(e,"theme_mode",3,"system"),i=r(e,"selected",3,!1),m=!1,d=0;var t=g();let l;var f=p(t);{var c=a=>{y(a,{get value(){return e.value},open:!0,get theme_mode(){return o()},show_indices:m,label_height:d,interactive:!1,show_copy_button:!1})};n(f,a=>{e.value&&a(c)})}b(t),_(()=>l=v(t,1,"container svelte-1skdjd4",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:i(),border:e.value})),u(s,t)}export{R as default}; diff --git a/assets/Example-CCIKPQQj.js b/assets/Example-7cNIWfNN.js similarity index 75% rename from assets/Example-CCIKPQQj.js rename to assets/Example-7cNIWfNN.js index 09ec769d04046a4019fded039932f06b62932eec..8f07b4eb02768ecb13d90e37552f709d5da493fd 100644 --- a/assets/Example-CCIKPQQj.js +++ b/assets/Example-7cNIWfNN.js @@ -1 +1 @@ -import{p,b as i}from"./i18n-CPHyzK9b.js";import{t as u,X as m,a as d,R as v,Q as _,T as y}from"./index-DydPgVMC.js";/* empty css */var b=v("
         
        ");function w(c,e){let n=p(e,"selected",3,!1);function f(r,s=60){if(!r)return"";const a=String(r);return a.length<=s?a:a.slice(0,s)+"..."}var t=b();let l;var o=_(t,!0);y(t),u(r=>{l=i(t,1,"svelte-9powsr",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:n()}),m(o,r)},[()=>f(e.value)]),d(c,t)}export{w as default}; +import{p,b as i}from"./i18n-DtG3MAQ1.js";import{t as u,X as m,a as d,R as v,Q as _,T as y}from"./index-BeNBoC9J.js";/* empty css */var b=v("
         
        ");function w(c,e){let n=p(e,"selected",3,!1);function f(r,s=60){if(!r)return"";const a=String(r);return a.length<=s?a:a.slice(0,s)+"..."}var t=b();let l;var o=_(t,!0);y(t),u(r=>{l=i(t,1,"svelte-9powsr",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:n()}),m(o,r)},[()=>f(e.value)]),d(c,t)}export{w as default}; diff --git a/assets/Example-BGlyl4O8.js b/assets/Example-BFvndbmT.js similarity index 67% rename from assets/Example-BGlyl4O8.js rename to assets/Example-BFvndbmT.js index 16107851dcf16ce77a41e325e3505bf196096440..149a6e001fe40739d11428596db0710077b020f7 100644 --- a/assets/Example-BGlyl4O8.js +++ b/assets/Example-BFvndbmT.js @@ -1 +1 @@ -import{p as v,b as d}from"./i18n-CPHyzK9b.js";import{M as n,t as f,a as c,O as y,R as _,X as o,Q as b,T as h}from"./index-DydPgVMC.js";/* empty css */var x=_("
        ");function M(s,e){n(e,!0);let r=v(e,"selected",3,!1),i=(e.value?Array.isArray(e.value)?e.value:[e.value]:[]).map(t=>e.choices.find(u=>u[1]===t)?.[0]).filter(t=>t!==void 0).join(", ");var a=x();let l;var m=b(a,!0);h(a),f(()=>{l=d(a,1,"svelte-1ti2sjb",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:r()}),o(m,i)}),c(s,a),y()}export{M as default}; +import{p as v,b as d}from"./i18n-DtG3MAQ1.js";import{M as n,t as f,a as c,O as y,R as _,X as o,Q as b,T as h}from"./index-BeNBoC9J.js";/* empty css */var x=_("
        ");function M(s,e){n(e,!0);let r=v(e,"selected",3,!1),i=(e.value?Array.isArray(e.value)?e.value:[e.value]:[]).map(t=>e.choices.find(u=>u[1]===t)?.[0]).filter(t=>t!==void 0).join(", ");var a=x();let l;var m=b(a,!0);h(a),f(()=>{l=d(a,1,"svelte-1ti2sjb",null,l,{table:e.type==="table",gallery:e.type==="gallery",selected:r()}),o(m,i)}),c(s,a),y()}export{M as default}; diff --git a/assets/Example-BPjTUpdK.js b/assets/Example-BK_3ogSC.js similarity index 62% rename from assets/Example-BPjTUpdK.js rename to assets/Example-BK_3ogSC.js index 85586e241ecaee704eb6b179b069f674c5df1ddf..e96c245e443a390eb1fae9ea0b4da89d8a02a2f0 100644 --- a/assets/Example-BPjTUpdK.js +++ b/assets/Example-BK_3ogSC.js @@ -1 +1 @@ -import{p as d,b as i}from"./i18n-CPHyzK9b.js";import{M as u,t as c,X as m,a as f,O as n,R as o,Q as y,T as x}from"./index-DydPgVMC.js";/* empty css */var _=o("
        ");function p(l,e){u(e,!0);let s=d(e,"selected",3,!1);var a=_();let t;var r=y(a,!0);x(a),c(v=>{t=i(a,1,"svelte-nkzdzc",null,t,{table:e.type==="table",gallery:e.type==="gallery",selected:s()}),m(r,v)},[()=>e.value?Array.isArray(e.value)?e.value.join(", "):e.value:""]),f(l,a),n()}export{p as default}; +import{p as d,b as i}from"./i18n-DtG3MAQ1.js";import{M as u,t as c,X as m,a as f,O as n,R as o,Q as y,T as x}from"./index-BeNBoC9J.js";/* empty css */var _=o("
        ");function p(l,e){u(e,!0);let s=d(e,"selected",3,!1);var a=_();let t;var r=y(a,!0);x(a),c(v=>{t=i(a,1,"svelte-nkzdzc",null,t,{table:e.type==="table",gallery:e.type==="gallery",selected:s()}),m(r,v)},[()=>e.value?Array.isArray(e.value)?e.value.join(", "):e.value:""]),f(l,a),n()}export{p as default}; diff --git a/assets/Example-ByqvSEWx.js b/assets/Example-BTYUTWpe.js similarity index 80% rename from assets/Example-ByqvSEWx.js rename to assets/Example-BTYUTWpe.js index 1c84f9300ea9fd0dec3fd828df84173d0c332174..fccb25f60122e6f7b5e0df0a8066a8c938653d8d 100644 --- a/assets/Example-ByqvSEWx.js +++ b/assets/Example-BTYUTWpe.js @@ -1 +1 @@ -import{p as u,e as o,b as f}from"./i18n-CPHyzK9b.js";import{M as i,t as m,x as y,v as g,X as x,a as _,O as h,P as c,R as b,Q as S,T as k}from"./index-DydPgVMC.js";var z=b("
        ");function M(n,a){i(a,!1);let t=u(a,"value",12),l=u(a,"type",12),r=u(a,"selected",12,!1);var p={get value(){return t()},set value(e){t(e),c()},get type(){return l()},set type(e){l(e),c()},get selected(){return r()},set selected(e){r(e),c()}};o();var s=z();let d;var v=S(s,!0);return k(s),m(e=>{d=f(s,1,"svelte-zt6t97",null,d,{table:l()==="table",gallery:l()==="gallery",selected:r()}),x(v,e)},[()=>(y(t()),g(()=>t()!==null?t().toLocaleString():""))]),_(n,s),h(p)}export{M as default}; +import{p as u,e as o,b as f}from"./i18n-DtG3MAQ1.js";import{M as i,t as m,x as y,v as g,X as x,a as _,O as h,P as c,R as b,Q as S,T as k}from"./index-BeNBoC9J.js";var z=b("
        ");function M(n,a){i(a,!1);let t=u(a,"value",12),l=u(a,"type",12),r=u(a,"selected",12,!1);var p={get value(){return t()},set value(e){t(e),c()},get type(){return l()},set type(e){l(e),c()},get selected(){return r()},set selected(e){r(e),c()}};o();var s=z();let d;var v=S(s,!0);return k(s),m(e=>{d=f(s,1,"svelte-zt6t97",null,d,{table:l()==="table",gallery:l()==="gallery",selected:r()}),x(v,e)},[()=>(y(t()),g(()=>t()!==null?t().toLocaleString():""))]),_(n,s),h(p)}export{M as default}; diff --git a/assets/Example-B3rqw2Wc.js b/assets/Example-BWxCDLr9.js similarity index 78% rename from assets/Example-B3rqw2Wc.js rename to assets/Example-BWxCDLr9.js index b6342fdc6e2976ad24688ef9f8290c3d2759246e..90206eb024b902956c328d7c094e50a621d76aa6 100644 --- a/assets/Example-B3rqw2Wc.js +++ b/assets/Example-BWxCDLr9.js @@ -1 +1 @@ -import{p as u,b as n}from"./i18n-CPHyzK9b.js";import{M as o,t as m,a as i,O as y,P as v,R as g,X as x,Q as b,T as h}from"./index-DydPgVMC.js";var _=g("
        ");function M(p,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),v()},get type(){return a()},set type(e){a(e),v()},get selected(){return r()},set selected(e){r(e),v()}},l=_();let c;var f=b(l,!0);return h(l),m(()=>{c=n(l,1,"svelte-1cjvr6b",null,c,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(p,l),y(d)}export{M as default}; +import{p as u,b as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as m,a as i,O as y,P as v,R as g,X as x,Q as b,T as h}from"./index-BeNBoC9J.js";var _=g("
        ");function M(p,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),v()},get type(){return a()},set type(e){a(e),v()},get selected(){return r()},set selected(e){r(e),v()}},l=_();let c;var f=b(l,!0);return h(l),m(()=>{c=n(l,1,"svelte-1cjvr6b",null,c,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(p,l),y(d)}export{M as default}; diff --git a/assets/Example-7FcnnBll.js b/assets/Example-BdhvPMmU.js similarity index 78% rename from assets/Example-7FcnnBll.js rename to assets/Example-BdhvPMmU.js index 511705bf36552dd207f1ff2062aeeb2285f288b7..a6ce9182c0b564eb4fcaa40fbbc425f40510f228 100644 --- a/assets/Example-7FcnnBll.js +++ b/assets/Example-BdhvPMmU.js @@ -1 +1 @@ -import{p as u,b as n}from"./i18n-CPHyzK9b.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-DydPgVMC.js";var b=g("
        ");function O(c,t){o(t,!1);let a=u(t,"value",12),l=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return a()},set value(e){a(e),p()},get type(){return l()},set type(e){l(e),p()},get selected(){return r()},set selected(e){r(e),p()}},s=b();let v;var f=h(s,!0);return _(s),m(()=>{v=n(s,1,"svelte-1trg192",null,v,{table:l()==="table",gallery:l()==="gallery",selected:r()}),x(f,a()?a():"")}),i(c,s),y(d)}export{O as default}; +import{p as u,b as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-BeNBoC9J.js";var b=g("
        ");function O(c,t){o(t,!1);let a=u(t,"value",12),l=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return a()},set value(e){a(e),p()},get type(){return l()},set type(e){l(e),p()},get selected(){return r()},set selected(e){r(e),p()}},s=b();let v;var f=h(s,!0);return _(s),m(()=>{v=n(s,1,"svelte-1trg192",null,v,{table:l()==="table",gallery:l()==="gallery",selected:r()}),x(f,a()?a():"")}),i(c,s),y(d)}export{O as default}; diff --git a/assets/Example-BfoDEvJC.js b/assets/Example-BfoDEvJC.js deleted file mode 100644 index dff0cb29eacd2f5231866b990a0d93a64183d675..0000000000000000000000000000000000000000 --- a/assets/Example-BfoDEvJC.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a4 as p,t as s,a as x,X as f,a5 as m}from"./index-DydPgVMC.js";function l(a,e){m();var t=p();s(()=>f(t,e.value||"")),x(a,t)}export{l as default}; diff --git a/assets/Example-CXAPpj07.js b/assets/Example-C2VbMl9n.js similarity index 84% rename from assets/Example-CXAPpj07.js rename to assets/Example-C2VbMl9n.js index a1ae182db1205286d2ed554cd92cb8269686251d..771abdc7785e12bab885d23bdfa87c859b7e7502 100644 --- a/assets/Example-CXAPpj07.js +++ b/assets/Example-C2VbMl9n.js @@ -1 +1 @@ -import{p as q,i as n,b as w,q as E,w as M}from"./i18n-CPHyzK9b.js";import{M as N,t as m,a as t,O,R as r,Q as c,N as Q,T as d,X as R,Z as S,S as T}from"./index-DydPgVMC.js";var X=r("
      • "),Z=r('
      • ...
      • '),j=r(" ",1),z=r("
        ");function D(x,a){N(a,!0);let y=q(a,"selected",3,!1);var l=z();let f;var g=c(l);{var h=s=>{var o=j(),u=Q(o);E(u,17,()=>Array.isArray(a.value)?a.value.slice(0,3):[a.value],M,(e,v)=>{var i=X(),_=c(i),k=c(_);d(_),d(i),m(()=>R(k,`./${S(v)??""}`)),t(e,i)});var b=T(u,2);{var A=e=>{var v=Z();t(e,v)};n(b,e=>{Array.isArray(a.value)&&a.value.length>3&&e(A)})}t(s,o)};n(g,s=>{a.value&&s(h)})}d(l),m(()=>f=w(l,1,"svelte-4dxvaf",null,f,{table:a.type==="table",gallery:a.type==="gallery",selected:y()})),t(x,l),O()}export{D as default}; +import{p as q,i as n,b as w,q as E,w as M}from"./i18n-DtG3MAQ1.js";import{M as N,t as m,a as t,O,R as r,Q as c,N as Q,T as d,X as R,Z as S,S as T}from"./index-BeNBoC9J.js";var X=r("
      • "),Z=r('
      • ...
      • '),j=r(" ",1),z=r("
        ");function D(x,a){N(a,!0);let y=q(a,"selected",3,!1);var l=z();let f;var g=c(l);{var h=s=>{var o=j(),u=Q(o);E(u,17,()=>Array.isArray(a.value)?a.value.slice(0,3):[a.value],M,(e,v)=>{var i=X(),_=c(i),k=c(_);d(_),d(i),m(()=>R(k,`./${S(v)??""}`)),t(e,i)});var b=T(u,2);{var A=e=>{var v=Z();t(e,v)};n(b,e=>{Array.isArray(a.value)&&a.value.length>3&&e(A)})}t(s,o)};n(g,s=>{a.value&&s(h)})}d(l),m(()=>f=w(l,1,"svelte-4dxvaf",null,f,{table:a.type==="table",gallery:a.type==="gallery",selected:y()})),t(x,l),O()}export{D as default}; diff --git a/assets/Example-q7qW2djY.js b/assets/Example-C8kkgkoI.js similarity index 68% rename from assets/Example-q7qW2djY.js rename to assets/Example-C8kkgkoI.js index b0862678c646f017488c16560643795adfc85348..360fef83ab66d2f77de966cb01e96990891e5633 100644 --- a/assets/Example-q7qW2djY.js +++ b/assets/Example-C8kkgkoI.js @@ -1 +1 @@ -import{p,b as f}from"./i18n-CPHyzK9b.js";import{M as m,t as n,a as i,O as y,P as u,R as h,Q as g,T as x}from"./index-DydPgVMC.js";import{h as b}from"./html-BZIV6tyB.js";var _=h("
        ");function O(d,t){m(t,!1);let s=p(t,"value",12),a=p(t,"type",12),r=p(t,"selected",12,!1);var v={get value(){return s()},set value(e){s(e),u()},get type(){return a()},set type(e){a(e),u()},get selected(){return r()},set selected(e){r(e),u()}},l=_();let o;var c=g(l);return b(c,s),x(l),n(()=>o=f(l,1,"prose svelte-uax3w3",null,o,{table:a()==="table",gallery:a()==="gallery",selected:r()})),i(d,l),y(v)}export{O as default}; +import{p,b as f}from"./i18n-DtG3MAQ1.js";import{M as m,t as n,a as i,O as y,P as u,R as h,Q as g,T as x}from"./index-BeNBoC9J.js";import{h as b}from"./html-DE4EmiOG.js";var _=h("
        ");function O(d,t){m(t,!1);let s=p(t,"value",12),a=p(t,"type",12),r=p(t,"selected",12,!1);var v={get value(){return s()},set value(e){s(e),u()},get type(){return a()},set type(e){a(e),u()},get selected(){return r()},set selected(e){r(e),u()}},l=_();let o;var c=g(l);return b(c,s),x(l),n(()=>o=f(l,1,"prose svelte-uax3w3",null,o,{table:a()==="table",gallery:a()==="gallery",selected:r()})),i(d,l),y(v)}export{O as default}; diff --git a/assets/Example-DXbKzhJW.js b/assets/Example-CDBVWKus.js similarity index 66% rename from assets/Example-DXbKzhJW.js rename to assets/Example-CDBVWKus.js index d0d66e604926e20ef1eebbdcc6a56b7a62b2ac77..3a2b814bf44519d4a502b7f08a9dbecb74723816 100644 --- a/assets/Example-DXbKzhJW.js +++ b/assets/Example-CDBVWKus.js @@ -1 +1 @@ -import{p as v,b as d}from"./i18n-CPHyzK9b.js";import{t as c,a as f,R as m,X as i,Q as u,T as o}from"./index-DydPgVMC.js";var x=m("
        ");function y(l,e){let s=v(e,"selected",3,!1);var t=x();let a;var r=u(t,!0);o(t),c(()=>{a=d(t,1,"svelte-vxg88u",null,a,{table:e.type==="table",gallery:e.type==="gallery",selected:s()}),i(r,e.value?e.value:"")}),f(l,t)}export{y as default}; +import{p as v,b as d}from"./i18n-DtG3MAQ1.js";import{t as c,a as f,R as m,X as i,Q as u,T as o}from"./index-BeNBoC9J.js";var x=m("
        ");function y(l,e){let s=v(e,"selected",3,!1);var t=x();let a;var r=u(t,!0);o(t),c(()=>{a=d(t,1,"svelte-vxg88u",null,a,{table:e.type==="table",gallery:e.type==="gallery",selected:s()}),i(r,e.value?e.value:"")}),f(l,t)}export{y as default}; diff --git a/assets/Example-DCvUey5Q.js b/assets/Example-CGtPi4dj.js similarity index 78% rename from assets/Example-DCvUey5Q.js rename to assets/Example-CGtPi4dj.js index 7d8b053d2dbb5e391f385015dc43c8db18901465..d0ef9bf7a2fecc15979c368d6a8f12f42f5b9168 100644 --- a/assets/Example-DCvUey5Q.js +++ b/assets/Example-CGtPi4dj.js @@ -1 +1 @@ -import{p as u,b as n}from"./i18n-CPHyzK9b.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-DydPgVMC.js";var b=g("
        ");function O(c,t){o(t,!1);let l=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return l()},set value(e){l(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},s=b();let v;var f=h(s,!0);return _(s),m(()=>{v=n(s,1,"svelte-l6o67f",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,l()!==null?l():"")}),i(c,s),y(d)}export{O as default}; +import{p as u,b as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-BeNBoC9J.js";var b=g("
        ");function O(c,t){o(t,!1);let l=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return l()},set value(e){l(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},s=b();let v;var f=h(s,!0);return _(s),m(()=>{v=n(s,1,"svelte-l6o67f",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,l()!==null?l():"")}),i(c,s),y(d)}export{O as default}; diff --git a/assets/Example-Cjtz6ob8.js b/assets/Example-CJXDEOIL.js similarity index 78% rename from assets/Example-Cjtz6ob8.js rename to assets/Example-CJXDEOIL.js index 758c60704e89d083b8e89facf3e9f5abae1e969d..12ebbc6adbccd22a57c084db8c9a306e260f1617 100644 --- a/assets/Example-Cjtz6ob8.js +++ b/assets/Example-CJXDEOIL.js @@ -1 +1 @@ -import{p as u,f,b as n}from"./i18n-CPHyzK9b.js";import{M as v,t as m,a as y,O as g,P as c,R as i}from"./index-DydPgVMC.js";var b=i("
        ");function x(p,t){v(t,!1);let l=u(t,"value",12),a=u(t,"type",12),s=u(t,"selected",12,!1);var d={get value(){return l()},set value(e){l(e),c()},get type(){return a()},set type(e){a(e),c()},get selected(){return s()},set selected(e){s(e),c()}},r=b();let o;return m(()=>{f(r,`background-color: ${(l()?l():"black")??""}`),o=n(r,1,"svelte-1wshq4n",null,o,{table:a()==="table",gallery:a()==="gallery",selected:s()})}),y(p,r),g(d)}export{x as default}; +import{p as u,f,b as n}from"./i18n-DtG3MAQ1.js";import{M as v,t as m,a as y,O as g,P as c,R as i}from"./index-BeNBoC9J.js";var b=i("
        ");function x(p,t){v(t,!1);let l=u(t,"value",12),a=u(t,"type",12),s=u(t,"selected",12,!1);var d={get value(){return l()},set value(e){l(e),c()},get type(){return a()},set type(e){a(e),c()},get selected(){return s()},set selected(e){s(e),c()}},r=b();let o;return m(()=>{f(r,`background-color: ${(l()?l():"black")??""}`),o=n(r,1,"svelte-1wshq4n",null,o,{table:a()==="table",gallery:a()==="gallery",selected:s()})}),y(p,r),g(d)}export{x as default}; diff --git a/assets/Example-Cpd2Jjnh.js b/assets/Example-CKTv7ur-.js similarity index 76% rename from assets/Example-Cpd2Jjnh.js rename to assets/Example-CKTv7ur-.js index 6a338ba078d9d263c76981082b21a98df7d48656..9a4c5a93092cf6a3b7c6531cbad282a1126216cf 100644 --- a/assets/Example-Cpd2Jjnh.js +++ b/assets/Example-CKTv7ur-.js @@ -1 +1 @@ -import{p as m,i as v,b as w}from"./i18n-CPHyzK9b.js";import{M as A,a3 as f,N as p,a as o,O as E,Q as I,$ as M,Z as t,T as N,t as O,R as Q,aa as R,a2 as T}from"./index-DydPgVMC.js";import{V as Z}from"./Video-BOdhnjQz.js";import"./snippet-BtHMuX3s.js";import"./actions-4RaHFoGI.js";import"./universal-C9tCO36V.js";var q=Q("
        ");function H(c,a){A(a,!0);let _=m(a,"selected",3,!1),i=m(a,"value",3,null),e=R(void 0);async function y(){t(e)&&(t(e).muted=!0,t(e).playsInline=!0,t(e).controls=!1,t(e).setAttribute("muted",""),await t(e).play(),t(e).pause())}var n=f(),g=p(n);{var b=s=>{var u=f(),h=p(u);{var k=l=>{var r=q();let d;var x=I(r);{let V=T(()=>i()?.url);Z(x,{muted:!0,playsinline:!0,onloadeddata:y,onmouseover:()=>t(e)?.play(),onmouseout:()=>t(e)?.pause(),get src(){return t(V)},is_stream:!1,get loop(){return a.loop},get node(){return t(e)},set node(j){M(e,j,!0)}})}N(r),O(()=>d=w(r,1,"container svelte-cjpdkh",null,d,{table:a.type==="table",gallery:a.type==="gallery",selected:_()})),o(l,r)};v(h,l=>{l(k)})}o(s,u)};v(g,s=>{i()&&s(b)})}o(c,n),E()}export{H as default}; +import{p as m,i as v,b as w}from"./i18n-DtG3MAQ1.js";import{M as A,a3 as f,N as p,a as o,O as E,Q as I,$ as M,Z as t,T as N,t as O,R as Q,aa as R,a2 as T}from"./index-BeNBoC9J.js";import{V as Z}from"./Video-BXpoIN7o.js";import"./snippet-BRIBYCwB.js";import"./actions-BbCJS635.js";import"./universal-DqSjxxHG.js";var q=Q("
        ");function H(c,a){A(a,!0);let _=m(a,"selected",3,!1),i=m(a,"value",3,null),e=R(void 0);async function y(){t(e)&&(t(e).muted=!0,t(e).playsInline=!0,t(e).controls=!1,t(e).setAttribute("muted",""),await t(e).play(),t(e).pause())}var n=f(),g=p(n);{var b=s=>{var u=f(),h=p(u);{var k=l=>{var r=q();let d;var x=I(r);{let V=T(()=>i()?.url);Z(x,{muted:!0,playsinline:!0,onloadeddata:y,onmouseover:()=>t(e)?.play(),onmouseout:()=>t(e)?.pause(),get src(){return t(V)},is_stream:!1,get loop(){return a.loop},get node(){return t(e)},set node(j){M(e,j,!0)}})}N(r),O(()=>d=w(r,1,"container svelte-cjpdkh",null,d,{table:a.type==="table",gallery:a.type==="gallery",selected:_()})),o(l,r)};v(h,l=>{l(k)})}o(s,u)};v(g,s=>{i()&&s(b)})}o(c,n),E()}export{H as default}; diff --git a/assets/Example-D-alj4yz.js b/assets/Example-CYA1ZfQi.js similarity index 51% rename from assets/Example-D-alj4yz.js rename to assets/Example-CYA1ZfQi.js index 5f92decdcdfc8f591a8bbee7ca323b05b7ab7e5e..3a80eed8c8d4cb1a980b9b32dc59f06d4e441147 100644 --- a/assets/Example-D-alj4yz.js +++ b/assets/Example-CYA1ZfQi.js @@ -1 +1 @@ -import{p as o,e as c,b as n}from"./i18n-CPHyzK9b.js";import{M as v,Z as f,t as g,a as y,O as _,P as p,Q as b,ad as h,x,v as k,R as w,T as I}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as q}from"./Image-CZ1Hb99p.js";/* empty css */import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";/* empty css */import"./Upload-Bq9KuxCu.js";/* empty css */import"./snippet-BtHMuX3s.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./actions-4RaHFoGI.js";var E=w("
        ");function G(m,a){v(a,!1);let t=o(a,"value",12),r=o(a,"type",12),l=o(a,"selected",12,!1);var u={get value(){return t()},set value(e){t(e),p()},get type(){return r()},set type(e){r(e),p()},get selected(){return l()},set selected(e){l(e),p()}};c();var s=E();let i;var d=b(s);{let e=h(()=>(x(t()),k(()=>t().composite?.url||t().background?.url)));q(d,{get src(){return f(e)},alt:""})}return I(s),g(()=>i=n(s,1,"container svelte-aw21w",null,i,{table:r()==="table",gallery:r()==="gallery",selected:l()})),y(m,s),_(u)}export{G as default}; +import{p as o,e as c,b as n}from"./i18n-DtG3MAQ1.js";import{M as v,Z as f,t as g,a as y,O as _,P as p,Q as b,ad as h,x,v as k,R as w,T as I}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as q}from"./Image-ALBOEs1f.js";/* empty css */import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";/* empty css */import"./Upload-CGTpHDBO.js";/* empty css */import"./snippet-BRIBYCwB.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./actions-BbCJS635.js";var E=w("
        ");function G(m,a){v(a,!1);let t=o(a,"value",12),r=o(a,"type",12),l=o(a,"selected",12,!1);var u={get value(){return t()},set value(e){t(e),p()},get type(){return r()},set type(e){r(e),p()},get selected(){return l()},set selected(e){l(e),p()}};c();var s=E();let i;var d=b(s);{let e=h(()=>(x(t()),k(()=>t().composite?.url||t().background?.url)));q(d,{get src(){return f(e)},alt:""})}return I(s),g(()=>i=n(s,1,"container svelte-aw21w",null,i,{table:r()==="table",gallery:r()==="gallery",selected:l()})),y(m,s),_(u)}export{G as default}; diff --git a/assets/Example-oI9QHs-R.js b/assets/Example-CpSLgFlm.js similarity index 71% rename from assets/Example-oI9QHs-R.js rename to assets/Example-CpSLgFlm.js index fdfc7bb55799a59bbce05463b11176a851cf09df..dddbf6c25de63421fa33b9977ef96c5dd13e73d7 100644 --- a/assets/Example-oI9QHs-R.js +++ b/assets/Example-CpSLgFlm.js @@ -1 +1 @@ -import{p as o,e as m,i as v,b as f}from"./i18n-CPHyzK9b.js";import{M as g,t as y,a as _,O as b,P as p,R as h,Q as x,x as k,v as I,T as E}from"./index-DydPgVMC.js";import{I as M}from"./Image-CZ1Hb99p.js";/* empty css */import"./misc-Dkc5KZ-v.js";/* empty css */var O=h("
        ");function q(u,a){g(a,!1);let t=o(a,"value",12),r=o(a,"type",12),l=o(a,"selected",12,!1);var d={get value(){return t()},set value(e){t(e),p()},get type(){return r()},set type(e){r(e),p()},get selected(){return l()},set selected(e){l(e),p()}};m();var s=O();let i;var c=x(s);{var n=e=>{M(e,{get src(){return k(t()),I(()=>t().url)},alt:""})};v(c,e=>{t()&&e(n)})}return E(s),y(()=>i=f(s,1,"container svelte-1pdautr",null,i,{table:r()==="table",gallery:r()==="gallery",selected:l(),border:t()})),_(u,s),b(d)}export{q as default}; +import{p as o,e as m,i as v,b as f}from"./i18n-DtG3MAQ1.js";import{M as g,t as y,a as _,O as b,P as p,R as h,Q as x,x as k,v as I,T as E}from"./index-BeNBoC9J.js";import{I as M}from"./Image-ALBOEs1f.js";/* empty css */import"./misc-D-Y84gKJ.js";/* empty css */var O=h("
        ");function q(u,a){g(a,!1);let t=o(a,"value",12),r=o(a,"type",12),l=o(a,"selected",12,!1);var d={get value(){return t()},set value(e){t(e),p()},get type(){return r()},set type(e){r(e),p()},get selected(){return l()},set selected(e){l(e),p()}};m();var s=O();let i;var c=x(s);{var n=e=>{M(e,{get src(){return k(t()),I(()=>t().url)},alt:""})};v(c,e=>{t()&&e(n)})}return E(s),y(()=>i=f(s,1,"container svelte-1pdautr",null,i,{table:r()==="table",gallery:r()==="gallery",selected:l(),border:t()})),_(u,s),b(d)}export{q as default}; diff --git a/assets/Example-CyVYJU_i.js b/assets/Example-CyVYJU_i.js new file mode 100644 index 0000000000000000000000000000000000000000..0ab1cb528e65dc0ed073836e3bcb4dc2fa33a981 --- /dev/null +++ b/assets/Example-CyVYJU_i.js @@ -0,0 +1 @@ +import"./i18n-DtG3MAQ1.js";import{a4 as p,t as s,a as x,X as f,a5 as m}from"./index-BeNBoC9J.js";function l(a,e){m();var t=p();s(()=>f(t,e.value||"")),x(a,t)}export{l as default}; diff --git a/assets/Example-Cr4dhaJx.js b/assets/Example-D1yz72bP.js similarity index 81% rename from assets/Example-Cr4dhaJx.js rename to assets/Example-D1yz72bP.js index 8e269a680e887a10f9df4d9edf1f8dc40a63df0f..44a954113cb09b3935605a650cc95e693a156ac4 100644 --- a/assets/Example-Cr4dhaJx.js +++ b/assets/Example-D1yz72bP.js @@ -1 +1 @@ -import{p as c,e as h,d as S,b as z}from"./i18n-CPHyzK9b.js";import{M,a7 as P,t as k,x as w,v as E,X as O,a as Q,O as R,P as o,R as T,Q as W,$ as v,a0 as m,Z as p,T as X}from"./index-DydPgVMC.js";import{b as Z}from"./size-D4lmUoTq.js";/* empty css */var j=T("
        ");function D(y,a){M(a,!1);let l=c(a,"value",12),r=c(a,"type",12),n=c(a,"selected",12,!1),d=m(),u=m();function _(e,s){e.style.setProperty("--local-text-width",`${s&&s<150?s:200}px`),e.style.whiteSpace="unset"}function b(e,s=60){if(!e)return"";const i=String(e);return i.length<=s?i:i.slice(0,s)+"..."}P(()=>{_(p(u),p(d))});var g={get value(){return l()},set value(e){l(e),o()},get type(){return r()},set type(e){r(e),o()},get selected(){return n()},set selected(e){n(e),o()}};h();var t=j();let f;var x=W(t,!0);return X(t),S(t,e=>v(u,e),()=>p(u)),k(e=>{f=z(t,1,"svelte-1w3nss4",null,f,{table:r()==="table",gallery:r()==="gallery",selected:n()}),O(x,e)},[()=>(w(l()),E(()=>b(l())))]),Z(t,"clientWidth",e=>v(d,e)),Q(y,t),R(g)}export{D as default}; +import{p as c,e as h,d as S,b as z}from"./i18n-DtG3MAQ1.js";import{M,a7 as P,t as k,x as w,v as E,X as O,a as Q,O as R,P as o,R as T,Q as W,$ as v,a0 as m,Z as p,T as X}from"./index-BeNBoC9J.js";import{b as Z}from"./size-ChvveZyb.js";/* empty css */var j=T("
        ");function D(y,a){M(a,!1);let l=c(a,"value",12),r=c(a,"type",12),n=c(a,"selected",12,!1),d=m(),u=m();function _(e,s){e.style.setProperty("--local-text-width",`${s&&s<150?s:200}px`),e.style.whiteSpace="unset"}function b(e,s=60){if(!e)return"";const i=String(e);return i.length<=s?i:i.slice(0,s)+"..."}P(()=>{_(p(u),p(d))});var g={get value(){return l()},set value(e){l(e),o()},get type(){return r()},set type(e){r(e),o()},get selected(){return n()},set selected(e){n(e),o()}};h();var t=j();let f;var x=W(t,!0);return X(t),S(t,e=>v(u,e),()=>p(u)),k(e=>{f=z(t,1,"svelte-1w3nss4",null,f,{table:r()==="table",gallery:r()==="gallery",selected:n()}),O(x,e)},[()=>(w(l()),E(()=>b(l())))]),Z(t,"clientWidth",e=>v(d,e)),Q(y,t),R(g)}export{D as default}; diff --git a/assets/Example-9DdwI8aj.js b/assets/Example-D4lnSVYE.js similarity index 80% rename from assets/Example-9DdwI8aj.js rename to assets/Example-D4lnSVYE.js index cb653abbafd9b55ed37a884a556df8f1041110cb..6ef42233e0e4a27584cdc1533574c0135154a751 100644 --- a/assets/Example-9DdwI8aj.js +++ b/assets/Example-D4lnSVYE.js @@ -1 +1 @@ -import{p as u,b as y}from"./i18n-CPHyzK9b.js";import{M as m,t as g,x,v as _,X as h,a as b,O,P as p,R as S,Q as c,T as n}from"./index-DydPgVMC.js";var k=S("
         
        ");function J(f,t){m(t,!1);let a=u(t,"value",12),s=u(t,"type",12),r=u(t,"selected",12,!1);var i={get value(){return a()},set value(e){a(e),p()},get type(){return s()},set type(e){s(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=k();let v;var d=c(l),o=c(d,!0);return n(d),n(l),g(e=>{v=y(l,1,"svelte-1quvy15",null,v,{table:s()==="table",gallery:s()==="gallery",selected:r()}),h(o,e)},[()=>(x(a()),_(()=>JSON.stringify(a(),null,2)))]),b(f,l),O(i)}export{J as default}; +import{p as u,b as y}from"./i18n-DtG3MAQ1.js";import{M as m,t as g,x,v as _,X as h,a as b,O,P as p,R as S,Q as c,T as n}from"./index-BeNBoC9J.js";var k=S("
         
        ");function J(f,t){m(t,!1);let a=u(t,"value",12),s=u(t,"type",12),r=u(t,"selected",12,!1);var i={get value(){return a()},set value(e){a(e),p()},get type(){return s()},set type(e){s(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=k();let v;var d=c(l),o=c(d,!0);return n(d),n(l),g(e=>{v=y(l,1,"svelte-1quvy15",null,v,{table:s()==="table",gallery:s()==="gallery",selected:r()}),h(o,e)},[()=>(x(a()),_(()=>JSON.stringify(a(),null,2)))]),b(f,l),O(i)}export{J as default}; diff --git a/assets/Example-DeD_Ynkp.js b/assets/Example-D7acdHWE.js similarity index 90% rename from assets/Example-DeD_Ynkp.js rename to assets/Example-D7acdHWE.js index 6fc73472af7fff449ca84cb8f81f9fadc0341f7c..9c134fdfed76cd26f42c425aec8a44e9ebfe9952 100644 --- a/assets/Example-DeD_Ynkp.js +++ b/assets/Example-D7acdHWE.js @@ -1 +1 @@ -import{p,e as ve,i as m,b as X,q as Z,w as j}from"./i18n-CPHyzK9b.js";import{M as ne,a3 as z,N,a,O as de,P as x,Q as h,T as u,t as k,U as B,$ as C,R as l,a0 as oe,a4 as ce,X as D,Z as y,v as A,S as F,x as G}from"./index-DydPgVMC.js";var fe=l('
        Empty
        '),ie=l(' '),_e=l('…'),me=l(''),ue=l("
        "),ye=l('
        ',1),be=l("
        ");function xe(H,o){ne(o,!1);let e=p(o,"value",12),c=p(o,"type",12),E=p(o,"selected",12,!1),b=p(o,"index",12),O=oe(!1),P=Array.isArray(e()),I=P&&(e().length===0||e()[0].length===0);var J={get value(){return e()},set value(t){e(t),x()},get type(){return c()},set type(t){c(t),x()},get selected(){return E()},set selected(t){E(t),x()},get index(){return b()},set index(t){b(t),x()}};ve();var Q=z(),K=N(Q);{var L=t=>{var r=be();let R;var V=h(r);{var W=v=>{var f=ce();k(()=>D(f,e())),a(v,f)},Y=v=>{var f=z(),w=N(f);{var $=n=>{var g=fe();a(n,g)},ee=n=>{var g=ye(),S=N(g),T=h(S);Z(T,5,()=>(G(e()),A(()=>e().slice(0,3))),j,(i,s)=>{var d=me(),U=h(d);Z(U,1,()=>(y(s),A(()=>y(s).slice(0,3))),j,(_,q)=>{var M=ie(),re=h(M,!0);u(M),k(()=>D(re,y(q))),a(_,M)});var se=F(U);{var le=_=>{var q=_e();a(_,q)};m(se,_=>{y(s),A(()=>y(s).length>3)&&_(le)})}u(d),a(i,d)}),u(T),u(S);var te=F(S,2);{var ae=i=>{var s=ue();let d;k(()=>d=X(s,1,"overlay svelte-4fmc1n",null,d,{odd:b()%2!=0,even:b()%2==0,button:c()==="gallery"})),a(i,s)};m(te,i=>{G(e()),A(()=>e().length>3)&&i(ae)})}a(n,g)};m(w,n=>{I?n($):n(ee,!1)},!0)}a(v,f)};m(V,v=>{typeof e()=="string"?v(W):v(Y,!1)})}u(r),k(()=>R=X(r,1,"svelte-4fmc1n",null,R,{table:c()==="table",gallery:c()==="gallery",selected:E()})),B("mouseenter",r,()=>C(O,!0)),B("mouseleave",r,()=>C(O,!1)),a(t,r)};m(K,t=>{P&&t(L)})}return a(H,Q),de(J)}export{xe as default}; +import{p,e as ve,i as m,b as X,q as Z,w as j}from"./i18n-DtG3MAQ1.js";import{M as ne,a3 as z,N,a,O as de,P as x,Q as h,T as u,t as k,U as B,$ as C,R as l,a0 as oe,a4 as ce,X as D,Z as y,v as A,S as F,x as G}from"./index-BeNBoC9J.js";var fe=l('
        Empty
        '),ie=l(' '),_e=l('…'),me=l(''),ue=l("
        "),ye=l('
        ',1),be=l("
        ");function xe(H,o){ne(o,!1);let e=p(o,"value",12),c=p(o,"type",12),E=p(o,"selected",12,!1),b=p(o,"index",12),O=oe(!1),P=Array.isArray(e()),I=P&&(e().length===0||e()[0].length===0);var J={get value(){return e()},set value(t){e(t),x()},get type(){return c()},set type(t){c(t),x()},get selected(){return E()},set selected(t){E(t),x()},get index(){return b()},set index(t){b(t),x()}};ve();var Q=z(),K=N(Q);{var L=t=>{var r=be();let R;var V=h(r);{var W=v=>{var f=ce();k(()=>D(f,e())),a(v,f)},Y=v=>{var f=z(),w=N(f);{var $=n=>{var g=fe();a(n,g)},ee=n=>{var g=ye(),S=N(g),T=h(S);Z(T,5,()=>(G(e()),A(()=>e().slice(0,3))),j,(i,s)=>{var d=me(),U=h(d);Z(U,1,()=>(y(s),A(()=>y(s).slice(0,3))),j,(_,q)=>{var M=ie(),re=h(M,!0);u(M),k(()=>D(re,y(q))),a(_,M)});var se=F(U);{var le=_=>{var q=_e();a(_,q)};m(se,_=>{y(s),A(()=>y(s).length>3)&&_(le)})}u(d),a(i,d)}),u(T),u(S);var te=F(S,2);{var ae=i=>{var s=ue();let d;k(()=>d=X(s,1,"overlay svelte-4fmc1n",null,d,{odd:b()%2!=0,even:b()%2==0,button:c()==="gallery"})),a(i,s)};m(te,i=>{G(e()),A(()=>e().length>3)&&i(ae)})}a(n,g)};m(w,n=>{I?n($):n(ee,!1)},!0)}a(v,f)};m(V,v=>{typeof e()=="string"?v(W):v(Y,!1)})}u(r),k(()=>R=X(r,1,"svelte-4fmc1n",null,R,{table:c()==="table",gallery:c()==="gallery",selected:E()})),B("mouseenter",r,()=>C(O,!0)),B("mouseleave",r,()=>C(O,!1)),a(t,r)};m(K,t=>{P&&t(L)})}return a(H,Q),de(J)}export{xe as default}; diff --git a/assets/Example-FH892lPu.js b/assets/Example-D9aSX7Ky.js similarity index 78% rename from assets/Example-FH892lPu.js rename to assets/Example-D9aSX7Ky.js index e6e278d1cf4f1188518d479454482f20509d94da..b18aa060233c2b17af8c2fd3e8cb1a13a2bcb92a 100644 --- a/assets/Example-FH892lPu.js +++ b/assets/Example-D9aSX7Ky.js @@ -1 +1 @@ -import{p as u,b as n}from"./i18n-CPHyzK9b.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as b,T as h}from"./index-DydPgVMC.js";var _=g("
        ");function M(c,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=_();let v;var f=b(l,!0);return h(l),m(()=>{v=n(l,1,"svelte-111fb3k",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(c,l),y(d)}export{M as default}; +import{p as u,b as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as b,T as h}from"./index-BeNBoC9J.js";var _=g("
        ");function M(c,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=_();let v;var f=b(l,!0);return h(l),m(()=>{v=n(l,1,"svelte-111fb3k",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(c,l),y(d)}export{M as default}; diff --git a/assets/Example-CT_gDfRl.js b/assets/Example-DDux58gL.js similarity index 85% rename from assets/Example-CT_gDfRl.js rename to assets/Example-DDux58gL.js index a9702c58477d856df035efb970e23df93e8d2798..85b888081b82596447f4d820cd9a62f807742c78 100644 --- a/assets/Example-CT_gDfRl.js +++ b/assets/Example-DDux58gL.js @@ -1 +1 @@ -import{p as c,e as f,b as w,a as n}from"./i18n-CPHyzK9b.js";import{M as o,t as b,a as x,O as h,P as i,S,R as k,Q as E,x as p,v as u,a5 as M,T as O}from"./index-DydPgVMC.js";var P=k('
        ');function T(g,t){o(t,!1);let a=c(t,"value",12),s=c(t,"samples_dir",12),l=c(t,"type",12),d=c(t,"selected",12,!1);var y={get value(){return a()},set value(e){a(e),i()},get samples_dir(){return s()},set samples_dir(e){s(e),i()},get type(){return l()},set type(e){l(e),i()},get selected(){return d()},set selected(e){d(e),i()}};f();var r=P();let v;var m=E(r),_=S(m,2);return M(2),O(r),b(()=>{v=w(r,1,"wrap svelte-15cwyaw",null,v,{table:l()==="table",gallery:l()==="gallery",selected:d()}),n(m,"src",(p(s()),p(a()),u(()=>s()+a()[0]))),n(_,"src",(p(s()),p(a()),u(()=>s()+a()[1])))}),x(g,r),h(y)}export{T as default}; +import{p as c,e as f,b as w,a as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as b,a as x,O as h,P as i,S,R as k,Q as E,x as p,v as u,a5 as M,T as O}from"./index-BeNBoC9J.js";var P=k('
        ');function T(g,t){o(t,!1);let a=c(t,"value",12),s=c(t,"samples_dir",12),l=c(t,"type",12),d=c(t,"selected",12,!1);var y={get value(){return a()},set value(e){a(e),i()},get samples_dir(){return s()},set samples_dir(e){s(e),i()},get type(){return l()},set type(e){l(e),i()},get selected(){return d()},set selected(e){d(e),i()}};f();var r=P();let v;var m=E(r),_=S(m,2);return M(2),O(r),b(()=>{v=w(r,1,"wrap svelte-15cwyaw",null,v,{table:l()==="table",gallery:l()==="gallery",selected:d()}),n(m,"src",(p(s()),p(a()),u(()=>s()+a()[0]))),n(_,"src",(p(s()),p(a()),u(()=>s()+a()[1])))}),x(g,r),h(y)}export{T as default}; diff --git a/assets/Example-DuOJfHh3.js b/assets/Example-DOrirSD_.js similarity index 76% rename from assets/Example-DuOJfHh3.js rename to assets/Example-DOrirSD_.js index ad169440e46af68ca980f6f78a4b642eb57e5905..1fcff19c24a55b4291007f7defb31f9334cfb552 100644 --- a/assets/Example-DuOJfHh3.js +++ b/assets/Example-DOrirSD_.js @@ -1 +1 @@ -import{p as a,b as h}from"./i18n-CPHyzK9b.js";import{M as b,Z as x,t as k,a as y,O as z,P as r,Q as M,ad as S,x as q,v as w,R as C,T as E}from"./index-DydPgVMC.js";import{M as O}from"./MarkdownCode-BTj729_f.js";/* empty css */import"./html-BZIV6tyB.js";import"./prism-python-BGiTAEDL.js";import"./index-B_pwUImq.js";var P=C("
        ");function D(f,t){b(t,!1);let l=a(t,"value",12),s=a(t,"type",12),n=a(t,"selected",12,!1),u=a(t,"sanitize_html",12),d=a(t,"line_breaks",12),m=a(t,"latex_delimiters",12);function g(e,c=60){if(!e)return"";const _=String(e);return _.length<=c?_:_.slice(0,c)+"..."}var v={get value(){return l()},set value(e){l(e),r()},get type(){return s()},set type(e){s(e),r()},get selected(){return n()},set selected(e){n(e),r()},get sanitize_html(){return u()},set sanitize_html(e){u(e),r()},get line_breaks(){return d()},set line_breaks(e){d(e),r()},get latex_delimiters(){return m()},set latex_delimiters(e){m(e),r()}},i=P();let o;var p=M(i);{let e=S(()=>(q(l()),w(()=>g(l()))));O(p,{get message(){return x(e)},get latex_delimiters(){return m()},get sanitize_html(){return u()},get line_breaks(){return d()},chatbot:!1})}return E(i),k(()=>o=h(i,1,"prose svelte-13sf037",null,o,{table:s()==="table",gallery:s()==="gallery",selected:n()})),y(f,i),z(v)}export{D as default}; +import{p as a,b as h}from"./i18n-DtG3MAQ1.js";import{M as b,Z as x,t as k,a as y,O as z,P as r,Q as M,ad as S,x as q,v as w,R as C,T as E}from"./index-BeNBoC9J.js";import{M as O}from"./MarkdownCode-QLelNkfo.js";/* empty css */import"./html-DE4EmiOG.js";import"./prism-python-DV2ZTlpc.js";import"./index-B_pwUImq.js";var P=C("
        ");function D(f,t){b(t,!1);let l=a(t,"value",12),s=a(t,"type",12),n=a(t,"selected",12,!1),u=a(t,"sanitize_html",12),d=a(t,"line_breaks",12),m=a(t,"latex_delimiters",12);function g(e,c=60){if(!e)return"";const _=String(e);return _.length<=c?_:_.slice(0,c)+"..."}var v={get value(){return l()},set value(e){l(e),r()},get type(){return s()},set type(e){s(e),r()},get selected(){return n()},set selected(e){n(e),r()},get sanitize_html(){return u()},set sanitize_html(e){u(e),r()},get line_breaks(){return d()},set line_breaks(e){d(e),r()},get latex_delimiters(){return m()},set latex_delimiters(e){m(e),r()}},i=P();let o;var p=M(i);{let e=S(()=>(q(l()),w(()=>g(l()))));O(p,{get message(){return x(e)},get latex_delimiters(){return m()},get sanitize_html(){return u()},get line_breaks(){return d()},chatbot:!1})}return E(i),k(()=>o=h(i,1,"prose svelte-13sf037",null,o,{table:s()==="table",gallery:s()==="gallery",selected:n()})),y(f,i),z(v)}export{D as default}; diff --git a/assets/Example-BeGmkx97.js b/assets/Example-DRaImiKg.js similarity index 82% rename from assets/Example-BeGmkx97.js rename to assets/Example-DRaImiKg.js index d7c21dc6438cee9b5d145b58450f75eba13f2d3a..55952f3b9bdf7e8073fa3e360173f69a6073eb65 100644 --- a/assets/Example-BeGmkx97.js +++ b/assets/Example-DRaImiKg.js @@ -1 +1 @@ -import{p as l,e as v,b as h}from"./i18n-CPHyzK9b.js";import{M as g,t as y,a as x,O as _,P as r,R as b,X as j,Q as E,T as M}from"./index-DydPgVMC.js";var O=b("
        ");function S(d,t){g(t,!1);let c=l(t,"value",12),s=l(t,"type",12),n=l(t,"selected",12,!1),i=l(t,"choices",12),f=c().map(e=>i().find(p=>p[1]===e)?.[0]).filter(e=>e!==void 0).join(", ");var o={get value(){return c()},set value(e){c(e),r()},get type(){return s()},set type(e){s(e),r()},get selected(){return n()},set selected(e){n(e),r()},get choices(){return i()},set choices(e){i(e),r()}};v();var a=O();let u;var m=E(a,!0);return M(a),y(()=>{u=h(a,1,"svelte-fp2dl0",null,u,{table:s()==="table",gallery:s()==="gallery",selected:n()}),j(m,f)}),x(d,a),_(o)}export{S as default}; +import{p as l,e as v,b as h}from"./i18n-DtG3MAQ1.js";import{M as g,t as y,a as x,O as _,P as r,R as b,X as j,Q as E,T as M}from"./index-BeNBoC9J.js";var O=b("
        ");function S(d,t){g(t,!1);let c=l(t,"value",12),s=l(t,"type",12),n=l(t,"selected",12,!1),i=l(t,"choices",12),f=c().map(e=>i().find(p=>p[1]===e)?.[0]).filter(e=>e!==void 0).join(", ");var o={get value(){return c()},set value(e){c(e),r()},get type(){return s()},set type(e){s(e),r()},get selected(){return n()},set selected(e){n(e),r()},get choices(){return i()},set choices(e){i(e),r()}};v();var a=O();let u;var m=E(a,!0);return M(a),y(()=>{u=h(a,1,"svelte-fp2dl0",null,u,{table:s()==="table",gallery:s()==="gallery",selected:n()}),j(m,f)}),x(d,a),_(o)}export{S as default}; diff --git a/assets/Example-BZRf8B4s.js b/assets/Example-DbIBQAf_.js similarity index 76% rename from assets/Example-BZRf8B4s.js rename to assets/Example-DbIBQAf_.js index 46479c841028ccbd498fbd6c042b63697b4c8039..dd6b2afab9f9932914da19844be74cd4d320b92a 100644 --- a/assets/Example-BZRf8B4s.js +++ b/assets/Example-DbIBQAf_.js @@ -1 +1 @@ -import{p as v,e as m}from"./i18n-CPHyzK9b.js";import{M as u,t as n,a as _,O as f,P as d,R as h,X as c,x as s,v as r,Q as x,T as g}from"./index-DydPgVMC.js";var b=h('
        ');function k(i,t){u(t,!1);let e=v(t,"value",28,()=>({visible:!0,home_page_title:"Home"}));var l={get value(){return e()},set value(p){e(p),d()}};m();var a=b(),o=x(a);return g(a),n(()=>c(o,`Navbar config: visible=${s(e()),r(()=>e().visible)??""}, home_page_title="${s(e()),r(()=>e().home_page_title)??""}"`)),_(i,a),f(l)}export{k as default}; +import{p as v,e as m}from"./i18n-DtG3MAQ1.js";import{M as u,t as n,a as _,O as f,P as d,R as h,X as c,x as s,v as r,Q as x,T as g}from"./index-BeNBoC9J.js";var b=h('
        ');function k(i,t){u(t,!1);let e=v(t,"value",28,()=>({visible:!0,home_page_title:"Home"}));var l={get value(){return e()},set value(p){e(p),d()}};m();var a=b(),o=x(a);return g(a),n(()=>c(o,`Navbar config: visible=${s(e()),r(()=>e().visible)??""}, home_page_title="${s(e()),r(()=>e().home_page_title)??""}"`)),_(i,a),f(l)}export{k as default}; diff --git a/assets/Example-CxjbLxdV.js b/assets/Example-Dg0CCdE9.js similarity index 75% rename from assets/Example-CxjbLxdV.js rename to assets/Example-Dg0CCdE9.js index 0bd9454e5a728e84283b68543b75e8035ace683a..fb1cf1f9254b602b4e5b8237f5ce0f2a2e1589ba 100644 --- a/assets/Example-CxjbLxdV.js +++ b/assets/Example-Dg0CCdE9.js @@ -1 +1 @@ -import{p as k,q as A,d as B,w as C,i as d,b as D,a as F}from"./i18n-CPHyzK9b.js";import{M as G,ac as H,t as _,a as o,O as J,S as K,$ as L,R as V,Q as z,aa as U,a3 as f,N as y,Z as t,X as I,T as S,a4 as Y}from"./index-DydPgVMC.js";import{b as $}from"./size-D4lmUoTq.js";import{I as ee}from"./Image-CZ1Hb99p.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */import{V as te}from"./Video-BOdhnjQz.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./snippet-BtHMuX3s.js";import"./actions-4RaHFoGI.js";import"./universal-C9tCO36V.js";var ae=V(""),se=V("

        ");function fe(q,m){G(m,!0);let u=k(m,"value",19,()=>({text:"",files:[]})),w=k(m,"selected",3,!1),v=U(0),n;function E(a,e){a.style.setProperty("--local-text-width",`${e&&e<150?e:200}px`),a.style.whiteSpace="unset"}H(()=>{n&&t(v)&&E(n,t(v))});var s=se();let g;var c=z(s),M=z(c,!0);S(c);var N=K(c,2);A(N,17,()=>u().files,C,(a,e)=>{var x=f(),O=y(x);{var P=r=>{ee(r,{get src(){return t(e).url},alt:""})},Q=r=>{var b=f(),R=y(b);{var T=i=>{te(i,{get src(){return t(e).url},alt:"",loop:!0,is_stream:!1})},W=i=>{var h=f(),X=y(h);{var Z=l=>{var p=ae();_(()=>F(p,"src",t(e).url)),o(l,p)},j=l=>{var p=Y();_(()=>I(p,t(e).orig_name)),o(l,p)};d(X,l=>{t(e).mime_type&&t(e).mime_type.includes("audio")?l(Z):l(j,!1)},!0)}o(i,h)};d(R,i=>{t(e).mime_type&&t(e).mime_type.includes("video")?i(T):i(W,!1)},!0)}o(r,b)};d(O,r=>{t(e).mime_type&&t(e).mime_type.includes("image")?r(P):r(Q,!1)})}o(a,x)}),S(s),B(s,a=>n=a,()=>n),_(()=>{g=D(s,1,"container svelte-kknkdu",null,g,{table:m.type==="table",gallery:m.type==="gallery",selected:w(),border:u()}),I(M,u().text?u().text:"")}),$(s,"clientWidth",a=>L(v,a)),o(q,s),J()}export{fe as default}; +import{p as k,q as A,d as B,w as C,i as d,b as D,a as F}from"./i18n-DtG3MAQ1.js";import{M as G,ac as H,t as _,a as o,O as J,S as K,$ as L,R as V,Q as z,aa as U,a3 as f,N as y,Z as t,X as I,T as S,a4 as Y}from"./index-BeNBoC9J.js";import{b as $}from"./size-ChvveZyb.js";import{I as ee}from"./Image-ALBOEs1f.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */import{V as te}from"./Video-BXpoIN7o.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./snippet-BRIBYCwB.js";import"./actions-BbCJS635.js";import"./universal-DqSjxxHG.js";var ae=V(""),se=V("

        ");function fe(q,m){G(m,!0);let u=k(m,"value",19,()=>({text:"",files:[]})),w=k(m,"selected",3,!1),v=U(0),n;function E(a,e){a.style.setProperty("--local-text-width",`${e&&e<150?e:200}px`),a.style.whiteSpace="unset"}H(()=>{n&&t(v)&&E(n,t(v))});var s=se();let g;var c=z(s),M=z(c,!0);S(c);var N=K(c,2);A(N,17,()=>u().files,C,(a,e)=>{var x=f(),O=y(x);{var P=r=>{ee(r,{get src(){return t(e).url},alt:""})},Q=r=>{var b=f(),R=y(b);{var T=i=>{te(i,{get src(){return t(e).url},alt:"",loop:!0,is_stream:!1})},W=i=>{var h=f(),X=y(h);{var Z=l=>{var p=ae();_(()=>F(p,"src",t(e).url)),o(l,p)},j=l=>{var p=Y();_(()=>I(p,t(e).orig_name)),o(l,p)};d(X,l=>{t(e).mime_type&&t(e).mime_type.includes("audio")?l(Z):l(j,!1)},!0)}o(i,h)};d(R,i=>{t(e).mime_type&&t(e).mime_type.includes("video")?i(T):i(W,!1)},!0)}o(r,b)};d(O,r=>{t(e).mime_type&&t(e).mime_type.includes("image")?r(P):r(Q,!1)})}o(a,x)}),S(s),B(s,a=>n=a,()=>n),_(()=>{g=D(s,1,"container svelte-kknkdu",null,g,{table:m.type==="table",gallery:m.type==="gallery",selected:w(),border:u()}),I(M,u().text?u().text:"")}),$(s,"clientWidth",a=>L(v,a)),o(q,s),J()}export{fe as default}; diff --git a/assets/Example-aWuNv4qC.js b/assets/Example-DoP5np0T.js similarity index 93% rename from assets/Example-aWuNv4qC.js rename to assets/Example-DoP5np0T.js index 6c9869169750918df1e1d8031a6d71f06eb5d55c..c9670ab08974f9c4f4fe911848e7d78289d361ba 100644 --- a/assets/Example-aWuNv4qC.js +++ b/assets/Example-DoP5np0T.js @@ -1 +1 @@ -import{p as M,e as U,i as c,b as V,q as W,a as N,w as Y}from"./i18n-CPHyzK9b.js";import{M as $,t as w,a as v,O as aa,P as O,R as o,x as P,v as r,Q as p,a3 as Z,N as j,Z as e,S as Q,T as _,X as z}from"./index-DydPgVMC.js";var ea=o(' '),ra=o('
        '),sa=o(' '),ta=o('
        ',2),va=o('
        '),la=o('
        '),ia=o("
        ");function da(A,h){$(h,!1);let s=M(h,"value",12),x=M(h,"type",12),b=M(h,"selected",12,!1);var B={get value(){return s()},set value(t){s(t),O()},get type(){return x()},set type(t){x(t),O()},get selected(){return b()},set selected(t){b(t),O()}};U();var y=ia();let R;var C=p(y);{var D=t=>{var m=la(),T=p(m);W(T,1,()=>(P(s()),r(()=>s().slice(0,3))),Y,(f,a)=>{var X=Z(),H=j(X);{var I=n=>{var d=ra(),u=p(d),k=Q(u,2);{var g=i=>{var l=ea(),S=p(l,!0);_(l),w(()=>z(S,(e(a),r(()=>e(a).caption)))),v(i,l)};c(k,i=>{e(a),r(()=>e(a).caption)&&i(g)})}_(d),w(()=>{N(u,"src",(e(a),r(()=>e(a).image.url))),N(u,"alt",(e(a),r(()=>e(a).caption||"")))}),v(n,d)},J=n=>{var d=Z(),u=j(d);{var k=g=>{var i=ta(),l=p(i);l.controls=!1,l.muted=!0;var S=Q(l,2);{var K=q=>{var E=sa(),L=p(E,!0);_(E),w(()=>z(L,(e(a),r(()=>e(a).caption)))),v(q,E)};c(S,q=>{e(a),r(()=>e(a).caption)&&q(K)})}_(i),w(()=>N(l,"src",(e(a),r(()=>e(a).video.url)))),v(g,i)};c(u,g=>{e(a),r(()=>"video"in e(a)&&e(a).video)&&g(k)},!0)}v(n,d)};c(H,n=>{e(a),r(()=>"image"in e(a)&&e(a).image)?n(I):n(J,!1)})}v(f,X)});var F=Q(T,2);{var G=f=>{var a=va();v(f,a)};c(F,f=>{P(s()),r(()=>s().length>3)&&f(G)})}_(m),v(t,m)};c(C,t=>{P(s()),r(()=>s()&&s().length>0)&&t(D)})}return _(y),w(()=>R=V(y,1,"container svelte-r81wri",null,R,{table:x()==="table",gallery:x()==="gallery",selected:b()})),v(A,y),aa(B)}export{da as default}; +import{p as M,e as U,i as c,b as V,q as W,a as N,w as Y}from"./i18n-DtG3MAQ1.js";import{M as $,t as w,a as v,O as aa,P as O,R as o,x as P,v as r,Q as p,a3 as Z,N as j,Z as e,S as Q,T as _,X as z}from"./index-BeNBoC9J.js";var ea=o(' '),ra=o('
        '),sa=o(' '),ta=o('
        ',2),va=o('
        '),la=o('
        '),ia=o("
        ");function da(A,h){$(h,!1);let s=M(h,"value",12),x=M(h,"type",12),b=M(h,"selected",12,!1);var B={get value(){return s()},set value(t){s(t),O()},get type(){return x()},set type(t){x(t),O()},get selected(){return b()},set selected(t){b(t),O()}};U();var y=ia();let R;var C=p(y);{var D=t=>{var m=la(),T=p(m);W(T,1,()=>(P(s()),r(()=>s().slice(0,3))),Y,(f,a)=>{var X=Z(),H=j(X);{var I=n=>{var d=ra(),u=p(d),k=Q(u,2);{var g=i=>{var l=ea(),S=p(l,!0);_(l),w(()=>z(S,(e(a),r(()=>e(a).caption)))),v(i,l)};c(k,i=>{e(a),r(()=>e(a).caption)&&i(g)})}_(d),w(()=>{N(u,"src",(e(a),r(()=>e(a).image.url))),N(u,"alt",(e(a),r(()=>e(a).caption||"")))}),v(n,d)},J=n=>{var d=Z(),u=j(d);{var k=g=>{var i=ta(),l=p(i);l.controls=!1,l.muted=!0;var S=Q(l,2);{var K=q=>{var E=sa(),L=p(E,!0);_(E),w(()=>z(L,(e(a),r(()=>e(a).caption)))),v(q,E)};c(S,q=>{e(a),r(()=>e(a).caption)&&q(K)})}_(i),w(()=>N(l,"src",(e(a),r(()=>e(a).video.url)))),v(g,i)};c(u,g=>{e(a),r(()=>"video"in e(a)&&e(a).video)&&g(k)},!0)}v(n,d)};c(H,n=>{e(a),r(()=>"image"in e(a)&&e(a).image)?n(I):n(J,!1)})}v(f,X)});var F=Q(T,2);{var G=f=>{var a=va();v(f,a)};c(F,f=>{P(s()),r(()=>s().length>3)&&f(G)})}_(m),v(t,m)};c(C,t=>{P(s()),r(()=>s()&&s().length>0)&&t(D)})}return _(y),w(()=>R=V(y,1,"container svelte-r81wri",null,R,{table:x()==="table",gallery:x()==="gallery",selected:b()})),v(A,y),aa(B)}export{da as default}; diff --git a/assets/Example-I6GSpyxR.js b/assets/Example-R1cs93ij.js similarity index 83% rename from assets/Example-I6GSpyxR.js rename to assets/Example-R1cs93ij.js index c3d6518e4ff19968c017c187663f7ee0ddcdad7e..5d5442580acc90fdfab7b09e8c4652eddb872834 100644 --- a/assets/Example-I6GSpyxR.js +++ b/assets/Example-R1cs93ij.js @@ -1 +1 @@ -import{p as r,e as g,b as h}from"./i18n-CPHyzK9b.js";import{M as y,$ as o,t as _,a as x,O as b,a0 as w,P as c,R as z,X as E,Z as M,Q as O,T as P}from"./index-DydPgVMC.js";var Q=z("
        ");function T(v,t){y(t,!1);let s=r(t,"value",12),a=r(t,"type",12),u=r(t,"selected",12,!1),n=r(t,"choices",12),i=w();if(s()===null)o(i,"");else{let e=n().find(p=>p[1]===s());o(i,e?e[0]:"")}var d={get value(){return s()},set value(e){s(e),c()},get type(){return a()},set type(e){a(e),c()},get selected(){return u()},set selected(e){u(e),c()},get choices(){return n()},set choices(e){n(e),c()}};g();var l=Q();let f;var m=O(l,!0);return P(l),_(()=>{f=h(l,1,"svelte-1vnwfzt",null,f,{table:a()==="table",gallery:a()==="gallery",selected:u()}),E(m,M(i))}),x(v,l),b(d)}export{T as default}; +import{p as r,e as g,b as h}from"./i18n-DtG3MAQ1.js";import{M as y,$ as o,t as _,a as x,O as b,a0 as w,P as c,R as z,X as E,Z as M,Q as O,T as P}from"./index-BeNBoC9J.js";var Q=z("
        ");function T(v,t){y(t,!1);let s=r(t,"value",12),a=r(t,"type",12),u=r(t,"selected",12,!1),n=r(t,"choices",12),i=w();if(s()===null)o(i,"");else{let e=n().find(p=>p[1]===s());o(i,e?e[0]:"")}var d={get value(){return s()},set value(e){s(e),c()},get type(){return a()},set type(e){a(e),c()},get selected(){return u()},set selected(e){u(e),c()},get choices(){return n()},set choices(e){n(e),c()}};g();var l=Q();let f;var m=O(l,!0);return P(l),_(()=>{f=h(l,1,"svelte-1vnwfzt",null,f,{table:a()==="table",gallery:a()==="gallery",selected:u()}),E(m,M(i))}),x(v,l),b(d)}export{T as default}; diff --git a/assets/Example-Biakqy76.js b/assets/Example-UB6M5PUH.js similarity index 76% rename from assets/Example-Biakqy76.js rename to assets/Example-UB6M5PUH.js index 2cf16ea9a0b9e668aa4b96a7d27fc05f59eea107..f4bf5ad25deda0bd23b6f24c9e812729ea92fc1f 100644 --- a/assets/Example-Biakqy76.js +++ b/assets/Example-UB6M5PUH.js @@ -1 +1 @@ -import{p as f,i as g}from"./i18n-CPHyzK9b.js";import{M as d,a3 as h,N as b,a as i,O as k,P as x,a4 as m,t as o,X as p}from"./index-DydPgVMC.js";function N(u,a){d(a,!1);let s=f(a,"title",12),r=f(a,"x",12),l=f(a,"y",12);var v={get title(){return s()},set title(t){s(t),x()},get x(){return r()},set x(t){r(t),x()},get y(){return l()},set y(t){l(t),x()}},n=h(),c=b(n);{var y=t=>{var e=m();o(()=>p(e,s())),i(t,e)},_=t=>{var e=m();o(()=>p(e,`${r()??""} x ${l()??""}`)),i(t,e)};g(c,t=>{s()?t(y):t(_,!1)})}return i(u,n),k(v)}export{N as default}; +import{p as f,i as g}from"./i18n-DtG3MAQ1.js";import{M as d,a3 as h,N as b,a as i,O as k,P as x,a4 as m,t as o,X as p}from"./index-BeNBoC9J.js";function N(u,a){d(a,!1);let s=f(a,"title",12),r=f(a,"x",12),l=f(a,"y",12);var v={get title(){return s()},set title(t){s(t),x()},get x(){return r()},set x(t){r(t),x()},get y(){return l()},set y(t){l(t),x()}},n=h(),c=b(n);{var y=t=>{var e=m();o(()=>p(e,s())),i(t,e)},_=t=>{var e=m();o(()=>p(e,`${r()??""} x ${l()??""}`)),i(t,e)};g(c,t=>{s()?t(y):t(_,!1)})}return i(u,n),k(v)}export{N as default}; diff --git a/assets/Example-BswZLX-K.js b/assets/Example-dwBneE8Q.js similarity index 78% rename from assets/Example-BswZLX-K.js rename to assets/Example-dwBneE8Q.js index 2fecae3115137ce4ffa3e2b97d2bf9fda136419c..0bc1a8a004781323cb7262b532a349811b7cf3cf 100644 --- a/assets/Example-BswZLX-K.js +++ b/assets/Example-dwBneE8Q.js @@ -1 +1 @@ -import{p as u,b as n}from"./i18n-CPHyzK9b.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-DydPgVMC.js";var b=g("
        ");function M(c,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=b();let v;var f=h(l,!0);return _(l),m(()=>{v=n(l,1,"svelte-9g2paw",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(c,l),y(d)}export{M as default}; +import{p as u,b as n}from"./i18n-DtG3MAQ1.js";import{M as o,t as m,a as i,O as y,P as p,R as g,X as x,Q as h,T as _}from"./index-BeNBoC9J.js";var b=g("
        ");function M(c,t){o(t,!1);let s=u(t,"value",12),a=u(t,"type",12),r=u(t,"selected",12,!1);var d={get value(){return s()},set value(e){s(e),p()},get type(){return a()},set type(e){a(e),p()},get selected(){return r()},set selected(e){r(e),p()}},l=b();let v;var f=h(l,!0);return _(l),m(()=>{v=n(l,1,"svelte-9g2paw",null,v,{table:a()==="table",gallery:a()==="gallery",selected:r()}),x(f,s())}),i(c,l),y(d)}export{M as default}; diff --git a/assets/ExtrasAsMetadata-CbU38CYg.js b/assets/ExtrasAsMetadata-DqS_eDQb.js similarity index 83% rename from assets/ExtrasAsMetadata-CbU38CYg.js rename to assets/ExtrasAsMetadata-DqS_eDQb.js index f3b10843a8542bd5916564d2a2e07b5fea15c90c..e8c04980a88c06dc63ef277a646530d89d53e6cd 100644 --- a/assets/ExtrasAsMetadata-CbU38CYg.js +++ b/assets/ExtrasAsMetadata-DqS_eDQb.js @@ -1 +1 @@ -import{aG as n,aH as d}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const r="ExtrasAsMetadata";class o{_assignExtras(s,t){if(t.extras&&Object.keys(t.extras).length>0){const a=s.metadata=s.metadata||{},e=a.gltf=a.gltf||{};e.extras=t.extras}}constructor(s){this.name=r,this.enabled=!0,this._loader=s}dispose(){this._loader=null}loadNodeAsync(s,t,a){return this._loader.loadNodeAsync(s,t,e=>{this._assignExtras(e,t),a(e)})}loadCameraAsync(s,t,a){return this._loader.loadCameraAsync(s,t,e=>{this._assignExtras(e,t),a(e)})}createMaterial(s,t,a){const e=this._loader.createMaterial(s,t,a);return this._assignExtras(e,t),e}loadAnimationAsync(s,t){return this._loader.loadAnimationAsync(s,t).then(a=>(this._assignExtras(a,t),a))}}n(r);d(r,!1,i=>new o(i));export{o as ExtrasAsMetadata}; +import{aG as n,aH as d}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";const r="ExtrasAsMetadata";class o{_assignExtras(s,t){if(t.extras&&Object.keys(t.extras).length>0){const a=s.metadata=s.metadata||{},e=a.gltf=a.gltf||{};e.extras=t.extras}}constructor(s){this.name=r,this.enabled=!0,this._loader=s}dispose(){this._loader=null}loadNodeAsync(s,t,a){return this._loader.loadNodeAsync(s,t,e=>{this._assignExtras(e,t),a(e)})}loadCameraAsync(s,t,a){return this._loader.loadCameraAsync(s,t,e=>{this._assignExtras(e,t),a(e)})}createMaterial(s,t,a){const e=this._loader.createMaterial(s,t,a);return this._assignExtras(e,t),e}loadAnimationAsync(s,t){return this._loader.loadAnimationAsync(s,t).then(a=>(this._assignExtras(a,t),a))}}n(r);d(r,!1,i=>new o(i));export{o as ExtrasAsMetadata}; diff --git a/assets/File-_VpQFuKr.js b/assets/File-CD333vfS.js similarity index 73% rename from assets/File-_VpQFuKr.js rename to assets/File-CD333vfS.js index 843ed7269509a77585f240c62f44759686836a4c..62b88d3b3ac2ff04e2b8af6710e30ddc1f59d151 100644 --- a/assets/File-_VpQFuKr.js +++ b/assets/File-CD333vfS.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as r,f as t}from"./index-DydPgVMC.js";var a=t('');function n(o){var e=a();r(o,e)}export{n as F}; +import"./i18n-DtG3MAQ1.js";import{a as r,f as t}from"./index-BeNBoC9J.js";var a=t('');function n(o){var e=a();r(o,e)}export{n as F}; diff --git a/assets/FileUpload-CCPLw8R5.js b/assets/FileUpload-h25zNPg5.js similarity index 93% rename from assets/FileUpload-CCPLw8R5.js rename to assets/FileUpload-h25zNPg5.js index 6967f695d3a1d21d430d7f1edf7222f83d086a13..49debe5121534b3a113be4939261490c02daca25 100644 --- a/assets/FileUpload-CCPLw8R5.js +++ b/assets/FileUpload-h25zNPg5.js @@ -1 +1 @@ -import{p as i,q as _e,i as C,b as fe,a as ee,f as ve,s as he}from"./i18n-CPHyzK9b.js";import{M as de,t as te,a as c,O as ge,Z as e,R as A,a2 as T,Q as y,ah as me,S as w,X as re,U as S,N as Y,a4 as be,aa as ae,$ as h,T as v,a5 as ye,a3 as we,G as Ae}from"./index-DydPgVMC.js";import{U as se}from"./Upload-Bq9KuxCu.js";import{I as ue,U as ke}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as xe}from"./BlockLabel-BzVeVrtL.js";import{C as pe}from"./Clear-BR8cTgGu.js";import{F as Be}from"./File-_VpQFuKr.js";import{I as ie}from"./IconButtonWrapper-PnNNNvqI.js";import{h as Te}from"./html-BZIV6tyB.js";import{D as ze}from"./DownloadLink-DM2QmhDx.js";const Ie=k=>{let r=["B","KB","MB","GB","PB"],l=0;for(;k>1024;)k/=1024,l++;let z=r[l];return k.toFixed(1)+" "+z};var Pe=A('⋮⋮'),Fe=A(" ⇣",1),De=A(''),Ee=A(' '),Ue=A('
        ');function Ce(k,r){de(r,!0);let l=i(r,"value",7),z=i(r,"selectable",3,!1),m=i(r,"height",3,void 0),R=i(r,"allow_reordering",3,!1),_=ae(null),d=ae(null);function q(a,n){h(_,n,!0),a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",n.toString()))}function I(a,n){if(a.preventDefault(),n===e(u).length-1){const t=a.currentTarget.getBoundingClientRect(),o=t.top+t.height/2;h(d,a.clientY>o?e(u).length:n,!0)}else h(d,n,!0);a.dataTransfer&&(a.dataTransfer.dropEffect="move")}function H(a){(!a.dataTransfer?.dropEffect||a.dataTransfer.dropEffect==="none")&&(h(_,null),h(d,null))}function P(a,n){if(a.preventDefault(),e(_)===null||e(_)===n)return;const t=Array.isArray(l())?[...l()]:[l()],[o]=t.splice(e(_),1);t.splice(e(d)===e(u).length?e(u).length:n,0,o);const b=Array.isArray(l())?t:t[0];r.onchange?.(b),h(_,null),h(d,null)}function F(a){const n=a.lastIndexOf(".");return n===-1?[a,""]:[a.slice(0,n),a.slice(n)]}let u=T(()=>(Array.isArray(l())?l():[l()]).map(a=>{const[n,t]=F(a.orig_name??"");return{...a,filename_stem:n,filename_ext:t}}));function K(a,n){const t=a.currentTarget;(a.target===t||t&&t.firstElementChild&&a.composedPath().includes(t.firstElementChild))&&r.onselect?.({value:e(u)[n].orig_name,index:n})}function N(a){const n=Array.isArray(l())?[...l()]:[l()],t=n.splice(a,1),o=Array.isArray(l())?n:n[0];l(o),r.ondelete?.(t[0]),r.onchange?.(o)}function D(a){r.ondownload?.(a)}const Q=typeof window<"u";var x=Ue();let W;var G=y(x),X=y(G);_e(X,23,()=>e(u),a=>a.url,(a,n,t)=>{var o=Ee();let b;o.__click=s=>{K(s,e(t))};var f=y(o),E=y(f);{var J=s=>{var g=Pe();c(s,g)};C(E,s=>{R()&&e(u).length>1&&s(J)})}var Z=w(E,2),j=y(Z,!0);v(Z);var L=w(Z,2),V=y(L,!0);v(L),v(f);var M=w(f),p=y(M);{var O=s=>{{let g=T(()=>Q&&window.__is_colab__?null:e(n).orig_name);ze(s,{get href(){return e(n).url},get download(){return e(g)},$$events:{click:()=>D(e(n))},children:(U,ne)=>{var oe=Fe(),ce=Y(oe);Te(ce,()=>e(n).size!=null?Ie(e(n).size):"(size unknown)"),ye(),c(U,oe)},$$slots:{default:!0}})}},$=s=>{var g=be();te(U=>re(g,U),[()=>r.i18n("file.uploading")]),c(s,g)};C(p,s=>{e(n).url?s(O):s($,!1)})}v(M);var le=w(M);{var B=s=>{var g=De(),U=y(g);U.__click=()=>{N(e(t))},U.__keydown=ne=>{ne.key==="Enter"&&N(e(t))},v(g),c(s,g)};C(le,s=>{e(u).length>1&&s(B)})}v(o),te(()=>{b=fe(o,1,"file svelte-ltvhae",null,b,{selectable:z(),dragging:e(_)===e(t),"drop-target":e(d)===e(t)||e(t)===e(u).length-1&&e(d)===e(u).length}),ee(o,"data-drop-target",e(d)===e(u).length&&e(t)===e(u).length-1||e(d)===e(t)+1?"after":"before"),ee(o,"draggable",R()&&e(u).length>1),ee(f,"aria-label",e(n).orig_name),re(j,e(n).filename_stem),re(V,e(n).filename_ext)}),S("dragstart",o,s=>q(s,e(t))),S("dragenter",o,s=>s.preventDefault()),S("dragover",o,s=>I(s,e(t))),S("drop",o,s=>P(s,e(t))),S("dragend",o,H),c(a,o)}),v(X),v(G),v(x),te(()=>W=ve(x,"",W,{"max-height":m()?typeof m()=="number"?m()+"px":m():"auto"})),c(k,x),ge()}me(["click","keydown"]);var Re=A(" ",1),Ge=A(" ",1),Le=A(" ",1);function Ze(k,r){de(r,!0);let l=i(r,"value",15),z=i(r,"show_label",3,!0),m=i(r,"file_count",3,"single"),R=i(r,"file_types",3,null),_=i(r,"selectable",3,!1),d=i(r,"height",3,void 0),q=i(r,"max_file_size",3,null),I=i(r,"uploading",15,!1),H=i(r,"allow_reordering",3,!1),P=i(r,"upload_promise",15),F=i(r,"buttons",3,null),u=i(r,"on_custom_button_click",3,null);async function K(t){Array.isArray(l())?l([...l(),...Array.isArray(t)?t:[t]]):l()?l([l(),...Array.isArray(t)?t:[t]]):l(t),await Ae(),r.onchange?.(l()),r.onupload?.(l())}function N(){l(null),r.onchange?.(null),r.onclear?.()}let D=ae(!1);var Q=Le(),x=Y(Q);{var W=t=>{ie(t,{get buttons(){return F()},get on_custom_button_click(){return u()}})};C(x,t=>{z()&&F()&&F().length>0&&t(W)})}var G=w(x,2);{let t=T(()=>!l()),o=T(()=>r.label||"File");xe(G,{get show_label(){return z()},get Icon(){return Be},get float(){return e(t)},get label(){return e(o)}})}var X=w(G,2);{var a=t=>{var o=Ge(),b=Y(o);{let E=T(()=>F()||[]);ie(b,{get buttons(){return e(E)},get on_custom_button_click(){return u()},children:(J,Z)=>{var j=Re(),L=Y(j);{var V=p=>{{let O=T(()=>r.i18n("common.upload"));ue(p,{get Icon(){return ke},get label(){return e(O)},children:($,le)=>{se($,{icon_upload:!0,onload:K,get filetype(){return R()},get file_count(){return m()},get max_file_size(){return q()},get root(){return r.root},get onerror(){return r.onerror},get stream_handler(){return r.stream_handler},get upload(){return r.upload},get upload_promise(){return P()},set upload_promise(B){P(B)},get dragging(){return e(D)},set dragging(B){h(D,B,!0)},get uploading(){return I()},set uploading(B){I(B)}})},$$slots:{default:!0}})}};C(L,p=>{m()==="single"&&(Array.isArray(l())?l().length>0:l()!==null)||p(V)})}var M=w(L,2);{let p=T(()=>r.i18n("common.clear"));ue(M,{get Icon(){return pe},get label(){return e(p)},onclick:O=>{O.stopPropagation(),N()}})}c(J,j)},$$slots:{default:!0}})}var f=w(b,2);Ce(f,{get i18n(){return r.i18n},get onselect(){return r.onselect},get selectable(){return _()},get value(){return l()},get height(){return d()},get onchange(){return r.onchange},get ondelete(){return r.ondelete},get allow_reordering(){return H()}}),c(t,o)},n=t=>{se(t,{onload:K,get filetype(){return R()},get file_count(){return m()},get max_file_size(){return q()},get root(){return r.root},get onerror(){return r.onerror},get stream_handler(){return r.stream_handler},get upload(){return r.upload},get height(){return d()},get upload_promise(){return P()},set upload_promise(o){P(o)},get dragging(){return e(D)},set dragging(o){h(D,o,!0)},get uploading(){return I()},set uploading(o){I(o)},children:(o,b)=>{var f=we(),E=Y(f);he(E,r,"default",{}),c(o,f)},$$slots:{default:!0}})};C(X,t=>{l()&&(!Array.isArray(l())||l().length>0)?t(a):t(n,!1)})}c(k,Q),ge()}export{Ce as F,Ze as a}; +import{p as i,q as _e,i as C,b as fe,a as ee,f as ve,s as he}from"./i18n-DtG3MAQ1.js";import{M as de,t as te,a as c,O as ge,Z as e,R as A,a2 as T,Q as y,ah as me,S as w,X as re,U as S,N as Y,a4 as be,aa as ae,$ as h,T as v,a5 as ye,a3 as we,G as Ae}from"./index-BeNBoC9J.js";import{U as se}from"./Upload-CGTpHDBO.js";import{I as ue,U as ke}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as xe}from"./BlockLabel-CEOjqpu7.js";import{C as pe}from"./Clear-BiKSVifk.js";import{F as Be}from"./File-CD333vfS.js";import{I as ie}from"./IconButtonWrapper-Ce5bzAyh.js";import{h as Te}from"./html-DE4EmiOG.js";import{D as ze}from"./DownloadLink-Dk6GrGSA.js";const Ie=k=>{let r=["B","KB","MB","GB","PB"],l=0;for(;k>1024;)k/=1024,l++;let z=r[l];return k.toFixed(1)+" "+z};var Pe=A('⋮⋮'),Fe=A(" ⇣",1),De=A(''),Ee=A(' '),Ue=A('
        ');function Ce(k,r){de(r,!0);let l=i(r,"value",7),z=i(r,"selectable",3,!1),m=i(r,"height",3,void 0),R=i(r,"allow_reordering",3,!1),_=ae(null),d=ae(null);function q(a,n){h(_,n,!0),a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",n.toString()))}function I(a,n){if(a.preventDefault(),n===e(u).length-1){const t=a.currentTarget.getBoundingClientRect(),o=t.top+t.height/2;h(d,a.clientY>o?e(u).length:n,!0)}else h(d,n,!0);a.dataTransfer&&(a.dataTransfer.dropEffect="move")}function H(a){(!a.dataTransfer?.dropEffect||a.dataTransfer.dropEffect==="none")&&(h(_,null),h(d,null))}function P(a,n){if(a.preventDefault(),e(_)===null||e(_)===n)return;const t=Array.isArray(l())?[...l()]:[l()],[o]=t.splice(e(_),1);t.splice(e(d)===e(u).length?e(u).length:n,0,o);const b=Array.isArray(l())?t:t[0];r.onchange?.(b),h(_,null),h(d,null)}function F(a){const n=a.lastIndexOf(".");return n===-1?[a,""]:[a.slice(0,n),a.slice(n)]}let u=T(()=>(Array.isArray(l())?l():[l()]).map(a=>{const[n,t]=F(a.orig_name??"");return{...a,filename_stem:n,filename_ext:t}}));function K(a,n){const t=a.currentTarget;(a.target===t||t&&t.firstElementChild&&a.composedPath().includes(t.firstElementChild))&&r.onselect?.({value:e(u)[n].orig_name,index:n})}function N(a){const n=Array.isArray(l())?[...l()]:[l()],t=n.splice(a,1),o=Array.isArray(l())?n:n[0];l(o),r.ondelete?.(t[0]),r.onchange?.(o)}function D(a){r.ondownload?.(a)}const Q=typeof window<"u";var x=Ue();let W;var G=y(x),X=y(G);_e(X,23,()=>e(u),a=>a.url,(a,n,t)=>{var o=Ee();let b;o.__click=s=>{K(s,e(t))};var f=y(o),E=y(f);{var J=s=>{var g=Pe();c(s,g)};C(E,s=>{R()&&e(u).length>1&&s(J)})}var Z=w(E,2),j=y(Z,!0);v(Z);var L=w(Z,2),V=y(L,!0);v(L),v(f);var M=w(f),p=y(M);{var O=s=>{{let g=T(()=>Q&&window.__is_colab__?null:e(n).orig_name);ze(s,{get href(){return e(n).url},get download(){return e(g)},$$events:{click:()=>D(e(n))},children:(U,ne)=>{var oe=Fe(),ce=Y(oe);Te(ce,()=>e(n).size!=null?Ie(e(n).size):"(size unknown)"),ye(),c(U,oe)},$$slots:{default:!0}})}},$=s=>{var g=be();te(U=>re(g,U),[()=>r.i18n("file.uploading")]),c(s,g)};C(p,s=>{e(n).url?s(O):s($,!1)})}v(M);var le=w(M);{var B=s=>{var g=De(),U=y(g);U.__click=()=>{N(e(t))},U.__keydown=ne=>{ne.key==="Enter"&&N(e(t))},v(g),c(s,g)};C(le,s=>{e(u).length>1&&s(B)})}v(o),te(()=>{b=fe(o,1,"file svelte-ltvhae",null,b,{selectable:z(),dragging:e(_)===e(t),"drop-target":e(d)===e(t)||e(t)===e(u).length-1&&e(d)===e(u).length}),ee(o,"data-drop-target",e(d)===e(u).length&&e(t)===e(u).length-1||e(d)===e(t)+1?"after":"before"),ee(o,"draggable",R()&&e(u).length>1),ee(f,"aria-label",e(n).orig_name),re(j,e(n).filename_stem),re(V,e(n).filename_ext)}),S("dragstart",o,s=>q(s,e(t))),S("dragenter",o,s=>s.preventDefault()),S("dragover",o,s=>I(s,e(t))),S("drop",o,s=>P(s,e(t))),S("dragend",o,H),c(a,o)}),v(X),v(G),v(x),te(()=>W=ve(x,"",W,{"max-height":m()?typeof m()=="number"?m()+"px":m():"auto"})),c(k,x),ge()}me(["click","keydown"]);var Re=A(" ",1),Ge=A(" ",1),Le=A(" ",1);function Ze(k,r){de(r,!0);let l=i(r,"value",15),z=i(r,"show_label",3,!0),m=i(r,"file_count",3,"single"),R=i(r,"file_types",3,null),_=i(r,"selectable",3,!1),d=i(r,"height",3,void 0),q=i(r,"max_file_size",3,null),I=i(r,"uploading",15,!1),H=i(r,"allow_reordering",3,!1),P=i(r,"upload_promise",15),F=i(r,"buttons",3,null),u=i(r,"on_custom_button_click",3,null);async function K(t){Array.isArray(l())?l([...l(),...Array.isArray(t)?t:[t]]):l()?l([l(),...Array.isArray(t)?t:[t]]):l(t),await Ae(),r.onchange?.(l()),r.onupload?.(l())}function N(){l(null),r.onchange?.(null),r.onclear?.()}let D=ae(!1);var Q=Le(),x=Y(Q);{var W=t=>{ie(t,{get buttons(){return F()},get on_custom_button_click(){return u()}})};C(x,t=>{z()&&F()&&F().length>0&&t(W)})}var G=w(x,2);{let t=T(()=>!l()),o=T(()=>r.label||"File");xe(G,{get show_label(){return z()},get Icon(){return Be},get float(){return e(t)},get label(){return e(o)}})}var X=w(G,2);{var a=t=>{var o=Ge(),b=Y(o);{let E=T(()=>F()||[]);ie(b,{get buttons(){return e(E)},get on_custom_button_click(){return u()},children:(J,Z)=>{var j=Re(),L=Y(j);{var V=p=>{{let O=T(()=>r.i18n("common.upload"));ue(p,{get Icon(){return ke},get label(){return e(O)},children:($,le)=>{se($,{icon_upload:!0,onload:K,get filetype(){return R()},get file_count(){return m()},get max_file_size(){return q()},get root(){return r.root},get onerror(){return r.onerror},get stream_handler(){return r.stream_handler},get upload(){return r.upload},get upload_promise(){return P()},set upload_promise(B){P(B)},get dragging(){return e(D)},set dragging(B){h(D,B,!0)},get uploading(){return I()},set uploading(B){I(B)}})},$$slots:{default:!0}})}};C(L,p=>{m()==="single"&&(Array.isArray(l())?l().length>0:l()!==null)||p(V)})}var M=w(L,2);{let p=T(()=>r.i18n("common.clear"));ue(M,{get Icon(){return pe},get label(){return e(p)},onclick:O=>{O.stopPropagation(),N()}})}c(J,j)},$$slots:{default:!0}})}var f=w(b,2);Ce(f,{get i18n(){return r.i18n},get onselect(){return r.onselect},get selectable(){return _()},get value(){return l()},get height(){return d()},get onchange(){return r.onchange},get ondelete(){return r.ondelete},get allow_reordering(){return H()}}),c(t,o)},n=t=>{se(t,{onload:K,get filetype(){return R()},get file_count(){return m()},get max_file_size(){return q()},get root(){return r.root},get onerror(){return r.onerror},get stream_handler(){return r.stream_handler},get upload(){return r.upload},get height(){return d()},get upload_promise(){return P()},set upload_promise(o){P(o)},get dragging(){return e(D)},set dragging(o){h(D,o,!0)},get uploading(){return I()},set uploading(o){I(o)},children:(o,b)=>{var f=we(),E=Y(f);he(E,r,"default",{}),c(o,f)},$$slots:{default:!0}})};C(X,t=>{l()&&(!Array.isArray(l())||l().length>0)?t(a):t(n,!1)})}c(k,Q),ge()}export{Ce as F,Ze as a}; diff --git a/assets/FullscreenButton-BuyUU5Yj.js b/assets/FullscreenButton-CFl3IB4T.js similarity index 71% rename from assets/FullscreenButton-BuyUU5Yj.js rename to assets/FullscreenButton-CFl3IB4T.js index 7817acb87f7f4feb250f3c2792cc7be58335318d..85019e9c96191f2bf668ea9399b9df0f1b58882b 100644 --- a/assets/FullscreenButton-BuyUU5Yj.js +++ b/assets/FullscreenButton-CFl3IB4T.js @@ -1 +1 @@ -import{i as c}from"./i18n-CPHyzK9b.js";import{a as n,f as m,M as f,a3 as u,N as v,O as h}from"./index-DydPgVMC.js";import{I as a}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{M as g}from"./Maximize-DWbY8BRa.js";var k=m('');function d(r){var e=k();n(r,e)}function I(r,e){f(e,!0);var t=u(),i=v(t);{var l=o=>{a(o,{get Icon(){return d},label:"Exit fullscreen mode",onclick:()=>e.onclick(!1)})},s=o=>{a(o,{get Icon(){return g},label:"Fullscreen",onclick:()=>e.onclick(!0)})};c(i,o=>{e.fullscreen?o(l):o(s,!1)})}n(r,t),h()}export{I as F}; +import{i as c}from"./i18n-DtG3MAQ1.js";import{a as n,f as m,M as f,a3 as u,N as v,O as h}from"./index-BeNBoC9J.js";import{I as a}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{M as g}from"./Maximize-DQMU3SdR.js";var k=m('');function d(r){var e=k();n(r,e)}function I(r,e){f(e,!0);var t=u(),i=v(t);{var l=o=>{a(o,{get Icon(){return d},label:"Exit fullscreen mode",onclick:()=>e.onclick(!1)})},s=o=>{a(o,{get Icon(){return g},label:"Fullscreen",onclick:()=>e.onclick(!0)})};c(i,o=>{e.fullscreen?o(l):o(s,!1)})}n(r,t),h()}export{I as F}; diff --git a/assets/Gallery-CRb8iS3j.js b/assets/Gallery-CclVtwgM.js similarity index 92% rename from assets/Gallery-CRb8iS3j.js rename to assets/Gallery-CclVtwgM.js index d8a8dc1398b6232b9e379c4a729ae6bffc904408..2ae9bb09d2064e3efe959e9d70e7fb26df512560 100644 --- a/assets/Gallery-CRb8iS3j.js +++ b/assets/Gallery-CclVtwgM.js @@ -1 +1 @@ -import{A as ht,p as r,i as f,q as Be,b as ee,a as Re,w as Te,d as fe,f as ie}from"./i18n-CPHyzK9b.js";import{at as wt,M as pt,aa as _e,ab as yt,ac as me,Z as e,$ as ve,G as kt,a7 as jt,N as te,a as x,O as xt,a2 as _,S as b,R as I,Q as B,T as z,t as Z,U as ae,X as De}from"./index-DydPgVMC.js";import{b as zt}from"./window-D5YXrKnH.js";import{s as It}from"./event-modifiers-CdEA5IGF.js";import{I as J,U as Pt,W as Lt,V as Ut,a as Et}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as Mt}from"./BlockLabel-BzVeVrtL.js";import{E as Bt}from"./Empty-B15ItVsj.js";import{S as Rt}from"./ShareButton-Cuvs43xM.js";import{C as We}from"./Clear-BR8cTgGu.js";import{D as Tt}from"./Download-DWSaBiea.js";import{I as Ae}from"./Image-DBmW1mOo.js";import{P as Ce}from"./Play-CRvn2HoA.js";import{I as Dt}from"./IconButtonWrapper-PnNNNvqI.js";import{F as Wt}from"./FullscreenButton-BuyUU5Yj.js";import{U as At}from"./Upload-Bq9KuxCu.js";import{M as Ct}from"./ModifyUpload-BL388q45.js";import{I as ge}from"./Image-CZ1Hb99p.js";/* empty css */import{V as be}from"./Video-BOdhnjQz.js";import{d as Ft}from"./index-tFQomdd2.js";async function Gt(G){return G?`
        ${(await Promise.all(G.map(async([U,h])=>U===null||!U.url?"":await ht(U.url)))).map(U=>``).join("")}
        `:""}async function ya(G,t,U="uploaded_file"){const h=G.type.split("/")[1]||"png",O=new File([G],`${U}.${h}`),se=[new wt({path:O.name,orig_name:O.name,blob:O,size:O.size,mime_type:O.type,is_stream:!1})];return(await t(se)??[]).filter(W=>W!==null)}var Ot=I('
        '),St=I(" ",1),Vt=I(' '),Xt=I(" ",1),qt=I(""),Ht=I('
        '),Nt=I(" ",1),Qt=I(" ",1),Zt=I('
        '),Jt=I(''),Kt=I(''),Yt=I(''),$t=I(" ",1);function ea(G,t){pt(t,!0);let U=r(t,"show_label",3,!0),h=r(t,"value",15),O=r(t,"columns",19,()=>[2]),se=r(t,"rows",3,void 0),W=r(t,"height",3,"auto"),ue=r(t,"allow_preview",3,!0),Fe=r(t,"object_fit",3,"cover"),Ge=r(t,"show_share_button",3,!1),Oe=r(t,"show_download_button",3,!1),o=r(t,"selected_index",15),Se=r(t,"show_fullscreen_button",3,!0),Ve=r(t,"fullscreen",3,!1),Xe=r(t,"root",3,""),qe=r(t,"file_types",19,()=>["image","video"]),He=r(t,"max_file_size",3,null),Ne=r(t,"fit_columns",3,!0),Qe=r(t,"buttons",3,null),Ze=r(t,"oncustom_button_click",3,null),Je=r(t,"onpreview_open",3,()=>{}),Ke=r(t,"onchange",3,()=>{}),Ye=r(t,"onclear",3,()=>{}),$e=r(t,"onselect",3,a=>{}),et=r(t,"onshare",3,a=>{}),he=r(t,"onerror",3,a=>{}),we=r(t,"onpreview_close",3,()=>{}),tt=r(t,"onfullscreen",3,a=>{}),at=r(t,"ondelete",3,()=>{}),lt=r(t,"onupload",3,()=>{}),le=r(t,"onsource_change",3,()=>{}),pe=null,ce="normal",nt=!1,de=!1,ye,ke=_e(!1),d=_(()=>h()==null?null:h().map(a=>"video"in a?{video:a.video,caption:a.caption}:"image"in a?{image:a.image,caption:a.caption}:{}));function rt(a,i,m){if(a&&i&&m){const T=a.length;return Array.isArray(i)?i.map(k=>Math.min(k,T)):Math.min(i,T)}else return i}let ot=_(()=>rt(e(d),O(),Ne())),je=_e(yt(h()));o()==null&&t.preview&&h()?.length&&o(0),me(()=>{Ft(e(je),h())||(e(ke)?(o(t.preview&&h()?.length?0:null),ve(ke,!1)):o()!==null&&h()!==null?o(Math.max(0,Math.min(o(),h().length-1))):o(null),Ke()(),ve(je,h(),!0))});let xe=_(()=>((o()??0)+(e(d)?.length??0)-1)%(e(d)?.length??0)),ze=_(()=>((o()??0)+1)%(e(d)?.length??0));function K(a){e(d)!==null&&$e()({index:a,value:e(d)?.[a]})}function it(a){const i=a.target,m=a.offsetX,k=i.offsetWidth/2;m{ue()&&e(y)&&ut(o())});let Y=[],y=_e(void 0);async function ut(a){if(typeof a!="number"||(await kt(),Y[a]===void 0)||!e(y))return;Y[a]?.focus();const{left:i,width:m}=e(y).getBoundingClientRect(),{left:T,width:k}=Y[a].getBoundingClientRect(),A=T-i+k/2-m/2+e(y).scrollLeft;e(y)&&typeof e(y).scrollTo=="function"&&e(y).scrollTo({left:A<0?0:A,behavior:"smooth"})}async function ct(a,i){let m;try{m=await t._fetch(a)}catch(A){if(A instanceof TypeError){window.open(a,"_blank","noreferrer");return}throw A}const T=await m.blob(),k=URL.createObjectURL(T),S=document.createElement("a");S.href=k,S.download=i,S.click(),URL.revokeObjectURL(k)}let w=_(()=>o()!=null&&e(d)!=null?e(d)[o()]:null),Ie=!1;function $(){e(y)&&(Ie=e(y).scrollWidth>e(y).clientWidth)}jt(()=>($(),document.addEventListener("fullscreenchange",()=>{de=!!document.fullscreenElement}),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$))),me(()=>{e(d),$(),e(y)&&$()});function dt(a){if(!h()||!e(d))return;const i=e(d)[a];let m;"image"in i?m={file:i.image,index:a}:"video"in i&&(m={file:i.video,index:a}),m&&at()(m)}let Pe=!1;var Le=$t(),Ue=te(Le);{var ft=a=>{{let i=_(()=>t.label||"Gallery");Mt(a,{get show_label(){return U()},get Icon(){return Ae},get label(){return e(i)}})}};f(Ue,a=>{U()&&a(ft)})}var _t=b(Ue,2);{var mt=a=>{Bt(a,{unpadded_box:!0,size:"large",children:(i,m)=>{Ae(i)},$$slots:{default:!0}})},vt=a=>{var i=Yt(),m=B(i);{var T=E=>{var v=Ht();ee(v,1,"preview svelte-1mjlab4",null,{},{minimal:ce==="minimal"});var R=B(v);Dt(R,{display_top_corner:nt,get buttons(){return Qe()},get on_custom_button_click(){return Ze()},children:(s,u)=>{var n=St(),l=te(n);{var c=g=>{{let D=_(()=>t.i18n("common.download"));J(g,{get Icon(){return Tt},get label(){return e(D)},onclick:()=>{const oe="image"in e(w)?e(w)?.image:e(w)?.video;if(oe==null)return;const{url:Q,orig_name:bt}=oe;Q&&ct(Q,bt??"image")}})}};f(l,g=>{Oe()&&g(c)})}var p=b(l,2);{var j=g=>{Wt(g,{get fullscreen(){return Ve()},onclick:D=>tt()({detail:D})})};f(p,g=>{Se()&&g(j)})}var N=b(p,2);{var L=g=>{var D=Ot(),oe=B(D);Rt(oe,{get i18n(){return t.i18n},get value(){return e(d)},get formatter(){return Gt},$$events:{share:Q=>{et()(Q)},error:Q=>{he()(Q)}}}),z(D),x(g,D)};f(N,g=>{Ge()&&g(L)})}var F=b(N,2);{var re=g=>{J(g,{get Icon(){return We},label:"Close",onclick:()=>{o(null),we()()}})};f(F,g=>{de||g(re)})}x(s,n)},$$slots:{default:!0}});var P=b(R,2),M=B(P);{var X=s=>{{let u=_(()=>({alt:e(w).caption||"",title:e(w).caption||null,class:e(w).caption&&"with-caption",loading:"lazy"}));ge(s,{get restProps(){return e(u)},get src(){return e(w).image.url},data_testid:"detailed-image"})}},V=s=>{{let u=_(()=>e(w).caption||"");be(s,{get src(){return e(w).video.url},"data-testid":"detailed-video",get alt(){return e(u)},loading:"lazy",loop:!1,is_stream:!1,muted:!1,controls:!0})}};f(M,s=>{"image"in e(w)?s(X):s(V,!1)})}z(P);var q=b(P,2);{var H=s=>{var u=Vt(),n=B(u,!0);z(u),Z(()=>De(n,e(w).caption)),x(s,u)};f(q,s=>{e(w)?.caption&&s(H)})}var C=b(q,2);Be(C,21,()=>e(d),Te,(s,u,n)=>{var l=qt();let c;var p=B(l);{var j=L=>{{let F=_(()=>({title:e(u).caption||null,alt:"",class:"with-caption",loading:"lazy"}));ge(L,{get src(){return e(u).image.url},get restProps(){return e(F)},data_testid:`thumbnail ${n+1}`})}},N=L=>{var F=Xt(),re=te(F);Ce(re);var g=b(re,2);{let D=_(()=>e(u).caption||null);be(g,{get src(){return e(u).video.url},get title(){return e(D)},is_stream:!1,"data-testid":"thumbnail "+(n+1),alt:"",loading:"lazy",loop:!1})}x(L,F)};f(p,L=>{"image"in e(u)?L(j):L(N,!1)})}z(l),fe(l,(L,F)=>Y[F]=L,L=>Y?.[L],()=>[n]),Z(()=>{c=ee(l,1,"thumbnail-item thumbnail-small svelte-1mjlab4",null,c,{selected:o()===n&&ce!=="minimal"}),Re(l,"aria-label","Thumbnail "+(n+1)+" of "+e(d).length)}),ae("click",l,()=>{o(n),K(n)}),x(s,l)}),z(C),fe(C,s=>ve(y,s),()=>e(y)),z(v),Z(()=>{ie(P,`height: calc(100% - ${e(w).caption?"80px":"60px"})`),ie(C,`justify-content: ${Ie?"flex-start":"center"};`)}),ae("click",P,function(...s){("image"in e(w)?u=>it(u):null)?.apply(this,s)}),ae("keydown",v,st),x(E,v)};f(m,E=>{e(w)&&ue()&&E(T)})}var k=b(m,2);let S,A;var Ee=B(k);{var gt=E=>{Ct(E,{get i18n(){return t.i18n},onclear:()=>{h([]),le()("upload"),Ye()()},children:(v,R)=>{var P=Nt(),M=te(P);{var X=n=>{{let l=_(()=>t.i18n("upload_text.click_to_upload"));J(n,{get Icon(){return Pt},get label(){return e(l)},children:(c,p)=>{At(c,{icon_upload:!0,onload:j=>lt()(j),get filetype(){return qe()},file_count:"multiple",get max_file_size(){return He()},get root(){return Xe()},onerror:j=>he()(j),get stream_handler(){return t.stream_handler},get upload(){return t.upload},get upload_promise(){return pe},set upload_promise(j){pe=j},get uploading(){return Pe},set uploading(j){Pe=j}})},$$slots:{default:!0}})}};f(M,n=>{t.upload&&t.stream_handler&&n(X)})}var V=b(M,2);{var q=n=>{{let l=_(()=>t.i18n("common.webcam"));J(n,{get Icon(){return Lt},get label(){return e(l)},onclick:()=>{le()("webcam")}})}};f(V,n=>{t.sources.includes("webcam")&&n(q)})}var H=b(V,2);{var C=n=>{{let l=_(()=>t.i18n("common.video"));J(n,{get Icon(){return Ut},get label(){return e(l)},onclick:()=>{le()("webcam-video")}})}};f(H,n=>{t.sources.includes("webcam-video")&&n(C)})}var s=b(H,2);{var u=n=>{{let l=_(()=>t.i18n("upload_text.paste_clipboard"));J(n,{get label(){return e(l)},onclick:()=>{le()("clipboard")},get Icon(){return Et}})}};f(s,n=>{t.sources.includes("clipboard")&&n(u)})}x(v,P)},$$slots:{default:!0}})};f(Ee,E=>{t.interactive&&o()===null&&E(gt)})}var ne=b(Ee,2);let Me;Be(ne,21,()=>e(d),Te,(E,v,R)=>{var P=Kt(),M=B(P);let X;var V=B(M);{var q=l=>{{let c=_(()=>e(v).caption||""),p=_(()=>typeof e(v).image=="string"?e(v).image:e(v).image.url);ge(l,{get alt(){return e(c)},get src(){return e(p)},loading:"lazy"})}},H=l=>{var c=Qt(),p=te(c);Ce(p);var j=b(p,2);{let N=_(()=>e(v).caption||null);be(j,{get src(){return e(v).video.url},get title(){return e(N)},is_stream:!1,"data-testid":"thumbnail "+(R+1),alt:"",loading:"lazy",loop:!1})}x(l,c)};f(V,l=>{"image"in e(v)?l(q):l(H,!1)})}var C=b(V,2);{var s=l=>{var c=Zt(),p=B(c,!0);z(c),Z(()=>De(p,e(v).caption)),x(l,c)};f(C,l=>{e(v).caption&&l(s)})}z(M);var u=b(M,2);{var n=l=>{var c=Jt(),p=B(c);We(p),z(c),ae("click",c,It(()=>dt(R))),x(l,c)};f(u,l=>{t.interactive&&l(n)})}z(P),Z(()=>{X=ee(M,1,"thumbnail-item thumbnail-lg svelte-1mjlab4",null,X,{selected:o()===R}),Re(M,"aria-label","Thumbnail "+(R+1)+" of "+e(d).length)}),ae("click",M,()=>{o()===null&&ue()&&Je()(),o(R),K(R)}),x(E,P)}),z(ne),z(k),z(i),fe(i,E=>ye=E,()=>ye),Z(()=>{S=ee(k,1,"grid-wrap svelte-1mjlab4",null,S,{minimal:ce==="minimal","fixed-height":!W()||W()=="auto",hidden:de}),A=ie(k,"",A,{height:W()!=="auto"?typeof W()=="number"?W()+"px":W():null}),Me=ee(ne,1,"grid-container svelte-1mjlab4",null,Me,{"pt-6":U()}),ie(ne,`--grid-cols:${e(ot)??""}; --grid-rows:${se()??""}; --object-fit: ${Fe()??""};`)}),x(a,i)};f(_t,a=>{h()==null||e(d)==null||e(d).length===0?a(mt):a(vt,!1)})}zt("innerHeight",a=>a),x(G,Le),xt()}const ka=Object.freeze(Object.defineProperty({__proto__:null,default:ea},Symbol.toStringTag,{value:"Module"}));export{ea as G,ka as a,ya as h}; +import{A as ht,p as r,i as f,q as Be,b as ee,a as Re,w as Te,d as fe,f as ie}from"./i18n-DtG3MAQ1.js";import{at as wt,M as pt,aa as _e,ab as yt,ac as me,Z as e,$ as ve,G as kt,a7 as jt,N as te,a as x,O as xt,a2 as _,S as b,R as I,Q as B,T as z,t as Z,U as ae,X as De}from"./index-BeNBoC9J.js";import{b as zt}from"./window-ChwzOWAi.js";import{s as It}from"./event-modifiers-CdEA5IGF.js";import{I as J,U as Pt,W as Lt,V as Ut,a as Et}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as Mt}from"./BlockLabel-CEOjqpu7.js";import{E as Bt}from"./Empty-Clj0ErcW.js";import{S as Rt}from"./ShareButton-ImGYvlzQ.js";import{C as We}from"./Clear-BiKSVifk.js";import{D as Tt}from"./Download-0gCL6VXM.js";import{I as Ae}from"./Image-DWBzZYev.js";import{P as Ce}from"./Play-DIYf8dw5.js";import{I as Dt}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as Wt}from"./FullscreenButton-CFl3IB4T.js";import{U as At}from"./Upload-CGTpHDBO.js";import{M as Ct}from"./ModifyUpload-DbCqTfQf.js";import{I as ge}from"./Image-ALBOEs1f.js";/* empty css */import{V as be}from"./Video-BXpoIN7o.js";import{d as Ft}from"./index-tFQomdd2.js";async function Gt(G){return G?`
        ${(await Promise.all(G.map(async([U,h])=>U===null||!U.url?"":await ht(U.url)))).map(U=>``).join("")}
        `:""}async function ya(G,t,U="uploaded_file"){const h=G.type.split("/")[1]||"png",O=new File([G],`${U}.${h}`),se=[new wt({path:O.name,orig_name:O.name,blob:O,size:O.size,mime_type:O.type,is_stream:!1})];return(await t(se)??[]).filter(W=>W!==null)}var Ot=I('
        '),St=I(" ",1),Vt=I(' '),Xt=I(" ",1),qt=I(""),Ht=I('
        '),Nt=I(" ",1),Qt=I(" ",1),Zt=I('
        '),Jt=I(''),Kt=I(''),Yt=I(''),$t=I(" ",1);function ea(G,t){pt(t,!0);let U=r(t,"show_label",3,!0),h=r(t,"value",15),O=r(t,"columns",19,()=>[2]),se=r(t,"rows",3,void 0),W=r(t,"height",3,"auto"),ue=r(t,"allow_preview",3,!0),Fe=r(t,"object_fit",3,"cover"),Ge=r(t,"show_share_button",3,!1),Oe=r(t,"show_download_button",3,!1),o=r(t,"selected_index",15),Se=r(t,"show_fullscreen_button",3,!0),Ve=r(t,"fullscreen",3,!1),Xe=r(t,"root",3,""),qe=r(t,"file_types",19,()=>["image","video"]),He=r(t,"max_file_size",3,null),Ne=r(t,"fit_columns",3,!0),Qe=r(t,"buttons",3,null),Ze=r(t,"oncustom_button_click",3,null),Je=r(t,"onpreview_open",3,()=>{}),Ke=r(t,"onchange",3,()=>{}),Ye=r(t,"onclear",3,()=>{}),$e=r(t,"onselect",3,a=>{}),et=r(t,"onshare",3,a=>{}),he=r(t,"onerror",3,a=>{}),we=r(t,"onpreview_close",3,()=>{}),tt=r(t,"onfullscreen",3,a=>{}),at=r(t,"ondelete",3,()=>{}),lt=r(t,"onupload",3,()=>{}),le=r(t,"onsource_change",3,()=>{}),pe=null,ce="normal",nt=!1,de=!1,ye,ke=_e(!1),d=_(()=>h()==null?null:h().map(a=>"video"in a?{video:a.video,caption:a.caption}:"image"in a?{image:a.image,caption:a.caption}:{}));function rt(a,i,m){if(a&&i&&m){const T=a.length;return Array.isArray(i)?i.map(k=>Math.min(k,T)):Math.min(i,T)}else return i}let ot=_(()=>rt(e(d),O(),Ne())),je=_e(yt(h()));o()==null&&t.preview&&h()?.length&&o(0),me(()=>{Ft(e(je),h())||(e(ke)?(o(t.preview&&h()?.length?0:null),ve(ke,!1)):o()!==null&&h()!==null?o(Math.max(0,Math.min(o(),h().length-1))):o(null),Ke()(),ve(je,h(),!0))});let xe=_(()=>((o()??0)+(e(d)?.length??0)-1)%(e(d)?.length??0)),ze=_(()=>((o()??0)+1)%(e(d)?.length??0));function K(a){e(d)!==null&&$e()({index:a,value:e(d)?.[a]})}function it(a){const i=a.target,m=a.offsetX,k=i.offsetWidth/2;m{ue()&&e(y)&&ut(o())});let Y=[],y=_e(void 0);async function ut(a){if(typeof a!="number"||(await kt(),Y[a]===void 0)||!e(y))return;Y[a]?.focus();const{left:i,width:m}=e(y).getBoundingClientRect(),{left:T,width:k}=Y[a].getBoundingClientRect(),A=T-i+k/2-m/2+e(y).scrollLeft;e(y)&&typeof e(y).scrollTo=="function"&&e(y).scrollTo({left:A<0?0:A,behavior:"smooth"})}async function ct(a,i){let m;try{m=await t._fetch(a)}catch(A){if(A instanceof TypeError){window.open(a,"_blank","noreferrer");return}throw A}const T=await m.blob(),k=URL.createObjectURL(T),S=document.createElement("a");S.href=k,S.download=i,S.click(),URL.revokeObjectURL(k)}let w=_(()=>o()!=null&&e(d)!=null?e(d)[o()]:null),Ie=!1;function $(){e(y)&&(Ie=e(y).scrollWidth>e(y).clientWidth)}jt(()=>($(),document.addEventListener("fullscreenchange",()=>{de=!!document.fullscreenElement}),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$))),me(()=>{e(d),$(),e(y)&&$()});function dt(a){if(!h()||!e(d))return;const i=e(d)[a];let m;"image"in i?m={file:i.image,index:a}:"video"in i&&(m={file:i.video,index:a}),m&&at()(m)}let Pe=!1;var Le=$t(),Ue=te(Le);{var ft=a=>{{let i=_(()=>t.label||"Gallery");Mt(a,{get show_label(){return U()},get Icon(){return Ae},get label(){return e(i)}})}};f(Ue,a=>{U()&&a(ft)})}var _t=b(Ue,2);{var mt=a=>{Bt(a,{unpadded_box:!0,size:"large",children:(i,m)=>{Ae(i)},$$slots:{default:!0}})},vt=a=>{var i=Yt(),m=B(i);{var T=E=>{var v=Ht();ee(v,1,"preview svelte-1mjlab4",null,{},{minimal:ce==="minimal"});var R=B(v);Dt(R,{display_top_corner:nt,get buttons(){return Qe()},get on_custom_button_click(){return Ze()},children:(s,u)=>{var n=St(),l=te(n);{var c=g=>{{let D=_(()=>t.i18n("common.download"));J(g,{get Icon(){return Tt},get label(){return e(D)},onclick:()=>{const oe="image"in e(w)?e(w)?.image:e(w)?.video;if(oe==null)return;const{url:Q,orig_name:bt}=oe;Q&&ct(Q,bt??"image")}})}};f(l,g=>{Oe()&&g(c)})}var p=b(l,2);{var j=g=>{Wt(g,{get fullscreen(){return Ve()},onclick:D=>tt()({detail:D})})};f(p,g=>{Se()&&g(j)})}var N=b(p,2);{var L=g=>{var D=Ot(),oe=B(D);Rt(oe,{get i18n(){return t.i18n},get value(){return e(d)},get formatter(){return Gt},$$events:{share:Q=>{et()(Q)},error:Q=>{he()(Q)}}}),z(D),x(g,D)};f(N,g=>{Ge()&&g(L)})}var F=b(N,2);{var re=g=>{J(g,{get Icon(){return We},label:"Close",onclick:()=>{o(null),we()()}})};f(F,g=>{de||g(re)})}x(s,n)},$$slots:{default:!0}});var P=b(R,2),M=B(P);{var X=s=>{{let u=_(()=>({alt:e(w).caption||"",title:e(w).caption||null,class:e(w).caption&&"with-caption",loading:"lazy"}));ge(s,{get restProps(){return e(u)},get src(){return e(w).image.url},data_testid:"detailed-image"})}},V=s=>{{let u=_(()=>e(w).caption||"");be(s,{get src(){return e(w).video.url},"data-testid":"detailed-video",get alt(){return e(u)},loading:"lazy",loop:!1,is_stream:!1,muted:!1,controls:!0})}};f(M,s=>{"image"in e(w)?s(X):s(V,!1)})}z(P);var q=b(P,2);{var H=s=>{var u=Vt(),n=B(u,!0);z(u),Z(()=>De(n,e(w).caption)),x(s,u)};f(q,s=>{e(w)?.caption&&s(H)})}var C=b(q,2);Be(C,21,()=>e(d),Te,(s,u,n)=>{var l=qt();let c;var p=B(l);{var j=L=>{{let F=_(()=>({title:e(u).caption||null,alt:"",class:"with-caption",loading:"lazy"}));ge(L,{get src(){return e(u).image.url},get restProps(){return e(F)},data_testid:`thumbnail ${n+1}`})}},N=L=>{var F=Xt(),re=te(F);Ce(re);var g=b(re,2);{let D=_(()=>e(u).caption||null);be(g,{get src(){return e(u).video.url},get title(){return e(D)},is_stream:!1,"data-testid":"thumbnail "+(n+1),alt:"",loading:"lazy",loop:!1})}x(L,F)};f(p,L=>{"image"in e(u)?L(j):L(N,!1)})}z(l),fe(l,(L,F)=>Y[F]=L,L=>Y?.[L],()=>[n]),Z(()=>{c=ee(l,1,"thumbnail-item thumbnail-small svelte-1mjlab4",null,c,{selected:o()===n&&ce!=="minimal"}),Re(l,"aria-label","Thumbnail "+(n+1)+" of "+e(d).length)}),ae("click",l,()=>{o(n),K(n)}),x(s,l)}),z(C),fe(C,s=>ve(y,s),()=>e(y)),z(v),Z(()=>{ie(P,`height: calc(100% - ${e(w).caption?"80px":"60px"})`),ie(C,`justify-content: ${Ie?"flex-start":"center"};`)}),ae("click",P,function(...s){("image"in e(w)?u=>it(u):null)?.apply(this,s)}),ae("keydown",v,st),x(E,v)};f(m,E=>{e(w)&&ue()&&E(T)})}var k=b(m,2);let S,A;var Ee=B(k);{var gt=E=>{Ct(E,{get i18n(){return t.i18n},onclear:()=>{h([]),le()("upload"),Ye()()},children:(v,R)=>{var P=Nt(),M=te(P);{var X=n=>{{let l=_(()=>t.i18n("upload_text.click_to_upload"));J(n,{get Icon(){return Pt},get label(){return e(l)},children:(c,p)=>{At(c,{icon_upload:!0,onload:j=>lt()(j),get filetype(){return qe()},file_count:"multiple",get max_file_size(){return He()},get root(){return Xe()},onerror:j=>he()(j),get stream_handler(){return t.stream_handler},get upload(){return t.upload},get upload_promise(){return pe},set upload_promise(j){pe=j},get uploading(){return Pe},set uploading(j){Pe=j}})},$$slots:{default:!0}})}};f(M,n=>{t.upload&&t.stream_handler&&n(X)})}var V=b(M,2);{var q=n=>{{let l=_(()=>t.i18n("common.webcam"));J(n,{get Icon(){return Lt},get label(){return e(l)},onclick:()=>{le()("webcam")}})}};f(V,n=>{t.sources.includes("webcam")&&n(q)})}var H=b(V,2);{var C=n=>{{let l=_(()=>t.i18n("common.video"));J(n,{get Icon(){return Ut},get label(){return e(l)},onclick:()=>{le()("webcam-video")}})}};f(H,n=>{t.sources.includes("webcam-video")&&n(C)})}var s=b(H,2);{var u=n=>{{let l=_(()=>t.i18n("upload_text.paste_clipboard"));J(n,{get label(){return e(l)},onclick:()=>{le()("clipboard")},get Icon(){return Et}})}};f(s,n=>{t.sources.includes("clipboard")&&n(u)})}x(v,P)},$$slots:{default:!0}})};f(Ee,E=>{t.interactive&&o()===null&&E(gt)})}var ne=b(Ee,2);let Me;Be(ne,21,()=>e(d),Te,(E,v,R)=>{var P=Kt(),M=B(P);let X;var V=B(M);{var q=l=>{{let c=_(()=>e(v).caption||""),p=_(()=>typeof e(v).image=="string"?e(v).image:e(v).image.url);ge(l,{get alt(){return e(c)},get src(){return e(p)},loading:"lazy"})}},H=l=>{var c=Qt(),p=te(c);Ce(p);var j=b(p,2);{let N=_(()=>e(v).caption||null);be(j,{get src(){return e(v).video.url},get title(){return e(N)},is_stream:!1,"data-testid":"thumbnail "+(R+1),alt:"",loading:"lazy",loop:!1})}x(l,c)};f(V,l=>{"image"in e(v)?l(q):l(H,!1)})}var C=b(V,2);{var s=l=>{var c=Zt(),p=B(c,!0);z(c),Z(()=>De(p,e(v).caption)),x(l,c)};f(C,l=>{e(v).caption&&l(s)})}z(M);var u=b(M,2);{var n=l=>{var c=Jt(),p=B(c);We(p),z(c),ae("click",c,It(()=>dt(R))),x(l,c)};f(u,l=>{t.interactive&&l(n)})}z(P),Z(()=>{X=ee(M,1,"thumbnail-item thumbnail-lg svelte-1mjlab4",null,X,{selected:o()===R}),Re(M,"aria-label","Thumbnail "+(R+1)+" of "+e(d).length)}),ae("click",M,()=>{o()===null&&ue()&&Je()(),o(R),K(R)}),x(E,P)}),z(ne),z(k),z(i),fe(i,E=>ye=E,()=>ye),Z(()=>{S=ee(k,1,"grid-wrap svelte-1mjlab4",null,S,{minimal:ce==="minimal","fixed-height":!W()||W()=="auto",hidden:de}),A=ie(k,"",A,{height:W()!=="auto"?typeof W()=="number"?W()+"px":W():null}),Me=ee(ne,1,"grid-container svelte-1mjlab4",null,Me,{"pt-6":U()}),ie(ne,`--grid-cols:${e(ot)??""}; --grid-rows:${se()??""}; --object-fit: ${Fe()??""};`)}),x(a,i)};f(_t,a=>{h()==null||e(d)==null||e(d).length===0?a(mt):a(vt,!1)})}zt("innerHeight",a=>a),x(G,Le),xt()}const ka=Object.freeze(Object.defineProperty({__proto__:null,default:ea},Symbol.toStringTag,{value:"Module"}));export{ea as G,ka as a,ya as h}; diff --git a/assets/HTML-Bcdz-vxU.js b/assets/HTML-BMuhpYGf.js similarity index 99% rename from assets/HTML-Bcdz-vxU.js rename to assets/HTML-BMuhpYGf.js index 43ddcc1d06e5923d9ef54489c29b2a1b46d953f5..80a6dd03e40831d43b6e25704975e506b10101cb 100644 --- a/assets/HTML-Bcdz-vxU.js +++ b/assets/HTML-BMuhpYGf.js @@ -1,4 +1,4 @@ -import{L as _r,p as K,m as We,i as lt,d as Ke,a as Sr,b as Je,j as ct}from"./i18n-CPHyzK9b.js";import{M as yr,aa as $,ab as kr,a1 as Cr,ac as ht,Z as R,$ as U,a3 as br,N as pt,a as me,O as Pr,Q as oe,S as ve,T as ue,a5 as Er,t as ze,X as ft,R as tt,a2 as le,ar as wr,a$ as Lr}from"./index-DydPgVMC.js";import{s as xr}from"./snippet-BtHMuX3s.js";var _e={exports:{}},Se={exports:{}},Z={},J={},dt;function z(){if(dt)return J;dt=1,J.__esModule=!0,J.extend=S,J.indexOf=a,J.escapeExpression=s,J.isEmpty=n,J.createFrame=c,J.blockParams=r,J.appendContextPath=t;var v={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},m=/[&<>"'`=]/g,C=/[&<>"'`=]/;function _(e){return v[e]}function S(e){for(var i=1;i0?(f.ids&&(f.ids=[f.name]),_.helpers.each(S,f)):d(this);if(f.data&&f.ids){var a=C.createFrame(f.data);a.contextPath=C.appendContextPath(f.data.contextPath,f.name),f={data:a}}return l(S,f)})},v.exports=m.default})(ke,ke.exports)),ke.exports}var Ce={exports:{}},vt;function Ar(){return vt||(vt=1,(function(v,m){m.__esModule=!0;function C(d){return d&&d.__esModule?d:{default:d}}var _=z(),S=X(),f=C(S);m.default=function(d){d.registerHelper("each",function(l,a){if(!a)throw new f.default("Must pass iterator to #each");var s=a.fn,n=a.inverse,c=0,r="",t=void 0,e=void 0;a.data&&a.ids&&(e=_.appendContextPath(a.data.contextPath,a.ids[0])+"."),_.isFunction(l)&&(l=l.call(this)),a.data&&(t=_.createFrame(a.data));function i(g,p,b){t&&(t.key=g,t.index=p,t.first=p===0,t.last=!!b,e&&(t.contextPath=e+g)),r=r+s(l[g],{data:t,blockParams:_.blockParams([l[g],g],[e+g,null])})}if(l&&typeof l=="object")if(_.isArray(l))for(var o=l.length;c=0?f=d:f=parseInt(f,10)}return f},log:function(f){if(f=_.lookupLevel(f),typeof console<"u"&&_.lookupLevel(_.level)<=f){var d=_.methodMap[f];console[d]||(d="log");for(var l=arguments.length,a=Array(l>1?l-1:0),s=1;s":">",'"':""","'":"'","`":"`","=":"="},m=/[&<>"'`=]/g,C=/[&<>"'`=]/;function _(e){return v[e]}function S(e){for(var i=1;i0?(f.ids&&(f.ids=[f.name]),_.helpers.each(S,f)):d(this);if(f.data&&f.ids){var a=C.createFrame(f.data);a.contextPath=C.appendContextPath(f.data.contextPath,f.name),f={data:a}}return l(S,f)})},v.exports=m.default})(ke,ke.exports)),ke.exports}var Ce={exports:{}},vt;function Ar(){return vt||(vt=1,(function(v,m){m.__esModule=!0;function C(d){return d&&d.__esModule?d:{default:d}}var _=z(),S=X(),f=C(S);m.default=function(d){d.registerHelper("each",function(l,a){if(!a)throw new f.default("Must pass iterator to #each");var s=a.fn,n=a.inverse,c=0,r="",t=void 0,e=void 0;a.data&&a.ids&&(e=_.appendContextPath(a.data.contextPath,a.ids[0])+"."),_.isFunction(l)&&(l=l.call(this)),a.data&&(t=_.createFrame(a.data));function i(g,p,b){t&&(t.key=g,t.index=p,t.first=p===0,t.last=!!b,e&&(t.contextPath=e+g)),r=r+s(l[g],{data:t,blockParams:_.blockParams([l[g],g],[e+g,null])})}if(l&&typeof l=="object")if(_.isArray(l))for(var o=l.length;c=0?f=d:f=parseInt(f,10)}return f},log:function(f){if(f=_.lookupLevel(f),typeof console<"u"&&_.lookupLevel(_.level)<=f){var d=_.methodMap[f];console[d]||(d="log");for(var l=arguments.length,a=Array(l>1?l-1:0),s=1;s= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Z.REVISION_CHANGES=r;var t="[object Object]";function e(o,u,h){this.helpers=o||{},this.partials=u||{},this.decorators=h||{},S.registerDefaultHelpers(this),f.registerDefaultDecorators(this)}e.prototype={constructor:e,logger:l.default,log:l.default.log,registerHelper:function(u,h){if(m.toString.call(u)===t){if(h)throw new _.default("Arg not supported with multiple helpers");m.extend(this.helpers,u)}else this.helpers[u]=h},unregisterHelper:function(u){delete this.helpers[u]},registerPartial:function(u,h){if(m.toString.call(u)===t)m.extend(this.partials,u);else{if(typeof h>"u")throw new _.default('Attempting to register a partial called "'+u+'" as undefined');this.partials[u]=h}},unregisterPartial:function(u){delete this.partials[u]},registerDecorator:function(u,h){if(m.toString.call(u)===t){if(h)throw new _.default("Arg not supported with multiple decorators");m.extend(this.decorators,u)}else this.decorators[u]=h},unregisterDecorator:function(u){delete this.decorators[u]},resetLoggedPropertyAccesses:function(){a.resetLoggedProperties()}};var i=l.default.log;return Z.log=i,Z.createFrame=m.createFrame,Z.logger=l.default,Z}var Oe={exports:{}},Mt;function Hr(){return Mt||(Mt=1,(function(v,m){m.__esModule=!0;function C(_){this.string=_}C.prototype.toString=C.prototype.toHTML=function(){return""+this.string},m.default=C,v.exports=m.default})(Oe,Oe.exports)),Oe.exports}var ee={},Ne={},At;function Tr(){if(At)return Ne;At=1,Ne.__esModule=!0,Ne.wrapHelper=v;function v(m,C){if(typeof m!="function")return m;var _=function(){var f=arguments[arguments.length-1];return arguments[arguments.length-1]=C(f),m.apply(this,arguments)};return _}return Ne}var Ot;function Fr(){if(Ot)return ee;Ot=1,ee.__esModule=!0,ee.checkRevision=n,ee.template=c,ee.wrapProgram=r,ee.resolvePartial=t,ee.invokePartial=e,ee.noop=i;function v(p){return p&&p.__esModule?p:{default:p}}function m(p){if(p&&p.__esModule)return p;var b={};if(p!=null)for(var y in p)Object.prototype.hasOwnProperty.call(p,y)&&(b[y]=p[y]);return b.default=p,b}var C=z(),_=m(C),S=X(),f=v(S),d=rt(),l=tr(),a=Tr(),s=nr();function n(p){var b=p&&p[0]||1,y=d.COMPILER_REVISION;if(!(b>=d.LAST_COMPATIBLE_COMPILER_REVISION&&b<=d.COMPILER_REVISION))if(b '),H=B('');function J(f,a){N(a,!1);let t=r(a,"button",12),l=r(a,"on_click",12);var m={get button(){return t()},set button(e){t(e),q()},get on_click(){return l()},set on_click(e){l(e),q()}};W();var n=H(),_=w(n);{var s=e=>{var u=G(),p=w(u,!0);C(u),y(()=>D(p,(v(t()),d(()=>t().value)))),c(e,u)};b(_,e=>{v(t()),d(()=>t().value)&&e(s)})}return C(n),y(()=>{j(n,"title",(v(t()),d(()=>t().value||""))),j(n,"aria-label",(v(t()),d(()=>t().value||"Custom action")))}),A("click",n,()=>l()(t().id)),c(f,n),O(m)}var K=B("
        ");function tt(f,a){N(a,!0);let t=r(a,"top_panel",3,!0),l=r(a,"display_top_corner",3,!1),m=r(a,"show_background",3,!0),n=r(a,"buttons",3,null),_=r(a,"on_custom_button_click",3,null);var s=K(),e=w(s);{var u=o=>{var i=h(),k=x(i);F(k,()=>a.children),c(o,i)};b(e,o=>{a.children&&o(u)})}var p=E(e,2);{var P=o=>{var i=h(),k=x(i);Z(k,17,n,z,(Q,I)=>{var S=h(),R=x(S);{var T=g=>{J(g,{get button(){return M(I)},on_click:U=>{_()&&_()(U)}})};b(R,g=>{typeof M(I)!="string"&&g(T)})}c(Q,S)}),c(o,i)};b(p,o=>{n()&&o(P)})}C(s),y(()=>X(s,1,`icon-button-wrapper ${t()?"top-panel":""} ${l()?"display-top-corner":"hide-top-corner"} ${m()?"":"no-background"}`,"svelte-1u3m6j7")),c(f,s),O()}export{J as C,tt as I}; +import{p as r,e as W,i as b,a as j,b as X,q as Z,w as z}from"./i18n-DtG3MAQ1.js";import{M as N,x as v,v as d,t as y,U as A,a as c,O,P as q,Q as w,X as D,R as B,T as C,S as E,a3 as h,N as x,Z as M}from"./index-BeNBoC9J.js";import{s as F}from"./snippet-BRIBYCwB.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";var G=B(' '),H=B('');function J(f,a){N(a,!1);let t=r(a,"button",12),l=r(a,"on_click",12);var m={get button(){return t()},set button(e){t(e),q()},get on_click(){return l()},set on_click(e){l(e),q()}};W();var n=H(),_=w(n);{var s=e=>{var u=G(),p=w(u,!0);C(u),y(()=>D(p,(v(t()),d(()=>t().value)))),c(e,u)};b(_,e=>{v(t()),d(()=>t().value)&&e(s)})}return C(n),y(()=>{j(n,"title",(v(t()),d(()=>t().value||""))),j(n,"aria-label",(v(t()),d(()=>t().value||"Custom action")))}),A("click",n,()=>l()(t().id)),c(f,n),O(m)}var K=B("
        ");function tt(f,a){N(a,!0);let t=r(a,"top_panel",3,!0),l=r(a,"display_top_corner",3,!1),m=r(a,"show_background",3,!0),n=r(a,"buttons",3,null),_=r(a,"on_custom_button_click",3,null);var s=K(),e=w(s);{var u=o=>{var i=h(),k=x(i);F(k,()=>a.children),c(o,i)};b(e,o=>{a.children&&o(u)})}var p=E(e,2);{var P=o=>{var i=h(),k=x(i);Z(k,17,n,z,(Q,I)=>{var S=h(),R=x(S);{var T=g=>{J(g,{get button(){return M(I)},on_click:U=>{_()&&_()(U)}})};b(R,g=>{typeof M(I)!="string"&&g(T)})}c(Q,S)}),c(o,i)};b(p,o=>{n()&&o(P)})}C(s),y(()=>X(s,1,`icon-button-wrapper ${t()?"top-panel":""} ${l()?"display-top-corner":"hide-top-corner"} ${m()?"":"no-background"}`,"svelte-1u3m6j7")),c(f,s),O()}export{J as C,tt as I}; diff --git a/assets/Image-CZ1Hb99p.js b/assets/Image-ALBOEs1f.js similarity index 69% rename from assets/Image-CZ1Hb99p.js rename to assets/Image-ALBOEs1f.js index 152387d2994f5c4029c093d791eedee3d141de47..cd109e0d3f11fb06407a0a6486d7c6b63dcc5513 100644 --- a/assets/Image-CZ1Hb99p.js +++ b/assets/Image-ALBOEs1f.js @@ -1 +1 @@ -import{p as e,c as l,r as n}from"./i18n-CPHyzK9b.js";import{M as d,U as v,a as _,O as f,R as p,V as u}from"./index-DydPgVMC.js";import{b}from"./misc-Dkc5KZ-v.js";/* empty css */var g=p("");function I(r,s){d(s,!0);let o=e(s,"src",3,""),i=e(s,"restProps",19,()=>({})),m=e(s,"class_names",19,()=>[]),c=n(s,["$$slots","$$events","$$legacy","src","restProps","data_testid","class_names"]);var t=g();l(t,a=>({src:o(),class:a,"data-testid":s.data_testid,...i(),...c}),[()=>m().join(" ")],void 0,void 0,"svelte-1xeksve"),u(t),v("load",t,function(a){b.call(this,s,a)}),_(r,t),f()}export{I}; +import{p as e,c as l,r as n}from"./i18n-DtG3MAQ1.js";import{M as d,U as v,a as _,O as f,R as p,V as u}from"./index-BeNBoC9J.js";import{b}from"./misc-D-Y84gKJ.js";/* empty css */var g=p("");function I(r,s){d(s,!0);let o=e(s,"src",3,""),i=e(s,"restProps",19,()=>({})),m=e(s,"class_names",19,()=>[]),c=n(s,["$$slots","$$events","$$legacy","src","restProps","data_testid","class_names"]);var t=g();l(t,a=>({src:o(),class:a,"data-testid":s.data_testid,...i(),...c}),[()=>m().join(" ")],void 0,void 0,"svelte-1xeksve"),u(t),v("load",t,function(a){b.call(this,s,a)}),_(r,t),f()}export{I}; diff --git a/assets/Image-DBmW1mOo.js b/assets/Image-DWBzZYev.js similarity index 74% rename from assets/Image-DBmW1mOo.js rename to assets/Image-DWBzZYev.js index 2e99a1613de70d24420c317ed1f430931153115a..6bea4313e579a31a0c122b296f9e632a7cb45dcb 100644 --- a/assets/Image-DBmW1mOo.js +++ b/assets/Image-DWBzZYev.js @@ -1 +1 @@ -import"./i18n-CPHyzK9b.js";import{a as o,f as t}from"./index-DydPgVMC.js";var i=t('');function a(r){var e=i();o(r,e)}export{a as I}; +import"./i18n-DtG3MAQ1.js";import{a as o,f as t}from"./index-BeNBoC9J.js";var i=t('');function a(r){var e=i();o(r,e)}export{a as I}; diff --git a/assets/ImagePreview-C41duyJ0.js b/assets/ImagePreview-Dr2yPezw.js similarity index 83% rename from assets/ImagePreview-C41duyJ0.js rename to assets/ImagePreview-Dr2yPezw.js index 6b9bb38878febc4513d0125cc2210098e6c2798e..7d5bd7eb8968df5e13e7d0cacc9b21de8ce005fe 100644 --- a/assets/ImagePreview-C41duyJ0.js +++ b/assets/ImagePreview-Dr2yPezw.js @@ -1 +1 @@ -import{p as s,e as te,i as p,A as re,d as ae,b as ne}from"./i18n-CPHyzK9b.js";import{M as le,a1 as oe,N as A,Z as w,a as S,O as se,P as u,ad as D,x as o,v as _,S as k,R as E,Q as M,T as N,$ as ue,t as ie,U as ce,a0 as _e}from"./index-DydPgVMC.js";import{b as T}from"./misc-Dkc5KZ-v.js";import{I as de}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as ge}from"./BlockLabel-BzVeVrtL.js";import{D as me}from"./DownloadLink-DM2QmhDx.js";import{E as fe}from"./Empty-B15ItVsj.js";import{S as be}from"./ShareButton-Cuvs43xM.js";import{D as he}from"./Download-DWSaBiea.js";import{I as C}from"./Image-DBmW1mOo.js";import{I as ve}from"./IconButtonWrapper-PnNNNvqI.js";import{F as pe}from"./FullscreenButton-BuyUU5Yj.js";import{I as we}from"./Image-CZ1Hb99p.js";/* empty css */const ke=b=>{let t;if(b.currentTarget instanceof Element)t=b.currentTarget.querySelector("img");else return[NaN,NaN];const a=t.getBoundingClientRect(),i=Math.min(a.width/t.naturalWidth,a.height/t.naturalHeight,1),d=(a.width-t.naturalWidth*i)/2,n=(a.height-t.naturalHeight*i)/2,g=Math.round((b.clientX-a.left-d)/i),m=Math.round((b.clientY-a.top-n)/i);return g<0||g>=t.naturalWidth||m<0||m>=t.naturalHeight?null:[g,m]};var ye=E(" ",1),Ie=E('
        '),Pe=E(" ",1);function xe(b,t){le(t,!1);let a=s(t,"value",12),i=s(t,"label",12,void 0),d=s(t,"show_label",12),n=s(t,"buttons",28,()=>[]),g=s(t,"on_custom_button_click",12,null),m=s(t,"selectable",12,!1),f=s(t,"i18n",12),y=s(t,"display_icon_button_wrapper_top_corner",12,!1),v=s(t,"fullscreen",12,!1),I=s(t,"show_button_background",12,!0);const H=oe(),Q=e=>{let c=ke(e);c&&H("select",{index:c,value:null})};let W=_e();var U={get value(){return a()},set value(e){a(e),u()},get label(){return i()},set label(e){i(e),u()},get show_label(){return d()},set show_label(e){d(e),u()},get buttons(){return n()},set buttons(e){n(e),u()},get on_custom_button_click(){return g()},set on_custom_button_click(e){g(e),u()},get selectable(){return m()},set selectable(e){m(e),u()},get i18n(){return f()},set i18n(e){f(e),u()},get display_icon_button_wrapper_top_corner(){return y()},set display_icon_button_wrapper_top_corner(e){y(e),u()},get fullscreen(){return v()},set fullscreen(e){v(e),u()},get show_button_background(){return I()},set show_button_background(e){I(e),u()}};te();var z=Pe(),F=A(z);{let e=D(()=>(o(d()),o(i()),o(f()),_(()=>d()?i()||f()("image.image"):"")));ge(F,{get show_label(){return d()},get Icon(){return C},get label(){return w(e)}})}var X=k(F,2);{var Y=e=>{fe(e,{unpadded_box:!0,size:"large",children:(c,P)=>{C(c)},$$slots:{default:!0}})},Z=e=>{var c=Ie(),P=M(c);ve(P,{get display_top_corner(){return y()},get show_background(){return I()},get buttons(){return n()},get on_custom_button_click(){return g()},children:(h,Be)=>{var R=ye(),j=A(R);{var J=l=>{pe(l,{get fullscreen(){return v()},onclick:r=>{v(r),H("fullscreen",r)}})};p(j,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="fullscreen"))&&l(J)})}var q=k(j,2);{var K=l=>{{let r=D(()=>(o(a()),_(()=>a().orig_name||"image")));me(l,{get href(){return o(a()),_(()=>a().url)},get download(){return w(r)},children:(L,Se)=>{{let ee=D(()=>(o(f()),_(()=>f()("common.download"))));de(L,{get Icon(){return he},get label(){return w(ee)}})}},$$slots:{default:!0}})}};p(q,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="download"))&&l(K)})}var V=k(q,2);{var $=l=>{be(l,{get i18n(){return f()},formatter:async r=>r?``:"",get value(){return a()},$$events:{share(r){T.call(this,t,r)},error(r){T.call(this,t,r)}}})};p(V,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="share"))&&l($)})}S(h,R)},$$slots:{default:!0}});var x=k(P,2),B=M(x);let O;var G=M(B);we(G,{get src(){return o(a()),_(()=>a().url)},restProps:{loading:"lazy",alt:""},$$events:{load(h){T.call(this,t,h)}}}),N(B),N(x),N(c),ae(c,h=>ue(W,h),()=>w(W)),ie(()=>O=ne(B,1,"image-frame svelte-iir8pm",null,O,{selectable:m()})),ce("click",x,Q),S(e,c)};p(X,e=>{o(a()),_(()=>a()==null||!a()?.url)?e(Y):e(Z,!1)})}return S(b,z),se(U)}const Ae=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));export{xe as I,Ae as a,ke as g}; +import{p as s,e as te,i as p,A as re,d as ae,b as ne}from"./i18n-DtG3MAQ1.js";import{M as le,a1 as oe,N as A,Z as w,a as S,O as se,P as u,ad as D,x as o,v as _,S as k,R as E,Q as M,T as N,$ as ue,t as ie,U as ce,a0 as _e}from"./index-BeNBoC9J.js";import{b as T}from"./misc-D-Y84gKJ.js";import{I as de}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as ge}from"./BlockLabel-CEOjqpu7.js";import{D as me}from"./DownloadLink-Dk6GrGSA.js";import{E as fe}from"./Empty-Clj0ErcW.js";import{S as be}from"./ShareButton-ImGYvlzQ.js";import{D as he}from"./Download-0gCL6VXM.js";import{I as C}from"./Image-DWBzZYev.js";import{I as ve}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as pe}from"./FullscreenButton-CFl3IB4T.js";import{I as we}from"./Image-ALBOEs1f.js";/* empty css */const ke=b=>{let t;if(b.currentTarget instanceof Element)t=b.currentTarget.querySelector("img");else return[NaN,NaN];const a=t.getBoundingClientRect(),i=Math.min(a.width/t.naturalWidth,a.height/t.naturalHeight,1),d=(a.width-t.naturalWidth*i)/2,n=(a.height-t.naturalHeight*i)/2,g=Math.round((b.clientX-a.left-d)/i),m=Math.round((b.clientY-a.top-n)/i);return g<0||g>=t.naturalWidth||m<0||m>=t.naturalHeight?null:[g,m]};var ye=E(" ",1),Ie=E('
        '),Pe=E(" ",1);function xe(b,t){le(t,!1);let a=s(t,"value",12),i=s(t,"label",12,void 0),d=s(t,"show_label",12),n=s(t,"buttons",28,()=>[]),g=s(t,"on_custom_button_click",12,null),m=s(t,"selectable",12,!1),f=s(t,"i18n",12),y=s(t,"display_icon_button_wrapper_top_corner",12,!1),v=s(t,"fullscreen",12,!1),I=s(t,"show_button_background",12,!0);const H=oe(),Q=e=>{let c=ke(e);c&&H("select",{index:c,value:null})};let W=_e();var U={get value(){return a()},set value(e){a(e),u()},get label(){return i()},set label(e){i(e),u()},get show_label(){return d()},set show_label(e){d(e),u()},get buttons(){return n()},set buttons(e){n(e),u()},get on_custom_button_click(){return g()},set on_custom_button_click(e){g(e),u()},get selectable(){return m()},set selectable(e){m(e),u()},get i18n(){return f()},set i18n(e){f(e),u()},get display_icon_button_wrapper_top_corner(){return y()},set display_icon_button_wrapper_top_corner(e){y(e),u()},get fullscreen(){return v()},set fullscreen(e){v(e),u()},get show_button_background(){return I()},set show_button_background(e){I(e),u()}};te();var z=Pe(),F=A(z);{let e=D(()=>(o(d()),o(i()),o(f()),_(()=>d()?i()||f()("image.image"):"")));ge(F,{get show_label(){return d()},get Icon(){return C},get label(){return w(e)}})}var X=k(F,2);{var Y=e=>{fe(e,{unpadded_box:!0,size:"large",children:(c,P)=>{C(c)},$$slots:{default:!0}})},Z=e=>{var c=Ie(),P=M(c);ve(P,{get display_top_corner(){return y()},get show_background(){return I()},get buttons(){return n()},get on_custom_button_click(){return g()},children:(h,Be)=>{var R=ye(),j=A(R);{var J=l=>{pe(l,{get fullscreen(){return v()},onclick:r=>{v(r),H("fullscreen",r)}})};p(j,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="fullscreen"))&&l(J)})}var q=k(j,2);{var K=l=>{{let r=D(()=>(o(a()),_(()=>a().orig_name||"image")));me(l,{get href(){return o(a()),_(()=>a().url)},get download(){return w(r)},children:(L,Se)=>{{let ee=D(()=>(o(f()),_(()=>f()("common.download"))));de(L,{get Icon(){return he},get label(){return w(ee)}})}},$$slots:{default:!0}})}};p(q,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="download"))&&l(K)})}var V=k(q,2);{var $=l=>{be(l,{get i18n(){return f()},formatter:async r=>r?``:"",get value(){return a()},$$events:{share(r){T.call(this,t,r)},error(r){T.call(this,t,r)}}})};p(V,l=>{o(n()),_(()=>n().some(r=>typeof r=="string"&&r==="share"))&&l($)})}S(h,R)},$$slots:{default:!0}});var x=k(P,2),B=M(x);let O;var G=M(B);we(G,{get src(){return o(a()),_(()=>a().url)},restProps:{loading:"lazy",alt:""},$$events:{load(h){T.call(this,t,h)}}}),N(B),N(x),N(c),ae(c,h=>ue(W,h),()=>w(W)),ie(()=>O=ne(B,1,"image-frame svelte-iir8pm",null,O,{selectable:m()})),ce("click",x,Q),S(e,c)};p(X,e=>{o(a()),_(()=>a()==null||!a()?.url)?e(Y):e(Z,!1)})}return S(b,z),se(U)}const Ae=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));export{xe as I,Ae as a,ke as g}; diff --git a/assets/Index-Df136VmG.js b/assets/Index-8AWEQqHg.js similarity index 80% rename from assets/Index-Df136VmG.js rename to assets/Index-8AWEQqHg.js index 0e2aa09730a89f0b09e38de836c3eada27b73d61..dbd807a15c3cd7f29f8b4c23606473038a7aced6 100644 --- a/assets/Index-Df136VmG.js +++ b/assets/Index-8AWEQqHg.js @@ -1 +1 @@ -import{p as O,a as x,b as Q,v as U,G as W,g as X,i as Z,q as j,r as z,w as A}from"./i18n-CPHyzK9b.js";import{M as I,t as R,U as C,a as k,O as S,Q as G,S as v,R as T,$ as P,Z as s,G as D,a2 as m,X as q,T as y,aa as F,ab as H,ac as J,N as K,a4 as L,ar as V,a5 as Y}from"./index-DydPgVMC.js";import{B as $}from"./Block-WPcVj6Bq.js";import{B as ee}from"./BlockTitle-DNiCHWOR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as te}from"./IconButtonWrapper-PnNNNvqI.js";import{S as ae}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{c as se}from"./input-BtIxlP_B.js";import{default as Ge}from"./Example-I6GSpyxR.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";let re=0;var le=T('');function ie(h,t){I(t,!0);const f=[];let e=O(t,"selected",15),i=m(()=>e()===t.internal_value);async function d(u){P(i,u.currentTarget.checked),s(i)&&(await D(),t.on_input())}var r=le();let g;var a=G(r);U(a);var n,o=v(a,2),b=G(o,!0);y(o),y(r),R(()=>{x(r,"data-testid",`${t.display_value??""}-radio-label`),g=Q(r,1,"svelte-4n7k2m",null,g,{disabled:t.disabled,selected:s(i),rtl:t.rtl}),a.disabled=t.disabled,x(a,"name",`radio-${++re}`),x(a,"aria-checked",s(i)),n!==(n=t.internal_value)&&(a.value=(a.__value=t.internal_value)??""),q(b,t.display_value)}),se(f,[],a,()=>(t.internal_value,e()),e),C("input",a,d),k(h,r),S()}var ne=T('
        ',1);function ye(h,t){I(t,!0);const f=z(t,["$$slots","$$events","$$legacy"]),e=new W(f);let i=m(()=>!e.shared.interactive),d=F(H(e.props.value));J(()=>{s(d)!=e.props.value&&(P(d,e.props.value,!0),e.dispatch("change"))}),$(h,{get visible(){return e.shared.visible},type:"fieldset",get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get rtl(){return e.props.rtl},children:(r,g)=>{var a=ne(),n=K(a);ae(n,X({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var o=v(n,2);{var b=l=>{te(l,{get buttons(){return e.props.buttons},on_custom_button_click:c=>{e.dispatch("custom_button_click",{id:c})}})};Z(o,l=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&l(b)})}var u=v(o,2);ee(u,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(l,c)=>{Y();var p=L();R(_=>q(p,_),[()=>e.shared.label||e.i18n("radio.radio")]),k(l,p)},$$slots:{default:!0}});var w=v(u,2);j(w,21,()=>e.props.choices,A,(l,c,p)=>{var _=m(()=>V(s(c),2));let E=()=>s(_)[0],B=()=>s(_)[1];{let M=m(()=>e.live_i18n(E()));ie(l,{get display_value(){return s(M)},get internal_value(){return B()},get disabled(){return s(i)},get rtl(){return e.props.rtl},on_input:()=>{e.dispatch("input"),e.dispatch("select",{value:B(),index:p})},get selected(){return e.props.value},set selected(N){e.props.value=N}})}}),y(w),k(r,a)},$$slots:{default:!0}}),S()}export{Ge as BaseExample,ie as BaseRadio,ye as default}; +import{p as O,a as x,b as Q,v as U,G as W,g as X,i as Z,q as j,r as z,w as A}from"./i18n-DtG3MAQ1.js";import{M as I,t as R,U as C,a as k,O as S,Q as G,S as v,R as T,$ as P,Z as s,G as D,a2 as m,X as q,T as y,aa as F,ab as H,ac as J,N as K,a4 as L,ar as V,a5 as Y}from"./index-BeNBoC9J.js";import{B as $}from"./Block-DkzyQHli.js";import{B as ee}from"./BlockTitle-B6Pgijwb.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as te}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as ae}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{c as se}from"./input-BLFxNjIx.js";import{default as Ge}from"./Example-R1cs93ij.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";let re=0;var le=T('');function ie(h,t){I(t,!0);const f=[];let e=O(t,"selected",15),i=m(()=>e()===t.internal_value);async function d(u){P(i,u.currentTarget.checked),s(i)&&(await D(),t.on_input())}var r=le();let g;var a=G(r);U(a);var n,o=v(a,2),b=G(o,!0);y(o),y(r),R(()=>{x(r,"data-testid",`${t.display_value??""}-radio-label`),g=Q(r,1,"svelte-4n7k2m",null,g,{disabled:t.disabled,selected:s(i),rtl:t.rtl}),a.disabled=t.disabled,x(a,"name",`radio-${++re}`),x(a,"aria-checked",s(i)),n!==(n=t.internal_value)&&(a.value=(a.__value=t.internal_value)??""),q(b,t.display_value)}),se(f,[],a,()=>(t.internal_value,e()),e),C("input",a,d),k(h,r),S()}var ne=T('
        ',1);function ye(h,t){I(t,!0);const f=z(t,["$$slots","$$events","$$legacy"]),e=new W(f);let i=m(()=>!e.shared.interactive),d=F(H(e.props.value));J(()=>{s(d)!=e.props.value&&(P(d,e.props.value,!0),e.dispatch("change"))}),$(h,{get visible(){return e.shared.visible},type:"fieldset",get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get rtl(){return e.props.rtl},children:(r,g)=>{var a=ne(),n=K(a);ae(n,X({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var o=v(n,2);{var b=l=>{te(l,{get buttons(){return e.props.buttons},on_custom_button_click:c=>{e.dispatch("custom_button_click",{id:c})}})};Z(o,l=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&l(b)})}var u=v(o,2);ee(u,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(l,c)=>{Y();var p=L();R(_=>q(p,_),[()=>e.shared.label||e.i18n("radio.radio")]),k(l,p)},$$slots:{default:!0}});var w=v(u,2);j(w,21,()=>e.props.choices,A,(l,c,p)=>{var _=m(()=>V(s(c),2));let E=()=>s(_)[0],B=()=>s(_)[1];{let M=m(()=>e.live_i18n(E()));ie(l,{get display_value(){return s(M)},get internal_value(){return B()},get disabled(){return s(i)},get rtl(){return e.props.rtl},on_input:()=>{e.dispatch("input"),e.dispatch("select",{value:B(),index:p})},get selected(){return e.props.value},set selected(N){e.props.value=N}})}}),y(w),k(r,a)},$$slots:{default:!0}}),S()}export{Ge as BaseExample,ie as BaseRadio,ye as default}; diff --git a/assets/Index-AYOgU-eZ.js b/assets/Index-AYOgU-eZ.js new file mode 100644 index 0000000000000000000000000000000000000000..3d2f5253a31a1c54144284254b286cf5d5e3f979 --- /dev/null +++ b/assets/Index-AYOgU-eZ.js @@ -0,0 +1 @@ +import{G as m,g as i,r as d,s as l}from"./i18n-DtG3MAQ1.js";import{M as n,O as f,a3 as u,N as c,a as $}from"./index-BeNBoC9J.js";import{B as g}from"./Index.svelte_svelte_type_style_lang-CqKXbK2o.js";import"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./html-DE4EmiOG.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./index-B_pwUImq.js";import"./Clear-BiKSVifk.js";function N(s,r){n(r,!0);let t=d(r,["$$slots","$$events","$$legacy"]);const a=new m(t);g(s,i(()=>a.shared,{children:(e,h)=>{var o=u(),p=c(o);l(p,r,"default",{}),$(e,o)},$$slots:{default:!0}})),f()}export{g as BaseColumn,N as default}; diff --git a/assets/Index-CvbBGSYW.js b/assets/Index-B1uREyKL.js similarity index 93% rename from assets/Index-CvbBGSYW.js rename to assets/Index-B1uREyKL.js index 9c1c38b59dda5def3999333b1cc07aa0bacac47e..dd66b93681c826e6deb01c5772c7aee6bf793c2c 100644 --- a/assets/Index-CvbBGSYW.js +++ b/assets/Index-B1uREyKL.js @@ -1 +1 @@ -import{p as u,i as C,a as N,d as be,M as Et,q as et,w as tt,W as Ft,h as Ht,b as ne,f as Pt,G as Bt,r as Gt,g as Ut}from"./i18n-CPHyzK9b.js";import{a as p,f as Wt,G as oe,ah as at,M as ze,aa as S,ab as Ae,a7 as rt,$ as n,Z as t,ae as Vt,ac as se,Q as g,T as f,t as B,O as Te,S as j,N as we,X as me,as as Lt,R,aL as Yt,ag as qt,a4 as Me,u as Kt,U as Z,a2 as L,a5 as Xt,a3 as Qe,ai as Nt}from"./index-DydPgVMC.js";import{a as Ot}from"./actions-4RaHFoGI.js";import{b as Qt}from"./input-BtIxlP_B.js";import{M as Zt,V as Jt}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as $t}from"./BlockTitle-DNiCHWOR.js";import{A as ea}from"./ArrowUp-aILrPIpo.js";import{C as ta}from"./Check-2f8HlfSn.js";import{C as Ze}from"./Clear-BR8cTgGu.js";import{F as aa}from"./File-_VpQFuKr.js";import{M as ra}from"./Music-CGJUBXWE.js";import{S as lt}from"./Square-D8rV3Ea-.js";import{S as la}from"./ScrollFade-CeVpKVW3.js";import{U as oa}from"./Upload-Bq9KuxCu.js";import{I as ia}from"./Image-CZ1Hb99p.js";/* empty css */import{u as na,p as sa,M as da}from"./MinimalAudioPlayer-C59qi7fl.js";import{o as Je}from"./record.esm-EHLfhwCm.js";import{B as ua}from"./Block-WPcVj6Bq.js";import{S as ca}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{default as fr}from"./Example-CxjbLxdV.js";import"./snippet-BtHMuX3s.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./index-B_pwUImq.js";import"./size-D4lmUoTq.js";import"./Video-BOdhnjQz.js";import"./universal-C9tCO36V.js";var _a=Wt('');function $e(c){var e=_a();p(c,e)}async function De(c,e,o){if(await oe(),e===o)return;const D=window.getComputedStyle(c),H=parseFloat(D.paddingTop),l=parseFloat(D.paddingBottom),M=parseFloat(D.lineHeight);let I=o===void 0?!1:H+l+M*o,h=H+l+e*M;c.style.height="1px";let k;I&&c.scrollHeight>I?k=I:c.scrollHeighto+D?c.style.overflowY="scroll":c.style.overflowY="hidden"}function fa(c,e){if(e.lines===e.max_lines)return;ot(c);function o(D){De(D.target,e.lines,e.max_lines)}if(c.addEventListener("input",o),!!e.text.trim())return De(c,e.lines,e.max_lines),{destroy:()=>c.removeEventListener("input",o)}}var va=R(""),ga=R(''),ma=R('
        '),pa=R('
        ',1),ha=R('
        ');function ba(c,e){ze(e,!0);let o=u(e,"waveform_settings",19,()=>({})),D=u(e,"recording",15),H=u(e,"max_file_size",3,null),l=u(e,"upload_promise",15),M,I,h=S(void 0),k=S(0),Y,O=S(!1),te=S(!1),P=S(Ae([])),Q=S(""),J=S(!1);const de=()=>{clearInterval(Y),Y=setInterval(()=>{Yt(k)},1e3)},E=async()=>{if(!M)return;I&&I.destroy();const v=getComputedStyle(document.documentElement).getPropertyValue("--color-accent")||"#ff7c00";I=na.create({container:M,height:32,waveColor:"rgba(128, 128, 128, 0.5)",progressColor:v,cursorColor:"transparent",barWidth:2,barGap:2,barRadius:2,interact:!1,hideScrollbar:!0,...o()}),n(h,I.registerPlugin(Je.create({scrollingWaveform:!0,scrollingWaveformWindow:7,renderRecordedAudio:!1})),!0),t(h).on("record-start",()=>{de(),n(O,!0),n(te,!0)}),t(h).on("record-end",async x=>{clearInterval(Y),n(O,!1),l((async()=>{try{const s=await x.arrayBuffer(),q=await new AudioContext({sampleRate:o().sampleRate||44100}).decodeAudioData(s);if(q){const d=await sa(q),K=new File([new Uint8Array(d)],"audio.wav",{type:"audio/wav"}),z=await Lt([K],!1),A=(await e.upload(z,e.root,void 0,H()||void 0))?.[0];A&&e.onchange?.(A)}}catch(s){console.error("Error processing audio:",s)}finally{e.onstoprecording?.(),l(null)}})()),await l()})};rt(async()=>{try{const v=await Je.getAvailableAudioDevices();n(P,v.filter(x=>x.deviceId),!0),t(P).length>0&&n(Q,t(P)[0].deviceId,!0),t(P).length>1?n(J,!0):await E()}catch{await E()}}),Vt(()=>{clearInterval(Y),t(h)&&t(h).stopMic(),I&&I.destroy()}),se(()=>{D()&&!t(O)&&t(h)&&t(te)===!1&&t(P).length<=1?t(h).startMic({deviceId:t(Q)}).then(()=>{t(h)?.startRecording()}).catch(v=>{console.error("Failed to access microphone:",v),e.onclear?.()}):!D()&&t(O)&&t(h)&&(t(h).stopRecording(),n(k,0))});async function ue(){if(n(J,!1),n(te,!0),await oe(),await E(),!!t(h))try{await t(h).startMic({deviceId:t(Q)}),t(h).startRecording()}catch(v){console.error("Error starting recording:",v),n(J,t(P).length>1),n(te,!1),D(!1)}}var ae=ha(),G=g(ae);{var U=v=>{var x=ma(),s=g(x);{var W=d=>{var K=ga();et(K,21,()=>t(P),tt,(z,ie)=>{var A=va(),X=g(A,!0);f(A);var ce={};B(()=>{me(X,t(ie).label),ce!==(ce=t(ie).deviceId)&&(A.value=(A.__value=t(ie).deviceId)??"")}),p(z,A)}),f(K),Ft(K,()=>t(Q),z=>n(Q,z)),p(d,K)};C(s,d=>{t(P).length>1&&d(W)})}var q=j(s,2);q.__click=ue,f(x),p(v,x)},$=v=>{var x=pa(),s=we(x);be(s,z=>M=z,()=>M);var W=j(s,2),q=g(W,!0);f(W);var d=j(W,2);d.__click=()=>{t(O)?D(!1):e.onclear?.()};var K=g(d);lt(K,{}),f(d),B(z=>me(q,z),[()=>Et(t(k))]),p(v,x)};C(G,v=>{t(J)?v(U):v($,!1)})}f(ae),B(()=>N(ae,"aria-label",e.label||"Audio Recorder")),p(c,ae),Te()}at(["click"]);var wa=R('
        '),xa=R('
        '),ya=R("
        "),ka=R(''),Ca=R('
        '),ja=R('
        '),Sa=R('
        '),Ra=R(''),Ma=R(''),Aa=R(''),Da=R(''),za=R('
        ');function Ta(c,e){ze(e,!0);let o=u(e,"value",31,()=>Ae({text:"",files:[]})),D=u(e,"value_is_output",3,!1),H=u(e,"lines",3,1),l=u(e,"placeholder",3,""),M=u(e,"disabled",3,!1),I=u(e,"info",3,void 0),h=u(e,"show_label",3,!0),k=u(e,"submit_btn",3,null),Y=u(e,"stop_btn",3,null),O=u(e,"rtl",3,!1),te=u(e,"autofocus",3,!1),P=u(e,"text_align",3,void 0),Q=u(e,"autoscroll",3,!0),J=u(e,"file_types_string",3,null),de=u(e,"max_file_size",3,null),E=u(e,"file_count",3,"multiple"),ue=u(e,"max_plain_text_length",3,1e3);u(e,"waveform_options",19,()=>({show_recording_waveform:!0}));let ae=u(e,"sources_string",3,"upload"),G=u(e,"active_source",15),U=u(e,"html_attributes",3,null),$=u(e,"upload_promise",15),v=u(e,"dragging",15),x,s,W=S(!1),q=S(0),d=S(!1),K=S(!1),z=S(!1),ie=S(Ae(o()?.text??"")),A=S(!1),X=S(null),ce,_e=L(()=>ae().split(",").map(a=>a.trim()).filter(a=>a==="upload"||a==="microphone")),pe=L(()=>J()?J().split(",").map(a=>a.trim()):null),xe=L(()=>t(_e)&&t(_e).includes("upload")&&!(E()==="single"&&o()?.files?.length>0));function Ie(){n(K,Ht(s),!0)}se(()=>{s&&o()?.text!==void 0&&oe().then(Ie)}),se(()=>{e.ondrag?.(v())}),se(()=>{o()&&t(ie)!==o().text&&(e.onchange?.(o()),n(ie,o().text,!0))}),se(()=>{o()?.text,s&&H()!==e.max_lines&&De(s,H(),e.max_lines)}),qt(()=>{s&&s.offsetHeight+s.scrollTop>s.scrollHeight-100&&n(W,!0)});const it=()=>{t(W)&&Q()&&!t(d)&&s.scrollTo(0,s.scrollHeight)};async function Ee(){e.onchange?.(o()),D()||e.oninput?.()}se(()=>{o(),te()&&s&&s.focus()}),se(()=>{t(W)&&Q()&&it()});function nt(a){const r=a.target,i=r.value,m=[r.selectionStart,r.selectionEnd];e.onselect?.({value:i.substring(...m),index:m})}async function st(a){a.key==="Enter"&&a.shiftKey&&H()>1?(a.preventDefault(),await oe(),e.onsubmit?.()):a.key==="Enter"&&!a.shiftKey&&H()===1&&e.max_lines>=1&&(a.preventDefault(),ye(),G(null),await oe(),e.onsubmit?.())}function dt(a){const r=a.target,i=r.scrollTop;i=m&&n(d,!1),Ie()}async function ut(a){if(Ee(),Array.isArray(a)){for(let r of a)o().files.push(r);o(o())}else o().files.push(a),o(o());await oe(),e.onchange?.(o()),e.onupload?.(a)}function ct(a,r){Ee(),a.stopPropagation(),o().files.splice(r,1),o(o())}function Fe(){x.open_upload()}function _t(){e.onstop?.()}function ye(){t(X)&&(o().files.push(t(X)),o(o()),n(X,null),e.onchange?.(o()))}function ft(){ye(),G(null),e.onsubmit?.()}async function vt(a){if(!a.clipboardData)return;const r=a.clipboardData.items,i=a.clipboardData.getData("text");if(i&&i.length>ue()){a.preventDefault();const m=new window.File([i],"pasted_text.txt",{type:"text/plain",lastModified:Date.now()});x&&x.load_files([m]);return}for(let m in r){const T=r[m];if(T.kind==="file"&&T.type.includes("image")){const F=T.getAsFile();F&&x.load_files([F])}}}function gt(a){a.preventDefault(),v(!0)}function mt(a){a.preventDefault();const r=ce.getBoundingClientRect(),{clientX:i,clientY:m}=a;(i<=r.left||i>=r.right||m<=r.top||m>=r.bottom)&&v(!1)}function pt(a){if(a.preventDefault(),v(!1),a.dataTransfer&&a.dataTransfer.files){const r=Array.from(a.dataTransfer.files);if(t(pe)){const i=r.filter(T=>t(pe).some(F=>F.startsWith(".")?T.name.toLowerCase().endsWith(F.toLowerCase()):T.type.match(new RegExp(F.replace("*",".*"))))),m=r.length-i.length;m>0&&e.onerror?.(`${m} file(s) were rejected. Accepted formats: ${t(pe).join(", ")}`),i.length>0&&x.load_files(i)}else x.load_files(r)}}var ee=za();let He;var Pe=g(ee);$t(Pe,{get show_label(){return h()},get info(){return I()},get rtl(){return O()},children:(a,r)=>{Xt();var i=Me();B(()=>me(i,e.label)),p(a,i)},$$slots:{default:!0}});var Be=j(Pe,2),Ge=g(Be);{var ht=a=>{var r=ya();let i;var m=g(r);{var T=w=>{var b=wa(),y=g(b);{let re=L(()=>e.label||"Audio");ba(y,{get label(){return t(re)},get waveform_settings(){return e.waveform_settings},get recording(){return t(A)},get upload(){return e.upload},get root(){return e.root},get max_file_size(){return de()},onchange:V=>{n(X,V,!0)},onstoprecording:()=>{n(A,!1),e.onstop_recording?.()},onclear:()=>{G(null),n(A,!1),n(X,null),e.onclear?.()},get upload_promise(){return $()},set upload_promise(V){$(V)}})}f(b),p(w,b)},F=w=>{var b=xa(),y=g(b);{let Se=L(()=>e.label||"Audio");da(y,{get value(){return t(X)},get label(){return t(Se)},loop:!1})}var re=j(y,2),V=g(re);V.__click=()=>{ye(),G(null),n(A,!1)};var he=g(V);ta(he),f(V);var fe=j(V,2);fe.__click=()=>{G(null),n(A,!1),n(X,null)};var je=g(fe);Ze(je),f(fe),f(re),f(b),p(w,b)};C(m,w=>{t(X)?w(F,!1):w(T)})}f(r),B(()=>i=ne(r,1,"recording-overlay svelte-1jnnld0",null,i,{"has-audio":t(X)!==null})),p(a,r)};C(Ge,a=>{t(_e)&&t(_e).includes("microphone")&&G()==="microphone"&&a(ht)})}var Ue=j(Ge,2);{var bt=a=>{be(oa(a,{onload:ut,get file_count(){return E()},get filetype(){return t(pe)},get root(){return e.root},get max_file_size(){return de()},show_progress:!1,disable_click:!0,get onerror(){return e.onerror},hidden:!0,get upload(){return e.upload},get stream_handler(){return e.stream_handler},get upload_promise(){return $()},set upload_promise(r){$(r)},get dragging(){return v()},set dragging(r){v(r)},get uploading(){return t(z)},set uploading(r){n(z,r,!0)}}),r=>x=r,()=>x)};C(Ue,a=>{t(xe)&&a(bt)})}var ke=j(Ue,2);let We;var Ve=g(ke);{var wt=a=>{var r=Sa(),i=g(r);{var m=b=>{var y=ka();y.__click=Fe;var re=g(y);$e(re),f(y),B(()=>y.disabled=M()),p(b,y)};C(i,b=>{t(xe)&&b(m)})}var T=j(i,2);et(T,17,()=>o()?.files??[],tt,(b,y,re)=>{var V=Ca(),he=g(V),fe=g(he);{var je=le=>{ia(le,{get src(){return t(y).url},restProps:{title:null,alt:"",loading:"lazy",class:"thumbnail-image"}})},Se=le=>{var Ne=Qe(),Mt=we(Ne);{var At=ve=>{ra(ve)},Dt=ve=>{var Oe=Qe(),zt=we(Oe);{var Tt=ge=>{Jt(ge)},It=ge=>{aa(ge)};C(zt,ge=>{t(y).mime_type&&t(y).mime_type.includes("video")?ge(Tt):ge(It,!1)},!0)}p(ve,Oe)};C(Mt,ve=>{t(y).mime_type&&t(y).mime_type.includes("audio")?ve(At):ve(Dt,!1)},!0)}p(le,Ne)};C(fe,le=>{t(y).mime_type&&t(y).mime_type.includes("image")?le(je):le(Se,!1)})}var Re=j(fe,2);Re.__click=le=>ct(le,re);var Rt=g(Re);Ze(Rt),f(Re),f(he),f(V),p(b,V)});var F=j(T,2);{var w=b=>{var y=ja();p(b,y)};C(F,b=>{t(z)&&b(w)})}f(r),p(a,r)};C(Ve,a=>{((o()?.files?.length??0)>0||t(z))&&a(wt)})}var Le=j(Ve,2),Ye=g(Le);{var xt=a=>{var r=Ra();r.__click=Fe;var i=g(r);$e(i),f(r),B(()=>r.disabled=M()),p(a,r)};C(Ye,a=>{t(xe)&&(o()?.files?.length??0)===0&&!t(z)&&a(xt)})}var Ce=j(Ye,2),_=g(Ce);Nt(_);let qe;Ot(_,(a,r)=>fa?.(a,r),()=>({text:o().text,lines:H(),max_lines:e.max_lines})),Kt(()=>Qt(_,()=>o().text,a=>o(o().text=a,!0))),be(_,a=>s=a,()=>s);var yt=j(_,2);la(yt,{get visible(){return t(K)},position:"absolute"}),f(Ce);var Ke=j(Ce,2);{var kt=a=>{var r=Ma();let i;r.__click=async()=>{G()!=="microphone"?(G("microphone"),await oe(),n(A,!0)):(G(null),n(A,!1))};var m=g(r);Zt(m),f(r),B(()=>{i=ne(r,1,"microphone-button svelte-1jnnld0",null,i,{recording:t(A)}),r.disabled=M()}),p(a,r)};C(Ke,a=>{t(_e)&&t(_e).includes("microphone")&&a(kt)})}var Xe=j(Ke,2);{var Ct=a=>{var r=Aa();let i;r.__click=ft;var m=g(r);{var T=w=>{ea(w)},F=w=>{var b=Me();B(()=>me(b,k())),p(w,b)};C(m,w=>{k()===!0?w(T):w(F,!1)})}f(r),B(()=>{i=ne(r,1,"submit-button svelte-1jnnld0",null,i,{"padded-button":k()!==!0}),r.disabled=M()}),p(a,r)};C(Xe,a=>{k()&&a(Ct)})}var jt=j(Xe,2);{var St=a=>{var r=Da();let i;r.__click=_t;var m=g(r);{var T=w=>{lt(w,{fill:"none",stroke_width:2.5})},F=w=>{var b=Me();B(()=>me(b,Y())),p(w,b)};C(m,w=>{Y()===!0?w(T):w(F,!1)})}f(r),B(()=>i=ne(r,1,"stop-button svelte-1jnnld0",null,i,{"padded-button":Y()!==!0})),p(a,r)};C(jt,a=>{Y()&&a(St)})}f(Le),f(ke),f(Be),f(ee),be(ee,a=>ce=a,()=>ce),B(()=>{He=ne(ee,1,"full-container svelte-1jnnld0",null,He,{dragging:v()}),We=ne(ke,1,"input-wrapper svelte-1jnnld0",null,We,{"has-files":(o()?.files?.length??0)>0||t(z)}),N(_,"dir",O()?"rtl":"ltr"),N(_,"placeholder",l()),N(_,"rows",H()),_.disabled=M(),Pt(_,P()?"text-align: "+P():""),N(_,"autocapitalize",U()?.autocapitalize),N(_,"autocorrect",U()?.autocorrect),N(_,"spellcheck",U()?.spellcheck),N(_,"autocomplete",U()?.autocomplete),N(_,"tabindex",U()?.tabindex),N(_,"enterkeyhint",U()?.enterkeyhint),N(_,"lang",U()?.lang),qe=ne(_,1,"svelte-1jnnld0",null,qe,{"no-label":!h()}),_.dir=_.dir}),Z("dragenter",ee,gt),Z("dragleave",ee,mt),Z("dragover",ee,a=>a.preventDefault()),Z("drop",ee,pt),Z("keypress",_,st),Z("blur",_,()=>e.onblur?.()),Z("select",_,nt),Z("focus",_,()=>e.onfocus?.()),Z("scroll",_,dt),Z("paste",_,vt),p(c,ee),Te()}at(["click"]);var Ia=R(" ",1);function ur(c,e){ze(e,!0);let o=S(null);class D extends Bt{async get_data(){return t(o)&&(await t(o),await oe()),await super.get_data()}}let H=Gt(e,["$$slots","$$events","$$legacy"]);const l=new D(H);l.props.value=l.props.value??{text:"",files:[]};let M=S(!1),I=S(null),h="darkorange";const k={height:50,barWidth:2,barGap:3,cursorWidth:2,cursorColor:"#ddd5e9",autoplay:!1,barRadius:10,dragToSeek:!0,normalize:!0,minPxPerSec:20,waveColor:"",progressColor:"",mediaControls:!1,sampleRate:44100};rt(()=>{h=getComputedStyle(document?.documentElement).getPropertyValue("--color-accent"),O(),k.waveColor=l.props?.waveform_options?.waveform_color||"#9ca3af",k.progressColor=l.props?.waveform_options?.waveform_progress_color||h,k.mediaControls=l.props?.waveform_options?.show_controls,k.sampleRate=l.props?.waveform_options?.sample_rate||44100});const Y={color:l.props?.waveform_options?.trim_region_color};function O(){document.documentElement.style.setProperty("--trim-region-color",Y.color||h)}const te=(...E)=>l.shared.client.upload(...E),P=E=>l.i18n(E),Q=(...E)=>l.shared.client.stream(...E);let J=L(()=>l.props.sources.join(",")),de=L(()=>(l.props.file_types||[]).join(",")||null);{let E=L(()=>[...l.shared.elem_classes||[],"multimodal-textbox"]),ue=L(()=>t(M)?"focus":"base");ua(c,{get visible(){return l.shared.visible},get elem_id(){return l.shared.elem_id},get elem_classes(){return t(E)},get scale(){return l.shared.scale},get min_width(){return l.shared.min_width},allow_overflow:!1,padding:!1,get border_mode(){return t(ue)},get rtl(){return l.props.rtl},children:(ae,G)=>{var U=Ia(),$=we(U);{var v=s=>{ca(s,Ut({get autoscroll(){return l.shared.autoscroll},get i18n(){return l.i18n}},()=>l.shared.loading_status,{on_clear_status:()=>l.dispatch("clear_status",l.shared.loading_status)}))};C($,s=>{l.shared.loading_status&&s(v)})}var x=j($,2);{let s=L(()=>l.shared.label||"MultimodalTextbox"),W=L(()=>l.props.max_lines?l.props.max_lines:l.props.lines+1),q=L(()=>!l.shared.interactive);Ta(x,{value_is_output:!0,get file_types_string(){return t(de)},get root(){return l.shared.root},get label(){return t(s)},get info(){return l.props.info},get show_label(){return l.shared.show_label},get lines(){return l.props.lines},get rtl(){return l.props.rtl},get text_align(){return l.props.text_align},get waveform_settings(){return k},i18n:P,get max_lines(){return t(W)},get placeholder(){return l.props.placeholder},get submit_btn(){return l.props.submit_btn},get stop_btn(){return l.props.stop_btn},get autofocus(){return l.props.autofocus},get autoscroll(){return l.shared.autoscroll},get file_count(){return l.props.file_count},get sources_string(){return t(J)},get max_file_size(){return l.shared.max_file_size},onchange:d=>{l.props.value=d,l.dispatch("change",l.props.value)},oninput:()=>l.dispatch("input"),onsubmit:()=>l.dispatch("submit"),onstop:()=>l.dispatch("stop"),onblur:()=>l.dispatch("blur"),onselect:d=>l.dispatch("select",d),onfocus:()=>l.dispatch("focus"),onerror:d=>{l.dispatch("error",d)},onstop_recording:()=>l.dispatch("stop_recording"),onupload:d=>l.dispatch("upload",d),onclear:()=>l.dispatch("clear"),get disabled(){return t(q)},upload:te,stream_handler:Q,get max_plain_text_length(){return l.props.max_plain_text_length},get html_attributes(){return l.props.html_attributes},get upload_promise(){return t(o)},set upload_promise(d){n(o,d,!0)},get value(){return l.props.value},set value(d){l.props.value=d},get dragging(){return t(M)},set dragging(d){n(M,d,!0)},get active_source(){return t(I)},set active_source(d){n(I,d,!0)}})}p(ae,U)},$$slots:{default:!0}})}Te()}export{fr as BaseExample,Ta as BaseMultimodalTextbox,ur as default}; +import{p as u,i as C,a as N,d as be,M as Et,q as et,w as tt,W as Ft,h as Ht,b as ne,f as Pt,G as Bt,r as Gt,g as Ut}from"./i18n-DtG3MAQ1.js";import{a as p,f as Wt,G as oe,ah as at,M as ze,aa as S,ab as Ae,a7 as rt,$ as n,Z as t,ae as Vt,ac as se,Q as g,T as f,t as B,O as Te,S as j,N as we,X as me,as as Lt,R,aL as Yt,ag as qt,a4 as Me,u as Kt,U as Z,a2 as L,a5 as Xt,a3 as Qe,ai as Nt}from"./index-BeNBoC9J.js";import{a as Ot}from"./actions-BbCJS635.js";import{b as Qt}from"./input-BLFxNjIx.js";import{M as Zt,V as Jt}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as $t}from"./BlockTitle-B6Pgijwb.js";import{A as ea}from"./ArrowUp-BNDE3Ai4.js";import{C as ta}from"./Check-DjGw_9dO.js";import{C as Ze}from"./Clear-BiKSVifk.js";import{F as aa}from"./File-CD333vfS.js";import{M as ra}from"./Music-DvtEcO9M.js";import{S as lt}from"./Square-CSlbzSkn.js";import{S as la}from"./ScrollFade-G27WKZg6.js";import{U as oa}from"./Upload-CGTpHDBO.js";import{I as ia}from"./Image-ALBOEs1f.js";/* empty css */import{u as na,p as sa,M as da}from"./MinimalAudioPlayer-B51K1PDx.js";import{o as Je}from"./record.esm-EHLfhwCm.js";import{B as ua}from"./Block-DkzyQHli.js";import{S as ca}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as fr}from"./Example-Dg0CCdE9.js";import"./snippet-BRIBYCwB.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./index-B_pwUImq.js";import"./size-ChvveZyb.js";import"./Video-BXpoIN7o.js";import"./universal-DqSjxxHG.js";var _a=Wt('');function $e(c){var e=_a();p(c,e)}async function De(c,e,o){if(await oe(),e===o)return;const D=window.getComputedStyle(c),H=parseFloat(D.paddingTop),l=parseFloat(D.paddingBottom),M=parseFloat(D.lineHeight);let I=o===void 0?!1:H+l+M*o,h=H+l+e*M;c.style.height="1px";let k;I&&c.scrollHeight>I?k=I:c.scrollHeighto+D?c.style.overflowY="scroll":c.style.overflowY="hidden"}function fa(c,e){if(e.lines===e.max_lines)return;ot(c);function o(D){De(D.target,e.lines,e.max_lines)}if(c.addEventListener("input",o),!!e.text.trim())return De(c,e.lines,e.max_lines),{destroy:()=>c.removeEventListener("input",o)}}var va=R(""),ga=R(''),ma=R('
        '),pa=R('
        ',1),ha=R('
        ');function ba(c,e){ze(e,!0);let o=u(e,"waveform_settings",19,()=>({})),D=u(e,"recording",15),H=u(e,"max_file_size",3,null),l=u(e,"upload_promise",15),M,I,h=S(void 0),k=S(0),Y,O=S(!1),te=S(!1),P=S(Ae([])),Q=S(""),J=S(!1);const de=()=>{clearInterval(Y),Y=setInterval(()=>{Yt(k)},1e3)},E=async()=>{if(!M)return;I&&I.destroy();const v=getComputedStyle(document.documentElement).getPropertyValue("--color-accent")||"#ff7c00";I=na.create({container:M,height:32,waveColor:"rgba(128, 128, 128, 0.5)",progressColor:v,cursorColor:"transparent",barWidth:2,barGap:2,barRadius:2,interact:!1,hideScrollbar:!0,...o()}),n(h,I.registerPlugin(Je.create({scrollingWaveform:!0,scrollingWaveformWindow:7,renderRecordedAudio:!1})),!0),t(h).on("record-start",()=>{de(),n(O,!0),n(te,!0)}),t(h).on("record-end",async x=>{clearInterval(Y),n(O,!1),l((async()=>{try{const s=await x.arrayBuffer(),q=await new AudioContext({sampleRate:o().sampleRate||44100}).decodeAudioData(s);if(q){const d=await sa(q),K=new File([new Uint8Array(d)],"audio.wav",{type:"audio/wav"}),z=await Lt([K],!1),A=(await e.upload(z,e.root,void 0,H()||void 0))?.[0];A&&e.onchange?.(A)}}catch(s){console.error("Error processing audio:",s)}finally{e.onstoprecording?.(),l(null)}})()),await l()})};rt(async()=>{try{const v=await Je.getAvailableAudioDevices();n(P,v.filter(x=>x.deviceId),!0),t(P).length>0&&n(Q,t(P)[0].deviceId,!0),t(P).length>1?n(J,!0):await E()}catch{await E()}}),Vt(()=>{clearInterval(Y),t(h)&&t(h).stopMic(),I&&I.destroy()}),se(()=>{D()&&!t(O)&&t(h)&&t(te)===!1&&t(P).length<=1?t(h).startMic({deviceId:t(Q)}).then(()=>{t(h)?.startRecording()}).catch(v=>{console.error("Failed to access microphone:",v),e.onclear?.()}):!D()&&t(O)&&t(h)&&(t(h).stopRecording(),n(k,0))});async function ue(){if(n(J,!1),n(te,!0),await oe(),await E(),!!t(h))try{await t(h).startMic({deviceId:t(Q)}),t(h).startRecording()}catch(v){console.error("Error starting recording:",v),n(J,t(P).length>1),n(te,!1),D(!1)}}var ae=ha(),G=g(ae);{var U=v=>{var x=ma(),s=g(x);{var W=d=>{var K=ga();et(K,21,()=>t(P),tt,(z,ie)=>{var A=va(),X=g(A,!0);f(A);var ce={};B(()=>{me(X,t(ie).label),ce!==(ce=t(ie).deviceId)&&(A.value=(A.__value=t(ie).deviceId)??"")}),p(z,A)}),f(K),Ft(K,()=>t(Q),z=>n(Q,z)),p(d,K)};C(s,d=>{t(P).length>1&&d(W)})}var q=j(s,2);q.__click=ue,f(x),p(v,x)},$=v=>{var x=pa(),s=we(x);be(s,z=>M=z,()=>M);var W=j(s,2),q=g(W,!0);f(W);var d=j(W,2);d.__click=()=>{t(O)?D(!1):e.onclear?.()};var K=g(d);lt(K,{}),f(d),B(z=>me(q,z),[()=>Et(t(k))]),p(v,x)};C(G,v=>{t(J)?v(U):v($,!1)})}f(ae),B(()=>N(ae,"aria-label",e.label||"Audio Recorder")),p(c,ae),Te()}at(["click"]);var wa=R('
        '),xa=R('
        '),ya=R("
        "),ka=R(''),Ca=R('
        '),ja=R('
        '),Sa=R('
        '),Ra=R(''),Ma=R(''),Aa=R(''),Da=R(''),za=R('
        ');function Ta(c,e){ze(e,!0);let o=u(e,"value",31,()=>Ae({text:"",files:[]})),D=u(e,"value_is_output",3,!1),H=u(e,"lines",3,1),l=u(e,"placeholder",3,""),M=u(e,"disabled",3,!1),I=u(e,"info",3,void 0),h=u(e,"show_label",3,!0),k=u(e,"submit_btn",3,null),Y=u(e,"stop_btn",3,null),O=u(e,"rtl",3,!1),te=u(e,"autofocus",3,!1),P=u(e,"text_align",3,void 0),Q=u(e,"autoscroll",3,!0),J=u(e,"file_types_string",3,null),de=u(e,"max_file_size",3,null),E=u(e,"file_count",3,"multiple"),ue=u(e,"max_plain_text_length",3,1e3);u(e,"waveform_options",19,()=>({show_recording_waveform:!0}));let ae=u(e,"sources_string",3,"upload"),G=u(e,"active_source",15),U=u(e,"html_attributes",3,null),$=u(e,"upload_promise",15),v=u(e,"dragging",15),x,s,W=S(!1),q=S(0),d=S(!1),K=S(!1),z=S(!1),ie=S(Ae(o()?.text??"")),A=S(!1),X=S(null),ce,_e=L(()=>ae().split(",").map(a=>a.trim()).filter(a=>a==="upload"||a==="microphone")),pe=L(()=>J()?J().split(",").map(a=>a.trim()):null),xe=L(()=>t(_e)&&t(_e).includes("upload")&&!(E()==="single"&&o()?.files?.length>0));function Ie(){n(K,Ht(s),!0)}se(()=>{s&&o()?.text!==void 0&&oe().then(Ie)}),se(()=>{e.ondrag?.(v())}),se(()=>{o()&&t(ie)!==o().text&&(e.onchange?.(o()),n(ie,o().text,!0))}),se(()=>{o()?.text,s&&H()!==e.max_lines&&De(s,H(),e.max_lines)}),qt(()=>{s&&s.offsetHeight+s.scrollTop>s.scrollHeight-100&&n(W,!0)});const it=()=>{t(W)&&Q()&&!t(d)&&s.scrollTo(0,s.scrollHeight)};async function Ee(){e.onchange?.(o()),D()||e.oninput?.()}se(()=>{o(),te()&&s&&s.focus()}),se(()=>{t(W)&&Q()&&it()});function nt(a){const r=a.target,i=r.value,m=[r.selectionStart,r.selectionEnd];e.onselect?.({value:i.substring(...m),index:m})}async function st(a){a.key==="Enter"&&a.shiftKey&&H()>1?(a.preventDefault(),await oe(),e.onsubmit?.()):a.key==="Enter"&&!a.shiftKey&&H()===1&&e.max_lines>=1&&(a.preventDefault(),ye(),G(null),await oe(),e.onsubmit?.())}function dt(a){const r=a.target,i=r.scrollTop;i=m&&n(d,!1),Ie()}async function ut(a){if(Ee(),Array.isArray(a)){for(let r of a)o().files.push(r);o(o())}else o().files.push(a),o(o());await oe(),e.onchange?.(o()),e.onupload?.(a)}function ct(a,r){Ee(),a.stopPropagation(),o().files.splice(r,1),o(o())}function Fe(){x.open_upload()}function _t(){e.onstop?.()}function ye(){t(X)&&(o().files.push(t(X)),o(o()),n(X,null),e.onchange?.(o()))}function ft(){ye(),G(null),e.onsubmit?.()}async function vt(a){if(!a.clipboardData)return;const r=a.clipboardData.items,i=a.clipboardData.getData("text");if(i&&i.length>ue()){a.preventDefault();const m=new window.File([i],"pasted_text.txt",{type:"text/plain",lastModified:Date.now()});x&&x.load_files([m]);return}for(let m in r){const T=r[m];if(T.kind==="file"&&T.type.includes("image")){const F=T.getAsFile();F&&x.load_files([F])}}}function gt(a){a.preventDefault(),v(!0)}function mt(a){a.preventDefault();const r=ce.getBoundingClientRect(),{clientX:i,clientY:m}=a;(i<=r.left||i>=r.right||m<=r.top||m>=r.bottom)&&v(!1)}function pt(a){if(a.preventDefault(),v(!1),a.dataTransfer&&a.dataTransfer.files){const r=Array.from(a.dataTransfer.files);if(t(pe)){const i=r.filter(T=>t(pe).some(F=>F.startsWith(".")?T.name.toLowerCase().endsWith(F.toLowerCase()):T.type.match(new RegExp(F.replace("*",".*"))))),m=r.length-i.length;m>0&&e.onerror?.(`${m} file(s) were rejected. Accepted formats: ${t(pe).join(", ")}`),i.length>0&&x.load_files(i)}else x.load_files(r)}}var ee=za();let He;var Pe=g(ee);$t(Pe,{get show_label(){return h()},get info(){return I()},get rtl(){return O()},children:(a,r)=>{Xt();var i=Me();B(()=>me(i,e.label)),p(a,i)},$$slots:{default:!0}});var Be=j(Pe,2),Ge=g(Be);{var ht=a=>{var r=ya();let i;var m=g(r);{var T=w=>{var b=wa(),y=g(b);{let re=L(()=>e.label||"Audio");ba(y,{get label(){return t(re)},get waveform_settings(){return e.waveform_settings},get recording(){return t(A)},get upload(){return e.upload},get root(){return e.root},get max_file_size(){return de()},onchange:V=>{n(X,V,!0)},onstoprecording:()=>{n(A,!1),e.onstop_recording?.()},onclear:()=>{G(null),n(A,!1),n(X,null),e.onclear?.()},get upload_promise(){return $()},set upload_promise(V){$(V)}})}f(b),p(w,b)},F=w=>{var b=xa(),y=g(b);{let Se=L(()=>e.label||"Audio");da(y,{get value(){return t(X)},get label(){return t(Se)},loop:!1})}var re=j(y,2),V=g(re);V.__click=()=>{ye(),G(null),n(A,!1)};var he=g(V);ta(he),f(V);var fe=j(V,2);fe.__click=()=>{G(null),n(A,!1),n(X,null)};var je=g(fe);Ze(je),f(fe),f(re),f(b),p(w,b)};C(m,w=>{t(X)?w(F,!1):w(T)})}f(r),B(()=>i=ne(r,1,"recording-overlay svelte-1jnnld0",null,i,{"has-audio":t(X)!==null})),p(a,r)};C(Ge,a=>{t(_e)&&t(_e).includes("microphone")&&G()==="microphone"&&a(ht)})}var Ue=j(Ge,2);{var bt=a=>{be(oa(a,{onload:ut,get file_count(){return E()},get filetype(){return t(pe)},get root(){return e.root},get max_file_size(){return de()},show_progress:!1,disable_click:!0,get onerror(){return e.onerror},hidden:!0,get upload(){return e.upload},get stream_handler(){return e.stream_handler},get upload_promise(){return $()},set upload_promise(r){$(r)},get dragging(){return v()},set dragging(r){v(r)},get uploading(){return t(z)},set uploading(r){n(z,r,!0)}}),r=>x=r,()=>x)};C(Ue,a=>{t(xe)&&a(bt)})}var ke=j(Ue,2);let We;var Ve=g(ke);{var wt=a=>{var r=Sa(),i=g(r);{var m=b=>{var y=ka();y.__click=Fe;var re=g(y);$e(re),f(y),B(()=>y.disabled=M()),p(b,y)};C(i,b=>{t(xe)&&b(m)})}var T=j(i,2);et(T,17,()=>o()?.files??[],tt,(b,y,re)=>{var V=Ca(),he=g(V),fe=g(he);{var je=le=>{ia(le,{get src(){return t(y).url},restProps:{title:null,alt:"",loading:"lazy",class:"thumbnail-image"}})},Se=le=>{var Ne=Qe(),Mt=we(Ne);{var At=ve=>{ra(ve)},Dt=ve=>{var Oe=Qe(),zt=we(Oe);{var Tt=ge=>{Jt(ge)},It=ge=>{aa(ge)};C(zt,ge=>{t(y).mime_type&&t(y).mime_type.includes("video")?ge(Tt):ge(It,!1)},!0)}p(ve,Oe)};C(Mt,ve=>{t(y).mime_type&&t(y).mime_type.includes("audio")?ve(At):ve(Dt,!1)},!0)}p(le,Ne)};C(fe,le=>{t(y).mime_type&&t(y).mime_type.includes("image")?le(je):le(Se,!1)})}var Re=j(fe,2);Re.__click=le=>ct(le,re);var Rt=g(Re);Ze(Rt),f(Re),f(he),f(V),p(b,V)});var F=j(T,2);{var w=b=>{var y=ja();p(b,y)};C(F,b=>{t(z)&&b(w)})}f(r),p(a,r)};C(Ve,a=>{((o()?.files?.length??0)>0||t(z))&&a(wt)})}var Le=j(Ve,2),Ye=g(Le);{var xt=a=>{var r=Ra();r.__click=Fe;var i=g(r);$e(i),f(r),B(()=>r.disabled=M()),p(a,r)};C(Ye,a=>{t(xe)&&(o()?.files?.length??0)===0&&!t(z)&&a(xt)})}var Ce=j(Ye,2),_=g(Ce);Nt(_);let qe;Ot(_,(a,r)=>fa?.(a,r),()=>({text:o().text,lines:H(),max_lines:e.max_lines})),Kt(()=>Qt(_,()=>o().text,a=>o(o().text=a,!0))),be(_,a=>s=a,()=>s);var yt=j(_,2);la(yt,{get visible(){return t(K)},position:"absolute"}),f(Ce);var Ke=j(Ce,2);{var kt=a=>{var r=Ma();let i;r.__click=async()=>{G()!=="microphone"?(G("microphone"),await oe(),n(A,!0)):(G(null),n(A,!1))};var m=g(r);Zt(m),f(r),B(()=>{i=ne(r,1,"microphone-button svelte-1jnnld0",null,i,{recording:t(A)}),r.disabled=M()}),p(a,r)};C(Ke,a=>{t(_e)&&t(_e).includes("microphone")&&a(kt)})}var Xe=j(Ke,2);{var Ct=a=>{var r=Aa();let i;r.__click=ft;var m=g(r);{var T=w=>{ea(w)},F=w=>{var b=Me();B(()=>me(b,k())),p(w,b)};C(m,w=>{k()===!0?w(T):w(F,!1)})}f(r),B(()=>{i=ne(r,1,"submit-button svelte-1jnnld0",null,i,{"padded-button":k()!==!0}),r.disabled=M()}),p(a,r)};C(Xe,a=>{k()&&a(Ct)})}var jt=j(Xe,2);{var St=a=>{var r=Da();let i;r.__click=_t;var m=g(r);{var T=w=>{lt(w,{fill:"none",stroke_width:2.5})},F=w=>{var b=Me();B(()=>me(b,Y())),p(w,b)};C(m,w=>{Y()===!0?w(T):w(F,!1)})}f(r),B(()=>i=ne(r,1,"stop-button svelte-1jnnld0",null,i,{"padded-button":Y()!==!0})),p(a,r)};C(jt,a=>{Y()&&a(St)})}f(Le),f(ke),f(Be),f(ee),be(ee,a=>ce=a,()=>ce),B(()=>{He=ne(ee,1,"full-container svelte-1jnnld0",null,He,{dragging:v()}),We=ne(ke,1,"input-wrapper svelte-1jnnld0",null,We,{"has-files":(o()?.files?.length??0)>0||t(z)}),N(_,"dir",O()?"rtl":"ltr"),N(_,"placeholder",l()),N(_,"rows",H()),_.disabled=M(),Pt(_,P()?"text-align: "+P():""),N(_,"autocapitalize",U()?.autocapitalize),N(_,"autocorrect",U()?.autocorrect),N(_,"spellcheck",U()?.spellcheck),N(_,"autocomplete",U()?.autocomplete),N(_,"tabindex",U()?.tabindex),N(_,"enterkeyhint",U()?.enterkeyhint),N(_,"lang",U()?.lang),qe=ne(_,1,"svelte-1jnnld0",null,qe,{"no-label":!h()}),_.dir=_.dir}),Z("dragenter",ee,gt),Z("dragleave",ee,mt),Z("dragover",ee,a=>a.preventDefault()),Z("drop",ee,pt),Z("keypress",_,st),Z("blur",_,()=>e.onblur?.()),Z("select",_,nt),Z("focus",_,()=>e.onfocus?.()),Z("scroll",_,dt),Z("paste",_,vt),p(c,ee),Te()}at(["click"]);var Ia=R(" ",1);function ur(c,e){ze(e,!0);let o=S(null);class D extends Bt{async get_data(){return t(o)&&(await t(o),await oe()),await super.get_data()}}let H=Gt(e,["$$slots","$$events","$$legacy"]);const l=new D(H);l.props.value=l.props.value??{text:"",files:[]};let M=S(!1),I=S(null),h="darkorange";const k={height:50,barWidth:2,barGap:3,cursorWidth:2,cursorColor:"#ddd5e9",autoplay:!1,barRadius:10,dragToSeek:!0,normalize:!0,minPxPerSec:20,waveColor:"",progressColor:"",mediaControls:!1,sampleRate:44100};rt(()=>{h=getComputedStyle(document?.documentElement).getPropertyValue("--color-accent"),O(),k.waveColor=l.props?.waveform_options?.waveform_color||"#9ca3af",k.progressColor=l.props?.waveform_options?.waveform_progress_color||h,k.mediaControls=l.props?.waveform_options?.show_controls,k.sampleRate=l.props?.waveform_options?.sample_rate||44100});const Y={color:l.props?.waveform_options?.trim_region_color};function O(){document.documentElement.style.setProperty("--trim-region-color",Y.color||h)}const te=(...E)=>l.shared.client.upload(...E),P=E=>l.i18n(E),Q=(...E)=>l.shared.client.stream(...E);let J=L(()=>l.props.sources.join(",")),de=L(()=>(l.props.file_types||[]).join(",")||null);{let E=L(()=>[...l.shared.elem_classes||[],"multimodal-textbox"]),ue=L(()=>t(M)?"focus":"base");ua(c,{get visible(){return l.shared.visible},get elem_id(){return l.shared.elem_id},get elem_classes(){return t(E)},get scale(){return l.shared.scale},get min_width(){return l.shared.min_width},allow_overflow:!1,padding:!1,get border_mode(){return t(ue)},get rtl(){return l.props.rtl},children:(ae,G)=>{var U=Ia(),$=we(U);{var v=s=>{ca(s,Ut({get autoscroll(){return l.shared.autoscroll},get i18n(){return l.i18n}},()=>l.shared.loading_status,{on_clear_status:()=>l.dispatch("clear_status",l.shared.loading_status)}))};C($,s=>{l.shared.loading_status&&s(v)})}var x=j($,2);{let s=L(()=>l.shared.label||"MultimodalTextbox"),W=L(()=>l.props.max_lines?l.props.max_lines:l.props.lines+1),q=L(()=>!l.shared.interactive);Ta(x,{value_is_output:!0,get file_types_string(){return t(de)},get root(){return l.shared.root},get label(){return t(s)},get info(){return l.props.info},get show_label(){return l.shared.show_label},get lines(){return l.props.lines},get rtl(){return l.props.rtl},get text_align(){return l.props.text_align},get waveform_settings(){return k},i18n:P,get max_lines(){return t(W)},get placeholder(){return l.props.placeholder},get submit_btn(){return l.props.submit_btn},get stop_btn(){return l.props.stop_btn},get autofocus(){return l.props.autofocus},get autoscroll(){return l.shared.autoscroll},get file_count(){return l.props.file_count},get sources_string(){return t(J)},get max_file_size(){return l.shared.max_file_size},onchange:d=>{l.props.value=d,l.dispatch("change",l.props.value)},oninput:()=>l.dispatch("input"),onsubmit:()=>l.dispatch("submit"),onstop:()=>l.dispatch("stop"),onblur:()=>l.dispatch("blur"),onselect:d=>l.dispatch("select",d),onfocus:()=>l.dispatch("focus"),onerror:d=>{l.dispatch("error",d)},onstop_recording:()=>l.dispatch("stop_recording"),onupload:d=>l.dispatch("upload",d),onclear:()=>l.dispatch("clear"),get disabled(){return t(q)},upload:te,stream_handler:Q,get max_plain_text_length(){return l.props.max_plain_text_length},get html_attributes(){return l.props.html_attributes},get upload_promise(){return t(o)},set upload_promise(d){n(o,d,!0)},get value(){return l.props.value},set value(d){l.props.value=d},get dragging(){return t(M)},set dragging(d){n(M,d,!0)},get active_source(){return t(I)},set active_source(d){n(I,d,!0)}})}p(ae,U)},$$slots:{default:!0}})}Te()}export{fr as BaseExample,Ta as BaseMultimodalTextbox,ur as default}; diff --git a/assets/Index-BzE3i7lA.js b/assets/Index-B7BcARTS.js similarity index 90% rename from assets/Index-BzE3i7lA.js rename to assets/Index-B7BcARTS.js index 8649579fdf4070897160adb47950154fd0995b1c..8fd01c171558f24cd6f8e04cb9017bafc5ec46c3 100644 --- a/assets/Index-BzE3i7lA.js +++ b/assets/Index-B7BcARTS.js @@ -1 +1 @@ -import{p as n,e as Ye,i as z,d as ze,s as Ze,b as Ue,f as Ae,G as He,r as Je,g as De}from"./i18n-CPHyzK9b.js";import{M as Te,a1 as Ke,Y as fe,x as f,Z as r,_ as Ve,N as k,a3 as N,a as w,t as Fe,U as Ie,O as We,a0 as ge,G as ce,P as o,ad as $,S as J,Q as xe,v as q,R as _e,$ as _,T as ke,at as Xe,ac as $e,aa as Pe,a2 as B}from"./index-DydPgVMC.js";import{g as et,I as tt}from"./ImagePreview-C41duyJ0.js";import{b as Be}from"./misc-Dkc5KZ-v.js";import{I as rt,S as at}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as st}from"./BlockLabel-BzVeVrtL.js";import{C as lt}from"./Clear-BR8cTgGu.js";import{I as Re}from"./Image-DBmW1mOo.js";import{I as nt}from"./IconButtonWrapper-PnNNNvqI.js";import{F as ot}from"./FullscreenButton-BuyUU5Yj.js";import{W as it}from"./Webcam-B-wg5Ly_.js";import{U as ut,a as dt}from"./Upload-Bq9KuxCu.js";import{I as gt}from"./Image-CZ1Hb99p.js";/* empty css */import{B as Ce}from"./Block-WPcVj6Bq.js";import{E as ct}from"./Empty-B15ItVsj.js";import{U as Ee}from"./UploadText-CYQRFBCv.js";import{S as Ge}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{default as rr}from"./Example-oI9QHs-R.js";import"./DownloadLink-DM2QmhDx.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";/* empty css */import"./snippet-BtHMuX3s.js";import"./Maximize-DWbY8BRa.js";import"./actions-4RaHFoGI.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";/* empty css */import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";/* empty css */var _t=_e(" ",1),mt=_e("
        "),pt=_e('
        ',1);function ft(ve,a){Te(a,!1);const W=ge();let l=n(a,"value",12,null),ee=n(a,"label",12,void 0),te=n(a,"show_label",12),e=n(a,"sources",28,()=>["upload","clipboard","webcam"]),i=n(a,"streaming",12,!1),v=n(a,"pending",12,!1),y=n(a,"webcam_options",12),R=n(a,"selectable",12,!1),D=n(a,"root",12),O=n(a,"i18n",12),Q=n(a,"max_file_size",12,null),Y=n(a,"upload",12),K=n(a,"stream_handler",12),V=n(a,"stream_every",12),re=n(a,"time_limit",12),ae=n(a,"show_fullscreen_button",12,!0),se=n(a,"stream_state",12,"closed"),m=n(a,"upload_promise",12,null),u=n(a,"onerror",12,void 0),F=ge(),I=n(a,"uploading",12,!1),g=n(a,"active_source",12,null),L=n(a,"fullscreen",12,!1),M=ge([]),j=ge();async function h(t){if(!i()){if(t.path?.toLowerCase().endsWith(".svg")&&t.url){const p=await(await fetch(t.url)).text();l({...t,url:`data:image/svg+xml,${encodeURIComponent(p)}`})}else l(t);await ce(),S("upload")}}function le(){l(null),S("clear"),S("change",null)}function Z(t){le(),t.stopPropagation()}async function ne(t,c){if(c==="stream"){S("stream",{value:{url:t},is_value_data:!0});return}_(j,Math.random().toString(36).substring(2,15));const p=new File([t],`image.${i()?"jpeg":"png"}`);_(M,[new Xe({path:p.name,orig_name:p.name,blob:p,size:p.size,mime_type:p.type,is_stream:!1})]),v(!0);const A=await r(F).load_files([p],r(j));(c==="change"||c==="upload")&&(l(A?.[0]||null),await ce(),S("change")),v(!1)}const S=Ke();let U=n(a,"dragging",12,!1);function s(t){let c=et(t);c&&S("select",{index:c,value:null})}async function Se(t){t==="clipboard"&&r(F).paste_clipboard()}let oe=ge();function he(t){t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"),U(!0)}async function be(t){t.preventDefault(),t.stopPropagation(),U(!1),l()&&(le(),await ce()),g("upload"),await ce(),r(F).load_files_from_drop(t)}fe(()=>(f(g()),f(e())),()=>{!g()&&e()&&g(e()[0])}),fe(()=>(f(i()),f(g())),()=>{_(W,i()&&g()==="webcam")}),fe(()=>(f(I()),r(W)),()=>{I()&&!r(W)&&l(null)}),fe(()=>f(U()),()=>{S("drag",U())}),Ve();var we={get value(){return l()},set value(t){l(t),o()},get label(){return ee()},set label(t){ee(t),o()},get show_label(){return te()},set show_label(t){te(t),o()},get sources(){return e()},set sources(t){e(t),o()},get streaming(){return i()},set streaming(t){i(t),o()},get pending(){return v()},set pending(t){v(t),o()},get webcam_options(){return y()},set webcam_options(t){y(t),o()},get selectable(){return R()},set selectable(t){R(t),o()},get root(){return D()},set root(t){D(t),o()},get i18n(){return O()},set i18n(t){O(t),o()},get max_file_size(){return Q()},set max_file_size(t){Q(t),o()},get upload(){return Y()},set upload(t){Y(t),o()},get stream_handler(){return K()},set stream_handler(t){K(t),o()},get stream_every(){return V()},set stream_every(t){V(t),o()},get time_limit(){return re()},set time_limit(t){re(t),o()},get show_fullscreen_button(){return ae()},set show_fullscreen_button(t){ae(t),o()},get stream_state(){return se()},set stream_state(t){se(t),o()},get upload_promise(){return m()},set upload_promise(t){m(t),o()},get onerror(){return u()},set onerror(t){u(t),o()},get uploading(){return I()},set uploading(t){I(t),o()},get active_source(){return g()},set active_source(t){g(t),o()},get fullscreen(){return L()},set fullscreen(t){L(t),o()},get dragging(){return U()},set dragging(t){U(t),o()}};Ye();var C=pt(),ie=k(C);{let t=$(()=>ee()||"Image");st(ie,{get show_label(){return te()},get Icon(){return Re},get label(){return r(t)}})}var ue=J(ie,2),me=xe(ue);nt(me,{children:(t,c)=>{var p=N(),A=k(p);{var b=P=>{var d=_t(),X=k(d);{var de=x=>{ot(x,{get fullscreen(){return L()},onclick:H=>{L(H),S("fullscreen",H)}})};z(X,x=>{ae()&&x(de)})}var T=J(X,2);rt(T,{get Icon(){return lt},label:"Remove Image",onclick:Z}),w(P,d)};z(A,P=>{f(l()),r(W),q(()=>l()?.url&&!r(W))&&P(b)})}w(t,p)},$$slots:{default:!0}});var E=J(me,2);let G,pe;var ye=xe(E);{let t=$(()=>l()!==null||g()==="webcam"),c=$(()=>g()==="clipboard"?"clipboard":"image/*"),p=$(()=>(f(e()),f(l()),q(()=>!e().includes("upload")||l()!==null))),A=$(()=>(f(O()),q(()=>O()("image.drop_to_upload"))));ze(ut(ye,{get hidden(){return r(t)},get filetype(){return r(c)},onload:h,get onerror(){return u()},get root(){return D()},get max_file_size(){return Q()},get disable_click(){return r(p)},get upload(){return Y()},get stream_handler(){return K()},get aria_label(){return r(A)},get upload_promise(){return m()},set upload_promise(b){m(b)},get uploading(){return I()},set uploading(b){I(b)},get dragging(){return U()},set dragging(b){U(b)},children:(b,P)=>{var d=N(),X=k(d);{var de=T=>{var x=N(),H=k(x);Ze(H,a,"default",{}),w(T,x)};z(X,T=>{l()===null&&T(de)})}w(b,d)},$$slots:{default:!0},$$legacy:!0}),b=>_(F,b),()=>r(F))}var Le=J(ye,2);{var Me=t=>{dt(t,{get root(){return D()},get upload_id(){return r(j)},get stream_handler(){return K()},get files(){return r(M)}})},je=t=>{var c=N(),p=k(c);{var A=P=>{it(P,{get root(){return D()},get value(){return l()},get stream_state(){return se()},get mirror_webcam(){return f(y()),q(()=>y().mirror)},get stream_every(){return V()},get streaming(){return i()},mode:"image",include_audio:!1,get i18n(){return O()},get upload(){return Y()},get time_limit(){return re()},get webcam_constraints(){return f(y()),q(()=>y().constraints)},$$events:{capture:d=>ne(d.detail,"change"),stream:d=>ne(d.detail,"stream"),error(d){Be.call(this,a,d)},drag(d){Be.call(this,a,d)},upload:d=>ne(d.detail,"upload"),close_stream(d){Be.call(this,a,d)}}})},b=P=>{var d=N(),X=k(d);{var de=T=>{var x=mt();let H;var Oe=xe(x);{let Qe=$(()=>(f(l()),q(()=>({alt:l().alt_text}))));gt(Oe,{get src(){return f(l()),q(()=>l().url)},get restProps(){return r(Qe)}})}ke(x),Fe(()=>H=Ue(x,1,"image-frame svelte-1wk35uo",null,H,{selectable:R()})),Ie("click",x,s),w(T,x)};z(X,T=>{l()!==null&&!i()&&T(de)},!0)}w(P,d)};z(p,P=>{g()==="webcam"&&(i()||!i()&&!l())?P(A):P(b,!1)},!0)}w(t,c)};z(Le,t=>{g()==="webcam"&&!i()&&v()?t(Me):t(je,!1)})}ke(E);var qe=J(E,2);{var Ne=t=>{at(t,{get sources(){return e()},handle_clear:le,handle_select:c=>Se(c),get active_source(){return g()},set active_source(c){g(c)},$$legacy:!0})};z(qe,t=>{f(e()),q(()=>e().length>1||e().includes("clipboard"))&&t(Ne)})}return ke(ue),ze(ue,t=>_(oe,t),()=>r(oe)),Fe(()=>{G=Ue(E,1,"upload-container svelte-1wk35uo",null,G,{"reduced-height":e().length>1}),pe=Ae(E,"",pe,{width:l()?"auto":"100%"})}),Ie("dragover",E,he),Ie("drop",E,be),w(ve,C),We(we)}var vt=_e(" ",1),ht=_e(" ",1);function $t(ve,a){Te(a,!0);let W={value:null},l=Pe(void 0);class ee extends He{async get_data(){r(l)&&(await r(l),await ce());const u=await super.get_data();return a.props.streaming&&(u.value=W.value),u}}const te=Je(a,["$$slots","$$events","$$legacy"]),e=new ee(te);let i=Pe(!1),v=Pe(!1),y=B(()=>e.props.sources?e.props.sources[0]:null),R;const D=m=>{const u=m;u.preventDefault(),u.stopPropagation(),u.type==="dragenter"||u.type==="dragover"?_(v,!0):u.type==="dragleave"&&_(v,!1)},O=m=>{if(e.shared.interactive){const u=m;u.preventDefault(),u.stopPropagation(),_(v,!1),R&&R.loadFilesFromDrop(u)}};let Q=e.props.value,Y=!1;$e(()=>{if(!Y){Q=e.props.value,Y=!0;return}Q!==e.props.value&&(Q=e.props.value,e.dispatch("change"))});let K=B(()=>e?.shared?.loading_status.stream_state);var V=N(),re=k(V);{var ae=m=>{{let u=B(()=>r(v)?"focus":"base"),F=B(()=>e.props.height||void 0);Ce(m,{get visible(){return e.shared.visible},variant:"solid",get border_mode(){return r(u)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return r(F)},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return r(i)},set fullscreen(I){_(i,I,!0)},children:(I,g)=>{var L=vt(),M=k(L);Ge(M,De({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var j=J(M,2);tt(j,{get fullscreen(){return r(i)},get value(){return e.props.value},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get selectable(){return e.props._selectable},get i18n(){return e.i18n},get buttons(){return e.props.buttons},on_custom_button_click:h=>{e.dispatch("custom_button_click",{id:h})},$$events:{select:({detail:h})=>e.dispatch("select",h),share:({detail:h})=>e.dispatch("share",h),error:({detail:h})=>e.dispatch("error",h),fullscreen:({detail:h})=>{_(i,h,!0)}}}),w(I,L)},$$slots:{default:!0}})}},se=m=>{{let u=B(()=>e.props.value===null?"dashed":"solid"),F=B(()=>r(v)?"focus":"base"),I=B(()=>e.props.height||void 0);Ce(m,{get visible(){return e.shared.visible},get variant(){return r(u)},get border_mode(){return r(F)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return r(I)},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return r(i)},set fullscreen(g){_(i,g,!0)},$$events:{dragenter:D,dragleave:D,dragover:D,drop:O},children:(g,L)=>{var M=ht(),j=k(M);{var h=Z=>{Ge(Z,De({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))};z(j,Z=>{(e.shared.loading_status.type==="output"||e.shared.loading_status.validation_error)&&Z(h)})}var le=J(j,2);{let Z=B(()=>e.props.buttons===null?!0:e.props.buttons.some(s=>typeof s=="string"&&s==="fullscreen")),ne=B(()=>e.shared.loading_status?.status==="pending"||e.shared.loading_status?.status==="streaming"),S=B(()=>e.shared.loading_status?.time_limit),U=B(()=>e.shared.client?.stream);ze(ft(le,{get selectable(){return e.props._selectable},get root(){return e.shared.root},get sources(){return e.props.sources},get fullscreen(){return r(i)},get show_fullscreen_button(){return r(Z)},onerror:s=>{e.shared.loading_status.status="error",e.dispatch("error",s)},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get pending(){return r(ne)},get streaming(){return e.props.streaming},get webcam_options(){return e.props.webcam_options},get stream_every(){return e.props.stream_every},get time_limit(){return r(S)},get max_file_size(){return e.shared.max_file_size},get i18n(){return e.i18n},upload:(...s)=>e.shared.client.upload(...s),get stream_handler(){return r(U)},get stream_state(){return r(K)},get upload_promise(){return r(l)},set upload_promise(s){_(l,s,!0)},get active_source(){return r(y)},set active_source(s){_(y,s)},get value(){return e.props.value},set value(s){e.props.value=s},get dragging(){return r(v)},set dragging(s){_(v,s,!0)},$$events:{edit:()=>e.dispatch("edit"),clear:()=>{_(i,!1),e.dispatch("clear"),e.dispatch("input")},stream:({detail:s})=>{W=s,e.dispatch("stream",s)},drag:({detail:s})=>_(v,s,!0),upload:()=>{e.dispatch("upload"),e.dispatch("input")},select:({detail:s})=>e.dispatch("select",s),share:({detail:s})=>e.dispatch("share",s),close_stream:()=>{e.dispatch("close_stream")},fullscreen:({detail:s})=>{_(i,s,!0)}},children:(s,Se)=>{var oe=N(),he=k(oe);{var be=C=>{Ee(C,{get i18n(){return e.i18n},type:"image",get placeholder(){return e.props.placeholder}})},we=C=>{var ie=N(),ue=k(ie);{var me=G=>{Ee(G,{get i18n(){return e.i18n},type:"clipboard",mode:"short"})},E=G=>{ct(G,{unpadded_box:!0,size:"large",children:(pe,ye)=>{Re(pe)},$$slots:{default:!0}})};z(ue,G=>{r(y)==="clipboard"?G(me):G(E,!1)},!0)}w(C,ie)};z(he,C=>{r(y)==="upload"||!r(y)?C(be):C(we,!1)})}w(s,oe)},$$slots:{default:!0}}),s=>R=s,()=>R)}w(g,M)},$$slots:{default:!0}})}};z(re,m=>{e.shared.interactive?m(se,!1):m(ae)})}w(ve,V),We()}export{rr as BaseExample,gt as BaseImage,ft as BaseImageUploader,tt as BaseStaticImage,it as Webcam,$t as default}; +import{p as n,e as Ye,i as z,d as ze,s as Ze,b as Ue,f as Ae,G as He,r as Je,g as De}from"./i18n-DtG3MAQ1.js";import{M as Te,a1 as Ke,Y as fe,x as f,Z as r,_ as Ve,N as k,a3 as N,a as w,t as Fe,U as Ie,O as We,a0 as ge,G as ce,P as o,ad as $,S as J,Q as xe,v as q,R as _e,$ as _,T as ke,at as Xe,ac as $e,aa as Pe,a2 as B}from"./index-BeNBoC9J.js";import{g as et,I as tt}from"./ImagePreview-Dr2yPezw.js";import{b as Be}from"./misc-D-Y84gKJ.js";import{I as rt,S as at}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as st}from"./BlockLabel-CEOjqpu7.js";import{C as lt}from"./Clear-BiKSVifk.js";import{I as Re}from"./Image-DWBzZYev.js";import{I as nt}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as ot}from"./FullscreenButton-CFl3IB4T.js";import{W as it}from"./Webcam-rfzmXTkZ.js";import{U as ut,a as dt}from"./Upload-CGTpHDBO.js";import{I as gt}from"./Image-ALBOEs1f.js";/* empty css */import{B as Ce}from"./Block-DkzyQHli.js";import{E as ct}from"./Empty-Clj0ErcW.js";import{U as Ee}from"./UploadText-yqnlGa4o.js";import{S as Ge}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as rr}from"./Example-CpSLgFlm.js";import"./DownloadLink-Dk6GrGSA.js";import"./ShareButton-ImGYvlzQ.js";import"./Download-0gCL6VXM.js";/* empty css */import"./snippet-BRIBYCwB.js";import"./Maximize-DQMU3SdR.js";import"./actions-BbCJS635.js";import"./DropdownArrow-C0w6FgSo.js";import"./Square-CSlbzSkn.js";import"./Spinner-Hiq4LkuG.js";import"./StreamingBar-BFOdhKj-.js";/* empty css */import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";/* empty css */var _t=_e(" ",1),mt=_e("
        "),pt=_e('
        ',1);function ft(ve,a){Te(a,!1);const W=ge();let l=n(a,"value",12,null),ee=n(a,"label",12,void 0),te=n(a,"show_label",12),e=n(a,"sources",28,()=>["upload","clipboard","webcam"]),i=n(a,"streaming",12,!1),v=n(a,"pending",12,!1),y=n(a,"webcam_options",12),R=n(a,"selectable",12,!1),D=n(a,"root",12),O=n(a,"i18n",12),Q=n(a,"max_file_size",12,null),Y=n(a,"upload",12),K=n(a,"stream_handler",12),V=n(a,"stream_every",12),re=n(a,"time_limit",12),ae=n(a,"show_fullscreen_button",12,!0),se=n(a,"stream_state",12,"closed"),m=n(a,"upload_promise",12,null),u=n(a,"onerror",12,void 0),F=ge(),I=n(a,"uploading",12,!1),g=n(a,"active_source",12,null),L=n(a,"fullscreen",12,!1),M=ge([]),j=ge();async function h(t){if(!i()){if(t.path?.toLowerCase().endsWith(".svg")&&t.url){const p=await(await fetch(t.url)).text();l({...t,url:`data:image/svg+xml,${encodeURIComponent(p)}`})}else l(t);await ce(),S("upload")}}function le(){l(null),S("clear"),S("change",null)}function Z(t){le(),t.stopPropagation()}async function ne(t,c){if(c==="stream"){S("stream",{value:{url:t},is_value_data:!0});return}_(j,Math.random().toString(36).substring(2,15));const p=new File([t],`image.${i()?"jpeg":"png"}`);_(M,[new Xe({path:p.name,orig_name:p.name,blob:p,size:p.size,mime_type:p.type,is_stream:!1})]),v(!0);const A=await r(F).load_files([p],r(j));(c==="change"||c==="upload")&&(l(A?.[0]||null),await ce(),S("change")),v(!1)}const S=Ke();let U=n(a,"dragging",12,!1);function s(t){let c=et(t);c&&S("select",{index:c,value:null})}async function Se(t){t==="clipboard"&&r(F).paste_clipboard()}let oe=ge();function he(t){t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"),U(!0)}async function be(t){t.preventDefault(),t.stopPropagation(),U(!1),l()&&(le(),await ce()),g("upload"),await ce(),r(F).load_files_from_drop(t)}fe(()=>(f(g()),f(e())),()=>{!g()&&e()&&g(e()[0])}),fe(()=>(f(i()),f(g())),()=>{_(W,i()&&g()==="webcam")}),fe(()=>(f(I()),r(W)),()=>{I()&&!r(W)&&l(null)}),fe(()=>f(U()),()=>{S("drag",U())}),Ve();var we={get value(){return l()},set value(t){l(t),o()},get label(){return ee()},set label(t){ee(t),o()},get show_label(){return te()},set show_label(t){te(t),o()},get sources(){return e()},set sources(t){e(t),o()},get streaming(){return i()},set streaming(t){i(t),o()},get pending(){return v()},set pending(t){v(t),o()},get webcam_options(){return y()},set webcam_options(t){y(t),o()},get selectable(){return R()},set selectable(t){R(t),o()},get root(){return D()},set root(t){D(t),o()},get i18n(){return O()},set i18n(t){O(t),o()},get max_file_size(){return Q()},set max_file_size(t){Q(t),o()},get upload(){return Y()},set upload(t){Y(t),o()},get stream_handler(){return K()},set stream_handler(t){K(t),o()},get stream_every(){return V()},set stream_every(t){V(t),o()},get time_limit(){return re()},set time_limit(t){re(t),o()},get show_fullscreen_button(){return ae()},set show_fullscreen_button(t){ae(t),o()},get stream_state(){return se()},set stream_state(t){se(t),o()},get upload_promise(){return m()},set upload_promise(t){m(t),o()},get onerror(){return u()},set onerror(t){u(t),o()},get uploading(){return I()},set uploading(t){I(t),o()},get active_source(){return g()},set active_source(t){g(t),o()},get fullscreen(){return L()},set fullscreen(t){L(t),o()},get dragging(){return U()},set dragging(t){U(t),o()}};Ye();var C=pt(),ie=k(C);{let t=$(()=>ee()||"Image");st(ie,{get show_label(){return te()},get Icon(){return Re},get label(){return r(t)}})}var ue=J(ie,2),me=xe(ue);nt(me,{children:(t,c)=>{var p=N(),A=k(p);{var b=P=>{var d=_t(),X=k(d);{var de=x=>{ot(x,{get fullscreen(){return L()},onclick:H=>{L(H),S("fullscreen",H)}})};z(X,x=>{ae()&&x(de)})}var T=J(X,2);rt(T,{get Icon(){return lt},label:"Remove Image",onclick:Z}),w(P,d)};z(A,P=>{f(l()),r(W),q(()=>l()?.url&&!r(W))&&P(b)})}w(t,p)},$$slots:{default:!0}});var E=J(me,2);let G,pe;var ye=xe(E);{let t=$(()=>l()!==null||g()==="webcam"),c=$(()=>g()==="clipboard"?"clipboard":"image/*"),p=$(()=>(f(e()),f(l()),q(()=>!e().includes("upload")||l()!==null))),A=$(()=>(f(O()),q(()=>O()("image.drop_to_upload"))));ze(ut(ye,{get hidden(){return r(t)},get filetype(){return r(c)},onload:h,get onerror(){return u()},get root(){return D()},get max_file_size(){return Q()},get disable_click(){return r(p)},get upload(){return Y()},get stream_handler(){return K()},get aria_label(){return r(A)},get upload_promise(){return m()},set upload_promise(b){m(b)},get uploading(){return I()},set uploading(b){I(b)},get dragging(){return U()},set dragging(b){U(b)},children:(b,P)=>{var d=N(),X=k(d);{var de=T=>{var x=N(),H=k(x);Ze(H,a,"default",{}),w(T,x)};z(X,T=>{l()===null&&T(de)})}w(b,d)},$$slots:{default:!0},$$legacy:!0}),b=>_(F,b),()=>r(F))}var Le=J(ye,2);{var Me=t=>{dt(t,{get root(){return D()},get upload_id(){return r(j)},get stream_handler(){return K()},get files(){return r(M)}})},je=t=>{var c=N(),p=k(c);{var A=P=>{it(P,{get root(){return D()},get value(){return l()},get stream_state(){return se()},get mirror_webcam(){return f(y()),q(()=>y().mirror)},get stream_every(){return V()},get streaming(){return i()},mode:"image",include_audio:!1,get i18n(){return O()},get upload(){return Y()},get time_limit(){return re()},get webcam_constraints(){return f(y()),q(()=>y().constraints)},$$events:{capture:d=>ne(d.detail,"change"),stream:d=>ne(d.detail,"stream"),error(d){Be.call(this,a,d)},drag(d){Be.call(this,a,d)},upload:d=>ne(d.detail,"upload"),close_stream(d){Be.call(this,a,d)}}})},b=P=>{var d=N(),X=k(d);{var de=T=>{var x=mt();let H;var Oe=xe(x);{let Qe=$(()=>(f(l()),q(()=>({alt:l().alt_text}))));gt(Oe,{get src(){return f(l()),q(()=>l().url)},get restProps(){return r(Qe)}})}ke(x),Fe(()=>H=Ue(x,1,"image-frame svelte-1wk35uo",null,H,{selectable:R()})),Ie("click",x,s),w(T,x)};z(X,T=>{l()!==null&&!i()&&T(de)},!0)}w(P,d)};z(p,P=>{g()==="webcam"&&(i()||!i()&&!l())?P(A):P(b,!1)},!0)}w(t,c)};z(Le,t=>{g()==="webcam"&&!i()&&v()?t(Me):t(je,!1)})}ke(E);var qe=J(E,2);{var Ne=t=>{at(t,{get sources(){return e()},handle_clear:le,handle_select:c=>Se(c),get active_source(){return g()},set active_source(c){g(c)},$$legacy:!0})};z(qe,t=>{f(e()),q(()=>e().length>1||e().includes("clipboard"))&&t(Ne)})}return ke(ue),ze(ue,t=>_(oe,t),()=>r(oe)),Fe(()=>{G=Ue(E,1,"upload-container svelte-1wk35uo",null,G,{"reduced-height":e().length>1}),pe=Ae(E,"",pe,{width:l()?"auto":"100%"})}),Ie("dragover",E,he),Ie("drop",E,be),w(ve,C),We(we)}var vt=_e(" ",1),ht=_e(" ",1);function $t(ve,a){Te(a,!0);let W={value:null},l=Pe(void 0);class ee extends He{async get_data(){r(l)&&(await r(l),await ce());const u=await super.get_data();return a.props.streaming&&(u.value=W.value),u}}const te=Je(a,["$$slots","$$events","$$legacy"]),e=new ee(te);let i=Pe(!1),v=Pe(!1),y=B(()=>e.props.sources?e.props.sources[0]:null),R;const D=m=>{const u=m;u.preventDefault(),u.stopPropagation(),u.type==="dragenter"||u.type==="dragover"?_(v,!0):u.type==="dragleave"&&_(v,!1)},O=m=>{if(e.shared.interactive){const u=m;u.preventDefault(),u.stopPropagation(),_(v,!1),R&&R.loadFilesFromDrop(u)}};let Q=e.props.value,Y=!1;$e(()=>{if(!Y){Q=e.props.value,Y=!0;return}Q!==e.props.value&&(Q=e.props.value,e.dispatch("change"))});let K=B(()=>e?.shared?.loading_status.stream_state);var V=N(),re=k(V);{var ae=m=>{{let u=B(()=>r(v)?"focus":"base"),F=B(()=>e.props.height||void 0);Ce(m,{get visible(){return e.shared.visible},variant:"solid",get border_mode(){return r(u)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return r(F)},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return r(i)},set fullscreen(I){_(i,I,!0)},children:(I,g)=>{var L=vt(),M=k(L);Ge(M,De({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var j=J(M,2);tt(j,{get fullscreen(){return r(i)},get value(){return e.props.value},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get selectable(){return e.props._selectable},get i18n(){return e.i18n},get buttons(){return e.props.buttons},on_custom_button_click:h=>{e.dispatch("custom_button_click",{id:h})},$$events:{select:({detail:h})=>e.dispatch("select",h),share:({detail:h})=>e.dispatch("share",h),error:({detail:h})=>e.dispatch("error",h),fullscreen:({detail:h})=>{_(i,h,!0)}}}),w(I,L)},$$slots:{default:!0}})}},se=m=>{{let u=B(()=>e.props.value===null?"dashed":"solid"),F=B(()=>r(v)?"focus":"base"),I=B(()=>e.props.height||void 0);Ce(m,{get visible(){return e.shared.visible},get variant(){return r(u)},get border_mode(){return r(F)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return r(I)},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return r(i)},set fullscreen(g){_(i,g,!0)},$$events:{dragenter:D,dragleave:D,dragover:D,drop:O},children:(g,L)=>{var M=ht(),j=k(M);{var h=Z=>{Ge(Z,De({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))};z(j,Z=>{(e.shared.loading_status.type==="output"||e.shared.loading_status.validation_error)&&Z(h)})}var le=J(j,2);{let Z=B(()=>e.props.buttons===null?!0:e.props.buttons.some(s=>typeof s=="string"&&s==="fullscreen")),ne=B(()=>e.shared.loading_status?.status==="pending"||e.shared.loading_status?.status==="streaming"),S=B(()=>e.shared.loading_status?.time_limit),U=B(()=>e.shared.client?.stream);ze(ft(le,{get selectable(){return e.props._selectable},get root(){return e.shared.root},get sources(){return e.props.sources},get fullscreen(){return r(i)},get show_fullscreen_button(){return r(Z)},onerror:s=>{e.shared.loading_status.status="error",e.dispatch("error",s)},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get pending(){return r(ne)},get streaming(){return e.props.streaming},get webcam_options(){return e.props.webcam_options},get stream_every(){return e.props.stream_every},get time_limit(){return r(S)},get max_file_size(){return e.shared.max_file_size},get i18n(){return e.i18n},upload:(...s)=>e.shared.client.upload(...s),get stream_handler(){return r(U)},get stream_state(){return r(K)},get upload_promise(){return r(l)},set upload_promise(s){_(l,s,!0)},get active_source(){return r(y)},set active_source(s){_(y,s)},get value(){return e.props.value},set value(s){e.props.value=s},get dragging(){return r(v)},set dragging(s){_(v,s,!0)},$$events:{edit:()=>e.dispatch("edit"),clear:()=>{_(i,!1),e.dispatch("clear"),e.dispatch("input")},stream:({detail:s})=>{W=s,e.dispatch("stream",s)},drag:({detail:s})=>_(v,s,!0),upload:()=>{e.dispatch("upload"),e.dispatch("input")},select:({detail:s})=>e.dispatch("select",s),share:({detail:s})=>e.dispatch("share",s),close_stream:()=>{e.dispatch("close_stream")},fullscreen:({detail:s})=>{_(i,s,!0)}},children:(s,Se)=>{var oe=N(),he=k(oe);{var be=C=>{Ee(C,{get i18n(){return e.i18n},type:"image",get placeholder(){return e.props.placeholder}})},we=C=>{var ie=N(),ue=k(ie);{var me=G=>{Ee(G,{get i18n(){return e.i18n},type:"clipboard",mode:"short"})},E=G=>{ct(G,{unpadded_box:!0,size:"large",children:(pe,ye)=>{Re(pe)},$$slots:{default:!0}})};z(ue,G=>{r(y)==="clipboard"?G(me):G(E,!1)},!0)}w(C,ie)};z(he,C=>{r(y)==="upload"||!r(y)?C(be):C(we,!1)})}w(s,oe)},$$slots:{default:!0}}),s=>R=s,()=>R)}w(g,M)},$$slots:{default:!0}})}};z(re,m=>{e.shared.interactive?m(se,!1):m(ae)})}w(ve,V),We()}export{rr as BaseExample,gt as BaseImage,ft as BaseImageUploader,tt as BaseStaticImage,it as Webcam,$t as default}; diff --git a/assets/Index-bS4AvZnj.js b/assets/Index-BG3hwyhV.js similarity index 82% rename from assets/Index-bS4AvZnj.js rename to assets/Index-BG3hwyhV.js index dbf7c7208610b53a406d48ce3f99619d3a3249f8..b2e66560345eae27afaca31be64bc3be94947706 100644 --- a/assets/Index-bS4AvZnj.js +++ b/assets/Index-BG3hwyhV.js @@ -1 +1 @@ -import{p as d,s as C,d as O,b as W,a as Z,f as q,G as A,g as D,i as F,r as H}from"./i18n-CPHyzK9b.js";import{ah as J,M as z,a7 as K,$ as c,Z as a,ac as U,Q as k,S as G,T as B,t as V,a as M,O as Q,aa as g,a2 as P,R as T,N as R,a3 as X}from"./index-DydPgVMC.js";import{S as Y}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as $}from"./Index.svelte_svelte_type_style_lang-glBt5fcY.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var ee=T('
        ');function te(w,t){z(t,!0);let m=d(t,"open",15,!0),e=d(t,"position",11,"left"),v=d(t,"elem_classes",19,()=>[]),_=d(t,"elem_id",3,""),b=d(t,"onexpand",3,()=>{}),x=d(t,"oncollapse",3,()=>{}),n=g(!1),s=g(!1),r,f=g(0),y=P(()=>typeof t.width=="number"?`${t.width}px`:t.width),i=g(!1);function p(){if(!r.closest(".wrap"))return;const l=r.closest(".wrap")?.getBoundingClientRect();if(!l)return;const u=r.getBoundingClientRect(),h=e()==="left"?l.left:window.innerWidth-l.right;c(f,Math.max(0,u.width-h+30),!0)}K(()=>{r.closest(".wrap")?.classList.add("sidebar-parent"),p(),window.addEventListener("resize",p),document.documentElement.style.setProperty("--overlap-amount",`${a(f)}px`),c(n,!0);const u=window.matchMedia("(prefers-reduced-motion: reduce)");c(i,u.matches,!0);const h=N=>{c(i,N.matches,!0)};return u.addEventListener("change",h),()=>{window.removeEventListener("resize",p),u.removeEventListener("change",h)}}),U(()=>{a(n)&&c(s,m(),!0)});let j=P(()=>v()?.join(" ")||"");var o=ee();let E;var L=k(o);L.__click=()=>{c(s,!a(s)),m(a(s)),a(s)?b()?.():x()?.()};var S=G(L,2),I=k(S);C(I,t,"default",{}),B(S),B(o),O(o,l=>r=l,()=>r),V(()=>{E=W(o,1,`sidebar ${a(j)??""}`,"svelte-msxaew",E,{open:a(s),right:e()==="right","reduce-motion":a(i)}),Z(o,"id",_()),q(o,`width: ${a(y)??""}; ${e()??""}: calc(${a(y)??""} * -1)`)}),M(w,o),Q()}J(["click"]);var se=T(" ",1);function me(w,t){z(t,!0);const m=H(t,["$$slots","$$events","$$legacy"]),e=new A(m);var v=se(),_=R(v);Y(_,D({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status));var b=G(_,2);{var x=n=>{te(n,{get width(){return e.props.width},onexpand:()=>e.dispatch("expand"),oncollapse:()=>e.dispatch("collapse"),get elem_classes(){return e.shared.elem_classes},get elem_id(){return e.shared.elem_id},get open(){return e.props.open},set open(s){e.props.open=s},get position(){return e.props.position},set position(s){e.props.position=s},children:(s,r)=>{$(s,{children:(f,y)=>{var i=X(),p=R(i);C(p,t,"default",{}),M(f,i)},$$slots:{default:!0}})},$$slots:{default:!0}})};F(b,n=>{e.shared.visible&&n(x)})}M(w,v),Q()}export{me as default}; +import{p as d,s as C,d as O,b as W,a as Z,f as q,G as A,g as D,i as F,r as H}from"./i18n-DtG3MAQ1.js";import{ah as J,M as z,a7 as K,$ as c,Z as a,ac as U,Q as k,S as G,T as B,t as V,a as M,O as Q,aa as g,a2 as P,R as T,N as R,a3 as X}from"./index-BeNBoC9J.js";import{S as Y}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as $}from"./Index.svelte_svelte_type_style_lang-CqKXbK2o.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var ee=T('
        ');function te(w,t){z(t,!0);let m=d(t,"open",15,!0),e=d(t,"position",11,"left"),v=d(t,"elem_classes",19,()=>[]),_=d(t,"elem_id",3,""),b=d(t,"onexpand",3,()=>{}),x=d(t,"oncollapse",3,()=>{}),n=g(!1),s=g(!1),r,f=g(0),y=P(()=>typeof t.width=="number"?`${t.width}px`:t.width),i=g(!1);function p(){if(!r.closest(".wrap"))return;const l=r.closest(".wrap")?.getBoundingClientRect();if(!l)return;const u=r.getBoundingClientRect(),h=e()==="left"?l.left:window.innerWidth-l.right;c(f,Math.max(0,u.width-h+30),!0)}K(()=>{r.closest(".wrap")?.classList.add("sidebar-parent"),p(),window.addEventListener("resize",p),document.documentElement.style.setProperty("--overlap-amount",`${a(f)}px`),c(n,!0);const u=window.matchMedia("(prefers-reduced-motion: reduce)");c(i,u.matches,!0);const h=N=>{c(i,N.matches,!0)};return u.addEventListener("change",h),()=>{window.removeEventListener("resize",p),u.removeEventListener("change",h)}}),U(()=>{a(n)&&c(s,m(),!0)});let j=P(()=>v()?.join(" ")||"");var o=ee();let E;var L=k(o);L.__click=()=>{c(s,!a(s)),m(a(s)),a(s)?b()?.():x()?.()};var S=G(L,2),I=k(S);C(I,t,"default",{}),B(S),B(o),O(o,l=>r=l,()=>r),V(()=>{E=W(o,1,`sidebar ${a(j)??""}`,"svelte-msxaew",E,{open:a(s),right:e()==="right","reduce-motion":a(i)}),Z(o,"id",_()),q(o,`width: ${a(y)??""}; ${e()??""}: calc(${a(y)??""} * -1)`)}),M(w,o),Q()}J(["click"]);var se=T(" ",1);function me(w,t){z(t,!0);const m=H(t,["$$slots","$$events","$$legacy"]),e=new A(m);var v=se(),_=R(v);Y(_,D({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status));var b=G(_,2);{var x=n=>{te(n,{get width(){return e.props.width},onexpand:()=>e.dispatch("expand"),oncollapse:()=>e.dispatch("collapse"),get elem_classes(){return e.shared.elem_classes},get elem_id(){return e.shared.elem_id},get open(){return e.props.open},set open(s){e.props.open=s},get position(){return e.props.position},set position(s){e.props.position=s},children:(s,r)=>{$(s,{children:(f,y)=>{var i=X(),p=R(i);C(p,t,"default",{}),M(f,i)},$$slots:{default:!0}})},$$slots:{default:!0}})};F(b,n=>{e.shared.visible&&n(x)})}M(w,v),Q()}export{me as default}; diff --git a/assets/Index-C7w0jeUn.js b/assets/Index-BPtyu9sY.js similarity index 89% rename from assets/Index-C7w0jeUn.js rename to assets/Index-BPtyu9sY.js index 957652a995bd9f9811f891e982c3cf0fd3080c1f..93e09ff397c607199bf1314d4f70490195b55fd6 100644 --- a/assets/Index-C7w0jeUn.js +++ b/assets/Index-BPtyu9sY.js @@ -1 +1 @@ -import{G,i as I,s as H,d as O,a as z,b as C,r as N,g as Q}from"./i18n-CPHyzK9b.js";import{M as R,a7 as Z,t as F,a as J,O as K,S as U,R as V,Q as W,G as X,Z as Y,T as ee,a2 as te}from"./index-DydPgVMC.js";import{S as re}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var ae=V('
        ');function fe(y,_){R(_,!0);const A=N(_,["$$slots","$$events","$$legacy"]),s=new G(A);let a,o=null,c=[],i=null;const p=[{event:"dragstart",handler:x},{event:"dragend",handler:M}],m=[{event:"dragover",handler:D},{event:"drop",handler:$},{event:"dragenter",handler:P}];function S(e){p.forEach(({event:r,handler:t})=>{e.addEventListener(r,t)})}function h(e){p.forEach(({event:r,handler:t})=>{e.removeEventListener(r,t)})}function w(e){m.forEach(({event:r,handler:t})=>{e.addEventListener(r,t)})}function v(e){m.forEach(({event:r,handler:t})=>{e.removeEventListener(r,t)})}function b(e,r){e.classList.add("draggable-item"),e.setAttribute("data-index",r.toString()),e.style.position="relative";const t=document.createElement("div");t.className="drag-handle",t.setAttribute("draggable","true"),t.setAttribute("aria-grabbed","false"),t.setAttribute("data-index",r.toString()),t.innerHTML="⋮⋮",e.appendChild(t),S(t),w(e)}function f(){if(!a)return;c.forEach(t=>{const n=t.querySelector(".drag-handle");n&&(h(n),n.remove()),v(t)}),c=[];const e=Array.from(a.children);let r=0;e.forEach(t=>{t.classList.contains("status-tracker")||(t.classList.contains("form")&&t.children.length>0?Array.from(t.children).forEach(l=>{c.push(l),b(l,r),r++}):(c.push(t),b(t,r),r++))})}function x(e){e.stopPropagation?.();const r=e.currentTarget,t=r.parentElement;o=t,parseInt(r.dataset.index||"-1"),r.setAttribute("aria-grabbed","true"),t.classList.add("dragging"),e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/html",t.outerHTML),e.dataTransfer.setDragImage(t,10,10))}function M(e){e.stopPropagation?.();const r=e.currentTarget;r.parentElement.classList.remove("dragging"),r.setAttribute("aria-grabbed","false"),i&&(i.classList.remove("drop-target"),i=null),o=null}function D(e){return e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),!1}function P(e){e.stopPropagation?.();const r=e.currentTarget;if(r===o||!o||!a)return;const t=o.parentElement,n=r.parentElement,l=t?.classList.contains("form")&&t.parentElement===a,u=n?.classList.contains("form")&&n.parentElement===a;(l||t===a)&&(u||n===a)&&(i&&i!==r&&i.classList.remove("drop-target"),r.classList.add("drop-target"),i=r)}async function $(e){e.stopPropagation?.();const r=e.currentTarget;if(r.classList.remove("drop-target"),i&&(i.classList.remove("drop-target"),i=null),o&&o!==r&&a){const t=o.parentElement,n=r.parentElement,l=t?.classList.contains("form")&&t.parentElement===a,u=n?.classList.contains("form")&&n.parentElement===a;if(!((l||t===a)&&(u||n===a)))return!1;const g=document.createElement("div");g.style.display="none",t.insertBefore(g,o),n.insertBefore(o,r),t.insertBefore(r,g),g.remove(),o?.classList.remove("dragging");const T=o?.querySelector(".drag-handle");T&&T.setAttribute("aria-grabbed","false"),await X(),f()}return!1}Z(()=>{f();const e=new MutationObserver(f);return a&&e.observe(a,{childList:!0,subtree:!1}),()=>{e.disconnect(),c.forEach(r=>{const t=r.querySelector(".drag-handle");t&&h(t),v(r)})}});var d=ae();let E;var L=W(d);{var j=e=>{{let r=te(()=>s.shared.loading_status?s.shared.loading_status.status=="pending"?"generating":s.shared.loading_status.status:null);re(e,Q({get autoscroll(){return s.shared.autoscroll},get i18n(){return s.i18n}},()=>s.shared.loading_status,{get status(){return Y(r)}}))}};I(L,e=>{s.shared.loading_status&&s.props.show_progress&&e(j)})}var k=U(L,2);H(k,_,"default",{}),ee(d),O(d,e=>a=e,()=>a),F(e=>{z(d,"id",s.shared.elem_id),E=C(d,1,`draggable ${e??""}`,"svelte-e7dsjj",E,{hide:!s.shared.visible,horizontal:s.props.orientation==="row",vertical:s.props.orientation==="column"})},[()=>(s.shared.elem_classes||[]).join(" ")]),J(y,d),K()}export{fe as default}; +import{G,i as I,s as H,d as O,a as z,b as C,r as N,g as Q}from"./i18n-DtG3MAQ1.js";import{M as R,a7 as Z,t as F,a as J,O as K,S as U,R as V,Q as W,G as X,Z as Y,T as ee,a2 as te}from"./index-BeNBoC9J.js";import{S as re}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var ae=V('
        ');function fe(y,_){R(_,!0);const A=N(_,["$$slots","$$events","$$legacy"]),s=new G(A);let a,o=null,c=[],i=null;const p=[{event:"dragstart",handler:x},{event:"dragend",handler:M}],m=[{event:"dragover",handler:D},{event:"drop",handler:$},{event:"dragenter",handler:P}];function S(e){p.forEach(({event:r,handler:t})=>{e.addEventListener(r,t)})}function h(e){p.forEach(({event:r,handler:t})=>{e.removeEventListener(r,t)})}function w(e){m.forEach(({event:r,handler:t})=>{e.addEventListener(r,t)})}function v(e){m.forEach(({event:r,handler:t})=>{e.removeEventListener(r,t)})}function b(e,r){e.classList.add("draggable-item"),e.setAttribute("data-index",r.toString()),e.style.position="relative";const t=document.createElement("div");t.className="drag-handle",t.setAttribute("draggable","true"),t.setAttribute("aria-grabbed","false"),t.setAttribute("data-index",r.toString()),t.innerHTML="⋮⋮",e.appendChild(t),S(t),w(e)}function f(){if(!a)return;c.forEach(t=>{const n=t.querySelector(".drag-handle");n&&(h(n),n.remove()),v(t)}),c=[];const e=Array.from(a.children);let r=0;e.forEach(t=>{t.classList.contains("status-tracker")||(t.classList.contains("form")&&t.children.length>0?Array.from(t.children).forEach(l=>{c.push(l),b(l,r),r++}):(c.push(t),b(t,r),r++))})}function x(e){e.stopPropagation?.();const r=e.currentTarget,t=r.parentElement;o=t,parseInt(r.dataset.index||"-1"),r.setAttribute("aria-grabbed","true"),t.classList.add("dragging"),e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/html",t.outerHTML),e.dataTransfer.setDragImage(t,10,10))}function M(e){e.stopPropagation?.();const r=e.currentTarget;r.parentElement.classList.remove("dragging"),r.setAttribute("aria-grabbed","false"),i&&(i.classList.remove("drop-target"),i=null),o=null}function D(e){return e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),!1}function P(e){e.stopPropagation?.();const r=e.currentTarget;if(r===o||!o||!a)return;const t=o.parentElement,n=r.parentElement,l=t?.classList.contains("form")&&t.parentElement===a,u=n?.classList.contains("form")&&n.parentElement===a;(l||t===a)&&(u||n===a)&&(i&&i!==r&&i.classList.remove("drop-target"),r.classList.add("drop-target"),i=r)}async function $(e){e.stopPropagation?.();const r=e.currentTarget;if(r.classList.remove("drop-target"),i&&(i.classList.remove("drop-target"),i=null),o&&o!==r&&a){const t=o.parentElement,n=r.parentElement,l=t?.classList.contains("form")&&t.parentElement===a,u=n?.classList.contains("form")&&n.parentElement===a;if(!((l||t===a)&&(u||n===a)))return!1;const g=document.createElement("div");g.style.display="none",t.insertBefore(g,o),n.insertBefore(o,r),t.insertBefore(r,g),g.remove(),o?.classList.remove("dragging");const T=o?.querySelector(".drag-handle");T&&T.setAttribute("aria-grabbed","false"),await X(),f()}return!1}Z(()=>{f();const e=new MutationObserver(f);return a&&e.observe(a,{childList:!0,subtree:!1}),()=>{e.disconnect(),c.forEach(r=>{const t=r.querySelector(".drag-handle");t&&h(t),v(r)})}});var d=ae();let E;var L=W(d);{var j=e=>{{let r=te(()=>s.shared.loading_status?s.shared.loading_status.status=="pending"?"generating":s.shared.loading_status.status:null);re(e,Q({get autoscroll(){return s.shared.autoscroll},get i18n(){return s.i18n}},()=>s.shared.loading_status,{get status(){return Y(r)}}))}};I(L,e=>{s.shared.loading_status&&s.props.show_progress&&e(j)})}var k=U(L,2);H(k,_,"default",{}),ee(d),O(d,e=>a=e,()=>a),F(e=>{z(d,"id",s.shared.elem_id),E=C(d,1,`draggable ${e??""}`,"svelte-e7dsjj",E,{hide:!s.shared.visible,horizontal:s.props.orientation==="row",vertical:s.props.orientation==="column"})},[()=>(s.shared.elem_classes||[]).join(" ")]),J(y,d),K()}export{fe as default}; diff --git a/assets/Index-DdDmW6aI.js b/assets/Index-BPzDpQu1.js similarity index 84% rename from assets/Index-DdDmW6aI.js rename to assets/Index-BPzDpQu1.js index 4a1b5de49ee636b0d3749cc8f4d37f1e30ec336e..c5b00fd7d2666a0e61f3418c03f9676553d60dfd 100644 --- a/assets/Index-DdDmW6aI.js +++ b/assets/Index-BPzDpQu1.js @@ -1,2 +1,2 @@ -import{p as P,i as f,b as J,f as N,q as H,a as h,J as K,w as U,G as V,g as Y,r as $}from"./i18n-CPHyzK9b.js";import{M as R,a as p,O as T,S as m,R as M,Q as i,ah as ee,T as d,t as O,X as j,a3 as ae,N as W,Z as t,a2 as I}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{L as Q}from"./LineChart-DuGokVK_.js";import{B as te}from"./Block-WPcVj6Bq.js";import{B as re}from"./BlockLabel-BzVeVrtL.js";import{E as le}from"./Empty-B15ItVsj.js";import{I as se}from"./IconButtonWrapper-PnNNNvqI.js";import{S as ne}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var oe=M('

        '),ie=M(''),de=M('
        ');function ce(S,r){R(r,!0);let E=P(r,"color",3,void 0),e=P(r,"selectable",3,!1),g=P(r,"show_heading",3,!0);function w(n){return n.replace(/\s/g,"-")}var x=de(),b=i(x);{var k=n=>{var o=oe();let c,u;var l=i(o,!0);d(o),O(()=>{c=J(o,1,"output-class svelte-1ixmwnc",null,c,{"no-confidence":!("confidences"in r.value)}),u=N(o,"",u,{"background-color":E()||"transparent"}),j(l,r.value.label)}),p(n,o)};f(b,n=>{(g()||!r.value.confidences)&&n(k)})}var y=m(b,2);{var G=n=>{var o=ae(),c=W(o);H(c,17,()=>r.value.confidences,U,(u,l,a)=>{var s=ie();let _;s.__click=()=>{r.onselect?.({index:a,value:t(l).label})};var B=i(s),v=i(B),q=m(v,2),L=i(q),X=i(L,!0);d(L);var C=m(L,4),Z=i(C);d(C),d(q),d(B),d(s),O((z,A,D,F)=>{_=J(s,1,"confidence-set group svelte-1ixmwnc",null,_,{selectable:e()}),h(s,"data-testid",`${t(l).label}-confidence-set`),h(v,"aria-labelledby",z),h(v,"aria-label",t(l).label),h(v,"aria-valuenow",A),K(v,t(l).confidence),N(v,`width: ${t(l).confidence*100}%; background: var(--stat-background-fill); +import{p as P,i as f,b as J,f as N,q as H,a as h,J as K,w as U,G as V,g as Y,r as $}from"./i18n-DtG3MAQ1.js";import{M as R,a as p,O as T,S as m,R as M,Q as i,ah as ee,T as d,t as O,X as j,a3 as ae,N as W,Z as t,a2 as I}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{L as Q}from"./LineChart-2ZYa4bPX.js";import{B as te}from"./Block-DkzyQHli.js";import{B as re}from"./BlockLabel-CEOjqpu7.js";import{E as le}from"./Empty-Clj0ErcW.js";import{I as se}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as ne}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var oe=M('

        '),ie=M(''),de=M('
        ');function ce(S,r){R(r,!0);let E=P(r,"color",3,void 0),e=P(r,"selectable",3,!1),g=P(r,"show_heading",3,!0);function w(n){return n.replace(/\s/g,"-")}var x=de(),b=i(x);{var k=n=>{var o=oe();let c,u;var l=i(o,!0);d(o),O(()=>{c=J(o,1,"output-class svelte-1ixmwnc",null,c,{"no-confidence":!("confidences"in r.value)}),u=N(o,"",u,{"background-color":E()||"transparent"}),j(l,r.value.label)}),p(n,o)};f(b,n=>{(g()||!r.value.confidences)&&n(k)})}var y=m(b,2);{var G=n=>{var o=ae(),c=W(o);H(c,17,()=>r.value.confidences,U,(u,l,a)=>{var s=ie();let _;s.__click=()=>{r.onselect?.({index:a,value:t(l).label})};var B=i(s),v=i(B),q=m(v,2),L=i(q),X=i(L,!0);d(L);var C=m(L,4),Z=i(C);d(C),d(q),d(B),d(s),O((z,A,D,F)=>{_=J(s,1,"confidence-set group svelte-1ixmwnc",null,_,{selectable:e()}),h(s,"data-testid",`${t(l).label}-confidence-set`),h(v,"aria-labelledby",z),h(v,"aria-label",t(l).label),h(v,"aria-valuenow",A),K(v,t(l).confidence),N(v,`width: ${t(l).confidence*100}%; background: var(--stat-background-fill); `),h(L,"id",D),j(X,t(l).label),j(Z,`${F??""}%`)},[()=>w(`meter-text-${t(l).label}`),()=>Math.round(t(l).confidence*100),()=>w(`meter-text-${t(l).label}`),()=>Math.round(t(l).confidence*100)]),p(u,s)}),p(n,o)};f(y,n=>{typeof r.value=="object"&&r.value.confidences&&n(G)})}d(x),p(S,x),T()}ee(["click"]);var ue=M(" ",1);function Ie(S,r){R(r,!0);const E=$(r,["$$slots","$$events","$$legacy"]),e=new V(E);let g=I(()=>e.props.value.label);e.watch_for_change(),te(S,{test_id:"label",get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},padding:!1,children:(w,x)=>{var b=ue(),k=W(b);ne(k,Y({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var y=m(k,2);{var G=a=>{se(a,{get buttons(){return e.props.buttons},on_custom_button_click:s=>{e.dispatch("custom_button_click",{id:s})}})};f(y,a=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&a(G)})}var n=m(y,2);{var o=a=>{{let s=I(()=>e.shared.label||e.i18n("label.label")),_=I(()=>e.shared.container===!1),B=I(()=>e.props.show_heading===!0);re(a,{get Icon(){return Q},get label(){return t(s)},get disable(){return t(_)},get float(){return t(B)}})}};f(n,a=>{e.shared.show_label&&a(o)})}var c=m(n,2);{var u=a=>{ce(a,{onselect:s=>e.dispatch("select",s),get selectable(){return e.props._selectable},get value(){return e.props.value},get color(){return e.props.color},get show_heading(){return e.props.show_heading}})},l=a=>{le(a,{unpadded_box:!0,children:(s,_)=>{Q(s)},$$slots:{default:!0}})};f(c,a=>{t(g)!==void 0&&t(g)!==null?a(u):a(l,!1)})}p(w,b)},$$slots:{default:!0}}),T()}export{ce as BaseLabel,Ie as default}; diff --git a/assets/Index-Dynj1EXQ.js b/assets/Index-BQWMUCX7.js similarity index 73% rename from assets/Index-Dynj1EXQ.js rename to assets/Index-BQWMUCX7.js index 91b086ff055988c013075fc25e7b0001d6cc7fca..6039d7ed6c4f1397e0c10cf86e7d23ab18e11b3e 100644 --- a/assets/Index-Dynj1EXQ.js +++ b/assets/Index-BQWMUCX7.js @@ -1 +1 @@ -import{G as x,i as $,r as w,m as y,g as k}from"./i18n-CPHyzK9b.js";import{M as B,aa as T,ab as G,ac as S,N as E,Z as s,a as I,S as M,a2 as o,O as N,$ as O,G as u,R as P}from"./index-DydPgVMC.js";import{T as R}from"./Textbox-BhB0hOv8.js";import{S as Z}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as j}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{default as dt}from"./Example-Cr4dhaJx.js";import"./actions-4RaHFoGI.js";import"./input-BtIxlP_B.js";import"./BlockTitle-DNiCHWOR.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./Send-oZH_TPNw.js";import"./Square-D8rV3Ea-.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";import"./size-D4lmUoTq.js";/* empty css */var q=P(" ",1);function lt(d,p){B(p,!0);let c=w(p,["$$slots","$$events","$$legacy"]);const t=new x(c);let h=o(()=>t.shared.label||"Textbox");t.props.value=t.props.value??"";let n=T(G(t.props.value));async function _(){s(n)!==t.props.value&&(O(n,t.props.value,!0),await u(),t.dispatch("change",y(t.props.value)))}async function m(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e,await u(),t.dispatch("input"))}S(()=>{_()});function g(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e)}j(d,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},allow_overflow:!1,get padding(){return t.shared.container},get rtl(){return t.props.rtl},children:(e,z)=>{var l=q(),i=E(l);{var f=a=>{Z(a,k({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}))};$(i,a=>{t.shared.loading_status&&a(f)})}var v=M(i,2);{let a=o(()=>t.shared?.loading_status?.validation_error||t.shared?.validation_error),b=o(()=>!t.shared.interactive);R(v,{get label(){return s(h)},get info(){return t.props.info},get show_label(){return t.shared.show_label},get lines(){return t.props.lines},get type(){return t.props.type},get rtl(){return t.props.rtl},get text_align(){return t.props.text_align},get max_lines(){return t.props.max_lines},get placeholder(){return t.props.placeholder},get submit_btn(){return t.props.submit_btn},get stop_btn(){return t.props.stop_btn},get buttons(){return t.props.buttons},get autofocus(){return t.props.autofocus},get container(){return t.shared.container},get autoscroll(){return t.shared.autoscroll},get max_length(){return t.props.max_length},get html_attributes(){return t.props.html_attributes},get validation_error(){return s(a)},onchange:g,oninput:m,onsubmit:()=>{t.shared.validation_error=null,t.dispatch("submit")},onblur:()=>t.dispatch("blur"),onselect:r=>t.dispatch("select",r),onfocus:()=>t.dispatch("focus"),onstop:()=>t.dispatch("stop"),oncopy:r=>t.dispatch("copy",r),oncustombuttonclick:r=>{t.dispatch("custom_button_click",{id:r})},get disabled(){return s(b)},get value(){return t.props.value},set value(r){t.props.value=r}})}I(e,l)},$$slots:{default:!0}}),N()}export{dt as BaseExample,R as BaseTextbox,lt as default}; +import{G as x,i as $,r as w,m as y,g as k}from"./i18n-DtG3MAQ1.js";import{M as B,aa as T,ab as G,ac as S,N as E,Z as s,a as I,S as M,a2 as o,O as N,$ as O,G as u,R as P}from"./index-BeNBoC9J.js";import{T as R}from"./Textbox-a-5KfA85.js";import{S as Z}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as j}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{default as dt}from"./Example-D1yz72bP.js";import"./actions-BbCJS635.js";import"./input-BLFxNjIx.js";import"./BlockTitle-B6Pgijwb.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./Send--YHrNLI0.js";import"./Square-CSlbzSkn.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";import"./size-ChvveZyb.js";/* empty css */var q=P(" ",1);function lt(d,p){B(p,!0);let c=w(p,["$$slots","$$events","$$legacy"]);const t=new x(c);let h=o(()=>t.shared.label||"Textbox");t.props.value=t.props.value??"";let n=T(G(t.props.value));async function _(){s(n)!==t.props.value&&(O(n,t.props.value,!0),await u(),t.dispatch("change",y(t.props.value)))}async function m(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e,await u(),t.dispatch("input"))}S(()=>{_()});function g(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e)}j(d,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},allow_overflow:!1,get padding(){return t.shared.container},get rtl(){return t.props.rtl},children:(e,z)=>{var l=q(),i=E(l);{var f=a=>{Z(a,k({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}))};$(i,a=>{t.shared.loading_status&&a(f)})}var v=M(i,2);{let a=o(()=>t.shared?.loading_status?.validation_error||t.shared?.validation_error),b=o(()=>!t.shared.interactive);R(v,{get label(){return s(h)},get info(){return t.props.info},get show_label(){return t.shared.show_label},get lines(){return t.props.lines},get type(){return t.props.type},get rtl(){return t.props.rtl},get text_align(){return t.props.text_align},get max_lines(){return t.props.max_lines},get placeholder(){return t.props.placeholder},get submit_btn(){return t.props.submit_btn},get stop_btn(){return t.props.stop_btn},get buttons(){return t.props.buttons},get autofocus(){return t.props.autofocus},get container(){return t.shared.container},get autoscroll(){return t.shared.autoscroll},get max_length(){return t.props.max_length},get html_attributes(){return t.props.html_attributes},get validation_error(){return s(a)},onchange:g,oninput:m,onsubmit:()=>{t.shared.validation_error=null,t.dispatch("submit")},onblur:()=>t.dispatch("blur"),onselect:r=>t.dispatch("select",r),onfocus:()=>t.dispatch("focus"),onstop:()=>t.dispatch("stop"),oncopy:r=>t.dispatch("copy",r),oncustombuttonclick:r=>{t.dispatch("custom_button_click",{id:r})},get disabled(){return s(b)},get value(){return t.props.value},set value(r){t.props.value=r}})}I(e,l)},$$slots:{default:!0}}),N()}export{dt as BaseExample,R as BaseTextbox,lt as default}; diff --git a/assets/Index-BGogXhGp.js b/assets/Index-BXavAFY8.js similarity index 83% rename from assets/Index-BGogXhGp.js rename to assets/Index-BXavAFY8.js index ce1e297fe4232e1ea17df84d54463457da20f6cc..82b3f0f2bb422b78ccd9fd7ab0841fcc131a7671 100644 --- a/assets/Index-BGogXhGp.js +++ b/assets/Index-BXavAFY8.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Canvas3D-TG45VLbi.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./Canvas3DGS-CSEUG3T9.js"])))=>i.map(i=>d[i]); -import{p as i,i as S,s as de,d as ie,G as ue,r as _e,g as $}from"./i18n-CPHyzK9b.js";import{M as oe,ac as K,$ as u,Z as t,N as m,a as p,O as le,aa as _,af as ee,a2 as c,S as P,R as T,a3 as F,Q as pe,T as ge,G as X,ab as ce}from"./index-DydPgVMC.js";import me from"./Model3D-gDU5RKVo.js";import{c as re}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{U as he}from"./Upload-Bq9KuxCu.js";import{M as fe}from"./ModifyUpload-BL388q45.js";import{B as se}from"./BlockLabel-BzVeVrtL.js";import{F as Y}from"./File-_VpQFuKr.js";import{B as ae}from"./Block-WPcVj6Bq.js";import{E as ve}from"./Empty-B15ItVsj.js";import{U as be}from"./UploadText-CYQRFBCv.js";import{I as we}from"./IconButtonWrapper-PnNNNvqI.js";import{S as te}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{default as er}from"./Example-7FcnnBll.js";import"./Download-DWSaBiea.js";import"./Undo-B9SlrYtT.js";import"./index-tFQomdd2.js";import"./snippet-BtHMuX3s.js";import"./actions-4RaHFoGI.js";import"./DownloadLink-DM2QmhDx.js";import"./Clear-BR8cTgGu.js";import"./Edit-G5CCT_vc.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var ye=T('
        '),ze=T(" ",1);function xe(V,a){oe(a,!0);let s=i(a,"value",15),N=i(a,"display_mode",3,"solid"),e=i(a,"clear_color",19,()=>[0,0,0,0]),j=i(a,"label",3,""),E=i(a,"zoom_speed",3,1),y=i(a,"pan_speed",3,1),L=i(a,"max_file_size",3,null),h=i(a,"uploading",15),O=i(a,"upload_promise",15),Q=i(a,"camera_position",19,()=>[null,null,null]),z=_(!1),R=_(void 0),W=_(void 0),I=_(void 0),x=_(!1);async function Z(){return(await ee(()=>import("./Canvas3D-TG45VLbi.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).default}async function q(){return(await ee(()=>import("./Canvas3DGS-CSEUG3T9.js"),__vite__mapDeps([5,3,1,2,4]),import.meta.url)).default}K(()=>{s()&&(u(z,s().path.endsWith(".splat")||s().path.endsWith(".ply"),!0),t(z)?q().then(r=>{u(R,r,!0)}):Z().then(r=>{u(W,r,!0)}))}),K(()=>{a.ondrag?.(t(x))});async function H(r){s(r),await X(),a.onchange?.(s()),a.onload?.(s())}async function o(){s(null),await X(),a.onclear?.(),a.onchange?.(null)}async function D(){t(I)?.reset_camera_position()}function U(r){a.onerror?.(r)}var M=ze(),A=m(M);{let r=c(()=>j()||"3D Model");se(A,{get show_label(){return a.show_label},get Icon(){return Y},get label(){return t(r)}})}var f=P(A,2);{var v=r=>{{let g=c(()=>a.i18n("model3d.drop_to_upload"));he(r,{get upload(){return a.upload},get stream_handler(){return a.stream_handler},onload:H,get root(){return a.root},get max_file_size(){return L()},filetype:[".stl",".obj",".gltf",".glb","model/obj",".splat",".ply"],onerror:U,get aria_label(){return t(g)},get upload_promise(){return O()},set upload_promise(l){O(l)},get dragging(){return t(x)},set dragging(l){u(x,l,!0)},get uploading(){return h()},set uploading(l){h(l)},children:(l,C)=>{var b=F(),G=m(b);de(G,a,"default",{}),p(l,b)},$$slots:{default:!0}})}},k=r=>{var g=ye(),l=pe(g);{let n=c(()=>!t(z));fe(l,{get undoable(){return t(n)},onclear:o,get i18n(){return a.i18n},onundo:D})}var C=P(l,2);{var b=n=>{var w=F(),d=m(w);re(d,()=>t(R),(B,J)=>{J(B,{get value(){return s()},get zoom_speed(){return E()},get pan_speed(){return y()}})}),p(n,w)},G=n=>{var w=F(),d=m(w);re(d,()=>t(W),(B,J)=>{ie(J(B,{get value(){return s()},get display_mode(){return N()},get clear_color(){return e()},get camera_position(){return Q()},get zoom_speed(){return E()},get pan_speed(){return y()}}),ne=>u(I,ne,!0),()=>t(I))}),p(n,w)};S(C,n=>{t(z)?n(b):n(G,!1)})}ge(g),p(r,g)};S(f,r=>{s()==null?r(v):r(k,!1)})}p(V,M),le()}var De=T(" ",1),Me=T(" ",1),Be=T(" ",1);function Xe(V,a){oe(a,!0);class s extends ue{async get_data(){return t(h)&&(await t(h),await X()),await super.get_data()}}const N=_e(a,["$$slots","$$events","$$legacy"]),e=new s(N);let j=_(ce(e.props.value)),E=_(!1),y=_(!1),L=_(!1),h=_(void 0);const O=typeof window<"u";K(()=>{t(j)!==e.props.value&&(u(j,e.props.value,!0),e.dispatch("change"))});function Q(o){e.props.value=o,e.dispatch("change",o),u(L,!0)}function z(o){u(y,o,!0)}function R(){e.props.value=null,e.dispatch("clear")}function W(o){e.props.value=o,e.dispatch("upload")}function I(o){e.shared.loading_status&&(e.shared.loading_status.status="error"),e.dispatch("error",o)}var x=F(),Z=m(x);{var q=o=>{{let D=c(()=>e.props.value===null?"dashed":"solid"),U=c(()=>t(y)?"focus":"base");ae(o,{get visible(){return e.shared.visible},get variant(){return t(D)},get border_mode(){return t(U)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get height(){return e.props.height},children:(M,A)=>{var f=Me(),v=m(f);te(v,$({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=P(v,2);{var r=l=>{me(l,{get value(){return e.props.value},get i18n(){return e.i18n},get display_mode(){return e.props.display_mode},get clear_color(){return e.props.clear_color},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get camera_position(){return e.props.camera_position},get zoom_speed(){return e.props.zoom_speed},get has_change_history(){return t(L)}})},g=l=>{var C=De(),b=m(C);{var G=d=>{we(d,{get buttons(){return e.props.buttons},on_custom_button_click:B=>{e.dispatch("custom_button_click",{id:B})}})};S(b,d=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&d(G)})}var n=P(b,2);{let d=c(()=>e.shared.label||"3D Model");se(n,{get show_label(){return e.shared.show_label},get Icon(){return Y},get label(){return t(d)}})}var w=P(n,2);ve(w,{unpadded_box:!0,size:"large",children:(d,B)=>{Y(d)},$$slots:{default:!0}}),p(l,C)};S(k,l=>{e.props.value&&O?l(r):l(g,!1)})}p(M,f)},$$slots:{default:!0}})}},H=o=>{{let D=c(()=>e.props.value===null?"dashed":"solid"),U=c(()=>t(y)?"focus":"base");ae(o,{get visible(){return e.shared.visible},get variant(){return t(D)},get border_mode(){return t(U)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get height(){return e.props.height},children:(M,A)=>{var f=Be(),v=m(f);te(v,$({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=P(v,2);xe(k,{get label(){return e.shared.label},get show_label(){return e.shared.show_label},get root(){return e.shared.root},get display_mode(){return e.props.display_mode},get clear_color(){return e.props.clear_color},get camera_position(){return e.props.camera_position},get zoom_speed(){return e.props.zoom_speed},onchange:Q,ondrag:z,onclear:R,onload:W,onerror:I,get i18n(){return e.i18n},get max_file_size(){return e.shared.max_file_size},upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),get upload_promise(){return t(h)},set upload_promise(r){u(h,r,!0)},get value(){return e.props.value},set value(r){e.props.value=r},get uploading(){return t(E)},set uploading(r){u(E,r,!0)},children:(r,g)=>{be(r,{get i18n(){return e.i18n},type:"file"})},$$slots:{default:!0}}),p(M,f)},$$slots:{default:!0}})}};S(Z,o=>{e.shared.interactive?o(H,!1):o(q)})}p(V,x),le()}export{er as BaseExample,me as BaseModel3D,xe as BaseModel3DUpload,Xe as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Canvas3D-BbKV2SzE.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./i18n-DtG3MAQ1.js","./i18n-CawRO-sx.css","./Canvas3DGS-CPiRrZLZ.js"])))=>i.map(i=>d[i]); +import{p as i,i as S,s as de,d as ie,G as ue,r as _e,g as $}from"./i18n-DtG3MAQ1.js";import{M as oe,ac as K,$ as u,Z as t,N as m,a as p,O as le,aa as _,af as ee,a2 as c,S as P,R as T,a3 as F,Q as pe,T as ge,G as X,ab as ce}from"./index-BeNBoC9J.js";import me from"./Model3D-DSlnWR_H.js";import{c as re}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{U as he}from"./Upload-CGTpHDBO.js";import{M as fe}from"./ModifyUpload-DbCqTfQf.js";import{B as se}from"./BlockLabel-CEOjqpu7.js";import{F as Y}from"./File-CD333vfS.js";import{B as ae}from"./Block-DkzyQHli.js";import{E as ve}from"./Empty-Clj0ErcW.js";import{U as be}from"./UploadText-yqnlGa4o.js";import{I as we}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as te}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as er}from"./Example-BdhvPMmU.js";import"./Download-0gCL6VXM.js";import"./Undo-Bu_OzfgD.js";import"./index-tFQomdd2.js";import"./snippet-BRIBYCwB.js";import"./actions-BbCJS635.js";import"./DownloadLink-Dk6GrGSA.js";import"./Clear-BiKSVifk.js";import"./Edit-DfYRtNtw.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var ye=T('
        '),ze=T(" ",1);function xe(V,a){oe(a,!0);let s=i(a,"value",15),N=i(a,"display_mode",3,"solid"),e=i(a,"clear_color",19,()=>[0,0,0,0]),j=i(a,"label",3,""),E=i(a,"zoom_speed",3,1),y=i(a,"pan_speed",3,1),L=i(a,"max_file_size",3,null),h=i(a,"uploading",15),O=i(a,"upload_promise",15),Q=i(a,"camera_position",19,()=>[null,null,null]),z=_(!1),R=_(void 0),W=_(void 0),I=_(void 0),x=_(!1);async function Z(){return(await ee(()=>import("./Canvas3D-BbKV2SzE.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).default}async function q(){return(await ee(()=>import("./Canvas3DGS-CPiRrZLZ.js"),__vite__mapDeps([5,3,1,2,4]),import.meta.url)).default}K(()=>{s()&&(u(z,s().path.endsWith(".splat")||s().path.endsWith(".ply"),!0),t(z)?q().then(r=>{u(R,r,!0)}):Z().then(r=>{u(W,r,!0)}))}),K(()=>{a.ondrag?.(t(x))});async function H(r){s(r),await X(),a.onchange?.(s()),a.onload?.(s())}async function o(){s(null),await X(),a.onclear?.(),a.onchange?.(null)}async function D(){t(I)?.reset_camera_position()}function U(r){a.onerror?.(r)}var M=ze(),A=m(M);{let r=c(()=>j()||"3D Model");se(A,{get show_label(){return a.show_label},get Icon(){return Y},get label(){return t(r)}})}var f=P(A,2);{var v=r=>{{let g=c(()=>a.i18n("model3d.drop_to_upload"));he(r,{get upload(){return a.upload},get stream_handler(){return a.stream_handler},onload:H,get root(){return a.root},get max_file_size(){return L()},filetype:[".stl",".obj",".gltf",".glb","model/obj",".splat",".ply"],onerror:U,get aria_label(){return t(g)},get upload_promise(){return O()},set upload_promise(l){O(l)},get dragging(){return t(x)},set dragging(l){u(x,l,!0)},get uploading(){return h()},set uploading(l){h(l)},children:(l,C)=>{var b=F(),G=m(b);de(G,a,"default",{}),p(l,b)},$$slots:{default:!0}})}},k=r=>{var g=ye(),l=pe(g);{let n=c(()=>!t(z));fe(l,{get undoable(){return t(n)},onclear:o,get i18n(){return a.i18n},onundo:D})}var C=P(l,2);{var b=n=>{var w=F(),d=m(w);re(d,()=>t(R),(B,J)=>{J(B,{get value(){return s()},get zoom_speed(){return E()},get pan_speed(){return y()}})}),p(n,w)},G=n=>{var w=F(),d=m(w);re(d,()=>t(W),(B,J)=>{ie(J(B,{get value(){return s()},get display_mode(){return N()},get clear_color(){return e()},get camera_position(){return Q()},get zoom_speed(){return E()},get pan_speed(){return y()}}),ne=>u(I,ne,!0),()=>t(I))}),p(n,w)};S(C,n=>{t(z)?n(b):n(G,!1)})}ge(g),p(r,g)};S(f,r=>{s()==null?r(v):r(k,!1)})}p(V,M),le()}var De=T(" ",1),Me=T(" ",1),Be=T(" ",1);function Xe(V,a){oe(a,!0);class s extends ue{async get_data(){return t(h)&&(await t(h),await X()),await super.get_data()}}const N=_e(a,["$$slots","$$events","$$legacy"]),e=new s(N);let j=_(ce(e.props.value)),E=_(!1),y=_(!1),L=_(!1),h=_(void 0);const O=typeof window<"u";K(()=>{t(j)!==e.props.value&&(u(j,e.props.value,!0),e.dispatch("change"))});function Q(o){e.props.value=o,e.dispatch("change",o),u(L,!0)}function z(o){u(y,o,!0)}function R(){e.props.value=null,e.dispatch("clear")}function W(o){e.props.value=o,e.dispatch("upload")}function I(o){e.shared.loading_status&&(e.shared.loading_status.status="error"),e.dispatch("error",o)}var x=F(),Z=m(x);{var q=o=>{{let D=c(()=>e.props.value===null?"dashed":"solid"),U=c(()=>t(y)?"focus":"base");ae(o,{get visible(){return e.shared.visible},get variant(){return t(D)},get border_mode(){return t(U)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get height(){return e.props.height},children:(M,A)=>{var f=Me(),v=m(f);te(v,$({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=P(v,2);{var r=l=>{me(l,{get value(){return e.props.value},get i18n(){return e.i18n},get display_mode(){return e.props.display_mode},get clear_color(){return e.props.clear_color},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get camera_position(){return e.props.camera_position},get zoom_speed(){return e.props.zoom_speed},get has_change_history(){return t(L)}})},g=l=>{var C=De(),b=m(C);{var G=d=>{we(d,{get buttons(){return e.props.buttons},on_custom_button_click:B=>{e.dispatch("custom_button_click",{id:B})}})};S(b,d=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&d(G)})}var n=P(b,2);{let d=c(()=>e.shared.label||"3D Model");se(n,{get show_label(){return e.shared.show_label},get Icon(){return Y},get label(){return t(d)}})}var w=P(n,2);ve(w,{unpadded_box:!0,size:"large",children:(d,B)=>{Y(d)},$$slots:{default:!0}}),p(l,C)};S(k,l=>{e.props.value&&O?l(r):l(g,!1)})}p(M,f)},$$slots:{default:!0}})}},H=o=>{{let D=c(()=>e.props.value===null?"dashed":"solid"),U=c(()=>t(y)?"focus":"base");ae(o,{get visible(){return e.shared.visible},get variant(){return t(D)},get border_mode(){return t(U)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get height(){return e.props.height},children:(M,A)=>{var f=Be(),v=m(f);te(v,$({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=P(v,2);xe(k,{get label(){return e.shared.label},get show_label(){return e.shared.show_label},get root(){return e.shared.root},get display_mode(){return e.props.display_mode},get clear_color(){return e.props.clear_color},get camera_position(){return e.props.camera_position},get zoom_speed(){return e.props.zoom_speed},onchange:Q,ondrag:z,onclear:R,onload:W,onerror:I,get i18n(){return e.i18n},get max_file_size(){return e.shared.max_file_size},upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),get upload_promise(){return t(h)},set upload_promise(r){u(h,r,!0)},get value(){return e.props.value},set value(r){e.props.value=r},get uploading(){return t(E)},set uploading(r){u(E,r,!0)},children:(r,g)=>{be(r,{get i18n(){return e.i18n},type:"file"})},$$slots:{default:!0}}),p(M,f)},$$slots:{default:!0}})}};S(Z,o=>{e.shared.interactive?o(H,!1):o(q)})}p(V,x),le()}export{er as BaseExample,me as BaseModel3D,xe as BaseModel3DUpload,Xe as default}; diff --git a/assets/Index-DHLZt6aU.js b/assets/Index-BbjiDvUC.js similarity index 80% rename from assets/Index-DHLZt6aU.js rename to assets/Index-BbjiDvUC.js index 72445d889fa625efa9684cb6f9f39f107810923b..237e385c679a4bc67b16596d55632c8f795b2c47 100644 --- a/assets/Index-DHLZt6aU.js +++ b/assets/Index-BbjiDvUC.js @@ -1 +1 @@ -import{p as T,i as b,G as z,g as M,r as N}from"./i18n-CPHyzK9b.js";import{M as w,ae as P,Z as r,O as k,a2 as c,$ as f,aa as y,N as $,a as D,S as v,R as I,ab as Z,ac as q}from"./index-DydPgVMC.js";import{S as A}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{C as F}from"./Code-Bhm2YgEI.js";import{C as E}from"./Check-2f8HlfSn.js";import{C as H}from"./Copy-B3jzejpA.js";import{I as R}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{D as J}from"./Download-DWSaBiea.js";import{D as K}from"./DownloadLink-DM2QmhDx.js";import{I as Q}from"./IconButtonWrapper-PnNNNvqI.js";import{B as V}from"./Block-WPcVj6Bq.js";import{B as X}from"./BlockLabel-BzVeVrtL.js";import{E as Y}from"./Empty-B15ItVsj.js";import{C as L}from"./Code-D1inKIZZ.js";import{default as je}from"./Example-CCIKPQQj.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./snippet-BtHMuX3s.js";/* empty css */function ee(p,t){w(t,!0);let a=y(!1),e;function n(){f(a,!0),e&&clearTimeout(e),e=setTimeout(()=>{f(a,!1)},2e3)}async function o(){"clipboard"in navigator&&(await navigator.clipboard.writeText(t.value),n())}P(()=>{e&&clearTimeout(e)});{let u=c(()=>r(a)?E:H);R(p,{get Icon(){return r(u)},label:"Copy",onclick:o})}k()}function te(p,t){w(t,!0);let a=c(()=>e(t.language));function e(m){return{py:"py",python:"py",md:"md",markdown:"md",json:"json",html:"html",css:"css",js:"js",javascript:"js",ts:"ts",typescript:"ts",yaml:"yaml",yml:"yml",dockerfile:"dockerfile",sh:"sh",shell:"sh",r:"r",c:"c",cpp:"cpp",latex:"tex"}[m]||"txt"}let n=y(!1),o;function u(){f(n,!0),o&&clearTimeout(o),o=setTimeout(()=>{f(n,!1)},2e3)}let d=c(()=>URL.createObjectURL(new Blob([t.value])));P(()=>{o&&clearTimeout(o)}),K(p,{get download(){return`file.${r(a)??""}`},get href(){return r(d)},onclick:u,children:(m,_)=>{{let g=c(()=>r(n)?E:J);R(m,{get Icon(){return r(g)},label:"Download"})}},$$slots:{default:!0}}),k()}var re=I(" ",1);function ae(p,t){w(t,!0);let a=T(t,"buttons",3,null),e=T(t,"on_custom_button_click",3,null);Q(p,{get buttons(){return a()},get on_custom_button_click(){return e()},children:(n,o)=>{var u=re(),d=$(u);{var m=s=>{te(s,{get value(){return t.value},get language(){return t.language}})};b(d,s=>{a()?.some(i=>typeof i=="string"&&i==="download")&&s(m)})}var _=v(d,2);{var g=s=>{ee(s,{get value(){return t.value}})};b(_,s=>{a()?.some(i=>typeof i=="string"&&i==="copy")&&s(g)})}D(n,u)},$$slots:{default:!0}}),k()}var oe=I(" ",1),se=I(" ",1);function $e(p,t){w(t,!0);const a=N(t,["$$slots","$$events","$$legacy"]),e=new z(a);let n=e.shared.theme==="dark",o=c(()=>e.shared.label||e.i18n("code.code")),u=y(Z(e.props.value)),d=y(!0);q(()=>{if(r(d)){f(d,!1);return}r(u)!=e.props.value&&(f(u,e.props.value,!0),e.dispatch("change"))});{let m=c(()=>e.props.max_lines&&"fit-content");V(p,{get height(){return r(m)},variant:"solid",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(_,g)=>{var s=se(),i=$(s);A(i,M({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var j=v(i,2);{var S=l=>{X(l,{get Icon(){return L},get show_label(){return e.shared.show_label},get label(){return r(o)},float:!1})};b(j,l=>{e.shared.show_label&&l(S)})}var W=v(j,2);{var G=l=>{Y(l,{unpadded_box:!0,size:"large",children:(h,x)=>{L(h)},$$slots:{default:!0}})},O=l=>{var h=oe(),x=$(h);{let B=c(()=>e.props.buttons??["copy","download"]);ae(x,{get language(){return e.props.language},get value(){return e.props.value},get buttons(){return r(B)},on_custom_button_click:C=>{e.dispatch("custom_button_click",{id:C})}})}var U=v(x,2);{let B=c(()=>!e.shared.interactive);F(U,{get language(){return e.props.language},get lines(){return e.props.lines},get max_lines(){return e.props.max_lines},get dark_mode(){return n},get wrap_lines(){return e.props.wrap_lines},get show_line_numbers(){return e.props.show_line_numbers},get autocomplete(){return e.props.autocomplete},get readonly(){return r(B)},onblur:()=>e.dispatch("blur"),onfocus:()=>e.dispatch("focus"),oninput:()=>e.dispatch("input"),get value(){return e.props.value},set value(C){e.props.value=C}})}D(l,h)};b(W,l=>{!e.props.value&&!e.shared.interactive?l(G):l(O,!1)})}D(_,s)},$$slots:{default:!0}})}k()}export{F as BaseCode,ee as BaseCopy,te as BaseDownload,je as BaseExample,ae as BaseWidget,$e as default}; +import{p as T,i as b,G as z,g as M,r as N}from"./i18n-DtG3MAQ1.js";import{M as w,ae as P,Z as r,O as k,a2 as c,$ as f,aa as y,N as $,a as D,S as v,R as I,ab as Z,ac as q}from"./index-BeNBoC9J.js";import{S as A}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{C as F}from"./Code-D0Kw4ylG.js";import{C as E}from"./Check-DjGw_9dO.js";import{C as H}from"./Copy-eBznHIlR.js";import{I as R}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{D as J}from"./Download-0gCL6VXM.js";import{D as K}from"./DownloadLink-Dk6GrGSA.js";import{I as Q}from"./IconButtonWrapper-Ce5bzAyh.js";import{B as V}from"./Block-DkzyQHli.js";import{B as X}from"./BlockLabel-CEOjqpu7.js";import{E as Y}from"./Empty-Clj0ErcW.js";import{C as L}from"./Code-B0D7Zxt1.js";import{default as je}from"./Example-7cNIWfNN.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./snippet-BRIBYCwB.js";/* empty css */function ee(p,t){w(t,!0);let a=y(!1),e;function n(){f(a,!0),e&&clearTimeout(e),e=setTimeout(()=>{f(a,!1)},2e3)}async function o(){"clipboard"in navigator&&(await navigator.clipboard.writeText(t.value),n())}P(()=>{e&&clearTimeout(e)});{let u=c(()=>r(a)?E:H);R(p,{get Icon(){return r(u)},label:"Copy",onclick:o})}k()}function te(p,t){w(t,!0);let a=c(()=>e(t.language));function e(m){return{py:"py",python:"py",md:"md",markdown:"md",json:"json",html:"html",css:"css",js:"js",javascript:"js",ts:"ts",typescript:"ts",yaml:"yaml",yml:"yml",dockerfile:"dockerfile",sh:"sh",shell:"sh",r:"r",c:"c",cpp:"cpp",latex:"tex"}[m]||"txt"}let n=y(!1),o;function u(){f(n,!0),o&&clearTimeout(o),o=setTimeout(()=>{f(n,!1)},2e3)}let d=c(()=>URL.createObjectURL(new Blob([t.value])));P(()=>{o&&clearTimeout(o)}),K(p,{get download(){return`file.${r(a)??""}`},get href(){return r(d)},onclick:u,children:(m,_)=>{{let g=c(()=>r(n)?E:J);R(m,{get Icon(){return r(g)},label:"Download"})}},$$slots:{default:!0}}),k()}var re=I(" ",1);function ae(p,t){w(t,!0);let a=T(t,"buttons",3,null),e=T(t,"on_custom_button_click",3,null);Q(p,{get buttons(){return a()},get on_custom_button_click(){return e()},children:(n,o)=>{var u=re(),d=$(u);{var m=s=>{te(s,{get value(){return t.value},get language(){return t.language}})};b(d,s=>{a()?.some(i=>typeof i=="string"&&i==="download")&&s(m)})}var _=v(d,2);{var g=s=>{ee(s,{get value(){return t.value}})};b(_,s=>{a()?.some(i=>typeof i=="string"&&i==="copy")&&s(g)})}D(n,u)},$$slots:{default:!0}}),k()}var oe=I(" ",1),se=I(" ",1);function $e(p,t){w(t,!0);const a=N(t,["$$slots","$$events","$$legacy"]),e=new z(a);let n=e.shared.theme==="dark",o=c(()=>e.shared.label||e.i18n("code.code")),u=y(Z(e.props.value)),d=y(!0);q(()=>{if(r(d)){f(d,!1);return}r(u)!=e.props.value&&(f(u,e.props.value,!0),e.dispatch("change"))});{let m=c(()=>e.props.max_lines&&"fit-content");V(p,{get height(){return r(m)},variant:"solid",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(_,g)=>{var s=se(),i=$(s);A(i,M({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var j=v(i,2);{var S=l=>{X(l,{get Icon(){return L},get show_label(){return e.shared.show_label},get label(){return r(o)},float:!1})};b(j,l=>{e.shared.show_label&&l(S)})}var W=v(j,2);{var G=l=>{Y(l,{unpadded_box:!0,size:"large",children:(h,x)=>{L(h)},$$slots:{default:!0}})},O=l=>{var h=oe(),x=$(h);{let B=c(()=>e.props.buttons??["copy","download"]);ae(x,{get language(){return e.props.language},get value(){return e.props.value},get buttons(){return r(B)},on_custom_button_click:C=>{e.dispatch("custom_button_click",{id:C})}})}var U=v(x,2);{let B=c(()=>!e.shared.interactive);F(U,{get language(){return e.props.language},get lines(){return e.props.lines},get max_lines(){return e.props.max_lines},get dark_mode(){return n},get wrap_lines(){return e.props.wrap_lines},get show_line_numbers(){return e.props.show_line_numbers},get autocomplete(){return e.props.autocomplete},get readonly(){return r(B)},onblur:()=>e.dispatch("blur"),onfocus:()=>e.dispatch("focus"),oninput:()=>e.dispatch("input"),get value(){return e.props.value},set value(C){e.props.value=C}})}D(l,h)};b(W,l=>{!e.props.value&&!e.shared.interactive?l(G):l(O,!1)})}D(_,s)},$$slots:{default:!0}})}k()}export{F as BaseCode,ee as BaseCopy,te as BaseDownload,je as BaseExample,ae as BaseWidget,$e as default}; diff --git a/assets/Index-ft-iSOp9.js b/assets/Index-BbnB_l1P.js similarity index 84% rename from assets/Index-ft-iSOp9.js rename to assets/Index-BbnB_l1P.js index 445ee8cf111ff5db26300b85f6a1ad72cd74237f..2b4aff9738f17c5aec07436daafc882567addfca 100644 --- a/assets/Index-ft-iSOp9.js +++ b/assets/Index-BbnB_l1P.js @@ -1 +1 @@ -import{G as b,i as v,r as $,s as c}from"./i18n-CPHyzK9b.js";import{M as x,ac as T,a3 as i,N as o,a as d,O as k}from"./index-DydPgVMC.js";import{W as w,T as B}from"./Walkthrough-BWP9RaPo.js";import{a as M}from"./Walkthrough-BWP9RaPo.js";function W(_,r){x(r,!0);let h=$(r,["$$slots","$$events","$$legacy"]);const e=new b(h);let n=e.props.selected;T(()=>{if(n!==e.props.selected){const t=e.props.initial_tabs.findIndex(s=>s.id===e.props.selected);t>=0&&e.dispatch("gradio_tab_select",{value:e.props.initial_tabs[t].label,index:t,id:e.props.initial_tabs[t].id,component_id:e.props.initial_tabs[t].component_id}),n=e.props.selected}});var p=i(),g=o(p);{var u=t=>{w(t,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},onchange:()=>e.dispatch("change"),onselect:s=>{e.dispatch("select",s),e.dispatch("gradio_tab_select",s)},get initial_tabs(){return e.props.initial_tabs},get selected(){return e.props.selected},set selected(s){e.props.selected=s},children:(s,f)=>{var a=i(),l=o(a);c(l,r,"default",{}),d(s,a)},$$slots:{default:!0}})},m=t=>{B(t,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},onchange:()=>e.dispatch("change"),onselect:s=>{e.dispatch("select",s),e.dispatch("gradio_tab_select",s)},get initial_tabs(){return e.props.initial_tabs},get selected(){return e.props.selected},set selected(s){e.props.selected=s},children:(s,f)=>{var a=i(),l=o(a);c(l,r,"default",{}),d(s,a)},$$slots:{default:!0}})};v(g,t=>{e.props.name==="walkthrough"?t(u):t(m,!1)})}d(_,p),k()}export{B as BaseTabs,M as TABS,W as default}; +import{G as b,i as v,r as $,s as c}from"./i18n-DtG3MAQ1.js";import{M as x,ac as T,a3 as i,N as o,a as d,O as k}from"./index-BeNBoC9J.js";import{W as w,T as B}from"./Walkthrough-H2UDh_VW.js";import{a as M}from"./Walkthrough-H2UDh_VW.js";function W(_,r){x(r,!0);let h=$(r,["$$slots","$$events","$$legacy"]);const e=new b(h);let n=e.props.selected;T(()=>{if(n!==e.props.selected){const t=e.props.initial_tabs.findIndex(s=>s.id===e.props.selected);t>=0&&e.dispatch("gradio_tab_select",{value:e.props.initial_tabs[t].label,index:t,id:e.props.initial_tabs[t].id,component_id:e.props.initial_tabs[t].component_id}),n=e.props.selected}});var p=i(),g=o(p);{var u=t=>{w(t,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},onchange:()=>e.dispatch("change"),onselect:s=>{e.dispatch("select",s),e.dispatch("gradio_tab_select",s)},get initial_tabs(){return e.props.initial_tabs},get selected(){return e.props.selected},set selected(s){e.props.selected=s},children:(s,f)=>{var a=i(),l=o(a);c(l,r,"default",{}),d(s,a)},$$slots:{default:!0}})},m=t=>{B(t,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},onchange:()=>e.dispatch("change"),onselect:s=>{e.dispatch("select",s),e.dispatch("gradio_tab_select",s)},get initial_tabs(){return e.props.initial_tabs},get selected(){return e.props.selected},set selected(s){e.props.selected=s},children:(s,f)=>{var a=i(),l=o(a);c(l,r,"default",{}),d(s,a)},$$slots:{default:!0}})};v(g,t=>{e.props.name==="walkthrough"?t(u):t(m,!1)})}d(_,p),k()}export{B as BaseTabs,M as TABS,W as default}; diff --git a/assets/Index-CMb7sSjM.js b/assets/Index-Be8Vl5NA.js similarity index 68% rename from assets/Index-CMb7sSjM.js rename to assets/Index-Be8Vl5NA.js index 96a2a226d666c134927c5d29ae31f2722d368e17..5a355e04b49cfb60934769984559e664fd40bca1 100644 --- a/assets/Index-CMb7sSjM.js +++ b/assets/Index-Be8Vl5NA.js @@ -1 +1 @@ -import{G as p,r as l}from"./i18n-CPHyzK9b.js";import{M as u,a4 as d,t as c,a as m,Z as g,O as _,a2 as h,X as v,a5 as f}from"./index-DydPgVMC.js";import{B as $}from"./Button-CV36sOqf.js";import"./snippet-BtHMuX3s.js";import"./Image-CZ1Hb99p.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */function O(s,t){u(t,!0);let a=l(t,["$$slots","$$events","$$legacy"]);const e=new p(a);e.watch_for_change();function i(){e.dispatch("click")}{let n=h(()=>!e.shared.interactive);$(s,{get value(){return e.props.value},get variant(){return e.props.variant},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get size(){return e.props.size},get scale(){return e.shared.scale},get link(){return e.props.link},get icon(){return e.props.icon},get min_width(){return e.shared.min_width},get visible(){return e.shared.visible},get disabled(){return g(n)},get link_target(){return e.props.link_target},onclick:i,children:(o,k)=>{f();var r=d();c(()=>v(r,e.props.value??"")),m(o,r)},$$slots:{default:!0}})}_()}export{$ as BaseButton,O as default}; +import{G as p,r as l}from"./i18n-DtG3MAQ1.js";import{M as u,a4 as d,t as c,a as m,Z as g,O as _,a2 as h,X as v,a5 as f}from"./index-BeNBoC9J.js";import{B as $}from"./Button-j0-_VC-G.js";import"./snippet-BRIBYCwB.js";import"./Image-ALBOEs1f.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */function O(s,t){u(t,!0);let a=l(t,["$$slots","$$events","$$legacy"]);const e=new p(a);e.watch_for_change();function i(){e.dispatch("click")}{let n=h(()=>!e.shared.interactive);$(s,{get value(){return e.props.value},get variant(){return e.props.variant},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get size(){return e.props.size},get scale(){return e.shared.scale},get link(){return e.props.link},get icon(){return e.props.icon},get min_width(){return e.shared.min_width},get visible(){return e.shared.visible},get disabled(){return g(n)},get link_target(){return e.props.link_target},onclick:i,children:(o,k)=>{f();var r=d();c(()=>v(r,e.props.value??"")),m(o,r)},$$slots:{default:!0}})}_()}export{$ as BaseButton,O as default}; diff --git a/assets/Index-DCmnrJma.js b/assets/Index-Bf2r3_yp.js similarity index 78% rename from assets/Index-DCmnrJma.js rename to assets/Index-Bf2r3_yp.js index f9836ce3ef5b0af2a38b08eae0f7e9bbcf6c0246..95382b8006a0d03bd86446e481f473cdd3899ee8 100644 --- a/assets/Index-DCmnrJma.js +++ b/assets/Index-Bf2r3_yp.js @@ -1 +1 @@ -import{p as B,s as z,b as C,f as $,i as I,r as M,G as N,g as O}from"./i18n-CPHyzK9b.js";import{M as G,N as b,t as Q,a as x,O as P,S as y,Q as h,R as S,ah as R,X as T,T as f,a3 as X,Z as g,a2 as v}from"./index-DydPgVMC.js";import{B as Z}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{S as j}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as q}from"./Index.svelte_svelte_type_style_lang-glBt5fcY.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var D=S('
        ',1);function E(u,t){G(t,!0);let s=B(t,"open",15,!0),m=B(t,"label",3,"");var e=D(),a=b(e);a.__click=()=>{s(!s()),s()?t.onexpand?.():t.oncollapse?.()};let d;var l=h(a),p=h(l,!0);f(l);var r=y(l,2);let n;f(a);var o=y(a,2);let c;var _=h(o);z(_,t,"default",{}),f(o),Q(()=>{d=C(a,1,"label-wrap svelte-1g6pozc",null,d,{open:s()}),T(p,m()),n=$(r,"",n,{transform:s()?"rotate(0)":"rotate(90deg)"}),c=$(o,"",c,{display:s()?"block":"none"})}),x(u,e),P()}R(["click"]);var F=S(" ",1);function oe(u,t){G(t,!0);let s=M(t,["$$slots","$$events","$$legacy"]);class m extends N{set_data(r){"open"in r&&r.open!==this.props.open&&(r.open?(this.dispatch("expand"),this.dispatch("gradio_expand")):this.dispatch("collapse")),super.set_data(r),this.shared.loading_status.status="complete"}}const e=new m(s);let a=v(()=>e.shared.label||""),d=v(()=>[...e.shared.elem_classes||[],"gr-accordion"]),l=v(()=>e.shared.visible===!0?!0:"hidden");Z(u,{get elem_id(){return e.shared.elem_id},get elem_classes(){return g(d)},get visible(){return g(l)},children:(p,r)=>{var n=F(),o=b(n);{var c=i=>{j(i,O({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status))};I(o,i=>{e.shared.loading_status&&i(c)})}var _=y(o,2);E(_,{get label(){return g(a)},get open(){return e.props.open},onexpand:()=>{e.dispatch("expand"),e.dispatch("gradio_expand")},oncollapse:()=>e.dispatch("collapse"),children:(i,H)=>{q(i,{children:(w,J)=>{var k=X(),A=b(k);z(A,t,"default",{}),x(w,k)},$$slots:{default:!0}})},$$slots:{default:!0}}),x(p,n)},$$slots:{default:!0}}),P()}export{oe as default}; +import{p as B,s as z,b as C,f as $,i as I,r as M,G as N,g as O}from"./i18n-DtG3MAQ1.js";import{M as G,N as b,t as Q,a as x,O as P,S as y,Q as h,R as S,ah as R,X as T,T as f,a3 as X,Z as g,a2 as v}from"./index-BeNBoC9J.js";import{B as Z}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{S as j}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as q}from"./Index.svelte_svelte_type_style_lang-CqKXbK2o.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var D=S('
        ',1);function E(u,t){G(t,!0);let s=B(t,"open",15,!0),m=B(t,"label",3,"");var e=D(),a=b(e);a.__click=()=>{s(!s()),s()?t.onexpand?.():t.oncollapse?.()};let d;var l=h(a),p=h(l,!0);f(l);var r=y(l,2);let n;f(a);var o=y(a,2);let c;var _=h(o);z(_,t,"default",{}),f(o),Q(()=>{d=C(a,1,"label-wrap svelte-1g6pozc",null,d,{open:s()}),T(p,m()),n=$(r,"",n,{transform:s()?"rotate(0)":"rotate(90deg)"}),c=$(o,"",c,{display:s()?"block":"none"})}),x(u,e),P()}R(["click"]);var F=S(" ",1);function oe(u,t){G(t,!0);let s=M(t,["$$slots","$$events","$$legacy"]);class m extends N{set_data(r){"open"in r&&r.open!==this.props.open&&(r.open?(this.dispatch("expand"),this.dispatch("gradio_expand")):this.dispatch("collapse")),super.set_data(r),this.shared.loading_status.status="complete"}}const e=new m(s);let a=v(()=>e.shared.label||""),d=v(()=>[...e.shared.elem_classes||[],"gr-accordion"]),l=v(()=>e.shared.visible===!0?!0:"hidden");Z(u,{get elem_id(){return e.shared.elem_id},get elem_classes(){return g(d)},get visible(){return g(l)},children:(p,r)=>{var n=F(),o=b(n);{var c=i=>{j(i,O({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status))};I(o,i=>{e.shared.loading_status&&i(c)})}var _=y(o,2);E(_,{get label(){return g(a)},get open(){return e.props.open},onexpand:()=>{e.dispatch("expand"),e.dispatch("gradio_expand")},oncollapse:()=>e.dispatch("collapse"),children:(i,H)=>{q(i,{children:(w,J)=>{var k=X(),A=b(k);z(A,t,"default",{}),x(w,k)},$$slots:{default:!0}})},$$slots:{default:!0}}),x(p,n)},$$slots:{default:!0}}),P()}export{oe as default}; diff --git a/assets/Index-B1nUzmPt.js b/assets/Index-Bm5GhQaR.js similarity index 86% rename from assets/Index-B1nUzmPt.js rename to assets/Index-Bm5GhQaR.js index 3bc3255849b8cb60dd5281473ee4f9bcd561fed5..69c60672f686bea83974b01428da07240b6304f9 100644 --- a/assets/Index-B1nUzmPt.js +++ b/assets/Index-Bm5GhQaR.js @@ -1 +1 @@ -import{G as ae,g as te,d as R,i as se,r as re,a as r,v as U}from"./i18n-CPHyzK9b.js";import{M as ie,aa as le,ab as ne,ac as E,Z as u,$ as pe,U as i,N as oe,a4 as ue,t as f,a as x,Q as l,S as d,O as de,G as $,au as me,R as Q,X as w,a2 as y,a5 as ve,T as n}from"./index-DydPgVMC.js";import{b as O}from"./input-BtIxlP_B.js";import{B as ce}from"./Block-WPcVj6Bq.js";import{B as _e}from"./BlockTitle-DNiCHWOR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{S as he}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";let ge=0;var be=Q(''),fe=Q('
        ',1);function Ae(V,k){ie(k,!0);let X=re(k,["$$slots","$$events","$$legacy"]),e=new ae(X);const Z=e.props.value;let S=le(ne(e.props.value)),m,B;const I=`range_id_${ge++}`;let j=y(()=>e.props.minimum??0),q=y(()=>{const p=e.props.minimum,h=e.props.maximum,o=e.props.value;return o>h?100:o{e.props.value==null||!m||(m.style.setProperty("--range_progress",`${u(q)}%`),m.value=e.props.value.toString())});async function C(){await $(),e.dispatch("change")}async function G(p){await $(),e.dispatch("release",e.props.value)}function D(){e.dispatch("release",e.props.value),e.props.value=Math.min(Math.max(e.props.value,e.props.minimum),e.props.maximum)}let _=y(()=>!e.shared.interactive);E(()=>{e.props.value!=u(S)&&(pe(S,e.props.value,!0),C())});function F(){}function H(){e.props.value=Z,e.dispatch("change"),e.dispatch("release",e.props.value)}async function M(){await $(),e.dispatch("input")}i("resize",me,F),ce(V,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(p,h)=>{var o=fe(),P=oe(o);he(P,te({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var T=d(P,2),g=l(T),v=l(g),J=l(v);_e(J,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(a,c)=>{ve();var N=ue();f(()=>w(N,e.shared.label||"Slider")),x(a,N)},$$slots:{default:!0}}),n(v);var z=d(v,2),t=l(z);U(t),R(t,a=>B=a,()=>B);var K=d(t,2);{var W=a=>{var c=be();f(()=>c.disabled=u(_)),i("click",c,H),x(a,c)};se(K,a=>{(e.props.buttons?.includes("reset")??!0)&&a(W)})}n(z),n(g);var A=d(g,2),b=l(A),Y=l(b,!0);n(b);var s=d(b,2);U(s),R(s,a=>m=a,()=>m);var L=d(s,2),ee=l(L,!0);n(L),n(A),n(T),f(()=>{r(v,"for",I),r(t,"aria-label",`number input for ${e.shared.label}`),r(t,"min",e.props.minimum),r(t,"max",e.props.maximum),r(t,"step",e.props.step),t.disabled=u(_),w(Y,u(j)),r(s,"id",I),r(s,"min",e.props.minimum),r(s,"max",e.props.maximum),r(s,"step",e.props.step),s.disabled=u(_),r(s,"aria-label",`range slider for ${e.shared.label}`),w(ee,e.props.maximum)}),O(t,()=>e.props.value,a=>e.props.value=a),i("input",t,M),i("blur",t,D),i("pointerup",t,G),O(s,()=>e.props.value,a=>e.props.value=a),i("input",s,M),i("pointerup",s,G),x(p,o)},$$slots:{default:!0}}),de()}export{Ae as default}; +import{G as ae,g as te,d as R,i as se,r as re,a as r,v as U}from"./i18n-DtG3MAQ1.js";import{M as ie,aa as le,ab as ne,ac as E,Z as u,$ as pe,U as i,N as oe,a4 as ue,t as f,a as x,Q as l,S as d,O as de,G as $,au as me,R as Q,X as w,a2 as y,a5 as ve,T as n}from"./index-BeNBoC9J.js";import{b as O}from"./input-BLFxNjIx.js";import{B as ce}from"./Block-DkzyQHli.js";import{B as _e}from"./BlockTitle-B6Pgijwb.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{S as he}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";let ge=0;var be=Q(''),fe=Q('
        ',1);function Ae(V,k){ie(k,!0);let X=re(k,["$$slots","$$events","$$legacy"]),e=new ae(X);const Z=e.props.value;let S=le(ne(e.props.value)),m,B;const I=`range_id_${ge++}`;let j=y(()=>e.props.minimum??0),q=y(()=>{const p=e.props.minimum,h=e.props.maximum,o=e.props.value;return o>h?100:o{e.props.value==null||!m||(m.style.setProperty("--range_progress",`${u(q)}%`),m.value=e.props.value.toString())});async function C(){await $(),e.dispatch("change")}async function G(p){await $(),e.dispatch("release",e.props.value)}function D(){e.dispatch("release",e.props.value),e.props.value=Math.min(Math.max(e.props.value,e.props.minimum),e.props.maximum)}let _=y(()=>!e.shared.interactive);E(()=>{e.props.value!=u(S)&&(pe(S,e.props.value,!0),C())});function F(){}function H(){e.props.value=Z,e.dispatch("change"),e.dispatch("release",e.props.value)}async function M(){await $(),e.dispatch("input")}i("resize",me,F),ce(V,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(p,h)=>{var o=fe(),P=oe(o);he(P,te({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var T=d(P,2),g=l(T),v=l(g),J=l(v);_e(J,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(a,c)=>{ve();var N=ue();f(()=>w(N,e.shared.label||"Slider")),x(a,N)},$$slots:{default:!0}}),n(v);var z=d(v,2),t=l(z);U(t),R(t,a=>B=a,()=>B);var K=d(t,2);{var W=a=>{var c=be();f(()=>c.disabled=u(_)),i("click",c,H),x(a,c)};se(K,a=>{(e.props.buttons?.includes("reset")??!0)&&a(W)})}n(z),n(g);var A=d(g,2),b=l(A),Y=l(b,!0);n(b);var s=d(b,2);U(s),R(s,a=>m=a,()=>m);var L=d(s,2),ee=l(L,!0);n(L),n(A),n(T),f(()=>{r(v,"for",I),r(t,"aria-label",`number input for ${e.shared.label}`),r(t,"min",e.props.minimum),r(t,"max",e.props.maximum),r(t,"step",e.props.step),t.disabled=u(_),w(Y,u(j)),r(s,"id",I),r(s,"min",e.props.minimum),r(s,"max",e.props.maximum),r(s,"step",e.props.step),s.disabled=u(_),r(s,"aria-label",`range slider for ${e.shared.label}`),w(ee,e.props.maximum)}),O(t,()=>e.props.value,a=>e.props.value=a),i("input",t,M),i("blur",t,D),i("pointerup",t,G),O(s,()=>e.props.value,a=>e.props.value=a),i("input",s,M),i("pointerup",s,G),x(p,o)},$$slots:{default:!0}}),de()}export{Ae as default}; diff --git a/assets/Index-C1l8r8dW.js b/assets/Index-BqcwK0Xk.js similarity index 65% rename from assets/Index-C1l8r8dW.js rename to assets/Index-BqcwK0Xk.js index afa5307597ebf79c63ab22627b9025a4e4c3b083..79f99ba7248c58024d2c227ce27b3f8ea38c22ab 100644 --- a/assets/Index-C1l8r8dW.js +++ b/assets/Index-BqcwK0Xk.js @@ -1 +1 @@ -import{G as g,g as f,i as l,r as b}from"./i18n-CPHyzK9b.js";import{M as v,N as $,Z as k,a as x,S as s,a2 as I,O as w,R as B}from"./index-DydPgVMC.js";import{B as C}from"./Block-WPcVj6Bq.js";import{I as S}from"./Info-DfrMwI06.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as G}from"./IconButtonWrapper-PnNNNvqI.js";import{S as y}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{C as M}from"./Checkbox-Bh_yH8eu.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";import"./input-BtIxlP_B.js";import"./universal-C9tCO36V.js";var N=B(" ",1);function Q(u,o){v(o,!0);let c=b(o,["$$slots","$$events","$$legacy"]);const t=new g(c);C(u,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},children:(d,O)=>{var a=N(),i=$(a);y(i,f({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}));var n=s(i,2);{var m=e=>{G(e,{get buttons(){return t.props.buttons},on_custom_button_click:r=>{t.dispatch("custom_button_click",{id:r})}})};l(n,e=>{t.shared.show_label&&t.props.buttons&&t.props.buttons.length>0&&e(m)})}var p=s(n,2);{let e=I(()=>t.shared.label||t.i18n("checkbox.checkbox"));M(p,{get label(){return k(e)},get interactive(){return t.shared.interactive},get show_label(){return t.shared.show_label},on_change:r=>t.dispatch("change",r),on_input:()=>t.dispatch("input"),on_select:r=>t.dispatch("select",r),get value(){return t.props.value},set value(r){t.props.value=r}})}var _=s(p,2);{var h=e=>{S(e,{get info(){return t.props.info}})};l(_,e=>{t.props.info&&e(h)})}x(d,a)},$$slots:{default:!0}}),w()}export{M as BaseCheckbox,Q as default}; +import{G as g,g as f,i as l,r as b}from"./i18n-DtG3MAQ1.js";import{M as v,N as $,Z as k,a as x,S as s,a2 as I,O as w,R as B}from"./index-BeNBoC9J.js";import{B as C}from"./Block-DkzyQHli.js";import{I as S}from"./Info-BjDIKIgf.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as G}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as y}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{C as M}from"./Checkbox-DdDaw1pY.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";import"./input-BLFxNjIx.js";import"./universal-DqSjxxHG.js";var N=B(" ",1);function Q(u,o){v(o,!0);let c=b(o,["$$slots","$$events","$$legacy"]);const t=new g(c);C(u,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},children:(d,O)=>{var a=N(),i=$(a);y(i,f({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}));var n=s(i,2);{var m=e=>{G(e,{get buttons(){return t.props.buttons},on_custom_button_click:r=>{t.dispatch("custom_button_click",{id:r})}})};l(n,e=>{t.shared.show_label&&t.props.buttons&&t.props.buttons.length>0&&e(m)})}var p=s(n,2);{let e=I(()=>t.shared.label||t.i18n("checkbox.checkbox"));M(p,{get label(){return k(e)},get interactive(){return t.shared.interactive},get show_label(){return t.shared.show_label},on_change:r=>t.dispatch("change",r),on_input:()=>t.dispatch("input"),on_select:r=>t.dispatch("select",r),get value(){return t.props.value},set value(r){t.props.value=r}})}var _=s(p,2);{var h=e=>{S(e,{get info(){return t.props.info}})};l(_,e=>{t.props.info&&e(h)})}x(d,a)},$$slots:{default:!0}}),w()}export{M as BaseCheckbox,Q as default}; diff --git a/assets/Index-BJ4MJC7J.js b/assets/Index-BvkII43l.js similarity index 70% rename from assets/Index-BJ4MJC7J.js rename to assets/Index-BvkII43l.js index 5e5dfe187557386731135f737048ba2323f2f5d1..681e2127144d7e085aa40d0a81aa640930fed52e 100644 --- a/assets/Index-BJ4MJC7J.js +++ b/assets/Index-BvkII43l.js @@ -1 +1 @@ -import{G as y,g as S,d as B,r as M,h as E,b as G}from"./i18n-CPHyzK9b.js";import{M as z,ac as _,G as m,N as L,Z as s,t as F,a as I,S as g,Q as N,a2 as i,O,aa as P,$ as Q,R,T}from"./index-DydPgVMC.js";import{M as Z}from"./Index.svelte_svelte_type_style_lang-C-orki39.js";import{S as j}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as q}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{S as A}from"./ScrollFade-CeVpKVW3.js";import{default as me}from"./Example-DuOJfHh3.js";import"./actions-4RaHFoGI.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./snippet-BtHMuX3s.js";import"./MarkdownCode-BTj729_f.js";import"./html-BZIV6tyB.js";import"./prism-python-BGiTAEDL.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";/* empty css */var C=R('
        ',1);function ue(c,l){z(l,!0);let f=M(l,["$$slots","$$events","$$legacy"]);const e=new y(f);let a,d=P(!1);function o(){e.props.height&&Q(d,E(a?.closest(".block")),!0)}_(()=>{const t=a?.closest(".block");if(!(!t||!e.props.height))return t.addEventListener("scroll",o),m().then(o),()=>t.removeEventListener("scroll",o)}),_(()=>{e.props.value!==void 0&&m().then(o)});{let t=i(()=>e.props.height??void 0),v=i(()=>e.props.min_height??void 0),b=i(()=>e.props.max_height??void 0);q(c,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},allow_overflow:!0,overflow_behavior:"auto",get height(){return s(t)},get min_height(){return s(v)},get max_height(){return s(b)},get rtl(){return e.props.rtl},children:(k,D)=>{var p=C(),u=L(p);j(u,S({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{variant:"center",on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var r=g(u,2);let h;var w=N(r);{let n=i(()=>e.props.buttons?.includes("copy"));Z(w,{get value(){return e.props.value},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get rtl(){return e.props.rtl},onchange:()=>e.dispatch("change"),oncopy:x=>e.dispatch("copy",x),get latex_delimiters(){return e.props.latex_delimiters},get sanitize_html(){return e.props.sanitize_html},get line_breaks(){return e.props.line_breaks},get header_links(){return e.props.header_links},get show_copy_button(){return s(n)},get loading_status(){return e.shared.loading_status},get theme_mode(){return e.shared.theme_mode}})}T(r),B(r,n=>a=n,()=>a);var $=g(r,2);A($,{get visible(){return s(d)}}),F(()=>h=G(r,1,"svelte-ehkka1",null,h,{padding:e.shared.padding,pending:e.shared.loading_status?.status==="pending"&&e.shared.loading_status?.show_progress!=="hidden"})),I(k,p)},$$slots:{default:!0}})}O()}export{me as BaseExample,Z as BaseMarkdown,ue as default}; +import{G as y,g as S,d as B,r as M,h as E,b as G}from"./i18n-DtG3MAQ1.js";import{M as z,ac as _,G as m,N as L,Z as s,t as F,a as I,S as g,Q as N,a2 as i,O,aa as P,$ as Q,R,T}from"./index-BeNBoC9J.js";import{M as Z}from"./Index.svelte_svelte_type_style_lang-CZFWgj20.js";import{S as j}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as q}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{S as A}from"./ScrollFade-G27WKZg6.js";import{default as me}from"./Example-DOrirSD_.js";import"./actions-BbCJS635.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./snippet-BRIBYCwB.js";import"./MarkdownCode-QLelNkfo.js";import"./html-DE4EmiOG.js";import"./prism-python-DV2ZTlpc.js";import"./index-B_pwUImq.js";import"./Clear-BiKSVifk.js";/* empty css */var C=R('
        ',1);function ue(c,l){z(l,!0);let f=M(l,["$$slots","$$events","$$legacy"]);const e=new y(f);let a,d=P(!1);function o(){e.props.height&&Q(d,E(a?.closest(".block")),!0)}_(()=>{const t=a?.closest(".block");if(!(!t||!e.props.height))return t.addEventListener("scroll",o),m().then(o),()=>t.removeEventListener("scroll",o)}),_(()=>{e.props.value!==void 0&&m().then(o)});{let t=i(()=>e.props.height??void 0),v=i(()=>e.props.min_height??void 0),b=i(()=>e.props.max_height??void 0);q(c,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},allow_overflow:!0,overflow_behavior:"auto",get height(){return s(t)},get min_height(){return s(v)},get max_height(){return s(b)},get rtl(){return e.props.rtl},children:(k,D)=>{var p=C(),u=L(p);j(u,S({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{variant:"center",on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var r=g(u,2);let h;var w=N(r);{let n=i(()=>e.props.buttons?.includes("copy"));Z(w,{get value(){return e.props.value},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get rtl(){return e.props.rtl},onchange:()=>e.dispatch("change"),oncopy:x=>e.dispatch("copy",x),get latex_delimiters(){return e.props.latex_delimiters},get sanitize_html(){return e.props.sanitize_html},get line_breaks(){return e.props.line_breaks},get header_links(){return e.props.header_links},get show_copy_button(){return s(n)},get loading_status(){return e.shared.loading_status},get theme_mode(){return e.shared.theme_mode}})}T(r),B(r,n=>a=n,()=>a);var $=g(r,2);A($,{get visible(){return s(d)}}),F(()=>h=G(r,1,"svelte-ehkka1",null,h,{padding:e.shared.padding,pending:e.shared.loading_status?.status==="pending"&&e.shared.loading_status?.show_progress!=="hidden"})),I(k,p)},$$slots:{default:!0}})}O()}export{me as BaseExample,Z as BaseMarkdown,ue as default}; diff --git a/assets/Index-CXTNaUIU.js b/assets/Index-C-kCUaSy.js similarity index 78% rename from assets/Index-CXTNaUIU.js rename to assets/Index-C-kCUaSy.js index 612ff00bdf73aab7feeca89afa958afc4133b77e..e7852d003e768e11867f09aca2e137678e997c57 100644 --- a/assets/Index-CXTNaUIU.js +++ b/assets/Index-C-kCUaSy.js @@ -1 +1 @@ -import{G as W,g as X,i as y,r as Z,b as B,a as s,v as j}from"./i18n-CPHyzK9b.js";import{M as q,aa as z,ab as A,ac as C,Z as G,$ as F,N as I,t as d,a as u,U as o,S as l,O as H,Q as N,R as c,G as J,X as S,a2 as K,a5 as L,T as P}from"./index-DydPgVMC.js";import{b as V}from"./input-BtIxlP_B.js";import{B as Y}from"./Block-WPcVj6Bq.js";import{B as ee}from"./BlockTitle-DNiCHWOR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as ae}from"./IconButtonWrapper-PnNNNvqI.js";import{S as te}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";var se=c('
        '),re=c(" ",1),oe=c(' ',1);function ke(T,_){q(_,!0);const D=Z(_,["$$slots","$$events","$$legacy"]),e=new W(D);e.props.value??=0;let m=z(A(e.props.value));C(()=>{G(m)!=e.props.value&&(F(m,e.props.value,!0),e.dispatch("change"))});async function E(r){await J(),r.key==="Enter"&&(r.preventDefault(),e.dispatch("submit"))}const M=K(()=>!e.shared.interactive);Y(T,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get padding(){return e.shared.container},allow_overflow:!1,get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(r,le)=>{var v=oe(),h=I(v);te(h,X({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>{e.dispatch("clear_status",e.shared.loading_status)}}));var i=l(h,2);let f;var b=N(i);{var O=t=>{ae(t,{get buttons(){return e.props.buttons},on_custom_button_click:k=>{e.dispatch("custom_button_click",{id:k})}})};y(b,t=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&t(O)})}var g=l(b,2);ee(g,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(t,k)=>{L();var w=re(),x=I(w),Q=l(x);{var R=n=>{var p=se(),U=N(p,!0);P(p),d(()=>S(U,e.shared.loading_status?.validation_error)),u(n,p)};y(Q,n=>{e.shared.loading_status?.validation_error&&n(R)})}d(()=>S(x,`${(e.shared.label||"Number")??""} `)),u(t,w)},$$slots:{default:!0}});var a=l(g,2);j(a);let $;P(i),d(()=>{f=B(i,1,"block svelte-1lh6opl",null,f,{container:e.shared.container}),s(a,"aria-label",e.shared.label||"Number"),s(a,"min",e.props.minimum),s(a,"max",e.props.maximum),s(a,"step",e.props.step),s(a,"placeholder",e.props.placeholder),a.disabled=G(M),$=B(a,1,"svelte-1lh6opl",null,$,{"validation-error":e.shared.loading_status?.validation_error})}),V(a,()=>e.props.value,t=>e.props.value=t),o("keypress",a,E),o("input",a,()=>e.dispatch("input")),o("blur",a,()=>e.dispatch("blur")),o("focus",a,()=>e.dispatch("focus")),u(r,v)},$$slots:{default:!0}}),H()}export{ke as default}; +import{G as W,g as X,i as y,r as Z,b as B,a as s,v as j}from"./i18n-DtG3MAQ1.js";import{M as q,aa as z,ab as A,ac as C,Z as G,$ as F,N as I,t as d,a as u,U as o,S as l,O as H,Q as N,R as c,G as J,X as S,a2 as K,a5 as L,T as P}from"./index-BeNBoC9J.js";import{b as V}from"./input-BLFxNjIx.js";import{B as Y}from"./Block-DkzyQHli.js";import{B as ee}from"./BlockTitle-B6Pgijwb.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as ae}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as te}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";var se=c('
        '),re=c(" ",1),oe=c(' ',1);function ke(T,_){q(_,!0);const D=Z(_,["$$slots","$$events","$$legacy"]),e=new W(D);e.props.value??=0;let m=z(A(e.props.value));C(()=>{G(m)!=e.props.value&&(F(m,e.props.value,!0),e.dispatch("change"))});async function E(r){await J(),r.key==="Enter"&&(r.preventDefault(),e.dispatch("submit"))}const M=K(()=>!e.shared.interactive);Y(T,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get padding(){return e.shared.container},allow_overflow:!1,get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(r,le)=>{var v=oe(),h=I(v);te(h,X({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>{e.dispatch("clear_status",e.shared.loading_status)}}));var i=l(h,2);let f;var b=N(i);{var O=t=>{ae(t,{get buttons(){return e.props.buttons},on_custom_button_click:k=>{e.dispatch("custom_button_click",{id:k})}})};y(b,t=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&t(O)})}var g=l(b,2);ee(g,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(t,k)=>{L();var w=re(),x=I(w),Q=l(x);{var R=n=>{var p=se(),U=N(p,!0);P(p),d(()=>S(U,e.shared.loading_status?.validation_error)),u(n,p)};y(Q,n=>{e.shared.loading_status?.validation_error&&n(R)})}d(()=>S(x,`${(e.shared.label||"Number")??""} `)),u(t,w)},$$slots:{default:!0}});var a=l(g,2);j(a);let $;P(i),d(()=>{f=B(i,1,"block svelte-1lh6opl",null,f,{container:e.shared.container}),s(a,"aria-label",e.shared.label||"Number"),s(a,"min",e.props.minimum),s(a,"max",e.props.maximum),s(a,"step",e.props.step),s(a,"placeholder",e.props.placeholder),a.disabled=G(M),$=B(a,1,"svelte-1lh6opl",null,$,{"validation-error":e.shared.loading_status?.validation_error})}),V(a,()=>e.props.value,t=>e.props.value=t),o("keypress",a,E),o("input",a,()=>e.dispatch("input")),o("blur",a,()=>e.dispatch("blur")),o("focus",a,()=>e.dispatch("focus")),u(r,v)},$$slots:{default:!0}}),H()}export{ke as default}; diff --git a/assets/Index-BCvXC7_h.js b/assets/Index-C5-FMz1o.js similarity index 84% rename from assets/Index-BCvXC7_h.js rename to assets/Index-C5-FMz1o.js index fb446e7d266dc3ff84f595204d869b54322ce4f2..64e56e9209f9ab1bc70b84cc4025947f4a34357e 100644 --- a/assets/Index-BCvXC7_h.js +++ b/assets/Index-C5-FMz1o.js @@ -1 +1 @@ -import{G as N,i as b,g as T,z as w,b as j,f as z,r as A}from"./i18n-CPHyzK9b.js";import{M as C,aa as G,ab as H,ac as J,Z as n,$ as O,N as Q,t as R,a as U,S as p,Q as W,a2 as u,O as Z,as as q,R as D,T as F}from"./index-DydPgVMC.js";import K from"./HTML-Bcdz-vxU.js";import{S as P}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as V}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as X}from"./BlockLabel-BzVeVrtL.js";import{C as Y}from"./Code-D1inKIZZ.js";import{I as ee}from"./IconButtonWrapper-PnNNNvqI.js";import{default as we}from"./Example-q7qW2djY.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var te=D("
        ",1);function ge(y,d){C(d,!0);let $=A(d,["$$slots","$$events","$$legacy"]),x=d.children;const e=new N($);let k=u(()=>({value:e.props.value??"",label:e.shared.label,visible:e.shared.visible,...e.props.props})),h=G(H(e.props.value));J(()=>{JSON.stringify(n(h))!==JSON.stringify(e.props.value)&&(O(h,e.props.value,!0),e.dispatch("change"))});let c=[];function B(l,t){const a=Array.isArray(l)?l:[l];c.push({props:a,callback:t})}function S(l){const t=new Set;for(const a of c)a.props.some(o=>l.includes(o))&&t.add(a);for(const a of t)try{a.callback()}catch(o){console.error("Error in watch callback:",o)}}async function E(l){try{const t=await q([l]),a=await e.shared.client.upload(t,e.shared.root,void 0,e.shared.max_file_size??void 0);if(a&&a[0])return{path:a[0].path,url:a[0].url};throw new Error("Upload failed")}catch(t){throw e.dispatch("error",t instanceof Error?t.message:String(t)),t}}{let l=u(()=>e.props.padding!==!1);V(y,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get padding(){return n(l)},overflow_behavior:"visible",children:(t,a)=>{var o=te(),_=Q(o);{var I=r=>{ee(r,{get buttons(){return e.props.buttons},on_custom_button_click:s=>{e.dispatch("custom_button_click",{id:s})}})};b(_,r=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&r(I)})}var f=p(_,2);{var L=r=>{X(r,{get Icon(){return Y},get show_label(){return e.shared.show_label},get label(){return e.shared.label},float:!0})};b(f,r=>{e.shared.show_label&&r(L)})}var m=p(f,2);P(m,T({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{variant:"center",on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var i=p(m,2);let g,v;var M=W(i);{let r=u(()=>e.shared.visible==="hidden"?!1:e.shared.visible);K(M,{get props(){return n(k)},get html_template(){return e.props.html_template},get css_template(){return e.props.css_template},get js_on_load(){return e.props.js_on_load},get elem_classes(){return e.shared.elem_classes},get visible(){return n(r)},get autoscroll(){return e.shared.autoscroll},get apply_default_css(){return e.props.apply_default_css},get head(){return e.props.head},get component_class_name(){return e.props.component_class_name},upload:E,get server(){return e.shared.server},watch_fn:B,fire_watchers:S,$$events:{event:s=>{e.dispatch(s.detail.type,s.detail.data)},update_value:s=>{s.detail.property==="value"?e.props.value=s.detail.data:s.detail.property==="label"?e.shared.label=s.detail.data:s.detail.property==="visible"&&(e.shared.visible=s.detail.data)}},children:(s,se)=>{x?.(s)},$$slots:{default:!0}})}F(i),R(r=>{g=j(i,1,"html-container svelte-1lkxah1",null,g,{pending:e.shared.loading_status?.status==="pending"&&e.shared.loading_status?.show_progress!=="hidden","label-padding":e.shared.show_label??void 0}),v=z(i,"",v,r)},[()=>({"min-height":e.props.min_height&&e.shared.loading_status?.status!=="pending"?w(e.props.min_height):void 0,"max-height":e.props.max_height?w(e.props.max_height):void 0,"overflow-y":e.props.max_height?"auto":void 0})]),U(t,o)},$$slots:{default:!0}})}Z()}export{we as BaseExample,K as BaseHTML,ge as default}; +import{G as N,i as b,g as T,z as w,b as j,f as z,r as A}from"./i18n-DtG3MAQ1.js";import{M as C,aa as G,ab as H,ac as J,Z as n,$ as O,N as Q,t as R,a as U,S as p,Q as W,a2 as u,O as Z,as as q,R as D,T as F}from"./index-BeNBoC9J.js";import K from"./HTML-BMuhpYGf.js";import{S as P}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{B as V}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as X}from"./BlockLabel-CEOjqpu7.js";import{C as Y}from"./Code-B0D7Zxt1.js";import{I as ee}from"./IconButtonWrapper-Ce5bzAyh.js";import{default as we}from"./Example-C8kkgkoI.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var te=D("
        ",1);function ge(y,d){C(d,!0);let $=A(d,["$$slots","$$events","$$legacy"]),x=d.children;const e=new N($);let k=u(()=>({value:e.props.value??"",label:e.shared.label,visible:e.shared.visible,...e.props.props})),h=G(H(e.props.value));J(()=>{JSON.stringify(n(h))!==JSON.stringify(e.props.value)&&(O(h,e.props.value,!0),e.dispatch("change"))});let c=[];function B(l,t){const a=Array.isArray(l)?l:[l];c.push({props:a,callback:t})}function S(l){const t=new Set;for(const a of c)a.props.some(o=>l.includes(o))&&t.add(a);for(const a of t)try{a.callback()}catch(o){console.error("Error in watch callback:",o)}}async function E(l){try{const t=await q([l]),a=await e.shared.client.upload(t,e.shared.root,void 0,e.shared.max_file_size??void 0);if(a&&a[0])return{path:a[0].path,url:a[0].url};throw new Error("Upload failed")}catch(t){throw e.dispatch("error",t instanceof Error?t.message:String(t)),t}}{let l=u(()=>e.props.padding!==!1);V(y,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get padding(){return n(l)},overflow_behavior:"visible",children:(t,a)=>{var o=te(),_=Q(o);{var I=r=>{ee(r,{get buttons(){return e.props.buttons},on_custom_button_click:s=>{e.dispatch("custom_button_click",{id:s})}})};b(_,r=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&r(I)})}var f=p(_,2);{var L=r=>{X(r,{get Icon(){return Y},get show_label(){return e.shared.show_label},get label(){return e.shared.label},float:!0})};b(f,r=>{e.shared.show_label&&r(L)})}var m=p(f,2);P(m,T({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{variant:"center",on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var i=p(m,2);let g,v;var M=W(i);{let r=u(()=>e.shared.visible==="hidden"?!1:e.shared.visible);K(M,{get props(){return n(k)},get html_template(){return e.props.html_template},get css_template(){return e.props.css_template},get js_on_load(){return e.props.js_on_load},get elem_classes(){return e.shared.elem_classes},get visible(){return n(r)},get autoscroll(){return e.shared.autoscroll},get apply_default_css(){return e.props.apply_default_css},get head(){return e.props.head},get component_class_name(){return e.props.component_class_name},upload:E,get server(){return e.shared.server},watch_fn:B,fire_watchers:S,$$events:{event:s=>{e.dispatch(s.detail.type,s.detail.data)},update_value:s=>{s.detail.property==="value"?e.props.value=s.detail.data:s.detail.property==="label"?e.shared.label=s.detail.data:s.detail.property==="visible"&&(e.shared.visible=s.detail.data)}},children:(s,se)=>{x?.(s)},$$slots:{default:!0}})}F(i),R(r=>{g=j(i,1,"html-container svelte-1lkxah1",null,g,{pending:e.shared.loading_status?.status==="pending"&&e.shared.loading_status?.show_progress!=="hidden","label-padding":e.shared.show_label??void 0}),v=z(i,"",v,r)},[()=>({"min-height":e.props.min_height&&e.shared.loading_status?.status!=="pending"?w(e.props.min_height):void 0,"max-height":e.props.max_height?w(e.props.max_height):void 0,"overflow-y":e.props.max_height?"auto":void 0})]),U(t,o)},$$slots:{default:!0}})}Z()}export{we as BaseExample,K as BaseHTML,ge as default}; diff --git a/assets/Index-DHTKmW0i.js b/assets/Index-C5t7Fjwy.js similarity index 71% rename from assets/Index-DHTKmW0i.js rename to assets/Index-C5t7Fjwy.js index cddc8476b41e60dafa7ba364519d0916db247a20..5b70d1bf59eae01d106d3a948758a81126c25882 100644 --- a/assets/Index-DHTKmW0i.js +++ b/assets/Index-C5t7Fjwy.js @@ -1 +1 @@ -import{G as w,i as $,g as S,r as k}from"./i18n-CPHyzK9b.js";import{M as x,aa as u,ab as y,ac as B,Z as a,$ as d,N as J,a as N,S as h,a2 as _,O,R as G,Q as I,T as j}from"./index-DydPgVMC.js";import{b as z}from"./size-D4lmUoTq.js";import{J as H,a as L}from"./JSON-DVsUg528.js";import{B as M}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as P}from"./BlockLabel-BzVeVrtL.js";import{S as Q}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./Empty-B15ItVsj.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var R=G("
        ",1);function ae(m,o){x(o,!0);const g=k(o,["$$slots","$$events","$$legacy"]),e=new w(g);let i=u(y(e.props.value));B(()=>{a(i)!==e.props.value&&(d(i,e.props.value,!0),e.dispatch("change"))});let l=u(0);M(m,{get visible(){return e.shared.visible},test_id:"json",get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},padding:!1,allow_overflow:!0,overflow_behavior:"auto",get height(){return e.props.height},get min_height(){return e.props.min_height},get max_height(){return e.props.max_height},children:(c,T)=>{var n=R(),s=J(n),f=I(s);{var b=t=>{{let r=_(()=>e.shared.container===!1);P(t,{get Icon(){return L},get show_label(){return e.shared.show_label},get label(){return e.shared.label},float:!1,get disable(){return a(r)}})}};$(f,t=>{e.shared.label&&t(b)})}j(s);var p=h(s,2);Q(p,S({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var v=h(p,2);{let t=_(()=>e.props.buttons==null?!0:e.props.buttons.some(r=>typeof r=="string"&&r==="copy"));H(v,{get value(){return e.props.value},get open(){return e.props.open},get theme_mode(){return e.props.theme_mode},get show_indices(){return e.props.show_indices},get show_copy_button(){return a(t)},get buttons(){return e.props.buttons},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},get label_height(){return a(l)}})}z(s,"clientHeight",t=>d(l,t)),N(c,n)},$$slots:{default:!0}}),O()}export{H as BaseJSON,ae as default}; +import{G as w,i as $,g as S,r as k}from"./i18n-DtG3MAQ1.js";import{M as x,aa as u,ab as y,ac as B,Z as a,$ as d,N as J,a as N,S as h,a2 as _,O,R as G,Q as I,T as j}from"./index-BeNBoC9J.js";import{b as z}from"./size-ChvveZyb.js";import{J as H,a as L}from"./JSON-BMd6yQaN.js";import{B as M}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as P}from"./BlockLabel-CEOjqpu7.js";import{S as Q}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./Empty-Clj0ErcW.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var R=G("
        ",1);function ae(m,o){x(o,!0);const g=k(o,["$$slots","$$events","$$legacy"]),e=new w(g);let i=u(y(e.props.value));B(()=>{a(i)!==e.props.value&&(d(i,e.props.value,!0),e.dispatch("change"))});let l=u(0);M(m,{get visible(){return e.shared.visible},test_id:"json",get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},padding:!1,allow_overflow:!0,overflow_behavior:"auto",get height(){return e.props.height},get min_height(){return e.props.min_height},get max_height(){return e.props.max_height},children:(c,T)=>{var n=R(),s=J(n),f=I(s);{var b=t=>{{let r=_(()=>e.shared.container===!1);P(t,{get Icon(){return L},get show_label(){return e.shared.show_label},get label(){return e.shared.label},float:!1,get disable(){return a(r)}})}};$(f,t=>{e.shared.label&&t(b)})}j(s);var p=h(s,2);Q(p,S({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var v=h(p,2);{let t=_(()=>e.props.buttons==null?!0:e.props.buttons.some(r=>typeof r=="string"&&r==="copy"));H(v,{get value(){return e.props.value},get open(){return e.props.open},get theme_mode(){return e.props.theme_mode},get show_indices(){return e.props.show_indices},get show_copy_button(){return a(t)},get buttons(){return e.props.buttons},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},get label_height(){return a(l)}})}z(s,"clientHeight",t=>d(l,t)),N(c,n)},$$slots:{default:!0}}),O()}export{H as BaseJSON,ae as default}; diff --git a/assets/Index-D7qviIOH.js b/assets/Index-CG9vArNj.js similarity index 90% rename from assets/Index-D7qviIOH.js rename to assets/Index-CG9vArNj.js index 5b335f02b755ece39d23a90b8316e1af41ba770f..40a754c1132c1e5a0f838531f98994aa264eadb6 100644 --- a/assets/Index-D7qviIOH.js +++ b/assets/Index-CG9vArNj.js @@ -1 +1 @@ -import{i as M,q as Be,d as De,b as j,a as x,w as Me,v as Oe,G as Ee,g as Ie,r as Ae}from"./i18n-CPHyzK9b.js";import{a as f,f as Se,av as Ge,M as ue,aa as C,ab as Pe,ac as Re,Z as t,$ as a,a4 as F,t as D,U as w,O as pe,a2 as d,S as y,Q as m,R as O,ar as ie,X as H,a5 as Te,T as h,N as de}from"./index-DydPgVMC.js";import{b as qe}from"./input-BtIxlP_B.js";import{p as ze}from"./event-modifiers-CdEA5IGF.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as Le}from"./BlockTitle-DNiCHWOR.js";import{D as Ne}from"./DropdownArrow-Cq3QAKSv.js";import{I as Qe}from"./IconButtonWrapper-PnNNNvqI.js";import{D as Ue,h as We,a as Xe,b as Ze}from"./Dropdown-CVRP4i7q.js";import{B as je}from"./Block-WPcVj6Bq.js";import{S as Ce}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{default as $t}from"./Example-BGlyl4O8.js";import"./snippet-BtHMuX3s.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./window-D5YXrKnH.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";/* empty css */var Fe=Se('');function ce(E){var k=Fe();f(E,k)}var He=O('
        '),Je=O('
        '),Ke=O('
        '),Ve=O(' ',1),Ye=O('
        ');function et(E,k){const L=Ge();ue(k,!0);const e=k.gradio;let I,o=C(""),A=d(()=>e.shared.label||"Multiselect");const $=`${L}-options`;let B=d(()=>e.props.buttons),S=d(()=>e.props.choices.map(([r,s])=>[e.live_i18n(r),s])),R=d(()=>t(S).map(r=>r[0])),b=d(()=>e.props.choices.map(r=>r[1])),_=d(()=>!e.shared.interactive),l=C(!1),_e=d(()=>{const r=Xe(t(S),t(o));return[r,r.length>0&&!e.props.allow_custom_value?r[0]:null]}),J=d(()=>ie(t(_e),2)),N=d(()=>t(J)[0]),v=d(()=>t(J)[1]);function ve(){return e.props.value===void 0?[]:Array.isArray(e.props.value)?e.props.value.map(r=>{const s=t(b).indexOf(r);if(s!==-1)return s;if(e.props.allow_custom_value)return r}).filter(r=>r!==void 0):[]}let i=d(ve);function fe(){e.props.allow_custom_value||a(o,""),e.props.allow_custom_value&&t(o)!==""&&(U(t(o)),a(o,"")),e.dispatch("blur"),a(l,!1),a(v,null)}function Q(r){a(i,t(i).filter(s=>s!==r)),e.props.value=t(i).map(s=>typeof s=="number"?t(b)[s]:s),e.dispatch("input"),e.dispatch("select",{index:typeof r=="number"?r:-1,value:typeof r=="number"?t(b)[r]:r,selected:!1})}function U(r){(e.props.max_choices==null||t(i).lengthtypeof s=="number"?t(b)[s]:s)}function me(r){const s=parseInt(r);K(s)}function K(r){t(i).includes(r)?Q(r):U(r),a(o,""),a(v,null),e.dispatch("input")}function V(r){a(i,[]),a(o,""),e.props.value=[],r.preventDefault()}function he(r){a(N,e.props.choices.map((s,n)=>n)),(e.props.max_choices===null||t(i).length{var n=ie(s,2);a(l,n[0],!0),a(v,n[1])})(We(r,t(v),t(N))),r.key==="Enter"&&(t(v)!==null?K(t(v)):e.props.allow_custom_value&&(U(t(o)),a(o,""))),r.key==="Backspace"&&t(o)===""){const s=t(i).slice(0,-1);e.props.value=s.map(n=>typeof n=="number"?t(b)[n]:n)}t(i).length===e.props.max_choices&&(a(l,!1),a(v,null))}let Y=C(Pe(e.props.value));Re(()=>{t(Y)!==e.props.value&&(a(Y,e.props.value,!0),e.dispatch("change"))});function ge(r){e.dispatch("custom_button_click",{id:r})}var T=Ye();let ee;var te=m(T);{var we=r=>{Qe(r,{get buttons(){return t(B)},on_custom_button_click:ge})};M(te,r=>{e.shared.show_label&&t(B)&&t(B).length>0&&r(we)})}var re=y(te,2);Le(re,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(r,s)=>{Te();var n=F();D(()=>H(n,t(A))),f(r,n)},$$slots:{default:!0}});var se=y(re,2),q=m(se);let ae;var oe=m(q);Be(oe,17,()=>t(i),Me,(r,s)=>{var n=Je(),G=m(n),z=m(G);{var W=u=>{var p=F();D(()=>H(p,t(R)[t(s)])),f(u,p)},P=u=>{var p=F();D(()=>H(p,t(s))),f(u,p)};M(z,u=>{typeof t(s)=="number"?u(W):u(P,!1)})}h(G);var g=y(G,2);{var X=u=>{var p=He(),$e=m(p);ce($e),h(p),D(Z=>x(p,"title",Z),[()=>e.i18n("common.remove")+" "+t(s)]),w("click",p,ze(()=>Q(t(s)))),w("keydown",p,Z=>{Z.key==="Enter"&&Q(t(s))}),f(u,p)};M(g,u=>{t(_)||u(X)})}h(n),f(r,n)});var le=y(oe,2),c=m(le);Oe(c);let ne;De(c,r=>I=r,()=>I);var ye=y(c,2);{var ke=r=>{var s=Ve(),n=de(s);{var G=P=>{var g=Ke(),X=m(g);ce(X),h(g),D(u=>x(g,"title",u),[()=>e.i18n("common.clear")]),w("click",g,V),w("keydown",g,u=>{u.key==="Enter"&&V(u)}),f(P,g)};M(n,P=>{t(i).length>0&&P(G)})}var z=y(n,2),W=m(z);Ne(W),h(z),f(r,s)};M(ye,r=>{t(_)||r(ke)})}h(le),h(q);var xe=y(q,2);Ue(xe,{get show_options(){return t(l)},get choices(){return t(S)},get filtered_indices(){return t(N)},get disabled(){return t(_)},get selected_indices(){return t(i)},get active_index(){return t(v)},get listbox_id(){return $},remember_scroll:!0,onchange:me}),h(se),h(T),D(r=>{ee=j(T,1,"svelte-rnbsew",null,ee,{container:e.shared.container}),ae=j(q,1,"wrap-inner svelte-rnbsew",null,ae,{show_options:t(l)}),x(c,"aria-controls",$),x(c,"aria-expanded",t(l)),x(c,"aria-activedescendant",t(l)&&t(v)!==null?`${$}-option-${t(v)}`:void 0),x(c,"aria-autocomplete",e.props.filterable?"list":"none"),x(c,"aria-label",t(A)),ne=j(c,1,"border-none svelte-rnbsew",null,ne,r),c.disabled=t(_),c.readOnly=!e.props.filterable},[()=>({subdued:!t(R).includes(t(o))&&!e.props.allow_custom_value||t(i).length===e.props.max_choices})]),qe(c,()=>t(o),r=>a(o,r)),w("keydown",c,be),w("keyup",c,r=>{e.dispatch("key_up",{key:r.key,input_value:t(o)})}),w("blur",c,fe),w("focus",c,he),f(E,T),pe()}var tt=O(" ",1);function yt(E,k){ue(k,!0);let L=Ae(k,["$$slots","$$events","$$legacy"]);const e=new Ee(L);let I=d(()=>e.props.choices.map(([o,A])=>[e.live_i18n(o),A]));je(E,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get padding(){return e.shared.container},allow_overflow:!1,get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(o,A)=>{var $=tt(),B=de($);Ce(B,Ie({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var S=y(B,2);{var R=_=>{et(_,{get gradio(){return e}})},b=_=>{Ze(_,{get label(){return e.shared.label},get info(){return e.props.info},get choices(){return t(I)},get interactive(){return e.shared.interactive},get show_label(){return e.shared.show_label},get container(){return e.shared.container},get allow_custom_value(){return e.props.allow_custom_value},get filterable(){return e.props.filterable},get buttons(){return e.props.buttons},oncustom_button_click:l=>{e.dispatch("custom_button_click",{id:l})},on_change:()=>e.dispatch("change"),on_input:()=>e.dispatch("input"),on_select:l=>e.dispatch("select",l),on_focus:()=>e.dispatch("focus"),on_blur:()=>e.dispatch("blur"),on_key_up:l=>e.dispatch("key_up",l),get value(){return e.props.value},set value(l){e.props.value=l}})};M(S,_=>{e.props.multiselect?_(R):_(b,!1)})}f(o,$)},$$slots:{default:!0}}),pe()}export{Ze as BaseDropdown,Ue as BaseDropdownOptions,$t as BaseExample,et as BaseMultiselect,yt as default}; +import{i as M,q as Be,d as De,b as j,a as x,w as Me,v as Oe,G as Ee,g as Ie,r as Ae}from"./i18n-DtG3MAQ1.js";import{a as f,f as Se,av as Ge,M as ue,aa as C,ab as Pe,ac as Re,Z as t,$ as a,a4 as F,t as D,U as w,O as pe,a2 as d,S as y,Q as m,R as O,ar as ie,X as H,a5 as Te,T as h,N as de}from"./index-BeNBoC9J.js";import{b as qe}from"./input-BLFxNjIx.js";import{p as ze}from"./event-modifiers-CdEA5IGF.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as Le}from"./BlockTitle-B6Pgijwb.js";import{D as Ne}from"./DropdownArrow-C0w6FgSo.js";import{I as Qe}from"./IconButtonWrapper-Ce5bzAyh.js";import{D as Ue,h as We,a as Xe,b as Ze}from"./Dropdown-D5-31HWl.js";import{B as je}from"./Block-DkzyQHli.js";import{S as Ce}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as $t}from"./Example-BFvndbmT.js";import"./snippet-BRIBYCwB.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./window-ChwzOWAi.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";/* empty css */var Fe=Se('');function ce(E){var k=Fe();f(E,k)}var He=O('
        '),Je=O('
        '),Ke=O('
        '),Ve=O(' ',1),Ye=O('
        ');function et(E,k){const L=Ge();ue(k,!0);const e=k.gradio;let I,o=C(""),A=d(()=>e.shared.label||"Multiselect");const $=`${L}-options`;let B=d(()=>e.props.buttons),S=d(()=>e.props.choices.map(([r,s])=>[e.live_i18n(r),s])),R=d(()=>t(S).map(r=>r[0])),b=d(()=>e.props.choices.map(r=>r[1])),_=d(()=>!e.shared.interactive),l=C(!1),_e=d(()=>{const r=Xe(t(S),t(o));return[r,r.length>0&&!e.props.allow_custom_value?r[0]:null]}),J=d(()=>ie(t(_e),2)),N=d(()=>t(J)[0]),v=d(()=>t(J)[1]);function ve(){return e.props.value===void 0?[]:Array.isArray(e.props.value)?e.props.value.map(r=>{const s=t(b).indexOf(r);if(s!==-1)return s;if(e.props.allow_custom_value)return r}).filter(r=>r!==void 0):[]}let i=d(ve);function fe(){e.props.allow_custom_value||a(o,""),e.props.allow_custom_value&&t(o)!==""&&(U(t(o)),a(o,"")),e.dispatch("blur"),a(l,!1),a(v,null)}function Q(r){a(i,t(i).filter(s=>s!==r)),e.props.value=t(i).map(s=>typeof s=="number"?t(b)[s]:s),e.dispatch("input"),e.dispatch("select",{index:typeof r=="number"?r:-1,value:typeof r=="number"?t(b)[r]:r,selected:!1})}function U(r){(e.props.max_choices==null||t(i).lengthtypeof s=="number"?t(b)[s]:s)}function me(r){const s=parseInt(r);K(s)}function K(r){t(i).includes(r)?Q(r):U(r),a(o,""),a(v,null),e.dispatch("input")}function V(r){a(i,[]),a(o,""),e.props.value=[],r.preventDefault()}function he(r){a(N,e.props.choices.map((s,n)=>n)),(e.props.max_choices===null||t(i).length{var n=ie(s,2);a(l,n[0],!0),a(v,n[1])})(We(r,t(v),t(N))),r.key==="Enter"&&(t(v)!==null?K(t(v)):e.props.allow_custom_value&&(U(t(o)),a(o,""))),r.key==="Backspace"&&t(o)===""){const s=t(i).slice(0,-1);e.props.value=s.map(n=>typeof n=="number"?t(b)[n]:n)}t(i).length===e.props.max_choices&&(a(l,!1),a(v,null))}let Y=C(Pe(e.props.value));Re(()=>{t(Y)!==e.props.value&&(a(Y,e.props.value,!0),e.dispatch("change"))});function ge(r){e.dispatch("custom_button_click",{id:r})}var T=Ye();let ee;var te=m(T);{var we=r=>{Qe(r,{get buttons(){return t(B)},on_custom_button_click:ge})};M(te,r=>{e.shared.show_label&&t(B)&&t(B).length>0&&r(we)})}var re=y(te,2);Le(re,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(r,s)=>{Te();var n=F();D(()=>H(n,t(A))),f(r,n)},$$slots:{default:!0}});var se=y(re,2),q=m(se);let ae;var oe=m(q);Be(oe,17,()=>t(i),Me,(r,s)=>{var n=Je(),G=m(n),z=m(G);{var W=u=>{var p=F();D(()=>H(p,t(R)[t(s)])),f(u,p)},P=u=>{var p=F();D(()=>H(p,t(s))),f(u,p)};M(z,u=>{typeof t(s)=="number"?u(W):u(P,!1)})}h(G);var g=y(G,2);{var X=u=>{var p=He(),$e=m(p);ce($e),h(p),D(Z=>x(p,"title",Z),[()=>e.i18n("common.remove")+" "+t(s)]),w("click",p,ze(()=>Q(t(s)))),w("keydown",p,Z=>{Z.key==="Enter"&&Q(t(s))}),f(u,p)};M(g,u=>{t(_)||u(X)})}h(n),f(r,n)});var le=y(oe,2),c=m(le);Oe(c);let ne;De(c,r=>I=r,()=>I);var ye=y(c,2);{var ke=r=>{var s=Ve(),n=de(s);{var G=P=>{var g=Ke(),X=m(g);ce(X),h(g),D(u=>x(g,"title",u),[()=>e.i18n("common.clear")]),w("click",g,V),w("keydown",g,u=>{u.key==="Enter"&&V(u)}),f(P,g)};M(n,P=>{t(i).length>0&&P(G)})}var z=y(n,2),W=m(z);Ne(W),h(z),f(r,s)};M(ye,r=>{t(_)||r(ke)})}h(le),h(q);var xe=y(q,2);Ue(xe,{get show_options(){return t(l)},get choices(){return t(S)},get filtered_indices(){return t(N)},get disabled(){return t(_)},get selected_indices(){return t(i)},get active_index(){return t(v)},get listbox_id(){return $},remember_scroll:!0,onchange:me}),h(se),h(T),D(r=>{ee=j(T,1,"svelte-rnbsew",null,ee,{container:e.shared.container}),ae=j(q,1,"wrap-inner svelte-rnbsew",null,ae,{show_options:t(l)}),x(c,"aria-controls",$),x(c,"aria-expanded",t(l)),x(c,"aria-activedescendant",t(l)&&t(v)!==null?`${$}-option-${t(v)}`:void 0),x(c,"aria-autocomplete",e.props.filterable?"list":"none"),x(c,"aria-label",t(A)),ne=j(c,1,"border-none svelte-rnbsew",null,ne,r),c.disabled=t(_),c.readOnly=!e.props.filterable},[()=>({subdued:!t(R).includes(t(o))&&!e.props.allow_custom_value||t(i).length===e.props.max_choices})]),qe(c,()=>t(o),r=>a(o,r)),w("keydown",c,be),w("keyup",c,r=>{e.dispatch("key_up",{key:r.key,input_value:t(o)})}),w("blur",c,fe),w("focus",c,he),f(E,T),pe()}var tt=O(" ",1);function yt(E,k){ue(k,!0);let L=Ae(k,["$$slots","$$events","$$legacy"]);const e=new Ee(L);let I=d(()=>e.props.choices.map(([o,A])=>[e.live_i18n(o),A]));je(E,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get padding(){return e.shared.container},allow_overflow:!1,get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(o,A)=>{var $=tt(),B=de($);Ce(B,Ie({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var S=y(B,2);{var R=_=>{et(_,{get gradio(){return e}})},b=_=>{Ze(_,{get label(){return e.shared.label},get info(){return e.props.info},get choices(){return t(I)},get interactive(){return e.shared.interactive},get show_label(){return e.shared.show_label},get container(){return e.shared.container},get allow_custom_value(){return e.props.allow_custom_value},get filterable(){return e.props.filterable},get buttons(){return e.props.buttons},oncustom_button_click:l=>{e.dispatch("custom_button_click",{id:l})},on_change:()=>e.dispatch("change"),on_input:()=>e.dispatch("input"),on_select:l=>e.dispatch("select",l),on_focus:()=>e.dispatch("focus"),on_blur:()=>e.dispatch("blur"),on_key_up:l=>e.dispatch("key_up",l),get value(){return e.props.value},set value(l){e.props.value=l}})};M(S,_=>{e.props.multiselect?_(R):_(b,!1)})}f(o,$)},$$slots:{default:!0}}),pe()}export{Ze as BaseDropdown,Ue as BaseDropdownOptions,$t as BaseExample,et as BaseMultiselect,yt as default}; diff --git a/assets/Index-Da0Ogfu8.js b/assets/Index-CNDPhdRV.js similarity index 78% rename from assets/Index-Da0Ogfu8.js rename to assets/Index-CNDPhdRV.js index 6c82f06315187760049f047d7b02a3f7594896a5..e067b43b6bda109942cbab29b65d40b2c02f3f15 100644 --- a/assets/Index-Da0Ogfu8.js +++ b/assets/Index-CNDPhdRV.js @@ -1 +1 @@ -import{p as y,s as w,a as Q,b as R,f as Z,u as p,t as j,G as q,r as z}from"./i18n-CPHyzK9b.js";import{M as B,aw as D,ac as u,Z as s,$ as E,v as F,G as H,a3 as T,N as G,a as b,t as K,O as I,aa as L,a2 as n,Q as U,R as V,T as W}from"./index-DydPgVMC.js";import{a as X}from"./Walkthrough-BWP9RaPo.js";import{B as Y}from"./Index.svelte_svelte_type_style_lang-glBt5fcY.js";import"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./html-BZIV6tyB.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";var $=V('
        ');function ee(d,e){B(e,!0);const c=()=>p(k,"$selected_tab_index",l),a=()=>p(S,"$selected_tab",l),[l,f]=j();let r=y(e,"elem_id",3,""),o=y(e,"elem_classes",19,()=>[]);const{register_tab:N,unregister_tab:O,selected_tab:S,selected_tab_index:k}=D(X);let v=L(void 0);function C(t,m){return t=JSON.parse(t),N(t,m)}let _=n(()=>e.id??e.component_id),J=n(()=>JSON.stringify({label:e.label,id:s(_),elem_id:r(),visible:e.visible,interactive:e.interactive,scale:e.scale,component_id:e.component_id})),P=n(()=>e.visible!==!1&&e.visible!=="hidden");u(()=>{const t=s(J);E(v,F(()=>C(t,e.order)),!0)}),u(()=>()=>O({label:e.label,id:s(_),elem_id:r()},e.order)),u(()=>{const t=s(v);t!==void 0&&c()===t&&H().then(()=>e.onselect?.({value:e.label,index:t}))});var i=$();let g,h;var A=U(i);{let t=n(()=>e.scale>=1?e.scale:null);Y(A,{get scale(){return s(t)},children:(m,te)=>{var x=T(),M=G(x);w(M,e,"default",{}),b(m,x)},$$slots:{default:!0}})}W(i),K(t=>{Q(i,"id",r()),g=R(i,1,`tabitem ${t??""}`,"svelte-1vg4i54",g,{"grow-children":e.scale>=1}),h=Z(i,"",h,{display:a()===s(_)&&s(P)?"flex":"none","flex-grow":e.scale})},[()=>o().join(" ")]),b(d,i),I(),f()}function ue(d,e){B(e,!0);let c=z(e,["$$slots","$$events","$$legacy"]);const a=new q(c);ee(d,{get elem_id(){return a.shared.elem_id},get elem_classes(){return a.shared.elem_classes},get label(){return a.shared.label},get visible(){return a.shared.visible},get interactive(){return a.shared.interactive},get id(){return a.props.id},get order(){return a.props.order},get scale(){return a.props.scale},get component_id(){return a.props.component_id},onselect:l=>a.dispatch("select",l),children:(l,f)=>{var r=T(),o=G(r);w(o,e,"default",{}),b(l,r)},$$slots:{default:!0}}),I()}export{ee as BaseTabItem,ue as default}; +import{p as y,s as w,a as Q,b as R,f as Z,u as p,t as j,G as q,r as z}from"./i18n-DtG3MAQ1.js";import{M as B,aw as D,ac as u,Z as s,$ as E,v as F,G as H,a3 as T,N as G,a as b,t as K,O as I,aa as L,a2 as n,Q as U,R as V,T as W}from"./index-BeNBoC9J.js";import{a as X}from"./Walkthrough-H2UDh_VW.js";import{B as Y}from"./Index.svelte_svelte_type_style_lang-CqKXbK2o.js";import"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./html-DE4EmiOG.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./index-B_pwUImq.js";import"./Clear-BiKSVifk.js";var $=V('
        ');function ee(d,e){B(e,!0);const c=()=>p(k,"$selected_tab_index",l),a=()=>p(S,"$selected_tab",l),[l,f]=j();let r=y(e,"elem_id",3,""),o=y(e,"elem_classes",19,()=>[]);const{register_tab:N,unregister_tab:O,selected_tab:S,selected_tab_index:k}=D(X);let v=L(void 0);function C(t,m){return t=JSON.parse(t),N(t,m)}let _=n(()=>e.id??e.component_id),J=n(()=>JSON.stringify({label:e.label,id:s(_),elem_id:r(),visible:e.visible,interactive:e.interactive,scale:e.scale,component_id:e.component_id})),P=n(()=>e.visible!==!1&&e.visible!=="hidden");u(()=>{const t=s(J);E(v,F(()=>C(t,e.order)),!0)}),u(()=>()=>O({label:e.label,id:s(_),elem_id:r()},e.order)),u(()=>{const t=s(v);t!==void 0&&c()===t&&H().then(()=>e.onselect?.({value:e.label,index:t}))});var i=$();let g,h;var A=U(i);{let t=n(()=>e.scale>=1?e.scale:null);Y(A,{get scale(){return s(t)},children:(m,te)=>{var x=T(),M=G(x);w(M,e,"default",{}),b(m,x)},$$slots:{default:!0}})}W(i),K(t=>{Q(i,"id",r()),g=R(i,1,`tabitem ${t??""}`,"svelte-1vg4i54",g,{"grow-children":e.scale>=1}),h=Z(i,"",h,{display:a()===s(_)&&s(P)?"flex":"none","flex-grow":e.scale})},[()=>o().join(" ")]),b(d,i),I(),f()}function ue(d,e){B(e,!0);let c=z(e,["$$slots","$$events","$$legacy"]);const a=new q(c);ee(d,{get elem_id(){return a.shared.elem_id},get elem_classes(){return a.shared.elem_classes},get label(){return a.shared.label},get visible(){return a.shared.visible},get interactive(){return a.shared.interactive},get id(){return a.props.id},get order(){return a.props.order},get scale(){return a.props.scale},get component_id(){return a.props.component_id},onselect:l=>a.dispatch("select",l),children:(l,f)=>{var r=T(),o=G(r);w(o,e,"default",{}),b(l,r)},$$slots:{default:!0}}),I()}export{ee as BaseTabItem,ue as default}; diff --git a/assets/Index-BSJNfw0b.js b/assets/Index-CRApU3uJ.js similarity index 94% rename from assets/Index-BSJNfw0b.js rename to assets/Index-CRApU3uJ.js index f5f60e3c5903df5a6903dede80dbca2eecde5fc9..9c7df25bed8ceac6f56c6fba17ba146b9fee1682 100644 --- a/assets/Index-BSJNfw0b.js +++ b/assets/Index-CRApU3uJ.js @@ -1 +1 @@ -import{p as m,v as de,b as J,q as ue,w as pe,i as D,a as A,G as fe,g as ve,r as _e}from"./i18n-CPHyzK9b.js";import{a as j,f as ge,ah as ee,M as V,t as H,O as W,R as L,aa as M,ab as N,$ as b,Z as r,ac as Q,S as T,X as he,a2 as x,Q as E,a3 as me,N as te,T as O}from"./index-DydPgVMC.js";import{k as be}from"./key-CFGu0zzg.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{F as ke}from"./File-_VpQFuKr.js";import{B as we}from"./Block-WPcVj6Bq.js";import{B as ye}from"./BlockLabel-BzVeVrtL.js";import{I as xe}from"./IconButtonWrapper-PnNNNvqI.js";import{a as je}from"./input-BtIxlP_B.js";import{S as Be}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var Ce=ge('');function Ge(B){var t=Ce();j(B,t)}var Se=L('');function Fe(B,t){V(t,!0);let i=m(t,"value",15);var e=Se();de(e),e.__input=()=>t.onchange?.(!i());let p;H(()=>{e.disabled=t.disabled,p=J(e,1,"svelte-1rqbbs6",null,p,{disabled:t.disabled&&!i()})}),je(e,i),j(B,e),W()}ee(["input"]);const Ie="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23888888'%20d='M6%202c-1.1%200-1.99.9-1.99%202L4%2020c0%201.1.89%202%201.99%202H18c1.1%200%202-.9%202-2V8l-6-6H6zm7%207V3.5L18.5%209H13z'/%3e%3c/svg%3e",Ue="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20viewBox='0%200%2032%2032'%20version='1.1'%20id='svg7'%20sodipodi:docname='light-folder-new.svg'%20inkscape:version='1.3.2%20(091e20e,%202023-11-25)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview7'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:zoom='7.375'%20inkscape:cx='15.932203'%20inkscape:cy='16'%20inkscape:window-width='1312'%20inkscape:window-height='529'%20inkscape:window-x='0'%20inkscape:window-y='38'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg7'%20/%3e%3cdefs%20id='defs6'%3e%3cclipPath%20id='clipPath1'%3e%3cpath%20d='m69.63%2012.145h-.052c-22.727-.292-46.47%204.077-46.709%204.122-2.424.451-4.946%202.974-5.397%205.397-.044.237-4.414%2023.983-4.122%2046.71-.292%2022.777%204.078%2046.523%204.122%2046.761.451%202.423%202.974%204.945%205.398%205.398.237.044%2023.982%204.413%2046.709%204.121%2022.779.292%2046.524-4.077%2046.761-4.121%202.423-.452%204.946-2.976%205.398-5.399.044-.236%204.413-23.981%204.121-46.709.292-22.777-4.077-46.523-4.121-46.761-.453-2.423-2.976-4.946-5.398-5.397-.238-.045-23.984-4.414-46.71-4.122'%20id='path1'%20/%3e%3c/clipPath%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20y2='352.98'%20x2='-601.15'%20y1='663.95'%20x1='-591.02'%20id='2'%3e%3cstop%20stop-color='%23a0a0a0'%20id='stop1'%20/%3e%3cstop%20offset='1'%20stop-color='%23aaa'%20id='stop2'%20/%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20y2='354.29'%20x2='-704.05'%20y1='647.77'%20x1='-701.19'%20id='1'%3e%3cstop%20stop-color='%23acabab'%20id='stop3'%20/%3e%3cstop%20offset='1'%20stop-color='%23d4d4d4'%20id='stop4'%20/%3e%3c/linearGradient%3e%3clinearGradient%20id='0'%20x1='59.12'%20y1='-19.888'%20x2='59.15'%20y2='-37.783'%20gradientUnits='userSpaceOnUse'%20gradientTransform='matrix(4.17478%200%200%204.16765-1069.7%20447.73)'%3e%3cstop%20stop-color='%23a0a0a0'%20id='stop5'%20/%3e%3cstop%20offset='1'%20stop-color='%23bdbdbd'%20id='stop6'%20/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20transform='matrix(.07089%200%200%20.07017%2023.295-40.67)'%20fill='%2360aae5'%20id='g7'%20style='fill:%23888888;fill-opacity:1'%3e%3cpath%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20d='m-884.1%20294.78c-4.626%200-8.349%203.718-8.349%208.335v161.41l468.19%201v-121.2c0-4.618-3.724-8.335-8.35-8.335h-272.65c-8.51.751-9.607-.377-13.812-5.981-5.964-7.968-14.969-21.443-20.84-29.21-4.712-6.805-5.477-6.02-13.292-6.02z'%20fill='url(%230)'%20color='%23000'%20id='path6'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3crect%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20y='356.85'%20x='-890.28'%20height='295.13'%20width='463.85'%20fill='url(%231)'%20stroke='url(%231)'%20stroke-width='2.378'%20rx='9.63'%20id='rect6'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3crect%20width='463.85'%20height='295.13'%20x='-890.28'%20y='356.85'%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20fill='none'%20stroke='url(%232)'%20stroke-linejoin='round'%20stroke-linecap='round'%20stroke-width='5.376'%20rx='9.63'%20id='rect7'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3c/g%3e%3c/svg%3e";var ze=L(''),Le=L(''),Oe=L('file icon'),Pe=L('
      • '),Ee=L("
          ");function re(B,t){V(t,!0);let i=m(t,"path",19,()=>[]),e=m(t,"index_path",19,()=>[]),p=m(t,"selected_files",19,()=>[]),n=m(t,"selected_folders",19,()=>[]),S=m(t,"is_selected_entirely",3,!1),f=m(t,"selectable",3,!1),F=m(t,"file_count",3,"multiple"),g=M(N([])),o=M(N([]));const u=a=>{r(o).includes(a)?b(o,r(o).filter(c=>c!==a),!0):b(o,[...r(o),a],!0)},s=a=>{r(o).includes(a)||b(o,[...r(o),a],!0)};(async()=>(b(g,await t.ls_fn(i()),!0),t.valid_for_selection&&b(g,[{name:".",type:"file"},...r(g)],!0),b(o,r(g).map((a,c)=>a.type==="folder"&&(S()||p().some(_=>_[0]===a.name))?c:null).filter(a=>a!==null),!0)))(),Q(()=>{S()&&r(g).forEach(a=>{t.oncheck?.({path:[...i(),a.name],checked:!0,type:a.type})})});function C(a,c,_){t.onselect?.({index:a,value:c.join("/"),selected:!0})}var k=Ee();let v;ue(k,21,()=>r(g),pe,(a,c,_)=>{let G=()=>r(c).type,h=()=>r(c).name,ae=()=>r(c).valid;const R=x(()=>(G()==="file"?p():n()).some(l=>l[0]===h()&&l.length===1));var Z=Pe(),I=E(Z);let X;I.__click=l=>{l.stopPropagation(),f()&&C([...e(),_],[...i(),h()],G())},I.__keydown=l=>{f()&&(l.key===" "||l.key==="Enter")&&C([...e(),_],[...i(),h()],G())};var K=E(I);{var le=l=>{var d=me(),U=te(d);{var q=z=>{var P=ze();j(z,P)},w=z=>{Fe(z,{disabled:!1,get value(){return r(R)},onchange:P=>{t.oncheck?.({path:[...i(),h()],checked:P,type:G()}),f()&&C([...e(),_],[...i(),h()],G()),G()==="folder"&&P&&s(_)}})};D(U,z=>{G()==="folder"&&F()==="single"?z(q):z(w,!1)})}j(l,d)};D(K,l=>{t.interactive&&l(le)})}var Y=T(K,2);{var se=l=>{var d=Le();let U;d.__click=w=>{w.stopPropagation(),u(_)},d.__keydown=w=>{(w.key===" "||w.key==="Enter")&&u(_)};var q=E(d);Ge(q),O(d),H(w=>U=J(d,1,"icon svelte-d2oddp",null,U,w),[()=>({hidden:!r(o).includes(_)})]),j(l,d)},ie=l=>{var d=Oe(),U=E(d);O(d),H(()=>A(U,"src",h()==="."?Ue:Ie)),j(l,d)};D(Y,l=>{G()==="folder"?l(se):l(ie,!1)})}var $=T(Y,2),ne=E($,!0);O($),O(I);var oe=T(I,2);{var ce=l=>{{let d=x(()=>[...i(),h()]),U=x(()=>[...e(),_]),q=x(()=>p().filter(y=>y[0]===h()).map(y=>y.slice(1))),w=x(()=>n().filter(y=>y[0]===h()).map(y=>y.slice(1))),z=x(()=>n().some(y=>y[0]===h()&&y.length===1)),P=x(()=>ae()??!1);re(l,{get path(){return r(d)},get index_path(){return r(U)},get selected_files(){return r(q)},get selected_folders(){return r(w)},get is_selected_entirely(){return r(z)},get interactive(){return t.interactive},get selectable(){return f()},get ls_fn(){return t.ls_fn},get file_count(){return F()},get valid_for_selection(){return r(P)},get oncheck(){return t.oncheck},get onselect(){return t.onselect}})}};D(oe,l=>{G()==="folder"&&r(o).includes(_)&&l(ce)})}O(Z),H(()=>{X=J(I,1,"wrap svelte-d2oddp",null,X,{selected:!t.interactive&&r(R),selectable:f()}),A(I,"role",f()?"button":void 0),A(I,"tabindex",f()?0:void 0),he(ne,h())}),j(a,Z)}),O(k),H(()=>v=J(k,1,"svelte-d2oddp",null,v,{"no-checkboxes":!t.interactive,root:i().length===0})),j(B,k),W()}ee(["click","keydown"]);var Te=L('
          ');function qe(B,t){V(t,!0);let i=m(t,"file_count",3,"multiple"),e=m(t,"value",15),p=m(t,"selectable",3,!1),n=M(N([]));const S=(u,s)=>u.join("/")===s.join("/"),f=(u,s)=>s.some(C=>S(C,u)),F=(u,s)=>u.join("/").startsWith(s.join("/"));var g=Te(),o=E(g);re(o,{path:[],get selected_files(){return e()},get selected_folders(){return r(n)},get interactive(){return t.interactive},get selectable(){return p()},get ls_fn(){return t.ls_fn},get file_count(){return i()},valid_for_selection:!1,oncheck:u=>{const{path:s,checked:C,type:k}=u;C?i()==="single"?e([s]):k==="folder"?f(s,r(n))||b(n,[...r(n),s],!0):f(s,e())||e([...e(),s]):(b(n,r(n).filter(v=>!F(s,v)),!0),k==="folder"?(b(n,r(n).filter(v=>!F(v,s)),!0),e(e().filter(v=>!F(v,s)))):e(e().filter(v=>!S(v,s)))),t.oninput?.()},get onselect(){return t.onselect}}),O(g),j(B,g),W()}var De=L(" ",1);function tt(B,t){V(t,!0);const i=_e(t,["$$slots","$$events","$$legacy"]),e=new fe(i,{value:[]});let p=M(N(e.props.value)),n=x(()=>[e.props.root_dir,e.props.glob,e.props.ignore_glob]),S=M(N(r(n)));Q(()=>{JSON.stringify(r(S))!=JSON.stringify(r(n))&&r(p)==e.props.value&&(b(S,r(n),!0),e.props.value=[])}),Q(()=>{r(p)!=e.props.value&&(b(p,e.props.value,!0),e.dispatch("change"))});{let f=x(()=>e.props.value===null?"dashed":"solid");we(B,{get visible(){return e.shared.visible},get variant(){return r(f)},border_mode:"base",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!0,overflow_behavior:"auto",get height(){return e.props.height},get max_height(){return e.props.max_height},get min_height(){return e.props.min_height},children:(F,g)=>{var o=De(),u=te(o);Be(u,ve(()=>e.shared.loading_status,{get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n},on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var s=T(u,2);{var C=a=>{xe(a,{get buttons(){return e.props.buttons},on_custom_button_click:c=>{e.dispatch("custom_button_click",{id:c})}})};D(s,a=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&a(C)})}var k=T(s,2);{let a=x(()=>e.shared.label||"FileExplorer");ye(k,{get show_label(){return e.shared.show_label},get Icon(){return ke},get label(){return r(a)},float:!1})}var v=T(k,2);be(v,()=>r(n),a=>{qe(a,{get file_count(){return e.props.file_count},get interactive(){return e.shared.interactive},get selectable(){return e.props._selectable},get ls_fn(){return e.shared.server.ls},oninput:()=>e.dispatch("input"),onselect:c=>e.dispatch("select",c),get value(){return e.props.value},set value(c){e.props.value=c}})}),j(F,o)},$$slots:{default:!0}})}W()}export{tt as default}; +import{p as m,v as de,b as J,q as ue,w as pe,i as D,a as A,G as fe,g as ve,r as _e}from"./i18n-DtG3MAQ1.js";import{a as j,f as ge,ah as ee,M as V,t as H,O as W,R as L,aa as M,ab as N,$ as b,Z as r,ac as Q,S as T,X as he,a2 as x,Q as E,a3 as me,N as te,T as O}from"./index-BeNBoC9J.js";import{k as be}from"./key-CbBDWaWR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{F as ke}from"./File-CD333vfS.js";import{B as we}from"./Block-DkzyQHli.js";import{B as ye}from"./BlockLabel-CEOjqpu7.js";import{I as xe}from"./IconButtonWrapper-Ce5bzAyh.js";import{a as je}from"./input-BLFxNjIx.js";import{S as Be}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var Ce=ge('');function Ge(B){var t=Ce();j(B,t)}var Se=L('');function Fe(B,t){V(t,!0);let i=m(t,"value",15);var e=Se();de(e),e.__input=()=>t.onchange?.(!i());let p;H(()=>{e.disabled=t.disabled,p=J(e,1,"svelte-1rqbbs6",null,p,{disabled:t.disabled&&!i()})}),je(e,i),j(B,e),W()}ee(["input"]);const Ie="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23888888'%20d='M6%202c-1.1%200-1.99.9-1.99%202L4%2020c0%201.1.89%202%201.99%202H18c1.1%200%202-.9%202-2V8l-6-6H6zm7%207V3.5L18.5%209H13z'/%3e%3c/svg%3e",Ue="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20viewBox='0%200%2032%2032'%20version='1.1'%20id='svg7'%20sodipodi:docname='light-folder-new.svg'%20inkscape:version='1.3.2%20(091e20e,%202023-11-25)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview7'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:zoom='7.375'%20inkscape:cx='15.932203'%20inkscape:cy='16'%20inkscape:window-width='1312'%20inkscape:window-height='529'%20inkscape:window-x='0'%20inkscape:window-y='38'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg7'%20/%3e%3cdefs%20id='defs6'%3e%3cclipPath%20id='clipPath1'%3e%3cpath%20d='m69.63%2012.145h-.052c-22.727-.292-46.47%204.077-46.709%204.122-2.424.451-4.946%202.974-5.397%205.397-.044.237-4.414%2023.983-4.122%2046.71-.292%2022.777%204.078%2046.523%204.122%2046.761.451%202.423%202.974%204.945%205.398%205.398.237.044%2023.982%204.413%2046.709%204.121%2022.779.292%2046.524-4.077%2046.761-4.121%202.423-.452%204.946-2.976%205.398-5.399.044-.236%204.413-23.981%204.121-46.709.292-22.777-4.077-46.523-4.121-46.761-.453-2.423-2.976-4.946-5.398-5.397-.238-.045-23.984-4.414-46.71-4.122'%20id='path1'%20/%3e%3c/clipPath%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20y2='352.98'%20x2='-601.15'%20y1='663.95'%20x1='-591.02'%20id='2'%3e%3cstop%20stop-color='%23a0a0a0'%20id='stop1'%20/%3e%3cstop%20offset='1'%20stop-color='%23aaa'%20id='stop2'%20/%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20y2='354.29'%20x2='-704.05'%20y1='647.77'%20x1='-701.19'%20id='1'%3e%3cstop%20stop-color='%23acabab'%20id='stop3'%20/%3e%3cstop%20offset='1'%20stop-color='%23d4d4d4'%20id='stop4'%20/%3e%3c/linearGradient%3e%3clinearGradient%20id='0'%20x1='59.12'%20y1='-19.888'%20x2='59.15'%20y2='-37.783'%20gradientUnits='userSpaceOnUse'%20gradientTransform='matrix(4.17478%200%200%204.16765-1069.7%20447.73)'%3e%3cstop%20stop-color='%23a0a0a0'%20id='stop5'%20/%3e%3cstop%20offset='1'%20stop-color='%23bdbdbd'%20id='stop6'%20/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20transform='matrix(.07089%200%200%20.07017%2023.295-40.67)'%20fill='%2360aae5'%20id='g7'%20style='fill:%23888888;fill-opacity:1'%3e%3cpath%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20d='m-884.1%20294.78c-4.626%200-8.349%203.718-8.349%208.335v161.41l468.19%201v-121.2c0-4.618-3.724-8.335-8.35-8.335h-272.65c-8.51.751-9.607-.377-13.812-5.981-5.964-7.968-14.969-21.443-20.84-29.21-4.712-6.805-5.477-6.02-13.292-6.02z'%20fill='url(%230)'%20color='%23000'%20id='path6'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3crect%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20y='356.85'%20x='-890.28'%20height='295.13'%20width='463.85'%20fill='url(%231)'%20stroke='url(%231)'%20stroke-width='2.378'%20rx='9.63'%20id='rect6'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3crect%20width='463.85'%20height='295.13'%20x='-890.28'%20y='356.85'%20transform='matrix(.7872%200%200%20.79524%20415.34%20430.11)'%20fill='none'%20stroke='url(%232)'%20stroke-linejoin='round'%20stroke-linecap='round'%20stroke-width='5.376'%20rx='9.63'%20id='rect7'%20style='fill:%23888888;fill-opacity:1'%20/%3e%3c/g%3e%3c/svg%3e";var ze=L(''),Le=L(''),Oe=L('file icon'),Pe=L('
        • '),Ee=L("
            ");function re(B,t){V(t,!0);let i=m(t,"path",19,()=>[]),e=m(t,"index_path",19,()=>[]),p=m(t,"selected_files",19,()=>[]),n=m(t,"selected_folders",19,()=>[]),S=m(t,"is_selected_entirely",3,!1),f=m(t,"selectable",3,!1),F=m(t,"file_count",3,"multiple"),g=M(N([])),o=M(N([]));const u=a=>{r(o).includes(a)?b(o,r(o).filter(c=>c!==a),!0):b(o,[...r(o),a],!0)},s=a=>{r(o).includes(a)||b(o,[...r(o),a],!0)};(async()=>(b(g,await t.ls_fn(i()),!0),t.valid_for_selection&&b(g,[{name:".",type:"file"},...r(g)],!0),b(o,r(g).map((a,c)=>a.type==="folder"&&(S()||p().some(_=>_[0]===a.name))?c:null).filter(a=>a!==null),!0)))(),Q(()=>{S()&&r(g).forEach(a=>{t.oncheck?.({path:[...i(),a.name],checked:!0,type:a.type})})});function C(a,c,_){t.onselect?.({index:a,value:c.join("/"),selected:!0})}var k=Ee();let v;ue(k,21,()=>r(g),pe,(a,c,_)=>{let G=()=>r(c).type,h=()=>r(c).name,ae=()=>r(c).valid;const R=x(()=>(G()==="file"?p():n()).some(l=>l[0]===h()&&l.length===1));var Z=Pe(),I=E(Z);let X;I.__click=l=>{l.stopPropagation(),f()&&C([...e(),_],[...i(),h()],G())},I.__keydown=l=>{f()&&(l.key===" "||l.key==="Enter")&&C([...e(),_],[...i(),h()],G())};var K=E(I);{var le=l=>{var d=me(),U=te(d);{var q=z=>{var P=ze();j(z,P)},w=z=>{Fe(z,{disabled:!1,get value(){return r(R)},onchange:P=>{t.oncheck?.({path:[...i(),h()],checked:P,type:G()}),f()&&C([...e(),_],[...i(),h()],G()),G()==="folder"&&P&&s(_)}})};D(U,z=>{G()==="folder"&&F()==="single"?z(q):z(w,!1)})}j(l,d)};D(K,l=>{t.interactive&&l(le)})}var Y=T(K,2);{var se=l=>{var d=Le();let U;d.__click=w=>{w.stopPropagation(),u(_)},d.__keydown=w=>{(w.key===" "||w.key==="Enter")&&u(_)};var q=E(d);Ge(q),O(d),H(w=>U=J(d,1,"icon svelte-d2oddp",null,U,w),[()=>({hidden:!r(o).includes(_)})]),j(l,d)},ie=l=>{var d=Oe(),U=E(d);O(d),H(()=>A(U,"src",h()==="."?Ue:Ie)),j(l,d)};D(Y,l=>{G()==="folder"?l(se):l(ie,!1)})}var $=T(Y,2),ne=E($,!0);O($),O(I);var oe=T(I,2);{var ce=l=>{{let d=x(()=>[...i(),h()]),U=x(()=>[...e(),_]),q=x(()=>p().filter(y=>y[0]===h()).map(y=>y.slice(1))),w=x(()=>n().filter(y=>y[0]===h()).map(y=>y.slice(1))),z=x(()=>n().some(y=>y[0]===h()&&y.length===1)),P=x(()=>ae()??!1);re(l,{get path(){return r(d)},get index_path(){return r(U)},get selected_files(){return r(q)},get selected_folders(){return r(w)},get is_selected_entirely(){return r(z)},get interactive(){return t.interactive},get selectable(){return f()},get ls_fn(){return t.ls_fn},get file_count(){return F()},get valid_for_selection(){return r(P)},get oncheck(){return t.oncheck},get onselect(){return t.onselect}})}};D(oe,l=>{G()==="folder"&&r(o).includes(_)&&l(ce)})}O(Z),H(()=>{X=J(I,1,"wrap svelte-d2oddp",null,X,{selected:!t.interactive&&r(R),selectable:f()}),A(I,"role",f()?"button":void 0),A(I,"tabindex",f()?0:void 0),he(ne,h())}),j(a,Z)}),O(k),H(()=>v=J(k,1,"svelte-d2oddp",null,v,{"no-checkboxes":!t.interactive,root:i().length===0})),j(B,k),W()}ee(["click","keydown"]);var Te=L('
            ');function qe(B,t){V(t,!0);let i=m(t,"file_count",3,"multiple"),e=m(t,"value",15),p=m(t,"selectable",3,!1),n=M(N([]));const S=(u,s)=>u.join("/")===s.join("/"),f=(u,s)=>s.some(C=>S(C,u)),F=(u,s)=>u.join("/").startsWith(s.join("/"));var g=Te(),o=E(g);re(o,{path:[],get selected_files(){return e()},get selected_folders(){return r(n)},get interactive(){return t.interactive},get selectable(){return p()},get ls_fn(){return t.ls_fn},get file_count(){return i()},valid_for_selection:!1,oncheck:u=>{const{path:s,checked:C,type:k}=u;C?i()==="single"?e([s]):k==="folder"?f(s,r(n))||b(n,[...r(n),s],!0):f(s,e())||e([...e(),s]):(b(n,r(n).filter(v=>!F(s,v)),!0),k==="folder"?(b(n,r(n).filter(v=>!F(v,s)),!0),e(e().filter(v=>!F(v,s)))):e(e().filter(v=>!S(v,s)))),t.oninput?.()},get onselect(){return t.onselect}}),O(g),j(B,g),W()}var De=L(" ",1);function tt(B,t){V(t,!0);const i=_e(t,["$$slots","$$events","$$legacy"]),e=new fe(i,{value:[]});let p=M(N(e.props.value)),n=x(()=>[e.props.root_dir,e.props.glob,e.props.ignore_glob]),S=M(N(r(n)));Q(()=>{JSON.stringify(r(S))!=JSON.stringify(r(n))&&r(p)==e.props.value&&(b(S,r(n),!0),e.props.value=[])}),Q(()=>{r(p)!=e.props.value&&(b(p,e.props.value,!0),e.dispatch("change"))});{let f=x(()=>e.props.value===null?"dashed":"solid");we(B,{get visible(){return e.shared.visible},get variant(){return r(f)},border_mode:"base",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!0,overflow_behavior:"auto",get height(){return e.props.height},get max_height(){return e.props.max_height},get min_height(){return e.props.min_height},children:(F,g)=>{var o=De(),u=te(o);Be(u,ve(()=>e.shared.loading_status,{get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n},on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var s=T(u,2);{var C=a=>{xe(a,{get buttons(){return e.props.buttons},on_custom_button_click:c=>{e.dispatch("custom_button_click",{id:c})}})};D(s,a=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&a(C)})}var k=T(s,2);{let a=x(()=>e.shared.label||"FileExplorer");ye(k,{get show_label(){return e.shared.show_label},get Icon(){return ke},get label(){return r(a)},float:!1})}var v=T(k,2);be(v,()=>r(n),a=>{qe(a,{get file_count(){return e.props.file_count},get interactive(){return e.shared.interactive},get selectable(){return e.props._selectable},get ls_fn(){return e.shared.server.ls},oninput:()=>e.dispatch("input"),onselect:c=>e.dispatch("select",c),get value(){return e.props.value},set value(c){e.props.value=c}})}),j(F,o)},$$slots:{default:!0}})}W()}export{tt as default}; diff --git a/assets/Index-BrbNPUGv.js b/assets/Index-CUd896DX.js similarity index 92% rename from assets/Index-BrbNPUGv.js rename to assets/Index-CUd896DX.js index 9db5f273aa469672ce84899f1a207bb5051b8ca3..ec48472b5215e6227024c765e1ad41ba21d9c9cb 100644 --- a/assets/Index-BrbNPUGv.js +++ b/assets/Index-CUd896DX.js @@ -1 +1 @@ -import{p as _e,e as ot,a as F,i as D,b as j,q as lt,d as me,f as nt,w as it,G as dt,r as ut,g as ct}from"./i18n-CPHyzK9b.js";import{M as $e,a1 as pt,Q as k,S as M,T as w,t as q,X as ke,U as B,a as $,O as Ce,P as he,R as T,aa as P,ab as be,ac as qe,$ as r,a7 as vt,a4 as Ae,au as gt,Z as e,a2 as O,a3 as Le,N as we,a5 as ft,ai as ye,G as ee}from"./index-DydPgVMC.js";import{t as ie,f as de}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{b as xe}from"./input-BtIxlP_B.js";import{I as _t}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as mt}from"./BlockTitle-DNiCHWOR.js";import{C as ht}from"./Check-2f8HlfSn.js";import{C as bt}from"./Copy-B3jzejpA.js";import{P as yt}from"./Plus-BDmybZhd.js";import{S as xt}from"./Send-oZH_TPNw.js";import{T as kt}from"./Trash-CJrspSVZ.js";import{I as wt}from"./IconButtonWrapper-PnNNNvqI.js";import{b as $t,D as Ne}from"./Dropdown-CVRP4i7q.js";/* empty css */import{B as Ct}from"./Block-WPcVj6Bq.js";import{S as It}from"./index-CfM_uZQa.js";import{default as fa}from"./Example-FH892lPu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./snippet-BtHMuX3s.js";import"./Info-DfrMwI06.js";import"./window-D5YXrKnH.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Clear-BR8cTgGu.js";var St=T('
            ');function Dt(K,G){$e(G,!1);let t=_e(G,"label",12),i=_e(G,"checked",12,!1),y=_e(G,"disabled",12,!1);const g=pt();function H(f){const E=f.target.getAttribute("aria-checked");i(E!=="true"),g("click",{checked:i()})}var te={get label(){return t()},set label(f){t(f),he()},get checked(){return i()},set checked(f){i(f),he()},get disabled(){return y()},set disabled(f){y(f),he()}};ot();var R=St(),b=k(R),C=M(b,2),m=k(C,!0);return w(C),w(R),q(()=>{F(b,"aria-checked",i()),b.disabled=y(),ke(m,t())}),B("click",b,H),$(K,R),Ce(te)}var Tt=T("
            "),Ot=T('
            Converting to dialogue format...
            '),Bt=T(''),Pt=T('
            '),Mt=T('
            '),Et=T('
            '),Rt=T('
            '),At=T('
            Converting to plain text...
            '),Lt=T('
            '),Nt=T('
            '),qt=T('
            '),Gt=T("
            ");function Ut(K,G){$e(G,!0);const t=G.gradio;let i=P(!1),y=O(()=>!t.shared.interactive),g=P(be([]));qe(()=>{t.props.value&&t.props.value.length&&typeof t.props.value!="string"?r(g,[...t.props.value],!0):t.props.value&&typeof t.props.value!="string"?r(g,[{speaker:`${t.props.speakers.length?t.props.speakers[0]:""}`,text:""}],!0):typeof t.props.value=="string"&&(r(I,t.props.value,!0),r(i,!0))});let H=O(()=>t.props.buttons||["copy"]),te=a=>{t.dispatch("custom_button_click",{id:a})},R,b=P(!1),C=P(-1),m=P(0),f=P(be([])),A=be([]),E,Ie=P(0),ae=P(!1),ue,I=P(""),se=P(null),W=P(!1),X=P(!1);const Se=["red","green","blue","yellow","purple","teal","orange","cyan","lime","pink"],Ge={red:"rgba(254, 202, 202, 0.7)",green:"rgba(209, 250, 229, 0.7)",blue:"rgba(219, 234, 254, 0.7)",yellow:"rgba(254, 243, 199, 0.7)",purple:"rgba(233, 213, 255, 0.7)",teal:"rgba(204, 251, 241, 0.7)",orange:"rgba(254, 215, 170, 0.7)",cyan:"rgba(207, 250, 254, 0.7)",lime:"rgba(217, 249, 157, 0.7)",pink:"rgba(252, 231, 243, 0.7)"};let Ue=O(()=>{let a={};return t.props.color_map?a={...t.props.color_map}:(a={},t.props.speakers.forEach((s,o)=>{const c=Se[o%Se.length];a[s]=Ge[c]})),a});function ze(a){const s=t.props.speakers.length>0?t.props.speakers[0]:"";r(g,[...e(g).slice(0,a+1),{speaker:s,text:""},...e(g).slice(a+1)],!0),ee().then(()=>{A[a+1]&&A[a+1].focus()}),t.props.value=[...e(g)]}function He(a){r(g,[...e(g).slice(0,a),...e(g).slice(a+1)],!0),t.props.value=[...e(g)]}function ce(a,s,o){e(g)[a][s]=o,r(g,[...e(g)],!0),t.props.value=[...e(g)]}function re(a,s){const o=a.target||HTMLTextAreaElement;o&&!A[s]&&(A[s]=o);const c=o.selectionStart||0,h=o.value;let _=!1,u=-1;if(h[c-1]===":"){r(C,s,!0),u=c;const l=Je(h,c);r(f,t.props.tags.filter(n=>l===""||n.toLowerCase().includes(l.toLowerCase())),!0),_=e(f).length>0,r(m,0)}else{const l=h.lastIndexOf(":",c-1);if(l>=0&&!h.substring(l+1,c).includes(" ")){r(C,s,!0),u=l+1;const n=h.substring(l+1,c);r(f,t.props.tags.filter(p=>n===""||p.toLowerCase().includes(n.toLowerCase())),!0),_=e(f).length>0,r(m,0)}}if(_&&u!==-1){r(b,!0);const l=o.getBoundingClientRect();if(R){const n=R.getBoundingClientRect();r(Ie,n.top+l.height*(s+1.5))}}else r(b,!1);t.dispatch("input")}function Je(a,s){const o=a.lastIndexOf(":",s-1);return o>=0?a.substring(o+1,s):""}async function De(){const a=e(f)[e(m)];if(a){let s,o;e(i)?(o=E,s=e(I)):(o=A[e(C)],s=e(g)[e(C)].text);const c=o?.selectionStart||0,h=s.lastIndexOf(":",c-1);if(h>=0){const _=s.substring(0,h),u=s.substring(c);if(e(i)){const l=`${_}${a} ${u}`;r(I,l),t.props.speakers.length===0?t.props.value=l:t.props.value=await t.shared.server.unformat({text:l}),ee().then(()=>{if(E){const n=_.length+a.length+1;E.setSelectionRange(n,n),E.focus()}})}else{const l=_.replace(/\[S\d+\]/g,"").trim(),n=`${l}${a} ${u}`;ce(e(C),"text",n),ee().then(()=>{const p=A[e(C)];if(p){const S=l.length+a.length+1;p.setSelectionRange(S,S),p.focus()}})}}r(b,!1),r(m,0)}}async function Te(a){a=parseInt(a);const s=t.props.tags[a];if(s){let o,c;e(i)?(c=E,o=e(I)):(c=A[e(C)],o=e(g)[e(C)].text);const h=c?.selectionStart||0,_=o.lastIndexOf(":",h-1);if(_>=0){const u=o.substring(0,_),l=o.substring(h);if(e(i)){const n=`${u}${s} ${l}`;r(I,n),t.props.speakers.length===0?t.props.value=n:t.props.value=await t.shared.server.unformat({text:n}),ee().then(()=>{if(E){const p=u.length+s.length+1;E.setSelectionRange(p,p),E.focus()}})}else{const n=u.replace(/\[S\d+\]/g,"").trim(),p=`${n}${s} ${l}`;ce(e(C),"text",p),ee().then(()=>{const S=A[e(C)];if(S){const Z=n.length+s.length+1;S.setSelectionRange(Z,Z),S.focus()}})}}r(b,!1),r(m,0)}}function Qe(a){if(e(b)){const s=a.target,o=document.querySelector('[data-testid="dialogue-tag-menu"]');o&&!o.contains(s)&&r(b,!1)}}async function pe(a){return typeof a=="string"?a:await t.shared.server.format(a)}async function We(){if("clipboard"in navigator){const a=await pe(t.props.value);await navigator.clipboard.writeText(a),Xe()}}function Xe(){r(ae,!0),ue&&clearTimeout(ue),ue=setTimeout(()=>{r(ae,!1)},1e3)}async function Ze(){e(i)&&(t.props.value=await t.shared.server.unformat({text:e(I)})),t.dispatch("submit")}vt(async()=>{if(typeof t.props.value=="string")r(I,t.props.value,!0);else if(t.props.value&&t.props.value.length>0){const a=await pe(t.props.value);r(I,a,!0)}else r(I,"")});var oe=Gt();B("click",gt,Qe);let Oe;var Be=k(oe);{var je=a=>{wt(a,{get buttons(){return e(H)},on_custom_button_click:te,children:(s,o)=>{var c=Le(),h=we(c);{var _=u=>{{let l=O(()=>e(ae)?ht:bt),n=O(()=>e(ae)?"Copied":"Copy");_t(u,{get Icon(){return e(l)},onclick:We,get label(){return e(n)}})}};D(h,u=>{e(H).some(l=>typeof l=="string"&&l==="copy")&&u(_)})}$(s,c)},$$slots:{default:!0}})};D(Be,a=>{t.shared.show_label&&(e(H).some(s=>typeof s=="string"&&s==="copy")||e(H).some(s=>typeof s!="string"))&&a(je)})}var Pe=M(Be,2);mt(Pe,{get show_label(){return t.shared.show_label},get info(){return t.props.info},children:(a,s)=>{ft();var o=Ae();q(()=>ke(o,t.shared.label||"Dialogue")),$(a,o)},$$slots:{default:!0}});var Me=M(Pe,2);{var Fe=a=>{var s=Tt();let o;var c=k(s);{let h=O(()=>e(X)||e(W));Dt(c,{label:"Plain Text",get disabled(){return e(h)},get checked(){return e(i)},set checked(_){r(i,_,!0)},$$events:{click:async _=>{if(_.detail.checked){r(X,!0);try{r(I,await pe(e(g)),!0)}finally{r(X,!1)}}else{r(W,!0);try{t.props.value=await t.shared.server.unformat({text:e(I)}),r(g,[...t.props.value],!0)}finally{r(W,!1)}}}}})}w(s),q(()=>o=j(s,1,"switch-container top-switch svelte-1y1egvg",null,o,{"switch-disabled":e(X)||e(W)})),$(a,s)};D(Me,a=>{t.props.ui_mode==="both"&&a(Fe)})}var Ee=M(Me,2);{var Ke=a=>{var s=Rt();let o;var c=k(s);{var h=u=>{var l=Ot();ie(3,l,()=>de,()=>({duration:200})),$(u,l)};D(c,u=>{e(W)&&u(h)})}var _=M(c,2);lt(_,17,()=>e(g),it,(u,l,n)=>{var p=Et(),S=k(p),Z=k(S);{var v=d=>{var x=Bt();ye(x),q(()=>x.disabled=e(y)),xe(x,()=>e(l).speaker,N=>e(l).speaker=N),$(d,x)},U=d=>{{let x=O(()=>t.props.speakers.map(N=>[N,N]));$t(d,{label:"",show_label:!1,container:!0,interactive:!0,get value(){return e(l).speaker},get choices(){return e(x)},on_change:N=>ce(n,"speaker",N)})}};D(Z,d=>{e(y)?d(v):d(U,!1)})}w(S);var V=M(S,2),le=k(V),L=k(le);ye(L),me(L,(d,x)=>A[x]=d,d=>A?.[d],()=>[n]);var ve=M(L,2);{var z=d=>{var x=Pt(),N=k(x);{let J=O(()=>t.props.tags.map((Q,rt)=>[Q,rt])),fe=O(()=>e(f).map(Q=>t.props.tags.indexOf(Q))),st=O(()=>e(f).map(Q=>t.props.tags.indexOf(Q))[e(m)]);Ne(N,{get choices(){return e(J)},get filtered_indices(){return e(fe)},get active_index(){return e(st)},show_options:!0,onchange:Q=>Te(Q),get offset_from_top(){return e(Ie)},from_top:!0})}w(x),ie(3,x,()=>de,()=>({duration:100})),$(d,x)};D(ve,d=>{e(b)&&e(C)===n&&d(z)})}w(le),w(V);var ne=M(V,2);{var tt=d=>{var x=Mt();let N;var J=k(x);F(J,"data-testid",`dialogue-add-button-${n}`);var fe=k(J);yt(fe),w(J),w(x),q(()=>{N=j(x,1,"svelte-1y1egvg",null,N,{"action-column":n==0,hidden:e(y)}),J.disabled=e(y)}),B("click",J,()=>ze(n)),$(d,x)};D(ne,d=>{(t.props.max_lines==null||t.props.max_lines&&n{nt(p,`--speaker-bg-color: ${(e(y)&&(e(se)===null||e(se)===e(l).speaker)&&e(Ue)[e(l).speaker]||"transparent")??""}`),F(L,"placeholder",t.props.placeholder),L.disabled=e(y),Re=j(ge,1,"action-column svelte-1y1egvg",null,Re,{hidden:e(y)||n==0}),Y.disabled=e(y)}),B("mouseenter",S,()=>e(y)&&r(se,e(l).speaker,!0)),B("mouseleave",S,()=>e(y)&&r(se,null)),xe(L,()=>e(l).text,d=>e(l).text=d),B("input",L,d=>re(d,n)),B("focus",L,d=>re(d,n)),B("keydown",L,d=>{d.key==="Escape"&&e(b)?(r(b,!1),r(m,0),d.preventDefault()):e(b)&&e(C)===n&&(d.key==="ArrowDown"?(r(m,Math.min(e(m)+1,e(f).length-1),!0),d.preventDefault()):d.key==="ArrowUp"?(r(m,Math.max(e(m)-1,0),!0),d.preventDefault()):d.key==="Enter"&&(e(f)[e(m)]&&De(),d.preventDefault()))}),B("click",Y,()=>He(n)),$(u,p)}),w(s),me(s,u=>R=u,()=>R),q(()=>o=j(s,1,"dialogue-container svelte-1y1egvg",null,o,{loading:e(W)})),$(a,s)},Ve=a=>{var s=Le(),o=we(s);{var c=h=>{var _=Nt();let u;var l=k(_);{var n=v=>{var U=At();ie(3,U,()=>de,()=>({duration:200})),$(v,U)};D(l,v=>{e(X)&&v(n)})}var p=M(l,2);ye(p),F(p,"rows",5),me(p,v=>E=v,()=>E);var S=M(p,2);{var Z=v=>{var U=Lt(),V=k(U);{let le=O(()=>t.props.tags.map((z,ne)=>[z,ne])),L=O(()=>e(f).map(z=>t.props.tags.indexOf(z))),ve=O(()=>e(f).map(z=>t.props.tags.indexOf(z))[e(m)]);Ne(V,{get choices(){return e(le)},get filtered_indices(){return e(L)},get active_index(){return e(ve)},show_options:!0,onchange:z=>Te(z)})}w(U),ie(3,U,()=>de,()=>({duration:100})),$(v,U)};D(S,v=>{e(b)&&v(Z)})}w(_),q(()=>{u=j(_,1,"textarea-container svelte-1y1egvg",null,u,{loading:e(X)}),F(p,"placeholder",t.props.placeholder),p.disabled=e(y)}),xe(p,()=>e(I),v=>r(I,v)),B("input",p,v=>{re(v,0),t.props.value=e(I)}),B("focus",p,v=>re(v,0)),B("keydown",p,v=>{v.key==="Escape"&&e(b)?(r(b,!1),r(m,0),v.preventDefault()):e(b)&&(v.key==="ArrowDown"?(r(m,Math.min(e(m)+1,e(f).length-1),!0),v.preventDefault()):v.key==="ArrowUp"?(r(m,Math.max(e(m)-1,0),!0),v.preventDefault()):v.key==="Enter"&&(e(f)[e(m)]&&De(),v.preventDefault()))}),$(h,_)};D(o,h=>{(e(i)||t.props.ui_mode!=="dialogue")&&h(c)},!0)}$(a,s)};D(Ee,a=>{!e(i)&&t.props.ui_mode!=="text"?a(Ke):a(Ve,!1)})}var Ye=M(Ee,2);{var et=a=>{var s=qt(),o=k(s),c=k(o);{var h=u=>{var l=Ae();q(()=>ke(l,t.props.submit_btn)),$(u,l)},_=u=>{xt(u)};D(c,u=>{typeof t.props.submit_btn=="string"?u(h):u(_,!1)})}w(o),w(s),q(()=>o.disabled=e(y)),B("click",o,Ze),$(a,s)};D(Ye,a=>{t.props.submit_btn&&!e(y)&&a(et)})}w(oe),q(()=>Oe=j(oe,1,"svelte-1y1egvg",null,Oe,{container:t.shared.container})),$(K,oe),Ce()}var zt=T(" ",1);function pa(K,G){$e(G,!0);const t=ut(G,["$$slots","$$events","$$legacy"]),i=new dt(t);let y=P(!1),g=i.props.value;qe(()=>{e(y)||(g=i.props.value,r(y,!0)),JSON.stringify(g)!=JSON.stringify(i.props.value)&&(g=i.props.value,i.dispatch("change"))}),Ct(K,{get visible(){return i.shared.visible},get elem_id(){return i.shared.elem_id},get elem_classes(){return i.shared.elem_classes},get scale(){return i.shared.scale},get min_width(){return i.shared.min_width},allow_overflow:!0,get padding(){return i.shared.container},children:(H,te)=>{var R=zt(),b=we(R);{var C=f=>{It(f,ct({get autoscroll(){return i.shared.autoscroll},get i18n(){return i.i18n}},()=>i.shared.loading_status,{on_clear_status:()=>i.dispatch("clear_status",i.shared.loading_status)}))};D(b,f=>{i.shared.loading_status&&f(C)})}var m=M(b,2);Ut(m,{get gradio(){return i}}),$(H,R)},$$slots:{default:!0}}),Ce()}export{Ut as BaseDialogue,fa as BaseExample,pa as default}; +import{p as _e,e as ot,a as F,i as D,b as j,q as lt,d as me,f as nt,w as it,G as dt,r as ut,g as ct}from"./i18n-DtG3MAQ1.js";import{M as $e,a1 as pt,Q as k,S as M,T as w,t as q,X as ke,U as B,a as $,O as Ce,P as he,R as T,aa as P,ab as be,ac as qe,$ as r,a7 as vt,a4 as Ae,au as gt,Z as e,a2 as O,a3 as Le,N as we,a5 as ft,ai as ye,G as ee}from"./index-BeNBoC9J.js";import{t as ie,f as de}from"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{b as xe}from"./input-BLFxNjIx.js";import{I as _t}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as mt}from"./BlockTitle-B6Pgijwb.js";import{C as ht}from"./Check-DjGw_9dO.js";import{C as bt}from"./Copy-eBznHIlR.js";import{P as yt}from"./Plus-P6-znuRS.js";import{S as xt}from"./Send--YHrNLI0.js";import{T as kt}from"./Trash-BLpDLXq5.js";import{I as wt}from"./IconButtonWrapper-Ce5bzAyh.js";import{b as $t,D as Ne}from"./Dropdown-D5-31HWl.js";/* empty css */import{B as Ct}from"./Block-DkzyQHli.js";import{S as It}from"./index-1YthqPsU.js";import{default as fa}from"./Example-D9aSX7Ky.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./snippet-BRIBYCwB.js";import"./Info-BjDIKIgf.js";import"./window-ChwzOWAi.js";import"./DropdownArrow-C0w6FgSo.js";import"./Clear-BiKSVifk.js";var St=T('
            ');function Dt(K,G){$e(G,!1);let t=_e(G,"label",12),i=_e(G,"checked",12,!1),y=_e(G,"disabled",12,!1);const g=pt();function H(f){const E=f.target.getAttribute("aria-checked");i(E!=="true"),g("click",{checked:i()})}var te={get label(){return t()},set label(f){t(f),he()},get checked(){return i()},set checked(f){i(f),he()},get disabled(){return y()},set disabled(f){y(f),he()}};ot();var R=St(),b=k(R),C=M(b,2),m=k(C,!0);return w(C),w(R),q(()=>{F(b,"aria-checked",i()),b.disabled=y(),ke(m,t())}),B("click",b,H),$(K,R),Ce(te)}var Tt=T("
            "),Ot=T('
            Converting to dialogue format...
            '),Bt=T(''),Pt=T('
            '),Mt=T('
            '),Et=T('
            '),Rt=T('
            '),At=T('
            Converting to plain text...
            '),Lt=T('
            '),Nt=T('
            '),qt=T('
            '),Gt=T("
            ");function Ut(K,G){$e(G,!0);const t=G.gradio;let i=P(!1),y=O(()=>!t.shared.interactive),g=P(be([]));qe(()=>{t.props.value&&t.props.value.length&&typeof t.props.value!="string"?r(g,[...t.props.value],!0):t.props.value&&typeof t.props.value!="string"?r(g,[{speaker:`${t.props.speakers.length?t.props.speakers[0]:""}`,text:""}],!0):typeof t.props.value=="string"&&(r(I,t.props.value,!0),r(i,!0))});let H=O(()=>t.props.buttons||["copy"]),te=a=>{t.dispatch("custom_button_click",{id:a})},R,b=P(!1),C=P(-1),m=P(0),f=P(be([])),A=be([]),E,Ie=P(0),ae=P(!1),ue,I=P(""),se=P(null),W=P(!1),X=P(!1);const Se=["red","green","blue","yellow","purple","teal","orange","cyan","lime","pink"],Ge={red:"rgba(254, 202, 202, 0.7)",green:"rgba(209, 250, 229, 0.7)",blue:"rgba(219, 234, 254, 0.7)",yellow:"rgba(254, 243, 199, 0.7)",purple:"rgba(233, 213, 255, 0.7)",teal:"rgba(204, 251, 241, 0.7)",orange:"rgba(254, 215, 170, 0.7)",cyan:"rgba(207, 250, 254, 0.7)",lime:"rgba(217, 249, 157, 0.7)",pink:"rgba(252, 231, 243, 0.7)"};let Ue=O(()=>{let a={};return t.props.color_map?a={...t.props.color_map}:(a={},t.props.speakers.forEach((s,o)=>{const c=Se[o%Se.length];a[s]=Ge[c]})),a});function ze(a){const s=t.props.speakers.length>0?t.props.speakers[0]:"";r(g,[...e(g).slice(0,a+1),{speaker:s,text:""},...e(g).slice(a+1)],!0),ee().then(()=>{A[a+1]&&A[a+1].focus()}),t.props.value=[...e(g)]}function He(a){r(g,[...e(g).slice(0,a),...e(g).slice(a+1)],!0),t.props.value=[...e(g)]}function ce(a,s,o){e(g)[a][s]=o,r(g,[...e(g)],!0),t.props.value=[...e(g)]}function re(a,s){const o=a.target||HTMLTextAreaElement;o&&!A[s]&&(A[s]=o);const c=o.selectionStart||0,h=o.value;let _=!1,u=-1;if(h[c-1]===":"){r(C,s,!0),u=c;const l=Je(h,c);r(f,t.props.tags.filter(n=>l===""||n.toLowerCase().includes(l.toLowerCase())),!0),_=e(f).length>0,r(m,0)}else{const l=h.lastIndexOf(":",c-1);if(l>=0&&!h.substring(l+1,c).includes(" ")){r(C,s,!0),u=l+1;const n=h.substring(l+1,c);r(f,t.props.tags.filter(p=>n===""||p.toLowerCase().includes(n.toLowerCase())),!0),_=e(f).length>0,r(m,0)}}if(_&&u!==-1){r(b,!0);const l=o.getBoundingClientRect();if(R){const n=R.getBoundingClientRect();r(Ie,n.top+l.height*(s+1.5))}}else r(b,!1);t.dispatch("input")}function Je(a,s){const o=a.lastIndexOf(":",s-1);return o>=0?a.substring(o+1,s):""}async function De(){const a=e(f)[e(m)];if(a){let s,o;e(i)?(o=E,s=e(I)):(o=A[e(C)],s=e(g)[e(C)].text);const c=o?.selectionStart||0,h=s.lastIndexOf(":",c-1);if(h>=0){const _=s.substring(0,h),u=s.substring(c);if(e(i)){const l=`${_}${a} ${u}`;r(I,l),t.props.speakers.length===0?t.props.value=l:t.props.value=await t.shared.server.unformat({text:l}),ee().then(()=>{if(E){const n=_.length+a.length+1;E.setSelectionRange(n,n),E.focus()}})}else{const l=_.replace(/\[S\d+\]/g,"").trim(),n=`${l}${a} ${u}`;ce(e(C),"text",n),ee().then(()=>{const p=A[e(C)];if(p){const S=l.length+a.length+1;p.setSelectionRange(S,S),p.focus()}})}}r(b,!1),r(m,0)}}async function Te(a){a=parseInt(a);const s=t.props.tags[a];if(s){let o,c;e(i)?(c=E,o=e(I)):(c=A[e(C)],o=e(g)[e(C)].text);const h=c?.selectionStart||0,_=o.lastIndexOf(":",h-1);if(_>=0){const u=o.substring(0,_),l=o.substring(h);if(e(i)){const n=`${u}${s} ${l}`;r(I,n),t.props.speakers.length===0?t.props.value=n:t.props.value=await t.shared.server.unformat({text:n}),ee().then(()=>{if(E){const p=u.length+s.length+1;E.setSelectionRange(p,p),E.focus()}})}else{const n=u.replace(/\[S\d+\]/g,"").trim(),p=`${n}${s} ${l}`;ce(e(C),"text",p),ee().then(()=>{const S=A[e(C)];if(S){const Z=n.length+s.length+1;S.setSelectionRange(Z,Z),S.focus()}})}}r(b,!1),r(m,0)}}function Qe(a){if(e(b)){const s=a.target,o=document.querySelector('[data-testid="dialogue-tag-menu"]');o&&!o.contains(s)&&r(b,!1)}}async function pe(a){return typeof a=="string"?a:await t.shared.server.format(a)}async function We(){if("clipboard"in navigator){const a=await pe(t.props.value);await navigator.clipboard.writeText(a),Xe()}}function Xe(){r(ae,!0),ue&&clearTimeout(ue),ue=setTimeout(()=>{r(ae,!1)},1e3)}async function Ze(){e(i)&&(t.props.value=await t.shared.server.unformat({text:e(I)})),t.dispatch("submit")}vt(async()=>{if(typeof t.props.value=="string")r(I,t.props.value,!0);else if(t.props.value&&t.props.value.length>0){const a=await pe(t.props.value);r(I,a,!0)}else r(I,"")});var oe=Gt();B("click",gt,Qe);let Oe;var Be=k(oe);{var je=a=>{wt(a,{get buttons(){return e(H)},on_custom_button_click:te,children:(s,o)=>{var c=Le(),h=we(c);{var _=u=>{{let l=O(()=>e(ae)?ht:bt),n=O(()=>e(ae)?"Copied":"Copy");_t(u,{get Icon(){return e(l)},onclick:We,get label(){return e(n)}})}};D(h,u=>{e(H).some(l=>typeof l=="string"&&l==="copy")&&u(_)})}$(s,c)},$$slots:{default:!0}})};D(Be,a=>{t.shared.show_label&&(e(H).some(s=>typeof s=="string"&&s==="copy")||e(H).some(s=>typeof s!="string"))&&a(je)})}var Pe=M(Be,2);mt(Pe,{get show_label(){return t.shared.show_label},get info(){return t.props.info},children:(a,s)=>{ft();var o=Ae();q(()=>ke(o,t.shared.label||"Dialogue")),$(a,o)},$$slots:{default:!0}});var Me=M(Pe,2);{var Fe=a=>{var s=Tt();let o;var c=k(s);{let h=O(()=>e(X)||e(W));Dt(c,{label:"Plain Text",get disabled(){return e(h)},get checked(){return e(i)},set checked(_){r(i,_,!0)},$$events:{click:async _=>{if(_.detail.checked){r(X,!0);try{r(I,await pe(e(g)),!0)}finally{r(X,!1)}}else{r(W,!0);try{t.props.value=await t.shared.server.unformat({text:e(I)}),r(g,[...t.props.value],!0)}finally{r(W,!1)}}}}})}w(s),q(()=>o=j(s,1,"switch-container top-switch svelte-1y1egvg",null,o,{"switch-disabled":e(X)||e(W)})),$(a,s)};D(Me,a=>{t.props.ui_mode==="both"&&a(Fe)})}var Ee=M(Me,2);{var Ke=a=>{var s=Rt();let o;var c=k(s);{var h=u=>{var l=Ot();ie(3,l,()=>de,()=>({duration:200})),$(u,l)};D(c,u=>{e(W)&&u(h)})}var _=M(c,2);lt(_,17,()=>e(g),it,(u,l,n)=>{var p=Et(),S=k(p),Z=k(S);{var v=d=>{var x=Bt();ye(x),q(()=>x.disabled=e(y)),xe(x,()=>e(l).speaker,N=>e(l).speaker=N),$(d,x)},U=d=>{{let x=O(()=>t.props.speakers.map(N=>[N,N]));$t(d,{label:"",show_label:!1,container:!0,interactive:!0,get value(){return e(l).speaker},get choices(){return e(x)},on_change:N=>ce(n,"speaker",N)})}};D(Z,d=>{e(y)?d(v):d(U,!1)})}w(S);var V=M(S,2),le=k(V),L=k(le);ye(L),me(L,(d,x)=>A[x]=d,d=>A?.[d],()=>[n]);var ve=M(L,2);{var z=d=>{var x=Pt(),N=k(x);{let J=O(()=>t.props.tags.map((Q,rt)=>[Q,rt])),fe=O(()=>e(f).map(Q=>t.props.tags.indexOf(Q))),st=O(()=>e(f).map(Q=>t.props.tags.indexOf(Q))[e(m)]);Ne(N,{get choices(){return e(J)},get filtered_indices(){return e(fe)},get active_index(){return e(st)},show_options:!0,onchange:Q=>Te(Q),get offset_from_top(){return e(Ie)},from_top:!0})}w(x),ie(3,x,()=>de,()=>({duration:100})),$(d,x)};D(ve,d=>{e(b)&&e(C)===n&&d(z)})}w(le),w(V);var ne=M(V,2);{var tt=d=>{var x=Mt();let N;var J=k(x);F(J,"data-testid",`dialogue-add-button-${n}`);var fe=k(J);yt(fe),w(J),w(x),q(()=>{N=j(x,1,"svelte-1y1egvg",null,N,{"action-column":n==0,hidden:e(y)}),J.disabled=e(y)}),B("click",J,()=>ze(n)),$(d,x)};D(ne,d=>{(t.props.max_lines==null||t.props.max_lines&&n{nt(p,`--speaker-bg-color: ${(e(y)&&(e(se)===null||e(se)===e(l).speaker)&&e(Ue)[e(l).speaker]||"transparent")??""}`),F(L,"placeholder",t.props.placeholder),L.disabled=e(y),Re=j(ge,1,"action-column svelte-1y1egvg",null,Re,{hidden:e(y)||n==0}),Y.disabled=e(y)}),B("mouseenter",S,()=>e(y)&&r(se,e(l).speaker,!0)),B("mouseleave",S,()=>e(y)&&r(se,null)),xe(L,()=>e(l).text,d=>e(l).text=d),B("input",L,d=>re(d,n)),B("focus",L,d=>re(d,n)),B("keydown",L,d=>{d.key==="Escape"&&e(b)?(r(b,!1),r(m,0),d.preventDefault()):e(b)&&e(C)===n&&(d.key==="ArrowDown"?(r(m,Math.min(e(m)+1,e(f).length-1),!0),d.preventDefault()):d.key==="ArrowUp"?(r(m,Math.max(e(m)-1,0),!0),d.preventDefault()):d.key==="Enter"&&(e(f)[e(m)]&&De(),d.preventDefault()))}),B("click",Y,()=>He(n)),$(u,p)}),w(s),me(s,u=>R=u,()=>R),q(()=>o=j(s,1,"dialogue-container svelte-1y1egvg",null,o,{loading:e(W)})),$(a,s)},Ve=a=>{var s=Le(),o=we(s);{var c=h=>{var _=Nt();let u;var l=k(_);{var n=v=>{var U=At();ie(3,U,()=>de,()=>({duration:200})),$(v,U)};D(l,v=>{e(X)&&v(n)})}var p=M(l,2);ye(p),F(p,"rows",5),me(p,v=>E=v,()=>E);var S=M(p,2);{var Z=v=>{var U=Lt(),V=k(U);{let le=O(()=>t.props.tags.map((z,ne)=>[z,ne])),L=O(()=>e(f).map(z=>t.props.tags.indexOf(z))),ve=O(()=>e(f).map(z=>t.props.tags.indexOf(z))[e(m)]);Ne(V,{get choices(){return e(le)},get filtered_indices(){return e(L)},get active_index(){return e(ve)},show_options:!0,onchange:z=>Te(z)})}w(U),ie(3,U,()=>de,()=>({duration:100})),$(v,U)};D(S,v=>{e(b)&&v(Z)})}w(_),q(()=>{u=j(_,1,"textarea-container svelte-1y1egvg",null,u,{loading:e(X)}),F(p,"placeholder",t.props.placeholder),p.disabled=e(y)}),xe(p,()=>e(I),v=>r(I,v)),B("input",p,v=>{re(v,0),t.props.value=e(I)}),B("focus",p,v=>re(v,0)),B("keydown",p,v=>{v.key==="Escape"&&e(b)?(r(b,!1),r(m,0),v.preventDefault()):e(b)&&(v.key==="ArrowDown"?(r(m,Math.min(e(m)+1,e(f).length-1),!0),v.preventDefault()):v.key==="ArrowUp"?(r(m,Math.max(e(m)-1,0),!0),v.preventDefault()):v.key==="Enter"&&(e(f)[e(m)]&&De(),v.preventDefault()))}),$(h,_)};D(o,h=>{(e(i)||t.props.ui_mode!=="dialogue")&&h(c)},!0)}$(a,s)};D(Ee,a=>{!e(i)&&t.props.ui_mode!=="text"?a(Ke):a(Ve,!1)})}var Ye=M(Ee,2);{var et=a=>{var s=qt(),o=k(s),c=k(o);{var h=u=>{var l=Ae();q(()=>ke(l,t.props.submit_btn)),$(u,l)},_=u=>{xt(u)};D(c,u=>{typeof t.props.submit_btn=="string"?u(h):u(_,!1)})}w(o),w(s),q(()=>o.disabled=e(y)),B("click",o,Ze),$(a,s)};D(Ye,a=>{t.props.submit_btn&&!e(y)&&a(et)})}w(oe),q(()=>Oe=j(oe,1,"svelte-1y1egvg",null,Oe,{container:t.shared.container})),$(K,oe),Ce()}var zt=T(" ",1);function pa(K,G){$e(G,!0);const t=ut(G,["$$slots","$$events","$$legacy"]),i=new dt(t);let y=P(!1),g=i.props.value;qe(()=>{e(y)||(g=i.props.value,r(y,!0)),JSON.stringify(g)!=JSON.stringify(i.props.value)&&(g=i.props.value,i.dispatch("change"))}),Ct(K,{get visible(){return i.shared.visible},get elem_id(){return i.shared.elem_id},get elem_classes(){return i.shared.elem_classes},get scale(){return i.shared.scale},get min_width(){return i.shared.min_width},allow_overflow:!0,get padding(){return i.shared.container},children:(H,te)=>{var R=zt(),b=we(R);{var C=f=>{It(f,ct({get autoscroll(){return i.shared.autoscroll},get i18n(){return i.i18n}},()=>i.shared.loading_status,{on_clear_status:()=>i.dispatch("clear_status",i.shared.loading_status)}))};D(b,f=>{i.shared.loading_status&&f(C)})}var m=M(b,2);Ut(m,{get gradio(){return i}}),$(H,R)},$$slots:{default:!0}}),Ce()}export{Ut as BaseDialogue,fa as BaseExample,pa as default}; diff --git a/assets/Index-CXv3_vP_.js b/assets/Index-CXv3_vP_.js deleted file mode 100644 index 2b45265e294adedbf5ab5b1e3090f3b2029cd332..0000000000000000000000000000000000000000 --- a/assets/Index-CXv3_vP_.js +++ /dev/null @@ -1 +0,0 @@ -import{G as o,r}from"./i18n-CPHyzK9b.js";import{M as t,ac as p,O as c}from"./index-DydPgVMC.js";function u(n,s){t(s,!0);let e=r(s,["$$slots","$$events","$$legacy"]);const a=new o(e);p(()=>{a.props.value&&a.dispatch("change")}),c()}export{u as default}; diff --git a/assets/Index-D2aFMIjl.js b/assets/Index-Cc3URrKg.js similarity index 95% rename from assets/Index-D2aFMIjl.js rename to assets/Index-Cc3URrKg.js index d5219de69e3cf0cb5dc8a554edc82c3194232bc0..ada7176f371dfcb3ba7e4a57fc81eb767985c611 100644 --- a/assets/Index-D2aFMIjl.js +++ b/assets/Index-Cc3URrKg.js @@ -1 +1 @@ -import{p as ve,i as m,d as fe,f as Q,a as S,q as ge,b as U,G as me,r as _e}from"./i18n-CPHyzK9b.js";import{M as W,a7 as ye,t as b,Z as p,X as Z,U as Fe,a as f,O as Y,aa as be,S as h,Q as c,R as g,$ as ke,a2 as xe,T as i,N as we}from"./index-DydPgVMC.js";import{h as M}from"./html-BZIV6tyB.js";import{P as X}from"./prism-python-BGiTAEDL.js";var J={},K;function Ae(){return K||(K=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var r=n.languages.extend("typescript",{});delete r["class-name"],n.languages.typescript["class-name"].inside=r,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),n.languages.ts=n.languages.typescript})(Prism)),J}Ae();var qe=g(' '),Le=g('🔗'),Te=g(": ",1),ze=g('
            default =
            '),Ee=g('

            '),Se=g('
             
            '),Ze=g('
            '),Me=g('
            ');function Ce(n,r){W(r,!0);let q=ve(r,"linkify",19,()=>[]),d,_=be(!1),P="python",C=xe(()=>$(r.docs,P));function I(e,a){let t="param-";return typeof a=="string"&&(t+=a+"-"),t+e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}function O(e,a){let t=X.highlight(e,X.languages[a],a);for(const o of q())t=t.replace(new RegExp(o,"g"),`${o}`);return t}function $(e,a){return e?Object.entries(e).map(([t,{type:o,description:F,default:v}])=>{let x=o?O(o,a):null;return{name:t,type:x,description:F,default:v?O(v,a):null}}):[]}function ee(){ke(_,!p(_)),d.querySelectorAll(".param").forEach(a=>{a instanceof HTMLDetailsElement&&(a.open=p(_))})}function ae(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'$1')}ye(()=>{window.location.hash&&R(window.location.hash),window.addEventListener("hashchange",e=>{R(window.location.hash)})});function R(e){if(!d)return;const a=e.slice(1),t=d.querySelector(`#${a}`);t instanceof HTMLDetailsElement&&(t.open=!0,t.scrollIntoView({behavior:"smooth"}))}const te=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}};var y=Me();let j;var L=c(y),D=c(L);{var re=e=>{var a=qe(),t=c(a,!0);i(a),b(()=>Z(t,r.header)),f(e,a)};m(D,e=>{r.header!==null&&e(re)})}var k=h(D,2),se=c(k,!0);i(k),i(L);var ne=h(L,2);{var le=e=>{var a=Ze();ge(a,21,()=>p(C),({type:t,description:o,default:F,name:v})=>v,(t,o)=>{let F=()=>p(o).type,v=()=>p(o).description,x=()=>p(o).default,T=()=>p(o).name;var w=Se(),z=c(w),G=c(z);{var ie=s=>{var l=Le();b(u=>S(l,"href",`#${u??""}`),[()=>I(T()||"",r.anchor_links)]),f(s,l)};m(G,s=>{r.anchor_links&&s(ie)})}var E=h(G,2);U(E,1,"language-python svelte-5ho88m");var H=c(E),V=c(H,!0),oe=h(V);{var ce=s=>{var l=Te(),u=h(we(l));M(u,F),f(s,l)};m(oe,s=>{F()&&s(ce)})}i(H),i(E),i(z);var B=h(z,2);{var de=s=>{var l=ze();let u;var A=c(l);Q(A,"",{},{"padding-right":"4px"});var N=h(A,2),he=h(c(N));M(he,x),i(N),i(l),b(()=>u=U(l,1,"default svelte-5ho88m",null,u,{last:!v()})),f(s,l)};m(B,s=>{x()&&s(de)})}var pe=h(B,2);{var ue=s=>{var l=Ee(),u=c(l),A=c(u);M(A,()=>ae(v())),i(u),i(l),f(s,l)};m(pe,s=>{v()&&s(ue)})}i(w),b(s=>{S(w,"id",s),Z(V,T())},[()=>r.anchor_links?I(T()||"",r.anchor_links):void 0]),f(t,w)}),i(a),f(e,a)};m(ne,e=>{p(C)&&e(le)})}i(y),fe(y,e=>d=e,()=>d),b(e=>{j=Q(y,"",j,e),S(k,"title",p(_)?"Close All":"Open All"),Z(se,p(_)?"▲":"▼")},[()=>({"max-height":te(r.max_height)})]),Fe("click",k,ee),f(n,y),Y()}function De(n,r){W(r,!0);const q=_e(r,["$$slots","$$events","$$legacy"]),d=new me(q);Ce(n,{get docs(){return d.props.value},get linkify(){return d.props.linkify},get header(){return d.props.header},get anchor_links(){return d.props.anchor_links},get max_height(){return d.props.max_height}}),Y()}export{De as default}; +import{p as ve,i as m,d as fe,f as Q,a as S,q as ge,b as U,G as me,r as _e}from"./i18n-DtG3MAQ1.js";import{M as W,a7 as ye,t as b,Z as p,X as Z,U as Fe,a as f,O as Y,aa as be,S as h,Q as c,R as g,$ as ke,a2 as xe,T as i,N as we}from"./index-BeNBoC9J.js";import{h as M}from"./html-DE4EmiOG.js";import{P as X}from"./prism-python-DV2ZTlpc.js";var J={},K;function Ae(){return K||(K=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var r=n.languages.extend("typescript",{});delete r["class-name"],n.languages.typescript["class-name"].inside=r,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),n.languages.ts=n.languages.typescript})(Prism)),J}Ae();var qe=g(' '),Le=g('🔗'),Te=g(": ",1),ze=g('
            default =
            '),Ee=g('

            '),Se=g('
             
            '),Ze=g('
            '),Me=g('
            ');function Ce(n,r){W(r,!0);let q=ve(r,"linkify",19,()=>[]),d,_=be(!1),P="python",C=xe(()=>$(r.docs,P));function I(e,a){let t="param-";return typeof a=="string"&&(t+=a+"-"),t+e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}function O(e,a){let t=X.highlight(e,X.languages[a],a);for(const o of q())t=t.replace(new RegExp(o,"g"),`${o}`);return t}function $(e,a){return e?Object.entries(e).map(([t,{type:o,description:F,default:v}])=>{let x=o?O(o,a):null;return{name:t,type:x,description:F,default:v?O(v,a):null}}):[]}function ee(){ke(_,!p(_)),d.querySelectorAll(".param").forEach(a=>{a instanceof HTMLDetailsElement&&(a.open=p(_))})}function ae(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'$1')}ye(()=>{window.location.hash&&R(window.location.hash),window.addEventListener("hashchange",e=>{R(window.location.hash)})});function R(e){if(!d)return;const a=e.slice(1),t=d.querySelector(`#${a}`);t instanceof HTMLDetailsElement&&(t.open=!0,t.scrollIntoView({behavior:"smooth"}))}const te=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}};var y=Me();let j;var L=c(y),D=c(L);{var re=e=>{var a=qe(),t=c(a,!0);i(a),b(()=>Z(t,r.header)),f(e,a)};m(D,e=>{r.header!==null&&e(re)})}var k=h(D,2),se=c(k,!0);i(k),i(L);var ne=h(L,2);{var le=e=>{var a=Ze();ge(a,21,()=>p(C),({type:t,description:o,default:F,name:v})=>v,(t,o)=>{let F=()=>p(o).type,v=()=>p(o).description,x=()=>p(o).default,T=()=>p(o).name;var w=Se(),z=c(w),G=c(z);{var ie=s=>{var l=Le();b(u=>S(l,"href",`#${u??""}`),[()=>I(T()||"",r.anchor_links)]),f(s,l)};m(G,s=>{r.anchor_links&&s(ie)})}var E=h(G,2);U(E,1,"language-python svelte-5ho88m");var H=c(E),V=c(H,!0),oe=h(V);{var ce=s=>{var l=Te(),u=h(we(l));M(u,F),f(s,l)};m(oe,s=>{F()&&s(ce)})}i(H),i(E),i(z);var B=h(z,2);{var de=s=>{var l=ze();let u;var A=c(l);Q(A,"",{},{"padding-right":"4px"});var N=h(A,2),he=h(c(N));M(he,x),i(N),i(l),b(()=>u=U(l,1,"default svelte-5ho88m",null,u,{last:!v()})),f(s,l)};m(B,s=>{x()&&s(de)})}var pe=h(B,2);{var ue=s=>{var l=Ee(),u=c(l),A=c(u);M(A,()=>ae(v())),i(u),i(l),f(s,l)};m(pe,s=>{v()&&s(ue)})}i(w),b(s=>{S(w,"id",s),Z(V,T())},[()=>r.anchor_links?I(T()||"",r.anchor_links):void 0]),f(t,w)}),i(a),f(e,a)};m(ne,e=>{p(C)&&e(le)})}i(y),fe(y,e=>d=e,()=>d),b(e=>{j=Q(y,"",j,e),S(k,"title",p(_)?"Close All":"Open All"),Z(se,p(_)?"▲":"▼")},[()=>({"max-height":te(r.max_height)})]),Fe("click",k,ee),f(n,y),Y()}function De(n,r){W(r,!0);const q=_e(r,["$$slots","$$events","$$legacy"]),d=new me(q);Ce(n,{get docs(){return d.props.value},get linkify(){return d.props.linkify},get header(){return d.props.header},get anchor_links(){return d.props.anchor_links},get max_height(){return d.props.max_height}}),Y()}export{De as default}; diff --git a/assets/Index-CST2XYRw.js b/assets/Index-CemHVIr2.js similarity index 79% rename from assets/Index-CST2XYRw.js rename to assets/Index-CemHVIr2.js index 5d2cafa56b16ed7b833fe0b8ecd5c877eca331ef..e5f7124ea680a5e1e37a3e90fae9ef1589cd0679 100644 --- a/assets/Index-CST2XYRw.js +++ b/assets/Index-CemHVIr2.js @@ -1 +1 @@ -import{G as _,f as g,s as b,a as p,b as v,r as f}from"./i18n-CPHyzK9b.js";import{M as x,t as w,a as y,O as $,Q as r,R as j,T as i}from"./index-DydPgVMC.js";var k=j('
            ');function M(m,t){x(t,!0);const n=f(t,["$$slots","$$events","$$legacy"]),s=new _(n);var e=k();let l;var a=r(e);let o;var d=r(a);g(d,"",{},{"--block-radius":"0px","--block-border-width":"0px","--layout-gap":"1px","--form-gap-width":"1px","--button-border-width":"0px","--button-large-radius":"0px","--button-small-radius":"0px"});var h=r(d);b(h,t,"default",{}),i(d),i(a),i(e),w((u,c)=>{p(e,"id",s.shared.elem_id),l=v(e,1,`gr-group ${u??""}`,"svelte-1g4mm7n",l,{hide:s.shared.visible==="hidden"}),p(a,"id",s.shared.elem_id),o=v(a,1,`gr-group ${c??""}`,"svelte-1g4mm7n",o,{hide:s.shared.visible==="hidden"})},[()=>s.shared.elem_classes?.join(" ")||"",()=>s.shared.elem_classes?.join(" ")||""]),y(m,e),$()}export{M as default}; +import{G as _,f as g,s as b,a as p,b as v,r as f}from"./i18n-DtG3MAQ1.js";import{M as x,t as w,a as y,O as $,Q as r,R as j,T as i}from"./index-BeNBoC9J.js";var k=j('
            ');function M(m,t){x(t,!0);const n=f(t,["$$slots","$$events","$$legacy"]),s=new _(n);var e=k();let l;var a=r(e);let o;var d=r(a);g(d,"",{},{"--block-radius":"0px","--block-border-width":"0px","--layout-gap":"1px","--form-gap-width":"1px","--button-border-width":"0px","--button-large-radius":"0px","--button-small-radius":"0px"});var h=r(d);b(h,t,"default",{}),i(d),i(a),i(e),w((u,c)=>{p(e,"id",s.shared.elem_id),l=v(e,1,`gr-group ${u??""}`,"svelte-1g4mm7n",l,{hide:s.shared.visible==="hidden"}),p(a,"id",s.shared.elem_id),o=v(a,1,`gr-group ${c??""}`,"svelte-1g4mm7n",o,{hide:s.shared.visible==="hidden"})},[()=>s.shared.elem_classes?.join(" ")||"",()=>s.shared.elem_classes?.join(" ")||""]),y(m,e),$()}export{M as default}; diff --git a/assets/Index-EyePZPlZ.js b/assets/Index-CfAYzUsl.js similarity index 99% rename from assets/Index-EyePZPlZ.js rename to assets/Index-CfAYzUsl.js index 422efb693511a71b3d1295af6070ca5102d42479..726b2e278c6a1889f659094d451d3d26d689f50f 100644 --- a/assets/Index-EyePZPlZ.js +++ b/assets/Index-CfAYzUsl.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./browserAll-DkqSnwnO.js","./webworkerAll-CFOMp2SO.js","./colorToUniform-3MxHuUz8.js","./i18n-CPHyzK9b.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./misc-Dkc5KZ-v.js","./ImagePreview-C41duyJ0.js","./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js","./snippet-BtHMuX3s.js","./ScrollFade-FmR1tTNV.css","./BlockLabel-BzVeVrtL.js","./DownloadLink-DM2QmhDx.js","./Empty-B15ItVsj.js","./ShareButton-Cuvs43xM.js","./Download-DWSaBiea.js","./Image-DBmW1mOo.js","./IconButtonWrapper-PnNNNvqI.js","./FullscreenButton-BuyUU5Yj.js","./Maximize-DWbY8BRa.js","./Image-CZ1Hb99p.js","./Image-dcYq_y3_.css","./ImagePreview-BZaoS7p0.css","./Block-WPcVj6Bq.js","./index-CfM_uZQa.js","./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js","./html-BZIV6tyB.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BR8cTgGu.js","./Upload-Bq9KuxCu.js","./actions-4RaHFoGI.js","./Upload-DNsX9s0p.css","./Webcam-B-wg5Ly_.js","./DropdownArrow-Cq3QAKSv.js","./Square-D8rV3Ea-.js","./Spinner-C4Ov0as9.js","./StreamingBar-CzgHaKX0.js","./ImageUploader-BRUNiKXB.css","./window-D5YXrKnH.js","./tinycolor-D4ULLcDx.js","./Plus-BDmybZhd.js","./input-BtIxlP_B.js","./Check-2f8HlfSn.js","./event-modifiers-CdEA5IGF.js","./ArrowUp-aILrPIpo.js","./Trash-CJrspSVZ.js","./Undo-B9SlrYtT.js","./Example-DEQ0XKtP.css","./WebGPURenderer-CSJjM6oL.js","./SharedSystems-C07l2FX_.js","./WebGLRenderer-DBblrsTz.js"])))=>i.map(i=>d[i]); -import{F as ai,p as I,e as we,i as Z,a as Ue,b as ne,f as ze,L as Uo,d as Qe,q as Bi,w as Li,v as No,J as Fh,k as Ne,t as Bh,u as Lh,s as Oh,r as Gh,G as Dh,g as yn}from"./i18n-CPHyzK9b.js";import{a as H,f as oe,ah as Uh,M as de,Y as yt,$ as W,x as X,_ as Le,Q as it,S as Y,T as J,t as Vt,Z as m,O as _e,a0 as K,P as z,X as Fe,R as nt,af as ps,a7 as Wo,U as qt,au as xn,N as $t,v as Rt,G as xr,a1 as Oe,ad as Dt,a2 as Ht,ar as Ho,a3 as ci,as as Os,aa as Nh,at as Gs}from"./index-DydPgVMC.js";import{b as pe}from"./misc-Dkc5KZ-v.js";import{I as Wh}from"./ImagePreview-C41duyJ0.js";import{B as bn}from"./Block-WPcVj6Bq.js";import{U as Hh,a as Vh,W as jh,I as se}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{s as Ds,S as vn}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";/* empty css */import{c as Xh}from"./Upload-Bq9KuxCu.js";/* empty css *//* empty css */import{C as wn,b as si,W as Yh}from"./Webcam-B-wg5Ly_.js";import{a as As}from"./actions-4RaHFoGI.js";import{I as Vo}from"./Image-DBmW1mOo.js";import{b as kn}from"./window-D5YXrKnH.js";import{t as ce,E as qh}from"./tinycolor-D4ULLcDx.js";import{P as jo}from"./Plus-BDmybZhd.js";import{b as $h}from"./input-BtIxlP_B.js";import{C as Xo}from"./Check-2f8HlfSn.js";/* empty css */import{s as gs}from"./event-modifiers-CdEA5IGF.js";import{A as Kh}from"./ArrowUp-aILrPIpo.js";import{C as Zh}from"./Clear-BR8cTgGu.js";import{D as Qh}from"./Download-DWSaBiea.js";import{T as Jh}from"./Trash-CJrspSVZ.js";import{U as tl}from"./Undo-B9SlrYtT.js";import{I as el}from"./IconButtonWrapper-PnNNNvqI.js";import{B as il}from"./BlockLabel-BzVeVrtL.js";var sl=oe('');function rl(s){var t=sl();H(s,t)}var nl=oe('');function ol(s){var t=nl();H(s,t)}var al=oe('');function hl(s){var t=al();H(s,t)}var ll=oe('');function cl(s){var t=ll();H(s,t)}var ul=oe('');function dl(s){var t=ul();H(s,t)}var _l=oe('');function fl(s){var t=_l();H(s,t)}var pl=oe('');function gl(s){var t=pl();H(s,t)}var ml=oe('');function yl(s){var t=ml();H(s,t)}var xl=oe('');function bl(s){var t=xl();H(s,t)}var vl=oe('');function wl(s){var t=vl();H(s,t)}var kl=oe('');function Al(s){var t=kl();H(s,t)}var Sl=oe('');function Cl(s){var t=Sl();H(s,t)}var Ml=oe('');function Tl(s){var t=Ml();H(s,t)}var Pl=oe('');function Il(s){var t=Pl();H(s,t)}class ms{command;next;previous;constructor(t){this.command=t||null,this.next=null,this.previous=null}push(t){this.next=null;const e=new ms(t);e.previous=this,this.next=e}}class zl{history=new ms;current_history=ai(this.history);undo(){this.history.previous&&(this.history.command?.undo(),this.history=this.history.previous,this.current_history.update(()=>this.history))}redo(t){this.history.next&&(this.history=this.history.next,this.history.command?.execute(t),this.current_history.update(()=>this.history))}async execute(t,e){await t.execute(e),this.history.push(t),this.history=this.history.next,this.current_history.update(()=>this.history)}async wait_for_next_frame(){return new Promise(t=>{requestAnimationFrame(()=>{t()})})}async replay(t,e){for(;t.previous;)t=t.previous;for(;t.next;)await t.next.command.execute(e),t=t.next;this.history=t,this.current_history.update(()=>this.history)}contains(t){let e=this.history;for(;e;){if(e.command?.name===t)return!0;e=e.next}return!1}reset(){this.history=new ms,this.current_history.update(()=>this.history)}}var El=nt(' '),Rl=nt(' '),Fl=nt("");function le(s,t){de(t,!1);const e=K();let i=I(t,"Icon",12),r=I(t,"label",12,""),n=I(t,"show_label",12,!1),o=I(t,"pending",12,!1),a=I(t,"size",12,"small"),h=I(t,"padded",12,!0),l=I(t,"highlight",12,!1),c=I(t,"disabled",12,!1),u=I(t,"hasPopup",12,!1),_=I(t,"color",12,"var(--block-label-text-color)"),d=I(t,"transparent",12,!1),f=I(t,"background",12,"var(--background-fill-primary)"),g=I(t,"offset",12,0),p=I(t,"label_position",12,"left"),y=I(t,"roundedness",12,"quite"),x=I(t,"onclick",12,void 0);yt(()=>(X(l()),X(_())),()=>{W(e,l()?"var(--color-accent)":_().toString())}),Le();var v={get Icon(){return i()},set Icon(B){i(B),z()},get label(){return r()},set label(B){r(B),z()},get show_label(){return n()},set show_label(B){n(B),z()},get pending(){return o()},set pending(B){o(B),z()},get size(){return a()},set size(B){a(B),z()},get padded(){return h()},set padded(B){h(B),z()},get highlight(){return l()},set highlight(B){l(B),z()},get disabled(){return c()},set disabled(B){c(B),z()},get hasPopup(){return u()},set hasPopup(B){u(B),z()},get color(){return _()},set color(B){_(B),z()},get transparent(){return d()},set transparent(B){d(B),z()},get background(){return f()},set background(B){f(B),z()},get offset(){return g()},set offset(B){g(B),z()},get label_position(){return p()},set label_position(B){p(B),z()},get roundedness(){return y()},set roundedness(B){y(B),z()},get onclick(){return x()},set onclick(B){x(B),z()}};we();var b=Fl();b.__click=function(...B){x()?.apply(this,B)};let M,w;var k=it(b);{var R=B=>{var rt=El(),L=it(rt,!0);J(rt),Vt(()=>Fe(L,r())),H(B,rt)};Z(k,B=>{n()&&p()==="left"&&B(R)})}var S=Y(k,2);let P;var F=it(S);i()(F,{}),J(S);var N=Y(S,2);{var U=B=>{var rt=Rl(),L=it(rt,!0);J(rt),Vt(()=>Fe(L,r())),H(B,rt)};Z(N,B=>{n()&&p()==="right"&&B(U)})}return J(b),Vt(()=>{b.disabled=c(),Ue(b,"aria-label",r()),Ue(b,"aria-haspopup",u()),Ue(b,"title",r()),M=ne(b,1,`${y()??""}-round`,"svelte-1ovfjjn",M,{pending:o(),padded:h(),highlight:l(),transparent:d()}),w=ze(b,"",w,{color:!c()&&m(e)?m(e):"var(--block-label-text-color)","--bg-color":c()?"auto":f(),"margin-left":g()+"px"}),P=ne(S,1,"svelte-1ovfjjn",null,P,{small:a()==="small",large:a()==="large",medium:a()==="medium"})}),H(s,b),_e(v)}Uh(["click"]);function Kr(s,t){const e=i=>{s&&!s.contains(i.target)&&!i.defaultPrevented&&t(i)};return document.addEventListener("mousedown",e,!0),{destroy(){document.removeEventListener("mousedown",e,!0)}}}var q=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s.ShapeBuilder="shape-builder",s.Batcher="batcher",s))(q||{});const br=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},Yi=(s,t)=>br(s).priority??t,Kt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(br).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...s){return s.map(br).forEach(t=>{t.type.forEach(e=>{const i=this._addHandlers,r=this._queue;i[e]?i[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))})}),this},handle(s,t,e){const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&(n[s]?.forEach(o=>t(o)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>Yi(o.value,e)-Yi(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>Yi(n,e)-Yi(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})},mixin(s,...t){for(const e of t)Object.defineProperties(s.prototype,Object.getOwnPropertyDescriptors(e))}},Bl={extension:{type:q.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ps(()=>import("./browserAll-DkqSnwnO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url)}},Ll={extension:{type:q.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ps(()=>import("./webworkerAll-CFOMp2SO.js"),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url)}};class Zt{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new Zt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Us={exports:{}},An;function Ol(){return An||(An=1,(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,_){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new r(c,u||h,_),f=e?e+l:l;return h._events[f]?h._events[f].fn?h._events[f]=[h._events[f],d]:h._events[f].push(d):(h._events[f]=d,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var _=0,d=u.length,f=new Array(d);_je[s],uY:s=>Xe[s],vX:s=>Ye[s],vY:s=>qe[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>vr[s][t],sub:(s,t)=>vr[s][Ct.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?Ct.S:Ct.N:Math.abs(t)*2<=Math.abs(s)?s>0?Ct.E:Ct.W:t>0?s>0?Ct.SE:Ct.SW:s>0?Ct.NE:Ct.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Yo[Ct.inv(t)];r.tx=e,r.ty=i,s.append(r)},transformRectCoords:(s,t,e,i)=>{const{x:r,y:n,width:o,height:a}=s,{x:h,y:l,width:c,height:u}=t;return e===Ct.E?(i.set(r+h,n+l,o,a),i):e===Ct.S?i.set(c-n-a+h,r+l,a,o):e===Ct.W?i.set(c-r-o+h,u-n-a+l,o,a):e===Ct.N?i.set(n+h,u-r-o+l,a,o):i.set(r+h,n+l,o,a)}},$i=[new dt,new dt,new dt,new dt];class Mt{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Mt(0,0,0,0)}clone(){return new Mt(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=u&&t<=_&&e>=d&&e<=f&&!(t>g&&ty&&et.right?t.right:this.right)<=R)return!1;const P=this.yt.bottom?t.bottom:this.bottom)>P}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=$i[0].set(t.left,t.top),h=$i[1].set(t.left,t.bottom),l=$i[2].set(t.right,t.top),c=$i[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=i||Math.min(a.x,h.x,l.x,c.x)>=r||Math.max(a.y,h.y,l.y,c.y)<=n||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const _=u*(h.y-a.y),d=u*(a.x-h.x),f=_*i+d*n,g=_*r+d*n,p=_*i+d*o,y=_*r+d*o;if(Math.max(f,g,p,y)<=_*a.x+d*a.y||Math.min(f,g,p,y)>=_*c.x+d*c.y)return!1;const x=u*(a.y-l.y),v=u*(l.x-a.x),b=x*i+v*n,M=x*r+v*n,w=x*i+v*o,k=x*r+v*o;return!(Math.max(b,M,w,k)<=x*a.x+v*a.y||Math.min(b,M,w,k)>=x*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t||(t=new Mt),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,i=t.y,r=t.x+t.width,n=t.y+t.height;return e>=this.x&&e=this.y&&i=this.x&&r=this.y&&n{if(oi.quiet||Sn.has(t))return;let i=new Error().stack;const r=`${t} +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./browserAll-BLR9WkdK.js","./webworkerAll-BBEgGV1p.js","./colorToUniform-3MxHuUz8.js","./i18n-DtG3MAQ1.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./misc-D-Y84gKJ.js","./ImagePreview-Dr2yPezw.js","./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js","./snippet-BRIBYCwB.js","./ScrollFade-FmR1tTNV.css","./BlockLabel-CEOjqpu7.js","./DownloadLink-Dk6GrGSA.js","./Empty-Clj0ErcW.js","./ShareButton-ImGYvlzQ.js","./Download-0gCL6VXM.js","./Image-DWBzZYev.js","./IconButtonWrapper-Ce5bzAyh.js","./FullscreenButton-CFl3IB4T.js","./Maximize-DQMU3SdR.js","./Image-ALBOEs1f.js","./Image-dcYq_y3_.css","./ImagePreview-BZaoS7p0.css","./Block-DkzyQHli.js","./index-1YthqPsU.js","./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js","./html-DE4EmiOG.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BiKSVifk.js","./Upload-CGTpHDBO.js","./actions-BbCJS635.js","./Upload-DNsX9s0p.css","./Webcam-rfzmXTkZ.js","./DropdownArrow-C0w6FgSo.js","./Square-CSlbzSkn.js","./Spinner-Hiq4LkuG.js","./StreamingBar-BFOdhKj-.js","./ImageUploader-BRUNiKXB.css","./window-ChwzOWAi.js","./tinycolor-DFnlDftg.js","./Plus-P6-znuRS.js","./input-BLFxNjIx.js","./Check-DjGw_9dO.js","./event-modifiers-CdEA5IGF.js","./ArrowUp-BNDE3Ai4.js","./Trash-BLpDLXq5.js","./Undo-Bu_OzfgD.js","./Example-DEQ0XKtP.css","./WebGPURenderer-DX2ilI_9.js","./SharedSystems-B7u4609a.js","./WebGLRenderer-CPdlouOR.js"])))=>i.map(i=>d[i]); +import{F as ai,p as I,e as we,i as Z,a as Ue,b as ne,f as ze,L as Uo,d as Qe,q as Bi,w as Li,v as No,J as Fh,k as Ne,t as Bh,u as Lh,s as Oh,r as Gh,G as Dh,g as yn}from"./i18n-DtG3MAQ1.js";import{a as H,f as oe,ah as Uh,M as de,Y as yt,$ as W,x as X,_ as Le,Q as it,S as Y,T as J,t as Vt,Z as m,O as _e,a0 as K,P as z,X as Fe,R as nt,af as ps,a7 as Wo,U as qt,au as xn,N as $t,v as Rt,G as xr,a1 as Oe,ad as Dt,a2 as Ht,ar as Ho,a3 as ci,as as Os,aa as Nh,at as Gs}from"./index-BeNBoC9J.js";import{b as pe}from"./misc-D-Y84gKJ.js";import{I as Wh}from"./ImagePreview-Dr2yPezw.js";import{B as bn}from"./Block-DkzyQHli.js";import{U as Hh,a as Vh,W as jh,I as se}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{s as Ds,S as vn}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";/* empty css */import{c as Xh}from"./Upload-CGTpHDBO.js";/* empty css *//* empty css */import{C as wn,b as si,W as Yh}from"./Webcam-rfzmXTkZ.js";import{a as As}from"./actions-BbCJS635.js";import{I as Vo}from"./Image-DWBzZYev.js";import{b as kn}from"./window-ChwzOWAi.js";import{t as ce,E as qh}from"./tinycolor-DFnlDftg.js";import{P as jo}from"./Plus-P6-znuRS.js";import{b as $h}from"./input-BLFxNjIx.js";import{C as Xo}from"./Check-DjGw_9dO.js";/* empty css */import{s as gs}from"./event-modifiers-CdEA5IGF.js";import{A as Kh}from"./ArrowUp-BNDE3Ai4.js";import{C as Zh}from"./Clear-BiKSVifk.js";import{D as Qh}from"./Download-0gCL6VXM.js";import{T as Jh}from"./Trash-BLpDLXq5.js";import{U as tl}from"./Undo-Bu_OzfgD.js";import{I as el}from"./IconButtonWrapper-Ce5bzAyh.js";import{B as il}from"./BlockLabel-CEOjqpu7.js";var sl=oe('');function rl(s){var t=sl();H(s,t)}var nl=oe('');function ol(s){var t=nl();H(s,t)}var al=oe('');function hl(s){var t=al();H(s,t)}var ll=oe('');function cl(s){var t=ll();H(s,t)}var ul=oe('');function dl(s){var t=ul();H(s,t)}var _l=oe('');function fl(s){var t=_l();H(s,t)}var pl=oe('');function gl(s){var t=pl();H(s,t)}var ml=oe('');function yl(s){var t=ml();H(s,t)}var xl=oe('');function bl(s){var t=xl();H(s,t)}var vl=oe('');function wl(s){var t=vl();H(s,t)}var kl=oe('');function Al(s){var t=kl();H(s,t)}var Sl=oe('');function Cl(s){var t=Sl();H(s,t)}var Ml=oe('');function Tl(s){var t=Ml();H(s,t)}var Pl=oe('');function Il(s){var t=Pl();H(s,t)}class ms{command;next;previous;constructor(t){this.command=t||null,this.next=null,this.previous=null}push(t){this.next=null;const e=new ms(t);e.previous=this,this.next=e}}class zl{history=new ms;current_history=ai(this.history);undo(){this.history.previous&&(this.history.command?.undo(),this.history=this.history.previous,this.current_history.update(()=>this.history))}redo(t){this.history.next&&(this.history=this.history.next,this.history.command?.execute(t),this.current_history.update(()=>this.history))}async execute(t,e){await t.execute(e),this.history.push(t),this.history=this.history.next,this.current_history.update(()=>this.history)}async wait_for_next_frame(){return new Promise(t=>{requestAnimationFrame(()=>{t()})})}async replay(t,e){for(;t.previous;)t=t.previous;for(;t.next;)await t.next.command.execute(e),t=t.next;this.history=t,this.current_history.update(()=>this.history)}contains(t){let e=this.history;for(;e;){if(e.command?.name===t)return!0;e=e.next}return!1}reset(){this.history=new ms,this.current_history.update(()=>this.history)}}var El=nt(' '),Rl=nt(' '),Fl=nt("");function le(s,t){de(t,!1);const e=K();let i=I(t,"Icon",12),r=I(t,"label",12,""),n=I(t,"show_label",12,!1),o=I(t,"pending",12,!1),a=I(t,"size",12,"small"),h=I(t,"padded",12,!0),l=I(t,"highlight",12,!1),c=I(t,"disabled",12,!1),u=I(t,"hasPopup",12,!1),_=I(t,"color",12,"var(--block-label-text-color)"),d=I(t,"transparent",12,!1),f=I(t,"background",12,"var(--background-fill-primary)"),g=I(t,"offset",12,0),p=I(t,"label_position",12,"left"),y=I(t,"roundedness",12,"quite"),x=I(t,"onclick",12,void 0);yt(()=>(X(l()),X(_())),()=>{W(e,l()?"var(--color-accent)":_().toString())}),Le();var v={get Icon(){return i()},set Icon(B){i(B),z()},get label(){return r()},set label(B){r(B),z()},get show_label(){return n()},set show_label(B){n(B),z()},get pending(){return o()},set pending(B){o(B),z()},get size(){return a()},set size(B){a(B),z()},get padded(){return h()},set padded(B){h(B),z()},get highlight(){return l()},set highlight(B){l(B),z()},get disabled(){return c()},set disabled(B){c(B),z()},get hasPopup(){return u()},set hasPopup(B){u(B),z()},get color(){return _()},set color(B){_(B),z()},get transparent(){return d()},set transparent(B){d(B),z()},get background(){return f()},set background(B){f(B),z()},get offset(){return g()},set offset(B){g(B),z()},get label_position(){return p()},set label_position(B){p(B),z()},get roundedness(){return y()},set roundedness(B){y(B),z()},get onclick(){return x()},set onclick(B){x(B),z()}};we();var b=Fl();b.__click=function(...B){x()?.apply(this,B)};let M,w;var k=it(b);{var R=B=>{var rt=El(),L=it(rt,!0);J(rt),Vt(()=>Fe(L,r())),H(B,rt)};Z(k,B=>{n()&&p()==="left"&&B(R)})}var S=Y(k,2);let P;var F=it(S);i()(F,{}),J(S);var N=Y(S,2);{var U=B=>{var rt=Rl(),L=it(rt,!0);J(rt),Vt(()=>Fe(L,r())),H(B,rt)};Z(N,B=>{n()&&p()==="right"&&B(U)})}return J(b),Vt(()=>{b.disabled=c(),Ue(b,"aria-label",r()),Ue(b,"aria-haspopup",u()),Ue(b,"title",r()),M=ne(b,1,`${y()??""}-round`,"svelte-1ovfjjn",M,{pending:o(),padded:h(),highlight:l(),transparent:d()}),w=ze(b,"",w,{color:!c()&&m(e)?m(e):"var(--block-label-text-color)","--bg-color":c()?"auto":f(),"margin-left":g()+"px"}),P=ne(S,1,"svelte-1ovfjjn",null,P,{small:a()==="small",large:a()==="large",medium:a()==="medium"})}),H(s,b),_e(v)}Uh(["click"]);function Kr(s,t){const e=i=>{s&&!s.contains(i.target)&&!i.defaultPrevented&&t(i)};return document.addEventListener("mousedown",e,!0),{destroy(){document.removeEventListener("mousedown",e,!0)}}}var q=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s.ShapeBuilder="shape-builder",s.Batcher="batcher",s))(q||{});const br=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},Yi=(s,t)=>br(s).priority??t,Kt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(br).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...s){return s.map(br).forEach(t=>{t.type.forEach(e=>{const i=this._addHandlers,r=this._queue;i[e]?i[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))})}),this},handle(s,t,e){const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&(n[s]?.forEach(o=>t(o)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>Yi(o.value,e)-Yi(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>Yi(n,e)-Yi(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})},mixin(s,...t){for(const e of t)Object.defineProperties(s.prototype,Object.getOwnPropertyDescriptors(e))}},Bl={extension:{type:q.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ps(()=>import("./browserAll-BLR9WkdK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url)}},Ll={extension:{type:q.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ps(()=>import("./webworkerAll-BBEgGV1p.js"),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url)}};class Zt{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new Zt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Us={exports:{}},An;function Ol(){return An||(An=1,(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,_){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new r(c,u||h,_),f=e?e+l:l;return h._events[f]?h._events[f].fn?h._events[f]=[h._events[f],d]:h._events[f].push(d):(h._events[f]=d,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var _=0,d=u.length,f=new Array(d);_je[s],uY:s=>Xe[s],vX:s=>Ye[s],vY:s=>qe[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>vr[s][t],sub:(s,t)=>vr[s][Ct.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?Ct.S:Ct.N:Math.abs(t)*2<=Math.abs(s)?s>0?Ct.E:Ct.W:t>0?s>0?Ct.SE:Ct.SW:s>0?Ct.NE:Ct.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Yo[Ct.inv(t)];r.tx=e,r.ty=i,s.append(r)},transformRectCoords:(s,t,e,i)=>{const{x:r,y:n,width:o,height:a}=s,{x:h,y:l,width:c,height:u}=t;return e===Ct.E?(i.set(r+h,n+l,o,a),i):e===Ct.S?i.set(c-n-a+h,r+l,a,o):e===Ct.W?i.set(c-r-o+h,u-n-a+l,o,a):e===Ct.N?i.set(n+h,u-r-o+l,a,o):i.set(r+h,n+l,o,a)}},$i=[new dt,new dt,new dt,new dt];class Mt{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Mt(0,0,0,0)}clone(){return new Mt(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=u&&t<=_&&e>=d&&e<=f&&!(t>g&&ty&&et.right?t.right:this.right)<=R)return!1;const P=this.yt.bottom?t.bottom:this.bottom)>P}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=$i[0].set(t.left,t.top),h=$i[1].set(t.left,t.bottom),l=$i[2].set(t.right,t.top),c=$i[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=i||Math.min(a.x,h.x,l.x,c.x)>=r||Math.max(a.y,h.y,l.y,c.y)<=n||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const _=u*(h.y-a.y),d=u*(a.x-h.x),f=_*i+d*n,g=_*r+d*n,p=_*i+d*o,y=_*r+d*o;if(Math.max(f,g,p,y)<=_*a.x+d*a.y||Math.min(f,g,p,y)>=_*c.x+d*c.y)return!1;const x=u*(a.y-l.y),v=u*(l.x-a.x),b=x*i+v*n,M=x*r+v*n,w=x*i+v*o,k=x*r+v*o;return!(Math.max(b,M,w,k)<=x*a.x+v*a.y||Math.min(b,M,w,k)>=x*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t||(t=new Mt),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,i=t.y,r=t.x+t.width,n=t.y+t.height;return e>=this.x&&e=this.y&&i=this.x&&r=this.y&&n{if(oi.quiet||Sn.has(t))return;let i=new Error().stack;const r=`${t} Deprecated since v${s}`,n=typeof console.groupCollapsed=="function"&&!oi.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",r):(i=i.split(` `).splice(e).join(` `),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(i))),Sn.add(t)};Object.defineProperties(ht,{quiet:{get:()=>oi.quiet,set:s=>{oi.quiet=s},enumerable:!0,configurable:!1},noColor:{get:()=>oi.noColor,set:s=>{oi.noColor=s},enumerable:!0,configurable:!1}});const qo=()=>{};function ys(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Cn(s){return!(s&s-1)&&!!s}function $o(s){const t={};for(const e in s)s[e]!==void 0&&(t[e]=s[e]);return t}const Mn=Object.create(null);function Xl(s){const t=Mn[s];return t===void 0&&(Mn[s]=Ot("resource")),t}const Ko=class Zo extends ke{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Zo.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){ht(wt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Xl(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Ko.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let xs=Ko;const Qo=class Jo extends ke{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Ot("textureSource"),this._resourceType="textureSource",this._resourceId=Ot("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Jo.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new xs($o(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Ot("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,i){i||(i=this._resolution),t||(t=this.width),e||(e=this.height);const r=Math.round(t*i),n=Math.round(e*i);return this.width=r/i,this.height=n/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=Ot("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Cn(this.pixelWidth)&&Cn(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Qo.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let ye=Qo;class Zr extends ye{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let i=t.format;i||(e instanceof Float32Array?i="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?i="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?i="rgba16uint":(e instanceof Int8Array,i="bgra8unorm")),super({...t,resource:e,format:i}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Zr.extension=q.TextureSource;const Tn=new gt;class Yl{constructor(t,e){this.mapCoord=new gt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let r=0;rthis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Mt);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Pn,this}set(t,e,i,r){this.minX=t,this.minY=e,this.maxX=i,this.maxY=r}addFrame(t,e,i,r,n){n||(n=this.matrix);const o=n.a,a=n.b,h=n.c,l=n.d,c=n.tx,u=n.ty;let _=this.minX,d=this.minY,f=this.maxX,g=this.maxY,p=o*t+h*e+c,y=a*t+l*e+u;p<_&&(_=p),yf&&(f=p),y>g&&(g=y),p=o*i+h*e+c,y=a*i+l*e+u,p<_&&(_=p),yf&&(f=p),y>g&&(g=y),p=o*t+h*r+c,y=a*t+l*r+u,p<_&&(_=p),yf&&(f=p),y>g&&(g=y),p=o*i+h*r+c,y=a*i+l*r+u,p<_&&(_=p),yf&&(f=p),y>g&&(g=y),this.minX=_,this.minY=d,this.maxX=f,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxXthis.maxX?_:this.maxX,this.maxY=d>this.maxY?d:this.maxY,_=o*e+h*n+c,d=a*e+l*n+u,this.minX=_this.maxX?_:this.maxX,this.maxY=d>this.maxY?d:this.maxY,_=o*r+h*n+c,d=a*r+l*n+u,this.minX=_this.maxX?_:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,i,r){return this.minXe&&(this.maxX=e),this.minYr&&(this.maxY=r),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new ve(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,i,r){let n=this.minX,o=this.minY,a=this.maxX,h=this.maxY;r||(r=this.matrix);const l=r.a,c=r.b,u=r.c,_=r.d,d=r.tx,f=r.ty;for(let g=e;ga?x:a,h=v>h?v:h}this.minX=n,this.minY=o,this.maxX=a,this.maxY=h}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var $l={grad:.9,turn:360,rad:360/(2*Math.PI)},Ie=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},Yt=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},ge=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},ta=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},In=function(s){return{r:ge(s.r,0,255),g:ge(s.g,0,255),b:ge(s.b,0,255),a:ge(s.a)}},Hs=function(s){return{r:Yt(s.r),g:Yt(s.g),b:Yt(s.b),a:Yt(s.a,3)}},Kl=/^#([0-9a-f]{3,8})$/i,Ki=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},ea=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),o=n-Math.min(t,e,i),a=o?n===t?(e-i)/o:n===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},ia=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),o=i*(1-e),a=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:r}},zn=function(s){return{h:ta(s.h),s:ge(s.s,0,100),l:ge(s.l,0,100),a:ge(s.a)}},En=function(s){return{h:Yt(s.h),s:Yt(s.s),l:Yt(s.l),a:Yt(s.a,3)}},Rn=function(s){return ia((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Ii=function(s){return{h:(t=ea(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},Zl=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ql=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Jl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wr={string:[[function(s){var t=Kl.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?Yt(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?Yt(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=Jl.exec(s)||tc.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:In({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(s){var t=Zl.exec(s)||Ql.exec(s);if(!t)return null;var e,i,r=zn({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*($l[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Rn(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return Ie(t)&&Ie(e)&&Ie(i)?In({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!Ie(t)||!Ie(e)||!Ie(i))return null;var o=zn({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return Rn(o)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!Ie(t)||!Ie(e)||!Ie(i))return null;var o=(function(a){return{h:ta(a.h),s:ge(a.s,0,100),v:ge(a.v,0,100),a:ge(a.a)}})({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return ia(o)},"hsv"]]},Fn=function(s,t){for(var e=0;e=.5},s.prototype.toHex=function(){return t=Hs(this.rgba),e=t.r,i=t.g,r=t.b,o=(n=t.a)<1?Ki(Yt(255*n)):"","#"+Ki(e)+Ki(i)+Ki(r)+o;var t,e,i,r,n,o},s.prototype.toRgb=function(){return Hs(this.rgba)},s.prototype.toRgbString=function(){return t=Hs(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return En(Ii(this.rgba))},s.prototype.toHslString=function(){return t=En(Ii(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=ea(this.rgba),{h:Yt(t.h),s:Yt(t.s),v:Yt(t.v),a:Yt(t.a,3)};var t},s.prototype.invert=function(){return Se({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),Se(Vs(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),Se(Vs(this.rgba,-t))},s.prototype.grayscale=function(){return Se(Vs(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),Se(Bn(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),Se(Bn(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?Se({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Yt(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=Ii(this.rgba);return typeof t=="number"?Se({h:t,s:e.s,l:e.l,a:e.a}):Yt(e.h)},s.prototype.isEqual=function(t){return this.toHex()===Se(t).toHex()},s})(),Se=function(s){return s instanceof kr?s:new kr(s)},Ln=[],ic=function(s){s.forEach(function(t){Ln.indexOf(t)<0&&(t(kr,wr),Ln.push(t))})};function sc(s,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=i[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),u=1/0,_="black";if(!n.length)for(var d in e)n[d]=new s(e[d]).toRgb();for(var f in e){var g=(a=c,h=n[f],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));gn===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,i,r]=this._components;return t[0]=e,t[1]=i,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,i]=this.toUint8RgbArray();return(i<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,r,n]=Ci._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=r,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,r=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Ci.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=Se(t);o.isValid()&&({r:e,g:i,b:r,a:n}=o.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=r,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ci||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};ui.shared=new ui;ui._temp=new ui;ui.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let jt=ui;const rc={cullArea:null,cullable:!1,cullableChildren:!0};let Xs=0;const On=500;function It(...s){Xs!==On&&(Xs++,Xs===On?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...s))}const Wi={_registeredResources:new Set,register(s){this._registeredResources.add(s)},unregister(s){this._registeredResources.delete(s)},release(){this._registeredResources.forEach(s=>s.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(s){return this._registeredResources.has(s)},reset(){this._registeredResources.clear()}};class nc{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t{const i=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[i]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const me=new oc;Wi.register(me);const ac={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(s){typeof s=="boolean"&&s===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(s===!0?{}:s))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(s){ht("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(s)}};function hc(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r0&&i<=e){for(let o=e-1;o>=s;o--){const a=this.children[o];a&&(r.push(a),a.parent=null)}hc(this.children,s,e);const n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(r);for(let o=0;o0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(s){const t=this.getChildAt(s);return this.removeChild(t)},getChildAt(s){if(s<0||s>=this.children.length)throw new Error(`getChildAt: Index (${s}) does not exist.`);return this.children[s]},setChildIndex(s,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(s),this.addChildAt(s,t)},getChildIndex(s){const t=this.children.indexOf(s);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(s,t){this.allowChildren||ht(wt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${s}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(s.parent){const r=s.parent.children.indexOf(s);if(s.parent===this&&r===t)return s;r!==-1&&s.parent.children.splice(r,1)}t===e.length?e.push(s):e.splice(t,0,s),s.parent=this,s.didChange=!0,s._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(s),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",s,this,t),s.emit("added",this),s},swapChildren(s,t){if(s===t)return;const e=this.getChildIndex(s),i=this.getChildIndex(t);this.children[e]=t,this.children[i]=s;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...s){return s.length===1?this.reparentChildAt(s[0],this.children.length):(s.forEach(t=>this.reparentChildAt(t,this.children.length)),s[0])},reparentChildAt(s,t){if(s.parent===this)return this.setChildIndex(s,t),s;const e=s.worldTransform.clone();s.removeFromParent(),this.addChildAt(s,t);const i=this.worldTransform.clone();return i.invert(),e.prepend(i),s.setFromMatrix(e),s},replaceChild(s,t){s.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(s)),t.setFromMatrix(s.localTransform),t.updateLocalTransform(),this.removeChild(s)}},cc={collectRenderables(s,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(s,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,s):this.collectRenderablesWithEffects(s,t,e))},collectRenderablesSimple(s,t,e){const i=this.children,r=i.length;for(let n=0;n=0;r--){const n=this.effects[r];i[n.pipe].pop(n,this,s)}}};class Gn{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;ee.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(s){const t=this.effects.indexOf(s);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(s){const t=this._maskEffect;t?.mask!==s&&(t&&(this.removeEffect(t),Ar.returnMaskEffect(t),this._maskEffect=null),s!=null&&(this._maskEffect=Ar.getMaskEffect(s),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(s){this._maskOptions={...this._maskOptions,...s},s.mask&&(this.mask=s.mask),this._markStructureAsChanged()},set filters(s){!Array.isArray(s)&&s&&(s=[s]);const t=this._filterEffect||(this._filterEffect=new Gn);s=s;const e=s?.length>0,i=t.filters?.length>0,r=e!==i;s=Array.isArray(s)?s.slice(0):s,t.filters=Object.freeze(s),r&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=s??null))},get filters(){return this._filterEffect?.filters},set filterArea(s){this._filterEffect||(this._filterEffect=new Gn),this._filterEffect.filterArea=s},get filterArea(){return this._filterEffect?.filterArea}},_c={label:null,get name(){return ht(wt,"Container.name property has been removed, use Container.label instead"),this.label},set name(s){ht(wt,"Container.name property has been removed, use Container.label instead"),this.label=s},getChildByName(s,t=!1){return this.getChildByLabel(s,t)},getChildByLabel(s,t=!1){const e=this.children;for(let i=0;i>16&255,i=s>>8&255,r=s&255,n=t>>16&255,o=t>>8&255,a=t&255,h=e*n/255|0,l=i*o/255|0,c=r*a/255|0;return(h<<16)+(l<<8)+c}const Dn=16777215;function Un(s,t){return s===Dn?t:t===Dn?s:na(s,t)}function cs(s){return((s&255)<<16)+(s&65280)+(s>>16&255)}const gc={getGlobalAlpha(s){if(s)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(s=new gt,t){if(t)return s.copyFrom(this.worldTransform);this.updateLocalTransform();const e=Qr(this,ee.get().identity());return s.appendFrom(this.localTransform,e),ee.return(e),s},getGlobalTint(s){if(s)return this.renderGroup?cs(this.renderGroup.worldColor):this.parentRenderGroup?cs(Un(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=Un(t,e.localColor),e=e.parent;return cs(t)}};function oa(s,t,e){return t.clear(),e||(e=gt.IDENTITY),aa(s,t,e,s,!0),t.isValid||t.set(0,0,0,0),t}function aa(s,t,e,i,r){let n;if(r)n=ee.get(),n=e.copyTo(n);else{if(!s.visible||!s.measurable)return;s.updateLocalTransform();const h=s.localTransform;n=ee.get(),n.appendFrom(h,e)}const o=t,a=!!s.effects.length;if(a&&(t=Ee.get().clear()),s.boundsArea)t.addRect(s.boundsArea,n);else{s.renderPipeId&&(t.matrix=n,t.addBounds(s.bounds));const h=s.children;for(let l=0;l-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let i=0;i0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;ethis.addChild(e)),t.parent?.addChild(this)}static mixin(t){ht("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Kt.mixin(lt,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||ht(wt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r1){for(let r=0;r-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,i),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=me.get(Sc,this),this.groupTransform=gt.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),me.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new gt),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Ul}set angle(t){this.rotation=t*Nl}get pivot(){return this._pivot===Zi&&(this._pivot=new Zt(this,0,0)),this._pivot}set pivot(t){this._pivot===Zi&&(this._pivot=new Zt(this,0,0),this._origin!==Qi&&It("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Ys&&(this._skew=new Zt(this,0,0)),this._skew}set skew(t){this._skew===Ys&&(this._skew=new Zt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===qs&&(this._scale=new Zt(this,1,1)),this._scale}set scale(t){this._scale===qs&&(this._scale=new Zt(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Qi&&(this._origin=new Zt(this,0,0)),this._origin}set origin(t){this._origin===Qi&&(this._origin=new Zt(this,0,0),this._pivot!==Zi&&It("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const i=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,i.width),e!==void 0&&this._setHeight(e,i.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,i=this._scale,r=this._pivot,n=this._origin,o=this._position,a=i._x,h=i._y,l=r._x,c=r._y,u=-n._x,_=-n._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*h,e.d=this._sy*h,e.tx=o._x-(l*e.a+c*e.c)+(u*e.a+_*e.c)-u,e.ty=o._y-(l*e.b+c*e.d)+(u*e.b+_*e.d)-_}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Nn,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const i=jt.shared.setValue(t??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=Nn,this._onUpdate())}get tint(){return cs(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Mc,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=$s,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=$s,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=$s,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let r=0;r=e.minX&&i<=e.maxX&&r>=e.minY&&r<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,i){const{renderPipes:r}=e;r.blendMode.pushBlendMode(this,this.groupBlendMode,t),r[this.renderPipeId].addRenderable(this,t),this.didViewUpdate=!1;const o=this.children,a=o.length;for(let h=0;h{this.onViewUpdate()}}),i?this.anchor=i:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof _t?new kt(t):new kt(_t.from(t,e))}set texture(t){t||(t=_t.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return ql(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return ht("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,i=this._bounds,{width:r,height:n}=e.orig;i.minX=-t._x*r,i.maxX=i.minX+r,i.minY=-t._y*n,i.maxY=i.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){const i=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}const Tc=new ve;function ua(s,t,e){const i=Tc;s.measurable=!0,sa(s,e,i),t.addBoundsMask(i),s.measurable=!1}function da(s,t,e){const i=Ee.get();s.measurable=!0;const r=ee.get().identity(),n=_a(s,e,r);oa(s,i,n),s.measurable=!1,t.addBoundsMask(i),ee.return(r),Ee.return(i)}function _a(s,t,e){return s?(s!==t&&(_a(s.parent,t,e),s.updateLocalTransform(),e.append(s.localTransform)),e):(It("Mask bounds, renderable is not inside the root container"),e)}class fa{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof kt),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||ua(this.mask,t,e)}addLocalBounds(t,e){da(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof kt}}fa.extension=q.MaskEffect;class pa{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}pa.extension=q.MaskEffect;class ga{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){ua(this.mask,t,e)}addLocalBounds(t,e){da(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof lt}}ga.extension=q.MaskEffect;const Pc={createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")};let Wn=Pc;const zt={get(){return Wn},set(s){Wn=s}};class ma extends ye{constructor(t){t.resource||(t.resource=zt.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,i=this._resolution){const r=super.resize(t,e,i);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}ma.extension=q.TextureSource;class Je extends ye{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}Je.extension=q.TextureSource;var Sr=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(Sr||{});class Ks{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=i,this._once=r}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const ya=class he{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ks(null,null,1/0),this.deltaMS=1/he.targetFPMS,this.elapsedMS=1/he.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=Sr.NORMAL){return this._addListener(new Ks(t,e,i))}addOnce(t,e,i=Sr.NORMAL){return this._addListener(new Ks(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{const t=zt.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(r),t.deleteTexture(i),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Zs}const Ss=class ba extends ye{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...ba.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Ji.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await xa(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ji.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ji.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ji.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};Ss.extension=q.TextureSource;Ss.defaultOptions={...ye.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Ss.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let zi=Ss;const be=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s);class Ic{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||It(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=be(t);let r;for(let h=0;h{n.set(h,e)});const o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(h=>{this._cacheMap.set(h,a)}),o.forEach(h=>{const l=r?r[h]:e;this._cache.has(h)&&this._cache.get(h)!==l&&It("[Cache] already has key:",h),this._cache.set(h,n.get(h))})}remove(t){if(!this._cacheMap.has(t)){It(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Pt=new Ic,Cr=[];Kt.handleByList(q.TextureSource,Cr);function va(s={}){const t=s&&s.resource,e=t?s.resource:s,i=t?s:{resource:s};for(let r=0;r{Pt.has(i)&&Pt.remove(i)}),t||Pt.set(i,n),n}function Ec(s,t=!1){return typeof s=="string"?Pt.get(s):s instanceof ye?new _t({source:s}):zc(s,t)}_t.from=Ec;ye.from=va;Kt.add(fa,pa,ga,zi,Je,ma,Zr);var He=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(He||{});function xe(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function xi(s){return s.split("?")[0].split("#")[0]}function Rc(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fc(s,t,e){return s.replace(new RegExp(Rc(t),"g"),e)}function Bc(s,t){let e="",i=0,r=-1,n=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=a,n=0;continue}}}else e.length>0?e+=`/${s.slice(r+1,a)}`:e=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const ue={toPosix(s){return Fc(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){xe(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(xe(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=xi(this.toPosix(t??zt.get().getBaseUrl())),r=xi(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?ue.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(xe(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=Bc(s),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return xe(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(xe(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),o=s;s=s.slice(n.length);for(let a=s.length-1;a>=1;--a)if(t=s.charCodeAt(a),t===47){if(!r){i=a;break}}else r=!1;return i===-1?e?"/":this.isUrl(o)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){xe(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){xe(s),t&&xe(t),s=xi(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let o=t.length-1,a=-1;for(n=s.length-1;n>=0;--n){const h=s.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){xe(s),s=xi(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}i===-1&&(r=!1,i=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){xe(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=xi(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,o=0,a=-1,h=!0,l=s.length-1,c=0;for(;l>=r;--l){if(e=s.charCodeAt(l),e===47){if(!h){o=l+1;break}continue}a===-1&&(h=!1,a=l+1),e===46?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}return n===-1||a===-1||c===0||c===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&i?t.base=t.name=s.slice(1,a):t.base=t.name=s.slice(o,a)):(o===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,a)):(t.name=s.slice(o,n),t.base=s.slice(o,a)),t.ext=s.slice(n,a)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function wa(s,t,e,i,r){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),wa(s,r,0,e,i)}else i.push(s);return i}const bs=s=>!Array.isArray(s);class pi{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,src:i}=t;return be(e||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}addManifest(t){this._manifest&&It("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let h;if(typeof a=="string"){const l=this._createBundleAssetId(t,a);i.push(l),h=[a,l]}else{const l=a.map(c=>this._createBundleAssetId(t,c));i.push(...l),h=[...a,...l]}this.add({...n,alias:h,src:o})}),this._bundles[t]=i}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let i;i=n=>{this.hasKey(n)&&It(`[Resolver] already has key: ${n} overwriting`)},be(e).forEach(n=>{const{src:o}=n;let{data:a,format:h,loadParser:l,parser:c}=n;const u=be(o).map(g=>typeof g=="string"?Lc(g):Array.isArray(g)?g:[g]),_=this.getAlias(n);Array.isArray(_)?_.forEach(i):i(_);const d=[],f=g=>({...this._parsers.find(y=>y.test(g))?.parse(g),src:g});u.forEach(g=>{g.forEach(p=>{let y={};if(typeof p!="object"?y=f(p):(a=p.data??a,h=p.format??h,(p.loadParser||p.parser)&&(l=p.loadParser??l,c=p.parser??c),y={...f(p.src),...p}),!_)throw new Error(`[Resolver] alias is undefined for this asset: ${y.src}`);y=this._buildResolvedAsset(y,{aliases:_,data:a,format:h,loadParser:l,parser:c,progressSize:n.progressSize}),d.push(y)})}),_.forEach(g=>{this._assetMap[g]=d})})}resolveBundle(t){const e=bs(t);t=be(t);const i={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(r,h)]=l}i[r]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=bs(t);t=be(t);const i={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(h=>{const l=n.filter(c=>c[a]?c[a]===h:!1);l.length&&(n=l)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:i,data:r,loadParser:n,parser:o,format:a,progressSize:h}=e;return(this._basePath||this._rootPath)&&(t.src=ue.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.parser=o??t.parser,t.format=a??t.format??Oc(t.src),h!==void 0&&(t.progressSize=h),t}}pi.RETINA_PREFIX=/@([0-9\.]+)x/;function Oc(s){return s.split(".").pop().split("?").shift().split("#").shift()}const Mr=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s},ka=class Mi{constructor(t,e){this.linkedSheets=[];let i=t;t?.source instanceof ye&&(i={texture:t,data:e});const{texture:r,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=r instanceof _t?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=n;const a=parseFloat(n.meta.scale);a?(this.resolution=a,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Mi.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=Mi.BATCH_SIZE;for(;e-t{this._batchIndex*Mi.BATCH_SIZE{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=ue.dirname(s[0]);t.linkedSheets.forEach((n,o)=>{const a=Aa([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(i,a)})}return i}const Dc={extension:q.Asset,cache:{test:s=>s instanceof Hn,getCacheableAssets:(s,t)=>Aa(s,t,!1)},resolver:{extension:{type:q.ResolveParser,name:"resolveSpritesheet"},test:s=>{const e=s.split("?")[0].split("."),i=e.pop(),r=e.pop();return i==="json"&&Gc.includes(r)},parse:s=>{const t=s.split(".");return{resolution:parseFloat(pi.RETINA_PREFIX.exec(s)?.[1]??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:q.LoadParser,priority:He.Normal,name:"spritesheetLoader"},async testParse(s,t){return ue.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){const{texture:i,imageFilename:r,textureOptions:n,cachePrefix:o}=t?.data??{};let a=ue.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let h;if(i instanceof _t)h=i;else{const u=Mr(a+(r??s.meta.image),t.src);h=(await e.load([{src:u,data:n}]))[u]}const l=new Hn({texture:h.source,data:s,cachePrefix:o});await l.parse();const c=s?.meta?.related_multi_packs;if(Array.isArray(c)){const u=[];for(const d of c){if(typeof d!="string")continue;let f=a+d;t.data?.ignoreMultiPack||(f=Mr(f,t.src),u.push(e.load({src:f,data:{textureOptions:n,ignoreMultiPack:!0}})))}const _=await Promise.all(u);l.linkedSheets=_,_.forEach(d=>{d.linkedSheets=[l].concat(l.linkedSheets.filter(f=>f!==d))})}return l},async unload(s,t,e){await e.unload(s.textureSource._sourceOrigin),s.destroy(!1)}}};Kt.add(Dc);const Qs=Object.create(null),Vn=Object.create(null);function Jr(s,t){let e=Vn[s];return e===void 0&&(Qs[t]===void 0&&(Qs[t]=1),Vn[s]=e=Qs[t]++),e}let ts;function Sa(){return(!ts||ts?.isContextLost())&&(ts=zt.get().createCanvas().getContext("webgl",{})),ts}let es;function Uc(){if(!es){es="mediump";const s=Sa();s&&s.getShaderPrecisionFormat&&(es=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision?"highp":"mediump")}return es}function Nc(s,t,e){return t?s:e?(s=s.replace("out vec4 finalColor;",""),` @@ -20,7 +20,7 @@ Deprecated since v${s}`,n=typeof console.groupCollapsed=="function"&&!oi.noColor `}function Wc(s,t,e){const i=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(s.substring(0,9)!=="precision"){let r=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float; ${s}`}else if(i!=="highp"&&s.substring(0,15)==="precision highp")return s.replace("precision highp","precision mediump");return s}function Hc(s,t){return t?`#version 300 es ${s}`:s}const Vc={},jc={};function Xc(s,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const i=e?Vc:jc;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,s.indexOf("#define SHADER_NAME")!==-1?s:`${`#define SHADER_NAME ${t}`} -${s}`}function Yc(s,t){return t?s.replace("#version 300 es",""):s}const Js={stripVersion:Yc,ensurePrecision:Wc,addProgramDefines:Nc,setProgramName:Xc,insertVersion:Hc},bi=Object.create(null),Ca=class Tr{constructor(t){t={...Tr.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Uc()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let r=t.fragment,n=t.vertex;Object.keys(Js).forEach(o=>{const a=i[o];r=Js[o](r,a,!0),n=Js[o](n,a,!1)}),this.fragment=r,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Jr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,bi[this._cacheKey]=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return bi[e]||(bi[e]=new Tr(t),bi[e]._cacheKey=e),bi[e]}};Ca.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let _i=Ca;const jn={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function qc(s){return jn[s]??jn.float32}const $c={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Kc({source:s,entryPoint:t}){const e={},i=s.indexOf(`fn ${t}`);if(i!==-1){const r=s.indexOf("->",i);if(r!==-1){const n=s.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const h=$c[a[3]]??"float32";e[a[2]]={location:parseInt(a[1],10),format:h,stride:qc(h).stride,offset:0,instance:!1,start:0}}}}return e}function tr(s){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,l=s.match(t)?.map(u=>({group:parseInt(u.match(e)[1],10),binding:parseInt(u.match(i)[1],10),name:u.match(r)[2],isUniform:u.match(r)[1]==="",type:u.match(n)[1]}));if(!l)return{groups:[],structs:[]};const c=s.match(o)?.map(u=>{const _=u.match(h)[1],d=u.match(a).reduce((f,g)=>{const[p,y]=g.split(":");return f[p.trim()]=y.trim(),f},{});return d?{name:_,members:d}:null}).filter(({name:u})=>l.some(_=>_.type===u))??[];return{groups:l,structs:c}}var Ti=(s=>(s[s.VERTEX=1]="VERTEX",s[s.FRAGMENT=2]="FRAGMENT",s[s.COMPUTE=4]="COMPUTE",s))(Ti||{});function Zc({groups:s}){const t=[];for(let e=0;ee.has(o.name)?!1:(e.add(o.name),!0)),n=[...s.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const vi=Object.create(null);class We{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=i,e.source===i.source){const a=tr(e.source);this.structsAndGroups=a}else{const a=tr(i.source),h=tr(e.source);this.structsAndGroups=Jc(a,h)}this.layout=r??Qc(this.structsAndGroups),this.gpuLayout=n??Zc(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,i=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Jr(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Kc(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,vi[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return vi[e]||(vi[e]=new We(t),vi[e]._cacheKey=e),vi[e]}}const Ma=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],tu=Ma.reduce((s,t)=>(s[t]=!0,s),{});function eu(s,t){switch(s){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Ta=class Pa{constructor(t,e){this._touched=0,this.uid=Ot("uniform"),this._resourceType="uniformGroup",this._resourceId=Ot("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Pa.defaultOptions,...e},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!tu[n.type]){const o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,a,h]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${h} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Ma.join(", ")}`)}n.value??(n.value=eu(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Jr(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Ta.defaultOptions={ubo:!1,isStatic:!1};let Ia=Ta;class us{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const i in t){const r=t[i];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const i in this.resources)t[e++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,e){const i=this.resources[e];t!==i&&(i&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const i=this.resources;for(const r in i)i[r]._gcLastUsed=t,i[r]._touched=e}destroy(){const t=this.resources;for(const e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const i in e)e[i]===t&&(e[i]=null)}else this._updateKey()}}var Pr=(s=>(s[s.WEBGL=1]="WEBGL",s[s.WEBGPU=2]="WEBGPU",s[s.BOTH=3]="BOTH",s))(Pr||{});class Cs extends ke{constructor(t){super(),this.uid=Ot("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=i,o===void 0&&(o=0,e&&(o|=Pr.WEBGPU),i&&(o|=Pr.WEBGL)),this.compatibleRenderers=o;const h={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&r&&a)for(const l in a)for(const c in a[l]){const u=a[l][c];h[u]={group:l,binding:c,name:u}}else if(e&&r&&!a){const l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,h[c.name]=c})}else if(n){r={},a={},e&&e.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u});let l=0;for(const c in n)h[c]||(r[99]||(r[99]=new us,this._ownedBindGroups.push(r[99])),h[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(const c in n){const u=c;let _=n[c];!_.source&&!_._resourceType&&(_=new Ia(_));const d=h[u];d&&(r[d.group]||(r[d.group]=new us,this._ownedBindGroups.push(r[d.group])),r[d.group].setResource(_,d.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,h)}addResource(t,e,i){var r,n;(r=this._uniformBindMap)[e]||(r[e]={}),(n=this._uniformBindMap[e])[i]||(n[i]=t),this.groups[e]||(this.groups[e]=new us,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const i={};for(const r in e){const n=e[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:i,...r}=t;let n,o;return e&&(n=We.from(e)),i&&(o=_i.from(i)),new Cs({gpuProgram:n,glProgram:o,...r})}}const iu={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},er=0,ir=1,sr=2,rr=3,nr=4,or=5,Ir=class za{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<80*e){a=s[0],h=s[1];let c=a,u=h;for(let _=e;_c&&(c=d),f>u&&(u=f)}l=Math.max(c-a,u-h),l=l!==0?32767/l:0}return Oi(n,o,e,a,h,l,0),o}function Ra(s,t,e,i,r){let n;if(r===vu(s,t,e,i)>0)for(let o=t;o=t;o-=i)n=Yn(o/i|0,s[o],s[o+1],n);return n&&fi(n,n.next)&&(Di(n),n=n.next),n}function ti(s,t){if(!s)return s;t||(t=s);let e=s,i;do if(i=!1,!e.steiner&&(fi(e,e.next)||Bt(e.prev,e,e.next)===0)){if(Di(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Oi(s,t,e,i,r,n,o){if(!s)return;!o&&n&&pu(s,i,r,n);let a=s;for(;s.prev!==s.next;){const h=s.prev,l=s.next;if(n?au(s,i,r,n):ou(s)){t.push(h.i,s.i,l.i),Di(s),s=l.next,a=l.next;continue}if(s=l,s===a){o?o===1?(s=hu(ti(s),t),Oi(s,t,e,i,r,n,2)):o===2&&lu(s,t,e,i,r,n):Oi(ti(s),t,e,i,r,n,1);break}}}function ou(s){const t=s.prev,e=s,i=s.next;if(Bt(t,e,i)>=0)return!1;const r=t.x,n=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=Math.min(r,n,o),u=Math.min(a,h,l),_=Math.max(r,n,o),d=Math.max(a,h,l);let f=i.next;for(;f!==t;){if(f.x>=c&&f.x<=_&&f.y>=u&&f.y<=d&&Pi(r,a,n,h,o,l,f.x,f.y)&&Bt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function au(s,t,e,i){const r=s.prev,n=s,o=s.next;if(Bt(r,n,o)>=0)return!1;const a=r.x,h=n.x,l=o.x,c=r.y,u=n.y,_=o.y,d=Math.min(a,h,l),f=Math.min(c,u,_),g=Math.max(a,h,l),p=Math.max(c,u,_),y=Fr(d,f,t,e,i),x=Fr(g,p,t,e,i);let v=s.prevZ,b=s.nextZ;for(;v&&v.z>=y&&b&&b.z<=x;){if(v.x>=d&&v.x<=g&&v.y>=f&&v.y<=p&&v!==r&&v!==o&&Pi(a,c,h,u,l,_,v.x,v.y)&&Bt(v.prev,v,v.next)>=0||(v=v.prevZ,b.x>=d&&b.x<=g&&b.y>=f&&b.y<=p&&b!==r&&b!==o&&Pi(a,c,h,u,l,_,b.x,b.y)&&Bt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;v&&v.z>=y;){if(v.x>=d&&v.x<=g&&v.y>=f&&v.y<=p&&v!==r&&v!==o&&Pi(a,c,h,u,l,_,v.x,v.y)&&Bt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=d&&b.x<=g&&b.y>=f&&b.y<=p&&b!==r&&b!==o&&Pi(a,c,h,u,l,_,b.x,b.y)&&Bt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function hu(s,t){let e=s;do{const i=e.prev,r=e.next.next;!fi(i,r)&&Ba(i,e,e.next,r)&&Gi(i,r)&&Gi(r,i)&&(t.push(i.i,e.i,r.i),Di(e),Di(e.next),e=s=r),e=e.next}while(e!==s);return ti(e)}function lu(s,t,e,i,r,n){let o=s;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&yu(o,a)){let h=La(o,a);o=ti(o,o.next),h=ti(h,h.next),Oi(o,t,e,i,r,n,0),Oi(h,t,e,i,r,n,0);return}a=a.next}o=o.next}while(o!==s)}function cu(s,t,e,i){const r=[];for(let n=0,o=t.length;n=e.next.y&&e.next.y!==e.y){const u=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=i&&u>n&&(n=u,o=e.x=e.x&&e.x>=h&&i!==e.x&&Fa(ro.x||e.x===o.x&&fu(o,e)))&&(o=e,c=u)}e=e.next}while(e!==a);return o}function fu(s,t){return Bt(s.prev,s,t.prev)<0&&Bt(t.next,s,s.next)<0}function pu(s,t,e,i){let r=s;do r.z===0&&(r.z=Fr(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==s);r.prevZ.nextZ=null,r.prevZ=null,gu(r)}function gu(s){let t,e=1;do{let i=s,r;s=null;let n=null;for(t=0;i;){t++;let o=i,a=0;for(let l=0;l0||h>0&&o;)a!==0&&(h===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,h--),n?n.nextZ=r:s=r,r.prevZ=n,n=r;i=o}n.nextZ=null,e*=2}while(t>1);return s}function Fr(s,t,e,i,r){return s=(s-e)*r|0,t=(t-i)*r|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,s|t<<1}function mu(s){let t=s,e=s;do(t.x=(s-o)*(n-a)&&(s-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(i-a)}function Pi(s,t,e,i,r,n,o,a){return!(s===o&&t===a)&&Fa(s,t,e,i,r,n,o,a)}function yu(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!xu(s,t)&&(Gi(s,t)&&Gi(t,s)&&bu(s,t)&&(Bt(s.prev,s,t.prev)||Bt(s,t.prev,t))||fi(s,t)&&Bt(s.prev,s,s.next)>0&&Bt(t.prev,t,t.next)>0)}function Bt(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function fi(s,t){return s.x===t.x&&s.y===t.y}function Ba(s,t,e,i){const r=ss(Bt(s,t,e)),n=ss(Bt(s,t,i)),o=ss(Bt(e,i,s)),a=ss(Bt(e,i,t));return!!(r!==n&&o!==a||r===0&&is(s,e,t)||n===0&&is(s,i,t)||o===0&&is(e,s,i)||a===0&&is(e,t,i))}function is(s,t,e){return t.x<=Math.max(s.x,e.x)&&t.x>=Math.min(s.x,e.x)&&t.y<=Math.max(s.y,e.y)&&t.y>=Math.min(s.y,e.y)}function ss(s){return s>0?1:s<0?-1:0}function xu(s,t){let e=s;do{if(e.i!==s.i&&e.next.i!==s.i&&e.i!==t.i&&e.next.i!==t.i&&Ba(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function Gi(s,t){return Bt(s.prev,s,s.next)<0?Bt(s,t,s.next)>=0&&Bt(s,s.prev,t)>=0:Bt(s,t,s.prev)<0||Bt(s,s.next,t)<0}function bu(s,t){let e=s,i=!1;const r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function La(s,t){const e=Br(s.i,s.x,s.y),i=Br(t.i,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Yn(s,t,e,i){const r=Br(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Di(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Br(s,t,e){return{i:s,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vu(s,t,e,i){let r=0;for(let n=t,o=e-i;n(s[s.NONE=0]="NONE",s[s.COLOR=16384]="COLOR",s[s.STENCIL=1024]="STENCIL",s[s.DEPTH=256]="DEPTH",s[s.COLOR_DEPTH=16640]="COLOR_DEPTH",s[s.COLOR_STENCIL=17408]="COLOR_STENCIL",s[s.DEPTH_STENCIL=1280]="DEPTH_STENCIL",s[s.ALL=17664]="ALL",s))(Oa||{});class ku{constructor(t){this.items=[],this._name=t}emit(t,e,i,r,n,o,a,h){const{name:l,items:c}=this;for(let u=0,_=c.length;u<_;u++)c[u][l](t,e,i,r,n,o,a,h);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Au=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Ga=class Da extends ke{constructor(t){super(),this.tick=0,this.uid=Ot("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...Au,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await ru(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)t={...this._systemsHash[i].constructor.defaultOptions,...t};t={...Da.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let i=0;i{this.runners[e]=new ku(e)})}_addSystems(t){let e;for(e in t){const i=t[e];this._addSystem(i.value,i.name)}}_addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,e){const i=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&Wi.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!nu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};Ga.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Ua=Ga,rs;function Su(s){return rs!==void 0||(rs=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:s??Ua.defaultOptions.failIfMajorPerformanceCaveat};try{if(!zt.get().getWebGLRenderingContext())return!1;let i=zt.get().createCanvas().getContext("webgl",t);const r=!!i?.getContextAttributes()?.stencil;if(i){const n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch{return!1}})()),rs}let ns;async function Cu(s={}){return ns!==void 0||(ns=await(async()=>{const t=zt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(s)).requestDevice(),!0}catch{return!1}})()),ns}const qn=["webgl","webgpu","canvas"];async function Mu(s){let t=[];s.preference?(t.push(s.preference),qn.forEach(n=>{n!==s.preference&&t.push(n)})):t=qn.slice();let e,i={};for(let n=0;n{const{WebGPURenderer:h}=await import("./WebGPURenderer-CSJjM6oL.js");return{WebGPURenderer:h}},__vite__mapDeps([50,2,51,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url);e=a,i={...s,...s.webgpu};break}else if(o==="webgl"&&Su(s.failIfMajorPerformanceCaveat??Ua.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await ps(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-DBblrsTz.js");return{WebGLRenderer:h}},__vite__mapDeps([52,2,51,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url);e=a,i={...s,...s.webgl};break}else if(o==="canvas")throw i={...s},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!e)throw new Error("No available renderer for the current environment");const r=new e;return await r.init(i),r}const Na="8.15.0";class Wa{static init(){globalThis.__PIXI_APP_INIT__?.(this,Na)}static destroy(){}}Wa.extension=q.Application;class Tu{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Na)}destroy(){this._renderer=null}}Tu.extension={type:[q.WebGLSystem,q.WebGPUSystem],name:"initHook",priority:-10};const Ha=class Lr{constructor(...t){this.stage=new lt,t[0]!==void 0&&ht(wt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new lt),this.renderer=await Mu(t),Lr._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ht(wt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const i=Lr._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Ha._plugins=[];let Va=Ha;Kt.handleByList(q.Application,Va._plugins);Kt.add(Wa);class ja extends ke{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return ht(wt,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return ht(wt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return ht(wt,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return ht(wt,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return ht(wt,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(const e in this.chars)this.chars[e].texture?.destroy();this.chars=null,t&&(this.pages.forEach(e=>e.texture.destroy(!0)),this.pages=null)}}class Pu{constructor(t=0,e=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=i,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){const e=new Array(t.length);for(let i=0;i0){const e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(e!==void 0){if(this.ttl>0&&e.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(e),e.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let e=this.first,i=0;for(;e!==null;)t[i++]=e.key,e=e.next;return t}setWithEvicted(t,e,i=this.resetTtl){let r=null;if(this.has(t))this.set(t,e,!0,i);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};++this.size===1?this.first=n:this.last.next=n,this.last=n}return r}set(t,e,i=!1,r=this.resetTtl){let n=this.items[t];return i||n!==void 0?(n.value=e,i===!1&&r&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(t=this.keys()){const e=new Array(t.length);for(let i=0;i=0;i--){let r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!Iu.includes(r)&&(r=`"${r}"`),e[i]=r}return`${s.fontStyle} ${s.fontVariant} ${s.fontWeight} ${t} ${e.join(",")}`}const ar={willReadFrequently:!0},Ae=class j{static get experimentalLetterSpacingSupported(){let t=j._experimentalLetterSpacingSupported;if(t===void 0){const e=zt.get().getCanvasRenderingContext2D().prototype;t=j._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,i,r,n,o,a,h,l){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=h,this.fontProperties=l}static measureText(t=" ",e,i=j._canvas,r=e.wordWrap){const n=`${t}-${e.styleKey}-wordWrap-${r}`;if(j._measurementCache.has(n))return j._measurementCache.get(n);const o=Or(e),a=j.measureFont(o);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const h=j.__context;h.font=o;const c=(r?j._wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),u=new Array(c.length);let _=0;for(let x=0;x0)if(r)o-=e,l-=e;else{const c=(j.graphemeSegmenter(t).length-1)*e;o+=c,l+=c}return Math.max(o,l)}static _wordWrap(t,e,i=j._canvas){const r=i.getContext("2d",ar);let n=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=j._collapseSpaces(c),_=j._collapseNewlines(c);let d=!u;const f=e.wordWrapWidth+l,g=j._tokenize(t);for(let p=0;pf)if(o!==""&&(a+=j._addLine(o),o="",n=0),j.canBreakWords(y,e.breakWords)){const v=j.wordWrapSplit(y);for(let b=0;bf&&(a+=j._addLine(o),d=!1,o="",n=0),o+=M,n+=R}}else{o.length>0&&(a+=j._addLine(o),o="",n=0);const v=p===g.length-1;a+=j._addLine(y,!v),d=!1,o="",n=0}else x+n>f&&(d=!1,a+=j._addLine(o),o="",n=0),(o.length>0||!j.isBreakingSpace(y)||d)&&(o+=y,n+=x)}return a+=j._addLine(o,!1),a}static _addLine(t,e=!0){return t=j._trimRight(t),t=e?`${t} +${s}`}function Yc(s,t){return t?s.replace("#version 300 es",""):s}const Js={stripVersion:Yc,ensurePrecision:Wc,addProgramDefines:Nc,setProgramName:Xc,insertVersion:Hc},bi=Object.create(null),Ca=class Tr{constructor(t){t={...Tr.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Uc()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let r=t.fragment,n=t.vertex;Object.keys(Js).forEach(o=>{const a=i[o];r=Js[o](r,a,!0),n=Js[o](n,a,!1)}),this.fragment=r,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Jr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,bi[this._cacheKey]=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return bi[e]||(bi[e]=new Tr(t),bi[e]._cacheKey=e),bi[e]}};Ca.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let _i=Ca;const jn={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function qc(s){return jn[s]??jn.float32}const $c={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Kc({source:s,entryPoint:t}){const e={},i=s.indexOf(`fn ${t}`);if(i!==-1){const r=s.indexOf("->",i);if(r!==-1){const n=s.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const h=$c[a[3]]??"float32";e[a[2]]={location:parseInt(a[1],10),format:h,stride:qc(h).stride,offset:0,instance:!1,start:0}}}}return e}function tr(s){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,l=s.match(t)?.map(u=>({group:parseInt(u.match(e)[1],10),binding:parseInt(u.match(i)[1],10),name:u.match(r)[2],isUniform:u.match(r)[1]==="",type:u.match(n)[1]}));if(!l)return{groups:[],structs:[]};const c=s.match(o)?.map(u=>{const _=u.match(h)[1],d=u.match(a).reduce((f,g)=>{const[p,y]=g.split(":");return f[p.trim()]=y.trim(),f},{});return d?{name:_,members:d}:null}).filter(({name:u})=>l.some(_=>_.type===u))??[];return{groups:l,structs:c}}var Ti=(s=>(s[s.VERTEX=1]="VERTEX",s[s.FRAGMENT=2]="FRAGMENT",s[s.COMPUTE=4]="COMPUTE",s))(Ti||{});function Zc({groups:s}){const t=[];for(let e=0;ee.has(o.name)?!1:(e.add(o.name),!0)),n=[...s.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const vi=Object.create(null);class We{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=i,e.source===i.source){const a=tr(e.source);this.structsAndGroups=a}else{const a=tr(i.source),h=tr(e.source);this.structsAndGroups=Jc(a,h)}this.layout=r??Qc(this.structsAndGroups),this.gpuLayout=n??Zc(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,i=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Jr(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Kc(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,vi[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return vi[e]||(vi[e]=new We(t),vi[e]._cacheKey=e),vi[e]}}const Ma=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],tu=Ma.reduce((s,t)=>(s[t]=!0,s),{});function eu(s,t){switch(s){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Ta=class Pa{constructor(t,e){this._touched=0,this.uid=Ot("uniform"),this._resourceType="uniformGroup",this._resourceId=Ot("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Pa.defaultOptions,...e},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!tu[n.type]){const o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,a,h]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${h} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Ma.join(", ")}`)}n.value??(n.value=eu(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Jr(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Ta.defaultOptions={ubo:!1,isStatic:!1};let Ia=Ta;class us{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const i in t){const r=t[i];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const i in this.resources)t[e++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,e){const i=this.resources[e];t!==i&&(i&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const i=this.resources;for(const r in i)i[r]._gcLastUsed=t,i[r]._touched=e}destroy(){const t=this.resources;for(const e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const i in e)e[i]===t&&(e[i]=null)}else this._updateKey()}}var Pr=(s=>(s[s.WEBGL=1]="WEBGL",s[s.WEBGPU=2]="WEBGPU",s[s.BOTH=3]="BOTH",s))(Pr||{});class Cs extends ke{constructor(t){super(),this.uid=Ot("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=i,o===void 0&&(o=0,e&&(o|=Pr.WEBGPU),i&&(o|=Pr.WEBGL)),this.compatibleRenderers=o;const h={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&r&&a)for(const l in a)for(const c in a[l]){const u=a[l][c];h[u]={group:l,binding:c,name:u}}else if(e&&r&&!a){const l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,h[c.name]=c})}else if(n){r={},a={},e&&e.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u});let l=0;for(const c in n)h[c]||(r[99]||(r[99]=new us,this._ownedBindGroups.push(r[99])),h[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(const c in n){const u=c;let _=n[c];!_.source&&!_._resourceType&&(_=new Ia(_));const d=h[u];d&&(r[d.group]||(r[d.group]=new us,this._ownedBindGroups.push(r[d.group])),r[d.group].setResource(_,d.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,h)}addResource(t,e,i){var r,n;(r=this._uniformBindMap)[e]||(r[e]={}),(n=this._uniformBindMap[e])[i]||(n[i]=t),this.groups[e]||(this.groups[e]=new us,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const i={};for(const r in e){const n=e[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:i,...r}=t;let n,o;return e&&(n=We.from(e)),i&&(o=_i.from(i)),new Cs({gpuProgram:n,glProgram:o,...r})}}const iu={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},er=0,ir=1,sr=2,rr=3,nr=4,or=5,Ir=class za{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<80*e){a=s[0],h=s[1];let c=a,u=h;for(let _=e;_c&&(c=d),f>u&&(u=f)}l=Math.max(c-a,u-h),l=l!==0?32767/l:0}return Oi(n,o,e,a,h,l,0),o}function Ra(s,t,e,i,r){let n;if(r===vu(s,t,e,i)>0)for(let o=t;o=t;o-=i)n=Yn(o/i|0,s[o],s[o+1],n);return n&&fi(n,n.next)&&(Di(n),n=n.next),n}function ti(s,t){if(!s)return s;t||(t=s);let e=s,i;do if(i=!1,!e.steiner&&(fi(e,e.next)||Bt(e.prev,e,e.next)===0)){if(Di(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Oi(s,t,e,i,r,n,o){if(!s)return;!o&&n&&pu(s,i,r,n);let a=s;for(;s.prev!==s.next;){const h=s.prev,l=s.next;if(n?au(s,i,r,n):ou(s)){t.push(h.i,s.i,l.i),Di(s),s=l.next,a=l.next;continue}if(s=l,s===a){o?o===1?(s=hu(ti(s),t),Oi(s,t,e,i,r,n,2)):o===2&&lu(s,t,e,i,r,n):Oi(ti(s),t,e,i,r,n,1);break}}}function ou(s){const t=s.prev,e=s,i=s.next;if(Bt(t,e,i)>=0)return!1;const r=t.x,n=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=Math.min(r,n,o),u=Math.min(a,h,l),_=Math.max(r,n,o),d=Math.max(a,h,l);let f=i.next;for(;f!==t;){if(f.x>=c&&f.x<=_&&f.y>=u&&f.y<=d&&Pi(r,a,n,h,o,l,f.x,f.y)&&Bt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function au(s,t,e,i){const r=s.prev,n=s,o=s.next;if(Bt(r,n,o)>=0)return!1;const a=r.x,h=n.x,l=o.x,c=r.y,u=n.y,_=o.y,d=Math.min(a,h,l),f=Math.min(c,u,_),g=Math.max(a,h,l),p=Math.max(c,u,_),y=Fr(d,f,t,e,i),x=Fr(g,p,t,e,i);let v=s.prevZ,b=s.nextZ;for(;v&&v.z>=y&&b&&b.z<=x;){if(v.x>=d&&v.x<=g&&v.y>=f&&v.y<=p&&v!==r&&v!==o&&Pi(a,c,h,u,l,_,v.x,v.y)&&Bt(v.prev,v,v.next)>=0||(v=v.prevZ,b.x>=d&&b.x<=g&&b.y>=f&&b.y<=p&&b!==r&&b!==o&&Pi(a,c,h,u,l,_,b.x,b.y)&&Bt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;v&&v.z>=y;){if(v.x>=d&&v.x<=g&&v.y>=f&&v.y<=p&&v!==r&&v!==o&&Pi(a,c,h,u,l,_,v.x,v.y)&&Bt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=d&&b.x<=g&&b.y>=f&&b.y<=p&&b!==r&&b!==o&&Pi(a,c,h,u,l,_,b.x,b.y)&&Bt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function hu(s,t){let e=s;do{const i=e.prev,r=e.next.next;!fi(i,r)&&Ba(i,e,e.next,r)&&Gi(i,r)&&Gi(r,i)&&(t.push(i.i,e.i,r.i),Di(e),Di(e.next),e=s=r),e=e.next}while(e!==s);return ti(e)}function lu(s,t,e,i,r,n){let o=s;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&yu(o,a)){let h=La(o,a);o=ti(o,o.next),h=ti(h,h.next),Oi(o,t,e,i,r,n,0),Oi(h,t,e,i,r,n,0);return}a=a.next}o=o.next}while(o!==s)}function cu(s,t,e,i){const r=[];for(let n=0,o=t.length;n=e.next.y&&e.next.y!==e.y){const u=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=i&&u>n&&(n=u,o=e.x=e.x&&e.x>=h&&i!==e.x&&Fa(ro.x||e.x===o.x&&fu(o,e)))&&(o=e,c=u)}e=e.next}while(e!==a);return o}function fu(s,t){return Bt(s.prev,s,t.prev)<0&&Bt(t.next,s,s.next)<0}function pu(s,t,e,i){let r=s;do r.z===0&&(r.z=Fr(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==s);r.prevZ.nextZ=null,r.prevZ=null,gu(r)}function gu(s){let t,e=1;do{let i=s,r;s=null;let n=null;for(t=0;i;){t++;let o=i,a=0;for(let l=0;l0||h>0&&o;)a!==0&&(h===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,h--),n?n.nextZ=r:s=r,r.prevZ=n,n=r;i=o}n.nextZ=null,e*=2}while(t>1);return s}function Fr(s,t,e,i,r){return s=(s-e)*r|0,t=(t-i)*r|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,s|t<<1}function mu(s){let t=s,e=s;do(t.x=(s-o)*(n-a)&&(s-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(i-a)}function Pi(s,t,e,i,r,n,o,a){return!(s===o&&t===a)&&Fa(s,t,e,i,r,n,o,a)}function yu(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!xu(s,t)&&(Gi(s,t)&&Gi(t,s)&&bu(s,t)&&(Bt(s.prev,s,t.prev)||Bt(s,t.prev,t))||fi(s,t)&&Bt(s.prev,s,s.next)>0&&Bt(t.prev,t,t.next)>0)}function Bt(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function fi(s,t){return s.x===t.x&&s.y===t.y}function Ba(s,t,e,i){const r=ss(Bt(s,t,e)),n=ss(Bt(s,t,i)),o=ss(Bt(e,i,s)),a=ss(Bt(e,i,t));return!!(r!==n&&o!==a||r===0&&is(s,e,t)||n===0&&is(s,i,t)||o===0&&is(e,s,i)||a===0&&is(e,t,i))}function is(s,t,e){return t.x<=Math.max(s.x,e.x)&&t.x>=Math.min(s.x,e.x)&&t.y<=Math.max(s.y,e.y)&&t.y>=Math.min(s.y,e.y)}function ss(s){return s>0?1:s<0?-1:0}function xu(s,t){let e=s;do{if(e.i!==s.i&&e.next.i!==s.i&&e.i!==t.i&&e.next.i!==t.i&&Ba(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function Gi(s,t){return Bt(s.prev,s,s.next)<0?Bt(s,t,s.next)>=0&&Bt(s,s.prev,t)>=0:Bt(s,t,s.prev)<0||Bt(s,s.next,t)<0}function bu(s,t){let e=s,i=!1;const r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function La(s,t){const e=Br(s.i,s.x,s.y),i=Br(t.i,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Yn(s,t,e,i){const r=Br(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Di(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Br(s,t,e){return{i:s,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vu(s,t,e,i){let r=0;for(let n=t,o=e-i;n(s[s.NONE=0]="NONE",s[s.COLOR=16384]="COLOR",s[s.STENCIL=1024]="STENCIL",s[s.DEPTH=256]="DEPTH",s[s.COLOR_DEPTH=16640]="COLOR_DEPTH",s[s.COLOR_STENCIL=17408]="COLOR_STENCIL",s[s.DEPTH_STENCIL=1280]="DEPTH_STENCIL",s[s.ALL=17664]="ALL",s))(Oa||{});class ku{constructor(t){this.items=[],this._name=t}emit(t,e,i,r,n,o,a,h){const{name:l,items:c}=this;for(let u=0,_=c.length;u<_;u++)c[u][l](t,e,i,r,n,o,a,h);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Au=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Ga=class Da extends ke{constructor(t){super(),this.tick=0,this.uid=Ot("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...Au,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await ru(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)t={...this._systemsHash[i].constructor.defaultOptions,...t};t={...Da.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let i=0;i{this.runners[e]=new ku(e)})}_addSystems(t){let e;for(e in t){const i=t[e];this._addSystem(i.value,i.name)}}_addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,e){const i=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&Wi.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!nu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};Ga.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Ua=Ga,rs;function Su(s){return rs!==void 0||(rs=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:s??Ua.defaultOptions.failIfMajorPerformanceCaveat};try{if(!zt.get().getWebGLRenderingContext())return!1;let i=zt.get().createCanvas().getContext("webgl",t);const r=!!i?.getContextAttributes()?.stencil;if(i){const n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch{return!1}})()),rs}let ns;async function Cu(s={}){return ns!==void 0||(ns=await(async()=>{const t=zt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(s)).requestDevice(),!0}catch{return!1}})()),ns}const qn=["webgl","webgpu","canvas"];async function Mu(s){let t=[];s.preference?(t.push(s.preference),qn.forEach(n=>{n!==s.preference&&t.push(n)})):t=qn.slice();let e,i={};for(let n=0;n{const{WebGPURenderer:h}=await import("./WebGPURenderer-DX2ilI_9.js");return{WebGPURenderer:h}},__vite__mapDeps([50,2,51,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url);e=a,i={...s,...s.webgpu};break}else if(o==="webgl"&&Su(s.failIfMajorPerformanceCaveat??Ua.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await ps(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-CPdlouOR.js");return{WebGLRenderer:h}},__vite__mapDeps([52,2,51,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url);e=a,i={...s,...s.webgl};break}else if(o==="canvas")throw i={...s},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!e)throw new Error("No available renderer for the current environment");const r=new e;return await r.init(i),r}const Na="8.15.0";class Wa{static init(){globalThis.__PIXI_APP_INIT__?.(this,Na)}static destroy(){}}Wa.extension=q.Application;class Tu{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Na)}destroy(){this._renderer=null}}Tu.extension={type:[q.WebGLSystem,q.WebGPUSystem],name:"initHook",priority:-10};const Ha=class Lr{constructor(...t){this.stage=new lt,t[0]!==void 0&&ht(wt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new lt),this.renderer=await Mu(t),Lr._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ht(wt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const i=Lr._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Ha._plugins=[];let Va=Ha;Kt.handleByList(q.Application,Va._plugins);Kt.add(Wa);class ja extends ke{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return ht(wt,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return ht(wt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return ht(wt,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return ht(wt,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return ht(wt,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(const e in this.chars)this.chars[e].texture?.destroy();this.chars=null,t&&(this.pages.forEach(e=>e.texture.destroy(!0)),this.pages=null)}}class Pu{constructor(t=0,e=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=i,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){const e=new Array(t.length);for(let i=0;i0){const e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(e!==void 0){if(this.ttl>0&&e.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(e),e.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let e=this.first,i=0;for(;e!==null;)t[i++]=e.key,e=e.next;return t}setWithEvicted(t,e,i=this.resetTtl){let r=null;if(this.has(t))this.set(t,e,!0,i);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};++this.size===1?this.first=n:this.last.next=n,this.last=n}return r}set(t,e,i=!1,r=this.resetTtl){let n=this.items[t];return i||n!==void 0?(n.value=e,i===!1&&r&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(t=this.keys()){const e=new Array(t.length);for(let i=0;i=0;i--){let r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!Iu.includes(r)&&(r=`"${r}"`),e[i]=r}return`${s.fontStyle} ${s.fontVariant} ${s.fontWeight} ${t} ${e.join(",")}`}const ar={willReadFrequently:!0},Ae=class j{static get experimentalLetterSpacingSupported(){let t=j._experimentalLetterSpacingSupported;if(t===void 0){const e=zt.get().getCanvasRenderingContext2D().prototype;t=j._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,i,r,n,o,a,h,l){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=h,this.fontProperties=l}static measureText(t=" ",e,i=j._canvas,r=e.wordWrap){const n=`${t}-${e.styleKey}-wordWrap-${r}`;if(j._measurementCache.has(n))return j._measurementCache.get(n);const o=Or(e),a=j.measureFont(o);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const h=j.__context;h.font=o;const c=(r?j._wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),u=new Array(c.length);let _=0;for(let x=0;x0)if(r)o-=e,l-=e;else{const c=(j.graphemeSegmenter(t).length-1)*e;o+=c,l+=c}return Math.max(o,l)}static _wordWrap(t,e,i=j._canvas){const r=i.getContext("2d",ar);let n=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=j._collapseSpaces(c),_=j._collapseNewlines(c);let d=!u;const f=e.wordWrapWidth+l,g=j._tokenize(t);for(let p=0;pf)if(o!==""&&(a+=j._addLine(o),o="",n=0),j.canBreakWords(y,e.breakWords)){const v=j.wordWrapSplit(y);for(let b=0;bf&&(a+=j._addLine(o),d=!1,o="",n=0),o+=M,n+=R}}else{o.length>0&&(a+=j._addLine(o),o="",n=0);const v=p===g.length-1;a+=j._addLine(y,!v),d=!1,o="",n=0}else x+n>f&&(d=!1,a+=j._addLine(o),o="",n=0),(o.length>0||!j.isBreakingSpace(y)||d)&&(o+=y,n+=x)}return a+=j._addLine(o,!1),a}static _addLine(t,e=!0){return t=j._trimRight(t),t=e?`${t} `:t,t}static _getFromCache(t,e,i,r){let n=i[t];return typeof n!="number"&&(n=j._measureText(t,e,r)+e,i[t]=n),n}static _collapseSpaces(t){return t==="normal"||t==="pre-line"}static _collapseNewlines(t){return t==="normal"}static _trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const i=t[e];if(!j.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static _isNewline(t){return typeof t!="string"?!1:j._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:j._breakingSpaces.includes(t.charCodeAt(0))}static _tokenize(t){const e=[];let i="";if(typeof t!="string")return e;for(let r=0;r{if(typeof Intl?.Segmenter=="function"){const s=new Intl.Segmenter;return t=>{const e=s.segment(t),i=[];let r=0;for(const n of e)i[r++]=n.segment;return i}}return s=>[...s]})();Ae.experimentalLetterSpacing=!1;Ae._fonts={};Ae._newlines=[10,13];Ae._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];Ae._measurementCache=Xa(1e3);let ds=Ae;const $n=[{offset:0,color:"white"},{offset:1,color:"black"}],tn=class Gr{constructor(...t){this.uid=Ot("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let e=zu(t);e={...e.type==="radial"?Gr.defaultRadialOptions:Gr.defaultLinearOptions,...$o(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:jt.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:i,y:r}=this.end,n=i-t,o=r-e;const a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){const p=t;t=i,i=p,n*=-1}if(o<0){const p=e;e=r,r=p,o*=-1}}const h=this.colorStops.length?this.colorStops:$n,l=this._textureSize,{canvas:c,context:u}=Zn(l,1),_=a?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);Kn(_,h),u.fillStyle=_,u.fillRect(0,0,l,1),this.texture=new _t({source:new Je({resource:c,addressMode:this._wrapMode})});const d=Math.sqrt(n*n+o*o),f=Math.atan2(o,n),g=new gt;g.scale(d/l,1),g.rotate(f),g.translate(t,e),this.textureSpace==="local"&&g.scale(l,l),this.transform=g}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:$n,e=this._textureSize,{canvas:i,context:r}=Zn(e,e),{x:n,y:o}=this.center,{x:a,y:h}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,u=a-c,_=h-c,d=e/(c*2),f=(n-u)*d,g=(o-_)*d,p=r.createRadialGradient(f,g,l*d,(a-u)*d,(h-_)*d,c*d);Kn(p,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,e,e),r.fillStyle=p,r.translate(f,g),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-f,-g),r.fillRect(0,0,e,e),this.texture=new _t({source:new Je({resource:i,addressMode:this._wrapMode})});const y=new gt;y.scale(1/d,1/d),y.translate(u,_),this.textureSpace==="local"&&y.scale(e,e),this.transform=y}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};tn.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};tn.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Be=tn;function Kn(s,t){for(let e=0;e2&&(o.push([h].concat(l.splice(0,2))),c="l",h=h=="m"?"l":"L");;){if(l.length==s[c])return l.unshift(h),o.push(l);if(l.length0&&(r=i.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:It(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&r===null&&(r={startX:n,startY:o},i.push(r))}return t}class en{constructor(t=0,e=0,i=0){this.type="circle",this.x=t,this.y=e,this.radius=i}clone(){return new en(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i}strokeContains(t,e,i,r=.5){if(this.radius===0)return!1;const n=this.x-t,o=this.y-e,a=this.radius,h=(1-r)*i,l=Math.sqrt(n*n+o*o);return l<=a+h&&l>a-(i-h)}getBounds(t){return t||(t=new Mt),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class sn{constructor(t=0,e=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=i,this.halfHeight=r}clone(){return new sn(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,e,i,r=.5){const{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return!1;const a=i*(1-r),h=i-a,l=n-h,c=o-h,u=n+a,_=o+a,d=t-this.x,f=e-this.y,g=d*d/(l*l)+f*f/(c*c),p=d*d/(u*u)+f*f/(_*_);return g>1&&p<=1}getBounds(t){return t||(t=new Mt),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Lu(s,t,e,i,r,n){const o=s-e,a=t-i,h=r-e,l=n-i,c=o*h+a*l,u=h*h+l*l;let _=-1;u!==0&&(_=c/u);let d,f;_<0?(d=e,f=i):_>1?(d=r,f=n):(d=e+_*h,f=i+_*l);const g=s-d,p=t-f;return g*g+p*p}let Ou,Gu;class Ei{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let r=0,n=e.length;re!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(i=!i)}return i}strokeContains(t,e,i,r=.5){const n=i*i,o=n*(1-r),a=n-o,{points:h}=this,l=h.length-(this.closePath?0:2);for(let c=0;cr?l:r,n=co?c:o}return t.x=i,t.width=r-i,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return ht("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return ht("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const os=(s,t,e,i,r,n,o)=>{const a=s-e,h=t-i,l=Math.sqrt(a*a+h*h);return l>=r-n&&l<=r+o};class rn{constructor(t=0,e=0,i=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n}getBounds(t){return t||(t=new Mt),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new rn(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=e-(this.y+i);const o=i*i;if(r*r+n*n<=o||(r=t-(this.x+this.width-i),r*r+n*n<=o)||(n=e-(this.y+this.height-i),r*r+n*n<=o)||(r=t-(this.x+i),r*r+n*n<=o))return!0}return!1}strokeContains(t,e,i,r=.5){const{x:n,y:o,width:a,height:h,radius:l}=this,c=i*(1-r),u=i-c,_=n+l,d=o+l,f=a-l*2,g=h-l*2,p=n+a,y=o+h;return(t>=n-c&&t<=n+u||t>=p-u&&t<=p+c)&&e>=d&&e<=d+g||(e>=o-c&&e<=o+u||e>=y-u&&e<=y+c)&&t>=_&&t<=_+f?!0:t<_&&ep-l&&ep-l&&e>y-l&&os(t,e,p-l,y-l,l,u,c)||t<_&&e>y-l&&os(t,e,_,y-l,l,u,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const Ya={};function Du(s,t,e){let i=2166136261;for(let r=0;r>>=0;return Ya[i]||Uu(s,t,i,e)}function Uu(s,t,e,i){const r={};let n=0;for(let a=0;a0){const o=new Uint8Array(s,e*8,n);new Uint8Array(t,e*8,n).set(o)}}const Nu={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Wu=(s=>(s[s.DISABLED=0]="DISABLED",s[s.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",s[s.MASK_ACTIVE=2]="MASK_ACTIVE",s[s.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",s[s.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",s[s.NONE=5]="NONE",s))(Wu||{});function io(s,t){return t.alphaMode==="no-premultiply-alpha"&&Nu[s]||s}const Hu=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` diff --git a/assets/Index-DEV3zA_w.js b/assets/Index-CoiAXrHT.js similarity index 90% rename from assets/Index-DEV3zA_w.js rename to assets/Index-CoiAXrHT.js index bbf3899ac6ed2736bc38facb7d2b52f132fc0f97..de43d226a4c083fdf0933c8988eb0b7b980602ea 100644 --- a/assets/Index-DEV3zA_w.js +++ b/assets/Index-CoiAXrHT.js @@ -1 +1 @@ -import{B as Fe,d as Qe,r as Je,p as ue,i as N,q as K,w as me,b as Ae,g as Ee,f as Xe,j as je,G as Ke}from"./i18n-CPHyzK9b.js";import{p as Ve,ay as Be,J as We,az as xe,aA as $e,aB as et,aC as tt,P as at,aD as Me,aE as rt,a6 as nt,a0 as Se,aF as st,h as ce,e as lt,aG as ot,s as it,aH as vt,ap as ke,M as He,ac as Oe,Z as e,aI as ut,aJ as mt,$ as W,a as r,O as Ne,aa as de,R as f,ab as ct,a3 as M,N as I,a2 as o,S as se,ah as dt,U as V,Q as S,t as ne,X as _e,T as p,a4 as _t}from"./index-DydPgVMC.js";import{B as pt}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{k as ft}from"./key-CFGu0zzg.js";import"./Textbox-BhB0hOv8.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import Te from"./Example-Cr4dhaJx.js";import"./snippet-BtHMuX3s.js";import"./actions-4RaHFoGI.js";import"./input-BtIxlP_B.js";import"./BlockTitle-DNiCHWOR.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./Send-oZH_TPNw.js";import"./Square-D8rV3Ea-.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./index-B_pwUImq.js";import"./size-D4lmUoTq.js";/* empty css */const De=0,ze=1;function we(R,t,w,a,u){ce&<();var P=nt(),E=rt,i=P?Me(E):Se(E,!1,!1),y=P?Me(E):Se(E,!1,!1),x=new Fe(R);Ve(()=>{var m=t(),c=!1;let H=ce&&Be(m)===(R.data===ot);if(H&&(it(vt()),ke(!1)),Be(m)){var F=st(),le=!1;const T=D=>{if(!c){le=!0,F(!1),$e.ensure(),ce&&ke(!1);try{D()}finally{et(),tt||at()}}};m.then(D=>{T(()=>{xe(i,D),x.ensure(ze,a&&(A=>a(A,i)))})},D=>{T(()=>{if(xe(y,D),x.ensure(ze,u&&(A=>u(A,y))),!u)throw y.v})}),ce?x.ensure(De,w):We(()=>{le||T(()=>{x.ensure(De,w)})})}else xe(i,m),x.ensure(ze,a&&(T=>a(T,i)));return H&&ke(!0),()=>{c=!0}})}var gt=f("");function Ge(R,t){He(t,!0);let w=Je(t,["$$slots","$$events","$$legacy","component","runtime"]),a=de(null);Oe(()=>{if(!e(a)||!t.component)return;const P=t.component,E=t.runtime,i=w;if(E){const y=E.mount(P.default,{target:e(a),props:i});return()=>{E.unmount(y)}}else{const y=ut(P.default,{target:e(a),props:i});return()=>{mt(y)}}});var u=gt();Qe(u,P=>W(a,P),()=>e(a)),r(R,u),Ne()}var ht=f(''),bt=f(''),yt=f(' '),xt=f(""),kt=f(''),zt=f('
            '),wt=f("
            ...
            "),Et=f(""),Ht=f('
            Pages:
            '),Nt=f(" ",1),It=f(''),Pt=f('');function At(R,t){He(t,!0);let w=ue(t,"sample_labels",3,null),a=ue(t,"value",15,null),u=ue(t,"samples_per_page",3,10),P=ue(t,"layout",3,null),E=o(()=>t.proxy_url?`/proxy=${t.proxy_url}file=`:`${t.root}/file=`),i=de(-1),y=o(()=>(t.components.length<2||w()!==null)&&P()!=="table"),x=o(()=>w()?w().map(v=>[v]):t.samples??[]),m=de(0);Oe(()=>{e(x),W(m,0)});let c=o(()=>e(x).length>u()),H=o(()=>e(c)?e(x).slice(e(m)*u(),(e(m)+1)*u()):e(x).slice()),F=o(()=>Math.ceil(e(x).length/u())),le=o(()=>{if(!e(c))return[];let v=[];return[0,e(m),e(F)-1].forEach(G=>{for(let g=G-2;g<=G+2;g++)g>=0&&g0&&g-v[v.length-1]>1&&v.push(-1),v.push(g))}),v});function T(v){W(i,v,!0)}function D(){W(i,-1)}let A=de(ct([]));async function Re(v){const G=JSON.parse(v);W(A,await Promise.all(G&&G.map(async g=>await Promise.all(g.map(async(Q,q)=>{const C=t.load_component(t.components[q].name,"example",t.components[q].class_id);return{value:Q,component:C.component,runtime:C.runtime}})))),!0)}let qe=o(()=>JSON.stringify(e(H)||[]));var Ie=M(),Ce=I(Ie);we(Ce,()=>Re(e(qe)),v=>{var G=M(),g=I(G);{var Q=q=>{var C=Pt();K(C,21,()=>e(H),me,(pe,U,h)=>{var k=M(),Y=I(k);{var b=s=>{var d=It();d.__click=()=>{a(h+e(m)*u()),t.onclick({index:a(),value:e(U)}),t.onselect({index:a(),value:e(U)})};var L=S(d);{var J=n=>{{let l=o(()=>e(i)===h);Te(n,{get value(){return e(U)[0]},get selected(){return e(l)},type:"gallery"})}},B=n=>{var l=_t();ne(()=>_e(l,e(U)[0])),r(n,l)};N(L,n=>{w()?n(J):n(B,!1)})}p(d),V("mouseenter",d,()=>T(h)),V("mouseleave",d,()=>D()),r(s,d)};N(Y,s=>{e(U)[0]!=null&&s(b)})}r(pe,k)}),p(C),r(q,C)};N(g,q=>{e(y)&&q(Q)})}r(v,G)},(v,G)=>{var g=Nt(),Q=I(g);{var q=h=>{var k=bt();K(k,21,()=>e(H),me,(Y,b,s)=>{var d=M(),L=I(d);{var J=B=>{var n=ht();n.__click=()=>{a(s+e(m)*u()),t.onclick({index:a(),value:e(b)}),t.onselect({index:a(),value:e(b)})};var l=S(n);{var O=_=>{{let X=o(()=>e(i)===s);Te(_,{get value(){return e(b)[0]},get selected(){return e(X)},type:"gallery"})}},z=_=>{var X=M(),$=I(X);{var oe=ie=>{var ve=M(),fe=I(ve);we(fe,()=>Promise.all([e(A)[s][0].component,e(A)[s][0].runtime]),null,(ge,ee)=>{var te=o(()=>{var[ae,re]=e(ee);return{component:ae,runtime:re}}),he=o(()=>e(te).component),be=o(()=>e(te).runtime),j=M(),Z=I(j);ft(Z,()=>e(b)[0],ae=>{{let re=o(()=>e(i)===s);Ge(ae,Ee({get component(){return e(he)},get runtime(){return e(be)}},()=>t.component_props[0],{get value(){return e(b)[0]},get samples_dir(){return e(E)},type:"gallery",get selected(){return e(re)},index:s,get root(){return t.root}}))}}),r(ge,j)}),r(ie,ve)};N($,ie=>{e(A).length&&e(A)[s]&&ie(oe)},!0)}r(_,X)};N(l,_=>{w()?_(O):_(z,!1)})}p(n),V("mouseenter",n,()=>T(s)),V("mouseleave",n,()=>D()),r(B,n)};N(L,B=>{e(b)[0]!=null&&B(J)})}r(Y,d)}),p(k),r(h,k)},C=h=>{var k=M(),Y=I(k);{var b=s=>{var d=zt(),L=S(d),J=S(L),B=S(J);K(B,20,()=>t.headers,l=>l,(l,O)=>{var z=yt(),_=S(z,!0);p(z),ne(()=>_e(_,O)),r(l,z)}),p(B),p(J);var n=se(J);K(n,21,()=>e(A),me,(l,O,z)=>{var _=kt();_.__click=()=>{a(z+e(m)*u()),t.onclick({index:a(),value:e(O)}),t.onselect({index:a(),value:e(H)[z]})},K(_,21,()=>e(O),me,(X,$,oe,ie)=>{let ve=()=>e($).value,fe=()=>e($).component,ge=()=>e($).runtime;const ee=o(()=>t.components[oe]?.name);var te=M(),he=I(te);{var be=j=>{var Z=xt(),ae=S(Z);we(ae,()=>Promise.all([fe(),ge()]),null,(re,Le)=>{var Pe=o(()=>{var[ye,Ze]=e(Le);return{component:ye,runtime:Ze}}),Ue=o(()=>e(Pe).component),Ye=o(()=>e(Pe).runtime);{let ye=o(()=>e(i)===z);Ge(re,Ee({get component(){return e(Ue)},get runtime(){return e(Ye)}},()=>t.component_props[oe],{get value(){return ve()},get samples_dir(){return e(E)},type:"table",get selected(){return e(ye)},index:z,get root(){return t.root}}))}}),p(Z),ne(()=>{Xe(Z,`max-width: ${e(ee)==="textbox"?"35ch":"auto"}`),Ae(Z,1,je(e(ee)),"svelte-pztbp6")}),r(j,Z)};N(he,j=>{e(ee)!==void 0&&j(be)})}r(X,te)}),p(_),V("mouseenter",_,()=>T(z)),V("mouseleave",_,()=>D()),r(l,_)}),p(n),p(L),p(d),r(s,d)};N(Y,s=>{e(H).length>0&&s(b)},!0)}r(h,k)};N(Q,h=>{e(y)?h(q):h(C,!1)})}var pe=se(Q,2);{var U=h=>{var k=Ht(),Y=se(S(k));K(Y,16,()=>e(le),b=>b,(b,s)=>{var d=M(),L=I(d);{var J=n=>{var l=wt();r(n,l)},B=n=>{var l=Et();l.__click=()=>W(m,s,!0);let O;var z=S(l,!0);p(l),ne(()=>{O=Ae(l,1,"svelte-pztbp6",null,O,{"current-page":e(m)===s}),_e(z,s+1)}),r(n,l)};N(L,n=>{s===-1?n(J):n(B,!1)})}r(b,d)}),p(k),r(h,k)};N(pe,h=>{e(c)&&h(U)})}r(v,g)}),r(R,Ie),Ne()}dt(["click"]);var Bt=f('
            '),Mt=f(" ",1);function ta(R,t){He(t,!0);let w=Je(t,["$$slots","$$events","$$legacy"]);const a=new Ke(w);a.watch_for_change();let u=o(()=>a.props.samples??[]);pt(R,{get visible(){return a.shared.visible},padding:!1,get elem_id(){return a.shared.elem_id},get elem_classes(){return a.shared.elem_classes},get scale(){return a.shared.scale},get min_width(){return a.shared.min_width},allow_overflow:!1,container:!1,children:(P,E)=>{var i=Mt(),y=I(i);{var x=c=>{var H=Bt(),F=se(S(H));p(H),ne(()=>_e(F,` ${(a.shared.label||"Examples")??""}`)),r(c,H)};N(y,c=>{a.shared.show_label&&c(x)})}var m=se(y,2);At(m,Ee({onclick:c=>(a.props.value=Array.isArray(c.index)?c.index[0]:c.index,a.dispatch("click")),onselect:c=>a.dispatch("select",c),get load_component(){return a.shared.load_component}},()=>a.props,{get samples(){return e(u)}})),r(P,i)},$$slots:{default:!0}}),Ne()}export{ta as default}; +import{B as Fe,d as Qe,r as Je,p as ue,i as N,q as K,w as me,b as Ae,g as Ee,f as Xe,j as je,G as Ke}from"./i18n-DtG3MAQ1.js";import{p as Ve,ay as Be,J as We,az as xe,aA as $e,aB as et,aC as tt,P as at,aD as Me,aE as rt,a6 as nt,a0 as Se,aF as st,h as ce,e as lt,aG as ot,s as it,aH as vt,ap as ke,M as He,ac as Oe,Z as e,aI as ut,aJ as mt,$ as W,a as r,O as Ne,aa as de,R as f,ab as ct,a3 as M,N as I,a2 as o,S as se,ah as dt,U as V,Q as S,t as ne,X as _e,T as p,a4 as _t}from"./index-BeNBoC9J.js";import{B as pt}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{k as ft}from"./key-CbBDWaWR.js";import"./Textbox-a-5KfA85.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import Te from"./Example-D1yz72bP.js";import"./snippet-BRIBYCwB.js";import"./actions-BbCJS635.js";import"./input-BLFxNjIx.js";import"./BlockTitle-B6Pgijwb.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./Send--YHrNLI0.js";import"./Square-CSlbzSkn.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./index-B_pwUImq.js";import"./size-ChvveZyb.js";/* empty css */const De=0,ze=1;function we(R,t,w,a,u){ce&<();var P=nt(),E=rt,i=P?Me(E):Se(E,!1,!1),y=P?Me(E):Se(E,!1,!1),x=new Fe(R);Ve(()=>{var m=t(),c=!1;let H=ce&&Be(m)===(R.data===ot);if(H&&(it(vt()),ke(!1)),Be(m)){var F=st(),le=!1;const T=D=>{if(!c){le=!0,F(!1),$e.ensure(),ce&&ke(!1);try{D()}finally{et(),tt||at()}}};m.then(D=>{T(()=>{xe(i,D),x.ensure(ze,a&&(A=>a(A,i)))})},D=>{T(()=>{if(xe(y,D),x.ensure(ze,u&&(A=>u(A,y))),!u)throw y.v})}),ce?x.ensure(De,w):We(()=>{le||T(()=>{x.ensure(De,w)})})}else xe(i,m),x.ensure(ze,a&&(T=>a(T,i)));return H&&ke(!0),()=>{c=!0}})}var gt=f("");function Ge(R,t){He(t,!0);let w=Je(t,["$$slots","$$events","$$legacy","component","runtime"]),a=de(null);Oe(()=>{if(!e(a)||!t.component)return;const P=t.component,E=t.runtime,i=w;if(E){const y=E.mount(P.default,{target:e(a),props:i});return()=>{E.unmount(y)}}else{const y=ut(P.default,{target:e(a),props:i});return()=>{mt(y)}}});var u=gt();Qe(u,P=>W(a,P),()=>e(a)),r(R,u),Ne()}var ht=f(''),bt=f(''),yt=f(' '),xt=f(""),kt=f(''),zt=f('
            '),wt=f("
            ...
            "),Et=f(""),Ht=f('
            Pages:
            '),Nt=f(" ",1),It=f(''),Pt=f('');function At(R,t){He(t,!0);let w=ue(t,"sample_labels",3,null),a=ue(t,"value",15,null),u=ue(t,"samples_per_page",3,10),P=ue(t,"layout",3,null),E=o(()=>t.proxy_url?`/proxy=${t.proxy_url}file=`:`${t.root}/file=`),i=de(-1),y=o(()=>(t.components.length<2||w()!==null)&&P()!=="table"),x=o(()=>w()?w().map(v=>[v]):t.samples??[]),m=de(0);Oe(()=>{e(x),W(m,0)});let c=o(()=>e(x).length>u()),H=o(()=>e(c)?e(x).slice(e(m)*u(),(e(m)+1)*u()):e(x).slice()),F=o(()=>Math.ceil(e(x).length/u())),le=o(()=>{if(!e(c))return[];let v=[];return[0,e(m),e(F)-1].forEach(G=>{for(let g=G-2;g<=G+2;g++)g>=0&&g0&&g-v[v.length-1]>1&&v.push(-1),v.push(g))}),v});function T(v){W(i,v,!0)}function D(){W(i,-1)}let A=de(ct([]));async function Re(v){const G=JSON.parse(v);W(A,await Promise.all(G&&G.map(async g=>await Promise.all(g.map(async(Q,q)=>{const C=t.load_component(t.components[q].name,"example",t.components[q].class_id);return{value:Q,component:C.component,runtime:C.runtime}})))),!0)}let qe=o(()=>JSON.stringify(e(H)||[]));var Ie=M(),Ce=I(Ie);we(Ce,()=>Re(e(qe)),v=>{var G=M(),g=I(G);{var Q=q=>{var C=Pt();K(C,21,()=>e(H),me,(pe,U,h)=>{var k=M(),Y=I(k);{var b=s=>{var d=It();d.__click=()=>{a(h+e(m)*u()),t.onclick({index:a(),value:e(U)}),t.onselect({index:a(),value:e(U)})};var L=S(d);{var J=n=>{{let l=o(()=>e(i)===h);Te(n,{get value(){return e(U)[0]},get selected(){return e(l)},type:"gallery"})}},B=n=>{var l=_t();ne(()=>_e(l,e(U)[0])),r(n,l)};N(L,n=>{w()?n(J):n(B,!1)})}p(d),V("mouseenter",d,()=>T(h)),V("mouseleave",d,()=>D()),r(s,d)};N(Y,s=>{e(U)[0]!=null&&s(b)})}r(pe,k)}),p(C),r(q,C)};N(g,q=>{e(y)&&q(Q)})}r(v,G)},(v,G)=>{var g=Nt(),Q=I(g);{var q=h=>{var k=bt();K(k,21,()=>e(H),me,(Y,b,s)=>{var d=M(),L=I(d);{var J=B=>{var n=ht();n.__click=()=>{a(s+e(m)*u()),t.onclick({index:a(),value:e(b)}),t.onselect({index:a(),value:e(b)})};var l=S(n);{var O=_=>{{let X=o(()=>e(i)===s);Te(_,{get value(){return e(b)[0]},get selected(){return e(X)},type:"gallery"})}},z=_=>{var X=M(),$=I(X);{var oe=ie=>{var ve=M(),fe=I(ve);we(fe,()=>Promise.all([e(A)[s][0].component,e(A)[s][0].runtime]),null,(ge,ee)=>{var te=o(()=>{var[ae,re]=e(ee);return{component:ae,runtime:re}}),he=o(()=>e(te).component),be=o(()=>e(te).runtime),j=M(),Z=I(j);ft(Z,()=>e(b)[0],ae=>{{let re=o(()=>e(i)===s);Ge(ae,Ee({get component(){return e(he)},get runtime(){return e(be)}},()=>t.component_props[0],{get value(){return e(b)[0]},get samples_dir(){return e(E)},type:"gallery",get selected(){return e(re)},index:s,get root(){return t.root}}))}}),r(ge,j)}),r(ie,ve)};N($,ie=>{e(A).length&&e(A)[s]&&ie(oe)},!0)}r(_,X)};N(l,_=>{w()?_(O):_(z,!1)})}p(n),V("mouseenter",n,()=>T(s)),V("mouseleave",n,()=>D()),r(B,n)};N(L,B=>{e(b)[0]!=null&&B(J)})}r(Y,d)}),p(k),r(h,k)},C=h=>{var k=M(),Y=I(k);{var b=s=>{var d=zt(),L=S(d),J=S(L),B=S(J);K(B,20,()=>t.headers,l=>l,(l,O)=>{var z=yt(),_=S(z,!0);p(z),ne(()=>_e(_,O)),r(l,z)}),p(B),p(J);var n=se(J);K(n,21,()=>e(A),me,(l,O,z)=>{var _=kt();_.__click=()=>{a(z+e(m)*u()),t.onclick({index:a(),value:e(O)}),t.onselect({index:a(),value:e(H)[z]})},K(_,21,()=>e(O),me,(X,$,oe,ie)=>{let ve=()=>e($).value,fe=()=>e($).component,ge=()=>e($).runtime;const ee=o(()=>t.components[oe]?.name);var te=M(),he=I(te);{var be=j=>{var Z=xt(),ae=S(Z);we(ae,()=>Promise.all([fe(),ge()]),null,(re,Le)=>{var Pe=o(()=>{var[ye,Ze]=e(Le);return{component:ye,runtime:Ze}}),Ue=o(()=>e(Pe).component),Ye=o(()=>e(Pe).runtime);{let ye=o(()=>e(i)===z);Ge(re,Ee({get component(){return e(Ue)},get runtime(){return e(Ye)}},()=>t.component_props[oe],{get value(){return ve()},get samples_dir(){return e(E)},type:"table",get selected(){return e(ye)},index:z,get root(){return t.root}}))}}),p(Z),ne(()=>{Xe(Z,`max-width: ${e(ee)==="textbox"?"35ch":"auto"}`),Ae(Z,1,je(e(ee)),"svelte-pztbp6")}),r(j,Z)};N(he,j=>{e(ee)!==void 0&&j(be)})}r(X,te)}),p(_),V("mouseenter",_,()=>T(z)),V("mouseleave",_,()=>D()),r(l,_)}),p(n),p(L),p(d),r(s,d)};N(Y,s=>{e(H).length>0&&s(b)},!0)}r(h,k)};N(Q,h=>{e(y)?h(q):h(C,!1)})}var pe=se(Q,2);{var U=h=>{var k=Ht(),Y=se(S(k));K(Y,16,()=>e(le),b=>b,(b,s)=>{var d=M(),L=I(d);{var J=n=>{var l=wt();r(n,l)},B=n=>{var l=Et();l.__click=()=>W(m,s,!0);let O;var z=S(l,!0);p(l),ne(()=>{O=Ae(l,1,"svelte-pztbp6",null,O,{"current-page":e(m)===s}),_e(z,s+1)}),r(n,l)};N(L,n=>{s===-1?n(J):n(B,!1)})}r(b,d)}),p(k),r(h,k)};N(pe,h=>{e(c)&&h(U)})}r(v,g)}),r(R,Ie),Ne()}dt(["click"]);var Bt=f('
            '),Mt=f(" ",1);function ta(R,t){He(t,!0);let w=Je(t,["$$slots","$$events","$$legacy"]);const a=new Ke(w);a.watch_for_change();let u=o(()=>a.props.samples??[]);pt(R,{get visible(){return a.shared.visible},padding:!1,get elem_id(){return a.shared.elem_id},get elem_classes(){return a.shared.elem_classes},get scale(){return a.shared.scale},get min_width(){return a.shared.min_width},allow_overflow:!1,container:!1,children:(P,E)=>{var i=Mt(),y=I(i);{var x=c=>{var H=Bt(),F=se(S(H));p(H),ne(()=>_e(F,` ${(a.shared.label||"Examples")??""}`)),r(c,H)};N(y,c=>{a.shared.show_label&&c(x)})}var m=se(y,2);At(m,Ee({onclick:c=>(a.props.value=Array.isArray(c.index)?c.index[0]:c.index,a.dispatch("click")),onselect:c=>a.dispatch("select",c),get load_component(){return a.shared.load_component}},()=>a.props,{get samples(){return e(u)}})),r(P,i)},$$slots:{default:!0}}),Ne()}export{ta as default}; diff --git a/assets/Index-Cp7-lnfK.js b/assets/Index-CuoFhwiy.js similarity index 86% rename from assets/Index-Cp7-lnfK.js rename to assets/Index-CuoFhwiy.js index 83f167154ca1a51063d3eb93b783b8d4fe0573b6..2e08bfa5aced2a2209ff43785e3e2fd07fee35ce 100644 --- a/assets/Index-Cp7-lnfK.js +++ b/assets/Index-CuoFhwiy.js @@ -1 +1 @@ -import{p as r,d as E,i as U,a as f,G as F,r as H}from"./i18n-CPHyzK9b.js";import{M as C,N as x,a as m,t as B,O as L,S as A,R as G,Z as h,as as J,G as K,a2 as j,ah as Q,a3 as T,a4 as V,X as Y,a5 as $}from"./index-DydPgVMC.js";import{s as ee}from"./snippet-BtHMuX3s.js";import{B as te}from"./Button-CV36sOqf.js";import{i as ae}from"./Upload-Bq9KuxCu.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./Image-CZ1Hb99p.js";import"./misc-Dkc5KZ-v.js";/* empty css *//* empty css */import"./actions-4RaHFoGI.js";var ie=G(''),re=G(" ",1),le=G(' ',1);function ne(p,e){C(e,!0);let y=r(e,"elem_id",3,""),t=r(e,"elem_classes",19,()=>[]),b=r(e,"visible",3,!0),d=r(e,"file_types",19,()=>[]),w=r(e,"size",3,"lg"),i=r(e,"icon",3,null),g=r(e,"scale",3,null),v=r(e,"min_width",3,void 0),M=r(e,"variant",3,"secondary"),N=r(e,"disabled",3,!1),O=r(e,"max_file_size",3,null),k,I=j(()=>d()==null?null:d().map(a=>a.startsWith(".")?a:a+"/*").join(", "));function R(){e.onclick?.(),k.click()}async function S(l){let a=Array.from(l).filter(s=>{const z="."+s.name.toLowerCase().split(".").pop();return ae(h(I),z,s.type)?!0:(e.onerror?.(`Invalid file type only ${d()?.join(", ")} allowed.`),!1)});if(!a.length)return;e.file_count==="single"&&(a=[a[0]]);let o=await J(a);await K();try{o=(await e.upload(o,e.root,void 0,O()??1/0))?.filter(s=>s!==null)}catch(s){e.onerror?.(s.message);return}const _=e.file_count==="single"?o?.[0]:o;e.onchange?.(_),e.onupload?.(_)}async function W(l){const a=l.target;a.files&&await S(a.files)}function X(l){const a=l.target;a.value&&(a.value="")}var P=le(),n=x(P);n.__change=W,n.__click=X,E(n,l=>k=l,()=>k);var Z=A(n,2);te(Z,{get size(){return w()},get variant(){return M()},get elem_id(){return y()},get elem_classes(){return t()},get visible(){return b()},onclick:R,get scale(){return g()},get min_width(){return v()},get disabled(){return N()},children:(l,a)=>{var o=re(),_=x(o);{var s=u=>{var c=ie();B(()=>{f(c,"src",i().url),f(c,"alt",`${e.value} icon`)}),m(u,c)};U(_,u=>{i()&&u(s)})}var z=A(_,2);{var q=u=>{var c=T(),D=x(c);ee(D,()=>e.children),m(u,c)};U(z,u=>{e.children&&u(q)})}m(l,o)},$$slots:{default:!0}}),B(()=>{f(n,"accept",h(I)),n.multiple=e.file_count==="multiple"||void 0,n.webkitdirectory=e.file_count==="directory"||void 0,f(n,"mozdirectory",e.file_count==="directory"||void 0),f(n,"data-testid",`${e.label??""}-upload-button`)}),m(p,P),L()}Q(["change","click"]);function pe(p,e){C(e,!0);const y=H(e,["$$slots","$$events","$$legacy"]),t=new F(y);let b=j(()=>t.props.value);async function d(i,g){t.props.value=i,t.dispatch(g)}const w=j(()=>!t.shared.interactive);ne(p,{get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get visible(){return t.shared.visible},get file_count(){return t.props.file_count},get file_types(){return t.props.file_types},get size(){return t.props.size},get scale(){return t.shared.scale},get icon(){return t.props.icon},get min_width(){return t.shared.min_width},get root(){return t.shared.root},get value(){return h(b)},get disabled(){return h(w)},get variant(){return t.props.variant},get label(){return t.shared.label},get max_file_size(){return t.shared.max_file_size},onclick:()=>t.dispatch("click"),onchange:i=>d(i,"change"),onupload:i=>d(i,"upload"),onerror:i=>{t.dispatch("error",i)},upload:(...i)=>t.shared.client.upload(...i),children:(i,g)=>{$();var v=V();B(()=>Y(v,t.shared.label??"")),m(i,v)},$$slots:{default:!0}}),L()}export{ne as BaseUploadButton,pe as default}; +import{p as r,d as E,i as U,a as f,G as F,r as H}from"./i18n-DtG3MAQ1.js";import{M as C,N as x,a as m,t as B,O as L,S as A,R as G,Z as h,as as J,G as K,a2 as j,ah as Q,a3 as T,a4 as V,X as Y,a5 as $}from"./index-BeNBoC9J.js";import{s as ee}from"./snippet-BRIBYCwB.js";import{B as te}from"./Button-j0-_VC-G.js";import{i as ae}from"./Upload-CGTpHDBO.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./Image-ALBOEs1f.js";import"./misc-D-Y84gKJ.js";/* empty css *//* empty css */import"./actions-BbCJS635.js";var ie=G(''),re=G(" ",1),le=G(' ',1);function ne(p,e){C(e,!0);let y=r(e,"elem_id",3,""),t=r(e,"elem_classes",19,()=>[]),b=r(e,"visible",3,!0),d=r(e,"file_types",19,()=>[]),w=r(e,"size",3,"lg"),i=r(e,"icon",3,null),g=r(e,"scale",3,null),v=r(e,"min_width",3,void 0),M=r(e,"variant",3,"secondary"),N=r(e,"disabled",3,!1),O=r(e,"max_file_size",3,null),k,I=j(()=>d()==null?null:d().map(a=>a.startsWith(".")?a:a+"/*").join(", "));function R(){e.onclick?.(),k.click()}async function S(l){let a=Array.from(l).filter(s=>{const z="."+s.name.toLowerCase().split(".").pop();return ae(h(I),z,s.type)?!0:(e.onerror?.(`Invalid file type only ${d()?.join(", ")} allowed.`),!1)});if(!a.length)return;e.file_count==="single"&&(a=[a[0]]);let o=await J(a);await K();try{o=(await e.upload(o,e.root,void 0,O()??1/0))?.filter(s=>s!==null)}catch(s){e.onerror?.(s.message);return}const _=e.file_count==="single"?o?.[0]:o;e.onchange?.(_),e.onupload?.(_)}async function W(l){const a=l.target;a.files&&await S(a.files)}function X(l){const a=l.target;a.value&&(a.value="")}var P=le(),n=x(P);n.__change=W,n.__click=X,E(n,l=>k=l,()=>k);var Z=A(n,2);te(Z,{get size(){return w()},get variant(){return M()},get elem_id(){return y()},get elem_classes(){return t()},get visible(){return b()},onclick:R,get scale(){return g()},get min_width(){return v()},get disabled(){return N()},children:(l,a)=>{var o=re(),_=x(o);{var s=u=>{var c=ie();B(()=>{f(c,"src",i().url),f(c,"alt",`${e.value} icon`)}),m(u,c)};U(_,u=>{i()&&u(s)})}var z=A(_,2);{var q=u=>{var c=T(),D=x(c);ee(D,()=>e.children),m(u,c)};U(z,u=>{e.children&&u(q)})}m(l,o)},$$slots:{default:!0}}),B(()=>{f(n,"accept",h(I)),n.multiple=e.file_count==="multiple"||void 0,n.webkitdirectory=e.file_count==="directory"||void 0,f(n,"mozdirectory",e.file_count==="directory"||void 0),f(n,"data-testid",`${e.label??""}-upload-button`)}),m(p,P),L()}Q(["change","click"]);function pe(p,e){C(e,!0);const y=H(e,["$$slots","$$events","$$legacy"]),t=new F(y);let b=j(()=>t.props.value);async function d(i,g){t.props.value=i,t.dispatch(g)}const w=j(()=>!t.shared.interactive);ne(p,{get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get visible(){return t.shared.visible},get file_count(){return t.props.file_count},get file_types(){return t.props.file_types},get size(){return t.props.size},get scale(){return t.shared.scale},get icon(){return t.props.icon},get min_width(){return t.shared.min_width},get root(){return t.shared.root},get value(){return h(b)},get disabled(){return h(w)},get variant(){return t.props.variant},get label(){return t.shared.label},get max_file_size(){return t.shared.max_file_size},onclick:()=>t.dispatch("click"),onchange:i=>d(i,"change"),onupload:i=>d(i,"upload"),onerror:i=>{t.dispatch("error",i)},upload:(...i)=>t.shared.client.upload(...i),children:(i,g)=>{$();var v=V();B(()=>Y(v,t.shared.label??"")),m(i,v)},$$slots:{default:!0}}),L()}export{ne as BaseUploadButton,pe as default}; diff --git a/assets/Index-D9gv-97d.js b/assets/Index-D-QiB6Zt.js similarity index 85% rename from assets/Index-D9gv-97d.js rename to assets/Index-D-QiB6Zt.js index 14f01ce176c1c95e99da3d0a7c20da92959a9b74..08f3b4a4ed1e54734d0f251cd7e40843602a9021 100644 --- a/assets/Index-D9gv-97d.js +++ b/assets/Index-D-QiB6Zt.js @@ -1 +1 @@ -import{G as J,m as K,g as L,i as y,q as V,r as Y,w as ee,y as U,b as te,a as W,v as X}from"./i18n-CPHyzK9b.js";import{M as ae,ac as se,N as S,a3 as Z,a as v,Z as i,S as m,a2 as k,O as le,R as T,t as B,X as I,U as b,Q as g,a4 as re,ar as oe,T as _}from"./index-DydPgVMC.js";import{B as ne}from"./Block-WPcVj6Bq.js";import{B as ie}from"./BlockTitle-DNiCHWOR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as pe}from"./IconButtonWrapper-PnNNNvqI.js";import{S as ce}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{d as ue}from"./index-tFQomdd2.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";var de=T('
            '),ve=T(''),_e=T('
            ',1);function qe(j,q){ae(q,!0);let z=Y(q,["$$slots","$$events","$$legacy"]),e=new J(z);function A(l){e.props.value.includes(l)?e.props.value=e.props.value.filter(c=>c!==l):e.props.value=[...e.props.value,l],e.dispatch("input")}function G(){const l=e.props.choices.map(([,c])=>c);e.props.value.length===l.length?e.props.value=[]:e.props.value=l.slice(),e.dispatch("input")}let P=k(()=>{const l=e.props.choices.map(([,c])=>c);return e.props.value.length===0?"unchecked":e.props.value.length===l.length?"checked":"indeterminate"}),D=k(()=>!e.shared.interactive),E=e.props.value;se(()=>{e.props.value,!ue(E,e.props.value)&&(E=e.props.value,e.dispatch("change",K(e.props.value)))}),ne(j,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},type:"fieldset",get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(l,c)=>{var M=_e(),N=S(M);ce(N,L({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var O=m(N,2);{var C=p=>{pe(p,{get buttons(){return e.props.buttons},on_custom_button_click:h=>{e.dispatch("custom_button_click",{id:h})}})};y(O,p=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&p(C)})}var Q=m(O,2);{let p=k(()=>e.shared.show_label||e.props.show_select_all&&e.shared.interactive);ie(Q,{get show_label(){return i(p)},get info(){return e.props.info},children:(h,x)=>{var f=Z(),w=S(f);{var s=r=>{var t=de(),o=g(t),n=g(o);X(n),_(o);var a=m(o,2),d=g(a,!0);_(a),_(t),B(()=>{U(n,i(P)==="checked"),n.indeterminate=i(P)==="indeterminate",I(d,e.shared.show_label?e.shared.label:"Select All")}),b("change",n,G),b("click",a,G),v(r,t)},u=r=>{var t=Z(),o=S(t);{var n=a=>{var d=re();B($=>I(d,$),[()=>e.shared.label||e.i18n("checkbox.checkbox_group")]),v(a,d)};y(o,a=>{e.shared.show_label&&a(n)},!0)}v(r,t)};y(w,r=>{e.props.show_select_all&&e.shared.interactive?r(s):r(u,!1)})}v(h,f)},$$slots:{default:!0}})}var R=m(Q,2);V(R,21,()=>e.props.choices,ee,(p,h,x)=>{var f=k(()=>oe(i(h),2));let w=()=>i(f)[0],s=()=>i(f)[1];var u=ve();let r;var t=g(u);X(t);var o=m(t,2),n=g(o,!0);_(o),_(u),B((a,d,$,F,H)=>{r=te(u,1,"svelte-f4netu",null,r,a),t.disabled=i(D),U(t,d),W(t,"name",$),W(t,"title",F),I(n,H)},[()=>({disabled:i(D),selected:e.props.value.includes(s())}),()=>e.props.value.includes(s()),()=>s()?.toString(),()=>s()?.toString(),()=>e.live_i18n(w())]),b("change",t,()=>A(s())),b("input",t,a=>e.dispatch("select",{index:x,value:s(),selected:a.currentTarget.checked})),b("keydown",t,a=>{a.key==="Enter"&&(A(s()),e.dispatch("select",{index:x,value:s(),selected:!e.props.value.includes(s())}))}),v(p,u)}),_(R),v(l,M)},$$slots:{default:!0}}),le()}export{qe as default}; +import{G as J,m as K,g as L,i as y,q as V,r as Y,w as ee,y as U,b as te,a as W,v as X}from"./i18n-DtG3MAQ1.js";import{M as ae,ac as se,N as S,a3 as Z,a as v,Z as i,S as m,a2 as k,O as le,R as T,t as B,X as I,U as b,Q as g,a4 as re,ar as oe,T as _}from"./index-BeNBoC9J.js";import{B as ne}from"./Block-DkzyQHli.js";import{B as ie}from"./BlockTitle-B6Pgijwb.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as pe}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as ce}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{d as ue}from"./index-tFQomdd2.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";var de=T('
            '),ve=T(''),_e=T('
            ',1);function qe(j,q){ae(q,!0);let z=Y(q,["$$slots","$$events","$$legacy"]),e=new J(z);function A(l){e.props.value.includes(l)?e.props.value=e.props.value.filter(c=>c!==l):e.props.value=[...e.props.value,l],e.dispatch("input")}function G(){const l=e.props.choices.map(([,c])=>c);e.props.value.length===l.length?e.props.value=[]:e.props.value=l.slice(),e.dispatch("input")}let P=k(()=>{const l=e.props.choices.map(([,c])=>c);return e.props.value.length===0?"unchecked":e.props.value.length===l.length?"checked":"indeterminate"}),D=k(()=>!e.shared.interactive),E=e.props.value;se(()=>{e.props.value,!ue(E,e.props.value)&&(E=e.props.value,e.dispatch("change",K(e.props.value)))}),ne(j,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},type:"fieldset",get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(l,c)=>{var M=_e(),N=S(M);ce(N,L({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var O=m(N,2);{var C=p=>{pe(p,{get buttons(){return e.props.buttons},on_custom_button_click:h=>{e.dispatch("custom_button_click",{id:h})}})};y(O,p=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&p(C)})}var Q=m(O,2);{let p=k(()=>e.shared.show_label||e.props.show_select_all&&e.shared.interactive);ie(Q,{get show_label(){return i(p)},get info(){return e.props.info},children:(h,x)=>{var f=Z(),w=S(f);{var s=r=>{var t=de(),o=g(t),n=g(o);X(n),_(o);var a=m(o,2),d=g(a,!0);_(a),_(t),B(()=>{U(n,i(P)==="checked"),n.indeterminate=i(P)==="indeterminate",I(d,e.shared.show_label?e.shared.label:"Select All")}),b("change",n,G),b("click",a,G),v(r,t)},u=r=>{var t=Z(),o=S(t);{var n=a=>{var d=re();B($=>I(d,$),[()=>e.shared.label||e.i18n("checkbox.checkbox_group")]),v(a,d)};y(o,a=>{e.shared.show_label&&a(n)},!0)}v(r,t)};y(w,r=>{e.props.show_select_all&&e.shared.interactive?r(s):r(u,!1)})}v(h,f)},$$slots:{default:!0}})}var R=m(Q,2);V(R,21,()=>e.props.choices,ee,(p,h,x)=>{var f=k(()=>oe(i(h),2));let w=()=>i(f)[0],s=()=>i(f)[1];var u=ve();let r;var t=g(u);X(t);var o=m(t,2),n=g(o,!0);_(o),_(u),B((a,d,$,F,H)=>{r=te(u,1,"svelte-f4netu",null,r,a),t.disabled=i(D),U(t,d),W(t,"name",$),W(t,"title",F),I(n,H)},[()=>({disabled:i(D),selected:e.props.value.includes(s())}),()=>e.props.value.includes(s()),()=>s()?.toString(),()=>s()?.toString(),()=>e.live_i18n(w())]),b("change",t,()=>A(s())),b("input",t,a=>e.dispatch("select",{index:x,value:s(),selected:a.currentTarget.checked})),b("keydown",t,a=>{a.key==="Enter"&&(A(s()),e.dispatch("select",{index:x,value:s(),selected:!e.props.value.includes(s())}))}),v(p,u)}),_(R),v(l,M)},$$slots:{default:!0}}),le()}export{qe as default}; diff --git a/assets/Index-C8Nr7g5M.js b/assets/Index-D3MWtY2S.js similarity index 95% rename from assets/Index-C8Nr7g5M.js rename to assets/Index-D3MWtY2S.js index d087672dd1ceb2532d09f9ac5776443f5fcbd54e..6a303854ce3030ddb8efaa47d96ccd81588368fb 100644 --- a/assets/Index-C8Nr7g5M.js +++ b/assets/Index-D3MWtY2S.js @@ -1,2 +1,2 @@ -import{V as Be,p as G,v as De,a as Q,J as Je,f as $,i as B,q as ie,w as ce,b as me,G as Qe,g as Ue,r as Xe}from"./i18n-CPHyzK9b.js";import{a as m,f as Ye,ah as Le,M as be,ab as re,aa as D,aj as Ke,$ as u,t as ee,Z as t,U as F,O as ke,R as w,ac as He,a7 as $e,Q as j,N as te,S as z,a3 as et,a2 as N,T as y,X as ue,ar as tt}from"./index-DydPgVMC.js";import{g as rt}from"./color-Be3KLOYu.js";import{C as Ie}from"./Clear-BR8cTgGu.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as nt}from"./Block-WPcVj6Bq.js";import{B as at}from"./BlockLabel-BzVeVrtL.js";import{E as lt}from"./Empty-B15ItVsj.js";import{I as ot}from"./IconButtonWrapper-PnNNNvqI.js";import{S as st}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./snippet-BtHMuX3s.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var it=Ye('');function Me(s){var r=it();m(s,r)}function Re(s,r){const e=document.createElement("canvas").getContext("2d");e.fillStyle=s,e.fillRect(0,0,1,1);const[l,p,T]=e.getImageData(0,0,1,1).data;return`rgba(${l}, ${p}, ${T}, ${r})`}function pe(s){if(!s)return!0;const r=s.toLowerCase().trim();return r==="transparent"||r.length===9&&r.endsWith("00")}function ct(s,r){const h={};for(const e in s){const l=s[e].trim();l in Be?h[e]=Be[l]:pe(l)?h[e]={primary:"transparent",secondary:"transparent"}:h[e]={primary:r?Re(l,1):l,secondary:r?Re(l,.5):l}}return h}function Oe(s,r){if(s.length===0)return[];const h=[];let e=s[0].token,l=s[0].class_or_confidence;for(let p=1;p');function Ce(s,r){be(r,!0);let h=G(r,"value",31,()=>re([])),e=G(r,"label_to_edit",31,()=>-1),l=G(r,"is_scores_mode",3,!1),p=D(re(r.category?.toString()??""));function T(){if(l()){const o=typeof r.category=="number"?r.category:parseFloat(r.category??"0");return Ve(o)}return r.category===null||r.active_legend&&r.active_legend!==r.category?"":r.color_map[r.category]?.primary??""}function R(o){const C=o.target.value.trim();h([...h().slice(0,r.label_index),{token:r.token,class_or_confidence:C===""?null:l()?Number(C):C},...h().slice(r.label_index+1)]),r.onchange()}function x(o){o.key==="Enter"&&(R(o),e(-1))}var i=ut();De(i),Ke(i,!0),i.__input=o=>{u(p,o.target.value,!0)},i.__keydown=x;let v;ee(o=>{Q(i,"type",l()?"number":"text"),Q(i,"step",l()?"0.1":void 0),Q(i,"placeholder",l()?void 0:"label"),Je(i,r.category),v=$(i,"",v,o)},[()=>({"background-color":T(),width:l()?"7ch":`${(t(p)?.length||4)+4}ch`})]),F("blur",i,R),m(s,i),ke()}Le(["input","keydown"]);var _t=w(''),dt=w('
            '),gt=w(' '),vt=w(''),ft=w(' '),ht=w(''),mt=w(" ",1),pt=w('
            ',1),bt=w('
            -1 0 +1
            '),kt=w(''),wt=w(' '),yt=w('
            ',1),xt=w('
            ');function Et(s,r){be(r,!0);const h=typeof window<"u";let e=G(r,"value",31,()=>re([])),l=G(r,"show_legend",3,!1),p=G(r,"show_inline_category",3,!0),T=G(r,"color_map",19,()=>({})),R=G(r,"show_whitespaces",3,!1),x=G(r,"interactive",3,!1),i=D(-1),v=D(""),o=D(-1),A=D(null),C=D("categories"),P=D(re({}));He(()=>{let n={...T()};for(const f of e())f.class_or_confidence!==null&&(typeof f.class_or_confidence=="string"?(u(C,"categories"),f.class_or_confidence in n||(n[f.class_or_confidence]=rt(Object.keys(n).length))):u(C,"scores"));u(P,ct(n,h),!0)}),$e(()=>{if(!x())return;const n=()=>{u(A,window.getSelection(),!0),_e(),window.removeEventListener("mouseup",n)};window.addEventListener("mousedown",()=>{window.addEventListener("mouseup",n)})});function _e(){if(!t(A))return;const n=t(A).toString();if(!n||!R()&&!n.trim())return;const f=t(A).getRangeAt(0).startOffset,M=t(A).getRangeAt(0).endOffset;de(f,M)}function de(n,f){if(!t(A)?.toString()||t(i)===-1||!e()[t(i)].token.includes(t(A).toString()))return;const M=e()[t(i)].token,X=[{token:M.substring(0,n),class_or_confidence:null},{token:M.substring(n,f),class_or_confidence:t(C)==="scores"?1:"label"},{token:M.substring(f),class_or_confidence:null}].filter(L=>R()?L.token!=="":L.token.trim()!=="");e([...e().slice(0,t(i)),...X,...e().slice(t(i)+1)]),u(o,e().findIndex((L,E)=>E>=t(i)&&L.token===M.substring(n,f)&&L.class_or_confidence!==null),!0),d(),document.getElementById(`label-input-${t(o)}`)?.focus()}function ne(n){n<0||n>=e().length||(e(e()[n].class_or_confidence=null,!0),e(Oe(e())),d(),window.getSelection()?.empty())}function d(){r.onchange?.(e()),u(o,-1)}function I(n){return n===null||t(v)&&t(v)!==n?"":t(P)[n]?.secondary??""}function U(n){return n===null||t(v)&&t(v)!==n?"":t(P)[n]?.primary??""}function we(n){const f=I(n);return pe(f)?"":"black"}var ge=xt(),je=j(ge);{var ze=n=>{var f=pt(),M=te(f);{var X=E=>{var H=dt();ie(H,21,()=>Object.entries(t(P)),ce,(c,O)=>{var a=N(()=>tt(t(O),2));let Z=()=>t(a)[0],W=()=>t(a)[1];var _=_t();let J;var q=j(_,!0);y(_),ee(()=>{J=$(_,"",J,{"background-color":W().secondary}),ue(q,Z())}),F("mouseenter",_,()=>u(v,Z(),!0)),F("mouseleave",_,()=>u(v,"")),F("focus",_,()=>u(v,Z(),!0)),F("blur",_,()=>u(v,"")),m(c,_)}),y(H),m(E,H)};B(M,E=>{l()&&E(X)})}var L=z(M,2);ie(L,21,e,ce,(E,H,c)=>{let O=()=>t(H).token,a=()=>t(H).class_or_confidence;const Z=N(()=>O().split(` +import{V as Be,p as G,v as De,a as Q,J as Je,f as $,i as B,q as ie,w as ce,b as me,G as Qe,g as Ue,r as Xe}from"./i18n-DtG3MAQ1.js";import{a as m,f as Ye,ah as Le,M as be,ab as re,aa as D,aj as Ke,$ as u,t as ee,Z as t,U as F,O as ke,R as w,ac as He,a7 as $e,Q as j,N as te,S as z,a3 as et,a2 as N,T as y,X as ue,ar as tt}from"./index-BeNBoC9J.js";import{g as rt}from"./color-B9Nbxwff.js";import{C as Ie}from"./Clear-BiKSVifk.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as nt}from"./Block-DkzyQHli.js";import{B as at}from"./BlockLabel-CEOjqpu7.js";import{E as lt}from"./Empty-Clj0ErcW.js";import{I as ot}from"./IconButtonWrapper-Ce5bzAyh.js";import{S as st}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./snippet-BRIBYCwB.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var it=Ye('');function Me(s){var r=it();m(s,r)}function Re(s,r){const e=document.createElement("canvas").getContext("2d");e.fillStyle=s,e.fillRect(0,0,1,1);const[l,p,T]=e.getImageData(0,0,1,1).data;return`rgba(${l}, ${p}, ${T}, ${r})`}function pe(s){if(!s)return!0;const r=s.toLowerCase().trim();return r==="transparent"||r.length===9&&r.endsWith("00")}function ct(s,r){const h={};for(const e in s){const l=s[e].trim();l in Be?h[e]=Be[l]:pe(l)?h[e]={primary:"transparent",secondary:"transparent"}:h[e]={primary:r?Re(l,1):l,secondary:r?Re(l,.5):l}}return h}function Oe(s,r){if(s.length===0)return[];const h=[];let e=s[0].token,l=s[0].class_or_confidence;for(let p=1;p');function Ce(s,r){be(r,!0);let h=G(r,"value",31,()=>re([])),e=G(r,"label_to_edit",31,()=>-1),l=G(r,"is_scores_mode",3,!1),p=D(re(r.category?.toString()??""));function T(){if(l()){const o=typeof r.category=="number"?r.category:parseFloat(r.category??"0");return Ve(o)}return r.category===null||r.active_legend&&r.active_legend!==r.category?"":r.color_map[r.category]?.primary??""}function R(o){const C=o.target.value.trim();h([...h().slice(0,r.label_index),{token:r.token,class_or_confidence:C===""?null:l()?Number(C):C},...h().slice(r.label_index+1)]),r.onchange()}function x(o){o.key==="Enter"&&(R(o),e(-1))}var i=ut();De(i),Ke(i,!0),i.__input=o=>{u(p,o.target.value,!0)},i.__keydown=x;let v;ee(o=>{Q(i,"type",l()?"number":"text"),Q(i,"step",l()?"0.1":void 0),Q(i,"placeholder",l()?void 0:"label"),Je(i,r.category),v=$(i,"",v,o)},[()=>({"background-color":T(),width:l()?"7ch":`${(t(p)?.length||4)+4}ch`})]),F("blur",i,R),m(s,i),ke()}Le(["input","keydown"]);var _t=w(''),dt=w('
            '),gt=w(' '),vt=w(''),ft=w(' '),ht=w(''),mt=w(" ",1),pt=w('
            ',1),bt=w('
            -1 0 +1
            '),kt=w(''),wt=w(' '),yt=w('
            ',1),xt=w('
            ');function Et(s,r){be(r,!0);const h=typeof window<"u";let e=G(r,"value",31,()=>re([])),l=G(r,"show_legend",3,!1),p=G(r,"show_inline_category",3,!0),T=G(r,"color_map",19,()=>({})),R=G(r,"show_whitespaces",3,!1),x=G(r,"interactive",3,!1),i=D(-1),v=D(""),o=D(-1),A=D(null),C=D("categories"),P=D(re({}));He(()=>{let n={...T()};for(const f of e())f.class_or_confidence!==null&&(typeof f.class_or_confidence=="string"?(u(C,"categories"),f.class_or_confidence in n||(n[f.class_or_confidence]=rt(Object.keys(n).length))):u(C,"scores"));u(P,ct(n,h),!0)}),$e(()=>{if(!x())return;const n=()=>{u(A,window.getSelection(),!0),_e(),window.removeEventListener("mouseup",n)};window.addEventListener("mousedown",()=>{window.addEventListener("mouseup",n)})});function _e(){if(!t(A))return;const n=t(A).toString();if(!n||!R()&&!n.trim())return;const f=t(A).getRangeAt(0).startOffset,M=t(A).getRangeAt(0).endOffset;de(f,M)}function de(n,f){if(!t(A)?.toString()||t(i)===-1||!e()[t(i)].token.includes(t(A).toString()))return;const M=e()[t(i)].token,X=[{token:M.substring(0,n),class_or_confidence:null},{token:M.substring(n,f),class_or_confidence:t(C)==="scores"?1:"label"},{token:M.substring(f),class_or_confidence:null}].filter(L=>R()?L.token!=="":L.token.trim()!=="");e([...e().slice(0,t(i)),...X,...e().slice(t(i)+1)]),u(o,e().findIndex((L,E)=>E>=t(i)&&L.token===M.substring(n,f)&&L.class_or_confidence!==null),!0),d(),document.getElementById(`label-input-${t(o)}`)?.focus()}function ne(n){n<0||n>=e().length||(e(e()[n].class_or_confidence=null,!0),e(Oe(e())),d(),window.getSelection()?.empty())}function d(){r.onchange?.(e()),u(o,-1)}function I(n){return n===null||t(v)&&t(v)!==n?"":t(P)[n]?.secondary??""}function U(n){return n===null||t(v)&&t(v)!==n?"":t(P)[n]?.primary??""}function we(n){const f=I(n);return pe(f)?"":"black"}var ge=xt(),je=j(ge);{var ze=n=>{var f=pt(),M=te(f);{var X=E=>{var H=dt();ie(H,21,()=>Object.entries(t(P)),ce,(c,O)=>{var a=N(()=>tt(t(O),2));let Z=()=>t(a)[0],W=()=>t(a)[1];var _=_t();let J;var q=j(_,!0);y(_),ee(()=>{J=$(_,"",J,{"background-color":W().secondary}),ue(q,Z())}),F("mouseenter",_,()=>u(v,Z(),!0)),F("mouseleave",_,()=>u(v,"")),F("focus",_,()=>u(v,Z(),!0)),F("blur",_,()=>u(v,"")),m(c,_)}),y(H),m(E,H)};B(M,E=>{l()&&E(X)})}var L=z(M,2);ie(L,21,e,ce,(E,H,c)=>{let O=()=>t(H).token,a=()=>t(H).class_or_confidence;const Z=N(()=>O().split(` `));var W=et(),_=te(W);ie(_,17,()=>t(Z),ce,(J,q,Y)=>{var ae=mt(),le=te(ae);{var ve=g=>{const S=N(()=>I(a()));var K=ft(),V=j(K);let ye;V.__click=()=>{a()!==null&&(x()?(r.onselect?.({index:c,value:[O(),a()]}),u(o,c,!0)):r.onselect?.({index:c,value:[O(),a()]}))},V.__keydown=b=>{x()&&b.key==="Enter"&&a()!==null&&u(o,c,!0)};let xe;var oe=j(V);let Ee;var Ae=j(oe,!0);y(oe);var Se=z(oe,2);{var Ze=b=>{var k=gt();let se;var We=j(k,!0);y(k),ee(qe=>{se=$(k,"",se,qe),ue(We,a())},[()=>({"background-color":U(a())})]),m(b,k)};B(Se,b=>{!l()&&p()&&a()!==null&&t(o)!==c&&b(Ze)})}var Fe=z(Se,2);{var Ge=b=>{Ce(b,{get category(){return a()},get active_legend(){return t(v)},get color_map(){return t(P)},label_index:c,get token(){return O()},onchange:d,get value(){return e()},set value(k){e(k)},get label_to_edit(){return t(o)},set label_to_edit(k){u(o,k,!0)}})};B(Fe,b=>{x()&&t(o)===c&&a()!==null&&b(Ge)})}y(V);var Ne=z(V,2);{var Pe=b=>{var k=vt();k.__click=()=>ne(c);var se=j(k);Ie(se),y(k),m(b,k)};B(Ne,b=>{x()&&a()!==null&&b(Pe)})}y(K),ee((b,k)=>{ye=me(V,1,"token svelte-we11ck",null,ye,b),Q(V,"role",a()!==null?"button":void 0),Q(V,"tabindex",a()!==null?0:void 0),xe=$(V,"",xe,k),Ee=me(oe,1,"text svelte-we11ck",null,Ee,{unlabeled:a()===null}),ue(Ae,t(q))},[()=>({highlighted:a()!==null,transparent:a()!==null&&pe(t(S)),dimmed:t(v)&&t(v)!==a()}),()=>({"background-color":t(S),color:we(a())})]),F("focus",V,()=>u(i,c,!0)),F("mouseenter",V,()=>u(i,c,!0)),m(g,K)};B(le,g=>{(R()?t(q)!=="":t(q).trim())&&g(ve)})}var fe=z(le,2);{var he=g=>{var S=ht();m(g,S)};B(fe,g=>{Y{var f=yt(),M=te(f);{var X=E=>{var H=bt();m(E,H)};B(M,E=>{l()&&E(X)})}var L=z(M,2);ie(L,21,e,ce,(E,H,c)=>{let O=()=>t(H).token,a=()=>t(H).class_or_confidence;const Z=N(()=>typeof a()=="string"?parseFloat(a()):a());var W=wt(),_=j(W);let J;Q(_,"tabindex",0),_.__click=()=>{x()?u(o,c,!0):r.onselect?.({index:c,value:[O(),a()]})},_.__keydown=g=>{g.key==="Enter"&&(x()?u(o,c,!0):r.onselect?.({index:c,value:[O(),a()]}))};let q;var Y=j(_),ae=j(Y,!0);y(Y);var le=z(Y,2);{var ve=g=>{Ce(g,{get category(){return a()},get active_legend(){return t(v)},get color_map(){return t(P)},label_index:c,get token(){return O()},onchange:d,is_scores_mode:!0,get value(){return e()},set value(S){e(S)},get label_to_edit(){return t(o)},set label_to_edit(S){u(o,S,!0)}})};B(le,g=>{x()&&a()!==null&&t(o)===c&&g(ve)})}y(_);var fe=z(_,2);{var he=g=>{var S=kt();S.__click=()=>ne(c);var K=j(S);Ie(K),y(S),m(g,S)};B(fe,g=>{x()&&a()!==null&&t(i)===c&&g(he)})}y(W),ee(g=>{J=me(_,1,"token score-token svelte-we11ck",null,J,{highlighted:t(Z)!==null}),q=$(_,"",q,g),ue(ae,O())},[()=>({"background-color":Ve(t(Z))})]),F("mouseenter",_,()=>u(i,c,!0)),F("focus",_,()=>u(i,c,!0)),m(E,W)}),y(L),m(n,f)};B(je,n=>{t(C)==="categories"?n(ze):n(Te,!1)})}y(ge),m(s,ge),ke()}Le(["click","keydown"]);var St=w(" ",1);function Ft(s,r){be(r,!0);const h=Xe(r,["$$slots","$$events","$$legacy"]),e=new Qe(h);let l=D(re(e.props.value));He(()=>{t(l)!==e.props.value&&(u(l,e.props.value,!0),e.dispatch("change"))});let p=N(()=>e.props.combine_adjacent?Oe(e.props.value||[]):e.props.value);{let T=N(()=>e.shared.interactive?"dashed":"solid");nt(s,{get variant(){return t(T)},test_id:"highlighted-text",get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},padding:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get rtl(){return e.props.rtl},children:(R,x)=>{var i=St(),v=te(i);st(v,Ue({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{onclearstatus:()=>e.dispatch("clear_status",e.shared.loading_status)}));var o=z(v,2);{var A=d=>{ot(d,{get buttons(){return e.props.buttons},on_custom_button_click:I=>e.dispatch("custom_button_click",{id:I})})};B(o,d=>{e.shared.interactive&&e.shared.label&&e.shared.show_label&&e.props.buttons?.length&&d(A)})}var C=z(o,2);{var P=d=>{{let I=N(()=>e.shared.label||e.i18n("highlighted_text.highlighted_text")),U=N(()=>e.shared.container===!1);at(d,{get Icon(){return Me},get label(){return t(I)},float:!1,get disable(){return t(U)},get show_label(){return e.shared.show_label},get rtl(){return e.props.rtl}})}};B(C,d=>{e.shared.label&&e.shared.show_label&&d(P)})}var _e=z(C,2);{var de=d=>{Et(d,{get interactive(){return e.shared.interactive},get show_legend(){return e.props.show_legend},get show_inline_category(){return e.props.show_inline_category},get show_whitespaces(){return e.props.show_whitespaces},get color_map(){return e.props.color_map},onselect:I=>e.dispatch("select",I),onchange:()=>{e.props.value=t(p),e.dispatch("change")},get value(){return t(p)},set value(I){u(p,I)}})},ne=d=>{{let I=N(()=>e.shared.interactive?"small":"large");lt(d,{get size(){return t(I)},get unpadded_box(){return e.shared.interactive},children:(U,we)=>{Me(U)},$$slots:{default:!0}})}};B(_e,d=>{t(p)?d(de):d(ne,!1)})}m(R,i)},$$slots:{default:!0}})}ke()}export{Et as BaseHighlightedText,Ft as default}; diff --git a/assets/Index-AN_eS0Ag.js b/assets/Index-D6_7KJwo.js similarity index 99% rename from assets/Index-AN_eS0Ag.js rename to assets/Index-D6_7KJwo.js index 12eb3db4df865f3651ce208fb81cc364a9c98fb3..327d6e66a827d42804708db80442d0762622de20 100644 --- a/assets/Index-AN_eS0Ag.js +++ b/assets/Index-D6_7KJwo.js @@ -1,4 +1,4 @@ -import{p as C,b as De,a as ge,j as Or,i as H,d as it,f as ot,v as An,J as Dn,q as mt,w as Lr,G as Hr,g as Gr,r as Br}from"./i18n-CPHyzK9b.js";import{aa as ne,ab as $e,ag as rn,Z as l,$ as p,ac as st,v as jr,ah as et,M as Xe,t as ae,a as k,O as Je,a2 as R,Q as V,R as J,T as E,N as ce,S as D,u as Tr,U as Et,ai as qr,a3 as Ce,a4 as On,X as _e,f as Oe,a7 as on,G as xt,au as Nr}from"./index-DydPgVMC.js";import{h as Ln}from"./html-BZIV6tyB.js";import{a as Yt}from"./actions-4RaHFoGI.js";import{b as Ur}from"./size-D4lmUoTq.js";import{U as Wr}from"./Upload-Bq9KuxCu.js";import{c as Kr,I as Xr}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{M as Hn}from"./MarkdownCode-BTj729_f.js";import{b as Jr}from"./input-BtIxlP_B.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{C as Gn}from"./Checkbox-Bh_yH8eu.js";import{C as Qt}from"./Check-2f8HlfSn.js";import{D as Yr}from"./DropdownArrow-Cq3QAKSv.js";import{C as Qr}from"./Copy-B3jzejpA.js";import{F as Zr}from"./FullscreenButton-BuyUU5Yj.js";import{d as $r}from"./dsv-DB8NKgIY.js";import{S as eo}from"./index-CfM_uZQa.js";import{B as to}from"./Block-WPcVj6Bq.js";import{default as ns}from"./Example-DeD_Ynkp.js";import"./snippet-BtHMuX3s.js";import"./prism-python-BGiTAEDL.js";import"./index-B_pwUImq.js";import"./universal-C9tCO36V.js";import"./Maximize-DWbY8BRa.js";import"./Clear-BR8cTgGu.js";function lt(e,t){return typeof e=="function"?e(t):e}function Be(e,t){return n=>{t.setState(r=>({...r,[e]:lt(n,r[e])}))}}function Vt(e){return e instanceof Function}function no(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ro(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function q(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((_,h)=>r[h]!==_)))return o;r=a;let g;if(n.key&&n.debug&&(g=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const _=Math.round((Date.now()-s)*100)/100,h=Math.round((Date.now()-g)*100)/100,d=h/16,c=(v,m)=>{for(v=String(v);v.length{t.setState(r=>({...r,[e]:lt(n,r[e])}))}}function Vt(e){return e instanceof Function}function no(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ro(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function q(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((_,h)=>r[h]!==_)))return o;r=a;let g;if(n.key&&n.debug&&(g=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const _=Math.round((Date.now()-s)*100)/100,h=Math.round((Date.now()-g)*100)/100,d=h/16,c=(v,m)=>{for(v=String(v);v.length{var o;return(o=e?.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function oo(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:q(()=>[e,n,t,i],(s,a,u,g)=>({table:s,column:a,row:u,cell:g,getValue:g.getValue,renderValue:g.renderValue}),N(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function io(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let g=(o=(i=a.id)!=null?i:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,_;if(a.accessorFn?_=a.accessorFn:u&&(u.includes(".")?_=d=>{let c=d;for(const m of u.split(".")){var v;c=(v=c)==null?void 0:v[m]}return c}:_=d=>d[a.accessorKey]),!g)throw new Error;let h={id:`${String(g)}`,accessorFn:_,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:q(()=>[!0],()=>{var d;return[h,...(d=h.columns)==null?void 0:d.flatMap(c=>c.getFlatColumns())]},N(e.options,"debugColumns")),getLeafColumns:q(()=>[e._getOrderColumnsFn()],d=>{var c;if((c=h.columns)!=null&&c.length){let v=h.columns.flatMap(m=>m.getLeafColumns());return d(v)}return[h]},N(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(h,e);return h}const Ie="debugHeaders";function yn(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),s.push(u)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const lo={createTable:e=>{e.getHeaderGroups=q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(h=>n.find(d=>d.id===h)).filter(Boolean))!=null?i:[],u=(s=o?.map(h=>n.find(d=>d.id===h)).filter(Boolean))!=null?s:[],g=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(o!=null&&o.includes(h.id)));return kt(t,[...a,...g,...u],e)},N(e.options,Ie)),e.getCenterHeaderGroups=q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),kt(t,n,e,"center")),N(e.options,Ie)),e.getLeftHeaderGroups=q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return kt(t,i,e,"left")},N(e.options,Ie)),e.getRightHeaderGroups=q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return kt(t,i,e,"right")},N(e.options,Ie)),e.getFooterGroups=q(()=>[e.getHeaderGroups()],t=>[...t].reverse(),N(e.options,Ie)),e.getLeftFooterGroups=q(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),N(e.options,Ie)),e.getCenterFooterGroups=q(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),N(e.options,Ie)),e.getRightFooterGroups=q(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),N(e.options,Ie)),e.getFlatHeaders=q(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),N(e.options,Ie)),e.getLeftFlatHeaders=q(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),N(e.options,Ie)),e.getCenterFlatHeaders=q(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),N(e.options,Ie)),e.getRightFlatHeaders=q(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),N(e.options,Ie)),e.getCenterLeafHeaders=q(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),N(e.options,Ie)),e.getLeftLeafHeaders=q(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),N(e.options,Ie)),e.getRightLeafHeaders=q(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),N(e.options,Ie)),e.getLeafHeaders=q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,u,g;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(u=(g=r[0])==null?void 0:g.headers)!=null?u:[]].map(_=>_.getLeafHeaders()).flat()},N(e.options,Ie))}};function kt(e,t,n,r){var o,i;let s=0;const a=function(d,c){c===void 0&&(c=1),s=Math.max(s,c),d.filter(v=>v.getIsVisible()).forEach(v=>{var m;(m=v.columns)!=null&&m.length&&a(v.columns,c+1)},0)};a(e);let u=[];const g=(d,c)=>{const v={depth:c,id:[r,`${c}`].filter(Boolean).join("_"),headers:[]},m=[];d.forEach(M=>{const I=[...m].reverse()[0],b=M.column.depth===v.depth;let B,X=!1;if(b&&M.column.parent?B=M.column.parent:(B=M.column,X=!0),I&&I?.column===B)I.subHeaders.push(M);else{const P=yn(n,B,{id:[r,c,B.id,M?.id].filter(Boolean).join("_"),isPlaceholder:X,placeholderId:X?`${m.filter(A=>A.column===B).length}`:void 0,depth:c,index:m.length});P.subHeaders.push(M),m.push(P)}v.headers.push(M),M.headerGroup=v}),u.push(v),c>0&&g(m,c-1)},_=t.map((d,c)=>yn(n,d,{depth:s,index:c}));g(_,s-1),u.reverse();const h=d=>d.filter(v=>v.column.getIsVisible()).map(v=>{let m=0,M=0,I=[0];v.subHeaders&&v.subHeaders.length?(I=[],h(v.subHeaders).forEach(B=>{let{colSpan:X,rowSpan:P}=B;m+=X,I.push(P)})):m=1;const b=Math.min(...I);return M=M+b,v.colSpan=m,v.rowSpan=M,{colSpan:m,rowSpan:M}});return h((o=(i=u[0])==null?void 0:i.headers)!=null?o:[]),u}const ln=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const g=e.getColumn(u);if(g!=null&&g.accessorFn)return a._valuesCache[u]=g.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const g=e.getColumn(u);if(g!=null&&g.accessorFn)return g.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=g.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var g;return(g=a.getValue(u))!=null?g:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ro(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],g=a;for(;;){const _=g.getParentRow();if(!_)break;u.push(_),g=_}return u.reverse()},getAllCells:q(()=>[e.getAllLeafColumns()],u=>u.map(g=>oo(e,a,g,g.id)),N(e.options,"debugRows")),_getAllCellsByColumnId:q(()=>[a.getAllCells()],u=>u.reduce((g,_)=>(g[_.column.id]=_,g),{}),N(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Bn=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Bn.autoRemove=e=>Ke(e);const jn=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};jn.autoRemove=e=>Ke(e);const Tn=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Tn.autoRemove=e=>Ke(e);const qn=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};qn.autoRemove=e=>Ke(e);const Nn=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Nn.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Un=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Un.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Wn=(e,t,n)=>e.getValue(t)===n;Wn.autoRemove=e=>Ke(e);const Kn=(e,t,n)=>e.getValue(t)==n;Kn.autoRemove=e=>Ke(e);const sn=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};sn.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};sn.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const tt={includesString:Bn,includesStringSensitive:jn,equalsString:Tn,arrIncludes:qn,arrIncludesAll:Nn,arrIncludesSome:Un,equals:Wn,weakEquals:Kn,inNumberRange:sn};function Ke(e){return e==null||e===""}const ao={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Be("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?tt.includesString:typeof r=="number"?tt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?tt.equals:Array.isArray(r)?tt.arrIncludes:tt.weakEquals},e.getFilterFn=()=>{var n,r;return Vt(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:tt[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(_=>_.id===e.id),s=lt(n,i?i.value:void 0);if(bn(o,s,e)){var a;return(a=r?.filter(_=>_.id!==e.id))!=null?a:[]}const u={id:e.id,value:s};if(i){var g;return(g=r?.map(_=>_.id===e.id?u:_))!=null?g:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=lt(t,o))==null?void 0:i.filter(s=>{const a=n.find(u=>u.id===s.id);if(a){const u=a.getFilterFn();if(bn(u,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function bn(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const uo=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),co=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},go=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r=i)&&(r=i)}),r},fo=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},_o=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!no(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},vo=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),mo=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,po=(e,t)=>t.length,qt={sum:uo,min:co,max:go,extent:fo,mean:ho,median:_o,unique:vo,uniqueCount:mo,count:po},wo={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Be("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return qt.sum;if(Object.prototype.toString.call(r)==="[object Date]")return qt.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Vt(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:qt[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function So(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const Co={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Be("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=q(n=>[bt(t,n)],n=>n.findIndex(r=>r.id===e.id),N(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=bt(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=bt(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const u=s.shift(),g=a.findIndex(_=>_.id===u);g>-1&&i.push(a.splice(g,1)[0])}i=[...i,...a]}return So(i,n,r)},N(e.options,"debugTable"))}},Nt=()=>({left:[],right:[]}),xo={getInitialState:e=>({columnPinning:Nt(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Be("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,u;return{left:((a=o?.left)!=null?a:[]).filter(h=>!(r!=null&&r.includes(h))),right:[...((u=o?.right)!=null?u:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var g,_;return{left:[...((g=o?.left)!=null?g:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((_=o?.right)!=null?_:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((i=o?.left)!=null?i:[]).filter(h=>!(r!=null&&r.includes(h))),right:((s=o?.right)!=null?s:[]).filter(h=>!(r!=null&&r.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},N(t.options,"debugRows")),e.getLeftVisibleCells=q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),N(t.options,"debugRows")),e.getRightVisibleCells=q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),N(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Nt():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Nt())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),N(e.options,"debugColumns")),e.getRightLeafColumns=q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),N(e.options,"debugColumns")),e.getCenterLeafColumns=q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},N(e.options,"debugColumns"))}};function Ro(e){return e||(typeof document<"u"?document:null)}const It={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ut=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),yo={getDefaultColumnDef:()=>It,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ut(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Be("columnSizing",e),onColumnSizingInfoChange:Be("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:It.minSize,(r=i??e.columnDef.size)!=null?r:It.size),(o=e.columnDef.maxSize)!=null?o:It.maxSize)},e.getStart=q(n=>[n,bt(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),N(t.options,"debugColumns")),e.getAfter=q(n=>[n,bt(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),N(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Wt(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(I=>[I.column.id,I.column.getSize()]):[[r.id,r.getSize()]],u=Wt(i)?Math.round(i.touches[0].clientX):i.clientX,g={},_=(I,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(B=>{var X,P;const A=t.options.columnResizeDirection==="rtl"?-1:1,j=(b-((X=B?.startOffset)!=null?X:0))*A,ie=Math.max(j/((P=B?.startSize)!=null?P:0),-.999999);return B.columnSizingStart.forEach(re=>{let[W,z]=re;g[W]=Math.round(Math.max(z+z*ie,0)*100)/100}),{...B,deltaOffset:j,deltaPercentage:ie}}),(t.options.columnResizeMode==="onChange"||I==="end")&&t.setColumnSizing(B=>({...B,...g})))},h=I=>_("move",I),d=I=>{_("end",I),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=Ro(n),v={moveHandler:I=>h(I.clientX),upHandler:I=>{c?.removeEventListener("mousemove",v.moveHandler),c?.removeEventListener("mouseup",v.upHandler),d(I.clientX)}},m={moveHandler:I=>(I.cancelable&&(I.preventDefault(),I.stopPropagation()),h(I.touches[0].clientX),!1),upHandler:I=>{var b;c?.removeEventListener("touchmove",m.moveHandler),c?.removeEventListener("touchend",m.upHandler),I.cancelable&&(I.preventDefault(),I.stopPropagation()),d((b=I.touches[0])==null?void 0:b.clientX)}},M=bo()?{passive:!1}:!1;Wt(i)?(c?.addEventListener("touchmove",m.moveHandler,M),c?.addEventListener("touchend",m.upHandler,M)):(c?.addEventListener("mousemove",v.moveHandler,M),c?.addEventListener("mouseup",v.upHandler,M)),t.setColumnSizingInfo(I=>({...I,startOffset:u,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ut():(n=e.initialState.columnSizingInfo)!=null?n:Ut())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Pt=null;function bo(){if(typeof Pt=="boolean")return Pt;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Pt=e,Pt}function Wt(e){return e.type==="touchstart"}const Fo={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Be("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),N(t.options,"debugRows")),e.getVisibleCells=q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],N(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>q(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),N(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function bt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Mo={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},ko={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Be("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>tt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Vt(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:tt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Io={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Be("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...u}=s;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Zt=0,$t=10,Kt=()=>({pageIndex:Zt,pageSize:$t}),Po={getInitialState:e=>({...e,pagination:{...Kt(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Be("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>lt(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Kt():(o=e.initialState.pagination)!=null?o:Kt())},e.setPageIndex=r=>{e.setPagination(o=>{let i=lt(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Zt:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Zt)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?$t:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:$t)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,lt(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=lt(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=q(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},N(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Xt=()=>({top:[],bottom:[]}),Eo={getInitialState:e=>({rowPinning:Xt(),...e}),getDefaultOptions:e=>({onRowPinningChange:Be("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(u=>{let{id:g}=u;return g}):[],s=o?e.getParentRows().map(u=>{let{id:g}=u;return g}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(u=>{var g,_;if(n==="bottom"){var h,d;return{top:((h=u?.top)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((d=u?.bottom)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var c,v;return{top:[...((c=u?.top)!=null?c:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((v=u?.bottom)!=null?v:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((g=u?.top)!=null?g:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((_=u?.bottom)!=null?_:[]).filter(m=>!(a!=null&&a.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Xt():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Xt())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),N(e.options,"debugRows")),e.getBottomRows=q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),N(e.options,"debugRows")),e.getCenterRows=q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},N(e.options,"debugRows"))}},Vo={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Be("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{en(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Jt(e,n):{rows:[],flatRows:[],rowsById:{}},N(e.options,"debugTable")),e.getFilteredSelectedRowModel=q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Jt(e,n):{rows:[],flatRows:[],rowsById:{}},N(e.options,"debugTable")),e.getGroupedSelectedRowModel=q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Jt(e,n):{rows:[],flatRows:[],rowsById:{}},N(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return en(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return an(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return tn(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return tn(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},en=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>en(e,a.id,n,r,o))};function Jt(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(u=>{var g;const _=an(u,n);if(_&&(r.push(u),o[u.id]=u),(g=u.subRows)!=null&&g.length&&(u={...u,subRows:i(u.subRows)}),_)return u}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function an(e,t){var n;return(n=t[e.id])!=null?n:!1}function tn(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(an(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=tn(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const nn=/([0-9]+)/gm,zo=(e,t,n)=>Xn(at(e.getValue(n)).toLowerCase(),at(t.getValue(n)).toLowerCase()),Ao=(e,t,n)=>Xn(at(e.getValue(n)),at(t.getValue(n))),Do=(e,t,n)=>un(at(e.getValue(n)).toLowerCase(),at(t.getValue(n)).toLowerCase()),Oo=(e,t,n)=>un(at(e.getValue(n)),at(t.getValue(n))),Lo=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:run(e.getValue(n),t.getValue(n));function un(e,t){return e===t?0:e>t?1:-1}function at(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Xn(e,t){const n=e.split(nn).filter(Boolean),r=t.split(nn).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),u=[s,a].sort();if(isNaN(u[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(u[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Rt={alphanumeric:zo,alphanumericCaseSensitive:Ao,text:Do,textCaseSensitive:Oo,datetime:Lo,basic:Ho},Go={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Be("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Rt.datetime;if(typeof i=="string"&&(r=!0,i.split(nn).length>1))return Rt.alphanumeric}return r?Rt.text:Rt.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Vt(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Rt[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(c=>c.id===e.id),u=s?.findIndex(c=>c.id===e.id);let g=[],_,h=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?_="toggle":_="add":s!=null&&s.length&&u!==s.length-1?_="replace":a?_="toggle":_="replace",_==="toggle"&&(i||o||(_="remove")),_==="add"){var d;g=[...s,{id:e.id,desc:h}],g.splice(0,g.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else _==="toggle"?g=s.map(c=>c.id===e.id?{...c,desc:h}:c):_==="remove"?g=s.filter(c=>c.id!==e.id):g=[{id:e.id,desc:h}];return g})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Bo=[lo,Fo,Co,xo,so,ao,Mo,ko,Go,wo,Io,Po,Eo,Vo,yo];function jo(e){var t,n;const r=[...Bo,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,c)=>Object.assign(d,c.getDefaultOptions==null?void 0:c.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var c;u=(c=d.getInitialState==null?void 0:d.getInitialState(u))!=null?c:u});const g=[];let _=!1;const h={_features:r,options:{...i,...e},initialState:u,_queue:d=>{g.push(d),_||(_=!0,Promise.resolve().then(()=>{for(;g.length;)g.shift()();_=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const c=lt(d,o.options);o.options=s(c)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,c,v)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(d,c,v))!=null?m:`${v?[v.id,c].join("."):c}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,c)=>{let v=(c?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!v&&(v=o.getCoreRowModel().rowsById[d],!v))throw new Error;return v},_getDefaultColumnDef:q(()=>[o.options.defaultColumn],d=>{var c;return d=(c=d)!=null?c:{},{header:v=>{const m=v.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:v=>{var m,M;return(m=(M=v.renderValue())==null||M.toString==null?void 0:M.toString())!=null?m:null},...o._features.reduce((v,m)=>Object.assign(v,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...d}},N(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:q(()=>[o._getColumnDefs()],d=>{const c=function(v,m,M){return M===void 0&&(M=0),v.map(I=>{const b=io(o,I,M,m),B=I;return b.columns=B.columns?c(B.columns,b,M+1):[],b})};return c(d)},N(e,"debugColumns")),getAllFlatColumns:q(()=>[o.getAllColumns()],d=>d.flatMap(c=>c.getFlatColumns()),N(e,"debugColumns")),_getAllFlatColumnsById:q(()=>[o.getAllFlatColumns()],d=>d.reduce((c,v)=>(c[v.id]=v,c),{}),N(e,"debugColumns")),getAllLeafColumns:q(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,c)=>{let v=d.flatMap(m=>m.getLeafColumns());return c(v)},N(e,"debugColumns")),getColumn:d=>o._getAllFlatColumnsById()[d]};Object.assign(o,h);for(let d=0;dq(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let g=0;ge._autoResetPageIndex()))}function qo(e,t,n){return n.options.filterFromLeafRows?No(e,t,n):Uo(e,t,n)}function No(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,g){g===void 0&&(g=0);const _=[];for(let d=0;dq(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d{var c;const v=e.getColumn(d.id);if(!v)return;const m=v.getFilterFn();m&&o.push({id:d.id,filterFn:m,resolvedValue:(c=m.resolveFilterValue==null?void 0:m.resolveFilterValue(d.value))!=null?c:d.value})});const s=(n??[]).map(d=>d.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&u.length&&(s.push("__global__"),u.forEach(d=>{var c;i.push({id:d.id,filterFn:a,resolvedValue:(c=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?c:r})}));let g,_;for(let d=0;d{c.columnFiltersMeta[m]=M})}if(i.length){for(let v=0;v{c.columnFiltersMeta[m]=M})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const h=d=>{for(let c=0;ce._autoResetPageIndex()))}function Ko(){return e=>q(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(u=>{var g;return(g=e.getColumn(u.id))==null?void 0:g.getCanSort()}),s={};i.forEach(u=>{const g=e.getColumn(u.id);g&&(s[u.id]={sortUndefined:g.columnDef.sortUndefined,invertSorting:g.columnDef.invertSorting,sortingFn:g.getSortingFn()})});const a=u=>{const g=u.map(_=>({..._}));return g.sort((_,h)=>{for(let c=0;c{var h;o.push(_),(h=_.subRows)!=null&&h.length&&(_.subRows=a(_.subRows))}),g};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},N(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function yt(...e){const t={};for(let n=0;n=0;s--){let a=e[s];typeof a=="function"&&(a=a());const u=(a||{})[i];if(u!==void 0)return u}}})}}return t}function Xo(e){const t=yt({state:{},onStateChange(){},renderFallbackValue:null,mergeOptions:(s,a)=>yt(s,a)},e),n=jo(t);let r=ne($e(n.initialState)),o=ne(0);function i(){n.setOptions(()=>yt(t,e,{state:yt(l(r),e.state||{}),onStateChange:s=>{s instanceof Function?p(r,s(l(r)),!0):p(r,yt(l(r),s),!0),p(o,l(o)+1),e.onStateChange?.(s)}}))}return i(),rn(()=>{i()}),{getRowModel:()=>(l(o),n.getRowModel()),getHeaderGroups:()=>(l(o),n.getHeaderGroups()),getColumn:s=>(l(o),n.getColumn(s))}}function vt(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,u,g;let _;n.key&&((a=n.debug)!=null&&a.call(n))&&(_=Date.now());const h=e();if(!(h.length!==r.length||h.some((v,m)=>r[m]!==v)))return o;r=h;let c;if(n.key&&((u=n.debug)!=null&&u.call(n))&&(c=Date.now()),o=t(...h),n.key&&((g=n.debug)!=null&&g.call(n))){const v=Math.round((Date.now()-_)*100)/100,m=Math.round((Date.now()-c)*100)/100,M=m/16,I=(b,B)=>{for(b=String(b);b.length{o&&!o.contains(e.target)&&!e.defaultPrevented&&a(e)};return document.addEventListener("mousedown",r,!0),{destroy(){document.removeEventListener("mousedown",r,!0)}}}function me(o){const a=o.s,r=o.v;let e=a*r;const g=o.h/60;let u=e*(1-Math.abs(g%2-1));const d=r-e;e=e+d,u=u+d;const w=Math.floor(g)%6,_=[e,u,d,d,u,e][w],m=[u,e,e,u,d,d][w],x=[d,d,u,e,e,u][w];return E({r:_*255,g:m*255,b:x*255,a:o.a}).toHexString()}function tt(o){const a=E(o);return a.isValid()?a.toHexString():o}function at(o,a){return a==="hex"?E(o).toHexString():a==="rgb"?E(o).toRgbString():E(o).toHslString()}var rt=N(""),st=N('
            '),nt=N(' ',1);function ot(o,a){pe(a,!0);let r=H(a,"value",15),e=H(a,"on_input",3,()=>{}),g=H(a,"on_release",3,()=>{}),u=H(a,"on_submit",3,()=>{}),d=H(a,"on_blur",3,()=>{}),w=H(a,"on_focus",3,()=>{}),_=Z(!1),m=Z("hex"),x=!1,k,j,L=[0,0],i=null,R=!1,q=[0,0],B=0,O=0,v=null,C=!1;function ye(t){v=t.currentTarget.getBoundingClientRect(),C=!0,A(t.clientX)}function A(t){if(!v)return;const s=Math.max(0,Math.min(t-v.left,v.width));O=s;const l=s/v.width*360;B=l,r(me({h:l,s:q[0],v:q[1],a:1})),e()()}function F(t,s){if(!i)return;const l=Math.max(0,Math.min(t-i.left,i.width)),M=Math.max(0,Math.min(s-i.top,i.height));L=[l,M];const S={h:B*1,s:l/i.width,v:1-M/i.height,a:1};q=[S.s,S.v],r(me(S)),e()()}function we(t){R=!0,i=t.currentTarget.getBoundingClientRect(),F(t.clientX,t.clientY)}function xe(t){R&&F(t.clientX,t.clientY),C&&A(t.clientX)}function ke(){const t=R||C;R=!1,C=!1,t&&g()()}async function J(t){if(R||C||(await Ne(),!t)||(!i&&k&&(i=k.getBoundingClientRect()),!v&&j&&(v=j.getBoundingClientRect()),!i||!v))return;const s=E(t).toHsv(),l=s.s*i.width,M=(1-s.v)*i.height;L=[l,M],q=[s.s,s.v],B=s.h,O=s.h/360*v.width}function je(){new EyeDropper().open().then(s=>{r(s.sRGBHex)}),e()()}const Be=[["Hex","hex"],["RGB","rgb"],["HSL","hsl"]];let K=I(()=>at(r(),c(m)));ze(async()=>{x=window!==void 0&&!!window.EyeDropper});function Me(){$(_,!1)}fe(()=>{J(r())});var W=nt();Y("mousemove",ve,xe),Y("mouseup",ve,ke);var ee=be(W);Je(ee,{get show_label(){return a.show_label},get info(){return a.info},children:(t,s)=>{Qe();var l=Ie();z(()=>he(l,a.label)),P(t,l)},$$slots:{default:!0}});var y=b(ee,2);y.__click=()=>{J(r()),$(_,!c(_))};let te;var Se=b(y,2);{var He=t=>{var s=st(),l=f(s);l.__mousedown=we;var M=f(l);let S;h(l),_e(l,n=>k=n,()=>k);var p=b(l,2);T(p,"aria-valuemin",0),T(p,"aria-valuemax",360),p.__mousedown=ye;var Ee=f(p);let ae;h(p),_e(p,n=>j=n,()=>j);var re=b(p,2),se=f(re);let ne;var oe=b(se,2),Q=f(oe),X=f(Q);Te(X),X.__change=n=>{r(tt(n.currentTarget.value))},X.__keydown=n=>{n.key==="Enter"&&u()()};var U=b(X,2);U.__click=je;var Re=f(U);{var Ce=n=>{Fe(n)};ce(Re,n=>{x&&n(Ce)})}h(U),h(Q);var le=b(Q,2);De(le,21,()=>Be,$e,(n,V,it,ut)=>{var ie=I(()=>Ue(c(V),2));let Xe=()=>c(ie)[0],ue=()=>c(ie)[1];var G=rt();let de;G.__click=()=>{$(m,ue(),!0)};var Ge=f(G,!0);h(G),z(()=>{de=Pe(G,1,"button svelte-m0j78y",null,de,{active:c(m)===ue()}),he(Ge,Xe())}),P(n,G)}),h(le),h(oe),h(re),h(s),Ze(s,(n,V)=>et?.(n,V),()=>Me),z(n=>{T(l,"aria-valuetext",r()),D(l,`--hue:${B??""}`),S=D(M,"",S,{transform:`translate(${L[0]??""}px,${L[1]??""}px)`,background:r()}),T(p,"aria-valuenow",n),ae=D(Ee,"",ae,{background:"hsl("+B+", 100%, 50%)",transform:`translateX(${O??""}px)`}),ne=D(se,"",ne,{background:r()})},[()=>Math.round(B)]),Ae(X,()=>c(K),n=>$(K,n)),P(t,s)};ce(Se,t=>{c(_)&&t(He)})}z(()=>{T(y,"aria-label",a.label),y.disabled=a.disabled,te=D(y,"",te,{background:r()})}),Y("focus",y,function(...t){w()?.apply(this,t)}),Y("blur",y,function(...t){d()?.apply(this,t)}),P(o,W),ge()}Oe(["click","mousedown","change","keydown"]);var lt=N(" ",1);function Bt(o,a){pe(a,!0);let r=Ye(a,["$$slots","$$events","$$legacy"]);const e=new Le(r,{value:"#000000"});let g=Z(Ve(e.props.value)),u=I(()=>e.shared.label||e.i18n("color_picker.color_picker"));fe(()=>{c(g)!==e.props.value&&($(g,e.props.value,!0),e.dispatch("change",e.props.value))}),Ke(o,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(d,w)=>{var _=lt(),m=be(_);We(m,qe({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var x=b(m,2);{let k=I(()=>!e.shared.interactive);ot(x,{get label(){return c(u)},get info(){return e.props.info},get show_label(){return e.shared.show_label},get disabled(){return c(k)},on_input:()=>e.dispatch("input"),on_release:()=>e.dispatch("release",e.props.value),on_submit:()=>e.dispatch("submit"),on_blur:()=>e.dispatch("blur"),on_focus:()=>e.dispatch("focus"),get value(){return e.props.value},set value(j){e.props.value=j}})}P(d,_)},$$slots:{default:!0}}),ge()}export{ot as BaseColorPicker,Ht as BaseExample,Bt as default}; +import{p as H,i as ce,a as T,f as D,d as _e,v as Te,q as De,b as Pe,w as $e,G as Le,g as qe,r as Ye}from"./i18n-DtG3MAQ1.js";import{M as pe,a7 as ze,ac as fe,U as Y,N as be,a4 as Ie,t as z,a as P,$,Z as c,O as ge,aa as Z,G as Ne,au as ve,S as b,R as N,ah as Oe,X as he,a5 as Qe,Q as f,T as h,a2 as I,ar as Ue,ab as Ve}from"./index-BeNBoC9J.js";import{a as Ze}from"./actions-BbCJS635.js";import{b as Ae}from"./input-BLFxNjIx.js";import{t as E,E as Fe}from"./tinycolor-DFnlDftg.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as Je}from"./BlockTitle-B6Pgijwb.js";import{B as Ke}from"./Block-DkzyQHli.js";import{S as We}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as Ht}from"./Example-CJXDEOIL.js";import"./snippet-BRIBYCwB.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";function et(o,a){const r=e=>{o&&!o.contains(e.target)&&!e.defaultPrevented&&a(e)};return document.addEventListener("mousedown",r,!0),{destroy(){document.removeEventListener("mousedown",r,!0)}}}function me(o){const a=o.s,r=o.v;let e=a*r;const g=o.h/60;let u=e*(1-Math.abs(g%2-1));const d=r-e;e=e+d,u=u+d;const w=Math.floor(g)%6,_=[e,u,d,d,u,e][w],m=[u,e,e,u,d,d][w],x=[d,d,u,e,e,u][w];return E({r:_*255,g:m*255,b:x*255,a:o.a}).toHexString()}function tt(o){const a=E(o);return a.isValid()?a.toHexString():o}function at(o,a){return a==="hex"?E(o).toHexString():a==="rgb"?E(o).toRgbString():E(o).toHslString()}var rt=N(""),st=N('
            '),nt=N(' ',1);function ot(o,a){pe(a,!0);let r=H(a,"value",15),e=H(a,"on_input",3,()=>{}),g=H(a,"on_release",3,()=>{}),u=H(a,"on_submit",3,()=>{}),d=H(a,"on_blur",3,()=>{}),w=H(a,"on_focus",3,()=>{}),_=Z(!1),m=Z("hex"),x=!1,k,j,L=[0,0],i=null,R=!1,q=[0,0],B=0,O=0,v=null,C=!1;function ye(t){v=t.currentTarget.getBoundingClientRect(),C=!0,A(t.clientX)}function A(t){if(!v)return;const s=Math.max(0,Math.min(t-v.left,v.width));O=s;const l=s/v.width*360;B=l,r(me({h:l,s:q[0],v:q[1],a:1})),e()()}function F(t,s){if(!i)return;const l=Math.max(0,Math.min(t-i.left,i.width)),M=Math.max(0,Math.min(s-i.top,i.height));L=[l,M];const S={h:B*1,s:l/i.width,v:1-M/i.height,a:1};q=[S.s,S.v],r(me(S)),e()()}function we(t){R=!0,i=t.currentTarget.getBoundingClientRect(),F(t.clientX,t.clientY)}function xe(t){R&&F(t.clientX,t.clientY),C&&A(t.clientX)}function ke(){const t=R||C;R=!1,C=!1,t&&g()()}async function J(t){if(R||C||(await Ne(),!t)||(!i&&k&&(i=k.getBoundingClientRect()),!v&&j&&(v=j.getBoundingClientRect()),!i||!v))return;const s=E(t).toHsv(),l=s.s*i.width,M=(1-s.v)*i.height;L=[l,M],q=[s.s,s.v],B=s.h,O=s.h/360*v.width}function je(){new EyeDropper().open().then(s=>{r(s.sRGBHex)}),e()()}const Be=[["Hex","hex"],["RGB","rgb"],["HSL","hsl"]];let K=I(()=>at(r(),c(m)));ze(async()=>{x=window!==void 0&&!!window.EyeDropper});function Me(){$(_,!1)}fe(()=>{J(r())});var W=nt();Y("mousemove",ve,xe),Y("mouseup",ve,ke);var ee=be(W);Je(ee,{get show_label(){return a.show_label},get info(){return a.info},children:(t,s)=>{Qe();var l=Ie();z(()=>he(l,a.label)),P(t,l)},$$slots:{default:!0}});var y=b(ee,2);y.__click=()=>{J(r()),$(_,!c(_))};let te;var Se=b(y,2);{var He=t=>{var s=st(),l=f(s);l.__mousedown=we;var M=f(l);let S;h(l),_e(l,n=>k=n,()=>k);var p=b(l,2);T(p,"aria-valuemin",0),T(p,"aria-valuemax",360),p.__mousedown=ye;var Ee=f(p);let ae;h(p),_e(p,n=>j=n,()=>j);var re=b(p,2),se=f(re);let ne;var oe=b(se,2),Q=f(oe),X=f(Q);Te(X),X.__change=n=>{r(tt(n.currentTarget.value))},X.__keydown=n=>{n.key==="Enter"&&u()()};var U=b(X,2);U.__click=je;var Re=f(U);{var Ce=n=>{Fe(n)};ce(Re,n=>{x&&n(Ce)})}h(U),h(Q);var le=b(Q,2);De(le,21,()=>Be,$e,(n,V,it,ut)=>{var ie=I(()=>Ue(c(V),2));let Xe=()=>c(ie)[0],ue=()=>c(ie)[1];var G=rt();let de;G.__click=()=>{$(m,ue(),!0)};var Ge=f(G,!0);h(G),z(()=>{de=Pe(G,1,"button svelte-m0j78y",null,de,{active:c(m)===ue()}),he(Ge,Xe())}),P(n,G)}),h(le),h(oe),h(re),h(s),Ze(s,(n,V)=>et?.(n,V),()=>Me),z(n=>{T(l,"aria-valuetext",r()),D(l,`--hue:${B??""}`),S=D(M,"",S,{transform:`translate(${L[0]??""}px,${L[1]??""}px)`,background:r()}),T(p,"aria-valuenow",n),ae=D(Ee,"",ae,{background:"hsl("+B+", 100%, 50%)",transform:`translateX(${O??""}px)`}),ne=D(se,"",ne,{background:r()})},[()=>Math.round(B)]),Ae(X,()=>c(K),n=>$(K,n)),P(t,s)};ce(Se,t=>{c(_)&&t(He)})}z(()=>{T(y,"aria-label",a.label),y.disabled=a.disabled,te=D(y,"",te,{background:r()})}),Y("focus",y,function(...t){w()?.apply(this,t)}),Y("blur",y,function(...t){d()?.apply(this,t)}),P(o,W),ge()}Oe(["click","mousedown","change","keydown"]);var lt=N(" ",1);function Bt(o,a){pe(a,!0);let r=Ye(a,["$$slots","$$events","$$legacy"]);const e=new Le(r,{value:"#000000"});let g=Z(Ve(e.props.value)),u=I(()=>e.shared.label||e.i18n("color_picker.color_picker"));fe(()=>{c(g)!==e.props.value&&($(g,e.props.value,!0),e.dispatch("change",e.props.value))}),Ke(o,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(d,w)=>{var _=lt(),m=be(_);We(m,qe({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var x=b(m,2);{let k=I(()=>!e.shared.interactive);ot(x,{get label(){return c(u)},get info(){return e.props.info},get show_label(){return e.shared.show_label},get disabled(){return c(k)},on_input:()=>e.dispatch("input"),on_release:()=>e.dispatch("release",e.props.value),on_submit:()=>e.dispatch("submit"),on_blur:()=>e.dispatch("blur"),on_focus:()=>e.dispatch("focus"),get value(){return e.props.value},set value(j){e.props.value=j}})}P(d,_)},$$slots:{default:!0}}),ge()}export{ot as BaseColorPicker,Ht as BaseExample,Bt as default}; diff --git a/assets/Index-C_R__XCO.js b/assets/Index-DOjHmyHp.js similarity index 69% rename from assets/Index-C_R__XCO.js rename to assets/Index-DOjHmyHp.js index b9d81461446ac1de431adb3cb1794f5f1c3a6728..f4459271147678841305271d7453c50da569266a 100644 --- a/assets/Index-C_R__XCO.js +++ b/assets/Index-DOjHmyHp.js @@ -1 +1 @@ -import{G as s,r as i}from"./i18n-CPHyzK9b.js";import{M as o,ac as n,ae as c,O as l}from"./index-DydPgVMC.js";function d(p,a){o(a,!0);const r=i(a,["$$slots","$$events","$$legacy"]),t=new s(r);t.watch_for_change();let e;n(()=>{e&&clearInterval(e),t.props.active&&(e=setInterval(()=>{document.visibilityState==="visible"&&t.dispatch("tick")},t.props.value*1e3))}),c(()=>{e&&clearInterval(e)}),l()}export{d as default}; +import{G as s,r as i}from"./i18n-DtG3MAQ1.js";import{M as o,ac as n,ae as c,O as l}from"./index-BeNBoC9J.js";function d(p,a){o(a,!0);const r=i(a,["$$slots","$$events","$$legacy"]),t=new s(r);t.watch_for_change();let e;n(()=>{e&&clearInterval(e),t.props.active&&(e=setInterval(()=>{document.visibilityState==="visible"&&t.dispatch("tick")},t.props.value*1e3))}),c(()=>{e&&clearInterval(e)}),l()}export{d as default}; diff --git a/assets/Index-CqEPR_xM.js b/assets/Index-DbZ0NDTE.js similarity index 82% rename from assets/Index-CqEPR_xM.js rename to assets/Index-DbZ0NDTE.js index febe421e4e5c936ad0445731bc98734c098de3fb..675549818d770f6c7b8b367be74ae002aeb5de46 100644 --- a/assets/Index-CqEPR_xM.js +++ b/assets/Index-DbZ0NDTE.js @@ -1 +1 @@ -import{g as ee,i as $,G as te,r as re,d as ae,j as se,b as oe}from"./i18n-CPHyzK9b.js";import{M as le,aa as U,ab as ie,N as W,a as C,$ as d,Z as s,O as ne,G as R,a2 as g,S as P,R as M,t as pe,Q as ue,T as ce,a3 as de}from"./index-DydPgVMC.js";import{b as f}from"./misc-Dkc5KZ-v.js";import{B as me}from"./Block-WPcVj6Bq.js";import{S as he}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{U as _e}from"./UploadText-CYQRFBCv.js";import{G as ge,h as E}from"./Gallery-CRb8iS3j.js";import{S as fe}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{a as ve}from"./FileUpload-CCPLw8R5.js";/* empty css *//* empty css *//* empty css */import{W as L}from"./Webcam-B-wg5Ly_.js";import"./Upload-Bq9KuxCu.js";/* empty css *//* empty css */import{default as gt}from"./Example-aWuNv4qC.js";import"./snippet-BtHMuX3s.js";import"./window-D5YXrKnH.js";import"./event-modifiers-CdEA5IGF.js";import"./BlockLabel-BzVeVrtL.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Clear-BR8cTgGu.js";import"./Download-DWSaBiea.js";import"./Image-DBmW1mOo.js";import"./Play-CRvn2HoA.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./FullscreenButton-BuyUU5Yj.js";import"./Maximize-DWbY8BRa.js";import"./ModifyUpload-BL388q45.js";import"./DownloadLink-DM2QmhDx.js";import"./Edit-G5CCT_vc.js";import"./Undo-B9SlrYtT.js";import"./Image-CZ1Hb99p.js";import"./Video-BOdhnjQz.js";import"./actions-4RaHFoGI.js";import"./universal-C9tCO36V.js";import"./index-tFQomdd2.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./File-_VpQFuKr.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";var we=M("
            ",1),be=M(" ",1);function mt(O,m){le(m,!0);let y=U(void 0);class Q extends te{async get_data(){return s(y)&&(await s(y),await R()),await super.get_data()}}const Z=re(m,["$$slots","$$events","$$legacy"]),e=new Q(Z,{selected_index:null,file_types:["image","video"]});let x=U(!1);function q(l){if(!e.props.value)return;const{index:n}=l;e.dispatch("delete",l),e.props.value=e.props.value.filter((o,p)=>p!==n),e.dispatch("change",e.props.value)}async function v(l){return(await Promise.all(l.map(async o=>{if(o.path?.toLowerCase().endsWith(".svg")&&o.url){const u=await(await fetch(o.url)).text();return{...o,url:`data:image/svg+xml,${encodeURIComponent(u)}`}}return o}))).map(o=>o.mime_type?.includes("video")?{video:o,caption:null}:{image:o,caption:null})}let T,i=U(ie(e.props.sources?e.props.sources[0]:"upload")),F=g(()=>e.props.value===null?!0:e.props.value.length===0),G=g(()=>e.props.file_types?.includes("video")&&e.props.sources.includes("webcam")?e.props.sources.concat(["webcam-video"]):e.props.sources);async function I(){navigator.clipboard.read().then(async l=>{let n=null;for(let o=0;o(e.props.file_types||["image"]).some(S=>u.startsWith(S+"/")));if(p){const u=await l[o].getType(p);n=new File([u],`clipboard.${p.replace("image/","")}`);break}}if(n){const o=await E(n,u=>e.shared.client.upload(u,e.shared.root),"clipboard_upload"),p=await v(o);e.props.value?.push(...p),e.dispatch("change",e.props.value),d(i,null)}else e.dispatch("warning","No image or video found in clipboard")})}async function D(l){l==="clipboard"&&await I()}async function H(l){await R(),l==="clipboard"?await I():(d(i,l,!0),d(F,!0))}{let l=g(()=>e.props.height||void 0);me(O,{get visible(){return e.shared.visible},variant:"solid",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,get height(){return s(l)},get fullscreen(){return s(x)},set fullscreen(n){d(x,n,!0)},children:(n,o)=>{var p=be(),u=W(p);fe(u,ee({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var S=P(u,2);{var J=h=>{var k=we(),_=W(k),z=ue(_);ae(ve(z,{value:null,get root(){return e.shared.root},get label(){return e.shared.label},get max_file_size(){return e.shared.max_file_size},file_count:"multiple",get file_types(){return e.props.file_types},get i18n(){return e.i18n},upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),onupload:async r=>{const a=Array.isArray(r)?r:[r];e.props.value=await v(a),d(i,null),e.dispatch("upload",e.props.value),e.dispatch("change",e.props.value)},onerror:r=>{e.shared.loading_status=e.shared.loading_status||{},e.shared.loading_status.status="error",e.dispatch("error",r)},get upload_promise(){return s(y)},set upload_promise(r){d(y,r,!0)},children:(r,a)=>{_e(r,{get i18n(){return e.i18n},type:"gallery"})},$$slots:{default:!0}}),r=>T=r,()=>T),ce(_);var t=P(_,2);{var B=r=>{L(r,{get root(){return e.shared.root},value:null,mirror_webcam:!0,streaming:!1,mode:"image",include_audio:!1,get i18n(){return e.i18n},upload:(...a)=>e.shared.client.upload(...a),$$events:{capture:async a=>{if(!(a.detail instanceof Blob))return;const j=await E(a.detail,b=>e.shared.client.upload(b,e.shared.root),"webcam_upload"),A=await v(j);e.props.value?.push(...A),d(i,null),e.dispatch("change",e.props.value)},error(a){f.call(this,m,a)},drag(a){f.call(this,m,a)},close_stream(a){f.call(this,m,a)}}})},w=r=>{var a=de(),j=W(a);{var A=b=>{L(b,{get root(){return e.shared.root},value:null,mirror_webcam:!0,streaming:!1,mode:"video",include_audio:!1,get i18n(){return e.i18n},upload:(...c)=>e.shared.client.upload(...c),$$events:{capture:async c=>{if(!c.detail)return;const N={...c.detail};N.mime_type="video/webm";const Y=await v([N]);e.props.value?.push(...Y),d(i,null),e.dispatch("change",e.props.value)},error(c){f.call(this,m,c)},drag(c){f.call(this,m,c)},close_stream(c){f.call(this,m,c)}}})};$(j,b=>{s(i)==="webcam-video"&&b(A)},!0)}C(r,a)};$(t,r=>{s(i)==="webcam"?r(B):r(w,!1)})}var V=P(t,2);{var X=r=>{he(r,{get sources(){return s(G)},handle_clear:()=>e.dispatch("clear"),handle_select:a=>D(a),get active_source(){return s(i)},set active_source(a){d(i,a,!0)}})};$(V,r=>{(s(G).length>1||s(G).includes("clipboard"))&&r(X)})}pe(r=>oe(_,1,r,"svelte-jtg6zo"),[()=>se(!e.props.value||s(i)&&s(i).includes("webcam")?"hidden-upload-input":"upload-wrapper")]),C(h,k)},K=h=>{{let k=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="share")),_=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="download")),z=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="fullscreen"));ge(h,{onchange:()=>e.dispatch("change"),onclear:()=>e.dispatch("change"),onselect:t=>e.dispatch("select",t),onshare:t=>e.dispatch("share",t.detail),onerror:t=>e.dispatch("error",t.detail),onpreview_open:()=>{e.dispatch("preview_open")},onpreview_close:()=>e.dispatch("preview_close"),onfullscreen:({detail:t})=>{d(x,t,!0)},ondelete:q,onupload:async t=>{const B=Array.isArray(t)?t:[t],w=await v(B);e.props.value=e.props.value?[...e.props.value,...w]:w,e.dispatch("upload",w),e.dispatch("change",e.props.value)},get sources(){return s(G)},onsource_change:t=>H(t),get label(){return e.shared.label},get show_label(){return e.shared.show_label},get columns(){return e.props.columns},get rows(){return e.props.rows},get height(){return e.props.height},get preview(){return e.props.preview},get object_fit(){return e.props.object_fit},get interactive(){return e.shared.interactive},get allow_preview(){return e.props.allow_preview},get show_share_button(){return s(k)},get show_download_button(){return s(_)},get fit_columns(){return e.props.fit_columns},get i18n(){return e.i18n},_fetch:(...t)=>e.shared.client.fetch(...t),get show_fullscreen_button(){return s(z)},get buttons(){return e.props.buttons},oncustom_button_click:t=>{e.dispatch("custom_button_click",{id:t})},get fullscreen(){return s(x)},get root(){return e.shared.root},get file_types(){return e.props.file_types},get max_file_size(){return e.shared.max_file_size},upload:(...t)=>e.shared.client.upload(...t),stream_handler:(...t)=>e.shared.client.stream(...t),get selected_index(){return e.props.selected_index},set selected_index(t){e.props.selected_index=t},get value(){return e.props.value},set value(t){e.props.value=t}})}};$(S,h=>{e.shared.interactive&&s(F)?h(J):h(K,!1)})}C(n,p)},$$slots:{default:!0}})}ne()}export{gt as BaseExample,ge as BaseGallery,mt as default}; +import{g as ee,i as $,G as te,r as re,d as ae,j as se,b as oe}from"./i18n-DtG3MAQ1.js";import{M as le,aa as U,ab as ie,N as W,a as C,$ as d,Z as s,O as ne,G as R,a2 as g,S as P,R as M,t as pe,Q as ue,T as ce,a3 as de}from"./index-BeNBoC9J.js";import{b as f}from"./misc-D-Y84gKJ.js";import{B as me}from"./Block-DkzyQHli.js";import{S as he}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{U as _e}from"./UploadText-yqnlGa4o.js";import{G as ge,h as E}from"./Gallery-CclVtwgM.js";import{S as fe}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{a as ve}from"./FileUpload-h25zNPg5.js";/* empty css *//* empty css *//* empty css */import{W as L}from"./Webcam-rfzmXTkZ.js";import"./Upload-CGTpHDBO.js";/* empty css *//* empty css */import{default as gt}from"./Example-DoP5np0T.js";import"./snippet-BRIBYCwB.js";import"./window-ChwzOWAi.js";import"./event-modifiers-CdEA5IGF.js";import"./BlockLabel-CEOjqpu7.js";import"./Empty-Clj0ErcW.js";import"./ShareButton-ImGYvlzQ.js";import"./Clear-BiKSVifk.js";import"./Download-0gCL6VXM.js";import"./Image-DWBzZYev.js";import"./Play-DIYf8dw5.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./FullscreenButton-CFl3IB4T.js";import"./Maximize-DQMU3SdR.js";import"./ModifyUpload-DbCqTfQf.js";import"./DownloadLink-Dk6GrGSA.js";import"./Edit-DfYRtNtw.js";import"./Undo-Bu_OzfgD.js";import"./Image-ALBOEs1f.js";import"./Video-BXpoIN7o.js";import"./actions-BbCJS635.js";import"./universal-DqSjxxHG.js";import"./index-tFQomdd2.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./File-CD333vfS.js";import"./DropdownArrow-C0w6FgSo.js";import"./Square-CSlbzSkn.js";import"./Spinner-Hiq4LkuG.js";import"./StreamingBar-BFOdhKj-.js";var we=M("
            ",1),be=M(" ",1);function mt(O,m){le(m,!0);let y=U(void 0);class Q extends te{async get_data(){return s(y)&&(await s(y),await R()),await super.get_data()}}const Z=re(m,["$$slots","$$events","$$legacy"]),e=new Q(Z,{selected_index:null,file_types:["image","video"]});let x=U(!1);function q(l){if(!e.props.value)return;const{index:n}=l;e.dispatch("delete",l),e.props.value=e.props.value.filter((o,p)=>p!==n),e.dispatch("change",e.props.value)}async function v(l){return(await Promise.all(l.map(async o=>{if(o.path?.toLowerCase().endsWith(".svg")&&o.url){const u=await(await fetch(o.url)).text();return{...o,url:`data:image/svg+xml,${encodeURIComponent(u)}`}}return o}))).map(o=>o.mime_type?.includes("video")?{video:o,caption:null}:{image:o,caption:null})}let T,i=U(ie(e.props.sources?e.props.sources[0]:"upload")),F=g(()=>e.props.value===null?!0:e.props.value.length===0),G=g(()=>e.props.file_types?.includes("video")&&e.props.sources.includes("webcam")?e.props.sources.concat(["webcam-video"]):e.props.sources);async function I(){navigator.clipboard.read().then(async l=>{let n=null;for(let o=0;o(e.props.file_types||["image"]).some(S=>u.startsWith(S+"/")));if(p){const u=await l[o].getType(p);n=new File([u],`clipboard.${p.replace("image/","")}`);break}}if(n){const o=await E(n,u=>e.shared.client.upload(u,e.shared.root),"clipboard_upload"),p=await v(o);e.props.value?.push(...p),e.dispatch("change",e.props.value),d(i,null)}else e.dispatch("warning","No image or video found in clipboard")})}async function D(l){l==="clipboard"&&await I()}async function H(l){await R(),l==="clipboard"?await I():(d(i,l,!0),d(F,!0))}{let l=g(()=>e.props.height||void 0);me(O,{get visible(){return e.shared.visible},variant:"solid",padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,get height(){return s(l)},get fullscreen(){return s(x)},set fullscreen(n){d(x,n,!0)},children:(n,o)=>{var p=be(),u=W(p);fe(u,ee({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var S=P(u,2);{var J=h=>{var k=we(),_=W(k),z=ue(_);ae(ve(z,{value:null,get root(){return e.shared.root},get label(){return e.shared.label},get max_file_size(){return e.shared.max_file_size},file_count:"multiple",get file_types(){return e.props.file_types},get i18n(){return e.i18n},upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),onupload:async r=>{const a=Array.isArray(r)?r:[r];e.props.value=await v(a),d(i,null),e.dispatch("upload",e.props.value),e.dispatch("change",e.props.value)},onerror:r=>{e.shared.loading_status=e.shared.loading_status||{},e.shared.loading_status.status="error",e.dispatch("error",r)},get upload_promise(){return s(y)},set upload_promise(r){d(y,r,!0)},children:(r,a)=>{_e(r,{get i18n(){return e.i18n},type:"gallery"})},$$slots:{default:!0}}),r=>T=r,()=>T),ce(_);var t=P(_,2);{var B=r=>{L(r,{get root(){return e.shared.root},value:null,mirror_webcam:!0,streaming:!1,mode:"image",include_audio:!1,get i18n(){return e.i18n},upload:(...a)=>e.shared.client.upload(...a),$$events:{capture:async a=>{if(!(a.detail instanceof Blob))return;const j=await E(a.detail,b=>e.shared.client.upload(b,e.shared.root),"webcam_upload"),A=await v(j);e.props.value?.push(...A),d(i,null),e.dispatch("change",e.props.value)},error(a){f.call(this,m,a)},drag(a){f.call(this,m,a)},close_stream(a){f.call(this,m,a)}}})},w=r=>{var a=de(),j=W(a);{var A=b=>{L(b,{get root(){return e.shared.root},value:null,mirror_webcam:!0,streaming:!1,mode:"video",include_audio:!1,get i18n(){return e.i18n},upload:(...c)=>e.shared.client.upload(...c),$$events:{capture:async c=>{if(!c.detail)return;const N={...c.detail};N.mime_type="video/webm";const Y=await v([N]);e.props.value?.push(...Y),d(i,null),e.dispatch("change",e.props.value)},error(c){f.call(this,m,c)},drag(c){f.call(this,m,c)},close_stream(c){f.call(this,m,c)}}})};$(j,b=>{s(i)==="webcam-video"&&b(A)},!0)}C(r,a)};$(t,r=>{s(i)==="webcam"?r(B):r(w,!1)})}var V=P(t,2);{var X=r=>{he(r,{get sources(){return s(G)},handle_clear:()=>e.dispatch("clear"),handle_select:a=>D(a),get active_source(){return s(i)},set active_source(a){d(i,a,!0)}})};$(V,r=>{(s(G).length>1||s(G).includes("clipboard"))&&r(X)})}pe(r=>oe(_,1,r,"svelte-jtg6zo"),[()=>se(!e.props.value||s(i)&&s(i).includes("webcam")?"hidden-upload-input":"upload-wrapper")]),C(h,k)},K=h=>{{let k=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="share")),_=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="download")),z=g(()=>e.props.buttons.some(t=>typeof t=="string"&&t==="fullscreen"));ge(h,{onchange:()=>e.dispatch("change"),onclear:()=>e.dispatch("change"),onselect:t=>e.dispatch("select",t),onshare:t=>e.dispatch("share",t.detail),onerror:t=>e.dispatch("error",t.detail),onpreview_open:()=>{e.dispatch("preview_open")},onpreview_close:()=>e.dispatch("preview_close"),onfullscreen:({detail:t})=>{d(x,t,!0)},ondelete:q,onupload:async t=>{const B=Array.isArray(t)?t:[t],w=await v(B);e.props.value=e.props.value?[...e.props.value,...w]:w,e.dispatch("upload",w),e.dispatch("change",e.props.value)},get sources(){return s(G)},onsource_change:t=>H(t),get label(){return e.shared.label},get show_label(){return e.shared.show_label},get columns(){return e.props.columns},get rows(){return e.props.rows},get height(){return e.props.height},get preview(){return e.props.preview},get object_fit(){return e.props.object_fit},get interactive(){return e.shared.interactive},get allow_preview(){return e.props.allow_preview},get show_share_button(){return s(k)},get show_download_button(){return s(_)},get fit_columns(){return e.props.fit_columns},get i18n(){return e.i18n},_fetch:(...t)=>e.shared.client.fetch(...t),get show_fullscreen_button(){return s(z)},get buttons(){return e.props.buttons},oncustom_button_click:t=>{e.dispatch("custom_button_click",{id:t})},get fullscreen(){return s(x)},get root(){return e.shared.root},get file_types(){return e.props.file_types},get max_file_size(){return e.shared.max_file_size},upload:(...t)=>e.shared.client.upload(...t),stream_handler:(...t)=>e.shared.client.stream(...t),get selected_index(){return e.props.selected_index},set selected_index(t){e.props.selected_index=t},get value(){return e.props.value},set value(t){e.props.value=t}})}};$(S,h=>{e.shared.interactive&&s(F)?h(J):h(K,!1)})}C(n,p)},$$slots:{default:!0}})}ne()}export{gt as BaseExample,ge as BaseGallery,mt as default}; diff --git a/assets/Index-Pd9Hkw9h.js b/assets/Index-DfQACTRI.js similarity index 99% rename from assets/Index-Pd9Hkw9h.js rename to assets/Index-DfQACTRI.js index 0b8977e3c206e534cfdc98ddee2e993f69660670..78343d8dce4a47f2b1ca5a183d308a8d5576ebd9 100644 --- a/assets/Index-Pd9Hkw9h.js +++ b/assets/Index-DfQACTRI.js @@ -1 +1 @@ -import{a0 as Bx,R as er,L as hx,G as lx,r as Cx}from"./i18n-CPHyzK9b.js";import{M as px,ac as Ex,a7 as Ax,O as Fx}from"./index-DydPgVMC.js";import{_ as Dx}from"./__vite-browser-external-D7Ct-6yo.js";var C0={exports:{}};function _x(R){throw new Error('Could not dynamically require "'+R+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var p0={exports:{}};const bx=Bx(Dx);var gx=p0.exports,Cr;function L(){return Cr||(Cr=1,(function(R,$){(function(h,x){R.exports=x()})(gx,function(){var h=h||(function(x,D){var E;if(typeof window<"u"&&window.crypto&&(E=window.crypto),typeof self<"u"&&self.crypto&&(E=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(E=globalThis.crypto),!E&&typeof window<"u"&&window.msCrypto&&(E=window.msCrypto),!E&&typeof er<"u"&&er.crypto&&(E=er.crypto),!E&&typeof _x=="function")try{E=bx}catch{}var g=function(){if(E){if(typeof E.getRandomValues=="function")try{return E.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof E.randomBytes=="function")try{return E.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},v=Object.create||(function(){function a(){}return function(n){var i;return a.prototype=n,i=new a,a.prototype=null,i}})(),d={},r=d.lib={},t=r.Base=(function(){return{extend:function(a){var n=v(this);return a&&n.mixIn(a),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var n in a)a.hasOwnProperty(n)&&(this[n]=a[n]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),B=r.WordArray=t.extend({init:function(a,n){a=this.words=a||[],n!=D?this.sigBytes=n:this.sigBytes=a.length*4},toString:function(a){return(a||f).stringify(this)},concat:function(a){var n=this.words,i=a.words,p=this.sigBytes,C=a.sigBytes;if(this.clamp(),p%4)for(var A=0;A>>2]>>>24-A%4*8&255;n[p+A>>>2]|=_<<24-(p+A)%4*8}else for(var S=0;S>>2]=i[S>>>2];return this.sigBytes+=C,this},clamp:function(){var a=this.words,n=this.sigBytes;a[n>>>2]&=4294967295<<32-n%4*8,a.length=x.ceil(n/4)},clone:function(){var a=t.clone.call(this);return a.words=this.words.slice(0),a},random:function(a){for(var n=[],i=0;i>>2]>>>24-C%4*8&255;p.push((A>>>4).toString(16)),p.push((A&15).toString(16))}return p.join("")},parse:function(a){for(var n=a.length,i=[],p=0;p>>3]|=parseInt(a.substr(p,2),16)<<24-p%8*4;return new B.init(i,n/2)}},o=e.Latin1={stringify:function(a){for(var n=a.words,i=a.sigBytes,p=[],C=0;C>>2]>>>24-C%4*8&255;p.push(String.fromCharCode(A))}return p.join("")},parse:function(a){for(var n=a.length,i=[],p=0;p>>2]|=(a.charCodeAt(p)&255)<<24-p%4*8;return new B.init(i,n)}},c=e.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},s=r.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new B.init,this._nDataBytes=0},_append:function(a){typeof a=="string"&&(a=c.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(a){var n,i=this._data,p=i.words,C=i.sigBytes,A=this.blockSize,_=A*4,S=C/_;a?S=x.ceil(S):S=x.max((S|0)-this._minBufferSize,0);var u=S*A,F=x.min(u*4,C);if(u){for(var y=0;y>>2]|=d[B]<<24-B%4*8;g.call(this,t,r)}else g.apply(this,arguments)};v.prototype=E}})(),h.lib.WordArray})})(A0)),A0.exports}var F0={exports:{}},wx=F0.exports,Ar;function mx(){return Ar||(Ar=1,(function(R,$){(function(h,x){R.exports=x(L())})(wx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Utf16=g.Utf16BE={stringify:function(d){for(var r=d.words,t=d.sigBytes,B=[],e=0;e>>2]>>>16-e%4*8&65535;B.push(String.fromCharCode(f))}return B.join("")},parse:function(d){for(var r=d.length,t=[],B=0;B>>1]|=d.charCodeAt(B)<<16-B%2*16;return E.create(t,r*2)}},g.Utf16LE={stringify:function(d){for(var r=d.words,t=d.sigBytes,B=[],e=0;e>>2]>>>16-e%4*8&65535);B.push(String.fromCharCode(f))}return B.join("")},parse:function(d){for(var r=d.length,t=[],B=0;B>>1]|=v(d.charCodeAt(B)<<16-B%2*16);return E.create(t,r*2)}};function v(d){return d<<8&4278255360|d>>>8&16711935}})(),h.enc.Utf16})})(F0)),F0.exports}var D0={exports:{}},Sx=D0.exports,Fr;function e0(){return Fr||(Fr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Sx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Base64={stringify:function(d){var r=d.words,t=d.sigBytes,B=this._map;d.clamp();for(var e=[],f=0;f>>2]>>>24-f%4*8&255,c=r[f+1>>>2]>>>24-(f+1)%4*8&255,s=r[f+2>>>2]>>>24-(f+2)%4*8&255,l=o<<16|c<<8|s,a=0;a<4&&f+a*.75>>6*(3-a)&63));var n=B.charAt(64);if(n)for(;e.length%4;)e.push(n);return e.join("")},parse:function(d){var r=d.length,t=this._map,B=this._reverseMap;if(!B){B=this._reverseMap=[];for(var e=0;e>>6-f%4*2,s=o|c;B[e>>>2]|=s<<24-e%4*8,e++}return E.create(B,e)}})(),h.enc.Base64})})(D0)),D0.exports}var _0={exports:{}},Rx=_0.exports,Dr;function zx(){return Dr||(Dr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Rx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Base64url={stringify:function(d,r){r===void 0&&(r=!0);var t=d.words,B=d.sigBytes,e=r?this._safe_map:this._map;d.clamp();for(var f=[],o=0;o>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,l=t[o+2>>>2]>>>24-(o+2)%4*8&255,a=c<<16|s<<8|l,n=0;n<4&&o+n*.75>>6*(3-n)&63));var i=e.charAt(64);if(i)for(;f.length%4;)f.push(i);return f.join("")},parse:function(d,r){r===void 0&&(r=!0);var t=d.length,B=r?this._safe_map:this._map,e=this._reverseMap;if(!e){e=this._reverseMap=[];for(var f=0;f>>6-f%4*2,s=o|c;B[e>>>2]|=s<<24-e%4*8,e++}return E.create(B,e)}})(),h.enc.Base64url})})(_0)),_0.exports}var b0={exports:{}},qx=b0.exports,_r;function t0(){return _r||(_r=1,(function(R,$){(function(h,x){R.exports=x(L())})(qx,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=[];(function(){for(var c=0;c<64;c++)r[c]=x.abs(x.sin(c+1))*4294967296|0})();var t=d.MD5=v.extend({_doReset:function(){this._hash=new g.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(c,s){for(var l=0;l<16;l++){var a=s+l,n=c[a];c[a]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var i=this._hash.words,p=c[s+0],C=c[s+1],A=c[s+2],_=c[s+3],S=c[s+4],u=c[s+5],F=c[s+6],y=c[s+7],k=c[s+8],z=c[s+9],q=c[s+10],P=c[s+11],K=c[s+12],I=c[s+13],N=c[s+14],T=c[s+15],b=i[0],w=i[1],m=i[2],H=i[3];b=B(b,w,m,H,p,7,r[0]),H=B(H,b,w,m,C,12,r[1]),m=B(m,H,b,w,A,17,r[2]),w=B(w,m,H,b,_,22,r[3]),b=B(b,w,m,H,S,7,r[4]),H=B(H,b,w,m,u,12,r[5]),m=B(m,H,b,w,F,17,r[6]),w=B(w,m,H,b,y,22,r[7]),b=B(b,w,m,H,k,7,r[8]),H=B(H,b,w,m,z,12,r[9]),m=B(m,H,b,w,q,17,r[10]),w=B(w,m,H,b,P,22,r[11]),b=B(b,w,m,H,K,7,r[12]),H=B(H,b,w,m,I,12,r[13]),m=B(m,H,b,w,N,17,r[14]),w=B(w,m,H,b,T,22,r[15]),b=e(b,w,m,H,C,5,r[16]),H=e(H,b,w,m,F,9,r[17]),m=e(m,H,b,w,P,14,r[18]),w=e(w,m,H,b,p,20,r[19]),b=e(b,w,m,H,u,5,r[20]),H=e(H,b,w,m,q,9,r[21]),m=e(m,H,b,w,T,14,r[22]),w=e(w,m,H,b,S,20,r[23]),b=e(b,w,m,H,z,5,r[24]),H=e(H,b,w,m,N,9,r[25]),m=e(m,H,b,w,_,14,r[26]),w=e(w,m,H,b,k,20,r[27]),b=e(b,w,m,H,I,5,r[28]),H=e(H,b,w,m,A,9,r[29]),m=e(m,H,b,w,y,14,r[30]),w=e(w,m,H,b,K,20,r[31]),b=f(b,w,m,H,u,4,r[32]),H=f(H,b,w,m,k,11,r[33]),m=f(m,H,b,w,P,16,r[34]),w=f(w,m,H,b,N,23,r[35]),b=f(b,w,m,H,C,4,r[36]),H=f(H,b,w,m,S,11,r[37]),m=f(m,H,b,w,y,16,r[38]),w=f(w,m,H,b,q,23,r[39]),b=f(b,w,m,H,I,4,r[40]),H=f(H,b,w,m,p,11,r[41]),m=f(m,H,b,w,_,16,r[42]),w=f(w,m,H,b,F,23,r[43]),b=f(b,w,m,H,z,4,r[44]),H=f(H,b,w,m,K,11,r[45]),m=f(m,H,b,w,T,16,r[46]),w=f(w,m,H,b,A,23,r[47]),b=o(b,w,m,H,p,6,r[48]),H=o(H,b,w,m,y,10,r[49]),m=o(m,H,b,w,N,15,r[50]),w=o(w,m,H,b,u,21,r[51]),b=o(b,w,m,H,K,6,r[52]),H=o(H,b,w,m,_,10,r[53]),m=o(m,H,b,w,q,15,r[54]),w=o(w,m,H,b,C,21,r[55]),b=o(b,w,m,H,k,6,r[56]),H=o(H,b,w,m,T,10,r[57]),m=o(m,H,b,w,F,15,r[58]),w=o(w,m,H,b,I,21,r[59]),b=o(b,w,m,H,S,6,r[60]),H=o(H,b,w,m,P,10,r[61]),m=o(m,H,b,w,A,15,r[62]),w=o(w,m,H,b,z,21,r[63]),i[0]=i[0]+b|0,i[1]=i[1]+w|0,i[2]=i[2]+m|0,i[3]=i[3]+H|0},_doFinalize:function(){var c=this._data,s=c.words,l=this._nDataBytes*8,a=c.sigBytes*8;s[a>>>5]|=128<<24-a%32;var n=x.floor(l/4294967296),i=l;s[(a+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,s[(a+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,c.sigBytes=(s.length+1)*4,this._process();for(var p=this._hash,C=p.words,A=0;A<4;A++){var _=C[A];C[A]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}return p},clone:function(){var c=v.clone.call(this);return c._hash=this._hash.clone(),c}});function B(c,s,l,a,n,i,p){var C=c+(s&l|~s&a)+n+p;return(C<>>32-i)+s}function e(c,s,l,a,n,i,p){var C=c+(s&a|l&~a)+n+p;return(C<>>32-i)+s}function f(c,s,l,a,n,i,p){var C=c+(s^l^a)+n+p;return(C<>>32-i)+s}function o(c,s,l,a,n,i,p){var C=c+(l^(s|~a))+n+p;return(C<>>32-i)+s}D.MD5=v._createHelper(t),D.HmacMD5=v._createHmacHelper(t)})(Math),h.MD5})})(b0)),b0.exports}var g0={exports:{}},$x=g0.exports,br;function Jr(){return br||(br=1,(function(R,$){(function(h,x){R.exports=x(L())})($x,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=D.Hasher,v=x.algo,d=[],r=v.SHA1=g.extend({_doReset:function(){this._hash=new E.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,B){for(var e=this._hash.words,f=e[0],o=e[1],c=e[2],s=e[3],l=e[4],a=0;a<80;a++){if(a<16)d[a]=t[B+a]|0;else{var n=d[a-3]^d[a-8]^d[a-14]^d[a-16];d[a]=n<<1|n>>>31}var i=(f<<5|f>>>27)+l+d[a];a<20?i+=(o&c|~o&s)+1518500249:a<40?i+=(o^c^s)+1859775393:a<60?i+=(o&c|o&s|c&s)-1894007588:i+=(o^c^s)-899497514,l=s,s=c,c=o<<30|o>>>2,o=f,f=i}e[0]=e[0]+f|0,e[1]=e[1]+o|0,e[2]=e[2]+c|0,e[3]=e[3]+s|0,e[4]=e[4]+l|0},_doFinalize:function(){var t=this._data,B=t.words,e=this._nDataBytes*8,f=t.sigBytes*8;return B[f>>>5]|=128<<24-f%32,B[(f+64>>>9<<4)+14]=Math.floor(e/4294967296),B[(f+64>>>9<<4)+15]=e,t.sigBytes=B.length*4,this._process(),this._hash},clone:function(){var t=g.clone.call(this);return t._hash=this._hash.clone(),t}});x.SHA1=g._createHelper(r),x.HmacSHA1=g._createHmacHelper(r)})(),h.SHA1})})(g0)),g0.exports}var y0={exports:{}},Px=y0.exports,gr;function tr(){return gr||(gr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Px,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=[],t=[];(function(){function f(l){for(var a=x.sqrt(l),n=2;n<=a;n++)if(!(l%n))return!1;return!0}function o(l){return(l-(l|0))*4294967296|0}for(var c=2,s=0;s<64;)f(c)&&(s<8&&(r[s]=o(x.pow(c,1/2))),t[s]=o(x.pow(c,1/3)),s++),c++})();var B=[],e=d.SHA256=v.extend({_doReset:function(){this._hash=new g.init(r.slice(0))},_doProcessBlock:function(f,o){for(var c=this._hash.words,s=c[0],l=c[1],a=c[2],n=c[3],i=c[4],p=c[5],C=c[6],A=c[7],_=0;_<64;_++){if(_<16)B[_]=f[o+_]|0;else{var S=B[_-15],u=(S<<25|S>>>7)^(S<<14|S>>>18)^S>>>3,F=B[_-2],y=(F<<15|F>>>17)^(F<<13|F>>>19)^F>>>10;B[_]=u+B[_-7]+y+B[_-16]}var k=i&p^~i&C,z=s&l^s&a^l&a,q=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),P=(i<<26|i>>>6)^(i<<21|i>>>11)^(i<<7|i>>>25),K=A+P+k+t[_]+B[_],I=q+z;A=C,C=p,p=i,i=n+K|0,n=a,a=l,l=s,s=K+I|0}c[0]=c[0]+s|0,c[1]=c[1]+l|0,c[2]=c[2]+a|0,c[3]=c[3]+n|0,c[4]=c[4]+i|0,c[5]=c[5]+p|0,c[6]=c[6]+C|0,c[7]=c[7]+A|0},_doFinalize:function(){var f=this._data,o=f.words,c=this._nDataBytes*8,s=f.sigBytes*8;return o[s>>>5]|=128<<24-s%32,o[(s+64>>>9<<4)+14]=x.floor(c/4294967296),o[(s+64>>>9<<4)+15]=c,f.sigBytes=o.length*4,this._process(),this._hash},clone:function(){var f=v.clone.call(this);return f._hash=this._hash.clone(),f}});D.SHA256=v._createHelper(e),D.HmacSHA256=v._createHmacHelper(e)})(Math),h.SHA256})})(y0)),y0.exports}var k0={exports:{}},Wx=k0.exports,yr;function Lx(){return yr||(yr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),tr())})(Wx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.algo,v=g.SHA256,d=g.SHA224=v.extend({_doReset:function(){this._hash=new E.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var r=v._doFinalize.call(this);return r.sigBytes-=4,r}});x.SHA224=v._createHelper(d),x.HmacSHA224=v._createHmacHelper(d)})(),h.SHA224})})(k0)),k0.exports}var H0={exports:{}},Ix=H0.exports,kr;function rx(){return kr||(kr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0())})(Ix,function(h){return(function(){var x=h,D=x.lib,E=D.Hasher,g=x.x64,v=g.Word,d=g.WordArray,r=x.algo;function t(){return v.create.apply(v,arguments)}var B=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],e=[];(function(){for(var o=0;o<80;o++)e[o]=t()})();var f=r.SHA512=E.extend({_doReset:function(){this._hash=new d.init([new v.init(1779033703,4089235720),new v.init(3144134277,2227873595),new v.init(1013904242,4271175723),new v.init(2773480762,1595750129),new v.init(1359893119,2917565137),new v.init(2600822924,725511199),new v.init(528734635,4215389547),new v.init(1541459225,327033209)])},_doProcessBlock:function(o,c){for(var s=this._hash.words,l=s[0],a=s[1],n=s[2],i=s[3],p=s[4],C=s[5],A=s[6],_=s[7],S=l.high,u=l.low,F=a.high,y=a.low,k=n.high,z=n.low,q=i.high,P=i.low,K=p.high,I=p.low,N=C.high,T=C.low,b=A.high,w=A.low,m=_.high,H=_.low,X=S,O=u,G=F,W=y,i0=k,a0=z,rr=q,s0=P,j=K,Z=I,B0=N,f0=T,h0=b,c0=w,xr=m,v0=H,V=0;V<80;V++){var Y,J,l0=e[V];if(V<16)J=l0.high=o[c+V*2]|0,Y=l0.low=o[c+V*2+1]|0;else{var nr=e[V-15],n0=nr.high,u0=nr.low,xx=(n0>>>1|u0<<31)^(n0>>>8|u0<<24)^n0>>>7,or=(u0>>>1|n0<<31)^(u0>>>8|n0<<24)^(u0>>>7|n0<<25),ir=e[V-2],o0=ir.high,d0=ir.low,ex=(o0>>>19|d0<<13)^(o0<<3|d0>>>29)^o0>>>6,sr=(d0>>>19|o0<<13)^(d0<<3|o0>>>29)^(d0>>>6|o0<<26),fr=e[V-7],tx=fr.high,ax=fr.low,cr=e[V-16],nx=cr.high,vr=cr.low;Y=or+ax,J=xx+tx+(Y>>>0>>0?1:0),Y=Y+sr,J=J+ex+(Y>>>0>>0?1:0),Y=Y+vr,J=J+nx+(Y>>>0>>0?1:0),l0.high=J,l0.low=Y}var ox=j&B0^~j&h0,ur=Z&f0^~Z&c0,ix=X&G^X&i0^G&i0,sx=O&W^O&a0^W&a0,fx=(X>>>28|O<<4)^(X<<30|O>>>2)^(X<<25|O>>>7),dr=(O>>>28|X<<4)^(O<<30|X>>>2)^(O<<25|X>>>7),cx=(j>>>14|Z<<18)^(j>>>18|Z<<14)^(j<<23|Z>>>9),vx=(Z>>>14|j<<18)^(Z>>>18|j<<14)^(Z<<23|j>>>9),Br=B[V],ux=Br.high,hr=Br.low,Q=v0+vx,r0=xr+cx+(Q>>>0>>0?1:0),Q=Q+ur,r0=r0+ox+(Q>>>0>>0?1:0),Q=Q+hr,r0=r0+ux+(Q>>>0
            >>0?1:0),Q=Q+Y,r0=r0+J+(Q>>>0>>0?1:0),lr=dr+sx,dx=fx+ix+(lr>>>0>>0?1:0);xr=h0,v0=c0,h0=B0,c0=f0,B0=j,f0=Z,Z=s0+Q|0,j=rr+r0+(Z>>>0>>0?1:0)|0,rr=i0,s0=a0,i0=G,a0=W,G=X,W=O,O=Q+lr|0,X=r0+dx+(O>>>0>>0?1:0)|0}u=l.low=u+O,l.high=S+X+(u>>>0>>0?1:0),y=a.low=y+W,a.high=F+G+(y>>>0>>0?1:0),z=n.low=z+a0,n.high=k+i0+(z>>>0>>0?1:0),P=i.low=P+s0,i.high=q+rr+(P>>>0>>0?1:0),I=p.low=I+Z,p.high=K+j+(I>>>0>>0?1:0),T=C.low=T+f0,C.high=N+B0+(T>>>0>>0?1:0),w=A.low=w+c0,A.high=b+h0+(w>>>0>>0?1:0),H=_.low=H+v0,_.high=m+xr+(H>>>0>>0?1:0)},_doFinalize:function(){var o=this._data,c=o.words,s=this._nDataBytes*8,l=o.sigBytes*8;c[l>>>5]|=128<<24-l%32,c[(l+128>>>10<<5)+30]=Math.floor(s/4294967296),c[(l+128>>>10<<5)+31]=s,o.sigBytes=c.length*4,this._process();var a=this._hash.toX32();return a},clone:function(){var o=E.clone.call(this);return o._hash=this._hash.clone(),o},blockSize:1024/32});x.SHA512=E._createHelper(f),x.HmacSHA512=E._createHmacHelper(f)})(),h.SHA512})})(H0)),H0.exports}var w0={exports:{}},Tx=w0.exports,Hr;function Nx(){return Hr||(Hr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0(),rx())})(Tx,function(h){return(function(){var x=h,D=x.x64,E=D.Word,g=D.WordArray,v=x.algo,d=v.SHA512,r=v.SHA384=d.extend({_doReset:function(){this._hash=new g.init([new E.init(3418070365,3238371032),new E.init(1654270250,914150663),new E.init(2438529370,812702999),new E.init(355462360,4144912697),new E.init(1731405415,4290775857),new E.init(2394180231,1750603025),new E.init(3675008525,1694076839),new E.init(1203062813,3204075428)])},_doFinalize:function(){var t=d._doFinalize.call(this);return t.sigBytes-=16,t}});x.SHA384=d._createHelper(r),x.HmacSHA384=d._createHmacHelper(r)})(),h.SHA384})})(w0)),w0.exports}var m0={exports:{}},Ox=m0.exports,wr;function Kx(){return wr||(wr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0())})(Ox,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.x64,r=d.Word,t=D.algo,B=[],e=[],f=[];(function(){for(var s=1,l=0,a=0;a<24;a++){B[s+5*l]=(a+1)*(a+2)/2%64;var n=l%5,i=(2*s+3*l)%5;s=n,l=i}for(var s=0;s<5;s++)for(var l=0;l<5;l++)e[s+5*l]=l+(2*s+3*l)%5*5;for(var p=1,C=0;C<24;C++){for(var A=0,_=0,S=0;S<7;S++){if(p&1){var u=(1<>>24)&16711935|(p<<24|p>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360;var A=a[i];A.high^=C,A.low^=p}for(var _=0;_<24;_++){for(var S=0;S<5;S++){for(var u=0,F=0,y=0;y<5;y++){var A=a[S+5*y];u^=A.high,F^=A.low}var k=o[S];k.high=u,k.low=F}for(var S=0;S<5;S++)for(var z=o[(S+4)%5],q=o[(S+1)%5],P=q.high,K=q.low,u=z.high^(P<<1|K>>>31),F=z.low^(K<<1|P>>>31),y=0;y<5;y++){var A=a[S+5*y];A.high^=u,A.low^=F}for(var I=1;I<25;I++){var u,F,A=a[I],N=A.high,T=A.low,b=B[I];b<32?(u=N<>>32-b,F=T<>>32-b):(u=T<>>64-b,F=N<>>64-b);var w=o[e[I]];w.high=u,w.low=F}var m=o[0],H=a[0];m.high=H.high,m.low=H.low;for(var S=0;S<5;S++)for(var y=0;y<5;y++){var I=S+5*y,A=a[I],X=o[I],O=o[(S+1)%5+5*y],G=o[(S+2)%5+5*y];A.high=X.high^~O.high&G.high,A.low=X.low^~O.low&G.low}var A=a[0],W=f[_];A.high^=W.high,A.low^=W.low}},_doFinalize:function(){var s=this._data,l=s.words;this._nDataBytes*8;var a=s.sigBytes*8,n=this.blockSize*32;l[a>>>5]|=1<<24-a%32,l[(x.ceil((a+1)/n)*n>>>5)-1]|=128,s.sigBytes=l.length*4,this._process();for(var i=this._state,p=this.cfg.outputLength/8,C=p/8,A=[],_=0;_>>24)&16711935|(u<<24|u>>>8)&4278255360,F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,A.push(F),A.push(u)}return new g.init(A,p)},clone:function(){for(var s=v.clone.call(this),l=s._state=this._state.slice(0),a=0;a<25;a++)l[a]=l[a].clone();return s}});D.SHA3=v._createHelper(c),D.HmacSHA3=v._createHmacHelper(c)})(Math),h.SHA3})})(m0)),m0.exports}var S0={exports:{}},Xx=S0.exports,mr;function Ux(){return mr||(mr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Xx,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=g.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),t=g.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),B=g.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),e=g.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=g.create([0,1518500249,1859775393,2400959708,2840853838]),o=g.create([1352829926,1548603684,1836072691,2053994217,0]),c=d.RIPEMD160=v.extend({_doReset:function(){this._hash=g.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(C,A){for(var _=0;_<16;_++){var S=A+_,u=C[S];C[S]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}var F=this._hash.words,y=f.words,k=o.words,z=r.words,q=t.words,P=B.words,K=e.words,I,N,T,b,w,m,H,X,O,G;m=I=F[0],H=N=F[1],X=T=F[2],O=b=F[3],G=w=F[4];for(var W,_=0;_<80;_+=1)W=I+C[A+z[_]]|0,_<16?W+=s(N,T,b)+y[0]:_<32?W+=l(N,T,b)+y[1]:_<48?W+=a(N,T,b)+y[2]:_<64?W+=n(N,T,b)+y[3]:W+=i(N,T,b)+y[4],W=W|0,W=p(W,P[_]),W=W+w|0,I=w,w=b,b=p(T,10),T=N,N=W,W=m+C[A+q[_]]|0,_<16?W+=i(H,X,O)+k[0]:_<32?W+=n(H,X,O)+k[1]:_<48?W+=a(H,X,O)+k[2]:_<64?W+=l(H,X,O)+k[3]:W+=s(H,X,O)+k[4],W=W|0,W=p(W,K[_]),W=W+G|0,m=G,G=O,O=p(X,10),X=H,H=W;W=F[1]+T+O|0,F[1]=F[2]+b+G|0,F[2]=F[3]+w+m|0,F[3]=F[4]+I+H|0,F[4]=F[0]+N+X|0,F[0]=W},_doFinalize:function(){var C=this._data,A=C.words,_=this._nDataBytes*8,S=C.sigBytes*8;A[S>>>5]|=128<<24-S%32,A[(S+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,C.sigBytes=(A.length+1)*4,this._process();for(var u=this._hash,F=u.words,y=0;y<5;y++){var k=F[y];F[y]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return u},clone:function(){var C=v.clone.call(this);return C._hash=this._hash.clone(),C}});function s(C,A,_){return C^A^_}function l(C,A,_){return C&A|~C&_}function a(C,A,_){return(C|~A)^_}function n(C,A,_){return C&_|A&~_}function i(C,A,_){return C^(A|~_)}function p(C,A){return C<>>32-A}D.RIPEMD160=v._createHelper(c),D.HmacRIPEMD160=v._createHmacHelper(c)})(),h.RIPEMD160})})(S0)),S0.exports}var R0={exports:{}},Gx=R0.exports,Sr;function ar(){return Sr||(Sr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Gx,function(h){(function(){var x=h,D=x.lib,E=D.Base,g=x.enc,v=g.Utf8,d=x.algo;d.HMAC=E.extend({init:function(r,t){r=this._hasher=new r.init,typeof t=="string"&&(t=v.parse(t));var B=r.blockSize,e=B*4;t.sigBytes>e&&(t=r.finalize(t)),t.clamp();for(var f=this._oKey=t.clone(),o=this._iKey=t.clone(),c=f.words,s=o.words,l=0;l>>2]&255;u.sigBytes-=F}};E.BlockCipher=f.extend({cfg:f.cfg.extend({mode:s,padding:a}),reset:function(){var u;f.reset.call(this);var F=this.cfg,y=F.iv,k=F.mode;this._xformMode==this._ENC_XFORM_MODE?u=k.createEncryptor:(u=k.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==u?this._mode.init(this,y&&y.words):(this._mode=u.call(k,this,y&&y.words),this._mode.__creator=u)},_doProcessBlock:function(u,F){this._mode.processBlock(u,F)},_doFinalize:function(){var u,F=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(F.pad(this._data,this.blockSize),u=this._process(!0)):(u=this._process(!0),F.unpad(u)),u},blockSize:128/32});var n=E.CipherParams=g.extend({init:function(u){this.mixIn(u)},toString:function(u){return(u||this.formatter).stringify(this)}}),i=D.format={},p=i.OpenSSL={stringify:function(u){var F,y=u.ciphertext,k=u.salt;return k?F=v.create([1398893684,1701076831]).concat(k).concat(y):F=y,F.toString(t)},parse:function(u){var F,y=t.parse(u),k=y.words;return k[0]==1398893684&&k[1]==1701076831&&(F=v.create(k.slice(2,4)),k.splice(0,4),y.sigBytes-=16),n.create({ciphertext:y,salt:F})}},C=E.SerializableCipher=g.extend({cfg:g.extend({format:p}),encrypt:function(u,F,y,k){k=this.cfg.extend(k);var z=u.createEncryptor(y,k),q=z.finalize(F),P=z.cfg;return n.create({ciphertext:q,key:y,iv:P.iv,algorithm:u,mode:P.mode,padding:P.padding,blockSize:u.blockSize,formatter:k.format})},decrypt:function(u,F,y,k){k=this.cfg.extend(k),F=this._parse(F,k.format);var z=u.createDecryptor(y,k).finalize(F.ciphertext);return z},_parse:function(u,F){return typeof u=="string"?F.parse(u,this):u}}),A=D.kdf={},_=A.OpenSSL={execute:function(u,F,y,k,z){if(k||(k=v.random(64/8)),z)var q=e.create({keySize:F+y,hasher:z}).compute(u,k);else var q=e.create({keySize:F+y}).compute(u,k);var P=v.create(q.words.slice(F),y*4);return q.sigBytes=F*4,n.create({key:q,iv:P,salt:k})}},S=E.PasswordBasedCipher=C.extend({cfg:C.cfg.extend({kdf:_}),encrypt:function(u,F,y,k){k=this.cfg.extend(k);var z=k.kdf.execute(y,u.keySize,u.ivSize,k.salt,k.hasher);k.iv=z.iv;var q=C.encrypt.call(this,u,F,z.key,k);return q.mixIn(z),q},decrypt:function(u,F,y,k){k=this.cfg.extend(k),F=this._parse(F,k.format);var z=k.kdf.execute(y,u.keySize,u.ivSize,F.salt,k.hasher);k.iv=z.iv;var q=C.decrypt.call(this,u,F,z.key,k);return q}})})()})})($0)),$0.exports}var P0={exports:{}},jx=P0.exports,$r;function Vx(){return $r||($r=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(jx,function(h){return h.mode.CFB=(function(){var x=h.lib.BlockCipherMode.extend();x.Encryptor=x.extend({processBlock:function(E,g){var v=this._cipher,d=v.blockSize;D.call(this,E,g,d,v),this._prevBlock=E.slice(g,g+d)}}),x.Decryptor=x.extend({processBlock:function(E,g){var v=this._cipher,d=v.blockSize,r=E.slice(g,g+d);D.call(this,E,g,d,v),this._prevBlock=r}});function D(E,g,v,d){var r,t=this._iv;t?(r=t.slice(0),this._iv=void 0):r=this._prevBlock,d.encryptBlock(r,0);for(var B=0;B>24&255)===255){var d=v>>16&255,r=v>>8&255,t=v&255;d===255?(d=0,r===255?(r=0,t===255?t=0:++t):++r):++d,v=0,v+=d<<16,v+=r<<8,v+=t}else v+=1<<24;return v}function E(v){return(v[0]=D(v[0]))===0&&(v[1]=D(v[1])),v}var g=x.Encryptor=x.extend({processBlock:function(v,d){var r=this._cipher,t=r.blockSize,B=this._iv,e=this._counter;B&&(e=this._counter=B.slice(0),this._iv=void 0),E(e);var f=e.slice(0);r.encryptBlock(f,0);for(var o=0;o>>2]|=v<<24-d%4*8,x.sigBytes+=v},unpad:function(x){var D=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=D}},h.pad.Ansix923})})(N0)),N0.exports}var O0={exports:{}},fe=O0.exports,Nr;function ce(){return Nr||(Nr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(fe,function(h){return h.pad.Iso10126={pad:function(x,D){var E=D*4,g=E-x.sigBytes%E;x.concat(h.lib.WordArray.random(g-1)).concat(h.lib.WordArray.create([g<<24],1))},unpad:function(x){var D=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=D}},h.pad.Iso10126})})(O0)),O0.exports}var K0={exports:{}},ve=K0.exports,Or;function ue(){return Or||(Or=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(ve,function(h){return h.pad.Iso97971={pad:function(x,D){x.concat(h.lib.WordArray.create([2147483648],1)),h.pad.ZeroPadding.pad(x,D)},unpad:function(x){h.pad.ZeroPadding.unpad(x),x.sigBytes--}},h.pad.Iso97971})})(K0)),K0.exports}var X0={exports:{}},de=X0.exports,Kr;function Be(){return Kr||(Kr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(de,function(h){return h.pad.ZeroPadding={pad:function(x,D){var E=D*4;x.clamp(),x.sigBytes+=E-(x.sigBytes%E||E)},unpad:function(x){for(var D=x.words,E=x.sigBytes-1,E=x.sigBytes-1;E>=0;E--)if(D[E>>>2]>>>24-E%4*8&255){x.sigBytes=E+1;break}}},h.pad.ZeroPadding})})(X0)),X0.exports}var U0={exports:{}},he=U0.exports,Xr;function le(){return Xr||(Xr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(he,function(h){return h.pad.NoPadding={pad:function(){},unpad:function(){}},h.pad.NoPadding})})(U0)),U0.exports}var G0={exports:{}},Ce=G0.exports,Ur;function pe(){return Ur||(Ur=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(Ce,function(h){return(function(x){var D=h,E=D.lib,g=E.CipherParams,v=D.enc,d=v.Hex,r=D.format;r.Hex={stringify:function(t){return t.ciphertext.toString(d)},parse:function(t){var B=d.parse(t);return g.create({ciphertext:B})}}})(),h.format.Hex})})(G0)),G0.exports}var Z0={exports:{}},Ee=Z0.exports,Gr;function Ae(){return Gr||(Gr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(Ee,function(h){return(function(){var x=h,D=x.lib,E=D.BlockCipher,g=x.algo,v=[],d=[],r=[],t=[],B=[],e=[],f=[],o=[],c=[],s=[];(function(){for(var n=[],i=0;i<256;i++)i<128?n[i]=i<<1:n[i]=i<<1^283;for(var p=0,C=0,i=0;i<256;i++){var A=C^C<<1^C<<2^C<<3^C<<4;A=A>>>8^A&255^99,v[p]=A,d[A]=p;var _=n[p],S=n[_],u=n[S],F=n[A]*257^A*16843008;r[p]=F<<24|F>>>8,t[p]=F<<16|F>>>16,B[p]=F<<8|F>>>24,e[p]=F;var F=u*16843009^S*65537^_*257^p*16843008;f[A]=F<<24|F>>>8,o[A]=F<<16|F>>>16,c[A]=F<<8|F>>>24,s[A]=F,p?(p=_^n[n[n[u^_]]],C^=n[n[C]]):p=C=1}})();var l=[0,1,2,4,8,16,32,64,128,27,54],a=g.AES=E.extend({_doReset:function(){var n;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var i=this._keyPriorReset=this._key,p=i.words,C=i.sigBytes/4,A=this._nRounds=C+6,_=(A+1)*4,S=this._keySchedule=[],u=0;u<_;u++)u6&&u%C==4&&(n=v[n>>>24]<<24|v[n>>>16&255]<<16|v[n>>>8&255]<<8|v[n&255]):(n=n<<8|n>>>24,n=v[n>>>24]<<24|v[n>>>16&255]<<16|v[n>>>8&255]<<8|v[n&255],n^=l[u/C|0]<<24),S[u]=S[u-C]^n);for(var F=this._invKeySchedule=[],y=0;y<_;y++){var u=_-y;if(y%4)var n=S[u];else var n=S[u-4];y<4||u<=4?F[y]=n:F[y]=f[v[n>>>24]]^o[v[n>>>16&255]]^c[v[n>>>8&255]]^s[v[n&255]]}}},encryptBlock:function(n,i){this._doCryptBlock(n,i,this._keySchedule,r,t,B,e,v)},decryptBlock:function(n,i){var p=n[i+1];n[i+1]=n[i+3],n[i+3]=p,this._doCryptBlock(n,i,this._invKeySchedule,f,o,c,s,d);var p=n[i+1];n[i+1]=n[i+3],n[i+3]=p},_doCryptBlock:function(n,i,p,C,A,_,S,u){for(var F=this._nRounds,y=n[i]^p[0],k=n[i+1]^p[1],z=n[i+2]^p[2],q=n[i+3]^p[3],P=4,K=1;K>>24]^A[k>>>16&255]^_[z>>>8&255]^S[q&255]^p[P++],N=C[k>>>24]^A[z>>>16&255]^_[q>>>8&255]^S[y&255]^p[P++],T=C[z>>>24]^A[q>>>16&255]^_[y>>>8&255]^S[k&255]^p[P++],b=C[q>>>24]^A[y>>>16&255]^_[k>>>8&255]^S[z&255]^p[P++];y=I,k=N,z=T,q=b}var I=(u[y>>>24]<<24|u[k>>>16&255]<<16|u[z>>>8&255]<<8|u[q&255])^p[P++],N=(u[k>>>24]<<24|u[z>>>16&255]<<16|u[q>>>8&255]<<8|u[y&255])^p[P++],T=(u[z>>>24]<<24|u[q>>>16&255]<<16|u[y>>>8&255]<<8|u[k&255])^p[P++],b=(u[q>>>24]<<24|u[y>>>16&255]<<16|u[k>>>8&255]<<8|u[z&255])^p[P++];n[i]=I,n[i+1]=N,n[i+2]=T,n[i+3]=b},keySize:256/32});x.AES=E._createHelper(a)})(),h.AES})})(Z0)),Z0.exports}var Q0={exports:{}},Fe=Q0.exports,Zr;function De(){return Zr||(Zr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(Fe,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=D.BlockCipher,v=x.algo,d=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],r=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],t=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],B=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],e=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=v.DES=g.extend({_doReset:function(){for(var l=this._key,a=l.words,n=[],i=0;i<56;i++){var p=d[i]-1;n[i]=a[p>>>5]>>>31-p%32&1}for(var C=this._subKeys=[],A=0;A<16;A++){for(var _=C[A]=[],S=t[A],i=0;i<24;i++)_[i/6|0]|=n[(r[i]-1+S)%28]<<31-i%6,_[4+(i/6|0)]|=n[28+(r[i+24]-1+S)%28]<<31-i%6;_[0]=_[0]<<1|_[0]>>>31;for(var i=1;i<7;i++)_[i]=_[i]>>>(i-1)*4+3;_[7]=_[7]<<5|_[7]>>>27}for(var u=this._invSubKeys=[],i=0;i<16;i++)u[i]=C[15-i]},encryptBlock:function(l,a){this._doCryptBlock(l,a,this._subKeys)},decryptBlock:function(l,a){this._doCryptBlock(l,a,this._invSubKeys)},_doCryptBlock:function(l,a,n){this._lBlock=l[a],this._rBlock=l[a+1],o.call(this,4,252645135),o.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),o.call(this,1,1431655765);for(var i=0;i<16;i++){for(var p=n[i],C=this._lBlock,A=this._rBlock,_=0,S=0;S<8;S++)_|=B[S][((A^p[S])&e[S])>>>0];this._lBlock=A,this._rBlock=C^_}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,o.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),o.call(this,16,65535),o.call(this,4,252645135),l[a]=this._lBlock,l[a+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function o(l,a){var n=(this._lBlock>>>l^this._rBlock)&a;this._rBlock^=n,this._lBlock^=n<>>l^this._lBlock)&a;this._lBlock^=n,this._rBlock^=n<192.");var n=a.slice(0,2),i=a.length<4?a.slice(0,2):a.slice(2,4),p=a.length<6?a.slice(0,2):a.slice(4,6);this._des1=f.createEncryptor(E.create(n)),this._des2=f.createEncryptor(E.create(i)),this._des3=f.createEncryptor(E.create(p))},encryptBlock:function(l,a){this._des1.encryptBlock(l,a),this._des2.decryptBlock(l,a),this._des3.encryptBlock(l,a)},decryptBlock:function(l,a){this._des3.decryptBlock(l,a),this._des2.encryptBlock(l,a),this._des1.decryptBlock(l,a)},keySize:192/32,ivSize:64/32,blockSize:64/32});x.TripleDES=g._createHelper(s)})(),h.TripleDES})})(Q0)),Q0.exports}var Y0={exports:{}},_e=Y0.exports,Qr;function be(){return Qr||(Qr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(_e,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=g.RC4=E.extend({_doReset:function(){for(var t=this._key,B=t.words,e=t.sigBytes,f=this._S=[],o=0;o<256;o++)f[o]=o;for(var o=0,c=0;o<256;o++){var s=o%e,l=B[s>>>2]>>>24-s%4*8&255;c=(c+f[o]+l)%256;var a=f[o];f[o]=f[c],f[c]=a}this._i=this._j=0},_doProcessBlock:function(t,B){t[B]^=d.call(this)},keySize:256/32,ivSize:0});function d(){for(var t=this._S,B=this._i,e=this._j,f=0,o=0;o<4;o++){B=(B+1)%256,e=(e+t[B])%256;var c=t[B];t[B]=t[e],t[e]=c,f|=t[(t[B]+t[e])%256]<<24-o*8}return this._i=B,this._j=e,f}x.RC4=E._createHelper(v);var r=g.RC4Drop=v.extend({cfg:v.cfg.extend({drop:192}),_doReset:function(){v._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)d.call(this)}});x.RC4Drop=E._createHelper(r)})(),h.RC4})})(Y0)),Y0.exports}var M0={exports:{}},ge=M0.exports,Yr;function ye(){return Yr||(Yr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(ge,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=[],d=[],r=[],t=g.Rabbit=E.extend({_doReset:function(){for(var e=this._key.words,f=this.cfg.iv,o=0;o<4;o++)e[o]=(e[o]<<8|e[o]>>>24)&16711935|(e[o]<<24|e[o]>>>8)&4278255360;var c=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],s=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var o=0;o<4;o++)B.call(this);for(var o=0;o<8;o++)s[o]^=c[o+4&7];if(f){var l=f.words,a=l[0],n=l[1],i=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,p=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,C=i>>>16|p&4294901760,A=p<<16|i&65535;s[0]^=i,s[1]^=C,s[2]^=p,s[3]^=A,s[4]^=i,s[5]^=C,s[6]^=p,s[7]^=A;for(var o=0;o<4;o++)B.call(this)}},_doProcessBlock:function(e,f){var o=this._X;B.call(this),v[0]=o[0]^o[5]>>>16^o[3]<<16,v[1]=o[2]^o[7]>>>16^o[5]<<16,v[2]=o[4]^o[1]>>>16^o[7]<<16,v[3]=o[6]^o[3]>>>16^o[1]<<16;for(var c=0;c<4;c++)v[c]=(v[c]<<8|v[c]>>>24)&16711935|(v[c]<<24|v[c]>>>8)&4278255360,e[f+c]^=v[c]},blockSize:128/32,ivSize:64/32});function B(){for(var e=this._X,f=this._C,o=0;o<8;o++)d[o]=f[o];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var o=0;o<8;o++){var c=e[o]+f[o],s=c&65535,l=c>>>16,a=((s*s>>>17)+s*l>>>15)+l*l,n=((c&4294901760)*c|0)+((c&65535)*c|0);r[o]=a^n}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}x.Rabbit=E._createHelper(t)})(),h.Rabbit})})(M0)),M0.exports}var j0={exports:{}},ke=j0.exports,Mr;function He(){return Mr||(Mr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(ke,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=[],d=[],r=[],t=g.RabbitLegacy=E.extend({_doReset:function(){var e=this._key.words,f=this.cfg.iv,o=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],c=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var s=0;s<4;s++)B.call(this);for(var s=0;s<8;s++)c[s]^=o[s+4&7];if(f){var l=f.words,a=l[0],n=l[1],i=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,p=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,C=i>>>16|p&4294901760,A=p<<16|i&65535;c[0]^=i,c[1]^=C,c[2]^=p,c[3]^=A,c[4]^=i,c[5]^=C,c[6]^=p,c[7]^=A;for(var s=0;s<4;s++)B.call(this)}},_doProcessBlock:function(e,f){var o=this._X;B.call(this),v[0]=o[0]^o[5]>>>16^o[3]<<16,v[1]=o[2]^o[7]>>>16^o[5]<<16,v[2]=o[4]^o[1]>>>16^o[7]<<16,v[3]=o[6]^o[3]>>>16^o[1]<<16;for(var c=0;c<4;c++)v[c]=(v[c]<<8|v[c]>>>24)&16711935|(v[c]<<24|v[c]>>>8)&4278255360,e[f+c]^=v[c]},blockSize:128/32,ivSize:64/32});function B(){for(var e=this._X,f=this._C,o=0;o<8;o++)d[o]=f[o];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var o=0;o<8;o++){var c=e[o]+f[o],s=c&65535,l=c>>>16,a=((s*s>>>17)+s*l>>>15)+l*l,n=((c&4294901760)*c|0)+((c&65535)*c|0);r[o]=a^n}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}x.RabbitLegacy=E._createHelper(t)})(),h.RabbitLegacy})})(j0)),j0.exports}var V0={exports:{}},we=V0.exports,jr;function me(){return jr||(jr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(we,function(h){return(function(){var x=h,D=x.lib,E=D.BlockCipher,g=x.algo;const v=16,d=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],r=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var t={pbox:[],sbox:[]};function B(s,l){let a=l>>24&255,n=l>>16&255,i=l>>8&255,p=l&255,C=s.sbox[0][a]+s.sbox[1][n];return C=C^s.sbox[2][i],C=C+s.sbox[3][p],C}function e(s,l,a){let n=l,i=a,p;for(let C=0;C1;--C)n=n^s.pbox[C],i=B(s,n)^i,p=n,n=i,i=p;return p=n,n=i,i=p,i=i^s.pbox[1],n=n^s.pbox[0],{left:n,right:i}}function o(s,l,a){for(let A=0;A<4;A++){s.sbox[A]=[];for(let _=0;_<256;_++)s.sbox[A][_]=r[A][_]}let n=0;for(let A=0;A=a&&(n=0);let i=0,p=0,C=0;for(let A=0;A{g!==x.props.value&&(g=x.props.value,E(x.props.value,x.props.secret,x.props.storage_key),x.dispatch("change"))}),Ax(()=>{D()}),Fx()}export{Ie as default}; +import{a0 as Bx,R as er,L as hx,G as lx,r as Cx}from"./i18n-DtG3MAQ1.js";import{M as px,ac as Ex,a7 as Ax,O as Fx}from"./index-BeNBoC9J.js";import{_ as Dx}from"./__vite-browser-external-D7Ct-6yo.js";var C0={exports:{}};function _x(R){throw new Error('Could not dynamically require "'+R+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var p0={exports:{}};const bx=Bx(Dx);var gx=p0.exports,Cr;function L(){return Cr||(Cr=1,(function(R,$){(function(h,x){R.exports=x()})(gx,function(){var h=h||(function(x,D){var E;if(typeof window<"u"&&window.crypto&&(E=window.crypto),typeof self<"u"&&self.crypto&&(E=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(E=globalThis.crypto),!E&&typeof window<"u"&&window.msCrypto&&(E=window.msCrypto),!E&&typeof er<"u"&&er.crypto&&(E=er.crypto),!E&&typeof _x=="function")try{E=bx}catch{}var g=function(){if(E){if(typeof E.getRandomValues=="function")try{return E.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof E.randomBytes=="function")try{return E.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},v=Object.create||(function(){function a(){}return function(n){var i;return a.prototype=n,i=new a,a.prototype=null,i}})(),d={},r=d.lib={},t=r.Base=(function(){return{extend:function(a){var n=v(this);return a&&n.mixIn(a),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var n in a)a.hasOwnProperty(n)&&(this[n]=a[n]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),B=r.WordArray=t.extend({init:function(a,n){a=this.words=a||[],n!=D?this.sigBytes=n:this.sigBytes=a.length*4},toString:function(a){return(a||f).stringify(this)},concat:function(a){var n=this.words,i=a.words,p=this.sigBytes,C=a.sigBytes;if(this.clamp(),p%4)for(var A=0;A>>2]>>>24-A%4*8&255;n[p+A>>>2]|=_<<24-(p+A)%4*8}else for(var S=0;S>>2]=i[S>>>2];return this.sigBytes+=C,this},clamp:function(){var a=this.words,n=this.sigBytes;a[n>>>2]&=4294967295<<32-n%4*8,a.length=x.ceil(n/4)},clone:function(){var a=t.clone.call(this);return a.words=this.words.slice(0),a},random:function(a){for(var n=[],i=0;i>>2]>>>24-C%4*8&255;p.push((A>>>4).toString(16)),p.push((A&15).toString(16))}return p.join("")},parse:function(a){for(var n=a.length,i=[],p=0;p>>3]|=parseInt(a.substr(p,2),16)<<24-p%8*4;return new B.init(i,n/2)}},o=e.Latin1={stringify:function(a){for(var n=a.words,i=a.sigBytes,p=[],C=0;C>>2]>>>24-C%4*8&255;p.push(String.fromCharCode(A))}return p.join("")},parse:function(a){for(var n=a.length,i=[],p=0;p>>2]|=(a.charCodeAt(p)&255)<<24-p%4*8;return new B.init(i,n)}},c=e.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},s=r.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new B.init,this._nDataBytes=0},_append:function(a){typeof a=="string"&&(a=c.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(a){var n,i=this._data,p=i.words,C=i.sigBytes,A=this.blockSize,_=A*4,S=C/_;a?S=x.ceil(S):S=x.max((S|0)-this._minBufferSize,0);var u=S*A,F=x.min(u*4,C);if(u){for(var y=0;y>>2]|=d[B]<<24-B%4*8;g.call(this,t,r)}else g.apply(this,arguments)};v.prototype=E}})(),h.lib.WordArray})})(A0)),A0.exports}var F0={exports:{}},wx=F0.exports,Ar;function mx(){return Ar||(Ar=1,(function(R,$){(function(h,x){R.exports=x(L())})(wx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Utf16=g.Utf16BE={stringify:function(d){for(var r=d.words,t=d.sigBytes,B=[],e=0;e>>2]>>>16-e%4*8&65535;B.push(String.fromCharCode(f))}return B.join("")},parse:function(d){for(var r=d.length,t=[],B=0;B>>1]|=d.charCodeAt(B)<<16-B%2*16;return E.create(t,r*2)}},g.Utf16LE={stringify:function(d){for(var r=d.words,t=d.sigBytes,B=[],e=0;e>>2]>>>16-e%4*8&65535);B.push(String.fromCharCode(f))}return B.join("")},parse:function(d){for(var r=d.length,t=[],B=0;B>>1]|=v(d.charCodeAt(B)<<16-B%2*16);return E.create(t,r*2)}};function v(d){return d<<8&4278255360|d>>>8&16711935}})(),h.enc.Utf16})})(F0)),F0.exports}var D0={exports:{}},Sx=D0.exports,Fr;function e0(){return Fr||(Fr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Sx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Base64={stringify:function(d){var r=d.words,t=d.sigBytes,B=this._map;d.clamp();for(var e=[],f=0;f>>2]>>>24-f%4*8&255,c=r[f+1>>>2]>>>24-(f+1)%4*8&255,s=r[f+2>>>2]>>>24-(f+2)%4*8&255,l=o<<16|c<<8|s,a=0;a<4&&f+a*.75>>6*(3-a)&63));var n=B.charAt(64);if(n)for(;e.length%4;)e.push(n);return e.join("")},parse:function(d){var r=d.length,t=this._map,B=this._reverseMap;if(!B){B=this._reverseMap=[];for(var e=0;e>>6-f%4*2,s=o|c;B[e>>>2]|=s<<24-e%4*8,e++}return E.create(B,e)}})(),h.enc.Base64})})(D0)),D0.exports}var _0={exports:{}},Rx=_0.exports,Dr;function zx(){return Dr||(Dr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Rx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.enc;g.Base64url={stringify:function(d,r){r===void 0&&(r=!0);var t=d.words,B=d.sigBytes,e=r?this._safe_map:this._map;d.clamp();for(var f=[],o=0;o>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,l=t[o+2>>>2]>>>24-(o+2)%4*8&255,a=c<<16|s<<8|l,n=0;n<4&&o+n*.75>>6*(3-n)&63));var i=e.charAt(64);if(i)for(;f.length%4;)f.push(i);return f.join("")},parse:function(d,r){r===void 0&&(r=!0);var t=d.length,B=r?this._safe_map:this._map,e=this._reverseMap;if(!e){e=this._reverseMap=[];for(var f=0;f>>6-f%4*2,s=o|c;B[e>>>2]|=s<<24-e%4*8,e++}return E.create(B,e)}})(),h.enc.Base64url})})(_0)),_0.exports}var b0={exports:{}},qx=b0.exports,_r;function t0(){return _r||(_r=1,(function(R,$){(function(h,x){R.exports=x(L())})(qx,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=[];(function(){for(var c=0;c<64;c++)r[c]=x.abs(x.sin(c+1))*4294967296|0})();var t=d.MD5=v.extend({_doReset:function(){this._hash=new g.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(c,s){for(var l=0;l<16;l++){var a=s+l,n=c[a];c[a]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var i=this._hash.words,p=c[s+0],C=c[s+1],A=c[s+2],_=c[s+3],S=c[s+4],u=c[s+5],F=c[s+6],y=c[s+7],k=c[s+8],z=c[s+9],q=c[s+10],P=c[s+11],K=c[s+12],I=c[s+13],N=c[s+14],T=c[s+15],b=i[0],w=i[1],m=i[2],H=i[3];b=B(b,w,m,H,p,7,r[0]),H=B(H,b,w,m,C,12,r[1]),m=B(m,H,b,w,A,17,r[2]),w=B(w,m,H,b,_,22,r[3]),b=B(b,w,m,H,S,7,r[4]),H=B(H,b,w,m,u,12,r[5]),m=B(m,H,b,w,F,17,r[6]),w=B(w,m,H,b,y,22,r[7]),b=B(b,w,m,H,k,7,r[8]),H=B(H,b,w,m,z,12,r[9]),m=B(m,H,b,w,q,17,r[10]),w=B(w,m,H,b,P,22,r[11]),b=B(b,w,m,H,K,7,r[12]),H=B(H,b,w,m,I,12,r[13]),m=B(m,H,b,w,N,17,r[14]),w=B(w,m,H,b,T,22,r[15]),b=e(b,w,m,H,C,5,r[16]),H=e(H,b,w,m,F,9,r[17]),m=e(m,H,b,w,P,14,r[18]),w=e(w,m,H,b,p,20,r[19]),b=e(b,w,m,H,u,5,r[20]),H=e(H,b,w,m,q,9,r[21]),m=e(m,H,b,w,T,14,r[22]),w=e(w,m,H,b,S,20,r[23]),b=e(b,w,m,H,z,5,r[24]),H=e(H,b,w,m,N,9,r[25]),m=e(m,H,b,w,_,14,r[26]),w=e(w,m,H,b,k,20,r[27]),b=e(b,w,m,H,I,5,r[28]),H=e(H,b,w,m,A,9,r[29]),m=e(m,H,b,w,y,14,r[30]),w=e(w,m,H,b,K,20,r[31]),b=f(b,w,m,H,u,4,r[32]),H=f(H,b,w,m,k,11,r[33]),m=f(m,H,b,w,P,16,r[34]),w=f(w,m,H,b,N,23,r[35]),b=f(b,w,m,H,C,4,r[36]),H=f(H,b,w,m,S,11,r[37]),m=f(m,H,b,w,y,16,r[38]),w=f(w,m,H,b,q,23,r[39]),b=f(b,w,m,H,I,4,r[40]),H=f(H,b,w,m,p,11,r[41]),m=f(m,H,b,w,_,16,r[42]),w=f(w,m,H,b,F,23,r[43]),b=f(b,w,m,H,z,4,r[44]),H=f(H,b,w,m,K,11,r[45]),m=f(m,H,b,w,T,16,r[46]),w=f(w,m,H,b,A,23,r[47]),b=o(b,w,m,H,p,6,r[48]),H=o(H,b,w,m,y,10,r[49]),m=o(m,H,b,w,N,15,r[50]),w=o(w,m,H,b,u,21,r[51]),b=o(b,w,m,H,K,6,r[52]),H=o(H,b,w,m,_,10,r[53]),m=o(m,H,b,w,q,15,r[54]),w=o(w,m,H,b,C,21,r[55]),b=o(b,w,m,H,k,6,r[56]),H=o(H,b,w,m,T,10,r[57]),m=o(m,H,b,w,F,15,r[58]),w=o(w,m,H,b,I,21,r[59]),b=o(b,w,m,H,S,6,r[60]),H=o(H,b,w,m,P,10,r[61]),m=o(m,H,b,w,A,15,r[62]),w=o(w,m,H,b,z,21,r[63]),i[0]=i[0]+b|0,i[1]=i[1]+w|0,i[2]=i[2]+m|0,i[3]=i[3]+H|0},_doFinalize:function(){var c=this._data,s=c.words,l=this._nDataBytes*8,a=c.sigBytes*8;s[a>>>5]|=128<<24-a%32;var n=x.floor(l/4294967296),i=l;s[(a+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,s[(a+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,c.sigBytes=(s.length+1)*4,this._process();for(var p=this._hash,C=p.words,A=0;A<4;A++){var _=C[A];C[A]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}return p},clone:function(){var c=v.clone.call(this);return c._hash=this._hash.clone(),c}});function B(c,s,l,a,n,i,p){var C=c+(s&l|~s&a)+n+p;return(C<>>32-i)+s}function e(c,s,l,a,n,i,p){var C=c+(s&a|l&~a)+n+p;return(C<>>32-i)+s}function f(c,s,l,a,n,i,p){var C=c+(s^l^a)+n+p;return(C<>>32-i)+s}function o(c,s,l,a,n,i,p){var C=c+(l^(s|~a))+n+p;return(C<>>32-i)+s}D.MD5=v._createHelper(t),D.HmacMD5=v._createHmacHelper(t)})(Math),h.MD5})})(b0)),b0.exports}var g0={exports:{}},$x=g0.exports,br;function Jr(){return br||(br=1,(function(R,$){(function(h,x){R.exports=x(L())})($x,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=D.Hasher,v=x.algo,d=[],r=v.SHA1=g.extend({_doReset:function(){this._hash=new E.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,B){for(var e=this._hash.words,f=e[0],o=e[1],c=e[2],s=e[3],l=e[4],a=0;a<80;a++){if(a<16)d[a]=t[B+a]|0;else{var n=d[a-3]^d[a-8]^d[a-14]^d[a-16];d[a]=n<<1|n>>>31}var i=(f<<5|f>>>27)+l+d[a];a<20?i+=(o&c|~o&s)+1518500249:a<40?i+=(o^c^s)+1859775393:a<60?i+=(o&c|o&s|c&s)-1894007588:i+=(o^c^s)-899497514,l=s,s=c,c=o<<30|o>>>2,o=f,f=i}e[0]=e[0]+f|0,e[1]=e[1]+o|0,e[2]=e[2]+c|0,e[3]=e[3]+s|0,e[4]=e[4]+l|0},_doFinalize:function(){var t=this._data,B=t.words,e=this._nDataBytes*8,f=t.sigBytes*8;return B[f>>>5]|=128<<24-f%32,B[(f+64>>>9<<4)+14]=Math.floor(e/4294967296),B[(f+64>>>9<<4)+15]=e,t.sigBytes=B.length*4,this._process(),this._hash},clone:function(){var t=g.clone.call(this);return t._hash=this._hash.clone(),t}});x.SHA1=g._createHelper(r),x.HmacSHA1=g._createHmacHelper(r)})(),h.SHA1})})(g0)),g0.exports}var y0={exports:{}},Px=y0.exports,gr;function tr(){return gr||(gr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Px,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=[],t=[];(function(){function f(l){for(var a=x.sqrt(l),n=2;n<=a;n++)if(!(l%n))return!1;return!0}function o(l){return(l-(l|0))*4294967296|0}for(var c=2,s=0;s<64;)f(c)&&(s<8&&(r[s]=o(x.pow(c,1/2))),t[s]=o(x.pow(c,1/3)),s++),c++})();var B=[],e=d.SHA256=v.extend({_doReset:function(){this._hash=new g.init(r.slice(0))},_doProcessBlock:function(f,o){for(var c=this._hash.words,s=c[0],l=c[1],a=c[2],n=c[3],i=c[4],p=c[5],C=c[6],A=c[7],_=0;_<64;_++){if(_<16)B[_]=f[o+_]|0;else{var S=B[_-15],u=(S<<25|S>>>7)^(S<<14|S>>>18)^S>>>3,F=B[_-2],y=(F<<15|F>>>17)^(F<<13|F>>>19)^F>>>10;B[_]=u+B[_-7]+y+B[_-16]}var k=i&p^~i&C,z=s&l^s&a^l&a,q=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),P=(i<<26|i>>>6)^(i<<21|i>>>11)^(i<<7|i>>>25),K=A+P+k+t[_]+B[_],I=q+z;A=C,C=p,p=i,i=n+K|0,n=a,a=l,l=s,s=K+I|0}c[0]=c[0]+s|0,c[1]=c[1]+l|0,c[2]=c[2]+a|0,c[3]=c[3]+n|0,c[4]=c[4]+i|0,c[5]=c[5]+p|0,c[6]=c[6]+C|0,c[7]=c[7]+A|0},_doFinalize:function(){var f=this._data,o=f.words,c=this._nDataBytes*8,s=f.sigBytes*8;return o[s>>>5]|=128<<24-s%32,o[(s+64>>>9<<4)+14]=x.floor(c/4294967296),o[(s+64>>>9<<4)+15]=c,f.sigBytes=o.length*4,this._process(),this._hash},clone:function(){var f=v.clone.call(this);return f._hash=this._hash.clone(),f}});D.SHA256=v._createHelper(e),D.HmacSHA256=v._createHmacHelper(e)})(Math),h.SHA256})})(y0)),y0.exports}var k0={exports:{}},Wx=k0.exports,yr;function Lx(){return yr||(yr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),tr())})(Wx,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=x.algo,v=g.SHA256,d=g.SHA224=v.extend({_doReset:function(){this._hash=new E.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var r=v._doFinalize.call(this);return r.sigBytes-=4,r}});x.SHA224=v._createHelper(d),x.HmacSHA224=v._createHmacHelper(d)})(),h.SHA224})})(k0)),k0.exports}var H0={exports:{}},Ix=H0.exports,kr;function rx(){return kr||(kr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0())})(Ix,function(h){return(function(){var x=h,D=x.lib,E=D.Hasher,g=x.x64,v=g.Word,d=g.WordArray,r=x.algo;function t(){return v.create.apply(v,arguments)}var B=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],e=[];(function(){for(var o=0;o<80;o++)e[o]=t()})();var f=r.SHA512=E.extend({_doReset:function(){this._hash=new d.init([new v.init(1779033703,4089235720),new v.init(3144134277,2227873595),new v.init(1013904242,4271175723),new v.init(2773480762,1595750129),new v.init(1359893119,2917565137),new v.init(2600822924,725511199),new v.init(528734635,4215389547),new v.init(1541459225,327033209)])},_doProcessBlock:function(o,c){for(var s=this._hash.words,l=s[0],a=s[1],n=s[2],i=s[3],p=s[4],C=s[5],A=s[6],_=s[7],S=l.high,u=l.low,F=a.high,y=a.low,k=n.high,z=n.low,q=i.high,P=i.low,K=p.high,I=p.low,N=C.high,T=C.low,b=A.high,w=A.low,m=_.high,H=_.low,X=S,O=u,G=F,W=y,i0=k,a0=z,rr=q,s0=P,j=K,Z=I,B0=N,f0=T,h0=b,c0=w,xr=m,v0=H,V=0;V<80;V++){var Y,J,l0=e[V];if(V<16)J=l0.high=o[c+V*2]|0,Y=l0.low=o[c+V*2+1]|0;else{var nr=e[V-15],n0=nr.high,u0=nr.low,xx=(n0>>>1|u0<<31)^(n0>>>8|u0<<24)^n0>>>7,or=(u0>>>1|n0<<31)^(u0>>>8|n0<<24)^(u0>>>7|n0<<25),ir=e[V-2],o0=ir.high,d0=ir.low,ex=(o0>>>19|d0<<13)^(o0<<3|d0>>>29)^o0>>>6,sr=(d0>>>19|o0<<13)^(d0<<3|o0>>>29)^(d0>>>6|o0<<26),fr=e[V-7],tx=fr.high,ax=fr.low,cr=e[V-16],nx=cr.high,vr=cr.low;Y=or+ax,J=xx+tx+(Y>>>0>>0?1:0),Y=Y+sr,J=J+ex+(Y>>>0>>0?1:0),Y=Y+vr,J=J+nx+(Y>>>0>>0?1:0),l0.high=J,l0.low=Y}var ox=j&B0^~j&h0,ur=Z&f0^~Z&c0,ix=X&G^X&i0^G&i0,sx=O&W^O&a0^W&a0,fx=(X>>>28|O<<4)^(X<<30|O>>>2)^(X<<25|O>>>7),dr=(O>>>28|X<<4)^(O<<30|X>>>2)^(O<<25|X>>>7),cx=(j>>>14|Z<<18)^(j>>>18|Z<<14)^(j<<23|Z>>>9),vx=(Z>>>14|j<<18)^(Z>>>18|j<<14)^(Z<<23|j>>>9),Br=B[V],ux=Br.high,hr=Br.low,Q=v0+vx,r0=xr+cx+(Q>>>0>>0?1:0),Q=Q+ur,r0=r0+ox+(Q>>>0>>0?1:0),Q=Q+hr,r0=r0+ux+(Q>>>0
            >>0?1:0),Q=Q+Y,r0=r0+J+(Q>>>0>>0?1:0),lr=dr+sx,dx=fx+ix+(lr>>>0>>0?1:0);xr=h0,v0=c0,h0=B0,c0=f0,B0=j,f0=Z,Z=s0+Q|0,j=rr+r0+(Z>>>0>>0?1:0)|0,rr=i0,s0=a0,i0=G,a0=W,G=X,W=O,O=Q+lr|0,X=r0+dx+(O>>>0>>0?1:0)|0}u=l.low=u+O,l.high=S+X+(u>>>0>>0?1:0),y=a.low=y+W,a.high=F+G+(y>>>0>>0?1:0),z=n.low=z+a0,n.high=k+i0+(z>>>0>>0?1:0),P=i.low=P+s0,i.high=q+rr+(P>>>0>>0?1:0),I=p.low=I+Z,p.high=K+j+(I>>>0>>0?1:0),T=C.low=T+f0,C.high=N+B0+(T>>>0>>0?1:0),w=A.low=w+c0,A.high=b+h0+(w>>>0>>0?1:0),H=_.low=H+v0,_.high=m+xr+(H>>>0>>0?1:0)},_doFinalize:function(){var o=this._data,c=o.words,s=this._nDataBytes*8,l=o.sigBytes*8;c[l>>>5]|=128<<24-l%32,c[(l+128>>>10<<5)+30]=Math.floor(s/4294967296),c[(l+128>>>10<<5)+31]=s,o.sigBytes=c.length*4,this._process();var a=this._hash.toX32();return a},clone:function(){var o=E.clone.call(this);return o._hash=this._hash.clone(),o},blockSize:1024/32});x.SHA512=E._createHelper(f),x.HmacSHA512=E._createHmacHelper(f)})(),h.SHA512})})(H0)),H0.exports}var w0={exports:{}},Tx=w0.exports,Hr;function Nx(){return Hr||(Hr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0(),rx())})(Tx,function(h){return(function(){var x=h,D=x.x64,E=D.Word,g=D.WordArray,v=x.algo,d=v.SHA512,r=v.SHA384=d.extend({_doReset:function(){this._hash=new g.init([new E.init(3418070365,3238371032),new E.init(1654270250,914150663),new E.init(2438529370,812702999),new E.init(355462360,4144912697),new E.init(1731405415,4290775857),new E.init(2394180231,1750603025),new E.init(3675008525,1694076839),new E.init(1203062813,3204075428)])},_doFinalize:function(){var t=d._doFinalize.call(this);return t.sigBytes-=16,t}});x.SHA384=d._createHelper(r),x.HmacSHA384=d._createHmacHelper(r)})(),h.SHA384})})(w0)),w0.exports}var m0={exports:{}},Ox=m0.exports,wr;function Kx(){return wr||(wr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),J0())})(Ox,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.x64,r=d.Word,t=D.algo,B=[],e=[],f=[];(function(){for(var s=1,l=0,a=0;a<24;a++){B[s+5*l]=(a+1)*(a+2)/2%64;var n=l%5,i=(2*s+3*l)%5;s=n,l=i}for(var s=0;s<5;s++)for(var l=0;l<5;l++)e[s+5*l]=l+(2*s+3*l)%5*5;for(var p=1,C=0;C<24;C++){for(var A=0,_=0,S=0;S<7;S++){if(p&1){var u=(1<>>24)&16711935|(p<<24|p>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360;var A=a[i];A.high^=C,A.low^=p}for(var _=0;_<24;_++){for(var S=0;S<5;S++){for(var u=0,F=0,y=0;y<5;y++){var A=a[S+5*y];u^=A.high,F^=A.low}var k=o[S];k.high=u,k.low=F}for(var S=0;S<5;S++)for(var z=o[(S+4)%5],q=o[(S+1)%5],P=q.high,K=q.low,u=z.high^(P<<1|K>>>31),F=z.low^(K<<1|P>>>31),y=0;y<5;y++){var A=a[S+5*y];A.high^=u,A.low^=F}for(var I=1;I<25;I++){var u,F,A=a[I],N=A.high,T=A.low,b=B[I];b<32?(u=N<>>32-b,F=T<>>32-b):(u=T<>>64-b,F=N<>>64-b);var w=o[e[I]];w.high=u,w.low=F}var m=o[0],H=a[0];m.high=H.high,m.low=H.low;for(var S=0;S<5;S++)for(var y=0;y<5;y++){var I=S+5*y,A=a[I],X=o[I],O=o[(S+1)%5+5*y],G=o[(S+2)%5+5*y];A.high=X.high^~O.high&G.high,A.low=X.low^~O.low&G.low}var A=a[0],W=f[_];A.high^=W.high,A.low^=W.low}},_doFinalize:function(){var s=this._data,l=s.words;this._nDataBytes*8;var a=s.sigBytes*8,n=this.blockSize*32;l[a>>>5]|=1<<24-a%32,l[(x.ceil((a+1)/n)*n>>>5)-1]|=128,s.sigBytes=l.length*4,this._process();for(var i=this._state,p=this.cfg.outputLength/8,C=p/8,A=[],_=0;_>>24)&16711935|(u<<24|u>>>8)&4278255360,F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,A.push(F),A.push(u)}return new g.init(A,p)},clone:function(){for(var s=v.clone.call(this),l=s._state=this._state.slice(0),a=0;a<25;a++)l[a]=l[a].clone();return s}});D.SHA3=v._createHelper(c),D.HmacSHA3=v._createHmacHelper(c)})(Math),h.SHA3})})(m0)),m0.exports}var S0={exports:{}},Xx=S0.exports,mr;function Ux(){return mr||(mr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Xx,function(h){return(function(x){var D=h,E=D.lib,g=E.WordArray,v=E.Hasher,d=D.algo,r=g.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),t=g.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),B=g.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),e=g.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=g.create([0,1518500249,1859775393,2400959708,2840853838]),o=g.create([1352829926,1548603684,1836072691,2053994217,0]),c=d.RIPEMD160=v.extend({_doReset:function(){this._hash=g.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(C,A){for(var _=0;_<16;_++){var S=A+_,u=C[S];C[S]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}var F=this._hash.words,y=f.words,k=o.words,z=r.words,q=t.words,P=B.words,K=e.words,I,N,T,b,w,m,H,X,O,G;m=I=F[0],H=N=F[1],X=T=F[2],O=b=F[3],G=w=F[4];for(var W,_=0;_<80;_+=1)W=I+C[A+z[_]]|0,_<16?W+=s(N,T,b)+y[0]:_<32?W+=l(N,T,b)+y[1]:_<48?W+=a(N,T,b)+y[2]:_<64?W+=n(N,T,b)+y[3]:W+=i(N,T,b)+y[4],W=W|0,W=p(W,P[_]),W=W+w|0,I=w,w=b,b=p(T,10),T=N,N=W,W=m+C[A+q[_]]|0,_<16?W+=i(H,X,O)+k[0]:_<32?W+=n(H,X,O)+k[1]:_<48?W+=a(H,X,O)+k[2]:_<64?W+=l(H,X,O)+k[3]:W+=s(H,X,O)+k[4],W=W|0,W=p(W,K[_]),W=W+G|0,m=G,G=O,O=p(X,10),X=H,H=W;W=F[1]+T+O|0,F[1]=F[2]+b+G|0,F[2]=F[3]+w+m|0,F[3]=F[4]+I+H|0,F[4]=F[0]+N+X|0,F[0]=W},_doFinalize:function(){var C=this._data,A=C.words,_=this._nDataBytes*8,S=C.sigBytes*8;A[S>>>5]|=128<<24-S%32,A[(S+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,C.sigBytes=(A.length+1)*4,this._process();for(var u=this._hash,F=u.words,y=0;y<5;y++){var k=F[y];F[y]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return u},clone:function(){var C=v.clone.call(this);return C._hash=this._hash.clone(),C}});function s(C,A,_){return C^A^_}function l(C,A,_){return C&A|~C&_}function a(C,A,_){return(C|~A)^_}function n(C,A,_){return C&_|A&~_}function i(C,A,_){return C^(A|~_)}function p(C,A){return C<>>32-A}D.RIPEMD160=v._createHelper(c),D.HmacRIPEMD160=v._createHmacHelper(c)})(),h.RIPEMD160})})(S0)),S0.exports}var R0={exports:{}},Gx=R0.exports,Sr;function ar(){return Sr||(Sr=1,(function(R,$){(function(h,x){R.exports=x(L())})(Gx,function(h){(function(){var x=h,D=x.lib,E=D.Base,g=x.enc,v=g.Utf8,d=x.algo;d.HMAC=E.extend({init:function(r,t){r=this._hasher=new r.init,typeof t=="string"&&(t=v.parse(t));var B=r.blockSize,e=B*4;t.sigBytes>e&&(t=r.finalize(t)),t.clamp();for(var f=this._oKey=t.clone(),o=this._iKey=t.clone(),c=f.words,s=o.words,l=0;l>>2]&255;u.sigBytes-=F}};E.BlockCipher=f.extend({cfg:f.cfg.extend({mode:s,padding:a}),reset:function(){var u;f.reset.call(this);var F=this.cfg,y=F.iv,k=F.mode;this._xformMode==this._ENC_XFORM_MODE?u=k.createEncryptor:(u=k.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==u?this._mode.init(this,y&&y.words):(this._mode=u.call(k,this,y&&y.words),this._mode.__creator=u)},_doProcessBlock:function(u,F){this._mode.processBlock(u,F)},_doFinalize:function(){var u,F=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(F.pad(this._data,this.blockSize),u=this._process(!0)):(u=this._process(!0),F.unpad(u)),u},blockSize:128/32});var n=E.CipherParams=g.extend({init:function(u){this.mixIn(u)},toString:function(u){return(u||this.formatter).stringify(this)}}),i=D.format={},p=i.OpenSSL={stringify:function(u){var F,y=u.ciphertext,k=u.salt;return k?F=v.create([1398893684,1701076831]).concat(k).concat(y):F=y,F.toString(t)},parse:function(u){var F,y=t.parse(u),k=y.words;return k[0]==1398893684&&k[1]==1701076831&&(F=v.create(k.slice(2,4)),k.splice(0,4),y.sigBytes-=16),n.create({ciphertext:y,salt:F})}},C=E.SerializableCipher=g.extend({cfg:g.extend({format:p}),encrypt:function(u,F,y,k){k=this.cfg.extend(k);var z=u.createEncryptor(y,k),q=z.finalize(F),P=z.cfg;return n.create({ciphertext:q,key:y,iv:P.iv,algorithm:u,mode:P.mode,padding:P.padding,blockSize:u.blockSize,formatter:k.format})},decrypt:function(u,F,y,k){k=this.cfg.extend(k),F=this._parse(F,k.format);var z=u.createDecryptor(y,k).finalize(F.ciphertext);return z},_parse:function(u,F){return typeof u=="string"?F.parse(u,this):u}}),A=D.kdf={},_=A.OpenSSL={execute:function(u,F,y,k,z){if(k||(k=v.random(64/8)),z)var q=e.create({keySize:F+y,hasher:z}).compute(u,k);else var q=e.create({keySize:F+y}).compute(u,k);var P=v.create(q.words.slice(F),y*4);return q.sigBytes=F*4,n.create({key:q,iv:P,salt:k})}},S=E.PasswordBasedCipher=C.extend({cfg:C.cfg.extend({kdf:_}),encrypt:function(u,F,y,k){k=this.cfg.extend(k);var z=k.kdf.execute(y,u.keySize,u.ivSize,k.salt,k.hasher);k.iv=z.iv;var q=C.encrypt.call(this,u,F,z.key,k);return q.mixIn(z),q},decrypt:function(u,F,y,k){k=this.cfg.extend(k),F=this._parse(F,k.format);var z=k.kdf.execute(y,u.keySize,u.ivSize,F.salt,k.hasher);k.iv=z.iv;var q=C.decrypt.call(this,u,F,z.key,k);return q}})})()})})($0)),$0.exports}var P0={exports:{}},jx=P0.exports,$r;function Vx(){return $r||($r=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(jx,function(h){return h.mode.CFB=(function(){var x=h.lib.BlockCipherMode.extend();x.Encryptor=x.extend({processBlock:function(E,g){var v=this._cipher,d=v.blockSize;D.call(this,E,g,d,v),this._prevBlock=E.slice(g,g+d)}}),x.Decryptor=x.extend({processBlock:function(E,g){var v=this._cipher,d=v.blockSize,r=E.slice(g,g+d);D.call(this,E,g,d,v),this._prevBlock=r}});function D(E,g,v,d){var r,t=this._iv;t?(r=t.slice(0),this._iv=void 0):r=this._prevBlock,d.encryptBlock(r,0);for(var B=0;B>24&255)===255){var d=v>>16&255,r=v>>8&255,t=v&255;d===255?(d=0,r===255?(r=0,t===255?t=0:++t):++r):++d,v=0,v+=d<<16,v+=r<<8,v+=t}else v+=1<<24;return v}function E(v){return(v[0]=D(v[0]))===0&&(v[1]=D(v[1])),v}var g=x.Encryptor=x.extend({processBlock:function(v,d){var r=this._cipher,t=r.blockSize,B=this._iv,e=this._counter;B&&(e=this._counter=B.slice(0),this._iv=void 0),E(e);var f=e.slice(0);r.encryptBlock(f,0);for(var o=0;o>>2]|=v<<24-d%4*8,x.sigBytes+=v},unpad:function(x){var D=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=D}},h.pad.Ansix923})})(N0)),N0.exports}var O0={exports:{}},fe=O0.exports,Nr;function ce(){return Nr||(Nr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(fe,function(h){return h.pad.Iso10126={pad:function(x,D){var E=D*4,g=E-x.sigBytes%E;x.concat(h.lib.WordArray.random(g-1)).concat(h.lib.WordArray.create([g<<24],1))},unpad:function(x){var D=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=D}},h.pad.Iso10126})})(O0)),O0.exports}var K0={exports:{}},ve=K0.exports,Or;function ue(){return Or||(Or=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(ve,function(h){return h.pad.Iso97971={pad:function(x,D){x.concat(h.lib.WordArray.create([2147483648],1)),h.pad.ZeroPadding.pad(x,D)},unpad:function(x){h.pad.ZeroPadding.unpad(x),x.sigBytes--}},h.pad.Iso97971})})(K0)),K0.exports}var X0={exports:{}},de=X0.exports,Kr;function Be(){return Kr||(Kr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(de,function(h){return h.pad.ZeroPadding={pad:function(x,D){var E=D*4;x.clamp(),x.sigBytes+=E-(x.sigBytes%E||E)},unpad:function(x){for(var D=x.words,E=x.sigBytes-1,E=x.sigBytes-1;E>=0;E--)if(D[E>>>2]>>>24-E%4*8&255){x.sigBytes=E+1;break}}},h.pad.ZeroPadding})})(X0)),X0.exports}var U0={exports:{}},he=U0.exports,Xr;function le(){return Xr||(Xr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(he,function(h){return h.pad.NoPadding={pad:function(){},unpad:function(){}},h.pad.NoPadding})})(U0)),U0.exports}var G0={exports:{}},Ce=G0.exports,Ur;function pe(){return Ur||(Ur=1,(function(R,$){(function(h,x,D){R.exports=x(L(),U())})(Ce,function(h){return(function(x){var D=h,E=D.lib,g=E.CipherParams,v=D.enc,d=v.Hex,r=D.format;r.Hex={stringify:function(t){return t.ciphertext.toString(d)},parse:function(t){var B=d.parse(t);return g.create({ciphertext:B})}}})(),h.format.Hex})})(G0)),G0.exports}var Z0={exports:{}},Ee=Z0.exports,Gr;function Ae(){return Gr||(Gr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(Ee,function(h){return(function(){var x=h,D=x.lib,E=D.BlockCipher,g=x.algo,v=[],d=[],r=[],t=[],B=[],e=[],f=[],o=[],c=[],s=[];(function(){for(var n=[],i=0;i<256;i++)i<128?n[i]=i<<1:n[i]=i<<1^283;for(var p=0,C=0,i=0;i<256;i++){var A=C^C<<1^C<<2^C<<3^C<<4;A=A>>>8^A&255^99,v[p]=A,d[A]=p;var _=n[p],S=n[_],u=n[S],F=n[A]*257^A*16843008;r[p]=F<<24|F>>>8,t[p]=F<<16|F>>>16,B[p]=F<<8|F>>>24,e[p]=F;var F=u*16843009^S*65537^_*257^p*16843008;f[A]=F<<24|F>>>8,o[A]=F<<16|F>>>16,c[A]=F<<8|F>>>24,s[A]=F,p?(p=_^n[n[n[u^_]]],C^=n[n[C]]):p=C=1}})();var l=[0,1,2,4,8,16,32,64,128,27,54],a=g.AES=E.extend({_doReset:function(){var n;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var i=this._keyPriorReset=this._key,p=i.words,C=i.sigBytes/4,A=this._nRounds=C+6,_=(A+1)*4,S=this._keySchedule=[],u=0;u<_;u++)u6&&u%C==4&&(n=v[n>>>24]<<24|v[n>>>16&255]<<16|v[n>>>8&255]<<8|v[n&255]):(n=n<<8|n>>>24,n=v[n>>>24]<<24|v[n>>>16&255]<<16|v[n>>>8&255]<<8|v[n&255],n^=l[u/C|0]<<24),S[u]=S[u-C]^n);for(var F=this._invKeySchedule=[],y=0;y<_;y++){var u=_-y;if(y%4)var n=S[u];else var n=S[u-4];y<4||u<=4?F[y]=n:F[y]=f[v[n>>>24]]^o[v[n>>>16&255]]^c[v[n>>>8&255]]^s[v[n&255]]}}},encryptBlock:function(n,i){this._doCryptBlock(n,i,this._keySchedule,r,t,B,e,v)},decryptBlock:function(n,i){var p=n[i+1];n[i+1]=n[i+3],n[i+3]=p,this._doCryptBlock(n,i,this._invKeySchedule,f,o,c,s,d);var p=n[i+1];n[i+1]=n[i+3],n[i+3]=p},_doCryptBlock:function(n,i,p,C,A,_,S,u){for(var F=this._nRounds,y=n[i]^p[0],k=n[i+1]^p[1],z=n[i+2]^p[2],q=n[i+3]^p[3],P=4,K=1;K>>24]^A[k>>>16&255]^_[z>>>8&255]^S[q&255]^p[P++],N=C[k>>>24]^A[z>>>16&255]^_[q>>>8&255]^S[y&255]^p[P++],T=C[z>>>24]^A[q>>>16&255]^_[y>>>8&255]^S[k&255]^p[P++],b=C[q>>>24]^A[y>>>16&255]^_[k>>>8&255]^S[z&255]^p[P++];y=I,k=N,z=T,q=b}var I=(u[y>>>24]<<24|u[k>>>16&255]<<16|u[z>>>8&255]<<8|u[q&255])^p[P++],N=(u[k>>>24]<<24|u[z>>>16&255]<<16|u[q>>>8&255]<<8|u[y&255])^p[P++],T=(u[z>>>24]<<24|u[q>>>16&255]<<16|u[y>>>8&255]<<8|u[k&255])^p[P++],b=(u[q>>>24]<<24|u[y>>>16&255]<<16|u[k>>>8&255]<<8|u[z&255])^p[P++];n[i]=I,n[i+1]=N,n[i+2]=T,n[i+3]=b},keySize:256/32});x.AES=E._createHelper(a)})(),h.AES})})(Z0)),Z0.exports}var Q0={exports:{}},Fe=Q0.exports,Zr;function De(){return Zr||(Zr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(Fe,function(h){return(function(){var x=h,D=x.lib,E=D.WordArray,g=D.BlockCipher,v=x.algo,d=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],r=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],t=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],B=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],e=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=v.DES=g.extend({_doReset:function(){for(var l=this._key,a=l.words,n=[],i=0;i<56;i++){var p=d[i]-1;n[i]=a[p>>>5]>>>31-p%32&1}for(var C=this._subKeys=[],A=0;A<16;A++){for(var _=C[A]=[],S=t[A],i=0;i<24;i++)_[i/6|0]|=n[(r[i]-1+S)%28]<<31-i%6,_[4+(i/6|0)]|=n[28+(r[i+24]-1+S)%28]<<31-i%6;_[0]=_[0]<<1|_[0]>>>31;for(var i=1;i<7;i++)_[i]=_[i]>>>(i-1)*4+3;_[7]=_[7]<<5|_[7]>>>27}for(var u=this._invSubKeys=[],i=0;i<16;i++)u[i]=C[15-i]},encryptBlock:function(l,a){this._doCryptBlock(l,a,this._subKeys)},decryptBlock:function(l,a){this._doCryptBlock(l,a,this._invSubKeys)},_doCryptBlock:function(l,a,n){this._lBlock=l[a],this._rBlock=l[a+1],o.call(this,4,252645135),o.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),o.call(this,1,1431655765);for(var i=0;i<16;i++){for(var p=n[i],C=this._lBlock,A=this._rBlock,_=0,S=0;S<8;S++)_|=B[S][((A^p[S])&e[S])>>>0];this._lBlock=A,this._rBlock=C^_}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,o.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),o.call(this,16,65535),o.call(this,4,252645135),l[a]=this._lBlock,l[a+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function o(l,a){var n=(this._lBlock>>>l^this._rBlock)&a;this._rBlock^=n,this._lBlock^=n<>>l^this._lBlock)&a;this._lBlock^=n,this._rBlock^=n<192.");var n=a.slice(0,2),i=a.length<4?a.slice(0,2):a.slice(2,4),p=a.length<6?a.slice(0,2):a.slice(4,6);this._des1=f.createEncryptor(E.create(n)),this._des2=f.createEncryptor(E.create(i)),this._des3=f.createEncryptor(E.create(p))},encryptBlock:function(l,a){this._des1.encryptBlock(l,a),this._des2.decryptBlock(l,a),this._des3.encryptBlock(l,a)},decryptBlock:function(l,a){this._des3.decryptBlock(l,a),this._des2.encryptBlock(l,a),this._des1.decryptBlock(l,a)},keySize:192/32,ivSize:64/32,blockSize:64/32});x.TripleDES=g._createHelper(s)})(),h.TripleDES})})(Q0)),Q0.exports}var Y0={exports:{}},_e=Y0.exports,Qr;function be(){return Qr||(Qr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(_e,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=g.RC4=E.extend({_doReset:function(){for(var t=this._key,B=t.words,e=t.sigBytes,f=this._S=[],o=0;o<256;o++)f[o]=o;for(var o=0,c=0;o<256;o++){var s=o%e,l=B[s>>>2]>>>24-s%4*8&255;c=(c+f[o]+l)%256;var a=f[o];f[o]=f[c],f[c]=a}this._i=this._j=0},_doProcessBlock:function(t,B){t[B]^=d.call(this)},keySize:256/32,ivSize:0});function d(){for(var t=this._S,B=this._i,e=this._j,f=0,o=0;o<4;o++){B=(B+1)%256,e=(e+t[B])%256;var c=t[B];t[B]=t[e],t[e]=c,f|=t[(t[B]+t[e])%256]<<24-o*8}return this._i=B,this._j=e,f}x.RC4=E._createHelper(v);var r=g.RC4Drop=v.extend({cfg:v.cfg.extend({drop:192}),_doReset:function(){v._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)d.call(this)}});x.RC4Drop=E._createHelper(r)})(),h.RC4})})(Y0)),Y0.exports}var M0={exports:{}},ge=M0.exports,Yr;function ye(){return Yr||(Yr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(ge,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=[],d=[],r=[],t=g.Rabbit=E.extend({_doReset:function(){for(var e=this._key.words,f=this.cfg.iv,o=0;o<4;o++)e[o]=(e[o]<<8|e[o]>>>24)&16711935|(e[o]<<24|e[o]>>>8)&4278255360;var c=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],s=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var o=0;o<4;o++)B.call(this);for(var o=0;o<8;o++)s[o]^=c[o+4&7];if(f){var l=f.words,a=l[0],n=l[1],i=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,p=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,C=i>>>16|p&4294901760,A=p<<16|i&65535;s[0]^=i,s[1]^=C,s[2]^=p,s[3]^=A,s[4]^=i,s[5]^=C,s[6]^=p,s[7]^=A;for(var o=0;o<4;o++)B.call(this)}},_doProcessBlock:function(e,f){var o=this._X;B.call(this),v[0]=o[0]^o[5]>>>16^o[3]<<16,v[1]=o[2]^o[7]>>>16^o[5]<<16,v[2]=o[4]^o[1]>>>16^o[7]<<16,v[3]=o[6]^o[3]>>>16^o[1]<<16;for(var c=0;c<4;c++)v[c]=(v[c]<<8|v[c]>>>24)&16711935|(v[c]<<24|v[c]>>>8)&4278255360,e[f+c]^=v[c]},blockSize:128/32,ivSize:64/32});function B(){for(var e=this._X,f=this._C,o=0;o<8;o++)d[o]=f[o];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var o=0;o<8;o++){var c=e[o]+f[o],s=c&65535,l=c>>>16,a=((s*s>>>17)+s*l>>>15)+l*l,n=((c&4294901760)*c|0)+((c&65535)*c|0);r[o]=a^n}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}x.Rabbit=E._createHelper(t)})(),h.Rabbit})})(M0)),M0.exports}var j0={exports:{}},ke=j0.exports,Mr;function He(){return Mr||(Mr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(ke,function(h){return(function(){var x=h,D=x.lib,E=D.StreamCipher,g=x.algo,v=[],d=[],r=[],t=g.RabbitLegacy=E.extend({_doReset:function(){var e=this._key.words,f=this.cfg.iv,o=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],c=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var s=0;s<4;s++)B.call(this);for(var s=0;s<8;s++)c[s]^=o[s+4&7];if(f){var l=f.words,a=l[0],n=l[1],i=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,p=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,C=i>>>16|p&4294901760,A=p<<16|i&65535;c[0]^=i,c[1]^=C,c[2]^=p,c[3]^=A,c[4]^=i,c[5]^=C,c[6]^=p,c[7]^=A;for(var s=0;s<4;s++)B.call(this)}},_doProcessBlock:function(e,f){var o=this._X;B.call(this),v[0]=o[0]^o[5]>>>16^o[3]<<16,v[1]=o[2]^o[7]>>>16^o[5]<<16,v[2]=o[4]^o[1]>>>16^o[7]<<16,v[3]=o[6]^o[3]>>>16^o[1]<<16;for(var c=0;c<4;c++)v[c]=(v[c]<<8|v[c]>>>24)&16711935|(v[c]<<24|v[c]>>>8)&4278255360,e[f+c]^=v[c]},blockSize:128/32,ivSize:64/32});function B(){for(var e=this._X,f=this._C,o=0;o<8;o++)d[o]=f[o];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var o=0;o<8;o++){var c=e[o]+f[o],s=c&65535,l=c>>>16,a=((s*s>>>17)+s*l>>>15)+l*l,n=((c&4294901760)*c|0)+((c&65535)*c|0);r[o]=a^n}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}x.RabbitLegacy=E._createHelper(t)})(),h.RabbitLegacy})})(j0)),j0.exports}var V0={exports:{}},we=V0.exports,jr;function me(){return jr||(jr=1,(function(R,$){(function(h,x,D){R.exports=x(L(),e0(),t0(),x0(),U())})(we,function(h){return(function(){var x=h,D=x.lib,E=D.BlockCipher,g=x.algo;const v=16,d=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],r=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var t={pbox:[],sbox:[]};function B(s,l){let a=l>>24&255,n=l>>16&255,i=l>>8&255,p=l&255,C=s.sbox[0][a]+s.sbox[1][n];return C=C^s.sbox[2][i],C=C+s.sbox[3][p],C}function e(s,l,a){let n=l,i=a,p;for(let C=0;C1;--C)n=n^s.pbox[C],i=B(s,n)^i,p=n,n=i,i=p;return p=n,n=i,i=p,i=i^s.pbox[1],n=n^s.pbox[0],{left:n,right:i}}function o(s,l,a){for(let A=0;A<4;A++){s.sbox[A]=[];for(let _=0;_<256;_++)s.sbox[A][_]=r[A][_]}let n=0;for(let A=0;A=a&&(n=0);let i=0,p=0,C=0;for(let A=0;A{g!==x.props.value&&(g=x.props.value,E(x.props.value,x.props.secret,x.props.storage_key),x.dispatch("change"))}),Ax(()=>{D()}),Fx()}export{Ie as default}; diff --git a/assets/Index-BFeI9nh0.js b/assets/Index-DfRY-DgY.js similarity index 96% rename from assets/Index-BFeI9nh0.js rename to assets/Index-DfRY-DgY.js index 3c5d6112c64d57e4a85789c0f839e6a6e5928e43..49ec212baf2512d32bf87879a065af3cadd4bd5a 100644 --- a/assets/Index-BFeI9nh0.js +++ b/assets/Index-DfRY-DgY.js @@ -1 +1 @@ -import{F as _t,p as g,e as Re,s as Pe,d as ve,b as ze,f as Xe,l as He,c as ft,S as mt,C as pt,i as te,u as vt,t as bt,G as wt,r as yt,g as Ve}from"./i18n-CPHyzK9b.js";import{M as we,a7 as Fe,Z as l,Y as be,x as S,_ as Ge,U as tt,au as xt,Q as se,T as ie,S as H,a5 as zt,$ as D,t as Me,a as j,O as ye,a0 as O,P as _,R as Z,a1 as Ce,G as Ne,V as Yt,N as re,v as T,ad as N,a3 as pe,aa as Ae,a2 as de}from"./index-DydPgVMC.js";import{b as qe}from"./size-D4lmUoTq.js";import{s as Te}from"./select-BigU4G0v.js";import{d as Xt}from"./dispatch-kxCwF96_.js";import{I as Ee}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as rt}from"./BlockLabel-BzVeVrtL.js";import{D as nt}from"./DownloadLink-DM2QmhDx.js";import{E as st}from"./Empty-B15ItVsj.js";import{C as it}from"./Clear-BR8cTgGu.js";import{D as at}from"./Download-DWSaBiea.js";import{I as Ie}from"./Image-DBmW1mOo.js";import{U as Mt}from"./Undo-B9SlrYtT.js";import{I as Et}from"./IconButtonWrapper-PnNNNvqI.js";import{F as Tt}from"./FullscreenButton-BuyUU5Yj.js";import{r as Dt,l as Rt}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{i as Je,S as Ze}from"./index-CfM_uZQa.js";import{b as xe}from"./misc-Dkc5KZ-v.js";import{U as Ke}from"./Upload-Bq9KuxCu.js";import{B as Qe}from"./Block-WPcVj6Bq.js";import{U as kt}from"./UploadText-CYQRFBCv.js";import"./snippet-BtHMuX3s.js";import"./Maximize-DWbY8BRa.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./actions-4RaHFoGI.js";function St(s){return s}function Oe(s,e){if(s===e||s!==s)return()=>s;const t=typeof s;if(t!==typeof e||Array.isArray(s)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(s)){const n=e.map((a,r)=>Oe(s[r],a));return a=>n.map(r=>r(a))}if(t==="object"){if(!s||!e)throw new Error("Object cannot be null");if(Je(s)&&Je(e)){const r=s.getTime(),o=e.getTime()-r;return f=>new Date(r+f*o)}const n=Object.keys(e),a={};return n.forEach(r=>{a[r]=Oe(s[r],e[r])}),r=>{const u={};return n.forEach(o=>{u[o]=a[o](r)}),u}}if(t==="number"){const n=e-s;return a=>s+a*n}return()=>e}function Pt(s,e={}){const t=_t(s);let n,a=s;function r(u,o){if(a=u,s==null)return t.set(s=u),Promise.resolve();let f=n,M=!1,{delay:x=0,duration:z=400,easing:w=St,interpolate:P=Oe}={...e,...o};if(z===0)return f&&(f.abort(),f=null),t.set(s=a),Promise.resolve();const C=Dt.now()+x;let c;return n=Rt(d=>{if(dz?(t.set(s=u),!1):(t.set(s=c(w(v/z))),!0)}),n.promise}return{set:r,update:(u,o)=>r(u(a,s),o),subscribe:t.subscribe}}function It(s){let e;for(;e=s.sourceEvent;)s=e;return s}function et(s,e){if(s=It(s),e===void 0&&(e=s.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var n=t.createSVGPoint();return n.x=s.clientX,n.y=s.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[s.clientX-a.left-e.clientLeft,s.clientY-a.top-e.clientTop]}}return[s.pageX,s.pageY]}const Lt={passive:!1},De={capture:!0,passive:!1};function je(s){s.stopImmediatePropagation()}function Ye(s){s.preventDefault(),s.stopImmediatePropagation()}function Ct(s){var e=s.document.documentElement,t=Te(s).on("dragstart.drag",Ye,De);"onselectstart"in e?t.on("selectstart.drag",Ye,De):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Bt(s,e){var t=s.document.documentElement,n=Te(s).on("dragstart.drag",null);e&&(n.on("click.drag",Ye,De),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in t?n.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const Se=s=>()=>s;function $e(s,{sourceEvent:e,subject:t,target:n,identifier:a,active:r,x:u,y:o,dx:f,dy:M,dispatch:x}){Object.defineProperties(this,{type:{value:s,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:M,enumerable:!0,configurable:!0},_:{value:x}})}$e.prototype.on=function(){var s=this._.on.apply(this._,arguments);return s===this._?this:s};function Ut(s){return!s.ctrlKey&&!s.button}function Wt(){return this.parentNode}function At(s,e){return e??{x:s.x,y:s.y}}function jt(){return navigator.maxTouchPoints||"ontouchstart"in this}function qt(){var s=Ut,e=Wt,t=At,n=jt,a={},r=Xt("start","drag","end"),u=0,o,f,M,x,z=0;function w(i){i.on("mousedown.drag",P).filter(n).on("touchstart.drag",d).on("touchmove.drag",v,Lt).on("touchend.drag touchcancel.drag",B).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function P(i,y){if(!(x||!s.call(this,i,y))){var Y=q(this,e.call(this,i,y),i,y,"mouse");Y&&(Te(i.view).on("mousemove.drag",C,De).on("mouseup.drag",c,De),Ct(i.view),je(i),M=!1,o=i.clientX,f=i.clientY,Y("start",i))}}function C(i){if(Ye(i),!M){var y=i.clientX-o,Y=i.clientY-f;M=y*y+Y*Y>z}a.mouse("drag",i)}function c(i){Te(i.view).on("mousemove.drag mouseup.drag",null),Bt(i.view,M),Ye(i),a.mouse("end",i)}function d(i,y){if(s.call(this,i,y)){var Y=i.changedTouches,X=e.call(this,i,y),R=Y.length,L,p;for(L=0;L
            ');function lt(s,e){we(e,!1);function t(b,h,W){return Math.min(Math.max(b,h),W)}let n=g(e,"position",12,.5),a=g(e,"disabled",12,!1),r=g(e,"slider_color",12,"var(--border-color-primary)"),u=g(e,"image_size",28,()=>({top:0,left:0,width:0,height:0})),o=g(e,"el",12,void 0),f=g(e,"parent_el",12,void 0),M=O(),x=O(0),z=O(!1),w=0;function P(b){w=f()?.getBoundingClientRect().width||0,b===0&&u(u().width=o()?.getBoundingClientRect().width||0,!0),D(x,t(u().width*n()+u().left,0,w))}function C(b,h){const W=Math.pow(10,h);return Math.round((b+Number.EPSILON)*W)/W}function c(b){D(x,t(b,0,w)),n(C((b-u().left)/u().width,5))}function d(b){a()||(D(z,!0),c(b.x))}function v(b){a()||c(b.x)}function B(){a()||D(z,!1)}function q(b){D(x,t(u().width*b+u().left,0,w))}Fe(()=>{P(u().width);const b=qt().on("start",d).on("drag",v).on("end",B);Te(l(M)).call(b)}),be(()=>S(u()),()=>{P(u().width)}),be(()=>S(n()),()=>{q(n())}),Ge();var i={get position(){return n()},set position(b){n(b),_()},get disabled(){return a()},set disabled(b){a(b),_()},get slider_color(){return r()},set slider_color(b){r(b),_()},get image_size(){return u()},set image_size(b){u(b),_()},get el(){return o()},set el(b){o(b),_()},get parent_el(){return f()},set parent_el(b){f(b),_()}};Re();var y=Ot();tt("resize",xt,()=>P(u().width));var Y=se(y),X=se(Y);Pe(X,e,"default",{}),ie(Y),ve(Y,b=>o(b),()=>o());var R=H(Y,2);let L;var p=se(R);let U;var K=H(se(p));let ae;zt(),ie(p);var $=H(p,2);let F;return ie(R),ve(R,b=>D(M,b),()=>l(M)),ie(y),ve(y,b=>f(b),()=>f()),Me(()=>{L=ze(R,1,"outer svelte-7q75nb",null,L,{disabled:a(),grab:l(z)}),Xe(R,`transform: translateX(${l(x)??""}px)`),U=ze(p,1,"icon-wrap svelte-7q75nb",null,U,{active:l(z),disabled:a()}),ae=Xe(K,"",ae,{"--color":r()}),F=Xe($,"",F,{"--color":r()})}),j(s,y),ye(i)}var $t=Z("");function Le(s,e){const t=He(e,["children","$$slots","$$events","$$legacy"]),n=He(t,["src","fullscreen","fixed","transform","img_el","hidden","variant","max_height"]);we(e,!1);let a=g(e,"src",12,void 0),r=g(e,"fullscreen",12,!1),u=g(e,"fixed",12,!1),o=g(e,"transform",12,"translate(0px, 0px) scale(1)"),f=g(e,"img_el",12,null),M=g(e,"hidden",12,!1),x=g(e,"variant",12,"upload"),z=g(e,"max_height",12,500);const w=Ce();function P(d){if(!d)return{top:0,left:0,width:0,height:0};const v=d.parentElement?.getBoundingClientRect();if(!v)return{top:0,left:0,width:0,height:0};const B=d.naturalWidth/d.naturalHeight,q=v.width/v.height;let i,y;B>q?(i=v.width,y=v.width/B):(y=v.height,i=v.height*B);const Y=(v.width-i)/2;return{top:(v.height-y)/2,left:Y,width:i,height:y}}Fe(()=>{const d=new ResizeObserver(async v=>{for(const B of v)await Ne(),w("load",P(f()))});return d.observe(f()),()=>{d.disconnect()}});var C={get src(){return a()},set src(d){a(d),_()},get fullscreen(){return r()},set fullscreen(d){r(d),_()},get fixed(){return u()},set fixed(d){u(d),_()},get transform(){return o()},set transform(d){o(d),_()},get img_el(){return f()},set img_el(d){f(d),_()},get hidden(){return M()},set hidden(d){M(d),_()},get variant(){return x()},set variant(d){x(d),_()},get max_height(){return z()},set max_height(d){z(d),_()}};Re();var c=$t();return ft(c,()=>({src:a(),"data-testid":"imageslider-image",...n,[pt]:{fixed:u(),hidden:M(),preview:x()==="preview",slider:x()==="upload",fullscreen:r(),small:!r()},[mt]:{transform:o(),"max-height":z()&&!r()?`${z()}px`:null}}),void 0,void 0,void 0,"svelte-7j19z4"),ve(c,d=>f(d),()=>f()),Yt(c),tt("load",c,()=>w("load",P(f()))),j(s,c),ye(C)}class Ft{container;image;scale;offsetX;offsetY;isDragging;lastX;lastY;initial_left_padding;initial_top_padding;initial_width;initial_height;subscribers;handleImageLoad;real_image_size={top:0,left:0,width:0,height:0};last_touch_distance;constructor(e,t){this.container=e,this.image=t,this.scale=1,this.offsetX=0,this.offsetY=0,this.isDragging=!1,this.lastX=0,this.lastY=0,this.initial_left_padding=0,this.initial_top_padding=0,this.initial_width=0,this.initial_height=0,this.subscribers=[],this.last_touch_distance=0,this.handleWheel=this.handleWheel.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleImageLoad=this.init.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.image.addEventListener("load",this.handleImageLoad),this.container.addEventListener("wheel",this.handleWheel),this.container.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.container.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("touchend",this.handleTouchEnd),new ResizeObserver(a=>{for(const r of a)r.target===this.container&&(this.handleResize(),this.get_image_size(this.image))}).observe(this.container)}handleResize(){this.init()}init(){const e=this.container.getBoundingClientRect(),t=this.image.getBoundingClientRect();this.initial_left_padding=t.left-e.left,this.initial_top_padding=t.top-e.top,this.initial_width=t.width,this.initial_height=t.height,this.reset_zoom(),this.updateTransform()}reset_zoom(){this.scale=1,this.offsetX=0,this.offsetY=0,this.updateTransform()}handleMouseDown(e){const t=this.image.getBoundingClientRect();if(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom){if(e.preventDefault(),this.scale===1)return;this.isDragging=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.image.style.cursor="grabbing"}}handleMouseMove(e){if(!this.isDragging)return;const t=e.clientX-this.lastX,n=e.clientY-this.lastY;this.offsetX+=t,this.offsetY+=n,this.lastX=e.clientX,this.lastY=e.clientY,this.updateTransform(),this.updateTransform()}handleMouseUp(){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1,this.image.style.cursor=this.scale>1?"grab":"zoom-in")}async handleWheel(e){e.preventDefault();const t=this.container.getBoundingClientRect(),n=this.image.getBoundingClientRect();if(e.clientXn.right||e.clientYn.bottom)return;const a=1.05,r=this.scale,u=-Math.sign(e.deltaY)>0?Math.min(15,r*a):Math.max(1,r/a);if(u===r)return;const o=e.clientX-t.left-this.initial_left_padding,f=e.clientY-t.top-this.initial_top_padding;this.scale=u,this.offsetX=this.compute_new_offset({cursor_position:o,current_offset:this.offsetX,new_scale:u,old_scale:r}),this.offsetY=this.compute_new_offset({cursor_position:f,current_offset:this.offsetY,new_scale:u,old_scale:r}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.image.style.cursor=this.scale>1?"grab":"zoom-in"}compute_new_position({position:e,scale:t,anchor_position:n}){return e-(e-n)*(t/this.scale)}compute_new_offset({cursor_position:e,current_offset:t,new_scale:n,old_scale:a}){return e-n/a*(e-t)}constrain_to_bounds(e=!1){if(this.scale===1){this.offsetX=0,this.offsetY=0;return}const t={top:this.real_image_size.top*this.scale+this.offsetY,left:this.real_image_size.left*this.scale+this.offsetX,width:this.real_image_size.width*this.scale,height:this.real_image_size.height*this.scale,bottom:this.real_image_size.top*this.scale+this.offsetY+this.real_image_size.height*this.scale,right:this.real_image_size.left*this.scale+this.offsetX+this.real_image_size.width*this.scale},n=this.real_image_size.left+this.real_image_size.width,a=this.real_image_size.top+this.real_image_size.height;e&&(t.top>this.real_image_size.top?this.offsetY=this.calculate_position(this.real_image_size.top,0,"y"):t.bottomthis.real_image_size.left?this.offsetX=this.calculate_position(this.real_image_size.left,0,"x"):t.rightt!==e)}notify({x:e,y:t,scale:n}){this.subscribers.forEach(a=>a({x:e,y:t,scale:n}))}handleTouchStart(e){e.preventDefault();const t=this.image.getBoundingClientRect(),n=e.touches[0];if(n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom){if(e.touches.length===1&&this.scale>1)this.isDragging=!0,this.lastX=n.clientX,this.lastY=n.clientY;else if(e.touches.length===2){const a=e.touches[0],r=e.touches[1];this.last_touch_distance=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)}}}get_image_size(e){if(!e)return;const t=e.parentElement?.getBoundingClientRect();if(!t)return;const n=e.naturalWidth/e.naturalHeight,a=t.width/t.height;let r,u;n>a?(r=t.width,u=t.width/n):(u=t.height,r=t.height*n);const o=(t.width-r)/2,f=(t.height-u)/2;this.real_image_size={top:f,left:o,width:r,height:u}}handleTouchMove(e){if(e.touches.length===1&&this.isDragging){e.preventDefault();const t=e.touches[0],n=t.clientX-this.lastX,a=t.clientY-this.lastY;this.offsetX+=n,this.offsetY+=a,this.lastX=t.clientX,this.lastY=t.clientY,this.updateTransform()}else if(e.touches.length===2){e.preventDefault();const t=e.touches[0],n=e.touches[1],a=Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY);if(this.last_touch_distance===0){this.last_touch_distance=a;return}const r=a/this.last_touch_distance,u=this.scale,o=Math.min(15,Math.max(1,u*r));if(o===u){this.last_touch_distance=a;return}const f=this.container.getBoundingClientRect(),M=(t.clientX+n.clientX)/2-f.left-this.initial_left_padding,x=(t.clientY+n.clientY)/2-f.top-this.initial_top_padding;this.scale=o,this.offsetX=this.compute_new_offset({cursor_position:M,current_offset:this.offsetX,new_scale:o,old_scale:u}),this.offsetY=this.compute_new_offset({cursor_position:x,current_offset:this.offsetY,new_scale:o,old_scale:u}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.last_touch_distance=a,this.image.style.cursor=this.scale>1?"grab":"zoom-in"}}handleTouchEnd(e){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1),e.touches.length===0&&(this.last_touch_distance=0)}calculate_position(e,t,n){if(this.container.getBoundingClientRect(),n==="x"){const a=e,r=this.real_image_size.left+t*this.real_image_size.width;return a-r*this.scale}if(n==="y"){const a=e,r=this.real_image_size.top+t*this.real_image_size.height;return a-r*this.scale}return 0}}var Gt=Z(" ",1),Nt=Z(" ",1),Ht=Z('
            '),Vt=Z(" ",1);function Jt(s,e){we(e,!1);const t=()=>vt(U,"$transform",n),[n,a]=bt(),r=O(),u=O();let o=g(e,"value",28,()=>[null,null]),f=g(e,"label",12,void 0),M=g(e,"show_download_button",12,!0),x=g(e,"show_label",12),z=g(e,"i18n",12),w=g(e,"position",12),P=g(e,"layer_images",12,!0),C=g(e,"show_single",12,!1),c=g(e,"slider_color",12),d=g(e,"show_fullscreen_button",12,!0),v=g(e,"fullscreen",12,!1),B=g(e,"buttons",12,null),q=g(e,"on_custom_button_click",12,null),i=g(e,"el_width",12,0),y=g(e,"max_height",12),Y=g(e,"interactive",12,!0);const X=Ce();let R=O(),L=O(),p=O(),U=Pt({x:0,y:0,z:1},{duration:75}),K=O();function ae(m,I,A,k,le,oe){return(m*A+k-le)/oe/I}let $=O(0),F=O(null),b=null;function h(m,I){!m||!I||(l(F)?.destroy(),b?.disconnect(),m?.getBoundingClientRect().width,D($,I?.getBoundingClientRect().width||0),D(F,new Ft(I,m)),l(F).subscribe(({x:A,y:k,scale:le})=>{U.set({x:A,y:k,z:le})}),b=new ResizeObserver(A=>{for(const k of A)k.target===I&&D($,k.contentRect.width),k.target===m&&k.contentRect.width}),b.observe(I),b.observe(m))}Fe(()=>()=>{l(F)?.destroy(),b?.disconnect()});let W=O(),G=O({top:0,left:0,width:0,height:0});function V(m){D(G,m.detail)}be(()=>(S(w()),l($),l(G),t()),()=>{D(r,ae(w(),l($),l(G).width,l(G).left,t().x,t().z))}),be(()=>(S(P()),l(r)),()=>{D(u,P()?`clip-path: inset(0 0 0 ${l(r)*100}%)`:"")}),be(()=>(l(R),l(L)),()=>{h(l(R),l(L))}),Ge();var he={get value(){return o()},set value(m){o(m),_()},get label(){return f()},set label(m){f(m),_()},get show_download_button(){return M()},set show_download_button(m){M(m),_()},get show_label(){return x()},set show_label(m){x(m),_()},get i18n(){return z()},set i18n(m){z(m),_()},get position(){return w()},set position(m){w(m),_()},get layer_images(){return P()},set layer_images(m){P(m),_()},get show_single(){return C()},set show_single(m){C(m),_()},get slider_color(){return c()},set slider_color(m){c(m),_()},get show_fullscreen_button(){return d()},set show_fullscreen_button(m){d(m),_()},get fullscreen(){return v()},set fullscreen(m){v(m),_()},get buttons(){return B()},set buttons(m){B(m),_()},get on_custom_button_click(){return q()},set on_custom_button_click(m){q(m),_()},get el_width(){return i()},set el_width(m){i(m),_()},get max_height(){return y()},set max_height(m){y(m),_()},get interactive(){return Y()},set interactive(m){Y(m),_()}};Re();var _e=Vt(),fe=re(_e);{let m=N(()=>(S(f()),S(z()),T(()=>f()||z()("image.image"))));rt(fe,{get show_label(){return x()},get Icon(){return Ie},get label(){return l(m)}})}var ke=H(fe,2);{var Be=m=>{st(m,{unpadded_box:!0,size:"large",children:(I,A)=>{Ie(I)},$$slots:{default:!0}})},Ue=m=>{var I=Ht(),A=se(I);Et(A,{get buttons(){return B()},get on_custom_button_click(){return q()},children:(E,ne)=>{var J=Gt(),Q=re(J);{let ee=N(()=>(S(z()),T(()=>z()("common.undo")))),ge=N(()=>(t(),T(()=>t().z===1)));Ee(Q,{get Icon(){return Mt},get label(){return l(ee)},get disabled(){return l(ge)},onclick:()=>l(F)?.reset_zoom()})}var ue=H(Q,2);{var ce=ee=>{Tt(ee,{get fullscreen(){return v()},onclick:ge=>{v(ge),X("fullscreen",ge)}})};te(ue,ee=>{d()&&ee(ce)})}var me=H(ue,2);{var ot=ee=>{{let ge=N(()=>(S(o()),T(()=>o()[1]?.url))),dt=N(()=>(S(o()),T(()=>o()[1]?.orig_name||"image")));nt(ee,{get href(){return l(ge)},get download(){return l(dt)},children:(ht,or)=>{{let gt=N(()=>(S(z()),T(()=>z()("common.download"))));Ee(ht,{get Icon(){return at},get label(){return l(gt)}})}},$$slots:{default:!0}})}};te(me,ee=>{M()&&ee(ot)})}var ut=H(me,2);{var ct=ee=>{Ee(ee,{get Icon(){return it},label:"Remove Image",onclick:ge=>{o([null,null]),X("clear"),ge.stopPropagation()}})};te(ut,ee=>{Y()&&ee(ct)})}j(E,J)},$$slots:{default:!0}});var k=H(A,2);let le;var oe=se(k);lt(oe,{get slider_color(){return c()},get image_size(){return l(G)},get position(){return w()},set position(E){w(E)},get el(){return l(L)},set el(E){D(L,E)},get parent_el(){return l(K)},set parent_el(E){D(K,E)},children:(E,ne)=>{var J=Nt(),Q=re(J);{let ce=N(()=>(S(o()),T(()=>o()?.[0]?.url)));Le(Q,{get src(){return l(ce)},alt:"",loading:"lazy",variant:"preview",get transform(){return`translate(${t(),T(()=>t().x)??""}px, ${t(),T(()=>t().y)??""}px) scale(${t(),T(()=>t().z)??""})`},get fullscreen(){return v()},get max_height(){return y()},get img_el(){return l(R)},set img_el(me){D(R,me)},$$events:{load:V},$$legacy:!0})}var ue=H(Q,2);{let ce=N(()=>(S(o()),T(()=>!o()?.[1]?.url))),me=N(()=>(S(o()),T(()=>o()?.[1]?.url)));Le(ue,{variant:"preview",get fixed(){return P()},get hidden(){return l(ce)},get src(){return l(me)},alt:"",loading:"lazy",get style(){return`${l(u)??""}; background: var(--block-background-fill);`},get transform(){return`translate(${t(),T(()=>t().x)??""}px, ${t(),T(()=>t().y)??""}px) scale(${t(),T(()=>t().z)??""})`},get fullscreen(){return v()},get max_height(){return y()},$$events:{load:V}})}j(E,J)},$$slots:{default:!0},$$legacy:!0}),ie(k),ve(k,E=>D(W,E),()=>l(W)),ie(I),ve(I,E=>D(p,E),()=>l(p)),Me(()=>le=ze(k,1,"slider-wrap svelte-19i1huv",null,le,{limit_height:!v()})),qe(k,"clientWidth",i),j(m,I)};te(ke,m=>{S(o()),S(C()),T(()=>(o()===null||o()[0]===null||o()[1]===null)&&!C())?m(Be):m(Ue,!1)})}j(s,_e);var We=ye(he);return a(),We}var Zt=Z('
            ');function Kt(s,e){we(e,!1);const t=Ce();Re();var n=Zt(),a=se(n);Ee(a,{get Icon(){return it},label:"Remove Image",onclick:r=>{t("remove_image"),r.stopPropagation()}}),ie(n),j(s,n),ye()}var Qt=Z('
            '),er=Z("
            "),tr=Z("
            "),rr=Z("
            "),nr=Z('
            ',1);function sr(s,e){we(e,!1);let t=g(e,"value",12),n=g(e,"label",12,void 0),a=g(e,"show_label",12),r=g(e,"root",12),u=g(e,"position",12),o=g(e,"upload_count",12,2),f=g(e,"show_download_button",12,!0),M=g(e,"slider_color",12),x=g(e,"upload",12),z=g(e,"stream_handler",12),w=g(e,"max_file_size",12,null),P=g(e,"i18n",12),C=g(e,"max_height",12),c=g(e,"upload_promise",12,null),d=O(t()||[null,null]),v=O(),B=O(),q=O();async function i(h,W){const G=[t()[0],t()[1]];h.length>1?G[W]=h[0]:G[W]=h[W],t(G),await Ne(),Y("upload",G)}let y=O("");const Y=Ce();let X=g(e,"dragging",12,!1);be(()=>(S(t()),l(y)),()=>{JSON.stringify(t())!==l(y)&&(D(y,JSON.stringify(t())),D(d,t()))}),be(()=>S(X()),()=>{Y("drag",X())}),Ge();var R={get value(){return t()},set value(h){t(h),_()},get label(){return n()},set label(h){n(h),_()},get show_label(){return a()},set show_label(h){a(h),_()},get root(){return r()},set root(h){r(h),_()},get position(){return u()},set position(h){u(h),_()},get upload_count(){return o()},set upload_count(h){o(h),_()},get show_download_button(){return f()},set show_download_button(h){f(h),_()},get slider_color(){return M()},set slider_color(h){M(h),_()},get upload(){return x()},set upload(h){x(h),_()},get stream_handler(){return z()},set stream_handler(h){z(h),_()},get max_file_size(){return w()},set max_file_size(h){w(h),_()},get i18n(){return P()},set i18n(h){P(h),_()},get max_height(){return C()},set max_height(h){C(h),_()},get upload_promise(){return c()},set upload_promise(h){c(h),_()},get dragging(){return X()},set dragging(h){X(h),_()}};Re();var L=nr(),p=re(L);{let h=N(()=>(S(n()),S(P()),T(()=>n()||P()("image.image"))));rt(p,{get show_label(){return a()},get Icon(){return Ie},get label(){return l(h)}})}var U=H(p,2),K=se(U);{var ae=h=>{Kt(h,{$$events:{remove_image:()=>{u(.5),t([null,null]),Y("clear")}}})};te(K,h=>{S(t()),T(()=>t()?.[0]?.url||t()?.[1]?.url)&&h(ae)})}var $=H(K,2);{var F=h=>{var W=Qt(),G=se(W);{var V=he=>{{let _e=N(()=>(S(t()),T(()=>t()[1].orig_name||"image")));nt(he,{get href(){return S(t()),T(()=>t()[1].url)},get download(){return l(_e)},children:(fe,ke)=>{Ee(fe,{get Icon(){return at}})},$$slots:{default:!0}})}};te(G,he=>{f()&&he(V)})}ie(W),j(h,W)};te($,h=>{S(t()),T(()=>t()?.[1]?.url)&&h(F)})}var b=H($,2);{let h=N(()=>(S(o()),S(t()),T(()=>o()==2||!t()?.[0])));lt(b,{get disabled(){return l(h)},get slider_color(){return M()},get position(){return u()},set position(W){u(W)},children:(W,G)=>{var V=rr();let he,_e;var fe=se(V);{var ke=I=>{var A=er();let k;var le=se(A);{let oe=N(()=>(S(t()),T(()=>!!t()?.[0])));Ke(le,{filetype:"image/*",onload:E=>i(E,0),get disable_click(){return l(oe)},get root(){return r()},file_count:"multiple",get upload(){return x()},get stream_handler(){return z()},get max_file_size(){return w()},get upload_promise(){return c()},set upload_promise(E){c(E)},get dragging(){return X()},set dragging(E){X(E)},children:(E,ne)=>{var J=pe(),Q=re(J);Pe(Q,e,"default",{}),j(E,J)},$$slots:{default:!0},$$legacy:!0})}ie(A),Me(()=>k=ze(A,1,"wrap svelte-6nrohp",null,k,{"half-wrap":o()===1})),j(I,A)},Be=I=>{{let A=N(()=>(l(d),T(()=>l(d)[0]?.url)));Le(I,{variant:"upload",get src(){return l(A)},alt:"",get max_height(){return C()},get img_el(){return l(v)},set img_el(k){D(v,k)},$$legacy:!0})}};te(fe,I=>{l(d),T(()=>!l(d)?.[0])?I(ke):I(Be,!1)})}var Ue=H(fe,2);{var We=I=>{{let A=N(()=>(S(t()),T(()=>!!t()?.[1])));Ke(I,{filetype:"image/*",onload:k=>i(k,1),get disable_click(){return l(A)},get root(){return r()},file_count:"multiple",get upload(){return x()},get stream_handler(){return z()},get max_file_size(){return w()},get upload_promise(){return c()},set upload_promise(k){c(k)},get dragging(){return X()},set dragging(k){X(k)},children:(k,le)=>{var oe=pe(),E=re(oe);Pe(E,e,"default",{}),j(k,oe)},$$slots:{default:!0},$$legacy:!0})}},m=I=>{var A=pe(),k=re(A);{var le=E=>{var ne=tr();let J,Q;var ue=se(ne);st(ue,{unpadded_box:!0,size:"large",children:(ce,me)=>{Ie(ce)},$$slots:{default:!0}}),ie(ne),Me(()=>{J=ze(ne,1,"empty-wrap fixed svelte-6nrohp",null,J,{"white-icon":!t()?.[0]?.url}),Q=Xe(ne,"",Q,{width:`${l(B)*(1-u())}px`,transform:`translateX(${l(B)*u()}px)`})}),j(E,ne)},oe=E=>{var ne=pe(),J=re(ne);{var Q=ue=>{{let ce=N(()=>o()===1);Le(ue,{variant:"upload",get src(){return l(d),T(()=>l(d)[1].url)},alt:"",get fixed(){return l(ce)},transform:"translate(0px, 0px) scale(1)",get max_height(){return C()}})}};te(J,ue=>{l(d),T(()=>l(d)?.[1])&&ue(Q)},!0)}j(E,ne)};te(k,E=>{l(d),S(o()),T(()=>!l(d)?.[1]&&o()===1)?E(le):E(oe,!1)},!0)}j(I,A)};te(Ue,I=>{l(d),S(o()),T(()=>!l(d)?.[1]&&o()===2)?I(We):I(m,!1)})}ie(V),Me(()=>{he=ze(V,1,"upload-wrap svelte-6nrohp",null,he,{"side-by-side":o()===2}),_e=Xe(V,"",_e,{display:o()===2?"flex":"block"})}),j(W,V)},$$slots:{default:!0},$$legacy:!0})}return ie(U),qe(U,"clientWidth",h=>D(B,h)),qe(U,"clientHeight",h=>D(q,h)),j(s,L),ye(R)}function ir(s,e){we(e,!1);let t=g(e,"value",28,()=>[null,null]),n=g(e,"upload",12),a=g(e,"stream_handler",12),r=g(e,"label",12),u=g(e,"show_label",12),o=g(e,"i18n",12),f=g(e,"root",12),M=g(e,"upload_count",12,1),x=g(e,"dragging",12),z=g(e,"max_height",12),w=g(e,"max_file_size",12,null),P=g(e,"upload_promise",12,null);var C={get value(){return t()},set value(c){t(c),_()},get upload(){return n()},set upload(c){n(c),_()},get stream_handler(){return a()},set stream_handler(c){a(c),_()},get label(){return r()},set label(c){r(c),_()},get show_label(){return u()},set show_label(c){u(c),_()},get i18n(){return o()},set i18n(c){o(c),_()},get root(){return f()},set root(c){f(c),_()},get upload_count(){return M()},set upload_count(c){M(c),_()},get dragging(){return x()},set dragging(c){x(c),_()},get max_height(){return z()},set max_height(c){z(c),_()},get max_file_size(){return w()},set max_file_size(c){w(c),_()},get upload_promise(){return P()},set upload_promise(c){P(c),_()}};return sr(s,{slider_color:"var(--border-color-primary)",position:.5,get root(){return f()},get label(){return r()},get show_label(){return u()},get upload_count(){return M()},get stream_handler(){return a()},get upload(){return n()},get max_file_size(){return w()},get max_height(){return z()},get i18n(){return o()},get upload_promise(){return P()},set upload_promise(c){P(c)},get value(){return t()},set value(c){t(c)},get dragging(){return x()},set dragging(c){x(c)},$$events:{edit(c){xe.call(this,e,c)},clear(c){xe.call(this,e,c)},stream(c){xe.call(this,e,c)},drag:({detail:c})=>x(c),upload(c){xe.call(this,e,c)},select(c){xe.call(this,e,c)},share(c){xe.call(this,e,c)}},children:(c,d)=>{var v=pe(),B=re(v);Pe(B,e,"default",{}),j(c,v)},$$slots:{default:!0},$$legacy:!0}),ye(C)}var ar=Z(" ",1),lr=Z(" ",1);function Lr(s,e){we(e,!0);let t=Ae(void 0);class n extends wt{async get_data(){return l(t)&&(await l(t),await Ne()),await super.get_data()}}const a=yt(e,["$$slots","$$events","$$legacy"]),r=new n(a);let u=Ae(!1),o=Ae(!1),f,M=de(()=>Math.max(0,Math.min(100,r.props.slider_position))/100);r.watch_for_change();const x=d=>{const v=d;v.preventDefault(),v.stopPropagation(),v.type==="dragenter"||v.type==="dragover"?D(o,!0):v.type==="dragleave"&&D(o,!1)},z=d=>{if(r.shared.interactive){const v=d;v.preventDefault(),v.stopPropagation(),D(o,!1),f&&f.loadFilesFromDrop(v)}};var w=pe(),P=re(w);{var C=d=>{{let v=de(()=>l(o)?"focus":"base"),B=de(()=>r.props.height||void 0);Qe(d,{get visible(){return r.shared.visible},variant:"solid",get border_mode(){return l(v)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l(B)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},get fullscreen(){return l(u)},set fullscreen(q){D(u,q,!0)},children:(q,i)=>{var y=ar(),Y=re(y);Ze(Y,Ve({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status));var X=H(Y,2);{let R=de(()=>r.props.buttons.some(p=>typeof p=="string"&&p==="download")),L=de(()=>r.props.buttons.some(p=>typeof p=="string"&&p==="fullscreen"));Jt(X,{get fullscreen(){return l(u)},get interactive(){return r.shared.interactive},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get show_download_button(){return l(R)},get i18n(){return r.i18n},get show_fullscreen_button(){return l(L)},get buttons(){return r.props.buttons},on_custom_button_click:p=>{r.dispatch("custom_button_click",{id:p})},get position(){return l(M)},get slider_color(){return r.props.slider_color},get max_height(){return r.props.max_height},get value(){return r.props.value},set value(p){r.props.value=p},$$events:{select:({detail:p})=>r.dispatch("select",p),share:({detail:p})=>r.dispatch("share",p),error:({detail:p})=>r.dispatch("error",p),clear:()=>{r.dispatch("clear"),r.dispatch("input")},fullscreen:({detail:p})=>{D(u,p,!0)}}})}j(q,y)},$$slots:{default:!0}})}},c=d=>{{let v=de(()=>r.props.value===null?"dashed":"solid"),B=de(()=>l(o)?"focus":"base"),q=de(()=>r.props.height||void 0);Qe(d,{get visible(){return r.shared.visible},get variant(){return l(v)},get border_mode(){return l(B)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l(q)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},$$events:{dragenter:x,dragleave:x,dragover:x,drop:z},children:(i,y)=>{var Y=lr(),X=re(Y);Ze(X,Ve({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status,{on_clear_status:()=>r.dispatch("clear_status",r.shared.loading_status)}));var R=H(X,2);{let L=de(()=>r.shared.client?.stream);ve(ir(R,{get root(){return r.shared.root},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get upload_count(){return r.props.upload_count},get max_file_size(){return r.shared.max_file_size},get i18n(){return r.i18n},upload:(...p)=>r.shared.client.upload(...p),get stream_handler(){return l(L)},get max_height(){return r.props.max_height},get upload_promise(){return l(t)},set upload_promise(p){D(t,p,!0)},get value(){return r.props.value},set value(p){r.props.value=p},get dragging(){return l(o)},set dragging(p){D(o,p,!0)},$$events:{edit:()=>r.dispatch("edit"),clear:()=>{r.dispatch("clear"),r.dispatch("input")},drag:({detail:p})=>D(o,p,!0),upload:()=>{r.dispatch("upload"),r.dispatch("input")},error:({detail:p})=>{r.shared.loading_status&&(r.shared.loading_status.status="error"),r.dispatch("error",p)},close_stream:()=>{r.dispatch("close_stream","stream")}},children:(p,U)=>{var K=pe(),ae=re(K);{var $=F=>{kt(F,{get i18n(){return r.i18n},type:"image",get placeholder(){return r.props.placeholder}})};te(ae,F=>{F($)})}j(p,K)},$$slots:{default:!0}}),p=>f=p,()=>f)}j(i,Y)},$$slots:{default:!0}})}};te(P,d=>{!r.shared.interactive||r.props.value?.[1]&&r.props.value?.[0]?d(C):d(c,!1)})}j(s,w),ye()}export{Lr as default}; +import{F as _t,p as g,e as Re,s as Pe,d as ve,b as ze,f as Xe,l as He,c as ft,S as mt,C as pt,i as te,u as vt,t as bt,G as wt,r as yt,g as Ve}from"./i18n-DtG3MAQ1.js";import{M as we,a7 as Fe,Z as l,Y as be,x as S,_ as Ge,U as tt,au as xt,Q as se,T as ie,S as H,a5 as zt,$ as D,t as Me,a as j,O as ye,a0 as O,P as _,R as Z,a1 as Ce,G as Ne,V as Yt,N as re,v as T,ad as N,a3 as pe,aa as Ae,a2 as de}from"./index-BeNBoC9J.js";import{b as qe}from"./size-ChvveZyb.js";import{s as Te}from"./select-BigU4G0v.js";import{d as Xt}from"./dispatch-kxCwF96_.js";import{I as Ee}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as rt}from"./BlockLabel-CEOjqpu7.js";import{D as nt}from"./DownloadLink-Dk6GrGSA.js";import{E as st}from"./Empty-Clj0ErcW.js";import{C as it}from"./Clear-BiKSVifk.js";import{D as at}from"./Download-0gCL6VXM.js";import{I as Ie}from"./Image-DWBzZYev.js";import{U as Mt}from"./Undo-Bu_OzfgD.js";import{I as Et}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as Tt}from"./FullscreenButton-CFl3IB4T.js";import{r as Dt,l as Rt}from"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{i as Je,S as Ze}from"./index-1YthqPsU.js";import{b as xe}from"./misc-D-Y84gKJ.js";import{U as Ke}from"./Upload-CGTpHDBO.js";import{B as Qe}from"./Block-DkzyQHli.js";import{U as kt}from"./UploadText-yqnlGa4o.js";import"./snippet-BRIBYCwB.js";import"./Maximize-DQMU3SdR.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./actions-BbCJS635.js";function St(s){return s}function Oe(s,e){if(s===e||s!==s)return()=>s;const t=typeof s;if(t!==typeof e||Array.isArray(s)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(s)){const n=e.map((a,r)=>Oe(s[r],a));return a=>n.map(r=>r(a))}if(t==="object"){if(!s||!e)throw new Error("Object cannot be null");if(Je(s)&&Je(e)){const r=s.getTime(),o=e.getTime()-r;return f=>new Date(r+f*o)}const n=Object.keys(e),a={};return n.forEach(r=>{a[r]=Oe(s[r],e[r])}),r=>{const u={};return n.forEach(o=>{u[o]=a[o](r)}),u}}if(t==="number"){const n=e-s;return a=>s+a*n}return()=>e}function Pt(s,e={}){const t=_t(s);let n,a=s;function r(u,o){if(a=u,s==null)return t.set(s=u),Promise.resolve();let f=n,M=!1,{delay:x=0,duration:z=400,easing:w=St,interpolate:P=Oe}={...e,...o};if(z===0)return f&&(f.abort(),f=null),t.set(s=a),Promise.resolve();const C=Dt.now()+x;let c;return n=Rt(d=>{if(dz?(t.set(s=u),!1):(t.set(s=c(w(v/z))),!0)}),n.promise}return{set:r,update:(u,o)=>r(u(a,s),o),subscribe:t.subscribe}}function It(s){let e;for(;e=s.sourceEvent;)s=e;return s}function et(s,e){if(s=It(s),e===void 0&&(e=s.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var n=t.createSVGPoint();return n.x=s.clientX,n.y=s.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[s.clientX-a.left-e.clientLeft,s.clientY-a.top-e.clientTop]}}return[s.pageX,s.pageY]}const Lt={passive:!1},De={capture:!0,passive:!1};function je(s){s.stopImmediatePropagation()}function Ye(s){s.preventDefault(),s.stopImmediatePropagation()}function Ct(s){var e=s.document.documentElement,t=Te(s).on("dragstart.drag",Ye,De);"onselectstart"in e?t.on("selectstart.drag",Ye,De):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Bt(s,e){var t=s.document.documentElement,n=Te(s).on("dragstart.drag",null);e&&(n.on("click.drag",Ye,De),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in t?n.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const Se=s=>()=>s;function $e(s,{sourceEvent:e,subject:t,target:n,identifier:a,active:r,x:u,y:o,dx:f,dy:M,dispatch:x}){Object.defineProperties(this,{type:{value:s,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:M,enumerable:!0,configurable:!0},_:{value:x}})}$e.prototype.on=function(){var s=this._.on.apply(this._,arguments);return s===this._?this:s};function Ut(s){return!s.ctrlKey&&!s.button}function Wt(){return this.parentNode}function At(s,e){return e??{x:s.x,y:s.y}}function jt(){return navigator.maxTouchPoints||"ontouchstart"in this}function qt(){var s=Ut,e=Wt,t=At,n=jt,a={},r=Xt("start","drag","end"),u=0,o,f,M,x,z=0;function w(i){i.on("mousedown.drag",P).filter(n).on("touchstart.drag",d).on("touchmove.drag",v,Lt).on("touchend.drag touchcancel.drag",B).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function P(i,y){if(!(x||!s.call(this,i,y))){var Y=q(this,e.call(this,i,y),i,y,"mouse");Y&&(Te(i.view).on("mousemove.drag",C,De).on("mouseup.drag",c,De),Ct(i.view),je(i),M=!1,o=i.clientX,f=i.clientY,Y("start",i))}}function C(i){if(Ye(i),!M){var y=i.clientX-o,Y=i.clientY-f;M=y*y+Y*Y>z}a.mouse("drag",i)}function c(i){Te(i.view).on("mousemove.drag mouseup.drag",null),Bt(i.view,M),Ye(i),a.mouse("end",i)}function d(i,y){if(s.call(this,i,y)){var Y=i.changedTouches,X=e.call(this,i,y),R=Y.length,L,p;for(L=0;L
            ');function lt(s,e){we(e,!1);function t(b,h,W){return Math.min(Math.max(b,h),W)}let n=g(e,"position",12,.5),a=g(e,"disabled",12,!1),r=g(e,"slider_color",12,"var(--border-color-primary)"),u=g(e,"image_size",28,()=>({top:0,left:0,width:0,height:0})),o=g(e,"el",12,void 0),f=g(e,"parent_el",12,void 0),M=O(),x=O(0),z=O(!1),w=0;function P(b){w=f()?.getBoundingClientRect().width||0,b===0&&u(u().width=o()?.getBoundingClientRect().width||0,!0),D(x,t(u().width*n()+u().left,0,w))}function C(b,h){const W=Math.pow(10,h);return Math.round((b+Number.EPSILON)*W)/W}function c(b){D(x,t(b,0,w)),n(C((b-u().left)/u().width,5))}function d(b){a()||(D(z,!0),c(b.x))}function v(b){a()||c(b.x)}function B(){a()||D(z,!1)}function q(b){D(x,t(u().width*b+u().left,0,w))}Fe(()=>{P(u().width);const b=qt().on("start",d).on("drag",v).on("end",B);Te(l(M)).call(b)}),be(()=>S(u()),()=>{P(u().width)}),be(()=>S(n()),()=>{q(n())}),Ge();var i={get position(){return n()},set position(b){n(b),_()},get disabled(){return a()},set disabled(b){a(b),_()},get slider_color(){return r()},set slider_color(b){r(b),_()},get image_size(){return u()},set image_size(b){u(b),_()},get el(){return o()},set el(b){o(b),_()},get parent_el(){return f()},set parent_el(b){f(b),_()}};Re();var y=Ot();tt("resize",xt,()=>P(u().width));var Y=se(y),X=se(Y);Pe(X,e,"default",{}),ie(Y),ve(Y,b=>o(b),()=>o());var R=H(Y,2);let L;var p=se(R);let U;var K=H(se(p));let ae;zt(),ie(p);var $=H(p,2);let F;return ie(R),ve(R,b=>D(M,b),()=>l(M)),ie(y),ve(y,b=>f(b),()=>f()),Me(()=>{L=ze(R,1,"outer svelte-7q75nb",null,L,{disabled:a(),grab:l(z)}),Xe(R,`transform: translateX(${l(x)??""}px)`),U=ze(p,1,"icon-wrap svelte-7q75nb",null,U,{active:l(z),disabled:a()}),ae=Xe(K,"",ae,{"--color":r()}),F=Xe($,"",F,{"--color":r()})}),j(s,y),ye(i)}var $t=Z("");function Le(s,e){const t=He(e,["children","$$slots","$$events","$$legacy"]),n=He(t,["src","fullscreen","fixed","transform","img_el","hidden","variant","max_height"]);we(e,!1);let a=g(e,"src",12,void 0),r=g(e,"fullscreen",12,!1),u=g(e,"fixed",12,!1),o=g(e,"transform",12,"translate(0px, 0px) scale(1)"),f=g(e,"img_el",12,null),M=g(e,"hidden",12,!1),x=g(e,"variant",12,"upload"),z=g(e,"max_height",12,500);const w=Ce();function P(d){if(!d)return{top:0,left:0,width:0,height:0};const v=d.parentElement?.getBoundingClientRect();if(!v)return{top:0,left:0,width:0,height:0};const B=d.naturalWidth/d.naturalHeight,q=v.width/v.height;let i,y;B>q?(i=v.width,y=v.width/B):(y=v.height,i=v.height*B);const Y=(v.width-i)/2;return{top:(v.height-y)/2,left:Y,width:i,height:y}}Fe(()=>{const d=new ResizeObserver(async v=>{for(const B of v)await Ne(),w("load",P(f()))});return d.observe(f()),()=>{d.disconnect()}});var C={get src(){return a()},set src(d){a(d),_()},get fullscreen(){return r()},set fullscreen(d){r(d),_()},get fixed(){return u()},set fixed(d){u(d),_()},get transform(){return o()},set transform(d){o(d),_()},get img_el(){return f()},set img_el(d){f(d),_()},get hidden(){return M()},set hidden(d){M(d),_()},get variant(){return x()},set variant(d){x(d),_()},get max_height(){return z()},set max_height(d){z(d),_()}};Re();var c=$t();return ft(c,()=>({src:a(),"data-testid":"imageslider-image",...n,[pt]:{fixed:u(),hidden:M(),preview:x()==="preview",slider:x()==="upload",fullscreen:r(),small:!r()},[mt]:{transform:o(),"max-height":z()&&!r()?`${z()}px`:null}}),void 0,void 0,void 0,"svelte-7j19z4"),ve(c,d=>f(d),()=>f()),Yt(c),tt("load",c,()=>w("load",P(f()))),j(s,c),ye(C)}class Ft{container;image;scale;offsetX;offsetY;isDragging;lastX;lastY;initial_left_padding;initial_top_padding;initial_width;initial_height;subscribers;handleImageLoad;real_image_size={top:0,left:0,width:0,height:0};last_touch_distance;constructor(e,t){this.container=e,this.image=t,this.scale=1,this.offsetX=0,this.offsetY=0,this.isDragging=!1,this.lastX=0,this.lastY=0,this.initial_left_padding=0,this.initial_top_padding=0,this.initial_width=0,this.initial_height=0,this.subscribers=[],this.last_touch_distance=0,this.handleWheel=this.handleWheel.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleImageLoad=this.init.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.image.addEventListener("load",this.handleImageLoad),this.container.addEventListener("wheel",this.handleWheel),this.container.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.container.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("touchend",this.handleTouchEnd),new ResizeObserver(a=>{for(const r of a)r.target===this.container&&(this.handleResize(),this.get_image_size(this.image))}).observe(this.container)}handleResize(){this.init()}init(){const e=this.container.getBoundingClientRect(),t=this.image.getBoundingClientRect();this.initial_left_padding=t.left-e.left,this.initial_top_padding=t.top-e.top,this.initial_width=t.width,this.initial_height=t.height,this.reset_zoom(),this.updateTransform()}reset_zoom(){this.scale=1,this.offsetX=0,this.offsetY=0,this.updateTransform()}handleMouseDown(e){const t=this.image.getBoundingClientRect();if(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom){if(e.preventDefault(),this.scale===1)return;this.isDragging=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.image.style.cursor="grabbing"}}handleMouseMove(e){if(!this.isDragging)return;const t=e.clientX-this.lastX,n=e.clientY-this.lastY;this.offsetX+=t,this.offsetY+=n,this.lastX=e.clientX,this.lastY=e.clientY,this.updateTransform(),this.updateTransform()}handleMouseUp(){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1,this.image.style.cursor=this.scale>1?"grab":"zoom-in")}async handleWheel(e){e.preventDefault();const t=this.container.getBoundingClientRect(),n=this.image.getBoundingClientRect();if(e.clientXn.right||e.clientYn.bottom)return;const a=1.05,r=this.scale,u=-Math.sign(e.deltaY)>0?Math.min(15,r*a):Math.max(1,r/a);if(u===r)return;const o=e.clientX-t.left-this.initial_left_padding,f=e.clientY-t.top-this.initial_top_padding;this.scale=u,this.offsetX=this.compute_new_offset({cursor_position:o,current_offset:this.offsetX,new_scale:u,old_scale:r}),this.offsetY=this.compute_new_offset({cursor_position:f,current_offset:this.offsetY,new_scale:u,old_scale:r}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.image.style.cursor=this.scale>1?"grab":"zoom-in"}compute_new_position({position:e,scale:t,anchor_position:n}){return e-(e-n)*(t/this.scale)}compute_new_offset({cursor_position:e,current_offset:t,new_scale:n,old_scale:a}){return e-n/a*(e-t)}constrain_to_bounds(e=!1){if(this.scale===1){this.offsetX=0,this.offsetY=0;return}const t={top:this.real_image_size.top*this.scale+this.offsetY,left:this.real_image_size.left*this.scale+this.offsetX,width:this.real_image_size.width*this.scale,height:this.real_image_size.height*this.scale,bottom:this.real_image_size.top*this.scale+this.offsetY+this.real_image_size.height*this.scale,right:this.real_image_size.left*this.scale+this.offsetX+this.real_image_size.width*this.scale},n=this.real_image_size.left+this.real_image_size.width,a=this.real_image_size.top+this.real_image_size.height;e&&(t.top>this.real_image_size.top?this.offsetY=this.calculate_position(this.real_image_size.top,0,"y"):t.bottomthis.real_image_size.left?this.offsetX=this.calculate_position(this.real_image_size.left,0,"x"):t.rightt!==e)}notify({x:e,y:t,scale:n}){this.subscribers.forEach(a=>a({x:e,y:t,scale:n}))}handleTouchStart(e){e.preventDefault();const t=this.image.getBoundingClientRect(),n=e.touches[0];if(n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom){if(e.touches.length===1&&this.scale>1)this.isDragging=!0,this.lastX=n.clientX,this.lastY=n.clientY;else if(e.touches.length===2){const a=e.touches[0],r=e.touches[1];this.last_touch_distance=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)}}}get_image_size(e){if(!e)return;const t=e.parentElement?.getBoundingClientRect();if(!t)return;const n=e.naturalWidth/e.naturalHeight,a=t.width/t.height;let r,u;n>a?(r=t.width,u=t.width/n):(u=t.height,r=t.height*n);const o=(t.width-r)/2,f=(t.height-u)/2;this.real_image_size={top:f,left:o,width:r,height:u}}handleTouchMove(e){if(e.touches.length===1&&this.isDragging){e.preventDefault();const t=e.touches[0],n=t.clientX-this.lastX,a=t.clientY-this.lastY;this.offsetX+=n,this.offsetY+=a,this.lastX=t.clientX,this.lastY=t.clientY,this.updateTransform()}else if(e.touches.length===2){e.preventDefault();const t=e.touches[0],n=e.touches[1],a=Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY);if(this.last_touch_distance===0){this.last_touch_distance=a;return}const r=a/this.last_touch_distance,u=this.scale,o=Math.min(15,Math.max(1,u*r));if(o===u){this.last_touch_distance=a;return}const f=this.container.getBoundingClientRect(),M=(t.clientX+n.clientX)/2-f.left-this.initial_left_padding,x=(t.clientY+n.clientY)/2-f.top-this.initial_top_padding;this.scale=o,this.offsetX=this.compute_new_offset({cursor_position:M,current_offset:this.offsetX,new_scale:o,old_scale:u}),this.offsetY=this.compute_new_offset({cursor_position:x,current_offset:this.offsetY,new_scale:o,old_scale:u}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.last_touch_distance=a,this.image.style.cursor=this.scale>1?"grab":"zoom-in"}}handleTouchEnd(e){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1),e.touches.length===0&&(this.last_touch_distance=0)}calculate_position(e,t,n){if(this.container.getBoundingClientRect(),n==="x"){const a=e,r=this.real_image_size.left+t*this.real_image_size.width;return a-r*this.scale}if(n==="y"){const a=e,r=this.real_image_size.top+t*this.real_image_size.height;return a-r*this.scale}return 0}}var Gt=Z(" ",1),Nt=Z(" ",1),Ht=Z('
            '),Vt=Z(" ",1);function Jt(s,e){we(e,!1);const t=()=>vt(U,"$transform",n),[n,a]=bt(),r=O(),u=O();let o=g(e,"value",28,()=>[null,null]),f=g(e,"label",12,void 0),M=g(e,"show_download_button",12,!0),x=g(e,"show_label",12),z=g(e,"i18n",12),w=g(e,"position",12),P=g(e,"layer_images",12,!0),C=g(e,"show_single",12,!1),c=g(e,"slider_color",12),d=g(e,"show_fullscreen_button",12,!0),v=g(e,"fullscreen",12,!1),B=g(e,"buttons",12,null),q=g(e,"on_custom_button_click",12,null),i=g(e,"el_width",12,0),y=g(e,"max_height",12),Y=g(e,"interactive",12,!0);const X=Ce();let R=O(),L=O(),p=O(),U=Pt({x:0,y:0,z:1},{duration:75}),K=O();function ae(m,I,A,k,le,oe){return(m*A+k-le)/oe/I}let $=O(0),F=O(null),b=null;function h(m,I){!m||!I||(l(F)?.destroy(),b?.disconnect(),m?.getBoundingClientRect().width,D($,I?.getBoundingClientRect().width||0),D(F,new Ft(I,m)),l(F).subscribe(({x:A,y:k,scale:le})=>{U.set({x:A,y:k,z:le})}),b=new ResizeObserver(A=>{for(const k of A)k.target===I&&D($,k.contentRect.width),k.target===m&&k.contentRect.width}),b.observe(I),b.observe(m))}Fe(()=>()=>{l(F)?.destroy(),b?.disconnect()});let W=O(),G=O({top:0,left:0,width:0,height:0});function V(m){D(G,m.detail)}be(()=>(S(w()),l($),l(G),t()),()=>{D(r,ae(w(),l($),l(G).width,l(G).left,t().x,t().z))}),be(()=>(S(P()),l(r)),()=>{D(u,P()?`clip-path: inset(0 0 0 ${l(r)*100}%)`:"")}),be(()=>(l(R),l(L)),()=>{h(l(R),l(L))}),Ge();var he={get value(){return o()},set value(m){o(m),_()},get label(){return f()},set label(m){f(m),_()},get show_download_button(){return M()},set show_download_button(m){M(m),_()},get show_label(){return x()},set show_label(m){x(m),_()},get i18n(){return z()},set i18n(m){z(m),_()},get position(){return w()},set position(m){w(m),_()},get layer_images(){return P()},set layer_images(m){P(m),_()},get show_single(){return C()},set show_single(m){C(m),_()},get slider_color(){return c()},set slider_color(m){c(m),_()},get show_fullscreen_button(){return d()},set show_fullscreen_button(m){d(m),_()},get fullscreen(){return v()},set fullscreen(m){v(m),_()},get buttons(){return B()},set buttons(m){B(m),_()},get on_custom_button_click(){return q()},set on_custom_button_click(m){q(m),_()},get el_width(){return i()},set el_width(m){i(m),_()},get max_height(){return y()},set max_height(m){y(m),_()},get interactive(){return Y()},set interactive(m){Y(m),_()}};Re();var _e=Vt(),fe=re(_e);{let m=N(()=>(S(f()),S(z()),T(()=>f()||z()("image.image"))));rt(fe,{get show_label(){return x()},get Icon(){return Ie},get label(){return l(m)}})}var ke=H(fe,2);{var Be=m=>{st(m,{unpadded_box:!0,size:"large",children:(I,A)=>{Ie(I)},$$slots:{default:!0}})},Ue=m=>{var I=Ht(),A=se(I);Et(A,{get buttons(){return B()},get on_custom_button_click(){return q()},children:(E,ne)=>{var J=Gt(),Q=re(J);{let ee=N(()=>(S(z()),T(()=>z()("common.undo")))),ge=N(()=>(t(),T(()=>t().z===1)));Ee(Q,{get Icon(){return Mt},get label(){return l(ee)},get disabled(){return l(ge)},onclick:()=>l(F)?.reset_zoom()})}var ue=H(Q,2);{var ce=ee=>{Tt(ee,{get fullscreen(){return v()},onclick:ge=>{v(ge),X("fullscreen",ge)}})};te(ue,ee=>{d()&&ee(ce)})}var me=H(ue,2);{var ot=ee=>{{let ge=N(()=>(S(o()),T(()=>o()[1]?.url))),dt=N(()=>(S(o()),T(()=>o()[1]?.orig_name||"image")));nt(ee,{get href(){return l(ge)},get download(){return l(dt)},children:(ht,or)=>{{let gt=N(()=>(S(z()),T(()=>z()("common.download"))));Ee(ht,{get Icon(){return at},get label(){return l(gt)}})}},$$slots:{default:!0}})}};te(me,ee=>{M()&&ee(ot)})}var ut=H(me,2);{var ct=ee=>{Ee(ee,{get Icon(){return it},label:"Remove Image",onclick:ge=>{o([null,null]),X("clear"),ge.stopPropagation()}})};te(ut,ee=>{Y()&&ee(ct)})}j(E,J)},$$slots:{default:!0}});var k=H(A,2);let le;var oe=se(k);lt(oe,{get slider_color(){return c()},get image_size(){return l(G)},get position(){return w()},set position(E){w(E)},get el(){return l(L)},set el(E){D(L,E)},get parent_el(){return l(K)},set parent_el(E){D(K,E)},children:(E,ne)=>{var J=Nt(),Q=re(J);{let ce=N(()=>(S(o()),T(()=>o()?.[0]?.url)));Le(Q,{get src(){return l(ce)},alt:"",loading:"lazy",variant:"preview",get transform(){return`translate(${t(),T(()=>t().x)??""}px, ${t(),T(()=>t().y)??""}px) scale(${t(),T(()=>t().z)??""})`},get fullscreen(){return v()},get max_height(){return y()},get img_el(){return l(R)},set img_el(me){D(R,me)},$$events:{load:V},$$legacy:!0})}var ue=H(Q,2);{let ce=N(()=>(S(o()),T(()=>!o()?.[1]?.url))),me=N(()=>(S(o()),T(()=>o()?.[1]?.url)));Le(ue,{variant:"preview",get fixed(){return P()},get hidden(){return l(ce)},get src(){return l(me)},alt:"",loading:"lazy",get style(){return`${l(u)??""}; background: var(--block-background-fill);`},get transform(){return`translate(${t(),T(()=>t().x)??""}px, ${t(),T(()=>t().y)??""}px) scale(${t(),T(()=>t().z)??""})`},get fullscreen(){return v()},get max_height(){return y()},$$events:{load:V}})}j(E,J)},$$slots:{default:!0},$$legacy:!0}),ie(k),ve(k,E=>D(W,E),()=>l(W)),ie(I),ve(I,E=>D(p,E),()=>l(p)),Me(()=>le=ze(k,1,"slider-wrap svelte-19i1huv",null,le,{limit_height:!v()})),qe(k,"clientWidth",i),j(m,I)};te(ke,m=>{S(o()),S(C()),T(()=>(o()===null||o()[0]===null||o()[1]===null)&&!C())?m(Be):m(Ue,!1)})}j(s,_e);var We=ye(he);return a(),We}var Zt=Z('
            ');function Kt(s,e){we(e,!1);const t=Ce();Re();var n=Zt(),a=se(n);Ee(a,{get Icon(){return it},label:"Remove Image",onclick:r=>{t("remove_image"),r.stopPropagation()}}),ie(n),j(s,n),ye()}var Qt=Z('
            '),er=Z("
            "),tr=Z("
            "),rr=Z("
            "),nr=Z('
            ',1);function sr(s,e){we(e,!1);let t=g(e,"value",12),n=g(e,"label",12,void 0),a=g(e,"show_label",12),r=g(e,"root",12),u=g(e,"position",12),o=g(e,"upload_count",12,2),f=g(e,"show_download_button",12,!0),M=g(e,"slider_color",12),x=g(e,"upload",12),z=g(e,"stream_handler",12),w=g(e,"max_file_size",12,null),P=g(e,"i18n",12),C=g(e,"max_height",12),c=g(e,"upload_promise",12,null),d=O(t()||[null,null]),v=O(),B=O(),q=O();async function i(h,W){const G=[t()[0],t()[1]];h.length>1?G[W]=h[0]:G[W]=h[W],t(G),await Ne(),Y("upload",G)}let y=O("");const Y=Ce();let X=g(e,"dragging",12,!1);be(()=>(S(t()),l(y)),()=>{JSON.stringify(t())!==l(y)&&(D(y,JSON.stringify(t())),D(d,t()))}),be(()=>S(X()),()=>{Y("drag",X())}),Ge();var R={get value(){return t()},set value(h){t(h),_()},get label(){return n()},set label(h){n(h),_()},get show_label(){return a()},set show_label(h){a(h),_()},get root(){return r()},set root(h){r(h),_()},get position(){return u()},set position(h){u(h),_()},get upload_count(){return o()},set upload_count(h){o(h),_()},get show_download_button(){return f()},set show_download_button(h){f(h),_()},get slider_color(){return M()},set slider_color(h){M(h),_()},get upload(){return x()},set upload(h){x(h),_()},get stream_handler(){return z()},set stream_handler(h){z(h),_()},get max_file_size(){return w()},set max_file_size(h){w(h),_()},get i18n(){return P()},set i18n(h){P(h),_()},get max_height(){return C()},set max_height(h){C(h),_()},get upload_promise(){return c()},set upload_promise(h){c(h),_()},get dragging(){return X()},set dragging(h){X(h),_()}};Re();var L=nr(),p=re(L);{let h=N(()=>(S(n()),S(P()),T(()=>n()||P()("image.image"))));rt(p,{get show_label(){return a()},get Icon(){return Ie},get label(){return l(h)}})}var U=H(p,2),K=se(U);{var ae=h=>{Kt(h,{$$events:{remove_image:()=>{u(.5),t([null,null]),Y("clear")}}})};te(K,h=>{S(t()),T(()=>t()?.[0]?.url||t()?.[1]?.url)&&h(ae)})}var $=H(K,2);{var F=h=>{var W=Qt(),G=se(W);{var V=he=>{{let _e=N(()=>(S(t()),T(()=>t()[1].orig_name||"image")));nt(he,{get href(){return S(t()),T(()=>t()[1].url)},get download(){return l(_e)},children:(fe,ke)=>{Ee(fe,{get Icon(){return at}})},$$slots:{default:!0}})}};te(G,he=>{f()&&he(V)})}ie(W),j(h,W)};te($,h=>{S(t()),T(()=>t()?.[1]?.url)&&h(F)})}var b=H($,2);{let h=N(()=>(S(o()),S(t()),T(()=>o()==2||!t()?.[0])));lt(b,{get disabled(){return l(h)},get slider_color(){return M()},get position(){return u()},set position(W){u(W)},children:(W,G)=>{var V=rr();let he,_e;var fe=se(V);{var ke=I=>{var A=er();let k;var le=se(A);{let oe=N(()=>(S(t()),T(()=>!!t()?.[0])));Ke(le,{filetype:"image/*",onload:E=>i(E,0),get disable_click(){return l(oe)},get root(){return r()},file_count:"multiple",get upload(){return x()},get stream_handler(){return z()},get max_file_size(){return w()},get upload_promise(){return c()},set upload_promise(E){c(E)},get dragging(){return X()},set dragging(E){X(E)},children:(E,ne)=>{var J=pe(),Q=re(J);Pe(Q,e,"default",{}),j(E,J)},$$slots:{default:!0},$$legacy:!0})}ie(A),Me(()=>k=ze(A,1,"wrap svelte-6nrohp",null,k,{"half-wrap":o()===1})),j(I,A)},Be=I=>{{let A=N(()=>(l(d),T(()=>l(d)[0]?.url)));Le(I,{variant:"upload",get src(){return l(A)},alt:"",get max_height(){return C()},get img_el(){return l(v)},set img_el(k){D(v,k)},$$legacy:!0})}};te(fe,I=>{l(d),T(()=>!l(d)?.[0])?I(ke):I(Be,!1)})}var Ue=H(fe,2);{var We=I=>{{let A=N(()=>(S(t()),T(()=>!!t()?.[1])));Ke(I,{filetype:"image/*",onload:k=>i(k,1),get disable_click(){return l(A)},get root(){return r()},file_count:"multiple",get upload(){return x()},get stream_handler(){return z()},get max_file_size(){return w()},get upload_promise(){return c()},set upload_promise(k){c(k)},get dragging(){return X()},set dragging(k){X(k)},children:(k,le)=>{var oe=pe(),E=re(oe);Pe(E,e,"default",{}),j(k,oe)},$$slots:{default:!0},$$legacy:!0})}},m=I=>{var A=pe(),k=re(A);{var le=E=>{var ne=tr();let J,Q;var ue=se(ne);st(ue,{unpadded_box:!0,size:"large",children:(ce,me)=>{Ie(ce)},$$slots:{default:!0}}),ie(ne),Me(()=>{J=ze(ne,1,"empty-wrap fixed svelte-6nrohp",null,J,{"white-icon":!t()?.[0]?.url}),Q=Xe(ne,"",Q,{width:`${l(B)*(1-u())}px`,transform:`translateX(${l(B)*u()}px)`})}),j(E,ne)},oe=E=>{var ne=pe(),J=re(ne);{var Q=ue=>{{let ce=N(()=>o()===1);Le(ue,{variant:"upload",get src(){return l(d),T(()=>l(d)[1].url)},alt:"",get fixed(){return l(ce)},transform:"translate(0px, 0px) scale(1)",get max_height(){return C()}})}};te(J,ue=>{l(d),T(()=>l(d)?.[1])&&ue(Q)},!0)}j(E,ne)};te(k,E=>{l(d),S(o()),T(()=>!l(d)?.[1]&&o()===1)?E(le):E(oe,!1)},!0)}j(I,A)};te(Ue,I=>{l(d),S(o()),T(()=>!l(d)?.[1]&&o()===2)?I(We):I(m,!1)})}ie(V),Me(()=>{he=ze(V,1,"upload-wrap svelte-6nrohp",null,he,{"side-by-side":o()===2}),_e=Xe(V,"",_e,{display:o()===2?"flex":"block"})}),j(W,V)},$$slots:{default:!0},$$legacy:!0})}return ie(U),qe(U,"clientWidth",h=>D(B,h)),qe(U,"clientHeight",h=>D(q,h)),j(s,L),ye(R)}function ir(s,e){we(e,!1);let t=g(e,"value",28,()=>[null,null]),n=g(e,"upload",12),a=g(e,"stream_handler",12),r=g(e,"label",12),u=g(e,"show_label",12),o=g(e,"i18n",12),f=g(e,"root",12),M=g(e,"upload_count",12,1),x=g(e,"dragging",12),z=g(e,"max_height",12),w=g(e,"max_file_size",12,null),P=g(e,"upload_promise",12,null);var C={get value(){return t()},set value(c){t(c),_()},get upload(){return n()},set upload(c){n(c),_()},get stream_handler(){return a()},set stream_handler(c){a(c),_()},get label(){return r()},set label(c){r(c),_()},get show_label(){return u()},set show_label(c){u(c),_()},get i18n(){return o()},set i18n(c){o(c),_()},get root(){return f()},set root(c){f(c),_()},get upload_count(){return M()},set upload_count(c){M(c),_()},get dragging(){return x()},set dragging(c){x(c),_()},get max_height(){return z()},set max_height(c){z(c),_()},get max_file_size(){return w()},set max_file_size(c){w(c),_()},get upload_promise(){return P()},set upload_promise(c){P(c),_()}};return sr(s,{slider_color:"var(--border-color-primary)",position:.5,get root(){return f()},get label(){return r()},get show_label(){return u()},get upload_count(){return M()},get stream_handler(){return a()},get upload(){return n()},get max_file_size(){return w()},get max_height(){return z()},get i18n(){return o()},get upload_promise(){return P()},set upload_promise(c){P(c)},get value(){return t()},set value(c){t(c)},get dragging(){return x()},set dragging(c){x(c)},$$events:{edit(c){xe.call(this,e,c)},clear(c){xe.call(this,e,c)},stream(c){xe.call(this,e,c)},drag:({detail:c})=>x(c),upload(c){xe.call(this,e,c)},select(c){xe.call(this,e,c)},share(c){xe.call(this,e,c)}},children:(c,d)=>{var v=pe(),B=re(v);Pe(B,e,"default",{}),j(c,v)},$$slots:{default:!0},$$legacy:!0}),ye(C)}var ar=Z(" ",1),lr=Z(" ",1);function Lr(s,e){we(e,!0);let t=Ae(void 0);class n extends wt{async get_data(){return l(t)&&(await l(t),await Ne()),await super.get_data()}}const a=yt(e,["$$slots","$$events","$$legacy"]),r=new n(a);let u=Ae(!1),o=Ae(!1),f,M=de(()=>Math.max(0,Math.min(100,r.props.slider_position))/100);r.watch_for_change();const x=d=>{const v=d;v.preventDefault(),v.stopPropagation(),v.type==="dragenter"||v.type==="dragover"?D(o,!0):v.type==="dragleave"&&D(o,!1)},z=d=>{if(r.shared.interactive){const v=d;v.preventDefault(),v.stopPropagation(),D(o,!1),f&&f.loadFilesFromDrop(v)}};var w=pe(),P=re(w);{var C=d=>{{let v=de(()=>l(o)?"focus":"base"),B=de(()=>r.props.height||void 0);Qe(d,{get visible(){return r.shared.visible},variant:"solid",get border_mode(){return l(v)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l(B)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},get fullscreen(){return l(u)},set fullscreen(q){D(u,q,!0)},children:(q,i)=>{var y=ar(),Y=re(y);Ze(Y,Ve({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status));var X=H(Y,2);{let R=de(()=>r.props.buttons.some(p=>typeof p=="string"&&p==="download")),L=de(()=>r.props.buttons.some(p=>typeof p=="string"&&p==="fullscreen"));Jt(X,{get fullscreen(){return l(u)},get interactive(){return r.shared.interactive},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get show_download_button(){return l(R)},get i18n(){return r.i18n},get show_fullscreen_button(){return l(L)},get buttons(){return r.props.buttons},on_custom_button_click:p=>{r.dispatch("custom_button_click",{id:p})},get position(){return l(M)},get slider_color(){return r.props.slider_color},get max_height(){return r.props.max_height},get value(){return r.props.value},set value(p){r.props.value=p},$$events:{select:({detail:p})=>r.dispatch("select",p),share:({detail:p})=>r.dispatch("share",p),error:({detail:p})=>r.dispatch("error",p),clear:()=>{r.dispatch("clear"),r.dispatch("input")},fullscreen:({detail:p})=>{D(u,p,!0)}}})}j(q,y)},$$slots:{default:!0}})}},c=d=>{{let v=de(()=>r.props.value===null?"dashed":"solid"),B=de(()=>l(o)?"focus":"base"),q=de(()=>r.props.height||void 0);Qe(d,{get visible(){return r.shared.visible},get variant(){return l(v)},get border_mode(){return l(B)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l(q)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},$$events:{dragenter:x,dragleave:x,dragover:x,drop:z},children:(i,y)=>{var Y=lr(),X=re(Y);Ze(X,Ve({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status,{on_clear_status:()=>r.dispatch("clear_status",r.shared.loading_status)}));var R=H(X,2);{let L=de(()=>r.shared.client?.stream);ve(ir(R,{get root(){return r.shared.root},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get upload_count(){return r.props.upload_count},get max_file_size(){return r.shared.max_file_size},get i18n(){return r.i18n},upload:(...p)=>r.shared.client.upload(...p),get stream_handler(){return l(L)},get max_height(){return r.props.max_height},get upload_promise(){return l(t)},set upload_promise(p){D(t,p,!0)},get value(){return r.props.value},set value(p){r.props.value=p},get dragging(){return l(o)},set dragging(p){D(o,p,!0)},$$events:{edit:()=>r.dispatch("edit"),clear:()=>{r.dispatch("clear"),r.dispatch("input")},drag:({detail:p})=>D(o,p,!0),upload:()=>{r.dispatch("upload"),r.dispatch("input")},error:({detail:p})=>{r.shared.loading_status&&(r.shared.loading_status.status="error"),r.dispatch("error",p)},close_stream:()=>{r.dispatch("close_stream","stream")}},children:(p,U)=>{var K=pe(),ae=re(K);{var $=F=>{kt(F,{get i18n(){return r.i18n},type:"image",get placeholder(){return r.props.placeholder}})};te(ae,F=>{F($)})}j(p,K)},$$slots:{default:!0}}),p=>f=p,()=>f)}j(i,Y)},$$slots:{default:!0}})}};te(P,d=>{!r.shared.interactive||r.props.value?.[1]&&r.props.value?.[0]?d(C):d(c,!1)})}j(s,w),ye()}export{Lr as default}; diff --git a/assets/Index-D8iPfACD.js b/assets/Index-DgPLRH8R.js similarity index 99% rename from assets/Index-D8iPfACD.js rename to assets/Index-DgPLRH8R.js index dea84c7c84d785c04f37d307bba25db7f13ee7a5..ae110ef85dd578e2897eb43a2bcd4615334c515e 100644 --- a/assets/Index-D8iPfACD.js +++ b/assets/Index-DgPLRH8R.js @@ -1,4 +1,4 @@ -import{F as Mo,i as k,b as he,q as St,y as ya,a as Te,J as va,w as Xt,v as oa,d as wa,p as lt,f as Bt,Z as fn,_ as _n,j as Yt,u as So,t as Po,G as Ao,k as To,r as Ho}from"./i18n-CPHyzK9b.js";import{a as s,f as Ze,ah as ba,M as ma,Z as e,t as S,O as ga,a2 as W,Q as u,S as b,X as Z,a3 as ye,N as K,R as m,T as d,$ as v,U as ca,aa as te,aw as Io,ac as Lt,a4 as Pa,a5 as na,ab as Wt,aj as No,a$ as Vo,a7 as zo,ax as Lo}from"./index-DydPgVMC.js";import{k as jo}from"./key-CFGu0zzg.js";import{t as mn,f as gn}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{T as Oo}from"./Textbox-BhB0hOv8.js";import{c as Ro}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */import{I as Eo}from"./ImagePreview-C41duyJ0.js";/* empty css */import"./Upload-Bq9KuxCu.js";/* empty css *//* empty css */import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./actions-4RaHFoGI.js";import"./input-BtIxlP_B.js";import"./BlockTitle-DNiCHWOR.js";import"./Info-DfrMwI06.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./Send-oZH_TPNw.js";import"./Square-D8rV3Ea-.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./snippet-BtHMuX3s.js";import"./misc-Dkc5KZ-v.js";import"./BlockLabel-BzVeVrtL.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";import"./Image-DBmW1mOo.js";import"./FullscreenButton-BuyUU5Yj.js";import"./Maximize-DWbY8BRa.js";import"./Image-CZ1Hb99p.js";/* empty css */function aa(n,t){return n==="any"||t==="any"||n===t}const fa={image:"#4fd1a5",text:"#8b83e8",audio:"#f5a623",video:"#4d9cf5",number:"#e879a8",boolean:"#f59e0b",file:"#94a3b8",json:"#22d3ee",gallery:"#34d399",model3d:"#a78bfa",any:"#6b6e78"},Do={image:"rgba(79, 209, 165, 0.15)",text:"rgba(139, 131, 232, 0.15)",audio:"rgba(245, 166, 35, 0.15)",video:"rgba(77, 156, 245, 0.15)",number:"rgba(232, 121, 168, 0.15)",boolean:"rgba(245, 158, 11, 0.15)",file:"rgba(148, 163, 184, 0.15)",json:"rgba(34, 211, 238, 0.15)",gallery:"rgba(52, 211, 153, 0.15)",model3d:"rgba(167, 139, 250, 0.15)",any:"rgba(107, 110, 120, 0.10)"};function Yo(n){if(!n||typeof n!="object")return!1;const t=n;return t.schema_version==="2"&&Array.isArray(t.references)&&Array.isArray(t.operators)&&Array.isArray(t.subjects)&&Array.isArray(t.edges)}function Zo(n){if(Yo(n))return n;const t=n??{},i=Array.isArray(t.nodes)?t.nodes:[],r=Array.isArray(t.edges)?t.edges:[],l=new Set;for(const x of r)l.add(x.to_node_id);const _=[],h=[],N=[];for(const x of i){const j={id:x.id,label:x.label??"",inputs:x.inputs??[],outputs:x.outputs??[],data:x.data??{},x:x.x??0,y:x.y??0,width:x.width??200,height:x.height??100};if(x.kind==="transform"){const G=Fo(x);h.push({...j,role:"operator",kind:G,source:Uo(x,G),space_id:x.space_id,model_id:x.model_id,dataset_id:x.dataset_id,dataset_config:x.dataset_config,dataset_split:x.dataset_split,endpoint:x.endpoint,pipeline_tag:x.pipeline_tag,provider:x.provider,fn:x.fn,runtime:"client"});continue}const pe=x.outputs?.[0]?.type??x.inputs?.[0]?.type??"any";l.has(x.id)?N.push({...j,role:"subject",asset_type:pe}):_.push({...j,role:"reference",asset_type:pe})}return{schema_version:"2",name:t.name??"My workflow",runtime:{default:"client"},references:_,operators:h,subjects:N,edges:r,view:{default:"canvas"}}}function Fo(n){return n.space_id||n.source==="space"?"space":n.model_id||n.source==="model"?"model":n.dataset_id||n.source==="dataset"?"dataset":"fn"}function Uo(n,t){if(t==="space"&&n.space_id)return`hf://spaces/${n.space_id}`;if(t==="model"&&n.model_id)return`hf://${n.model_id}`;if(t==="dataset"&&n.dataset_id)return`hf://datasets/${n.dataset_id}`;if(t==="fn")return n.fn??void 0}function Wo(n,t){return n.references.find(i=>i.id===t)??n.operators.find(i=>i.id===t)??n.subjects.find(i=>i.id===t)}function En(n){const t=new Set;for(const r of n.edges)t.add(r.to_node_id);const i=[];for(const r of n.references)i.push({id:r.id,kind:"component",label:r.label,source:"local",inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});for(const r of n.operators)i.push({id:r.id,kind:"transform",label:r.label,source:r.kind,space_id:r.space_id,model_id:r.model_id,dataset_id:r.dataset_id,dataset_config:r.dataset_config,dataset_split:r.dataset_split,endpoint:r.endpoint,endpoints:r.endpoints,pipeline_tag:r.pipeline_tag,provider:r.provider,fn:r.fn,inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});for(const r of n.subjects)i.push({id:r.id,kind:"component",label:r.label,source:"local",inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});return{version:"1",name:n.name,nodes:i,edges:n.edges}}function Ta(){return crypto.randomUUID()}const Bo={schema_version:"2",name:"My workflow",runtime:{default:"client"},references:[{id:"ref_default",role:"reference",label:"Image",asset_type:"image",inputs:[{id:"in",label:"Image",type:"image"}],outputs:[{id:"out",label:"Image",type:"image"}],data:{},x:80,y:120,width:200,height:160}],operators:[],subjects:[],edges:[],view:{default:"canvas"}},Ot=Mo(Bo);function Xo(n){const t=n?.url;return typeof t=="string"&&(t.startsWith("blob:")||t.startsWith("data:"))}function Dn(n){for(const t of Object.values(n??{})){const i=t?.url;typeof i=="string"&&i.startsWith("blob:")&&URL.revokeObjectURL(i)}}function Fa(n){return Ha(n,t=>{if(!t.data)return t;const i={};for(const[r,l]of Object.entries(t.data))Xo(l)||(i[r]=l);return{...t,data:i}})}function qo(n,t,i){const r=Ta(),l={};for(const h of n.inputs)h.default_value!==void 0&&(l[h.id]=h.default_value);const _={...n,role:"reference",id:r,x:t,y:i,data:l};return Ot.update(h=>({...h,references:[...h.references,_]})),r}function Go(n,t,i){const r=Ta(),l={};for(const h of n.inputs)h.default_value!==void 0&&(l[h.id]=h.default_value);const _={...n,role:"operator",id:r,x:t,y:i,data:l};return Ot.update(h=>({...h,operators:[...h.operators,_]})),r}function Jo(n,t,i){const r=Ta(),l={...n,role:"subject",id:r,x:t,y:i,data:{}};return Ot.update(_=>({..._,subjects:[..._.subjects,l]})),r}function la(n,t,i,r){const l={label:t.label??"",inputs:t.inputs??[],outputs:t.outputs??[],width:t.width??200,height:t.height??100};if(n==="reference"){const h=t.asset_type??t.outputs?.[0]?.type??t.inputs?.[0]?.type??"any";return qo({...l,asset_type:h},i,r)}if(n==="operator"){const h=t.source==="space"||t.source==="model"||t.source==="dataset"||t.source==="fn"?t.source:t.kind==="space"||t.kind==="model"||t.kind==="dataset"||t.kind==="fn"?t.kind:t.space_id?"space":t.model_id?"model":t.dataset_id?"dataset":"fn";return Go({...l,kind:h,source:t.source&&typeof t.source=="string"&&t.source.startsWith("hf://")?t.source:void 0,space_id:t.space_id,model_id:t.model_id,dataset_id:t.dataset_id,dataset_config:t.dataset_config,dataset_split:t.dataset_split,endpoint:t.endpoint,endpoints:t.endpoints,pipeline_tag:t.pipeline_tag,provider:t.provider,fn:t.fn,runtime:t.runtime},i,r)}const _=t.asset_type??t.inputs?.[0]?.type??t.outputs?.[0]?.type??"any";return Jo({...l,asset_type:_},i,r)}function Ha(n,t){return{...n,references:n.references.map(i=>t(i)),operators:n.operators.map(i=>t(i)),subjects:n.subjects.map(i=>t(i))}}function hn(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,x:t,y:i}:l))}function Ko(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,width:t,height:i}:l))}function La(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,data:{...l.data,[t]:i}}:l))}function bn(n){Ot.update(t=>{const i=Wo(t,n);return i&&Dn(i.data),{...t,references:t.references.filter(r=>r.id!==n),operators:t.operators.filter(r=>r.id!==n),subjects:t.subjects.filter(r=>r.id!==n),edges:t.edges.filter(r=>r.from_node_id!==n&&r.to_node_id!==n)}})}function pa(n){Ot.update(t=>({...t,edges:[...t.edges,{...n,id:Ta()}]}))}function yn(n){Ot.update(t=>({...t,edges:t.edges.filter(i=>i.id!==n)}))}function Qo(n,t){Ot.update(i=>({...i,operators:i.operators.map(r=>r.id===n?{...r,endpoints:t}:r)}))}function $o(n,t){Ot.update(i=>{const r=i.operators.find(N=>N.id===n);if(!r||!r.endpoints)return i;const l=r.endpoints.find(N=>N.name===t);if(!l||l.name===r.endpoint)return i;const _=new Map(l.inputs.map(N=>[N.id,N])),h=new Map(l.outputs.map(N=>[N.id,N]));return{...i,operators:i.operators.map(N=>N.id===n?{...N,endpoint:l.name,inputs:l.inputs,outputs:l.outputs,data:{}}:N),edges:i.edges.filter(N=>{if(N.from_node_id===n){const x=h.get(N.from_port_id);if(!x||!aa(x.type,N.type))return!1}if(N.to_node_id===n){const x=_.get(N.to_port_id);if(!x||!aa(x.type,N.type))return!1}return!0})}})}function ei(n,t){Ot.update(i=>({...i,operators:i.operators.map(r=>{if(r.id!==n)return r;const l={...r};return delete l.space_id,delete l.model_id,delete l.dataset_id,delete l.dataset_config,delete l.dataset_split,delete l.endpoint,delete l.pipeline_tag,delete l.source,{...l,...t.kind&&{kind:t.kind},...t.source!==void 0&&{source:t.source},...t.space_id!==void 0&&{space_id:t.space_id},...t.model_id!==void 0&&{model_id:t.model_id},...t.dataset_id!==void 0&&{dataset_id:t.dataset_id},...t.dataset_config!==void 0&&{dataset_config:t.dataset_config},...t.dataset_split!==void 0&&{dataset_split:t.dataset_split},...t.endpoint!==void 0&&{endpoint:t.endpoint},...t.pipeline_tag!==void 0&&{pipeline_tag:t.pipeline_tag},inputs:t.inputs,outputs:t.outputs,label:t.label??r.label,width:t.width??r.width,data:{}}})}))}var ti=Ze('');function ai(n){var t=ti();s(n,t)}var ni=m(''),oi=m(''),ii=m(''),ri=m('
            '),si=m('
            '),li=m('
            '),di=m(''),ci=m('
            '),ui=m('
            '),vi=m('
            '),pi=m(''),fi=m(''),_i=m('',2),mi=m('
            '),gi=m(''),hi=m('
            '),bi=m('
            Waiting for output...
            '),yi=m('
            '),wi=m("
            ");function xi(n,t){ma(t,!0);const i=W(()=>t.node.outputs.find(V=>V.id===t.widgetPortId)??t.node.inputs.find(V=>V.id===t.widgetPortId)),r=W(()=>e(i)?.choices??null),l=W(()=>!!e(r)?.length),_=W(()=>!!e(i)?.multiselect);let h=te(void 0);function N(){const V=t.node.data?.[t.widgetPortId];return typeof V=="string"?V:""}function x(){const V=t.node.data?.[t.widgetPortId];return V&&typeof V=="object"&&!Array.isArray(V)?V:null}function j(){const V=t.node.data?.[t.widgetPortId];return typeof V=="number"?V:0}function pe(){const V=t.node.data?.[t.widgetPortId];return typeof V=="boolean"?V:!1}function G(V){const D=V.currentTarget;t.ondatachange(t.node.id,t.widgetPortId,parseFloat(D.value)||0)}function He(V){const D=V.currentTarget;t.ondatachange(t.node.id,t.widgetPortId,D.checked)}function me(){const V=x();V?.url?.startsWith("blob:")&&URL.revokeObjectURL(V.url)}function ot(V){me(),t.ondatachange(t.node.id,t.widgetPortId,{name:V.name,url:URL.createObjectURL(V),mime:V.type})}function vt(V){const D=V.currentTarget.files?.[0];D&&ot(D)}function A(V){V.preventDefault(),V.stopPropagation();const D=V.dataTransfer?.files?.[0];D&&ot(D)}function dt(){me(),t.ondatachange(t.node.id,t.widgetPortId,null)}async function f(){const V=x();if(!V?.url)return;const D=V.name||"download",Xe=V.url.startsWith("blob:")||V.url.startsWith("data:")||V.url.startsWith("http")&&new URL(V.url,window.location.origin).origin===window.location.origin||!V.url.startsWith("http");try{const ge=Xe?V.url:await fetch(V.url).then(re=>re.blob()).then(re=>URL.createObjectURL(re)),X=document.createElement("a");X.href=ge,X.download=D,document.body.appendChild(X),X.click(),document.body.removeChild(X),Xe||setTimeout(()=>URL.revokeObjectURL(ge),1e3)}catch{window.open(V.url,"_blank","noopener")}}const ce=V=>V;var le=wi();let w;le.__mousedown=V=>V.stopPropagation(),le.__pointerdown=V=>V.stopPropagation();var T=u(le);{var J=V=>{const D=W(()=>t.node.data?.[t.widgetPortId]),Xe=W(()=>e(_)&&Array.isArray(e(D))?e(D):[]),ge=W(()=>!e(_)&&typeof e(D)=="string"?e(D):"");var X=ri();St(X,21,()=>e(r),Xt,(re,it)=>{var xt=ii(),F=u(xt);{var $e=qe=>{var de=ni();oa(de),de.__change=Fe=>t.ondatachange(t.node.id,t.widgetPortId,Fe.currentTarget.checked?[...e(Xe),e(it)]:e(Xe).filter(_e=>_e!==e(it))),S(Fe=>{ya(de,Fe),de.disabled=t.isReadonly},[()=>e(Xe).includes(e(it))]),s(qe,de)},fe=qe=>{var de=oi();oa(de),de.__change=()=>t.ondatachange(t.node.id,t.widgetPortId,e(it)),S(()=>{Te(de,"name",`${t.node.id??""}-${t.widgetPortId??""}`),va(de,e(it)),ya(de,e(ge)===e(it)),de.disabled=t.isReadonly}),s(qe,de)};k(F,qe=>{e(_)?qe($e):qe(fe,!1)})}var Le=b(F,2),et=u(Le,!0);d(Le),d(xt),S(()=>Z(et,e(it))),s(re,xt)}),d(X),s(V,X)},Q=V=>{var D=ye(),Xe=K(D);{var ge=re=>{var it=si(),xt=u(it),F=u(xt);{let $e=W(N),fe=W(()=>t.widgetType==="json"?4:3),Le=W(()=>t.isReadonly?"Waiting for output...":t.widgetType==="json"?'{"key": "value"}':"Enter text...");Oo(F,{get value(){return e($e)},label:"text",show_label:!1,get lines(){return e(fe)},max_lines:8,get placeholder(){return e(Le)},get disabled(){return t.isReadonly},oninput:et=>t.ondatachange(t.node.id,t.widgetPortId,et)})}d(xt),d(it),s(re,it)},X=re=>{var it=ye(),xt=K(it);{var F=fe=>{var Le=ci(),et=u(Le);{var qe=Fe=>{var _e=li(),tt=u(_e,!0);d(_e),S($=>Z(tt,$),[j]),s(Fe,_e)},de=Fe=>{var _e=di();oa(_e),_e.__input=G,S(tt=>va(_e,tt),[j]),s(Fe,_e)};k(et,Fe=>{t.isReadonly?Fe(qe):Fe(de,!1)})}d(Le),s(fe,Le)},$e=fe=>{var Le=ye(),et=K(Le);{var qe=Fe=>{var _e=ui(),tt=u(_e),$=u(tt);oa($),$.__change=He;var ct=b($,2),Ue=u(ct,!0);d(ct),d(tt),d(_e),S((Rt,kt)=>{ya($,Rt),$.disabled=t.isReadonly,Z(Ue,kt)},[pe,()=>pe()?"On":"Off"]),s(Fe,_e)},de=Fe=>{var _e=ye(),tt=K(_e);{var $=ct=>{const Ue=W(x);var Rt=ye(),kt=K(Rt);{var Zt=we=>{var Oe=hi(),Qe=u(Oe);{var mt=ee=>{var Me=vi(),ke=u(Me);{let E=W(()=>({url:e(Ue).url,orig_name:e(Ue).name,path:e(Ue).url,mime_type:e(Ue).mime,meta:{_type:"gradio.FileData"}}));Eo(ke,{get value(){return e(E)},show_label:!1,i18n:ce,buttons:[]})}d(Me),s(ee,Me)},R=ee=>{var Me=ye(),ke=K(Me);{var E=be=>{var ae=pi();S(()=>{Te(ae,"src",e(Ue).url),Te(ae,"alt",e(Ue).name)}),s(be,ae)},ue=be=>{var ae=ye(),oe=K(ae);{var ze=Se=>{var Vt=fi();S(()=>Te(Vt,"src",e(Ue).url)),s(Se,Vt)},gt=Se=>{var Vt=ye(),ua=K(Vt);{var Qt=I=>{var ve=_i();S(()=>Te(ve,"src",e(Ue).url)),s(I,ve)},g=I=>{var ve=mi(),Pe=u(ve),Ee=u(Pe,!0);d(Pe),d(ve),S(()=>Z(Ee,e(Ue).name)),s(I,ve)};k(ua,I=>{t.widgetType==="video"?I(Qt):I(g,!1)},!0)}s(Se,Vt)};k(oe,Se=>{t.widgetType==="audio"?Se(ze):Se(gt,!1)},!0)}s(be,ae)};k(ke,be=>{t.widgetType==="image"||t.widgetType==="gallery"?be(E):be(ue,!1)},!0)}s(ee,Me)};k(Qe,ee=>{(t.widgetType==="image"||t.widgetType==="gallery")&&t.isReadonly?ee(mt):ee(R,!1)})}var L=b(Qe,2),Y=u(L);Y.__click=f;var Ce=u(Y);ai(Ce),d(Y);var Ie=b(Y,2);{var Re=ee=>{var Me=gi();Me.__click=dt,s(ee,Me)};k(Ie,ee=>{t.isReadonly||ee(Re)})}d(L),d(Oe),S(()=>Te(Y,"title",`Download ${e(Ue).name??""}`)),s(we,Oe)},Ut=we=>{var Oe=ye(),Qe=K(Oe);{var mt=L=>{var Y=bi();s(L,Y)},R=L=>{var Y=yi();Y.__click=()=>e(h)?.click(),Y.__keydown=ee=>{(ee.key==="Enter"||ee.key===" ")&&e(h)?.click()},Y.__mousedown=ee=>ee.stopPropagation(),Y.__pointerdown=ee=>ee.stopPropagation();var Ce=u(Y);Ce.__change=vt,wa(Ce,ee=>v(h,ee),()=>e(h));var Ie=b(Ce,2),Re=u(Ie);d(Ie),d(Y),S(()=>{Te(Ce,"accept",t.widgetType==="image"?"image/*":t.widgetType==="audio"?"audio/*":t.widgetType==="video"?"video/*":t.widgetType==="model3d"?".glb,.gltf,.obj,.stl":"*"),Z(Re,`Drop ${t.widgetType??""} or click`)}),ca("dragover",Y,ee=>{ee.preventDefault(),ee.stopPropagation()}),ca("drop",Y,A),s(L,Y)};k(Qe,L=>{t.isReadonly?L(mt):L(R,!1)},!0)}s(we,Oe)};k(kt,we=>{e(Ue)?we(Zt):we(Ut,!1)})}s(ct,Rt)};k(tt,ct=>{(t.widgetType==="image"||t.widgetType==="audio"||t.widgetType==="video"||t.widgetType==="file"||t.widgetType==="gallery"||t.widgetType==="model3d")&&ct($)},!0)}s(Fe,_e)};k(et,Fe=>{t.widgetType==="boolean"?Fe(qe):Fe(de,!1)},!0)}s(fe,Le)};k(xt,fe=>{t.widgetType==="number"?fe(F):fe($e,!1)},!0)}s(re,it)};k(Xe,re=>{t.widgetType==="text"||t.widgetType==="json"?re(ge):re(X,!1)},!0)}s(V,D)};k(T,V=>{e(l)&&e(r)?V(J):V(Q,!1)})}d(le),S(()=>w=he(le,1,"widget-zone nodrag nopan svelte-1twu31f",null,w,{"text-full":(t.widgetType==="text"||t.widgetType==="json")&&!e(l)})),s(n,le),ga()}ba(["mousedown","pointerdown","change","input","click","keydown"]);var ki=Ze('');function Yn(n){var t=ki();s(n,t)}var Ci=Ze('');function Ua(n){var t=Ci();s(n,t)}var Mi=m(''),Si=m(''),Pi=m(' '),Ai=m(''),Ti=m(''),Hi=m(' '),Ii=m(''),Ni=m('
            '),Vi=m('
            '),zi=m(''),Li=m(''),ji=m(''),Oi=m(``),Ri=m('
            '),Ei=m(' ',1),Di=m(''),Yi=m('
            '),Zi=m(''),Fi=m(''),Ui=m(''),Wi=m(''),Bi=m(''),Xi=m(''),qi=m('
            '),Gi=m('
            ',1),Ji=m(''),Ki=m("
            "),Qi=m(' ',1),$i=m('
            '),er=m("
            "),tr=m('
            '),ar=m('
            ');function nr(n,t){ma(t,!0);let i=lt(t,"selected",3,!1);const r=Io("wf"),l=W(()=>r.pending),_=W(()=>r.readOnly),h=W(()=>r.nodeStatus[t.id]??"idle"),N=W(()=>r.nodeErrors[t.id]??""),x=W(()=>r.staleNodes.has(t.id)),j=W(()=>r.connectedPorts),pe=W(()=>t.data.kind==="transform");let G,He=te(!1),me,ot=te(!1);function vt(R,L){if(L==="number"){const Y=Number(R);return Number.isNaN(Y)?R:Y}if(L==="boolean"){if(R==="true")return!0;if(R==="false")return!1}return R}function A(R){const L=R.trim();!e(_)&&L&&L!==t.data.label&&Ot.update(Y=>({...Y,references:Y.references.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce),operators:Y.operators.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce),subjects:Y.subjects.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce)})),v(He,!1)}const dt=W(()=>t.data.outputs[0]?.type??t.data.inputs[0]?.type??"any"),f=W(()=>fa[e(dt)]),ce=W(()=>Do[e(dt)]),le=W(()=>t.data.kind==="component"),w=W(()=>e(le)&&t.data.inputs[0]?e(j).has(`${t.data.id}:${t.data.inputs[0].id}:input`):!1),T=W(()=>e(le)?e(w)?"output":"input":t.data.kind),J=W(()=>e(T)==="input"||e(T)==="output"),Q=W(()=>e(T)==="input"?t.data.outputs[0]?.id??null:e(T)==="output"?t.data.inputs[0]?.id??null:null),V=W(()=>e(T)==="input"?t.data.outputs[0]?.type??null:e(T)==="output"?t.data.inputs[0]?.type??null:null),D=W(()=>e(T)==="output");function Xe(R){return R.space_id?`https://huggingface.co/spaces/${R.space_id}`:R.model_id?`https://huggingface.co/${R.model_id}`:R.dataset_id?`https://huggingface.co/datasets/${R.dataset_id}`:""}const ge=W(()=>e(l)!==null&&e(l).from_node_id!==t.data.id&&t.data.inputs.some(R=>aa(e(l).type,R.type)&&!e(j).has(`${t.data.id}:${R.id}:input`)));Lt(()=>{if(!G)return;const R=new ResizeObserver(([L])=>{const Y=Math.ceil(L.borderBoxSize[0].blockSize);Math.abs(Y-t.data.height)>1&&Ko(t.data.id,t.data.width,Y)});return R.observe(G),()=>R.disconnect()});var X=ar();let re;X.__click=R=>r.onselect(t.data.id,R.shiftKey);var it=u(X),xt=u(it),F=u(xt);{var $e=R=>{var L=Mi();s(R,L)};k(F,R=>{e(h)==="running"&&R($e)})}var fe=b(F,2);{var Le=R=>{var L=Si();oa(L),L.__keydown=Y=>{Y.key==="Enter"&&A(Y.currentTarget.value),Y.key==="Escape"&&v(He,!1),Y.stopPropagation()},L.__mousedown=Y=>Y.stopPropagation(),wa(L,Y=>me=Y,()=>me),S(()=>va(L,t.data.label)),ca("blur",L,Y=>A(Y.currentTarget.value)),s(R,L)},et=R=>{var L=Pi();L.__dblclick=Ce=>{Ce.stopPropagation(),!e(_)&&(v(He,!0),requestAnimationFrame(()=>me?.select()))};var Y=u(L,!0);d(L),S(()=>Z(Y,t.data.label)),s(R,L)};k(fe,R=>{e(He)?R(Le):R(et,!1)})}var qe=b(fe,2);{var de=R=>{var L=Ai();let Y;L.__pointerdown=Ie=>Ie.stopPropagation(),L.__mousedown=Ie=>Ie.stopPropagation(),L.__click=Ie=>{Ie.stopPropagation(),r.onrunnode(t.data.id)};var Ce=u(L);Yn(Ce),d(L),S(()=>{Y=he(L,1,"node-run svelte-1ruw0hv",null,Y,{"node-run-stale":e(x)}),Te(L,"title",e(x)?"Run this node (inputs changed)":"Run this node")}),s(R,L)};k(qe,R=>{e(pe)&&R(de)})}var Fe=b(qe,2);{var _e=R=>{var L=Ti();L.__pointerdown=Y=>Y.stopPropagation(),L.__mousedown=Y=>Y.stopPropagation(),L.__click=Y=>{Y.stopPropagation(),r.onremove(t.data.id)},s(R,L)};k(Fe,R=>{e(_)||R(_e)})}d(xt),d(it);var tt=b(it,2);{var $=R=>{var L=ye(),Y=K(L);{var Ce=Re=>{const ee=W(()=>t.data.space_id??t.data.model_id??t.data.dataset_id??"");var Me=Ni(),ke=u(Me);{var E=oe=>{var ze=Hi(),gt=u(ze,!0);d(ze),S(Se=>Z(gt,Se),[()=>e(ee).split("/").pop()??e(ee)]),s(oe,ze)},ue=oe=>{var ze=Ii();ze.__pointerdown=Se=>Se.stopPropagation(),ze.__mousedown=Se=>Se.stopPropagation(),ze.__click=Se=>{Se.stopPropagation(),r.onopenpicker(t.data.id)};var gt=u(ze,!0);d(ze),S(Se=>Z(gt,Se),[()=>e(ee).split("/").pop()??e(ee)]),s(oe,ze)};k(ke,oe=>{e(_)?oe(E):oe(ue,!1)})}var be=b(ke,2);be.__pointerdown=oe=>oe.stopPropagation(),be.__mousedown=oe=>oe.stopPropagation(),be.__click=oe=>oe.stopPropagation();var ae=u(be);Ua(ae),d(be),d(Me),S(oe=>Te(be,"href",oe),[()=>Xe(t.data)]),s(Re,Me)},Ie=Re=>{var ee=ye(),Me=K(ee);{var ke=ue=>{var be=Vi(),ae=u(be),oe=u(ae);d(ae),d(be),S(()=>Z(oe,`${t.data.fn??""}()`)),s(ue,be)},E=ue=>{var be=ye(),ae=K(be);{var oe=ze=>{var gt=zi();gt.__pointerdown=Se=>Se.stopPropagation(),gt.__mousedown=Se=>Se.stopPropagation(),gt.__click=Se=>{Se.stopPropagation(),r.onopenpicker(t.data.id)},s(ze,gt)};k(ae,ze=>{e(_)||ze(oe)},!0)}s(ue,be)};k(Me,ue=>{t.data.fn?ue(ke):ue(E,!1)},!0)}s(Re,ee)};k(Y,Re=>{t.data.space_id||t.data.model_id||t.data.dataset_id?Re(Ce):Re(Ie,!1)})}s(R,L)};k(tt,R=>{t.data.kind==="transform"&&R($)})}var ct=b(tt,2);{var Ue=R=>{var L=Ri();L.__pointerdown=Re=>Re.stopPropagation(),L.__mousedown=Re=>Re.stopPropagation();var Y=u(L);{var Ce=Re=>{var ee=ji();ee.__pointerdown=ke=>ke.stopPropagation(),ee.__mousedown=ke=>ke.stopPropagation(),ee.__click=ke=>ke.stopPropagation(),ee.__change=ke=>{ke.stopPropagation(),r.onswitchendpoint(t.data.id,ke.currentTarget.value)},St(ee,21,()=>t.data.endpoints,Xt,(ke,E)=>{var ue=Li(),be=u(ue,!0);d(ue);var ae={};S(()=>{Z(be,e(E).name),ae!==(ae=e(E).name)&&(ue.value=(ue.__value=e(E).name)??"")}),s(ke,ue)}),d(ee);var Me;fn(ee),S(()=>{ee.disabled=e(_),Me!==(Me=t.data.endpoint??"")&&(ee.value=(ee.__value=t.data.endpoint??"")??"",_n(ee,t.data.endpoint??""))}),s(Re,ee)},Ie=Re=>{var ee=ye(),Me=K(ee);{var ke=E=>{var ue=Oi();ue.__pointerdown=ae=>ae.stopPropagation(),ue.__mousedown=ae=>ae.stopPropagation(),ue.__click=ae=>{ae.stopPropagation(),r.onhydratendpoints(t.data.id,t.data.space_id??"")};var be=u(ue);d(ue),S(()=>Z(be,`${t.data.endpoint??"/predict"??""} ▾`)),s(E,ue)};k(Me,E=>{t.data.endpoints||E(ke)},!0)}s(Re,ee)};k(Y,Re=>{t.data.endpoints&&t.data.endpoints.length>1?Re(Ce):Re(Ie,!1)})}d(L),s(R,L)};k(ct,R=>{t.data.space_id&&R(Ue)})}var Rt=b(ct,2);{var kt=R=>{const L=W(()=>t.data.inputs.filter(ke=>ke.required===!1&&!e(j).has(`${t.data.id}:${ke.id}:input`)).length),Y=W(()=>e(L)>0);var Ce=Ki();let Ie;var Re=u(Ce);St(Re,17,()=>t.data.inputs,Xt,(ke,E)=>{const ue=W(()=>e(j).has(`${t.data.id}:${e(E).id}:input`)),be=W(()=>e(ot)||e(ue)||e(E).required!==!1);var ae=ye(),oe=K(ae);{var ze=gt=>{var Se=Gi(),Vt=K(Se);let ua;var Qt=u(Vt);let g;Qt.__pointerdown=se=>r.onportpointerdown(se,t.data.id,e(E).id,e(E).type,!0);var I=b(Qt,2);{var ve=se=>{var xe=Ei(),je=K(xe);let Ge;var ht=u(je,!0);d(je);var ne=b(je,2),pt=u(ne,!0);d(ne),S(()=>{Ge=he(je,1,"port-label svelte-1ruw0hv",null,Ge,{"port-label-optional":e(E).required===!1}),Z(ht,e(E).label),Bt(ne,`color: ${fa[e(E).type]??""}`),Z(pt,e(E).type)}),s(se,xe)};k(I,se=>{e(J)||se(ve)})}d(Vt);var Pe=b(Vt,2);{var Ee=se=>{var xe=qi();xe.__mousedown=ne=>ne.stopPropagation();var je=u(xe);{var Ge=ne=>{const pt=W(()=>Array.isArray(t.data.data?.[e(E).id])?t.data.data[e(E).id]:[]);var Pt=Yi();St(Pt,21,()=>e(E).choices,Xt,(at,Je)=>{var We=Di(),De=u(We);oa(De),De.__change=Ye=>{const q=Ye.currentTarget.checked?[...e(pt),e(Je)]:e(pt).filter(Ne=>Ne!==e(Je));r.ondatachange(t.data.id,e(E).id,q)};var rt=b(De,2),ft=u(rt,!0);d(rt),d(We),S(Ye=>{ya(De,Ye),Z(ft,e(Je))},[()=>e(pt).includes(e(Je))]),s(at,We)}),d(Pt),s(ne,Pt)},ht=ne=>{var pt=ye(),Pt=K(pt);{var at=We=>{const De=W(()=>t.data.data?.[e(E).id]??e(E).default_value),rt=W(()=>e(De)!=null?String(e(De)):""),ft=W(()=>e(E).choices.includes(e(rt)));var Ye=Ui();Ye.__change=Ct=>{const Ke=Ct.currentTarget.value;Ke!==""&&r.ondatachange(t.data.id,e(E).id,vt(Ke,e(E).type))};var q=u(Ye);{var Ne=Ct=>{var Ke=Zi(),st=u(Ke);d(Ke),Ke.value=Ke.__value="",S(()=>Z(st,`Select ${e(E).label??""}`)),s(Ct,Ke)};k(q,Ct=>{e(ft)||Ct(Ne)})}var bt=b(q);St(bt,17,()=>e(E).choices,Xt,(Ct,Ke)=>{var st=Fi(),yt=u(st,!0);d(st);var Et={};S(()=>{Z(yt,e(Ke)),Et!==(Et=e(Ke))&&(st.value=(st.__value=e(Ke))??"")}),s(Ct,st)}),d(Ye);var Tt;fn(Ye),S(()=>{Tt!==(Tt=e(ft)?e(rt):"")&&(Ye.value=(Ye.__value=e(ft)?e(rt):"")??"",_n(Ye,e(ft)?e(rt):""))}),s(We,Ye)},Je=We=>{var De=ye(),rt=K(De);{var ft=q=>{var Ne=Wi();oa(Ne),Ne.__input=bt=>r.ondatachange(t.data.id,e(E).id,parseFloat(bt.currentTarget.value)||0),S(bt=>{Te(Ne,"placeholder",bt),va(Ne,t.data.data?.[e(E).id]??"")},[()=>e(E).default_value!=null?String(e(E).default_value):"0"]),s(q,Ne)},Ye=q=>{var Ne=ye(),bt=K(Ne);{var Tt=Ke=>{var st=Bi(),yt=u(st);oa(yt),yt.__change=$t=>r.ondatachange(t.data.id,e(E).id,$t.currentTarget.checked);var Et=b(yt,2),jt=u(Et,!0);d(Et),d(st),S(()=>{ya(yt,!!t.data.data?.[e(E).id]),Z(jt,t.data.data?.[e(E).id]?"On":"Off")}),s(Ke,st)},Ct=Ke=>{var st=Xi();oa(st),st.__input=yt=>r.ondatachange(t.data.id,e(E).id,yt.currentTarget.value),S(yt=>{Te(st,"placeholder",yt),va(st,typeof t.data.data?.[e(E).id]=="string"?t.data.data[e(E).id]:"")},[()=>e(E).default_value!=null?String(e(E).default_value):e(E).label]),s(Ke,st)};k(bt,Ke=>{e(E).type==="boolean"?Ke(Tt):Ke(Ct,!1)},!0)}s(q,Ne)};k(rt,q=>{e(E).type==="number"?q(ft):q(Ye,!1)},!0)}s(We,De)};k(Pt,We=>{e(E).choices&&e(E).choices.length>0?We(at):We(Je,!1)},!0)}s(ne,pt)};k(je,ne=>{e(E).choices&&e(E).choices.length>0&&e(E).multiselect?ne(Ge):ne(ht,!1)})}d(xe),s(se,xe)};k(Pe,se=>{!e(ue)&&t.data.kind==="transform"&&(e(E).type==="text"||e(E).type==="number"||e(E).type==="boolean"||e(E).type==="any"||e(E).type==="json")&&se(Ee)})}S(se=>{ua=he(Vt,1,"port-row input-row svelte-1ruw0hv",null,ua,{"widget-port":e(J)}),g=he(Qt,1,"port-handle-sf input-handle-sf svelte-1ruw0hv",null,g,se),Te(Qt,"data-node-id",t.data.id),Te(Qt,"data-port-id",e(E).id),Te(Qt,"data-port-type",e(E).type),Bt(Qt,`--port-color: ${fa[e(E).type]??""}`)},[()=>({connected:e(ue),incompatible:e(l)!==null&&!aa(e(l).type,e(E).type),pulse:e(l)!==null&&aa(e(l).type,e(E).type)})]),s(gt,Se)};k(oe,gt=>{e(be)&>(ze)})}s(ke,ae)});var ee=b(Re,2);{var Me=ke=>{var E=Ji();E.__pointerdown=oe=>oe.stopPropagation(),E.__mousedown=oe=>oe.stopPropagation(),E.__click=oe=>{oe.stopPropagation(),v(ot,!e(ot))};var ue=u(E);{var be=oe=>{var ze=Pa("▴ show less");s(oe,ze)},ae=oe=>{var ze=Pa();S(()=>Z(ze,`▾ ${e(L)??""} optional param${e(L)===1?"":"s"}`)),s(oe,ze)};k(ue,oe=>{e(ot)?oe(be):oe(ae,!1)})}d(E),s(ke,E)};k(ee,ke=>{e(Y)&&ke(Me)})}d(Ce),S(()=>Ie=he(Ce,1,"ports svelte-1ruw0hv",null,Ie,{"widget-ports":e(J)})),s(R,Ce)};k(Rt,R=>{t.data.inputs.length>0&&R(kt)})}var Zt=b(Rt,2);{var Ut=R=>{xi(R,{get node(){return t.data},get widgetPortId(){return e(Q)},get widgetType(){return e(V)},get isReadonly(){return e(D)},get ondatachange(){return r.ondatachange}})};k(Zt,R=>{e(J)&&e(Q)&&e(V)&&R(Ut)})}var we=b(Zt,2);{var Oe=R=>{var L=er();let Y;St(L,21,()=>t.data.outputs,Xt,(Ce,Ie)=>{const Re=W(()=>e(j).has(`${t.data.id}:${e(Ie).id}:output`));var ee=$i();let Me;var ke=u(ee);{var E=ae=>{var oe=Qi(),ze=K(oe),gt=u(ze,!0);d(ze);var Se=b(ze,2),Vt=u(Se,!0);d(Se),S(()=>{Bt(ze,`color: ${fa[e(Ie).type]??""}`),Z(gt,e(Ie).type),Z(Vt,e(Ie).label)}),s(ae,oe)};k(ke,ae=>{e(J)||ae(E)})}var ue=b(ke,2);let be;ue.__pointerdown=ae=>r.onportpointerdown(ae,t.data.id,e(Ie).id,e(Ie).type,!1),d(ee),S(()=>{Me=he(ee,1,"port-row output-row svelte-1ruw0hv",null,Me,{"widget-port":e(J)}),be=he(ue,1,"port-handle-sf output-handle-sf svelte-1ruw0hv",null,be,{connected:e(Re)}),Te(ue,"data-node-id",t.data.id),Te(ue,"data-port-id",e(Ie).id),Te(ue,"data-port-type",e(Ie).type),Bt(ue,`--port-color: ${fa[e(Ie).type]??""}`)}),s(Ce,ee)}),d(L),S(()=>Y=he(L,1,"ports svelte-1ruw0hv",null,Y,{"widget-ports":e(J)})),s(R,L)};k(we,R=>{t.data.outputs.length>0&&R(Oe)})}var Qe=b(we,2);{var mt=R=>{var L=tr(),Y=u(L,!0);d(L),S(()=>Z(Y,e(N))),s(R,L)};k(Qe,R=>{e(h)==="error"&&e(N)&&R(mt)})}d(X),wa(X,R=>G=R,()=>G),S(()=>{re=he(X,1,"wf-node svelte-1ruw0hv",null,re,{"node-transform":t.data.kind==="transform","node-running":e(h)==="running","node-done":e(h)==="done","node-error":e(h)==="error","node-stale":e(x),"node-selected":i(),"node-droptarget":e(ge),"has-pending":e(l)!==null}),Bt(X,` +import{F as Mo,i as k,b as he,q as St,y as ya,a as Te,J as va,w as Xt,v as oa,d as wa,p as lt,f as Bt,Z as fn,_ as _n,j as Yt,u as So,t as Po,G as Ao,k as To,r as Ho}from"./i18n-DtG3MAQ1.js";import{a as s,f as Ze,ah as ba,M as ma,Z as e,t as S,O as ga,a2 as W,Q as u,S as b,X as Z,a3 as ye,N as K,R as m,T as d,$ as v,U as ca,aa as te,aw as Io,ac as Lt,a4 as Pa,a5 as na,ab as Wt,aj as No,a$ as Vo,a7 as zo,ax as Lo}from"./index-BeNBoC9J.js";import{k as jo}from"./key-CbBDWaWR.js";import{t as mn,f as gn}from"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{T as Oo}from"./Textbox-a-5KfA85.js";import{c as Ro}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */import{I as Eo}from"./ImagePreview-Dr2yPezw.js";/* empty css */import"./Upload-CGTpHDBO.js";/* empty css *//* empty css */import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";import"./actions-BbCJS635.js";import"./input-BLFxNjIx.js";import"./BlockTitle-B6Pgijwb.js";import"./Info-BjDIKIgf.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./Send--YHrNLI0.js";import"./Square-CSlbzSkn.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./snippet-BRIBYCwB.js";import"./misc-D-Y84gKJ.js";import"./BlockLabel-CEOjqpu7.js";import"./DownloadLink-Dk6GrGSA.js";import"./Empty-Clj0ErcW.js";import"./ShareButton-ImGYvlzQ.js";import"./Download-0gCL6VXM.js";import"./Image-DWBzZYev.js";import"./FullscreenButton-CFl3IB4T.js";import"./Maximize-DQMU3SdR.js";import"./Image-ALBOEs1f.js";/* empty css */function aa(n,t){return n==="any"||t==="any"||n===t}const fa={image:"#4fd1a5",text:"#8b83e8",audio:"#f5a623",video:"#4d9cf5",number:"#e879a8",boolean:"#f59e0b",file:"#94a3b8",json:"#22d3ee",gallery:"#34d399",model3d:"#a78bfa",any:"#6b6e78"},Do={image:"rgba(79, 209, 165, 0.15)",text:"rgba(139, 131, 232, 0.15)",audio:"rgba(245, 166, 35, 0.15)",video:"rgba(77, 156, 245, 0.15)",number:"rgba(232, 121, 168, 0.15)",boolean:"rgba(245, 158, 11, 0.15)",file:"rgba(148, 163, 184, 0.15)",json:"rgba(34, 211, 238, 0.15)",gallery:"rgba(52, 211, 153, 0.15)",model3d:"rgba(167, 139, 250, 0.15)",any:"rgba(107, 110, 120, 0.10)"};function Yo(n){if(!n||typeof n!="object")return!1;const t=n;return t.schema_version==="2"&&Array.isArray(t.references)&&Array.isArray(t.operators)&&Array.isArray(t.subjects)&&Array.isArray(t.edges)}function Zo(n){if(Yo(n))return n;const t=n??{},i=Array.isArray(t.nodes)?t.nodes:[],r=Array.isArray(t.edges)?t.edges:[],l=new Set;for(const x of r)l.add(x.to_node_id);const _=[],h=[],N=[];for(const x of i){const j={id:x.id,label:x.label??"",inputs:x.inputs??[],outputs:x.outputs??[],data:x.data??{},x:x.x??0,y:x.y??0,width:x.width??200,height:x.height??100};if(x.kind==="transform"){const G=Fo(x);h.push({...j,role:"operator",kind:G,source:Uo(x,G),space_id:x.space_id,model_id:x.model_id,dataset_id:x.dataset_id,dataset_config:x.dataset_config,dataset_split:x.dataset_split,endpoint:x.endpoint,pipeline_tag:x.pipeline_tag,provider:x.provider,fn:x.fn,runtime:"client"});continue}const pe=x.outputs?.[0]?.type??x.inputs?.[0]?.type??"any";l.has(x.id)?N.push({...j,role:"subject",asset_type:pe}):_.push({...j,role:"reference",asset_type:pe})}return{schema_version:"2",name:t.name??"My workflow",runtime:{default:"client"},references:_,operators:h,subjects:N,edges:r,view:{default:"canvas"}}}function Fo(n){return n.space_id||n.source==="space"?"space":n.model_id||n.source==="model"?"model":n.dataset_id||n.source==="dataset"?"dataset":"fn"}function Uo(n,t){if(t==="space"&&n.space_id)return`hf://spaces/${n.space_id}`;if(t==="model"&&n.model_id)return`hf://${n.model_id}`;if(t==="dataset"&&n.dataset_id)return`hf://datasets/${n.dataset_id}`;if(t==="fn")return n.fn??void 0}function Wo(n,t){return n.references.find(i=>i.id===t)??n.operators.find(i=>i.id===t)??n.subjects.find(i=>i.id===t)}function En(n){const t=new Set;for(const r of n.edges)t.add(r.to_node_id);const i=[];for(const r of n.references)i.push({id:r.id,kind:"component",label:r.label,source:"local",inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});for(const r of n.operators)i.push({id:r.id,kind:"transform",label:r.label,source:r.kind,space_id:r.space_id,model_id:r.model_id,dataset_id:r.dataset_id,dataset_config:r.dataset_config,dataset_split:r.dataset_split,endpoint:r.endpoint,endpoints:r.endpoints,pipeline_tag:r.pipeline_tag,provider:r.provider,fn:r.fn,inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});for(const r of n.subjects)i.push({id:r.id,kind:"component",label:r.label,source:"local",inputs:r.inputs,outputs:r.outputs,x:r.x,y:r.y,width:r.width,height:r.height,data:r.data});return{version:"1",name:n.name,nodes:i,edges:n.edges}}function Ta(){return crypto.randomUUID()}const Bo={schema_version:"2",name:"My workflow",runtime:{default:"client"},references:[{id:"ref_default",role:"reference",label:"Image",asset_type:"image",inputs:[{id:"in",label:"Image",type:"image"}],outputs:[{id:"out",label:"Image",type:"image"}],data:{},x:80,y:120,width:200,height:160}],operators:[],subjects:[],edges:[],view:{default:"canvas"}},Ot=Mo(Bo);function Xo(n){const t=n?.url;return typeof t=="string"&&(t.startsWith("blob:")||t.startsWith("data:"))}function Dn(n){for(const t of Object.values(n??{})){const i=t?.url;typeof i=="string"&&i.startsWith("blob:")&&URL.revokeObjectURL(i)}}function Fa(n){return Ha(n,t=>{if(!t.data)return t;const i={};for(const[r,l]of Object.entries(t.data))Xo(l)||(i[r]=l);return{...t,data:i}})}function qo(n,t,i){const r=Ta(),l={};for(const h of n.inputs)h.default_value!==void 0&&(l[h.id]=h.default_value);const _={...n,role:"reference",id:r,x:t,y:i,data:l};return Ot.update(h=>({...h,references:[...h.references,_]})),r}function Go(n,t,i){const r=Ta(),l={};for(const h of n.inputs)h.default_value!==void 0&&(l[h.id]=h.default_value);const _={...n,role:"operator",id:r,x:t,y:i,data:l};return Ot.update(h=>({...h,operators:[...h.operators,_]})),r}function Jo(n,t,i){const r=Ta(),l={...n,role:"subject",id:r,x:t,y:i,data:{}};return Ot.update(_=>({..._,subjects:[..._.subjects,l]})),r}function la(n,t,i,r){const l={label:t.label??"",inputs:t.inputs??[],outputs:t.outputs??[],width:t.width??200,height:t.height??100};if(n==="reference"){const h=t.asset_type??t.outputs?.[0]?.type??t.inputs?.[0]?.type??"any";return qo({...l,asset_type:h},i,r)}if(n==="operator"){const h=t.source==="space"||t.source==="model"||t.source==="dataset"||t.source==="fn"?t.source:t.kind==="space"||t.kind==="model"||t.kind==="dataset"||t.kind==="fn"?t.kind:t.space_id?"space":t.model_id?"model":t.dataset_id?"dataset":"fn";return Go({...l,kind:h,source:t.source&&typeof t.source=="string"&&t.source.startsWith("hf://")?t.source:void 0,space_id:t.space_id,model_id:t.model_id,dataset_id:t.dataset_id,dataset_config:t.dataset_config,dataset_split:t.dataset_split,endpoint:t.endpoint,endpoints:t.endpoints,pipeline_tag:t.pipeline_tag,provider:t.provider,fn:t.fn,runtime:t.runtime},i,r)}const _=t.asset_type??t.inputs?.[0]?.type??t.outputs?.[0]?.type??"any";return Jo({...l,asset_type:_},i,r)}function Ha(n,t){return{...n,references:n.references.map(i=>t(i)),operators:n.operators.map(i=>t(i)),subjects:n.subjects.map(i=>t(i))}}function hn(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,x:t,y:i}:l))}function Ko(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,width:t,height:i}:l))}function La(n,t,i){Ot.update(r=>Ha(r,l=>l.id===n?{...l,data:{...l.data,[t]:i}}:l))}function bn(n){Ot.update(t=>{const i=Wo(t,n);return i&&Dn(i.data),{...t,references:t.references.filter(r=>r.id!==n),operators:t.operators.filter(r=>r.id!==n),subjects:t.subjects.filter(r=>r.id!==n),edges:t.edges.filter(r=>r.from_node_id!==n&&r.to_node_id!==n)}})}function pa(n){Ot.update(t=>({...t,edges:[...t.edges,{...n,id:Ta()}]}))}function yn(n){Ot.update(t=>({...t,edges:t.edges.filter(i=>i.id!==n)}))}function Qo(n,t){Ot.update(i=>({...i,operators:i.operators.map(r=>r.id===n?{...r,endpoints:t}:r)}))}function $o(n,t){Ot.update(i=>{const r=i.operators.find(N=>N.id===n);if(!r||!r.endpoints)return i;const l=r.endpoints.find(N=>N.name===t);if(!l||l.name===r.endpoint)return i;const _=new Map(l.inputs.map(N=>[N.id,N])),h=new Map(l.outputs.map(N=>[N.id,N]));return{...i,operators:i.operators.map(N=>N.id===n?{...N,endpoint:l.name,inputs:l.inputs,outputs:l.outputs,data:{}}:N),edges:i.edges.filter(N=>{if(N.from_node_id===n){const x=h.get(N.from_port_id);if(!x||!aa(x.type,N.type))return!1}if(N.to_node_id===n){const x=_.get(N.to_port_id);if(!x||!aa(x.type,N.type))return!1}return!0})}})}function ei(n,t){Ot.update(i=>({...i,operators:i.operators.map(r=>{if(r.id!==n)return r;const l={...r};return delete l.space_id,delete l.model_id,delete l.dataset_id,delete l.dataset_config,delete l.dataset_split,delete l.endpoint,delete l.pipeline_tag,delete l.source,{...l,...t.kind&&{kind:t.kind},...t.source!==void 0&&{source:t.source},...t.space_id!==void 0&&{space_id:t.space_id},...t.model_id!==void 0&&{model_id:t.model_id},...t.dataset_id!==void 0&&{dataset_id:t.dataset_id},...t.dataset_config!==void 0&&{dataset_config:t.dataset_config},...t.dataset_split!==void 0&&{dataset_split:t.dataset_split},...t.endpoint!==void 0&&{endpoint:t.endpoint},...t.pipeline_tag!==void 0&&{pipeline_tag:t.pipeline_tag},inputs:t.inputs,outputs:t.outputs,label:t.label??r.label,width:t.width??r.width,data:{}}})}))}var ti=Ze('');function ai(n){var t=ti();s(n,t)}var ni=m(''),oi=m(''),ii=m(''),ri=m('
            '),si=m('
            '),li=m('
            '),di=m(''),ci=m('
            '),ui=m('
            '),vi=m('
            '),pi=m(''),fi=m(''),_i=m('',2),mi=m('
            '),gi=m(''),hi=m('
            '),bi=m('
            Waiting for output...
            '),yi=m('
            '),wi=m("
            ");function xi(n,t){ma(t,!0);const i=W(()=>t.node.outputs.find(V=>V.id===t.widgetPortId)??t.node.inputs.find(V=>V.id===t.widgetPortId)),r=W(()=>e(i)?.choices??null),l=W(()=>!!e(r)?.length),_=W(()=>!!e(i)?.multiselect);let h=te(void 0);function N(){const V=t.node.data?.[t.widgetPortId];return typeof V=="string"?V:""}function x(){const V=t.node.data?.[t.widgetPortId];return V&&typeof V=="object"&&!Array.isArray(V)?V:null}function j(){const V=t.node.data?.[t.widgetPortId];return typeof V=="number"?V:0}function pe(){const V=t.node.data?.[t.widgetPortId];return typeof V=="boolean"?V:!1}function G(V){const D=V.currentTarget;t.ondatachange(t.node.id,t.widgetPortId,parseFloat(D.value)||0)}function He(V){const D=V.currentTarget;t.ondatachange(t.node.id,t.widgetPortId,D.checked)}function me(){const V=x();V?.url?.startsWith("blob:")&&URL.revokeObjectURL(V.url)}function ot(V){me(),t.ondatachange(t.node.id,t.widgetPortId,{name:V.name,url:URL.createObjectURL(V),mime:V.type})}function vt(V){const D=V.currentTarget.files?.[0];D&&ot(D)}function A(V){V.preventDefault(),V.stopPropagation();const D=V.dataTransfer?.files?.[0];D&&ot(D)}function dt(){me(),t.ondatachange(t.node.id,t.widgetPortId,null)}async function f(){const V=x();if(!V?.url)return;const D=V.name||"download",Xe=V.url.startsWith("blob:")||V.url.startsWith("data:")||V.url.startsWith("http")&&new URL(V.url,window.location.origin).origin===window.location.origin||!V.url.startsWith("http");try{const ge=Xe?V.url:await fetch(V.url).then(re=>re.blob()).then(re=>URL.createObjectURL(re)),X=document.createElement("a");X.href=ge,X.download=D,document.body.appendChild(X),X.click(),document.body.removeChild(X),Xe||setTimeout(()=>URL.revokeObjectURL(ge),1e3)}catch{window.open(V.url,"_blank","noopener")}}const ce=V=>V;var le=wi();let w;le.__mousedown=V=>V.stopPropagation(),le.__pointerdown=V=>V.stopPropagation();var T=u(le);{var J=V=>{const D=W(()=>t.node.data?.[t.widgetPortId]),Xe=W(()=>e(_)&&Array.isArray(e(D))?e(D):[]),ge=W(()=>!e(_)&&typeof e(D)=="string"?e(D):"");var X=ri();St(X,21,()=>e(r),Xt,(re,it)=>{var xt=ii(),F=u(xt);{var $e=qe=>{var de=ni();oa(de),de.__change=Fe=>t.ondatachange(t.node.id,t.widgetPortId,Fe.currentTarget.checked?[...e(Xe),e(it)]:e(Xe).filter(_e=>_e!==e(it))),S(Fe=>{ya(de,Fe),de.disabled=t.isReadonly},[()=>e(Xe).includes(e(it))]),s(qe,de)},fe=qe=>{var de=oi();oa(de),de.__change=()=>t.ondatachange(t.node.id,t.widgetPortId,e(it)),S(()=>{Te(de,"name",`${t.node.id??""}-${t.widgetPortId??""}`),va(de,e(it)),ya(de,e(ge)===e(it)),de.disabled=t.isReadonly}),s(qe,de)};k(F,qe=>{e(_)?qe($e):qe(fe,!1)})}var Le=b(F,2),et=u(Le,!0);d(Le),d(xt),S(()=>Z(et,e(it))),s(re,xt)}),d(X),s(V,X)},Q=V=>{var D=ye(),Xe=K(D);{var ge=re=>{var it=si(),xt=u(it),F=u(xt);{let $e=W(N),fe=W(()=>t.widgetType==="json"?4:3),Le=W(()=>t.isReadonly?"Waiting for output...":t.widgetType==="json"?'{"key": "value"}':"Enter text...");Oo(F,{get value(){return e($e)},label:"text",show_label:!1,get lines(){return e(fe)},max_lines:8,get placeholder(){return e(Le)},get disabled(){return t.isReadonly},oninput:et=>t.ondatachange(t.node.id,t.widgetPortId,et)})}d(xt),d(it),s(re,it)},X=re=>{var it=ye(),xt=K(it);{var F=fe=>{var Le=ci(),et=u(Le);{var qe=Fe=>{var _e=li(),tt=u(_e,!0);d(_e),S($=>Z(tt,$),[j]),s(Fe,_e)},de=Fe=>{var _e=di();oa(_e),_e.__input=G,S(tt=>va(_e,tt),[j]),s(Fe,_e)};k(et,Fe=>{t.isReadonly?Fe(qe):Fe(de,!1)})}d(Le),s(fe,Le)},$e=fe=>{var Le=ye(),et=K(Le);{var qe=Fe=>{var _e=ui(),tt=u(_e),$=u(tt);oa($),$.__change=He;var ct=b($,2),Ue=u(ct,!0);d(ct),d(tt),d(_e),S((Rt,kt)=>{ya($,Rt),$.disabled=t.isReadonly,Z(Ue,kt)},[pe,()=>pe()?"On":"Off"]),s(Fe,_e)},de=Fe=>{var _e=ye(),tt=K(_e);{var $=ct=>{const Ue=W(x);var Rt=ye(),kt=K(Rt);{var Zt=we=>{var Oe=hi(),Qe=u(Oe);{var mt=ee=>{var Me=vi(),ke=u(Me);{let E=W(()=>({url:e(Ue).url,orig_name:e(Ue).name,path:e(Ue).url,mime_type:e(Ue).mime,meta:{_type:"gradio.FileData"}}));Eo(ke,{get value(){return e(E)},show_label:!1,i18n:ce,buttons:[]})}d(Me),s(ee,Me)},R=ee=>{var Me=ye(),ke=K(Me);{var E=be=>{var ae=pi();S(()=>{Te(ae,"src",e(Ue).url),Te(ae,"alt",e(Ue).name)}),s(be,ae)},ue=be=>{var ae=ye(),oe=K(ae);{var ze=Se=>{var Vt=fi();S(()=>Te(Vt,"src",e(Ue).url)),s(Se,Vt)},gt=Se=>{var Vt=ye(),ua=K(Vt);{var Qt=I=>{var ve=_i();S(()=>Te(ve,"src",e(Ue).url)),s(I,ve)},g=I=>{var ve=mi(),Pe=u(ve),Ee=u(Pe,!0);d(Pe),d(ve),S(()=>Z(Ee,e(Ue).name)),s(I,ve)};k(ua,I=>{t.widgetType==="video"?I(Qt):I(g,!1)},!0)}s(Se,Vt)};k(oe,Se=>{t.widgetType==="audio"?Se(ze):Se(gt,!1)},!0)}s(be,ae)};k(ke,be=>{t.widgetType==="image"||t.widgetType==="gallery"?be(E):be(ue,!1)},!0)}s(ee,Me)};k(Qe,ee=>{(t.widgetType==="image"||t.widgetType==="gallery")&&t.isReadonly?ee(mt):ee(R,!1)})}var L=b(Qe,2),Y=u(L);Y.__click=f;var Ce=u(Y);ai(Ce),d(Y);var Ie=b(Y,2);{var Re=ee=>{var Me=gi();Me.__click=dt,s(ee,Me)};k(Ie,ee=>{t.isReadonly||ee(Re)})}d(L),d(Oe),S(()=>Te(Y,"title",`Download ${e(Ue).name??""}`)),s(we,Oe)},Ut=we=>{var Oe=ye(),Qe=K(Oe);{var mt=L=>{var Y=bi();s(L,Y)},R=L=>{var Y=yi();Y.__click=()=>e(h)?.click(),Y.__keydown=ee=>{(ee.key==="Enter"||ee.key===" ")&&e(h)?.click()},Y.__mousedown=ee=>ee.stopPropagation(),Y.__pointerdown=ee=>ee.stopPropagation();var Ce=u(Y);Ce.__change=vt,wa(Ce,ee=>v(h,ee),()=>e(h));var Ie=b(Ce,2),Re=u(Ie);d(Ie),d(Y),S(()=>{Te(Ce,"accept",t.widgetType==="image"?"image/*":t.widgetType==="audio"?"audio/*":t.widgetType==="video"?"video/*":t.widgetType==="model3d"?".glb,.gltf,.obj,.stl":"*"),Z(Re,`Drop ${t.widgetType??""} or click`)}),ca("dragover",Y,ee=>{ee.preventDefault(),ee.stopPropagation()}),ca("drop",Y,A),s(L,Y)};k(Qe,L=>{t.isReadonly?L(mt):L(R,!1)},!0)}s(we,Oe)};k(kt,we=>{e(Ue)?we(Zt):we(Ut,!1)})}s(ct,Rt)};k(tt,ct=>{(t.widgetType==="image"||t.widgetType==="audio"||t.widgetType==="video"||t.widgetType==="file"||t.widgetType==="gallery"||t.widgetType==="model3d")&&ct($)},!0)}s(Fe,_e)};k(et,Fe=>{t.widgetType==="boolean"?Fe(qe):Fe(de,!1)},!0)}s(fe,Le)};k(xt,fe=>{t.widgetType==="number"?fe(F):fe($e,!1)},!0)}s(re,it)};k(Xe,re=>{t.widgetType==="text"||t.widgetType==="json"?re(ge):re(X,!1)},!0)}s(V,D)};k(T,V=>{e(l)&&e(r)?V(J):V(Q,!1)})}d(le),S(()=>w=he(le,1,"widget-zone nodrag nopan svelte-1twu31f",null,w,{"text-full":(t.widgetType==="text"||t.widgetType==="json")&&!e(l)})),s(n,le),ga()}ba(["mousedown","pointerdown","change","input","click","keydown"]);var ki=Ze('');function Yn(n){var t=ki();s(n,t)}var Ci=Ze('');function Ua(n){var t=Ci();s(n,t)}var Mi=m(''),Si=m(''),Pi=m(' '),Ai=m(''),Ti=m(''),Hi=m(' '),Ii=m(''),Ni=m('
            '),Vi=m('
            '),zi=m(''),Li=m(''),ji=m(''),Oi=m(``),Ri=m('
            '),Ei=m(' ',1),Di=m(''),Yi=m('
            '),Zi=m(''),Fi=m(''),Ui=m(''),Wi=m(''),Bi=m(''),Xi=m(''),qi=m('
            '),Gi=m('
            ',1),Ji=m(''),Ki=m("
            "),Qi=m(' ',1),$i=m('
            '),er=m("
            "),tr=m('
            '),ar=m('
            ');function nr(n,t){ma(t,!0);let i=lt(t,"selected",3,!1);const r=Io("wf"),l=W(()=>r.pending),_=W(()=>r.readOnly),h=W(()=>r.nodeStatus[t.id]??"idle"),N=W(()=>r.nodeErrors[t.id]??""),x=W(()=>r.staleNodes.has(t.id)),j=W(()=>r.connectedPorts),pe=W(()=>t.data.kind==="transform");let G,He=te(!1),me,ot=te(!1);function vt(R,L){if(L==="number"){const Y=Number(R);return Number.isNaN(Y)?R:Y}if(L==="boolean"){if(R==="true")return!0;if(R==="false")return!1}return R}function A(R){const L=R.trim();!e(_)&&L&&L!==t.data.label&&Ot.update(Y=>({...Y,references:Y.references.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce),operators:Y.operators.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce),subjects:Y.subjects.map(Ce=>Ce.id===t.data.id?{...Ce,label:L}:Ce)})),v(He,!1)}const dt=W(()=>t.data.outputs[0]?.type??t.data.inputs[0]?.type??"any"),f=W(()=>fa[e(dt)]),ce=W(()=>Do[e(dt)]),le=W(()=>t.data.kind==="component"),w=W(()=>e(le)&&t.data.inputs[0]?e(j).has(`${t.data.id}:${t.data.inputs[0].id}:input`):!1),T=W(()=>e(le)?e(w)?"output":"input":t.data.kind),J=W(()=>e(T)==="input"||e(T)==="output"),Q=W(()=>e(T)==="input"?t.data.outputs[0]?.id??null:e(T)==="output"?t.data.inputs[0]?.id??null:null),V=W(()=>e(T)==="input"?t.data.outputs[0]?.type??null:e(T)==="output"?t.data.inputs[0]?.type??null:null),D=W(()=>e(T)==="output");function Xe(R){return R.space_id?`https://huggingface.co/spaces/${R.space_id}`:R.model_id?`https://huggingface.co/${R.model_id}`:R.dataset_id?`https://huggingface.co/datasets/${R.dataset_id}`:""}const ge=W(()=>e(l)!==null&&e(l).from_node_id!==t.data.id&&t.data.inputs.some(R=>aa(e(l).type,R.type)&&!e(j).has(`${t.data.id}:${R.id}:input`)));Lt(()=>{if(!G)return;const R=new ResizeObserver(([L])=>{const Y=Math.ceil(L.borderBoxSize[0].blockSize);Math.abs(Y-t.data.height)>1&&Ko(t.data.id,t.data.width,Y)});return R.observe(G),()=>R.disconnect()});var X=ar();let re;X.__click=R=>r.onselect(t.data.id,R.shiftKey);var it=u(X),xt=u(it),F=u(xt);{var $e=R=>{var L=Mi();s(R,L)};k(F,R=>{e(h)==="running"&&R($e)})}var fe=b(F,2);{var Le=R=>{var L=Si();oa(L),L.__keydown=Y=>{Y.key==="Enter"&&A(Y.currentTarget.value),Y.key==="Escape"&&v(He,!1),Y.stopPropagation()},L.__mousedown=Y=>Y.stopPropagation(),wa(L,Y=>me=Y,()=>me),S(()=>va(L,t.data.label)),ca("blur",L,Y=>A(Y.currentTarget.value)),s(R,L)},et=R=>{var L=Pi();L.__dblclick=Ce=>{Ce.stopPropagation(),!e(_)&&(v(He,!0),requestAnimationFrame(()=>me?.select()))};var Y=u(L,!0);d(L),S(()=>Z(Y,t.data.label)),s(R,L)};k(fe,R=>{e(He)?R(Le):R(et,!1)})}var qe=b(fe,2);{var de=R=>{var L=Ai();let Y;L.__pointerdown=Ie=>Ie.stopPropagation(),L.__mousedown=Ie=>Ie.stopPropagation(),L.__click=Ie=>{Ie.stopPropagation(),r.onrunnode(t.data.id)};var Ce=u(L);Yn(Ce),d(L),S(()=>{Y=he(L,1,"node-run svelte-1ruw0hv",null,Y,{"node-run-stale":e(x)}),Te(L,"title",e(x)?"Run this node (inputs changed)":"Run this node")}),s(R,L)};k(qe,R=>{e(pe)&&R(de)})}var Fe=b(qe,2);{var _e=R=>{var L=Ti();L.__pointerdown=Y=>Y.stopPropagation(),L.__mousedown=Y=>Y.stopPropagation(),L.__click=Y=>{Y.stopPropagation(),r.onremove(t.data.id)},s(R,L)};k(Fe,R=>{e(_)||R(_e)})}d(xt),d(it);var tt=b(it,2);{var $=R=>{var L=ye(),Y=K(L);{var Ce=Re=>{const ee=W(()=>t.data.space_id??t.data.model_id??t.data.dataset_id??"");var Me=Ni(),ke=u(Me);{var E=oe=>{var ze=Hi(),gt=u(ze,!0);d(ze),S(Se=>Z(gt,Se),[()=>e(ee).split("/").pop()??e(ee)]),s(oe,ze)},ue=oe=>{var ze=Ii();ze.__pointerdown=Se=>Se.stopPropagation(),ze.__mousedown=Se=>Se.stopPropagation(),ze.__click=Se=>{Se.stopPropagation(),r.onopenpicker(t.data.id)};var gt=u(ze,!0);d(ze),S(Se=>Z(gt,Se),[()=>e(ee).split("/").pop()??e(ee)]),s(oe,ze)};k(ke,oe=>{e(_)?oe(E):oe(ue,!1)})}var be=b(ke,2);be.__pointerdown=oe=>oe.stopPropagation(),be.__mousedown=oe=>oe.stopPropagation(),be.__click=oe=>oe.stopPropagation();var ae=u(be);Ua(ae),d(be),d(Me),S(oe=>Te(be,"href",oe),[()=>Xe(t.data)]),s(Re,Me)},Ie=Re=>{var ee=ye(),Me=K(ee);{var ke=ue=>{var be=Vi(),ae=u(be),oe=u(ae);d(ae),d(be),S(()=>Z(oe,`${t.data.fn??""}()`)),s(ue,be)},E=ue=>{var be=ye(),ae=K(be);{var oe=ze=>{var gt=zi();gt.__pointerdown=Se=>Se.stopPropagation(),gt.__mousedown=Se=>Se.stopPropagation(),gt.__click=Se=>{Se.stopPropagation(),r.onopenpicker(t.data.id)},s(ze,gt)};k(ae,ze=>{e(_)||ze(oe)},!0)}s(ue,be)};k(Me,ue=>{t.data.fn?ue(ke):ue(E,!1)},!0)}s(Re,ee)};k(Y,Re=>{t.data.space_id||t.data.model_id||t.data.dataset_id?Re(Ce):Re(Ie,!1)})}s(R,L)};k(tt,R=>{t.data.kind==="transform"&&R($)})}var ct=b(tt,2);{var Ue=R=>{var L=Ri();L.__pointerdown=Re=>Re.stopPropagation(),L.__mousedown=Re=>Re.stopPropagation();var Y=u(L);{var Ce=Re=>{var ee=ji();ee.__pointerdown=ke=>ke.stopPropagation(),ee.__mousedown=ke=>ke.stopPropagation(),ee.__click=ke=>ke.stopPropagation(),ee.__change=ke=>{ke.stopPropagation(),r.onswitchendpoint(t.data.id,ke.currentTarget.value)},St(ee,21,()=>t.data.endpoints,Xt,(ke,E)=>{var ue=Li(),be=u(ue,!0);d(ue);var ae={};S(()=>{Z(be,e(E).name),ae!==(ae=e(E).name)&&(ue.value=(ue.__value=e(E).name)??"")}),s(ke,ue)}),d(ee);var Me;fn(ee),S(()=>{ee.disabled=e(_),Me!==(Me=t.data.endpoint??"")&&(ee.value=(ee.__value=t.data.endpoint??"")??"",_n(ee,t.data.endpoint??""))}),s(Re,ee)},Ie=Re=>{var ee=ye(),Me=K(ee);{var ke=E=>{var ue=Oi();ue.__pointerdown=ae=>ae.stopPropagation(),ue.__mousedown=ae=>ae.stopPropagation(),ue.__click=ae=>{ae.stopPropagation(),r.onhydratendpoints(t.data.id,t.data.space_id??"")};var be=u(ue);d(ue),S(()=>Z(be,`${t.data.endpoint??"/predict"??""} ▾`)),s(E,ue)};k(Me,E=>{t.data.endpoints||E(ke)},!0)}s(Re,ee)};k(Y,Re=>{t.data.endpoints&&t.data.endpoints.length>1?Re(Ce):Re(Ie,!1)})}d(L),s(R,L)};k(ct,R=>{t.data.space_id&&R(Ue)})}var Rt=b(ct,2);{var kt=R=>{const L=W(()=>t.data.inputs.filter(ke=>ke.required===!1&&!e(j).has(`${t.data.id}:${ke.id}:input`)).length),Y=W(()=>e(L)>0);var Ce=Ki();let Ie;var Re=u(Ce);St(Re,17,()=>t.data.inputs,Xt,(ke,E)=>{const ue=W(()=>e(j).has(`${t.data.id}:${e(E).id}:input`)),be=W(()=>e(ot)||e(ue)||e(E).required!==!1);var ae=ye(),oe=K(ae);{var ze=gt=>{var Se=Gi(),Vt=K(Se);let ua;var Qt=u(Vt);let g;Qt.__pointerdown=se=>r.onportpointerdown(se,t.data.id,e(E).id,e(E).type,!0);var I=b(Qt,2);{var ve=se=>{var xe=Ei(),je=K(xe);let Ge;var ht=u(je,!0);d(je);var ne=b(je,2),pt=u(ne,!0);d(ne),S(()=>{Ge=he(je,1,"port-label svelte-1ruw0hv",null,Ge,{"port-label-optional":e(E).required===!1}),Z(ht,e(E).label),Bt(ne,`color: ${fa[e(E).type]??""}`),Z(pt,e(E).type)}),s(se,xe)};k(I,se=>{e(J)||se(ve)})}d(Vt);var Pe=b(Vt,2);{var Ee=se=>{var xe=qi();xe.__mousedown=ne=>ne.stopPropagation();var je=u(xe);{var Ge=ne=>{const pt=W(()=>Array.isArray(t.data.data?.[e(E).id])?t.data.data[e(E).id]:[]);var Pt=Yi();St(Pt,21,()=>e(E).choices,Xt,(at,Je)=>{var We=Di(),De=u(We);oa(De),De.__change=Ye=>{const q=Ye.currentTarget.checked?[...e(pt),e(Je)]:e(pt).filter(Ne=>Ne!==e(Je));r.ondatachange(t.data.id,e(E).id,q)};var rt=b(De,2),ft=u(rt,!0);d(rt),d(We),S(Ye=>{ya(De,Ye),Z(ft,e(Je))},[()=>e(pt).includes(e(Je))]),s(at,We)}),d(Pt),s(ne,Pt)},ht=ne=>{var pt=ye(),Pt=K(pt);{var at=We=>{const De=W(()=>t.data.data?.[e(E).id]??e(E).default_value),rt=W(()=>e(De)!=null?String(e(De)):""),ft=W(()=>e(E).choices.includes(e(rt)));var Ye=Ui();Ye.__change=Ct=>{const Ke=Ct.currentTarget.value;Ke!==""&&r.ondatachange(t.data.id,e(E).id,vt(Ke,e(E).type))};var q=u(Ye);{var Ne=Ct=>{var Ke=Zi(),st=u(Ke);d(Ke),Ke.value=Ke.__value="",S(()=>Z(st,`Select ${e(E).label??""}`)),s(Ct,Ke)};k(q,Ct=>{e(ft)||Ct(Ne)})}var bt=b(q);St(bt,17,()=>e(E).choices,Xt,(Ct,Ke)=>{var st=Fi(),yt=u(st,!0);d(st);var Et={};S(()=>{Z(yt,e(Ke)),Et!==(Et=e(Ke))&&(st.value=(st.__value=e(Ke))??"")}),s(Ct,st)}),d(Ye);var Tt;fn(Ye),S(()=>{Tt!==(Tt=e(ft)?e(rt):"")&&(Ye.value=(Ye.__value=e(ft)?e(rt):"")??"",_n(Ye,e(ft)?e(rt):""))}),s(We,Ye)},Je=We=>{var De=ye(),rt=K(De);{var ft=q=>{var Ne=Wi();oa(Ne),Ne.__input=bt=>r.ondatachange(t.data.id,e(E).id,parseFloat(bt.currentTarget.value)||0),S(bt=>{Te(Ne,"placeholder",bt),va(Ne,t.data.data?.[e(E).id]??"")},[()=>e(E).default_value!=null?String(e(E).default_value):"0"]),s(q,Ne)},Ye=q=>{var Ne=ye(),bt=K(Ne);{var Tt=Ke=>{var st=Bi(),yt=u(st);oa(yt),yt.__change=$t=>r.ondatachange(t.data.id,e(E).id,$t.currentTarget.checked);var Et=b(yt,2),jt=u(Et,!0);d(Et),d(st),S(()=>{ya(yt,!!t.data.data?.[e(E).id]),Z(jt,t.data.data?.[e(E).id]?"On":"Off")}),s(Ke,st)},Ct=Ke=>{var st=Xi();oa(st),st.__input=yt=>r.ondatachange(t.data.id,e(E).id,yt.currentTarget.value),S(yt=>{Te(st,"placeholder",yt),va(st,typeof t.data.data?.[e(E).id]=="string"?t.data.data[e(E).id]:"")},[()=>e(E).default_value!=null?String(e(E).default_value):e(E).label]),s(Ke,st)};k(bt,Ke=>{e(E).type==="boolean"?Ke(Tt):Ke(Ct,!1)},!0)}s(q,Ne)};k(rt,q=>{e(E).type==="number"?q(ft):q(Ye,!1)},!0)}s(We,De)};k(Pt,We=>{e(E).choices&&e(E).choices.length>0?We(at):We(Je,!1)},!0)}s(ne,pt)};k(je,ne=>{e(E).choices&&e(E).choices.length>0&&e(E).multiselect?ne(Ge):ne(ht,!1)})}d(xe),s(se,xe)};k(Pe,se=>{!e(ue)&&t.data.kind==="transform"&&(e(E).type==="text"||e(E).type==="number"||e(E).type==="boolean"||e(E).type==="any"||e(E).type==="json")&&se(Ee)})}S(se=>{ua=he(Vt,1,"port-row input-row svelte-1ruw0hv",null,ua,{"widget-port":e(J)}),g=he(Qt,1,"port-handle-sf input-handle-sf svelte-1ruw0hv",null,g,se),Te(Qt,"data-node-id",t.data.id),Te(Qt,"data-port-id",e(E).id),Te(Qt,"data-port-type",e(E).type),Bt(Qt,`--port-color: ${fa[e(E).type]??""}`)},[()=>({connected:e(ue),incompatible:e(l)!==null&&!aa(e(l).type,e(E).type),pulse:e(l)!==null&&aa(e(l).type,e(E).type)})]),s(gt,Se)};k(oe,gt=>{e(be)&>(ze)})}s(ke,ae)});var ee=b(Re,2);{var Me=ke=>{var E=Ji();E.__pointerdown=oe=>oe.stopPropagation(),E.__mousedown=oe=>oe.stopPropagation(),E.__click=oe=>{oe.stopPropagation(),v(ot,!e(ot))};var ue=u(E);{var be=oe=>{var ze=Pa("▴ show less");s(oe,ze)},ae=oe=>{var ze=Pa();S(()=>Z(ze,`▾ ${e(L)??""} optional param${e(L)===1?"":"s"}`)),s(oe,ze)};k(ue,oe=>{e(ot)?oe(be):oe(ae,!1)})}d(E),s(ke,E)};k(ee,ke=>{e(Y)&&ke(Me)})}d(Ce),S(()=>Ie=he(Ce,1,"ports svelte-1ruw0hv",null,Ie,{"widget-ports":e(J)})),s(R,Ce)};k(Rt,R=>{t.data.inputs.length>0&&R(kt)})}var Zt=b(Rt,2);{var Ut=R=>{xi(R,{get node(){return t.data},get widgetPortId(){return e(Q)},get widgetType(){return e(V)},get isReadonly(){return e(D)},get ondatachange(){return r.ondatachange}})};k(Zt,R=>{e(J)&&e(Q)&&e(V)&&R(Ut)})}var we=b(Zt,2);{var Oe=R=>{var L=er();let Y;St(L,21,()=>t.data.outputs,Xt,(Ce,Ie)=>{const Re=W(()=>e(j).has(`${t.data.id}:${e(Ie).id}:output`));var ee=$i();let Me;var ke=u(ee);{var E=ae=>{var oe=Qi(),ze=K(oe),gt=u(ze,!0);d(ze);var Se=b(ze,2),Vt=u(Se,!0);d(Se),S(()=>{Bt(ze,`color: ${fa[e(Ie).type]??""}`),Z(gt,e(Ie).type),Z(Vt,e(Ie).label)}),s(ae,oe)};k(ke,ae=>{e(J)||ae(E)})}var ue=b(ke,2);let be;ue.__pointerdown=ae=>r.onportpointerdown(ae,t.data.id,e(Ie).id,e(Ie).type,!1),d(ee),S(()=>{Me=he(ee,1,"port-row output-row svelte-1ruw0hv",null,Me,{"widget-port":e(J)}),be=he(ue,1,"port-handle-sf output-handle-sf svelte-1ruw0hv",null,be,{connected:e(Re)}),Te(ue,"data-node-id",t.data.id),Te(ue,"data-port-id",e(Ie).id),Te(ue,"data-port-type",e(Ie).type),Bt(ue,`--port-color: ${fa[e(Ie).type]??""}`)}),s(Ce,ee)}),d(L),S(()=>Y=he(L,1,"ports svelte-1ruw0hv",null,Y,{"widget-ports":e(J)})),s(R,L)};k(we,R=>{t.data.outputs.length>0&&R(Oe)})}var Qe=b(we,2);{var mt=R=>{var L=tr(),Y=u(L,!0);d(L),S(()=>Z(Y,e(N))),s(R,L)};k(Qe,R=>{e(h)==="error"&&e(N)&&R(mt)})}d(X),wa(X,R=>G=R,()=>G),S(()=>{re=he(X,1,"wf-node svelte-1ruw0hv",null,re,{"node-transform":t.data.kind==="transform","node-running":e(h)==="running","node-done":e(h)==="done","node-error":e(h)==="error","node-stale":e(x),"node-selected":i(),"node-droptarget":e(ge),"has-pending":e(l)!==null}),Bt(X,` width: ${t.data.width??""}px; --accent: ${e(f)??""}; --accent-dim: ${e(ce)??""}; diff --git a/assets/Index-DgYPkB4-.js b/assets/Index-DgYPkB4-.js new file mode 100644 index 0000000000000000000000000000000000000000..8852b589046f5a26bb881b0b7797e5c2e98b21bf --- /dev/null +++ b/assets/Index-DgYPkB4-.js @@ -0,0 +1 @@ +import{G as o,r}from"./i18n-DtG3MAQ1.js";import{M as t,ac as p,O as c}from"./index-BeNBoC9J.js";function u(n,s){t(s,!0);let e=r(s,["$$slots","$$events","$$legacy"]);const a=new o(e);p(()=>{a.props.value&&a.dispatch("change")}),c()}export{u as default}; diff --git a/assets/Index-DwTi2bAp.js b/assets/Index-DlvNPLPX.js similarity index 97% rename from assets/Index-DwTi2bAp.js rename to assets/Index-DlvNPLPX.js index 5a87a3d1c07b6a910f331a1760db55a4c8de2bff..f820c6508897d1bf856cceb19d18a2567f7166f6 100644 --- a/assets/Index-DwTi2bAp.js +++ b/assets/Index-DlvNPLPX.js @@ -1,4 +1,4 @@ -import{A as at,p as x,i as c,q as Ze,f as Qe,w as qe,b as Te,g as ze,d as Xe,a as he,j as gt,x as Mt,K as Vt,G as zt,r as jt}from"./i18n-CPHyzK9b.js";import{a as l,f as Ie,ah as Ye,M as Le,aa as we,ab as Oe,ac as je,$,N as j,S as D,Z as t,O as Me,a2 as i,Q as C,T as w,t as X,X as pe,R as y,a3 as Z,U as et,a4 as Ke,a5 as At,ai as Tt,aj as It,v as Bt,G as Dt}from"./index-DydPgVMC.js";import{a as Et}from"./actions-4RaHFoGI.js";import{b as St}from"./input-BtIxlP_B.js";import{I as Ge}from"./Image-CZ1Hb99p.js";import{I as be,c as Fe}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */import{C as ot}from"./Check-2f8HlfSn.js";import{C as ft}from"./Copy-B3jzejpA.js";import{C as Ft}from"./Clear-BR8cTgGu.js";import{D as Zt}from"./Download-DWSaBiea.js";import{E as qt}from"./Edit-G5CCT_vc.js";import{U as Pt}from"./Undo-B9SlrYtT.js";import{D as Wt}from"./DownloadLink-DM2QmhDx.js";import{S as Ut,C as Ot}from"./ShareButton-Cuvs43xM.js";import{I as mt}from"./IconButtonWrapper-PnNNNvqI.js";import{F as rt}from"./File-_VpQFuKr.js";import{M as it}from"./MarkdownCode-BTj729_f.js";import{t as Rt,s as Gt}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{s as Nt}from"./event-modifiers-CdEA5IGF.js";import{T as Jt}from"./Trash-CJrspSVZ.js";import{M as st}from"./Music-CGJUBXWE.js";import{B as Kt}from"./Block-WPcVj6Bq.js";import{B as Qt}from"./BlockLabel-BzVeVrtL.js";import{S as Xt}from"./index-CfM_uZQa.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./snippet-BtHMuX3s.js";import"./html-BZIV6tyB.js";import"./prism-python-BGiTAEDL.js";import"./index-B_pwUImq.js";var Yt=Ie('');function $t(r){var e=Yt();l(r,e)}var ea=Ie('');function ta(r){var e=ea();l(r,e)}var aa=Ie('');function ra(r){var e=aa();l(r,e)}var na=Ie('');function la(r){var e=na();l(r,e)}const oa=async(r,e=1800)=>{let n=[...r],a=await tt(n);if(a.length>e&&n.length>2){const o=n[0],s=n[n.length-1];n=[o,s],a=await tt(n)}return a.length>e&&n.length>0&&(n=n.map(s=>{if(s.type==="text"){const d=Math.floor(e/n.length)-20;if(s.content.length>d)return{...s,content:s.content.substring(0,d)+"..."}}return s}),a=await tt(n)),a},tt=async r=>(await Promise.all(r.map(async n=>{if(n.role==="system")return"";let a=n.role==="user"?"😃":"🤖",o="";if(n.type==="text"){const s={audio:/|!\[.*?\]\((\/file=.*?)\)/g};o=n.content;for(let[d,g]of Object.entries(s)){let H;for(;(H=g.exec(n.content))!==null;){const T=H[1]||H[2],h=await at(T);o=o.replace(T,h)}}}else{if(!n.content.value)return"";const s=n.content.component==="video"?n.content.value?.video.path:n.content.value,d=await at(s);n.content.component==="audio"?o=``:n.content.component==="video"?o=d:n.content.component==="image"&&(o=``)}return`${a}: ${o}`}))).filter(n=>n!=="").join(` +import{A as at,p as x,i as c,q as Ze,f as Qe,w as qe,b as Te,g as ze,d as Xe,a as he,j as gt,x as Mt,K as Vt,G as zt,r as jt}from"./i18n-DtG3MAQ1.js";import{a as l,f as Ie,ah as Ye,M as Le,aa as we,ab as Oe,ac as je,$,N as j,S as D,Z as t,O as Me,a2 as i,Q as C,T as w,t as X,X as pe,R as y,a3 as Z,U as et,a4 as Ke,a5 as At,ai as Tt,aj as It,v as Bt,G as Dt}from"./index-BeNBoC9J.js";import{a as Et}from"./actions-BbCJS635.js";import{b as St}from"./input-BLFxNjIx.js";import{I as Ge}from"./Image-ALBOEs1f.js";import{I as be,c as Fe}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */import{C as ot}from"./Check-DjGw_9dO.js";import{C as ft}from"./Copy-eBznHIlR.js";import{C as Ft}from"./Clear-BiKSVifk.js";import{D as Zt}from"./Download-0gCL6VXM.js";import{E as qt}from"./Edit-DfYRtNtw.js";import{U as Pt}from"./Undo-Bu_OzfgD.js";import{D as Wt}from"./DownloadLink-Dk6GrGSA.js";import{S as Ut,C as Ot}from"./ShareButton-ImGYvlzQ.js";import{I as mt}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as rt}from"./File-CD333vfS.js";import{M as it}from"./MarkdownCode-QLelNkfo.js";import{t as Rt,s as Gt}from"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{s as Nt}from"./event-modifiers-CdEA5IGF.js";import{T as Jt}from"./Trash-BLpDLXq5.js";import{M as st}from"./Music-DvtEcO9M.js";import{B as Kt}from"./Block-DkzyQHli.js";import{B as Qt}from"./BlockLabel-CEOjqpu7.js";import{S as Xt}from"./index-1YthqPsU.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./snippet-BRIBYCwB.js";import"./html-DE4EmiOG.js";import"./prism-python-DV2ZTlpc.js";import"./index-B_pwUImq.js";var Yt=Ie('');function $t(r){var e=Yt();l(r,e)}var ea=Ie('');function ta(r){var e=ea();l(r,e)}var aa=Ie('');function ra(r){var e=aa();l(r,e)}var na=Ie('');function la(r){var e=na();l(r,e)}const oa=async(r,e=1800)=>{let n=[...r],a=await tt(n);if(a.length>e&&n.length>2){const o=n[0],s=n[n.length-1];n=[o,s],a=await tt(n)}return a.length>e&&n.length>0&&(n=n.map(s=>{if(s.type==="text"){const d=Math.floor(e/n.length)-20;if(s.content.length>d)return{...s,content:s.content.substring(0,d)+"..."}}return s}),a=await tt(n)),a},tt=async r=>(await Promise.all(r.map(async n=>{if(n.role==="system")return"";let a=n.role==="user"?"😃":"🤖",o="";if(n.type==="text"){const s={audio:/|!\[.*?\]\((\/file=.*?)\)/g};o=n.content;for(let[d,g]of Object.entries(s)){let H;for(;(H=g.exec(n.content))!==null;){const T=H[1]||H[2],h=await at(T);o=o.replace(T,h)}}}else{if(!n.content.value)return"";const s=n.content.component==="video"?n.content.value?.video.path:n.content.value,d=await at(s);n.content.component==="audio"?o=``:n.content.component==="video"?o=d:n.content.component==="image"&&(o=``)}return`${a}: ${o}`}))).filter(n=>n!=="").join(` `),ia=(r,e)=>r.replace('src="/file',`src="${e}file`);function sa(r,e){if(!r){const n=e?.path;if(n){const a=n.toLowerCase();if(a.endsWith(".glb")||a.endsWith(".gltf")||a.endsWith(".obj")||a.endsWith(".stl")||a.endsWith(".splat")||a.endsWith(".ply"))return"model3d"}return"file"}return r.includes("audio")?"audio":r.includes("video")?"video":r.includes("image")?"image":r.includes("model")?"model3d":"file"}function ua(r){const e=Array.isArray(r.file)?r.file[0]:r.file,n=sa(e?.mime_type,e);return{component:n,value:n==="file"?Array.isArray(r.file)?r.file:[r.file]:r.file,alt_text:r.alt_text,constructor_args:{},props:{}}}function da(r,e,n,a){let o;return e.type==="text"?o={role:r.role,metadata:r.metadata,content:ia(e.text,n),type:"text",index:a,options:r.options}:e.type==="file"?o={role:r.role,metadata:r.metadata,content:ua(e),type:"component",index:a,options:r.options}:o={role:r.role,metadata:r.metadata,content:e,type:"component",index:a,options:r.options},o}function ca(r,e){if(r===null)return r;const n=new Map;return r.flatMap((a,o)=>{const s=a.content.map(d=>da(a,d,e,o));for(const d of s){const{id:g,title:H,parent_id:T}=a.metadata||{};if(T){const h=n.get(String(T));if(h){const f={...d,children:[]};return h.children.push(f),g&&H&&n.set(String(g),f),null}}if(g&&H){const h={...d,children:[]};return n.set(String(g),h),h}}return s}).filter(a=>a!==null)}function _a(r){return r.type==="component"}function ut(r,e){const n=r[r.length-1].role==="assistant",a=r[r.length-1].index;return JSON.stringify(a)===JSON.stringify(e[e.length-1].index)&&n}function va(r,e=!0){const n=[];let a=[],o=null;for(const s of r)if(s.role==="assistant"||s.role==="user"){if(!e){n.push([s]);continue}s.role===o?a.push(s):(a.length>0&&n.push(a),a=[s],o=s.role)}return a.length>0&&n.push(a),n}async function ga(r,e,n){for(const a of r){if(e[a]||a==="file")continue;const o=a==="dataframe"?"component":"base",{component:s}=n(a,o),d=await s;e[a]=d.default}return e}function fa(r){if(!r)return[];let e=new Set;return r.forEach(n=>{n.type==="component"&&e.add(n.content.component)}),Array.from(e)}function nt(r,e=0){let n="";const a=" ".repeat(e);r.metadata?.title&&(n+=`${a}${e>0?"- ":""}${r.metadata.title} `),typeof r.content=="string"&&(n+=`${a} ${r.content} `);const o=r;return o.children?.length>0&&(n+=o.children.map(s=>nt(s,e+1)).join("")),n}function ma(r){return Array.isArray(r)?r.map(e=>e.metadata?.title?nt(e):e.content).join(` diff --git a/assets/Index-DoGUZ99P.js b/assets/Index-DoGUZ99P.js deleted file mode 100644 index f5021221ae3efa24bc33101a8a8dd924dffcf01f..0000000000000000000000000000000000000000 --- a/assets/Index-DoGUZ99P.js +++ /dev/null @@ -1 +0,0 @@ -import{G as m,g as i,r as d,s as l}from"./i18n-CPHyzK9b.js";import{M as n,O as f,a3 as u,N as c,a as $}from"./index-DydPgVMC.js";import{B as g}from"./Index.svelte_svelte_type_style_lang-glBt5fcY.js";import"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./html-BZIV6tyB.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";function N(s,r){n(r,!0);let t=d(r,["$$slots","$$events","$$legacy"]);const a=new m(t);g(s,i(()=>a.shared,{children:(e,h)=>{var o=u(),p=c(o);l(p,r,"default",{}),$(e,o)},$$slots:{default:!0}})),f()}export{g as BaseColumn,N as default}; diff --git a/assets/Index-CbuW6Q7r.js b/assets/Index-DqRcRVmV.js similarity index 93% rename from assets/Index-CbuW6Q7r.js rename to assets/Index-DqRcRVmV.js index 243bd6e845a7017a3c919b7309e89ab6a5f5faca..2be52e414fb4b12496ba816567dbe518c659f37f 100644 --- a/assets/Index-CbuW6Q7r.js +++ b/assets/Index-DqRcRVmV.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./embed-C0bvMD9o.js","./mollweide-XXUPULVr.js","./ordinal-BeghXfj9.js","./init-Dmth1JHB.js","./linear-8mDBZVC7.js","./step-B-Gbak1k.js","./defaultLocale-CzDG__Ur.js","./time-BMaLdJ6b.js","./dispatch-kxCwF96_.js","./range-OtVwhkKS.js","./index-BU4IRnz1.js","./colors-Cc3OSVma.js","./dsv-DB8NKgIY.js","./arc-Bt_eNeYl.js"])))=>i.map(i=>d[i]); -import{M as be,aa as $,ab as se,ac as Z,$ as h,Z as t,a7 as xe,v as ke,N as K,a4 as we,t as ie,a as M,S as T,O as $e,a2 as b,af as Ee,R as H,X as pe,a5 as Ie,Q as Fe,T as Pe}from"./index-DydPgVMC.js";import{G as Oe,i as z,r as ze,g as Se,d as Ae}from"./i18n-CPHyzK9b.js";import{B as Me}from"./Block-WPcVj6Bq.js";import{B as Te}from"./BlockTitle-DNiCHWOR.js";import{I as We}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{E as Ce}from"./Empty-B15ItVsj.js";import{D as Ve}from"./Download-DWSaBiea.js";import{L as Ne}from"./LineChart-DuGokVK_.js";import{I as Le}from"./IconButtonWrapper-PnNNNvqI.js";import{F as je}from"./FullscreenButton-BuyUU5Yj.js";import{S as De}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./Maximize-DWbY8BRa.js";import"./Clear-BR8cTgGu.js";import"./index-B_pwUImq.js";var Be=H(" ",1),He=H('

            '),Re=H('
            ',1),Ge=H(" ",1);function ut(ue,ee){be(ee,!0);let de=ze(ee,["$$slots","$$events","$$legacy"]);const e=new Oe(de);e.watch_for_change();let te=b(()=>{if(!e.props.color||!e.props.value||e.props.value.datatypes[e.props.color]!=="nominal")return[];const r=e.props.value.columns.indexOf(e.props.color);return r===-1?[]:Array.from(new Set(e.props.value.data.map(l=>l[r])))}),S=b(()=>e.props.x_lim||null),W=b(()=>e.props.y_lim||null),C=b(()=>t(S)?.[0]!==null?t(S)?.[0]:void 0),V=b(()=>t(S)?.[1]!==null?t(S)?.[1]:void 0),re=b(()=>t(W)?.[0]!==null?t(W)?.[0]:void 0),oe=b(()=>t(W)?.[1]!==null?t(W)?.[1]:void 0),E=$(!1);function fe(r){if(r==="x")return"ascending";if(r==="-x")return"descending";if(r==="y")return{field:e.props.y,order:"ascending"};if(r==="-y")return{field:e.props.y,order:"descending"};if(r===null)return null;if(Array.isArray(r))return r}let ce=b(()=>fe(e.props.sort)),R=$(se([]));function A(r){return r.replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]")}let G=b(()=>e.props.value&&e.props.value.datatypes[e.props.x]==="temporal"),N=b(()=>t(G)?[t(C)!==void 0?t(C)*1e3:null,t(V)!==void 0?t(V)*1e3:null]:t(S)),U=$(!1);const _e={s:1,m:60,h:3600,d:1440*60};let I=b(()=>e.props.x_bin?typeof e.props.x_bin=="string"?1e3*parseInt(e.props.x_bin.substring(0,e.props.x_bin.length-1))*_e[e.props.x_bin[e.props.x_bin.length-1]]:e.props.x_bin:void 0),Y=b(()=>{if(e.props.value)if(e.props.value.mark==="point"){const r=t(I)!==void 0;return e.props.y_aggregate||r?"sum":void 0}else return e.props.y_aggregate?e.props.y_aggregate:"sum"}),le=b(()=>e.props.value?e.props.value.mark==="point"?t(I)!==void 0:t(I)!==void 0||e.props.value.datatypes[e.props.x]==="nominal":!1);function ne(r,l,g,i,s,d){if(r.length<1e3||e.props.x_bin!==null||e.props.value?.mark!=="line"||e.props.value?.datatypes[e.props.x]==="nominal")return r;const c=250;let a={};if((s===void 0||d===void 0)&&r.forEach(o=>{let p=o[l];(s===void 0||pd)&&(d=p)}),s===void 0||d===void 0)return r;const f=(d-s)/c;r.forEach((o,p)=>{const v=o[l],m=o[g],u=i!==null?o[i]:"any",n=Math.floor((v-s)/f);a[u]===void 0&&(a[u]=[]),a[u][n]=a[u][n]||[null,Number.POSITIVE_INFINITY,null,Number.NEGATIVE_INFINITY],ma[u][n][3]&&(a[u][n][2]=p,a[u][n][3]=m)});const w=[];return Object.values(a).forEach(o=>{o.forEach(([p,v,m,u])=>{let n=[];p!==null&&m!==null?n=[Math.min(p,m),Math.max(p,m)]:p!==null?n=[p]:m!==null&&(n=[m]),n.forEach(F=>{w.push(r[F])})})}),w}function me(r,l,g){let i=r.columns.indexOf(e.props.x),s=r.columns.indexOf(e.props.y),d=e.props.color?r.columns.indexOf(e.props.color):null,c=r.data;if(l!==void 0&&g!==void 0){const a=r.datatypes[e.props.x]==="temporal"?1e3:1,_=l*a,f=g*a;let w={},o={};const p=c.filter((v,m)=>{const u=v[i],n=d!==null?v[d]:"any";return u<_&&(w[n]===void 0||u>w[n][1])&&(w[n]=[m,u]),u>f&&(o[n]===void 0||u=_&&u<=f});c=[...Object.values(w).map(([v,m])=>c[v]),...ne(p,i,s,d,_,f),...Object.values(o).map(([v,m])=>c[v])]}else c=ne(c,i,s,d,void 0,void 0);return e.props.tooltip=="all"||Array.isArray(e.props.tooltip)?c.map(a=>{const _={};return r.columns.forEach((f,w)=>{_[f]=a[w]}),_}):c.map(a=>{const _={[e.props.x]:a[i],[e.props.y]:a[s]};return e.props.color&&d!==null&&(_[e.props.color]=a[d]),_})}Z(()=>{h(R,e.props.value?me(e.props.value,t(C),t(V)):[],!0)});let ae=$(se(e.props.value));Z(()=>{t(ae)!==e.props.value&&t(x)&&(h(ae,e.props.value,!0),t(x).data("data",t(R)).runAsync())});const ge=typeof window<"u";let y=$(void 0),k=b(()=>t(y)?window.getComputedStyle(t(y)):null),x=$(void 0),L=$(!1),j=$(0),X=$(0),D=$(void 0),q;async function B(){if(t(U)){h(J,!0);return}if(t(x)&&t(x).finalize(),!e.props.value||!t(y))return;h(j,t(y).offsetWidth,!0),h(X,t(y).offsetHeight,!0);const r=ye();r&&(h(D,new ResizeObserver(l=>{if(!(!l[0].target||!(l[0].target instanceof HTMLElement)))if(t(j)===0&&t(y).offsetWidth!==0&&e.props.value.datatypes[e.props.x]==="nominal")B();else{const g=Math.abs(t(j)-l[0].target.offsetWidth),i=Math.abs(t(X)-l[0].target.offsetHeight);g>100||i>100?(h(j,l[0].target.offsetWidth,!0),h(X,l[0].target.offsetHeight,!0),B()):t(x)&&(t(x).signal("width",l[0].target.offsetWidth).run(),t(E)&&t(x).signal("height",l[0].target.offsetHeight).run())}}),!0),q||(q=(await Ee(async()=>{const{default:l}=await import("./embed-C0bvMD9o.js");return{default:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)).default),t(y)&&q(t(y),r,{actions:!1,renderer:"svg"}).then(function(l){h(x,l.view,!0),t(D).observe(t(y));var g,i=0;t(x).addEventListener("dblclick",()=>{e.dispatch("double_click")}),t(y).addEventListener("mousedown",function(s){s.detail>1&&s.preventDefault()},!1),e.props._selectable&&t(x).addSignalListener("brush",function(s,d){if(Date.now()-i<1e3||(h(U,!0),Object.keys(d).length===0))return;clearTimeout(g);let c=d[Object.keys(d)[0]];t(G)&&(c=[c[0]/1e3,c[1]/1e3]),g=setTimeout(function(){h(U,!1),i=Date.now(),e.dispatch("select",{value:c,index:c,selected:!0}),t(J)&&(h(J,!1),B())},250)})}))}let J=$(!1);xe(()=>(h(L,!0),()=>{h(L,!1),t(x)&&t(x).finalize(),t(D)&&t(D).disconnect()}));function ve(){if(!t(x)||!t(k))return;const r=t(x),g=t(k).getPropertyValue("--block-background-fill")||"white";r.background(g).run(),r.toImageURL("png",2).then(function(i){r.background("transparent").run();const s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download","chart.png"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}).catch(function(i){console.error("Export failed:",i),r.background("transparent").run()})}let he=b(()=>JSON.stringify(e.props.color_map));Z(()=>{e.props.title,e.props.x_title,e.props.y_title,e.props.color_title,e.props.x,e.props.y,e.props.color,e.props.x_bin,t(Y),t(he),e.props.colors_in_legend,t(C),t(V),t(re),t(oe),e.props.caption,e.props.sort,t(L),t(y),t(E),t(k),t(L)&&t(y)&&ke(()=>{B()})});function ye(){if(!e.props.value||!t(k))return null;let r=t(k).getPropertyValue("--color-accent"),l=t(k).getPropertyValue("--body-text-color"),g=t(k).getPropertyValue("--border-color-primary"),i=t(k).fontFamily,s=t(k).getPropertyValue("--block-title-text-weight");const d=_=>_.endsWith("px")?parseFloat(_.slice(0,-2)):12;let c=d(t(k).getPropertyValue("--text-md")),a=d(t(k).getPropertyValue("--text-sm"));return{$schema:"https://vega.github.io/schema/vega-lite/v5.17.0.json",background:"transparent",config:{autosize:{type:"fit",contains:"padding"},axis:{labelFont:i,labelColor:l,titleFont:i,titleColor:l,titlePadding:8,tickColor:g,labelFontSize:a,gridColor:g,titleFontWeight:"normal",titleFontSize:a,labelFontWeight:"normal",domain:!1,labelAngle:0,titleLimit:(t(y)?.offsetHeight??0)*.8},legend:{labelColor:l,labelFont:i,titleColor:l,titleFont:i,titleFontWeight:"normal",titleFontSize:a,labelFontWeight:"normal",offset:2},title:{color:l,font:i,fontSize:c,fontWeight:s,anchor:"middle"},view:{stroke:g},mark:{stroke:e.props.value.mark!=="bar"?r:void 0,fill:e.props.value.mark==="bar"?r:void 0,cursor:"crosshair"}},data:{name:"data"},datasets:{data:t(R)},layer:["plot",...e.props.value.mark==="line"?["hover"]:[]].map(_=>({encoding:{size:e.props.value.mark==="line"?_=="plot"?{condition:{empty:!1,param:"hoverPlot",value:3},value:2}:{condition:{empty:!1,param:"hover",value:100},value:0}:void 0,opacity:_==="plot"?void 0:{condition:{empty:!1,param:"hover",value:1},value:0},x:{axis:{...e.props.x_label_angle!==null&&{labelAngle:e.props.x_label_angle},labels:e.props.x_axis_labels_visible,ticks:e.props.x_axis_labels_visible,...e.props.x_axis_format!==null&&{format:e.props.x_axis_format}},field:A(e.props.x),title:e.props.x_title||e.props.x,type:e.props.value.datatypes[e.props.x],scale:{zero:!1,domainMin:t(N)?.[0]!==null?t(N)?.[0]:void 0,domainMax:t(N)?.[1]!==null?t(N)?.[1]:void 0},bin:t(I)?{step:t(I)}:void 0,sort:t(ce)},y:{axis:{...e.props.y_label_angle&&{labelAngle:e.props.y_label_angle},...e.props.y_axis_format!==null&&{format:e.props.y_axis_format}},field:A(e.props.y),title:e.props.y_title||e.props.y,type:e.props.value.datatypes[e.props.y],scale:{zero:!1,domainMin:t(re)??void 0,domainMax:t(oe)??void 0},aggregate:t(le)?t(Y):void 0},color:e.props.color?{field:A(e.props.color),legend:e.props.colors_in_legend?.length===0?null:{orient:"bottom",title:e.props.color_title,values:e.props.colors_in_legend?[...e.props.colors_in_legend]:void 0},scale:e.props.value.datatypes[e.props.color]==="nominal"?{domain:t(te),range:e.props.color_map?t(te).map(f=>e.props.color_map[f]):void 0}:{range:[100,200,300,400,500,600,700,800,900].map(f=>t(k).getPropertyValue("--primary-"+f)),interpolate:"hsl"},type:e.props.value.datatypes[e.props.color]}:void 0,tooltip:e.props.tooltip=="none"?void 0:[{field:A(e.props.y),type:e.props.value.datatypes[e.props.y],aggregate:t(le)?t(Y):void 0,title:e.props.y_title||e.props.y},{field:A(e.props.x),type:e.props.value.datatypes[e.props.x],title:e.props.x_title||e.props.x,format:t(G)?"%Y-%m-%d %H:%M:%S":void 0,bin:t(I)?{step:t(I)}:void 0},...e.props.color?[{field:e.props.color,type:e.props.value.datatypes[e.props.color]}]:[],...e.props.tooltip==="axis"?[]:(e.props.value?.columns??[]).filter(f=>f!==e.props.x&&f!==e.props.y&&f!==e.props.color&&(e.props.tooltip==="all"||e.props.tooltip.includes(f))).map(f=>({field:f,type:e.props.value.datatypes[f]}))]},strokeDash:{},mark:{clip:!0,type:_==="hover"?"point":e.props.value.mark},name:_})),params:[...e.props.value.mark==="line"?[{name:"hoverPlot",select:{clear:"mouseout",fields:e.props.color?[e.props.color]:[],nearest:!0,on:"mouseover",type:"point"},views:["hover"]},{name:"hover",select:{clear:"mouseout",nearest:!0,on:"mouseover",type:"point"},views:["hover"]}]:[],...e.props._selectable?[{name:"brush",select:{encodings:["x"],mark:{fill:"gray",fillOpacity:.3,stroke:"none"},type:"interval"},views:["plot"]}]:[]],width:t(y).offsetWidth,height:e.props.height||t(E)?"container":void 0,title:e.props.title||void 0}}Me(ue,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,padding:!0,get height(){return e.props.height},get fullscreen(){return t(E)},set fullscreen(r){h(E,r,!0)},children:(r,l)=>{var g=Ge(),i=K(g);{var s=o=>{De(o,Se({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))};z(i,o=>{e.shared.loading_status&&o(s)})}var d=T(i,2);{var c=o=>{Le(o,{get buttons(){return e.props.buttons},on_custom_button_click:p=>{e.dispatch("custom_button_click",{id:p})},children:(p,v)=>{var m=Be(),u=K(m);{var n=P=>{We(P,{get Icon(){return Ve},label:"Export",onclick:ve})};z(u,P=>{e.props.buttons?.some(O=>typeof O=="string"&&O==="export")&&P(n)})}var F=T(u,2);{var Q=P=>{je(P,{get fullscreen(){return t(E)},onclick:O=>h(E,O,!0)})};z(F,P=>{e.props.buttons?.some(O=>typeof O=="string"&&O==="fullscreen")&&P(Q)})}M(p,m)},$$slots:{default:!0}})};z(d,o=>{e.props.buttons?.length&&o(c)})}var a=T(d,2);Te(a,{get show_label(){return e.shared.show_label},info:void 0,children:(o,p)=>{Ie();var v=we();ie(()=>pe(v,e.shared.label)),M(o,v)},$$slots:{default:!0}});var _=T(a,2);{var f=o=>{var p=Re(),v=K(p);Ae(v,n=>h(y,n),()=>t(y));var m=T(v,2);{var u=n=>{var F=He(),Q=Fe(F,!0);Pe(F),ie(()=>pe(Q,e.props.caption)),M(n,F)};z(m,n=>{e.props.caption&&n(u)})}M(o,p)},w=o=>{Ce(o,{unpadded_box:!0,children:(p,v)=>{Ne(p)},$$slots:{default:!0}})};z(_,o=>{e.props.value&&ge?o(f):o(w,!1)})}M(r,g)},$$slots:{default:!0}}),$e()}export{ut as default}; +import{M as be,aa as $,ab as se,ac as Z,$ as h,Z as t,a7 as xe,v as ke,N as K,a4 as we,t as ie,a as M,S as T,O as $e,a2 as b,af as Ee,R as H,X as pe,a5 as Ie,Q as Fe,T as Pe}from"./index-BeNBoC9J.js";import{G as Oe,i as z,r as ze,g as Se,d as Ae}from"./i18n-DtG3MAQ1.js";import{B as Me}from"./Block-DkzyQHli.js";import{B as Te}from"./BlockTitle-B6Pgijwb.js";import{I as We}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{E as Ce}from"./Empty-Clj0ErcW.js";import{D as Ve}from"./Download-0gCL6VXM.js";import{L as Ne}from"./LineChart-2ZYa4bPX.js";import{I as Le}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as je}from"./FullscreenButton-CFl3IB4T.js";import{S as De}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./Maximize-DQMU3SdR.js";import"./Clear-BiKSVifk.js";import"./index-B_pwUImq.js";var Be=H(" ",1),He=H('

            '),Re=H('
            ',1),Ge=H(" ",1);function ut(ue,ee){be(ee,!0);let de=ze(ee,["$$slots","$$events","$$legacy"]);const e=new Oe(de);e.watch_for_change();let te=b(()=>{if(!e.props.color||!e.props.value||e.props.value.datatypes[e.props.color]!=="nominal")return[];const r=e.props.value.columns.indexOf(e.props.color);return r===-1?[]:Array.from(new Set(e.props.value.data.map(l=>l[r])))}),S=b(()=>e.props.x_lim||null),W=b(()=>e.props.y_lim||null),C=b(()=>t(S)?.[0]!==null?t(S)?.[0]:void 0),V=b(()=>t(S)?.[1]!==null?t(S)?.[1]:void 0),re=b(()=>t(W)?.[0]!==null?t(W)?.[0]:void 0),oe=b(()=>t(W)?.[1]!==null?t(W)?.[1]:void 0),E=$(!1);function fe(r){if(r==="x")return"ascending";if(r==="-x")return"descending";if(r==="y")return{field:e.props.y,order:"ascending"};if(r==="-y")return{field:e.props.y,order:"descending"};if(r===null)return null;if(Array.isArray(r))return r}let ce=b(()=>fe(e.props.sort)),R=$(se([]));function A(r){return r.replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]")}let G=b(()=>e.props.value&&e.props.value.datatypes[e.props.x]==="temporal"),N=b(()=>t(G)?[t(C)!==void 0?t(C)*1e3:null,t(V)!==void 0?t(V)*1e3:null]:t(S)),U=$(!1);const _e={s:1,m:60,h:3600,d:1440*60};let I=b(()=>e.props.x_bin?typeof e.props.x_bin=="string"?1e3*parseInt(e.props.x_bin.substring(0,e.props.x_bin.length-1))*_e[e.props.x_bin[e.props.x_bin.length-1]]:e.props.x_bin:void 0),Y=b(()=>{if(e.props.value)if(e.props.value.mark==="point"){const r=t(I)!==void 0;return e.props.y_aggregate||r?"sum":void 0}else return e.props.y_aggregate?e.props.y_aggregate:"sum"}),le=b(()=>e.props.value?e.props.value.mark==="point"?t(I)!==void 0:t(I)!==void 0||e.props.value.datatypes[e.props.x]==="nominal":!1);function ne(r,l,g,i,s,d){if(r.length<1e3||e.props.x_bin!==null||e.props.value?.mark!=="line"||e.props.value?.datatypes[e.props.x]==="nominal")return r;const c=250;let a={};if((s===void 0||d===void 0)&&r.forEach(o=>{let p=o[l];(s===void 0||pd)&&(d=p)}),s===void 0||d===void 0)return r;const f=(d-s)/c;r.forEach((o,p)=>{const v=o[l],m=o[g],u=i!==null?o[i]:"any",n=Math.floor((v-s)/f);a[u]===void 0&&(a[u]=[]),a[u][n]=a[u][n]||[null,Number.POSITIVE_INFINITY,null,Number.NEGATIVE_INFINITY],ma[u][n][3]&&(a[u][n][2]=p,a[u][n][3]=m)});const w=[];return Object.values(a).forEach(o=>{o.forEach(([p,v,m,u])=>{let n=[];p!==null&&m!==null?n=[Math.min(p,m),Math.max(p,m)]:p!==null?n=[p]:m!==null&&(n=[m]),n.forEach(F=>{w.push(r[F])})})}),w}function me(r,l,g){let i=r.columns.indexOf(e.props.x),s=r.columns.indexOf(e.props.y),d=e.props.color?r.columns.indexOf(e.props.color):null,c=r.data;if(l!==void 0&&g!==void 0){const a=r.datatypes[e.props.x]==="temporal"?1e3:1,_=l*a,f=g*a;let w={},o={};const p=c.filter((v,m)=>{const u=v[i],n=d!==null?v[d]:"any";return u<_&&(w[n]===void 0||u>w[n][1])&&(w[n]=[m,u]),u>f&&(o[n]===void 0||u=_&&u<=f});c=[...Object.values(w).map(([v,m])=>c[v]),...ne(p,i,s,d,_,f),...Object.values(o).map(([v,m])=>c[v])]}else c=ne(c,i,s,d,void 0,void 0);return e.props.tooltip=="all"||Array.isArray(e.props.tooltip)?c.map(a=>{const _={};return r.columns.forEach((f,w)=>{_[f]=a[w]}),_}):c.map(a=>{const _={[e.props.x]:a[i],[e.props.y]:a[s]};return e.props.color&&d!==null&&(_[e.props.color]=a[d]),_})}Z(()=>{h(R,e.props.value?me(e.props.value,t(C),t(V)):[],!0)});let ae=$(se(e.props.value));Z(()=>{t(ae)!==e.props.value&&t(x)&&(h(ae,e.props.value,!0),t(x).data("data",t(R)).runAsync())});const ge=typeof window<"u";let y=$(void 0),k=b(()=>t(y)?window.getComputedStyle(t(y)):null),x=$(void 0),L=$(!1),j=$(0),X=$(0),D=$(void 0),q;async function B(){if(t(U)){h(J,!0);return}if(t(x)&&t(x).finalize(),!e.props.value||!t(y))return;h(j,t(y).offsetWidth,!0),h(X,t(y).offsetHeight,!0);const r=ye();r&&(h(D,new ResizeObserver(l=>{if(!(!l[0].target||!(l[0].target instanceof HTMLElement)))if(t(j)===0&&t(y).offsetWidth!==0&&e.props.value.datatypes[e.props.x]==="nominal")B();else{const g=Math.abs(t(j)-l[0].target.offsetWidth),i=Math.abs(t(X)-l[0].target.offsetHeight);g>100||i>100?(h(j,l[0].target.offsetWidth,!0),h(X,l[0].target.offsetHeight,!0),B()):t(x)&&(t(x).signal("width",l[0].target.offsetWidth).run(),t(E)&&t(x).signal("height",l[0].target.offsetHeight).run())}}),!0),q||(q=(await Ee(async()=>{const{default:l}=await import("./embed-C0bvMD9o.js");return{default:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)).default),t(y)&&q(t(y),r,{actions:!1,renderer:"svg"}).then(function(l){h(x,l.view,!0),t(D).observe(t(y));var g,i=0;t(x).addEventListener("dblclick",()=>{e.dispatch("double_click")}),t(y).addEventListener("mousedown",function(s){s.detail>1&&s.preventDefault()},!1),e.props._selectable&&t(x).addSignalListener("brush",function(s,d){if(Date.now()-i<1e3||(h(U,!0),Object.keys(d).length===0))return;clearTimeout(g);let c=d[Object.keys(d)[0]];t(G)&&(c=[c[0]/1e3,c[1]/1e3]),g=setTimeout(function(){h(U,!1),i=Date.now(),e.dispatch("select",{value:c,index:c,selected:!0}),t(J)&&(h(J,!1),B())},250)})}))}let J=$(!1);xe(()=>(h(L,!0),()=>{h(L,!1),t(x)&&t(x).finalize(),t(D)&&t(D).disconnect()}));function ve(){if(!t(x)||!t(k))return;const r=t(x),g=t(k).getPropertyValue("--block-background-fill")||"white";r.background(g).run(),r.toImageURL("png",2).then(function(i){r.background("transparent").run();const s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download","chart.png"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}).catch(function(i){console.error("Export failed:",i),r.background("transparent").run()})}let he=b(()=>JSON.stringify(e.props.color_map));Z(()=>{e.props.title,e.props.x_title,e.props.y_title,e.props.color_title,e.props.x,e.props.y,e.props.color,e.props.x_bin,t(Y),t(he),e.props.colors_in_legend,t(C),t(V),t(re),t(oe),e.props.caption,e.props.sort,t(L),t(y),t(E),t(k),t(L)&&t(y)&&ke(()=>{B()})});function ye(){if(!e.props.value||!t(k))return null;let r=t(k).getPropertyValue("--color-accent"),l=t(k).getPropertyValue("--body-text-color"),g=t(k).getPropertyValue("--border-color-primary"),i=t(k).fontFamily,s=t(k).getPropertyValue("--block-title-text-weight");const d=_=>_.endsWith("px")?parseFloat(_.slice(0,-2)):12;let c=d(t(k).getPropertyValue("--text-md")),a=d(t(k).getPropertyValue("--text-sm"));return{$schema:"https://vega.github.io/schema/vega-lite/v5.17.0.json",background:"transparent",config:{autosize:{type:"fit",contains:"padding"},axis:{labelFont:i,labelColor:l,titleFont:i,titleColor:l,titlePadding:8,tickColor:g,labelFontSize:a,gridColor:g,titleFontWeight:"normal",titleFontSize:a,labelFontWeight:"normal",domain:!1,labelAngle:0,titleLimit:(t(y)?.offsetHeight??0)*.8},legend:{labelColor:l,labelFont:i,titleColor:l,titleFont:i,titleFontWeight:"normal",titleFontSize:a,labelFontWeight:"normal",offset:2},title:{color:l,font:i,fontSize:c,fontWeight:s,anchor:"middle"},view:{stroke:g},mark:{stroke:e.props.value.mark!=="bar"?r:void 0,fill:e.props.value.mark==="bar"?r:void 0,cursor:"crosshair"}},data:{name:"data"},datasets:{data:t(R)},layer:["plot",...e.props.value.mark==="line"?["hover"]:[]].map(_=>({encoding:{size:e.props.value.mark==="line"?_=="plot"?{condition:{empty:!1,param:"hoverPlot",value:3},value:2}:{condition:{empty:!1,param:"hover",value:100},value:0}:void 0,opacity:_==="plot"?void 0:{condition:{empty:!1,param:"hover",value:1},value:0},x:{axis:{...e.props.x_label_angle!==null&&{labelAngle:e.props.x_label_angle},labels:e.props.x_axis_labels_visible,ticks:e.props.x_axis_labels_visible,...e.props.x_axis_format!==null&&{format:e.props.x_axis_format}},field:A(e.props.x),title:e.props.x_title||e.props.x,type:e.props.value.datatypes[e.props.x],scale:{zero:!1,domainMin:t(N)?.[0]!==null?t(N)?.[0]:void 0,domainMax:t(N)?.[1]!==null?t(N)?.[1]:void 0},bin:t(I)?{step:t(I)}:void 0,sort:t(ce)},y:{axis:{...e.props.y_label_angle&&{labelAngle:e.props.y_label_angle},...e.props.y_axis_format!==null&&{format:e.props.y_axis_format}},field:A(e.props.y),title:e.props.y_title||e.props.y,type:e.props.value.datatypes[e.props.y],scale:{zero:!1,domainMin:t(re)??void 0,domainMax:t(oe)??void 0},aggregate:t(le)?t(Y):void 0},color:e.props.color?{field:A(e.props.color),legend:e.props.colors_in_legend?.length===0?null:{orient:"bottom",title:e.props.color_title,values:e.props.colors_in_legend?[...e.props.colors_in_legend]:void 0},scale:e.props.value.datatypes[e.props.color]==="nominal"?{domain:t(te),range:e.props.color_map?t(te).map(f=>e.props.color_map[f]):void 0}:{range:[100,200,300,400,500,600,700,800,900].map(f=>t(k).getPropertyValue("--primary-"+f)),interpolate:"hsl"},type:e.props.value.datatypes[e.props.color]}:void 0,tooltip:e.props.tooltip=="none"?void 0:[{field:A(e.props.y),type:e.props.value.datatypes[e.props.y],aggregate:t(le)?t(Y):void 0,title:e.props.y_title||e.props.y},{field:A(e.props.x),type:e.props.value.datatypes[e.props.x],title:e.props.x_title||e.props.x,format:t(G)?"%Y-%m-%d %H:%M:%S":void 0,bin:t(I)?{step:t(I)}:void 0},...e.props.color?[{field:e.props.color,type:e.props.value.datatypes[e.props.color]}]:[],...e.props.tooltip==="axis"?[]:(e.props.value?.columns??[]).filter(f=>f!==e.props.x&&f!==e.props.y&&f!==e.props.color&&(e.props.tooltip==="all"||e.props.tooltip.includes(f))).map(f=>({field:f,type:e.props.value.datatypes[f]}))]},strokeDash:{},mark:{clip:!0,type:_==="hover"?"point":e.props.value.mark},name:_})),params:[...e.props.value.mark==="line"?[{name:"hoverPlot",select:{clear:"mouseout",fields:e.props.color?[e.props.color]:[],nearest:!0,on:"mouseover",type:"point"},views:["hover"]},{name:"hover",select:{clear:"mouseout",nearest:!0,on:"mouseover",type:"point"},views:["hover"]}]:[],...e.props._selectable?[{name:"brush",select:{encodings:["x"],mark:{fill:"gray",fillOpacity:.3,stroke:"none"},type:"interval"},views:["plot"]}]:[]],width:t(y).offsetWidth,height:e.props.height||t(E)?"container":void 0,title:e.props.title||void 0}}Me(ue,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,padding:!0,get height(){return e.props.height},get fullscreen(){return t(E)},set fullscreen(r){h(E,r,!0)},children:(r,l)=>{var g=Ge(),i=K(g);{var s=o=>{De(o,Se({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))};z(i,o=>{e.shared.loading_status&&o(s)})}var d=T(i,2);{var c=o=>{Le(o,{get buttons(){return e.props.buttons},on_custom_button_click:p=>{e.dispatch("custom_button_click",{id:p})},children:(p,v)=>{var m=Be(),u=K(m);{var n=P=>{We(P,{get Icon(){return Ve},label:"Export",onclick:ve})};z(u,P=>{e.props.buttons?.some(O=>typeof O=="string"&&O==="export")&&P(n)})}var F=T(u,2);{var Q=P=>{je(P,{get fullscreen(){return t(E)},onclick:O=>h(E,O,!0)})};z(F,P=>{e.props.buttons?.some(O=>typeof O=="string"&&O==="fullscreen")&&P(Q)})}M(p,m)},$$slots:{default:!0}})};z(d,o=>{e.props.buttons?.length&&o(c)})}var a=T(d,2);Te(a,{get show_label(){return e.shared.show_label},info:void 0,children:(o,p)=>{Ie();var v=we();ie(()=>pe(v,e.shared.label)),M(o,v)},$$slots:{default:!0}});var _=T(a,2);{var f=o=>{var p=Re(),v=K(p);Ae(v,n=>h(y,n),()=>t(y));var m=T(v,2);{var u=n=>{var F=He(),Q=Fe(F,!0);Pe(F),ie(()=>pe(Q,e.props.caption)),M(n,F)};z(m,n=>{e.props.caption&&n(u)})}M(o,p)},w=o=>{Ce(o,{unpadded_box:!0,children:(p,v)=>{Ne(p)},$$slots:{default:!0}})};z(_,o=>{e.props.value&&ge?o(f):o(w,!1)})}M(r,g)},$$slots:{default:!0}}),$e()}export{ut as default}; diff --git a/assets/Index-BHiVKlHr.js b/assets/Index-DraqA-kq.js similarity index 92% rename from assets/Index-BHiVKlHr.js rename to assets/Index-DraqA-kq.js index 2efa922ff09dea6ccb73eefee122706151116ab5..e1045d14284524f6ae9e887a9a882bc6ade8a606 100644 --- a/assets/Index-BHiVKlHr.js +++ b/assets/Index-DraqA-kq.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Blocks-C9ppI-He.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./html-BZIV6tyB.js","./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js","./snippet-BtHMuX3s.js","./ScrollFade-FmR1tTNV.css","./size-D4lmUoTq.js","./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./state.svelte-DpHZj3x1.js","./index-CfM_uZQa.js","./Clear-BR8cTgGu.js","./index-CMKhGNWj.js","./index-tFQomdd2.js","./Blocks-D2UALFgQ.css","./Login-ySksf2jQ.js","./BaseForm-DAripPNq.js","./BaseForm-LdQUnEHK.css","./Textbox-BhB0hOv8.js","./actions-4RaHFoGI.js","./input-BtIxlP_B.js","./BlockTitle-DNiCHWOR.js","./Info-DfrMwI06.js","./Check-2f8HlfSn.js","./Copy-B3jzejpA.js","./Send-oZH_TPNw.js","./Square-D8rV3Ea-.js","./IconButtonWrapper-PnNNNvqI.js","./Textbox-D-AXA9VE.css","./Block-WPcVj6Bq.js","./Button-CV36sOqf.js","./Image-CZ1Hb99p.js","./misc-Dkc5KZ-v.js","./Image-dcYq_y3_.css","./Button-hbTB5kNr.css","./ImagePreview-BZaoS7p0.css","./Index.svelte_svelte_type_style_lang-glBt5fcY.js","./Index-B186V_yQ.css","./Login-CPNF-7LI.css","./Example-DR0uKad_.css"])))=>i.map(i=>d[i]); -import{M as gt,$ as i,a1 as mt,a7 as Be,ae as ht,Y as O,_ as ft,O as yt,P as v,Z as e,x as de,a3 as ke,N as ce,a as k,a0 as u,ad as E,v as m,S as Le,R as J,t as Re,X as Fe,Q as W,af as He,T as Y,a5 as vt}from"./index-DydPgVMC.js";import{D as Ve,p as w,e as wt,E as bt,t as xt,i as U,u as Ge,$ as Ct,F as Et,H as Ze,I as We,a as At,g as kt}from"./i18n-CPHyzK9b.js";import{S as Lt}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var Rt=()=>{const r=document.createElement("link");r.href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap",r.rel="stylesheet";const t=document.createElement("link");t.href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap",t.rel="stylesheet",document.head.appendChild(r),document.head.appendChild(t)},St=()=>{const r=document.createElement("div");return r.style.backgroundImage="linear-gradient(to top, #f9fafb, white)",r.style.border="1px solid #e5e7eb",r.style.borderRadius="0.75rem",r.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)",r.style.color="#374151",r.style.display="flex",r.style.flexDirection="row",r.style.alignItems="center",r.style.height="40px",r.style.justifyContent="space-between",r.style.overflow="hidden",r.style.position="fixed",r.style.right=".75rem",r.style.top=".75rem",r.style.width="auto",r.style.zIndex="20",r.style.paddingLeft="1rem",r.setAttribute("id","huggingface-space-header"),window.matchMedia("(max-width: 768px)").addEventListener("change",t=>{t.matches?r.style.display="none":r.style.display="flex"}),r},It=()=>{const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("role","img"),r.setAttribute("width","1em"),r.setAttribute("height","1em"),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.setAttribute("viewBox","0 0 12 12"),r.setAttribute("fill","currentColor");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","M0.375001 10.3828L0.375 1.61719C0.375 1.104 0.816001 0.687501 1.35938 0.687501L10.6406 0.6875C10.9017 0.6875 11.1521 0.785449 11.3367 0.959797C11.5213 1.13415 11.625 1.37062 11.625 1.61719V10.3828C11.625 10.6294 11.5213 10.8659 11.3367 11.0402C11.1521 11.2145 10.9017 11.3125 10.6406 11.3125H1.35938C0.816001 11.3125 0.375001 10.896 0.375001 10.3828ZM1.35938 10.5156H10.6406C10.7183 10.5156 10.7813 10.4561 10.7813 10.3828V4.40625H1.21875V10.3828C1.21875 10.418 1.23356 10.4518 1.25994 10.4767C1.28631 10.5017 1.32208 10.5156 1.35938 10.5156ZM4.61052 6.38251L5.9999 7.69472L7.38927 6.38251C7.44083 6.33007 7.50645 6.29173 7.57913 6.27153C7.6518 6.25134 7.72898 6.25003 7.8024 6.26776C7.87583 6.28549 7.9428 6.3216 7.99628 6.37227C8.04983 6.42295 8.08785 6.48631 8.10645 6.5557C8.12528 6.62497 8.12393 6.69773 8.10263 6.76635C8.0814 6.83497 8.0409 6.8969 7.98555 6.94564L6.29802 8.53936C6.21892 8.61399 6.11169 8.65592 5.9999 8.65592C5.8881 8.65592 5.78087 8.61399 5.70177 8.53936L4.01427 6.94564C3.95874 6.89694 3.91814 6.835 3.89676 6.76633C3.87538 6.69766 3.874 6.62483 3.89277 6.55549C3.91154 6.48615 3.94977 6.42287 4.00343 6.37233C4.05708 6.32179 4.12418 6.28585 4.19765 6.2683C4.27098 6.25054 4.34803 6.25178 4.42068 6.27188C4.49334 6.29198 4.55891 6.3302 4.61052 6.38251Z"),r.appendChild(t),r},Pt=(r,t)=>{const o=document.createElement("div");return o.setAttribute("id","space-header__collapse"),o.style.display="flex",o.style.flexDirection="row",o.style.alignItems="center",o.style.justifyContent="center",o.style.fontSize="16px",o.style.paddingLeft="10px",o.style.paddingRight="10px",o.style.height="40px",o.style.cursor="pointer",o.style.color="#40546e",o.style.transitionDuration="0.1s",o.style.transitionProperty="all",o.style.transitionTimingFunction="ease-in-out",o.appendChild(It()),o.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),t()}),o.addEventListener("mouseenter",()=>{o.style.color="#213551"}),o.addEventListener("mouseleave",()=>{o.style.color="#40546e"}),o},$t=r=>{const t=document.createElement("p");return t.style.margin="0",t.style.padding="0",t.style.color="#9ca3af",t.style.fontSize="14px",t.style.fontFamily="Source Sans Pro, sans-serif",t.style.padding="0px 6px",t.style.borderLeft="1px solid #e5e7eb",t.style.marginLeft="4px",t.textContent=(r??0).toString(),t},Mt=()=>{const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("role","img"),r.setAttribute("width","1em"),r.setAttribute("height","1em"),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.setAttribute("viewBox","0 0 32 32"),r.setAttribute("fill","#6b7280");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"),r.appendChild(t),r},Dt=r=>{const t=document.createElement("a");return t.setAttribute("href",`https://huggingface.co/spaces/${r.id}`),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.style.border="1px solid #e5e7eb",t.style.borderRadius="6px",t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.margin="0 0 0 12px",t.style.fontSize="14px",t.style.paddingLeft="4px",t.style.textDecoration="none",t.appendChild(Mt()),t.appendChild($t(r.likes)),t},Nt=(r,t="user")=>{const o=t==="user"?"users":"organizations",a=document.createElement("img");return a.src=`https://huggingface.co/api/${o}/${r}/avatar`,a.style.width="0.875rem",a.style.height="0.875rem",a.style.borderRadius="50%",a.style.flex="none",a.style.marginRight="0.375rem",a},zt=r=>{const[t,o]=r.split("/"),a=document.createElement("a");return a.setAttribute("href",`https://huggingface.co/spaces/${r}`),a.setAttribute("rel","noopener noreferrer"),a.setAttribute("target","_blank"),a.style.color="#1f2937",a.style.textDecoration="none",a.style.fontWeight="600",a.style.fontSize="15px",a.style.lineHeight="24px",a.style.flex="none",a.style.fontFamily="IBM Plex Mono, sans-serif",a.addEventListener("mouseover",()=>{a.style.color="#2563eb"}),a.addEventListener("mouseout",()=>{a.style.color="#1f2937"}),a.textContent=o,a},Ot=()=>{const r=document.createElement("div");return r.style.marginLeft=".125rem",r.style.marginRight=".125rem",r.style.color="#d1d5db",r.textContent="/",r},Ut=r=>{const t=document.createElement("a");return t.setAttribute("href",`https://huggingface.co/${r}`),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.style.color="rgb(107, 114, 128)",t.style.textDecoration="none",t.style.fontWeight="400",t.style.fontSize="16px",t.style.lineHeight="24px",t.style.flex="none",t.style.fontFamily="Source Sans Pro, sans-serif",t.addEventListener("mouseover",()=>{t.style.color="#2563eb"}),t.addEventListener("mouseout",()=>{t.style.color="rgb(107, 114, 128)"}),t.textContent=r,t},qt=r=>{const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.justifyContent="center",t.style.borderRight="1px solid #e5e7eb",t.style.paddingRight="12px",t.style.height="40px",r.type!=="unknown"&&t.appendChild(Nt(r.author,r.type)),t.appendChild(Ut(r.author)),t.appendChild(Ot()),t.appendChild(zt(r.id)),t.appendChild(Dt(r)),t},Tt=r=>{const t=St(),o=()=>t.style.display="none";return t.appendChild(qt(r)),t.appendChild(Pt(r,o)),t},Ye=async(r,t="user")=>{const o=t==="user"?"users":"organizations";try{return(await fetch(`https://huggingface.co/api/${o}/${r}/avatar`)).ok}catch{return!1}},jt=async r=>{try{return await(await fetch(`https://huggingface.co/api/spaces/${r}`)).json()}catch{return null}},Bt=(r,t)=>{if(document.body===null)return console.error("document.body is null");document.body.appendChild(r)};async function Ft(r,t){var o,a;if(window===void 0)return console.error("Please run this script in a browser environment");if(Object.values((a=(o=window.location)==null?void 0:o.ancestorOrigins)!=null?a:{0:window.document.referrer}).some(L=>{var T;return((T=new URL(L))==null?void 0:T.origin)==="https://huggingface.co"}))return;Rt();let h;if(typeof r=="string"){if(h=await jt(r),h===null)return console.error("Space not found")}else h=r;const[b,q]=await Promise.all([Ye(h.author,"user"),Ye(h.author,"org")]);h.type=b?"user":q?"org":"unknown";const S=Tt(h);return Bt(S),{element:S}}var Ht=(r,t)=>Ft(r);let Vt=-1;function Gt(){const r=Et({}),t=new Map,o=new IntersectionObserver(R=>{R.forEach(h=>{if(h.isIntersecting){let b=t.get(h.target);b!==void 0&&r.update(q=>({...q,[b]:!0}))}})});function a(R,h){t.set(h,R),o.observe(h)}return{register:a,subscribe:r.subscribe}}const Je=Gt();var Zt=J('

            If your custom component never loads, consult the troubleshooting guide.

            '),Wt=J('
            '),Yt=J('

            Please contact the author of the space to let them know.

            '),Jt=J('

            '),Qt=J('

            '),Xt=J(" ",1);function lr(r,t){gt(t,!1);const o=()=>Ge(Je,"$intersecting",R),a=()=>Ge(Ct,"$_",R),[R,h]=xt();let b=u(!1);Ve().then(()=>{i(b,!0)});const q=mt();let S=w(t,"autoscroll",12),L=w(t,"version",12),T=w(t,"initial_height",12),te=w(t,"app_mode",12),f=w(t,"is_embed",12),ue=w(t,"theme_mode",12,"system"),pe=w(t,"control_page_title",12),_e=w(t,"container",12),ge=w(t,"info",12),re=w(t,"eager",12),me,Se=u([]),Ie=u(),Pe=u(),ne=w(t,"Client",12),I=w(t,"space",12),he=w(t,"src",12),$e=Vt++,j=u("pending"),Qe=u(null),P=u(),Q=u(!1),se=u(!1),s=u(),Me=u("Loading..."),De=u(),ae,X=null;async function Ne(n){n&&(X||(X=document.createElement("style"),document.head.appendChild(X)),X.textContent=Ze(n,L(),X)),await We(e(s).root+"/theme.css?v="+e(s).theme_hash,document.head),e(s).stylesheets&&await Promise.all(e(s).stylesheets.map(d=>d.startsWith("http:")||d.startsWith("https:")?We(d,document.head):fetch(e(s).root+"/"+d).then(c=>c.text()).then(c=>{Ze(c,L())})))}async function ze(n){if(n){const d=new DOMParser,l=Array.from(d.parseFromString(n,"text/html").head.children);if(l)for(let c of l){let _=document.createElement(c.tagName);if(_.tagName==="SCRIPT"&&(_.async=!1),Array.from(c.attributes).forEach(y=>{_.setAttribute(y.name,y.value)}),_.textContent=c.textContent,_.tagName=="META"){const y=_.getAttribute("property"),M=_.getAttribute("name");if(y||M){const le=Array.from(document.head.getElementsByTagName("meta")??[]).find(F=>y&&F.getAttribute("property")===y||M&&F.getAttribute("name")===M?!F.isEqualNode(_):!1);if(le){document.head.replaceChild(_,le);continue}}}document.head.appendChild(_)}}}function Xe(n){const d=window.__gradio_mode__==="website";let l;if(d)l="light";else{const _=new URL(window.location.toString()).searchParams.get("__theme");l=ue()||_||"system"}return l==="dark"||l==="light"?Oe(n,l):l=Ke(n),l}function Ke(n){const d=l();window?.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",l);function l(){let c=window?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light";return Oe(n,c),c}return d}function Oe(n,d){const l=f()?n.parentElement:document.body,c=f()?n:n.parentElement;c.style.background="var(--body-background-fill)",d==="dark"?l.classList.add("dark"):l.classList.remove("dark")}let g=u({message:"",load_status:"pending",status:"sleeping",detail:"SLEEPING"}),p=u(),fe=u(!1);function Ue(n){i(g,n)}const qe=window.__GRADIO_DEV__;let oe=u(!1),B=u(),ye=u(0);Be(async()=>{i(De,Xe(e(P)));const n=window.__GRADIO__SERVER_PORT__;ae=qe==="dev"?`http://localhost:${typeof n=="number"?n:7860}`:I()||he()||new URL(location.pathname,location.origin).href.replace(/\/$/,"");const d=new URLSearchParams(window.location.search).get("deep_link"),l={};if(d&&(l.deep_link=d),i(p,await ne().connect(ae,{status_callback:Ue,with_null_state:!0,events:["data","log","status","render"],query_params:l})),window.addEventListener("beforeunload",()=>{e(p).close()}),!e(p).config&&!e(s)?.auth_required)throw new Error("Could not resolve app config");if(i(s,e(p).get_url_config()),window.__gradio_space__=e(s).space_id,e(p).config?.i18n_translations&&(await Ve(e(p).config.i18n_translations),i(b,!0)),window.__gradio_session_hash__=e(p).session_hash,i(g,{message:"",load_status:"complete",status:"running",detail:"RUNNING"}),await Ne(e(s).css),await ze(e(s).head),i(fe,!0),window.__is_colab__=e(s).is_colab,q("loaded"),i(Se,e(s).pages),i(Ie,e(s).current_page),i(Pe,e(s).root),e(s).deep_link_state==="invalid"&&i(oe,!0),e(s).js)try{const c=document.createElement("script");c.textContent=e(s).js,document.head.appendChild(c)}catch(c){console.error("Error executing custom JS:",c)}e(s).dev_mode&&setTimeout(()=>{const{host:c}=new URL(ae);let _=new URL(`${window.location.protocol}//${c}${e(p).api_prefix}/dev/reload`);me=new EventSource(_),me.addEventListener("error",async y=>{let M=y.data;M&&(e(B)("Error","Error reloading app",-1,"error",10,!0),console.error(JSON.parse(M)))}),me.addEventListener("reload",async y=>{if(e(p).close(),i(p,await ne().connect(ae,{status_callback:Ue,with_null_state:!0,events:["data","log","status","render"],session_hash:e(p).session_hash})),!e(p).config)throw new Error("Could not resolve app config");i(s,e(p).get_url_config()),window.__gradio_space__=e(s).space_id,await Ne(e(s).css),await ze(e(s).head),i(fe,!0),window.__is_colab__=e(s).is_colab,i(ye,e(ye)+1),q("loaded")})},200)});let ve=u(),ie=u();async function et(){i(ve,(await He(async()=>{const{default:n}=await import("./Blocks-C9ppI-He.js").then(d=>d.B);return{default:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url)).default)}async function tt(){i(ie,(await He(async()=>{const{default:n}=await import("./Login-ySksf2jQ.js");return{default:n}},__vite__mapDeps([19,3,1,2,4,5,20,21,22,23,24,6,7,8,25,26,27,28,29,30,31,32,10,11,12,33,34,35,36,37,38,39,40,14,15,41,42,43]),import.meta.url)).default)}function rt(){e(s).auth_required?tt():et()}let $=u();Be(async()=>{Je.register($e,e(P))});let K;async function nt(n,d){if(n&&!d&&window.self===window.top){K&&(K.remove(),K=void 0);const l=await Ht(n);l&&(K=l.element)}}ht(()=>{K?.remove()}),O(()=>e(s),()=>{e(s)?.app_id&&i(Qe,e(s).app_id)}),O(()=>(e(B),e(oe)),()=>{e(B)&&e(oe)&&(e(B)("Error","Deep link was not valid",-1,"error",10,!0),i(oe,!1))}),O(()=>(e(Q),e(g)),()=>{i(j,!e(Q)&&e(g).load_status!=="error"?"pending":!e(Q)&&e(g).load_status==="error"?"error":e(g).load_status)}),O(()=>(e(s),de(re()),o()),()=>{e(s)&&(re()||o()[$e])&&rt()}),O(()=>(e(b),a()),()=>{e(b)&&(i(Me,a()("common.loading")+"..."),i($,{readable_error:{NO_APP_FILE:a()("errors.no_app_file"),CONFIG_ERROR:a()("errors.config_error"),BUILD_ERROR:a()("errors.build_error"),RUNTIME_ERROR:a()("errors.runtime_error"),PAUSED:a()("errors.space_paused")},title(n){return encodeURIComponent(a()("errors.space_not_working"))},description(n,d){return encodeURIComponent(`Hello, +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Blocks-C4lA_Loz.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./i18n-DtG3MAQ1.js","./i18n-CawRO-sx.css","./html-DE4EmiOG.js","./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js","./snippet-BRIBYCwB.js","./ScrollFade-FmR1tTNV.css","./size-ChvveZyb.js","./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./state.svelte-COyO-AzF.js","./index-1YthqPsU.js","./Clear-BiKSVifk.js","./index-DCGrAb1j.js","./index-tFQomdd2.js","./Blocks-D2UALFgQ.css","./Login-RGzKMwr1.js","./BaseForm-CgXgHXvl.js","./BaseForm-LdQUnEHK.css","./Textbox-a-5KfA85.js","./actions-BbCJS635.js","./input-BLFxNjIx.js","./BlockTitle-B6Pgijwb.js","./Info-BjDIKIgf.js","./Check-DjGw_9dO.js","./Copy-eBznHIlR.js","./Send--YHrNLI0.js","./Square-CSlbzSkn.js","./IconButtonWrapper-Ce5bzAyh.js","./Textbox-D-AXA9VE.css","./Block-DkzyQHli.js","./Button-j0-_VC-G.js","./Image-ALBOEs1f.js","./misc-D-Y84gKJ.js","./Image-dcYq_y3_.css","./Button-hbTB5kNr.css","./ImagePreview-BZaoS7p0.css","./Index.svelte_svelte_type_style_lang-CqKXbK2o.js","./Index-B186V_yQ.css","./Login-CPNF-7LI.css","./Example-DR0uKad_.css"])))=>i.map(i=>d[i]); +import{M as gt,$ as i,a1 as mt,a7 as Be,ae as ht,Y as O,_ as ft,O as yt,P as v,Z as e,x as de,a3 as ke,N as ce,a as k,a0 as u,ad as E,v as m,S as Le,R as J,t as Re,X as Fe,Q as W,af as He,T as Y,a5 as vt}from"./index-BeNBoC9J.js";import{D as Ve,p as w,e as wt,E as bt,t as xt,i as U,u as Ge,$ as Ct,F as Et,H as Ze,I as We,a as At,g as kt}from"./i18n-DtG3MAQ1.js";import{S as Lt}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var Rt=()=>{const r=document.createElement("link");r.href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap",r.rel="stylesheet";const t=document.createElement("link");t.href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap",t.rel="stylesheet",document.head.appendChild(r),document.head.appendChild(t)},St=()=>{const r=document.createElement("div");return r.style.backgroundImage="linear-gradient(to top, #f9fafb, white)",r.style.border="1px solid #e5e7eb",r.style.borderRadius="0.75rem",r.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)",r.style.color="#374151",r.style.display="flex",r.style.flexDirection="row",r.style.alignItems="center",r.style.height="40px",r.style.justifyContent="space-between",r.style.overflow="hidden",r.style.position="fixed",r.style.right=".75rem",r.style.top=".75rem",r.style.width="auto",r.style.zIndex="20",r.style.paddingLeft="1rem",r.setAttribute("id","huggingface-space-header"),window.matchMedia("(max-width: 768px)").addEventListener("change",t=>{t.matches?r.style.display="none":r.style.display="flex"}),r},It=()=>{const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("role","img"),r.setAttribute("width","1em"),r.setAttribute("height","1em"),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.setAttribute("viewBox","0 0 12 12"),r.setAttribute("fill","currentColor");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","M0.375001 10.3828L0.375 1.61719C0.375 1.104 0.816001 0.687501 1.35938 0.687501L10.6406 0.6875C10.9017 0.6875 11.1521 0.785449 11.3367 0.959797C11.5213 1.13415 11.625 1.37062 11.625 1.61719V10.3828C11.625 10.6294 11.5213 10.8659 11.3367 11.0402C11.1521 11.2145 10.9017 11.3125 10.6406 11.3125H1.35938C0.816001 11.3125 0.375001 10.896 0.375001 10.3828ZM1.35938 10.5156H10.6406C10.7183 10.5156 10.7813 10.4561 10.7813 10.3828V4.40625H1.21875V10.3828C1.21875 10.418 1.23356 10.4518 1.25994 10.4767C1.28631 10.5017 1.32208 10.5156 1.35938 10.5156ZM4.61052 6.38251L5.9999 7.69472L7.38927 6.38251C7.44083 6.33007 7.50645 6.29173 7.57913 6.27153C7.6518 6.25134 7.72898 6.25003 7.8024 6.26776C7.87583 6.28549 7.9428 6.3216 7.99628 6.37227C8.04983 6.42295 8.08785 6.48631 8.10645 6.5557C8.12528 6.62497 8.12393 6.69773 8.10263 6.76635C8.0814 6.83497 8.0409 6.8969 7.98555 6.94564L6.29802 8.53936C6.21892 8.61399 6.11169 8.65592 5.9999 8.65592C5.8881 8.65592 5.78087 8.61399 5.70177 8.53936L4.01427 6.94564C3.95874 6.89694 3.91814 6.835 3.89676 6.76633C3.87538 6.69766 3.874 6.62483 3.89277 6.55549C3.91154 6.48615 3.94977 6.42287 4.00343 6.37233C4.05708 6.32179 4.12418 6.28585 4.19765 6.2683C4.27098 6.25054 4.34803 6.25178 4.42068 6.27188C4.49334 6.29198 4.55891 6.3302 4.61052 6.38251Z"),r.appendChild(t),r},Pt=(r,t)=>{const o=document.createElement("div");return o.setAttribute("id","space-header__collapse"),o.style.display="flex",o.style.flexDirection="row",o.style.alignItems="center",o.style.justifyContent="center",o.style.fontSize="16px",o.style.paddingLeft="10px",o.style.paddingRight="10px",o.style.height="40px",o.style.cursor="pointer",o.style.color="#40546e",o.style.transitionDuration="0.1s",o.style.transitionProperty="all",o.style.transitionTimingFunction="ease-in-out",o.appendChild(It()),o.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),t()}),o.addEventListener("mouseenter",()=>{o.style.color="#213551"}),o.addEventListener("mouseleave",()=>{o.style.color="#40546e"}),o},$t=r=>{const t=document.createElement("p");return t.style.margin="0",t.style.padding="0",t.style.color="#9ca3af",t.style.fontSize="14px",t.style.fontFamily="Source Sans Pro, sans-serif",t.style.padding="0px 6px",t.style.borderLeft="1px solid #e5e7eb",t.style.marginLeft="4px",t.textContent=(r??0).toString(),t},Mt=()=>{const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("role","img"),r.setAttribute("width","1em"),r.setAttribute("height","1em"),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.setAttribute("viewBox","0 0 32 32"),r.setAttribute("fill","#6b7280");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"),r.appendChild(t),r},Dt=r=>{const t=document.createElement("a");return t.setAttribute("href",`https://huggingface.co/spaces/${r.id}`),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.style.border="1px solid #e5e7eb",t.style.borderRadius="6px",t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.margin="0 0 0 12px",t.style.fontSize="14px",t.style.paddingLeft="4px",t.style.textDecoration="none",t.appendChild(Mt()),t.appendChild($t(r.likes)),t},Nt=(r,t="user")=>{const o=t==="user"?"users":"organizations",a=document.createElement("img");return a.src=`https://huggingface.co/api/${o}/${r}/avatar`,a.style.width="0.875rem",a.style.height="0.875rem",a.style.borderRadius="50%",a.style.flex="none",a.style.marginRight="0.375rem",a},zt=r=>{const[t,o]=r.split("/"),a=document.createElement("a");return a.setAttribute("href",`https://huggingface.co/spaces/${r}`),a.setAttribute("rel","noopener noreferrer"),a.setAttribute("target","_blank"),a.style.color="#1f2937",a.style.textDecoration="none",a.style.fontWeight="600",a.style.fontSize="15px",a.style.lineHeight="24px",a.style.flex="none",a.style.fontFamily="IBM Plex Mono, sans-serif",a.addEventListener("mouseover",()=>{a.style.color="#2563eb"}),a.addEventListener("mouseout",()=>{a.style.color="#1f2937"}),a.textContent=o,a},Ot=()=>{const r=document.createElement("div");return r.style.marginLeft=".125rem",r.style.marginRight=".125rem",r.style.color="#d1d5db",r.textContent="/",r},Ut=r=>{const t=document.createElement("a");return t.setAttribute("href",`https://huggingface.co/${r}`),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.style.color="rgb(107, 114, 128)",t.style.textDecoration="none",t.style.fontWeight="400",t.style.fontSize="16px",t.style.lineHeight="24px",t.style.flex="none",t.style.fontFamily="Source Sans Pro, sans-serif",t.addEventListener("mouseover",()=>{t.style.color="#2563eb"}),t.addEventListener("mouseout",()=>{t.style.color="rgb(107, 114, 128)"}),t.textContent=r,t},qt=r=>{const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.justifyContent="center",t.style.borderRight="1px solid #e5e7eb",t.style.paddingRight="12px",t.style.height="40px",r.type!=="unknown"&&t.appendChild(Nt(r.author,r.type)),t.appendChild(Ut(r.author)),t.appendChild(Ot()),t.appendChild(zt(r.id)),t.appendChild(Dt(r)),t},Tt=r=>{const t=St(),o=()=>t.style.display="none";return t.appendChild(qt(r)),t.appendChild(Pt(r,o)),t},Ye=async(r,t="user")=>{const o=t==="user"?"users":"organizations";try{return(await fetch(`https://huggingface.co/api/${o}/${r}/avatar`)).ok}catch{return!1}},jt=async r=>{try{return await(await fetch(`https://huggingface.co/api/spaces/${r}`)).json()}catch{return null}},Bt=(r,t)=>{if(document.body===null)return console.error("document.body is null");document.body.appendChild(r)};async function Ft(r,t){var o,a;if(window===void 0)return console.error("Please run this script in a browser environment");if(Object.values((a=(o=window.location)==null?void 0:o.ancestorOrigins)!=null?a:{0:window.document.referrer}).some(L=>{var T;return((T=new URL(L))==null?void 0:T.origin)==="https://huggingface.co"}))return;Rt();let h;if(typeof r=="string"){if(h=await jt(r),h===null)return console.error("Space not found")}else h=r;const[b,q]=await Promise.all([Ye(h.author,"user"),Ye(h.author,"org")]);h.type=b?"user":q?"org":"unknown";const S=Tt(h);return Bt(S),{element:S}}var Ht=(r,t)=>Ft(r);let Vt=-1;function Gt(){const r=Et({}),t=new Map,o=new IntersectionObserver(R=>{R.forEach(h=>{if(h.isIntersecting){let b=t.get(h.target);b!==void 0&&r.update(q=>({...q,[b]:!0}))}})});function a(R,h){t.set(h,R),o.observe(h)}return{register:a,subscribe:r.subscribe}}const Je=Gt();var Zt=J('

            If your custom component never loads, consult the troubleshooting guide.

            '),Wt=J('
            '),Yt=J('

            Please contact the author of the space to let them know.

            '),Jt=J('

            '),Qt=J('

            '),Xt=J(" ",1);function lr(r,t){gt(t,!1);const o=()=>Ge(Je,"$intersecting",R),a=()=>Ge(Ct,"$_",R),[R,h]=xt();let b=u(!1);Ve().then(()=>{i(b,!0)});const q=mt();let S=w(t,"autoscroll",12),L=w(t,"version",12),T=w(t,"initial_height",12),te=w(t,"app_mode",12),f=w(t,"is_embed",12),ue=w(t,"theme_mode",12,"system"),pe=w(t,"control_page_title",12),_e=w(t,"container",12),ge=w(t,"info",12),re=w(t,"eager",12),me,Se=u([]),Ie=u(),Pe=u(),ne=w(t,"Client",12),I=w(t,"space",12),he=w(t,"src",12),$e=Vt++,j=u("pending"),Qe=u(null),P=u(),Q=u(!1),se=u(!1),s=u(),Me=u("Loading..."),De=u(),ae,X=null;async function Ne(n){n&&(X||(X=document.createElement("style"),document.head.appendChild(X)),X.textContent=Ze(n,L(),X)),await We(e(s).root+"/theme.css?v="+e(s).theme_hash,document.head),e(s).stylesheets&&await Promise.all(e(s).stylesheets.map(d=>d.startsWith("http:")||d.startsWith("https:")?We(d,document.head):fetch(e(s).root+"/"+d).then(c=>c.text()).then(c=>{Ze(c,L())})))}async function ze(n){if(n){const d=new DOMParser,l=Array.from(d.parseFromString(n,"text/html").head.children);if(l)for(let c of l){let _=document.createElement(c.tagName);if(_.tagName==="SCRIPT"&&(_.async=!1),Array.from(c.attributes).forEach(y=>{_.setAttribute(y.name,y.value)}),_.textContent=c.textContent,_.tagName=="META"){const y=_.getAttribute("property"),M=_.getAttribute("name");if(y||M){const le=Array.from(document.head.getElementsByTagName("meta")??[]).find(F=>y&&F.getAttribute("property")===y||M&&F.getAttribute("name")===M?!F.isEqualNode(_):!1);if(le){document.head.replaceChild(_,le);continue}}}document.head.appendChild(_)}}}function Xe(n){const d=window.__gradio_mode__==="website";let l;if(d)l="light";else{const _=new URL(window.location.toString()).searchParams.get("__theme");l=ue()||_||"system"}return l==="dark"||l==="light"?Oe(n,l):l=Ke(n),l}function Ke(n){const d=l();window?.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",l);function l(){let c=window?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light";return Oe(n,c),c}return d}function Oe(n,d){const l=f()?n.parentElement:document.body,c=f()?n:n.parentElement;c.style.background="var(--body-background-fill)",d==="dark"?l.classList.add("dark"):l.classList.remove("dark")}let g=u({message:"",load_status:"pending",status:"sleeping",detail:"SLEEPING"}),p=u(),fe=u(!1);function Ue(n){i(g,n)}const qe=window.__GRADIO_DEV__;let oe=u(!1),B=u(),ye=u(0);Be(async()=>{i(De,Xe(e(P)));const n=window.__GRADIO__SERVER_PORT__;ae=qe==="dev"?`http://localhost:${typeof n=="number"?n:7860}`:I()||he()||new URL(location.pathname,location.origin).href.replace(/\/$/,"");const d=new URLSearchParams(window.location.search).get("deep_link"),l={};if(d&&(l.deep_link=d),i(p,await ne().connect(ae,{status_callback:Ue,with_null_state:!0,events:["data","log","status","render"],query_params:l})),window.addEventListener("beforeunload",()=>{e(p).close()}),!e(p).config&&!e(s)?.auth_required)throw new Error("Could not resolve app config");if(i(s,e(p).get_url_config()),window.__gradio_space__=e(s).space_id,e(p).config?.i18n_translations&&(await Ve(e(p).config.i18n_translations),i(b,!0)),window.__gradio_session_hash__=e(p).session_hash,i(g,{message:"",load_status:"complete",status:"running",detail:"RUNNING"}),await Ne(e(s).css),await ze(e(s).head),i(fe,!0),window.__is_colab__=e(s).is_colab,q("loaded"),i(Se,e(s).pages),i(Ie,e(s).current_page),i(Pe,e(s).root),e(s).deep_link_state==="invalid"&&i(oe,!0),e(s).js)try{const c=document.createElement("script");c.textContent=e(s).js,document.head.appendChild(c)}catch(c){console.error("Error executing custom JS:",c)}e(s).dev_mode&&setTimeout(()=>{const{host:c}=new URL(ae);let _=new URL(`${window.location.protocol}//${c}${e(p).api_prefix}/dev/reload`);me=new EventSource(_),me.addEventListener("error",async y=>{let M=y.data;M&&(e(B)("Error","Error reloading app",-1,"error",10,!0),console.error(JSON.parse(M)))}),me.addEventListener("reload",async y=>{if(e(p).close(),i(p,await ne().connect(ae,{status_callback:Ue,with_null_state:!0,events:["data","log","status","render"],session_hash:e(p).session_hash})),!e(p).config)throw new Error("Could not resolve app config");i(s,e(p).get_url_config()),window.__gradio_space__=e(s).space_id,await Ne(e(s).css),await ze(e(s).head),i(fe,!0),window.__is_colab__=e(s).is_colab,i(ye,e(ye)+1),q("loaded")})},200)});let ve=u(),ie=u();async function et(){i(ve,(await He(async()=>{const{default:n}=await import("./Blocks-C4lA_Loz.js").then(d=>d.B);return{default:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url)).default)}async function tt(){i(ie,(await He(async()=>{const{default:n}=await import("./Login-RGzKMwr1.js");return{default:n}},__vite__mapDeps([19,3,1,2,4,5,20,21,22,23,24,6,7,8,25,26,27,28,29,30,31,32,10,11,12,33,34,35,36,37,38,39,40,14,15,41,42,43]),import.meta.url)).default)}function rt(){e(s).auth_required?tt():et()}let $=u();Be(async()=>{Je.register($e,e(P))});let K;async function nt(n,d){if(n&&!d&&window.self===window.top){K&&(K.remove(),K=void 0);const l=await Ht(n);l&&(K=l.element)}}ht(()=>{K?.remove()}),O(()=>e(s),()=>{e(s)?.app_id&&i(Qe,e(s).app_id)}),O(()=>(e(B),e(oe)),()=>{e(B)&&e(oe)&&(e(B)("Error","Deep link was not valid",-1,"error",10,!0),i(oe,!1))}),O(()=>(e(Q),e(g)),()=>{i(j,!e(Q)&&e(g).load_status!=="error"?"pending":!e(Q)&&e(g).load_status==="error"?"error":e(g).load_status)}),O(()=>(e(s),de(re()),o()),()=>{e(s)&&(re()||o()[$e])&&rt()}),O(()=>(e(b),a()),()=>{e(b)&&(i(Me,a()("common.loading")+"..."),i($,{readable_error:{NO_APP_FILE:a()("errors.no_app_file"),CONFIG_ERROR:a()("errors.config_error"),BUILD_ERROR:a()("errors.build_error"),RUNTIME_ERROR:a()("errors.runtime_error"),PAUSED:a()("errors.space_paused")},title(n){return encodeURIComponent(a()("errors.space_not_working"))},description(n,d){return encodeURIComponent(`Hello, Firstly, thanks for creating this space! diff --git a/assets/Index-uGItVsFZ.js b/assets/Index-Drnwkydh.js similarity index 80% rename from assets/Index-uGItVsFZ.js rename to assets/Index-Drnwkydh.js index cf61d016efc85c9f630e9585860db3ee0f983337..4f9f9512e3bade3015209c8ceaf402d7a137df8d 100644 --- a/assets/Index-uGItVsFZ.js +++ b/assets/Index-Drnwkydh.js @@ -1 +1 @@ -import{p as a,i as f,a as h,G as I,r as M}from"./i18n-CPHyzK9b.js";import{M as w,N as b,a as o,O as k,S as N,R as x,t as y,a3 as O,a4 as R,Z as S,a2 as X,X as Z,a5 as j}from"./index-DydPgVMC.js";import{s as p}from"./snippet-BtHMuX3s.js";import{B as q}from"./Button-CV36sOqf.js";import"./Image-CZ1Hb99p.js";import"./misc-Dkc5KZ-v.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */var A=x(''),F=x(" ",1);function H(u,e){w(e,!0);let c=a(e,"elem_id",3,""),t=a(e,"elem_classes",19,()=>[]),m=a(e,"visible",3,!0),_=a(e,"variant",3,"secondary"),v=a(e,"size",3,"lg"),d=a(e,"disabled",3,!1),z=a(e,"scale",3,null),B=a(e,"min_width",3,void 0);function C(){if(e.on_click?.(),!e.value?.url)return;let r;if(!e.value.orig_name&&e.value.url){const s=e.value.url.split("/");r=s[s.length-1],r=r.split("?")[0].split("#")[0]}else r=e.value.orig_name;const l=document.createElement("a");l.href=e.value.url,l.download=r||"file",document.body.appendChild(l),l.click(),document.body.removeChild(l)}q(u,{get size(){return v()},get variant(){return _()},get elem_id(){return c()},get elem_classes(){return t()},get visible(){return m()},onclick:C,get scale(){return z()},get min_width(){return B()},get disabled(){return d()},children:(r,l)=>{var s=F(),g=b(s);{var G=i=>{var n=A();y(()=>{h(n,"src",e.icon.url),h(n,"alt",`${e.value} icon`)}),o(i,n)};f(g,i=>{e.icon&&i(G)})}var P=N(g,2);{var D=i=>{var n=O(),E=b(n);p(E,()=>e.children),o(i,n)};f(P,i=>{e.children&&i(D)})}o(r,s)},$$slots:{default:!0}}),k()}function $(u,e){w(e,!0);const c=M(e,["$$slots","$$events","$$legacy"]),t=new I(c);t.watch_for_change();{let m=X(()=>!t.shared.interactive);H(u,{get value(){return t.props.value},get variant(){return t.props.variant},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get size(){return t.props.size},get scale(){return t.shared.scale},get icon(){return t.props.icon},get min_width(){return t.shared.min_width},get visible(){return t.shared.visible},get disabled(){return S(m)},on_click:()=>t.dispatch("click"),children:(_,v)=>{j();var d=R();y(()=>Z(d,t.shared.label??"")),o(_,d)},$$slots:{default:!0}})}k()}export{H as BaseButton,$ as default}; +import{p as a,i as f,a as h,G as I,r as M}from"./i18n-DtG3MAQ1.js";import{M as w,N as b,a as o,O as k,S as N,R as x,t as y,a3 as O,a4 as R,Z as S,a2 as X,X as Z,a5 as j}from"./index-BeNBoC9J.js";import{s as p}from"./snippet-BRIBYCwB.js";import{B as q}from"./Button-j0-_VC-G.js";import"./Image-ALBOEs1f.js";import"./misc-D-Y84gKJ.js";/* empty css */import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";/* empty css */var A=x(''),F=x(" ",1);function H(u,e){w(e,!0);let c=a(e,"elem_id",3,""),t=a(e,"elem_classes",19,()=>[]),m=a(e,"visible",3,!0),_=a(e,"variant",3,"secondary"),v=a(e,"size",3,"lg"),d=a(e,"disabled",3,!1),z=a(e,"scale",3,null),B=a(e,"min_width",3,void 0);function C(){if(e.on_click?.(),!e.value?.url)return;let r;if(!e.value.orig_name&&e.value.url){const s=e.value.url.split("/");r=s[s.length-1],r=r.split("?")[0].split("#")[0]}else r=e.value.orig_name;const l=document.createElement("a");l.href=e.value.url,l.download=r||"file",document.body.appendChild(l),l.click(),document.body.removeChild(l)}q(u,{get size(){return v()},get variant(){return _()},get elem_id(){return c()},get elem_classes(){return t()},get visible(){return m()},onclick:C,get scale(){return z()},get min_width(){return B()},get disabled(){return d()},children:(r,l)=>{var s=F(),g=b(s);{var G=i=>{var n=A();y(()=>{h(n,"src",e.icon.url),h(n,"alt",`${e.value} icon`)}),o(i,n)};f(g,i=>{e.icon&&i(G)})}var P=N(g,2);{var D=i=>{var n=O(),E=b(n);p(E,()=>e.children),o(i,n)};f(P,i=>{e.children&&i(D)})}o(r,s)},$$slots:{default:!0}}),k()}function $(u,e){w(e,!0);const c=M(e,["$$slots","$$events","$$legacy"]),t=new I(c);t.watch_for_change();{let m=X(()=>!t.shared.interactive);H(u,{get value(){return t.props.value},get variant(){return t.props.variant},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get size(){return t.props.size},get scale(){return t.shared.scale},get icon(){return t.props.icon},get min_width(){return t.shared.min_width},get visible(){return t.shared.visible},get disabled(){return S(m)},on_click:()=>t.dispatch("click"),children:(_,v)=>{j();var d=R();y(()=>Z(d,t.shared.label??"")),o(_,d)},$$slots:{default:!0}})}k()}export{H as BaseButton,$ as default}; diff --git a/assets/Index-9wedEojI.js b/assets/Index-MykHl5RI.js similarity index 92% rename from assets/Index-9wedEojI.js rename to assets/Index-MykHl5RI.js index 444306e35a0a896484e318c4a03bd7d81abf5579..775bf496c860836b6db611b5f7f432222cbd4bdf 100644 --- a/assets/Index-9wedEojI.js +++ b/assets/Index-MykHl5RI.js @@ -1 +1 @@ -import{p as lt,e as Ht,i as C,d as vt,f as Vt,b as Q,q as ct,w as ht}from"./i18n-CPHyzK9b.js";import{M as Rt,a7 as $t,Y as I,x as zt,G as U,Z as t,_ as Bt,t as z,v as g,U as k,a as h,O as Dt,a0 as w,$ as o,P as pt,Q as l,S as p,R as f,T as d,a3 as Lt,N as Pt,ai as Ut,X as et,a4 as ut}from"./index-DydPgVMC.js";import{b as Wt}from"./input-BtIxlP_B.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{C as Tt}from"./Code-Bhm2YgEI.js";/* empty css */import{M as Zt}from"./Index.svelte_svelte_type_style_lang-C-orki39.js";import"./MarkdownCode-BTj729_f.js";import"./index-B_pwUImq.js";/* empty css */import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";import"./actions-4RaHFoGI.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./prism-python-BGiTAEDL.js";var qt=f(' '),Qt=f(' '),It=f(' '),jt=f(''),Gt=f('
            '),Nt=f('
            No messages yet
            '),Xt=f(''),Yt=f('
            '),At=f('
            '),Kt=f('
            '),Ot=f('
            Powered by: gpt-oss
            ');function be(_t,j){Rt(j,!1);let E=lt(j,"app",12),F=lt(j,"root",12),H=w(""),G=w(350),N=!1,at=w(),M=w("chat"),B=w(""),c=w(null),i=w([]),D=w();const W=(e="smooth")=>{t(D)&&t(D).scrollTo({top:t(D).scrollHeight,behavior:e})};let T=w([]);(async()=>E().post_data(`${F()}/gradio_api/vibe-starter-queries/`,{}).then(async([s,n])=>{if(n!==200)throw new Error(`Error: ${n}`);o(T,s.starter_queries)}).catch(async s=>{console.error("Failed to fetch starter queries:",s)}))();const X=async e=>{const s=e||t(H);if(s.trim()==="")return;o(c,null);const n=t(i).length;o(i,[...t(i),{text:s,isBot:!1}]);const u=t(i).length;o(i,[...t(i),{text:"Working...",isBot:!0,isPending:!0}]),await U(),W();const y=s;e||o(H,""),E().post_data(`${F()}/gradio_api/vibe-edit/`,{prompt:y}).then(async([v,r])=>{if(r!==200)throw new Error(`Error: ${r}`);const a=v;o(c,a.diff_stats),o(i,t(i).map((_,m)=>m===n?{..._,hash:a.hash}:_)),o(i,t(i).map((_,m)=>m===u?{text:a.reasoning?a.reasoning:"Done.",isBot:!0,isPending:!1}:_)),await U(),W()}).catch(async v=>{o(i,t(i).map((r,a)=>a===u?{text:"Error occurred.",isBot:!0,isPending:!1}:r)),await U(),W()})},mt=async e=>{await X(e)},ft=async(e,s)=>{try{await E().post_data(`${F()}/gradio_api/undo-vibe-edit/`,{hash:e}),o(c,null);const n=t(i)[s];o(H,n.text),o(i,t(i).slice(0,s))}catch(n){console.error("Failed to undo:",n)}},bt=e=>{e.preventDefault(),N=!0,document.addEventListener("mousemove",Y),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},Y=e=>{if(!N)return;const s=250,n=Math.min(800,window.innerWidth*.5),u=window.innerWidth-e.clientX;o(G,Math.max(s,Math.min(n,u))),window.dispatchEvent(new CustomEvent("vibeEditorResize",{detail:{width:t(G)}}))},A=()=>{N=!1,document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",A),document.body.style.cursor="",document.body.style.userSelect=""},gt=async()=>{try{const e=await fetch(`${F()}/gradio_api/vibe-code/`,{method:"GET",headers:{"Content-Type":"application/json"}});if(e.ok){const s=await e.json();o(B,s.code)}}catch(e){console.error("Failed to fetch code:",e)}};let $=w(!1);const wt=async()=>{try{await E().post_data(`${F()}/gradio_api/vibe-code/`,{code:t(B)}),o($,!0),setTimeout(()=>{o($,!1)},1e3)}catch(e){console.error("Failed to update code:",e)}};function yt(){const e="https://huggingface.co/new-space",s=new URLSearchParams({name:"new-space",sdk:"gradio"}),n=t(B).trimStart();s.append("files[0][path]","app.py"),s.append("files[0][content]",n),window.open(`${e}?${s.toString()}`,"_blank")?.focus()}$t(()=>()=>{document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",A)}),I(()=>zt(E()),()=>{E(),gt()}),I(()=>(t(M),U),()=>{t(M)==="chat"&&U().then(()=>W("auto"))}),I(()=>t($),()=>{t($)}),I(()=>t(T),()=>{t(T)}),Bt();var xt={get app(){return E()},set app(e){E(e),pt()},get root(){return F()},set root(e){F(e),pt()}};Ht();var L=Ot(),st=l(L),K=p(st,2),O=l(K);let rt;var Z=p(O,2);let ot;var Ct=p(l(Z));{var kt=e=>{var s=It(),n=l(s);{var u=v=>{var r=qt(),a=l(r);d(r),z(()=>et(a,`+${t(c),g(()=>t(c).lines_added)??""}`)),h(v,r)};C(n,v=>{t(c),g(()=>t(c).lines_added>0)&&v(u)})}var y=p(n,2);{var S=v=>{var r=Qt(),a=l(r);d(r),z(()=>et(a,`-${t(c),g(()=>t(c).lines_removed)??""}`)),h(v,r)};C(y,v=>{t(c),g(()=>t(c).lines_removed>0)&&v(S)})}d(s),h(e,s)};C(Ct,e=>{t(c),g(()=>t(c)&&(t(c).lines_added>0||t(c).lines_removed>0))&&e(kt)})}d(Z),d(K);var J=p(K,2),Et=l(J);{var Mt=e=>{var s=At(),n=l(s);ct(n,1,()=>t(i),ht,(r,a,_)=>{var m=Gt();let V;var x=l(m),R=l(x),b=l(R);Zt(b,{get value(){return t(a),g(()=>t(a).text)},latex_delimiters:[],theme_mode:"system"}),d(R);var P=p(R,2);{var Ft=tt=>{var dt=jt();k("click",dt,()=>ft(t(a).hash||"",_)),h(tt,dt)};C(P,tt=>{t(a),g(()=>!t(a).isBot&&t(a).hash&&!t(a).isPending)&&tt(Ft)})}d(x),d(m),z(()=>V=Q(m,1,"message-item svelte-rvhith",null,V,{"bot-message":t(a).isBot,"user-message":!t(a).isBot})),h(r,m)});var u=p(n,2);{var y=r=>{var a=Nt();h(r,a)};C(u,r=>{t(i),g(()=>t(i).length===0)&&r(y)})}var S=p(u,2);{var v=r=>{var a=Yt(),_=l(a);ct(_,5,()=>t(T),ht,(m,V)=>{var x=Xt(),R=l(x,!0);d(x),z(()=>et(R,t(V))),k("click",x,()=>mt(t(V))),h(m,x)}),d(_),d(a),h(r,a)};C(S,r=>{t(i),g(()=>t(i).length===0)&&r(v)})}d(s),vt(s,r=>o(D,r),()=>t(D)),h(e,s)},St=e=>{var s=Lt(),n=Pt(s);{var u=y=>{var S=Kt(),v=l(S),r=l(v);Tt(r,{language:"python",lines:10,dark_mode:!1,basic:!0,readonly:!1,placeholder:"Enter your code here...",wrap_lines:!0,get value(){return t(B)},set value(b){o(B,b)},$$legacy:!0}),d(v);var a=p(v,2);let _;var m=l(a);{var V=b=>{var P=ut("Updated!");h(b,P)},x=b=>{var P=ut("Update Code");h(b,P)};C(m,b=>{t($)?b(V):b(x,!1)})}d(a);var R=p(a,2);d(S),z(()=>_=Q(a,1,"update-code-button svelte-rvhith",null,_,{updating:t($)})),k("click",a,wt),k("click",R,()=>yt()),h(y,S)};C(n,y=>{t(M)==="code"&&y(u)},!0)}h(e,s)};C(Et,e=>{t(M)==="chat"?e(Mt):e(St,!1)})}d(J);var it=p(J,2),q=p(l(it),2);Ut(q);var nt=p(q,2);return d(it),d(L),vt(L,e=>o(at,e),()=>t(at)),z(e=>{Vt(L,`width: ${t(G)??""}px;`),rt=Q(O,1,"tab-button svelte-rvhith",null,rt,{active:t(M)==="chat"}),ot=Q(Z,1,"tab-button svelte-rvhith",null,ot,{active:t(M)==="code"}),nt.disabled=e},[()=>(t(H),g(()=>t(H).trim()===""))]),k("mousedown",st,bt),k("click",O,()=>o(M,"chat")),k("click",Z,()=>o(M,"code")),k("keydown",q,e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),X())}),Wt(q,()=>t(H),e=>o(H,e)),k("click",nt,()=>X()),h(_t,L),Dt(xt)}export{be as default}; +import{p as lt,e as Ht,i as C,d as vt,f as Vt,b as Q,q as ct,w as ht}from"./i18n-DtG3MAQ1.js";import{M as Rt,a7 as $t,Y as I,x as zt,G as U,Z as t,_ as Bt,t as z,v as g,U as k,a as h,O as Dt,a0 as w,$ as o,P as pt,Q as l,S as p,R as f,T as d,a3 as Lt,N as Pt,ai as Ut,X as et,a4 as ut}from"./index-BeNBoC9J.js";import{b as Wt}from"./input-BLFxNjIx.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{C as Tt}from"./Code-D0Kw4ylG.js";/* empty css */import{M as Zt}from"./Index.svelte_svelte_type_style_lang-CZFWgj20.js";import"./MarkdownCode-QLelNkfo.js";import"./index-B_pwUImq.js";/* empty css */import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";import"./actions-BbCJS635.js";import"./Check-DjGw_9dO.js";import"./Copy-eBznHIlR.js";import"./IconButtonWrapper-Ce5bzAyh.js";import"./prism-python-DV2ZTlpc.js";var qt=f(' '),Qt=f(' '),It=f(' '),jt=f(''),Gt=f('
            '),Nt=f('
            No messages yet
            '),Xt=f(''),Yt=f('
            '),At=f('
            '),Kt=f('
            '),Ot=f('
            Powered by: gpt-oss
            ');function be(_t,j){Rt(j,!1);let E=lt(j,"app",12),F=lt(j,"root",12),H=w(""),G=w(350),N=!1,at=w(),M=w("chat"),B=w(""),c=w(null),i=w([]),D=w();const W=(e="smooth")=>{t(D)&&t(D).scrollTo({top:t(D).scrollHeight,behavior:e})};let T=w([]);(async()=>E().post_data(`${F()}/gradio_api/vibe-starter-queries/`,{}).then(async([s,n])=>{if(n!==200)throw new Error(`Error: ${n}`);o(T,s.starter_queries)}).catch(async s=>{console.error("Failed to fetch starter queries:",s)}))();const X=async e=>{const s=e||t(H);if(s.trim()==="")return;o(c,null);const n=t(i).length;o(i,[...t(i),{text:s,isBot:!1}]);const u=t(i).length;o(i,[...t(i),{text:"Working...",isBot:!0,isPending:!0}]),await U(),W();const y=s;e||o(H,""),E().post_data(`${F()}/gradio_api/vibe-edit/`,{prompt:y}).then(async([v,r])=>{if(r!==200)throw new Error(`Error: ${r}`);const a=v;o(c,a.diff_stats),o(i,t(i).map((_,m)=>m===n?{..._,hash:a.hash}:_)),o(i,t(i).map((_,m)=>m===u?{text:a.reasoning?a.reasoning:"Done.",isBot:!0,isPending:!1}:_)),await U(),W()}).catch(async v=>{o(i,t(i).map((r,a)=>a===u?{text:"Error occurred.",isBot:!0,isPending:!1}:r)),await U(),W()})},mt=async e=>{await X(e)},ft=async(e,s)=>{try{await E().post_data(`${F()}/gradio_api/undo-vibe-edit/`,{hash:e}),o(c,null);const n=t(i)[s];o(H,n.text),o(i,t(i).slice(0,s))}catch(n){console.error("Failed to undo:",n)}},bt=e=>{e.preventDefault(),N=!0,document.addEventListener("mousemove",Y),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},Y=e=>{if(!N)return;const s=250,n=Math.min(800,window.innerWidth*.5),u=window.innerWidth-e.clientX;o(G,Math.max(s,Math.min(n,u))),window.dispatchEvent(new CustomEvent("vibeEditorResize",{detail:{width:t(G)}}))},A=()=>{N=!1,document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",A),document.body.style.cursor="",document.body.style.userSelect=""},gt=async()=>{try{const e=await fetch(`${F()}/gradio_api/vibe-code/`,{method:"GET",headers:{"Content-Type":"application/json"}});if(e.ok){const s=await e.json();o(B,s.code)}}catch(e){console.error("Failed to fetch code:",e)}};let $=w(!1);const wt=async()=>{try{await E().post_data(`${F()}/gradio_api/vibe-code/`,{code:t(B)}),o($,!0),setTimeout(()=>{o($,!1)},1e3)}catch(e){console.error("Failed to update code:",e)}};function yt(){const e="https://huggingface.co/new-space",s=new URLSearchParams({name:"new-space",sdk:"gradio"}),n=t(B).trimStart();s.append("files[0][path]","app.py"),s.append("files[0][content]",n),window.open(`${e}?${s.toString()}`,"_blank")?.focus()}$t(()=>()=>{document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",A)}),I(()=>zt(E()),()=>{E(),gt()}),I(()=>(t(M),U),()=>{t(M)==="chat"&&U().then(()=>W("auto"))}),I(()=>t($),()=>{t($)}),I(()=>t(T),()=>{t(T)}),Bt();var xt={get app(){return E()},set app(e){E(e),pt()},get root(){return F()},set root(e){F(e),pt()}};Ht();var L=Ot(),st=l(L),K=p(st,2),O=l(K);let rt;var Z=p(O,2);let ot;var Ct=p(l(Z));{var kt=e=>{var s=It(),n=l(s);{var u=v=>{var r=qt(),a=l(r);d(r),z(()=>et(a,`+${t(c),g(()=>t(c).lines_added)??""}`)),h(v,r)};C(n,v=>{t(c),g(()=>t(c).lines_added>0)&&v(u)})}var y=p(n,2);{var S=v=>{var r=Qt(),a=l(r);d(r),z(()=>et(a,`-${t(c),g(()=>t(c).lines_removed)??""}`)),h(v,r)};C(y,v=>{t(c),g(()=>t(c).lines_removed>0)&&v(S)})}d(s),h(e,s)};C(Ct,e=>{t(c),g(()=>t(c)&&(t(c).lines_added>0||t(c).lines_removed>0))&&e(kt)})}d(Z),d(K);var J=p(K,2),Et=l(J);{var Mt=e=>{var s=At(),n=l(s);ct(n,1,()=>t(i),ht,(r,a,_)=>{var m=Gt();let V;var x=l(m),R=l(x),b=l(R);Zt(b,{get value(){return t(a),g(()=>t(a).text)},latex_delimiters:[],theme_mode:"system"}),d(R);var P=p(R,2);{var Ft=tt=>{var dt=jt();k("click",dt,()=>ft(t(a).hash||"",_)),h(tt,dt)};C(P,tt=>{t(a),g(()=>!t(a).isBot&&t(a).hash&&!t(a).isPending)&&tt(Ft)})}d(x),d(m),z(()=>V=Q(m,1,"message-item svelte-rvhith",null,V,{"bot-message":t(a).isBot,"user-message":!t(a).isBot})),h(r,m)});var u=p(n,2);{var y=r=>{var a=Nt();h(r,a)};C(u,r=>{t(i),g(()=>t(i).length===0)&&r(y)})}var S=p(u,2);{var v=r=>{var a=Yt(),_=l(a);ct(_,5,()=>t(T),ht,(m,V)=>{var x=Xt(),R=l(x,!0);d(x),z(()=>et(R,t(V))),k("click",x,()=>mt(t(V))),h(m,x)}),d(_),d(a),h(r,a)};C(S,r=>{t(i),g(()=>t(i).length===0)&&r(v)})}d(s),vt(s,r=>o(D,r),()=>t(D)),h(e,s)},St=e=>{var s=Lt(),n=Pt(s);{var u=y=>{var S=Kt(),v=l(S),r=l(v);Tt(r,{language:"python",lines:10,dark_mode:!1,basic:!0,readonly:!1,placeholder:"Enter your code here...",wrap_lines:!0,get value(){return t(B)},set value(b){o(B,b)},$$legacy:!0}),d(v);var a=p(v,2);let _;var m=l(a);{var V=b=>{var P=ut("Updated!");h(b,P)},x=b=>{var P=ut("Update Code");h(b,P)};C(m,b=>{t($)?b(V):b(x,!1)})}d(a);var R=p(a,2);d(S),z(()=>_=Q(a,1,"update-code-button svelte-rvhith",null,_,{updating:t($)})),k("click",a,wt),k("click",R,()=>yt()),h(y,S)};C(n,y=>{t(M)==="code"&&y(u)},!0)}h(e,s)};C(Et,e=>{t(M)==="chat"?e(Mt):e(St,!1)})}d(J);var it=p(J,2),q=p(l(it),2);Ut(q);var nt=p(q,2);return d(it),d(L),vt(L,e=>o(at,e),()=>t(at)),z(e=>{Vt(L,`width: ${t(G)??""}px;`),rt=Q(O,1,"tab-button svelte-rvhith",null,rt,{active:t(M)==="chat"}),ot=Q(Z,1,"tab-button svelte-rvhith",null,ot,{active:t(M)==="code"}),nt.disabled=e},[()=>(t(H),g(()=>t(H).trim()===""))]),k("mousedown",st,bt),k("click",O,()=>o(M,"chat")),k("click",Z,()=>o(M,"code")),k("keydown",q,e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),X())}),Wt(q,()=>t(H),e=>o(H,e)),k("click",nt,()=>X()),h(_t,L),Dt(xt)}export{be as default}; diff --git a/assets/Index-DMgk5BHD.js b/assets/Index-X_iPfRzM.js similarity index 61% rename from assets/Index-DMgk5BHD.js rename to assets/Index-X_iPfRzM.js index 45f28711599c43ce6bcf5bfff09eba2a37d24997..33b04775fc8af0c1b7515d6d83760fd6f7eae595 100644 --- a/assets/Index-DMgk5BHD.js +++ b/assets/Index-X_iPfRzM.js @@ -1 +1 @@ -import{G as n,s as d,r as l}from"./i18n-CPHyzK9b.js";import{M as m,a3 as p,N as u,a as f,O as c}from"./index-DydPgVMC.js";import{B as h}from"./BaseForm-DAripPNq.js";function w(t,e){m(e,!0);let a=l(e,["$$slots","$$events","$$legacy"]);const s=new n(a);h(t,{get visible(){return s.shared.visible},get scale(){return s.shared.scale},get min_width(){return s.shared.min_width},children:(o,g)=>{var r=p(),i=u(r);d(i,e,"default",{}),f(o,r)},$$slots:{default:!0}}),c()}export{h as BaseForm,w as default}; +import{G as n,s as d,r as l}from"./i18n-DtG3MAQ1.js";import{M as m,a3 as p,N as u,a as f,O as c}from"./index-BeNBoC9J.js";import{B as h}from"./BaseForm-CgXgHXvl.js";function w(t,e){m(e,!0);let a=l(e,["$$slots","$$events","$$legacy"]);const s=new n(a);h(t,{get visible(){return s.shared.visible},get scale(){return s.shared.scale},get min_width(){return s.shared.min_width},children:(o,g)=>{var r=p(),i=u(r);d(i,e,"default",{}),f(o,r)},$$slots:{default:!0}}),c()}export{h as BaseForm,w as default}; diff --git a/assets/Index-rdevcKty.js b/assets/Index-ZDM-nQdr.js similarity index 65% rename from assets/Index-rdevcKty.js rename to assets/Index-ZDM-nQdr.js index f040ea5df8fc1c151edf6476796f35ab77735343..599775216aa9b04fa16451b172e0ba9c6e13479e 100644 --- a/assets/Index-rdevcKty.js +++ b/assets/Index-ZDM-nQdr.js @@ -1 +1 @@ -import{p as a,s as c}from"./i18n-CPHyzK9b.js";import{M as d,a3 as _,N as f,a as p,O as v,P as i}from"./index-DydPgVMC.js";import{B as g}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";function y(n,s){d(s,!1);let t=a(s,"elem_id",12),l=a(s,"elem_classes",12),r=a(s,"visible",12,!0);var o={get elem_id(){return t()},set elem_id(e){t(e),i()},get elem_classes(){return l()},set elem_classes(e){l(e),i()},get visible(){return r()},set visible(e){r(e),i()}};return g(n,{get elem_id(){return t()},get elem_classes(){return l()},get visible(){return r()},explicit_call:!0,children:(e,b)=>{var m=_(),u=f(m);c(u,s,"default",{}),p(e,m)},$$slots:{default:!0}}),v(o)}export{y as default}; +import{p as a,s as c}from"./i18n-DtG3MAQ1.js";import{M as d,a3 as _,N as f,a as p,O as v,P as i}from"./index-BeNBoC9J.js";import{B as g}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";function y(n,s){d(s,!1);let t=a(s,"elem_id",12),l=a(s,"elem_classes",12),r=a(s,"visible",12,!0);var o={get elem_id(){return t()},set elem_id(e){t(e),i()},get elem_classes(){return l()},set elem_classes(e){l(e),i()},get visible(){return r()},set visible(e){r(e),i()}};return g(n,{get elem_id(){return t()},get elem_classes(){return l()},get visible(){return r()},explicit_call:!0,children:(e,b)=>{var m=_(),u=f(m);c(u,s,"default",{}),p(e,m)},$$slots:{default:!0}}),v(o)}export{y as default}; diff --git a/assets/Index-HqnXgC8B.js b/assets/Index-aHJrzwH3.js similarity index 79% rename from assets/Index-HqnXgC8B.js rename to assets/Index-aHJrzwH3.js index 71393dd8fc3ea847f64a7487d2225d7dd75aaeb8..16144ac2cc7f4b8513ee51353489b06040b032d5 100644 --- a/assets/Index-HqnXgC8B.js +++ b/assets/Index-aHJrzwH3.js @@ -1 +1 @@ -import{p as F,i as k,m as A,g as L,r as M,G as N}from"./i18n-CPHyzK9b.js";import{M as B,N as G,Z as s,a as I,O as P,S as x,a2 as u,R as U,aa as v,ab as O,ac as R,$ as w,G as T}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as W}from"./BlockLabel-BzVeVrtL.js";import{E as Z}from"./Empty-B15ItVsj.js";import{F as y}from"./File-_VpQFuKr.js";import{I as j}from"./IconButtonWrapper-PnNNNvqI.js";import{F as q,a as C}from"./FileUpload-CCPLw8R5.js";import{B as D}from"./Block-WPcVj6Bq.js";import{U as H}from"./UploadText-CYQRFBCv.js";import{S as J}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{default as ke}from"./Example-BPjTUpdK.js";import"./snippet-BtHMuX3s.js";import"./Upload-Bq9KuxCu.js";import"./actions-4RaHFoGI.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./DownloadLink-DM2QmhDx.js";import"./index-B_pwUImq.js";/* empty css */var K=U(" ",1);function Q(m,t){B(t,!0);let d=F(t,"buttons",3,null),i=F(t,"on_custom_button_click",3,null);var c=K(),p=G(c);{var e=a=>{j(a,{get buttons(){return d()},get on_custom_button_click(){return i()}})};k(p,a=>{t.show_label&&d()&&d().length>0&&a(e)})}var _=x(p,2);{let a=u(()=>t.value===null),l=u(()=>t.label||"File");W(_,{get show_label(){return t.show_label},get float(){return s(a)},get Icon(){return y},get label(){return s(l)}})}var g=x(_,2);{var h=a=>{{let l=u(()=>t.height??void 0);q(a,{get i18n(){return t.i18n},get selectable(){return t.selectable},get onselect(){return t.on_select},get ondownload(){return t.on_download},get value(){return t.value},get height(){return s(l)}})}},f=a=>{Z(a,{unpadded_box:!0,size:"large",children:(l,b)=>{y(l)},$$slots:{default:!0}})};k(g,a=>{t.value&&(!Array.isArray(t.value)||t.value.length>0)?a(h):a(f,!1)})}I(m,c),P()}var V=U(" ",1);function be(m,t){B(t,!0);const d=M(t,["$$slots","$$events","$$legacy"]);let i=v(null),c=v(!1);class p extends N{async get_data(){return s(i)&&(await s(i),await T()),await super.get_data()}}const e=new p(d);let _=v(O(e.props.value));R(()=>{s(_)!==e.props.value&&(w(_,e.props.value,!0),e.dispatch("change",A(e.props.value)))});{let g=u(()=>e.props.value?"solid":"dashed"),h=u(()=>s(c)?"focus":"base");D(m,{get visible(){return e.shared.visible},get variant(){return s(g)},get border_mode(){return s(h)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,children:(f,a)=>{var l=V(),b=G(l);{let o=u(()=>e.shared.loading_status?.status||"complete");J(b,L({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{get status(){return s(o)},on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))}var z=x(b,2);{var E=o=>{Q(o,{on_select:n=>e.dispatch("select",n),on_download:n=>e.dispatch("download",n),get selectable(){return e.props._selectable},get value(){return e.props.value},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get height(){return e.props.height},get i18n(){return e.i18n},get buttons(){return e.props.buttons},on_custom_button_click:n=>{e.dispatch("custom_button_click",{id:n})}})},S=o=>{{let n=u(()=>e.props.height??void 0);C(o,{upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),get label(){return e.shared.label},get show_label(){return e.shared.show_label},get value(){return e.props.value},get file_count(){return e.props.file_count},get file_types(){return e.props.file_types},get selectable(){return e.props._selectable},get height(){return s(n)},get root(){return e.shared.root},get allow_reordering(){return e.props.allow_reordering},get max_file_size(){return e.shared.max_file_size},get buttons(){return e.props.buttons},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},onchange:r=>{e.props.value=r},ondrag:r=>w(c,r,!0),onclear:()=>e.dispatch("clear"),onselect:r=>e.dispatch("select",r),onupload:()=>e.dispatch("upload"),onerror:r=>{e.shared.loading_status=e.shared.loading_status||{},e.shared.loading_status.status="error",e.dispatch("error",r)},ondelete:r=>{e.dispatch("delete",r)},get i18n(){return e.i18n},get upload_promise(){return s(i)},set upload_promise(r){w(i,r,!0)},children:(r,X)=>{H(r,{get i18n(){return e.i18n},type:"file"})},$$slots:{default:!0}})}};k(z,o=>{e.shared.interactive?o(S,!1):o(E)})}I(f,l)},$$slots:{default:!0}})}P()}export{ke as BaseExample,Q as BaseFile,C as BaseFileUpload,q as FilePreview,be as default}; +import{p as F,i as k,m as A,g as L,r as M,G as N}from"./i18n-DtG3MAQ1.js";import{M as B,N as G,Z as s,a as I,O as P,S as x,a2 as u,R as U,aa as v,ab as O,ac as R,$ as w,G as T}from"./index-BeNBoC9J.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as W}from"./BlockLabel-CEOjqpu7.js";import{E as Z}from"./Empty-Clj0ErcW.js";import{F as y}from"./File-CD333vfS.js";import{I as j}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as q,a as C}from"./FileUpload-h25zNPg5.js";import{B as D}from"./Block-DkzyQHli.js";import{U as H}from"./UploadText-yqnlGa4o.js";import{S as J}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import{default as ke}from"./Example-BK_3ogSC.js";import"./snippet-BRIBYCwB.js";import"./Upload-CGTpHDBO.js";import"./actions-BbCJS635.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./DownloadLink-Dk6GrGSA.js";import"./index-B_pwUImq.js";/* empty css */var K=U(" ",1);function Q(m,t){B(t,!0);let d=F(t,"buttons",3,null),i=F(t,"on_custom_button_click",3,null);var c=K(),p=G(c);{var e=a=>{j(a,{get buttons(){return d()},get on_custom_button_click(){return i()}})};k(p,a=>{t.show_label&&d()&&d().length>0&&a(e)})}var _=x(p,2);{let a=u(()=>t.value===null),l=u(()=>t.label||"File");W(_,{get show_label(){return t.show_label},get float(){return s(a)},get Icon(){return y},get label(){return s(l)}})}var g=x(_,2);{var h=a=>{{let l=u(()=>t.height??void 0);q(a,{get i18n(){return t.i18n},get selectable(){return t.selectable},get onselect(){return t.on_select},get ondownload(){return t.on_download},get value(){return t.value},get height(){return s(l)}})}},f=a=>{Z(a,{unpadded_box:!0,size:"large",children:(l,b)=>{y(l)},$$slots:{default:!0}})};k(g,a=>{t.value&&(!Array.isArray(t.value)||t.value.length>0)?a(h):a(f,!1)})}I(m,c),P()}var V=U(" ",1);function be(m,t){B(t,!0);const d=M(t,["$$slots","$$events","$$legacy"]);let i=v(null),c=v(!1);class p extends N{async get_data(){return s(i)&&(await s(i),await T()),await super.get_data()}}const e=new p(d);let _=v(O(e.props.value));R(()=>{s(_)!==e.props.value&&(w(_,e.props.value,!0),e.dispatch("change",A(e.props.value)))});{let g=u(()=>e.props.value?"solid":"dashed"),h=u(()=>s(c)?"focus":"base");D(m,{get visible(){return e.shared.visible},get variant(){return s(g)},get border_mode(){return s(h)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,children:(f,a)=>{var l=V(),b=G(l);{let o=u(()=>e.shared.loading_status?.status||"complete");J(b,L({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{get status(){return s(o)},on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}))}var z=x(b,2);{var E=o=>{Q(o,{on_select:n=>e.dispatch("select",n),on_download:n=>e.dispatch("download",n),get selectable(){return e.props._selectable},get value(){return e.props.value},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get height(){return e.props.height},get i18n(){return e.i18n},get buttons(){return e.props.buttons},on_custom_button_click:n=>{e.dispatch("custom_button_click",{id:n})}})},S=o=>{{let n=u(()=>e.props.height??void 0);C(o,{upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),get label(){return e.shared.label},get show_label(){return e.shared.show_label},get value(){return e.props.value},get file_count(){return e.props.file_count},get file_types(){return e.props.file_types},get selectable(){return e.props._selectable},get height(){return s(n)},get root(){return e.shared.root},get allow_reordering(){return e.props.allow_reordering},get max_file_size(){return e.shared.max_file_size},get buttons(){return e.props.buttons},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},onchange:r=>{e.props.value=r},ondrag:r=>w(c,r,!0),onclear:()=>e.dispatch("clear"),onselect:r=>e.dispatch("select",r),onupload:()=>e.dispatch("upload"),onerror:r=>{e.shared.loading_status=e.shared.loading_status||{},e.shared.loading_status.status="error",e.dispatch("error",r)},ondelete:r=>{e.dispatch("delete",r)},get i18n(){return e.i18n},get upload_promise(){return s(i)},set upload_promise(r){w(i,r,!0)},children:(r,X)=>{H(r,{get i18n(){return e.i18n},type:"file"})},$$slots:{default:!0}})}};k(z,o=>{e.shared.interactive?o(S,!1):o(E)})}I(f,l)},$$slots:{default:!0}})}P()}export{ke as BaseExample,Q as BaseFile,C as BaseFileUpload,q as FilePreview,be as default}; diff --git a/assets/Index-CT81CJxE.js b/assets/Index-cXYfMzBG.js similarity index 90% rename from assets/Index-CT81CJxE.js rename to assets/Index-cXYfMzBG.js index ef9546702b8e4748c156e7cf7240262f7be07ee6..511357d4afa0beba506f17b2265120a6460863e7 100644 --- a/assets/Index-CT81CJxE.js +++ b/assets/Index-cXYfMzBG.js @@ -1 +1 @@ -import{p as Y,e as xe,i as p,b as M,q as qe,w as Se,G as we,r as Ae,g as Be}from"./i18n-CPHyzK9b.js";import{M as _e,Y as oe,x as w,Z as e,_ as $e,a3 as te,N as d,a as l,O as ve,a0 as Z,P as z,v as o,$ as Q,Q as A,T as j,S as b,t as R,X as I,R as i,U as J,a5 as Oe,ad as le}from"./index-DydPgVMC.js";import{B as Ee}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{S as Ge}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var Ie=i(','),Je=i(" ",1),Ke=i(','),Ne=i(' ',1),Pe=i(' :',1),Te=i(','),Ve=i(" ",1),Le=i("
          • "),Me=i(','),Qe=i('
              ',1);function ie(C,g){_e(g,!1);let r=Y(g,"json",12),t=Y(g,"depth",12,1/0),B=Y(g,"_cur",12,0),k=Y(g,"_last",12,!0),u=Z([]),v=Z(!1),n=Z(["",""]),x=Z(!1);function $(a){return a===null?"null":typeof a}function O(a){return JSON.stringify(a)}function ce(a){switch($(a)){case"function":return"f () {...}";case"symbol":return a.toString();default:return O(a)}}function U(){Q(x,!e(x))}function D(a){a instanceof KeyboardEvent&&["Enter"," "].includes(a.key)&&U()}oe(()=>(w(r()),e(v)),()=>{Q(u,$(r())==="object"?Object.keys(r()):[]),Q(v,Array.isArray(r())),Q(n,e(v)?["[","]"]:["{","}"])}),oe(()=>(w(t()),w(B())),()=>{Q(x,t(){var K=Je(),E=d(K);let X;var F=A(E);j(E);var m=b(E);{var q=s=>{var S=Ie();l(s,S)};p(m,s=>{k()||s(q)})}R(()=>{X=M(E,1,"_jsonBkt empty svelte-fviqo5",null,X,{isArray:e(v)}),I(F,`${e(n),o(()=>e(n)[0])??""}${e(n),o(()=>e(n)[1])??""}`)}),l(a,K)},de=a=>{var K=te(),E=d(K);{var X=m=>{var q=Ne(),s=d(q);let S;var H=A(s);j(s);var N=b(s);{var h=G=>{var W=Ke();l(G,W)};p(N,G=>{!k()&&e(x)&&G(h)})}R(()=>{S=M(s,1,"_jsonBkt svelte-fviqo5",null,S,{isArray:e(v)}),I(H,`${e(n),o(()=>e(n)[0])??""}...${e(n),o(()=>e(n)[1])??""}`)}),J("click",s,U),J("keydown",s,D),l(m,q)},F=m=>{var q=Qe(),s=d(q);let S;var H=A(s,!0);j(s);var N=b(s,2);qe(N,5,()=>e(u),Se,(P,_,re)=>{var ee=Le(),ne=A(ee);{var he=c=>{var y=Pe(),f=d(y),T=A(f,!0);j(f),Oe(),R(V=>I(T,V),[()=>(e(_),o(()=>O(e(_))))]),l(c,y)};p(ne,c=>{e(v)||c(he)})}var ye=b(ne,2);{var je=c=>{var y=te(),f=d(y);{let T=le(()=>B()+1),V=le(()=>(e(u),o(()=>re===e(u).length-1)));ie(f,{get json(){return w(r()),e(_),o(()=>r()[e(_)])},get depth(){return t()},get _cur(){return e(T)},get _last(){return e(V)}})}l(c,y)},be=c=>{var y=Ve(),f=d(y),T=A(f,!0);j(f);var V=b(f);{var ke=L=>{var ae=Te();l(L,ae)};p(V,L=>{e(u),o(()=>re{M(f,1,`_jsonVal ${L??""}`,"svelte-fviqo5"),I(T,ae)},[()=>(w(r()),e(_),o(()=>$(r()[e(_)]))),()=>(w(r()),e(_),o(()=>ce(r()[e(_)])))]),l(c,y)};p(ye,c=>{w(r()),e(_),o(()=>$(r()[e(_)])==="object")?c(je):c(be,!1)})}j(ee),l(P,ee)}),j(N);var h=b(N,2);let G;var W=A(h,!0);j(h);var ge=b(h);{var me=P=>{var _=Me();l(P,_)};p(ge,P=>{k()||P(me)})}R(()=>{S=M(s,1,"_jsonBkt svelte-fviqo5",null,S,{isArray:e(v)}),I(H,(e(n),o(()=>e(n)[0]))),G=M(h,1,"_jsonBkt svelte-fviqo5",null,G,{isArray:e(v)}),I(W,(e(n),o(()=>e(n)[1])))}),J("click",s,U),J("keydown",s,D),J("click",h,U),J("keydown",h,D),l(m,q)};p(E,m=>{e(x)?m(X):m(F,!1)},!0)}l(a,K)};p(fe,a=>{e(u),o(()=>!e(u).length)?a(pe):a(de,!1)})}return l(C,se),ve(ue)}var Re=i(" ",1);function ea(C,g){_e(g,!0);const r=Ae(g,["$$slots","$$events","$$legacy"]),t=new we(r);t.watch_for_change(),Ee(C,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},container:!0,get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},children:(k,u)=>{var v=Re(),n=d(v);{var x=O=>{Ge(O,Be({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}))};p(n,O=>{t.shared.loading_status&&O(x)})}var $=b(n,2);ie($,{get json(){return t.props.value}}),l(k,v)},$$slots:{default:!0}}),ve()}export{ea as default}; +import{p as Y,e as xe,i as p,b as M,q as qe,w as Se,G as we,r as Ae,g as Be}from"./i18n-DtG3MAQ1.js";import{M as _e,Y as oe,x as w,Z as e,_ as $e,a3 as te,N as d,a as l,O as ve,a0 as Z,P as z,v as o,$ as Q,Q as A,T as j,S as b,t as R,X as I,R as i,U as J,a5 as Oe,ad as le}from"./index-BeNBoC9J.js";import{B as Ee}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{S as Ge}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var Ie=i(','),Je=i(" ",1),Ke=i(','),Ne=i(' ',1),Pe=i(' :',1),Te=i(','),Ve=i(" ",1),Le=i("
            • "),Me=i(','),Qe=i('
                ',1);function ie(C,g){_e(g,!1);let r=Y(g,"json",12),t=Y(g,"depth",12,1/0),B=Y(g,"_cur",12,0),k=Y(g,"_last",12,!0),u=Z([]),v=Z(!1),n=Z(["",""]),x=Z(!1);function $(a){return a===null?"null":typeof a}function O(a){return JSON.stringify(a)}function ce(a){switch($(a)){case"function":return"f () {...}";case"symbol":return a.toString();default:return O(a)}}function U(){Q(x,!e(x))}function D(a){a instanceof KeyboardEvent&&["Enter"," "].includes(a.key)&&U()}oe(()=>(w(r()),e(v)),()=>{Q(u,$(r())==="object"?Object.keys(r()):[]),Q(v,Array.isArray(r())),Q(n,e(v)?["[","]"]:["{","}"])}),oe(()=>(w(t()),w(B())),()=>{Q(x,t(){var K=Je(),E=d(K);let X;var F=A(E);j(E);var m=b(E);{var q=s=>{var S=Ie();l(s,S)};p(m,s=>{k()||s(q)})}R(()=>{X=M(E,1,"_jsonBkt empty svelte-fviqo5",null,X,{isArray:e(v)}),I(F,`${e(n),o(()=>e(n)[0])??""}${e(n),o(()=>e(n)[1])??""}`)}),l(a,K)},de=a=>{var K=te(),E=d(K);{var X=m=>{var q=Ne(),s=d(q);let S;var H=A(s);j(s);var N=b(s);{var h=G=>{var W=Ke();l(G,W)};p(N,G=>{!k()&&e(x)&&G(h)})}R(()=>{S=M(s,1,"_jsonBkt svelte-fviqo5",null,S,{isArray:e(v)}),I(H,`${e(n),o(()=>e(n)[0])??""}...${e(n),o(()=>e(n)[1])??""}`)}),J("click",s,U),J("keydown",s,D),l(m,q)},F=m=>{var q=Qe(),s=d(q);let S;var H=A(s,!0);j(s);var N=b(s,2);qe(N,5,()=>e(u),Se,(P,_,re)=>{var ee=Le(),ne=A(ee);{var he=c=>{var y=Pe(),f=d(y),T=A(f,!0);j(f),Oe(),R(V=>I(T,V),[()=>(e(_),o(()=>O(e(_))))]),l(c,y)};p(ne,c=>{e(v)||c(he)})}var ye=b(ne,2);{var je=c=>{var y=te(),f=d(y);{let T=le(()=>B()+1),V=le(()=>(e(u),o(()=>re===e(u).length-1)));ie(f,{get json(){return w(r()),e(_),o(()=>r()[e(_)])},get depth(){return t()},get _cur(){return e(T)},get _last(){return e(V)}})}l(c,y)},be=c=>{var y=Ve(),f=d(y),T=A(f,!0);j(f);var V=b(f);{var ke=L=>{var ae=Te();l(L,ae)};p(V,L=>{e(u),o(()=>re{M(f,1,`_jsonVal ${L??""}`,"svelte-fviqo5"),I(T,ae)},[()=>(w(r()),e(_),o(()=>$(r()[e(_)]))),()=>(w(r()),e(_),o(()=>ce(r()[e(_)])))]),l(c,y)};p(ye,c=>{w(r()),e(_),o(()=>$(r()[e(_)])==="object")?c(je):c(be,!1)})}j(ee),l(P,ee)}),j(N);var h=b(N,2);let G;var W=A(h,!0);j(h);var ge=b(h);{var me=P=>{var _=Me();l(P,_)};p(ge,P=>{k()||P(me)})}R(()=>{S=M(s,1,"_jsonBkt svelte-fviqo5",null,S,{isArray:e(v)}),I(H,(e(n),o(()=>e(n)[0]))),G=M(h,1,"_jsonBkt svelte-fviqo5",null,G,{isArray:e(v)}),I(W,(e(n),o(()=>e(n)[1])))}),J("click",s,U),J("keydown",s,D),J("click",h,U),J("keydown",h,D),l(m,q)};p(E,m=>{e(x)?m(X):m(F,!1)},!0)}l(a,K)};p(fe,a=>{e(u),o(()=>!e(u).length)?a(pe):a(de,!1)})}return l(C,se),ve(ue)}var Re=i(" ",1);function ea(C,g){_e(g,!0);const r=Ae(g,["$$slots","$$events","$$legacy"]),t=new we(r);t.watch_for_change(),Ee(C,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},container:!0,get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},children:(k,u)=>{var v=Re(),n=d(v);{var x=O=>{Ge(O,Be({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}))};p(n,O=>{t.shared.loading_status&&O(x)})}var $=b(n,2);ie($,{get json(){return t.props.value}}),l(k,v)},$$slots:{default:!0}}),ve()}export{ea as default}; diff --git a/assets/Index-CdACL_KS.js b/assets/Index-fvOhqK6W.js similarity index 73% rename from assets/Index-CdACL_KS.js rename to assets/Index-fvOhqK6W.js index 3f002e816182359bbbf162d009bb02af5062b5f8..33e67921d341bef4029c2a2bfe98246a5832ec77 100644 --- a/assets/Index-CdACL_KS.js +++ b/assets/Index-fvOhqK6W.js @@ -1 +1 @@ -import{G as S,i as d,g as F,r as G}from"./i18n-CPHyzK9b.js";import{M as y,N as h,Z as s,a as g,$ as f,a2 as b,S as n,O as L,aa as M,R as N,a3 as O}from"./index-DydPgVMC.js";import{P as R,a as W}from"./Plot-CYQ3vpBc.js";import{B as Z}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as j}from"./BlockLabel-BzVeVrtL.js";import{I as q}from"./IconButtonWrapper-PnNNNvqI.js";import{F as z}from"./FullscreenButton-BuyUU5Yj.js";import{S as A}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./key-CFGu0zzg.js";import"./Empty-B15ItVsj.js";import"./snippet-BtHMuX3s.js";import"./Maximize-DWbY8BRa.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var C=N(" ",1);function pe(v,p){y(p,!0);let $=G(p,["$$slots","$$events","$$legacy"]);const e=new S($);let r=M(!1);Z(v,{padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,get fullscreen(){return s(r)},set fullscreen(o){f(r,o,!0)},children:(o,D)=>{var u=C(),i=h(u);{let t=b(()=>e.shared.label||e.i18n("plot.plot"));j(i,{get show_label(){return e.shared.show_label},get label(){return s(t)},get Icon(){return R}})}var _=n(i,2);{var w=t=>{{let B=b(()=>e.props.buttons??[]);q(t,{get buttons(){return s(B)},on_custom_button_click:a=>{e.dispatch("custom_button_click",{id:a})},children:(a,E)=>{var m=O(),P=h(m);{var x=l=>{z(l,{get fullscreen(){return s(r)},onclick:I=>{f(r,I,!0)}})};d(P,l=>{e.props.show_fullscreen_button&&l(x)})}g(a,m)},$$slots:{default:!0}})}};d(_,t=>{(e.props.buttons&&e.props.buttons.length>0||e.props.show_fullscreen_button)&&t(w)})}var c=n(_,2);A(c,F({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=n(c,2);W(k,{get value(){return e.props.value},get theme_mode(){return e.props.theme_mode},get show_label(){return e.shared.show_label},get caption(){return e.props.caption},get bokeh_version(){return e.props.bokeh_version},get show_actions_button(){return e.props.show_actions_button},get _selectable(){return e.props._selectable},get x_lim(){return e.props.x_lim},get show_fullscreen_button(){return e.props.show_fullscreen_button},on_change:()=>e.dispatch("change"),onselect:t=>e.dispatch("select",t)}),g(o,u)},$$slots:{default:!0}}),L()}export{W as BasePlot,pe as default}; +import{G as S,i as d,g as F,r as G}from"./i18n-DtG3MAQ1.js";import{M as y,N as h,Z as s,a as g,$ as f,a2 as b,S as n,O as L,aa as M,R as N,a3 as O}from"./index-BeNBoC9J.js";import{P as R,a as W}from"./Plot-DOg6WLrs.js";import{B as Z}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as j}from"./BlockLabel-CEOjqpu7.js";import{I as q}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as z}from"./FullscreenButton-CFl3IB4T.js";import{S as A}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./key-CbBDWaWR.js";import"./Empty-Clj0ErcW.js";import"./snippet-BRIBYCwB.js";import"./Maximize-DQMU3SdR.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var C=N(" ",1);function pe(v,p){y(p,!0);let $=G(p,["$$slots","$$events","$$legacy"]);const e=new S($);let r=M(!1);Z(v,{padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get visible(){return e.shared.visible},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,get fullscreen(){return s(r)},set fullscreen(o){f(r,o,!0)},children:(o,D)=>{var u=C(),i=h(u);{let t=b(()=>e.shared.label||e.i18n("plot.plot"));j(i,{get show_label(){return e.shared.show_label},get label(){return s(t)},get Icon(){return R}})}var _=n(i,2);{var w=t=>{{let B=b(()=>e.props.buttons??[]);q(t,{get buttons(){return s(B)},on_custom_button_click:a=>{e.dispatch("custom_button_click",{id:a})},children:(a,E)=>{var m=O(),P=h(m);{var x=l=>{z(l,{get fullscreen(){return s(r)},onclick:I=>{f(r,I,!0)}})};d(P,l=>{e.props.show_fullscreen_button&&l(x)})}g(a,m)},$$slots:{default:!0}})}};d(_,t=>{(e.props.buttons&&e.props.buttons.length>0||e.props.show_fullscreen_button)&&t(w)})}var c=n(_,2);A(c,F({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var k=n(c,2);W(k,{get value(){return e.props.value},get theme_mode(){return e.props.theme_mode},get show_label(){return e.shared.show_label},get caption(){return e.props.caption},get bokeh_version(){return e.props.bokeh_version},get show_actions_button(){return e.props.show_actions_button},get _selectable(){return e.props._selectable},get x_lim(){return e.props.x_lim},get show_fullscreen_button(){return e.props.show_fullscreen_button},on_change:()=>e.dispatch("change"),onselect:t=>e.dispatch("select",t)}),g(o,u)},$$slots:{default:!0}}),L()}export{W as BasePlot,pe as default}; diff --git a/assets/Index-BhX9aXr4.js b/assets/Index-oAwLBA9w.js similarity index 95% rename from assets/Index-BhX9aXr4.js rename to assets/Index-oAwLBA9w.js index 76b248dd9b063b57edf666f5c1ddc7b5eb4b4720..7995b2a6db581e80b9e6289583c723bd5d7a7cd9 100644 --- a/assets/Index-BhX9aXr4.js +++ b/assets/Index-oAwLBA9w.js @@ -1,2 +1,2 @@ -import{p as A,q as he,b as ve,w as be,i as se,f as we,T as te,v as ne,G as ye,d as de,r as ke,a as xe}from"./i18n-CPHyzK9b.js";import{a as B,f as De,ah as pe,M as ge,S as g,Q as f,t as W,X as re,Z as r,O as fe,a2 as oe,$ as d,R as q,T as _,aa as x,ab as Y,ac as Me,ae as Se,N as Ye,a4 as He,U as Ee,a5 as Te}from"./index-DydPgVMC.js";import{b as ae}from"./input-BtIxlP_B.js";import{B as Fe}from"./Block-WPcVj6Bq.js";import{B as Be}from"./BlockTitle-DNiCHWOR.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as Le}from"./IconButtonWrapper-PnNNNvqI.js";import{default as ct}from"./Example-BfoDEvJC.js";import"./Info-DfrMwI06.js";import"./html-BZIV6tyB.js";import"./snippet-BtHMuX3s.js";var Ce=De('');function Pe(t){var s=Ce();B(t,s)}const Ne=(t,s)=>{if(t.toJSON()===null)return"";const a=S=>S.toString().padStart(2,"0"),e=t.getFullYear(),n=a(t.getMonth()+1),l=a(t.getDate()),v=a(t.getHours()),w=a(t.getMinutes()),b=a(t.getSeconds()),o=`${e}-${n}-${l}`,J=`${v}:${w}:${b}`;return s?`${o} ${J}`:o},ue=(t,s)=>{if(t==null||t==="")return!0;const a=s?/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/:/^\d{4}-\d{2}-\d{2}$/,e=t.match(a)!==null,n=t.match(/^(?:\s*now\s*(?:-\s*\d+\s*[dmhs])?)?\s*$/)!==null;return e||n},_e=(t,s)=>new Date(t,s+1,0).getDate(),je=(t,s)=>new Date(t,s,1).getDay(),Ae=(t,s)=>{if(!t||t===""){const e=new Date;return{selected_date:e,current_year:e.getFullYear(),current_month:e.getMonth(),selected_hour:e.getHours(),selected_minute:e.getMinutes(),selected_second:e.getSeconds(),is_pm:e.getHours()>=12}}try{let e=t;!s&&t.match(/^\d{4}-\d{2}-\d{2}$/)&&(e+=" 00:00:00");const n=new Date(e.replace(" ","T"));if(!isNaN(n.getTime()))return{selected_date:n,current_year:n.getFullYear(),current_month:n.getMonth(),selected_hour:n.getHours(),selected_minute:n.getMinutes(),selected_second:n.getSeconds(),is_pm:n.getHours()>=12}}catch{}const a=new Date;return{selected_date:a,current_year:a.getFullYear(),current_month:a.getMonth(),selected_hour:a.getHours(),selected_minute:a.getMinutes(),selected_second:a.getSeconds(),is_pm:a.getHours()>=12}},Je=(t,s)=>{const a=_e(t,s),e=je(t,s),n=[],l=s===0?11:s-1,v=s===0?t-1:t,w=_e(v,l);for(let o=e-1;o>=0;o--)n.push({day:w-o,is_current_month:!1,is_next_month:!1});for(let o=1;o<=a;o++)n.push({day:o,is_current_month:!0,is_next_month:!1});const b=42-n.length;for(let o=1;o<=b;o++)n.push({day:o,is_current_month:!1,is_next_month:!0});return n},Ie=(t,s)=>s?t===0?12:t>12?t-12:t:t===0?12:t,Oe=(t,s)=>s?t===12?12:t+12:t===12?0:t,Ge=["January","February","March","April","May","June","July","August","September","October","November","December"];var Re=q(''),We=q('
                Period
                '),qe=q('
                Su
                Mo
                Tu
                We
                Th
                Fr
                Sa
                ');function Qe(t,s){ge(s,!0);let a=A(s,"selected_date",15),e=A(s,"current_year",15),n=A(s,"current_month",15),l=A(s,"selected_hour",15),v=A(s,"selected_minute",15),w=A(s,"selected_second",15),b=A(s,"is_pm",15),o=oe(()=>Ie(l(),b())),J=oe(()=>Je(e(),n()));const S=c=>{a(new Date(e(),n(),c,l(),v(),w())),L()},L=()=>{const c=Ne(a(),s.include_time);s.onupdate?.(c)},H=()=>{a(new Date(e(),n(),a().getDate(),l(),v(),w())),L()},C=()=>{n()===0?(n(11),te(e,-1)):te(n,-1)},I=()=>{n()===11?(n(0),te(e)):te(n)},Q=()=>{b(!b()),b()&&l()<12?l(l()+12):!b()&&l()>=12&&l(l()-12),H()},U=c=>{l(Oe(c,b())),H()},ie=()=>{const c=new Date;a(c),e(c.getFullYear()),n(c.getMonth()),l(c.getHours()),v(c.getMinutes()),w(c.getSeconds()),b(l()>=12),L()};var E=qe(),O=f(E),P=f(O),X=f(P);X.__click=C;var Z=g(X,2),z=f(Z);_(Z);var G=g(Z,2);G.__click=I,_(P);var T=g(P,2),$=g(f(T),2);he($,21,()=>r(J),be,(c,y)=>{let m=()=>r(y).day,D=()=>r(y).is_current_month,N=()=>r(y).is_next_month;var k=Re();let F;k.__click=()=>{D()?S(m()):N()?(I(),S(m())):(C(),S(m()))};var j=f(k,!0);_(k),W(i=>{F=ve(k,1,"day svelte-sa4ftg",null,F,i),re(j,m())},[()=>({"other-month":!D(),selected:D()&&m()===a().getDate()&&n()===a().getMonth()&&e()===a().getFullYear()})]),B(c,k)}),_($),_(T);var ee=g(T,2);{var u=c=>{var y=We(),m=f(y),D=f(m),N=g(f(D),2);ne(N),N.__input=()=>U(r(o)),_(D);var k=g(D,2),F=g(f(k),2);ne(F),F.__input=H,_(k);var j=g(k,2),i=g(f(j),2);ne(i),i.__input=H,_(j);var h=g(j,2),M=g(f(h),2);M.__click=Q;var p=f(M,!0);_(M),_(h),_(m),_(y),W(()=>re(p,b()?"PM":"AM")),ae(N,()=>r(o),me=>d(o,me)),ae(F,v),ae(i,w),B(c,y)};se(ee,c=>{s.include_time&&c(u)})}var le=g(ee,2),K=f(le);K.__click=function(...c){s.onclear?.apply(this,c)};var R=g(K,2),V=f(R);V.__click=ie;var ce=g(V,2);ce.__click=function(...c){s.onclose?.apply(this,c)},_(R),_(le),_(O),_(E),W(()=>{we(E,`top: ${s.position.top??""}px; left: ${s.position.left??""}px;`),re(z,`${Ge[n()]??""} +import{p as A,q as he,b as ve,w as be,i as se,f as we,T as te,v as ne,G as ye,d as de,r as ke,a as xe}from"./i18n-DtG3MAQ1.js";import{a as B,f as De,ah as pe,M as ge,S as g,Q as f,t as W,X as re,Z as r,O as fe,a2 as oe,$ as d,R as q,T as _,aa as x,ab as Y,ac as Me,ae as Se,N as Ye,a4 as He,U as Ee,a5 as Te}from"./index-BeNBoC9J.js";import{b as ae}from"./input-BLFxNjIx.js";import{B as Fe}from"./Block-DkzyQHli.js";import{B as Be}from"./BlockTitle-B6Pgijwb.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as Le}from"./IconButtonWrapper-Ce5bzAyh.js";import{default as ct}from"./Example-CyVYJU_i.js";import"./Info-BjDIKIgf.js";import"./html-DE4EmiOG.js";import"./snippet-BRIBYCwB.js";var Ce=De('');function Pe(t){var s=Ce();B(t,s)}const Ne=(t,s)=>{if(t.toJSON()===null)return"";const a=S=>S.toString().padStart(2,"0"),e=t.getFullYear(),n=a(t.getMonth()+1),l=a(t.getDate()),v=a(t.getHours()),w=a(t.getMinutes()),b=a(t.getSeconds()),o=`${e}-${n}-${l}`,J=`${v}:${w}:${b}`;return s?`${o} ${J}`:o},ue=(t,s)=>{if(t==null||t==="")return!0;const a=s?/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/:/^\d{4}-\d{2}-\d{2}$/,e=t.match(a)!==null,n=t.match(/^(?:\s*now\s*(?:-\s*\d+\s*[dmhs])?)?\s*$/)!==null;return e||n},_e=(t,s)=>new Date(t,s+1,0).getDate(),je=(t,s)=>new Date(t,s,1).getDay(),Ae=(t,s)=>{if(!t||t===""){const e=new Date;return{selected_date:e,current_year:e.getFullYear(),current_month:e.getMonth(),selected_hour:e.getHours(),selected_minute:e.getMinutes(),selected_second:e.getSeconds(),is_pm:e.getHours()>=12}}try{let e=t;!s&&t.match(/^\d{4}-\d{2}-\d{2}$/)&&(e+=" 00:00:00");const n=new Date(e.replace(" ","T"));if(!isNaN(n.getTime()))return{selected_date:n,current_year:n.getFullYear(),current_month:n.getMonth(),selected_hour:n.getHours(),selected_minute:n.getMinutes(),selected_second:n.getSeconds(),is_pm:n.getHours()>=12}}catch{}const a=new Date;return{selected_date:a,current_year:a.getFullYear(),current_month:a.getMonth(),selected_hour:a.getHours(),selected_minute:a.getMinutes(),selected_second:a.getSeconds(),is_pm:a.getHours()>=12}},Je=(t,s)=>{const a=_e(t,s),e=je(t,s),n=[],l=s===0?11:s-1,v=s===0?t-1:t,w=_e(v,l);for(let o=e-1;o>=0;o--)n.push({day:w-o,is_current_month:!1,is_next_month:!1});for(let o=1;o<=a;o++)n.push({day:o,is_current_month:!0,is_next_month:!1});const b=42-n.length;for(let o=1;o<=b;o++)n.push({day:o,is_current_month:!1,is_next_month:!0});return n},Ie=(t,s)=>s?t===0?12:t>12?t-12:t:t===0?12:t,Oe=(t,s)=>s?t===12?12:t+12:t===12?0:t,Ge=["January","February","March","April","May","June","July","August","September","October","November","December"];var Re=q(''),We=q('
                Period
                '),qe=q('
                Su
                Mo
                Tu
                We
                Th
                Fr
                Sa
                ');function Qe(t,s){ge(s,!0);let a=A(s,"selected_date",15),e=A(s,"current_year",15),n=A(s,"current_month",15),l=A(s,"selected_hour",15),v=A(s,"selected_minute",15),w=A(s,"selected_second",15),b=A(s,"is_pm",15),o=oe(()=>Ie(l(),b())),J=oe(()=>Je(e(),n()));const S=c=>{a(new Date(e(),n(),c,l(),v(),w())),L()},L=()=>{const c=Ne(a(),s.include_time);s.onupdate?.(c)},H=()=>{a(new Date(e(),n(),a().getDate(),l(),v(),w())),L()},C=()=>{n()===0?(n(11),te(e,-1)):te(n,-1)},I=()=>{n()===11?(n(0),te(e)):te(n)},Q=()=>{b(!b()),b()&&l()<12?l(l()+12):!b()&&l()>=12&&l(l()-12),H()},U=c=>{l(Oe(c,b())),H()},ie=()=>{const c=new Date;a(c),e(c.getFullYear()),n(c.getMonth()),l(c.getHours()),v(c.getMinutes()),w(c.getSeconds()),b(l()>=12),L()};var E=qe(),O=f(E),P=f(O),X=f(P);X.__click=C;var Z=g(X,2),z=f(Z);_(Z);var G=g(Z,2);G.__click=I,_(P);var T=g(P,2),$=g(f(T),2);he($,21,()=>r(J),be,(c,y)=>{let m=()=>r(y).day,D=()=>r(y).is_current_month,N=()=>r(y).is_next_month;var k=Re();let F;k.__click=()=>{D()?S(m()):N()?(I(),S(m())):(C(),S(m()))};var j=f(k,!0);_(k),W(i=>{F=ve(k,1,"day svelte-sa4ftg",null,F,i),re(j,m())},[()=>({"other-month":!D(),selected:D()&&m()===a().getDate()&&n()===a().getMonth()&&e()===a().getFullYear()})]),B(c,k)}),_($),_(T);var ee=g(T,2);{var u=c=>{var y=We(),m=f(y),D=f(m),N=g(f(D),2);ne(N),N.__input=()=>U(r(o)),_(D);var k=g(D,2),F=g(f(k),2);ne(F),F.__input=H,_(k);var j=g(k,2),i=g(f(j),2);ne(i),i.__input=H,_(j);var h=g(j,2),M=g(f(h),2);M.__click=Q;var p=f(M,!0);_(M),_(h),_(m),_(y),W(()=>re(p,b()?"PM":"AM")),ae(N,()=>r(o),me=>d(o,me)),ae(F,v),ae(i,w),B(c,y)};se(ee,c=>{s.include_time&&c(u)})}var le=g(ee,2),K=f(le);K.__click=function(...c){s.onclear?.apply(this,c)};var R=g(K,2),V=f(R);V.__click=ie;var ce=g(V,2);ce.__click=function(...c){s.onclose?.apply(this,c)},_(R),_(le),_(O),_(E),W(()=>{we(E,`top: ${s.position.top??""}px; left: ${s.position.left??""}px;`),re(z,`${Ge[n()]??""} ${e()??""}`)}),B(t,E),fe()}pe(["click","input"]);var Ue=q(''),Xe=q('
                '),Ze=q('
                ',1);function ot(t,s){ge(s,!0);const a=ke(s,["$$slots","$$events","$$legacy"]),e=new ye(a);let n=x(Y(e.props.value)),l=x(!1),v=x(Y(e.props.value)),w,b,o,J=x(Y({top:0,left:0})),S=x(Y(new Date().getFullYear())),L=x(Y(new Date().getMonth())),H=x(Y(new Date)),C=x(Y(new Date().getHours())),I=x(Y(new Date().getMinutes())),Q=x(Y(new Date().getSeconds())),U=x(r(C)>=12),ie=oe(()=>ue(r(v),e.props.include_time)),E=oe(()=>!e.shared.interactive);Me(()=>{r(n)!=e.props.value&&(d(n,e.props.value,!0),d(v,e.props.value,!0),O(),e.dispatch("change"))});const O=()=>{const u=Ae(r(v),e.props.include_time);d(H,u.selected_date,!0),d(S,u.current_year,!0),d(L,u.current_month,!0),d(C,u.selected_hour,!0),d(I,u.selected_minute,!0),d(Q,u.selected_second,!0),d(U,u.is_pm,!0)},P=()=>{r(v)!==e.props.value&&ue(r(v),e.props.include_time)&&(d(n,e.props.value=r(v),!0),e.dispatch("change"))},X=()=>{if(o){const u=o.getBoundingClientRect();d(J,{top:u.bottom+4,left:u.right-280},!0)}},Z=u=>{r(E)||(u.stopPropagation(),d(l,!r(l)),r(l)?(O(),X(),setTimeout(()=>{typeof window<"u"&&(window.addEventListener("click",G),window.addEventListener("scroll",T,!0))},10)):typeof window<"u"&&(window.removeEventListener("click",G),window.removeEventListener("scroll",T,!0)))},z=()=>{d(l,!1),typeof window<"u"&&(window.removeEventListener("click",G),window.removeEventListener("scroll",T,!0))},G=u=>{r(l)&&w&&!w.contains(u.target)&&o&&!o.contains(u.target)&&z()},T=()=>{r(l)&&X()},$=u=>{d(v,u,!0),P()},ee=()=>{d(v,""),e.props.value="",z(),e.dispatch("change")};Se(()=>{typeof window<"u"&&(window.removeEventListener("click",G),window.removeEventListener("scroll",T,!0))}),O(),Fe(t,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,padding:!0,children:(u,le)=>{var K=Ze(),R=Ye(K),V=f(R);{var ce=i=>{Le(i,{get buttons(){return e.props.buttons},on_custom_button_click:h=>{e.dispatch("custom_button_click",{id:h})}})};se(V,i=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&i(ce)})}var c=g(V,2);Be(c,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(i,h)=>{Te();var M=He();W(()=>re(M,e.shared.label||"Date")),B(i,M)},$$slots:{default:!0}}),_(R);var y=g(R,2),m=f(y);ne(m);let D;m.__keydown=i=>{i.key==="Enter"&&(P(),e.dispatch("submit"))},de(m,i=>b=i,()=>b);var N=g(m,2);{var k=i=>{var h=Ue();h.__click=Z;var M=f(h);Pe(M),_(h),de(h,p=>o=p,()=>o),W(()=>h.disabled=r(E)),B(i,h)};se(N,i=>{e.shared.interactive&&i(k)})}_(y);var F=g(y,2);{var j=i=>{var h=Xe(),M=f(h);Qe(M,{get include_time(){return e.props.include_time},get position(){return r(J)},onupdate:$,onclear:ee,onclose:z,get selected_date(){return r(H)},set selected_date(p){d(H,p,!0)},get current_year(){return r(S)},set current_year(p){d(S,p,!0)},get current_month(){return r(L)},set current_month(p){d(L,p,!0)},get selected_hour(){return r(C)},set selected_hour(p){d(C,p,!0)},get selected_minute(){return r(I)},set selected_minute(p){d(I,p,!0)},get selected_second(){return r(Q)},set selected_second(p){d(Q,p,!0)},get is_pm(){return r(U)},set is_pm(p){d(U,p,!0)}}),_(h),de(h,p=>w=p,()=>w),B(i,h)};se(F,i=>{r(l)&&i(j)})}W(()=>{D=ve(m,1,"time svelte-1352xkt",null,D,{invalid:!r(ie)}),m.disabled=r(E),xe(m,"placeholder",e.props.include_time?"YYYY-MM-DD HH:MM:SS":"YYYY-MM-DD")}),Ee("blur",m,P),ae(m,()=>r(v),i=>d(v,i)),B(u,K)},$$slots:{default:!0}}),fe()}pe(["keydown","click"]);export{ct as BaseExample,ot as default}; diff --git a/assets/Index-BxmsNHzG.js b/assets/Index-pt0yzj-z.js similarity index 76% rename from assets/Index-BxmsNHzG.js rename to assets/Index-pt0yzj-z.js index b81a18ba464a11df14fbc39369e581b38a998ba2..203ff5374deee2b83b9ff6f9aafbd6386b41e722 100644 --- a/assets/Index-BxmsNHzG.js +++ b/assets/Index-pt0yzj-z.js @@ -1 +1 @@ -import{G as u,i as c,s as m,a as f,b as _,f as v,r as b,g as x}from"./i18n-CPHyzK9b.js";import{M as w,t as y,a as $,O as q,S,R as k,Q as G,Z as j,T as z,a2 as I}from"./index-DydPgVMC.js";import{S as M}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var O=k("
                ");function F(d,a){w(a,!0);const r=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}};let h=b(a,["$$slots","$$events","$$legacy"]),s=new u(h);var t=O();let o,l;var p=G(t);{var n=e=>{{let i=I(()=>s.shared.loading_status?s.shared.loading_status.status=="pending"?"generating":s.shared.loading_status.status:null);M(e,x({get autoscroll(){return s.shared.autoscroll},get i18n(){return s.i18n}},()=>s.shared.loading_status,{get status(){return j(i)}}))}};c(p,e=>{s.shared.loading_status&&s.shared.loading_status.show_progress&&s&&e(n)})}var g=S(p,2);m(g,a,"default",{}),z(t),y((e,i)=>{f(t,"id",s.shared.elem_id),o=_(t,1,`row ${e??""}`,"svelte-1vzdkcm",o,{compact:s.props.variant==="compact",panel:s.props.variant==="panel","unequal-height":s.props.equal_height===!1,stretch:s.props.equal_height,hide:!s.shared.visible,"grow-children":s.shared.scale&&s.shared.scale>=1}),l=v(t,"",l,i)},[()=>s.shared.elem_classes?.join(" "),()=>({height:r(s.props.height),"max-height":r(s.props.max_height),"min-height":r(s.props.min_height),"flex-grow":s.shared.scale})]),$(d,t),q()}export{F as default}; +import{G as u,i as c,s as m,a as f,b as _,f as v,r as b,g as x}from"./i18n-DtG3MAQ1.js";import{M as w,t as y,a as $,O as q,S,R as k,Q as G,Z as j,T as z,a2 as I}from"./index-BeNBoC9J.js";import{S as M}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import"./snippet-BRIBYCwB.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var O=k("
                ");function F(d,a){w(a,!0);const r=e=>{if(e!==void 0){if(typeof e=="number")return e+"px";if(typeof e=="string")return e}};let h=b(a,["$$slots","$$events","$$legacy"]),s=new u(h);var t=O();let o,l;var p=G(t);{var n=e=>{{let i=I(()=>s.shared.loading_status?s.shared.loading_status.status=="pending"?"generating":s.shared.loading_status.status:null);M(e,x({get autoscroll(){return s.shared.autoscroll},get i18n(){return s.i18n}},()=>s.shared.loading_status,{get status(){return j(i)}}))}};c(p,e=>{s.shared.loading_status&&s.shared.loading_status.show_progress&&s&&e(n)})}var g=S(p,2);m(g,a,"default",{}),z(t),y((e,i)=>{f(t,"id",s.shared.elem_id),o=_(t,1,`row ${e??""}`,"svelte-1vzdkcm",o,{compact:s.props.variant==="compact",panel:s.props.variant==="panel","unequal-height":s.props.equal_height===!1,stretch:s.props.equal_height,hide:!s.shared.visible,"grow-children":s.shared.scale&&s.shared.scale>=1}),l=v(t,"",l,i)},[()=>s.shared.elem_classes?.join(" "),()=>({height:r(s.props.height),"max-height":r(s.props.max_height),"min-height":r(s.props.min_height),"flex-grow":s.shared.scale})]),$(d,t),q()}export{F as default}; diff --git a/assets/Index-BdR5tpCt.js b/assets/Index-vGhqHOeT.js similarity index 82% rename from assets/Index-BdR5tpCt.js rename to assets/Index-vGhqHOeT.js index 55df47261e70e08269d86057dd25df02bcede959..e27e5ec72fbc044d5af1aa516ea085b5d10bc81b 100644 --- a/assets/Index-BdR5tpCt.js +++ b/assets/Index-vGhqHOeT.js @@ -1 +1 @@ -import{G as ae,g as re,i as q,r as se,q as R,a as x,b as T,f as U,w as W,d as le}from"./i18n-CPHyzK9b.js";import{M as oe,N as B,Z as t,a as d,$,S as v,O as ie,aa as X,a2 as Z,R as h,Q as I,a3 as ne,t as y,T as w,X as pe,U as _}from"./index-DydPgVMC.js";import{B as ue}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as de}from"./BlockLabel-BzVeVrtL.js";import{E as ce}from"./Empty-B15ItVsj.js";import{I as j}from"./Image-DBmW1mOo.js";import{I as me}from"./IconButtonWrapper-PnNNNvqI.js";import{F as ge}from"./FullscreenButton-BuyUU5Yj.js";import{S as ve}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./snippet-BtHMuX3s.js";import"./Maximize-DWbY8BRa.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";var _e=h(""),he=h(''),fe=h('
                '),be=h('
                the base file that is annotated
                ',1),$e=h('
                ',1);function Oe(A,M){oe(M,!0);const C=se(M,["$$slots","$$events","$$legacy"]),e=new ae(C);let c=X(null),P,n=X(!1),D=Z(()=>e.shared.label||e.i18n("annotated_image.annotated_image"));e.watch_for_change();function S(o){$(c,o,!0)}function E(){$(c,null)}function H(o,F){e.dispatch("select",{value:F,index:o})}ue(A,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},padding:!1,get height(){return e.props.height},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return t(n)},set fullscreen(o){$(n,o,!0)},children:(o,F)=>{var G=$e(),z=B(G);ve(z,re({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status));var L=v(z,2);de(L,{get show_label(){return e.shared.show_label},get Icon(){return j},get label(){return t(D)}});var N=v(L,2),J=I(N);{var K=p=>{ce(p,{size:"large",unpadded_box:!0,children:(f,m)=>{j(f)},$$slots:{default:!0}})},V=p=>{var f=be(),m=B(f),O=I(m);{let l=Z(()=>e.props.buttons||[]);me(O,{get buttons(){return t(l)},on_custom_button_click:s=>{e.dispatch("custom_button_click",{id:s})},children:(s,b)=>{var a=ne(),i=B(a);{var r=g=>{ge(g,{get fullscreen(){return t(n)},onclick:u=>$(n,u,!0)})};q(i,g=>{(e.props.buttons||[]).some(u=>typeof u=="string"&&u==="fullscreen")&&g(r)})}d(s,a)},$$slots:{default:!0}})}var k=v(O,2);let Q;var Y=v(k,2);R(Y,17,()=>e.props.value?e.props.value.annotations:[],W,(l,s,b)=>{var a=_e();let i;y(r=>{x(a,"alt",`segmentation mask identifying ${e.shared.label??""} within the uploaded file`),i=T(a,1,"mask fit-height svelte-1tg70qp",null,i,{"fit-height":!t(n),active:t(c)==t(s).label,inactive:t(c)!=t(s).label&&t(c)!=null}),x(a,"src",t(s).image.url),U(a,r)},[()=>e.props.color_map&&t(s).label in e.props.color_map?null:`filter: hue-rotate(${Math.round(b*360/(e.props.value?.annotations.length??1))}deg);`]),d(l,a)}),w(m),le(m,l=>P=l,()=>P);var ee=v(m,2);{var te=l=>{var s=fe();R(s,21,()=>e.props.value.annotations,W,(b,a,i)=>{var r=he(),g=I(r,!0);w(r),y(u=>{U(r,`background-color: ${u??""}`),pe(g,t(a).label)},[()=>e.props.color_map&&t(a).label in e.props.color_map?e.props.color_map[t(a).label]+"88":`hsla(${Math.round(i*360/e.props.value.annotations.length)}, 100%, 50%, 0.3)`]),_("mouseover",r,()=>S(t(a).label)),_("focus",r,()=>S(t(a).label)),_("mouseout",r,()=>E()),_("blur",r,()=>E()),_("click",r,()=>H(i,t(a).label)),d(b,r)}),w(s),d(l,s)};q(ee,l=>{e.props.show_legend&&e.props.value&&l(te)})}y(()=>{Q=T(k,1,"base-image svelte-1tg70qp",null,Q,{"fit-height":e.props.height&&!t(n)}),x(k,"src",e.props.value?e.props.value.image.url:null)}),d(p,f)};q(J,p=>{e.props.value==null?p(K):p(V,!1)})}w(N),d(o,G)},$$slots:{default:!0}}),ie()}export{Oe as default}; +import{G as ae,g as re,i as q,r as se,q as R,a as x,b as T,f as U,w as W,d as le}from"./i18n-DtG3MAQ1.js";import{M as oe,N as B,Z as t,a as d,$,S as v,O as ie,aa as X,a2 as Z,R as h,Q as I,a3 as ne,t as y,T as w,X as pe,U as _}from"./index-BeNBoC9J.js";import{B as ue}from"./Block-DkzyQHli.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{B as de}from"./BlockLabel-CEOjqpu7.js";import{E as ce}from"./Empty-Clj0ErcW.js";import{I as j}from"./Image-DWBzZYev.js";import{I as me}from"./IconButtonWrapper-Ce5bzAyh.js";import{F as ge}from"./FullscreenButton-CFl3IB4T.js";import{S as ve}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";import"./snippet-BRIBYCwB.js";import"./Maximize-DQMU3SdR.js";import"./Clear-BiKSVifk.js";import"./html-DE4EmiOG.js";import"./index-B_pwUImq.js";var _e=h(""),he=h(''),fe=h('
                '),be=h('
                the base file that is annotated
                ',1),$e=h('
                ',1);function Oe(A,M){oe(M,!0);const C=se(M,["$$slots","$$events","$$legacy"]),e=new ae(C);let c=X(null),P,n=X(!1),D=Z(()=>e.shared.label||e.i18n("annotated_image.annotated_image"));e.watch_for_change();function S(o){$(c,o,!0)}function E(){$(c,null)}function H(o,F){e.dispatch("select",{value:F,index:o})}ue(A,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},padding:!1,get height(){return e.props.height},get width(){return e.props.width},allow_overflow:!1,get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get fullscreen(){return t(n)},set fullscreen(o){$(n,o,!0)},children:(o,F)=>{var G=$e(),z=B(G);ve(z,re({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status));var L=v(z,2);de(L,{get show_label(){return e.shared.show_label},get Icon(){return j},get label(){return t(D)}});var N=v(L,2),J=I(N);{var K=p=>{ce(p,{size:"large",unpadded_box:!0,children:(f,m)=>{j(f)},$$slots:{default:!0}})},V=p=>{var f=be(),m=B(f),O=I(m);{let l=Z(()=>e.props.buttons||[]);me(O,{get buttons(){return t(l)},on_custom_button_click:s=>{e.dispatch("custom_button_click",{id:s})},children:(s,b)=>{var a=ne(),i=B(a);{var r=g=>{ge(g,{get fullscreen(){return t(n)},onclick:u=>$(n,u,!0)})};q(i,g=>{(e.props.buttons||[]).some(u=>typeof u=="string"&&u==="fullscreen")&&g(r)})}d(s,a)},$$slots:{default:!0}})}var k=v(O,2);let Q;var Y=v(k,2);R(Y,17,()=>e.props.value?e.props.value.annotations:[],W,(l,s,b)=>{var a=_e();let i;y(r=>{x(a,"alt",`segmentation mask identifying ${e.shared.label??""} within the uploaded file`),i=T(a,1,"mask fit-height svelte-1tg70qp",null,i,{"fit-height":!t(n),active:t(c)==t(s).label,inactive:t(c)!=t(s).label&&t(c)!=null}),x(a,"src",t(s).image.url),U(a,r)},[()=>e.props.color_map&&t(s).label in e.props.color_map?null:`filter: hue-rotate(${Math.round(b*360/(e.props.value?.annotations.length??1))}deg);`]),d(l,a)}),w(m),le(m,l=>P=l,()=>P);var ee=v(m,2);{var te=l=>{var s=fe();R(s,21,()=>e.props.value.annotations,W,(b,a,i)=>{var r=he(),g=I(r,!0);w(r),y(u=>{U(r,`background-color: ${u??""}`),pe(g,t(a).label)},[()=>e.props.color_map&&t(a).label in e.props.color_map?e.props.color_map[t(a).label]+"88":`hsla(${Math.round(i*360/e.props.value.annotations.length)}, 100%, 50%, 0.3)`]),_("mouseover",r,()=>S(t(a).label)),_("focus",r,()=>S(t(a).label)),_("mouseout",r,()=>E()),_("blur",r,()=>E()),_("click",r,()=>H(i,t(a).label)),d(b,r)}),w(s),d(l,s)};q(ee,l=>{e.props.show_legend&&e.props.value&&l(te)})}y(()=>{Q=T(k,1,"base-image svelte-1tg70qp",null,Q,{"fit-height":e.props.height&&!t(n)}),x(k,"src",e.props.value?e.props.value.image.url:null)}),d(p,f)};q(J,p=>{e.props.value==null?p(K):p(V,!1)})}w(N),d(o,G)},$$slots:{default:!0}}),ie()}export{Oe as default}; diff --git a/assets/Index-sTTH5Ggb.js b/assets/Index-xgfqaomk.js similarity index 79% rename from assets/Index-sTTH5Ggb.js rename to assets/Index-xgfqaomk.js index e020b90930d579aa2a07ab8efd6ba26e97e6887a..5f724f97bd355e91f21352d7255ac11176c768ee 100644 --- a/assets/Index-sTTH5Ggb.js +++ b/assets/Index-xgfqaomk.js @@ -1 +1 @@ -import{G as d,n as a,j as l,a as _,b as c,r as m,k as v}from"./i18n-CPHyzK9b.js";import{M as u,a7 as f,ac as b,Z as n,t as g,a as h,O as $,a2 as x,R as y}from"./index-DydPgVMC.js";var j=y('
                ');function k(i,r){u(r,!0);const p=m(r,["$$slots","$$events","$$legacy"]),e=new d(p);let t=x(()=>({visible:e.shared.visible==="hidden"?!1:e.shared.visible,main_page_name:e.props.main_page_name??"Home",value:e.props.value}));f(()=>{v(a)||a.set(n(t))}),b(()=>{a.set(n(t))});var s=j();g(o=>{_(s,"id",e.shared.elem_id),c(s,1,o)},[()=>l(e.shared.elem_classes.join(" "))]),h(i,s),$()}export{k as default}; +import{G as d,n as a,j as l,a as _,b as c,r as m,k as v}from"./i18n-DtG3MAQ1.js";import{M as u,a7 as f,ac as b,Z as n,t as g,a as h,O as $,a2 as x,R as y}from"./index-BeNBoC9J.js";var j=y('
                ');function k(i,r){u(r,!0);const p=m(r,["$$slots","$$events","$$legacy"]),e=new d(p);let t=x(()=>({visible:e.shared.visible==="hidden"?!1:e.shared.visible,main_page_name:e.props.main_page_name??"Home",value:e.props.value}));f(()=>{v(a)||a.set(n(t))}),b(()=>{a.set(n(t))});var s=j();g(o=>{_(s,"id",e.shared.elem_id),c(s,1,o)},[()=>l(e.shared.elem_classes.join(" "))]),h(i,s),$()}export{k as default}; diff --git a/assets/Index.svelte_svelte_type_style_lang-C-orki39.js b/assets/Index.svelte_svelte_type_style_lang-CZFWgj20.js similarity index 80% rename from assets/Index.svelte_svelte_type_style_lang-C-orki39.js rename to assets/Index.svelte_svelte_type_style_lang-CZFWgj20.js index d48e78467e836b8e637ca929858d5144e25854a7..44377402a7c71246489251325ee3805ba8f3ce5c 100644 --- a/assets/Index.svelte_svelte_type_style_lang-C-orki39.js +++ b/assets/Index.svelte_svelte_type_style_lang-CZFWgj20.js @@ -1 +1 @@ -import{p as t,i as Z,z as v,b as q,a as A,f as D,K as E}from"./i18n-CPHyzK9b.js";import{M as F,aa as g,ab as G,ac as H,Z as s,$ as o,t as J,a as L,O as N,S as U,R as V,Q as X,a2 as b,T as Y}from"./index-DydPgVMC.js";import{a as p}from"./actions-4RaHFoGI.js";import{C as $}from"./Check-2f8HlfSn.js";import{C as ee}from"./Copy-B3jzejpA.js";import{I as te}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{I as ae}from"./IconButtonWrapper-PnNNNvqI.js";import{M as ie}from"./MarkdownCode-BTj729_f.js";var se=V('
                ');function _e(y,e){F(e,!0);let k=t(e,"elem_classes",19,()=>[]),w=t(e,"visible",3,!0),d=t(e,"min_height",3,void 0),x=t(e,"rtl",3,!1),C=t(e,"sanitize_html",3,!0),I=t(e,"line_breaks",3,!1),M=t(e,"latex_delimiters",19,()=>[]),z=t(e,"header_links",3,!1),u=t(e,"height",3,void 0),T=t(e,"show_copy_button",3,!1),B=t(e,"loading_status",3,void 0),j=t(e,"onchange",3,()=>{}),K=t(e,"oncopy",3,i=>{}),l=g(!1),n,m=g(G(e.value));H(()=>{e.value!==s(m)&&(o(m,e.value,!0),j()())});async function O(){"clipboard"in navigator&&(await navigator.clipboard.writeText(e.value),K()({value:e.value}),P())}function P(){o(l,!0),n&&clearTimeout(n),n=setTimeout(()=>{o(l,!1)},1e3)}var a=se();let c,_;var f=X(a);{var Q=i=>{ae(i,{children:(r,h)=>{{let S=b(()=>s(l)?$:ee),W=b(()=>s(l)?"Copied conversation":"Copy conversation");te(r,{get Icon(){return s(S)},onclick:O,get label(){return s(W)}})}},$$slots:{default:!0}})};Z(f,i=>{T()&&i(Q)})}var R=U(f,2);ie(R,{get message(){return e.value},get latex_delimiters(){return M()},get sanitize_html(){return C()},get line_breaks(){return I()},chatbot:!1,get header_links(){return z()},get theme_mode(){return e.theme_mode}}),Y(a),p(a,i=>E?.(i)),J((i,r,h)=>{c=q(a,1,`prose ${i??""}`,"svelte-98p4e6",c,{hide:!w()}),A(a,"dir",x()?"rtl":"ltr"),_=D(a,r,_,h),a.dir=a.dir},[()=>k()?.join(" ")||"",()=>u()?`max-height: ${v(u())}; overflow-y: auto;`:"",()=>({"min-height":d()&&B()?.status!=="pending"?v(d()):void 0})]),L(y,a),N()}export{_e as M}; +import{p as t,i as Z,z as v,b as q,a as A,f as D,K as E}from"./i18n-DtG3MAQ1.js";import{M as F,aa as g,ab as G,ac as H,Z as s,$ as o,t as J,a as L,O as N,S as U,R as V,Q as X,a2 as b,T as Y}from"./index-BeNBoC9J.js";import{a as p}from"./actions-BbCJS635.js";import{C as $}from"./Check-DjGw_9dO.js";import{C as ee}from"./Copy-eBznHIlR.js";import{I as te}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{I as ae}from"./IconButtonWrapper-Ce5bzAyh.js";import{M as ie}from"./MarkdownCode-QLelNkfo.js";var se=V('
                ');function _e(y,e){F(e,!0);let k=t(e,"elem_classes",19,()=>[]),w=t(e,"visible",3,!0),d=t(e,"min_height",3,void 0),x=t(e,"rtl",3,!1),C=t(e,"sanitize_html",3,!0),I=t(e,"line_breaks",3,!1),M=t(e,"latex_delimiters",19,()=>[]),z=t(e,"header_links",3,!1),u=t(e,"height",3,void 0),T=t(e,"show_copy_button",3,!1),B=t(e,"loading_status",3,void 0),j=t(e,"onchange",3,()=>{}),K=t(e,"oncopy",3,i=>{}),l=g(!1),n,m=g(G(e.value));H(()=>{e.value!==s(m)&&(o(m,e.value,!0),j()())});async function O(){"clipboard"in navigator&&(await navigator.clipboard.writeText(e.value),K()({value:e.value}),P())}function P(){o(l,!0),n&&clearTimeout(n),n=setTimeout(()=>{o(l,!1)},1e3)}var a=se();let c,_;var f=X(a);{var Q=i=>{ae(i,{children:(r,h)=>{{let S=b(()=>s(l)?$:ee),W=b(()=>s(l)?"Copied conversation":"Copy conversation");te(r,{get Icon(){return s(S)},onclick:O,get label(){return s(W)}})}},$$slots:{default:!0}})};Z(f,i=>{T()&&i(Q)})}var R=U(f,2);ie(R,{get message(){return e.value},get latex_delimiters(){return M()},get sanitize_html(){return C()},get line_breaks(){return I()},chatbot:!1,get header_links(){return z()},get theme_mode(){return e.theme_mode}}),Y(a),p(a,i=>E?.(i)),J((i,r,h)=>{c=q(a,1,`prose ${i??""}`,"svelte-98p4e6",c,{hide:!w()}),A(a,"dir",x()?"rtl":"ltr"),_=D(a,r,_,h),a.dir=a.dir},[()=>k()?.join(" ")||"",()=>u()?`max-height: ${v(u())}; overflow-y: auto;`:"",()=>({"min-height":d()&&B()?.status!=="pending"?v(d()):void 0})]),L(y,a),N()}export{_e as M}; diff --git a/assets/Index.svelte_svelte_type_style_lang-glBt5fcY.js b/assets/Index.svelte_svelte_type_style_lang-CqKXbK2o.js similarity index 78% rename from assets/Index.svelte_svelte_type_style_lang-glBt5fcY.js rename to assets/Index.svelte_svelte_type_style_lang-CqKXbK2o.js index 965c6b1220d1a42b41119157c7a9d8780db3bd46..cbd12ea3698b3032e376eb8dcd0f63a8298d5a2f 100644 --- a/assets/Index.svelte_svelte_type_style_lang-glBt5fcY.js +++ b/assets/Index.svelte_svelte_type_style_lang-CqKXbK2o.js @@ -1 +1 @@ -import{i as z,s as B,d as j,a as k,b as p,f as C,g as M}from"./i18n-CPHyzK9b.js";import{M as O,t as Q,Z as e,a as R,O as T,a2 as a,S as Z,R as A,Q as D,T as E}from"./index-DydPgVMC.js";import{S as F}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";var G=A("
                ");function L(o,t){O(t,!0);let n,_=a(()=>t.scale??null),c=a(()=>t.min_width??0),f=a(()=>t.elem_id??""),g=a(()=>t.elem_classes??[]),v=a(()=>t.visible??!0),r=a(()=>t.variant??"default"),s=a(()=>t.loading_status);var l=G();let u,d;var m=D(l);{var h=i=>{{let w=a(()=>t.autoscroll??!1),x=a(()=>t.i18n??(y=>y)),S=a(()=>e(s).queue_size??null),q=a(()=>e(s)?e(s).status=="pending"?"generating":e(s).status:null);F(i,M({get autoscroll(){return e(w)},get i18n(){return e(x)}},()=>e(s),{get queue_size(){return e(S)},get status(){return e(q)}}))}};z(m,i=>{e(s)&&e(s).show_progress&&i(h)})}var b=Z(m,2);B(b,t,"default",{}),E(l),j(l,i=>n=i,()=>n),Q(i=>{k(l,"id",e(f)),u=p(l,1,`column ${i??""}`,"svelte-nnx25n",u,{compact:e(r)==="compact",panel:e(r)==="panel",hide:!e(v)}),d=C(l,"",d,{"flex-grow":e(_),"min-width":`calc(min(${e(c)??""}px, 100%))`})},[()=>e(g).join(" ")]),R(o,l),T()}export{L as B}; +import{i as z,s as B,d as j,a as k,b as p,f as C,g as M}from"./i18n-DtG3MAQ1.js";import{M as O,t as Q,Z as e,a as R,O as T,a2 as a,S as Z,R as A,Q as D,T as E}from"./index-BeNBoC9J.js";import{S as F}from"./index-1YthqPsU.js";import"./StreamingBar.svelte_svelte_type_style_lang-BUk4GIbA.js";var G=A("
                ");function L(o,t){O(t,!0);let n,_=a(()=>t.scale??null),c=a(()=>t.min_width??0),f=a(()=>t.elem_id??""),g=a(()=>t.elem_classes??[]),v=a(()=>t.visible??!0),r=a(()=>t.variant??"default"),s=a(()=>t.loading_status);var l=G();let u,d;var m=D(l);{var h=i=>{{let w=a(()=>t.autoscroll??!1),x=a(()=>t.i18n??(y=>y)),S=a(()=>e(s).queue_size??null),q=a(()=>e(s)?e(s).status=="pending"?"generating":e(s).status:null);F(i,M({get autoscroll(){return e(w)},get i18n(){return e(x)}},()=>e(s),{get queue_size(){return e(S)},get status(){return e(q)}}))}};z(m,i=>{e(s)&&e(s).show_progress&&i(h)})}var b=Z(m,2);B(b,t,"default",{}),E(l),j(l,i=>n=i,()=>n),Q(i=>{k(l,"id",e(f)),u=p(l,1,`column ${i??""}`,"svelte-nnx25n",u,{compact:e(r)==="compact",panel:e(r)==="panel",hide:!e(v)}),d=C(l,"",d,{"flex-grow":e(_),"min-width":`calc(min(${e(c)??""}px, 100%))`})},[()=>e(g).join(" ")]),R(o,l),T()}export{L as B}; diff --git a/assets/Info-DfrMwI06.js b/assets/Info-BjDIKIgf.js similarity index 78% rename from assets/Info-DfrMwI06.js rename to assets/Info-BjDIKIgf.js index 2410597b0c0e66f8085932a3b392515d3bc2261f..bd0da8197f7d825794f32a9b6f76aad1a67130d4 100644 --- a/assets/Info-DfrMwI06.js +++ b/assets/Info-BjDIKIgf.js @@ -1 +1 @@ -import{p,e as _}from"./i18n-CPHyzK9b.js";import{M as i,x as o,v as f,a as m,O as g,P as u,Q as E,R,T as d}from"./index-DydPgVMC.js";import{h}from"./html-BZIV6tyB.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";const I=/`([^`]+)`/g,v=/\[([^\]]+)\]\(([^)]+)\)/g,O=/\*\*(.+?)\*\*/g,$=/__(.+?)__/g,L=/\*(.+?)\*/g,S=/(?/g,">").replace(/"/g,""")}function k(r,e,t){const n=t.trim();return C.test(n)?/^https?:/i.test(n)?`${e}`:e:`${e}`}function s(r){let e=T(r);return e=e.replace(I,"$1"),e=e.replace(v,k),e=e.replace(O,"$1"),e=e.replace($,"$1"),e=e.replace(L,"$1"),e=e.replace(S,"$1"),e=e.replace(/\n/g,"
                "),e}var D=R('
                ');function K(r,e){i(e,!1);let t=p(e,"info",12);var n={get info(){return t()},set info(l){t(l),u()}};_();var a=D(),c=E(a);return h(c,()=>(o(s),o(t()),f(()=>s(t())))),d(a),m(r,a),g(n)}export{K as I}; +import{p,e as _}from"./i18n-DtG3MAQ1.js";import{M as i,x as o,v as f,a as m,O as g,P as u,Q as E,R,T as d}from"./index-BeNBoC9J.js";import{h}from"./html-DE4EmiOG.js";import"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";const I=/`([^`]+)`/g,v=/\[([^\]]+)\]\(([^)]+)\)/g,O=/\*\*(.+?)\*\*/g,$=/__(.+?)__/g,L=/\*(.+?)\*/g,S=/(?/g,">").replace(/"/g,""")}function k(r,e,t){const n=t.trim();return C.test(n)?/^https?:/i.test(n)?`${e}`:e:`${e}`}function s(r){let e=T(r);return e=e.replace(I,"$1"),e=e.replace(v,k),e=e.replace(O,"$1"),e=e.replace($,"$1"),e=e.replace(L,"$1"),e=e.replace(S,"$1"),e=e.replace(/\n/g,"
                "),e}var D=R('
                ');function K(r,e){i(e,!1);let t=p(e,"info",12);var n={get info(){return t()},set info(l){t(l),u()}};_();var a=D(),c=E(a);return h(c,()=>(o(s),o(t()),f(()=>s(t())))),d(a),m(r,a),g(n)}export{K as I}; diff --git a/assets/JSON-DVsUg528.js b/assets/JSON-BMd6yQaN.js similarity index 94% rename from assets/JSON-DVsUg528.js rename to assets/JSON-BMd6yQaN.js index 108af051a1d1288898b9b5d88347e3a414c6553f..6f4873e59880e2a12d6ea6b939af5e11bf4d7726 100644 --- a/assets/JSON-DVsUg528.js +++ b/assets/JSON-BMd6yQaN.js @@ -1 +1 @@ -import{p as v,i as f,d as Se,b as G,f as ke,a as ye,q as Ne,w as je}from"./i18n-CPHyzK9b.js";import{a as s,f as qe,ah as Ce,M as we,aa as te,ab as be,ac as he,$ as V,Z as a,G as pe,Q as i,S as b,T as u,t as p,O as Ae,N as O,a5 as Je,X as j,a3 as K,a2 as B,R as o,ar as Ie}from"./index-DydPgVMC.js";import{C as Te}from"./Check-2f8HlfSn.js";import{C as Ee}from"./Copy-B3jzejpA.js";import{I as Me}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{E as Ve}from"./Empty-B15ItVsj.js";import{I as Be}from"./IconButtonWrapper-PnNNNvqI.js";var He=qe('');function Le(Q){var e=He();s(Q,e)}var Pe=o(''),Re=o(' :',1),Ze=o(' ',1),Ge=o(" ",1),Ke=o(' '),Qe=o(' '),We=o(' '),Xe=o('null'),Ye=o(" "),ze=o(','),De=o(','),Fe=o('
                '),Ue=o('
                ');function xe(Q,e){we(e,!0);let S=v(e,"depth",3,0),ae=v(e,"is_root",3,!1),re=v(e,"is_last_item",3,!0),se=v(e,"key",3,null),le=v(e,"open",3,!1),W=v(e,"theme_mode",3,"system"),H=v(e,"show_indices",3,!1),X=v(e,"interactive",3,!0),I=te(void 0),c=te(be(le()?!1:S()>=3)),k=te(be([]));function T(t){return t!==null&&(typeof t=="object"||Array.isArray(t))}async function ne(){V(c,!a(c)),await pe()}function _e(t){return Array.isArray(t)?`Array(${t.length})`:typeof t=="object"&&t!==null?`Object(${Object.keys(t).length})`:String(t)}he(()=>{T(e.value)?V(k,Object.entries(e.value),!0):V(k,[],!0)});function ie(){if(!a(I))return;a(I).querySelectorAll(".line").forEach((r,l)=>{const d=r.querySelector(".line-number");d&&(d.setAttribute("data-pseudo-content",(l+1).toString()),d?.setAttribute("aria-roledescription",`Line number ${l+1}`),d?.setAttribute("title",`Line number ${l+1}`))})}he(()=>{e.value,a(c),ae()&&a(I)&&pe().then(()=>{ie()})});var q=Ue();let ue;var L=i(q);let _;var N=b(i(L),2),E=i(N);{var Y=t=>{var r=Pe();r.__click=ne,p(()=>{ye(r,"data-pseudo-content",X()?a(c)?"▶":"▼":""),ye(r,"aria-label",a(c)?"Expand":"Collapse"),r.disabled=!X()}),s(t,r)};f(E,t=>{T(e.value)&&t(Y)})}var M=b(E,2);{var ve=t=>{var r=Re(),l=O(r),d=i(l);u(l),Je(),p(()=>j(d,`"${se()??""}"`)),s(t,r)};f(M,t=>{se()!==null&&t(ve)})}var oe=b(M,2);{var z=t=>{var r=Ge(),l=O(r);let d;var P=i(l,!0);u(l);var y=b(l,2);{var m=h=>{var C=Ze(),J=O(C);J.__click=ne;var w=i(J,!0);u(J);var n=b(J,2);let g;var F=i(n,!0);u(n),p((R,A,x)=>{j(w,R),g=G(n,1,"punctuation bracket svelte-5rsslu",null,g,A),j(F,x)},[()=>_e(e.value),()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"]":"}"]),s(h,C)};f(y,h=>{a(c)&&h(m)})}p((h,C)=>{d=G(l,1,"punctuation bracket svelte-5rsslu",null,d,h),j(P,C)},[()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"[":"{"]),s(t,r)},D=t=>{var r=K(),l=O(r);{var d=y=>{var m=Ke(),h=i(m);u(m),p(()=>j(h,`"${e.value??""}"`)),s(y,m)},P=y=>{var m=K(),h=O(m);{var C=w=>{var n=Qe(),g=i(n,!0);u(n),p(()=>j(g,e.value)),s(w,n)},J=w=>{var n=K(),g=O(n);{var F=A=>{var x=We(),U=i(x,!0);u(x),p($=>j(U,$),[()=>e.value.toString()]),s(A,x)},R=A=>{var x=K(),U=O(x);{var $=Z=>{var ee=Xe();s(Z,ee)},me=Z=>{var ee=Ye(),Oe=i(ee,!0);u(ee),p(()=>j(Oe,e.value)),s(Z,ee)};f(U,Z=>{e.value===null?Z($):Z(me,!1)},!0)}s(A,x)};f(g,A=>{typeof e.value=="boolean"?A(F):A(R,!1)},!0)}s(w,n)};f(h,w=>{typeof e.value=="number"?w(C):w(J,!1)},!0)}s(y,m)};f(l,y=>{typeof e.value=="string"?y(d):y(P,!1)},!0)}s(t,r)};f(oe,t=>{T(e.value)?t(z):t(D,!1)})}var ge=b(oe,2);{var ce=t=>{var r=ze();s(t,r)};f(ge,t=>{!re()&&(!T(e.value)||a(c))&&t(ce)})}u(N),u(L);var de=b(L,2);{var fe=t=>{var r=Fe();let l;var d=i(r);Ne(d,17,()=>a(k),je,(n,g,F)=>{var R=B(()=>Ie(a(g),2));let A=()=>a(R)[0],x=()=>a(R)[1];{let U=B(()=>S()+1),$=B(()=>F===a(k).length-1),me=B(()=>Array.isArray(e.value)&&!H()?null:A());xe(n,{get value(){return x()},get depth(){return a(U)},get is_last_item(){return a($)},get key(){return a(me)},get open(){return le()},get theme_mode(){return W()},get show_indices(){return H()},get interactive(){return X()}})}});var P=b(d,2),y=b(i(P),2),m=i(y);let h;var C=i(m,!0);u(m);var J=b(m,2);{var w=n=>{var g=De();s(n,g)};f(J,n=>{re()||n(w)})}u(y),u(P),u(r),p((n,g)=>{l=G(r,1,"children svelte-5rsslu",null,l,{hidden:a(c)}),h=G(m,1,"punctuation bracket svelte-5rsslu",null,h,n),j(C,g)},[()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"]":"}"]),s(t,r)};f(de,t=>{T(e.value)&&t(fe)})}u(q),Se(q,t=>V(I,t),()=>a(I)),p(()=>{ue=G(q,1,"json-node svelte-5rsslu",null,ue,{root:ae(),"dark-mode":W()==="dark"}),ke(q,`--depth: ${S()??""};`),_=G(L,1,"line svelte-5rsslu",null,_,{collapsed:a(c)})}),s(Q,q),Ae()}Ce(["click"]);var $e=o('
                ',1),et=o('
                ');function ut(Q,e){we(e,!0);let S=v(e,"value",19,()=>({})),ae=v(e,"open",3,!1),re=v(e,"theme_mode",3,"system"),se=v(e,"show_indices",3,!1),le=v(e,"interactive",3,!0),W=v(e,"show_copy_button",3,!0),H=v(e,"buttons",3,null),X=v(e,"on_custom_button_click",3,null),I=B(()=>`calc(100% - ${e.label_height}px)`),c=te(!1),k=te(void 0);function T(){V(c,!0),a(k)&&clearTimeout(a(k)),V(k,setTimeout(()=>{V(c,!1)},1e3),!0)}async function ne(){"clipboard"in navigator&&(await navigator.clipboard.writeText(JSON.stringify(S(),null,2)),T())}function _e(_){return _&&Object.keys(_).length===0&&Object.getPrototypeOf(_)===Object.prototype&&JSON.stringify(_)===JSON.stringify({})}he(()=>()=>{a(k)&&clearTimeout(a(k))});var ie=K(),q=O(ie);{var ue=_=>{var N=$e(),E=O(N);{var Y=z=>{Be(z,{get buttons(){return H()},get on_custom_button_click(){return X()},children:(D,ge)=>{var ce=K(),de=O(ce);{var fe=t=>{{let r=B(()=>a(c)?"Copied":"Copy"),l=B(()=>a(c)?Te:Ee);Me(t,{show_label:!1,get label(){return a(r)},get Icon(){return a(l)},onclick:()=>ne()})}};f(de,t=>{W()&&t(fe)})}s(D,ce)},$$slots:{default:!0}})};f(E,z=>{(W()||H()&&H().some(D=>typeof D!="string"))&&z(Y)})}var M=b(E,2);let ve;var oe=i(M);xe(oe,{get value(){return S()},depth:0,is_root:!0,get open(){return ae()},get theme_mode(){return re()},get show_indices(){return se()},get interactive(){return le()}}),u(M),p(()=>ve=ke(M,"",ve,{"max-height":a(I)})),s(_,N)},L=_=>{var N=et(),E=i(N);Ve(E,{children:(Y,M)=>{Le(Y)},$$slots:{default:!0}}),u(N),s(_,N)};f(q,_=>{S()&&S()!=='""'&&!_e(S())?_(ue):_(L,!1)})}s(Q,ie),Ae()}export{ut as J,Le as a}; +import{p as v,i as f,d as Se,b as G,f as ke,a as ye,q as Ne,w as je}from"./i18n-DtG3MAQ1.js";import{a as s,f as qe,ah as Ce,M as we,aa as te,ab as be,ac as he,$ as V,Z as a,G as pe,Q as i,S as b,T as u,t as p,O as Ae,N as O,a5 as Je,X as j,a3 as K,a2 as B,R as o,ar as Ie}from"./index-BeNBoC9J.js";import{C as Te}from"./Check-DjGw_9dO.js";import{C as Ee}from"./Copy-eBznHIlR.js";import{I as Me}from"./ScrollFade.svelte_svelte_type_style_lang-DgbEBGDD.js";import{E as Ve}from"./Empty-Clj0ErcW.js";import{I as Be}from"./IconButtonWrapper-Ce5bzAyh.js";var He=qe('');function Le(Q){var e=He();s(Q,e)}var Pe=o(''),Re=o(' :',1),Ze=o(' ',1),Ge=o(" ",1),Ke=o(' '),Qe=o(' '),We=o(' '),Xe=o('null'),Ye=o(" "),ze=o(','),De=o(','),Fe=o('
                '),Ue=o('
                ');function xe(Q,e){we(e,!0);let S=v(e,"depth",3,0),ae=v(e,"is_root",3,!1),re=v(e,"is_last_item",3,!0),se=v(e,"key",3,null),le=v(e,"open",3,!1),W=v(e,"theme_mode",3,"system"),H=v(e,"show_indices",3,!1),X=v(e,"interactive",3,!0),I=te(void 0),c=te(be(le()?!1:S()>=3)),k=te(be([]));function T(t){return t!==null&&(typeof t=="object"||Array.isArray(t))}async function ne(){V(c,!a(c)),await pe()}function _e(t){return Array.isArray(t)?`Array(${t.length})`:typeof t=="object"&&t!==null?`Object(${Object.keys(t).length})`:String(t)}he(()=>{T(e.value)?V(k,Object.entries(e.value),!0):V(k,[],!0)});function ie(){if(!a(I))return;a(I).querySelectorAll(".line").forEach((r,l)=>{const d=r.querySelector(".line-number");d&&(d.setAttribute("data-pseudo-content",(l+1).toString()),d?.setAttribute("aria-roledescription",`Line number ${l+1}`),d?.setAttribute("title",`Line number ${l+1}`))})}he(()=>{e.value,a(c),ae()&&a(I)&&pe().then(()=>{ie()})});var q=Ue();let ue;var L=i(q);let _;var N=b(i(L),2),E=i(N);{var Y=t=>{var r=Pe();r.__click=ne,p(()=>{ye(r,"data-pseudo-content",X()?a(c)?"▶":"▼":""),ye(r,"aria-label",a(c)?"Expand":"Collapse"),r.disabled=!X()}),s(t,r)};f(E,t=>{T(e.value)&&t(Y)})}var M=b(E,2);{var ve=t=>{var r=Re(),l=O(r),d=i(l);u(l),Je(),p(()=>j(d,`"${se()??""}"`)),s(t,r)};f(M,t=>{se()!==null&&t(ve)})}var oe=b(M,2);{var z=t=>{var r=Ge(),l=O(r);let d;var P=i(l,!0);u(l);var y=b(l,2);{var m=h=>{var C=Ze(),J=O(C);J.__click=ne;var w=i(J,!0);u(J);var n=b(J,2);let g;var F=i(n,!0);u(n),p((R,A,x)=>{j(w,R),g=G(n,1,"punctuation bracket svelte-5rsslu",null,g,A),j(F,x)},[()=>_e(e.value),()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"]":"}"]),s(h,C)};f(y,h=>{a(c)&&h(m)})}p((h,C)=>{d=G(l,1,"punctuation bracket svelte-5rsslu",null,d,h),j(P,C)},[()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"[":"{"]),s(t,r)},D=t=>{var r=K(),l=O(r);{var d=y=>{var m=Ke(),h=i(m);u(m),p(()=>j(h,`"${e.value??""}"`)),s(y,m)},P=y=>{var m=K(),h=O(m);{var C=w=>{var n=Qe(),g=i(n,!0);u(n),p(()=>j(g,e.value)),s(w,n)},J=w=>{var n=K(),g=O(n);{var F=A=>{var x=We(),U=i(x,!0);u(x),p($=>j(U,$),[()=>e.value.toString()]),s(A,x)},R=A=>{var x=K(),U=O(x);{var $=Z=>{var ee=Xe();s(Z,ee)},me=Z=>{var ee=Ye(),Oe=i(ee,!0);u(ee),p(()=>j(Oe,e.value)),s(Z,ee)};f(U,Z=>{e.value===null?Z($):Z(me,!1)},!0)}s(A,x)};f(g,A=>{typeof e.value=="boolean"?A(F):A(R,!1)},!0)}s(w,n)};f(h,w=>{typeof e.value=="number"?w(C):w(J,!1)},!0)}s(y,m)};f(l,y=>{typeof e.value=="string"?y(d):y(P,!1)},!0)}s(t,r)};f(oe,t=>{T(e.value)?t(z):t(D,!1)})}var ge=b(oe,2);{var ce=t=>{var r=ze();s(t,r)};f(ge,t=>{!re()&&(!T(e.value)||a(c))&&t(ce)})}u(N),u(L);var de=b(L,2);{var fe=t=>{var r=Fe();let l;var d=i(r);Ne(d,17,()=>a(k),je,(n,g,F)=>{var R=B(()=>Ie(a(g),2));let A=()=>a(R)[0],x=()=>a(R)[1];{let U=B(()=>S()+1),$=B(()=>F===a(k).length-1),me=B(()=>Array.isArray(e.value)&&!H()?null:A());xe(n,{get value(){return x()},get depth(){return a(U)},get is_last_item(){return a($)},get key(){return a(me)},get open(){return le()},get theme_mode(){return W()},get show_indices(){return H()},get interactive(){return X()}})}});var P=b(d,2),y=b(i(P),2),m=i(y);let h;var C=i(m,!0);u(m);var J=b(m,2);{var w=n=>{var g=De();s(n,g)};f(J,n=>{re()||n(w)})}u(y),u(P),u(r),p((n,g)=>{l=G(r,1,"children svelte-5rsslu",null,l,{hidden:a(c)}),h=G(m,1,"punctuation bracket svelte-5rsslu",null,h,n),j(C,g)},[()=>({"square-bracket":Array.isArray(e.value)}),()=>Array.isArray(e.value)?"]":"}"]),s(t,r)};f(de,t=>{T(e.value)&&t(fe)})}u(q),Se(q,t=>V(I,t),()=>a(I)),p(()=>{ue=G(q,1,"json-node svelte-5rsslu",null,ue,{root:ae(),"dark-mode":W()==="dark"}),ke(q,`--depth: ${S()??""};`),_=G(L,1,"line svelte-5rsslu",null,_,{collapsed:a(c)})}),s(Q,q),Ae()}Ce(["click"]);var $e=o('
                ',1),et=o('
                ');function ut(Q,e){we(e,!0);let S=v(e,"value",19,()=>({})),ae=v(e,"open",3,!1),re=v(e,"theme_mode",3,"system"),se=v(e,"show_indices",3,!1),le=v(e,"interactive",3,!0),W=v(e,"show_copy_button",3,!0),H=v(e,"buttons",3,null),X=v(e,"on_custom_button_click",3,null),I=B(()=>`calc(100% - ${e.label_height}px)`),c=te(!1),k=te(void 0);function T(){V(c,!0),a(k)&&clearTimeout(a(k)),V(k,setTimeout(()=>{V(c,!1)},1e3),!0)}async function ne(){"clipboard"in navigator&&(await navigator.clipboard.writeText(JSON.stringify(S(),null,2)),T())}function _e(_){return _&&Object.keys(_).length===0&&Object.getPrototypeOf(_)===Object.prototype&&JSON.stringify(_)===JSON.stringify({})}he(()=>()=>{a(k)&&clearTimeout(a(k))});var ie=K(),q=O(ie);{var ue=_=>{var N=$e(),E=O(N);{var Y=z=>{Be(z,{get buttons(){return H()},get on_custom_button_click(){return X()},children:(D,ge)=>{var ce=K(),de=O(ce);{var fe=t=>{{let r=B(()=>a(c)?"Copied":"Copy"),l=B(()=>a(c)?Te:Ee);Me(t,{show_label:!1,get label(){return a(r)},get Icon(){return a(l)},onclick:()=>ne()})}};f(de,t=>{W()&&t(fe)})}s(D,ce)},$$slots:{default:!0}})};f(E,z=>{(W()||H()&&H().some(D=>typeof D!="string"))&&z(Y)})}var M=b(E,2);let ve;var oe=i(M);xe(oe,{get value(){return S()},depth:0,is_root:!0,get open(){return ae()},get theme_mode(){return re()},get show_indices(){return se()},get interactive(){return le()}}),u(M),p(()=>ve=ke(M,"",ve,{"max-height":a(I)})),s(_,N)},L=_=>{var N=et(),E=i(N);Ve(E,{children:(Y,M)=>{Le(Y)},$$slots:{default:!0}}),u(N),s(_,N)};f(q,_=>{S()&&S()!=='""'&&!_e(S())?_(ue):_(L,!1)})}s(Q,ie),Ae()}export{ut as J,Le as a}; diff --git a/assets/KHR_animation_pointer-CtN8fOa7.js b/assets/KHR_animation_pointer-suHFfE5N.js similarity index 98% rename from assets/KHR_animation_pointer-CtN8fOa7.js rename to assets/KHR_animation_pointer-suHFfE5N.js index 729eff9e33c3693c5d616581c166a945ba535068..9e321d84b665e2716c43ecd4fb2ddd839475bd2e 100644 --- a/assets/KHR_animation_pointer-CtN8fOa7.js +++ b/assets/KHR_animation_pointer-suHFfE5N.js @@ -1 +1 @@ -import{as as t,C as z,L as H,aG as G,aH as B}from"./index-GY9JDBGV.js";import{S as e,G as Z}from"./objectModelMapping-CpTIXcMS.js";import{AnimationPropertyInfo as I}from"./glTFLoaderAnimation-DM5M4v5g.js";import"./index-DydPgVMC.js";function u(l,r,a,i){return z.FromArray(r,a).scale(i)}function V(l,r,a,i){return r[a+3]*i}function s(l,r,a,i){return r[a]*i}function K(l,r,a,i){return-r[a]*i}function A(l,r,a,i){return r[a+1]*i}function X(l,r,a,i){return r[a]*i*2}function o(l){return{scale:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uScale`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vScale`,A,()=>2)],offset:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uOffset`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vOffset`,A,()=>2)],rotation:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.wAng`,K,()=>1)]}}class c extends I{buildAnimations(r,a,i,_){return[{babylonAnimatable:r._babylonCamera,babylonAnimation:this._buildAnimation(a,i,_)}]}}class n extends I{buildAnimations(r,a,i,_){const x=[];for(const T in r._data)x.push({babylonAnimatable:r._data[T].babylonMaterial,babylonAnimation:this._buildAnimation(a,i,_)});return x}}class m extends I{buildAnimations(r,a,i,_){return[{babylonAnimatable:r._babylonLight,babylonAnimation:this._buildAnimation(a,i,_)}]}}class W extends I{buildAnimations(r,a,i,_){return r._primitiveBabylonMeshes?r._primitiveBabylonMeshes.map(x=>({babylonAnimatable:x,babylonAnimation:this._buildAnimation(a,i,_)})):[]}}e("/cameras/{}/orthographic/xmag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoLeft",K,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoRight",A,()=>1)]);e("/cameras/{}/orthographic/ymag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoBottom",K,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoTop",A,()=>1)]);e("/cameras/{}/orthographic/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/orthographic/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/cameras/{}/perspective/yfov",[new c(t.ANIMATIONTYPE_FLOAT,"fov",s,()=>1)]);e("/cameras/{}/perspective/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/perspective/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"albedoColor",u,()=>4),new n(t.ANIMATIONTYPE_FLOAT,"alpha",V,()=>4)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallic",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"roughness",s,()=>1)]);const O=o("albedoTexture");e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",O.scale);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",O.offset);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",O.rotation);const N=o("metallicTexture");e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",N.scale);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",N.offset);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",N.rotation);e("/materials/{}/emissiveFactor",[new n(t.ANIMATIONTYPE_COLOR3,"emissiveColor",u,()=>3)]);const g=o("bumpTexture");e("/materials/{}/normalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"bumpTexture.level",s,()=>1)]);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",g.scale);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",g.offset);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",g.rotation);e("/materials/{}/occlusionTexture/strength",[new n(t.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",s,()=>1)]);const d=o("ambientTexture");e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",d.scale);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",d.offset);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",d.rotation);const b=o("emissiveTexture");e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",b.scale);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",b.offset);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",b.rotation);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.angle",s,()=>1)]);const M=o("anisotropy.texture");e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",M.scale);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",M.offset);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",M.rotation);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",s,()=>1)]);const F=o("clearCoat.texture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",F.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",F.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",F.rotation);const E=o("clearCoat.bumpTexture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",E.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",E.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",E.rotation);const w=o("clearCoat.textureRoughness");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",w.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",w.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",w.rotation);e("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new n(t.ANIMATIONTYPE_FLOAT,"emissiveIntensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_ior/ior",[new n(t.ANIMATIONTYPE_FLOAT,"indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",s,()=>1)]);const L=o("iridescence.texture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",L.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",L.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",L.rotation);const P=o("iridescence.thicknessTexture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",P.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",P.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",P.rotation);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"sheen.color",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"sheen.roughness",s,()=>1)]);const y=o("sheen.texture");e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",y.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",y.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",y.rotation);const C=o("sheen.textureRoughness");e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",C.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",C.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",C.rotation);e("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallicF0Factor",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",u,()=>3)]);const Y=o("metallicReflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",Y.scale);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",Y.offset);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",Y.rotation);const v=o("reflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",v.scale);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",v.offset);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",v.rotation);e("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",s,()=>1)]);const S=o("subSurface.refractionIntensityTexture");e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",S.scale);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",S.offset);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",S.rotation);e("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",s,()=>1)]);const $=o("subSurface.thicknessTexture");e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",$.scale);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",$.offset);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",$.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",s,()=>1)]);const k=o("subSurface.translucencyIntensityTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",k.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",k.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",k.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",u,()=>3)]);const j=o("subSurface.translucencyColorTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",j.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",j.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",j.rotation);e("/extensions/KHR_lights_punctual/lights/{}/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/KHR_lights_punctual/lights/{}/intensity",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/range",[new m(t.ANIMATIONTYPE_FLOAT,"range",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new m(t.ANIMATIONTYPE_FLOAT,"innerAngle",X,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new m(t.ANIMATIONTYPE_FLOAT,"angle",X,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/EXT_lights_area/lights/{}/intensity",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/size",[new m(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/rect/aspect",[new m(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/nodes/{}/extensions/EXT_lights_ies/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/nodes/{}/extensions/KHR_node_visibility/visible",[new W(t.ANIMATIONTYPE_FLOAT,"isVisible",s,()=>1)]);const R="KHR_animation_pointer";class D{constructor(r){this.name=R,this._loader=r,this._pathToObjectConverter=Z(this._loader.gltf)}get enabled(){return this._loader.isExtensionUsed(R)}dispose(){this._loader=null,delete this._pathToObjectConverter}_loadAnimationChannelAsync(r,a,i,_,x){const T=_.target.extensions?.KHR_animation_pointer;if(!T||!this._pathToObjectConverter)return null;_.target.path!=="pointer"&&H.Warn(`${r}/target/path: Value (${_.target.path}) must be (pointer) when using the ${this.name} extension`),_.target.node!=null&&H.Warn(`${r}/target/node: Value (${_.target.node}) must not be present when using the ${this.name} extension`);const h=`${r}/extensions/${this.name}`,p=T.pointer;if(!p)throw new Error(`${h}: Pointer is missing`);try{const f=this._pathToObjectConverter.convert(p);if(!f.info.interpolation)throw new Error(`${h}/pointer: Interpolation is missing`);return this._loader._loadAnimationChannelFromTargetInfoAsync(r,a,i,_,{object:f.object,info:f.info.interpolation},x)}catch{return H.Warn(`${h}/pointer: Invalid pointer (${p}) skipped`),null}}}G(R);B(R,!0,l=>new D(l));export{D as KHR_animation_pointer}; +import{as as t,C as z,L as H,aG as G,aH as B}from"./index-DmfQKmJL.js";import{S as e,G as Z}from"./objectModelMapping-BHbejOcH.js";import{AnimationPropertyInfo as I}from"./glTFLoaderAnimation-Bl0pgpcZ.js";import"./index-BeNBoC9J.js";function u(l,r,a,i){return z.FromArray(r,a).scale(i)}function V(l,r,a,i){return r[a+3]*i}function s(l,r,a,i){return r[a]*i}function K(l,r,a,i){return-r[a]*i}function A(l,r,a,i){return r[a+1]*i}function X(l,r,a,i){return r[a]*i*2}function o(l){return{scale:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uScale`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vScale`,A,()=>2)],offset:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uOffset`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vOffset`,A,()=>2)],rotation:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.wAng`,K,()=>1)]}}class c extends I{buildAnimations(r,a,i,_){return[{babylonAnimatable:r._babylonCamera,babylonAnimation:this._buildAnimation(a,i,_)}]}}class n extends I{buildAnimations(r,a,i,_){const x=[];for(const T in r._data)x.push({babylonAnimatable:r._data[T].babylonMaterial,babylonAnimation:this._buildAnimation(a,i,_)});return x}}class m extends I{buildAnimations(r,a,i,_){return[{babylonAnimatable:r._babylonLight,babylonAnimation:this._buildAnimation(a,i,_)}]}}class W extends I{buildAnimations(r,a,i,_){return r._primitiveBabylonMeshes?r._primitiveBabylonMeshes.map(x=>({babylonAnimatable:x,babylonAnimation:this._buildAnimation(a,i,_)})):[]}}e("/cameras/{}/orthographic/xmag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoLeft",K,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoRight",A,()=>1)]);e("/cameras/{}/orthographic/ymag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoBottom",K,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoTop",A,()=>1)]);e("/cameras/{}/orthographic/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/orthographic/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/cameras/{}/perspective/yfov",[new c(t.ANIMATIONTYPE_FLOAT,"fov",s,()=>1)]);e("/cameras/{}/perspective/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/perspective/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"albedoColor",u,()=>4),new n(t.ANIMATIONTYPE_FLOAT,"alpha",V,()=>4)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallic",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"roughness",s,()=>1)]);const O=o("albedoTexture");e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",O.scale);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",O.offset);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",O.rotation);const N=o("metallicTexture");e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",N.scale);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",N.offset);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",N.rotation);e("/materials/{}/emissiveFactor",[new n(t.ANIMATIONTYPE_COLOR3,"emissiveColor",u,()=>3)]);const g=o("bumpTexture");e("/materials/{}/normalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"bumpTexture.level",s,()=>1)]);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",g.scale);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",g.offset);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",g.rotation);e("/materials/{}/occlusionTexture/strength",[new n(t.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",s,()=>1)]);const d=o("ambientTexture");e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",d.scale);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",d.offset);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",d.rotation);const b=o("emissiveTexture");e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",b.scale);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",b.offset);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",b.rotation);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.angle",s,()=>1)]);const M=o("anisotropy.texture");e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",M.scale);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",M.offset);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",M.rotation);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",s,()=>1)]);const F=o("clearCoat.texture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",F.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",F.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",F.rotation);const E=o("clearCoat.bumpTexture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",E.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",E.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",E.rotation);const w=o("clearCoat.textureRoughness");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",w.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",w.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",w.rotation);e("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new n(t.ANIMATIONTYPE_FLOAT,"emissiveIntensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_ior/ior",[new n(t.ANIMATIONTYPE_FLOAT,"indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",s,()=>1)]);const L=o("iridescence.texture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",L.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",L.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",L.rotation);const P=o("iridescence.thicknessTexture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",P.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",P.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",P.rotation);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"sheen.color",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"sheen.roughness",s,()=>1)]);const y=o("sheen.texture");e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",y.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",y.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",y.rotation);const C=o("sheen.textureRoughness");e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",C.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",C.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",C.rotation);e("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallicF0Factor",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",u,()=>3)]);const Y=o("metallicReflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",Y.scale);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",Y.offset);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",Y.rotation);const v=o("reflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",v.scale);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",v.offset);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",v.rotation);e("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",s,()=>1)]);const S=o("subSurface.refractionIntensityTexture");e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",S.scale);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",S.offset);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",S.rotation);e("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",s,()=>1)]);const $=o("subSurface.thicknessTexture");e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",$.scale);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",$.offset);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",$.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",s,()=>1)]);const k=o("subSurface.translucencyIntensityTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",k.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",k.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",k.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",u,()=>3)]);const j=o("subSurface.translucencyColorTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",j.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",j.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",j.rotation);e("/extensions/KHR_lights_punctual/lights/{}/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/KHR_lights_punctual/lights/{}/intensity",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/range",[new m(t.ANIMATIONTYPE_FLOAT,"range",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new m(t.ANIMATIONTYPE_FLOAT,"innerAngle",X,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new m(t.ANIMATIONTYPE_FLOAT,"angle",X,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/EXT_lights_area/lights/{}/intensity",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/size",[new m(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/rect/aspect",[new m(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/nodes/{}/extensions/EXT_lights_ies/color",[new m(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new m(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/nodes/{}/extensions/KHR_node_visibility/visible",[new W(t.ANIMATIONTYPE_FLOAT,"isVisible",s,()=>1)]);const R="KHR_animation_pointer";class D{constructor(r){this.name=R,this._loader=r,this._pathToObjectConverter=Z(this._loader.gltf)}get enabled(){return this._loader.isExtensionUsed(R)}dispose(){this._loader=null,delete this._pathToObjectConverter}_loadAnimationChannelAsync(r,a,i,_,x){const T=_.target.extensions?.KHR_animation_pointer;if(!T||!this._pathToObjectConverter)return null;_.target.path!=="pointer"&&H.Warn(`${r}/target/path: Value (${_.target.path}) must be (pointer) when using the ${this.name} extension`),_.target.node!=null&&H.Warn(`${r}/target/node: Value (${_.target.node}) must not be present when using the ${this.name} extension`);const h=`${r}/extensions/${this.name}`,p=T.pointer;if(!p)throw new Error(`${h}: Pointer is missing`);try{const f=this._pathToObjectConverter.convert(p);if(!f.info.interpolation)throw new Error(`${h}/pointer: Interpolation is missing`);return this._loader._loadAnimationChannelFromTargetInfoAsync(r,a,i,_,{object:f.object,info:f.info.interpolation},x)}catch{return H.Warn(`${h}/pointer: Invalid pointer (${p}) skipped`),null}}}G(R);B(R,!0,l=>new D(l));export{D as KHR_animation_pointer}; diff --git a/assets/KHR_draco_mesh_compression-CYCZ7fYE.js b/assets/KHR_draco_mesh_compression-8UXeyRYs.js similarity index 96% rename from assets/KHR_draco_mesh_compression-CYCZ7fYE.js rename to assets/KHR_draco_mesh_compression-8UXeyRYs.js index 8b00dfb88f8202032742726550c7d2eb32aafc6b..e8d730416d863af529da58bb5ed81584800a3ee2 100644 --- a/assets/KHR_draco_mesh_compression-CYCZ7fYE.js +++ b/assets/KHR_draco_mesh_compression-8UXeyRYs.js @@ -1 +1 @@ -import{d as A,bp as M,J as w,L as v,aG as V,aH as k}from"./index-GY9JDBGV.js";import{A as R}from"./workerPool-CfMXSLnf.js";import{GLTFLoader as F,ArrayItem as D,LoadBoundingInfoFromPositionAccessor as N}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";function I(c,t,n,i,f){const e=c;let r=null,o=null,s=null;try{r=new e.Decoder,o=new e.DecoderBuffer,o.Init(t,t.byteLength);let a;const l=r.GetEncodedGeometryType(o);switch(l){case e.TRIANGULAR_MESH:{const d=new e.Mesh;if(a=r.DecodeBufferToMesh(o,d),!a.ok()||d.ptr===0)throw new Error(a.error_msg());const y=d.num_faces()*3,h=y*4,u=e._malloc(h);try{r.GetTrianglesUInt32Array(d,h,u);const P=new Uint32Array(y);P.set(new Uint32Array(e.HEAPF32.buffer,u,y)),i(P)}finally{e._free(u)}s=d;break}case e.POINT_CLOUD:{const d=new e.PointCloud;if(a=r.DecodeBufferToPointCloud(o,d),!a.ok()||!d.ptr)throw new Error(a.error_msg());s=d;break}default:throw new Error(`Invalid geometry type ${l}`)}const _=s.num_points(),b=(d,m,y,h)=>{const u=h.data_type(),P=h.num_components(),B=h.normalized(),C=h.byte_stride(),O=h.byte_offset(),T={[e.DT_FLOAT32]:{typedArrayConstructor:Float32Array,heap:e.HEAPF32},[e.DT_INT8]:{typedArrayConstructor:Int8Array,heap:e.HEAP8},[e.DT_INT16]:{typedArrayConstructor:Int16Array,heap:e.HEAP16},[e.DT_INT32]:{typedArrayConstructor:Int32Array,heap:e.HEAP32},[e.DT_UINT8]:{typedArrayConstructor:Uint8Array,heap:e.HEAPU8},[e.DT_UINT16]:{typedArrayConstructor:Uint16Array,heap:e.HEAPU16},[e.DT_UINT32]:{typedArrayConstructor:Uint32Array,heap:e.HEAPU32}}[u];if(!T)throw new Error(`Invalid data type ${u}`);const U=_*P,L=U*T.typedArrayConstructor.BYTES_PER_ELEMENT,g=e._malloc(L);try{d.GetAttributeDataArrayForAllPoints(m,h,u,L,g);const G=new T.typedArrayConstructor(T.heap.buffer,g,U);f(y,G.slice(),P,O,C,B)}finally{e._free(g)}};if(n)for(const d in n){const m=n[d],y=r.GetAttributeByUniqueId(s,m);b(r,s,d,y)}else{const d={position:e.POSITION,normal:e.NORMAL,color:e.COLOR,uv:e.TEX_COORD};for(const m in d){const y=r.GetAttributeId(s,d[m]);if(y!==-1){const h=r.GetAttribute(s,y);b(r,s,m,h)}}}return _}finally{s&&e.destroy(s),o&&e.destroy(o),r&&e.destroy(r)}}function S(){let c;onmessage=t=>{const n=t.data;switch(n.id){case"init":{n.url&&importScripts(n.url);const i=n.wasmBinary?{wasmBinary:n.wasmBinary}:{};c=DracoDecoderModule(i),postMessage({id:"initDone"});break}case"decodeMesh":{if(!c)throw new Error("Draco decoder module is not available");c.then(i=>{const f=I(i,n.dataView,n.attributes,e=>{postMessage({id:"indices",data:e},[e.buffer])},(e,r,o,s,a,l)=>{postMessage({id:"attribute",kind:e,data:r,size:o,byteOffset:s,byteStride:a,normalized:l},[r.buffer])});postMessage({id:"decodeMeshDone",totalVertices:f})});break}}}}async function W(c,t,n){return await new Promise((i,f)=>{const e=o=>{c.removeEventListener("error",e),c.removeEventListener("message",r),f(o)},r=o=>{o.data.id==="initDone"&&(c.removeEventListener("error",e),c.removeEventListener("message",r),i(c))};if(c.addEventListener("error",e),c.addEventListener("message",r),!t)c.postMessage({id:"init",url:n});else{const o=t.slice(0);c.postMessage({id:"init",url:n,wasmBinary:o},[o])}})}function K(){return typeof navigator!="object"||!navigator.hardwareConcurrency?1:Math.min(Math.floor(navigator.hardwareConcurrency*.5),4)}function $(c){return!!(c.wasmUrl&&(c.wasmBinary||c.wasmBinaryUrl)&&typeof WebAssembly=="object"||c.fallbackUrl)}class H{constructor(t){if(t.workerPool){this._workerPoolPromise=Promise.resolve(t.workerPool);return}const n=t.wasmBinary,i=t.numWorkers??K(),f=i&&typeof Worker=="function"&&typeof URL=="function",e=f||!t.jsModule,r=t.wasmUrl&&t.wasmBinaryUrl&&typeof WebAssembly=="object"?{url:e?A.GetBabylonScriptURL(t.wasmUrl,!0):"",wasmBinaryPromise:n?Promise.resolve(n):A.LoadFileAsync(A.GetBabylonScriptURL(t.wasmBinaryUrl,!0))}:{url:e?A.GetBabylonScriptURL(t.fallbackUrl):"",wasmBinaryPromise:Promise.resolve(void 0)};f?this._workerPoolPromise=r.wasmBinaryPromise.then(o=>{const s=this._getWorkerContent(),a=URL.createObjectURL(new Blob([s],{type:"application/javascript"}));return new R(i,()=>{const l=new Worker(a);return W(l,o,r.url)})}):this._modulePromise=r.wasmBinaryPromise.then(async o=>{if(!this._isModuleAvailable()&&!t.jsModule){if(!r.url)throw new Error("Draco codec module is not available");await A.LoadBabylonScriptAsync(r.url)}return await this._createModuleAsync(o,t.jsModule)})}async whenReadyAsync(){if(this._workerPoolPromise){await this._workerPoolPromise;return}if(this._modulePromise){await this._modulePromise;return}}dispose(){this._workerPoolPromise&&this._workerPoolPromise.then(t=>{t.dispose()}),delete this._workerPoolPromise,delete this._modulePromise}}class p extends H{static get DefaultAvailable(){return $(p.DefaultConfiguration)}static get Default(){return p._Default??(p._Default=new p),p._Default}static ResetDefault(t){p._Default&&(t||p._Default.dispose(),p._Default=null)}_isModuleAvailable(){return typeof DracoDecoderModule<"u"}async _createModuleAsync(t,n){return{module:await(n||DracoDecoderModule)({wasmBinary:t})}}_getWorkerContent(){return`${I}(${S})()`}constructor(t=p.DefaultConfiguration){super(t)}decodeMeshToMeshDataAsync(t,n,i){const f=t instanceof ArrayBuffer?new Int8Array(t):new Int8Array(t.buffer,t.byteOffset,t.byteLength),e=(r,o)=>i&&i[r]!==void 0?(o!==i[r]&&v.Warn(`Normalized flag from Draco data (${o}) does not match normalized flag from glTF accessor (${i[r]}). Using flag from glTF accessor.`),i[r]):o;if(this._workerPoolPromise)return this._workerPoolPromise.then(async r=>await new Promise((o,s)=>{r.push((a,l)=>{let _=null;const b=[],d=h=>{a.removeEventListener("error",d),a.removeEventListener("message",m),s(h),l()},m=h=>{const u=h.data;switch(u.id){case"indices":{_=u.data;break}case"attribute":{b.push({kind:u.kind,data:u.data,size:u.size,byteOffset:u.byteOffset,byteStride:u.byteStride,normalized:e(u.kind,u.normalized)});break}case"decodeMeshDone":{a.removeEventListener("error",d),a.removeEventListener("message",m),o({indices:_,attributes:b,totalVertices:u.totalVertices}),l();break}}};a.addEventListener("error",d),a.addEventListener("message",m);const y=f.slice();a.postMessage({id:"decodeMesh",dataView:y,attributes:n},[y.buffer])})}));if(this._modulePromise)return this._modulePromise.then(r=>{let o=null;const s=[],a=I(r.module,f,n,l=>{o=l},(l,_,b,d,m,y)=>{s.push({kind:l,data:_,size:b,byteOffset:d,byteStride:m,normalized:y})});return{indices:o,attributes:s,totalVertices:a}});throw new Error("Draco decoder module is not available")}async decodeMeshToGeometryAsync(t,n,i,f){const e=await this.decodeMeshToMeshDataAsync(i,f),r=new M(t,n);e.indices&&r.setIndices(e.indices);for(const o of e.attributes)r.setVerticesBuffer(new w(n.getEngine(),o.data,o.kind,!1,void 0,o.byteStride,void 0,o.byteOffset,o.size,void 0,o.normalized,!0),e.totalVertices);return r}async _decodeMeshToGeometryForGltfAsync(t,n,i,f,e,r){const o=await this.decodeMeshToMeshDataAsync(i,f,e),s=new M(t,n);r&&(s._boundingInfo=r,s.useBoundingInfoFromGeometry=!0),o.indices&&s.setIndices(o.indices);for(const a of o.attributes)s.setVerticesBuffer(new w(n.getEngine(),a.data,a.kind,!1,void 0,a.byteStride,void 0,a.byteOffset,a.size,void 0,a.normalized,!0),o.totalVertices);return s}}p.DefaultConfiguration={wasmUrl:`${A._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,wasmBinaryUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.wasm`,fallbackUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.js`};p._Default=null;const E="KHR_draco_mesh_compression";class z{constructor(t){this.name=E,this.useNormalizedFlagFromAccessor=!0,this._loader=t,this.enabled=p.DefaultAvailable&&this._loader.isExtensionUsed(E)}dispose(){delete this.dracoDecoder,this._loader=null}_loadVertexDataAsync(t,n,i){return F.LoadExtensionAsync(t,n,this.name,async(f,e)=>{if(n.mode!=null&&n.mode!==4&&n.mode!==5)throw new Error(`${t}: Unsupported mode ${n.mode}`);const r={},o={},s=(l,_)=>{const b=e.attributes[l];if(b!=null&&(i._delayInfo=i._delayInfo||[],i._delayInfo.indexOf(_)===-1&&i._delayInfo.push(_),r[_]=b,this.useNormalizedFlagFromAccessor)){const d=D.TryGet(this._loader.gltf.accessors,n.attributes[l]);d&&(o[_]=d.normalized||!1)}};s("POSITION",w.PositionKind),s("NORMAL",w.NormalKind),s("TANGENT",w.TangentKind),s("TEXCOORD_0",w.UVKind),s("TEXCOORD_1",w.UV2Kind),s("TEXCOORD_2",w.UV3Kind),s("TEXCOORD_3",w.UV4Kind),s("TEXCOORD_4",w.UV5Kind),s("TEXCOORD_5",w.UV6Kind),s("JOINTS_0",w.MatricesIndicesKind),s("WEIGHTS_0",w.MatricesWeightsKind),s("COLOR_0",w.ColorKind);const a=D.Get(f,this._loader.gltf.bufferViews,e.bufferView);return a._dracoBabylonGeometry||(a._dracoBabylonGeometry=this._loader.loadBufferViewAsync(`/bufferViews/${a.index}`,a).then(async l=>{const _=this.dracoDecoder||p.Default,b=D.TryGet(this._loader.gltf.accessors,n.attributes.POSITION),d=!this._loader.parent.alwaysComputeBoundingBox&&!i.skeleton&&b?N(b):null;return await _._decodeMeshToGeometryForGltfAsync(i.name,this._loader.babylonScene,l,r,o,d).catch(m=>{throw new Error(`${t}: ${m.message}`)})})),await a._dracoBabylonGeometry})}}V(E);k(E,!0,c=>new z(c));export{z as KHR_draco_mesh_compression}; +import{d as A,bp as M,J as w,L as v,aG as V,aH as k}from"./index-DmfQKmJL.js";import{A as R}from"./workerPool-CfMXSLnf.js";import{GLTFLoader as F,ArrayItem as D,LoadBoundingInfoFromPositionAccessor as N}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";function I(c,t,n,i,f){const e=c;let r=null,o=null,s=null;try{r=new e.Decoder,o=new e.DecoderBuffer,o.Init(t,t.byteLength);let a;const l=r.GetEncodedGeometryType(o);switch(l){case e.TRIANGULAR_MESH:{const d=new e.Mesh;if(a=r.DecodeBufferToMesh(o,d),!a.ok()||d.ptr===0)throw new Error(a.error_msg());const y=d.num_faces()*3,h=y*4,u=e._malloc(h);try{r.GetTrianglesUInt32Array(d,h,u);const P=new Uint32Array(y);P.set(new Uint32Array(e.HEAPF32.buffer,u,y)),i(P)}finally{e._free(u)}s=d;break}case e.POINT_CLOUD:{const d=new e.PointCloud;if(a=r.DecodeBufferToPointCloud(o,d),!a.ok()||!d.ptr)throw new Error(a.error_msg());s=d;break}default:throw new Error(`Invalid geometry type ${l}`)}const _=s.num_points(),b=(d,m,y,h)=>{const u=h.data_type(),P=h.num_components(),B=h.normalized(),C=h.byte_stride(),O=h.byte_offset(),T={[e.DT_FLOAT32]:{typedArrayConstructor:Float32Array,heap:e.HEAPF32},[e.DT_INT8]:{typedArrayConstructor:Int8Array,heap:e.HEAP8},[e.DT_INT16]:{typedArrayConstructor:Int16Array,heap:e.HEAP16},[e.DT_INT32]:{typedArrayConstructor:Int32Array,heap:e.HEAP32},[e.DT_UINT8]:{typedArrayConstructor:Uint8Array,heap:e.HEAPU8},[e.DT_UINT16]:{typedArrayConstructor:Uint16Array,heap:e.HEAPU16},[e.DT_UINT32]:{typedArrayConstructor:Uint32Array,heap:e.HEAPU32}}[u];if(!T)throw new Error(`Invalid data type ${u}`);const U=_*P,L=U*T.typedArrayConstructor.BYTES_PER_ELEMENT,g=e._malloc(L);try{d.GetAttributeDataArrayForAllPoints(m,h,u,L,g);const G=new T.typedArrayConstructor(T.heap.buffer,g,U);f(y,G.slice(),P,O,C,B)}finally{e._free(g)}};if(n)for(const d in n){const m=n[d],y=r.GetAttributeByUniqueId(s,m);b(r,s,d,y)}else{const d={position:e.POSITION,normal:e.NORMAL,color:e.COLOR,uv:e.TEX_COORD};for(const m in d){const y=r.GetAttributeId(s,d[m]);if(y!==-1){const h=r.GetAttribute(s,y);b(r,s,m,h)}}}return _}finally{s&&e.destroy(s),o&&e.destroy(o),r&&e.destroy(r)}}function S(){let c;onmessage=t=>{const n=t.data;switch(n.id){case"init":{n.url&&importScripts(n.url);const i=n.wasmBinary?{wasmBinary:n.wasmBinary}:{};c=DracoDecoderModule(i),postMessage({id:"initDone"});break}case"decodeMesh":{if(!c)throw new Error("Draco decoder module is not available");c.then(i=>{const f=I(i,n.dataView,n.attributes,e=>{postMessage({id:"indices",data:e},[e.buffer])},(e,r,o,s,a,l)=>{postMessage({id:"attribute",kind:e,data:r,size:o,byteOffset:s,byteStride:a,normalized:l},[r.buffer])});postMessage({id:"decodeMeshDone",totalVertices:f})});break}}}}async function W(c,t,n){return await new Promise((i,f)=>{const e=o=>{c.removeEventListener("error",e),c.removeEventListener("message",r),f(o)},r=o=>{o.data.id==="initDone"&&(c.removeEventListener("error",e),c.removeEventListener("message",r),i(c))};if(c.addEventListener("error",e),c.addEventListener("message",r),!t)c.postMessage({id:"init",url:n});else{const o=t.slice(0);c.postMessage({id:"init",url:n,wasmBinary:o},[o])}})}function K(){return typeof navigator!="object"||!navigator.hardwareConcurrency?1:Math.min(Math.floor(navigator.hardwareConcurrency*.5),4)}function $(c){return!!(c.wasmUrl&&(c.wasmBinary||c.wasmBinaryUrl)&&typeof WebAssembly=="object"||c.fallbackUrl)}class H{constructor(t){if(t.workerPool){this._workerPoolPromise=Promise.resolve(t.workerPool);return}const n=t.wasmBinary,i=t.numWorkers??K(),f=i&&typeof Worker=="function"&&typeof URL=="function",e=f||!t.jsModule,r=t.wasmUrl&&t.wasmBinaryUrl&&typeof WebAssembly=="object"?{url:e?A.GetBabylonScriptURL(t.wasmUrl,!0):"",wasmBinaryPromise:n?Promise.resolve(n):A.LoadFileAsync(A.GetBabylonScriptURL(t.wasmBinaryUrl,!0))}:{url:e?A.GetBabylonScriptURL(t.fallbackUrl):"",wasmBinaryPromise:Promise.resolve(void 0)};f?this._workerPoolPromise=r.wasmBinaryPromise.then(o=>{const s=this._getWorkerContent(),a=URL.createObjectURL(new Blob([s],{type:"application/javascript"}));return new R(i,()=>{const l=new Worker(a);return W(l,o,r.url)})}):this._modulePromise=r.wasmBinaryPromise.then(async o=>{if(!this._isModuleAvailable()&&!t.jsModule){if(!r.url)throw new Error("Draco codec module is not available");await A.LoadBabylonScriptAsync(r.url)}return await this._createModuleAsync(o,t.jsModule)})}async whenReadyAsync(){if(this._workerPoolPromise){await this._workerPoolPromise;return}if(this._modulePromise){await this._modulePromise;return}}dispose(){this._workerPoolPromise&&this._workerPoolPromise.then(t=>{t.dispose()}),delete this._workerPoolPromise,delete this._modulePromise}}class p extends H{static get DefaultAvailable(){return $(p.DefaultConfiguration)}static get Default(){return p._Default??(p._Default=new p),p._Default}static ResetDefault(t){p._Default&&(t||p._Default.dispose(),p._Default=null)}_isModuleAvailable(){return typeof DracoDecoderModule<"u"}async _createModuleAsync(t,n){return{module:await(n||DracoDecoderModule)({wasmBinary:t})}}_getWorkerContent(){return`${I}(${S})()`}constructor(t=p.DefaultConfiguration){super(t)}decodeMeshToMeshDataAsync(t,n,i){const f=t instanceof ArrayBuffer?new Int8Array(t):new Int8Array(t.buffer,t.byteOffset,t.byteLength),e=(r,o)=>i&&i[r]!==void 0?(o!==i[r]&&v.Warn(`Normalized flag from Draco data (${o}) does not match normalized flag from glTF accessor (${i[r]}). Using flag from glTF accessor.`),i[r]):o;if(this._workerPoolPromise)return this._workerPoolPromise.then(async r=>await new Promise((o,s)=>{r.push((a,l)=>{let _=null;const b=[],d=h=>{a.removeEventListener("error",d),a.removeEventListener("message",m),s(h),l()},m=h=>{const u=h.data;switch(u.id){case"indices":{_=u.data;break}case"attribute":{b.push({kind:u.kind,data:u.data,size:u.size,byteOffset:u.byteOffset,byteStride:u.byteStride,normalized:e(u.kind,u.normalized)});break}case"decodeMeshDone":{a.removeEventListener("error",d),a.removeEventListener("message",m),o({indices:_,attributes:b,totalVertices:u.totalVertices}),l();break}}};a.addEventListener("error",d),a.addEventListener("message",m);const y=f.slice();a.postMessage({id:"decodeMesh",dataView:y,attributes:n},[y.buffer])})}));if(this._modulePromise)return this._modulePromise.then(r=>{let o=null;const s=[],a=I(r.module,f,n,l=>{o=l},(l,_,b,d,m,y)=>{s.push({kind:l,data:_,size:b,byteOffset:d,byteStride:m,normalized:y})});return{indices:o,attributes:s,totalVertices:a}});throw new Error("Draco decoder module is not available")}async decodeMeshToGeometryAsync(t,n,i,f){const e=await this.decodeMeshToMeshDataAsync(i,f),r=new M(t,n);e.indices&&r.setIndices(e.indices);for(const o of e.attributes)r.setVerticesBuffer(new w(n.getEngine(),o.data,o.kind,!1,void 0,o.byteStride,void 0,o.byteOffset,o.size,void 0,o.normalized,!0),e.totalVertices);return r}async _decodeMeshToGeometryForGltfAsync(t,n,i,f,e,r){const o=await this.decodeMeshToMeshDataAsync(i,f,e),s=new M(t,n);r&&(s._boundingInfo=r,s.useBoundingInfoFromGeometry=!0),o.indices&&s.setIndices(o.indices);for(const a of o.attributes)s.setVerticesBuffer(new w(n.getEngine(),a.data,a.kind,!1,void 0,a.byteStride,void 0,a.byteOffset,a.size,void 0,a.normalized,!0),o.totalVertices);return s}}p.DefaultConfiguration={wasmUrl:`${A._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,wasmBinaryUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.wasm`,fallbackUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.js`};p._Default=null;const E="KHR_draco_mesh_compression";class z{constructor(t){this.name=E,this.useNormalizedFlagFromAccessor=!0,this._loader=t,this.enabled=p.DefaultAvailable&&this._loader.isExtensionUsed(E)}dispose(){delete this.dracoDecoder,this._loader=null}_loadVertexDataAsync(t,n,i){return F.LoadExtensionAsync(t,n,this.name,async(f,e)=>{if(n.mode!=null&&n.mode!==4&&n.mode!==5)throw new Error(`${t}: Unsupported mode ${n.mode}`);const r={},o={},s=(l,_)=>{const b=e.attributes[l];if(b!=null&&(i._delayInfo=i._delayInfo||[],i._delayInfo.indexOf(_)===-1&&i._delayInfo.push(_),r[_]=b,this.useNormalizedFlagFromAccessor)){const d=D.TryGet(this._loader.gltf.accessors,n.attributes[l]);d&&(o[_]=d.normalized||!1)}};s("POSITION",w.PositionKind),s("NORMAL",w.NormalKind),s("TANGENT",w.TangentKind),s("TEXCOORD_0",w.UVKind),s("TEXCOORD_1",w.UV2Kind),s("TEXCOORD_2",w.UV3Kind),s("TEXCOORD_3",w.UV4Kind),s("TEXCOORD_4",w.UV5Kind),s("TEXCOORD_5",w.UV6Kind),s("JOINTS_0",w.MatricesIndicesKind),s("WEIGHTS_0",w.MatricesWeightsKind),s("COLOR_0",w.ColorKind);const a=D.Get(f,this._loader.gltf.bufferViews,e.bufferView);return a._dracoBabylonGeometry||(a._dracoBabylonGeometry=this._loader.loadBufferViewAsync(`/bufferViews/${a.index}`,a).then(async l=>{const _=this.dracoDecoder||p.Default,b=D.TryGet(this._loader.gltf.accessors,n.attributes.POSITION),d=!this._loader.parent.alwaysComputeBoundingBox&&!i.skeleton&&b?N(b):null;return await _._decodeMeshToGeometryForGltfAsync(i.name,this._loader.babylonScene,l,r,o,d).catch(m=>{throw new Error(`${t}: ${m.message}`)})})),await a._dracoBabylonGeometry})}}V(E);k(E,!0,c=>new z(c));export{z as KHR_draco_mesh_compression}; diff --git a/assets/KHR_interactivity-DnpPVqY7.js b/assets/KHR_interactivity-BbXH6jPr.js similarity index 84% rename from assets/KHR_interactivity-DnpPVqY7.js rename to assets/KHR_interactivity-BbXH6jPr.js index df24cd540bef7b39d3e9b770cfd71fd5e82d6766..2807e2ec10f4b3655ada61c8477c18ea879fdebc 100644 --- a/assets/KHR_interactivity-DnpPVqY7.js +++ b/assets/KHR_interactivity-BbXH6jPr.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./flowGraphPlayAnimationBlock-BYGPLYtZ.js","./declarationMapper--DEn7iYN.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./animationGroup-R6N9NYXv.js","./bone-CnpD8dWY.js","./objectModelMapping-CpTIXcMS.js","./flowGraphStopAnimationBlock-BECrV18a.js","./flowGraphPauseAnimationBlock-CF3wQXZ2.js","./flowGraphInterpolationBlock-C2GVXWth.js","./flowGraphSceneReadyEventBlock-BwcOTioF.js","./flowGraphSceneTickEventBlock-DpbQfpZL.js","./flowGraphSendCustomEventBlock-COjyDDOI.js","./flowGraphReceiveCustomEventBlock-BQt26_dH.js","./flowGraphMeshPickEventBlock-BO0FoK9f.js","./flowGraphMathBlocks-WHnmoWh_.js","./flowGraphBinaryOperationBlock-BCZdn6kI.js","./flowGraphCachedOperationBlock-C58XZTsG.js","./flowGraphUnaryOperationBlock-DezHCHpH.js","./flowGraphVectorMathBlocks-9N0EGpm7.js","./flowGraphMatrixMathBlocks-BLgu0Sgs.js","./flowGraphBranchBlock-mWauQRgm.js","./flowGraphSetDelayBlock-CgKyoSr_.js","./flowGraphCancelDelayBlock-KXl3XqBI.js","./flowGraphCounterBlock-xyxrrdpZ.js","./flowGraphDebounceBlock-DFfy7WVS.js","./flowGraphThrottleBlock-DvCQTEiE.js","./flowGraphDoNBlock-BUmWFhhp.js","./flowGraphFlipFlopBlock-C2r0gT8W.js","./flowGraphForLoopBlock-B4q8-wMR.js","./flowGraphMultiGateBlock-BrH1iWnE.js","./flowGraphSequenceBlock-CsGWl_9B.js","./flowGraphSwitchBlock-Bvo_J2Tt.js","./flowGraphWaitAllBlock-CkaEjrg9.js","./flowGraphWhileLoopBlock-JYaXEXT9.js","./flowGraphConsoleLogBlock-x-M88RVd.js","./flowGraphConditionalDataBlock-C46R1Z3F.js","./flowGraphConstantBlock-DTYr_13D.js","./flowGraphTransformCoordinatesSystemBlock-Cdsh0cBZ.js","./flowGraphGetAssetBlock-BH52hwPP.js","./flowGraphGetPropertyBlock-Ar6QWCqC.js","./flowGraphSetPropertyBlock-zywlahU1.js","./flowGraphGetVariableBlock-BmI0H3Mo.js","./flowGraphSetVariableBlock-CHJ2f_VB.js","./flowGraphJsonPointerParserBlock-CbgFrsq4.js","./flowGraphMathCombineExtractBlocks-BLZz5aaG.js","./flowGraphTypeToTypeBlocks-CdqQYaY1.js","./flowGraphEasingBlock-D2uwp4dD.js","./flowGraphBezierCurveEasingBlock-Dhfe3xNk.js","./flowGraphPointerOverEventBlock-DBLNmcpf.js","./flowGraphPointerOutEventBlock-zex71JkY.js","./flowGraphContextBlock-Bd-M1lOa.js","./flowGraphArrayIndexBlock-DmxisnJu.js","./flowGraphCodeExecutionBlock-DtgT7ugb.js","./flowGraphIndexOfBlock-1sUrEqt1.js","./flowGraphFunctionReferenceBlock-BEE10xFF.js","./flowGraphDataSwitchBlock-D46Djwq4.js","./flowGraphGLTFDataProvider-6e5hvgTT.js"])))=>i.map(i=>d[i]); -import{af as n}from"./index-DydPgVMC.js";import{M as et,ah as ot,V as Q,ai as rt,ao as R,C as at,b9 as nt,L as p,h as I,O,_ as it,s as st,R as J,aQ as q,aG as lt,aH as ct}from"./index-GY9JDBGV.js";import{n as ut,p as pt,F as ht,g as _t,r as wt,s as $}from"./declarationMapper--DEn7iYN.js";import{G as dt,A as E}from"./objectModelMapping-CpTIXcMS.js";function mt(r){return r==="Mesh"||r==="AbstractMesh"||r==="GroundMesh"||r==="InstanceMesh"||r==="LinesMesh"||r==="GoldbergMesh"||r==="GreasedLineMesh"||r==="TrailMesh"}function Z(r){return r==="Vector2"||r==="Vector3"||r==="Vector4"||r==="Quaternion"||r==="Color3"||r==="Color4"}function ft(r){return r==="Matrix"||r==="Matrix2D"||r==="Matrix3D"}function yt(r){return r==="AnimationGroup"}function gt(r,t,e=!1){if(r==="Vector2")return ot.FromArray(t);if(r==="Vector3")return e&&(t[2]*=-1),Q.FromArray(t);if(r==="Vector4")return rt.FromArray(t);if(r==="Quaternion")return e&&(t[2]*=-1,t[3]*=-1),R.FromArray(t);if(r==="Color3")return new at(t[0],t[1],t[2]);if(r==="Color4")return new nt(t[0],t[1],t[2],t[3]);throw new Error(`Unknown vector class name ${r}`)}function M(r,t,e){const o=t?.getClassName?.()??"";if(Z(o)||ft(o))e[r]={value:t.asArray(),className:o};else if(o==="FlowGraphInteger")e[r]={value:t.value,className:o};else if(o&&(t.id||t.name))e[r]={id:t.id,name:t.name,className:o};else if(typeof t!="object")e[r]=t;else throw new Error(`Could not serialize value ${t}`)}function x(r,t,e,o){const a=t[r];let i;const s=a?.type??a?.className;if(mt(s)){let c=o.meshes.filter(l=>a.id?l.id===a.id:l.name===a.name);c.length===0&&(c=o.transformNodes.filter(l=>a.id?l.id===a.id:l.name===a.name)),i=a.uniqueId?c.find(l=>l.uniqueId===a.uniqueId):c[0]}else if(Z(s))i=gt(s,a.value);else if(yt(s)){const c=o.animationGroups.filter(l=>l.name===a.name);i=c.length===1?c[0]:c.find(l=>l.uniqueId===a.uniqueId)}else s==="Matrix"?i=et.FromArray(a.value):s==="Matrix2D"?i=new ut(a.value):s==="Matrix3D"?i=new pt(a.value):s==="FlowGraphInteger"?i=ht.FromValue(a.value):s==="number"||s==="string"||s==="boolean"?i=a.value[0]:a&&a.value!==void 0?i=a.value:Array.isArray(a)?i=a.reduce((c,l)=>(l.eventData&&(c[l.id]={type:_t(l.type)},typeof l.value<"u"&&(c[l.id].value=x("value",l,e,o))),c),{}):i=a;return i}function kt(r){return r==="FlowGraphJsonPointerParserBlock"}var K;(function(r){r.Animation="Animation",r.AnimationGroup="AnimationGroup",r.Mesh="Mesh",r.Material="Material",r.Camera="Camera",r.Light="Light"})(K||(K={}));function Gt(r,t,e,o){switch(t){case"Animation":return o?r.animations.find(a=>a.uniqueId===e)??null:r.animations[e]??null;case"AnimationGroup":return o?r.animationGroups.find(a=>a.uniqueId===e)??null:r.animationGroups[e]??null;case"Mesh":return o?r.meshes.find(a=>a.uniqueId===e)??null:r.meshes[e]??null;case"Material":return o?r.materials.find(a=>a.uniqueId===e)??null:r.materials[e]??null;case"Camera":return o?r.cameras.find(a=>a.uniqueId===e)??null:r.cameras[e]??null;case"Light":return o?r.lights.find(a=>a.uniqueId===e)??null:r.lights[e]??null;default:return null}}var W;(function(r){r.ExecuteBlock="ExecuteBlock",r.ExecuteEvent="ExecuteEvent",r.TriggerConnection="TriggerConnection",r.ContextVariableSet="ContextVariableSet",r.GlobalVariableSet="GlobalVariableSet",r.GlobalVariableDelete="GlobalVariableDelete",r.GlobalVariableGet="GlobalVariableGet",r.AddConnection="AddConnection",r.GetConnectionValue="GetConnectionValue",r.SetConnectionValue="SetConnectionValue",r.ActivateSignal="ActivateSignal",r.ContextVariableGet="ContextVariableGet"})(W||(W={}));class Bt{constructor(){this.logToConsole=!1,this.log=[]}addLogItem(t){if(t.time||(t.time=Date.now()),this.log.push(t),this.logToConsole){const e=t.payload?.value;typeof e=="object"&&e.getClassName?p.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(e.getClassName())}: ${e.toString()}`):p.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(t.payload)}`)}}getItemsOfType(t){return this.log.filter(e=>e.action===t)}}class X{get enableLogging(){return this._enableLogging}set enableLogging(t){this._enableLogging!==t&&(this._enableLogging=t,this._enableLogging?(this.logger=new Bt,this.logger.logToConsole=!0):this.logger=null)}constructor(t){this.uniqueId=I(),this._userVariables={},this._executionVariables={},this._globalContextVariables={},this._connectionValues={},this._pendingBlocks=[],this._executionId=0,this.onNodeExecutedObservable=new O,this.treatDataAsRightHanded=!1,this._enableLogging=!1,this._configuration=t,this.assetsContext=t.assetsContext??t.scene}hasVariable(t){return t in this._userVariables}setVariable(t,e){this._userVariables[t]=e,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableSet",payload:{name:t,value:e}})}getAsset(t,e){return Gt(this.assetsContext,t,e)}getVariable(t){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableGet",payload:{name:t,value:this._userVariables[t]}}),this._userVariables[t]}get userVariables(){return this._userVariables}getScene(){return this._configuration.scene}_getUniqueIdPrefixedName(t,e){return`${t.uniqueId}_${e}`}_getGlobalContextVariable(t,e){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableGet",payload:{name:t,defaultValue:e,possibleValue:this._globalContextVariables[t]}}),this._hasGlobalContextVariable(t)?this._globalContextVariables[t]:e}_setGlobalContextVariable(t,e){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableSet",payload:{name:t,value:e}}),this._globalContextVariables[t]=e}_deleteGlobalContextVariable(t){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableDelete",payload:{name:t}}),delete this._globalContextVariables[t]}_hasGlobalContextVariable(t){return t in this._globalContextVariables}_setExecutionVariable(t,e,o){this._executionVariables[this._getUniqueIdPrefixedName(t,e)]=o}_getExecutionVariable(t,e,o){return this._hasExecutionVariable(t,e)?this._executionVariables[this._getUniqueIdPrefixedName(t,e)]:o}_deleteExecutionVariable(t,e){delete this._executionVariables[this._getUniqueIdPrefixedName(t,e)]}_hasExecutionVariable(t,e){return this._getUniqueIdPrefixedName(t,e)in this._executionVariables}_hasConnectionValue(t){return t.uniqueId in this._connectionValues}_setConnectionValue(t,e){this._connectionValues[t.uniqueId]=e,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"SetConnectionValue",payload:{connectionPointId:t.uniqueId,value:e}})}_setConnectionValueByKey(t,e){this._connectionValues[t]=e}_getConnectionValue(t){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GetConnectionValue",payload:{connectionPointId:t.uniqueId,value:this._connectionValues[t.uniqueId]}}),this._connectionValues[t.uniqueId]}get configuration(){return this._configuration}get hasPendingBlocks(){return this._pendingBlocks.length>0}_addPendingBlock(t){this._pendingBlocks.includes(t)||(this._pendingBlocks.push(t),this._pendingBlocks.sort((e,o)=>e.priority-o.priority))}_removePendingBlock(t){const e=this._pendingBlocks.indexOf(t);e!==-1&&this._pendingBlocks.splice(e,1)}_clearPendingBlocks(){for(const t of this._pendingBlocks)t._cancelPendingTasks(this);this._pendingBlocks.length=0}_notifyExecuteNode(t){this.onNodeExecutedObservable.notifyObservers(t),this.logger?.addLogItem({time:Date.now(),className:t.getClassName(),uniqueId:t.uniqueId,action:"ExecuteBlock"})}_notifyOnTick(t){this._setGlobalContextVariable("timeSinceStart",t.timeSinceStart),this._setGlobalContextVariable("deltaTime",t.deltaTime);for(const e of this._pendingBlocks)e._executeOnTick?.(this)}_increaseExecutionId(){this._executionId++}get executionId(){return this._executionId}serialize(t={},e=M){t.uniqueId=this.uniqueId,t._userVariables={};for(const o in this._userVariables)e(o,this._userVariables[o],t._userVariables);t._connectionValues={};for(const o in this._connectionValues)e(o,this._connectionValues[o],t._connectionValues);this.assetsContext!==this.getScene()&&(t._assetsContext={meshes:this.assetsContext.meshes.map(o=>o.id),materials:this.assetsContext.materials.map(o=>o.id),textures:this.assetsContext.textures.map(o=>o.name),animations:this.assetsContext.animations.map(o=>o.name),lights:this.assetsContext.lights.map(o=>o.id),cameras:this.assetsContext.cameras.map(o=>o.id),sounds:this.assetsContext.sounds?.map(o=>o.name),skeletons:this.assetsContext.skeletons.map(o=>o.id),particleSystems:this.assetsContext.particleSystems.map(o=>o.name),geometries:this.assetsContext.geometries.map(o=>o.id),multiMaterials:this.assetsContext.multiMaterials.map(o=>o.id),transformNodes:this.assetsContext.transformNodes.map(o=>o.id)})}getClassName(){return"FlowGraphContext"}}it([st()],X.prototype,"uniqueId",void 0);var U;(function(r){r[r.Input=0]="Input",r[r.Output=1]="Output"})(U||(U={}));class Y{constructor(t,e,o){this._ownerBlock=o,this._connectedPoint=[],this.uniqueId=I(),this.connectedPointIds=[],this.name=t,this._connectionType=e}get connectionType(){return this._connectionType}_isSingularConnection(){return!0}isConnected(){return this._connectedPoint.length>0}connectTo(t){if(this._connectionType===t._connectionType)throw new Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||t._isSingularConnection()&&t._connectedPoint.length>0)throw new Error("Max number of connections for point reached");this._connectedPoint.push(t),t._connectedPoint.push(this)}disconnectFrom(t,e=!0){const o=this._connectedPoint.indexOf(t),a=t._connectedPoint.indexOf(this);o===-1||a===-1||(e&&this._connectedPoint.splice(o,1),t._connectedPoint.splice(a,1))}disconnectFromAll(){for(const t of this._connectedPoint)this.disconnectFrom(t,!1);this._connectedPoint.length=0}dispose(){for(const t of this._connectedPoint)this.disconnectFrom(t)}serialize(t={}){t.uniqueId=this.uniqueId,t.name=this.name,t._connectionType=this._connectionType,t.connectedPointIds=[],t.className=this.getClassName();for(const e of this._connectedPoint)t.connectedPointIds.push(e.uniqueId)}getClassName(){return"FGConnection"}deserialize(t){this.uniqueId=t.uniqueId,this.name=t.name,this._connectionType=t._connectionType,this.connectedPointIds=t.connectedPointIds}}class L extends Y{constructor(t,e,o,a,i=a.defaultValue,s=!1){super(t,e,o),this.richType=a,this._defaultValue=i,this._optional=s,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new O}get optional(){return this._optional}get isDisabled(){return this._isDisabled}set isDisabled(t){this._isDisabled!==t&&(this._isDisabled=t,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){return this.connectionType===0}setValue(t,e){e._getConnectionValue(this)!==t&&(e._setConnectionValue(this,t),this.onValueChangedObservable.notifyObservers(t))}resetToDefaultValue(t){t._setConnectionValue(this,this._defaultValue)}connectTo(t){this._isDisabled||super.connectTo(t)}_getValueOrDefault(t){const e=t._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(e):e}getValue(t){if(this.connectionType===1){t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(t);const o=this._getValueOrDefault(t);return this._lastValue=o,this.richType.typeTransformer?this.richType.typeTransformer(o):o}const e=this.isConnected()?this._connectedPoint[0].getValue(t):this._getValueOrDefault(t);return this._lastValue=e,this.richType.typeTransformer?this.richType.typeTransformer(e):e}_getLastValue(){return this._lastValue}getClassName(){return"FlowGraphDataConnection"}serialize(t={}){super.serialize(t),t.richType={},this.richType.serialize(t.richType),t.optional=this._optional,M("defaultValue",this._defaultValue,t)}}J("FlowGraphDataConnection",L);class Ft{constructor(t){this.config=t,this.uniqueId=I(),this.name=this.config?.name??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(t){}registerDataInput(t,e,o){const a=new L(t,0,this,e,o);return this.dataInputs.push(a),a}registerDataOutput(t,e,o){const a=new L(t,1,this,e,o);return this.dataOutputs.push(a),a}getDataInput(t){return this.dataInputs.find(e=>e.name===t)}getDataOutput(t){return this.dataOutputs.find(e=>e.name===t)}serialize(t={},e=M){if(t.uniqueId=this.uniqueId,t.config={},this.config){const o=this.config,a=Object.keys(o);for(const i of a)e(i,o[i],t.config)}t.dataInputs=[],t.dataOutputs=[],t.className=this.getClassName();for(const o of this.dataInputs){const a={};o.serialize(a),t.dataInputs.push(a)}for(const o of this.dataOutputs){const a={};o.serialize(a),t.dataOutputs.push(a)}}deserialize(t){}_log(t,e,o){t.logger?.addLogItem({action:e,payload:o,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){return"FlowGraphBlock"}}class S extends Y{constructor(){super(...arguments),this.priority=0}_isSingularConnection(){return!1}connectTo(t){super.connectTo(t),this._connectedPoint.sort((e,o)=>o.priority-e.priority)}_activateSignal(t){if(t.logger?.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),this.connectionType===0)t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._execute(t,this),t._increaseExecutionId();else for(const e of this._connectedPoint)e._activateSignal(t)}}J("FlowGraphSignalConnection",S);class D extends Ft{constructor(t){super(t),this.priority=0,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(t){const e=new S(t,0,this);return this.signalInputs.push(e),e}_registerSignalOutput(t){const e=new S(t,1,this);return this.signalOutputs.push(e),e}_unregisterSignalInput(t){const e=this.signalInputs.findIndex(o=>o.name===t);e!==-1&&(this.signalInputs[e].dispose(),this.signalInputs.splice(e,1))}_unregisterSignalOutput(t){const e=this.signalOutputs.findIndex(o=>o.name===t);e!==-1&&(this.signalOutputs[e].dispose(),this.signalOutputs.splice(e,1))}_reportError(t,e){this.error.payload=typeof e=="string"?new Error(e):e,this.error._activateSignal(t)}getSignalInput(t){return this.signalInputs.find(e=>e.name===t)}getSignalOutput(t){return this.signalOutputs.find(e=>e.name===t)}serialize(t={}){super.serialize(t),t.signalInputs=[],t.signalOutputs=[];for(const e of this.signalInputs){const o={};e.serialize(o),t.signalInputs.push(o)}for(const e of this.signalOutputs){const o={};e.serialize(o),t.signalOutputs.push(o)}}deserialize(t){for(let e=0;e{this.sceneReadyTriggered||(this.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}),this.sceneReadyTriggered=!0)}),this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{this.onEventTriggeredObservable.notifyObservers({type:"SceneDispose"})}),this._sceneOnBeforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{const t=this._scene.getEngine().getDeltaTime()/1e3;this.onEventTriggeredObservable.notifyObservers({type:"SceneBeforeRender",payload:{timeSinceStart:this._startingTime,deltaTime:t}}),this._startingTime+=t}),this._meshPickedObserver=this._scene.onPointerObservable.add(t=>{this.onEventTriggeredObservable.notifyObservers({type:"MeshPick",payload:t})},q.POINTERPICK),this._meshUnderPointerObserver=this._scene.onMeshUnderPointerUpdatedObservable.add(t=>{const e=t.pointerId,o=t.mesh,a=this._pointerUnderMeshState[e];!a&&o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o}}):a&&!o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:a}}):a&&o&&a!==o&&(this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:a,over:o}}),this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o,out:a}})),this._pointerUnderMeshState[e]=o},q.POINTERMOVE)}dispose(){this._sceneDisposeObserver?.remove(),this._sceneReadyObserver?.remove(),this._sceneOnBeforeRenderObserver?.remove(),this._meshPickedObserver?.remove(),this._meshUnderPointerObserver?.remove(),this.onEventTriggeredObservable.clear()}}function z(r,t){return!!(r.parent&&(r.parent===t||z(r.parent,t)))}function Wt(r){if(r.getClassName)return r.getClassName()}function Ut(r,t){return r===t&&(r==="Vector2"||r==="Vector3"||r==="Vector4"||r==="Quaternion")}function Ht(r,t){return r===t&&(r==="Matrix"||r==="Matrix2D"||r==="Matrix3D")}function Qt(r,t){return r==="FlowGraphInteger"&&t==="FlowGraphInteger"}function Jt(r,t){const e=typeof r=="number"||typeof r?.value=="number";return e&&!t?!isNaN(vt(r)):e}function vt(r){return typeof r=="number"?r:r.value}var H;(function(r){r[r.Stopped=0]="Stopped",r[r.Started=1]="Started"})(H||(H={}));class It{get state(){return this._state}set state(t){this._state=t,this.onStateChangedObservable.notifyObservers(t)}constructor(t){this.onStateChangedObservable=new O,this._eventBlocks={SceneReady:[],SceneDispose:[],SceneBeforeRender:[],MeshPick:[],PointerDown:[],PointerUp:[],PointerMove:[],PointerOver:[],PointerOut:[],SceneAfterRender:[],NoTrigger:[]},this._executionContexts=[],this._state=0,this._scene=t.scene,this._sceneEventCoordinator=new Et(this._scene),this._coordinator=t.coordinator,this._eventObserver=this._sceneEventCoordinator.onEventTriggeredObservable.add(e=>{for(const o of this._executionContexts){const a=this._getContextualOrder(e.type,o);for(const i of a)if(!i._executeEvent(o,e.payload))break}switch(e.type){case"SceneReady":this._sceneEventCoordinator.sceneReadyTriggered=!0;break;case"SceneBeforeRender":for(const o of this._executionContexts)o._notifyOnTick(e.payload);break;case"SceneDispose":this.dispose();break}})}createContext(){const t=new X({scene:this._scene,coordinator:this._coordinator});return this._executionContexts.push(t),t}getContext(t){return this._executionContexts[t]}addEventBlock(t){if((t.type==="PointerOver"||t.type==="PointerOut")&&(this._scene.constantlyUpdateMeshUnderPointer=!0),t.type!=="NoTrigger"&&this._eventBlocks[t.type].push(t),this.state===1)for(const e of this._executionContexts)t._startPendingTasks(e);else this.onStateChangedObservable.addOnce(e=>{if(e===1)for(const o of this._executionContexts)t._startPendingTasks(o)})}start(){this.state!==1&&(this._executionContexts.length===0&&this.createContext(),this.onStateChangedObservable.add(t=>{t===1&&(this._startPendingEvents(),this._scene.isReady(!0)&&this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}))}),this.state=1)}_startPendingEvents(){for(const t of this._executionContexts)for(const e in this._eventBlocks){const o=this._getContextualOrder(e,t);for(const a of o)a._startPendingTasks(t)}}_getContextualOrder(t,e){const o=this._eventBlocks[t].sort((a,i)=>i.initPriority-a.initPriority);if(t==="MeshPick"){const a=[];for(const i of o){const s=i.asset.getValue(e);let c=0;for(;c0;){const a=e.pop();t(a);for(const i of a.dataInputs)for(const s of i._connectedPoint)o.has(s._ownerBlock.uniqueId)||(e.push(s._ownerBlock),o.add(s._ownerBlock.uniqueId));if(a instanceof D)for(const i of a.signalOutputs)for(const s of i._connectedPoint)o.has(s._ownerBlock.uniqueId)||(e.push(s._ownerBlock),o.add(s._ownerBlock.uniqueId))}}serialize(t={},e){t.allBlocks=[],this.visitAllBlocks(o=>{const a={};o.serialize(a),t.allBlocks.push(a)}),t.executionContexts=[];for(const o of this._executionContexts){const a={};o.serialize(a,e),t.executionContexts.push(a)}}}class g{constructor(t){this.config=t,this.dispatchEventsSynchronously=!0,this._flowGraphs=[],this._customEventsMap=new Map,this._eventExecutionCounter=new Map,this._executeOnNextFrame=[],this._eventUniqueId=0,this._disposeObserver=this.config.scene.onDisposeObservable.add(()=>{this.dispose()}),this._onBeforeRenderObserver=this.config.scene.onBeforeRenderObservable.add(()=>{this._eventExecutionCounter.clear();const o=this._executeOnNextFrame.slice(0);if(o.length)for(const a of o){this.notifyCustomEvent(a.id,a.data,!1);const i=this._executeOnNextFrame.findIndex(s=>s.uniqueId===a.uniqueId);i!==-1&&this._executeOnNextFrame.splice(i,1)}}),(g.SceneCoordinators.get(this.config.scene)??[]).push(this)}createGraph(){const t=new It({scene:this.config.scene,coordinator:this});return this._flowGraphs.push(t),t}removeGraph(t){const e=this._flowGraphs.indexOf(t);e!==-1&&(t.dispose(),this._flowGraphs.splice(e,1))}start(){for(const t of this._flowGraphs)t.start()}dispose(){for(const o of this._flowGraphs)o.dispose();this._flowGraphs.length=0,this._disposeObserver?.remove(),this._onBeforeRenderObserver?.remove();const t=g.SceneCoordinators.get(this.config.scene)??[],e=t.indexOf(this);e!==-1&&t.splice(e,1)}serialize(t,e){t._flowGraphs=[];for(const o of this._flowGraphs){const a={};o.serialize(a,e),t._flowGraphs.push(a)}t.dispatchEventsSynchronously=this.dispatchEventsSynchronously}get flowGraphs(){return this._flowGraphs}getCustomEventObservable(t){let e=this._customEventsMap.get(t);return e||(e=new O,this._customEventsMap.set(t,e)),e}notifyCustomEvent(t,e,o=!this.dispatchEventsSynchronously){if(o){this._executeOnNextFrame.push({id:t,data:e,uniqueId:this._eventUniqueId++});return}if(this._eventExecutionCounter.has(t)){const i=this._eventExecutionCounter.get(t);if(this._eventExecutionCounter.set(t,i+1),i>=g.MaxEventTypeExecutionPerFrame){i===g.MaxEventTypeExecutionPerFrame&&p.Warn(`FlowGraphCoordinator: Too many executions of event "${t}".`);return}}else this._eventExecutionCounter.set(t,1);const a=this._customEventsMap.get(t);a&&a.notifyObservers(e)}}g.MaxEventsPerType=30;g.MaxEventTypeExecutionPerFrame=30;g.SceneCoordinators=new Map;const N={};function Tt(r,t,e){N[`${r}/${t}`]=e}function Vt(r){switch(r){case"FlowGraphPlayAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphPlayAnimationBlock:t}=await import("./flowGraphPlayAnimationBlock-BYGPLYtZ.js");return{FlowGraphPlayAnimationBlock:t}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).FlowGraphPlayAnimationBlock;case"FlowGraphStopAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphStopAnimationBlock:t}=await import("./flowGraphStopAnimationBlock-BECrV18a.js");return{FlowGraphStopAnimationBlock:t}},__vite__mapDeps([8,1,2,3,4,7]),import.meta.url)).FlowGraphStopAnimationBlock;case"FlowGraphPauseAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphPauseAnimationBlock:t}=await import("./flowGraphPauseAnimationBlock-CF3wQXZ2.js");return{FlowGraphPauseAnimationBlock:t}},__vite__mapDeps([9,1,2,3,4,7]),import.meta.url)).FlowGraphPauseAnimationBlock;case"FlowGraphInterpolationBlock":return async()=>(await n(async()=>{const{FlowGraphInterpolationBlock:t}=await import("./flowGraphInterpolationBlock-C2GVXWth.js");return{FlowGraphInterpolationBlock:t}},__vite__mapDeps([10,1,2,3,4,7]),import.meta.url)).FlowGraphInterpolationBlock;case"FlowGraphSceneReadyEventBlock":return async()=>(await n(async()=>{const{FlowGraphSceneReadyEventBlock:t}=await import("./flowGraphSceneReadyEventBlock-BwcOTioF.js");return{FlowGraphSceneReadyEventBlock:t}},__vite__mapDeps([11,2,3,4,1,7]),import.meta.url)).FlowGraphSceneReadyEventBlock;case"FlowGraphSceneTickEventBlock":return async()=>(await n(async()=>{const{FlowGraphSceneTickEventBlock:t}=await import("./flowGraphSceneTickEventBlock-DpbQfpZL.js");return{FlowGraphSceneTickEventBlock:t}},__vite__mapDeps([12,2,3,4,1,7]),import.meta.url)).FlowGraphSceneTickEventBlock;case"FlowGraphSendCustomEventBlock":return async()=>(await n(async()=>{const{FlowGraphSendCustomEventBlock:t}=await import("./flowGraphSendCustomEventBlock-COjyDDOI.js");return{FlowGraphSendCustomEventBlock:t}},__vite__mapDeps([13,2,3,4,1,7]),import.meta.url)).FlowGraphSendCustomEventBlock;case"FlowGraphReceiveCustomEventBlock":return async()=>(await n(async()=>{const{FlowGraphReceiveCustomEventBlock:t}=await import("./flowGraphReceiveCustomEventBlock-BQt26_dH.js");return{FlowGraphReceiveCustomEventBlock:t}},__vite__mapDeps([14,2,3,4,1,7]),import.meta.url)).FlowGraphReceiveCustomEventBlock;case"FlowGraphMeshPickEventBlock":return async()=>(await n(async()=>{const{FlowGraphMeshPickEventBlock:t}=await import("./flowGraphMeshPickEventBlock-BO0FoK9f.js");return{FlowGraphMeshPickEventBlock:t}},__vite__mapDeps([15,2,3,4,1,7]),import.meta.url)).FlowGraphMeshPickEventBlock;case"FlowGraphEBlock":return async()=>(await n(async()=>{const{FlowGraphEBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphEBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphEBlock;case"FlowGraphPIBlock":return async()=>(await n(async()=>{const{FlowGraphPiBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphPiBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphPiBlock;case"FlowGraphInfBlock":return async()=>(await n(async()=>{const{FlowGraphInfBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphInfBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphInfBlock;case"FlowGraphNaNBlock":return async()=>(await n(async()=>{const{FlowGraphNaNBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphNaNBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphNaNBlock;case"FlowGraphRandomBlock":return async()=>(await n(async()=>{const{FlowGraphRandomBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphRandomBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRandomBlock;case"FlowGraphAddBlock":return async()=>(await n(async()=>{const{FlowGraphAddBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAddBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAddBlock;case"FlowGraphSubtractBlock":return async()=>(await n(async()=>{const{FlowGraphSubtractBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSubtractBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSubtractBlock;case"FlowGraphMultiplyBlock":return async()=>(await n(async()=>{const{FlowGraphMultiplyBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphMultiplyBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMultiplyBlock;case"FlowGraphDivideBlock":return async()=>(await n(async()=>{const{FlowGraphDivideBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphDivideBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphDivideBlock;case"FlowGraphAbsBlock":return async()=>(await n(async()=>{const{FlowGraphAbsBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAbsBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAbsBlock;case"FlowGraphSignBlock":return async()=>(await n(async()=>{const{FlowGraphSignBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSignBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSignBlock;case"FlowGraphTruncBlock":return async()=>(await n(async()=>{const{FlowGraphTruncBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphTruncBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTruncBlock;case"FlowGraphFloorBlock":return async()=>(await n(async()=>{const{FlowGraphFloorBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphFloorBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphFloorBlock;case"FlowGraphCeilBlock":return async()=>(await n(async()=>{const{FlowGraphCeilBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphCeilBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCeilBlock;case"FlowGraphRoundBlock":return async()=>(await n(async()=>{const{FlowGraphRoundBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphRoundBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRoundBlock;case"FlowGraphFractBlock":return async()=>(await n(async()=>{const{FlowGraphFractionBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphFractionBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphFractionBlock;case"FlowGraphNegationBlock":return async()=>(await n(async()=>{const{FlowGraphNegationBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphNegationBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphNegationBlock;case"FlowGraphModuloBlock":return async()=>(await n(async()=>{const{FlowGraphModuloBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphModuloBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphModuloBlock;case"FlowGraphMinBlock":return async()=>(await n(async()=>{const{FlowGraphMinBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphMinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMinBlock;case"FlowGraphMaxBlock":return async()=>(await n(async()=>{const{FlowGraphMaxBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphMaxBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMaxBlock;case"FlowGraphClampBlock":return async()=>(await n(async()=>{const{FlowGraphClampBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphClampBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphClampBlock;case"FlowGraphSaturateBlock":return async()=>(await n(async()=>{const{FlowGraphSaturateBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSaturateBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSaturateBlock;case"FlowGraphMathInterpolationBlock":return async()=>(await n(async()=>{const{FlowGraphMathInterpolationBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphMathInterpolationBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMathInterpolationBlock;case"FlowGraphEqualityBlock":return async()=>(await n(async()=>{const{FlowGraphEqualityBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphEqualityBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphEqualityBlock;case"FlowGraphLessThanBlock":return async()=>(await n(async()=>{const{FlowGraphLessThanBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLessThanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLessThanBlock;case"FlowGraphLessThanOrEqualBlock":return async()=>(await n(async()=>{const{FlowGraphLessThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLessThanOrEqualBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLessThanOrEqualBlock;case"FlowGraphGreaterThanBlock":return async()=>(await n(async()=>{const{FlowGraphGreaterThanBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphGreaterThanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphGreaterThanBlock;case"FlowGraphGreaterThanOrEqualBlock":return async()=>(await n(async()=>{const{FlowGraphGreaterThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphGreaterThanOrEqualBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphGreaterThanOrEqualBlock;case"FlowGraphIsNaNBlock":return async()=>(await n(async()=>{const{FlowGraphIsNanBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphIsNanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphIsNanBlock;case"FlowGraphIsInfBlock":return async()=>(await n(async()=>{const{FlowGraphIsInfinityBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphIsInfinityBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphIsInfinityBlock;case"FlowGraphDegToRadBlock":return async()=>(await n(async()=>{const{FlowGraphDegToRadBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphDegToRadBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphDegToRadBlock;case"FlowGraphRadToDegBlock":return async()=>(await n(async()=>{const{FlowGraphRadToDegBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphRadToDegBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRadToDegBlock;case"FlowGraphSinBlock":return async()=>(await n(async()=>{const{FlowGraphSinBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSinBlock;case"FlowGraphCosBlock":return async()=>(await n(async()=>{const{FlowGraphCosBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphCosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCosBlock;case"FlowGraphTanBlock":return async()=>(await n(async()=>{const{FlowGraphTanBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphTanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTanBlock;case"FlowGraphASinBlock":return async()=>(await n(async()=>{const{FlowGraphAsinBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAsinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAsinBlock;case"FlowGraphACosBlock":return async()=>(await n(async()=>{const{FlowGraphAcosBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAcosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAcosBlock;case"FlowGraphATanBlock":return async()=>(await n(async()=>{const{FlowGraphAtanBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAtanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtanBlock;case"FlowGraphATan2Block":return async()=>(await n(async()=>{const{FlowGraphAtan2Block:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAtan2Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtan2Block;case"FlowGraphSinhBlock":return async()=>(await n(async()=>{const{FlowGraphSinhBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSinhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSinhBlock;case"FlowGraphCoshBlock":return async()=>(await n(async()=>{const{FlowGraphCoshBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphCoshBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCoshBlock;case"FlowGraphTanhBlock":return async()=>(await n(async()=>{const{FlowGraphTanhBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphTanhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTanhBlock;case"FlowGraphASinhBlock":return async()=>(await n(async()=>{const{FlowGraphAsinhBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAsinhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAsinhBlock;case"FlowGraphACoshBlock":return async()=>(await n(async()=>{const{FlowGraphAcoshBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAcoshBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAcoshBlock;case"FlowGraphATanhBlock":return async()=>(await n(async()=>{const{FlowGraphAtanhBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphAtanhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtanhBlock;case"FlowGraphExponentialBlock":return async()=>(await n(async()=>{const{FlowGraphExpBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphExpBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphExpBlock;case"FlowGraphLogBlock":return async()=>(await n(async()=>{const{FlowGraphLogBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLogBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLogBlock;case"FlowGraphLog2Block":return async()=>(await n(async()=>{const{FlowGraphLog2Block:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLog2Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLog2Block;case"FlowGraphLog10Block":return async()=>(await n(async()=>{const{FlowGraphLog10Block:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLog10Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLog10Block;case"FlowGraphSquareRootBlock":return async()=>(await n(async()=>{const{FlowGraphSquareRootBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphSquareRootBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSquareRootBlock;case"FlowGraphPowerBlock":return async()=>(await n(async()=>{const{FlowGraphPowerBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphPowerBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphPowerBlock;case"FlowGraphCubeRootBlock":return async()=>(await n(async()=>{const{FlowGraphCubeRootBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphCubeRootBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCubeRootBlock;case"FlowGraphBitwiseAndBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseAndBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseAndBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseAndBlock;case"FlowGraphBitwiseOrBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseOrBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseOrBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseOrBlock;case"FlowGraphBitwiseNotBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseNotBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseNotBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseNotBlock;case"FlowGraphBitwiseXorBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseXorBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseXorBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseXorBlock;case"FlowGraphBitwiseLeftShiftBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseLeftShiftBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseLeftShiftBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseLeftShiftBlock;case"FlowGraphBitwiseRightShiftBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseRightShiftBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphBitwiseRightShiftBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseRightShiftBlock;case"FlowGraphLengthBlock":return async()=>(await n(async()=>{const{FlowGraphLengthBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphLengthBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphLengthBlock;case"FlowGraphNormalizeBlock":return async()=>(await n(async()=>{const{FlowGraphNormalizeBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphNormalizeBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphNormalizeBlock;case"FlowGraphDotBlock":return async()=>(await n(async()=>{const{FlowGraphDotBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphDotBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphDotBlock;case"FlowGraphCrossBlock":return async()=>(await n(async()=>{const{FlowGraphCrossBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphCrossBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphCrossBlock;case"FlowGraphRotate2DBlock":return async()=>(await n(async()=>{const{FlowGraphRotate2DBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphRotate2DBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphRotate2DBlock;case"FlowGraphRotate3DBlock":return async()=>(await n(async()=>{const{FlowGraphRotate3DBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphRotate3DBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphRotate3DBlock;case"FlowGraphTransposeBlock":return async()=>(await n(async()=>{const{FlowGraphTransposeBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphTransposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphTransposeBlock;case"FlowGraphDeterminantBlock":return async()=>(await n(async()=>{const{FlowGraphDeterminantBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphDeterminantBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphDeterminantBlock;case"FlowGraphInvertMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphInvertMatrixBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphInvertMatrixBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphInvertMatrixBlock;case"FlowGraphMatrixMultiplicationBlock":return async()=>(await n(async()=>{const{FlowGraphMatrixMultiplicationBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphMatrixMultiplicationBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixMultiplicationBlock;case"FlowGraphBranchBlock":return async()=>(await n(async()=>{const{FlowGraphBranchBlock:t}=await import("./flowGraphBranchBlock-mWauQRgm.js");return{FlowGraphBranchBlock:t}},__vite__mapDeps([22,1,2,3,4,7]),import.meta.url)).FlowGraphBranchBlock;case"FlowGraphSetDelayBlock":return async()=>(await n(async()=>{const{FlowGraphSetDelayBlock:t}=await import("./flowGraphSetDelayBlock-CgKyoSr_.js");return{FlowGraphSetDelayBlock:t}},__vite__mapDeps([23,1,2,3,4,7]),import.meta.url)).FlowGraphSetDelayBlock;case"FlowGraphCancelDelayBlock":return async()=>(await n(async()=>{const{FlowGraphCancelDelayBlock:t}=await import("./flowGraphCancelDelayBlock-KXl3XqBI.js");return{FlowGraphCancelDelayBlock:t}},__vite__mapDeps([24,2,3,4,1,7]),import.meta.url)).FlowGraphCancelDelayBlock;case"FlowGraphCallCounterBlock":return async()=>(await n(async()=>{const{FlowGraphCallCounterBlock:t}=await import("./flowGraphCounterBlock-xyxrrdpZ.js");return{FlowGraphCallCounterBlock:t}},__vite__mapDeps([25,1,2,3,4,7]),import.meta.url)).FlowGraphCallCounterBlock;case"FlowGraphDebounceBlock":return async()=>(await n(async()=>{const{FlowGraphDebounceBlock:t}=await import("./flowGraphDebounceBlock-DFfy7WVS.js");return{FlowGraphDebounceBlock:t}},__vite__mapDeps([26,1,2,3,4,7]),import.meta.url)).FlowGraphDebounceBlock;case"FlowGraphThrottleBlock":return async()=>(await n(async()=>{const{FlowGraphThrottleBlock:t}=await import("./flowGraphThrottleBlock-DvCQTEiE.js");return{FlowGraphThrottleBlock:t}},__vite__mapDeps([27,1,2,3,4,7]),import.meta.url)).FlowGraphThrottleBlock;case"FlowGraphDoNBlock":return async()=>(await n(async()=>{const{FlowGraphDoNBlock:t}=await import("./flowGraphDoNBlock-BUmWFhhp.js");return{FlowGraphDoNBlock:t}},__vite__mapDeps([28,1,2,3,4,7]),import.meta.url)).FlowGraphDoNBlock;case"FlowGraphFlipFlopBlock":return async()=>(await n(async()=>{const{FlowGraphFlipFlopBlock:t}=await import("./flowGraphFlipFlopBlock-C2r0gT8W.js");return{FlowGraphFlipFlopBlock:t}},__vite__mapDeps([29,1,2,3,4,7]),import.meta.url)).FlowGraphFlipFlopBlock;case"FlowGraphForLoopBlock":return async()=>(await n(async()=>{const{FlowGraphForLoopBlock:t}=await import("./flowGraphForLoopBlock-B4q8-wMR.js");return{FlowGraphForLoopBlock:t}},__vite__mapDeps([30,1,2,3,4,7]),import.meta.url)).FlowGraphForLoopBlock;case"FlowGraphMultiGateBlock":return async()=>(await n(async()=>{const{FlowGraphMultiGateBlock:t}=await import("./flowGraphMultiGateBlock-BrH1iWnE.js");return{FlowGraphMultiGateBlock:t}},__vite__mapDeps([31,2,3,4,1,7]),import.meta.url)).FlowGraphMultiGateBlock;case"FlowGraphSequenceBlock":return async()=>(await n(async()=>{const{FlowGraphSequenceBlock:t}=await import("./flowGraphSequenceBlock-CsGWl_9B.js");return{FlowGraphSequenceBlock:t}},__vite__mapDeps([32,2,3,4,1,7]),import.meta.url)).FlowGraphSequenceBlock;case"FlowGraphSwitchBlock":return async()=>(await n(async()=>{const{FlowGraphSwitchBlock:t}=await import("./flowGraphSwitchBlock-Bvo_J2Tt.js");return{FlowGraphSwitchBlock:t}},__vite__mapDeps([33,1,2,3,4,7]),import.meta.url)).FlowGraphSwitchBlock;case"FlowGraphWaitAllBlock":return async()=>(await n(async()=>{const{FlowGraphWaitAllBlock:t}=await import("./flowGraphWaitAllBlock-CkaEjrg9.js");return{FlowGraphWaitAllBlock:t}},__vite__mapDeps([34,2,3,4,1,7]),import.meta.url)).FlowGraphWaitAllBlock;case"FlowGraphWhileLoopBlock":return async()=>(await n(async()=>{const{FlowGraphWhileLoopBlock:t}=await import("./flowGraphWhileLoopBlock-JYaXEXT9.js");return{FlowGraphWhileLoopBlock:t}},__vite__mapDeps([35,1,2,3,4,7]),import.meta.url)).FlowGraphWhileLoopBlock;case"FlowGraphConsoleLogBlock":return async()=>(await n(async()=>{const{FlowGraphConsoleLogBlock:t}=await import("./flowGraphConsoleLogBlock-x-M88RVd.js");return{FlowGraphConsoleLogBlock:t}},__vite__mapDeps([36,1,2,3,4,7]),import.meta.url)).FlowGraphConsoleLogBlock;case"FlowGraphConditionalBlock":return async()=>(await n(async()=>{const{FlowGraphConditionalDataBlock:t}=await import("./flowGraphConditionalDataBlock-C46R1Z3F.js");return{FlowGraphConditionalDataBlock:t}},__vite__mapDeps([37,1,2,3,4,7]),import.meta.url)).FlowGraphConditionalDataBlock;case"FlowGraphConstantBlock":return async()=>(await n(async()=>{const{FlowGraphConstantBlock:t}=await import("./flowGraphConstantBlock-DTYr_13D.js");return{FlowGraphConstantBlock:t}},__vite__mapDeps([38,1,2,3,4,7]),import.meta.url)).FlowGraphConstantBlock;case"FlowGraphTransformCoordinatesSystemBlock":return async()=>(await n(async()=>{const{FlowGraphTransformCoordinatesSystemBlock:t}=await import("./flowGraphTransformCoordinatesSystemBlock-Cdsh0cBZ.js");return{FlowGraphTransformCoordinatesSystemBlock:t}},__vite__mapDeps([39,1,2,3,4,7]),import.meta.url)).FlowGraphTransformCoordinatesSystemBlock;case"FlowGraphGetAssetBlock":return async()=>(await n(async()=>{const{FlowGraphGetAssetBlock:t}=await import("./flowGraphGetAssetBlock-BH52hwPP.js");return{FlowGraphGetAssetBlock:t}},__vite__mapDeps([40,1,2,3,4,7]),import.meta.url)).FlowGraphGetAssetBlock;case"FlowGraphGetPropertyBlock":return async()=>(await n(async()=>{const{FlowGraphGetPropertyBlock:t}=await import("./flowGraphGetPropertyBlock-Ar6QWCqC.js");return{FlowGraphGetPropertyBlock:t}},__vite__mapDeps([41,1,2,3,4,18,7]),import.meta.url)).FlowGraphGetPropertyBlock;case"FlowGraphSetPropertyBlock":return async()=>(await n(async()=>{const{FlowGraphSetPropertyBlock:t}=await import("./flowGraphSetPropertyBlock-zywlahU1.js");return{FlowGraphSetPropertyBlock:t}},__vite__mapDeps([42,1,2,3,4,7]),import.meta.url)).FlowGraphSetPropertyBlock;case"FlowGraphGetVariableBlock":return async()=>(await n(async()=>{const{FlowGraphGetVariableBlock:t}=await import("./flowGraphGetVariableBlock-BmI0H3Mo.js");return{FlowGraphGetVariableBlock:t}},__vite__mapDeps([43,1,2,3,4,7]),import.meta.url)).FlowGraphGetVariableBlock;case"FlowGraphSetVariableBlock":return async()=>(await n(async()=>{const{FlowGraphSetVariableBlock:t}=await import("./flowGraphSetVariableBlock-CHJ2f_VB.js");return{FlowGraphSetVariableBlock:t}},__vite__mapDeps([44,2,3,4,1,7]),import.meta.url)).FlowGraphSetVariableBlock;case"FlowGraphJsonPointerParserBlock":return async()=>(await n(async()=>{const{FlowGraphJsonPointerParserBlock:t}=await import("./flowGraphJsonPointerParserBlock-CbgFrsq4.js");return{FlowGraphJsonPointerParserBlock:t}},__vite__mapDeps([45,1,2,3,4,18,7]),import.meta.url)).FlowGraphJsonPointerParserBlock;case"FlowGraphLeadingZerosBlock":return async()=>(await n(async()=>{const{FlowGraphLeadingZerosBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphLeadingZerosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLeadingZerosBlock;case"FlowGraphTrailingZerosBlock":return async()=>(await n(async()=>{const{FlowGraphTrailingZerosBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphTrailingZerosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTrailingZerosBlock;case"FlowGraphOneBitsCounterBlock":return async()=>(await n(async()=>{const{FlowGraphOneBitsCounterBlock:t}=await import("./flowGraphMathBlocks-WHnmoWh_.js");return{FlowGraphOneBitsCounterBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphOneBitsCounterBlock;case"FlowGraphCombineVector2Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphCombineVector2Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector2Block;case"FlowGraphCombineVector3Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphCombineVector3Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector3Block;case"FlowGraphCombineVector4Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphCombineVector4Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector4Block;case"FlowGraphCombineMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphCombineMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphCombineMatrixBlock:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineMatrixBlock;case"FlowGraphExtractVector2Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphExtractVector2Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector2Block;case"FlowGraphExtractVector3Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphExtractVector3Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector3Block;case"FlowGraphExtractVector4Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphExtractVector4Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector4Block;case"FlowGraphExtractMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphExtractMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-BLZz5aaG.js");return{FlowGraphExtractMatrixBlock:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractMatrixBlock;case"FlowGraphTransformVectorBlock":return async()=>(await n(async()=>{const{FlowGraphTransformBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphTransformBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphTransformBlock;case"FlowGraphTransformCoordinatesBlock":return async()=>(await n(async()=>{const{FlowGraphTransformCoordinatesBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphTransformCoordinatesBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphTransformCoordinatesBlock;case"FlowGraphConjugateBlock":return async()=>(await n(async()=>{const{FlowGraphConjugateBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphConjugateBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphConjugateBlock;case"FlowGraphAngleBetweenBlock":return async()=>(await n(async()=>{const{FlowGraphAngleBetweenBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphAngleBetweenBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphAngleBetweenBlock;case"FlowGraphQuaternionFromAxisAngleBlock":return async()=>(await n(async()=>{const{FlowGraphQuaternionFromAxisAngleBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphQuaternionFromAxisAngleBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphQuaternionFromAxisAngleBlock;case"FlowGraphAxisAngleFromQuaternionBlock":return async()=>(await n(async()=>{const{FlowGraphAxisAngleFromQuaternionBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphAxisAngleFromQuaternionBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphAxisAngleFromQuaternionBlock;case"FlowGraphQuaternionFromDirectionsBlock":return async()=>(await n(async()=>{const{FlowGraphQuaternionFromDirectionsBlock:t}=await import("./flowGraphVectorMathBlocks-9N0EGpm7.js");return{FlowGraphQuaternionFromDirectionsBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphQuaternionFromDirectionsBlock;case"FlowGraphMatrixDecompose":return async()=>(await n(async()=>{const{FlowGraphMatrixDecomposeBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphMatrixDecomposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixDecomposeBlock;case"FlowGraphMatrixCompose":return async()=>(await n(async()=>{const{FlowGraphMatrixComposeBlock:t}=await import("./flowGraphMatrixMathBlocks-BLgu0Sgs.js");return{FlowGraphMatrixComposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixComposeBlock;case"FlowGraphBooleanToFloat":return async()=>(await n(async()=>{const{FlowGraphBooleanToFloat:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphBooleanToFloat:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphBooleanToFloat;case"FlowGraphBooleanToInt":return async()=>(await n(async()=>{const{FlowGraphBooleanToInt:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphBooleanToInt:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphBooleanToInt;case"FlowGraphFloatToBoolean":return async()=>(await n(async()=>{const{FlowGraphFloatToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphFloatToBoolean:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphFloatToBoolean;case"FlowGraphIntToBoolean":return async()=>(await n(async()=>{const{FlowGraphIntToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphIntToBoolean:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphIntToBoolean;case"FlowGraphIntToFloat":return async()=>(await n(async()=>{const{FlowGraphIntToFloat:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphIntToFloat:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphIntToFloat;case"FlowGraphFloatToInt":return async()=>(await n(async()=>{const{FlowGraphFloatToInt:t}=await import("./flowGraphTypeToTypeBlocks-CdqQYaY1.js");return{FlowGraphFloatToInt:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphFloatToInt;case"FlowGraphEasingBlock":return async()=>(await n(async()=>{const{FlowGraphEasingBlock:t}=await import("./flowGraphEasingBlock-D2uwp4dD.js");return{FlowGraphEasingBlock:t}},__vite__mapDeps([48,2,3,4,1,7]),import.meta.url)).FlowGraphEasingBlock;case"FlowGraphBezierCurveEasing":return async()=>(await n(async()=>{const{FlowGraphBezierCurveEasingBlock:t}=await import("./flowGraphBezierCurveEasingBlock-Dhfe3xNk.js");return{FlowGraphBezierCurveEasingBlock:t}},__vite__mapDeps([49,2,3,4,1,7]),import.meta.url)).FlowGraphBezierCurveEasingBlock;case"FlowGraphPointerOverEventBlock":return async()=>(await n(async()=>{const{FlowGraphPointerOverEventBlock:t}=await import("./flowGraphPointerOverEventBlock-DBLNmcpf.js");return{FlowGraphPointerOverEventBlock:t}},__vite__mapDeps([50,1,2,3,4,7]),import.meta.url)).FlowGraphPointerOverEventBlock;case"FlowGraphPointerOutEventBlock":return async()=>(await n(async()=>{const{FlowGraphPointerOutEventBlock:t}=await import("./flowGraphPointerOutEventBlock-zex71JkY.js");return{FlowGraphPointerOutEventBlock:t}},__vite__mapDeps([51,1,2,3,4,7]),import.meta.url)).FlowGraphPointerOutEventBlock;case"FlowGraphContextBlock":return async()=>(await n(async()=>{const{FlowGraphContextBlock:t}=await import("./flowGraphContextBlock-Bd-M1lOa.js");return{FlowGraphContextBlock:t}},__vite__mapDeps([52,1,2,3,4,7]),import.meta.url)).FlowGraphContextBlock;case"FlowGraphArrayIndexBlock":return async()=>(await n(async()=>{const{FlowGraphArrayIndexBlock:t}=await import("./flowGraphArrayIndexBlock-DmxisnJu.js");return{FlowGraphArrayIndexBlock:t}},__vite__mapDeps([53,1,2,3,4,7]),import.meta.url)).FlowGraphArrayIndexBlock;case"FlowGraphCodeExecutionBlock":return async()=>(await n(async()=>{const{FlowGraphCodeExecutionBlock:t}=await import("./flowGraphCodeExecutionBlock-DtgT7ugb.js");return{FlowGraphCodeExecutionBlock:t}},__vite__mapDeps([54,1,2,3,4,7]),import.meta.url)).FlowGraphCodeExecutionBlock;case"FlowGraphIndexOfBlock":return async()=>(await n(async()=>{const{FlowGraphIndexOfBlock:t}=await import("./flowGraphIndexOfBlock-1sUrEqt1.js");return{FlowGraphIndexOfBlock:t}},__vite__mapDeps([55,1,2,3,4,7]),import.meta.url)).FlowGraphIndexOfBlock;case"FlowGraphFunctionReference":return async()=>(await n(async()=>{const{FlowGraphFunctionReferenceBlock:t}=await import("./flowGraphFunctionReferenceBlock-BEE10xFF.js");return{FlowGraphFunctionReferenceBlock:t}},__vite__mapDeps([56,1,2,3,4,7]),import.meta.url)).FlowGraphFunctionReferenceBlock;case"FlowGraphDataSwitchBlock":return async()=>(await n(async()=>{const{FlowGraphDataSwitchBlock:t}=await import("./flowGraphDataSwitchBlock-D46Djwq4.js");return{FlowGraphDataSwitchBlock:t}},__vite__mapDeps([57,1,2,3,4,7]),import.meta.url)).FlowGraphDataSwitchBlock;default:if(N[r])return N[r];throw new Error(`Unknown block name ${r}`)}}class Ct extends D{constructor(t){super(t),this.out=this._registerSignalOutput("out")}}class Pt extends Ct{constructor(t,e){if(super(t),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),e)for(const o of e)this._eventsSignalOutputs[o]=this._registerSignalOutput(o+"Event")}_executeOnTick(t){}_startPendingTasks(t){t._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(t),this._resetAfterCanceled(t)),this._preparePendingTasks(t),t._addPendingBlock(this),this.out._activateSignal(t),t._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(t){t._deleteExecutionVariable(this,"_initialized"),t._removePendingBlock(this)}}class bt extends Pt{constructor(){super(...arguments),this.initPriority=0,this.type="NoTrigger"}_execute(t){t._notifyExecuteNode(this),this.done._activateSignal(t)}}function Ot(r,t){for(const e of r)for(const o of e.dataOutputs)if(o.uniqueId===t)return o;throw new Error("Could not find data out connection with unique id "+t)}function xt(r,t){for(const e of r)if(e instanceof D){for(const o of e.signalInputs)if(o.uniqueId===t)return o}throw new Error("Could not find signal in connection with unique id "+t)}async function Dt(r,t){const e=await Promise.all(r.allBlocks.map(async o=>await Vt(o.className)()));return At(r,t,e)}function At(r,t,e){const o=t.coordinator.createGraph(),a=[],i=t.valueParseFunction??x;for(let s=0;si.getMeshById(l)),lights:s.lights?.map(l=>i.getLightByName(l)),cameras:s.cameras?.map(l=>i.getCameraByName(l)),materials:s.materials?.map(l=>i.getMaterialById(l)),textures:s.textures?.map(l=>i.getTextureByName(l)),animations:s.animations?.map(l=>i.animations.find(_=>_.name===l)),skeletons:s.skeletons?.map(l=>i.getSkeletonByName(l)),particleSystems:s.particleSystems?.map(l=>i.getParticleSystemById(l)),animationGroups:s.animationGroups?.map(l=>i.getAnimationGroupByName(l)),transformNodes:s.transformNodes?.map(l=>i.getTransformNodeById(l)),rootNodes:[],multiMaterials:[],morphTargetManagers:[],geometries:[],actionManagers:[],environmentTexture:null,postProcesses:[],sounds:null,effectLayers:[],layers:[],reflectionProbes:[],lensFlareSystems:[],proceduralTextures:[],getNodes:function(){throw new Error("Function not implemented.")}};o.assetsContext=c}for(const s in r._userVariables){const c=a(s,r._userVariables,o.assetsContext,i);o.userVariables[s]=c}for(const s in r._connectionValues){const c=a(s,r._connectionValues,o.assetsContext,i);o._setConnectionValueByKey(s,c)}return o}function Lt(r,t,e){const o={},a=t.valueParseFunction??x;if(r.config)for(const s in r.config)o[s]=a(s,r.config,t.assetsContainer||t.scene,t.scene);if(kt(r.className)){if(!t.pathConverter)throw new Error("Path converter is required for this block");o.pathConverter=t.pathConverter}const i=new e(o);i.uniqueId=r.uniqueId;for(let s=0;s{const a=t.values?.[o];if(!a)throw p.Error(["No value found for event key",o]),new Error("Error parsing events");const i=this._types[a.type];if(!i)throw p.Error(["No type found for event value",a]),new Error("Error parsing events");const s=typeof a.value<"u"?this._parseVariable(a):void 0;return{id:o,type:i.flowGraphType,eventData:!0,value:s}})),this._events.push(e)}}_parseNodes(){if(this._interactivityGraph.nodes)for(const t of this._interactivityGraph.nodes){if(typeof t.declaration!="number")throw p.Error(["No declaration found for node",t]),new Error("Error parsing nodes");const e=this._mappings[t.declaration];if(!e)throw p.Error(["No mapping found for node",t]),new Error("Error parsing nodes");if(e.flowGraphMapping.validation){const a=e.flowGraphMapping.validation(t,this._interactivityGraph,this._gltf);if(!a.valid)throw new Error(`Error validating interactivity node ${this._interactivityGraph.declarations?.[t.declaration].op} - ${a.error}`)}const o=[];for(const a of e.flowGraphMapping.blocks){const i=this._getEmptyBlock(a,e.fullOperationName);this._parseNodeConfiguration(t,i,e.flowGraphMapping,a),o.push(i)}this._nodes.push({blocks:o,fullOperationName:e.fullOperationName})}}_getEmptyBlock(t,e){return{uniqueId:I(),className:t,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:e,metadata:{}}}_parseNodeConfiguration(t,e,o,a){const i=t.configuration;if(i)for(const s in i){const c=i[s];if(!c)throw new Error("Error parsing node configuration");const l=o.configuration?.[s];if(l&&l.toBlock?l.toBlock===a:o.blocks.indexOf(a)===0){let u=l?.defaultValue;c?.value&&(u=c.value),l?.isArray||(u.length!==1&&p.Warn(`Invalid non-array value length: ${u.length}`),u=u[0]),l?.dataTransformer&&(u=l.dataTransformer(u,this)),u!==void 0&&(e.config[l?.name||s]={value:u})}}}_parseNodeConnections(t){for(let e=0;ef.className===h.toBlock)||a.blocks[0]).signalOutputs.push(T);const A=w.node,d=this._nodes[A];if(!d)throw p.Error(["No node found for input node id",A]),new Error("Error parsing node connections");const k=$(d.fullOperationName);if(!k)throw p.Error(["No mapping found for input node",d]),new Error("Error parsing node connections");let m=k.inputs?.flows?.[w.socket||"in"],B=!1;if(!m)for(const f in k.inputs?.flows)f.startsWith("[")&&f.endsWith("]")&&(B=!0,m=k.inputs?.flows?.[f]);const y=m?B?m.name.replace("$1",w.socket||""):m.name:w.socket||"in",C=m&&m.toBlock&&d.blocks.find(f=>f.className===m.toBlock)||d.blocks[0];let G=C.signalInputs.find(f=>f.name===y);G||(G=this._createNewSocketConnection(y),C.signalInputs.push(G)),G.connectedPointIds.push(T.uniqueId),T.connectedPointIds.push(G.uniqueId)}const l=o.values||{},_=Object.keys(l);for(const u of _){const w=l[u];let h=i.flowGraphMapping.inputs?.values?.[u],v=!1;if(!h)for(const d in i.flowGraphMapping.inputs?.values)d.startsWith("[")&&d.endsWith("]")&&(v=!0,h=i.flowGraphMapping.inputs?.values?.[d]);const T=h?v?h.name.replace("$1",u):h.name:u,V=this._createNewSocketConnection(T);if((h&&h.toBlock&&a.blocks.find(d=>d.className===h.toBlock)||a.blocks[0]).dataInputs.push(V),w.value!==void 0){const d=this._parseVariable(w,h&&h.dataTransformer);t._connectionValues[V.uniqueId]=d}else if(typeof w.node<"u"){const d=w.node,k=w.socket||"value",m=this._nodes[d];if(!m)throw p.Error(["No node found for output socket reference",w]),new Error("Error parsing node connections");const B=$(m.fullOperationName);if(!B)throw p.Error(["No mapping found for output socket reference",w]),new Error("Error parsing node connections");let y=B.outputs?.values?.[k],C=!1;if(!y)for(const F in B.outputs?.values)F.startsWith("[")&&F.endsWith("]")&&(C=!0,y=B.outputs?.values?.[F]);const G=y?C?y.name.replace("$1",k):y?.name:k,f=y&&y.toBlock&&m.blocks.find(F=>F.className===y.toBlock)||m.blocks[0];let P=f.dataOutputs.find(F=>F.name===G);P||(P=this._createNewSocketConnection(G,!0),f.dataOutputs.push(P)),V.connectedPointIds.push(P.uniqueId),P.connectedPointIds.push(V.uniqueId)}else throw p.Error(["Invalid value for value connection",w]),new Error("Error parsing node connections")}if(i.flowGraphMapping.interBlockConnectors)for(const u of i.flowGraphMapping.interBlockConnectors){const w=u.input,h=u.output,v=u.isVariable;this._connectFlowGraphNodes(w,h,a.blocks[u.inputBlockIndex],a.blocks[u.outputBlockIndex],v)}if(i.flowGraphMapping.extraProcessor){const u=this._interactivityGraph.declarations?.[o.declaration];if(!u)throw p.Error(["No declaration found for extra processor",o]),new Error("Error parsing node connections");a.blocks=i.flowGraphMapping.extraProcessor(o,u,i.flowGraphMapping,this,a.blocks,t,this._gltf)}}}_createNewSocketConnection(t,e){return{uniqueId:I(),name:t,_connectionType:e?1:0,connectedPointIds:[]}}_connectFlowGraphNodes(t,e,o,a,i){const s=i?o.dataInputs:o.signalInputs,c=i?a.dataOutputs:a.signalOutputs,l=s.find(u=>u.name===t)||this._createNewSocketConnection(t),_=c.find(u=>u.name===e)||this._createNewSocketConnection(e,!0);s.find(u=>u.name===t)||s.push(l),c.find(u=>u.name===e)||c.push(_),l.connectedPointIds.push(_.uniqueId),_.connectedPointIds.push(l.uniqueId)}getVariableName(t){return"staticVariable_"+t}serializeToFlowGraph(){const t={uniqueId:I(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(t);for(let o=0;oo.concat(a.blocks),[]),executionContexts:[t]}}}const b="KHR_interactivity";class j{constructor(t){this._loader=t,this.name=b,this.enabled=this._loader.isExtensionUsed(b),this._pathConverter=dt(this._loader.gltf),t._skipStartAnimationStep=!0;const e=t.babylonScene;e&&tt(e)}dispose(){this._loader=null,delete this._pathConverter}async onReady(){if(!this._loader.babylonScene||!this._pathConverter)return;const t=this._loader.babylonScene,e=this._loader.gltf.extensions?.KHR_interactivity;if(!e)return;const o=new g({scene:t});o.dispatchEventsSynchronously=!1;const a=e.graphs.map(i=>new Nt(i,this._loader.gltf,this._loader.parent.targetFps).serializeToFlowGraph());await Promise.all(a.map(async i=>await Dt(i,{coordinator:o,pathConverter:this._pathConverter}))),o.start()}}function tt(r){E("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:()=>{if(!r.activeCamera)return new R(NaN,NaN,NaN,NaN);const t=R.FromRotationMatrix(r.activeCamera.getWorldMatrix()).normalize();return r.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:()=>r.activeCamera}),E("/extensions/KHR_interactivity/?/activeCamera/position",{get:()=>{if(!r.activeCamera)return new Q(NaN,NaN,NaN);const t=r.activeCamera.getWorldMatrix().getTranslation();return r.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:()=>r.activeCamera}),E("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:t=>t._babylonAnimationGroup?.isPlaying??!1,type:"boolean",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/minTime",{get:t=>(t._babylonAnimationGroup?.from??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/maxTime",{get:t=>(t._babylonAnimationGroup?.to??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/playhead",{get:t=>(t._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:t=>(t._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup})}Tt(b,"FlowGraphGLTFDataProvider",async()=>(await n(async()=>{const{FlowGraphGLTFDataProvider:r}=await import("./flowGraphGLTFDataProvider-6e5hvgTT.js");return{FlowGraphGLTFDataProvider:r}},__vite__mapDeps([58,1,2,3,4,7]),import.meta.url)).FlowGraphGLTFDataProvider);lt(b);ct(b,!0,r=>new j(r));const Zt=Object.freeze(Object.defineProperty({__proto__:null,KHR_interactivity:j,_AddInteractivityObjectModel:tt},Symbol.toStringTag,{value:"Module"}));export{Ft as F,Gt as G,Zt as K,z as _,Pt as a,Ct as b,bt as c,g as d,D as e,M as f,vt as g,Wt as h,Jt as i,Ut as j,Ht as k,Qt as l}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./flowGraphPlayAnimationBlock-yMdaunvk.js","./declarationMapper-g3VMH3is.js","./index-DmfQKmJL.js","./index-BeNBoC9J.js","./index-BSZrXtnz.css","./animationGroup-BPSPSYSJ.js","./bone-DcPUF7Rw.js","./objectModelMapping-BHbejOcH.js","./flowGraphStopAnimationBlock-Cex6L5GQ.js","./flowGraphPauseAnimationBlock-Jn1q4dx6.js","./flowGraphInterpolationBlock-CANx4XcO.js","./flowGraphSceneReadyEventBlock-Bv0Q4_Ma.js","./flowGraphSceneTickEventBlock-DAewRadS.js","./flowGraphSendCustomEventBlock-BzwzScub.js","./flowGraphReceiveCustomEventBlock-sg3CxkkW.js","./flowGraphMeshPickEventBlock-CzCmGJcz.js","./flowGraphMathBlocks-z2zNUqDY.js","./flowGraphBinaryOperationBlock-ClbzDVrx.js","./flowGraphCachedOperationBlock-Can_aTAb.js","./flowGraphUnaryOperationBlock-B7lF76f2.js","./flowGraphVectorMathBlocks-DTKNQnH4.js","./flowGraphMatrixMathBlocks-1adeofxu.js","./flowGraphBranchBlock-up3wUT00.js","./flowGraphSetDelayBlock-DufofuPB.js","./flowGraphCancelDelayBlock-BCGD7j_Y.js","./flowGraphCounterBlock-B3fMG4Oh.js","./flowGraphDebounceBlock-cgUWhMk1.js","./flowGraphThrottleBlock-DA8gjjoT.js","./flowGraphDoNBlock-BSmSYu4W.js","./flowGraphFlipFlopBlock-CQj0gp2M.js","./flowGraphForLoopBlock-VMf2cpFK.js","./flowGraphMultiGateBlock-Cnyy87B-.js","./flowGraphSequenceBlock-C3QMqWII.js","./flowGraphSwitchBlock-FyxUNMq-.js","./flowGraphWaitAllBlock-DpoWxZ2D.js","./flowGraphWhileLoopBlock-DfCG3NGj.js","./flowGraphConsoleLogBlock-CdQ_BZMp.js","./flowGraphConditionalDataBlock-ChAv1xDe.js","./flowGraphConstantBlock-ZwzU08iO.js","./flowGraphTransformCoordinatesSystemBlock-hXnZcke2.js","./flowGraphGetAssetBlock-Cc_FY6kq.js","./flowGraphGetPropertyBlock-CAj41dnr.js","./flowGraphSetPropertyBlock-Czv1gWvn.js","./flowGraphGetVariableBlock-BmAdsTSc.js","./flowGraphSetVariableBlock-D4KTri-H.js","./flowGraphJsonPointerParserBlock-Jp8NW6fo.js","./flowGraphMathCombineExtractBlocks-DSiM9i66.js","./flowGraphTypeToTypeBlocks-hZnJ2rXW.js","./flowGraphEasingBlock-D_7QLffQ.js","./flowGraphBezierCurveEasingBlock-Bn0_rCS1.js","./flowGraphPointerOverEventBlock-B5Sh8KiE.js","./flowGraphPointerOutEventBlock-Dz_uC9Ho.js","./flowGraphContextBlock-Dkn_mjiI.js","./flowGraphArrayIndexBlock-C-6tnsIF.js","./flowGraphCodeExecutionBlock-BMHxPqK5.js","./flowGraphIndexOfBlock-ClcxICeW.js","./flowGraphFunctionReferenceBlock-DA2-VZ2n.js","./flowGraphDataSwitchBlock-D4WhGjRY.js","./flowGraphGLTFDataProvider-ozn3C3RZ.js"])))=>i.map(i=>d[i]); +import{af as n}from"./index-BeNBoC9J.js";import{M as et,ah as ot,V as Q,ai as rt,ao as R,C as at,b9 as nt,L as p,h as I,O,_ as it,s as st,R as J,aQ as q,aG as lt,aH as ct}from"./index-DmfQKmJL.js";import{n as ut,p as pt,F as ht,g as _t,r as wt,s as $}from"./declarationMapper-g3VMH3is.js";import{G as dt,A as E}from"./objectModelMapping-BHbejOcH.js";function mt(r){return r==="Mesh"||r==="AbstractMesh"||r==="GroundMesh"||r==="InstanceMesh"||r==="LinesMesh"||r==="GoldbergMesh"||r==="GreasedLineMesh"||r==="TrailMesh"}function Z(r){return r==="Vector2"||r==="Vector3"||r==="Vector4"||r==="Quaternion"||r==="Color3"||r==="Color4"}function ft(r){return r==="Matrix"||r==="Matrix2D"||r==="Matrix3D"}function yt(r){return r==="AnimationGroup"}function gt(r,t,e=!1){if(r==="Vector2")return ot.FromArray(t);if(r==="Vector3")return e&&(t[2]*=-1),Q.FromArray(t);if(r==="Vector4")return rt.FromArray(t);if(r==="Quaternion")return e&&(t[2]*=-1,t[3]*=-1),R.FromArray(t);if(r==="Color3")return new at(t[0],t[1],t[2]);if(r==="Color4")return new nt(t[0],t[1],t[2],t[3]);throw new Error(`Unknown vector class name ${r}`)}function M(r,t,e){const o=t?.getClassName?.()??"";if(Z(o)||ft(o))e[r]={value:t.asArray(),className:o};else if(o==="FlowGraphInteger")e[r]={value:t.value,className:o};else if(o&&(t.id||t.name))e[r]={id:t.id,name:t.name,className:o};else if(typeof t!="object")e[r]=t;else throw new Error(`Could not serialize value ${t}`)}function x(r,t,e,o){const a=t[r];let i;const s=a?.type??a?.className;if(mt(s)){let c=o.meshes.filter(l=>a.id?l.id===a.id:l.name===a.name);c.length===0&&(c=o.transformNodes.filter(l=>a.id?l.id===a.id:l.name===a.name)),i=a.uniqueId?c.find(l=>l.uniqueId===a.uniqueId):c[0]}else if(Z(s))i=gt(s,a.value);else if(yt(s)){const c=o.animationGroups.filter(l=>l.name===a.name);i=c.length===1?c[0]:c.find(l=>l.uniqueId===a.uniqueId)}else s==="Matrix"?i=et.FromArray(a.value):s==="Matrix2D"?i=new ut(a.value):s==="Matrix3D"?i=new pt(a.value):s==="FlowGraphInteger"?i=ht.FromValue(a.value):s==="number"||s==="string"||s==="boolean"?i=a.value[0]:a&&a.value!==void 0?i=a.value:Array.isArray(a)?i=a.reduce((c,l)=>(l.eventData&&(c[l.id]={type:_t(l.type)},typeof l.value<"u"&&(c[l.id].value=x("value",l,e,o))),c),{}):i=a;return i}function kt(r){return r==="FlowGraphJsonPointerParserBlock"}var K;(function(r){r.Animation="Animation",r.AnimationGroup="AnimationGroup",r.Mesh="Mesh",r.Material="Material",r.Camera="Camera",r.Light="Light"})(K||(K={}));function Gt(r,t,e,o){switch(t){case"Animation":return o?r.animations.find(a=>a.uniqueId===e)??null:r.animations[e]??null;case"AnimationGroup":return o?r.animationGroups.find(a=>a.uniqueId===e)??null:r.animationGroups[e]??null;case"Mesh":return o?r.meshes.find(a=>a.uniqueId===e)??null:r.meshes[e]??null;case"Material":return o?r.materials.find(a=>a.uniqueId===e)??null:r.materials[e]??null;case"Camera":return o?r.cameras.find(a=>a.uniqueId===e)??null:r.cameras[e]??null;case"Light":return o?r.lights.find(a=>a.uniqueId===e)??null:r.lights[e]??null;default:return null}}var W;(function(r){r.ExecuteBlock="ExecuteBlock",r.ExecuteEvent="ExecuteEvent",r.TriggerConnection="TriggerConnection",r.ContextVariableSet="ContextVariableSet",r.GlobalVariableSet="GlobalVariableSet",r.GlobalVariableDelete="GlobalVariableDelete",r.GlobalVariableGet="GlobalVariableGet",r.AddConnection="AddConnection",r.GetConnectionValue="GetConnectionValue",r.SetConnectionValue="SetConnectionValue",r.ActivateSignal="ActivateSignal",r.ContextVariableGet="ContextVariableGet"})(W||(W={}));class Bt{constructor(){this.logToConsole=!1,this.log=[]}addLogItem(t){if(t.time||(t.time=Date.now()),this.log.push(t),this.logToConsole){const e=t.payload?.value;typeof e=="object"&&e.getClassName?p.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(e.getClassName())}: ${e.toString()}`):p.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(t.payload)}`)}}getItemsOfType(t){return this.log.filter(e=>e.action===t)}}class X{get enableLogging(){return this._enableLogging}set enableLogging(t){this._enableLogging!==t&&(this._enableLogging=t,this._enableLogging?(this.logger=new Bt,this.logger.logToConsole=!0):this.logger=null)}constructor(t){this.uniqueId=I(),this._userVariables={},this._executionVariables={},this._globalContextVariables={},this._connectionValues={},this._pendingBlocks=[],this._executionId=0,this.onNodeExecutedObservable=new O,this.treatDataAsRightHanded=!1,this._enableLogging=!1,this._configuration=t,this.assetsContext=t.assetsContext??t.scene}hasVariable(t){return t in this._userVariables}setVariable(t,e){this._userVariables[t]=e,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableSet",payload:{name:t,value:e}})}getAsset(t,e){return Gt(this.assetsContext,t,e)}getVariable(t){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableGet",payload:{name:t,value:this._userVariables[t]}}),this._userVariables[t]}get userVariables(){return this._userVariables}getScene(){return this._configuration.scene}_getUniqueIdPrefixedName(t,e){return`${t.uniqueId}_${e}`}_getGlobalContextVariable(t,e){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableGet",payload:{name:t,defaultValue:e,possibleValue:this._globalContextVariables[t]}}),this._hasGlobalContextVariable(t)?this._globalContextVariables[t]:e}_setGlobalContextVariable(t,e){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableSet",payload:{name:t,value:e}}),this._globalContextVariables[t]=e}_deleteGlobalContextVariable(t){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableDelete",payload:{name:t}}),delete this._globalContextVariables[t]}_hasGlobalContextVariable(t){return t in this._globalContextVariables}_setExecutionVariable(t,e,o){this._executionVariables[this._getUniqueIdPrefixedName(t,e)]=o}_getExecutionVariable(t,e,o){return this._hasExecutionVariable(t,e)?this._executionVariables[this._getUniqueIdPrefixedName(t,e)]:o}_deleteExecutionVariable(t,e){delete this._executionVariables[this._getUniqueIdPrefixedName(t,e)]}_hasExecutionVariable(t,e){return this._getUniqueIdPrefixedName(t,e)in this._executionVariables}_hasConnectionValue(t){return t.uniqueId in this._connectionValues}_setConnectionValue(t,e){this._connectionValues[t.uniqueId]=e,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"SetConnectionValue",payload:{connectionPointId:t.uniqueId,value:e}})}_setConnectionValueByKey(t,e){this._connectionValues[t]=e}_getConnectionValue(t){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GetConnectionValue",payload:{connectionPointId:t.uniqueId,value:this._connectionValues[t.uniqueId]}}),this._connectionValues[t.uniqueId]}get configuration(){return this._configuration}get hasPendingBlocks(){return this._pendingBlocks.length>0}_addPendingBlock(t){this._pendingBlocks.includes(t)||(this._pendingBlocks.push(t),this._pendingBlocks.sort((e,o)=>e.priority-o.priority))}_removePendingBlock(t){const e=this._pendingBlocks.indexOf(t);e!==-1&&this._pendingBlocks.splice(e,1)}_clearPendingBlocks(){for(const t of this._pendingBlocks)t._cancelPendingTasks(this);this._pendingBlocks.length=0}_notifyExecuteNode(t){this.onNodeExecutedObservable.notifyObservers(t),this.logger?.addLogItem({time:Date.now(),className:t.getClassName(),uniqueId:t.uniqueId,action:"ExecuteBlock"})}_notifyOnTick(t){this._setGlobalContextVariable("timeSinceStart",t.timeSinceStart),this._setGlobalContextVariable("deltaTime",t.deltaTime);for(const e of this._pendingBlocks)e._executeOnTick?.(this)}_increaseExecutionId(){this._executionId++}get executionId(){return this._executionId}serialize(t={},e=M){t.uniqueId=this.uniqueId,t._userVariables={};for(const o in this._userVariables)e(o,this._userVariables[o],t._userVariables);t._connectionValues={};for(const o in this._connectionValues)e(o,this._connectionValues[o],t._connectionValues);this.assetsContext!==this.getScene()&&(t._assetsContext={meshes:this.assetsContext.meshes.map(o=>o.id),materials:this.assetsContext.materials.map(o=>o.id),textures:this.assetsContext.textures.map(o=>o.name),animations:this.assetsContext.animations.map(o=>o.name),lights:this.assetsContext.lights.map(o=>o.id),cameras:this.assetsContext.cameras.map(o=>o.id),sounds:this.assetsContext.sounds?.map(o=>o.name),skeletons:this.assetsContext.skeletons.map(o=>o.id),particleSystems:this.assetsContext.particleSystems.map(o=>o.name),geometries:this.assetsContext.geometries.map(o=>o.id),multiMaterials:this.assetsContext.multiMaterials.map(o=>o.id),transformNodes:this.assetsContext.transformNodes.map(o=>o.id)})}getClassName(){return"FlowGraphContext"}}it([st()],X.prototype,"uniqueId",void 0);var U;(function(r){r[r.Input=0]="Input",r[r.Output=1]="Output"})(U||(U={}));class Y{constructor(t,e,o){this._ownerBlock=o,this._connectedPoint=[],this.uniqueId=I(),this.connectedPointIds=[],this.name=t,this._connectionType=e}get connectionType(){return this._connectionType}_isSingularConnection(){return!0}isConnected(){return this._connectedPoint.length>0}connectTo(t){if(this._connectionType===t._connectionType)throw new Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||t._isSingularConnection()&&t._connectedPoint.length>0)throw new Error("Max number of connections for point reached");this._connectedPoint.push(t),t._connectedPoint.push(this)}disconnectFrom(t,e=!0){const o=this._connectedPoint.indexOf(t),a=t._connectedPoint.indexOf(this);o===-1||a===-1||(e&&this._connectedPoint.splice(o,1),t._connectedPoint.splice(a,1))}disconnectFromAll(){for(const t of this._connectedPoint)this.disconnectFrom(t,!1);this._connectedPoint.length=0}dispose(){for(const t of this._connectedPoint)this.disconnectFrom(t)}serialize(t={}){t.uniqueId=this.uniqueId,t.name=this.name,t._connectionType=this._connectionType,t.connectedPointIds=[],t.className=this.getClassName();for(const e of this._connectedPoint)t.connectedPointIds.push(e.uniqueId)}getClassName(){return"FGConnection"}deserialize(t){this.uniqueId=t.uniqueId,this.name=t.name,this._connectionType=t._connectionType,this.connectedPointIds=t.connectedPointIds}}class L extends Y{constructor(t,e,o,a,i=a.defaultValue,s=!1){super(t,e,o),this.richType=a,this._defaultValue=i,this._optional=s,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new O}get optional(){return this._optional}get isDisabled(){return this._isDisabled}set isDisabled(t){this._isDisabled!==t&&(this._isDisabled=t,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){return this.connectionType===0}setValue(t,e){e._getConnectionValue(this)!==t&&(e._setConnectionValue(this,t),this.onValueChangedObservable.notifyObservers(t))}resetToDefaultValue(t){t._setConnectionValue(this,this._defaultValue)}connectTo(t){this._isDisabled||super.connectTo(t)}_getValueOrDefault(t){const e=t._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(e):e}getValue(t){if(this.connectionType===1){t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(t);const o=this._getValueOrDefault(t);return this._lastValue=o,this.richType.typeTransformer?this.richType.typeTransformer(o):o}const e=this.isConnected()?this._connectedPoint[0].getValue(t):this._getValueOrDefault(t);return this._lastValue=e,this.richType.typeTransformer?this.richType.typeTransformer(e):e}_getLastValue(){return this._lastValue}getClassName(){return"FlowGraphDataConnection"}serialize(t={}){super.serialize(t),t.richType={},this.richType.serialize(t.richType),t.optional=this._optional,M("defaultValue",this._defaultValue,t)}}J("FlowGraphDataConnection",L);class Ft{constructor(t){this.config=t,this.uniqueId=I(),this.name=this.config?.name??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(t){}registerDataInput(t,e,o){const a=new L(t,0,this,e,o);return this.dataInputs.push(a),a}registerDataOutput(t,e,o){const a=new L(t,1,this,e,o);return this.dataOutputs.push(a),a}getDataInput(t){return this.dataInputs.find(e=>e.name===t)}getDataOutput(t){return this.dataOutputs.find(e=>e.name===t)}serialize(t={},e=M){if(t.uniqueId=this.uniqueId,t.config={},this.config){const o=this.config,a=Object.keys(o);for(const i of a)e(i,o[i],t.config)}t.dataInputs=[],t.dataOutputs=[],t.className=this.getClassName();for(const o of this.dataInputs){const a={};o.serialize(a),t.dataInputs.push(a)}for(const o of this.dataOutputs){const a={};o.serialize(a),t.dataOutputs.push(a)}}deserialize(t){}_log(t,e,o){t.logger?.addLogItem({action:e,payload:o,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){return"FlowGraphBlock"}}class S extends Y{constructor(){super(...arguments),this.priority=0}_isSingularConnection(){return!1}connectTo(t){super.connectTo(t),this._connectedPoint.sort((e,o)=>o.priority-e.priority)}_activateSignal(t){if(t.logger?.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),this.connectionType===0)t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._execute(t,this),t._increaseExecutionId();else for(const e of this._connectedPoint)e._activateSignal(t)}}J("FlowGraphSignalConnection",S);class D extends Ft{constructor(t){super(t),this.priority=0,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(t){const e=new S(t,0,this);return this.signalInputs.push(e),e}_registerSignalOutput(t){const e=new S(t,1,this);return this.signalOutputs.push(e),e}_unregisterSignalInput(t){const e=this.signalInputs.findIndex(o=>o.name===t);e!==-1&&(this.signalInputs[e].dispose(),this.signalInputs.splice(e,1))}_unregisterSignalOutput(t){const e=this.signalOutputs.findIndex(o=>o.name===t);e!==-1&&(this.signalOutputs[e].dispose(),this.signalOutputs.splice(e,1))}_reportError(t,e){this.error.payload=typeof e=="string"?new Error(e):e,this.error._activateSignal(t)}getSignalInput(t){return this.signalInputs.find(e=>e.name===t)}getSignalOutput(t){return this.signalOutputs.find(e=>e.name===t)}serialize(t={}){super.serialize(t),t.signalInputs=[],t.signalOutputs=[];for(const e of this.signalInputs){const o={};e.serialize(o),t.signalInputs.push(o)}for(const e of this.signalOutputs){const o={};e.serialize(o),t.signalOutputs.push(o)}}deserialize(t){for(let e=0;e{this.sceneReadyTriggered||(this.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}),this.sceneReadyTriggered=!0)}),this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{this.onEventTriggeredObservable.notifyObservers({type:"SceneDispose"})}),this._sceneOnBeforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{const t=this._scene.getEngine().getDeltaTime()/1e3;this.onEventTriggeredObservable.notifyObservers({type:"SceneBeforeRender",payload:{timeSinceStart:this._startingTime,deltaTime:t}}),this._startingTime+=t}),this._meshPickedObserver=this._scene.onPointerObservable.add(t=>{this.onEventTriggeredObservable.notifyObservers({type:"MeshPick",payload:t})},q.POINTERPICK),this._meshUnderPointerObserver=this._scene.onMeshUnderPointerUpdatedObservable.add(t=>{const e=t.pointerId,o=t.mesh,a=this._pointerUnderMeshState[e];!a&&o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o}}):a&&!o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:a}}):a&&o&&a!==o&&(this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:a,over:o}}),this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o,out:a}})),this._pointerUnderMeshState[e]=o},q.POINTERMOVE)}dispose(){this._sceneDisposeObserver?.remove(),this._sceneReadyObserver?.remove(),this._sceneOnBeforeRenderObserver?.remove(),this._meshPickedObserver?.remove(),this._meshUnderPointerObserver?.remove(),this.onEventTriggeredObservable.clear()}}function z(r,t){return!!(r.parent&&(r.parent===t||z(r.parent,t)))}function Wt(r){if(r.getClassName)return r.getClassName()}function Ut(r,t){return r===t&&(r==="Vector2"||r==="Vector3"||r==="Vector4"||r==="Quaternion")}function Ht(r,t){return r===t&&(r==="Matrix"||r==="Matrix2D"||r==="Matrix3D")}function Qt(r,t){return r==="FlowGraphInteger"&&t==="FlowGraphInteger"}function Jt(r,t){const e=typeof r=="number"||typeof r?.value=="number";return e&&!t?!isNaN(vt(r)):e}function vt(r){return typeof r=="number"?r:r.value}var H;(function(r){r[r.Stopped=0]="Stopped",r[r.Started=1]="Started"})(H||(H={}));class It{get state(){return this._state}set state(t){this._state=t,this.onStateChangedObservable.notifyObservers(t)}constructor(t){this.onStateChangedObservable=new O,this._eventBlocks={SceneReady:[],SceneDispose:[],SceneBeforeRender:[],MeshPick:[],PointerDown:[],PointerUp:[],PointerMove:[],PointerOver:[],PointerOut:[],SceneAfterRender:[],NoTrigger:[]},this._executionContexts=[],this._state=0,this._scene=t.scene,this._sceneEventCoordinator=new Et(this._scene),this._coordinator=t.coordinator,this._eventObserver=this._sceneEventCoordinator.onEventTriggeredObservable.add(e=>{for(const o of this._executionContexts){const a=this._getContextualOrder(e.type,o);for(const i of a)if(!i._executeEvent(o,e.payload))break}switch(e.type){case"SceneReady":this._sceneEventCoordinator.sceneReadyTriggered=!0;break;case"SceneBeforeRender":for(const o of this._executionContexts)o._notifyOnTick(e.payload);break;case"SceneDispose":this.dispose();break}})}createContext(){const t=new X({scene:this._scene,coordinator:this._coordinator});return this._executionContexts.push(t),t}getContext(t){return this._executionContexts[t]}addEventBlock(t){if((t.type==="PointerOver"||t.type==="PointerOut")&&(this._scene.constantlyUpdateMeshUnderPointer=!0),t.type!=="NoTrigger"&&this._eventBlocks[t.type].push(t),this.state===1)for(const e of this._executionContexts)t._startPendingTasks(e);else this.onStateChangedObservable.addOnce(e=>{if(e===1)for(const o of this._executionContexts)t._startPendingTasks(o)})}start(){this.state!==1&&(this._executionContexts.length===0&&this.createContext(),this.onStateChangedObservable.add(t=>{t===1&&(this._startPendingEvents(),this._scene.isReady(!0)&&this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}))}),this.state=1)}_startPendingEvents(){for(const t of this._executionContexts)for(const e in this._eventBlocks){const o=this._getContextualOrder(e,t);for(const a of o)a._startPendingTasks(t)}}_getContextualOrder(t,e){const o=this._eventBlocks[t].sort((a,i)=>i.initPriority-a.initPriority);if(t==="MeshPick"){const a=[];for(const i of o){const s=i.asset.getValue(e);let c=0;for(;c0;){const a=e.pop();t(a);for(const i of a.dataInputs)for(const s of i._connectedPoint)o.has(s._ownerBlock.uniqueId)||(e.push(s._ownerBlock),o.add(s._ownerBlock.uniqueId));if(a instanceof D)for(const i of a.signalOutputs)for(const s of i._connectedPoint)o.has(s._ownerBlock.uniqueId)||(e.push(s._ownerBlock),o.add(s._ownerBlock.uniqueId))}}serialize(t={},e){t.allBlocks=[],this.visitAllBlocks(o=>{const a={};o.serialize(a),t.allBlocks.push(a)}),t.executionContexts=[];for(const o of this._executionContexts){const a={};o.serialize(a,e),t.executionContexts.push(a)}}}class g{constructor(t){this.config=t,this.dispatchEventsSynchronously=!0,this._flowGraphs=[],this._customEventsMap=new Map,this._eventExecutionCounter=new Map,this._executeOnNextFrame=[],this._eventUniqueId=0,this._disposeObserver=this.config.scene.onDisposeObservable.add(()=>{this.dispose()}),this._onBeforeRenderObserver=this.config.scene.onBeforeRenderObservable.add(()=>{this._eventExecutionCounter.clear();const o=this._executeOnNextFrame.slice(0);if(o.length)for(const a of o){this.notifyCustomEvent(a.id,a.data,!1);const i=this._executeOnNextFrame.findIndex(s=>s.uniqueId===a.uniqueId);i!==-1&&this._executeOnNextFrame.splice(i,1)}}),(g.SceneCoordinators.get(this.config.scene)??[]).push(this)}createGraph(){const t=new It({scene:this.config.scene,coordinator:this});return this._flowGraphs.push(t),t}removeGraph(t){const e=this._flowGraphs.indexOf(t);e!==-1&&(t.dispose(),this._flowGraphs.splice(e,1))}start(){for(const t of this._flowGraphs)t.start()}dispose(){for(const o of this._flowGraphs)o.dispose();this._flowGraphs.length=0,this._disposeObserver?.remove(),this._onBeforeRenderObserver?.remove();const t=g.SceneCoordinators.get(this.config.scene)??[],e=t.indexOf(this);e!==-1&&t.splice(e,1)}serialize(t,e){t._flowGraphs=[];for(const o of this._flowGraphs){const a={};o.serialize(a,e),t._flowGraphs.push(a)}t.dispatchEventsSynchronously=this.dispatchEventsSynchronously}get flowGraphs(){return this._flowGraphs}getCustomEventObservable(t){let e=this._customEventsMap.get(t);return e||(e=new O,this._customEventsMap.set(t,e)),e}notifyCustomEvent(t,e,o=!this.dispatchEventsSynchronously){if(o){this._executeOnNextFrame.push({id:t,data:e,uniqueId:this._eventUniqueId++});return}if(this._eventExecutionCounter.has(t)){const i=this._eventExecutionCounter.get(t);if(this._eventExecutionCounter.set(t,i+1),i>=g.MaxEventTypeExecutionPerFrame){i===g.MaxEventTypeExecutionPerFrame&&p.Warn(`FlowGraphCoordinator: Too many executions of event "${t}".`);return}}else this._eventExecutionCounter.set(t,1);const a=this._customEventsMap.get(t);a&&a.notifyObservers(e)}}g.MaxEventsPerType=30;g.MaxEventTypeExecutionPerFrame=30;g.SceneCoordinators=new Map;const N={};function Tt(r,t,e){N[`${r}/${t}`]=e}function Vt(r){switch(r){case"FlowGraphPlayAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphPlayAnimationBlock:t}=await import("./flowGraphPlayAnimationBlock-yMdaunvk.js");return{FlowGraphPlayAnimationBlock:t}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).FlowGraphPlayAnimationBlock;case"FlowGraphStopAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphStopAnimationBlock:t}=await import("./flowGraphStopAnimationBlock-Cex6L5GQ.js");return{FlowGraphStopAnimationBlock:t}},__vite__mapDeps([8,1,2,3,4,7]),import.meta.url)).FlowGraphStopAnimationBlock;case"FlowGraphPauseAnimationBlock":return async()=>(await n(async()=>{const{FlowGraphPauseAnimationBlock:t}=await import("./flowGraphPauseAnimationBlock-Jn1q4dx6.js");return{FlowGraphPauseAnimationBlock:t}},__vite__mapDeps([9,1,2,3,4,7]),import.meta.url)).FlowGraphPauseAnimationBlock;case"FlowGraphInterpolationBlock":return async()=>(await n(async()=>{const{FlowGraphInterpolationBlock:t}=await import("./flowGraphInterpolationBlock-CANx4XcO.js");return{FlowGraphInterpolationBlock:t}},__vite__mapDeps([10,1,2,3,4,7]),import.meta.url)).FlowGraphInterpolationBlock;case"FlowGraphSceneReadyEventBlock":return async()=>(await n(async()=>{const{FlowGraphSceneReadyEventBlock:t}=await import("./flowGraphSceneReadyEventBlock-Bv0Q4_Ma.js");return{FlowGraphSceneReadyEventBlock:t}},__vite__mapDeps([11,2,3,4,1,7]),import.meta.url)).FlowGraphSceneReadyEventBlock;case"FlowGraphSceneTickEventBlock":return async()=>(await n(async()=>{const{FlowGraphSceneTickEventBlock:t}=await import("./flowGraphSceneTickEventBlock-DAewRadS.js");return{FlowGraphSceneTickEventBlock:t}},__vite__mapDeps([12,2,3,4,1,7]),import.meta.url)).FlowGraphSceneTickEventBlock;case"FlowGraphSendCustomEventBlock":return async()=>(await n(async()=>{const{FlowGraphSendCustomEventBlock:t}=await import("./flowGraphSendCustomEventBlock-BzwzScub.js");return{FlowGraphSendCustomEventBlock:t}},__vite__mapDeps([13,2,3,4,1,7]),import.meta.url)).FlowGraphSendCustomEventBlock;case"FlowGraphReceiveCustomEventBlock":return async()=>(await n(async()=>{const{FlowGraphReceiveCustomEventBlock:t}=await import("./flowGraphReceiveCustomEventBlock-sg3CxkkW.js");return{FlowGraphReceiveCustomEventBlock:t}},__vite__mapDeps([14,2,3,4,1,7]),import.meta.url)).FlowGraphReceiveCustomEventBlock;case"FlowGraphMeshPickEventBlock":return async()=>(await n(async()=>{const{FlowGraphMeshPickEventBlock:t}=await import("./flowGraphMeshPickEventBlock-CzCmGJcz.js");return{FlowGraphMeshPickEventBlock:t}},__vite__mapDeps([15,2,3,4,1,7]),import.meta.url)).FlowGraphMeshPickEventBlock;case"FlowGraphEBlock":return async()=>(await n(async()=>{const{FlowGraphEBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphEBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphEBlock;case"FlowGraphPIBlock":return async()=>(await n(async()=>{const{FlowGraphPiBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphPiBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphPiBlock;case"FlowGraphInfBlock":return async()=>(await n(async()=>{const{FlowGraphInfBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphInfBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphInfBlock;case"FlowGraphNaNBlock":return async()=>(await n(async()=>{const{FlowGraphNaNBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphNaNBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphNaNBlock;case"FlowGraphRandomBlock":return async()=>(await n(async()=>{const{FlowGraphRandomBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphRandomBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRandomBlock;case"FlowGraphAddBlock":return async()=>(await n(async()=>{const{FlowGraphAddBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAddBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAddBlock;case"FlowGraphSubtractBlock":return async()=>(await n(async()=>{const{FlowGraphSubtractBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSubtractBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSubtractBlock;case"FlowGraphMultiplyBlock":return async()=>(await n(async()=>{const{FlowGraphMultiplyBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphMultiplyBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMultiplyBlock;case"FlowGraphDivideBlock":return async()=>(await n(async()=>{const{FlowGraphDivideBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphDivideBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphDivideBlock;case"FlowGraphAbsBlock":return async()=>(await n(async()=>{const{FlowGraphAbsBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAbsBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAbsBlock;case"FlowGraphSignBlock":return async()=>(await n(async()=>{const{FlowGraphSignBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSignBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSignBlock;case"FlowGraphTruncBlock":return async()=>(await n(async()=>{const{FlowGraphTruncBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphTruncBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTruncBlock;case"FlowGraphFloorBlock":return async()=>(await n(async()=>{const{FlowGraphFloorBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphFloorBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphFloorBlock;case"FlowGraphCeilBlock":return async()=>(await n(async()=>{const{FlowGraphCeilBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphCeilBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCeilBlock;case"FlowGraphRoundBlock":return async()=>(await n(async()=>{const{FlowGraphRoundBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphRoundBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRoundBlock;case"FlowGraphFractBlock":return async()=>(await n(async()=>{const{FlowGraphFractionBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphFractionBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphFractionBlock;case"FlowGraphNegationBlock":return async()=>(await n(async()=>{const{FlowGraphNegationBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphNegationBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphNegationBlock;case"FlowGraphModuloBlock":return async()=>(await n(async()=>{const{FlowGraphModuloBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphModuloBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphModuloBlock;case"FlowGraphMinBlock":return async()=>(await n(async()=>{const{FlowGraphMinBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphMinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMinBlock;case"FlowGraphMaxBlock":return async()=>(await n(async()=>{const{FlowGraphMaxBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphMaxBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMaxBlock;case"FlowGraphClampBlock":return async()=>(await n(async()=>{const{FlowGraphClampBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphClampBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphClampBlock;case"FlowGraphSaturateBlock":return async()=>(await n(async()=>{const{FlowGraphSaturateBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSaturateBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSaturateBlock;case"FlowGraphMathInterpolationBlock":return async()=>(await n(async()=>{const{FlowGraphMathInterpolationBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphMathInterpolationBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphMathInterpolationBlock;case"FlowGraphEqualityBlock":return async()=>(await n(async()=>{const{FlowGraphEqualityBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphEqualityBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphEqualityBlock;case"FlowGraphLessThanBlock":return async()=>(await n(async()=>{const{FlowGraphLessThanBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLessThanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLessThanBlock;case"FlowGraphLessThanOrEqualBlock":return async()=>(await n(async()=>{const{FlowGraphLessThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLessThanOrEqualBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLessThanOrEqualBlock;case"FlowGraphGreaterThanBlock":return async()=>(await n(async()=>{const{FlowGraphGreaterThanBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphGreaterThanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphGreaterThanBlock;case"FlowGraphGreaterThanOrEqualBlock":return async()=>(await n(async()=>{const{FlowGraphGreaterThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphGreaterThanOrEqualBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphGreaterThanOrEqualBlock;case"FlowGraphIsNaNBlock":return async()=>(await n(async()=>{const{FlowGraphIsNanBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphIsNanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphIsNanBlock;case"FlowGraphIsInfBlock":return async()=>(await n(async()=>{const{FlowGraphIsInfinityBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphIsInfinityBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphIsInfinityBlock;case"FlowGraphDegToRadBlock":return async()=>(await n(async()=>{const{FlowGraphDegToRadBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphDegToRadBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphDegToRadBlock;case"FlowGraphRadToDegBlock":return async()=>(await n(async()=>{const{FlowGraphRadToDegBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphRadToDegBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphRadToDegBlock;case"FlowGraphSinBlock":return async()=>(await n(async()=>{const{FlowGraphSinBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSinBlock;case"FlowGraphCosBlock":return async()=>(await n(async()=>{const{FlowGraphCosBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphCosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCosBlock;case"FlowGraphTanBlock":return async()=>(await n(async()=>{const{FlowGraphTanBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphTanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTanBlock;case"FlowGraphASinBlock":return async()=>(await n(async()=>{const{FlowGraphAsinBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAsinBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAsinBlock;case"FlowGraphACosBlock":return async()=>(await n(async()=>{const{FlowGraphAcosBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAcosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAcosBlock;case"FlowGraphATanBlock":return async()=>(await n(async()=>{const{FlowGraphAtanBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAtanBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtanBlock;case"FlowGraphATan2Block":return async()=>(await n(async()=>{const{FlowGraphAtan2Block:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAtan2Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtan2Block;case"FlowGraphSinhBlock":return async()=>(await n(async()=>{const{FlowGraphSinhBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSinhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSinhBlock;case"FlowGraphCoshBlock":return async()=>(await n(async()=>{const{FlowGraphCoshBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphCoshBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCoshBlock;case"FlowGraphTanhBlock":return async()=>(await n(async()=>{const{FlowGraphTanhBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphTanhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTanhBlock;case"FlowGraphASinhBlock":return async()=>(await n(async()=>{const{FlowGraphAsinhBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAsinhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAsinhBlock;case"FlowGraphACoshBlock":return async()=>(await n(async()=>{const{FlowGraphAcoshBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAcoshBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAcoshBlock;case"FlowGraphATanhBlock":return async()=>(await n(async()=>{const{FlowGraphAtanhBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphAtanhBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphAtanhBlock;case"FlowGraphExponentialBlock":return async()=>(await n(async()=>{const{FlowGraphExpBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphExpBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphExpBlock;case"FlowGraphLogBlock":return async()=>(await n(async()=>{const{FlowGraphLogBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLogBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLogBlock;case"FlowGraphLog2Block":return async()=>(await n(async()=>{const{FlowGraphLog2Block:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLog2Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLog2Block;case"FlowGraphLog10Block":return async()=>(await n(async()=>{const{FlowGraphLog10Block:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLog10Block:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLog10Block;case"FlowGraphSquareRootBlock":return async()=>(await n(async()=>{const{FlowGraphSquareRootBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphSquareRootBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphSquareRootBlock;case"FlowGraphPowerBlock":return async()=>(await n(async()=>{const{FlowGraphPowerBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphPowerBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphPowerBlock;case"FlowGraphCubeRootBlock":return async()=>(await n(async()=>{const{FlowGraphCubeRootBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphCubeRootBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphCubeRootBlock;case"FlowGraphBitwiseAndBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseAndBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseAndBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseAndBlock;case"FlowGraphBitwiseOrBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseOrBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseOrBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseOrBlock;case"FlowGraphBitwiseNotBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseNotBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseNotBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseNotBlock;case"FlowGraphBitwiseXorBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseXorBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseXorBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseXorBlock;case"FlowGraphBitwiseLeftShiftBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseLeftShiftBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseLeftShiftBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseLeftShiftBlock;case"FlowGraphBitwiseRightShiftBlock":return async()=>(await n(async()=>{const{FlowGraphBitwiseRightShiftBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphBitwiseRightShiftBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphBitwiseRightShiftBlock;case"FlowGraphLengthBlock":return async()=>(await n(async()=>{const{FlowGraphLengthBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphLengthBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphLengthBlock;case"FlowGraphNormalizeBlock":return async()=>(await n(async()=>{const{FlowGraphNormalizeBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphNormalizeBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphNormalizeBlock;case"FlowGraphDotBlock":return async()=>(await n(async()=>{const{FlowGraphDotBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphDotBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphDotBlock;case"FlowGraphCrossBlock":return async()=>(await n(async()=>{const{FlowGraphCrossBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphCrossBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphCrossBlock;case"FlowGraphRotate2DBlock":return async()=>(await n(async()=>{const{FlowGraphRotate2DBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphRotate2DBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphRotate2DBlock;case"FlowGraphRotate3DBlock":return async()=>(await n(async()=>{const{FlowGraphRotate3DBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphRotate3DBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphRotate3DBlock;case"FlowGraphTransposeBlock":return async()=>(await n(async()=>{const{FlowGraphTransposeBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphTransposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphTransposeBlock;case"FlowGraphDeterminantBlock":return async()=>(await n(async()=>{const{FlowGraphDeterminantBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphDeterminantBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphDeterminantBlock;case"FlowGraphInvertMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphInvertMatrixBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphInvertMatrixBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphInvertMatrixBlock;case"FlowGraphMatrixMultiplicationBlock":return async()=>(await n(async()=>{const{FlowGraphMatrixMultiplicationBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphMatrixMultiplicationBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixMultiplicationBlock;case"FlowGraphBranchBlock":return async()=>(await n(async()=>{const{FlowGraphBranchBlock:t}=await import("./flowGraphBranchBlock-up3wUT00.js");return{FlowGraphBranchBlock:t}},__vite__mapDeps([22,1,2,3,4,7]),import.meta.url)).FlowGraphBranchBlock;case"FlowGraphSetDelayBlock":return async()=>(await n(async()=>{const{FlowGraphSetDelayBlock:t}=await import("./flowGraphSetDelayBlock-DufofuPB.js");return{FlowGraphSetDelayBlock:t}},__vite__mapDeps([23,1,2,3,4,7]),import.meta.url)).FlowGraphSetDelayBlock;case"FlowGraphCancelDelayBlock":return async()=>(await n(async()=>{const{FlowGraphCancelDelayBlock:t}=await import("./flowGraphCancelDelayBlock-BCGD7j_Y.js");return{FlowGraphCancelDelayBlock:t}},__vite__mapDeps([24,2,3,4,1,7]),import.meta.url)).FlowGraphCancelDelayBlock;case"FlowGraphCallCounterBlock":return async()=>(await n(async()=>{const{FlowGraphCallCounterBlock:t}=await import("./flowGraphCounterBlock-B3fMG4Oh.js");return{FlowGraphCallCounterBlock:t}},__vite__mapDeps([25,1,2,3,4,7]),import.meta.url)).FlowGraphCallCounterBlock;case"FlowGraphDebounceBlock":return async()=>(await n(async()=>{const{FlowGraphDebounceBlock:t}=await import("./flowGraphDebounceBlock-cgUWhMk1.js");return{FlowGraphDebounceBlock:t}},__vite__mapDeps([26,1,2,3,4,7]),import.meta.url)).FlowGraphDebounceBlock;case"FlowGraphThrottleBlock":return async()=>(await n(async()=>{const{FlowGraphThrottleBlock:t}=await import("./flowGraphThrottleBlock-DA8gjjoT.js");return{FlowGraphThrottleBlock:t}},__vite__mapDeps([27,1,2,3,4,7]),import.meta.url)).FlowGraphThrottleBlock;case"FlowGraphDoNBlock":return async()=>(await n(async()=>{const{FlowGraphDoNBlock:t}=await import("./flowGraphDoNBlock-BSmSYu4W.js");return{FlowGraphDoNBlock:t}},__vite__mapDeps([28,1,2,3,4,7]),import.meta.url)).FlowGraphDoNBlock;case"FlowGraphFlipFlopBlock":return async()=>(await n(async()=>{const{FlowGraphFlipFlopBlock:t}=await import("./flowGraphFlipFlopBlock-CQj0gp2M.js");return{FlowGraphFlipFlopBlock:t}},__vite__mapDeps([29,1,2,3,4,7]),import.meta.url)).FlowGraphFlipFlopBlock;case"FlowGraphForLoopBlock":return async()=>(await n(async()=>{const{FlowGraphForLoopBlock:t}=await import("./flowGraphForLoopBlock-VMf2cpFK.js");return{FlowGraphForLoopBlock:t}},__vite__mapDeps([30,1,2,3,4,7]),import.meta.url)).FlowGraphForLoopBlock;case"FlowGraphMultiGateBlock":return async()=>(await n(async()=>{const{FlowGraphMultiGateBlock:t}=await import("./flowGraphMultiGateBlock-Cnyy87B-.js");return{FlowGraphMultiGateBlock:t}},__vite__mapDeps([31,2,3,4,1,7]),import.meta.url)).FlowGraphMultiGateBlock;case"FlowGraphSequenceBlock":return async()=>(await n(async()=>{const{FlowGraphSequenceBlock:t}=await import("./flowGraphSequenceBlock-C3QMqWII.js");return{FlowGraphSequenceBlock:t}},__vite__mapDeps([32,2,3,4,1,7]),import.meta.url)).FlowGraphSequenceBlock;case"FlowGraphSwitchBlock":return async()=>(await n(async()=>{const{FlowGraphSwitchBlock:t}=await import("./flowGraphSwitchBlock-FyxUNMq-.js");return{FlowGraphSwitchBlock:t}},__vite__mapDeps([33,1,2,3,4,7]),import.meta.url)).FlowGraphSwitchBlock;case"FlowGraphWaitAllBlock":return async()=>(await n(async()=>{const{FlowGraphWaitAllBlock:t}=await import("./flowGraphWaitAllBlock-DpoWxZ2D.js");return{FlowGraphWaitAllBlock:t}},__vite__mapDeps([34,2,3,4,1,7]),import.meta.url)).FlowGraphWaitAllBlock;case"FlowGraphWhileLoopBlock":return async()=>(await n(async()=>{const{FlowGraphWhileLoopBlock:t}=await import("./flowGraphWhileLoopBlock-DfCG3NGj.js");return{FlowGraphWhileLoopBlock:t}},__vite__mapDeps([35,1,2,3,4,7]),import.meta.url)).FlowGraphWhileLoopBlock;case"FlowGraphConsoleLogBlock":return async()=>(await n(async()=>{const{FlowGraphConsoleLogBlock:t}=await import("./flowGraphConsoleLogBlock-CdQ_BZMp.js");return{FlowGraphConsoleLogBlock:t}},__vite__mapDeps([36,1,2,3,4,7]),import.meta.url)).FlowGraphConsoleLogBlock;case"FlowGraphConditionalBlock":return async()=>(await n(async()=>{const{FlowGraphConditionalDataBlock:t}=await import("./flowGraphConditionalDataBlock-ChAv1xDe.js");return{FlowGraphConditionalDataBlock:t}},__vite__mapDeps([37,1,2,3,4,7]),import.meta.url)).FlowGraphConditionalDataBlock;case"FlowGraphConstantBlock":return async()=>(await n(async()=>{const{FlowGraphConstantBlock:t}=await import("./flowGraphConstantBlock-ZwzU08iO.js");return{FlowGraphConstantBlock:t}},__vite__mapDeps([38,1,2,3,4,7]),import.meta.url)).FlowGraphConstantBlock;case"FlowGraphTransformCoordinatesSystemBlock":return async()=>(await n(async()=>{const{FlowGraphTransformCoordinatesSystemBlock:t}=await import("./flowGraphTransformCoordinatesSystemBlock-hXnZcke2.js");return{FlowGraphTransformCoordinatesSystemBlock:t}},__vite__mapDeps([39,1,2,3,4,7]),import.meta.url)).FlowGraphTransformCoordinatesSystemBlock;case"FlowGraphGetAssetBlock":return async()=>(await n(async()=>{const{FlowGraphGetAssetBlock:t}=await import("./flowGraphGetAssetBlock-Cc_FY6kq.js");return{FlowGraphGetAssetBlock:t}},__vite__mapDeps([40,1,2,3,4,7]),import.meta.url)).FlowGraphGetAssetBlock;case"FlowGraphGetPropertyBlock":return async()=>(await n(async()=>{const{FlowGraphGetPropertyBlock:t}=await import("./flowGraphGetPropertyBlock-CAj41dnr.js");return{FlowGraphGetPropertyBlock:t}},__vite__mapDeps([41,1,2,3,4,18,7]),import.meta.url)).FlowGraphGetPropertyBlock;case"FlowGraphSetPropertyBlock":return async()=>(await n(async()=>{const{FlowGraphSetPropertyBlock:t}=await import("./flowGraphSetPropertyBlock-Czv1gWvn.js");return{FlowGraphSetPropertyBlock:t}},__vite__mapDeps([42,1,2,3,4,7]),import.meta.url)).FlowGraphSetPropertyBlock;case"FlowGraphGetVariableBlock":return async()=>(await n(async()=>{const{FlowGraphGetVariableBlock:t}=await import("./flowGraphGetVariableBlock-BmAdsTSc.js");return{FlowGraphGetVariableBlock:t}},__vite__mapDeps([43,1,2,3,4,7]),import.meta.url)).FlowGraphGetVariableBlock;case"FlowGraphSetVariableBlock":return async()=>(await n(async()=>{const{FlowGraphSetVariableBlock:t}=await import("./flowGraphSetVariableBlock-D4KTri-H.js");return{FlowGraphSetVariableBlock:t}},__vite__mapDeps([44,2,3,4,1,7]),import.meta.url)).FlowGraphSetVariableBlock;case"FlowGraphJsonPointerParserBlock":return async()=>(await n(async()=>{const{FlowGraphJsonPointerParserBlock:t}=await import("./flowGraphJsonPointerParserBlock-Jp8NW6fo.js");return{FlowGraphJsonPointerParserBlock:t}},__vite__mapDeps([45,1,2,3,4,18,7]),import.meta.url)).FlowGraphJsonPointerParserBlock;case"FlowGraphLeadingZerosBlock":return async()=>(await n(async()=>{const{FlowGraphLeadingZerosBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphLeadingZerosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphLeadingZerosBlock;case"FlowGraphTrailingZerosBlock":return async()=>(await n(async()=>{const{FlowGraphTrailingZerosBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphTrailingZerosBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphTrailingZerosBlock;case"FlowGraphOneBitsCounterBlock":return async()=>(await n(async()=>{const{FlowGraphOneBitsCounterBlock:t}=await import("./flowGraphMathBlocks-z2zNUqDY.js");return{FlowGraphOneBitsCounterBlock:t}},__vite__mapDeps([16,2,3,4,1,17,18,19,7]),import.meta.url)).FlowGraphOneBitsCounterBlock;case"FlowGraphCombineVector2Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphCombineVector2Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector2Block;case"FlowGraphCombineVector3Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphCombineVector3Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector3Block;case"FlowGraphCombineVector4Block":return async()=>(await n(async()=>{const{FlowGraphCombineVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphCombineVector4Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineVector4Block;case"FlowGraphCombineMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphCombineMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphCombineMatrixBlock:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphCombineMatrixBlock;case"FlowGraphExtractVector2Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphExtractVector2Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector2Block;case"FlowGraphExtractVector3Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphExtractVector3Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector3Block;case"FlowGraphExtractVector4Block":return async()=>(await n(async()=>{const{FlowGraphExtractVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphExtractVector4Block:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractVector4Block;case"FlowGraphExtractMatrixBlock":return async()=>(await n(async()=>{const{FlowGraphExtractMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-DSiM9i66.js");return{FlowGraphExtractMatrixBlock:t}},__vite__mapDeps([46,18,1,2,3,4,7]),import.meta.url)).FlowGraphExtractMatrixBlock;case"FlowGraphTransformVectorBlock":return async()=>(await n(async()=>{const{FlowGraphTransformBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphTransformBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphTransformBlock;case"FlowGraphTransformCoordinatesBlock":return async()=>(await n(async()=>{const{FlowGraphTransformCoordinatesBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphTransformCoordinatesBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphTransformCoordinatesBlock;case"FlowGraphConjugateBlock":return async()=>(await n(async()=>{const{FlowGraphConjugateBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphConjugateBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphConjugateBlock;case"FlowGraphAngleBetweenBlock":return async()=>(await n(async()=>{const{FlowGraphAngleBetweenBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphAngleBetweenBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphAngleBetweenBlock;case"FlowGraphQuaternionFromAxisAngleBlock":return async()=>(await n(async()=>{const{FlowGraphQuaternionFromAxisAngleBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphQuaternionFromAxisAngleBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphQuaternionFromAxisAngleBlock;case"FlowGraphAxisAngleFromQuaternionBlock":return async()=>(await n(async()=>{const{FlowGraphAxisAngleFromQuaternionBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphAxisAngleFromQuaternionBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphAxisAngleFromQuaternionBlock;case"FlowGraphQuaternionFromDirectionsBlock":return async()=>(await n(async()=>{const{FlowGraphQuaternionFromDirectionsBlock:t}=await import("./flowGraphVectorMathBlocks-DTKNQnH4.js");return{FlowGraphQuaternionFromDirectionsBlock:t}},__vite__mapDeps([20,1,2,3,4,17,18,19,7]),import.meta.url)).FlowGraphQuaternionFromDirectionsBlock;case"FlowGraphMatrixDecompose":return async()=>(await n(async()=>{const{FlowGraphMatrixDecomposeBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphMatrixDecomposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixDecomposeBlock;case"FlowGraphMatrixCompose":return async()=>(await n(async()=>{const{FlowGraphMatrixComposeBlock:t}=await import("./flowGraphMatrixMathBlocks-1adeofxu.js");return{FlowGraphMatrixComposeBlock:t}},__vite__mapDeps([21,1,2,3,4,19,18,17,7]),import.meta.url)).FlowGraphMatrixComposeBlock;case"FlowGraphBooleanToFloat":return async()=>(await n(async()=>{const{FlowGraphBooleanToFloat:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphBooleanToFloat:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphBooleanToFloat;case"FlowGraphBooleanToInt":return async()=>(await n(async()=>{const{FlowGraphBooleanToInt:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphBooleanToInt:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphBooleanToInt;case"FlowGraphFloatToBoolean":return async()=>(await n(async()=>{const{FlowGraphFloatToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphFloatToBoolean:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphFloatToBoolean;case"FlowGraphIntToBoolean":return async()=>(await n(async()=>{const{FlowGraphIntToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphIntToBoolean:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphIntToBoolean;case"FlowGraphIntToFloat":return async()=>(await n(async()=>{const{FlowGraphIntToFloat:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphIntToFloat:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphIntToFloat;case"FlowGraphFloatToInt":return async()=>(await n(async()=>{const{FlowGraphFloatToInt:t}=await import("./flowGraphTypeToTypeBlocks-hZnJ2rXW.js");return{FlowGraphFloatToInt:t}},__vite__mapDeps([47,19,18,1,2,3,4,7]),import.meta.url)).FlowGraphFloatToInt;case"FlowGraphEasingBlock":return async()=>(await n(async()=>{const{FlowGraphEasingBlock:t}=await import("./flowGraphEasingBlock-D_7QLffQ.js");return{FlowGraphEasingBlock:t}},__vite__mapDeps([48,2,3,4,1,7]),import.meta.url)).FlowGraphEasingBlock;case"FlowGraphBezierCurveEasing":return async()=>(await n(async()=>{const{FlowGraphBezierCurveEasingBlock:t}=await import("./flowGraphBezierCurveEasingBlock-Bn0_rCS1.js");return{FlowGraphBezierCurveEasingBlock:t}},__vite__mapDeps([49,2,3,4,1,7]),import.meta.url)).FlowGraphBezierCurveEasingBlock;case"FlowGraphPointerOverEventBlock":return async()=>(await n(async()=>{const{FlowGraphPointerOverEventBlock:t}=await import("./flowGraphPointerOverEventBlock-B5Sh8KiE.js");return{FlowGraphPointerOverEventBlock:t}},__vite__mapDeps([50,1,2,3,4,7]),import.meta.url)).FlowGraphPointerOverEventBlock;case"FlowGraphPointerOutEventBlock":return async()=>(await n(async()=>{const{FlowGraphPointerOutEventBlock:t}=await import("./flowGraphPointerOutEventBlock-Dz_uC9Ho.js");return{FlowGraphPointerOutEventBlock:t}},__vite__mapDeps([51,1,2,3,4,7]),import.meta.url)).FlowGraphPointerOutEventBlock;case"FlowGraphContextBlock":return async()=>(await n(async()=>{const{FlowGraphContextBlock:t}=await import("./flowGraphContextBlock-Dkn_mjiI.js");return{FlowGraphContextBlock:t}},__vite__mapDeps([52,1,2,3,4,7]),import.meta.url)).FlowGraphContextBlock;case"FlowGraphArrayIndexBlock":return async()=>(await n(async()=>{const{FlowGraphArrayIndexBlock:t}=await import("./flowGraphArrayIndexBlock-C-6tnsIF.js");return{FlowGraphArrayIndexBlock:t}},__vite__mapDeps([53,1,2,3,4,7]),import.meta.url)).FlowGraphArrayIndexBlock;case"FlowGraphCodeExecutionBlock":return async()=>(await n(async()=>{const{FlowGraphCodeExecutionBlock:t}=await import("./flowGraphCodeExecutionBlock-BMHxPqK5.js");return{FlowGraphCodeExecutionBlock:t}},__vite__mapDeps([54,1,2,3,4,7]),import.meta.url)).FlowGraphCodeExecutionBlock;case"FlowGraphIndexOfBlock":return async()=>(await n(async()=>{const{FlowGraphIndexOfBlock:t}=await import("./flowGraphIndexOfBlock-ClcxICeW.js");return{FlowGraphIndexOfBlock:t}},__vite__mapDeps([55,1,2,3,4,7]),import.meta.url)).FlowGraphIndexOfBlock;case"FlowGraphFunctionReference":return async()=>(await n(async()=>{const{FlowGraphFunctionReferenceBlock:t}=await import("./flowGraphFunctionReferenceBlock-DA2-VZ2n.js");return{FlowGraphFunctionReferenceBlock:t}},__vite__mapDeps([56,1,2,3,4,7]),import.meta.url)).FlowGraphFunctionReferenceBlock;case"FlowGraphDataSwitchBlock":return async()=>(await n(async()=>{const{FlowGraphDataSwitchBlock:t}=await import("./flowGraphDataSwitchBlock-D4WhGjRY.js");return{FlowGraphDataSwitchBlock:t}},__vite__mapDeps([57,1,2,3,4,7]),import.meta.url)).FlowGraphDataSwitchBlock;default:if(N[r])return N[r];throw new Error(`Unknown block name ${r}`)}}class Ct extends D{constructor(t){super(t),this.out=this._registerSignalOutput("out")}}class Pt extends Ct{constructor(t,e){if(super(t),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),e)for(const o of e)this._eventsSignalOutputs[o]=this._registerSignalOutput(o+"Event")}_executeOnTick(t){}_startPendingTasks(t){t._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(t),this._resetAfterCanceled(t)),this._preparePendingTasks(t),t._addPendingBlock(this),this.out._activateSignal(t),t._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(t){t._deleteExecutionVariable(this,"_initialized"),t._removePendingBlock(this)}}class bt extends Pt{constructor(){super(...arguments),this.initPriority=0,this.type="NoTrigger"}_execute(t){t._notifyExecuteNode(this),this.done._activateSignal(t)}}function Ot(r,t){for(const e of r)for(const o of e.dataOutputs)if(o.uniqueId===t)return o;throw new Error("Could not find data out connection with unique id "+t)}function xt(r,t){for(const e of r)if(e instanceof D){for(const o of e.signalInputs)if(o.uniqueId===t)return o}throw new Error("Could not find signal in connection with unique id "+t)}async function Dt(r,t){const e=await Promise.all(r.allBlocks.map(async o=>await Vt(o.className)()));return At(r,t,e)}function At(r,t,e){const o=t.coordinator.createGraph(),a=[],i=t.valueParseFunction??x;for(let s=0;si.getMeshById(l)),lights:s.lights?.map(l=>i.getLightByName(l)),cameras:s.cameras?.map(l=>i.getCameraByName(l)),materials:s.materials?.map(l=>i.getMaterialById(l)),textures:s.textures?.map(l=>i.getTextureByName(l)),animations:s.animations?.map(l=>i.animations.find(_=>_.name===l)),skeletons:s.skeletons?.map(l=>i.getSkeletonByName(l)),particleSystems:s.particleSystems?.map(l=>i.getParticleSystemById(l)),animationGroups:s.animationGroups?.map(l=>i.getAnimationGroupByName(l)),transformNodes:s.transformNodes?.map(l=>i.getTransformNodeById(l)),rootNodes:[],multiMaterials:[],morphTargetManagers:[],geometries:[],actionManagers:[],environmentTexture:null,postProcesses:[],sounds:null,effectLayers:[],layers:[],reflectionProbes:[],lensFlareSystems:[],proceduralTextures:[],getNodes:function(){throw new Error("Function not implemented.")}};o.assetsContext=c}for(const s in r._userVariables){const c=a(s,r._userVariables,o.assetsContext,i);o.userVariables[s]=c}for(const s in r._connectionValues){const c=a(s,r._connectionValues,o.assetsContext,i);o._setConnectionValueByKey(s,c)}return o}function Lt(r,t,e){const o={},a=t.valueParseFunction??x;if(r.config)for(const s in r.config)o[s]=a(s,r.config,t.assetsContainer||t.scene,t.scene);if(kt(r.className)){if(!t.pathConverter)throw new Error("Path converter is required for this block");o.pathConverter=t.pathConverter}const i=new e(o);i.uniqueId=r.uniqueId;for(let s=0;s{const a=t.values?.[o];if(!a)throw p.Error(["No value found for event key",o]),new Error("Error parsing events");const i=this._types[a.type];if(!i)throw p.Error(["No type found for event value",a]),new Error("Error parsing events");const s=typeof a.value<"u"?this._parseVariable(a):void 0;return{id:o,type:i.flowGraphType,eventData:!0,value:s}})),this._events.push(e)}}_parseNodes(){if(this._interactivityGraph.nodes)for(const t of this._interactivityGraph.nodes){if(typeof t.declaration!="number")throw p.Error(["No declaration found for node",t]),new Error("Error parsing nodes");const e=this._mappings[t.declaration];if(!e)throw p.Error(["No mapping found for node",t]),new Error("Error parsing nodes");if(e.flowGraphMapping.validation){const a=e.flowGraphMapping.validation(t,this._interactivityGraph,this._gltf);if(!a.valid)throw new Error(`Error validating interactivity node ${this._interactivityGraph.declarations?.[t.declaration].op} - ${a.error}`)}const o=[];for(const a of e.flowGraphMapping.blocks){const i=this._getEmptyBlock(a,e.fullOperationName);this._parseNodeConfiguration(t,i,e.flowGraphMapping,a),o.push(i)}this._nodes.push({blocks:o,fullOperationName:e.fullOperationName})}}_getEmptyBlock(t,e){return{uniqueId:I(),className:t,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:e,metadata:{}}}_parseNodeConfiguration(t,e,o,a){const i=t.configuration;if(i)for(const s in i){const c=i[s];if(!c)throw new Error("Error parsing node configuration");const l=o.configuration?.[s];if(l&&l.toBlock?l.toBlock===a:o.blocks.indexOf(a)===0){let u=l?.defaultValue;c?.value&&(u=c.value),l?.isArray||(u.length!==1&&p.Warn(`Invalid non-array value length: ${u.length}`),u=u[0]),l?.dataTransformer&&(u=l.dataTransformer(u,this)),u!==void 0&&(e.config[l?.name||s]={value:u})}}}_parseNodeConnections(t){for(let e=0;ef.className===h.toBlock)||a.blocks[0]).signalOutputs.push(T);const A=w.node,d=this._nodes[A];if(!d)throw p.Error(["No node found for input node id",A]),new Error("Error parsing node connections");const k=$(d.fullOperationName);if(!k)throw p.Error(["No mapping found for input node",d]),new Error("Error parsing node connections");let m=k.inputs?.flows?.[w.socket||"in"],B=!1;if(!m)for(const f in k.inputs?.flows)f.startsWith("[")&&f.endsWith("]")&&(B=!0,m=k.inputs?.flows?.[f]);const y=m?B?m.name.replace("$1",w.socket||""):m.name:w.socket||"in",C=m&&m.toBlock&&d.blocks.find(f=>f.className===m.toBlock)||d.blocks[0];let G=C.signalInputs.find(f=>f.name===y);G||(G=this._createNewSocketConnection(y),C.signalInputs.push(G)),G.connectedPointIds.push(T.uniqueId),T.connectedPointIds.push(G.uniqueId)}const l=o.values||{},_=Object.keys(l);for(const u of _){const w=l[u];let h=i.flowGraphMapping.inputs?.values?.[u],v=!1;if(!h)for(const d in i.flowGraphMapping.inputs?.values)d.startsWith("[")&&d.endsWith("]")&&(v=!0,h=i.flowGraphMapping.inputs?.values?.[d]);const T=h?v?h.name.replace("$1",u):h.name:u,V=this._createNewSocketConnection(T);if((h&&h.toBlock&&a.blocks.find(d=>d.className===h.toBlock)||a.blocks[0]).dataInputs.push(V),w.value!==void 0){const d=this._parseVariable(w,h&&h.dataTransformer);t._connectionValues[V.uniqueId]=d}else if(typeof w.node<"u"){const d=w.node,k=w.socket||"value",m=this._nodes[d];if(!m)throw p.Error(["No node found for output socket reference",w]),new Error("Error parsing node connections");const B=$(m.fullOperationName);if(!B)throw p.Error(["No mapping found for output socket reference",w]),new Error("Error parsing node connections");let y=B.outputs?.values?.[k],C=!1;if(!y)for(const F in B.outputs?.values)F.startsWith("[")&&F.endsWith("]")&&(C=!0,y=B.outputs?.values?.[F]);const G=y?C?y.name.replace("$1",k):y?.name:k,f=y&&y.toBlock&&m.blocks.find(F=>F.className===y.toBlock)||m.blocks[0];let P=f.dataOutputs.find(F=>F.name===G);P||(P=this._createNewSocketConnection(G,!0),f.dataOutputs.push(P)),V.connectedPointIds.push(P.uniqueId),P.connectedPointIds.push(V.uniqueId)}else throw p.Error(["Invalid value for value connection",w]),new Error("Error parsing node connections")}if(i.flowGraphMapping.interBlockConnectors)for(const u of i.flowGraphMapping.interBlockConnectors){const w=u.input,h=u.output,v=u.isVariable;this._connectFlowGraphNodes(w,h,a.blocks[u.inputBlockIndex],a.blocks[u.outputBlockIndex],v)}if(i.flowGraphMapping.extraProcessor){const u=this._interactivityGraph.declarations?.[o.declaration];if(!u)throw p.Error(["No declaration found for extra processor",o]),new Error("Error parsing node connections");a.blocks=i.flowGraphMapping.extraProcessor(o,u,i.flowGraphMapping,this,a.blocks,t,this._gltf)}}}_createNewSocketConnection(t,e){return{uniqueId:I(),name:t,_connectionType:e?1:0,connectedPointIds:[]}}_connectFlowGraphNodes(t,e,o,a,i){const s=i?o.dataInputs:o.signalInputs,c=i?a.dataOutputs:a.signalOutputs,l=s.find(u=>u.name===t)||this._createNewSocketConnection(t),_=c.find(u=>u.name===e)||this._createNewSocketConnection(e,!0);s.find(u=>u.name===t)||s.push(l),c.find(u=>u.name===e)||c.push(_),l.connectedPointIds.push(_.uniqueId),_.connectedPointIds.push(l.uniqueId)}getVariableName(t){return"staticVariable_"+t}serializeToFlowGraph(){const t={uniqueId:I(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(t);for(let o=0;oo.concat(a.blocks),[]),executionContexts:[t]}}}const b="KHR_interactivity";class j{constructor(t){this._loader=t,this.name=b,this.enabled=this._loader.isExtensionUsed(b),this._pathConverter=dt(this._loader.gltf),t._skipStartAnimationStep=!0;const e=t.babylonScene;e&&tt(e)}dispose(){this._loader=null,delete this._pathConverter}async onReady(){if(!this._loader.babylonScene||!this._pathConverter)return;const t=this._loader.babylonScene,e=this._loader.gltf.extensions?.KHR_interactivity;if(!e)return;const o=new g({scene:t});o.dispatchEventsSynchronously=!1;const a=e.graphs.map(i=>new Nt(i,this._loader.gltf,this._loader.parent.targetFps).serializeToFlowGraph());await Promise.all(a.map(async i=>await Dt(i,{coordinator:o,pathConverter:this._pathConverter}))),o.start()}}function tt(r){E("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:()=>{if(!r.activeCamera)return new R(NaN,NaN,NaN,NaN);const t=R.FromRotationMatrix(r.activeCamera.getWorldMatrix()).normalize();return r.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:()=>r.activeCamera}),E("/extensions/KHR_interactivity/?/activeCamera/position",{get:()=>{if(!r.activeCamera)return new Q(NaN,NaN,NaN);const t=r.activeCamera.getWorldMatrix().getTranslation();return r.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:()=>r.activeCamera}),E("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:t=>t._babylonAnimationGroup?.isPlaying??!1,type:"boolean",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/minTime",{get:t=>(t._babylonAnimationGroup?.from??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/maxTime",{get:t=>(t._babylonAnimationGroup?.to??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/playhead",{get:t=>(t._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup}),E("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:t=>(t._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:t=>t._babylonAnimationGroup})}Tt(b,"FlowGraphGLTFDataProvider",async()=>(await n(async()=>{const{FlowGraphGLTFDataProvider:r}=await import("./flowGraphGLTFDataProvider-ozn3C3RZ.js");return{FlowGraphGLTFDataProvider:r}},__vite__mapDeps([58,1,2,3,4,7]),import.meta.url)).FlowGraphGLTFDataProvider);lt(b);ct(b,!0,r=>new j(r));const Zt=Object.freeze(Object.defineProperty({__proto__:null,KHR_interactivity:j,_AddInteractivityObjectModel:tt},Symbol.toStringTag,{value:"Module"}));export{Ft as F,Gt as G,Zt as K,z as _,Pt as a,Ct as b,bt as c,g as d,D as e,M as f,vt as g,Wt as h,Jt as i,Ut as j,Ht as k,Qt as l}; diff --git a/assets/KHR_lights_punctual-BD4Uxwq7.js b/assets/KHR_lights_punctual-DwcGfODn.js similarity index 91% rename from assets/KHR_lights_punctual-BD4Uxwq7.js rename to assets/KHR_lights_punctual-DwcGfODn.js index 22b5ae351cbb40aecad2b3f6918822499d2bd7b2..8458fa686a1e3d388b1c9f641b0e0abab5d17467 100644 --- a/assets/KHR_lights_punctual-BD4Uxwq7.js +++ b/assets/KHR_lights_punctual-DwcGfODn.js @@ -1 +1 @@ -import{bk as y,aI as m,V as r,M as L,an as w,_ as b,s as A,R as v,bl as C,C as g,aG as P,aH as S}from"./index-GY9JDBGV.js";import{a as T}from"./objectModelMapping-CpTIXcMS.js";import{ArrayItem as _,GLTFLoader as p}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";w.AddNodeConstructor("Light_Type_0",(l,e)=>()=>new c(l,r.Zero(),e));class c extends y{get shadowAngle(){return this._shadowAngle}set shadowAngle(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(e){const i=this.needCube();if(this._direction=e,this.needCube()!==i&&this._shadowGenerators){const t=this._shadowGenerators.values();for(let n=t.next();n.done!==!0;n=t.next())n.value.recreateShadowMap()}}constructor(e,i,t,n){super(e,t,n),this._shadowAngle=Math.PI/2,this.position=i}getClassName(){return"PointLight"}getTypeID(){return m.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(e){if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new r(1,0,0);case 1:return new r(-1,0,0);case 2:return new r(0,-1,0);case 3:return new r(0,1,0);case 4:return new r(0,0,1);case 5:return new r(0,0,-1)}return r.Zero()}_setDefaultShadowProjectionMatrix(e,i,t){const n=this.getScene().activeCamera,d=this.getDepthMinZ(n),a=this.getDepthMaxZ(n),s=this.getScene().getEngine().useReverseDepthBuffer;L.PerspectiveFovLHToRef(this.shadowAngle,1,s?a:d,s?d:a,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,s)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,i){const t=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-t.x,this.transformedPosition.y-t.y,this.transformedPosition.z-t.z,0,i):this._uniformBuffer.updateFloat4("vLightData",this.position.x-t.x,this.position.y-t.y,this.position.z-t.z,0,i),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,i),this}transferToNodeMaterialEffect(e,i){const t=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?e.setFloat3(i,this.transformedPosition.x-t.x,this.transformedPosition.y-t.y,this.transformedPosition.z-t.z):e.setFloat3(i,this.position.x-t.x,this.position.y-t.y,this.position.z-t.z),this}prepareLightSpecificDefines(e,i){e["POINTLIGHT"+i]=!0}}b([A()],c.prototype,"shadowAngle",null);v("BABYLON.PointLight",c);const f="KHR_lights_punctual";class x{constructor(e){this.name=f,this._loader=e,this.enabled=this._loader.isExtensionUsed(f)}dispose(){this._loader=null,delete this._lights}onLoading(){const e=this._loader.gltf.extensions;if(e&&e[this.name]){const i=e[this.name];this._lights=i.lights,_.Assign(this._lights)}}loadNodeAsync(e,i,t){return p.LoadExtensionAsync(e,i,this.name,async(n,d)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(e,i,a=>{let s;const o=_.Get(n,this._lights,d.light),u=o.name||a.name;switch(this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,o.type){case"directional":{const h=new C(u,r.Backward(),this._loader.babylonScene);h.position.setAll(0),s=h;break}case"point":{s=new c(u,r.Zero(),this._loader.babylonScene);break}case"spot":{const h=new T(u,r.Zero(),r.Backward(),0,1,this._loader.babylonScene);h.angle=(o.spot&&o.spot.outerConeAngle||Math.PI/4)*2,h.innerAngle=(o.spot&&o.spot.innerConeAngle||0)*2,s=h;break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${n}: Invalid light type (${o.type})`)}s._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,o._babylonLight=s,s.falloffType=m.FALLOFF_GLTF,s.diffuse=o.color?g.FromArray(o.color):g.White(),s.intensity=o.intensity==null?1:o.intensity,s.range=o.range==null?Number.MAX_VALUE:o.range,s.parent=a,this._loader._babylonLights.push(s),p.AddPointerMetadata(s,n),t(a)})))}}P(f);S(f,!0,l=>new x(l));export{x as KHR_lights}; +import{bk as y,aI as m,V as r,M as L,an as w,_ as b,s as A,R as v,bl as C,C as g,aG as P,aH as S}from"./index-DmfQKmJL.js";import{a as T}from"./objectModelMapping-BHbejOcH.js";import{ArrayItem as _,GLTFLoader as p}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";w.AddNodeConstructor("Light_Type_0",(l,e)=>()=>new c(l,r.Zero(),e));class c extends y{get shadowAngle(){return this._shadowAngle}set shadowAngle(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(e){const i=this.needCube();if(this._direction=e,this.needCube()!==i&&this._shadowGenerators){const t=this._shadowGenerators.values();for(let n=t.next();n.done!==!0;n=t.next())n.value.recreateShadowMap()}}constructor(e,i,t,n){super(e,t,n),this._shadowAngle=Math.PI/2,this.position=i}getClassName(){return"PointLight"}getTypeID(){return m.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(e){if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new r(1,0,0);case 1:return new r(-1,0,0);case 2:return new r(0,-1,0);case 3:return new r(0,1,0);case 4:return new r(0,0,1);case 5:return new r(0,0,-1)}return r.Zero()}_setDefaultShadowProjectionMatrix(e,i,t){const n=this.getScene().activeCamera,d=this.getDepthMinZ(n),a=this.getDepthMaxZ(n),s=this.getScene().getEngine().useReverseDepthBuffer;L.PerspectiveFovLHToRef(this.shadowAngle,1,s?a:d,s?d:a,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,s)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,i){const t=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-t.x,this.transformedPosition.y-t.y,this.transformedPosition.z-t.z,0,i):this._uniformBuffer.updateFloat4("vLightData",this.position.x-t.x,this.position.y-t.y,this.position.z-t.z,0,i),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,i),this}transferToNodeMaterialEffect(e,i){const t=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?e.setFloat3(i,this.transformedPosition.x-t.x,this.transformedPosition.y-t.y,this.transformedPosition.z-t.z):e.setFloat3(i,this.position.x-t.x,this.position.y-t.y,this.position.z-t.z),this}prepareLightSpecificDefines(e,i){e["POINTLIGHT"+i]=!0}}b([A()],c.prototype,"shadowAngle",null);v("BABYLON.PointLight",c);const f="KHR_lights_punctual";class x{constructor(e){this.name=f,this._loader=e,this.enabled=this._loader.isExtensionUsed(f)}dispose(){this._loader=null,delete this._lights}onLoading(){const e=this._loader.gltf.extensions;if(e&&e[this.name]){const i=e[this.name];this._lights=i.lights,_.Assign(this._lights)}}loadNodeAsync(e,i,t){return p.LoadExtensionAsync(e,i,this.name,async(n,d)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(e,i,a=>{let s;const o=_.Get(n,this._lights,d.light),u=o.name||a.name;switch(this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,o.type){case"directional":{const h=new C(u,r.Backward(),this._loader.babylonScene);h.position.setAll(0),s=h;break}case"point":{s=new c(u,r.Zero(),this._loader.babylonScene);break}case"spot":{const h=new T(u,r.Zero(),r.Backward(),0,1,this._loader.babylonScene);h.angle=(o.spot&&o.spot.outerConeAngle||Math.PI/4)*2,h.innerAngle=(o.spot&&o.spot.innerConeAngle||0)*2,s=h;break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${n}: Invalid light type (${o.type})`)}s._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,o._babylonLight=s,s.falloffType=m.FALLOFF_GLTF,s.diffuse=o.color?g.FromArray(o.color):g.White(),s.intensity=o.intensity==null?1:o.intensity,s.range=o.range==null?Number.MAX_VALUE:o.range,s.parent=a,this._loader._babylonLights.push(s),p.AddPointerMetadata(s,n),t(a)})))}}P(f);S(f,!0,l=>new x(l));export{x as KHR_lights}; diff --git a/assets/KHR_materials_anisotropy-C1QXEXZd.js b/assets/KHR_materials_anisotropy-GlLZkQ-P.js similarity index 77% rename from assets/KHR_materials_anisotropy-C1QXEXZd.js rename to assets/KHR_materials_anisotropy-GlLZkQ-P.js index 6feddd51f16f35300dd0ce1b560aa4ca219d7afc..15106049943b2f1c559d5b225121a00282775141 100644 --- a/assets/KHR_materials_anisotropy-C1QXEXZd.js +++ b/assets/KHR_materials_anisotropy-GlLZkQ-P.js @@ -1 +1 @@ -import{GLTFLoader as m}from"./glTFLoader-CdfQ_yvy.js";import{aG as d,aH as c}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const a="KHR_materials_anisotropy";class _{constructor(t){this.name=a,this.order=195,this._loader=t,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,o,r){return m.LoadExtensionAsync(t,o,this.name,async(s,n)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(t,o,r)),e.push(this._loadAnisotropyPropertiesAsync(s,n,r)),await Promise.all(e)})}async _loadAnisotropyPropertiesAsync(t,o,r){const s=this._loader._getOrCreateMaterialAdapter(r),n=new Array,e=o.anisotropyStrength??0,l=o.anisotropyRotation??0;s.specularRoughnessAnisotropy=e,s.geometryTangentAngle=l;const p=o.extensions??{};(!p.EXT_materials_anisotropy_openpbr||!p.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled)&&s.configureGltfStyleAnisotropy(!0),o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${t}/anisotropyTexture`,o.anisotropyTexture,y=>{y.name=`${r.name} (Anisotropy Intensity)`,s.geometryTangentTexture=y}))),await Promise.all(n)}}d(a);c(a,!0,i=>new _(i));export{_ as KHR_materials_anisotropy}; +import{GLTFLoader as m}from"./glTFLoader-BBmdTKVx.js";import{aG as d,aH as c}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const a="KHR_materials_anisotropy";class _{constructor(t){this.name=a,this.order=195,this._loader=t,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,o,r){return m.LoadExtensionAsync(t,o,this.name,async(s,n)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(t,o,r)),e.push(this._loadAnisotropyPropertiesAsync(s,n,r)),await Promise.all(e)})}async _loadAnisotropyPropertiesAsync(t,o,r){const s=this._loader._getOrCreateMaterialAdapter(r),n=new Array,e=o.anisotropyStrength??0,l=o.anisotropyRotation??0;s.specularRoughnessAnisotropy=e,s.geometryTangentAngle=l;const p=o.extensions??{};(!p.EXT_materials_anisotropy_openpbr||!p.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled)&&s.configureGltfStyleAnisotropy(!0),o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${t}/anisotropyTexture`,o.anisotropyTexture,y=>{y.name=`${r.name} (Anisotropy Intensity)`,s.geometryTangentTexture=y}))),await Promise.all(n)}}d(a);c(a,!0,i=>new _(i));export{_ as KHR_materials_anisotropy}; diff --git a/assets/KHR_materials_clearcoat-BiqbwZRP.js b/assets/KHR_materials_clearcoat-BmiidW4_.js similarity index 83% rename from assets/KHR_materials_clearcoat-BiqbwZRP.js rename to assets/KHR_materials_clearcoat-BmiidW4_.js index bd668fc88c502d68d4b8f47e383cb54dbe6e6a02..84500e5cbe8007fffe298afef31ab94427daf92c 100644 --- a/assets/KHR_materials_clearcoat-BiqbwZRP.js +++ b/assets/KHR_materials_clearcoat-BmiidW4_.js @@ -1 +1 @@ -import{GLTFLoader as l}from"./glTFLoader-CdfQ_yvy.js";import{aG as u,aH as m}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const c="KHR_materials_clearcoat";class i{constructor(r){this.name=c,this.order=190,this._loader=r,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,t){return l.LoadExtensionAsync(r,e,this.name,async(o,s)=>{const a=new Array;a.push(this._loader.loadMaterialPropertiesAsync(r,e,t)),a.push(this._loadClearCoatPropertiesAsync(o,s,t)),await Promise.all(a)})}_loadClearCoatPropertiesAsync(r,e,t){const o=this._loader._getOrCreateMaterialAdapter(t),s=new Array;return o.configureCoat(),o.coatWeight=e.clearcoatFactor!==void 0?e.clearcoatFactor:0,o.coatRoughness=e.clearcoatRoughnessFactor!==void 0?e.clearcoatRoughnessFactor:0,e.clearcoatTexture&&s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatTexture`,e.clearcoatTexture,a=>{a.name=`${t.name} (ClearCoat)`,o.coatWeightTexture=a})),e.clearcoatRoughnessTexture&&(e.clearcoatRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatRoughnessTexture`,e.clearcoatRoughnessTexture,a=>{a.name=`${t.name} (ClearCoat Roughness)`,o.coatRoughnessTexture=a}))),e.clearcoatNormalTexture&&(e.clearcoatNormalTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatNormalTexture`,e.clearcoatNormalTexture,a=>{a.name=`${t.name} (ClearCoat Normal)`,o.geometryCoatNormalTexture=a,e.clearcoatNormalTexture?.scale!=null&&(o.geometryCoatNormalTextureScale=e.clearcoatNormalTexture.scale)})),o.setNormalMapInversions(!t.getScene().useRightHandedSystem,t.getScene().useRightHandedSystem)),Promise.all(s).then(()=>{})}}u(c);m(c,!0,n=>new i(n));export{i as KHR_materials_clearcoat}; +import{GLTFLoader as l}from"./glTFLoader-BBmdTKVx.js";import{aG as u,aH as m}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const c="KHR_materials_clearcoat";class i{constructor(r){this.name=c,this.order=190,this._loader=r,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,t){return l.LoadExtensionAsync(r,e,this.name,async(o,s)=>{const a=new Array;a.push(this._loader.loadMaterialPropertiesAsync(r,e,t)),a.push(this._loadClearCoatPropertiesAsync(o,s,t)),await Promise.all(a)})}_loadClearCoatPropertiesAsync(r,e,t){const o=this._loader._getOrCreateMaterialAdapter(t),s=new Array;return o.configureCoat(),o.coatWeight=e.clearcoatFactor!==void 0?e.clearcoatFactor:0,o.coatRoughness=e.clearcoatRoughnessFactor!==void 0?e.clearcoatRoughnessFactor:0,e.clearcoatTexture&&s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatTexture`,e.clearcoatTexture,a=>{a.name=`${t.name} (ClearCoat)`,o.coatWeightTexture=a})),e.clearcoatRoughnessTexture&&(e.clearcoatRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatRoughnessTexture`,e.clearcoatRoughnessTexture,a=>{a.name=`${t.name} (ClearCoat Roughness)`,o.coatRoughnessTexture=a}))),e.clearcoatNormalTexture&&(e.clearcoatNormalTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatNormalTexture`,e.clearcoatNormalTexture,a=>{a.name=`${t.name} (ClearCoat Normal)`,o.geometryCoatNormalTexture=a,e.clearcoatNormalTexture?.scale!=null&&(o.geometryCoatNormalTextureScale=e.clearcoatNormalTexture.scale)})),o.setNormalMapInversions(!t.getScene().useRightHandedSystem,t.getScene().useRightHandedSystem)),Promise.all(s).then(()=>{})}}u(c);m(c,!0,n=>new i(n));export{i as KHR_materials_clearcoat}; diff --git a/assets/KHR_materials_diffuse_roughness-BdhVzmEY.js b/assets/KHR_materials_diffuse_roughness-DrWjYvSt.js similarity index 73% rename from assets/KHR_materials_diffuse_roughness-BdhVzmEY.js rename to assets/KHR_materials_diffuse_roughness-DrWjYvSt.js index e62ddd24ba402846190dacf0cbc10b68550bfecb..76b983f90245a19e7ab080e26b358a6a11294112 100644 --- a/assets/KHR_materials_diffuse_roughness-BdhVzmEY.js +++ b/assets/KHR_materials_diffuse_roughness-DrWjYvSt.js @@ -1 +1 @@ -import{GLTFLoader as u}from"./glTFLoader-CdfQ_yvy.js";import{aG as h,aH as f}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const n="KHR_materials_diffuse_roughness";class d{constructor(s){this.name=n,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return u.LoadExtensionAsync(s,e,this.name,async(t,i)=>{const r=new Array;return r.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),r.push(this._loadDiffuseRoughnessPropertiesAsync(t,i,o)),await Promise.all(r).then(()=>{})})}_loadDiffuseRoughnessPropertiesAsync(s,e,o){const t=this._loader._getOrCreateMaterialAdapter(o),i=new Array;return t.baseDiffuseRoughness=e.diffuseRoughnessFactor??0,e.diffuseRoughnessTexture&&i.push(this._loader.loadTextureInfoAsync(`${s}/diffuseRoughnessTexture`,e.diffuseRoughnessTexture,r=>{r.name=`${o.name} (Diffuse Roughness)`,t.baseDiffuseRoughnessTexture=r})),Promise.all(i).then(()=>{})}}h(n);f(n,!0,a=>new d(a));export{d as KHR_materials_diffuse_roughness}; +import{GLTFLoader as u}from"./glTFLoader-BBmdTKVx.js";import{aG as h,aH as f}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const n="KHR_materials_diffuse_roughness";class d{constructor(s){this.name=n,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return u.LoadExtensionAsync(s,e,this.name,async(t,i)=>{const r=new Array;return r.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),r.push(this._loadDiffuseRoughnessPropertiesAsync(t,i,o)),await Promise.all(r).then(()=>{})})}_loadDiffuseRoughnessPropertiesAsync(s,e,o){const t=this._loader._getOrCreateMaterialAdapter(o),i=new Array;return t.baseDiffuseRoughness=e.diffuseRoughnessFactor??0,e.diffuseRoughnessTexture&&i.push(this._loader.loadTextureInfoAsync(`${s}/diffuseRoughnessTexture`,e.diffuseRoughnessTexture,r=>{r.name=`${o.name} (Diffuse Roughness)`,t.baseDiffuseRoughnessTexture=r})),Promise.all(i).then(()=>{})}}h(n);f(n,!0,a=>new d(a));export{d as KHR_materials_diffuse_roughness}; diff --git a/assets/KHR_materials_diffuse_transmission-CDvky1C-.js b/assets/KHR_materials_diffuse_transmission-C_N-4jS7.js similarity index 81% rename from assets/KHR_materials_diffuse_transmission-CDvky1C-.js rename to assets/KHR_materials_diffuse_transmission-C_N-4jS7.js index 59e9ab3efe4a333c36e2d4eb905e4c53d797d391..a1aec695d006b0ab56df5efa5cfb7b8a28b84386 100644 --- a/assets/KHR_materials_diffuse_transmission-CDvky1C-.js +++ b/assets/KHR_materials_diffuse_transmission-C_N-4jS7.js @@ -1 +1 @@ -import{GLTFLoader as m}from"./glTFLoader-CdfQ_yvy.js";import{C as f,aG as d,aH as l}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="KHR_materials_diffuse_transmission";class T{constructor(r){this.name=t,this.order=174,this._loader=r,this.enabled=this._loader.isExtensionUsed(t),this.enabled&&(r.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,n,o){return m.LoadExtensionAsync(r,n,this.name,async(s,e)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(r,n,o)),i.push(this._loadTranslucentPropertiesAsync(s,n,o,e)),await Promise.all(i).then(()=>{})})}_loadTranslucentPropertiesAsync(r,n,o,s){const e=this._loader._getOrCreateMaterialAdapter(o);e.configureSubsurface(),e.subsurfaceWeight=s.diffuseTransmissionFactor??0,e.subsurfaceColor=s.diffuseTransmissionColorFactor!==void 0?f.FromArray(s.diffuseTransmissionColorFactor):f.White();const i=new Array;return s.diffuseTransmissionTexture&&(s.diffuseTransmissionTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionTexture`,s.diffuseTransmissionTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission)`,e.subsurfaceWeightTexture=a}))),s.diffuseTransmissionColorTexture&&i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionColorTexture`,s.diffuseTransmissionColorTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission Color)`,e.subsurfaceColorTexture=a})),Promise.all(i).then(()=>{})}}d(t);l(t,!0,u=>new T(u));export{T as KHR_materials_diffuse_transmission}; +import{GLTFLoader as m}from"./glTFLoader-BBmdTKVx.js";import{C as f,aG as d,aH as l}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const t="KHR_materials_diffuse_transmission";class T{constructor(r){this.name=t,this.order=174,this._loader=r,this.enabled=this._loader.isExtensionUsed(t),this.enabled&&(r.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,n,o){return m.LoadExtensionAsync(r,n,this.name,async(s,e)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(r,n,o)),i.push(this._loadTranslucentPropertiesAsync(s,n,o,e)),await Promise.all(i).then(()=>{})})}_loadTranslucentPropertiesAsync(r,n,o,s){const e=this._loader._getOrCreateMaterialAdapter(o);e.configureSubsurface(),e.subsurfaceWeight=s.diffuseTransmissionFactor??0,e.subsurfaceColor=s.diffuseTransmissionColorFactor!==void 0?f.FromArray(s.diffuseTransmissionColorFactor):f.White();const i=new Array;return s.diffuseTransmissionTexture&&(s.diffuseTransmissionTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionTexture`,s.diffuseTransmissionTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission)`,e.subsurfaceWeightTexture=a}))),s.diffuseTransmissionColorTexture&&i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionColorTexture`,s.diffuseTransmissionColorTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission Color)`,e.subsurfaceColorTexture=a})),Promise.all(i).then(()=>{})}}d(t);l(t,!0,u=>new T(u));export{T as KHR_materials_diffuse_transmission}; diff --git a/assets/KHR_materials_dispersion-a6L3iXwc.js b/assets/KHR_materials_dispersion-CU3fVt_o.js similarity index 68% rename from assets/KHR_materials_dispersion-a6L3iXwc.js rename to assets/KHR_materials_dispersion-CU3fVt_o.js index 6e91a7d81ebd523e36a204c68d2379dc7d854e1c..5929fb68893870137a967e362616ff2e0a5d9372 100644 --- a/assets/KHR_materials_dispersion-a6L3iXwc.js +++ b/assets/KHR_materials_dispersion-CU3fVt_o.js @@ -1 +1 @@ -import{GLTFLoader as p}from"./glTFLoader-CdfQ_yvy.js";import{aG as d,aH as m}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="KHR_materials_dispersion";class l{constructor(s){this.name=t,this.order=174,this._loader=s,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,r,e){return p.LoadExtensionAsync(s,r,this.name,async(i,o)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(s,r,e)),n.push(this._loadDispersionPropertiesAsync(i,r,e,o)),await Promise.all(n).then(()=>{})})}_loadDispersionPropertiesAsync(s,r,e,i){const o=this._loader._getOrCreateMaterialAdapter(e);return o.transmissionWeight>0||!i.dispersion||(o.transmissionDispersionAbbeNumber=20/i.dispersion),Promise.resolve()}}d(t);m(t,!0,a=>new l(a));export{l as KHR_materials_dispersion}; +import{GLTFLoader as p}from"./glTFLoader-BBmdTKVx.js";import{aG as d,aH as m}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const t="KHR_materials_dispersion";class l{constructor(s){this.name=t,this.order=174,this._loader=s,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,r,e){return p.LoadExtensionAsync(s,r,this.name,async(i,o)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(s,r,e)),n.push(this._loadDispersionPropertiesAsync(i,r,e,o)),await Promise.all(n).then(()=>{})})}_loadDispersionPropertiesAsync(s,r,e,i){const o=this._loader._getOrCreateMaterialAdapter(e);return o.transmissionWeight>0||!i.dispersion||(o.transmissionDispersionAbbeNumber=20/i.dispersion),Promise.resolve()}}d(t);m(t,!0,a=>new l(a));export{l as KHR_materials_dispersion}; diff --git a/assets/KHR_materials_emissive_strength-BkRm5iN7.js b/assets/KHR_materials_emissive_strength-C1kLBr20.js similarity index 64% rename from assets/KHR_materials_emissive_strength-BkRm5iN7.js rename to assets/KHR_materials_emissive_strength-C1kLBr20.js index 8cec488108101c3b0f7e29c2e285c5f58a77d59a..9cbbc03088def3e426488a357c06422a681f4fb5 100644 --- a/assets/KHR_materials_emissive_strength-BkRm5iN7.js +++ b/assets/KHR_materials_emissive_strength-C1kLBr20.js @@ -1 +1 @@ -import{GLTFLoader as n}from"./glTFLoader-CdfQ_yvy.js";import{aG as m,aH as d}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="KHR_materials_emissive_strength";class l{constructor(e){this.name=t,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,i){return n.LoadExtensionAsync(e,s,this.name,async(r,a)=>(await this._loader.loadMaterialPropertiesAsync(e,s,i),this._loadEmissiveProperties(r,a,i),await Promise.resolve()))}_loadEmissiveProperties(e,s,i){if(s.emissiveStrength!==void 0){const r=this._loader._getOrCreateMaterialAdapter(i);r.emissionLuminance=s.emissiveStrength}}}m(t);d(t,!0,o=>new l(o));export{l as KHR_materials_emissive_strength}; +import{GLTFLoader as n}from"./glTFLoader-BBmdTKVx.js";import{aG as m,aH as d}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const t="KHR_materials_emissive_strength";class l{constructor(e){this.name=t,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,i){return n.LoadExtensionAsync(e,s,this.name,async(r,a)=>(await this._loader.loadMaterialPropertiesAsync(e,s,i),this._loadEmissiveProperties(r,a,i),await Promise.resolve()))}_loadEmissiveProperties(e,s,i){if(s.emissiveStrength!==void 0){const r=this._loader._getOrCreateMaterialAdapter(i);r.emissionLuminance=s.emissiveStrength}}}m(t);d(t,!0,o=>new l(o));export{l as KHR_materials_emissive_strength}; diff --git a/assets/KHR_materials_ior-C8mEIcEf.js b/assets/KHR_materials_ior-tcfpDDEn.js similarity index 66% rename from assets/KHR_materials_ior-C8mEIcEf.js rename to assets/KHR_materials_ior-tcfpDDEn.js index 9672bb48ca4146afdb741bcefd13fd9a2d434673..20078dd6bf7d9a0e49e46bd447b55df9856b9db0 100644 --- a/assets/KHR_materials_ior-C8mEIcEf.js +++ b/assets/KHR_materials_ior-tcfpDDEn.js @@ -1 +1 @@ -import{GLTFLoader as l}from"./glTFLoader-CdfQ_yvy.js";import{aG as p,aH as c}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const s="KHR_materials_ior";class t{constructor(r){this.name=s,this.order=180,this._loader=r,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,o){return l.LoadExtensionAsync(r,e,this.name,async(i,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(r,e,o)),n.push(this._loadIorPropertiesAsync(i,a,o)),await Promise.all(n).then(()=>{})})}_loadIorPropertiesAsync(r,e,o){const i=this._loader._getOrCreateMaterialAdapter(o),a=e.ior!==void 0?e.ior:t._DEFAULT_IOR;return i.specularIor=a,Promise.resolve()}}t._DEFAULT_IOR=1.5;p(s);c(s,!0,d=>new t(d));export{t as KHR_materials_ior}; +import{GLTFLoader as l}from"./glTFLoader-BBmdTKVx.js";import{aG as p,aH as c}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const s="KHR_materials_ior";class t{constructor(r){this.name=s,this.order=180,this._loader=r,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,o){return l.LoadExtensionAsync(r,e,this.name,async(i,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(r,e,o)),n.push(this._loadIorPropertiesAsync(i,a,o)),await Promise.all(n).then(()=>{})})}_loadIorPropertiesAsync(r,e,o){const i=this._loader._getOrCreateMaterialAdapter(o),a=e.ior!==void 0?e.ior:t._DEFAULT_IOR;return i.specularIor=a,Promise.resolve()}}t._DEFAULT_IOR=1.5;p(s);c(s,!0,d=>new t(d));export{t as KHR_materials_ior}; diff --git a/assets/KHR_materials_iridescence-BHHGpwMu.js b/assets/KHR_materials_iridescence-De0DOH7R.js similarity index 79% rename from assets/KHR_materials_iridescence-BHHGpwMu.js rename to assets/KHR_materials_iridescence-De0DOH7R.js index e20616038975365ef25d2861bb055d5047ea3435..afb7b9800d2b9209c20c93b591532df82fab5ad9 100644 --- a/assets/KHR_materials_iridescence-BHHGpwMu.js +++ b/assets/KHR_materials_iridescence-De0DOH7R.js @@ -1 +1 @@ -import{GLTFLoader as d}from"./glTFLoader-CdfQ_yvy.js";import{aG as o,aH as h}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="KHR_materials_iridescence";class m{constructor(n){this.name=t,this.order=195,this._loader=n,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(n,e,r){return d.LoadExtensionAsync(n,e,this.name,async(s,c)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(n,e,r)),i.push(this._loadIridescencePropertiesAsync(s,c,r)),await Promise.all(i).then(()=>{})})}_loadIridescencePropertiesAsync(n,e,r){const s=this._loader._getOrCreateMaterialAdapter(r),c=new Array;return s.thinFilmWeight=e.iridescenceFactor??0,s.thinFilmIor=e.iridescenceIor??e.iridescenceIOR??1.3,s.thinFilmThicknessMinimum=e.iridescenceThicknessMinimum??100,s.thinFilmThicknessMaximum=e.iridescenceThicknessMaximum??400,e.iridescenceTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceTexture`,e.iridescenceTexture,i=>{i.name=`${r.name} (Iridescence)`,s.thinFilmWeightTexture=i})),e.iridescenceThicknessTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceThicknessTexture`,e.iridescenceThicknessTexture,i=>{i.name=`${r.name} (Iridescence Thickness)`,s.thinFilmThicknessTexture=i})),Promise.all(c).then(()=>{})}}o(t);h(t,!0,a=>new m(a));export{m as KHR_materials_iridescence}; +import{GLTFLoader as d}from"./glTFLoader-BBmdTKVx.js";import{aG as o,aH as h}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const t="KHR_materials_iridescence";class m{constructor(n){this.name=t,this.order=195,this._loader=n,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(n,e,r){return d.LoadExtensionAsync(n,e,this.name,async(s,c)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(n,e,r)),i.push(this._loadIridescencePropertiesAsync(s,c,r)),await Promise.all(i).then(()=>{})})}_loadIridescencePropertiesAsync(n,e,r){const s=this._loader._getOrCreateMaterialAdapter(r),c=new Array;return s.thinFilmWeight=e.iridescenceFactor??0,s.thinFilmIor=e.iridescenceIor??e.iridescenceIOR??1.3,s.thinFilmThicknessMinimum=e.iridescenceThicknessMinimum??100,s.thinFilmThicknessMaximum=e.iridescenceThicknessMaximum??400,e.iridescenceTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceTexture`,e.iridescenceTexture,i=>{i.name=`${r.name} (Iridescence)`,s.thinFilmWeightTexture=i})),e.iridescenceThicknessTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceThicknessTexture`,e.iridescenceThicknessTexture,i=>{i.name=`${r.name} (Iridescence Thickness)`,s.thinFilmThicknessTexture=i})),Promise.all(c).then(()=>{})}}o(t);h(t,!0,a=>new m(a));export{m as KHR_materials_iridescence}; diff --git a/assets/KHR_materials_pbrSpecularGlossiness-BU-j5ndp.js b/assets/KHR_materials_pbrSpecularGlossiness-Dak3xHNu.js similarity index 82% rename from assets/KHR_materials_pbrSpecularGlossiness-BU-j5ndp.js rename to assets/KHR_materials_pbrSpecularGlossiness-Dak3xHNu.js index 90f1deff12b55623ffd42b2b8e9ec6c633eb6713..f21eac1beb87e2986a5788bb071d3ebe1a90c79e 100644 --- a/assets/KHR_materials_pbrSpecularGlossiness-BU-j5ndp.js +++ b/assets/KHR_materials_pbrSpecularGlossiness-Dak3xHNu.js @@ -1 +1 @@ -import{aJ as a,C as t,aG as c,aH as d}from"./index-GY9JDBGV.js";import{GLTFLoader as f}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const u="KHR_materials_pbrSpecularGlossiness";class h{constructor(r){this.name=u,this.order=200,this._loader=r,this.enabled=this._loader.isExtensionUsed(u)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,s){return f.LoadExtensionAsync(r,e,this.name,async(i,o)=>{const l=new Array;return l.push(this._loader.loadMaterialBasePropertiesAsync(r,e,s)),l.push(this._loadSpecularGlossinessPropertiesAsync(i,o,s)),this._loader.loadMaterialAlphaProperties(r,e,s),await Promise.all(l).then(()=>{})})}_loadSpecularGlossinessPropertiesAsync(r,e,s){if(!(s instanceof a))throw new Error(`${r}: Material type not supported`);const i=new Array;return s.metallic=null,s.roughness=null,e.diffuseFactor?(s.albedoColor=t.FromArray(e.diffuseFactor),s.alpha=e.diffuseFactor[3]):s.albedoColor=t.White(),s.reflectivityColor=e.specularFactor?t.FromArray(e.specularFactor):t.White(),s.microSurface=e.glossinessFactor==null?1:e.glossinessFactor,e.diffuseTexture&&i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTexture`,e.diffuseTexture,o=>{o.name=`${s.name} (Diffuse)`,s.albedoTexture=o})),e.specularGlossinessTexture&&(i.push(this._loader.loadTextureInfoAsync(`${r}/specularGlossinessTexture`,e.specularGlossinessTexture,o=>{o.name=`${s.name} (Specular Glossiness)`,s.reflectivityTexture=o,s.reflectivityTexture.hasAlpha=!0})),s.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(i).then(()=>{})}}c(u);d(u,!0,n=>new h(n));export{h as KHR_materials_pbrSpecularGlossiness}; +import{aJ as a,C as t,aG as c,aH as d}from"./index-DmfQKmJL.js";import{GLTFLoader as f}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const u="KHR_materials_pbrSpecularGlossiness";class h{constructor(r){this.name=u,this.order=200,this._loader=r,this.enabled=this._loader.isExtensionUsed(u)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,s){return f.LoadExtensionAsync(r,e,this.name,async(i,o)=>{const l=new Array;return l.push(this._loader.loadMaterialBasePropertiesAsync(r,e,s)),l.push(this._loadSpecularGlossinessPropertiesAsync(i,o,s)),this._loader.loadMaterialAlphaProperties(r,e,s),await Promise.all(l).then(()=>{})})}_loadSpecularGlossinessPropertiesAsync(r,e,s){if(!(s instanceof a))throw new Error(`${r}: Material type not supported`);const i=new Array;return s.metallic=null,s.roughness=null,e.diffuseFactor?(s.albedoColor=t.FromArray(e.diffuseFactor),s.alpha=e.diffuseFactor[3]):s.albedoColor=t.White(),s.reflectivityColor=e.specularFactor?t.FromArray(e.specularFactor):t.White(),s.microSurface=e.glossinessFactor==null?1:e.glossinessFactor,e.diffuseTexture&&i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTexture`,e.diffuseTexture,o=>{o.name=`${s.name} (Diffuse)`,s.albedoTexture=o})),e.specularGlossinessTexture&&(i.push(this._loader.loadTextureInfoAsync(`${r}/specularGlossinessTexture`,e.specularGlossinessTexture,o=>{o.name=`${s.name} (Specular Glossiness)`,s.reflectivityTexture=o,s.reflectivityTexture.hasAlpha=!0})),s.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(i).then(()=>{})}}c(u);d(u,!0,n=>new h(n));export{h as KHR_materials_pbrSpecularGlossiness}; diff --git a/assets/KHR_materials_sheen-DYXuHxxU.js b/assets/KHR_materials_sheen-DKy2SCHa.js similarity index 78% rename from assets/KHR_materials_sheen-DYXuHxxU.js rename to assets/KHR_materials_sheen-DKy2SCHa.js index 2b65769f979076b011552601ed4671641a6741c3..5177338e413a497f6f63ad0542b0549a4e3a6b07 100644 --- a/assets/KHR_materials_sheen-DYXuHxxU.js +++ b/assets/KHR_materials_sheen-DKy2SCHa.js @@ -1 +1 @@ -import{GLTFLoader as d}from"./glTFLoader-CdfQ_yvy.js";import{C as i,aG as m,aH as c}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const a="KHR_materials_sheen";class g{constructor(o){this.name=a,this.order=190,this._loader=o,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(o,e,n){return d.LoadExtensionAsync(o,e,this.name,async(s,r)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(o,e,n)),t.push(this._loadSheenPropertiesAsync(s,r,n)),await Promise.all(t).then(()=>{})})}_loadSheenPropertiesAsync(o,e,n){const s=this._loader._getOrCreateMaterialAdapter(n),r=new Array;s.configureFuzz();const t=e.sheenColorFactor!==void 0?i.FromArray(e.sheenColorFactor):i.Black(),l=e.sheenRoughnessFactor!==void 0?e.sheenRoughnessFactor:0;return s.fuzzWeight=1,s.fuzzColor=t,s.fuzzRoughness=l,e.sheenColorTexture&&r.push(this._loader.loadTextureInfoAsync(`${o}/sheenColorTexture`,e.sheenColorTexture,h=>{h.name=`${n.name} (Sheen Color)`,s.fuzzColorTexture=h})),e.sheenRoughnessTexture&&(e.sheenRoughnessTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${o}/sheenRoughnessTexture`,e.sheenRoughnessTexture,h=>{h.name=`${n.name} (Sheen Roughness)`,s.fuzzRoughnessTexture=h}))),Promise.all(r).then(()=>{})}}m(a);c(a,!0,u=>new g(u));export{g as KHR_materials_sheen}; +import{GLTFLoader as d}from"./glTFLoader-BBmdTKVx.js";import{C as i,aG as m,aH as c}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const a="KHR_materials_sheen";class g{constructor(o){this.name=a,this.order=190,this._loader=o,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(o,e,n){return d.LoadExtensionAsync(o,e,this.name,async(s,r)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(o,e,n)),t.push(this._loadSheenPropertiesAsync(s,r,n)),await Promise.all(t).then(()=>{})})}_loadSheenPropertiesAsync(o,e,n){const s=this._loader._getOrCreateMaterialAdapter(n),r=new Array;s.configureFuzz();const t=e.sheenColorFactor!==void 0?i.FromArray(e.sheenColorFactor):i.Black(),l=e.sheenRoughnessFactor!==void 0?e.sheenRoughnessFactor:0;return s.fuzzWeight=1,s.fuzzColor=t,s.fuzzRoughness=l,e.sheenColorTexture&&r.push(this._loader.loadTextureInfoAsync(`${o}/sheenColorTexture`,e.sheenColorTexture,h=>{h.name=`${n.name} (Sheen Color)`,s.fuzzColorTexture=h})),e.sheenRoughnessTexture&&(e.sheenRoughnessTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${o}/sheenRoughnessTexture`,e.sheenRoughnessTexture,h=>{h.name=`${n.name} (Sheen Roughness)`,s.fuzzRoughnessTexture=h}))),Promise.all(r).then(()=>{})}}m(a);c(a,!0,u=>new g(u));export{g as KHR_materials_sheen}; diff --git a/assets/KHR_materials_specular-CZZxTPjo.js b/assets/KHR_materials_specular-DG0rpgUg.js similarity index 80% rename from assets/KHR_materials_specular-CZZxTPjo.js rename to assets/KHR_materials_specular-DG0rpgUg.js index fb0ecd6f55a63cfb9e226a9b4d02b65926def255..ac07934c29336155afc40985faf1764df7c401ea 100644 --- a/assets/KHR_materials_specular-CZZxTPjo.js +++ b/assets/KHR_materials_specular-DG0rpgUg.js @@ -1 +1 @@ -import{GLTFLoader as i}from"./glTFLoader-CdfQ_yvy.js";import{C as n,aG as p,aH as d}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="KHR_materials_specular";class m{constructor(s){this.name=t,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return i.LoadExtensionAsync(s,e,this.name,async(l,a)=>{const r=new Array;r.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),r.push(this._loadSpecularPropertiesAsync(l,a,o));const c=this._loader._getOrCreateMaterialAdapter(o);return a.extensions&&a.extensions.EXT_materials_specular_edge_color&&a.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&c.enableSpecularEdgeColor(!0),await Promise.all(r).then(()=>{})})}_loadSpecularPropertiesAsync(s,e,o){const l=this._loader._getOrCreateMaterialAdapter(o),a=new Array;return l.specularWeight=e.specularFactor??1,l.specularColor=e.specularColorFactor!==void 0?n.FromArray(e.specularColorFactor):new n(1,1,1),e.specularTexture&&(e.specularTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync(`${s}/specularTexture`,e.specularTexture,r=>{r.name=`${o.name} (Specular)`,l.specularWeightTexture=r}))),e.specularColorTexture&&a.push(this._loader.loadTextureInfoAsync(`${s}/specularColorTexture`,e.specularColorTexture,r=>{r.name=`${o.name} (Specular Color)`,l.specularColorTexture=r})),Promise.all(a).then(()=>{})}}p(t);d(t,!0,u=>new m(u));export{m as KHR_materials_specular}; +import{GLTFLoader as i}from"./glTFLoader-BBmdTKVx.js";import{C as n,aG as p,aH as d}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const t="KHR_materials_specular";class m{constructor(s){this.name=t,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return i.LoadExtensionAsync(s,e,this.name,async(l,a)=>{const r=new Array;r.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),r.push(this._loadSpecularPropertiesAsync(l,a,o));const c=this._loader._getOrCreateMaterialAdapter(o);return a.extensions&&a.extensions.EXT_materials_specular_edge_color&&a.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&c.enableSpecularEdgeColor(!0),await Promise.all(r).then(()=>{})})}_loadSpecularPropertiesAsync(s,e,o){const l=this._loader._getOrCreateMaterialAdapter(o),a=new Array;return l.specularWeight=e.specularFactor??1,l.specularColor=e.specularColorFactor!==void 0?n.FromArray(e.specularColorFactor):new n(1,1,1),e.specularTexture&&(e.specularTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync(`${s}/specularTexture`,e.specularTexture,r=>{r.name=`${o.name} (Specular)`,l.specularWeightTexture=r}))),e.specularColorTexture&&a.push(this._loader.loadTextureInfoAsync(`${s}/specularColorTexture`,e.specularColorTexture,r=>{r.name=`${o.name} (Specular Color)`,l.specularColorTexture=r})),Promise.all(a).then(()=>{})}}p(t);d(t,!0,u=>new m(u));export{m as KHR_materials_specular}; diff --git a/assets/KHR_materials_transmission-CFNuGSuS.js b/assets/KHR_materials_transmission-Cs5JIiaN.js similarity index 93% rename from assets/KHR_materials_transmission-CFNuGSuS.js rename to assets/KHR_materials_transmission-Cs5JIiaN.js index b365a2f27c5722865fe448c71af3f68583d9df27..a935262fdffee843e6b6ccb14dd6851944551d4d 100644 --- a/assets/KHR_materials_transmission-CFNuGSuS.js +++ b/assets/KHR_materials_transmission-Cs5JIiaN.js @@ -1 +1 @@ -import{GLTFLoader as l}from"./glTFLoader-CdfQ_yvy.js";import{aK as u,O as _,d as c,aL as T,aG as g,aH as f}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";class h{static _GetDefaultOptions(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:u.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,s){this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...h._GetDefaultOptions(),...e},this._scene=s,this._scene._transmissionHelper=this,this.onErrorObservable=new _,this._scene.onDisposeObservable.addOnce(()=>{this.dispose()}),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter(a=>this._options[a]!==e[a]).length)return;const t={...this._options,...e},r=this._options;this._options=t,t.renderSize!==r.renderSize||t.renderTargetTextureType!==r.renderTargetTextureType||t.generateMipmaps!==r.generateMipmaps||!this._opaqueRenderTarget?this._setupRenderTargets():(this._opaqueRenderTarget.samples=t.samples,this._opaqueRenderTarget.lodGenerationScale=t.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=t.lodGenerationOffset)}getOpaqueTarget(){return this._opaqueRenderTarget}_shouldRenderAsTransmission(e){return!!e?.subSurface?.isRefractionEnabled}_addMesh(e){this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),c.SetImmediate(()=>{this._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=this._opaqueRenderTarget,this._transparentMeshesCache.indexOf(e)===-1&&this._transparentMeshesCache.push(e)):this._opaqueMeshesCache.indexOf(e)===-1&&this._opaqueMeshesCache.push(e)})}_removeMesh(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let s=this._transparentMeshesCache.indexOf(e);s!==-1&&this._transparentMeshesCache.splice(s,1),s=this._opaqueMeshesCache.indexOf(e),s!==-1&&this._opaqueMeshesCache.splice(s,1)}_parseScene(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(e){const s=this._transparentMeshesCache.indexOf(e),t=this._opaqueMeshesCache.indexOf(e);if(this._shouldRenderAsTransmission(e.material)){if(e.material){const a=e.material.subSurface;a&&(a.refractionTexture=this._opaqueRenderTarget)}t!==-1?(this._opaqueMeshesCache.splice(t,1),this._transparentMeshesCache.push(e)):s===-1&&this._transparentMeshesCache.push(e)}else s!==-1?(this._transparentMeshesCache.splice(s,1),this._opaqueMeshesCache.push(e)):t===-1&&this._opaqueMeshesCache.push(e)}_isRenderTargetValid(){return this._opaqueRenderTarget?.getInternalTexture()!==null}_setupRenderTargets(){this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new T("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=this._options.clearColor?.clone()??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0;let e;this._opaqueRenderTarget.onBeforeBindObservable.add(s=>{e=this._scene.environmentIntensity,this._scene.environmentIntensity=1,this._options.clearColor?s.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(s.clearColor,this._scene.getEngine().useExactSrgbConversions)}),this._opaqueRenderTarget.onAfterUnbindObservable.add(()=>{this._scene.environmentIntensity=e});for(const s of this._transparentMeshesCache)this._shouldRenderAsTransmission(s.material)&&(s.material.refractionTexture=this._opaqueRenderTarget)}dispose(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const o="KHR_materials_transmission";class m{constructor(e){this.name=o,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,t){return l.LoadExtensionAsync(e,s,this.name,async(r,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(e,s,t)),n.push(this._loadTransparentPropertiesAsync(r,s,t,a)),await Promise.all(n).then(()=>{})})}_loadTransparentPropertiesAsync(e,s,t,r){const a=this._loader._getOrCreateMaterialAdapter(t),n=r.transmissionFactor!==void 0?r.transmissionFactor:0;if(n===0)return Promise.resolve();if(a.configureTransmission(),a.transmissionWeight=n,n>0&&!this._loader.parent.dontUseTransmissionHelper){const i=t.getScene();i._transmissionHelper?i._transmissionHelper?._isRenderTargetValid()||i._transmissionHelper?._setupRenderTargets():new h({},t.getScene())}let p=Promise.resolve(null);return r.transmissionTexture&&(r.transmissionTexture.nonColorData=!0,p=this._loader.loadTextureInfoAsync(`${e}/transmissionTexture`,r.transmissionTexture,i=>{i.name=`${t.name} (Transmission)`,a.transmissionWeightTexture=i})),p.then(()=>{})}}g(o);f(o,!0,d=>new m(d));export{m as KHR_materials_transmission}; +import{GLTFLoader as l}from"./glTFLoader-BBmdTKVx.js";import{aK as u,O as _,d as c,aL as T,aG as g,aH as f}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";class h{static _GetDefaultOptions(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:u.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,s){this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...h._GetDefaultOptions(),...e},this._scene=s,this._scene._transmissionHelper=this,this.onErrorObservable=new _,this._scene.onDisposeObservable.addOnce(()=>{this.dispose()}),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter(a=>this._options[a]!==e[a]).length)return;const t={...this._options,...e},r=this._options;this._options=t,t.renderSize!==r.renderSize||t.renderTargetTextureType!==r.renderTargetTextureType||t.generateMipmaps!==r.generateMipmaps||!this._opaqueRenderTarget?this._setupRenderTargets():(this._opaqueRenderTarget.samples=t.samples,this._opaqueRenderTarget.lodGenerationScale=t.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=t.lodGenerationOffset)}getOpaqueTarget(){return this._opaqueRenderTarget}_shouldRenderAsTransmission(e){return!!e?.subSurface?.isRefractionEnabled}_addMesh(e){this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),c.SetImmediate(()=>{this._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=this._opaqueRenderTarget,this._transparentMeshesCache.indexOf(e)===-1&&this._transparentMeshesCache.push(e)):this._opaqueMeshesCache.indexOf(e)===-1&&this._opaqueMeshesCache.push(e)})}_removeMesh(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let s=this._transparentMeshesCache.indexOf(e);s!==-1&&this._transparentMeshesCache.splice(s,1),s=this._opaqueMeshesCache.indexOf(e),s!==-1&&this._opaqueMeshesCache.splice(s,1)}_parseScene(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(e){const s=this._transparentMeshesCache.indexOf(e),t=this._opaqueMeshesCache.indexOf(e);if(this._shouldRenderAsTransmission(e.material)){if(e.material){const a=e.material.subSurface;a&&(a.refractionTexture=this._opaqueRenderTarget)}t!==-1?(this._opaqueMeshesCache.splice(t,1),this._transparentMeshesCache.push(e)):s===-1&&this._transparentMeshesCache.push(e)}else s!==-1?(this._transparentMeshesCache.splice(s,1),this._opaqueMeshesCache.push(e)):t===-1&&this._opaqueMeshesCache.push(e)}_isRenderTargetValid(){return this._opaqueRenderTarget?.getInternalTexture()!==null}_setupRenderTargets(){this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new T("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=this._options.clearColor?.clone()??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0;let e;this._opaqueRenderTarget.onBeforeBindObservable.add(s=>{e=this._scene.environmentIntensity,this._scene.environmentIntensity=1,this._options.clearColor?s.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(s.clearColor,this._scene.getEngine().useExactSrgbConversions)}),this._opaqueRenderTarget.onAfterUnbindObservable.add(()=>{this._scene.environmentIntensity=e});for(const s of this._transparentMeshesCache)this._shouldRenderAsTransmission(s.material)&&(s.material.refractionTexture=this._opaqueRenderTarget)}dispose(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const o="KHR_materials_transmission";class m{constructor(e){this.name=o,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,t){return l.LoadExtensionAsync(e,s,this.name,async(r,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(e,s,t)),n.push(this._loadTransparentPropertiesAsync(r,s,t,a)),await Promise.all(n).then(()=>{})})}_loadTransparentPropertiesAsync(e,s,t,r){const a=this._loader._getOrCreateMaterialAdapter(t),n=r.transmissionFactor!==void 0?r.transmissionFactor:0;if(n===0)return Promise.resolve();if(a.configureTransmission(),a.transmissionWeight=n,n>0&&!this._loader.parent.dontUseTransmissionHelper){const i=t.getScene();i._transmissionHelper?i._transmissionHelper?._isRenderTargetValid()||i._transmissionHelper?._setupRenderTargets():new h({},t.getScene())}let p=Promise.resolve(null);return r.transmissionTexture&&(r.transmissionTexture.nonColorData=!0,p=this._loader.loadTextureInfoAsync(`${e}/transmissionTexture`,r.transmissionTexture,i=>{i.name=`${t.name} (Transmission)`,a.transmissionWeightTexture=i})),p.then(()=>{})}}g(o);f(o,!0,d=>new m(d));export{m as KHR_materials_transmission}; diff --git a/assets/KHR_materials_unlit-BDUo87Sq.js b/assets/KHR_materials_unlit-Ddn56Xlr.js similarity index 73% rename from assets/KHR_materials_unlit-BDUo87Sq.js rename to assets/KHR_materials_unlit-Ddn56Xlr.js index af1c8554b8ccabe867ee423808d61e2addfe0aec..c84f573f0656a49f63e6715d8d93730ff18e7d05 100644 --- a/assets/KHR_materials_unlit-BDUo87Sq.js +++ b/assets/KHR_materials_unlit-Ddn56Xlr.js @@ -1 +1 @@ -import{C as d,aG as p,aH as u}from"./index-GY9JDBGV.js";import{GLTFLoader as c}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const i="KHR_materials_unlit";class m{constructor(e){this.name=i,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,r,t){return c.LoadExtensionAsync(e,r,this.name,async()=>await this._loadUnlitPropertiesAsync(e,r,t))}_loadUnlitPropertiesAsync(e,r,t){const o=this._loader._getOrCreateMaterialAdapter(t),l=new Array,s=r.pbrMetallicRoughness;return s&&(s.baseColorFactor&&(o.baseColor=d.FromArray(s.baseColorFactor),o.geometryOpacity=s.baseColorFactor[3]),s.baseColorTexture&&l.push(this._loader.loadTextureInfoAsync(`${e}/baseColorTexture`,s.baseColorTexture,n=>{n.name=`${t.name} (Base Color)`,o.baseColorTexture=n}))),o.isUnlit=!0,r.doubleSided&&(o.backFaceCulling=!1,o.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,r,t),Promise.all(l).then(()=>{})}}p(i);u(i,!0,a=>new m(a));export{m as KHR_materials_unlit}; +import{C as d,aG as p,aH as u}from"./index-DmfQKmJL.js";import{GLTFLoader as c}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const i="KHR_materials_unlit";class m{constructor(e){this.name=i,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,r,t){return c.LoadExtensionAsync(e,r,this.name,async()=>await this._loadUnlitPropertiesAsync(e,r,t))}_loadUnlitPropertiesAsync(e,r,t){const o=this._loader._getOrCreateMaterialAdapter(t),l=new Array,s=r.pbrMetallicRoughness;return s&&(s.baseColorFactor&&(o.baseColor=d.FromArray(s.baseColorFactor),o.geometryOpacity=s.baseColorFactor[3]),s.baseColorTexture&&l.push(this._loader.loadTextureInfoAsync(`${e}/baseColorTexture`,s.baseColorTexture,n=>{n.name=`${t.name} (Base Color)`,o.baseColorTexture=n}))),o.isUnlit=!0,r.doubleSided&&(o.backFaceCulling=!1,o.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,r,t),Promise.all(l).then(()=>{})}}p(i);u(i,!0,a=>new m(a));export{m as KHR_materials_unlit}; diff --git a/assets/KHR_materials_variants-HlnHyUkm.js b/assets/KHR_materials_variants-DhjWb_BP.js similarity index 92% rename from assets/KHR_materials_variants-HlnHyUkm.js rename to assets/KHR_materials_variants-DhjWb_BP.js index 01b346d50f8ef8b6320a49a28910ad7402051ab8..575176f5c33bc6c7bbd7643e47bca916f4d83962 100644 --- a/assets/KHR_materials_variants-HlnHyUkm.js +++ b/assets/KHR_materials_variants-DhjWb_BP.js @@ -1 +1 @@ -import{GLTFLoader as S,ArrayItem as L}from"./glTFLoader-CdfQ_yvy.js";import{l as O,aG as C,aH as I}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const n="KHR_materials_variants";class s{constructor(t){this.name=n,this._loader=t,this.enabled=this._loader.isExtensionUsed(n)&&!this._loader.parent.skipMaterials}dispose(){this._loader=null}static GetAvailableVariants(t){const e=this._GetExtensionMetadata(t);return e?Object.keys(e.variants):[]}getAvailableVariants(t){return s.GetAvailableVariants(t)}static SelectVariant(t,e){const r=this._GetExtensionMetadata(t);if(!r)throw new Error(`Cannot select variant on a glTF mesh that does not have the ${n} extension`);const h=c=>{const f=r.variants[c];if(f)for(const m of f)m.mesh.material=m.material};if(e instanceof Array)for(const c of e)h(c);else h(e);r.lastSelected=e}selectVariant(t,e){s.SelectVariant(t,e)}static Reset(t){const e=this._GetExtensionMetadata(t);if(!e)throw new Error(`Cannot reset on a glTF mesh that does not have the ${n} extension`);for(const r of e.original)r.mesh.material=r.material;e.lastSelected=null}reset(t){s.Reset(t)}static GetLastSelectedVariant(t){const e=this._GetExtensionMetadata(t);if(!e)throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${n} extension`);return e.lastSelected}getLastSelectedVariant(t){return s.GetLastSelectedVariant(t)}static _GetExtensionMetadata(t){return t?._internalMetadata?.gltf?.[n]||null}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._variants=e.variants}}onReady(){const t=this._loader.rootBabylonMesh;if(t){const e=this._loader.parent.extensionOptions[n];e?.defaultVariant&&s.SelectVariant(t,e.defaultVariant),e?.onLoaded?.({get variants(){return s.GetAvailableVariants(t)},get selectedVariant(){const r=s.GetLastSelectedVariant(t);return r?Array.isArray(r)?r[0]:r:s.GetAvailableVariants(t)[0]},set selectedVariant(r){s.SelectVariant(t,r)}})}}_loadMeshPrimitiveAsync(t,e,r,h,c,f){return S.LoadExtensionAsync(t,c,this.name,async(m,V)=>{const x=new Array;return x.push(this._loader._loadMeshPrimitiveAsync(t,e,r,h,c,o=>{if(f(o),o instanceof O){const $=S._GetDrawMode(t,c.mode),d=this._loader.rootBabylonMesh,E=d?d._internalMetadata=d._internalMetadata||{}:{},w=E.gltf=E.gltf||{},g=w[n]=w[n]||{lastSelected:null,original:[],variants:{}};g.original.push({mesh:o,material:o.material});for(let p=0;p{for(let v=0;v{const G=k;let l=null,i=G;do{if(i=i.parent,!i)return;l=s._GetExtensionMetadata(i)}while(l===null);if(d&&l===s._GetExtensionMetadata(d)){i._internalMetadata={};for(const a in d._internalMetadata)i._internalMetadata[a]=d._internalMetadata[a];i._internalMetadata.gltf=[];for(const a in d._internalMetadata.gltf)i._internalMetadata.gltf[a]=d._internalMetadata.gltf[a];i._internalMetadata.gltf[n]={lastSelected:null,original:[],variants:{}};for(const a of l.original)i._internalMetadata.gltf[n].original.push({mesh:a.mesh,material:a.material});for(const a in l.variants)if(Object.prototype.hasOwnProperty.call(l.variants,a)){i._internalMetadata.gltf[n].variants[a]=[];for(const A of l.variants[a])i._internalMetadata.gltf[n].variants[a].push({mesh:A.mesh,material:A.material})}l=i._internalMetadata.gltf[n]}for(const a of l.original)a.mesh===o&&(a.mesh=G);for(const a of l.variants[M.name])a.mesh===o&&(a.mesh=G)})}}))}}})),await Promise.all(x).then(([o])=>o)})}}C(n);I(n,!0,_=>new s(_));export{s as KHR_materials_variants}; +import{GLTFLoader as S,ArrayItem as L}from"./glTFLoader-BBmdTKVx.js";import{l as O,aG as C,aH as I}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const n="KHR_materials_variants";class s{constructor(t){this.name=n,this._loader=t,this.enabled=this._loader.isExtensionUsed(n)&&!this._loader.parent.skipMaterials}dispose(){this._loader=null}static GetAvailableVariants(t){const e=this._GetExtensionMetadata(t);return e?Object.keys(e.variants):[]}getAvailableVariants(t){return s.GetAvailableVariants(t)}static SelectVariant(t,e){const r=this._GetExtensionMetadata(t);if(!r)throw new Error(`Cannot select variant on a glTF mesh that does not have the ${n} extension`);const h=c=>{const f=r.variants[c];if(f)for(const m of f)m.mesh.material=m.material};if(e instanceof Array)for(const c of e)h(c);else h(e);r.lastSelected=e}selectVariant(t,e){s.SelectVariant(t,e)}static Reset(t){const e=this._GetExtensionMetadata(t);if(!e)throw new Error(`Cannot reset on a glTF mesh that does not have the ${n} extension`);for(const r of e.original)r.mesh.material=r.material;e.lastSelected=null}reset(t){s.Reset(t)}static GetLastSelectedVariant(t){const e=this._GetExtensionMetadata(t);if(!e)throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${n} extension`);return e.lastSelected}getLastSelectedVariant(t){return s.GetLastSelectedVariant(t)}static _GetExtensionMetadata(t){return t?._internalMetadata?.gltf?.[n]||null}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._variants=e.variants}}onReady(){const t=this._loader.rootBabylonMesh;if(t){const e=this._loader.parent.extensionOptions[n];e?.defaultVariant&&s.SelectVariant(t,e.defaultVariant),e?.onLoaded?.({get variants(){return s.GetAvailableVariants(t)},get selectedVariant(){const r=s.GetLastSelectedVariant(t);return r?Array.isArray(r)?r[0]:r:s.GetAvailableVariants(t)[0]},set selectedVariant(r){s.SelectVariant(t,r)}})}}_loadMeshPrimitiveAsync(t,e,r,h,c,f){return S.LoadExtensionAsync(t,c,this.name,async(m,V)=>{const x=new Array;return x.push(this._loader._loadMeshPrimitiveAsync(t,e,r,h,c,o=>{if(f(o),o instanceof O){const $=S._GetDrawMode(t,c.mode),d=this._loader.rootBabylonMesh,E=d?d._internalMetadata=d._internalMetadata||{}:{},w=E.gltf=E.gltf||{},g=w[n]=w[n]||{lastSelected:null,original:[],variants:{}};g.original.push({mesh:o,material:o.material});for(let p=0;p{for(let v=0;v{const G=k;let l=null,i=G;do{if(i=i.parent,!i)return;l=s._GetExtensionMetadata(i)}while(l===null);if(d&&l===s._GetExtensionMetadata(d)){i._internalMetadata={};for(const a in d._internalMetadata)i._internalMetadata[a]=d._internalMetadata[a];i._internalMetadata.gltf=[];for(const a in d._internalMetadata.gltf)i._internalMetadata.gltf[a]=d._internalMetadata.gltf[a];i._internalMetadata.gltf[n]={lastSelected:null,original:[],variants:{}};for(const a of l.original)i._internalMetadata.gltf[n].original.push({mesh:a.mesh,material:a.material});for(const a in l.variants)if(Object.prototype.hasOwnProperty.call(l.variants,a)){i._internalMetadata.gltf[n].variants[a]=[];for(const A of l.variants[a])i._internalMetadata.gltf[n].variants[a].push({mesh:A.mesh,material:A.material})}l=i._internalMetadata.gltf[n]}for(const a of l.original)a.mesh===o&&(a.mesh=G);for(const a of l.variants[M.name])a.mesh===o&&(a.mesh=G)})}}))}}})),await Promise.all(x).then(([o])=>o)})}}C(n);I(n,!0,_=>new s(_));export{s as KHR_materials_variants}; diff --git a/assets/KHR_materials_volume-ES-Rox3I.js b/assets/KHR_materials_volume-Q4lnjBKf.js similarity index 79% rename from assets/KHR_materials_volume-ES-Rox3I.js rename to assets/KHR_materials_volume-Q4lnjBKf.js index 1cdae5c756026fdcde7f376a212dc1aab3b3bc3b..5eae0aaa6f27c27505ec356795394b90c099215c 100644 --- a/assets/KHR_materials_volume-ES-Rox3I.js +++ b/assets/KHR_materials_volume-Q4lnjBKf.js @@ -1 +1 @@ -import{C as h,aG as u,aH as d}from"./index-GY9JDBGV.js";import{GLTFLoader as m}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const a="KHR_materials_volume";class c{constructor(t){this.name=a,this.order=173,this._loader=t,this.enabled=this._loader.isExtensionUsed(a),this.enabled&&this._loader._disableInstancedMesh++}dispose(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(t,o,i){return m.LoadExtensionAsync(t,o,this.name,async(e,s)=>{const r=new Array;return r.push(this._loader.loadMaterialPropertiesAsync(t,o,i)),r.push(this._loadVolumePropertiesAsync(e,o,i,s)),await Promise.all(r).then(()=>{})})}_loadVolumePropertiesAsync(t,o,i,e){const s=this._loader._getOrCreateMaterialAdapter(i);if(s.transmissionWeight===0&&s.subsurfaceWeight===0||!e.thicknessFactor)return Promise.resolve();s.transmissionDepth=e.attenuationDistance!==void 0?e.attenuationDistance:Number.MAX_VALUE,s.transmissionColor=e.attenuationColor!==void 0&&e.attenuationColor.length==3?h.FromArray(e.attenuationColor):h.White(),s.volumeThickness=e.thicknessFactor??0;const r=new Array;return e.thicknessTexture&&(e.thicknessTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${t}/thicknessTexture`,e.thicknessTexture,l=>{l.name=`${i.name} (Thickness)`,s.volumeThicknessTexture=l}))),Promise.all(r).then(()=>{})}}u(a);d(a,!0,n=>new c(n));export{c as KHR_materials_volume}; +import{C as h,aG as u,aH as d}from"./index-DmfQKmJL.js";import{GLTFLoader as m}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const a="KHR_materials_volume";class c{constructor(t){this.name=a,this.order=173,this._loader=t,this.enabled=this._loader.isExtensionUsed(a),this.enabled&&this._loader._disableInstancedMesh++}dispose(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(t,o,i){return m.LoadExtensionAsync(t,o,this.name,async(e,s)=>{const r=new Array;return r.push(this._loader.loadMaterialPropertiesAsync(t,o,i)),r.push(this._loadVolumePropertiesAsync(e,o,i,s)),await Promise.all(r).then(()=>{})})}_loadVolumePropertiesAsync(t,o,i,e){const s=this._loader._getOrCreateMaterialAdapter(i);if(s.transmissionWeight===0&&s.subsurfaceWeight===0||!e.thicknessFactor)return Promise.resolve();s.transmissionDepth=e.attenuationDistance!==void 0?e.attenuationDistance:Number.MAX_VALUE,s.transmissionColor=e.attenuationColor!==void 0&&e.attenuationColor.length==3?h.FromArray(e.attenuationColor):h.White(),s.volumeThickness=e.thicknessFactor??0;const r=new Array;return e.thicknessTexture&&(e.thicknessTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${t}/thicknessTexture`,e.thicknessTexture,l=>{l.name=`${i.name} (Thickness)`,s.volumeThicknessTexture=l}))),Promise.all(r).then(()=>{})}}u(a);d(a,!0,n=>new c(n));export{c as KHR_materials_volume}; diff --git a/assets/KHR_mesh_quantization-CUv9csqJ.js b/assets/KHR_mesh_quantization-CUv9csqJ.js new file mode 100644 index 0000000000000000000000000000000000000000..5a07cd84130cf4d56d5561d0fbf9481c948335ca --- /dev/null +++ b/assets/KHR_mesh_quantization-CUv9csqJ.js @@ -0,0 +1 @@ +import{aG as n,aH as i}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";const s="KHR_mesh_quantization";class o{constructor(e){this.name=s,this.enabled=e.isExtensionUsed(s)}dispose(){}}n(s);i(s,!0,t=>new o(t));export{o as KHR_mesh_quantization}; diff --git a/assets/KHR_mesh_quantization-CkEf5nTW.js b/assets/KHR_mesh_quantization-CkEf5nTW.js deleted file mode 100644 index 7dcd8a32bb130ff2d42b1e4d1712f531d48d07cb..0000000000000000000000000000000000000000 --- a/assets/KHR_mesh_quantization-CkEf5nTW.js +++ /dev/null @@ -1 +0,0 @@ -import{aG as n,aH as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const s="KHR_mesh_quantization";class o{constructor(e){this.name=s,this.enabled=e.isExtensionUsed(s)}dispose(){}}n(s);i(s,!0,t=>new o(t));export{o as KHR_mesh_quantization}; diff --git a/assets/KHR_node_hoverability-D6JodqoY.js b/assets/KHR_node_hoverability-BUksSKT1.js similarity index 94% rename from assets/KHR_node_hoverability-D6JodqoY.js rename to assets/KHR_node_hoverability-BUksSKT1.js index fcd50bcc8d5a1d66f8e2f06b560cb7f6a7c88ebd..7dbbc1c6f586bcf19fbfe806054be7d715e5a043 100644 --- a/assets/KHR_node_hoverability-D6JodqoY.js +++ b/assets/KHR_node_hoverability-BUksSKT1.js @@ -1 +1 @@ -import{aG as f,aH as b}from"./index-GY9JDBGV.js";import{a as p}from"./declarationMapper--DEn7iYN.js";import{A as v}from"./objectModelMapping-CpTIXcMS.js";import"./index-DydPgVMC.js";const i="KHR_node_hoverability",d="targetMeshPointerOver_";p("event/onHoverIn",i,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return d+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,h,t,u,r){const a=t[t.length-1];a.config=a.config||{},a.config.glTF=r;const n=e.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=d+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});const c="targetMeshPointerOut_";p("event/onHoverOut",i,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return c+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,h,t,u,r){const a=t[t.length-1];a.config=a.config||{},a.config.glTF=r;const n=e.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=c+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});v("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:e=>{const o=e._babylonTransformNode;return o&&o.pointerOverDisableMeshTesting!==void 0?o.pointerOverDisableMeshTesting:!0},set:(e,o)=>{o._primitiveBabylonMeshes?.forEach(s=>{s.pointerOverDisableMeshTesting=!e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"pointerOverDisableMeshTesting"],type:"boolean"});class x{constructor(o){this.name=i,this._loader=o,this.enabled=o.isExtensionUsed(i)}async onReady(){this._loader.gltf.nodes?.forEach(o=>{o.extensions?.KHR_node_hoverability&&o.extensions?.KHR_node_hoverability.hoverable===!1&&o._babylonTransformNode?.getChildMeshes().forEach(s=>{s.pointerOverDisableMeshTesting=!0})})}dispose(){this._loader=null}}f(i);b(i,!0,e=>new x(e));export{x as KHR_node_hoverability}; +import{aG as f,aH as b}from"./index-DmfQKmJL.js";import{a as p}from"./declarationMapper-g3VMH3is.js";import{A as v}from"./objectModelMapping-BHbejOcH.js";import"./index-BeNBoC9J.js";const i="KHR_node_hoverability",d="targetMeshPointerOver_";p("event/onHoverIn",i,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return d+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,h,t,u,r){const a=t[t.length-1];a.config=a.config||{},a.config.glTF=r;const n=e.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=d+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});const c="targetMeshPointerOut_";p("event/onHoverOut",i,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return c+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,h,t,u,r){const a=t[t.length-1];a.config=a.config||{},a.config.glTF=r;const n=e.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=c+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});v("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:e=>{const o=e._babylonTransformNode;return o&&o.pointerOverDisableMeshTesting!==void 0?o.pointerOverDisableMeshTesting:!0},set:(e,o)=>{o._primitiveBabylonMeshes?.forEach(s=>{s.pointerOverDisableMeshTesting=!e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"pointerOverDisableMeshTesting"],type:"boolean"});class x{constructor(o){this.name=i,this._loader=o,this.enabled=o.isExtensionUsed(i)}async onReady(){this._loader.gltf.nodes?.forEach(o=>{o.extensions?.KHR_node_hoverability&&o.extensions?.KHR_node_hoverability.hoverable===!1&&o._babylonTransformNode?.getChildMeshes().forEach(s=>{s.pointerOverDisableMeshTesting=!0})})}dispose(){this._loader=null}}f(i);b(i,!0,e=>new x(e));export{x as KHR_node_hoverability}; diff --git a/assets/KHR_node_selectability-CL97S7vV.js b/assets/KHR_node_selectability-BGsP4qlQ.js similarity index 91% rename from assets/KHR_node_selectability-CL97S7vV.js rename to assets/KHR_node_selectability-BGsP4qlQ.js index a043c428be796a337de3cd2530a833717e2d5402..74b4be46d50eb99394b44f198e9bb69627fce213 100644 --- a/assets/KHR_node_selectability-CL97S7vV.js +++ b/assets/KHR_node_selectability-BGsP4qlQ.js @@ -1 +1 @@ -import{aG as d,aH as u}from"./index-GY9JDBGV.js";import{a as p}from"./declarationMapper--DEn7iYN.js";import{A as b}from"./objectModelMapping-CpTIXcMS.js";import"./index-DydPgVMC.js";const t="KHR_node_selectability";p("event/onSelect",t,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(o){return"pickedMesh_"+o}}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(o,e,a,m,i,c,r){const s=i[i.length-1];s.config=s.config||{},s.config.glTF=r;const n=o.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l="pickedMesh_"+n;return i[1].config.variable=l,c._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},i}});b("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:o=>{const e=o._babylonTransformNode;return e&&e.isPickable!==void 0?e.isPickable:!0},set:(o,e)=>{e._primitiveBabylonMeshes?.forEach(a=>{a.isPickable=o})},getTarget:o=>o._babylonTransformNode,getPropertyName:[()=>"isPickable"],type:"boolean"});class f{constructor(e){this.name=t,this._loader=e,this.enabled=e.isExtensionUsed(t)}async onReady(){this._loader.gltf.nodes?.forEach(e=>{e.extensions?.KHR_node_selectability&&e.extensions?.KHR_node_selectability.selectable===!1&&e._babylonTransformNode?.getChildMeshes().forEach(a=>{a.isPickable=!1})})}dispose(){this._loader=null}}d(t);u(t,!0,o=>new f(o));export{f as KHR_node_selectability}; +import{aG as d,aH as u}from"./index-DmfQKmJL.js";import{a as p}from"./declarationMapper-g3VMH3is.js";import{A as b}from"./objectModelMapping-BHbejOcH.js";import"./index-BeNBoC9J.js";const t="KHR_node_selectability";p("event/onSelect",t,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(o){return"pickedMesh_"+o}}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(o,e,a,m,i,c,r){const s=i[i.length-1];s.config=s.config||{},s.config.glTF=r;const n=o.configuration?.nodeIndex?.value?.[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l="pickedMesh_"+n;return i[1].config.variable=l,c._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},i}});b("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:o=>{const e=o._babylonTransformNode;return e&&e.isPickable!==void 0?e.isPickable:!0},set:(o,e)=>{e._primitiveBabylonMeshes?.forEach(a=>{a.isPickable=o})},getTarget:o=>o._babylonTransformNode,getPropertyName:[()=>"isPickable"],type:"boolean"});class f{constructor(e){this.name=t,this._loader=e,this.enabled=e.isExtensionUsed(t)}async onReady(){this._loader.gltf.nodes?.forEach(e=>{e.extensions?.KHR_node_selectability&&e.extensions?.KHR_node_selectability.selectable===!1&&e._babylonTransformNode?.getChildMeshes().forEach(a=>{a.isPickable=!1})})}dispose(){this._loader=null}}d(t);u(t,!0,o=>new f(o));export{f as KHR_node_selectability}; diff --git a/assets/KHR_node_visibility-DPtswzyf.js b/assets/KHR_node_visibility-r1d3kjpo.js similarity index 87% rename from assets/KHR_node_visibility-DPtswzyf.js rename to assets/KHR_node_visibility-r1d3kjpo.js index 7ad28d66894aa939896d2e4725f825cf5016ffac..1ab1d404986d452fb20b392854ce9a7a024f22e1 100644 --- a/assets/KHR_node_visibility-DPtswzyf.js +++ b/assets/KHR_node_visibility-r1d3kjpo.js @@ -1 +1 @@ -import{aG as n,aH as r}from"./index-GY9JDBGV.js";import{A as a}from"./objectModelMapping-CpTIXcMS.js";import"./index-DydPgVMC.js";const o="KHR_node_visibility";a("/nodes/{}/extensions/KHR_node_visibility/visible",{get:e=>{const i=e._babylonTransformNode;return i&&i.isVisible!==void 0?i.isVisible:!0},set:(e,i)=>{i._primitiveBabylonMeshes?.forEach(s=>{s.inheritVisibility=!0}),i._babylonTransformNode&&(i._babylonTransformNode.isVisible=e),i._primitiveBabylonMeshes?.forEach(s=>{s.isVisible=e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"isVisible"],type:"boolean"});class b{constructor(i){this.name=o,this._loader=i,this.enabled=i.isExtensionUsed(o)}onReady(){if(!this._loader)return;const i=this._loader.gltf.nodes;if(i)for(const s of i){const t=s._babylonTransformNode;t&&(t.inheritVisibility=!0,s.extensions&&s.extensions.KHR_node_visibility&&s.extensions.KHR_node_visibility.visible===!1&&(t.isVisible=!1))}}dispose(){delete this._loader}}n(o);r(o,!0,e=>new b(e));export{b as KHR_node_visibility}; +import{aG as n,aH as r}from"./index-DmfQKmJL.js";import{A as a}from"./objectModelMapping-BHbejOcH.js";import"./index-BeNBoC9J.js";const o="KHR_node_visibility";a("/nodes/{}/extensions/KHR_node_visibility/visible",{get:e=>{const i=e._babylonTransformNode;return i&&i.isVisible!==void 0?i.isVisible:!0},set:(e,i)=>{i._primitiveBabylonMeshes?.forEach(s=>{s.inheritVisibility=!0}),i._babylonTransformNode&&(i._babylonTransformNode.isVisible=e),i._primitiveBabylonMeshes?.forEach(s=>{s.isVisible=e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"isVisible"],type:"boolean"});class b{constructor(i){this.name=o,this._loader=i,this.enabled=i.isExtensionUsed(o)}onReady(){if(!this._loader)return;const i=this._loader.gltf.nodes;if(i)for(const s of i){const t=s._babylonTransformNode;t&&(t.inheritVisibility=!0,s.extensions&&s.extensions.KHR_node_visibility&&s.extensions.KHR_node_visibility.visible===!1&&(t.isVisible=!1))}}dispose(){delete this._loader}}n(o);r(o,!0,e=>new b(e));export{b as KHR_node_visibility}; diff --git a/assets/KHR_texture_basisu-DQi3JB14.js b/assets/KHR_texture_basisu-CsSDuYIk.js similarity index 65% rename from assets/KHR_texture_basisu-DQi3JB14.js rename to assets/KHR_texture_basisu-CsSDuYIk.js index e6340726363f4ab52e430009842bdb47f3ae5ed8..1e0c7b7e7324f0198dd538634877f11bac0a2473 100644 --- a/assets/KHR_texture_basisu-DQi3JB14.js +++ b/assets/KHR_texture_basisu-CsSDuYIk.js @@ -1 +1 @@ -import{GLTFLoader as a,ArrayItem as o}from"./glTFLoader-CdfQ_yvy.js";import{aG as d,aH as _}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const r="KHR_texture_basisu";class c{constructor(e){this.name=r,this._loader=e,this.enabled=e.isExtensionUsed(r)}dispose(){this._loader=null}_loadTextureAsync(e,s,n){return a.LoadExtensionAsync(e,s,this.name,async(i,l)=>{const m=s.sampler==null?a.DefaultSampler:o.Get(`${e}/sampler`,this._loader.gltf.samplers,s.sampler),u=o.Get(`${i}/source`,this._loader.gltf.images,l.source);return await this._loader._createTextureAsync(e,m,u,p=>{n(p)},s._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!s._textureInfo.nonColorData)})}}d(r);_(r,!0,t=>new c(t));export{c as KHR_texture_basisu}; +import{GLTFLoader as a,ArrayItem as o}from"./glTFLoader-BBmdTKVx.js";import{aG as d,aH as _}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const r="KHR_texture_basisu";class c{constructor(e){this.name=r,this._loader=e,this.enabled=e.isExtensionUsed(r)}dispose(){this._loader=null}_loadTextureAsync(e,s,n){return a.LoadExtensionAsync(e,s,this.name,async(i,l)=>{const m=s.sampler==null?a.DefaultSampler:o.Get(`${e}/sampler`,this._loader.gltf.samplers,s.sampler),u=o.Get(`${i}/source`,this._loader.gltf.images,l.source);return await this._loader._createTextureAsync(e,m,u,p=>{n(p)},s._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!s._textureInfo.nonColorData)})}}d(r);_(r,!0,t=>new c(t));export{c as KHR_texture_basisu}; diff --git a/assets/KHR_texture_transform-CoUD1z_v.js b/assets/KHR_texture_transform-CXA16jSd.js similarity index 66% rename from assets/KHR_texture_transform-CoUD1z_v.js rename to assets/KHR_texture_transform-CXA16jSd.js index 918439d79cd41fbfe4027ea3f9750a419ab06443..4c1664aa3c621f384109015b8b00c8f7ac3eefd3 100644 --- a/assets/KHR_texture_transform-CoUD1z_v.js +++ b/assets/KHR_texture_transform-CXA16jSd.js @@ -1 +1 @@ -import{T as d,aG as c,aH as m}from"./index-GY9JDBGV.js";import{GLTFLoader as p}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const s="KHR_texture_transform";class n{constructor(o){this.name=s,this._loader=o,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadTextureInfoAsync(o,a,f){return p.LoadExtensionAsync(o,a,this.name,async(e,t)=>await this._loader.loadTextureInfoAsync(o,a,r=>{if(!(r instanceof d))throw new Error(`${e}: Texture type not supported`);t.offset&&(r.uOffset=t.offset[0],r.vOffset=t.offset[1]),r.uRotationCenter=0,r.vRotationCenter=0,t.rotation&&(r.wAng=-t.rotation),t.scale&&(r.uScale=t.scale[0],r.vScale=t.scale[1]),t.texCoord!=null&&(r.coordinatesIndex=t.texCoord),f(r)}))}}c(s);m(s,!0,i=>new n(i));export{n as KHR_texture_transform}; +import{T as d,aG as c,aH as m}from"./index-DmfQKmJL.js";import{GLTFLoader as p}from"./glTFLoader-BBmdTKVx.js";import"./index-BeNBoC9J.js";import"./bone-DcPUF7Rw.js";import"./skeleton-CiiOtZPn.js";import"./rawTexture-3EXxZD4a.js";import"./assetContainer-CT42NrOs.js";import"./objectModelMapping-BHbejOcH.js";const s="KHR_texture_transform";class n{constructor(o){this.name=s,this._loader=o,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadTextureInfoAsync(o,a,f){return p.LoadExtensionAsync(o,a,this.name,async(e,t)=>await this._loader.loadTextureInfoAsync(o,a,r=>{if(!(r instanceof d))throw new Error(`${e}: Texture type not supported`);t.offset&&(r.uOffset=t.offset[0],r.vOffset=t.offset[1]),r.uRotationCenter=0,r.vRotationCenter=0,t.rotation&&(r.wAng=-t.rotation),t.scale&&(r.uScale=t.scale[0],r.vScale=t.scale[1]),t.texCoord!=null&&(r.coordinatesIndex=t.texCoord),f(r)}))}}c(s);m(s,!0,i=>new n(i));export{n as KHR_texture_transform}; diff --git a/assets/KHR_xmp_json_ld-Ct3AEWVf.js b/assets/KHR_xmp_json_ld-DtbWmIaX.js similarity index 80% rename from assets/KHR_xmp_json_ld-Ct3AEWVf.js rename to assets/KHR_xmp_json_ld-DtbWmIaX.js index 6be5170a9bb74e6c4cbef4ae050ef2a7fd7af624..a1ce2e4e0895ee89a64b3d102953a5739040515c 100644 --- a/assets/KHR_xmp_json_ld-Ct3AEWVf.js +++ b/assets/KHR_xmp_json_ld-DtbWmIaX.js @@ -1 +1 @@ -import{aG as n,aH as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const s="KHR_xmp_json_ld";class i{constructor(t){this.name=s,this.order=100,this._loader=t,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}onLoading(){if(this._loader.rootBabylonMesh===null)return;const t=this._loader.gltf.extensions?.KHR_xmp_json_ld,o=this._loader.gltf.asset?.extensions?.KHR_xmp_json_ld;if(t&&o){const a=+o.packet;t.packets&&anew i(e));export{i as KHR_xmp_json_ld}; +import{aG as n,aH as r}from"./index-DmfQKmJL.js";import"./index-BeNBoC9J.js";const s="KHR_xmp_json_ld";class i{constructor(t){this.name=s,this.order=100,this._loader=t,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}onLoading(){if(this._loader.rootBabylonMesh===null)return;const t=this._loader.gltf.extensions?.KHR_xmp_json_ld,o=this._loader.gltf.asset?.extensions?.KHR_xmp_json_ld;if(t&&o){const a=+o.packet;t.packets&&anew i(e));export{i as KHR_xmp_json_ld}; diff --git a/assets/LineChart-DuGokVK_.js b/assets/LineChart-DuGokVK_.js deleted file mode 100644 index 85077009cfc3d5b2bfcd923975f52251cd3f94ff..0000000000000000000000000000000000000000 --- a/assets/LineChart-DuGokVK_.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as t,f as o}from"./index-DydPgVMC.js";var v=o('');function s(i){var r=v();t(i,r)}export{s as L}; diff --git a/assets/Login-ySksf2jQ.js b/assets/Login-ySksf2jQ.js deleted file mode 100644 index f7e1d99ab9f69bb5b479e9bb1105181c09c6cd46..0000000000000000000000000000000000000000 --- a/assets/Login-ySksf2jQ.js +++ /dev/null @@ -1 +0,0 @@ -import{p as c,e as ae,i as R,b as re}from"./i18n-CPHyzK9b.js";import{M as se,N as X,S as p,Z as l,$ as f,ad as Z,x as m,v as u,a as i,a4 as oe,t as g,X as P,Q as h,O as le,a0 as q,P as $,R as d,T as b,a5 as ie}from"./index-DydPgVMC.js";import{h as ne}from"./html-BZIV6tyB.js";import{B as pe}from"./BaseForm-DAripPNq.js";import{T as j}from"./Textbox-BhB0hOv8.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{B as A}from"./Block-WPcVj6Bq.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";/* empty css */import{B as me}from"./Button-CV36sOqf.js";import{B as ue}from"./Index.svelte_svelte_type_style_lang-glBt5fcY.js";import"./actions-4RaHFoGI.js";import"./input-BtIxlP_B.js";import"./BlockTitle-DNiCHWOR.js";import"./Info-DfrMwI06.js";import"./Check-2f8HlfSn.js";import"./Copy-B3jzejpA.js";import"./Send-oZH_TPNw.js";import"./Square-D8rV3Ea-.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./snippet-BtHMuX3s.js";import"./index-B_pwUImq.js";import"./Image-CZ1Hb99p.js";import"./misc-Dkc5KZ-v.js";/* empty css *//* empty css */import"./index-CfM_uZQa.js";import"./Clear-BR8cTgGu.js";var de=d('

                '),_e=d('

                '),ve=d('

                '),ce=d(" ",1),fe=d('

                ',1),ge=d("
                ");function Ee(E,n){se(n,!1);let _=c(n,"root",12),x=c(n,"auth_message",12),k=c(n,"app_mode",12),T=c(n,"space_id",12),a=c(n,"i18n",12),w=q(""),B=q(""),z=q(!1);const S=async()=>{const t=new FormData;t.append("username",l(w)),t.append("password",l(B));const M=new URL("login",_().endsWith("/")?_():_()+"/").href;let v=await fetch(M,{method:"POST",body:t});v.status===400?(f(z,!0),f(w,""),f(B,"")):v.status==200&&location.reload()};var G={get root(){return _()},set root(t){_(t),$()},get auth_message(){return x()},set auth_message(t){x(t),$()},get app_mode(){return k()},set app_mode(t){k(t),$()},get space_id(){return T()},set space_id(t){T(t),$()},get i18n(){return a()},set i18n(t){a(t),$()}};ae();var y=ge();let C;var H=h(y);return ue(H,{variant:"panel",min_width:480,children:(t,M)=>{var v=fe(),D=X(v),I=h(D,!0);b(D);var N=p(D,2);{var J=e=>{var r=de(),s=h(r);ne(s,x),b(r),i(e,r)};R(N,e=>{x()&&e(J)})}var Q=p(N,2);{var K=e=>{var r=_e(),s=h(r,!0);b(r),g(o=>P(s,o),[()=>(m(a()),u(()=>a()("login.enable_cookies")))]),i(e,r)};R(Q,e=>{T()&&e(K)})}var U=p(Q,2);{var V=e=>{var r=ve(),s=h(r,!0);b(r),g(o=>P(s,o),[()=>(m(a()),u(()=>a()("login.incorrect_credentials")))]),i(e,r)};R(U,e=>{l(z)&&e(V)})}var W=p(U,2);pe(W,{children:(e,r)=>{var s=ce(),o=X(s);A(o,{children:(F,te)=>{{let L=Z(()=>(m(a()),u(()=>a()("login.username"))));j(F,{get label(){return l(L)},lines:1,show_label:!0,max_lines:1,onsubmit:S,get value(){return l(w)},set value(O){f(w,O)},$$legacy:!0})}},$$slots:{default:!0}});var ee=p(o,2);A(ee,{children:(F,te)=>{{let L=Z(()=>(m(a()),u(()=>a()("login.password"))));j(F,{get label(){return l(L)},lines:1,show_label:!0,max_lines:1,type:"password",onsubmit:S,get value(){return l(B)},set value(O){f(B,O)},$$legacy:!0})}},$$slots:{default:!0}}),i(e,s)},$$slots:{default:!0}});var Y=p(W,2);me(Y,{size:"lg",variant:"primary",onclick:S,children:(e,r)=>{ie();var s=oe();g(o=>P(s,o),[()=>(m(a()),u(()=>a()("login.login")))]),i(e,s)},$$slots:{default:!0}}),g(e=>P(I,e),[()=>(m(a()),u(()=>a()("login.login")))]),i(t,v)},$$slots:{default:!0}}),b(y),g(()=>C=re(y,1,"wrap svelte-2nab5v",null,C,{"min-h-screen":k()})),i(E,y),le(G)}export{Ee as default}; diff --git a/assets/MSFT_audio_emitter-W4xW1f1_.js b/assets/MSFT_audio_emitter-W4xW1f1_.js deleted file mode 100644 index 4bbd5d87d1bda29727ce023d07a62a51aa951805..0000000000000000000000000000000000000000 --- a/assets/MSFT_audio_emitter-W4xW1f1_.js +++ /dev/null @@ -1 +0,0 @@ -import{O as R,V as m,aq as E,A as c,L as C,bo as v,be as F,R as L,b,a as _,M as U,by as W,d as P,aG as z,aH as q}from"./index-GY9JDBGV.js";import{_ as $,d as g}from"./spatialWebAudio-D-sfHE2Z.js";import{_WebAudioSoundSource as p}from"./webAudioSoundSource-3sgwHR9P.js";import{_WebAudioStaticSound as y}from"./webAudioStaticSound-BEsC4sEN.js";import{_WebAudioStreamingSound as G}from"./webAudioStreamingSound-C_Kgt28o.js";import{ArrayItem as T,GLTFLoader as S}from"./glTFLoader-CdfQ_yvy.js";import"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";import"./webAudioBaseSubGraph-CgvRUdPi.js";import"./abstractSoundSource-Dkzp9Tp9.js";import"./abstractSoundInstance-Bnv14BnJ.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";class w{constructor(t,e,i){this.frame=t,this.action=e,this.onlyOnce=i,this.isDone=!1}_clone(){return new w(this.frame,this.action,this.onlyOnce)}}const x={duration:0,shape:"linear"},D={duration:0,startOffset:0,waitTime:0},I={waitTime:0};function M(o){return o*Math.PI/180}function N(o){return o*180/Math.PI}class A{get name(){return this._soundV2.name}set name(t){this._soundV2.name=t}get autoplay(){return this._soundV2 instanceof p?!0:this._optionsV2.autoplay}set autoplay(t){this._optionsV2.autoplay=t}get loop(){return this._soundV2 instanceof p?!0:this._soundV2.loop}set loop(t){this._soundV2 instanceof p||this._soundV2&&(this._soundV2.loop=t)}get isPlaying(){return this._soundV2 instanceof p?!0:this._soundV2?.state===3||!this.isReady()&&this._optionsV2.autoplay}get isPaused(){return this._soundV2 instanceof p?!1:this._soundV2.state===5}get maxDistance(){return this._optionsV2.spatialMaxDistance||100}set maxDistance(t){this._optionsV2.spatialMaxDistance=t,!this.useCustomAttenuation&&this._soundV2&&(this._initSpatial(),this._soundV2.spatial.maxDistance=t)}get distanceModel(){return this._optionsV2.spatialDistanceModel||"linear"}set distanceModel(t){this._optionsV2.spatialDistanceModel=t,this._soundV2&&(this._initSpatial(),this._soundV2.spatial.distanceModel=t)}get currentTime(){return this._soundV2 instanceof p?this._soundV2.engine.currentTime:this._soundV2.currentTime}get spatialSound(){return this._soundV2?._isSpatial??!1}set spatialSound(t){this._soundV2&&(t?this._initSpatial():this._soundV2._isSpatial=!1)}get _onReady(){return this._onReadyObservable||(this._onReadyObservable=new R),this._onReadyObservable}constructor(t,e,i,s=null,a){if(this.useCustomAttenuation=!1,this.soundTrackId=-1,this.refDistance=1,this.rolloffFactor=1,this.metadata=null,this.onEndedObservable=new R,this._localDirection=new m(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._isOutputConnected=!1,this._url=null,this._onReadyObservable=null,this._onReadyToPlay=()=>{this._scene.mainSoundTrack.addSound(this),this._isReadyToPlay=!0,this._readyToPlayCallback(),this._onReadyObservable&&this._onReadyObservable.notifyObservers(),this._optionsV2.autoplay&&this.play()},this._onended=()=>{this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)},i=i||E.LastCreatedScene,!i)return;this._scene=i,A._SceneComponentInitialization(i),this._readyToPlayCallback=s||(()=>{}),this._customAttenuationFunction=(h,V,O,Q,X)=>V{if(r){const h={preloadCount:0,...n},V=new G(t,d,h);return V._initAsync(e,n).then(()=>{V.preloadInstancesAsync(1).then(this._onReadyToPlay)}),V}else{const h=new y(t,d,n);return h._initAsync(e,n).then(this._onReadyToPlay),h}};if(!e)this._soundV2=new y(t,d,n);else if(typeof e=="string")this._url=e,this._soundV2=u();else if(e instanceof ArrayBuffer)r=!1,this._soundV2=u();else if(e instanceof HTMLMediaElement)r=!0,this._soundV2=u();else if(e instanceof MediaStream){const h=new MediaStreamAudioSourceNode(d._audioContext,{mediaStream:e});this._soundV2=new p(t,h,d,n),this._soundV2._initAsync(n).then(this._onReadyToPlay)}else e instanceof AudioBuffer?(r=!1,this._soundV2=u()):Array.isArray(e)&&(this._soundV2=u());if(!this._soundV2){C.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");return}this._soundV2 instanceof p||this._soundV2.onEndedObservable.add(this._onended)}dispose(){this.isPlaying&&this.stop(),this._isReadyToPlay=!1,this.soundTrackId===-1?this._scene.mainSoundTrack.removeSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].removeSound(this),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null),this._soundV2.dispose()}isReady(){return this._isReadyToPlay}getClassName(){return"Sound"}setAudioBuffer(t){this._isReadyToPlay||this._soundV2 instanceof y&&this._soundV2._initAsync(t,this._optionsV2).then(this._onReadyToPlay)}updateOptions(t){if(t){if(this.loop=t.loop??this.loop,this.maxDistance=t.maxDistance??this.maxDistance,this.useCustomAttenuation=t.useCustomAttenuation??this.useCustomAttenuation,this.rolloffFactor=t.rolloffFactor??this.rolloffFactor,this.refDistance=t.refDistance??this.refDistance,this.distanceModel=t.distanceModel??this.distanceModel,t.playbackRate!==void 0&&this.setPlaybackRate(t.playbackRate),t.spatialSound!==void 0&&(this.spatialSound=t.spatialSound),t.volume!==void 0&&this.setVolume(t.volume),this._soundV2 instanceof y){let e=!1;t.offset!==void 0&&(this._optionsV2.startOffset=t.offset,e=!0),t.length!==void 0&&(this._soundV2.duration=t.length,e=!0),e&&this.isPaused&&this.stop()}this._updateSpatialParameters()}}_updateSpatialParameters(){if(!this.spatialSound)return;const t=this._soundV2.spatial;this.useCustomAttenuation?(t.distanceModel="linear",t.minDistance=1,t.maxDistance=Number.MAX_VALUE,t.rolloffFactor=1,t.panningModel="equalpower"):(t.distanceModel=this.distanceModel,t.minDistance=this.refDistance,t.maxDistance=this.maxDistance,t.rolloffFactor=this.rolloffFactor,t.panningModel=this._optionsV2.spatialPanningModel||"equalpower")}switchPanningModelToHRTF(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="HRTF")}switchPanningModelToEqualPower(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="equalpower")}connectToSoundTrackAudioNode(t){const e=this._soundV2._outNode;e&&(this._isOutputConnected&&e.disconnect(),e.connect(t),this._isOutputConnected=!0)}setDirectionalCone(t,e,i){if(e{this._soundV2.play(D)},500)}catch(a){C.Error("Error while trying to play audio: "+this.name+", "+a.message)}}}stop(t){this._soundV2&&(this._soundV2 instanceof p||(I.waitTime=t||0,this._soundV2.stop(I)))}pause(){this._soundV2&&(this._soundV2 instanceof p||this._soundV2.pause())}setVolume(t,e){if(!this.isReady()){this._onReady.addOnce(()=>{this.setVolume(t,e)});return}x.duration=e||0,this._soundV2.setVolume(t,x),this._volume=t}setPlaybackRate(t){this._soundV2 instanceof y&&(this._soundV2.playbackRate=t)}getPlaybackRate(){return this._soundV2 instanceof y?this._soundV2.playbackRate:1}getVolume(){return this._volume}attachToMesh(t){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=t,this.spatialSound||(this.spatialSound=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._optionsV2.startOffset,this._optionsV2.duration))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=e=>this._onRegisterAfterWorldMatrixUpdate(e),this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)}detachFromMesh(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)}_onRegisterAfterWorldMatrixUpdate(t){if(!t.getBoundingInfo)this.setPosition(t.absolutePosition);else{const i=t.getBoundingInfo();this.setPosition(i.boundingSphere.centerWorld)}this._isDirectional&&this.isPlaying&&this._updateDirection()}clone(){if(!(this._soundV2 instanceof y))return null;const t={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},e=new A(this.name+"_cloned",this._soundV2.buffer,this._scene,null,t);return e._optionsV2=this._optionsV2,this.useCustomAttenuation&&e.setAttenuationFunction(this._customAttenuationFunction),e}getAudioBuffer(){return this._soundV2 instanceof y?this._soundV2.buffer._audioBuffer:null}getSoundSource(){return null}getSoundGain(){return this._soundV2._outNode}serialize(){const t={name:this.name,url:this._url,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this.getPlaybackRate(),panningModel:this._soundV2.spatial.panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this.spatialSound&&(this._connectedTransformNode&&(t.connectedMeshId=this._connectedTransformNode.id),t.position=this._soundV2.spatial.position.asArray(),t.refDistance=this.refDistance,t.distanceModel=this.distanceModel,t.isDirectional=this._isDirectional,t.localDirectionToMesh=this._localDirection.asArray(),t.coneInnerAngle=this.directionalConeInnerAngle,t.coneOuterAngle=this.directionalConeOuterAngle,t.coneOuterGain=this._soundV2.spatial.coneOuterVolume),t}static Parse(t,e,i,s){const a=t.name;let n;t.url?n=i+t.url:n=i+a;const r={autoplay:t.autoplay,loop:t.loop,volume:t.volume,spatialSound:t.spatialSound,maxDistance:t.maxDistance,rolloffFactor:t.rolloffFactor,refDistance:t.refDistance,distanceModel:t.distanceModel,playbackRate:t.playbackRate};let l;if(!s)l=new A(a,n,e,()=>{e.removePendingData(l)},r),e.addPendingData(l);else{const d=()=>{v(()=>s._isReadyToPlay,()=>{const u=s.getAudioBuffer();u&&l.setAudioBuffer(u),l._isReadyToPlay=!0,l.autoplay&&l.play(0,s._optionsV2.startOffset,s._optionsV2.duration)},void 0,300)};l=new A(a,new ArrayBuffer(0),e,null,r),d()}if(t.position){const d=m.FromArray(t.position);l.setPosition(d)}if(t.isDirectional&&(l.setDirectionalCone(t.coneInnerAngle||360,t.coneOuterAngle||360,t.coneOuterGain||0),t.localDirectionToMesh)){const d=m.FromArray(t.localDirectionToMesh);l.setLocalDirectionToMesh(d)}if(t.connectedMeshId){const d=e.getMeshById(t.connectedMeshId);d&&l.attachToMesh(d)}return t.metadata&&(l.metadata=t.metadata),l}}A._SceneComponentInitialization=o=>{throw F("AudioSceneComponent")};L("BABYLON.Sound",A);class j{constructor(t,e,i){if(this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],e.length!==i.length)throw new Error("Sounds length does not equal weights length");this.loop=t,this._weights=i;let s=0;for(const n of i)s+=n;const a=s>0?1/s:0;for(let n=0;n{this._onended()})}get directionalConeInnerAngle(){return this._coneInnerAngle}set directionalConeInnerAngle(t){if(t!==this._coneInnerAngle){if(this._coneOuterAngle0&&(s=e.activeCameras[0]),this.audioListenerPositionProvider){const n=this.audioListenerPositionProvider();i.audioContext.listener.setPosition(n.x||0,n.y||0,n.z||0)}else s?this._cachedCameraPosition.equals(s.globalPosition)||(this._cachedCameraPosition.copyFrom(s.globalPosition),i.audioContext.listener.setPosition(s.globalPosition.x,s.globalPosition.y,s.globalPosition.z)):i.audioContext.listener.setPosition(0,0,0);if(this.audioListenerRotationProvider){const n=this.audioListenerRotationProvider();i.audioContext.listener.setOrientation(n.x||0,n.y||0,n.z||0,0,1,0)}else s?(s.rigCameras&&s.rigCameras.length>0&&(s=s.rigCameras[0]),s.getViewMatrix().invertToRef(this._invertMatrixTemp),m.TransformNormalToRef(f._CameraDirection,this._invertMatrixTemp,this._cameraDirectionTemp),this._cameraDirectionTemp.normalize(),!isNaN(this._cameraDirectionTemp.x)&&!isNaN(this._cameraDirectionTemp.y)&&!isNaN(this._cameraDirectionTemp.z)&&(this._cachedCameraDirection.equals(this._cameraDirectionTemp)||(this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp),i.audioContext.listener.setOrientation(this._cameraDirectionTemp.x,this._cameraDirectionTemp.y,this._cameraDirectionTemp.z,0,1,0)))):i.audioContext.listener.setOrientation(0,0,0,0,1,0);let a;for(a=0;a{let t=o._getComponent(_.NAME_AUDIO);t||(t=new f(o),o._addComponent(t))};const k="MSFT_audio_emitter";class B{constructor(t){this.name=k,this._loader=t,this.enabled=this._loader.isExtensionUsed(k)}dispose(){this._loader=null,this._clips=null,this._emitters=null}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._clips=e.clips,this._emitters=e.emitters,T.Assign(this._clips),T.Assign(this._emitters)}}loadSceneAsync(t,e){return S.LoadExtensionAsync(t,e,this.name,async(i,s)=>{const a=new Array;a.push(this._loader.loadSceneAsync(t,e));for(const n of s.emitters){const r=T.Get(`${i}/emitters`,this._emitters,n);if(r.refDistance!=null||r.maxDistance!=null||r.rolloffFactor!=null||r.distanceModel!=null||r.innerAngle!=null||r.outerAngle!=null)throw new Error(`${i}: Direction or Distance properties are not allowed on emitters attached to a scene`);a.push(this._loadEmitterAsync(`${i}/emitters/${r.index}`,r))}await Promise.all(a)})}loadNodeAsync(t,e,i){return S.LoadExtensionAsync(t,e,this.name,async(s,a)=>{const n=new Array,r=await this._loader.loadNodeAsync(s,e,l=>{for(const d of a.emitters){const u=T.Get(`${s}/emitters`,this._emitters,d);n.push(this._loadEmitterAsync(`${s}/emitters/${u.index}`,u).then(()=>{for(const h of u._babylonSounds)h.attachToMesh(l),(u.innerAngle!=null||u.outerAngle!=null)&&(h.setLocalDirectionToMesh(m.Forward()),h.setDirectionalCone(2*P.ToDegrees(u.innerAngle==null?Math.PI:u.innerAngle),2*P.ToDegrees(u.outerAngle==null?Math.PI:u.outerAngle),0))}))}i(l)});return await Promise.all(n),r})}loadAnimationAsync(t,e){return S.LoadExtensionAsync(t,e,this.name,async(i,s)=>{const a=await this._loader.loadAnimationAsync(t,e),n=new Array;T.Assign(s.events);for(const r of s.events)n.push(this._loadAnimationEventAsync(`${i}/events/${r.index}`,t,e,r,a));return await Promise.all(n),a})}_loadClipAsync(t,e){if(e._objectURL)return e._objectURL;let i;if(e.uri)i=this._loader.loadUriAsync(t,e,e.uri);else{const s=T.Get(`${t}/bufferView`,this._loader.gltf.bufferViews,e.bufferView);i=this._loader.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}return e._objectURL=i.then(s=>URL.createObjectURL(new Blob([s],{type:e.mimeType}))),e._objectURL}_loadEmitterAsync(t,e){if(e._babylonSounds=e._babylonSounds||[],!e._babylonData){const i=new Array,s=e.name||`emitter${e.index}`,a={loop:!1,autoplay:!1,volume:e.volume==null?1:e.volume};for(let r=0;r{const h=e._babylonSounds[r]=new A(s,u,this._loader.babylonScene,null,a);h.refDistance=e.refDistance||1,h.maxDistance=e.maxDistance||256,h.rolloffFactor=e.rolloffFactor||1,h.distanceModel=e.distanceModel||"exponential"}))}const n=Promise.all(i).then(()=>{const r=e.clips.map(d=>d.weight||1),l=new j(e.loop||!1,e._babylonSounds,r);e.innerAngle&&(l.directionalConeInnerAngle=2*P.ToDegrees(e.innerAngle)),e.outerAngle&&(l.directionalConeOuterAngle=2*P.ToDegrees(e.outerAngle)),e.volume&&(l.volume=e.volume),e._babylonData.sound=l});e._babylonData={loaded:n}}return e._babylonData.loaded}_getEventAction(t,e,i,s,a){switch(i){case"play":return n=>{const r=(a||0)+(n-s);e.play(r)};case"stop":return()=>{e.stop()};case"pause":return()=>{e.pause()};default:throw new Error(`${t}: Unsupported action ${i}`)}}_loadAnimationEventAsync(t,e,i,s,a){if(a.targetedAnimations.length==0)return Promise.resolve();const n=a.targetedAnimations[0],r=s.emitter,l=T.Get(`/extensions/${this.name}/emitters`,this._emitters,r);return this._loadEmitterAsync(t,l).then(()=>{const d=l._babylonData.sound;if(d){const u=new w(s.time,this._getEventAction(t,d,s.action,s.time,s.startOffset));n.animation.addEvent(u),a.onAnimationGroupEndObservable.add(()=>{d.stop()}),a.onAnimationGroupPauseObservable.add(()=>{d.pause()})}})}}z(k);q(k,!0,o=>new B(o));export{B as MSFT_audio_emitter}; diff --git a/assets/MSFT_lod-F-ajb3GE.js b/assets/MSFT_lod-F-ajb3GE.js deleted file mode 100644 index ca24c87c30ab412ec20ac7b97a336a7664e16037..0000000000000000000000000000000000000000 --- a/assets/MSFT_lod-F-ajb3GE.js +++ /dev/null @@ -1 +0,0 @@ -import{O as u,aM as f,aG as g,aH as p}from"./index-GY9JDBGV.js";import{GLTFLoader as c,ArrayItem as b}from"./glTFLoader-CdfQ_yvy.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const O="MSFT_lod";class x{constructor(e){this.name=O,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new u,this.onMaterialLODsLoadedObservable=new u,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.maxLODsToLoad=this._loader.parent.extensionOptions[O]?.maxLODsToLoad??this.maxLODsToLoad,this.enabled=this._loader.isExtensionUsed(O)}dispose(){this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()}onReady(){for(let e=0;e{e!==0&&(this._loader.endPerformanceCounter(`Node LOD ${e}`),this._loader.log(`Loaded node LOD ${e}`)),this.onNodeLODsLoadedObservable.notifyObservers(e),e!==this._nodePromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Node LOD ${e+1}`),this._loadBufferLOD(this._nodeBufferLODs,e+1),this._nodeSignalLODs[e]&&this._nodeSignalLODs[e].resolve())});this._loader._completePromises.push(i)}for(let e=0;e{e!==0&&(this._loader.endPerformanceCounter(`Material LOD ${e}`),this._loader.log(`Loaded material LOD ${e}`)),this.onMaterialLODsLoadedObservable.notifyObservers(e),e!==this._materialPromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Material LOD ${e+1}`),this._loadBufferLOD(this._materialBufferLODs,e+1),this._materialSignalLODs[e]&&this._materialSignalLODs[e].resolve())});this._loader._completePromises.push(i)}}loadSceneAsync(e,i){const s=this._loader.loadSceneAsync(e,i);return this._loadBufferLOD(this._bufferLODs,0),s}loadNodeAsync(e,i,s){return c.LoadExtensionAsync(e,i,this.name,async(t,o)=>{let n;const d=this._getLODs(t,i,this._loader.gltf.nodes,o.ids);this._loader.logOpen(`${t}`);for(let a=0;a{s(L),L.setEnabled(!1)},h=this._loader.loadNodeAsync(`/nodes/${l.index}`,l,r).then(L=>{if(a!==0){const _=d[a-1];_._babylonTransformNode&&(this._disposeTransformNode(_._babylonTransformNode),delete _._babylonTransformNode)}return L.setEnabled(!0),L});this._nodePromiseLODs[a]=this._nodePromiseLODs[a]||[],a===0?n=h:(this._nodeIndexLOD=null,this._nodePromiseLODs[a].push(h))}return this._loader.logClose(),await n})}_loadMaterialAsync(e,i,s,t,o){return this._nodeIndexLOD?null:c.LoadExtensionAsync(e,i,this.name,async(n,d)=>{let a;const l=this._getLODs(n,i,this._loader.gltf.materials,d.ids);this._loader.logOpen(`${n}`);for(let r=0;r{r===0&&o(_)}).then(_=>{if(r!==0){o(_);const m=l[r-1]._data;m[t]&&(this._disposeMaterials([m[t].babylonMaterial]),delete m[t])}return _});this._materialPromiseLODs[r]=this._materialPromiseLODs[r]||[],r===0?a=L:(this._materialIndexLOD=null,this._materialPromiseLODs[r].push(L))}return this._loader.logClose(),await a})}_loadUriAsync(e,i,s){if(this._nodeIndexLOD!==null){this._loader.log("deferred");const t=this._nodeIndexLOD-1;return this._nodeSignalLODs[t]=this._nodeSignalLODs[t]||new f,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then(async()=>await this._loader.loadUriAsync(e,i,s))}else if(this._materialIndexLOD!==null){this._loader.log("deferred");const t=this._materialIndexLOD-1;return this._materialSignalLODs[t]=this._materialSignalLODs[t]||new f,this._materialSignalLODs[t].promise.then(async()=>await this._loader.loadUriAsync(e,i,s))}return null}loadBufferAsync(e,i,s,t){if(this._loader.parent.useRangeRequests&&!i.uri){if(!this._loader.bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);const o=async(n,d)=>{const a=s,l=a+t-1;let r=n[d];return r?(r.start=Math.min(r.start,a),r.end=Math.max(r.end,l)):(r={start:a,end:l,loaded:new f},n[d]=r),await r.loaded.promise.then(h=>new Uint8Array(h.buffer,h.byteOffset+s-r.start,t))};return this._loader.log("deferred"),this._nodeIndexLOD!==null?o(this._nodeBufferLODs,this._nodeIndexLOD):this._materialIndexLOD!==null?o(this._materialBufferLODs,this._materialIndexLOD):o(this._bufferLODs,0)}return null}_loadBufferLOD(e,i){const s=e[i];s&&(this._loader.log(`Loading buffer range [${s.start}-${s.end}]`),this._loader.bin.readAsync(s.start,s.end-s.start+1).then(t=>{s.loaded.resolve(t)},t=>{s.loaded.reject(t)}))}_getLODs(e,i,s,t){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");const o=[];for(let n=t.length-1;n>=0;n--)if(o.push(b.Get(`${e}/ids/${t[n]}`,s,t[n])),o.length===this.maxLODsToLoad)return o;return o.push(i),o}_disposeTransformNode(e){const i=[],s=e.material;s&&i.push(s);for(const o of e.getChildMeshes())o.material&&i.push(o.material);e.dispose();const t=i.filter(o=>this._loader.babylonScene.meshes.every(n=>n.material!=o));this._disposeMaterials(t)}_disposeMaterials(e){const i={};for(const s of e){for(const t of s.getActiveTextures())i[t.uniqueId]=t;s.dispose()}for(const s in i)for(const t of this._loader.babylonScene.materials)t.hasTexture(i[s])&&delete i[s];for(const s in i)i[s].dispose()}}g(O);p(O,!0,D=>new x(D));export{x as MSFT_lod}; diff --git a/assets/MSFT_minecraftMesh-CrOa9bAI.js b/assets/MSFT_minecraftMesh-CrOa9bAI.js deleted file mode 100644 index e654a7ea4e376a92e6d78a556be2853e9d657033..0000000000000000000000000000000000000000 --- a/assets/MSFT_minecraftMesh-CrOa9bAI.js +++ /dev/null @@ -1 +0,0 @@ -import{GLTFLoader as a}from"./glTFLoader-CdfQ_yvy.js";import{aG as d,aH as h}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const t="MSFT_minecraftMesh";class m{constructor(r){this.name=t,this._loader=r,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,s,e){return a.LoadExtraAsync(r,s,this.name,async(o,n)=>{if(n){if(!this._loader._pbrMaterialImpl)throw new Error(`${o}: Material type not supported`);const p=this._loader.loadMaterialPropertiesAsync(r,s,e);return e.needAlphaBlending()&&(e.forceDepthWrite=!0,e.separateCullingPass=!0),e.backFaceCulling=e.forceDepthWrite,e.twoSidedLighting=!0,await p}})}}d(t);h(t,!0,i=>new m(i));export{m as MSFT_minecraftMesh}; diff --git a/assets/MSFT_sRGBFactors-qYiR2sYo.js b/assets/MSFT_sRGBFactors-qYiR2sYo.js deleted file mode 100644 index 8c56c992cb0573d386322df1fa548c874f78f199..0000000000000000000000000000000000000000 --- a/assets/MSFT_sRGBFactors-qYiR2sYo.js +++ /dev/null @@ -1 +0,0 @@ -import{GLTFLoader as p}from"./glTFLoader-CdfQ_yvy.js";import{aG as l,aH as d}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./bone-CnpD8dWY.js";import"./skeleton-CQeK9qOO.js";import"./rawTexture-BDsvmix4.js";import"./assetContainer-X8dc1NDD.js";import"./objectModelMapping-CpTIXcMS.js";const o="MSFT_sRGBFactors";class u{constructor(r){this.name=o,this._loader=r,this.enabled=this._loader.isExtensionUsed(o)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,a,t){return p.LoadExtraAsync(r,a,this.name,async(m,n)=>{if(n){const e=this._loader._getOrCreateMaterialAdapter(t),c=this._loader.loadMaterialPropertiesAsync(r,a,t),i=t.getScene().getEngine().useExactSrgbConversions;return e.baseColorTexture||e.baseColor.toLinearSpaceToRef(e.baseColor,i),e.specularColorTexture||e.specularColor.toLinearSpaceToRef(e.specularColor,i),await c}})}}l(o);d(o,!0,s=>new u(s));export{u as MSFT_sRGBFactors}; diff --git a/assets/MarkdownCode-BTj729_f.js b/assets/MarkdownCode-BTj729_f.js deleted file mode 100644 index 3b71b69ec9c84c3aea93d5cdee75f0a45c350201..0000000000000000000000000000000000000000 --- a/assets/MarkdownCode-BTj729_f.js +++ /dev/null @@ -1,66 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./katex-D20gp3Ba.css","./auto-render-NRfUkSas.js","./katex-XbL3y5x-.js","./mermaid.core-BcqUqpnI.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./step-B-Gbak1k.js","./dispatch-kxCwF96_.js","./select-BigU4G0v.js"])))=>i.map(i=>d[i]); -import{M as Ye,ac as Ke,t as Ve,a as je,O as We,R as Qe,Z as Je,a2 as et,Q as tt,T as nt,af as U,G as rt}from"./index-DydPgVMC.js";import{p as B,d as st,b as ut}from"./i18n-CPHyzK9b.js";import{h as it}from"./html-BZIV6tyB.js";import{p as K}from"./prism-python-BGiTAEDL.js";import{A as at}from"./index-B_pwUImq.js";function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let I=W();function _e(i){I=i}const Te=/[&<>"']/,ot=new RegExp(Te.source,"g"),ye=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,lt=new RegExp(ye.source,"g"),ct={"&":"&","<":"<",">":">",'"':""","'":"'"},ue=i=>ct[i];function A(i,e){if(e){if(Te.test(i))return i.replace(ot,ue)}else if(ye.test(i))return i.replace(lt,ue);return i}const pt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function dt(i){return i.replace(pt,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Dt=/(^|[^\[])\^/g;function f(i,e){let t=typeof i=="string"?i:i.source;e=e||"";const n={replace:(r,u)=>{let s=typeof u=="string"?u:u.source;return s=s.replace(Dt,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}function ie(i){try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}const v={exec:()=>null};function ae(i,e){const t=i.replace(/\|/g,(u,s,a)=>{let o=!1,c=s;for(;--c>=0&&a[c]==="\\";)o=!o;return o?"|":" |"}),n=t.split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length{const u=r.match(/^\s+/);if(u===null)return r;const[s]=u;return s.length>=n.length?r.slice(n.length):r}).join(` -`)}class Z{options;rules;lexer;constructor(e){this.options=e||I}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:H(n,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=ft(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const r=H(n,"#");(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` - $1`);n=H(n.replace(/^ *>[ \t]?/gm,""),` -`);const r=this.lexer.state.top;this.lexer.state.top=!0;const u=this.lexer.blockTokens(n);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:u,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,u={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",o="",c=!1;for(;e;){let l=!1;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let d=t[2].split(` -`,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),p=e.split(` -`,1)[0],D=0;this.options.pedantic?(D=2,o=d.trimStart()):(D=t[2].search(/[^ ]/),D=D>4?1:D,o=d.slice(D),D+=t[1].length);let m=!1;if(!d&&/^ *$/.test(p)&&(a+=p+` -`,e=e.substring(p.length+1),l=!0),!l){const y=new RegExp(`^ {0,${Math.min(3,D-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),k=new RegExp(`^ {0,${Math.min(3,D-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),S=new RegExp(`^ {0,${Math.min(3,D-1)}}(?:\`\`\`|~~~)`),L=new RegExp(`^ {0,${Math.min(3,D-1)}}#`);for(;e;){const N=e.split(` -`,1)[0];if(p=N,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),S.test(p)||L.test(p)||y.test(p)||k.test(e))break;if(p.search(/[^ ]/)>=D||!p.trim())o+=` -`+p.slice(D);else{if(m||d.search(/[^ ]/)>=4||S.test(d)||L.test(d)||k.test(d))break;o+=` -`+p}!m&&!p.trim()&&(m=!0),a+=N+` -`,e=e.substring(N.length+1),d=p.slice(D)}}u.loose||(c?u.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let E=null,x;this.options.gfm&&(E=/^\[[ xX]\] /.exec(o),E&&(x=E[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),u.items.push({type:"list_item",raw:a,task:!!E,checked:x,loose:!1,text:o,tokens:[]}),u.raw+=a}u.items[u.items.length-1].raw=a.trimEnd(),u.items[u.items.length-1].text=o.trimEnd(),u.raw=u.raw.trimEnd();for(let l=0;lD.type==="space"),p=d.length>0&&d.some(D=>/\n.*\n/.test(D.raw));u.loose=p}if(u.loose)for(let l=0;l$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:u}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=ae(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),u=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` -`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)/^ *-+: *$/.test(a)?s.align.push("right"):/^ *:-+: *$/.test(a)?s.align.push("center"):/^ *:-+ *$/.test(a)?s.align.push("left"):s.align.push(null);for(const a of n)s.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of u)s.rows.push(ae(a,s.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:A(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=H(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=ht(t[2],"()");if(s>-1){const o=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],u="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],u=s[3])}else u=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^$/.test(n)?r=r.slice(1):r=r.slice(1,-1)),oe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:u&&u.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(/\s+/g," "),u=t[r.toLowerCase()];if(!u){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return oe(n,u,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...r[0]].length-1;let a,o,c=s,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+l);const p=[...r[0]][0].length,D=e.slice(0,s+r.index+p+o);if(Math.min(s,o)%2){const E=D.slice(1,-1);return{type:"em",raw:D,text:E,tokens:this.lexer.inlineTokens(E)}}const m=D.slice(2,-2);return{type:"strong",raw:D,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const r=/[^ ]/.test(n),u=/^ /.test(n)&&/ $/.test(n);return r&&u&&(n=n.substring(1,n.length-1)),n=A(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=A(t[1]),r="mailto:"+n):(n=A(t[1]),r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=A(t[0]),r="mailto:"+n;else{let u;do u=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(u!==t[0]);n=A(t[0]),t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=A(t[0]),{type:"text",raw:t[0],text:n}}}}const gt=/^(?: *(?:\n|$))+/,Et=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Ft=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Se=/(?:[*+-]|\d{1,9}[.)])/,Be=f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Se).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Q=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mt=/^[^\n]+/,J=/(?!\s*\])(?:\\.|[^\[\]\\])+/,At=f(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",J).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kt=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Se).getRegex(),Y="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/|$))/,Ct=f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",ee).replace("tag",Y).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Re=f(Q).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y).getRegex(),wt=f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Re).getRegex(),te={blockquote:wt,code:Et,def:At,fences:Ft,heading:bt,hr:P,html:Ct,lheading:Be,list:kt,newline:gt,paragraph:Re,table:v,text:mt},le=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y).getRegex(),xt={...te,table:le,paragraph:f(Q).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",le).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y).getRegex()},_t={...te,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:v,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(Q).replace("hr",P).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Be).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ie=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oe=/^( {2,}|\\)\n(?!\s*$)/,yt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Rt=f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,M).getRegex(),It=f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,M).getRegex(),Ot=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,M).getRegex(),Lt=f(/\\([punct])/,"gu").replace(/punct/g,M).getRegex(),Nt=f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$t=f(ee).replace("(?:-->|$)","-->").getRegex(),vt=f("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",$t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),X=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zt=f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",X).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Le=f(/^!?\[(label)\]\[(ref)\]/).replace("label",X).replace("ref",J).getRegex(),Ne=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",J).getRegex(),Pt=f("reflink|nolink(?!\\()","g").replace("reflink",Le).replace("nolink",Ne).getRegex(),ne={_backpedal:v,anyPunctuation:Lt,autolink:Nt,blockSkip:Bt,br:Oe,code:Tt,del:v,emStrongLDelim:Rt,emStrongRDelimAst:It,emStrongRDelimUnd:Ot,escape:Ie,link:zt,nolink:Ne,punctuation:St,reflink:Le,reflinkSearch:Pt,tag:vt,text:yt,url:v},Mt={...ne,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",X).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X).getRegex()},j={...ne,escape:f(Ie).replace("])","~|])").getRegex(),url:f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\o+" ".repeat(c.length));let n,r,u,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` -`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` -`+n.raw,r.text+=` -`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` -`+n.raw,r.text+=` -`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(u=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const o=e.slice(1);let c;this.options.extensions.startBlock.forEach(l=>{c=l.call({lexer:this},o),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(u))){r=t[t.length-1],s&&r.type==="paragraph"?(r.raw+=` -`+n.raw,r.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=u.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=` -`+n.raw,r.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,u,s=e,a,o,c;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(c=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(l=>(n=l.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(u=e,this.options.extensions&&this.options.extensions.startInline){let l=1/0;const d=e.slice(1);let p;this.options.extensions.startInline.forEach(D=>{p=D.call({lexer:this},d),typeof p=="number"&&p>=0&&(l=Math.min(l,p))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(n=this.tokenizer.inlineText(u)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}}class z{options;constructor(e){this.options=e||I}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+` -`,r?'
                '+(n?e:A(e,!0))+`
                -`:"
                "+(n?e:A(e,!0))+`
                -`}blockquote(e){return`
                -${e}
                -`}html(e,t){return e}heading(e,t,n){return`${e} -`}hr(){return`
                -`}list(e,t,n){const r=t?"ol":"ul",u=t&&n!==1?' start="'+n+'"':"";return"<"+r+u+`> -`+e+" -`}listitem(e,t,n){return`
              • ${e}
              • -`}checkbox(e){return"'}paragraph(e){return`

                ${e}

                -`}table(e,t){return t&&(t=`${t}`),` - -`+e+` -`+t+`
                -`}tablerow(e){return` -${e} -`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` -`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
                "}del(e){return`${e}`}link(e,t,n){const r=ie(e);if(r===null)return n;e=r;let u='
                ",u}image(e,t,n){const r=ie(e);if(r===null)return n;e=r;let u=`${n}0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=x+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=x+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:x+" "}):E+=x+" "}E+=this.parse(p.tokens,c),l+=this.renderer.listitem(E,m,!!D)}n+=this.renderer.list(l,a,o);continue}case"html":{const s=u;n+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=u;n+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=u,a=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1{const a=u[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):u.tokens&&(n=n.concat(this.walkTokens(u.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(u=>{if(!u.name)throw new Error("extension name required");if("renderer"in u){const s=t.renderers[u.name];s?t.renderers[u.name]=function(...a){let o=u.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[u.name]=u.renderer}if("tokenizer"in u){if(!u.level||u.level!=="block"&&u.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=t[u.level];s?s.unshift(u.tokenizer):t[u.level]=[u.tokenizer],u.start&&(u.level==="block"?t.startBlock?t.startBlock.push(u.start):t.startBlock=[u.start]:u.level==="inline"&&(t.startInline?t.startInline.push(u.start):t.startInline=[u.start]))}"childTokens"in u&&u.childTokens&&(t.childTokens[u.name]=u.childTokens)}),r.extensions=t),n.renderer){const u=this.defaults.renderer||new z(this.defaults);for(const s in n.renderer){if(!(s in u))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const a=s,o=n.renderer[a],c=u[a];u[a]=(...l)=>{let d=o.apply(u,l);return d===!1&&(d=c.apply(u,l)),d||""}}r.renderer=u}if(n.tokenizer){const u=this.defaults.tokenizer||new Z(this.defaults);for(const s in n.tokenizer){if(!(s in u))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=s,o=n.tokenizer[a],c=u[a];u[a]=(...l)=>{let d=o.apply(u,l);return d===!1&&(d=c.apply(u,l)),d}}r.tokenizer=u}if(n.hooks){const u=this.defaults.hooks||new q;for(const s in n.hooks){if(!(s in u))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const a=s,o=n.hooks[a],c=u[a];q.passThroughHooks.has(s)?u[a]=l=>{if(this.defaults.async)return Promise.resolve(o.call(u,l)).then(p=>c.call(u,p));const d=o.call(u,l);return c.call(u,d)}:u[a]=(...l)=>{let d=o.apply(u,l);return d===!1&&(d=c.apply(u,l)),d}}r.hooks=u}if(n.walkTokens){const u=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),u&&(o=o.concat(u.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _.lex(e,t??this.defaults)}parser(e,t){return T.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const u={...r},s={...this.defaults,...u};this.defaults.async===!0&&u.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const a=this.#t(!!s.silent,!!s.async);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(o=>e(o,s)).then(o=>s.hooks?s.hooks.processAllTokens(o):o).then(o=>s.walkTokens?Promise.all(this.walkTokens(o,s.walkTokens)).then(()=>o):o).then(o=>t(o,s)).then(o=>s.hooks?s.hooks.postprocess(o):o).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let o=e(n,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let c=t(o,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}#t(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const r="

                An error occurred:

                "+A(n.message+"",!0)+"
                ";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}const R=new $e;function h(i,e){return R.parse(i,e)}h.options=h.setOptions=function(i){return R.setOptions(i),h.defaults=R.defaults,_e(h.defaults),h};h.getDefaults=W;h.defaults=I;h.use=function(...i){return R.use(...i),h.defaults=R.defaults,_e(h.defaults),h};h.walkTokens=function(i,e){return R.walkTokens(i,e)};h.parseInline=R.parseInline;h.Parser=T;h.parser=T.parse;h.Renderer=z;h.TextRenderer=re;h.Lexer=_;h.lexer=_.lex;h.Tokenizer=Z;h.Hooks=q;h.parse=h;h.options;h.setOptions;h.use;h.walkTokens;h.parseInline;T.parse;_.lex;function Ht(i){if(typeof i=="function"&&(i={highlight:i}),!i||typeof i.highlight!="function")throw new Error("Must provide highlight function");return typeof i.langPrefix!="string"&&(i.langPrefix="language-"),typeof i.emptyLangClass!="string"&&(i.emptyLangClass=""),{async:!!i.async,walkTokens(e){if(e.type!=="code")return;const t=ce(e.lang);if(i.async)return Promise.resolve(i.highlight(e.text,t,e.lang||"")).then(pe(e));const n=i.highlight(e.text,t,e.lang||"");if(n instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");pe(e)(n)},useNewRenderer:!0,renderer:{code(e,t,n){typeof e=="object"&&(n=e.escaped,t=e.lang,e=e.text);const r=ce(t),u=r?i.langPrefix+De(r):i.emptyLangClass,s=u?` class="${u}"`:"";return e=e.replace(/\n$/,""),`
                ${n?e:De(e,!0)}
                -
                `}}}}function ce(i){return(i||"").match(/\S*/)[0]}function pe(i){return e=>{typeof e=="string"&&e!==i.text&&(i.escaped=!0,i.text=e)}}const ve=/[&<>"']/,Gt=new RegExp(ve.source,"g"),ze=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,qt=new RegExp(ze.source,"g"),Zt={"&":"&","<":"<",">":">",'"':""","'":"'"},de=i=>Zt[i];function De(i,e){if(e){if(ve.test(i))return i.replace(Gt,de)}else if(ze.test(i))return i.replace(qt,de);return i}const Xt=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,Yt=Object.hasOwnProperty;class se{constructor(){this.occurrences,this.reset()}slug(e,t){const n=this;let r=Kt(e,t===!0);const u=r;for(;Yt.call(n.occurrences,r);)n.occurrences[u]++,r=u+"-"+n.occurrences[u];return n.occurrences[r]=0,r}reset(){this.occurrences=Object.create(null)}}function Kt(i,e){return typeof i!="string"?"":(e||(i=i.toLowerCase()),i.replace(Xt,"").replace(/ /g,"-"))}let Pe=new se,Me=[];function Vt({prefix:i="",globalSlugs:e=!1}={}){return{headerIds:!1,hooks:{preprocess(t){return e||jt(),t}},renderer:{heading(t,n,r){r=r.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"");const u=`${i}${Pe.slug(r)}`,s={level:n,text:t,id:u};return Me.push(s),`${t} -`}}}}function jt(){Me=[],Pe=new se}(function(i){var e=/\\(?:[^a-z()[\]]|[a-z*]+)/i,t={"equation-command":{pattern:e,alias:"regex"}};i.languages.latex={comment:/%.*/,cdata:{pattern:/(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:t,alias:"string"},{pattern:/(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:t,alias:"string"}],keyword:{pattern:/(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:e,alias:"selector"},punctuation:/[[\]{}&]/},i.languages.tex=i.languages.latex,i.languages.context=i.languages.latex})(Prism);(function(i){var e="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",t={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:t,environment:{pattern:RegExp("\\$"+e),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+e),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};i.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+e),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:t}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},t.inside=i.languages.bash;for(var r=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=n.variable[1].inside,s=0;s>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;var he={},fe;function Wt(){return fe||(fe=1,(function(i){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return e.source});i.languages.cpp=i.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),i.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),i.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:i.languages.cpp}}}}),i.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),i.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:i.languages.extend("cpp",{})}}),i.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},i.languages.cpp["base-clause"])})(Prism)),he}Wt();Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};var ge={},Ee;function Qt(){return Ee||(Ee=1,(function(i){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};i.languages.java=i.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[n,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:n.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:n.inside}],keyword:e,function:[i.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),i.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),i.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:n.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:n.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),ge}Qt();Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var Fe={},be;function Jt(){return be||(be=1,(function(i){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,t=0;t<2;t++)e=e.replace(//g,function(){return e});e=e.replace(//g,function(){return/[^\s\S]/.source}),i.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},i.languages.rust["closure-params"].inside.rest=i.languages.rust,i.languages.rust.attribute.inside.string=i.languages.rust.string})(Prism)),Fe}Jt();var me={},Ae;function en(){return Ae||(Ae=1,(function(i){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],n=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;i.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:n,operator:r,punctuation:u};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:i.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];i.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:e,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:n,operator:r,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),i.hooks.add("before-tokenize",function(o){if(/<\?/.test(o.code)){var c=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;i.languages["markup-templating"].buildPlaceholders(o,"php",c)}}),i.hooks.add("after-tokenize",function(o){i.languages["markup-templating"].tokenizePlaceholders(o,"php")})})(Prism)),me}en();(function(i){var e=/[*&][^\s[\]{},]+/,t=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+t.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+t.source+")?)",r=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,o){o=(o||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return n}).replace(/<>/g,function(){return a});return RegExp(c,o)}i.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return n})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return n}).replace(/<>/g,function(){return"(?:"+r+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(u),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:t,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},i.languages.yml=i.languages.yaml})(Prism);(function(i){function e(t,n){return"___"+t.toUpperCase()+n+"___"}Object.defineProperties(i.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,n,r,u){if(t.language===n){var s=t.tokenStack=[];t.code=t.code.replace(r,function(a){if(typeof u=="function"&&!u(a))return a;for(var o=s.length,c;t.code.indexOf(c=e(n,o))!==-1;)++o;return s[o]=a,c}),t.grammar=i.languages.markup}}},tokenizePlaceholders:{value:function(t,n){if(t.language!==n||!t.tokenStack)return;t.grammar=i.languages[n];var r=0,u=Object.keys(t.tokenStack);function s(a){for(var o=0;o=u.length);o++){var c=a[o];if(typeof c=="string"||c.content&&typeof c.content=="string"){var l=u[r],d=t.tokenStack[l],p=typeof c=="string"?c:c.content,D=e(n,l),m=p.indexOf(D);if(m>-1){++r;var E=p.substring(0,m),x=new i.Token(n,i.tokenize(d,t.grammar),"language-"+n,d),y=p.substring(m+D.length),k=[];E&&k.push.apply(k,s([E])),k.push(x),y&&k.push.apply(k,s([y])),typeof c=="string"?a.splice.apply(a,[o,1].concat(k)):c.content=k}}else c.content&&s(c.content)}return a}s(t.tokens)}}})})(Prism);const tn='',nn=` - - -`,rn=` -`,ke=``,sn=new z;function un(i){const e=i.trim();return e!==""&&!e.startsWith("#")}const Ue=/[&<>"']/,an=new RegExp(Ue.source,"g"),He=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,on=new RegExp(He.source,"g"),ln={"&":"&","<":"<",">":">",'"':""","'":"'"},Ce=i=>ln[i]||"";function V(i,e){if(e){if(Ue.test(i))return i.replace(an,Ce)}else if(He.test(i))return i.replace(on,Ce);return i}function cn(i){const e=i.map(t=>({start:new RegExp(t.left.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")),end:new RegExp(t.right.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))}));return{name:"latex",level:"block",start(t){for(const n of e){const r=t.match(n.start);if(r)return r.index}return-1},tokenizer(t,n){for(const r of e){const u=new RegExp(`${r.start.source}([\\s\\S]+?)${r.end.source}`).exec(t);if(u)return{type:"latex",raw:u[0],text:u[1].trim()}}},renderer(t){return`
                ${t.text}
                `}}}function pn(){return{name:"mermaid",level:"block",start(i){return i.match(/^```mermaid\s*\n/)?.index},tokenizer(i){const e=/^```mermaid\s*\n([\s\S]*?)```\s*(?:\n|$)/.exec(i);if(e)return{type:"mermaid",raw:e[0],text:e[1].trim()}},renderer(i){return`
                ${i.text}
                -`}}}const dn={code(i,e,t){const n=(e??"").match(/\S*/)?.[0]??"";return i=i.replace(/\n$/,"")+` -`,!n||n==="mermaid"?'
                '+ke+"
                "+(t?i:V(i,!0))+`
                -`:'
                '+ke+'
                '+(t?i:V(i,!0))+`
                -`},link(i,e,t){const n=sn.link(i,e,t);return!un(i)||!n.startsWith("
                K.languages?.[a]?K.highlight(s,K.languages[a],a):s}),{renderer:dn}),i&&(n.use(Vt()),n.use({extensions:[{name:"heading",level:"block",renderer(s){const a=s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,""),o="h"+Dn.slug(a),c=s.depth,l=this.parser.parseInline(s.tokens);return`${tn}${l} -`}}]}));const r=pn(),u=cn(t);return n.use({extensions:[r,u]}),n}const fn=i=>{const e=i?.trim();return!!e&&!e.startsWith("#")};function we(i){const e=new at,t=new DOMParser().parseFromString(i,"text/html"),n=e.sanitize(t);return Ge(n.body,"A",r=>{r instanceof HTMLElement&&"target"in r&&fn(r.getAttribute("href"))&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer"))}),n.body.innerHTML}function Ge(i,e,t){i&&(i.nodeName===e||typeof e=="function")&&t(i);const n=i?.childNodes||[];for(let r=0;r!xe.includes(i))];var Fn=Qe("");function xn(i,e){Ye(e,!0);let t=B(e,"chatbot",3,!0),n=B(e,"sanitize_html",3,!0),r=B(e,"latex_delimiters",19,()=>[]),u=B(e,"render_markdown",3,!0),s=B(e,"line_breaks",3,!0),a=B(e,"header_links",3,!1),o=B(e,"allow_tags",3,!1),c=B(e,"theme_mode",3,"system"),l;const d=hn({header_links:a(),line_breaks:s(),latex_delimiters:r()||[]});let p=et(()=>e.message&&e.message.trim()?y(e.message):""),D=!1;function m(b){return!r()||r().length===0?!1:r().some(g=>b.includes(g.left)&&b.includes(g.right))}function E(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(b,g){if(g===!0){const C=/<\/?([a-zA-Z][a-zA-Z0-9-]*)([\s>])/g;return b.replace(C,(F,w,O)=>En.includes(w.toLowerCase())?F:F.replace(//g,">"))}if(Array.isArray(g)){const C=g.map(w=>({open:new RegExp(`<(${w})(\\s+[^>]*)?>`,"gi"),close:new RegExp(``,"gi")}));let F=b;return C.forEach(w=>{F=F.replace(w.open,O=>O.replace(//g,">")),F=F.replace(w.close,O=>O.replace(//g,">"))}),F}return b}function y(b){let g=b;if(u()){const C=[];r().forEach((F,w)=>{const O=E(F.left),qe=E(F.right),Ze=new RegExp(`${O}([\\s\\S]+?)${qe}`,"g");g=g.replace(Ze,(Xe,bn)=>(C.push(Xe),`%%%LATEX_BLOCK_${C.length-1}%%%`))}),g=d.parse(g),g=g.replace(/%%%LATEX_BLOCK_(\d+)%%%/g,(F,w)=>C[parseInt(w,10)])}return o()&&(g=x(g,o())),n()&&we&&(g=we(g)),g}async function k(b){if(r().length>0&&b&&m(b))if(!D)await Promise.all([U(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url),U(()=>import("./auto-render-NRfUkSas.js"),__vite__mapDeps([1,2]),import.meta.url)]).then(([,{default:g}])=>{D=!0,g(l,{delimiters:r(),throwOnError:!1})});else{const{default:g}=await U(async()=>{const{default:C}=await import("./auto-render-NRfUkSas.js");return{default:C}},__vite__mapDeps([1,2]),import.meta.url);g(l,{delimiters:r(),throwOnError:!1})}if(l){const g=l.querySelectorAll(".mermaid");if(g.length>0){await rt();const{default:C}=await U(async()=>{const{default:F}=await import("./mermaid.core-BcqUqpnI.js").then(w=>w.b5);return{default:F}},__vite__mapDeps([3,4,5,6,7,8,9,10]),import.meta.url);C.initialize({startOnLoad:!1,theme:c()==="dark"?"dark":"default",securityLevel:"antiscript"}),await C.run({nodes:Array.from(g).map(F=>F)})}}}Ke(()=>{l&&document.body.contains(l)?k(e.message).then(()=>e.onload?.()):console.error("Element is not in the DOM")});var S=Fn();let L;var N=tt(S);it(N,()=>Je(p)),nt(S),st(S,b=>l=b,()=>l),Ve(()=>L=ut(S,1,"md svelte-1r2inw1",null,L,{chatbot:t(),prose:u()})),je(i,S),We()}export{xn as M}; diff --git a/assets/MatplotlibPlot-3NvwORNR.js b/assets/MatplotlibPlot-3NvwORNR.js deleted file mode 100644 index c9a076c22a9671d60b417d3178a65ddf95dbf562..0000000000000000000000000000000000000000 --- a/assets/MatplotlibPlot-3NvwORNR.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e}from"./i18n-CPHyzK9b.js";import{M as o,t as r,a as d,O as m,R as v,Z as p,a2 as u,Q as f,T as c}from"./index-DydPgVMC.js";var n=v('
                ');function h(s,a){o(a,!0);let i=u(()=>a.value?.plot);var t=n();e(t,"data-testid","matplotlib");var l=f(t);c(t),r(()=>{e(l,"src",p(i)),e(l,"alt",`${a.value.chart} plot visualising provided data`)}),d(s,t),m()}export{h as default}; diff --git a/assets/Maximize-DWbY8BRa.js b/assets/Maximize-DWbY8BRa.js deleted file mode 100644 index 28788684ebb9f75664fc1aceffd8a52330d4312b..0000000000000000000000000000000000000000 --- a/assets/Maximize-DWbY8BRa.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a,f as t}from"./index-DydPgVMC.js";var e=t('');function h(o){var r=e();a(o,r)}export{h as M}; diff --git a/assets/MinimalAudioPlayer-C59qi7fl.js b/assets/MinimalAudioPlayer-C59qi7fl.js deleted file mode 100644 index 68d9468531a4ec500f95ae97f40cf2d83584b620..0000000000000000000000000000000000000000 --- a/assets/MinimalAudioPlayer-C59qi7fl.js +++ /dev/null @@ -1,73 +0,0 @@ -import{p as X,i as $,d as q,M as Y,a as _}from"./i18n-CPHyzK9b.js";import{ah as Z,M as Q,a7 as J,ae as K,Q as N,Z as x,T as I,S as F,t as tt,X as et,a as B,O as it,aa as W,$ as R,R as st,a2 as nt,f as V}from"./index-DydPgVMC.js";function C(c,t,e,i){return new(e||(e=Promise))((function(s,n){function r(l){try{h(i.next(l))}catch(a){n(a)}}function o(l){try{h(i.throw(l))}catch(a){n(a)}}function h(l){var a;l.done?s(l.value):(a=l.value,a instanceof e?a:new e((function(p){p(a)}))).then(r,o)}h((i=i.apply(c,t||[])).next())}))}class A{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),i?.once){const s=(...n)=>{this.un(t,s),e(...n)};return this.listeners[t].add(s),()=>this.un(t,s)}return this.listeners[t].add(e),()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach((i=>i(...e)))}}const L={decode:function(c,t){return C(this,void 0,void 0,(function*(){const e=new AudioContext({sampleRate:t});try{return yield e.decodeAudioData(c)}finally{e.close()}}))},createBuffer:function(c,t){if(!c||c.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof c[0]=="number"&&(c=[c]),!c[0]||c[0].length===0)throw new Error("channelData must contain non-empty channel arrays");return(function(e){const i=e[0];if(i.some((s=>s>1||s<-1))){const s=i.length;let n=0;for(let r=0;rn&&(n=o)}for(const r of e)for(let o=0;oc?.[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function G(c,t){const e=t.xmlns?document.createElementNS(t.xmlns,c):document.createElement(c);for(const[i,s]of Object.entries(t))if(i==="children"&&s)for(const[n,r]of Object.entries(s))r instanceof Node?e.appendChild(r):typeof r=="string"?e.appendChild(document.createTextNode(r)):e.appendChild(G(n,r));else i==="style"?Object.assign(e.style,s):i==="textContent"?e.textContent=s:e.setAttribute(i,s.toString());return e}function H(c,t,e){const i=G(c,t||{});return e?.appendChild(i),i}var rt=Object.freeze({__proto__:null,createElement:H,default:H});const ot={fetchBlob:function(c,t,e){return C(this,void 0,void 0,(function*(){const i=yield fetch(c,e);if(i.status>=400)throw new Error(`Failed to fetch ${c}: ${i.status} (${i.statusText})`);return(function(s,n){C(this,void 0,void 0,(function*(){if(!s.body||!s.headers)return;const r=s.body.getReader(),o=Number(s.headers.get("Content-Length"))||0;let h=0,l=0;const a=d=>C(this,void 0,void 0,(function*(){h+=d?.length||0;const u=Math.round(h/o*100);n(u)})),p=()=>C(this,void 0,void 0,(function*(){if(l++>1e5)return void console.error("Fetcher: Maximum iterations reached, stopping read loop");let d;try{d=yield r.read()}catch{return}d.done||(a(d.value),yield p())}));p()}))})(i.clone(),t),i.blob()}))}};class at extends A{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",(()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)}),{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const s=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),s||t)try{this.media.src=s}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return C(this,void 0,void 0,(function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class T extends A{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[s,n]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),s=e.clientX-i.left,n=e.clientY-i.top;return[s/i.width,n/i.height]};if(this.wrapper.addEventListener("click",(e=>{const[i,s]=t(e);this.emit("click",i,s)})),this.wrapper.addEventListener("dblclick",(e=>{const[i,s]=t(e);this.emit("dblclick",i,s)})),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",(()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:s}=this.scrollContainer,n=e/i,r=(e+s)/i;this.emit("scroll",n,r,e,e+s)})),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{e().then((()=>this.onContainerResize())).catch((()=>{}))})),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=(function(t,e,i,s,n=3,r=0,o=100){if(!t)return()=>{};const h=matchMedia("(pointer: coarse)").matches;let l=()=>{};const a=p=>{if(p.button!==r)return;p.preventDefault(),p.stopPropagation();let d=p.clientX,u=p.clientY,f=!1;const w=Date.now(),v=m=>{if(m.preventDefault(),m.stopPropagation(),h&&Date.now()-wn||Math.abs(D)>n){const k=t.getBoundingClientRect(),{left:z,top:j}=k;f||(i?.(d-z,u-j),f=!0),e(P,D,E-z,M-j),d=E,u=M}},b=m=>{if(f){const E=m.clientX,M=m.clientY,P=t.getBoundingClientRect(),{left:D,top:k}=P;s?.(E-D,M-k)}l()},y=m=>{m.relatedTarget&&m.relatedTarget!==document.documentElement||b(m)},S=m=>{f&&(m.stopPropagation(),m.preventDefault())},g=m=>{f&&m.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",b),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("click",S,{capture:!0}),l=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",b),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",g),setTimeout((()=>{document.removeEventListener("click",S,{capture:!0})}),10)}};return t.addEventListener("pointerdown",a),()=>{l(),t.removeEventListener("pointerdown",a)}})(this.wrapper,((t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))}),(t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}),(t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))})),this.subscriptions.push(this.dragUnsubscribe))}getHeight(t,e){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const n=this.parent.clientHeight||128;return e?.every((r=>!r.overlay))?n/s:n}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=` - - :host { - user-select: none; - min-width: 1px; - } - :host audio { - display: block; - width: 100%; - } - :host .scroll { - overflow-x: auto; - overflow-y: hidden; - width: 100%; - position: relative; - } - :host .noScrollbar { - scrollbar-color: transparent; - scrollbar-width: none; - } - :host .noScrollbar::-webkit-scrollbar { - display: none; - -webkit-appearance: none; - } - :host .wrapper { - position: relative; - overflow: visible; - z-index: 2; - } - :host .canvases { - min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px; - } - :host .canvases > div { - position: relative; - } - :host canvas { - display: block; - position: absolute; - top: 0; - image-rendering: pixelated; - } - :host .progress { - pointer-events: none; - position: absolute; - z-index: 2; - top: 0; - left: 0; - width: 0; - height: 100%; - overflow: hidden; - } - :host .progress > div { - position: relative; - } - :host .cursor { - pointer-events: none; - position: absolute; - z-index: 5; - top: 0; - left: 0; - height: 100%; - border-radius: 2px; - } - - -
                -
                -
                -
                -
                -
                -
                - `,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,i=e*t;this.setScroll(i)}destroy(){var t;this.subscriptions.forEach((e=>e())),this.container.remove(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),(t=this.unsubscribeOnScroll)===null||t===void 0||t.forEach((e=>e())),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,i;const s=()=>{e&&(clearTimeout(e),e=void 0),i&&(i(),i=void 0)};return this.timeouts.push(s),()=>new Promise(((n,r)=>{s(),i=r,e=setTimeout((()=>{e=void 0,i=void 0,n()}),t)}))}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length===0)return"#999";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),i=e.getContext("2d"),s=e.height*(window.devicePixelRatio||1),n=i.createLinearGradient(0,0,0,s),r=1/(t.length-1);return t.forEach(((o,h)=>{const l=h*r;n.addColorStop(l,o)})),n}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,i,s){const n=t[0],r=t[1]||t[0],o=n.length,{width:h,height:l}=i.canvas,a=l/2,p=this.getPixelRatio(),d=e.barWidth?e.barWidth*p:1,u=e.barGap?e.barGap*p:e.barWidth?d/2:0,f=e.barRadius||0,w=h/(d+u)/o,v=f&&"roundRect"in i?"roundRect":"rect";i.beginPath();let b=0,y=0,S=0;for(let g=0;g<=o;g++){const m=Math.round(g*w);if(m>b){const P=Math.round(y*a*s),D=P+Math.round(S*a*s)||1;let k=a-P;e.barAlign==="top"?k=0:e.barAlign==="bottom"&&(k=l-D),i[v](b*(d+u),k,d,D,f),b=m,y=0,S=0}const E=Math.abs(n[g]||0),M=Math.abs(r[g]||0);E>y&&(y=E),M>S&&(S=M)}i.fill(),i.closePath()}renderLineWaveform(t,e,i,s){const n=r=>{const o=t[r]||t[0],h=o.length,{height:l}=i.canvas,a=l/2,p=i.canvas.width/h;i.moveTo(0,a);let d=0,u=0;for(let f=0;f<=h;f++){const w=Math.round(f*p);if(w>d){const b=a+(Math.round(u*a*s)||1)*(r===0?-1:1);i.lineTo(d,b),d=w,u=0}const v=Math.abs(o[f]||0);v>u&&(u=v)}i.lineTo(d,a)};i.beginPath(),n(0),n(1),i.fill(),i.closePath()}renderWaveform(t,e,i){if(i.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,i);let s=e.barHeight||1;if(e.normalize){const n=Array.from(t[0]).reduce(((r,o)=>Math.max(r,Math.abs(o))),0);s=n?s/n:s}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,i,s):this.renderLineWaveform(t,e,i,s)}renderSingleCanvas(t,e,i,s,n,r,o){const h=this.getPixelRatio(),l=document.createElement("canvas");l.width=Math.round(i*h),l.height=Math.round(s*h),l.style.width=`${i}px`,l.style.height=`${s}px`,l.style.left=`${Math.round(n)}px`,r.appendChild(l);const a=l.getContext("2d");if(this.renderWaveform(t,e,a),l.width>0&&l.height>0){const p=l.cloneNode(),d=p.getContext("2d");d.drawImage(l,0,0),d.globalCompositeOperation="source-in",d.fillStyle=this.convertColorValues(e.progressColor),d.fillRect(0,0,l.width,l.height),o.appendChild(p)}}renderMultiCanvas(t,e,i,s,n,r){const o=this.getPixelRatio(),{clientWidth:h}=this.scrollContainer,l=i/o;let a=Math.min(T.MAX_CANVAS_WIDTH,h,l),p={};if(e.barWidth||e.barGap){const v=e.barWidth||.5,b=v+(e.barGap||v/2);a%b!=0&&(a=Math.floor(a/b)*b)}if(a===0)return;const d=v=>{if(v<0||v>=u||p[v])return;p[v]=!0;const b=v*a;let y=Math.min(l-b,a);if(e.barWidth||e.barGap){const g=e.barWidth||.5,m=g+(e.barGap||g/2);y=Math.floor(y/m)*m}if(y<=0)return;const S=t.map((g=>{const m=Math.floor(b/l*g.length),E=Math.floor((b+y)/l*g.length);return g.slice(m,E)}));this.renderSingleCanvas(S,e,y,s,b,n,r)},u=Math.ceil(l/a);if(!this.isScrollable){for(let v=0;v1){const v=this.on("scroll",(()=>{const{scrollLeft:b}=this.scrollContainer,y=Math.floor(b/l*u);Object.keys(p).length>T.MAX_NODES&&(n.innerHTML="",r.innerHTML="",p={}),d(y-1),d(y),d(y+1)}));this.unsubscribeOnScroll.push(v)}}renderChannel(t,e,i,s){var{overlay:n}=e,r=(function(a,p){var d={};for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&p.indexOf(u)<0&&(d[u]=a[u]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(u=Object.getOwnPropertySymbols(a);f0&&(o.style.marginTop=`-${h}px`),this.canvasWrapper.style.minHeight=`${h}px`,this.canvasWrapper.appendChild(o);const l=o.cloneNode();this.progressWrapper.appendChild(l),this.renderMultiCanvas(t,r,i,h,o,l)}render(t){return C(this,void 0,void 0,(function*(){var e;this.timeouts.forEach((h=>h())),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const i=this.getPixelRatio(),s=this.scrollContainer.clientWidth,n=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=n>s;const r=this.options.fillParent&&!this.isScrollable,o=(r?s:n)*i;if(this.wrapper.style.width=r?"100%":`${n}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let h=0;h1&&h.push(t.getChannelData(1)),this.renderChannel(h,this.options,o,0)}Promise.resolve().then((()=>this.emit("rendered")))}))}reRender(){if(this.unsubscribeOnScroll.forEach((i=>i())),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let s=i-e;s*=2,s=s<0?Math.floor(s):Math.ceil(s),s/=2,this.scrollContainer.scrollLeft+=s}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:i,scrollWidth:s,clientWidth:n}=this.scrollContainer,r=t*s,o=i,h=i+n,l=n/2;if(this.isDragging)r+30>h?this.scrollContainer.scrollLeft+=30:r-30h)&&(this.scrollContainer.scrollLeft=r-(this.options.autoCenter?l:0));const a=r-i-l;e&&this.options.autoCenter&&a>0&&(this.scrollContainer.scrollLeft+=Math.min(a,10))}{const a=this.scrollContainer.scrollLeft,p=a/s,d=(a+n)/s;this.emit("scroll",p,d,a,a+n)}}renderProgress(t,e){if(isNaN(t))return;const i=100*t;this.canvasWrapper.style.clipPath=`polygon(${i}% 0%, 100% 0%, 100% 100%, ${i}% 100%)`,this.progressWrapper.style.width=`${i}%`,this.cursor.style.left=`${i}%`,this.cursor.style.transform=this.options.cursorWidth?`translateX(-${t*this.options.cursorWidth}px)`:"",this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,i){return C(this,void 0,void 0,(function*(){const s=this.canvasWrapper.querySelectorAll("canvas");if(!s.length)throw new Error("No waveform data");if(i==="dataURL"){const n=Array.from(s).map((r=>r.toDataURL(t,e)));return Promise.resolve(n)}return Promise.all(Array.from(s).map((n=>new Promise(((r,o)=>{n.toBlob((h=>{h?r(h):o(new Error("Could not export image"))}),t,e)})))))}))}}T.MAX_CANVAS_WIDTH=8e3,T.MAX_NODES=10;class lt extends A{constructor(){super(...arguments),this.animationFrameId=null,this.isRunning=!1}start(){if(this.isRunning)return;this.isRunning=!0;const t=()=>{this.isRunning&&(this.emit("tick"),this.animationFrameId=requestAnimationFrame(t))};t()}stop(){this.isRunning=!1,this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stop()}}class U extends A{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return C(this,void 0,void 0,(function*(){}))}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()})).then((e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e))).then((e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())}))}_play(){if(!this.paused)return;this.paused=!1,this.bufferNode&&(this.bufferNode.onended=null,this.bufferNode.disconnect()),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;(t>=this.duration||t<0)&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return C(this,void 0,void 0,(function*(){this.paused&&(this._play(),this.emit("play"))}))}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,i=this.bufferNode;i?.stop(this.audioContext.currentTime+e),i?.addEventListener("ended",(()=>{i===this.bufferNode&&(this.bufferNode=null,this.pause())}),{once:!0})}setSinkId(t){return C(this,void 0,void 0,(function*(){return this.audioContext.setSinkId(t)}))}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let i=0;i{this.emit("init");const{peaks:n,duration:r}=this.options;(s||n&&r)&&this.load(s,n,r).catch((o=>{console.error("WaveSurfer initial load error:",o)}))}))}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",(()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}})))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",(()=>{const t=this.updateProgress();this.emit("timeupdate",t)})),this.onMediaEvent("play",(()=>{this.emit("play"),this.timer.start()})),this.onMediaEvent("pause",(()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null})),this.onMediaEvent("emptied",(()=>{this.timer.stop(),this.stopAtPosition=null})),this.onMediaEvent("ended",(()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null})),this.onMediaEvent("seeking",(()=>{this.emit("seeking",this.getCurrentTime())})),this.onMediaEvent("error",(()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null})))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",((t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))})),this.renderer.on("dblclick",((t,e)=>{this.emit("dblclick",t,e)})),this.renderer.on("scroll",((t,e,i,s)=>{const n=this.getDuration();this.emit("scroll",t*n,e*n,i,s)})),this.renderer.on("render",(()=>{this.emit("redraw")})),this.renderer.on("rendered",(()=>{this.emit("redrawcomplete")})),this.renderer.on("dragstart",(t=>{this.emit("dragstart",t)})),this.renderer.on("dragend",(t=>{this.emit("dragend",t)})));{let t;const e=this.renderer.on("drag",(i=>{if(!this.options.interact)return;let s;this.renderer.renderProgress(i),clearTimeout(t),this.isPlaying()?s=0:this.options.dragToSeek===!0?s=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(s=this.options.dragToSeek.debounceTime),t=setTimeout((()=>{this.seekTo(i)}),s),this.emit("interaction",i*this.getDuration()),this.emit("drag",i)}));this.subscriptions.push((()=>{clearTimeout(t),e()}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach((e=>{this.registerPlugin(e)}))}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach((t=>t())),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=L.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=L.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){if(this.plugins.includes(t))return t;t._init(this),this.plugins.push(t);const e=t.once("destroy",(()=>{this.plugins=this.plugins.filter((i=>i!==t)),this.subscriptions=this.subscriptions.filter((i=>i!==e))}));return this.subscriptions.push(e),t}unregisterPlugin(t){this.plugins=this.plugins.filter((e=>e!==t)),t.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,i,s){return C(this,void 0,void 0,(function*(){var n;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,(n=this.abortController)===null||n===void 0||n.abort(),this.abortController=null,!e&&!i){const o=this.options.fetchParams||{};window.AbortController&&!o.signal&&(this.abortController=new AbortController,o.signal=this.abortController.signal);const h=a=>this.emit("loading",a);e=yield ot.fetchBlob(t,h,o);const l=this.options.blobMimeType;l&&(e=new Blob([e],{type:l}))}this.setSrc(t,e);const r=yield new Promise((o=>{const h=s||this.getDuration();h?o(h):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",(()=>o(this.getDuration())),{once:!0}))}));if(!t&&!e){const o=this.getMediaElement();o instanceof U&&(o.duration=r)}if(i)this.decodedData=L.createBuffer(i,r||0);else if(e){const o=yield e.arrayBuffer();this.decodedData=yield L.decode(o,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())}))}load(t,e,i){return C(this,void 0,void 0,(function*(){try{return yield this.loadAudio(t,void 0,e,i)}catch(s){throw this.emit("error",s),s}}))}loadBlob(t,e,i){return C(this,void 0,void 0,(function*(){try{return yield this.loadAudio("",t,e,i)}catch(s){throw this.emit("error",s),s}}))}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:i=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const s=Math.min(t,this.decodedData.numberOfChannels),n=[];for(let r=0;rMath.abs(d)&&(d=f)}h.push(Math.round(d*i)/i)}n.push(h)}return n}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const i=Object.create(null,{play:{get:()=>super.play}});return C(this,void 0,void 0,(function*(){t!=null&&this.setTime(t);const s=yield i.play.call(this);return e!=null&&(this.media instanceof U?this.media.stopAt(e):this.stopAtPosition=e),s}))}playPause(){return C(this,void 0,void 0,(function*(){return this.isPlaying()?this.pause():this.play()}))}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return C(this,arguments,void 0,(function*(t="image/png",e=1,i="dataURL"){return this.renderer.exportImage(t,e,i)}))}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach((e=>e.destroy())),this.subscriptions.forEach((e=>e())),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}O.BasePlugin=class extends A{constructor(c){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=c}onInit(){}_init(c){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=c,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach((c=>c())),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}},O.dom=rt;function ct(c){const t=c.numberOfChannels,e=c.length*t*2+44,i=new ArrayBuffer(e),s=new DataView(i);let n=0;const r=function(o,h,l){for(let a=0;a{const s=new AudioContext({sampleRate:i||c.sampleRate}),n=c.numberOfChannels,r=i||c.sampleRate;let o=c.length,h=0;t!=null&&e!=null&&(h=Math.round(t*r),o=Math.round(e*r)-h);const l=s.createBuffer(n,o,r);for(let a=0;a{c&&c.skip(t)},bt=(c,t)=>(t||(t=5),c/100*t||5);var dt=V(''),ut=V(''),pt=st('
                ');function yt(c,t){Q(t,!0);let e=X(t,"loop",3,!1),i,s,n=W(!1),r=W(0),o=W(0),h=W(!1),l=nt(()=>t.value.url);const a=async()=>{if(!i||!x(l)||x(h))return;s&&s.destroy();const g=getComputedStyle(document.documentElement).getPropertyValue("--color-accent")||"#ff7c00";s=O.create({container:i,height:32,waveColor:"rgba(128, 128, 128, 0.5)",progressColor:g,cursorColor:"transparent",barWidth:2,barGap:2,barRadius:2,normalize:!0,interact:!0,dragToSeek:!0,hideScrollbar:!0}),s.on("play",()=>R(n,!0)),s.on("pause",()=>R(n,!1)),s.on("ready",()=>{R(r,s?.getDuration()||0,!0),R(h,!0)}),s.on("audioprocess",()=>{R(o,s?.getCurrentTime()||0,!0)}),s.on("interaction",()=>{R(o,s?.getCurrentTime()||0,!0)}),s.on("finish",()=>{R(n,!1),e()&&s?.play()}),await s.load(x(l))};J(async()=>{await a()}),K(()=>{s&&s.destroy()});const p=()=>{s&&s.playPause()};var d=pt(),u=N(d);u.__click=p;var f=N(u);{var w=g=>{var m=dt();B(g,m)},v=g=>{var m=ut();B(g,m)};$(f,g=>{x(n)?g(w):g(v,!1)})}I(u);var b=F(u,2);q(b,g=>i=g,()=>i);var y=F(b,2),S=N(y,!0);I(y),I(d),tt((g,m)=>{_(d,"aria-label",t.label||"Audio"),_(d,"data-testid",g),_(u,"aria-label",x(n)?"Pause":"Play"),et(S,m)},[()=>t.label&&typeof t.label=="string"&&t.label.trim()?"waveform-"+t.label:"unlabelled-audio",()=>Y(x(n)?x(o):x(r))]),B(c,d),it()}Z(["click"]);export{yt as M,bt as g,gt as p,vt as s,O as u}; diff --git a/assets/Model3D-gDU5RKVo.js b/assets/Model3D-gDU5RKVo.js deleted file mode 100644 index f4fede7a1269d157235bde14adb1ae662b12e622..0000000000000000000000000000000000000000 --- a/assets/Model3D-gDU5RKVo.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Canvas3D-TG45VLbi.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./Canvas3DGS-CSEUG3T9.js"])))=>i.map(i=>d[i]); -import{M as ee,aa as v,ab as ae,ac as R,$ as f,Z as a,N as w,a as p,O as te,af as S,a2 as y,S as I,R as k,Q as T,T as U,t as oe,a3 as W}from"./index-DydPgVMC.js";import{p as n,i as z,a as C,d as re}from"./i18n-CPHyzK9b.js";import{I as x,c as A}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as ne}from"./BlockLabel-BzVeVrtL.js";import{D as le}from"./Download-DWSaBiea.js";import{F as de}from"./File-_VpQFuKr.js";import{U as se}from"./Undo-B9SlrYtT.js";import{I as _e}from"./IconButtonWrapper-PnNNNvqI.js";import{d as ie}from"./index-tFQomdd2.js";import"./snippet-BtHMuX3s.js";var ue=k(' ',1),me=k('
                '),ce=k(" ",1);function ze(F,e){ee(e,!0);let G=n(e,"display_mode",3,"solid"),M=n(e,"clear_color",19,()=>[0,0,0,0]),V=n(e,"label",3,""),l=n(e,"zoom_speed",3,1),d=n(e,"pan_speed",3,1),u=n(e,"camera_position",19,()=>[null,null,null]),q=n(e,"has_change_history",3,!1),g=v(ae({camera_position:u(),zoom_speed:l(),pan_speed:d()})),h=v(!1),B=v(void 0),E=v(void 0),b=v(void 0);async function N(){return(await S(()=>import("./Canvas3D-TG45VLbi.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).default}async function Q(){return(await S(()=>import("./Canvas3DGS-CSEUG3T9.js"),__vite__mapDeps([5,3,1,2,4]),import.meta.url)).default}R(()=>{e.value&&(f(h,e.value.path.endsWith(".splat")||e.value.path.endsWith(".ply"),!0),a(h)?Q().then(t=>{f(B,t,!0)}):N().then(t=>{f(E,t,!0)}))});function Z(){a(b)?.reset_camera_position()}R(()=>{(!ie(a(g).camera_position,u())||a(g).zoom_speed!==l()||a(g).pan_speed!==d())&&(a(b)?.update_camera(u(),l(),d()),f(g,{camera_position:u(),zoom_speed:l(),pan_speed:d()},!0))});var P=ce(),L=w(P);{let t=y(()=>V()||e.i18n("3D_model.3d_model"));ne(L,{get show_label(){return e.show_label},get Icon(){return de},get label(){return a(t)}})}var j=I(L,2);{var H=t=>{var D=me(),O=T(D);_e(O,{children:(o,s)=>{var _=ue(),i=w(_);{var m=c=>{{let $=y(()=>!q());x(c,{get Icon(){return se},label:"Undo",onclick:()=>Z(),get disabled(){return a($)}})}};z(i,c=>{a(h)||c(m)})}var r=I(i,2);C(r,"target",window.__is_colab__?"_blank":null);var Y=T(r);{let c=y(()=>e.i18n("common.download"));x(Y,{get Icon(){return le},get label(){return a(c)}})}U(r),oe(()=>{C(r,"href",e.value.url),C(r,"download",window.__is_colab__?null:e.value.orig_name||e.value.path)}),p(o,_)},$$slots:{default:!0}});var J=I(O,2);{var K=o=>{var s=W(),_=w(s);A(_,()=>a(B),(i,m)=>{m(i,{get value(){return e.value},get zoom_speed(){return l()},get pan_speed(){return d()}})}),p(o,s)},X=o=>{var s=W(),_=w(s);A(_,()=>a(E),(i,m)=>{re(m(i,{get value(){return e.value},get display_mode(){return G()},get clear_color(){return M()},get camera_position(){return u()},get zoom_speed(){return l()},get pan_speed(){return d()}}),r=>f(b,r,!0),()=>a(b))}),p(o,s)};z(J,o=>{a(h)?o(K):o(X,!1)})}U(D),p(t,D)};z(j,t=>{e.value&&t(H)})}p(F,P),te()}export{ze as default}; diff --git a/assets/ModifyUpload-BL388q45.js b/assets/ModifyUpload-BL388q45.js deleted file mode 100644 index f83beb3aaf92ca1b780523dab92d409bd2132ec3..0000000000000000000000000000000000000000 --- a/assets/ModifyUpload-BL388q45.js +++ /dev/null @@ -1 +0,0 @@ -import{p as d,i as a}from"./i18n-CPHyzK9b.js";import{M as C,N as _,S as t,Z as n,a as b,a2 as l,a3 as E,O as x,R as y}from"./index-DydPgVMC.js";import{s as L}from"./snippet-BtHMuX3s.js";import{I as i}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{D as N}from"./DownloadLink-DM2QmhDx.js";import{C as O}from"./Clear-BR8cTgGu.js";import{D as R}from"./Download-DWSaBiea.js";import{E as S}from"./Edit-G5CCT_vc.js";import{U as W}from"./Undo-B9SlrYtT.js";import{I as Z}from"./IconButtonWrapper-PnNNNvqI.js";var j=y(" ",1);function X(h,e){C(e,!0);let I=d(e,"editable",3,!1),w=d(e,"undoable",3,!1),m=d(e,"download",3,null);Z(h,{children:(k,q)=>{var c=j(),f=_(c);{var p=o=>{{let r=l(()=>e.i18n("common.edit"));i(o,{get Icon(){return S},get label(){return n(r)},onclick:()=>e.onedit?.()})}};a(f,o=>{I()&&o(p)})}var s=t(f,2);{var D=o=>{{let r=l(()=>e.i18n("common.undo"));i(o,{get Icon(){return W},get label(){return n(r)},onclick:()=>e.onundo?.()})}};a(s,o=>{w()&&o(D)})}var u=t(s,2);{var M=o=>{N(o,{get href(){return m()},download:!0,children:(r,v)=>{{let B=l(()=>e.i18n("common.download"));i(r,{get Icon(){return R},get label(){return n(B)}})}},$$slots:{default:!0}})};a(u,o=>{m()&&o(M)})}var g=t(u,2);{var P=o=>{var r=E(),v=_(r);L(v,()=>e.children),b(o,r)};a(g,o=>{e.children&&o(P)})}var U=t(g,2);{let o=l(()=>e.i18n("common.clear"));i(U,{get Icon(){return O},get label(){return n(o)},onclick:r=>{e.onclear?.(),r.stopPropagation()}})}b(k,c)},$$slots:{default:!0}}),x()}export{X as M}; diff --git a/assets/Music-CGJUBXWE.js b/assets/Music-CGJUBXWE.js deleted file mode 100644 index 41ab432923a2fe0ac21a5fa839b07dc47dde4b85..0000000000000000000000000000000000000000 --- a/assets/Music-CGJUBXWE.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as o,f as t}from"./index-DydPgVMC.js";var c=t('');function a(r){var e=c();o(r,e)}export{a as M}; diff --git a/assets/Play-CRvn2HoA.js b/assets/Play-CRvn2HoA.js deleted file mode 100644 index e06eeaa9ab0a20fc75b6e973308e51935df4e263..0000000000000000000000000000000000000000 --- a/assets/Play-CRvn2HoA.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as t,f as n}from"./index-DydPgVMC.js";var s=n('');function l(o){var r=s();t(o,r)}export{l as P}; diff --git a/assets/Plot-CYQ3vpBc.js b/assets/Plot-CYQ3vpBc.js deleted file mode 100644 index b3805b112a22a39f0347fbe5dce9f79e9b49d299..0000000000000000000000000000000000000000 --- a/assets/Plot-CYQ3vpBc.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PlotlyPlot-D51HNFIN.js","./i18n-CPHyzK9b.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CawRO-sx.css","./BokehPlot-B0xAqoU-.js","./BokehPlot-CuxSh81N.css","./MatplotlibPlot-3NvwORNR.js","./MatplotlibPlot-C0hWVe9M.css","./AltairPlot-DvtXjkKK.js","./color-Be3KLOYu.js","./mollweide-XXUPULVr.js","./ordinal-BeghXfj9.js","./init-Dmth1JHB.js","./linear-8mDBZVC7.js","./step-B-Gbak1k.js","./defaultLocale-CzDG__Ur.js","./time-BMaLdJ6b.js","./dispatch-kxCwF96_.js","./range-OtVwhkKS.js","./index-BU4IRnz1.js","./colors-Cc3OSVma.js","./dsv-DB8NKgIY.js","./arc-Bt_eNeYl.js","./AltairPlot-CKbUvQSk.css"])))=>i.map(i=>d[i]); -import{a as n,f as T,M as L,ac as A,v as R,$ as a,Z as r,a3 as m,N as f,O as V,aa as i,af as c}from"./index-DydPgVMC.js";import{i as D}from"./i18n-CPHyzK9b.js";import{k as I}from"./key-CFGu0zzg.js";import{c as j}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{E as z}from"./Empty-B15ItVsj.js";var H=T('');function S(_){var e=H();n(_,e)}function Z(_,e){L(e,!0);let l=i(null),d=i(!1),s=i(0);const v={plotly:()=>c(()=>import("./PlotlyPlot-D51HNFIN.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),bokeh:()=>c(()=>import("./BokehPlot-B0xAqoU-.js"),__vite__mapDeps([5,1,2,3,4,6]),import.meta.url),matplotlib:()=>c(()=>import("./MatplotlibPlot-3NvwORNR.js"),__vite__mapDeps([7,1,2,3,4,8]),import.meta.url),altair:()=>c(()=>import("./AltairPlot-DvtXjkKK.js"),__vite__mapDeps([9,1,2,3,4,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url)};let u={};const b=typeof window<"u";let g=i(null);A(()=>{let t=e.value?.type;R(()=>{a(s,r(s)+1),t!==r(g)&&a(l,null),t&&t in v&&b&&(u[t]?a(l,u[t],!0):v[t]().then(o=>{a(l,o.default,!0),u[t]=r(l)})),a(g,t,!0)}),e.on_change()});var p=m(),w=f(p);{var x=t=>{var o=m(),h=f(o);I(h,()=>r(s),k=>{var y=m(),E=f(y);j(E,()=>r(l),(C,M)=>{M(C,{get value(){return e.value},colors:[],get theme_mode(){return e.theme_mode},get show_label(){return e.show_label},get caption(){return e.caption},get bokeh_version(){return e.bokeh_version},get show_actions_button(){return e.show_actions_button},get _selectable(){return e._selectable},get x_lim(){return e.x_lim},get onselect(){return e.onselect},get loaded_plotly_css(){return r(d)},set loaded_plotly_css(O){a(d,O,!0)}})}),n(k,y)}),n(t,o)},P=t=>{z(t,{unpadded_box:!0,size:"large",children:(o,h)=>{S(o)},$$slots:{default:!0}})};D(w,t=>{e.value&&r(l)?t(x):t(P,!1)})}n(_,p),V()}const G=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"}));export{S as P,Z as a,G as b}; diff --git a/assets/PlotlyPlot-D51HNFIN.js b/assets/PlotlyPlot-D51HNFIN.js deleted file mode 100644 index 022d887e04918efde7c63ab1c332c3a24805e878..0000000000000000000000000000000000000000 --- a/assets/PlotlyPlot-D51HNFIN.js +++ /dev/null @@ -1,3789 +0,0 @@ -import{L as BI,p as RI,a as NI,d as jI}from"./i18n-CPHyzK9b.js";import{M as UI,ac as VI,a as HI,O as qI,R as WI,Z as B4,a2 as GI}from"./index-DydPgVMC.js";var Ly={exports:{}},ZI=Ly.exports,R4;function KI(){return R4||(R4=1,(function(zg){var r0={};(function(md,gd){zg.exports?zg.exports=gd():md.moduleName=gd()})(typeof self<"u"?self:ZI,()=>{var md=(()=>{var gd=Object.create,zh=Object.defineProperty,cm=Object.defineProperties,Cy=Object.getOwnPropertyDescriptor,fm=Object.getOwnPropertyDescriptors,nf=Object.getOwnPropertyNames,n0=Object.getOwnPropertySymbols,U4=Object.getPrototypeOf,Iy=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,G_=(K,V,u)=>V in K?zh(K,V,{enumerable:!0,configurable:!0,writable:!0,value:u}):K[V]=u,vd=(K,V)=>{for(var u in V||(V={}))Iy.call(V,u)&&G_(K,u,V[u]);if(n0)for(var u of n0(V))W_.call(V,u)&&G_(K,u,V[u]);return K},hm=(K,V)=>cm(K,fm(V)),V4=(K,V)=>{var u={};for(var d in K)Iy.call(K,d)&&V.indexOf(d)<0&&(u[d]=K[d]);if(K!=null&&n0)for(var d of n0(K))V.indexOf(d)<0&&W_.call(K,d)&&(u[d]=K[d]);return u},Bl=(K,V)=>()=>(K&&(V=K(K=0)),V),Vt=(K,V)=>()=>(V||K((V={exports:{}}).exports,V),V.exports),Z_=(K,V)=>{for(var u in V)zh(K,u,{get:V[u],enumerable:!0})},K_=(K,V,u,d)=>{if(V&&typeof V=="object"||typeof V=="function")for(let E of nf(V))!Iy.call(K,E)&&E!==u&&zh(K,E,{get:()=>V[E],enumerable:!(d=Cy(V,E))||d.enumerable});return K},H4=(K,V,u)=>(u=K!=null?gd(U4(K)):{},K_(zh(u,"default",{value:K,enumerable:!0}),K)),yd=K=>K_(zh({},"__esModule",{value:!0}),K),Py=Vt(K=>{K.version="3.3.1"}),q4=Vt((K,V)=>{(function(u,d,E){d[u]=d[u]||E(),typeof V<"u"&&V.exports&&(V.exports=d[u])})("Promise",typeof window<"u"?window:K,function(){var u,d,E,A=Object.prototype.toString,t=typeof setImmediate<"u"?function(w){return setImmediate(w)}:setTimeout;try{Object.defineProperty({},"x",{}),u=function(w,l,x,y){return Object.defineProperty(w,l,{value:x,writable:!0,configurable:y!==!1})}}catch{u=function(l,x,y){return l[x]=y,l}}E=(function(){var w,l,x;function y(S,k){this.fn=S,this.self=k,this.next=void 0}return{add:function(S,k){x=new y(S,k),l?l.next=x:w=x,l=x,x=void 0},drain:function(){var S=w;for(w=l=d=void 0;S;)S.fn.call(S.self),S=S.next}}})();function e(w,l){E.add(w,l),d||(d=t(E.drain))}function r(w){var l,x=typeof w;return w!=null&&(x=="object"||x=="function")&&(l=w.then),typeof l=="function"?l:!1}function i(){for(var w=0;w0&&e(i,x))}catch(y){a.call(new f(x),y)}}}function a(w){var l=this;l.triggered||(l.triggered=!0,l.def&&(l=l.def),l.msg=w,l.state=2,l.chain.length>0&&e(i,l))}function s(w,l,x,y){for(var S=0;S{(function(){var u={version:"3.8.2"},d=[].slice,E=function(gt){return d.call(gt)},A=self.document;function t(gt){return gt&&(gt.ownerDocument||gt.document||gt).documentElement}function e(gt){return gt&&(gt.ownerDocument&>.ownerDocument.defaultView||gt.document&>||gt.defaultView)}if(A)try{E(A.documentElement.childNodes)[0].nodeType}catch{E=function(Et){for(var Xt=Et.length,fe=new Array(Xt);Xt--;)fe[Xt]=Et[Xt];return fe}}if(Date.now||(Date.now=function(){return+new Date}),A)try{A.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,i=r.setAttribute,n=r.setAttributeNS,o=this.CSSStyleDeclaration.prototype,a=o.setProperty;r.setAttribute=function(Et,Xt){i.call(this,Et,Xt+"")},r.setAttributeNS=function(Et,Xt,fe){n.call(this,Et,Xt,fe+"")},o.setProperty=function(Et,Xt,fe){a.call(this,Et,Xt+"",fe)}}u.ascending=s;function s(gt,Et){return gtEt?1:gt>=Et?0:NaN}u.descending=function(gt,Et){return Etgt?1:Et>=gt?0:NaN},u.min=function(gt,Et){var Xt=-1,fe=gt.length,me,we;if(arguments.length===1){for(;++Xt=we){me=we;break}for(;++Xtwe&&(me=we)}else{for(;++Xt=we){me=we;break}for(;++Xtwe&&(me=we)}return me},u.max=function(gt,Et){var Xt=-1,fe=gt.length,me,we;if(arguments.length===1){for(;++Xt=we){me=we;break}for(;++Xtme&&(me=we)}else{for(;++Xt=we){me=we;break}for(;++Xtme&&(me=we)}return me},u.extent=function(gt,Et){var Xt=-1,fe=gt.length,me,we,Ve;if(arguments.length===1){for(;++Xt=we){me=Ve=we;break}for(;++Xtwe&&(me=we),Ve=we){me=Ve=we;break}for(;++Xtwe&&(me=we),Ve1)return Ve/(or-1)},u.deviation=function(){var gt=u.variance.apply(this,arguments);return gt&&Math.sqrt(gt)};function g(gt){return{left:function(Et,Xt,fe,me){for(arguments.length<3&&(fe=0),arguments.length<4&&(me=Et.length);fe>>1;gt(Et[we],Xt)<0?fe=we+1:me=we}return fe},right:function(Et,Xt,fe,me){for(arguments.length<3&&(fe=0),arguments.length<4&&(me=Et.length);fe>>1;gt(Et[we],Xt)>0?me=we:fe=we+1}return fe}}}var m=g(s);u.bisectLeft=m.left,u.bisect=u.bisectRight=m.right,u.bisector=function(gt){return g(gt.length===1?function(Et,Xt){return s(gt(Et),Xt)}:gt)},u.shuffle=function(gt,Et,Xt){(fe=arguments.length)<3&&(Xt=gt.length,fe<2&&(Et=0));for(var fe=Xt-Et,me,we;fe;)we=Math.random()*fe--|0,me=gt[fe+Et],gt[fe+Et]=gt[we+Et],gt[we+Et]=me;return gt},u.permute=function(gt,Et){for(var Xt=Et.length,fe=new Array(Xt);Xt--;)fe[Xt]=gt[Et[Xt]];return fe},u.pairs=function(gt){for(var Et=0,Xt=gt.length-1,fe,me=gt[0],we=new Array(Xt<0?0:Xt);Et=0;)for(Ve=gt[Et],Xt=Ve.length;--Xt>=0;)we[--me]=Ve[Xt];return we};var l=Math.abs;u.range=function(gt,Et,Xt){if(arguments.length<3&&(Xt=1,arguments.length<2&&(Et=gt,gt=0)),(Et-gt)/Xt===1/0)throw new Error("infinite range");var fe=[],me=x(l(Xt)),we=-1,Ve;if(gt*=me,Et*=me,Xt*=me,Xt<0)for(;(Ve=gt+Xt*++we)>Et;)fe.push(Ve/me);else for(;(Ve=gt+Xt*++we)=Et.length)return me?me.call(gt,or):fe?or.sort(fe):or;for(var Sr=-1,Wr=or.length,an=Et[Cr++],on,ta,hn,Bn=new S,Hn;++Sr=Et.length)return je;var Cr=[],Sr=Xt[or++];return je.forEach(function(Wr,an){Cr.push({key:Wr,values:Ve(an,or)})}),Sr?Cr.sort(function(Wr,an){return Sr(Wr.key,an.key)}):Cr}return gt.map=function(je,or){return we(or,je,0)},gt.entries=function(je){return Ve(we(u.map,je,0),0)},gt.key=function(je){return Et.push(je),gt},gt.sortKeys=function(je){return Xt[Et.length-1]=je,gt},gt.sortValues=function(je){return fe=je,gt},gt.rollup=function(je){return me=je,gt},gt},u.set=function(gt){var Et=new D;if(gt)for(var Xt=0,fe=gt.length;Xt=0&&(fe=gt.slice(Xt+1),gt=gt.slice(0,Xt)),gt)return arguments.length<2?this[gt].on(fe):this[gt].on(fe,Et);if(arguments.length===2){if(Et==null)for(gt in this)this.hasOwnProperty(gt)&&this[gt].on(fe,null);return this}};function G(gt){var Et=[],Xt=new S;function fe(){for(var me=Et,we=-1,Ve=me.length,je;++we=0&&(Xt=gt.slice(0,Et))!=="xmlns"&&(gt=gt.slice(Et+1)),dt.hasOwnProperty(Xt)?{space:dt[Xt],local:gt}:gt}},J.attr=function(gt,Et){if(arguments.length<2){if(typeof gt=="string"){var Xt=this.node();return gt=u.ns.qualify(gt),gt.local?Xt.getAttributeNS(gt.space,gt.local):Xt.getAttribute(gt)}for(Et in gt)this.each(Tt(Et,gt[Et]));return this}return this.each(Tt(gt,Et))};function Tt(gt,Et){gt=u.ns.qualify(gt);function Xt(){this.removeAttribute(gt)}function fe(){this.removeAttributeNS(gt.space,gt.local)}function me(){this.setAttribute(gt,Et)}function we(){this.setAttributeNS(gt.space,gt.local,Et)}function Ve(){var or=Et.apply(this,arguments);or==null?this.removeAttribute(gt):this.setAttribute(gt,or)}function je(){var or=Et.apply(this,arguments);or==null?this.removeAttributeNS(gt.space,gt.local):this.setAttributeNS(gt.space,gt.local,or)}return Et==null?gt.local?fe:Xt:typeof Et=="function"?gt.local?je:Ve:gt.local?we:me}function wt(gt){return gt.trim().replace(/\s+/g," ")}J.classed=function(gt,Et){if(arguments.length<2){if(typeof gt=="string"){var Xt=this.node(),fe=(gt=It(gt)).length,me=-1;if(Et=Xt.classList){for(;++me=0;)(we=Xt[fe])&&(me&&me!==we.nextSibling&&me.parentNode.insertBefore(we,me),me=we);return this},J.sort=function(gt){gt=Ut.apply(this,arguments);for(var Et=-1,Xt=this.length;++Et=Et&&(Et=me+1);!(or=Ve[Et])&&++Et0&&(gt=gt.slice(0,me));var Ve=We.get(gt);Ve&&(gt=Ve,we=vr);function je(){var Sr=this[fe];Sr&&(this.removeEventListener(gt,Sr,Sr.$),delete this[fe])}function or(){var Sr=we(Et,E(arguments));je.call(this),this.addEventListener(gt,this[fe]=Sr,Sr.$=Xt),Sr._=Et}function Cr(){var Sr=new RegExp("^__on([^.]+)"+u.requote(gt)+"$"),Wr;for(var an in this)if(Wr=an.match(Sr)){var on=this[an];this.removeEventListener(Wr[1],on,on.$),delete this[an]}}return me?Et?or:je:Et?j:Cr}var We=u.map({mouseenter:"mouseover",mouseleave:"mouseout"});A&&We.forEach(function(gt){"on"+gt in A&&We.remove(gt)});function qe(gt,Et){return function(Xt){var fe=u.event;u.event=Xt,Et[0]=this.__data__;try{gt.apply(this,Et)}finally{u.event=fe}}}function vr(gt,Et){var Xt=qe(gt,Et);return function(fe){var me=this,we=fe.relatedTarget;(!we||we!==me&&!(we.compareDocumentPosition(me)&8))&&Xt.call(me,fe)}}var _r,er=0;function Mr(gt){var Et=".dragsuppress-"+ ++er,Xt="click"+Et,fe=u.select(e(gt)).on("touchmove"+Et,rt).on("dragstart"+Et,rt).on("selectstart"+Et,rt);if(_r==null&&(_r="onselectstart"in gt?!1:I(gt.style,"userSelect")),_r){var me=t(gt).style,we=me[_r];me[_r]="none"}return function(Ve){if(fe.on(Et,null),_r&&(me[_r]=we),Ve){var je=function(){fe.on(Xt,null)};fe.on(Xt,function(){rt(),je()},!0),setTimeout(je,0)}}}u.mouse=function(gt){return de(gt,ct())};var Ir=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function de(gt,Et){Et.changedTouches&&(Et=Et.changedTouches[0]);var Xt=gt.ownerSVGElement||gt;if(Xt.createSVGPoint){var fe=Xt.createSVGPoint();if(Ir<0){var me=e(gt);if(me.scrollX||me.scrollY){Xt=u.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var we=Xt[0][0].getScreenCTM();Ir=!(we.f||we.e),Xt.remove()}}return Ir?(fe.x=Et.pageX,fe.y=Et.pageY):(fe.x=Et.clientX,fe.y=Et.clientY),fe=fe.matrixTransform(gt.getScreenCTM().inverse()),[fe.x,fe.y]}var Ve=gt.getBoundingClientRect();return[Et.clientX-Ve.left-gt.clientLeft,Et.clientY-Ve.top-gt.clientTop]}u.touch=function(gt,Et,Xt){if(arguments.length<3&&(Xt=Et,Et=ct().changedTouches),Et){for(var fe=0,me=Et.length,we;fe1?Ht:gt<-1?-Ht:Math.asin(gt)}function Ue(gt){return((gt=Math.exp(gt))-1/gt)/2}function ir(gt){return((gt=Math.exp(gt))+1/gt)/2}function ar(gt){return((gt=Math.exp(2*gt))-1)/(gt+1)}var Ye=Math.SQRT2,Er=2,pn=4;u.interpolateZoom=function(gt,Et){var Xt=gt[0],fe=gt[1],me=gt[2],we=Et[0],Ve=Et[1],je=Et[2],or=we-Xt,Cr=Ve-fe,Sr=or*or+Cr*Cr,Wr,an;if(Sr<_t)an=Math.log(je/me)/Ye,Wr=function(Yn){return[Xt+Yn*or,fe+Yn*Cr,me*Math.exp(Ye*Yn*an)]};else{var on=Math.sqrt(Sr),ta=(je*je-me*me+pn*Sr)/(2*me*Er*on),hn=(je*je-me*me-pn*Sr)/(2*je*Er*on),Bn=Math.log(Math.sqrt(ta*ta+1)-ta),Hn=Math.log(Math.sqrt(hn*hn+1)-hn);an=(Hn-Bn)/Ye,Wr=function(Yn){var na=Yn*an,_n=ir(Bn),Ha=me/(Er*on)*(_n*ar(Ye*na+Bn)-Ue(Bn));return[Xt+Ha*or,fe+Ha*Cr,me*_n/ir(Ye*na+Bn)]}}return Wr.duration=an*1e3,Wr},u.behavior.zoom=function(){var gt={x:0,y:0,k:1},Et,Xt,fe,me=[960,500],we=dn,Ve=250,je=0,or="mousedown.zoom",Cr="mousemove.zoom",Sr="mouseup.zoom",Wr,an="touchstart.zoom",on,ta=st(na,"zoomstart","zoom","zoomend"),hn,Bn,Hn,Yn;Zn||(Zn="onwheel"in A?(bn=function(){return-u.event.deltaY*(u.event.deltaMode?120:1)},"wheel"):"onmousewheel"in A?(bn=function(){return u.event.wheelDelta},"mousewheel"):(bn=function(){return-u.event.detail},"MozMousePixelScroll"));function na(fi){fi.on(or,Ji).on(Zn+".zoom",pl).on("dblclick.zoom",Ns).on(an,es)}na.event=function(fi){fi.each(function(){var Ao=ta.of(this,arguments),Bo=gt;Ai?u.select(this).transition().each("start.zoom",function(){gt=this.__chart__||{x:0,y:0,k:1},zi(Ao)}).tween("zoom:zoom",function(){var Ds=me[0],Ts=me[1],lu=Xt?Xt[0]:Ds/2,ps=Xt?Xt[1]:Ts/2,zs=u.interpolateZoom([(lu-gt.x)/gt.k,(ps-gt.y)/gt.k,Ds/gt.k],[(lu-Bo.x)/Bo.k,(ps-Bo.y)/Bo.k,Ds/Bo.k]);return function(Eu){var ie=zs(Eu),nr=Ds/ie[2];this.__chart__=gt={x:lu-ie[0]*nr,y:ps-ie[1]*nr,k:nr},jo(Ao)}}).each("interrupt.zoom",function(){Ii(Ao)}).each("end.zoom",function(){Ii(Ao)}):(this.__chart__=gt,zi(Ao),jo(Ao),Ii(Ao))})},na.translate=function(fi){return arguments.length?(gt={x:+fi[0],y:+fi[1],k:gt.k},ki(),na):[gt.x,gt.y]},na.scale=function(fi){return arguments.length?(gt={x:gt.x,y:gt.y,k:null},Wa(+fi),ki(),na):gt.k},na.scaleExtent=function(fi){return arguments.length?(we=fi==null?dn:[+fi[0],+fi[1]],na):we},na.center=function(fi){return arguments.length?(fe=fi&&[+fi[0],+fi[1]],na):fe},na.size=function(fi){return arguments.length?(me=fi&&[+fi[0],+fi[1]],na):me},na.duration=function(fi){return arguments.length?(Ve=+fi,na):Ve},na.x=function(fi){return arguments.length?(Bn=fi,hn=fi.copy(),gt={x:0,y:0,k:1},na):Bn},na.y=function(fi){return arguments.length?(Yn=fi,Hn=fi.copy(),gt={x:0,y:0,k:1},na):Yn};function _n(fi){return[(fi[0]-gt.x)/gt.k,(fi[1]-gt.y)/gt.k]}function Ha(fi){return[fi[0]*gt.k+gt.x,fi[1]*gt.k+gt.y]}function Wa(fi){gt.k=Math.max(we[0],Math.min(we[1],fi))}function ri(fi,Ao){Ao=Ha(Ao),gt.x+=fi[0]-Ao[0],gt.y+=fi[1]-Ao[1]}function xi(fi,Ao,Bo,Ds){fi.__chart__={x:gt.x,y:gt.y,k:gt.k},Wa(Math.pow(2,Ds)),ri(Xt=Ao,Bo),fi=u.select(fi),Ve>0&&(fi=fi.transition().duration(Ve)),fi.call(na.event)}function ki(){Bn&&Bn.domain(hn.range().map(function(fi){return(fi-gt.x)/gt.k}).map(hn.invert)),Yn&&Yn.domain(Hn.range().map(function(fi){return(fi-gt.y)/gt.k}).map(Hn.invert))}function zi(fi){je++||fi({type:"zoomstart"})}function jo(fi){ki(),fi({type:"zoom",scale:gt.k,translate:[gt.x,gt.y]})}function Ii(fi){--je||(fi({type:"zoomend"}),Xt=null)}function Ji(){var fi=this,Ao=ta.of(fi,arguments),Bo=0,Ds=u.select(e(fi)).on(Cr,ps).on(Sr,zs),Ts=_n(u.mouse(fi)),lu=Mr(fi);Jn.call(fi),zi(Ao);function ps(){Bo=1,ri(u.mouse(fi),Ts),jo(Ao)}function zs(){Ds.on(Cr,null).on(Sr,null),lu(Bo),Ii(Ao)}}function es(){var fi=this,Ao=ta.of(fi,arguments),Bo={},Ds=0,Ts,lu=".zoom-"+u.event.changedTouches[0].identifier,ps="touchmove"+lu,zs="touchend"+lu,Eu=[],ie=u.select(fi),nr=Mr(fi);sn(),zi(Ao),ie.on(or,null).on(an,sn);function cr(){var qr=u.touches(fi);return Ts=gt.k,qr.forEach(function(Sn){Sn.identifier in Bo&&(Bo[Sn.identifier]=_n(Sn))}),qr}function sn(){var qr=u.event.target;u.select(qr).on(ps,zn).on(zs,Tn),Eu.push(qr);for(var Sn=u.event.changedTouches,sa=0,ea=Sn.length;sa1){var Va=ka[0],fa=ka[1],Un=Va[0]-fa[0],Nr=Va[1]-fa[1];Ds=Un*Un+Nr*Nr}}function zn(){var qr=u.touches(fi),Sn,sa,ea,ka;Jn.call(fi);for(var Ka=0,Va=qr.length;Ka1?1:Et,Xt=Xt<0?0:Xt>1?1:Xt,me=Xt<=.5?Xt*(1+Et):Xt+Et-Xt*Et,fe=2*Xt-me;function we(je){return je>360?je-=360:je<0&&(je+=360),je<60?fe+(me-fe)*je/60:je<180?me:je<240?fe+(me-fe)*(240-je)/60:fe}function Ve(je){return Math.round(we(je)*255)}return new Fa(Ve(gt+120),Ve(gt),Ve(gt-120))}u.hcl=Se;function Se(gt,Et,Xt){return this instanceof Se?(this.h=+gt,this.c=+Et,void(this.l=+Xt)):arguments.length<2?gt instanceof Se?new Se(gt.h,gt.c,gt.l):gt instanceof tr?Kn(gt.l,gt.a,gt.b):Kn((gt=mr((gt=u.rgb(gt)).r,gt.g,gt.b)).l,gt.a,gt.b):new Se(gt,Et,Xt)}var Re=Se.prototype=new En;Re.brighter=function(gt){return new Se(this.h,this.c,Math.min(100,this.l+zr*(arguments.length?gt:1)))},Re.darker=function(gt){return new Se(this.h,this.c,Math.max(0,this.l-zr*(arguments.length?gt:1)))},Re.rgb=function(){return Ze(this.h,this.c,this.l).rgb()};function Ze(gt,Et,Xt){return isNaN(gt)&&(gt=0),isNaN(Et)&&(Et=0),new tr(Xt,Math.cos(gt*=Yt)*Et,Math.sin(gt)*Et)}u.lab=tr;function tr(gt,Et,Xt){return this instanceof tr?(this.l=+gt,this.a=+Et,void(this.b=+Xt)):arguments.length<2?gt instanceof tr?new tr(gt.l,gt.a,gt.b):gt instanceof Se?Ze(gt.h,gt.c,gt.l):mr((gt=Fa(gt)).r,gt.g,gt.b):new tr(gt,Et,Xt)}var zr=18,tn=.95047,Yr=1,$r=1.08883,In=tr.prototype=new En;In.brighter=function(gt){return new tr(Math.min(100,this.l+zr*(arguments.length?gt:1)),this.a,this.b)},In.darker=function(gt){return new tr(Math.max(0,this.l-zr*(arguments.length?gt:1)),this.a,this.b)},In.rgb=function(){return Nn(this.l,this.a,this.b)};function Nn(gt,Et,Xt){var fe=(gt+16)/116,me=fe+Et/500,we=fe-Xt/200;return me=$n(me)*tn,fe=$n(fe)*Yr,we=$n(we)*$r,new Fa(Cn(3.2404542*me-1.5371385*fe-.4985314*we),Cn(-.969266*me+1.8760108*fe+.041556*we),Cn(.0556434*me-.2040259*fe+1.0572252*we))}function Kn(gt,Et,Xt){return gt>0?new Se(Math.atan2(Xt,Et)*se,Math.sqrt(Et*Et+Xt*Xt),gt):new Se(NaN,NaN,gt)}function $n(gt){return gt>.206893034?gt*gt*gt:(gt-4/29)/7.787037}function ia(gt){return gt>.008856?Math.pow(gt,1/3):7.787037*gt+4/29}function Cn(gt){return Math.round(255*(gt<=.00304?12.92*gt:1.055*Math.pow(gt,1/2.4)-.055))}u.rgb=Fa;function Fa(gt,Et,Xt){return this instanceof Fa?(this.r=~~gt,this.g=~~Et,void(this.b=~~Xt)):arguments.length<2?gt instanceof Fa?new Fa(gt.r,gt.g,gt.b):br(""+gt,Fa,ra):new Fa(gt,Et,Xt)}function Ga(gt){return new Fa(gt>>16,gt>>8&255,gt&255)}function ve(gt){return Ga(gt)+""}var ge=Fa.prototype=new En;ge.brighter=function(gt){gt=Math.pow(.7,arguments.length?gt:1);var Et=this.r,Xt=this.g,fe=this.b,me=30;return!Et&&!Xt&&!fe?new Fa(me,me,me):(Et&&Et>4,fe=fe>>4|fe,me=or&240,me=me>>4|me,we=or&15,we=we<<4|we):gt.length===7&&(fe=(or&16711680)>>16,me=(or&65280)>>8,we=or&255)),Et(fe,me,we))}function Tr(gt,Et,Xt){var fe=Math.min(gt/=255,Et/=255,Xt/=255),me=Math.max(gt,Et,Xt),we=me-fe,Ve,je,or=(me+fe)/2;return we?(je=or<.5?we/(me+fe):we/(2-me-fe),gt==me?Ve=(Et-Xt)/we+(Et0&&or<1?0:Ve),new gn(Ve,je,or)}function mr(gt,Et,Xt){gt=kr(gt),Et=kr(Et),Xt=kr(Xt);var fe=ia((.4124564*gt+.3575761*Et+.1804375*Xt)/tn),me=ia((.2126729*gt+.7151522*Et+.072175*Xt)/Yr),we=ia((.0193339*gt+.119192*Et+.9503041*Xt)/$r);return tr(116*me-16,500*(fe-me),200*(me-we))}function kr(gt){return(gt/=255)<=.04045?gt/12.92:Math.pow((gt+.055)/1.055,2.4)}function Ur(gt){var Et=parseFloat(gt);return gt.charAt(gt.length-1)==="%"?Math.round(Et*2.55):Et}var Or=u.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Or.forEach(function(gt,Et){Or.set(gt,Ga(Et))});function pe(gt){return typeof gt=="function"?gt:function(){return gt}}u.functor=pe,u.xhr=Ke(B);function Ke(gt){return function(Et,Xt,fe){return arguments.length===2&&typeof Xt=="function"&&(fe=Xt,Xt=null),xr(Et,Xt,gt,fe)}}function xr(gt,Et,Xt,fe){var me={},we=u.dispatch("beforesend","progress","load","error"),Ve={},je=new XMLHttpRequest,or=null;self.XDomainRequest&&!("withCredentials"in je)&&/^(http(s)?:)?\/\//.test(gt)&&(je=new XDomainRequest),"onload"in je?je.onload=je.onerror=Cr:je.onreadystatechange=function(){je.readyState>3&&Cr()};function Cr(){var Sr=je.status,Wr;if(!Sr&&ln(je)||Sr>=200&&Sr<300||Sr===304){try{Wr=Xt.call(me,je)}catch(an){we.error.call(me,an);return}we.load.call(me,Wr)}else we.error.call(me,je)}return je.onprogress=function(Sr){var Wr=u.event;u.event=Sr;try{we.progress.call(me,je)}finally{u.event=Wr}},me.header=function(Sr,Wr){return Sr=(Sr+"").toLowerCase(),arguments.length<2?Ve[Sr]:(Wr==null?delete Ve[Sr]:Ve[Sr]=Wr+"",me)},me.mimeType=function(Sr){return arguments.length?(Et=Sr==null?null:Sr+"",me):Et},me.responseType=function(Sr){return arguments.length?(or=Sr,me):or},me.response=function(Sr){return Xt=Sr,me},["get","post"].forEach(function(Sr){me[Sr]=function(){return me.send.apply(me,[Sr].concat(E(arguments)))}}),me.send=function(Sr,Wr,an){if(arguments.length===2&&typeof Wr=="function"&&(an=Wr,Wr=null),je.open(Sr,gt,!0),Et!=null&&!("accept"in Ve)&&(Ve.accept=Et+",*/*"),je.setRequestHeader)for(var on in Ve)je.setRequestHeader(on,Ve[on]);return Et!=null&&je.overrideMimeType&&je.overrideMimeType(Et),or!=null&&(je.responseType=or),an!=null&&me.on("error",an).on("load",function(ta){an(null,ta)}),we.beforesend.call(me,je),je.send(Wr??null),me},me.abort=function(){return je.abort(),me},u.rebind(me,we,"on"),fe==null?me:me.get(Gr(fe))}function Gr(gt){return gt.length===1?function(Et,Xt){gt(Et==null?Xt:null)}:gt}function ln(gt){var Et=gt.responseType;return Et&&Et!=="text"?gt.response:gt.responseText}u.dsv=function(gt,Et){var Xt=new RegExp('["'+gt+` -]`),fe=gt.charCodeAt(0);function me(Cr,Sr,Wr){arguments.length<3&&(Wr=Sr,Sr=null);var an=xr(Cr,Et,Sr==null?we:Ve(Sr),Wr);return an.row=function(on){return arguments.length?an.response((Sr=on)==null?we:Ve(on)):Sr},an}function we(Cr){return me.parse(Cr.responseText)}function Ve(Cr){return function(Sr){return me.parse(Sr.responseText,Cr)}}me.parse=function(Cr,Sr){var Wr;return me.parseRows(Cr,function(an,on){if(Wr)return Wr(an,on-1);var ta=function(hn){for(var Bn={},Hn=an.length,Yn=0;Yn=ta)return an;if(Yn)return Yn=!1,Wr;var Ha=hn;if(Cr.charCodeAt(Ha)===34){for(var Wa=Ha;Wa++24?(isFinite(Et)&&(clearTimeout(vn),vn=setTimeout(Qa,Et)),Qr=0):(Qr=1,Oa(Qa))}u.timer.flush=function(){Ja(),wi()};function Ja(){for(var gt=Date.now(),Et=wn;Et;)gt>=Et.t&&Et.c(gt-Et.t)&&(Et.c=null),Et=Et.n;return gt}function wi(){for(var gt,Et=wn,Xt=1/0;Et;)Et.c?(Et.t=0;--je)hn.push(me[Cr[Wr[je]][2]]);for(je=+on;je1&&ke(gt[Xt[fe-2]],gt[Xt[fe-1]],gt[me])<=0;)--fe;Xt[fe++]=me}return Xt.slice(0,fe)}function Qi(gt,Et){return gt[0]-Et[0]||gt[1]-Et[1]}u.geom.polygon=function(gt){return Z(gt,Hi),gt};var Hi=u.geom.polygon.prototype=[];Hi.area=function(){for(var gt=-1,Et=this.length,Xt,fe=this[Et-1],me=0;++gtqt)je=je.L;else if(Ve=Et-li(je,Xt),Ve>qt){if(!je.R){fe=je;break}je=je.R}else{we>-qt?(fe=je.P,me=je):Ve>-qt?(fe=je,me=je.N):fe=me=je;break}var or=ts(gt);if(Po.insert(fe,or),!(!fe&&!me)){if(fe===me){is(fe),me=ts(fe.site),Po.insert(or,me),or.edge=me.edge=Is(fe.site,or.site),No(fe),No(me);return}if(!me){or.edge=Is(fe.site,or.site);return}is(fe),is(me);var Cr=fe.site,Sr=Cr.x,Wr=Cr.y,an=gt.x-Sr,on=gt.y-Wr,ta=me.site,hn=ta.x-Sr,Bn=ta.y-Wr,Hn=2*(an*Bn-on*hn),Yn=an*an+on*on,na=hn*hn+Bn*Bn,_n={x:(Bn*Yn-on*na)/Hn+Sr,y:(an*na-hn*Yn)/Hn+Wr};Bi(me.edge,Cr,ta,_n),or.edge=Is(Cr,gt,null,_n),me.edge=Is(gt,ta,null,_n),No(fe),No(me)}}function Da(gt,Et){var Xt=gt.site,fe=Xt.x,me=Xt.y,we=me-Et;if(!we)return fe;var Ve=gt.P;if(!Ve)return-1/0;Xt=Ve.site;var je=Xt.x,or=Xt.y,Cr=or-Et;if(!Cr)return je;var Sr=je-fe,Wr=1/we-1/Cr,an=Sr/Cr;return Wr?(-an+Math.sqrt(an*an-2*Wr*(Sr*Sr/(-2*Cr)-or+Cr/2+me-we/2)))/Wr+fe:(fe+je)/2}function li(gt,Et){var Xt=gt.N;if(Xt)return Da(Xt,Et);var fe=gt.site;return fe.y===Et?fe.x:1/0}function wo(gt){this.site=gt,this.edges=[]}wo.prototype.prepare=function(){for(var gt=this.edges,Et=gt.length,Xt;Et--;)Xt=gt[Et].edge,(!Xt.b||!Xt.a)&>.splice(Et,1);return gt.sort(Di),gt.length};function Ms(gt){for(var Et=gt[0][0],Xt=gt[1][0],fe=gt[0][1],me=gt[1][1],we,Ve,je,or,Cr=qo,Sr=Cr.length,Wr,an,on,ta,hn,Bn;Sr--;)if(Wr=Cr[Sr],!(!Wr||!Wr.prepare()))for(on=Wr.edges,ta=on.length,an=0;anqt||l(or-Ve)>qt)&&(on.splice(an,0,new $s(Wo(Wr.site,Bn,l(je-Et)qt?{x:Et,y:l(we-Et)qt?{x:l(Ve-me)qt?{x:Xt,y:l(we-Xt)qt?{x:l(Ve-fe)=-_t)){var on=or*or+Cr*Cr,ta=Sr*Sr+Wr*Wr,hn=(Wr*on-Cr*ta)/an,Bn=(or*ta-Sr*on)/an,Wr=Bn+je,Hn=yi.pop()||new _s;Hn.arc=gt,Hn.site=me,Hn.x=hn+Ve,Hn.y=Wr+Math.sqrt(hn*hn+Bn*Bn),Hn.cy=Wr,gt.circle=Hn;for(var Yn=null,na=uo._;na;)if(Hn.y0)){if(hn/=on,on<0){if(hn0){if(hn>an)return;hn>Wr&&(Wr=hn)}if(hn=Xt-je,!(!on&&hn<0)){if(hn/=on,on<0){if(hn>an)return;hn>Wr&&(Wr=hn)}else if(on>0){if(hn0)){if(hn/=ta,ta<0){if(hn0){if(hn>an)return;hn>Wr&&(Wr=hn)}if(hn=fe-or,!(!ta&&hn<0)){if(hn/=ta,ta<0){if(hn>an)return;hn>Wr&&(Wr=hn)}else if(ta>0){if(hn0&&(me.a={x:je+Wr*on,y:or+Wr*ta}),an<1&&(me.b={x:je+an*on,y:or+an*ta}),me}}}}}}function ii(gt){for(var Et=qi,Xt=al(gt[0][0],gt[0][1],gt[1][0],gt[1][1]),fe=Et.length,me;fe--;)me=Et[fe],(!io(me,gt)||!Xt(me)||l(me.a.x-me.b.x)=we)return;if(Sr>an){if(!fe)fe={x:ta,y:Ve};else if(fe.y>=je)return;Xt={x:ta,y:je}}else{if(!fe)fe={x:ta,y:je};else if(fe.y1)if(Sr>an){if(!fe)fe={x:(Ve-Hn)/Bn,y:Ve};else if(fe.y>=je)return;Xt={x:(je-Hn)/Bn,y:je}}else{if(!fe)fe={x:(je-Hn)/Bn,y:je};else if(fe.y=we)return;Xt={x:we,y:Bn*we+Hn}}else{if(!fe)fe={x:we,y:Bn*we+Hn};else if(fe.x=Sr&&Hn.x<=an&&Hn.y>=Wr&&Hn.y<=on?[[Sr,on],[an,on],[an,Wr],[Sr,Wr]]:[];Yn.point=or[hn]}),Cr}function je(or){return or.map(function(Cr,Sr){return{x:Math.round(fe(Cr,Sr)/qt)*qt,y:Math.round(me(Cr,Sr)/qt)*qt,i:Sr}})}return Ve.links=function(or){return xl(je(or)).edges.filter(function(Cr){return Cr.l&&Cr.r}).map(function(Cr){return{source:or[Cr.l.i],target:or[Cr.r.i]}})},Ve.triangles=function(or){var Cr=[];return xl(je(or)).cells.forEach(function(Sr,Wr){for(var an=Sr.site,on=Sr.edges.sort(Di),ta=-1,hn=on.length,Bn,Hn,Yn=on[hn-1].edge,na=Yn.l===an?Yn.r:Yn.l;++tana&&(na=Sr.x),Sr.y>_n&&(_n=Sr.y),on.push(Sr.x),ta.push(Sr.y);else for(hn=0;hnna&&(na=Ha),Wa>_n&&(_n=Wa),on.push(Ha),ta.push(Wa)}var ri=na-Hn,xi=_n-Yn;ri>xi?_n=Yn+ri:na=Hn+xi;function ki(Ii,Ji,es,pl,Ns,fi,Ao,Bo){if(!(isNaN(es)||isNaN(pl)))if(Ii.leaf){var Ds=Ii.x,Ts=Ii.y;if(Ds!=null)if(l(Ds-es)+l(Ts-pl)<.01)zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo);else{var lu=Ii.point;Ii.x=Ii.y=Ii.point=null,zi(Ii,lu,Ds,Ts,Ns,fi,Ao,Bo),zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}else Ii.x=es,Ii.y=pl,Ii.point=Ji}else zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}function zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo){var Ds=(Ns+Ao)*.5,Ts=(fi+Bo)*.5,lu=es>=Ds,ps=pl>=Ts,zs=ps<<1|lu;Ii.leaf=!1,Ii=Ii.nodes[zs]||(Ii.nodes[zs]=cs()),lu?Ns=Ds:Ao=Ds,ps?fi=Ts:Bo=Ts,ki(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}var jo=cs();if(jo.add=function(Ii){ki(jo,Ii,+Wr(Ii,++hn),+an(Ii,hn),Hn,Yn,na,_n)},jo.visit=function(Ii){Gl(Ii,jo,Hn,Yn,na,_n)},jo.find=function(Ii){return zc(jo,Ii[0],Ii[1],Hn,Yn,na,_n)},hn=-1,Et==null){for(;++hnwe||an>Ve||on=Ha,xi=Xt>=Wa,ki=xi<<1|ri,zi=ki+4;kiXt&&(we=Et.slice(Xt,we),je[Ve]?je[Ve]+=we:je[++Ve]=we),(fe=fe[0])===(me=me[0])?je[Ve]?je[Ve]+=me:je[++Ve]=me:(je[++Ve]=null,or.push({i:Ve,x:Ml(fe,me)})),Xt=bl.lastIndex;return Xt=0&&!(fe=u.interpolators[Xt](gt,Et)););return fe}u.interpolators=[function(gt,Et){var Xt=typeof Et;return(Xt==="string"?Or.has(Et.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Et)?Al:hu:Et instanceof En?Al:Array.isArray(Et)?bs:Xt==="object"&&isNaN(Et)?_l:Ml)(gt,Et)}],u.interpolateArray=bs;function bs(gt,Et){var Xt=[],fe=[],me=gt.length,we=Et.length,Ve=Math.min(gt.length,Et.length),je;for(je=0;je=0?gt.slice(0,Et):gt,fe=Et>=0?gt.slice(Et+1):"in";return Xt=Nl.get(Xt)||Iu,fe=Hu.get(fe)||B,qs(fe(Xt.apply(null,d.call(arguments,1))))};function qs(gt){return function(Et){return Et<=0?0:Et>=1?1:gt(Et)}}function sf(gt){return function(Et){return 1-gt(1-Et)}}function Oo(gt){return function(Et){return .5*(Et<.5?gt(2*Et):2-gt(2-2*Et))}}function yf(gt){return gt*gt}function os(gt){return gt*gt*gt}function Fi(gt){if(gt<=0)return 0;if(gt>=1)return 1;var Et=gt*gt,Xt=Et*gt;return 4*(gt<.5?Xt:3*(gt-Et)+Xt-.75)}function nc(gt){return function(Et){return Math.pow(Et,gt)}}function pu(gt){return 1-Math.cos(gt*Ht)}function ml(gt){return Math.pow(2,10*(gt-1))}function Lc(gt){return 1-Math.sqrt(1-gt*gt)}function qu(gt,Et){var Xt;return arguments.length<2&&(Et=.45),arguments.length?Xt=Et/yt*Math.asin(1/gt):(gt=1,Xt=Et/4),function(fe){return 1+gt*Math.pow(2,-10*fe)*Math.sin((fe-Xt)*yt/Et)}}function dc(gt){return gt||(gt=1.70158),function(Et){return Et*Et*((gt+1)*Et-gt)}}function wl(gt){return gt<1/2.75?7.5625*gt*gt:gt<2/2.75?7.5625*(gt-=1.5/2.75)*gt+.75:gt<2.5/2.75?7.5625*(gt-=2.25/2.75)*gt+.9375:7.5625*(gt-=2.625/2.75)*gt+.984375}u.interpolateHcl=Yc;function Yc(gt,Et){gt=u.hcl(gt),Et=u.hcl(Et);var Xt=gt.h,fe=gt.c,me=gt.l,we=Et.h-Xt,Ve=Et.c-fe,je=Et.l-me;return isNaN(Ve)&&(Ve=0,fe=isNaN(fe)?Et.c:fe),isNaN(we)?(we=0,Xt=isNaN(Xt)?Et.h:Xt):we>180?we-=360:we<-180&&(we+=360),function(or){return Ze(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateHsl=Fc;function Fc(gt,Et){gt=u.hsl(gt),Et=u.hsl(Et);var Xt=gt.h,fe=gt.s,me=gt.l,we=Et.h-Xt,Ve=Et.s-fe,je=Et.l-me;return isNaN(Ve)&&(Ve=0,fe=isNaN(fe)?Et.s:fe),isNaN(we)?(we=0,Xt=isNaN(Xt)?Et.h:Xt):we>180?we-=360:we<-180&&(we+=360),function(or){return ra(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateLab=mc;function mc(gt,Et){gt=u.lab(gt),Et=u.lab(Et);var Xt=gt.l,fe=gt.a,me=gt.b,we=Et.l-Xt,Ve=Et.a-fe,je=Et.b-me;return function(or){return Nn(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateRound=Wu;function Wu(gt,Et){return Et-=gt,function(Xt){return Math.round(gt+Et*Xt)}}u.transform=function(gt){var Et=A.createElementNS(u.ns.prefix.svg,"g");return(u.transform=function(Xt){if(Xt!=null){Et.setAttribute("transform",Xt);var fe=Et.transform.baseVal.consolidate()}return new Cc(fe?fe.matrix:Pu)})(gt)};function Cc(gt){var Et=[gt.a,gt.b],Xt=[gt.c,gt.d],fe=du(Et),me=Ic(Et,Xt),we=du(Bc(Xt,Et,-me))||0;Et[0]*Xt[1]180?Et+=360:Et-gt>180&&(gt+=360),fe.push({i:Xt.push(wu(Xt)+"rotate(",null,")")-2,x:Ml(gt,Et)})):Et&&Xt.push(wu(Xt)+"rotate("+Et+")")}function Pc(gt,Et,Xt,fe){gt!==Et?fe.push({i:Xt.push(wu(Xt)+"skewX(",null,")")-2,x:Ml(gt,Et)}):Et&&Xt.push(wu(Xt)+"skewX("+Et+")")}function Es(gt,Et,Xt,fe){if(gt[0]!==Et[0]||gt[1]!==Et[1]){var me=Xt.push(wu(Xt)+"scale(",null,",",null,")");fe.push({i:me-4,x:Ml(gt[0],Et[0])},{i:me-2,x:Ml(gt[1],Et[1])})}else(Et[0]!==1||Et[1]!==1)&&Xt.push(wu(Xt)+"scale("+Et+")")}function _c(gt,Et){var Xt=[],fe=[];return gt=u.transform(gt),Et=u.transform(Et),Tl(gt.translate,Et.translate,Xt,fe),Ju(gt.rotate,Et.rotate,Xt,fe),Pc(gt.skew,Et.skew,Xt,fe),Es(gt.scale,Et.scale,Xt,fe),gt=Et=null,function(me){for(var we=-1,Ve=fe.length,je;++we0?we=_n:(Xt.c=null,Xt.t=NaN,Xt=null,Et.end({type:"end",alpha:we=0})):_n>0&&(Et.start({type:"start",alpha:we=_n}),Xt=Qn(gt.tick)),gt):we},gt.start=function(){var _n,Ha=on.length,Wa=ta.length,ri=fe[0],xi=fe[1],ki,zi;for(_n=0;_n=0;)we.push(Sr=Cr[or]),Sr.parent=je,Sr.depth=je.depth+1;Xt&&(je.value=0),je.children=Cr}else Xt&&(je.value=+Xt.call(fe,je,je.depth)||0),delete je.children;return Tu(me,function(Wr){var an,on;gt&&(an=Wr.children)&&an.sort(gt),Xt&&(on=Wr.parent)&&(on.value+=Wr.value)}),Ve}return fe.sort=function(me){return arguments.length?(gt=me,fe):gt},fe.children=function(me){return arguments.length?(Et=me,fe):Et},fe.value=function(me){return arguments.length?(Xt=me,fe):Xt},fe.revalue=function(me){return Xt&&(ac(me,function(we){we.children&&(we.value=0)}),Tu(me,function(we){var Ve;we.children||(we.value=+Xt.call(fe,we,we.depth)||0),(Ve=we.parent)&&(Ve.value+=we.value)})),me},fe};function Ws(gt,Et){return u.rebind(gt,Et,"sort","children","value"),gt.nodes=gt,gt.links=Sf,gt}function ac(gt,Et){for(var Xt=[gt];(gt=Xt.pop())!=null;)if(Et(gt),(me=gt.children)&&(fe=me.length))for(var fe,me;--fe>=0;)Xt.push(me[fe])}function Tu(gt,Et){for(var Xt=[gt],fe=[];(gt=Xt.pop())!=null;)if(fe.push(gt),(Ve=gt.children)&&(we=Ve.length))for(var me=-1,we,Ve;++meme&&(me=je),fe.push(je)}for(Ve=0;Vefe&&(Xt=Et,fe=me);return Xt}function Du(gt){return gt.reduce(Xl,0)}function Xl(gt,Et){return gt+Et[1]}u.layout.histogram=function(){var gt=!0,Et=Number,Xt=vc,fe=Xc;function me(we,Ve){for(var je=[],or=we.map(Et,this),Cr=Xt.call(this,or,Ve),Sr=fe.call(this,Cr,or,Ve),Wr,Ve=-1,an=or.length,on=Sr.length-1,ta=gt?1:1/an,hn;++Ve0)for(Ve=-1;++Ve=Cr[0]&&hn<=Cr[1]&&(Wr=je[u.bisect(Sr,hn,1,on)-1],Wr.y+=ta,Wr.push(we[Ve]));return je}return me.value=function(we){return arguments.length?(Et=we,me):Et},me.range=function(we){return arguments.length?(Xt=pe(we),me):Xt},me.bins=function(we){return arguments.length?(fe=typeof we=="number"?function(Ve){return Vs(Ve,we)}:pe(we),me):fe},me.frequency=function(we){return arguments.length?(gt=!!we,me):gt},me};function Xc(gt,Et){return Vs(gt,Math.ceil(Math.log(Et.length)/Math.LN2+1))}function Vs(gt,Et){for(var Xt=-1,fe=+gt[0],me=(gt[1]-fe)/Et,we=[];++Xt<=Et;)we[Xt]=me*Xt+fe;return we}function vc(gt){return[u.min(gt),u.max(gt)]}u.layout.pack=function(){var gt=u.layout.hierarchy().sort(Ku),Et=0,Xt=[1,1],fe;function me(we,Ve){var je=gt.call(this,we,Ve),or=je[0],Cr=Xt[0],Sr=Xt[1],Wr=fe==null?Math.sqrt:typeof fe=="function"?fe:function(){return fe};if(or.x=or.y=0,Tu(or,function(on){on.r=+Wr(on.value)}),Tu(or,yc),Et){var an=Et*(fe?1:Math.max(2*or.r/Cr,2*or.r/Sr))/2;Tu(or,function(on){on.r+=an}),Tu(or,yc),Tu(or,function(on){on.r-=an})}return Uc(or,Cr/2,Sr/2,fe?1:1/Math.max(2*or.r/Cr,2*or.r/Sr)),je}return me.size=function(we){return arguments.length?(Xt=we,me):Xt},me.radius=function(we){return arguments.length?(fe=we==null||typeof we=="function"?we:+we,me):fe},me.padding=function(we){return arguments.length?(Et=+we,me):Et},Ws(me,gt)};function Ku(gt,Et){return gt.value-Et.value}function ou(gt,Et){var Xt=gt._pack_next;gt._pack_next=Et,Et._pack_prev=gt,Et._pack_next=Xt,Xt._pack_prev=Et}function Qu(gt,Et){gt._pack_next=Et,Et._pack_prev=gt}function Yu(gt,Et){var Xt=Et.x-gt.x,fe=Et.y-gt.y,me=gt.r+Et.r;return .999*me*me>Xt*Xt+fe*fe}function yc(gt){if(!(Et=gt.children)||!(an=Et.length))return;var Et,Xt=1/0,fe=-1/0,me=1/0,we=-1/0,Ve,je,or,Cr,Sr,Wr,an;function on(_n){Xt=Math.min(_n.x-_n.r,Xt),fe=Math.max(_n.x+_n.r,fe),me=Math.min(_n.y-_n.r,me),we=Math.max(_n.y+_n.r,we)}if(Et.forEach(cf),Ve=Et[0],Ve.x=-Ve.r,Ve.y=0,on(Ve),an>1&&(je=Et[1],je.x=je.r,je.y=0,on(je),an>2))for(or=Et[2],su(Ve,je,or),on(or),ou(Ve,or),Ve._pack_prev=or,ou(or,je),je=Ve._pack_next,Cr=3;CrBn.x&&(Bn=Ha),Ha.depth>Hn.depth&&(Hn=Ha)});var Yn=Et(hn,Bn)/2-hn.x,na=Xt[0]/(Bn.x+Et(Bn,hn)/2+Yn),_n=Xt[1]/(Hn.depth||1);ac(on,function(Ha){Ha.x=(Ha.x+Yn)*na,Ha.y=Ha.depth*_n})}return an}function we(Sr){for(var Wr={A:null,children:[Sr]},an=[Wr],on;(on=an.pop())!=null;)for(var ta=on.children,hn,Bn=0,Hn=ta.length;Bn0&&(Cs(lc(hn,Sr,an),Sr,Ha),Hn+=Ha,Yn+=Ha),na+=hn.m,Hn+=on.m,_n+=Bn.m,Yn+=ta.m;hn&&!il(ta)&&(ta.t=hn,ta.m+=na-Yn),on&&!Au(Bn)&&(Bn.t=on,Bn.m+=Hn-_n,an=Sr)}return an}function Cr(Sr){Sr.x*=Xt[0],Sr.y=Sr.depth*Xt[1]}return me.separation=function(Sr){return arguments.length?(Et=Sr,me):Et},me.size=function(Sr){return arguments.length?(fe=(Xt=Sr)==null?Cr:null,me):fe?null:Xt},me.nodeSize=function(Sr){return arguments.length?(fe=(Xt=Sr)==null?null:Cr,me):fe?Xt:null},Ws(me,gt)};function Fu(gt,Et){return gt.parent==Et.parent?1:2}function Au(gt){var Et=gt.children;return Et.length?Et[0]:gt.t}function il(gt){var Et=gt.children,Xt;return(Xt=Et.length)?Et[Xt-1]:gt.t}function Cs(gt,Et,Xt){var fe=Xt/(Et.i-gt.i);Et.c-=fe,Et.s+=Xt,gt.c+=fe,Et.z+=Xt,Et.m+=Xt}function Mu(gt){for(var Et=0,Xt=0,fe=gt.children,me=fe.length,we;--me>=0;)we=fe[me],we.z+=Et,we.m+=Et,Et+=we.s+(Xt+=we.c)}function lc(gt,Et,Xt){return gt.a.parent===Et.parent?gt.a:Xt}u.layout.cluster=function(){var gt=u.layout.hierarchy().sort(null).value(null),Et=Fu,Xt=[1,1],fe=!1;function me(we,Ve){var je=gt.call(this,we,Ve),or=je[0],Cr,Sr=0;Tu(or,function(hn){var Bn=hn.children;Bn&&Bn.length?(hn.x=Oc(Bn),hn.y=Su(Bn)):(hn.x=Cr?Sr+=Et(hn,Cr):0,hn.y=0,Cr=hn)});var Wr=Xe(or),an=yr(or),on=Wr.x-Et(Wr,an)/2,ta=an.x+Et(an,Wr)/2;return Tu(or,fe?function(hn){hn.x=(hn.x-or.x)*Xt[0],hn.y=(or.y-hn.y)*Xt[1]}:function(hn){hn.x=(hn.x-on)/(ta-on)*Xt[0],hn.y=(1-(or.y?hn.y/or.y:1))*Xt[1]}),je}return me.separation=function(we){return arguments.length?(Et=we,me):Et},me.size=function(we){return arguments.length?(fe=(Xt=we)==null,me):fe?null:Xt},me.nodeSize=function(we){return arguments.length?(fe=(Xt=we)!=null,me):fe?Xt:null},Ws(me,gt)};function Su(gt){return 1+u.max(gt,function(Et){return Et.y})}function Oc(gt){return gt.reduce(function(Et,Xt){return Et+Xt.x},0)/gt.length}function Xe(gt){var Et=gt.children;return Et&&Et.length?Xe(Et[0]):gt}function yr(gt){var Et=gt.children,Xt;return Et&&(Xt=Et.length)?yr(Et[Xt-1]):gt}u.layout.treemap=function(){var gt=u.layout.hierarchy(),Et=Math.round,Xt=[1,1],fe=null,me=Kr,we=!1,Ve,je="squarify",or=.5*(1+Math.sqrt(5));function Cr(hn,Bn){for(var Hn=-1,Yn=hn.length,na,_n;++Hn0;)Yn.push(_n=na[xi-1]),Yn.area+=_n.area,je!=="squarify"||(Wa=an(Yn,ri))<=Ha?(na.pop(),Ha=Wa):(Yn.area-=Yn.pop().area,on(Yn,ri,Hn,!1),ri=Math.min(Hn.dx,Hn.dy),Yn.length=Yn.area=0,Ha=1/0);Yn.length&&(on(Yn,ri,Hn,!0),Yn.length=Yn.area=0),Bn.forEach(Sr)}}function Wr(hn){var Bn=hn.children;if(Bn&&Bn.length){var Hn=me(hn),Yn=Bn.slice(),na,_n=[];for(Cr(Yn,Hn.dx*Hn.dy/hn.value),_n.area=0;na=Yn.pop();)_n.push(na),_n.area+=na.area,na.z!=null&&(on(_n,na.z?Hn.dx:Hn.dy,Hn,!Yn.length),_n.length=_n.area=0);Bn.forEach(Wr)}}function an(hn,Bn){for(var Hn=hn.area,Yn,na=0,_n=1/0,Ha=-1,Wa=hn.length;++Hana&&(na=Yn));return Hn*=Hn,Bn*=Bn,Hn?Math.max(Bn*na*or/Hn,Hn/(Bn*_n*or)):1/0}function on(hn,Bn,Hn,Yn){var na=-1,_n=hn.length,Ha=Hn.x,Wa=Hn.y,ri=Bn?Et(hn.area/Bn):0,xi;if(Bn==Hn.dx){for((Yn||ri>Hn.dy)&&(ri=Hn.dy);++na<_n;)xi=hn[na],xi.x=Ha,xi.y=Wa,xi.dy=ri,Ha+=xi.dx=Math.min(Hn.x+Hn.dx-Ha,ri?Et(xi.area/ri):0);xi.z=!0,xi.dx+=Hn.x+Hn.dx-Ha,Hn.y+=ri,Hn.dy-=ri}else{for((Yn||ri>Hn.dx)&&(ri=Hn.dx);++na<_n;)xi=hn[na],xi.x=Ha,xi.y=Wa,xi.dx=ri,Wa+=xi.dy=Math.min(Hn.y+Hn.dy-Wa,ri?Et(xi.area/ri):0);xi.z=!1,xi.dy+=Hn.y+Hn.dy-Wa,Hn.x+=ri,Hn.dx-=ri}}function ta(hn){var Bn=Ve||gt(hn),Hn=Bn[0];return Hn.x=Hn.y=0,Hn.value?(Hn.dx=Xt[0],Hn.dy=Xt[1]):Hn.dx=Hn.dy=0,Ve&>.revalue(Hn),Cr([Hn],Hn.dx*Hn.dy/Hn.value),(Ve?Wr:Sr)(Hn),we&&(Ve=Bn),Bn}return ta.size=function(hn){return arguments.length?(Xt=hn,ta):Xt},ta.padding=function(hn){if(!arguments.length)return fe;function Bn(na){var _n=hn.call(ta,na,na.depth);return _n==null?Kr(na):Rr(na,typeof _n=="number"?[_n,_n,_n,_n]:_n)}function Hn(na){return Rr(na,hn)}var Yn;return me=(fe=hn)==null?Kr:(Yn=typeof hn)=="function"?Bn:(Yn==="number"&&(hn=[hn,hn,hn,hn]),Hn),ta},ta.round=function(hn){return arguments.length?(Et=hn?Math.round:Number,ta):Et!=Number},ta.sticky=function(hn){return arguments.length?(we=hn,Ve=null,ta):we},ta.ratio=function(hn){return arguments.length?(or=hn,ta):or},ta.mode=function(hn){return arguments.length?(je=hn+"",ta):je},Ws(ta,gt)};function Kr(gt){return{x:gt.x,y:gt.y,dx:gt.dx,dy:gt.dy}}function Rr(gt,Et){var Xt=gt.x+Et[3],fe=gt.y+Et[0],me=gt.dx-Et[1]-Et[3],we=gt.dy-Et[0]-Et[2];return me<0&&(Xt+=me/2,me=0),we<0&&(fe+=we/2,we=0),{x:Xt,y:fe,dx:me,dy:we}}u.random={normal:function(gt,Et){var Xt=arguments.length;return Xt<2&&(Et=1),Xt<1&&(gt=0),function(){var fe,me,we;do fe=Math.random()*2-1,me=Math.random()*2-1,we=fe*fe+me*me;while(!we||we>1);return gt+Et*fe*Math.sqrt(-2*Math.log(we)/we)}},logNormal:function(){var gt=u.random.normal.apply(u,arguments);return function(){return Math.exp(gt())}},bates:function(gt){var Et=u.random.irwinHall(gt);return function(){return Et()/gt}},irwinHall:function(gt){return function(){for(var Et=0,Xt=0;Xt2?va:ha,Cr=fe?Rc:lf;return me=or(gt,Et,Cr,Xt),we=or(Et,gt,Cr,Fo),je}function je(or){return me(or)}return je.invert=function(or){return we(or)},je.domain=function(or){return arguments.length?(gt=or.map(Number),Ve()):gt},je.range=function(or){return arguments.length?(Et=or,Ve()):Et},je.rangeRound=function(or){return je.range(or).interpolate(Wu)},je.clamp=function(or){return arguments.length?(fe=or,Ve()):fe},je.interpolate=function(or){return arguments.length?(Xt=or,Ve()):Xt},je.ticks=function(or){return Vi(gt,or)},je.tickFormat=function(or,Cr){return d3_scale_linearTickFormat(gt,or,Cr)},je.nice=function(or){return ca(gt,or),Ve()},je.copy=function(){return Ba(gt,Et,Xt,fe)},Ve()}function za(gt,Et){return u.rebind(gt,Et,"range","rangeRound","interpolate","clamp")}function ca(gt,Et){return Ta(gt,Ua(ei(gt,Et)[2])),Ta(gt,Ua(ei(gt,Et)[2])),gt}function ei(gt,Et){Et==null&&(Et=10);var Xt=mn(gt),fe=Xt[1]-Xt[0],me=Math.pow(10,Math.floor(Math.log(fe/Et)/Math.LN10)),we=Et/fe*me;return we<=.15?me*=10:we<=.35?me*=5:we<=.75&&(me*=2),Xt[0]=Math.ceil(Xt[0]/me)*me,Xt[1]=Math.floor(Xt[1]/me)*me+me*.5,Xt[2]=me,Xt}function Vi(gt,Et){return u.range.apply(u,ei(gt,Et))}u.scale.log=function(){return Oi(u.scale.linear().domain([0,1]),10,!0,[1,10])};function Oi(gt,Et,Xt,fe){function me(je){return(Xt?Math.log(je<0?0:je):-Math.log(je>0?0:-je))/Math.log(Et)}function we(je){return Xt?Math.pow(Et,je):-Math.pow(Et,-je)}function Ve(je){return gt(me(je))}return Ve.invert=function(je){return we(gt.invert(je))},Ve.domain=function(je){return arguments.length?(Xt=je[0]>=0,gt.domain((fe=je.map(Number)).map(me)),Ve):fe},Ve.base=function(je){return arguments.length?(Et=+je,gt.domain(fe.map(me)),Ve):Et},Ve.nice=function(){var je=Ta(fe.map(me),Xt?Math:Wi);return gt.domain(je),fe=je.map(we),Ve},Ve.ticks=function(){var je=mn(fe),or=[],Cr=je[0],Sr=je[1],Wr=Math.floor(me(Cr)),an=Math.ceil(me(Sr)),on=Et%1?2:Et;if(isFinite(an-Wr)){if(Xt){for(;Wr0;ta--)or.push(we(Wr)*ta);for(Wr=0;or[Wr]Sr;an--);or=or.slice(Wr,an)}return or},Ve.copy=function(){return Oi(gt.copy(),Et,Xt,fe)},za(Ve,gt)}var Wi={floor:function(gt){return-Math.ceil(-gt)},ceil:function(gt){return-Math.floor(-gt)}};u.scale.pow=function(){return Xi(u.scale.linear(),1,[0,1])};function Xi(gt,Et,Xt){var fe=ni(Et),me=ni(1/Et);function we(Ve){return gt(fe(Ve))}return we.invert=function(Ve){return me(gt.invert(Ve))},we.domain=function(Ve){return arguments.length?(gt.domain((Xt=Ve.map(Number)).map(fe)),we):Xt},we.ticks=function(Ve){return Vi(Xt,Ve)},we.tickFormat=function(Ve,je){return d3_scale_linearTickFormat(Xt,Ve,je)},we.nice=function(Ve){return we.domain(ca(Xt,Ve))},we.exponent=function(Ve){return arguments.length?(fe=ni(Et=Ve),me=ni(1/Et),gt.domain(Xt.map(fe)),we):Et},we.copy=function(){return Xi(gt.copy(),Et,Xt)},za(we,gt)}function ni(gt){return function(Et){return Et<0?-Math.pow(-Et,gt):Math.pow(Et,gt)}}u.scale.sqrt=function(){return u.scale.pow().exponent(.5)},u.scale.ordinal=function(){return Za([],{t:"range",a:[[]]})};function Za(gt,Et){var Xt,fe,me;function we(je){return fe[((Xt.get(je)||(Et.t==="range"?Xt.set(je,gt.push(je)):NaN))-1)%fe.length]}function Ve(je,or){return u.range(gt.length).map(function(Cr){return je+or*Cr})}return we.domain=function(je){if(!arguments.length)return gt;gt=[],Xt=new S;for(var or=-1,Cr=je.length,Sr;++or0?Xt[we-1]:gt[0],wean?0:1;if(Sr=St)return or(Sr,ta)+(Cr?or(Cr,1-ta):"")+"Z";var hn,Bn,Hn,Yn,na=0,_n=0,Ha,Wa,ri,xi,ki,zi,jo,Ii,Ji=[];if((Yn=(+Ve.apply(this,arguments)||0)/2)&&(Hn=fe===Rs?Math.sqrt(Cr*Cr+Sr*Sr):+fe.apply(this,arguments),ta||(_n*=-1),Sr&&(_n=Ee(Hn/Sr*Math.sin(Yn))),Cr&&(na=Ee(Hn/Cr*Math.sin(Yn)))),Sr){Ha=Sr*Math.cos(Wr+_n),Wa=Sr*Math.sin(Wr+_n),ri=Sr*Math.cos(an-_n),xi=Sr*Math.sin(an-_n);var es=Math.abs(an-Wr-2*_n)<=lt?0:1;if(_n&&$l(Ha,Wa,ri,xi)===ta^es){var pl=(Wr+an)/2;Ha=Sr*Math.cos(pl),Wa=Sr*Math.sin(pl),ri=xi=null}}else Ha=Wa=0;if(Cr){ki=Cr*Math.cos(an-na),zi=Cr*Math.sin(an-na),jo=Cr*Math.cos(Wr+na),Ii=Cr*Math.sin(Wr+na);var Ns=Math.abs(Wr-an+2*na)<=lt?0:1;if(na&&$l(ki,zi,jo,Ii)===1-ta^Ns){var fi=(Wr+an)/2;ki=Cr*Math.cos(fi),zi=Cr*Math.sin(fi),jo=Ii=null}}else ki=zi=0;if(on>qt&&(hn=Math.min(Math.abs(Sr-Cr)/2,+Xt.apply(this,arguments)))>.001){Bn=Cr0?0:1}function jl(gt,Et,Xt,fe,me){var we=gt[0]-Et[0],Ve=gt[1]-Et[1],je=(me?fe:-fe)/Math.sqrt(we*we+Ve*Ve),or=je*Ve,Cr=-je*we,Sr=gt[0]+or,Wr=gt[1]+Cr,an=Et[0]+or,on=Et[1]+Cr,ta=(Sr+an)/2,hn=(Wr+on)/2,Bn=an-Sr,Hn=on-Wr,Yn=Bn*Bn+Hn*Hn,na=Xt-fe,_n=Sr*on-an*Wr,Ha=(Hn<0?-1:1)*Math.sqrt(Math.max(0,na*na*Yn-_n*_n)),Wa=(_n*Hn-Bn*Ha)/Yn,ri=(-_n*Bn-Hn*Ha)/Yn,xi=(_n*Hn+Bn*Ha)/Yn,ki=(-_n*Bn+Hn*Ha)/Yn,zi=Wa-ta,jo=ri-hn,Ii=xi-ta,Ji=ki-hn;return zi*zi+jo*jo>Ii*Ii+Ji*Ji&&(Wa=xi,ri=ki),[[Wa-or,ri-Cr],[Wa*Xt/na,ri*Xt/na]]}function Bu(){return!0}function Jl(gt){var Et=ci,Xt=Ti,fe=Bu,me=nl,we=me.key,Ve=.7;function je(or){var Cr=[],Sr=[],Wr=-1,an=or.length,on,ta=pe(Et),hn=pe(Xt);function Bn(){Cr.push("M",me(gt(Sr),Ve))}for(;++Wr1?gt.join("L"):gt+"Z"}function Nu(gt){return gt.join("L")+"Z"}function Ui(gt){for(var Et=0,Xt=gt.length,fe=gt[0],me=[fe[0],",",fe[1]];++Et1&&me.push("H",fe[0]),me.join("")}function fo(gt){for(var Et=0,Xt=gt.length,fe=gt[0],me=[fe[0],",",fe[1]];++Et1){je=Et[1],we=gt[or],or++,fe+="C"+(me[0]+Ve[0])+","+(me[1]+Ve[1])+","+(we[0]-je[0])+","+(we[1]-je[1])+","+we[0]+","+we[1];for(var Cr=2;Cr9&&(we=Xt*3/Math.sqrt(we),Ve[je]=we*fe,Ve[je+1]=we*me));for(je=-1;++je<=or;)we=(gt[Math.min(or,je+1)][0]-gt[Math.max(0,je-1)][0])/(6*(1+Ve[je]*Ve[je])),Et.push([we||0,Ve[je]*we||0]);return Et}function Gt(gt){return gt.length<3?nl(gt):gt[0]+L(gt,Rt(gt))}u.svg.line.radial=function(){var gt=Jl(ae);return gt.radius=gt.x,delete gt.x,gt.angle=gt.y,delete gt.y,gt};function ae(gt){for(var Et,Xt=-1,fe=gt.length,me,we;++Xtlt)+",1 "+Wr}function Cr(Sr,Wr,an,on){return"Q 0,0 "+on}return we.radius=function(Sr){return arguments.length?(Xt=pe(Sr),we):Xt},we.source=function(Sr){return arguments.length?(gt=pe(Sr),we):gt},we.target=function(Sr){return arguments.length?(Et=pe(Sr),we):Et},we.startAngle=function(Sr){return arguments.length?(fe=pe(Sr),we):fe},we.endAngle=function(Sr){return arguments.length?(me=pe(Sr),we):me},we};function ze(gt){return gt.radius}u.svg.diagonal=function(){var gt=Te,Et=ye,Xt=rr;function fe(me,we){var Ve=gt.call(this,me,we),je=Et.call(this,me,we),or=(Ve.y+je.y)/2,Cr=[Ve,{x:Ve.x,y:or},{x:je.x,y:or},je];return Cr=Cr.map(Xt),"M"+Cr[0]+"C"+Cr[1]+" "+Cr[2]+" "+Cr[3]}return fe.source=function(me){return arguments.length?(gt=pe(me),fe):gt},fe.target=function(me){return arguments.length?(Et=pe(me),fe):Et},fe.projection=function(me){return arguments.length?(Xt=me,fe):Xt},fe};function rr(gt){return[gt.x,gt.y]}u.svg.diagonal.radial=function(){var gt=u.svg.diagonal(),Et=rr,Xt=gt.projection;return gt.projection=function(fe){return arguments.length?Xt(fr(Et=fe)):Et},gt};function fr(gt){return function(){var Et=gt.apply(this,arguments),Xt=Et[0],fe=Et[1]-Ht;return[Xt*Math.cos(fe),Xt*Math.sin(fe)]}}u.svg.symbol=function(){var gt=Lr,Et=gr;function Xt(fe,me){return(nn.get(gt.call(this,fe,me))||Hr)(Et.call(this,fe,me))}return Xt.type=function(fe){return arguments.length?(gt=pe(fe),Xt):gt},Xt.size=function(fe){return arguments.length?(Et=pe(fe),Xt):Et},Xt};function gr(){return 64}function Lr(){return"circle"}function Hr(gt){var Et=Math.sqrt(gt/lt);return"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+-Et+"A"+Et+","+Et+" 0 1,1 0,"+Et+"Z"}var nn=u.map({circle:Hr,cross:function(gt){var Et=Math.sqrt(gt/5)/2;return"M"+-3*Et+","+-Et+"H"+-Et+"V"+-3*Et+"H"+Et+"V"+-Et+"H"+3*Et+"V"+Et+"H"+Et+"V"+3*Et+"H"+-Et+"V"+Et+"H"+-3*Et+"Z"},diamond:function(gt){var Et=Math.sqrt(gt/(2*Mn)),Xt=Et*Mn;return"M0,"+-Et+"L"+Xt+",0 0,"+Et+" "+-Xt+",0Z"},square:function(gt){var Et=Math.sqrt(gt)/2;return"M"+-Et+","+-Et+"L"+Et+","+-Et+" "+Et+","+Et+" "+-Et+","+Et+"Z"},"triangle-down":function(gt){var Et=Math.sqrt(gt/cn),Xt=Et*cn/2;return"M0,"+Xt+"L"+Et+","+-Xt+" "+-Et+","+-Xt+"Z"},"triangle-up":function(gt){var Et=Math.sqrt(gt/cn),Xt=Et*cn/2;return"M0,"+-Xt+"L"+Et+","+Xt+" "+-Et+","+Xt+"Z"}});u.svg.symbolTypes=nn.keys();var cn=Math.sqrt(3),Mn=Math.tan(30*Yt);J.transition=function(gt){for(var Et=Ai||++ai,Xt=Xo(gt),fe=[],me,we,Ve=mi||{time:Date.now(),ease:Fi,delay:0,duration:250},je=-1,or=this.length;++je0;)Wr[--Yn].call(gt,Hn);if(Bn>=1)return Ve.event&&Ve.event.end.call(gt,gt.__data__,Et),--we.count?delete we[fe]:delete gt[Xt],1}Ve||(je=me.time,or=Qn(an,0,je),Ve=we[fe]={tween:new S,time:je,timer:or,delay:me.delay,duration:me.duration,ease:me.ease,index:Et},me=null,++we.count)}u.svg.axis=function(){var gt=u.scale.linear(),Et=Qo,Xt=6,fe=6,me=3,we=[10],Ve=null,je;function or(Cr){Cr.each(function(){var Sr=u.select(this),Wr=this.__chart__||gt,an=this.__chart__=gt.copy(),on=Ve??(an.ticks?an.ticks.apply(an,we):an.domain()),ta=je??(an.tickFormat?an.tickFormat.apply(an,we):B),hn=Sr.selectAll(".tick").data(on,an),Bn=hn.enter().insert("g",".domain").attr("class","tick").style("opacity",qt),Hn=u.transition(hn.exit()).style("opacity",qt).remove(),Yn=u.transition(hn.order()).style("opacity",1),na=Math.max(Xt,0)+me,_n,Ha=Pn(an),Wa=Sr.selectAll(".domain").data([0]),ri=(Wa.enter().append("path").attr("class","domain"),u.transition(Wa));Bn.append("line"),Bn.append("text");var xi=Bn.select("line"),ki=Yn.select("line"),zi=hn.select("text").text(ta),jo=Bn.select("text"),Ii=Yn.select("text"),Ji=Et==="top"||Et==="left"?-1:1,es,pl,Ns,fi;if(Et==="bottom"||Et==="top"?(_n=Us,es="x",Ns="y",pl="x2",fi="y2",zi.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),ri.attr("d","M"+Ha[0]+","+Ji*fe+"V0H"+Ha[1]+"V"+Ji*fe)):(_n=To,es="y",Ns="x",pl="y2",fi="x2",zi.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),ri.attr("d","M"+Ji*fe+","+Ha[0]+"H0V"+Ha[1]+"H"+Ji*fe)),xi.attr(fi,Ji*Xt),jo.attr(Ns,Ji*na),ki.attr(pl,0).attr(fi,Ji*Xt),Ii.attr(es,0).attr(Ns,Ji*na),an.rangeBand){var Ao=an,Bo=Ao.rangeBand()/2;Wr=an=function(Ds){return Ao(Ds)+Bo}}else Wr.rangeBand?Wr=an:Hn.call(_n,an,Wr);Bn.call(_n,Wr,an),Yn.call(_n,an,an)})}return or.scale=function(Cr){return arguments.length?(gt=Cr,or):gt},or.orient=function(Cr){return arguments.length?(Et=Cr in Js?Cr+"":Qo,or):Et},or.ticks=function(){return arguments.length?(we=E(arguments),or):we},or.tickValues=function(Cr){return arguments.length?(Ve=Cr,or):Ve},or.tickFormat=function(Cr){return arguments.length?(je=Cr,or):je},or.tickSize=function(Cr){var Sr=arguments.length;return Sr?(Xt=+Cr,fe=+arguments[Sr-1],or):Xt},or.innerTickSize=function(Cr){return arguments.length?(Xt=+Cr,or):Xt},or.outerTickSize=function(Cr){return arguments.length?(fe=+Cr,or):fe},or.tickPadding=function(Cr){return arguments.length?(me=+Cr,or):me},or.tickSubdivide=function(){return arguments.length&&or},or};var Qo="bottom",Js={top:1,right:1,bottom:1,left:1};function Us(gt,Et,Xt){gt.attr("transform",function(fe){var me=Et(fe);return"translate("+(isFinite(me)?me:Xt(fe))+",0)"})}function To(gt,Et,Xt){gt.attr("transform",function(fe){var me=Et(fe);return"translate(0,"+(isFinite(me)?me:Xt(fe))+")"})}u.svg.brush=function(){var gt=st(Sr,"brushstart","brush","brushend"),Et=null,Xt=null,fe=[0,0],me=[0,0],we,Ve,je=!0,or=!0,Cr=hl[0];function Sr(hn){hn.each(function(){var Bn=u.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ta).on("touchstart.brush",ta),Hn=Bn.selectAll(".background").data([0]);Hn.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Bn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Yn=Bn.selectAll(".resize").data(Cr,B);Yn.exit().remove(),Yn.enter().append("g").attr("class",function(Wa){return"resize "+Wa}).style("cursor",function(Wa){return ko[Wa]}).append("rect").attr("x",function(Wa){return/[ew]$/.test(Wa)?-3:null}).attr("y",function(Wa){return/^[ns]/.test(Wa)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Yn.style("display",Sr.empty()?"none":null);var na=u.transition(Bn),_n=u.transition(Hn),Ha;Et&&(Ha=Pn(Et),_n.attr("x",Ha[0]).attr("width",Ha[1]-Ha[0]),an(na)),Xt&&(Ha=Pn(Xt),_n.attr("y",Ha[0]).attr("height",Ha[1]-Ha[0]),on(na)),Wr(na)})}Sr.event=function(hn){hn.each(function(){var Bn=gt.of(this,arguments),Hn={x:fe,y:me,i:we,j:Ve},Yn=this.__chart__||Hn;this.__chart__=Hn,Ai?u.select(this).transition().each("start.brush",function(){we=Yn.i,Ve=Yn.j,fe=Yn.x,me=Yn.y,Bn({type:"brushstart"})}).tween("brush:brush",function(){var na=bs(fe,Hn.x),_n=bs(me,Hn.y);return we=Ve=null,function(Ha){fe=Hn.x=na(Ha),me=Hn.y=_n(Ha),Bn({type:"brush",mode:"resize"})}}).each("end.brush",function(){we=Hn.i,Ve=Hn.j,Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"})}):(Bn({type:"brushstart"}),Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"}))})};function Wr(hn){hn.selectAll(".resize").attr("transform",function(Bn){return"translate("+fe[+/e$/.test(Bn)]+","+me[+/^s/.test(Bn)]+")"})}function an(hn){hn.select(".extent").attr("x",fe[0]),hn.selectAll(".extent,.n>rect,.s>rect").attr("width",fe[1]-fe[0])}function on(hn){hn.select(".extent").attr("y",me[0]),hn.selectAll(".extent,.e>rect,.w>rect").attr("height",me[1]-me[0])}function ta(){var hn=this,Bn=u.select(u.event.target),Hn=gt.of(hn,arguments),Yn=u.select(hn),na=Bn.datum(),_n=!/^(n|s)$/.test(na)&&Et,Ha=!/^(e|w)$/.test(na)&&Xt,Wa=Bn.classed("extent"),ri=Mr(hn),xi,ki=u.mouse(hn),zi,jo=u.select(e(hn)).on("keydown.brush",es).on("keyup.brush",pl);if(u.event.changedTouches?jo.on("touchmove.brush",Ns).on("touchend.brush",Ao):jo.on("mousemove.brush",Ns).on("mouseup.brush",Ao),Yn.interrupt().selectAll("*").interrupt(),Wa)ki[0]=fe[0]-ki[0],ki[1]=me[0]-ki[1];else if(na){var Ii=+/w$/.test(na),Ji=+/^n/.test(na);zi=[fe[1-Ii]-ki[0],me[1-Ji]-ki[1]],ki[0]=fe[Ii],ki[1]=me[Ji]}else u.event.altKey&&(xi=ki.slice());Yn.style("pointer-events","none").selectAll(".resize").style("display",null),u.select("body").style("cursor",Bn.style("cursor")),Hn({type:"brushstart"}),Ns();function es(){u.event.keyCode==32&&(Wa||(xi=null,ki[0]-=fe[1],ki[1]-=me[1],Wa=2),rt())}function pl(){u.event.keyCode==32&&Wa==2&&(ki[0]+=fe[1],ki[1]+=me[1],Wa=0,rt())}function Ns(){var Bo=u.mouse(hn),Ds=!1;zi&&(Bo[0]+=zi[0],Bo[1]+=zi[1]),Wa||(u.event.altKey?(xi||(xi=[(fe[0]+fe[1])/2,(me[0]+me[1])/2]),ki[0]=fe[+(Bo[0]{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){var d=new Date,E=new Date;function A(vt,Ut,re,Kt){function ue(Me){return vt(Me=arguments.length===0?new Date:new Date(+Me)),Me}return ue.floor=function(Me){return vt(Me=new Date(+Me)),Me},ue.ceil=function(Me){return vt(Me=new Date(Me-1)),Ut(Me,1),vt(Me),Me},ue.round=function(Me){var Ce=ue(Me),We=ue.ceil(Me);return Me-Ce0))return qe;do qe.push(vr=new Date(+Me)),Ut(Me,We),vt(Me);while(vr=Ce)for(;vt(Ce),!Me(Ce);)Ce.setTime(Ce-1)},function(Ce,We){if(Ce>=Ce)if(We<0)for(;++We<=0;)for(;Ut(Ce,-1),!Me(Ce););else for(;--We>=0;)for(;Ut(Ce,1),!Me(Ce););})},re&&(ue.count=function(Me,Ce){return d.setTime(+Me),E.setTime(+Ce),vt(d),vt(E),Math.floor(re(d,E))},ue.every=function(Me){return Me=Math.floor(Me),!isFinite(Me)||!(Me>0)?null:Me>1?ue.filter(Kt?function(Ce){return Kt(Ce)%Me===0}:function(Ce){return ue.count(0,Ce)%Me===0}):ue}),ue}var t=A(function(){},function(vt,Ut){vt.setTime(+vt+Ut)},function(vt,Ut){return Ut-vt});t.every=function(vt){return vt=Math.floor(vt),!isFinite(vt)||!(vt>0)?null:vt>1?A(function(Ut){Ut.setTime(Math.floor(Ut/vt)*vt)},function(Ut,re){Ut.setTime(+Ut+re*vt)},function(Ut,re){return(re-Ut)/vt}):t};var e=t.range,r=1e3,i=6e4,n=36e5,o=864e5,a=6048e5,s=A(function(vt){vt.setTime(vt-vt.getMilliseconds())},function(vt,Ut){vt.setTime(+vt+Ut*r)},function(vt,Ut){return(Ut-vt)/r},function(vt){return vt.getUTCSeconds()}),f=s.range,v=A(function(vt){vt.setTime(vt-vt.getMilliseconds()-vt.getSeconds()*r)},function(vt,Ut){vt.setTime(+vt+Ut*i)},function(vt,Ut){return(Ut-vt)/i},function(vt){return vt.getMinutes()}),g=v.range,m=A(function(vt){vt.setTime(vt-vt.getMilliseconds()-vt.getSeconds()*r-vt.getMinutes()*i)},function(vt,Ut){vt.setTime(+vt+Ut*n)},function(vt,Ut){return(Ut-vt)/n},function(vt){return vt.getHours()}),w=m.range,l=A(function(vt){vt.setHours(0,0,0,0)},function(vt,Ut){vt.setDate(vt.getDate()+Ut)},function(vt,Ut){return(Ut-vt-(Ut.getTimezoneOffset()-vt.getTimezoneOffset())*i)/o},function(vt){return vt.getDate()-1}),x=l.range;function y(vt){return A(function(Ut){Ut.setDate(Ut.getDate()-(Ut.getDay()+7-vt)%7),Ut.setHours(0,0,0,0)},function(Ut,re){Ut.setDate(Ut.getDate()+re*7)},function(Ut,re){return(re-Ut-(re.getTimezoneOffset()-Ut.getTimezoneOffset())*i)/a})}var S=y(0),k=y(1),M=y(2),T=y(3),c=y(4),h=y(5),b=y(6),_=S.range,P=k.range,z=M.range,D=T.range,B=c.range,R=h.range,I=b.range,F=A(function(vt){vt.setDate(1),vt.setHours(0,0,0,0)},function(vt,Ut){vt.setMonth(vt.getMonth()+Ut)},function(vt,Ut){return Ut.getMonth()-vt.getMonth()+(Ut.getFullYear()-vt.getFullYear())*12},function(vt){return vt.getMonth()}),j=F.range,N=A(function(vt){vt.setMonth(0,1),vt.setHours(0,0,0,0)},function(vt,Ut){vt.setFullYear(vt.getFullYear()+Ut)},function(vt,Ut){return Ut.getFullYear()-vt.getFullYear()},function(vt){return vt.getFullYear()});N.every=function(vt){return!isFinite(vt=Math.floor(vt))||!(vt>0)?null:A(function(Ut){Ut.setFullYear(Math.floor(Ut.getFullYear()/vt)*vt),Ut.setMonth(0,1),Ut.setHours(0,0,0,0)},function(Ut,re){Ut.setFullYear(Ut.getFullYear()+re*vt)})};var G=N.range,rt=A(function(vt){vt.setUTCSeconds(0,0)},function(vt,Ut){vt.setTime(+vt+Ut*i)},function(vt,Ut){return(Ut-vt)/i},function(vt){return vt.getUTCMinutes()}),ct=rt.range,st=A(function(vt){vt.setUTCMinutes(0,0,0)},function(vt,Ut){vt.setTime(+vt+Ut*n)},function(vt,Ut){return(Ut-vt)/n},function(vt){return vt.getUTCHours()}),et=st.range,Z=A(function(vt){vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCDate(vt.getUTCDate()+Ut)},function(vt,Ut){return(Ut-vt)/o},function(vt){return vt.getUTCDate()-1}),ot=Z.range;function X(vt){return A(function(Ut){Ut.setUTCDate(Ut.getUTCDate()-(Ut.getUTCDay()+7-vt)%7),Ut.setUTCHours(0,0,0,0)},function(Ut,re){Ut.setUTCDate(Ut.getUTCDate()+re*7)},function(Ut,re){return(re-Ut)/a})}var Q=X(0),ut=X(1),J=X(2),q=X(3),it=X(4),nt=X(5),dt=X(6),Tt=Q.range,wt=ut.range,Ct=J.range,It=q.range,Nt=it.range,te=nt.range,Jt=dt.range,ee=A(function(vt){vt.setUTCDate(1),vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCMonth(vt.getUTCMonth()+Ut)},function(vt,Ut){return Ut.getUTCMonth()-vt.getUTCMonth()+(Ut.getUTCFullYear()-vt.getUTCFullYear())*12},function(vt){return vt.getUTCMonth()}),Zt=ee.range,mt=A(function(vt){vt.setUTCMonth(0,1),vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCFullYear(vt.getUTCFullYear()+Ut)},function(vt,Ut){return Ut.getUTCFullYear()-vt.getUTCFullYear()},function(vt){return vt.getUTCFullYear()});mt.every=function(vt){return!isFinite(vt=Math.floor(vt))||!(vt>0)?null:A(function(Ut){Ut.setUTCFullYear(Math.floor(Ut.getUTCFullYear()/vt)*vt),Ut.setUTCMonth(0,1),Ut.setUTCHours(0,0,0,0)},function(Ut,re){Ut.setUTCFullYear(Ut.getUTCFullYear()+re*vt)})};var bt=mt.range;u.timeDay=l,u.timeDays=x,u.timeFriday=h,u.timeFridays=R,u.timeHour=m,u.timeHours=w,u.timeInterval=A,u.timeMillisecond=t,u.timeMilliseconds=e,u.timeMinute=v,u.timeMinutes=g,u.timeMonday=k,u.timeMondays=P,u.timeMonth=F,u.timeMonths=j,u.timeSaturday=b,u.timeSaturdays=I,u.timeSecond=s,u.timeSeconds=f,u.timeSunday=S,u.timeSundays=_,u.timeThursday=c,u.timeThursdays=B,u.timeTuesday=M,u.timeTuesdays=z,u.timeWednesday=T,u.timeWednesdays=D,u.timeWeek=S,u.timeWeeks=_,u.timeYear=N,u.timeYears=G,u.utcDay=Z,u.utcDays=ot,u.utcFriday=nt,u.utcFridays=te,u.utcHour=st,u.utcHours=et,u.utcMillisecond=t,u.utcMilliseconds=e,u.utcMinute=rt,u.utcMinutes=ct,u.utcMonday=ut,u.utcMondays=wt,u.utcMonth=ee,u.utcMonths=Zt,u.utcSaturday=dt,u.utcSaturdays=Jt,u.utcSecond=s,u.utcSeconds=f,u.utcSunday=Q,u.utcSundays=Tt,u.utcThursday=it,u.utcThursdays=Nt,u.utcTuesday=J,u.utcTuesdays=Ct,u.utcWednesday=q,u.utcWednesdays=It,u.utcWeek=Q,u.utcWeeks=Tt,u.utcYear=mt,u.utcYears=bt,Object.defineProperty(u,"__esModule",{value:!0})})}),pm=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Y_()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(K,function(u,d){function E(Dt){if(0<=Dt.y&&Dt.y<100){var qt=new Date(-1,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L);return qt.setFullYear(Dt.y),qt}return new Date(Dt.y,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L)}function A(Dt){if(0<=Dt.y&&Dt.y<100){var qt=new Date(Date.UTC(-1,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L));return qt.setUTCFullYear(Dt.y),qt}return new Date(Date.UTC(Dt.y,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L))}function t(Dt,qt,_t){return{y:Dt,m:qt,d:_t,H:0,M:0,S:0,L:0}}function e(Dt){var qt=Dt.dateTime,_t=Dt.date,lt=Dt.time,yt=Dt.periods,St=Dt.days,Ht=Dt.shortDays,Yt=Dt.months,se=Dt.shortMonths,ke=f(yt),Ee=v(yt),Ue=f(St),ir=v(St),ar=f(Ht),Ye=v(Ht),Er=f(Yt),pn=v(Yt),dn=f(se),bn=v(se),Zn={a:Nn,A:Kn,b:$n,B:ia,c:null,d:F,e:F,f:ct,H:j,I:N,j:G,L:rt,m:st,M:et,p:Cn,q:Fa,Q:Ce,s:We,S:Z,u:ot,U:X,V:Q,w:ut,W:J,x:null,X:null,y:q,Y:it,Z:nt,"%":Me},En={a:Ga,A:ve,b:ge,B:dr,c:null,d:dt,e:dt,f:Nt,H:Tt,I:wt,j:Ct,L:It,m:te,M:Jt,p:br,q:Tr,Q:Ce,s:We,S:ee,u:Zt,U:mt,V:bt,w:vt,W:Ut,x:null,X:null,y:re,Y:Kt,Z:ue,"%":Me},gn={a:Ze,A:tr,b:zr,B:tn,c:Yr,d:c,e:c,f:D,H:b,I:b,j:h,L:z,m:T,M:_,p:Re,q:M,Q:R,s:I,S:P,u:m,U:w,V:l,w:g,W:x,x:$r,X:In,y:S,Y:y,Z:k,"%":B};Zn.x=da(_t,Zn),Zn.X=da(lt,Zn),Zn.c=da(qt,Zn),En.x=da(_t,En),En.X=da(lt,En),En.c=da(qt,En);function da(mr,kr){return function(Ur){var Or=[],pe=-1,Ke=0,xr=mr.length,Gr,ln,wn;for(Ur instanceof Date||(Ur=new Date(+Ur));++pe53)return null;"w"in Or||(Or.w=1),"Z"in Or?(Ke=A(t(Or.y,0,1)),xr=Ke.getUTCDay(),Ke=xr>4||xr===0?d.utcMonday.ceil(Ke):d.utcMonday(Ke),Ke=d.utcDay.offset(Ke,(Or.V-1)*7),Or.y=Ke.getUTCFullYear(),Or.m=Ke.getUTCMonth(),Or.d=Ke.getUTCDate()+(Or.w+6)%7):(Ke=E(t(Or.y,0,1)),xr=Ke.getDay(),Ke=xr>4||xr===0?d.timeMonday.ceil(Ke):d.timeMonday(Ke),Ke=d.timeDay.offset(Ke,(Or.V-1)*7),Or.y=Ke.getFullYear(),Or.m=Ke.getMonth(),Or.d=Ke.getDate()+(Or.w+6)%7)}else("W"in Or||"U"in Or)&&("w"in Or||(Or.w="u"in Or?Or.u%7:"W"in Or?1:0),xr="Z"in Or?A(t(Or.y,0,1)).getUTCDay():E(t(Or.y,0,1)).getDay(),Or.m=0,Or.d="W"in Or?(Or.w+6)%7+Or.W*7-(xr+5)%7:Or.w+Or.U*7-(xr+6)%7);return"Z"in Or?(Or.H+=Or.Z/100|0,Or.M+=Or.Z%100,A(Or)):E(Or)}}function Se(mr,kr,Ur,Or){for(var pe=0,Ke=kr.length,xr=Ur.length,Gr,ln;pe=xr)return-1;if(Gr=kr.charCodeAt(pe++),Gr===37){if(Gr=kr.charAt(pe++),ln=gn[Gr in r?kr.charAt(pe++):Gr],!ln||(Or=ln(mr,Ur,Or))<0)return-1}else if(Gr!=Ur.charCodeAt(Or++))return-1}return Or}function Re(mr,kr,Ur){var Or=ke.exec(kr.slice(Ur));return Or?(mr.p=Ee[Or[0].toLowerCase()],Ur+Or[0].length):-1}function Ze(mr,kr,Ur){var Or=ar.exec(kr.slice(Ur));return Or?(mr.w=Ye[Or[0].toLowerCase()],Ur+Or[0].length):-1}function tr(mr,kr,Ur){var Or=Ue.exec(kr.slice(Ur));return Or?(mr.w=ir[Or[0].toLowerCase()],Ur+Or[0].length):-1}function zr(mr,kr,Ur){var Or=dn.exec(kr.slice(Ur));return Or?(mr.m=bn[Or[0].toLowerCase()],Ur+Or[0].length):-1}function tn(mr,kr,Ur){var Or=Er.exec(kr.slice(Ur));return Or?(mr.m=pn[Or[0].toLowerCase()],Ur+Or[0].length):-1}function Yr(mr,kr,Ur){return Se(mr,qt,kr,Ur)}function $r(mr,kr,Ur){return Se(mr,_t,kr,Ur)}function In(mr,kr,Ur){return Se(mr,lt,kr,Ur)}function Nn(mr){return Ht[mr.getDay()]}function Kn(mr){return St[mr.getDay()]}function $n(mr){return se[mr.getMonth()]}function ia(mr){return Yt[mr.getMonth()]}function Cn(mr){return yt[+(mr.getHours()>=12)]}function Fa(mr){return 1+~~(mr.getMonth()/3)}function Ga(mr){return Ht[mr.getUTCDay()]}function ve(mr){return St[mr.getUTCDay()]}function ge(mr){return se[mr.getUTCMonth()]}function dr(mr){return Yt[mr.getUTCMonth()]}function br(mr){return yt[+(mr.getUTCHours()>=12)]}function Tr(mr){return 1+~~(mr.getUTCMonth()/3)}return{format:function(mr){var kr=da(mr+="",Zn);return kr.toString=function(){return mr},kr},parse:function(mr){var kr=ra(mr+="",!1);return kr.toString=function(){return mr},kr},utcFormat:function(mr){var kr=da(mr+="",En);return kr.toString=function(){return mr},kr},utcParse:function(mr){var kr=ra(mr+="",!0);return kr.toString=function(){return mr},kr}}}var r={"-":"",_:" ",0:"0"},i=/^\s*\d+/,n=/^%/,o=/[\\^$*+?|[\]().{}]/g;function a(Dt,qt,_t){var lt=Dt<0?"-":"",yt=(lt?-Dt:Dt)+"",St=yt.length;return lt+(St<_t?new Array(_t-St+1).join(qt)+yt:yt)}function s(Dt){return Dt.replace(o,"\\$&")}function f(Dt){return new RegExp("^(?:"+Dt.map(s).join("|")+")","i")}function v(Dt){for(var qt={},_t=-1,lt=Dt.length;++_t68?1900:2e3),_t+lt[0].length):-1}function k(Dt,qt,_t){var lt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(qt.slice(_t,_t+6));return lt?(Dt.Z=lt[1]?0:-(lt[2]+(lt[3]||"00")),_t+lt[0].length):-1}function M(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+1));return lt?(Dt.q=lt[0]*3-3,_t+lt[0].length):-1}function T(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.m=lt[0]-1,_t+lt[0].length):-1}function c(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.d=+lt[0],_t+lt[0].length):-1}function h(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+3));return lt?(Dt.m=0,Dt.d=+lt[0],_t+lt[0].length):-1}function b(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.H=+lt[0],_t+lt[0].length):-1}function _(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.M=+lt[0],_t+lt[0].length):-1}function P(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.S=+lt[0],_t+lt[0].length):-1}function z(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+3));return lt?(Dt.L=+lt[0],_t+lt[0].length):-1}function D(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+6));return lt?(Dt.L=Math.floor(lt[0]/1e3),_t+lt[0].length):-1}function B(Dt,qt,_t){var lt=n.exec(qt.slice(_t,_t+1));return lt?_t+lt[0].length:-1}function R(Dt,qt,_t){var lt=i.exec(qt.slice(_t));return lt?(Dt.Q=+lt[0],_t+lt[0].length):-1}function I(Dt,qt,_t){var lt=i.exec(qt.slice(_t));return lt?(Dt.s=+lt[0],_t+lt[0].length):-1}function F(Dt,qt){return a(Dt.getDate(),qt,2)}function j(Dt,qt){return a(Dt.getHours(),qt,2)}function N(Dt,qt){return a(Dt.getHours()%12||12,qt,2)}function G(Dt,qt){return a(1+d.timeDay.count(d.timeYear(Dt),Dt),qt,3)}function rt(Dt,qt){return a(Dt.getMilliseconds(),qt,3)}function ct(Dt,qt){return rt(Dt,qt)+"000"}function st(Dt,qt){return a(Dt.getMonth()+1,qt,2)}function et(Dt,qt){return a(Dt.getMinutes(),qt,2)}function Z(Dt,qt){return a(Dt.getSeconds(),qt,2)}function ot(Dt){var qt=Dt.getDay();return qt===0?7:qt}function X(Dt,qt){return a(d.timeSunday.count(d.timeYear(Dt)-1,Dt),qt,2)}function Q(Dt,qt){var _t=Dt.getDay();return Dt=_t>=4||_t===0?d.timeThursday(Dt):d.timeThursday.ceil(Dt),a(d.timeThursday.count(d.timeYear(Dt),Dt)+(d.timeYear(Dt).getDay()===4),qt,2)}function ut(Dt){return Dt.getDay()}function J(Dt,qt){return a(d.timeMonday.count(d.timeYear(Dt)-1,Dt),qt,2)}function q(Dt,qt){return a(Dt.getFullYear()%100,qt,2)}function it(Dt,qt){return a(Dt.getFullYear()%1e4,qt,4)}function nt(Dt){var qt=Dt.getTimezoneOffset();return(qt>0?"-":(qt*=-1,"+"))+a(qt/60|0,"0",2)+a(qt%60,"0",2)}function dt(Dt,qt){return a(Dt.getUTCDate(),qt,2)}function Tt(Dt,qt){return a(Dt.getUTCHours(),qt,2)}function wt(Dt,qt){return a(Dt.getUTCHours()%12||12,qt,2)}function Ct(Dt,qt){return a(1+d.utcDay.count(d.utcYear(Dt),Dt),qt,3)}function It(Dt,qt){return a(Dt.getUTCMilliseconds(),qt,3)}function Nt(Dt,qt){return It(Dt,qt)+"000"}function te(Dt,qt){return a(Dt.getUTCMonth()+1,qt,2)}function Jt(Dt,qt){return a(Dt.getUTCMinutes(),qt,2)}function ee(Dt,qt){return a(Dt.getUTCSeconds(),qt,2)}function Zt(Dt){var qt=Dt.getUTCDay();return qt===0?7:qt}function mt(Dt,qt){return a(d.utcSunday.count(d.utcYear(Dt)-1,Dt),qt,2)}function bt(Dt,qt){var _t=Dt.getUTCDay();return Dt=_t>=4||_t===0?d.utcThursday(Dt):d.utcThursday.ceil(Dt),a(d.utcThursday.count(d.utcYear(Dt),Dt)+(d.utcYear(Dt).getUTCDay()===4),qt,2)}function vt(Dt){return Dt.getUTCDay()}function Ut(Dt,qt){return a(d.utcMonday.count(d.utcYear(Dt)-1,Dt),qt,2)}function re(Dt,qt){return a(Dt.getUTCFullYear()%100,qt,2)}function Kt(Dt,qt){return a(Dt.getUTCFullYear()%1e4,qt,4)}function ue(){return"+0000"}function Me(){return"%"}function Ce(Dt){return+Dt}function We(Dt){return Math.floor(+Dt/1e3)}var qe;vr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vr(Dt){return qe=e(Dt),u.timeFormat=qe.format,u.timeParse=qe.parse,u.utcFormat=qe.utcFormat,u.utcParse=qe.utcParse,qe}var _r="%Y-%m-%dT%H:%M:%S.%LZ";function er(Dt){return Dt.toISOString()}var Mr=Date.prototype.toISOString?er:u.utcFormat(_r);function Ir(Dt){var qt=new Date(Dt);return isNaN(qt)?null:qt}var de=+new Date("2000-01-01T00:00:00.000Z")?Ir:u.utcParse(_r);u.isoFormat=Mr,u.isoParse=de,u.timeFormatDefaultLocale=vr,u.timeFormatLocale=e,Object.defineProperty(u,"__esModule",{value:!0})})}),X_=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=typeof globalThis<"u"?globalThis:u||self,d(u.d3=u.d3||{}))})(K,function(u){function d(T){return Math.abs(T=Math.round(T))>=1e21?T.toLocaleString("en").replace(/,/g,""):T.toString(10)}function E(T,c){if((h=(T=c?T.toExponential(c-1):T.toExponential()).indexOf("e"))<0)return null;var h,b=T.slice(0,h);return[b.length>1?b[0]+b.slice(2):b,+T.slice(h+1)]}function A(T){return T=E(Math.abs(T)),T?T[1]:NaN}function t(T,c){return function(h,b){for(var _=h.length,P=[],z=0,D=T[0],B=0;_>0&&D>0&&(B+D+1>b&&(D=Math.max(1,b-B)),P.push(h.substring(_-=D,_+D)),!((B+=D+1)>b));)D=T[z=(z+1)%T.length];return P.reverse().join(c)}}function e(T){return function(c){return c.replace(/[0-9]/g,function(h){return T[+h]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(T){if(!(c=r.exec(T)))throw new Error("invalid format: "+T);var c;return new n({fill:c[1],align:c[2],sign:c[3],symbol:c[4],zero:c[5],width:c[6],comma:c[7],precision:c[8]&&c[8].slice(1),trim:c[9],type:c[10]})}i.prototype=n.prototype;function n(T){this.fill=T.fill===void 0?" ":T.fill+"",this.align=T.align===void 0?">":T.align+"",this.sign=T.sign===void 0?"-":T.sign+"",this.symbol=T.symbol===void 0?"":T.symbol+"",this.zero=!!T.zero,this.width=T.width===void 0?void 0:+T.width,this.comma=!!T.comma,this.precision=T.precision===void 0?void 0:+T.precision,this.trim=!!T.trim,this.type=T.type===void 0?"":T.type+""}n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function o(T){t:for(var c=T.length,h=1,b=-1,_;h0&&(b=0);break}return b>0?T.slice(0,b)+T.slice(_+1):T}var a;function s(T,c){var h=E(T,c);if(!h)return T+"";var b=h[0],_=h[1],P=_-(a=Math.max(-8,Math.min(8,Math.floor(_/3)))*3)+1,z=b.length;return P===z?b:P>z?b+new Array(P-z+1).join("0"):P>0?b.slice(0,P)+"."+b.slice(P):"0."+new Array(1-P).join("0")+E(T,Math.max(0,c+P-1))[0]}function f(T,c){var h=E(T,c);if(!h)return T+"";var b=h[0],_=h[1];return _<0?"0."+new Array(-_).join("0")+b:b.length>_+1?b.slice(0,_+1)+"."+b.slice(_+1):b+new Array(_-b.length+2).join("0")}var v={"%":function(T,c){return(T*100).toFixed(c)},b:function(T){return Math.round(T).toString(2)},c:function(T){return T+""},d,e:function(T,c){return T.toExponential(c)},f:function(T,c){return T.toFixed(c)},g:function(T,c){return T.toPrecision(c)},o:function(T){return Math.round(T).toString(8)},p:function(T,c){return f(T*100,c)},r:f,s,X:function(T){return Math.round(T).toString(16).toUpperCase()},x:function(T){return Math.round(T).toString(16)}};function g(T){return T}var m=Array.prototype.map,w=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(T){var c=T.grouping===void 0||T.thousands===void 0?g:t(m.call(T.grouping,Number),T.thousands+""),h=T.currency===void 0?"":T.currency[0]+"",b=T.currency===void 0?"":T.currency[1]+"",_=T.decimal===void 0?".":T.decimal+"",P=T.numerals===void 0?g:e(m.call(T.numerals,String)),z=T.percent===void 0?"%":T.percent+"",D=T.minus===void 0?"-":T.minus+"",B=T.nan===void 0?"NaN":T.nan+"";function R(F){F=i(F);var j=F.fill,N=F.align,G=F.sign,rt=F.symbol,ct=F.zero,st=F.width,et=F.comma,Z=F.precision,ot=F.trim,X=F.type;X==="n"?(et=!0,X="g"):v[X]||(Z===void 0&&(Z=12),ot=!0,X="g"),(ct||j==="0"&&N==="=")&&(ct=!0,j="0",N="=");var Q=rt==="$"?h:rt==="#"&&/[boxX]/.test(X)?"0"+X.toLowerCase():"",ut=rt==="$"?b:/[%p]/.test(X)?z:"",J=v[X],q=/[defgprs%]/.test(X);Z=Z===void 0?6:/[gprs]/.test(X)?Math.max(1,Math.min(21,Z)):Math.max(0,Math.min(20,Z));function it(nt){var dt=Q,Tt=ut,wt,Ct,It;if(X==="c")Tt=J(nt)+Tt,nt="";else{nt=+nt;var Nt=nt<0||1/nt<0;if(nt=isNaN(nt)?B:J(Math.abs(nt),Z),ot&&(nt=o(nt)),Nt&&+nt==0&&G!=="+"&&(Nt=!1),dt=(Nt?G==="("?G:D:G==="-"||G==="("?"":G)+dt,Tt=(X==="s"?w[8+a/3]:"")+Tt+(Nt&&G==="("?")":""),q){for(wt=-1,Ct=nt.length;++wtIt||It>57){Tt=(It===46?_+nt.slice(wt+1):nt.slice(wt))+Tt,nt=nt.slice(0,wt);break}}}et&&!ct&&(nt=c(nt,1/0));var te=dt.length+nt.length+Tt.length,Jt=te>1)+dt+nt+Tt+Jt.slice(te);break;default:nt=Jt+dt+nt+Tt;break}return P(nt)}return it.toString=function(){return F+""},it}function I(F,j){var N=R((F=i(F),F.type="f",F)),G=Math.max(-8,Math.min(8,Math.floor(A(j)/3)))*3,rt=Math.pow(10,-G),ct=w[8+G/3];return function(st){return N(rt*st)+ct}}return{format:R,formatPrefix:I}}var x;y({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function y(T){return x=l(T),u.format=x.format,u.formatPrefix=x.formatPrefix,x}function S(T){return Math.max(0,-A(Math.abs(T)))}function k(T,c){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A(c)/3)))*3-A(Math.abs(T)))}function M(T,c){return T=Math.abs(T),c=Math.abs(c)-T,Math.max(0,A(c)-A(T))+1}u.FormatSpecifier=n,u.formatDefaultLocale=y,u.formatLocale=l,u.formatSpecifier=i,u.precisionFixed=S,u.precisionPrefix=k,u.precisionRound=M,Object.defineProperty(u,"__esModule",{value:!0})})}),W4=Vt((K,V)=>{V.exports=function(u){for(var d=u.length,E,A=0;A13)&&E!==32&&E!==133&&E!==160&&E!==5760&&E!==6158&&(E<8192||E>8205)&&E!==8232&&E!==8233&&E!==8239&&E!==8287&&E!==8288&&E!==12288&&E!==65279)return!1;return!0}}),Lo=Vt((K,V)=>{var u=W4();V.exports=function(d){var E=typeof d;if(E==="string"){var A=d;if(d=+d,d===0&&u(A))return!1}else if(E!=="number")return!1;return d-d<1}}),ks=Vt((K,V)=>{V.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),$_=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=typeof globalThis<"u"?globalThis:u||self,d(u["base64-arraybuffer"]={}))})(K,function(u){for(var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256),A=0;A>2],a+=d[(i[n]&3)<<4|i[n+1]>>4],a+=d[(i[n+1]&15)<<2|i[n+2]>>6],a+=d[i[n+2]&63];return o%3===2?a=a.substring(0,a.length-1)+"=":o%3===1&&(a=a.substring(0,a.length-2)+"=="),a},e=function(r){var i=r.length*.75,n=r.length,o,a=0,s,f,v,g;r[r.length-1]==="="&&(i--,r[r.length-2]==="="&&i--);var m=new ArrayBuffer(i),w=new Uint8Array(m);for(o=0;o>4,w[a++]=(f&15)<<4|v>>2,w[a++]=(v&3)<<6|g&63;return m};u.decode=e,u.encode=t,Object.defineProperty(u,"__esModule",{value:!0})})}),Dp=Vt((K,V)=>{V.exports=function(u){return window&&window.process&&window.process.versions?Object.prototype.toString.call(u)==="[object Object]":Object.prototype.toString.call(u)==="[object Object]"&&Object.getPrototypeOf(u).hasOwnProperty("hasOwnProperty")}}),nh=Vt(K=>{var V=$_().decode,u=Dp(),d=Array.isArray,E=ArrayBuffer,A=DataView;function t(s){return E.isView(s)&&!(s instanceof A)}K.isTypedArray=t;function e(s){return d(s)||t(s)}K.isArrayOrTypedArray=e;function r(s){return!e(s[0])}K.isArray1D=r,K.ensureArray=function(s,f){return d(s)||(s=[]),s.length=f,s};var i={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};i.uint8c=i.u1c,i.uint8=i.u1,i.int8=i.i1,i.uint16=i.u2,i.int16=i.i2,i.uint32=i.u4,i.int32=i.i4,i.float32=i.f4,i.float64=i.f8;function n(s){return s.constructor===ArrayBuffer}K.isArrayBuffer=n,K.decodeTypedArraySpec=function(s){var f=[],v=o(s),g=v.dtype,m=i[g];if(!m)throw new Error('Error in dtype: "'+g+'"');var w=m.BYTES_PER_ELEMENT,l=v.bdata;n(l)||(l=V(l));var x=v.shape===void 0?[l.byteLength/w]:(""+v.shape).split(",");x.reverse();var y=x.length,S,k,M=+x[0],T=w*M,c=0;if(y===1)f=new m(l);else if(y===2)for(S=+x[1],k=0;k{var u=Lo(),d=nh().isArrayOrTypedArray;V.exports=function(a,s){if(u(s))s=String(s);else if(typeof s!="string"||s.slice(-4)==="[-1]")throw"bad property string";var f=s.split("."),v,g,m,w;for(w=0;w{var u=Lg(),d=/^\w*$/,E=0,A=1,t=2,e=3,r=4;V.exports=function(i,n,o,a){o=o||"name",a=a||"value";var s,f,v,g={};n&&n.length?(v=u(i,n),f=v.get()):f=i,n=n||"";var m={};if(f)for(s=0;s2)return g[y]=g[y]|t,l.set(x,null);if(w){for(s=y;s{var u=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,d=/^[^\.\[\]]+$/;V.exports=function(E,A){for(;A;){var t=E.match(u);if(t)E=t[1];else if(E.match(d))E="";else throw new Error("bad relativeAttr call:"+[E,A]);if(A.charAt(0)==="^")A=A.slice(1);else break}return E&&A.charAt(0)!=="["?E+"."+A:E+A}}),Oy=Vt((K,V)=>{var u=Lo();V.exports=function(d,E){if(d>0)return Math.log(d)/Math.LN10;var A=Math.log(Math.min(E[0],E[1]))/Math.LN10;return u(A)||(A=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),A}}),K4=Vt((K,V)=>{var u=nh().isArrayOrTypedArray,d=Dp();V.exports=function E(A,t){for(var e in t){var r=t[e],i=A[e];if(i!==r)if(e.charAt(0)==="_"||typeof r=="function"){if(e in A)continue;A[e]=r}else if(u(r)&&u(i)&&d(r[0])){if(e==="customdata"||e==="ids")continue;for(var n=Math.min(r.length,i.length),o=0;o{function u(E,A){var t=E%A;return t<0?t+A:t}function d(E,A){return Math.abs(E)>A/2?E-Math.round(E/A)*A:E}V.exports={mod:u,modHalf:d}}),Af=Vt((K,V)=>{(function(u){var d=/^\s+/,E=/\s+$/,A=0,t=u.round,e=u.min,r=u.max,i=u.random;function n(q,it){if(q=q||"",it=it||{},q instanceof n)return q;if(!(this instanceof n))return new n(q,it);var nt=o(q);this._originalInput=q,this._r=nt.r,this._g=nt.g,this._b=nt.b,this._a=nt.a,this._roundA=t(100*this._a)/100,this._format=it.format||nt.format,this._gradientType=it.gradientType,this._r<1&&(this._r=t(this._r)),this._g<1&&(this._g=t(this._g)),this._b<1&&(this._b=t(this._b)),this._ok=nt.ok,this._tc_id=A++}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var q=this.toRgb();return(q.r*299+q.g*587+q.b*114)/1e3},getLuminance:function(){var q=this.toRgb(),it,nt,dt,Tt,wt,Ct;return it=q.r/255,nt=q.g/255,dt=q.b/255,it<=.03928?Tt=it/12.92:Tt=u.pow((it+.055)/1.055,2.4),nt<=.03928?wt=nt/12.92:wt=u.pow((nt+.055)/1.055,2.4),dt<=.03928?Ct=dt/12.92:Ct=u.pow((dt+.055)/1.055,2.4),.2126*Tt+.7152*wt+.0722*Ct},setAlpha:function(q){return this._a=F(q),this._roundA=t(100*this._a)/100,this},toHsv:function(){var q=v(this._r,this._g,this._b);return{h:q.h*360,s:q.s,v:q.v,a:this._a}},toHsvString:function(){var q=v(this._r,this._g,this._b),it=t(q.h*360),nt=t(q.s*100),dt=t(q.v*100);return this._a==1?"hsv("+it+", "+nt+"%, "+dt+"%)":"hsva("+it+", "+nt+"%, "+dt+"%, "+this._roundA+")"},toHsl:function(){var q=s(this._r,this._g,this._b);return{h:q.h*360,s:q.s,l:q.l,a:this._a}},toHslString:function(){var q=s(this._r,this._g,this._b),it=t(q.h*360),nt=t(q.s*100),dt=t(q.l*100);return this._a==1?"hsl("+it+", "+nt+"%, "+dt+"%)":"hsla("+it+", "+nt+"%, "+dt+"%, "+this._roundA+")"},toHex:function(q){return m(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return w(this._r,this._g,this._b,this._a,q)},toHex8String:function(q){return"#"+this.toHex8(q)},toRgb:function(){return{r:t(this._r),g:t(this._g),b:t(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+t(this._r)+", "+t(this._g)+", "+t(this._b)+")":"rgba("+t(this._r)+", "+t(this._g)+", "+t(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:t(j(this._r,255)*100)+"%",g:t(j(this._g,255)*100)+"%",b:t(j(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(j(this._r,255)*100)+"%, "+t(j(this._g,255)*100)+"%, "+t(j(this._b,255)*100)+"%)":"rgba("+t(j(this._r,255)*100)+"%, "+t(j(this._g,255)*100)+"%, "+t(j(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:R[m(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var it="#"+l(this._r,this._g,this._b,this._a),nt=it,dt=this._gradientType?"GradientType = 1, ":"";if(q){var Tt=n(q);nt="#"+l(Tt._r,Tt._g,Tt._b,Tt._a)}return"progid:DXImageTransform.Microsoft.gradient("+dt+"startColorstr="+it+",endColorstr="+nt+")"},toString:function(q){var it=!!q;q=q||this._format;var nt=!1,dt=this._a<1&&this._a>=0,Tt=!it&&dt&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return Tt?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(nt=this.toRgbString()),q==="prgb"&&(nt=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(nt=this.toHexString()),q==="hex3"&&(nt=this.toHexString(!0)),q==="hex4"&&(nt=this.toHex8String(!0)),q==="hex8"&&(nt=this.toHex8String()),q==="name"&&(nt=this.toName()),q==="hsl"&&(nt=this.toHslString()),q==="hsv"&&(nt=this.toHsvString()),nt||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(q,it){var nt=q.apply(null,[this].concat([].slice.call(it)));return this._r=nt._r,this._g=nt._g,this._b=nt._b,this.setAlpha(nt._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(M,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(c,arguments)},_applyCombination:function(q,it){return q.apply(null,[this].concat([].slice.call(it)))},analogous:function(){return this._applyCombination(z,arguments)},complement:function(){return this._applyCombination(h,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},n.fromRatio=function(q,it){if(typeof q=="object"){var nt={};for(var dt in q)q.hasOwnProperty(dt)&&(dt==="a"?nt[dt]=q[dt]:nt[dt]=et(q[dt]));q=nt}return n(q,it)};function o(q){var it={r:0,g:0,b:0},nt=1,dt=null,Tt=null,wt=null,Ct=!1,It=!1;return typeof q=="string"&&(q=ut(q)),typeof q=="object"&&(Q(q.r)&&Q(q.g)&&Q(q.b)?(it=a(q.r,q.g,q.b),Ct=!0,It=String(q.r).substr(-1)==="%"?"prgb":"rgb"):Q(q.h)&&Q(q.s)&&Q(q.v)?(dt=et(q.s),Tt=et(q.v),it=g(q.h,dt,Tt),Ct=!0,It="hsv"):Q(q.h)&&Q(q.s)&&Q(q.l)&&(dt=et(q.s),wt=et(q.l),it=f(q.h,dt,wt),Ct=!0,It="hsl"),q.hasOwnProperty("a")&&(nt=q.a)),nt=F(nt),{ok:Ct,format:q.format||It,r:e(255,r(it.r,0)),g:e(255,r(it.g,0)),b:e(255,r(it.b,0)),a:nt}}function a(q,it,nt){return{r:j(q,255)*255,g:j(it,255)*255,b:j(nt,255)*255}}function s(q,it,nt){q=j(q,255),it=j(it,255),nt=j(nt,255);var dt=r(q,it,nt),Tt=e(q,it,nt),wt,Ct,It=(dt+Tt)/2;if(dt==Tt)wt=Ct=0;else{var Nt=dt-Tt;switch(Ct=It>.5?Nt/(2-dt-Tt):Nt/(dt+Tt),dt){case q:wt=(it-nt)/Nt+(it1&&(ee-=1),ee<1/6?te+(Jt-te)*6*ee:ee<1/2?Jt:ee<2/3?te+(Jt-te)*(2/3-ee)*6:te}if(it===0)dt=Tt=wt=nt;else{var It=nt<.5?nt*(1+it):nt+it-nt*it,Nt=2*nt-It;dt=Ct(Nt,It,q+1/3),Tt=Ct(Nt,It,q),wt=Ct(Nt,It,q-1/3)}return{r:dt*255,g:Tt*255,b:wt*255}}function v(q,it,nt){q=j(q,255),it=j(it,255),nt=j(nt,255);var dt=r(q,it,nt),Tt=e(q,it,nt),wt,Ct,It=dt,Nt=dt-Tt;if(Ct=dt===0?0:Nt/dt,dt==Tt)wt=0;else{switch(dt){case q:wt=(it-nt)/Nt+(it>1)+720)%360;--it;)dt.h=(dt.h+Tt)%360,wt.push(n(dt));return wt}function D(q,it){it=it||6;for(var nt=n(q).toHsv(),dt=nt.h,Tt=nt.s,wt=nt.v,Ct=[],It=1/it;it--;)Ct.push(n({h:dt,s:Tt,v:wt})),wt=(wt+It)%1;return Ct}n.mix=function(q,it,nt){nt=nt===0?0:nt||50;var dt=n(q).toRgb(),Tt=n(it).toRgb(),wt=nt/100,Ct={r:(Tt.r-dt.r)*wt+dt.r,g:(Tt.g-dt.g)*wt+dt.g,b:(Tt.b-dt.b)*wt+dt.b,a:(Tt.a-dt.a)*wt+dt.a};return n(Ct)},n.readability=function(q,it){var nt=n(q),dt=n(it);return(u.max(nt.getLuminance(),dt.getLuminance())+.05)/(u.min(nt.getLuminance(),dt.getLuminance())+.05)},n.isReadable=function(q,it,nt){var dt=n.readability(q,it),Tt,wt;switch(wt=!1,Tt=J(nt),Tt.level+Tt.size){case"AAsmall":case"AAAlarge":wt=dt>=4.5;break;case"AAlarge":wt=dt>=3;break;case"AAAsmall":wt=dt>=7;break}return wt},n.mostReadable=function(q,it,nt){var dt=null,Tt=0,wt,Ct,It,Nt;nt=nt||{},Ct=nt.includeFallbackColors,It=nt.level,Nt=nt.size;for(var te=0;teTt&&(Tt=wt,dt=n(it[te]));return n.isReadable(q,dt,{level:It,size:Nt})||!Ct?dt:(nt.includeFallbackColors=!1,n.mostReadable(q,["#fff","#000"],nt))};var B=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=n.hexNames=I(B);function I(q){var it={};for(var nt in q)q.hasOwnProperty(nt)&&(it[q[nt]]=nt);return it}function F(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function j(q,it){rt(q)&&(q="100%");var nt=ct(q);return q=e(it,r(0,parseFloat(q))),nt&&(q=parseInt(q*it,10)/100),u.abs(q-it)<1e-6?1:q%it/parseFloat(it)}function N(q){return e(1,r(0,q))}function G(q){return parseInt(q,16)}function rt(q){return typeof q=="string"&&q.indexOf(".")!=-1&&parseFloat(q)===1}function ct(q){return typeof q=="string"&&q.indexOf("%")!=-1}function st(q){return q.length==1?"0"+q:""+q}function et(q){return q<=1&&(q=q*100+"%"),q}function Z(q){return u.round(parseFloat(q)*255).toString(16)}function ot(q){return G(q)/255}var X=(function(){var q="[-\\+]?\\d+%?",it="[-\\+]?\\d*\\.\\d+%?",nt="(?:"+it+")|(?:"+q+")",dt="[\\s|\\(]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")\\s*\\)?",Tt="[\\s|\\(]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")\\s*\\)?";return{CSS_UNIT:new RegExp(nt),rgb:new RegExp("rgb"+dt),rgba:new RegExp("rgba"+Tt),hsl:new RegExp("hsl"+dt),hsla:new RegExp("hsla"+Tt),hsv:new RegExp("hsv"+dt),hsva:new RegExp("hsva"+Tt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Q(q){return!!X.CSS_UNIT.exec(q)}function ut(q){q=q.replace(d,"").replace(E,"").toLowerCase();var it=!1;if(B[q])q=B[q],it=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var nt;return(nt=X.rgb.exec(q))?{r:nt[1],g:nt[2],b:nt[3]}:(nt=X.rgba.exec(q))?{r:nt[1],g:nt[2],b:nt[3],a:nt[4]}:(nt=X.hsl.exec(q))?{h:nt[1],s:nt[2],l:nt[3]}:(nt=X.hsla.exec(q))?{h:nt[1],s:nt[2],l:nt[3],a:nt[4]}:(nt=X.hsv.exec(q))?{h:nt[1],s:nt[2],v:nt[3]}:(nt=X.hsva.exec(q))?{h:nt[1],s:nt[2],v:nt[3],a:nt[4]}:(nt=X.hex8.exec(q))?{r:G(nt[1]),g:G(nt[2]),b:G(nt[3]),a:ot(nt[4]),format:it?"name":"hex8"}:(nt=X.hex6.exec(q))?{r:G(nt[1]),g:G(nt[2]),b:G(nt[3]),format:it?"name":"hex"}:(nt=X.hex4.exec(q))?{r:G(nt[1]+""+nt[1]),g:G(nt[2]+""+nt[2]),b:G(nt[3]+""+nt[3]),a:ot(nt[4]+""+nt[4]),format:it?"name":"hex8"}:(nt=X.hex3.exec(q))?{r:G(nt[1]+""+nt[1]),g:G(nt[2]+""+nt[2]),b:G(nt[3]+""+nt[3]),format:it?"name":"hex"}:!1}function J(q){var it,nt;return q=q||{level:"AA",size:"small"},it=(q.level||"AA").toUpperCase(),nt=(q.size||"small").toLowerCase(),it!=="AA"&&it!=="AAA"&&(it="AA"),nt!=="small"&&nt!=="large"&&(nt="small"),{level:it,size:nt}}typeof V<"u"&&V.exports?V.exports=n:window.tinycolor=n})(Math)}),So=Vt(K=>{var V=Dp(),u=Array.isArray;function d(A,t){var e,r;for(e=0;e{V.exports=function(u){var d=u.variantValues,E=u.editType,A=u.colorEditType;A===void 0&&(A=E);var t={editType:E,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};u.noNumericWeightValues&&(t.valType="enumerated",t.values=t.extras,t.extras=void 0,t.min=void 0,t.max=void 0);var e={family:{valType:"string",noBlank:!0,strict:!0,editType:E},size:{valType:"number",min:1,editType:E},color:{valType:"color",editType:A},weight:t,style:{editType:E,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:u.noFontVariant?void 0:{editType:E,valType:"enumerated",values:d||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:u.noFontTextcase?void 0:{editType:E,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:u.noFontLineposition?void 0:{editType:E,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:u.noFontShadow?void 0:{editType:E,valType:"string",dflt:u.autoShadowDflt?"auto":"none"},editType:E};return u.autoSize&&(e.size.dflt="auto"),u.autoColor&&(e.color.dflt="auto"),u.arrayOk&&(e.family.arrayOk=!0,e.weight.arrayOk=!0,e.style.arrayOk=!0,u.noFontVariant||(e.variant.arrayOk=!0),u.noFontTextcase||(e.textcase.arrayOk=!0),u.noFontLineposition||(e.lineposition.arrayOk=!0),u.noFontShadow||(e.shadow.arrayOk=!0),e.size.arrayOk=!0,e.color.arrayOk=!0),e}}),Cg=Vt((K,V)=>{V.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),xd=Vt((K,V)=>{var u=Cg(),d=yu(),E=d({editType:"none"});E.family.dflt=u.HOVERFONT,E.size.dflt=u.HOVERFONTSIZE,V.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:E,grouptitlefont:d({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),mm=Vt((K,V)=>{var u=yu(),d=xd().hoverlabel,E=So().extendFlat;V.exports={hoverlabel:{bgcolor:E({},d.bgcolor,{arrayOk:!0}),bordercolor:E({},d.bordercolor,{arrayOk:!0}),font:u({arrayOk:!0,editType:"none"}),align:E({},d.align,{arrayOk:!0}),namelength:E({},d.namelength,{arrayOk:!0}),showarrow:E({},d.showarrow),editType:"none"}}}),kl=Vt((K,V)=>{var u=yu(),d=mm();V.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:u({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:d.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),a0=Vt((K,V)=>{var u=Af(),d={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},E=d.RdBu;function A(r,i){if(i||(i=E),!r)return i;function n(){try{r=d[r]||JSON.parse(r)}catch{r=i}}return typeof r=="string"&&(n(),typeof r=="string"&&n()),t(r)?r:i}function t(r){var i=0;if(!Array.isArray(r)||r.length<2||!r[0]||!r[r.length-1]||+r[0][0]!=0||+r[r.length-1][0]!=1)return!1;for(var n=0;n{K.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],K.defaultLine="#444",K.lightLine="#eee",K.background="#fff",K.borderLine="#BEC8D9",K.lightFraction=1e3/11}),Pi=Vt((K,V)=>{var u=Af(),d=Lo(),E=nh().isTypedArray,A=V.exports={},t=af();A.defaults=t.defaults;var e=A.defaultLine=t.defaultLine;A.lightLine=t.lightLine;var r=A.background=t.background;A.tinyRGB=function(n){var o=n.toRgb();return"rgb("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+")"},A.rgb=function(n){return A.tinyRGB(u(n))},A.opacity=function(n){return n?u(n).getAlpha():0},A.addOpacity=function(n,o){var a=u(n).toRgb();return"rgba("+Math.round(a.r)+", "+Math.round(a.g)+", "+Math.round(a.b)+", "+o+")"},A.combine=function(n,o){var a=u(n).toRgb();if(a.a===1)return u(n).toRgbString();var s=u(o||r).toRgb(),f=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},v={r:f.r*(1-a.a)+a.r*a.a,g:f.g*(1-a.a)+a.g*a.a,b:f.b*(1-a.a)+a.b*a.a};return u(v).toRgbString()},A.interpolate=function(n,o,a){var s=u(n).toRgb(),f=u(o).toRgb(),v={r:a*s.r+(1-a)*f.r,g:a*s.g+(1-a)*f.g,b:a*s.b+(1-a)*f.b};return u(v).toRgbString()},A.contrast=function(n,o,a){var s=u(n);s.getAlpha()!==1&&(s=u(A.combine(n,r)));var f=s.isDark()?o?s.lighten(o):r:a?s.darken(a):e;return f.toString()},A.stroke=function(n,o){var a=u(o);n.style({stroke:A.tinyRGB(a),"stroke-opacity":a.getAlpha()})},A.fill=function(n,o){var a=u(o);n.style({fill:A.tinyRGB(a),"fill-opacity":a.getAlpha()})},A.clean=function(n){if(!(!n||typeof n!="object")){var o=Object.keys(n),a,s,f,v;for(a=0;a=0)))return n;if(v===3)s[v]>1&&(s[v]=1);else if(s[v]>=1)return n}var g=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+g+", "+s[3]+")":"rgb("+g+")"}}),_d=Vt((K,V)=>{V.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),gm=Vt(K=>{K.counter=function(V,u,d,E){var A=(u||"")+(d?"":"$"),t=E===!1?"":"^";return V==="xy"?new RegExp(t+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+A):new RegExp(t+V+"([2-9]|[1-9][0-9]+)?"+A)}}),Y4=Vt(K=>{var V=Lo(),u=Af(),d=So().extendFlat,E=kl(),A=a0(),t=Pi(),e=_d().DESELECTDIM,r=Lg(),i=gm().counter,n=dm().modHalf,o=nh().isArrayOrTypedArray,a=nh().isTypedArraySpec,s=nh().decodeTypedArraySpec;K.valObjectMeta={data_array:{coerceFunction:function(v,g,m){g.set(o(v)?v:a(v)?s(v):m)}},enumerated:{coerceFunction:function(v,g,m,w){w.coerceNumber&&(v=+v),w.values.indexOf(v)===-1?g.set(m):g.set(v)},validateFunction:function(v,g){g.coerceNumber&&(v=+v);for(var m=g.values,w=0;wx===!0||x===!1;l(v)||w.arrayOk&&Array.isArray(v)&&v.length>0&&v.every(l)?g.set(v):g.set(m)}},number:{coerceFunction:function(v,g,m,w){a(v)&&(v=s(v)),!V(v)||w.min!==void 0&&vw.max?g.set(m):g.set(+v)}},integer:{coerceFunction:function(v,g,m,w){if((w.extras||[]).indexOf(v)!==-1){g.set(v);return}a(v)&&(v=s(v)),v%1||!V(v)||w.min!==void 0&&vw.max?g.set(m):g.set(+v)}},string:{coerceFunction:function(v,g,m,w){if(typeof v!="string"){var l=typeof v=="number";w.strict===!0||!l?g.set(m):g.set(String(v))}else w.noBlank&&!v?g.set(m):g.set(v)}},color:{coerceFunction:function(v,g,m){a(v)&&(v=s(v)),u(v).isValid()?g.set(v):g.set(m)}},colorlist:{coerceFunction:function(v,g,m){function w(l){return u(l).isValid()}!Array.isArray(v)||!v.length?g.set(m):v.every(w)?g.set(v):g.set(m)}},colorscale:{coerceFunction:function(v,g,m){g.set(A.get(v,m))}},angle:{coerceFunction:function(v,g,m){a(v)&&(v=s(v)),v==="auto"?g.set("auto"):V(v)?g.set(n(+v,360)):g.set(m)}},subplotid:{coerceFunction:function(v,g,m,w){var l=w.regex||i(m);let x=y=>typeof y=="string"&&l.test(y);x(v)||w.arrayOk&&o(v)&&v.length>0&&v.every(x)?g.set(v):g.set(m)},validateFunction:function(v,g){var m=g.dflt;return v===m?!0:typeof v!="string"?!1:!!i(m).test(v)}},flaglist:{coerceFunction:function(v,g,m,w){if((w.extras||[]).indexOf(v)!==-1){g.set(v);return}if(typeof v!="string"){g.set(m);return}for(var l=v.split("+"),x=0;x{var u={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},d={};function E(A,t){for(var e in A){var r=A[e];r.valType?t[e]=r.dflt:(t[e]||(t[e]={}),E(r,t[e]))}}E(u,d),V.exports={configAttributes:u,dfltConfig:d}}),J_=Vt((K,V)=>{var u=Ni(),d=Lo(),E=[];V.exports=function(A,t){if(E.indexOf(A)!==-1)return;E.push(A);var e=1e3;d(t)?e=t:t==="long"&&(e=3e3);var r=u.select("body").selectAll(".plotly-notifier").data([0]);r.enter().append("div").classed("plotly-notifier",!0);var i=r.selectAll(".notifier-note").data(E);function n(o){o.duration(700).style("opacity",0).each("end",function(a){var s=E.indexOf(a);s!==-1&&E.splice(s,1),u.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var a=u.select(this);a.append("button").classed("notifier-close",!0).html("×").on("click",function(){a.transition().call(n)});for(var s=a.append("p"),f=o.split(//g),v=0;v{var u=i0().dfltConfig,d=J_(),E=V.exports={};E.log=function(){var A;if(u.logging>1){var t=["LOG:"];for(A=0;A1){var e=[];for(A=0;A"),"long")}},E.warn=function(){var A;if(u.logging>0){var t=["WARN:"];for(A=0;A0){var e=[];for(A=0;A"),"stick")}},E.error=function(){var A;if(u.logging>0){var t=["ERROR:"];for(A=0;A0){var e=[];for(A=0;A"),"stick")}}}),Dy=Vt((K,V)=>{V.exports=function(){}}),Q_=Vt((K,V)=>{V.exports=function(u,d){if(d instanceof RegExp){for(var E=d.toString(),A=0;A{V.exports=u;function u(){var d=new Float32Array(16);return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),$4=Vt((K,V)=>{V.exports=u;function u(d){var E=new Float32Array(16);return E[0]=d[0],E[1]=d[1],E[2]=d[2],E[3]=d[3],E[4]=d[4],E[5]=d[5],E[6]=d[6],E[7]=d[7],E[8]=d[8],E[9]=d[9],E[10]=d[10],E[11]=d[11],E[12]=d[12],E[13]=d[13],E[14]=d[14],E[15]=d[15],E}}),J4=Vt((K,V)=>{V.exports=u;function u(d,E){return d[0]=E[0],d[1]=E[1],d[2]=E[2],d[3]=E[3],d[4]=E[4],d[5]=E[5],d[6]=E[6],d[7]=E[7],d[8]=E[8],d[9]=E[9],d[10]=E[10],d[11]=E[11],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15],d}}),tb=Vt((K,V)=>{V.exports=u;function u(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),Q4=Vt((K,V)=>{V.exports=u;function u(d,E){if(d===E){var A=E[1],t=E[2],e=E[3],r=E[6],i=E[7],n=E[11];d[1]=E[4],d[2]=E[8],d[3]=E[12],d[4]=A,d[6]=E[9],d[7]=E[13],d[8]=t,d[9]=r,d[11]=E[14],d[12]=e,d[13]=i,d[14]=n}else d[0]=E[0],d[1]=E[4],d[2]=E[8],d[3]=E[12],d[4]=E[1],d[5]=E[5],d[6]=E[9],d[7]=E[13],d[8]=E[2],d[9]=E[6],d[10]=E[10],d[11]=E[14],d[12]=E[3],d[13]=E[7],d[14]=E[11],d[15]=E[15];return d}}),tT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=E[4],n=E[5],o=E[6],a=E[7],s=E[8],f=E[9],v=E[10],g=E[11],m=E[12],w=E[13],l=E[14],x=E[15],y=A*n-t*i,S=A*o-e*i,k=A*a-r*i,M=t*o-e*n,T=t*a-r*n,c=e*a-r*o,h=s*w-f*m,b=s*l-v*m,_=s*x-g*m,P=f*l-v*w,z=f*x-g*w,D=v*x-g*l,B=y*D-S*z+k*P+M*_-T*b+c*h;return B?(B=1/B,d[0]=(n*D-o*z+a*P)*B,d[1]=(e*z-t*D-r*P)*B,d[2]=(w*c-l*T+x*M)*B,d[3]=(v*T-f*c-g*M)*B,d[4]=(o*_-i*D-a*b)*B,d[5]=(A*D-e*_+r*b)*B,d[6]=(l*k-m*c-x*S)*B,d[7]=(s*c-v*k+g*S)*B,d[8]=(i*z-n*_+a*h)*B,d[9]=(t*_-A*z-r*h)*B,d[10]=(m*T-w*k+x*y)*B,d[11]=(f*k-s*T-g*y)*B,d[12]=(n*b-i*P-o*h)*B,d[13]=(A*P-t*b+e*h)*B,d[14]=(w*S-m*M-l*y)*B,d[15]=(s*M-f*S+v*y)*B,d):null}}),eT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=E[4],n=E[5],o=E[6],a=E[7],s=E[8],f=E[9],v=E[10],g=E[11],m=E[12],w=E[13],l=E[14],x=E[15];return d[0]=n*(v*x-g*l)-f*(o*x-a*l)+w*(o*g-a*v),d[1]=-(t*(v*x-g*l)-f*(e*x-r*l)+w*(e*g-r*v)),d[2]=t*(o*x-a*l)-n*(e*x-r*l)+w*(e*a-r*o),d[3]=-(t*(o*g-a*v)-n*(e*g-r*v)+f*(e*a-r*o)),d[4]=-(i*(v*x-g*l)-s*(o*x-a*l)+m*(o*g-a*v)),d[5]=A*(v*x-g*l)-s*(e*x-r*l)+m*(e*g-r*v),d[6]=-(A*(o*x-a*l)-i*(e*x-r*l)+m*(e*a-r*o)),d[7]=A*(o*g-a*v)-i*(e*g-r*v)+s*(e*a-r*o),d[8]=i*(f*x-g*w)-s*(n*x-a*w)+m*(n*g-a*f),d[9]=-(A*(f*x-g*w)-s*(t*x-r*w)+m*(t*g-r*f)),d[10]=A*(n*x-a*w)-i*(t*x-r*w)+m*(t*a-r*n),d[11]=-(A*(n*g-a*f)-i*(t*g-r*f)+s*(t*a-r*n)),d[12]=-(i*(f*l-v*w)-s*(n*l-o*w)+m*(n*v-o*f)),d[13]=A*(f*l-v*w)-s*(t*l-e*w)+m*(t*v-e*f),d[14]=-(A*(n*l-o*w)-i*(t*l-e*w)+m*(t*o-e*n)),d[15]=A*(n*v-o*f)-i*(t*v-e*f)+s*(t*o-e*n),d}}),rT=Vt((K,V)=>{V.exports=u;function u(d){var E=d[0],A=d[1],t=d[2],e=d[3],r=d[4],i=d[5],n=d[6],o=d[7],a=d[8],s=d[9],f=d[10],v=d[11],g=d[12],m=d[13],w=d[14],l=d[15],x=E*i-A*r,y=E*n-t*r,S=E*o-e*r,k=A*n-t*i,M=A*o-e*i,T=t*o-e*n,c=a*m-s*g,h=a*w-f*g,b=a*l-v*g,_=s*w-f*m,P=s*l-v*m,z=f*l-v*w;return x*z-y*P+S*_+k*b-M*h+T*c}}),nT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=E[0],e=E[1],r=E[2],i=E[3],n=E[4],o=E[5],a=E[6],s=E[7],f=E[8],v=E[9],g=E[10],m=E[11],w=E[12],l=E[13],x=E[14],y=E[15],S=A[0],k=A[1],M=A[2],T=A[3];return d[0]=S*t+k*n+M*f+T*w,d[1]=S*e+k*o+M*v+T*l,d[2]=S*r+k*a+M*g+T*x,d[3]=S*i+k*s+M*m+T*y,S=A[4],k=A[5],M=A[6],T=A[7],d[4]=S*t+k*n+M*f+T*w,d[5]=S*e+k*o+M*v+T*l,d[6]=S*r+k*a+M*g+T*x,d[7]=S*i+k*s+M*m+T*y,S=A[8],k=A[9],M=A[10],T=A[11],d[8]=S*t+k*n+M*f+T*w,d[9]=S*e+k*o+M*v+T*l,d[10]=S*r+k*a+M*g+T*x,d[11]=S*i+k*s+M*m+T*y,S=A[12],k=A[13],M=A[14],T=A[15],d[12]=S*t+k*n+M*f+T*w,d[13]=S*e+k*o+M*v+T*l,d[14]=S*r+k*a+M*g+T*x,d[15]=S*i+k*s+M*m+T*y,d}}),aT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=A[0],e=A[1],r=A[2],i,n,o,a,s,f,v,g,m,w,l,x;return E===d?(d[12]=E[0]*t+E[4]*e+E[8]*r+E[12],d[13]=E[1]*t+E[5]*e+E[9]*r+E[13],d[14]=E[2]*t+E[6]*e+E[10]*r+E[14],d[15]=E[3]*t+E[7]*e+E[11]*r+E[15]):(i=E[0],n=E[1],o=E[2],a=E[3],s=E[4],f=E[5],v=E[6],g=E[7],m=E[8],w=E[9],l=E[10],x=E[11],d[0]=i,d[1]=n,d[2]=o,d[3]=a,d[4]=s,d[5]=f,d[6]=v,d[7]=g,d[8]=m,d[9]=w,d[10]=l,d[11]=x,d[12]=i*t+s*e+m*r+E[12],d[13]=n*t+f*e+w*r+E[13],d[14]=o*t+v*e+l*r+E[14],d[15]=a*t+g*e+x*r+E[15]),d}}),iT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=A[0],e=A[1],r=A[2];return d[0]=E[0]*t,d[1]=E[1]*t,d[2]=E[2]*t,d[3]=E[3]*t,d[4]=E[4]*e,d[5]=E[5]*e,d[6]=E[6]*e,d[7]=E[7]*e,d[8]=E[8]*r,d[9]=E[9]*r,d[10]=E[10]*r,d[11]=E[11]*r,d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15],d}}),oT=Vt((K,V)=>{V.exports=u;function u(d,E,A,t){var e=t[0],r=t[1],i=t[2],n=Math.sqrt(e*e+r*r+i*i),o,a,s,f,v,g,m,w,l,x,y,S,k,M,T,c,h,b,_,P,z,D,B,R;return Math.abs(n)<1e-6?null:(n=1/n,e*=n,r*=n,i*=n,o=Math.sin(A),a=Math.cos(A),s=1-a,f=E[0],v=E[1],g=E[2],m=E[3],w=E[4],l=E[5],x=E[6],y=E[7],S=E[8],k=E[9],M=E[10],T=E[11],c=e*e*s+a,h=r*e*s+i*o,b=i*e*s-r*o,_=e*r*s-i*o,P=r*r*s+a,z=i*r*s+e*o,D=e*i*s+r*o,B=r*i*s-e*o,R=i*i*s+a,d[0]=f*c+w*h+S*b,d[1]=v*c+l*h+k*b,d[2]=g*c+x*h+M*b,d[3]=m*c+y*h+T*b,d[4]=f*_+w*P+S*z,d[5]=v*_+l*P+k*z,d[6]=g*_+x*P+M*z,d[7]=m*_+y*P+T*z,d[8]=f*D+w*B+S*R,d[9]=v*D+l*B+k*R,d[10]=g*D+x*B+M*R,d[11]=m*D+y*B+T*R,E!==d&&(d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d)}}),sT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[4],i=E[5],n=E[6],o=E[7],a=E[8],s=E[9],f=E[10],v=E[11];return E!==d&&(d[0]=E[0],d[1]=E[1],d[2]=E[2],d[3]=E[3],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[4]=r*e+a*t,d[5]=i*e+s*t,d[6]=n*e+f*t,d[7]=o*e+v*t,d[8]=a*e-r*t,d[9]=s*e-i*t,d[10]=f*e-n*t,d[11]=v*e-o*t,d}}),lT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[0],i=E[1],n=E[2],o=E[3],a=E[8],s=E[9],f=E[10],v=E[11];return E!==d&&(d[4]=E[4],d[5]=E[5],d[6]=E[6],d[7]=E[7],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[0]=r*e-a*t,d[1]=i*e-s*t,d[2]=n*e-f*t,d[3]=o*e-v*t,d[8]=r*t+a*e,d[9]=i*t+s*e,d[10]=n*t+f*e,d[11]=o*t+v*e,d}}),uT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[0],i=E[1],n=E[2],o=E[3],a=E[4],s=E[5],f=E[6],v=E[7];return E!==d&&(d[8]=E[8],d[9]=E[9],d[10]=E[10],d[11]=E[11],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[0]=r*e+a*t,d[1]=i*e+s*t,d[2]=n*e+f*t,d[3]=o*e+v*t,d[4]=a*e-r*t,d[5]=s*e-i*t,d[6]=f*e-n*t,d[7]=v*e-o*t,d}}),cT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t,e,r,i=A[0],n=A[1],o=A[2],a=Math.sqrt(i*i+n*n+o*o);return Math.abs(a)<1e-6?null:(a=1/a,i*=a,n*=a,o*=a,t=Math.sin(E),e=Math.cos(E),r=1-e,d[0]=i*i*r+e,d[1]=n*i*r+o*t,d[2]=o*i*r-n*t,d[3]=0,d[4]=i*n*r-o*t,d[5]=n*n*r+e,d[6]=o*n*r+i*t,d[7]=0,d[8]=i*o*r+n*t,d[9]=n*o*r-i*t,d[10]=o*o*r+e,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d)}}),fT=Vt((K,V)=>{V.exports=u;function u(d,E,A){var t=E[0],e=E[1],r=E[2],i=E[3],n=t+t,o=e+e,a=r+r,s=t*n,f=t*o,v=t*a,g=e*o,m=e*a,w=r*a,l=i*n,x=i*o,y=i*a;return d[0]=1-(g+w),d[1]=f+y,d[2]=v-x,d[3]=0,d[4]=f-y,d[5]=1-(s+w),d[6]=m+l,d[7]=0,d[8]=v+x,d[9]=m-l,d[10]=1-(s+g),d[11]=0,d[12]=A[0],d[13]=A[1],d[14]=A[2],d[15]=1,d}}),hT=Vt((K,V)=>{V.exports=u;function u(d,E){return d[0]=E[0],d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=E[1],d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=E[2],d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),pT=Vt((K,V)=>{V.exports=u;function u(d,E){return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=E[0],d[13]=E[1],d[14]=E[2],d[15]=1,d}}),dT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=t,d[6]=A,d[7]=0,d[8]=0,d[9]=-A,d[10]=t,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),mT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=t,d[1]=0,d[2]=-A,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=A,d[9]=0,d[10]=t,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),gT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=t,d[1]=A,d[2]=0,d[3]=0,d[4]=-A,d[5]=t,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),vT=Vt((K,V)=>{V.exports=u;function u(d,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=A+A,n=t+t,o=e+e,a=A*i,s=t*i,f=t*n,v=e*i,g=e*n,m=e*o,w=r*i,l=r*n,x=r*o;return d[0]=1-f-m,d[1]=s+x,d[2]=v-l,d[3]=0,d[4]=s-x,d[5]=1-a-m,d[6]=g+w,d[7]=0,d[8]=v+l,d[9]=g-w,d[10]=1-a-f,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),yT=Vt((K,V)=>{V.exports=u;function u(d,E,A,t,e,r,i){var n=1/(A-E),o=1/(e-t),a=1/(r-i);return d[0]=r*2*n,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=r*2*o,d[6]=0,d[7]=0,d[8]=(A+E)*n,d[9]=(e+t)*o,d[10]=(i+r)*a,d[11]=-1,d[12]=0,d[13]=0,d[14]=i*r*2*a,d[15]=0,d}}),xT=Vt((K,V)=>{V.exports=u;function u(d,E,A,t,e){var r=1/Math.tan(E/2),i=1/(t-e);return d[0]=r/A,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=r,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=(e+t)*i,d[11]=-1,d[12]=0,d[13]=0,d[14]=2*e*t*i,d[15]=0,d}}),_T=Vt((K,V)=>{V.exports=u;function u(d,E,A,t){var e=Math.tan(E.upDegrees*Math.PI/180),r=Math.tan(E.downDegrees*Math.PI/180),i=Math.tan(E.leftDegrees*Math.PI/180),n=Math.tan(E.rightDegrees*Math.PI/180),o=2/(i+n),a=2/(e+r);return d[0]=o,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=a,d[6]=0,d[7]=0,d[8]=-((i-n)*o*.5),d[9]=(e-r)*a*.5,d[10]=t/(A-t),d[11]=-1,d[12]=0,d[13]=0,d[14]=t*A/(A-t),d[15]=0,d}}),bT=Vt((K,V)=>{V.exports=u;function u(d,E,A,t,e,r,i){var n=1/(E-A),o=1/(t-e),a=1/(r-i);return d[0]=-2*n,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*o,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*a,d[11]=0,d[12]=(E+A)*n,d[13]=(e+t)*o,d[14]=(i+r)*a,d[15]=1,d}}),wT=Vt((K,V)=>{var u=tb();V.exports=d;function d(E,A,t,e){var r,i,n,o,a,s,f,v,g,m,w=A[0],l=A[1],x=A[2],y=e[0],S=e[1],k=e[2],M=t[0],T=t[1],c=t[2];return Math.abs(w-M)<1e-6&&Math.abs(l-T)<1e-6&&Math.abs(x-c)<1e-6?u(E):(f=w-M,v=l-T,g=x-c,m=1/Math.sqrt(f*f+v*v+g*g),f*=m,v*=m,g*=m,r=S*g-k*v,i=k*f-y*g,n=y*v-S*f,m=Math.sqrt(r*r+i*i+n*n),m?(m=1/m,r*=m,i*=m,n*=m):(r=0,i=0,n=0),o=v*n-g*i,a=g*r-f*n,s=f*i-v*r,m=Math.sqrt(o*o+a*a+s*s),m?(m=1/m,o*=m,a*=m,s*=m):(o=0,a=0,s=0),E[0]=r,E[1]=o,E[2]=f,E[3]=0,E[4]=i,E[5]=a,E[6]=v,E[7]=0,E[8]=n,E[9]=s,E[10]=g,E[11]=0,E[12]=-(r*w+i*l+n*x),E[13]=-(o*w+a*l+s*x),E[14]=-(f*w+v*l+g*x),E[15]=1,E)}}),TT=Vt((K,V)=>{V.exports=u;function u(d){return"mat4("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+", "+d[6]+", "+d[7]+", "+d[8]+", "+d[9]+", "+d[10]+", "+d[11]+", "+d[12]+", "+d[13]+", "+d[14]+", "+d[15]+")"}}),eb=Vt((K,V)=>{V.exports={create:X4(),clone:$4(),copy:J4(),identity:tb(),transpose:Q4(),invert:tT(),adjoint:eT(),determinant:rT(),multiply:nT(),translate:aT(),scale:iT(),rotate:oT(),rotateX:sT(),rotateY:lT(),rotateZ:uT(),fromRotation:cT(),fromRotationTranslation:fT(),fromScaling:hT(),fromTranslation:pT(),fromXRotation:dT(),fromYRotation:mT(),fromZRotation:gT(),fromQuat:vT(),frustum:yT(),perspective:xT(),perspectiveFromFieldOfView:_T(),ortho:bT(),lookAt:wT(),str:TT()}}),Fy=Vt(K=>{var V=eb();K.init2dArray=function(u,d){for(var E=new Array(u),A=0;A{var u=Ni(),d=bd(),E=Fy(),A=eb();function t(w){var l;if(typeof w=="string"){if(l=document.getElementById(w),l===null)throw new Error("No DOM element with id '"+w+"' exists on the page.");return l}else if(w==null)throw new Error("DOM element provided is null or undefined");return w}function e(w){var l=u.select(w);return l.node()instanceof HTMLElement&&l.size()&&l.classed("js-plotly-plot")}function r(w){var l=w&&w.parentNode;l&&l.removeChild(w)}function i(w,l){n("global",w,l)}function n(w,l,x){var y="plotly.js-style-"+w,S=document.getElementById(y);if(!(S&&S.matches(".no-inline-styles"))){S||(S=document.createElement("style"),S.setAttribute("id",y),S.appendChild(document.createTextNode("")),document.head.appendChild(S));var k=S.sheet;k?k.insertRule?k.insertRule(l+"{"+x+"}",0):k.addRule?k.addRule(l,x,0):d.warn("addStyleRule failed"):d.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function o(w){var l="plotly.js-style-"+w,x=document.getElementById(l);x&&r(x)}function a(w,l,x,y,S,k){var M=y.split(":"),T=S.split(":"),c="data-btn-style-event-added";k||(k=document),k.querySelectorAll(w).forEach(function(h){h.getAttribute(c)||(h.addEventListener("mouseenter",function(){var b=this.querySelector(x);b&&(b.style[M[0]]=M[1])}),h.addEventListener("mouseleave",function(){var b=this.querySelector(x);b&&(l&&this.matches(l)?b.style[M[0]]=M[1]:b.style[T[0]]=T[1])}),h.setAttribute(c,!0))})}function s(w){var l=v(w),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.forEach(function(y){var S=f(y);if(S){var k=E.convertCssMatrix(S);x=A.multiply(x,x,k)}}),x}function f(w){var l=window.getComputedStyle(w,null),x=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("-moz-transform")||l.getPropertyValue("-ms-transform")||l.getPropertyValue("-o-transform")||l.getPropertyValue("transform");return x==="none"?null:x.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(y){return+y})}function v(w){for(var l=[];g(w);)l.push(w),w=w.parentNode,typeof ShadowRoot=="function"&&w instanceof ShadowRoot&&(w=w.host);return l}function g(w){return w&&(w instanceof Element||w instanceof HTMLElement)}function m(w,l){return w&&l&&w.top===l.top&&w.left===l.left&&w.right===l.right&&w.bottom===l.bottom}V.exports={getGraphDiv:t,isPlotDiv:e,removeElement:r,addStyleRule:i,addRelatedStyleRule:n,deleteRelatedStyleRule:o,setStyleOnHover:a,getFullTransformMatrix:s,getElementTransformMatrix:f,getElementAndAncestors:v,equalDomRects:m}}),Pg=Vt((K,V)=>{V.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),Cu=Vt((K,V)=>{var u=So().extendFlat,d=Dp(),E={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},A={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},t=E.flags.slice().concat(["fullReplot"]),e=A.flags.slice().concat("layoutReplot");V.exports={traces:E,layout:A,traceFlags:function(){return r(t)},layoutFlags:function(){return r(e)},update:function(o,a){var s=a.editType;if(s&&s!=="none")for(var f=s.split("+"),v=0;v{K.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},K.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),rb=Vt((K,V)=>{V.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),yl=Vt(K=>{var{DATE_FORMAT_LINK:V,FORMAT_LINK:u}=rb(),d=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function E({supportOther:A}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(A?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,u,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,V,"for details on the date formatting syntax.",d].join(" ")}K.templateFormatStringDescription=E,K.hovertemplateAttrs=({editType:A="none",arrayOk:t}={},e={})=>vd({valType:"string",dflt:"",editType:A},t!==!1?{arrayOk:!0}:{}),K.texttemplateAttrs=({editType:A="calc",arrayOk:t}={},e={})=>vd({valType:"string",dflt:"",editType:A},t!==!1?{arrayOk:!0}:{}),K.shapeTexttemplateAttrs=({editType:A="arraydraw",newshape:t}={},e={})=>({valType:"string",dflt:"",editType:A}),K.templatefallbackAttrs=({editType:A="none"}={})=>({valType:"any",dflt:"-",editType:A})}),By=Vt((K,V)=>{function u(x,y){return y?y.d2l(x):x}function d(x,y){return y?y.l2d(x):x}function E(x){return x.x0}function A(x){return x.x1}function t(x){return x.y0}function e(x){return x.y1}function r(x){return x.x0shift||0}function i(x){return x.x1shift||0}function n(x){return x.y0shift||0}function o(x){return x.y1shift||0}function a(x,y){return u(x.x1,y)+i(x)-u(x.x0,y)-r(x)}function s(x,y,S){return u(x.y1,S)+o(x)-u(x.y0,S)-n(x)}function f(x,y){return Math.abs(a(x,y))}function v(x,y,S){return Math.abs(s(x,y,S))}function g(x,y,S){return x.type!=="line"?void 0:Math.sqrt(Math.pow(a(x,y),2)+Math.pow(s(x,y,S),2))}function m(x,y){return d((u(x.x1,y)+i(x)+u(x.x0,y)+r(x))/2,y)}function w(x,y,S){return d((u(x.y1,S)+o(x)+u(x.y0,S)+n(x))/2,S)}function l(x,y,S){return x.type!=="line"?void 0:s(x,y,S)/a(x,y)}V.exports={x0:E,x1:A,y0:t,y1:e,slope:l,dx:a,dy:s,width:f,height:v,length:g,xcenter:m,ycenter:w}}),kT=Vt((K,V)=>{var u=Cu().overrideAll,d=kl(),E=yu(),A=If().dash,t=So().extendFlat,{shapeTexttemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=By();V.exports=u({newshape:{visible:t({},d.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},d.legend,{}),legendgroup:t({},d.legendgroup,{}),legendgrouptitle:{text:t({},d.legendgrouptitle.text,{}),font:E({})},legendrank:t({},d.legendrank,{}),legendwidth:t({},d.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:t({},A,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:t({},d.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:e({newshape:!0},{keys:Object.keys(i)}),texttemplatefallback:r({editType:"arraydraw"}),font:E({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),AT=Vt((K,V)=>{var u=If().dash,d=So().extendFlat;V.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:d({},u,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Ry=Vt((K,V)=>{V.exports=function(u){var d=u.editType;return{t:{valType:"number",dflt:0,editType:d},r:{valType:"number",dflt:0,editType:d},b:{valType:"number",dflt:0,editType:d},l:{valType:"number",dflt:0,editType:d},editType:d}}}),vm=Vt((K,V)=>{var u=yu(),d=Pg(),E=af(),A=kT(),t=AT(),e=Ry(),r=So().extendFlat,i=u({editType:"calc"});i.family.dflt='"Open Sans", verdana, arial, sans-serif',i.size.dflt=12,i.color.dflt=E.defaultLine,V.exports={font:i,title:{text:{valType:"string",editType:"layoutstyle"},font:u({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:u({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(e({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:E.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:E.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:E.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:A.newshape,activeshape:A.activeshape,newselection:t.newselection,activeselection:t.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},d.transition,{editType:"none"})}}),MT=Vt(()=>{(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var K=document.createElement("style");K.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",K.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(K)}})()}),ji=Vt(K=>{var V=bd(),u=Dy(),d=Q_(),E=Dp(),A=Ig().addStyleRule,t=So(),e=kl(),r=vm(),i=t.extendFlat,n=t.extendDeepAll;K.modules={},K.allCategories={},K.allTypes=[],K.subplotsRegistry={},K.componentsRegistry={},K.layoutArrayContainers=[],K.layoutArrayRegexes=[],K.traceLayoutAttributes={},K.localeRegistry={},K.apiMethodRegistry={},K.collectableSubplotTypes=null,K.register=function(x){if(K.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var y=0;y{var V=pm().timeFormat,u=Lo(),d=bd(),E=dm().mod,A=ks(),t=A.BADNUM,e=A.ONEDAY,r=A.ONEHOUR,i=A.ONEMIN,n=A.ONESEC,o=A.EPOCHJD,a=ji(),s=pm().utcFormat,f=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,g=new Date().getFullYear()-70;function m(B){return B&&a.componentsRegistry.calendars&&typeof B=="string"&&B!=="gregorian"}K.dateTick0=function(B,R){var I=w(B,!!R);if(R<2)return I;var F=K.dateTime2ms(I,B);return F+=e*(R-1),K.ms2DateTime(F,0,B)};function w(B,R){return m(B)?R?a.getComponentMethod("calendars","CANONICAL_SUNDAY")[B]:a.getComponentMethod("calendars","CANONICAL_TICK")[B]:R?"2000-01-02":"2000-01-01"}K.dfltRange=function(B){return m(B)?a.getComponentMethod("calendars","DFLTRANGE")[B]:["2000-01-01","2001-01-01"]},K.isJSDate=function(B){return typeof B=="object"&&B!==null&&typeof B.getTime=="function"};var l,x;K.dateTime2ms=function(B,R){if(K.isJSDate(B)){var I=B.getTimezoneOffset()*i,F=(B.getUTCMinutes()-B.getMinutes())*i+(B.getUTCSeconds()-B.getSeconds())*n+(B.getUTCMilliseconds()-B.getMilliseconds());if(F){var j=3*i;I=I-j/2+E(F-I+j/2,j)}return B=Number(B)-I,B>=l&&B<=x?B:t}if(typeof B!="string"&&typeof B!="number")return t;B=String(B);var N=m(R),G=B.charAt(0);N&&(G==="G"||G==="g")&&(B=B.slice(1),R="");var rt=N&&R.slice(0,7)==="chinese",ct=B.match(rt?v:f);if(!ct)return t;var st=ct[1],et=ct[3]||"1",Z=Number(ct[5]||1),ot=Number(ct[7]||0),X=Number(ct[9]||0),Q=Number(ct[11]||0);if(N){if(st.length===2)return t;st=Number(st);var ut;try{var J=a.getComponentMethod("calendars","getCal")(R);if(rt){var q=et.charAt(et.length-1)==="i";et=parseInt(et,10),ut=J.newDate(st,J.toMonthIndex(st,et,q),Z)}else ut=J.newDate(st,Number(et),Z)}catch{return t}return ut?(ut.toJD()-o)*e+ot*r+X*i+Q*n:t}st.length===2?st=(Number(st)+2e3-g)%100+g:st=Number(st),et-=1;var it=new Date(Date.UTC(2e3,et,Z,ot,X));return it.setUTCFullYear(st),it.getUTCMonth()!==et||it.getUTCDate()!==Z?t:it.getTime()+Q*n},l=K.MIN_MS=K.dateTime2ms("-9999"),x=K.MAX_MS=K.dateTime2ms("9999-12-31 23:59:59.9999"),K.isDateTime=function(B,R){return K.dateTime2ms(B,R)!==t};function y(B,R){return String(B+Math.pow(10,R)).slice(1)}var S=90*e,k=3*r,M=5*i;K.ms2DateTime=function(B,R,I){if(typeof B!="number"||!(B>=l&&B<=x))return t;R||(R=0);var F=Math.floor(E(B+.05,1)*10),j=Math.round(B-F/10),N,G,rt,ct,st,et;if(m(I)){var Z=Math.floor(j/e)+o,ot=Math.floor(E(B,e));try{N=a.getComponentMethod("calendars","getCal")(I).fromJD(Z).formatDate("yyyy-mm-dd")}catch{N=s("G%Y-%m-%d")(new Date(j))}if(N.charAt(0)==="-")for(;N.length<11;)N="-0"+N.slice(1);else for(;N.length<10;)N="0"+N;G=R=l+e&&B<=x-e))return t;var R=Math.floor(E(B+.05,1)*10),I=new Date(Math.round(B-R/10)),F=V("%Y-%m-%d")(I),j=I.getHours(),N=I.getMinutes(),G=I.getSeconds(),rt=I.getUTCMilliseconds()*10+R;return T(F,j,N,G,rt)};function T(B,R,I,F,j){if((R||I||F||j)&&(B+=" "+y(R,2)+":"+y(I,2),(F||j)&&(B+=":"+y(F,2),j))){for(var N=4;j%10===0;)N-=1,j/=10;B+="."+y(j,N)}return B}K.cleanDate=function(B,R,I){if(B===t)return R;if(K.isJSDate(B)||typeof B=="number"&&isFinite(B)){if(m(I))return d.error("JS Dates and milliseconds are incompatible with world calendars",B),R;if(B=K.ms2DateTimeLocal(+B),!B&&R!==void 0)return R}else if(!K.isDateTime(B,I))return d.error("unrecognized date",B),R;return B};var c=/%\d?f/g,h=/%h/g,b={1:"1",2:"1",3:"2",4:"2"};function _(B,R,I,F){B=B.replace(c,function(N){var G=Math.min(+N.charAt(1)||6,6),rt=(R/1e3%1+2).toFixed(G).slice(2).replace(/0+$/,"")||"0";return rt});var j=new Date(Math.floor(R+.05));if(B=B.replace(h,function(){return b[I("%q")(j)]}),m(F))try{B=a.getComponentMethod("calendars","worldCalFmt")(B,R,F)}catch{return"Invalid"}return I(B)(j)}var P=[59,59.9,59.99,59.999,59.9999];function z(B,R){var I=E(B+.05,e),F=y(Math.floor(I/r),2)+":"+y(E(Math.floor(I/i),60),2);if(R!=="M"){u(R)||(R=0);var j=Math.min(E(B/n,60),P[R]),N=(100+j).toFixed(R).slice(1);R>0&&(N=N.replace(/0+$/,"").replace(/[\.]$/,"")),F+=":"+N}return F}K.formatDate=function(B,R,I,F,j,N){if(j=m(j)&&j,!R)if(I==="y")R=N.year;else if(I==="m")R=N.month;else if(I==="d")R=N.dayMonth+` -`+N.year;else return z(B,I)+` -`+_(N.dayMonthYear,B,F,j);return _(R,B,F,j)};var D=3*e;K.incrementMonth=function(B,R,I){I=m(I)&&I;var F=E(B,e);if(B=Math.round(B-F),I)try{var j=Math.round(B/e)+o,N=a.getComponentMethod("calendars","getCal")(I),G=N.fromJD(j);return R%12?N.add(G,R,"m"):N.add(G,R/12,"y"),(G.toJD()-o)*e+F}catch{d.error("invalid ms "+B+" in calendar "+I)}var rt=new Date(B+D);return rt.setUTCMonth(rt.getUTCMonth()+R)+F-D},K.findExactDates=function(B,R){for(var I=0,F=0,j=0,N=0,G,rt,ct=m(R)&&a.getComponentMethod("calendars","getCal")(R),st=0;st{V.exports=function(u){return u}}),Ny=Vt(K=>{var V=Lo(),u=bd(),d=Og(),E=ks().BADNUM,A=1e-9;K.findBin=function(n,o,a){if(V(o.start))return a?Math.ceil((n-o.start)/o.size-A)-1:Math.floor((n-o.start)/o.size+A);var s=0,f=o.length,v=0,g=f>1?(o[f-1]-o[0])/(f-1):1,m,w;for(g>=0?w=a?t:e:w=a?i:r,n+=g*A*(a?-1:1)*(g>=0?1:-1);s90&&u.log("Long binary search..."),s-1};function t(n,o){return no}function i(n,o){return n>=o}K.sorterAsc=function(n,o){return n-o},K.sorterDes=function(n,o){return o-n},K.distinctVals=function(n){var o=n.slice();o.sort(K.sorterAsc);var a;for(a=o.length-1;a>-1&&o[a]===E;a--);for(var s=o[a]-o[0]||1,f=s/(a||1)/1e4,v=[],g,m=0;m<=a;m++){var w=o[m],l=w-g;g===void 0?(v.push(w),g=w):l>f&&(s=Math.min(s,l),v.push(w),g=w)}return{vals:v,minDiff:s}},K.roundUp=function(n,o,a){for(var s=0,f=o.length-1,v,g=0,m=a?0:1,w=a?1:0,l=a?Math.ceil:Math.floor;s0&&(s=1),a&&s)return n.sort(o)}return s?n:n.reverse()},K.findIndexOfMin=function(n,o){o=o||d;for(var a=1/0,s,f=0;f{V.exports=function(u){return Object.keys(u).sort()}}),ET=Vt(K=>{var V=Lo(),u=nh().isArrayOrTypedArray;K.aggNums=function(d,E,A,t){var e,r;if((!t||t>A.length)&&(t=A.length),V(E)||(E=!1),u(A[0])){for(r=new Array(t),e=0;ed.length-1)return d[d.length-1];var A=E%1;return A*d[Math.ceil(E)]+(1-A)*d[Math.floor(E)]}}),zT=Vt((K,V)=>{var u=dm(),d=u.mod,E=u.modHalf,A=Math.PI,t=2*A;function e(w){return w/180*A}function r(w){return w/A*180}function i(w){return Math.abs(w[1]-w[0])>t-1e-14}function n(w,l){return E(l-w,t)}function o(w,l){return Math.abs(n(w,l))}function a(w,l){if(i(l))return!0;var x,y;l[0]y&&(y+=t);var S=d(w,t),k=S+t;return S>=x&&S<=y||k>=x&&k<=y}function s(w,l,x,y){if(!a(l,y))return!1;var S,k;return x[0]=S&&w<=k}function f(w,l,x,y,S,k,M){S=S||0,k=k||0;var T=i([x,y]),c,h,b,_,P;T?(c=0,h=A,b=t):x{K.isLeftAnchor=function(V){return V.xanchor==="left"||V.xanchor==="auto"&&V.x<=1/3},K.isCenterAnchor=function(V){return V.xanchor==="center"||V.xanchor==="auto"&&V.x>1/3&&V.x<2/3},K.isRightAnchor=function(V){return V.xanchor==="right"||V.xanchor==="auto"&&V.x>=2/3},K.isTopAnchor=function(V){return V.yanchor==="top"||V.yanchor==="auto"&&V.y>=2/3},K.isMiddleAnchor=function(V){return V.yanchor==="middle"||V.yanchor==="auto"&&V.y>1/3&&V.y<2/3},K.isBottomAnchor=function(V){return V.yanchor==="bottom"||V.yanchor==="auto"&&V.y<=1/3}}),CT=Vt(K=>{var V=dm().mod;K.segmentsIntersect=u;function u(e,r,i,n,o,a,s,f){var v=i-e,g=o-e,m=s-o,w=n-r,l=a-r,x=f-a,y=v*x-m*w;if(y===0)return null;var S=(g*x-m*l)/y,k=(g*w-v*l)/y;return k<0||k>1||S<0||S>1?null:{x:e+v*S,y:r+w*S}}K.segmentDistance=function(e,r,i,n,o,a,s,f){if(u(e,r,i,n,o,a,s,f))return 0;var v=i-e,g=n-r,m=s-o,w=f-a,l=v*v+g*g,x=m*m+w*w,y=Math.min(d(v,g,l,o-e,a-r),d(v,g,l,s-e,f-r),d(m,w,x,e-o,r-a),d(m,w,x,i-o,n-a));return Math.sqrt(y)};function d(e,r,i,n,o){var a=n*e+o*r;if(a<0)return n*n+o*o;if(a>i){var s=n-e,f=o-r;return s*s+f*f}else{var v=n*r-o*e;return v*v/i}}var E,A,t;K.getTextLocation=function(e,r,i,n){if((e!==A||n!==t)&&(E={},A=e,t=n),E[i])return E[i];var o=e.getPointAtLength(V(i-n/2,r)),a=e.getPointAtLength(V(i+n/2,r)),s=Math.atan((a.y-o.y)/(a.x-o.x)),f=e.getPointAtLength(V(i,r)),v=(f.x*4+o.x+a.x)/6,g=(f.y*4+o.y+a.y)/6,m={x:v,y:g,theta:s};return E[i]=m,m},K.clearLocationCache=function(){A=null},K.getVisibleSegment=function(e,r,i){var n=r.left,o=r.right,a=r.top,s=r.bottom,f=0,v=e.getTotalLength(),g=v,m,w;function l(y){var S=e.getPointAtLength(y);y===0?m=S:y===v&&(w=S);var k=S.xo?S.x-o:0,M=S.ys?S.y-s:0;return Math.sqrt(k*k+M*M)}for(var x=l(f);x;){if(f+=x+i,f>g)return;x=l(f)}for(x=l(g);x;){if(g-=x+i,f>g)return;x=l(g)}return{min:f,max:g,len:g-f,total:v,isClosed:f===0&&g===v&&Math.abs(m.x-w.x)<.1&&Math.abs(m.y-w.y)<.1}},K.findPointOnPath=function(e,r,i,n){n=n||{};for(var o=n.pathLength||e.getTotalLength(),a=n.tolerance||.001,s=n.iterationLimit||30,f=e.getPointAtLength(0)[i]>e.getPointAtLength(o)[i]?-1:1,v=0,g=0,m=o,w,l,x;v0?m=w:g=w,v++}return l}}),jy=Vt(K=>{var V={};K.throttle=function(d,E,A){var t=V[d],e=Date.now();if(!t){for(var r in V)V[r].tst.ts+E){i();return}t.timer=setTimeout(function(){i(),t.timer=null},E)},K.done=function(d){var E=V[d];return!E||!E.timer?Promise.resolve():new Promise(function(A){var t=E.onDone;E.onDone=function(){t&&t(),A(),E.onDone=null}})},K.clear=function(d){if(d)u(V[d]),delete V[d];else for(var E in V)K.clear(E)};function u(d){d&&d.timer!==null&&(clearTimeout(d.timer),d.timer=null)}}),IT=Vt((K,V)=>{V.exports=function(u){u._responsiveChartHandler&&(window.removeEventListener("resize",u._responsiveChartHandler),delete u._responsiveChartHandler)}}),PT=Vt((K,V)=>{V.exports=A,V.exports.isMobile=A,V.exports.default=A;var u=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,d=/CrOS/,E=/android|ipad|playbook|silk/i;function A(t){t||(t={});let e=t.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let r=u.test(e)&&!d.test(e)||!!t.tablet&&E.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(r=!0),r}}),OT=Vt((K,V)=>{var u=Lo(),d=PT();V.exports=function(A){var t;if(A&&A.hasOwnProperty("userAgent")?t=A.userAgent:t=E(),typeof t!="string")return!0;var e=d({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!e)for(var r=t.split(" "),i=1;i-1;o--){var a=r[o];if(a.slice(0,8)==="Version/"){var s=a.slice(8).split(".")[0];if(u(s)&&(s=+s),s>=13)return!0}}}return e};function E(){var A;return typeof navigator<"u"&&(A=navigator.userAgent),A&&A.headers&&typeof A.headers["user-agent"]=="string"&&(A=A.headers["user-agent"]),A}}),DT=Vt((K,V)=>{var u=Ni();V.exports=function(d,E,A){var t=d.selectAll("g."+A.replace(/\s/g,".")).data(E,function(r){return r[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",A),t.order();var e=d.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(r){r[0][e]=u.select(this)}),t}}),FT=Vt((K,V)=>{var u=ji();V.exports=function(d,E){for(var A=d._context.locale,t=0;t<2;t++){for(var e=d._context.locales,r=0;r<2;r++){var i=(e[A]||{}).dictionary;if(i){var n=i[E];if(n)return n}e=u.localeRegistry}var o=A.split("-")[0];if(o===A)break;A=o}return E}}),nb=Vt((K,V)=>{V.exports=function(u){for(var d={},E=[],A=0,t=0;t{V.exports=function(A){for(var t=E(A)?d:u,e=[],r=0;r{V.exports=function(u,d){if(!d)return u;var E=1/Math.abs(d),A=E>1?(E*u+E*d)/E:u+d,t=String(A).length;if(t>16){var e=String(d).length,r=String(u).length;if(t>=r+e){var i=parseFloat(A).toPrecision(12);i.indexOf("e+")===-1&&(A=+i)}}return A}}),NT=Vt((K,V)=>{var u=Lo(),d=ks().BADNUM,E=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;V.exports=function(A){return typeof A=="string"&&(A=A.replace(E,"")),u(A)?Number(A):d}}),Xr=Vt((K,V)=>{var u=Ni(),d=pm().utcFormat,E=X_().format,A=Lo(),t=ks(),e=t.FP_SAFE,r=-e,i=t.BADNUM,n=V.exports={};n.adjustFormat=function(J){return!J||/^\d[.]\df/.test(J)||/[.]\d%/.test(J)?J:J==="0.f"?"~f":/^\d%/.test(J)?"~%":/^\ds/.test(J)?"~s":!/^[~,.0$]/.test(J)&&/[&fps]/.test(J)?"~"+J:J};var o={};n.warnBadFormat=function(J){var q=String(J);o[q]||(o[q]=1,n.warn('encountered bad format: "'+q+'"'))},n.noFormat=function(J){return String(J)},n.numberFormat=function(J){var q;try{q=E(n.adjustFormat(J))}catch{return n.warnBadFormat(J),n.noFormat}return q},n.nestedProperty=Lg(),n.keyedContainer=G4(),n.relativeAttr=Z4(),n.isPlainObject=Dp(),n.toLogRange=Oy(),n.relinkPrivateKeys=K4();var a=nh();n.isArrayBuffer=a.isArrayBuffer,n.isTypedArray=a.isTypedArray,n.isArrayOrTypedArray=a.isArrayOrTypedArray,n.isArray1D=a.isArray1D,n.ensureArray=a.ensureArray,n.concat=a.concat,n.maxRowLength=a.maxRowLength,n.minRowLength=a.minRowLength;var s=dm();n.mod=s.mod,n.modHalf=s.modHalf;var f=Y4();n.valObjectMeta=f.valObjectMeta,n.coerce=f.coerce,n.coerce2=f.coerce2,n.coerceFont=f.coerceFont,n.coercePattern=f.coercePattern,n.coerceHoverinfo=f.coerceHoverinfo,n.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,n.validate=f.validate;var v=ST();n.dateTime2ms=v.dateTime2ms,n.isDateTime=v.isDateTime,n.ms2DateTime=v.ms2DateTime,n.ms2DateTimeLocal=v.ms2DateTimeLocal,n.cleanDate=v.cleanDate,n.isJSDate=v.isJSDate,n.formatDate=v.formatDate,n.incrementMonth=v.incrementMonth,n.dateTick0=v.dateTick0,n.dfltRange=v.dfltRange,n.findExactDates=v.findExactDates,n.MIN_MS=v.MIN_MS,n.MAX_MS=v.MAX_MS;var g=Ny();n.findBin=g.findBin,n.sorterAsc=g.sorterAsc,n.sorterDes=g.sorterDes,n.distinctVals=g.distinctVals,n.roundUp=g.roundUp,n.sort=g.sort,n.findIndexOfMin=g.findIndexOfMin,n.sortObjectKeys=wd();var m=ET();n.aggNums=m.aggNums,n.len=m.len,n.mean=m.mean,n.geometricMean=m.geometricMean,n.median=m.median,n.midRange=m.midRange,n.variance=m.variance,n.stdev=m.stdev,n.interp=m.interp;var w=Fy();n.init2dArray=w.init2dArray,n.transposeRagged=w.transposeRagged,n.dot=w.dot,n.translationMatrix=w.translationMatrix,n.rotationMatrix=w.rotationMatrix,n.rotationXYMatrix=w.rotationXYMatrix,n.apply3DTransform=w.apply3DTransform,n.apply2DTransform=w.apply2DTransform,n.apply2DTransform2=w.apply2DTransform2,n.convertCssMatrix=w.convertCssMatrix,n.inverseTransformMatrix=w.inverseTransformMatrix;var l=zT();n.deg2rad=l.deg2rad,n.rad2deg=l.rad2deg,n.angleDelta=l.angleDelta,n.angleDist=l.angleDist,n.isFullCircle=l.isFullCircle,n.isAngleInsideSector=l.isAngleInsideSector,n.isPtInsideSector=l.isPtInsideSector,n.pathArc=l.pathArc,n.pathSector=l.pathSector,n.pathAnnulus=l.pathAnnulus;var x=LT();n.isLeftAnchor=x.isLeftAnchor,n.isCenterAnchor=x.isCenterAnchor,n.isRightAnchor=x.isRightAnchor,n.isTopAnchor=x.isTopAnchor,n.isMiddleAnchor=x.isMiddleAnchor,n.isBottomAnchor=x.isBottomAnchor;var y=CT();n.segmentsIntersect=y.segmentsIntersect,n.segmentDistance=y.segmentDistance,n.getTextLocation=y.getTextLocation,n.clearLocationCache=y.clearLocationCache,n.getVisibleSegment=y.getVisibleSegment,n.findPointOnPath=y.findPointOnPath;var S=So();n.extendFlat=S.extendFlat,n.extendDeep=S.extendDeep,n.extendDeepAll=S.extendDeepAll,n.extendDeepNoArrays=S.extendDeepNoArrays;var k=bd();n.log=k.log,n.warn=k.warn,n.error=k.error;var M=gm();n.counterRegex=M.counter;var T=jy();n.throttle=T.throttle,n.throttleDone=T.done,n.clearThrottle=T.clear;var c=Ig();n.getGraphDiv=c.getGraphDiv,n.isPlotDiv=c.isPlotDiv,n.removeElement=c.removeElement,n.addStyleRule=c.addStyleRule,n.addRelatedStyleRule=c.addRelatedStyleRule,n.deleteRelatedStyleRule=c.deleteRelatedStyleRule,n.setStyleOnHover=c.setStyleOnHover,n.getFullTransformMatrix=c.getFullTransformMatrix,n.getElementTransformMatrix=c.getElementTransformMatrix,n.getElementAndAncestors=c.getElementAndAncestors,n.equalDomRects=c.equalDomRects,n.clearResponsive=IT(),n.preserveDrawingBuffer=OT(),n.makeTraceGroups=DT(),n._=FT(),n.notifier=J_(),n.filterUnique=nb(),n.filterVisible=BT(),n.pushUnique=Q_(),n.increment=RT(),n.cleanNumber=NT(),n.ensureNumber=function(J){return A(J)?(J=Number(J),J>e||J=q?!1:A(J)&&J>=0&&J%1===0},n.noop=Dy(),n.identity=Og(),n.repeat=function(J,q){for(var it=new Array(q),nt=0;ntit?Math.max(it,Math.min(q,J)):Math.max(q,Math.min(it,J))},n.bBoxIntersect=function(J,q,it){return it=it||0,J.left<=q.right+it&&q.left<=J.right+it&&J.top<=q.bottom+it&&q.top<=J.bottom+it},n.simpleMap=function(J,q,it,nt,dt){for(var Tt=J.length,wt=new Array(Tt),Ct=0;Ct=Math.pow(2,it)?dt>10?(n.warn("randstr failed uniqueness"),wt):J(q,it,nt,(dt||0)+1):wt},n.OptionControl=function(J,q){J||(J={}),q||(q="opt");var it={};return it.optionList=[],it._newoption=function(nt){nt[q]=J,it[nt.name]=nt,it.optionList.push(nt)},it["_"+q]=J,it},n.smooth=function(J,q){if(q=Math.round(q)||0,q<2)return J;var it=J.length,nt=2*it,dt=2*q-1,Tt=new Array(dt),wt=new Array(it),Ct,It,Nt,te;for(Ct=0;Ct=nt&&(Nt-=nt*Math.floor(Nt/nt)),Nt<0?Nt=-1-Nt:Nt>=it&&(Nt=nt-1-Nt),te+=J[Nt]*Tt[It];wt[Ct]=te}return wt},n.syncOrAsync=function(J,q,it){var nt,dt;function Tt(){return n.syncOrAsync(J,q,it)}for(;J.length;)if(dt=J.splice(0,1)[0],nt=dt(q),nt&&nt.then)return nt.then(Tt);return it&&it(q)},n.stripTrailingSlash=function(J){return J.slice(-1)==="/"?J.slice(0,-1):J},n.noneOrAll=function(J,q,it){if(J){var nt=!1,dt=!0,Tt,wt;for(Tt=0;Tt0?dt:0})},n.fillArray=function(J,q,it,nt){if(nt=nt||n.identity,n.isArrayOrTypedArray(J))for(var dt=0;dtz.test(window.navigator.userAgent);var D=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var J=D.exec(window.navigator.userAgent);if(J&&J.length===2){var q=parseInt(J[1]);if(!isNaN(q))return q}return null},n.isD3Selection=function(J){return J instanceof u.selection},n.ensureSingle=function(J,q,it,nt){var dt=J.select(q+(it?"."+it:""));if(dt.size())return dt;var Tt=J.append(q);return it&&Tt.classed(it,!0),nt&&Tt.call(nt),Tt},n.ensureSingleById=function(J,q,it,nt){var dt=J.select(q+"#"+it);if(dt.size())return dt;var Tt=J.append(q).attr("id",it);return nt&&Tt.call(nt),Tt},n.objectFromPath=function(J,q){for(var it=J.split("."),nt,dt=nt={},Tt=0;Tt1?dt+wt[1]:"";if(Tt&&(wt.length>1||Ct.length>4||it))for(;nt.test(Ct);)Ct=Ct.replace(nt,"$1"+Tt+"$2");return Ct+It},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var F=/^\w*$/;n.templateString=function(J,q){var it={};return J.replace(n.TEMPLATE_STRING_REGEX,function(nt,dt){var Tt;return F.test(dt)?Tt=q[dt]:(it[dt]=it[dt]||n.nestedProperty(q,dt).get,Tt=it[dt](!0)),Tt!==void 0?Tt:""})};var j={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=J=>et(hm(vd({},J),{opts:j}));var N={max:10,count:0,name:"texttemplate"};n.texttemplateString=J=>et(hm(vd({},J),{opts:N}));var G=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function rt(J){var q=J.match(G);return q?{key:q[1],op:q[2],number:Number(q[3])}:{key:J,op:null,number:null}}var ct={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=J=>et(hm(vd({},J),{opts:ct}));var st=/^[:|\|]/;function et({data:J=[],locale:q,fallback:it,labels:nt={},opts:dt,template:Tt}){return Tt.replace(n.TEMPLATE_STRING_REGEX,(wt,Ct,It)=>{let Nt=["xother","yother"].includes(Ct),te=["_xother","_yother"].includes(Ct),Jt=["_xother_","_yother_"].includes(Ct),ee=["xother_","yother_"].includes(Ct),Zt=Nt||te||ee||Jt;(te||Jt)&&(Ct=Ct.substring(1)),(ee||Jt)&&(Ct=Ct.substring(0,Ct.length-1));let mt=null,bt=null;if(dt.parseMultDiv){var vt=rt(Ct);Ct=vt.key,mt=vt.op,bt=vt.number}let Ut;if(Zt){if(nt[Ct]===void 0)return"";Ut=nt[Ct]}else for(let Me of J)if(Me){if(Me.hasOwnProperty(Ct)){Ut=Me[Ct];break}if(F.test(Ct)||(Ut=n.nestedProperty(Me,Ct).get(!0)),Ut!==void 0)break}if(Ut===void 0){let{count:Me,max:Ce,name:We}=dt,qe=it===!1?wt:it;return Me=Z&&wt<=ot,Nt=Ct>=Z&&Ct<=ot;if(It&&(nt=10*nt+wt-Z),Nt&&(dt=10*dt+Ct-Z),!It||!Nt){if(nt!==dt)return nt-dt;if(wt!==Ct)return wt-Ct}}return dt-nt};var X=2e9;n.seedPseudoRandom=function(){X=2e9},n.pseudoRandom=function(){var J=X;return X=(69069*X+1)%4294967296,Math.abs(X-J)<429496729?n.pseudoRandom():X/4294967296},n.fillText=function(J,q,it){var nt=Array.isArray(it)?function(wt){it.push(wt)}:function(wt){it.text=wt},dt=n.extractOption(J,q,"htx","hovertext");if(n.isValidTextValue(dt))return nt(dt);var Tt=n.extractOption(J,q,"tx","text");if(n.isValidTextValue(Tt))return nt(Tt)},n.isValidTextValue=function(J){return J||J===0},n.formatPercent=function(J,q){q=q||0;for(var it=(Math.round(100*J*Math.pow(10,q))*Math.pow(.1,q)).toFixed(q)+"%",nt=0;nt1&&(Nt=1):Nt=0,n.strTranslate(dt-Nt*(it+wt),Tt-Nt*(nt+Ct))+n.strScale(Nt)+(It?"rotate("+It+(q?"":" "+it+" "+nt)+")":"")},n.setTransormAndDisplay=function(J,q){J.attr("transform",n.getTextTransform(q)),J.style("display",q.scale?null:"none")},n.ensureUniformFontSize=function(J,q){var it=n.extendFlat({},q);return it.size=Math.max(q.size,J._fullLayout.uniformtext.minsize||0),it},n.join2=function(J,q,it){var nt=J.length;return nt>1?J.slice(0,-1).join(q)+it+J[nt-1]:J.join(q)},n.bigFont=function(J){return Math.round(1.2*J)};var Q=n.getFirefoxVersion(),ut=Q!==null&&Q<86;n.getPositionFromD3Event=function(){return ut?[u.event.layerX,u.event.layerY]:[u.event.offsetX,u.event.offsetY]}}),jT=Vt(()=>{var K=Xr(),V={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(d in V)u=d.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),K.addStyleRule(u,V[d]);var u,d}),ab=Vt((K,V)=>{V.exports=!0}),ib=Vt((K,V)=>{var u=ab(),d;typeof window.matchMedia=="function"?d=!window.matchMedia("(hover: none)").matches:d=u,V.exports=d}),o0=Vt((K,V)=>{var u=typeof Reflect=="object"?Reflect:null,d=u&&typeof u.apply=="function"?u.apply:function(S,k,M){return Function.prototype.apply.call(S,k,M)},E;u&&typeof u.ownKeys=="function"?E=u.ownKeys:Object.getOwnPropertySymbols?E=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:E=function(S){return Object.getOwnPropertyNames(S)};function A(S){console&&console.warn&&console.warn(S)}var t=Number.isNaN||function(S){return S!==S};function e(){e.init.call(this)}V.exports=e,V.exports.once=l,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._eventsCount=0,e.prototype._maxListeners=void 0;var r=10;function i(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(e,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||t(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),e.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},e.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||t(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function n(S){return S._maxListeners===void 0?e.defaultMaxListeners:S._maxListeners}e.prototype.getMaxListeners=function(){return n(this)},e.prototype.emit=function(S){for(var k=[],M=1;M0&&(h=k[0]),h instanceof Error)throw h;var b=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw b.context=h,b}var _=c[S];if(_===void 0)return!1;if(typeof _=="function")d(_,this,k);else for(var P=_.length,z=g(_,P),M=0;M0&&b.length>c&&!b.warned){b.warned=!0;var _=new Error("Possible EventEmitter memory leak detected. "+b.length+" "+String(k)+" listeners added. Use emitter.setMaxListeners() to increase limit");_.name="MaxListenersExceededWarning",_.emitter=S,_.type=k,_.count=b.length,A(_)}return S}e.prototype.addListener=function(S,k){return o(this,S,k,!1)},e.prototype.on=e.prototype.addListener,e.prototype.prependListener=function(S,k){return o(this,S,k,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(S,k,M){var T={fired:!1,wrapFn:void 0,target:S,type:k,listener:M},c=a.bind(T);return c.listener=M,T.wrapFn=c,c}e.prototype.once=function(S,k){return i(k),this.on(S,s(this,S,k)),this},e.prototype.prependOnceListener=function(S,k){return i(k),this.prependListener(S,s(this,S,k)),this},e.prototype.removeListener=function(S,k){var M,T,c,h,b;if(i(k),T=this._events,T===void 0)return this;if(M=T[S],M===void 0)return this;if(M===k||M.listener===k)--this._eventsCount===0?this._events=Object.create(null):(delete T[S],T.removeListener&&this.emit("removeListener",S,M.listener||k));else if(typeof M!="function"){for(c=-1,h=M.length-1;h>=0;h--)if(M[h]===k||M[h].listener===k){b=M[h].listener,c=h;break}if(c<0)return this;c===0?M.shift():m(M,c),M.length===1&&(T[S]=M[0]),T.removeListener!==void 0&&this.emit("removeListener",S,b||k)}return this},e.prototype.off=e.prototype.removeListener,e.prototype.removeAllListeners=function(S){var k,M,T;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[S]),this;if(arguments.length===0){var c=Object.keys(M),h;for(T=0;T=0;T--)this.removeListener(S,k[T]);return this};function f(S,k,M){var T=S._events;if(T===void 0)return[];var c=T[k];return c===void 0?[]:typeof c=="function"?M?[c.listener||c]:[c]:M?w(c):g(c,c.length)}e.prototype.listeners=function(S){return f(this,S,!0)},e.prototype.rawListeners=function(S){return f(this,S,!1)},e.listenerCount=function(S,k){return typeof S.listenerCount=="function"?S.listenerCount(k):v.call(S,k)},e.prototype.listenerCount=v;function v(S){var k=this._events;if(k!==void 0){var M=k[S];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}e.prototype.eventNames=function(){return this._eventsCount>0?E(this._events):[]};function g(S,k){for(var M=new Array(k),T=0;T{var u=o0().EventEmitter,d={init:function(E){if(E._ev instanceof u)return E;var A=new u,t=new u;return E._ev=A,E._internalEv=t,E.on=A.on.bind(A),E.once=A.once.bind(A),E.removeListener=A.removeListener.bind(A),E.removeAllListeners=A.removeAllListeners.bind(A),E._internalOn=t.on.bind(t),E._internalOnce=t.once.bind(t),E._removeInternalListener=t.removeListener.bind(t),E._removeAllInternalListeners=t.removeAllListeners.bind(t),E.emit=function(e,r){A.emit(e,r),t.emit(e,r)},typeof E.addEventListener=="function"&&E.addEventListener("wheel",()=>{},{passive:!0}),E},triggerHandler:function(E,A,t){var e,r=E._ev;if(!r)return;var i=r._events[A];if(!i)return;function n(a){if(a.listener){if(r.removeListener(A,a.listener),!a.fired)return a.fired=!0,a.listener.apply(r,[t])}else return a.apply(r,[t])}i=Array.isArray(i)?i:[i];var o;for(o=0;o{var u=Xr(),d=i0().dfltConfig;function E(t,e){for(var r=[],i,n=0;nd.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},A.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},A.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},A.undo=function(t){var e,r;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r{V.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),xm=Vt(K=>{var V=ji(),u=Xr(),d=kl(),E=vm(),A=ob(),t=Pg(),e=i0().configAttributes,r=Cu(),i=u.extendDeepAll,n=u.isPlainObject,o=u.isArrayOrTypedArray,a=u.nestedProperty,s=u.valObjectMeta,f="_isSubplotObj",v="_isLinkedToArray",g="_arrayAttrRegexps",m="_deprecated",w=[f,v,g,m];K.IS_SUBPLOT_OBJ=f,K.IS_LINKED_TO_ARRAY=v,K.DEPRECATED=m,K.UNDERSCORE_ATTRS=w,K.get=function(){var z={};return V.allTypes.forEach(function(D){z[D]=S(D)}),{defs:{valObjects:s,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:r.traces,layout:r.layout},impliedEdits:{}},traces:z,layout:k(),frames:M(),animation:T(t),config:T(e)}},K.crawl=function(z,D,B,R){var I=B||0;R=R||"",Object.keys(z).forEach(function(F){var j=z[F];if(w.indexOf(F)===-1){var N=(R?R+".":"")+F;D(j,F,z,I,N),!K.isValObject(j)&&n(j)&&F!=="impliedEdits"&&K.crawl(j,D,I+1,N)}})},K.isValObject=function(z){return z&&z.valType!==void 0},K.findArrayAttributes=function(z){var D=[],B=[],R=[],I,F;function j(G,rt,ct,st){B=B.slice(0,st).concat([rt]),R=R.slice(0,st).concat([G&&G._isLinkedToArray]);var et=G&&(G.valType==="data_array"||G.arrayOk===!0)&&!(B[st-1]==="colorbar"&&(rt==="ticktext"||rt==="tickvals"));et&&N(I,0,"")}function N(G,rt,ct){var st=G[B[rt]],et=ct+B[rt];if(rt===B.length-1)o(st)&&D.push(F+et);else if(R[rt]){if(Array.isArray(st))for(var Z=0;Z=F.length)return!1;if(z.dimensions===2){if(B++,D.length===B)return z;var j=D[B];if(!y(j))return!1;z=F[I][j]}else z=F[I]}else z=F}}return z}function y(z){return z===Math.round(z)&&z>=0}function S(z){var D,B;D=V.modules[z]._module,B=D.basePlotModule;var R={};R.type=null;var I=i({},d),F=i({},D.attributes);K.crawl(F,function(G,rt,ct,st,et){a(I,et).set(void 0),G===void 0&&a(F,et).set(void 0)}),i(R,I),V.traceIs(z,"noOpacity")&&delete R.opacity,V.traceIs(z,"showLegend")||(delete R.showlegend,delete R.legendgroup),V.traceIs(z,"noHover")&&(delete R.hoverinfo,delete R.hoverlabel),D.selectPoints||delete R.selectedpoints,i(R,F),B.attributes&&i(R,B.attributes),R.type=z;var j={meta:D.meta||{},categories:D.categories||{},animatable:!!D.animatable,type:z,attributes:T(R)};if(D.layoutAttributes){var N={};i(N,D.layoutAttributes),j.layoutAttributes=T(N)}return D.animatable||K.crawl(j,function(G){K.isValObject(G)&&"anim"in G&&delete G.anim}),j}function k(){var z={},D,B;i(z,E);for(D in V.subplotsRegistry)if(B=V.subplotsRegistry[D],!!B.layoutAttributes)if(Array.isArray(B.attr))for(var R=0;R{var V=Xr(),u=kl(),d="templateitemname",E={name:{valType:"string",editType:"none"}};E[d]={valType:"string",editType:"calc"},K.templatedArray=function(e,r){return r._isLinkedToArray=e,r.name=E.name,r[d]=E[d],r},K.traceTemplater=function(e){var r={},i,n;for(i in e)n=e[i],Array.isArray(n)&&n.length&&(r[i]=0);function o(a){i=V.coerce(a,{},u,"type");var s={type:i,_template:null};if(i in r){n=e[i];var f=r[i]%n.length;r[i]++,s._template=n[f]}return s}return{newTrace:o}},K.newContainer=function(e,r,i){var n=e._template,o=n&&(n[r]||i&&n[i]);V.isPlainObject(o)||(o=null);var a=e[r]={_template:o};return a},K.arrayTemplater=function(e,r,i){var n=e._template,o=n&&n[t(r)],a=n&&n[r];(!Array.isArray(a)||!a.length)&&(a=[]);var s={};function f(g){var m={name:g.name,_input:g},w=m[d]=g[d];if(!A(w))return m._template=o,m;for(var l=0;l=n&&(i._input||{})._templateitemname;a&&(o=n);var s=r+"["+o+"]",f;function v(){f={},a&&(f[s]={},f[s][d]=a)}v();function g(x,y){f[x]=y}function m(x,y){a?V.nestedProperty(f[s],x).set(y):f[s+"."+x]=y}function w(){var x=f;return v(),x}function l(x,y){x&&m(x,y);var S=w();for(var k in S)V.nestedProperty(e,k).set(S[k])}return{modifyBase:g,modifyItem:m,getUpdateObj:w,applyUpdate:l}}}),Mf=Vt((K,V)=>{var u=gm().counter;V.exports={idRegex:{x:u("x","( domain)?"),y:u("y","( domain)?")},attrRegex:u("[xy]axis"),xAxisMatch:u("xaxis"),yAxisMatch:u("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),cc=Vt(K=>{var V=ji(),u=Mf();K.id2name=function(E){if(!(typeof E!="string"||!E.match(u.AX_ID_PATTERN))){var A=E.split(" ")[0].slice(1);return A==="1"&&(A=""),E.charAt(0)+"axis"+A}},K.name2id=function(E){if(E.match(u.AX_NAME_PATTERN)){var A=E.slice(5);return A==="1"&&(A=""),E.charAt(0)+A}},K.cleanId=function(E,A,t){var e=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(u.AX_ID_PATTERN))&&!(A&&E.charAt(0)!==A)&&!(e&&!t)){var r=E.split(" ")[0].slice(1).replace(/^0+/,"");return r==="1"&&(r=""),E.charAt(0)+r+(e&&t?" domain":"")}},K.list=function(E,A,t){var e=E._fullLayout;if(!e)return[];var r=K.listIds(E,A),i=new Array(r.length),n;for(n=0;ne?1:-1:+(E.slice(1)||1)-+(A.slice(1)||1)},K.ref2id=function(E){return/^[xyz]/.test(E)?E.split(" ")[0]:!1};function d(E,A){if(A&&A.length){for(var t=0;t{function u(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".outline-controllers").remove()}function d(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".select-outline").remove(),E._fullLayout._outlining=!1}V.exports={clearOutlineControllers:u,clearOutline:d}}),Uy=Vt((K,V)=>{V.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Pf=Vt(K=>{var V=ji();Mf().SUBPLOT_PATTERN,K.getSubplotCalcData=function(u,d,E){var A=V.subplotsRegistry[d];if(!A)return[];for(var t=A.attr,e=[],r=0;r{var V=ji(),u=Xr();K.manageCommandObserver=function(r,i,n,o){var a={},s=!0;i&&i._commandObserver&&(a=i._commandObserver),a.cache||(a.cache={}),a.lookupTable={};var f=K.hasSimpleAPICommandBindings(r,n,a.lookupTable);if(i&&i._commandObserver){if(f)return a;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,a}if(f){d(r,f,a.cache),a.check=function(){if(s){var m=d(r,f,a.cache);return m.changed&&o&&a.lookupTable[m.value]!==void 0&&(a.disable(),Promise.resolve(o({value:m.value,type:f.type,prop:f.prop,traces:f.traces,index:a.lookupTable[m.value]})).then(a.enable,a.enable)),m.changed}};for(var v=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],g=0;g0?".":"")+a;u.isPlainObject(s)?e(s,i,f,o+1):i(f,a,s)}})}}),Uu=Vt((K,V)=>{var u=Ni(),d=pm().timeFormatLocale,E=X_().formatLocale,A=Lo(),t=$_(),e=ji(),r=xm(),i=cl(),n=Xr(),o=Pi(),a=ks().BADNUM,s=cc(),f=Td().clearOutline,v=Uy(),g=Pg(),m=ob(),w=Pf().getModuleCalcData,l=n.relinkPrivateKeys,x=n._,y=V.exports={};n.extendFlat(y,e),y.attributes=kl(),y.attributes.type.values=y.allTypes,y.fontAttrs=yu(),y.layoutAttributes=vm();var S=VT();y.executeAPICommand=S.executeAPICommand,y.computeAPICommandBindings=S.computeAPICommandBindings,y.manageCommandObserver=S.manageCommandObserver,y.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,y.redrawText=function(Z){return Z=n.getGraphDiv(Z),new Promise(function(ot){setTimeout(function(){Z._fullLayout&&(e.getComponentMethod("annotations","draw")(Z),e.getComponentMethod("legend","draw")(Z),e.getComponentMethod("colorbar","draw")(Z),ot(y.previousPromises(Z)))},300)})},y.resize=function(Z){Z=n.getGraphDiv(Z);var ot,X=new Promise(function(Q,ut){(!Z||n.isHidden(Z))&&ut(new Error("Resize must be passed a displayed plot div element.")),Z._redrawTimer&&clearTimeout(Z._redrawTimer),Z._resolveResize&&(ot=Z._resolveResize),Z._resolveResize=Q,Z._redrawTimer=setTimeout(function(){if(!Z.layout||Z.layout.width&&Z.layout.height||n.isHidden(Z)){Q(Z);return}delete Z.layout.width,delete Z.layout.height;var J=Z.changed;Z.autoplay=!0,e.call("relayout",Z,{autosize:!0}).then(function(){Z.changed=J,Z._resolveResize===Q&&(delete Z._resolveResize,Q(Z))})},100)});return ot&&ot(X),X},y.previousPromises=function(Z){if((Z._promises||[]).length)return Promise.all(Z._promises).then(function(){Z._promises=[]})},y.addLinks=function(Z){if(!(!Z._context.showLink&&!Z._context.showSources)){var ot=Z._fullLayout,X=n.ensureSingle(ot._paper,"text","js-plot-link-container",function(nt){nt.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:o.defaultLine,"pointer-events":"all"}).each(function(){var dt=u.select(this);dt.append("tspan").classed("js-link-to-tool",!0),dt.append("tspan").classed("js-link-spacer",!0),dt.append("tspan").classed("js-sourcelinks",!0)})}),Q=X.node(),ut={y:ot._paper.attr("height")-9};document.body.contains(Q)&&Q.getComputedTextLength()>=ot.width-20?(ut["text-anchor"]="start",ut.x=5):(ut["text-anchor"]="end",ut.x=ot._paper.attr("width")-7),X.attr(ut);var J=X.select(".js-link-to-tool"),q=X.select(".js-link-spacer"),it=X.select(".js-sourcelinks");Z._context.showSources&&Z._context.showSources(Z),Z._context.showLink&&k(Z,J),q.text(J.text()&&it.text()?" - ":"")}};function k(Z,ot){ot.text("");var X=ot.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(Z._context.linkText+" »");if(Z._context.sendData)X.on("click",function(){y.sendDataToCloud(Z)});else{var Q=window.location.pathname.split("/"),ut=window.location.search;X.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+Q[2].split(".")[0]+"/"+Q[1]+ut})}}y.sendDataToCloud=function(Z){var ot=(window.PLOTLYENV||{}).BASE_URL||Z._context.plotlyServerURL;if(ot){Z.emit("plotly_beforeexport");var X=u.select(Z).append("div").attr("id","hiddenform").style("display","none"),Q=X.append("form").attr({action:ot+"/external",method:"post",target:"_blank"}),ut=Q.append("input").attr({type:"text",name:"data"});return ut.node().value=y.graphJson(Z,!1,"keepdata"),Q.node().submit(),X.remove(),Z.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];y.supplyDefaults=function(Z,ot){var X=ot&&ot.skipUpdateCalc,Q=Z._fullLayout||{};if(Q._skipDefaults){delete Q._skipDefaults;return}var ut=Z._fullLayout={},J=Z.layout||{},q=Z._fullData||[],it=Z._fullData=[],nt=Z.data||[],dt=Z.calcdata||[],Tt=Z._context||{},wt;Z._transitionData||y.createTransitionData(Z),ut._dfltTitle={plot:x(Z,"Click to enter Plot title"),subtitle:x(Z,"Click to enter Plot subtitle"),x:x(Z,"Click to enter X axis title"),y:x(Z,"Click to enter Y axis title"),colorbar:x(Z,"Click to enter Colorscale title"),annotation:x(Z,"new text")},ut._traceWord=x(Z,"trace");var Ct=b(Z,M);if(ut._mapboxAccessToken=Tt.mapboxAccessToken,Q._initialAutoSizeIsDone){var It=Q.width,Nt=Q.height;y.supplyLayoutGlobalDefaults(J,ut,Ct),J.width||(ut.width=It),J.height||(ut.height=Nt),y.sanitizeMargins(ut)}else{y.supplyLayoutGlobalDefaults(J,ut,Ct);var te=!J.width||!J.height,Jt=ut.autosize,ee=Tt.autosizable,Zt=te&&(Jt||ee);Zt?y.plotAutoSize(Z,J,ut):te&&y.sanitizeMargins(ut),!Jt&&te&&(J.width=ut.width,J.height=ut.height)}ut._d3locale=_(Ct,ut.separators),ut._extraFormat=b(Z,T),ut._initialAutoSizeIsDone=!0,ut._dataLength=nt.length,ut._modules=[],ut._visibleModules=[],ut._basePlotModules=[];var mt=ut._subplots=h(),bt=ut._splomAxes={x:{},y:{}},vt=ut._splomSubplots={};ut._splomGridDflt={},ut._scatterStackOpts={},ut._firstScatter={},ut._alignmentOpts={},ut._colorAxes={},ut._requestRangeslider={},ut._traceUids=c(q,nt),y.supplyDataDefaults(nt,it,J,ut);var Ut=Object.keys(bt.x),re=Object.keys(bt.y);if(Ut.length>1&&re.length>1){for(e.getComponentMethod("grid","sizeDefaults")(J,ut),wt=0;wt15&&re.length>15&&ut.shapes.length===0&&ut.images.length===0,y.linkSubplots(it,ut,q,Q),y.cleanPlot(it,ut,q,Q);var We=!!(Q._has&&Q._has("cartesian")),qe=!!(ut._has&&ut._has("cartesian")),vr=We,_r=qe;vr&&!_r?Q._bgLayer.remove():_r&&!vr&&(ut._shouldCreateBgLayer=!0),Q._zoomlayer&&!Z._dragging&&f({_fullLayout:Q}),P(it,ut),l(ut,Q),e.getComponentMethod("colorscale","crossTraceDefaults")(it,ut),ut._preGUI||(ut._preGUI={}),ut._tracePreGUI||(ut._tracePreGUI={});var er=ut._tracePreGUI,Mr={},Ir;for(Ir in er)Mr[Ir]="old";for(wt=0;wt0){var dt=1-2*ut;J=Math.round(dt*J),q=Math.round(dt*q)}}var Tt=y.layoutAttributes.width.min,wt=y.layoutAttributes.height.min;J1,It=!ot.height&&Math.abs(X.height-q)>1;(It||Ct)&&(Ct&&(X.width=J),It&&(X.height=q)),Z._initialAutoSize||(Z._initialAutoSize={width:J,height:q}),y.sanitizeMargins(X)},y.supplyLayoutModuleDefaults=function(Z,ot,X,Q){var ut=e.componentsRegistry,J=ot._basePlotModules,q,it,nt,dt=e.subplotsRegistry.cartesian;for(q in ut)nt=ut[q],nt.includeBasePlot&&nt.includeBasePlot(Z,ot);J.length||J.push(dt),ot._has("cartesian")&&(e.getComponentMethod("grid","contentDefaults")(Z,ot),dt.finalizeSubplots(Z,ot));for(var Tt in ot._subplots)ot._subplots[Tt].sort(n.subplotSort);for(it=0;it1&&(X.l/=Jt,X.r/=Jt)}if(Ct){var ee=(X.t+X.b)/Ct;ee>1&&(X.t/=ee,X.b/=ee)}var Zt=X.xl!==void 0?X.xl:X.x,mt=X.xr!==void 0?X.xr:X.x,bt=X.yt!==void 0?X.yt:X.y,vt=X.yb!==void 0?X.yb:X.y;It[ot]={l:{val:Zt,size:X.l+te},r:{val:mt,size:X.r+te},b:{val:vt,size:X.b+te},t:{val:bt,size:X.t+te}},Nt[ot]=1}if(!Q._replotting)return y.doAutoMargin(Z)}};function F(Z){if("_redrawFromAutoMarginCount"in Z._fullLayout)return!1;var ot=s.list(Z,"",!0);for(var X in ot)if(ot[X].autoshift||ot[X].shift)return!0;return!1}y.doAutoMargin=function(Z){var ot=Z._fullLayout,X=ot.width,Q=ot.height;ot._size||(ot._size={}),B(ot);var ut=ot._size,J=ot.margin,q={t:0,b:0,l:0,r:0},it=n.extendFlat({},ut),nt=J.l,dt=J.r,Tt=J.t,wt=J.b,Ct=ot._pushmargin,It=ot._pushmarginIds,Nt=ot.minreducedwidth,te=ot.minreducedheight;if(J.autoexpand!==!1){for(var Jt in Ct)It[Jt]||delete Ct[Jt];var ee=Z._fullLayout._reservedMargin;for(var Zt in ee)for(var mt in ee[Zt]){var bt=ee[Zt][mt];q[mt]=Math.max(q[mt],bt)}Ct.base={l:{val:0,size:nt},r:{val:1,size:dt},t:{val:1,size:Tt},b:{val:0,size:wt}};for(var vt in q){var Ut=0;for(var re in Ct)re!=="base"&&A(Ct[re][vt].size)&&(Ut=Ct[re][vt].size>Ut?Ct[re][vt].size:Ut);var Kt=Math.max(0,J[vt]-Ut);q[vt]=Math.max(0,q[vt]-Kt)}for(var ue in Ct){var Me=Ct[ue].l||{},Ce=Ct[ue].b||{},We=Me.val,qe=Me.size,vr=Ce.val,_r=Ce.size,er=X-q.r-q.l,Mr=Q-q.t-q.b;for(var Ir in Ct){if(A(qe)&&Ct[Ir].r){var de=Ct[Ir].r.val,Dt=Ct[Ir].r.size;if(de>We){var qt=(qe*de+(Dt-er)*We)/(de-We),_t=(Dt*(1-We)+(qe-er)*(1-de))/(de-We);qt+_t>nt+dt&&(nt=qt,dt=_t)}}if(A(_r)&&Ct[Ir].t){var lt=Ct[Ir].t.val,yt=Ct[Ir].t.size;if(lt>vr){var St=(_r*lt+(yt-Mr)*vr)/(lt-vr),Ht=(yt*(1-vr)+(_r-Mr)*(1-lt))/(lt-vr);St+Ht>wt+Tt&&(wt=St,Tt=Ht)}}}}}var Yt=n.constrain(X-J.l-J.r,R,Nt),se=n.constrain(Q-J.t-J.b,I,te),ke=Math.max(0,X-Yt),Ee=Math.max(0,Q-se);if(ke){var Ue=(nt+dt)/ke;Ue>1&&(nt/=Ue,dt/=Ue)}if(Ee){var ir=(wt+Tt)/Ee;ir>1&&(wt/=ir,Tt/=ir)}if(ut.l=Math.round(nt)+q.l,ut.r=Math.round(dt)+q.r,ut.t=Math.round(Tt)+q.t,ut.b=Math.round(wt)+q.b,ut.p=Math.round(J.pad),ut.w=Math.round(X)-ut.l-ut.r,ut.h=Math.round(Q)-ut.t-ut.b,!ot._replotting&&(y.didMarginChange(it,ut)||F(Z))){"_redrawFromAutoMarginCount"in ot?ot._redrawFromAutoMarginCount++:ot._redrawFromAutoMarginCount=1;var ar=3*(1+Object.keys(It).length);if(ot._redrawFromAutoMarginCount1)return!0}return!1},y.graphJson=function(Z,ot,X,Q,ut,J){(ut&&ot&&!Z._fullData||ut&&!ot&&!Z._fullLayout)&&y.supplyDefaults(Z);var q=ut?Z._fullData:Z.data,it=ut?Z._fullLayout:Z.layout,nt=(Z._transitionData||{})._frames;function dt(Ct,It){if(typeof Ct=="function")return It?"_function_":null;if(n.isPlainObject(Ct)){var Nt={},te;return Object.keys(Ct).sort().forEach(function(mt){if(["_","["].indexOf(mt.charAt(0))===-1){if(typeof Ct[mt]=="function"){It&&(Nt[mt]="_function");return}if(X==="keepdata"){if(mt.slice(-3)==="src")return}else if(X==="keepstream"){if(te=Ct[mt+"src"],typeof te=="string"&&te.indexOf(":")>0&&!n.isPlainObject(Ct.stream))return}else if(X!=="keepall"&&(te=Ct[mt+"src"],typeof te=="string"&&te.indexOf(":")>0))return;Nt[mt]=dt(Ct[mt],It)}}),Nt}var Jt=Array.isArray(Ct),ee=n.isTypedArray(Ct);if((Jt||ee)&&Ct.dtype&&Ct.shape){var Zt=Ct.bdata;return dt({dtype:Ct.dtype,shape:Ct.shape,bdata:n.isArrayBuffer(Zt)?t.encode(Zt):Zt},It)}return Jt?Ct.map(function(mt){return dt(mt,It)}):ee?n.simpleMap(Ct,n.identity):n.isJSDate(Ct)?n.ms2DateTimeLocal(+Ct):Ct}var Tt={data:(q||[]).map(function(Ct){var It=dt(Ct);return ot&&delete It.fit,It})};if(!ot&&(Tt.layout=dt(it),ut)){var wt=it._size;Tt.layout.computed={margin:{b:wt.b,l:wt.l,r:wt.r,t:wt.t}}}return nt&&(Tt.frames=dt(nt)),J&&(Tt.config=dt(Z._context,!0)),Q==="object"?Tt:JSON.stringify(Tt)},y.modifyFrames=function(Z,ot){var X,Q,ut,J=Z._transitionData._frames,q=Z._transitionData._frameHash;for(X=0;X0&&(Z._transitioningWithDuration=!0),Z._transitionData._interruptCallbacks.push(function(){Q=!0}),X.redraw&&Z._transitionData._interruptCallbacks.push(function(){return e.call("redraw",Z)}),Z._transitionData._interruptCallbacks.push(function(){Z.emit("plotly_transitioninterrupted",[])});var Ct=0,It=0;function Nt(){return Ct++,function(){It++,!Q&&It===Ct&&it(wt)}}X.runFn(Nt),setTimeout(Nt())})}function it(wt){if(Z._transitionData)return J(Z._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(X.redraw)return e.call("redraw",Z)}).then(function(){Z._transitioning=!1,Z._transitioningWithDuration=!1,Z.emit("plotly_transitioned",[])}).then(wt)}function nt(){if(Z._transitionData)return Z._transitioning=!1,ut(Z._transitionData._interruptCallbacks)}var dt=[y.previousPromises,nt,X.prepareFn,y.rehover,y.reselect,q],Tt=n.syncOrAsync(dt,Z);return(!Tt||!Tt.then)&&(Tt=Promise.resolve()),Tt.then(function(){return Z})}y.doCalcdata=function(Z,ot){var X=s.list(Z),Q=Z._fullData,ut=Z._fullLayout,J,q,it,nt,dt=new Array(Q.length),Tt=(Z.calcdata||[]).slice();for(Z.calcdata=dt,ut._numBoxes=0,ut._numViolins=0,ut._violinScaleGroupStats={},Z._hmpixcount=0,Z._hmlumcount=0,ut._piecolormap={},ut._sunburstcolormap={},ut._treemapcolormap={},ut._iciclecolormap={},ut._funnelareacolormap={},it=0;it=0;nt--)if(vt[nt].enabled){J._indexToPoints=vt[nt]._indexToPoints;break}q&&q.calc&&(bt=q.calc(Z,J))}(!Array.isArray(bt)||!bt[0])&&(bt=[{x:a,y:a}]),bt[0].t||(bt[0].t={}),bt[0].trace=J,dt[Zt]=bt}}for(st(X,Q,ut),it=0;it{K.xmlns="http://www.w3.org/2000/xmlns/",K.svg="http://www.w3.org/2000/svg",K.xlink="http://www.w3.org/1999/xlink",K.svgAttrs={xmlns:K.svg,"xmlns:xlink":K.xlink}}),gf=Vt((K,V)=>{V.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),Dl=Vt(K=>{var V=Ni(),u=Xr(),d=u.strTranslate,E=Lh(),A=gf().LINE_SPACING,t=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;K.convertToTspans=function(I,F,j){var N=I.text(),G=!I.attr("data-notex")&&F&&F._context.typesetMath&&typeof MathJax<"u"&&N.match(t),rt=V.select(I.node().parentNode);if(rt.empty())return;var ct=I.attr("class")?I.attr("class").split(" ")[0]:"text";ct+="-math",rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove(),I.style("display",null).attr({"data-unformatted":N,"data-math":"N"});function st(){rt.empty()||(ct=I.attr("class")+"-math",rt.select("svg."+ct).remove()),I.text("").style("white-space","pre");var et=z(I.node(),N);et&&I.style("pointer-events","all"),K.positionText(I),j&&j.call(I)}return G?(F&&F._promises||[]).push(new Promise(function(et){I.style("display","none");var Z=parseInt(I.node().style.fontSize,10),ot={fontSize:Z};o(G[2],ot,function(X,Q,ut){rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove();var J=X&&X.select("svg");if(!J||!J.node()){st(),et();return}var q=rt.append("g").classed(ct+"-group",!0).attr({"pointer-events":"none","data-unformatted":N,"data-math":"Y"});q.node().appendChild(J.node()),Q&&Q.node()&&J.node().insertBefore(Q.node().cloneNode(!0),J.node().firstChild);var it=ut.width,nt=ut.height;J.attr({class:ct,height:nt,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var dt=I.node().style.fill||"black",Tt=J.select("g");Tt.attr({fill:dt,stroke:dt});var wt=Tt.node().getBoundingClientRect(),Ct=wt.width,It=wt.height;(Ct>it||It>nt)&&(J.style("overflow","hidden"),wt=J.node().getBoundingClientRect(),Ct=wt.width,It=wt.height);var Nt=+I.attr("x"),te=+I.attr("y"),Jt=Z||I.node().getBoundingClientRect().height,ee=-Jt/4;if(ct[0]==="y")q.attr({transform:"rotate("+[-90,Nt,te]+")"+d(-Ct/2,ee-It/2)});else if(ct[0]==="l")te=ee-It/2;else if(ct[0]==="a"&&ct.indexOf("atitle")!==0)Nt=0,te=ee;else{var Zt=I.attr("text-anchor");Nt=Nt-Ct*(Zt==="middle"?.5:Zt==="end"?1:0),te=te+ee-It/2}J.attr({x:Nt,y:te}),j&&j.call(I,q),et(q)})})):st(),I};var e=/(<|<|<)/g,r=/(>|>|>)/g;function i(I){return I.replace(e,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function o(I,F,j){var N=parseInt((MathJax.version||"").split(".")[0]);if(N!==2&&N!==3){u.warn("No MathJax version:",MathJax.version);return}var G,rt,ct,st,et=function(){return rt=u.extendDeepAll({},MathJax.Hub.config),ct=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},Z=function(){rt=u.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ot=function(){if(G=MathJax.Hub.config.menuSettings.renderer,G!=="SVG")return MathJax.Hub.setRenderer("SVG")},X=function(){G=MathJax.config.startup.output,G!=="svg"&&(MathJax.config.startup.output="svg")},Q=function(){var dt="math-output-"+u.randstr({},64);st=V.select("body").append("div").attr({id:dt}).style({visibility:"hidden",position:"absolute","font-size":F.fontSize+"px"}).text(i(I));var Tt=st.node();return N===2?MathJax.Hub.Typeset(Tt):MathJax.typeset([Tt])},ut=function(){var dt=st.select(N===2?".MathJax_SVG":".MathJax"),Tt=!dt.empty()&&st.select("svg").node();if(!Tt)u.log("There was an error in the tex syntax.",I),j();else{var wt=Tt.getBoundingClientRect(),Ct;N===2?Ct=V.select("body").select("#MathJax_SVG_glyphs"):Ct=dt.select("defs"),j(dt,Ct,wt)}st.remove()},J=function(){if(G!=="SVG")return MathJax.Hub.setRenderer(G)},q=function(){G!=="svg"&&(MathJax.config.startup.output=G)},it=function(){return ct!==void 0&&(MathJax.Hub.processSectionDelay=ct),MathJax.Hub.Config(rt)},nt=function(){MathJax.config=rt};N===2?MathJax.Hub.Queue(et,ot,Q,ut,J,it):N===3&&(Z(),X(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Q(),ut(),q(),nt()}))}var a={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},v="​",g=["http:","https:","mailto:","",void 0,":"],m=K.NEWLINES=/(\r\n?|\n)/g,w=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;K.BR_TAG_ALL=//gi;var y=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,k=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(I,F){if(!I)return null;var j=I.match(F),N=j&&(j[3]||j[4]);return N&&_(N)}var c=/(^|;)\s*color:/;K.plainText=function(I,F){F=F||{};for(var j=F.len!==void 0&&F.len!==-1?F.len:1/0,N=F.allowedTags!==void 0?F.allowedTags:["br"],G="...",rt=G.length,ct=I.split(w),st=[],et="",Z=0,ot=0;otrt?st.push(X.slice(0,Math.max(0,q-rt))+G):st.push(X.slice(0,q));break}et=""}}return st.join("")};var h={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},b=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function _(I){return I.replace(b,function(F,j){var N;return j.charAt(0)==="#"?N=P(j.charAt(1)==="x"?parseInt(j.slice(2),16):parseInt(j.slice(1),10)):N=h[j],N||F})}K.convertEntities=_;function P(I){if(!(I>1114111)){var F=String.fromCodePoint;if(F)return F(I);var j=String.fromCharCode;return I<=65535?j(I):j((I>>10)+55232,I%1024+56320)}}function z(I,F){F=F.replace(m," ");var j=!1,N=[],G,rt=-1;function ct(){rt++;var It=document.createElementNS(E.svg,"tspan");V.select(It).attr({class:"line",dy:rt*A+"em"}),I.appendChild(It),G=It;var Nt=N;if(N=[{node:It}],Nt.length>1)for(var te=1;te.",F);return}var Nt=N.pop();It!==Nt.type&&u.log("Start tag <"+Nt.type+"> doesnt match end tag <"+It+">. Pretending it did match.",F),G=N[N.length-1].node}var ot=x.test(F);ot?ct():(G=I,N=[{node:I}]);for(var X=F.split(w),Q=0;Q{var u=Ni(),d=Af(),E=Lo(),A=Xr(),t=Pi(),e=a0().isValid;function r(m,w,l){var x=w?A.nestedProperty(m,w).get()||{}:m,y=x[l||"color"];y&&y._inputArray&&(y=y._inputArray);var S=!1;if(A.isArrayOrTypedArray(y)){for(var k=0;k=0;x--,y++){var S=m[x];l[y]=[1-S[0],S[1]]}return l}function f(m,w){w=w||{};for(var l=m.domain,x=m.range,y=x.length,S=new Array(y),k=0;k{var u=rb(),d=u.FORMAT_LINK,E=u.DATE_FORMAT_LINK;function A(r,i){return{valType:"string",dflt:"",editType:"none",description:(i?t:e)("hover text",r)+["By default the values are formatted using "+(i?"generic number format":"`"+r+"axis.hoverformat`")+"."].join(" ")}}function t(r,i){return["Sets the "+r+" formatting rule"+(i?"for `"+i+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+d+"."].join(" ")}function e(r,i){return t(r,i)+[" And for dates see: "+E+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}V.exports={axisHoverFormat:A,descriptionOnlyNumbers:t,descriptionWithDates:e}}),Of=Vt((K,V)=>{var u=yu(),d=af(),E=If().dash,A=So().extendFlat,t=cl().templatedArray;yl().templateFormatStringDescription;var e=fc().descriptionWithDates,r=ks().ONEDAY,i=Mf(),n=i.HOUR_PATTERN,o=i.WEEKDAY_PATTERN,a={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},s=A({},a,{values:a.values.slice().concat(["sync"])});function f(c){return{valType:"integer",min:0,dflt:c?5:0,editType:"ticks"}}var v={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},m={valType:"data_array",editType:"ticks"},w={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function l(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=5),h}function x(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=1),h}var y={valType:"color",dflt:d.defaultLine,editType:"ticks"},S={valType:"color",dflt:d.lightLine,editType:"ticks"};function k(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=1),h}var M=A({},E,{editType:"ticks"}),T={valType:"boolean",editType:"ticks"};V.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:d.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:u({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[i.idRegex.x.toString(),i.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"calc"},rangebreaks:t("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[o,n,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:r},editType:"calc"}),tickmode:s,nticks:f(),tick0:v,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:m,ticktext:{valType:"data_array",editType:"ticks"},ticks:w,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:l(),tickwidth:x(),tickcolor:y,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:A({},E,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:u({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:e("tick label")},tickformatstops:t("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:e("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:d.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:T,gridcolor:S,gridwidth:k(),griddash:M,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:d.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:d.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"plot"},minor:{tickmode:a,nticks:f("minor"),tick0:v,dtick:g,tickvals:m,ticks:w,ticklen:l("minor"),tickwidth:x("minor"),tickcolor:y,gridcolor:S,gridwidth:k("minor"),griddash:M,showgrid:T,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),Vy=Vt((K,V)=>{var u=Of(),d=yu(),E=So().extendFlat,A=Cu().overrideAll;V.exports=A({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:u.linecolor,outlinewidth:u.linewidth,bordercolor:u.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:u.minor.tickmode,nticks:u.nticks,tick0:u.tick0,dtick:u.dtick,tickvals:u.tickvals,ticktext:u.ticktext,ticks:E({},u.ticks,{dflt:""}),ticklabeloverflow:E({},u.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:u.ticklen,tickwidth:u.tickwidth,tickcolor:u.tickcolor,ticklabelstep:u.ticklabelstep,showticklabels:u.showticklabels,labelalias:u.labelalias,tickfont:d({}),tickangle:u.tickangle,tickformat:u.tickformat,tickformatstops:u.tickformatstops,tickprefix:u.tickprefix,showtickprefix:u.showtickprefix,ticksuffix:u.ticksuffix,showticksuffix:u.showticksuffix,separatethousands:u.separatethousands,exponentformat:u.exponentformat,minexponent:u.minexponent,showexponent:u.showexponent,title:{text:{valType:"string"},font:d({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Wl=Vt((K,V)=>{var u=Vy(),d=gm().counter,E=wd(),A=a0().scales;E(A);function t(e){return"`"+e+"`"}V.exports=function(e,r){e=e||"",r=r||{};var i=r.cLetter||"c";"onlyIfNumerical"in r&&r.onlyIfNumerical;var n="noScale"in r?r.noScale:e==="marker.line",o="showScaleDflt"in r?r.showScaleDflt:i==="z",a=typeof r.colorscaleDflt=="string"?A[r.colorscaleDflt]:null,s=r.editTypeOverride||"",f=e?e+".":"",v;"colorAttr"in r?(v=r.colorAttr,r.colorAttr):(v={z:"z",c:"color"}[i],""+t(f+v));var g=i+"auto",m=i+"min",w=i+"max",l=i+"mid",x={};x[m]=x[w]=void 0;var y={};y[g]=!1;var S={};return v==="color"&&(S.color={valType:"color",arrayOk:!0,editType:s||"style"},r.anim&&(S.color.anim=!0)),S[g]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:x},S[m]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:y},S[w]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:y},S[l]={valType:"number",dflt:null,editType:"calc",impliedEdits:x},S.colorscale={valType:"colorscale",editType:"calc",dflt:a,impliedEdits:{autocolorscale:!1}},S.autocolorscale={valType:"boolean",dflt:r.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},S.reversescale={valType:"boolean",dflt:!1,editType:"plot"},n||(S.showscale={valType:"boolean",dflt:o,editType:"calc"},S.colorbar=u),r.noColorAxis||(S.coloraxis={valType:"subplotid",regex:d("coloraxis"),dflt:null,editType:"calc"}),S}}),sb=Vt((K,V)=>{var u=So().extendFlat,d=Wl(),E=a0().scales;V.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:E.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:E.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:E.RdBu,editType:"calc"}},coloraxis:u({_isSubplotObj:!0,editType:"calc"},d("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),lb=Vt((K,V)=>{var u=Xr();V.exports=function(d){return u.isPlainObject(d.colorbar)}}),ub=Vt(K=>{var V=Lo(),u=Xr(),d=ks(),E=d.ONEDAY,A=d.ONEWEEK;K.dtick=function(t,e){var r=e==="log",i=e==="date",n=e==="category",o=i?E:1;if(!t)return o;if(V(t))return t=Number(t),t<=0?o:n?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if(typeof t!="string"||!(i||r))return o;var a=t.charAt(0),s=t.slice(1);return s=V(s)?Number(s):0,s<=0||!(i&&a==="M"&&s===Math.round(s)||r&&a==="L"||r&&a==="D"&&(s===1||s===2))?o:t},K.tick0=function(t,e,r,i){if(e==="date")return u.cleanDate(t,u.dateTick0(r,i%A===0?1:0));if(!(i==="D1"||i==="D2"))return V(t)?Number(t):0}}),s0=Vt((K,V)=>{var u=ub(),d=Xr().isArrayOrTypedArray,E=nh().isTypedArraySpec,A=nh().decodeTypedArraySpec;V.exports=function(t,e,r,i,n){n||(n={});var o=n.isMinor,a=o?t.minor||{}:t,s=o?e.minor:e,f=o?"minor.":"";function v(k){var M=a[k];return E(M)&&(M=A(M)),M!==void 0?M:(s._template||{})[k]}var g=v("tick0"),m=v("dtick"),w=v("tickvals"),l=d(w)?"array":m?"linear":"auto",x=r(f+"tickmode",l);if(x==="auto"||x==="sync")r(f+"nticks");else if(x==="linear"){var y=s.dtick=u.dtick(m,i);s.tick0=u.tick0(g,i,e.calendar,y)}else if(i!=="multicategory"){var S=r(f+"tickvals");S===void 0?s.tickmode="auto":o||r("ticktext")}}}),_m=Vt((K,V)=>{var u=Xr(),d=Of();V.exports=function(E,A,t,e){var r=e.isMinor,i=r?E.minor||{}:E,n=r?A.minor:A,o=r?d.minor:d,a=r?"minor.":"",s=u.coerce2(i,n,o,"ticklen",r?(A.ticklen||5)*.6:void 0),f=u.coerce2(i,n,o,"tickwidth",r?A.tickwidth||1:void 0),v=u.coerce2(i,n,o,"tickcolor",(r?A.tickcolor:void 0)||n.color),g=t(a+"ticks",!r&&e.outerTicks||s||f||v?"outside":"");g||(delete n.ticklen,delete n.tickwidth,delete n.tickcolor)}}),cb=Vt((K,V)=>{V.exports=function(u){var d=["showexponent","showtickprefix","showticksuffix"],E=d.filter(function(t){return u[t]!==void 0}),A=function(t){return u[t]===u[E[0]]};if(E.every(A)||E.length===1)return u[E[0]]}}),Gf=Vt((K,V)=>{var u=Xr(),d=cl();V.exports=function(E,A,t){var e=t.name,r=t.inclusionAttr||"visible",i=A[e],n=u.isArrayOrTypedArray(E[e])?E[e]:[],o=A[e]=[],a=d.arrayTemplater(A,e,r),s,f;for(s=0;s{var u=Xr(),d=Pi().contrast,E=Of(),A=cb(),t=Gf();V.exports=function(r,i,n,o,a){a||(a={});var s=n("labelalias");u.isPlainObject(s)||delete i.labelalias;var f=A(r),v=n("showticklabels");if(v){a.noTicklabelshift||n("ticklabelshift"),a.noTicklabelstandoff||n("ticklabelstandoff");var g=a.font||{},m=i.color,w=i.ticklabelposition||"",l=w.indexOf("inside")!==-1?d(a.bgColor):m&&m!==E.color.dflt?m:g.color;if(u.coerceFont(n,"tickfont",g,{overrideDflt:{color:l}}),!a.noTicklabelstep&&o!=="multicategory"&&o!=="log"&&n("ticklabelstep"),!a.noAng){var x=n("tickangle");!a.noAutotickangles&&x==="auto"&&n("autotickangles")}if(o!=="category"){var y=n("tickformat");t(r,i,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:e}),i.tickformatstops.length||delete i.tickformatstops,!a.noExp&&!y&&o!=="date"&&(n("showexponent",f),n("exponentformat"),n("minexponent"),n("separatethousands"))}!a.noMinorloglabels&&o==="log"&&n("minorloglabels")}};function e(r,i){function n(a,s){return u.coerce(r,i,E.tickformatstops,a,s)}var o=n("enabled");o&&(n("dtickrange"),n("value"))}}),Ad=Vt((K,V)=>{var u=cb();V.exports=function(d,E,A,t,e){e||(e={});var r=e.tickSuffixDflt,i=u(d),n=A("tickprefix");n&&A("showtickprefix",i);var o=A("ticksuffix",r);o&&A("showticksuffix",i)}}),fb=Vt((K,V)=>{var u=Xr(),d=cl(),E=s0(),A=_m(),t=kd(),e=Ad(),r=Vy();V.exports=function(i,n,o){var a=d.newContainer(n,"colorbar"),s=i.colorbar||{};function f(I,F){return u.coerce(s,a,r,I,F)}var v=o.margin||{t:0,b:0,l:0,r:0},g=o.width-v.l-v.r,m=o.height-v.t-v.b,w=f("orientation"),l=w==="v",x=f("thicknessmode");f("thickness",x==="fraction"?30/(l?g:m):30);var y=f("lenmode");f("len",y==="fraction"?1:l?m:g);var S=f("yref"),k=f("xref"),M=S==="paper",T=k==="paper",c,h,b,_="left";l?(b="middle",_=T?"left":"right",c=T?1.02:1,h=.5):(b=M?"bottom":"top",_="center",c=.5,h=M?1.02:1),u.coerce(s,a,{x:{valType:"number",min:T?-2:0,max:T?3:1,dflt:c}},"x"),u.coerce(s,a,{y:{valType:"number",min:M?-2:0,max:M?3:1,dflt:h}},"y"),f("xanchor",_),f("xpad"),f("yanchor",b),f("ypad"),u.noneOrAll(s,a,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var P=u.coerce(s,a,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:l?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");f("ticklabeloverflow",P.indexOf("inside")!==-1?"hide past domain":"hide past div"),E(s,a,f,"linear");var z=o.font,D={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:z};P.indexOf("inside")!==-1&&(D.bgColor="black"),e(s,a,f,"linear",D),t(s,a,f,"linear",D),A(s,a,f,"linear",D),f("title.text",o._dfltTitle.colorbar);var B=a.showticklabels?a.tickfont:z,R=u.extendFlat({},z,{family:B.family,size:u.bigFont(B.size)});u.coerceFont(f,"title.font",R),f("title.side",l?"top":"right")}}),vf=Vt((K,V)=>{var u=Lo(),d=Xr(),E=lb(),A=fb(),t=a0().isValid,e=ji().traceIs;function r(i,n){var o=n.slice(0,n.length-1);return n?d.nestedProperty(i,o).get()||{}:i}V.exports=function i(n,o,a,s,f){var v=f.prefix,g=f.cLetter,m="_module"in o,w=r(n,v),l=r(o,v),x=r(o._template||{},v)||{},y=function(){return delete n.coloraxis,delete o.coloraxis,i(n,o,a,s,f)};if(m){var S=a._colorAxes||{},k=s(v+"coloraxis");if(k){var M=e(o,"contour")&&d.nestedProperty(o,"contours.coloring").get()||"heatmap",T=S[k];T?(T[2].push(y),T[0]!==M&&(T[0]=!1,d.warn(["Ignoring coloraxis:",k,"setting","as it is linked to incompatible colorscales."].join(" ")))):S[k]=[M,o,[y]];return}}var c=w[g+"min"],h=w[g+"max"],b=u(c)&&u(h)&&c{var u=Xr(),d=cl(),E=sb(),A=vf();V.exports=function(t,e){function r(g,m){return u.coerce(t,e,E,g,m)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var i=e._colorAxes,n,o;function a(g,m){return u.coerce(n,o,E.coloraxis,g,m)}for(var s in i){var f=i[s];if(f[0])n=t[s]||{},o=d.newContainer(e,s,"coloraxis"),o._name=s,A(n,o,e,a,{prefix:"",cLetter:"c"});else{for(var v=0;v{var u=Xr(),d=ah().hasColorscale,E=ah().extractOpts;V.exports=function(A,t){function e(f,v){var g=f["_"+v];g!==void 0&&(f[v]=g)}function r(f,v){var g=v.container?u.nestedProperty(f,v.container).get():f;if(g)if(g.coloraxis)g._colorAx=t[g.coloraxis];else{var m=E(g),w=m.auto;(w||m.min===void 0)&&e(g,v.min),(w||m.max===void 0)&&e(g,v.max),m.autocolorscale&&e(g,"colorscale")}}for(var i=0;i{var u=Lo(),d=Xr(),E=ah().extractOpts;V.exports=function(A,t,e){var r=A._fullLayout,i=e.vals,n=e.containerStr,o=n?d.nestedProperty(t,n).get():t,a=E(o),s=a.auto!==!1,f=a.min,v=a.max,g=a.mid,m=function(){return d.aggNums(Math.min,null,i)},w=function(){return d.aggNums(Math.max,null,i)};if(f===void 0?f=m():s&&(o._colorAx&&u(f)?f=Math.min(f,m()):f=m()),v===void 0?v=w():s&&(o._colorAx&&u(v)?v=Math.max(v,w()):v=w()),s&&g!==void 0&&(v-g>g-f?f=g-(v-g):v-g=0?l=r.colorscale.sequential:l=r.colorscale.sequentialminus,a._sync("colorscale",l)}}}),xu=Vt((K,V)=>{var u=a0(),d=ah();V.exports={moduleType:"component",name:"colorscale",attributes:Wl(),layoutAttributes:sb(),supplyLayoutDefaults:HT(),handleDefaults:vf(),crossTraceDefaults:qT(),calc:ih(),scales:u.scales,defaultScale:u.defaultScale,getScale:u.get,isValidScale:u.isValid,hasColorscale:d.hasColorscale,extractOpts:d.extractOpts,extractScale:d.extractScale,flipScale:d.flipScale,makeColorScaleFunc:d.makeColorScaleFunc,makeColorScaleFuncFromTrace:d.makeColorScaleFuncFromTrace}}),nu=Vt((K,V)=>{var u=Xr(),d=nh().isTypedArraySpec;V.exports={hasLines:function(E){return E.visible&&E.mode&&E.mode.indexOf("lines")!==-1},hasMarkers:function(E){return E.visible&&(E.mode&&E.mode.indexOf("markers")!==-1||E.type==="splom")},hasText:function(E){return E.visible&&E.mode&&E.mode.indexOf("text")!==-1},isBubble:function(E){var A=E.marker;return u.isPlainObject(A)&&(u.isArrayOrTypedArray(A.size)||d(A.size))}}}),bm=Vt((K,V)=>{var u=Lo();V.exports=function(d,E){E||(E=2);var A=d.marker,t=A.sizeref||1,e=A.sizemin||0,r=A.sizemode==="area"?function(i){return Math.sqrt(i/t)}:function(i){return i/t};return function(i){var n=r(i/E);return u(n)&&n>0?Math.max(n,e):0}}}),mh=Vt(K=>{var V=Xr();K.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},K.isTraceInSubplots=function(e,r){if(e.type==="splom"){for(var i=e.xaxes||[],n=e.yaxes||[],o=0;o=0&&i.index{V.exports=E;var u={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function E(e){var r=[];return e.replace(d,function(i,n,o){var a=n.toLowerCase();for(o=t(o),a=="m"&&o.length>2&&(r.push([n].concat(o.splice(0,2))),a="l",n=n=="m"?"l":"L");;){if(o.length==u[a])return o.unshift(n),r.push(o);if(o.length{var u=Dg(),d=function(g,m){return m?Math.round(g*(m=Math.pow(10,m)))/m:Math.round(g)},E="M0,0Z",A=Math.sqrt(2),t=Math.sqrt(3),e=Math.PI,r=Math.cos,i=Math.sin;V.exports={circle:{n:0,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x="M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z";return w?v(m,w,x):x}},square:{n:1,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")}},diamond:{n:2,f:function(g,m,w){if(n(m))return E;var l=d(g*1.3,2);return v(m,w,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"Z")}},cross:{n:3,f:function(g,m,w){if(n(m))return E;var l=d(g*.4,2),x=d(g*1.2,2);return v(m,w,"M"+x+","+l+"H"+l+"V"+x+"H-"+l+"V"+l+"H-"+x+"V-"+l+"H-"+l+"V-"+x+"H"+l+"V-"+l+"H"+x+"Z")}},x:{n:4,f:function(g,m,w){if(n(m))return E;var l=d(g*.8/A,2),x="l"+l+","+l,y="l"+l+",-"+l,S="l-"+l+",-"+l,k="l-"+l+","+l;return v(m,w,"M0,"+l+x+y+S+y+S+k+S+k+x+k+x+"Z")}},"triangle-up":{n:5,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+l+","+x+"H"+l+"L0,-"+y+"Z")}},"triangle-down":{n:6,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+l+",-"+x+"H"+l+"L0,"+y+"Z")}},"triangle-left":{n:7,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M"+x+",-"+l+"V"+l+"L-"+y+",0Z")}},"triangle-right":{n:8,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+x+",-"+l+"V"+l+"L"+y+",0Z")}},"triangle-ne":{n:9,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M-"+x+",-"+l+"H"+l+"V"+x+"Z")}},"triangle-se":{n:10,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M"+l+",-"+x+"V"+l+"H-"+x+"Z")}},"triangle-sw":{n:11,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M"+x+","+l+"H-"+l+"V-"+x+"Z")}},"triangle-nw":{n:12,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M-"+l+","+x+"V-"+l+"H"+x+"Z")}},pentagon:{n:13,f:function(g,m,w){if(n(m))return E;var l=d(g*.951,2),x=d(g*.588,2),y=d(-g,2),S=d(g*-.309,2),k=d(g*.809,2);return v(m,w,"M"+l+","+S+"L"+x+","+k+"H-"+x+"L-"+l+","+S+"L0,"+y+"Z")}},hexagon:{n:14,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/2,2),y=d(g*t/2,2);return v(m,w,"M"+y+",-"+x+"V"+x+"L0,"+l+"L-"+y+","+x+"V-"+x+"L0,-"+l+"Z")}},hexagon2:{n:15,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/2,2),y=d(g*t/2,2);return v(m,w,"M-"+x+","+y+"H"+x+"L"+l+",0L"+x+",-"+y+"H-"+x+"L-"+l+",0Z")}},octagon:{n:16,f:function(g,m,w){if(n(m))return E;var l=d(g*.924,2),x=d(g*.383,2);return v(m,w,"M-"+x+",-"+l+"H"+x+"L"+l+",-"+x+"V"+x+"L"+x+","+l+"H-"+x+"L-"+l+","+x+"V-"+x+"Z")}},star:{n:17,f:function(g,m,w){if(n(m))return E;var l=g*1.4,x=d(l*.225,2),y=d(l*.951,2),S=d(l*.363,2),k=d(l*.588,2),M=d(-l,2),T=d(l*-.309,2),c=d(l*.118,2),h=d(l*.809,2),b=d(l*.382,2);return v(m,w,"M"+x+","+T+"H"+y+"L"+S+","+c+"L"+k+","+h+"L0,"+b+"L-"+k+","+h+"L-"+S+","+c+"L-"+y+","+T+"H-"+x+"L0,"+M+"Z")}},hexagram:{n:18,f:function(g,m,w){if(n(m))return E;var l=d(g*.66,2),x=d(g*.38,2),y=d(g*.76,2);return v(m,w,"M-"+y+",0l-"+x+",-"+l+"h"+y+"l"+x+",-"+l+"l"+x+","+l+"h"+y+"l-"+x+","+l+"l"+x+","+l+"h-"+y+"l-"+x+","+l+"l-"+x+",-"+l+"h-"+y+"Z")}},"star-triangle-up":{n:19,f:function(g,m,w){if(n(m))return E;var l=d(g*t*.8,2),x=d(g*.8,2),y=d(g*1.6,2),S=d(g*4,2),k="A "+S+","+S+" 0 0 1 ";return v(m,w,"M-"+l+","+x+k+l+","+x+k+"0,-"+y+k+"-"+l+","+x+"Z")}},"star-triangle-down":{n:20,f:function(g,m,w){if(n(m))return E;var l=d(g*t*.8,2),x=d(g*.8,2),y=d(g*1.6,2),S=d(g*4,2),k="A "+S+","+S+" 0 0 1 ";return v(m,w,"M"+l+",-"+x+k+"-"+l+",-"+x+k+"0,"+y+k+l+",-"+x+"Z")}},"star-square":{n:21,f:function(g,m,w){if(n(m))return E;var l=d(g*1.1,2),x=d(g*2,2),y="A "+x+","+x+" 0 0 1 ";return v(m,w,"M-"+l+",-"+l+y+"-"+l+","+l+y+l+","+l+y+l+",-"+l+y+"-"+l+",-"+l+"Z")}},"star-diamond":{n:22,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2),x=d(g*1.9,2),y="A "+x+","+x+" 0 0 1 ";return v(m,w,"M-"+l+",0"+y+"0,"+l+y+l+",0"+y+"0,-"+l+y+"-"+l+",0Z")}},"diamond-tall":{n:23,f:function(g,m,w){if(n(m))return E;var l=d(g*.7,2),x=d(g*1.4,2);return v(m,w,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},"diamond-wide":{n:24,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2),x=d(g*.7,2);return v(m,w,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},hourglass:{n:25,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"H-"+l+"L"+l+",-"+l+"H-"+l+"Z")},noDot:!0},bowtie:{n:26,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"V-"+l+"L-"+l+","+l+"V-"+l+"Z")},noDot:!0},"circle-cross":{n:27,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/A,2);return v(m,w,"M"+x+","+x+"L-"+x+",-"+x+"M"+x+",-"+x+"L-"+x+","+x+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(g,m,w){if(n(m))return E;var l=d(g*1.3,2);return v(m,w,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM0,-"+l+"V"+l+"M-"+l+",0H"+l)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(g,m,w){if(n(m))return E;var l=d(g*1.3,2),x=d(g*.65,2);return v(m,w,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM-"+x+",-"+x+"L"+x+","+x+"M-"+x+","+x+"L"+x+",-"+x)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M0,"+l+"V-"+l+"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*.85,2);return v(m,w,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+x+","+x+"L-"+x+",-"+x+"M"+x+",-"+x+"L-"+x+","+x)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(g,m,w){if(n(m))return E;var l=d(g/2,2),x=d(g,2);return v(m,w,"M"+l+","+x+"V-"+x+"M"+(l-x)+",-"+x+"V"+x+"M"+x+","+l+"H-"+x+"M-"+x+","+(l-x)+"H"+x)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+l+","+y+"L0,0M"+l+","+y+"L0,0M0,-"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+l+",-"+y+"L0,0M"+l+",-"+y+"L0,0M0,"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M"+y+","+l+"L0,0M"+y+",-"+l+"L0,0M-"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+y+","+l+"L0,0M-"+y+",-"+l+"L0,0M"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M0,"+l+"V-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"L-"+l+",-"+l)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M0,0L-"+l+",-"+x+"H"+l+"Z")},noDot:!0},"arrow-left":{n:47,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,0L"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-right":{n:48,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,0L-"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M-"+l+",0H"+l+"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M-"+l+",0H"+l+"M0,0L-"+l+",-"+x+"H"+l+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,-"+x+"V"+x+"M0,0L"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,-"+x+"V"+x+"M0,0L-"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(g,m,w){if(n(m))return E;var l=e/2.5,x=2*g*r(l),y=2*g*i(l);return v(m,w,"M0,0L"+-x+","+y+"L"+x+","+y+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(g,m,w){if(n(m))return E;var l=e/4,x=2*g*r(l),y=2*g*i(l);return v(m,w,"M0,0L"+-x+","+y+"A "+2*g+","+2*g+" 0 0 1 "+x+","+y+"Z")},backoff:.4,noDot:!0}};function n(g){return g===null}var o,a,s,f;function v(g,m,w){if((!g||g%360===0)&&!m)return w;if(s===g&&f===m&&o===w)return a;s=g,f=m,o=w;function l(D,B){var R=r(D),I=i(D),F=B[0],j=B[1]+(m||0);return[F*R-j*I,F*I+j*R]}for(var x=g/180*e,y=0,S=0,k=u(w),M="",T=0;T{var u=Ni(),d=Xr(),E=d.numberFormat,A=Lo(),t=Af(),e=ji(),r=Pi(),i=xu(),n=d.strTranslate,o=Dl(),a=Lh(),s=gf(),f=s.LINE_SPACING,v=_d().DESELECTDIM,g=nu(),m=bm(),w=mh().appendArrayPointValue,l=V.exports={};l.font=function(mt,bt){var vt=bt.variant,Ut=bt.style,re=bt.weight,Kt=bt.color,ue=bt.size,Me=bt.family,Ce=bt.shadow,We=bt.lineposition,qe=bt.textcase;Me&&mt.style("font-family",Me),ue+1&&mt.style("font-size",ue+"px"),Kt&&mt.call(r.fill,Kt),re&&mt.style("font-weight",re),Ut&&mt.style("font-style",Ut),vt&&mt.style("font-variant",vt),qe&&mt.style("text-transform",x(S(qe))),Ce&&mt.style("text-shadow",Ce==="auto"?o.makeTextShadow(r.contrast(Kt)):x(Ce)),We&&mt.style("text-decoration-line",x(k(We)))};function x(mt){return mt==="none"?void 0:mt}var y={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function S(mt){return y[mt]}function k(mt){return mt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}l.setPosition=function(mt,bt,vt){mt.attr("x",bt).attr("y",vt)},l.setSize=function(mt,bt,vt){mt.attr("width",bt).attr("height",vt)},l.setRect=function(mt,bt,vt,Ut,re){mt.call(l.setPosition,bt,vt).call(l.setSize,Ut,re)},l.translatePoint=function(mt,bt,vt,Ut){var re=vt.c2p(mt.x),Kt=Ut.c2p(mt.y);if(A(re)&&A(Kt)&&bt.node())bt.node().nodeName==="text"?bt.attr("x",re).attr("y",Kt):bt.attr("transform",n(re,Kt));else return!1;return!0},l.translatePoints=function(mt,bt,vt){mt.each(function(Ut){var re=u.select(this);l.translatePoint(Ut,re,bt,vt)})},l.hideOutsideRangePoint=function(mt,bt,vt,Ut,re,Kt){bt.attr("display",vt.isPtWithinRange(mt,re)&&Ut.isPtWithinRange(mt,Kt)?null:"none")},l.hideOutsideRangePoints=function(mt,bt){if(bt._hasClipOnAxisFalse){var vt=bt.xaxis,Ut=bt.yaxis;mt.each(function(re){var Kt=re[0].trace,ue=Kt.xcalendar,Me=Kt.ycalendar,Ce=e.traceIs(Kt,"bar-like")?".bartext":".point,.textpoint";mt.selectAll(Ce).each(function(We){l.hideOutsideRangePoint(We,u.select(this),vt,Ut,ue,Me)})})}},l.crispRound=function(mt,bt,vt){return!bt||!A(bt)?vt||0:mt._context.staticPlot?bt:bt<1?1:Math.round(bt)},l.singleLineStyle=function(mt,bt,vt,Ut,re){bt.style("fill","none");var Kt=(((mt||[])[0]||{}).trace||{}).line||{},ue=vt||Kt.width||0,Me=re||Kt.dash||"";r.stroke(bt,Ut||Kt.color),l.dashLine(bt,Me,ue)},l.lineGroupStyle=function(mt,bt,vt,Ut){mt.style("fill","none").each(function(re){var Kt=(((re||[])[0]||{}).trace||{}).line||{},ue=bt||Kt.width||0,Me=Ut||Kt.dash||"";u.select(this).call(r.stroke,vt||Kt.color).call(l.dashLine,Me,ue)})},l.dashLine=function(mt,bt,vt){vt=+vt||0,bt=l.dashStyle(bt,vt),mt.style({"stroke-dasharray":bt,"stroke-width":vt+"px"})},l.dashStyle=function(mt,bt){bt=+bt||1;var vt=Math.max(bt,3);return mt==="solid"?mt="":mt==="dot"?mt=vt+"px,"+vt+"px":mt==="dash"?mt=3*vt+"px,"+3*vt+"px":mt==="longdash"?mt=5*vt+"px,"+5*vt+"px":mt==="dashdot"?mt=3*vt+"px,"+vt+"px,"+vt+"px,"+vt+"px":mt==="longdashdot"&&(mt=5*vt+"px,"+2*vt+"px,"+vt+"px,"+2*vt+"px"),mt};function M(mt,bt,vt,Ut){var re=bt.fillpattern,Kt=bt.fillgradient,ue=l.getPatternAttr,Me=re&&(ue(re.shape,0,"")||ue(re.path,0,""));if(Me){var Ce=ue(re.bgcolor,0,null),We=ue(re.fgcolor,0,null),qe=re.fgopacity,vr=ue(re.size,0,8),_r=ue(re.solidity,0,.3),er=bt.uid;l.pattern(mt,"point",vt,er,Me,vr,_r,void 0,re.fillmode,Ce,We,qe)}else if(Kt&&Kt.type!=="none"){var Mr=Kt.type,Ir="scatterfill-"+bt.uid;if(Ut&&(Ir="legendfill-"+bt.uid),!Ut&&(Kt.start!==void 0||Kt.stop!==void 0)){var de,Dt;Mr==="horizontal"?(de={x:Kt.start,y:0},Dt={x:Kt.stop,y:0}):Mr==="vertical"&&(de={x:0,y:Kt.start},Dt={x:0,y:Kt.stop}),de.x=bt._xA.c2p(de.x===void 0?bt._extremes.x.min[0].val:de.x,!0),de.y=bt._yA.c2p(de.y===void 0?bt._extremes.y.min[0].val:de.y,!0),Dt.x=bt._xA.c2p(Dt.x===void 0?bt._extremes.x.max[0].val:Dt.x,!0),Dt.y=bt._yA.c2p(Dt.y===void 0?bt._extremes.y.max[0].val:Dt.y,!0),mt.call(z,vt,Ir,"linear",Kt.colorscale,"fill",de,Dt,!0,!1)}else Mr==="horizontal"&&(Mr=Mr+"reversed"),mt.call(l.gradient,vt,Ir,Mr,Kt.colorscale,"fill")}else bt.fillcolor&&mt.call(r.fill,bt.fillcolor)}l.singleFillStyle=function(mt,bt){var vt=u.select(mt.node()),Ut=vt.data(),re=((Ut[0]||[])[0]||{}).trace||{};M(mt,re,bt,!1)},l.fillGroupStyle=function(mt,bt,vt){mt.style("stroke-width",0).each(function(Ut){var re=u.select(this);Ut[0].trace&&M(re,Ut[0].trace,bt,vt)})};var T=WT();l.symbolNames=[],l.symbolFuncs=[],l.symbolBackOffs=[],l.symbolNeedLines={},l.symbolNoDot={},l.symbolNoFill={},l.symbolList=[],Object.keys(T).forEach(function(mt){var bt=T[mt],vt=bt.n;l.symbolList.push(vt,String(vt),mt,vt+100,String(vt+100),mt+"-open"),l.symbolNames[vt]=mt,l.symbolFuncs[vt]=bt.f,l.symbolBackOffs[vt]=bt.backoff||0,bt.needLine&&(l.symbolNeedLines[vt]=!0),bt.noDot?l.symbolNoDot[vt]=!0:l.symbolList.push(vt+200,String(vt+200),mt+"-dot",vt+300,String(vt+300),mt+"-open-dot"),bt.noFill&&(l.symbolNoFill[vt]=!0)});var c=l.symbolNames.length,h="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";l.symbolNumber=function(mt){if(A(mt))mt=+mt;else if(typeof mt=="string"){var bt=0;mt.indexOf("-open")>0&&(bt=100,mt=mt.replace("-open","")),mt.indexOf("-dot")>0&&(bt+=200,mt=mt.replace("-dot","")),mt=l.symbolNames.indexOf(mt),mt>=0&&(mt+=bt)}return mt%100>=c||mt>=400?0:Math.floor(Math.max(mt,0))};function b(mt,bt,vt,Ut){var re=mt%100;return l.symbolFuncs[re](bt,vt,Ut)+(mt>=200?h:"")}var _=E("~f"),P={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(mt,bt,vt,Ut,re,Kt){var ue=P[Ut];return z(mt,bt,vt,ue.type,re,Kt,ue.start,ue.stop,!1,ue.reversed)};function z(mt,bt,vt,Ut,re,Kt,ue,Me,Ce,We){var qe=re.length,vr;Ut==="linear"?vr={node:"linearGradient",attrs:{x1:ue.x,y1:ue.y,x2:Me.x,y2:Me.y,gradientUnits:Ce?"userSpaceOnUse":"objectBoundingBox"},reversed:We}:Ut==="radial"&&(vr={node:"radialGradient",reversed:We});for(var _r=new Array(qe),er=0;er=0&&mt.i===void 0&&(mt.i=Kt.i),bt.style("opacity",Ut.selectedOpacityFn?Ut.selectedOpacityFn(mt):mt.mo===void 0?ue.opacity:mt.mo),Ut.ms2mrc){var Ce;mt.ms==="various"||ue.size==="various"?Ce=3:Ce=Ut.ms2mrc(mt.ms),mt.mrc=Ce,Ut.selectedSizeFn&&(Ce=mt.mrc=Ut.selectedSizeFn(mt));var We=l.symbolNumber(mt.mx||ue.symbol)||0;mt.om=We%200>=100;var qe=Zt(mt,vt),vr=it(mt,vt);bt.attr("d",b(We,Ce,qe,vr))}var _r=!1,er,Mr,Ir;if(mt.so)Ir=Me.outlierwidth,Mr=Me.outliercolor,er=ue.outliercolor;else{var de=(Me||{}).width;Ir=(mt.mlw+1||de+1||(mt.trace?(mt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in mt?Mr=mt.mlcc=Ut.lineScale(mt.mlc):d.isArrayOrTypedArray(Me.color)?Mr=r.defaultLine:Mr=Me.color,d.isArrayOrTypedArray(ue.color)&&(er=r.defaultLine,_r=!0),"mc"in mt?er=mt.mcc=Ut.markerScale(mt.mc):er=ue.color||ue.colors||"rgba(0,0,0,0)",Ut.selectedColorFn&&(er=Ut.selectedColorFn(mt))}if(mt.om)bt.call(r.stroke,er).style({"stroke-width":(Ir||1)+"px",fill:"none"});else{bt.style("stroke-width",(mt.isBlank?0:Ir)+"px");var Dt=ue.gradient,qt=mt.mgt;qt?_r=!0:qt=Dt&&Dt.type,d.isArrayOrTypedArray(qt)&&(qt=qt[0],P[qt]||(qt=0));var _t=ue.pattern,lt=l.getPatternAttr,yt=_t&&(lt(_t.shape,mt.i,"")||lt(_t.path,mt.i,""));if(qt&&qt!=="none"){var St=mt.mgc;St?_r=!0:St=Dt.color;var Ht=vt.uid;_r&&(Ht+="-"+mt.i),l.gradient(bt,re,Ht,qt,[[0,St],[1,er]],"fill")}else if(yt){var Yt=!1,se=_t.fgcolor;!se&&Kt&&Kt.color&&(se=Kt.color,Yt=!0);var ke=lt(se,mt.i,Kt&&Kt.color||null),Ee=lt(_t.bgcolor,mt.i,null),Ue=_t.fgopacity,ir=lt(_t.size,mt.i,8),ar=lt(_t.solidity,mt.i,.3);Yt=Yt||mt.mcc||d.isArrayOrTypedArray(_t.shape)||d.isArrayOrTypedArray(_t.path)||d.isArrayOrTypedArray(_t.bgcolor)||d.isArrayOrTypedArray(_t.fgcolor)||d.isArrayOrTypedArray(_t.size)||d.isArrayOrTypedArray(_t.solidity);var Ye=vt.uid;Yt&&(Ye+="-"+mt.i),l.pattern(bt,"point",re,Ye,yt,ir,ar,mt.mcc,_t.fillmode,Ee,ke,Ue)}else d.isArrayOrTypedArray(er)?r.fill(bt,er[mt.i]):r.fill(bt,er);Ir&&r.stroke(bt,Mr)}},l.makePointStyleFns=function(mt){var bt={},vt=mt.marker;return bt.markerScale=l.tryColorscale(vt,""),bt.lineScale=l.tryColorscale(vt,"line"),e.traceIs(mt,"symbols")&&(bt.ms2mrc=g.isBubble(mt)?m(mt):function(){return(vt.size||6)/2}),mt.selectedpoints&&d.extendFlat(bt,l.makeSelectedPointStyleFns(mt)),bt},l.makeSelectedPointStyleFns=function(mt){var bt={},vt=mt.selected||{},Ut=mt.unselected||{},re=mt.marker||{},Kt=vt.marker||{},ue=Ut.marker||{},Me=re.opacity,Ce=Kt.opacity,We=ue.opacity,qe=Ce!==void 0,vr=We!==void 0;(d.isArrayOrTypedArray(Me)||qe||vr)&&(bt.selectedOpacityFn=function(lt){var yt=lt.mo===void 0?re.opacity:lt.mo;return lt.selected?qe?Ce:yt:vr?We:v*yt});var _r=re.color,er=Kt.color,Mr=ue.color;(er||Mr)&&(bt.selectedColorFn=function(lt){var yt=lt.mcc||_r;return lt.selected?er||yt:Mr||yt});var Ir=re.size,de=Kt.size,Dt=ue.size,qt=de!==void 0,_t=Dt!==void 0;return e.traceIs(mt,"symbols")&&(qt||_t)&&(bt.selectedSizeFn=function(lt){var yt=lt.mrc||Ir/2;return lt.selected?qt?de/2:yt:_t?Dt/2:yt}),bt},l.makeSelectedTextStyleFns=function(mt){var bt={},vt=mt.selected||{},Ut=mt.unselected||{},re=mt.textfont||{},Kt=vt.textfont||{},ue=Ut.textfont||{},Me=re.color,Ce=Kt.color,We=ue.color;return bt.selectedTextColorFn=function(qe){var vr=qe.tc||Me;return qe.selected?Ce||vr:We||(Ce?vr:r.addOpacity(vr,v))},bt},l.selectedPointStyle=function(mt,bt){if(!(!mt.size()||!bt.selectedpoints)){var vt=l.makeSelectedPointStyleFns(bt),Ut=bt.marker||{},re=[];vt.selectedOpacityFn&&re.push(function(Kt,ue){Kt.style("opacity",vt.selectedOpacityFn(ue))}),vt.selectedColorFn&&re.push(function(Kt,ue){r.fill(Kt,vt.selectedColorFn(ue))}),vt.selectedSizeFn&&re.push(function(Kt,ue){var Me=ue.mx||Ut.symbol||0,Ce=vt.selectedSizeFn(ue);Kt.attr("d",b(l.symbolNumber(Me),Ce,Zt(ue,bt),it(ue,bt))),ue.mrc2=Ce}),re.length&&mt.each(function(Kt){for(var ue=u.select(this),Me=0;Me0?vt:0}l.textPointStyle=function(mt,bt,vt){if(mt.size()){var Ut;if(bt.selectedpoints){var re=l.makeSelectedTextStyleFns(bt);Ut=re.selectedTextColorFn}var Kt=bt.texttemplate,ue=vt._fullLayout;mt.each(function(Me){var Ce=u.select(this),We=Kt?d.extractOption(Me,bt,"txt","texttemplate"):d.extractOption(Me,bt,"tx","text");if(!We&&We!==0){Ce.remove();return}if(Kt){var qe=bt._module.formatLabels,vr=qe?qe(Me,bt,ue):{},_r={};w(_r,bt,Me.i),We=d.texttemplateString({data:[_r,Me,bt._meta],fallback:bt.texttemplatefallback,labels:vr,locale:ue._d3locale,template:We})}var er=Me.tp||bt.textposition,Mr=R(Me,bt),Ir=Ut?Ut(Me):Me.tc||bt.textfont.color;Ce.call(l.font,{family:Me.tf||bt.textfont.family,weight:Me.tw||bt.textfont.weight,style:Me.ty||bt.textfont.style,variant:Me.tv||bt.textfont.variant,textcase:Me.tC||bt.textfont.textcase,lineposition:Me.tE||bt.textfont.lineposition,shadow:Me.tS||bt.textfont.shadow,size:Mr,color:Ir}).text(We).call(o.convertToTspans,vt).call(B,er,Mr,Me.mrc)})}},l.selectedTextStyle=function(mt,bt){if(!(!mt.size()||!bt.selectedpoints)){var vt=l.makeSelectedTextStyleFns(bt);mt.each(function(Ut){var re=u.select(this),Kt=vt.selectedTextColorFn(Ut),ue=Ut.tp||bt.textposition,Me=R(Ut,bt);r.fill(re,Kt);var Ce=e.traceIs(bt,"bar-like");B(re,ue,Me,Ut.mrc2||Ut.mrc,Ce)})}};var I=.5;l.smoothopen=function(mt,bt){if(mt.length<3)return"M"+mt.join("L");var vt="M"+mt[0],Ut=[],re;for(re=1;re=Ce||lt>=qe&<<=Ce)&&(yt<=vr&&yt>=We||yt>=vr&&yt<=We)&&(mt=[lt,yt])}return mt}l.applyBackoff=Z,l.makeTester=function(){var mt=d.ensureSingleById(u.select("body"),"svg","js-plotly-tester",function(vt){vt.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),bt=d.ensureSingle(mt,"path","js-reference-point",function(vt){vt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=mt,l.testref=bt},l.savedBBoxes={};var ot=0,X=1e4;l.bBox=function(mt,bt,vt){vt||(vt=Q(mt));var Ut;if(vt){if(Ut=l.savedBBoxes[vt],Ut)return d.extendFlat({},Ut)}else if(mt.childNodes.length===1){var re=mt.childNodes[0];if(vt=Q(re),vt){var Kt=+re.getAttribute("x")||0,ue=+re.getAttribute("y")||0,Me=re.getAttribute("transform");if(!Me){var Ce=l.bBox(re,!1,vt);return Kt&&(Ce.left+=Kt,Ce.right+=Kt),ue&&(Ce.top+=ue,Ce.bottom+=ue),Ce}if(vt+="~"+Kt+"~"+ue+"~"+Me,Ut=l.savedBBoxes[vt],Ut)return d.extendFlat({},Ut)}}var We,qe;bt?We=mt:(qe=l.tester.node(),We=mt.cloneNode(!0),qe.appendChild(We)),u.select(We).attr("transform",null).call(o.positionText,0,0);var vr=We.getBoundingClientRect(),_r=l.testref.node().getBoundingClientRect();bt||qe.removeChild(We);var er={height:vr.height,width:vr.width,left:vr.left-_r.left,top:vr.top-_r.top,right:vr.right-_r.left,bottom:vr.bottom-_r.top};return ot>=X&&(l.savedBBoxes={},ot=0),vt&&(l.savedBBoxes[vt]=er),ot++,d.extendFlat({},er)};function Q(mt){var bt=mt.getAttribute("data-unformatted");if(bt!==null)return bt+mt.getAttribute("data-math")+mt.getAttribute("text-anchor")+mt.getAttribute("style")}l.setClipUrl=function(mt,bt,vt){mt.attr("clip-path",ut(bt,vt))};function ut(mt,bt){if(!mt)return null;var vt=bt._context,Ut=vt._exportedPlot?"":vt._baseUrl||"";return Ut?"url('"+Ut+"#"+mt+"')":"url(#"+mt+")"}l.getTranslate=function(mt){var bt=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,vt=mt.attr?"attr":"getAttribute",Ut=mt[vt]("transform")||"",re=Ut.replace(bt,function(Kt,ue,Me){return[ue,Me].join(" ")}).split(" ");return{x:+re[0]||0,y:+re[1]||0}},l.setTranslate=function(mt,bt,vt){var Ut=/(\btranslate\(.*?\);?)/,re=mt.attr?"attr":"getAttribute",Kt=mt.attr?"attr":"setAttribute",ue=mt[re]("transform")||"";return bt=bt||0,vt=vt||0,ue=ue.replace(Ut,"").trim(),ue+=n(bt,vt),ue=ue.trim(),mt[Kt]("transform",ue),ue},l.getScale=function(mt){var bt=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,vt=mt.attr?"attr":"getAttribute",Ut=mt[vt]("transform")||"",re=Ut.replace(bt,function(Kt,ue,Me){return[ue,Me].join(" ")}).split(" ");return{x:+re[0]||1,y:+re[1]||1}},l.setScale=function(mt,bt,vt){var Ut=/(\bscale\(.*?\);?)/,re=mt.attr?"attr":"getAttribute",Kt=mt.attr?"attr":"setAttribute",ue=mt[re]("transform")||"";return bt=bt||1,vt=vt||1,ue=ue.replace(Ut,"").trim(),ue+="scale("+bt+","+vt+")",ue=ue.trim(),mt[Kt]("transform",ue),ue};var J=/\s*sc.*/;l.setPointGroupScale=function(mt,bt,vt){if(bt=bt||1,vt=vt||1,!!mt){var Ut=bt===1&&vt===1?"":"scale("+bt+","+vt+")";mt.each(function(){var re=(this.getAttribute("transform")||"").replace(J,"");re+=Ut,re=re.trim(),this.setAttribute("transform",re)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(mt,bt,vt){mt&&mt.each(function(){var Ut,re=u.select(this),Kt=re.select("text");if(Kt.node()){var ue=parseFloat(Kt.attr("x")||0),Me=parseFloat(Kt.attr("y")||0),Ce=(re.attr("transform")||"").match(q);bt===1&&vt===1?Ut=[]:Ut=[n(ue,Me),"scale("+bt+","+vt+")",n(-ue,-Me)],Ce&&Ut.push(Ce),re.attr("transform",Ut.join(""))}})};function it(mt,bt){var vt;return mt&&(vt=mt.mf),vt===void 0&&(vt=bt.marker&&bt.marker.standoff||0),!bt._geo&&!bt._xA?-vt:vt}l.getMarkerStandoff=it;var nt=Math.atan2,dt=Math.cos,Tt=Math.sin;function wt(mt,bt){var vt=bt[0],Ut=bt[1];return[vt*dt(mt)-Ut*Tt(mt),vt*Tt(mt)+Ut*dt(mt)]}var Ct,It,Nt,te,Jt,ee;function Zt(mt,bt){var vt=mt.ma;vt===void 0&&(vt=bt.marker.angle,(!vt||d.isArrayOrTypedArray(vt))&&(vt=0));var Ut,re,Kt=bt.marker.angleref;if(Kt==="previous"||Kt==="north"){if(bt._geo){var ue=bt._geo.project(mt.lonlat);Ut=ue[0],re=ue[1]}else{var Me=bt._xA,Ce=bt._yA;if(Me&&Ce)Ut=Me.c2p(mt.x),re=Ce.c2p(mt.y);else return 90}if(bt._geo){var We=mt.lonlat[0],qe=mt.lonlat[1],vr=bt._geo.project([We,qe+1e-5]),_r=bt._geo.project([We+1e-5,qe]),er=nt(_r[1]-re,_r[0]-Ut),Mr=nt(vr[1]-re,vr[0]-Ut),Ir;if(Kt==="north")Ir=vt/180*Math.PI;else if(Kt==="previous"){var de=We/180*Math.PI,Dt=qe/180*Math.PI,qt=Ct/180*Math.PI,_t=It/180*Math.PI,lt=qt-de,yt=dt(_t)*Tt(lt),St=Tt(_t)*dt(Dt)-dt(_t)*Tt(Dt)*dt(lt);Ir=-nt(yt,St)-Math.PI,Ct=We,It=qe}var Ht=wt(er,[dt(Ir),0]),Yt=wt(Mr,[Tt(Ir),0]);vt=nt(Ht[1]+Yt[1],Ht[0]+Yt[0])/Math.PI*180,Kt==="previous"&&!(ee===bt.uid&&mt.i===Jt+1)&&(vt=null)}if(Kt==="previous"&&!bt._geo)if(ee===bt.uid&&mt.i===Jt+1&&A(Ut)&&A(re)){var se=Ut-Nt,ke=re-te,Ee=bt.line&&bt.line.shape||"",Ue=Ee.slice(Ee.length-1);Ue==="h"&&(ke=0),Ue==="v"&&(se=0),vt+=nt(ke,se)/Math.PI*180+90}else vt=null}return Nt=Ut,te=re,Jt=mt.i,ee=bt.uid,vt}l.getMarkerAngle=Zt}),l0=Vt((K,V)=>{var u=Ni(),d=Lo(),E=Uu(),A=ji(),t=Xr(),e=t.strTranslate,r=Eo(),i=Pi(),n=Dl(),o=_d(),a=gf().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,v=1.6;function g(m,w,l){var x=m._fullLayout,y=l.propContainer,S=l.propName,k=l.placeholder,M=l.traceIndex,T=l.avoid||{},c=l.attributes,h=l.transform,b=l.containerGroup,_=1,P=y.title,z=(P&&P.text?P.text:"").trim(),D=!1,B=P&&P.font?P.font:{},R=B.family,I=B.size,F=B.color,j=B.weight,N=B.style,G=B.variant,rt=B.textcase,ct=B.lineposition,st=B.shadow,et=l.subtitlePropName,Z=!!et,ot=l.subtitlePlaceholder,X=(y.title||{}).subtitle||{text:"",font:{}},Q=(X.text||"").trim(),ut=!1,J=1,q=X.font,it=q.family,nt=q.size,dt=q.color,Tt=q.weight,wt=q.style,Ct=q.variant,It=q.textcase,Nt=q.lineposition,te=q.shadow,Jt;S==="title.text"?Jt="titleText":S.indexOf("axis")!==-1?Jt="axisTitleText":S.indexOf("colorbar")!==-1&&(Jt="colorbarTitleText");var ee=m._context.edits[Jt];function Zt(_r,er){return _r===void 0||er===void 0?!1:_r.replace(s," % ")===er.replace(s," % ")}z===""?_=0:Zt(z,k)&&(ee||(z=""),_=.2,D=!0),Z&&(Q===""?J=0:Zt(Q,ot)&&(ee||(Q=""),J=.2,ut=!0)),l._meta?z=t.templateString(z,l._meta):x._meta&&(z=t.templateString(z,x._meta));var mt=z||Q||ee,bt;b||(b=t.ensureSingle(x._infolayer,"g","g-"+w),bt=x._hColorbarMoveTitle);var vt=b.selectAll("text."+w).data(mt?[0]:[]);vt.enter().append("text"),vt.text(z).attr("class",w),vt.exit().remove();var Ut=null,re=w+"-subtitle",Kt=Q||ee;if(Z&&(Ut=b.selectAll("text."+re).data(Kt?[0]:[]),Ut.enter().append("text"),Ut.text(Q).attr("class",re),Ut.exit().remove()),!mt)return b;function ue(_r,er){t.syncOrAsync([Me,Ce],{title:_r,subtitle:er})}function Me(_r){var er=_r.title,Mr=_r.subtitle,Ir;!h&&bt&&(h={}),h?(Ir="",h.rotate&&(Ir+="rotate("+[h.rotate,c.x,c.y]+")"),(h.offset||bt)&&(Ir+=e(0,(h.offset||0)-(bt||0)))):Ir=null,er.attr("transform",Ir);function de(St){if(St){var Ht=u.select(St.node().parentNode).select("."+re);if(!Ht.empty()){var Yt=St.node().getBBox();if(Yt.height){var se=Yt.y+Yt.height+f*nt;Ht.attr("y",se)}}}}if(er.style("opacity",_*i.opacity(F)).call(r.font,{color:i.rgb(F),size:u.round(I,2),family:R,weight:j,style:N,variant:G,textcase:rt,shadow:st,lineposition:ct}).attr(c).call(n.convertToTspans,m,de),Mr&&!Mr.empty()){var Dt=b.select("."+w+"-math-group"),qt=er.node().getBBox(),_t=Dt.node()?Dt.node().getBBox():void 0,lt=_t?_t.y+_t.height+f*nt:qt.y+qt.height+v*nt,yt=t.extendFlat({},c,{y:lt});Mr.attr("transform",Ir),Mr.style("opacity",J*i.opacity(dt)).call(r.font,{color:i.rgb(dt),size:u.round(nt,2),family:it,weight:Tt,style:wt,variant:Ct,textcase:It,shadow:te,lineposition:Nt}).attr(yt).call(n.convertToTspans,m)}return E.previousPromises(m)}function Ce(_r){var er=_r.title,Mr=u.select(er.node().parentNode);if(T&&T.selection&&T.side&&z){Mr.attr("transform",null);var Ir=a[T.side],de=T.side==="left"||T.side==="top"?-1:1,Dt=d(T.pad)?T.pad:2,qt=r.bBox(Mr.node()),_t={t:0,b:0,l:0,r:0},lt=m._fullLayout._reservedMargin;for(var yt in lt)for(var St in lt[yt]){var Ht=lt[yt][St];_t[St]=Math.max(_t[St],Ht)}var Yt={left:_t.l,top:_t.t,right:x.width-_t.r,bottom:x.height-_t.b},se=T.maxShift||de*(Yt[T.side]-qt[T.side]),ke=0;if(se<0)ke=se;else{var Ee=T.offsetLeft||0,Ue=T.offsetTop||0;qt.left-=Ee,qt.right-=Ee,qt.top-=Ue,qt.bottom-=Ue,T.selection.each(function(){var ar=r.bBox(this);t.bBoxIntersect(qt,ar,Dt)&&(ke=Math.max(ke,de*(ar[T.side]-qt[Ir])+Dt))}),ke=Math.min(se,ke),y._titleScoot=Math.abs(ke)}if(ke>0||se<0){var ir={left:[-ke,0],right:[ke,0],top:[0,-ke],bottom:[0,ke]}[T.side];Mr.attr("transform",e(ir[0],ir[1]))}}}vt.call(ue,Ut);function We(_r,er){_r.text(er).on("mouseover.opacity",function(){u.select(this).transition().duration(o.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){u.select(this).transition().duration(o.HIDE_PLACEHOLDER).style("opacity",0)})}if(ee&&(z?vt.on(".opacity",null):(We(vt,k),D=!0),vt.call(n.makeEditable,{gd:m}).on("edit",function(_r){M!==void 0?A.call("_guiRestyle",m,S,_r,M):A.call("_guiRelayout",m,S,_r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ue)}).on("input",function(_r){this.text(_r||" ").call(n.positionText,c.x,c.y)}),Z)){if(Z&&!z){var qe=vt.node().getBBox(),vr=qe.y+qe.height+v*nt;Ut.attr("y",vr)}Q?Ut.on(".opacity",null):(We(Ut,ot),ut=!0),Ut.call(n.makeEditable,{gd:m}).on("edit",function(_r){A.call("_guiRelayout",m,"title.subtitle.text",_r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ue)}).on("input",function(_r){this.text(_r||" ").call(n.positionText,Ut.attr("x"),Ut.attr("y"))})}return vt.classed("js-placeholder",D),Ut&&!Ut.empty()&&Ut.classed("js-placeholder",ut),b}V.exports={draw:g,SUBTITLE_PADDING_EM:v,SUBTITLE_PADDING_MATHJAX_EM:f}}),mp=Vt((K,V)=>{var u=Ni(),d=pm().utcFormat,E=Xr(),A=E.numberFormat,t=Lo(),e=E.cleanNumber,r=E.ms2DateTime,i=E.dateTime2ms,n=E.ensureNumber,o=E.isArrayOrTypedArray,a=ks(),s=a.FP_SAFE,f=a.BADNUM,v=a.LOG_CLIP,g=a.ONEWEEK,m=a.ONEDAY,w=a.ONEHOUR,l=a.ONEMIN,x=a.ONESEC,y=cc(),S=Mf(),k=S.HOUR_PATTERN,M=S.WEEKDAY_PATTERN;function T(h){return Math.pow(10,h)}function c(h){return h!=null}V.exports=function(h,b){b=b||{};var _=h._id||"x",P=_.charAt(0);function z(X,Q){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&Q&&h.range&&h.range.length===2){var ut=h.range[0],J=h.range[1];return .5*(ut+J-2*v*Math.abs(ut-J))}else return f}function D(X,Q,ut,J){if((J||{}).msUTC&&t(X))return+X;var q=i(X,ut||h.calendar);if(q===f)if(t(X)){X=+X;var it=Math.floor(E.mod(X+.05,1)*10),nt=Math.round(X-it/10);q=i(new Date(nt))+it/10}else return f;return q}function B(X,Q,ut){return r(X,Q,ut||h.calendar)}function R(X){return h._categories[Math.round(X)]}function I(X){if(c(X)){if(h._categoriesMap===void 0&&(h._categoriesMap={}),h._categoriesMap[X]!==void 0)return h._categoriesMap[X];h._categories.push(typeof X=="number"?String(X):X);var Q=h._categories.length-1;return h._categoriesMap[X]=Q,Q}return f}function F(X,Q){for(var ut=new Array(Q),J=0;Jh.range[1]&&(ut=!ut);for(var J=ut?-1:1,q=J*X,it=0,nt=0;ntTt)it=nt+1;else{it=q<(dt+Tt)/2?nt:nt+1;break}}var wt=h._B[it]||0;return isFinite(wt)?rt(X,h._m2,wt):0},et=function(X){var Q=h._rangebreaks.length;if(!Q)return ct(X,h._m,h._b);for(var ut=0,J=0;Jh._rangebreaks[J].pmax&&(ut=J+1);return ct(X,h._m2,h._B[ut])}}h.c2l=h.type==="log"?z:n,h.l2c=h.type==="log"?T:n,h.l2p=st,h.p2l=et,h.c2p=h.type==="log"?function(X,Q){return st(z(X,Q))}:st,h.p2c=h.type==="log"?function(X){return T(et(X))}:et,["linear","-"].indexOf(h.type)!==-1?(h.d2r=h.r2d=h.d2c=h.r2c=h.d2l=h.r2l=e,h.c2d=h.c2r=h.l2d=h.l2r=n,h.d2p=h.r2p=function(X){return h.l2p(e(X))},h.p2d=h.p2r=et,h.cleanPos=n):h.type==="log"?(h.d2r=h.d2l=function(X,Q){return z(e(X),Q)},h.r2d=h.r2c=function(X){return T(e(X))},h.d2c=h.r2l=e,h.c2d=h.l2r=n,h.c2r=z,h.l2d=T,h.d2p=function(X,Q){return h.l2p(h.d2r(X,Q))},h.p2d=function(X){return T(et(X))},h.r2p=function(X){return h.l2p(e(X))},h.p2r=et,h.cleanPos=n):h.type==="date"?(h.d2r=h.r2d=E.identity,h.d2c=h.r2c=h.d2l=h.r2l=D,h.c2d=h.c2r=h.l2d=h.l2r=B,h.d2p=h.r2p=function(X,Q,ut){return h.l2p(D(X,0,ut))},h.p2d=h.p2r=function(X,Q,ut){return B(et(X),Q,ut)},h.cleanPos=function(X){return E.cleanDate(X,f,h.calendar)}):h.type==="category"?(h.d2c=h.d2l=I,h.r2d=h.c2d=h.l2d=R,h.d2r=h.d2l_noadd=N,h.r2c=function(X){var Q=G(X);return Q!==void 0?Q:h.fraction2r(.5)},h.l2r=h.c2r=n,h.r2l=G,h.d2p=function(X){return h.l2p(h.r2c(X))},h.p2d=function(X){return R(et(X))},h.r2p=h.d2p,h.p2r=et,h.cleanPos=function(X){return typeof X=="string"&&X!==""?X:n(X)}):h.type==="multicategory"&&(h.r2d=h.c2d=h.l2d=R,h.d2r=h.d2l_noadd=N,h.r2c=function(X){var Q=N(X);return Q!==void 0?Q:h.fraction2r(.5)},h.r2c_just_indices=j,h.l2r=h.c2r=n,h.r2l=N,h.d2p=function(X){return h.l2p(h.r2c(X))},h.p2d=function(X){return R(et(X))},h.r2p=h.d2p,h.p2r=et,h.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:n(X)},h.setupMultiCategory=function(X){var Q=h._traceIndices,ut,J,q=h._matchGroup;if(q&&h._categories.length===0){for(var it in q)if(it!==_){var nt=b[y.id2name(it)];Q=Q.concat(nt._traceIndices)}}var dt=[[0,{}],[0,{}]],Tt=[];for(ut=0;utnt[1]&&(J[it?0:1]=ut),J[0]===J[1]){var dt=h.l2r(Q),Tt=h.l2r(ut);if(Q!==void 0){var wt=dt+1;ut!==void 0&&(wt=Math.min(wt,Tt)),J[it?1:0]=wt}if(ut!==void 0){var Ct=Tt+1;Q!==void 0&&(Ct=Math.max(Ct,dt)),J[it?0:1]=Ct}}}},h.cleanRange=function(X,Q){h._cleanRange(X,Q),h.limitRange(X)},h._cleanRange=function(X,Q){Q||(Q={}),X||(X="range");var ut=E.nestedProperty(h,X).get(),J,q;if(h.type==="date"?q=E.dfltRange(h.calendar):P==="y"?q=S.DFLTRANGEY:h._name==="realaxis"?q=[0,1]:q=Q.dfltRange||S.DFLTRANGEX,q=q.slice(),(h.rangemode==="tozero"||h.rangemode==="nonnegative")&&(q[0]=0),!ut||ut.length!==2){E.nestedProperty(h,X).set(q);return}var it=ut[0]===null,nt=ut[1]===null;for(h.type==="date"&&!h.autorange&&(ut[0]=E.cleanDate(ut[0],f,h.calendar),ut[1]=E.cleanDate(ut[1],f,h.calendar)),J=0;J<2;J++)if(h.type==="date"){if(!E.isDateTime(ut[J],h.calendar)){h[X]=q;break}if(h.r2l(ut[0])===h.r2l(ut[1])){var dt=E.constrain(h.r2l(ut[0]),E.MIN_MS+1e3,E.MAX_MS-1e3);ut[0]=h.l2r(dt-1e3),ut[1]=h.l2r(dt+1e3);break}}else{if(!t(ut[J]))if(!(it||nt)&&t(ut[1-J]))ut[J]=ut[1-J]*(J?10:.1);else{h[X]=q;break}if(ut[J]<-s?ut[J]=-s:ut[J]>s&&(ut[J]=s),ut[0]===ut[1]){var Tt=Math.max(1,Math.abs(ut[0]*1e-6));ut[0]-=Tt,ut[1]+=Tt}}},h.setScale=function(X){var Q=b._size;if(h.overlaying){var ut=y.getFromId({_fullLayout:b},h.overlaying);h.domain=ut.domain}var J=X&&h._r?"_r":"range",q=h.calendar;h.cleanRange(J);var it=h.r2l(h[J][0],q),nt=h.r2l(h[J][1],q),dt=P==="y";if(dt?(h._offset=Q.t+(1-h.domain[1])*Q.h,h._length=Q.h*(h.domain[1]-h.domain[0]),h._m=h._length/(it-nt),h._b=-h._m*nt):(h._offset=Q.l+h.domain[0]*Q.w,h._length=Q.w*(h.domain[1]-h.domain[0]),h._m=h._length/(nt-it),h._b=-h._m*it),h._rangebreaks=[],h._lBreaks=0,h._m2=0,h._B=[],h.rangebreaks){var Tt,wt;if(h._rangebreaks=h.locateBreaks(Math.min(it,nt),Math.max(it,nt)),h._rangebreaks.length){for(Tt=0;Ttnt&&(Ct=!Ct),Ct&&h._rangebreaks.reverse();var It=Ct?-1:1;for(h._m2=It*h._length/(Math.abs(nt-it)-h._lBreaks),h._B.push(-h._m2*(dt?nt:it)),Tt=0;Ttq&&(q+=7,itq&&(q+=24,it=J&&it=J&&X=Kt.min&&(btKt.max&&(Kt.max=vt),Ut=!1)}Ut&&nt.push({min:bt,max:vt})}};for(ut=0;ut{var u=Lo(),d=Xr(),E=ks().BADNUM,A=d.isArrayOrTypedArray,t=d.isDateTime,e=d.cleanNumber,r=Math.round;V.exports=function(v,g,m){var w=v,l=m.noMultiCategory;if(A(w)&&!w.length)return"-";if(!l&&f(w))return"multicategory";if(l&&Array.isArray(w[0])){for(var x=[],y=0;yx*2}function a(v){return Math.max(1,(v-1)/1e3)}function s(v,g){for(var m=v.length,w=a(m),l=0,x=0,y={},S=0;Sl*2}function f(v){return A(v[0])&&A(v[1])}}),Xh=Vt((K,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=ks().FP_SAFE,t=ji(),e=Eo(),r=cc(),i=r.getFromId,n=r.isLinked;V.exports={applyAutorangeOptions:b,getAutoRange:o,makePadFn:s,doAutoRange:m,findExtremes:w,concatExtremes:g};function o(_,P){var z,D,B=[],R=_._fullLayout,I=s(R,P,0),F=s(R,P,1),j=g(_,P),N=j.min,G=j.max;if(N.length===0||G.length===0)return E.simpleMap(P.range,P.r2l);var rt=N[0].val,ct=G[0].val;for(z=1;z0&&(wt=ut-I(it)-F(nt),wt>J?Ct/wt>q&&(dt=it,Tt=nt,q=Ct/wt):Ct/ut>q&&(dt={val:it.val,nopad:1},Tt={val:nt.val,nopad:1},q=Ct/ut));function It(Zt,mt){return Math.max(Zt,F(mt))}if(rt===ct){var Nt=rt-1,te=rt+1;if(X)if(rt===0)B=[0,1];else{var Jt=(rt>0?G:N).reduce(It,0),ee=rt/(1-Math.min(.5,Jt/ut));B=rt>0?[0,ee]:[ee,0]}else Q?B=[Math.max(0,Nt),Math.max(1,te)]:B=[Nt,te]}else X?(dt.val>=0&&(dt={val:0,nopad:1}),Tt.val<=0&&(Tt={val:0,nopad:1})):Q&&(dt.val-q*I(dt)<0&&(dt={val:0,nopad:1}),Tt.val<=0&&(Tt={val:1,nopad:1})),q=(Tt.val-dt.val-a(P,it.val,nt.val))/(ut-I(dt)-F(Tt)),B=[dt.val-q*I(dt),Tt.val+q*F(Tt)];return B=b(B,P),P.limitRange&&P.limitRange(),et&&B.reverse(),E.simpleMap(B,P.l2r||Number)}function a(_,P,z){var D=0;if(_.rangebreaks)for(var B=_.locateBreaks(P,z),R=0;R0?z.ppadplus:z.ppadminus)||z.ppad||0),it=J((_._m>0?z.ppadminus:z.ppadplus)||z.ppad||0),nt=J(z.vpadplus||z.vpad),dt=J(z.vpadminus||z.vpad);if(!N){if(Q=1/0,ut=-1/0,j)for(rt=0;rt0&&(Q=ct),ct>ut&&ct-A&&(Q=ct),ct>ut&&ct=Ct;rt--)wt(rt);return{min:D,max:B,opts:z}}function l(_,P,z,D){y(_,P,z,D,k)}function x(_,P,z,D){y(_,P,z,D,M)}function y(_,P,z,D,B){for(var R=D.tozero,I=D.extrapad,F=!0,j=0;j<_.length&&F;j++){var N=_[j];if(B(N.val,P)&&N.pad>=z&&(N.extrapad||!I)){F=!1;break}else B(P,N.val)&&N.pad<=z&&(I||!N.extrapad)&&(_.splice(j,1),j--)}if(F){var G=R&&P===0;_.push({val:P,pad:G?0:z,extrapad:G?!1:I})}}function S(_){return d(_)&&Math.abs(_)=P}function T(_,P){var z=P.autorangeoptions;return z&&z.minallowed!==void 0&&h(P,z.minallowed,z.maxallowed)?z.minallowed:z&&z.clipmin!==void 0&&h(P,z.clipmin,z.clipmax)?Math.max(_,P.d2l(z.clipmin)):_}function c(_,P){var z=P.autorangeoptions;return z&&z.maxallowed!==void 0&&h(P,z.minallowed,z.maxallowed)?z.maxallowed:z&&z.clipmax!==void 0&&h(P,z.clipmin,z.clipmax)?Math.min(_,P.d2l(z.clipmax)):_}function h(_,P,z){return P!==void 0&&z!==void 0?(P=_.d2l(P),z=_.d2l(z),P=j&&(R=j,z=j),I<=j&&(I=j,D=j)}}return z=T(z,P),D=c(D,P),[z,D]}}),yo=Vt((K,V)=>{var u=Ni(),d=Lo(),E=Uu(),A=ji(),t=Xr(),e=t.strTranslate,r=Dl(),i=l0(),n=Pi(),o=Eo(),a=Of(),s=ub(),f=ks(),v=f.ONEMAXYEAR,g=f.ONEAVGYEAR,m=f.ONEMINYEAR,w=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,x=f.ONEMINQUARTER,y=f.ONEMAXMONTH,S=f.ONEAVGMONTH,k=f.ONEMINMONTH,M=f.ONEWEEK,T=f.ONEDAY,c=T/2,h=f.ONEHOUR,b=f.ONEMIN,_=f.ONESEC,P=f.ONEMILLI,z=f.ONEMICROSEC,D=f.MINUS_SIGN,B=f.BADNUM,R={K:"zeroline"},I={K:"gridline",L:"path"},F={K:"minor-gridline",L:"path"},j={K:"tick",L:"path"},N={K:"tick",L:"text"},G={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},rt=gf(),ct=rt.MID_SHIFT,st=rt.CAP_SHIFT,et=rt.LINE_SPACING,Z=rt.OPPOSITE_SIDE,ot=3,X=V.exports={};X.setConvert=mp();var Q=wm(),ut=cc(),J=ut.idSort,q=ut.isLinked;X.id2name=ut.id2name,X.name2id=ut.name2id,X.cleanId=ut.cleanId,X.list=ut.list,X.listIds=ut.listIds,X.getFromId=ut.getFromId,X.getFromTrace=ut.getFromTrace;var it=Xh();X.getAutoRange=it.getAutoRange,X.findExtremes=it.findExtremes;var nt=1e-4;function dt(ve){var ge=(ve[1]-ve[0])*nt;return[ve[0]-ge,ve[1]+ge]}X.coerceRef=function(ve,ge,dr,br,Tr,mr){var kr=br.charAt(br.length-1),Ur=dr._fullLayout._subplots[kr+"axis"],Or=br+"ref",pe={};return Tr||(Tr=Ur[0]||(typeof mr=="string"?mr:mr[0])),mr||(mr=Tr),Ur=Ur.concat(Ur.map(function(Ke){return Ke+" domain"})),pe[Or]={valType:"enumerated",values:Ur.concat(mr?typeof mr=="string"?[mr]:mr:[]),dflt:Tr},t.coerce(ve,ge,pe,Or)},X.getRefType=function(ve){return ve===void 0?ve:ve==="paper"?"paper":ve==="pixel"?"pixel":/( domain)$/.test(ve)?"domain":"range"},X.coercePosition=function(ve,ge,dr,br,Tr,mr){var kr,Ur,Or=X.getRefType(br);if(Or!=="range")kr=t.ensureNumber,Ur=dr(Tr,mr);else{var pe=X.getFromId(ge,br);mr=pe.fraction2r(mr),Ur=dr(Tr,mr),kr=pe.cleanPos}ve[Tr]=kr(Ur)},X.cleanPosition=function(ve,ge,dr){var br=dr==="paper"||dr==="pixel"?t.ensureNumber:X.getFromId(ge,dr).cleanPos;return br(ve)},X.redrawComponents=function(ve,ge){ge=ge||X.listIds(ve);var dr=ve._fullLayout;function br(Tr,mr,kr,Ur){for(var Or=A.getComponentMethod(Tr,mr),pe={},Ke=0;Ke2e-6||((dr-ve._forceTick0)/ve._minDtick%1+1.000001)%1>2e-6)&&(ve._minDtick=0))},X.saveRangeInitial=function(ve,ge){for(var dr=X.list(ve,"",!0),br=!1,Tr=0;Trxr*.3||pe(br)||pe(Tr))){var Gr=dr.dtick/2;ve+=ve+Grkr){var Ur=Number(dr.slice(1));mr.exactYears>kr&&Ur%12===0?ve=X.tickIncrement(ve,"M6","reverse")+T*1.5:mr.exactMonths>kr?ve=X.tickIncrement(ve,"M1","reverse")+T*15.5:ve-=c;var Or=X.tickIncrement(ve,dr);if(Or<=br)return Or}return ve}X.prepMinorTicks=function(ve,ge,dr){if(!ge.minor.dtick){delete ve.dtick;var br=ge.dtick&&d(ge._tmin),Tr;if(br){var mr=X.tickIncrement(ge._tmin,ge.dtick,!0);Tr=[ge._tmin,mr*.99+ge._tmin*.01]}else{var kr=t.simpleMap(ge.range,ge.r2l);Tr=[kr[0],.8*kr[0]+.2*kr[1]]}if(ve.range=t.simpleMap(Tr,ge.l2r),ve._isMinor=!0,X.prepTicks(ve,dr),br){var Ur=d(ge.dtick),Or=d(ve.dtick),pe=Ur?ge.dtick:+ge.dtick.substring(1),Ke=Or?ve.dtick:+ve.dtick.substring(1);Ur&&Or?te(pe,Ke)?pe===2*M&&Ke===2*T&&(ve.dtick=M):pe===2*M&&Ke===3*T?ve.dtick=M:pe===M&&!(ge._input.minor||{}).nticks?ve.dtick=T:Jt(pe/Ke,2.5)?ve.dtick=pe/2:ve.dtick=pe:String(ge.dtick).charAt(0)==="M"?Or?ve.dtick="M1":te(pe,Ke)?pe>=12&&Ke===2&&(ve.dtick="M3"):ve.dtick=ge.dtick:String(ve.dtick).charAt(0)==="L"?String(ge.dtick).charAt(0)==="L"?te(pe,Ke)||(ve.dtick=Jt(pe/Ke,2.5)?ge.dtick/2:ge.dtick):ve.dtick="D1":ve.dtick==="D2"&&+ge.dtick>1&&(ve.dtick=1)}ve.range=ge.range}ge.minor._tick0Init===void 0&&(ve.tick0=ge.tick0)};function te(ve,ge){return Math.abs((ve/ge+.5)%1-.5)<.001}function Jt(ve,ge){return Math.abs(ve/ge-1)<.001}X.prepTicks=function(ve,ge){var dr=t.simpleMap(ve.range,ve.r2l,void 0,void 0,ge);if(ve.tickmode==="auto"||!ve.dtick){var br=ve.nticks,Tr;br||(ve.type==="category"||ve.type==="multicategory"?(Tr=ve.tickfont?t.bigFont(ve.tickfont.size||12):15,br=ve._length/Tr):(Tr=ve._id.charAt(0)==="y"?40:80,br=t.constrain(ve._length/Tr,4,9)+1),ve._name==="radialaxis"&&(br*=2)),ve.minor&&ve.minor.tickmode!=="array"||ve.tickmode==="array"&&(br*=100),ve._roughDTick=Math.abs(dr[1]-dr[0])/br,X.autoTicks(ve,ve._roughDTick),ve._minDtick>0&&ve.dtick0?(mr=br-1,kr=br):(mr=br,kr=br);var Ur=ve[mr].value,Or=ve[kr].value,pe=Math.abs(Or-Ur),Ke=dr||pe,xr=0;Ke>=m?pe>=m&&pe<=v?xr=pe:xr=g:dr===l&&Ke>=x?pe>=x&&pe<=w?xr=pe:xr=l:Ke>=k?pe>=k&&pe<=y?xr=pe:xr=S:dr===M&&Ke>=M?xr=M:Ke>=T?xr=T:dr===c&&Ke>=c?xr=c:dr===h&&Ke>=h&&(xr=h);var Gr;xr>=pe&&(xr=pe,Gr=!0);var ln=Tr+xr;if(ge.rangebreaks&&xr>0){for(var wn=84,rn=0,Qr=0;QrM&&(xr=pe)}(xr>0||br===0)&&(ve[br].periodX=Tr+xr/2)}}X.calcTicks=function(ve,ge){for(var dr=ve.type,br=ve.calendar,Tr=ve.ticklabelstep,mr=ve.ticklabelmode==="period",kr=ve.range[0]>ve.range[1],Ur=!ve.ticklabelindex||t.isArrayOrTypedArray(ve.ticklabelindex)?ve.ticklabelindex:[ve.ticklabelindex],Or=t.simpleMap(ve.range,ve.r2l,void 0,void 0,ge),pe=Or[1]=(Oa?0:1);Qn--){var Qa=!Qn;Qn?(ve._dtickInit=ve.dtick,ve._tick0Init=ve.tick0):(ve.minor._dtickInit=ve.minor.dtick,ve.minor._tick0Init=ve.minor.tick0);var Ja=Qn?ve:t.extendFlat({},ve,ve.minor);if(Qa?X.prepMinorTicks(Ja,ve,ge):X.prepTicks(Ja,ge),Ja.tickmode==="array"){Qn?(rn=[],ln=Ut(ve,!Qa)):(Qr=[],wn=Ut(ve,!Qa));continue}if(Ja.tickmode==="sync"){rn=[],ln=vt(ve);continue}var wi=dt(Or),ci=wi[0],Ti=wi[1],Ra=d(Ja.dtick),Qi=dr==="log"&&!(Ra||Ja.dtick.charAt(0)==="L"),Hi=X.tickFirst(Ja,ge);if(Qn){if(ve._tmin=Hi,Hi=Ti:Ci<=Ti;Ci=X.tickIncrement(Ci,qo,pe,br)){if(Qn&&zo++,Ja.rangebreaks&&!pe){if(Ci=xr)break}if(rn.length>Gr||Ci===Ho)break;Ho=Ci;var Po={value:Ci};Qn?(Qi&&Ci!==(Ci|0)&&(Po.simpleLabel=!0),Tr>1&&zo%Tr&&(Po.skipLabel=!0),rn.push(Po)):(Po.minor=!0,Qr.push(Po))}}if(!Qr||Qr.length<2)Ur=!1;else{var hs=(Qr[1].value-Qr[0].value)*(kr?-1:1);Ga(hs,ve.tickformat)||(Ur=!1)}if(!Ur)vn=rn;else{var Gi=rn.concat(Qr);mr&&rn.length&&(Gi=Gi.slice(1)),Gi=Gi.sort(function(Wo,Bi){return Wo.value-Bi.value}).filter(function(Wo,Bi,$s){return Bi===0||Wo.value!==$s[Bi-1].value});var uo=Gi.map(function(Wo,Bi){return Wo.minor===void 0&&!Wo.skipLabel?Bi:null}).filter(function(Wo){return Wo!==null});uo.forEach(function(Wo){Ur.map(function(Bi){var $s=Wo+Bi;$s>=0&&$s-1;wo--){if(rn[wo].drop){rn.splice(wo,1);continue}rn[wo].value=Kn(rn[wo].value,ve);var No=ve.c2p(rn[wo].value);(Ms?_s>No-Di:_sxr||flxr&&($s.periodX=xr),flTr&&Grg)ge/=g,br=Tr(10),ve.dtick="M"+12*vr(ge,br,re);else if(mr>S)ge/=S,ve.dtick="M"+vr(ge,1,Kt);else if(mr>T){if(ve.dtick=vr(ge,T,ve._hasDayOfWeekBreaks?[1,2,7,14]:Me),!dr){var kr=X.getTickFormat(ve),Ur=ve.ticklabelmode==="period";Ur&&(ve._rawTick0=ve.tick0),/%[uVW]/.test(kr)?ve.tick0=t.dateTick0(ve.calendar,2):ve.tick0=t.dateTick0(ve.calendar,1),Ur&&(ve._dowTick0=ve.tick0)}}else mr>h?ve.dtick=vr(ge,h,Kt):mr>b?ve.dtick=vr(ge,b,ue):mr>_?ve.dtick=vr(ge,_,ue):(br=Tr(10),ve.dtick=vr(ge,br,re))}else if(ve.type==="log"){ve.tick0=0;var Or=t.simpleMap(ve.range,ve.r2l);if(ve._isMinor&&(ge*=1.5),ge>.7)ve.dtick=Math.ceil(ge);else if(Math.abs(Or[1]-Or[0])<1){var pe=1.5*Math.abs((Or[1]-Or[0])/ge);ge=Math.abs(Math.pow(10,Or[1])-Math.pow(10,Or[0]))/pe,br=Tr(10),ve.dtick="L"+vr(ge,br,re)}else ve.dtick=ge>.3?"D2":"D1"}else ve.type==="category"||ve.type==="multicategory"?(ve.tick0=0,ve.dtick=Math.ceil(Math.max(ge,1))):Nn(ve)?(ve.tick0=0,br=1,ve.dtick=vr(ge,br,qe)):(ve.tick0=0,br=Tr(10),ve.dtick=vr(ge,br,re));if(ve.dtick===0&&(ve.dtick=1),!d(ve.dtick)&&typeof ve.dtick!="string"){var Ke=ve.dtick;throw ve.dtick=1,"ax.dtick error: "+String(Ke)}};function _r(ve){var ge=ve.dtick;if(ve._tickexponent=0,!d(ge)&&typeof ge!="string"&&(ge=1),(ve.type==="category"||ve.type==="multicategory")&&(ve._tickround=null),ve.type==="date"){var dr=ve.r2l(ve.tick0),br=ve.l2r(dr).replace(/(^-|i)/g,""),Tr=br.length;if(String(ge).charAt(0)==="M")Tr>10||br.slice(5)!=="01-01"?ve._tickround="d":ve._tickround=+ge.slice(1)%12===0?"y":"m";else if(ge>=T&&Tr<=10||ge>=T*15)ve._tickround="d";else if(ge>=b&&Tr<=16||ge>=h)ve._tickround="M";else if(ge>=_&&Tr<=19||ge>=b)ve._tickround="S";else{var mr=ve.l2r(dr+ge).replace(/^-/,"").length;ve._tickround=Math.max(Tr,mr)-20,ve._tickround<0&&(ve._tickround=4)}}else if(d(ge)||ge.charAt(0)==="L"){var kr=ve.range.map(ve.r2d||Number);d(ge)||(ge=Number(ge.slice(1))),ve._tickround=2-Math.floor(Math.log(ge)/Math.LN10+.01);var Ur=Math.max(Math.abs(kr[0]),Math.abs(kr[1])),Or=Math.floor(Math.log(Ur)/Math.LN10+.01),pe=ve.minexponent===void 0?3:ve.minexponent;Math.abs(Or)>pe&&(Ht(ve.exponentformat)&&ve.exponentformat!=="SI extended"&&!Yt(Or)||Ht(ve.exponentformat)&&ve.exponentformat==="SI extended"&&!se(Or)?ve._tickexponent=3*Math.round((Or-1)/3):ve._tickexponent=Or)}else ve._tickround=null}X.tickIncrement=function(ve,ge,dr,br){var Tr=dr?-1:1;if(d(ge))return t.increment(ve,Tr*ge);var mr=ge.charAt(0),kr=Tr*Number(ge.slice(1));if(mr==="M")return t.incrementMonth(ve,kr,br);if(mr==="L")return Math.log(Math.pow(10,ve)+kr)/Math.LN10;if(mr==="D"){var Ur=ge==="D2"?We:Ce,Or=ve+Tr*.01,pe=t.roundUp(t.mod(Or,1),Ur,dr);return Math.floor(Or)+Math.log(u.round(Math.pow(10,pe),1))/Math.LN10}throw"unrecognized dtick "+String(ge)},X.tickFirst=function(ve,ge){var dr=ve.r2l||Number,br=t.simpleMap(ve.range,dr,void 0,void 0,ge),Tr=br[1]=0&&vn<=ve._length?Qr:null};if(mr&&t.isArrayOrTypedArray(ve.ticktext)){var xr=t.simpleMap(ve.range,ve.r2l),Gr=(Math.abs(xr[1]-xr[0])-(ve._lBreaks||0))/1e4;for(pe=0;pe"+Ur;else{var pe=$n(ve),Ke=ve._trueSide||ve.side;(!pe&&Ke==="top"||pe&&Ke==="bottom")&&(kr+="
                ")}ge.text=kr}function Ir(ve,ge,dr,br,Tr){var mr=ve.dtick,kr=ge.x,Ur=ve.tickformat,Or=typeof mr=="string"&&mr.charAt(0);if(Tr==="never"&&(Tr=""),br&&Or!=="L"&&(mr="L3",Or="L"),Ur||Or==="L")ge.text=Ee(Math.pow(10,kr),ve,Tr,br);else if(d(mr)||Or==="D"&&(ve.minorloglabels==="complete"||t.mod(kr+.01,1)<.1)){ve.minorloglabels==="complete"&&!(t.mod(kr+.01,1)<.1)&&(ge.fontSize*=.75);var pe=Math.pow(10,kr).toExponential(0),Ke=pe.split("e"),xr=+Ke[1],Gr=Math.abs(xr),ln=ve.exponentformat;ln==="power"||Ht(ln)&&ln!=="SI extended"&&Yt(xr)||Ht(ln)&&ln==="SI extended"&&se(xr)?(ge.text=Ke[0],Gr>0&&(ge.text+="x10"),ge.text==="1x10"&&(ge.text="10"),xr!==0&&xr!==1&&(ge.text+=""+(xr>0?"":D)+Gr+""),ge.fontSize*=1.25):(ln==="e"||ln==="E")&&Gr>2?ge.text=Ke[0]+ln+(xr>0?"+":D)+Gr:(ge.text=Ee(Math.pow(10,kr),ve,"","fakehover"),mr==="D1"&&ve._id.charAt(0)==="y"&&(ge.dy-=ge.fontSize/6))}else if(Or==="D")ge.text=ve.minorloglabels==="none"?"":String(Math.round(Math.pow(10,t.mod(kr,1)))),ge.fontSize*=.75;else throw"unrecognized dtick "+String(mr);if(ve.dtick==="D1"){var wn=String(ge.text).charAt(0);(wn==="0"||wn==="1")&&(ve._id.charAt(0)==="y"?ge.dx-=ge.fontSize/4:(ge.dy+=ge.fontSize/2,ge.dx+=(ve.range[1]>ve.range[0]?1:-1)*ge.fontSize*(kr<0?.5:.25)))}}function de(ve,ge){var dr=ve._categories[Math.round(ge.x)];dr===void 0&&(dr=""),ge.text=String(dr)}function Dt(ve,ge,dr){var br=Math.round(ge.x),Tr=ve._categories[br]||[],mr=Tr[1]===void 0?"":String(Tr[1]),kr=Tr[0]===void 0?"":String(Tr[0]);dr?ge.text=kr+" - "+mr:(ge.text=mr,ge.text2=kr)}function qt(ve,ge,dr,br,Tr){Tr==="never"?Tr="":ve.showexponent==="all"&&Math.abs(ge.x/ve.dtick)<1e-6&&(Tr="hide"),ge.text=Ee(ge.x,ve,Tr,br)}function _t(ve,ge,dr,br,Tr){if(ve.thetaunit==="radians"&&!dr){var mr=ge.x/180;if(mr===0)ge.text="0";else{var kr=lt(mr);if(kr[1]>=100)ge.text=Ee(t.deg2rad(ge.x),ve,Tr,br);else{var Ur=ge.x<0;kr[1]===1?kr[0]===1?ge.text="π":ge.text=kr[0]+"π":ge.text=["",kr[0],"","⁄","",kr[1],"","π"].join(""),Ur&&(ge.text=D+ge.text)}}}else ge.text=Ee(ge.x,ve,Tr,br)}function lt(ve){function ge(Ur,Or){return Math.abs(Ur-Or)<=1e-6}function dr(Ur,Or){return ge(Or,0)?Ur:dr(Or,Ur%Or)}function br(Ur){for(var Or=1;!ge(Math.round(Ur*Or)/Or,Ur);)Or*=10;return Or}var Tr=br(ve),mr=ve*Tr,kr=Math.abs(dr(mr,Tr));return[Math.round(mr/kr),Math.round(Tr/kr)]}var yt=["f","p","n","μ","m","","k","M","G","T"],St=["q","r","y","z","a",...yt,"P","E","Z","Y","R","Q"],Ht=ve=>["SI","SI extended","B"].includes(ve);function Yt(ve){return ve>14||ve<-15}function se(ve){return ve>32||ve<-30}function ke(ve,ge){return Ht(ge)?!!(ge==="SI extended"&&se(ve)||ge!=="SI extended"&&Yt(ve)):!1}function Ee(ve,ge,dr,br){var Tr=ve<0,mr=ge._tickround,kr=dr||ge.exponentformat||"B",Ur=ge._tickexponent,Or=X.getTickFormat(ge),pe=ge.separatethousands;if(br){var Ke={exponentformat:kr,minexponent:ge.minexponent,dtick:ge.showexponent==="none"?ge.dtick:d(ve)&&Math.abs(ve)||1,range:ge.showexponent==="none"?ge.range.map(ge.r2d):[0,ve||1]};_r(Ke),mr=(Number(Ke._tickround)||0)+4,Ur=Ke._tickexponent,ge.hoverformat&&(Or=ge.hoverformat)}if(Or)return ge._numFormat(Or)(ve).replace(/-/g,D);var xr=Math.pow(10,-mr)/2;if(kr==="none"&&(Ur=0),ve=Math.abs(ve),ve"+wn+"":kr==="B"&&Ur===9?ve+="B":Ht(kr)&&(ve+=kr==="SI extended"?St[Ur/3+10]:yt[Ur/3+5])}return Tr?D+ve:ve}X.getTickFormat=function(ve){var ge;function dr(Or){return typeof Or!="string"?Or:Number(Or.replace("M",""))*S}function br(Or,pe){var Ke=["L","D"];if(typeof Or==typeof pe){if(typeof Or=="number")return Or-pe;var xr=Ke.indexOf(Or.charAt(0)),Gr=Ke.indexOf(pe.charAt(0));return xr===Gr?Number(Or.replace(/(L|D)/g,""))-Number(pe.replace(/(L|D)/g,"")):xr-Gr}else return typeof Or=="number"?1:-1}function Tr(Or,pe,Ke){var xr=Ke||function(wn){return wn},Gr=pe[0],ln=pe[1];return(!Gr&&typeof Gr!="number"||xr(Gr)<=xr(Or))&&(!ln&&typeof ln!="number"||xr(ln)>=xr(Or))}function mr(Or,pe){var Ke=pe[0]===null,xr=pe[1]===null,Gr=br(Or,pe[0])>=0,ln=br(Or,pe[1])<=0;return(Ke||Gr)&&(xr||ln)}var kr,Ur;if(ve.tickformatstops&&ve.tickformatstops.length>0)switch(ve.type){case"date":case"linear":{for(ge=0;ge=0&&Tr.unshift(Tr.splice(Ke,1).shift())}});var Ur={false:{left:0,right:0}};return t.syncOrAsync(Tr.map(function(Or){return function(){if(Or){var pe=X.getFromId(ve,Or);dr||(dr={}),dr.axShifts=Ur,dr.overlayingShiftedAx=kr;var Ke=X.drawOne(ve,pe,dr);return pe._shiftPusher&&Cn(pe,pe._fullDepth||0,Ur,!0),pe._r=pe.range.slice(),pe._rl=t.simpleMap(pe._r,pe.r2l),Ke}}}))},X.drawOne=function(ve,ge,dr){dr=dr||{};var br=dr.axShifts||{},Tr=dr.overlayingShiftedAx||[],mr,kr,Ur;ge.setScale();var Or=ve._fullLayout,pe=ge._id,Ke=pe.charAt(0),xr=X.counterLetter(pe),Gr=Or._plots[ge._mainSubplot],ln=ge.zerolinelayer==="above traces";if(!Gr)return;if(ge._shiftPusher=ge.autoshift||Tr.indexOf(ge._id)!==-1||Tr.indexOf(ge.overlaying)!==-1,ge._shiftPusher&ge.anchor==="free"){var wn=ge.linewidth/2||0;ge.ticks==="inside"&&(wn+=ge.ticklen),Cn(ge,wn,br,!0),Cn(ge,ge.shift||0,br,!1)}(dr.skipTitle!==!0||ge._shift===void 0)&&(ge._shift=Fa(ge,br));var rn=Gr[Ke+"axislayer"],Qr=ge._mainLinePosition,vn=Qr+=ge._shift,Oa=ge._mainMirrorPosition,Qn=ge._vals=X.calcTicks(ge),Qa=[ge.mirror,vn,Oa].join("_");for(mr=0;mr0?Jo.bottom-$s:0,fl))));var xl=0,bu=0;if(ge._shiftPusher&&(xl=Math.max(fl,Jo.height>0?Wo==="l"?$s-Jo.left:Jo.right-$s:0),ge.title.text!==Or._dfltTitle[Ke]&&(bu=(ge._titleStandoff||0)+(ge._titleScoot||0),Wo==="l"&&(bu+=En(ge))),ge._fullDepth=Math.max(xl,bu)),ge.automargin){us={x:0,y:0,r:0,l:0,t:0,b:0};var au=[0,1],fu=typeof ge._shift=="number"?ge._shift:0;if(Ke==="x"){if(Wo==="b"?us[Wo]=ge._depth:(us[Wo]=ge._depth=Math.max(Jo.width>0?$s-Jo.top:0,fl),au.reverse()),Jo.width>0){var Ec=Jo.right-(ge._offset+ge._length);Ec>0&&(us.xr=1,us.r=Ec);var xc=ge._offset-Jo.left;xc>0&&(us.xl=0,us.l=xc)}}else if(Wo==="l"?(ge._depth=Math.max(Jo.height>0?$s-Jo.left:0,fl),us[Wo]=ge._depth-fu):(ge._depth=Math.max(Jo.height>0?Jo.right-$s:0,fl),us[Wo]=ge._depth+fu,au.reverse()),Jo.height>0){var cs=Jo.bottom-(ge._offset+ge._length);cs>0&&(us.yb=0,us.b=cs);var Gl=ge._offset-Jo.top;Gl>0&&(us.yt=1,us.t=Gl)}us[xr]=ge.anchor==="free"?ge.position:ge._anchorAxis.domain[au[0]],ge.title.text!==Or._dfltTitle[Ke]&&(us[Wo]+=En(ge)+(ge.title.standoff||0)),ge.mirror&&ge.anchor!=="free"&&(Ss={x:0,y:0,r:0,l:0,t:0,b:0},Ss[Bi]=ge.linewidth,ge.mirror&&ge.mirror!==!0&&(Ss[Bi]+=fl),ge.mirror===!0||ge.mirror==="ticks"?Ss[xr]=ge._anchorAxis.domain[au[1]]:(ge.mirror==="all"||ge.mirror==="allticks")&&(Ss[xr]=[ge._counterDomainMin,ge._counterDomainMax][au[1]]))}Is&&(Ls=A.getComponentMethod("rangeslider","autoMarginOpts")(ve,ge)),typeof ge.automargin=="string"&&(Ue(us,ge.automargin),Ue(Ss,ge.automargin)),E.autoMargin(ve,Ze(ge),us),E.autoMargin(ve,tr(ge),Ss),E.autoMargin(ve,zr(ge),Ls)}),t.syncOrAsync(io)}};function Ue(ve,ge){if(ve){var dr=Object.keys(G).reduce(function(br,Tr){return ge.indexOf(Tr)!==-1&&G[Tr].forEach(function(mr){br[mr]=1}),br},{});Object.keys(ve).forEach(function(br){dr[br]||(br.length===1?ve[br]=0:delete ve[br])})}}function ir(ve,ge){var dr=[],br,Tr=function(mr,kr){var Ur=mr.xbnd[kr];Ur!==null&&dr.push(t.extendFlat({},mr,{x:Ur}))};if(ge.length){for(br=0;brve.range[1],Ur=ve.ticklabelposition&&ve.ticklabelposition.indexOf("inside")!==-1,Or=!Ur;if(dr){var pe=kr?-1:1;dr=dr*pe}if(br){var Ke=ve.side,xr=Ur&&(Ke==="top"||Ke==="left")||Or&&(Ke==="bottom"||Ke==="right")?1:-1;br=br*xr}return ve._id.charAt(0)==="x"?function(Gr){return e(Tr+ve._offset+ve.l2p(pn(Gr))+dr,mr+br)}:function(Gr){return e(mr+br,Tr+ve._offset+ve.l2p(pn(Gr))+dr)}};function pn(ve){return ve.periodX!==void 0?ve.periodX:ve.x}function dn(ve){var ge=ve.ticklabelposition||"",dr=ve.tickson||"",br=function(wn){return ge.indexOf(wn)!==-1},Tr=br("top"),mr=br("left"),kr=br("right"),Ur=br("bottom"),Or=br("inside"),pe=dr!=="boundaries"&&(Ur||mr||Tr||kr);if(!pe&&!Or)return[0,0];var Ke=ve.side,xr=pe?(ve.tickwidth||0)/2:0,Gr=ot,ln=ve.tickfont?ve.tickfont.size:12;return(Ur||Tr)&&(xr+=ln*st,Gr+=(ve.linewidth||0)/2),(mr||kr)&&(xr+=(ve.linewidth||0)/2,Gr+=ot),Or&&Ke==="top"&&(Gr-=ln*(1-st)),(mr||Tr)&&(xr=-xr),(Ke==="bottom"||Ke==="right")&&(Gr=-Gr),[pe?xr:0,Or?Gr:0]}X.makeTickPath=function(ve,ge,dr,br){br||(br={});var Tr=br.minor;if(Tr&&!ve.minor)return"";var mr=br.len!==void 0?br.len:Tr?ve.minor.ticklen:ve.ticklen,kr=ve._id.charAt(0),Ur=(ve.linewidth||1)/2;return kr==="x"?"M0,"+(ge+Ur*dr)+"v"+mr*dr:"M"+(ge+Ur*dr)+",0h"+mr*dr},X.makeLabelFns=function(ve,ge,dr){var br=ve.ticklabelposition||"",Tr=ve.tickson||"",mr=function(Ci){return br.indexOf(Ci)!==-1},kr=mr("top"),Ur=mr("left"),Or=mr("right"),pe=mr("bottom"),Ke=Tr!=="boundaries"&&(pe||Ur||kr||Or),xr=mr("inside"),Gr=br==="inside"&&ve.ticks==="inside"||!xr&&ve.ticks==="outside"&&Tr!=="boundaries",ln=0,wn=0,rn=Gr?ve.ticklen:0;if(xr?rn*=-1:Ke&&(rn=0),Gr&&(ln+=rn,dr)){var Qr=t.deg2rad(dr);ln=rn*Math.cos(Qr)+1,wn=rn*Math.sin(Qr)}ve.showticklabels&&(Gr||ve.showline)&&(ln+=.2*ve.tickfont.size),ln+=(ve.linewidth||1)/2*(xr?-1:1);var vn={labelStandoff:ln,labelShift:wn},Oa,Qn,Qa,Ja,wi=0,ci=ve.side,Ti=ve._id.charAt(0),Ra=ve.tickangle,Qi;if(Ti==="x")Qi=!xr&&ci==="bottom"||xr&&ci==="top",Ja=Qi?1:-1,xr&&(Ja*=-1),Oa=wn*Ja,Qn=ge+ln*Ja,Qa=Qi?1:-.2,Math.abs(Ra)===90&&(xr?Qa+=ct:Ra===-90&&ci==="bottom"?Qa=st:Ra===90&&ci==="top"?Qa=ct:Qa=.5,wi=ct/2*(Ra/90)),vn.xFn=function(Ci){return Ci.dx+Oa+wi*Ci.fontSize},vn.yFn=function(Ci){return Ci.dy+Qn+Ci.fontSize*Qa},vn.anchorFn=function(Ci,zo){if(Ke){if(Ur)return"end";if(Or)return"start"}return!d(zo)||zo===0||zo===180?"middle":zo*Ja<0!==xr?"end":"start"},vn.heightFn=function(Ci,zo,qi){return zo<-60||zo>60?-.5*qi:ve.side==="top"!==xr?-qi:0};else if(Ti==="y"){if(Qi=!xr&&ci==="left"||xr&&ci==="right",Ja=Qi?1:-1,xr&&(Ja*=-1),Oa=ln,Qn=wn*Ja,Qa=0,!xr&&Math.abs(Ra)===90&&(Ra===-90&&ci==="left"||Ra===90&&ci==="right"?Qa=st:Qa=.5),xr){var Hi=d(Ra)?+Ra:0;if(Hi!==0){var Ho=t.deg2rad(Hi);wi=Math.abs(Math.sin(Ho))*st*Ja,Qa=0}}vn.xFn=function(Ci){return Ci.dx+ge-(Oa+Ci.fontSize*Qa)*Ja+wi*Ci.fontSize},vn.yFn=function(Ci){return Ci.dy+Qn+Ci.fontSize*ct},vn.anchorFn=function(Ci,zo){return d(zo)&&Math.abs(zo)===90?"middle":Qi?"end":"start"},vn.heightFn=function(Ci,zo,qi){return ve.side==="right"&&(zo*=-1),zo<-30?-qi:zo<30?-.5*qi:0}}return vn};function bn(ve){return[ve.text,ve.x,ve.axInfo,ve.font,ve.fontSize,ve.fontColor].join("_")}X.drawTicks=function(ve,ge,dr){dr=dr||{};var br=ge._id+"tick",Tr=[].concat(ge.minor&&ge.minor.ticks?dr.vals.filter(function(kr){return kr.minor&&!kr.noTick}):[]).concat(ge.ticks?dr.vals.filter(function(kr){return!kr.minor&&!kr.noTick}):[]),mr=dr.layer.selectAll("path."+br).data(Tr,bn);mr.exit().remove(),mr.enter().append("path").classed(br,1).classed("ticks",1).classed("crisp",dr.crisp!==!1).each(function(kr){return n.stroke(u.select(this),kr.minor?ge.minor.tickcolor:ge.tickcolor)}).style("stroke-width",function(kr){return o.crispRound(ve,kr.minor?ge.minor.tickwidth:ge.tickwidth,1)+"px"}).attr("d",dr.path).style("display",null),ia(ge,[j]),mr.attr("transform",dr.transFn)},X.drawGrid=function(ve,ge,dr){if(dr=dr||{},ge.tickmode!=="sync"){var br=ge._id+"grid",Tr=ge.minor&&ge.minor.showgrid,mr=Tr?dr.vals.filter(function(vn){return vn.minor}):[],kr=ge.showgrid?dr.vals.filter(function(vn){return!vn.minor}):[],Ur=dr.counterAxis;if(Ur&&X.shouldShowZeroLine(ve,ge,Ur))for(var Or=ge.tickmode==="array",pe=0;pe=0;wn--){var rn=wn?Gr:ln;if(rn){var Qr=rn.selectAll("path."+br).data(wn?kr:mr,bn);Qr.exit().remove(),Qr.enter().append("path").classed(br,1).classed("crisp",dr.crisp!==!1),Qr.attr("transform",dr.transFn).attr("d",dr.path).each(function(vn){return n.stroke(u.select(this),vn.minor?ge.minor.gridcolor:ge.gridcolor||"#ddd")}).style("stroke-dasharray",function(vn){return o.dashStyle(vn.minor?ge.minor.griddash:ge.griddash,vn.minor?ge.minor.gridwidth:ge.gridwidth)}).style("stroke-width",function(vn){return(vn.minor?xr:ge._gw)+"px"}).style("display",null),typeof dr.path=="function"&&Qr.attr("d",dr.path)}}ia(ge,[I,F])}},X.drawZeroLine=function(ve,ge,dr){dr=dr||dr;var br=ge._id+"zl",Tr=X.shouldShowZeroLine(ve,ge,dr.counterAxis),mr=dr.layer.selectAll("path."+br).data(Tr?[{x:0,id:ge._id}]:[]);mr.exit().remove(),mr.enter().append("path").classed(br,1).classed("zl",1).classed("crisp",dr.crisp!==!1).each(function(){dr.layer.selectAll("path").sort(function(kr,Ur){return J(kr.id,Ur.id)})}),mr.attr("transform",dr.transFn).attr("d",dr.path).call(n.stroke,ge.zerolinecolor||n.defaultLine).style("stroke-width",o.crispRound(ve,ge.zerolinewidth,ge._gw||1)+"px").style("display",null),ia(ge,[R])},X.drawLabels=function(ve,ge,dr){dr=dr||{};var br=ve._fullLayout,Tr=ge._id,mr=ge.zerolinelayer==="above traces",kr=dr.cls||Tr+"tick",Ur=dr.vals.filter(function(Gi){return Gi.text}),Or=dr.labelFns,pe=dr.secondary?0:ge.tickangle,Ke=(ge._prevTickAngles||{})[kr],xr=dr.layer.selectAll("g."+kr).data(ge.showticklabels?Ur:[],bn),Gr=[];xr.enter().append("g").classed(kr,1).append("text").attr("text-anchor","middle").each(function(Gi){var uo=u.select(this),yi=ve._promises.length;uo.call(r.positionText,Or.xFn(Gi),Or.yFn(Gi)).call(o.font,{family:Gi.font,size:Gi.fontSize,color:Gi.fontColor,weight:Gi.fontWeight,style:Gi.fontStyle,variant:Gi.fontVariant,textcase:Gi.fontTextcase,lineposition:Gi.fontLineposition,shadow:Gi.fontShadow}).text(Gi.text).call(r.convertToTspans,ve),ve._promises[yi]?Gr.push(ve._promises.pop().then(function(){ln(uo,pe)})):ln(uo,pe)}),ia(ge,[N]),xr.exit().remove(),dr.repositionOnUpdate&&xr.each(function(Gi){u.select(this).select("text").call(r.positionText,Or.xFn(Gi),Or.yFn(Gi))});function ln(Gi,uo){Gi.each(function(yi){var ao=u.select(this),ts=ao.select(".text-math-group"),vs=Or.anchorFn(yi,uo),As=dr.transFn.call(ao.node(),yi)+(d(uo)&&+uo!=0?" rotate("+uo+","+Or.xFn(yi)+","+(Or.yFn(yi)-yi.fontSize/2)+")":""),_o=r.lineCount(ao),Da=et*yi.fontSize,li=Or.heightFn(yi,d(uo)?+uo:0,(_o-1)*Da);if(li&&(As+=e(0,li)),ts.empty()){var wo=ao.select("text");wo.attr({transform:As,"text-anchor":vs}),wo.style("display",null),ge._adjustTickLabelsOverflow&&ge._adjustTickLabelsOverflow()}else{var Ms=o.bBox(ts.node()).width,Di=Ms*{end:-.5,start:.5}[vs];ts.attr("transform",As+e(Di,0))}})}ge._adjustTickLabelsOverflow=function(){var Gi=ge.ticklabeloverflow;if(!(!Gi||Gi==="allow")){var uo=Gi.indexOf("hide")!==-1,yi=ge._id.charAt(0)==="x",ao=0,ts=yi?ve._fullLayout.width:ve._fullLayout.height;if(Gi.indexOf("domain")!==-1){var vs=t.simpleMap(ge.range,ge.r2l);ao=ge.l2p(vs[0])+ge._offset,ts=ge.l2p(vs[1])+ge._offset}var As=Math.min(ao,ts),_o=Math.max(ao,ts),Da=ge.side,li=1/0,wo=-1/0;xr.each(function(No){var is=u.select(this),al=is.select(".text-math-group");if(al.empty()){var ii=o.bBox(is.node()),io=0;yi?(ii.right>_o||ii.left_o||ii.top+(ge.tickangle?0:No.fontSize/4)ge["_visibleLabelMin_"+vs._id]?is.style("display","none"):_o.K==="tick"&&!As&&is.node().style.display!=="none"&&is.style("display",null)})})})})},ln(xr,Ke+1?Ke:pe);function wn(){return Gr.length&&Promise.all(Gr)}var rn=null;function Qr(){if(ln(xr,pe),Ur.length&&ge.autotickangles&&(ge.type!=="log"||String(ge.dtick).charAt(0)!=="D")){rn=ge.autotickangles[0];var Gi=0,uo=[],yi,ao=1;xr.each(function(us){Gi=Math.max(Gi,us.fontSize);var Ss=ge.l2p(us.x),Ls=Re(this),xl=o.bBox(Ls.node());ao=Math.max(ao,r.lineCount(Ls)),uo.push({top:0,bottom:10,height:10,left:Ss-xl.width/2,right:Ss+xl.width/2+2,width:xl.width+2})});var ts=(ge.tickson==="boundaries"||ge.showdividers)&&!dr.secondary,vs=Ur.length,As=Math.abs((Ur[vs-1].x-Ur[0].x)*ge._m)/(vs-1),_o=ts?As/2:As,Da=ts?ge.ticklen:Gi*1.25*ao,li=Math.sqrt(Math.pow(_o,2)+Math.pow(Da,2)),wo=_o/li,Ms=ge.autotickangles.map(function(us){return us*Math.PI/180}),Di=Ms.find(function(us){return Math.abs(Math.cos(us))<=wo});Di===void 0&&(Di=Ms.reduce(function(us,Ss){return Math.abs(Math.cos(us))qo*qi&&(Ho=qi,Ra[Ti]=Qi[Ti]=Ci[Ti])}var Po=Math.abs(Ho-Hi);Po-Ja>0?(Po-=Ja,Ja*=1+Ja/Po):Ja=0,ge._id.charAt(0)!=="y"&&(Ja=-Ja),Ra[ci]=Qn.p2r(Qn.r2p(Qi[ci])+wi*Ja),Qn.autorange==="min"||Qn.autorange==="max reversed"?(Ra[0]=null,Qn._rangeInitial0=void 0,Qn._rangeInitial1=void 0):(Qn.autorange==="max"||Qn.autorange==="min reversed")&&(Ra[1]=null,Qn._rangeInitial0=void 0,Qn._rangeInitial1=void 0),br._insideTickLabelsUpdaterange[Qn._name+".range"]=Ra}var hs=t.syncOrAsync(vn);return hs&&hs.then&&ve._promises.push(hs),hs};function Zn(ve,ge,dr){var br=ge._id+"divider",Tr=dr.vals,mr=dr.layer.selectAll("path."+br).data(Tr,bn);mr.exit().remove(),mr.enter().insert("path",":first-child").classed(br,1).classed("crisp",1).call(n.stroke,ge.dividercolor).style("stroke-width",o.crispRound(ve,ge.dividerwidth,1)+"px"),mr.attr("transform",dr.transFn).attr("d",dr.path)}X.getPxPosition=function(ve,ge){var dr=ve._fullLayout._size,br=ge._id.charAt(0),Tr=ge.side,mr;if(ge.anchor!=="free"?mr=ge._anchorAxis:br==="x"?mr={_offset:dr.t+(1-(ge.position||0))*dr.h,_length:0}:br==="y"&&(mr={_offset:dr.l+(ge.position||0)*dr.w+ge._shift,_length:0}),Tr==="top"||Tr==="left")return mr._offset;if(Tr==="bottom"||Tr==="right")return mr._offset+mr._length};function En(ve){var ge=ve.title.font.size,dr=(ve.title.text.match(r.BR_TAG_ALL)||[]).length;return ve.title.hasOwnProperty("standoff")?ge*(st+dr*et):dr?ge*(dr+1)*et:ge}function gn(ve,ge){var dr=ve._fullLayout,br=ge._id,Tr=br.charAt(0),mr=ge.title.font.size,kr,Ur=(ge.title.text.match(r.BR_TAG_ALL)||[]).length;if(ge.title.hasOwnProperty("standoff"))ge.side==="bottom"||ge.side==="right"?kr=ge._depth+ge.title.standoff+mr*st:(ge.side==="top"||ge.side==="left")&&(kr=ge._depth+ge.title.standoff+mr*(ct+Ur*et));else{var Or=$n(ge);if(ge.type==="multicategory")kr=ge._depth;else{var pe=1.5*mr;Or&&(pe=.5*mr,ge.ticks==="outside"&&(pe+=ge.ticklen)),kr=10+pe+(ge.linewidth?ge.linewidth-1:0)}Or||(Tr==="x"?kr+=ge.side==="top"?mr*(ge.showticklabels?1:0):mr*(ge.showticklabels?1.5:.5):kr+=ge.side==="right"?mr*(ge.showticklabels?1:.5):mr*(ge.showticklabels?.5:0))}var Ke=X.getPxPosition(ve,ge),xr,Gr,ln;Tr==="x"?(Gr=ge._offset+ge._length/2,ln=ge.side==="top"?Ke-kr:Ke+kr):(ln=ge._offset+ge._length/2,Gr=ge.side==="right"?Ke+kr:Ke-kr,xr={rotate:"-90",offset:0});var wn;if(ge.type!=="multicategory"){var rn=ge._selections[ge._id+"tick"];if(wn={selection:rn,side:ge.side},rn&&rn.node()&&rn.node().parentNode){var Qr=o.getTranslate(rn.node().parentNode);wn.offsetLeft=Qr.x,wn.offsetTop=Qr.y}ge.title.hasOwnProperty("standoff")&&(wn.pad=0)}return ge._titleStandoff=kr,i.draw(ve,br+"title",{propContainer:ge,propName:ge._name+".title.text",placeholder:dr._dfltTitle[Tr],avoid:wn,transform:xr,attributes:{x:Gr,y:ln,"text-anchor":"middle"}})}X.shouldShowZeroLine=function(ve,ge,dr){var br=t.simpleMap(ge.range,ge.r2l);return br[0]*br[1]<=0&&ge.zeroline&&(ge.type==="linear"||ge.type==="-")&&!(ge.rangebreaks&&ge.maskBreaks(0)===B)&&(da(ge,0)||!ra(ve,ge,dr,br)||Se(ve,ge))},X.clipEnds=function(ve,ge){return ge.filter(function(dr){return da(ve,dr.x)})};function da(ve,ge){var dr=ve.l2p(ge);return dr>1&&dr1)for(Tr=1;Tr=Tr.min&&ve=z:/%L/.test(ge)?ve>=P:/%[SX]/.test(ge)?ve>=_:/%M/.test(ge)?ve>=b:/%[HI]/.test(ge)?ve>=h:/%p/.test(ge)?ve>=c:/%[Aadejuwx]/.test(ge)?ve>=T:/%[UVW]/.test(ge)?ve>=M:/%[Bbm]/.test(ge)?ve>=k:/%[q]/.test(ge)?ve>=x:/%[Yy]/.test(ge)?ve>=m:!0}}),hb=Vt((K,V)=>{V.exports=function(u,d,E){var A,t;if(E){var e=d==="reversed"||d==="min reversed"||d==="max reversed";A=E[e?1:0],t=E[e?0:1]}var r=u("autorangeoptions.minallowed",t===null?A:void 0),i=u("autorangeoptions.maxallowed",A===null?t:void 0);r===void 0&&u("autorangeoptions.clipmin"),i===void 0&&u("autorangeoptions.clipmax"),u("autorangeoptions.include")}}),pb=Vt((K,V)=>{var u=hb();V.exports=function(d,E,A,t){var e=E._template||{},r=E.type||e.type||"-";A("minallowed"),A("maxallowed");var i=A("range");if(!i){var n;!t.noInsiderange&&r!=="log"&&(n=A("insiderange"),n&&(n[0]===null||n[1]===null)&&(E.insiderange=!1,n=void 0),n&&(i=A("range",n)))}var o=E.getAutorangeDflt(i,t),a=A("autorange",o),s;i&&(i[0]===null&&i[1]===null||(i[0]===null||i[1]===null)&&(a==="reversed"||a===!0)||i[0]!==null&&(a==="min"||a==="max reversed")||i[1]!==null&&(a==="max"||a==="min reversed"))&&(i=void 0,delete E.range,E.autorange=!0,s=!0),s||(o=E.getAutorangeDflt(i,t),a=A("autorange",o)),a&&(u(A,a,i),(r==="linear"||r==="-")&&A("rangemode")),E.cleanRange()}}),GT=Vt((K,V)=>{var u={left:0,top:0};V.exports=d;function d(A,t,e){t=t||A.currentTarget||A.srcElement,Array.isArray(e)||(e=[0,0]);var r=A.clientX||0,i=A.clientY||0,n=E(t);return e[0]=r-n.left,e[1]=i-n.top,e}function E(A){return A===window||A===document||A===document.body?u:A.getBoundingClientRect()}}),Hy=Vt((K,V)=>{var u=ab();function d(){var E=!1;try{var A=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("test",null,A),window.removeEventListener("test",null,A)}catch{E=!1}return E}V.exports=u&&d()}),ZT=Vt((K,V)=>{V.exports=function(u,d,E,A,t){var e=(u-E)/(A-E),r=e+d/(A-E),i=(e+r)/2;return t==="left"||t==="bottom"?e:t==="center"||t==="middle"?i:t==="right"||t==="top"?r:e<2/3-i?e:r>4/3-i?r:i}}),KT=Vt((K,V)=>{var u=Xr(),d=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];V.exports=function(E,A,t,e){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=u.constrain(Math.floor(E*3),0,2),e==="bottom"?A=0:e==="middle"?A=1:e==="top"?A=2:A=u.constrain(Math.floor(A*3),0,2),d[A][E]}}),YT=Vt((K,V)=>{var u=ym(),d=jy(),E=Ig().getGraphDiv,A=Cg(),t=V.exports={};t.wrapped=function(e,r,i){e=E(e),e._fullLayout&&d.clear(e._fullLayout._uid+A.HOVERID),t.raw(e,r,i)},t.raw=function(e,r){var i=e._fullLayout,n=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&u.triggerHandler(e,"plotly_beforehover",r)===!1)&&(i._hoverlayer.selectAll("g").remove(),i._hoverlayer.selectAll("line").remove(),i._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,r.target&&n&&e.emit("plotly_unhover",{event:r,points:n}))}}),oh=Vt((K,V)=>{var u=GT(),d=ib(),E=Hy(),A=Xr().removeElement,t=Mf(),e=V.exports={};e.align=ZT(),e.getCursor=KT();var r=YT();e.unhover=r.wrapped,e.unhoverRaw=r.raw,e.init=function(o){var a=o.gd,s=1,f=a._context.doubleClickDelay,v=o.element,g,m,w,l,x,y,S,k;a._mouseDownTime||(a._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=c,E?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=c,v.addEventListener("touchstart",c,{passive:!1})):v.ontouchstart=c;function M(_,P,z){return Math.abs(_)"u"&&typeof _.clientY>"u"&&(_.clientX=g,_.clientY=m),w=new Date().getTime(),w-a._mouseDownTimef&&(s=Math.max(s-1,1)),a._dragged)o.doneFn&&o.doneFn();else{var P;y.target===S?P=y:(P={target:S,srcElement:S,toElement:S},Object.keys(y).concat(Object.keys(y.__proto__)).forEach(z=>{var D=y[z];!P[z]&&typeof D!="function"&&(P[z]=D)})),o.clickFn&&o.clickFn(s,P),k||S.dispatchEvent(new MouseEvent("click",_))}a._dragging=!1,a._dragged=!1}};function i(){var o=document.createElement("div");o.className="dragcover";var a=o.style;return a.position="fixed",a.left=0,a.right=0,a.top=0,a.bottom=0,a.zIndex=999999999,a.background="none",document.body.appendChild(o),o}e.coverSlip=i;function n(o){return u(o.changedTouches?o.changedTouches[0]:o,document.body)}}),$h=Vt((K,V)=>{V.exports=function(u,d){(u.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&u.classed(E,!1)}),d&&u.classed("cursor-"+d,!0)}}),XT=Vt((K,V)=>{var u=$h(),d="data-savedcursor",E="!!";V.exports=function(A,t){var e=A.attr(d);if(t){if(!e){for(var r=(A.attr("class")||"").split(" "),i=0;i{var u=yu(),d=af();V.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:u({editType:"legend"}),grouptitlefont:u({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:u({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),qy=Vt(K=>{K.isGrouped=function(V){return(V.traceorder||"").indexOf("grouped")!==-1},K.isVertical=function(V){return V.orientation!=="h"},K.isReversed=function(V){return(V.traceorder||"").indexOf("reversed")!==-1}}),mb=Vt((K,V)=>{var u=ji(),d=Xr(),E=cl(),A=kl(),t=db(),e=vm(),r=qy();function i(n,o,a,s){var f=o[n]||{},v=E.newContainer(a,n);function g(Z,ot){return d.coerce(f,v,t,Z,ot)}var m=d.coerceFont(g,"font",a.font);g("bgcolor",a.paper_bgcolor),g("bordercolor");var w=g("visible");if(!w)return;var l,x=function(Z,ot){var X=l._input,Q=l;return d.coerce(X,Q,A,Z,ot)},y=a.font||{},S=d.coerceFont(g,"grouptitlefont",y,{overrideDflt:{size:Math.round(y.size*1.1)}}),k=0,M=!1,T="normal",c=(a.shapes||[]).filter(function(Z){return Z.showlegend});function h(Z){return u.traceIs(Z,"pie-like")&&Z._length!=null&&(Array.isArray(Z.legend)||Array.isArray(Z.showlegend))}s.filter(h).forEach(function(Z){Z.visible&&k++;for(var ot=0;otZ.legend.length)for(var Q=Z.legend.length;Q(n==="legend"?1:0));if(z===!1&&(a[n]=void 0),!(z===!1&&!f.uirevision)&&(g("uirevision",a.uirevision),z!==!1)){g("borderwidth");var D=g("orientation"),B=g("yref"),R=g("xref"),I=D==="h",F=B==="paper",j=R==="paper",N,G,rt,ct="left";I?(N=0,u.getComponentMethod("rangeslider","isVisible")(o.xaxis)?F?(G=1.1,rt="bottom"):(G=1,rt="top"):F?(G=-.1,rt="top"):(G=0,rt="bottom")):(G=1,rt="auto",j?N=1.02:(N=1,ct="right")),d.coerce(f,v,{x:{valType:"number",editType:"legend",min:j?-2:0,max:j?3:1,dflt:N}},"x"),d.coerce(f,v,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:G}},"y"),g("traceorder",T),r.isGrouped(a[n])&&g("tracegroupgap"),g("entrywidth"),g("entrywidthmode"),g("indentation"),g("itemsizing"),g("itemwidth"),g("itemclick"),g("itemdoubleclick"),g("groupclick"),g("xanchor",ct),g("yanchor",rt),g("maxheight"),g("valign"),d.noneOrAll(f,v,["x","y"]);var st=g("title.text");if(st){g("title.side",I?"left":"top");var et=d.extendFlat({},m,{size:d.bigFont(m.size)});d.coerceFont(g,"title.font",et)}}}V.exports=function(n,o,a){var s,f=a.slice(),v=o.shapes;if(v)for(s=0;s{var u=ji(),d=Xr(),E=d.pushUnique,A=!0;V.exports=function(t,e,r){var i=e._fullLayout;if(e._dragged||e._editing)return;var n=i.legend.itemclick,o=i.legend.itemdoubleclick,a=i.legend.groupclick;r===1&&n==="toggle"&&o==="toggleothers"&&A&&e.data&&e._context.showTips&&d.notifier(d._(e,"Double-click on legend to isolate one trace"),"long"),A=!1;var s;if(r===1?s=n:r===2&&(s=o),!s)return;var f=a==="togglegroup",v=i.hiddenlabels?i.hiddenlabels.slice():[],g=t.data()[0][0];if(g.groupTitle&&g.noClick)return;var m=e._fullData,w=(i.shapes||[]).filter(function(Zt){return Zt.showlegend}),l=m.concat(w),x=g.trace;x._isShape&&(x=x._fullInput);var y=x.legendgroup,S,k,M,T,c,h,b={},_=[],P=[],z=[];function D(Zt,mt){var bt=_.indexOf(Zt),vt=b.visible;return vt||(vt=b.visible=[]),_.indexOf(Zt)===-1&&(_.push(Zt),bt=_.length-1),vt[bt]=mt,bt}var B=(i.shapes||[]).map(function(Zt){return Zt._input}),R=!1;function I(Zt,mt){B[Zt].visible=mt,R=!0}function F(Zt,mt){if(!(g.groupTitle&&!f)){var bt=Zt._fullInput||Zt,vt=bt._isShape,Ut=bt.index;Ut===void 0&&(Ut=bt._index);var re=bt.visible===!1?!1:mt;vt?I(Ut,re):D(Ut,re)}}var j=x.legend,N=x._fullInput,G=N&&N._isShape;if(!G&&u.traceIs(x,"pie-like")){var rt=g.label,ct=v.indexOf(rt);if(s==="toggle")ct===-1?v.push(rt):v.splice(ct,1);else if(s==="toggleothers"){var st=ct!==-1,et=[];for(S=0;S{V.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),JT=Vt((K,V)=>{var u=ji(),d=qy();V.exports=function(E,A,t){var e=A._inHover,r=d.isGrouped(A),i=d.isReversed(A),n={},o=[],a=!1,s={},f=0,v=0,g,m;function w(N,G,rt){if(A.visible!==!1&&!(t&&N!==A._id))if(G===""||!d.isGrouped(A)){var ct="~~i"+f;o.push(ct),n[ct]=[rt],f++}else o.indexOf(G)===-1?(o.push(G),a=!0,n[G]=[rt]):n[G].push(rt)}for(g=0;gz&&(P=z)}b[g][0]._groupMinRank=P,b[g][0]._preGroupSort=g}var D=function(N,G){return N[0]._groupMinRank-G[0]._groupMinRank||N[0]._preGroupSort-G[0]._preGroupSort},B=function(N,G){return N.trace.legendrank-G.trace.legendrank||N._preSort-G._preSort};for(b.forEach(function(N,G){N[0]._preGroupSort=G}),b.sort(D),g=0;g{var V=Xr();function u(d){return d.indexOf("e")!==-1?d.replace(/[.]?0+e/,"e"):d.indexOf(".")!==-1?d.replace(/[.]?0+$/,""):d}K.formatPiePercent=function(d,E){var A=u((d*100).toPrecision(3));return V.numSeparate(A,E)+"%"},K.formatPieValue=function(d,E){var A=u(d.toPrecision(10));return V.numSeparate(A,E)},K.getFirstFilled=function(d,E){if(V.isArrayOrTypedArray(d))for(var A=0;A{var u=Eo(),d=Pi();V.exports=function(E,A,t,e){var r=t.marker.pattern;r&&r.shape?u.pointStyle(E,t,e,A):d.fill(E,A.color)}}),Tm=Vt((K,V)=>{var u=Pi(),d=Md().castOption,E=QT();V.exports=function(A,t,e,r){var i=e.marker.line,n=d(i.color,t.pts)||u.defaultLine,o=d(i.width,t.pts)||0;A.call(E,t,e,r).style("stroke-width",o).call(u.stroke,n)}}),vb=Vt((K,V)=>{var u=Ni(),d=ji(),E=Xr(),A=E.strTranslate,t=Eo(),e=Pi(),r=ah().extractOpts,i=nu(),n=Tm(),o=Md().castOption,a=gb(),s=12,f=5,v=2,g=10,m=5;V.exports=function(y,S,k){var M=S._fullLayout;k||(k=M.legend);var T=k.itemsizing==="constant",c=k.itemwidth,h=(c+a.itemGap*2)/2,b=A(h,0),_=function(et,Z,ot,X){var Q;if(et+1)Q=et;else if(Z&&Z.width>0)Q=Z.width;else return 0;return T?X:Math.min(Q,ot)};y.each(function(et){var Z=u.select(this),ot=E.ensureSingle(Z,"g","layers");ot.style("opacity",et[0].trace.opacity);var X=k.indentation,Q=k.valign,ut=et[0].lineHeight,J=et[0].height;if(Q==="middle"&&X===0||!ut||!J)ot.attr("transform",null);else{var q={top:1,bottom:-1}[Q],it=q*(.5*(ut-J+3))||0,nt=k.indentation;ot.attr("transform",A(nt,it))}var dt=ot.selectAll("g.legendfill").data([et]);dt.enter().append("g").classed("legendfill",!0);var Tt=ot.selectAll("g.legendlines").data([et]);Tt.enter().append("g").classed("legendlines",!0);var wt=ot.selectAll("g.legendsymbols").data([et]);wt.enter().append("g").classed("legendsymbols",!0),wt.selectAll("g.legendpoints").data([et]).enter().append("g").classed("legendpoints",!0)}).each(st).each(D).each(R).each(B).each(F).each(rt).each(G).each(P).each(z).each(j).each(N);function P(et){var Z=l(et),ot=Z.showFill,X=Z.showLine,Q=Z.showGradientLine,ut=Z.showGradientFill,J=Z.anyFill,q=Z.anyLine,it=et[0],nt=it.trace,dt,Tt,wt=r(nt),Ct=wt.colorscale,It=wt.reversescale,Nt=function(vt){if(vt.size())if(ot)t.fillGroupStyle(vt,S,!0);else{var Ut="legendfill-"+nt.uid;t.gradient(vt,S,Ut,w(It),Ct,"fill")}},te=function(vt){if(vt.size()){var Ut="legendline-"+nt.uid;t.lineGroupStyle(vt),t.gradient(vt,S,Ut,w(It),Ct,"stroke")}},Jt=i.hasMarkers(nt)||!J?"M5,0":q?"M5,-2":"M5,-3",ee=u.select(this),Zt=ee.select(".legendfill").selectAll("path").data(ot||ut?[et]:[]);if(Zt.enter().append("path").classed("js-fill",!0),Zt.exit().remove(),Zt.attr("d",Jt+"h"+c+"v6h-"+c+"z").call(Nt),X||Q){var mt=_(void 0,nt.line,g,f);Tt=E.minExtend(nt,{line:{width:mt}}),dt=[E.minExtend(it,{trace:Tt})]}var bt=ee.select(".legendlines").selectAll("path").data(X||Q?[dt]:[]);bt.enter().append("path").classed("js-line",!0),bt.exit().remove(),bt.attr("d",Jt+(Q?"l"+c+",0.0001":"h"+c)).call(X?t.lineGroupStyle:te)}function z(et){var Z=l(et),ot=Z.anyFill,X=Z.anyLine,Q=Z.showLine,ut=Z.showMarker,J=et[0],q=J.trace,it=!ut&&!X&&!ot&&i.hasText(q),nt,dt;function Tt(Zt,mt,bt,vt){var Ut=E.nestedProperty(q,Zt).get(),re=E.isArrayOrTypedArray(Ut)&&mt?mt(Ut):Ut;if(T&&re&&vt!==void 0&&(re=vt),bt){if(rebt[1])return bt[1]}return re}function wt(Zt){return J._distinct&&J.index&&Zt[J.index]?Zt[J.index]:Zt[0]}if(ut||it||Q){var Ct={},It={};if(ut){Ct.mc=Tt("marker.color",wt),Ct.mx=Tt("marker.symbol",wt),Ct.mo=Tt("marker.opacity",E.mean,[.2,1]),Ct.mlc=Tt("marker.line.color",wt),Ct.mlw=Tt("marker.line.width",E.mean,[0,5],v),It.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var Nt=Tt("marker.size",E.mean,[2,16],s);Ct.ms=Nt,It.marker.size=Nt}Q&&(It.line={width:Tt("line.width",wt,[0,10],f)}),it&&(Ct.tx="Aa",Ct.tp=Tt("textposition",wt),Ct.ts=10,Ct.tc=Tt("textfont.color",wt),Ct.tf=Tt("textfont.family",wt),Ct.tw=Tt("textfont.weight",wt),Ct.ty=Tt("textfont.style",wt),Ct.tv=Tt("textfont.variant",wt),Ct.tC=Tt("textfont.textcase",wt),Ct.tE=Tt("textfont.lineposition",wt),Ct.tS=Tt("textfont.shadow",wt)),nt=[E.minExtend(J,Ct)],dt=E.minExtend(q,It),dt.selectedpoints=null,dt.texttemplate=null}var te=u.select(this).select("g.legendpoints"),Jt=te.selectAll("path.scatterpts").data(ut?nt:[]);Jt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),Jt.exit().remove(),Jt.call(t.pointStyle,dt,S),ut&&(nt[0].mrc=3);var ee=te.selectAll("g.pointtext").data(it?nt:[]);ee.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),ee.exit().remove(),ee.selectAll("text").call(t.textPointStyle,dt,S)}function D(et){var Z=et[0].trace,ot=Z.type==="waterfall";if(et[0]._distinct&&ot){var X=et[0].trace[et[0].dir].marker;return et[0].mc=X.color,et[0].mlw=X.line.width,et[0].mlc=X.line.color,I(et,this,"waterfall")}var Q=[];Z.visible&&ot&&(Q=et[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var ut=u.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(Q);ut.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),ut.exit().remove(),ut.each(function(J){var q=u.select(this),it=Z[J[0]].marker,nt=_(void 0,it.line,m,v);q.attr("d",J[1]).style("stroke-width",nt+"px").call(e.fill,it.color),nt&&q.call(e.stroke,it.line.color)})}function B(et){I(et,this)}function R(et){I(et,this,"funnel")}function I(et,Z,ot){var X=et[0].trace,Q=X.marker||{},ut=Q.line||{},J=Q.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",q=ot?X.visible&&X.type===ot:d.traceIs(X,"bar"),it=u.select(Z).select("g.legendpoints").selectAll("path.legend"+ot).data(q?[et]:[]);it.enter().append("path").classed("legend"+ot,!0).attr("d",J).attr("transform",b),it.exit().remove(),it.each(function(nt){var dt=u.select(this),Tt=nt[0],wt=_(Tt.mlw,Q.line,m,v);dt.style("stroke-width",wt+"px");var Ct=Tt.mcc;if(!k._inHover&&"mc"in Tt){var It=r(Q),Nt=It.mid;Nt===void 0&&(Nt=(It.max+It.min)/2),Ct=t.tryColorscale(Q,"")(Nt)}var te=Ct||Tt.mc||Q.color,Jt=Q.pattern,ee=t.getPatternAttr,Zt=Jt&&(ee(Jt.shape,0,"")||ee(Jt.path,0,""));if(Zt){var mt=ee(Jt.bgcolor,0,null),bt=ee(Jt.fgcolor,0,null),vt=Jt.fgopacity,Ut=x(Jt.size,8,10),re=x(Jt.solidity,.5,1),Kt="legend-"+X.uid;dt.call(t.pattern,"legend",S,Kt,Zt,Ut,re,Ct,Jt.fillmode,mt,bt,vt)}else dt.call(e.fill,te);wt&&e.stroke(dt,Tt.mlc||ut.color)})}function F(et){var Z=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendbox").data(Z.visible&&d.traceIs(Z,"box-violin")?[et]:[]);ot.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),ot.exit().remove(),ot.each(function(){var X=u.select(this);if((Z.boxpoints==="all"||Z.points==="all")&&e.opacity(Z.fillcolor)===0&&e.opacity((Z.line||{}).color)===0){var Q=E.minExtend(Z,{marker:{size:T?s:E.constrain(Z.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ot.call(t.pointStyle,Q,S)}else{var ut=_(void 0,Z.line,m,v);X.style("stroke-width",ut+"px").call(e.fill,Z.fillcolor),ut&&e.stroke(X,Z.line.color)}})}function j(et){var Z=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(Z.visible&&Z.type==="candlestick"?[et,et]:[]);ot.enter().append("path").classed("legendcandle",!0).attr("d",function(X,Q){return Q?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",b).style("stroke-miterlimit",1),ot.exit().remove(),ot.each(function(X,Q){var ut=u.select(this),J=Z[Q?"increasing":"decreasing"],q=_(void 0,J.line,m,v);ut.style("stroke-width",q+"px").call(e.fill,J.fillcolor),q&&e.stroke(ut,J.line.color)})}function N(et){var Z=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(Z.visible&&Z.type==="ohlc"?[et,et]:[]);ot.enter().append("path").classed("legendohlc",!0).attr("d",function(X,Q){return Q?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",b).style("stroke-miterlimit",1),ot.exit().remove(),ot.each(function(X,Q){var ut=u.select(this),J=Z[Q?"increasing":"decreasing"],q=_(void 0,J.line,m,v);ut.style("fill","none").call(t.dashLine,J.line.dash,q),q&&e.stroke(ut,J.line.color)})}function G(et){ct(et,this,"pie")}function rt(et){ct(et,this,"funnelarea")}function ct(et,Z,ot){var X=et[0],Q=X.trace,ut=ot?Q.visible&&Q.type===ot:d.traceIs(Q,ot),J=u.select(Z).select("g.legendpoints").selectAll("path.legend"+ot).data(ut?[et]:[]);if(J.enter().append("path").classed("legend"+ot,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),J.exit().remove(),J.size()){var q=Q.marker||{},it=_(o(q.line.width,X.pts),q.line,m,v),nt="pieLike",dt=E.minExtend(Q,{marker:{line:{width:it}}},nt),Tt=E.minExtend(X,{trace:dt},nt);n(J,Tt,dt,S)}}function st(et){var Z=et[0].trace,ot,X=[];if(Z.visible)switch(Z.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],ot=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],ot=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ot="radial";break;case"cone":X=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ot=!1;break;case"streamtube":X=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ot=!1;break;case"surface":X=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ot=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ot=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ot=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ot=!1;break}var Q=u.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);Q.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),Q.exit().remove(),Q.each(function(ut,J){var q=u.select(this),it=r(Z),nt=it.colorscale,dt=it.reversescale,Tt=function(Nt){if(Nt.size()){var te="legendfill-"+Z.uid;t.gradient(Nt,S,te,w(dt,ot==="radial"),nt,"fill")}},wt;if(nt){if(!ot){var Ct=nt.length;wt=J===0?nt[dt?Ct-1:0][1]:J===1?nt[dt?0:Ct-1][1]:nt[Math.floor((Ct-1)/2)][1]}}else{var It=Z.vertexcolor||Z.facecolor||Z.color;wt=E.isArrayOrTypedArray(It)?It[J]||It[0]:It}q.attr("d",ut[0]),wt?q.call(e.fill,wt):q.call(Tt)})}};function w(y,S){var k=S?"radial":"horizontal";return k+(y?"":"reversed")}function l(y){var S=y[0].trace,k=S.contours,M=i.hasLines(S),T=i.hasMarkers(S),c=S.visible&&S.fill&&S.fill!=="none",h=!1,b=!1;if(k){var _=k.coloring;_==="lines"?h=!0:M=_==="none"||_==="heatmap"||k.showlines,k.type==="constraint"?c=k._operation!=="=":(_==="fill"||_==="heatmap")&&(b=!0)}return{showMarker:T,showLine:M,showFill:c,showGradientLine:h,showGradientFill:b,anyLine:M||h,anyFill:c||b}}function x(y,S,k){return y&&E.isArrayOrTypedArray(y)?S:y>k?k:y}}),yb=Vt((K,V)=>{var u=Ni(),d=Xr(),E=Uu(),A=ji(),t=ym(),e=oh(),r=Eo(),i=Pi(),n=Dl(),o=$T(),a=gb(),s=gf(),f=s.LINE_SPACING,v=s.FROM_TL,g=s.FROM_BR,m=JT(),w=vb(),l=qy(),x=1,y=/^legend[0-9]*$/;V.exports=function(j,N){if(N)k(j,N);else{var G=j._fullLayout,rt=G._legends,ct=G._infolayer.selectAll('[class^="legend"]');ct.each(function(){var ot=u.select(this),X=ot.attr("class"),Q=X.split(" ")[0];Q.match(y)&&rt.indexOf(Q)===-1&&ot.remove()});for(var st=0;st1)}var it=rt.hiddenlabels||[];if(!Z&&(!rt.showlegend||!ot.length))return et.selectAll("."+ct).remove(),rt._topdefs.select("#"+st).remove(),E.autoMargin(j,ct);var nt=d.ensureSingle(et,"g",ct,function(ee){Z||ee.attr("pointer-events","all")}),dt=d.ensureSingleById(rt._topdefs,"clipPath",st,function(ee){ee.append("rect")}),Tt=d.ensureSingle(nt,"rect","bg",function(ee){ee.attr("shape-rendering","crispEdges")});Tt.call(i.stroke,G.bordercolor).call(i.fill,G.bgcolor).style("stroke-width",G.borderwidth+"px");var wt=d.ensureSingle(nt,"g","scrollbox"),Ct=G.title;G._titleWidth=0,G._titleHeight=0;var It;Ct.text?(It=d.ensureSingle(wt,"text",ct+"titletext"),It.attr("text-anchor","start").call(r.font,Ct.font).text(Ct.text),_(It,wt,j,G,x)):wt.selectAll("."+ct+"titletext").remove();var Nt=d.ensureSingle(nt,"rect","scrollbar",function(ee){ee.attr(a.scrollBarEnterAttrs).call(i.fill,a.scrollBarColor)}),te=wt.selectAll("g.groups").data(ot);te.enter().append("g").attr("class","groups"),te.exit().remove();var Jt=te.selectAll("g.traces").data(d.identity);Jt.enter().append("g").attr("class","traces"),Jt.exit().remove(),Jt.style("opacity",function(ee){var Zt=ee[0].trace;return A.traceIs(Zt,"pie-like")?it.indexOf(ee[0].label)!==-1?.5:1:Zt.visible==="legendonly"?.5:1}).each(function(){u.select(this).call(c,j,G)}).call(w,j,G).each(function(){Z||u.select(this).call(b,j,ct)}),d.syncOrAsync([E.previousPromises,function(){return D(j,te,Jt,G)},function(){var ee=rt._size,Zt=G.borderwidth,mt=G.xref==="paper",bt=G.yref==="paper";if(Ct.text&&S(It,G,Zt),!Z){var vt,Ut;mt?vt=ee.l+ee.w*G.x-v[R(G)]*G._width:vt=rt.width*G.x-v[R(G)]*G._width,bt?Ut=ee.t+ee.h*(1-G.y)-v[I(G)]*G._effHeight:Ut=rt.height*(1-G.y)-v[I(G)]*G._effHeight;var re=B(j,ct,vt,Ut);if(re)return;if(rt.margin.autoexpand){var Kt=vt,ue=Ut;vt=mt?d.constrain(vt,0,rt.width-G._width):Kt,Ut=bt?d.constrain(Ut,0,rt.height-G._effHeight):ue,vt!==Kt&&d.log("Constrain "+ct+".x to make legend fit inside graph"),Ut!==ue&&d.log("Constrain "+ct+".y to make legend fit inside graph")}r.setTranslate(nt,vt,Ut)}if(Nt.on(".drag",null),nt.on("wheel",null),Z||G._height<=G._maxHeight||j._context.staticPlot){var Me=G._effHeight;Z&&(Me=G._height),Tt.attr({width:G._width-Zt,height:Me-Zt,x:Zt/2,y:Zt/2}),r.setTranslate(wt,0,0),dt.select("rect").attr({width:G._width-2*Zt,height:Me-2*Zt,x:Zt,y:Zt}),r.setClipUrl(wt,st,j),r.setRect(Nt,0,0,0,0),delete G._scrollY}else{var Ce=Math.max(a.scrollBarMinHeight,G._effHeight*G._effHeight/G._height),We=G._effHeight-Ce-2*a.scrollBarMargin,qe=G._height-G._effHeight,vr=We/qe,_r=Math.min(G._scrollY||0,qe);Tt.attr({width:G._width-2*Zt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-Zt,x:Zt/2,y:Zt/2}),dt.select("rect").attr({width:G._width-2*Zt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-2*Zt,x:Zt,y:Zt+_r}),r.setClipUrl(wt,st,j),lt(_r,Ce,vr),nt.on("wheel",function(){_r=d.constrain(G._scrollY+u.event.deltaY/qe*We,0,qe),lt(_r,Ce,vr),_r!==0&&_r!==qe&&u.event.preventDefault()});var er,Mr,Ir,de=function(se,ke,Ee){var Ue=(Ee-ke)/vr+se;return d.constrain(Ue,0,qe)},Dt=function(se,ke,Ee){var Ue=(ke-Ee)/vr+se;return d.constrain(Ue,0,qe)},qt=u.behavior.drag().on("dragstart",function(){var se=u.event.sourceEvent;se.type==="touchstart"?er=se.changedTouches[0].clientY:er=se.clientY,Ir=_r}).on("drag",function(){var se=u.event.sourceEvent;se.buttons===2||se.ctrlKey||(se.type==="touchmove"?Mr=se.changedTouches[0].clientY:Mr=se.clientY,_r=de(Ir,er,Mr),lt(_r,Ce,vr))});Nt.call(qt);var _t=u.behavior.drag().on("dragstart",function(){var se=u.event.sourceEvent;se.type==="touchstart"&&(er=se.changedTouches[0].clientY,Ir=_r)}).on("drag",function(){var se=u.event.sourceEvent;se.type==="touchmove"&&(Mr=se.changedTouches[0].clientY,_r=Dt(Ir,er,Mr),lt(_r,Ce,vr))});wt.call(_t)}function lt(se,ke,Ee){G._scrollY=j._fullLayout[ct]._scrollY=se,r.setTranslate(wt,0,-se),r.setRect(Nt,G._width,a.scrollBarMargin+se*Ee,a.scrollBarWidth,ke),dt.select("rect").attr("y",Zt+se)}if(j._context.edits.legendPosition){var yt,St,Ht,Yt;nt.classed("cursor-move",!0),e.init({element:nt.node(),gd:j,prepFn:function(se){if(se.target!==Nt.node()){var ke=r.getTranslate(nt);Ht=ke.x,Yt=ke.y}},moveFn:function(se,ke){if(Ht!==void 0&&Yt!==void 0){var Ee=Ht+se,Ue=Yt+ke;r.setTranslate(nt,Ee,Ue),yt=e.align(Ee,G._width,ee.l,ee.l+ee.w,G.xanchor),St=e.align(Ue+G._height,-G._height,ee.t+ee.h,ee.t,G.yanchor)}},doneFn:function(){if(yt!==void 0&&St!==void 0){var se={};se[ct+".x"]=yt,se[ct+".y"]=St,A.call("_guiRelayout",j,se)}},clickFn:function(se,ke){var Ee=et.selectAll("g.traces").filter(function(){var Ue=this.getBoundingClientRect();return ke.clientX>=Ue.left&&ke.clientX<=Ue.right&&ke.clientY>=Ue.top&&ke.clientY<=Ue.bottom});Ee.size()>0&&T(j,nt,Ee,se,ke)}})}}],j)}}function M(j,N,G){var rt=j[0],ct=rt.width,st=N.entrywidthmode,et=rt.trace.legendwidth||N.entrywidth;return st==="fraction"?N._maxWidth*et:G+(et||ct)}function T(j,N,G,rt,ct){var st=G.data()[0][0].trace,et={event:ct,node:G.node(),curveNumber:st.index,expandedIndex:st.index,data:j.data,layout:j.layout,frames:j._transitionData._frames,config:j._context,fullData:j._fullData,fullLayout:j._fullLayout};st._group&&(et.group=st._group),A.traceIs(st,"pie-like")&&(et.label=G.datum()[0].label);var Z=t.triggerHandler(j,"plotly_legendclick",et);if(rt===1){if(Z===!1)return;N._clickTimeout=setTimeout(function(){j._fullLayout&&o(G,j,rt)},j._context.doubleClickDelay)}else if(rt===2){N._clickTimeout&&clearTimeout(N._clickTimeout),j._legendMouseDownTime=0;var ot=t.triggerHandler(j,"plotly_legenddoubleclick",et);ot!==!1&&Z!==!1&&o(G,j,rt)}}function c(j,N,G){var rt=F(G),ct=j.data()[0][0],st=ct.trace,et=A.traceIs(st,"pie-like"),Z=!G._inHover&&N._context.edits.legendText&&!et,ot=G._maxNameLength,X,Q;ct.groupTitle?(X=ct.groupTitle.text,Q=ct.groupTitle.font):(Q=G.font,G.entries?X=ct.text:(X=et?ct.label:st.name,st._meta&&(X=d.templateString(X,st._meta))));var ut=d.ensureSingle(j,"text",rt+"text");ut.attr("text-anchor","start").call(r.font,Q).text(Z?h(X,ot):X);var J=G.indentation+G.itemwidth+a.itemGap*2;n.positionText(ut,J,0),Z?ut.call(n.makeEditable,{gd:N,text:X}).call(_,j,N,G).on("edit",function(q){this.text(h(q,ot)).call(_,j,N,G);var it=ct.trace._fullInput||{},nt={};return nt.name=q,it._isShape?A.call("_guiRelayout",N,"shapes["+st.index+"].name",nt.name):A.call("_guiRestyle",N,nt,st.index)}):_(ut,j,N,G)}function h(j,N){var G=Math.max(4,N);if(j&&j.trim().length>=G/2)return j;j=j||"";for(var rt=G-j.length;rt>0;rt--)j+=" ";return j}function b(j,N,G){var rt=N._context.doubleClickDelay,ct,st=1,et=d.ensureSingle(j,"rect",G+"toggle",function(Z){N._context.staticPlot||Z.style("cursor","pointer").attr("pointer-events","all"),Z.call(i.fill,"rgba(0,0,0,0)")});N._context.staticPlot||(et.on("mousedown",function(){ct=new Date().getTime(),ct-N._legendMouseDownTimert&&(st=Math.max(st-1,1)),T(N,Z,j,st,u.event)}}))}function _(j,N,G,rt,ct){rt._inHover&&j.attr("data-notex",!0),n.convertToTspans(j,G,function(){P(N,G,rt,ct)})}function P(j,N,G,rt){var ct=j.data()[0][0],st=ct&&ct.trace.showlegend;if(Array.isArray(st)&&(st=st[ct.i]!==!1),!G._inHover&&ct&&!st){j.remove();return}var et=j.select("g[class*=math-group]"),Z=et.node(),ot=F(G);G||(G=N._fullLayout[ot]);var X=G.borderwidth,Q;rt===x?Q=G.title.font:ct.groupTitle?Q=ct.groupTitle.font:Q=G.font;var ut=Q.size*f,J,q;if(Z){var it=r.bBox(Z);J=it.height,q=it.width,rt===x?r.setTranslate(et,X,X+J*.75):r.setTranslate(et,0,J*.25)}else{var nt="."+ot+(rt===x?"title":"")+"text",dt=j.select(nt),Tt=n.lineCount(dt),wt=dt.node();if(J=ut*Tt,q=wt?r.bBox(wt).width:0,rt===x)G.title.side==="left"&&(q+=a.itemGap*2),n.positionText(dt,X+a.titlePad,X+ut);else{var Ct=a.itemGap*2+G.indentation+G.itemwidth;ct.groupTitle&&(Ct=a.itemGap,q-=G.indentation+G.itemwidth),n.positionText(dt,Ct,-ut*((Tt-1)/2-.3))}}rt===x?(G._titleWidth=q,G._titleHeight=J):(ct.lineHeight=ut,ct.height=Math.max(J,16)+3,ct.width=q)}function z(j){var N=0,G=0,rt=j.title.side;return rt&&(rt.indexOf("left")!==-1&&(N=j._titleWidth),rt.indexOf("top")!==-1&&(G=j._titleHeight)),[N,G]}function D(j,N,G,rt){var ct=j._fullLayout,st=F(rt);rt||(rt=ct[st]);var et=ct._size,Z=l.isVertical(rt),ot=l.isGrouped(rt),X=rt.entrywidthmode==="fraction",Q=rt.borderwidth,ut=2*Q,J=a.itemGap,q=rt.indentation+rt.itemwidth+J*2,it=2*(Q+J),nt=I(rt),dt=rt.y<0||rt.y===0&&nt==="top",Tt=rt.y>1||rt.y===1&&nt==="bottom",wt=rt.tracegroupgap,Ct={};let{orientation:It,yref:Nt}=rt,{maxheight:te}=rt,Jt=dt||Tt||It!=="v"||Nt!=="paper";te||(te=Jt?.5:1);let ee=Jt?ct.height:et.h;rt._maxHeight=Math.max(te>1?te:te*ee,30);var Zt=0;rt._width=0,rt._height=0;var mt=z(rt);if(Z)G.each(function(lt){var yt=lt[0].height;r.setTranslate(this,Q+mt[0],Q+mt[1]+rt._height+yt/2+J),rt._height+=yt,rt._width=Math.max(rt._width,lt[0].width)}),Zt=q+rt._width,rt._width+=J+q+ut,rt._height+=it,ot&&(N.each(function(lt,yt){r.setTranslate(this,0,yt*rt.tracegroupgap)}),rt._height+=(rt._lgroupsLength-1)*rt.tracegroupgap);else{var bt=R(rt),vt=rt.x<0||rt.x===0&&bt==="right",Ut=rt.x>1||rt.x===1&&bt==="left",re=Tt||dt,Kt=ct.width/2;rt._maxWidth=Math.max(vt?re&&bt==="left"?et.l+et.w:Kt:Ut?re&&bt==="right"?et.r+et.w:Kt:et.w,2*q);var ue=0,Me=0;G.each(function(lt){var yt=M(lt,rt,q);ue=Math.max(ue,yt),Me+=yt}),Zt=null;var Ce=0;if(ot){var We=0,qe=0,vr=0;N.each(function(){var lt=0,yt=0;u.select(this).selectAll("g.traces").each(function(Ht){var Yt=M(Ht,rt,q),se=Ht[0].height;r.setTranslate(this,mt[0],mt[1]+Q+J+se/2+yt),yt+=se,lt=Math.max(lt,Yt),Ct[Ht[0].trace.legendgroup]=lt});var St=lt+J;qe>0&&St+Q+qe>rt._maxWidth?(Ce=Math.max(Ce,qe),qe=0,vr+=We+wt,We=yt):We=Math.max(We,yt),r.setTranslate(this,qe,vr),qe+=St}),rt._width=Math.max(Ce,qe)+Q,rt._height=vr+We+it}else{var _r=G.size(),er=Me+ut+(_r-1)*J=rt._maxWidth&&(Ce=Math.max(Ce,Dt),Ir=0,de+=Mr,rt._height+=Mr,Mr=0),r.setTranslate(this,mt[0]+Q+Ir,mt[1]+Q+de+yt/2+J),Dt=Ir+St+J,Ir+=Ht,Mr=Math.max(Mr,yt)}),er?(rt._width=Ir+ut,rt._height=Mr+it):(rt._width=Math.max(Ce,Dt)+ut,rt._height+=Mr+it)}}rt._width=Math.ceil(Math.max(rt._width+mt[0],rt._titleWidth+2*(Q+a.titlePad))),rt._height=Math.ceil(Math.max(rt._height+mt[1],rt._titleHeight+2*(Q+a.itemGap))),rt._effHeight=Math.min(rt._height,rt._maxHeight);var qt=j._context.edits,_t=qt.legendText||qt.legendPosition;G.each(function(lt){var yt=u.select(this).select("."+st+"toggle"),St=lt[0].height,Ht=lt[0].trace.legendgroup,Yt=M(lt,rt,q);ot&&Ht!==""&&(Yt=Ct[Ht]);var se=_t?q:Zt||Yt;!Z&&!X&&(se+=J/2),r.setRect(yt,0,-St/2,se,St)})}function B(j,N,G,rt){var ct=j._fullLayout,st=ct[N],et=R(st),Z=I(st),ot=st.xref==="paper",X=st.yref==="paper";j._fullLayout._reservedMargin[N]={};var Q=st.y<.5?"b":"t",ut=st.x<.5?"l":"r",J={r:ct.width-G,l:G+st._width,b:ct.height-rt,t:rt+st._effHeight};if(ot&&X)return E.autoMargin(j,N,{x:st.x,y:st.y,l:st._width*v[et],r:st._width*g[et],b:st._effHeight*g[Z],t:st._effHeight*v[Z]});ot?j._fullLayout._reservedMargin[N][Q]=J[Q]:X||st.orientation==="v"?j._fullLayout._reservedMargin[N][ut]=J[ut]:j._fullLayout._reservedMargin[N][Q]=J[Q]}function R(j){return d.isRightAnchor(j)?"right":d.isCenterAnchor(j)?"center":"left"}function I(j){return d.isBottomAnchor(j)?"bottom":d.isMiddleAnchor(j)?"middle":"top"}function F(j){return j._id||"legend"}}),xb=Vt(K=>{var V=Ni(),u=Lo(),d=Af(),E=Xr(),A=E.pushUnique,t=E.strTranslate,e=E.strRotate,r=ym(),i=Dl(),n=XT(),o=Eo(),a=Pi(),s=oh(),f=yo(),v=Mf().zindexSeparator,g=ji(),m=mh(),w=Cg(),l=mb(),x=yb(),y=w.YANGLE,S=Math.PI*y/180,k=1/Math.sin(S),M=Math.cos(S),T=Math.sin(S),c=w.HOVERARROWSIZE,h=w.HOVERTEXTPAD,b={box:!0,ohlc:!0,violin:!0,candlestick:!0},_={scatter:!0,scattergl:!0,splom:!0};function P(q,it){return q.distance-it.distance}K.hover=function(q,it,nt,dt){q=E.getGraphDiv(q);var Tt=it.target;E.throttle(q._fullLayout._uid+w.HOVERID,w.HOVERMINTIME,function(){z(q,it,nt,dt,Tt)})},K.loneHover=function(q,it){var nt=!0;Array.isArray(q)||(nt=!1,q=[q]);var dt=it.gd,Tt=Q(dt),wt=ut(dt),Ct=q.map(function(vt){var Ut=vt._x0||vt.x0||vt.x||0,re=vt._x1||vt.x1||vt.x||0,Kt=vt._y0||vt.y0||vt.y||0,ue=vt._y1||vt.y1||vt.y||0,Me=vt.eventData;if(Me){var Ce=Math.min(Ut,re),We=Math.max(Ut,re),qe=Math.min(Kt,ue),vr=Math.max(Kt,ue),_r=vt.trace;if(g.traceIs(_r,"gl3d")){var er=dt._fullLayout[_r.scene]._scene.container,Mr=er.offsetLeft,Ir=er.offsetTop;Ce+=Mr,We+=Mr,qe+=Ir,vr+=Ir}Me.bbox={x0:Ce+wt,x1:We+wt,y0:qe+Tt,y1:vr+Tt},it.inOut_bbox&&it.inOut_bbox.push(Me.bbox)}else Me=!1;return{color:vt.color||a.defaultLine,x0:vt.x0||vt.x||0,x1:vt.x1||vt.x||0,y0:vt.y0||vt.y||0,y1:vt.y1||vt.y||0,xLabel:vt.xLabel,yLabel:vt.yLabel,zLabel:vt.zLabel,text:vt.text,name:vt.name,idealAlign:vt.idealAlign,borderColor:vt.borderColor,fontFamily:vt.fontFamily,fontSize:vt.fontSize,fontColor:vt.fontColor,fontWeight:vt.fontWeight,fontStyle:vt.fontStyle,fontVariant:vt.fontVariant,nameLength:vt.nameLength,textAlign:vt.textAlign,trace:vt.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:vt.hovertemplate||!1,hovertemplateLabels:vt.hovertemplateLabels||!1,eventData:Me}}),It=!1,Nt=R(Ct,{gd:dt,hovermode:"closest",rotateLabels:It,bgColor:it.bgColor||a.background,container:V.select(it.container),outerContainer:it.outerContainer||it.container}),te=Nt.hoverLabels,Jt=5,ee=0,Zt=0;te.sort(function(vt,Ut){return vt.y0-Ut.y0}).each(function(vt,Ut){var re=vt.y0-vt.by/2;re-Jtqe[0]._length||En<0||En>vr[0]._length)return s.unhoverRaw(q,it)}if(it.pointerX=Zn+qe[0]._offset,it.pointerY=En+vr[0]._offset,"xval"in it?_t=m.flat(wt,it.xval):_t=m.p2c(qe,Zn),"yval"in it?lt=m.flat(wt,it.yval):lt=m.p2c(vr,En),!u(_t[0])||!u(lt[0]))return E.warn("Fx.hover failed",it,q),s.unhoverRaw(q,it)}var ra=1/0;function Se(Ra,Qi){for(St=0;StYe&&(Dt.splice(0,Ye),ra=Dt[0].distance),ee&&de!==0&&Dt.length===0){ar.distance=de,ar.index=!1;var qi=Yt._module.hoverPoints(ar,Ue,ir,"closest",{hoverLayer:It._hoverlayer});if(qi&&(qi=qi.filter(function(yi){return yi.spikeDistance<=de})),qi&&qi.length){var qo,Po=qi.filter(function(yi){return yi.xa.showspikes&&yi.xa.spikesnap!=="hovered data"});if(Po.length){var hs=Po[0];u(hs.x0)&&u(hs.y0)&&(qo=Ze(hs),(!Er.vLinePoint||Er.vLinePoint.spikeDistance>qo.spikeDistance)&&(Er.vLinePoint=qo))}var Gi=qi.filter(function(yi){return yi.ya.showspikes&&yi.ya.spikesnap!=="hovered data"});if(Gi.length){var uo=Gi[0];u(uo.x0)&&u(uo.y0)&&(qo=Ze(uo),(!Er.hLinePoint||Er.hLinePoint.spikeDistance>qo.spikeDistance)&&(Er.hLinePoint=qo))}}}}}Se();function Re(Ra,Qi,Hi){for(var Ho=null,Ci=1/0,zo,qi=0;qiRa.trace.index===Cn.trace.index):Dt=[Cn];var Fa=Dt.length,Ga=X("x",Cn,It),ve=X("y",Cn,It);Se(Ga,ve);var ge=[],dr={},br=0,Tr=function(Ra){var Qi=b[Ra.trace.type]?D(Ra):Ra.trace.index;if(!dr[Qi])br++,dr[Qi]=br,ge.push(Ra);else{var Hi=dr[Qi]-1,Ho=ge[Hi];Hi>0&&Math.abs(Ra.distance)Fa-1;mr--)Tr(Dt[mr]);Dt=ge,tn()}var kr=q._hoverdata,Ur=[],Or=Q(q),pe=ut(q);for(let Ra of Dt){var Ke=m.makeEventData(Ra,Ra.trace,Ra.cd);if(Ra.hovertemplate!==!1){var xr=!1;Ra.cd[Ra.index]&&Ra.cd[Ra.index].ht&&(xr=Ra.cd[Ra.index].ht),Ra.hovertemplate=xr||Ra.trace.hovertemplate||!1}if(Ra.xa&&Ra.ya){var Gr=Ra.x0+Ra.xa._offset,ln=Ra.x1+Ra.xa._offset,wn=Ra.y0+Ra.ya._offset,rn=Ra.y1+Ra.ya._offset,Qr=Math.min(Gr,ln),vn=Math.max(Gr,ln),Oa=Math.min(wn,rn),Qn=Math.max(wn,rn);Ke.bbox={x0:Qr+pe,x1:vn+pe,y0:Oa+Or,y1:Qn+Or}}Ra.eventData=[Ke],Ur.push(Ke)}q._hoverdata=Ur;var Qa=Zt==="y"&&(qt.length>1||Dt.length>1)||Zt==="closest"&&pn&&Dt.length>1,Ja=a.combine(It.plot_bgcolor||a.background,It.paper_bgcolor),wi=R(Dt,{gd:q,hovermode:Zt,rotateLabels:Qa,bgColor:Ja,container:It._hoverlayer,outerContainer:It._paper.node(),commonLabelOpts:It.hoverlabel,hoverdistance:It.hoverdistance}),ci=wi.hoverLabels;if(m.isUnifiedHover(Zt)||(F(ci,Qa,It,wi.commonLabelBoundingBox),G(ci,Qa,It._invScaleX,It._invScaleY)),Tt&&Tt.tagName){var Ti=g.getComponentMethod("annotations","hasClickToShow")(q,Ur);n(V.select(Tt),Ti?"pointer":"")}!Tt||dt||!st(q,it,kr)||(kr&&q.emit("plotly_unhover",{event:it,points:kr}),q.emit("plotly_hover",{event:it,points:q._hoverdata,xaxes:qe,yaxes:vr,xvals:_t,yvals:lt}))}function D(q){return[q.trace.index,q.index,q.x0,q.y0,q.name,q.attr,q.xa?q.xa._id:"",q.ya?q.ya._id:""].join(",")}var B=/([\s\S]*)<\/extra>/;function R(q,it){var nt=it.gd,dt=nt._fullLayout,Tt=it.hovermode,wt=it.rotateLabels,Ct=it.bgColor,It=it.container,Nt=it.outerContainer,te=it.commonLabelOpts||{};if(q.length===0)return[[]];var Jt=it.fontFamily||w.HOVERFONT,ee=it.fontSize||w.HOVERFONTSIZE,Zt=it.fontWeight||dt.font.weight,mt=it.fontStyle||dt.font.style,bt=it.fontVariant||dt.font.variant,vt=it.fontTextcase||dt.font.textcase,Ut=it.fontLineposition||dt.font.lineposition,re=it.fontShadow||dt.font.shadow,Kt=q[0],ue=Kt.xa,Me=Kt.ya,Ce=Tt.charAt(0),We=Ce+"Label",qe=Kt[We];if(qe===void 0&&ue.type==="multicategory")for(var vr=0;vrdt.width-pe&&(Ke=dt.width-pe),Fa.attr("d","M"+(kr-Ke)+",0L"+(kr-Ke+c)+","+Or+c+"H"+pe+"v"+Or+(h*2+mr.height)+"H"+-pe+"V"+Or+c+"H"+(kr-Ke-c)+"Z"),kr=Ke,St.minX=kr-pe,St.maxX=kr+pe,ue.side==="top"?(St.minY=Ur-(h*2+mr.height),St.maxY=Ur-h):(St.minY=Ur+h,St.maxY=Ur+(h*2+mr.height))}else{var xr,Gr,ln;Me.side==="right"?(xr="start",Gr=1,ln="",kr=ue._offset+ue._length):(xr="end",Gr=-1,ln="-",kr=ue._offset),Ur=Me._offset+(Kt.y0+Kt.y1)/2,Ga.attr("text-anchor",xr),Fa.attr("d","M0,0L"+ln+c+","+c+"V"+(h+mr.height/2)+"h"+ln+(h*2+mr.width)+"V-"+(h+mr.height/2)+"H"+ln+c+"V-"+c+"Z"),St.minY=Ur-(h+mr.height/2),St.maxY=Ur+(h+mr.height/2),Me.side==="right"?(St.minX=kr+c,St.maxX=kr+c+(h*2+mr.width)):(St.minX=kr-c-(h*2+mr.width),St.maxX=kr-c);var wn=mr.height/2,rn=er-mr.top-wn,Qr="clip"+dt._uid+"commonlabel"+Me._id,vn;if(krFa.hoverinfo!=="none");if(Cn.length===0)return[];var Ht=dt.hoverlabel,Yt=Ht.font,se=Cn[0],ke=((Tt==="x unified"?se.xa:se.ya).unifiedhovertitle||{}).text,Ee=ke?E.hovertemplateString({data:Tt==="x unified"?[{xa:se.xa,x:se.xVal}]:[{ya:se.ya,y:se.yVal}],fallback:se.trace.hovertemplatefallback,locale:dt._d3locale,template:ke}):qe,Ue={showlegend:!0,legend:{title:{text:Ee,font:Yt},font:Yt,bgcolor:Ht.bgcolor,bordercolor:Ht.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:dt.legend?dt.legend.traceorder:void 0,orientation:"v"}},ir={font:Yt};l(Ue,ir,nt._fullData);var ar=ir.legend;ar.entries=[];for(var Ye=0;Ye=0?Kn=Yr:$r+da=0?Kn=$r:In+da=0?$n=zr:tn+ra=0?$n=tn:Nn+ra=0,(Cn.idealAlign==="top"||!Qa)&&Ja?(ln-=rn/2,Cn.anchor="end"):Qa?(ln+=rn/2,Cn.anchor="start"):Cn.anchor="middle",Cn.crossPos=ln;else{if(Cn.pos=ln,Qa=Gr+wn/2+Qn<=Mr,Ja=Gr-wn/2-Qn>=0,(Cn.idealAlign==="left"||!Qa)&&Ja)Gr-=wn/2,Cn.anchor="end";else if(Qa)Gr+=wn/2,Cn.anchor="start";else{Cn.anchor="middle";var wi=Qn/2,ci=Gr+wi-Mr,Ti=Gr-wi;ci>0&&(Gr-=ci),Ti<0&&(Gr+=-Ti)}Cn.crossPos=Gr}Ur.attr("text-anchor",Cn.anchor),pe&&Or.attr("text-anchor",Cn.anchor),Fa.attr("transform",t(Gr,ln)+(wt?e(y):""))}),{hoverLabels:ia,commonLabelBoundingBox:St}}function I(q,it,nt,dt,Tt,wt){var Ct,It,Nt="",te="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=E.templateString(q.name,q.trace._meta)),Nt=Z(q.name,q.nameLength));var Jt=nt.charAt(0),ee=Jt==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(te+="x: "+q.xLabel+"
                "),q.yLabel!==void 0&&(te+="y: "+q.yLabel+"
                "),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(te+=(te?"z: ":"")+q.zLabel)):it&&q[Jt+"Label"]===Tt?te=q[ee+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(te=q.yLabel):q.yLabel===void 0?te=q.xLabel:te="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(te+=(te?"
                ":"")+q.text),q.extraText!==void 0&&(te+=(te?"
                ":"")+q.extraText),wt&&te===""&&!q.hovertemplate&&(Nt===""&&wt.remove(),te=Nt),(It=(Ct=q.trace)==null?void 0:Ct.hoverlabel)!=null&&It.split&&(q.hovertemplate="");let{hovertemplate:Zt=!1}=q;if(Zt){let mt=q.hovertemplateLabels||q;q[Jt+"Label"]!==Tt&&(mt[Jt+"other"]=mt[Jt+"Val"],mt[Jt+"otherLabel"]=mt[Jt+"Label"]),te=E.hovertemplateString({data:[q.eventData[0]||{},q.trace._meta],fallback:q.trace.hovertemplatefallback,labels:mt,locale:dt._d3locale,template:Zt}),te=te.replace(B,(bt,vt)=>(Nt=Z(vt,q.nameLength),""))}return[te,Nt]}function F(q,it,nt,dt){var Tt=it?"xa":"ya",wt=it?"ya":"xa",Ct=0,It=1,Nt=q.size(),te=new Array(Nt),Jt=0,ee=dt.minX,Zt=dt.maxX,mt=dt.minY,bt=dt.maxY,vt=function(_t){return _t*nt._invScaleX},Ut=function(_t){return _t*nt._invScaleY};q.each(function(_t){var lt=_t[Tt],yt=_t[wt],St=lt._id.charAt(0)==="x",Ht=lt.range;Jt===0&&Ht&&Ht[0]>Ht[1]!==St&&(It=-1);var Yt=0,se=St?nt.width:nt.height;if(nt.hovermode==="x"||nt.hovermode==="y"){var ke=j(_t,it),Ee=_t.anchor,Ue=Ee==="end"?-1:1,ir,ar;if(Ee==="middle")ir=_t.crossPos+(St?Ut(ke.y-_t.by/2):vt(_t.bx/2+_t.tx2width/2)),ar=ir+(St?Ut(_t.by):vt(_t.bx));else if(St)ir=_t.crossPos+Ut(c+ke.y)-Ut(_t.by/2-c),ar=ir+Ut(_t.by);else{var Ye=vt(Ue*c+ke.x),Er=Ye+vt(Ue*_t.bx);ir=_t.crossPos+Math.min(Ye,Er),ar=_t.crossPos+Math.max(Ye,Er)}St?mt!==void 0&&bt!==void 0&&Math.min(ar,bt)-Math.max(ir,mt)>1&&(yt.side==="left"?(Yt=yt._mainLinePosition,se=nt.width):se=yt._mainLinePosition):ee!==void 0&&Zt!==void 0&&Math.min(ar,Zt)-Math.max(ir,ee)>1&&(yt.side==="top"?(Yt=yt._mainLinePosition,se=nt.height):se=yt._mainLinePosition)}te[Jt++]=[{datum:_t,traceIndex:_t.trace.index,dp:0,pos:_t.pos,posref:_t.posref,size:_t.by*(St?k:1)/2,pmin:Yt,pmax:se}]}),te.sort(function(_t,lt){return _t[0].posref-lt[0].posref||It*(lt[0].traceIndex-_t[0].traceIndex)});var re,Kt,ue,Me,Ce,We,qe;function vr(_t){var lt=_t[0],yt=_t[_t.length-1];if(Kt=lt.pmin-lt.pos-lt.dp+lt.size,ue=yt.pos+yt.dp+yt.size-lt.pmax,Kt>.01){for(Ce=_t.length-1;Ce>=0;Ce--)_t[Ce].dp+=Kt;re=!1}if(!(ue<.01)){if(Kt<-.01){for(Ce=_t.length-1;Ce>=0;Ce--)_t[Ce].dp-=ue;re=!1}if(re){var St=0;for(Me=0;Me<_t.length;Me++)We=_t[Me],We.pos+We.dp+We.size>lt.pmax&&St++;for(Me=_t.length-1;Me>=0&&!(St<=0);Me--)We=_t[Me],We.pos>lt.pmax-1&&(We.del=!0,St--);for(Me=0;Me<_t.length&&!(St<=0);Me++)if(We=_t[Me],We.pos=0;Ce--)_t[Ce].dp-=ue;for(Me=_t.length-1;Me>=0&&!(St<=0);Me--)We=_t[Me],We.pos+We.dp+We.size>lt.pmax&&(We.del=!0,St--)}}}for(;!re&&Ct<=Nt;){for(Ct++,re=!0,Me=0;Me.01){for(Ce=er.length-1;Ce>=0;Ce--)er[Ce].dp+=Kt;for(_r.push.apply(_r,er),te.splice(Me+1,1),qe=0,Ce=_r.length-1;Ce>=0;Ce--)qe+=_r[Ce].dp;for(ue=qe/_r.length,Ce=_r.length-1;Ce>=0;Ce--)_r[Ce].dp-=ue;re=!1}else Me++}te.forEach(vr)}for(Me=te.length-1;Me>=0;Me--){var de=te[Me];for(Ce=de.length-1;Ce>=0;Ce--){var Dt=de[Ce],qt=Dt.datum;qt.offset=Dt.dp,qt.del=Dt.del}}}function j(q,it){var nt=0,dt=q.offset;return it&&(dt*=-T,nt=q.offset*M),{x:nt,y:dt}}function N(q){var it={start:1,end:-1,middle:0}[q.anchor],nt=it*(c+h),dt=nt+it*(q.txwidth+h),Tt=q.anchor==="middle";return Tt&&(nt-=q.tx2width/2,dt+=q.txwidth/2+h),{alignShift:it,textShiftX:nt,text2ShiftX:dt}}function G(q,it,nt,dt){var Tt=function(Ct){return Ct*nt},wt=function(Ct){return Ct*dt};q.each(function(Ct){var It=V.select(this);if(Ct.del)return It.remove();var Nt=It.select("text.nums"),te=Ct.anchor,Jt=te==="end"?-1:1,ee=N(Ct),Zt=j(Ct,it),mt=Zt.x,bt=Zt.y,vt=te==="middle",Ut="hoverlabel"in Ct.trace?Ct.trace.hoverlabel.showarrow:!0,re;vt?re="M-"+Tt(Ct.bx/2+Ct.tx2width/2)+","+wt(bt-Ct.by/2)+"h"+Tt(Ct.bx)+"v"+wt(Ct.by)+"h-"+Tt(Ct.bx)+"Z":Ut?re="M0,0L"+Tt(Jt*c+mt)+","+wt(c+bt)+"v"+wt(Ct.by/2-c)+"h"+Tt(Jt*Ct.bx)+"v-"+wt(Ct.by)+"H"+Tt(Jt*c+mt)+"V"+wt(bt-c)+"Z":re="M"+Tt(Jt*c+mt)+","+wt(bt-Ct.by/2)+"h"+Tt(Jt*Ct.bx)+"v"+wt(Ct.by)+"h"+Tt(-Jt*Ct.bx)+"Z",It.select("path").attr("d",re);var Kt=mt+ee.textShiftX,ue=bt+Ct.ty0-Ct.by/2+h,Me=Ct.textAlign||"auto";Me!=="auto"&&(Me==="left"&&te!=="start"?(Nt.attr("text-anchor","start"),Kt=vt?-Ct.bx/2-Ct.tx2width/2+h:-Ct.bx-h):Me==="right"&&te!=="end"&&(Nt.attr("text-anchor","end"),Kt=vt?Ct.bx/2-Ct.tx2width/2-h:Ct.bx+h)),Nt.call(i.positionText,Tt(Kt),wt(ue)),Ct.tx2width&&(It.select("text.name").call(i.positionText,Tt(ee.text2ShiftX+ee.alignShift*h+mt),wt(bt+Ct.ty0-Ct.by/2+h)),It.select("rect").call(o.setRect,Tt(ee.text2ShiftX+(ee.alignShift-1)*Ct.tx2width/2+mt),wt(bt-Ct.by/2-1),Tt(Ct.tx2width),wt(Ct.by+2)))})}function rt(q,it){var nt=q.index,dt=q.trace||{},Tt=q.cd[0],wt=q.cd[nt]||{};function Ct(Zt){return Zt||u(Zt)&&Zt===0}var It=Array.isArray(nt)?function(Zt,mt){var bt=E.castOption(Tt,nt,Zt);return Ct(bt)?bt:E.extractOption({},dt,"",mt)}:function(Zt,mt){return E.extractOption(wt,dt,Zt,mt)};function Nt(Zt,mt,bt){var vt=It(mt,bt);Ct(vt)&&(q[Zt]=vt)}if(Nt("hoverinfo","hi","hoverinfo"),Nt("bgcolor","hbg","hoverlabel.bgcolor"),Nt("borderColor","hbc","hoverlabel.bordercolor"),Nt("fontFamily","htf","hoverlabel.font.family"),Nt("fontSize","hts","hoverlabel.font.size"),Nt("fontColor","htc","hoverlabel.font.color"),Nt("fontWeight","htw","hoverlabel.font.weight"),Nt("fontStyle","hty","hoverlabel.font.style"),Nt("fontVariant","htv","hoverlabel.font.variant"),Nt("nameLength","hnl","hoverlabel.namelength"),Nt("textAlign","hta","hoverlabel.align"),q.posref=it==="y"||it==="closest"&&dt.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=E.constrain(q.x0,0,q.xa._length),q.x1=E.constrain(q.x1,0,q.xa._length),q.y0=E.constrain(q.y0,0,q.ya._length),q.y1=E.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:f.hoverLabelText(q.xa,q.xLabelVal,dt.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:f.hoverLabelText(q.ya,q.yLabelVal,dt.yhoverformat),q.yVal=q.ya.c2d(q.yLabelVal)),q.zLabelVal!==void 0&&q.zLabel===void 0&&(q.zLabel=String(q.zLabelVal)),!isNaN(q.xerr)&&!(q.xa.type==="log"&&q.xerr<=0)){var te=f.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+te+" / -"+f.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+te,it==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Jt=f.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Jt+" / -"+f.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Jt,it==="y"&&(q.distance+=1)}var ee=q.hoverinfo||q.trace.hoverinfo;return ee&&ee!=="all"&&(ee=Array.isArray(ee)?ee:ee.split("+"),ee.indexOf("x")===-1&&(q.xLabel=void 0),ee.indexOf("y")===-1&&(q.yLabel=void 0),ee.indexOf("z")===-1&&(q.zLabel=void 0),ee.indexOf("text")===-1&&(q.text=void 0),ee.indexOf("name")===-1&&(q.name=void 0)),q}function ct(q,it,nt){var dt=nt.container,Tt=nt.fullLayout,wt=Tt._size,Ct=nt.event,It=!!it.hLinePoint,Nt=!!it.vLinePoint,te,Jt;if(dt.selectAll(".spikeline").remove(),!!(Nt||It)){var ee=a.combine(Tt.plot_bgcolor,Tt.paper_bgcolor);if(It){var Zt=it.hLinePoint,mt,bt;te=Zt&&Zt.xa,Jt=Zt&&Zt.ya;var vt=Jt.spikesnap;vt==="cursor"?(mt=Ct.pointerX,bt=Ct.pointerY):(mt=te._offset+Zt.x,bt=Jt._offset+Zt.y);var Ut=d.readability(Zt.color,ee)<1.5?a.contrast(ee):Zt.color,re=Jt.spikemode,Kt=Jt.spikethickness,ue=Jt.spikecolor||Ut,Me=f.getPxPosition(q,Jt),Ce,We;if(re.indexOf("toaxis")!==-1||re.indexOf("across")!==-1){if(re.indexOf("toaxis")!==-1&&(Ce=Me,We=mt),re.indexOf("across")!==-1){var qe=Jt._counterDomainMin,vr=Jt._counterDomainMax;Jt.anchor==="free"&&(qe=Math.min(qe,Jt.position),vr=Math.max(vr,Jt.position)),Ce=wt.l+qe*wt.w,We=wt.l+vr*wt.w}dt.insert("line",":first-child").attr({x1:Ce,x2:We,y1:bt,y2:bt,"stroke-width":Kt,stroke:ue,"stroke-dasharray":o.dashStyle(Jt.spikedash,Kt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:Ce,x2:We,y1:bt,y2:bt,"stroke-width":Kt+2,stroke:ee}).classed("spikeline",!0).classed("crisp",!0)}re.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:Me+(Jt.side!=="right"?Kt:-Kt),cy:bt,r:Kt,fill:ue}).classed("spikeline",!0)}if(Nt){var _r=it.vLinePoint,er,Mr;te=_r&&_r.xa,Jt=_r&&_r.ya;var Ir=te.spikesnap;Ir==="cursor"?(er=Ct.pointerX,Mr=Ct.pointerY):(er=te._offset+_r.x,Mr=Jt._offset+_r.y);var de=d.readability(_r.color,ee)<1.5?a.contrast(ee):_r.color,Dt=te.spikemode,qt=te.spikethickness,_t=te.spikecolor||de,lt=f.getPxPosition(q,te),yt,St;if(Dt.indexOf("toaxis")!==-1||Dt.indexOf("across")!==-1){if(Dt.indexOf("toaxis")!==-1&&(yt=lt,St=Mr),Dt.indexOf("across")!==-1){var Ht=te._counterDomainMin,Yt=te._counterDomainMax;te.anchor==="free"&&(Ht=Math.min(Ht,te.position),Yt=Math.max(Yt,te.position)),yt=wt.t+(1-Yt)*wt.h,St=wt.t+(1-Ht)*wt.h}dt.insert("line",":first-child").attr({x1:er,x2:er,y1:yt,y2:St,"stroke-width":qt,stroke:_t,"stroke-dasharray":o.dashStyle(te.spikedash,qt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:er,x2:er,y1:yt,y2:St,"stroke-width":qt+2,stroke:ee}).classed("spikeline",!0).classed("crisp",!0)}Dt.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:er,cy:lt-(te.side!=="top"?qt:-qt),r:qt,fill:_t}).classed("spikeline",!0)}}}function st(q,it,nt){if(!nt||nt.length!==q._hoverdata.length)return!0;for(var dt=nt.length-1;dt>=0;dt--){var Tt=nt[dt],wt=q._hoverdata[dt];if(Tt.curveNumber!==wt.curveNumber||String(Tt.pointNumber)!==String(wt.pointNumber)||String(Tt.pointNumbers)!==String(wt.pointNumbers)||Tt.binNumber!==wt.binNumber)return!0}return!1}function et(q,it){return!0}function Z(q,it){return i.plainText(q||"",{len:it,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ot(q,it){for(var nt=it.charAt(0),dt=[],Tt=[],wt=[],Ct=0;Ctq.offsetTop+q.clientTop,ut=q=>q.offsetLeft+q.clientLeft;function J(q,it){var nt=q._fullLayout,dt=it.getBoundingClientRect(),Tt=dt.left,wt=dt.top,Ct=Tt+dt.width,It=wt+dt.height,Nt=E.apply3DTransform(nt._invTransform)(Tt,wt),te=E.apply3DTransform(nt._invTransform)(Ct,It),Jt=Nt[0],ee=Nt[1],Zt=te[0],mt=te[1];return{x:Jt,y:ee,width:Zt-Jt,height:mt-ee,top:Math.min(ee,mt),left:Math.min(Jt,Zt),right:Math.max(Jt,Zt),bottom:Math.max(ee,mt)}}}),Fg=Vt((K,V)=>{var u=Xr(),d=Pi(),E=mh().isUnifiedHover;V.exports=function(A,t,e,r){r=r||{};var i=t.legend;function n(o){r.font[o]||(r.font[o]=i?t.legend.font[o]:t.font[o])}t&&E(t.hovermode)&&(r.font||(r.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),i?(r.bgcolor||(r.bgcolor=d.combine(t.legend.bgcolor,t.paper_bgcolor)),r.bordercolor||(r.bordercolor=t.legend.bordercolor)):r.bgcolor||(r.bgcolor=t.paper_bgcolor)),e("hoverlabel.bgcolor",r.bgcolor),e("hoverlabel.bordercolor",r.bordercolor),e("hoverlabel.namelength",r.namelength),e("hoverlabel.showarrow",r.showarrow),u.coerceFont(e,"hoverlabel.font",r.font),e("hoverlabel.align",r.align)}}),tk=Vt((K,V)=>{var u=Xr(),d=Fg(),E=xd();V.exports=function(A,t){function e(r,i){return u.coerce(A,t,E,r,i)}d(A,t,e)}}),ek=Vt((K,V)=>{var u=Xr(),d=mm(),E=Fg();V.exports=function(A,t,e,r){function i(o,a){return u.coerce(A,t,d,o,a)}var n=u.extendFlat({},r.hoverlabel);t.hovertemplate&&(n.namelength=-1),E(A,t,i,n)}}),_b=Vt((K,V)=>{var u=Xr(),d=xd();V.exports=function(E,A){function t(e,r){return A[e]!==void 0?A[e]:u.coerce(E,A,d,e,r)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}),rk=Vt((K,V)=>{var u=Xr(),d=xd(),E=_b(),A=Fg();V.exports=function(t,e){function r(v,g){return u.coerce(t,e,d,v,g)}var i=E(t,e);i&&(r("hoverdistance"),r("spikedistance"));var n=r("dragmode");n==="select"&&r("selectdirection");var o=e._has("mapbox"),a=e._has("map"),s=e._has("geo"),f=e._basePlotModules.length;e.dragmode==="zoom"&&((o||a||s)&&f===1||(o||a)&&s&&f===2)&&(e.dragmode="pan"),A(t,e,r),u.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}),nk=Vt((K,V)=>{var u=Xr(),d=ji();V.exports=function(A){var t=A.calcdata,e=A._fullLayout;function r(s){return function(f){return u.coerceHoverinfo({hoverinfo:f},{_module:s._module},e)}}for(var i=0;i{var u=ji(),d=xb().hover;V.exports=function(E,A,t){var e=u.getComponentMethod("annotations","onClick")(E,E._hoverdata);t!==void 0&&d(E,A,t,!0);function r(){E.emit("plotly_click",{points:E._hoverdata,event:A})}E._hoverdata&&A&&A.target&&(e&&e.then?e.then(r):r(),A.stopImmediatePropagation&&A.stopImmediatePropagation())}}),hc=Vt((K,V)=>{var u=Ni(),d=Xr(),E=oh(),A=mh(),t=xd(),e=xb();V.exports={moduleType:"component",name:"fx",constants:Cg(),schema:{layout:t},attributes:mm(),layoutAttributes:t,supplyLayoutGlobalDefaults:tk(),supplyDefaults:ek(),supplyLayoutDefaults:rk(),calc:nk(),getDistanceFunction:A.getDistanceFunction,getClosest:A.getClosest,inbox:A.inbox,quadrature:A.quadrature,appendArrayPointValue:A.appendArrayPointValue,castHoverOption:i,castHoverinfo:n,hover:e.hover,unhover:E.unhover,loneHover:e.loneHover,loneUnhover:r,click:ak()};function r(o){var a=d.isD3Selection(o)?o:u.select(o);a.selectAll("g.hovertext").remove(),a.selectAll(".spikeline").remove()}function i(o,a,s){return d.castOption(o,a,"hoverlabel."+s)}function n(o,a,s){function f(v){return d.coerceHoverinfo({hoverinfo:v},{_module:o._module},a)}return d.castOption(o,s,"hoverinfo",f)}}),Jh=Vt(K=>{K.selectMode=function(V){return V==="lasso"||V==="select"},K.drawMode=function(V){return V==="drawclosedpath"||V==="drawopenpath"||V==="drawline"||V==="drawrect"||V==="drawcircle"},K.openMode=function(V){return V==="drawline"||V==="drawopenpath"},K.rectMode=function(V){return V==="select"||V==="drawline"||V==="drawrect"||V==="drawcircle"},K.freeMode=function(V){return V==="lasso"||V==="drawclosedpath"||V==="drawopenpath"},K.selectingOrDrawing=function(V){return K.freeMode(V)||K.rectMode(V)}}),Bg=Vt((K,V)=>{V.exports=function(u){var d=u._fullLayout;d._glcanvas&&d._glcanvas.size()&&d._glcanvas.each(function(E){E.regl&&E.regl.clear({color:!0,depth:!0})})}}),Wy=Vt((K,V)=>{V.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}),Gy=Vt((K,V)=>{var u=32;V.exports={CIRCLE_SIDES:u,i000:0,i090:u/4,i180:u/2,i270:u/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),Zy=Vt((K,V)=>{var u=Xr().strTranslate;function d(e,r){switch(e.type){case"log":return e.p2d(r);case"date":return e.p2r(r,0,e.calendar);default:return e.p2r(r)}}function E(e,r){switch(e.type){case"log":return e.d2p(r);case"date":return e.r2p(r,0,e.calendar);default:return e.r2p(r)}}function A(e){var r=e._id.charAt(0)==="y"?1:0;return function(i){return d(e,i[r])}}function t(e){return u(e.xaxis._offset,e.yaxis._offset)}V.exports={p2r:d,r2p:E,axValue:A,getTransform:t}}),Sd=Vt(K=>{var V=Dg(),u=Gy(),d=u.CIRCLE_SIDES,E=u.SQRT2,A=Zy(),t=A.p2r,e=A.r2p,r=[0,3,4,5,6,1,2],i=[0,3,4,1,2];K.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",v=0;v0&&x{var u=cc(),d=Jh(),E=d.drawMode,A=d.openMode,t=Gy(),e=t.i000,r=t.i090,i=t.i180,n=t.i270,o=t.cos45,a=t.sin45,s=Zy(),f=s.p2r,v=s.r2p,g=Td(),m=g.clearOutline,w=Sd(),l=w.readPaths,x=w.writePaths,y=w.ellipseOver,S=w.fixDatesForPaths;function k(T,c){if(T.length){var h=T[0][0];if(h){var b=c.gd,_=c.isActiveShape,P=c.dragmode,z=(b.layout||{}).shapes||[];if(!E(P)&&_!==void 0){var D=b._fullLayout._activeShapeIndex;if(D{var u=Jh(),d=u.selectMode,E=Td(),A=E.clearOutline,t=Sd(),e=t.readPaths,r=t.writePaths,i=t.fixDatesForPaths;V.exports=function(n,o){if(n.length){var a=n[0][0];if(a){var s=a.getAttribute("d"),f=o.gd,v=f._fullLayout.newselection,g=o.plotinfo,m=g.xaxis,w=g.yaxis,l=o.isActiveSelection,x=o.dragmode,y=(f.layout||{}).selections||[];if(!d(x)&&l!==void 0){var S=f._fullLayout._activeSelectionIndex;if(S{V.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),Ed=Vt(K=>{var V=Rg(),u=Xr(),d=yo();K.rangeToShapePosition=function(t){return t.type==="log"?t.r2d:function(e){return e}},K.shapePositionToRange=function(t){return t.type==="log"?t.d2r:function(e){return e}},K.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},K.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},K.extractPathCoords=function(t,e,r){var i=[],n=t.match(V.segmentRE);return n.forEach(function(o){var a=e[o.charAt(0)].drawn;if(a!==void 0){var s=o.slice(1).match(V.paramRE);if(!(!s||s.lengthl&&(y="X"),y});return v>l&&(x=x.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+f)),g+x})}function A(t,e){e=e||0;var r=0;return e&&t&&(t.type==="category"||t.type==="multicategory")&&(r=(t.r2p(1)-t.r2p(0))*e),r}}),wb=Vt((K,V)=>{var u=Xr(),d=yo(),E=Dl(),A=Eo(),t=Sd().readPaths,e=Ed(),r=e.getPathString,i=By(),n=gf().FROM_TL;V.exports=function(s,f,v,g){if(g.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var m;if(v.label.texttemplate){var w={};if(v.type!=="path"){var l=d.getFromId(s,v.xref),x=d.getFromId(s,v.yref);for(var y in i){var S=i[y](v,l,x);S!==void 0&&(w[y]=S)}}m=u.texttemplateStringForShapes({data:[w],fallback:v.label.texttemplatefallback,locale:s._fullLayout._d3locale,template:v.label.texttemplate})}else m=v.label.text;var k={"data-index":f},M=v.label.font,T={"data-notex":1},c=g.append("g").attr(k).classed("shape-label",!0),h=c.append("text").attr(T).classed("shape-label-text",!0).text(m),b,_,P,z;if(v.path){var D=r(s,v),B=t(D,s);b=1/0,P=1/0,_=-1/0,z=-1/0;for(var R=0;R=s?m=f-g:m=g-f,-180/Math.PI*Math.atan2(m,w)}function a(s,f,v,g,m,w,l){var x=m.label.textposition,y=m.label.textangle,S=m.label.padding,k=m.type,M=Math.PI/180*w,T=Math.sin(M),c=Math.cos(M),h=m.label.xanchor,b=m.label.yanchor,_,P,z,D;if(k==="line"){x==="start"?(_=s,P=f):x==="end"?(_=v,P=g):(_=(s+v)/2,P=(f+g)/2),h==="auto"&&(x==="start"?y==="auto"?v>s?h="left":vs?h="right":vs?h="right":vs?h="left":v{var u=Xr(),d=u.strTranslate,E=oh(),A=Jh(),t=A.drawMode,e=A.selectMode,r=ji(),i=Pi(),n=Gy(),o=n.i000,a=n.i090,s=n.i180,f=n.i270,v=Td(),g=v.clearOutlineControllers,m=Sd(),w=m.pointsOnRectangle,l=m.pointsOnEllipse,x=m.writePaths,y=Ky().newShapes,S=Ky().createShapeObj,k=bb(),M=wb();V.exports=function b(_,P,z,D){D||(D=0);var B=z.gd;function R(){b(_,P,z,D++),(l(_[0])||z.hasText)&&I({redrawing:!0})}function I(ee){var Zt={};z.isActiveShape!==void 0&&(z.isActiveShape=!1,Zt=y(P,z)),z.isActiveSelection!==void 0&&(z.isActiveSelection=!1,Zt=k(P,z),B._fullLayout._reselect=!0),Object.keys(Zt).length&&r.call((ee||{}).redrawing?"relayout":"_guiRelayout",B,Zt)}var F=B._fullLayout,j=F._zoomlayer,N=z.dragmode,G=t(N),rt=e(N);(G||rt)&&(B._fullLayout._outlining=!0),g(B),P.attr("d",x(_));var ct,st,et,Z,ot;if(!D&&(z.isActiveShape||z.isActiveSelection)){ot=T([],_);var X=j.append("g").attr("class","outline-controllers");Tt(X),Jt()}if(G&&z.hasText){var Q=j.select(".label-temp"),ut=S(P,z,z.dragmode);M(B,"label-temp",ut,Q)}function J(ee){et=+ee.srcElement.getAttribute("data-i"),Z=+ee.srcElement.getAttribute("data-j"),ct[et][Z].moveFn=q}function q(ee,Zt){if(_.length){var mt=ot[et][Z][1],bt=ot[et][Z][2],vt=_[et],Ut=vt.length;if(w(vt)){var re=ee,Kt=Zt;if(z.isActiveSelection){var ue=c(vt,Z);ue[1]===vt[Z][1]?Kt=0:re=0}for(var Me=0;Me1&&!(ee.length===2&&ee[1][0]==="Z")&&(Z===0&&(ee[0][0]="M"),_[et]=ee,R(),I())}}function dt(ee,Zt){if(ee===2){et=+Zt.srcElement.getAttribute("data-i"),Z=+Zt.srcElement.getAttribute("data-j");var mt=_[et];!w(mt)&&!l(mt)&&nt()}}function Tt(ee){ct=[];for(var Zt=0;Zt<_.length;Zt++){var mt=_[Zt],bt=w(mt),vt=!bt&&l(mt);ct[Zt]=[];for(var Ut=mt.length,re=0;re{var u=Ni(),d=ji(),E=Xr(),A=yo(),t=Sd().readPaths,e=Yy(),r=wb(),i=Td().clearOutlineControllers,n=Pi(),o=Eo(),a=cl().arrayEditor,s=oh(),f=$h(),v=Rg(),g=Ed(),m=g.getPathString;V.exports={draw:w,drawOne:y,eraseActiveShape:h,drawLabel:r};function w(b){var _=b._fullLayout;_._shapeUpperLayer.selectAll("path").remove(),_._shapeLowerLayer.selectAll("path").remove(),_._shapeUpperLayer.selectAll("text").remove(),_._shapeLowerLayer.selectAll("text").remove();for(var P in _._plots){var z=_._plots[P].shapelayer;z&&(z.selectAll("path").remove(),z.selectAll("text").remove())}for(var D=0;D<_.shapes.length;D++)_.shapes[D].visible===!0&&y(b,D)}function l(b){return!!b._fullLayout._outlining}function x(b){return!b._context.edits.shapePosition}function y(b,_){b._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+_+'"]').remove();var P=g.makeShapesOptionsAndPlotinfo(b,_),z=P.options,D=P.plotinfo;if(!z._input||z.visible!==!0)return;if(z.layer==="above")R(b._fullLayout._shapeUpperLayer);else if(z.xref==="paper"||z.yref==="paper")R(b._fullLayout._shapeLowerLayer);else if(z.layer==="between")R(D.shapelayerBetween);else if(D._hadPlotinfo){var B=D.mainplotinfo||D;R(B.shapelayer)}else R(b._fullLayout._shapeLowerLayer);function R(I){var F=m(b,z),j={"data-index":_,"fill-rule":z.fillrule,d:F},N=z.opacity,G=z.fillcolor,rt=z.line.width?z.line.color:"rgba(0,0,0,0)",ct=z.line.width,st=z.line.dash;!ct&&z.editable===!0&&(ct=5,st="solid");var et=F[F.length-1]!=="Z",Z=x(b)&&z.editable&&b._fullLayout._activeShapeIndex===_;Z&&(G=et?"rgba(0,0,0,0)":b._fullLayout.activeshape.fillcolor,N=b._fullLayout.activeshape.opacity);var ot=I.append("g").classed("shape-group",!0).attr({"data-index":_}),X=ot.append("path").attr(j).style("opacity",N).call(n.stroke,rt).call(n.fill,G).call(o.dashLine,st,ct);S(ot,b,z),r(b,_,z,ot);var Q;if((Z||b._context.edits.shapePosition)&&(Q=a(b.layout,"shapes",z)),Z){X.style({cursor:"move"});var ut={element:X.node(),plotinfo:D,gd:b,editHelpers:Q,hasText:z.label.text||z.label.texttemplate,isActiveShape:!0},J=t(F,b);e(J,X,ut)}else b._context.edits.shapePosition?k(b,X,z,_,I,Q):z.editable===!0&&X.style("pointer-events",et||n.opacity(G)*N<=.5?"stroke":"all");X.node().addEventListener("click",function(){return T(b,X)})}}function S(b,_,P){var z=(P.xref+P.yref).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");o.setClipUrl(b,z?"clip"+_._fullLayout._uid+z:null,_)}function k(b,_,P,z,D,B){var R=10,I=10,F=P.xsizemode==="pixel",j=P.ysizemode==="pixel",N=P.type==="line",G=P.type==="path",rt=B.modifyItem,ct,st,et,Z,ot,X,Q,ut,J,q,it,nt,dt,Tt,wt,Ct=u.select(_.node().parentNode),It=A.getFromId(b,P.xref),Nt=A.getRefType(P.xref),te=A.getFromId(b,P.yref),Jt=A.getRefType(P.yref),ee=P.x0shift,Zt=P.x1shift,mt=P.y0shift,bt=P.y1shift,vt=function(lt,yt){var St=g.getDataToPixel(b,It,yt,!1,Nt);return St(lt)},Ut=function(lt,yt){var St=g.getDataToPixel(b,te,yt,!0,Jt);return St(lt)},re=g.getPixelToData(b,It,!1,Nt),Kt=g.getPixelToData(b,te,!0,Jt),ue=We(),Me={element:ue.node(),gd:b,prepFn:_r,doneFn:er,clickFn:Mr},Ce;s.init(Me),ue.node().onmousemove=vr;function We(){return N?qe():_}function qe(){var lt=10,yt=Math.max(P.line.width,lt),St=D.append("g").attr("data-index",z).attr("drag-helper",!0);St.append("path").attr("d",_.attr("d")).style({cursor:"move","stroke-width":yt,"stroke-opacity":"0"});var Ht={"fill-opacity":"0"},Yt=Math.max(yt/2,lt);return St.append("circle").attr({"data-line-point":"start-point",cx:F?vt(P.xanchor)+P.x0:vt(P.x0,ee),cy:j?Ut(P.yanchor)-P.y0:Ut(P.y0,mt),r:Yt}).style(Ht).classed("cursor-grab",!0),St.append("circle").attr({"data-line-point":"end-point",cx:F?vt(P.xanchor)+P.x1:vt(P.x1,Zt),cy:j?Ut(P.yanchor)-P.y1:Ut(P.y1,bt),r:Yt}).style(Ht).classed("cursor-grab",!0),St}function vr(lt){if(l(b)){Ce=null;return}if(N)lt.target.tagName==="path"?Ce="move":Ce=lt.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var yt=Me.element.getBoundingClientRect(),St=yt.right-yt.left,Ht=yt.bottom-yt.top,Yt=lt.clientX-yt.left,se=lt.clientY-yt.top,ke=!G&&St>R&&Ht>I&&!lt.shiftKey?s.getCursor(Yt/St,1-se/Ht):"move";f(_,ke),Ce=ke.split("-")[0]}}function _r(lt){l(b)||(F&&(ot=vt(P.xanchor)),j&&(X=Ut(P.yanchor)),P.type==="path"?wt=P.path:(ct=F?P.x0:vt(P.x0),st=j?P.y0:Ut(P.y0),et=F?P.x1:vt(P.x1),Z=j?P.y1:Ut(P.y1)),ctZ?(Q=st,it="y0",ut=Z,nt="y1"):(Q=Z,it="y1",ut=st,nt="y0"),vr(lt),Dt(D,P),_t(_,P,b),Me.moveFn=Ce==="move"?Ir:de,Me.altKey=lt.altKey)}function er(){l(b)||(f(_),qt(D),S(_,b,P),d.call("_guiRelayout",b,B.getUpdateObj()))}function Mr(){l(b)||qt(D)}function Ir(lt,yt){if(P.type==="path"){var St=function(se){return se},Ht=St,Yt=St;F?rt("xanchor",P.xanchor=re(ot+lt)):(Ht=function(se){return re(vt(se)+lt)},It&&It.type==="date"&&(Ht=g.encodeDate(Ht))),j?rt("yanchor",P.yanchor=Kt(X+yt)):(Yt=function(se){return Kt(Ut(se)+yt)},te&&te.type==="date"&&(Yt=g.encodeDate(Yt))),rt("path",P.path=M(wt,Ht,Yt))}else F?rt("xanchor",P.xanchor=re(ot+lt)):(rt("x0",P.x0=re(ct+lt)),rt("x1",P.x1=re(et+lt))),j?rt("yanchor",P.yanchor=Kt(X+yt)):(rt("y0",P.y0=Kt(st+yt)),rt("y1",P.y1=Kt(Z+yt)));_.attr("d",m(b,P)),Dt(D,P),r(b,z,P,Ct)}function de(lt,yt){if(G){var St=function(gn){return gn},Ht=St,Yt=St;F?rt("xanchor",P.xanchor=re(ot+lt)):(Ht=function(gn){return re(vt(gn)+lt)},It&&It.type==="date"&&(Ht=g.encodeDate(Ht))),j?rt("yanchor",P.yanchor=Kt(X+yt)):(Yt=function(gn){return Kt(Ut(gn)+yt)},te&&te.type==="date"&&(Yt=g.encodeDate(Yt))),rt("path",P.path=M(wt,Ht,Yt))}else if(N){if(Ce==="resize-over-start-point"){var se=ct+lt,ke=j?st-yt:st+yt;rt("x0",P.x0=F?se:re(se)),rt("y0",P.y0=j?ke:Kt(ke))}else if(Ce==="resize-over-end-point"){var Ee=et+lt,Ue=j?Z-yt:Z+yt;rt("x1",P.x1=F?Ee:re(Ee)),rt("y1",P.y1=j?Ue:Kt(Ue))}}else{var ir=function(gn){return Ce.indexOf(gn)!==-1},ar=ir("n"),Ye=ir("s"),Er=ir("w"),pn=ir("e"),dn=ar?Q+yt:Q,bn=Ye?ut+yt:ut,Zn=Er?J+lt:J,En=pn?q+lt:q;j&&(ar&&(dn=Q-yt),Ye&&(bn=ut-yt)),(!j&&bn-dn>I||j&&dn-bn>I)&&(rt(it,P[it]=j?dn:Kt(dn)),rt(nt,P[nt]=j?bn:Kt(bn))),En-Zn>R&&(rt(dt,P[dt]=F?Zn:re(Zn)),rt(Tt,P[Tt]=F?En:re(En)))}_.attr("d",m(b,P)),Dt(D,P),r(b,z,P,Ct)}function Dt(lt,yt){(F||j)&&St();function St(){var Ht=yt.type!=="path",Yt=lt.selectAll(".visual-cue").data([0]),se=1;Yt.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":se}).classed("visual-cue",!0);var ke=vt(F?yt.xanchor:E.midRange(Ht?[yt.x0,yt.x1]:g.extractPathCoords(yt.path,v.paramIsX))),Ee=Ut(j?yt.yanchor:E.midRange(Ht?[yt.y0,yt.y1]:g.extractPathCoords(yt.path,v.paramIsY)));if(ke=g.roundPositionForSharpStrokeRendering(ke,se),Ee=g.roundPositionForSharpStrokeRendering(Ee,se),F&&j){var Ue="M"+(ke-1-se)+","+(Ee-1-se)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Yt.attr("d",Ue)}else if(F){var ir="M"+(ke-1-se)+","+(Ee-9-se)+"v18 h2 v-18 Z";Yt.attr("d",ir)}else{var ar="M"+(ke-9-se)+","+(Ee-1-se)+"h18 v2 h-18 Z";Yt.attr("d",ar)}}}function qt(lt){lt.selectAll(".visual-cue").remove()}function _t(lt,yt,St){var Ht=yt.xref,Yt=yt.yref,se=A.getFromId(St,Ht),ke=A.getFromId(St,Yt),Ee="";Ht!=="paper"&&!se.autorange&&(Ee+=Ht),Yt!=="paper"&&!ke.autorange&&(Ee+=Yt),o.setClipUrl(lt,Ee?"clip"+St._fullLayout._uid+Ee:null,St)}}function M(b,_,P){return b.replace(v.segmentRE,function(z){var D=0,B=z.charAt(0),R=v.paramIsX[B],I=v.paramIsY[B],F=v.numParams[B],j=z.slice(1).replace(v.paramRE,function(N){return D>=F||(R[D]?N=_(N):I[D]&&(N=P(N)),D++),N});return B+j})}function T(b,_){if(x(b)){var P=_.node(),z=+P.getAttribute("data-index");if(z>=0){if(z===b._fullLayout._activeShapeIndex){c(b);return}b._fullLayout._activeShapeIndex=z,b._fullLayout._deactivateShape=c,w(b)}}}function c(b){if(x(b)){var _=b._fullLayout._activeShapeIndex;_>=0&&(i(b),delete b._fullLayout._activeShapeIndex,w(b))}}function h(b){if(x(b)){i(b);var _=b._fullLayout._activeShapeIndex,P=(b.layout||{}).shapes||[];if(_{var u=ji(),d=Uu(),E=cc(),A=Wy(),t=Xy().eraseActiveShape,e=Xr(),r=e._,i=V.exports={};i.toImage={name:"toImage",title:function(k){var M=k._context.toImageButtonOptions||{},T=M.format||"png";return T==="png"?r(k,"Download plot as a PNG"):r(k,"Download plot")},icon:A.camera,click:function(k){var M=k._context.toImageButtonOptions,T={format:M.format||"png"};e.notifier(r(k,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(c){c in M&&(T[c]=M[c])}),u.call("downloadImage",k,T).then(function(c){e.notifier(r(k,"Snapshot succeeded")+" - "+c,"long")}).catch(function(){e.notifier(r(k,"Sorry, there was a problem downloading your snapshot!"),"long")})}},i.sendDataToCloud={name:"sendDataToCloud",title:function(k){return r(k,"Edit in Chart Studio")},icon:A.disk,click:function(k){d.sendDataToCloud(k)}},i.editInChartStudio={name:"editInChartStudio",title:function(k){return r(k,"Edit in Chart Studio")},icon:A.pencil,click:function(k){d.sendDataToCloud(k)}},i.zoom2d={name:"zoom2d",_cat:"zoom",title:function(k){return r(k,"Zoom")},attr:"dragmode",val:"zoom",icon:A.zoombox,click:n},i.pan2d={name:"pan2d",_cat:"pan",title:function(k){return r(k,"Pan")},attr:"dragmode",val:"pan",icon:A.pan,click:n},i.select2d={name:"select2d",_cat:"select",title:function(k){return r(k,"Box Select")},attr:"dragmode",val:"select",icon:A.selectbox,click:n},i.lasso2d={name:"lasso2d",_cat:"lasso",title:function(k){return r(k,"Lasso Select")},attr:"dragmode",val:"lasso",icon:A.lasso,click:n},i.drawclosedpath={name:"drawclosedpath",title:function(k){return r(k,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:A.drawclosedpath,click:n},i.drawopenpath={name:"drawopenpath",title:function(k){return r(k,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:A.drawopenpath,click:n},i.drawline={name:"drawline",title:function(k){return r(k,"Draw line")},attr:"dragmode",val:"drawline",icon:A.drawline,click:n},i.drawrect={name:"drawrect",title:function(k){return r(k,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:A.drawrect,click:n},i.drawcircle={name:"drawcircle",title:function(k){return r(k,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:A.drawcircle,click:n},i.eraseshape={name:"eraseshape",title:function(k){return r(k,"Erase active shape")},icon:A.eraseshape,click:t},i.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(k){return r(k,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:n},i.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(k){return r(k,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:n},i.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(k){return r(k,"Autoscale")},attr:"zoom",val:"auto",icon:A.autoscale,click:n},i.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(k){return r(k,"Reset axes")},attr:"zoom",val:"reset",icon:A.home,click:n},i.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(k){return r(k,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:A.tooltip_basic,gravity:"ne",click:n},i.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(k){return r(k,"Compare data on hover")},attr:"hovermode",val:function(k){return k._fullLayout._isHoriz?"y":"x"},icon:A.tooltip_compare,gravity:"ne",click:n};function n(k,M){var T=M.currentTarget,c=T.getAttribute("data-attr"),h=T.getAttribute("data-val")||!0,b=k._fullLayout,_={},P=E.list(k,null,!0),z=b._cartesianSpikesEnabled,D,B;if(c==="zoom"){var R=h==="in"?.5:2,I=(1+R)/2,F=(1-R)/2,j,N;for(B=0;B{var u=Tb(),d=Object.keys(u),E=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],A=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(E),t=[],e=function(r){if(A.indexOf(r._cat||r.name)===-1){var i=r.name,n=(r._cat||r.name).toLowerCase();t.indexOf(i)===-1&&t.push(i),t.indexOf(n)===-1&&t.push(n)}};d.forEach(function(r){e(u[r])}),t.sort(),V.exports={DRAW_MODES:E,backButtons:A,foreButtons:t}}),Ab=Vt((K,V)=>{kb(),V.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),ik=Vt((K,V)=>{var u=Xr(),d=Pi(),E=cl(),A=Ab();V.exports=function(t,e){var r=t.modebar||{},i=E.newContainer(e,"modebar");function n(a,s){return u.coerce(r,i,A,a,s)}n("orientation"),n("bgcolor",d.addOpacity(e.paper_bgcolor,.5));var o=d.contrast(d.rgb(e.modebar.bgcolor));n("color",d.addOpacity(o,.3)),n("activecolor",d.addOpacity(o,.7)),n("uirevision",e.uirevision),n("add"),n("remove")}}),ok=Vt((K,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=Wy(),t=Py().version,e=new DOMParser;function r(a){this.container=a.container,this.element=document.createElement("div"),this.update(a.graphInfo,a.buttons),this.container.appendChild(this.element)}var i=r.prototype;i.update=function(a,s){this.graphInfo=a;var f=this.graphInfo._context,v=this.graphInfo._fullLayout,g="modebar-"+v._uid;this.element.setAttribute("id",g),this.element.setAttribute("role","toolbar"),this._uid=g,this.element.className="modebar modebar--custom",f.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),v.modebar.orientation==="v"&&(this.element.className+=" vertical",s=s.reverse());var m=v.modebar,w="#"+g+" .modebar-group";document.querySelectorAll(w).forEach(function(k){k.style.backgroundColor=m.bgcolor});var l=!this.hasButtons(s),x=this.hasLogo!==f.displaylogo,y=this.locale!==f.locale;if(this.locale=f.locale,(l||x||y)&&(this.removeAllButtons(),this.updateButtons(s),f.watermark||f.displaylogo)){var S=this.getLogo();f.watermark&&(S.className=S.className+" watermark"),v.modebar.orientation==="v"?this.element.insertBefore(S,this.element.childNodes[0]):this.element.appendChild(S),this.hasLogo=!0}this.updateActiveButton(),E.setStyleOnHover("#"+g+" .modebar-btn",".active",".icon path","fill: "+m.activecolor,"fill: "+m.color,this.element)},i.updateButtons=function(a){var s=this;this.buttons=a,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(f){var v=s.createGroup();f.forEach(function(g){var m=g.name;if(!m)throw new Error("must provide button 'name' in button config");if(s.buttonsNames.indexOf(m)!==-1)throw new Error("button name '"+m+"' is taken");s.buttonsNames.push(m);var w=s.createButton(g);s.buttonElements.push(w),v.appendChild(w)}),s.element.appendChild(v)})},i.createGroup=function(){var a=document.createElement("div");a.className="modebar-group";var s=this.graphInfo._fullLayout.modebar;return a.style.backgroundColor=s.bgcolor,a},i.createButton=function(a){var s=this,f=document.createElement("button");f.setAttribute("type","button"),f.setAttribute("rel","tooltip"),f.className="modebar-btn";var v=a.title;v===void 0?v=a.name:typeof v=="function"&&(v=v(this.graphInfo)),(v||v===0)&&(f.setAttribute("data-title",v),f.setAttribute("aria-label",v)),a.attr!==void 0&&f.setAttribute("data-attr",a.attr);var g=a.val;g!==void 0&&(typeof g=="function"&&(g=g(this.graphInfo)),f.setAttribute("data-val",g));var m=a.click;if(typeof m!="function")throw new Error("must provide button 'click' function in button config");f.addEventListener("click",function(l){a.click(s.graphInfo,l),s.updateActiveButton(l.currentTarget)}),f.setAttribute("data-toggle",a.toggle||!1),a.toggle&&u.select(f).classed("active",!0);var w=a.icon;return typeof w=="function"?f.appendChild(w()):f.appendChild(this.createIcon(w||A.question)),f.setAttribute("data-gravity",a.gravity||"n"),f},i.createIcon=function(a){var s=d(a.height)?Number(a.height):a.ascent-a.descent,f="http://www.w3.org/2000/svg",v;if(a.path){v=document.createElementNS(f,"svg"),v.setAttribute("viewBox",[0,0,a.width,s].join(" ")),v.setAttribute("class","icon");var g=document.createElementNS(f,"path");g.setAttribute("d",a.path),a.transform?g.setAttribute("transform",a.transform):a.ascent!==void 0&&g.setAttribute("transform","matrix(1 0 0 -1 0 "+a.ascent+")"),v.appendChild(g)}if(a.svg){var m=e.parseFromString(a.svg,"application/xml");v=m.childNodes[0]}return v.setAttribute("height","1em"),v.setAttribute("width","1em"),v},i.updateActiveButton=function(a){var s=this.graphInfo._fullLayout,f=a!==void 0?a.getAttribute("data-attr"):null;this.buttonElements.forEach(function(v){var g=v.getAttribute("data-val")||!0,m=v.getAttribute("data-attr"),w=v.getAttribute("data-toggle")==="true",l=u.select(v),x=function(k,M){var T=s.modebar,c=k.querySelector(".icon path");c&&(M||k.matches(":hover")?c.style.fill=T.activecolor:c.style.fill=T.color)};if(w){if(m===f){var y=!l.classed("active");l.classed("active",y),x(v,y)}}else{var S=m===null?m:E.nestedProperty(s,m).get();l.classed("active",S===g),x(v,S===g)}})},i.hasButtons=function(a){var s=this.buttons;if(!s||a.length!==s.length)return!1;for(var f=0;f{var u=cc(),d=nu(),E=ji(),A=mh().isUnifiedHover,t=ok(),e=Tb(),r=kb().DRAW_MODES,i=Xr().extendDeep;V.exports=function(g){var m=g._fullLayout,w=g._context,l=m._modeBar;if(!w.displayModeBar&&!w.watermark){l&&(l.destroy(),delete m._modeBar);return}if(!Array.isArray(w.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(w.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var x=w.modeBarButtons,y;Array.isArray(x)&&x.length?y=v(x):!w.displayModeBar&&w.watermark?y=[]:y=n(g),l?l.update(g,y):m._modeBar=t(g,y)};function n(g){var m=g._fullLayout,w=g._fullData,l=g._context;function x(q,it){if(typeof it=="string"){if(it.toLowerCase()===q.toLowerCase())return!0}else{var nt=it.name,dt=it._cat||it.name;if(nt===q||dt===q.toLowerCase())return!0}return!1}var y=m.modebar.add;typeof y=="string"&&(y=[y]);var S=m.modebar.remove;typeof S=="string"&&(S=[S]);var k=l.modeBarButtonsToAdd.concat(y.filter(function(q){for(var it=0;it1?(st=["toggleHover"],et=["resetViews"]):h?(ct=["zoomInGeo","zoomOutGeo"],st=["hoverClosestGeo"],et=["resetGeo"]):c?(st=["hoverClosest3d"],et=["resetCameraDefault3d","resetCameraLastSave3d"]):z?(ct=["zoomInMapbox","zoomOutMapbox"],st=["toggleHover"],et=["resetViewMapbox"]):D?(ct=["zoomInMap","zoomOutMap"],st=["toggleHover"],et=["resetViewMap"]):b?st=["hoverClosestPie"]:I?(st=["hoverClosestCartesian","hoverCompareCartesian"],et=["resetViewSankey"]):st=["toggleHover"],T&&st.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(w)||j)&&(st=[]),T&&!F&&(ct=["zoomIn2d","zoomOut2d","autoScale2d"],et[0]!=="resetViews"&&(et=["resetScale2d"])),c?Z=["zoom3d","pan3d","orbitRotation","tableRotation"]:T&&!F||P?Z=["zoom2d","pan2d"]:z||D||h?Z=["pan2d"]:B&&(Z=["zoom2d"]),a(w)&&Z.push("select2d","lasso2d");var ot=[],X=function(q){ot.indexOf(q)===-1&&st.indexOf(q)!==-1&&ot.push(q)};if(Array.isArray(k)){for(var Q=[],ut=0;ut{V.exports={moduleType:"component",name:"modebar",layoutAttributes:Ab(),supplyLayoutDefaults:ik(),manage:sk()}}),Sb=Vt((K,V)=>{var u=gf().FROM_BL;V.exports=function(d,E,A){A===void 0&&(A=u[d.constraintoward||"center"]);var t=[d.r2l(d.range[0]),d.r2l(d.range[1])],e=t[0]+(t[1]-t[0])*A;d.range=d._input.range=[d.l2r(e+(t[0]-e)*E),d.l2r(e+(t[1]-e)*E)],d.setScale()}}),u0=Vt(K=>{var V=Xr(),u=Xh(),d=cc().id2name,E=Of(),A=Sb(),t=mp(),e=ks().ALMOST_EQUAL,r=gf().FROM_BL;K.handleDefaults=function(g,m,w){var l=w.axIds,x=w.axHasImage,y=m._axisConstraintGroups=[],S=m._axisMatchGroups=[],k,M,T,c,h,b,_,P;for(k=0;ky?w.slice(y):l.slice(x))+S}function f(g,m){for(var w=m._size,l=w.h/w.w,x={},y=Object.keys(g),S=0;Se*_&&!B)){for(x=0;xet&&itct&&(ct=it);var dt=(ct-rt)/(2*st);c/=dt,rt=k.l2r(rt),ct=k.l2r(ct),k.range=k._input.range=j{var V=Ni(),u=ji(),d=Uu(),E=Xr(),A=Dl(),t=Bg(),e=Pi(),r=Eo(),i=l0(),n=Mb(),o=yo(),a=gf(),s=u0(),f=s.enforce,v=s.clean,g=Xh().doAutoRange,m="start",w="middle",l="end",x=Mf().zindexSeparator;K.layoutStyles=function(I){return E.syncOrAsync([d.doAutoMargin,S],I)};function y(I,F,j){for(var N=0;N=I[1]||G[1]<=I[0])&&rt[0]F[0])return!0}return!1}function S(I){var F=I._fullLayout,j=F._size,N=j.p,G=o.list(I,"",!0),rt,ct,st,et,Z,ot;if(F._paperdiv.style({width:I._context.responsive&&F.autosize&&!I._context._hasZeroWidth&&!I.layout.width?"100%":F.width+"px",height:I._context.responsive&&F.autosize&&!I._context._hasZeroHeight&&!I.layout.height?"100%":F.height+"px"}).selectAll(".main-svg").call(r.setSize,F.width,F.height),I._context.setBackground(I,F.paper_bgcolor),K.drawMainTitle(I),n.manage(I),!F._has("cartesian"))return d.previousPromises(I);function X(_t,lt,yt){var St=_t._lw/2;if(_t._id.charAt(0)==="x"){if(lt){if(yt==="top")return lt._offset-N-St}else return j.t+j.h*(1-(_t.position||0))+St%1;return lt._offset+lt._length+N+St}if(lt){if(yt==="right")return lt._offset+lt._length+N+St}else return j.l+j.w*(_t.position||0)+St%1;return lt._offset-N-St}for(rt=0;rt0){_(I,rt,Z,et),st.attr({x:ct,y:rt,"text-anchor":N,dy:D(F.yanchor)}).call(A.positionText,ct,rt);var ot=(F.text.match(A.BR_TAG_ALL)||[]).length;if(ot){var X=a.LINE_SPACING*ot+a.MID_SHIFT;F.y===0&&(X=-X),st.selectAll(".line").each(function(){var it=+this.getAttribute("dy").slice(0,-2)-X+"em";this.setAttribute("dy",it)})}var Q=V.select(I).selectAll(".gtitle-subtitle");if(Q.node()){var ut=st.node().getBBox(),J=ut.y+ut.height,q=J+i.SUBTITLE_PADDING_EM*F.subtitle.font.size;Q.attr({x:ct,y:q,"text-anchor":N,dy:D(F.yanchor)}).call(A.positionText,ct,q)}}}};function c(I,F,j,N,G){var rt=F.yref==="paper"?I._fullLayout._size.h:I._fullLayout.height,ct=E.isTopAnchor(F)?N:N-G,st=j==="b"?rt-ct:ct;return E.isTopAnchor(F)&&j==="t"||E.isBottomAnchor(F)&&j==="b"?!1:st.5?"t":"b",ct=I._fullLayout.margin[rt],st=0;return F.yref==="paper"?st=j+F.pad.t+F.pad.b:F.yref==="container"&&(st=h(rt,N,G,I._fullLayout.height,j)+F.pad.t+F.pad.b),st>ct?st:0}function _(I,F,j,N){var G="title.automargin",rt=I._fullLayout.title,ct=rt.y>.5?"t":"b",st={x:rt.x,y:rt.y,t:0,b:0},et={};rt.yref==="paper"&&c(I,rt,ct,F,N)?st[ct]=j:rt.yref==="container"&&(et[ct]=j,I._fullLayout._reservedMargin[G]=et),d.allowAutoMargin(I,G),d.autoMargin(I,G,st)}function P(I,F){var j=I.title,N=I._size,G=0;return(F===m?G=j.pad.l:F===l&&(G=-j.pad.r),j.xref)==="paper"?N.l+N.w*j.x+G:I.width*j.x+G}function z(I,F){var j=I.title,N=I._size,G=0;return F==="0em"||!F?G=-j.pad.b:F===a.CAP_SHIFT+"em"&&(G=j.pad.t),j.y==="auto"?N.t/2:j.yref==="paper"?N.t+N.h-N.h*j.y+G:I.height-I.height*j.y+G}function D(I){return I==="top"?a.CAP_SHIFT+.3+"em":I==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function B(I){var F=I.title,j=w;return E.isRightAnchor(F)?j=l:E.isLeftAnchor(F)&&(j=m),j}function R(I){var F=I.title,j="0em";return E.isTopAnchor(F)?j=a.CAP_SHIFT+"em":E.isMiddleAnchor(F)&&(j=a.MID_SHIFT+"em"),j}K.doTraceStyle=function(I){var F=I.calcdata,j=[],N;for(N=0;N{var u=Sd().readPaths,d=Yy(),E=Td().clearOutlineControllers,A=Pi(),t=Eo(),e=cl().arrayEditor,r=Ed(),i=r.getPathString;V.exports={draw:n,drawOne:a,activateLastSelection:v};function n(m){var w=m._fullLayout;E(m),w._selectionLayer.selectAll("path").remove();for(var l in w._plots){var x=w._plots[l].selectionLayer;x&&x.selectAll("path").remove()}for(var y=0;y=0;B--){var R=k.append("path").attr(T).style("opacity",B?.1:c).call(A.stroke,b).call(A.fill,h).call(t.dashLine,B?"solid":P,B?4+_:_);if(s(R,m,x),z){var I=e(m.layout,"selections",x);R.style({cursor:"move"});var F={element:R.node(),plotinfo:y,gd:m,editHelpers:I,isActiveSelection:!0},j=u(M,m);d(j,R,F)}else R.style("pointer-events",B?"all":"none");D[B]=R}var N=D[0],G=D[1];G.node().addEventListener("click",function(){return f(m,N)})}}function s(m,w,l){var x=l.xref+l.yref;t.setClipUrl(m,"clip"+w._fullLayout._uid+x,w)}function f(m,w){if(o(m)){var l=w.node(),x=+l.getAttribute("data-index");if(x>=0){if(x===m._fullLayout._activeSelectionIndex){g(m);return}m._fullLayout._activeSelectionIndex=x,m._fullLayout._deactivateSelection=g,n(m)}}}function v(m){if(o(m)){var w=m._fullLayout.selections.length-1;m._fullLayout._activeSelectionIndex=w,m._fullLayout._deactivateSelection=g,n(m)}}function g(m){if(o(m)){var w=m._fullLayout._activeSelectionIndex;w>=0&&(E(m),delete m._fullLayout._activeSelectionIndex,n(m))}}}),lk=Vt((K,V)=>{function u(){var d,E=0,A=!1;function t(e,r){return d.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),d}return d={list:[],segmentId:function(){return E++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,i){return t("temp_status",{seg:e,above:r,below:i})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,i){return t("status",{seg:e,above:r,below:i})},vert:function(e){return e===A?d:(A=e,t("vert",{x:e}))},log:function(e){return typeof e!="string"&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}},d}V.exports=u}),uk=Vt((K,V)=>{function u(d){typeof d!="number"&&(d=1e-10);var E={epsilon:function(A){return typeof A=="number"&&(d=A),d},pointAboveOrOnLine:function(A,t,e){var r=t[0],i=t[1],n=e[0],o=e[1],a=A[0],s=A[1];return(n-r)*(s-i)-(o-i)*(a-r)>=-d},pointBetween:function(A,t,e){var r=A[1]-t[1],i=e[0]-t[0],n=A[0]-t[0],o=e[1]-t[1],a=n*i+r*o;if(a-d)},pointsSameX:function(A,t){return Math.abs(A[0]-t[0])d!=n-r>d&&(i-s)*(r-f)/(n-f)+s-e>d&&(o=!o),i=s,n=f}return o}};return E}V.exports=u}),ck=Vt((K,V)=>{var u={create:function(){var d={root:{root:!0,next:null},exists:function(E){return!(E===null||E===d.root)},isEmpty:function(){return d.root.next===null},getHead:function(){return d.root.next},insertBefore:function(E,A){for(var t=d.root,e=d.root.next;e!==null;){if(A(e)){E.prev=e.prev,E.next=e,e.prev.next=E,e.prev=E;return}t=e,e=e.next}t.next=E,E.prev=t,E.next=null},findTransition:function(E){for(var A=d.root,t=d.root.next;t!==null&&!E(t);)A=t,t=t.next;return{before:A===d.root?null:A,after:t,insert:function(e){return e.prev=A,e.next=t,A.next=e,t!==null&&(t.prev=e),e}}}};return d},node:function(d){return d.prev=null,d.next=null,d.remove=function(){d.prev.next=d.next,d.next&&(d.next.prev=d.prev),d.prev=null,d.next=null},d}};V.exports=u}),fk=Vt((K,V)=>{var u=ck();function d(E,A,t){function e(w,l){return{id:t?t.segmentId():-1,start:w,end:l,myFill:{above:null,below:null},otherFill:null}}function r(w,l,x){return{id:t?t.segmentId():-1,start:w,end:l,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var i=u.create();function n(w,l,x,y,S,k){var M=A.pointsCompare(l,S);return M!==0?M:A.pointsSame(x,k)?0:w!==y?w?1:-1:A.pointAboveOrOnLine(x,y?S:k,y?k:S)?1:-1}function o(w,l){i.insertBefore(w,function(x){var y=n(w.isStart,w.pt,l,x.isStart,x.pt,x.other.pt);return y<0})}function a(w,l){var x=u.node({isStart:!0,pt:w.start,seg:w,primary:l,other:null,status:null});return o(x,w.end),x}function s(w,l,x){var y=u.node({isStart:!1,pt:l.end,seg:l,primary:x,other:w,status:null});w.other=y,o(y,w.pt)}function f(w,l){var x=a(w,l);return s(x,w,l),x}function v(w,l){t&&t.segmentChop(w.seg,l),w.other.remove(),w.seg.end=l,w.other.pt=l,o(w.other,w.pt)}function g(w,l){var x=r(l,w.seg.end,w.seg);return v(w,l),f(x,w.primary)}function m(w,l){var x=u.create();function y(R,I){var F=R.seg.start,j=R.seg.end,N=I.seg.start,G=I.seg.end;return A.pointsCollinear(F,N,G)?A.pointsCollinear(j,N,G)||A.pointAboveOrOnLine(j,N,G)?1:-1:A.pointAboveOrOnLine(F,N,G)?1:-1}function S(R){return x.findTransition(function(I){var F=y(R,I.ev);return F>0})}function k(R,I){var F=R.seg,j=I.seg,N=F.start,G=F.end,rt=j.start,ct=j.end;t&&t.checkIntersection(F,j);var st=A.linesIntersect(N,G,rt,ct);if(st===!1){if(!A.pointsCollinear(N,G,rt)||A.pointsSame(N,ct)||A.pointsSame(G,rt))return!1;var et=A.pointsSame(N,rt),Z=A.pointsSame(G,ct);if(et&&Z)return I;var ot=!et&&A.pointBetween(N,rt,ct),X=!Z&&A.pointBetween(G,rt,ct);if(et)return X?g(I,G):g(R,ct),I;ot&&(Z||(X?g(I,G):g(R,ct)),g(I,N))}else st.alongA===0&&(st.alongB===-1?g(R,rt):st.alongB===0?g(R,st.pt):st.alongB===1&&g(R,ct)),st.alongB===0&&(st.alongA===-1?g(I,N):st.alongA===0?g(I,st.pt):st.alongA===1&&g(I,G));return!1}for(var M=[];!i.isEmpty();){var T=i.getHead();if(t&&t.vert(T.pt[0]),T.isStart){let R=function(){if(h){var I=k(T,h);if(I)return I}return b?k(T,b):!1};t&&t.segmentNew(T.seg,T.primary);var c=S(T),h=c.before?c.before.ev:null,b=c.after?c.after.ev:null;t&&t.tempStatus(T.seg,h?h.seg:!1,b?b.seg:!1);var _=R();if(_){if(E){var P;T.seg.myFill.below===null?P=!0:P=T.seg.myFill.above!==T.seg.myFill.below,P&&(_.seg.myFill.above=!_.seg.myFill.above)}else _.seg.otherFill=T.seg.myFill;t&&t.segmentUpdate(_.seg),T.other.remove(),T.remove()}if(i.getHead()!==T){t&&t.rewind(T.seg);continue}if(E){var P;T.seg.myFill.below===null?P=!0:P=T.seg.myFill.above!==T.seg.myFill.below,b?T.seg.myFill.below=b.seg.myFill.above:T.seg.myFill.below=w,P?T.seg.myFill.above=!T.seg.myFill.below:T.seg.myFill.above=T.seg.myFill.below}else if(T.seg.otherFill===null){var z;b?T.primary===b.primary?z=b.seg.otherFill.above:z=b.seg.myFill.above:z=T.primary?l:w,T.seg.otherFill={above:z,below:z}}t&&t.status(T.seg,h?h.seg:!1,b?b.seg:!1),T.other.status=c.insert(u.node({ev:T}))}else{var D=T.status;if(D===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(D.prev)&&x.exists(D.next)&&k(D.prev.ev,D.next.ev),t&&t.statusRemove(D.ev.seg),D.remove(),!T.primary){var B=T.seg.myFill;T.seg.myFill=T.seg.otherFill,T.seg.otherFill=B}M.push(T.seg)}i.getHead().remove()}return t&&t.done(),M}return E?{addRegion:function(w){for(var l,x=w[w.length-1],y=0;y{function u(d,E,A){var t=[],e=[];return d.forEach(function(r){var i=r.start,n=r.end;if(E.pointsSame(i,n)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}A&&A.chainStart(r);var o={index:0,matches_head:!1,matches_pt1:!1},a={index:0,matches_head:!1,matches_pt1:!1},s=o;function f(z,D,B){return s.index=z,s.matches_head=D,s.matches_pt1=B,s===o?(s=a,!1):(s=null,!0)}for(var v=0;v{function u(E,A,t){var e=[];return E.forEach(function(r){var i=(r.myFill.above?8:0)+(r.myFill.below?4:0)+(r.otherFill&&r.otherFill.above?2:0)+(r.otherFill&&r.otherFill.below?1:0);A[i]!==0&&e.push({id:t?t.segmentId():-1,start:r.start,end:r.end,myFill:{above:A[i]===1,below:A[i]===2},otherFill:null})}),t&&t.selected(e),e}var d={union:function(E,A){return u(E,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],A)},intersect:function(E,A){return u(E,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],A)},difference:function(E,A){return u(E,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],A)},differenceRev:function(E,A){return u(E,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],A)},xor:function(E,A){return u(E,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],A)}};V.exports=d}),dk=Vt((K,V)=>{var u={toPolygon:function(d,E){function A(r){if(r.length<=0)return d.segments({inverted:!1,regions:[]});function i(a){var s=a.slice(0,a.length-1);return d.segments({inverted:!1,regions:[s]})}for(var n=i(r[0]),o=1;o{var u=lk(),d=uk(),E=fk(),A=hk(),t=pk(),e=dk(),r=!1,i=d(),n;n={buildLog:function(a){return a===!0?r=u():a===!1&&(r=!1),r===!1?!1:r.list},epsilon:function(a){return i.epsilon(a)},segments:function(a){var s=E(!0,i,r);return a.regions.forEach(s.addRegion),{segments:s.calculate(a.inverted),inverted:a.inverted}},combine:function(a,s){var f=E(!1,i,r);return{combined:f.calculate(a.segments,a.inverted,s.segments,s.inverted),inverted1:a.inverted,inverted2:s.inverted}},selectUnion:function(a){return{segments:t.union(a.combined,r),inverted:a.inverted1||a.inverted2}},selectIntersect:function(a){return{segments:t.intersect(a.combined,r),inverted:a.inverted1&&a.inverted2}},selectDifference:function(a){return{segments:t.difference(a.combined,r),inverted:a.inverted1&&!a.inverted2}},selectDifferenceRev:function(a){return{segments:t.differenceRev(a.combined,r),inverted:!a.inverted1&&a.inverted2}},selectXor:function(a){return{segments:t.xor(a.combined,r),inverted:a.inverted1!==a.inverted2}},polygon:function(a){return{regions:A(a.segments,i,r),inverted:a.inverted}},polygonFromGeoJSON:function(a){return e.toPolygon(n,a)},polygonToGeoJSON:function(a){return e.fromPolygon(n,i,a)},union:function(a,s){return o(a,s,n.selectUnion)},intersect:function(a,s){return o(a,s,n.selectIntersect)},difference:function(a,s){return o(a,s,n.selectDifference)},differenceRev:function(a,s){return o(a,s,n.selectDifferenceRev)},xor:function(a,s){return o(a,s,n.selectXor)}};function o(a,s,f){var v=n.segments(a),g=n.segments(s),m=n.combine(v,g),w=f(m);return n.polygon(w)}typeof window=="object"&&(window.PolyBool=n),V.exports=n}),gk=Vt((K,V)=>{V.exports=function(u,d,E,A){var t=u[0],e=u[1],r=!1;E===void 0&&(E=0),A===void 0&&(A=d.length);for(var i=A-E,n=0,o=i-1;ne!=v>e&&t<(f-a)*(e-s)/(v-s)+a;g&&(r=!r)}return r}}),jg=Vt((K,V)=>{var u=Fy().dot,d=ks().BADNUM,E=V.exports={};E.tester=function(A){var t=A.slice(),e=t[0][0],r=e,i=t[0][1],n=i,o;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),o=1;or||y===d||yn||l&&s(w))}function v(w,l){var x=w[0],y=w[1];if(x===d||xr||y===d||yn)return!1;var S=t.length,k=t[0][0],M=t[0][1],T=0,c,h,b,_,P;for(c=1;cMath.max(h,k)||y>Math.max(b,M)))if(yo||Math.abs(u(v,s))>r)return!0;return!1},E.filter=function(A,t){var e=[A[0]],r=0,i=0;function n(a){A.push(a);var s=e.length,f=r;e.splice(i+1);for(var v=f+1;v1){var o=A.pop();n(o)}return{addPt:n,raw:A,filtered:e}}}),vk=Vt((K,V)=>{V.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),yk=Vt((K,V)=>{var u=mk(),d=gk(),E=ji(),A=Eo().dashStyle,t=Pi(),e=hc(),r=mh().makeEventData,i=Jh(),n=i.freeMode,o=i.rectMode,a=i.drawMode,s=i.openMode,f=i.selectMode,v=Ed(),g=Rg(),m=Yy(),w=Td().clearOutline,l=Sd(),x=l.handleEllipse,y=l.readPaths,S=Ky().newShapes,k=bb(),M=Eb().activateLastSelection,T=Xr(),c=T.sorterAsc,h=jg(),b=jy(),_=cc().getFromId,P=Bg(),z=Ng().redrawReglTraces,D=vk(),B=D.MINSELECT,R=h.filter,I=h.tester,F=Zy(),j=F.p2r,N=F.axValue,G=F.getTransform;function rt(Dt){return Dt.subplot!==void 0}function ct(Dt,qt,_t,lt,yt){var St=!rt(lt),Ht=n(yt),Yt=o(yt),se=s(yt),ke=a(yt),Ee=f(yt),Ue=yt==="drawline",ir=yt==="drawcircle",ar=Ue||ir,Ye=lt.gd,Er=Ye._fullLayout,pn=Ee&&Er.newselection.mode==="immediate"&&St,dn=Er._zoomlayer,bn=lt.element.getBoundingClientRect(),Zn=lt.plotinfo,En=G(Zn),gn=qt-bn.left,da=_t-bn.top;Er._calcInverseTransform(Ye);var ra=T.apply3DTransform(Er._invTransform)(gn,da);gn=ra[0],da=ra[1];var Se=Er._invScaleX,Re=Er._invScaleY,Ze=gn,tr=da,zr="M"+gn+","+da,tn=lt.xaxes[0],Yr=lt.yaxes[0],$r=tn._length,In=Yr._length,Nn=Dt.altKey&&!(a(yt)&&se),Kn,$n,ia,Cn,Fa,Ga,ve;Q(Dt,Ye,lt),Ht&&(Kn=R([[gn,da]],D.BENDPX));var ge=dn.selectAll("path.select-outline-"+Zn.id).data([1]),dr=ke?Er.newshape:Er.newselection;ke&&(lt.hasText=dr.label.text||dr.label.texttemplate);var br=ke&&!se?dr.fillcolor:"rgba(0,0,0,0)",Tr=dr.line.color||(St?t.contrast(Ye._fullLayout.plot_bgcolor):"#7f7f7f");ge.enter().append("path").attr("class","select-outline select-outline-"+Zn.id).style({opacity:ke?dr.opacity/2:1,"stroke-dasharray":A(dr.line.dash,dr.line.width),"stroke-width":dr.line.width+"px","shape-rendering":"crispEdges"}).call(t.stroke,Tr).call(t.fill,br).attr("fill-rule","evenodd").classed("cursor-move",!!ke).attr("transform",En).attr("d",zr+"Z");var mr=dn.append("path").attr("class","zoombox-corners").style({fill:t.background,stroke:t.defaultLine,"stroke-width":1}).attr("transform",En).attr("d","M0,0Z");if(ke&<.hasText){var kr=dn.select(".label-temp");kr.empty()&&(kr=dn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Ur=Er._uid+D.SELECTID,Or=[],pe=nt(Ye,lt.xaxes,lt.yaxes,lt.subplot);pn&&!Dt.shiftKey&&(lt._clearSubplotSelections=function(){if(St){var xr=tn._id,Gr=Yr._id;Kt(Ye,xr,Gr,pe);for(var ln=(Ye.layout||{}).selections||[],wn=[],rn=!1,Qr=0;Qr=0){Ye._fullLayout._deactivateShape(Ye);return}if(!ke){var ln=Er.clickmode;b.done(Ur).then(function(){if(b.clear(Ur),xr===2){for(ge.remove(),Fa=0;Fa-1&&st(Gr,Ye,lt.xaxes,lt.yaxes,lt.subplot,lt,ge),ln==="event"&&Ir(Ye,void 0);e.click(Ye,Gr,Zn.id)}).catch(T.error)}},lt.doneFn=function(){mr.remove(),b.done(Ur).then(function(){b.clear(Ur),!pn&&Cn&<.selectionDefs&&(Cn.subtract=Nn,lt.selectionDefs.push(Cn),lt.mergedPolygons.length=0,[].push.apply(lt.mergedPolygons,ia)),(pn||ke)&&q(lt,pn),lt.doneFnCompleted&<.doneFnCompleted(Or),Ee&&Ir(Ye,ve)}).catch(T.error)}}function st(Dt,qt,_t,lt,yt,St,Ht){var Yt=qt._hoverdata,se=qt._fullLayout,ke=se.clickmode,Ee=ke.indexOf("event")>-1,Ue=[],ir,ar,Ye,Er,pn,dn,bn,Zn,En,gn;if(Tt(Yt)){Q(Dt,qt,St),ir=nt(qt,_t,lt,yt);var da=wt(Yt,ir),ra=da.pointNumbers.length>0;if(ra?It(ir,da):Nt(ir)&&(bn=Ct(da))){for(Ht&&Ht.remove(),gn=0;gn=0}function J(Dt){return Dt._fullLayout._activeSelectionIndex>=0}function q(Dt,qt){var _t=Dt.dragmode,lt=Dt.plotinfo,yt=Dt.gd;ut(yt)&&yt._fullLayout._deactivateShape(yt),J(yt)&&yt._fullLayout._deactivateSelection(yt);var St=yt._fullLayout,Ht=St._zoomlayer,Yt=a(_t),se=f(_t);if(Yt||se){var ke=Ht.selectAll(".select-outline-"+lt.id);if(ke&&yt._fullLayout._outlining){var Ee;Yt&&(Ee=S(ke,Dt)),Ee&&E.call("_guiRelayout",yt,{shapes:Ee});var Ue;se&&!rt(Dt)&&(Ue=k(ke,Dt)),Ue&&(yt._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",yt,{selections:Ue}).then(function(){qt&&M(yt)})),yt._fullLayout._outlining=!1}}lt.selection={},lt.selection.selectionDefs=Dt.selectionDefs=[],lt.selection.mergedPolygons=Dt.mergedPolygons=[]}function it(Dt){return Dt._id}function nt(Dt,qt,_t,lt){if(!Dt.calcdata)return[];var yt=[],St=qt.map(it),Ht=_t.map(it),Yt,se,ke;for(ke=0;ke0,St=yt?lt[0]:_t;return qt.selectedpoints?qt.selectedpoints.indexOf(St)>-1:!1}function It(Dt,qt){var _t=[],lt,yt,St,Ht;for(Ht=0;Ht0&&_t.push(lt);if(_t.length===1&&(St=_t[0]===qt.searchInfo,St&&(yt=qt.searchInfo.cd[0].trace,yt.selectedpoints.length===qt.pointNumbers.length))){for(Ht=0;Ht1||(qt+=lt.selectedpoints.length,qt>1)))return!1;return qt===1}function te(Dt,qt,_t){var lt;for(lt=0;lt-1&&qt;if(!Ht&&qt){var xr=Me(Dt,!0);if(xr.length){var Gr=xr[0].xref,ln=xr[0].yref;if(Gr&&ln){var wn=qe(xr),rn=_r([_(Dt,Gr,"x"),_(Dt,ln,"y")]);rn(Or,wn)}}Dt._fullLayout._noEmitSelectedAtStart?Dt._fullLayout._noEmitSelectedAtStart=!1:Ke&&Ir(Dt,Or),ir._reselect=!1}if(!Ht&&ir._deselect){var Qr=ir._deselect;Yt=Qr.xref,se=Qr.yref,re(Yt,se,Ee)||Kt(Dt,Yt,se,lt),Ke&&(Or.points.length?Ir(Dt,Or):de(Dt)),ir._deselect=!1}return{eventData:Or,selectionTesters:_t}}function Ut(Dt){var qt=Dt.calcdata;if(qt)for(var _t=0;_t{V.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),Ug=Vt((K,V)=>{V.exports={axisRefDescription:function(u,d,E){return["If set to a",u,"axis id (e.g. *"+u+"* or","*"+u+"2*), the `"+u+"` position refers to a",u,"coordinate. If set to *paper*, the `"+u+"`","position refers to the distance from the",d,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",d,"("+E+"). If set to a",u,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",d,"of the domain of that axis: e.g.,","*"+u+"2 domain* refers to the domain of the second",u," axis and a",u,"position of 0.5 refers to the","point between the",d,"and the",E,"of the domain of the","second",u,"axis."].join(" ")}}}),c0=Vt((K,V)=>{var u=zb(),d=yu(),E=Mf(),A=cl().templatedArray;Ug(),V.exports=A("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:d({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:u.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:u.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",E.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",E.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",E.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",E.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:d({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),gp=Vt((K,V)=>{V.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Qh=Vt((K,V)=>{V.exports=function(u){return{valType:"color",editType:"style",anim:!0}}}),pc=Vt((K,V)=>{var u=fc().axisHoverFormat,{hovertemplateAttrs:d,texttemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Wl(),e=yu(),r=If().dash,i=If().pattern,n=Eo(),o=gp(),a=So().extendFlat,s=Qh();function f(m){return{valType:"any",dflt:0,editType:"calc"}}function v(m){return{valType:"any",editType:"calc"}}function g(m){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}V.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:f(),yperiod:f(),xperiod0:v(),yperiod0:v(),xperiodalignment:g(),yperiodalignment:g(),xhoverformat:u("x"),yhoverformat:u("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:E(),texttemplatefallback:A({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:d({},{keys:o.eventDataKeys}),hovertemplatefallback:A(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:a({},r,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:s(!0),fillgradient:a({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:i,marker:a({symbol:{valType:"enumerated",values:n.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:a({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},t("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},t("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:e({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),Lb=Vt((K,V)=>{var u=c0(),d=pc().line,E=If().dash,A=So().extendFlat,t=Cu().overrideAll,e=cl().templatedArray;Ug(),V.exports=t(e("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:A({},u.xref,{}),yref:A({},u.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:d.color,width:A({},d.width,{min:1,dflt:1}),dash:A({},E,{dflt:"dot"})}}),"arraydraw","from-root")}),xk=Vt((K,V)=>{var u=Xr(),d=yo(),E=Gf(),A=Lb(),t=Ed();V.exports=function(r,i){E(r,i,{name:"selections",handleItemDefaults:e});for(var n=i.selections,o=0;o{V.exports=function(u,d,E){E("newselection.mode");var A=E("newselection.line.width");A&&(E("newselection.line.color"),E("newselection.line.dash")),E("activeselection.fillcolor"),E("activeselection.opacity")}}),Vg=Vt((K,V)=>{var u=ji(),d=Xr(),E=cc();V.exports=function(A){return function(t,e){var r=t[A];if(Array.isArray(r))for(var i=u.subplotsRegistry.cartesian,n=i.idRegex,o=e._subplots,a=o.xaxis,s=o.yaxis,f=o.cartesian,v=e._has("cartesian"),g=0;g{var u=Eb(),d=yk();V.exports={moduleType:"component",name:"selections",layoutAttributes:Lb(),supplyLayoutDefaults:xk(),supplyDrawNewSelectionDefaults:_k(),includeBasePlot:Vg()("selections"),draw:u.draw,drawOne:u.drawOne,reselect:d.reselect,prepSelect:d.prepSelect,clearOutline:d.clearOutline,clearSelectionsCache:d.clearSelectionsCache,selectOnClick:d.selectOnClick}}),Cb=Vt((K,V)=>{var u=Ni(),d=Xr(),E=d.numberFormat,A=Af(),t=Hy(),e=ji(),r=d.strTranslate,i=Dl(),n=Pi(),o=Eo(),a=hc(),s=yo(),f=$h(),v=oh(),g=Jh(),m=g.selectingOrDrawing,w=g.freeMode,l=gf().FROM_TL,x=Bg(),y=Ng().redrawReglTraces,S=Uu(),k=cc().getFromId,M=Sc().prepSelect,T=Sc().clearOutline,c=Sc().selectOnClick,h=Sb(),b=Mf(),_=b.MINDRAG,P=b.MINZOOM,z=!0;function D(dt,Tt,wt,Ct,It,Nt,te,Jt){var ee=dt._fullLayout._zoomlayer,Zt=te+Jt==="nsew",mt=(te+Jt).length===1,bt,vt,Ut,re,Kt,ue,Me,Ce,We,qe,vr,_r,er,Mr,Ir,de,Dt,qt,_t,lt,yt,St,Ht;wt+=Tt.yaxis._shift;function Yt(){if(bt=Tt.xaxis,vt=Tt.yaxis,We=bt._length,qe=vt._length,Me=bt._offset,Ce=vt._offset,Ut={},Ut[bt._id]=bt,re={},re[vt._id]=vt,te&&Jt)for(var ge=Tt.overlays,dr=0;dr=0){br._fullLayout._deactivateShape(br);return}var Tr=br._fullLayout.clickmode;if(ot(br),ge===2&&!mt&&$n(),Zt)Tr.indexOf("select")>-1&&c(dr,br,Kt,ue,Tt.id,Ee),Tr.indexOf("event")>-1&&a.click(br,dr,Tt.id);else if(ge===1&&mt){var mr=te?vt:bt,kr=te==="s"||Jt==="w"?0:1,Ur=mr._name+".range["+kr+"]",Or=F(mr,kr),pe="left",Ke="middle";if(mr.fixedrange)return;te?(Ke=te==="n"?"top":"bottom",mr.side==="right"&&(pe="right")):Jt==="e"&&(pe="right"),br._context.showAxisRangeEntryBoxes&&u.select(ke).call(i.makeEditable,{gd:br,immediate:!0,background:br._fullLayout.paper_bgcolor,text:String(Or),fill:mr.tickfont?mr.tickfont.color:"#444",horizontalAlign:pe,verticalAlign:Ke}).on("edit",function(xr){var Gr=mr.d2r(xr);Gr!==void 0&&e.call("_guiRelayout",br,Ur,Gr)})}}v.init(Ee);var ar,Ye,Er,pn,dn,bn,Zn,En,gn,da;function ra(ge,dr,br){var Tr=ke.getBoundingClientRect();ar=dr-Tr.left,Ye=br-Tr.top,dt._fullLayout._calcInverseTransform(dt);var mr=d.apply3DTransform(dt._fullLayout._invTransform)(ar,Ye);ar=mr[0],Ye=mr[1],Er={l:ar,r:ar,w:0,t:Ye,b:Ye,h:0},pn=dt._hmpixcount?dt._hmlumcount/dt._hmpixcount:A(dt._fullLayout.plot_bgcolor).getLuminance(),dn="M0,0H"+We+"V"+qe+"H0V0",bn=!1,Zn="xy",da=!1,En=ct(ee,pn,Me,Ce,dn),gn=st(ee,Me,Ce)}function Se(ge,dr){if(dt._transitioningWithDuration)return!1;var br=Math.max(0,Math.min(We,St*ge+ar)),Tr=Math.max(0,Math.min(qe,Ht*dr+Ye)),mr=Math.abs(br-ar),kr=Math.abs(Tr-Ye);Er.l=Math.min(ar,br),Er.r=Math.max(ar,br),Er.t=Math.min(Ye,Tr),Er.b=Math.max(Ye,Tr);function Ur(){Zn="",Er.r=Er.l,Er.t=Er.b,gn.attr("d","M0,0Z")}if(vr.isSubplotConstrained)mr>P||kr>P?(Zn="xy",mr/We>kr/qe?(kr=mr*qe/We,Ye>Tr?Er.t=Ye-kr:Er.b=Ye+kr):(mr=kr*We/qe,ar>br?Er.l=ar-mr:Er.r=ar+mr),gn.attr("d",J(Er))):Ur();else if(_r.isSubplotConstrained)if(mr>P||kr>P){Zn="xy";var Or=Math.min(Er.l/We,(qe-Er.b)/qe),pe=Math.max(Er.r/We,(qe-Er.t)/qe);Er.l=Or*We,Er.r=pe*We,Er.b=(1-Or)*qe,Er.t=(1-pe)*qe,gn.attr("d",J(Er))}else Ur();else!Mr||kr0){var xr;if(_r.isSubplotConstrained||!er&&Mr.length===1){for(xr=0;xr1&&(Ur.maxallowed!==void 0&&de===(Ur.range[0]1&&(Or.maxallowed!==void 0&&Dt===(Or.range[0]=0?Math.min(dt,.9):1/(1/Math.max(dt,-.3)+3.222))}function rt(dt,Tt,wt){return dt?dt==="nsew"?wt?"":Tt==="pan"?"move":"crosshair":dt.toLowerCase()+"-resize":"pointer"}function ct(dt,Tt,wt,Ct,It){return dt.append("path").attr("class","zoombox").style({fill:Tt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(wt,Ct)).attr("d",It+"Z")}function st(dt,Tt,wt){return dt.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Tt,wt)).attr("d","M0,0Z")}function et(dt,Tt,wt,Ct,It,Nt){dt.attr("d",Ct+"M"+wt.l+","+wt.t+"v"+wt.h+"h"+wt.w+"v-"+wt.h+"h-"+wt.w+"Z"),Z(dt,Tt,It,Nt)}function Z(dt,Tt,wt,Ct){wt||(dt.transition().style("fill",Ct>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Tt.transition().style("opacity",1).duration(200))}function ot(dt){u.select(dt).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function X(dt){z&&dt.data&&dt._context.showTips&&(d.notifier(d._(dt,"Double-click to zoom back out"),"long"),z=!1)}function Q(dt,Tt){return"M"+(dt.l-.5)+","+(Tt-P-.5)+"h-3v"+(2*P+1)+"h3ZM"+(dt.r+.5)+","+(Tt-P-.5)+"h3v"+(2*P+1)+"h-3Z"}function ut(dt,Tt){return"M"+(Tt-P-.5)+","+(dt.t-.5)+"v-3h"+(2*P+1)+"v3ZM"+(Tt-P-.5)+","+(dt.b+.5)+"v3h"+(2*P+1)+"v-3Z"}function J(dt){var Tt=Math.floor(Math.min(dt.b-dt.t,dt.r-dt.l,P)/2);return"M"+(dt.l-3.5)+","+(dt.t-.5+Tt)+"h3v"+-Tt+"h"+Tt+"v-3h-"+(Tt+3)+"ZM"+(dt.r+3.5)+","+(dt.t-.5+Tt)+"h-3v"+-Tt+"h"+-Tt+"v-3h"+(Tt+3)+"ZM"+(dt.r+3.5)+","+(dt.b+.5-Tt)+"h-3v"+Tt+"h"+-Tt+"v3h"+(Tt+3)+"ZM"+(dt.l-3.5)+","+(dt.b+.5-Tt)+"h3v"+Tt+"h"+Tt+"v3h-"+(Tt+3)+"Z"}function q(dt,Tt,wt,Ct,It){for(var Nt=!1,te={},Jt={},ee,Zt,mt,bt,vt=(It||{}).xaHash,Ut=(It||{}).yaHash,re=0;re{var V=Ni(),u=hc(),d=oh(),E=$h(),A=Cb().makeDragBox,t=Mf().DRAGGERSIZE;K.initInteractions=function(e){var r=e._fullLayout;if(e._context.staticPlot){V.select(e).selectAll(".drag").remove();return}if(!(!r._has("cartesian")&&!r._has("splom"))){var i=Object.keys(r._plots||{}).sort(function(o,a){if((r._plots[o].mainplot&&!0)===(r._plots[a].mainplot&&!0)){var s=o.split("y"),f=a.split("y");return s[0]===f[0]?Number(s[1]||1)-Number(f[1]||1):Number(s[0]||1)-Number(f[0]||1)}return r._plots[o].mainplot?1:-1});i.forEach(function(o){var a=r._plots[o],s=a.xaxis,f=a.yaxis;if(!a.mainplot){var v=A(e,a,s._offset,f._offset,s._length,f._length,"ns","ew");v.onmousemove=function(w){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===o&&e._fullLayout._plots[o]&&u.hover(e,w,o)},u.hover(e,w,o),e._fullLayout._lasthover=v,e._fullLayout._hoversubplot=o},v.onmouseout=function(w){e._dragging||(e._fullLayout._hoversubplot=null,d.unhover(e,w))},e._context.showAxisDragHandles&&(A(e,a,s._offset-t,f._offset-t,t,t,"n","w"),A(e,a,s._offset+s._length,f._offset-t,t,t,"n","e"),A(e,a,s._offset-t,f._offset+f._length,t,t,"s","w"),A(e,a,s._offset+s._length,f._offset+f._length,t,t,"s","e"))}if(e._context.showAxisDragHandles){if(o===s._mainSubplot){var g=s._mainLinePosition;s.side==="top"&&(g-=t),A(e,a,s._offset+s._length*.1,g,s._length*.8,t,"","ew"),A(e,a,s._offset,g,s._length*.1,t,"","w"),A(e,a,s._offset+s._length*.9,g,s._length*.1,t,"","e")}if(o===f._mainSubplot){var m=f._mainLinePosition;f.side!=="right"&&(m-=t),A(e,a,m,f._offset+f._length*.1,t,f._length*.8,"ns",""),A(e,a,m,f._offset+f._length*.9,t,f._length*.1,"s",""),A(e,a,m,f._offset,t,f._length*.1,"n","")}}});var n=r._hoverlayer.node();n.onmousemove=function(o){o.target=e._fullLayout._lasthover,u.hover(e,o,r._hoversubplot)},n.onclick=function(o){o.target=e._fullLayout._lasthover,u.click(e,o)},n.onmousedown=function(o){e._fullLayout._lasthover.onmousedown(o)},K.updateFx(e)}},K.updateFx=function(e){var r=e._fullLayout,i=r.dragmode==="pan"?"move":"crosshair";E(r._draggers,i)}}),bk=Vt((K,V)=>{var u=ji();V.exports=function(d){for(var E=u.layoutArrayContainers,A=u.layoutArrayRegexes,t=d.split("[")[0],e,r,i=0;i{var V=Dp(),u=Dy(),d=bd(),E=Ny().sorterAsc,A=ji();K.containerArrayMatch=bk();var t=K.isAddVal=function(r){return r==="add"||V(r)},e=K.isRemoveVal=function(r){return r===null||r==="remove"};K.applyContainerArrayChanges=function(r,i,n,o,a){var s=i.astr,f=A.getComponentMethod(s,"supplyLayoutDefaults"),v=A.getComponentMethod(s,"draw"),g=A.getComponentMethod(s,"drawOne"),m=o.replot||o.recalc||f===u||v===u,w=r.layout,l=r._fullLayout;if(n[""]){Object.keys(n).length>1&&d.warn("Full array edits are incompatible with other edits",s);var x=n[""][""];if(e(x))i.set(null);else if(Array.isArray(x))i.set(x);else return d.warn("Unrecognized full array edit value",s,x),!0;return m?!1:(f(w,l),v(r),!0)}var y=Object.keys(n).map(Number).sort(E),S=i.get(),k=S||[],M=a(l,s).get(),T=[],c=-1,h=k.length,b,_,P,z,D,B,R,I;for(b=0;bk.length-(R?0:1)){d.warn("index out of range",s,P);continue}if(B!==void 0)D.length>1&&d.warn("Insertion & removal are incompatible with edits to the same index.",s,P),e(B)?T.push(P):R?(B==="add"&&(B={}),k.splice(P,0,B),M&&M.splice(P,0,{})):d.warn("Unrecognized full object edit value",s,P,B),c===-1&&(c=P);else for(_=0;_=0;b--)k.splice(T[b],1),M&&M.splice(T[b],1);if(k.length?S||i.set(k):i.set(null),m)return!1;if(f(w,l),g!==u){var F;if(c===-1)F=y;else{for(h=Math.max(k.length,h),F=[],b=0;b=c));b++)F.push(P);for(b=c;b{var V=Lo(),u=ji(),d=Xr(),E=Uu(),A=cc(),t=Pi(),e=A.cleanId,r=A.getFromTrace,i=u.traceIs,n=["x","y","z"];K.clearPromiseQueue=function(l){Array.isArray(l._promises)&&l._promises.length>0&&d.log("Clearing previous rejected promises from queue."),l._promises=[]},K.cleanLayout=function(l){var x;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var y=(E.subplotsRegistry.cartesian||{}).attrRegex;(E.subplotsRegistry.polar||{}).attrRegex,(E.subplotsRegistry.ternary||{}).attrRegex,(E.subplotsRegistry.gl3d||{}).attrRegex;var S=Object.keys(l);for(x=0;x3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),t.clean(l),l.template&&l.template.layout&&K.cleanLayout(l.template.layout),l};function o(l,x){var y=l[x],S=x.charAt(0);y&&y!=="paper"&&(l[x]=e(y,S,!0))}K.cleanData=function(l){for(var x=0;x0)return l.slice(0,x)}K.hasParent=function(l,x){for(var y=m(x);y;){if(y in l)return!0;y=m(y)}return!1},K.clearAxisTypes=function(l,x,y){for(var S=0;S{let y=(...S)=>S.every(k=>d.isPlainObject(k))||S.every(k=>Array.isArray(k));if([l,x].every(S=>Array.isArray(S))){if(l.length!==x.length)return!1;for(let S=0;Sd.isPlainObject(S))){if(Object.keys(l).length!==Object.keys(x).length)return!1;for(let S in l){if(S.startsWith("_"))continue;let k=l[S],M=x[S];if(k!==M&&!(y(k,M)&&w(k,M)))return!1}return!0}return!1};K.collectionsAreEqual=w}),$y=Vt(K=>{var V=Ni(),u=Lo(),d=ib(),E=Xr(),A=E.nestedProperty,t=ym(),e=UT(),r=ji(),i=xm(),n=Uu(),o=yo(),a=pb(),s=Of(),f=Eo(),v=Pi(),g=Ib().initInteractions,m=Lh(),w=Sc().clearOutline,l=i0().dfltConfig,x=wk(),y=Tk(),S=Ng(),k=Cu(),M=Mf().AX_NAME_PATTERN,T=0,c=5;function h(_t,lt,yt,St){var Ht;if(_t=E.getGraphDiv(_t),t.init(_t),E.isPlainObject(lt)){var Yt=lt;lt=Yt.data,yt=Yt.layout,St=Yt.config,Ht=Yt.frames}var se=t.triggerHandler(_t,"plotly_beforeplot",[lt,yt,St]);if(se===!1)return Promise.reject();!lt&&!yt&&!E.isPlotDiv(_t)&&E.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",_t);function ke(){if(Ht)return K.addFrames(_t,Ht)}D(_t,St),yt||(yt={}),V.select(_t).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(_t._promises)||(_t._promises=[]);var Ee=(_t.data||[]).length===0&&Array.isArray(lt);Array.isArray(lt)&&(y.cleanData(lt),Ee?_t.data=lt:_t.data.push.apply(_t.data,lt),_t.empty=!1),(!_t.layout||Ee)&&(_t.layout=y.cleanLayout(yt)),n.supplyDefaults(_t);var Ue=_t._fullLayout,ir=Ue._has("cartesian");Ue._replotting=!0,(Ee||Ue._shouldCreateBgLayer)&&(qt(_t),Ue._shouldCreateBgLayer&&delete Ue._shouldCreateBgLayer),f.initGradients(_t),f.initPatterns(_t),Ee&&o.saveShowSpikeInitial(_t);var ar=!_t.calcdata||_t.calcdata.length!==(_t._fullData||[]).length;ar&&n.doCalcdata(_t);for(var Ye=0;Ye<_t.calcdata.length;Ye++)_t.calcdata[Ye][0].trace=_t._fullData[Ye];_t._context.responsive?_t._responsiveChartHandler||(_t._responsiveChartHandler=function(){E.isHidden(_t)||n.resize(_t)},window.addEventListener("resize",_t._responsiveChartHandler)):E.clearResponsive(_t);var Er=E.extendFlat({},Ue._size),pn=0;function dn(){for(var Re=Ue._basePlotModules,Ze=0;Ze=_t.data.length||Ht<-_t.data.length)throw new Error(yt+" must be valid indices for gd.data.");if(lt.indexOf(Ht,St+1)>-1||Ht>=0&<.indexOf(-_t.data.length+Ht)>-1||Ht<0&<.indexOf(_t.data.length+Ht)>-1)throw new Error("each index in "+yt+" must be unique.")}}function j(_t,lt,yt){if(!Array.isArray(_t.data))throw new Error("gd.data must be an array.");if(typeof lt>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(lt)||(lt=[lt]),F(_t,lt,"currentIndices"),typeof yt<"u"&&!Array.isArray(yt)&&(yt=[yt]),typeof yt<"u"&&F(_t,yt,"newIndices"),typeof yt<"u"&<.length!==yt.length)throw new Error("current and new indices must be of equal length.")}function N(_t,lt,yt){var St,Ht;if(!Array.isArray(_t.data))throw new Error("gd.data must be an array.");if(typeof lt>"u")throw new Error("traces must be defined.");for(Array.isArray(lt)||(lt=[lt]),St=0;St"u")throw new Error("indices must be an integer or array of integers");F(_t,yt,"indices");for(var Yt in lt){if(!Array.isArray(lt[Yt])||lt[Yt].length!==yt.length)throw new Error("attribute "+Yt+" must be an array of length equal to indices array length");if(Ht&&(!(Yt in St)||!Array.isArray(St[Yt])||St[Yt].length!==lt[Yt].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function rt(_t,lt,yt,St){var Ht=E.isPlainObject(St),Yt=[],se,ke,Ee,Ue,ir;Array.isArray(yt)||(yt=[yt]),yt=I(yt,_t.data.length-1);for(var ar in lt)for(var Ye=0;Ye=0&&ir=0&&ir"u")return Ue=K.redraw(_t),e.add(_t,Ht,se,Yt,ke),Ue;Array.isArray(yt)||(yt=[yt]);try{j(_t,St,yt)}catch(ir){throw _t.data.splice(_t.data.length-lt.length,lt.length),ir}return e.startSequence(_t),e.add(_t,Ht,se,Yt,ke),Ue=K.moveTraces(_t,St,yt),e.stopSequence(_t),Ue}function X(_t,lt){_t=E.getGraphDiv(_t);var yt=[],St=K.addTraces,Ht=X,Yt=[_t,yt,lt],se=[_t,lt],ke,Ee;if(typeof lt>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(lt)||(lt=[lt]),F(_t,lt,"indices"),lt=I(lt,_t.data.length-1),lt.sort(E.sorterDes),ke=0;ke"u")for(yt=[],Ue=0;Ue0&&typeof Ze.parts[tn]!="string";)tn--;var Yr=Ze.parts[tn],$r=Ze.parts[tn-1]+"."+Yr,In=Ze.parts.slice(0,tn).join("."),Nn=A(_t.layout,In).get(),Kn=A(St,In).get(),$n=Ze.get();if(tr!==void 0){Zn[Re]=tr,En[Re]=Yr==="reverse"?tr:J($n);var ia=i.getLayoutValObject(St,Ze.parts);if(ia&&ia.impliedEdits&&tr!==null)for(var Cn in ia.impliedEdits)gn(E.relativeAttr(Re,Cn),ia.impliedEdits[Cn]);if(["width","height"].indexOf(Re)!==-1)if(tr){gn("autosize",null);var Fa=Re==="height"?"width":"height";gn(Fa,St[Fa])}else St[Re]=_t._initialAutoSize[Re];else if(Re==="autosize")gn("width",tr?null:St.width),gn("height",tr?null:St.height);else if($r.match(It))Se($r),A(St,In+"._inputRange").set(null);else if($r.match(Nt)){Se($r),A(St,In+"._inputRange").set(null);var Ga=A(St,In).get();Ga._inputDomain&&(Ga._input.domain=Ga._inputDomain.slice())}else $r.match(te)&&A(St,In+"._inputDomain").set(null);if(Yr==="type"){ra=Nn;var ve=Kn.type==="linear"&&tr==="log",ge=Kn.type==="log"&&tr==="linear";if(ve||ge){if(!ra||!ra.range)gn(In+".autorange",!0);else if(Kn.autorange)ve&&(ra.range=ra.range[1]>ra.range[0]?[1,2]:[2,1]);else{var dr=ra.range[0],br=ra.range[1];ve?(dr<=0&&br<=0&&gn(In+".autorange",!0),dr<=0?dr=br/1e6:br<=0&&(br=dr/1e6),gn(In+".range[0]",Math.log(dr)/Math.LN10),gn(In+".range[1]",Math.log(br)/Math.LN10)):(gn(In+".range[0]",Math.pow(10,dr)),gn(In+".range[1]",Math.pow(10,br)))}Array.isArray(St._subplots.polar)&&St._subplots.polar.length&&St[Ze.parts[0]]&&Ze.parts[1]==="radialaxis"&&delete St[Ze.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(_t,Kn,tr,gn),r.getComponentMethod("images","convertCoords")(_t,Kn,tr,gn)}else gn(In+".autorange",!0),gn(In+".range",null);A(St,In+"._inputRange").set(null)}else if(Yr.match(M)){var Tr=A(St,Re).get(),mr=(tr||{}).type;(!mr||mr==="-")&&(mr="linear"),r.getComponentMethod("annotations","convertCoords")(_t,Tr,mr,gn),r.getComponentMethod("images","convertCoords")(_t,Tr,mr,gn)}var kr=x.containerArrayMatch(Re);if(kr){ir=kr.array,ar=kr.index;var Ur=kr.property,Or=ia||{editType:"calc"};ar!==""&&Ur===""&&(x.isAddVal(tr)?En[Re]=null:x.isRemoveVal(tr)?En[Re]=(A(yt,ir).get()||[])[ar]:E.warn("unrecognized full object value",lt)),k.update(bn,Or),Ue[ir]||(Ue[ir]={});var pe=Ue[ir][ar];pe||(pe=Ue[ir][ar]={}),pe[Ur]=tr,delete lt[Re]}else Yr==="reverse"?(Nn.range?Nn.range.reverse():(gn(In+".autorange",!0),Nn.range=[1,0]),Kn.autorange?bn.calc=!0:bn.plot=!0):(Re==="dragmode"&&(tr===!1&&$n!==!1||tr!==!1&&$n===!1)||St._has("scatter-like")&&St._has("regl")&&Re==="dragmode"&&(tr==="lasso"||tr==="select")&&!($n==="lasso"||$n==="select")?bn.plot=!0:ia?k.update(bn,ia):bn.calc=!0,Ze.set(tr))}}for(ir in Ue){var Ke=x.applyContainerArrayChanges(_t,Yt(yt,ir),Ue[ir],bn,Yt);Ke||(bn.plot=!0)}for(var xr in da){ra=o.getFromId(_t,xr);var Gr=ra&&ra._constraintGroup;if(Gr){bn.calc=!0;for(var ln in Gr)da[ln]||(o.getFromId(_t,ln)._constraintShrinkable=!0)}}(ee(_t)||lt.height||lt.width)&&(bn.plot=!0);var wn=St.shapes;for(ar=0;ar1;)if(St.pop(),yt=A(lt,St.join(".")+".uirevision").get(),yt!==void 0)return yt;return lt.uirevision}function Kt(_t,lt){for(var yt=0;yt[In,_t._ev.listeners(In)]);Yt=K.newPlot(_t,lt,yt,St).then(()=>{for(let[In,Nn]of $r)Nn.forEach(Kn=>_t.on(In,Kn));return K.react(_t,lt,yt,St)})}else{_t.data=lt||[],y.cleanData(_t.data),_t.layout=yt||{},y.cleanLayout(_t.layout),Ce(_t.data,_t.layout,ke,Ee),n.supplyDefaults(_t,{skipUpdateCalc:!0});var ar=_t._fullData,Ye=_t._fullLayout,Er=Ye.datarevision===void 0,pn=Ye.transition,dn=vr(_t,Ee,Ye,Er,pn),bn=dn.newDataRevision,Zn=qe(_t,ke,ar,Er,pn,bn);if(ee(_t)&&(dn.layoutReplot=!0),Zn.calc||dn.calc){_t.calcdata=void 0;for(var En=Object.getOwnPropertyNames(Ye),gn=0;gn(ir||_t.emit("plotly_react",{config:St,data:lt,layout:yt}),_t))}function qe(_t,lt,yt,St,Ht,Yt){var se=lt.length===yt.length;if(!Ht&&!se)return{fullReplot:!0,calc:!0};var ke=k.traceFlags();ke.arrays={},ke.nChanges=0,ke.nChangesAnim=0;var Ee,Ue;function ir(Er){var pn=i.getTraceValObject(Ue,Er);return!Ue._module.animatable&&pn.anim&&(pn.anim=!1),pn}var ar={getValObject:ir,flags:ke,immutable:St,transition:Ht,newDataRevision:Yt,gd:_t},Ye={};for(Ee=0;Ee=Ht.length?Ht[0]:Ht[Ue]:Ht}function ke(Ue){return Array.isArray(Yt)?Ue>=Yt.length?Yt[0]:Yt[Ue]:Yt}function Ee(Ue,ir){var ar=0;return function(){if(Ue&&++ar===ir)return Ue()}}return new Promise(function(Ue,ir){function ar(){if(St._frameQueue.length!==0){for(;St._frameQueue.length;){var Yr=St._frameQueue.pop();Yr.onInterrupt&&Yr.onInterrupt()}_t.emit("plotly_animationinterrupted",[])}}function Ye(Yr){if(Yr.length!==0){for(var $r=0;$rSt._timeToNext&&pn()};Yr()}var bn=0;function Zn(Yr){return Array.isArray(Ht)?bn>=Ht.length?Yr.transitionOpts=Ht[bn]:Yr.transitionOpts=Ht[0]:Yr.transitionOpts=Ht,bn++,Yr}var En,gn,da=[],ra=lt==null,Se=Array.isArray(lt),Re=!ra&&!Se&&E.isPlainObject(lt);if(Re)da.push({type:"object",data:Zn(E.extendFlat({},lt))});else if(ra||["string","number"].indexOf(typeof lt)!==-1)for(En=0;En0&&zrzr)&&tn.push(gn);da=tn}}da.length>0?Ye(da):(_t.emit("plotly_animated"),Ue())})}function Mr(_t,lt,yt){if(_t=E.getGraphDiv(_t),lt==null)return Promise.resolve();if(!E.isPlotDiv(_t))throw new Error("This element is not a Plotly plot: "+_t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var St,Ht,Yt,se,ke=_t._transitionData._frames,Ee=_t._transitionData._frameHash;if(!Array.isArray(lt))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+lt);var Ue=ke.length+lt.length*2,ir=[],ar={};for(St=lt.length-1;St>=0;St--)if(E.isPlainObject(lt[St])){var Ye=lt[St].name,Er=(Ee[Ye]||ar[Ye]||{}).name,pn=lt[St].name,dn=Ee[Er]||ar[Er];Er&&pn&&typeof pn=="number"&&dn&&TZe.index?-1:Re.index=0;St--){if(Ht=ir[St].frame,typeof Ht.name=="number"&&E.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Ht.name)for(;Ee[Ht.name="frame "+_t._transitionData._counter++];);if(Ee[Ht.name]){for(Yt=0;Yt=0;yt--)St=lt[yt],Yt.push({type:"delete",index:St}),se.unshift({type:"insert",index:St,value:Ht[St]});var ke=n.modifyFrames,Ee=n.modifyFrames,Ue=[_t,se],ir=[_t,Yt];return e&&e.add(_t,ke,Ue,Ee,ir),n.modifyFrames(_t,Yt)}function de(_t){_t=E.getGraphDiv(_t);var lt=_t._fullLayout||{},yt=_t._fullData||[];return n.cleanPlot([],{},yt,lt),n.purge(_t),t.purge(_t),lt._container&<._container.remove(),delete _t._context,_t}function Dt(_t){var lt=_t._fullLayout,yt=_t.getBoundingClientRect();if(!E.equalDomRects(yt,lt._lastBBox)){var St=lt._invTransform=E.inverseTransformMatrix(E.getFullTransformMatrix(_t));lt._invScaleX=Math.sqrt(St[0][0]*St[0][0]+St[0][1]*St[0][1]+St[0][2]*St[0][2]),lt._invScaleY=Math.sqrt(St[1][0]*St[1][0]+St[1][1]*St[1][1]+St[1][2]*St[1][2]),lt._lastBBox=yt}}function qt(_t){var lt=V.select(_t),yt=_t._fullLayout;if(yt._calcInverseTransform=Dt,yt._calcInverseTransform(_t),yt._container=lt.selectAll(".plot-container").data([0]),yt._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),yt._paperdiv=yt._container.selectAll(".svg-container").data([0]),yt._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),yt._glcontainer=yt._paperdiv.selectAll(".gl-container").data([{}]),yt._glcontainer.enter().append("div").classed("gl-container",!0),yt._paperdiv.selectAll(".main-svg").remove(),yt._paperdiv.select(".modebar-container").remove(),yt._paper=yt._paperdiv.insert("svg",":first-child").classed("main-svg",!0),yt._toppaper=yt._paperdiv.append("svg").classed("main-svg",!0),yt._modebardiv=yt._paperdiv.append("div"),delete yt._modeBar,yt._hoverpaper=yt._paperdiv.append("svg").classed("main-svg",!0),!yt._uid){var St={};V.selectAll("defs").each(function(){this.id&&(St[this.id.split("-")[1]]=1)}),yt._uid=E.randstr(St)}yt._paperdiv.selectAll(".main-svg").attr(m.svgAttrs),yt._defs=yt._paper.append("defs").attr("id","defs-"+yt._uid),yt._clips=yt._defs.append("g").classed("clips",!0),yt._topdefs=yt._toppaper.append("defs").attr("id","topdefs-"+yt._uid),yt._topclips=yt._topdefs.append("g").classed("clips",!0),yt._bgLayer=yt._paper.append("g").classed("bglayer",!0),yt._draggers=yt._paper.append("g").classed("draglayer",!0);var Ht=yt._paper.append("g").classed("layer-below",!0);yt._imageLowerLayer=Ht.append("g").classed("imagelayer",!0),yt._shapeLowerLayer=Ht.append("g").classed("shapelayer",!0),yt._cartesianlayer=yt._paper.append("g").classed("cartesianlayer",!0),yt._polarlayer=yt._paper.append("g").classed("polarlayer",!0),yt._smithlayer=yt._paper.append("g").classed("smithlayer",!0),yt._ternarylayer=yt._paper.append("g").classed("ternarylayer",!0),yt._geolayer=yt._paper.append("g").classed("geolayer",!0),yt._funnelarealayer=yt._paper.append("g").classed("funnelarealayer",!0),yt._pielayer=yt._paper.append("g").classed("pielayer",!0),yt._iciclelayer=yt._paper.append("g").classed("iciclelayer",!0),yt._treemaplayer=yt._paper.append("g").classed("treemaplayer",!0),yt._sunburstlayer=yt._paper.append("g").classed("sunburstlayer",!0),yt._indicatorlayer=yt._toppaper.append("g").classed("indicatorlayer",!0),yt._glimages=yt._paper.append("g").classed("glimages",!0);var Yt=yt._toppaper.append("g").classed("layer-above",!0);yt._imageUpperLayer=Yt.append("g").classed("imagelayer",!0),yt._shapeUpperLayer=Yt.append("g").classed("shapelayer",!0),yt._selectionLayer=yt._toppaper.append("g").classed("selectionlayer",!0),yt._infolayer=yt._toppaper.append("g").classed("infolayer",!0),yt._menulayer=yt._toppaper.append("g").classed("menulayer",!0),yt._zoomlayer=yt._toppaper.append("g").classed("zoomlayer",!0),yt._hoverlayer=yt._hoverpaper.append("g").classed("hoverlayer",!0),yt._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),_t.emit("plotly_framework")}K.animate=er,K.addFrames=Mr,K.deleteFrames=Ir,K.addTraces=ot,K.deleteTraces=X,K.extendTraces=et,K.moveTraces=Q,K.prependTraces=Z,K.newPlot=R,K._doPlot=h,K.purge=de,K.react=We,K.redraw=B,K.relayout=Tt,K.restyle=ut,K.setPlotConfig=_,K.update=Zt,K._guiRelayout=mt(Tt),K._guiRestyle=mt(ut),K._guiUpdate=mt(Zt),K._storeDirectGUIEdit=nt}),Fp=Vt(K=>{var V=ji();K.getDelay=function(E){return E._has&&(E._has("gl3d")||E._has("mapbox")||E._has("map"))?500:0},K.getRedrawFunc=function(E){return function(){V.getComponentMethod("colorbar","draw")(E)}},K.encodeSVG=function(E){return"data:image/svg+xml,"+encodeURIComponent(E)},K.encodeJSON=function(E){return"data:application/json,"+encodeURIComponent(E)};var u=window.URL||window.webkitURL;K.createObjectURL=function(E){return u.createObjectURL(E)},K.revokeObjectURL=function(E){return u.revokeObjectURL(E)},K.createBlob=function(E,A){if(A==="svg")return new window.Blob([E],{type:"image/svg+xml;charset=utf-8"});if(A==="full-json")return new window.Blob([E],{type:"application/json;charset=utf-8"});var t=d(window.atob(E));return new window.Blob([t],{type:"image/"+A})},K.octetStream=function(E){document.location.href="data:application/octet-stream"+E};function d(E){for(var A=E.length,t=new ArrayBuffer(A),e=new Uint8Array(t),r=0;r{var u=Ni();Xr();var d=Eo(),E=Pi();Lh();var A=/"/g,t="TOBESTRIPPED",e=new RegExp('("'+t+")|("+t+'")',"g");function r(n){var o=u.select("body").append("div").style({display:"none"}).html(""),a=n.replace(/(&[^;]*;)/gi,function(s){return s==="<"?"<":s==="&rt;"?">":s.indexOf("<")!==-1||s.indexOf(">")!==-1?"":o.html(s).text()});return o.remove(),a}function i(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}V.exports=function(n,o,a){var s=n._fullLayout,f=s._paper,v=s._toppaper,g=s.width,m=s.height,w;f.insert("rect",":first-child").call(d.setRect,0,0,g,m).call(E.fill,s.paper_bgcolor);var l=s._basePlotModules||[];for(w=0;w{var u=Xr(),d=o0().EventEmitter,E=Fp();function A(t){var e=t.emitter||new d,r=new Promise(function(i,n){var o=window.Image,a=t.svg,s=t.format||"png",f=t.canvas,v=t.scale||1,g=t.width||300,m=t.height||150,w=v*g,l=v*m,x=f.getContext("2d",{willReadFrequently:!0}),y=new o,S,k;s==="svg"||u.isSafari()?k=E.encodeSVG(a):(S=E.createBlob(a,"svg"),k=E.createObjectURL(S)),f.width=w,f.height=l,y.onload=function(){var M;switch(S=null,E.revokeObjectURL(k),s!=="svg"&&x.drawImage(y,0,0,w,l),s){case"jpeg":M=f.toDataURL("image/jpeg");break;case"png":M=f.toDataURL("image/png");break;case"webp":M=f.toDataURL("image/webp");break;case"svg":M=k;break;default:var T="Image format is not jpeg, png, svg or webp.";if(n(new Error(T)),!t.promise)return e.emit("error",T)}i(M),t.promise||e.emit("success",M)},y.onerror=function(M){if(S=null,E.revokeObjectURL(k),n(M),!t.promise)return e.emit("error",M)},y.src=k});return t.promise?r:e}V.exports=A}),Pb=Vt((K,V)=>{var u=Lo(),d=$y(),E=Uu(),A=Xr(),t=Fp(),e=Jy(),r=Qy(),i=Py().version,n={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function o(a,s){s=s||{};var f,v,g,m;A.isPlainObject(a)?(f=a.data||[],v=a.layout||{},g=a.config||{},m={}):(a=A.getGraphDiv(a),f=A.extendDeep([],a.data),v=A.extendDeep({},a.layout),g=a._context,m=a._fullLayout||{});function w(R){return!(R in s)||A.validate(s[R],n[R])}if(!w("width")&&s.width!==null||!w("height")&&s.height!==null)throw new Error("Height and width should be pixel values.");if(!w("format"))throw new Error("Export format is not "+A.join2(n.format.values,", "," or ")+".");var l={};function x(R,I){return A.coerce(s,l,n,R,I)}var y=x("format"),S=x("width"),k=x("height"),M=x("scale"),T=x("setBackground"),c=x("imageDataOnly"),h=document.createElement("div");h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var b=A.extendFlat({},v);S?b.width=S:s.width===null&&u(m.width)&&(b.width=m.width),k?b.height=k:s.height===null&&u(m.height)&&(b.height=m.height);var _=A.extendFlat({},g,{_exportedPlot:!0,staticPlot:!0,setBackground:T}),P=t.getRedrawFunc(h);function z(){return new Promise(function(R){setTimeout(R,t.getDelay(h._fullLayout))})}function D(){return new Promise(function(R,I){var F=e(h,y,M),j=h._fullLayout.width,N=h._fullLayout.height;function G(){d.purge(h),document.body.removeChild(h)}if(y==="full-json"){var rt=E.graphJson(h,!1,"keepdata","object",!0,!0);return rt.version=i,rt=JSON.stringify(rt),G(),R(c?rt:t.encodeJSON(rt))}if(G(),y==="svg")return R(c?F:t.encodeSVG(F));var ct=document.createElement("canvas");ct.id=A.randstr(),r({format:y,width:j,height:N,scale:M,canvas:ct,svg:F,promise:!0}).then(R).catch(I)})}function B(R){return c?R.replace(t.IMAGE_URL_PREFIX,""):R}return new Promise(function(R,I){d.newPlot(h,f,b,_).then(P).then(z).then(D).then(function(F){R(B(F))}).catch(function(F){I(F)})})}V.exports=o}),kk=Vt((K,V)=>{var u=Xr(),d=Uu(),E=xm(),A=i0().dfltConfig,t=u.isPlainObject,e=Array.isArray,r=u.isArrayOrTypedArray;V.exports=function(l,x){l===void 0&&(l=[]),x===void 0&&(x={});var y=E.get(),S=[],k={_context:u.extendFlat({},A)},M,T;e(l)?(k.data=u.extendDeep([],l),M=l):(k.data=[],M=[],S.push(s("array","data"))),t(x)?(k.layout=u.extendDeep({},x),T=x):(k.layout={},T={},arguments.length>1&&S.push(s("object","layout"))),d.supplyDefaults(k);for(var c=k._fullData,h=M.length,b=0;bP.length&&S.push(s("unused",k,b.concat(P.length)));var F=P.length,j=Array.isArray(I);j&&(F=Math.min(F,I.length));var N,G,rt,ct,st;if(z.dimensions===2)for(G=0;GP[G].length&&S.push(s("unused",k,b.concat(G,P[G].length)));var et=P[G].length;for(N=0;N<(j?Math.min(et,I[G].length):et);N++)rt=j?I[G][N]:I,ct=_[G][N],st=P[G][N],u.validate(ct,rt)?st!==ct&&st!==+ct&&S.push(s("dynamic",k,b.concat(G,N),ct,st)):S.push(s("value",k,b.concat(G,N),ct))}else S.push(s("array",k,b.concat(G),_[G]));else for(G=0;G{var u=Xr(),d=Fp();function E(A,t,e){var r=document.createElement("a"),i="download"in r,n=new Promise(function(o,a){var s,f;if(i)return s=d.createBlob(A,e),f=d.createObjectURL(s),r.href=f,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),d.revokeObjectURL(f),s=null,o(t);if(u.isSafari()){var v=e==="svg"?",":";base64,";return d.octetStream(v+encodeURIComponent(A)),o(t)}a(new Error("download error"))});return n}V.exports=E}),Ob=Vt((K,V)=>{var u=Xr(),d=Pb(),E=Ak();Fp();function A(t,e){var r;return u.isPlainObject(t)||(r=u.getGraphDiv(t)),e=e||{},e.format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(i,n){r&&r._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),r&&(r._snapshotInProgress=!0);var o=d(t,e),a=e.filename||t.fn||"newplot";a+="."+e.format.replace("-","."),o.then(function(s){return r&&(r._snapshotInProgress=!1),E(s,a,e.format)}).then(function(s){i(s)}).catch(function(s){r&&(r._snapshotInProgress=!1),n(s)})})}V.exports=A}),Mk=Vt(K=>{var V=Xr(),u=V.isPlainObject,d=xm(),E=Uu(),A=kl(),t=cl(),e=i0().dfltConfig;K.makeTemplate=function(g){g=V.isPlainObject(g)?g:V.getGraphDiv(g),g=V.extendDeep({_context:e},{data:g.data,layout:g.layout}),E.supplyDefaults(g);var m=g.data||[],w=g.layout||{};w._basePlotModules=g._fullLayout._basePlotModules,w._modules=g._fullLayout._modules;var l={data:{},layout:{}};m.forEach(function(_){var P={};n(_,P,a.bind(null,_));var z=V.coerce(_,{},A,"type"),D=l.data[z];D||(D=l.data[z]=[]),D.push(P)}),n(w,l.layout,o.bind(null,w)),delete l.layout.template;var x=w.template;if(u(x)){var y=x.layout,S,k,M,T,c,h;u(y)&&r(y,l.layout);var b=x.data;if(u(b)){for(k in l.data)if(M=b[k],Array.isArray(M)){for(c=l.data[k],h=c.length,T=M.length,S=0;SB?S.push({code:"unused",traceType:_,templateCount:D,dataCount:B}):B>D&&S.push({code:"reused",traceType:_,templateCount:D,dataCount:B})}}function R(I,F){for(var j in I)if(j.charAt(0)!=="_"){var N=I[j],G=s(I,j,F);u(N)?(Array.isArray(I)&&N._template===!1&&N.templateitemname&&S.push({code:"missing",path:G,templateitemname:N.templateitemname}),R(N,G)):Array.isArray(N)&&f(N)&&R(N,G)}}if(R({data:M,layout:k},""),S.length)return S.map(v)};function f(g){for(var m=0;m{var V=$y();K._doPlot=V._doPlot,K.newPlot=V.newPlot,K.restyle=V.restyle,K.relayout=V.relayout,K.redraw=V.redraw,K.update=V.update,K._guiRestyle=V._guiRestyle,K._guiRelayout=V._guiRelayout,K._guiUpdate=V._guiUpdate,K._storeDirectGUIEdit=V._storeDirectGUIEdit,K.react=V.react,K.extendTraces=V.extendTraces,K.prependTraces=V.prependTraces,K.addTraces=V.addTraces,K.deleteTraces=V.deleteTraces,K.moveTraces=V.moveTraces,K.purge=V.purge,K.addFrames=V.addFrames,K.deleteFrames=V.deleteFrames,K.animate=V.animate,K.setPlotConfig=V.setPlotConfig;var u=Ig().getGraphDiv,d=Xy().eraseActiveShape;K.deleteActiveShape=function(A){return d(u(A))},K.toImage=Pb(),K.validate=kk(),K.downloadImage=Ob();var E=Mk();K.makeTemplate=E.makeTemplate,K.validateTemplate=E.validateTemplate}),km=Vt((K,V)=>{var u=Xr(),d=ji();V.exports=function(E,A,t,e){var r=e("x"),i=e("y"),n,o=d.getComponentMethod("calendars","handleTraceDefaults");if(o(E,A,["x","y"],t),r){var a=u.minRowLength(r);i?n=Math.min(a,u.minRowLength(i)):(n=a,e("y0"),e("dy"))}else{if(!i)return 0;n=u.minRowLength(i),e("x0"),e("dx")}return A._length=n,n}}),tp=Vt((K,V)=>{var u=Xr().dateTick0,d=ks(),E=d.ONEWEEK;function A(t,e){return t%E===0?u(e,1):u(e,0)}V.exports=function(t,e,r,i,n){if(n||(n={x:!0,y:!0}),n.x){var o=i("xperiod");o&&(i("xperiod0",A(o,e.xcalendar)),i("xperiodalignment"))}if(n.y){var a=i("yperiod");a&&(i("yperiod0",A(a,e.ycalendar)),i("yperiodalignment"))}}}),Ek=Vt((K,V)=>{var u=["orientation","groupnorm","stackgaps"];V.exports=function(d,E,A,t){var e=A._scatterStackOpts,r=t("stackgroup");if(r){var i=E.xaxis+E.yaxis,n=e[i];n||(n=e[i]={});var o=n[r],a=!1;o?o.traces.push(E):(o=n[r]={traceIndices:[],traces:[E]},a=!0);for(var s={orientation:E.x&&!E.y?"h":"v"},f=0;f{var u=Pi(),d=ah().hasColorscale,E=vf(),A=nu();V.exports=function(t,e,r,i,n,o){var a=A.isBubble(t),s=(t.line||{}).color,f;if(o=o||{},s&&(r=s),n("marker.symbol"),n("marker.opacity",a?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",r),d(t,"marker")&&E(t,e,i,n,{prefix:"marker.",cLetter:"c"}),o.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),o.noLine||(s&&!Array.isArray(s)&&e.marker.color!==s?f=s:a?f=u.background:f=u.defaultLine,n("marker.line.color",f),d(t,"marker.line")&&E(t,e,i,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",a?1:0)),a&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var v=n("marker.gradient.type");v!=="none"&&n("marker.gradient.color")}}}),Rh=Vt((K,V)=>{var u=Xr().isArrayOrTypedArray,d=ah().hasColorscale,E=vf();V.exports=function(A,t,e,r,i,n){n||(n={});var o=(A.marker||{}).color;if(o&&o._inputArray&&(o=o._inputArray),i("line.color",e),d(A,"line"))E(A,t,r,i,{prefix:"line.",cLetter:"c"});else{var a=(u(o)?!1:o)||e;i("line.color",a)}i("line.width"),n.noDash||i("line.dash"),n.backoff&&i("line.backoff")}}),Am=Vt((K,V)=>{V.exports=function(u,d,E){var A=E("line.shape");A==="spline"&&E("line.smoothing")}}),Nh=Vt((K,V)=>{var u=Xr();V.exports=function(d,E,A,t,e){e=e||{},t("textposition"),u.coerceFont(t,"textfont",e.font||A.font,e),e.noSelect||(t("selected.textfont.color"),t("unselected.textfont.color"))}}),ep=Vt((K,V)=>{var u=Pi(),d=Xr().isArrayOrTypedArray;function E(A){for(var t=u.interpolate(A[0][1],A[1][1],.5),e=2;e{var u=Xr(),d=ji(),E=pc(),A=gp(),t=nu(),e=km(),r=tp(),i=Ek(),n=Ch(),o=Rh(),a=Am(),s=Nh(),f=ep(),v=Xr().coercePattern;V.exports=function(g,m,w,l){function x(b,_){return u.coerce(g,m,E,b,_)}var y=e(g,m,l,x);if(y||(m.visible=!1),!!m.visible){r(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder");var S=i(g,m,l,x);l.scattermode==="group"&&m.orientation===void 0&&x("orientation","v");var k=!S&&y{var u=u0().getAxisGroup;V.exports=function(d,E,A,t,e){var r=E.orientation,i=E[{v:"x",h:"y"}[r]+"axis"],n=u(A,i)+r,o=A._alignmentOpts||{},a=t("alignmentgroup"),s=o[n];s||(s=o[n]={});var f=s[a];f?f.traces.push(E):f=s[a]={traces:[E],alignmentIndex:Object.keys(s).length,offsetGroups:{}};var v=t("offsetgroup")||"",g=f.offsetGroups,m=g[v];E._offsetIndex=0,(e!=="group"||v)&&(m||(m=g[v]={offsetIndex:Object.keys(g).length}),E._offsetIndex=m.offsetIndex)}}),Db=Vt((K,V)=>{var u=Xr(),d=f0(),E=pc();V.exports=function(A,t){var e,r,i,n=t.scattermode;function o(g){return u.coerce(r._input,r,E,g)}if(t.scattermode==="group")for(i=0;i=0;f--){var v=A[f];if(v.type==="scatter"&&v.xaxis===a.xaxis&&v.yaxis===a.yaxis){v.opacity=void 0;break}}}}}}),Lk=Vt((K,V)=>{var u=Xr(),d=Uy();V.exports=function(E,A){function t(r,i){return u.coerce(E,A,d,r,i)}var e=A.barmode==="group";A.scattermode==="group"&&t("scattergap",e?A.bargap:.2)}}),rp=Vt((K,V)=>{var u=Lo(),d=Xr(),E=d.dateTime2ms,A=d.incrementMonth,t=ks(),e=t.ONEAVGMONTH;V.exports=function(r,i,n,o){if(i.type!=="date")return{vals:o};var a=r[n+"periodalignment"];if(!a)return{vals:o};var s=r[n+"period"],f;if(u(s)){if(s=+s,s<=0)return{vals:o}}else if(typeof s=="string"&&s.charAt(0)==="M"){var v=+s.substring(1);if(v>0&&Math.round(v)===v)f=v;else return{vals:o}}for(var g=i.calendar,m=a==="start",w=a==="end",l=r[n+"period0"],x=E(l,g)||0,y=[],S=[],k=[],M=o.length,T=0;Tc;)_=A(_,-f,g);for(;_<=c;)_=A(_,f,g);b=A(_,-f,g)}else{for(h=Math.round((c-x)/s),_=x+h*s;_>c;)_-=s;for(;_<=c;)_+=s;b=_-s}y[T]=m?b:w?_:(b+_)/2,S[T]=b,k[T]=_}return{vals:y,starts:S,ends:k}}}),jh=Vt((K,V)=>{var u=ah().hasColorscale,d=ih(),E=nu();V.exports=function(A,t){E.hasLines(t)&&u(t,"line")&&d(A,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),E.hasMarkers(t)&&(u(t,"marker")&&d(A,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),u(t,"marker.line")&&d(A,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),vp=Vt((K,V)=>{var u=Xr();V.exports=function(d,E){for(var A=0;A{var u=Xr();V.exports=function(d,E){u.isArrayOrTypedArray(E.selectedpoints)&&u.tagSelected(d,E)}}),Vh=Vt((K,V)=>{var u=Lo(),d=Xr(),E=yo(),A=rp(),t=ks().BADNUM,e=nu(),r=jh(),i=vp(),n=Uh();function o(m,w){var l=m._fullLayout,x=w._xA=E.getFromId(m,w.xaxis||"x","x"),y=w._yA=E.getFromId(m,w.yaxis||"y","y"),S=x.makeCalcdata(w,"x"),k=y.makeCalcdata(w,"y"),M=A(w,x,"x",S),T=A(w,y,"y",k),c=M.vals,h=T.vals,b=w._length,_=new Array(b),P=w.ids,z=g(w,l,x,y),D=!1,B,R,I,F,j,N;f(l,w);var G="x",rt="y",ct;if(z)d.pushUnique(z.traceIndices,w.index),B=z.orientation==="v",B?(rt="s",ct="x"):(G="s",ct="y"),j=z.stackgaps==="interpolate";else{var st=s(w,b);a(m,w,x,y,c,h,st)}var et=!!w.xperiodalignment,Z=!!w.yperiodalignment;for(R=0;RR&&_[F].gap;)F--;for(N=_[F].s,I=_.length-1;I>F;I--)_[I].s=N;for(;R{V.exports=d;var u=Xr().distinctVals;function d(E,A){this.traces=E,this.sepNegVal=A.sepNegVal,this.overlapNoMerge=A.overlapNoMerge;for(var t=1/0,e=A.posAxis._id.charAt(0),r=[],i=0;i{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ji(),t=yo(),e=u0().getAxisGroup,r=Ck();function i(_,P){for(var z=P.xaxis,D=P.yaxis,B=_._fullLayout,R=_._fullData,I=_.calcdata,F=[],j=[],N=0;Nj+I||!u(F))}for(var G=0;G{var u=Vh(),d=h0().setGroupPositions;function E(e,r){for(var i=r.xaxis,n=r.yaxis,o=e._fullLayout,a=e._fullData,s=e.calcdata,f=[],v=[],g=0;gz[g]&&g{var u=Eo(),d=ks(),E=d.BADNUM,A=d.LOG_CLIP,t=A+.5,e=A-.5,r=Xr(),i=r.segmentsIntersect,n=r.constrain,o=gp();V.exports=function(a,s){var f=s.trace||{},v=s.xaxis,g=s.yaxis,m=v.type==="log",w=g.type==="log",l=v._length,x=g._length,y=s.backoff,S=f.marker,k=s.connectGaps,M=s.baseTolerance,T=s.shape,c=T==="linear",h=f.fill&&f.fill!=="none",b=[],_=o.minTolerance,P=a.length,z=new Array(P),D=0,B,R,I,F,j,N,G,rt,ct,st,et,Z,ot,X,Q,ut;function J(se){var ke=a[se];if(!ke)return!1;var Ee=s.linearized?v.l2p(ke.x):v.c2p(ke.x),Ue=s.linearized?g.l2p(ke.y):g.c2p(ke.y);if(Ee===E){if(m&&(Ee=v.c2p(ke.x,!0)),Ee===E)return!1;w&&Ue===E&&(Ee*=Math.abs(v._m*x*(v._m>0?t:e)/(g._m*l*(g._m>0?t:e)))),Ee*=1e3}if(Ue===E){if(w&&(Ue=g.c2p(ke.y,!0)),Ue===E)return!1;Ue*=1e3}return[Ee,Ue]}function q(se,ke,Ee,Ue){var ir=Ee-se,ar=Ue-ke,Ye=.5-se,Er=.5-ke,pn=ir*ir+ar*ar,dn=ir*Ye+ar*Er;if(dn>0&&dn1||Math.abs(Ye.y-Ee[0][1])>1)&&(Ye=[Ye.x,Ye.y],Ue&&Tt(Ye,se)It||se[1]te)return[n(se[0],Ct,It),n(se[1],Nt,te)]}function ue(se,ke){if(se[0]===ke[0]&&(se[0]===Ct||se[0]===It)||se[1]===ke[1]&&(se[1]===Nt||se[1]===te))return!0}function Me(se,ke){var Ee=[],Ue=Kt(se),ir=Kt(ke);return Ue&&ir&&ue(Ue,ir)||(Ue&&Ee.push(Ue),ir&&Ee.push(ir)),Ee}function Ce(se,ke,Ee){return function(Ue,ir){var ar=Kt(Ue),Ye=Kt(ir),Er=[];if(ar&&Ye&&ue(ar,Ye))return Er;ar&&Er.push(ar),Ye&&Er.push(Ye);var pn=2*r.constrain((Ue[se]+ir[se])/2,ke,Ee)-((ar||Ue)[se]+(Ye||ir)[se]);if(pn){var dn;ar&&Ye?dn=pn>0==ar[se]>Ye[se]?ar:Ye:dn=ar||Ye,dn[se]+=pn}return Er}}var We;T==="linear"||T==="spline"?We=re:T==="hv"||T==="vh"?We=Me:T==="hvh"?We=Ce(0,Ct,It):T==="vhv"&&(We=Ce(1,Nt,te));function qe(se,ke){var Ee=ke[0]-se[0],Ue=(ke[1]-se[1])/Ee,ir=(se[1]*ke[0]-ke[1]*se[0])/Ee;return ir>0?[Ue>0?Ct:It,te]:[Ue>0?It:Ct,Nt]}function vr(se){var ke=se[0],Ee=se[1],Ue=ke===z[D-1][0],ir=Ee===z[D-1][1];if(!(Ue&&ir))if(D>1){var ar=ke===z[D-2][0],Ye=Ee===z[D-2][1];Ue&&(ke===Ct||ke===It)&&ar?Ye?D--:z[D-1]=se:ir&&(Ee===Nt||Ee===te)&&Ye?ar?D--:z[D-1]=se:z[D++]=se}else z[D++]=se}function _r(se){z[D-1][0]!==se[0]&&z[D-1][1]!==se[1]&&vr([mt,bt]),vr(se),vt=null,mt=bt=0}var er=r.isArrayOrTypedArray(S);function Mr(se){if(se&&y&&(se.i=B,se.d=a,se.trace=f,se.marker=er?S[se.i]:S,se.backoff=y),it=se[0]/l,nt=se[1]/x,ee=se[0]It?It:0,Zt=se[1]te?te:0,ee||Zt){if(!D)z[D++]=[ee||se[0],Zt||se[1]];else if(vt){var ke=We(vt,se);ke.length>1&&(_r(ke[0]),z[D++]=ke[1])}else Ut=We(z[D-1],se)[0],z[D++]=Ut;var Ee=z[D-1];ee&&Zt&&(Ee[0]!==ee||Ee[1]!==Zt)?(vt&&(mt!==ee&&bt!==Zt?vr(mt&&bt?qe(vt,se):[mt||ee,bt||Zt]):mt&&bt&&vr([mt,bt])),vr([ee,Zt])):mt-ee&&bt-Zt&&vr([ee||mt,Zt||bt]),vt=se,mt=ee,bt=Zt}else vt&&_r(We(vt,se)[0]),z[D++]=se}for(B=0;Bdt(N,Ir))break;I=N,ot=ct[0]*rt[0]+ct[1]*rt[1],ot>et?(et=ot,F=N,G=!1):ot=a.length||!N)break;Mr(N),R=N}}vt&&vr([mt||vt[0],bt||vt[1]]),b.push(z.slice(0,D))}var de=T.slice(T.length-1);if(y&&de!=="h"&&de!=="v"){for(var Dt=!1,qt=-1,_t=[],lt=0;lt{var u={tonextx:1,tonexty:1,tonext:1};V.exports=function(d,E,A){var t,e,r,i,n,o={},a=!1,s=-1,f=0,v=-1;for(e=0;e=0?n=v:(n=v=f,f++),n{var u=Ni(),d=ji(),E=Xr(),A=E.ensureSingle,t=E.identity,e=Eo(),r=nu(),i=Fb(),n=Bb(),o=jg().tester;V.exports=function(v,g,m,w,l,x){var y,S,k=!l,M=!!l&&l.duration>0,T=n(v,g,m);if(y=w.selectAll("g.trace").data(T,function(h){return h[0].trace.uid}),y.enter().append("g").attr("class",function(h){return"trace scatter trace"+h[0].trace.uid}).style("stroke-miterlimit",2),y.order(),a(v,y,g),M){x&&(S=x());var c=u.transition().duration(l.duration).ease(l.easing).each("end",function(){S&&S()}).each("interrupt",function(){S&&S()});c.each(function(){w.selectAll("g.trace").each(function(h,b){s(v,b,g,h,T,this,l)})})}else y.each(function(h,b){s(v,b,g,h,T,this,l)});k&&y.exit().remove(),w.selectAll("path:not([d])").remove()};function a(v,g,m){g.each(function(w){var l=A(u.select(this),"g","fills");e.setClipUrl(l,m.layerClipId,v);var x=w[0].trace,y=[];x._ownfill&&y.push("_ownFill"),x._nexttrace&&y.push("_nextFill");var S=l.selectAll("g").data(y,t);S.enter().append("g"),S.exit().each(function(k){x[k]=null}).remove(),S.order().each(function(k){x[k]=A(u.select(this),"path","js-fill")})})}function s(v,g,m,w,l,x,y){var S=v._context.staticPlot,k;f(v,g,m,w,l);var M=!!y&&y.duration>0;function T(_r){return M?_r.transition():_r}var c=m.xaxis,h=m.yaxis,b=w[0].trace,_=b.line,P=u.select(x),z=A(P,"g","errorbars"),D=A(P,"g","lines"),B=A(P,"g","points"),R=A(P,"g","text");if(d.getComponentMethod("errorbars","plot")(v,z,m,y),b.visible!==!0)return;T(P).style("opacity",b.opacity);var I,F,j=b.fill.charAt(b.fill.length-1);j!=="x"&&j!=="y"&&(j="");var N,G;j==="y"?(N=1,G=h.c2p(0,!0)):j==="x"&&(N=0,G=c.c2p(0,!0)),w[0][m.isRangePlot?"nodeRangePlot3":"node3"]=P;var rt="",ct=[],st=b._prevtrace,et=null,Z=null;st&&(rt=st._prevRevpath||"",F=st._nextFill,ct=st._ownPolygons,et=st._fillsegments,Z=st._fillElement);var ot,X,Q="",ut="",J,q,it,nt,dt,Tt,wt=[];b._polygons=[];var Ct=[],It=[],Nt=E.noop;if(I=b._ownFill,r.hasLines(b)||b.fill!=="none"){F&&F.datum(w),["hv","vh","hvh","vhv"].indexOf(_.shape)!==-1?(J=e.steps(_.shape),q=e.steps(_.shape.split("").reverse().join(""))):_.shape==="spline"?J=q=function(_r){var er=_r[_r.length-1];return _r.length>1&&_r[0][0]===er[0]&&_r[0][1]===er[1]?e.smoothclosed(_r.slice(1),_.smoothing):e.smoothopen(_r,_.smoothing)}:J=q=function(_r){return"M"+_r.join("L")},it=function(_r){return q(_r.reverse())},It=i(w,{xaxis:c,yaxis:h,trace:b,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,backoff:_.backoff,simplify:_.simplify,fill:b.fill}),Ct=new Array(It.length);var te=0;for(k=0;k=S[0]&&P.x<=S[1]&&P.y>=k[0]&&P.y<=k[1]}),h=Math.ceil(c.length/T),b=0;l.forEach(function(P,z){var D=P[0].trace;r.hasMarkers(D)&&D.marker.maxdisplayed>0&&z{V.exports={container:"marker",min:"cmin",max:"cmax"}}),t1=Vt((K,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e={_fullLayout:A},r=u.getFromTrace(e,E,"x"),i=u.getFromTrace(e,E,"y"),n=d.orig_x;n===void 0&&(n=d.x);var o=d.orig_y;return o===void 0&&(o=d.y),t.xLabel=u.tickText(r,r.c2l(n),!0).text,t.yLabel=u.tickText(i,i.c2l(o),!0).text,t}}),gh=Vt((K,V)=>{var u=Ni(),d=Eo(),E=ji();function A(i){var n=u.select(i).selectAll("g.trace.scatter");n.style("opacity",function(o){return o[0].trace.opacity}),n.selectAll("g.points").each(function(o){var a=u.select(this),s=o.trace||o[0].trace;t(a,s,i)}),n.selectAll("g.text").each(function(o){var a=u.select(this),s=o.trace||o[0].trace;e(a,s,i)}),n.selectAll("g.trace path.js-line").call(d.lineGroupStyle),n.selectAll("g.trace path.js-fill").call(d.fillGroupStyle,i,!1),E.getComponentMethod("errorbars","style")(n)}function t(i,n,o){d.pointStyle(i.selectAll("path.point"),n,o)}function e(i,n,o){d.textPointStyle(i.selectAll("text"),n,o)}function r(i,n,o){var a=n[0].trace;a.selectedpoints?(d.selectedPointStyle(o.selectAll("path.point"),a),d.selectedTextStyle(o.selectAll("text"),a)):(t(o,a,i),e(o,a,i))}V.exports={style:A,stylePoints:t,styleText:e,styleOnSelect:r}}),Sm=Vt((K,V)=>{var u=Pi(),d=nu();V.exports=function(E,A){var t,e;if(E.mode==="lines")return t=E.line.color,t&&u.opacity(t)?t:E.fillcolor;if(E.mode==="none")return E.fill?E.fillcolor:"";var r=A.mcc||(E.marker||{}).color,i=A.mlcc||((E.marker||{}).line||{}).color;return e=r&&u.opacity(r)?r:i&&u.opacity(i)&&(A.mlw||((E.marker||{}).line||{}).width)?i:"",e?u.opacity(e)<.3?u.addOpacity(e,.3):e:(t=(E.line||{}).color,t&&u.opacity(t)&&d.hasLines(E)&&E.line.width?t:E.fillcolor)}}),Em=Vt((K,V)=>{var u=Xr(),d=hc(),E=ji(),A=Sm(),t=Pi(),e=u.fillText;V.exports=function(r,i,n,o){var a=r.cd,s=a[0].trace,f=r.xa,v=r.ya,g=f.c2p(i),m=v.c2p(n),w=[g,m],l=s.hoveron||"",x=s.mode.indexOf("markers")!==-1?3:.5,y=!!s.xperiodalignment,S=!!s.yperiodalignment;if(l.indexOf("points")!==-1){var k=function(rt){if(y){var ct=f.c2p(rt.xStart),st=f.c2p(rt.xEnd);return g>=Math.min(ct,st)&&g<=Math.max(ct,st)?0:1/0}var et=Math.max(3,rt.mrc||0),Z=1-1/et,ot=Math.abs(f.c2p(rt.x)-g);return ot=Math.min(ct,st)&&m<=Math.max(ct,st)?0:1/0}var et=Math.max(3,rt.mrc||0),Z=1-1/et,ot=Math.abs(v.c2p(rt.y)-m);return otQ!=wt>=Q&&(nt=q[J-1][0],dt=q[J][0],wt-Tt&&(it=nt+(dt-nt)*(Q-Tt)/(wt-Tt),et=Math.min(et,it),Z=Math.max(Z,it)));return et=Math.max(et,0),Z=Math.min(Z,f._length),{x0:et,x1:Z,y0:Q,y1:Q}}if(l.indexOf("fills")!==-1&&s._fillElement){var j=I(s._fillElement)&&!I(s._fillExclusionElement);if(j){var N=F(s._polygons);N===null&&(N={x0:w[0],x1:w[0],y0:w[1],y1:w[1]});var G=t.defaultLine;return t.opacity(s.fillcolor)?G=s.fillcolor:t.opacity((s.line||{}).color)&&(G=s.line.color),u.extendFlat(r,{distance:r.maxHoverDistance,x0:N.x0,x1:N.x1,y0:N.y0,y1:N.y1,color:G,hovertemplate:!1}),delete r.index,s.text&&!u.isArrayOrTypedArray(s.text)?r.text=String(s.text):r.text=s.name,[r]}}}}),zm=Vt((K,V)=>{var u=nu();V.exports=function(d,E){var A=d.cd,t=d.xaxis,e=d.yaxis,r=[],i=A[0].trace,n,o,a,s,f=!u.hasMarkers(i)&&!u.hasText(i);if(f)return[];if(E===!1)for(n=0;n{V.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),Rb=Vt((K,V)=>{var u=ji().traceIs,d=wm();V.exports=function(r,i,n,o){n("autotypenumbers",o.autotypenumbersDflt);var a=n("type",(o.splomStash||{}).type);a==="-"&&(E(i,o.data),i.type==="-"?i.type="linear":r.type=i.type)};function E(r,i){if(r.type==="-"){var n=r._id,o=n.charAt(0),a;n.indexOf("scene")!==-1&&(n=o);var s=A(i,n,o);if(s){if(s.type==="histogram"&&o==={v:"y",h:"x"}[s.orientation||"v"]){r.type="linear";return}var f=o+"calendar",v=s[f],g={noMultiCategory:!u(s,"cartesian")||u(s,"noMultiCategory")};if(s.type==="box"&&s._hasPreCompStats&&o==={h:"x",v:"y"}[s.orientation||"v"]&&(g.noMultiCategory=!0),g.autotypenumbers=r.autotypenumbers,e(s,o)){var m=t(s),w=[];for(a=0;a0&&(a["_"+n+"axes"]||{})[i]||(a[n+"axis"]||n)===i&&(e(a,n)||(a[n]||[]).length||a[n+"0"]))return a}}function t(r){return{v:"x",h:"y"}[r.orientation||"v"]}function e(r,i){var n=t(r),o=u(r,"box-violin"),a=u(r._fullInput||{},"candlestick");return o&&!a&&i===n&&r[n]===void 0&&r[n+"0"]===void 0}}),e1=Vt((K,V)=>{var u=nh().isTypedArraySpec;function d(E,A){var t=A.dataAttr||E._id.charAt(0),e={},r,i,n;if(A.axData)r=A.axData;else for(r=[],i=0;i0||u(r),n;i&&(n="array");var o=t("categoryorder",n),a;o==="array"&&(a=t("categoryarray")),!i&&o==="array"&&(o=A.categoryorder="trace"),o==="trace"?A._initialCategories=[]:o==="array"?A._initialCategories=a.slice():(a=d(A,e).sort(),o==="category ascending"?A._initialCategories=a:o==="category descending"&&(A._initialCategories=a.reverse()))}}}),Hg=Vt((K,V)=>{var u=Af().mix,d=af(),E=Xr();V.exports=function(A,t,e,r){r=r||{};var i=r.dfltColor;function n(h,b){return E.coerce2(A,t,r.attributes,h,b)}var o=n("linecolor",i),a=n("linewidth"),s=e("showline",r.showLine||!!o||!!a);s||(delete t.linecolor,delete t.linewidth);var f=u(i,r.bgColor,r.blend||d.lightFraction).toRgbString(),v=n("gridcolor",f),g=n("gridwidth"),m=n("griddash"),w=e("showgrid",r.showGrid||!!v||!!g||!!m);if(w||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),r.hasMinor){var l=u(t.gridcolor,r.bgColor,67).toRgbString(),x=n("minor.gridcolor",l),y=n("minor.gridwidth",t.gridwidth||1),S=n("minor.griddash",t.griddash||"solid"),k=e("minor.showgrid",!!x||!!y||!!S);k||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!r.noZeroLine){n("zerolinelayer");var M=n("zerolinecolor",i),T=n("zerolinewidth"),c=e("zeroline",r.showGrid||!!M||!!T);c||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}),qg=Vt((K,V)=>{var u=Lo(),d=ji(),E=Xr(),A=cl(),t=Gf(),e=Of(),r=s0(),i=_m(),n=kd(),o=Ad(),a=e1(),s=Hg(),f=pb(),v=mp(),g=Mf().WEEKDAY_PATTERN,m=Mf().HOUR_PATTERN;V.exports=function(y,S,k,M,T){var c=M.letter,h=M.font||{},b=M.splomStash||{},_=k("visible",!M.visibleDflt),P=S._template||{},z=S.type||P.type||"-",D;if(z==="date"){var B=d.getComponentMethod("calendars","handleDefaults");B(y,S,"calendar",M.calendar),M.noTicklabelmode||(D=k("ticklabelmode"))}!M.noTicklabelindex&&(z==="date"||z==="linear")&&k("ticklabelindex");var R="";(!M.noTicklabelposition||z==="multicategory")&&(R=E.coerce(y,S,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:D==="period"?["outside","inside"]:c==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),M.noTicklabeloverflow||k("ticklabeloverflow",R.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),v(S,T),f(y,S,k,M),a(y,S,k,M),M.noHover||(z!=="category"&&k("hoverformat"),M.noUnifiedhovertitle||k("unifiedhovertitle.text"));var I=k("color"),F=I!==e.color.dflt?I:h.color,j=b.label||T._dfltTitle[c];if(o(y,S,k,z,M),!_)return S;k("title.text",j),E.coerceFont(k,"title.font",h,{overrideDflt:{size:E.bigFont(h.size),color:F}}),r(y,S,k,z);var N=M.hasMinor;if(N&&(A.newContainer(S,"minor"),r(y,S,k,z,{isMinor:!0})),n(y,S,k,z,M),i(y,S,k,M),N){var G=M.isMinor;M.isMinor=!0,i(y,S,k,M),M.isMinor=G}s(y,S,k,{dfltColor:I,bgColor:M.bgColor,showGrid:M.showGrid,hasMinor:N,attributes:e}),N&&!S.minor.ticks&&!S.minor.showgrid&&delete S.minor,(S.showline||S.ticks)&&k("mirror");var rt=z==="multicategory";if(!M.noTickson&&(z==="category"||rt)&&(S.ticks||S.showgrid)&&(rt?(k("tickson","boundaries"),delete S.ticklabelposition):k("tickson")),rt){var ct=k("showdividers");ct&&(k("dividercolor"),k("dividerwidth"))}if(z==="date")if(t(y,S,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:w}),!S.rangebreaks.length)delete S.rangebreaks;else{for(var st=0;st=2){var h="",b,_;if(c.length===2){for(b=0;b<2;b++)if(_=x(c[b]),_){h=g;break}}var P=M("pattern",h);if(P===g)for(b=0;b<2;b++)_=x(c[b]),_&&(S.bounds[b]=c[b]=_-1);if(P)for(b=0;b<2;b++)switch(_=c[b],P){case g:if(!u(_)){S.enabled=!1;return}if(_=+_,_!==Math.floor(_)||_<0||_>=7){S.enabled=!1;return}S.bounds[b]=c[b]=_;break;case m:if(!u(_)){S.enabled=!1;return}if(_=+_,_<0||_>24){S.enabled=!1;return}S.bounds[b]=c[b]=_;break}if(k.autorange===!1){var z=k.range;if(z[0]z[1]){S.enabled=!1;return}}else if(c[0]>z[0]&&c[1]{var u=Lo(),d=Xr();V.exports=function(E,A,t,e){var r=e.counterAxes||[],i=e.overlayableAxes||[],n=e.letter,o=e.grid,a=e.overlayingDomain,s,f,v,g,m,w;o&&(f=o._domains[n][o._axisMap[A._id]],s=o._anchors[A._id],f&&(v=o[n+"side"].split(" ")[0],g=o.domain[n][v==="right"||v==="top"?1:0])),f=f||[0,1],s=s||(u(E.position)?"free":r[0]||"free"),v=v||(n==="x"?"bottom":"left"),g=g||0,m=0,w=!1;var l=d.coerce(E,A,{anchor:{valType:"enumerated",values:["free"].concat(r),dflt:s}},"anchor"),x=d.coerce(E,A,{side:{valType:"enumerated",values:n==="x"?["bottom","top"]:["left","right"],dflt:v}},"side");if(l==="free"){if(n==="y"){var y=t("autoshift");y&&(g=x==="left"?a[0]:a[1],w=A.automargin?A.automargin:!0,m=x==="left"?-3:3),t("shift",m)}t("position",g)}t("automargin",w);var S=!1;if(i.length&&(S=d.coerce(E,A,{overlaying:{valType:"enumerated",values:[!1].concat(i),dflt:!1}},"overlaying")),!S){var k=t("domain",f);k[0]>k[1]-1/4096&&(A.domain=f),d.noneOrAll(E.domain,A.domain,f),A.tickmode==="sync"&&(A.tickmode="auto")}return t("layer"),A}}),Ok=Vt((K,V)=>{var u=Xr(),d=Pi(),E=mh().isUnifiedHover,A=_b(),t=cl(),e=vm(),r=Of(),i=Rb(),n=qg(),o=u0(),a=r1(),s=cc(),f=s.id2name,v=s.name2id,g=Mf().AX_ID_PATTERN,m=ji(),w=m.traceIs,l=m.getComponentMethod;function x(y,S,k){Array.isArray(y[S])?y[S].push(k):y[S]=[k]}V.exports=function(y,S,k){var M=S.autotypenumbers,T={},c={},h={},b={},_={},P={},z={},D={},B={},R={},I,F;for(I=0;I{var u=Ni(),d=ji(),E=Xr(),A=Eo(),t=yo();V.exports=function(e,r,i,n){var o=e._fullLayout;if(r.length===0){t.redrawComponents(e);return}function a(S){var k=S.xaxis,M=S.yaxis;o._defs.select("#"+S.clipId+"> rect").call(A.setTranslate,0,0).call(A.setScale,1,1),S.plot.call(A.setTranslate,k._offset,M._offset).call(A.setScale,1,1);var T=S.plot.selectAll(".scatterlayer .trace");T.selectAll(".point").call(A.setPointGroupScale,1,1),T.selectAll(".textpoint").call(A.setTextPointsScale,1,1),T.call(A.hideOutsideRangePoints,S)}function s(S,k){var M=S.plotinfo,T=M.xaxis,c=M.yaxis,h=T._length,b=c._length,_=!!S.xr1,P=!!S.yr1,z=[];if(_){var D=E.simpleMap(S.xr0,T.r2l),B=E.simpleMap(S.xr1,T.r2l),R=D[1]-D[0],I=B[1]-B[0];z[0]=(D[0]*(1-k)+k*B[0]-D[0])/(D[1]-D[0])*h,z[2]=h*(1-k+k*I/R),T.range[0]=T.l2r(D[0]*(1-k)+k*B[0]),T.range[1]=T.l2r(D[1]*(1-k)+k*B[1])}else z[0]=0,z[2]=h;if(P){var F=E.simpleMap(S.yr0,c.r2l),j=E.simpleMap(S.yr1,c.r2l),N=F[1]-F[0],G=j[1]-j[0];z[1]=(F[1]*(1-k)+k*j[1]-F[1])/(F[0]-F[1])*b,z[3]=b*(1-k+k*G/N),c.range[0]=T.l2r(F[0]*(1-k)+k*j[0]),c.range[1]=c.l2r(F[1]*(1-k)+k*j[1])}else z[1]=0,z[3]=b;t.drawOne(e,T,{skipTitle:!0}),t.drawOne(e,c,{skipTitle:!0}),t.redrawComponents(e,[T._id,c._id]);var rt=_?h/z[2]:1,ct=P?b/z[3]:1,st=_?z[0]:0,et=P?z[1]:0,Z=_?z[0]/z[2]*h:0,ot=P?z[1]/z[3]*b:0,X=T._offset-Z,Q=c._offset-ot;M.clipRect.call(A.setTranslate,st,et).call(A.setScale,1/rt,1/ct),M.plot.call(A.setTranslate,X,Q).call(A.setScale,rt,ct),A.setPointGroupScale(M.zoomScalePts,1/rt,1/ct),A.setTextPointsScale(M.zoomScaleTxt,1/rt,1/ct)}var f;n&&(f=n());function v(){for(var S={},k=0;ki.duration?(v(),l=window.cancelAnimationFrame(y)):l=window.requestAnimationFrame(y)}return m=Date.now(),l=window.requestAnimationFrame(y),Promise.resolve()}}),Kc=Vt(K=>{var V=Ni(),u=ji(),d=Xr(),E=Uu(),A=Eo(),t=Pf().getModuleCalcData,e=cc(),r=Mf(),i=Lh(),n=d.ensureSingle;function o(w,l,x){return d.ensureSingle(w,l,x,function(y){y.datum(x)})}var a=r.zindexSeparator;K.name="cartesian",K.attr=["xaxis","yaxis"],K.idRoot=["x","y"],K.idRegex=r.idRegex,K.attrRegex=r.attrRegex,K.attributes=Pk(),K.layoutAttributes=Of(),K.supplyLayoutDefaults=Ok(),K.transitionAxes=Dk(),K.finalizeSubplots=function(w,l){var x=l._subplots,y=x.xaxis,S=x.yaxis,k=x.cartesian,M=k,T={},c={},h,b,_;for(h=0;h0){var z=P.id;if(z.indexOf(a)!==-1)continue;z+=a+(h+1),P=d.extendFlat({},P,{id:z,plot:S._cartesianlayer.selectAll(".subplot").select("."+z)})}for(var D=[],B,R=0;R1&&(G+=a+N),j.push(T+G),M=0;M1,_=l.mainplotinfo;if(!l.mainplot||b)if(h)l.xlines=n(y,"path","xlines-above"),l.ylines=n(y,"path","ylines-above"),l.xaxislayer=n(y,"g","xaxislayer-above"),l.yaxislayer=n(y,"g","yaxislayer-above");else{if(!M){var P=n(y,"g","layer-subplot");l.shapelayer=n(P,"g","shapelayer"),l.imagelayer=n(P,"g","imagelayer"),_&&b?(l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer):(l.minorGridlayer=n(y,"g","minor-gridlayer"),l.gridlayer=n(y,"g","gridlayer"),l.zerolinelayer=n(y,"g","zerolinelayer"));var z=n(y,"g","layer-between");l.shapelayerBetween=n(z,"g","shapelayer"),l.imagelayerBetween=n(z,"g","imagelayer"),n(y,"path","xlines-below"),n(y,"path","ylines-below"),l.overlinesBelow=n(y,"g","overlines-below"),n(y,"g","xaxislayer-below"),n(y,"g","yaxislayer-below"),l.overaxesBelow=n(y,"g","overaxes-below")}l.overplot=n(y,"g","overplot"),l.plot=n(l.overplot,"g",S),_&&b?l.zerolinelayerAbove=_.zerolinelayerAbove:l.zerolinelayerAbove=n(y,"g","zerolinelayer-above"),M||(l.xlines=n(y,"path","xlines-above"),l.ylines=n(y,"path","ylines-above"),l.overlinesAbove=n(y,"g","overlines-above"),n(y,"g","xaxislayer-above"),n(y,"g","yaxislayer-above"),l.overaxesAbove=n(y,"g","overaxes-above"),l.xlines=y.select(".xlines-"+T),l.ylines=y.select(".ylines-"+c),l.xaxislayer=y.select(".xaxislayer-"+T),l.yaxislayer=y.select(".yaxislayer-"+c))}else{var D=_.plotgroup,B=S+"-x",R=S+"-y";l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer,l.zerolinelayerAbove=_.zerolinelayerAbove,n(_.overlinesBelow,"path",B),n(_.overlinesBelow,"path",R),n(_.overaxesBelow,"g",B),n(_.overaxesBelow,"g",R),l.plot=n(_.overplot,"g",S),n(_.overlinesAbove,"path",B),n(_.overlinesAbove,"path",R),n(_.overaxesAbove,"g",B),n(_.overaxesAbove,"g",R),l.xlines=D.select(".overlines-"+T).select("."+B),l.ylines=D.select(".overlines-"+c).select("."+R),l.xaxislayer=D.select(".overaxes-"+T).select("."+B),l.yaxislayer=D.select(".overaxes-"+c).select("."+R)}M||(h||(o(l.minorGridlayer,"g",l.xaxis._id),o(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(I){return I[0]}).sort(e.idSort),o(l.gridlayer,"g",l.xaxis._id),o(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(I){return I[0]}).sort(e.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function g(w,l){if(w){var x={};w.each(function(c){var h=c[0],b=V.select(this);b.remove(),m(h,l),x[h]=!0});for(var y in l._plots)for(var S=l._plots[y],k=S.overlays||[],M=0;M{var u=nu();V.exports={hasLines:u.hasLines,hasMarkers:u.hasMarkers,hasText:u.hasText,isBubble:u.isBubble,attributes:pc(),layoutAttributes:Uy(),supplyDefaults:zk(),crossTraceDefaults:Db(),supplyLayoutDefaults:Lk(),calc:Vh().calc,crossTraceCalc:Ik(),arraysToCalcdata:vp(),plot:Mm(),colorbar:Zf(),formatLabels:t1(),style:gh().style,styleOnSelect:gh().styleOnSelect,hoverPoints:Em(),selectPoints:zm(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Kc(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),Bk=Vt((K,V)=>{var u=Ni(),d=Pi(),E=zb(),A=Xr(),t=A.strScale,e=A.strRotate,r=A.strTranslate;V.exports=function(i,n,o){var a=i.node(),s=E[o.arrowhead||0],f=E[o.startarrowhead||0],v=(o.arrowwidth||1)*(o.arrowsize||1),g=(o.arrowwidth||1)*(o.startarrowsize||1),m=n.indexOf("start")>=0,w=n.indexOf("end")>=0,l=s.backoff*v+o.standoff,x=f.backoff*g+o.startstandoff,y,S,k,M;if(a.nodeName==="line"){y={x:+i.attr("x1"),y:+i.attr("y1")},S={x:+i.attr("x2"),y:+i.attr("y2")};var T=y.x-S.x,c=y.y-S.y;if(k=Math.atan2(c,T),M=k+Math.PI,l&&x&&l+x>Math.sqrt(T*T+c*c)){N();return}if(l){if(l*l>T*T+c*c){N();return}var h=l*Math.cos(k),b=l*Math.sin(k);S.x+=h,S.y+=b,i.attr({x2:S.x,y2:S.y})}if(x){if(x*x>T*T+c*c){N();return}var _=x*Math.cos(k),P=x*Math.sin(k);y.x-=_,y.y-=P,i.attr({x1:y.x,y1:y.y})}}else if(a.nodeName==="path"){var z=a.getTotalLength(),D="";if(z{var u=Ni(),d=ji(),E=Uu(),A=Xr(),t=A.strTranslate,e=yo(),r=Pi(),i=Eo(),n=hc(),o=Dl(),a=$h(),s=oh(),f=cl().arrayEditor,v=Bk();V.exports={draw:g,drawOne:m,drawRaw:l};function g(x){var y=x._fullLayout;y._infolayer.selectAll(".annotation").remove();for(var S=0;S2/3?gn="right":gn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[gn]}for(var re=!1,Kt=["x","y"],ue=0;ue1)&&(We===Ce?(Yt=qe.r2fraction(y["a"+Me]),(Yt<0||Yt>1)&&(re=!0)):re=!0),qt=qe._offset+qe.r2p(y[Me]),yt=.5}else{var se=Ht==="domain";Me==="x"?(lt=y[Me],qt=se?qe._offset+qe._length*lt:qt=h.l+h.w*lt):(lt=1-y[Me],qt=se?qe._offset+qe._length*lt:qt=h.t+h.h*lt),yt=y.showarrow?.5:lt}if(y.showarrow){Dt.head=qt;var ke=y["a"+Me];if(St=_r*Ut(.5,y.xanchor)-er*Ut(.5,y.yanchor),We===Ce){var Ee=e.getRefType(We);Ee==="domain"?(Me==="y"&&(ke=1-ke),Dt.tail=qe._offset+qe._length*ke):Ee==="paper"?Me==="y"?(ke=1-ke,Dt.tail=h.t+h.h*ke):Dt.tail=h.l+h.w*ke:Dt.tail=qe._offset+qe.r2p(ke),_t=St}else Dt.tail=qt+ke,_t=St+ke;Dt.text=Dt.tail+St;var Ue=c[Me==="x"?"width":"height"];if(Ce==="paper"&&(Dt.head=A.constrain(Dt.head,1,Ue-1)),We==="pixel"){var ir=-Math.max(Dt.tail-3,Dt.text),ar=Math.min(Dt.tail+3,Dt.text)-Ue;ir>0?(Dt.tail+=ir,Dt.text+=ir):ar>0&&(Dt.tail-=ar,Dt.text-=ar)}Dt.tail+=de,Dt.head+=de}else St=Mr*Ut(yt,Ir),_t=St,Dt.text=qt+St;Dt.text+=de,St+=de,_t+=de,y["_"+Me+"padplus"]=Mr/2+_t,y["_"+Me+"padminus"]=Mr/2-_t,y["_"+Me+"size"]=Mr,y["_"+Me+"shift"]=St}if(re){et.remove();return}var Ye=0,Er=0;if(y.align!=="left"&&(Ye=(Zt-Jt)*(y.align==="center"?.5:1)),y.valign!=="top"&&(Er=(mt-ee)*(y.valign==="middle"?.5:1)),Nt)It.select("svg").attr({x:X+Ye-1,y:X+Er}).call(i.setClipUrl,ut?I:null,x);else{var pn=X+Er-te.top,dn=X+Ye-te.left;nt.call(o.positionText,dn,pn).call(i.setClipUrl,ut?I:null,x)}J.select("rect").call(i.setRect,X,X,Zt,mt),Q.call(i.setRect,Z/2,Z/2,bt-Z,vt-Z),et.call(i.setTranslate,Math.round(F.x.text-bt/2),Math.round(F.y.text-vt/2)),G.attr({transform:"rotate("+j+","+F.x.text+","+F.y.text+")"});var bn=function(En,gn){N.selectAll(".annotation-arrow-g").remove();var da=F.x.head,ra=F.y.head,Se=F.x.tail+En,Re=F.y.tail+gn,Ze=F.x.text+En,tr=F.y.text+gn,zr=A.rotationXYMatrix(j,Ze,tr),tn=A.apply2DTransform(zr),Yr=A.apply2DTransform2(zr),$r=+Q.attr("width"),In=+Q.attr("height"),Nn=Ze-.5*$r,Kn=Nn+$r,$n=tr-.5*In,ia=$n+In,Cn=[[Nn,$n,Nn,ia],[Nn,ia,Kn,ia],[Kn,ia,Kn,$n],[Kn,$n,Nn,$n]].map(Yr);if(!Cn.reduce(function(pe,Ke){return pe^!!A.segmentsIntersect(da,ra,da+1e6,ra+1e6,Ke[0],Ke[1],Ke[2],Ke[3])},!1)){Cn.forEach(function(pe){var Ke=A.segmentsIntersect(Se,Re,da,ra,pe[0],pe[1],pe[2],pe[3]);Ke&&(Se=Ke.x,Re=Ke.y)});var Fa=y.arrowwidth,Ga=y.arrowcolor,ve=y.arrowside,ge=N.append("g").style({opacity:r.opacity(Ga)}).classed("annotation-arrow-g",!0),dr=ge.append("path").attr("d","M"+Se+","+Re+"L"+da+","+ra).style("stroke-width",Fa+"px").call(r.stroke,r.rgb(Ga));if(v(dr,ve,y),b.annotationPosition&&dr.node().parentNode&&!k){var br=da,Tr=ra;if(y.standoff){var mr=Math.sqrt(Math.pow(da-Se,2)+Math.pow(ra-Re,2));br+=y.standoff*(Se-da)/mr,Tr+=y.standoff*(Re-ra)/mr}var kr=ge.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Se-br)+","+(Re-Tr),transform:t(br,Tr)}).style("stroke-width",Fa+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Ur,Or;s.init({element:kr.node(),gd:x,prepFn:function(){var pe=i.getTranslate(et);Ur=pe.x,Or=pe.y,M&&M.autorange&&D(M._name+".autorange",!0),T&&T.autorange&&D(T._name+".autorange",!0)},moveFn:function(pe,Ke){var xr=tn(Ur,Or),Gr=xr[0]+pe,ln=xr[1]+Ke;et.call(i.setTranslate,Gr,ln),B("x",w(M,pe,"x",h,y)),B("y",w(T,Ke,"y",h,y)),y.axref===y.xref&&B("ax",w(M,pe,"ax",h,y)),y.ayref===y.yref&&B("ay",w(T,Ke,"ay",h,y)),ge.attr("transform",t(pe,Ke)),G.attr({transform:"rotate("+j+","+Gr+","+ln+")"})},doneFn:function(){d.call("_guiRelayout",x,R());var pe=document.querySelector(".js-notes-box-panel");pe&&pe.redraw(pe.selectedObj)}})}}};if(y.showarrow&&bn(0,0),rt){var Zn;s.init({element:et.node(),gd:x,prepFn:function(){Zn=G.attr("transform")},moveFn:function(En,gn){var da="pointer";if(y.showarrow)y.axref===y.xref?B("ax",w(M,En,"ax",h,y)):B("ax",y.ax+En),y.ayref===y.yref?B("ay",w(T,gn,"ay",h.w,y)):B("ay",y.ay+gn),bn(En,gn);else{if(k)return;var ra,Se;if(M)ra=w(M,En,"x",h,y);else{var Re=y._xsize/h.w,Ze=y.x+(y._xshift-y.xshift)/h.w-Re/2;ra=s.align(Ze+En/h.w,Re,0,1,y.xanchor)}if(T)Se=w(T,gn,"y",h,y);else{var tr=y._ysize/h.h,zr=y.y-(y._yshift+y.yshift)/h.h-tr/2;Se=s.align(zr-gn/h.h,tr,0,1,y.yanchor)}B("x",ra),B("y",Se),(!M||!T)&&(da=s.getCursor(M?.5:ra,T?.5:Se,y.xanchor,y.yanchor))}G.attr({transform:t(En,gn)+Zn}),a(et,da)},clickFn:function(En,gn){y.captureevents&&x.emit("plotly_clickannotation",st(gn))},doneFn:function(){a(et),d.call("_guiRelayout",x,R());var En=document.querySelector(".js-notes-box-panel");En&&En.redraw(En.selectedObj)}})}}b.annotationText?nt.call(o.makeEditable,{delegate:et,gd:x}).call(dt).on("edit",function(wt){y.text=wt,this.call(dt),B("text",wt),M&&M.autorange&&D(M._name+".autorange",!0),T&&T.autorange&&D(T._name+".autorange",!0),d.call("_guiRelayout",x,R())}):nt.call(dt)}}),Rk=Vt((K,V)=>{var u=Xr(),d=ji(),E=cl().arrayEditor;V.exports={hasClickToShow:A,onClick:t};function A(i,n){var o=e(i,n);return o.on.length>0||o.explicitOff.length>0}function t(i,n){var o=e(i,n),a=o.on,s=o.off.concat(o.explicitOff),f={},v=i._fullLayout.annotations,g,m;if(a.length||s.length){for(g=0;g{var u=Xr(),d=Pi();V.exports=function(E,A,t,e){e("opacity");var r=e("bgcolor"),i=e("bordercolor"),n=d.opacity(i);e("borderpad");var o=e("borderwidth"),a=e("showarrow");e("text",a?" ":t._dfltTitle.annotation),e("textangle"),u.coerceFont(e,"font",t.font),e("width"),e("align");var s=e("height");if(s&&e("valign"),a){var f=e("arrowside"),v,g;f.indexOf("end")!==-1&&(v=e("arrowhead"),g=e("arrowsize")),f.indexOf("start")!==-1&&(e("startarrowhead",v),e("startarrowsize",g)),e("arrowcolor",n?A.bordercolor:d.defaultLine),e("arrowwidth",(n&&o||1)*2),e("standoff"),e("startstandoff")}var m=e("hovertext"),w=t.hoverlabel||{};if(m){var l=e("hoverlabel.bgcolor",w.bgcolor||(d.opacity(r)?d.rgb(r):d.defaultLine)),x=e("hoverlabel.bordercolor",w.bordercolor||d.contrast(l)),y=u.extendFlat({},w.font);y.color||(y.color=x),u.coerceFont(e,"hoverlabel.font",y)}e("captureevents",!!m)}}),Nk=Vt((K,V)=>{var u=Xr(),d=yo(),E=Gf(),A=Nb(),t=c0();V.exports=function(r,i){E(r,i,{name:"annotations",handleItemDefaults:e})};function e(r,i,n){function o(h,b){return u.coerce(r,i,t,h,b)}var a=o("visible"),s=o("clicktoshow");if(a||s){A(r,i,n,o);for(var f=i.showarrow,v=["x","y"],g=[-10,-30],m={_fullLayout:n},w=0;w<2;w++){var l=v[w],x=d.coerceRef(r,i,m,l,"","paper");if(x!=="paper"){var y=d.getFromId(m,x);y._annIndices.push(i._index)}if(d.coercePosition(i,m,o,x,l,.5),f){var S="a"+l,k=d.coerceRef(r,i,m,S,"pixel",["pixel","paper"]);k!=="pixel"&&k!==x&&(k=i[S]="pixel");var M=k==="pixel"?g[w]:.4;d.coercePosition(i,m,o,k,S,M)}o(l+"anchor"),o(l+"shift")}if(u.noneOrAll(r,i,["x","y"]),f&&u.noneOrAll(r,i,["ax","ay"]),s){var T=o("xclick"),c=o("yclick");i._xclick=T===void 0?i.x:d.cleanPosition(T,m,i.xref),i._yclick=c===void 0?i.y:d.cleanPosition(c,m,i.yref)}}}}),jk=Vt((K,V)=>{var u=Xr(),d=yo(),E=n1().draw;V.exports=function(e){var r=e._fullLayout,i=u.filterVisible(r.annotations);if(i.length&&e._fullData.length)return u.syncOrAsync([E,A],e)};function A(e){var r=e._fullLayout;u.filterVisible(r.annotations).forEach(function(i){var n=d.getFromId(e,i.xref),o=d.getFromId(e,i.yref),a=d.getRefType(i.xref),s=d.getRefType(i.yref);i._extremes={},a==="range"&&t(i,n),s==="range"&&t(i,o)})}function t(e,r){var i=r._id,n=i.charAt(0),o=e[n],a=e["a"+n],s=e[n+"ref"],f=e["a"+n+"ref"],v=e["_"+n+"padplus"],g=e["_"+n+"padminus"],m={x:1,y:-1}[n]*e[n+"shift"],w=3*e.arrowsize*e.arrowwidth||0,l=w+m,x=w-m,y=3*e.startarrowsize*e.arrowwidth||0,S=y+m,k=y-m,M;if(f===s){var T=d.findExtremes(r,[r.r2c(o)],{ppadplus:l,ppadminus:x}),c=d.findExtremes(r,[r.r2c(a)],{ppadplus:Math.max(v,S),ppadminus:Math.max(g,k)});M={min:[T.min[0],c.min[0]],max:[T.max[0],c.max[0]]}}else S=a?S+a:S,k=a?k-a:k,M=d.findExtremes(r,[r.r2c(o)],{ppadplus:Math.max(v,l,S),ppadminus:Math.max(g,x,k)});e._extremes[i]=M}}),Uk=Vt((K,V)=>{var u=Lo(),d=Oy();V.exports=function(E,A,t,e){A=A||{};var r=t==="log"&&A.type==="linear",i=t==="linear"&&A.type==="log";if(!(r||i))return;var n=E._fullLayout.annotations,o=A._id.charAt(0),a,s;function f(g){var m=a[g],w=null;r?w=d(m,A.range):w=Math.pow(10,m),u(w)||(w=null),e(s+g,w)}for(var v=0;v{var u=n1(),d=Rk();V.exports={moduleType:"component",name:"annotations",layoutAttributes:c0(),supplyLayoutDefaults:Nk(),includeBasePlot:Vg()("annotations"),calcAutorange:jk(),draw:u.draw,drawOne:u.drawOne,drawRaw:u.drawRaw,hasClickToShow:d.hasClickToShow,onClick:d.onClick,convertCoords:Uk()}}),a1=Vt((K,V)=>{var u=c0(),d=Cu().overrideAll,E=cl().templatedArray;V.exports=d(E("annotation",{visible:u.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:u.xanchor,xshift:u.xshift,yanchor:u.yanchor,yshift:u.yshift,text:u.text,textangle:u.textangle,font:u.font,width:u.width,height:u.height,opacity:u.opacity,align:u.align,valign:u.valign,bgcolor:u.bgcolor,bordercolor:u.bordercolor,borderpad:u.borderpad,borderwidth:u.borderwidth,showarrow:u.showarrow,arrowcolor:u.arrowcolor,arrowhead:u.arrowhead,startarrowhead:u.startarrowhead,arrowside:u.arrowside,arrowsize:u.arrowsize,startarrowsize:u.startarrowsize,arrowwidth:u.arrowwidth,standoff:u.standoff,startstandoff:u.startstandoff,hovertext:u.hovertext,hoverlabel:u.hoverlabel,captureevents:u.captureevents}),"calc","from-root")}),Hk=Vt((K,V)=>{var u=Xr(),d=yo(),E=Gf(),A=Nb(),t=a1();V.exports=function(r,i,n){E(r,i,{name:"annotations",handleItemDefaults:e,fullLayout:n.fullLayout})};function e(r,i,n,o){function a(v,g){return u.coerce(r,i,t,v,g)}function s(v){var g=v+"axis",m={_fullLayout:{}};return m._fullLayout[g]=n[g],d.coercePosition(i,m,a,v,v,.5)}var f=a("visible");f&&(A(r,i,o.fullLayout,a),s("x"),s("y"),s("z"),u.noneOrAll(r,i,["x","y","z"]),i.xref="x",i.yref="y",i.zref="z",a("xanchor"),a("yanchor"),a("xshift"),a("yshift"),i.showarrow&&(i.axref="pixel",i.ayref="pixel",a("ax",-10),a("ay",-30),u.noneOrAll(r,i,["ax","ay"])))}}),qk=Vt((K,V)=>{var u=Xr(),d=yo();V.exports=function(A){for(var t=A.fullSceneLayout,e=t.annotations,r=0;r{function u(E,A){var t=[0,0,0,0],e,r;for(e=0;e<4;++e)for(r=0;r<4;++r)t[r]+=E[4*e+r]*A[e];return t}function d(E,A){var t=u(E.projection,u(E.view,u(E.model,[A[0],A[1],A[2],1])));return t}V.exports=d}),Wk=Vt((K,V)=>{var u=n1().drawRaw,d=jb(),E=["x","y","z"];V.exports=function(A){for(var t=A.fullSceneLayout,e=A.dataScale,r=t.annotations,i=0;i1){o=!0;break}}o?A.fullLayout._infolayer.select(".annotation-"+A.id+'[data-index="'+i+'"]').remove():(n._pdata=d(A.glplot.cameraParams,[t.xaxis.r2l(n.x)*e[0],t.yaxis.r2l(n.y)*e[1],t.zaxis.r2l(n.z)*e[2]]),u(A.graphDiv,n,i,A.id,n._xa,n._ya))}}}),Gk=Vt((K,V)=>{var u=ji(),d=Xr();V.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:a1()}}},layoutAttributes:a1(),handleDefaults:Hk(),includeBasePlot:E,convert:qk(),draw:Wk()};function E(A,t){var e=u.subplotsRegistry.gl3d;if(e)for(var r=e.attrRegex,i=Object.keys(A),n=0;n{var u=c0(),d=yu(),E=pc().line,A=If().dash,t=So().extendFlat,e=cl().templatedArray;Ug();var r=kl(),{shapeTexttemplateAttrs:i,templatefallbackAttrs:n}=yl(),o=By();V.exports=e("shape",{visible:t({},r.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:t({},r.legend,{editType:"calc+arraydraw"}),legendgroup:t({},r.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:t({},r.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:d({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:t({},r.legendrank,{editType:"calc+arraydraw"}),legendwidth:t({},r.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:t({},u.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:t({},u.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:t({},E.color,{editType:"arraydraw"}),width:t({},E.width,{editType:"calc+arraydraw"}),dash:t({},A,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:i({},{keys:Object.keys(o)}),texttemplatefallback:n({editType:"arraydraw"}),font:d({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),Zk=Vt((K,V)=>{var u=Xr(),d=yo(),E=Gf(),A=Ub(),t=Ed();V.exports=function(i,n){E(i,n,{name:"shapes",handleItemDefaults:r})};function e(i,n){return i?"bottom":n.indexOf("top")!==-1?"top":n.indexOf("bottom")!==-1?"bottom":"middle"}function r(i,n,o){function a(Z,ot){return u.coerce(i,n,A,Z,ot)}n._isShape=!0;var s=a("visible");if(s){var f=a("showlegend");f&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),u.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var v=a("path"),g=v?"path":"rect",m=a("type",g),w=m!=="path";w&&delete n.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule");var l=a("line.width");l&&(a("line.color"),a("line.dash"));for(var x=a("xsizemode"),y=a("ysizemode"),S=["x","y"],k=0;k<2;k++){var M=S[k],T=M+"anchor",c=M==="x"?x:y,h={_fullLayout:o},b,_,P,z=d.coerceRef(i,n,h,M,void 0,"paper"),D=d.getRefType(z);if(D==="range"?(b=d.getFromId(h,z),b._shapeIndices.push(n._index),P=t.rangeToShapePosition(b),_=t.shapePositionToRange(b),(b.type==="category"||b.type==="multicategory")&&(a(M+"0shift"),a(M+"1shift"))):_=P=u.identity,w){var B=.25,R=.75,I=M+"0",F=M+"1",j=i[I],N=i[F];i[I]=_(i[I],!0),i[F]=_(i[F],!0),c==="pixel"?(a(I,0),a(F,10)):(d.coercePosition(n,h,a,z,I,B),d.coercePosition(n,h,a,z,F,R)),n[I]=P(n[I]),n[F]=P(n[F]),i[I]=j,i[F]=N}if(c==="pixel"){var G=i[T];i[T]=_(i[T],!0),d.coercePosition(n,h,a,z,T,.25),n[T]=P(n[T]),i[T]=G}}w&&u.noneOrAll(i,n,["x0","x1","y0","y1"]);var rt=m==="line",ct,st;if(w&&(ct=a("label.texttemplate"),a("label.texttemplatefallback")),ct||(st=a("label.text")),st||ct){a("label.textangle");var et=a("label.textposition",rt?"middle":"middle center");a("label.xanchor"),a("label.yanchor",e(rt,et)),a("label.padding"),u.coerceFont(a,"label.font",o.font)}}}}),Kk=Vt((K,V)=>{var u=Pi(),d=Xr();function E(A,t){return A?"bottom":t.indexOf("top")!==-1?"top":t.indexOf("bottom")!==-1?"bottom":"middle"}V.exports=function(A,t,e){e("newshape.visible"),e("newshape.name"),e("newshape.showlegend"),e("newshape.legend"),e("newshape.legendwidth"),e("newshape.legendgroup"),e("newshape.legendgrouptitle.text"),d.coerceFont(e,"newshape.legendgrouptitle.font"),e("newshape.legendrank"),e("newshape.drawdirection"),e("newshape.layer"),e("newshape.fillcolor"),e("newshape.fillrule"),e("newshape.opacity");var r=e("newshape.line.width");if(r){var i=(A||{}).plot_bgcolor||"#FFF";e("newshape.line.color",u.contrast(i)),e("newshape.line.dash")}var n=A.dragmode==="drawline",o=e("newshape.label.text"),a=e("newshape.label.texttemplate");if(e("newshape.label.texttemplatefallback"),o||a){e("newshape.label.textangle");var s=e("newshape.label.textposition",n?"middle":"middle center");e("newshape.label.xanchor"),e("newshape.label.yanchor",E(n,s)),e("newshape.label.padding"),d.coerceFont(e,"newshape.label.font",t.font)}e("activeshape.fillcolor"),e("activeshape.opacity")}}),Yk=Vt((K,V)=>{var u=Xr(),d=yo(),E=Rg(),A=Ed();V.exports=function(n){var o=n._fullLayout,a=u.filterVisible(o.shapes);if(!(!a.length||!n._fullData.length))for(var s=0;s0?l+g:g;return{ppad:g,ppadplus:m?y:S,ppadminus:m?S:y}}else return{ppad:g}}function i(n,o,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",v,g,m=0,w=0,l=f?n.r2c:n.d2c,x=o[s+"sizemode"]==="scaled";if(x?(v=o[s+"0"],g=o[s+"1"],f&&(m=o[s+"0shift"],w=o[s+"1shift"])):(v=o[s+"anchor"],g=o[s+"anchor"]),v!==void 0)return[l(v)+m,l(g)+w];if(o.path){var y=1/0,S=-1/0,k=o.path.match(E.segmentRE),M,T,c,h,b;for(n.type==="date"&&(l=A.decodeDate(l)),M=0;MS&&(S=b)));if(S>=y)return[y,S]}}}),Xk=Vt((K,V)=>{var u=Xy();V.exports={moduleType:"component",name:"shapes",layoutAttributes:Ub(),supplyLayoutDefaults:Zk(),supplyDrawNewShapeDefaults:Kk(),includeBasePlot:Vg()("shapes"),calcAutorange:Yk(),draw:u.draw,drawOne:u.drawOne}}),Vb=Vt((K,V)=>{var u=Mf(),d=cl().templatedArray;Ug(),V.exports=d("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",u.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",u.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),$k=Vt((K,V)=>{var u=Xr(),d=yo(),E=Gf(),A=Vb(),t="images";V.exports=function(r,i){var n={name:t,handleItemDefaults:e};E(r,i,n)};function e(r,i,n){function o(x,y){return u.coerce(r,i,A,x,y)}var a=o("source"),s=o("visible",!!a);if(!s)return i;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var f={_fullLayout:n},v=["x","y"],g=0;g<2;g++){var m=v[g],w=d.coerceRef(r,i,f,m,"paper",void 0);if(w!=="paper"){var l=d.getFromId(f,w);l._imgIndices.push(i._index)}d.coercePosition(i,f,o,w,m,0)}return i}}),Jk=Vt((K,V)=>{var u=Ni(),d=Eo(),E=yo(),A=cc(),t=Lh();V.exports=function(e){var r=e._fullLayout,i=[],n={},o=[],a,s;for(s=0;s{var u=Lo(),d=Oy();V.exports=function(E,A,t,e){A=A||{};var r=t==="log"&&A.type==="linear",i=t==="linear"&&A.type==="log";if(r||i){for(var n=E._fullLayout.images,o=A._id.charAt(0),a,s,f=0;f{V.exports={moduleType:"component",name:"images",layoutAttributes:Vb(),supplyLayoutDefaults:$k(),includeBasePlot:Vg()("images"),draw:Jk(),convertCoords:Qk()}}),i1=Vt((K,V)=>{V.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),Hb=Vt((K,V)=>{var u=yu(),d=af(),E=So().extendFlat,A=Cu().overrideAll,t=Ry(),e=cl().templatedArray,r=e("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});V.exports=A(e("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:r,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:E(t({editType:"arraydraw"}),{}),font:u({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:d.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),e6=Vt((K,V)=>{var u=Xr(),d=Gf(),E=Hb(),A=i1(),t=A.name,e=E.buttons;V.exports=function(n,o){var a={name:t,handleItemDefaults:r};d(n,o,a)};function r(n,o,a){function s(g,m){return u.coerce(n,o,E,g,m)}var f=d(n,o,{name:"buttons",handleItemDefaults:i}),v=s("visible",f.length>0);v&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),u.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),u.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function i(n,o){function a(f,v){return u.coerce(n,o,e,f,v)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}),r6=Vt((K,V)=>{V.exports=t;var u=Ni(),d=Pi(),E=Eo(),A=Xr();function t(e,r,i){this.gd=e,this.container=r,this.id=i,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}t.barWidth=2,t.barLength=20,t.barRadius=2,t.barPad=1,t.barColor="#808BA4",t.prototype.enable=function(e,r,i){var n=this.gd._fullLayout,o=n.width,a=n.height;this.position=e;var s=this.position.l,f=this.position.w,v=this.position.t,g=this.position.h,m=this.position.direction,w=m==="down",l=m==="left",x=m==="right",y=m==="up",S=f,k=g,M,T,c,h;!w&&!l&&!x&&!y&&(this.position.direction="down",w=!0);var b=w||y;b?(M=s,T=M+S,w?(c=v,h=Math.min(c+k,a),k=h-c):(h=v+k,c=Math.max(h-k,0),k=h-c)):(c=v,h=c+k,l?(T=s+S,M=Math.max(T-S,0),S=T-M):(M=s,T=Math.min(M+S,o),S=T-M)),this._box={l:M,t:c,w:S,h:k};var _=f>S,P=t.barLength+2*t.barPad,z=t.barWidth+2*t.barPad,D=s,B=v+g;B+z>a&&(B=a-z);var R=this.container.selectAll("rect.scrollbar-horizontal").data(_?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-horizontal",!0).call(d.fill,t.barColor),_?(this.hbar=R.attr({rx:t.barRadius,ry:t.barRadius,x:D,y:B,width:P,height:z}),this._hbarXMin=D+P/2,this._hbarTranslateMax=S-P):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>k,F=t.barWidth+2*t.barPad,j=t.barLength+2*t.barPad,N=s+f,G=v;N+F>o&&(N=o-F);var rt=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);rt.exit().on(".drag",null).remove(),rt.enter().append("rect").classed("scrollbar-vertical",!0).call(d.fill,t.barColor),I?(this.vbar=rt.attr({rx:t.barRadius,ry:t.barRadius,x:N,y:G,width:F,height:j}),this._vbarYMin=G+j/2,this._vbarTranslateMax=k-j):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var ct=this.id,st=M-.5,et=I?T+F+.5:T+.5,Z=c-.5,ot=_?h+z+.5:h+.5,X=n._topdefs.selectAll("#"+ct).data(_||I?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",ct).append("rect"),_||I?(this._clipRect=X.select("rect").attr({x:Math.floor(st),y:Math.floor(Z),width:Math.ceil(et)-Math.floor(st),height:Math.ceil(ot)-Math.floor(Z)}),this.container.call(E.setClipUrl,ct,this.gd),this.bg.attr({x:s,y:v,width:f,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(E.setClipUrl,null),delete this._clipRect),_||I){var Q=u.behavior.drag().on("dragstart",function(){u.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Q);var ut=u.behavior.drag().on("dragstart",function(){u.event.sourceEvent.preventDefault(),u.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));_&&this.hbar.on(".drag",null).call(ut),I&&this.vbar.on(".drag",null).call(ut)}this.setTranslate(r,i)},t.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(E.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},t.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=u.event.dx),this.vbar&&(r-=u.event.dy),this.setTranslate(e,r)},t.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=u.event.deltaY),this.vbar&&(r+=u.event.deltaY),this.setTranslate(e,r)},t.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var i=e+this._hbarXMin,n=i+this._hbarTranslateMax,o=A.constrain(u.event.x,i,n),a=(o-i)/(n-i),s=this.position.w-this._box.w;e=a*s}if(this.vbar){var f=r+this._vbarYMin,v=f+this._vbarTranslateMax,g=A.constrain(u.event.y,f,v),m=(g-f)/(v-f),w=this.position.h-this._box.h;r=m*w}this.setTranslate(e,r)},t.prototype.setTranslate=function(e,r){var i=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=A.constrain(e||0,0,i),r=A.constrain(r||0,0,n),this.translateX=e,this.translateY=r,this.container.call(E.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-r),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+r-.5)}),this.hbar){var o=e/i;this.hbar.call(E.setTranslate,e+o*this._hbarTranslateMax,r)}if(this.vbar){var a=r/n;this.vbar.call(E.setTranslate,e,r+a*this._vbarTranslateMax)}}}),n6=Vt((K,V)=>{var u=Ni(),d=Uu(),E=Pi(),A=Eo(),t=Xr(),e=Dl(),r=cl().arrayEditor,i=gf().LINE_SPACING,n=i1(),o=r6();V.exports=function(P){var z=P._fullLayout,D=t.filterVisible(z[n.name]);function B(ct){d.autoMargin(P,h(ct))}var R=z._menulayer.selectAll("g."+n.containerClassName).data(D.length>0?[0]:[]);if(R.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),R.exit().each(function(){u.select(this).selectAll("g."+n.headerGroupClassName).each(B)}).remove(),D.length!==0){var I=R.selectAll("g."+n.headerGroupClassName).data(D,a);I.enter().append("g").classed(n.headerGroupClassName,!0);for(var F=t.ensureSingle(R,"g",n.dropdownButtonGroupClassName,function(ct){ct.style("pointer-events","all")}),j=0;j{var u=i1();V.exports={moduleType:"component",name:u.name,layoutAttributes:Hb(),supplyLayoutDefaults:e6(),draw:n6()}}),Wg=Vt((K,V)=>{V.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),qb=Vt((K,V)=>{var u=yu(),d=Ry(),E=So().extendDeepAll,A=Cu().overrideAll,t=Pg(),e=cl().templatedArray,r=Wg(),i=e("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});V.exports=A(e("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:i,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:E(d({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:t.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:u({})},font:u({}),activebgcolor:{valType:"color",dflt:r.gripBgActiveColor},bgcolor:{valType:"color",dflt:r.railBgColor},bordercolor:{valType:"color",dflt:r.railBorderColor},borderwidth:{valType:"number",min:0,dflt:r.railBorderWidth},ticklen:{valType:"number",min:0,dflt:r.tickLength},tickcolor:{valType:"color",dflt:r.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:r.minorTickLength}}),"arraydraw","from-root")}),i6=Vt((K,V)=>{var u=Xr(),d=Gf(),E=qb(),A=Wg(),t=A.name,e=E.steps;V.exports=function(n,o){d(n,o,{name:t,handleItemDefaults:r})};function r(n,o,a){function s(y,S){return u.coerce(n,o,E,y,S)}for(var f=d(n,o,{name:"steps",handleItemDefaults:i}),v=0,g=0;g{var u=Ni(),d=Uu(),E=Pi(),A=Eo(),t=Xr(),e=t.strTranslate,r=Dl(),i=cl().arrayEditor,n=Wg(),o=gf(),a=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR;V.exports=function(R){var I=R._context.staticPlot,F=R._fullLayout,j=g(F,R),N=F._infolayer.selectAll("g."+n.containerClassName).data(j.length>0?[0]:[]);N.enter().append("g").classed(n.containerClassName,!0).style("cursor",I?null:"ew-resize");function G(et){et._commandObserver&&(et._commandObserver.remove(),delete et._commandObserver),d.autoMargin(R,v(et))}if(N.exit().each(function(){u.select(this).selectAll("g."+n.groupClassName).each(G)}).remove(),j.length!==0){var rt=N.selectAll("g."+n.groupClassName).data(j,m);rt.enter().append("g").classed(n.groupClassName,!0),rt.exit().each(G).remove();for(var ct=0;ct0&&(ct=ct.transition().duration(I.transition.duration).ease(I.transition.easing)),ct.attr("transform",e(rt-n.gripWidth*.5,I._dims.currentValueTotalHeight))}}function P(R,I){var F=R._dims;return F.inputAreaStart+n.stepInset+(F.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,I))}function z(R,I){var F=R._dims;return Math.min(1,Math.max(0,(I-n.stepInset-F.inputAreaStart)/(F.inputAreaLength-2*n.stepInset-2*F.inputAreaStart)))}function D(R,I,F){var j=F._dims,N=t.ensureSingle(R,"rect",n.railTouchRectClass,function(G){G.call(c,I,R,F).style("pointer-events","all")});N.attr({width:j.inputAreaLength,height:Math.max(j.inputAreaWidth,n.tickOffset+F.ticklen+j.labelHeight)}).call(E.fill,F.bgcolor).attr("opacity",0),A.setTranslate(N,0,j.currentValueTotalHeight)}function B(R,I){var F=I._dims,j=F.inputAreaLength-n.railInset*2,N=t.ensureSingle(R,"rect",n.railRectClass);N.attr({width:j,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(E.stroke,I.bordercolor).call(E.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px"),A.setTranslate(N,n.railInset,(F.inputAreaWidth-n.railWidth)*.5+F.currentValueTotalHeight)}}),s6=Vt((K,V)=>{var u=Wg();V.exports={moduleType:"component",name:u.name,layoutAttributes:qb(),supplyLayoutDefaults:i6(),draw:o6()}}),o1=Vt((K,V)=>{var u=af();V.exports={bgcolor:{valType:"color",dflt:u.background,editType:"plot"},bordercolor:{valType:"color",dflt:u.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),Wb=Vt((K,V)=>{V.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),s1=Vt((K,V)=>{V.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),l6=Vt(K=>{var V=cc(),u=Dl(),d=s1(),E=gf().LINE_SPACING,A=d.name;function t(e){var r=e&&e[A];return r&&r.visible}K.isVisible=t,K.makeData=function(e){for(var r=V.list({_fullLayout:e},"x",!0),i=e.margin,n=[],o=0;o{var u=Xr(),d=cl(),E=cc(),A=o1(),t=Wb();V.exports=function(e,r,i){var n=e[i],o=r[i];if(!(n.rangeslider||r._requestRangeslider[o._id]))return;u.isPlainObject(n.rangeslider)||(n.rangeslider={});var a=n.rangeslider,s=d.newContainer(o,"rangeslider");function f(h,b){return u.coerce(a,s,A,h,b)}var v,g;function m(h,b){return u.coerce(v,g,t,h,b)}var w=f("visible");if(w){f("bgcolor",r.plot_bgcolor),f("bordercolor"),f("borderwidth"),f("thickness"),f("autorange",!o.isValidRange(a.range)),f("range");var l=r._subplots;if(l)for(var x=l.cartesian.filter(function(h){return h.slice(0,Math.max(0,h.indexOf("y")))===E.name2id(i)}).map(function(h){return h.slice(h.indexOf("y"),h.length)}),y=u.simpleMap(x,E.id2name),S=0;S{var u=cc().list,d=Xh().getAutoRange,E=s1();V.exports=function(A){for(var t=u(A,"x",!0),e=0;e{var u=Ni(),d=ji(),E=Uu(),A=Xr(),t=A.strTranslate,e=Eo(),r=Pi(),i=l0(),n=Kc(),o=cc(),a=oh(),s=$h(),f=s1();V.exports=function(c){for(var h=c._fullLayout,b=h._rangeSliderData,_=0;_=Jt.max)Nt=dt[te+1];else if(It=Jt.pmax)Nt=dt[te+1];else if(It0?c.touches[0].clientX:0}function g(c,h,b,_){if(h._context.staticPlot)return;var P=c.select("rect."+f.slideBoxClassName).node(),z=c.select("rect."+f.grabAreaMinClassName).node(),D=c.select("rect."+f.grabAreaMaxClassName).node();function B(){var R=u.event,I=R.target,F=v(R),j=F-c.node().getBoundingClientRect().left,N=_.d2p(b._rl[0]),G=_.d2p(b._rl[1]),rt=a.coverSlip();this.addEventListener("touchmove",ct),this.addEventListener("touchend",st),rt.addEventListener("mousemove",ct),rt.addEventListener("mouseup",st);function ct(et){var Z=v(et),ot=+Z-F,X,Q,ut;switch(I){case P:if(ut="ew-resize",N+ot>b._length||G+ot<0)return;X=N+ot,Q=G+ot;break;case z:if(ut="col-resize",N+ot>b._length)return;X=N+ot,Q=G;break;case D:if(ut="col-resize",G+ot<0)return;X=N,Q=G+ot;break;default:ut="ew-resize",X=j,Q=j+ot;break}if(Q{var u=Xr(),d=o1(),E=Wb(),A=l6();V.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:u.extendFlat({},d,{yaxis:E})}}},layoutAttributes:o1(),handleDefaults:u6(),calcAutorange:c6(),draw:f6(),isVisible:A.isVisible,makeData:A.makeData,autoMarginOpts:A.autoMarginOpts}}),l1=Vt((K,V)=>{var u=yu(),d=af(),E=cl().templatedArray,A=E("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});V.exports={visible:{valType:"boolean",editType:"plot"},buttons:A,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:u({editType:"plot"}),bgcolor:{valType:"color",dflt:d.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),Gb=Vt((K,V)=>{V.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),p6=Vt((K,V)=>{var u=Xr(),d=Pi(),E=cl(),A=Gf(),t=l1(),e=Gb();V.exports=function(n,o,a,s,f){var v=n.rangeselector||{},g=E.newContainer(o,"rangeselector");function m(S,k){return u.coerce(v,g,t,S,k)}var w=A(v,g,{name:"buttons",handleItemDefaults:r,calendar:f}),l=m("visible",w.length>0);if(l){var x=i(o,a,s);m("x",x[0]),m("y",x[1]),u.noneOrAll(n,o,["x","y"]),m("xanchor"),m("yanchor"),u.coerceFont(m,"font",a.font);var y=m("bgcolor");m("activecolor",d.contrast(y,e.lightAmount,e.darkAmount)),m("bordercolor"),m("borderwidth")}};function r(n,o,a,s){var f=s.calendar;function v(w,l){return u.coerce(n,o,t.buttons,w,l)}var g=v("visible");if(g){var m=v("step");m!=="all"&&(f&&f!=="gregorian"&&(m==="month"||m==="year")?o.stepmode="backward":v("stepmode"),v("count")),v("label")}}function i(n,o,a){for(var s=a.filter(function(m){return o[m].anchor===n._id}),f=0,v=0;v{var u=Y_(),d=Xr().titleCase;V.exports=function(A,t){var e=A._name,r={};if(t.step==="all")r[e+".autorange"]=!0;else{var i=E(A,t);r[e+".range[0]"]=i[0],r[e+".range[1]"]=i[1]}return r};function E(A,t){var e=A.range,r=new Date(A.r2l(e[1])),i=t.step,n=u["utc"+d(i)],o=t.count,a;switch(t.stepmode){case"backward":a=A.l2r(+n.offset(r,-o));break;case"todate":var s=n.offset(r,-o);a=A.l2r(+n.ceil(s));break}var f=e[1];return[a,f]}}),m6=Vt((K,V)=>{var u=Ni(),d=ji(),E=Uu(),A=Pi(),t=Eo(),e=Xr(),r=e.strTranslate,i=Dl(),n=cc(),o=gf(),a=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR,v=Gb(),g=d6();V.exports=function(T){var c=T._fullLayout,h=c._infolayer.selectAll(".rangeselector").data(m(T),w);h.enter().append("g").classed("rangeselector",!0),h.exit().remove(),h.style({cursor:"pointer","pointer-events":"all"}),h.each(function(b){var _=u.select(this),P=b,z=P.rangeselector,D=_.selectAll("g.button").data(e.filterVisible(z.buttons));D.enter().append("g").classed("button",!0),D.exit().remove(),D.each(function(B){var R=u.select(this),I=g(P,B);B._isActive=l(P,B,I),R.call(x,z,B),R.call(S,z,B,T),R.on("click",function(){T._dragged||d.call("_guiRelayout",T,I)}),R.on("mouseover",function(){B._isHovered=!0,R.call(x,z,B)}),R.on("mouseout",function(){B._isHovered=!1,R.call(x,z,B)})}),M(T,D,z,P._name,_)})};function m(T){for(var c=n.list(T,"x",!0),h=[],b=0;b{V.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:l1()}}},layoutAttributes:l1(),handleDefaults:p6(),draw:m6()}}),Vu=Vt(K=>{var V=So().extendFlat;K.attributes=function(u,d){u=u||{},d=d||{};var E={valType:"info_array",editType:u.editType,items:[{valType:"number",min:0,max:1,editType:u.editType},{valType:"number",min:0,max:1,editType:u.editType}],dflt:[0,1]};u.name&&u.name+"",u.trace,d.description&&""+d.description;var A={x:V({},E,{}),y:V({},E,{}),editType:u.editType};return u.noGridCell||(A.row={valType:"integer",min:0,dflt:0,editType:u.editType},A.column={valType:"integer",min:0,dflt:0,editType:u.editType}),A},K.defaults=function(u,d,E,A){var t=A&&A.x||[0,1],e=A&&A.y||[0,1],r=d.grid;if(r){var i=E("domain.column");i!==void 0&&(i{var u=Xr(),d=gm().counter,E=Vu().attributes,A=Mf().idRegex,t=cl(),e={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[d("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[A.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[A.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:E({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function r(s,f,v){var g=f[v+"axes"],m=Object.keys((s._splomAxes||{})[v]||{});if(Array.isArray(g))return g;if(m.length)return m}function i(s,f){var v=s.grid||{},g=r(f,v,"x"),m=r(f,v,"y");if(!s.grid&&!g&&!m)return;var w=Array.isArray(v.subplots)&&Array.isArray(v.subplots[0]),l=Array.isArray(g),x=Array.isArray(m),y=l&&g!==v.xaxes&&x&&m!==v.yaxes,S,k;w?(S=v.subplots.length,k=v.subplots[0].length):(x&&(S=m.length),l&&(k=g.length));var M=t.newContainer(f,"grid");function T(I,F){return u.coerce(v,M,e,I,F)}var c=T("rows",S),h=T("columns",k);if(!(c*h>1)){delete f.grid;return}if(!w&&!l&&!x){var b=T("pattern")==="independent";b&&(w=!0)}M._hasSubplotGrid=w;var _=T("roworder"),P=_==="top to bottom",z=w?.2:.1,D=w?.3:.1,B,R;y&&f._splomGridDflt&&(B=f._splomGridDflt.xside,R=f._splomGridDflt.yside),M._domains={x:n("x",T,z,B,h),y:n("y",T,D,R,c,P)}}function n(s,f,v,g,m,w){var l=f(s+"gap",v),x=f("domain."+s);f(s+"side",g);for(var y=new Array(m),S=x[0],k=(x[1]-S)/(m-l),M=k*(1-l),T=0;T{V.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),v6=Vt((K,V)=>{var u=Lo(),d=ji(),E=Xr(),A=cl(),t=Kb();V.exports=function(e,r,i,n){var o="error_"+n.axis,a=A.newContainer(r,o),s=e[o]||{};function f(y,S){return E.coerce(s,a,t,y,S)}var v=s.array!==void 0||s.value!==void 0||s.type==="sqrt",g=f("visible",v);if(g!==!1){var m=f("type","array"in s?"data":"percent"),w=!0;m!=="sqrt"&&(w=f("symmetric",!((m==="data"?"arrayminus":"valueminus")in s))),m==="data"?(f("array"),f("traceref"),w||(f("arrayminus"),f("tracerefminus"))):(m==="percent"||m==="constant")&&(f("value"),w||f("valueminus"));var l="copy_"+n.inherit+"style";if(n.inherit){var x=r["error_"+n.inherit];(x||{}).visible&&f(l,!(s.color||u(s.thickness)||u(s.width)))}(!n.inherit||!a[l])&&(f("color",i),f("thickness"),f("width",d.traceIs(r,"gl3d")?0:4))}}}),Yb=Vt((K,V)=>{V.exports=function(d){var E=d.type,A=d.symmetric;if(E==="data"){var t=d.array||[];if(A)return function(n,o){var a=+t[o];return[a,a]};var e=d.arrayminus||[];return function(n,o){var a=+t[o],s=+e[o];return!isNaN(a)||!isNaN(s)?[s||0,a||0]:[NaN,NaN]}}else{var r=u(E,d.value),i=u(E,d.valueminus);return A||d.valueminus===void 0?function(n){var o=r(n);return[o,o]}:function(n){return[i(n),r(n)]}}};function u(d,E){if(d==="percent")return function(A){return Math.abs(A*E/100)};if(d==="constant")return function(){return Math.abs(E)};if(d==="sqrt")return function(A){return Math.sqrt(Math.abs(A))}}}),y6=Vt((K,V)=>{var u=Lo(),d=ji(),E=yo(),A=Xr(),t=Yb();V.exports=function(r){for(var i=r.calcdata,n=0;n{var u=Ni(),d=Lo(),E=Eo(),A=nu();V.exports=function(e,r,i,n){var o,a=i.xaxis,s=i.yaxis,f=n&&n.duration>0,v=e._context.staticPlot;r.each(function(g){var m=g[0].trace,w=m.error_x||{},l=m.error_y||{},x;m.ids&&(x=function(M){return M.id});var y=A.hasMarkers(m)&&m.marker.maxdisplayed>0;!l.visible&&!w.visible&&(g=[]);var S=u.select(this).selectAll("g.errorbar").data(g,x);if(S.exit().remove(),!!g.length){w.visible||S.selectAll("path.xerror").remove(),l.visible||S.selectAll("path.yerror").remove(),S.style("opacity",1);var k=S.enter().append("g").classed("errorbar",!0);f&&k.style("opacity",0).transition().duration(n.duration).style("opacity",1),E.setClipUrl(S,i.layerClipId,e),S.each(function(M){var T=u.select(this),c=t(M,a,s);if(!(y&&!M.vis)){var h,b=T.select("path.yerror");if(l.visible&&d(c.x)&&d(c.yh)&&d(c.ys)){var _=l.width;h="M"+(c.x-_)+","+c.yh+"h"+2*_+"m-"+_+",0V"+c.ys,c.noYS||(h+="m-"+_+",0h"+2*_),o=!b.size(),o?b=T.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):f&&(b=b.transition().duration(n.duration).ease(n.easing)),b.attr("d",h)}else b.remove();var P=T.select("path.xerror");if(w.visible&&d(c.y)&&d(c.xh)&&d(c.xs)){var z=(w.copy_ystyle?l:w).width;h="M"+c.xh+","+(c.y-z)+"v"+2*z+"m0,-"+z+"H"+c.xs,c.noXS||(h+="m0,-"+z+"v"+2*z),o=!P.size(),o?P=T.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):f&&(P=P.transition().duration(n.duration).ease(n.easing)),P.attr("d",h)}else P.remove()}})}})};function t(e,r,i){var n={x:r.c2p(e.x),y:i.c2p(e.y)};return e.yh!==void 0&&(n.yh=i.c2p(e.yh),n.ys=i.c2p(e.ys),d(n.ys)||(n.noYS=!0,n.ys=i.c2p(e.ys,!0))),e.xh!==void 0&&(n.xh=r.c2p(e.xh),n.xs=r.c2p(e.xs),d(n.xs)||(n.noXS=!0,n.xs=r.c2p(e.xs,!0))),n}}),_6=Vt((K,V)=>{var u=Ni(),d=Pi();V.exports=function(E){E.each(function(A){var t=A[0].trace,e=t.error_y||{},r=t.error_x||{},i=u.select(this);i.selectAll("path.yerror").style("stroke-width",e.thickness+"px").call(d.stroke,e.color),r.copy_ystyle&&(r=e),i.selectAll("path.xerror").style("stroke-width",r.thickness+"px").call(d.stroke,r.color)})}}),b6=Vt((K,V)=>{var u=Xr(),d=Cu().overrideAll,E=Kb(),A={error_x:u.extendFlat({},E),error_y:u.extendFlat({},E)};delete A.error_x.copy_zstyle,delete A.error_y.copy_zstyle,delete A.error_y.copy_ystyle;var t={error_x:u.extendFlat({},E),error_y:u.extendFlat({},E),error_z:u.extendFlat({},E)};delete t.error_x.copy_ystyle,delete t.error_y.copy_ystyle,delete t.error_z.copy_ystyle,delete t.error_z.copy_zstyle,V.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:A,bar:A,histogram:A,scatter3d:d(t,"calc","nested"),scattergl:d(A,"calc","nested")}},supplyDefaults:v6(),calc:y6(),makeComputeError:Yb(),plot:x6(),style:_6(),hoverInfo:e};function e(r,i,n){(i.error_y||{}).visible&&(n.yerr=r.yh-r.y,i.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(i.error_x||{}).visible&&(n.xerr=r.xh-r.x,i.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}),w6=Vt((K,V)=>{V.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),T6=Vt((K,V)=>{var u=Ni(),d=Af(),E=Uu(),A=ji(),t=yo(),e=oh(),r=Xr(),i=r.strTranslate,n=So().extendFlat,o=$h(),a=Eo(),s=Pi(),f=l0(),v=Dl(),g=ah().flipScale,m=qg(),w=r1(),l=Of(),x=gf(),y=x.LINE_SPACING,S=x.FROM_TL,k=x.FROM_BR,M=w6().cn;function T(z){var D=z._fullLayout,B=D._infolayer.selectAll("g."+M.colorbar).data(c(z),function(R){return R._id});B.enter().append("g").attr("class",function(R){return R._id}).classed(M.colorbar,!0),B.each(function(R){var I=u.select(this);r.ensureSingle(I,"rect",M.cbbg),r.ensureSingle(I,"g",M.cbfills),r.ensureSingle(I,"g",M.cblines),r.ensureSingle(I,"g",M.cbaxis,function(j){j.classed(M.crisp,!0)}),r.ensureSingle(I,"g",M.cbtitleunshift,function(j){j.append("g").classed(M.cbtitle,!0)}),r.ensureSingle(I,"rect",M.cboutline);var F=h(I,R,z);F&&F.then&&(z._promises||[]).push(F),z._context.edits.colorbarPosition&&b(I,R,z)}),B.exit().each(function(R){E.autoMargin(z,R._id)}).remove(),B.order()}function c(z){var D=z._fullLayout,B=z.calcdata,R=[],I,F,j,N;function G(q){return n(q,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function rt(){typeof N.calc=="function"?N.calc(z,j,I):(I._fillgradient=F.reversescale?g(F.colorscale):F.colorscale,I._zrange=[F[N.min],F[N.max]])}for(var ct=0;ct1){var Dt=Math.pow(10,Math.floor(Math.log(de)/Math.LN10));Mr*=Dt*r.roundUp(de/Dt,[2,5,10]),(Math.abs(te.start)/te.size+1e-6)%1<2e-6&&(_r.tick0=0)}_r.dtick=Mr}_r.domain=R?[qe+ot/it.h,qe+Ut-ot/it.h]:[qe+Z/it.w,qe+Ut-Z/it.w],_r.setScale(),z.attr("transform",i(Math.round(it.l),Math.round(it.t)));var qt=z.select("."+M.cbtitleunshift).attr("transform",i(-Math.round(it.l),-Math.round(it.t))),_t=_r.ticklabelposition,lt=_r.title.font.size,yt=z.select("."+M.cbaxis),St,Ht=0,Yt=0;function se(ar,Ye){var Er={propContainer:_r,propName:D._propPrefix+"title.text",traceIndex:D._traceIndex,_meta:D._meta,placeholder:q._dfltTitle.colorbar,containerGroup:z.select("."+M.cbtitle)},pn=ar.charAt(0)==="h"?ar.slice(1):"h"+ar;z.selectAll("."+pn+",."+pn+"-math-group").remove(),f.draw(B,ar,n(Er,Ye||{}))}function ke(){if(R&&er||!R&&!er){var ar,Ye;wt==="top"&&(ar=Z+it.l+re*X,Ye=ot+it.t+Kt*(1-qe-Ut)+3+lt*.75),wt==="bottom"&&(ar=Z+it.l+re*X,Ye=ot+it.t+Kt*(1-qe)-3-lt*.25),wt==="right"&&(Ye=ot+it.t+Kt*Q+3+lt*.75,ar=Z+it.l+re*qe),se(_r._id+"title",{attributes:{x:ar,y:Ye,"text-anchor":R?"start":"middle"}})}}function Ee(){if(R&&!er||!R&&er){var ar=_r.position||0,Ye=_r._offset+_r._length/2,Er,pn;if(wt==="right")pn=Ye,Er=it.l+re*ar+10+lt*(_r.showticklabels?1:.5);else if(Er=Ye,wt==="bottom"&&(pn=it.t+Kt*ar+10+(_t.indexOf("inside")===-1?_r.tickfont.size:0)+(_r.ticks!=="inside"&&D.ticklen||0)),wt==="top"){var dn=Tt.text.split("
                ").length;pn=it.t+Kt*ar+10-mt-y*lt*dn}se((R?"h":"v")+_r._id+"title",{avoid:{selection:u.select(B).selectAll("g."+_r._id+"tick"),side:wt,offsetTop:R?0:it.t,offsetLeft:R?it.l:0,maxShift:R?q.width:q.height},attributes:{x:Er,y:pn,"text-anchor":"middle"},transform:{rotate:R?-90:0,offset:0}})}}function Ue(){if(!R&&!er||R&&er){var ar=z.select("."+M.cbtitle),Ye=ar.select("text"),Er=[-G/2,G/2],pn=ar.select(".h"+_r._id+"title-math-group").node(),dn=15.6;Ye.node()&&(dn=parseInt(Ye.node().style.fontSize,10)*y);var bn;if(pn?(bn=a.bBox(pn),Yt=bn.width,Ht=bn.height,Ht>dn&&(Er[1]-=(Ht-dn)/2)):Ye.node()&&!Ye.classed(M.jsPlaceholder)&&(bn=a.bBox(Ye.node()),Yt=bn.width,Ht=bn.height),R){if(Ht){if(Ht+=5,wt==="top")_r.domain[1]-=Ht/it.h,Er[1]*=-1;else{_r.domain[0]+=Ht/it.h;var Zn=v.lineCount(Ye);Er[1]+=(1-Zn)*dn}ar.attr("transform",i(Er[0],Er[1])),_r.setScale()}}else Yt&&(wt==="right"&&(_r.domain[0]+=(Yt+lt/2)/it.w),ar.attr("transform",i(Er[0],Er[1])),_r.setScale())}z.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",R?i(0,Math.round(it.h*(1-_r.domain[1]))):i(Math.round(it.w*_r.domain[0]),0)),yt.attr("transform",R?i(0,Math.round(-it.t)):i(Math.round(-it.l),0));var En=z.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(ee);En.enter().append("rect").classed(M.cbfill,!0).attr("style",""),En.exit().remove();var gn=Ct.map(_r.c2p).map(Math.round).sort(function(Ze,tr){return Ze-tr});En.each(function(Ze,tr){var zr=[tr===0?Ct[0]:(ee[tr]+ee[tr-1])/2,tr===ee.length-1?Ct[1]:(ee[tr]+ee[tr+1])/2].map(_r.c2p).map(Math.round);R&&(zr[1]=r.constrain(zr[1]+(zr[1]>zr[0])?1:-1,gn[0],gn[1]));var tn=u.select(this).attr(R?"x":"y",ue).attr(R?"y":"x",u.min(zr)).attr(R?"width":"height",Math.max(mt,2)).attr(R?"height":"width",Math.max(u.max(zr)-u.min(zr),2));if(D._fillgradient)a.gradient(tn,B,D._id,R?"vertical":"horizontalreversed",D._fillgradient,"fill");else{var Yr=Nt(Ze).replace("e-","");tn.attr("fill",d(Yr).toHexString())}});var da=z.select("."+M.cblines).selectAll("path."+M.cbline).data(dt.color&&dt.width?Zt:[]);da.enter().append("path").classed(M.cbline,!0),da.exit().remove(),da.each(function(Ze){var tr=ue,zr=Math.round(_r.c2p(Ze))+dt.width/2%1;u.select(this).attr("d","M"+(R?tr+","+zr:zr+","+tr)+(R?"h":"v")+mt).call(a.lineGroupStyle,dt.width,It(Ze),dt.dash)}),yt.selectAll("g."+_r._id+"tick,path").remove();var ra=ue+mt+(G||0)/2-(D.ticks==="outside"?1:0),Se=t.calcTicks(_r),Re=t.getTickSigns(_r)[2];return t.drawTicks(B,_r,{vals:_r.ticks==="inside"?t.clipEnds(_r,Se):Se,layer:yt,path:t.makeTickPath(_r,ra,Re),transFn:t.makeTransTickFn(_r)}),t.drawLabels(B,_r,{vals:Se,layer:yt,transFn:t.makeTransTickLabelFn(_r),labelFns:t.makeLabelFns(_r,ra)})}function ir(){var ar,Ye=mt+G/2;_t.indexOf("inside")===-1&&(ar=a.bBox(yt.node()),Ye+=R?ar.width:ar.height),St=qt.select("text");var Er=0,pn=R&&wt==="top",dn=!R&&wt==="right",bn=0;if(St.node()&&!St.classed(M.jsPlaceholder)){var Zn,En=qt.select(".h"+_r._id+"title-math-group").node();En&&(R&&er||!R&&!er)?(ar=a.bBox(En),Er=ar.width,Zn=ar.height):(ar=a.bBox(qt.node()),Er=ar.right-it.l-(R?ue:vr),Zn=ar.bottom-it.t-(R?vr:ue),!R&&wt==="top"&&(Ye+=ar.height,bn=ar.height)),dn&&(St.attr("transform",i(Er/2+lt/2,0)),Er*=2),Ye=Math.max(Ye,R?Er:Zn)}var gn=(R?Z:ot)*2+Ye+rt+G/2,da=0;!R&&Tt.text&&et==="bottom"&&Q<=0&&(da=gn/2,gn+=da,bn+=da),q._hColorbarMoveTitle=da,q._hColorbarMoveCBTitle=bn;var ra=rt+G,Se=(R?ue:vr)-ra/2-(R?Z:0),Re=(R?vr:ue)-(R?vt:ot+bn-da);z.select("."+M.cbbg).attr("x",Se).attr("y",Re).attr(R?"width":"height",Math.max(gn-da,2)).attr(R?"height":"width",Math.max(vt+ra,2)).call(s.fill,ct).call(s.stroke,D.bordercolor).style("stroke-width",rt);var Ze=dn?Math.max(Er-10,0):0;z.selectAll("."+M.cboutline).attr("x",(R?ue:vr+Z)+Ze).attr("y",(R?vr+ot-vt:ue)+(pn?Ht:0)).attr(R?"width":"height",Math.max(mt,2)).attr(R?"height":"width",Math.max(vt-(R?2*ot+Ht:2*Z+Ze),2)).call(s.stroke,D.outlinecolor).style({fill:"none","stroke-width":G});var tr=R?Me*gn:0,zr=R?0:(1-Ce)*gn-bn;if(tr=J?it.l-tr:-tr,zr=ut?it.t-zr:-zr,z.attr("transform",i(tr,zr)),!R&&(rt||d(ct).getAlpha()&&!d.equals(q.paper_bgcolor,ct))){var tn=yt.selectAll("text"),Yr=tn[0].length,$r=z.select("."+M.cbbg).node(),In=a.bBox($r),Nn=a.getTranslate(z),Kn=2;tn.each(function(Tr,mr){var kr=0,Ur=Yr-1;if(mr===kr||mr===Ur){var Or=a.bBox(this),pe=a.getTranslate(this),Ke;if(mr===Ur){var xr=Or.right+pe.x,Gr=In.right+Nn.x+vr-rt-Kn+X;Ke=Gr-xr,Ke>0&&(Ke=0)}else if(mr===kr){var ln=Or.left+pe.x,wn=In.left+Nn.x+vr+rt+Kn;Ke=wn-ln,Ke<0&&(Ke=0)}Ke&&(Yr<3?this.setAttribute("transform","translate("+Ke+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var $n={},ia=S[st],Cn=k[st],Fa=S[et],Ga=k[et],ve=gn-mt;R?(F==="pixels"?($n.y=Q,$n.t=vt*Fa,$n.b=vt*Ga):($n.t=$n.b=0,$n.yt=Q+I*Fa,$n.yb=Q-I*Ga),N==="pixels"?($n.x=X,$n.l=gn*ia,$n.r=gn*Cn):($n.l=ve*ia,$n.r=ve*Cn,$n.xl=X-j*ia,$n.xr=X+j*Cn)):(F==="pixels"?($n.x=X,$n.l=vt*ia,$n.r=vt*Cn):($n.l=$n.r=0,$n.xl=X+I*ia,$n.xr=X-I*Cn),N==="pixels"?($n.y=1-Q,$n.t=gn*Fa,$n.b=gn*Ga):($n.t=ve*Fa,$n.b=ve*Ga,$n.yt=Q-j*Fa,$n.yb=Q+j*Ga));var ge=D.y<.5?"b":"t",dr=D.x<.5?"l":"r";B._fullLayout._reservedMargin[D._id]={};var br={r:q.width-Se-tr,l:Se+$n.r,b:q.height-Re-zr,t:Re+$n.b};J&&ut?E.autoMargin(B,D._id,$n):J?B._fullLayout._reservedMargin[D._id][ge]=br[ge]:ut||R?B._fullLayout._reservedMargin[D._id][dr]=br[dr]:B._fullLayout._reservedMargin[D._id][ge]=br[ge]}return r.syncOrAsync([E.previousPromises,ke,Ue,Ee,E.previousPromises,ir],B)}function b(z,D,B){var R=D.orientation==="v",I=B._fullLayout,F=I._size,j,N,G;e.init({element:z.node(),gd:B,prepFn:function(){j=z.attr("transform"),o(z)},moveFn:function(rt,ct){z.attr("transform",j+i(rt,ct)),N=e.align((R?D._uFrac:D._vFrac)+rt/F.w,R?D._thickFrac:D._lenFrac,0,1,D.xanchor),G=e.align((R?D._vFrac:1-D._uFrac)-ct/F.h,R?D._lenFrac:D._thickFrac,0,1,D.yanchor);var st=e.getCursor(N,G,D.xanchor,D.yanchor);o(z,st)},doneFn:function(){if(o(z),N!==void 0&&G!==void 0){var rt={};rt[D._propPrefix+"x"]=N,rt[D._propPrefix+"y"]=G,D._traceIndex!==void 0?A.call("_guiRestyle",B,rt,D._traceIndex):A.call("_guiRelayout",B,rt)}}})}function _(z,D,B){var R=D._levels,I=[],F=[],j,N,G=R.end+R.size/100,rt=R.size,ct=1.001*B[0]-.001*B[1],st=1.001*B[1]-.001*B[0];for(N=0;N<1e5&&(j=R.start+N*rt,!(rt>0?j>=G:j<=G));N++)j>ct&&j0?j>=G:j<=G));N++)j>B[0]&&j{V.exports={moduleType:"component",name:"colorbar",attributes:Vy(),supplyDefaults:fb(),draw:T6().draw,hasColorbar:lb()}}),A6=Vt((K,V)=>{V.exports={moduleType:"component",name:"legend",layoutAttributes:db(),supplyLayoutDefaults:mb(),draw:yb(),style:vb()}}),M6=Vt((K,V)=>{V.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),S6=Vt((K,V)=>{V.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),Xb=Vt((K,V)=>{var u=ji(),d=Xr(),E=d.extendFlat,A=d.extendDeep;function t(r){var i;switch(r){case"themes__thumb":i={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":i={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:i={}}return i}function e(r){var i=["xaxis","yaxis","zaxis"];return i.indexOf(r.slice(0,5))>-1}V.exports=function(r,i){var n,o=r.data,a=r.layout,s=A([],o),f=A({},a,t(i.tileClass)),v=r._context||{};if(i.width&&(f.width=i.width),i.height&&(f.height=i.height),i.tileClass==="thumbnail"||i.tileClass==="themes__thumb"){f.annotations=[];var g=Object.keys(f);for(n=0;n{var u=o0().EventEmitter,d=ji(),E=Xr(),A=Fp(),t=Xb(),e=Jy(),r=Qy();function i(n,o){var a=new u,s=t(n,{format:"png"}),f=s.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);function v(){var m=A.getDelay(f._fullLayout);setTimeout(function(){var w=e(f),l=document.createElement("canvas");l.id=E.randstr(),a=r({format:o.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:l,emitter:a,svg:w}),a.clean=function(){f&&document.body.removeChild(f)}},m)}var g=A.getRedrawFunc(f);return d.call("_doPlot",f,s.data,s.layout,s.config).then(g).then(v).catch(function(m){a.emit("error",m)}),a}V.exports=i}),z6=Vt((K,V)=>{var u=Fp(),d={getDelay:u.getDelay,getRedrawFunc:u.getRedrawFunc,clone:Xb(),toSVG:Jy(),svgToImg:Qy(),toImage:E6(),downloadImage:Ob()};V.exports=d}),L6=Vt(K=>{K.version=Py().version,q4(),jT();var V=ji(),u=K.register=V.register,d=Sk(),E=Object.keys(d);for(t=0;t{V.exports=L6()}),p0=Vt((K,V)=>{V.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),yp=Vt((K,V)=>{var u=pc(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,texttemplateAttrs:A,templatefallbackAttrs:t}=yl(),e=Wl(),r=yu(),i=p0(),n=If().pattern,o=So().extendFlat,a=r({editType:"calc",arrayOk:!0,colorEditType:"style"}),s=u.marker,f=s.line,v=o({},f.width,{dflt:0}),g=o({width:v,editType:"calc"},e("marker.line")),m=o({line:g,editType:"calc"},e("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:n,cornerradius:{valType:"any",editType:"calc"}});V.exports={x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:d("x"),yhoverformat:d("y"),text:u.text,texttemplate:A({editType:"plot"},{keys:i.eventDataKeys}),texttemplatefallback:t({editType:"plot"}),hovertext:u.hovertext,hovertemplate:E({},{keys:i.eventDataKeys}),hovertemplatefallback:t(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:o({},a,{}),insidetextfont:o({},a,{}),outsidetextfont:o({},a,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:o({},u.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:m,offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:{marker:{opacity:u.selected.marker.opacity,color:u.selected.marker.color,editType:"style"},textfont:u.selected.textfont,editType:"style"},unselected:{marker:{opacity:u.unselected.marker.opacity,color:u.unselected.marker.color,editType:"style"},textfont:u.unselected.textfont,editType:"style"},zorder:u.zorder}}),u1=Vt((K,V)=>{V.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),c1=Vt((K,V)=>{var u=Pi(),d=ah().hasColorscale,E=vf(),A=Xr().coercePattern;V.exports=function(t,e,r,i,n){var o=r("marker.color",i),a=d(t,"marker");a&&E(t,e,n,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",u.defaultLine),d(t,"marker.line")&&E(t,e,n,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),A(r,"marker.pattern",o,a),r("selected.marker.color"),r("unselected.marker.color")}}),Ih=Vt((K,V)=>{var u=Lo(),d=Xr(),E=Pi(),A=ji(),t=km(),e=tp(),r=c1(),i=f0(),n=yp(),o=d.coerceFont;function a(g,m,w,l){function x(T,c){return d.coerce(g,m,n,T,c)}var y=t(g,m,l,x);if(!y){m.visible=!1;return}e(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder"),x("orientation",m.x&&!m.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var S=x("textposition");v(g,m,l,x,S,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),r(g,m,x,w,l);var k=(m.marker.line||{}).color,M=A.getComponentMethod("errorbars","supplyDefaults");M(g,m,k||E.defaultLine,{axis:"y"}),M(g,m,k||E.defaultLine,{axis:"x",inherit:"y"}),d.coerceSelectionMarkerOpacity(m,x)}function s(g,m){var w,l;function x(k,M){return d.coerce(l._input,l,n,k,M)}for(var y=0;y=0)return g}else if(typeof g=="string"&&(g=g.trim(),g.slice(-1)==="%"&&u(g.slice(0,-1))&&(g=+g.slice(0,-1),g>=0)))return g+"%"}function v(g,m,w,l,x,y){y=y||{};var S=y.moduleHasSelected!==!1,k=y.moduleHasUnselected!==!1,M=y.moduleHasConstrain!==!1,T=y.moduleHasCliponaxis!==!1,c=y.moduleHasTextangle!==!1,h=y.moduleHasInsideanchor!==!1,b=!!y.hasPathbar,_=Array.isArray(x)||x==="auto",P=_||x==="inside",z=_||x==="outside";if(P||z){var D=o(l,"textfont",w.font),B=d.extendFlat({},D),R=g.textfont&&g.textfont.color,I=!R;if(I&&delete B.color,o(l,"insidetextfont",B),b){var F=d.extendFlat({},D);I&&delete F.color,o(l,"pathbar.textfont",F)}z&&o(l,"outsidetextfont",D),S&&l("selected.textfont.color"),k&&l("unselected.textfont.color"),M&&l("constraintext"),T&&l("cliponaxis"),c&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}P&&h&&l("insidetextanchor")}V.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:v,validateCornerradius:f}}),$b=Vt((K,V)=>{var u=ji(),d=yo(),E=Xr(),A=u1(),t=Ih().validateCornerradius;V.exports=function(e,r,i){function n(S,k){return E.coerce(e,r,A,S,k)}for(var o=!1,a=!1,s=!1,f={},v=n("barmode"),g=v==="group",m=0;m0&&!f[l]&&(s=!0),f[l]=!0),w.visible&&w.type==="histogram"){var x=d.getFromId({_fullLayout:r},w[w.orientation==="v"?"xaxis":"yaxis"]);x.type!=="category"&&(a=!0)}}if(!o){delete r.barmode;return}v!=="overlay"&&n("barnorm"),n("bargap",a&&!s?0:.2),n("bargroupgap");var y=n("barcornerradius");r.barcornerradius=t(y)}}),Gg=Vt((K,V)=>{var u=Xr();V.exports=function(d,E){for(var A=0;A{var u=yo(),d=rp(),E=ah().hasColorscale,A=ih(),t=Gg(),e=Uh();V.exports=function(r,i){var n=u.getFromId(r,i.xaxis||"x"),o=u.getFromId(r,i.yaxis||"y"),a,s,f,v,g,m,w={msUTC:!!(i.base||i.base===0)};i.orientation==="h"?(a=n.makeCalcdata(i,"x",w),f=o.makeCalcdata(i,"y"),v=d(i,o,"y",f),g=!!i.yperiodalignment,m="y"):(a=o.makeCalcdata(i,"y",w),f=n.makeCalcdata(i,"x"),v=d(i,n,"x",f),g=!!i.xperiodalignment,m="x"),s=v.vals;for(var l=Math.min(s.length,a.length),x=new Array(l),y=0;y{var u=Ni(),d=Xr();function E(r,i,n){var o=r._fullLayout,a=o["_"+n+"Text_minsize"];if(a){var s=o.uniformtext.mode==="hide",f;switch(n){case"funnelarea":case"pie":case"sunburst":f="g.slice";break;case"treemap":case"icicle":f="g.slice, g.pathbar";break;default:f="g.points > g.point"}i.selectAll(f).each(function(v){var g=v.transform;if(g){g.scale=s&&g.hide?0:a/g.fontSize;var m=u.select(this).select("text");d.setTransormAndDisplay(m,g)}})}}function A(r,i,n){if(n.uniformtext.mode){var o=e(r),a=n.uniformtext.minsize,s=i.scale*i.fontSize;i.hide=s{var V=Lo(),u=Af(),d=Xr().isArrayOrTypedArray;K.coerceString=function(E,A,t){if(typeof A=="string"){if(A||!E.noBlank)return A}else if((typeof A=="number"||A===!0)&&!E.strict)return String(A);return t!==void 0?t:E.dflt},K.coerceNumber=function(E,A,t){if(V(A)){A=+A;var e=E.min,r=E.max,i=e!==void 0&&Ar;if(!i)return A}return t!==void 0?t:E.dflt},K.coerceColor=function(E,A,t){return u(A).isValid()?A:t!==void 0?t:E.dflt},K.coerceEnumerated=function(E,A,t){return E.coerceNumber&&(A=+A),E.values.indexOf(A)!==-1?A:t!==void 0?t:E.dflt},K.getValue=function(E,A){var t;return d(E)?A{var u=Ni(),d=Pi(),E=Eo(),A=Xr(),t=ji(),e=sh().resizeText,r=yp(),i=r.textfont,n=r.insidetextfont,o=r.outsidetextfont,a=f1();function s(T){var c=u.select(T).selectAll('g[class^="barlayer"]').selectAll("g.trace");e(T,c,"bar");var h=c.size(),b=T._fullLayout;c.style("opacity",function(_){return _[0].trace.opacity}).each(function(_){(b.barmode==="stack"&&h>1||b.bargap===0&&b.bargroupgap===0&&!_[0].trace.marker.line.width)&&u.select(this).attr("shape-rendering","crispEdges")}),c.selectAll("g.points").each(function(_){var P=u.select(this),z=_[0].trace;f(P,z,T)}),t.getComponentMethod("errorbars","style")(c)}function f(T,c,h){E.pointStyle(T.selectAll("path"),c,h),v(T,c,h)}function v(T,c,h){T.selectAll("text").each(function(b){var _=u.select(this),P=A.ensureUniformFontSize(h,l(_,b,c,h));E.font(_,P)})}function g(T,c,h){var b=c[0].trace;b.selectedpoints?m(h,b,T):(f(h,b,T),t.getComponentMethod("errorbars","style")(h))}function m(T,c,h){E.selectedPointStyle(T.selectAll("path"),c),w(T.selectAll("text"),c,h)}function w(T,c,h){T.each(function(b){var _=u.select(this),P;if(b.selected){P=A.ensureUniformFontSize(h,l(_,b,c,h));var z=c.selected.textfont&&c.selected.textfont.color;z&&(P.color=z),E.font(_,P)}else E.selectedTextStyle(_,c)})}function l(T,c,h,b){var _=b._fullLayout.font,P=h.textfont;if(T.classed("bartext-inside")){var z=M(c,h);P=y(h,c.i,_,z)}else T.classed("bartext-outside")&&(P=S(h,c.i,_));return P}function x(T,c,h){return k(i,T.textfont,c,h)}function y(T,c,h,b){var _=x(T,c,h),P=T._input.textfont===void 0||T._input.textfont.color===void 0||Array.isArray(T.textfont.color)&&T.textfont.color[c]===void 0;return P&&(_={color:d.contrast(b),family:_.family,size:_.size,weight:_.weight,style:_.style,variant:_.variant,textcase:_.textcase,lineposition:_.lineposition,shadow:_.shadow}),k(n,T.insidetextfont,c,_)}function S(T,c,h){var b=x(T,c,h);return k(o,T.outsidetextfont,c,b)}function k(T,c,h,b){c=c||{};var _=a.getValue(c.family,h),P=a.getValue(c.size,h),z=a.getValue(c.color,h),D=a.getValue(c.weight,h),B=a.getValue(c.style,h),R=a.getValue(c.variant,h),I=a.getValue(c.textcase,h),F=a.getValue(c.lineposition,h),j=a.getValue(c.shadow,h);return{family:a.coerceString(T.family,_,b.family),size:a.coerceNumber(T.size,P,b.size),color:a.coerceColor(T.color,z,b.color),weight:a.coerceString(T.weight,D,b.weight),style:a.coerceString(T.style,B,b.style),variant:a.coerceString(T.variant,R,b.variant),textcase:a.coerceString(T.variant,I,b.textcase),lineposition:a.coerceString(T.variant,F,b.lineposition),shadow:a.coerceString(T.variant,j,b.shadow)}}function M(T,c){return c.type==="waterfall"?c[T.dir].marker.color:T.mcc||T.mc||c.marker.color}V.exports={style:s,styleTextPoints:v,styleOnSelect:g,getInsideTextFont:y,getOutsideTextFont:S,getBarColor:M,resizeText:e}}),d0=Vt((K,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=Dl(),t=Pi(),e=Eo(),r=ji(),i=yo().tickText,n=sh(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Hh(),f=f1(),v=p0(),g=yp(),m=g.text,w=g.textposition,l=mh().appendArrayPointValue,x=v.TEXTPAD;function y(rt){return rt.id}function S(rt){if(rt.ids)return y}function k(rt){return(rt>0)-(rt<0)}function M(rt,ct){return rt0}function b(rt,ct,st,et,Z,ot){var X=ct.xaxis,Q=ct.yaxis,ut=rt._fullLayout,J=rt._context.staticPlot;Z||(Z={mode:ut.barmode,norm:ut.barmode,gap:ut.bargap,groupgap:ut.bargroupgap},a("bar",ut));var q=E.makeTraceGroups(et,st,"trace bars").each(function(it){var nt=u.select(this),dt=it[0].trace,Tt=it[0].t,wt=dt.type==="waterfall",Ct=dt.type==="funnel",It=dt.type==="histogram",Nt=dt.type==="bar",te=Nt||Ct,Jt=0;wt&&dt.connector.visible&&dt.connector.mode==="between"&&(Jt=dt.connector.line.width/2);var ee=dt.orientation==="h",Zt=h(Z),mt=E.ensureSingle(nt,"g","points"),bt=S(dt),vt=mt.selectAll("g.point").data(E.identity,bt);vt.enter().append("g").classed("point",!0),vt.exit().remove(),vt.each(function(re,Kt){var ue=u.select(this),Me=T(re,X,Q,ee),Ce=Me[0][0],We=Me[0][1],qe=Me[1][0],vr=Me[1][1],_r=(ee?We-Ce:vr-qe)===0;_r&&te&&f.getLineWidth(dt,re)&&(_r=!1),_r||(_r=!d(Ce)||!d(We)||!d(qe)||!d(vr)),re.isBlank=_r,_r&&(ee?We=Ce:vr=qe),Jt&&!_r&&(ee?(Ce-=M(Ce,We)*Jt,We+=M(Ce,We)*Jt):(qe-=M(qe,vr)*Jt,vr+=M(qe,vr)*Jt));var er,Mr;if(dt.type==="waterfall"){if(!_r){var Ir=dt[re.dir].marker;er=Ir.line.width,Mr=Ir.color}}else er=f.getLineWidth(dt,re),Mr=re.mc||dt.marker.color;function de(ra){var Se=u.round(er/2%1,2);return Z.gap===0&&Z.groupgap===0?u.round(Math.round(ra)-Se,2):ra}function Dt(ra,Se,Re){return Re&&ra===Se?ra:Math.abs(ra-Se)>=2?de(ra):ra>Se?Math.ceil(ra):Math.floor(ra)}var qt=t.opacity(Mr),_t=qt<1||er>.01?de:Dt;rt._context.staticPlot||(Ce=_t(Ce,We,ee),We=_t(We,Ce,ee),qe=_t(qe,vr,!ee),vr=_t(vr,qe,!ee));var lt=ee?X.c2p:Q.c2p,yt;re.s0>0?yt=re._sMax:re.s0<0?yt=re._sMin:yt=re.s1>0?re._sMax:re._sMin;function St(ra,Se){if(!ra)return 0;var Re=Math.abs(ee?vr-qe:We-Ce),Ze=Math.abs(ee?We-Ce:vr-qe),tr=_t(Math.abs(lt(yt,!0)-lt(0,!0))),zr=re.hasB?Math.min(Re/2,Ze/2):Math.min(Re/2,tr),tn;if(Se==="%"){var Yr=Math.min(50,ra);tn=Re*(Yr/100)}else tn=ra;return _t(Math.max(Math.min(tn,zr),0))}var Ht=Nt||It?St(Tt.cornerradiusvalue,Tt.cornerradiusform):0,Yt,se,ke="M"+Ce+","+qe+"V"+vr+"H"+We+"V"+qe+"Z",Ee=0;if(Ht&&re.s){var Ue=k(re.s0)===0||k(re.s)===k(re.s0)?re.s1:re.s0;if(Ee=_t(re.hasB?0:Math.abs(lt(yt,!0)-lt(Ue,!0))),Ee0?Math.sqrt(Ee*(2*Ht-Ee)):0,dn=ir>0?Math.max:Math.min;Yt="M"+Ce+","+qe+"V"+(vr-Er*ar)+"H"+dn(We-(Ht-Ee)*ir,Ce)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+We+","+(vr-Ht*ar-pn)+"V"+(qe+Ht*ar+pn)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+dn(We-(Ht-Ee)*ir,Ce)+","+(qe+Er*ar)+"Z"}else if(re.hasB)Yt="M"+(Ce+Ht*ir)+","+qe+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+Ce+","+(qe+Ht*ar)+"V"+(vr-Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(Ce+Ht*ir)+","+vr+"H"+(We-Ht*ir)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+We+","+(vr-Ht*ar)+"V"+(qe+Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(We-Ht*ir)+","+qe+"Z";else{se=Math.abs(vr-qe)+Ee;var bn=se0?Math.sqrt(Ee*(2*Ht-Ee)):0,En=ar>0?Math.max:Math.min;Yt="M"+(Ce+bn*ir)+","+qe+"V"+En(vr-(Ht-Ee)*ar,qe)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(Ce+Ht*ir-Zn)+","+vr+"H"+(We-Ht*ir+Zn)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(We-bn*ir)+","+En(vr-(Ht-Ee)*ar,qe)+"V"+qe+"Z"}}else Yt=ke}else Yt=ke;var gn=c(E.ensureSingle(ue,"path"),ut,Z,ot);if(gn.style("vector-effect",J?"none":"non-scaling-stroke").attr("d",isNaN((We-Ce)*(vr-qe))||_r&&rt._context.staticPlot?"M0,0Z":Yt).call(e.setClipUrl,ct.layerClipId,rt),!ut.uniformtext.mode&&Zt){var da=e.makePointStyleFns(dt);e.singlePointStyle(re,gn,dt,da,rt)}_(rt,ct,ue,it,Kt,Ce,We,qe,vr,Ht,Ee,Z,ot),ct.layerClipId&&e.hideOutsideRangePoint(re,ue.select("text"),X,Q,dt.xcalendar,dt.ycalendar)});var Ut=dt.cliponaxis===!1;e.setClipUrl(nt,Ut?null:ct.layerClipId,rt)});r.getComponentMethod("errorbars","plot")(rt,q,ct,Z)}function _(rt,ct,st,et,Z,ot,X,Q,ut,J,q,it,nt){var dt=ct.xaxis,Tt=ct.yaxis,wt=rt._fullLayout,Ct;function It(se,ke,Ee){var Ue=E.ensureSingle(se,"text").text(ke).attr({class:"bartext bartext-"+Ct,"text-anchor":"middle","data-notex":1}).call(e.font,Ee).call(A.convertToTspans,rt);return Ue}var Nt=et[0].trace,te=Nt.orientation==="h",Jt=F(wt,et,Z,dt,Tt);Ct=j(Nt,Z);var ee=it.mode==="stack"||it.mode==="relative",Zt=et[Z],mt=!ee||Zt._outmost,bt=Zt.hasB,vt=J&&J-q>x;if(!Jt||Ct==="none"||(Zt.isBlank||ot===X||Q===ut)&&(Ct==="auto"||Ct==="inside")){st.select("text").remove();return}var Ut=wt.font,re=s.getBarColor(et[Z],Nt),Kt=s.getInsideTextFont(Nt,Z,Ut,re),ue=s.getOutsideTextFont(Nt,Z,Ut),Me=Nt.insidetextanchor||"end",Ce=st.datum();te?dt.type==="log"&&Ce.s0<=0&&(dt.range[0]0&&de>0,_t;vt?bt?_t=P(vr-2*J,_r,Ir,de,te)||P(vr,_r-2*J,Ir,de,te):te?_t=P(vr-(J-q),_r,Ir,de,te)||P(vr,_r-2*(J-q),Ir,de,te):_t=P(vr,_r-(J-q),Ir,de,te)||P(vr-2*(J-q),_r,Ir,de,te):_t=P(vr,_r,Ir,de,te),qt&&_t?Ct="inside":(Ct="outside",er.remove(),er=null)}else Ct="inside";if(!er){Dt=E.ensureUniformFontSize(rt,Ct==="outside"?ue:Kt),er=It(st,Jt,Dt);var lt=er.attr("transform");if(er.attr("transform",""),Mr=e.bBox(er.node()),Ir=Mr.width,de=Mr.height,er.attr("transform",lt),Ir<=0||de<=0){er.remove();return}}var yt=Nt.textangle,St,Ht;Ct==="outside"?(Ht=Nt.constraintext==="both"||Nt.constraintext==="outside",St=I(ot,X,Q,ut,Mr,{isHorizontal:te,constrained:Ht,angle:yt})):(Ht=Nt.constraintext==="both"||Nt.constraintext==="inside",St=B(ot,X,Q,ut,Mr,{isHorizontal:te,constrained:Ht,angle:yt,anchor:Me,hasB:bt,r:J,overhead:q})),St.fontSize=Dt.size,o(Nt.type==="histogram"?"bar":Nt.type,St,wt),Zt.transform=St;var Yt=c(er,wt,it,nt);E.setTransormAndDisplay(Yt,St)}function P(rt,ct,st,et,Z){if(rt<0||ct<0)return!1;var ot=st<=rt&&et<=ct,X=st<=ct&&et<=rt,Q=Z?rt>=st*(ct/et):ct>=et*(rt/st);return ot||X||Q}function z(rt){return rt==="auto"?0:rt}function D(rt,ct){var st=Math.PI/180*ct,et=Math.abs(Math.sin(st)),Z=Math.abs(Math.cos(st));return{x:rt.width*Z+rt.height*et,y:rt.width*et+rt.height*Z}}function B(rt,ct,st,et,Z,ot){var X=!!ot.isHorizontal,Q=!!ot.constrained,ut=ot.angle||0,J=ot.anchor,q=J==="end",it=J==="start",nt=ot.leftToRight||0,dt=(nt+1)/2,Tt=1-dt,wt=ot.hasB,Ct=ot.r,It=ot.overhead,Nt=Z.width,te=Z.height,Jt=Math.abs(ct-rt),ee=Math.abs(et-st),Zt=Jt>2*x&&ee>2*x?x:0;Jt-=2*Zt,ee-=2*Zt;var mt=z(ut);ut==="auto"&&!(Nt<=Jt&&te<=ee)&&(Nt>Jt||te>ee)&&(!(Nt>ee||te>Jt)||Ntx){var re=R(rt,ct,st,et,bt,Ct,It,X,wt);vt=re.scale,Ut=re.pad}else vt=1,Q&&(vt=Math.min(1,Jt/bt.x,ee/bt.y)),Ut=0;var Kt=Z.left*Tt+Z.right*dt,ue=(Z.top+Z.bottom)/2,Me=(rt+x)*Tt+(ct-x)*dt,Ce=(st+et)/2,We=0,qe=0;if(it||q){var vr=(X?bt.x:bt.y)/2;Ct&&(q||wt)&&(Zt+=Ut);var _r=X?M(rt,ct):M(st,et);X?it?(Me=rt+_r*Zt,We=-_r*vr):(Me=ct-_r*Zt,We=_r*vr):it?(Ce=st+_r*Zt,qe=-_r*vr):(Ce=et-_r*Zt,qe=_r*vr)}return{textX:Kt,textY:ue,targetX:Me,targetY:Ce,anchorX:We,anchorY:qe,scale:vt,rotate:mt}}function R(rt,ct,st,et,Z,ot,X,Q,ut){var J=Math.max(0,Math.abs(ct-rt)-2*x),q=Math.max(0,Math.abs(et-st)-2*x),it=ot-x,nt=X?it-Math.sqrt(it*it-(it-X)*(it-X)):it,dt=ut?it*2:Q?it-X:2*nt,Tt=ut?it*2:Q?2*nt:it-X,wt,Ct,It,Nt,te;return Z.y/Z.x>=q/(J-dt)?Nt=q/Z.y:Z.y/Z.x<=(q-Tt)/J?Nt=J/Z.x:!ut&&Q?(wt=Z.x*Z.x+Z.y*Z.y/4,Ct=-2*Z.x*(J-it)-Z.y*(q/2-it),It=(J-it)*(J-it)+(q/2-it)*(q/2-it)-it*it,Nt=(-Ct+Math.sqrt(Ct*Ct-4*wt*It))/(2*wt)):ut?(wt=(Z.x*Z.x+Z.y*Z.y)/4,Ct=-Z.x*(J/2-it)-Z.y*(q/2-it),It=(J/2-it)*(J/2-it)+(q/2-it)*(q/2-it)-it*it,Nt=(-Ct+Math.sqrt(Ct*Ct-4*wt*It))/(2*wt)):(wt=Z.x*Z.x/4+Z.y*Z.y,Ct=-Z.x*(J/2-it)-2*Z.y*(q-it),It=(J/2-it)*(J/2-it)+(q-it)*(q-it)-it*it,Nt=(-Ct+Math.sqrt(Ct*Ct-4*wt*It))/(2*wt)),Nt=Math.min(1,Nt),Q?te=Math.max(0,it-Math.sqrt(Math.max(0,it*it-(it-(q-Z.y*Nt)/2)*(it-(q-Z.y*Nt)/2)))-X):te=Math.max(0,it-Math.sqrt(Math.max(0,it*it-(it-(J-Z.x*Nt)/2)*(it-(J-Z.x*Nt)/2)))-X),{scale:Nt,pad:te}}function I(rt,ct,st,et,Z,ot){var X=!!ot.isHorizontal,Q=!!ot.constrained,ut=ot.angle||0,J=Z.width,q=Z.height,it=Math.abs(ct-rt),nt=Math.abs(et-st),dt;X?dt=nt>2*x?x:0:dt=it>2*x?x:0;var Tt=1;Q&&(Tt=X?Math.min(1,nt/q):Math.min(1,it/J));var wt=z(ut),Ct=D(Z,wt),It=(X?Ct.x:Ct.y)/2,Nt=(Z.left+Z.right)/2,te=(Z.top+Z.bottom)/2,Jt=(rt+ct)/2,ee=(st+et)/2,Zt=0,mt=0,bt=X?M(ct,rt):M(st,et);return X?(Jt=ct-bt*dt,Zt=bt*It):(ee=et+bt*dt,mt=-bt*It),{textX:Nt,textY:te,targetX:Jt,targetY:ee,anchorX:Zt,anchorY:mt,scale:Tt,rotate:wt}}function F(rt,ct,st,et,Z){var ot=ct[0].trace,X=ot.texttemplate,Q;return X?Q=N(rt,ct,st,et,Z):ot.textinfo?Q=G(ct,st,et,Z):Q=f.getValue(ot.text,st),f.coerceString(m,Q)}function j(rt,ct){var st=f.getValue(rt.textposition,ct);return f.coerceEnumerated(w,st)}function N(rt,ct,st,et,Z){var ot=ct[0].trace,X=E.castOption(ot,st,"texttemplate");if(!X)return"";var Q=ot.type==="histogram",ut=ot.type==="waterfall",J=ot.type==="funnel",q=ot.orientation==="h",it,nt,dt,Tt;q?(it="y",nt=Z,dt="x",Tt=et):(it="x",nt=et,dt="y",Tt=Z);function wt(Zt){return i(nt,nt.c2l(Zt),!0).text}function Ct(Zt){return i(Tt,Tt.c2l(Zt),!0).text}var It=ct[st],Nt={};Nt.label=It.p,Nt.labelLabel=Nt[it+"Label"]=wt(It.p);var te=E.castOption(ot,It.i,"text");(te===0||te)&&(Nt.text=te),Nt.value=It.s,Nt.valueLabel=Nt[dt+"Label"]=Ct(It.s);var Jt={};l(Jt,ot,It.i),(Q||Jt.x===void 0)&&(Jt.x=q?Nt.value:Nt.label),(Q||Jt.y===void 0)&&(Jt.y=q?Nt.label:Nt.value),(Q||Jt.xLabel===void 0)&&(Jt.xLabel=q?Nt.valueLabel:Nt.labelLabel),(Q||Jt.yLabel===void 0)&&(Jt.yLabel=q?Nt.labelLabel:Nt.valueLabel),ut&&(Nt.delta=+It.rawS||It.s,Nt.deltaLabel=Ct(Nt.delta),Nt.final=It.v,Nt.finalLabel=Ct(Nt.final),Nt.initial=Nt.final-Nt.delta,Nt.initialLabel=Ct(Nt.initial)),J&&(Nt.value=It.s,Nt.valueLabel=Ct(Nt.value),Nt.percentInitial=It.begR,Nt.percentInitialLabel=E.formatPercent(It.begR),Nt.percentPrevious=It.difR,Nt.percentPreviousLabel=E.formatPercent(It.difR),Nt.percentTotal=It.sumR,Nt.percenTotalLabel=E.formatPercent(It.sumR));var ee=E.castOption(ot,It.i,"customdata");return ee&&(Nt.customdata=ee),E.texttemplateString({data:[Jt,Nt,ot._meta],fallback:ot.texttemplatefallback,labels:Nt,locale:rt._d3locale,template:X})}function G(rt,ct,st,et){var Z=rt[0].trace,ot=Z.orientation==="h",X=Z.type==="waterfall",Q=Z.type==="funnel";function ut(ee){var Zt=ot?et:st;return i(Zt,ee,!0).text}function J(ee){var Zt=ot?st:et;return i(Zt,+ee,!0).text}var q=Z.textinfo,it=rt[ct],nt=q.split("+"),dt=[],Tt,wt=function(ee){return nt.indexOf(ee)!==-1};if(wt("label")&&dt.push(ut(rt[ct].p)),wt("text")&&(Tt=E.castOption(Z,it.i,"text"),(Tt===0||Tt)&&dt.push(Tt)),X){var Ct=+it.rawS||it.s,It=it.v,Nt=It-Ct;wt("initial")&&dt.push(J(Nt)),wt("delta")&&dt.push(J(Ct)),wt("final")&&dt.push(J(It))}if(Q){wt("value")&&dt.push(J(it.s));var te=0;wt("percent initial")&&te++,wt("percent previous")&&te++,wt("percent total")&&te++;var Jt=te>1;wt("percent initial")&&(Tt=E.formatPercent(it.begR),Jt&&(Tt+=" of initial"),dt.push(Tt)),wt("percent previous")&&(Tt=E.formatPercent(it.difR),Jt&&(Tt+=" of previous"),dt.push(Tt)),wt("percent total")&&(Tt=E.formatPercent(it.sumR),Jt&&(Tt+=" of total"),dt.push(Tt))}return dt.join("
                ")}V.exports={plot:b,toMoveInsideBar:B}}),Lm=Vt((K,V)=>{var u=hc(),d=ji(),E=Pi(),A=Xr().fillText,t=f1().getLineWidth,e=yo().hoverLabelText,r=ks().BADNUM;function i(a,s,f,v,g){var m=n(a,s,f,v,g);if(m){var w=m.cd,l=w[0].trace,x=w[m.index];return m.color=o(l,x),d.getComponentMethod("errorbars","hoverInfo")(x,l,m),[m]}}function n(a,s,f,v,g){var m=a.cd,w=m[0].trace,l=m[0].t,x=v==="closest",y=w.type==="waterfall",S=a.maxHoverDistance,k=a.maxSpikeDistance,M,T,c,h,b,_,P;w.orientation==="h"?(M=f,T=s,c="y",h="x",b=et,_=rt):(M=s,T=f,c="x",h="y",_=et,b=rt);var z=w[c+"period"],D=x||z;function B(Tt){return I(Tt,-1)}function R(Tt){return I(Tt,1)}function I(Tt,wt){var Ct=Tt.w;return Tt[c]+wt*Ct/2}function F(Tt){return Tt[c+"End"]-Tt[c+"Start"]}var j=x?B:z?function(Tt){return Tt.p-F(Tt)/2}:function(Tt){return Math.min(B(Tt),Tt.p-l.bardelta/2)},N=x?R:z?function(Tt){return Tt.p+F(Tt)/2}:function(Tt){return Math.max(R(Tt),Tt.p+l.bardelta/2)};function G(Tt,wt,Ct){return g.finiteRange&&(Ct=0),u.inbox(Tt-M,wt-M,Ct+Math.min(1,Math.abs(wt-Tt)/P)-1)}function rt(Tt){return G(j(Tt),N(Tt),S)}function ct(Tt){return G(B(Tt),R(Tt),k)}function st(Tt){var wt=Tt[h];if(y){var Ct=Math.abs(Tt.rawS)||0;T>0?wt+=Ct:T<0&&(wt-=Ct)}return wt}function et(Tt){var wt=T,Ct=Tt.b,It=st(Tt);return u.inbox(Ct-wt,It-wt,S+(It-wt)/(It-Ct)-1)}function Z(Tt){var wt=T,Ct=Tt.b,It=st(Tt);return u.inbox(Ct-wt,It-wt,k+(It-wt)/(It-Ct)-1)}var ot=a[c+"a"],X=a[h+"a"];P=Math.abs(ot.r2c(ot.range[1])-ot.r2c(ot.range[0]));function Q(Tt){return(b(Tt)+_(Tt))/2}var ut=u.getDistanceFunction(v,b,_,Q);if(u.getClosest(m,ut,a),a.index!==!1&&m[a.index].p!==r){D||(j=function(Tt){return Math.min(B(Tt),Tt.p-l.bargroupwidth/2)},N=function(Tt){return Math.max(R(Tt),Tt.p+l.bargroupwidth/2)});var J=a.index,q=m[J],it=w.base?q.b+q.s:q.s;a[h+"0"]=a[h+"1"]=X.c2p(q[h],!0),a[h+"LabelVal"]=it;var nt=l.extents[l.extents.round(q.p)];a[c+"0"]=ot.c2p(x?j(q):nt[0],!0),a[c+"1"]=ot.c2p(x?N(q):nt[1],!0);var dt=q.orig_p!==void 0;return a[c+"LabelVal"]=dt?q.orig_p:q.p,a.labelLabel=e(ot,a[c+"LabelVal"],w[c+"hoverformat"]),a.valueLabel=e(X,a[h+"LabelVal"],w[h+"hoverformat"]),a.baseLabel=e(X,q.b,w[h+"hoverformat"]),a.spikeDistance=(Z(q)+ct(q))/2,a[c+"Spike"]=ot.c2p(q.p,!0),A(q,w,a),a.hovertemplate=w.hovertemplate,a}}function o(a,s){var f=s.mcc||a.marker.color,v=s.mlcc||a.marker.line.color,g=t(a,s);if(E.opacity(f))return f;if(E.opacity(v)&&g)return v}V.exports={hoverPoints:i,hoverOnBars:n,getTraceColor:o}}),P6=Vt((K,V)=>{V.exports=function(u,d,E){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),E.orientation==="h"?(u.label=u.y,u.value=u.x):(u.label=u.x,u.value=u.y),u}}),Cm=Vt((K,V)=>{V.exports=function(d,E){var A=d.cd,t=d.xaxis,e=d.yaxis,r=A[0].trace,i=r.type==="funnel",n=r.orientation==="h",o=[],a;if(E===!1)for(a=0;a{V.exports={attributes:yp(),layoutAttributes:u1(),supplyDefaults:Ih().supplyDefaults,crossTraceDefaults:Ih().crossTraceDefaults,supplyLayoutDefaults:$b(),calc:I6(),crossTraceCalc:h0().crossTraceCalc,colorbar:Zf(),arraysToCalcdata:Gg(),plot:d0().plot,style:Hh().style,styleOnSelect:Hh().styleOnSelect,hoverPoints:Lm().hoverPoints,eventData:P6(),selectPoints:Cm(),moduleType:"trace",name:"bar",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),D6=Vt((K,V)=>{V.exports=O6()}),Zg=Vt((K,V)=>{var u=Qh(),d=pc(),E=yp(),A=af(),t=fc().axisHoverFormat,{hovertemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=So().extendFlat,n=d.marker,o=n.line;V.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},n.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},n.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:i({},n.angle,{arrayOk:!1,editType:"calc"}),size:i({},n.size,{arrayOk:!1,editType:"calc"}),color:i({},n.color,{arrayOk:!1,editType:"style"}),line:{color:i({},o.color,{arrayOk:!1,dflt:A.defaultLine,editType:"style"}),width:i({},o.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:u(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:E.offsetgroup,alignmentgroup:E.alignmentgroup,selected:{marker:d.selected.marker,editType:"style"},unselected:{marker:d.unselected.marker,editType:"style"},text:i({},d.text,{}),hovertext:i({},d.hovertext,{}),hovertemplate:e({}),hovertemplatefallback:r(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:d.zorder}}),Kg=Vt((K,V)=>{V.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),Yg=Vt((K,V)=>{var u=Xr(),d=ji(),E=Pi(),A=tp(),t=f0(),e=wm(),r=Zg();function i(s,f,v,g){function m(h,b){return u.coerce(s,f,r,h,b)}if(n(s,f,m,g),f.visible!==!1){A(s,f,g,m),m("xhoverformat"),m("yhoverformat");var w=f._hasPreCompStats;w&&(m("lowerfence"),m("upperfence")),m("line.color",(s.marker||{}).color||v),m("line.width"),m("fillcolor",E.addOpacity(f.line.color,.5));var l=!1;if(w){var x=m("mean"),y=m("sd");x&&x.length&&(l=!0,y&&y.length&&(l="sd"))}m("whiskerwidth");var S=m("sizemode"),k;S==="quartiles"&&(k=m("boxmean",l)),m("showwhiskers",S==="quartiles"),(S==="sd"||k==="sd")&&m("sdmultiple"),m("width"),m("quartilemethod");var M=!1;if(w){var T=m("notchspan");T&&T.length&&(M=!0)}else u.validate(s.notchwidth,r.notchwidth)&&(M=!0);var c=m("notched",M);c&&m("notchwidth"),o(s,f,m,{prefix:"box"}),m("zorder")}}function n(s,f,v,g){function m(G){var rt=0;return G&&G.length&&(rt+=1,u.isArrayOrTypedArray(G[0])&&G[0].length&&(rt+=1)),rt}function w(G){return u.validate(s[G],r[G])}var l=v("y"),x=v("x"),y;if(f.type==="box"){var S=v("q1"),k=v("median"),M=v("q3");f._hasPreCompStats=S&&S.length&&k&&k.length&&M&&M.length,y=Math.min(u.minRowLength(S),u.minRowLength(k),u.minRowLength(M))}var T=m(l),c=m(x),h=T&&u.minRowLength(l),b=c&&u.minRowLength(x),_=g.calendar,P={autotypenumbers:g.autotypenumbers},z,D;if(f._hasPreCompStats)switch(String(c)+String(T)){case"00":var B=w("x0")||w("dx"),R=w("y0")||w("dy");R&&!B?z="h":z="v",D=y;break;case"10":z="v",D=Math.min(y,b);break;case"20":z="h",D=Math.min(y,x.length);break;case"01":z="h",D=Math.min(y,h);break;case"02":z="v",D=Math.min(y,l.length);break;case"12":z="v",D=Math.min(y,b,l.length);break;case"21":z="h",D=Math.min(y,x.length,h);break;case"11":D=0;break;case"22":var I=!1,F;for(F=0;F0?(z="v",c>0?D=Math.min(b,h):D=Math.min(h)):c>0?(z="h",D=Math.min(b)):D=0;if(!D){f.visible=!1;return}f._length=D;var j=v("orientation",z);f._hasPreCompStats?j==="v"&&c===0?(v("x0",0),v("dx",1)):j==="h"&&T===0&&(v("y0",0),v("dy",1)):j==="v"&&c===0?v("x0"):j==="h"&&T===0&&v("y0");var N=d.getComponentMethod("calendars","handleTraceDefaults");N(s,f,["x","y"],g)}function o(s,f,v,g){var m=g.prefix,w=u.coerce2(s,f,r,"marker.outliercolor"),l=v("marker.line.outliercolor"),x="outliers";f._hasPreCompStats?x="all":(w||l)&&(x="suspectedoutliers");var y=v(m+"points",x);y?(v("jitter",y==="all"?.3:0),v("pointpos",y==="all"?-1.5:0),v("marker.symbol"),v("marker.opacity"),v("marker.size"),v("marker.angle"),v("marker.color",f.line.color),v("marker.line.color"),v("marker.line.width"),y==="suspectedoutliers"&&(v("marker.line.outliercolor",f.marker.color),v("marker.line.outlierwidth")),v("selected.marker.color"),v("unselected.marker.color"),v("selected.marker.size"),v("unselected.marker.size"),v("text"),v("hovertext")):delete f.marker;var S=v("hoveron");(S==="all"||S.indexOf("points")!==-1)&&(v("hovertemplate"),v("hovertemplatefallback")),u.coerceSelectionMarkerOpacity(f,v)}function a(s,f){var v,g;function m(y){return u.coerce(g._input,g,r,y)}for(var w=0;w{var u=ji(),d=Xr(),E=Kg();function A(e,r,i,n,o){for(var a=o+"Layout",s=!1,f=0;f{var u=Lo(),d=yo(),E=rp(),A=Xr(),t=ks().BADNUM,e=A._;V.exports=function(y,S){var k=y._fullLayout,M=d.getFromId(y,S.xaxis||"x"),T=d.getFromId(y,S.yaxis||"y"),c=[],h=S.type==="violin"?"_numViolins":"_numBoxes",b,_,P,z,D,B,R;S.orientation==="h"?(P=M,z="x",D=T,B="y",R=!!S.yperiodalignment):(P=T,z="y",D=M,B="x",R=!!S.xperiodalignment);var I=r(S,B,D,k[h]),F=I[0],j=I[1],N=A.distinctVals(F,D),G=N.vals,rt=N.minDiff/2,ct,st,et,Z,ot,X,Q=(S.boxpoints||S.points)==="all"?A.identity:function(vr){return vr.vct.uf};if(S._hasPreCompStats){var ut=S[z],J=function(vr){return P.d2c((S[vr]||[])[b])},q=1/0,it=-1/0;for(b=0;b=ct.q1&&ct.q3>=ct.med){var dt=J("lowerfence");ct.lf=dt!==t&&dt<=ct.q1?dt:g(ct,et,Z);var Tt=J("upperfence");ct.uf=Tt!==t&&Tt>=ct.q3?Tt:m(ct,et,Z);var wt=J("mean");ct.mean=wt!==t?wt:Z?A.mean(et,Z):(ct.q1+ct.q3)/2;var Ct=J("sd");ct.sd=wt!==t&&Ct>=0?Ct:Z?A.stdev(et,Z,ct.mean):ct.q3-ct.q1,ct.lo=w(ct),ct.uo=l(ct);var It=J("notchspan");It=It!==t&&It>0?It:x(ct,Z),ct.ln=ct.med-It,ct.un=ct.med+It;var Nt=ct.lf,te=ct.uf;S.boxpoints&&et.length&&(Nt=Math.min(Nt,et[0]),te=Math.max(te,et[Z-1])),S.notched&&(Nt=Math.min(Nt,ct.ln),te=Math.max(te,ct.un)),ct.min=Nt,ct.max=te}else{A.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+ct.q1,"median = "+ct.med,"q3 = "+ct.q3].join(` -`));var Jt;ct.med!==t?Jt=ct.med:ct.q1!==t?ct.q3!==t?Jt=(ct.q1+ct.q3)/2:Jt=ct.q1:ct.q3!==t?Jt=ct.q3:Jt=0,ct.med=Jt,ct.q1=ct.q3=Jt,ct.lf=ct.uf=Jt,ct.mean=ct.sd=Jt,ct.ln=ct.un=Jt,ct.min=ct.max=Jt}q=Math.min(q,ct.min),it=Math.max(it,ct.max),ct.pts2=st.filter(Q),c.push(ct)}}S._extremes[P._id]=d.findExtremes(P,[q,it],{padded:!0})}else{var ee=P.makeCalcdata(S,z),Zt=i(G,rt),mt=G.length,bt=n(mt);for(b=0;b=0&&vt0){if(ct={},ct.pos=ct[B]=G[b],st=ct.pts=bt[b].sort(f),et=ct[z]=st.map(v),Z=et.length,ct.min=et[0],ct.max=et[Z-1],ct.mean=A.mean(et,Z),ct.sd=A.stdev(et,Z,ct.mean)*S.sdmultiple,ct.med=A.interp(et,.5),Z%2&&(ue||Me)){var Ce,We;ue?(Ce=et.slice(0,Z/2),We=et.slice(Z/2+1)):Me&&(Ce=et.slice(0,Z/2+1),We=et.slice(Z/2)),ct.q1=A.interp(Ce,.5),ct.q3=A.interp(We,.5)}else ct.q1=A.interp(et,.25),ct.q3=A.interp(et,.75);ct.lf=g(ct,et,Z),ct.uf=m(ct,et,Z),ct.lo=w(ct),ct.uo=l(ct);var qe=x(ct,Z);ct.ln=ct.med-qe,ct.un=ct.med+qe,Ut=Math.min(Ut,ct.ln),re=Math.max(re,ct.un),ct.pts2=st.filter(Q),c.push(ct)}S.notched&&A.isTypedArray(ee)&&(ee=Array.from(ee)),S._extremes[P._id]=d.findExtremes(P,S.notched?ee.concat([Ut,re]):ee,{padded:!0})}return s(c,S),c.length>0?(c[0].t={num:k[h],dPos:rt,posLetter:B,valLetter:z,labels:{med:e(y,"median:"),min:e(y,"min:"),q1:e(y,"q1:"),q3:e(y,"q3:"),max:e(y,"max:"),mean:S.boxmean==="sd"||S.sizemode==="sd"?e(y,"mean ± σ:").replace("σ",S.sdmultiple===1?"σ":S.sdmultiple+"σ"):e(y,"mean:"),lf:e(y,"lower fence:"),uf:e(y,"upper fence:")}},k[h]++,c):[{t:{empty:!0}}]};function r(y,S,k,M){var T=S in y,c=S+"0"in y,h="d"+S in y;if(T||c&&h){var b=k.makeCalcdata(y,S),_=E(y,k,S,b).vals;return[_,b]}var P;c?P=y[S+"0"]:"name"in y&&(k.type==="category"||u(y.name)&&["linear","log"].indexOf(k.type)!==-1||A.isDateTime(y.name)&&k.type==="date")?P=y.name:P=M;for(var z=k.type==="multicategory"?k.r2c_just_indices(P):k.d2c(P,0,y[S+"calendar"]),D=y._length,B=new Array(D),R=0;R{var u=yo(),d=Xr(),E=u0().getAxisGroup,A=["v","h"];function t(r,i){for(var n=r.calcdata,o=i.xaxis,a=i.yaxis,s=0;s1,c=1-s[r+"gap"],h=1-s[r+"groupgap"];for(g=0;g0;if(z==="positive"?(st=D*(P?1:.5),ot=Z,et=ot=R):z==="negative"?(st=ot=R,et=D*(P?1:.5),X=Z):(st=et=D,ot=X=Z),nt){var dt=b.pointpos,Tt=b.jitter,wt=b.marker.size/2,Ct=0;dt+Tt>=0&&(Ct=Z*(dt+Tt),Ct>st?(it=!0,J=wt,Q=Ct):Ct>ot&&(J=wt,Q=st)),Ct<=st&&(Q=st);var It=0;dt-Tt<=0&&(It=-Z*(dt-Tt),It>et?(it=!0,q=wt,ut=It):It>X&&(q=wt,ut=et)),It<=et&&(ut=et)}else Q=st,ut=et;var Nt=new Array(w.length);for(m=0;m{var u=Ni(),d=Xr(),E=Eo(),A=5,t=.01;function e(o,a,s,f){var v=o._context.staticPlot,g=a.xaxis,m=a.yaxis;d.makeTraceGroups(f,s,"trace boxes").each(function(w){var l=u.select(this),x=w[0],y=x.t,S=x.trace;if(y.wdPos=y.bdPos*S.whiskerwidth,S.visible!==!0||y.empty){l.remove();return}var k,M;S.orientation==="h"?(k=m,M=g):(k=g,M=m),r(l,{pos:k,val:M},S,y,v),i(l,{x:g,y:m},S,y),n(l,{pos:k,val:M},S,y)})}function r(o,a,s,f,v){var g=s.orientation==="h",m=a.val,w=a.pos,l=!!w.rangebreaks,x=f.bPos,y=f.wdPos||0,S=f.bPosPxOffset||0,k=s.whiskerwidth||0,M=s.showwhiskers!==!1,T=s.notched||!1,c=T?1-2*s.notchwidth:1,h,b;Array.isArray(f.bdPos)?(h=f.bdPos[0],b=f.bdPos[1]):(h=f.bdPos,b=f.bdPos);var _=o.selectAll("path.box").data(s.type!=="violin"||s.box.visible?d.identity:[]);_.enter().append("path").style("vector-effect",v?"none":"non-scaling-stroke").attr("class","box"),_.exit().remove(),_.each(function(P){if(P.empty)return u.select(this).attr("d","M0,0Z");var z=w.c2l(P.pos+x,!0),D=w.l2p(z-h)+S,B=w.l2p(z+b)+S,R=l?(D+B)/2:w.l2p(z)+S,I=s.whiskerwidth,F=l?D*I+(1-I)*R:w.l2p(z-y)+S,j=l?B*I+(1-I)*R:w.l2p(z+y)+S,N=w.l2p(z-h*c)+S,G=w.l2p(z+b*c)+S,rt=s.sizemode==="sd",ct=m.c2p(rt?P.mean-P.sd:P.q1,!0),st=rt?m.c2p(P.mean+P.sd,!0):m.c2p(P.q3,!0),et=d.constrain(rt?m.c2p(P.mean,!0):m.c2p(P.med,!0),Math.min(ct,st)+1,Math.max(ct,st)-1),Z=P.lf===void 0||s.boxpoints===!1||rt,ot=m.c2p(Z?P.min:P.lf,!0),X=m.c2p(Z?P.max:P.uf,!0),Q=m.c2p(P.ln,!0),ut=m.c2p(P.un,!0);g?u.select(this).attr("d","M"+et+","+N+"V"+G+"M"+ct+","+D+"V"+B+(T?"H"+Q+"L"+et+","+G+"L"+ut+","+B:"")+"H"+st+"V"+D+(T?"H"+ut+"L"+et+","+N+"L"+Q+","+D:"")+"Z"+(M?"M"+ct+","+R+"H"+ot+"M"+st+","+R+"H"+X+(k===0?"":"M"+ot+","+F+"V"+j+"M"+X+","+F+"V"+j):"")):u.select(this).attr("d","M"+N+","+et+"H"+G+"M"+D+","+ct+"H"+B+(T?"V"+Q+"L"+G+","+et+"L"+B+","+ut:"")+"V"+st+"H"+D+(T?"V"+ut+"L"+N+","+et+"L"+D+","+Q:"")+"Z"+(M?"M"+R+","+ct+"V"+ot+"M"+R+","+st+"V"+X+(k===0?"":"M"+F+","+ot+"H"+j+"M"+F+","+X+"H"+j):""))})}function i(o,a,s,f){var v=a.x,g=a.y,m=f.bdPos,w=f.bPos,l=s.boxpoints||s.points;d.seedPseudoRandom();var x=function(k){return k.forEach(function(M){M.t=f,M.trace=s}),k},y=o.selectAll("g.points").data(l?x:[]);y.enter().append("g").attr("class","points"),y.exit().remove();var S=y.selectAll("path").data(function(k){var M,T=k.pts2,c=Math.max((k.max-k.min)/10,k.q3-k.q1),h=c*1e-9,b=c*t,_=[],P=0,z;if(s.jitter){if(c===0)for(P=1,_=new Array(T.length),M=0;Mk.lo&&(j.so=!0)}return T});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(E.translatePoints,v,g)}function n(o,a,s,f){var v=a.val,g=a.pos,m=!!g.rangebreaks,w=f.bPos,l=f.bPosPxOffset||0,x=s.boxmean||(s.meanline||{}).visible,y,S;Array.isArray(f.bdPos)?(y=f.bdPos[0],S=f.bdPos[1]):(y=f.bdPos,S=f.bdPos);var k=o.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?d.identity:[]);k.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),k.exit().remove(),k.each(function(M){var T=g.c2l(M.pos+w,!0),c=g.l2p(T-y)+l,h=g.l2p(T+S)+l,b=m?(c+h)/2:g.l2p(T)+l,_=v.c2p(M.mean,!0),P=v.c2p(M.mean-M.sd,!0),z=v.c2p(M.mean+M.sd,!0);s.orientation==="h"?u.select(this).attr("d","M"+_+","+c+"V"+h+(x==="sd"?"m0,0L"+P+","+b+"L"+_+","+c+"L"+z+","+b+"Z":"")):u.select(this).attr("d","M"+c+","+_+"H"+h+(x==="sd"?"m0,0L"+b+","+P+"L"+c+","+_+"L"+b+","+z+"Z":""))})}V.exports={plot:e,plotBoxAndWhiskers:r,plotPoints:i,plotBoxMean:n}}),m1=Vt((K,V)=>{var u=Ni(),d=Pi(),E=Eo();function A(e,r,i){var n=i||u.select(e).selectAll("g.trace.boxes");n.style("opacity",function(o){return o[0].trace.opacity}),n.each(function(o){var a=u.select(this),s=o[0].trace,f=s.line.width;function v(w,l,x,y){w.style("stroke-width",l+"px").call(d.stroke,x).call(d.fill,y)}var g=a.selectAll("path.box");if(s.type==="candlestick")g.each(function(w){if(!w.empty){var l=u.select(this),x=s[w.dir];v(l,x.line.width,x.line.color,x.fillcolor),l.style("opacity",s.selectedpoints&&!w.selected?.3:1)}});else{v(g,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(d.stroke,s.line.color);var m=a.selectAll("path.point");E.pointStyle(m,s,e)}})}function t(e,r,i){var n=r[0].trace,o=i.selectAll("path.point");n.selectedpoints?E.selectedPointStyle(o,n):E.pointStyle(o,n,e)}V.exports={style:A,styleOnSelect:t}}),Qb=Vt((K,V)=>{var u=yo(),d=Xr(),E=hc(),A=Pi(),t=d.fillText;function e(n,o,a,s){var f=n.cd,v=f[0].trace,g=v.hoveron,m=[],w;return g.indexOf("boxes")!==-1&&(m=m.concat(r(n,o,a,s))),g.indexOf("points")!==-1&&(w=i(n,o,a)),s==="closest"?w?[w]:m:(w&&m.push(w),m)}function r(n,o,a,s){var f=n.cd,v=n.xa,g=n.ya,m=f[0].trace,w=f[0].t,l=m.type==="violin",x,y,S,k,M,T,c,h,b,_,P,z=w.bdPos,D,B,R=w.wHover,I=function(It){return S.c2l(It.pos)+w.bPos-S.c2l(T)};l&&m.side!=="both"?(m.side==="positive"&&(b=function(It){var Nt=I(It);return E.inbox(Nt,Nt+R,_)},D=z,B=0),m.side==="negative"&&(b=function(It){var Nt=I(It);return E.inbox(Nt-R,Nt,_)},D=0,B=z)):(b=function(It){var Nt=I(It);return E.inbox(Nt-R,Nt+R,_)},D=B=z);var F;l?F=function(It){return E.inbox(It.span[0]-M,It.span[1]-M,_)}:F=function(It){return E.inbox(It.min-M,It.max-M,_)},m.orientation==="h"?(M=o,T=a,c=F,h=b,x="y",S=g,y="x",k=v):(M=a,T=o,c=b,h=F,x="x",S=v,y="y",k=g);var j=Math.min(1,z/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));_=n.maxHoverDistance-j,P=n.maxSpikeDistance-j;function N(It){return(c(It)+h(It))/2}var G=E.getDistanceFunction(s,c,h,N);if(E.getClosest(f,G,n),n.index===!1)return[];var rt=f[n.index],ct=m.line.color,st=(m.marker||{}).color;A.opacity(ct)&&m.line.width?n.color=ct:A.opacity(st)&&m.boxpoints?n.color=st:n.color=m.fillcolor,n[x+"0"]=S.c2p(rt.pos+w.bPos-B,!0),n[x+"1"]=S.c2p(rt.pos+w.bPos+D,!0),n[x+"LabelVal"]=rt.orig_p!==void 0?rt.orig_p:rt.pos;var et=x+"Spike";n.spikeDistance=N(rt)*P/_,n[et]=S.c2p(rt.pos,!0);var Z=m.boxmean||m.sizemode==="sd"||(m.meanline||{}).visible,ot=m.boxpoints||m.points,X=ot&&Z?["max","uf","q3","med","mean","q1","lf","min"]:ot&&!Z?["max","uf","q3","med","q1","lf","min"]:!ot&&Z?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],Q=k.range[1]{V.exports=function(u,d){return d.hoverOnBox&&(u.hoverOnBox=d.hoverOnBox),"xVal"in d&&(u.x=d.xVal),"yVal"in d&&(u.y=d.yVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),t2=Vt((K,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i;if(d===!1)for(r=0;r{V.exports={attributes:Zg(),layoutAttributes:Kg(),supplyDefaults:Yg().supplyDefaults,crossTraceDefaults:Yg().crossTraceDefaults,supplyLayoutDefaults:h1().supplyLayoutDefaults,calc:Jb(),crossTraceCalc:p1().crossTraceCalc,plot:d1().plot,style:m1().style,styleOnSelect:m1().styleOnSelect,hoverPoints:Qb().hoverPoints,eventData:F6(),selectPoints:t2(),moduleType:"trace",name:"box",basePlotModule:Kc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),R6=Vt((K,V)=>{V.exports=B6()}),Im=Vt((K,V)=>{var u=Wl(),{extendFlat:d}=So(),E=kl(),{axisHoverFormat:A}=fc(),t=yu(),{hovertemplateAttrs:e,templatefallbackAttrs:r,texttemplateAttrs:i}=yl(),n=pc();V.exports=d({z:{valType:"data_array",editType:"calc"},x:d({},n.x,{impliedEdits:{xtype:"array"}}),x0:d({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:d({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:d({},n.y,{impliedEdits:{ytype:"array"}}),y0:d({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:d({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:d({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:d({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:d({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:d({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:d({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:d({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:e(),hovertemplatefallback:r(),texttemplate:i({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:r({editType:"plot"}),textfont:t({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:d({},E.showlegend,{dflt:!1}),zorder:n.zorder},u("",{cLetter:"z",autoColorDflt:!1}))}),g1=Vt((K,V)=>{var u=Lo(),d=Xr(),E=ji();V.exports=function(e,r,i,n,o,a){var s=i("z");o=o||"x",a=a||"y";var f,v;if(s===void 0||!s.length)return 0;if(d.isArray1D(s)){f=i(o),v=i(a);var g=d.minRowLength(f),m=d.minRowLength(v);if(g===0||m===0)return 0;r._length=Math.min(g,m,s.length)}else{if(f=A(o,i),v=A(a,i),!t(s))return 0;i("transpose"),r._length=null}var w=E.getComponentMethod("calendars","handleTraceDefaults");return w(e,r,[o,a],n),!0};function A(e,r){var i=r(e),n=i?r(e+"type","array"):"scaled";return n==="scaled"&&(r(e+"0"),r("d"+e)),i}function t(e){for(var r=!0,i=!1,n=!1,o,a=0;a0&&(i=!0);for(var s=0;s{var u=Xr();V.exports=function(d,E){d("texttemplate"),d("texttemplatefallback");var A=u.extendFlat({},E.font,{color:"auto",size:"auto"});u.coerceFont(d,"textfont",A)}}),e2=Vt((K,V)=>{V.exports=function(u,d,E){var A=E("zsmooth");A===!1&&(E("xgap"),E("ygap")),E("zhoverformat")}}),N6=Vt((K,V)=>{var u=Xr(),d=g1(),E=Xg(),A=tp(),t=e2(),e=vf(),r=Im();V.exports=function(i,n,o,a){function s(v,g){return u.coerce(i,n,r,v,g)}var f=d(i,n,s,a);if(!f){n.visible=!1;return}A(i,n,a,s),s("xhoverformat"),s("yhoverformat"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),E(s,a),t(i,n,s,a),s("hoverongaps"),s("connectgaps",u.isArray1D(n.z)&&n.zsmooth!==!1),e(i,n,a,s,{prefix:"",cLetter:"z"}),s("zorder")}}),r2=Vt((K,V)=>{var u=Lo();V.exports={count:function(d,E,A){return A[d]++,1},sum:function(d,E,A,t){var e=t[E];return u(e)?(e=Number(e),A[d]+=e,e):0},avg:function(d,E,A,t,e){var r=t[E];return u(r)&&(r=Number(r),A[d]+=r,e[d]++),0},min:function(d,E,A,t){var e=t[E];if(u(e))if(e=Number(e),u(A[d])){if(A[d]>e){var r=e-A[d];return A[d]=e,r}}else return A[d]=e,e;return 0},max:function(d,E,A,t){var e=t[E];if(u(e))if(e=Number(e),u(A[d])){if(A[d]{V.exports={percent:function(u,d){for(var E=u.length,A=100/d,t=0;t{V.exports=function(u,d){for(var E=u.length,A=0,t=0;t{var u=ks(),d=u.ONEAVGYEAR,E=u.ONEAVGMONTH,A=u.ONEDAY,t=u.ONEHOUR,e=u.ONEMIN,r=u.ONESEC,i=yo().tickIncrement;V.exports=function(f,v,g,m,w){var l=-1.1*v,x=-.1*v,y=f-x,S=g[0],k=g[1],M=Math.min(n(S+x,S+y,m,w),n(k+x,k+y,m,w)),T=Math.min(n(S+l,S+x,m,w),n(k+l,k+x,m,w)),c,h;if(M>T&&TA){var b=c===d?1:6,_=c===d?"M12":"M1";return function(P,z){var D=m.c2d(P,d,w),B=D.indexOf("-",b);B>0&&(D=D.slice(0,B));var R=m.d2c(D,0,w);if(Rr?f>A?f>d*1.1?d:f>E*1.1?E:A:f>t?t:f>e?e:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,v,g,m,w,l){if(m&&f>A){var x=s(v,w,l),y=s(g,w,l),S=f===d?0:1;return x[S]!==y[S]}return Math.floor(g/f)-Math.floor(v/f)>.1}function s(f,v,g){var m=v.c2d(f,d,g).split("-");return m[0]===""&&(m.unshift(),m[0]="-"+m[0]),m}}),o2=Vt((K,V)=>{var u=Lo(),d=Xr(),E=ji(),A=yo(),{hasColorscale:t}=ah(),e=ih(),r=Gg(),i=r2(),n=n2(),o=a2(),a=i2();function s(w,l){var x=[],y=[],S=l.orientation==="h",k=A.getFromId(w,S?l.yaxis:l.xaxis),M=S?"y":"x",T={x:"y",y:"x"}[M],c=l[M+"calendar"],h=l.cumulative,b,_=f(w,l,k,M),P=_[0],z=_[1],D=typeof P.size=="string",B=[],R=D?B:P,I=[],F=[],j=[],N=0,G=l.histnorm,rt=l.histfunc,ct=G.indexOf("density")!==-1,st,et,Z;h.enabled&&ct&&(G=G.replace(/ ?density$/,""),ct=!1);var ot=rt==="max"||rt==="min",X=ot?null:0,Q=i.count,ut=n[G],J=!1,q=function(Ut){return k.r2c(Ut,0,c)},it;for(d.isArrayOrTypedArray(l[T])&&rt!=="count"&&(it=l[T],J=rt==="avg",Q=i[rt]),b=q(P.start),et=q(P.end)+(b-A.tickIncrement(b,P.size,!1,c))/1e6;b=0&&Z=mt;b--)if(y[b]){bt=b;break}for(b=mt;b<=bt;b++)if(u(x[b])&&u(y[b])){var vt={p:x[b],s:y[b],b:0};h.enabled||(vt.pts=j[b],wt?vt.ph0=vt.ph1=j[b].length?z[j[b][0]]:x[b]:(l._computePh=!0,vt.ph0=Jt(B[b]),vt.ph1=Jt(B[b+1],!0))),Zt.push(vt)}return Zt.length===1&&(Zt[0].width1=A.tickIncrement(Zt[0].p,P.size,!1,c)-Zt[0].p),t(l,"marker")&&e(w,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),t(l,"marker.line")&&e(w,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(Zt,l),d.isArrayOrTypedArray(l.selectedpoints)&&d.tagSelected(Zt,l,Nt),Zt}function f(w,l,x,y,S){var k=y+"bins",M=w._fullLayout,T=l["_"+y+"bingroup"],c=M._histogramBinOpts[T],h=M.barmode==="overlay",b,_,P,z,D,B,R,I=function(te){return x.r2c(te,0,z)},F=function(te){return x.c2r(te,0,z)},j=x.type==="date"?function(te){return te||te===0?d.cleanDate(te,null,z):null}:function(te){return u(te)?Number(te):null};function N(te,Jt,ee){Jt[te+"Found"]?(Jt[te]=j(Jt[te]),Jt[te]===null&&(Jt[te]=ee[te])):(B[te]=Jt[te]=ee[te],d.nestedProperty(_[0],k+"."+te).set(ee[te]))}if(l["_"+y+"autoBinFinished"])delete l["_"+y+"autoBinFinished"];else{_=c.traces;var G=[],rt=!0,ct=!1,st=!1;for(b=0;b<_.length;b++)if(P=_[b],P.visible){var et=c.dirs[b];D=P["_"+et+"pos0"]=x.makeCalcdata(P,et),G=d.concat(G,D),delete P["_"+y+"autoBinFinished"],l.visible===!0&&(rt?rt=!1:(delete P._autoBin,P["_"+y+"autoBinFinished"]=1),E.traceIs(P,"2dMap")&&(ct=!0),P.type==="histogram2dcontour"&&(st=!0))}z=_[0][y+"calendar"];var Z=A.autoBin(G,x,c.nbins,ct,z,c.sizeFound&&c.size),ot=_[0]._autoBin={};if(B=ot[c.dirs[0]]={},st&&(c.size||(Z.start=F(A.tickIncrement(I(Z.start),Z.size,!0,z))),c.end===void 0&&(Z.end=F(A.tickIncrement(I(Z.end),Z.size,!1,z)))),h&&!E.traceIs(l,"2dMap")&&Z._dataSpan===0&&x.type!=="category"&&x.type!=="multicategory"&&l.bingroup===""&&typeof l.xbins>"u"){if(S)return[Z,D,!0];Z=v(w,l,x,y,k)}R=P.cumulative||{},R.enabled&&R.currentbin!=="include"&&(R.direction==="decreasing"?Z.start=F(A.tickIncrement(I(Z.start),Z.size,!0,z)):Z.end=F(A.tickIncrement(I(Z.end),Z.size,!1,z))),c.size=Z.size,c.sizeFound||(B.size=Z.size,d.nestedProperty(_[0],k+".size").set(Z.size)),N("start",c,Z),N("end",c,Z)}D=l["_"+y+"pos0"],delete l["_"+y+"pos0"];var X=l._input[k]||{},Q=d.extendFlat({},c),ut=c.start,J=x.r2l(X.start),q=J!==void 0;if((c.startFound||q)&&J!==x.r2l(ut)){var it=q?J:d.aggNums(Math.min,null,D),nt={type:x.type==="category"||x.type==="multicategory"?"linear":x.type,r2l:x.r2l,dtick:c.size,tick0:ut,calendar:z,range:[it,A.tickIncrement(it,c.size,!1,z)].map(x.l2r)},dt=A.tickFirst(nt);dt>x.r2l(it)&&(dt=A.tickIncrement(dt,c.size,!0,z)),Q.start=x.l2r(dt),q||d.nestedProperty(l,k+".start").set(Q.start)}var Tt=c.end,wt=x.r2l(X.end),Ct=wt!==void 0;if((c.endFound||Ct)&&wt!==x.r2l(Tt)){var It=Ct?wt:d.aggNums(Math.max,null,D);Q.end=x.l2r(It),Ct||d.nestedProperty(l,k+".start").set(Q.end)}var Nt="autobin"+y;return l._input[Nt]===!1&&(l._input[k]=d.extendFlat({},l[k]||{}),delete l._input[Nt],delete l[Nt]),[Q,D]}function v(w,l,x,y,S){var k=w._fullLayout,M=g(w,l),T=!1,c=1/0,h=[l],b,_,P;for(b=0;b=0;y--)T(y);else if(l==="increasing"){for(y=1;y=0;y--)w[y]+=w[y+1];x==="exclude"&&(w.push(0),w.shift())}}V.exports={calc:s,calcAllAutoBins:f}}),j6=Vt((K,V)=>{var u=Xr(),d=yo(),E=r2(),A=n2(),t=a2(),e=i2(),r=o2().calcAllAutoBins;V.exports=function(a,s){var f=d.getFromId(a,s.xaxis),v=d.getFromId(a,s.yaxis),g=s.xcalendar,m=s.ycalendar,w=function(de){return f.r2c(de,0,g)},l=function(de){return v.r2c(de,0,m)},x=function(de){return f.c2r(de,0,g)},y=function(de){return v.c2r(de,0,m)},S,k,M,T,c=r(a,s,f,"x"),h=c[0],b=c[1],_=r(a,s,v,"y"),P=_[0],z=_[1],D=s._length;b.length>D&&b.splice(D,b.length-D),z.length>D&&z.splice(D,z.length-D);var B=[],R=[],I=[],F=typeof h.size=="string",j=typeof P.size=="string",N=[],G=[],rt=F?N:h,ct=j?G:P,st=0,et=[],Z=[],ot=s.histnorm,X=s.histfunc,Q=ot.indexOf("density")!==-1,ut=X==="max"||X==="min",J=ut?null:0,q=E.count,it=A[ot],nt=!1,dt=[],Tt=[],wt="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";wt&&X!=="count"&&(nt=X==="avg",q=E[X]);var Ct=h.size,It=w(h.start),Nt=w(h.end)+(It-d.tickIncrement(It,Ct,!1,g))/1e6;for(S=It;S=0&&M=0&&T{var u=Xr(),d=ks().BADNUM,E=rp();V.exports=function(A,t,e,r,i,n){var o=A._length,a=t.makeCalcdata(A,r),s=e.makeCalcdata(A,i);a=E(A,t,r,a).vals,s=E(A,e,i,s).vals;var f=A.text,v=f!==void 0&&u.isArray1D(f),g=A.hovertext,m=g!==void 0&&u.isArray1D(g),w,l,x=u.distinctVals(a),y=x.vals,S=u.distinctVals(s),k=S.vals,M=[],T,c,h=k.length,b=y.length;for(w=0;w{var u=Lo(),d=Xr(),E=ks().BADNUM;V.exports=function(A,t,e,r){var i,n,o,a,s,f;function v(y){if(u(y))return+y}if(t&&t.transpose){for(i=0,s=0;s{var u=Xr(),d=.01,E=[[-1,0],[1,0],[0,-1],[0,1]];function A(e){return .5-.25*Math.min(1,e*.5)}V.exports=function(e,r){var i=1,n;for(t(e,r),n=0;nd;n++)i=t(e,r,A(i));return i>d&&u.log("interp2d didn't converge quickly",i),e};function t(e,r,i){var n=0,o,a,s,f,v,g,m,w,l,x,y,S,k;for(f=0;fS&&(n=Math.max(n,Math.abs(e[a][s]-y)/(k-S))))}return n}}),_1=Vt((K,V)=>{var u=Xr().maxRowLength;V.exports=function(d){var E=[],A={},t=[],e=d[0],r=[],i=[0,0,0],n=u(d),o,a,s,f,v,g,m,w;for(a=0;a=0;v--)f=t[v],a=f[0],s=f[1],g=((A[[a-1,s]]||i)[2]+(A[[a+1,s]]||i)[2]+(A[[a,s-1]]||i)[2]+(A[[a,s+1]]||i)[2])/20,g&&(m[f]=[a,s,g],t.splice(v,1),w=!0);if(!w)throw"findEmpties iterated with no new neighbors";for(f in m)A[f]=m[f],E.push(m[f])}return E.sort(function(l,x){return x[2]-l[2]})}}),s2=Vt((K,V)=>{var u=ji(),d=Xr().isArrayOrTypedArray;V.exports=function(E,A,t,e,r,i){var n=[],o=u.traceIs(E,"contour"),a=u.traceIs(E,"histogram"),s,f,v,g=d(A)&&A.length>1;if(g&&!a&&i.type!=="category"){var m=A.length;if(m<=r){if(o)n=Array.from(A).slice(0,r);else if(r===1)i.type==="log"?n=[.5*A[0],2*A[0]]:n=[A[0]-.5,A[0]+.5];else if(i.type==="log"){for(n=[Math.pow(A[0],1.5)/Math.pow(A[1],.5)],v=1;v{var u=ji(),d=Xr(),E=yo(),A=rp(),t=j6(),e=ih(),r=v1(),i=y1(),n=x1(),o=_1(),a=s2(),s=ks().BADNUM;V.exports=function(g,m){var w=E.getFromId(g,m.xaxis||"x"),l=E.getFromId(g,m.yaxis||"y"),x=u.traceIs(m,"contour"),y=u.traceIs(m,"histogram"),S=x?"best":m.zsmooth,k,M,T,c,h,b,_,P,z,D,B;if(w._minDtick=0,l._minDtick=0,y)B=t(g,m),c=B.orig_x,k=B.x,M=B.x0,T=B.dx,P=B.orig_y,h=B.y,b=B.y0,_=B.dy,z=B.z;else{var R=m.z;d.isArray1D(R)?(r(m,w,l,"x","y",["z"]),k=m._x,h=m._y,R=m._z):(c=m.x?w.makeCalcdata(m,"x"):[],P=m.y?l.makeCalcdata(m,"y"):[],k=A(m,w,"x",c).vals,h=A(m,l,"y",P).vals,m._x=k,m._y=h),M=m.x0,T=m.dx,b=m.y0,_=m.dy,z=i(R,m,w,l)}(w.rangebreaks||l.rangebreaks)&&(z=v(k,h,z),y||(k=f(k),h=f(h),m._x=k,m._y=h)),!y&&(x||m.connectgaps)&&(m._emptypoints=o(z),n(z,m._emptypoints));function I(Z){S=m._input.zsmooth=m.zsmooth=!1,d.warn('cannot use zsmooth: "fast": '+Z)}function F(Z){if(Z.length>1){var ot=(Z[Z.length-1]-Z[0])/(Z.length-1),X=Math.abs(ot/100);for(D=0;DX)return!1}return!0}m._islinear=!1,w.type==="log"||l.type==="log"?S==="fast"&&I("log axis found"):F(k)?F(h)?m._islinear=!0:S==="fast"&&I("y scale is not linear"):S==="fast"&&I("x scale is not linear");var j=d.maxRowLength(z),N=m.xtype==="scaled"?"":k,G=a(m,N,M,T,j,w),rt=m.ytype==="scaled"?"":h,ct=a(m,rt,b,_,z.length,l);m._extremes[w._id]=E.findExtremes(w,G),m._extremes[l._id]=E.findExtremes(l,ct);var st={x:G,y:ct,z,text:m._text||m.text,hovertext:m._hovertext||m.hovertext};if(m.xperiodalignment&&c&&(st.orig_x=c),m.yperiodalignment&&P&&(st.orig_y=P),N&&N.length===G.length-1&&(st.xCenter=N),rt&&rt.length===ct.length-1&&(st.yCenter=rt),y&&(st.xRanges=B.xRanges,st.yRanges=B.yRanges,st.pts=B.pts),x||e(g,m,{vals:z,cLetter:"z"}),x&&m.contours&&m.contours.coloring==="heatmap"){var et={type:m.type==="contour"?"heatmap":"histogram2d",xcalendar:m.xcalendar,ycalendar:m.ycalendar};st.xfill=a(et,N,M,T,j,w),st.yfill=a(et,rt,b,_,z.length,l)}return[st]};function f(g){for(var m=[],w=g.length,l=0;l{K.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],K.STYLE=K.CSS_DECLARATIONS.map(function(V){return V.join(": ")+"; "}).join("")}),l2=Vt((K,V)=>{var u=w1(),d=Eo(),E=Xr(),A=null;function t(){if(A!==null)return A;A=!1;var e=E.isSafari()||E.isMacWKWebView()||E.isIOS();if(window.navigator.userAgent&&!e){var r=Array.from(u.CSS_DECLARATIONS).reverse(),i=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof i=="function")A=r.some(function(s){return i.apply(null,s)});else{var n=d.tester.append("image").attr("style",u.STYLE),o=window.getComputedStyle(n.node()),a=o.imageRendering;A=r.some(function(s){var f=s[1];return a===f||a===f.toLowerCase()}),n.remove()}}return A}V.exports=t}),T1=Vt((K,V)=>{var u=Ni(),d=Af(),E=ji(),A=Eo(),t=yo(),e=Xr(),r=Dl(),i=t1(),n=Pi(),o=xu().extractOpts,a=xu().makeColorScaleFuncFromTrace,s=Lh(),f=gf(),v=f.LINE_SPACING,g=l2(),m=w1().STYLE,w="heatmap-label";function l(M){return M.selectAll("g."+w)}function x(M){l(M).remove()}V.exports=function(M,T,c,h){var b=T.xaxis,_=T.yaxis;e.makeTraceGroups(h,c,"hm").each(function(P){var z=u.select(this),D=P[0],B=D.trace,R=B.xgap||0,I=B.ygap||0,F=D.z,j=D.x,N=D.y,G=D.xCenter,rt=D.yCenter,ct=E.traceIs(B,"contour"),st=ct?"best":B.zsmooth,et=F.length,Z=e.maxRowLength(F),ot=!1,X=!1,Q,ut,J,q,it,nt,dt,Tt;for(nt=0;Q===void 0&&nt0;)ut=b.c2p(j[nt]),nt--;for(ut0;)it=_.c2p(N[nt]),nt--;it=b._length||ut<=0||q>=_._length||it<=0;if(te){var Jt=z.selectAll("image").data([]);Jt.exit().remove(),x(z);return}var ee,Zt;wt==="fast"?(ee=Z,Zt=et):(ee=It,Zt=Nt);var mt=document.createElement("canvas");mt.width=ee,mt.height=Zt;var bt=mt.getContext("2d",{willReadFrequently:!0}),vt=a(B,{noNumericCheck:!0,returnArray:!0}),Ut,re;wt==="fast"?(Ut=ot?function(vn){return Z-1-vn}:e.identity,re=X?function(vn){return et-1-vn}:e.identity):(Ut=function(vn){return e.constrain(Math.round(b.c2p(j[vn])-Q),0,It)},re=function(vn){return e.constrain(Math.round(_.c2p(N[vn])-q),0,Nt)});var Kt=re(0),ue=[Kt,Kt],Me=ot?0:1,Ce=X?0:1,We=0,qe=0,vr=0,_r=0,er,Mr,Ir,de,Dt;function qt(vn,Oa){if(vn!==void 0){var Qn=vt(vn);return Qn[0]=Math.round(Qn[0]),Qn[1]=Math.round(Qn[1]),Qn[2]=Math.round(Qn[2]),We+=Oa,qe+=Qn[0]*Oa,vr+=Qn[1]*Oa,_r+=Qn[2]*Oa,Qn}return[0,0,0,0]}function _t(vn,Oa,Qn,Qa){var Ja=vn[Qn.bin0];if(Ja===void 0)return qt(void 0,1);var wi=vn[Qn.bin1],ci=Oa[Qn.bin0],Ti=Oa[Qn.bin1],Ra=wi-Ja||0,Qi=ci-Ja||0,Hi;return wi===void 0?Ti===void 0?Hi=0:ci===void 0?Hi=2*(Ti-Ja):Hi=(2*Ti-ci-Ja)*2/3:Ti===void 0?ci===void 0?Hi=0:Hi=(2*Ja-wi-ci)*2/3:ci===void 0?Hi=(2*Ti-wi-Ja)*2/3:Hi=Ti+Ja-wi-ci,qt(Ja+Qn.frac*Ra+Qa.frac*(Qi+Qn.frac*Hi))}if(wt!=="default"){var lt=0,yt;try{yt=new Uint8Array(ee*Zt*4)}catch{yt=new Array(ee*Zt*4)}if(wt==="smooth"){var St=G||j,Ht=rt||N,Yt=new Array(St.length),se=new Array(Ht.length),ke=new Array(It),Ee=G?S:y,Ue=rt?S:y,ir,ar,Ye;for(nt=0;ntNn||Nn>_._length))for(dt=tn;dt$n||$n>b._length)){var ia=i({x:Kn,y:In},B,M._fullLayout);ia.x=Kn,ia.y=In;var Cn=D.z[nt][dt];Cn===void 0?(ia.z="",ia.zLabel=""):(ia.z=Cn,ia.zLabel=t.tickText(Se,Cn,"hover").text);var Fa=D.text&&D.text[nt]&&D.text[nt][dt];(Fa===void 0||Fa===!1)&&(Fa=""),ia.text=Fa;var Ga=e.texttemplateString({data:[ia,B._meta],fallback:B.texttemplatefallback,labels:ia,locale:M._fullLayout._d3locale,template:da});if(Ga){var ve=Ga.split("
                "),ge=ve.length,dr=0;for(Tt=0;Tt{V.exports={min:"zmin",max:"zmax"}}),k1=Vt((K,V)=>{var u=Ni();V.exports=function(d){u.select(d).selectAll(".hm image").style("opacity",function(E){return E.trace.opacity})}}),A1=Vt((K,V)=>{var u=hc(),d=Xr(),E=d.isArrayOrTypedArray,A=yo(),t=xu().extractOpts;V.exports=function(e,r,i,n,o){o||(o={});var a=o.isContour,s=e.cd[0],f=s.trace,v=e.xa,g=e.ya,m=s.x,w=s.y,l=s.z,x=s.xCenter,y=s.yCenter,S=s.zmask,k=f.zhoverformat,M=m,T=w,c,h,b,_;if(e.index!==!1){try{b=Math.round(e.index[1]),_=Math.round(e.index[0])}catch{d.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index);return}if(b<0||b>=l[0].length||_<0||_>l.length)return}else{if(u.inbox(r-m[0],r-m[m.length-1],0)>0||u.inbox(i-w[0],i-w[w.length-1],0)>0)return;if(a){var P;for(M=[2*m[0]-m[1]],P=1;P{V.exports={attributes:Im(),supplyDefaults:N6(),calc:b1(),plot:T1(),colorbar:zd(),style:k1(),hoverPoints:A1(),moduleType:"trace",name:"heatmap",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),V6=Vt((K,V)=>{V.exports=U6()}),u2=Vt((K,V)=>{V.exports=function(u,d){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),H6=Vt((K,V)=>{V.exports={eventDataKeys:["binNumber"]}}),M1=Vt((K,V)=>{var u=yp(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,texttemplateAttrs:A,templatefallbackAttrs:t}=yl(),e=yu(),r=u2(),i=H6(),n=So().extendFlat;V.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:d("x"),yhoverformat:d("y"),text:n({},u.text,{}),hovertext:n({},u.hovertext,{}),orientation:u.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:r("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:r("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:E({},{keys:i.eventDataKeys}),hovertemplatefallback:t(),texttemplate:A({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:t({editType:"plot"}),textposition:n({},u.textposition,{arrayOk:!1}),textfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:u.insidetextanchor,textangle:u.textangle,cliponaxis:u.cliponaxis,constraintext:u.constraintext,marker:u.marker,offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:u.selected,unselected:u.unselected,zorder:u.zorder}}),q6=Vt((K,V)=>{var u=ji(),d=Xr(),E=Pi(),A=Ih().handleText,t=c1(),e=M1();V.exports=function(r,i,n,o){function a(T,c){return d.coerce(r,i,e,T,c)}var s=a("x"),f=a("y"),v=a("cumulative.enabled");v&&(a("cumulative.direction"),a("cumulative.currentbin")),a("text");var g=a("textposition");A(r,i,o,a,g,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("xhoverformat"),a("yhoverformat");var m=a("orientation",f&&!s?"h":"v"),w=m==="v"?"x":"y",l=m==="v"?"y":"x",x=s&&f?Math.min(d.minRowLength(s)&&d.minRowLength(f)):d.minRowLength(i[w]||[]);if(!x){i.visible=!1;return}i._length=x;var y=u.getComponentMethod("calendars","handleTraceDefaults");y(r,i,["x","y"],o);var S=i[l];S&&a("histfunc"),a("histnorm"),a("autobin"+w),t(r,i,a,n,o),d.coerceSelectionMarkerOpacity(i,a);var k=(i.marker.line||{}).color,M=u.getComponentMethod("errorbars","supplyDefaults");M(r,i,k||E.defaultLine,{axis:"y"}),M(r,i,k||E.defaultLine,{axis:"x",inherit:"y"}),a("zorder")}}),S1=Vt((K,V)=>{var u=Xr(),d=cc(),E=ji().traceIs,A=f0(),t=Ih().validateCornerradius,e=u.nestedProperty,r=u0().getAxisGroup,i=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],n=["x","y"];V.exports=function(o,a){var s=a._histogramBinOpts={},f=[],v={},g=[],m,w,l,x,y,S,k;function M(ct,st){return u.coerce(m._input,m,m._module.attributes,ct,st)}function T(ct){return ct.orientation==="v"?"x":"y"}function c(ct,st){var et=d.getFromTrace({_fullLayout:a},ct,st);return et.type}function h(ct,st,et){var Z=ct.uid+"__"+et;st||(st=Z);var ot=c(ct,et),X=ct[et+"calendar"]||"",Q=s[st],ut=!0;Q&&(ot===Q.axType&&X===Q.calendar?(ut=!1,Q.traces.push(ct),Q.dirs.push(et)):(st=Z,ot!==Q.axType&&u.warn(["Attempted to group the bins of trace",ct.index,"set on a","type:"+ot,"axis","with bins on","type:"+Q.axType,"axis."].join(" ")),X!==Q.calendar&&u.warn(["Attempted to group the bins of trace",ct.index,"set with a",X,"calendar","with bins",Q.calendar?"on a "+Q.calendar+" calendar":"w/o a set calendar"].join(" ")))),ut&&(s[st]={traces:[ct],dirs:[et],axType:ot,calendar:ct[et+"calendar"]||""}),ct["_"+et+"bingroup"]=st}for(y=0;y{var u=Lm().hoverPoints,d=yo().hoverLabelText;V.exports=function(E,A,t,e,r){var i=u(E,A,t,e,r);if(i){E=i[0];var n=E.cd[E.index],o=E.cd[0].trace;if(!o.cumulative.enabled){var a=o.orientation==="h"?"y":"x";E[a+"Label"]=d(E[a+"a"],[n.ph0,n.ph1],o[a+"hoverformat"])}return i}}}),c2=Vt((K,V)=>{V.exports=function(u,d,E,A,t){if(u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"zLabelVal"in d&&(u.z=d.zLabelVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),!(E.cumulative||{}).enabled){var e=Array.isArray(t)?A[0].pts[t[0]][t[1]]:A[t].pts;u.pointNumbers=e,u.binNumber=u.pointNumber,delete u.pointNumber,delete u.pointIndex;var r;if(E._indexToPoints){r=[];for(var i=0;i{V.exports={attributes:M1(),layoutAttributes:u1(),supplyDefaults:q6(),crossTraceDefaults:S1(),supplyLayoutDefaults:$b(),calc:o2().calc,crossTraceCalc:h0().crossTraceCalc,plot:d0().plot,layerName:"barlayer",style:Hh().style,styleOnSelect:Hh().styleOnSelect,colorbar:Zf(),hoverPoints:W6(),selectPoints:Cm(),eventData:c2(),moduleType:"trace",name:"histogram",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Z6=Vt((K,V)=>{V.exports=G6()}),E1=Vt((K,V)=>{var u=M1(),d=u2(),E=Im(),A=kl(),t=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:r,templatefallbackAttrs:i}=yl(),n=Wl(),o=So().extendFlat;V.exports=o({x:u.x,y:u.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:u.histnorm,histfunc:u.histfunc,nbinsx:u.nbinsx,xbins:d("x"),nbinsy:u.nbinsy,ybins:d("y"),autobinx:u.autobinx,autobiny:u.autobiny,bingroup:o({},u.bingroup,{}),xbingroup:o({},u.bingroup,{}),ybingroup:o({},u.bingroup,{}),xgap:E.xgap,ygap:E.ygap,zsmooth:E.zsmooth,xhoverformat:t("x"),yhoverformat:t("y"),zhoverformat:t("z",1),hovertemplate:e({},{keys:["z"]}),hovertemplatefallback:i(),texttemplate:r({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:i({editType:"plot"}),textfont:E.textfont,showlegend:o({},A.showlegend,{dflt:!1})},n("",{cLetter:"z",autoColorDflt:!1}))}),f2=Vt((K,V)=>{var u=ji(),d=Xr();V.exports=function(E,A,t,e){var r=t("x"),i=t("y"),n=d.minRowLength(r),o=d.minRowLength(i);if(!n||!o){A.visible=!1;return}A._length=Math.min(n,o);var a=u.getComponentMethod("calendars","handleTraceDefaults");a(E,A,["x","y"],e);var s=t("z")||t("marker.color");s&&t("histfunc"),t("histnorm"),t("autobinx"),t("autobiny")}}),K6=Vt((K,V)=>{var u=Xr(),d=f2(),E=e2(),A=vf(),t=Xg(),e=E1();V.exports=function(r,i,n,o){function a(s,f){return u.coerce(r,i,e,s,f)}d(r,i,a,o),i.visible!==!1&&(E(r,i,a,o),A(r,i,o,a,{prefix:"",cLetter:"z"}),a("hovertemplate"),a("hovertemplatefallback"),t(a,o),a("xhoverformat"),a("yhoverformat"))}}),Y6=Vt((K,V)=>{var u=A1(),d=yo().hoverLabelText;V.exports=function(E,A,t,e,r){var i=u(E,A,t,e,r);if(i){E=i[0];var n=E.index,o=n[0],a=n[1],s=E.cd[0],f=s.trace,v=s.xRanges[a],g=s.yRanges[o];return E.xLabel=d(E.xa,[v[0],v[1]],f.xhoverformat),E.yLabel=d(E.ya,[g[0],g[1]],f.yhoverformat),i}}}),X6=Vt((K,V)=>{V.exports={attributes:E1(),supplyDefaults:K6(),crossTraceDefaults:S1(),calc:b1(),plot:T1(),layerName:"heatmaplayer",colorbar:zd(),style:k1(),hoverPoints:Y6(),eventData:c2(),moduleType:"trace",name:"histogram2d",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),$6=Vt((K,V)=>{V.exports=X6()}),z1=Vt((K,V)=>{V.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),$g=Vt((K,V)=>{var u=Im(),d=pc(),E=fc(),A=E.axisHoverFormat,t=E.descriptionOnlyNumbers,e=Wl(),r=If().dash,i=yu(),n=So().extendFlat,o=z1(),a=o.COMPARISON_OPS2,s=o.INTERVAL_OPS,f=d.line;V.exports=n({z:u.z,x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,text:u.text,hovertext:u.hovertext,transpose:u.transpose,xtype:u.xtype,ytype:u.ytype,xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,texttemplate:n({},u.texttemplate,{}),texttemplatefallback:u.texttemplatefallback,textfont:n({},u.textfont,{}),hoverongaps:u.hoverongaps,connectgaps:n({},u.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:i({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:t("contour label")},operation:{valType:"enumerated",values:[].concat(a).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},f.smoothing,{}),editType:"plot"},zorder:d.zorder},e("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),h2=Vt((K,V)=>{var u=E1(),d=$g(),E=Wl(),A=fc().axisHoverFormat,t=So().extendFlat;V.exports=t({x:u.x,y:u.y,z:u.z,marker:u.marker,histnorm:u.histnorm,histfunc:u.histfunc,nbinsx:u.nbinsx,xbins:u.xbins,nbinsy:u.nbinsy,ybins:u.ybins,autobinx:u.autobinx,autobiny:u.autobiny,bingroup:u.bingroup,xbingroup:u.xbingroup,ybingroup:u.ybingroup,autocontour:d.autocontour,ncontours:d.ncontours,contours:d.contours,line:{color:d.line.color,width:t({},d.line.width,{dflt:.5}),dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,texttemplate:d.texttemplate,texttemplatefallback:d.texttemplatefallback,textfont:d.textfont},E("",{cLetter:"z",editTypeOverride:"calc"}))}),L1=Vt((K,V)=>{V.exports=function(u,d,E,A){var t=A("contours.start"),e=A("contours.end"),r=t===!1||e===!1,i=E("contours.size"),n;r?n=d.autocontour=!0:n=E("autocontour",!1),(n||!i)&&E("ncontours")}}),p2=Vt((K,V)=>{var u=Xr();V.exports=function(d,E,A,t){t||(t={});var e=d("contours.showlabels");if(e){var r=E.font;u.coerceFont(d,"contours.labelfont",r,{overrideDflt:{color:A}}),d("contours.labelformat")}t.hasHover!==!1&&d("zhoverformat")}}),C1=Vt((K,V)=>{var u=vf(),d=p2();V.exports=function(E,A,t,e,r){var i=t("contours.coloring"),n,o="";i==="fill"&&(n=t("contours.showlines")),n!==!1&&(i!=="lines"&&(o=t("line.color","#000")),t("line.width",.5),t("line.dash")),i!=="none"&&(E.showlegend!==!0&&(A.showlegend=!1),A._dfltShowLegend=!1,u(E,A,e,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),d(t,e,o,r)}}),J6=Vt((K,V)=>{var u=Xr(),d=f2(),E=L1(),A=C1(),t=Xg(),e=h2();V.exports=function(r,i,n,o){function a(f,v){return u.coerce(r,i,e,f,v)}function s(f){return u.coerce2(r,i,e,f)}d(r,i,a,o),i.visible!==!1&&(E(r,i,a,s),A(r,i,a,o),a("xhoverformat"),a("yhoverformat"),a("hovertemplate"),a("hovertemplatefallback"),i.contours&&i.contours.coloring==="heatmap"&&t(a,o))}}),d2=Vt((K,V)=>{var u=yo(),d=Xr();V.exports=function(A,t){var e=A.contours;if(A.autocontour){var r=A.zmin,i=A.zmax;(A.zauto||r===void 0)&&(r=d.aggNums(Math.min,null,t)),(A.zauto||i===void 0)&&(i=d.aggNums(Math.max,null,t));var n=E(r,i,A.ncontours);e.size=n.dtick,e.start=u.tickFirst(n),n.range.reverse(),e.end=u.tickFirst(n),e.start===r&&(e.start+=e.size),e.end===i&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),A._input.contours||(A._input.contours={}),d.extendFlat(A._input.contours,{start:e.start,end:e.end,size:e.size}),A._input.autocontour=!0}else if(e.type!=="constraint"){var o=e.start,a=e.end,s=A._input.contours;if(o>a&&(e.start=s.start=a,a=e.end=s.end=o,o=e.start),!(e.size>0)){var f;o===a?f=1:f=E(o,a,A.ncontours).dtick,s.size=e.size=f}}};function E(A,t,e){var r={type:"linear",range:[A,t]};return u.autoTicks(r,(t-A)/(e||15)),r}}),Jg=Vt((K,V)=>{V.exports=function(u){return u.end+u.size/1e6}}),m2=Vt((K,V)=>{var u=xu(),d=b1(),E=d2(),A=Jg();V.exports=function(t,e){var r=d(t,e),i=r[0].z;E(e,i);var n=e.contours,o=u.extractOpts(e),a;if(n.coloring==="heatmap"&&o.auto&&e.autocontour===!1){var s=n.start,f=A(n),v=n.size||1,g=Math.floor((f-s)/v)+1;isFinite(v)||(v=1,g=1);var m=s-v/2,w=m+g*v;a=[m,w]}else a=i;return u.calc(t,e,{vals:a,cLetter:"z"}),r}}),Qg=Vt((K,V)=>{V.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),g2=Vt((K,V)=>{var u=Qg();V.exports=function(E){var A=E[0].z,t=A.length,e=A[0].length,r=t===2||e===2,i,n,o,a,s,f,v,g,m;for(n=0;nE?0:1)+(A[0][1]>E?0:2)+(A[1][1]>E?0:4)+(A[1][0]>E?0:8);if(t===5||t===10){var e=(A[0][0]+A[0][1]+A[1][0]+A[1][1])/4;return E>e?t===5?713:1114:t===5?104:208}return t===15?0:t}}),v2=Vt((K,V)=>{var u=Xr(),d=Qg();V.exports=function(i,n,o){var a,s,f,v,g;for(n=n||.01,o=o||.01,f=0;f20?(v=d.CHOOSESADDLE[v][(g[0]||g[1])<0?0:1],i.crossings[f]=d.SADDLEREMAINDER[v]):delete i.crossings[f],g=d.NEWDELTA[v],!g){u.log("Found bad marching index:",v,n,i.level);break}m.push(r(i,n,g)),n[0]+=g[0],n[1]+=g[1],f=n.join(","),E(m[m.length-1],m[m.length-2],a,s)&&m.pop();var k=g[0]&&(n[0]<0||n[0]>l-2)||g[1]&&(n[1]<0||n[1]>w-2),M=n[0]===x[0]&&n[1]===x[1]&&g[0]===y[0]&&g[1]===y[1];if(M||o&&k)break;v=i.crossings[f]}S===1e4&&u.log("Infinite loop in contour?");var T=E(m[0],m[m.length-1],a,s),c=0,h=.2*i.smoothing,b=[],_=0,P,z,D,B,R,I,F,j,N,G,rt;for(S=1;S=_;S--)if(P=b[S],P=_&&P+b[z]j&&N--,i.edgepaths[N]=rt.concat(m,G));break}Z||(i.edgepaths[j]=m.concat(G))}for(j=0;j20&&n?i===208||i===1114?a=o[0]===0?1:-1:s=o[1]===0?1:-1:d.BOTTOMSTART.indexOf(i)!==-1?s=1:d.LEFTSTART.indexOf(i)!==-1?a=1:d.TOPSTART.indexOf(i)!==-1?s=-1:a=-1,[a,s]}function r(i,n,o){var a=n[0]+Math.max(o[0],0),s=n[1]+Math.max(o[1],0),f=i.z[s][a],v=i.xaxis,g=i.yaxis;if(o[1]){var m=(i.level-f)/(i.z[s][a+1]-f),w=(m!==1?(1-m)*v.c2l(i.x[a]):0)+(m!==0?m*v.c2l(i.x[a+1]):0);return[v.c2p(v.l2c(w),!0),g.c2p(i.y[s],!0),a+m,s]}else{var l=(i.level-f)/(i.z[s+1][a]-f),x=(l!==1?(1-l)*g.c2l(i.y[s]):0)+(l!==0?l*g.c2l(i.y[s+1]):0);return[v.c2p(i.x[a],!0),g.c2p(g.l2c(x),!0),a,s+l]}}}),Q6=Vt((K,V)=>{var u=z1(),d=Lo();V.exports={"[]":A("[]"),"][":A("]["),">":t(">"),"<":t("<"),"=":t("=")};function E(e,r){var i=Array.isArray(r),n;function o(a){return d(a)?+a:null}return u.COMPARISON_OPS2.indexOf(e)!==-1?n=o(i?r[0]:r):u.INTERVAL_OPS.indexOf(e)!==-1?n=i?[o(r[0]),o(r[1])]:[o(r),o(r)]:u.SET_OPS.indexOf(e)!==-1&&(n=i?r.map(o):[o(r)]),n}function A(e){return function(r){r=E(e,r);var i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:i,end:n,size:n-i}}}function t(e){return function(r){return r=E(e,r),{start:r,end:1/0,size:1/0}}}}),y2=Vt((K,V)=>{var u=Xr(),d=Q6(),E=Jg();V.exports=function(A,t,e){for(var r=A.type==="constraint"?d[A._operation](A.value):A,i=r.size,n=[],o=E(r),a=e.trace._carpetTrace,s=a?{xaxis:a.aaxis,yaxis:a.baxis,x:e.a,y:e.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:e.x,y:e.y},f=r.start;f1e3){u.warn("Too many contours, clipping at 1000",A);break}return n}}),x2=Vt((K,V)=>{var u=Xr();V.exports=function(E,A){var t,e,r,i=function(a){return a.reverse()},n=function(a){return a};switch(A){case"=":case"<":return E;case">":for(E.length!==1&&u.warn("Contour data invalid for the specified inequality operation."),e=E[0],t=0;t{V.exports=function(u,d){var E=u[0],A=E.z,t;switch(d.type){case"levels":var e=Math.min(A[0][0],A[0][1]);for(t=0;tr.level||r.starts.length&&e===r.level)}break;case"constraint":if(E.prefixBoundary=!1,E.edgepaths.length)return;var i=E.x.length,n=E.y.length,o=-1/0,a=1/0;for(t=0;t":s>o&&(E.prefixBoundary=!0);break;case"<":(so||E.starts.length&&v===a)&&(E.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),v=Math.max(s[0],s[1]),fo&&(E.prefixBoundary=!0);break}break}}}),I1=Vt(K=>{var V=Ni(),u=Xr(),d=Eo(),E=xu(),A=Dl(),t=yo(),e=mp(),r=T1(),i=g2(),n=v2(),o=y2(),a=x2(),s=_2(),f=Qg(),v=f.LABELOPTIMIZER;K.plot=function(k,M,T,c){var h=M.xaxis,b=M.yaxis;u.makeTraceGroups(c,T,"contour").each(function(_){var P=V.select(this),z=_[0],D=z.trace,B=z.x,R=z.y,I=D.contours,F=o(I,M,z),j=u.ensureSingle(P,"g","heatmapcoloring"),N=[];I.coloring==="heatmap"&&(N=[_]),r(k,M,N,j),i(F),n(F);var G=h.c2p(B[0],!0),rt=h.c2p(B[B.length-1],!0),ct=b.c2p(R[0],!0),st=b.c2p(R[R.length-1],!0),et=[[G,st],[rt,st],[rt,ct],[G,ct]],Z=F;I.type==="constraint"&&(Z=a(F,I._operation)),g(P,et,I),m(P,Z,et,I),l(P,F,k,z,I),y(P,M,k,z,et)})};function g(k,M,T){var c=u.ensureSingle(k,"g","contourbg"),h=c.selectAll("path").data(T.coloring==="fill"?[0]:[]);h.enter().append("path"),h.exit().remove(),h.attr("d","M"+M.join("L")+"Z").style("stroke","none")}function m(k,M,T,c){var h=c.coloring==="fill"||c.type==="constraint"&&c._operation!=="=",b="M"+T.join("L")+"Z";h&&s(M,c);var _=u.ensureSingle(k,"g","contourfill"),P=_.selectAll("path").data(h?M:[]);P.enter().append("path"),P.exit().remove(),P.each(function(z){var D=(z.prefixBoundary?b:"")+w(z,T);D?V.select(this).attr("d",D).style("stroke","none"):V.select(this).remove()})}function w(k,M){var T="",c=0,h=k.edgepaths.map(function(rt,ct){return ct}),b=!0,_,P,z,D,B,R;function I(rt){return Math.abs(rt[1]-M[0][1])<.01}function F(rt){return Math.abs(rt[1]-M[2][1])<.01}function j(rt){return Math.abs(rt[0]-M[0][0])<.01}function N(rt){return Math.abs(rt[0]-M[2][0])<.01}for(;h.length;){for(R=d.smoothopen(k.edgepaths[c],k.smoothing),T+=b?R:R.replace(/^M/,"L"),h.splice(h.indexOf(c),1),_=k.edgepaths[c][k.edgepaths[c].length-1],D=-1,z=0;z<4;z++){if(!_){u.log("Missing end?",c,k);break}for(I(_)&&!N(_)?P=M[1]:j(_)?P=M[0]:F(_)?P=M[3]:N(_)&&(P=M[2]),B=0;B=0&&(P=G,D=B):Math.abs(_[1]-P[1])<.01?Math.abs(_[1]-G[1])<.01&&(G[0]-_[0])*(P[0]-G[0])>=0&&(P=G,D=B):u.log("endpt to newendpt is not vert. or horz.",_,P,G)}if(_=P,D>=0)break;T+="L"+P}if(D===k.edgepaths.length){u.log("unclosed perimeter path");break}c=D,b=h.indexOf(c)===-1,b&&(c=h[0],T+="Z")}for(c=0;cv.MAXCOST*2)break;I&&(P/=2),_=D-P/2,z=_+P*1.5}if(R<=v.MAXCOST)return B};function x(k,M,T,c){var h=M.width/2,b=M.height/2,_=k.x,P=k.y,z=k.theta,D=Math.cos(z)*h,B=Math.sin(z)*h,R=(_>c.center?c.right-_:_-c.left)/(D+Math.abs(Math.sin(z)*b)),I=(P>c.middle?c.bottom-P:P-c.top)/(Math.abs(B)+Math.cos(z)*b);if(R<1||I<1)return 1/0;var F=v.EDGECOST*(1/(R-1)+1/(I-1));F+=v.ANGLECOST*z*z;for(var j=_-D,N=P-B,G=_+D,rt=P+B,ct=0;ct{var u=Ni(),d=xu(),E=Jg();V.exports=function(A){var t=A.contours,e=t.start,r=E(t),i=t.size||1,n=Math.floor((r-e)/i)+1,o=t.coloring==="lines"?0:1,a=d.extractOpts(A);isFinite(i)||(i=1,n=1);var s=a.reversescale?d.flipScale(a.colorscale):a.colorscale,f=s.length,v=new Array(f),g=new Array(f),m,w,l=a.min,x=a.max;if(t.coloring==="heatmap"){for(w=0;w=x)&&(e<=l&&(e=l),r>=x&&(r=x),n=Math.floor((r-e)/i)+1,o=0),w=0;wl&&(v.unshift(l),g.unshift(g[0])),v[v.length-1]{var u=Ni(),d=Eo(),E=k1(),A=b2();V.exports=function(t){var e=u.select(t).selectAll("g.contour");e.style("opacity",function(r){return r[0].trace.opacity}),e.each(function(r){var i=u.select(this),n=r[0].trace,o=n.contours,a=n.line,s=o.size||1,f=o.start,v=o.type==="constraint",g=!v&&o.coloring==="lines",m=!v&&o.coloring==="fill",w=g||m?A(n):null;i.selectAll("g.contourlevel").each(function(y){u.select(this).selectAll("path").call(d.lineGroupStyle,a.width,g?w(y.level):a.color,a.dash)});var l=o.labelfont;if(i.selectAll("g.contourlabels text").each(function(y){d.font(u.select(this),{weight:l.weight,style:l.style,variant:l.variant,textcase:l.textcase,lineposition:l.lineposition,shadow:l.shadow,family:l.family,size:l.size,color:l.color||(g?w(y.level):a.color)})}),v)i.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(m){var x;i.selectAll("g.contourfill path").style("fill",function(y){return x===void 0&&(x=y.level),w(y.level+.5*s)}),x===void 0&&(x=f),i.selectAll("g.contourbg path").style("fill",w(x-.5*s))}}),E(t)}}),O1=Vt((K,V)=>{var u=xu(),d=b2(),E=Jg();function A(t,e,r){var i=e.contours,n=e.line,o=i.size||1,a=i.coloring,s=d(e,{isColorbar:!0});if(a==="heatmap"){var f=u.extractOpts(e);r._fillgradient=f.reversescale?u.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else a==="fill"&&(r._fillcolor=s);r._line={color:a==="lines"?s:n.color,width:i.showlines!==!1?n.width:0,dash:n.dash},r._levels={start:i.start,end:E(i),size:o}}V.exports={min:"zmin",max:"zmax",calc:A}}),w2=Vt((K,V)=>{var u=Pi(),d=A1();V.exports=function(E,A,t,e,r){r||(r={}),r.isContour=!0;var i=d(E,A,t,e,r);return i&&i.forEach(function(n){var o=n.trace;o.contours.type==="constraint"&&(o.fillcolor&&u.opacity(o.fillcolor)?n.color=u.addOpacity(o.fillcolor,1):o.contours.showlines&&u.opacity(o.line.color)&&(n.color=u.addOpacity(o.line.color,1)))}),i}}),tA=Vt((K,V)=>{V.exports={attributes:h2(),supplyDefaults:J6(),crossTraceDefaults:S1(),calc:m2(),plot:I1().plot,layerName:"contourlayer",style:P1(),colorbar:O1(),hoverPoints:w2(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),eA=Vt((K,V)=>{V.exports=tA()}),T2=Vt((K,V)=>{var u=Lo(),d=p2(),E=Pi(),A=E.addOpacity,t=E.opacity,e=z1(),r=Xr().isArrayOrTypedArray,i=e.CONSTRAINT_REDUCTION,n=e.COMPARISON_OPS2;V.exports=function(a,s,f,v,g,m){var w=s.contours,l,x,y,S=f("contours.operation");if(w._operation=i[S],o(f,w),S==="="?l=w.showlines=!0:(l=f("contours.showlines"),y=f("fillcolor",A((a.line||{}).color||g,.5))),l){var k=y&&t(y)?A(s.fillcolor,1):g;x=f("line.color",k),f("line.width",2),f("line.dash")}f("line.smoothing"),d(f,v,x,m)};function o(a,s){var f;n.indexOf(s.operation)===-1?(a("contours.value",[0,1]),r(s.value)?s.value.length>2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(f=parseFloat(s.value[0]),s.value=[f,f+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:u(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(a("contours.value",0),u(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}),rA=Vt((K,V)=>{var u=Xr(),d=g1(),E=tp(),A=T2(),t=L1(),e=C1(),r=Xg(),i=$g();V.exports=function(n,o,a,s){function f(w,l){return u.coerce(n,o,i,w,l)}function v(w){return u.coerce2(n,o,i,w)}var g=d(n,o,f,s);if(!g){o.visible=!1;return}E(n,o,s,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var m=f("contours.type")==="constraint";f("connectgaps",u.isArray1D(o.z)),m?A(n,o,f,s,a):(t(n,o,f,v),e(n,o,f,s)),o.contours&&o.contours.coloring==="heatmap"&&r(f,s),f("zorder")}}),nA=Vt((K,V)=>{V.exports={attributes:$g(),supplyDefaults:rA(),calc:m2(),plot:I1().plot,style:P1(),colorbar:O1(),hoverPoints:w2(),moduleType:"trace",name:"contour",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),aA=Vt((K,V)=>{V.exports=nA()}),k2=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Qh(),t=pc(),e=kl(),r=Wl(),i=If().dash,n=So().extendFlat,o=t.marker,a=t.line,s=o.line;V.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:d({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:n({},t.hovertext,{}),line:{color:a.color,width:a.width,dash:i,backoff:a.backoff,shape:n({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:t.connectgaps,cliponaxis:t.cliponaxis,fill:n({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:n({symbol:o.symbol,opacity:o.opacity,angle:o.angle,angleref:o.angleref,standoff:o.standoff,maxdisplayed:o.maxdisplayed,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:n({width:s.width,editType:"calc"},r("marker.line")),gradient:o.gradient,editType:"calc"},r("marker")),textfont:t.textfont,textposition:t.textposition,selected:t.selected,unselected:t.unselected,hoverinfo:n({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:t.hoveron,hovertemplate:u(),hovertemplatefallback:E()}}),iA=Vt((K,V)=>{var u=Xr(),d=gp(),E=nu(),A=Ch(),t=Rh(),e=Am(),r=Nh(),i=ep(),n=k2();V.exports=function(o,a,s,f){function v(S,k){return u.coerce(o,a,n,S,k)}var g=v("a"),m=v("b"),w=v("c"),l;if(g?(l=g.length,m?(l=Math.min(l,m.length),w&&(l=Math.min(l,w.length))):w?l=Math.min(l,w.length):l=0):m&&w&&(l=Math.min(m.length,w.length)),!l){a.visible=!1;return}a._length=l,v("sum"),v("text"),v("hovertext"),a.hoveron!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback"));var x=l{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot;return t.aLabel=u.tickText(e.aaxis,d.a,!0).text,t.bLabel=u.tickText(e.baxis,d.b,!0).text,t.cLabel=u.tickText(e.caxis,d.c,!0).text,t}}),sA=Vt((K,V)=>{var u=Lo(),d=jh(),E=vp(),A=Uh(),t=Vh().calcMarkerSize,e=["a","b","c"],r={a:["b","c"],b:["a","c"],c:["a","b"]};V.exports=function(i,n){var o=i._fullLayout[n.subplot],a=o.sum,s=n.sum||a,f={a:n.a,b:n.b,c:n.c},v=n.ids,g,m,w,l,x,y;for(g=0;g{var u=Mm();V.exports=function(d,E,A){var t=E.plotContainer;t.select(".scatterlayer").selectAll("*").remove();for(var e=E.xaxis,r=E.yaxis,i={xaxis:e,yaxis:r,plot:t,layerClipId:E._hasClipOnAxisFalse?E.clipIdRelative:null},n=E.layers.frontplot.select("g.scatterlayer"),o=0;o{var u=Em();V.exports=function(d,E,A,t){var e=u(d,E,A,t);if(!e||e[0].index===!1)return;var r=e[0];if(r.index===void 0){var i=1-r.y0/d.ya._length,n=d.xa._length,o=n*i/2,a=n-o;return r.x0=Math.max(Math.min(r.x0,a),o),r.x1=Math.max(Math.min(r.x1,a),o),e}var s=r.cd[r.index],f=r.trace,v=r.subplot;r.a=s.a,r.b=s.b,r.c=s.c,r.xLabelVal=void 0,r.yLabelVal=void 0;var g={};g[f.subplot]={_subplot:v};var m=f._module.formatLabels(s,f,g);r.aLabel=m.aLabel,r.bLabel=m.bLabel,r.cLabel=m.cLabel;var w=s.hi||f.hoverinfo,l=[];function x(S,k){l.push(S._hovertitle+": "+k)}if(!f.hovertemplate){var y=w.split("+");y.indexOf("all")!==-1&&(y=["a","b","c"]),y.indexOf("a")!==-1&&x(v.aaxis,r.aLabel),y.indexOf("b")!==-1&&x(v.baxis,r.bLabel),y.indexOf("c")!==-1&&x(v.caxis,r.cLabel)}return r.extraText=l.join("
                "),r.hovertemplate=f.hovertemplate,e}}),cA=Vt((K,V)=>{V.exports=function(u,d,E,A,t){if(d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),A[t]){var e=A[t];u.a=e.a,u.b=e.b,u.c=e.c}else u.a=d.a,u.b=d.b,u.c=d.c;return u}}),fA=Vt((K,V)=>{var u=Ni(),d=Af(),E=ji(),A=Xr(),t=A.strTranslate,e=A._,r=Pi(),i=Eo(),n=mp(),o=So().extendFlat,a=Uu(),s=yo(),f=oh(),v=hc(),g=Jh(),m=g.freeMode,w=g.rectMode,l=l0(),x=Sc().prepSelect,y=Sc().selectOnClick,S=Sc().clearOutline,k=Sc().clearSelectionsCache,M=Mf();function T(F,j){this.id=F.id,this.graphDiv=F.graphDiv,this.init(j),this.makeFramework(j),this.updateFx(j),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}V.exports=T;var c=T.prototype;c.init=function(F){this.container=F._ternarylayer,this.defs=F._defs,this.layoutId=F._uid,this.traceHash={},this.layers={}},c.plot=function(F,j){var N=this,G=j[N.id],rt=j._size;N._hasClipOnAxisFalse=!1;for(var ct=0;cth*ot?(dt=ot,nt=dt*h):(nt=Z,dt=nt/h),Tt=st*nt/Z,wt=et*dt/ot,q=j.l+j.w*rt-nt/2,it=j.t+j.h*(1-ct)-dt/2,N.x0=q,N.y0=it,N.w=nt,N.h=dt,N.sum=X,N.xaxis={type:"linear",range:[Q+2*J-X,X-Q-2*ut],domain:[rt-Tt/2,rt+Tt/2],_id:"x"},n(N.xaxis,N.graphDiv._fullLayout),N.xaxis.setScale(),N.xaxis.isPtWithinRange=function(Ut){return Ut.a>=N.aaxis.range[0]&&Ut.a<=N.aaxis.range[1]&&Ut.b>=N.baxis.range[1]&&Ut.b<=N.baxis.range[0]&&Ut.c>=N.caxis.range[1]&&Ut.c<=N.caxis.range[0]},N.yaxis={type:"linear",range:[Q,X-ut-J],domain:[ct-wt/2,ct+wt/2],_id:"y"},n(N.yaxis,N.graphDiv._fullLayout),N.yaxis.setScale(),N.yaxis.isPtWithinRange=function(){return!0};var Ct=N.yaxis.domain[0],It=N.aaxis=o({},F.aaxis,{range:[Q,X-ut-J],side:"left",tickangle:(+F.aaxis.tickangle||0)-30,domain:[Ct,Ct+wt*h],anchor:"free",position:0,_id:"y",_length:nt});n(It,N.graphDiv._fullLayout),It.setScale();var Nt=N.baxis=o({},F.baxis,{range:[X-Q-J,ut],side:"bottom",domain:N.xaxis.domain,anchor:"free",position:0,_id:"x",_length:nt});n(Nt,N.graphDiv._fullLayout),Nt.setScale();var te=N.caxis=o({},F.caxis,{range:[X-Q-ut,J],side:"right",tickangle:(+F.caxis.tickangle||0)+30,domain:[Ct,Ct+wt*h],anchor:"free",position:0,_id:"y",_length:nt});n(te,N.graphDiv._fullLayout),te.setScale();var Jt="M"+q+","+(it+dt)+"h"+nt+"l-"+nt/2+",-"+dt+"Z";N.clipDef.select("path").attr("d",Jt),N.layers.plotbg.select("path").attr("d",Jt);var ee="M0,"+dt+"h"+nt+"l-"+nt/2+",-"+dt+"Z";N.clipDefRelative.select("path").attr("d",ee);var Zt=t(q,it);N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Zt),N.clipDefRelative.select("path").attr("transform",null);var mt=t(q-Nt._offset,it+dt);N.layers.baxis.attr("transform",mt),N.layers.bgrid.attr("transform",mt);var bt=t(q+nt/2,it)+"rotate(30)"+t(0,-It._offset);N.layers.aaxis.attr("transform",bt),N.layers.agrid.attr("transform",bt);var vt=t(q+nt/2,it)+"rotate(-30)"+t(0,-te._offset);N.layers.caxis.attr("transform",vt),N.layers.cgrid.attr("transform",vt),N.drawAxes(!0),N.layers.aline.select("path").attr("d",It.showline?"M"+q+","+(it+dt)+"l"+nt/2+",-"+dt:"M0,0").call(r.stroke,It.linecolor||"#000").style("stroke-width",(It.linewidth||0)+"px"),N.layers.bline.select("path").attr("d",Nt.showline?"M"+q+","+(it+dt)+"h"+nt:"M0,0").call(r.stroke,Nt.linecolor||"#000").style("stroke-width",(Nt.linewidth||0)+"px"),N.layers.cline.select("path").attr("d",te.showline?"M"+(q+nt/2)+","+it+"l"+nt/2+","+dt:"M0,0").call(r.stroke,te.linecolor||"#000").style("stroke-width",(te.linewidth||0)+"px"),N.graphDiv._context.staticPlot||N.initInteractions(),i.setClipUrl(N.layers.frontplot,N._hasClipOnAxisFalse?null:N.clipId,N.graphDiv)},c.drawAxes=function(F){var j=this,N=j.graphDiv,G=j.id.slice(7)+"title",rt=j.layers,ct=j.aaxis,st=j.baxis,et=j.caxis;if(j.drawAx(ct),j.drawAx(st),j.drawAx(et),F){var Z=Math.max(ct.showticklabels?ct.tickfont.size/2:0,(et.showticklabels?et.tickfont.size*.75:0)+(et.ticks==="outside"?et.ticklen*.87:0)),ot=(st.showticklabels?st.tickfont.size:0)+(st.ticks==="outside"?st.ticklen:0)+3;rt["a-title"]=l.draw(N,"a"+G,{propContainer:ct,propName:j.id+".aaxis.title.text",placeholder:e(N,"Click to enter Component A title"),attributes:{x:j.x0+j.w/2,y:j.y0-ct.title.font.size/3-Z,"text-anchor":"middle"}}),rt["b-title"]=l.draw(N,"b"+G,{propContainer:st,propName:j.id+".baxis.title.text",placeholder:e(N,"Click to enter Component B title"),attributes:{x:j.x0-ot,y:j.y0+j.h+st.title.font.size*.83+ot,"text-anchor":"middle"}}),rt["c-title"]=l.draw(N,"c"+G,{propContainer:et,propName:j.id+".caxis.title.text",placeholder:e(N,"Click to enter Component C title"),attributes:{x:j.x0+j.w+ot,y:j.y0+j.h+et.title.font.size*.83+ot,"text-anchor":"middle"}})}},c.drawAx=function(F){var j=this,N=j.graphDiv,G=F._name,rt=G.charAt(0),ct=F._id,st=j.layers[G],et=30,Z=rt+"tickLayout",ot=b(F);j[Z]!==ot&&(st.selectAll("."+ct+"tick").remove(),j[Z]=ot),F.setScale();var X=s.calcTicks(F),Q=s.clipEnds(F,X),ut=s.makeTransTickFn(F),J=s.getTickSigns(F)[2],q=A.deg2rad(et),it=J*(F.linewidth||1)/2,nt=J*F.ticklen,dt=j.w,Tt=j.h,wt=rt==="b"?"M0,"+it+"l"+Math.sin(q)*nt+","+Math.cos(q)*nt:"M"+it+",0l"+Math.cos(q)*nt+","+-Math.sin(q)*nt,Ct={a:"M0,0l"+Tt+",-"+dt/2,b:"M0,0l-"+dt/2+",-"+Tt,c:"M0,0l-"+Tt+","+dt/2}[rt];s.drawTicks(N,F,{vals:F.ticks==="inside"?Q:X,layer:st,path:wt,transFn:ut,crisp:!1}),s.drawGrid(N,F,{vals:Q,layer:j.layers[rt+"grid"],path:Ct,transFn:ut,crisp:!1}),s.drawLabels(N,F,{vals:X,layer:st,transFn:ut,labelFns:s.makeLabelFns(F,0,et)})};function b(F){return F.ticks+String(F.ticklen)+String(F.showticklabels)}var _=M.MINZOOM/2+.87,P="m-0.87,.5h"+_+"v3h-"+(_+5.2)+"l"+(_/2+2.6)+",-"+(_*.87+4.5)+"l2.6,1.5l-"+_/2+","+_*.87+"Z",z="m0.87,.5h-"+_+"v3h"+(_+5.2)+"l-"+(_/2+2.6)+",-"+(_*.87+4.5)+"l-2.6,1.5l"+_/2+","+_*.87+"Z",D="m0,1l"+_/2+","+_*.87+"l2.6,-1.5l-"+(_/2+2.6)+",-"+(_*.87+4.5)+"l-"+(_/2+2.6)+","+(_*.87+4.5)+"l2.6,1.5l"+_/2+",-"+_*.87+"Z",B="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",R=!0;c.clearOutline=function(){k(this.dragOptions),S(this.dragOptions.gd)},c.initInteractions=function(){var F=this,j=F.layers.plotbg.select("path").node(),N=F.graphDiv,G=N._fullLayout._zoomlayer,rt,ct;this.dragOptions={element:j,gd:N,plotinfo:{id:F.id,domain:N._fullLayout[F.id].domain,xaxis:F.xaxis,yaxis:F.yaxis},subplot:F.id,prepFn:function(mt,bt,vt){F.dragOptions.xaxes=[F.xaxis],F.dragOptions.yaxes=[F.yaxis],rt=N._fullLayout._invScaleX,ct=N._fullLayout._invScaleY;var Ut=F.dragOptions.dragmode=N._fullLayout.dragmode;m(Ut)?F.dragOptions.minDrag=1:F.dragOptions.minDrag=void 0,Ut==="zoom"?(F.dragOptions.moveFn=Nt,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=te,Tt(mt,bt,vt)):Ut==="pan"?(F.dragOptions.moveFn=ee,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=Zt,Jt(),F.clearOutline(N)):(w(Ut)||m(Ut))&&x(mt,bt,vt,F.dragOptions,Ut)}};var st,et,Z,ot,X,Q,ut,J,q,it;function nt(mt){var bt={};return bt[F.id+".aaxis.min"]=mt.a,bt[F.id+".baxis.min"]=mt.b,bt[F.id+".caxis.min"]=mt.c,bt}function dt(mt,bt){var vt=N._fullLayout.clickmode;I(N),mt===2&&(N.emit("plotly_doubleclick",null),E.call("_guiRelayout",N,nt({a:0,b:0,c:0}))),vt.indexOf("select")>-1&&mt===1&&y(bt,N,[F.xaxis],[F.yaxis],F.id,F.dragOptions),vt.indexOf("event")>-1&&v.click(N,bt,F.id)}function Tt(mt,bt,vt){var Ut=j.getBoundingClientRect();st=bt-Ut.left,et=vt-Ut.top,N._fullLayout._calcInverseTransform(N);var re=N._fullLayout._invTransform,Kt=A.apply3DTransform(re)(st,et);st=Kt[0],et=Kt[1],Z={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},X=Z,ot=F.aaxis.range[1]-Z.a,Q=d(F.graphDiv._fullLayout[F.id].bgcolor).getLuminance(),ut="M0,"+F.h+"L"+F.w/2+", 0L"+F.w+","+F.h+"Z",J=!1,q=G.append("path").attr("class","zoombox").attr("transform",t(F.x0,F.y0)).style({fill:Q>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ut),it=G.append("path").attr("class","zoombox-corners").attr("transform",t(F.x0,F.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),F.clearOutline(N)}function wt(mt,bt){return 1-bt/F.h}function Ct(mt,bt){return 1-(mt+(F.h-bt)/Math.sqrt(3))/F.w}function It(mt,bt){return(mt-(F.h-bt)/Math.sqrt(3))/F.w}function Nt(mt,bt){var vt=st+mt*rt,Ut=et+bt*ct,re=Math.max(0,Math.min(1,wt(st,et),wt(vt,Ut))),Kt=Math.max(0,Math.min(1,Ct(st,et),Ct(vt,Ut))),ue=Math.max(0,Math.min(1,It(st,et),It(vt,Ut))),Me=(re/2+ue)*F.w,Ce=(1-re/2-Kt)*F.w,We=(Me+Ce)/2,qe=Ce-Me,vr=(1-re)*F.h,_r=vr-qe/h;qe.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),it.transition().style("opacity",1).duration(200),J=!0),N.emit("plotly_relayouting",nt(X))}function te(){I(N),X!==Z&&(E.call("_guiRelayout",N,nt(X)),R&&N.data&&N._context.showTips&&(A.notifier(e(N,"Double-click to zoom back out"),"long"),R=!1))}function Jt(){Z={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},X=Z}function ee(mt,bt){var vt=mt/F.xaxis._m,Ut=bt/F.yaxis._m;X={a:Z.a-Ut,b:Z.b+(vt+Ut)/2,c:Z.c-(vt-Ut)/2};var re=[X.a,X.b,X.c].sort(A.sorterAsc),Kt={a:re.indexOf(X.a),b:re.indexOf(X.b),c:re.indexOf(X.c)};re[0]<0&&(re[1]+re[0]/2<0?(re[2]+=re[0]+re[1],re[0]=re[1]=0):(re[2]+=re[0]/2,re[1]+=re[0]/2,re[0]=0),X={a:re[Kt.a],b:re[Kt.b],c:re[Kt.c]},bt=(Z.a-X.a)*F.yaxis._m,mt=(Z.c-X.c-Z.b+X.b)*F.xaxis._m);var ue=t(F.x0+mt,F.y0+bt);F.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ue);var Me=t(-mt,-bt);F.clipDefRelative.select("path").attr("transform",Me),F.aaxis.range=[X.a,F.sum-X.b-X.c],F.baxis.range=[F.sum-X.a-X.c,X.b],F.caxis.range=[F.sum-X.a-X.b,X.c],F.drawAxes(!1),F._hasClipOnAxisFalse&&F.plotContainer.select(".scatterlayer").selectAll(".trace").call(i.hideOutsideRangePoints,F),N.emit("plotly_relayouting",nt(X))}function Zt(){E.call("_guiRelayout",N,nt(X))}j.onmousemove=function(mt){v.hover(N,mt,F.id),N._fullLayout._lasthover=j,N._fullLayout._hoversubplot=F.id},j.onmouseout=function(mt){N._dragging||f.unhover(N,mt)},f.init(this.dragOptions)};function I(F){u.select(F).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),A2=Vt((K,V)=>{var u=af(),d=Vu().attributes,E=Of(),A=Cu().overrideAll,t=So().extendFlat,e={title:{text:E.title.text,font:E.title.font},color:E.color,tickmode:E.minor.tickmode,nticks:t({},E.nticks,{dflt:6,min:1}),tick0:E.tick0,dtick:E.dtick,tickvals:E.tickvals,ticktext:E.ticktext,ticks:E.ticks,ticklen:E.ticklen,tickwidth:E.tickwidth,tickcolor:E.tickcolor,ticklabelstep:E.ticklabelstep,showticklabels:E.showticklabels,labelalias:E.labelalias,showtickprefix:E.showtickprefix,tickprefix:E.tickprefix,showticksuffix:E.showticksuffix,ticksuffix:E.ticksuffix,showexponent:E.showexponent,exponentformat:E.exponentformat,minexponent:E.minexponent,separatethousands:E.separatethousands,tickfont:E.tickfont,tickangle:E.tickangle,tickformat:E.tickformat,tickformatstops:E.tickformatstops,hoverformat:E.hoverformat,showline:t({},E.showline,{dflt:!0}),linecolor:E.linecolor,linewidth:E.linewidth,showgrid:t({},E.showgrid,{dflt:!0}),gridcolor:E.gridcolor,gridwidth:E.gridwidth,griddash:E.griddash,layer:E.layer,min:{valType:"number",dflt:0,min:0}},r=V.exports=A({domain:d({name:"ternary"}),bgcolor:{valType:"color",dflt:u.background},sum:{valType:"number",dflt:1,min:0},aaxis:e,baxis:e,caxis:e},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}),Ld=Vt((K,V)=>{var u=Xr(),d=cl(),E=Vu().defaults;V.exports=function(A,t,e,r){var i=r.type,n=r.attributes,o=r.handleDefaults,a=r.partition||"x",s=t._subplots[i],f=s.length,v=f&&s[0].replace(/\d+$/,""),g,m;function w(S,k){return u.coerce(g,m,n,S,k)}for(var l=0;l{var u=Pi(),d=cl(),E=Xr(),A=Ld(),t=kd(),e=Ad(),r=_m(),i=s0(),n=Hg(),o=A2(),a=["aaxis","baxis","caxis"];V.exports=function(v,g,m){A(v,g,m,{type:"ternary",attributes:o,handleDefaults:s,font:g.font,paper_bgcolor:g.paper_bgcolor})};function s(v,g,m,w){var l=m("bgcolor"),x=m("sum");w.bgColor=u.combine(l,w.paper_bgcolor);for(var y,S,k,M=0;M=x&&(T.min=0,c.min=0,h.min=0,v.aaxis&&delete v.aaxis.min,v.baxis&&delete v.baxis.min,v.caxis&&delete v.caxis.min)}function f(v,g,m,w){var l=o[g._name];function x(b,_){return E.coerce(v,g,l,b,_)}x("uirevision",w.uirevision),g.type="linear";var y=x("color"),S=y!==l.color.dflt?y:m.font.color,k=g._name,M=k.charAt(0).toUpperCase(),T="Component "+M,c=x("title.text",T);g._hovertitle=c===T?c:M,E.coerceFont(x,"title.font",m.font,{overrideDflt:{size:E.bigFont(m.font.size),color:S}}),x("min"),i(v,g,x,"linear"),e(v,g,x,"linear"),t(v,g,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(v,g,x,{outerTicks:!0});var h=x("showticklabels");h&&(E.coerceFont(x,"tickfont",m.font,{overrideDflt:{color:S}}),x("tickangle"),x("tickformat")),n(v,g,x,{dfltColor:y,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),x("hoverformat"),x("layer")}}),pA=Vt(K=>{var V=fA(),u=Pf().getSubplotCalcData,d=Xr().counterRegex,E="ternary";K.name=E;var A=K.attr="subplot";K.idRoot=E,K.idRegex=K.attrRegex=d(E);var t=K.attributes={};t[A]={valType:"subplotid",dflt:"ternary",editType:"calc"},K.layoutAttributes=A2(),K.supplyLayoutDefaults=hA(),K.plot=function(e){for(var r=e._fullLayout,i=e.calcdata,n=r._subplots[E],o=0;o{V.exports={attributes:k2(),supplyDefaults:iA(),colorbar:Zf(),formatLabels:oA(),calc:sA(),plot:lA(),style:gh().style,styleOnSelect:gh().styleOnSelect,hoverPoints:uA(),selectPoints:zm(),eventData:cA(),moduleType:"trace",name:"scatterternary",basePlotModule:pA(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),mA=Vt((K,V)=>{V.exports=dA()}),M2=Vt((K,V)=>{var u=Zg(),d=So().extendFlat,E=fc().axisHoverFormat;V.exports={y:u.y,x:u.x,x0:u.x0,y0:u.y0,xhoverformat:E("x"),yhoverformat:E("y"),name:d({},u.name,{}),orientation:d({},u.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:u.fillcolor,points:d({},u.boxpoints,{}),jitter:d({},u.jitter,{}),pointpos:d({},u.pointpos,{}),width:d({},u.width,{}),marker:u.marker,text:u.text,hovertext:u.hovertext,hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,quartilemethod:u.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:u.selected,unselected:u.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:u.zorder}}),S2=Vt((K,V)=>{var u=Kg(),d=Xr().extendFlat;V.exports={violinmode:d({},u.boxmode,{}),violingap:d({},u.boxgap,{}),violingroupgap:d({},u.boxgroupgap,{})}}),gA=Vt((K,V)=>{var u=Xr(),d=Pi(),E=Yg(),A=M2();V.exports=function(t,e,r,i){function n(c,h){return u.coerce(t,e,A,c,h)}function o(c,h){return u.coerce2(t,e,A,c,h)}if(E.handleSampleDefaults(t,e,n,i),e.visible!==!1){n("bandwidth"),n("side");var a=n("width");a||(n("scalegroup",e.name),n("scalemode"));var s=n("span"),f;Array.isArray(s)&&(f="manual"),n("spanmode",f);var v=n("line.color",(t.marker||{}).color||r),g=n("line.width"),m=n("fillcolor",d.addOpacity(e.line.color,.5));E.handlePointsDefaults(t,e,n,{prefix:""});var w=o("box.width"),l=o("box.fillcolor",m),x=o("box.line.color",v),y=o("box.line.width",g),S=n("box.visible",!!(w||l||x||y));S||(e.box={visible:!1});var k=o("meanline.color",v),M=o("meanline.width",g),T=n("meanline.visible",!!(k||M));T||(e.meanline={visible:!1}),n("quartilemethod"),n("zorder")}}}),vA=Vt((K,V)=>{var u=Xr(),d=S2(),E=h1();V.exports=function(A,t,e){function r(i,n){return u.coerce(A,t,d,i,n)}E._supply(A,t,e,r,"violin")}}),D1=Vt(K=>{var V=Xr(),u={gaussian:function(d){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*d*d)}};K.makeKDE=function(d,E,A){var t=A.length,e=u.gaussian,r=d.bandwidth,i=1/(t*r);return function(n){for(var o=0,a=0;a{var u=Xr(),d=yo(),E=Jb(),A=D1(),t=ks().BADNUM;V.exports=function(n,o){var a=E(n,o);if(a[0].t.empty)return a;for(var s=n._fullLayout,f=d.getFromId(n,o[o.orientation==="h"?"xaxis":"yaxis"]),v=1/0,g=-1/0,m=0,w=0,l=0;l{var u=p1().setPositionOffset,d=["v","h"];V.exports=function(E,A){for(var t=E.calcdata,e=A.xaxis,r=A.yaxis,i=0;i{var u=Ni(),d=Xr(),E=Eo(),A=d1(),t=Fb(),e=D1();V.exports=function(r,i,n,o){var a=r._context.staticPlot,s=r._fullLayout,f=i.xaxis,v=i.yaxis;function g(m,w){var l=t(m,{xaxis:f,yaxis:v,trace:w,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return E.smoothopen(l[0],1)}d.makeTraceGroups(o,n,"trace violins").each(function(m){var w=u.select(this),l=m[0],x=l.t,y=l.trace;if(y.visible!==!0||x.empty){w.remove();return}var S=x.bPos,k=x.bdPos,M=i[x.valLetter+"axis"],T=i[x.posLetter+"axis"],c=y.side==="both",h=c||y.side==="positive",b=c||y.side==="negative",_=w.selectAll("path.violin").data(d.identity);_.enter().append("path").style("vector-effect",a?"none":"non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each(function(j){var N=u.select(this),G=j.density,rt=G.length,ct=T.c2l(j.pos+S,!0),st=T.l2p(ct),et;if(y.width)et=x.maxKDE/k;else{var Z=s._violinScaleGroupStats[y.scalegroup];et=y.scalemode==="count"?Z.maxKDE/k*(Z.maxCount/j.pts.length):Z.maxKDE/k}var ot,X,Q,ut,J,q,it;if(h){for(q=new Array(rt),ut=0;ut{var u=Ni(),d=Pi(),E=gh().stylePoints;V.exports=function(A){var t=u.select(A).selectAll("g.trace.violins");t.style("opacity",function(e){return e[0].trace.opacity}),t.each(function(e){var r=e[0].trace,i=u.select(this),n=r.box||{},o=n.line||{},a=r.meanline||{},s=a.width;i.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(d.stroke,r.line.color).call(d.fill,r.fillcolor),i.selectAll("path.box").style("stroke-width",o.width+"px").call(d.stroke,o.color).call(d.fill,n.fillcolor);var f={"stroke-width":s+"px","stroke-dasharray":2*s+"px,"+s+"px"};i.selectAll("path.mean").style(f).call(d.stroke,a.color),i.selectAll("path.meanline").style(f).call(d.stroke,a.color),E(i,r,A)})}}),wA=Vt((K,V)=>{var u=Pi(),d=Xr(),E=yo(),A=Qb(),t=D1();V.exports=function(e,r,i,n,o){o||(o={});var a=o.hoverLayer,s=e.cd,f=s[0].trace,v=f.hoveron,g=v.indexOf("violins")!==-1,m=v.indexOf("kde")!==-1,w=[],l,x;if(g||m){var y=A.hoverOnBoxes(e,r,i,n);if(m&&y.length>0){var S=e.xa,k=e.ya,M,T,c,h,b;f.orientation==="h"?(b=r,M="y",c=k,T="x",h=S):(b=i,M="x",c=S,T="y",h=k);var _=s[e.index];if(b>=_.span[0]&&b<=_.span[1]){var P=d.extendFlat({},e),z=h.c2p(b,!0),D=t.getKdeValue(_,f,b),B=t.getPositionOnKdePath(_,f,z),R=c._offset,I=c._length;P[M+"0"]=B[0],P[M+"1"]=B[1],P[T+"0"]=P[T+"1"]=z,P[T+"Label"]=T+": "+E.hoverLabelText(h,b,f[T+"hoverformat"])+", "+s[0].t.labels.kde+" "+D.toFixed(3);for(var F=0,j=0;j{V.exports={attributes:M2(),layoutAttributes:S2(),supplyDefaults:gA(),crossTraceDefaults:Yg().crossTraceDefaults,supplyLayoutDefaults:vA(),calc:yA(),crossTraceCalc:xA(),plot:_A(),style:bA(),styleOnSelect:gh().styleOnSelect,hoverPoints:wA(),selectPoints:t2(),moduleType:"trace",name:"violin",basePlotModule:Kc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),kA=Vt((K,V)=>{V.exports=TA()}),AA=Vt((K,V)=>{V.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),E2=Vt((K,V)=>{var u=yp(),d=pc().line,E=kl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=AA(),n=So().extendFlat,o=Pi();V.exports={x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:u.hovertext,hovertemplate:t({},{keys:i.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},E.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:e({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:r({editType:"plot"}),text:u.text,textposition:u.textposition,insidetextanchor:n({},u.insidetextanchor,{dflt:"middle"}),textangle:n({},u.textangle,{dflt:0}),textfont:u.textfont,insidetextfont:u.insidetextfont,outsidetextfont:u.outsidetextfont,constraintext:u.constraintext,cliponaxis:u.cliponaxis,orientation:n({},u.orientation,{}),offset:n({},u.offset,{arrayOk:!1}),width:n({},u.width,{arrayOk:!1}),marker:a(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:n({},d.color,{dflt:o.defaultLine}),width:n({},d.width,{dflt:0,editType:"plot"}),dash:d.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,zorder:u.zorder};function a(){var s=n({},u.marker);return delete s.pattern,delete s.cornerradius,s}}),z2=Vt((K,V)=>{V.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),L2=Vt((K,V)=>{var u=Xr(),d=f0(),E=Ih().handleText,A=km(),t=tp(),e=E2(),r=Pi();function i(a,s,f,v){function g(k,M){return u.coerce(a,s,e,k,M)}var m=A(a,s,v,g);if(!m){s.visible=!1;return}t(a,s,v,g),g("xhoverformat"),g("yhoverformat"),g("orientation",s.y&&!s.x?"v":"h"),g("offset"),g("width");var w=g("text");g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var l=g("textposition");E(a,s,v,g,l,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s.textposition!=="none"&&!s.texttemplate&&g("textinfo",u.isArrayOrTypedArray(w)?"text+value":"value");var x=g("marker.color",f);g("marker.line.color",r.defaultLine),g("marker.line.width");var y=g("connector.visible");if(y){g("connector.fillcolor",n(x));var S=g("connector.line.width");S&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function n(a){var s=u.isArrayOrTypedArray(a)?"#000":a;return r.addOpacity(s,.5*r.opacity(s))}function o(a,s){var f,v;function g(w){return u.coerce(v._input,v,e,w)}for(var m=0;m{var u=Xr(),d=z2();V.exports=function(E,A,t){var e=!1;function r(o,a){return u.coerce(E,A,d,o,a)}for(var i=0;i{var u=Xr();V.exports=function(d,E){for(var A=0;A{var u=yo(),d=rp(),E=SA(),A=Uh(),t=ks().BADNUM;V.exports=function(r,i){var n=u.getFromId(r,i.xaxis||"x"),o=u.getFromId(r,i.yaxis||"y"),a,s,f,v,g,m,w,l;i.orientation==="h"?(a=n.makeCalcdata(i,"x"),f=o.makeCalcdata(i,"y"),v=d(i,o,"y",f),g=!!i.yperiodalignment,m="y"):(a=o.makeCalcdata(i,"y"),f=n.makeCalcdata(i,"x"),v=d(i,n,"x",f),g=!!i.xperiodalignment,m="x"),s=v.vals;var x=Math.min(s.length,a.length),y=new Array(x);for(i._base=[],w=0;w{var u=h0().setGroupPositions;V.exports=function(d,E){var A=d._fullLayout,t=d._fullData,e=d.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,f;for(f=0;f{var u=Ni(),d=Xr(),E=Eo(),A=ks().BADNUM,t=d0(),e=sh().clearMinTextSize;V.exports=function(o,a,s,f){var v=o._fullLayout;e("funnel",v),r(o,a,s,f),i(o,a,s,f),t.plot(o,a,s,f,{mode:v.funnelmode,norm:v.funnelmode,gap:v.funnelgap,groupgap:v.funnelgroupgap})};function r(o,a,s,f){var v=a.xaxis,g=a.yaxis;d.makeTraceGroups(f,s,"trace bars").each(function(m){var w=u.select(this),l=m[0].trace,x=d.ensureSingle(w,"g","regions");if(!l.connector||!l.connector.visible){x.remove();return}var y=l.orientation==="h",S=x.selectAll("g.region").data(d.identity);S.enter().append("g").classed("region",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=n(M,v,g,y),h=c[0],b=c[1],_="";h[0]!==A&&b[0]!==A&&h[1]!==A&&b[1]!==A&&h[2]!==A&&b[2]!==A&&h[3]!==A&&b[3]!==A&&(y?_+="M"+h[0]+","+b[1]+"L"+h[2]+","+b[2]+"H"+h[3]+"L"+h[1]+","+b[1]+"Z":_+="M"+h[1]+","+b[1]+"L"+h[2]+","+b[3]+"V"+b[2]+"L"+h[1]+","+b[0]+"Z"),_===""&&(_="M0,0Z"),d.ensureSingle(u.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function i(o,a,s,f){var v=a.xaxis,g=a.yaxis;d.makeTraceGroups(f,s,"trace bars").each(function(m){var w=u.select(this),l=m[0].trace,x=d.ensureSingle(w,"g","lines");if(!l.connector||!l.connector.visible||!l.connector.line.width){x.remove();return}var y=l.orientation==="h",S=x.selectAll("g.line").data(d.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=n(M,v,g,y),h=c[0],b=c[1],_="";h[3]!==void 0&&b[3]!==void 0&&(y?(_+="M"+h[0]+","+b[1]+"L"+h[2]+","+b[2],_+="M"+h[1]+","+b[1]+"L"+h[3]+","+b[2]):(_+="M"+h[1]+","+b[1]+"L"+h[2]+","+b[3],_+="M"+h[1]+","+b[0]+"L"+h[2]+","+b[2])),_===""&&(_="M0,0Z"),d.ensureSingle(u.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function n(o,a,s,f){var v=[],g=[],m=f?a:s,w=f?s:a;return v[0]=m.c2p(o.s0,!0),g[0]=w.c2p(o.p0,!0),v[1]=m.c2p(o.s1,!0),g[1]=w.c2p(o.p1,!0),v[2]=m.c2p(o.nextS0,!0),g[2]=w.c2p(o.nextP0,!0),v[3]=m.c2p(o.nextS1,!0),g[3]=w.c2p(o.nextP1,!0),f?[v,g]:[g,v]}}),CA=Vt((K,V)=>{var u=Ni(),d=Eo(),E=Pi(),A=_d().DESELECTDIM,t=Hh(),e=sh().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||u.select(n).selectAll('g[class^="funnellayer"]').selectAll("g.trace");e(n,s,"funnel"),s.style("opacity",function(f){return f[0].trace.opacity}),s.each(function(f){var v=u.select(this),g=f[0].trace;v.selectAll(".point > path").each(function(m){if(!m.isBlank){var w=g.marker;u.select(this).call(E.fill,m.mc||w.color).call(E.stroke,m.mlc||w.line.color).call(d.dashLine,w.line.dash,m.mlw||w.line.width).style("opacity",g.selectedpoints&&!m.selected?A:1)}}),r(v,g,n),v.selectAll(".regions").each(function(){u.select(this).selectAll("path").style("stroke-width",0).call(E.fill,g.connector.fillcolor)}),v.selectAll(".lines").each(function(){var m=g.connector.line;d.lineGroupStyle(u.select(this).selectAll("path"),m.width,m.color,m.dash)})})}V.exports={style:i}}),IA=Vt((K,V)=>{var u=Pi().opacity,d=Lm().hoverOnBars,E=Xr().formatPercent;V.exports=function(t,e,r,i,n){var o=d(t,e,r,i,n);if(o){var a=o.cd,s=a[0].trace,f=s.orientation==="h",v=o.index,g=a[v],m=f?"x":"y";o[m+"LabelVal"]=g.s,o.percentInitial=g.begR,o.percentInitialLabel=E(g.begR,1),o.percentPrevious=g.difR,o.percentPreviousLabel=E(g.difR,1),o.percentTotal=g.sumR,o.percentTotalLabel=E(g.sumR,1);var w=g.hi||s.hoverinfo,l=[];if(w&&w!=="none"&&w!=="skip"){var x=w==="all",y=w.split("+"),S=function(k){return x||y.indexOf(k)!==-1};S("percent initial")&&l.push(o.percentInitialLabel+" of initial"),S("percent previous")&&l.push(o.percentPreviousLabel+" of previous"),S("percent total")&&l.push(o.percentTotalLabel+" of total")}return o.extraText=l.join("
                "),o.color=A(s,g),[o]}};function A(t,e){var r=t.marker,i=e.mc||r.color,n=e.mlc||r.line.color,o=e.mlw||r.line.width;if(u(i))return i;if(u(n)&&o)return n}}),PA=Vt((K,V)=>{V.exports=function(u,d){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"percentInitial"in d&&(u.percentInitial=d.percentInitial),"percentPrevious"in d&&(u.percentPrevious=d.percentPrevious),"percentTotal"in d&&(u.percentTotal=d.percentTotal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),OA=Vt((K,V)=>{V.exports={attributes:E2(),layoutAttributes:z2(),supplyDefaults:L2().supplyDefaults,crossTraceDefaults:L2().crossTraceDefaults,supplyLayoutDefaults:MA(),calc:EA(),crossTraceCalc:zA(),plot:LA(),style:CA().style,hoverPoints:IA(),eventData:PA(),selectPoints:Cm(),moduleType:"trace",name:"funnel",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),DA=Vt((K,V)=>{V.exports=OA()}),FA=Vt((K,V)=>{V.exports={eventDataKeys:["initial","delta","final"]}}),C2=Vt((K,V)=>{var u=yp(),d=pc().line,E=kl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=FA(),n=So().extendFlat,o=Pi();function a(s){return{marker:{color:n({},u.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},u.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},u.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}V.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:u.hovertext,hovertemplate:t({},{keys:i.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},E.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:e({editType:"plot"},{keys:i.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:u.text,textposition:u.textposition,insidetextanchor:u.insidetextanchor,textangle:u.textangle,textfont:u.textfont,insidetextfont:u.insidetextfont,outsidetextfont:u.outsidetextfont,constraintext:u.constraintext,cliponaxis:u.cliponaxis,orientation:u.orientation,offset:u.offset,width:u.width,increasing:a(),decreasing:a(),totals:a(),connector:{line:{color:n({},d.color,{dflt:o.defaultLine}),width:n({},d.width,{editType:"plot"}),dash:d.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,zorder:u.zorder}}),I2=Vt((K,V)=>{V.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Pm=Vt((K,V)=>{V.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),P2=Vt((K,V)=>{var u=Xr(),d=f0(),E=Ih().handleText,A=km(),t=tp(),e=C2(),r=Pi(),i=Pm(),n=i.INCREASING.COLOR,o=i.DECREASING.COLOR,a="#4499FF";function s(g,m,w){g(m+".marker.color",w),g(m+".marker.line.color",r.defaultLine),g(m+".marker.line.width")}function f(g,m,w,l){function x(T,c){return u.coerce(g,m,e,T,c)}var y=A(g,m,l,x);if(!y){m.visible=!1;return}t(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",m.x&&!m.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var S=x("textposition");E(g,m,l,x,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),m.textposition!=="none"&&(x("texttemplate"),x("texttemplatefallback"),m.texttemplate||x("textinfo")),s(x,"increasing",n),s(x,"decreasing",o),s(x,"totals",a);var k=x("connector.visible");if(k){x("connector.mode");var M=x("connector.line.width");M&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function v(g,m){var w,l;function x(S){return u.coerce(l._input,l,e,S)}if(m.waterfallmode==="group")for(var y=0;y{var u=Xr(),d=I2();V.exports=function(E,A,t){var e=!1;function r(o,a){return u.coerce(E,A,d,o,a)}for(var i=0;i{var u=yo(),d=rp(),E=Xr().mergeArray,A=Uh(),t=ks().BADNUM;function e(i){return i==="a"||i==="absolute"}function r(i){return i==="t"||i==="total"}V.exports=function(i,n){var o=u.getFromId(i,n.xaxis||"x"),a=u.getFromId(i,n.yaxis||"y"),s,f,v,g,m,w;n.orientation==="h"?(s=o.makeCalcdata(n,"x"),v=a.makeCalcdata(n,"y"),g=d(n,a,"y",v),m=!!n.yperiodalignment,w="y"):(s=a.makeCalcdata(n,"y"),v=o.makeCalcdata(n,"x"),g=d(n,o,"x",v),m=!!n.xperiodalignment,w="x"),f=g.vals;for(var l=Math.min(f.length,s.length),x=new Array(l),y=0,S,k=!1,M=0;M{var u=h0().setGroupPositions;V.exports=function(d,E){var A=d._fullLayout,t=d._fullData,e=d.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,f;for(f=0;f{var u=Ni(),d=Xr(),E=Eo(),A=ks().BADNUM,t=d0(),e=sh().clearMinTextSize;V.exports=function(n,o,a,s){var f=n._fullLayout;e("waterfall",f),t.plot(n,o,a,s,{mode:f.waterfallmode,norm:f.waterfallmode,gap:f.waterfallgap,groupgap:f.waterfallgroupgap}),r(n,o,a,s)};function r(n,o,a,s){var f=o.xaxis,v=o.yaxis;d.makeTraceGroups(s,a,"trace bars").each(function(g){var m=u.select(this),w=g[0].trace,l=d.ensureSingle(m,"g","lines");if(!w.connector||!w.connector.visible){l.remove();return}var x=w.orientation==="h",y=w.connector.mode,S=l.selectAll("g.line").data(d.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=i(M,f,v,x),h=c[0],b=c[1],_="";h[0]!==A&&b[0]!==A&&h[1]!==A&&b[1]!==A&&(y==="spanning"&&!M.isSum&&T>0&&(x?_+="M"+h[0]+","+b[1]+"V"+b[0]:_+="M"+h[1]+","+b[0]+"H"+h[0]),y!=="between"&&(M.isSum||T{var u=Ni(),d=Eo(),E=Pi(),A=_d().DESELECTDIM,t=Hh(),e=sh().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||u.select(n).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");e(n,s,"waterfall"),s.style("opacity",function(f){return f[0].trace.opacity}),s.each(function(f){var v=u.select(this),g=f[0].trace;v.selectAll(".point > path").each(function(m){if(!m.isBlank){var w=g[m.dir].marker;u.select(this).call(E.fill,w.color).call(E.stroke,w.line.color).call(d.dashLine,w.line.dash,w.line.width).style("opacity",g.selectedpoints&&!m.selected?A:1)}}),r(v,g,n),v.selectAll(".lines").each(function(){var m=g.connector.line;d.lineGroupStyle(u.select(this).selectAll("path"),m.width,m.color,m.dash)})})}V.exports={style:i}}),VA=Vt((K,V)=>{var u=yo().hoverLabelText,d=Pi().opacity,E=Lm().hoverOnBars,A=Pm(),t={increasing:A.INCREASING.SYMBOL,decreasing:A.DECREASING.SYMBOL};V.exports=function(r,i,n,o,a){var s=E(r,i,n,o,a);if(!s)return;var f=s.cd,v=f[0].trace,g=v.orientation==="h",m=g?"x":"y",w=g?r.xa:r.ya;function l(_){return u(w,_,v[m+"hoverformat"])}var x=s.index,y=f[x],S=y.isSum?y.b+y.s:y.rawS;s.initial=y.b+y.s-S,s.delta=S,s.final=s.initial+s.delta;var k=l(Math.abs(s.delta));s.deltaLabel=S<0?"("+k+")":k,s.finalLabel=l(s.final),s.initialLabel=l(s.initial);var M=y.hi||v.hoverinfo,T=[];if(M&&M!=="none"&&M!=="skip"){var c=M==="all",h=M.split("+"),b=function(_){return c||h.indexOf(_)!==-1};y.isSum||(b("final")&&(g?!b("x"):!b("y"))&&T.push(s.finalLabel),b("delta")&&(S<0?T.push(s.deltaLabel+" "+t.decreasing):T.push(s.deltaLabel+" "+t.increasing)),b("initial")&&T.push("Initial: "+s.initialLabel))}return T.length&&(s.extraText=T.join("
                ")),s.color=e(v,y),[s]};function e(r,i){var n=r[i.dir].marker,o=n.color,a=n.line.color,s=n.line.width;if(d(o))return o;if(d(a)&&s)return a}}),HA=Vt((K,V)=>{V.exports=function(u,d){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"initial"in d&&(u.initial=d.initial),"delta"in d&&(u.delta=d.delta),"final"in d&&(u.final=d.final),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),qA=Vt((K,V)=>{V.exports={attributes:C2(),layoutAttributes:I2(),supplyDefaults:P2().supplyDefaults,crossTraceDefaults:P2().crossTraceDefaults,supplyLayoutDefaults:BA(),calc:RA(),crossTraceCalc:NA(),plot:jA(),style:UA().style,hoverPoints:VA(),eventData:HA(),selectPoints:Cm(),moduleType:"trace",name:"waterfall",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),WA=Vt((K,V)=>{V.exports=qA()}),Om=Vt((K,V)=>{V.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(u){return u.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(u){return u.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(u){return u.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(u){var d=u.slice(0,3);return d[1]=d[1]+"%",d[2]=d[2]+"%",d},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(u){var d=u.slice(0,4);return d[1]=d[1]+"%",d[2]=d[2]+"%",d},suffix:["°","%","%",""]}}}}),O2=Vt((K,V)=>{var u=kl(),d=pc().zorder,{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=So().extendFlat,e=Om().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],i=[],n=[];for(a=0;a{var u=Xr(),d=O2(),E=Om(),A=Fp().IMAGE_URL_PREFIX;V.exports=function(t,e){function r(o,a){return u.coerce(t,e,d,o,a)}r("source"),e.source&&!e.source.match(A)&&delete e.source,e._hasSource=!!e.source;var i=r("z");if(e._hasZ=!(i===void 0||!i.length||!i[0]||!i[0].length),!e._hasZ&&!e._hasSource){e.visible=!1;return}r("x0"),r("y0"),r("dx"),r("dy");var n;e._hasZ?(r("colormodel","rgb"),n=E.colormodel[e.colormodel],r("zmin",n.zminDflt||n.min),r("zmax",n.zmaxDflt||n.max)):e._hasSource&&(e.colormodel="rgba256",n=E.colormodel[e.colormodel],e.zmin=n.zminDflt,e.zmax=n.zmaxDflt),r("zsmooth"),r("text"),r("hovertext"),r("hovertemplate"),r("hovertemplatefallback"),e._length=null,r("zorder")}}),Bp=Vt((K,V)=>{typeof Object.create=="function"?V.exports=function(u,d){d&&(u.super_=d,u.prototype=Object.create(d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}))}:V.exports=function(u,d){if(d){u.super_=d;var E=function(){};E.prototype=d.prototype,u.prototype=new E,u.prototype.constructor=u}}}),D2=Vt((K,V)=>{V.exports=o0().EventEmitter}),ZA=Vt(K=>{K.byteLength=r,K.toByteArray=n,K.fromByteArray=s;var V=[],u=[],d=typeof Uint8Array<"u"?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A=0,t=E.length;A0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=v);var m=g===v?0:4-g%4;return[g,m]}function r(f){var v=e(f),g=v[0],m=v[1];return(g+m)*3/4-m}function i(f,v,g){return(v+g)*3/4-g}function n(f){var v,g=e(f),m=g[0],w=g[1],l=new d(i(f,m,w)),x=0,y=w>0?m-4:m,S;for(S=0;S>16&255,l[x++]=v>>8&255,l[x++]=v&255;return w===2&&(v=u[f.charCodeAt(S)]<<2|u[f.charCodeAt(S+1)]>>4,l[x++]=v&255),w===1&&(v=u[f.charCodeAt(S)]<<10|u[f.charCodeAt(S+1)]<<4|u[f.charCodeAt(S+2)]>>2,l[x++]=v>>8&255,l[x++]=v&255),l}function o(f){return V[f>>18&63]+V[f>>12&63]+V[f>>6&63]+V[f&63]}function a(f,v,g){for(var m,w=[],l=v;ly?y:x+l));return m===1?(v=f[g-1],w.push(V[v>>2]+V[v<<4&63]+"==")):m===2&&(v=(f[g-2]<<8)+f[g-1],w.push(V[v>>10]+V[v>>4&63]+V[v<<2&63]+"=")),w.join("")}}),KA=Vt(K=>{K.read=function(V,u,d,E,A){var t,e,r=A*8-E-1,i=(1<>1,o=-7,a=d?A-1:0,s=d?-1:1,f=V[u+a];for(a+=s,t=f&(1<<-o)-1,f>>=-o,o+=r;o>0;t=t*256+V[u+a],a+=s,o-=8);for(e=t&(1<<-o)-1,t>>=-o,o+=E;o>0;e=e*256+V[u+a],a+=s,o-=8);if(t===0)t=1-n;else{if(t===i)return e?NaN:(f?-1:1)*(1/0);e=e+Math.pow(2,E),t=t-n}return(f?-1:1)*e*Math.pow(2,t-E)},K.write=function(V,u,d,E,A,t){var e,r,i,n=t*8-A-1,o=(1<>1,s=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=E?0:t-1,v=E?1:-1,g=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(r=isNaN(u)?1:0,e=o):(e=Math.floor(Math.log(u)/Math.LN2),u*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+a>=1?u+=s/i:u+=s*Math.pow(2,1-a),u*i>=2&&(e++,i/=2),e+a>=o?(r=0,e=o):e+a>=1?(r=(u*i-1)*Math.pow(2,A),e=e+a):(r=u*Math.pow(2,a-1)*Math.pow(2,A),e=0));A>=8;V[d+f]=r&255,f+=v,r/=256,A-=8);for(e=e<0;V[d+f]=e&255,f+=v,e/=256,n-=8);V[d+f-v]|=g*128}}),m0=Vt(K=>{var V=ZA(),u=KA(),d=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K.Buffer=e,K.SlowBuffer=w,K.INSPECT_MAX_BYTES=50;var E=2147483647;K.kMaxLength=E,e.TYPED_ARRAY_SUPPORT=A(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function A(){try{let mt=new Uint8Array(1),bt={foo:function(){return 42}};return Object.setPrototypeOf(bt,Uint8Array.prototype),Object.setPrototypeOf(mt,bt),mt.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function t(mt){if(mt>E)throw new RangeError('The value "'+mt+'" is invalid for option "size"');let bt=new Uint8Array(mt);return Object.setPrototypeOf(bt,e.prototype),bt}function e(mt,bt,vt){if(typeof mt=="number"){if(typeof bt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return o(mt)}return r(mt,bt,vt)}e.poolSize=8192;function r(mt,bt,vt){if(typeof mt=="string")return a(mt,bt);if(ArrayBuffer.isView(mt))return f(mt);if(mt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof mt);if(Nt(mt,ArrayBuffer)||mt&&Nt(mt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(mt,SharedArrayBuffer)||mt&&Nt(mt.buffer,SharedArrayBuffer)))return v(mt,bt,vt);if(typeof mt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ut=mt.valueOf&&mt.valueOf();if(Ut!=null&&Ut!==mt)return e.from(Ut,bt,vt);let re=g(mt);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof mt[Symbol.toPrimitive]=="function")return e.from(mt[Symbol.toPrimitive]("string"),bt,vt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof mt)}e.from=function(mt,bt,vt){return r(mt,bt,vt)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function i(mt){if(typeof mt!="number")throw new TypeError('"size" argument must be of type number');if(mt<0)throw new RangeError('The value "'+mt+'" is invalid for option "size"')}function n(mt,bt,vt){return i(mt),mt<=0?t(mt):bt!==void 0?typeof vt=="string"?t(mt).fill(bt,vt):t(mt).fill(bt):t(mt)}e.alloc=function(mt,bt,vt){return n(mt,bt,vt)};function o(mt){return i(mt),t(mt<0?0:m(mt)|0)}e.allocUnsafe=function(mt){return o(mt)},e.allocUnsafeSlow=function(mt){return o(mt)};function a(mt,bt){if((typeof bt!="string"||bt==="")&&(bt="utf8"),!e.isEncoding(bt))throw new TypeError("Unknown encoding: "+bt);let vt=l(mt,bt)|0,Ut=t(vt),re=Ut.write(mt,bt);return re!==vt&&(Ut=Ut.slice(0,re)),Ut}function s(mt){let bt=mt.length<0?0:m(mt.length)|0,vt=t(bt);for(let Ut=0;Ut=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return mt|0}function w(mt){return+mt!=mt&&(mt=0),e.alloc(+mt)}e.isBuffer=function(mt){return mt!=null&&mt._isBuffer===!0&&mt!==e.prototype},e.compare=function(mt,bt){if(Nt(mt,Uint8Array)&&(mt=e.from(mt,mt.offset,mt.byteLength)),Nt(bt,Uint8Array)&&(bt=e.from(bt,bt.offset,bt.byteLength)),!e.isBuffer(mt)||!e.isBuffer(bt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(mt===bt)return 0;let vt=mt.length,Ut=bt.length;for(let re=0,Kt=Math.min(vt,Ut);reUt.length?(e.isBuffer(Kt)||(Kt=e.from(Kt)),Kt.copy(Ut,re)):Uint8Array.prototype.set.call(Ut,Kt,re);else if(e.isBuffer(Kt))Kt.copy(Ut,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=Kt.length}return Ut};function l(mt,bt){if(e.isBuffer(mt))return mt.length;if(ArrayBuffer.isView(mt)||Nt(mt,ArrayBuffer))return mt.byteLength;if(typeof mt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof mt);let vt=mt.length,Ut=arguments.length>2&&arguments[2]===!0;if(!Ut&&vt===0)return 0;let re=!1;for(;;)switch(bt){case"ascii":case"latin1":case"binary":return vt;case"utf8":case"utf-8":return dt(mt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt*2;case"hex":return vt>>>1;case"base64":return Ct(mt).length;default:if(re)return Ut?-1:dt(mt).length;bt=(""+bt).toLowerCase(),re=!0}}e.byteLength=l;function x(mt,bt,vt){let Ut=!1;if((bt===void 0||bt<0)&&(bt=0),bt>this.length||((vt===void 0||vt>this.length)&&(vt=this.length),vt<=0)||(vt>>>=0,bt>>>=0,vt<=bt))return"";for(mt||(mt="utf8");;)switch(mt){case"hex":return I(this,bt,vt);case"utf8":case"utf-8":return P(this,bt,vt);case"ascii":return B(this,bt,vt);case"latin1":case"binary":return R(this,bt,vt);case"base64":return _(this,bt,vt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,bt,vt);default:if(Ut)throw new TypeError("Unknown encoding: "+mt);mt=(mt+"").toLowerCase(),Ut=!0}}e.prototype._isBuffer=!0;function y(mt,bt,vt){let Ut=mt[bt];mt[bt]=mt[vt],mt[vt]=Ut}e.prototype.swap16=function(){let mt=this.length;if(mt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let bt=0;btbt&&(mt+=" ... "),""},d&&(e.prototype[d]=e.prototype.inspect),e.prototype.compare=function(mt,bt,vt,Ut,re){if(Nt(mt,Uint8Array)&&(mt=e.from(mt,mt.offset,mt.byteLength)),!e.isBuffer(mt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof mt);if(bt===void 0&&(bt=0),vt===void 0&&(vt=mt?mt.length:0),Ut===void 0&&(Ut=0),re===void 0&&(re=this.length),bt<0||vt>mt.length||Ut<0||re>this.length)throw new RangeError("out of range index");if(Ut>=re&&bt>=vt)return 0;if(Ut>=re)return-1;if(bt>=vt)return 1;if(bt>>>=0,vt>>>=0,Ut>>>=0,re>>>=0,this===mt)return 0;let Kt=re-Ut,ue=vt-bt,Me=Math.min(Kt,ue),Ce=this.slice(Ut,re),We=mt.slice(bt,vt);for(let qe=0;qe2147483647?vt=2147483647:vt<-2147483648&&(vt=-2147483648),vt=+vt,te(vt)&&(vt=re?0:mt.length-1),vt<0&&(vt=mt.length+vt),vt>=mt.length){if(re)return-1;vt=mt.length-1}else if(vt<0)if(re)vt=0;else return-1;if(typeof bt=="string"&&(bt=e.from(bt,Ut)),e.isBuffer(bt))return bt.length===0?-1:k(mt,bt,vt,Ut,re);if(typeof bt=="number")return bt=bt&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(mt,bt,vt):Uint8Array.prototype.lastIndexOf.call(mt,bt,vt):k(mt,[bt],vt,Ut,re);throw new TypeError("val must be string, number or Buffer")}function k(mt,bt,vt,Ut,re){let Kt=1,ue=mt.length,Me=bt.length;if(Ut!==void 0&&(Ut=String(Ut).toLowerCase(),Ut==="ucs2"||Ut==="ucs-2"||Ut==="utf16le"||Ut==="utf-16le")){if(mt.length<2||bt.length<2)return-1;Kt=2,ue/=2,Me/=2,vt/=2}function Ce(qe,vr){return Kt===1?qe[vr]:qe.readUInt16BE(vr*Kt)}let We;if(re){let qe=-1;for(We=vt;Weue&&(vt=ue-Me),We=vt;We>=0;We--){let qe=!0;for(let vr=0;vrre&&(Ut=re)):Ut=re;let Kt=bt.length;Ut>Kt/2&&(Ut=Kt/2);let ue;for(ue=0;ue>>0,isFinite(vt)?(vt=vt>>>0,Ut===void 0&&(Ut="utf8")):(Ut=vt,vt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let re=this.length-bt;if((vt===void 0||vt>re)&&(vt=re),mt.length>0&&(vt<0||bt<0)||bt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ut||(Ut="utf8");let Kt=!1;for(;;)switch(Ut){case"hex":return M(this,mt,bt,vt);case"utf8":case"utf-8":return T(this,mt,bt,vt);case"ascii":case"latin1":case"binary":return c(this,mt,bt,vt);case"base64":return h(this,mt,bt,vt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,mt,bt,vt);default:if(Kt)throw new TypeError("Unknown encoding: "+Ut);Ut=(""+Ut).toLowerCase(),Kt=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(mt,bt,vt){return bt===0&&vt===mt.length?V.fromByteArray(mt):V.fromByteArray(mt.slice(bt,vt))}function P(mt,bt,vt){vt=Math.min(mt.length,vt);let Ut=[],re=bt;for(;re239?4:Kt>223?3:Kt>191?2:1;if(re+Me<=vt){let Ce,We,qe,vr;switch(Me){case 1:Kt<128&&(ue=Kt);break;case 2:Ce=mt[re+1],(Ce&192)===128&&(vr=(Kt&31)<<6|Ce&63,vr>127&&(ue=vr));break;case 3:Ce=mt[re+1],We=mt[re+2],(Ce&192)===128&&(We&192)===128&&(vr=(Kt&15)<<12|(Ce&63)<<6|We&63,vr>2047&&(vr<55296||vr>57343)&&(ue=vr));break;case 4:Ce=mt[re+1],We=mt[re+2],qe=mt[re+3],(Ce&192)===128&&(We&192)===128&&(qe&192)===128&&(vr=(Kt&15)<<18|(Ce&63)<<12|(We&63)<<6|qe&63,vr>65535&&vr<1114112&&(ue=vr))}}ue===null?(ue=65533,Me=1):ue>65535&&(ue-=65536,Ut.push(ue>>>10&1023|55296),ue=56320|ue&1023),Ut.push(ue),re+=Me}return D(Ut)}var z=4096;function D(mt){let bt=mt.length;if(bt<=z)return String.fromCharCode.apply(String,mt);let vt="",Ut=0;for(;UtUt)&&(vt=Ut);let re="";for(let Kt=bt;Ktvt&&(mt=vt),bt<0?(bt+=vt,bt<0&&(bt=0)):bt>vt&&(bt=vt),btvt)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||j(mt,bt,this.length);let Ut=this[mt],re=1,Kt=0;for(;++Kt>>0,bt=bt>>>0,vt||j(mt,bt,this.length);let Ut=this[mt+--bt],re=1;for(;bt>0&&(re*=256);)Ut+=this[mt+--bt]*re;return Ut},e.prototype.readUint8=e.prototype.readUInt8=function(mt,bt){return mt=mt>>>0,bt||j(mt,1,this.length),this[mt]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(mt,bt){return mt=mt>>>0,bt||j(mt,2,this.length),this[mt]|this[mt+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(mt,bt){return mt=mt>>>0,bt||j(mt,2,this.length),this[mt]<<8|this[mt+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(mt,bt){return mt=mt>>>0,bt||j(mt,4,this.length),(this[mt]|this[mt+1]<<8|this[mt+2]<<16)+this[mt+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(mt,bt){return mt=mt>>>0,bt||j(mt,4,this.length),this[mt]*16777216+(this[mt+1]<<16|this[mt+2]<<8|this[mt+3])},e.prototype.readBigUInt64LE=ee(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=bt+this[++mt]*2**8+this[++mt]*2**16+this[++mt]*2**24,re=this[++mt]+this[++mt]*2**8+this[++mt]*2**16+vt*2**24;return BigInt(Ut)+(BigInt(re)<>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=bt*2**24+this[++mt]*2**16+this[++mt]*2**8+this[++mt],re=this[++mt]*2**24+this[++mt]*2**16+this[++mt]*2**8+vt;return(BigInt(Ut)<>>0,bt=bt>>>0,vt||j(mt,bt,this.length);let Ut=this[mt],re=1,Kt=0;for(;++Kt=re&&(Ut-=Math.pow(2,8*bt)),Ut},e.prototype.readIntBE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||j(mt,bt,this.length);let Ut=bt,re=1,Kt=this[mt+--Ut];for(;Ut>0&&(re*=256);)Kt+=this[mt+--Ut]*re;return re*=128,Kt>=re&&(Kt-=Math.pow(2,8*bt)),Kt},e.prototype.readInt8=function(mt,bt){return mt=mt>>>0,bt||j(mt,1,this.length),this[mt]&128?(255-this[mt]+1)*-1:this[mt]},e.prototype.readInt16LE=function(mt,bt){mt=mt>>>0,bt||j(mt,2,this.length);let vt=this[mt]|this[mt+1]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt16BE=function(mt,bt){mt=mt>>>0,bt||j(mt,2,this.length);let vt=this[mt+1]|this[mt]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt32LE=function(mt,bt){return mt=mt>>>0,bt||j(mt,4,this.length),this[mt]|this[mt+1]<<8|this[mt+2]<<16|this[mt+3]<<24},e.prototype.readInt32BE=function(mt,bt){return mt=mt>>>0,bt||j(mt,4,this.length),this[mt]<<24|this[mt+1]<<16|this[mt+2]<<8|this[mt+3]},e.prototype.readBigInt64LE=ee(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=this[mt+4]+this[mt+5]*2**8+this[mt+6]*2**16+(vt<<24);return(BigInt(Ut)<>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=(bt<<24)+this[++mt]*2**16+this[++mt]*2**8+this[++mt];return(BigInt(Ut)<>>0,bt||j(mt,4,this.length),u.read(this,mt,!0,23,4)},e.prototype.readFloatBE=function(mt,bt){return mt=mt>>>0,bt||j(mt,4,this.length),u.read(this,mt,!1,23,4)},e.prototype.readDoubleLE=function(mt,bt){return mt=mt>>>0,bt||j(mt,8,this.length),u.read(this,mt,!0,52,8)},e.prototype.readDoubleBE=function(mt,bt){return mt=mt>>>0,bt||j(mt,8,this.length),u.read(this,mt,!1,52,8)};function N(mt,bt,vt,Ut,re,Kt){if(!e.isBuffer(mt))throw new TypeError('"buffer" argument must be a Buffer instance');if(bt>re||btmt.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,vt=vt>>>0,!Ut){let ue=Math.pow(2,8*vt)-1;N(this,mt,bt,vt,ue,0)}let re=1,Kt=0;for(this[bt]=mt&255;++Kt>>0,vt=vt>>>0,!Ut){let ue=Math.pow(2,8*vt)-1;N(this,mt,bt,vt,ue,0)}let re=vt-1,Kt=1;for(this[bt+re]=mt&255;--re>=0&&(Kt*=256);)this[bt+re]=mt/Kt&255;return bt+vt},e.prototype.writeUint8=e.prototype.writeUInt8=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,1,255,0),this[bt]=mt&255,bt+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,2,65535,0),this[bt]=mt&255,this[bt+1]=mt>>>8,bt+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,2,65535,0),this[bt]=mt>>>8,this[bt+1]=mt&255,bt+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,4,4294967295,0),this[bt+3]=mt>>>24,this[bt+2]=mt>>>16,this[bt+1]=mt>>>8,this[bt]=mt&255,bt+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,4,4294967295,0),this[bt]=mt>>>24,this[bt+1]=mt>>>16,this[bt+2]=mt>>>8,this[bt+3]=mt&255,bt+4};function G(mt,bt,vt,Ut,re){ut(bt,Ut,re,mt,vt,7);let Kt=Number(bt&BigInt(4294967295));mt[vt++]=Kt,Kt=Kt>>8,mt[vt++]=Kt,Kt=Kt>>8,mt[vt++]=Kt,Kt=Kt>>8,mt[vt++]=Kt;let ue=Number(bt>>BigInt(32)&BigInt(4294967295));return mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,vt}function rt(mt,bt,vt,Ut,re){ut(bt,Ut,re,mt,vt,7);let Kt=Number(bt&BigInt(4294967295));mt[vt+7]=Kt,Kt=Kt>>8,mt[vt+6]=Kt,Kt=Kt>>8,mt[vt+5]=Kt,Kt=Kt>>8,mt[vt+4]=Kt;let ue=Number(bt>>BigInt(32)&BigInt(4294967295));return mt[vt+3]=ue,ue=ue>>8,mt[vt+2]=ue,ue=ue>>8,mt[vt+1]=ue,ue=ue>>8,mt[vt]=ue,vt+8}e.prototype.writeBigUInt64LE=ee(function(mt,bt=0){return G(this,mt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=ee(function(mt,bt=0){return rt(this,mt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,!Ut){let Me=Math.pow(2,8*vt-1);N(this,mt,bt,vt,Me-1,-Me)}let re=0,Kt=1,ue=0;for(this[bt]=mt&255;++re>0)-ue&255;return bt+vt},e.prototype.writeIntBE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,!Ut){let Me=Math.pow(2,8*vt-1);N(this,mt,bt,vt,Me-1,-Me)}let re=vt-1,Kt=1,ue=0;for(this[bt+re]=mt&255;--re>=0&&(Kt*=256);)mt<0&&ue===0&&this[bt+re+1]!==0&&(ue=1),this[bt+re]=(mt/Kt>>0)-ue&255;return bt+vt},e.prototype.writeInt8=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,1,127,-128),mt<0&&(mt=255+mt+1),this[bt]=mt&255,bt+1},e.prototype.writeInt16LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,2,32767,-32768),this[bt]=mt&255,this[bt+1]=mt>>>8,bt+2},e.prototype.writeInt16BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,2,32767,-32768),this[bt]=mt>>>8,this[bt+1]=mt&255,bt+2},e.prototype.writeInt32LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,4,2147483647,-2147483648),this[bt]=mt&255,this[bt+1]=mt>>>8,this[bt+2]=mt>>>16,this[bt+3]=mt>>>24,bt+4},e.prototype.writeInt32BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||N(this,mt,bt,4,2147483647,-2147483648),mt<0&&(mt=4294967295+mt+1),this[bt]=mt>>>24,this[bt+1]=mt>>>16,this[bt+2]=mt>>>8,this[bt+3]=mt&255,bt+4},e.prototype.writeBigInt64LE=ee(function(mt,bt=0){return G(this,mt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=ee(function(mt,bt=0){return rt(this,mt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ct(mt,bt,vt,Ut,re,Kt){if(vt+Ut>mt.length)throw new RangeError("Index out of range");if(vt<0)throw new RangeError("Index out of range")}function st(mt,bt,vt,Ut,re){return bt=+bt,vt=vt>>>0,re||ct(mt,bt,vt,4),u.write(mt,bt,vt,Ut,23,4),vt+4}e.prototype.writeFloatLE=function(mt,bt,vt){return st(this,mt,bt,!0,vt)},e.prototype.writeFloatBE=function(mt,bt,vt){return st(this,mt,bt,!1,vt)};function et(mt,bt,vt,Ut,re){return bt=+bt,vt=vt>>>0,re||ct(mt,bt,vt,8),u.write(mt,bt,vt,Ut,52,8),vt+8}e.prototype.writeDoubleLE=function(mt,bt,vt){return et(this,mt,bt,!0,vt)},e.prototype.writeDoubleBE=function(mt,bt,vt){return et(this,mt,bt,!1,vt)},e.prototype.copy=function(mt,bt,vt,Ut){if(!e.isBuffer(mt))throw new TypeError("argument should be a Buffer");if(vt||(vt=0),!Ut&&Ut!==0&&(Ut=this.length),bt>=mt.length&&(bt=mt.length),bt||(bt=0),Ut>0&&Ut=this.length)throw new RangeError("Index out of range");if(Ut<0)throw new RangeError("sourceEnd out of bounds");Ut>this.length&&(Ut=this.length),mt.length-bt>>0,vt=vt===void 0?this.length:vt>>>0,mt||(mt=0);let re;if(typeof mt=="number")for(re=bt;re2**32?re=X(String(vt)):typeof vt=="bigint"&&(re=String(vt),(vt>BigInt(2)**BigInt(32)||vt<-(BigInt(2)**BigInt(32)))&&(re=X(re)),re+="n"),Ut+=` It must be ${bt}. Received ${re}`,Ut},RangeError);function X(mt){let bt="",vt=mt.length,Ut=mt[0]==="-"?1:0;for(;vt>=Ut+4;vt-=3)bt=`_${mt.slice(vt-3,vt)}${bt}`;return`${mt.slice(0,vt)}${bt}`}function Q(mt,bt,vt){J(bt,"offset"),(mt[bt]===void 0||mt[bt+vt]===void 0)&&q(bt,mt.length-(vt+1))}function ut(mt,bt,vt,Ut,re,Kt){if(mt>vt||mt= 0${ue} and < 2${ue} ** ${(Kt+1)*8}${ue}`:Me=`>= -(2${ue} ** ${(Kt+1)*8-1}${ue}) and < 2 ** ${(Kt+1)*8-1}${ue}`,new Z.ERR_OUT_OF_RANGE("value",Me,mt)}Q(Ut,re,Kt)}function J(mt,bt){if(typeof mt!="number")throw new Z.ERR_INVALID_ARG_TYPE(bt,"number",mt)}function q(mt,bt,vt){throw Math.floor(mt)!==mt?(J(mt,vt),new Z.ERR_OUT_OF_RANGE("offset","an integer",mt)):bt<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${bt}`,mt)}var it=/[^+/0-9A-Za-z-_]/g;function nt(mt){if(mt=mt.split("=")[0],mt=mt.trim().replace(it,""),mt.length<2)return"";for(;mt.length%4!==0;)mt=mt+"=";return mt}function dt(mt,bt){bt=bt||1/0;let vt,Ut=mt.length,re=null,Kt=[];for(let ue=0;ue55295&&vt<57344){if(!re){if(vt>56319){(bt-=3)>-1&&Kt.push(239,191,189);continue}else if(ue+1===Ut){(bt-=3)>-1&&Kt.push(239,191,189);continue}re=vt;continue}if(vt<56320){(bt-=3)>-1&&Kt.push(239,191,189),re=vt;continue}vt=(re-55296<<10|vt-56320)+65536}else re&&(bt-=3)>-1&&Kt.push(239,191,189);if(re=null,vt<128){if((bt-=1)<0)break;Kt.push(vt)}else if(vt<2048){if((bt-=2)<0)break;Kt.push(vt>>6|192,vt&63|128)}else if(vt<65536){if((bt-=3)<0)break;Kt.push(vt>>12|224,vt>>6&63|128,vt&63|128)}else if(vt<1114112){if((bt-=4)<0)break;Kt.push(vt>>18|240,vt>>12&63|128,vt>>6&63|128,vt&63|128)}else throw new Error("Invalid code point")}return Kt}function Tt(mt){let bt=[];for(let vt=0;vt>8,re=vt%256,Kt.push(re),Kt.push(Ut);return Kt}function Ct(mt){return V.toByteArray(nt(mt))}function It(mt,bt,vt,Ut){let re;for(re=0;re=bt.length||re>=mt.length);++re)bt[re+vt]=mt[re];return re}function Nt(mt,bt){return mt instanceof bt||mt!=null&&mt.constructor!=null&&mt.constructor.name!=null&&mt.constructor.name===bt.name}function te(mt){return mt!==mt}var Jt=(function(){let mt="0123456789abcdef",bt=new Array(256);for(let vt=0;vt<16;++vt){let Ut=vt*16;for(let re=0;re<16;++re)bt[Ut+re]=mt[vt]+mt[re]}return bt})();function ee(mt){return typeof BigInt>"u"?Zt:mt}function Zt(){throw new Error("BigInt not supported")}}),F1=Vt((K,V)=>{V.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var u={},d=Symbol("test"),E=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var A=42;u[d]=A;for(var t in u)return!1;if(typeof Object.keys=="function"&&Object.keys(u).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(u).length!==0)return!1;var e=Object.getOwnPropertySymbols(u);if(e.length!==1||e[0]!==d||!Object.prototype.propertyIsEnumerable.call(u,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(u,d);if(r.value!==A||r.enumerable!==!0)return!1}return!0}}),tv=Vt((K,V)=>{var u=F1();V.exports=function(){return u()&&!!Symbol.toStringTag}}),F2=Vt((K,V)=>{V.exports=Object}),YA=Vt((K,V)=>{V.exports=Error}),XA=Vt((K,V)=>{V.exports=EvalError}),$A=Vt((K,V)=>{V.exports=RangeError}),JA=Vt((K,V)=>{V.exports=ReferenceError}),B2=Vt((K,V)=>{V.exports=SyntaxError}),Dm=Vt((K,V)=>{V.exports=TypeError}),QA=Vt((K,V)=>{V.exports=URIError}),tM=Vt((K,V)=>{V.exports=Math.abs}),eM=Vt((K,V)=>{V.exports=Math.floor}),rM=Vt((K,V)=>{V.exports=Math.max}),nM=Vt((K,V)=>{V.exports=Math.min}),aM=Vt((K,V)=>{V.exports=Math.pow}),iM=Vt((K,V)=>{V.exports=Math.round}),oM=Vt((K,V)=>{V.exports=Number.isNaN||function(u){return u!==u}}),sM=Vt((K,V)=>{var u=oM();V.exports=function(d){return u(d)||d===0?d:d<0?-1:1}}),lM=Vt((K,V)=>{V.exports=Object.getOwnPropertyDescriptor}),g0=Vt((K,V)=>{var u=lM();if(u)try{u([],"length")}catch{u=null}V.exports=u}),ev=Vt((K,V)=>{var u=Object.defineProperty||!1;if(u)try{u({},"a",{value:1})}catch{u=!1}V.exports=u}),uM=Vt((K,V)=>{var u=typeof Symbol<"u"&&Symbol,d=F1();V.exports=function(){return typeof u!="function"||typeof Symbol!="function"||typeof u("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:d()}}),R2=Vt((K,V)=>{V.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),N2=Vt((K,V)=>{var u=F2();V.exports=u.getPrototypeOf||null}),cM=Vt((K,V)=>{var u="Function.prototype.bind called on incompatible ",d=Object.prototype.toString,E=Math.max,A="[object Function]",t=function(i,n){for(var o=[],a=0;a{var u=cM();V.exports=Function.prototype.bind||u}),B1=Vt((K,V)=>{V.exports=Function.prototype.call}),j2=Vt((K,V)=>{V.exports=Function.prototype.apply}),fM=Vt((K,V)=>{V.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),hM=Vt((K,V)=>{var u=Fm(),d=j2(),E=B1(),A=fM();V.exports=A||u.call(E,d)}),pM=Vt((K,V)=>{var u=Fm(),d=Dm(),E=B1(),A=hM();V.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new d("a function is required");return A(u,E,t)}}),dM=Vt((K,V)=>{var u=pM(),d=g0(),E;try{E=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var A=!!E&&d&&d(Object.prototype,"__proto__"),t=Object,e=t.getPrototypeOf;V.exports=A&&typeof A.get=="function"?u([A.get]):typeof e=="function"?function(r){return e(r==null?r:t(r))}:!1}),mM=Vt((K,V)=>{var u=R2(),d=N2(),E=dM();V.exports=u?function(A){return u(A)}:d?function(A){if(!A||typeof A!="object"&&typeof A!="function")throw new TypeError("getProto: not an object");return d(A)}:E?function(A){return E(A)}:null}),gM=Vt((K,V)=>{var u=Function.prototype.call,d=Object.prototype.hasOwnProperty,E=Fm();V.exports=E.call(u,d)}),R1=Vt((K,V)=>{var u,d=F2(),E=YA(),A=XA(),t=$A(),e=JA(),r=B2(),i=Dm(),n=QA(),o=tM(),a=eM(),s=rM(),f=nM(),v=aM(),g=iM(),m=sM(),w=Function,l=function(Q){try{return w('"use strict"; return ('+Q+").constructor;")()}catch{}},x=g0(),y=ev(),S=function(){throw new i},k=x?(function(){try{return arguments.callee,S}catch{try{return x(arguments,"callee").get}catch{return S}}})():S,M=uM()(),T=mM(),c=N2(),h=R2(),b=j2(),_=B1(),P={},z=typeof Uint8Array>"u"||!T?u:T(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?u:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?u:ArrayBuffer,"%ArrayIteratorPrototype%":M&&T?T([][Symbol.iterator]()):u,"%AsyncFromSyncIteratorPrototype%":u,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?u:Atomics,"%BigInt%":typeof BigInt>"u"?u:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?u:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?u:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?u:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E,"%eval%":eval,"%EvalError%":A,"%Float16Array%":typeof Float16Array>"u"?u:Float16Array,"%Float32Array%":typeof Float32Array>"u"?u:Float32Array,"%Float64Array%":typeof Float64Array>"u"?u:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?u:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?u:Int8Array,"%Int16Array%":typeof Int16Array>"u"?u:Int16Array,"%Int32Array%":typeof Int32Array>"u"?u:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&T?T(T([][Symbol.iterator]())):u,"%JSON%":typeof JSON=="object"?JSON:u,"%Map%":typeof Map>"u"?u:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!T?u:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":d,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?u:Promise,"%Proxy%":typeof Proxy>"u"?u:Proxy,"%RangeError%":t,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?u:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?u:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!T?u:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?u:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&T?T(""[Symbol.iterator]()):u,"%Symbol%":M?Symbol:u,"%SyntaxError%":r,"%ThrowTypeError%":k,"%TypedArray%":z,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?u:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?u:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?u:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?u:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?u:WeakMap,"%WeakRef%":typeof WeakRef>"u"?u:WeakRef,"%WeakSet%":typeof WeakSet>"u"?u:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":b,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":c,"%Math.abs%":o,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":v,"%Math.round%":g,"%Math.sign%":m,"%Reflect.getPrototypeOf%":h};if(T)try{null.error}catch(Q){B=T(T(Q)),D["%Error.prototype%"]=B}var B,R=function Q(ut){var J;if(ut==="%AsyncFunction%")J=l("async function () {}");else if(ut==="%GeneratorFunction%")J=l("function* () {}");else if(ut==="%AsyncGeneratorFunction%")J=l("async function* () {}");else if(ut==="%AsyncGenerator%"){var q=Q("%AsyncGeneratorFunction%");q&&(J=q.prototype)}else if(ut==="%AsyncIteratorPrototype%"){var it=Q("%AsyncGenerator%");it&&T&&(J=T(it.prototype))}return D[ut]=J,J},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=Fm(),j=gM(),N=F.call(_,Array.prototype.concat),G=F.call(b,Array.prototype.splice),rt=F.call(_,String.prototype.replace),ct=F.call(_,String.prototype.slice),st=F.call(_,RegExp.prototype.exec),et=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,ot=function(Q){var ut=ct(Q,0,1),J=ct(Q,-1);if(ut==="%"&&J!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(J==="%"&&ut!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var q=[];return rt(Q,et,function(it,nt,dt,Tt){q[q.length]=dt?rt(Tt,Z,"$1"):nt||it}),q},X=function(Q,ut){var J=Q,q;if(j(I,J)&&(q=I[J],J="%"+q[0]+"%"),j(D,J)){var it=D[J];if(it===P&&(it=R(J)),typeof it>"u"&&!ut)throw new i("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:q,name:J,value:it}}throw new r("intrinsic "+Q+" does not exist!")};V.exports=function(Q,ut){if(typeof Q!="string"||Q.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ut!="boolean")throw new i('"allowMissing" argument must be a boolean');if(st(/^%?[^%]*%?$/,Q)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var J=ot(Q),q=J.length>0?J[0]:"",it=X("%"+q+"%",ut),nt=it.name,dt=it.value,Tt=!1,wt=it.alias;wt&&(q=wt[0],G(J,N([0,1],wt)));for(var Ct=1,It=!0;Ct=J.length){var ee=x(dt,Nt);It=!!ee,It&&"get"in ee&&!("originalValue"in ee.get)?dt=ee.get:dt=dt[Nt]}else It=j(dt,Nt),dt=dt[Nt];It&&!Tt&&(D[nt]=dt)}}return dt}}),vM=Vt((K,V)=>{var u=ev(),d=B2(),E=Dm(),A=g0();V.exports=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new E("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new E("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new E("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new E("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new E("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new E("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,s=!!A&&A(t,e);if(u)u(t,e,{configurable:o===null&&s?s.configurable:!o,enumerable:i===null&&s?s.enumerable:!i,value:r,writable:n===null&&s?s.writable:!n});else if(a||!i&&!n&&!o)t[e]=r;else throw new d("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),U2=Vt((K,V)=>{var u=ev(),d=function(){return!!u};d.hasArrayLengthDefineBug=function(){if(!u)return null;try{return u([],"length",{value:1}).length!==1}catch{return!0}},V.exports=d}),yM=Vt((K,V)=>{var u=R1(),d=vM(),E=U2()(),A=g0(),t=Dm(),e=u("%Math.floor%");V.exports=function(r,i){if(typeof r!="function")throw new t("`fn` is not a function");if(typeof i!="number"||i<0||i>4294967295||e(i)!==i)throw new t("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in r&&A){var s=A(r,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(a=!1)}return(o||a||!n)&&(E?d(r,"length",i,!0,!0):d(r,"length",i)),r}}),rv=Vt((K,V)=>{var u=Fm(),d=R1(),E=yM(),A=Dm(),t=d("%Function.prototype.apply%"),e=d("%Function.prototype.call%"),r=d("%Reflect.apply%",!0)||u.call(e,t),i=ev(),n=d("%Math.max%");V.exports=function(a){if(typeof a!="function")throw new A("a function is required");var s=r(u,e,arguments);return E(s,1+n(0,a.length-(arguments.length-1)),!0)};var o=function(){return r(u,t,arguments)};i?i(V.exports,"apply",{value:o}):V.exports.apply=o}),Bm=Vt((K,V)=>{var u=R1(),d=rv(),E=d(u("String.prototype.indexOf"));V.exports=function(A,t){var e=u(A,!!t);return typeof e=="function"&&E(A,".prototype.")>-1?d(e):e}}),xM=Vt((K,V)=>{var u=tv()(),d=Bm(),E=d("Object.prototype.toString"),A=function(r){return u&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:E(r)==="[object Arguments]"},t=function(r){return A(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&E(r)!=="[object Array]"&&E(r.callee)==="[object Function]"},e=(function(){return A(arguments)})();A.isLegacyArguments=t,V.exports=e?A:t}),_M=Vt((K,V)=>{var u=Object.prototype.toString,d=Function.prototype.toString,E=/^\s*(?:function)?\*/,A=tv()(),t=Object.getPrototypeOf,e=function(){if(!A)return!1;try{return Function("return function*() {}")()}catch{}},r;V.exports=function(i){if(typeof i!="function")return!1;if(E.test(d.call(i)))return!0;if(!A){var n=u.call(i);return n==="[object GeneratorFunction]"}if(!t)return!1;if(typeof r>"u"){var o=e();r=o?t(o):!1}return t(i)===r}}),bM=Vt((K,V)=>{var u=Function.prototype.toString,d=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,E,A;if(typeof d=="function"&&typeof Object.defineProperty=="function")try{E=Object.defineProperty({},"length",{get:function(){throw A}}),A={},d(function(){throw 42},null,E)}catch(x){x!==A&&(d=null)}else d=null;var t=/^\s*class\b/,e=function(x){try{var y=u.call(x);return t.test(y)}catch{return!1}},r=function(x){try{return e(x)?!1:(u.call(x),!0)}catch{return!1}},i=Object.prototype.toString,n="[object Object]",o="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",v="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),w=function(){return!1};typeof document=="object"&&(l=document.all,i.call(l)===i.call(document.all)&&(w=function(x){if((m||!x)&&(typeof x>"u"||typeof x=="object"))try{var y=i.call(x);return(y===s||y===f||y===v||y===n)&&x("")==null}catch{}return!1}));var l;V.exports=d?function(x){if(w(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{d(x,null,E)}catch(y){if(y!==A)return!1}return!e(x)&&r(x)}:function(x){if(w(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(g)return r(x);if(e(x))return!1;var y=i.call(x);return y!==o&&y!==a&&!/^\[object HTML/.test(y)?!1:r(x)}}),V2=Vt((K,V)=>{var u=bM(),d=Object.prototype.toString,E=Object.prototype.hasOwnProperty,A=function(i,n,o){for(var a=0,s=i.length;a=3&&(a=o),d.call(i)==="[object Array]"?A(i,n,a):typeof i=="string"?t(i,n,a):e(i,n,a)};V.exports=r}),H2=Vt((K,V)=>{var u=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],d=typeof globalThis>"u"?window:globalThis;V.exports=function(){for(var E=[],A=0;A{var u=V2(),d=H2(),E=rv(),A=Bm(),t=g0(),e=A("Object.prototype.toString"),r=tv()(),i=typeof globalThis>"u"?window:globalThis,n=d(),o=A("String.prototype.slice"),a=Object.getPrototypeOf,s=A("Array.prototype.indexOf",!0)||function(m,w){for(var l=0;l-1?w:w!=="Object"?!1:g(m)}return t?v(m):null}}),TM=Vt((K,V)=>{var u=V2(),d=H2(),E=Bm(),A=E("Object.prototype.toString"),t=tv()(),e=g0(),r=typeof globalThis>"u"?window:globalThis,i=d(),n=E("Array.prototype.indexOf",!0)||function(v,g){for(var m=0;m-1}return e?f(v):!1}}),q2=Vt(K=>{var V=xM(),u=_M(),d=wM(),E=TM();function A(wt){return wt.call.bind(wt)}var t=typeof BigInt<"u",e=typeof Symbol<"u",r=A(Object.prototype.toString),i=A(Number.prototype.valueOf),n=A(String.prototype.valueOf),o=A(Boolean.prototype.valueOf);t&&(a=A(BigInt.prototype.valueOf));var a;e&&(s=A(Symbol.prototype.valueOf));var s;function f(wt,Ct){if(typeof wt!="object")return!1;try{return Ct(wt),!0}catch{return!1}}K.isArgumentsObject=V,K.isGeneratorFunction=u,K.isTypedArray=E;function v(wt){return typeof Promise<"u"&&wt instanceof Promise||wt!==null&&typeof wt=="object"&&typeof wt.then=="function"&&typeof wt.catch=="function"}K.isPromise=v;function g(wt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(wt):E(wt)||G(wt)}K.isArrayBufferView=g;function m(wt){return d(wt)==="Uint8Array"}K.isUint8Array=m;function w(wt){return d(wt)==="Uint8ClampedArray"}K.isUint8ClampedArray=w;function l(wt){return d(wt)==="Uint16Array"}K.isUint16Array=l;function x(wt){return d(wt)==="Uint32Array"}K.isUint32Array=x;function y(wt){return d(wt)==="Int8Array"}K.isInt8Array=y;function S(wt){return d(wt)==="Int16Array"}K.isInt16Array=S;function k(wt){return d(wt)==="Int32Array"}K.isInt32Array=k;function M(wt){return d(wt)==="Float32Array"}K.isFloat32Array=M;function T(wt){return d(wt)==="Float64Array"}K.isFloat64Array=T;function c(wt){return d(wt)==="BigInt64Array"}K.isBigInt64Array=c;function h(wt){return d(wt)==="BigUint64Array"}K.isBigUint64Array=h;function b(wt){return r(wt)==="[object Map]"}b.working=typeof Map<"u"&&b(new Map);function _(wt){return typeof Map>"u"?!1:b.working?b(wt):wt instanceof Map}K.isMap=_;function P(wt){return r(wt)==="[object Set]"}P.working=typeof Set<"u"&&P(new Set);function z(wt){return typeof Set>"u"?!1:P.working?P(wt):wt instanceof Set}K.isSet=z;function D(wt){return r(wt)==="[object WeakMap]"}D.working=typeof WeakMap<"u"&&D(new WeakMap);function B(wt){return typeof WeakMap>"u"?!1:D.working?D(wt):wt instanceof WeakMap}K.isWeakMap=B;function R(wt){return r(wt)==="[object WeakSet]"}R.working=typeof WeakSet<"u"&&R(new WeakSet);function I(wt){return R(wt)}K.isWeakSet=I;function F(wt){return r(wt)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer<"u"&&F(new ArrayBuffer);function j(wt){return typeof ArrayBuffer>"u"?!1:F.working?F(wt):wt instanceof ArrayBuffer}K.isArrayBuffer=j;function N(wt){return r(wt)==="[object DataView]"}N.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&N(new DataView(new ArrayBuffer(1),0,1));function G(wt){return typeof DataView>"u"?!1:N.working?N(wt):wt instanceof DataView}K.isDataView=G;var rt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ct(wt){return r(wt)==="[object SharedArrayBuffer]"}function st(wt){return typeof rt>"u"?!1:(typeof ct.working>"u"&&(ct.working=ct(new rt)),ct.working?ct(wt):wt instanceof rt)}K.isSharedArrayBuffer=st;function et(wt){return r(wt)==="[object AsyncFunction]"}K.isAsyncFunction=et;function Z(wt){return r(wt)==="[object Map Iterator]"}K.isMapIterator=Z;function ot(wt){return r(wt)==="[object Set Iterator]"}K.isSetIterator=ot;function X(wt){return r(wt)==="[object Generator]"}K.isGeneratorObject=X;function Q(wt){return r(wt)==="[object WebAssembly.Module]"}K.isWebAssemblyCompiledModule=Q;function ut(wt){return f(wt,i)}K.isNumberObject=ut;function J(wt){return f(wt,n)}K.isStringObject=J;function q(wt){return f(wt,o)}K.isBooleanObject=q;function it(wt){return t&&f(wt,a)}K.isBigIntObject=it;function nt(wt){return e&&f(wt,s)}K.isSymbolObject=nt;function dt(wt){return ut(wt)||J(wt)||q(wt)||it(wt)||nt(wt)}K.isBoxedPrimitive=dt;function Tt(wt){return typeof Uint8Array<"u"&&(j(wt)||st(wt))}K.isAnyArrayBuffer=Tt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(wt){Object.defineProperty(K,wt,{enumerable:!1,value:function(){throw new Error(wt+" is not supported in userland")}})})}),W2=Vt((K,V)=>{V.exports=function(u){return u&&typeof u=="object"&&typeof u.copy=="function"&&typeof u.fill=="function"&&typeof u.readUInt8=="function"}}),G2=Vt(K=>{var V=Object.getOwnPropertyDescriptors||function(N){for(var G=Object.keys(N),rt={},ct=0;ct=st)return X;switch(X){case"%s":return String(ct[rt++]);case"%d":return Number(ct[rt++]);case"%j":try{return JSON.stringify(ct[rt++])}catch{return"[Circular]"}default:return X}}),Z=ct[rt];rt"u")return function(){return K.deprecate(N,G).apply(this,arguments)};var rt=!1;function ct(){if(!rt){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),rt=!0}return N.apply(this,arguments)}return ct};var d={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;K.debuglog=function(N){if(N=N.toUpperCase(),!d[N])if(E.test(N)){var G=process.pid;d[N]=function(){var rt=K.format.apply(K,arguments);console.error("%s %d: %s",N,G,rt)}}else d[N]=function(){};return d[N]};function t(N,G){var rt={seen:[],stylize:r};return arguments.length>=3&&(rt.depth=arguments[2]),arguments.length>=4&&(rt.colors=arguments[3]),m(G)?rt.showHidden=G:G&&K._extend(rt,G),k(rt.showHidden)&&(rt.showHidden=!1),k(rt.depth)&&(rt.depth=2),k(rt.colors)&&(rt.colors=!1),k(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,N,rt.depth)}K.inspect=t,t.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function e(N,G){var rt=t.styles[G];return rt?"\x1B["+t.colors[rt][0]+"m"+N+"\x1B["+t.colors[rt][1]+"m":N}function r(N,G){return N}function i(N){var G={};return N.forEach(function(rt,ct){G[rt]=!0}),G}function n(N,G,rt){if(N.customInspect&&G&&b(G.inspect)&&G.inspect!==K.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,N);return y(ct)||(ct=n(N,ct,rt)),ct}var st=o(N,G);if(st)return st;var et=Object.keys(G),Z=i(et);if(N.showHidden&&(et=Object.getOwnPropertyNames(G)),h(G)&&(et.indexOf("message")>=0||et.indexOf("description")>=0))return a(G);if(et.length===0){if(b(G)){var ot=G.name?": "+G.name:"";return N.stylize("[Function"+ot+"]","special")}if(M(G))return N.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return N.stylize(Date.prototype.toString.call(G),"date");if(h(G))return a(G)}var X="",Q=!1,ut=["{","}"];if(g(G)&&(Q=!0,ut=["[","]"]),b(G)){var J=G.name?": "+G.name:"";X=" [Function"+J+"]"}if(M(G)&&(X=" "+RegExp.prototype.toString.call(G)),c(G)&&(X=" "+Date.prototype.toUTCString.call(G)),h(G)&&(X=" "+a(G)),et.length===0&&(!Q||G.length==0))return ut[0]+X+ut[1];if(rt<0)return M(G)?N.stylize(RegExp.prototype.toString.call(G),"regexp"):N.stylize("[Object]","special");N.seen.push(G);var q;return Q?q=s(N,G,rt,Z,et):q=et.map(function(it){return f(N,G,rt,Z,it,Q)}),N.seen.pop(),v(q,X,ut)}function o(N,G){if(k(G))return N.stylize("undefined","undefined");if(y(G)){var rt="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(rt,"string")}if(x(G))return N.stylize(""+G,"number");if(m(G))return N.stylize(""+G,"boolean");if(w(G))return N.stylize("null","null")}function a(N){return"["+Error.prototype.toString.call(N)+"]"}function s(N,G,rt,ct,st){for(var et=[],Z=0,ot=G.length;Z-1&&(et?ot=ot.split(` -`).map(function(Q){return" "+Q}).join(` -`).slice(2):ot=` -`+ot.split(` -`).map(function(Q){return" "+Q}).join(` -`))):ot=N.stylize("[Circular]","special")),k(Z)){if(et&&st.match(/^\d+$/))return ot;Z=JSON.stringify(""+st),Z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Z=Z.slice(1,-1),Z=N.stylize(Z,"name")):(Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=N.stylize(Z,"string"))}return Z+": "+ot}function v(N,G,rt){var ct=0,st=N.reduce(function(et,Z){return ct++,Z.indexOf(` -`)>=0&&ct++,et+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return st>60?rt[0]+(G===""?"":G+` - `)+" "+N.join(`, - `)+" "+rt[1]:rt[0]+G+" "+N.join(", ")+" "+rt[1]}K.types=q2();function g(N){return Array.isArray(N)}K.isArray=g;function m(N){return typeof N=="boolean"}K.isBoolean=m;function w(N){return N===null}K.isNull=w;function l(N){return N==null}K.isNullOrUndefined=l;function x(N){return typeof N=="number"}K.isNumber=x;function y(N){return typeof N=="string"}K.isString=y;function S(N){return typeof N=="symbol"}K.isSymbol=S;function k(N){return N===void 0}K.isUndefined=k;function M(N){return T(N)&&P(N)==="[object RegExp]"}K.isRegExp=M,K.types.isRegExp=M;function T(N){return typeof N=="object"&&N!==null}K.isObject=T;function c(N){return T(N)&&P(N)==="[object Date]"}K.isDate=c,K.types.isDate=c;function h(N){return T(N)&&(P(N)==="[object Error]"||N instanceof Error)}K.isError=h,K.types.isNativeError=h;function b(N){return typeof N=="function"}K.isFunction=b;function _(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N>"u"}K.isPrimitive=_,K.isBuffer=W2();function P(N){return Object.prototype.toString.call(N)}function z(N){return N<10?"0"+N.toString(10):N.toString(10)}var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var N=new Date,G=[z(N.getHours()),z(N.getMinutes()),z(N.getSeconds())].join(":");return[N.getDate(),D[N.getMonth()],G].join(" ")}K.log=function(){console.log("%s - %s",B(),K.format.apply(K,arguments))},K.inherits=Bp(),K._extend=function(N,G){if(!G||!T(G))return N;for(var rt=Object.keys(G),ct=rt.length;ct--;)N[rt[ct]]=G[rt[ct]];return N};function R(N,G){return Object.prototype.hasOwnProperty.call(N,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;K.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&N[I]){var G=N[I];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,st=new Promise(function(ot,X){rt=ot,ct=X}),et=[],Z=0;Z{function u(f,v){var g=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);v&&(m=m.filter(function(w){return Object.getOwnPropertyDescriptor(f,w).enumerable})),g.push.apply(g,m)}return g}function d(f){for(var v=1;v0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(v){var g={data:v,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var g=this.head,m=""+g.data;g=g.next;)m+=v+g.data;return m}},{key:"concat",value:function(v){if(this.length===0)return i.alloc(0);for(var g=i.allocUnsafe(v>>>0),m=this.head,w=0;m;)s(m.data,g,w),w+=m.data.length,m=m.next;return g}},{key:"consume",value:function(v,g){var m;return vl.length?l.length:v;if(x===l.length?w+=l:w+=l.slice(0,v),v-=x,v===0){x===l.length?(++m,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=l.slice(x));break}++m}return this.length-=m,w}},{key:"_getBuffer",value:function(v){var g=i.allocUnsafe(v),m=this.head,w=1;for(m.data.copy(g),v-=m.data.length;m=m.next;){var l=m.data,x=v>l.length?l.length:v;if(l.copy(g,g.length-v,0,x),v-=x,v===0){x===l.length?(++w,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=l.slice(x));break}++w}return this.length-=w,g}},{key:a,value:function(v,g){return o(this,d({},g,{depth:0,customInspect:!1}))}}]),f})()}),Z2=Vt((K,V)=>{function u(r,i){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(t,this,r)):process.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!i&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(E,n):(n._writableState.errorEmitted=!0,process.nextTick(d,n,s)):process.nextTick(d,n,s):i?(process.nextTick(E,n),i(s)):process.nextTick(E,n)}),this)}function d(r,i){t(r,i),E(r)}function E(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function A(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function t(r,i){r.emit("error",i)}function e(r,i){var n=r._readableState,o=r._writableState;n&&n.autoDestroy||o&&o.autoDestroy?r.destroy(i):r.emit("error",i)}V.exports={destroy:u,undestroy:A,errorOrDestroy:e}}),v0=Vt((K,V)=>{function u(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n}var d={};function E(i,n,o){o||(o=Error);function a(f,v,g){return typeof n=="string"?n:n(f,v,g)}var s=(function(f){u(v,f);function v(g,m,w){return f.call(this,a(g,m,w))||this}return v})(o);s.prototype.name=o.name,s.prototype.code=i,d[i]=s}function A(i,n){if(Array.isArray(i)){var o=i.length;return i=i.map(function(a){return String(a)}),o>2?"one of ".concat(n," ").concat(i.slice(0,o-1).join(", "),", or ")+i[o-1]:o===2?"one of ".concat(n," ").concat(i[0]," or ").concat(i[1]):"of ".concat(n," ").concat(i[0])}else return"of ".concat(n," ").concat(String(i))}function t(i,n,o){return i.substr(0,n.length)===n}function e(i,n,o){return(o===void 0||o>i.length)&&(o=i.length),i.substring(o-n.length,o)===n}function r(i,n,o){return typeof o!="number"&&(o=0),o+n.length>i.length?!1:i.indexOf(n,o)!==-1}E("ERR_INVALID_OPT_VALUE",function(i,n){return'The value "'+n+'" is invalid for option "'+i+'"'},TypeError),E("ERR_INVALID_ARG_TYPE",function(i,n,o){var a;typeof n=="string"&&t(n,"not ")?(a="must not be",n=n.replace(/^not /,"")):a="must be";var s;if(e(i," argument"))s="The ".concat(i," ").concat(a," ").concat(A(n,"type"));else{var f=r(i,".")?"property":"argument";s='The "'.concat(i,'" ').concat(f," ").concat(a," ").concat(A(n,"type"))}return s+=". Received type ".concat(typeof o),s},TypeError),E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),E("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),E("ERR_STREAM_PREMATURE_CLOSE","Premature close"),E("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),E("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),E("ERR_STREAM_WRITE_AFTER_END","write after end"),E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),E("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),V.exports.codes=d}),K2=Vt((K,V)=>{var u=v0().codes.ERR_INVALID_OPT_VALUE;function d(A,t,e){return A.highWaterMark!=null?A.highWaterMark:t?A[e]:null}function E(A,t,e,r){var i=d(t,r,e);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var n=r?e:"highWaterMark";throw new u(n,i)}return Math.floor(i)}return A.objectMode?16:16*1024}V.exports={getHighWaterMark:E}}),AM=Vt((K,V)=>{V.exports=u;function u(E,A){if(d("noDeprecation"))return E;var t=!1;function e(){if(!t){if(d("throwDeprecation"))throw new Error(A);d("traceDeprecation")?console.trace(A):console.warn(A),t=!0}return E.apply(this,arguments)}return e}function d(E){try{if(!window.localStorage)return!1}catch{return!1}var A=window.localStorage[E];return A==null?!1:String(A).toLowerCase()==="true"}}),Y2=Vt((K,V)=>{V.exports=c;function u(Z){var ot=this;this.next=null,this.entry=null,this.finish=function(){et(ot,Z)}}var d;c.WritableState=M;var E={deprecate:AM()},A=D2(),t=m0().Buffer,e=window.Uint8Array||function(){};function r(Z){return t.from(Z)}function i(Z){return t.isBuffer(Z)||Z instanceof e}var n=Z2(),o=K2(),a=o.getHighWaterMark,s=v0().codes,f=s.ERR_INVALID_ARG_TYPE,v=s.ERR_METHOD_NOT_IMPLEMENTED,g=s.ERR_MULTIPLE_CALLBACK,m=s.ERR_STREAM_CANNOT_PIPE,w=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,x=s.ERR_STREAM_WRITE_AFTER_END,y=s.ERR_UNKNOWN_ENCODING,S=n.errorOrDestroy;Bp()(c,A);function k(){}function M(Z,ot,X){d=d||y0(),Z=Z||{},typeof X!="boolean"&&(X=ot instanceof d),this.objectMode=!!Z.objectMode,X&&(this.objectMode=this.objectMode||!!Z.writableObjectMode),this.highWaterMark=a(this,Z,"writableHighWaterMark",X),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=Z.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=Z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ut){R(ot,ut)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Z.emitClose!==!1,this.autoDestroy=!!Z.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}M.prototype.getBuffer=function(){for(var Z=this.bufferedRequest,ot=[];Z;)ot.push(Z),Z=Z.next;return ot},(function(){try{Object.defineProperty(M.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var T;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(Z){return T.call(this,Z)?!0:this!==c?!1:Z&&Z._writableState instanceof M}})):T=function(Z){return Z instanceof this};function c(Z){d=d||y0();var ot=this instanceof d;if(!ot&&!T.call(c,this))return new c(Z);this._writableState=new M(Z,this,ot),this.writable=!0,Z&&(typeof Z.write=="function"&&(this._write=Z.write),typeof Z.writev=="function"&&(this._writev=Z.writev),typeof Z.destroy=="function"&&(this._destroy=Z.destroy),typeof Z.final=="function"&&(this._final=Z.final)),A.call(this)}c.prototype.pipe=function(){S(this,new m)};function h(Z,ot){var X=new x;S(Z,X),process.nextTick(ot,X)}function b(Z,ot,X,Q){var ut;return X===null?ut=new l:typeof X!="string"&&!ot.objectMode&&(ut=new f("chunk",["string","Buffer"],X)),ut?(S(Z,ut),process.nextTick(Q,ut),!1):!0}c.prototype.write=function(Z,ot,X){var Q=this._writableState,ut=!1,J=!Q.objectMode&&i(Z);return J&&!t.isBuffer(Z)&&(Z=r(Z)),typeof ot=="function"&&(X=ot,ot=null),J?ot="buffer":ot||(ot=Q.defaultEncoding),typeof X!="function"&&(X=k),Q.ending?h(this,X):(J||b(this,Q,Z,X))&&(Q.pendingcb++,ut=P(this,Q,J,Z,ot,X)),ut},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var Z=this._writableState;Z.corked&&(Z.corked--,!Z.writing&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&j(this,Z))},c.prototype.setDefaultEncoding=function(Z){if(typeof Z=="string"&&(Z=Z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Z+"").toLowerCase())>-1))throw new y(Z);return this._writableState.defaultEncoding=Z,this},Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _(Z,ot,X){return!Z.objectMode&&Z.decodeStrings!==!1&&typeof ot=="string"&&(ot=t.from(ot,X)),ot}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function P(Z,ot,X,Q,ut,J){if(!X){var q=_(ot,Q,ut);Q!==q&&(X=!0,ut="buffer",Q=q)}var it=ot.objectMode?1:Q.length;ot.length+=it;var nt=ot.length{var u=Object.keys||function(o){var a=[];for(var s in o)a.push(s);return a};V.exports=r;var d=$2(),E=Y2();for(Bp()(r,d),A=u(E.prototype),e=0;e{var u=m0(),d=u.Buffer;function E(t,e){for(var r in t)e[r]=t[r]}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?V.exports=u:(E(u,K),K.Buffer=A);function A(t,e,r){return d(t,e,r)}A.prototype=Object.create(d.prototype),E(d,A),A.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return d(t,e,r)},A.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=d(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},A.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return d(t)},A.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(t)}}),X2=Vt(K=>{var V=MM().Buffer,u=V.isEncoding||function(w){switch(w=""+w,w&&w.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(w){if(!w)return"utf8";for(var l;;)switch(w){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return w;default:if(l)return;w=(""+w).toLowerCase(),l=!0}}function E(w){var l=d(w);if(typeof l!="string"&&(V.isEncoding===u||!u(w)))throw new Error("Unknown encoding: "+w);return l||w}K.StringDecoder=A;function A(w){this.encoding=E(w);var l;switch(this.encoding){case"utf16le":this.text=a,this.end=s,l=4;break;case"utf8":this.fillLast=i,l=4;break;case"base64":this.text=f,this.end=v,l=3;break;default:this.write=g,this.end=m;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(l)}A.prototype.write=function(w){if(w.length===0)return"";var l,x;if(this.lastNeed){if(l=this.fillLast(w),l===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function e(w,l,x){var y=l.length-1;if(y=0?(S>0&&(w.lastNeed=S-1),S):--y=0?(S>0&&(w.lastNeed=S-2),S):--y=0?(S>0&&(S===2?S=0:w.lastNeed=S-3),S):0))}function r(w,l,x){if((l[0]&192)!==128)return w.lastNeed=0,"�";if(w.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return w.lastNeed=1,"�";if(w.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return w.lastNeed=2,"�"}}function i(w){var l=this.lastTotal-this.lastNeed,x=r(this,w);if(x!==void 0)return x;if(this.lastNeed<=w.length)return w.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,l,0,w.length),this.lastNeed-=w.length}function n(w,l){var x=e(this,w,l);if(!this.lastNeed)return w.toString("utf8",l);this.lastTotal=x;var y=w.length-(x-this.lastNeed);return w.copy(this.lastChar,0,y),w.toString("utf8",l,y)}function o(w){var l=w&&w.length?this.write(w):"";return this.lastNeed?l+"�":l}function a(w,l){if((w.length-l)%2===0){var x=w.toString("utf16le",l);if(x){var y=x.charCodeAt(x.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",l,w.length-1)}function s(w){var l=w&&w.length?this.write(w):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,x)}return l}function f(w,l){var x=(w.length-l)%3;return x===0?w.toString("base64",l):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",l,w.length-x))}function v(w){var l=w&&w.length?this.write(w):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function g(w){return w.toString(this.encoding)}function m(w){return w&&w.length?this.write(w):""}}),N1=Vt((K,V)=>{var u=v0().codes.ERR_STREAM_PREMATURE_CLOSE;function d(e){var r=!1;return function(){if(!r){r=!0;for(var i=arguments.length,n=new Array(i),o=0;o{var u;function d(l,x,y){return x in l?Object.defineProperty(l,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):l[x]=y,l}var E=N1(),A=Symbol("lastResolve"),t=Symbol("lastReject"),e=Symbol("error"),r=Symbol("ended"),i=Symbol("lastPromise"),n=Symbol("handlePromise"),o=Symbol("stream");function a(l,x){return{value:l,done:x}}function s(l){var x=l[A];if(x!==null){var y=l[o].read();y!==null&&(l[i]=null,l[A]=null,l[t]=null,x(a(y,!1)))}}function f(l){process.nextTick(s,l)}function v(l,x){return function(y,S){l.then(function(){if(x[r]){y(a(void 0,!0));return}x[n](y,S)},S)}}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((u={get stream(){return this[o]},next:function(){var l=this,x=this[e];if(x!==null)return Promise.reject(x);if(this[r])return Promise.resolve(a(void 0,!0));if(this[o].destroyed)return new Promise(function(M,T){process.nextTick(function(){l[e]?T(l[e]):M(a(void 0,!0))})});var y=this[i],S;if(y)S=new Promise(v(y,this));else{var k=this[o].read();if(k!==null)return Promise.resolve(a(k,!1));S=new Promise(this[n])}return this[i]=S,S}},d(u,Symbol.asyncIterator,function(){return this}),d(u,"return",function(){var l=this;return new Promise(function(x,y){l[o].destroy(null,function(S){if(S){y(S);return}x(a(void 0,!0))})})}),u),g),w=function(l){var x,y=Object.create(m,(x={},d(x,o,{value:l,writable:!0}),d(x,A,{value:null,writable:!0}),d(x,t,{value:null,writable:!0}),d(x,e,{value:null,writable:!0}),d(x,r,{value:l._readableState.endEmitted,writable:!0}),d(x,n,{value:function(S,k){var M=y[o].read();M?(y[i]=null,y[A]=null,y[t]=null,S(a(M,!1))):(y[A]=S,y[t]=k)},writable:!0}),x));return y[i]=null,E(l,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=y[t];k!==null&&(y[i]=null,y[A]=null,y[t]=null,k(S)),y[e]=S;return}var M=y[A];M!==null&&(y[i]=null,y[A]=null,y[t]=null,M(a(void 0,!0))),y[r]=!0}),l.on("readable",f.bind(null,y)),y};V.exports=w}),EM=Vt((K,V)=>{V.exports=function(){throw new Error("Readable.from is not available in the browser")}}),$2=Vt((K,V)=>{V.exports=h;var u;h.ReadableState=c,o0().EventEmitter;var d=function(J,q){return J.listeners(q).length},E=D2(),A=m0().Buffer,t=window.Uint8Array||function(){};function e(J){return A.from(J)}function r(J){return A.isBuffer(J)||J instanceof t}var i=G2(),n;i&&i.debuglog?n=i.debuglog("stream"):n=function(){};var o=kM(),a=Z2(),s=K2(),f=s.getHighWaterMark,v=v0().codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,l=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,y,S;Bp()(h,E);var k=a.errorOrDestroy,M=["error","close","destroy","pause","resume"];function T(J,q,it){if(typeof J.prependListener=="function")return J.prependListener(q,it);!J._events||!J._events[q]?J.on(q,it):Array.isArray(J._events[q])?J._events[q].unshift(it):J._events[q]=[it,J._events[q]]}function c(J,q,it){u=u||y0(),J=J||{},typeof it!="boolean"&&(it=q instanceof u),this.objectMode=!!J.objectMode,it&&(this.objectMode=this.objectMode||!!J.readableObjectMode),this.highWaterMark=f(this,J,"readableHighWaterMark",it),this.buffer=new o,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=J.emitClose!==!1,this.autoDestroy=!!J.autoDestroy,this.destroyed=!1,this.defaultEncoding=J.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,J.encoding&&(x||(x=X2().StringDecoder),this.decoder=new x(J.encoding),this.encoding=J.encoding)}function h(J){if(u=u||y0(),!(this instanceof h))return new h(J);var q=this instanceof u;this._readableState=new c(J,this,q),this.readable=!0,J&&(typeof J.read=="function"&&(this._read=J.read),typeof J.destroy=="function"&&(this._destroy=J.destroy)),E.call(this)}Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(J){this._readableState&&(this._readableState.destroyed=J)}}),h.prototype.destroy=a.destroy,h.prototype._undestroy=a.undestroy,h.prototype._destroy=function(J,q){q(J)},h.prototype.push=function(J,q){var it=this._readableState,nt;return it.objectMode?nt=!0:typeof J=="string"&&(q=q||it.defaultEncoding,q!==it.encoding&&(J=A.from(J,q),q=""),nt=!0),b(this,J,q,!1,nt)},h.prototype.unshift=function(J){return b(this,J,null,!0,!1)};function b(J,q,it,nt,dt){n("readableAddChunk",q);var Tt=J._readableState;if(q===null)Tt.reading=!1,R(J,Tt);else{var wt;if(dt||(wt=P(Tt,q)),wt)k(J,wt);else if(Tt.objectMode||q&&q.length>0)if(typeof q!="string"&&!Tt.objectMode&&Object.getPrototypeOf(q)!==A.prototype&&(q=e(q)),nt)Tt.endEmitted?k(J,new l):_(J,Tt,q,!0);else if(Tt.ended)k(J,new m);else{if(Tt.destroyed)return!1;Tt.reading=!1,Tt.decoder&&!it?(q=Tt.decoder.write(q),Tt.objectMode||q.length!==0?_(J,Tt,q,!1):j(J,Tt)):_(J,Tt,q,!1)}else nt||(Tt.reading=!1,j(J,Tt))}return!Tt.ended&&(Tt.length=z?J=z:(J--,J|=J>>>1,J|=J>>>2,J|=J>>>4,J|=J>>>8,J|=J>>>16,J++),J}function B(J,q){return J<=0||q.length===0&&q.ended?0:q.objectMode?1:J!==J?q.flowing&&q.length?q.buffer.head.data.length:q.length:(J>q.highWaterMark&&(q.highWaterMark=D(J)),J<=q.length?J:q.ended?q.length:(q.needReadable=!0,0))}h.prototype.read=function(J){n("read",J),J=parseInt(J,10);var q=this._readableState,it=J;if(J!==0&&(q.emittedReadable=!1),J===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return n("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?X(this):I(this),null;if(J=B(J,q),J===0&&q.ended)return q.length===0&&X(this),null;var nt=q.needReadable;n("need readable",nt),(q.length===0||q.length-J0?dt=ot(J,q):dt=null,dt===null?(q.needReadable=q.length<=q.highWaterMark,J=0):(q.length-=J,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),it!==J&&q.ended&&X(this)),dt!==null&&this.emit("data",dt),dt};function R(J,q){if(n("onEofChunk"),!q.ended){if(q.decoder){var it=q.decoder.end();it&&it.length&&(q.buffer.push(it),q.length+=q.objectMode?1:it.length)}q.ended=!0,q.sync?I(J):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,F(J)))}}function I(J){var q=J._readableState;n("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(n("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(F,J))}function F(J){var q=J._readableState;n("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(J.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,Z(J)}function j(J,q){q.readingMore||(q.readingMore=!0,process.nextTick(N,J,q))}function N(J,q){for(;!q.reading&&!q.ended&&(q.length1&&ut(nt.pipes,J)!==-1)&&!Nt&&(n("false write response, pause",nt.awaitDrain),nt.awaitDrain++),it.pause())}function ee(vt){n("onerror",vt),bt(),J.removeListener("error",ee),d(J,"error")===0&&k(J,vt)}T(J,"error",ee);function Zt(){J.removeListener("finish",mt),bt()}J.once("close",Zt);function mt(){n("onfinish"),J.removeListener("close",Zt),bt()}J.once("finish",mt);function bt(){n("unpipe"),it.unpipe(J)}return J.emit("pipe",it),nt.flowing||(n("pipe resume"),it.resume()),J};function G(J){return function(){var q=J._readableState;n("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&d(J,"data")&&(q.flowing=!0,Z(J))}}h.prototype.unpipe=function(J){var q=this._readableState,it={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return J&&J!==q.pipes?this:(J||(J=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,J&&J.emit("unpipe",this,it),this);if(!J){var nt=q.pipes,dt=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var Tt=0;Tt0,nt.flowing!==!1&&this.resume()):J==="readable"&&!nt.endEmitted&&!nt.readableListening&&(nt.readableListening=nt.needReadable=!0,nt.flowing=!1,nt.emittedReadable=!1,n("on readable",nt.length,nt.reading),nt.length?I(this):nt.reading||process.nextTick(ct,this)),it},h.prototype.addListener=h.prototype.on,h.prototype.removeListener=function(J,q){var it=E.prototype.removeListener.call(this,J,q);return J==="readable"&&process.nextTick(rt,this),it},h.prototype.removeAllListeners=function(J){var q=E.prototype.removeAllListeners.apply(this,arguments);return(J==="readable"||J===void 0)&&process.nextTick(rt,this),q};function rt(J){var q=J._readableState;q.readableListening=J.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:J.listenerCount("data")>0&&J.resume()}function ct(J){n("readable nexttick read 0"),J.read(0)}h.prototype.resume=function(){var J=this._readableState;return J.flowing||(n("resume"),J.flowing=!J.readableListening,st(this,J)),J.paused=!1,this};function st(J,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(et,J,q))}function et(J,q){n("resume",q.reading),q.reading||J.read(0),q.resumeScheduled=!1,J.emit("resume"),Z(J),q.flowing&&!q.reading&&J.read(0)}h.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Z(J){var q=J._readableState;for(n("flow",q.flowing);q.flowing&&J.read()!==null;);}h.prototype.wrap=function(J){var q=this,it=this._readableState,nt=!1;J.on("end",function(){if(n("wrapped end"),it.decoder&&!it.ended){var wt=it.decoder.end();wt&&wt.length&&q.push(wt)}q.push(null)}),J.on("data",function(wt){if(n("wrapped data"),it.decoder&&(wt=it.decoder.write(wt)),!(it.objectMode&&wt==null)&&!(!it.objectMode&&(!wt||!wt.length))){var Ct=q.push(wt);Ct||(nt=!0,J.pause())}});for(var dt in J)this[dt]===void 0&&typeof J[dt]=="function"&&(this[dt]=(function(wt){return function(){return J[wt].apply(J,arguments)}})(dt));for(var Tt=0;Tt=q.length?(q.decoder?it=q.buffer.join(""):q.buffer.length===1?it=q.buffer.first():it=q.buffer.concat(q.length),q.buffer.clear()):it=q.buffer.consume(J,q.decoder),it}function X(J){var q=J._readableState;n("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(Q,q,J))}function Q(J,q){if(n("endReadableNT",J.endEmitted,J.length),!J.endEmitted&&J.length===0&&(J.endEmitted=!0,q.readable=!1,q.emit("end"),J.autoDestroy)){var it=q._writableState;(!it||it.autoDestroy&&it.finished)&&q.destroy()}}typeof Symbol=="function"&&(h.from=function(J,q){return S===void 0&&(S=EM()),S(h,J,q)});function ut(J,q){for(var it=0,nt=J.length;it{V.exports=i;var u=v0().codes,d=u.ERR_METHOD_NOT_IMPLEMENTED,E=u.ERR_MULTIPLE_CALLBACK,A=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,t=u.ERR_TRANSFORM_WITH_LENGTH_0,e=y0();Bp()(i,e);function r(a,s){var f=this._transformState;f.transforming=!1;var v=f.writecb;if(v===null)return this.emit("error",new E);f.writechunk=null,f.writecb=null,s!=null&&this.push(s),v(a);var g=this._readableState;g.reading=!1,(g.needReadable||g.length{V.exports=d;var u=J2();Bp()(d,u);function d(E){if(!(this instanceof d))return new d(E);u.call(this,E)}d.prototype._transform=function(E,A,t){t(null,E)}}),LM=Vt((K,V)=>{var u;function d(f){var v=!1;return function(){v||(v=!0,f.apply(void 0,arguments))}}var E=v0().codes,A=E.ERR_MISSING_ARGS,t=E.ERR_STREAM_DESTROYED;function e(f){if(f)throw f}function r(f){return f.setHeader&&typeof f.abort=="function"}function i(f,v,g,m){m=d(m);var w=!1;f.on("close",function(){w=!0}),u===void 0&&(u=N1()),u(f,{readable:v,writable:g},function(x){if(x)return m(x);w=!0,m()});var l=!1;return function(x){if(!w&&!l){if(l=!0,r(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();m(x||new t("pipe"))}}}function n(f){f()}function o(f,v){return f.pipe(v)}function a(f){return!f.length||typeof f[f.length-1]!="function"?e:f.pop()}function s(){for(var f=arguments.length,v=new Array(f),g=0;g0;return i(x,S,k,function(M){w||(w=M),M&&l.forEach(n),!S&&(l.forEach(n),m(w))})});return v.reduce(o)}V.exports=s}),CM=Vt((K,V)=>{V.exports=E;var u=o0().EventEmitter,d=Bp();d(E,u),E.Readable=$2(),E.Writable=Y2(),E.Duplex=y0(),E.Transform=J2(),E.PassThrough=zM(),E.finished=N1(),E.pipeline=LM(),E.Stream=E;function E(){u.call(this)}E.prototype.pipe=function(A,t){var e=this;function r(v){A.writable&&A.write(v)===!1&&e.pause&&e.pause()}e.on("data",r);function i(){e.readable&&e.resume&&e.resume()}A.on("drain",i),!A._isStdio&&(!t||t.end!==!1)&&(e.on("end",o),e.on("close",a));var n=!1;function o(){n||(n=!0,A.end())}function a(){n||(n=!0,typeof A.destroy=="function"&&A.destroy())}function s(v){if(f(),u.listenerCount(this,"error")===0)throw v}e.on("error",s),A.on("error",s);function f(){e.removeListener("data",r),A.removeListener("drain",i),e.removeListener("end",o),e.removeListener("close",a),e.removeListener("error",s),A.removeListener("error",s),e.removeListener("end",f),e.removeListener("close",f),A.removeListener("close",f)}return e.on("end",f),e.on("close",f),A.on("close",f),A.emit("pipe",e),A}}),Rm=Vt(K=>{var V=Object.getOwnPropertyDescriptors||function(N){for(var G=Object.keys(N),rt={},ct=0;ct=st)return X;switch(X){case"%s":return String(ct[rt++]);case"%d":return Number(ct[rt++]);case"%j":try{return JSON.stringify(ct[rt++])}catch{return"[Circular]"}default:return X}}),Z=ct[rt];rt"u")return function(){return K.deprecate(N,G).apply(this,arguments)};var rt=!1;function ct(){if(!rt){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),rt=!0}return N.apply(this,arguments)}return ct};var d={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;K.debuglog=function(N){if(N=N.toUpperCase(),!d[N])if(E.test(N)){var G=process.pid;d[N]=function(){var rt=K.format.apply(K,arguments);console.error("%s %d: %s",N,G,rt)}}else d[N]=function(){};return d[N]};function t(N,G){var rt={seen:[],stylize:r};return arguments.length>=3&&(rt.depth=arguments[2]),arguments.length>=4&&(rt.colors=arguments[3]),m(G)?rt.showHidden=G:G&&K._extend(rt,G),k(rt.showHidden)&&(rt.showHidden=!1),k(rt.depth)&&(rt.depth=2),k(rt.colors)&&(rt.colors=!1),k(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,N,rt.depth)}K.inspect=t,t.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function e(N,G){var rt=t.styles[G];return rt?"\x1B["+t.colors[rt][0]+"m"+N+"\x1B["+t.colors[rt][1]+"m":N}function r(N,G){return N}function i(N){var G={};return N.forEach(function(rt,ct){G[rt]=!0}),G}function n(N,G,rt){if(N.customInspect&&G&&b(G.inspect)&&G.inspect!==K.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,N);return y(ct)||(ct=n(N,ct,rt)),ct}var st=o(N,G);if(st)return st;var et=Object.keys(G),Z=i(et);if(N.showHidden&&(et=Object.getOwnPropertyNames(G)),h(G)&&(et.indexOf("message")>=0||et.indexOf("description")>=0))return a(G);if(et.length===0){if(b(G)){var ot=G.name?": "+G.name:"";return N.stylize("[Function"+ot+"]","special")}if(M(G))return N.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return N.stylize(Date.prototype.toString.call(G),"date");if(h(G))return a(G)}var X="",Q=!1,ut=["{","}"];if(g(G)&&(Q=!0,ut=["[","]"]),b(G)){var J=G.name?": "+G.name:"";X=" [Function"+J+"]"}if(M(G)&&(X=" "+RegExp.prototype.toString.call(G)),c(G)&&(X=" "+Date.prototype.toUTCString.call(G)),h(G)&&(X=" "+a(G)),et.length===0&&(!Q||G.length==0))return ut[0]+X+ut[1];if(rt<0)return M(G)?N.stylize(RegExp.prototype.toString.call(G),"regexp"):N.stylize("[Object]","special");N.seen.push(G);var q;return Q?q=s(N,G,rt,Z,et):q=et.map(function(it){return f(N,G,rt,Z,it,Q)}),N.seen.pop(),v(q,X,ut)}function o(N,G){if(k(G))return N.stylize("undefined","undefined");if(y(G)){var rt="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(rt,"string")}if(x(G))return N.stylize(""+G,"number");if(m(G))return N.stylize(""+G,"boolean");if(w(G))return N.stylize("null","null")}function a(N){return"["+Error.prototype.toString.call(N)+"]"}function s(N,G,rt,ct,st){for(var et=[],Z=0,ot=G.length;Z-1&&(et?ot=ot.split(` -`).map(function(Q){return" "+Q}).join(` -`).slice(2):ot=` -`+ot.split(` -`).map(function(Q){return" "+Q}).join(` -`))):ot=N.stylize("[Circular]","special")),k(Z)){if(et&&st.match(/^\d+$/))return ot;Z=JSON.stringify(""+st),Z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Z=Z.slice(1,-1),Z=N.stylize(Z,"name")):(Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=N.stylize(Z,"string"))}return Z+": "+ot}function v(N,G,rt){var ct=0,st=N.reduce(function(et,Z){return ct++,Z.indexOf(` -`)>=0&&ct++,et+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return st>60?rt[0]+(G===""?"":G+` - `)+" "+N.join(`, - `)+" "+rt[1]:rt[0]+G+" "+N.join(", ")+" "+rt[1]}K.types=q2();function g(N){return Array.isArray(N)}K.isArray=g;function m(N){return typeof N=="boolean"}K.isBoolean=m;function w(N){return N===null}K.isNull=w;function l(N){return N==null}K.isNullOrUndefined=l;function x(N){return typeof N=="number"}K.isNumber=x;function y(N){return typeof N=="string"}K.isString=y;function S(N){return typeof N=="symbol"}K.isSymbol=S;function k(N){return N===void 0}K.isUndefined=k;function M(N){return T(N)&&P(N)==="[object RegExp]"}K.isRegExp=M,K.types.isRegExp=M;function T(N){return typeof N=="object"&&N!==null}K.isObject=T;function c(N){return T(N)&&P(N)==="[object Date]"}K.isDate=c,K.types.isDate=c;function h(N){return T(N)&&(P(N)==="[object Error]"||N instanceof Error)}K.isError=h,K.types.isNativeError=h;function b(N){return typeof N=="function"}K.isFunction=b;function _(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N>"u"}K.isPrimitive=_,K.isBuffer=W2();function P(N){return Object.prototype.toString.call(N)}function z(N){return N<10?"0"+N.toString(10):N.toString(10)}var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var N=new Date,G=[z(N.getHours()),z(N.getMinutes()),z(N.getSeconds())].join(":");return[N.getDate(),D[N.getMonth()],G].join(" ")}K.log=function(){console.log("%s - %s",B(),K.format.apply(K,arguments))},K.inherits=Bp(),K._extend=function(N,G){if(!G||!T(G))return N;for(var rt=Object.keys(G),ct=rt.length;ct--;)N[rt[ct]]=G[rt[ct]];return N};function R(N,G){return Object.prototype.hasOwnProperty.call(N,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;K.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&N[I]){var G=N[I];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,st=new Promise(function(ot,X){rt=ot,ct=X}),et=[],Z=0;Z{function u(x){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},u(x)}function d(x,y,S){return Object.defineProperty(x,"prototype",{writable:!1}),x}function E(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function A(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),y&&t(x,y)}function t(x,y){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,k){return S.__proto__=k,S},t(x,y)}function e(x){var y=n();return function(){var S=o(x),k;if(y){var M=o(this).constructor;k=Reflect.construct(S,arguments,M)}else k=S.apply(this,arguments);return r(this,k)}}function r(x,y){if(y&&(u(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(x)}function i(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function o(x){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},o(x)}var a={},s,f;function v(x,y,S){S||(S=Error);function k(T,c,h){return typeof y=="string"?y:y(T,c,h)}var M=(function(T){A(h,T);var c=e(h);function h(b,_,P){var z;return E(this,h),z=c.call(this,k(b,_,P)),z.code=x,z}return d(h)})(S);a[x]=M}function g(x,y){if(Array.isArray(x)){var S=x.length;return x=x.map(function(k){return String(k)}),S>2?"one of ".concat(y," ").concat(x.slice(0,S-1).join(", "),", or ")+x[S-1]:S===2?"one of ".concat(y," ").concat(x[0]," or ").concat(x[1]):"of ".concat(y," ").concat(x[0])}else return"of ".concat(y," ").concat(String(x))}function m(x,y,S){return x.substr(0,y.length)===y}function w(x,y,S){return(S===void 0||S>x.length)&&(S=x.length),x.substring(S-y.length,S)===y}function l(x,y,S){return typeof S!="number"&&(S=0),S+y.length>x.length?!1:x.indexOf(y,S)!==-1}v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(x,y,S){s===void 0&&(s=av()),s(typeof x=="string","'name' must be a string");var k;typeof y=="string"&&m(y,"not ")?(k="must not be",y=y.replace(/^not /,"")):k="must be";var M;if(w(x," argument"))M="The ".concat(x," ").concat(k," ").concat(g(y,"type"));else{var T=l(x,".")?"property":"argument";M='The "'.concat(x,'" ').concat(T," ").concat(k," ").concat(g(y,"type"))}return M+=". Received type ".concat(u(S)),M},TypeError),v("ERR_INVALID_ARG_VALUE",function(x,y){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Rm());var k=f.inspect(y);return k.length>128&&(k="".concat(k.slice(0,128),"...")),"The argument '".concat(x,"' ").concat(S,". Received ").concat(k)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(x,y,S){var k;return S&&S.constructor&&S.constructor.name?k="instance of ".concat(S.constructor.name):k="type ".concat(u(S)),"Expected ".concat(x,' to be returned from the "').concat(y,'"')+" function but got ".concat(k,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var x=arguments.length,y=new Array(x),S=0;S0,"At least one arg needs to be specified");var k="The ",M=y.length;switch(y=y.map(function(T){return'"'.concat(T,'"')}),M){case 1:k+="".concat(y[0]," argument");break;case 2:k+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:k+=y.slice(0,M-1).join(", "),k+=", and ".concat(y[M-1]," arguments");break}return"".concat(k," must be specified")},TypeError),V.exports.codes=a}),IM=Vt((K,V)=>{function u(j,N){var G=Object.keys(j);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(j);N&&(rt=rt.filter(function(ct){return Object.getOwnPropertyDescriptor(j,ct).enumerable})),G.push.apply(G,rt)}return G}function d(j){for(var N=1;N"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(j){return Function.toString.call(j).indexOf("[native code]")!==-1}function w(j,N){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,rt){return G.__proto__=rt,G},w(j,N)}function l(j){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(N){return N.__proto__||Object.getPrototypeOf(N)},l(j)}function x(j){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},x(j)}var y=Rm(),S=y.inspect,k=Q2(),M=k.codes.ERR_INVALID_ARG_TYPE;function T(j,N,G){return(G===void 0||G>j.length)&&(G=j.length),j.substring(G-N.length,G)===N}function c(j,N){if(N=Math.floor(N),j.length==0||N==0)return"";var G=j.length*N;for(N=Math.floor(Math.log(N)/Math.log(2));N;)j+=j,N--;return j+=j.substring(0,G-j.length),j}var h="",b="",_="",P="",z={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},D=10;function B(j){var N=Object.keys(j),G=Object.create(Object.getPrototypeOf(j));return N.forEach(function(rt){G[rt]=j[rt]}),Object.defineProperty(G,"message",{value:j.message}),G}function R(j){return S(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function I(j,N,G){var rt="",ct="",st=0,et="",Z=!1,ot=R(j),X=ot.split(` -`),Q=R(N).split(` -`),ut=0,J="";if(G==="strictEqual"&&x(j)==="object"&&x(N)==="object"&&j!==null&&N!==null&&(G="strictEqualObject"),X.length===1&&Q.length===1&&X[0]!==Q[0]){var q=X[0].length+Q[0].length;if(q<=D){if((x(j)!=="object"||j===null)&&(x(N)!=="object"||N===null)&&(j!==0||N!==0))return"".concat(z[G],` - -`)+"".concat(X[0]," !== ").concat(Q[0],` -`)}else if(G!=="strictEqualObject"){var it=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q2&&(J=` - `.concat(c(" ",ut),"^"),ut=0)}}}for(var nt=X[X.length-1],dt=Q[Q.length-1];nt===dt&&(ut++<2?et=` - `.concat(nt).concat(et):rt=nt,X.pop(),Q.pop(),!(X.length===0||Q.length===0));)nt=X[X.length-1],dt=Q[Q.length-1];var Tt=Math.max(X.length,Q.length);if(Tt===0){var wt=ot.split(` -`);if(wt.length>30)for(wt[26]="".concat(h,"...").concat(P);wt.length>27;)wt.pop();return"".concat(z.notIdentical,` - -`).concat(wt.join(` -`),` -`)}ut>3&&(et=` -`.concat(h,"...").concat(P).concat(et),Z=!0),rt!==""&&(et=` - `.concat(rt).concat(et),rt="");var Ct=0,It=z[G]+` -`.concat(b,"+ actual").concat(P," ").concat(_,"- expected").concat(P),Nt=" ".concat(h,"...").concat(P," Lines skipped");for(ut=0;ut1&&ut>2&&(te>4?(ct+=` -`.concat(h,"...").concat(P),Z=!0):te>3&&(ct+=` - `.concat(Q[ut-2]),Ct++),ct+=` - `.concat(Q[ut-1]),Ct++),st=ut,rt+=` -`.concat(_,"-").concat(P," ").concat(Q[ut]),Ct++;else if(Q.length1&&ut>2&&(te>4?(ct+=` -`.concat(h,"...").concat(P),Z=!0):te>3&&(ct+=` - `.concat(X[ut-2]),Ct++),ct+=` - `.concat(X[ut-1]),Ct++),st=ut,ct+=` -`.concat(b,"+").concat(P," ").concat(X[ut]),Ct++;else{var Jt=Q[ut],ee=X[ut],Zt=ee!==Jt&&(!T(ee,",")||ee.slice(0,-1)!==Jt);Zt&&T(Jt,",")&&Jt.slice(0,-1)===ee&&(Zt=!1,ee+=","),Zt?(te>1&&ut>2&&(te>4?(ct+=` -`.concat(h,"...").concat(P),Z=!0):te>3&&(ct+=` - `.concat(X[ut-2]),Ct++),ct+=` - `.concat(X[ut-1]),Ct++),st=ut,ct+=` -`.concat(b,"+").concat(P," ").concat(ee),rt+=` -`.concat(_,"-").concat(P," ").concat(Jt),Ct+=2):(ct+=rt,rt="",(te===1||ut===0)&&(ct+=` - `.concat(ee),Ct++))}if(Ct>20&&ut30)for(q[26]="".concat(h,"...").concat(P);q.length>27;)q.pop();q.length===1?st=G.call(this,"".concat(J," ").concat(q[0])):st=G.call(this,"".concat(J,` - -`).concat(q.join(` -`),` -`))}else{var it=R(X),nt="",dt=z[Z];Z==="notDeepEqual"||Z==="notEqual"?(it="".concat(z[Z],` - -`).concat(it),it.length>1024&&(it="".concat(it.slice(0,1021),"..."))):(nt="".concat(R(Q)),it.length>512&&(it="".concat(it.slice(0,509),"...")),nt.length>512&&(nt="".concat(nt.slice(0,509),"...")),Z==="deepEqual"||Z==="equal"?it="".concat(dt,` - -`).concat(it,` - -should equal - -`):nt=" ".concat(Z," ").concat(nt)),st=G.call(this,"".concat(it).concat(nt))}return Error.stackTraceLimit=ut,st.generatedMessage=!et,Object.defineProperty(s(st),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),st.code="ERR_ASSERTION",st.actual=X,st.expected=Q,st.operator=Z,Error.captureStackTrace&&Error.captureStackTrace(s(st),ot),st.stack,st.name="AssertionError",a(st)}return e(rt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:N,value:function(ct,st){return S(this,d(d({},st),{},{customInspect:!1,depth:0}))}}]),rt})(f(Error),S.custom);V.exports=F}),tw=Vt((K,V)=>{var u=Object.prototype.toString;V.exports=function(d){var E=u.call(d),A=E==="[object Arguments]";return A||(A=E!=="[object Array]"&&d!==null&&typeof d=="object"&&typeof d.length=="number"&&d.length>=0&&u.call(d.callee)==="[object Function]"),A}}),PM=Vt((K,V)=>{var u;Object.keys||(d=Object.prototype.hasOwnProperty,E=Object.prototype.toString,A=tw(),t=Object.prototype.propertyIsEnumerable,e=!t.call({toString:null},"toString"),r=t.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(f){var v=f.constructor;return v&&v.prototype===f},o={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!o["$"+f]&&d.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{n(window[f])}catch{return!0}}catch{return!0}return!1})(),s=function(f){if(typeof window>"u"||!a)return n(f);try{return n(f)}catch{return!1}},u=function(f){var v=f!==null&&typeof f=="object",g=E.call(f)==="[object Function]",m=A(f),w=v&&E.call(f)==="[object String]",l=[];if(!v&&!g&&!m)throw new TypeError("Object.keys called on a non-object");var x=r&&g;if(w&&f.length>0&&!d.call(f,0))for(var y=0;y0)for(var S=0;S{var u=Array.prototype.slice,d=tw(),E=Object.keys,A=E?function(e){return E(e)}:PM(),t=Object.keys;A.shim=function(){if(Object.keys){var e=(function(){var r=Object.keys(arguments);return r&&r.length===arguments.length})(1,2);e||(Object.keys=function(r){return d(r)?t(u.call(r)):t(r)})}else Object.keys=A;return Object.keys||A},V.exports=A}),OM=Vt((K,V)=>{var u=ew(),d=F1()(),E=Bm(),A=Object,t=E("Array.prototype.push"),e=E("Object.prototype.propertyIsEnumerable"),r=d?Object.getOwnPropertySymbols:null;V.exports=function(i,n){if(i==null)throw new TypeError("target must be an object");var o=A(i);if(arguments.length===1)return o;for(var a=1;a{var u=OM(),d=function(){if(!Object.assign)return!1;for(var A="abcdefghijklmnopqrst",t=A.split(""),e={},r=0;r{var u=function(d){return d!==d};V.exports=function(d,E){return d===0&&E===0?1/d===1/E:!!(d===E||u(d)&&u(E))}}),j1=Vt((K,V)=>{var u=rw();V.exports=function(){return typeof Object.is=="function"?Object.is:u}}),nv=Vt((K,V)=>{var u=ew(),d=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",E=Object.prototype.toString,A=Array.prototype.concat,t=Object.defineProperty,e=function(a){return typeof a=="function"&&E.call(a)==="[object Function]"},r=U2()(),i=t&&r,n=function(a,s,f,v){if(s in a){if(v===!0){if(a[s]===f)return}else if(!e(v)||!v())return}i?t(a,s,{configurable:!0,enumerable:!1,value:f,writable:!0}):a[s]=f},o=function(a,s){var f=arguments.length>2?arguments[2]:{},v=u(s);d&&(v=A.call(v,Object.getOwnPropertySymbols(s)));for(var g=0;g{var u=j1(),d=nv();V.exports=function(){var E=u();return d(Object,{is:E},{is:function(){return Object.is!==E}}),E}}),BM=Vt((K,V)=>{var u=nv(),d=rv(),E=rw(),A=j1(),t=FM(),e=d(A(),Object);u(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),nw=Vt((K,V)=>{V.exports=function(u){return u!==u}}),aw=Vt((K,V)=>{var u=nw();V.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:u}}),RM=Vt((K,V)=>{var u=nv(),d=aw();V.exports=function(){var E=d();return u(Number,{isNaN:E},{isNaN:function(){return Number.isNaN!==E}}),E}}),NM=Vt((K,V)=>{var u=rv(),d=nv(),E=nw(),A=aw(),t=RM(),e=u(A(),Number);d(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),jM=Vt((K,V)=>{function u(Zt,mt){return e(Zt)||t(Zt,mt)||E(Zt,mt)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(Zt,mt){if(Zt){if(typeof Zt=="string")return A(Zt,mt);var bt=Object.prototype.toString.call(Zt).slice(8,-1);if(bt==="Object"&&Zt.constructor&&(bt=Zt.constructor.name),bt==="Map"||bt==="Set")return Array.from(Zt);if(bt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bt))return A(Zt,mt)}}function A(Zt,mt){(mt==null||mt>Zt.length)&&(mt=Zt.length);for(var bt=0,vt=new Array(mt);bt10)return!0;for(var mt=0;mt57)return!0}return Zt.length===10&&Zt>=Math.pow(2,32)}function F(Zt){return Object.keys(Zt).filter(I).concat(s(Zt).filter(Object.prototype.propertyIsEnumerable.bind(Zt)))}function j(Zt,mt){if(Zt===mt)return 0;for(var bt=Zt.length,vt=mt.length,Ut=0,re=Math.min(bt,vt);Ut{function u(st){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},u(st)}function d(st,et,Z){return Object.defineProperty(st,"prototype",{writable:!1}),st}function E(st,et){if(!(st instanceof et))throw new TypeError("Cannot call a class as a function")}var A=Q2(),t=A.codes,e=t.ERR_AMBIGUOUS_ARGUMENT,r=t.ERR_INVALID_ARG_TYPE,i=t.ERR_INVALID_ARG_VALUE,n=t.ERR_INVALID_RETURN_VALUE,o=t.ERR_MISSING_ARGS,a=IM(),s=Rm(),f=s.inspect,v=Rm().types,g=v.isPromise,m=v.isRegExp,w=DM()(),l=j1()(),x=Bm()("RegExp.prototype.test"),y,S;function k(){var st=jM();y=st.isDeepEqual,S=st.isDeepStrictEqual}var M=!1,T=V.exports=P,c={};function h(st){throw st.message instanceof Error?st.message:new a(st)}function b(st,et,Z,ot,X){var Q=arguments.length,ut;if(Q===0)ut="Failed";else if(Q===1)Z=st,st=void 0;else{if(M===!1){M=!0;var J=process.emitWarning?process.emitWarning:console.warn.bind(console);J("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Q===2&&(ot="!=")}if(Z instanceof Error)throw Z;var q={actual:st,expected:et,operator:ot===void 0?"fail":ot,stackStartFn:X||b};Z!==void 0&&(q.message=Z);var it=new a(q);throw ut&&(it.message=ut,it.generatedMessage=!0),it}T.fail=b,T.AssertionError=a;function _(st,et,Z,ot){if(!Z){var X=!1;if(et===0)X=!0,ot="No value argument passed to `assert.ok()`";else if(ot instanceof Error)throw ot;var Q=new a({actual:Z,expected:!0,message:ot,operator:"==",stackStartFn:st});throw Q.generatedMessage=X,Q}}function P(){for(var st=arguments.length,et=new Array(st),Z=0;Z1?Z-1:0),X=1;X1?Z-1:0),X=1;X1?Z-1:0),X=1;X1?Z-1:0),X=1;X{var u=1e3,d=u*60,E=d*60,A=E*24,t=A*365.25;V.exports=function(o,a){a=a||{};var s=typeof o;if(s==="string"&&o.length>0)return e(o);if(s==="number"&&isNaN(o)===!1)return a.long?i(o):r(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function e(o){if(o=String(o),!(o.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return s*t;case"days":case"day":case"d":return s*A;case"hours":case"hour":case"hrs":case"hr":case"h":return s*E;case"minutes":case"minute":case"mins":case"min":case"m":return s*d;case"seconds":case"second":case"secs":case"sec":case"s":return s*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(o){return o>=A?Math.round(o/A)+"d":o>=E?Math.round(o/E)+"h":o>=d?Math.round(o/d)+"m":o>=u?Math.round(o/u)+"s":o+"ms"}function i(o){return n(o,A,"day")||n(o,E,"hour")||n(o,d,"minute")||n(o,u,"second")||o+" ms"}function n(o,a,s){if(!(o{K=V.exports=E.debug=E.default=E,K.coerce=r,K.disable=t,K.enable=A,K.enabled=e,K.humanize=UM(),K.names=[],K.skips=[],K.formatters={};var u;function d(i){var n=0,o;for(o in i)n=(n<<5)-n+i.charCodeAt(o),n|=0;return K.colors[Math.abs(n)%K.colors.length]}function E(i){function n(){if(n.enabled){var o=n,a=+new Date,s=a-(u||a);o.diff=s,o.prev=u,o.curr=a,u=a;for(var f=new Array(arguments.length),v=0;v{K=V.exports=VM(),K.log=E,K.formatArgs=d,K.save=A,K.load=t,K.useColors=u,K.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:e(),K.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function u(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}K.formatters.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}};function d(r){var i=this.useColors;if(r[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+r[0]+(i?"%c ":" ")+"+"+K.humanize(this.diff),!!i){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(o++,s==="%c"&&(a=o))}),r.splice(a,0,n)}}function E(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function A(r){try{r==null?K.storage.removeItem("debug"):K.storage.debug=r}catch{}}function t(){var r;try{r=K.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=r0.DEBUG),r}K.enable(t());function e(){try{return window.localStorage}catch{}}}),qM=Vt((K,V)=>{var u=av(),d=HM()("stream-parser");V.exports=r;var E=-1,A=0,t=1,e=2;function r(l){var x=l&&typeof l._transform=="function",y=l&&typeof l._write=="function";if(!x&&!y)throw new Error("must pass a Writable or Transform stream in");d("extending Parser into stream"),l._bytes=n,l._skipBytes=o,x&&(l._passthrough=a),x?l._transform=f:l._write=s}function i(l){d("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=E,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function n(l,x){u(!this._parserCallback,'there is already a "callback" set!'),u(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||i(this),d("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=A}function o(l,x){u(!this._parserCallback,'there is already a "callback" set!'),u(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||i(this),d("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=t}function a(l,x){u(!this._parserCallback,'There is already a "callback" set!'),u(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||i(this),d("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=e}function s(l,x,y){this._parserInit||i(this),d("write(%o bytes)",l.length),typeof x=="function"&&(y=x),m(this,l,null,y)}function f(l,x,y){this._parserInit||i(this),d("transform(%o bytes)",l.length),typeof x!="function"&&(x=this._parserOutput),m(this,l,x,y)}function v(l,x,y,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):x.length<=l._parserBytesLeft?function(){return g(l,x,y,S)}:function(){var k=x.slice(0,l._parserBytesLeft);return g(l,k,y,function(M){if(M)return S(M);if(x.length>k.length)return function(){return v(l,x.slice(k.length),y,S)}})}}function g(l,x,y,S){if(l._parserBytesLeft-=x.length,d("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===A?(l._parserBuffers.push(x),l._parserBuffered+=x.length):l._parserState===e&&y(x),l._parserBytesLeft===0){var k=l._parserCallback;if(k&&l._parserState===A&&l._parserBuffers.length>1&&(x=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==A&&(x=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=E,l._parserBuffers.splice(0),k){var M=[];x&&M.push(x),y&&M.push(y);var T=k.length>M.length;T&&M.push(w(S));var c=k.apply(l,M);if(!T||S===c)return S}}else return S}var m=w(v);function w(l){return function(){for(var x=l.apply(this,arguments);typeof x=="function";)x=x();return x}}}),_u=Vt(K=>{var V=CM().Transform,u=qM();function d(){V.call(this,{readableObjectMode:!0})}d.prototype=Object.create(V.prototype),d.prototype.constructor=d,u(d.prototype),K.ParserStream=d,K.sliceEq=function(A,t,e){for(var r=t,i=0;i{var u=_u().readUInt16BE,d=_u().readUInt32BE;function E(a,s){if(a.length<4+s)return null;var f=d(a,s);return a.length>4&15,v=a[4]&15,g=a[5]>>4&15,m=u(a,6),w=8,l=0;lm.width||g.width===m.width&&g.height>m.height?g:m}),f=a.reduce(function(g,m){return g.height>m.height||g.height===m.height&&g.width>m.width?g:m}),v;return s.width>f.height||s.width===f.height&&s.height>f.width?v=s:v=f,v}V.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var f=o(s.sizes),v=1;s.transforms.forEach(function(m){var w={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(m.type==="imir"&&(m.value===0?v=l[v]:(v=l[v],v=w[v],v=w[v])),m.type==="irot")for(var x=0;x{function u(A,t){var e=new Error(A);return e.code=t,e}function d(A){try{return decodeURIComponent(escape(A))}catch{return A}}function E(A,t,e){this.input=A.subarray(t,e),this.start=t;var r=String.fromCharCode.apply(null,this.input.subarray(0,4));if(r!=="II*\0"&&r!=="MM\0*")throw u("invalid TIFF signature","EBADDATA");this.big_endian=r[0]==="M"}E.prototype.each=function(A){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var e=this.ifds_to_read.shift();e.offset&&this.scan_ifd(e.id,e.offset,A)}},E.prototype.read_uint16=function(A){var t=this.input;if(A+2>t.length)throw u("unexpected EOF","EBADDATA");return this.big_endian?t[A]*256+t[A+1]:t[A]+t[A+1]*256},E.prototype.read_uint32=function(A){var t=this.input;if(A+4>t.length)throw u("unexpected EOF","EBADDATA");return this.big_endian?t[A]*16777216+t[A+1]*65536+t[A+2]*256+t[A+3]:t[A]+t[A+1]*256+t[A+2]*65536+t[A+3]*16777216},E.prototype.is_subifd_link=function(A,t){return A===0&&t===34665||A===0&&t===34853||A===34665&&t===40965},E.prototype.exif_format_length=function(A){switch(A){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},E.prototype.exif_format_read=function(A,t){var e;switch(A){case 1:case 2:return e=this.input[t],e;case 6:return e=this.input[t],e|(e&128)*33554430;case 3:return e=this.read_uint16(t),e;case 8:return e=this.read_uint16(t),e|(e&32768)*131070;case 4:return e=this.read_uint32(t),e;case 9:return e=this.read_uint32(t),e|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},E.prototype.scan_ifd=function(A,t,e){var r=this.read_uint16(t);t+=2;for(var i=0;ithis.input.length)throw u("unexpected EOF","EBADDATA");for(var m=[],w=v,l=0;l0&&(this.ifds_to_read.push({id:n,offset:m[0]}),g=!0);var y={is_big_endian:this.big_endian,ifd:A,tag:n,format:o,count:a,entry_offset:t+this.start,data_length:f,data_offset:v+this.start,value:m,is_subifd_link:g};if(e(y)===!1){this.aborted=!0;return}t+=12}A===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},V.exports.ExifParser=E,V.exports.get_orientation=function(A){var t=0;try{return new E(A,0,A.length).each(function(e){if(e.ifd===0&&e.tag===274&&Array.isArray(e.value))return t=e.value[0],!1}),t}catch{return-1}}}),GM=Vt((K,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=WM(),t=U1(),e=u("ftyp");V.exports=function(r){if(d(r,4,e)){var i=A.unbox(r,0);if(i){var n=A.getMimeType(i.data);if(n){for(var o,a=i.end;;){var s=A.unbox(r,a);if(!s)break;if(a=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){o=s.data;break}}if(o){var f=A.readSizeFromMeta(o);if(f){var v={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(v.variants=f.variants),f.orientation&&(v.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var g=E(r,f.exif_location.offset),m=r.slice(f.exif_location.offset+g+4,f.exif_location.offset+f.exif_location.length),w=t.get_orientation(m);w>0&&(v.orientation=w)}return v}}}}}}}),ZM=Vt((K,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=u("BM");V.exports=function(t){if(!(t.length<26)&&d(t,0,A))return{width:E(t,18),height:E(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),KM=Vt((K,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=u("GIF87a"),t=u("GIF89a");V.exports=function(e){if(!(e.length<10)&&!(!d(e,0,A)&&!d(e,0,t)))return{width:E(e,6),height:E(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),YM=Vt((K,V)=>{var u=_u().readUInt16LE,d=0,E=1,A=16;V.exports=function(t){var e=u(t,0),r=u(t,2),i=u(t,4);if(!(e!==d||r!==E||!i)){for(var n=[],o={width:0,height:0},a=0;ao.width||f>o.height)&&(o=v)}return{width:o.width,height:o.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),XM=Vt((K,V)=>{var u=_u().readUInt16BE,d=_u().str2arr,E=_u().sliceEq,A=U1(),t=d("Exif\0\0");V.exports=function(e){if(!(e.length<2)&&!(e[0]!==255||e[1]!==216||e[2]!==255))for(var r=2;;){for(;;){if(e.length-r<2)return;if(e[r++]===255)break}for(var i=e[r++],n;i===255;)i=e[r++];if(208<=i&&i<=217||i===1)n=0;else if(192<=i&&i<=254){if(e.length-r<2)return;n=u(e,r)-2,r+=2}else return;if(i===217||i===218)return;var o;if(i===225&&n>=10&&E(e,r,t)&&(o=A.get_orientation(e.slice(r+6,r+n))),n>=5&&192<=i&&i<=207&&i!==196&&i!==200&&i!==204){if(e.length-r0&&(a.orientation=o),a}r+=n}}}),$M=Vt((K,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=u(`‰PNG\r - -`),t=u("IHDR");V.exports=function(e){if(!(e.length<24)&&d(e,0,A)&&d(e,12,t))return{width:E(e,16),height:E(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),JM=Vt((K,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=u("8BPS\0");V.exports=function(t){if(!(t.length<22)&&d(t,0,A))return{width:E(t,18),height:E(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),QM=Vt((K,V)=>{function u(s){return s===32||s===9||s===13||s===10}function d(s){return typeof s=="number"&&isFinite(s)&&s>0}function E(s){var f=0,v=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f]*>/,t=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,e=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,i=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function o(s){var f=s.match(e),v=s.match(r),g=s.match(i);return{width:f&&(f[1]||f[2]),height:v&&(v[1]||v[2]),viewbox:g&&(g[1]||g[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}V.exports=function(s){if(E(s)){for(var f="",v=0;v{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=_u().readUInt16BE,t=_u().readUInt32LE,e=_u().readUInt32BE,r=u("II*\0"),i=u("MM\0*");function n(s,f,v){return v?A(s,f):E(s,f)}function o(s,f,v){return v?e(s,f):t(s,f)}function a(s,f,v){var g=n(s,f+2,v),m=o(s,f+4,v);return m!==1||g!==3&&g!==4?null:g===3?n(s,f+8,v):o(s,f+8,v)}V.exports=function(s){if(!(s.length<8)&&!(!d(s,0,r)&&!d(s,0,i))){var f=s[0]===77,v=o(s,4,f)-8;if(!(v<0)){var g=v+8;if(!(s.length-g<2)){var m=n(s,g+0,f)*12;if(!(m<=0)&&(g+=2,!(s.length-g{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=_u().readUInt32LE,t=U1(),e=u("RIFF"),r=u("WEBP");function i(a,s){if(!(a[s+3]!==157||a[s+4]!==1||a[s+5]!==42))return{width:E(a,s+6)&16383,height:E(a,s+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function n(a,s){if(a[s]===47){var f=A(a,s+1);return{width:(f&16383)+1,height:(f>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function o(a,s){return{width:(a[s+6]<<16|a[s+5]<<8|a[s+4])+1,height:(a[s+9]<a.length)){for(;s+8=10?f=f||i(a,s+8):m==="VP8L"&&w>=9?f=f||n(a,s+8):m==="VP8X"&&w>=10?f=f||o(a,s+8):m==="EXIF"&&(v=t.get_orientation(a.slice(s+8,s+8+w)),s=1/0),s+=8+w}if(f)return v>0&&(f.orientation=v),f}}}}),rS=Vt((K,V)=>{V.exports={avif:GM(),bmp:ZM(),gif:KM(),ico:YM(),jpeg:XM(),png:$M(),psd:JM(),svg:QM(),tiff:tS(),webp:eS()}}),nS=Vt((K,V)=>{var u=rS();function d(E){for(var A=Object.keys(u),t=0;t{var V=nS(),u=Fp().IMAGE_URL_PREFIX,d=m0().Buffer;K.getImageSize=function(E){var A=E.replace(u,""),t=new d(A,"base64");return V(t)}}),iS=Vt((K,V)=>{var u=Xr(),d=Om(),E=Lo(),A=yo(),t=Xr().maxRowLength,e=aS().getImageSize;V.exports=function(o,a){var s,f;if(a._hasZ)s=a.z.length,f=t(a.z);else if(a._hasSource){var v=e(a.source);s=v.height,f=v.width}var g=A.getFromId(o,a.xaxis||"x"),m=A.getFromId(o,a.yaxis||"y"),w=g.d2c(a.x0)-a.dx/2,l=m.d2c(a.y0)-a.dy/2,x,y=[w,w+f*a.dx],S=[l,l+s*a.dy];if(g&&g.type==="log")for(x=0;x{var u=Ni(),d=Xr(),E=d.strTranslate,A=Lh(),t=Om(),e=l2(),r=w1().STYLE;V.exports=function(i,n,o,a){var s=n.xaxis,f=n.yaxis,v=!i._context._exportedPlot&&e();d.makeTraceGroups(a,o,"im").each(function(g){var m=u.select(this),w=g[0],l=w.trace,x=(l.zsmooth==="fast"||l.zsmooth===!1&&v)&&!l._hasZ&&l._hasSource&&s.type==="linear"&&f.type==="linear";l._realImage=x;var y=w.z,S=w.x0,k=w.y0,M=w.w,T=w.h,c=l.dx,h=l.dy,b,_,P,z,D,B;for(B=0;b===void 0&&B0;)_=s.c2p(S+B*c),B--;for(B=0;z===void 0&&B0;)D=f.c2p(k+B*h),B--;if(_et[0];if(Z||ot){var X=b+I/2,Q=z+F/2;ct+="transform:"+E(X+"px",Q+"px")+"scale("+(Z?-1:1)+","+(ot?-1:1)+")"+E(-X+"px",-Q+"px")+";"}}rt.attr("style",ct);var ut=new Promise(function(J){if(l._hasZ)J();else if(l._hasSource)if(l._canvas&&l._canvas.el.width===M&&l._canvas.el.height===T&&l._canvas.source===l.source)J();else{var q=document.createElement("canvas");q.width=M,q.height=T;var it=q.getContext("2d",{willReadFrequently:!0});l._image=l._image||new Image;var nt=l._image;nt.onload=function(){it.drawImage(nt,0,0),l._canvas={el:q,source:l.source},J()},nt.setAttribute("src",l.source)}}).then(function(){var J,q;if(l._hasZ)q=G(function(dt,Tt){var wt=y[Tt][dt];return d.isTypedArray(wt)&&(wt=Array.from(wt)),wt}),J=q.toDataURL("image/png");else if(l._hasSource)if(x)J=l.source;else{var it=l._canvas.el.getContext("2d",{willReadFrequently:!0}),nt=it.getImageData(0,0,M,T).data;q=G(function(dt,Tt){var wt=4*(Tt*M+dt);return[nt[wt],nt[wt+1],nt[wt+2],nt[wt+3]]}),J=q.toDataURL("image/png")}rt.attr({"xlink:href":J,height:F,width:I,x:b,y:z})});i._promises.push(ut)})}}),sS=Vt((K,V)=>{var u=Ni();V.exports=function(d){u.select(d).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}),lS=Vt((K,V)=>{var u=hc(),d=Xr(),E=d.isArrayOrTypedArray,A=Om();V.exports=function(t,e,r){var i=t.cd[0],n=i.trace,o=t.xa,a=t.ya;if(!(u.inbox(e-i.x0,e-(i.x0+i.w*n.dx),0)>0||u.inbox(r-i.y0,r-(i.y0+i.h*n.dy),0)>0)){var s=Math.floor((e-i.x0)/n.dx),f=Math.floor(Math.abs(r-i.y0)/n.dy),v;if(n._hasZ?v=i.z[f][s]:n._hasSource&&(v=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(s,f,1,1).data),!!v){var g=i.hi||n.hoverinfo,m;if(g){var w=g.split("+");w.indexOf("all")!==-1&&(w=["color"]),w.indexOf("color")!==-1&&(m=!0)}var l=A.colormodel[n.colormodel],x=l.colormodel||n.colormodel,y=x.length,S=n._scaler(v),k=l.suffix,M=[];(n.hovertemplate||m)&&(M.push("["+[S[0]+k[0],S[1]+k[1],S[2]+k[2]].join(", ")),y===4&&M.push(", "+S[3]+k[3]),M.push("]"),M=M.join(""),t.extraText=x.toUpperCase()+": "+M);var T;E(n.hovertext)&&E(n.hovertext[f])?T=n.hovertext[f][s]:E(n.text)&&E(n.text[f])&&(T=n.text[f][s]);var c=a.c2p(i.y0+(f+.5)*n.dy),h=i.x0+(s+.5)*n.dx,b=i.y0+(f+.5)*n.dy,_="["+v.slice(0,n.colormodel.length).join(", ")+"]";return[d.extendFlat(t,{index:[f,s],x0:o.c2p(i.x0+s*n.dx),x1:o.c2p(i.x0+(s+1)*n.dx),y0:c,y1:c,color:S,xVal:h,xLabelVal:h,yVal:b,yLabelVal:b,zLabelVal:_,text:T,hovertemplateLabels:{zLabel:_,colorLabel:M,"color[0]Label":S[0]+k[0],"color[1]Label":S[1]+k[1],"color[2]Label":S[2]+k[2],"color[3]Label":S[3]+k[3]}})]}}}}),uS=Vt((K,V)=>{V.exports=function(u,d){return"xVal"in d&&(u.x=d.xVal),"yVal"in d&&(u.y=d.yVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u.color=d.color,u.colormodel=d.trace.colormodel,u.z||(u.z=d.color),u}}),cS=Vt((K,V)=>{V.exports={attributes:O2(),supplyDefaults:GA(),calc:iS(),plot:oS(),style:sS(),hoverPoints:lS(),eventData:uS(),moduleType:"trace",name:"image",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),fS=Vt((K,V)=>{V.exports=cS()}),x0=Vt((K,V)=>{var u=kl(),d=Vu().attributes,E=yu(),A=af(),{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=So().extendFlat,n=If().pattern,o=E({editType:"plot",arrayOk:!0,colorEditType:"plot"});V.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:A.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:n,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:i({},u.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:t({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:e({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:i({},o,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:i({},o,{}),outsidetextfont:i({},o,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:i({},u.showlegend,{arrayOk:!0}),legend:i({},u.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:i({},o,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:d({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),_0=Vt((K,V)=>{var u=Lo(),d=Xr(),E=x0(),A=Vu().defaults,t=Ih().handleText,e=Xr().coercePattern;function r(o,a){var s=d.isArrayOrTypedArray(o),f=d.isArrayOrTypedArray(a),v=Math.min(s?o.length:1/0,f?a.length:1/0);if(isFinite(v)||(v=0),v&&f){for(var g,m=0;m0){g=!0;break}}g||(v=0)}return{hasLabels:s,hasValues:f,len:v}}function i(o,a,s,f,v){var g=f("marker.line.width");g&&f("marker.line.color",v?void 0:s.paper_bgcolor);var m=f("marker.colors");e(f,"marker.pattern",m),o.marker&&!a.marker.pattern.fgcolor&&(a.marker.pattern.fgcolor=o.marker.colors),a.marker.pattern.bgcolor||(a.marker.pattern.bgcolor=s.paper_bgcolor)}function n(o,a,s,f){function v(_,P){return d.coerce(o,a,E,_,P)}var g=v("labels"),m=v("values"),w=r(g,m),l=w.len;if(a._hasLabels=w.hasLabels,a._hasValues=w.hasValues,!a._hasLabels&&a._hasValues&&(v("label0"),v("dlabel")),!l){a.visible=!1;return}a._length=l,i(o,a,f,v,!0),v("scalegroup");var x=v("text"),y=v("texttemplate");v("texttemplatefallback");var S;if(y||(S=v("textinfo",d.isArrayOrTypedArray(x)?"text+percent":"percent")),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),y||S&&S!=="none"){var k=v("textposition");t(o,a,f,v,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var M=Array.isArray(k)||k==="auto",T=M||k==="outside";T&&v("automargin"),(k==="inside"||k==="auto"||Array.isArray(k))&&v("insidetextorientation")}else S==="none"&&v("textposition","none");A(a,f,v);var c=v("hole"),h=v("title.text");if(h){var b=v("title.position",c?"middle center":"top center");!c&&b==="middle center"&&(a.title.position="top center"),d.coerceFont(v,"title.font",f.font)}v("sort"),v("direction"),v("rotation"),v("pull")}V.exports={handleLabelsAndValues:r,handleMarkerDefaults:i,supplyDefaults:n}}),V1=Vt((K,V)=>{V.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),hS=Vt((K,V)=>{var u=Xr(),d=V1();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("hiddenlabels"),t("piecolorway",A.colorway),t("extendpiecolors")}}),Nm=Vt((K,V)=>{var u=Lo(),d=Af(),E=Pi(),A={};function t(n,o){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],v=o.labels,g=o.marker.colors||[],m=o.values,w=o._length,l=o._hasValues&&w,x,y;if(o.dlabel)for(v=new Array(w),x=0;x=0});var P=o.type==="funnelarea"?T:o.sort;return P&&a.sort(function(z,D){return D.v-z.v}),a[0]&&(a[0].vTotal=M),a}function e(n){return function(o,a){return!o||(o=d(o),!o.isValid())?!1:(o=E.addOpacity(o,o.getAlpha()),n[a]||(n[a]=o),o)}}function r(n,o){var a=(o||{}).type;a||(a="pie");var s=n._fullLayout,f=n.calcdata,v=s[a+"colorway"],g=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(v=i(v,A));for(var m=0,w=0;w{var u=mh().appendArrayMultiPointValues;V.exports=function(d,E){var A={curveNumber:E.index,pointNumbers:d.pts,data:E._input,fullData:E,label:d.label,color:d.color,value:d.v,percent:d.percent,text:d.text,bbox:d.bbox,v:d.v};return d.pts.length===1&&(A.pointNumber=A.i=d.pts[0]),u(A,E,d.pts),E.type==="funnelarea"&&(delete A.v,delete A.i),A}}),H1=Vt((K,V)=>{var u=Ni(),d=Uu(),E=hc(),A=Pi(),t=Eo(),e=Xr(),r=e.strScale,i=e.strTranslate,n=Dl(),o=sh(),a=o.recordMinTextSize,s=o.clearMinTextSize,f=p0().TEXTPAD,v=Md(),g=pS(),m=Xr().isValidTextValue;function w(ot,X){var Q=ot._context.staticPlot,ut=ot._fullLayout,J=ut._size;s("pie",ut),k(X,ot),G(X,J);var q=e.makeTraceGroups(ut._pielayer,X,"trace").each(function(it){var nt=u.select(this),dt=it[0],Tt=dt.trace;ct(it),nt.attr("stroke-linejoin","round"),nt.each(function(){var wt=u.select(this).selectAll("g.slice").data(it);wt.enter().append("g").classed("slice",!0),wt.exit().remove();var Ct=[[[],[]],[[],[]]],It=!1;wt.each(function(vt,Ut){if(vt.hidden){u.select(this).selectAll("path,g").remove();return}vt.pointNumber=vt.i,vt.curveNumber=Tt.index,Ct[vt.pxmid[1]<0?0:1][vt.pxmid[0]<0?0:1].push(vt);var re=dt.cx,Kt=dt.cy,ue=u.select(this),Me=ue.selectAll("path.surface").data([vt]);if(Me.enter().append("path").classed("surface",!0).style({"pointer-events":Q?"none":"all"}),ue.call(x,ot,it),Tt.pull){var Ce=+v.castOption(Tt.pull,vt.pts)||0;Ce>0&&(re+=Ce*vt.pxmid[0],Kt+=Ce*vt.pxmid[1])}vt.cxFinal=re,vt.cyFinal=Kt;function We(de,Dt,qt,_t){var lt=_t*(Dt[0]-de[0]),yt=_t*(Dt[1]-de[1]);return"a"+_t*dt.r+","+_t*dt.r+" 0 "+vt.largeArc+(qt?" 1 ":" 0 ")+lt+","+yt}var qe=Tt.hole;if(vt.v===dt.vTotal){var vr="M"+(re+vt.px0[0])+","+(Kt+vt.px0[1])+We(vt.px0,vt.pxmid,!0,1)+We(vt.pxmid,vt.px0,!0,1)+"Z";qe?Me.attr("d","M"+(re+qe*vt.px0[0])+","+(Kt+qe*vt.px0[1])+We(vt.px0,vt.pxmid,!1,qe)+We(vt.pxmid,vt.px0,!1,qe)+"Z"+vr):Me.attr("d",vr)}else{var _r=We(vt.px0,vt.px1,!0,1);if(qe){var er=1-qe;Me.attr("d","M"+(re+qe*vt.px1[0])+","+(Kt+qe*vt.px1[1])+We(vt.px1,vt.px0,!1,qe)+"l"+er*vt.px0[0]+","+er*vt.px0[1]+_r+"Z")}else Me.attr("d","M"+re+","+Kt+"l"+vt.px0[0]+","+vt.px0[1]+_r+"Z")}et(ot,vt,dt);var Mr=v.castOption(Tt.textposition,vt.pts),Ir=ue.selectAll("g.slicetext").data(vt.text&&Mr!=="none"?[0]:[]);Ir.enter().append("g").classed("slicetext",!0),Ir.exit().remove(),Ir.each(function(){var de=e.ensureSingle(u.select(this),"text","",function(Yt){Yt.attr("data-notex",1)}),Dt=e.ensureUniformFontSize(ot,Mr==="outside"?y(Tt,vt,ut.font):S(Tt,vt,ut.font));de.text(vt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(t.font,Dt).call(n.convertToTspans,ot);var qt=t.bBox(de.node()),_t;if(Mr==="outside")_t=D(qt,vt);else if(_t=M(qt,vt,dt),Mr==="auto"&&_t.scale<1){var lt=e.ensureUniformFontSize(ot,Tt.outsidetextfont);de.call(t.font,lt),qt=t.bBox(de.node()),_t=D(qt,vt)}var yt=_t.textPosAngle,St=yt===void 0?vt.pxmid:st(dt.r,yt);if(_t.targetX=re+St[0]*_t.rCenter+(_t.x||0),_t.targetY=Kt+St[1]*_t.rCenter+(_t.y||0),Z(_t,qt),_t.outside){var Ht=_t.targetY;vt.yLabelMin=Ht-qt.height/2,vt.yLabelMid=Ht,vt.yLabelMax=Ht+qt.height/2,vt.labelExtraX=0,vt.labelExtraY=0,It=!0}_t.fontSize=Dt.size,a(Tt.type,_t,ut),it[Ut].transform=_t,e.setTransormAndDisplay(de,_t)})});var Nt=u.select(this).selectAll("g.titletext").data(Tt.title.text?[0]:[]);if(Nt.enter().append("g").classed("titletext",!0),Nt.exit().remove(),Nt.each(function(){var vt=e.ensureSingle(u.select(this),"text","",function(Kt){Kt.attr("data-notex",1)}),Ut=Tt.title.text;Tt._meta&&(Ut=e.templateString(Ut,Tt._meta)),vt.text(Ut).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(t.font,Tt.title.font).call(n.convertToTspans,ot);var re;Tt.title.position==="middle center"?re=B(dt):re=R(dt,J),vt.attr("transform",i(re.x,re.y)+r(Math.min(1,re.scale))+i(re.tx,re.ty))}),It&&N(Ct,Tt),l(wt,Tt),It&&Tt.automargin){var te=t.bBox(nt.node()),Jt=Tt.domain,ee=J.w*(Jt.x[1]-Jt.x[0]),Zt=J.h*(Jt.y[1]-Jt.y[0]),mt=(.5*ee-dt.r)/J.w,bt=(.5*Zt-dt.r)/J.h;d.autoMargin(ot,"pie."+Tt.uid+".automargin",{xl:Jt.x[0]-mt,xr:Jt.x[1]+mt,yb:Jt.y[0]-bt,yt:Jt.y[1]+bt,l:Math.max(dt.cx-dt.r-te.left,0),r:Math.max(te.right-(dt.cx+dt.r),0),b:Math.max(te.bottom-(dt.cy+dt.r),0),t:Math.max(dt.cy-dt.r-te.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var it=u.select(this);it.attr("dy")&&it.attr("dy",it.attr("dy"))})},0)}function l(ot,X){ot.each(function(Q){var ut=u.select(this);if(!Q.labelExtraX&&!Q.labelExtraY){ut.select("path.textline").remove();return}var J=ut.select("g.slicetext text");Q.transform.targetX+=Q.labelExtraX,Q.transform.targetY+=Q.labelExtraY,e.setTransormAndDisplay(J,Q.transform);var q=Q.cxFinal+Q.pxmid[0],it=Q.cyFinal+Q.pxmid[1],nt="M"+q+","+it,dt=(Q.yLabelMax-Q.yLabelMin)*(Q.pxmid[0]<0?-1:1)/4;if(Q.labelExtraX){var Tt=Q.labelExtraX*Q.pxmid[1]/Q.pxmid[0],wt=Q.yLabelMid+Q.labelExtraY-(Q.cyFinal+Q.pxmid[1]);Math.abs(Tt)>Math.abs(wt)?nt+="l"+wt*Q.pxmid[0]/Q.pxmid[1]+","+wt+"H"+(q+Q.labelExtraX+dt):nt+="l"+Q.labelExtraX+","+Tt+"v"+(wt-Tt)+"h"+dt}else nt+="V"+(Q.yLabelMid+Q.labelExtraY)+"h"+dt;e.ensureSingle(ut,"path","textline").call(A.stroke,X.outsidetextfont.color).attr({"stroke-width":Math.min(2,X.outsidetextfont.size/8),d:nt,fill:"none"})})}function x(ot,X,Q){var ut=Q[0],J=ut.cx,q=ut.cy,it=ut.trace,nt=it.type==="funnelarea";"_hasHoverLabel"in it||(it._hasHoverLabel=!1),"_hasHoverEvent"in it||(it._hasHoverEvent=!1),ot.on("mouseover",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index];if(!(X._dragging||Tt.hovermode===!1)){var Ct=wt.hoverinfo;if(Array.isArray(Ct)&&(Ct=E.castHoverinfo({hoverinfo:[v.castOption(Ct,dt.pts)],_module:it._module},Tt,0)),Ct==="all"&&(Ct="label+text+value+percent+name"),wt.hovertemplate||Ct!=="none"&&Ct!=="skip"&&Ct){var It=dt.rInscribed||0,Nt=J+dt.pxmid[0]*(1-It),te=q+dt.pxmid[1]*(1-It),Jt=Tt.separators,ee=[];if(Ct&&Ct.indexOf("label")!==-1&&ee.push(dt.label),dt.text=v.castOption(wt.hovertext||wt.text,dt.pts),Ct&&Ct.indexOf("text")!==-1){var Zt=dt.text;e.isValidTextValue(Zt)&&ee.push(Zt)}dt.value=dt.v,dt.valueLabel=v.formatPieValue(dt.v,Jt),Ct&&Ct.indexOf("value")!==-1&&ee.push(dt.valueLabel),dt.percent=dt.v/ut.vTotal,dt.percentLabel=v.formatPiePercent(dt.percent,Jt),Ct&&Ct.indexOf("percent")!==-1&&ee.push(dt.percentLabel);var mt=wt.hoverlabel,bt=mt.font,vt=[];E.loneHover({trace:it,x0:Nt-It*ut.r,x1:Nt+It*ut.r,y:te,_x0:nt?J+dt.TL[0]:Nt-It*ut.r,_x1:nt?J+dt.TR[0]:Nt+It*ut.r,_y0:nt?q+dt.TL[1]:te-It*ut.r,_y1:nt?q+dt.BL[1]:te+It*ut.r,text:ee.join("
                "),name:wt.hovertemplate||Ct.indexOf("name")!==-1?wt.name:void 0,idealAlign:dt.pxmid[0]<0?"left":"right",color:v.castOption(mt.bgcolor,dt.pts)||dt.color,borderColor:v.castOption(mt.bordercolor,dt.pts),fontFamily:v.castOption(bt.family,dt.pts),fontSize:v.castOption(bt.size,dt.pts),fontColor:v.castOption(bt.color,dt.pts),nameLength:v.castOption(mt.namelength,dt.pts),textAlign:v.castOption(mt.align,dt.pts),hovertemplate:v.castOption(wt.hovertemplate,dt.pts),hovertemplateLabels:dt,eventData:[g(dt,wt)]},{container:Tt._hoverlayer.node(),outerContainer:Tt._paper.node(),gd:X,inOut_bbox:vt}),dt.bbox=vt[0],it._hasHoverLabel=!0}it._hasHoverEvent=!0,X.emit("plotly_hover",{points:[g(dt,wt)],event:u.event})}}),ot.on("mouseout",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index],Ct=u.select(this).datum();it._hasHoverEvent&&(dt.originalEvent=u.event,X.emit("plotly_unhover",{points:[g(Ct,wt)],event:u.event}),it._hasHoverEvent=!1),it._hasHoverLabel&&(E.loneUnhover(Tt._hoverlayer.node()),it._hasHoverLabel=!1)}),ot.on("click",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index];X._dragging||Tt.hovermode===!1||(X._hoverdata=[g(dt,wt)],E.click(X,u.event))})}function y(ot,X,Q){var ut=v.castOption(ot.outsidetextfont.color,X.pts)||v.castOption(ot.textfont.color,X.pts)||Q.color,J=v.castOption(ot.outsidetextfont.family,X.pts)||v.castOption(ot.textfont.family,X.pts)||Q.family,q=v.castOption(ot.outsidetextfont.size,X.pts)||v.castOption(ot.textfont.size,X.pts)||Q.size,it=v.castOption(ot.outsidetextfont.weight,X.pts)||v.castOption(ot.textfont.weight,X.pts)||Q.weight,nt=v.castOption(ot.outsidetextfont.style,X.pts)||v.castOption(ot.textfont.style,X.pts)||Q.style,dt=v.castOption(ot.outsidetextfont.variant,X.pts)||v.castOption(ot.textfont.variant,X.pts)||Q.variant,Tt=v.castOption(ot.outsidetextfont.textcase,X.pts)||v.castOption(ot.textfont.textcase,X.pts)||Q.textcase,wt=v.castOption(ot.outsidetextfont.lineposition,X.pts)||v.castOption(ot.textfont.lineposition,X.pts)||Q.lineposition,Ct=v.castOption(ot.outsidetextfont.shadow,X.pts)||v.castOption(ot.textfont.shadow,X.pts)||Q.shadow;return{color:ut,family:J,size:q,weight:it,style:nt,variant:dt,textcase:Tt,lineposition:wt,shadow:Ct}}function S(ot,X,Q){var ut=v.castOption(ot.insidetextfont.color,X.pts);!ut&&ot._input.textfont&&(ut=v.castOption(ot._input.textfont.color,X.pts));var J=v.castOption(ot.insidetextfont.family,X.pts)||v.castOption(ot.textfont.family,X.pts)||Q.family,q=v.castOption(ot.insidetextfont.size,X.pts)||v.castOption(ot.textfont.size,X.pts)||Q.size,it=v.castOption(ot.insidetextfont.weight,X.pts)||v.castOption(ot.textfont.weight,X.pts)||Q.weight,nt=v.castOption(ot.insidetextfont.style,X.pts)||v.castOption(ot.textfont.style,X.pts)||Q.style,dt=v.castOption(ot.insidetextfont.variant,X.pts)||v.castOption(ot.textfont.variant,X.pts)||Q.variant,Tt=v.castOption(ot.insidetextfont.textcase,X.pts)||v.castOption(ot.textfont.textcase,X.pts)||Q.textcase,wt=v.castOption(ot.insidetextfont.lineposition,X.pts)||v.castOption(ot.textfont.lineposition,X.pts)||Q.lineposition,Ct=v.castOption(ot.insidetextfont.shadow,X.pts)||v.castOption(ot.textfont.shadow,X.pts)||Q.shadow;return{color:ut||A.contrast(X.color),family:J,size:q,weight:it,style:nt,variant:dt,textcase:Tt,lineposition:wt,shadow:Ct}}function k(ot,X){for(var Q,ut,J=0;J=-4;mt-=2)Zt(Math.PI*mt,"tan");for(mt=4;mt>=-4;mt-=2)Zt(Math.PI*(mt+1),"tan")}if(Ct||Nt){for(mt=4;mt>=-4;mt-=2)Zt(Math.PI*(mt+1.5),"rad");for(mt=4;mt>=-4;mt-=2)Zt(Math.PI*(mt+.5),"rad")}}if(nt||te||Ct){var bt=Math.sqrt(ot.width*ot.width+ot.height*ot.height);if(ee={scale:J*ut*2/bt,rCenter:1-J,rotate:0},ee.textPosAngle=(X.startangle+X.stopangle)/2,ee.scale>=1)return ee;Jt.push(ee)}(te||Nt)&&(ee=c(ot,ut,it,dt,Tt),ee.textPosAngle=(X.startangle+X.stopangle)/2,Jt.push(ee)),(te||It)&&(ee=h(ot,ut,it,dt,Tt),ee.textPosAngle=(X.startangle+X.stopangle)/2,Jt.push(ee));for(var vt=0,Ut=0,re=0;re=1)break}return Jt[vt]}function T(ot,X){var Q=ot.startangle,ut=ot.stopangle;return Q>X&&X>ut||Q0?1:-1)/2,y:q/(1+Q*Q/(ut*ut)),outside:!0}}function B(ot){var X=Math.sqrt(ot.titleBox.width*ot.titleBox.width+ot.titleBox.height*ot.titleBox.height);return{x:ot.cx,y:ot.cy,scale:ot.trace.hole*ot.r*2/X,tx:0,ty:-ot.titleBox.height/2+ot.trace.title.font.size}}function R(ot,X){var Q=1,ut=1,J,q=ot.trace,it={x:ot.cx,y:ot.cy},nt={tx:0,ty:0};nt.ty+=q.title.font.size,J=j(q),q.title.position.indexOf("top")!==-1?(it.y-=(1+J)*ot.r,nt.ty-=ot.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(it.y+=(1+J)*ot.r);var dt=I(ot.r,ot.trace.aspectratio),Tt=X.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(Tt=Tt+dt,it.x-=(1+J)*dt,nt.tx+=ot.titleBox.width/2):q.title.position.indexOf("center")!==-1?Tt*=2:q.title.position.indexOf("right")!==-1&&(Tt=Tt+dt,it.x+=(1+J)*dt,nt.tx-=ot.titleBox.width/2),Q=Tt/ot.titleBox.width,ut=F(ot,X)/ot.titleBox.height,{x:it.x,y:it.y,scale:Math.min(Q,ut),tx:nt.tx,ty:nt.ty}}function I(ot,X){return ot/(X===void 0?1:X)}function F(ot,X){var Q=ot.trace,ut=X.h*(Q.domain.y[1]-Q.domain.y[0]);return Math.min(ot.titleBox.height,ut/2)}function j(ot){var X=ot.pull;if(!X)return 0;var Q;if(e.isArrayOrTypedArray(X))for(X=0,Q=0;QX&&(X=ot.pull[Q]);return X}function N(ot,X){var Q,ut,J,q,it,nt,dt,Tt,wt,Ct,It,Nt,te;function Jt(bt,vt){return bt.pxmid[1]-vt.pxmid[1]}function ee(bt,vt){return vt.pxmid[1]-bt.pxmid[1]}function Zt(bt,vt){vt||(vt={});var Ut=vt.labelExtraY+(ut?vt.yLabelMax:vt.yLabelMin),re=ut?bt.yLabelMin:bt.yLabelMax,Kt=ut?bt.yLabelMax:bt.yLabelMin,ue=bt.cyFinal+it(bt.px0[1],bt.px1[1]),Me=Ut-re,Ce,We,qe,vr,_r,er;if(Me*dt>0&&(bt.labelExtraY=Me),!!e.isArrayOrTypedArray(X.pull))for(We=0;We=(v.castOption(X.pull,qe.pts)||0))&&((bt.pxmid[1]-qe.pxmid[1])*dt>0?(vr=qe.cyFinal+it(qe.px0[1],qe.px1[1]),Me=vr-re-bt.labelExtraY,Me*dt>0&&(bt.labelExtraY+=Me)):(Kt+bt.labelExtraY-ue)*dt>0&&(Ce=3*nt*Math.abs(We-Ct.indexOf(bt)),_r=qe.cxFinal+q(qe.px0[0],qe.px1[0]),er=_r+Ce-(bt.cxFinal+bt.pxmid[0])-bt.labelExtraX,er*nt>0&&(bt.labelExtraX+=er)))}for(ut=0;ut<2;ut++)for(J=ut?Jt:ee,it=ut?Math.max:Math.min,dt=ut?1:-1,Q=0;Q<2;Q++){for(q=Q?Math.max:Math.min,nt=Q?1:-1,Tt=ot[ut][Q],Tt.sort(J),wt=ot[1-ut][Q],Ct=wt.concat(Tt),Nt=[],It=0;It1?(Tt=Q.r,wt=Tt/J.aspectratio):(wt=Q.r,Tt=wt*J.aspectratio),Tt*=(1+J.baseratio)/2,dt=Tt*wt}it=Math.min(it,dt/Q.vTotal)}for(ut=0;utX.vTotal/2?1:0,Tt.halfangle=Math.PI*Math.min(Tt.v/X.vTotal,.5),Tt.ring=1-ut.hole,Tt.rInscribed=z(Tt,X))}function st(ot,X){return[ot*Math.sin(X),-ot*Math.cos(X)]}function et(ot,X,Q){var ut=ot._fullLayout,J=Q.trace,q=J.texttemplate,it=J.textinfo;if(!q&&it&&it!=="none"){var nt=it.split("+"),dt=function(vt){return nt.indexOf(vt)!==-1},Tt=dt("label"),wt=dt("text"),Ct=dt("value"),It=dt("percent"),Nt=ut.separators,te;if(te=Tt?[X.label]:[],wt){var Jt=v.getFirstFilled(J.text,X.pts);m(Jt)&&te.push(Jt)}Ct&&te.push(v.formatPieValue(X.v,Nt)),It&&te.push(v.formatPiePercent(X.v/Q.vTotal,Nt)),X.text=te.join("
                ")}function ee(vt){return{label:vt.label,value:vt.v,valueLabel:v.formatPieValue(vt.v,ut.separators),percent:vt.v/Q.vTotal,percentLabel:v.formatPiePercent(vt.v/Q.vTotal,ut.separators),color:vt.color,text:vt.text,customdata:e.castOption(J,vt.i,"customdata")}}if(q){var Zt=e.castOption(J,X.i,"texttemplate");if(!Zt)X.text="";else{var mt=ee(X),bt=v.getFirstFilled(J.text,X.pts);(m(bt)||bt==="")&&(mt.text=bt),X.text=e.texttemplateString({data:[mt,J._meta],fallback:J.texttemplatefallback,labels:mt,locale:ot._fullLayout._d3locale,template:Zt})}}}function Z(ot,X){var Q=ot.rotate*Math.PI/180,ut=Math.cos(Q),J=Math.sin(Q),q=(X.left+X.right)/2,it=(X.top+X.bottom)/2;ot.textX=q*ut-it*J,ot.textY=q*J+it*ut,ot.noCenter=!0}V.exports={plot:w,formatSliceLabel:et,transformInsideText:M,determineInsideTextFont:S,positionTitleOutside:R,prerenderTitles:k,layoutAreas:G,attachFxHandlers:x,computeTransform:Z}}),dS=Vt((K,V)=>{var u=Ni(),d=Tm(),E=sh().resizeText;V.exports=function(A){var t=A._fullLayout._pielayer.selectAll(".trace");E(A,t,"pie"),t.each(function(e){var r=e[0],i=r.trace,n=u.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){u.select(this).call(d,o,i,A)})})}}),mS=Vt(K=>{var V=Uu();K.name="pie",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),gS=Vt((K,V)=>{V.exports={attributes:x0(),supplyDefaults:_0().supplyDefaults,supplyLayoutDefaults:hS(),layoutAttributes:V1(),calc:Nm().calc,crossTraceCalc:Nm().crossTraceCalc,plot:H1().plot,style:dS(),styleOne:Tm(),moduleType:"trace",name:"pie",basePlotModule:mS(),categories:["pie-like","pie","showLegend"],meta:{}}}),vS=Vt((K,V)=>{V.exports=gS()}),yS=Vt(K=>{var V=Uu();K.name="sunburst",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),iw=Vt((K,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),iv=Vt((K,V)=>{var u=kl(),{hovertemplateAttrs:d,texttemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Wl(),e=Vu().attributes,r=x0(),i=iw(),n=So().extendFlat,o=If().pattern;V.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:n({colors:{valType:"data_array",editType:"calc"},line:{color:n({},r.marker.line.color,{dflt:null}),width:n({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:o,editType:"calc"},t("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:E({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:A({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},u.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:d({},{keys:i.eventDataKeys}),hovertemplatefallback:A(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:n({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}),ow=Vt((K,V)=>{V.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),xS=Vt((K,V)=>{var u=Xr(),d=iv(),E=Vu().defaults,A=Ih().handleText,t=_0().handleMarkerDefaults,e=xu(),r=e.hasColorscale,i=e.handleDefaults;V.exports=function(n,o,a,s){function f(y,S){return u.coerce(n,o,d,y,S)}var v=f("labels"),g=f("parents");if(!v||!v.length||!g||!g.length){o.visible=!1;return}var m=f("values");m&&m.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),t(n,o,s,f);var w=o._hasColorscale=r(n,"marker","colors")||(n.marker||{}).coloraxis;w&&i(n,o,s,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",w?1:.7);var l=f("text");f("texttemplate"),f("texttemplatefallback"),o.texttemplate||f("textinfo",u.isArrayOrTypedArray(l)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var x="auto";A(n,o,s,f,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),E(o,s,f),o._length=null}}),_S=Vt((K,V)=>{var u=Xr(),d=ow();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("sunburstcolorway",A.colorway),t("extendsunburstcolors")}}),ov=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){function d(_t,lt){return _t.parent===lt.parent?1:2}function E(_t){return _t.reduce(A,0)/_t.length}function A(_t,lt){return _t+lt.x}function t(_t){return 1+_t.reduce(e,0)}function e(_t,lt){return Math.max(_t,lt.y)}function r(_t){for(var lt;lt=_t.children;)_t=lt[0];return _t}function i(_t){for(var lt;lt=_t.children;)_t=lt[lt.length-1];return _t}function n(){var _t=d,lt=1,yt=1,St=!1;function Ht(Yt){var se,ke=0;Yt.eachAfter(function(Ye){var Er=Ye.children;Er?(Ye.x=E(Er),Ye.y=t(Er)):(Ye.x=se?ke+=_t(Ye,se):0,Ye.y=0,se=Ye)});var Ee=r(Yt),Ue=i(Yt),ir=Ee.x-_t(Ee,Ue)/2,ar=Ue.x+_t(Ue,Ee)/2;return Yt.eachAfter(St?function(Ye){Ye.x=(Ye.x-Yt.x)*lt,Ye.y=(Yt.y-Ye.y)*yt}:function(Ye){Ye.x=(Ye.x-ir)/(ar-ir)*lt,Ye.y=(1-(Yt.y?Ye.y/Yt.y:1))*yt})}return Ht.separation=function(Yt){return arguments.length?(_t=Yt,Ht):_t},Ht.size=function(Yt){return arguments.length?(St=!1,lt=+Yt[0],yt=+Yt[1],Ht):St?null:[lt,yt]},Ht.nodeSize=function(Yt){return arguments.length?(St=!0,lt=+Yt[0],yt=+Yt[1],Ht):St?[lt,yt]:null},Ht}function o(_t){var lt=0,yt=_t.children,St=yt&&yt.length;if(!St)lt=1;else for(;--St>=0;)lt+=yt[St].value;_t.value=lt}function a(){return this.eachAfter(o)}function s(_t){var lt=this,yt,St=[lt],Ht,Yt,se;do for(yt=St.reverse(),St=[];lt=yt.pop();)if(_t(lt),Ht=lt.children,Ht)for(Yt=0,se=Ht.length;Yt=0;--Ht)yt.push(St[Ht]);return this}function v(_t){for(var lt=this,yt=[lt],St=[],Ht,Yt,se;lt=yt.pop();)if(St.push(lt),Ht=lt.children,Ht)for(Yt=0,se=Ht.length;Yt=0;)yt+=St[Ht].value;lt.value=yt})}function m(_t){return this.eachBefore(function(lt){lt.children&<.children.sort(_t)})}function w(_t){for(var lt=this,yt=l(lt,_t),St=[lt];lt!==yt;)lt=lt.parent,St.push(lt);for(var Ht=St.length;_t!==yt;)St.splice(Ht,0,_t),_t=_t.parent;return St}function l(_t,lt){if(_t===lt)return _t;var yt=_t.ancestors(),St=lt.ancestors(),Ht=null;for(_t=yt.pop(),lt=St.pop();_t===lt;)Ht=_t,_t=yt.pop(),lt=St.pop();return Ht}function x(){for(var _t=this,lt=[_t];_t=_t.parent;)lt.push(_t);return lt}function y(){var _t=[];return this.each(function(lt){_t.push(lt)}),_t}function S(){var _t=[];return this.eachBefore(function(lt){lt.children||_t.push(lt)}),_t}function k(){var _t=this,lt=[];return _t.each(function(yt){yt!==_t&<.push({source:yt.parent,target:yt})}),lt}function M(_t,lt){var yt=new _(_t),St=+_t.value&&(yt.value=_t.value),Ht,Yt=[yt],se,ke,Ee,Ue;for(lt==null&&(lt=c);Ht=Yt.pop();)if(St&&(Ht.value=+Ht.data.value),(ke=lt(Ht.data))&&(Ue=ke.length))for(Ht.children=new Array(Ue),Ee=Ue-1;Ee>=0;--Ee)Yt.push(se=Ht.children[Ee]=new _(ke[Ee])),se.parent=Ht,se.depth=Ht.depth+1;return yt.eachBefore(b)}function T(){return M(this).eachBefore(h)}function c(_t){return _t.children}function h(_t){_t.data=_t.data.data}function b(_t){var lt=0;do _t.height=lt;while((_t=_t.parent)&&_t.height<++lt)}function _(_t){this.data=_t,this.depth=this.height=0,this.parent=null}_.prototype=M.prototype={constructor:_,count:a,each:s,eachAfter:v,eachBefore:f,sum:g,sort:m,path:w,ancestors:x,descendants:y,leaves:S,links:k,copy:T};var P=Array.prototype.slice;function z(_t){for(var lt=_t.length,yt,St;lt;)St=Math.random()*lt--|0,yt=_t[lt],_t[lt]=_t[St],_t[St]=yt;return _t}function D(_t){for(var lt=0,yt=(_t=z(P.call(_t))).length,St=[],Ht,Yt;lt0&&yt*yt>St*St+Ht*Ht}function F(_t,lt){for(var yt=0;ytEe?(Ht=(Ue+Ee-Yt)/(2*Ue),ke=Math.sqrt(Math.max(0,Ee/Ue-Ht*Ht)),yt.x=_t.x-Ht*St-ke*se,yt.y=_t.y-Ht*se+ke*St):(Ht=(Ue+Yt-Ee)/(2*Ue),ke=Math.sqrt(Math.max(0,Yt/Ue-Ht*Ht)),yt.x=lt.x+Ht*St-ke*se,yt.y=lt.y+Ht*se+ke*St)):(yt.x=lt.x+yt.r,yt.y=lt.y)}function st(_t,lt){var yt=_t.r+lt.r-1e-6,St=lt.x-_t.x,Ht=lt.y-_t.y;return yt>0&&yt*yt>St*St+Ht*Ht}function et(_t){var lt=_t._,yt=_t.next._,St=lt.r+yt.r,Ht=(lt.x*yt.r+yt.x*lt.r)/St,Yt=(lt.y*yt.r+yt.y*lt.r)/St;return Ht*Ht+Yt*Yt}function Z(_t){this._=_t,this.next=null,this.previous=null}function ot(_t){if(!(Ht=_t.length))return 0;var lt,yt,St,Ht,Yt,se,ke,Ee,Ue,ir,ar;if(lt=_t[0],lt.x=0,lt.y=0,!(Ht>1))return lt.r;if(yt=_t[1],lt.x=-yt.r,yt.x=lt.r,yt.y=0,!(Ht>2))return lt.r+yt.r;ct(yt,lt,St=_t[2]),lt=new Z(lt),yt=new Z(yt),St=new Z(St),lt.next=St.previous=yt,yt.next=lt.previous=St,St.next=yt.previous=lt;t:for(ke=3;ke0)throw new Error("cycle");return ke}return yt.id=function(St){return arguments.length?(_t=ut(St),yt):_t},yt.parentId=function(St){return arguments.length?(lt=ut(St),yt):lt},yt}function vt(_t,lt){return _t.parent===lt.parent?1:2}function Ut(_t){var lt=_t.children;return lt?lt[0]:_t.t}function re(_t){var lt=_t.children;return lt?lt[lt.length-1]:_t.t}function Kt(_t,lt,yt){var St=yt/(lt.i-_t.i);lt.c-=St,lt.s+=yt,_t.c+=St,lt.z+=yt,lt.m+=yt}function ue(_t){for(var lt=0,yt=0,St=_t.children,Ht=St.length,Yt;--Ht>=0;)Yt=St[Ht],Yt.z+=lt,Yt.m+=lt,lt+=Yt.s+(yt+=Yt.c)}function Me(_t,lt,yt){return _t.a.parent===lt.parent?_t.a:yt}function Ce(_t,lt){this._=_t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=lt}Ce.prototype=Object.create(_.prototype);function We(_t){for(var lt=new Ce(_t,0),yt,St=[lt],Ht,Yt,se,ke;yt=St.pop();)if(Yt=yt._.children)for(yt.children=new Array(ke=Yt.length),se=ke-1;se>=0;--se)St.push(Ht=yt.children[se]=new Ce(Yt[se],se)),Ht.parent=yt;return(lt.parent=new Ce(null,0)).children=[lt],lt}function qe(){var _t=vt,lt=1,yt=1,St=null;function Ht(Ue){var ir=We(Ue);if(ir.eachAfter(Yt),ir.parent.m=-ir.z,ir.eachBefore(se),St)Ue.eachBefore(Ee);else{var ar=Ue,Ye=Ue,Er=Ue;Ue.eachBefore(function(En){En.xYe.x&&(Ye=En),En.depth>Er.depth&&(Er=En)});var pn=ar===Ye?1:_t(ar,Ye)/2,dn=pn-ar.x,bn=lt/(Ye.x+pn+dn),Zn=yt/(Er.depth||1);Ue.eachBefore(function(En){En.x=(En.x+dn)*bn,En.y=En.depth*Zn})}return Ue}function Yt(Ue){var ir=Ue.children,ar=Ue.parent.children,Ye=Ue.i?ar[Ue.i-1]:null;if(ir){ue(Ue);var Er=(ir[0].z+ir[ir.length-1].z)/2;Ye?(Ue.z=Ye.z+_t(Ue._,Ye._),Ue.m=Ue.z-Er):Ue.z=Er}else Ye&&(Ue.z=Ye.z+_t(Ue._,Ye._));Ue.parent.A=ke(Ue,Ye,Ue.parent.A||ar[0])}function se(Ue){Ue._.x=Ue.z+Ue.parent.m,Ue.m+=Ue.parent.m}function ke(Ue,ir,ar){if(ir){for(var Ye=Ue,Er=Ue,pn=ir,dn=Ye.parent.children[0],bn=Ye.m,Zn=Er.m,En=pn.m,gn=dn.m,da;pn=re(pn),Ye=Ut(Ye),pn&&Ye;)dn=Ut(dn),Er=re(Er),Er.a=Ue,da=pn.z+En-Ye.z-bn+_t(pn._,Ye._),da>0&&(Kt(Me(pn,Ue,ar),Ue,da),bn+=da,Zn+=da),En+=pn.m,bn+=Ye.m,gn+=dn.m,Zn+=Er.m;pn&&!re(Er)&&(Er.t=pn,Er.m+=En-Zn),Ye&&!Ut(dn)&&(dn.t=Ye,dn.m+=bn-gn,ar=Ue)}return ar}function Ee(Ue){Ue.x*=lt,Ue.y=Ue.depth*yt}return Ht.separation=function(Ue){return arguments.length?(_t=Ue,Ht):_t},Ht.size=function(Ue){return arguments.length?(St=!1,lt=+Ue[0],yt=+Ue[1],Ht):St?null:[lt,yt]},Ht.nodeSize=function(Ue){return arguments.length?(St=!0,lt=+Ue[0],yt=+Ue[1],Ht):St?[lt,yt]:null},Ht}function vr(_t,lt,yt,St,Ht){for(var Yt=_t.children,se,ke=-1,Ee=Yt.length,Ue=_t.value&&(Ht-yt)/_t.value;++keEn&&(En=Ue),Se=bn*bn*ra,gn=Math.max(En/Se,Se/Zn),gn>da){bn-=Ue;break}da=gn}se.push(Ee={value:bn,dice:Er1?St:1)},yt})(_r);function Ir(){var _t=Mr,lt=!1,yt=1,St=1,Ht=[0],Yt=J,se=J,ke=J,Ee=J,Ue=J;function ir(Ye){return Ye.x0=Ye.y0=0,Ye.x1=yt,Ye.y1=St,Ye.eachBefore(ar),Ht=[0],lt&&Ye.eachBefore(Ct),Ye}function ar(Ye){var Er=Ht[Ye.depth],pn=Ye.x0+Er,dn=Ye.y0+Er,bn=Ye.x1-Er,Zn=Ye.y1-Er;bn=Ye-1){var En=Yt[ar];En.x0=pn,En.y0=dn,En.x1=bn,En.y1=Zn;return}for(var gn=Ue[ar],da=Er/2+gn,ra=ar+1,Se=Ye-1;ra>>1;Ue[Re]Zn-dn){var zr=(pn*tr+bn*Ze)/Er;ir(ar,ra,Ze,pn,dn,zr,Zn),ir(ra,Ye,tr,zr,dn,bn,Zn)}else{var tn=(dn*tr+Zn*Ze)/Er;ir(ar,ra,Ze,pn,dn,bn,tn),ir(ra,Ye,tr,pn,tn,bn,Zn)}}}function Dt(_t,lt,yt,St,Ht){(_t.depth&1?vr:It)(_t,lt,yt,St,Ht)}var qt=(function _t(lt){function yt(St,Ht,Yt,se,ke){if((Ee=St._squarify)&&Ee.ratio===lt)for(var Ee,Ue,ir,ar,Ye=-1,Er,pn=Ee.length,dn=St.value;++Ye1?St:1)},yt})(_r);u.cluster=n,u.hierarchy=M,u.pack=nt,u.packEnclose=D,u.packSiblings=X,u.partition=Nt,u.stratify=bt,u.tree=qe,u.treemap=Ir,u.treemapBinary=de,u.treemapDice=It,u.treemapResquarify=qt,u.treemapSlice=vr,u.treemapSliceDice=Dt,u.treemapSquarify=Mr,Object.defineProperty(u,"__esModule",{value:!0})})}),sv=Vt(K=>{var V=ov(),u=Lo(),d=Xr(),E=xu().makeColorScaleFuncFromTrace,A=Nm().makePullColorFn,t=Nm().generateExtendedColors,e=xu().calc,r=ks().ALMOST_EQUAL,i={},n={},o={};K.calc=function(s,f){var v=s._fullLayout,g=f.ids,m=d.isArrayOrTypedArray(g),w=f.labels,l=f.parents,x=f.values,y=d.isArrayOrTypedArray(x),S=[],k={},M={},T=function(X,Q){k[X]?k[X].push(Q):k[X]=[Q],M[Q]=1},c=function(X){return X||typeof X=="number"},h=function(X){return!y||u(x[X])&&x[X]>=0},b,_,P;m?(b=Math.min(g.length,l.length),_=function(X){return c(g[X])&&h(X)},P=function(X){return String(g[X])}):(b=Math.min(w.length,l.length),_=function(X){return c(w[X])&&h(X)},P=function(X){return String(w[X])}),y&&(b=Math.min(b,x.length));for(var z=0;z1){for(var I=d.randstr(),F=0;F{});function Rp(){}function sw(){return this.rgb().formatHex()}function bS(){return this.rgb().formatHex8()}function wS(){return pw(this).formatHsl()}function lw(){return this.rgb().formatRgb()}function Um(K){var V,u;return K=(K+"").trim().toLowerCase(),(V=mw.exec(K))?(u=V[1].length,V=parseInt(V[1],16),u===6?uw(V):u===3?new Df(V>>8&15|V>>4&240,V>>4&15|V&240,(V&15)<<4|V&15,1):u===8?lv(V>>24&255,V>>16&255,V>>8&255,(V&255)/255):u===4?lv(V>>12&15|V>>8&240,V>>8&15|V>>4&240,V>>4&15|V&240,((V&15)<<4|V&15)/255):null):(V=gw.exec(K))?new Df(V[1],V[2],V[3],1):(V=vw.exec(K))?new Df(V[1]*255/100,V[2]*255/100,V[3]*255/100,1):(V=yw.exec(K))?lv(V[1],V[2],V[3],V[4]):(V=xw.exec(K))?lv(V[1]*255/100,V[2]*255/100,V[3]*255/100,V[4]):(V=_w.exec(K))?hw(V[1],V[2]/100,V[3]/100,1):(V=bw.exec(K))?hw(V[1],V[2]/100,V[3]/100,V[4]):K1.hasOwnProperty(K)?uw(K1[K]):K==="transparent"?new Df(NaN,NaN,NaN,0):null}function uw(K){return new Df(K>>16&255,K>>8&255,K&255,1)}function lv(K,V,u,d){return d<=0&&(K=V=u=NaN),new Df(K,V,u,d)}function W1(K){return K instanceof Rp||(K=Um(K)),K?(K=K.rgb(),new Df(K.r,K.g,K.b,K.opacity)):new Df}function uv(K,V,u,d){return arguments.length===1?W1(K):new Df(K,V,u,d??1)}function Df(K,V,u,d){this.r=+K,this.g=+V,this.b=+u,this.opacity=+d}function cw(){return`#${Id(this.r)}${Id(this.g)}${Id(this.b)}`}function TS(){return`#${Id(this.r)}${Id(this.g)}${Id(this.b)}${Id((isNaN(this.opacity)?1:this.opacity)*255)}`}function fw(){let K=cv(this.opacity);return`${K===1?"rgb(":"rgba("}${Cd(this.r)}, ${Cd(this.g)}, ${Cd(this.b)}${K===1?")":`, ${K})`}`}function cv(K){return isNaN(K)?1:Math.max(0,Math.min(1,K))}function Cd(K){return Math.max(0,Math.min(255,Math.round(K)||0))}function Id(K){return K=Cd(K),(K<16?"0":"")+K.toString(16)}function hw(K,V,u,d){return d<=0?K=V=u=NaN:u<=0||u>=1?K=V=NaN:V<=0&&(K=NaN),new qh(K,V,u,d)}function pw(K){if(K instanceof qh)return new qh(K.h,K.s,K.l,K.opacity);if(K instanceof Rp||(K=Um(K)),!K)return new qh;if(K instanceof qh)return K;K=K.rgb();var V=K.r/255,u=K.g/255,d=K.b/255,E=Math.min(V,u,d),A=Math.max(V,u,d),t=NaN,e=A-E,r=(A+E)/2;return e?(V===A?t=(u-d)/e+(u0&&r<1?0:t,new qh(t,e,r,K.opacity)}function G1(K,V,u,d){return arguments.length===1?pw(K):new qh(K,V,u,d??1)}function qh(K,V,u,d){this.h=+K,this.s=+V,this.l=+u,this.opacity=+d}function dw(K){return K=(K||0)%360,K<0?K+360:K}function fv(K){return Math.max(0,Math.min(1,K||0))}function Z1(K,V,u){return(K<60?V+(u-V)*K/60:K<180?u:K<240?V+(u-V)*(240-K)/60:V)*255}var Np,Pd,Od,w0,Wh,mw,gw,vw,yw,xw,_w,bw,K1,Y1=Bl(()=>{q1(),Np=.7,Pd=1/Np,Od="\\s*([+-]?\\d+)\\s*",w0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mw=/^#([0-9a-f]{3,8})$/,gw=new RegExp(`^rgb\\(${Od},${Od},${Od}\\)$`),vw=new RegExp(`^rgb\\(${Wh},${Wh},${Wh}\\)$`),yw=new RegExp(`^rgba\\(${Od},${Od},${Od},${w0}\\)$`),xw=new RegExp(`^rgba\\(${Wh},${Wh},${Wh},${w0}\\)$`),_w=new RegExp(`^hsl\\(${w0},${Wh},${Wh}\\)$`),bw=new RegExp(`^hsla\\(${w0},${Wh},${Wh},${w0}\\)$`),K1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},b0(Rp,Um,{copy(K){return Object.assign(new this.constructor,this,K)},displayable(){return this.rgb().displayable()},hex:sw,formatHex:sw,formatHex8:bS,formatHsl:wS,formatRgb:lw,toString:lw}),b0(Df,uv,jm(Rp,{brighter(K){return K=K==null?Pd:Math.pow(Pd,K),new Df(this.r*K,this.g*K,this.b*K,this.opacity)},darker(K){return K=K==null?Np:Math.pow(Np,K),new Df(this.r*K,this.g*K,this.b*K,this.opacity)},rgb(){return this},clamp(){return new Df(Cd(this.r),Cd(this.g),Cd(this.b),cv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cw,formatHex:cw,formatHex8:TS,formatRgb:fw,toString:fw})),b0(qh,G1,jm(Rp,{brighter(K){return K=K==null?Pd:Math.pow(Pd,K),new qh(this.h,this.s,this.l*K,this.opacity)},darker(K){return K=K==null?Np:Math.pow(Np,K),new qh(this.h,this.s,this.l*K,this.opacity)},rgb(){var K=this.h%360+(this.h<0)*360,V=isNaN(K)||isNaN(this.s)?0:this.s,u=this.l,d=u+(u<.5?u:1-u)*V,E=2*u-d;return new Df(Z1(K>=240?K-240:K+120,E,d),Z1(K,E,d),Z1(K<120?K+240:K-120,E,d),this.opacity)},clamp(){return new qh(dw(this.h),fv(this.s),fv(this.l),cv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let K=cv(this.opacity);return`${K===1?"hsl(":"hsla("}${dw(this.h)}, ${fv(this.s)*100}%, ${fv(this.l)*100}%${K===1?")":`, ${K})`}`}}))}),X1,$1,ww=Bl(()=>{X1=Math.PI/180,$1=180/Math.PI});function Tw(K){if(K instanceof np)return new np(K.l,K.a,K.b,K.opacity);if(K instanceof xp)return kw(K);K instanceof Df||(K=W1(K));var V=rx(K.r),u=rx(K.g),d=rx(K.b),E=Q1((.2225045*V+.7168786*u+.0606169*d)/ix),A,t;return V===u&&u===d?A=t=E:(A=Q1((.4360747*V+.3850649*u+.1430804*d)/ax),t=Q1((.0139322*V+.0971045*u+.7141733*d)/ox)),new np(116*E-16,500*(A-E),200*(E-t),K.opacity)}function J1(K,V,u,d){return arguments.length===1?Tw(K):new np(K,V,u,d??1)}function np(K,V,u,d){this.l=+K,this.a=+V,this.b=+u,this.opacity=+d}function Q1(K){return K>Aw?Math.pow(K,.3333333333333333):K/lx+sx}function tx(K){return K>Dd?K*K*K:lx*(K-sx)}function ex(K){return 255*(K<=.0031308?12.92*K:1.055*Math.pow(K,.4166666666666667)-.055)}function rx(K){return(K/=255)<=.04045?K/12.92:Math.pow((K+.055)/1.055,2.4)}function kS(K){if(K instanceof xp)return new xp(K.h,K.c,K.l,K.opacity);if(K instanceof np||(K=Tw(K)),K.a===0&&K.b===0)return new xp(NaN,0{q1(),Y1(),ww(),Vm=18,ax=.96422,ix=1,ox=.82521,sx=4/29,Dd=6/29,lx=3*Dd*Dd,Aw=Dd*Dd*Dd,b0(np,J1,jm(Rp,{brighter(K){return new np(this.l+Vm*(K??1),this.a,this.b,this.opacity)},darker(K){return new np(this.l-Vm*(K??1),this.a,this.b,this.opacity)},rgb(){var K=(this.l+16)/116,V=isNaN(this.a)?K:K+this.a/500,u=isNaN(this.b)?K:K-this.b/200;return V=ax*tx(V),K=ix*tx(K),u=ox*tx(u),new Df(ex(3.1338561*V-1.6168667*K-.4906146*u),ex(-.9787684*V+1.9161415*K+.033454*u),ex(.0719453*V-.2289914*K+1.4052427*u),this.opacity)}})),b0(xp,nx,jm(Rp,{brighter(K){return new xp(this.h,this.c,this.l+Vm*(K??1),this.opacity)},darker(K){return new xp(this.h,this.c,this.l-Vm*(K??1),this.opacity)},rgb(){return kw(this).rgb()}}))});function MS(K){if(K instanceof Fd)return new Fd(K.h,K.s,K.l,K.opacity);K instanceof Df||(K=W1(K));var V=K.r/255,u=K.g/255,d=K.b/255,E=(px*d+fx*V-hx*u)/(px+fx-hx),A=d-E,t=(T0*(u-E)-pv*A)/Hm,e=Math.sqrt(t*t+A*A)/(T0*E*(1-E)),r=e?Math.atan2(t,A)*$1-120:NaN;return new Fd(r<0?r+360:r,e,E,K.opacity)}function ux(K,V,u,d){return arguments.length===1?MS(K):new Fd(K,V,u,d??1)}function Fd(K,V,u,d){this.h=+K,this.s=+V,this.l=+u,this.opacity=+d}var cx,hv,pv,Hm,T0,fx,hx,px,SS=Bl(()=>{q1(),Y1(),ww(),cx=-.14861,hv=1.78277,pv=-.29227,Hm=-.90649,T0=1.97294,fx=T0*Hm,hx=T0*hv,px=hv*pv-Hm*cx,b0(Fd,ux,jm(Rp,{brighter(K){return K=K==null?Pd:Math.pow(Pd,K),new Fd(this.h,this.s,this.l*K,this.opacity)},darker(K){return K=K==null?Np:Math.pow(Np,K),new Fd(this.h,this.s,this.l*K,this.opacity)},rgb(){var K=isNaN(this.h)?0:(this.h+120)*X1,V=+this.l,u=isNaN(this.s)?0:this.s*V*(1-V),d=Math.cos(K),E=Math.sin(K);return new Df(255*(V+u*(cx*d+hv*E)),255*(V+u*(pv*d+Hm*E)),255*(V+u*(T0*d)),this.opacity)}}))}),k0=Bl(()=>{Y1(),AS(),SS()});function Mw(K,V,u,d,E){var A=K*K,t=A*K;return((1-3*K+3*A-t)*V+(4-6*A+3*t)*u+(1+3*K+3*A-3*t)*d+t*E)/6}function Sw(K){var V=K.length-1;return function(u){var d=u<=0?u=0:u>=1?(u=1,V-1):Math.floor(u*V),E=K[d],A=K[d+1],t=d>0?K[d-1]:2*E-A,e=d{});function Ew(K){var V=K.length;return function(u){var d=Math.floor(((u%=1)<0?++u:u)*V),E=K[(d+V-1)%V],A=K[d%V],t=K[(d+1)%V],e=K[(d+2)%V];return Mw((u-d/V)*V,E,A,t,e)}}var zw=Bl(()=>{dx()}),qm,Lw=Bl(()=>{qm=K=>()=>K});function Cw(K,V){return function(u){return K+u*V}}function ES(K,V,u){return K=Math.pow(K,u),V=Math.pow(V,u)-K,u=1/u,function(d){return Math.pow(K+d*V,u)}}function dv(K,V){var u=V-K;return u?Cw(K,u>180||u<-180?u-360*Math.round(u/360):u):qm(isNaN(K)?V:K)}function zS(K){return(K=+K)==1?Ff:function(V,u){return u-V?ES(V,u,K):qm(isNaN(V)?u:V)}}function Ff(K,V){var u=V-K;return u?Cw(K,u):qm(isNaN(K)?V:K)}var A0=Bl(()=>{Lw()});function Iw(K){return function(V){var u=V.length,d=new Array(u),E=new Array(u),A=new Array(u),t,e;for(t=0;t{k0(),dx(),zw(),A0(),mv=(function K(V){var u=zS(V);function d(E,A){var t=u((E=uv(E)).r,(A=uv(A)).r),e=u(E.g,A.g),r=u(E.b,A.b),i=Ff(E.opacity,A.opacity);return function(n){return E.r=t(n),E.g=e(n),E.b=r(n),E.opacity=i(n),E+""}}return d.gamma=K,d})(1),Pw=Iw(Sw),Ow=Iw(Ew)});function mx(K,V){V||(V=[]);var u=K?Math.min(V.length,K.length):0,d=V.slice(),E;return function(A){for(E=0;E{});function LS(K,V){return(Fw(V)?mx:Bw)(K,V)}function Bw(K,V){var u=V?V.length:0,d=K?Math.min(u,K.length):0,E=new Array(d),A=new Array(u),t;for(t=0;t{_v(),gx()});function Nw(K,V){var u=new Date;return K=+K,V=+V,function(d){return u.setTime(K*(1-d)+V*d),u}}var jw=Bl(()=>{});function ap(K,V){return K=+K,V=+V,function(u){return K*(1-u)+V*u}}var gv=Bl(()=>{});function Uw(K,V){var u={},d={},E;(K===null||typeof K!="object")&&(K={}),(V===null||typeof V!="object")&&(V={});for(E in V)E in K?u[E]=xv(K[E],V[E]):d[E]=V[E];return function(A){for(E in u)d[E]=u[E](A);return d}}var Vw=Bl(()=>{_v()});function CS(K){return function(){return K}}function IS(K){return function(V){return K(V)+""}}function Hw(K,V){var u=vv.lastIndex=yv.lastIndex=0,d,E,A,t=-1,e=[],r=[];for(K=K+"",V=V+"";(d=vv.exec(K))&&(E=yv.exec(V));)(A=E.index)>u&&(A=V.slice(u,A),e[t]?e[t]+=A:e[++t]=A),(d=d[0])===(E=E[0])?e[t]?e[t]+=E:e[++t]=E:(e[++t]=null,r.push({i:t,x:ap(d,E)})),u=yv.lastIndex;return u{gv(),vv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yv=new RegExp(vv.source,"g")});function xv(K,V){var u=typeof V,d;return V==null||u==="boolean"?qm(V):(u==="number"?ap:u==="string"?(d=Um(V))?(V=d,mv):Hw:V instanceof Um?mv:V instanceof Date?Nw:Fw(V)?mx:Array.isArray(V)?Bw:typeof V.valueOf!="function"&&typeof V.toString!="function"||isNaN(V)?Uw:ap)(K,V)}var _v=Bl(()=>{k0(),Dw(),Rw(),jw(),gv(),Vw(),qw(),Lw(),gx()});function PS(K){var V=K.length;return function(u){return K[Math.max(0,Math.min(V-1,Math.floor(u*V)))]}}var OS=Bl(()=>{});function DS(K,V){var u=dv(+K,+V);return function(d){var E=u(d);return E-360*Math.floor(E/360)}}var FS=Bl(()=>{A0()});function BS(K,V){return K=+K,V=+V,function(u){return Math.round(K*(1-u)+V*u)}}var RS=Bl(()=>{});function Ww(K,V,u,d,E,A){var t,e,r;return(t=Math.sqrt(K*K+V*V))&&(K/=t,V/=t),(r=K*u+V*d)&&(u-=K*r,d-=V*r),(e=Math.sqrt(u*u+d*d))&&(u/=e,d/=e,r/=e),K*d{vx=180/Math.PI,bv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function jS(K){let V=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(K+"");return V.isIdentity?bv:Ww(V.a,V.b,V.c,V.d,V.e,V.f)}function US(K){return K==null?bv:(wv||(wv=document.createElementNS("http://www.w3.org/2000/svg","g")),wv.setAttribute("transform",K),(K=wv.transform.baseVal.consolidate())?(K=K.matrix,Ww(K.a,K.b,K.c,K.d,K.e,K.f)):bv)}var wv,VS=Bl(()=>{NS()});function Gw(K,V,u,d){function E(i){return i.length?i.pop()+" ":""}function A(i,n,o,a,s,f){if(i!==o||n!==a){var v=s.push("translate(",null,V,null,u);f.push({i:v-4,x:ap(i,o)},{i:v-2,x:ap(n,a)})}else(o||a)&&s.push("translate("+o+V+a+u)}function t(i,n,o,a){i!==n?(i-n>180?n+=360:n-i>180&&(i+=360),a.push({i:o.push(E(o)+"rotate(",null,d)-2,x:ap(i,n)})):n&&o.push(E(o)+"rotate("+n+d)}function e(i,n,o,a){i!==n?a.push({i:o.push(E(o)+"skewX(",null,d)-2,x:ap(i,n)}):n&&o.push(E(o)+"skewX("+n+d)}function r(i,n,o,a,s,f){if(i!==o||n!==a){var v=s.push(E(s)+"scale(",null,",",null,")");f.push({i:v-4,x:ap(i,o)},{i:v-2,x:ap(n,a)})}else(o!==1||a!==1)&&s.push(E(s)+"scale("+o+","+a+")")}return function(i,n){var o=[],a=[];return i=K(i),n=K(n),A(i.translateX,i.translateY,n.translateX,n.translateY,o,a),t(i.rotate,n.rotate,o,a),e(i.skewX,n.skewX,o,a),r(i.scaleX,i.scaleY,n.scaleX,n.scaleY,o,a),i=n=null,function(s){for(var f=-1,v=a.length,g;++f{gv(),VS(),Zw=Gw(jS,"px, ","px)","deg)"),Kw=Gw(US,", ",")",")")});function Yw(K){return((K=Math.exp(K))+1/K)/2}function qS(K){return((K=Math.exp(K))-1/K)/2}function WS(K){return((K=Math.exp(2*K))-1)/(K+1)}var Xw,$w,GS=Bl(()=>{Xw=1e-12,$w=(function K(V,u,d){function E(A,t){var e=A[0],r=A[1],i=A[2],n=t[0],o=t[1],a=t[2],s=n-e,f=o-r,v=s*s+f*f,g,m;if(v{k0(),A0(),Qw=Jw(dv),t3=Jw(Ff)});function KS(K,V){var u=Ff((K=J1(K)).l,(V=J1(V)).l),d=Ff(K.a,V.a),E=Ff(K.b,V.b),A=Ff(K.opacity,V.opacity);return function(t){return K.l=u(t),K.a=d(t),K.b=E(t),K.opacity=A(t),K+""}}var YS=Bl(()=>{k0(),A0()});function e3(K){return function(V,u){var d=K((V=nx(V)).h,(u=nx(u)).h),E=Ff(V.c,u.c),A=Ff(V.l,u.l),t=Ff(V.opacity,u.opacity);return function(e){return V.h=d(e),V.c=E(e),V.l=A(e),V.opacity=t(e),V+""}}}var r3,n3,XS=Bl(()=>{k0(),A0(),r3=e3(dv),n3=e3(Ff)});function a3(K){return(function V(u){u=+u;function d(E,A){var t=K((E=ux(E)).h,(A=ux(A)).h),e=Ff(E.s,A.s),r=Ff(E.l,A.l),i=Ff(E.opacity,A.opacity);return function(n){return E.h=t(n),E.s=e(n),E.l=r(Math.pow(n,u)),E.opacity=i(n),E+""}}return d.gamma=V,d})(1)}var i3,o3,$S=Bl(()=>{k0(),A0(),i3=a3(dv),o3=a3(Ff)});function JS(K,V){V===void 0&&(V=K,K=xv);for(var u=0,d=V.length-1,E=V[0],A=new Array(d<0?0:d);u{_v()});function t8(K,V){for(var u=new Array(V),d=0;d{}),Bd={};Z_(Bd,{interpolate:()=>xv,interpolateArray:()=>LS,interpolateBasis:()=>Sw,interpolateBasisClosed:()=>Ew,interpolateCubehelix:()=>i3,interpolateCubehelixLong:()=>o3,interpolateDate:()=>Nw,interpolateDiscrete:()=>PS,interpolateHcl:()=>r3,interpolateHclLong:()=>n3,interpolateHsl:()=>Qw,interpolateHslLong:()=>t3,interpolateHue:()=>DS,interpolateLab:()=>KS,interpolateNumber:()=>ap,interpolateNumberArray:()=>mx,interpolateObject:()=>Uw,interpolateRgb:()=>mv,interpolateRgbBasis:()=>Pw,interpolateRgbBasisClosed:()=>Ow,interpolateRound:()=>BS,interpolateString:()=>Hw,interpolateTransformCss:()=>Zw,interpolateTransformSvg:()=>Kw,interpolateZoom:()=>$w,piecewise:()=>JS,quantize:()=>t8});var M0=Bl(()=>{_v(),Rw(),dx(),zw(),jw(),OS(),FS(),gv(),gx(),Vw(),RS(),qw(),HS(),GS(),Dw(),ZS(),YS(),XS(),$S(),QS(),e8()}),yx=Vt((K,V)=>{var u=Eo(),d=Pi();V.exports=function(E,A,t,e,r){var i=A.data.data,n=i.i,o=r||i.color;if(n>=0){A.i=i.i;var a=t.marker;a.pattern?(!a.colors||!a.pattern.shape)&&(a.color=o,A.color=o):(a.color=o,A.color=o),u.pointStyle(E,t,e,A)}else d.fill(E,o)}}),s3=Vt((K,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=sh().resizeText,t=yx();function e(i){var n=i._fullLayout._sunburstlayer.selectAll(".trace");A(i,n,"sunburst"),n.each(function(o){var a=u.select(this),s=o[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(v){u.select(this).call(r,v,f,i)})})}function r(i,n,o,a){var s=n.data.data,f=!n.children,v=s.i,g=E.castOption(o,v,"marker.line.color")||d.defaultLine,m=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",m).call(d.stroke,g).style("opacity",f?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),jp=Vt(K=>{var V=Xr(),u=Pi(),d=$h(),E=Md();K.findEntryWithLevel=function(r,i){var n;return i&&r.eachAfter(function(o){if(K.getPtId(o)===i)return n=o.copy()}),n||r},K.findEntryWithChild=function(r,i){var n;return r.eachAfter(function(o){for(var a=o.children||[],s=0;s0)},K.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},K.isHeader=function(r,i){return!(K.isLeaf(r)||r.depth===i._maxDepth-1)};function e(r){return r.data.data.pid}K.getParent=function(r,i){return K.findEntryWithLevel(r,e(i))},K.listPath=function(r,i){var n=r.parent;if(!n)return[];var o=i?[n.data[i]]:[n];return K.listPath(n,i).concat(o)},K.getPath=function(r){return K.listPath(r,"label").join("/")+"/"},K.formatValue=E.formatPieValue,K.formatPercent=function(r,i){var n=V.formatPercent(r,0);return n==="0%"&&(n=E.formatPiePercent(r,i)),n}}),Tv=Vt((K,V)=>{var u=Ni(),d=ji(),E=mh().appendArrayPointValue,A=hc(),t=Xr(),e=ym(),r=jp(),i=Md(),n=i.formatPieValue;V.exports=function(a,s,f,v,g){var m=v[0],w=m.trace,l=m.hierarchy,x=w.type==="sunburst",y=w.type==="treemap"||w.type==="icicle";"_hasHoverLabel"in w||(w._hasHoverLabel=!1),"_hasHoverEvent"in w||(w._hasHoverEvent=!1);var S=function(T){var c=f._fullLayout;if(!(f._dragging||c.hovermode===!1)){var h=f._fullData[w.index],b=T.data.data,_=b.i,P=r.isHierarchyRoot(T),z=r.getParent(l,T),D=r.getValue(T),B=function(q){return t.castOption(h,_,q)},R=B("hovertemplate"),I=A.castHoverinfo(h,c,_),F=c.separators,j;if(R||I&&I!=="none"&&I!=="skip"){var N,G;x&&(N=m.cx+T.pxmid[0]*(1-T.rInscribed),G=m.cy+T.pxmid[1]*(1-T.rInscribed)),y&&(N=T._hoverX,G=T._hoverY);var rt={},ct=[],st=[],et=function(q){return ct.indexOf(q)!==-1};I&&(ct=I==="all"?h._module.attributes.hoverinfo.flags:I.split("+")),rt.label=b.label,et("label")&&rt.label&&st.push(rt.label),b.hasOwnProperty("v")&&(rt.value=b.v,rt.valueLabel=n(rt.value,F),et("value")&&st.push(rt.valueLabel)),rt.currentPath=T.currentPath=r.getPath(T.data),et("current path")&&!P&&st.push(rt.currentPath);var Z,ot=[],X=function(){ot.indexOf(Z)===-1&&(st.push(Z),ot.push(Z))};rt.percentParent=T.percentParent=D/r.getValue(z),rt.parent=T.parentString=r.getPtLabel(z),et("percent parent")&&(Z=r.formatPercent(rt.percentParent,F)+" of "+rt.parent,X()),rt.percentEntry=T.percentEntry=D/r.getValue(s),rt.entry=T.entry=r.getPtLabel(s),et("percent entry")&&!P&&!T.onPathbar&&(Z=r.formatPercent(rt.percentEntry,F)+" of "+rt.entry,X()),rt.percentRoot=T.percentRoot=D/r.getValue(l),rt.root=T.root=r.getPtLabel(l),et("percent root")&&!P&&(Z=r.formatPercent(rt.percentRoot,F)+" of "+rt.root,X()),rt.text=B("hovertext")||B("text"),et("text")&&(Z=rt.text,t.isValidTextValue(Z)&&st.push(Z)),j=[o(T,h,g.eventDataKeys)];var Q={trace:h,y:G,_x0:T._x0,_x1:T._x1,_y0:T._y0,_y1:T._y1,text:st.join("
                "),name:R||et("name")?h.name:void 0,color:B("hoverlabel.bgcolor")||b.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:R,hovertemplateLabels:rt,eventData:j};x&&(Q.x0=N-T.rInscribed*T.rpx1,Q.x1=N+T.rInscribed*T.rpx1,Q.idealAlign=T.pxmid[0]<0?"left":"right"),y&&(Q.x=N,Q.idealAlign=N<0?"left":"right");var ut=[];A.loneHover(Q,{container:c._hoverlayer.node(),outerContainer:c._paper.node(),gd:f,inOut_bbox:ut}),j[0].bbox=ut[0],w._hasHoverLabel=!0}if(y){var J=a.select("path.surface");g.styleOne(J,T,h,f,{hovered:!0})}w._hasHoverEvent=!0,f.emit("plotly_hover",{points:j||[o(T,h,g.eventDataKeys)],event:u.event})}},k=function(T){var c=f._fullLayout,h=f._fullData[w.index],b=u.select(this).datum();if(w._hasHoverEvent&&(T.originalEvent=u.event,f.emit("plotly_unhover",{points:[o(b,h,g.eventDataKeys)],event:u.event}),w._hasHoverEvent=!1),w._hasHoverLabel&&(A.loneUnhover(c._hoverlayer.node()),w._hasHoverLabel=!1),y){var _=a.select("path.surface");g.styleOne(_,b,h,f,{hovered:!1})}},M=function(T){var c=f._fullLayout,h=f._fullData[w.index],b=x&&(r.isHierarchyRoot(T)||r.isLeaf(T)),_=r.getPtId(T),P=r.isEntry(T)?r.findEntryWithChild(l,_):r.findEntryWithLevel(l,_),z=r.getPtId(P),D={points:[o(T,h,g.eventDataKeys)],event:u.event};b||(D.nextLevel=z);var B=e.triggerHandler(f,"plotly_"+w.type+"click",D);if(B!==!1&&c.hovermode&&(f._hoverdata=[o(T,h,g.eventDataKeys)],A.click(f,u.event)),!b&&B!==!1&&!f._dragging&&!f._transitioning){d.call("_storeDirectGUIEdit",h,c._tracePreGUI[h.uid],{level:h.level});var R={data:[{level:z}],traces:[w.index]},I={frame:{redraw:!1,duration:g.transitionTime},transition:{duration:g.transitionTime,easing:g.transitionEasing},mode:"immediate",fromcurrent:!0};A.loneUnhover(c._hoverlayer.node()),d.call("animate",f,R,I)}};a.on("mouseover",S),a.on("mouseout",k),a.on("click",M)};function o(a,s,f){for(var v=a.data.data,g={curveNumber:s.index,pointNumber:v.i,data:s._input,fullData:s},m=0;m{var V=Ni(),u=ov(),d=(M0(),yd(Bd)).interpolate,E=Eo(),A=Xr(),t=Dl(),e=sh(),r=e.recordMinTextSize,i=e.clearMinTextSize,n=H1(),o=Md().getRotationAngle,a=n.computeTransform,s=n.transformInsideText,f=s3().styleOne,v=Hh().resizeText,g=Tv(),m=iw(),w=jp();K.plot=function(M,T,c,h){var b=M._fullLayout,_=b._sunburstlayer,P,z,D=!c,B=!b.uniformtext.mode&&w.hasTransition(c);if(i("sunburst",b),P=_.selectAll("g.trace.sunburst").data(T,function(I){return I[0].trace.uid}),P.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),P.order(),B){h&&(z=h());var R=V.transition().duration(c.duration).ease(c.easing).each("end",function(){z&&z()}).each("interrupt",function(){z&&z()});R.each(function(){_.selectAll("g.trace").each(function(I){l(M,I,this,c)})})}else P.each(function(I){l(M,I,this,c)}),b.uniformtext.mode&&v(M,b._sunburstlayer.selectAll(".trace"),"sunburst");D&&P.exit().remove()};function l(M,T,c,h){var b=M._context.staticPlot,_=M._fullLayout,P=!_.uniformtext.mode&&w.hasTransition(h),z=V.select(c),D=z.selectAll("g.slice"),B=T[0],R=B.trace,I=B.hierarchy,F=w.findEntryWithLevel(I,R.level),j=w.getMaxDepth(R),N=_._size,G=R.domain,rt=N.w*(G.x[1]-G.x[0]),ct=N.h*(G.y[1]-G.y[0]),st=.5*Math.min(rt,ct),et=B.cx=N.l+N.w*(G.x[1]+G.x[0])/2,Z=B.cy=N.t+N.h*(1-G.y[0])-ct/2;if(!F)return D.remove();var ot=null,X={};P&&D.each(function(vt){X[w.getPtId(vt)]={rpx0:vt.rpx0,rpx1:vt.rpx1,x0:vt.x0,x1:vt.x1,transform:vt.transform},!ot&&w.isEntry(vt)&&(ot=vt)});var Q=x(F).descendants(),ut=F.height+1,J=0,q=j;B.hasMultipleRoots&&w.isHierarchyRoot(F)&&(Q=Q.slice(1),ut-=1,J=1,q+=1),Q=Q.filter(function(vt){return vt.y1<=q});var it=o(R.rotation);it&&Q.forEach(function(vt){vt.x0+=it,vt.x1+=it});var nt=Math.min(ut,j),dt=function(vt){return(vt-J)/nt*st},Tt=function(vt,Ut){return[vt*Math.cos(Ut),-vt*Math.sin(Ut)]},wt=function(vt){return A.pathAnnulus(vt.rpx0,vt.rpx1,vt.x0,vt.x1,et,Z)},Ct=function(vt){return et+S(vt)[0]*(vt.transform.rCenter||0)+(vt.transform.x||0)},It=function(vt){return Z+S(vt)[1]*(vt.transform.rCenter||0)+(vt.transform.y||0)};D=D.data(Q,w.getPtId),D.enter().append("g").classed("slice",!0),P?D.exit().transition().each(function(){var vt=V.select(this),Ut=vt.select("path.surface");Ut.transition().attrTween("d",function(Kt){var ue=ee(Kt);return function(Me){return wt(ue(Me))}});var re=vt.select("g.slicetext");re.attr("opacity",0)}).remove():D.exit().remove(),D.order();var Nt=null;if(P&&ot){var te=w.getPtId(ot);D.each(function(vt){Nt===null&&w.getPtId(vt)===te&&(Nt=vt.x1)})}var Jt=D;P&&(Jt=Jt.transition().each("end",function(){var vt=V.select(this);w.setSliceCursor(vt,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Jt.each(function(vt){var Ut=V.select(this),re=A.ensureSingle(Ut,"path","surface",function(qe){qe.style("pointer-events",b?"none":"all")});vt.rpx0=dt(vt.y0),vt.rpx1=dt(vt.y1),vt.xmid=(vt.x0+vt.x1)/2,vt.pxmid=Tt(vt.rpx1,vt.xmid),vt.midangle=-(vt.xmid-Math.PI/2),vt.startangle=-(vt.x0-Math.PI/2),vt.stopangle=-(vt.x1-Math.PI/2),vt.halfangle=.5*Math.min(A.angleDelta(vt.x0,vt.x1)||Math.PI,Math.PI),vt.ring=1-vt.rpx0/vt.rpx1,vt.rInscribed=y(vt),P?re.transition().attrTween("d",function(qe){var vr=Zt(qe);return function(_r){return wt(vr(_r))}}):re.attr("d",wt),Ut.call(g,F,M,T,{eventDataKeys:m.eventDataKeys,transitionTime:m.CLICK_TRANSITION_TIME,transitionEasing:m.CLICK_TRANSITION_EASING}).call(w.setSliceCursor,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:M._transitioning}),re.call(f,vt,R,M);var Kt=A.ensureSingle(Ut,"g","slicetext"),ue=A.ensureSingle(Kt,"text","",function(qe){qe.attr("data-notex",1)}),Me=A.ensureUniformFontSize(M,w.determineTextFont(R,vt,_.font));ue.text(K.formatSliceLabel(vt,F,R,T,_)).classed("slicetext",!0).attr("text-anchor","middle").call(E.font,Me).call(t.convertToTspans,M);var Ce=E.bBox(ue.node());vt.transform=s(Ce,vt,B),vt.transform.targetX=Ct(vt),vt.transform.targetY=It(vt);var We=function(qe,vr){var _r=qe.transform;return a(_r,vr),_r.fontSize=Me.size,r(R.type,_r,_),A.getTextTransform(_r)};P?ue.transition().attrTween("transform",function(qe){var vr=mt(qe);return function(_r){return We(vr(_r),Ce)}}):ue.attr("transform",We(vt,Ce))});function ee(vt){var Ut=w.getPtId(vt),re=X[Ut],Kt=X[w.getPtId(F)],ue;if(Kt){var Me=(vt.x1>Kt.x1?2*Math.PI:0)+it;ue=vt.rpx1Nt?2*Math.PI:0)+it;re={x0:ue,x1:ue}}else re={rpx0:st,rpx1:st},A.extendFlat(re,bt(vt));else re={rpx0:0,rpx1:0};else re={x0:it,x1:it};return d(re,Kt)}function mt(vt){var Ut=X[w.getPtId(vt)],re,Kt=vt.transform;if(Ut)re=Ut;else if(re={rpx1:vt.rpx1,transform:{textPosAngle:Kt.textPosAngle,scale:0,rotate:Kt.rotate,rCenter:Kt.rCenter,x:Kt.x,y:Kt.y}},ot)if(vt.parent)if(Nt){var ue=vt.x1>Nt?2*Math.PI:0;re.x0=re.x1=ue}else A.extendFlat(re,bt(vt));else re.x0=re.x1=it;else re.x0=re.x1=it;var Me=d(re.transform.textPosAngle,vt.transform.textPosAngle),Ce=d(re.rpx1,vt.rpx1),We=d(re.x0,vt.x0),qe=d(re.x1,vt.x1),vr=d(re.transform.scale,Kt.scale),_r=d(re.transform.rotate,Kt.rotate),er=Kt.rCenter===0?3:re.transform.rCenter===0?1/3:1,Mr=d(re.transform.rCenter,Kt.rCenter),Ir=function(de){return Mr(Math.pow(de,er))};return function(de){var Dt=Ce(de);We(de),qe(de);var qt=Ir(de),_t=Me(de),lt={rpx1:Dt,transform:{textPosAngle:_t,rCenter:qt,x:Kt.x,y:Kt.y}};return r(R.type,Kt,_),{transform:{targetX:Ct(lt),targetY:It(lt),scale:vr(de),rotate:_r(de),rCenter:qt}}}}function bt(vt){var Ut=vt.parent,re=X[w.getPtId(Ut)],Kt={};if(re){var ue=Ut.children,Me=ue.indexOf(vt),Ce=ue.length,We=d(re.x0,re.x1);Kt.x0=We(Me/Ce),Kt.x1=We(Me/Ce)}else Kt.x0=Kt.x1=0;return Kt}}function x(M){return u.partition().size([2*Math.PI,M.height+1])(M)}K.formatSliceLabel=function(M,T,c,h,b){var _=c.texttemplate,P=c.textinfo;if(!_&&(!P||P==="none"))return"";var z=b.separators,D=h[0],B=M.data.data,R=D.hierarchy,I=w.isHierarchyRoot(M),F=w.getParent(R,M),j=w.getValue(M);if(!_){var N=P.split("+"),G=function(J){return N.indexOf(J)!==-1},rt=[],ct;if(G("label")&&B.label&&rt.push(B.label),B.hasOwnProperty("v")&&G("value")&&rt.push(w.formatValue(B.v,z)),!I){G("current path")&&rt.push(w.getPath(M.data));var st=0;G("percent parent")&&st++,G("percent entry")&&st++,G("percent root")&&st++;var et=st>1;if(st){var Z,ot=function(J){ct=w.formatPercent(Z,z),et&&(ct+=" of "+J),rt.push(ct)};G("percent parent")&&!I&&(Z=j/w.getValue(F),ot("parent")),G("percent entry")&&(Z=j/w.getValue(T),ot("entry")),G("percent root")&&(Z=j/w.getValue(R),ot("root"))}}return G("text")&&(ct=A.castOption(c,B.i,"text"),A.isValidTextValue(ct)&&rt.push(ct)),rt.join("
                ")}var X=A.castOption(c,B.i,"texttemplate");if(!X)return"";var Q={};B.label&&(Q.label=B.label),B.hasOwnProperty("v")&&(Q.value=B.v,Q.valueLabel=w.formatValue(B.v,z)),Q.currentPath=w.getPath(M.data),I||(Q.percentParent=j/w.getValue(F),Q.percentParentLabel=w.formatPercent(Q.percentParent,z),Q.parent=w.getPtLabel(F)),Q.percentEntry=j/w.getValue(T),Q.percentEntryLabel=w.formatPercent(Q.percentEntry,z),Q.entry=w.getPtLabel(T),Q.percentRoot=j/w.getValue(R),Q.percentRootLabel=w.formatPercent(Q.percentRoot,z),Q.root=w.getPtLabel(R),B.hasOwnProperty("color")&&(Q.color=B.color);var ut=A.castOption(c,B.i,"text");return(A.isValidTextValue(ut)||ut==="")&&(Q.text=ut),Q.customdata=A.castOption(c,B.i,"customdata"),A.texttemplateString({data:[Q,c._meta],fallback:c.texttemplatefallback,labels:Q,locale:b._d3locale,template:X})};function y(M){return M.rpx0===0&&A.isFullCircle([M.x0,M.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(M.halfangle)),M.ring/2))}function S(M){return k(M.rpx1,M.transform.textPosAngle)}function k(M,T){return[M*Math.sin(T),-M*Math.cos(T)]}}),r8=Vt((K,V)=>{V.exports={moduleType:"trace",name:"sunburst",basePlotModule:yS(),categories:[],animatable:!0,attributes:iv(),layoutAttributes:ow(),supplyDefaults:xS(),supplyLayoutDefaults:_S(),calc:sv().calc,crossTraceCalc:sv().crossTraceCalc,plot:xx().plot,style:s3().style,colorbar:Zf(),meta:{}}}),n8=Vt((K,V)=>{V.exports=r8()}),a8=Vt(K=>{var V=Uu();K.name="treemap",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),S0=Vt((K,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),_x=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Wl(),t=Vu().attributes,e=x0(),r=iv(),i=S0(),n=So().extendFlat,o=If().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:n({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:r.marker.colors,pattern:o,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:n({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:r.textinfo,texttemplate:d({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:u({},{keys:i.eventDataKeys}),hovertemplatefallback:E(),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:n({},e.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:e.sort,root:r.root,domain:t({name:"treemap",trace:!0,editType:"calc"})}}),l3=Vt((K,V)=>{V.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),i8=Vt((K,V)=>{var u=Xr(),d=_x(),E=Pi(),A=Vu().defaults,t=Ih().handleText,e=p0().TEXTPAD,r=_0().handleMarkerDefaults,i=xu(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,f,v){function g(h,b){return u.coerce(a,s,d,h,b)}var m=g("labels"),w=g("parents");if(!m||!m.length||!w||!w.length){s.visible=!1;return}var l=g("values");l&&l.length?g("branchvalues"):g("count"),g("level"),g("maxdepth");var x=g("tiling.packing");x==="squarify"&&g("tiling.squarifyratio"),g("tiling.flip"),g("tiling.pad");var y=g("text");g("texttemplate"),g("texttemplatefallback"),s.texttemplate||g("textinfo",u.isArrayOrTypedArray(y)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var S=g("pathbar.visible"),k="auto";t(a,s,v,g,k,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition");var M=s.textposition.indexOf("bottom")!==-1;r(a,s,v,g);var T=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;T?o(a,s,v,g,{prefix:"marker.",cLetter:"c"}):g("marker.depthfade",!(s.marker.colors||[]).length);var c=s.textfont.size*2;g("marker.pad.t",M?c/4:c),g("marker.pad.l",c/4),g("marker.pad.r",c/4),g("marker.pad.b",M?c:c/4),g("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},S&&(g("pathbar.thickness",s.pathbar.textfont.size+2*e),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),A(s,v,g),s._length=null}}),o8=Vt((K,V)=>{var u=Xr(),d=l3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("treemapcolorway",A.colorway),t("extendtreemapcolors")}}),u3=Vt(K=>{var V=sv();K.calc=function(u,d){return V.calc(u,d)},K.crossTraceCalc=function(u){return V._runCrossTraceCalc("treemap",u)}}),c3=Vt((K,V)=>{V.exports=function u(d,E,A){var t;A.swapXY&&(t=d.x0,d.x0=d.y0,d.y0=t,t=d.x1,d.x1=d.y1,d.y1=t),A.flipX&&(t=d.x0,d.x0=E[0]-d.x1,d.x1=E[0]-t),A.flipY&&(t=d.y0,d.y0=E[1]-d.y1,d.y1=E[1]-t);var e=d.children;if(e)for(var r=0;r{var u=ov(),d=c3();V.exports=function(A,t,e){var r=e.flipX,i=e.flipY,n=e.packing==="dice-slice",o=e.pad[i?"bottom":"top"],a=e.pad[r?"right":"left"],s=e.pad[r?"left":"right"],f=e.pad[i?"top":"bottom"],v;n&&(v=a,a=o,o=v,v=s,s=f,f=v);var g=u.treemap().tile(E(e.packing,e.squarifyratio)).paddingInner(e.pad.inner).paddingLeft(a).paddingRight(s).paddingTop(o).paddingBottom(f).size(n?[t[1],t[0]]:t)(A);return(n||r||i)&&d(g,t,{swapXY:n,flipX:r,flipY:i}),g};function E(A,t){switch(A){case"squarify":return u.treemapSquarify.ratio(t);case"binary":return u.treemapBinary;case"dice":return u.treemapDice;case"slice":return u.treemapSlice;default:return u.treemapSliceDice}}}),bx=Vt((K,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=jp(),t=sh().resizeText,e=yx();function r(n){var o=n._fullLayout._treemaplayer.selectAll(".trace");t(n,o,"treemap"),o.each(function(a){var s=u.select(this),f=a[0],v=f.trace;s.style("opacity",v.opacity),s.selectAll("path.surface").each(function(g){u.select(this).call(i,g,v,n,{hovered:!1})})})}function i(n,o,a,s,f){var v=(f||{}).hovered,g=o.data.data,m=g.i,w,l,x=g.color,y=A.isHierarchyRoot(o),S=1;if(v)w=a._hovered.marker.line.color,l=a._hovered.marker.line.width;else if(y&&x===a.root.color)S=100,w="rgba(0,0,0,0)",l=0;else if(w=E.castOption(a,m,"marker.line.color")||d.defaultLine,l=E.castOption(a,m,"marker.line.width")||0,!a._hasColorscale&&!o.onPathbar){var k=a.marker.depthfade;if(k){var M=d.combine(d.addOpacity(a._backgroundColor,.75),x),T;if(k===!0){var c=A.getMaxDepth(a);isFinite(c)?A.isLeaf(o)?T=0:T=a._maxVisibleLayers-(o.data.depth-a._entryDepth):T=o.data.height+1}else T=o.data.depth-a._entryDepth,a._atRootLevel||T++;if(T>0)for(var h=0;h{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=f3(),e=bx().styleOne,r=S0(),i=jp(),n=Tv(),o=!0;V.exports=function(a,s,f,v,g){var m=g.barDifY,w=g.width,l=g.height,x=g.viewX,y=g.viewY,S=g.pathSlice,k=g.toMoveInsideSlice,M=g.strTransform,T=g.hasTransition,c=g.handleSlicesExit,h=g.makeUpdateSliceInterpolator,b=g.makeUpdateTextInterpolator,_={},P=a._context.staticPlot,z=a._fullLayout,D=s[0],B=D.trace,R=D.hierarchy,I=w/B._entryDepth,F=i.listPath(f.data,"id"),j=t(R.copy(),[w,l],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();j=j.filter(function(G){var rt=F.indexOf(G.data.id);return rt===-1?!1:(G.x0=I*rt,G.x1=I*(rt+1),G.y0=m,G.y1=m+l,G.onPathbar=!0,!0)}),j.reverse(),v=v.data(j,i.getPtId),v.enter().append("g").classed("pathbar",!0),c(v,o,_,[w,l],S),v.order();var N=v;T&&(N=N.transition().each("end",function(){var G=u.select(this);i.setSliceCursor(G,a,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),N.each(function(G){G._x0=x(G.x0),G._x1=x(G.x1),G._y0=y(G.y0),G._y1=y(G.y1),G._hoverX=x(G.x1-Math.min(w,l)/2),G._hoverY=y(G.y1-l/2);var rt=u.select(this),ct=d.ensureSingle(rt,"path","surface",function(ot){ot.style("pointer-events",P?"none":"all")});T?ct.transition().attrTween("d",function(ot){var X=h(ot,o,_,[w,l]);return function(Q){return S(X(Q))}}):ct.attr("d",S),rt.call(n,f,a,s,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,a,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:a._transitioning}),ct.call(e,G,B,a,{hovered:!1}),G._text=(i.getPtLabel(G)||"").split("
                ").join(" ")||"";var st=d.ensureSingle(rt,"g","slicetext"),et=d.ensureSingle(st,"text","",function(ot){ot.attr("data-notex",1)}),Z=d.ensureUniformFontSize(a,i.determineTextFont(B,G,z.font,{onPathbar:!0}));et.text(G._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(E.font,Z).call(A.convertToTspans,a),G.textBB=E.bBox(et.node()),G.transform=k(G,{fontSize:Z.size,onPathbar:!0}),G.transform.fontSize=Z.size,T?et.transition().attrTween("transform",function(ot){var X=b(ot,o,_,[w,l]);return function(Q){return M(X(Q))}}):et.attr("transform",M(G))})}}),l8=Vt((K,V)=>{var u=Ni(),d=(M0(),yd(Bd)).interpolate,E=jp(),A=Xr(),t=p0().TEXTPAD,e=d0(),r=e.toMoveInsideBar,i=sh(),n=i.recordMinTextSize,o=S0(),a=s8();function s(f){return E.isHierarchyRoot(f)?"":E.getPtId(f)}V.exports=function(f,v,g,m,w){var l=f._fullLayout,x=v[0],y=x.trace,S=y.type,k=S==="icicle",M=x.hierarchy,T=E.findEntryWithLevel(M,y.level),c=u.select(g),h=c.selectAll("g.pathbar"),b=c.selectAll("g.slice");if(!T){h.remove(),b.remove();return}var _=E.isHierarchyRoot(T),P=!l.uniformtext.mode&&E.hasTransition(m),z=E.getMaxDepth(y),D=function(er){return er.data.depth-T.data.depth-1?F+G:-(N+G):0,ct={x0:j,x1:j,y0:rt,y1:rt+N},st=function(er,Mr,Ir){var de=y.tiling.pad,Dt=function(yt){return yt-de<=Mr.x0},qt=function(yt){return yt+de>=Mr.x1},_t=function(yt){return yt-de<=Mr.y0},lt=function(yt){return yt+de>=Mr.y1};return er.x0===Mr.x0&&er.x1===Mr.x1&&er.y0===Mr.y0&&er.y1===Mr.y1?{x0:er.x0,x1:er.x1,y0:er.y0,y1:er.y1}:{x0:Dt(er.x0-de)?0:qt(er.x0-de)?Ir[0]:er.x0,x1:Dt(er.x1+de)?0:qt(er.x1+de)?Ir[0]:er.x1,y0:_t(er.y0-de)?0:lt(er.y0-de)?Ir[1]:er.y0,y1:_t(er.y1+de)?0:lt(er.y1+de)?Ir[1]:er.y1}},et=null,Z={},ot={},X=null,Q=function(er,Mr){return Mr?Z[s(er)]:ot[s(er)]},ut=function(er,Mr,Ir,de){if(Mr)return Z[s(M)]||ct;var Dt=ot[y.level]||Ir;return D(er)?st(er,Dt,de):{}};x.hasMultipleRoots&&_&&z++,y._maxDepth=z,y._backgroundColor=l.paper_bgcolor,y._entryDepth=T.data.depth,y._atRootLevel=_;var J=-I/2+B.l+B.w*(R.x[1]+R.x[0])/2,q=-F/2+B.t+B.h*(1-(R.y[1]+R.y[0])/2),it=function(er){return J+er},nt=function(er){return q+er},dt=nt(0),Tt=it(0),wt=function(er){return Tt+er},Ct=function(er){return dt+er};function It(er,Mr){return er+","+Mr}var Nt=wt(0),te=function(er){er.x=Math.max(Nt,er.x)},Jt=y.pathbar.edgeshape,ee=function(er){var Mr=wt(Math.max(Math.min(er.x0,er.x0),0)),Ir=wt(Math.min(Math.max(er.x1,er.x1),j)),de=Ct(er.y0),Dt=Ct(er.y1),qt=N/2,_t={},lt={};_t.x=Mr,lt.x=Ir,_t.y=lt.y=(de+Dt)/2;var yt={x:Mr,y:de},St={x:Ir,y:de},Ht={x:Ir,y:Dt},Yt={x:Mr,y:Dt};return Jt===">"?(yt.x-=qt,St.x-=qt,Ht.x-=qt,Yt.x-=qt):Jt==="/"?(Ht.x-=qt,Yt.x-=qt,_t.x-=qt/2,lt.x-=qt/2):Jt==="\\"?(yt.x-=qt,St.x-=qt,_t.x-=qt/2,lt.x-=qt/2):Jt==="<"&&(_t.x-=qt,lt.x-=qt),te(yt),te(Yt),te(_t),te(St),te(Ht),te(lt),"M"+It(yt.x,yt.y)+"L"+It(St.x,St.y)+"L"+It(lt.x,lt.y)+"L"+It(Ht.x,Ht.y)+"L"+It(Yt.x,Yt.y)+"L"+It(_t.x,_t.y)+"Z"},Zt=y[k?"tiling":"marker"].pad,mt=function(er){return y.textposition.indexOf(er)!==-1},bt=mt("top"),vt=mt("left"),Ut=mt("right"),re=mt("bottom"),Kt=function(er){var Mr=it(er.x0),Ir=it(er.x1),de=nt(er.y0),Dt=nt(er.y1),qt=Ir-Mr,_t=Dt-de;if(!qt||!_t)return"";var lt=y.marker.cornerradius||0,yt=Math.min(lt,qt/2,_t/2);yt&&er.data&&er.data.data&&er.data.data.label&&(bt&&(yt=Math.min(yt,Zt.t)),vt&&(yt=Math.min(yt,Zt.l)),Ut&&(yt=Math.min(yt,Zt.r)),re&&(yt=Math.min(yt,Zt.b)));var St=function(Ht,Yt){return yt?"a"+It(yt,yt)+" 0 0 1 "+It(Ht,Yt):""};return"M"+It(Mr,de+yt)+St(yt,-yt)+"L"+It(Ir-yt,de)+St(yt,yt)+"L"+It(Ir,Dt-yt)+St(-yt,yt)+"L"+It(Mr+yt,Dt)+St(-yt,-yt)+"Z"},ue=function(er,Mr){var Ir=er.x0,de=er.x1,Dt=er.y0,qt=er.y1,_t=er.textBB,lt=bt||Mr.isHeader&&!re,yt=lt?"start":re?"end":"middle",St=mt("right"),Ht=mt("left")||Mr.onPathbar,Yt=Ht?-1:St?1:0;if(Mr.isHeader){if(Ir+=(k?Zt:Zt.l)-t,de-=(k?Zt:Zt.r)-t,Ir>=de){var se=(Ir+de)/2;Ir=se,de=se}var ke;re?(ke=qt-(k?Zt:Zt.b),Dt{var u=Ni(),d=jp(),E=sh(),A=E.clearMinTextSize,t=Hh().resizeText,e=l8();V.exports=function(r,i,n,o,a){var s=a.type,f=a.drawDescendants,v=r._fullLayout,g=v["_"+s+"layer"],m,w,l=!n;if(A(s,v),m=g.selectAll("g.trace."+s).data(i,function(y){return y[0].trace.uid}),m.enter().append("g").classed("trace",!0).classed(s,!0),m.order(),!v.uniformtext.mode&&d.hasTransition(n)){o&&(w=o());var x=u.transition().duration(n.duration).ease(n.easing).each("end",function(){w&&w()}).each("interrupt",function(){w&&w()});x.each(function(){g.selectAll("g.trace").each(function(y){e(r,y,this,n,f)})})}else m.each(function(y){e(r,y,this,n,f)}),v.uniformtext.mode&&t(r,g.selectAll(".trace"),s);l&&m.exit().remove()}}),u8=Vt((K,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=f3(),e=bx().styleOne,r=S0(),i=jp(),n=Tv(),o=xx().formatSliceLabel,a=!1;V.exports=function(s,f,v,g,m){var w=m.width,l=m.height,x=m.viewX,y=m.viewY,S=m.pathSlice,k=m.toMoveInsideSlice,M=m.strTransform,T=m.hasTransition,c=m.handleSlicesExit,h=m.makeUpdateSliceInterpolator,b=m.makeUpdateTextInterpolator,_=m.prevEntry,P={},z=s._context.staticPlot,D=s._fullLayout,B=f[0],R=B.trace,I=R.textposition.indexOf("left")!==-1,F=R.textposition.indexOf("right")!==-1,j=R.textposition.indexOf("bottom")!==-1,N=!j&&!R.marker.pad.t||j&&!R.marker.pad.b,G=t(v,[w,l],{packing:R.tiling.packing,squarifyratio:R.tiling.squarifyratio,flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1,pad:{inner:R.tiling.pad,top:R.marker.pad.t,left:R.marker.pad.l,right:R.marker.pad.r,bottom:R.marker.pad.b}}),rt=G.descendants(),ct=1/0,st=-1/0;rt.forEach(function(Q){var ut=Q.depth;ut>=R._maxDepth?(Q.x0=Q.x1=(Q.x0+Q.x1)/2,Q.y0=Q.y1=(Q.y0+Q.y1)/2):(ct=Math.min(ct,ut),st=Math.max(st,ut))}),g=g.data(rt,i.getPtId),R._maxVisibleLayers=isFinite(st)?st-ct+1:0,g.enter().append("g").classed("slice",!0),c(g,a,P,[w,l],S),g.order();var et=null;if(T&&_){var Z=i.getPtId(_);g.each(function(Q){et===null&&i.getPtId(Q)===Z&&(et={x0:Q.x0,x1:Q.x1,y0:Q.y0,y1:Q.y1})})}var ot=function(){return et||{x0:0,x1:w,y0:0,y1:l}},X=g;return T&&(X=X.transition().each("end",function(){var Q=u.select(this);i.setSliceCursor(Q,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(Q){var ut=i.isHeader(Q,R);Q._x0=x(Q.x0),Q._x1=x(Q.x1),Q._y0=y(Q.y0),Q._y1=y(Q.y1),Q._hoverX=x(Q.x1-R.marker.pad.r),Q._hoverY=y(j?Q.y1-R.marker.pad.b/2:Q.y0+R.marker.pad.t/2);var J=u.select(this),q=d.ensureSingle(J,"path","surface",function(Ct){Ct.style("pointer-events",z?"none":"all")});T?q.transition().attrTween("d",function(Ct){var It=h(Ct,a,ot(),[w,l]);return function(Nt){return S(It(Nt))}}):q.attr("d",S),J.call(n,v,s,f,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{isTransitioning:s._transitioning}),q.call(e,Q,R,s,{hovered:!1}),Q.x0===Q.x1||Q.y0===Q.y1?Q._text="":ut?Q._text=N?"":i.getPtLabel(Q)||"":Q._text=o(Q,v,R,f,D)||"";var it=d.ensureSingle(J,"g","slicetext"),nt=d.ensureSingle(it,"text","",function(Ct){Ct.attr("data-notex",1)}),dt=d.ensureUniformFontSize(s,i.determineTextFont(R,Q,D.font)),Tt=Q._text||" ",wt=ut&&Tt.indexOf("
                ")===-1;nt.text(Tt).classed("slicetext",!0).attr("text-anchor",F?"end":I||wt?"start":"middle").call(E.font,dt).call(A.convertToTspans,s),Q.textBB=E.bBox(nt.node()),Q.transform=k(Q,{fontSize:dt.size,isHeader:ut}),Q.transform.fontSize=dt.size,T?nt.transition().attrTween("transform",function(Ct){var It=b(Ct,a,ot(),[w,l]);return function(Nt){return M(It(Nt))}}):nt.attr("transform",M(Q))}),et}}),c8=Vt((K,V)=>{var u=h3(),d=u8();V.exports=function(E,A,t,e){return u(E,A,t,e,{type:"treemap",drawDescendants:d})}}),f8=Vt((K,V)=>{V.exports={moduleType:"trace",name:"treemap",basePlotModule:a8(),categories:[],animatable:!0,attributes:_x(),layoutAttributes:l3(),supplyDefaults:i8(),supplyLayoutDefaults:o8(),calc:u3().calc,crossTraceCalc:u3().crossTraceCalc,plot:c8(),style:bx().style,colorbar:Zf(),meta:{}}}),h8=Vt((K,V)=>{V.exports=f8()}),p8=Vt(K=>{var V=Uu();K.name="icicle",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),p3=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Wl(),t=Vu().attributes,e=x0(),r=iv(),i=_x(),n=S0(),o=So().extendFlat,a=If().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:i.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:o({colors:r.marker.colors,line:r.marker.line,pattern:a,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:i.pathbar,text:e.text,textinfo:r.textinfo,texttemplate:d({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:u({},{keys:n.eventDataKeys}),hovertemplatefallback:E(),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:i.outsidetextfont,textposition:i.textposition,sort:e.sort,root:r.root,domain:t({name:"icicle",trace:!0,editType:"calc"})}}),d3=Vt((K,V)=>{V.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),d8=Vt((K,V)=>{var u=Xr(),d=p3(),E=Pi(),A=Vu().defaults,t=Ih().handleText,e=p0().TEXTPAD,r=_0().handleMarkerDefaults,i=xu(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,f,v){function g(M,T){return u.coerce(a,s,d,M,T)}var m=g("labels"),w=g("parents");if(!m||!m.length||!w||!w.length){s.visible=!1;return}var l=g("values");l&&l.length?g("branchvalues"):g("count"),g("level"),g("maxdepth"),g("tiling.orientation"),g("tiling.flip"),g("tiling.pad");var x=g("text");g("texttemplate"),g("texttemplatefallback"),s.texttemplate||g("textinfo",u.isArrayOrTypedArray(x)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var y=g("pathbar.visible"),S="auto";t(a,s,v,g,S,{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition"),r(a,s,v,g);var k=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;k&&o(a,s,v,g,{prefix:"marker.",cLetter:"c"}),g("leaf.opacity",k?1:.7),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},y&&(g("pathbar.thickness",s.pathbar.textfont.size+2*e),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),A(s,v,g),s._length=null}}),m8=Vt((K,V)=>{var u=Xr(),d=d3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("iciclecolorway",A.colorway),t("extendiciclecolors")}}),m3=Vt(K=>{var V=sv();K.calc=function(u,d){return V.calc(u,d)},K.crossTraceCalc=function(u){return V._runCrossTraceCalc("icicle",u)}}),g8=Vt((K,V)=>{var u=ov(),d=c3();V.exports=function(E,A,t){var e=t.flipX,r=t.flipY,i=t.orientation==="h",n=t.maxDepth,o=A[0],a=A[1];n&&(o=(E.height+1)*A[0]/Math.min(E.height+1,n),a=(E.height+1)*A[1]/Math.min(E.height+1,n));var s=u.partition().padding(t.pad.inner).size(i?[A[1],o]:[A[0],a])(E);return(i||e||r)&&d(s,A,{swapXY:i,flipX:e,flipY:r}),s}}),g3=Vt((K,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=sh().resizeText,t=yx();function e(i){var n=i._fullLayout._iciclelayer.selectAll(".trace");A(i,n,"icicle"),n.each(function(o){var a=u.select(this),s=o[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(v){u.select(this).call(r,v,f,i)})})}function r(i,n,o,a){var s=n.data.data,f=!n.children,v=s.i,g=E.castOption(o,v,"marker.line.color")||d.defaultLine,m=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",m).call(d.stroke,g).style("opacity",f?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),v8=Vt((K,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=g8(),e=g3().styleOne,r=S0(),i=jp(),n=Tv(),o=xx().formatSliceLabel,a=!1;V.exports=function(s,f,v,g,m){var w=m.width,l=m.height,x=m.viewX,y=m.viewY,S=m.pathSlice,k=m.toMoveInsideSlice,M=m.strTransform,T=m.hasTransition,c=m.handleSlicesExit,h=m.makeUpdateSliceInterpolator,b=m.makeUpdateTextInterpolator,_=m.prevEntry,P={},z=s._context.staticPlot,D=s._fullLayout,B=f[0],R=B.trace,I=R.textposition.indexOf("left")!==-1,F=R.textposition.indexOf("right")!==-1,j=R.textposition.indexOf("bottom")!==-1,N=t(v,[w,l],{flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1,orientation:R.tiling.orientation,pad:{inner:R.tiling.pad},maxDepth:R._maxDepth}),G=N.descendants(),rt=1/0,ct=-1/0;G.forEach(function(X){var Q=X.depth;Q>=R._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(rt=Math.min(rt,Q),ct=Math.max(ct,Q))}),g=g.data(G,i.getPtId),R._maxVisibleLayers=isFinite(ct)?ct-rt+1:0,g.enter().append("g").classed("slice",!0),c(g,a,P,[w,l],S),g.order();var st=null;if(T&&_){var et=i.getPtId(_);g.each(function(X){st===null&&i.getPtId(X)===et&&(st={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var Z=function(){return st||{x0:0,x1:w,y0:0,y1:l}},ot=g;return T&&(ot=ot.transition().each("end",function(){var X=u.select(this);i.setSliceCursor(X,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ot.each(function(X){X._x0=x(X.x0),X._x1=x(X.x1),X._y0=y(X.y0),X._y1=y(X.y1),X._hoverX=x(X.x1-R.tiling.pad),X._hoverY=y(j?X.y1-R.tiling.pad/2:X.y0+R.tiling.pad/2);var Q=u.select(this),ut=d.ensureSingle(Q,"path","surface",function(nt){nt.style("pointer-events",z?"none":"all")});T?ut.transition().attrTween("d",function(nt){var dt=h(nt,a,Z(),[w,l],{orientation:R.tiling.orientation,flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1});return function(Tt){return S(dt(Tt))}}):ut.attr("d",S),Q.call(n,v,s,f,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{isTransitioning:s._transitioning}),ut.call(e,X,R,s,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=o(X,v,R,f,D)||"";var J=d.ensureSingle(Q,"g","slicetext"),q=d.ensureSingle(J,"text","",function(nt){nt.attr("data-notex",1)}),it=d.ensureUniformFontSize(s,i.determineTextFont(R,X,D.font));q.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",F?"end":I?"start":"middle").call(E.font,it).call(A.convertToTspans,s),X.textBB=E.bBox(q.node()),X.transform=k(X,{fontSize:it.size}),X.transform.fontSize=it.size,T?q.transition().attrTween("transform",function(nt){var dt=b(nt,a,Z(),[w,l]);return function(Tt){return M(dt(Tt))}}):q.attr("transform",M(X))}),st}}),y8=Vt((K,V)=>{var u=h3(),d=v8();V.exports=function(E,A,t,e){return u(E,A,t,e,{type:"icicle",drawDescendants:d})}}),x8=Vt((K,V)=>{V.exports={moduleType:"trace",name:"icicle",basePlotModule:p8(),categories:[],animatable:!0,attributes:p3(),layoutAttributes:d3(),supplyDefaults:d8(),supplyLayoutDefaults:m8(),calc:m3().calc,crossTraceCalc:m3().crossTraceCalc,plot:y8(),style:g3().style,colorbar:Zf(),meta:{}}}),_8=Vt((K,V)=>{V.exports=x8()}),b8=Vt(K=>{var V=Uu();K.name="funnelarea",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),v3=Vt((K,V)=>{var u=x0(),d=kl(),E=Vu().attributes,{hovertemplateAttrs:A,texttemplateAttrs:t,templatefallbackAttrs:e}=yl(),r=So().extendFlat;V.exports={labels:u.labels,label0:u.label0,dlabel:u.dlabel,values:u.values,marker:{colors:u.marker.colors,line:{color:r({},u.marker.line.color,{dflt:null}),width:r({},u.marker.line.width,{dflt:1}),editType:"calc"},pattern:u.marker.pattern,editType:"calc"},text:u.text,hovertext:u.hovertext,scalegroup:r({},u.scalegroup,{}),textinfo:r({},u.textinfo,{flags:["label","text","value","percent"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:e({editType:"plot"}),hoverinfo:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:A({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:e(),textposition:r({},u.textposition,{values:["inside","none"],dflt:"inside"}),textfont:u.textfont,insidetextfont:u.insidetextfont,title:{text:u.title.text,font:u.title.font,position:r({},u.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:E({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),y3=Vt((K,V)=>{var u=V1().hiddenlabels;V.exports={hiddenlabels:u,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),w8=Vt((K,V)=>{var u=Xr(),d=v3(),E=Vu().defaults,A=Ih().handleText,t=_0().handleLabelsAndValues,e=_0().handleMarkerDefaults;V.exports=function(r,i,n,o){function a(S,k){return u.coerce(r,i,d,S,k)}var s=a("labels"),f=a("values"),v=t(s,f),g=v.len;if(i._hasLabels=v.hasLabels,i._hasValues=v.hasValues,!i._hasLabels&&i._hasValues&&(a("label0"),a("dlabel")),!g){i.visible=!1;return}i._length=g,e(r,i,o,a),a("scalegroup");var m=a("text"),w=a("texttemplate");a("texttemplatefallback");var l;if(w||(l=a("textinfo",Array.isArray(m)?"text+percent":"percent")),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),w||l&&l!=="none"){var x=a("textposition");A(r,i,o,a,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else l==="none"&&a("textposition","none");E(i,o,a);var y=a("title.text");y&&(a("title.position"),u.coerceFont(a,"title.font",o.font)),a("aspectratio"),a("baseratio")}}),T8=Vt((K,V)=>{var u=Xr(),d=y3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("hiddenlabels"),t("funnelareacolorway",A.colorway),t("extendfunnelareacolors")}}),x3=Vt((K,V)=>{var u=Nm();function d(A,t){return u.calc(A,t)}function E(A){u.crossTraceCalc(A,{type:"funnelarea"})}V.exports={calc:d,crossTraceCalc:E}}),k8=Vt((K,V)=>{var u=Ni(),d=Eo(),E=Xr(),A=E.strScale,t=E.strTranslate,e=Dl(),r=d0(),i=r.toMoveInsideBar,n=sh(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Md(),f=H1(),v=f.attachFxHandlers,g=f.determineInsideTextFont,m=f.layoutAreas,w=f.prerenderTitles,l=f.positionTitleOutside,x=f.formatSliceLabel;V.exports=function(M,T){var c=M._context.staticPlot,h=M._fullLayout;a("funnelarea",h),w(T,M),m(T,h._size),E.makeTraceGroups(h._funnelarealayer,T,"trace").each(function(b){var _=u.select(this),P=b[0],z=P.trace;k(b),_.each(function(){var D=u.select(this).selectAll("g.slice").data(b);D.enter().append("g").classed("slice",!0),D.exit().remove(),D.each(function(R,I){if(R.hidden){u.select(this).selectAll("path,g").remove();return}R.pointNumber=R.i,R.curveNumber=z.index;var F=P.cx,j=P.cy,N=u.select(this),G=N.selectAll("path.surface").data([R]);G.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),N.call(v,M,b);var rt="M"+(F+R.TR[0])+","+(j+R.TR[1])+y(R.TR,R.BR)+y(R.BR,R.BL)+y(R.BL,R.TL)+"Z";G.attr("d",rt),x(M,R,P);var ct=s.castOption(z.textposition,R.pts),st=N.selectAll("g.slicetext").data(R.text&&ct!=="none"?[0]:[]);st.enter().append("g").classed("slicetext",!0),st.exit().remove(),st.each(function(){var et=E.ensureSingle(u.select(this),"text","",function(it){it.attr("data-notex",1)}),Z=E.ensureUniformFontSize(M,g(z,R,h.font));et.text(R.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,Z).call(e.convertToTspans,M);var ot=d.bBox(et.node()),X,Q,ut,J=Math.min(R.BL[1],R.BR[1])+j,q=Math.max(R.TL[1],R.TR[1])+j;Q=Math.max(R.TL[0],R.BL[0])+F,ut=Math.min(R.TR[0],R.BR[0])+F,X=i(Q,ut,J,q,ot,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=Z.size,o(z.type,X,h),b[I].transform=X,E.setTransormAndDisplay(et,X)})});var B=u.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var R=E.ensureSingle(u.select(this),"text","",function(j){j.attr("data-notex",1)}),I=z.title.text;z._meta&&(I=E.templateString(I,z._meta)),R.text(I).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(d.font,z.title.font).call(e.convertToTspans,M);var F=l(P,h._size);R.attr("transform",t(F.x,F.y)+A(Math.min(1,F.scale))+t(F.tx,F.ty))})})})};function y(M,T){var c=T[0]-M[0],h=T[1]-M[1];return"l"+c+","+h}function S(M,T){return[.5*(M[0]+T[0]),.5*(M[1]+T[1])]}function k(M){if(!M.length)return;var T=M[0],c=T.trace,h=c.aspectratio,b=c.baseratio;b>.999&&(b=.999);var _=Math.pow(b,2),P=T.vTotal,z=P*_/(1-_),D=P,B=z/P;function R(){var dt=Math.sqrt(B);return{x:dt,y:-dt}}function I(){var dt=R();return[dt.x,dt.y]}var F,j=[];j.push(I());var N,G;for(N=M.length-1;N>-1;N--)if(G=M[N],!G.hidden){var rt=G.v/D;B+=rt,j.push(I())}var ct=1/0,st=-1/0;for(N=0;N-1;N--)if(G=M[N],!G.hidden){q+=1;var it=j[q][0],nt=j[q][1];G.TL=[-it,nt],G.TR=[it,nt],G.BL=ut,G.BR=J,G.pxmid=S(G.TR,G.BR),ut=G.TL,J=G.TR}}}),A8=Vt((K,V)=>{var u=Ni(),d=Tm(),E=sh().resizeText;V.exports=function(A){var t=A._fullLayout._funnelarealayer.selectAll(".trace");E(A,t,"funnelarea"),t.each(function(e){var r=e[0],i=r.trace,n=u.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){u.select(this).call(d,o,i,A)})})}}),M8=Vt((K,V)=>{V.exports={moduleType:"trace",name:"funnelarea",basePlotModule:b8(),categories:["pie-like","funnelarea","showLegend"],attributes:v3(),layoutAttributes:y3(),supplyDefaults:w8(),supplyLayoutDefaults:T8(),calc:x3().calc,crossTraceCalc:x3().crossTraceCalc,plot:k8(),style:A8(),styleOne:Tm(),meta:{}}}),S8=Vt((K,V)=>{V.exports=M8()}),Bf=Vt((K,V)=>{(function(){var u={24:function(t){var e={left:0,top:0};t.exports=r;function r(n,o,a){o=o||n.currentTarget||n.srcElement,Array.isArray(a)||(a=[0,0]);var s=n.clientX||0,f=n.clientY||0,v=i(o);return a[0]=s-v.left,a[1]=f-v.top,a}function i(n){return n===window||n===document||n===document.body?e:n.getBoundingClientRect()}},109:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[2],f=i[0]-a,v=i[2]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=a+v*g+f*m,r[1]=i[1],r[2]=s+v*m-f*g,r}},160:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.max(i[0],n[0]),r[1]=Math.max(i[1],n[1]),r[2]=Math.max(i[2],n[2]),r[3]=Math.max(i[3],n[3]),r}},216:function(t){t.exports=e;function e(r,i){for(var n={},o=0;o1){g[0]in f||(f[g[0]]=[]),f=f[g[0]];for(var m=1;m=0;--F){var ot=R[F];j=ot[0];var X=D[j],Q=X[0],ut=X[1],J=z[Q],q=z[ut];if((J[0]-q[0]||J[1]-q[1])<0){var it=Q;Q=ut,ut=it}X[0]=Q;var nt=X[1]=ot[1],dt;for(I&&(dt=X[2]);F>0&&R[F-1][0]===j;){var ot=R[--F],Tt=ot[1];I?D.push([nt,Tt,dt]):D.push([nt,Tt]),nt=Tt}I?D.push([nt,ut,dt]):D.push([nt,ut])}return N}function M(z,D,B){for(var R=D.length,I=new i(R),F=[],j=0;jD[2]?1:0)}function h(z,D,B){if(z.length!==0){if(D)for(var R=0;R0||j.length>0}function P(z,D,B){var R;if(B){R=D;for(var I=new Array(D.length),F=0;F 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the cone vertex and normal at the given index. -// -// The returned vertex is for a cone with its top at origin and height of 1.0, -// pointing in the direction of the vector attribute. -// -// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. -// These vertices are used to make up the triangles of the cone by the following: -// segment + 0 top vertex -// segment + 1 perimeter vertex a+1 -// segment + 2 perimeter vertex a -// segment + 3 center base vertex -// segment + 4 perimeter vertex a -// segment + 5 perimeter vertex a+1 -// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. -// To go from index to segment, floor(index / 6) -// To go from segment to angle, 2*pi * (segment/segmentCount) -// To go from index to segment index, index - (segment*6) -// -vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { - - const float segmentCount = 8.0; - - float index = rawIndex - floor(rawIndex / - (segmentCount * 6.0)) * - (segmentCount * 6.0); - - float segment = floor(0.001 + index/6.0); - float segmentIndex = index - (segment*6.0); - - normal = -normalize(d); - - if (segmentIndex > 2.99 && segmentIndex < 3.01) { - return mix(vec3(0.0), -d, coneOffset); - } - - float nextAngle = ( - (segmentIndex > 0.99 && segmentIndex < 1.01) || - (segmentIndex > 4.99 && segmentIndex < 5.01) - ) ? 1.0 : 0.0; - float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); - - vec3 v1 = mix(d, vec3(0.0), coneOffset); - vec3 v2 = v1 - d; - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d)*0.25; - vec3 y = v * sin(angle) * length(d)*0.25; - vec3 v3 = v2 + x + y; - if (segmentIndex < 3.0) { - vec3 tx = u * sin(angle); - vec3 ty = v * -cos(angle); - vec3 tangent = tx + ty; - normal = normalize(cross(v3 - v1, tangent)); - } - - if (segmentIndex == 0.0) { - return mix(d, vec3(0.0), coneOffset); - } - return v3; -} - -attribute vec3 vector; -attribute vec4 color, position; -attribute vec2 uv; - -uniform float vectorScale, coneScale, coneOffset; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 eyePosition, lightPosition; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - // Scale the vector magnitude to stay constant with - // model & view changes. - vec3 normal; - vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); - vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * conePosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - f_lightDirection = lightPosition - cameraCoordinate.xyz; - f_eyeDirection = eyePosition - cameraCoordinate.xyz; - f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); - - // vec4 m_position = model * vec4(conePosition, 1.0); - vec4 t_position = view * conePosition; - gl_Position = projection * t_position; - - f_color = color; - f_data = conePosition.xyz; - f_position = position.xyz; - f_uv = uv; -} -`]),o=i([`#extension GL_OES_standard_derivatives : enable - -precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float cookTorranceSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness, - float fresnel) { - - float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); - float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); - - //Half angle vector - vec3 H = normalize(lightDirection + viewDirection); - - //Geometric term - float NdotH = max(dot(surfaceNormal, H), 0.0); - float VdotH = max(dot(viewDirection, H), 0.000001); - float LdotH = max(dot(lightDirection, H), 0.000001); - float G1 = (2.0 * NdotH * VdotN) / VdotH; - float G2 = (2.0 * NdotH * LdotN) / LdotH; - float G = min(1.0, min(G1, G2)); - - //Distribution term - float D = beckmannDistribution(NdotH, roughness); - - //Fresnel term - float F = pow(1.0 - VdotN, fresnel); - - //Multiply terms and done - return G * F * D / max(3.14159265 * VdotN, 0.000001); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform sampler2D texture; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = f_color * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * opacity; -} -`]),a=i([`precision highp float; - -precision highp float; -#define GLSLIFY 1 - -vec3 getOrthogonalVector(vec3 v) { - // Return up-vector for only-z vector. - // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). - // From the above if-statement we have ||a|| > 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the cone vertex and normal at the given index. -// -// The returned vertex is for a cone with its top at origin and height of 1.0, -// pointing in the direction of the vector attribute. -// -// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. -// These vertices are used to make up the triangles of the cone by the following: -// segment + 0 top vertex -// segment + 1 perimeter vertex a+1 -// segment + 2 perimeter vertex a -// segment + 3 center base vertex -// segment + 4 perimeter vertex a -// segment + 5 perimeter vertex a+1 -// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. -// To go from index to segment, floor(index / 6) -// To go from segment to angle, 2*pi * (segment/segmentCount) -// To go from index to segment index, index - (segment*6) -// -vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { - - const float segmentCount = 8.0; - - float index = rawIndex - floor(rawIndex / - (segmentCount * 6.0)) * - (segmentCount * 6.0); - - float segment = floor(0.001 + index/6.0); - float segmentIndex = index - (segment*6.0); - - normal = -normalize(d); - - if (segmentIndex > 2.99 && segmentIndex < 3.01) { - return mix(vec3(0.0), -d, coneOffset); - } - - float nextAngle = ( - (segmentIndex > 0.99 && segmentIndex < 1.01) || - (segmentIndex > 4.99 && segmentIndex < 5.01) - ) ? 1.0 : 0.0; - float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); - - vec3 v1 = mix(d, vec3(0.0), coneOffset); - vec3 v2 = v1 - d; - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d)*0.25; - vec3 y = v * sin(angle) * length(d)*0.25; - vec3 v3 = v2 + x + y; - if (segmentIndex < 3.0) { - vec3 tx = u * sin(angle); - vec3 ty = v * -cos(angle); - vec3 tangent = tx + ty; - normal = normalize(cross(v3 - v1, tangent)); - } - - if (segmentIndex == 0.0) { - return mix(d, vec3(0.0), coneOffset); - } - return v3; -} - -attribute vec4 vector; -attribute vec4 position; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform float vectorScale, coneScale, coneOffset; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - vec3 normal; - vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); - vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - gl_Position = projection * (view * conePosition); - f_id = id; - f_position = position.xyz; -} -`]),s=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},665:function(t,e,r){var i=r(3202);t.exports=s;var n=96;function o(f,v){var g=i(getComputedStyle(f).getPropertyValue(v));return g[0]*s(g[1],f)}function a(f,v){var g=document.createElement("div");g.style["font-size"]="128"+f,v.appendChild(g);var m=o(g,"font-size")/128;return v.removeChild(g),m}function s(f,v){switch(v=v||document.body,f=(f||"px").trim().toLowerCase(),(v===window||v===document)&&(v=document.body),f){case"%":return v.clientHeight/100;case"ch":case"ex":return a(f,v);case"em":return o(v,"font-size");case"rem":return o(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return n;case"cm":return n/2.54;case"mm":return n/25.4;case"pt":return n/72;case"pc":return n/6}return 1}},727:function(t,e,r){var i=r(2962),n=6;function o(S){var k=S===2?f:S===3?v:S===4?g:S===5?m:w;return S<6?k(i[S]):k(i)}function a(){return[[0]]}function s(S,k){return[[k[0]],[S[0][0]]]}function f(S){return function(k,M){return[S([[+M[0],+k[0][1]],[+M[1],+k[1][1]]]),S([[+k[0][0],+M[0]],[+k[1][0],+M[1]]]),S(k)]}}function v(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2]],[+M[1],+k[1][1],+k[1][2]],[+M[2],+k[2][1],+k[2][2]]]),S([[+k[0][0],+M[0],+k[0][2]],[+k[1][0],+M[1],+k[1][2]],[+k[2][0],+M[2],+k[2][2]]]),S([[+k[0][0],+k[0][1],+M[0]],[+k[1][0],+k[1][1],+M[1]],[+k[2][0],+k[2][1],+M[2]]]),S(k)]}}function g(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3]],[+M[1],+k[1][1],+k[1][2],+k[1][3]],[+M[2],+k[2][1],+k[2][2],+k[2][3]],[+M[3],+k[3][1],+k[3][2],+k[3][3]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3]],[+k[1][0],+M[1],+k[1][2],+k[1][3]],[+k[2][0],+M[2],+k[2][2],+k[2][3]],[+k[3][0],+M[3],+k[3][2],+k[3][3]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3]],[+k[1][0],+k[1][1],+M[1],+k[1][3]],[+k[2][0],+k[2][1],+M[2],+k[2][3]],[+k[3][0],+k[3][1],+M[3],+k[3][3]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+M[3]]]),S(k)]}}function m(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3],+k[0][4]],[+M[1],+k[1][1],+k[1][2],+k[1][3],+k[1][4]],[+M[2],+k[2][1],+k[2][2],+k[2][3],+k[2][4]],[+M[3],+k[3][1],+k[3][2],+k[3][3],+k[3][4]],[+M[4],+k[4][1],+k[4][2],+k[4][3],+k[4][4]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3],+k[0][4]],[+k[1][0],+M[1],+k[1][2],+k[1][3],+k[1][4]],[+k[2][0],+M[2],+k[2][2],+k[2][3],+k[2][4]],[+k[3][0],+M[3],+k[3][2],+k[3][3],+k[3][4]],[+k[4][0],+M[4],+k[4][2],+k[4][3],+k[4][4]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3],+k[0][4]],[+k[1][0],+k[1][1],+M[1],+k[1][3],+k[1][4]],[+k[2][0],+k[2][1],+M[2],+k[2][3],+k[2][4]],[+k[3][0],+k[3][1],+M[3],+k[3][3],+k[3][4]],[+k[4][0],+k[4][1],+M[4],+k[4][3],+k[4][4]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0],+k[0][4]],[+k[1][0],+k[1][1],+k[1][2],+M[1],+k[1][4]],[+k[2][0],+k[2][1],+k[2][2],+M[2],+k[2][4]],[+k[3][0],+k[3][1],+k[3][2],+M[3],+k[3][4]],[+k[4][0],+k[4][1],+k[4][2],+M[4],+k[4][4]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+M[3]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+M[4]]]),S(k)]}}function w(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3],+k[0][4],+k[0][5]],[+M[1],+k[1][1],+k[1][2],+k[1][3],+k[1][4],+k[1][5]],[+M[2],+k[2][1],+k[2][2],+k[2][3],+k[2][4],+k[2][5]],[+M[3],+k[3][1],+k[3][2],+k[3][3],+k[3][4],+k[3][5]],[+M[4],+k[4][1],+k[4][2],+k[4][3],+k[4][4],+k[4][5]],[+M[5],+k[5][1],+k[5][2],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3],+k[0][4],+k[0][5]],[+k[1][0],+M[1],+k[1][2],+k[1][3],+k[1][4],+k[1][5]],[+k[2][0],+M[2],+k[2][2],+k[2][3],+k[2][4],+k[2][5]],[+k[3][0],+M[3],+k[3][2],+k[3][3],+k[3][4],+k[3][5]],[+k[4][0],+M[4],+k[4][2],+k[4][3],+k[4][4],+k[4][5]],[+k[5][0],+M[5],+k[5][2],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3],+k[0][4],+k[0][5]],[+k[1][0],+k[1][1],+M[1],+k[1][3],+k[1][4],+k[1][5]],[+k[2][0],+k[2][1],+M[2],+k[2][3],+k[2][4],+k[2][5]],[+k[3][0],+k[3][1],+M[3],+k[3][3],+k[3][4],+k[3][5]],[+k[4][0],+k[4][1],+M[4],+k[4][3],+k[4][4],+k[4][5]],[+k[5][0],+k[5][1],+M[5],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0],+k[0][4],+k[0][5]],[+k[1][0],+k[1][1],+k[1][2],+M[1],+k[1][4],+k[1][5]],[+k[2][0],+k[2][1],+k[2][2],+M[2],+k[2][4],+k[2][5]],[+k[3][0],+k[3][1],+k[3][2],+M[3],+k[3][4],+k[3][5]],[+k[4][0],+k[4][1],+k[4][2],+M[4],+k[4][4],+k[4][5]],[+k[5][0],+k[5][1],+k[5][2],+M[5],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+M[0],+k[0][5]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+M[1],+k[1][5]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+M[2],+k[2][5]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+M[3],+k[3][5]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+M[4],+k[4][5]],[+k[5][0],+k[5][1],+k[5][2],+k[5][3],+M[5],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+k[0][4],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+k[1][4],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+k[2][4],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+k[3][4],+M[3]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+k[4][4],+M[4]],[+k[5][0],+k[5][1],+k[5][2],+k[5][3],+k[5][4],+M[5]]]),S(k)]}}var l=[a,s];function x(S,k,M,T,c,h,b,_){return function(P,z){switch(P.length){case 0:return S(P,z);case 1:return k(P,z);case 2:return M(P,z);case 3:return T(P,z);case 4:return c(P,z);case 5:return h(P,z)}var D=b[P.length];return D||(D=b[P.length]=_(P.length)),D(P,z)}}function y(){for(;l.length1e-6?(x=Math.acos(y),S=Math.sin(x),k=Math.sin((1-o)*x)/S,M=Math.sin(o*x)/S):(k=1-o,M=o),r[0]=k*a+M*g,r[1]=k*s+M*m,r[2]=k*f+M*w,r[3]=k*v+M*l,r}},799:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision mediump float; -#define GLSLIFY 1 -attribute vec2 position; -varying vec2 uv; -void main() { - uv = position; - gl_Position = vec4(position, 0, 1); -}`]),a=i([`precision mediump float; -#define GLSLIFY 1 - -uniform sampler2D accumBuffer; -varying vec2 uv; - -void main() { - vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); - gl_FragColor = min(vec4(1,1,1,1), accum); -}`]);t.exports=function(s){return n(s,o,a,null,[{name:"position",type:"vec2"}])}},811:function(t){t.exports=e;function e(r,i){return r[0]=1/i[0],r[1]=1/i[1],r[2]=1/i[2],r}},840:function(t,e,r){var i=r(3236),n=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position, normal; -attribute vec4 color; -attribute vec2 uv; - -uniform mat4 model - , view - , projection - , inverseModel; -uniform vec3 eyePosition - , lightPosition; - -varying vec3 f_normal - , f_lightDirection - , f_eyeDirection - , f_data; -varying vec4 f_color; -varying vec2 f_uv; - -vec4 project(vec3 p) { - return projection * (view * (model * vec4(p, 1.0))); -} - -void main() { - gl_Position = project(position); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * vec4(position , 1.0); - cameraCoordinate.xyz /= cameraCoordinate.w; - f_lightDirection = lightPosition - cameraCoordinate.xyz; - f_eyeDirection = eyePosition - cameraCoordinate.xyz; - f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); - - f_color = color; - f_data = position; - f_uv = uv; -} -`]),o=i([`#extension GL_OES_standard_derivatives : enable - -precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float cookTorranceSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness, - float fresnel) { - - float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); - float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); - - //Half angle vector - vec3 H = normalize(lightDirection + viewDirection); - - //Geometric term - float NdotH = max(dot(surfaceNormal, H), 0.0); - float VdotH = max(dot(viewDirection, H), 0.000001); - float LdotH = max(dot(lightDirection, H), 0.000001); - float G1 = (2.0 * NdotH * VdotN) / VdotH; - float G2 = (2.0 * NdotH * LdotN) / LdotH; - float G = min(1.0, min(G1, G2)); - - //Distribution term - float D = beckmannDistribution(NdotH, roughness); - - //Fresnel term - float F = pow(1.0 - VdotN, fresnel); - - //Multiply terms and done - return G * F * D / max(3.14159265 * VdotN, 0.000001); -} - -//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness - , fresnel - , kambient - , kdiffuse - , kspecular; -uniform sampler2D texture; - -varying vec3 f_normal - , f_lightDirection - , f_eyeDirection - , f_data; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (f_color.a == 0.0 || - outOfRange(clipBounds[0], clipBounds[1], f_data) - ) discard; - - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d - - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * f_color.a; -} -`]),a=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec4 color; -attribute vec2 uv; - -uniform mat4 model, view, projection; - -varying vec4 f_color; -varying vec3 f_data; -varying vec2 f_uv; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - f_color = color; - f_data = position; - f_uv = uv; -}`]),s=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform sampler2D texture; -uniform float opacity; - -varying vec4 f_color; -varying vec3 f_data; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; - - gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; -}`]),f=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 uv; -attribute float pointSize; - -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); - } else { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - } - gl_PointSize = pointSize; - f_color = color; - f_uv = uv; -}`]),v=i([`precision highp float; -#define GLSLIFY 1 - -uniform sampler2D texture; -uniform float opacity; - -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); - if(dot(pointR, pointR) > 0.25) { - discard; - } - gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; -}`]),g=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec4 id; - -uniform mat4 model, view, projection; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - f_id = id; - f_position = position; -}`]),m=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]),w=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute float pointSize; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); - } else { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - gl_PointSize = pointSize; - } - f_id = id; - f_position = position; -}`]),l=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; - -uniform mat4 model, view, projection; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); -}`]),x=i([`precision highp float; -#define GLSLIFY 1 - -uniform vec3 contourColor; - -void main() { - gl_FragColor = vec4(contourColor, 1.0); -} -`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:f,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:g,fragment:m,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:w,fragment:m,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:l,fragment:x,attributes:[{name:"position",type:"vec3"}]}},855:function(t,e,r){t.exports={init:y,sweepBipartite:M,sweepComplete:T,scanBipartite:c,scanComplete:h};var i=r(1888),n=r(8828),o=r(4192),a=1<<28,s=1024,f=i.mallocInt32(s),v=i.mallocInt32(s),g=i.mallocInt32(s),m=i.mallocInt32(s),w=i.mallocInt32(s),l=i.mallocInt32(s),x=i.mallocDouble(s*8);function y(b){var _=n.nextPow2(b);f.length<_&&(i.free(f),f=i.mallocInt32(_)),v.length<_&&(i.free(v),v=i.mallocInt32(_)),g.length<_&&(i.free(g),g=i.mallocInt32(_)),m.length<_&&(i.free(m),m=i.mallocInt32(_)),w.length<_&&(i.free(w),w=i.mallocInt32(_)),l.length<_&&(i.free(l),l=i.mallocInt32(_));var P=8*_;x.length>>1;o(x,X);for(var Q=0,ut=0,st=0;st=a)J=J-a|0,S(g,m,ut--,J);else if(J>=0)S(f,v,Q--,J);else if(J<=-a){J=-J-a|0;for(var q=0;q>>1;o(x,X);for(var Q=0,ut=0,J=0,st=0;st>1===x[2*st+3]>>1&&(it=2,st+=1),q<0){for(var nt=-(q>>1)-1,dt=0;dt>1)-1;it===0?S(f,v,Q--,nt):it===1?S(g,m,ut--,nt):it===2&&S(w,l,J--,nt)}}}function c(b,_,P,z,D,B,R,I,F,j,N,G){var rt=0,ct=2*b,st=_,et=_+b,Z=1,ot=1;z?ot=a:Z=a;for(var X=D;X>>1;o(x,q);for(var it=0,X=0;X=a?(dt=!z,Q-=a):(dt=!!z,Q-=1),dt)k(f,v,it++,Q);else{var Tt=G[Q],wt=ct*Q,Ct=N[wt+_+1],It=N[wt+_+1+b];t:for(var Nt=0;Nt>>1;o(x,Q);for(var ut=0,et=0;et=a)f[ut++]=Z-a;else{Z-=1;var q=N[Z],it=rt*Z,nt=j[it+_+1],dt=j[it+_+1+b];t:for(var Tt=0;Tt=0;--Tt)if(f[Tt]===Z){for(var Nt=Tt+1;Nt max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 lowerBound, upperBound; -uniform float contourTint; -uniform vec4 contourColor; -uniform sampler2D colormap; -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform float vertexColor; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - if ( - kill > 0.0 || - vColor.a == 0.0 || - outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) - ) discard; - - vec3 N = normalize(surfaceNormal); - vec3 V = normalize(eyeDirection); - vec3 L = normalize(lightDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = max(beckmannSpecular(L, V, N, roughness), 0.); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - //decide how to interpolate color — in vertex or in fragment - vec4 surfaceColor = - step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + - step(.5, vertexColor) * vColor; - - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; -} -`]),s=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec4 uv; -attribute float f; - -uniform vec3 objectOffset; -uniform mat3 permutation; -uniform mat4 model, view, projection; -uniform float height, zOffset; -uniform sampler2D colormap; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - vec3 dataCoordinate = permutation * vec3(uv.xy, height); - worldCoordinate = objectOffset + dataCoordinate; - mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); - vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); - - vec4 clipPosition = projection * (view * worldPosition); - clipPosition.z += zOffset; - - gl_Position = clipPosition; - value = f + objectOffset.z; - kill = -1.0; - planeCoordinate = uv.zw; - - vColor = texture2D(colormap, vec2(value, value)); - - //Don't do lighting for contours - surfaceNormal = vec3(1,0,0); - eyeDirection = vec3(0,1,0); - lightDirection = vec3(0,0,1); -} -`]),f=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec2 shape; -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 surfaceNormal; - -vec2 splitFloat(float v) { - float vh = 255.0 * v; - float upper = floor(vh); - float lower = fract(vh); - return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); -} - -void main() { - if ((kill > 0.0) || - (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; - - vec2 ux = splitFloat(planeCoordinate.x / shape.x); - vec2 uy = splitFloat(planeCoordinate.y / shape.y); - gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); -} -`]);e.createShader=function(v){var g=i(v,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},e.createPickShader=function(v){var g=i(v,o,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},e.createContourShader=function(v){var g=i(v,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g},e.createPickContourShader=function(v){var g=i(v,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g}},1085:function(t,e,r){var i=r(1371);t.exports=n;function n(o,a,s){a=typeof a=="number"?a:1,s=s||": ";var f=o.split(/\r?\n/),v=String(f.length+a-1).length;return f.map(function(g,m){var w=m+a,l=String(w).length,x=i(w,v-l);return x+s+g}).join(` -`)}},1091:function(t){t.exports=e;function e(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},1125:function(t,e,r){t.exports=o;var i=r(3250)[3];function n(a,s,f,v){for(var g=0;g<2;++g){var m=a[g],w=s[g],l=Math.min(m,w),x=Math.max(m,w),y=f[g],S=v[g],k=Math.min(y,S),M=Math.max(y,S);if(M0&&m>0||g<0&&m<0)return!1;var w=i(f,a,s),l=i(v,a,s);return w>0&&l>0||w<0&&l<0?!1:g===0&&m===0&&w===0&&l===0?n(a,s,f,v):!0}},1278:function(t,e,r){var i=r(2361),n=Math.pow(2,-1074),o=-1>>>0;t.exports=a;function a(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var v=i.hi(s),g=i.lo(s);return f>s==s>0?g===o?(v+=1,g=0):g+=1:g===0?(g=o,v-=1):g-=1,i.pack(g,v)}},1283:function(t,e,r){var i=r(9405),n=r(3236),o=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform vec4 highlightId; -uniform float highlightScale; -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float scale = 1.0; - if(distance(highlightId, id) < 0.0001) { - scale = highlightScale; - } - - vec4 worldPosition = model * vec4(position, 1); - vec4 viewPosition = view * worldPosition; - viewPosition = viewPosition / viewPosition.w; - vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); - - gl_Position = clipPosition; - interpColor = color; - pickId = id; - dataCoordinate = position; - } -}`]),a=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform vec2 screenSize; -uniform vec3 clipBounds[2]; -uniform float highlightScale, pixelRatio; -uniform vec4 highlightId; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float scale = pixelRatio; - if(distance(highlightId.bgr, id.bgr) < 0.001) { - scale *= highlightScale; - } - - vec4 worldPosition = model * vec4(position, 1.0); - vec4 viewPosition = view * worldPosition; - vec4 clipPosition = projection * viewPosition; - clipPosition /= clipPosition.w; - - gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); - interpColor = color; - pickId = id; - dataCoordinate = position; - } -}`]),s=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform float highlightScale; -uniform vec4 highlightId; -uniform vec3 axes[2]; -uniform mat4 model, view, projection; -uniform vec2 screenSize; -uniform vec3 clipBounds[2]; -uniform float scale, pixelRatio; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float lscale = pixelRatio * scale; - if(distance(highlightId, id) < 0.0001) { - lscale *= highlightScale; - } - - vec4 clipCenter = projection * (view * (model * vec4(position, 1))); - vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; - vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); - - gl_Position = clipPosition; - interpColor = color; - pickId = id; - dataCoordinate = dataPosition; - } -} -`]),f=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 fragClipBounds[2]; -uniform float opacity; - -varying vec4 interpColor; -varying vec3 dataCoordinate; - -void main() { - if ( - outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || - interpColor.a * opacity == 0. - ) discard; - gl_FragColor = interpColor * opacity; -} -`]),v=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 fragClipBounds[2]; -uniform float pickGroup; - -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; - - gl_FragColor = vec4(pickGroup, pickId.bgr); -}`]),g=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],m={vertex:o,fragment:f,attributes:g},w={vertex:a,fragment:f,attributes:g},l={vertex:s,fragment:f,attributes:g},x={vertex:o,fragment:v,attributes:g},y={vertex:a,fragment:v,attributes:g},S={vertex:s,fragment:v,attributes:g};function k(M,T){var c=i(M,T),h=c.attributes;return h.position.location=0,h.color.location=1,h.glyph.location=2,h.id.location=3,c}e.createPerspective=function(M){return k(M,m)},e.createOrtho=function(M){return k(M,w)},e.createProject=function(M){return k(M,l)},e.createPickPerspective=function(M){return k(M,x)},e.createPickOrtho=function(M){return k(M,y)},e.createPickProject=function(M){return k(M,S)}},1303:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){var f,v;if(s[0][0]s[1][0])f=s[1],v=s[0];else{var g=Math.min(a[0][1],a[1][1]),m=Math.max(a[0][1],a[1][1]),w=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return ml?g-l:m-l}var x,y;a[0][1]s[1][0])f=s[1],v=s[0];else return n(s,a);var g,m;if(a[0][0]a[1][0])g=a[1],m=a[0];else return-n(a,s);var w=i(f,v,m),l=i(f,v,g);if(w<0){if(l<=0)return w}else if(w>0){if(l>=0)return w}else if(l)return l;if(w=i(m,g,v),l=i(m,g,f),w<0){if(l<=0)return w}else if(w>0){if(l>=0)return w}else if(l)return l;return v[0]-m[0]}},1318:function(t){t.exports=e;function e(r,i){return r[0].mul(i[1]).cmp(i[0].mul(r[1]))}},1338:function(t){function e(n,o,a){var s=n[a]|0;if(s<=0)return[];var f=new Array(s),v;if(a===n.length-1)for(v=0;v"u"&&(o=0),typeof n){case"number":if(n>0)return r(n|0,o);break;case"object":if(typeof n.length=="number")return e(n,o,0);break}return[]}t.exports=i},1369:function(t,e,r){var i=r(5716);t.exports=n;function n(o){var a=o.length,s=o.words,f=0;if(a===1)f=s[0];else if(a===2)f=s[0]+s[1]*67108864;else for(var v=0;vo)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a=0?b[F]:I)}function z(R){var I=y(R);return I?_ in I:h.indexOf(R)>=0}function D(R,I){var F,j=y(R);return j?j[_]=I:(F=h.indexOf(R),F>=0?b[F]=I:(F=h.length,b[F]=I,h[F]=R)),this}function B(R){var I=y(R),F,j;return I?_ in I&&delete I[_]:(F=h.indexOf(R),F<0?!1:(j=h.length-1,h[F]=void 0,b[F]=b[j],h[F]=h[j],h.length=j,b.length=j,!0))}return Object.create(c.prototype,{get___:{value:S(P)},has___:{value:S(z)},set___:{value:S(D)},delete___:{value:S(B)}})};c.prototype=Object.create(Object.prototype,{get:{value:function(h,b){return this.get___(h,b)},writable:!0,configurable:!0},has:{value:function(h){return this.has___(h)},writable:!0,configurable:!0},set:{value:function(h,b){return this.set___(h,b)},writable:!0,configurable:!0},delete:{value:function(h){return this.delete___(h)},writable:!0,configurable:!0}}),typeof i=="function"?(function(){r&&typeof Proxy<"u"&&(Proxy=void 0);function h(){this instanceof c||M();var b=new i,_=void 0,P=!1;function z(I,F){return _?b.has(I)?b.get(I):_.get___(I,F):b.get(I,F)}function D(I){return b.has(I)||(_?_.has___(I):!1)}var B;r?B=function(I,F){return b.set(I,F),b.has(I)||(_||(_=new c),_.set(I,F)),this}:B=function(I,F){if(P)try{b.set(I,F)}catch{_||(_=new c),_.set___(I,F)}else b.set(I,F);return this};function R(I){var F=!!b.delete(I);return _&&_.delete___(I)||F}return Object.create(c.prototype,{get___:{value:S(z)},has___:{value:S(D)},set___:{value:S(B)},delete___:{value:S(R)},permitHostObjects___:{value:S(function(I){if(I===e)P=!0;else throw new Error("bogus call to permitHostObjects___")})}})}h.prototype=c.prototype,t.exports=h,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=c)})()},1570:function(t){t.exports=r;var e=[function(){function i(n,o,a,s){for(var f=n.length,v=[],g=0;g>1,x=a[2*l+1];if(x===g)return l;g>1,x=a[2*l+1];if(x===g)return l;g>1,x=a[2*l+1];if(x===g)return l;g HALF_PI) && (b <= ONE_AND_HALF_PI)) ? - b - PI : - b; -} - -float look_horizontal_or_vertical(float a, float ratio) { - // ratio controls the ratio between being horizontal to (vertical + horizontal) - // if ratio is set to 0.5 then it is 50%, 50%. - // when using a higher ratio e.g. 0.75 the result would - // likely be more horizontal than vertical. - - float b = positive_angle(a); - - return - (b < ( ratio) * HALF_PI) ? 0.0 : - (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : - (b < (2.0 + ratio) * HALF_PI) ? 0.0 : - (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : - 0.0; -} - -float roundTo(float a, float b) { - return float(b * floor((a + 0.5 * b) / b)); -} - -float look_round_n_directions(float a, int n) { - float b = positive_angle(a); - float div = TWO_PI / float(n); - float c = roundTo(b, div); - return look_upwards(c); -} - -float applyAlignOption(float rawAngle, float delta) { - return - (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions - (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical - (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis - (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards - (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal - rawAngle; // otherwise return back raw input angle -} - -bool isAxisTitle = (axis.x == 0.0) && - (axis.y == 0.0) && - (axis.z == 0.0); - -void main() { - //Compute world offset - float axisDistance = position.z; - vec3 dataPosition = axisDistance * axis + offset; - - float beta = angle; // i.e. user defined attributes for each tick - - float axisAngle; - float clipAngle; - float flip; - - if (enableAlign) { - axisAngle = (isAxisTitle) ? HALF_PI : - computeViewAngle(dataPosition, dataPosition + axis); - clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); - - axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; - clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; - - flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), - vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; - - beta += applyAlignOption(clipAngle, flip * PI); - } - - //Compute plane offset - vec2 planeCoord = position.xy * pixelScale; - - mat2 planeXform = scale * mat2( - cos(beta), sin(beta), - -sin(beta), cos(beta) - ); - - vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; - - //Compute clip position - vec3 clipPosition = project(dataPosition); - - //Apply text offset in clip coordinates - clipPosition += vec3(viewOffset, 0.0); - - //Done - gl_Position = vec4(clipPosition, 1.0); -} -`]),f=i([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 color; -void main() { - gl_FragColor = color; -}`]);e.Q=function(m){return n(m,s,f,null,[{name:"position",type:"vec3"}])};var v=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec3 normal; - -uniform mat4 model, view, projection; -uniform vec3 enable; -uniform vec3 bounds[2]; - -varying vec3 colorChannel; - -void main() { - - vec3 signAxis = sign(bounds[1] - bounds[0]); - - vec3 realNormal = signAxis * normal; - - if(dot(realNormal, enable) > 0.0) { - vec3 minRange = min(bounds[0], bounds[1]); - vec3 maxRange = max(bounds[0], bounds[1]); - vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); - gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); - } else { - gl_Position = vec4(0,0,0,0); - } - - colorChannel = abs(realNormal); -} -`]),g=i([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 colors[3]; - -varying vec3 colorChannel; - -void main() { - gl_FragColor = colorChannel.x * colors[0] + - colorChannel.y * colors[1] + - colorChannel.z * colors[2]; -}`]);e.bg=function(m){return n(m,v,g,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},1888:function(t,e,r){var i=r(8828),n=r(1338),o=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:n([32,0]),UINT16:n([32,0]),UINT32:n([32,0]),BIGUINT64:n([32,0]),INT8:n([32,0]),INT16:n([32,0]),INT32:n([32,0]),BIGINT64:n([32,0]),FLOAT:n([32,0]),DOUBLE:n([32,0]),DATA:n([32,0]),UINT8C:n([32,0]),BUFFER:n([32,0])});var a=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",f=typeof BigInt64Array<"u",v=r.g.__TYPEDARRAY_POOL;v.UINT8C||(v.UINT8C=n([32,0])),v.BIGUINT64||(v.BIGUINT64=n([32,0])),v.BIGINT64||(v.BIGINT64=n([32,0])),v.BUFFER||(v.BUFFER=n([32,0]));var g=v.DATA,m=v.BUFFER;e.free=function(R){if(o.isBuffer(R))m[i.log2(R.length)].push(R);else{if(Object.prototype.toString.call(R)!=="[object ArrayBuffer]"&&(R=R.buffer),!R)return;var I=R.length||R.byteLength,F=i.log2(I)|0;g[F].push(R)}};function w(R){if(R){var I=R.length||R.byteLength,F=i.log2(I);g[F].push(R)}}function l(R){w(R.buffer)}e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=l,e.freeArrayBuffer=w,e.freeBuffer=function(R){m[i.log2(R.length)].push(R)},e.malloc=function(R,I){if(I===void 0||I==="arraybuffer")return x(R);switch(I){case"uint8":return y(R);case"uint16":return S(R);case"uint32":return k(R);case"int8":return M(R);case"int16":return T(R);case"int32":return c(R);case"float":case"float32":return h(R);case"double":case"float64":return b(R);case"uint8_clamped":return _(R);case"bigint64":return z(R);case"biguint64":return P(R);case"buffer":return B(R);case"data":case"dataview":return D(R);default:return null}return null};function x(I){var I=i.nextPow2(I),F=i.log2(I),j=g[F];return j.length>0?j.pop():new ArrayBuffer(I)}e.mallocArrayBuffer=x;function y(R){return new Uint8Array(x(R),0,R)}e.mallocUint8=y;function S(R){return new Uint16Array(x(2*R),0,R)}e.mallocUint16=S;function k(R){return new Uint32Array(x(4*R),0,R)}e.mallocUint32=k;function M(R){return new Int8Array(x(R),0,R)}e.mallocInt8=M;function T(R){return new Int16Array(x(2*R),0,R)}e.mallocInt16=T;function c(R){return new Int32Array(x(4*R),0,R)}e.mallocInt32=c;function h(R){return new Float32Array(x(4*R),0,R)}e.mallocFloat32=e.mallocFloat=h;function b(R){return new Float64Array(x(8*R),0,R)}e.mallocFloat64=e.mallocDouble=b;function _(R){return a?new Uint8ClampedArray(x(R),0,R):y(R)}e.mallocUint8Clamped=_;function P(R){return s?new BigUint64Array(x(8*R),0,R):null}e.mallocBigUint64=P;function z(R){return f?new BigInt64Array(x(8*R),0,R):null}e.mallocBigInt64=z;function D(R){return new DataView(x(R),0,R)}e.mallocDataView=D;function B(R){R=i.nextPow2(R);var I=i.log2(R),F=m[I];return F.length>0?F.pop():new o(R)}e.mallocBuffer=B,e.clearCache=function(){for(var R=0;R<32;++R)v.UINT8[R].length=0,v.UINT16[R].length=0,v.UINT32[R].length=0,v.INT8[R].length=0,v.INT16[R].length=0,v.INT32[R].length=0,v.FLOAT[R].length=0,v.DOUBLE[R].length=0,v.BIGUINT64[R].length=0,v.BIGINT64[R].length=0,v.UINT8C[R].length=0,g[R].length=0,m[R].length=0}},1903:function(t){t.exports=e;function e(r){var i=new Float32Array(16);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}},1944:function(t,e,r){var i=r(5250),n=r(8210);t.exports=o;function o(a,s){for(var f=i(a[0],s[0]),v=1;v>1,B=f(h[D],b);B<=0?(B===0&&(z=D),_=D+1):B>0&&(P=D-1)}return z}e.findCell=w;function l(h,b){for(var _=new Array(h.length),P=0,z=_.length;P=h.length||f(h[rt],D)!==0););}return _}e.incidence=l;function x(h,b){if(!b)return l(m(S(h,0)),h);for(var _=new Array(b),P=0;P>>F&1&&I.push(z[F]);b.push(I)}return g(b)}e.explode=y;function S(h,b){if(b<0)return[];for(var _=[],P=(1<0}c=c.filter(h);for(var b=c.length,_=new Array(b),P=new Array(b),T=0;T0;){var nt=q.pop(),dt=st[nt];f(dt,function(te,Jt){return te-Jt});var Tt=dt.length,wt=it[nt],Ct;if(wt===0){var F=c[nt];Ct=[F]}for(var T=0;T=0)&&(it[It]=wt^1,q.push(It),wt===0)){var F=c[It];J(F)||(F.reverse(),Ct.push(F))}}wt===0&&y.push(Ct)}return y}},2145:function(t,e){e.uniforms=o,e.attributes=a;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},i=null;function n(s,f){if(!i){var v=Object.keys(r);i={};for(var g=0;g1)for(var x=0;x1&&B.drawBuffersWEBGL(n[D]);var N=b.getExtension("WEBGL_depth_texture");N?R?c.depth=l(b,P,z,N.UNSIGNED_INT_24_8_WEBGL,b.DEPTH_STENCIL,b.DEPTH_STENCIL_ATTACHMENT):I&&(c.depth=l(b,P,z,b.UNSIGNED_SHORT,b.DEPTH_COMPONENT,b.DEPTH_ATTACHMENT)):I&&R?c._depth_rb=x(b,P,z,b.DEPTH_STENCIL,b.DEPTH_STENCIL_ATTACHMENT):I?c._depth_rb=x(b,P,z,b.DEPTH_COMPONENT16,b.DEPTH_ATTACHMENT):R&&(c._depth_rb=x(b,P,z,b.STENCIL_INDEX,b.STENCIL_ATTACHMENT));var G=b.checkFramebufferStatus(b.FRAMEBUFFER);if(G!==b.FRAMEBUFFER_COMPLETE){c._destroyed=!0,b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(c.handle),c.handle=null,c.depth&&(c.depth.dispose(),c.depth=null),c._depth_rb&&(b.deleteRenderbuffer(c._depth_rb),c._depth_rb=null);for(var j=0;jP||b<0||b>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");c._shape[0]=h,c._shape[1]=b;for(var z=v(_),D=0;Dz||b<0||b>z)throw new Error("gl-fbo: Parameters are too large for FBO");_=_||{};var D=1;if("color"in _){if(D=Math.max(_.color|0,0),D<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(D>1)if(P){if(D>c.getParameter(P.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+D+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var B=c.UNSIGNED_BYTE,R=c.getExtension("OES_texture_float");if(_.float&&D>0){if(!R)throw new Error("gl-fbo: Context does not support floating point textures");B=c.FLOAT}else _.preferFloat&&D>0&&R&&(B=c.FLOAT);var I=!0;"depth"in _&&(I=!!_.depth);var F=!1;return"stencil"in _&&(F=!!_.stencil),new S(c,h,b,B,D,I,F,P)}},2272:function(t,e,r){var i=r(2646)[4];r(2478),t.exports=o;function n(a,s,f,v,g,m){var w=s.opposite(v,g);if(!(w<0)){if(g0;){for(var x=f.pop(),m=f.pop(),y=-1,S=-1,w=g[m],M=1;M=0||(s.flip(m,x),n(a,s,f,y,m,S),n(a,s,f,m,S,y),n(a,s,f,S,x,y),n(a,s,f,x,y,S))}}},2334:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.min(i[0],n[0]),r[1]=Math.min(i[1],n[1]),r[2]=Math.min(i[2],n[2]),r[3]=Math.min(i[3],n[3]),r}},2335:function(t){t.exports=e;function e(r){var i=new Float32Array(4);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i}},2361:function(t){var e=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),i=new Uint32Array(r.buffer);if(r[0]=1,e=!0,i[1]===1072693248){let o=function(f,v){return i[0]=f,i[1]=v,r[0]},a=function(f){return r[0]=f,i[0]},s=function(f){return r[0]=f,i[1]};t.exports=function(f){return r[0]=f,[i[0],i[1]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else if(i[0]===1072693248){let o=function(f,v){return i[1]=f,i[0]=v,r[0]},a=function(f){return r[0]=f,i[1]},s=function(f){return r[0]=f,i[0]};t.exports=function(f){return r[0]=f,[i[1],i[0]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else e=!1}if(!e){let o=function(f,v){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(v,4,!0),n.readDoubleLE(0,!0)},a=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(0,!0)},s=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);t.exports=function(f){return n.writeDoubleLE(f,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}t.exports.sign=function(o){return t.exports.hi(o)>>>31},t.exports.exponent=function(o){var a=t.exports.hi(o);return(a<<1>>>21)-1023},t.exports.fraction=function(o){var a=t.exports.lo(o),s=t.exports.hi(o),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[a,f]},t.exports.denormalized=function(o){var a=t.exports.hi(o);return!(a&2146435072)}},2408:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[0],f=i[1],v=i[2],g=i[3],m=i[8],w=i[9],l=i[10],x=i[11];return i!==r&&(r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*a-m*o,r[1]=f*a-w*o,r[2]=v*a-l*o,r[3]=g*a-x*o,r[8]=s*o+m*a,r[9]=f*o+w*a,r[10]=v*o+l*a,r[11]=g*o+x*a,r}},2419:function(t){t.exports=e;function e(r){for(var i=1,n=1;nS-y?o(f,v,g,m,w,l,x,y,S,k,M):a(f,v,g,m,w,l,x,y,S,k,M)}return s}function i(){function o(g,m,w,l,x,y,S,k,M,T,c){for(var h=2*g,b=l,_=h*l;bT-M?l?o(g,m,w,x,y,S,k,M,T,c,h):a(g,m,w,x,y,S,k,M,T,c,h):l?s(g,m,w,x,y,S,k,M,T,c,h):f(g,m,w,x,y,S,k,M,T,c,h)}return v}function n(o){return o?r():i()}e.partial=n(!1),e.full=n(!0)},2478:function(t){function e(s,f,v,g,m){for(var w=m+1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y>=0?(w=l,m=l-1):g=l+1}return w}function r(s,f,v,g,m){for(var w=m+1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y>0?(w=l,m=l-1):g=l+1}return w}function i(s,f,v,g,m){for(var w=g-1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y<0?(w=l,g=l+1):m=l-1}return w}function n(s,f,v,g,m){for(var w=g-1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y<=0?(w=l,g=l+1):m=l-1}return w}function o(s,f,v,g,m){for(;g<=m;){var w=g+m>>>1,l=s[w],x=v!==void 0?v(l,f):l-f;if(x===0)return w;x<=0?g=w+1:m=w-1}return-1}function a(s,f,v,g,m,w){return typeof v=="function"?w(s,f,v,g===void 0?0:g|0,m===void 0?s.length-1:m|0):w(s,f,void 0,v===void 0?0:v|0,g===void 0?s.length-1:g|0)}t.exports={ge:function(s,f,v,g,m){return a(s,f,v,g,m,e)},gt:function(s,f,v,g,m){return a(s,f,v,g,m,r)},lt:function(s,f,v,g,m){return a(s,f,v,g,m,i)},le:function(s,f,v,g,m){return a(s,f,v,g,m,n)},eq:function(s,f,v,g,m){return a(s,f,v,g,m,o)}}},2504:function(t){t.exports=e;function e(r,i,n){var o=n[0],a=n[1],s=n[2];return r[0]=i[0]*o,r[1]=i[1]*o,r[2]=i[2]*o,r[3]=i[3]*o,r[4]=i[4]*a,r[5]=i[5]*a,r[6]=i[6]*a,r[7]=i[7]*a,r[8]=i[8]*s,r[9]=i[9]*s,r[10]=i[10]*s,r[11]=i[11]*s,r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],r}},2538:function(t,e,r){var i=r(8902),n=r(5542),o=r(2272),a=r(5023);t.exports=m;function s(w){return[Math.min(w[0],w[1]),Math.max(w[0],w[1])]}function f(w,l){return w[0]-l[0]||w[1]-l[1]}function v(w){return w.map(s).sort(f)}function g(w,l,x){return l in w?w[l]:x}function m(w,l,x){Array.isArray(l)?(x=x||{},l=l||[]):(x=l||{},l=[]);var y=!!g(x,"delaunay",!0),S=!!g(x,"interior",!0),k=!!g(x,"exterior",!0),M=!!g(x,"infinity",!1);if(!S&&!k||w.length===0)return[];var T=i(w,l);if(y||S!==k||M){for(var c=n(w.length,v(l)),h=0;h0){if(G=1,st[Z++]=v(M[b],l,x,y),b+=F,S>0)for(N=1,_=M[b],ot=st[Z]=v(_,l,x,y),ut=st[Z+X],it=st[Z+J],Tt=st[Z+nt],(ot!==ut||ot!==it||ot!==Tt)&&(z=M[b+P],B=M[b+D],I=M[b+R],s(N,G,_,z,B,I,ot,ut,it,Tt,l,x,y),wt=et[Z]=rt++),Z+=1,b+=F,N=2;N0)for(N=1,_=M[b],ot=st[Z]=v(_,l,x,y),ut=st[Z+X],it=st[Z+J],Tt=st[Z+nt],(ot!==ut||ot!==it||ot!==Tt)&&(z=M[b+P],B=M[b+D],I=M[b+R],s(N,G,_,z,B,I,ot,ut,it,Tt,l,x,y),wt=et[Z]=rt++,Tt!==it&&f(et[Z+J],wt,B,I,it,Tt,l,x,y)),Z+=1,b+=F,N=2;N0){if(N=1,st[Z++]=v(M[b],l,x,y),b+=F,k>0)for(G=1,_=M[b],ot=st[Z]=v(_,l,x,y),it=st[Z+J],ut=st[Z+X],Tt=st[Z+nt],(ot!==it||ot!==ut||ot!==Tt)&&(z=M[b+P],B=M[b+D],I=M[b+R],s(N,G,_,z,B,I,ot,it,ut,Tt,l,x,y),wt=et[Z]=rt++),Z+=1,b+=F,G=2;G0)for(G=1,_=M[b],ot=st[Z]=v(_,l,x,y),it=st[Z+J],ut=st[Z+X],Tt=st[Z+nt],(ot!==it||ot!==ut||ot!==Tt)&&(z=M[b+P],B=M[b+D],I=M[b+R],s(N,G,_,z,B,I,ot,it,ut,Tt,l,x,y),wt=et[Z]=rt++,Tt!==it&&f(et[Z+J],wt,I,z,Tt,it,l,x,y)),Z+=1,b+=F,G=2;G 0"),typeof s.vertex!="function"&&f("Must specify vertex creation function"),typeof s.cell!="function"&&f("Must specify cell creation function"),typeof s.phase!="function"&&f("Must specify phase function");for(var w=s.getters||[],l=new Array(g),x=0;x=0?l[x]=!0:l[x]=!1;return o(s.vertex,s.cell,s.phase,m,v,l)}},2642:function(t,e,r){t.exports=o;var i=r(727);function n(a){for(var s=0,f=0;fl[1][2]&&(_[0]=-_[0]),l[0][2]>l[2][0]&&(_[1]=-_[1]),l[1][0]>l[0][1]&&(_[2]=-_[2]),!0};function y(M,T,c){var h=T[0],b=T[1],_=T[2],P=T[3];return M[0]=c[0]*h+c[4]*b+c[8]*_+c[12]*P,M[1]=c[1]*h+c[5]*b+c[9]*_+c[13]*P,M[2]=c[2]*h+c[6]*b+c[10]*_+c[14]*P,M[3]=c[3]*h+c[7]*b+c[11]*_+c[15]*P,M}function S(M,T){M[0][0]=T[0],M[0][1]=T[1],M[0][2]=T[2],M[1][0]=T[4],M[1][1]=T[5],M[1][2]=T[6],M[2][0]=T[8],M[2][1]=T[9],M[2][2]=T[10]}function k(M,T,c,h,b){M[0]=T[0]*h+c[0]*b,M[1]=T[1]*h+c[1]*b,M[2]=T[2]*h+c[2]*b}},2653:function(t,e,r){var i=r(3865);t.exports=n;function n(o,a){for(var s=o.length,f=new Array(s),v=0;v=v[S]&&(y+=1);l[x]=y}}return f}function s(f,v){try{return i(f,!0)}catch{var g=n(f);if(g.length<=v)return[];var m=o(f,g),w=i(m,!0);return a(w,g)}}},2762:function(t,e,r){var i=r(1888),n=r(5298),o=r(9618),a=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,x,y,S,k){this.gl=l,this.type=x,this.handle=y,this.length=S,this.usage=k}var f=s.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)};function v(l,x,y,S,k,M){var T=k.length*k.BYTES_PER_ELEMENT;if(M<0)return l.bufferData(x,k,S),T;if(T+M>y)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(x,M,k),y}function g(l,x){for(var y=i.malloc(l.length,x),S=l.length,k=0;k=0;--S){if(x[S]!==y)return!1;y*=l[S]}return!0}f.update=function(l,x){if(typeof x!="number"&&(x=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var y=l.dtype;if(a.indexOf(y)<0&&(y="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&y!=="uint16"?y="uint32":y="uint16"}if(y===l.dtype&&m(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=v(this.gl,this.type,this.length,this.usage,l.data,x):this.length=v(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),x);else{var k=i.malloc(l.size,y),M=o(k,l.shape);n.assign(M,l),x<0?this.length=v(this.gl,this.type,this.length,this.usage,k,x):this.length=v(this.gl,this.type,this.length,this.usage,k.subarray(0,l.size),x),i.free(k)}}else if(Array.isArray(l)){var T;this.type===this.gl.ELEMENT_ARRAY_BUFFER?T=g(l,"uint16"):T=g(l,"float32"),x<0?this.length=v(this.gl,this.type,this.length,this.usage,T,x):this.length=v(this.gl,this.type,this.length,this.usage,T.subarray(0,l.length),x),i.free(T)}else if(typeof l=="object"&&typeof l.length=="number")this.length=v(this.gl,this.type,this.length,this.usage,l,x);else if(typeof l=="number"||l===void 0){if(x>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function w(l,x,y,S){if(y=y||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,y!==l.ARRAY_BUFFER&&y!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var k=l.createBuffer(),M=new s(l,y,k,0,S);return M.update(x),M}t.exports=w},2825:function(t){t.exports=e;function e(r,i,n){var o=new Float32Array(3);return o[0]=r,o[1]=i,o[2]=n,o}},2931:function(t,e,r){t.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},2933:function(t){t.exports=e;function e(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r}},2953:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2];return n*n+o*o+a*a}},2962:function(t,e,r){var i=r(5250),n=r(8210),o=r(3012),a=r(7004),s=6;function f(S,k,M,T){return function(c){return T(S(M(c[0][0],c[1][1]),M(-c[0][1],c[1][0])))}}function v(S,k,M,T){return function(c){return T(S(k(S(M(c[1][1],c[2][2]),M(-c[1][2],c[2][1])),c[0][0]),S(k(S(M(c[1][0],c[2][2]),M(-c[1][2],c[2][0])),-c[0][1]),k(S(M(c[1][0],c[2][1]),M(-c[1][1],c[2][0])),c[0][2]))))}}function g(S,k,M,T){return function(c){return T(S(S(k(S(k(S(M(c[2][2],c[3][3]),M(-c[2][3],c[3][2])),c[1][1]),S(k(S(M(c[2][1],c[3][3]),M(-c[2][3],c[3][1])),-c[1][2]),k(S(M(c[2][1],c[3][2]),M(-c[2][2],c[3][1])),c[1][3]))),c[0][0]),k(S(k(S(M(c[2][2],c[3][3]),M(-c[2][3],c[3][2])),c[1][0]),S(k(S(M(c[2][0],c[3][3]),M(-c[2][3],c[3][0])),-c[1][2]),k(S(M(c[2][0],c[3][2]),M(-c[2][2],c[3][0])),c[1][3]))),-c[0][1])),S(k(S(k(S(M(c[2][1],c[3][3]),M(-c[2][3],c[3][1])),c[1][0]),S(k(S(M(c[2][0],c[3][3]),M(-c[2][3],c[3][0])),-c[1][1]),k(S(M(c[2][0],c[3][1]),M(-c[2][1],c[3][0])),c[1][3]))),c[0][2]),k(S(k(S(M(c[2][1],c[3][2]),M(-c[2][2],c[3][1])),c[1][0]),S(k(S(M(c[2][0],c[3][2]),M(-c[2][2],c[3][0])),-c[1][1]),k(S(M(c[2][0],c[3][1]),M(-c[2][1],c[3][0])),c[1][2]))),-c[0][3]))))}}function m(S,k,M,T){return function(c){return T(S(S(k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][2]),S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),-c[2][3]),k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][4]))),c[1][1]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][3]),k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][4]))),-c[1][2])),S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][3]))),-c[1][4]))),c[0][0]),k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][2]),S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),-c[2][3]),k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][3]),k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),c[2][4]))),-c[1][2])),S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][3]))),-c[1][4]))),-c[0][1])),S(k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][3]),k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][3]),k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),c[2][4]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][3]))),-c[1][4]))),c[0][2]),S(k(S(S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][4]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][4]))),c[1][2]),k(S(k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][2]))),-c[1][4]))),-c[0][3]),k(S(S(k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][3]))),c[1][0]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][3]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][3]))),c[1][2]),k(S(k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][2]))),-c[1][3]))),c[0][4])))))}}function w(S){var k=S===2?f:S===3?v:S===4?g:S===5?m:void 0;return k(n,o,i,a)}var l=[function(){return[0]},function(S){return[S[0][0]]}];function x(S,k,M,T,c,h,b,_){return function(P){switch(P.length){case 0:return S(P);case 1:return k(P);case 2:return M(P);case 3:return T(P);case 4:return c(P);case 5:return h(P)}var z=b[P.length];return z||(z=b[P.length]=_(P.length)),z(P)}}function y(){for(;l.length0){_=v[D][h][0],z=D;break}P=_[z^1];for(var B=0;B<2;++B)for(var R=v[B][h],I=0;I0&&(_=F,P=j,z=B)}return b||_&&l(_,z),P}function y(c,h){var b=v[h][c][0],_=[c];l(b,h);for(var P=b[h^1],z=h;;){for(;P!==c;)_.push(P),P=x(_[_.length-2],P,!1);if(v[0][c].length+v[1][c].length===0)break;var D=_[_.length-1],B=c,R=_[1],I=x(D,B,!0);if(i(a[D],a[B],a[R],a[I])<0)break;_.push(c),P=x(D,B)}return _}function S(c,h){return h[1]===h[h.length-1]}for(var g=0;g0;){v[0][g].length;var T=y(g,k);S(M,T)?M.push.apply(M,T):(M.length>0&&w.push(M),M=T)}M.length>0&&w.push(M)}return w}},3090:function(t,e,r){t.exports=n;var i=r(3250)[3];function n(o){var a=o.length;if(a<3){for(var s=new Array(a),f=0;f1&&i(o[g[x-2]],o[g[x-1]],l)<=0;)x-=1,g.pop();for(g.push(w),x=m.length;x>1&&i(o[m[x-2]],o[m[x-1]],l)>=0;)x-=1,m.pop();m.push(w)}for(var s=new Array(m.length+g.length-2),y=0,f=0,S=g.length;f0;--k)s[y++]=m[k];return s}},3105:function(t,e){"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<0)-(o<0)},e.abs=function(o){var a=o>>r-1;return(o^a)-a},e.min=function(o,a){return a^(o^a)&-(o65535)<<4,o>>>=a,s=(o>255)<<3,o>>>=s,a|=s,s=(o>15)<<2,o>>>=s,a|=s,s=(o>3)<<1,o>>>=s,a|=s,a|o>>1},e.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},e.popCount=function(o){return o=o-(o>>>1&1431655765),o=(o&858993459)+(o>>>2&858993459),(o+(o>>>4)&252645135)*16843009>>>24};function i(o){var a=32;return o&=-o,o&&a--,o&65535&&(a-=16),o&16711935&&(a-=8),o&252645135&&(a-=4),o&858993459&&(a-=2),o&1431655765&&(a-=1),a}e.countTrailingZeros=i,e.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o+1},e.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o-(o>>>1)},e.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,o&=15,27030>>>o&1};var n=new Array(256);(function(o){for(var a=0;a<256;++a){var s=a,f=a,v=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--v;o[a]=f<>>8&255]<<16|n[o>>>16&255]<<8|n[o>>>24&255]},e.interleave2=function(o,a){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o|a<<1},e.deinterleave2=function(o,a){return o=o>>>a&1431655765,o=(o|o>>>1)&858993459,o=(o|o>>>2)&252645135,o=(o|o>>>4)&16711935,o=(o|o>>>16)&65535,o<<16>>16},e.interleave3=function(o,a,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o|s<<2},e.deinterleave3=function(o,a){return o=o>>>a&1227133513,o=(o|o>>>2)&3272356035,o=(o|o>>>4)&251719695,o=(o|o>>>8)&4278190335,o=(o|o>>>16)&1023,o<<22>>22},e.nextCombination=function(o){var a=o|o-1;return a+1|(~a&-~a)-1>>>i(o)+1}},3126:function(t){t.exports=e;function e(r){var i=new Float32Array(3);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i}},3134:function(t,e,r){t.exports=n;var i=r(1682);function n(o,a){var s=o.length;if(typeof a!="number"){a=0;for(var f=0;f=0}function v(g,m,w,l){var x=i(m,w,l);if(x===0){var y=n(i(g,m,w)),S=n(i(g,m,l));if(y===S){if(y===0){var k=f(g,m,w),M=f(g,m,l);return k===M?0:k?1:-1}return 0}else{if(S===0)return y>0||f(g,m,l)?-1:1;if(y===0)return S>0||f(g,m,w)?1:-1}return n(S-y)}var T=i(g,m,w);if(T>0)return x>0&&i(g,m,l)>0?1:-1;if(T<0)return x>0||i(g,m,l)>0?1:-1;var c=i(g,m,l);return c>0||f(g,m,w)?1:-1}},3202:function(t){t.exports=function(e,r){r||(r=[0,""]),e=String(e);var i=parseFloat(e,10);return r[0]=i,r[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",r}},3233:function(t){var e="",r;t.exports=i;function i(n,o){if(typeof n!="string")throw new TypeError("expected a string");if(o===1)return n;if(o===2)return n+n;var a=n.length*o;if(r!==n||typeof r>"u")r=n,e="";else if(e.length>=a)return e.substr(0,a);for(;a>e.length&&o>1;)o&1&&(e+=n),o>>=1,n+=n;return e+=n,e=e.substr(0,a),e}},3236:function(t){t.exports=function(e){typeof e=="string"&&(e=[e]);for(var r=[].slice.call(arguments,1),i=[],n=0;n0){if(z<=0)return D;B=P+z}else if(P<0){if(z>=0)return D;B=-(P+z)}else return D;var R=v*B;return D>=R||D<=-R?D:y(h,b,_)},function(h,b,_,P){var z=h[0]-P[0],D=b[0]-P[0],B=_[0]-P[0],R=h[1]-P[1],I=b[1]-P[1],F=_[1]-P[1],j=h[2]-P[2],N=b[2]-P[2],G=_[2]-P[2],rt=D*F,ct=B*I,st=B*R,et=z*F,Z=z*I,ot=D*R,X=j*(rt-ct)+N*(st-et)+G*(Z-ot),Q=(Math.abs(rt)+Math.abs(ct))*Math.abs(j)+(Math.abs(st)+Math.abs(et))*Math.abs(N)+(Math.abs(Z)+Math.abs(ot))*Math.abs(G),ut=g*Q;return X>ut||-X>ut?X:S(h,b,_,P)}];function M(h){var b=k[h.length];return b||(b=k[h.length]=x(h.length)),b.apply(void 0,h)}function T(h,b,_,P,z,D,B){return function(R,I,F,j,N){switch(arguments.length){case 0:case 1:return 0;case 2:return P(R,I);case 3:return z(R,I,F);case 4:return D(R,I,F,j);case 5:return B(R,I,F,j,N)}for(var G=new Array(arguments.length),rt=0;rt4)throw new n("","Invalid data type");switch(j.charAt(0)){case"b":case"i":f["uniform"+N+"iv"](m[z],D);break;case"v":f["uniform"+N+"fv"](m[z],D);break;default:throw new n("","Unrecognized data type for vector "+name+": "+j)}}else if(j.indexOf("mat")===0&&j.length===4){if(N=j.charCodeAt(j.length-1)-48,N<2||N>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+j);f["uniformMatrix"+N+"fv"](m[z],!1,D);break}else throw new n("","Unknown uniform data type for "+name+": "+j)}}}}}function x(T,c){if(typeof c!="object")return[[T,c]];var h=[];for(var b in c){var _=c[b],P=T;parseInt(b)+""===b?P+="["+b+"]":P+="."+b,typeof _=="object"?h.push.apply(h,x(P,_)):h.push([P,_])}return h}function y(T){switch(T){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var c=T.indexOf("vec");if(0<=c&&c<=1&&T.length===4+c){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new n("","Invalid data type");return T.charAt(0)==="b"?a(h,!1):a(h,0)}else if(T.indexOf("mat")===0&&T.length===4){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+T);return a(h*h,0)}else throw new n("","Unknown uniform data type for "+name+": "+T)}}function S(T,c,h){if(typeof h=="object"){var b=k(h);Object.defineProperty(T,c,{get:o(b),set:l(h),enumerable:!0,configurable:!1})}else m[h]?Object.defineProperty(T,c,{get:w(h),set:l(h),enumerable:!0,configurable:!1}):T[c]=y(g[h].type)}function k(T){var c;if(Array.isArray(T)){c=new Array(T.length);for(var h=0;h=0!=c>=0&&m.push(y[0]+.5+.5*(T+c)/(T-c))}g+=M,++y[0]}}}function r(){return e()}var i=r;function n(s){var f={};return function(v,g,m){var w=v.dtype,l=v.order,x=[w,l.join()].join(),y=f[x];return y||(f[x]=y=s([w,l])),y(v.shape.slice(0),v.data,v.stride,v.offset|0,g,m)}}function o(s){return n(i.bind(void 0,s))}function a(s){return o({funcName:s.funcName})}t.exports=a({funcName:"zeroCrossings"})},3352:function(t,e,r){var i=r(2478),n=0,o=1,a=2;t.exports=b;function s(_,P,z,D,B){this.mid=_,this.left=P,this.right=z,this.leftPoints=D,this.rightPoints=B,this.count=(P?P.count:0)+(z?z.count:0)+D.length}var f=s.prototype;function v(_,P){_.mid=P.mid,_.left=P.left,_.right=P.right,_.leftPoints=P.leftPoints,_.rightPoints=P.rightPoints,_.count=P.count}function g(_,P){var z=T(P);_.mid=z.mid,_.left=z.left,_.right=z.right,_.leftPoints=z.leftPoints,_.rightPoints=z.rightPoints,_.count=z.count}function m(_,P){var z=_.intervals([]);z.push(P),g(_,z)}function w(_,P){var z=_.intervals([]),D=z.indexOf(P);return D<0?n:(z.splice(D,1),g(_,z),o)}f.intervals=function(_){return _.push.apply(_,this.leftPoints),this.left&&this.left.intervals(_),this.right&&this.right.intervals(_),_},f.insert=function(_){var P=this.count-this.leftPoints.length;if(this.count+=1,_[1]3*(P+1)?m(this,_):this.left.insert(_):this.left=T([_]);else if(_[0]>this.mid)this.right?4*(this.right.count+1)>3*(P+1)?m(this,_):this.right.insert(_):this.right=T([_]);else{var z=i.ge(this.leftPoints,_,k),D=i.ge(this.rightPoints,_,M);this.leftPoints.splice(z,0,_),this.rightPoints.splice(D,0,_)}},f.remove=function(_){var P=this.count-this.leftPoints;if(_[1]3*(P-1))return w(this,_);var D=this.left.remove(_);return D===a?(this.left=null,this.count-=1,o):(D===o&&(this.count-=1),D)}else if(_[0]>this.mid){if(!this.right)return n;var B=this.left?this.left.count:0;if(4*B>3*(P-1))return w(this,_);var D=this.right.remove(_);return D===a?(this.right=null,this.count-=1,o):(D===o&&(this.count-=1),D)}else{if(this.count===1)return this.leftPoints[0]===_?a:n;if(this.leftPoints.length===1&&this.leftPoints[0]===_){if(this.left&&this.right){for(var R=this,I=this.left;I.right;)R=I,I=I.right;if(R===this)I.right=this.right;else{var F=this.left,D=this.right;R.count-=I.count,R.right=I.left,I.left=F,I.right=D}v(this,I),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?v(this,this.left):v(this,this.right);return o}for(var F=i.ge(this.leftPoints,_,k);F=0&&_[D][1]>=P;--D){var B=z(_[D]);if(B)return B}}function y(_,P){for(var z=0;z<_.length;++z){var D=P(_[z]);if(D)return D}}f.queryPoint=function(_,P){if(_this.mid){if(this.right){var z=this.right.queryPoint(_,P);if(z)return z}return x(this.rightPoints,_,P)}else return y(this.leftPoints,P)},f.queryInterval=function(_,P,z){if(_this.mid&&this.right){var D=this.right.queryInterval(_,P,z);if(D)return D}return Pthis.mid?x(this.rightPoints,_,z):y(this.leftPoints,z)};function S(_,P){return _-P}function k(_,P){var z=_[0]-P[0];return z||_[1]-P[1]}function M(_,P){var z=_[1]-P[1];return z||_[0]-P[0]}function T(_){if(_.length===0)return null;for(var P=[],z=0;z<_.length;++z)P.push(_[z][0],_[z][1]);P.sort(S);for(var D=P[P.length>>1],B=[],R=[],I=[],z=0;z<_.length;++z){var F=_[z];F[1]=0),M.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,M.width?parseInt(M.width):0);break;case"e":x=M.precision?parseFloat(x).toExponential(M.precision):parseFloat(x).toExponential();break;case"f":x=M.precision?parseFloat(x).toFixed(M.precision):parseFloat(x);break;case"g":x=M.precision?String(Number(x.toPrecision(M.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x),x=M.precision?x.substring(0,M.precision):x;break;case"t":x=String(!!x),x=M.precision?x.substring(0,M.precision):x;break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase(),x=M.precision?x.substring(0,M.precision):x;break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf(),x=M.precision?x.substring(0,M.precision):x;break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}n.json.test(M.type)?y+=x:(n.number.test(M.type)&&(!b||M.sign)?(_=b?"+":"-",x=x.toString().replace(n.sign,"")):_="",c=M.pad_char?M.pad_char==="0"?"0":M.pad_char.charAt(1):" ",h=M.width-(_+x).length,T=M.width&&h>0?c.repeat(h):"",y+=M.align?_+x+T:c==="0"?_+T+x:T+_+x)}return y}var f=Object.create(null);function v(g){if(f[g])return f[g];for(var m=g,w,l=[],x=0;m;){if((w=n.text.exec(m))!==null)l.push(w[0]);else if((w=n.modulo.exec(m))!==null)l.push("%");else if((w=n.placeholder.exec(m))!==null){if(w[2]){x|=1;var y=[],S=w[2],k=[];if((k=n.key.exec(S))!==null)for(y.push(k[1]);(S=S.substring(k[0].length))!=="";)if((k=n.key_access.exec(S))!==null)y.push(k[1]);else if((k=n.index_access.exec(S))!==null)y.push(k[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");w[2]=y}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:w[0],param_no:w[1],keys:w[2],sign:w[3],pad_char:w[4],align:w[5],width:w[6],precision:w[7],type:w[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");m=m.substring(w[0].length)}return f[g]=l}e.sprintf=o,e.vsprintf=a,typeof window<"u"&&(window.sprintf=o,window.vsprintf=a,i=function(){return{sprintf:o,vsprintf:a}}.call(e,r,e,t),i!==void 0&&(t.exports=i))})()},3390:function(t){t.exports=e;function e(r,i,n,o){var a=new Float32Array(4);return a[0]=r,a[1]=i,a[2]=n,a[3]=o,a}},3436:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position, offset; -attribute vec4 color; -uniform mat4 model, view, projection; -uniform float capSize; -varying vec4 fragColor; -varying vec3 fragPosition; - -void main() { - vec4 worldPosition = model * vec4(position, 1.0); - worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); - gl_Position = projection * (view * worldPosition); - fragColor = color; - fragPosition = position; -}`]),a=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float opacity; -varying vec3 fragPosition; -varying vec4 fragColor; - -void main() { - if ( - outOfRange(clipBounds[0], clipBounds[1], fragPosition) || - fragColor.a * opacity == 0. - ) discard; - - gl_FragColor = opacity * fragColor; -}`]);t.exports=function(s){return n(s,o,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},3502:function(t,e,r){t.exports=o;var i=r(5995),n=r(9127);function o(a,s){return n(i(a,s))}},3508:function(t,e,r){var i=r(6852);i=i.slice().filter(function(n){return!/^(gl\_|texture)/.test(n)}),t.exports=i.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},3536:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=n*n+o*o+a*a;return s>0&&(s=1/Math.sqrt(s),r[0]=i[0]*s,r[1]=i[1]*s,r[2]=i[2]*s),r}},3545:function(t,e,r){t.exports=s;var i=r(8105),n=i("log&&w[T+v]>k;--M,T-=x){for(var c=T,h=T+x,b=0;b>>1,k=2*f,M=S,T=w[k*S+v];x=P?(M=_,T=P):b>=D?(M=h,T=b):(M=z,T=D):P>=D?(M=_,T=P):D>=b?(M=h,T=b):(M=z,T=D);for(var B=k*(y-1),R=k*M,I=0;Ithis.buffer.length){n.free(this.buffer);for(var y=this.buffer=n.mallocUint8(a(x*l*4)),S=0;Sk|0},vertex:function(x,y,S,k,M,T,c,h,b,_,P,z,D){var B=(c<<0)+(h<<1)+(b<<2)+(_<<3)|0;if(!(B===0||B===15))switch(B){case 0:P.push([x-.5,y-.5]);break;case 1:P.push([x-.25-.25*(k+S-2*D)/(S-k),y-.25-.25*(M+S-2*D)/(S-M)]);break;case 2:P.push([x-.75-.25*(-k-S+2*D)/(k-S),y-.25-.25*(T+k-2*D)/(k-T)]);break;case 3:P.push([x-.5,y-.5-.5*(M+S+T+k-4*D)/(S-M+k-T)]);break;case 4:P.push([x-.25-.25*(T+M-2*D)/(M-T),y-.75-.25*(-M-S+2*D)/(M-S)]);break;case 5:P.push([x-.5-.5*(k+S+T+M-4*D)/(S-k+M-T),y-.5]);break;case 6:P.push([x-.5-.25*(-k-S+T+M)/(k-S+M-T),y-.5-.25*(-M-S+T+k)/(M-S+k-T)]);break;case 7:P.push([x-.75-.25*(T+M-2*D)/(M-T),y-.75-.25*(T+k-2*D)/(k-T)]);break;case 8:P.push([x-.75-.25*(-T-M+2*D)/(T-M),y-.75-.25*(-T-k+2*D)/(T-k)]);break;case 9:P.push([x-.5-.25*(k+S+-T-M)/(S-k+T-M),y-.5-.25*(M+S+-T-k)/(S-M+T-k)]);break;case 10:P.push([x-.5-.5*(-k-S+-T-M+4*D)/(k-S+T-M),y-.5]);break;case 11:P.push([x-.25-.25*(-T-M+2*D)/(T-M),y-.75-.25*(M+S-2*D)/(S-M)]);break;case 12:P.push([x-.5,y-.5-.5*(-M-S+-T-k+4*D)/(M-S+T-k)]);break;case 13:P.push([x-.75-.25*(k+S-2*D)/(S-k),y-.25-.25*(-T-k+2*D)/(T-k)]);break;case 14:P.push([x-.25-.25*(-k-S+2*D)/(k-S),y-.25-.25*(-M-S+2*D)/(M-S)]);break;case 15:P.push([x-.5,y-.5]);break}},cell:function(x,y,S,k,M,T,c,h,b){M?h.push([x,y]):h.push([y,x])}});return function(x,y){var S=[],k=[];return l(x,S,k,y),{positions:S,cells:k}}}};function a(g,m){var w=g.length+"d",l=o[w];if(l)return l(i,g,m)}function s(g,m){for(var w=n(g,m),l=w.length,x=new Array(l),y=new Array(l),S=0;S>1,w=-7,l=n?a-1:0,x=n?-1:1,y=r[i+l];for(l+=x,s=y&(1<<-w)-1,y>>=-w,w+=v;w>0;s=s*256+r[i+l],l+=x,w-=8);for(f=s&(1<<-w)-1,s>>=-w,w+=o;w>0;f=f*256+r[i+l],l+=x,w-=8);if(s===0)s=1-m;else{if(s===g)return f?NaN:(y?-1:1)*(1/0);f=f+Math.pow(2,o),s=s-m}return(y?-1:1)*f*Math.pow(2,s-o)},e.write=function(r,i,n,o,a,s){var f,v,g,m=s*8-a-1,w=(1<>1,x=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=o?0:s-1,S=o?1:-1,k=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(v=isNaN(i)?1:0,f=w):(f=Math.floor(Math.log(i)/Math.LN2),i*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+l>=1?i+=x/g:i+=x*Math.pow(2,1-l),i*g>=2&&(f++,g/=2),f+l>=w?(v=0,f=w):f+l>=1?(v=(i*g-1)*Math.pow(2,a),f=f+l):(v=i*Math.pow(2,l-1)*Math.pow(2,a),f=0));a>=8;r[n+y]=v&255,y+=S,v/=256,a-=8);for(f=f<0;r[n+y]=f&255,y+=S,f/=256,m-=8);r[n+y-S]|=k*128}},3788:function(t,e,r){var i=r(8507),n=r(2419);t.exports=o;function o(a,s){return i(a,s)||n(a)-n(s)}},3837:function(t,e,r){t.exports=z;var i=r(4935),n=r(501),o=r(5304),a=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),v=ArrayBuffer,g=DataView;function m(D){return v.isView(D)&&!(D instanceof g)}function w(D){return Array.isArray(D)||m(D)}function l(D,B){return D[0]=B[0],D[1]=B[1],D[2]=B[2],D}function x(D){this.gl=D,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=o(D)}var y=x.prototype;y.update=function(D){D=D||{};function B(Q,ut,J){if(J in D){var q=D[J],it=this[J],nt;(Q?w(q)&&w(q[0]):w(q))?this[J]=nt=[ut(q[0]),ut(q[1]),ut(q[2])]:this[J]=nt=[ut(q),ut(q),ut(q)];for(var dt=0;dt<3;++dt)if(nt[dt]!==it[dt])return!0}return!1}var R=B.bind(this,!1,Number),I=B.bind(this,!1,Boolean),F=B.bind(this,!1,String),j=B.bind(this,!0,function(Q){if(w(Q)){if(Q.length===3)return[+Q[0],+Q[1],+Q[2],1];if(Q.length===4)return[+Q[0],+Q[1],+Q[2],+Q[3]]}return[0,0,0,1]}),N,G=!1,rt=!1;if("bounds"in D)for(var ct=D.bounds,st=0;st<2;++st)for(var et=0;et<3;++et)ct[st][et]!==this.bounds[st][et]&&(rt=!0),this.bounds[st][et]=ct[st][et];if("ticks"in D){N=D.ticks,G=!0,this.autoTicks=!1;for(var st=0;st<3;++st)this.tickSpacing[st]=0}else R("tickSpacing")&&(this.autoTicks=!0,rt=!0);if(this._firstInit&&("ticks"in D||"tickSpacing"in D||(this.autoTicks=!0),rt=!0,G=!0,this._firstInit=!1),rt&&this.autoTicks&&(N=s.create(this.bounds,this.tickSpacing),G=!0),G){for(var st=0;st<3;++st)N[st].sort(function(ut,J){return ut.x-J.x});s.equal(N,this.ticks)?G=!1:this.ticks=N}I("tickEnable"),F("tickFont")&&(G=!0),F("tickFontStyle")&&(G=!0),F("tickFontWeight")&&(G=!0),F("tickFontVariant")&&(G=!0),R("tickSize"),R("tickAngle"),R("tickPad"),j("tickColor");var Z=F("labels");F("labelFont")&&(Z=!0),F("labelFontStyle")&&(Z=!0),F("labelFontWeight")&&(Z=!0),F("labelFontVariant")&&(Z=!0),I("labelEnable"),R("labelSize"),R("labelPad"),j("labelColor"),I("lineEnable"),I("lineMirror"),R("lineWidth"),j("lineColor"),I("lineTickEnable"),I("lineTickMirror"),R("lineTickLength"),R("lineTickWidth"),j("lineTickColor"),I("gridEnable"),R("gridWidth"),j("gridColor"),I("zeroEnable"),j("zeroLineColor"),R("zeroLineWidth"),I("backgroundEnable"),j("backgroundColor");var ot=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],X=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(Z||G)&&this._text.update(this.bounds,this.labels,ot,this.ticks,X):this._text=i(this.gl,this.bounds,this.labels,ot,this.ticks,X),this._lines&&G&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var k=[new S,new S,new S];function M(D,B,R,I,F){for(var j=D.primalOffset,N=D.primalMinor,G=D.mirrorOffset,rt=D.mirrorMinor,ct=I[B],st=0;st<3;++st)if(B!==st){var et=j,Z=G,ot=N,X=rt;ct&1<0?(ot[st]=-1,X[st]=0):(ot[st]=0,X[st]=1)}}var T=[0,0,0],c={model:f,view:f,projection:f,_ortho:!1};y.isOpaque=function(){return!0},y.isTransparent=function(){return!1},y.drawTransparent=function(D){};var h=0,b=[0,0,0],_=[0,0,0],P=[0,0,0];y.draw=function(D){D=D||c;for(var B=this.gl,R=D.model||f,I=D.view||f,F=D.projection||f,j=this.bounds,N=D._ortho||!1,G=a(R,I,F,j,N),rt=G.cubeEdges,ct=G.axis,st=I[12],et=I[13],Z=I[14],ot=I[15],X=N?2:1,Q=X*this.pixelRatio*(F[3]*st+F[7]*et+F[11]*Z+F[15]*ot)/B.drawingBufferHeight,ut=0;ut<3;++ut)this.lastCubeProps.cubeEdges[ut]=rt[ut],this.lastCubeProps.axis[ut]=ct[ut];for(var J=k,ut=0;ut<3;++ut)M(k[ut],ut,this.bounds,rt,ct);for(var B=this.gl,q=T,ut=0;ut<3;++ut)this.backgroundEnable[ut]?q[ut]=ct[ut]:q[ut]=0;this._background.draw(R,I,F,j,q,this.backgroundColor),this._lines.bind(R,I,F,this);for(var ut=0;ut<3;++ut){var it=[0,0,0];ct[ut]>0?it[ut]=j[1][ut]:it[ut]=j[0][ut];for(var nt=0;nt<2;++nt){var dt=(ut+1+nt)%3,Tt=(ut+1+(nt^1))%3;this.gridEnable[dt]&&this._lines.drawGrid(dt,Tt,this.bounds,it,this.gridColor[dt],this.gridWidth[dt]*this.pixelRatio)}for(var nt=0;nt<2;++nt){var dt=(ut+1+nt)%3,Tt=(ut+1+(nt^1))%3;this.zeroEnable[Tt]&&Math.min(j[0][Tt],j[1][Tt])<=0&&Math.max(j[0][Tt],j[1][Tt])>=0&&this._lines.drawZero(dt,Tt,this.bounds,it,this.zeroLineColor[Tt],this.zeroLineWidth[Tt]*this.pixelRatio)}}for(var ut=0;ut<3;++ut){this.lineEnable[ut]&&this._lines.drawAxisLine(ut,this.bounds,J[ut].primalOffset,this.lineColor[ut],this.lineWidth[ut]*this.pixelRatio),this.lineMirror[ut]&&this._lines.drawAxisLine(ut,this.bounds,J[ut].mirrorOffset,this.lineColor[ut],this.lineWidth[ut]*this.pixelRatio);for(var wt=l(b,J[ut].primalMinor),Ct=l(_,J[ut].mirrorMinor),It=this.lineTickLength,nt=0;nt<3;++nt){var Nt=Q/R[5*nt];wt[nt]*=It[nt]*Nt,Ct[nt]*=It[nt]*Nt}this.lineTickEnable[ut]&&this._lines.drawAxisTicks(ut,J[ut].primalOffset,wt,this.lineTickColor[ut],this.lineTickWidth[ut]*this.pixelRatio),this.lineTickMirror[ut]&&this._lines.drawAxisTicks(ut,J[ut].mirrorOffset,Ct,this.lineTickColor[ut],this.lineTickWidth[ut]*this.pixelRatio)}this._lines.unbind(),this._text.bind(R,I,F,this.pixelRatio);var te,Jt=.5,ee,Zt;function mt(ue){Zt=[0,0,0],Zt[ue]=1}function bt(ue,Me,Ce){var We=(ue+1)%3,qe=(ue+2)%3,vr=Me[We],_r=Me[qe],er=Ce[We],Mr=Ce[qe];if(vr>0&&Mr>0){mt(We);return}else if(vr>0&&Mr<0){mt(We);return}else if(vr<0&&Mr>0){mt(We);return}else if(vr<0&&Mr<0){mt(We);return}else if(_r>0&&er>0){mt(qe);return}else if(_r>0&&er<0){mt(qe);return}else if(_r<0&&er>0){mt(qe);return}else if(_r<0&&er<0){mt(qe);return}}for(var ut=0;ut<3;++ut){for(var vt=J[ut].primalMinor,Ut=J[ut].mirrorMinor,re=l(P,J[ut].primalOffset),nt=0;nt<3;++nt)this.lineTickEnable[ut]&&(re[nt]+=Q*vt[nt]*Math.max(this.lineTickLength[nt],0)/R[5*nt]);var Kt=[0,0,0];if(Kt[ut]=1,this.tickEnable[ut]){this.tickAngle[ut]===-3600?(this.tickAngle[ut]=0,this.tickAlign[ut]="auto"):this.tickAlign[ut]=-1,ee=1,te=[this.tickAlign[ut],Jt,ee],te[0]==="auto"?te[0]=h:te[0]=parseInt(""+te[0]),Zt=[0,0,0],bt(ut,vt,Ut);for(var nt=0;nt<3;++nt)re[nt]+=Q*vt[nt]*this.tickPad[nt]/R[5*nt];this._text.drawTicks(ut,this.tickSize[ut],this.tickAngle[ut],re,this.tickColor[ut],Kt,Zt,te)}if(this.labelEnable[ut]){ee=0,Zt=[0,0,0],this.labels[ut].length>4&&(mt(ut),ee=1),te=[this.labelAlign[ut],Jt,ee],te[0]==="auto"?te[0]=h:te[0]=parseInt(""+te[0]);for(var nt=0;nt<3;++nt)re[nt]+=Q*vt[nt]*this.labelPad[nt]/R[5*nt];re[ut]+=.5*(j[0][ut]+j[1][ut]),this._text.drawLabel(ut,this.labelSize[ut],this.labelAngle[ut],re,this.labelColor[ut],[0,0,0],Zt,te)}}this._text.unbind()},y.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function z(D,B){var R=new x(D);return R.update(B),R}},3840:function(t){t.exports=k;var e=0,r=1;function i(M,T,c,h,b,_){this._color=M,this.key=T,this.value=c,this.left=h,this.right=b,this._count=_}function n(M){return new i(M._color,M.key,M.value,M.left,M.right,M._count)}function o(M,T){return new i(M,T.key,T.value,T.left,T.right,T._count)}function a(M){M._count=1+(M.left?M.left._count:0)+(M.right?M.right._count:0)}function s(M,T){this._compare=M,this.root=T}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var M=[];return this.forEach(function(T,c){M.push(T)}),M}}),Object.defineProperty(f,"values",{get:function(){var M=[];return this.forEach(function(T,c){M.push(c)}),M}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(M,T){for(var c=this._compare,h=this.root,b=[],_=[];h;){var P=c(M,h.key);b.push(h),_.push(P),P<=0?h=h.left:h=h.right}b.push(new i(e,M,T,null,null,1));for(var z=b.length-2;z>=0;--z){var h=b[z];_[z]<=0?b[z]=new i(h._color,h.key,h.value,b[z+1],h.right,h._count+1):b[z]=new i(h._color,h.key,h.value,h.left,b[z+1],h._count+1)}for(var z=b.length-1;z>1;--z){var D=b[z-1],h=b[z];if(D._color===r||h._color===r)break;var B=b[z-2];if(B.left===D)if(D.left===h){var R=B.right;if(R&&R._color===e)D._color=r,B.right=o(r,R),B._color=e,z-=1;else{if(B._color=e,B.left=D.right,D._color=r,D.right=B,b[z-2]=D,b[z-1]=h,a(B),a(D),z>=3){var I=b[z-3];I.left===B?I.left=D:I.right=D}break}}else{var R=B.right;if(R&&R._color===e)D._color=r,B.right=o(r,R),B._color=e,z-=1;else{if(D.right=h.left,B._color=e,B.left=h.right,h._color=r,h.left=D,h.right=B,b[z-2]=h,b[z-1]=D,a(B),a(D),a(h),z>=3){var I=b[z-3];I.left===B?I.left=h:I.right=h}break}}else if(D.right===h){var R=B.left;if(R&&R._color===e)D._color=r,B.left=o(r,R),B._color=e,z-=1;else{if(B._color=e,B.right=D.left,D._color=r,D.left=B,b[z-2]=D,b[z-1]=h,a(B),a(D),z>=3){var I=b[z-3];I.right===B?I.right=D:I.left=D}break}}else{var R=B.left;if(R&&R._color===e)D._color=r,B.left=o(r,R),B._color=e,z-=1;else{if(D.left=h.right,B._color=e,B.right=h.left,h._color=r,h.right=D,h.left=B,b[z-2]=h,b[z-1]=D,a(B),a(D),a(h),z>=3){var I=b[z-3];I.right===B?I.right=h:I.left=h}break}}}return b[0]._color=r,new s(c,b[0])};function v(M,T){if(T.left){var c=v(M,T.left);if(c)return c}var c=M(T.key,T.value);if(c)return c;if(T.right)return v(M,T.right)}function g(M,T,c,h){var b=T(M,h.key);if(b<=0){if(h.left){var _=g(M,T,c,h.left);if(_)return _}var _=c(h.key,h.value);if(_)return _}if(h.right)return g(M,T,c,h.right)}function m(M,T,c,h,b){var _=c(M,b.key),P=c(T,b.key),z;if(_<=0&&(b.left&&(z=m(M,T,c,h,b.left),z)||P>0&&(z=h(b.key,b.value),z)))return z;if(P>0&&b.right)return m(M,T,c,h,b.right)}f.forEach=function(M,T,c){if(this.root)switch(arguments.length){case 1:return v(M,this.root);case 2:return g(T,this._compare,M,this.root);case 3:return this._compare(T,c)>=0?void 0:m(T,c,this._compare,M,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var M=[],T=this.root;T;)M.push(T),T=T.left;return new w(this,M)}}),Object.defineProperty(f,"end",{get:function(){for(var M=[],T=this.root;T;)M.push(T),T=T.right;return new w(this,M)}}),f.at=function(M){if(M<0)return new w(this,[]);for(var T=this.root,c=[];;){if(c.push(T),T.left){if(M=T.right._count)break;T=T.right}else break}return new w(this,[])},f.ge=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_<=0&&(b=h.length),_<=0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.gt=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_<0&&(b=h.length),_<0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.lt=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_>0&&(b=h.length),_<=0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.le=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_>=0&&(b=h.length),_<0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.find=function(M){for(var T=this._compare,c=this.root,h=[];c;){var b=T(M,c.key);if(h.push(c),b===0)return new w(this,h);b<=0?c=c.left:c=c.right}return new w(this,[])},f.remove=function(M){var T=this.find(M);return T?T.remove():this},f.get=function(M){for(var T=this._compare,c=this.root;c;){var h=T(M,c.key);if(h===0)return c.value;h<=0?c=c.left:c=c.right}};function w(M,T){this.tree=M,this._stack=T}var l=w.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new w(this.tree,this._stack.slice())};function x(M,T){M.key=T.key,M.value=T.value,M.left=T.left,M.right=T.right,M._color=T._color,M._count=T._count}function y(M){for(var T,c,h,b,_=M.length-1;_>=0;--_){if(T=M[_],_===0){T._color=r;return}if(c=M[_-1],c.left===T){if(h=c.right,h.right&&h.right._color===e){if(h=c.right=n(h),b=h.right=n(h.right),c.right=h.left,h.left=c,h.right=b,h._color=c._color,T._color=r,c._color=r,b._color=r,a(c),a(h),_>1){var P=M[_-2];P.left===c?P.left=h:P.right=h}M[_-1]=h;return}else if(h.left&&h.left._color===e){if(h=c.right=n(h),b=h.left=n(h.left),c.right=b.left,h.left=b.right,b.left=c,b.right=h,b._color=c._color,c._color=r,h._color=r,T._color=r,a(c),a(h),a(b),_>1){var P=M[_-2];P.left===c?P.left=b:P.right=b}M[_-1]=b;return}if(h._color===r)if(c._color===e){c._color=r,c.right=o(e,h);return}else{c.right=o(e,h);continue}else{if(h=n(h),c.right=h.left,h.left=c,h._color=c._color,c._color=e,a(c),a(h),_>1){var P=M[_-2];P.left===c?P.left=h:P.right=h}M[_-1]=h,M[_]=c,_+11){var P=M[_-2];P.right===c?P.right=h:P.left=h}M[_-1]=h;return}else if(h.right&&h.right._color===e){if(h=c.left=n(h),b=h.right=n(h.right),c.left=b.right,h.right=b.left,b.right=c,b.left=h,b._color=c._color,c._color=r,h._color=r,T._color=r,a(c),a(h),a(b),_>1){var P=M[_-2];P.right===c?P.right=b:P.left=b}M[_-1]=b;return}if(h._color===r)if(c._color===e){c._color=r,c.left=o(e,h);return}else{c.left=o(e,h);continue}else{if(h=n(h),c.left=h.right,h.right=c,h._color=c._color,c._color=e,a(c),a(h),_>1){var P=M[_-2];P.right===c?P.right=h:P.left=h}M[_-1]=h,M[_]=c,_+1=0;--h){var c=M[h];c.left===M[h+1]?T[h]=new i(c._color,c.key,c.value,T[h+1],c.right,c._count):T[h]=new i(c._color,c.key,c.value,c.left,T[h+1],c._count)}if(c=T[T.length-1],c.left&&c.right){var b=T.length;for(c=c.left;c.right;)T.push(c),c=c.right;var _=T[b-1];T.push(new i(c._color,_.key,_.value,c.left,c.right,c._count)),T[b-1].key=c.key,T[b-1].value=c.value;for(var h=T.length-2;h>=b;--h)c=T[h],T[h]=new i(c._color,c.key,c.value,c.left,T[h+1],c._count);T[b-1].left=T[b]}if(c=T[T.length-1],c._color===e){var P=T[T.length-2];P.left===c?P.left=null:P.right===c&&(P.right=null),T.pop();for(var h=0;h0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var M=0,T=this._stack;if(T.length===0){var c=this.tree.root;return c?c._count:0}else T[T.length-1].left&&(M=T[T.length-1].left._count);for(var h=T.length-2;h>=0;--h)T[h+1]===T[h].right&&(++M,T[h].left&&(M+=T[h].left._count));return M},enumerable:!0}),l.next=function(){var M=this._stack;if(M.length!==0){var T=M[M.length-1];if(T.right)for(T=T.right;T;)M.push(T),T=T.left;else for(M.pop();M.length>0&&M[M.length-1].right===T;)T=M[M.length-1],M.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var M=this._stack;if(M.length===0)return!1;if(M[M.length-1].right)return!0;for(var T=M.length-1;T>0;--T)if(M[T-1].left===M[T])return!0;return!1}}),l.update=function(M){var T=this._stack;if(T.length===0)throw new Error("Can't update empty node!");var c=new Array(T.length),h=T[T.length-1];c[c.length-1]=new i(h._color,h.key,M,h.left,h.right,h._count);for(var b=T.length-2;b>=0;--b)h=T[b],h.left===T[b+1]?c[b]=new i(h._color,h.key,h.value,c[b+1],h.right,h._count):c[b]=new i(h._color,h.key,h.value,h.left,c[b+1],h._count);return new s(this.tree._compare,c[0])},l.prev=function(){var M=this._stack;if(M.length!==0){var T=M[M.length-1];if(T.left)for(T=T.left;T;)M.push(T),T=T.right;else for(M.pop();M.length>0&&M[M.length-1].left===T;)T=M[M.length-1],M.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var M=this._stack;if(M.length===0)return!1;if(M[M.length-1].left)return!0;for(var T=M.length-1;T>0;--T)if(M[T-1].right===M[T])return!0;return!1}});function S(M,T){return MT?1:0}function k(M){return new s(M||S,null)}},3865:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[1]).add(a[0].mul(o[1])),o[1].mul(a[1]))}},3952:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){for(var f=new Array(s+1),v=0;v20?52:f+32}},4040:function(t){t.exports=e;function e(r,i,n,o,a,s,f){var v=1/(i-n),g=1/(o-a),m=1/(s-f);return r[0]=-2*v,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*m,r[11]=0,r[12]=(i+n)*v,r[13]=(a+o)*g,r[14]=(f+s)*m,r[15]=1,r}},4041:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[0],v=n[1],g=n[2],m=n[3],w=m*o+v*s-g*a,l=m*a+g*o-f*s,x=m*s+f*a-v*o,y=-f*o-v*a-g*s;return r[0]=w*m+y*-f+l*-g-x*-v,r[1]=l*m+y*-v+x*-f-w*-g,r[2]=x*m+y*-g+w*-v-l*-f,r[3]=i[3],r}},4081:function(t){t.exports=e;function e(r,i,n,o,a,s,f,v,g,m){var w=i+s+m;if(l>0){var l=Math.sqrt(w+1);r[0]=.5*(f-g)/l,r[1]=.5*(v-o)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var x=Math.max(i,s,m),l=Math.sqrt(2*x-w+1);i>=x?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(v+o)/l,r[3]=.5*(f-g)/l):s>=x?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(g+f)/l,r[3]=.5*(v-o)/l):(r[0]=.5*(o+v)/l,r[1]=.5*(f+g)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}},4100:function(t,e,r){var i=r(4437),n=r(3837),o=r(5445),a=r(4449),s=r(3589),f=r(2260),v=r(7169),g=r(351),m=r(4772),w=r(4040),l=r(799),x=r(9216)({tablet:!0,featureDetect:!0});t.exports={createScene:T,createCamera:i};function y(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function S(h,b){var _=null;try{_=h.getContext("webgl",b),_||(_=h.getContext("experimental-webgl",b))}catch{return null}return _}function k(h){var b=Math.round(Math.log(Math.abs(h))/Math.log(10));if(b<0){var _=Math.round(Math.pow(10,-b));return Math.ceil(h*_)/_}else if(b>0){var _=Math.round(Math.pow(10,b));return Math.ceil(h/_)*_}return Math.ceil(h)}function M(h){return typeof h=="boolean"?h:!0}function T(h){h=h||{},h.camera=h.camera||{};var b=h.canvas;if(!b)if(b=document.createElement("canvas"),h.container){var _=h.container;_.appendChild(b)}else document.body.appendChild(b);var P=h.gl;if(P||(h.glOptions&&(x=!!h.glOptions.preserveDrawingBuffer),P=S(b,h.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!P)throw new Error("webgl not supported");var z=h.bounds||[[-10,-10,-10],[10,10,10]],D=new y,B=f(P,P.drawingBufferWidth,P.drawingBufferHeight,{preferFloat:!x}),R=l(P),I=h.cameraObject&&h.cameraObject._ortho===!0||h.camera.projection&&h.camera.projection.type==="orthographic"||!1,F={eye:h.camera.eye||[2,0,0],center:h.camera.center||[0,0,0],up:h.camera.up||[0,1,0],zoomMin:h.camera.zoomMax||.1,zoomMax:h.camera.zoomMin||100,mode:h.camera.mode||"turntable",_ortho:I},j=h.axes||{},N=n(P,j);N.enable=!j.disable;var G=h.spikes||{},rt=a(P,G),ct=[],st=[],et=[],Z=[],ot=!0,J=!0,X=new Array(16),Q=new Array(16),ut={view:null,projection:X,model:Q,_ortho:!1},J=!0,q=[P.drawingBufferWidth,P.drawingBufferHeight],it=h.cameraObject||i(b,F),nt={gl:P,contextLost:!1,pixelRatio:h.pixelRatio||1,canvas:b,selection:D,camera:it,axes:N,axesPixels:null,spikes:rt,bounds:z,objects:ct,shape:q,aspect:h.aspectRatio||[1,1,1],pickRadius:h.pickRadius||10,zNear:h.zNear||.01,zFar:h.zFar||1e3,fovy:h.fovy||Math.PI/4,clearColor:h.clearColor||[0,0,0,0],autoResize:M(h.autoResize),autoBounds:M(h.autoBounds),autoScale:!!h.autoScale,autoCenter:M(h.autoCenter),clipToBounds:M(h.clipToBounds),snapToData:!!h.snapToData,onselect:h.onselect||null,onrender:h.onrender||null,onclick:h.onclick||null,cameraParams:ut,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Zt){this.aspect[0]=Zt.x,this.aspect[1]=Zt.y,this.aspect[2]=Zt.z,J=!0},setBounds:function(Zt,mt){this.bounds[0][Zt]=mt.min,this.bounds[1][Zt]=mt.max},setClearColor:function(Zt){this.clearColor=Zt},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},dt=[P.drawingBufferWidth/nt.pixelRatio|0,P.drawingBufferHeight/nt.pixelRatio|0];function Tt(){if(!nt._stopped&&nt.autoResize){var Zt=b.parentNode,mt=1,bt=1;Zt&&Zt!==document.body?(mt=Zt.clientWidth,bt=Zt.clientHeight):(mt=window.innerWidth,bt=window.innerHeight);var vt=Math.ceil(mt*nt.pixelRatio)|0,Ut=Math.ceil(bt*nt.pixelRatio)|0;if(vt!==b.width||Ut!==b.height){b.width=vt,b.height=Ut;var re=b.style;re.position=re.position||"absolute",re.left="0px",re.top="0px",re.width=mt+"px",re.height=bt+"px",ot=!0}}}nt.autoResize&&Tt(),window.addEventListener("resize",Tt);function wt(){for(var Zt=ct.length,mt=Z.length,bt=0;bt0&&et[mt-1]===0;)et.pop(),Z.pop().dispose()}nt.update=function(Zt){nt._stopped||(ot=!0,J=!0)},nt.add=function(Zt){nt._stopped||(Zt.axes=N,ct.push(Zt),st.push(-1),ot=!0,J=!0,wt())},nt.remove=function(Zt){if(!nt._stopped){var mt=ct.indexOf(Zt);mt<0||(ct.splice(mt,1),st.pop(),ot=!0,J=!0,wt())}},nt.dispose=function(){if(!nt._stopped&&(nt._stopped=!0,window.removeEventListener("resize",Tt),b.removeEventListener("webglcontextlost",Ct),nt.mouseListener.enabled=!1,!nt.contextLost)){N.dispose(),rt.dispose();for(var Zt=0;ZtD.distance)continue;for(var Ce=0;Cem;){var c=l[T-2],h=l[T-1];if(cl[w+1]:!0}function v(m,w,l,x){m*=2;var y=x[m];return y>1,M=k-x,T=k+x,c=y,h=M,b=k,_=T,P=S,z=m+1,D=w-1,B=0;f(c,h,l)&&(B=c,c=h,h=B),f(_,P,l)&&(B=_,_=P,P=B),f(c,b,l)&&(B=c,c=b,b=B),f(h,b,l)&&(B=h,h=b,b=B),f(c,_,l)&&(B=c,c=_,_=B),f(b,_,l)&&(B=b,b=_,_=B),f(h,P,l)&&(B=h,h=P,P=B),f(h,b,l)&&(B=h,h=b,b=B),f(_,P,l)&&(B=_,_=P,P=B);for(var R=l[2*h],I=l[2*h+1],F=l[2*_],j=l[2*_+1],N=2*c,G=2*b,rt=2*P,ct=2*y,st=2*k,et=2*S,Z=0;Z<2;++Z){var ot=l[N+Z],X=l[G+Z],Q=l[rt+Z];l[ct+Z]=ot,l[st+Z]=X,l[et+Z]=Q}o(M,m,l),o(T,w,l);for(var ut=z;ut<=D;++ut)if(v(ut,R,I,l))ut!==z&&n(ut,z,l),++z;else if(!v(ut,F,j,l))for(;;)if(v(D,F,j,l)){v(D,R,I,l)?(a(ut,z,D,l),++z,--D):(n(ut,D,l),--D);break}else{if(--D0)if(y[0]!==k[1][0])S=x,x=x.right;else{var h=g(x.right,y);if(h)return h;x=x.left}else{if(y[0]!==k[1][0])return x;var h=g(x.right,y);if(h)return h;x=x.left}}return S}f.castUp=function(x){var y=i.le(this.coordinates,x[0]);if(y<0)return-1;this.slabs[y];var S=g(this.slabs[y],x),k=-1;if(S&&(k=S.value),this.coordinates[y]===x[0]){var M=null;if(S&&(M=S.key),y>0){var T=g(this.slabs[y-1],x);T&&(M?a(T.key,M)>0&&(M=T.key,k=T.value):(k=T.value,M=T.key))}var c=this.horizontal[y];if(c.length>0){var h=i.ge(c,x[1],v);if(h=c.length)return k;b=c[h]}}if(b.start)if(M){var _=o(M[0],M[1],[x[0],b.y]);M[0][0]>M[1][0]&&(_=-_),_>0&&(k=b.index)}else k=b.index;else b.y!==x[1]&&(k=b.index)}}}return k};function m(x,y,S,k){this.y=x,this.index=y,this.start=S,this.closed=k}function w(x,y,S,k){this.x=x,this.segment=y,this.create=S,this.index=k}function l(x){for(var y=x.length,S=2*y,k=new Array(S),M=0;MMath.abs(h))l.rotate(P,0,0,-c*b*Math.PI*M.rotateSpeed/window.innerWidth);else if(!M._ortho){var z=-M.zoomSpeed*_*h/window.innerHeight*(P-l.lastT())/20;l.pan(P,0,0,y*(Math.exp(z)-1))}}},!0)},M.enableMouseListeners(),M}},4449:function(t,e,r){var i=r(2762),n=r(8116),o=r(1493);t.exports=w;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,x,y,S){this.gl=l,this.buffer=x,this.vao=y,this.shader=S,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var f=s.prototype,v=[0,0,0],g=[0,0,0],m=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var x=this.gl,y=this.vao,S=this.shader;y.bind(),S.bind();var k=l.model||a,M=l.view||a,T=l.projection||a,c;this.axes&&(c=this.axes.lastCubeProps.axis);for(var h=v,b=g,_=0;_<3;++_)c&&c[_]<0?(h[_]=this.bounds[0][_],b[_]=this.bounds[1][_]):(h[_]=this.bounds[1][_],b[_]=this.bounds[0][_]);m[0]=x.drawingBufferWidth,m[1]=x.drawingBufferHeight,S.uniforms.model=k,S.uniforms.view=M,S.uniforms.projection=T,S.uniforms.coordinates=[this.position,h,b],S.uniforms.colors=this.colors,S.uniforms.screenShape=m;for(var _=0;_<3;++_)S.uniforms.lineWidth=this.lineWidth[_]*this.pixelRatio,this.enabled[_]&&(y.draw(x.TRIANGLES,6,6*_),this.drawSides[_]&&y.draw(x.TRIANGLES,12,18+12*_));y.unbind()},f.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function w(l,x){var y=[];function S(h,b,_,P,z,D){var B=[h,b,_,0,0,0,1];B[P+3]=1,B[P]=z,y.push.apply(y,B),B[6]=-1,y.push.apply(y,B),B[P]=D,y.push.apply(y,B),y.push.apply(y,B),B[6]=1,y.push.apply(y,B),B[P]=z,y.push.apply(y,B)}S(0,0,0,0,0,1),S(0,0,0,1,0,1),S(0,0,0,2,0,1),S(1,0,0,1,-1,1),S(1,0,0,2,-1,1),S(0,1,0,0,-1,1),S(0,1,0,2,-1,1),S(0,0,1,0,-1,1),S(0,0,1,1,-1,1);var k=i(l,y),M=n(l,[{type:l.FLOAT,buffer:k,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:k,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:k,size:1,offset:24,stride:28}]),T=o(l);T.attributes.position.location=0,T.attributes.color.location=1,T.attributes.weight.location=2;var c=new s(l,k,M,T);return c.update(x),c}},4494:function(t){t.exports=e;function e(r,i){return r[0]=1/i[0],r[1]=1/i[1],r[2]=1/i[2],r[3]=1/i[3],r}},4505:function(t,e,r){t.exports=r(5847)},4578:function(t){t.exports=e;function e(r,i,n,o,a){return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r}},4623:function(t){"use restrict";t.exports=e;function e(r){this.roots=new Array(r),this.ranks=new Array(r);for(var i=0;i0)return 1<=0)return 1<=0;--l)f[l]=v*i[l]+g*n[l]+m*o[l]+w*a[l];return f}return v*i+g*n+m*o[l]+w*a}function r(i,n,o,a,s,f){var v=s-1,g=s*s,m=v*v,w=(1+2*s)*m,l=s*m,x=g*(3-2*s),y=g*v;if(i.length){f||(f=new Array(i.length));for(var S=i.length-1;S>=0;--S)f[S]=w*i[S]+l*n[S]+x*o[S]+y*a[S];return f}return w*i+l*n+x*o+y*a}t.exports=r,t.exports.derivative=e},4772:function(t){t.exports=e;function e(r,i,n,o,a){var s=1/Math.tan(i/2),f=1/(o-a);return r[0]=s/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(a+o)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*o*f,r[15]=0,r}},4793:function(t,e,r){function i(lt,yt){if(!(lt instanceof yt))throw new TypeError("Cannot call a class as a function")}function n(lt,yt){for(var St=0;StT)throw new RangeError('The value "'+lt+'" is invalid for option "size"');var yt=new Uint8Array(lt);return Object.setPrototypeOf(yt,b.prototype),yt}function b(lt,yt,St){if(typeof lt=="number"){if(typeof yt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return D(lt)}return _(lt,yt,St)}b.poolSize=8192;function _(lt,yt,St){if(typeof lt=="string")return B(lt,yt);if(ArrayBuffer.isView(lt))return I(lt);if(lt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+y(lt));if(Ir(lt,ArrayBuffer)||lt&&Ir(lt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ir(lt,SharedArrayBuffer)||lt&&Ir(lt.buffer,SharedArrayBuffer)))return F(lt,yt,St);if(typeof lt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Ht=lt.valueOf&<.valueOf();if(Ht!=null&&Ht!==lt)return b.from(Ht,yt,St);var Yt=j(lt);if(Yt)return Yt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof lt[Symbol.toPrimitive]=="function")return b.from(lt[Symbol.toPrimitive]("string"),yt,St);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+y(lt))}b.from=function(lt,yt,St){return _(lt,yt,St)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array);function P(lt){if(typeof lt!="number")throw new TypeError('"size" argument must be of type number');if(lt<0)throw new RangeError('The value "'+lt+'" is invalid for option "size"')}function z(lt,yt,St){return P(lt),lt<=0?h(lt):yt!==void 0?typeof St=="string"?h(lt).fill(yt,St):h(lt).fill(yt):h(lt)}b.alloc=function(lt,yt,St){return z(lt,yt,St)};function D(lt){return P(lt),h(lt<0?0:N(lt)|0)}b.allocUnsafe=function(lt){return D(lt)},b.allocUnsafeSlow=function(lt){return D(lt)};function B(lt,yt){if((typeof yt!="string"||yt==="")&&(yt="utf8"),!b.isEncoding(yt))throw new TypeError("Unknown encoding: "+yt);var St=G(lt,yt)|0,Ht=h(St),Yt=Ht.write(lt,yt);return Yt!==St&&(Ht=Ht.slice(0,Yt)),Ht}function R(lt){for(var yt=lt.length<0?0:N(lt.length)|0,St=h(yt),Ht=0;Ht=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return lt|0}b.isBuffer=function(lt){return lt!=null&<._isBuffer===!0&<!==b.prototype},b.compare=function(lt,yt){if(Ir(lt,Uint8Array)&&(lt=b.from(lt,lt.offset,lt.byteLength)),Ir(yt,Uint8Array)&&(yt=b.from(yt,yt.offset,yt.byteLength)),!b.isBuffer(lt)||!b.isBuffer(yt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(lt===yt)return 0;for(var St=lt.length,Ht=yt.length,Yt=0,se=Math.min(St,Ht);YtHt.length?(b.isBuffer(se)||(se=b.from(se)),se.copy(Ht,Yt)):Uint8Array.prototype.set.call(Ht,se,Yt);else if(b.isBuffer(se))se.copy(Ht,Yt);else throw new TypeError('"list" argument must be an Array of Buffers');Yt+=se.length}return Ht};function G(lt,yt){if(b.isBuffer(lt))return lt.length;if(ArrayBuffer.isView(lt)||Ir(lt,ArrayBuffer))return lt.byteLength;if(typeof lt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+y(lt));var St=lt.length,Ht=arguments.length>2&&arguments[2]===!0;if(!Ht&&St===0)return 0;for(var Yt=!1;;)switch(yt){case"ascii":case"latin1":case"binary":return St;case"utf8":case"utf-8":return qe(lt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St*2;case"hex":return St>>>1;case"base64":return er(lt).length;default:if(Yt)return Ht?-1:qe(lt).length;yt=(""+yt).toLowerCase(),Yt=!0}}b.byteLength=G;function rt(lt,yt,St){var Ht=!1;if((yt===void 0||yt<0)&&(yt=0),yt>this.length||((St===void 0||St>this.length)&&(St=this.length),St<=0)||(St>>>=0,yt>>>=0,St<=yt))return"";for(lt||(lt="utf8");;)switch(lt){case"hex":return wt(this,yt,St);case"utf8":case"utf-8":return q(this,yt,St);case"ascii":return dt(this,yt,St);case"latin1":case"binary":return Tt(this,yt,St);case"base64":return J(this,yt,St);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,yt,St);default:if(Ht)throw new TypeError("Unknown encoding: "+lt);lt=(lt+"").toLowerCase(),Ht=!0}}b.prototype._isBuffer=!0;function ct(lt,yt,St){var Ht=lt[yt];lt[yt]=lt[St],lt[St]=Ht}b.prototype.swap16=function(){var lt=this.length;if(lt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var yt=0;ytyt&&(lt+=" ... "),""},M&&(b.prototype[M]=b.prototype.inspect),b.prototype.compare=function(lt,yt,St,Ht,Yt){if(Ir(lt,Uint8Array)&&(lt=b.from(lt,lt.offset,lt.byteLength)),!b.isBuffer(lt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+y(lt));if(yt===void 0&&(yt=0),St===void 0&&(St=lt?lt.length:0),Ht===void 0&&(Ht=0),Yt===void 0&&(Yt=this.length),yt<0||St>lt.length||Ht<0||Yt>this.length)throw new RangeError("out of range index");if(Ht>=Yt&&yt>=St)return 0;if(Ht>=Yt)return-1;if(yt>=St)return 1;if(yt>>>=0,St>>>=0,Ht>>>=0,Yt>>>=0,this===lt)return 0;for(var se=Yt-Ht,ke=St-yt,Ee=Math.min(se,ke),Ue=this.slice(Ht,Yt),ir=lt.slice(yt,St),ar=0;ar2147483647?St=2147483647:St<-2147483648&&(St=-2147483648),St=+St,de(St)&&(St=Yt?0:lt.length-1),St<0&&(St=lt.length+St),St>=lt.length){if(Yt)return-1;St=lt.length-1}else if(St<0)if(Yt)St=0;else return-1;if(typeof yt=="string"&&(yt=b.from(yt,Ht)),b.isBuffer(yt))return yt.length===0?-1:et(lt,yt,St,Ht,Yt);if(typeof yt=="number")return yt=yt&255,typeof Uint8Array.prototype.indexOf=="function"?Yt?Uint8Array.prototype.indexOf.call(lt,yt,St):Uint8Array.prototype.lastIndexOf.call(lt,yt,St):et(lt,[yt],St,Ht,Yt);throw new TypeError("val must be string, number or Buffer")}function et(lt,yt,St,Ht,Yt){var se=1,ke=lt.length,Ee=yt.length;if(Ht!==void 0&&(Ht=String(Ht).toLowerCase(),Ht==="ucs2"||Ht==="ucs-2"||Ht==="utf16le"||Ht==="utf-16le")){if(lt.length<2||yt.length<2)return-1;se=2,ke/=2,Ee/=2,St/=2}function Ue(pn,dn){return se===1?pn[dn]:pn.readUInt16BE(dn*se)}var ir;if(Yt){var ar=-1;for(ir=St;irke&&(St=ke-Ee),ir=St;ir>=0;ir--){for(var Ye=!0,Er=0;ErYt&&(Ht=Yt)):Ht=Yt;var se=yt.length;Ht>se/2&&(Ht=se/2);var ke;for(ke=0;ke>>0,isFinite(St)?(St=St>>>0,Ht===void 0&&(Ht="utf8")):(Ht=St,St=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Yt=this.length-yt;if((St===void 0||St>Yt)&&(St=Yt),lt.length>0&&(St<0||yt<0)||yt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ht||(Ht="utf8");for(var se=!1;;)switch(Ht){case"hex":return Z(this,lt,yt,St);case"utf8":case"utf-8":return ot(this,lt,yt,St);case"ascii":case"latin1":case"binary":return X(this,lt,yt,St);case"base64":return Q(this,lt,yt,St);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,lt,yt,St);default:if(se)throw new TypeError("Unknown encoding: "+Ht);Ht=(""+Ht).toLowerCase(),se=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(lt,yt,St){return yt===0&&St===lt.length?S.fromByteArray(lt):S.fromByteArray(lt.slice(yt,St))}function q(lt,yt,St){St=Math.min(lt.length,St);for(var Ht=[],Yt=yt;Yt239?4:se>223?3:se>191?2:1;if(Yt+Ee<=St){var Ue=void 0,ir=void 0,ar=void 0,Ye=void 0;switch(Ee){case 1:se<128&&(ke=se);break;case 2:Ue=lt[Yt+1],(Ue&192)===128&&(Ye=(se&31)<<6|Ue&63,Ye>127&&(ke=Ye));break;case 3:Ue=lt[Yt+1],ir=lt[Yt+2],(Ue&192)===128&&(ir&192)===128&&(Ye=(se&15)<<12|(Ue&63)<<6|ir&63,Ye>2047&&(Ye<55296||Ye>57343)&&(ke=Ye));break;case 4:Ue=lt[Yt+1],ir=lt[Yt+2],ar=lt[Yt+3],(Ue&192)===128&&(ir&192)===128&&(ar&192)===128&&(Ye=(se&15)<<18|(Ue&63)<<12|(ir&63)<<6|ar&63,Ye>65535&&Ye<1114112&&(ke=Ye))}}ke===null?(ke=65533,Ee=1):ke>65535&&(ke-=65536,Ht.push(ke>>>10&1023|55296),ke=56320|ke&1023),Ht.push(ke),Yt+=Ee}return nt(Ht)}var it=4096;function nt(lt){var yt=lt.length;if(yt<=it)return String.fromCharCode.apply(String,lt);for(var St="",Ht=0;HtHt)&&(St=Ht);for(var Yt="",se=yt;seSt&&(lt=St),yt<0?(yt+=St,yt<0&&(yt=0)):yt>St&&(yt=St),ytSt)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||It(lt,yt,this.length);for(var Ht=this[lt],Yt=1,se=0;++se>>0,yt=yt>>>0,St||It(lt,yt,this.length);for(var Ht=this[lt+--yt],Yt=1;yt>0&&(Yt*=256);)Ht+=this[lt+--yt]*Yt;return Ht},b.prototype.readUint8=b.prototype.readUInt8=function(lt,yt){return lt=lt>>>0,yt||It(lt,1,this.length),this[lt]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(lt,yt){return lt=lt>>>0,yt||It(lt,2,this.length),this[lt]|this[lt+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(lt,yt){return lt=lt>>>0,yt||It(lt,2,this.length),this[lt]<<8|this[lt+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(lt,yt){return lt=lt>>>0,yt||It(lt,4,this.length),(this[lt]|this[lt+1]<<8|this[lt+2]<<16)+this[lt+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(lt,yt){return lt=lt>>>0,yt||It(lt,4,this.length),this[lt]*16777216+(this[lt+1]<<16|this[lt+2]<<8|this[lt+3])},b.prototype.readBigUInt64LE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=yt+this[++lt]*Math.pow(2,8)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,24),Yt=this[++lt]+this[++lt]*Math.pow(2,8)+this[++lt]*Math.pow(2,16)+St*Math.pow(2,24);return BigInt(Ht)+(BigInt(Yt)<>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=yt*Math.pow(2,24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+this[++lt],Yt=this[++lt]*Math.pow(2,24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+St;return(BigInt(Ht)<>>0,yt=yt>>>0,St||It(lt,yt,this.length);for(var Ht=this[lt],Yt=1,se=0;++se=Yt&&(Ht-=Math.pow(2,8*yt)),Ht},b.prototype.readIntBE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||It(lt,yt,this.length);for(var Ht=yt,Yt=1,se=this[lt+--Ht];Ht>0&&(Yt*=256);)se+=this[lt+--Ht]*Yt;return Yt*=128,se>=Yt&&(se-=Math.pow(2,8*yt)),se},b.prototype.readInt8=function(lt,yt){return lt=lt>>>0,yt||It(lt,1,this.length),this[lt]&128?(255-this[lt]+1)*-1:this[lt]},b.prototype.readInt16LE=function(lt,yt){lt=lt>>>0,yt||It(lt,2,this.length);var St=this[lt]|this[lt+1]<<8;return St&32768?St|4294901760:St},b.prototype.readInt16BE=function(lt,yt){lt=lt>>>0,yt||It(lt,2,this.length);var St=this[lt+1]|this[lt]<<8;return St&32768?St|4294901760:St},b.prototype.readInt32LE=function(lt,yt){return lt=lt>>>0,yt||It(lt,4,this.length),this[lt]|this[lt+1]<<8|this[lt+2]<<16|this[lt+3]<<24},b.prototype.readInt32BE=function(lt,yt){return lt=lt>>>0,yt||It(lt,4,this.length),this[lt]<<24|this[lt+1]<<16|this[lt+2]<<8|this[lt+3]},b.prototype.readBigInt64LE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=this[lt+4]+this[lt+5]*Math.pow(2,8)+this[lt+6]*Math.pow(2,16)+(St<<24);return(BigInt(Ht)<>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=(yt<<24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+this[++lt];return(BigInt(Ht)<>>0,yt||It(lt,4,this.length),k.read(this,lt,!0,23,4)},b.prototype.readFloatBE=function(lt,yt){return lt=lt>>>0,yt||It(lt,4,this.length),k.read(this,lt,!1,23,4)},b.prototype.readDoubleLE=function(lt,yt){return lt=lt>>>0,yt||It(lt,8,this.length),k.read(this,lt,!0,52,8)},b.prototype.readDoubleBE=function(lt,yt){return lt=lt>>>0,yt||It(lt,8,this.length),k.read(this,lt,!1,52,8)};function Nt(lt,yt,St,Ht,Yt,se){if(!b.isBuffer(lt))throw new TypeError('"buffer" argument must be a Buffer instance');if(yt>Yt||ytlt.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,St=St>>>0,!Ht){var Yt=Math.pow(2,8*St)-1;Nt(this,lt,yt,St,Yt,0)}var se=1,ke=0;for(this[yt]=lt&255;++ke>>0,St=St>>>0,!Ht){var Yt=Math.pow(2,8*St)-1;Nt(this,lt,yt,St,Yt,0)}var se=St-1,ke=1;for(this[yt+se]=lt&255;--se>=0&&(ke*=256);)this[yt+se]=lt/ke&255;return yt+St},b.prototype.writeUint8=b.prototype.writeUInt8=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,1,255,0),this[yt]=lt&255,yt+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,65535,0),this[yt]=lt&255,this[yt+1]=lt>>>8,yt+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,65535,0),this[yt]=lt>>>8,this[yt+1]=lt&255,yt+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,4294967295,0),this[yt+3]=lt>>>24,this[yt+2]=lt>>>16,this[yt+1]=lt>>>8,this[yt]=lt&255,yt+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,4294967295,0),this[yt]=lt>>>24,this[yt+1]=lt>>>16,this[yt+2]=lt>>>8,this[yt+3]=lt&255,yt+4};function te(lt,yt,St,Ht,Yt){Kt(yt,Ht,Yt,lt,St,7);var se=Number(yt&BigInt(4294967295));lt[St++]=se,se=se>>8,lt[St++]=se,se=se>>8,lt[St++]=se,se=se>>8,lt[St++]=se;var ke=Number(yt>>BigInt(32)&BigInt(4294967295));return lt[St++]=ke,ke=ke>>8,lt[St++]=ke,ke=ke>>8,lt[St++]=ke,ke=ke>>8,lt[St++]=ke,St}function Jt(lt,yt,St,Ht,Yt){Kt(yt,Ht,Yt,lt,St,7);var se=Number(yt&BigInt(4294967295));lt[St+7]=se,se=se>>8,lt[St+6]=se,se=se>>8,lt[St+5]=se,se=se>>8,lt[St+4]=se;var ke=Number(yt>>BigInt(32)&BigInt(4294967295));return lt[St+3]=ke,ke=ke>>8,lt[St+2]=ke,ke=ke>>8,lt[St+1]=ke,ke=ke>>8,lt[St]=ke,St+8}b.prototype.writeBigUInt64LE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return te(this,lt,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,lt,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,!Ht){var Yt=Math.pow(2,8*St-1);Nt(this,lt,yt,St,Yt-1,-Yt)}var se=0,ke=1,Ee=0;for(this[yt]=lt&255;++se>0)-Ee&255;return yt+St},b.prototype.writeIntBE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,!Ht){var Yt=Math.pow(2,8*St-1);Nt(this,lt,yt,St,Yt-1,-Yt)}var se=St-1,ke=1,Ee=0;for(this[yt+se]=lt&255;--se>=0&&(ke*=256);)lt<0&&Ee===0&&this[yt+se+1]!==0&&(Ee=1),this[yt+se]=(lt/ke>>0)-Ee&255;return yt+St},b.prototype.writeInt8=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,1,127,-128),lt<0&&(lt=255+lt+1),this[yt]=lt&255,yt+1},b.prototype.writeInt16LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,32767,-32768),this[yt]=lt&255,this[yt+1]=lt>>>8,yt+2},b.prototype.writeInt16BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,32767,-32768),this[yt]=lt>>>8,this[yt+1]=lt&255,yt+2},b.prototype.writeInt32LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,2147483647,-2147483648),this[yt]=lt&255,this[yt+1]=lt>>>8,this[yt+2]=lt>>>16,this[yt+3]=lt>>>24,yt+4},b.prototype.writeInt32BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,2147483647,-2147483648),lt<0&&(lt=4294967295+lt+1),this[yt]=lt>>>24,this[yt+1]=lt>>>16,this[yt+2]=lt>>>8,this[yt+3]=lt&255,yt+4},b.prototype.writeBigInt64LE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return te(this,lt,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,lt,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(lt,yt,St,Ht,Yt,se){if(St+Ht>lt.length)throw new RangeError("Index out of range");if(St<0)throw new RangeError("Index out of range")}function Zt(lt,yt,St,Ht,Yt){return yt=+yt,St=St>>>0,Yt||ee(lt,yt,St,4),k.write(lt,yt,St,Ht,23,4),St+4}b.prototype.writeFloatLE=function(lt,yt,St){return Zt(this,lt,yt,!0,St)},b.prototype.writeFloatBE=function(lt,yt,St){return Zt(this,lt,yt,!1,St)};function mt(lt,yt,St,Ht,Yt){return yt=+yt,St=St>>>0,Yt||ee(lt,yt,St,8),k.write(lt,yt,St,Ht,52,8),St+8}b.prototype.writeDoubleLE=function(lt,yt,St){return mt(this,lt,yt,!0,St)},b.prototype.writeDoubleBE=function(lt,yt,St){return mt(this,lt,yt,!1,St)},b.prototype.copy=function(lt,yt,St,Ht){if(!b.isBuffer(lt))throw new TypeError("argument should be a Buffer");if(St||(St=0),!Ht&&Ht!==0&&(Ht=this.length),yt>=lt.length&&(yt=lt.length),yt||(yt=0),Ht>0&&Ht=this.length)throw new RangeError("Index out of range");if(Ht<0)throw new RangeError("sourceEnd out of bounds");Ht>this.length&&(Ht=this.length),lt.length-yt>>0,St=St===void 0?this.length:St>>>0,lt||(lt=0);var se;if(typeof lt=="number")for(se=yt;seMath.pow(2,32)?Yt=Ut(String(St)):typeof St=="bigint"&&(Yt=String(St),(St>Math.pow(BigInt(2),BigInt(32))||St<-Math.pow(BigInt(2),BigInt(32)))&&(Yt=Ut(Yt)),Yt+="n"),Ht+=" It must be ".concat(yt,". Received ").concat(Yt),Ht},RangeError);function Ut(lt){for(var yt="",St=lt.length,Ht=lt[0]==="-"?1:0;St>=Ht+4;St-=3)yt="_".concat(lt.slice(St-3,St)).concat(yt);return"".concat(lt.slice(0,St)).concat(yt)}function re(lt,yt,St){ue(yt,"offset"),(lt[yt]===void 0||lt[yt+St]===void 0)&&Me(yt,lt.length-(St+1))}function Kt(lt,yt,St,Ht,Yt,se){if(lt>St||lt= 0".concat(ke," and < 2").concat(ke," ** ").concat((se+1)*8).concat(ke):Ee=">= -(2".concat(ke," ** ").concat((se+1)*8-1).concat(ke,") and < 2 ** ")+"".concat((se+1)*8-1).concat(ke),new bt.ERR_OUT_OF_RANGE("value",Ee,lt)}re(Ht,Yt,se)}function ue(lt,yt){if(typeof lt!="number")throw new bt.ERR_INVALID_ARG_TYPE(yt,"number",lt)}function Me(lt,yt,St){throw Math.floor(lt)!==lt?(ue(lt,St),new bt.ERR_OUT_OF_RANGE("offset","an integer",lt)):yt<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(yt),lt)}var Ce=/[^+/0-9A-Za-z-_]/g;function We(lt){if(lt=lt.split("=")[0],lt=lt.trim().replace(Ce,""),lt.length<2)return"";for(;lt.length%4!==0;)lt=lt+"=";return lt}function qe(lt,yt){yt=yt||1/0;for(var St,Ht=lt.length,Yt=null,se=[],ke=0;ke55295&&St<57344){if(!Yt){if(St>56319){(yt-=3)>-1&&se.push(239,191,189);continue}else if(ke+1===Ht){(yt-=3)>-1&&se.push(239,191,189);continue}Yt=St;continue}if(St<56320){(yt-=3)>-1&&se.push(239,191,189),Yt=St;continue}St=(Yt-55296<<10|St-56320)+65536}else Yt&&(yt-=3)>-1&&se.push(239,191,189);if(Yt=null,St<128){if((yt-=1)<0)break;se.push(St)}else if(St<2048){if((yt-=2)<0)break;se.push(St>>6|192,St&63|128)}else if(St<65536){if((yt-=3)<0)break;se.push(St>>12|224,St>>6&63|128,St&63|128)}else if(St<1114112){if((yt-=4)<0)break;se.push(St>>18|240,St>>12&63|128,St>>6&63|128,St&63|128)}else throw new Error("Invalid code point")}return se}function vr(lt){for(var yt=[],St=0;St>8,Yt=St%256,se.push(Yt),se.push(Ht);return se}function er(lt){return S.toByteArray(We(lt))}function Mr(lt,yt,St,Ht){var Yt;for(Yt=0;Yt=yt.length||Yt>=lt.length);++Yt)yt[Yt+St]=lt[Yt];return Yt}function Ir(lt,yt){return lt instanceof yt||lt!=null&<.constructor!=null&<.constructor.name!=null&<.constructor.name===yt.name}function de(lt){return lt!==lt}var Dt=(function(){for(var lt="0123456789abcdef",yt=new Array(256),St=0;St<16;++St)for(var Ht=St*16,Yt=0;Yt<16;++Yt)yt[Ht+Yt]=lt[St]+lt[Yt];return yt})();function qt(lt){return typeof BigInt>"u"?_t:lt}function _t(){throw new Error("BigInt not supported")}},4844:function(t){t.exports=e;function e(r,i,n,o){return r[0]=i[0]+n[0]*o,r[1]=i[1]+n[1]*o,r[2]=i[2]+n[2]*o,r[3]=i[3]+n[3]*o,r}},4905:function(t,e,r){var i=r(5874);t.exports=n;function n(o,a){var s=i(a),f=[];return f=f.concat(s(o)),f=f.concat(s(null)),f}},4935:function(t,e,r){t.exports=x;var i=r(2762),n=r(8116),o=r(4359),a=r(1879).Q,s=window||process.global||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var v=3;function g(y,S,k,M){this.gl=y,this.shader=S,this.buffer=k,this.vao=M,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var m=g.prototype,w=[0,0];m.bind=function(y,S,k,M){this.vao.bind(),this.shader.bind();var T=this.shader.uniforms;T.model=y,T.view=S,T.projection=k,T.pixelScale=M,w[0]=this.gl.drawingBufferWidth,w[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=w},m.unbind=function(){this.vao.unbind()},m.update=function(y,S,k,M,T){var c=[];function h(j,N,G,rt,ct,st){var et=[G.style,G.weight,G.variant,G.family].join("_"),Z=f[et];Z||(Z=f[et]={});var ot=Z[N];ot||(ot=Z[N]=l(N,{triangles:!0,font:G.family,fontStyle:G.style,fontWeight:G.weight,fontVariant:G.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ct,styletags:st}));for(var X=(rt||12)/12,Q=ot.positions,ut=ot.cells,J=0,q=ut.length;J=0;--nt){var dt=Q[it[nt]];c.push(X*dt[0],-X*dt[1],j)}}for(var b=[0,0,0],_=[0,0,0],P=[0,0,0],z=[0,0,0],D=1.25,B={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},R=0;R<3;++R){P[R]=c.length/v|0,h(.5*(y[0][R]+y[1][R]),S[R],k[R],12,D,B),z[R]=(c.length/v|0)-P[R],b[R]=c.length/v|0;for(var I=0;I0||S.length>0;){for(;y.length>0;){var h=y.pop();if(k[h]!==-x){k[h]=x;for(var b=M[h],_=0;_<3;++_){var P=c[3*h+_];P>=0&&k[P]===0&&(T[3*h+_]?S.push(P):(y.push(P),k[P]=x))}}}var z=S;S=y,y=z,S.length=0,x=-x}var D=f(M,k,m);return w?D.concat(l.boundary):D}},5033:function(t){t.exports=e;function e(r,i,n){var o=i||0,a=n||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[o*r[12]+r[8],o*r[13]+r[9],o*r[14]+r[10],o*r[15]+r[11]],[a*r[12]-r[8],a*r[13]-r[9],a*r[14]-r[10],a*r[15]-r[11]]]}},5085:function(t,e,r){t.exports=x;var i=r(3250)[3],n=r(4209),o=r(3352),a=r(2478);function s(){return!0}function f(y){return function(S,k){var M=y[S];return M?!!M.queryPoint(k,s):!1}}function v(y){for(var S={},k=0;k0&&S[M]===k[0])T=y[M-1];else return 1;for(var c=1;T;){var h=T.key,b=i(k,h[0],h[1]);if(h[0][0]0)c=-1,T=T.right;else return 0;else if(b>0)T=T.left;else if(b<0)c=1,T=T.right;else return 0}return c}}function m(y){return 1}function w(y){return function(S){return y(S[0],S[1])?0:1}}function l(y,S){return function(k){return y(k[0],k[1])?0:S(k)}}function x(y){for(var S=y.length,k=[],M=[],T=0,c=0;c"u"?r(606):WeakMap,a=new o,s=0;function f(S,k,M,T,c,h,b){this.id=S,this.src=k,this.type=M,this.shader=T,this.count=h,this.programs=[],this.cache=b}f.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,k=S.gl,M=this.programs,T=0,c=M.length;T0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=o*f,r[2]=a*f,r[3]=s*f),r}},5202:function(t,e,r){var i=r(1944),n=r(8210);t.exports=s,t.exports.positive=f,t.exports.negative=v;function o(g,m){var w=n(i(g,m),[m[m.length-1]]);return w[w.length-1]}function a(g,m,w,l){var x=l-m,y=-m/x;y<0?y=0:y>1&&(y=1);for(var S=1-y,k=g.length,M=new Array(k),T=0;T0||x>0&&M<0){var T=a(y,M,S,x);w.push(T),l.push(T.slice())}M<0?l.push(S.slice()):M>0?w.push(S.slice()):(w.push(S.slice()),l.push(S.slice())),x=M}return{positive:w,negative:l}}function f(g,m){for(var w=[],l=o(g[g.length-1],m),x=g[g.length-1],y=g[0],S=0;S0||l>0&&k<0)&&w.push(a(x,k,y,l)),k>=0&&w.push(y.slice()),l=k}return w}function v(g,m){for(var w=[],l=o(g[g.length-1],m),x=g[g.length-1],y=g[0],S=0;S0||l>0&&k<0)&&w.push(a(x,k,y,l)),k<=0&&w.push(y.slice()),l=k}return w}},5219:function(t){t.exports=function(e){for(var r=e.length,i,n=0;n13)&&i!==32&&i!==133&&i!==160&&i!==5760&&i!==6158&&(i<8192||i>8205)&&i!==8232&&i!==8233&&i!==8239&&i!==8287&&i!==8288&&i!==12288&&i!==65279)return!1;return!0}},5250:function(t){t.exports=r;var e=+(Math.pow(2,27)+1);function r(i,n,o){var a=i*n,s=e*i,f=s-i,v=s-f,g=i-v,m=e*n,w=m-n,l=m-w,x=n-l,y=a-v*l,S=y-g*l,k=S-v*x,M=g*x-k;return o?(o[0]=M,o[1]=a,o):[M,a]}},5298:function(t,e){var r={"float64,2,1,0":function(){return function(v,g,m,w,l){var x=v[0],y=v[1],S=v[2],k=m[0],M=m[1],T=m[2];w|=0;var c=0,h=0,b=0,_=T,P=M-S*T,z=k-y*M;for(b=0;b0;){R<64?(k=R,R=0):(k=64,R-=64);for(var I=v[1]|0;I>0;){I<64?(M=I,I=0):(M=64,I-=64),w=D+R*c+I*h,y=B+R*_+I*P;var F=0,j=0,N=0,G=b,rt=c-T*b,ct=h-k*c,st=z,et=_-T*z,Z=P-k*_;for(N=0;N0;){P<64?(k=P,P=0):(k=64,P-=64);for(var z=v[0]|0;z>0;){z<64?(S=z,z=0):(S=64,z-=64),w=b+P*T+z*M,y=_+P*h+z*c;var D=0,B=0,R=T,I=M-k*T,F=h,j=c-k*h;for(B=0;B0;){B<64?(M=B,B=0):(M=64,B-=64);for(var R=v[0]|0;R>0;){R<64?(S=R,R=0):(S=64,R-=64);for(var I=v[1]|0;I>0;){I<64?(k=I,I=0):(k=64,I-=64),w=z+B*h+R*T+I*c,y=D+B*P+R*b+I*_;var F=0,j=0,N=0,G=h,rt=T-M*h,ct=c-S*T,st=P,et=b-M*P,Z=_-S*b;for(N=0;N=0}})(),o.removeTriangle=function(f,v,g){var m=this.stars;a(m[f],v,g),a(m[v],g,f),a(m[g],f,v)},o.addTriangle=function(f,v,g){var m=this.stars;m[f].push(v,g),m[v].push(g,f),m[g].push(f,v)},o.opposite=function(f,v){for(var g=this.stars[v],m=1,w=g.length;m0;){var l=g.pop();f[l]=!1;for(var x=s[l],m=0;m0){for(var et=0;et<24;++et)z.push(z[z.length-12]);I+=2,rt=!0}continue t}F[0][_]=Math.min(F[0][_],ct[_],st[_]),F[1][_]=Math.max(F[1][_],ct[_],st[_])}var Z,ot;Array.isArray(N[0])?(Z=N.length>b-1?N[b-1]:N.length>0?N[N.length-1]:[0,0,0,1],ot=N.length>b?N[b]:N.length>0?N[N.length-1]:[0,0,0,1]):Z=ot=N,Z.length===3&&(Z=[Z[0],Z[1],Z[2],1]),ot.length===3&&(ot=[ot[0],ot[1],ot[2],1]),!this.hasAlpha&&Z[3]<1&&(this.hasAlpha=!0);var X;Array.isArray(G)?X=G.length>b-1?G[b-1]:G.length>0?G[G.length-1]:[0,0,0,1]:X=G;var Q=R;if(R+=y(ct,st),rt){for(_=0;_<2;++_)z.push(ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,X,Z[0],Z[1],Z[2],Z[3]);I+=2,rt=!1}z.push(ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,X,Z[0],Z[1],Z[2],Z[3],ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,-X,Z[0],Z[1],Z[2],Z[3],st[0],st[1],st[2],ct[0],ct[1],ct[2],R,-X,ot[0],ot[1],ot[2],ot[3],st[0],st[1],st[2],ct[0],ct[1],ct[2],R,X,ot[0],ot[1],ot[2],ot[3]),I+=4}}if(this.buffer.update(z),D.push(R),B.push(j[j.length-1].slice()),this.bounds=F,this.vertexCount=I,this.points=B,this.arcLength=D,"dashes"in h){var ut=h.dashes,J=ut.slice();for(J.unshift(0),b=1;br[n][0]&&(n=o);return in?[[n],[i]]:[[i]]}},5771:function(t,e,r){var i=r(8507),n=r(3788),o=r(2419);t.exports=a;function a(s){s.sort(n);for(var f=s.length,v=0,g=0;g0){var l=s[v-1];if(i(m,l)===0&&o(l)!==w){v-=1;continue}}s[v++]=m}}return s.length=v,s}},5838:function(t,e,r){t.exports=n;var i=r(7842);function n(o){for(var a=new Array(o.length),s=0;s0)continue;Ut=mt.slice(0,1).join("")}return J(Ut),rt+=Ut.length,F=F.slice(Ut.length),F.length}while(!0)}function te(){return/[^a-fA-F0-9]/.test(R)?(J(F.join("")),B=f,z):(F.push(R),I=R,z+1)}function Jt(){return R==="."||/[eE]/.test(R)?(F.push(R),B=y,I=R,z+1):R==="x"&&F.length===1&&F[0]==="0"?(B=h,F.push(R),I=R,z+1):/[^\d]/.test(R)?(J(F.join("")),B=f,z):(F.push(R),I=R,z+1)}function ee(){return R==="f"&&(F.push(R),I=R,z+=1),/[eE]/.test(R)||(R==="-"||R==="+")&&/[eE]/.test(I)?(F.push(R),I=R,z+1):/[^\d]/.test(R)?(J(F.join("")),B=f,z):(F.push(R),I=R,z+1)}function Zt(){if(/[^\d\w_]/.test(R)){var mt=F.join("");return ut[mt]?B=M:Q[mt]?B=k:B=S,J(F.join("")),B=f,z}return F.push(R),I=R,z+1}}},5878:function(t,e,r){t.exports=a;var i=r(3250),n=r(2014);function o(s,f,v){var g=Math.abs(i(s,f,v)),m=Math.sqrt(Math.pow(f[0]-v[0],2)+Math.pow(f[1]-v[1],2));return g/m}function a(s,f,v){for(var g=f.length,m=s.length,w=new Array(g),l=new Array(g),x=new Array(g),y=new Array(g),S=0;S>1:(et>>1)-1}function P(et){for(var Z=b(et);;){var ot=Z,X=2*et+1,Q=2*(et+1),ut=et;if(X0;){var ot=_(et);if(ot>=0){var X=b(ot);if(Z0){var et=I[0];return h(0,N-1),N-=1,P(0),et}return-1}function B(et,Z){var ot=I[et];return x[ot]===Z?et:(x[ot]=-1/0,z(et),D(),x[ot]=Z,N+=1,z(N-1))}function R(et){if(!y[et]){y[et]=!0;var Z=w[et],ot=l[et];w[ot]>=0&&(w[ot]=Z),l[Z]>=0&&(l[Z]=ot),F[Z]>=0&&B(F[Z],c(Z)),F[ot]>=0&&B(F[ot],c(ot))}}for(var I=[],F=new Array(g),S=0;S>1;S>=0;--S)P(S);for(;;){var G=D();if(G<0||x[G]>v)break;R(G)}for(var rt=[],S=0;S=0&&ot>=0&&Z!==ot){var X=F[Z],Q=F[ot];X!==Q&&st.push([X,Q])}}),n.unique(n.normalize(st)),{positions:rt,edges:st}}},5911:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[0],v=n[1],g=n[2];return r[0]=a*g-s*v,r[1]=s*f-o*g,r[2]=o*v-a*f,r}},5964:function(t){t.exports=function(e){return!e&&e!==0?"":e.toString()}},5995:function(t,e,r){t.exports=o;var i=r(7642),n=r(6037);function o(a,s){return i(s).filter(function(f){for(var v=new Array(f.length),g=0;g2&&b[1]>2&&T(h.pick(-1,-1).lo(1,1).hi(b[0]-2,b[1]-2),c.pick(-1,-1,0).lo(1,1).hi(b[0]-2,b[1]-2),c.pick(-1,-1,1).lo(1,1).hi(b[0]-2,b[1]-2)),b[1]>2&&(M(h.pick(0,-1).lo(1).hi(b[1]-2),c.pick(0,-1,1).lo(1).hi(b[1]-2)),k(c.pick(0,-1,0).lo(1).hi(b[1]-2))),b[1]>2&&(M(h.pick(b[0]-1,-1).lo(1).hi(b[1]-2),c.pick(b[0]-1,-1,1).lo(1).hi(b[1]-2)),k(c.pick(b[0]-1,-1,0).lo(1).hi(b[1]-2))),b[0]>2&&(M(h.pick(-1,0).lo(1).hi(b[0]-2),c.pick(-1,0,0).lo(1).hi(b[0]-2)),k(c.pick(-1,0,1).lo(1).hi(b[0]-2))),b[0]>2&&(M(h.pick(-1,b[1]-1).lo(1).hi(b[0]-2),c.pick(-1,b[1]-1,0).lo(1).hi(b[0]-2)),k(c.pick(-1,b[1]-1,1).lo(1).hi(b[0]-2))),c.set(0,0,0,0),c.set(0,0,1,0),c.set(b[0]-1,0,0,0),c.set(b[0]-1,0,1,0),c.set(0,b[1]-1,0,0),c.set(0,b[1]-1,1,0),c.set(b[0]-1,b[1]-1,0,0),c.set(b[0]-1,b[1]-1,1,0),c}}function y(S){var k=S.join(),b=g[k];if(b)return b;for(var M=S.length,T=[m,w],c=1;c<=M;++c)T.push(l(c));var h=x,b=h.apply(void 0,T);return g[k]=b,b}t.exports=function(S,k,M){if(Array.isArray(M)||(typeof M=="string"?M=i(k.dimension,M):M=i(k.dimension,"clamp")),k.size===0)return S;if(k.dimension===0)return S.set(0),S;var T=y(M);return T(S,k)}},6204:function(t){t.exports=e;function e(r){var i,n,o,a=r.length,s=0;for(i=0;ig&&(g=i.length(z)),_&&!b){var D=2*i.distance(k,P)/(i.length(M)+i.length(z));D?(c=Math.min(c,D),h=!1):h=!0}h||(k=P,M=z),T.push(z)}var B=[m,l,y],R=[w,x,S];a&&(a[0]=B,a[1]=R),g===0&&(g=1);var I=1/g;isFinite(c)||(c=1),v.vectorScale=c;var F=o.coneSize||(b?1:.5);o.absoluteConeSize&&(F=o.absoluteConeSize*I),v.coneScale=F;for(var _=0,j=0;_rt&&(R|=1<rt){R|=1<v[z][1])&&(ut=z);for(var J=-1,z=0;z<3;++z){var q=ut^1<v[it][0]&&(it=q)}}var nt=y;nt[0]=nt[1]=nt[2]=0,nt[i.log2(J^ut)]=ut&J,nt[i.log2(ut^it)]=ut⁢var dt=it^7;dt===R||dt===Q?(dt=J^7,nt[i.log2(it^dt)]=dt&it):nt[i.log2(J^dt)]=dt&J;for(var Tt=S,wt=R,j=0;j<3;++j)wt&1<=0&&(v=s.length-f-1);var g=Math.pow(10,v),m=Math.round(o*a*g),w=m+"";if(w.indexOf("e")>=0)return w;var l=m/g,x=m%g;m<0?(l=-Math.ceil(l)|0,x=-x|0):(l=Math.floor(l)|0,x=x|0);var y=""+l;if(m<0&&(y="-"+y),v){for(var S=""+x;S.length=o[0][f];--m)v.push({x:m*a[f],text:r(a[f],m)});s.push(v)}return s}function n(o,a){for(var s=0;s<3;++s){if(o[s].length!==a[s].length)return!1;for(var f=0;fk+1)throw new Error(y+" map requires nshades to be at least size "+x.length);Array.isArray(v.alpha)?v.alpha.length!==2?M=[1,1]:M=v.alpha.slice():typeof v.alpha=="number"?M=[v.alpha,v.alpha]:M=[1,1],g=x.map(function(P){return Math.round(P.index*k)}),M[0]=Math.min(Math.max(M[0],0),1),M[1]=Math.min(Math.max(M[1],0),1);var c=x.map(function(P,z){var D=x[z].index,B=x[z].rgb.slice();return B.length===4&&B[3]>=0&&B[3]<=1||(B[3]=M[0]+(M[1]-M[0])*D),B}),h=[];for(T=0;T 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the tube vertex and normal at the given index. -// -// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. -// -// Each tube segment is made up of a ring of vertices. -// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. -// The indexes of tube segments run from 0 to 8. -// -vec3 getTubePosition(vec3 d, float index, out vec3 normal) { - float segmentCount = 8.0; - - float angle = 2.0 * 3.14159 * (index / segmentCount); - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d); - vec3 y = v * sin(angle) * length(d); - vec3 v3 = x + y; - - normal = normalize(v3); - - return v3; -} - -attribute vec4 vector; -attribute vec4 color, position; -attribute vec2 uv; - -uniform float vectorScale, tubeScale; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 eyePosition, lightPosition; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - // Scale the vector magnitude to stay constant with - // model & view changes. - vec3 normal; - vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); - vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * tubePosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - f_lightDirection = lightPosition - cameraCoordinate.xyz; - f_eyeDirection = eyePosition - cameraCoordinate.xyz; - f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); - - // vec4 m_position = model * vec4(tubePosition, 1.0); - vec4 t_position = view * tubePosition; - gl_Position = projection * t_position; - - f_color = color; - f_data = tubePosition.xyz; - f_position = position.xyz; - f_uv = uv; -} -`]),o=i([`#extension GL_OES_standard_derivatives : enable - -precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float cookTorranceSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness, - float fresnel) { - - float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); - float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); - - //Half angle vector - vec3 H = normalize(lightDirection + viewDirection); - - //Geometric term - float NdotH = max(dot(surfaceNormal, H), 0.0); - float VdotH = max(dot(viewDirection, H), 0.000001); - float LdotH = max(dot(lightDirection, H), 0.000001); - float G1 = (2.0 * NdotH * VdotN) / VdotH; - float G2 = (2.0 * NdotH * LdotN) / LdotH; - float G = min(1.0, min(G1, G2)); - - //Distribution term - float D = beckmannDistribution(NdotH, roughness); - - //Fresnel term - float F = pow(1.0 - VdotN, fresnel); - - //Multiply terms and done - return G * F * D / max(3.14159265 * VdotN, 0.000001); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform sampler2D texture; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = f_color * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * opacity; -} -`]),a=i([`precision highp float; - -precision highp float; -#define GLSLIFY 1 - -vec3 getOrthogonalVector(vec3 v) { - // Return up-vector for only-z vector. - // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). - // From the above if-statement we have ||a|| > 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the tube vertex and normal at the given index. -// -// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. -// -// Each tube segment is made up of a ring of vertices. -// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. -// The indexes of tube segments run from 0 to 8. -// -vec3 getTubePosition(vec3 d, float index, out vec3 normal) { - float segmentCount = 8.0; - - float angle = 2.0 * 3.14159 * (index / segmentCount); - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d); - vec3 y = v * sin(angle) * length(d); - vec3 v3 = x + y; - - normal = normalize(v3); - - return v3; -} - -attribute vec4 vector; -attribute vec4 position; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform float tubeScale; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - vec3 normal; - vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); - vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - gl_Position = projection * (view * tubePosition); - f_id = id; - f_position = position.xyz; -} -`]),s=i([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},6743:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=i[3],v=o+o,g=a+a,m=s+s,w=o*v,l=o*g,x=o*m,y=a*g,S=a*m,k=s*m,M=f*v,T=f*g,c=f*m;return r[0]=1-(y+k),r[1]=l+c,r[2]=x-T,r[3]=0,r[4]=l-c,r[5]=1-(w+k),r[6]=S+M,r[7]=0,r[8]=x+T,r[9]=S-M,r[10]=1-(w+y),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}},6760:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=i[3],v=i[4],g=i[5],m=i[6],w=i[7],l=i[8],x=i[9],y=i[10],S=i[11],k=i[12],M=i[13],T=i[14],c=i[15],h=n[0],b=n[1],_=n[2],P=n[3];return r[0]=h*o+b*v+_*l+P*k,r[1]=h*a+b*g+_*x+P*M,r[2]=h*s+b*m+_*y+P*T,r[3]=h*f+b*w+_*S+P*c,h=n[4],b=n[5],_=n[6],P=n[7],r[4]=h*o+b*v+_*l+P*k,r[5]=h*a+b*g+_*x+P*M,r[6]=h*s+b*m+_*y+P*T,r[7]=h*f+b*w+_*S+P*c,h=n[8],b=n[9],_=n[10],P=n[11],r[8]=h*o+b*v+_*l+P*k,r[9]=h*a+b*g+_*x+P*M,r[10]=h*s+b*m+_*y+P*T,r[11]=h*f+b*w+_*S+P*c,h=n[12],b=n[13],_=n[14],P=n[15],r[12]=h*o+b*v+_*l+P*k,r[13]=h*a+b*g+_*x+P*M,r[14]=h*s+b*m+_*y+P*T,r[15]=h*f+b*w+_*S+P*c,r}},6768:function(t,e,r){var i=r(6859);t.exports=n;function n(o){return new i(o)}},6803:function(t,e,r){r(8828),r(1755);function i(n,o){var a=n.length,s=n.length-o.length,f=Math.min;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-o[0];case 2:var l=n[0]+n[1]-o[0]-o[1];return l||f(n[0],n[1])-f(o[0],o[1]);case 3:var v=n[0]+n[1],g=o[0]+o[1];if(l=v+n[2]-(g+o[2]),l)return l;var m=f(n[0],n[1]),w=f(o[0],o[1]),l=f(m,n[2])-f(w,o[2]);return l||f(m+n[2],v)-f(w+o[2],g);default:var x=n.slice(0);x.sort();var y=o.slice(0);y.sort();for(var S=0;S0?I:F},s.min=function(I,F){return I.cmp(F)<0?I:F},s.prototype._init=function(I,F,j){if(typeof I=="number")return this._initNumber(I,F,j);if(typeof I=="object")return this._initArray(I,F,j);F==="hex"&&(F=16),o(F===(F|0)&&F>=2&&F<=36),I=I.toString().replace(/\s+/g,"");var N=0;I[0]==="-"&&(N++,this.negative=1),N=0;N-=3)rt=I[N]|I[N-1]<<8|I[N-2]<<16,this.words[G]|=rt<>>26-ct&67108863,ct+=24,ct>=26&&(ct-=26,G++);else if(j==="le")for(N=0,G=0;N>>26-ct&67108863,ct+=24,ct>=26&&(ct-=26,G++);return this.strip()};function v(I,F){var j=I.charCodeAt(F);return j>=65&&j<=70?j-55:j>=97&&j<=102?j-87:j-48&15}function g(I,F,j){var N=v(I,j);return j-1>=F&&(N|=v(I,j-1)<<4),N}s.prototype._parseHex=function(I,F,j){this.length=Math.ceil((I.length-F)/6),this.words=new Array(this.length);for(var N=0;N=F;N-=2)ct=g(I,F,N)<=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8;else{var st=I.length-F;for(N=st%2===0?F+1:F;N=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8}this.strip()};function m(I,F,j,N){for(var G=0,rt=Math.min(I.length,j),ct=F;ct=49?G+=st-49+10:st>=17?G+=st-17+10:G+=st}return G}s.prototype._parseBase=function(I,F,j){this.words=[0],this.length=1;for(var N=0,G=1;G<=67108863;G*=F)N++;N--,G=G/F|0;for(var rt=I.length-j,ct=rt%N,st=Math.min(rt,rt-ct)+j,et=0,Z=j;Z1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(I,F){I=I||10,F=F|0||1;var j;if(I===16||I==="hex"){j="";for(var N=0,G=0,rt=0;rt>>24-N&16777215,G!==0||rt!==this.length-1?j=w[6-st.length]+st+j:j=st+j,N+=2,N>=26&&(N-=26,rt--)}for(G!==0&&(j=G.toString(16)+j);j.length%F!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}if(I===(I|0)&&I>=2&&I<=36){var et=l[I],Z=x[I];j="";var ot=this.clone();for(ot.negative=0;!ot.isZero();){var X=ot.modn(Z).toString(I);ot=ot.idivn(Z),ot.isZero()?j=X+j:j=w[et-X.length]+X+j}for(this.isZero()&&(j="0"+j);j.length%F!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}o(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(I,F){return o(typeof f<"u"),this.toArrayLike(f,I,F)},s.prototype.toArray=function(I,F){return this.toArrayLike(Array,I,F)},s.prototype.toArrayLike=function(I,F,j){var N=this.byteLength(),G=j||Math.max(1,N);o(N<=G,"byte array longer than desired length"),o(G>0,"Requested array length <= 0"),this.strip();var rt=F==="le",ct=new I(G),st,et,Z=this.clone();if(rt){for(et=0;!Z.isZero();et++)st=Z.andln(255),Z.iushrn(8),ct[et]=st;for(;et=4096&&(j+=13,F>>>=13),F>=64&&(j+=7,F>>>=7),F>=8&&(j+=4,F>>>=4),F>=2&&(j+=2,F>>>=2),j+F},s.prototype._zeroBits=function(I){if(I===0)return 26;var F=I,j=0;return(F&8191)===0&&(j+=13,F>>>=13),(F&127)===0&&(j+=7,F>>>=7),(F&15)===0&&(j+=4,F>>>=4),(F&3)===0&&(j+=2,F>>>=2),(F&1)===0&&j++,j},s.prototype.bitLength=function(){var I=this.words[this.length-1],F=this._countBits(I);return(this.length-1)*26+F};function y(I){for(var F=new Array(I.bitLength()),j=0;j>>G}return F}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,F=0;FI.length?this.clone().ior(I):I.clone().ior(this)},s.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},s.prototype.iuand=function(I){var F;this.length>I.length?F=I:F=this;for(var j=0;jI.length?this.clone().iand(I):I.clone().iand(this)},s.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},s.prototype.iuxor=function(I){var F,j;this.length>I.length?(F=this,j=I):(F=I,j=this);for(var N=0;NI.length?this.clone().ixor(I):I.clone().ixor(this)},s.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},s.prototype.inotn=function(I){o(typeof I=="number"&&I>=0);var F=Math.ceil(I/26)|0,j=I%26;this._expand(F),j>0&&F--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-j),this.strip()},s.prototype.notn=function(I){return this.clone().inotn(I)},s.prototype.setn=function(I,F){o(typeof I=="number"&&I>=0);var j=I/26|0,N=I%26;return this._expand(j+1),F?this.words[j]=this.words[j]|1<I.length?(j=this,N=I):(j=I,N=this);for(var G=0,rt=0;rt>>26;for(;G!==0&&rt>>26;if(this.length=j.length,G!==0)this.words[this.length]=G,this.length++;else if(j!==this)for(;rtI.length?this.clone().iadd(I):I.clone().iadd(this)},s.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var F=this.iadd(I);return I.negative=1,F._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var j=this.cmp(I);if(j===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,G;j>0?(N=this,G=I):(N=I,G=this);for(var rt=0,ct=0;ct>26,this.words[ct]=F&67108863;for(;rt!==0&&ct>26,this.words[ct]=F&67108863;if(rt===0&&ct>>26,X=et&67108863,Q=Math.min(Z,F.length-1),ut=Math.max(0,Z-I.length+1);ut<=Q;ut++){var J=Z-ut|0;G=I.words[J]|0,rt=F.words[ut]|0,ct=G*rt+X,ot+=ct/67108864|0,X=ct&67108863}j.words[Z]=X|0,et=ot|0}return et!==0?j.words[Z]=et|0:j.length--,j.strip()}var k=function(I,F,j){var N=I.words,G=F.words,rt=j.words,ct=0,st,et,Z,ot=N[0]|0,X=ot&8191,Q=ot>>>13,ut=N[1]|0,J=ut&8191,q=ut>>>13,it=N[2]|0,nt=it&8191,dt=it>>>13,Tt=N[3]|0,wt=Tt&8191,Ct=Tt>>>13,It=N[4]|0,Nt=It&8191,te=It>>>13,Jt=N[5]|0,ee=Jt&8191,Zt=Jt>>>13,mt=N[6]|0,bt=mt&8191,vt=mt>>>13,Ut=N[7]|0,re=Ut&8191,Kt=Ut>>>13,ue=N[8]|0,Me=ue&8191,Ce=ue>>>13,We=N[9]|0,qe=We&8191,vr=We>>>13,_r=G[0]|0,er=_r&8191,Mr=_r>>>13,Ir=G[1]|0,de=Ir&8191,Dt=Ir>>>13,qt=G[2]|0,_t=qt&8191,lt=qt>>>13,yt=G[3]|0,St=yt&8191,Ht=yt>>>13,Yt=G[4]|0,se=Yt&8191,ke=Yt>>>13,Ee=G[5]|0,Ue=Ee&8191,ir=Ee>>>13,ar=G[6]|0,Ye=ar&8191,Er=ar>>>13,pn=G[7]|0,dn=pn&8191,bn=pn>>>13,Zn=G[8]|0,En=Zn&8191,gn=Zn>>>13,da=G[9]|0,ra=da&8191,Se=da>>>13;j.negative=I.negative^F.negative,j.length=19,st=Math.imul(X,er),et=Math.imul(X,Mr),et=et+Math.imul(Q,er)|0,Z=Math.imul(Q,Mr);var Re=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Re>>>26)|0,Re&=67108863,st=Math.imul(J,er),et=Math.imul(J,Mr),et=et+Math.imul(q,er)|0,Z=Math.imul(q,Mr),st=st+Math.imul(X,de)|0,et=et+Math.imul(X,Dt)|0,et=et+Math.imul(Q,de)|0,Z=Z+Math.imul(Q,Dt)|0;var Ze=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,st=Math.imul(nt,er),et=Math.imul(nt,Mr),et=et+Math.imul(dt,er)|0,Z=Math.imul(dt,Mr),st=st+Math.imul(J,de)|0,et=et+Math.imul(J,Dt)|0,et=et+Math.imul(q,de)|0,Z=Z+Math.imul(q,Dt)|0,st=st+Math.imul(X,_t)|0,et=et+Math.imul(X,lt)|0,et=et+Math.imul(Q,_t)|0,Z=Z+Math.imul(Q,lt)|0;var tr=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(tr>>>26)|0,tr&=67108863,st=Math.imul(wt,er),et=Math.imul(wt,Mr),et=et+Math.imul(Ct,er)|0,Z=Math.imul(Ct,Mr),st=st+Math.imul(nt,de)|0,et=et+Math.imul(nt,Dt)|0,et=et+Math.imul(dt,de)|0,Z=Z+Math.imul(dt,Dt)|0,st=st+Math.imul(J,_t)|0,et=et+Math.imul(J,lt)|0,et=et+Math.imul(q,_t)|0,Z=Z+Math.imul(q,lt)|0,st=st+Math.imul(X,St)|0,et=et+Math.imul(X,Ht)|0,et=et+Math.imul(Q,St)|0,Z=Z+Math.imul(Q,Ht)|0;var zr=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(zr>>>26)|0,zr&=67108863,st=Math.imul(Nt,er),et=Math.imul(Nt,Mr),et=et+Math.imul(te,er)|0,Z=Math.imul(te,Mr),st=st+Math.imul(wt,de)|0,et=et+Math.imul(wt,Dt)|0,et=et+Math.imul(Ct,de)|0,Z=Z+Math.imul(Ct,Dt)|0,st=st+Math.imul(nt,_t)|0,et=et+Math.imul(nt,lt)|0,et=et+Math.imul(dt,_t)|0,Z=Z+Math.imul(dt,lt)|0,st=st+Math.imul(J,St)|0,et=et+Math.imul(J,Ht)|0,et=et+Math.imul(q,St)|0,Z=Z+Math.imul(q,Ht)|0,st=st+Math.imul(X,se)|0,et=et+Math.imul(X,ke)|0,et=et+Math.imul(Q,se)|0,Z=Z+Math.imul(Q,ke)|0;var tn=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(tn>>>26)|0,tn&=67108863,st=Math.imul(ee,er),et=Math.imul(ee,Mr),et=et+Math.imul(Zt,er)|0,Z=Math.imul(Zt,Mr),st=st+Math.imul(Nt,de)|0,et=et+Math.imul(Nt,Dt)|0,et=et+Math.imul(te,de)|0,Z=Z+Math.imul(te,Dt)|0,st=st+Math.imul(wt,_t)|0,et=et+Math.imul(wt,lt)|0,et=et+Math.imul(Ct,_t)|0,Z=Z+Math.imul(Ct,lt)|0,st=st+Math.imul(nt,St)|0,et=et+Math.imul(nt,Ht)|0,et=et+Math.imul(dt,St)|0,Z=Z+Math.imul(dt,Ht)|0,st=st+Math.imul(J,se)|0,et=et+Math.imul(J,ke)|0,et=et+Math.imul(q,se)|0,Z=Z+Math.imul(q,ke)|0,st=st+Math.imul(X,Ue)|0,et=et+Math.imul(X,ir)|0,et=et+Math.imul(Q,Ue)|0,Z=Z+Math.imul(Q,ir)|0;var Yr=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,st=Math.imul(bt,er),et=Math.imul(bt,Mr),et=et+Math.imul(vt,er)|0,Z=Math.imul(vt,Mr),st=st+Math.imul(ee,de)|0,et=et+Math.imul(ee,Dt)|0,et=et+Math.imul(Zt,de)|0,Z=Z+Math.imul(Zt,Dt)|0,st=st+Math.imul(Nt,_t)|0,et=et+Math.imul(Nt,lt)|0,et=et+Math.imul(te,_t)|0,Z=Z+Math.imul(te,lt)|0,st=st+Math.imul(wt,St)|0,et=et+Math.imul(wt,Ht)|0,et=et+Math.imul(Ct,St)|0,Z=Z+Math.imul(Ct,Ht)|0,st=st+Math.imul(nt,se)|0,et=et+Math.imul(nt,ke)|0,et=et+Math.imul(dt,se)|0,Z=Z+Math.imul(dt,ke)|0,st=st+Math.imul(J,Ue)|0,et=et+Math.imul(J,ir)|0,et=et+Math.imul(q,Ue)|0,Z=Z+Math.imul(q,ir)|0,st=st+Math.imul(X,Ye)|0,et=et+Math.imul(X,Er)|0,et=et+Math.imul(Q,Ye)|0,Z=Z+Math.imul(Q,Er)|0;var $r=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+($r>>>26)|0,$r&=67108863,st=Math.imul(re,er),et=Math.imul(re,Mr),et=et+Math.imul(Kt,er)|0,Z=Math.imul(Kt,Mr),st=st+Math.imul(bt,de)|0,et=et+Math.imul(bt,Dt)|0,et=et+Math.imul(vt,de)|0,Z=Z+Math.imul(vt,Dt)|0,st=st+Math.imul(ee,_t)|0,et=et+Math.imul(ee,lt)|0,et=et+Math.imul(Zt,_t)|0,Z=Z+Math.imul(Zt,lt)|0,st=st+Math.imul(Nt,St)|0,et=et+Math.imul(Nt,Ht)|0,et=et+Math.imul(te,St)|0,Z=Z+Math.imul(te,Ht)|0,st=st+Math.imul(wt,se)|0,et=et+Math.imul(wt,ke)|0,et=et+Math.imul(Ct,se)|0,Z=Z+Math.imul(Ct,ke)|0,st=st+Math.imul(nt,Ue)|0,et=et+Math.imul(nt,ir)|0,et=et+Math.imul(dt,Ue)|0,Z=Z+Math.imul(dt,ir)|0,st=st+Math.imul(J,Ye)|0,et=et+Math.imul(J,Er)|0,et=et+Math.imul(q,Ye)|0,Z=Z+Math.imul(q,Er)|0,st=st+Math.imul(X,dn)|0,et=et+Math.imul(X,bn)|0,et=et+Math.imul(Q,dn)|0,Z=Z+Math.imul(Q,bn)|0;var In=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(In>>>26)|0,In&=67108863,st=Math.imul(Me,er),et=Math.imul(Me,Mr),et=et+Math.imul(Ce,er)|0,Z=Math.imul(Ce,Mr),st=st+Math.imul(re,de)|0,et=et+Math.imul(re,Dt)|0,et=et+Math.imul(Kt,de)|0,Z=Z+Math.imul(Kt,Dt)|0,st=st+Math.imul(bt,_t)|0,et=et+Math.imul(bt,lt)|0,et=et+Math.imul(vt,_t)|0,Z=Z+Math.imul(vt,lt)|0,st=st+Math.imul(ee,St)|0,et=et+Math.imul(ee,Ht)|0,et=et+Math.imul(Zt,St)|0,Z=Z+Math.imul(Zt,Ht)|0,st=st+Math.imul(Nt,se)|0,et=et+Math.imul(Nt,ke)|0,et=et+Math.imul(te,se)|0,Z=Z+Math.imul(te,ke)|0,st=st+Math.imul(wt,Ue)|0,et=et+Math.imul(wt,ir)|0,et=et+Math.imul(Ct,Ue)|0,Z=Z+Math.imul(Ct,ir)|0,st=st+Math.imul(nt,Ye)|0,et=et+Math.imul(nt,Er)|0,et=et+Math.imul(dt,Ye)|0,Z=Z+Math.imul(dt,Er)|0,st=st+Math.imul(J,dn)|0,et=et+Math.imul(J,bn)|0,et=et+Math.imul(q,dn)|0,Z=Z+Math.imul(q,bn)|0,st=st+Math.imul(X,En)|0,et=et+Math.imul(X,gn)|0,et=et+Math.imul(Q,En)|0,Z=Z+Math.imul(Q,gn)|0;var Nn=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,st=Math.imul(qe,er),et=Math.imul(qe,Mr),et=et+Math.imul(vr,er)|0,Z=Math.imul(vr,Mr),st=st+Math.imul(Me,de)|0,et=et+Math.imul(Me,Dt)|0,et=et+Math.imul(Ce,de)|0,Z=Z+Math.imul(Ce,Dt)|0,st=st+Math.imul(re,_t)|0,et=et+Math.imul(re,lt)|0,et=et+Math.imul(Kt,_t)|0,Z=Z+Math.imul(Kt,lt)|0,st=st+Math.imul(bt,St)|0,et=et+Math.imul(bt,Ht)|0,et=et+Math.imul(vt,St)|0,Z=Z+Math.imul(vt,Ht)|0,st=st+Math.imul(ee,se)|0,et=et+Math.imul(ee,ke)|0,et=et+Math.imul(Zt,se)|0,Z=Z+Math.imul(Zt,ke)|0,st=st+Math.imul(Nt,Ue)|0,et=et+Math.imul(Nt,ir)|0,et=et+Math.imul(te,Ue)|0,Z=Z+Math.imul(te,ir)|0,st=st+Math.imul(wt,Ye)|0,et=et+Math.imul(wt,Er)|0,et=et+Math.imul(Ct,Ye)|0,Z=Z+Math.imul(Ct,Er)|0,st=st+Math.imul(nt,dn)|0,et=et+Math.imul(nt,bn)|0,et=et+Math.imul(dt,dn)|0,Z=Z+Math.imul(dt,bn)|0,st=st+Math.imul(J,En)|0,et=et+Math.imul(J,gn)|0,et=et+Math.imul(q,En)|0,Z=Z+Math.imul(q,gn)|0,st=st+Math.imul(X,ra)|0,et=et+Math.imul(X,Se)|0,et=et+Math.imul(Q,ra)|0,Z=Z+Math.imul(Q,Se)|0;var Kn=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,st=Math.imul(qe,de),et=Math.imul(qe,Dt),et=et+Math.imul(vr,de)|0,Z=Math.imul(vr,Dt),st=st+Math.imul(Me,_t)|0,et=et+Math.imul(Me,lt)|0,et=et+Math.imul(Ce,_t)|0,Z=Z+Math.imul(Ce,lt)|0,st=st+Math.imul(re,St)|0,et=et+Math.imul(re,Ht)|0,et=et+Math.imul(Kt,St)|0,Z=Z+Math.imul(Kt,Ht)|0,st=st+Math.imul(bt,se)|0,et=et+Math.imul(bt,ke)|0,et=et+Math.imul(vt,se)|0,Z=Z+Math.imul(vt,ke)|0,st=st+Math.imul(ee,Ue)|0,et=et+Math.imul(ee,ir)|0,et=et+Math.imul(Zt,Ue)|0,Z=Z+Math.imul(Zt,ir)|0,st=st+Math.imul(Nt,Ye)|0,et=et+Math.imul(Nt,Er)|0,et=et+Math.imul(te,Ye)|0,Z=Z+Math.imul(te,Er)|0,st=st+Math.imul(wt,dn)|0,et=et+Math.imul(wt,bn)|0,et=et+Math.imul(Ct,dn)|0,Z=Z+Math.imul(Ct,bn)|0,st=st+Math.imul(nt,En)|0,et=et+Math.imul(nt,gn)|0,et=et+Math.imul(dt,En)|0,Z=Z+Math.imul(dt,gn)|0,st=st+Math.imul(J,ra)|0,et=et+Math.imul(J,Se)|0,et=et+Math.imul(q,ra)|0,Z=Z+Math.imul(q,Se)|0;var $n=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+($n>>>26)|0,$n&=67108863,st=Math.imul(qe,_t),et=Math.imul(qe,lt),et=et+Math.imul(vr,_t)|0,Z=Math.imul(vr,lt),st=st+Math.imul(Me,St)|0,et=et+Math.imul(Me,Ht)|0,et=et+Math.imul(Ce,St)|0,Z=Z+Math.imul(Ce,Ht)|0,st=st+Math.imul(re,se)|0,et=et+Math.imul(re,ke)|0,et=et+Math.imul(Kt,se)|0,Z=Z+Math.imul(Kt,ke)|0,st=st+Math.imul(bt,Ue)|0,et=et+Math.imul(bt,ir)|0,et=et+Math.imul(vt,Ue)|0,Z=Z+Math.imul(vt,ir)|0,st=st+Math.imul(ee,Ye)|0,et=et+Math.imul(ee,Er)|0,et=et+Math.imul(Zt,Ye)|0,Z=Z+Math.imul(Zt,Er)|0,st=st+Math.imul(Nt,dn)|0,et=et+Math.imul(Nt,bn)|0,et=et+Math.imul(te,dn)|0,Z=Z+Math.imul(te,bn)|0,st=st+Math.imul(wt,En)|0,et=et+Math.imul(wt,gn)|0,et=et+Math.imul(Ct,En)|0,Z=Z+Math.imul(Ct,gn)|0,st=st+Math.imul(nt,ra)|0,et=et+Math.imul(nt,Se)|0,et=et+Math.imul(dt,ra)|0,Z=Z+Math.imul(dt,Se)|0;var ia=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(ia>>>26)|0,ia&=67108863,st=Math.imul(qe,St),et=Math.imul(qe,Ht),et=et+Math.imul(vr,St)|0,Z=Math.imul(vr,Ht),st=st+Math.imul(Me,se)|0,et=et+Math.imul(Me,ke)|0,et=et+Math.imul(Ce,se)|0,Z=Z+Math.imul(Ce,ke)|0,st=st+Math.imul(re,Ue)|0,et=et+Math.imul(re,ir)|0,et=et+Math.imul(Kt,Ue)|0,Z=Z+Math.imul(Kt,ir)|0,st=st+Math.imul(bt,Ye)|0,et=et+Math.imul(bt,Er)|0,et=et+Math.imul(vt,Ye)|0,Z=Z+Math.imul(vt,Er)|0,st=st+Math.imul(ee,dn)|0,et=et+Math.imul(ee,bn)|0,et=et+Math.imul(Zt,dn)|0,Z=Z+Math.imul(Zt,bn)|0,st=st+Math.imul(Nt,En)|0,et=et+Math.imul(Nt,gn)|0,et=et+Math.imul(te,En)|0,Z=Z+Math.imul(te,gn)|0,st=st+Math.imul(wt,ra)|0,et=et+Math.imul(wt,Se)|0,et=et+Math.imul(Ct,ra)|0,Z=Z+Math.imul(Ct,Se)|0;var Cn=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,st=Math.imul(qe,se),et=Math.imul(qe,ke),et=et+Math.imul(vr,se)|0,Z=Math.imul(vr,ke),st=st+Math.imul(Me,Ue)|0,et=et+Math.imul(Me,ir)|0,et=et+Math.imul(Ce,Ue)|0,Z=Z+Math.imul(Ce,ir)|0,st=st+Math.imul(re,Ye)|0,et=et+Math.imul(re,Er)|0,et=et+Math.imul(Kt,Ye)|0,Z=Z+Math.imul(Kt,Er)|0,st=st+Math.imul(bt,dn)|0,et=et+Math.imul(bt,bn)|0,et=et+Math.imul(vt,dn)|0,Z=Z+Math.imul(vt,bn)|0,st=st+Math.imul(ee,En)|0,et=et+Math.imul(ee,gn)|0,et=et+Math.imul(Zt,En)|0,Z=Z+Math.imul(Zt,gn)|0,st=st+Math.imul(Nt,ra)|0,et=et+Math.imul(Nt,Se)|0,et=et+Math.imul(te,ra)|0,Z=Z+Math.imul(te,Se)|0;var Fa=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,st=Math.imul(qe,Ue),et=Math.imul(qe,ir),et=et+Math.imul(vr,Ue)|0,Z=Math.imul(vr,ir),st=st+Math.imul(Me,Ye)|0,et=et+Math.imul(Me,Er)|0,et=et+Math.imul(Ce,Ye)|0,Z=Z+Math.imul(Ce,Er)|0,st=st+Math.imul(re,dn)|0,et=et+Math.imul(re,bn)|0,et=et+Math.imul(Kt,dn)|0,Z=Z+Math.imul(Kt,bn)|0,st=st+Math.imul(bt,En)|0,et=et+Math.imul(bt,gn)|0,et=et+Math.imul(vt,En)|0,Z=Z+Math.imul(vt,gn)|0,st=st+Math.imul(ee,ra)|0,et=et+Math.imul(ee,Se)|0,et=et+Math.imul(Zt,ra)|0,Z=Z+Math.imul(Zt,Se)|0;var Ga=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,st=Math.imul(qe,Ye),et=Math.imul(qe,Er),et=et+Math.imul(vr,Ye)|0,Z=Math.imul(vr,Er),st=st+Math.imul(Me,dn)|0,et=et+Math.imul(Me,bn)|0,et=et+Math.imul(Ce,dn)|0,Z=Z+Math.imul(Ce,bn)|0,st=st+Math.imul(re,En)|0,et=et+Math.imul(re,gn)|0,et=et+Math.imul(Kt,En)|0,Z=Z+Math.imul(Kt,gn)|0,st=st+Math.imul(bt,ra)|0,et=et+Math.imul(bt,Se)|0,et=et+Math.imul(vt,ra)|0,Z=Z+Math.imul(vt,Se)|0;var ve=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(ve>>>26)|0,ve&=67108863,st=Math.imul(qe,dn),et=Math.imul(qe,bn),et=et+Math.imul(vr,dn)|0,Z=Math.imul(vr,bn),st=st+Math.imul(Me,En)|0,et=et+Math.imul(Me,gn)|0,et=et+Math.imul(Ce,En)|0,Z=Z+Math.imul(Ce,gn)|0,st=st+Math.imul(re,ra)|0,et=et+Math.imul(re,Se)|0,et=et+Math.imul(Kt,ra)|0,Z=Z+Math.imul(Kt,Se)|0;var ge=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(ge>>>26)|0,ge&=67108863,st=Math.imul(qe,En),et=Math.imul(qe,gn),et=et+Math.imul(vr,En)|0,Z=Math.imul(vr,gn),st=st+Math.imul(Me,ra)|0,et=et+Math.imul(Me,Se)|0,et=et+Math.imul(Ce,ra)|0,Z=Z+Math.imul(Ce,Se)|0;var dr=(ct+st|0)+((et&8191)<<13)|0;ct=(Z+(et>>>13)|0)+(dr>>>26)|0,dr&=67108863,st=Math.imul(qe,ra),et=Math.imul(qe,Se),et=et+Math.imul(vr,ra)|0,Z=Math.imul(vr,Se);var br=(ct+st|0)+((et&8191)<<13)|0;return ct=(Z+(et>>>13)|0)+(br>>>26)|0,br&=67108863,rt[0]=Re,rt[1]=Ze,rt[2]=tr,rt[3]=zr,rt[4]=tn,rt[5]=Yr,rt[6]=$r,rt[7]=In,rt[8]=Nn,rt[9]=Kn,rt[10]=$n,rt[11]=ia,rt[12]=Cn,rt[13]=Fa,rt[14]=Ga,rt[15]=ve,rt[16]=ge,rt[17]=dr,rt[18]=br,ct!==0&&(rt[19]=ct,j.length++),j};Math.imul||(k=S);function M(I,F,j){j.negative=F.negative^I.negative,j.length=I.length+F.length;for(var N=0,G=0,rt=0;rt>>26)|0,G+=ct>>>26,ct&=67108863}j.words[rt]=st,N=ct,ct=G}return N!==0?j.words[rt]=N:j.length--,j.strip()}function T(I,F,j){var N=new c;return N.mulp(I,F,j)}s.prototype.mulTo=function(I,F){var j,N=this.length+I.length;return this.length===10&&I.length===10?j=k(this,I,F):N<63?j=S(this,I,F):N<1024?j=M(this,I,F):j=T(this,I,F),j};function c(I,F){this.x=I,this.y=F}c.prototype.makeRBT=function(I){for(var F=new Array(I),j=s.prototype._countBits(I)-1,N=0;N>=1;return N},c.prototype.permute=function(I,F,j,N,G,rt){for(var ct=0;ct>>1)G++;return 1<>>13,j[2*rt+1]=G&8191,G=G>>>13;for(rt=2*F;rt>=26,F+=N/67108864|0,F+=G>>>26,this.words[j]=G&67108863}return F!==0&&(this.words[j]=F,this.length++),this},s.prototype.muln=function(I){return this.clone().imuln(I)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(I){var F=y(I);if(F.length===0)return new s(1);for(var j=this,N=0;N=0);var F=I%26,j=(I-F)/26,N=67108863>>>26-F<<26-F,G;if(F!==0){var rt=0;for(G=0;G>>26-F}rt&&(this.words[G]=rt,this.length++)}if(j!==0){for(G=this.length-1;G>=0;G--)this.words[G+j]=this.words[G];for(G=0;G=0);var N;F?N=(F-F%26)/26:N=0;var G=I%26,rt=Math.min((I-G)/26,this.length),ct=67108863^67108863>>>G<rt)for(this.length-=rt,et=0;et=0&&(Z!==0||et>=N);et--){var ot=this.words[et]|0;this.words[et]=Z<<26-G|ot>>>G,Z=ot&ct}return st&&Z!==0&&(st.words[st.length++]=Z),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(I,F,j){return o(this.negative===0),this.iushrn(I,F,j)},s.prototype.shln=function(I){return this.clone().ishln(I)},s.prototype.ushln=function(I){return this.clone().iushln(I)},s.prototype.shrn=function(I){return this.clone().ishrn(I)},s.prototype.ushrn=function(I){return this.clone().iushrn(I)},s.prototype.testn=function(I){o(typeof I=="number"&&I>=0);var F=I%26,j=(I-F)/26,N=1<=0);var F=I%26,j=(I-F)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=j)return this;if(F!==0&&j++,this.length=Math.min(j,this.length),F!==0){var N=67108863^67108863>>>F<=67108864;F++)this.words[F]-=67108864,F===this.length-1?this.words[F+1]=1:this.words[F+1]++;return this.length=Math.max(this.length,F+1),this},s.prototype.isubn=function(I){if(o(typeof I=="number"),o(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var F=0;F>26)-(st/67108864|0),this.words[G+j]=rt&67108863}for(;G>26,this.words[G+j]=rt&67108863;if(ct===0)return this.strip();for(o(ct===-1),ct=0,G=0;G>26,this.words[G]=rt&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(I,F){var j=this.length-I.length,N=this.clone(),G=I,rt=G.words[G.length-1]|0,ct=this._countBits(rt);j=26-ct,j!==0&&(G=G.ushln(j),N.iushln(j),rt=G.words[G.length-1]|0);var st=N.length-G.length,et;if(F!=="mod"){et=new s(null),et.length=st+1,et.words=new Array(et.length);for(var Z=0;Z=0;X--){var Q=(N.words[G.length+X]|0)*67108864+(N.words[G.length+X-1]|0);for(Q=Math.min(Q/rt|0,67108863),N._ishlnsubmul(G,Q,X);N.negative!==0;)Q--,N.negative=0,N._ishlnsubmul(G,1,X),N.isZero()||(N.negative^=1);et&&(et.words[X]=Q)}return et&&et.strip(),N.strip(),F!=="div"&&j!==0&&N.iushrn(j),{div:et||null,mod:N}},s.prototype.divmod=function(I,F,j){if(o(!I.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,G,rt;return this.negative!==0&&I.negative===0?(rt=this.neg().divmod(I,F),F!=="mod"&&(N=rt.div.neg()),F!=="div"&&(G=rt.mod.neg(),j&&G.negative!==0&&G.iadd(I)),{div:N,mod:G}):this.negative===0&&I.negative!==0?(rt=this.divmod(I.neg(),F),F!=="mod"&&(N=rt.div.neg()),{div:N,mod:rt.mod}):(this.negative&I.negative)!==0?(rt=this.neg().divmod(I.neg(),F),F!=="div"&&(G=rt.mod.neg(),j&&G.negative!==0&&G.isub(I)),{div:rt.div,mod:G}):I.length>this.length||this.cmp(I)<0?{div:new s(0),mod:this}:I.length===1?F==="div"?{div:this.divn(I.words[0]),mod:null}:F==="mod"?{div:null,mod:new s(this.modn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new s(this.modn(I.words[0]))}:this._wordDiv(I,F)},s.prototype.div=function(I){return this.divmod(I,"div",!1).div},s.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},s.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},s.prototype.divRound=function(I){var F=this.divmod(I);if(F.mod.isZero())return F.div;var j=F.div.negative!==0?F.mod.isub(I):F.mod,N=I.ushrn(1),G=I.andln(1),rt=j.cmp(N);return rt<0||G===1&&rt===0?F.div:F.div.negative!==0?F.div.isubn(1):F.div.iaddn(1)},s.prototype.modn=function(I){o(I<=67108863);for(var F=67108864%I,j=0,N=this.length-1;N>=0;N--)j=(F*j+(this.words[N]|0))%I;return j},s.prototype.idivn=function(I){o(I<=67108863);for(var F=0,j=this.length-1;j>=0;j--){var N=(this.words[j]|0)+F*67108864;this.words[j]=N/I|0,F=N%I}return this.strip()},s.prototype.divn=function(I){return this.clone().idivn(I)},s.prototype.egcd=function(I){o(I.negative===0),o(!I.isZero());var F=this,j=I.clone();F.negative!==0?F=F.umod(I):F=F.clone();for(var N=new s(1),G=new s(0),rt=new s(0),ct=new s(1),st=0;F.isEven()&&j.isEven();)F.iushrn(1),j.iushrn(1),++st;for(var et=j.clone(),Z=F.clone();!F.isZero();){for(var ot=0,X=1;(F.words[0]&X)===0&&ot<26;++ot,X<<=1);if(ot>0)for(F.iushrn(ot);ot-- >0;)(N.isOdd()||G.isOdd())&&(N.iadd(et),G.isub(Z)),N.iushrn(1),G.iushrn(1);for(var Q=0,ut=1;(j.words[0]&ut)===0&&Q<26;++Q,ut<<=1);if(Q>0)for(j.iushrn(Q);Q-- >0;)(rt.isOdd()||ct.isOdd())&&(rt.iadd(et),ct.isub(Z)),rt.iushrn(1),ct.iushrn(1);F.cmp(j)>=0?(F.isub(j),N.isub(rt),G.isub(ct)):(j.isub(F),rt.isub(N),ct.isub(G))}return{a:rt,b:ct,gcd:j.iushln(st)}},s.prototype._invmp=function(I){o(I.negative===0),o(!I.isZero());var F=this,j=I.clone();F.negative!==0?F=F.umod(I):F=F.clone();for(var N=new s(1),G=new s(0),rt=j.clone();F.cmpn(1)>0&&j.cmpn(1)>0;){for(var ct=0,st=1;(F.words[0]&st)===0&&ct<26;++ct,st<<=1);if(ct>0)for(F.iushrn(ct);ct-- >0;)N.isOdd()&&N.iadd(rt),N.iushrn(1);for(var et=0,Z=1;(j.words[0]&Z)===0&&et<26;++et,Z<<=1);if(et>0)for(j.iushrn(et);et-- >0;)G.isOdd()&&G.iadd(rt),G.iushrn(1);F.cmp(j)>=0?(F.isub(j),N.isub(G)):(j.isub(F),G.isub(N))}var ot;return F.cmpn(1)===0?ot=N:ot=G,ot.cmpn(0)<0&&ot.iadd(I),ot},s.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var F=this.clone(),j=I.clone();F.negative=0,j.negative=0;for(var N=0;F.isEven()&&j.isEven();N++)F.iushrn(1),j.iushrn(1);do{for(;F.isEven();)F.iushrn(1);for(;j.isEven();)j.iushrn(1);var G=F.cmp(j);if(G<0){var rt=F;F=j,j=rt}else if(G===0||j.cmpn(1)===0)break;F.isub(j)}while(!0);return j.iushln(N)},s.prototype.invm=function(I){return this.egcd(I).a.umod(I)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(I){return this.words[0]&I},s.prototype.bincn=function(I){o(typeof I=="number");var F=I%26,j=(I-F)/26,N=1<>>26,ct&=67108863,this.words[rt]=ct}return G!==0&&(this.words[rt]=G,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(I){var F=I<0;if(this.negative!==0&&!F)return-1;if(this.negative===0&&F)return 1;this.strip();var j;if(this.length>1)j=1;else{F&&(I=-I),o(I<=67108863,"Number is too big");var N=this.words[0]|0;j=N===I?0:NI.length)return 1;if(this.length=0;j--){var N=this.words[j]|0,G=I.words[j]|0;if(N!==G){NG&&(F=1);break}}return F},s.prototype.gtn=function(I){return this.cmpn(I)===1},s.prototype.gt=function(I){return this.cmp(I)===1},s.prototype.gten=function(I){return this.cmpn(I)>=0},s.prototype.gte=function(I){return this.cmp(I)>=0},s.prototype.ltn=function(I){return this.cmpn(I)===-1},s.prototype.lt=function(I){return this.cmp(I)===-1},s.prototype.lten=function(I){return this.cmpn(I)<=0},s.prototype.lte=function(I){return this.cmp(I)<=0},s.prototype.eqn=function(I){return this.cmpn(I)===0},s.prototype.eq=function(I){return this.cmp(I)===0},s.red=function(I){return new B(I)},s.prototype.toRed=function(I){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},s.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(I){return this.red=I,this},s.prototype.forceRed=function(I){return o(!this.red,"Already a number in reduction context"),this._forceRed(I)},s.prototype.redAdd=function(I){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},s.prototype.redIAdd=function(I){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},s.prototype.redSub=function(I){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},s.prototype.redISub=function(I){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},s.prototype.redShl=function(I){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},s.prototype.redMul=function(I){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},s.prototype.redIMul=function(I){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},s.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(I){return o(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var h={k256:null,p224:null,p192:null,p25519:null};function b(I,F){this.name=I,this.p=new s(F,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}b.prototype._tmp=function(){var I=new s(null);return I.words=new Array(Math.ceil(this.n/13)),I},b.prototype.ireduce=function(I){var F=I,j;do this.split(F,this.tmp),F=this.imulK(F),F=F.iadd(this.tmp),j=F.bitLength();while(j>this.n);var N=j0?F.isub(this.p):F.strip!==void 0?F.strip():F._strip(),F},b.prototype.split=function(I,F){I.iushrn(this.n,0,F)},b.prototype.imulK=function(I){return I.imul(this.k)};function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(_,b),_.prototype.split=function(I,F){for(var j=4194303,N=Math.min(I.length,9),G=0;G>>22,rt=ct}rt>>>=22,I.words[G-10]=rt,rt===0&&I.length>10?I.length-=10:I.length-=9},_.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var F=0,j=0;j>>=26,I.words[j]=G,F=N}return F!==0&&(I.words[I.length++]=F),I},s._prime=function(I){if(h[I])return h[I];var F;if(I==="k256")F=new _;else if(I==="p224")F=new P;else if(I==="p192")F=new z;else if(I==="p25519")F=new D;else throw new Error("Unknown prime "+I);return h[I]=F,F};function B(I){if(typeof I=="string"){var F=s._prime(I);this.m=F.p,this.prime=F}else o(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}B.prototype._verify1=function(I){o(I.negative===0,"red works only with positives"),o(I.red,"red works only with red numbers")},B.prototype._verify2=function(I,F){o((I.negative|F.negative)===0,"red works only with positives"),o(I.red&&I.red===F.red,"red works only with red numbers")},B.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):I.umod(this.m)._forceRed(this)},B.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},B.prototype.add=function(I,F){this._verify2(I,F);var j=I.add(F);return j.cmp(this.m)>=0&&j.isub(this.m),j._forceRed(this)},B.prototype.iadd=function(I,F){this._verify2(I,F);var j=I.iadd(F);return j.cmp(this.m)>=0&&j.isub(this.m),j},B.prototype.sub=function(I,F){this._verify2(I,F);var j=I.sub(F);return j.cmpn(0)<0&&j.iadd(this.m),j._forceRed(this)},B.prototype.isub=function(I,F){this._verify2(I,F);var j=I.isub(F);return j.cmpn(0)<0&&j.iadd(this.m),j},B.prototype.shl=function(I,F){return this._verify1(I),this.imod(I.ushln(F))},B.prototype.imul=function(I,F){return this._verify2(I,F),this.imod(I.imul(F))},B.prototype.mul=function(I,F){return this._verify2(I,F),this.imod(I.mul(F))},B.prototype.isqr=function(I){return this.imul(I,I.clone())},B.prototype.sqr=function(I){return this.mul(I,I)},B.prototype.sqrt=function(I){if(I.isZero())return I.clone();var F=this.m.andln(3);if(o(F%2===1),F===3){var j=this.m.add(new s(1)).iushrn(2);return this.pow(I,j)}for(var N=this.m.subn(1),G=0;!N.isZero()&&N.andln(1)===0;)G++,N.iushrn(1);o(!N.isZero());var rt=new s(1).toRed(this),ct=rt.redNeg(),st=this.m.subn(1).iushrn(1),et=this.m.bitLength();for(et=new s(2*et*et).toRed(this);this.pow(et,st).cmp(ct)!==0;)et.redIAdd(ct);for(var Z=this.pow(et,N),ot=this.pow(I,N.addn(1).iushrn(1)),X=this.pow(I,N),Q=G;X.cmp(rt)!==0;){for(var ut=X,J=0;ut.cmp(rt)!==0;J++)ut=ut.redSqr();o(J=0;G--){for(var Z=F.words[G],ot=et-1;ot>=0;ot--){var X=Z>>ot&1;if(rt!==N[0]&&(rt=this.sqr(rt)),X===0&&ct===0){st=0;continue}ct<<=1,ct|=X,st++,!(st!==j&&(G!==0||ot!==0))&&(rt=this.mul(rt,N[ct]),st=0,ct=0)}et=26}return rt},B.prototype.convertTo=function(I){var F=I.umod(this.m);return F===I?F.clone():F},B.prototype.convertFrom=function(I){var F=I.clone();return F.red=null,F},s.mont=function(I){return new R(I)};function R(I){B.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(R,B),R.prototype.convertTo=function(I){return this.imod(I.ushln(this.shift))},R.prototype.convertFrom=function(I){var F=this.imod(I.mul(this.rinv));return F.red=null,F},R.prototype.imul=function(I,F){if(I.isZero()||F.isZero())return I.words[0]=0,I.length=1,I;var j=I.imul(F),N=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=j.isub(N).iushrn(this.shift),rt=G;return G.cmp(this.m)>=0?rt=G.isub(this.m):G.cmpn(0)<0&&(rt=G.iadd(this.m)),rt._forceRed(this)},R.prototype.mul=function(I,F){if(I.isZero()||F.isZero())return new s(0)._forceRed(this);var j=I.mul(F),N=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=j.isub(N).iushrn(this.shift),rt=G;return G.cmp(this.m)>=0?rt=G.isub(this.m):G.cmpn(0)<0&&(rt=G.iadd(this.m)),rt._forceRed(this)},R.prototype.invm=function(I){var F=this.imod(I._invmp(this.m).mul(this.r2));return F._forceRed(this)}})(t,this)},6860:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]-n[0],r[1]=i[1]-n[1],r[2]=i[2]-n[2],r[3]=i[3]-n[3],r}},6864:function(t){t.exports=e;function e(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},6867:function(t,e,r){t.exports=l;var i=r(1888),n=r(855),o=r(7150);function a(x,y){for(var S=0;S>>1;if(!(c<=0)){var h,b=i.mallocDouble(2*c*M),_=i.mallocInt32(M);if(M=s(x,c,b,_),M>0){if(c===1&&k)n.init(M),h=n.sweepComplete(c,S,0,M,b,_,0,M,b,_);else{var P=i.mallocDouble(2*c*T),z=i.mallocInt32(T);T=s(y,c,P,z),T>0&&(n.init(M+T),c===1?h=n.sweepBipartite(c,S,0,M,b,_,0,T,P,z):h=o(c,S,k,M,b,_,T,P,z),i.free(P),i.free(z))}i.free(b),i.free(_)}return h}}}var v;function g(x,y){v.push([x,y])}function m(x){return v=[],f(x,x,g,!0),v}function w(x,y){return v=[],f(x,y,g,!1),v}function l(x,y,S){switch(arguments.length){case 1:return m(x);case 2:return typeof y=="function"?f(x,x,y,!0):w(x,y);case 3:return f(x,y,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},6894:function(t){t.exports=e;function e(r,i,n,o){var a=n[1],s=n[2],f=i[1]-a,v=i[2]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=i[0],r[1]=a+f*m-v*g,r[2]=s+f*g+v*m,r}},7004:function(t){t.exports=e;function e(r){for(var i=r.length,n=r[r.length-1],o=i,a=i-2;a>=0;--a){var s=n,f=r[a];n=s+f;var v=n-s,g=f-v;g&&(r[--o]=n,n=g)}for(var m=0,a=o;a=p0)&&!(p1>=hi)"),y=g("lo===p0"),S=g("lo0;){ot-=1;var ut=ot*c,J=_[ut],q=_[ut+1],it=_[ut+2],nt=_[ut+3],dt=_[ut+4],Tt=_[ut+5],wt=ot*h,Ct=P[wt],It=P[wt+1],Nt=Tt&1,te=!!(Tt&16),Jt=rt,ee=ct,Zt=et,mt=Z;if(Nt&&(Jt=et,ee=Z,Zt=rt,mt=ct),!(Tt&2&&(it=S(F,J,q,it,Jt,ee,It),q>=it))&&!(Tt&4&&(q=k(F,J,q,it,Jt,ee,Ct),q>=it))){var bt=it-q,vt=dt-nt;if(te){if(F*bt*(bt+vt)"u"?r(1538):WeakMap,n=r(2762),o=r(8116),a=new i;function s(f){var v=a.get(f),g=v&&(v._triangleBuffer.handle||v._triangleBuffer.buffer);if(!g||!f.isBuffer(g)){var m=n(f,new Float32Array([-1,-1,-1,4,4,-1]));v=o(f,[{buffer:m,type:f.FLOAT,size:2}]),v._triangleBuffer=m,a.set(f,v)}v.bind(),f.drawArrays(f.TRIANGLES,0,3),v.unbind()}t.exports=s},7182:function(t,e,r){var i={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};i.create();var n=i.create();t.exports=function(o,a,s,f,v,g){return i.identity(o),i.fromRotationTranslation(o,g,a),o[3]=v[0],o[7]=v[1],o[11]=v[2],o[15]=v[3],i.identity(n),f[2]!==0&&(n[9]=f[2],i.multiply(o,o,n)),f[1]!==0&&(n[9]=0,n[8]=f[1],i.multiply(o,o,n)),f[0]!==0&&(n[8]=0,n[4]=f[0],i.multiply(o,o,n)),i.scale(o,o,s),o}},7201:function(t,e,r){var i=1e-6,n=1e-6,o=r(9405),a=r(2762),s=r(8116),f=r(7766),v=r(8406),g=r(6760),m=r(7608),w=r(9618),l=r(6729),x=r(7765),y=r(1888),S=r(840),k=r(7626),M=S.meshShader,T=S.wireShader,c=S.pointShader,h=S.pickShader,b=S.pointPickShader,_=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function z(et,Z,ot,X,Q,ut,J,q,it,nt,dt,Tt,wt,Ct,It,Nt,te,Jt,ee,Zt,mt,bt,vt,Ut,re,Kt,ue){this.gl=et,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=Z,this.dirty=!0,this.triShader=ot,this.lineShader=X,this.pointShader=Q,this.pickShader=ut,this.pointPickShader=J,this.contourShader=q,this.trianglePositions=it,this.triangleColors=dt,this.triangleNormals=wt,this.triangleUVs=Tt,this.triangleIds=nt,this.triangleVAO=Ct,this.triangleCount=0,this.lineWidth=1,this.edgePositions=It,this.edgeColors=te,this.edgeUVs=Jt,this.edgeIds=Nt,this.edgeVAO=ee,this.edgeCount=0,this.pointPositions=Zt,this.pointColors=bt,this.pointUVs=vt,this.pointSizes=Ut,this.pointIds=mt,this.pointVAO=re,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Kt,this.contourVAO=ue,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=P,this._view=P,this._projection=P,this._resolution=[1,1]}var D=z.prototype;D.isOpaque=function(){return!this.hasAlpha},D.isTransparent=function(){return this.hasAlpha},D.pickSlots=1,D.setPickBase=function(et){this.pickId=et};function B(et,Z){if(!Z||!Z.length)return 1;for(var ot=0;otet&&ot>0){var X=(Z[ot][0]-et)/(Z[ot][0]-Z[ot-1][0]);return Z[ot][1]*(1-X)+X*Z[ot-1][1]}}return 1}function R(et,Z){for(var ot=l({colormap:et,nshades:256,format:"rgba"}),X=new Uint8Array(1024),Q=0;Q<256;++Q){for(var ut=ot[Q],J=0;J<3;++J)X[4*Q+J]=ut[J];Z?X[4*Q+3]=255*B(Q/255,Z):X[4*Q+3]=255*ut[3]}return w(X,[256,256,4],[4,0,1])}function I(et){for(var Z=et.length,ot=new Array(Z),X=0;X0){var wt=this.triShader;wt.bind(),wt.uniforms=q,this.triangleVAO.bind(),Z.drawArrays(Z.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var wt=this.lineShader;wt.bind(),wt.uniforms=q,this.edgeVAO.bind(),Z.lineWidth(this.lineWidth*this.pixelRatio),Z.drawArrays(Z.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var wt=this.pointShader;wt.bind(),wt.uniforms=q,this.pointVAO.bind(),Z.drawArrays(Z.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var wt=this.contourShader;wt.bind(),wt.uniforms=q,this.contourVAO.bind(),Z.drawArrays(Z.LINES,0,this.contourCount),this.contourVAO.unbind()}},D.drawPick=function(et){et=et||{};for(var Z=this.gl,ot=et.model||P,X=et.view||P,Q=et.projection||P,ut=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],J=0;J<3;++J)ut[0][J]=Math.max(ut[0][J],this.clipBounds[0][J]),ut[1][J]=Math.min(ut[1][J],this.clipBounds[1][J]);this._model=[].slice.call(ot),this._view=[].slice.call(X),this._projection=[].slice.call(Q),this._resolution=[Z.drawingBufferWidth,Z.drawingBufferHeight];var q={model:ot,view:X,projection:Q,clipBounds:ut,pickId:this.pickId/255},it=this.pickShader;if(it.bind(),it.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),Z.drawArrays(Z.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),Z.lineWidth(this.lineWidth*this.pixelRatio),Z.drawArrays(Z.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var it=this.pointPickShader;it.bind(),it.uniforms=q,this.pointVAO.bind(),Z.drawArrays(Z.POINTS,0,this.pointCount),this.pointVAO.unbind()}},D.pick=function(et){if(!et||et.id!==this.pickId)return null;for(var Z=et.value[0]+256*et.value[1]+65536*et.value[2],ot=this.cells[Z],X=this.positions,Q=new Array(ot.length),ut=0;utMath.max(M,T)?c[2]=1:M>Math.max(k,T)?c[0]=1:c[1]=1;for(var h=0,b=0,_=0;_<3;++_)h+=S[_]*S[_],b+=c[_]*S[_];for(var _=0;_<3;++_)c[_]-=b/h*S[_];return s(c,c),c}function w(S,k,M,T,c,h,b,_){this.center=i(M),this.up=i(T),this.right=i(c),this.radius=i([h]),this.angle=i([b,_]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,k),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var P=0;P<16;++P)this.computedMatrix[P]=.5;this.recalcMatrix(0)}var l=w.prototype;l.setDistanceLimits=function(S,k){S>0?S=Math.log(S):S=-1/0,k>0?k=Math.log(k):k=1/0,k=Math.max(k,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=k},l.getDistanceLimits=function(S){var k=this.radius.bounds[0];return S?(S[0]=Math.exp(k[0][0]),S[1]=Math.exp(k[1][0]),S):[Math.exp(k[0][0]),Math.exp(k[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var k=this.computedUp,M=this.computedRight,T=0,c=0,h=0;h<3;++h)c+=k[h]*M[h],T+=k[h]*k[h];for(var b=Math.sqrt(T),_=0,h=0;h<3;++h)M[h]-=k[h]*c/T,_+=M[h]*M[h],k[h]/=b;for(var P=Math.sqrt(_),h=0;h<3;++h)M[h]/=P;var z=this.computedToward;a(z,k,M),s(z,z);for(var D=Math.exp(this.computedRadius[0]),B=this.computedAngle[0],R=this.computedAngle[1],I=Math.cos(B),F=Math.sin(B),j=Math.cos(R),N=Math.sin(R),G=this.computedCenter,rt=I*j,ct=F*j,st=N,et=-I*N,Z=-F*N,ot=j,X=this.computedEye,Q=this.computedMatrix,h=0;h<3;++h){var ut=rt*M[h]+ct*z[h]+st*k[h];Q[4*h+1]=et*M[h]+Z*z[h]+ot*k[h],Q[4*h+2]=ut,Q[4*h+3]=0}var J=Q[1],q=Q[5],it=Q[9],nt=Q[2],dt=Q[6],Tt=Q[10],wt=q*Tt-it*dt,Ct=it*nt-J*Tt,It=J*dt-q*nt,Nt=v(wt,Ct,It);wt/=Nt,Ct/=Nt,It/=Nt,Q[0]=wt,Q[4]=Ct,Q[8]=It;for(var h=0;h<3;++h)X[h]=G[h]+Q[2+4*h]*D;for(var h=0;h<3;++h){for(var _=0,te=0;te<3;++te)_+=Q[h+4*te]*X[te];Q[12+h]=-_}Q[15]=1},l.getMatrix=function(S,k){this.recalcMatrix(S);var M=this.computedMatrix;if(k){for(var T=0;T<16;++T)k[T]=M[T];return k}return M};var x=[0,0,0];l.rotate=function(S,k,M,T){if(this.angle.move(S,k,M),T){this.recalcMatrix(S);var c=this.computedMatrix;x[0]=c[2],x[1]=c[6],x[2]=c[10];for(var h=this.computedUp,b=this.computedRight,_=this.computedToward,P=0;P<3;++P)c[4*P]=h[P],c[4*P+1]=b[P],c[4*P+2]=_[P];o(c,c,T,x);for(var P=0;P<3;++P)h[P]=c[4*P],b[P]=c[4*P+1];this.up.set(S,h[0],h[1],h[2]),this.right.set(S,b[0],b[1],b[2])}},l.pan=function(S,k,M,T){k=k||0,M=M||0,T=T||0,this.recalcMatrix(S);var c=this.computedMatrix;Math.exp(this.computedRadius[0]);var h=c[1],b=c[5],_=c[9],P=v(h,b,_);h/=P,b/=P,_/=P;var z=c[0],D=c[4],B=c[8],R=z*h+D*b+B*_;z-=h*R,D-=b*R,B-=_*R;var I=v(z,D,B);z/=I,D/=I,B/=I;var F=z*k+h*M,j=D*k+b*M,N=B*k+_*M;this.center.move(S,F,j,N);var G=Math.exp(this.computedRadius[0]);G=Math.max(1e-4,G+T),this.radius.set(S,Math.log(G))},l.translate=function(S,k,M,T){this.center.move(S,k||0,M||0,T||0)},l.setMatrix=function(S,k,M,T){var c=1;typeof M=="number"&&(c=M|0),(c<0||c>3)&&(c=1);var h=(c+2)%3;k||(this.recalcMatrix(S),k=this.computedMatrix);var b=k[c],_=k[c+4],P=k[c+8];if(T){var z=Math.abs(b),D=Math.abs(_),B=Math.abs(P),R=Math.max(z,D,B);z===R?(b=b<0?-1:1,_=P=0):B===R?(P=P<0?-1:1,b=_=0):(_=_<0?-1:1,b=P=0)}else{var I=v(b,_,P);b/=I,_/=I,P/=I}var F=k[h],j=k[h+4],N=k[h+8],G=F*b+j*_+N*P;F-=b*G,j-=_*G,N-=P*G;var rt=v(F,j,N);F/=rt,j/=rt,N/=rt;var ct=_*N-P*j,st=P*F-b*N,et=b*j-_*F,Z=v(ct,st,et);ct/=Z,st/=Z,et/=Z,this.center.jump(S,mt,bt,vt),this.radius.idle(S),this.up.jump(S,b,_,P),this.right.jump(S,F,j,N);var ot,X;if(c===2){var Q=k[1],ut=k[5],J=k[9],q=Q*F+ut*j+J*N,it=Q*ct+ut*st+J*et;wt<0?ot=-Math.PI/2:ot=Math.PI/2,X=Math.atan2(it,q)}else{var nt=k[2],dt=k[6],Tt=k[10],wt=nt*b+dt*_+Tt*P,Ct=nt*F+dt*j+Tt*N,It=nt*ct+dt*st+Tt*et;ot=Math.asin(g(wt)),X=Math.atan2(It,Ct)}this.angle.jump(S,X,ot),this.recalcMatrix(S);var Nt=k[2],te=k[6],Jt=k[10],ee=this.computedMatrix;n(ee,k);var Zt=ee[15],mt=ee[12]/Zt,bt=ee[13]/Zt,vt=ee[14]/Zt,Ut=Math.exp(this.computedRadius[0]);this.center.jump(S,mt-Nt*Ut,bt-te*Ut,vt-Jt*Ut)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,k){k>0&&this.radius.set(S,Math.log(k))},l.lookAt=function(S,k,M,T){this.recalcMatrix(S),k=k||this.computedEye,M=M||this.computedCenter,T=T||this.computedUp;var c=T[0],h=T[1],b=T[2],_=v(c,h,b);if(!(_<1e-6)){c/=_,h/=_,b/=_;var P=k[0]-M[0],z=k[1]-M[1],D=k[2]-M[2],B=v(P,z,D);if(!(B<1e-6)){P/=B,z/=B,D/=B;var R=this.computedRight,I=R[0],F=R[1],j=R[2],N=c*I+h*F+b*j;I-=N*c,F-=N*h,j-=N*b;var G=v(I,F,j);if(!(G<.01&&(I=h*D-b*z,F=b*P-c*D,j=c*z-h*P,G=v(I,F,j),G<1e-6))){I/=G,F/=G,j/=G,this.up.set(S,c,h,b),this.right.set(S,I,F,j),this.center.set(S,M[0],M[1],M[2]),this.radius.set(S,Math.log(B));var rt=h*j-b*F,ct=b*I-c*j,st=c*F-h*I,et=v(rt,ct,st);rt/=et,ct/=et,st/=et;var Z=c*P+h*z+b*D,ot=I*P+F*z+j*D,X=rt*P+ct*z+st*D,Q=Math.asin(g(Z)),ut=Math.atan2(X,ot),J=this.angle._state,q=J[J.length-1],it=J[J.length-2];q=q%(2*Math.PI);var nt=Math.abs(q+2*Math.PI-ut),dt=Math.abs(q-ut),Tt=Math.abs(q-2*Math.PI-ut);nt max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform sampler2D dashTexture; -uniform float dashScale; -uniform float opacity; - -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; - -void main() { - if ( - outOfRange(clipBounds[0], clipBounds[1], worldPosition) || - fragColor.a * opacity == 0. - ) discard; - - float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; - if(dashWeight < 0.5) { - discard; - } - gl_FragColor = fragColor * opacity; -} -`]),s=i([`precision highp float; -#define GLSLIFY 1 - -#define FLOAT_MAX 1.70141184e38 -#define FLOAT_MIN 1.17549435e-38 - -// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl -vec4 packFloat(float v) { - float av = abs(v); - - //Handle special cases - if(av < FLOAT_MIN) { - return vec4(0.0, 0.0, 0.0, 0.0); - } else if(v > FLOAT_MAX) { - return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; - } else if(v < -FLOAT_MAX) { - return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; - } - - vec4 c = vec4(0,0,0,0); - - //Compute exponent and mantissa - float e = floor(log2(av)); - float m = av * pow(2.0, -e) - 1.0; - - //Unpack mantissa - c[1] = floor(128.0 * m); - m -= c[1] / 128.0; - c[2] = floor(32768.0 * m); - m -= c[2] / 32768.0; - c[3] = floor(8388608.0 * m); - - //Unpack exponent - float ebias = e + 127.0; - c[0] = floor(ebias / 2.0); - ebias -= c[0] * 2.0; - c[1] += floor(ebias) * 128.0; - - //Unpack sign bit - c[0] += 128.0 * step(0.0, -v); - - //Scale back to range - return c / 255.0; -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform float pickId; -uniform vec3 clipBounds[2]; - -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; - - gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); -}`]),f=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(v){return n(v,o,a,null,f)},e.createPickShader=function(v){return n(v,o,s,null,f)}},7352:function(t,e,r){var i=r(5721),n=r(4750),o=r(2690);t.exports=a;function a(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var v=s[0].length;return v===0?[]:v===1?i(s):v===2?n(s):o(s,v)}},7399:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],f=n+n,v=o+o,g=a+a,m=n*f,w=o*f,l=o*v,x=a*f,y=a*v,S=a*g,k=s*f,M=s*v,T=s*g;return r[0]=1-l-S,r[1]=w+T,r[2]=x-M,r[3]=0,r[4]=w-T,r[5]=1-m-S,r[6]=y+k,r[7]=0,r[8]=x+M,r[9]=y-k,r[10]=1-m-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},7417:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.max(i[0],n[0]),r[1]=Math.max(i[1],n[1]),r[2]=Math.max(i[2],n[2]),r}},7442:function(t,e,r){var i=r(6658),n=r(7182),o=r(2652),a=r(9921),s=r(8648),f=w(),v=w(),g=w();t.exports=m;function m(y,S,k,M){if(a(S)===0||a(k)===0)return!1;var T=o(S,f.translate,f.scale,f.skew,f.perspective,f.quaternion),c=o(k,v.translate,v.scale,v.skew,v.perspective,v.quaternion);return!T||!c?!1:(i(g.translate,f.translate,v.translate,M),i(g.skew,f.skew,v.skew,M),i(g.scale,f.scale,v.scale,M),i(g.perspective,f.perspective,v.perspective,M),s(g.quaternion,f.quaternion,v.quaternion,M),n(y,g.translate,g.scale,g.skew,g.perspective,g.quaternion),!0)}function w(){return{translate:l(),scale:l(1),skew:l(),perspective:x(),quaternion:x()}}function l(y){return[y||0,y||0,y||0]}function x(){return[0,0,0,1]}},7507:function(t,e){e.byteLength=v,e.toByteArray=m,e.fromByteArray=x;for(var r=[],i=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var k=y.indexOf("=");k===-1&&(k=S);var M=k===S?0:4-k%4;return[k,M]}function v(y){var S=f(y),k=S[0],M=S[1];return(k+M)*3/4-M}function g(y,S,k){return(S+k)*3/4-k}function m(y){var S,k=f(y),M=k[0],T=k[1],c=new n(g(y,M,T)),h=0,b=T>0?M-4:M,_;for(_=0;_>16&255,c[h++]=S>>8&255,c[h++]=S&255;return T===2&&(S=i[y.charCodeAt(_)]<<2|i[y.charCodeAt(_+1)]>>4,c[h++]=S&255),T===1&&(S=i[y.charCodeAt(_)]<<10|i[y.charCodeAt(_+1)]<<4|i[y.charCodeAt(_+2)]>>2,c[h++]=S>>8&255,c[h++]=S&255),c}function w(y){return r[y>>18&63]+r[y>>12&63]+r[y>>6&63]+r[y&63]}function l(y,S,k){for(var M,T=[],c=S;cb?b:h+c));return M===1?(S=y[k-1],T.push(r[S>>2]+r[S<<4&63]+"==")):M===2&&(S=(y[k-2]<<8)+y[k-1],T.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),T.join("")}},7518:function(t,e,r){var i=r(1433);function n(s,f,v,g,m,w){this.location=s,this.dimension=f,this.a=v,this.b=g,this.c=m,this.d=w}n.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function o(s,f,v){this.gl=s,this._ext=f,this.handle=v,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}o.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s1.0001)return null;_+=b[k]}return Math.abs(_-1)>.001?null:[M,f(g,b),b]}},7636:function(t){t.exports=e;function e(r,i){i=i||1;var n=Math.random()*2*Math.PI,o=Math.random()*2-1,a=Math.sqrt(1-o*o)*i;return r[0]=Math.cos(n)*a,r[1]=Math.sin(n)*a,r[2]=o*i,r}},7640:function(t,e,r){var i=r(1888);function n(m){return m==="uint32"?[i.mallocUint32,i.freeUint32]:null}var o={"uint32,1,0":function(m,w){return function(l,x,y,S,k,M,T,c,h,b,_){var P,z,D,B=l*k+S,R,I=m(c),F,j,N,G;for(P=l+1;P<=x;++P){for(z=P,B+=k,D=B,F=0,j=B,R=0;Rl;){F=0,j=D-k;e:for(R=0;RG)break e;j+=b,F+=_}for(F=D,j=D-k,R=0;R>1,F=I-D,j=I+D,N=B,G=F,rt=I,ct=j,st=R,et=y+1,Z=S-1,ot=!0,X,Q,ut,J,q,it,nt,dt,Tt,wt=0,Ct=0,It=0,Nt,te,Jt,ee,Zt,mt,bt,vt,Ut,re,Kt,ue,Me,Ce,We,qe,vr=b,_r=w(vr),er=w(vr);te=T*N,Jt=T*G,qe=M;t:for(Nt=0;Nt0){Q=N,N=G,G=Q;break t}if(It<0)break t;qe+=P}te=T*ct,Jt=T*st,qe=M;t:for(Nt=0;Nt0){Q=ct,ct=st,st=Q;break t}if(It<0)break t;qe+=P}te=T*N,Jt=T*rt,qe=M;t:for(Nt=0;Nt0){Q=N,N=rt,rt=Q;break t}if(It<0)break t;qe+=P}te=T*G,Jt=T*rt,qe=M;t:for(Nt=0;Nt0){Q=G,G=rt,rt=Q;break t}if(It<0)break t;qe+=P}te=T*N,Jt=T*ct,qe=M;t:for(Nt=0;Nt0){Q=N,N=ct,ct=Q;break t}if(It<0)break t;qe+=P}te=T*rt,Jt=T*ct,qe=M;t:for(Nt=0;Nt0){Q=rt,rt=ct,ct=Q;break t}if(It<0)break t;qe+=P}te=T*G,Jt=T*st,qe=M;t:for(Nt=0;Nt0){Q=G,G=st,st=Q;break t}if(It<0)break t;qe+=P}te=T*G,Jt=T*rt,qe=M;t:for(Nt=0;Nt0){Q=G,G=rt,rt=Q;break t}if(It<0)break t;qe+=P}te=T*ct,Jt=T*st,qe=M;t:for(Nt=0;Nt0){Q=ct,ct=st,st=Q;break t}if(It<0)break t;qe+=P}for(te=T*N,Jt=T*G,ee=T*rt,Zt=T*ct,mt=T*st,bt=T*B,vt=T*I,Ut=T*R,We=0,qe=M,Nt=0;Nt0)Z--;else if(It<0){for(te=T*it,Jt=T*et,ee=T*Z,qe=M,Nt=0;Nt0)for(;;){nt=M+Z*T,We=0;t:for(Nt=0;Nt0){if(--ZR){t:for(;;){for(nt=M+et*T,We=0,qe=M,Nt=0;Nt1&&x?S(l,x[0],x[1]):S(l)}var v={"uint32,1,0":function(m,w){return function(l){var x=l.data,y=l.offset|0,S=l.shape,k=l.stride,M=k[0]|0,T=S[0]|0,c=k[1]|0,h=S[1]|0,b=c,_=c,P=1;T<=32?m(0,T-1,x,y,M,c,T,h,b,_,P):w(0,T-1,x,y,M,c,T,h,b,_,P)}}};function g(m,w){var l=[w,m].join(","),x=v[l],y=a(m,w),S=f(m,w,y);return x(y,S)}t.exports=g},7642:function(t,e,r){var i=r(8954),n=r(1682);t.exports=f;function o(v,g){this.point=v,this.index=g}function a(v,g){for(var m=v.point,w=g.point,l=m.length,x=0;x=2)return!1;B[I]=F}return!0}):D=D.filter(function(B){for(var R=0;R<=w;++R){var I=b[B[R]];if(I<0)return!1;B[R]=I}return!0}),w&1)for(var y=0;y",j="",N=F.length,G=j.length,rt=B[0]===x||B[0]===k,ct=0,st=-G;ct>-1&&(ct=R.indexOf(F,ct),!(ct===-1||(st=R.indexOf(j,ct+N),st===-1)||st<=ct));){for(var et=ct;et=st)I[et]=null,R=R.substr(0,et)+" "+R.substr(et+1);else if(I[et]!==null){var Z=I[et].indexOf(B[0]);Z===-1?I[et]+=B:rt&&(I[et]=I[et].substr(0,Z+1)+(1+parseInt(I[et][Z+1]))+I[et].substr(Z+2))}var ot=ct+N,X=R.substr(ot,st-ot),Q=X.indexOf(F);Q!==-1?ct=Q:ct=st+G}return I}function c(D,B,R){for(var I=B.textAlign||"start",F=B.textBaseline||"alphabetic",j=[1073741824,1073741824],N=[0,0],G=D.length,rt=0;rt/g,` -`):R=R.replace(/\/g," ");var N="",G=[];for(q=0;q-1?parseInt(vt[1+Kt]):0,Ce=ue>-1?parseInt(Ut[1+ue]):0;Me!==Ce&&(re=re.replace(It(),"?px "),dt*=Math.pow(.75,Ce-Me),re=re.replace("?px ",It())),nt+=.25*Z*(Ce-Me)}if(j.superscripts===!0){var We=vt.indexOf(x),qe=Ut.indexOf(x),vr=We>-1?parseInt(vt[1+We]):0,_r=qe>-1?parseInt(Ut[1+qe]):0;vr!==_r&&(re=re.replace(It(),"?px "),dt*=Math.pow(.75,_r-vr),re=re.replace("?px ",It())),nt-=.25*Z*(_r-vr)}if(j.bolds===!0){var er=vt.indexOf(g)>-1,Mr=Ut.indexOf(g)>-1;!er&&Mr&&(Ir?re=re.replace("italic ","italic bold "):re="bold "+re),er&&!Mr&&(re=re.replace("bold ",""))}if(j.italics===!0){var Ir=vt.indexOf(w)>-1,de=Ut.indexOf(w)>-1;!Ir&&de&&(re="italic "+re),Ir&&!de&&(re=re.replace("italic ",""))}B.font=re}for(J=0;J0&&(F=I.size),I.lineSpacing&&I.lineSpacing>0&&(j=I.lineSpacing),I.styletags&&I.styletags.breaklines&&(N.breaklines=!!I.styletags.breaklines),I.styletags&&I.styletags.bolds&&(N.bolds=!!I.styletags.bolds),I.styletags&&I.styletags.italics&&(N.italics=!!I.styletags.italics),I.styletags&&I.styletags.subscripts&&(N.subscripts=!!I.styletags.subscripts),I.styletags&&I.styletags.superscripts&&(N.superscripts=!!I.styletags.superscripts)),R.font=[I.fontStyle,I.fontVariant,I.fontWeight,F+"px",I.font].filter(function(rt){return rt}).join(" "),R.textAlign="start",R.textBaseline="alphabetic",R.direction="ltr";var G=h(B,R,D,F,j,N);return P(G,I,F)}},7721:function(t,e,r){var i=r(5716);t.exports=n;function n(o){return i(o[0])*i(o[1])}},7765:function(t,e,r){t.exports=l;var i=r(9618),n=r(1888),o=r(446),a=r(1570);function s(x){for(var y=x.length,S=0,k=0;k"u"&&(k=s(x));var M=x.length;if(M===0||k<1)return{cells:[],vertexIds:[],vertexWeights:[]};var T=f(y,+S),c=v(x,k),h=g(c,y,T,+S),b=m(c,y.length|0),_=a(k)(x,c.data,b,T),P=w(c),z=[].slice.call(h.data,0,h.shape[0]);return n.free(T),n.free(c.data),n.free(h.data),n.free(b),{cells:_,vertexIds:P,vertexWeights:z}}},7766:function(t,e,r){var i=r(9618),n=r(5298),o=r(1888);t.exports=h;var a=null,s=null,f=null;function v(b){a=[b.LINEAR,b.NEAREST_MIPMAP_LINEAR,b.LINEAR_MIPMAP_NEAREST,b.LINEAR_MIPMAP_NEAREST],s=[b.NEAREST,b.LINEAR,b.NEAREST_MIPMAP_NEAREST,b.NEAREST_MIPMAP_LINEAR,b.LINEAR_MIPMAP_NEAREST,b.LINEAR_MIPMAP_LINEAR],f=[b.REPEAT,b.CLAMP_TO_EDGE,b.MIRRORED_REPEAT]}function g(b){return typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&b instanceof HTMLVideoElement||typeof ImageData<"u"&&b instanceof ImageData}var m=function(b,_){n.muls(b,_,255)};function w(b,_,P){var z=b.gl,D=z.getParameter(z.MAX_TEXTURE_SIZE);if(_<0||_>D||P<0||P>D)throw new Error("gl-texture2d: Invalid texture size");return b._shape=[_,P],b.bind(),z.texImage2D(z.TEXTURE_2D,0,b.format,_,P,0,b.format,b.type,null),b._mipLevels=[0],b}function l(b,_,P,z,D,B){this.gl=b,this.handle=_,this.format=D,this.type=B,this._shape=[P,z],this._mipLevels=[0],this._magFilter=b.NEAREST,this._minFilter=b.NEAREST,this._wrapS=b.CLAMP_TO_EDGE,this._wrapT=b.CLAMP_TO_EDGE,this._anisoSamples=1;var R=this,I=[this._wrapS,this._wrapT];Object.defineProperties(I,[{get:function(){return R._wrapS},set:function(j){return R.wrapS=j}},{get:function(){return R._wrapT},set:function(j){return R.wrapT=j}}]),this._wrapVector=I;var F=[this._shape[0],this._shape[1]];Object.defineProperties(F,[{get:function(){return R._shape[0]},set:function(j){return R.width=j}},{get:function(){return R._shape[1]},set:function(j){return R.height=j}}]),this._shapeVector=F}var x=l.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(b){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(b)>=0&&(_.getExtension("OES_texture_float_linear")||(b=_.NEAREST)),s.indexOf(b)<0)throw new Error("gl-texture2d: Unknown filter mode "+b);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,b),this._minFilter=b}},magFilter:{get:function(){return this._magFilter},set:function(b){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(b)>=0&&(_.getExtension("OES_texture_float_linear")||(b=_.NEAREST)),s.indexOf(b)<0)throw new Error("gl-texture2d: Unknown filter mode "+b);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,b),this._magFilter=b}},mipSamples:{get:function(){return this._anisoSamples},set:function(b){var _=this._anisoSamples;if(this._anisoSamples=Math.max(b,1)|0,_!==this._anisoSamples){var P=this.gl.getExtension("EXT_texture_filter_anisotropic");P&&this.gl.texParameterf(this.gl.TEXTURE_2D,P.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(b){if(this.bind(),f.indexOf(b)<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,b),this._wrapS=b}},wrapT:{get:function(){return this._wrapT},set:function(b){if(this.bind(),f.indexOf(b)<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,b),this._wrapT=b}},wrap:{get:function(){return this._wrapVector},set:function(b){if(Array.isArray(b)||(b=[b,b]),b.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var _=0;_<2;++_)if(f.indexOf(b[_])<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);this._wrapS=b[0],this._wrapT=b[1];var P=this.gl;return this.bind(),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_S,this._wrapS),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_T,this._wrapT),b}},shape:{get:function(){return this._shapeVector},set:function(b){if(!Array.isArray(b))b=[b|0,b|0];else if(b.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return w(this,b[0]|0,b[1]|0),[b[0]|0,b[1]|0]}},width:{get:function(){return this._shape[0]},set:function(b){return b=b|0,w(this,b,this._shape[1]),b}},height:{get:function(){return this._shape[1]},set:function(b){return b=b|0,w(this,this._shape[0],b),b}}}),x.bind=function(b){var _=this.gl;return b!==void 0&&_.activeTexture(_.TEXTURE0+(b|0)),_.bindTexture(_.TEXTURE_2D,this.handle),b!==void 0?b|0:_.getParameter(_.ACTIVE_TEXTURE)-_.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var b=Math.min(this._shape[0],this._shape[1]),_=0;b>0;++_,b>>>=1)this._mipLevels.indexOf(_)<0&&this._mipLevels.push(_)},x.setPixels=function(b,_,P,z){var D=this.gl;this.bind(),Array.isArray(_)?(z=P,P=_[1]|0,_=_[0]|0):(_=_||0,P=P||0),z=z||0;var B=g(b)?b:b.raw;if(B){var R=this._mipLevels.indexOf(z)<0;R?(D.texImage2D(D.TEXTURE_2D,0,this.format,this.format,this.type,B),this._mipLevels.push(z)):D.texSubImage2D(D.TEXTURE_2D,z,_,P,this.format,this.type,B)}else if(b.shape&&b.stride&&b.data){if(b.shape.length<2||_+b.shape[1]>this._shape[1]>>>z||P+b.shape[0]>this._shape[0]>>>z||_<0||P<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(D,_,P,z,this.format,this.type,this._mipLevels,b)}else throw new Error("gl-texture2d: Unsupported data type")};function y(b,_){return b.length===3?_[2]===1&&_[1]===b[0]*b[2]&&_[0]===b[2]:_[0]===1&&_[1]===b[0]}function S(b,_,P,z,D,B,R,I){var F=I.dtype,j=I.shape.slice();if(j.length<2||j.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var N=0,G=0,rt=y(j,I.stride.slice());if(F==="float32"?N=b.FLOAT:F==="float64"?(N=b.FLOAT,rt=!1,F="float32"):F==="uint8"?N=b.UNSIGNED_BYTE:(N=b.UNSIGNED_BYTE,rt=!1,F="uint8"),j.length===2)G=b.LUMINANCE,j=[j[0],j[1],1],I=i(I.data,j,[I.stride[0],I.stride[1],1],I.offset);else if(j.length===3){if(j[2]===1)G=b.ALPHA;else if(j[2]===2)G=b.LUMINANCE_ALPHA;else if(j[2]===3)G=b.RGB;else if(j[2]===4)G=b.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");j[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((G===b.LUMINANCE||G===b.ALPHA)&&(D===b.LUMINANCE||D===b.ALPHA)&&(G=D),G!==D)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ct=I.size,st=R.indexOf(z)<0;if(st&&R.push(z),N===B&&rt)I.offset===0&&I.data.length===ct?st?b.texImage2D(b.TEXTURE_2D,z,D,j[0],j[1],0,D,B,I.data):b.texSubImage2D(b.TEXTURE_2D,z,_,P,j[0],j[1],D,B,I.data):st?b.texImage2D(b.TEXTURE_2D,z,D,j[0],j[1],0,D,B,I.data.subarray(I.offset,I.offset+ct)):b.texSubImage2D(b.TEXTURE_2D,z,_,P,j[0],j[1],D,B,I.data.subarray(I.offset,I.offset+ct));else{var et;B===b.FLOAT?et=o.mallocFloat32(ct):et=o.mallocUint8(ct);var Z=i(et,j,[j[2],j[2]*j[0],1]);N===b.FLOAT&&B===b.UNSIGNED_BYTE?m(Z,I):n.assign(Z,I),st?b.texImage2D(b.TEXTURE_2D,z,D,j[0],j[1],0,D,B,et.subarray(0,ct)):b.texSubImage2D(b.TEXTURE_2D,z,_,P,j[0],j[1],D,B,et.subarray(0,ct)),B===b.FLOAT?o.freeFloat32(et):o.freeUint8(et)}}function k(b){var _=b.createTexture();return b.bindTexture(b.TEXTURE_2D,_),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),_}function M(b,_,P,z,D){var B=b.getParameter(b.MAX_TEXTURE_SIZE);if(_<0||_>B||P<0||P>B)throw new Error("gl-texture2d: Invalid texture shape");if(D===b.FLOAT&&!b.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var R=k(b);return b.texImage2D(b.TEXTURE_2D,0,z,_,P,0,z,D,null),new l(b,R,_,P,z,D)}function T(b,_,P,z,D,B){var R=k(b);return b.texImage2D(b.TEXTURE_2D,0,D,D,B,_),new l(b,R,P,z,D,B)}function c(b,_){var P=_.dtype,z=_.shape.slice(),D=b.getParameter(b.MAX_TEXTURE_SIZE);if(z[0]<0||z[0]>D||z[1]<0||z[1]>D)throw new Error("gl-texture2d: Invalid texture size");var B=y(z,_.stride.slice()),R=0;P==="float32"?R=b.FLOAT:P==="float64"?(R=b.FLOAT,B=!1,P="float32"):P==="uint8"?R=b.UNSIGNED_BYTE:(R=b.UNSIGNED_BYTE,B=!1,P="uint8");var I=0;if(z.length===2)I=b.LUMINANCE,z=[z[0],z[1],1],_=i(_.data,z,[_.stride[0],_.stride[1],1],_.offset);else if(z.length===3)if(z[2]===1)I=b.ALPHA;else if(z[2]===2)I=b.LUMINANCE_ALPHA;else if(z[2]===3)I=b.RGB;else if(z[2]===4)I=b.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");R===b.FLOAT&&!b.getExtension("OES_texture_float")&&(R=b.UNSIGNED_BYTE,B=!1);var F,j,N=_.size;if(B)_.offset===0&&_.data.length===N?F=_.data:F=_.data.subarray(_.offset,_.offset+N);else{var G=[z[2],z[2]*z[0],1];j=o.malloc(N,P);var rt=i(j,z,G,0);(P==="float32"||P==="float64")&&R===b.UNSIGNED_BYTE?m(rt,_):n.assign(rt,_),F=j.subarray(0,N)}var ct=k(b);return b.texImage2D(b.TEXTURE_2D,0,I,z[0],z[1],0,I,R,F),B||o.free(j),new l(b,ct,z[0],z[1],I,R)}function h(b){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||v(b),typeof arguments[1]=="number")return M(b,arguments[1],arguments[2],arguments[3]||b.RGBA,arguments[4]||b.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return M(b,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||b.RGBA,arguments[3]||b.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var _=arguments[1],P=g(_)?_:_.raw;if(P)return T(b,P,_.width|0,_.height|0,arguments[2]||b.RGBA,arguments[3]||b.UNSIGNED_BYTE);if(_.shape&&_.data&&_.stride)return c(b,_)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(t,e,r){var i=r(2931),n=r(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(y,S,k,M){for(var T=y.points,c=y.velocities,h=y.divergences,b=[],_=[],P=[],z=[],D=[],B=[],R=0,I=0,F=n.create(),j=n.create(),N=8,G=0;G0)for(var et=0;etS)return M-1}return M},v=function(y,S,k){return yk?k:y},g=function(y,S,k){var M=S.vectors,T=S.meshgrid,c=y[0],h=y[1],b=y[2],_=T[0].length,P=T[1].length,z=T[2].length,D=f(T[0],c),B=f(T[1],h),R=f(T[2],b),I=D+1,F=B+1,j=R+1;if(D=v(D,0,_-1),I=v(I,0,_-1),B=v(B,0,P-1),F=v(F,0,P-1),R=v(R,0,z-1),j=v(j,0,z-1),D<0||B<0||R<0||I>_-1||F>P-1||j>z-1)return i.create();var N=T[0][D],G=T[0][I],rt=T[1][B],ct=T[1][F],st=T[2][R],et=T[2][j],Z=(c-N)/(G-N),ot=(h-rt)/(ct-rt),X=(b-st)/(et-st);isFinite(Z)||(Z=.5),isFinite(ot)||(ot=.5),isFinite(X)||(X=.5);var Q,ut,J,q,it,nt;switch(k.reversedX&&(D=_-1-D,I=_-1-I),k.reversedY&&(B=P-1-B,F=P-1-F),k.reversedZ&&(R=z-1-R,j=z-1-j),k.filled){case 5:it=R,nt=j,J=B*z,q=F*z,Q=D*z*P,ut=I*z*P;break;case 4:it=R,nt=j,Q=D*z,ut=I*z,J=B*z*_,q=F*z*_;break;case 3:J=B,q=F,it=R*P,nt=j*P,Q=D*P*z,ut=I*P*z;break;case 2:J=B,q=F,Q=D*P,ut=I*P,it=R*P*_,nt=j*P*_;break;case 1:Q=D,ut=I,it=R*_,nt=j*_,J=B*_*z,q=F*_*z;break;default:Q=D,ut=I,J=B*_,q=F*_,it=R*_*P,nt=j*_*P;break}var dt=M[Q+J+it],Tt=M[Q+J+nt],wt=M[Q+q+it],Ct=M[Q+q+nt],It=M[ut+J+it],Nt=M[ut+J+nt],te=M[ut+q+it],Jt=M[ut+q+nt],ee=i.create(),Zt=i.create(),mt=i.create(),bt=i.create();i.lerp(ee,dt,It,Z),i.lerp(Zt,Tt,Nt,Z),i.lerp(mt,wt,te,Z),i.lerp(bt,Ct,Jt,Z);var vt=i.create(),Ut=i.create();i.lerp(vt,ee,mt,ot),i.lerp(Ut,Zt,bt,ot);var re=i.create();return i.lerp(re,vt,Ut,X),re},m=function(y){var S=1/0;y.sort(function(c,h){return c-h});for(var k=y.length,M=1;MI||JtF||eej)},G=i.distance(S[0],S[1]),rt=10*G/M,ct=rt*rt,st=1,et=0,Z=k.length;Z>1&&(st=w(k));for(var ot=0;otet&&(et=dt),it.push(dt),z.push({points:Q,velocities:ut,divergences:it});for(var Tt=0;Ttct&&i.scale(wt,wt,rt/Math.sqrt(Ct)),i.add(wt,wt,X),J=_(wt),i.squaredDistance(q,wt)-ct>-1e-4*ct){Q.push(wt),q=wt,ut.push(J);var nt=P(wt,J),dt=i.length(nt);isFinite(dt)&&dt>et&&(et=dt),it.push(dt)}X=wt}}var It=s(z,y.colormap,et,st);return c?It.tubeScale=c:(et===0&&(et=1),It.tubeScale=T*.5*st/et),It};var l=r(6740),x=r(6405).createMesh;t.exports.createTubeMesh=function(y,S){return x(y,S,{shaders:l,traceType:"streamtube"})}},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(t,e,r){var i=r(6330),n=r(1533),o=r(2651),a=r(6768),s=r(869),f=r(8697);t.exports=v;function v(g,m){if(i(g))return m?f(g,v(m)):[g[0].clone(),g[1].clone()];var w=0,l,x;if(n(g))l=g.clone();else if(typeof g=="string")l=a(g);else{if(g===0)return[o(0),o(1)];if(g===Math.floor(g))l=o(g);else{for(;g!==Math.floor(g);)g=g*Math.pow(2,256),w-=256;l=o(g)}}if(i(m))l.mul(m[1]),x=m[0].clone();else if(n(m))x=m.clone();else if(typeof m=="string")x=a(m);else if(!m)x=o(1);else if(m===Math.floor(m))x=o(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),w+=256;x=o(m)}return w>0?l=l.ushln(w):w<0&&(x=x.ushln(-w)),s(l,x)}},7894:function(t){t.exports=e;function e(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},7932:function(t,e,r){var i=r(620);t.exports=i.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},7960:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2],s=i[3]-r[3];return n*n+o*o+a*a+s*s}},8105:function(t){t.exports=r;var e={"lo===p0":i,"lo=p0)&&!(p1>=hi)":v};function r(g){return e[g]}function i(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h];if(P===S)if(c===_)c+=1,T+=k;else{for(var z=0;k>z;++z){var D=x[M+z];x[M+z]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function n(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h];if(Pz;++z){var D=x[M+z];x[M+z]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function o(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+b];if(P<=S)if(c===_)c+=1,T+=k;else{for(var z=0;k>z;++z){var D=x[M+z];x[M+z]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function a(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+b];if(P<=S)if(c===_)c+=1,T+=k;else{for(var z=0;k>z;++z){var D=x[M+z];x[M+z]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function s(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h],z=x[M+b];if(P<=S&&S<=z)if(c===_)c+=1,T+=k;else{for(var D=0;k>D;++D){var B=x[M+D];x[M+D]=x[T],x[T++]=B}var R=y[_];y[_]=y[c],y[c++]=R}}return c}function f(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h],z=x[M+b];if(PD;++D){var B=x[M+D];x[M+D]=x[T],x[T++]=B}var R=y[_];y[_]=y[c],y[c++]=R}}return c}function v(g,m,w,l,x,y,S,k){for(var M=2*g,T=M*w,c=T,h=w,b=m,_=g+m,P=w;l>P;++P,T+=M){var z=x[T+b],D=x[T+_];if(!(z>=S)&&!(k>=D))if(h===P)h+=1,c+=M;else{for(var B=0;M>B;++B){var R=x[T+B];x[T+B]=x[c],x[c++]=R}var I=y[P];y[P]=y[h],y[h++]=I}}return h}},8107:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.min(i[0],n[0]),r[1]=Math.min(i[1],n[1]),r[2]=Math.min(i[2],n[2]),r}},8116:function(t,e,r){var i=r(7518),n=r(870);function o(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function a(s,f,v,g){var m=s.createVertexArray?new o(s):s.getExtension("OES_vertex_array_object"),w;return m?w=i(s,m):w=n(s),w.update(f,v,g),w}t.exports=a},8192:function(t,e,r){t.exports=a;var i=r(2825),n=r(3536),o=r(244);function a(s,f){var v=i(s[0],s[1],s[2]),g=i(f[0],f[1],f[2]);n(v,v),n(g,g);var m=o(v,g);return m>1?0:Math.acos(m)}},8210:function(t){t.exports=r;function e(i,n){var o=i+n,a=o-i,s=o-a,f=n-a,v=i-s,g=v+f;return g?[g,o]:[o]}function r(i,n){var o=i.length|0,a=n.length|0;if(o===1&&a===1)return e(i[0],n[0]);var s=o+a,f=new Array(s),v=0,g=0,m=0,w=Math.abs,l=i[g],x=w(l),y=n[m],S=w(y),k,M;x=a?(k=l,g+=1,gv)for(var P=f[l],z=1/Math.sqrt(c*b),_=0;_<3;++_){var D=(_+1)%3,B=(_+2)%3;P[_]+=z*(h[D]*T[B]-h[B]*T[D])}}for(var g=0;gv)for(var z=1/Math.sqrt(R),_=0;_<3;++_)P[_]*=z;else for(var _=0;_<3;++_)P[_]=0}return f},e.faceNormals=function(n,o,a){for(var s=n.length,f=new Array(s),v=a===void 0?i:a,g=0;gv?k=1/Math.sqrt(k):k=0;for(var l=0;l<3;++l)S[l]*=k;f[g]=S}return f}},8418:function(t,e,r){var i=r(5219),n=r(2762),o=r(8116),a=r(1888),s=r(6760),f=r(1283),v=r(9366),g=r(5964),m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],w=ArrayBuffer,l=DataView;function x(Q){return w.isView(Q)&&!(Q instanceof l)}function y(Q){return Array.isArray(Q)||x(Q)}t.exports=X;function S(Q,ut){var J=Q[0],q=Q[1],it=Q[2],nt=Q[3];return Q[0]=ut[0]*J+ut[4]*q+ut[8]*it+ut[12]*nt,Q[1]=ut[1]*J+ut[5]*q+ut[9]*it+ut[13]*nt,Q[2]=ut[2]*J+ut[6]*q+ut[10]*it+ut[14]*nt,Q[3]=ut[3]*J+ut[7]*q+ut[11]*it+ut[15]*nt,Q}function k(Q,ut,J,q){return S(q,q),S(q,q),S(q,q)}function M(Q,ut){this.index=Q,this.dataCoordinate=this.position=ut}function T(Q){return Q===!0||Q>1?1:Q}function c(Q,ut,J,q,it,nt,dt,Tt,wt,Ct,It,Nt){this.gl=Q,this.pixelRatio=1,this.shader=ut,this.orthoShader=J,this.projectShader=q,this.pointBuffer=it,this.colorBuffer=nt,this.glyphBuffer=dt,this.idBuffer=Tt,this.vao=wt,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ct,this.pickOrthoShader=It,this.pickProjectShader=Nt,this.points=[],this._selectResult=new M(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var h=c.prototype;h.pickSlots=1,h.setPickBase=function(Q){this.pickId=Q},h.isTransparent=function(){if(this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&this.projectHasAlpha)return!0;return!1},h.isOpaque=function(){if(!this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&!this.projectHasAlpha)return!0;return!1};var b=[0,0],_=[0,0,0],P=[0,0,0],z=[0,0,0,1],D=[0,0,0,1],B=m.slice(),R=[0,0,0],I=[[0,0,0],[0,0,0]];function F(Q){return Q[0]=Q[1]=Q[2]=0,Q}function j(Q,ut){return Q[0]=ut[0],Q[1]=ut[1],Q[2]=ut[2],Q[3]=1,Q}function N(Q,ut,J,q){return Q[0]=ut[0],Q[1]=ut[1],Q[2]=ut[2],Q[J]=q,Q}function G(Q){for(var ut=I,J=0;J<2;++J)for(var q=0;q<3;++q)ut[J][q]=Math.max(Math.min(Q[J][q],1e8),-1e8);return ut}function rt(Q,ut,J,q){var it=ut.axesProject,nt=ut.gl,dt=Q.uniforms,Tt=J.model||m,wt=J.view||m,Ct=J.projection||m,It=ut.axesBounds,Nt=G(ut.clipBounds),te;ut.axes&&ut.axes.lastCubeProps?te=ut.axes.lastCubeProps.axis:te=[1,1,1],b[0]=2/nt.drawingBufferWidth,b[1]=2/nt.drawingBufferHeight,Q.bind(),dt.view=wt,dt.projection=Ct,dt.screenSize=b,dt.highlightId=ut.highlightId,dt.highlightScale=ut.highlightScale,dt.clipBounds=Nt,dt.pickGroup=ut.pickId/255,dt.pixelRatio=q;for(var Jt=0;Jt<3;++Jt)if(it[Jt]){dt.scale=ut.projectScale[Jt],dt.opacity=ut.projectOpacity[Jt];for(var ee=B,Zt=0;Zt<16;++Zt)ee[Zt]=0;for(var Zt=0;Zt<4;++Zt)ee[5*Zt]=1;ee[5*Jt]=0,te[Jt]<0?ee[12+Jt]=It[0][Jt]:ee[12+Jt]=It[1][Jt],s(ee,Tt,ee),dt.model=ee;var mt=(Jt+1)%3,bt=(Jt+2)%3,vt=F(_),Ut=F(P);vt[mt]=1,Ut[bt]=1;var re=k(Ct,wt,Tt,j(z,vt)),Kt=k(Ct,wt,Tt,j(D,Ut));if(Math.abs(re[1])>Math.abs(Kt[1])){var ue=re;re=Kt,Kt=ue,ue=vt,vt=Ut,Ut=ue;var Me=mt;mt=bt,bt=Me}re[0]<0&&(vt[mt]=-1),Kt[1]>0&&(Ut[bt]=-1);for(var Ce=0,We=0,Zt=0;Zt<4;++Zt)Ce+=Math.pow(Tt[4*mt+Zt],2),We+=Math.pow(Tt[4*bt+Zt],2);vt[mt]/=Math.sqrt(Ce),Ut[bt]/=Math.sqrt(We),dt.axes[0]=vt,dt.axes[1]=Ut,dt.fragClipBounds[0]=N(R,Nt[0],Jt,-1e8),dt.fragClipBounds[1]=N(R,Nt[1],Jt,1e8),ut.vao.bind(),ut.vao.draw(nt.TRIANGLES,ut.vertexCount),ut.lineWidth>0&&(nt.lineWidth(ut.lineWidth*q),ut.vao.draw(nt.LINES,ut.lineVertexCount,ut.vertexCount)),ut.vao.unbind()}}var ct=[-1e8,-1e8,-1e8],st=[1e8,1e8,1e8],et=[ct,st];function Z(Q,ut,J,q,it,nt,dt){var Tt=J.gl;if((nt===J.projectHasAlpha||dt)&&rt(ut,J,q,it),nt===J.hasAlpha||dt){Q.bind();var wt=Q.uniforms;wt.model=q.model||m,wt.view=q.view||m,wt.projection=q.projection||m,b[0]=2/Tt.drawingBufferWidth,b[1]=2/Tt.drawingBufferHeight,wt.screenSize=b,wt.highlightId=J.highlightId,wt.highlightScale=J.highlightScale,wt.fragClipBounds=et,wt.clipBounds=J.axes.bounds,wt.opacity=J.opacity,wt.pickGroup=J.pickId/255,wt.pixelRatio=it,J.vao.bind(),J.vao.draw(Tt.TRIANGLES,J.vertexCount),J.lineWidth>0&&(Tt.lineWidth(J.lineWidth*it),J.vao.draw(Tt.LINES,J.lineVertexCount,J.vertexCount)),J.vao.unbind()}}h.draw=function(Q){var ut=this.useOrtho?this.orthoShader:this.shader;Z(ut,this.projectShader,this,Q,this.pixelRatio,!1,!1)},h.drawTransparent=function(Q){var ut=this.useOrtho?this.orthoShader:this.shader;Z(ut,this.projectShader,this,Q,this.pixelRatio,!0,!1)},h.drawPick=function(Q){var ut=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;Z(ut,this.pickProjectShader,this,Q,1,!0,!0)},h.pick=function(Q){if(!Q||Q.id!==this.pickId)return null;var ut=Q.value[2]+(Q.value[1]<<8)+(Q.value[0]<<16);if(ut>=this.pointCount||ut<0)return null;var J=this.points[ut],q=this._selectResult;q.index=ut;for(var it=0;it<3;++it)q.position[it]=q.dataCoordinate[it]=J[it];return q},h.highlight=function(Q){if(!Q)this.highlightId=[1,1,1,1];else{var ut=Q.index,J=ut&255,q=ut>>8&255,it=ut>>16&255;this.highlightId=[J/255,q/255,it/255,0]}};function ot(Q,ut,J,q){var it;y(Q)?ut0){var Ir=0,de=bt,Dt=[0,0,0,1],qt=[0,0,0,1],_t=y(te)&&y(te[0]),lt=y(Zt)&&y(Zt[0]);t:for(var q=0;q0?1-We[0][0]:Ee<0?1+We[1][0]:1,Ue*=Ue>0?1-We[0][1]:Ue<0?1+We[1][1]:1;for(var ir=[Ee,Ue],ar=Me.cells||[],Ye=Me.positions||[],Kt=0;Kt=a?(k=l,g+=1,g0?1:0}},8648:function(t,e,r){t.exports=r(783)},8692:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[1],f=i[0]-a,v=i[1]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=a+f*m-v*g,r[1]=s+f*g+v*m,r[2]=i[2],r}},8697:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[1]),o[1].mul(a[0]))}},8731:function(t,e,r){t.exports=v;var i=r(8866);function n(g,m,w,l,x,y){this._gl=g,this._wrapper=m,this._index=w,this._locations=l,this._dimension=x,this._constFunc=y}var o=n.prototype;o.pointer=function(g,m,w,l){var x=this,y=x._gl,S=x._locations[x._index];y.vertexAttribPointer(S,x._dimension,g||y.FLOAT,!!m,w||0,l||0),y.enableVertexAttribArray(S)},o.set=function(g,m,w,l){return this._constFunc(this._locations[this._index],g,m,w,l)},Object.defineProperty(o,"location",{get:function(){return this._locations[this._index]},set:function(g){return g!==this._locations[this._index]&&(this._locations[this._index]=g|0,this._wrapper.program=null),g|0}});var a=[function(g,m,w){return w.length===void 0?g.vertexAttrib1f(m,w):g.vertexAttrib1fv(m,w)},function(g,m,w,l){return w.length===void 0?g.vertexAttrib2f(m,w,l):g.vertexAttrib2fv(m,w)},function(g,m,w,l,x){return w.length===void 0?g.vertexAttrib3f(m,w,l,x):g.vertexAttrib3fv(m,w)},function(g,m,w,l,x,y){return w.length===void 0?g.vertexAttrib4f(m,w,l,x,y):g.vertexAttrib4fv(m,w)}];function s(g,m,w,l,x,y,S){var k=a[x],M=new n(g,m,w,l,x,k);Object.defineProperty(y,S,{set:function(T){return g.disableVertexAttribArray(l[w]),k(g,l[w],T),T},get:function(){return M},enumerable:!0})}function f(g,m,w,l,x,y,S){for(var k=new Array(x),M=new Array(x),T=0;T=0){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new i("","Invalid data type for attribute "+M+": "+T);s(g,m,c[0],l,h,x,M)}else if(T.indexOf("mat")>=0){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new i("","Invalid data type for attribute "+M+": "+T);f(g,m,c,l,h,x,M)}else throw new i("","Unknown data type for attribute "+M+": "+T);break}}return x}},8828:function(t,e){"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<0)-(o<0)},e.abs=function(o){var a=o>>r-1;return(o^a)-a},e.min=function(o,a){return a^(o^a)&-(o65535)<<4,o>>>=a,s=(o>255)<<3,o>>>=s,a|=s,s=(o>15)<<2,o>>>=s,a|=s,s=(o>3)<<1,o>>>=s,a|=s,a|o>>1},e.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},e.popCount=function(o){return o=o-(o>>>1&1431655765),o=(o&858993459)+(o>>>2&858993459),(o+(o>>>4)&252645135)*16843009>>>24};function i(o){var a=32;return o&=-o,o&&a--,o&65535&&(a-=16),o&16711935&&(a-=8),o&252645135&&(a-=4),o&858993459&&(a-=2),o&1431655765&&(a-=1),a}e.countTrailingZeros=i,e.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o+1},e.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o-(o>>>1)},e.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,o&=15,27030>>>o&1};var n=new Array(256);(function(o){for(var a=0;a<256;++a){var s=a,f=a,v=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--v;o[a]=f<>>8&255]<<16|n[o>>>16&255]<<8|n[o>>>24&255]},e.interleave2=function(o,a){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o|a<<1},e.deinterleave2=function(o,a){return o=o>>>a&1431655765,o=(o|o>>>1)&858993459,o=(o|o>>>2)&252645135,o=(o|o>>>4)&16711935,o=(o|o>>>16)&65535,o<<16>>16},e.interleave3=function(o,a,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o|s<<2},e.deinterleave3=function(o,a){return o=o>>>a&1227133513,o=(o|o>>>2)&3272356035,o=(o|o>>>4)&251719695,o=(o|o>>>8)&4278190335,o=(o|o>>>16)&1023,o<<22>>22},e.nextCombination=function(o){var a=o|o-1;return a+1|(~a&-~a)-1>>>i(o)+1}},8866:function(t){function e(r,i,n){this.shortMessage=i||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(i||r||"")+(n?` -`+n:""),this.stack=new Error().stack}e.prototype=new Error,e.prototype.name="GLError",e.prototype.constructor=e,t.exports=e},8902:function(t,e,r){var i=r(2478),n=r(3250)[3],o=0,a=1,s=2;t.exports=S;function f(k,M,T,c,h){this.a=k,this.b=M,this.idx=T,this.lowerIds=c,this.upperIds=h}function v(k,M,T,c){this.a=k,this.b=M,this.type=T,this.idx=c}function g(k,M){var T=k.a[0]-M.a[0]||k.a[1]-M.a[1]||k.type-M.type;return T||k.type!==o&&(T=n(k.a,k.b,M.b),T)?T:k.idx-M.idx}function m(k,M){return n(k.a,k.b,M)}function w(k,M,T,c,h){for(var b=i.lt(M,c,m),_=i.gt(M,c,m),P=b;P<_;++P){for(var z=M[P],D=z.lowerIds,B=D.length;B>1&&n(T[D[B-2]],T[D[B-1]],c)>0;)k.push([D[B-1],D[B-2],h]),B-=1;D.length=B,D.push(h);for(var R=z.upperIds,B=R.length;B>1&&n(T[R[B-2]],T[R[B-1]],c)<0;)k.push([R[B-2],R[B-1],h]),B-=1;R.length=B,R.push(h)}}function l(k,M){var T;return k.a[0]z[0]&&h.push(new v(z,P,s,b),new v(P,z,a,b))}h.sort(g);for(var D=h[0].a[0]-(1+Math.abs(h[0].a[0]))*Math.pow(2,-52),B=[new f([D,1],[D,0],-1,[],[])],R=[],b=0,I=h.length;b0;){x=c.pop();for(var h=x.adjacent,b=0;b<=S;++b){var _=h[b];if(!(!_.boundary||_.lastVisited<=-k)){for(var P=_.vertices,z=0;z<=S;++z){var D=P[z];D<0?M[z]=y:M[z]=T[D]}var B=this.orient();if(B>0)return _;_.lastVisited=-k,B===0&&c.push(_)}}}return null},w.walk=function(x,y){var S=this.vertices.length-1,k=this.dimension,M=this.vertices,T=this.tuple,c=y?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[c];t:for(;!h.boundary;){for(var b=h.vertices,_=h.adjacent,P=0;P<=k;++P)T[P]=M[b[P]];h.lastVisited=S;for(var P=0;P<=k;++P){var z=_[P];if(!(z.lastVisited>=S)){var D=T[P];T[P]=x;var B=this.orient();if(T[P]=D,B<0){h=z;continue t}else z.boundary?z.lastVisited=-S:z.lastVisited=S}}return}return h},w.addPeaks=function(x,y){var S=this.vertices.length-1,k=this.dimension,M=this.vertices,T=this.tuple,c=this.interior,h=this.simplices,b=[y];y.lastVisited=S,y.vertices[y.vertices.indexOf(-1)]=S,y.boundary=!1,c.push(y);for(var _=[];b.length>0;){var y=b.pop(),P=y.vertices,z=y.adjacent,D=P.indexOf(S);if(!(D<0)){for(var B=0;B<=k;++B)if(B!==D){var R=z[B];if(!(!R.boundary||R.lastVisited>=S)){var I=R.vertices;if(R.lastVisited!==-S){for(var F=0,j=0;j<=k;++j)I[j]<0?(F=j,T[j]=x):T[j]=M[I[j]];var N=this.orient();if(N>0){I[F]=S,R.boundary=!1,c.push(R),b.push(R),R.lastVisited=S;continue}else R.lastVisited=-S}var G=R.adjacent,rt=P.slice(),ct=z.slice(),st=new o(rt,ct,!0);h.push(st);var et=G.indexOf(y);if(!(et<0)){G[et]=st,ct[D]=R,rt[B]=-1,ct[B]=y,z[B]=st,st.flip();for(var j=0;j<=k;++j){var Z=rt[j];if(!(Z<0||Z===S)){for(var ot=new Array(k-1),X=0,Q=0;Q<=k;++Q){var ut=rt[Q];ut<0||Q===j||(ot[X++]=ut)}_.push(new a(ot,st,j))}}}}}}}_.sort(s);for(var B=0;B+1<_.length;B+=2){var J=_[B],q=_[B+1],it=J.index,nt=q.index;it<0||nt<0||(J.cell.adjacent[J.index]=q.cell,q.cell.adjacent[q.index]=J.cell)}},w.insert=function(x,y){var S=this.vertices;S.push(x);var k=this.walk(x,y);if(k){for(var M=this.dimension,T=this.tuple,c=0;c<=M;++c){var h=k.vertices[c];h<0?T[c]=x:T[c]=S[h]}var b=this.orient(T);b<0||b===0&&(k=this.handleBoundaryDegeneracy(k,x),!k)||this.addPeaks(x,k)}},w.boundary=function(){for(var x=this.dimension,y=[],S=this.simplices,k=S.length,M=0;M=0?c[b++]=h[P]:_=P&1;if(_===(x&1)){var z=c[0];c[0]=c[1],c[1]=z}y.push(c)}}return y};function l(x,y){var S=x.length;if(S===0)throw new Error("Must have at least d+1 points");var k=x[0].length;if(S<=k)throw new Error("Must input at least d+1 points");var M=x.slice(0,k+1),T=i.apply(void 0,M);if(T===0)throw new Error("Input not in general position");for(var c=new Array(k+1),h=0;h<=k;++h)c[h]=h;T<0&&(c[0]=1,c[1]=0);for(var b=new o(c,new Array(k+1),!1),_=b.adjacent,P=new Array(k+2),h=0;h<=k;++h){for(var z=c.slice(),D=0;D<=k;++D)D===h&&(z[D]=-1);var B=z[0];z[0]=z[1],z[1]=B;var R=new o(z,new Array(k+1),!0);_[h]=R,P[h]=R}P[k+1]=b;for(var h=0;h<=k;++h)for(var z=_[h].vertices,I=_[h].adjacent,D=0;D<=k;++D){var F=z[D];if(F<0){I[D]=b;continue}for(var j=0;j<=k;++j)_[j].vertices.indexOf(F)<0&&(I[D]=_[j])}for(var N=new m(k,M,P),G=!!y,h=k+1;h=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(T){this.pickId=T};function x(T){for(var c=g({colormap:T,nshades:256,format:"rgba"}),h=new Uint8Array(1024),b=0;b<256;++b){for(var _=c[b],P=0;P<3;++P)h[4*b+P]=_[P];h[4*b+3]=_[3]*255}return v(h,[256,256,4],[4,0,1])}function y(T){for(var c=T.length,h=new Array(c),b=0;b0){var j=this.triShader;j.bind(),j.uniforms=D,this.triangleVAO.bind(),c.drawArrays(c.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(T){T=T||{};for(var c=this.gl,h=T.model||m,b=T.view||m,_=T.projection||m,P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],z=0;z<3;++z)P[0][z]=Math.max(P[0][z],this.clipBounds[0][z]),P[1][z]=Math.min(P[1][z],this.clipBounds[1][z]);this._model=[].slice.call(h),this._view=[].slice.call(b),this._projection=[].slice.call(_),this._resolution=[c.drawingBufferWidth,c.drawingBufferHeight];var D={model:h,view:b,projection:_,clipBounds:P,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},B=this.pickShader;B.bind(),B.uniforms=D,this.triangleCount>0&&(this.triangleVAO.bind(),c.drawArrays(c.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(T){if(!T||T.id!==this.pickId)return null;var c=T.value[0]+256*T.value[1]+65536*T.value[2],h=this.cells[c],b=this.positions[h[1]].slice(0,3),_={position:b,dataCoordinate:b,index:Math.floor(h[1]/48)};return this.traceType==="cone"?_.index=Math.floor(h[1]/48):this.traceType==="streamtube"&&(_.intensity=this.intensity[h[1]],_.velocity=this.vectors[h[1]].slice(0,3),_.divergence=this.vectors[h[1]][3],_.index=c),_},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function S(T,c){var h=i(T,c.meshShader.vertex,c.meshShader.fragment,null,c.meshShader.attributes);return h.attributes.position.location=0,h.attributes.color.location=2,h.attributes.uv.location=3,h.attributes.vector.location=4,h}function k(T,c){var h=i(T,c.pickShader.vertex,c.pickShader.fragment,null,c.pickShader.attributes);return h.attributes.position.location=0,h.attributes.id.location=1,h.attributes.vector.location=4,h}function M(T,c,h){var b=h.shaders;arguments.length===1&&(c=T,T=c.gl);var _=S(T,b),P=k(T,b),z=a(T,v(new Uint8Array([255,255,255,255]),[1,1,4]));z.generateMipmap(),z.minFilter=T.LINEAR_MIPMAP_LINEAR,z.magFilter=T.LINEAR;var D=n(T),B=n(T),R=n(T),I=n(T),F=n(T),j=o(T,[{buffer:D,type:T.FLOAT,size:4},{buffer:F,type:T.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:R,type:T.FLOAT,size:4},{buffer:I,type:T.FLOAT,size:2},{buffer:B,type:T.FLOAT,size:4}]),N=new w(T,z,_,P,D,B,F,R,I,j,h.traceType||"cone");return N.update(c),N}t.exports=M},9127:function(t,e,r){t.exports=o;var i=r(6204),n=r(5771);function o(a){return n(i(a))}},9131:function(t,e,r){var i=r(5177),n=r(9288);t.exports=o;function o(a,s){return s=s||1,a[0]=Math.random(),a[1]=Math.random(),a[2]=Math.random(),a[3]=Math.random(),i(a,a),n(a,a,s),a}},9165:function(t,e,r){t.exports=w;var i=r(2762),n=r(8116),o=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,x,y,S){this.gl=l,this.shader=S,this.buffer=x,this.vao=y,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var f=s.prototype;f.isOpaque=function(){return!this.hasAlpha},f.isTransparent=function(){return this.hasAlpha},f.drawTransparent=f.draw=function(l){var x=this.gl,y=this.shader.uniforms;this.shader.bind();var S=y.view=l.view||a,k=y.projection=l.projection||a;y.model=l.model||a,y.clipBounds=this.clipBounds,y.opacity=this.opacity;var M=S[12],T=S[13],c=S[14],h=S[15],b=l._ortho||!1,_=b?2:1,P=_*this.pixelRatio*(k[3]*M+k[7]*T+k[11]*c+k[15]*h)/x.drawingBufferHeight;this.vao.bind();for(var z=0;z<3;++z)x.lineWidth(this.lineWidth[z]*this.pixelRatio),y.capSize=this.capSize[z]*P,this.lineCount[z]&&x.drawArrays(x.LINES,this.lineOffset[z],this.lineCount[z]);this.vao.unbind()};function v(l,x){for(var y=0;y<3;++y)l[0][y]=Math.min(l[0][y],x[y]),l[1][y]=Math.max(l[1][y],x[y])}var g=(function(){for(var l=new Array(3),x=0;x<3;++x){for(var y=[],S=1;S<=2;++S)for(var k=-1;k<=1;k+=2){var M=(S+x)%3,T=[0,0,0];T[M]=k,y.push(T)}l[x]=y}return l})();function m(l,x,y,S){for(var k=g[S],M=0;M0){var D=b.slice();D[c]+=P[1][c],k.push(b[0],b[1],b[2],z[0],z[1],z[2],z[3],0,0,0,D[0],D[1],D[2],z[0],z[1],z[2],z[3],0,0,0),v(this.bounds,D),T+=2+m(k,D,z,c)}}}this.lineCount[c]=T-this.lineOffset[c]}this.buffer.update(k)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function w(l){var x=l.gl,y=i(x),S=n(x,[{buffer:y,type:x.FLOAT,size:3,offset:0,stride:40},{buffer:y,type:x.FLOAT,size:4,offset:12,stride:40},{buffer:y,type:x.FLOAT,size:3,offset:28,stride:40}]),k=o(x);k.attributes.position.location=0,k.attributes.color.location=1,k.attributes.offset.location=2;var M=new s(x,y,S,k);return M.update(l),M}},9215:function(t,e,r){t.exports=v;var i=r(4769),n=r(2478);function o(g,m,w){return Math.min(m,Math.max(g,w))}function a(g,m,w){this.dimension=g.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=w-1)for(var T=y.length-1,h=g-m[w-1],c=0;c=w-1)for(var M=y.length-1,T=g-m[w-1],c=0;c=0;--w)if(g[--m])return!1;return!0},s.jump=function(g){var m=this.lastT(),w=this.dimension;if(!(g0;--c)l.push(o(k[c-1],M[c-1],arguments[c])),x.push(0)}},s.push=function(g){var m=this.lastT(),w=this.dimension;if(!(g1e-6?1/S:0;this._time.push(g);for(var h=w;h>0;--h){var b=o(M[h-1],T[h-1],arguments[h]);l.push(b),x.push((b-l[y++])*c)}}},s.set=function(g){var m=this.dimension;if(!(g0;--k)w.push(o(y[k-1],S[k-1],arguments[k])),l.push(0)}},s.move=function(g){var m=this.lastT(),w=this.dimension;if(!(g<=m||arguments.length!==w+1)){var l=this._state,x=this._velocity,y=l.length-this.dimension,S=this.bounds,k=S[0],M=S[1],T=g-m,c=T>1e-6?1/T:0;this._time.push(g);for(var h=w;h>0;--h){var b=arguments[h];l.push(o(k[h-1],M[h-1],l[y++]+b)),x.push(b*c)}}},s.idle=function(g){var m=this.lastT();if(!(g=0;--c)l.push(o(k[c],M[c],l[y]+T*x[y])),x.push(0),y+=1}};function f(g){for(var m=new Array(g),w=0;w1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(s=!0),s}},9226:function(t){t.exports=e;function e(r,i){return r[0]=Math.ceil(i[0]),r[1]=Math.ceil(i[1]),r[2]=Math.ceil(i[2]),r}},9265:function(t){t.exports=e;function e(r,i){return r[0]===i[0]&&r[1]===i[1]&&r[2]===i[2]}},9288:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=i[3]*n,r}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),i=new Float64Array(4);function n(o,a,s,f,v){e.length=m?(h=1,_=m+2*x+S):(h=-x/m,_=x*h+S)):(h=0,y>=0?(b=0,_=S):-y>=l?(b=1,_=l+2*y+S):(b=-y/l,_=y*b+S));else if(b<0)b=0,x>=0?(h=0,_=S):-x>=m?(h=1,_=m+2*x+S):(h=-x/m,_=x*h+S);else{var P=1/c;h*=P,b*=P,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S}else{var z,D,B,R;h<0?(z=w+x,D=l+y,D>z?(B=D-z,R=m-2*w+l,B>=R?(h=1,b=0,_=m+2*x+S):(h=B/R,b=1-h,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)):(h=0,D<=0?(b=1,_=l+2*y+S):y>=0?(b=0,_=S):(b=-y/l,_=y*b+S))):b<0?(z=w+y,D=m+x,D>z?(B=D-z,R=m-2*w+l,B>=R?(b=1,h=0,_=l+2*y+S):(b=B/R,h=1-b,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)):(b=0,D<=0?(h=1,_=m+2*x+S):x>=0?(h=0,_=S):(h=-x/m,_=x*h+S))):(B=l+y-w-x,B<=0?(h=0,b=1,_=l+2*y+S):(R=m-2*w+l,B>=R?(h=1,b=0,_=m+2*x+S):(h=B/R,b=1-h,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)))}for(var I=1-h-b,g=0;gy)for(l=y;lx)for(l=x;l=0){for(var I=R.type.charAt(R.type.length-1)|0,F=new Array(I),j=0;j=0;)N+=1;D[B]=N}var G=new Array(y.length);function rt(){M.program=a.program(T,M._vref,M._fref,z,D);for(var ct=0;ctJ&&it>0){var nt=(q[it][0]-J)/(q[it][0]-q[it-1][0]);return q[it][1]*(1-nt)+nt*q[it-1][1]}}return 1}var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[_.slice(),_.slice(),_.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function G(J,q){var it,nt,dt,Tt=q.axes&&q.axes.lastCubeProps.axis||j,wt=q.showSurface,Ct=q.showContour;for(it=0;it<3;++it)for(wt=wt||q.surfaceProject[it],nt=0;nt<3;++nt)Ct=Ct||q.contourProject[it][nt];for(it=0;it<3;++it){var It=N.projections[it];for(nt=0;nt<16;++nt)It[nt]=0;for(nt=0;nt<4;++nt)It[5*nt]=1;It[5*it]=0,It[12+it]=q.axesBounds[+(Tt[it]>0)][it],l(It,J.model,It);var Nt=N.clipBounds[it];for(dt=0;dt<2;++dt)for(nt=0;nt<3;++nt)Nt[dt][nt]=J.clipBounds[dt][nt];Nt[0][it]=-1e8,Nt[1][it]=1e8}return N.showSurface=wt,N.showContour=Ct,N}var rt={model:_,view:_,projection:_,inverseModel:_.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},ct=_.slice(),st=[1,0,0,0,1,0,0,0,1];function et(J,q){J=J||{};var it=this.gl;it.disable(it.CULL_FACE),this._colorMap.bind(0);var nt=rt;nt.model=J.model||_,nt.view=J.view||_,nt.projection=J.projection||_,nt.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],nt.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],nt.objectOffset=this.objectOffset,nt.contourColor=this.contourColor[0],nt.inverseModel=x(nt.inverseModel,nt.model);for(var dt=0;dt<2;++dt)for(var Tt=nt.clipBounds[dt],wt=0;wt<3;++wt)Tt[wt]=Math.min(Math.max(this.clipBounds[dt][wt],-1e8),1e8);nt.kambient=this.ambientLight,nt.kdiffuse=this.diffuseLight,nt.kspecular=this.specularLight,nt.roughness=this.roughness,nt.fresnel=this.fresnel,nt.opacity=this.opacity,nt.height=0,nt.permutation=st,nt.vertexColor=this.vertexColor;var Ct=ct;for(l(Ct,nt.view,nt.model),l(Ct,nt.projection,Ct),x(Ct,Ct),dt=0;dt<3;++dt)nt.eyePosition[dt]=Ct[12+dt]/Ct[15];var It=Ct[15];for(dt=0;dt<3;++dt)It+=this.lightPosition[dt]*Ct[4*dt+3];for(dt=0;dt<3;++dt){var Nt=Ct[12+dt];for(wt=0;wt<3;++wt)Nt+=Ct[4*wt+dt]*this.lightPosition[wt];nt.lightPosition[dt]=Nt/It}var te=G(nt,this);if(te.showSurface){for(this._shader.bind(),this._shader.uniforms=nt,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(it.TRIANGLES,this._vertexCount),dt=0;dt<3;++dt)!this.surfaceProject[dt]||!this.vertexCount||(this._shader.uniforms.model=te.projections[dt],this._shader.uniforms.clipBounds=te.clipBounds[dt],this._vao.draw(it.TRIANGLES,this._vertexCount));this._vao.unbind()}if(te.showContour){var Jt=this._contourShader;nt.kambient=1,nt.kdiffuse=0,nt.kspecular=0,nt.opacity=1,Jt.bind(),Jt.uniforms=nt;var ee=this._contourVAO;for(ee.bind(),dt=0;dt<3;++dt)for(Jt.uniforms.permutation=z[dt],it.lineWidth(this.contourWidth[dt]*this.pixelRatio),wt=0;wt>4)/16)/255,dt=Math.floor(nt),Tt=nt-dt,wt=q[1]*(J.value[1]+(J.value[2]&15)/16)/255,Ct=Math.floor(wt),It=wt-Ct;dt+=1,Ct+=1;var Nt=it.position;Nt[0]=Nt[1]=Nt[2]=0;for(var te=0;te<2;++te)for(var Jt=te?Tt:1-Tt,ee=0;ee<2;++ee)for(var Zt=ee?It:1-It,mt=dt+te,bt=Ct+ee,vt=Jt*Zt,Ut=0;Ut<3;++Ut)Nt[Ut]+=this._field[Ut].get(mt,bt)*vt;for(var re=this._pickResult.level,Kt=0;Kt<3;++Kt)if(re[Kt]=y.le(this.contourLevels[Kt],Nt[Kt]),re[Kt]<0)this.contourLevels[Kt].length>0&&(re[Kt]=0);else if(re[Kt]Math.abs(Me-Nt[Kt])&&(re[Kt]+=1)}for(it.index[0]=Tt<.5?dt:dt+1,it.index[1]=It<.5?Ct:Ct+1,it.uv[0]=nt/q[0],it.uv[1]=wt/q[1],Ut=0;Ut<3;++Ut)it.dataCoordinate[Ut]=this._field[Ut].get(it.index[0],it.index[1]);return it},I.padField=function(J,q){var it=q.shape.slice(),nt=J.shape.slice();v.assign(J.lo(1,1).hi(it[0],it[1]),q),v.assign(J.lo(1).hi(it[0],1),q.hi(it[0],1)),v.assign(J.lo(1,nt[1]-1).hi(it[0],1),q.lo(0,it[1]-1).hi(it[0],1)),v.assign(J.lo(0,1).hi(1,it[1]),q.hi(1)),v.assign(J.lo(nt[0]-1,1).hi(1,it[1]),q.lo(it[0]-1)),J.set(0,0,q.get(0,0)),J.set(0,nt[1]-1,q.get(0,it[1]-1)),J.set(nt[0]-1,0,q.get(it[0]-1,0)),J.set(nt[0]-1,nt[1]-1,q.get(it[0]-1,it[1]-1))};function ot(J,q){return Array.isArray(J)?[q(J[0]),q(J[1]),q(J[2])]:[q(J),q(J),q(J)]}function X(J){return Array.isArray(J)?J.length===3?[J[0],J[1],J[2],1]:[J[0],J[1],J[2],J[3]]:[0,0,0,1]}function Q(J){if(Array.isArray(J)){if(Array.isArray(J))return[X(J[0]),X(J[1]),X(J[2])];var q=X(J);return[q.slice(),q.slice(),q.slice()]}}I.update=function(J){J=J||{},this.objectOffset=J.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in J&&(this.contourWidth=ot(J.contourWidth,Number)),"showContour"in J&&(this.showContour=ot(J.showContour,Boolean)),"showSurface"in J&&(this.showSurface=!!J.showSurface),"contourTint"in J&&(this.contourTint=ot(J.contourTint,Boolean)),"contourColor"in J&&(this.contourColor=Q(J.contourColor)),"contourProject"in J&&(this.contourProject=ot(J.contourProject,function(ia){return ot(ia,Boolean)})),"surfaceProject"in J&&(this.surfaceProject=J.surfaceProject),"dynamicColor"in J&&(this.dynamicColor=Q(J.dynamicColor)),"dynamicTint"in J&&(this.dynamicTint=ot(J.dynamicTint,Number)),"dynamicWidth"in J&&(this.dynamicWidth=ot(J.dynamicWidth,Number)),"opacity"in J&&(this.opacity=J.opacity),"opacityscale"in J&&(this.opacityscale=J.opacityscale),"colorBounds"in J&&(this.colorBounds=J.colorBounds),"vertexColor"in J&&(this.vertexColor=J.vertexColor?1:0),"colormap"in J&&this._colorMap.setPixels(this.genColormap(J.colormap,this.opacityscale));var q=J.field||J.coords&&J.coords[2]||null,it=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in J||"coords"in J){var nt=(q.shape[0]+2)*(q.shape[1]+2);nt>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(i.nextPow2(nt))),this._field[2]=m(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var dt=this.shape,Tt=0;Tt<2;++Tt)this._field[2].size>this._field[Tt].data.length&&(s.freeFloat(this._field[Tt].data),this._field[Tt].data=s.mallocFloat(this._field[2].size)),this._field[Tt]=m(this._field[Tt].data,[dt[0]+2,dt[1]+2]);if(J.coords){var wt=J.coords;if(!Array.isArray(wt)||wt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Tt=0;Tt<2;++Tt){var Ct=wt[Tt];for(ee=0;ee<2;++ee)if(Ct.shape[ee]!==dt[ee])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Tt],Ct)}}else if(J.ticks){var It=J.ticks;if(!Array.isArray(It)||It.length!==2)throw new Error("gl-surface: invalid ticks");for(Tt=0;Tt<2;++Tt){var Nt=It[Tt];if((Array.isArray(Nt)||Nt.length)&&(Nt=m(Nt)),Nt.shape[0]!==dt[Tt])throw new Error("gl-surface: invalid tick length");var te=m(Nt.data,dt);te.stride[Tt]=Nt.stride[0],te.stride[Tt^1]=0,this.padField(this._field[Tt],te)}}else{for(Tt=0;Tt<2;++Tt){var Jt=[0,0];Jt[Tt]=1,this._field[Tt]=m(this._field[Tt].data,[dt[0]+2,dt[1]+2],Jt,0)}this._field[0].set(0,0,0);for(var ee=0;ee0){for(var Kn=0;Kn<5;++Kn)ar.pop();_t-=1}continue t}}}dn.push(_t)}this._contourOffsets[Ye]=pn,this._contourCounts[Ye]=dn}var $n=s.mallocFloat(ar.length);for(Tt=0;Tt=0&&(T=k|0,M+=h*T,c-=T),new y(this.data,c,h,M)},S.step=function(k){var M=this.shape[0],T=this.stride[0],c=this.offset,h=0,b=Math.ceil;return typeof k=="number"&&(h=k|0,h<0?(c+=T*(M-1),M=b(-M/h)):M=b(M/h),T*=h),new y(this.data,M,T,c)},S.transpose=function(k){k=k===void 0?0:k|0;var M=this.shape,T=this.stride;return new y(this.data,M[k],T[k],this.offset)},S.pick=function(k){var M=[],T=[],c=this.offset;typeof k=="number"&&k>=0?c=c+this.stride[0]*k|0:(M.push(this.shape[0]),T.push(this.stride[0]));var h=l[M.length+1];return h(this.data,M,T,c)},function(k,M,T,c){return new y(k,M[0],T[0],c)}},2:function(w,l,x){function y(k,M,T,c,h,b){this.data=k,this.shape=[M,T],this.stride=[c,h],this.offset=b|0}var S=y.prototype;return S.dtype=w,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(k,M,T){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M,T):this.data[this.offset+this.stride[0]*k+this.stride[1]*M]=T},S.get=function(k,M){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M):this.data[this.offset+this.stride[0]*k+this.stride[1]*M]},S.index=function(k,M){return this.offset+this.stride[0]*k+this.stride[1]*M},S.hi=function(k,M){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(k,M){var T=this.offset,c=0,h=this.shape[0],b=this.shape[1],_=this.stride[0],P=this.stride[1];return typeof k=="number"&&k>=0&&(c=k|0,T+=_*c,h-=c),typeof M=="number"&&M>=0&&(c=M|0,T+=P*c,b-=c),new y(this.data,h,b,_,P,T)},S.step=function(k,M){var T=this.shape[0],c=this.shape[1],h=this.stride[0],b=this.stride[1],_=this.offset,P=0,z=Math.ceil;return typeof k=="number"&&(P=k|0,P<0?(_+=h*(T-1),T=z(-T/P)):T=z(T/P),h*=P),typeof M=="number"&&(P=M|0,P<0?(_+=b*(c-1),c=z(-c/P)):c=z(c/P),b*=P),new y(this.data,T,c,h,b,_)},S.transpose=function(k,M){k=k===void 0?0:k|0,M=M===void 0?1:M|0;var T=this.shape,c=this.stride;return new y(this.data,T[k],T[M],c[k],c[M],this.offset)},S.pick=function(k,M){var T=[],c=[],h=this.offset;typeof k=="number"&&k>=0?h=h+this.stride[0]*k|0:(T.push(this.shape[0]),c.push(this.stride[0])),typeof M=="number"&&M>=0?h=h+this.stride[1]*M|0:(T.push(this.shape[1]),c.push(this.stride[1]));var b=l[T.length+1];return b(this.data,T,c,h)},function(k,M,T,c){return new y(k,M[0],M[1],T[0],T[1],c)}},3:function(w,l,x){function y(k,M,T,c,h,b,_,P){this.data=k,this.shape=[M,T,c],this.stride=[h,b,_],this.offset=P|0}var S=y.prototype;return S.dtype=w,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var k=Math.abs(this.stride[0]),M=Math.abs(this.stride[1]),T=Math.abs(this.stride[2]);return k>M?M>T?[2,1,0]:k>T?[1,2,0]:[1,0,2]:k>T?[2,0,1]:T>M?[0,1,2]:[0,2,1]}}),S.set=function(k,M,T,c){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T,c):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T]=c},S.get=function(k,M,T){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T]},S.index=function(k,M,T){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T},S.hi=function(k,M,T){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(k,M,T){var c=this.offset,h=0,b=this.shape[0],_=this.shape[1],P=this.shape[2],z=this.stride[0],D=this.stride[1],B=this.stride[2];return typeof k=="number"&&k>=0&&(h=k|0,c+=z*h,b-=h),typeof M=="number"&&M>=0&&(h=M|0,c+=D*h,_-=h),typeof T=="number"&&T>=0&&(h=T|0,c+=B*h,P-=h),new y(this.data,b,_,P,z,D,B,c)},S.step=function(k,M,T){var c=this.shape[0],h=this.shape[1],b=this.shape[2],_=this.stride[0],P=this.stride[1],z=this.stride[2],D=this.offset,B=0,R=Math.ceil;return typeof k=="number"&&(B=k|0,B<0?(D+=_*(c-1),c=R(-c/B)):c=R(c/B),_*=B),typeof M=="number"&&(B=M|0,B<0?(D+=P*(h-1),h=R(-h/B)):h=R(h/B),P*=B),typeof T=="number"&&(B=T|0,B<0?(D+=z*(b-1),b=R(-b/B)):b=R(b/B),z*=B),new y(this.data,c,h,b,_,P,z,D)},S.transpose=function(k,M,T){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0;var c=this.shape,h=this.stride;return new y(this.data,c[k],c[M],c[T],h[k],h[M],h[T],this.offset)},S.pick=function(k,M,T){var c=[],h=[],b=this.offset;typeof k=="number"&&k>=0?b=b+this.stride[0]*k|0:(c.push(this.shape[0]),h.push(this.stride[0])),typeof M=="number"&&M>=0?b=b+this.stride[1]*M|0:(c.push(this.shape[1]),h.push(this.stride[1])),typeof T=="number"&&T>=0?b=b+this.stride[2]*T|0:(c.push(this.shape[2]),h.push(this.stride[2]));var _=l[c.length+1];return _(this.data,c,h,b)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],T[0],T[1],T[2],c)}},4:function(w,l,x){function y(k,M,T,c,h,b,_,P,z,D){this.data=k,this.shape=[M,T,c,h],this.stride=[b,_,P,z],this.offset=D|0}var S=y.prototype;return S.dtype=w,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:x}),S.set=function(k,M,T,c,h){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c,h):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c]=h},S.get=function(k,M,T,c){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c]},S.index=function(k,M,T,c){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c},S.hi=function(k,M,T,c){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,typeof c!="number"||c<0?this.shape[3]:c|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(k,M,T,c){var h=this.offset,b=0,_=this.shape[0],P=this.shape[1],z=this.shape[2],D=this.shape[3],B=this.stride[0],R=this.stride[1],I=this.stride[2],F=this.stride[3];return typeof k=="number"&&k>=0&&(b=k|0,h+=B*b,_-=b),typeof M=="number"&&M>=0&&(b=M|0,h+=R*b,P-=b),typeof T=="number"&&T>=0&&(b=T|0,h+=I*b,z-=b),typeof c=="number"&&c>=0&&(b=c|0,h+=F*b,D-=b),new y(this.data,_,P,z,D,B,R,I,F,h)},S.step=function(k,M,T,c){var h=this.shape[0],b=this.shape[1],_=this.shape[2],P=this.shape[3],z=this.stride[0],D=this.stride[1],B=this.stride[2],R=this.stride[3],I=this.offset,F=0,j=Math.ceil;return typeof k=="number"&&(F=k|0,F<0?(I+=z*(h-1),h=j(-h/F)):h=j(h/F),z*=F),typeof M=="number"&&(F=M|0,F<0?(I+=D*(b-1),b=j(-b/F)):b=j(b/F),D*=F),typeof T=="number"&&(F=T|0,F<0?(I+=B*(_-1),_=j(-_/F)):_=j(_/F),B*=F),typeof c=="number"&&(F=c|0,F<0?(I+=R*(P-1),P=j(-P/F)):P=j(P/F),R*=F),new y(this.data,h,b,_,P,z,D,B,R,I)},S.transpose=function(k,M,T,c){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0,c=c===void 0?3:c|0;var h=this.shape,b=this.stride;return new y(this.data,h[k],h[M],h[T],h[c],b[k],b[M],b[T],b[c],this.offset)},S.pick=function(k,M,T,c){var h=[],b=[],_=this.offset;typeof k=="number"&&k>=0?_=_+this.stride[0]*k|0:(h.push(this.shape[0]),b.push(this.stride[0])),typeof M=="number"&&M>=0?_=_+this.stride[1]*M|0:(h.push(this.shape[1]),b.push(this.stride[1])),typeof T=="number"&&T>=0?_=_+this.stride[2]*T|0:(h.push(this.shape[2]),b.push(this.stride[2])),typeof c=="number"&&c>=0?_=_+this.stride[3]*c|0:(h.push(this.shape[3]),b.push(this.stride[3]));var P=l[h.length+1];return P(this.data,h,b,_)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],M[3],T[0],T[1],T[2],T[3],c)}},5:function(w,l,x){function y(k,M,T,c,h,b,_,P,z,D,B,R){this.data=k,this.shape=[M,T,c,h,b],this.stride=[_,P,z,D,B],this.offset=R|0}var S=y.prototype;return S.dtype=w,S.dimension=5,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(S,"order",{get:x}),S.set=function(k,M,T,c,h,b){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h,b):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h]=b},S.get=function(k,M,T,c,h){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h]},S.index=function(k,M,T,c,h){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h},S.hi=function(k,M,T,c,h){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,typeof c!="number"||c<0?this.shape[3]:c|0,typeof h!="number"||h<0?this.shape[4]:h|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},S.lo=function(k,M,T,c,h){var b=this.offset,_=0,P=this.shape[0],z=this.shape[1],D=this.shape[2],B=this.shape[3],R=this.shape[4],I=this.stride[0],F=this.stride[1],j=this.stride[2],N=this.stride[3],G=this.stride[4];return typeof k=="number"&&k>=0&&(_=k|0,b+=I*_,P-=_),typeof M=="number"&&M>=0&&(_=M|0,b+=F*_,z-=_),typeof T=="number"&&T>=0&&(_=T|0,b+=j*_,D-=_),typeof c=="number"&&c>=0&&(_=c|0,b+=N*_,B-=_),typeof h=="number"&&h>=0&&(_=h|0,b+=G*_,R-=_),new y(this.data,P,z,D,B,R,I,F,j,N,G,b)},S.step=function(k,M,T,c,h){var b=this.shape[0],_=this.shape[1],P=this.shape[2],z=this.shape[3],D=this.shape[4],B=this.stride[0],R=this.stride[1],I=this.stride[2],F=this.stride[3],j=this.stride[4],N=this.offset,G=0,rt=Math.ceil;return typeof k=="number"&&(G=k|0,G<0?(N+=B*(b-1),b=rt(-b/G)):b=rt(b/G),B*=G),typeof M=="number"&&(G=M|0,G<0?(N+=R*(_-1),_=rt(-_/G)):_=rt(_/G),R*=G),typeof T=="number"&&(G=T|0,G<0?(N+=I*(P-1),P=rt(-P/G)):P=rt(P/G),I*=G),typeof c=="number"&&(G=c|0,G<0?(N+=F*(z-1),z=rt(-z/G)):z=rt(z/G),F*=G),typeof h=="number"&&(G=h|0,G<0?(N+=j*(D-1),D=rt(-D/G)):D=rt(D/G),j*=G),new y(this.data,b,_,P,z,D,B,R,I,F,j,N)},S.transpose=function(k,M,T,c,h){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0,c=c===void 0?3:c|0,h=h===void 0?4:h|0;var b=this.shape,_=this.stride;return new y(this.data,b[k],b[M],b[T],b[c],b[h],_[k],_[M],_[T],_[c],_[h],this.offset)},S.pick=function(k,M,T,c,h){var b=[],_=[],P=this.offset;typeof k=="number"&&k>=0?P=P+this.stride[0]*k|0:(b.push(this.shape[0]),_.push(this.stride[0])),typeof M=="number"&&M>=0?P=P+this.stride[1]*M|0:(b.push(this.shape[1]),_.push(this.stride[1])),typeof T=="number"&&T>=0?P=P+this.stride[2]*T|0:(b.push(this.shape[2]),_.push(this.stride[2])),typeof c=="number"&&c>=0?P=P+this.stride[3]*c|0:(b.push(this.shape[3]),_.push(this.stride[3])),typeof h=="number"&&h>=0?P=P+this.stride[4]*h|0:(b.push(this.shape[4]),_.push(this.stride[4]));var z=l[b.length+1];return z(this.data,b,_,P)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],M[3],M[4],T[0],T[1],T[2],T[3],T[4],c)}}};function f(w,l){var x=l===-1?"T":String(l),y=s[x];return l===-1?y(w):l===0?y(w,g[w][0]):y(w,g[w],a)}function v(w){if(i(w))return"buffer";if(n)switch(Object.prototype.toString.call(w)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(w)?"array":"generic"}var g={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function m(w,l,x,y){if(w===void 0){var h=g.array[0];return h([])}else typeof w=="number"&&(w=[w]);l===void 0&&(l=[w.length]);var S=l.length;if(x===void 0){x=new Array(S);for(var k=S-1,M=1;k>=0;--k)x[k]=M,M*=l[k]}if(y===void 0){y=0;for(var k=0;k1e-6?(x[0]=S/c,x[1]=k/c,x[2]=M/c,x[3]=T/c):(x[0]=x[1]=x[2]=0,x[3]=1)}function m(x,y,S){this.radius=i([S]),this.center=i(y),this.rotation=i(x),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var w=m.prototype;w.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},w.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var y=this.computedRotation;g(y,y);var S=this.computedMatrix;o(S,y);var k=this.computedCenter,M=this.computedEye,T=this.computedUp,c=Math.exp(this.computedRadius[0]);M[0]=k[0]+c*S[2],M[1]=k[1]+c*S[6],M[2]=k[2]+c*S[10],T[0]=S[1],T[1]=S[5],T[2]=S[9];for(var h=0;h<3;++h){for(var b=0,_=0;_<3;++_)b+=S[h+4*_]*M[_];S[12+h]=-b}},w.getMatrix=function(x,y){this.recalcMatrix(x);var S=this.computedMatrix;if(y){for(var k=0;k<16;++k)y[k]=S[k];return y}return S},w.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},w.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},w.pan=function(x,y,S,k){y=y||0,S=S||0,k=k||0,this.recalcMatrix(x);var M=this.computedMatrix,T=M[1],c=M[5],h=M[9],b=f(T,c,h);T/=b,c/=b,h/=b;var _=M[0],P=M[4],z=M[8],D=_*T+P*c+z*h;_-=T*D,P-=c*D,z-=h*D;var B=f(_,P,z);_/=B,P/=B,z/=B,M[2],M[6],M[10];var R=_*y+T*S,I=P*y+c*S,F=z*y+h*S;this.center.move(x,R,I,F);var j=Math.exp(this.computedRadius[0]);j=Math.max(1e-4,j+k),this.radius.set(x,Math.log(j))},w.rotate=function(x,y,S,k){this.recalcMatrix(x),y=y||0,S=S||0;var M=this.computedMatrix,T=M[0],c=M[4],h=M[8],b=M[1],_=M[5],P=M[9],z=M[2],D=M[6],B=M[10],R=y*T+S*b,I=y*c+S*_,F=y*h+S*P,j=-(D*F-B*I),N=-(B*R-z*F),G=-(z*I-D*R),rt=Math.sqrt(Math.max(0,1-Math.pow(j,2)-Math.pow(N,2)-Math.pow(G,2))),ct=v(j,N,G,rt);ct>1e-6?(j/=ct,N/=ct,G/=ct,rt/=ct):(j=N=G=0,rt=1);var st=this.computedRotation,et=st[0],Z=st[1],ot=st[2],X=st[3],Q=et*rt+X*j+Z*G-ot*N,ut=Z*rt+X*N+ot*j-et*G,J=ot*rt+X*G+et*N-Z*j,q=X*rt-et*j-Z*N-ot*G;if(k){j=z,N=D,G=B;var it=Math.sin(k)/f(j,N,G);j*=it,N*=it,G*=it,rt=Math.cos(y),Q=Q*rt+q*j+ut*G-J*N,ut=ut*rt+q*N+J*j-Q*G,J=J*rt+q*G+Q*N-ut*j,q=q*rt-Q*j-ut*N-J*G}var nt=v(Q,ut,J,q);nt>1e-6?(Q/=nt,ut/=nt,J/=nt,q/=nt):(Q=ut=J=0,q=1),this.rotation.set(x,Q,ut,J,q)},w.lookAt=function(x,y,S,k){this.recalcMatrix(x),S=S||this.computedCenter,y=y||this.computedEye,k=k||this.computedUp;var M=this.computedMatrix;n(M,y,S,k);var T=this.computedRotation;s(T,M[0],M[1],M[2],M[4],M[5],M[6],M[8],M[9],M[10]),g(T,T),this.rotation.set(x,T[0],T[1],T[2],T[3]);for(var c=0,h=0;h<3;++h)c+=Math.pow(S[h]-y[h],2);this.radius.set(x,.5*Math.log(Math.max(c,1e-6))),this.center.set(x,S[0],S[1],S[2])},w.translate=function(x,y,S,k){this.center.move(x,y||0,S||0,k||0)},w.setMatrix=function(x,y){var S=this.computedRotation;s(S,y[0],y[1],y[2],y[4],y[5],y[6],y[8],y[9],y[10]),g(S,S),this.rotation.set(x,S[0],S[1],S[2],S[3]);var k=this.computedMatrix;a(k,y);var M=k[15];if(Math.abs(M)>1e-6){var T=k[12]/M,c=k[13]/M,h=k[14]/M;this.recalcMatrix(x);var b=Math.exp(this.computedRadius[0]);this.center.set(x,T-k[2]*b,c-k[6]*b,h-k[10]*b),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},w.setDistance=function(x,y){y>0&&this.radius.set(x,Math.log(y))},w.setDistanceLimits=function(x,y){x>0?x=Math.log(x):x=-1/0,y>0?y=Math.log(y):y=1/0,y=Math.max(y,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=y},w.getDistanceLimits=function(x){var y=this.radius.bounds;return x?(x[0]=Math.exp(y[0][0]),x[1]=Math.exp(y[1][0]),x):[Math.exp(y[0][0]),Math.exp(y[1][0])]},w.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},w.fromJSON=function(x){var y=this.lastT(),S=x.center;S&&this.center.set(y,S[0],S[1],S[2]);var k=x.rotation;k&&this.rotation.set(y,k[0],k[1],k[2],k[3]);var M=x.distance;M&&M>0&&this.radius.set(y,Math.log(M)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function l(x){x=x||{};var y=x.center||[0,0,0],S=x.rotation||[0,0,0,1],k=x.radius||1;y=[].slice.call(y,0,3),S=[].slice.call(S,0,4),g(S,S);var M=new m(S,y,Math.log(k));return M.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&M.lookAt(0,x.eye,x.center,x.up),M}},9994:function(t,e,r){var i=r(9618),n=r(8277);t.exports=function(o,a){for(var s=[],f=o,v=1;Array.isArray(f);)s.push(f.length),v*=f.length,f=f[0];return s.length===0?i():(a||(a=i(new Float64Array(v),s)),n(a,o),a)}}},d={};function E(t){var e=d[t];if(e!==void 0)return e.exports;var r=d[t]={id:t,loaded:!1,exports:{}};return u[t].call(r.exports,r,r.exports,E),r.loaded=!0,r.exports}(function(){E.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){E.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}})();var A=E(1964);V.exports=A})()}),_3=Vt((K,V)=>{V.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),E8=Vt((K,V)=>{var u=_3();V.exports=E;var d={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function E(A){var t,e=[],r=1,i;if(typeof A=="string")if(A=A.toLowerCase(),u[A])e=u[A].slice(),i="rgb";else if(A==="transparent")r=0,i="rgb",e=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(A)){var n=A.slice(1),o=n.length,a=o<=4;r=1,a?(e=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],o===4&&(r=parseInt(n[3]+n[3],16)/255)):(e=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],o===8&&(r=parseInt(n[6]+n[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(A)){var s=t[1],f=s==="rgb",n=s.replace(/a$/,"");i=n;var o=n==="cmyk"?4:n==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(m,w){if(/%$/.test(m))return w===o?parseFloat(m)/100:n==="rgb"?parseFloat(m)*255/100:parseFloat(m);if(n[w]==="h"){if(/deg$/.test(m))return parseFloat(m);if(d[m]!==void 0)return d[m]}return parseFloat(m)}),s===n&&e.push(1),r=f||e[o]===void 0?1:e[o],e=e.slice(0,o)}else A.length>10&&/[0-9](?:\s|\/)/.test(A)&&(e=A.match(/([0-9]+)/g).map(function(v){return parseFloat(v)}),i=A.match(/([a-z])/ig).join("").toLowerCase());else isNaN(A)?Array.isArray(A)||A.length?(e=[A[0],A[1],A[2]],i="rgb",r=A.length===4?A[3]:1):A instanceof Object&&(A.r!=null||A.red!=null||A.R!=null?(i="rgb",e=[A.r||A.red||A.R||0,A.g||A.green||A.G||0,A.b||A.blue||A.B||0]):(i="hsl",e=[A.h||A.hue||A.H||0,A.s||A.saturation||A.S||0,A.l||A.lightness||A.L||A.b||A.brightness]),r=A.a||A.alpha||A.opacity||1,A.opacity!=null&&(r/=100)):(i="rgb",e=[A>>>16,(A&65280)>>>8,A&255]);return{space:i,values:e,alpha:r}}}),z8=Vt((K,V)=>{var u=E8();V.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var A,t=u(E);if(!t.space)return[];var e=[0,0,0],r=t.space[0]==="h"?[360,100,100]:[255,255,255];return A=Array(3),A[0]=Math.min(Math.max(t.values[0],e[0]),r[0]),A[1]=Math.min(Math.max(t.values[1],e[1]),r[1]),A[2]=Math.min(Math.max(t.values[2],e[2]),r[2]),t.space[0]==="h"&&(A=d(A)),A.push(Math.min(Math.max(t.alpha,0),1)),A};function d(E){var A=E[0]/360,t=E[1]/100,e=E[2]/100,r,i,n,o,a,s=0;if(t===0)return a=e*255,[a,a,a];for(i=e<.5?e*(1+t):e+t-e*t,r=2*e-i,o=[0,0,0];s<3;)n=A+1/3*-(s-1),n<0?n++:n>1&&n--,a=6*n<1?r+(i-r)*6*n:2*n<1?i:3*n<2?r+(i-r)*(2/3-n)*6:r,o[s++]=a*255;return o}}),kv=Vt((K,V)=>{V.exports=u;function u(d,E,A){return EA?A:d:dE?E:d}}),wx=Vt((K,V)=>{V.exports=function(u){switch(u){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),Rd=Vt((K,V)=>{var u=z8(),d=kv(),E=wx();V.exports=function(t,e){(e==="float"||!e)&&(e="array"),e==="uint"&&(e="uint8"),e==="uint_clamped"&&(e="uint8_clamped");var r=E(e),i=new r(4),n=e!=="uint8"&&e!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=u(t),t[0]/=255,t[1]/=255,t[2]/=255),A(t)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3]!=null?t[3]:255,n&&(i[0]/=255,i[1]/=255,i[2]/=255,i[3]/=255),i):(n?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3]!=null?t[3]:1):(i[0]=d(Math.floor(t[0]*255),0,255),i[1]=d(Math.floor(t[1]*255),0,255),i[2]=d(Math.floor(t[2]*255),0,255),i[3]=t[3]==null?255:d(Math.floor(t[3]*255),0,255)),i)};function A(t){return!!(t instanceof Uint8Array||t instanceof Uint8ClampedArray||Array.isArray(t)&&(t[0]>1||t[0]===0)&&(t[1]>1||t[1]===0)&&(t[2]>1||t[2]===0)&&(!t[3]||t[3]>1))}}),Up=Vt((K,V)=>{var u=Rd();function d(E){return E?u(E):[0,0,0,1]}V.exports=d}),Vp=Vt((K,V)=>{var u=Lo(),d=Af(),E=Rd(),A=xu(),t=af().defaultLine,e=nh().isArrayOrTypedArray,r=E(t),i=1;function n(v,g){var m=v;return m[3]*=g,m}function o(v){if(u(v))return r;var g=E(v);return g.length?g:r}function a(v){return u(v)?v:i}function s(v,g,m){var w=v.color;w&&w._inputArray&&(w=w._inputArray);var l=e(w),x=e(g),y=A.extractOpts(v),S=[],k,M,T,c,h;if(y.colorscale!==void 0?k=A.makeColorScaleFuncFromTrace(v):k=o,l?M=function(_,P){return _[P]===void 0?r:E(k(_[P]))}:M=o,x?T=function(_,P){return _[P]===void 0?i:a(_[P])}:T=a,l||x)for(var b=0;b{V.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),Tx=Vt((K,V)=>{V.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),L8=Vt((K,V)=>{var u=ji();function d(t,e,r,i){if(!e||!e.visible)return null;for(var n=u.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),a=0;a0){var m=i.c2l(v);i._lowerLogErrorBound||(i._lowerLogErrorBound=m),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,m)}}else o[a]=[-s[0]*r,s[1]*r]}return o}function E(t){for(var e=0;e{var u=Bf().gl_line3d,d=Bf().gl_scatter3d,E=Bf().gl_error3d,A=Bf().gl_mesh3d,t=Bf().delaunay_triangulate,e=Xr(),r=Up(),i=Vp().formatColor,n=bm(),o=b3(),a=Tx(),s=yo(),f=mh().appendArrayPointValue,v=L8();function g(P,z){this.scene=P,this.uid=z,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var m=g.prototype;m.handlePick=function(P){if(P.object&&(P.object===this.linePlot||P.object===this.delaunayMesh||P.object===this.textMarkers||P.object===this.scatterPlot)){var z=P.index=P.data.index;return P.object.highlight&&P.object.highlight(null),this.scatterPlot&&(P.object=this.scatterPlot,this.scatterPlot.highlight(P.data)),P.textLabel="",this.textLabels&&(e.isArrayOrTypedArray(this.textLabels)?(this.textLabels[z]||this.textLabels[z]===0)&&(P.textLabel=this.textLabels[z]):P.textLabel=this.textLabels),P.traceCoordinate=[this.data.x[z],this.data.y[z],this.data.z[z]],!0}};function w(P,z,D){var B=(D+1)%3,R=(D+2)%3,I=[],F=[],j;for(j=0;j-1?-1:P.indexOf("right")>-1?1:0}function y(P){return P==null?0:P.indexOf("top")>-1?-1:P.indexOf("bottom")>-1?1:0}function S(P){var z=0,D=0,B=[z,D];if(Array.isArray(P))for(var R=0;R=0){var G=w(j.position,j.delaunayColor,j.delaunayAxis);G.opacity=P.opacity,this.delaunayMesh?this.delaunayMesh.update(G):(G.gl=z,this.delaunayMesh=A(G),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},m.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function _(P,z){var D=new g(P,z.uid);return D.update(z),D}V.exports=_}),w3=Vt((K,V)=>{var u=pc(),d=yu(),E=Wl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=kl(),n=b3(),o=Tx(),a=So().extendFlat,s=Cu().overrideAll,f=wd(),v=u.line,g=u.marker,m=g.line,w=a({width:v.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},E("line"));function l(y){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var x=V.exports=s({x:u.x,y:u.y,z:{valType:"data_array"},text:a({},u.text,{}),texttemplate:e(),texttemplatefallback:r({editType:"calc"}),hovertext:a({},u.hovertext,{}),hovertemplate:t(),hovertemplatefallback:r(),xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z"),mode:a({},u.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l(),y:l(),z:l()},connectgaps:u.connectgaps,line:w,marker:a({symbol:{valType:"enumerated",values:f(o),dflt:"circle",arrayOk:!0},size:a({},g.size,{dflt:8}),sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,opacity:a({},g.opacity,{arrayOk:!1}),colorbar:g.colorbar,line:a({width:a({},m.width,{arrayOk:!1})},E("marker.line"))},E("marker")),textposition:a({},u.textposition,{dflt:"top center"}),textfont:d({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:i.opacity,hoverinfo:a({},i.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}),I8=Vt((K,V)=>{var u=ji(),d=Xr(),E=nu(),A=Ch(),t=Rh(),e=Nh(),r=w3();V.exports=function(n,o,a,s){function f(S,k){return d.coerce(n,o,r,S,k)}var v=i(n,o,f,s);if(!v){o.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),E.hasMarkers(o)&&A(n,o,a,s,f,{noSelect:!0,noAngle:!0}),E.hasLines(o)&&(f("connectgaps"),t(n,o,a,s,f)),E.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),e(n,o,s,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var g=(o.line||{}).color,m=(o.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",g||m);for(var w=["x","y","z"],l=0;l<3;++l){var x="projection."+w[l];f(x+".show")&&(f(x+".opacity"),f(x+".scale"))}var y=u.getComponentMethod("errorbars","supplyDefaults");y(n,o,g||m||a,{axis:"z"}),y(n,o,g||m||a,{axis:"y",inherit:"z"}),y(n,o,g||m||a,{axis:"x",inherit:"z"})};function i(n,o,a,s){var f=0,v=a("x"),g=a("y"),m=a("z"),w=u.getComponentMethod("calendars","handleTraceDefaults");return w(n,o,["x","y","z"],s),v&&g&&m&&(f=Math.min(v.length,g.length,m.length),o._length=o._xlength=o._ylength=o._zlength=f),f}}),P8=Vt((K,V)=>{var u=vp(),d=jh();V.exports=function(E,A){var t=[{x:!1,y:!1,trace:A,t:{}}];return u(t,A),d(E,A),t}}),O8=Vt((K,V)=>{V.exports=u;function u(d,E){if(typeof d!="string")throw new TypeError("must specify type string");if(E=E||{},typeof document>"u"&&!E.canvas)return null;var A=E.canvas||document.createElement("canvas");typeof E.width=="number"&&(A.width=E.width),typeof E.height=="number"&&(A.height=E.height);var t=E,e;try{var r=[d];d.indexOf("webgl")===0&&r.push("experimental-"+d);for(var i=0;i{var u=O8();V.exports=function(d){return u("webgl",d)}}),T3=Vt((K,V)=>{var u=Pi(),d=function(){};V.exports=function(E){for(var A in E)typeof E[A]=="function"&&(E[A]=d);E.destroy=function(){E.container.parentNode.removeChild(E.container)};var t=document.createElement("div");t.className="no-webgl",t.style.cursor="pointer",t.style.fontSize="24px",t.style.color=u.defaults[0],t.style.position="absolute",t.style.left=t.style.top="0px",t.style.width=t.style.height="100%",t.style["background-color"]=u.lightLine,t.style["z-index"]=30;var e=document.createElement("p");return e.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",e.style.position="relative",e.style.top="50%",e.style.left="50%",e.style.height="30%",e.style.width="50%",e.style.margin="-15% 0 0 -25%",t.appendChild(e),E.container.appendChild(t),E.container.style.background="#FFFFFF",E.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),F8=Vt((K,V)=>{var u=Up(),d=Xr(),E=["xaxis","yaxis","zaxis"];function A(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var t=A.prototype;t.merge=function(r,i){for(var n=this,o=0;o<3;++o){var a=i[E[o]];if(!a.visible){n.tickEnable[o]=!1,n.labelEnable[o]=!1,n.lineEnable[o]=!1,n.lineTickEnable[o]=!1,n.gridEnable[o]=!1,n.zeroEnable[o]=!1,n.backgroundEnable[o]=!1;continue}n.labels[o]=r._meta?d.templateString(a.title.text,r._meta):a.title.text,"font"in a.title&&(a.title.font.color&&(n.labelColor[o]=u(a.title.font.color)),a.title.font.family&&(n.labelFont[o]=a.title.font.family),a.title.font.size&&(n.labelSize[o]=a.title.font.size),a.title.font.weight&&(n.labelFontWeight[o]=a.title.font.weight),a.title.font.style&&(n.labelFontStyle[o]=a.title.font.style),a.title.font.variant&&(n.labelFontVariant[o]=a.title.font.variant)),"showline"in a&&(n.lineEnable[o]=a.showline),"linecolor"in a&&(n.lineColor[o]=u(a.linecolor)),"linewidth"in a&&(n.lineWidth[o]=a.linewidth),"showgrid"in a&&(n.gridEnable[o]=a.showgrid),"gridcolor"in a&&(n.gridColor[o]=u(a.gridcolor)),"gridwidth"in a&&(n.gridWidth[o]=a.gridwidth),a.type==="log"?n.zeroEnable[o]=!1:"zeroline"in a&&(n.zeroEnable[o]=a.zeroline),"zerolinecolor"in a&&(n.zeroLineColor[o]=u(a.zerolinecolor)),"zerolinewidth"in a&&(n.zeroLineWidth[o]=a.zerolinewidth),"ticks"in a&&a.ticks?n.lineTickEnable[o]=!0:n.lineTickEnable[o]=!1,"ticklen"in a&&(n.lineTickLength[o]=n._defaultLineTickLength[o]=a.ticklen),"tickcolor"in a&&(n.lineTickColor[o]=u(a.tickcolor)),"tickwidth"in a&&(n.lineTickWidth[o]=a.tickwidth),"tickangle"in a&&(n.tickAngle[o]=a.tickangle==="auto"?-3600:Math.PI*-a.tickangle/180),"showticklabels"in a&&(n.tickEnable[o]=a.showticklabels),"tickfont"in a&&(a.tickfont.color&&(n.tickColor[o]=u(a.tickfont.color)),a.tickfont.family&&(n.tickFont[o]=a.tickfont.family),a.tickfont.size&&(n.tickSize[o]=a.tickfont.size),a.tickfont.weight&&(n.tickFontWeight[o]=a.tickfont.weight),a.tickfont.style&&(n.tickFontStyle[o]=a.tickfont.style),a.tickfont.variant&&(n.tickFontVariant[o]=a.tickfont.variant)),"mirror"in a?["ticks","all","allticks"].indexOf(a.mirror)!==-1?(n.lineTickMirror[o]=!0,n.lineMirror[o]=!0):a.mirror===!0?(n.lineTickMirror[o]=!1,n.lineMirror[o]=!0):(n.lineTickMirror[o]=!1,n.lineMirror[o]=!1):n.lineMirror[o]=!1,"showbackground"in a&&a.showbackground!==!1?(n.backgroundEnable[o]=!0,n.backgroundColor[o]=u(a.backgroundcolor)):n.backgroundEnable[o]=!1}};function e(r,i){var n=new A;return n.merge(r,i),n}V.exports=e}),B8=Vt((K,V)=>{var u=Up(),d=["xaxis","yaxis","zaxis"];function E(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var A=E.prototype;A.merge=function(e){for(var r=0;r<3;++r){var i=e[d[r]];if(!i.visible){this.enabled[r]=!1,this.drawSides[r]=!1;continue}this.enabled[r]=i.showspikes,this.colors[r]=u(i.spikecolor),this.drawSides[r]=i.spikesides,this.lineWidth[r]=i.spikethickness}};function t(e){var r=new E;return r.merge(e),r}V.exports=t}),R8=Vt((K,V)=>{V.exports=t;var u=yo(),d=Xr(),E=["xaxis","yaxis","zaxis"];function A(e){for(var r=new Array(3),i=0;i<3;++i){for(var n=e[i],o=new Array(n.length),a=0;a/g," "));o[a]=g,s.tickmode=f}}r.ticks=o;for(var a=0;a<3;++a){.5*(e.glplot.bounds[0][a]+e.glplot.bounds[1][a]);for(var m=0;m<2;++m)r.bounds[m][a]=e.glplot.bounds[m][a]}e.contourLevels=A(o)}}),N8=Vt((K,V)=>{var u=Bf().gl_plot3d,d=u.createCamera,E=u.createScene,A=D8(),t=Hy(),e=ji(),r=Xr(),i=r.preserveDrawingBuffer(),n=yo(),o=hc(),a=Up(),s=T3(),f=jb(),v=F8(),g=B8(),m=R8(),w=Xh().applyAutorangeOptions,l,x,y=!1;function S(D,B){var R=document.createElement("div"),I=D.container;this.graphDiv=D.graphDiv;var F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.style.position="absolute",F.style.top=F.style.left="0px",F.style.width=F.style.height="100%",F.style["z-index"]=20,F.style["pointer-events"]="none",R.appendChild(F),this.svgContainer=F,R.id=D.id,R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",I.appendChild(R),this.fullLayout=B,this.id=D.id||"scene",this.fullSceneLayout=B[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(B,B[this.id]),this.spikeOptions=g(B[this.id]),this.container=R,this.staticMode=!!D.staticPlot,this.pixelRatio=this.pixelRatio||D.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=e.getComponentMethod("annotations3d","convert"),this.drawAnnotations=e.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var k=S.prototype;k.prepareOptions=function(){var D=this,B={canvas:D.canvas,gl:D.gl,glOptions:{preserveDrawingBuffer:i,premultipliedAlpha:!0,antialias:!0},container:D.container,axes:D.axesOptions,spikes:D.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:D.camera,pixelRatio:D.pixelRatio};if(D.staticMode){if(!x&&(l=document.createElement("canvas"),x=A({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!x))throw new Error("error creating static canvas/context for image server");B.gl=x,B.canvas=l}return B};var M=!0;k.tryCreatePlot=function(){var D=this,B=D.prepareOptions(),R=!0;try{D.glplot=E(B)}catch{if(D.staticMode||!M||i)R=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{i=B.glOptions.preserveDrawingBuffer=!0,D.glplot=E(B)}catch{i=B.glOptions.preserveDrawingBuffer=!1,R=!1}}}return M=!1,R},k.initializeGLCamera=function(){var D=this,B=D.fullSceneLayout.camera,R=B.projection.type==="orthographic";D.camera=d(D.container,{center:[B.center.x,B.center.y,B.center.z],eye:[B.eye.x,B.eye.y,B.eye.z],up:[B.up.x,B.up.y,B.up.z],_ortho:R,zoomMin:.01,zoomMax:100,mode:"orbit"})},k.initializeGLPlot=function(){var D=this;D.initializeGLCamera();var B=D.tryCreatePlot();if(!B)return s(D);D.traces={},D.make4thDimension();var R=D.graphDiv,I=R.layout,F=function(){var N={};return D.isCameraChanged(I)&&(N[D.id+".camera"]=D.getCamera()),D.isAspectChanged(I)&&(N[D.id+".aspectratio"]=D.glplot.getAspectratio(),I[D.id].aspectmode!=="manual"&&(D.fullSceneLayout.aspectmode=I[D.id].aspectmode=N[D.id+".aspectmode"]="manual")),N},j=function(N){if(N.fullSceneLayout.dragmode!==!1){var G=F();N.saveLayout(I),N.graphDiv.emit("plotly_relayout",G)}};return D.glplot.canvas&&(D.glplot.canvas.addEventListener("mouseup",function(){j(D)}),D.glplot.canvas.addEventListener("touchstart",function(){y=!0}),D.glplot.canvas.addEventListener("wheel",function(N){if(R._context._scrollZoom.gl3d){if(D.camera._ortho){var G=N.deltaX>N.deltaY?1.1:.9090909090909091,rt=D.glplot.getAspectratio();D.glplot.setAspectratio({x:G*rt.x,y:G*rt.y,z:G*rt.z})}j(D)}},t?{passive:!1}:!1),D.glplot.canvas.addEventListener("mousemove",function(){if(D.fullSceneLayout.dragmode!==!1&&D.camera.mouseListener.buttons!==0){var N=F();D.graphDiv.emit("plotly_relayouting",N)}}),D.staticMode||D.glplot.canvas.addEventListener("webglcontextlost",function(N){R&&R.emit&&R.emit("plotly_webglcontextlost",{event:N,layer:D.id})},!1)),D.glplot.oncontextloss=function(){D.recoverContext()},D.glplot.onrender=function(){D.render()},!0},k.render=function(){var D=this,B=D.graphDiv,R,I=D.svgContainer,F=D.container.getBoundingClientRect();B._fullLayout._calcInverseTransform(B);var j=B._fullLayout._invScaleX,N=B._fullLayout._invScaleY,G=F.width*j,rt=F.height*N;I.setAttributeNS(null,"viewBox","0 0 "+G+" "+rt),I.setAttributeNS(null,"width",G),I.setAttributeNS(null,"height",rt),m(D),D.glplot.axes.update(D.axesOptions);for(var ct=Object.keys(D.traces),st=null,et=D.glplot.selection,Z=0;Z")):R.type==="isosurface"||R.type==="volume"?(J.valueLabel=n.hoverLabelText(D._mockAxis,D._mockAxis.d2l(et.traceCoordinate[3]),R.valuehoverformat),Tt.push("value: "+J.valueLabel),et.textLabel&&Tt.push(et.textLabel),dt=Tt.join("
                ")):dt=et.textLabel;var wt={x:et.traceCoordinate[0],y:et.traceCoordinate[1],z:et.traceCoordinate[2],data:Q._input,fullData:Q,curveNumber:Q.index,pointNumber:ut};o.appendArrayPointValue(wt,Q,ut),R._module.eventData&&(wt=Q._module.eventData(wt,et,Q,{},ut));var Ct={points:[wt]};if(D.fullSceneLayout.hovermode){var It=[];o.loneHover({trace:Q,x:(.5+.5*X[0]/X[3])*G,y:(.5-.5*X[1]/X[3])*rt,xLabel:J.xLabel,yLabel:J.yLabel,zLabel:J.zLabel,text:dt,name:st.name,color:o.castHoverOption(Q,ut,"bgcolor")||st.color,borderColor:o.castHoverOption(Q,ut,"bordercolor"),fontFamily:o.castHoverOption(Q,ut,"font.family"),fontSize:o.castHoverOption(Q,ut,"font.size"),fontColor:o.castHoverOption(Q,ut,"font.color"),nameLength:o.castHoverOption(Q,ut,"namelength"),textAlign:o.castHoverOption(Q,ut,"align"),hovertemplate:r.castOption(Q,ut,"hovertemplate"),hovertemplateLabels:r.extendFlat({},wt,J),eventData:[wt]},{container:I,gd:B,inOut_bbox:It}),wt.bbox=It[0]}et.distance<5&&(et.buttons||y)?B.emit("plotly_click",Ct):B.emit("plotly_hover",Ct),this.oldEventData=Ct}else o.loneUnhover(I),this.oldEventData&&B.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;D.drawAnnotations(D)},k.recoverContext=function(){var D=this;D.glplot.dispose();var B=function(){if(D.glplot.gl.isContextLost()){requestAnimationFrame(B);return}if(!D.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}D.plot.apply(D,D.plotArgs)};requestAnimationFrame(B)};var T=["xaxis","yaxis","zaxis"];function c(D,B,R){for(var I=D.fullSceneLayout,F=0;F<3;F++){var j=T[F],N=j.charAt(0),G=I[j],rt=B[N],ct=B[N+"calendar"],st=B["_"+N+"length"];if(!r.isArrayOrTypedArray(rt))R[0][F]=Math.min(R[0][F],0),R[1][F]=Math.max(R[1][F],st-1);else for(var et,Z=0;Z<(st||rt.length);Z++)if(r.isArrayOrTypedArray(rt[Z]))for(var ot=0;otQ[1][N])Q[0][N]=-1,Q[1][N]=1;else{var te=Q[1][N]-Q[0][N];Q[0][N]-=te/32,Q[1][N]+=te/32}if(q=[Q[0][N],Q[1][N]],q=w(q,rt),Q[0][N]=q[0],Q[1][N]=q[1],rt.isReversed()){var Jt=Q[0][N];Q[0][N]=Q[1][N],Q[1][N]=Jt}}else q=rt.range,Q[0][N]=rt.r2l(q[0]),Q[1][N]=rt.r2l(q[1]);Q[0][N]===Q[1][N]&&(Q[0][N]-=1,Q[1][N]+=1),ut[N]=Q[1][N]-Q[0][N],rt.range=[Q[0][N],Q[1][N]],rt.limitRange(),I.glplot.setBounds(N,{min:rt.range[0]*ot[N],max:rt.range[1]*ot[N]})}var ee,Zt=st.aspectmode;if(Zt==="cube")ee=[1,1,1];else if(Zt==="manual"){var mt=st.aspectratio;ee=[mt.x,mt.y,mt.z]}else if(Zt==="auto"||Zt==="data"){var bt=[1,1,1];for(N=0;N<3;++N){rt=st[T[N]],ct=rt.type;var vt=J[ct];bt[N]=Math.pow(vt.acc,1/vt.count)/ot[N]}Zt==="data"||Math.max.apply(null,bt)/Math.min.apply(null,bt)<=4?ee=bt:ee=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");st.aspectratio.x=et.aspectratio.x=ee[0],st.aspectratio.y=et.aspectratio.y=ee[1],st.aspectratio.z=et.aspectratio.z=ee[2],I.glplot.setAspectratio(st.aspectratio),I.viewInitial.aspectratio||(I.viewInitial.aspectratio={x:st.aspectratio.x,y:st.aspectratio.y,z:st.aspectratio.z}),I.viewInitial.aspectmode||(I.viewInitial.aspectmode=st.aspectmode);var Ut=st.domain||null,re=B._size||null;if(Ut&&re){var Kt=I.container.style;Kt.position="absolute",Kt.left=re.l+Ut.x[0]*re.w+"px",Kt.top=re.t+(1-Ut.y[1])*re.h+"px",Kt.width=re.w*(Ut.x[1]-Ut.x[0])+"px",Kt.height=re.h*(Ut.y[1]-Ut.y[0])+"px"}I.glplot.redraw()}},k.destroy=function(){var D=this;D.glplot&&(D.camera.mouseListener.enabled=!1,D.container.removeEventListener("wheel",D.camera.wheelListener),D.camera=null,D.glplot.dispose(),D.container.parentNode.removeChild(D.container),D.glplot=null)};function b(D){return[[D.eye.x,D.eye.y,D.eye.z],[D.center.x,D.center.y,D.center.z],[D.up.x,D.up.y,D.up.z]]}function _(D){return{up:{x:D.up[0],y:D.up[1],z:D.up[2]},center:{x:D.center[0],y:D.center[1],z:D.center[2]},eye:{x:D.eye[0],y:D.eye[1],z:D.eye[2]},projection:{type:D._ortho===!0?"orthographic":"perspective"}}}k.getCamera=function(){var D=this;return D.camera.view.recalcMatrix(D.camera.view.lastT()),_(D.camera)},k.setViewport=function(D){var B=this,R=D.camera;B.camera.lookAt.apply(this,b(R)),B.glplot.setAspectratio(D.aspectratio);var I=R.projection.type==="orthographic",F=B.camera._ortho;I!==F&&(B.glplot.redraw(),B.glplot.clearRGBA(),B.glplot.dispose(),B.initializeGLPlot())},k.isCameraChanged=function(D){var B=this,R=B.getCamera(),I=r.nestedProperty(D,B.id+".camera"),F=I.get();function j(ct,st,et,Z){var ot=["up","center","eye"],X=["x","y","z"];return st[ot[et]]&&ct[ot[et]][X[Z]]===st[ot[et]][X[Z]]}var N=!1;if(F===void 0)N=!0;else{for(var G=0;G<3;G++)for(var rt=0;rt<3;rt++)if(!j(R,F,G,rt)){N=!0;break}(!F.projection||R.projection&&R.projection.type!==F.projection.type)&&(N=!0)}return N},k.isAspectChanged=function(D){var B=this,R=B.glplot.getAspectratio(),I=r.nestedProperty(D,B.id+".aspectratio"),F=I.get();return F===void 0||F.x!==R.x||F.y!==R.y||F.z!==R.z},k.saveLayout=function(D){var B=this,R=B.fullLayout,I,F,j,N,G,rt,ct=B.isCameraChanged(D),st=B.isAspectChanged(D),et=ct||st;if(et){var Z={};if(ct&&(I=B.getCamera(),F=r.nestedProperty(D,B.id+".camera"),j=F.get(),Z[B.id+".camera"]=j),st&&(N=B.glplot.getAspectratio(),G=r.nestedProperty(D,B.id+".aspectratio"),rt=G.get(),Z[B.id+".aspectratio"]=rt),e.call("_storeDirectGUIEdit",D,R._preGUI,Z),ct){F.set(I);var ot=r.nestedProperty(R,B.id+".camera");ot.set(I)}if(st){G.set(N);var X=r.nestedProperty(R,B.id+".aspectratio");X.set(N),B.glplot.redraw()}}return et},k.updateFx=function(D,B){var R=this,I=R.camera;if(I)if(D==="orbit")I.mode="orbit",I.keyBindingMode="rotate";else if(D==="turntable"){I.up=[0,0,1],I.mode="turntable",I.keyBindingMode="rotate";var F=R.graphDiv,j=F._fullLayout,N=R.fullSceneLayout.camera,G=N.up.x,rt=N.up.y,ct=N.up.z;if(ct/Math.sqrt(G*G+rt*rt+ct*ct)<.999){var st=R.id+".camera.up",et={x:0,y:0,z:1},Z={};Z[st]=et;var ot=F.layout;e.call("_storeDirectGUIEdit",ot,j._preGUI,Z),N.up=et,r.nestedProperty(ot,st).set(et)}}else I.keyBindingMode=D;R.fullSceneLayout.hovermode=B};function P(D,B,R){for(var I=0,F=R-1;I0)for(var G=255/N,rt=0;rt<3;++rt)D[j+rt]=Math.min(G*D[j+rt],255)}}k.toImage=function(D){var B=this;D||(D="png"),B.staticMode&&B.container.appendChild(l),B.glplot.redraw();var R=B.glplot.gl,I=R.drawingBufferWidth,F=R.drawingBufferHeight;R.bindFramebuffer(R.FRAMEBUFFER,null);var j=new Uint8Array(I*F*4);R.readPixels(0,0,I,F,R.RGBA,R.UNSIGNED_BYTE,j),P(j,I,F),z(j,I,F);var N=document.createElement("canvas");N.width=I,N.height=F;var G=N.getContext("2d",{willReadFrequently:!0}),rt=G.createImageData(I,F);rt.data.set(j),G.putImageData(rt,0,0);var ct;switch(D){case"jpeg":ct=N.toDataURL("image/jpeg");break;case"webp":ct=N.toDataURL("image/webp");break;default:ct=N.toDataURL("image/png")}return B.staticMode&&B.container.removeChild(l),ct},k.setConvert=function(){for(var D=this,B=0;B<3;B++){var R=D.fullSceneLayout[T[B]];n.setConvert(R,D.fullLayout),R.setScale=r.noop}},k.make4thDimension=function(){var D=this,B=D.graphDiv,R=B._fullLayout;D._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(D._mockAxis,R)},V.exports=S}),j8=Vt((K,V)=>{V.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),k3=Vt((K,V)=>{var u=Pi(),d=Of(),E=So().extendFlat,A=Cu().overrideAll;V.exports=A({visible:d.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:u.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:d.color,categoryorder:d.categoryorder,categoryarray:d.categoryarray,title:{text:d.title.text,font:d.title.font},type:E({},d.type,{values:["-","linear","log","date","category"]}),autotypenumbers:d.autotypenumbers,autorange:d.autorange,autorangeoptions:{minallowed:d.autorangeoptions.minallowed,maxallowed:d.autorangeoptions.maxallowed,clipmin:d.autorangeoptions.clipmin,clipmax:d.autorangeoptions.clipmax,include:d.autorangeoptions.include,editType:"plot"},rangemode:d.rangemode,minallowed:d.minallowed,maxallowed:d.maxallowed,range:E({},d.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,mirror:d.mirror,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,labelalias:d.labelalias,tickfont:d.tickfont,tickangle:d.tickangle,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,minexponent:d.minexponent,separatethousands:d.separatethousands,tickformat:d.tickformat,tickformatstops:d.tickformatstops,hoverformat:d.hoverformat,showline:d.showline,linecolor:d.linecolor,linewidth:d.linewidth,showgrid:d.showgrid,gridcolor:E({},d.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:d.gridwidth,zeroline:d.zeroline,zerolinecolor:d.zerolinecolor,zerolinewidth:d.zerolinewidth},"plot","from-root")}),A3=Vt((K,V)=>{var u=k3(),d=Vu().attributes,E=So().extendFlat,A=Xr().counterRegex;function t(e,r,i){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:i,editType:"camera"},editType:"camera"}}V.exports={_arrayAttrRegexps:[A("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:E(t(0,0,1),{}),center:E(t(0,0,0),{}),eye:E(t(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:d({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:u,yaxis:u,zaxis:u,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),U8=Vt((K,V)=>{var u=Af().mix,d=Xr(),E=cl(),A=k3(),t=Rb(),e=qg(),r=["xaxis","yaxis","zaxis"],i=13600/187;V.exports=function(n,o,a){var s,f;function v(w,l){return d.coerce(s,f,A,w,l)}for(var g=0;g{var u=Xr(),d=Pi(),E=ji(),A=Ld(),t=U8(),e=A3(),r=Pf().getSubplotData,i="gl3d";V.exports=function(o,a,s){var f=a._basePlotModules.length>1;function v(g){if(!f){var m=u.validate(o[g],e[g]);if(m)return o[g]}}A(o,a,s,{type:i,attributes:e,handleDefaults:n,fullLayout:a,font:a.font,fullData:s,getDfltFromLayout:v,autotypenumbersDflt:a.autotypenumbers,paper_bgcolor:a.paper_bgcolor,calendar:a.calendar})};function n(o,a,s,f){for(var v=s("bgcolor"),g=d.combine(v,f.paper_bgcolor),m=["up","center","eye"],w=0;w.999)&&(k="turntable")}else k="turntable";s("dragmode",k),s("hovermode",f.getDfltFromLayout("hovermode"))}}),Nd=Vt(K=>{var V=Cu().overrideAll,u=xd(),d=N8(),E=Pf().getSubplotData,A=Xr(),t=Lh(),e="gl3d",r="scene";K.name=e,K.attr=r,K.idRoot=r,K.idRegex=K.attrRegex=A.counterRegex("scene"),K.attributes=j8(),K.layoutAttributes=A3(),K.baseLayoutAttrOverrides=V({hoverlabel:u.hoverlabel},"plot","nested"),K.supplyLayoutDefaults=V8(),K.plot=function(i){for(var n=i._fullLayout,o=i._fullData,a=n._subplots[e],s=0;s{V.exports={plot:C8(),attributes:w3(),markerSymbols:Tx(),supplyDefaults:I8(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:P8(),moduleType:"trace",name:"scatter3d",basePlotModule:Nd(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),q8=Vt((K,V)=>{V.exports=H8()}),Av=Vt((K,V)=>{var u=Pi(),d=Wl(),E=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:t}=yl(),e=kl(),r=So().extendFlat,i=Cu().overrideAll;function n(s){return{valType:"boolean",dflt:!1}}function o(s){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:n(),y:n(),z:n()},color:{valType:"color",dflt:u.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:u.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=V.exports=i(r({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:A(),hovertemplatefallback:t(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},d("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:o(),y:o(),z:o()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:r({},e.hoverinfo),showlegend:r({},e.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType="calc+clearAxisTypes"}),M3=Vt((K,V)=>{var u=ji(),d=Xr(),E=vf(),A=Av(),t=.1;function e(o,a){for(var s=[],f=32,v=0;v{var u=ih();V.exports=function(d,E){E.surfacecolor?u(d,E,{vals:E.surfacecolor,containerStr:"",cLetter:"c"}):u(d,E,{vals:E.z,containerStr:"",cLetter:"c"})}}),G8=Vt((K,V)=>{var u=Bf().gl_surface3d,d=Bf().ndarray,E=Bf().ndarray_linear_interpolate.d2,A=x1(),t=_1(),e=Xr().isArrayOrTypedArray,r=Vp().parseColorScale,i=Up(),n=xu().extractOpts;function o(b,_,P){this.scene=b,this.uid=P,this.surface=_,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var a=o.prototype;a.getXat=function(b,_,P,z){var D=e(this.data.x)?e(this.data.x[0])?this.data.x[_][b]:this.data.x[b]:b;return P===void 0?D:z.d2l(D,0,P)},a.getYat=function(b,_,P,z){var D=e(this.data.y)?e(this.data.y[0])?this.data.y[_][b]:this.data.y[_]:_;return P===void 0?D:z.d2l(D,0,P)},a.getZat=function(b,_,P,z){var D=this.data.z[_][b];return D===null&&this.data.connectgaps&&this.data._interpolatedZ&&(D=this.data._interpolatedZ[_][b]),P===void 0?D:z.d2l(D,0,P)},a.handlePick=function(b){if(b.object===this.surface){var _=(b.data.index[0]-1)/this.dataScaleX-1,P=(b.data.index[1]-1)/this.dataScaleY-1,z=Math.max(Math.min(Math.round(_),this.data.z[0].length-1),0),D=Math.max(Math.min(Math.round(P),this.data._ylength-1),0);b.index=[z,D],b.traceCoordinate=[this.getXat(z,D),this.getYat(z,D),this.getZat(z,D)],b.dataCoordinate=[this.getXat(z,D,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(z,D,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(z,D,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var B=0;B<3;B++){var R=b.dataCoordinate[B];R!=null&&(b.dataCoordinate[B]*=this.scene.dataScale[B])}var I=this.data.hovertext||this.data.text;return e(I)&&I[D]&&I[D][z]!==void 0?b.textLabel=I[D][z]:I?b.textLabel=I:b.textLabel="",b.data.dataCoordinate=b.dataCoordinate.slice(),this.surface.highlight(b.data),this.scene.glplot.spikes.position=b.dataCoordinate,!0}};function s(b){var _=b[0].rgb,P=b[b.length-1].rgb;return _[0]===P[0]&&_[1]===P[1]&&_[2]===P[2]&&_[3]===P[3]}var f=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function v(b,_){if(b<_)return 0;for(var P=0;Math.floor(b%_)===0;)b/=_,P++;return P}function g(b){for(var _=[],P=0;P0){P=f[z];break}return P}function w(b,_){if(!(b<1||_<1)){for(var P=g(b),z=g(_),D=1,B=0;BS;)z--,z/=m(z),z++,z1?D:1};function k(b,_,P){var z=P[8]+P[2]*_[0]+P[5]*_[1];return b[0]=(P[6]+P[0]*_[0]+P[3]*_[1])/z,b[1]=(P[7]+P[1]*_[0]+P[4]*_[1])/z,b}function M(b,_,P){return T(b,_,k,P),b}function T(b,_,P,z){for(var D=[0,0],B=b.shape[0],R=b.shape[1],I=0;I0&&this.contourStart[z]!==null&&this.contourEnd[z]!==null&&this.contourEnd[z]>this.contourStart[z]))for(_[z]=!0,D=this.contourStart[z];Drt&&(this.minValues[j]=rt),this.maxValues[j]{V.exports={attributes:Av(),supplyDefaults:M3().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:W8(),plot:G8(),moduleType:"trace",name:"surface",basePlotModule:Nd(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),K8=Vt((K,V)=>{V.exports=Z8()}),Wm=Vt((K,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Av(),e=kl(),r=So().extendFlat;V.exports=r({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:E({editType:"calc"}),hovertemplatefallback:A({editType:"calc"}),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},u("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:t.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:r({},t.contours.x.show,{}),color:t.contours.x.color,width:t.contours.x.width,editType:"calc"},lightposition:{x:r({},t.lightposition.x,{dflt:1e5}),y:r({},t.lightposition.y,{dflt:1e5}),z:r({},t.lightposition.z,{dflt:0}),editType:"calc"},lighting:r({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},t.lighting),hoverinfo:r({},e.hoverinfo,{editType:"calc"}),showlegend:r({},e.showlegend,{dflt:!1})})}),kx=Vt((K,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Wm(),e=kl(),r=So().extendFlat,i=Cu().overrideAll;function n(s){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function o(s){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var a=V.exports=i(r({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:n(),y:n(),z:n()},caps:{x:o(),y:o(),z:o()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:E(),hovertemplatefallback:A(),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),valuehoverformat:d("value",1),showlegend:r({},e.showlegend,{dflt:!1})},u("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:t.opacity,lightposition:t.lightposition,lighting:t.lighting,flatshading:t.flatshading,contour:t.contour,hoverinfo:r({},e.hoverinfo)}),"calc","nested");a.flatshading.dflt=!0,a.lighting.facenormalsepsilon.dflt=0,a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),S3=Vt((K,V)=>{var u=Xr(),d=ji(),E=kx(),A=vf();function t(r,i,n,o){function a(s,f){return u.coerce(r,i,E,s,f)}e(r,i,n,o,a)}function e(r,i,n,o,a){var s=a("isomin"),f=a("isomax");f!=null&&s!==void 0&&s!==null&&s>f&&(i.isomin=null,i.isomax=null);var v=a("x"),g=a("y"),m=a("z"),w=a("value");if(!v||!v.length||!g||!g.length||!m||!m.length||!w||!w.length){i.visible=!1;return}var l=d.getComponentMethod("calendars","handleTraceDefaults");l(r,i,["x","y","z"],o),a("valuehoverformat"),["x","y","z"].forEach(function(k){a(k+"hoverformat");var M="caps."+k,T=a(M+".show");T&&a(M+".fill");var c="slices."+k,h=a(c+".show");h&&(a(c+".fill"),a(c+".locations"))});var x=a("spaceframe.show");x&&a("spaceframe.fill");var y=a("surface.show");y&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var S=a("contour.show");S&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(k){a(k)}),A(r,i,o,a,{prefix:"",cLetter:"c"}),i._length=null}V.exports={supplyDefaults:t,supplyIsoDefaults:e}}),Ax=Vt((K,V)=>{var u=Xr(),d=ih();function E(r,i){i._len=Math.min(i.u.length,i.v.length,i.w.length,i.x.length,i.y.length,i.z.length),i._u=e(i.u,i._len),i._v=e(i.v,i._len),i._w=e(i.w,i._len),i._x=e(i.x,i._len),i._y=e(i.y,i._len),i._z=e(i.z,i._len);var n=A(i);i._gridFill=n.fill,i._Xs=n.Xs,i._Ys=n.Ys,i._Zs=n.Zs,i._len=n.len;var o=0,a,s,f;i.starts&&(a=e(i.starts.x||[]),s=e(i.starts.y||[]),f=e(i.starts.z||[]),o=Math.min(a.length,s.length,f.length)),i._startsX=a||[],i._startsY=s||[],i._startsZ=f||[];var v=0,g=1/0,m;for(m=0;m1&&(h=i[a-1],_=n[a-1],z=o[a-1]),s=0;sh?"-":"+")+"x"),S=S.replace("y",(b>_?"-":"+")+"y"),S=S.replace("z",(P>z?"-":"+")+"z");var I=function(){a=0,D=[],B=[],R=[]};(!a||a{var u=ih(),d=Ax().processGrid,E=Ax().filter;V.exports=function(A,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=E(t.x,t._len),t._y=E(t.y,t._len),t._z=E(t.z,t._len),t._value=E(t.value,t._len);var e=d(t);t._gridFill=e.fill,t._Xs=e.Xs,t._Ys=e.Ys,t._Zs=e.Zs,t._len=e.len;for(var r=1/0,i=-1/0,n=0;n{V.exports=function(u,d,E,A){A=A||u.length;for(var t=new Array(A),e=0;e{var u=Bf().gl_mesh3d,d=Vp().parseColorScale,E=Xr().isArrayOrTypedArray,A=Up(),t=xu().extractOpts,e=Gm(),r=function(f,v){for(var g=v.length-1;g>0;g--){var m=Math.min(v[g],v[g-1]),w=Math.max(v[g],v[g-1]);if(w>m&&m-1}function it(de,Dt){return de===null?Dt:de}function nt(de,Dt,qt){ct();var _t=[Dt],lt=[qt];if(Q>=1)_t=[Dt],lt=[qt];else if(Q>0){var yt=J(Dt,qt);_t=yt.xyzv,lt=yt.abc}for(var St=0;St<_t.length;St++){Dt=_t[St],qt=lt[St];for(var Ht=[],Yt=0;Yt<3;Yt++){var se=Dt[Yt][0],ke=Dt[Yt][1],Ee=Dt[Yt][2],Ue=Dt[Yt][3],ir=qt[Yt]>-1?qt[Yt]:rt(se,ke,Ee);ir>-1?Ht[Yt]=ir:Ht[Yt]=et(se,ke,Ee,it(de,Ue))}Z(Ht[0],Ht[1],Ht[2])}}function dt(de,Dt,qt){var _t=function(lt,yt,St){nt(de,[Dt[lt],Dt[yt],Dt[St]],[qt[lt],qt[yt],qt[St]])};_t(0,1,2),_t(2,3,0)}function Tt(de,Dt,qt){var _t=function(lt,yt,St){nt(de,[Dt[lt],Dt[yt],Dt[St]],[qt[lt],qt[yt],qt[St]])};_t(0,1,2),_t(3,0,1),_t(2,3,0),_t(1,2,3)}function wt(de,Dt,qt,_t){var lt=de[3];lt_t&&(lt=_t);for(var yt=(de[3]-lt)/(de[3]-Dt[3]+1e-9),St=[],Ht=0;Ht<4;Ht++)St[Ht]=(1-yt)*de[Ht]+yt*Dt[Ht];return St}function Ct(de,Dt,qt){return de>=Dt&&de<=qt}function It(de){var Dt=.001*(I-R);return de>=R-Dt&&de<=I+Dt}function Nt(de){for(var Dt=[],qt=0;qt<4;qt++){var _t=de[qt];Dt.push([f._x[_t],f._y[_t],f._z[_t],f._value[_t]])}return Dt}var te=3;function Jt(de,Dt,qt,_t,lt,yt){yt||(yt=1),qt=[-1,-1,-1];var St=!1,Ht=[Ct(Dt[0][3],_t,lt),Ct(Dt[1][3],_t,lt),Ct(Dt[2][3],_t,lt)];if(!Ht[0]&&!Ht[1]&&!Ht[2])return!1;var Yt=function(ke,Ee,Ue){return It(Ee[0][3])&&It(Ee[1][3])&&It(Ee[2][3])?(nt(ke,Ee,Ue),!0):ytHt?[D,yt]:[yt,B];We(Dt,Yt[0],Yt[1])}}var se=[[Math.min(R,B),Math.max(R,B)],[Math.min(D,I),Math.max(D,I)]];["x","y","z"].forEach(function(ke){for(var Ee=[],Ue=0;Ue0&&(dn.push(En.id),ke==="x"?bn.push([En.distRatio,0,0]):ke==="y"?bn.push([0,En.distRatio,0]):bn.push([0,0,En.distRatio]))}else ke==="x"?pn=er(1,h-1):ke==="y"?pn=er(1,b-1):pn=er(1,_-1);dn.length>0&&(ke==="x"?Ee[ir]=qe(de,dn,ar,Ye,bn,Ee[ir]):ke==="y"?Ee[ir]=vr(de,dn,ar,Ye,bn,Ee[ir]):Ee[ir]=_r(de,dn,ar,Ye,bn,Ee[ir]),ir++),pn.length>0&&(ke==="x"?Ee[ir]=re(de,pn,ar,Ye,Ee[ir]):ke==="y"?Ee[ir]=Kt(de,pn,ar,Ye,Ee[ir]):Ee[ir]=ue(de,pn,ar,Ye,Ee[ir]),ir++)}var gn=f.caps[ke];gn.show&&gn.fill&&(ut(gn.fill),ke==="x"?Ee[ir]=re(de,[0,h-1],ar,Ye,Ee[ir]):ke==="y"?Ee[ir]=Kt(de,[0,b-1],ar,Ye,Ee[ir]):Ee[ir]=ue(de,[0,_-1],ar,Ye,Ee[ir]),ir++)}}),y===0&&st(),f._meshX=F,f._meshY=j,f._meshZ=N,f._meshIntensity=G,f._Xs=M,f._Ys=T,f._Zs=c}return Ir(),f}function s(f,v){var g=f.glplot.gl,m=u({gl:g}),w=new i(f,m,v.uid);return m._trace=w,w.update(v),f.glplot.add(m),w}V.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}),Y8=Vt((K,V)=>{V.exports={attributes:kx(),supplyDefaults:S3().supplyDefaults,calc:E3(),colorbar:{min:"cmin",max:"cmax"},plot:Mx().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),X8=Vt((K,V)=>{V.exports=Y8()}),z3=Vt((K,V)=>{var u=Wl(),d=kx(),E=Av(),A=kl(),t=So().extendFlat,e=Cu().overrideAll,r=V.exports=e(t({x:d.x,y:d.y,z:d.z,value:d.value,isomin:d.isomin,isomax:d.isomax,surface:d.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:d.slices,caps:d.caps,text:d.text,hovertext:d.hovertext,xhoverformat:d.xhoverformat,yhoverformat:d.yhoverformat,zhoverformat:d.zhoverformat,valuehoverformat:d.valuehoverformat,hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback},u("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:d.colorbar,opacity:d.opacity,opacityscale:E.opacityscale,lightposition:d.lightposition,lighting:d.lighting,flatshading:d.flatshading,contour:d.contour,hoverinfo:t({},A.hoverinfo),showlegend:t({},A.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}),$8=Vt((K,V)=>{var u=Xr(),d=z3(),E=S3().supplyIsoDefaults,A=M3().opacityscaleDefaults;V.exports=function(t,e,r,i){function n(o,a){return u.coerce(t,e,d,o,a)}E(t,e,r,i,n),A(t,e,i,n)}}),J8=Vt((K,V)=>{var u=Bf().gl_mesh3d,d=Vp().parseColorScale,E=Xr().isArrayOrTypedArray,A=Up(),t=xu().extractOpts,e=Gm(),r=Mx().findNearestOnAxis,i=Mx().generateIsoMeshes;function n(s,f,v){this.scene=s,this.uid=v,this.mesh=f,this.name="",this.data=null,this.showContour=!1}var o=n.prototype;o.handlePick=function(s){if(s.object===this.mesh){var f=s.data.index,v=this.data._meshX[f],g=this.data._meshY[f],m=this.data._meshZ[f],w=this.data._Ys.length,l=this.data._Zs.length,x=r(v,this.data._Xs).id,y=r(g,this.data._Ys).id,S=r(m,this.data._Zs).id,k=s.index=S+l*y+l*w*x;s.traceCoordinate=[this.data._meshX[k],this.data._meshY[k],this.data._meshZ[k],this.data._value[k]];var M=this.data.hovertext||this.data.text;return E(M)&&M[k]!==void 0?s.textLabel=M[k]:M&&(s.textLabel=M),!0}},o.update=function(s){var f=this.scene,v=f.fullSceneLayout;this.data=i(s);function g(y,S,k,M){return S.map(function(T){return y.d2l(T,0,M)*k})}var m=e(g(v.xaxis,s._meshX,f.dataScale[0],s.xcalendar),g(v.yaxis,s._meshY,f.dataScale[1],s.ycalendar),g(v.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),w=e(s._meshI,s._meshJ,s._meshK),l={positions:m,cells:w,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:A(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},x=t(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[x.min,x.max],l.colormap=d(s),this.mesh.update(l)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,f){var v=s.glplot.gl,g=u({gl:v}),m=new n(s,g,f.uid);return g._trace=m,m.update(f),s.glplot.add(g),m}V.exports=a}),Q8=Vt((K,V)=>{V.exports={attributes:z3(),supplyDefaults:$8(),calc:E3(),colorbar:{min:"cmin",max:"cmax"},plot:J8(),moduleType:"trace",name:"volume",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),tE=Vt((K,V)=>{V.exports=Q8()}),eE=Vt((K,V)=>{var u=ji(),d=Xr(),E=vf(),A=Wm();V.exports=function(t,e,r,i){function n(v,g){return d.coerce(t,e,A,v,g)}function o(v){var g=v.map(function(m){var w=n(m);return w&&d.isArrayOrTypedArray(w)?w:null});return g.every(function(m){return m&&m.length===g[0].length})&&g}var a=o(["x","y","z"]);if(!a){e.visible=!1;return}if(o(["i","j","k"]),e.i&&(!e.j||!e.k)||e.j&&(!e.k||!e.i)||e.k&&(!e.i||!e.j)){e.visible=!1;return}var s=u.getComponentMethod("calendars","handleTraceDefaults");s(t,e,["x","y","z"],i),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(v){n(v)});var f=n("contour.show");f&&(n("contour.color"),n("contour.width")),"intensity"in t?(n("intensity"),n("intensitymode"),E(t,e,i,n,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?n("facecolor"):"vertexcolor"in t?n("vertexcolor"):n("color",r)),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),e._length=null}}),rE=Vt((K,V)=>{var u=ih();V.exports=function(d,E){E.intensity&&u(d,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}),nE=Vt((K,V)=>{var u=Bf().gl_mesh3d,d=Bf().delaunay_triangulate,E=Bf().alpha_shape,A=Bf().convex_hull,t=Vp().parseColorScale,e=Xr().isArrayOrTypedArray,r=Up(),i=xu().extractOpts,n=Gm();function o(l,x,y){this.scene=l,this.uid=y,this.mesh=x,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var a=o.prototype;a.handlePick=function(l){if(l.object===this.mesh){var x=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[x],this.data.y[x],this.data.z[x]];var y=this.data.hovertext||this.data.text;return e(y)&&y[x]!==void 0?l.textLabel=y[x]:y&&(l.textLabel=y),!0}};function s(l){for(var x=[],y=l.length,S=0;S=x-.5)return!1;return!0}a.update=function(l){var x=this.scene,y=x.fullSceneLayout;this.data=l;var S=l.x.length,k=n(f(y.xaxis,l.x,x.dataScale[0],l.xcalendar),f(y.yaxis,l.y,x.dataScale[1],l.ycalendar),f(y.zaxis,l.z,x.dataScale[2],l.zcalendar)),M;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!m(l.i,S)||!m(l.j,S)||!m(l.k,S))return;M=n(v(l.i),v(l.j),v(l.k))}else l.alphahull===0?M=A(k):l.alphahull>0?M=E(l.alphahull,k):M=g(l.delaunayaxis,k);var T={positions:k,cells:M,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var c=i(l);this.color="#fff";var h=l.intensitymode;T[h+"Intensity"]=l.intensity,T[h+"IntensityBounds"]=[c.min,c.max],T.colormap=t(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],T.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],T.cellColors=s(l.facecolor)):(this.color=l.color,T.meshColor=r(l.color));this.mesh.update(T)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function w(l,x){var y=l.glplot.gl,S=u({gl:y}),k=new o(l,S,x.uid);return S._trace=k,k.update(x),l.glplot.add(S),k}V.exports=w}),aE=Vt((K,V)=>{V.exports={attributes:Wm(),supplyDefaults:eE(),calc:rE(),colorbar:{min:"cmin",max:"cmax"},plot:nE(),moduleType:"trace",name:"mesh3d",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),iE=Vt((K,V)=>{V.exports=aE()}),L3=Vt((K,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Wm(),e=kl(),r=So().extendFlat,i={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:E({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:A({editType:"calc"}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(i,u("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){i[o]=t[o]}),i.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=i}),oE=Vt((K,V)=>{var u=Xr(),d=vf(),E=L3();V.exports=function(A,t,e,r){function i(m,w){return u.coerce(A,t,E,m,w)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),f=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!f||!f.length||!v||!v.length){t.visible=!1;return}var g=i("sizemode");i("sizeref",g==="raw"?1:.5),i("anchor"),i("lighting.ambient"),i("lighting.diffuse"),i("lighting.specular"),i("lighting.roughness"),i("lighting.fresnel"),i("lightposition.x"),i("lightposition.y"),i("lightposition.z"),d(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),sE=Vt((K,V)=>{var u=ih();V.exports=function(d,E){for(var A=E.u,t=E.v,e=E.w,r=Math.min(E.x.length,E.y.length,E.z.length,A.length,t.length,e.length),i=-1/0,n=1/0,o=0;o{var u=Bf().gl_cone3d,d=Bf().gl_cone3d.createConeMesh,E=Xr().simpleMap,A=Vp().parseColorScale,t=xu().extractOpts,e=Xr().isArrayOrTypedArray,r=Gm();function i(g,m){this.scene=g,this.uid=m,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(g){if(g.object===this.mesh){var m=g.index=g.data.index,w=this.data.x[m],l=this.data.y[m],x=this.data.z[m],y=this.data.u[m],S=this.data.v[m],k=this.data.w[m];g.traceCoordinate=[w,l,x,y,S,k,Math.sqrt(y*y+S*S+k*k)];var M=this.data.hovertext||this.data.text;return e(M)&&M[m]!==void 0?g.textLabel=M[m]:M&&(g.textLabel=M),!0}};var o={xaxis:0,yaxis:1,zaxis:2},a={tip:1,tail:0,cm:.25,center:.5},s={tip:1,tail:1,cm:.75,center:.5};function f(g,m){var w=g.fullSceneLayout,l=g.dataScale,x={};function y(c,h){var b=w[h],_=l[o[h]];return E(c,function(P){return b.d2l(P)*_})}x.vectors=r(y(m.u,"xaxis"),y(m.v,"yaxis"),y(m.w,"zaxis"),m._len),x.positions=r(y(m.x,"xaxis"),y(m.y,"yaxis"),y(m.z,"zaxis"),m._len);var S=t(m);x.colormap=A(m),x.vertexIntensityBounds=[S.min/m._normMax,S.max/m._normMax],x.coneOffset=a[m.anchor];var k=m.sizemode;k==="scaled"?x.coneSize=m.sizeref||.5:k==="absolute"?x.coneSize=m.sizeref&&m._normMax?m.sizeref/m._normMax:.5:k==="raw"&&(x.coneSize=m.sizeref),x.coneSizemode=k;var M=u(x),T=m.lightposition;return M.lightPosition=[T.x,T.y,T.z],M.ambient=m.lighting.ambient,M.diffuse=m.lighting.diffuse,M.specular=m.lighting.specular,M.roughness=m.lighting.roughness,M.fresnel=m.lighting.fresnel,M.opacity=m.opacity,m._pad=s[m.anchor]*M.vectorScale*M.coneScale*m._normMax,M}n.update=function(g){this.data=g;var m=f(this.scene,g);this.mesh.update(m)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function v(g,m){var w=g.glplot.gl,l=f(g,m),x=d(w,l),y=new i(g,m.uid);return y.mesh=x,y.data=m,x._trace=y,g.glplot.add(x),y}V.exports=v}),uE=Vt((K,V)=>{V.exports={moduleType:"trace",name:"cone",basePlotModule:Nd(),categories:["gl3d","showLegend"],attributes:L3(),supplyDefaults:oE(),colorbar:{min:"cmin",max:"cmax"},calc:sE(),plot:lE(),eventData:function(u,d){return u.norm=d.traceCoordinate[6],u},meta:{}}}),cE=Vt((K,V)=>{V.exports=uE()}),C3=Vt((K,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=Wm(),e=kl(),r=So().extendFlat,i={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:E({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:A({editType:"calc"}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(i,u("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){i[o]=t[o]}),i.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=i}),fE=Vt((K,V)=>{var u=Xr(),d=vf(),E=C3();V.exports=function(A,t,e,r){function i(g,m){return u.coerce(A,t,E,g,m)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),f=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!f||!f.length||!v||!v.length){t.visible=!1;return}i("starts.x"),i("starts.y"),i("starts.z"),i("maxdisplayed"),i("sizeref"),i("lighting.ambient"),i("lighting.diffuse"),i("lighting.specular"),i("lighting.roughness"),i("lighting.fresnel"),i("lightposition.x"),i("lightposition.y"),i("lightposition.z"),d(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),hE=Vt((K,V)=>{var u=Bf().gl_streamtube3d,d=u.createTubeMesh,E=Xr(),A=Vp().parseColorScale,t=xu().extractOpts,e=Gm(),r={xaxis:0,yaxis:1,zaxis:2};function i(v,g){this.scene=v,this.uid=g,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(v){var g=this.scene.fullSceneLayout,m=this.scene.dataScale;function w(y,S){var k=g[S],M=m[r[S]];return k.l2c(y)/M}if(v.object===this.mesh){var l=v.data.position,x=v.data.velocity;return v.traceCoordinate=[w(l[0],"xaxis"),w(l[1],"yaxis"),w(l[2],"zaxis"),w(x[0],"xaxis"),w(x[1],"yaxis"),w(x[2],"zaxis"),v.data.intensity*this.data._normMax,v.data.divergence],v.textLabel=this.data.hovertext||this.data.text,!0}};function o(v){var g=v.length,m;return g>2?m=v.slice(1,g-1):g===2?m=[(v[0]+v[1])/2]:m=v,m}function a(v){var g=v.length;return g===1?[.5,.5]:[v[1]-v[0],v[g-1]-v[g-2]]}function s(v,g){var m=v.fullSceneLayout,w=v.dataScale,l=g._len,x={};function y(et,Z){var ot=m[Z],X=w[r[Z]];return E.simpleMap(et,function(Q){return ot.d2l(Q)*X})}if(x.vectors=e(y(g._u,"xaxis"),y(g._v,"yaxis"),y(g._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=y(g._Xs,"xaxis"),k=y(g._Ys,"yaxis"),M=y(g._Zs,"zaxis");x.meshgrid=[S,k,M],x.gridFill=g._gridFill;var T=g._slen;if(T)x.startingPositions=e(y(g._startsX,"xaxis"),y(g._startsY,"yaxis"),y(g._startsZ,"zaxis"));else{for(var c=k[0],h=o(S),b=o(M),_=new Array(h.length*b.length),P=0,z=0;z{V.exports={moduleType:"trace",name:"streamtube",basePlotModule:Nd(),categories:["gl3d","showLegend"],attributes:C3(),supplyDefaults:fE(),colorbar:{min:"cmin",max:"cmax"},calc:Ax().calc,plot:hE(),eventData:function(u,d){return u.tubex=u.x,u.tubey=u.y,u.tubez=u.z,u.tubeu=d.traceCoordinate[3],u.tubev=d.traceCoordinate[4],u.tubew=d.traceCoordinate[5],u.norm=d.traceCoordinate[6],u.divergence=d.traceCoordinate[7],delete u.x,delete u.y,delete u.z,u},meta:{}}}),dE=Vt((K,V)=>{V.exports=pE()}),E0=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Qh(),t=pc(),e=kl(),r=Wl(),i=If().dash,n=So().extendFlat,o=Cu().overrideAll,a=t.marker,s=t.line,f=a.line;V.exports=o({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:n({},t.hovertext,{}),textfont:t.textfont,textposition:t.textposition,line:{color:s.color,width:s.width,dash:i},connectgaps:t.connectgaps,marker:n({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:n({},a.angleref,{values:["previous","up","north"]}),standoff:a.standoff,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,colorbar:a.colorbar,line:n({width:f.width},r("marker.line")),gradient:a.gradient},r("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:A(),selected:t.selected,unselected:t.unselected,hoverinfo:n({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),mE=Vt((K,V)=>{var u=Xr(),d=nu(),E=Ch(),A=Rh(),t=Nh(),e=ep(),r=E0(),i=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");V.exports=function(n,o,a,s){function f(S,k){return u.coerce(n,o,r,S,k)}var v=f("locations"),g;if(v&&v.length){var m=f("geojson"),w;(typeof m=="string"&&m!==""||u.isPlainObject(m))&&(w="geojson-id");var l=f("locationmode",w);l==="country names"&&u.warn(i),l==="geojson-id"&&f("featureidkey"),g=v.length}else{var x=f("lon")||[],y=f("lat")||[];g=Math.min(x.length,y.length)}if(!g){o.visible=!1;return}o._length=g,f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),d.hasMarkers(o)&&E(n,o,a,s,f,{gradient:!0}),d.hasLines(o)&&(A(n,o,a,s,f),f("connectgaps")),d.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),t(n,o,s,f)),f("fill"),o.fill!=="none"&&e(n,o,a,f),u.coerceSelectionMarkerOpacity(o,f)}}),gE=Vt((K,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.geo]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),Sx=Vt((K,V)=>{var u=Lo(),d=ks().BADNUM,E=jh(),A=vp(),t=Uh(),e=Xr().isArrayOrTypedArray,r=Xr()._;function i(n){return n&&typeof n=="string"}V.exports=function(n,o){var a=e(o.locations),s=a?o.locations.length:o._length,f=new Array(s),v;o.geojson?v=function(y){return i(y)||u(y)}:v=i;for(var g=0;g{K.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},K.axesNames=["lonaxis","lataxis"],K.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},K.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},K.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},K.clipPad=.001,K.precision=.1,K.landColor="#F0DC82",K.waterColor="#3399FF",K.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},K.sphereSVG={type:"Sphere"},K.fillLayers={ocean:1,land:1,lakes:1},K.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},K.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],K.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],K.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),I3=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.topojson=u.topojson||{}))})(K,function(u){function d(y){return y}function E(y){if(y==null)return d;var S,k,M=y.scale[0],T=y.scale[1],c=y.translate[0],h=y.translate[1];return function(b,_){_||(S=k=0);var P=2,z=b.length,D=new Array(z);for(D[0]=(S+=b[0])*M+c,D[1]=(k+=b[1])*T+h;Pc&&(c=P[0]),P[1]h&&(h=P[1])}function _(P){switch(P.type){case"GeometryCollection":P.geometries.forEach(_);break;case"Point":b(P.coordinates);break;case"MultiPoint":P.coordinates.forEach(b);break}}y.arcs.forEach(function(P){for(var z=-1,D=P.length,B;++zc&&(c=B[0]),B[1]h&&(h=B[1])});for(k in y.objects)_(y.objects[k]);return[M,T,c,h]}function t(y,S){for(var k,M=y.length,T=M-S;T<--M;)k=y[T],y[T++]=y[M],y[M]=k}function e(y,S){return typeof S=="string"&&(S=y.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(k){return r(y,k)})}:r(y,S)}function r(y,S){var k=S.id,M=S.bbox,T=S.properties==null?{}:S.properties,c=i(y,S);return k==null&&M==null?{type:"Feature",properties:T,geometry:c}:M==null?{type:"Feature",id:k,properties:T,geometry:c}:{type:"Feature",id:k,bbox:M,properties:T,geometry:c}}function i(y,S){var k=E(y.transform),M=y.arcs;function T(z,D){D.length&&D.pop();for(var B=M[z<0?~z:z],R=0,I=B.length;R1)M=s(y,S,k);else for(T=0,M=new Array(c=y.arcs.length);T1)for(var D=1,B=b(P[0]),R,I;DB&&(I=P[0],P[0]=P[D],P[D]=I,B=R);return P}).filter(function(_){return _.length>0})}}function m(y,S){for(var k=0,M=y.length;k>>1;y[T]=2))throw new Error("n must be ≥2");_=y.bbox||A(y);var k=_[0],M=_[1],T=_[2],c=_[3],h;S={scale:[T-k?(T-k)/(h-1):1,c-M?(c-M)/(h-1):1],translate:[k,M]}}else _=y.bbox;var b=l(S),_,P,z=y.objects,D={};function B(F){return b(F)}function R(F){var j;switch(F.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:F.geometries.map(R)};break;case"Point":j={type:"Point",coordinates:B(F.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:F.coordinates.map(B)};break;default:return F}return F.id!=null&&(j.id=F.id),F.bbox!=null&&(j.bbox=F.bbox),F.properties!=null&&(j.properties=F.properties),j}function I(F){var j=0,N=1,G=F.length,rt,ct=new Array(G);for(ct[0]=b(F[0],0);++j{var u=V.exports={},d=Mv().locationmodeToLayer,E=I3().feature;u.getTopojsonName=function(A){return[A.scope.replace(/ /g,"-"),"_",A.resolution.toString(),"m"].join("")},u.getTopojsonPath=function(A,t){return A+=A.endsWith("/")?"":"/",`${A}${t}.json`},u.getTopojsonFeatures=function(A,t){var e=d[A.locationmode],r=t.objects[e];return E(t,r).features}}),jd=Vt(K=>{var V=ks().BADNUM;K.calcTraceToLineCoords=function(u){for(var d=u[0].trace,E=d.connectgaps,A=[],t=[],e=0;e0&&(A.push(t),t=[])}return t.length>0&&A.push(t),A},K.makeLine=function(u){return u.length===1?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u}},K.makePolygon=function(u){if(u.length===1)return{type:"Polygon",coordinates:u};for(var d=new Array(u.length),E=0;E{V.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),zx=Vt(K=>{Object.defineProperty(K,"__esModule",{value:!0});var V=63710088e-1,u={centimeters:V*100,centimetres:V*100,degrees:360/(2*Math.PI),feet:V*3.28084,inches:V*39.37,kilometers:V/1e3,kilometres:V/1e3,meters:V,metres:V,miles:V/1609.344,millimeters:V*1e3,millimetres:V*1e3,nauticalmiles:V/1852,radians:1,yards:V*1.0936},d={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function E(z,D,B={}){let R={type:"Feature"};return(B.id===0||B.id)&&(R.id=B.id),B.bbox&&(R.bbox=B.bbox),R.properties=D||{},R.geometry=z,R}function A(z,D,B={}){switch(z){case"Point":return t(D).geometry;case"LineString":return n(D).geometry;case"Polygon":return r(D).geometry;case"MultiPoint":return f(D).geometry;case"MultiLineString":return s(D).geometry;case"MultiPolygon":return v(D).geometry;default:throw new Error(z+" is invalid")}}function t(z,D,B={}){if(!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(z[0])||!h(z[1]))throw new Error("coordinates must contain numbers");return E({type:"Point",coordinates:z},D,B)}function e(z,D,B={}){return a(z.map(R=>t(R,D)),B)}function r(z,D,B={}){for(let R of z){if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(R[R.length-1].length!==R[0].length)throw new Error("First and last Position are not equivalent.");for(let I=0;Ir(R,D)),B)}function n(z,D,B={}){if(z.length<2)throw new Error("coordinates must be an array of two or more positions");return E({type:"LineString",coordinates:z},D,B)}function o(z,D,B={}){return a(z.map(R=>n(R,D)),B)}function a(z,D={}){let B={type:"FeatureCollection"};return D.id&&(B.id=D.id),D.bbox&&(B.bbox=D.bbox),B.features=z,B}function s(z,D,B={}){return E({type:"MultiLineString",coordinates:z},D,B)}function f(z,D,B={}){return E({type:"MultiPoint",coordinates:z},D,B)}function v(z,D,B={}){return E({type:"MultiPolygon",coordinates:z},D,B)}function g(z,D,B={}){return E({type:"GeometryCollection",geometries:z},D,B)}function m(z,D=0){if(D&&!(D>=0))throw new Error("precision must be a positive number");let B=Math.pow(10,D||0);return Math.round(z*B)/B}function w(z,D="kilometers"){let B=u[D];if(!B)throw new Error(D+" units is invalid");return z*B}function l(z,D="kilometers"){let B=u[D];if(!B)throw new Error(D+" units is invalid");return z/B}function x(z,D){return k(l(z,D))}function y(z){let D=z%360;return D<0&&(D+=360),D}function S(z){return z=z%360,z>180?z-360:z<-180?z+360:z}function k(z){return z%(2*Math.PI)*180/Math.PI}function M(z){return z%360*Math.PI/180}function T(z,D="kilometers",B="kilometers"){if(!(z>=0))throw new Error("length must be a positive number");return w(l(z,D),B)}function c(z,D="meters",B="kilometers"){if(!(z>=0))throw new Error("area must be a positive number");let R=d[D];if(!R)throw new Error("invalid original units");let I=d[B];if(!I)throw new Error("invalid final units");return z/R*I}function h(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function b(z){return z!==null&&typeof z=="object"&&!Array.isArray(z)}function _(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(D=>{if(!h(D))throw new Error("bbox must only contain numbers")})}function P(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}K.areaFactors=d,K.azimuthToBearing=S,K.bearingToAzimuth=y,K.convertArea=c,K.convertLength=T,K.degreesToRadians=M,K.earthRadius=V,K.factors=u,K.feature=E,K.featureCollection=a,K.geometry=A,K.geometryCollection=g,K.isNumber=h,K.isObject=b,K.lengthToDegrees=x,K.lengthToRadians=l,K.lineString=n,K.lineStrings=o,K.multiLineString=s,K.multiPoint=f,K.multiPolygon=v,K.point=t,K.points=e,K.polygon=r,K.polygons=i,K.radiansToDegrees=k,K.radiansToLength=w,K.round=m,K.validateBBox=_,K.validateId=P}),Lx=Vt(K=>{Object.defineProperty(K,"__esModule",{value:!0});var V=zx();function u(l,x,y){if(l!==null)for(var S,k,M,T,c,h,b,_=0,P=0,z,D=l.type,B=D==="FeatureCollection",R=D==="Feature",I=B?l.features.length:1,F=0;Fh||B>b||R>_){c=P,h=S,b=B,_=R,M=0;return}var I=V.lineString.call(void 0,[c,P],y.properties);if(x(I,S,k,R,M)===!1)return!1;M++,c=P})===!1)return!1}}})}function f(l,x,y){var S=y,k=!1;return s(l,function(M,T,c,h,b){k===!1&&y===void 0?S=M:S=x(S,M,T,c,h,b),k=!0}),S}function v(l,x){if(!l)throw new Error("geojson is required");o(l,function(y,S,k){if(y.geometry!==null){var M=y.geometry.type,T=y.geometry.coordinates;switch(M){case"LineString":if(x(y,S,k,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c{Object.defineProperty(K,"__esModule",{value:!0});var V=zx(),u=Lx();function d(n){return u.geomReduce.call(void 0,n,(o,a)=>o+E(a),0)}function E(n){let o=0,a;switch(n.type){case"Polygon":return A(n.coordinates);case"MultiPolygon":for(a=0;a0){o+=Math.abs(r(n[0]));for(let a=1;a=o?(s+2)%o:s+2],m=f[0]*e,w=v[1]*e,l=g[0]*e;a+=(l-m)*Math.sin(w),s++}return a*t}var i=d;K.area=d,K.default=i}),xE=Vt(K=>{Object.defineProperty(K,"__esModule",{value:!0});var V=zx(),u=Lx();function d(A,t={}){let e=0,r=0,i=0;return u.coordEach.call(void 0,A,function(n){e+=n[0],r+=n[1],i++},!0),V.point.call(void 0,[e/i,r/i],t.properties)}var E=d;K.centroid=d,K.default=E}),_E=Vt(K=>{Object.defineProperty(K,"__esModule",{value:!0});var V=Lx();function u(E,A={}){if(E.bbox!=null&&A.recompute!==!0)return E.bbox;let t=[1/0,1/0,-1/0,-1/0];return V.coordEach.call(void 0,E,e=>{t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]{var u=Ni(),d=vE(),{area:E}=yE(),{centroid:A}=xE(),{bbox:t}=_E(),e=Og(),r=bd(),i=Dp(),n=Lg(),o=jg(),a=Object.keys(d),s={"ISO-3":e,"USA-states":e,"country names":f};function f(S){for(var k=0;k0&&D[B+1][0]<0)return B;return null}switch(T==="RUS"||T==="FJI"?h=function(D){var B;if(z(D)===null)B=D;else for(B=new Array(D.length),P=0;PB?R[I++]=[D[P][0]+360,D[P][1]]:P===B?(R[I++]=D[P],R[I++]=[D[P][0],-90]):R[I++]=D[P];var F=o.tester(R);F.pts.pop(),c.push(F)}:h=function(D){c.push(o.tester(D))},k.type){case"MultiPolygon":for(b=0;b0?F.properties.ct=l(F):F.properties.ct=[NaN,NaN],R.fIn=D,R.fOut=F,c.push(F)}else r.log(["Location",R.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete T[B]}switch(M.type){case"FeatureCollection":var P=M.features;for(h=0;hc&&(c=_,M=b)}else M=k;return A(M).geometry.coordinates}function x(S){var k=window.PlotlyGeoAssets||{},M=[];function T(P){return new Promise(function(z,D){u.json(P,function(B,R){if(B){delete k[P];var I=B.status===404?'GeoJSON at URL "'+P+'" does not exist.':"Unexpected error while fetching from "+P;return D(new Error(I))}return k[P]=R,z(R)})})}function c(P){return new Promise(function(z,D){var B=0,R=setInterval(function(){if(k[P]&&k[P]!=="pending")return clearInterval(R),z(k[P]);if(B>100)return clearInterval(R),D("Unexpected error while fetching from "+P);B++},50)})}for(var h=0;h{var u=Ni(),d=Eo(),E=Pi(),A=gh(),t=A.stylePoints,e=A.styleText;V.exports=function(i,n){n&&r(i,n)};function r(i,n){var o=n[0].trace,a=n[0].node3;a.style("opacity",n[0].trace.opacity),t(a,o,i),e(a,o,i),a.selectAll("path.js-line").style("fill","none").each(function(s){var f=u.select(this),v=s.trace,g=v.line||{};f.call(E.stroke,g.color).call(d.dashLine,g.dash||"",g.width||0),v.fill!=="none"&&f.call(E.fill,v.fillcolor)})}}),O3=Vt((K,V)=>{var u=Ni(),d=Xr(),E=Ex().getTopojsonFeatures,A=jd(),t=Ud(),e=Xh().findExtremes,r=ks().BADNUM,i=Vh().calcMarkerSize,n=nu(),o=P3();function a(f,v,g){var m=v.layers.frontplot.select(".scatterlayer"),w=d.makeTraceGroups(m,g,"trace scattergeo");function l(x,y){x.lonlat[0]===r&&u.select(y).remove()}w.selectAll("*").remove(),w.each(function(x){var y=u.select(this),S=x[0].trace;if(n.hasLines(S)||S.fill!=="none"){var k=A.calcTraceToLineCoords(x),M=S.fill!=="none"?A.makePolygon(k):A.makeLine(k);y.selectAll("path.js-line").data([{geojson:M,trace:S}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}n.hasMarkers(S)&&y.selectAll("path.point").data(d.identity).enter().append("path").classed("point",!0).each(function(T){l(T,this)}),n.hasText(S)&&y.selectAll("g").data(d.identity).enter().append("g").append("text").each(function(T){l(T,this)}),o(f,x)})}function s(f,v){var g=f[0].trace,m=v[g.geo],w=m._subplot,l=g._length,x,y;if(d.isArrayOrTypedArray(g.locations)){var S=g.locationmode,k=S==="geojson-id"?t.extractTraceFeature(f):E(g,w.topojson);for(x=0;x{var u=hc(),d=ks().BADNUM,E=Sm(),A=Xr().fillText,t=E0();V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.xa,f=r.ya,v=r.subplot,g=v.projection.isLonLatOverEdges,m=v.project;function w(T){var c=T.lonlat;if(c[0]===d||g(c))return 1/0;var h=m(c),b=m([i,n]),_=Math.abs(h[0]-b[0]),P=Math.abs(h[1]-b[1]),z=Math.max(3,T.mrc||0);return Math.max(Math.sqrt(_*_+P*P)-z,1-3/z)}if(u.getClosest(o,w,r),r.index!==!1){var l=o[r.index],x=l.lonlat,y=[s.c2p(x),f.c2p(x)],S=l.mrc||1;r.x0=y[0]-S,r.x1=y[0]+S,r.y0=y[1]-S,r.y1=y[1]+S,r.loc=l.loc,r.lon=x[0],r.lat=x[1];var k={};k[a.geo]={_subplot:v};var M=a._module.formatLabels(l,a,k);return r.lonLabel=M.lonLabel,r.latLabel=M.latLabel,r.color=E(a,l),r.extraText=e(a,l,r,o[0].t.labels),r.hovertemplate=a.hovertemplate,[r]}};function e(r,i,n,o){if(r.hovertemplate)return;var a=i.hi||r.hoverinfo,s=a==="all"?t.hoverinfo.flags:a.split("+"),f=s.indexOf("location")!==-1&&Array.isArray(r.locations),v=s.indexOf("lon")!==-1,g=s.indexOf("lat")!==-1,m=s.indexOf("text")!==-1,w=[];function l(x){return x+"°"}return f?w.push(i.loc):v&&g?w.push("("+l(n.latLabel)+", "+l(n.lonLabel)+")"):v?w.push(o.lon+l(n.lonLabel)):g&&w.push(o.lat+l(n.latLabel)),m&&A(i,r,w),w.join("
                ")}}),wE=Vt((K,V)=>{V.exports=function(u,d,E,A,t){u.lon=d.lon,u.lat=d.lat,u.location=d.loc?d.loc:null;var e=A[t];return e.fIn&&e.fIn.properties&&(u.properties=e.fIn.properties),u}}),TE=Vt((K,V)=>{var u=nu(),d=ks().BADNUM;V.exports=function(E,A){var t=E.cd,e=E.xaxis,r=E.yaxis,i=[],n=t[0].trace,o,a,s,f,v,g=!u.hasMarkers(n)&&!u.hasText(n);if(g)return[];if(A===!1)for(v=0;v{(function(u,d){d(typeof K=="object"&&typeof V<"u"?K:u.d3=u.d3||{})})(K,function(u){function d(X,Q){return XQ?1:X>=Q?0:NaN}function E(X){return X.length===1&&(X=A(X)),{left:function(Q,ut,J,q){for(J==null&&(J=0),q==null&&(q=Q.length);J>>1;X(Q[it],ut)<0?J=it+1:q=it}return J},right:function(Q,ut,J,q){for(J==null&&(J=0),q==null&&(q=Q.length);J>>1;X(Q[it],ut)>0?q=it:J=it+1}return J}}}function A(X){return function(Q,ut){return d(X(Q),ut)}}var t=E(d),e=t.right,r=t.left;function i(X,Q){Q==null&&(Q=n);for(var ut=0,J=X.length-1,q=X[0],it=new Array(J<0?0:J);utX?1:Q>=X?0:NaN}function s(X){return X===null?NaN:+X}function f(X,Q){var ut=X.length,J=0,q=-1,it=0,nt,dt,Tt=0;if(Q==null)for(;++q1)return Tt/(J-1)}function v(X,Q){var ut=f(X,Q);return ut&&Math.sqrt(ut)}function g(X,Q){var ut=X.length,J=-1,q,it,nt;if(Q==null){for(;++J=q)for(it=nt=q;++Jq&&(it=q),nt=q)for(it=nt=q;++Jq&&(it=q),nt0)return[X];if((J=Q0)for(X=Math.ceil(X/dt),Q=Math.floor(Q/dt),nt=new Array(it=Math.ceil(Q-X+1));++q=0?(it>=k?10:it>=M?5:it>=T?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(it>=k?10:it>=M?5:it>=T?2:1)}function b(X,Q,ut){var J=Math.abs(Q-X)/Math.max(0,ut),q=Math.pow(10,Math.floor(Math.log(J)/Math.LN10)),it=J/q;return it>=k?q*=10:it>=M?q*=5:it>=T&&(q*=2),QIt;)Nt.pop(),--te;var Jt=new Array(te+1),ee;for(it=0;it<=te;++it)ee=Jt[it]=[],ee.x0=it>0?Nt[it-1]:Ct,ee.x1=it=1)return+ut(X[J-1],J-1,X);var J,q=(J-1)*Q,it=Math.floor(q),nt=+ut(X[it],it,X),dt=+ut(X[it+1],it+1,X);return nt+(dt-nt)*(q-it)}}function D(X,Q,ut){return X=l.call(X,s).sort(d),Math.ceil((ut-Q)/(2*(z(X,.75)-z(X,.25))*Math.pow(X.length,-1/3)))}function B(X,Q,ut){return Math.ceil((ut-Q)/(3.5*v(X)*Math.pow(X.length,-1/3)))}function R(X,Q){var ut=X.length,J=-1,q,it;if(Q==null){for(;++J=q)for(it=q;++Jit&&(it=q)}else for(;++J=q)for(it=q;++Jit&&(it=q);return it}function I(X,Q){var ut=X.length,J=ut,q=-1,it,nt=0;if(Q==null)for(;++q=0;)for(nt=X[Q],ut=nt.length;--ut>=0;)it[--q]=nt[ut];return it}function N(X,Q){var ut=X.length,J=-1,q,it;if(Q==null){for(;++J=q)for(it=q;++Jq&&(it=q)}else for(;++J=q)for(it=q;++Jq&&(it=q);return it}function G(X,Q){for(var ut=Q.length,J=new Array(ut);ut--;)J[ut]=X[Q[ut]];return J}function rt(X,Q){if(ut=X.length){var ut,J=0,q=0,it,nt=X[q];for(Q==null&&(Q=d);++J{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Sv()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(K,function(u,d){function E(){return new A}function A(){this.reset()}A.prototype={constructor:A,reset:function(){this.s=this.t=0},add:function(Xe){e(t,Xe,this.t),e(this,t.s,this.s),this.s?this.t+=t.t:this.s=t.t},valueOf:function(){return this.s}};var t=new A;function e(Xe,yr,Kr){var Rr=Xe.s=yr+Kr,mn=Rr-yr,Pn=Rr-mn;Xe.t=yr-Pn+(Kr-mn)}var r=1e-6,i=1e-12,n=Math.PI,o=n/2,a=n/4,s=n*2,f=180/n,v=n/180,g=Math.abs,m=Math.atan,w=Math.atan2,l=Math.cos,x=Math.ceil,y=Math.exp,S=Math.log,k=Math.pow,M=Math.sin,T=Math.sign||function(Xe){return Xe>0?1:Xe<0?-1:0},c=Math.sqrt,h=Math.tan;function b(Xe){return Xe>1?0:Xe<-1?n:Math.acos(Xe)}function _(Xe){return Xe>1?o:Xe<-1?-o:Math.asin(Xe)}function P(Xe){return(Xe=M(Xe/2))*Xe}function z(){}function D(Xe,yr){Xe&&R.hasOwnProperty(Xe.type)&&R[Xe.type](Xe,yr)}var B={Feature:function(Xe,yr){D(Xe.geometry,yr)},FeatureCollection:function(Xe,yr){for(var Kr=Xe.features,Rr=-1,mn=Kr.length;++Rr=0?1:-1,mn=Rr*Kr,Pn=l(yr),ha=M(yr),Ta=Z*ha,Ua=et*Pn+Ta*l(mn),Ya=Ta*Rr*M(mn);N.add(w(Ya,Ua)),st=Xe,et=Pn,Z=ha}function q(Xe){return G.reset(),j(Xe,ot),G*2}function it(Xe){return[w(Xe[1],Xe[0]),_(Xe[2])]}function nt(Xe){var yr=Xe[0],Kr=Xe[1],Rr=l(Kr);return[Rr*l(yr),Rr*M(yr),M(Kr)]}function dt(Xe,yr){return Xe[0]*yr[0]+Xe[1]*yr[1]+Xe[2]*yr[2]}function Tt(Xe,yr){return[Xe[1]*yr[2]-Xe[2]*yr[1],Xe[2]*yr[0]-Xe[0]*yr[2],Xe[0]*yr[1]-Xe[1]*yr[0]]}function wt(Xe,yr){Xe[0]+=yr[0],Xe[1]+=yr[1],Xe[2]+=yr[2]}function Ct(Xe,yr){return[Xe[0]*yr,Xe[1]*yr,Xe[2]*yr]}function It(Xe){var yr=c(Xe[0]*Xe[0]+Xe[1]*Xe[1]+Xe[2]*Xe[2]);Xe[0]/=yr,Xe[1]/=yr,Xe[2]/=yr}var Nt,te,Jt,ee,Zt,mt,bt,vt,Ut=E(),re,Kt,ue={point:Me,lineStart:We,lineEnd:qe,polygonStart:function(){ue.point=vr,ue.lineStart=_r,ue.lineEnd=er,Ut.reset(),ot.polygonStart()},polygonEnd:function(){ot.polygonEnd(),ue.point=Me,ue.lineStart=We,ue.lineEnd=qe,N<0?(Nt=-(Jt=180),te=-(ee=90)):Ut>r?ee=90:Ut<-r&&(te=-90),Kt[0]=Nt,Kt[1]=Jt},sphere:function(){Nt=-(Jt=180),te=-(ee=90)}};function Me(Xe,yr){re.push(Kt=[Nt=Xe,Jt=Xe]),yree&&(ee=yr)}function Ce(Xe,yr){var Kr=nt([Xe*v,yr*v]);if(vt){var Rr=Tt(vt,Kr),mn=[Rr[1],-Rr[0],0],Pn=Tt(mn,Rr);It(Pn),Pn=it(Pn);var ha=Xe-Zt,Ta=ha>0?1:-1,Ua=Pn[0]*f*Ta,Ya,va=g(ha)>180;va^(Ta*Ztee&&(ee=Ya)):(Ua=(Ua+360)%360-180,va^(Ta*Ztee&&(ee=yr))),va?XeMr(Nt,Jt)&&(Jt=Xe):Mr(Xe,Jt)>Mr(Nt,Jt)&&(Nt=Xe):Jt>=Nt?(XeJt&&(Jt=Xe)):Xe>Zt?Mr(Nt,Xe)>Mr(Nt,Jt)&&(Jt=Xe):Mr(Xe,Jt)>Mr(Nt,Jt)&&(Nt=Xe)}else re.push(Kt=[Nt=Xe,Jt=Xe]);yree&&(ee=yr),vt=Kr,Zt=Xe}function We(){ue.point=Ce}function qe(){Kt[0]=Nt,Kt[1]=Jt,ue.point=Me,vt=null}function vr(Xe,yr){if(vt){var Kr=Xe-Zt;Ut.add(g(Kr)>180?Kr+(Kr>0?360:-360):Kr)}else mt=Xe,bt=yr;ot.point(Xe,yr),Ce(Xe,yr)}function _r(){ot.lineStart()}function er(){vr(mt,bt),ot.lineEnd(),g(Ut)>r&&(Nt=-(Jt=180)),Kt[0]=Nt,Kt[1]=Jt,vt=null}function Mr(Xe,yr){return(yr-=Xe)<0?yr+360:yr}function Ir(Xe,yr){return Xe[0]-yr[0]}function de(Xe,yr){return Xe[0]<=Xe[1]?Xe[0]<=yr&&yr<=Xe[1]:yrMr(Rr[0],Rr[1])&&(Rr[1]=mn[1]),Mr(mn[0],Rr[1])>Mr(Rr[0],Rr[1])&&(Rr[0]=mn[0])):Pn.push(Rr=mn);for(ha=-1/0,Kr=Pn.length-1,yr=0,Rr=Pn[Kr];yr<=Kr;Rr=mn,++yr)mn=Pn[yr],(Ta=Mr(Rr[1],mn[0]))>ha&&(ha=Ta,Nt=mn[0],Jt=Rr[1])}return re=Kt=null,Nt===1/0||te===1/0?[[NaN,NaN],[NaN,NaN]]:[[Nt,te],[Jt,ee]]}var qt,_t,lt,yt,St,Ht,Yt,se,ke,Ee,Ue,ir,ar,Ye,Er,pn,dn={sphere:z,point:bn,lineStart:En,lineEnd:ra,polygonStart:function(){dn.lineStart=Se,dn.lineEnd=Re},polygonEnd:function(){dn.lineStart=En,dn.lineEnd=ra}};function bn(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr);Zn(Kr*l(Xe),Kr*M(Xe),M(yr))}function Zn(Xe,yr,Kr){++qt,lt+=(Xe-lt)/qt,yt+=(yr-yt)/qt,St+=(Kr-St)/qt}function En(){dn.point=gn}function gn(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr);Ye=Kr*l(Xe),Er=Kr*M(Xe),pn=M(yr),dn.point=da,Zn(Ye,Er,pn)}function da(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr),Rr=Kr*l(Xe),mn=Kr*M(Xe),Pn=M(yr),ha=w(c((ha=Er*Pn-pn*mn)*ha+(ha=pn*Rr-Ye*Pn)*ha+(ha=Ye*mn-Er*Rr)*ha),Ye*Rr+Er*mn+pn*Pn);_t+=ha,Ht+=ha*(Ye+(Ye=Rr)),Yt+=ha*(Er+(Er=mn)),se+=ha*(pn+(pn=Pn)),Zn(Ye,Er,pn)}function ra(){dn.point=bn}function Se(){dn.point=Ze}function Re(){tr(ir,ar),dn.point=bn}function Ze(Xe,yr){ir=Xe,ar=yr,Xe*=v,yr*=v,dn.point=tr;var Kr=l(yr);Ye=Kr*l(Xe),Er=Kr*M(Xe),pn=M(yr),Zn(Ye,Er,pn)}function tr(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr),Rr=Kr*l(Xe),mn=Kr*M(Xe),Pn=M(yr),ha=Er*Pn-pn*mn,Ta=pn*Rr-Ye*Pn,Ua=Ye*mn-Er*Rr,Ya=c(ha*ha+Ta*Ta+Ua*Ua),va=_(Ya),Ba=Ya&&-va/Ya;ke+=Ba*ha,Ee+=Ba*Ta,Ue+=Ba*Ua,_t+=va,Ht+=va*(Ye+(Ye=Rr)),Yt+=va*(Er+(Er=mn)),se+=va*(pn+(pn=Pn)),Zn(Ye,Er,pn)}function zr(Xe){qt=_t=lt=yt=St=Ht=Yt=se=ke=Ee=Ue=0,j(Xe,dn);var yr=ke,Kr=Ee,Rr=Ue,mn=yr*yr+Kr*Kr+Rr*Rr;return mnn?Xe+Math.round(-Xe/s)*s:Xe,yr]}$r.invert=$r;function In(Xe,yr,Kr){return(Xe%=s)?yr||Kr?Yr(Kn(Xe),$n(yr,Kr)):Kn(Xe):yr||Kr?$n(yr,Kr):$r}function Nn(Xe){return function(yr,Kr){return yr+=Xe,[yr>n?yr-s:yr<-n?yr+s:yr,Kr]}}function Kn(Xe){var yr=Nn(Xe);return yr.invert=Nn(-Xe),yr}function $n(Xe,yr){var Kr=l(Xe),Rr=M(Xe),mn=l(yr),Pn=M(yr);function ha(Ta,Ua){var Ya=l(Ua),va=l(Ta)*Ya,Ba=M(Ta)*Ya,za=M(Ua),ca=za*Kr+va*Rr;return[w(Ba*mn-ca*Pn,va*Kr-za*Rr),_(ca*mn+Ba*Pn)]}return ha.invert=function(Ta,Ua){var Ya=l(Ua),va=l(Ta)*Ya,Ba=M(Ta)*Ya,za=M(Ua),ca=za*mn-Ba*Pn;return[w(Ba*mn+za*Pn,va*Kr+ca*Rr),_(ca*Kr-va*Rr)]},ha}function ia(Xe){Xe=In(Xe[0]*v,Xe[1]*v,Xe.length>2?Xe[2]*v:0);function yr(Kr){return Kr=Xe(Kr[0]*v,Kr[1]*v),Kr[0]*=f,Kr[1]*=f,Kr}return yr.invert=function(Kr){return Kr=Xe.invert(Kr[0]*v,Kr[1]*v),Kr[0]*=f,Kr[1]*=f,Kr},yr}function Cn(Xe,yr,Kr,Rr,mn,Pn){if(Kr){var ha=l(yr),Ta=M(yr),Ua=Rr*Kr;mn==null?(mn=yr+Rr*s,Pn=yr-Ua/2):(mn=Fa(ha,mn),Pn=Fa(ha,Pn),(Rr>0?mnPn)&&(mn+=Rr*s));for(var Ya,va=mn;Rr>0?va>Pn:va1&&Xe.push(Xe.pop().concat(Xe.shift()))},result:function(){var Kr=Xe;return Xe=[],yr=null,Kr}}}function ge(Xe,yr){return g(Xe[0]-yr[0])=0;--Ta)mn.point((Ba=va[Ta])[0],Ba[1]);else Rr(za.x,za.p.x,-1,mn);za=za.p}za=za.o,va=za.z,ca=!ca}while(!za.v);mn.lineEnd()}}}function Tr(Xe){if(yr=Xe.length){for(var yr,Kr=0,Rr=Xe[0],mn;++Kr=0?1:-1,ys=Ps*ss,Os=ys>n,Yo=Vi*$i;if(mr.add(w(Yo*Ps*M(ys),Oi*Do+Yo*l(ys))),ha+=Os?ss+Ps*s:ss,Os^ca>=Kr^ni>=Kr){var ll=Tt(nt(za),nt(Xi));It(ll);var el=Tt(Pn,ll);It(el);var Rs=(Os^ss>=0?-1:1)*_(el[2]);(Rr>Rs||Rr===Rs&&(ll[0]||ll[1]))&&(Ta+=Os^ss>=0?1:-1)}}return(ha<-r||ha0){for(Ua||(mn.polygonStart(),Ua=!0),mn.lineStart(),Do=0;Do1&&Za&2&&$i.push($i.pop().concat($i.shift())),va.push($i.filter(pe))}}return za}}function pe(Xe){return Xe.length>1}function Ke(Xe,yr){return((Xe=Xe.x)[0]<0?Xe[1]-o-r:o-Xe[1])-((yr=yr.x)[0]<0?yr[1]-o-r:o-yr[1])}var xr=Or(function(){return!0},Gr,wn,[-n,-o]);function Gr(Xe){var yr=NaN,Kr=NaN,Rr=NaN,mn;return{lineStart:function(){Xe.lineStart(),mn=1},point:function(Pn,ha){var Ta=Pn>0?n:-n,Ua=g(Pn-yr);g(Ua-n)0?o:-o),Xe.point(Rr,Kr),Xe.lineEnd(),Xe.lineStart(),Xe.point(Ta,Kr),Xe.point(Pn,Kr),mn=0):Rr!==Ta&&Ua>=n&&(g(yr-Rr)r?m((M(yr)*(Pn=l(Rr))*M(Kr)-M(Rr)*(mn=l(yr))*M(Xe))/(mn*Pn*ha)):(yr+Rr)/2}function wn(Xe,yr,Kr,Rr){var mn;if(Xe==null)mn=Kr*o,Rr.point(-n,mn),Rr.point(0,mn),Rr.point(n,mn),Rr.point(n,0),Rr.point(n,-mn),Rr.point(0,-mn),Rr.point(-n,-mn),Rr.point(-n,0),Rr.point(-n,mn);else if(g(Xe[0]-yr[0])>r){var Pn=Xe[0]0,mn=g(yr)>r;function Pn(va,Ba,za,ca){Cn(ca,Xe,Kr,za,va,Ba)}function ha(va,Ba){return l(va)*l(Ba)>yr}function Ta(va){var Ba,za,ca,ei,Vi;return{lineStart:function(){ei=ca=!1,Vi=1},point:function(Oi,Wi){var Xi=[Oi,Wi],ni,Za=ha(Oi,Wi),$i=Rr?Za?0:Ya(Oi,Wi):Za?Ya(Oi+(Oi<0?n:-n),Wi):0;if(!Ba&&(ei=ca=Za)&&va.lineStart(),Za!==ca&&(ni=Ua(Ba,Xi),(!ni||ge(Ba,ni)||ge(Xi,ni))&&(Xi[2]=1)),Za!==ca)Vi=0,Za?(va.lineStart(),ni=Ua(Xi,Ba),va.point(ni[0],ni[1])):(ni=Ua(Ba,Xi),va.point(ni[0],ni[1],2),va.lineEnd()),Ba=ni;else if(mn&&Ba&&Rr^Za){var Do;!($i&za)&&(Do=Ua(Xi,Ba,!0))&&(Vi=0,Rr?(va.lineStart(),va.point(Do[0][0],Do[0][1]),va.point(Do[1][0],Do[1][1]),va.lineEnd()):(va.point(Do[1][0],Do[1][1]),va.lineEnd(),va.lineStart(),va.point(Do[0][0],Do[0][1],3)))}Za&&(!Ba||!ge(Ba,Xi))&&va.point(Xi[0],Xi[1]),Ba=Xi,ca=Za,za=$i},lineEnd:function(){ca&&va.lineEnd(),Ba=null},clean:function(){return Vi|(ei&&ca)<<1}}}function Ua(va,Ba,za){var ca=nt(va),ei=nt(Ba),Vi=[1,0,0],Oi=Tt(ca,ei),Wi=dt(Oi,Oi),Xi=Oi[0],ni=Wi-Xi*Xi;if(!ni)return!za&&va;var Za=yr*Wi/ni,$i=-yr*Xi/ni,Do=Tt(Vi,Oi),ss=Ct(Vi,Za),Ps=Ct(Oi,$i);wt(ss,Ps);var ys=Do,Os=dt(ss,ys),Yo=dt(ys,ys),ll=Os*Os-Yo*(dt(ss,ss)-1);if(!(ll<0)){var el=c(ll),Rs=Ct(ys,(-Os-el)/Yo);if(wt(Rs,ss),Rs=it(Rs),!za)return Rs;var bi=va[0],so=Ba[0],ws=va[1],fs=Ba[1],Ll;so0^Rs[1]<(g(Rs[0]-bi)n^(bi<=Rs[0]&&Rs[0]<=so)){var Jl=Ct(ys,(-Os+el)/Yo);return wt(Jl,ss),[Rs,it(Jl)]}}}function Ya(va,Ba){var za=Rr?Xe:n-Xe,ca=0;return va<-za?ca|=1:va>za&&(ca|=2),Ba<-za?ca|=4:Ba>za&&(ca|=8),ca}return Or(ha,Ta,Pn,Rr?[0,-Xe]:[-n,Xe-n])}function Qr(Xe,yr,Kr,Rr,mn,Pn){var ha=Xe[0],Ta=Xe[1],Ua=yr[0],Ya=yr[1],va=0,Ba=1,za=Ua-ha,ca=Ya-Ta,ei;if(ei=Kr-ha,!(!za&&ei>0)){if(ei/=za,za<0){if(ei0){if(ei>Ba)return;ei>va&&(va=ei)}if(ei=mn-ha,!(!za&&ei<0)){if(ei/=za,za<0){if(ei>Ba)return;ei>va&&(va=ei)}else if(za>0){if(ei0)){if(ei/=ca,ca<0){if(ei0){if(ei>Ba)return;ei>va&&(va=ei)}if(ei=Pn-Ta,!(!ca&&ei<0)){if(ei/=ca,ca<0){if(ei>Ba)return;ei>va&&(va=ei)}else if(ca>0){if(ei0&&(Xe[0]=ha+va*za,Xe[1]=Ta+va*ca),Ba<1&&(yr[0]=ha+Ba*za,yr[1]=Ta+Ba*ca),!0}}}}}var vn=1e9,Oa=-vn;function Qn(Xe,yr,Kr,Rr){function mn(Ya,va){return Xe<=Ya&&Ya<=Kr&&yr<=va&&va<=Rr}function Pn(Ya,va,Ba,za){var ca=0,ei=0;if(Ya==null||(ca=ha(Ya,Ba))!==(ei=ha(va,Ba))||Ua(Ya,va)<0^Ba>0)do za.point(ca===0||ca===3?Xe:Kr,ca>1?Rr:yr);while((ca=(ca+Ba+4)%4)!==ei);else za.point(va[0],va[1])}function ha(Ya,va){return g(Ya[0]-Xe)0?0:3:g(Ya[0]-Kr)0?2:1:g(Ya[1]-yr)0?1:0:va>0?3:2}function Ta(Ya,va){return Ua(Ya.x,va.x)}function Ua(Ya,va){var Ba=ha(Ya,1),za=ha(va,1);return Ba!==za?Ba-za:Ba===0?va[1]-Ya[1]:Ba===1?Ya[0]-va[0]:Ba===2?Ya[1]-va[1]:va[0]-Ya[0]}return function(Ya){var va=Ya,Ba=ve(),za,ca,ei,Vi,Oi,Wi,Xi,ni,Za,$i,Do,ss={point:Ps,lineStart:ll,lineEnd:el,polygonStart:Os,polygonEnd:Yo};function Ps(bi,so){mn(bi,so)&&va.point(bi,so)}function ys(){for(var bi=0,so=0,ws=ca.length;soRr&&(Ru-Bu)*(Rr-Jl)>(nl-Jl)*(Xe-Bu)&&++bi:nl<=Rr&&(Ru-Bu)*(Rr-Jl)<(nl-Jl)*(Xe-Bu)&&--bi;return bi}function Os(){va=Ba,za=[],ca=[],Do=!0}function Yo(){var bi=ys(),so=Do&&bi,ws=(za=d.merge(za)).length;(so||ws)&&(Ya.polygonStart(),so&&(Ya.lineStart(),Pn(null,null,1,Ya),Ya.lineEnd()),ws&&br(za,Ta,bi,Pn,Ya),Ya.polygonEnd()),va=Ya,za=ca=ei=null}function ll(){ss.point=Rs,ca&&ca.push(ei=[]),$i=!0,Za=!1,Xi=ni=NaN}function el(){za&&(Rs(Vi,Oi),Wi&&Za&&Ba.rejoin(),za.push(Ba.result())),ss.point=Ps,Za&&va.lineEnd()}function Rs(bi,so){var ws=mn(bi,so);if(ca&&ei.push([bi,so]),$i)Vi=bi,Oi=so,Wi=ws,$i=!1,ws&&(va.lineStart(),va.point(bi,so));else if(ws&&Za)va.point(bi,so);else{var fs=[Xi=Math.max(Oa,Math.min(vn,Xi)),ni=Math.max(Oa,Math.min(vn,ni))],Ll=[bi=Math.max(Oa,Math.min(vn,bi)),so=Math.max(Oa,Math.min(vn,so))];Qr(fs,Ll,Xe,yr,Kr,Rr)?(Za||(va.lineStart(),va.point(fs[0],fs[1])),va.point(Ll[0],Ll[1]),ws||va.lineEnd(),Do=!1):ws&&(va.lineStart(),va.point(bi,so),Do=!1)}Xi=bi,ni=so,Za=ws}return ss}}function Qa(){var Xe=0,yr=0,Kr=960,Rr=500,mn,Pn,ha;return ha={stream:function(Ta){return mn&&Pn===Ta?mn:mn=Qn(Xe,yr,Kr,Rr)(Pn=Ta)},extent:function(Ta){return arguments.length?(Xe=+Ta[0][0],yr=+Ta[0][1],Kr=+Ta[1][0],Rr=+Ta[1][1],mn=Pn=null,ha):[[Xe,yr],[Kr,Rr]]}}}var Ja=E(),wi,ci,Ti,Ra={sphere:z,point:z,lineStart:Qi,lineEnd:z,polygonStart:z,polygonEnd:z};function Qi(){Ra.point=Ho,Ra.lineEnd=Hi}function Hi(){Ra.point=Ra.lineEnd=z}function Ho(Xe,yr){Xe*=v,yr*=v,wi=Xe,ci=M(yr),Ti=l(yr),Ra.point=Ci}function Ci(Xe,yr){Xe*=v,yr*=v;var Kr=M(yr),Rr=l(yr),mn=g(Xe-wi),Pn=l(mn),ha=M(mn),Ta=Rr*ha,Ua=Ti*Kr-ci*Rr*Pn,Ya=ci*Kr+Ti*Rr*Pn;Ja.add(w(c(Ta*Ta+Ua*Ua),Ya)),wi=Xe,ci=Kr,Ti=Rr}function zo(Xe){return Ja.reset(),j(Xe,Ra),+Ja}var qi=[null,null],qo={type:"LineString",coordinates:qi};function Po(Xe,yr){return qi[0]=Xe,qi[1]=yr,zo(qo)}var hs={Feature:function(Xe,yr){return uo(Xe.geometry,yr)},FeatureCollection:function(Xe,yr){for(var Kr=Xe.features,Rr=-1,mn=Kr.length;++Rr0&&(mn=Po(Xe[Pn],Xe[Pn-1]),mn>0&&Kr<=mn&&Rr<=mn&&(Kr+Rr-mn)*(1-Math.pow((Kr-Rr)/mn,2))r}).map(za)).concat(d.range(x(Pn/Ya)*Ya,mn,Ya).filter(function(ni){return g(ni%Ba)>r}).map(ca))}return Wi.lines=function(){return Xi().map(function(ni){return{type:"LineString",coordinates:ni}})},Wi.outline=function(){return{type:"Polygon",coordinates:[ei(Rr).concat(Vi(ha).slice(1),ei(Kr).reverse().slice(1),Vi(Ta).reverse().slice(1))]}},Wi.extent=function(ni){return arguments.length?Wi.extentMajor(ni).extentMinor(ni):Wi.extentMinor()},Wi.extentMajor=function(ni){return arguments.length?(Rr=+ni[0][0],Kr=+ni[1][0],Ta=+ni[0][1],ha=+ni[1][1],Rr>Kr&&(ni=Rr,Rr=Kr,Kr=ni),Ta>ha&&(ni=Ta,Ta=ha,ha=ni),Wi.precision(Oi)):[[Rr,Ta],[Kr,ha]]},Wi.extentMinor=function(ni){return arguments.length?(yr=+ni[0][0],Xe=+ni[1][0],Pn=+ni[0][1],mn=+ni[1][1],yr>Xe&&(ni=yr,yr=Xe,Xe=ni),Pn>mn&&(ni=Pn,Pn=mn,mn=ni),Wi.precision(Oi)):[[yr,Pn],[Xe,mn]]},Wi.step=function(ni){return arguments.length?Wi.stepMajor(ni).stepMinor(ni):Wi.stepMinor()},Wi.stepMajor=function(ni){return arguments.length?(va=+ni[0],Ba=+ni[1],Wi):[va,Ba]},Wi.stepMinor=function(ni){return arguments.length?(Ua=+ni[0],Ya=+ni[1],Wi):[Ua,Ya]},Wi.precision=function(ni){return arguments.length?(Oi=+ni,za=Da(Pn,mn,90),ca=li(yr,Xe,Oi),ei=Da(Ta,ha,90),Vi=li(Rr,Kr,Oi),Wi):Oi},Wi.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ms(){return wo()()}function Di(Xe,yr){var Kr=Xe[0]*v,Rr=Xe[1]*v,mn=yr[0]*v,Pn=yr[1]*v,ha=l(Rr),Ta=M(Rr),Ua=l(Pn),Ya=M(Pn),va=ha*l(Kr),Ba=ha*M(Kr),za=Ua*l(mn),ca=Ua*M(mn),ei=2*_(c(P(Pn-Rr)+ha*Ua*P(mn-Kr))),Vi=M(ei),Oi=ei?function(Wi){var Xi=M(Wi*=ei)/Vi,ni=M(ei-Wi)/Vi,Za=ni*va+Xi*za,$i=ni*Ba+Xi*ca,Do=ni*Ta+Xi*Ya;return[w($i,Za)*f,w(Do,c(Za*Za+$i*$i))*f]}:function(){return[Kr*f,Rr*f]};return Oi.distance=ei,Oi}function _s(Xe){return Xe}var No=E(),is=E(),al,ii,io,co,Is={point:z,lineStart:z,lineEnd:z,polygonStart:function(){Is.lineStart=Wo,Is.lineEnd=fl},polygonEnd:function(){Is.lineStart=Is.lineEnd=Is.point=z,No.add(g(is)),is.reset()},result:function(){var Xe=No/2;return No.reset(),Xe}};function Wo(){Is.point=Bi}function Bi(Xe,yr){Is.point=$s,al=io=Xe,ii=co=yr}function $s(Xe,yr){is.add(co*Xe-io*yr),io=Xe,co=yr}function fl(){$s(al,ii)}var Jo=1/0,us=Jo,Ss=-Jo,Ls=Ss,xl={point:bu,lineStart:z,lineEnd:z,polygonStart:z,polygonEnd:z,result:function(){var Xe=[[Jo,us],[Ss,Ls]];return Ss=Ls=-(us=Jo=1/0),Xe}};function bu(Xe,yr){XeSs&&(Ss=Xe),yrLs&&(Ls=yr)}var au=0,fu=0,Ec=0,xc=0,cs=0,Gl=0,zc=0,Al=0,_l=0,Ml,hu,Fs,bl,Fo={point:bs,lineStart:Iu,lineEnd:qs,polygonStart:function(){Fo.lineStart=sf,Fo.lineEnd=Oo},polygonEnd:function(){Fo.point=bs,Fo.lineStart=Iu,Fo.lineEnd=qs},result:function(){var Xe=_l?[zc/_l,Al/_l]:Gl?[xc/Gl,cs/Gl]:Ec?[au/Ec,fu/Ec]:[NaN,NaN];return au=fu=Ec=xc=cs=Gl=zc=Al=_l=0,Xe}};function bs(Xe,yr){au+=Xe,fu+=yr,++Ec}function Iu(){Fo.point=Nl}function Nl(Xe,yr){Fo.point=Hu,bs(Fs=Xe,bl=yr)}function Hu(Xe,yr){var Kr=Xe-Fs,Rr=yr-bl,mn=c(Kr*Kr+Rr*Rr);xc+=mn*(Fs+Xe)/2,cs+=mn*(bl+yr)/2,Gl+=mn,bs(Fs=Xe,bl=yr)}function qs(){Fo.point=bs}function sf(){Fo.point=yf}function Oo(){os(Ml,hu)}function yf(Xe,yr){Fo.point=os,bs(Ml=Fs=Xe,hu=bl=yr)}function os(Xe,yr){var Kr=Xe-Fs,Rr=yr-bl,mn=c(Kr*Kr+Rr*Rr);xc+=mn*(Fs+Xe)/2,cs+=mn*(bl+yr)/2,Gl+=mn,mn=bl*Xe-Fs*yr,zc+=mn*(Fs+Xe),Al+=mn*(bl+yr),_l+=mn*3,bs(Fs=Xe,bl=yr)}function Fi(Xe){this._context=Xe}Fi.prototype={_radius:4.5,pointRadius:function(Xe){return this._radius=Xe,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(Xe,yr){switch(this._point){case 0:{this._context.moveTo(Xe,yr),this._point=1;break}case 1:{this._context.lineTo(Xe,yr);break}default:{this._context.moveTo(Xe+this._radius,yr),this._context.arc(Xe,yr,this._radius,0,s);break}}},result:z};var nc=E(),pu,ml,Lc,qu,dc,wl={point:z,lineStart:function(){wl.point=Yc},lineEnd:function(){pu&&Fc(ml,Lc),wl.point=z},polygonStart:function(){pu=!0},polygonEnd:function(){pu=null},result:function(){var Xe=+nc;return nc.reset(),Xe}};function Yc(Xe,yr){wl.point=Fc,ml=qu=Xe,Lc=dc=yr}function Fc(Xe,yr){qu-=Xe,dc-=yr,nc.add(c(qu*qu+dc*dc)),qu=Xe,dc=yr}function mc(){this._string=[]}mc.prototype={_radius:4.5,_circle:Wu(4.5),pointRadius:function(Xe){return(Xe=+Xe)!==this._radius&&(this._radius=Xe,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(Xe,yr){switch(this._point){case 0:{this._string.push("M",Xe,",",yr),this._point=1;break}case 1:{this._string.push("L",Xe,",",yr);break}default:{this._circle==null&&(this._circle=Wu(this._radius)),this._string.push("M",Xe,",",yr,this._circle);break}}},result:function(){if(this._string.length){var Xe=this._string.join("");return this._string=[],Xe}else return null}};function Wu(Xe){return"m0,"+Xe+"a"+Xe+","+Xe+" 0 1,1 0,"+-2*Xe+"a"+Xe+","+Xe+" 0 1,1 0,"+2*Xe+"z"}function Cc(Xe,yr){var Kr=4.5,Rr,mn;function Pn(ha){return ha&&(typeof Kr=="function"&&mn.pointRadius(+Kr.apply(this,arguments)),j(ha,Rr(mn))),mn.result()}return Pn.area=function(ha){return j(ha,Rr(Is)),Is.result()},Pn.measure=function(ha){return j(ha,Rr(wl)),wl.result()},Pn.bounds=function(ha){return j(ha,Rr(xl)),xl.result()},Pn.centroid=function(ha){return j(ha,Rr(Fo)),Fo.result()},Pn.projection=function(ha){return arguments.length?(Rr=ha==null?(Xe=null,_s):(Xe=ha).stream,Pn):Xe},Pn.context=function(ha){return arguments.length?(mn=ha==null?(yr=null,new mc):new Fi(yr=ha),typeof Kr!="function"&&mn.pointRadius(Kr),Pn):yr},Pn.pointRadius=function(ha){return arguments.length?(Kr=typeof ha=="function"?ha:(mn.pointRadius(+ha),+ha),Pn):Kr},Pn.projection(Xe).context(yr)}function Ic(Xe){return{stream:du(Xe)}}function du(Xe){return function(yr){var Kr=new Bc;for(var Rr in Xe)Kr[Rr]=Xe[Rr];return Kr.stream=yr,Kr}}function Bc(){}Bc.prototype={constructor:Bc,point:function(Xe,yr){this.stream.point(Xe,yr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Pu(Xe,yr,Kr){var Rr=Xe.clipExtent&&Xe.clipExtent();return Xe.scale(150).translate([0,0]),Rr!=null&&Xe.clipExtent(null),j(Kr,Xe.stream(xl)),yr(xl.result()),Rr!=null&&Xe.clipExtent(Rr),Xe}function wu(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=yr[1][0]-yr[0][0],Pn=yr[1][1]-yr[0][1],ha=Math.min(mn/(Rr[1][0]-Rr[0][0]),Pn/(Rr[1][1]-Rr[0][1])),Ta=+yr[0][0]+(mn-ha*(Rr[1][0]+Rr[0][0]))/2,Ua=+yr[0][1]+(Pn-ha*(Rr[1][1]+Rr[0][1]))/2;Xe.scale(150*ha).translate([Ta,Ua])},Kr)}function Tl(Xe,yr,Kr){return wu(Xe,[[0,0],yr],Kr)}function Ju(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=+yr,Pn=mn/(Rr[1][0]-Rr[0][0]),ha=(mn-Pn*(Rr[1][0]+Rr[0][0]))/2,Ta=-Pn*Rr[0][1];Xe.scale(150*Pn).translate([ha,Ta])},Kr)}function Pc(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=+yr,Pn=mn/(Rr[1][1]-Rr[0][1]),ha=-Pn*Rr[0][0],Ta=(mn-Pn*(Rr[1][1]+Rr[0][1]))/2;Xe.scale(150*Pn).translate([ha,Ta])},Kr)}var Es=16,_c=l(30*v);function lf(Xe,yr){return+yr?gc(Xe,yr):Rc(Xe)}function Rc(Xe){return du({point:function(yr,Kr){yr=Xe(yr,Kr),this.stream.point(yr[0],yr[1])}})}function gc(Xe,yr){function Kr(Rr,mn,Pn,ha,Ta,Ua,Ya,va,Ba,za,ca,ei,Vi,Oi){var Wi=Ya-Rr,Xi=va-mn,ni=Wi*Wi+Xi*Xi;if(ni>4*yr&&Vi--){var Za=ha+za,$i=Ta+ca,Do=Ua+ei,ss=c(Za*Za+$i*$i+Do*Do),Ps=_(Do/=ss),ys=g(g(Do)-1)yr||g((Wi*el+Xi*Rs)/ni-.5)>.3||ha*za+Ta*ca+Ua*ei<_c)&&(Kr(Rr,mn,Pn,ha,Ta,Ua,Yo,ll,ys,Za/=ss,$i/=ss,Do,Vi,Oi),Oi.point(Yo,ll),Kr(Yo,ll,ys,Za,$i,Do,Ya,va,Ba,za,ca,ei,Vi,Oi))}}return function(Rr){var mn,Pn,ha,Ta,Ua,Ya,va,Ba,za,ca,ei,Vi,Oi={point:Wi,lineStart:Xi,lineEnd:Za,polygonStart:function(){Rr.polygonStart(),Oi.lineStart=$i},polygonEnd:function(){Rr.polygonEnd(),Oi.lineStart=Xi}};function Wi(Ps,ys){Ps=Xe(Ps,ys),Rr.point(Ps[0],Ps[1])}function Xi(){Ba=NaN,Oi.point=ni,Rr.lineStart()}function ni(Ps,ys){var Os=nt([Ps,ys]),Yo=Xe(Ps,ys);Kr(Ba,za,va,ca,ei,Vi,Ba=Yo[0],za=Yo[1],va=Ps,ca=Os[0],ei=Os[1],Vi=Os[2],Es,Rr),Rr.point(Ba,za)}function Za(){Oi.point=Wi,Rr.lineEnd()}function $i(){Xi(),Oi.point=Do,Oi.lineEnd=ss}function Do(Ps,ys){ni(mn=Ps,ys),Pn=Ba,ha=za,Ta=ca,Ua=ei,Ya=Vi,Oi.point=ni}function ss(){Kr(Ba,za,va,ca,ei,Vi,Pn,ha,mn,Ta,Ua,Ya,Es,Rr),Oi.lineEnd=Za,Za()}return Oi}}var Nc=du({point:function(Xe,yr){this.stream.point(Xe*v,yr*v)}});function Zl(Xe){return du({point:function(yr,Kr){var Rr=Xe(yr,Kr);return this.stream.point(Rr[0],Rr[1])}})}function jc(Xe,yr,Kr,Rr,mn){function Pn(ha,Ta){return ha*=Rr,Ta*=mn,[yr+Xe*ha,Kr-Xe*Ta]}return Pn.invert=function(ha,Ta){return[(ha-yr)/Xe*Rr,(Kr-Ta)/Xe*mn]},Pn}function rl(Xe,yr,Kr,Rr,mn,Pn){var ha=l(Pn),Ta=M(Pn),Ua=ha*Xe,Ya=Ta*Xe,va=ha/Xe,Ba=Ta/Xe,za=(Ta*Kr-ha*yr)/Xe,ca=(Ta*yr+ha*Kr)/Xe;function ei(Vi,Oi){return Vi*=Rr,Oi*=mn,[Ua*Vi-Ya*Oi+yr,Kr-Ya*Vi-Ua*Oi]}return ei.invert=function(Vi,Oi){return[Rr*(va*Vi-Ba*Oi+za),mn*(ca-Ba*Vi-va*Oi)]},ei}function Kl(Xe){return Gu(function(){return Xe})()}function Gu(Xe){var yr,Kr=150,Rr=480,mn=250,Pn=0,ha=0,Ta=0,Ua=0,Ya=0,va,Ba=0,za=1,ca=1,ei=null,Vi=xr,Oi=null,Wi,Xi,ni,Za=_s,$i=.5,Do,ss,Ps,ys,Os;function Yo(bi){return Ps(bi[0]*v,bi[1]*v)}function ll(bi){return bi=Ps.invert(bi[0],bi[1]),bi&&[bi[0]*f,bi[1]*f]}Yo.stream=function(bi){return ys&&Os===bi?ys:ys=Nc(Zl(va)(Vi(Do(Za(Os=bi)))))},Yo.preclip=function(bi){return arguments.length?(Vi=bi,ei=void 0,Rs()):Vi},Yo.postclip=function(bi){return arguments.length?(Za=bi,Oi=Wi=Xi=ni=null,Rs()):Za},Yo.clipAngle=function(bi){return arguments.length?(Vi=+bi?rn(ei=bi*v):(ei=null,xr),Rs()):ei*f},Yo.clipExtent=function(bi){return arguments.length?(Za=bi==null?(Oi=Wi=Xi=ni=null,_s):Qn(Oi=+bi[0][0],Wi=+bi[0][1],Xi=+bi[1][0],ni=+bi[1][1]),Rs()):Oi==null?null:[[Oi,Wi],[Xi,ni]]},Yo.scale=function(bi){return arguments.length?(Kr=+bi,el()):Kr},Yo.translate=function(bi){return arguments.length?(Rr=+bi[0],mn=+bi[1],el()):[Rr,mn]},Yo.center=function(bi){return arguments.length?(Pn=bi[0]%360*v,ha=bi[1]%360*v,el()):[Pn*f,ha*f]},Yo.rotate=function(bi){return arguments.length?(Ta=bi[0]%360*v,Ua=bi[1]%360*v,Ya=bi.length>2?bi[2]%360*v:0,el()):[Ta*f,Ua*f,Ya*f]},Yo.angle=function(bi){return arguments.length?(Ba=bi%360*v,el()):Ba*f},Yo.reflectX=function(bi){return arguments.length?(za=bi?-1:1,el()):za<0},Yo.reflectY=function(bi){return arguments.length?(ca=bi?-1:1,el()):ca<0},Yo.precision=function(bi){return arguments.length?(Do=lf(ss,$i=bi*bi),Rs()):c($i)},Yo.fitExtent=function(bi,so){return wu(Yo,bi,so)},Yo.fitSize=function(bi,so){return Tl(Yo,bi,so)},Yo.fitWidth=function(bi,so){return Ju(Yo,bi,so)},Yo.fitHeight=function(bi,so){return Pc(Yo,bi,so)};function el(){var bi=rl(Kr,0,0,za,ca,Ba).apply(null,yr(Pn,ha)),so=(Ba?rl:jc)(Kr,Rr-bi[0],mn-bi[1],za,ca,Ba);return va=In(Ta,Ua,Ya),ss=Yr(yr,so),Ps=Yr(va,ss),Do=lf(ss,$i),Rs()}function Rs(){return ys=Os=null,Yo}return function(){return yr=Xe.apply(this,arguments),Yo.invert=yr.invert&&ll,el()}}function Bs(Xe){var yr=0,Kr=n/3,Rr=Gu(Xe),mn=Rr(yr,Kr);return mn.parallels=function(Pn){return arguments.length?Rr(yr=Pn[0]*v,Kr=Pn[1]*v):[yr*f,Kr*f]},mn}function Ou(Xe){var yr=l(Xe);function Kr(Rr,mn){return[Rr*yr,M(mn)/yr]}return Kr.invert=function(Rr,mn){return[Rr/yr,_(mn*yr)]},Kr}function Rl(Xe,yr){var Kr=M(Xe),Rr=(Kr+M(yr))/2;if(g(Rr)=.12&&Oi<.234&&Vi>=-.425&&Vi<-.214?mn:Oi>=.166&&Oi<.234&&Vi>=-.214&&Vi<-.115?ha:Kr).invert(za)},va.stream=function(za){return Xe&&yr===za?Xe:Xe=ac([Kr.stream(yr=za),mn.stream(za),ha.stream(za)])},va.precision=function(za){return arguments.length?(Kr.precision(za),mn.precision(za),ha.precision(za),Ba()):Kr.precision()},va.scale=function(za){return arguments.length?(Kr.scale(za),mn.scale(za*.35),ha.scale(za),va.translate(Kr.translate())):Kr.scale()},va.translate=function(za){if(!arguments.length)return Kr.translate();var ca=Kr.scale(),ei=+za[0],Vi=+za[1];return Rr=Kr.translate(za).clipExtent([[ei-.455*ca,Vi-.238*ca],[ei+.455*ca,Vi+.238*ca]]).stream(Ya),Pn=mn.translate([ei-.307*ca,Vi+.201*ca]).clipExtent([[ei-.425*ca+r,Vi+.12*ca+r],[ei-.214*ca-r,Vi+.234*ca-r]]).stream(Ya),Ta=ha.translate([ei-.205*ca,Vi+.212*ca]).clipExtent([[ei-.214*ca+r,Vi+.166*ca+r],[ei-.115*ca-r,Vi+.234*ca-r]]).stream(Ya),Ba()},va.fitExtent=function(za,ca){return wu(va,za,ca)},va.fitSize=function(za,ca){return Tl(va,za,ca)},va.fitWidth=function(za,ca){return Ju(va,za,ca)},va.fitHeight=function(za,ca){return Pc(va,za,ca)};function Ba(){return Xe=yr=null,va}return va.scale(1070)}function Zu(Xe){return function(yr,Kr){var Rr=l(yr),mn=l(Kr),Pn=Xe(Rr*mn);return[Pn*mn*M(yr),Pn*M(Kr)]}}function bc(Xe){return function(yr,Kr){var Rr=c(yr*yr+Kr*Kr),mn=Xe(Rr),Pn=M(mn),ha=l(mn);return[w(yr*Pn,Rr*ha),_(Rr&&Kr*Pn/Rr)]}}var uf=Zu(function(Xe){return c(2/(1+Xe))});uf.invert=bc(function(Xe){return 2*_(Xe/2)});function Sf(){return Kl(uf).scale(124.75).clipAngle(180-.001)}var ic=Zu(function(Xe){return(Xe=b(Xe))&&Xe/M(Xe)});ic.invert=bc(function(Xe){return Xe});function wc(){return Kl(ic).scale(79.4188).clipAngle(180-.001)}function Fl(Xe,yr){return[Xe,S(h((o+yr)/2))]}Fl.invert=function(Xe,yr){return[Xe,2*m(y(yr))-o]};function oc(){return iu(Fl).scale(961/s)}function iu(Xe){var yr=Kl(Xe),Kr=yr.center,Rr=yr.scale,mn=yr.translate,Pn=yr.clipExtent,ha=null,Ta,Ua,Ya;yr.scale=function(Ba){return arguments.length?(Rr(Ba),va()):Rr()},yr.translate=function(Ba){return arguments.length?(mn(Ba),va()):mn()},yr.center=function(Ba){return arguments.length?(Kr(Ba),va()):Kr()},yr.clipExtent=function(Ba){return arguments.length?(Ba==null?ha=Ta=Ua=Ya=null:(ha=+Ba[0][0],Ta=+Ba[0][1],Ua=+Ba[1][0],Ya=+Ba[1][1]),va()):ha==null?null:[[ha,Ta],[Ua,Ya]]};function va(){var Ba=n*Rr(),za=yr(ia(yr.rotate()).invert([0,0]));return Pn(ha==null?[[za[0]-Ba,za[1]-Ba],[za[0]+Ba,za[1]+Ba]]:Xe===Fl?[[Math.max(za[0]-Ba,ha),Ta],[Math.min(za[0]+Ba,Ua),Ya]]:[[ha,Math.max(za[1]-Ba,Ta)],[Ua,Math.min(za[1]+Ba,Ya)]])}return va()}function sc(Xe){return h((o+Xe)/2)}function Tc(Xe,yr){var Kr=l(Xe),Rr=Xe===yr?M(Xe):S(Kr/l(yr))/S(sc(yr)/sc(Xe)),mn=Kr*k(sc(Xe),Rr)/Rr;if(!Rr)return Fl;function Pn(ha,Ta){mn>0?Ta<-o+r&&(Ta=-o+r):Ta>o-r&&(Ta=o-r);var Ua=mn/k(sc(Ta),Rr);return[Ua*M(Rr*ha),mn-Ua*l(Rr*ha)]}return Pn.invert=function(ha,Ta){var Ua=mn-Ta,Ya=T(Rr)*c(ha*ha+Ua*Ua),va=w(ha,g(Ua))*T(Ua);return Ua*Rr<0&&(va-=n*T(ha)*T(Ua)),[va/Rr,2*m(k(mn/Ya,1/Rr))-o]},Pn}function ku(){return Bs(Tc).scale(109.5).parallels([30,30])}function Gs(Xe,yr){return[Xe,yr]}Gs.invert=Gs;function Du(){return Kl(Gs).scale(152.63)}function Xl(Xe,yr){var Kr=l(Xe),Rr=Xe===yr?M(Xe):(Kr-l(yr))/(yr-Xe),mn=Kr/Rr+Xe;if(g(Rr)r&&--Rr>0);return[Xe/(.8707+(Pn=Kr*Kr)*(-.131979+Pn*(-.013791+Pn*Pn*Pn*(.003971-.001529*Pn)))),Kr]};function Au(){return Kl(Fu).scale(175.295)}function il(Xe,yr){return[l(yr)*M(Xe),M(yr)]}il.invert=bc(_);function Cs(){return Kl(il).scale(249.5).clipAngle(90+r)}function Mu(Xe,yr){var Kr=l(yr),Rr=1+l(Xe)*Kr;return[Kr*M(Xe)/Rr,M(yr)/Rr]}Mu.invert=bc(function(Xe){return 2*m(Xe)});function lc(){return Kl(Mu).scale(250).clipAngle(142)}function Su(Xe,yr){return[S(h((o+yr)/2)),-Xe]}Su.invert=function(Xe,yr){return[-yr,2*m(y(Xe))-o]};function Oc(){var Xe=iu(Su),yr=Xe.center,Kr=Xe.rotate;return Xe.center=function(Rr){return arguments.length?yr([-Rr[1],Rr[0]]):(Rr=yr(),[Rr[1],-Rr[0]])},Xe.rotate=function(Rr){return arguments.length?Kr([Rr[0],Rr[1],Rr.length>2?Rr[2]+90:90]):(Rr=Kr(),[Rr[0],Rr[1],Rr[2]-90])},Kr([0,0,90]).scale(159.155)}u.geoAlbers=Ws,u.geoAlbersUsa=Tu,u.geoArea=q,u.geoAzimuthalEqualArea=Sf,u.geoAzimuthalEqualAreaRaw=uf,u.geoAzimuthalEquidistant=wc,u.geoAzimuthalEquidistantRaw=ic,u.geoBounds=Dt,u.geoCentroid=zr,u.geoCircle=Ga,u.geoClipAntimeridian=xr,u.geoClipCircle=rn,u.geoClipExtent=Qa,u.geoClipRectangle=Qn,u.geoConicConformal=ku,u.geoConicConformalRaw=Tc,u.geoConicEqualArea=Yl,u.geoConicEqualAreaRaw=Rl,u.geoConicEquidistant=Xc,u.geoConicEquidistantRaw=Xl,u.geoContains=_o,u.geoDistance=Po,u.geoEqualEarth=cf,u.geoEqualEarthRaw=yc,u.geoEquirectangular=Du,u.geoEquirectangularRaw=Gs,u.geoGnomonic=Uc,u.geoGnomonicRaw=zl,u.geoGraticule=wo,u.geoGraticule10=Ms,u.geoIdentity=su,u.geoInterpolate=Di,u.geoLength=zo,u.geoMercator=oc,u.geoMercatorRaw=Fl,u.geoNaturalEarth1=Au,u.geoNaturalEarth1Raw=Fu,u.geoOrthographic=Cs,u.geoOrthographicRaw=il,u.geoPath=Cc,u.geoProjection=Kl,u.geoProjectionMutator=Gu,u.geoRotation=ia,u.geoStereographic=lc,u.geoStereographicRaw=Mu,u.geoStream=j,u.geoTransform=Ic,u.geoTransverseMercator=Oc,u.geoTransverseMercatorRaw=Su,Object.defineProperty(u,"__esModule",{value:!0})})}),kE=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,D3(),Sv()):d(u.d3=u.d3||{},u.d3,u.d3)})(K,function(u,d,E){var A=Math.abs,t=Math.atan,e=Math.atan2,r=Math.cos,i=Math.exp,n=Math.floor,o=Math.log,a=Math.max,s=Math.min,f=Math.pow,v=Math.round,g=Math.sign||function(Rt){return Rt>0?1:Rt<0?-1:0},m=Math.sin,w=Math.tan,l=1e-6,x=1e-12,y=Math.PI,S=y/2,k=y/4,M=Math.SQRT1_2,T=B(2),c=B(y),h=y*2,b=180/y,_=y/180;function P(Rt){return Rt?Rt/Math.sin(Rt):1}function z(Rt){return Rt>1?S:Rt<-1?-S:Math.asin(Rt)}function D(Rt){return Rt>1?0:Rt<-1?y:Math.acos(Rt)}function B(Rt){return Rt>0?Math.sqrt(Rt):0}function R(Rt){return Rt=i(2*Rt),(Rt-1)/(Rt+1)}function I(Rt){return(i(Rt)-i(-Rt))/2}function F(Rt){return(i(Rt)+i(-Rt))/2}function j(Rt){return o(Rt+B(Rt*Rt+1))}function N(Rt){return o(Rt+B(Rt*Rt-1))}function G(Rt){var Gt=w(Rt/2),ae=2*o(r(Rt/2))/(Gt*Gt);function ce(Te,ye){var ze=r(Te),rr=r(ye),fr=m(ye),gr=rr*ze,Lr=-((1-gr?o((1+gr)/2)/(1-gr):-.5)+ae/(1+gr));return[Lr*rr*m(Te),Lr*fr]}return ce.invert=function(Te,ye){var ze=B(Te*Te+ye*ye),rr=-Rt/2,fr=50,gr;if(!ze)return[0,0];do{var Lr=rr/2,Hr=r(Lr),nn=m(Lr),cn=nn/Hr,Mn=-o(A(Hr));rr-=gr=(2/cn*Mn-ae*cn-ze)/(-Mn/(nn*nn)+1-ae/(2*Hr*Hr))*(Hr<0?.7:1)}while(A(gr)>l&&--fr>0);var Jn=m(rr);return[e(Te*Jn,ze*r(rr)),z(ye*Jn/ze)]},ce}function rt(){var Rt=S,Gt=d.geoProjectionMutator(G),ae=Gt(Rt);return ae.radius=function(ce){return arguments.length?Gt(Rt=ce*_):Rt*b},ae.scale(179.976).clipAngle(147)}function ct(Rt,Gt){var ae=r(Gt),ce=P(D(ae*r(Rt/=2)));return[2*ae*m(Rt)*ce,m(Gt)*ce]}ct.invert=function(Rt,Gt){if(!(Rt*Rt+4*Gt*Gt>y*y+l)){var ae=Rt,ce=Gt,Te=25;do{var ye=m(ae),ze=m(ae/2),rr=r(ae/2),fr=m(ce),gr=r(ce),Lr=m(2*ce),Hr=fr*fr,nn=gr*gr,cn=ze*ze,Mn=1-nn*rr*rr,Jn=Mn?D(gr*rr)*B(_a=1/Mn):_a=0,_a,xa=2*Jn*gr*ze-Rt,La=Jn*fr-Gt,ai=_a*(nn*cn+Jn*gr*rr*Hr),Ai=_a*(.5*ye*Lr-Jn*2*fr*ze),mi=_a*.25*(Lr*ze-Jn*fr*nn*ye),Yi=_a*(Hr*rr+Jn*cn*gr),Go=Ai*mi-Yi*ai;if(!Go)break;var Xo=(La*Ai-xa*Yi)/Go,po=(xa*mi-La*ai)/Go;ae-=Xo,ce-=po}while((A(Xo)>l||A(po)>l)&&--Te>0);return[ae,ce]}};function st(){return d.geoProjection(ct).scale(152.63)}function et(Rt){var Gt=m(Rt),ae=r(Rt),ce=Rt>=0?1:-1,Te=w(ce*Rt),ye=(1+Gt-ae)/2;function ze(rr,fr){var gr=r(fr),Lr=r(rr/=2);return[(1+gr)*m(rr),(ce*fr>-e(Lr,Te)-.001?0:-ce*10)+ye+m(fr)*ae-(1+gr)*Gt*Lr]}return ze.invert=function(rr,fr){var gr=0,Lr=0,Hr=50;do{var nn=r(gr),cn=m(gr),Mn=r(Lr),Jn=m(Lr),_a=1+Mn,xa=_a*cn-rr,La=ye+Jn*ae-_a*Gt*nn-fr,ai=_a*nn/2,Ai=-cn*Jn,mi=Gt*_a*cn/2,Yi=ae*Mn+Gt*nn*Jn,Go=Ai*mi-Yi*ai,Xo=(La*Ai-xa*Yi)/Go/2,po=(xa*mi-La*ai)/Go;A(po)>2&&(po/=2),gr-=Xo,Lr-=po}while((A(Xo)>l||A(po)>l)&&--Hr>0);return ce*Lr>-e(r(gr),Te)-.001?[gr*2,Lr]:null},ze}function Z(){var Rt=20*_,Gt=Rt>=0?1:-1,ae=w(Gt*Rt),ce=d.geoProjectionMutator(et),Te=ce(Rt),ye=Te.stream;return Te.parallel=function(ze){return arguments.length?(ae=w((Gt=(Rt=ze*_)>=0?1:-1)*Rt),ce(Rt)):Rt*b},Te.stream=function(ze){var rr=Te.rotate(),fr=ye(ze),gr=(Te.rotate([0,0]),ye(ze)),Lr=Te.precision();return Te.rotate(rr),fr.sphere=function(){gr.polygonStart(),gr.lineStart();for(var Hr=Gt*-180;Gt*Hr<180;Hr+=Gt*90)gr.point(Hr,Gt*90);if(Rt)for(;Gt*(Hr-=3*Gt*Lr)>=-180;)gr.point(Hr,Gt*-e(r(Hr*_/2),ae)*b);gr.lineEnd(),gr.polygonEnd()},fr},Te.scale(218.695).center([0,28.0974])}function ot(Rt,Gt){var ae=w(Gt/2),ce=B(1-ae*ae),Te=1+ce*r(Rt/=2),ye=m(Rt)*ce/Te,ze=ae/Te,rr=ye*ye,fr=ze*ze;return[4/3*ye*(3+rr-3*fr),4/3*ze*(3+3*rr-fr)]}ot.invert=function(Rt,Gt){if(Rt*=3/8,Gt*=3/8,!Rt&&A(Gt)>1)return null;var ae=Rt*Rt,ce=Gt*Gt,Te=1+ae+ce,ye=B((Te-B(Te*Te-4*Gt*Gt))/2),ze=z(ye)/3,rr=ye?N(A(Gt/ye))/3:j(A(Rt))/3,fr=r(ze),gr=F(rr),Lr=gr*gr-fr*fr;return[g(Rt)*2*e(I(rr)*fr,.25-Lr),g(Gt)*2*e(gr*m(ze),.25+Lr)]};function X(){return d.geoProjection(ot).scale(66.1603)}var Q=B(8),ut=o(1+T);function J(Rt,Gt){var ae=A(Gt);return aex&&--ce>0);return[Rt/(r(ae)*(Q-1/m(ae))),g(Gt)*ae]};function q(){return d.geoProjection(J).scale(112.314)}function it(Rt){var Gt=2*y/Rt;function ae(ce,Te){var ye=d.geoAzimuthalEquidistantRaw(ce,Te);if(A(ce)>S){var ze=e(ye[1],ye[0]),rr=B(ye[0]*ye[0]+ye[1]*ye[1]),fr=Gt*v((ze-S)/Gt)+S,gr=e(m(ze-=fr),2-r(ze));ze=fr+z(y/rr*m(gr))-gr,ye[0]=rr*r(ze),ye[1]=rr*m(ze)}return ye}return ae.invert=function(ce,Te){var ye=B(ce*ce+Te*Te);if(ye>S){var ze=e(Te,ce),rr=Gt*v((ze-S)/Gt)+S,fr=ze>rr?-1:1,gr=ye*r(rr-ze),Lr=1/w(fr*D((gr-y)/B(y*(y-2*gr)+ye*ye)));ze=rr+2*t((Lr+fr*B(Lr*Lr-3))/3),ce=ye*r(ze),Te=ye*m(ze)}return d.geoAzimuthalEquidistantRaw.invert(ce,Te)},ae}function nt(){var Rt=5,Gt=d.geoProjectionMutator(it),ae=Gt(Rt),ce=ae.stream,Te=.01,ye=-r(Te*_),ze=m(Te*_);return ae.lobes=function(rr){return arguments.length?Gt(Rt=+rr):Rt},ae.stream=function(rr){var fr=ae.rotate(),gr=ce(rr),Lr=(ae.rotate([0,0]),ce(rr));return ae.rotate(fr),gr.sphere=function(){Lr.polygonStart(),Lr.lineStart();for(var Hr=0,nn=360/Rt,cn=2*y/Rt,Mn=90-180/Rt,Jn=S;Hr0&&A(Te)>l);return ce<0?NaN:ae}function It(Rt,Gt,ae){return Gt===void 0&&(Gt=40),ae===void 0&&(ae=x),function(ce,Te,ye,ze){var rr,fr,gr;ye=ye===void 0?0:+ye,ze=ze===void 0?0:+ze;for(var Lr=0;Lrrr){ye-=fr/=2,ze-=gr/=2;continue}rr=Mn;var Jn=(ye>0?-1:1)*ae,_a=(ze>0?-1:1)*ae,xa=Rt(ye+Jn,ze),La=Rt(ye,ze+_a),ai=(xa[0]-Hr[0])/Jn,Ai=(xa[1]-Hr[1])/Jn,mi=(La[0]-Hr[0])/_a,Yi=(La[1]-Hr[1])/_a,Go=Yi*ai-Ai*mi,Xo=(A(Go)<.5?.5:1)/Go;if(fr=(cn*mi-nn*Yi)*Xo,gr=(nn*Ai-cn*ai)*Xo,ye+=fr,ze+=gr,A(fr)0&&(rr[1]*=1+fr/1.5*rr[0]*rr[0]),rr}return ce.invert=It(ce),ce}function te(){return d.geoProjection(Nt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Jt(Rt,Gt){var ae=Rt*m(Gt),ce=30,Te;do Gt-=Te=(Gt+m(Gt)-ae)/(1+r(Gt));while(A(Te)>l&&--ce>0);return Gt/2}function ee(Rt,Gt,ae){function ce(Te,ye){return[Rt*Te*r(ye=Jt(ae,ye)),Gt*m(ye)]}return ce.invert=function(Te,ye){return ye=z(ye/Gt),[Te/(Rt*r(ye)),z((2*ye+m(2*ye))/ae)]},ce}var Zt=ee(T/S,T,y);function mt(){return d.geoProjection(Zt).scale(169.529)}var bt=2.00276,vt=1.11072;function Ut(Rt,Gt){var ae=Jt(y,Gt);return[bt*Rt/(1/r(Gt)+vt/r(ae)),(Gt+T*m(ae))/bt]}Ut.invert=function(Rt,Gt){var ae=bt*Gt,ce=Gt<0?-k:k,Te=25,ye,ze;do ze=ae-T*m(ce),ce-=ye=(m(2*ce)+2*ce-y*m(ze))/(2*r(2*ce)+2+y*r(ze)*T*r(ce));while(A(ye)>l&&--Te>0);return ze=ae-T*m(ce),[Rt*(1/r(ze)+vt/r(ce))/bt,ze]};function re(){return d.geoProjection(Ut).scale(160.857)}function Kt(Rt){var Gt=0,ae=d.geoProjectionMutator(Rt),ce=ae(Gt);return ce.parallel=function(Te){return arguments.length?ae(Gt=Te*_):Gt*b},ce}function ue(Rt,Gt){return[Rt*r(Gt),Gt]}ue.invert=function(Rt,Gt){return[Rt/r(Gt),Gt]};function Me(){return d.geoProjection(ue).scale(152.63)}function Ce(Rt){if(!Rt)return ue;var Gt=1/w(Rt);function ae(ce,Te){var ye=Gt+Rt-Te,ze=ye&&ce*r(Te)/ye;return[ye*m(ze),Gt-ye*r(ze)]}return ae.invert=function(ce,Te){var ye=B(ce*ce+(Te=Gt-Te)*Te),ze=Gt+Rt-ye;return[ye/r(ze)*e(ce,Te),ze]},ae}function We(){return Kt(Ce).scale(123.082).center([0,26.1441]).parallel(45)}function qe(Rt){function Gt(ae,ce){var Te=S-ce,ye=Te&&ae*Rt*m(Te)/Te;return[Te*m(ye)/Rt,S-Te*r(ye)]}return Gt.invert=function(ae,ce){var Te=ae*Rt,ye=S-ce,ze=B(Te*Te+ye*ye),rr=e(Te,ye);return[(ze?ze/m(ze):1)*rr/Rt,S-ze]},Gt}function vr(){var Rt=.5,Gt=d.geoProjectionMutator(qe),ae=Gt(Rt);return ae.fraction=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(158.837)}var _r=ee(1,4/y,y);function er(){return d.geoProjection(_r).scale(152.63)}function Mr(Rt,Gt,ae,ce,Te,ye){var ze=r(ye),rr;if(A(Rt)>1||A(ye)>1)rr=D(ae*Te+Gt*ce*ze);else{var fr=m(Rt/2),gr=m(ye/2);rr=2*z(B(fr*fr+Gt*ce*gr*gr))}return A(rr)>l?[rr,e(ce*m(ye),Gt*Te-ae*ce*ze)]:[0,0]}function Ir(Rt,Gt,ae){return D((Rt*Rt+Gt*Gt-ae*ae)/(2*Rt*Gt))}function de(Rt){return Rt-2*y*n((Rt+y)/(2*y))}function Dt(Rt,Gt,ae){for(var ce=[[Rt[0],Rt[1],m(Rt[1]),r(Rt[1])],[Gt[0],Gt[1],m(Gt[1]),r(Gt[1])],[ae[0],ae[1],m(ae[1]),r(ae[1])]],Te=ce[2],ye,ze=0;ze<3;++ze,Te=ye)ye=ce[ze],Te.v=Mr(ye[1]-Te[1],Te[3],Te[2],ye[3],ye[2],ye[0]-Te[0]),Te.point=[0,0];var rr=Ir(ce[0].v[0],ce[2].v[0],ce[1].v[0]),fr=Ir(ce[0].v[0],ce[1].v[0],ce[2].v[0]),gr=y-rr;ce[2].point[1]=0,ce[0].point[0]=-(ce[1].point[0]=ce[0].v[0]/2);var Lr=[ce[2].point[0]=ce[0].point[0]+ce[2].v[0]*r(rr),2*(ce[0].point[1]=ce[1].point[1]=ce[2].v[0]*m(rr))];function Hr(nn,cn){var Mn=m(cn),Jn=r(cn),_a=new Array(3),xa;for(xa=0;xa<3;++xa){var La=ce[xa];if(_a[xa]=Mr(cn-La[1],La[3],La[2],Jn,Mn,nn-La[0]),!_a[xa][0])return La.point;_a[xa][1]=de(_a[xa][1]-La.v[1])}var ai=Lr.slice();for(xa=0;xa<3;++xa){var Ai=xa==2?0:xa+1,mi=Ir(ce[xa].v[0],_a[xa][0],_a[Ai][0]);_a[xa][1]<0&&(mi=-mi),xa?xa==1?(mi=fr-mi,ai[0]-=_a[xa][0]*r(mi),ai[1]-=_a[xa][0]*m(mi)):(mi=gr-mi,ai[0]+=_a[xa][0]*r(mi),ai[1]+=_a[xa][0]*m(mi)):(ai[0]+=_a[xa][0]*r(mi),ai[1]-=_a[xa][0]*m(mi))}return ai[0]/=3,ai[1]/=3,ai}return Hr}function qt(Rt){return Rt[0]*=_,Rt[1]*=_,Rt}function _t(){return lt([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function lt(Rt,Gt,ae){var ce=d.geoCentroid({type:"MultiPoint",coordinates:[Rt,Gt,ae]}),Te=[-ce[0],-ce[1]],ye=d.geoRotation(Te),ze=Dt(qt(ye(Rt)),qt(ye(Gt)),qt(ye(ae)));ze.invert=It(ze);var rr=d.geoProjection(ze).rotate(Te),fr=rr.center;return delete rr.rotate,rr.center=function(gr){return arguments.length?fr(ye(gr)):ye.invert(fr())},rr.clipAngle(90)}function yt(Rt,Gt){var ae=B(1-m(Gt));return[2/c*Rt*ae,c*(1-ae)]}yt.invert=function(Rt,Gt){var ae=(ae=Gt/c-1)*ae;return[ae>0?Rt*B(y/ae)/2:0,z(1-ae)]};function St(){return d.geoProjection(yt).scale(95.6464).center([0,30])}function Ht(Rt){var Gt=w(Rt);function ae(ce,Te){return[ce,(ce?ce/m(ce):1)*(m(Te)*r(ce)-Gt*r(Te))]}return ae.invert=Gt?function(ce,Te){ce&&(Te*=m(ce)/ce);var ye=r(ce);return[ce,2*e(B(ye*ye+Gt*Gt-Te*Te)-ye,Gt-Te)]}:function(ce,Te){return[ce,z(ce?Te*w(ce)/ce:Te)]},ae}function Yt(){return Kt(Ht).scale(249.828).clipAngle(90)}var se=B(3);function ke(Rt,Gt){return[se*Rt*(2*r(2*Gt/3)-1)/c,se*c*m(Gt/3)]}ke.invert=function(Rt,Gt){var ae=3*z(Gt/(se*c));return[c*Rt/(se*(2*r(2*ae/3)-1)),ae]};function Ee(){return d.geoProjection(ke).scale(156.19)}function Ue(Rt){var Gt=r(Rt);function ae(ce,Te){return[ce*Gt,m(Te)/Gt]}return ae.invert=function(ce,Te){return[ce/Gt,z(Te*Gt)]},ae}function ir(){return Kt(Ue).parallel(38.58).scale(195.044)}function ar(Rt){var Gt=r(Rt);function ae(ce,Te){return[ce*Gt,(1+Gt)*w(Te/2)]}return ae.invert=function(ce,Te){return[ce/Gt,t(Te/(1+Gt))*2]},ae}function Ye(){return Kt(ar).scale(124.75)}function Er(Rt,Gt){var ae=B(8/(3*y));return[ae*Rt*(1-A(Gt)/y),ae*Gt]}Er.invert=function(Rt,Gt){var ae=B(8/(3*y)),ce=Gt/ae;return[Rt/(ae*(1-A(ce)/y)),ce]};function pn(){return d.geoProjection(Er).scale(165.664)}function dn(Rt,Gt){var ae=B(4-3*m(A(Gt)));return[2/B(6*y)*Rt*ae,g(Gt)*B(2*y/3)*(2-ae)]}dn.invert=function(Rt,Gt){var ae=2-A(Gt)/B(2*y/3);return[Rt*B(6*y)/(2*ae),g(Gt)*z((4-ae*ae)/3)]};function bn(){return d.geoProjection(dn).scale(165.664)}function Zn(Rt,Gt){var ae=B(y*(4+y));return[2/ae*Rt*(1+B(1-4*Gt*Gt/(y*y))),4/ae*Gt]}Zn.invert=function(Rt,Gt){var ae=B(y*(4+y))/2;return[Rt*ae/(1+B(1-Gt*Gt*(4+y)/(4*y))),Gt*ae/2]};function En(){return d.geoProjection(Zn).scale(180.739)}function gn(Rt,Gt){var ae=(2+S)*m(Gt);Gt/=2;for(var ce=0,Te=1/0;ce<10&&A(Te)>l;ce++){var ye=r(Gt);Gt-=Te=(Gt+m(Gt)*(ye+2)-ae)/(2*ye*(1+ye))}return[2/B(y*(4+y))*Rt*(1+r(Gt)),2*B(y/(4+y))*m(Gt)]}gn.invert=function(Rt,Gt){var ae=Gt*B((4+y)/y)/2,ce=z(ae),Te=r(ce);return[Rt/(2/B(y*(4+y))*(1+Te)),z((ce+ae*(Te+2))/(2+S))]};function da(){return d.geoProjection(gn).scale(180.739)}function ra(Rt,Gt){return[Rt*(1+r(Gt))/B(2+y),2*Gt/B(2+y)]}ra.invert=function(Rt,Gt){var ae=B(2+y),ce=Gt*ae/2;return[ae*Rt/(1+r(ce)),ce]};function Se(){return d.geoProjection(ra).scale(173.044)}function Re(Rt,Gt){for(var ae=(1+S)*m(Gt),ce=0,Te=1/0;ce<10&&A(Te)>l;ce++)Gt-=Te=(Gt+m(Gt)-ae)/(1+r(Gt));return ae=B(2+y),[Rt*(1+r(Gt))/ae,2*Gt/ae]}Re.invert=function(Rt,Gt){var ae=1+S,ce=B(ae/2);return[Rt*2*ce/(1+r(Gt*=ce)),z((Gt+m(Gt))/ae)]};function Ze(){return d.geoProjection(Re).scale(173.044)}var tr=3+2*T;function zr(Rt,Gt){var ae=m(Rt/=2),ce=r(Rt),Te=B(r(Gt)),ye=r(Gt/=2),ze=m(Gt)/(ye+T*ce*Te),rr=B(2/(1+ze*ze)),fr=B((T*ye+(ce+ae)*Te)/(T*ye+(ce-ae)*Te));return[tr*(rr*(fr-1/fr)-2*o(fr)),tr*(rr*ze*(fr+1/fr)-2*t(ze))]}zr.invert=function(Rt,Gt){if(!(ye=ot.invert(Rt/1.2,Gt*1.065)))return null;var ae=ye[0],ce=ye[1],Te=20,ye;Rt/=tr,Gt/=tr;do{var ze=ae/2,rr=ce/2,fr=m(ze),gr=r(ze),Lr=m(rr),Hr=r(rr),nn=r(ce),cn=B(nn),Mn=Lr/(Hr+T*gr*cn),Jn=Mn*Mn,_a=B(2/(1+Jn)),xa=T*Hr+(gr+fr)*cn,La=T*Hr+(gr-fr)*cn,ai=xa/La,Ai=B(ai),mi=Ai-1/Ai,Yi=Ai+1/Ai,Go=_a*mi-2*o(Ai)-Rt,Xo=_a*Mn*Yi-2*t(Mn)-Gt,po=Lr&&M*cn*fr*Jn/Lr,Qo=(T*gr*Hr+cn)/(2*(Hr+T*gr*cn)*(Hr+T*gr*cn)*cn),Js=-.5*Mn*_a*_a*_a,Us=Js*po,To=Js*Qo,ko=(ko=2*Hr+T*cn*(gr-fr))*ko*Ai,hl=(T*gr*Hr*cn+nn)/ko,Sl=-(T*fr*Lr)/(cn*ko),tu=mi*Us-2*hl/Ai+_a*(hl+hl/ai),gt=mi*To-2*Sl/Ai+_a*(Sl+Sl/ai),Et=Mn*Yi*Us-2*po/(1+Jn)+_a*Yi*po+_a*Mn*(hl-hl/ai),Xt=Mn*Yi*To-2*Qo/(1+Jn)+_a*Yi*Qo+_a*Mn*(Sl-Sl/ai),fe=gt*Et-Xt*tu;if(!fe)break;var me=(Xo*gt-Go*Xt)/fe,we=(Go*Et-Xo*tu)/fe;ae-=me,ce=a(-S,s(S,ce-we))}while((A(me)>l||A(we)>l)&&--Te>0);return A(A(ce)-S)ce){var Hr=B(Lr),nn=e(gr,fr),cn=ae*v(nn/ae),Mn=nn-cn,Jn=Rt*r(Mn),_a=(Rt*m(Mn)-Mn*m(Jn))/(S-Jn),xa=ge(Mn,_a),La=(y-Rt)/dr(xa,Jn,y);fr=Hr;var ai=50,Ai;do fr-=Ai=(Rt+dr(xa,Jn,fr)*La-Hr)/(xa(fr)*La);while(A(Ai)>l&&--ai>0);gr=Mn*m(fr),frce){var fr=B(rr),gr=e(ze,ye),Lr=ae*v(gr/ae),Hr=gr-Lr;ye=fr*r(Hr),ze=fr*m(Hr);for(var nn=ye-S,cn=m(ye),Mn=ze/cn,Jn=yel||A(Mn)>l)&&--Jn>0);return[Hr,nn]},fr}var mr=Tr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function kr(){return d.geoProjection(mr).scale(149.995)}var Ur=Tr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Or(){return d.geoProjection(Ur).scale(153.93)}var pe=Tr(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ke(){return d.geoProjection(pe).scale(130.945)}function xr(Rt,Gt){var ae=Rt*Rt,ce=Gt*Gt;return[Rt*(1-.162388*ce)*(.87-952426e-9*ae*ae),Gt*(1+ce/12)]}xr.invert=function(Rt,Gt){var ae=Rt,ce=Gt,Te=50,ye;do{var ze=ce*ce;ce-=ye=(ce*(1+ze/12)-Gt)/(1+ze/4)}while(A(ye)>l&&--Te>0);Te=50,Rt/=1-.162388*ze;do{var rr=(rr=ae*ae)*rr;ae-=ye=(ae*(.87-952426e-9*rr)-Rt)/(.87-.00476213*rr)}while(A(ye)>l&&--Te>0);return[ae,ce]};function Gr(){return d.geoProjection(xr).scale(131.747)}var ln=Tr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function wn(){return d.geoProjection(ln).scale(131.087)}function rn(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ae(ce,Te){var ye=ce>0?-.5:.5,ze=Rt(ce+ye*y,Te);return ze[0]-=ye*Gt,ze}return Rt.invert&&(ae.invert=function(ce,Te){var ye=ce>0?-.5:.5,ze=Rt.invert(ce+ye*Gt,Te),rr=ze[0]-ye*y;return rr<-y?rr+=2*y:rr>y&&(rr-=2*y),ze[0]=rr,ze}),ae}function Qr(Rt,Gt){var ae=g(Rt),ce=g(Gt),Te=r(Gt),ye=r(Rt)*Te,ze=m(Rt)*Te,rr=m(ce*Gt);Rt=A(e(ze,rr)),Gt=z(ye),A(Rt-S)>l&&(Rt%=S);var fr=vn(Rt>y/4?S-Rt:Rt,Gt);return Rt>y/4&&(rr=fr[0],fr[0]=-fr[1],fr[1]=-rr),fr[0]*=ae,fr[1]*=-ce,fr}Qr.invert=function(Rt,Gt){A(Rt)>1&&(Rt=g(Rt)*2-Rt),A(Gt)>1&&(Gt=g(Gt)*2-Gt);var ae=g(Rt),ce=g(Gt),Te=-ae*Rt,ye=-ce*Gt,ze=ye/Te<1,rr=Oa(ze?ye:Te,ze?Te:ye),fr=rr[0],gr=rr[1],Lr=r(gr);return ze&&(fr=-S-fr),[ae*(e(m(fr)*Lr,-m(gr))+y),ce*z(r(fr)*Lr)]};function vn(Rt,Gt){if(Gt===S)return[0,0];var ae=m(Gt),ce=ae*ae,Te=ce*ce,ye=1+Te,ze=1+3*Te,rr=1-Te,fr=z(1/B(ye)),gr=rr+ce*ye*fr,Lr=(1-ae)/gr,Hr=B(Lr),nn=Lr*ye,cn=B(nn),Mn=Hr*rr,Jn,_a;if(Rt===0)return[0,-(Mn+ce*cn)];var xa=r(Gt),La=1/xa,ai=2*ae*xa,Ai=(-3*ce+fr*ze)*ai,mi=(-gr*xa-(1-ae)*Ai)/(gr*gr),Yi=.5*mi/Hr,Go=rr*Yi-2*ce*Hr*ai,Xo=ce*ye*mi+Lr*ze*ai,po=-La*ai,Qo=-La*Xo,Js=-2*La*Go,Us=4*Rt/y,To;if(Rt>.222*y||Gt.175*y){if(Jn=(Mn+ce*B(nn*(1+Te)-Mn*Mn))/(1+Te),Rt>y/4)return[Jn,Jn];var ko=Jn,hl=.5*Jn;Jn=.5*(hl+ko),_a=50;do{var Sl=B(nn-Jn*Jn),tu=Jn*(Js+po*Sl)+Qo*z(Jn/cn)-Us;if(!tu)break;tu<0?hl=Jn:ko=Jn,Jn=.5*(hl+ko)}while(A(ko-hl)>l&&--_a>0)}else{Jn=l,_a=25;do{var gt=Jn*Jn,Et=B(nn-gt),Xt=Js+po*Et,fe=Jn*Xt+Qo*z(Jn/cn)-Us,me=Xt+(Qo-po*gt)/Et;Jn-=To=Et?fe/me:0}while(A(To)>l&&--_a>0)}return[Jn,-Mn-ce*B(nn-Jn*Jn)]}function Oa(Rt,Gt){for(var ae=0,ce=1,Te=.5,ye=50;;){var ze=Te*Te,rr=B(Te),fr=z(1/B(1+ze)),gr=1-ze+Te*(1+ze)*fr,Lr=(1-rr)/gr,Hr=B(Lr),nn=Lr*(1+ze),cn=Hr*(1-ze),Mn=nn-Rt*Rt,Jn=B(Mn),_a=Gt+cn+Te*Jn;if(A(ce-ae)0?ae=Te:ce=Te,Te=.5*(ae+ce)}if(!ye)return null;var xa=z(rr),La=r(xa),ai=1/La,Ai=2*rr*La,mi=(-3*Te+fr*(1+3*ze))*Ai,Yi=(-gr*La-(1-rr)*mi)/(gr*gr),Go=.5*Yi/Hr,Xo=(1-ze)*Go-2*Te*Hr*Ai,po=-2*ai*Xo,Qo=-ai*Ai,Js=-ai*(Te*(1+ze)*Yi+Lr*(1+3*ze)*Ai);return[y/4*(Rt*(po+Qo*Jn)+Js*z(Rt/B(nn))),xa]}function Qn(){return d.geoProjection(rn(Qr)).scale(239.75)}function Qa(Rt,Gt,ae){var ce,Te,ye;return Rt?(ce=Ja(Rt,ae),Gt?(Te=Ja(Gt,1-ae),ye=Te[1]*Te[1]+ae*ce[0]*ce[0]*Te[0]*Te[0],[[ce[0]*Te[2]/ye,ce[1]*ce[2]*Te[0]*Te[1]/ye],[ce[1]*Te[1]/ye,-ce[0]*ce[2]*Te[0]*Te[2]/ye],[ce[2]*Te[1]*Te[2]/ye,-ae*ce[0]*ce[1]*Te[0]/ye]]):[[ce[0],0],[ce[1],0],[ce[2],0]]):(Te=Ja(Gt,1-ae),[[0,Te[0]/Te[1]],[1/Te[1],0],[Te[2]/Te[1],0]])}function Ja(Rt,Gt){var ae,ce,Te,ye,ze;if(Gt=1-l)return ae=(1-Gt)/4,ce=F(Rt),ye=R(Rt),Te=1/ce,ze=ce*I(Rt),[ye+ae*(ze-Rt)/(ce*ce),Te-ae*ye*Te*(ze-Rt),Te+ae*ye*Te*(ze+Rt),2*t(i(Rt))-S+ae*(ze-Rt)/ce];var rr=[1,0,0,0,0,0,0,0,0],fr=[B(Gt),0,0,0,0,0,0,0,0],gr=0;for(ce=B(1-Gt),ze=1;A(fr[gr]/rr[gr])>l&&gr<8;)ae=rr[gr++],fr[gr]=(ae-ce)/2,rr[gr]=(ae+ce)/2,ce=B(ae*ce),ze*=2;Te=ze*rr[gr]*Rt;do ye=fr[gr]*m(ce=Te)/rr[gr],Te=(z(ye)+Te)/2;while(--gr);return[m(Te),ye=r(Te),ye/r(Te-ce),Te]}function wi(Rt,Gt,ae){var ce=A(Rt),Te=A(Gt),ye=I(Te);if(ce){var ze=1/m(ce),rr=1/(w(ce)*w(ce)),fr=-(rr+ae*(ye*ye*ze*ze)-1+ae),gr=(ae-1)*rr,Lr=(-fr+B(fr*fr-4*gr))/2;return[ci(t(1/B(Lr)),ae)*g(Rt),ci(t(B((Lr/rr-1)/ae)),1-ae)*g(Gt)]}return[0,ci(t(ye),1-ae)*g(Gt)]}function ci(Rt,Gt){if(!Gt)return Rt;if(Gt===1)return o(w(Rt/2+k));for(var ae=1,ce=B(1-Gt),Te=B(Gt),ye=0;A(Te)>l;ye++){if(Rt%y){var ze=t(ce*w(Rt)/ae);ze<0&&(ze+=y),Rt+=ze+~~(Rt/y)*y}else Rt+=Rt;Te=(ae+ce)/2,ce=B(ae*ce),Te=((ae=Te)-ce)/2}return Rt/(f(2,ye)*ae)}function Ti(Rt,Gt){var ae=(T-1)/(T+1),ce=B(1-ae*ae),Te=ci(S,ce*ce),ye=-1,ze=o(w(y/4+A(Gt)/2)),rr=i(ye*ze)/B(ae),fr=Ra(rr*r(ye*Rt),rr*m(ye*Rt)),gr=wi(fr[0],fr[1],ce*ce);return[-gr[1],(Gt>=0?1:-1)*(.5*Te-gr[0])]}function Ra(Rt,Gt){var ae=Rt*Rt,ce=Gt+1,Te=1-ae-Gt*Gt;return[.5*((Rt>=0?S:-S)-e(Te,2*Rt)),-.25*o(Te*Te+4*ae)+.5*o(ce*ce+ae)]}function Qi(Rt,Gt){var ae=Gt[0]*Gt[0]+Gt[1]*Gt[1];return[(Rt[0]*Gt[0]+Rt[1]*Gt[1])/ae,(Rt[1]*Gt[0]-Rt[0]*Gt[1])/ae]}Ti.invert=function(Rt,Gt){var ae=(T-1)/(T+1),ce=B(1-ae*ae),Te=ci(S,ce*ce),ye=-1,ze=Qa(.5*Te-Gt,-Rt,ce*ce),rr=Qi(ze[0],ze[1]),fr=e(rr[1],rr[0])/ye;return[fr,2*t(i(.5/ye*o(ae*rr[0]*rr[0]+ae*rr[1]*rr[1])))-S]};function Hi(){return d.geoProjection(rn(Ti)).scale(151.496)}function Ho(Rt){var Gt=m(Rt),ae=r(Rt),ce=Ci(Rt);ce.invert=Ci(-Rt);function Te(ye,ze){var rr=ce(ye,ze);ye=rr[0],ze=rr[1];var fr=m(ze),gr=r(ze),Lr=r(ye),Hr=D(Gt*fr+ae*gr*Lr),nn=m(Hr),cn=A(nn)>l?Hr/nn:1;return[cn*ae*m(ye),(A(ye)>S?cn:-cn)*(Gt*gr-ae*fr*Lr)]}return Te.invert=function(ye,ze){var rr=B(ye*ye+ze*ze),fr=-m(rr),gr=r(rr),Lr=rr*gr,Hr=-ze*fr,nn=rr*Gt,cn=B(Lr*Lr+Hr*Hr-nn*nn),Mn=e(Lr*nn+Hr*cn,Hr*nn-Lr*cn),Jn=(rr>S?-1:1)*e(ye*fr,rr*r(Mn)*gr+ze*m(Mn)*fr);return ce.invert(Jn,Mn)},Te}function Ci(Rt){var Gt=m(Rt),ae=r(Rt);return function(ce,Te){var ye=r(Te),ze=r(ce)*ye,rr=m(ce)*ye,fr=m(Te);return[e(rr,ze*ae-fr*Gt),z(fr*ae+ze*Gt)]}}function zo(){var Rt=0,Gt=d.geoProjectionMutator(Ho),ae=Gt(Rt),ce=ae.rotate,Te=ae.stream,ye=d.geoCircle();return ae.parallel=function(ze){if(!arguments.length)return Rt*b;var rr=ae.rotate();return Gt(Rt=ze*_).rotate(rr)},ae.rotate=function(ze){return arguments.length?(ce.call(ae,[ze[0],ze[1]-Rt*b]),ye.center([-ze[0],-ze[1]]),ae):(ze=ce.call(ae),ze[1]+=Rt*b,ze)},ae.stream=function(ze){return ze=Te(ze),ze.sphere=function(){ze.polygonStart();var rr=.01,fr=ye.radius(90-rr)().coordinates[0],gr=fr.length-1,Lr=-1,Hr;for(ze.lineStart();++Lr=0;)ze.point((Hr=fr[Lr])[0],Hr[1]);ze.lineEnd(),ze.polygonEnd()},ze},ae.scale(79.4187).parallel(45).clipAngle(180-.001)}var qi=3,qo=z(1-1/qi)*b,Po=Ue(0);function hs(Rt){var Gt=qo*_,ae=yt(y,Gt)[0]-yt(-y,Gt)[0],ce=Po(0,Gt)[1],Te=yt(0,Gt)[1],ye=c-Te,ze=h/Rt,rr=4/h,fr=ce+ye*ye*4/h;function gr(Lr,Hr){var nn,cn=A(Hr);if(cn>Gt){var Mn=s(Rt-1,a(0,n((Lr+y)/ze)));Lr+=y*(Rt-1)/Rt-Mn*ze,nn=yt(Lr,cn),nn[0]=nn[0]*h/ae-h*(Rt-1)/(2*Rt)+Mn*h/Rt,nn[1]=ce+(nn[1]-Te)*4*ye/h,Hr<0&&(nn[1]=-nn[1])}else nn=Po(Lr,Hr);return nn[0]*=rr,nn[1]/=fr,nn}return gr.invert=function(Lr,Hr){Lr/=rr,Hr*=fr;var nn=A(Hr);if(nn>ce){var cn=s(Rt-1,a(0,n((Lr+y)/ze)));Lr=(Lr+y*(Rt-1)/Rt-cn*ze)*ae/h;var Mn=yt.invert(Lr,.25*(nn-ce)*h/ye+Te);return Mn[0]-=y*(Rt-1)/Rt-cn*ze,Hr<0&&(Mn[1]=-Mn[1]),Mn}return Po.invert(Lr,Hr)},gr}function Gi(Rt,Gt){return[Rt,Gt&1?90-l:qo]}function uo(Rt,Gt){return[Rt,Gt&1?-90+l:-qo]}function yi(Rt){return[Rt[0]*(1-l),Rt[1]]}function ao(Rt){var Gt=[].concat(E.range(-180,180+Rt/2,Rt).map(Gi),E.range(180,-180-Rt/2,-Rt).map(uo));return{type:"Polygon",coordinates:[Rt===180?Gt.map(yi):Gt]}}function ts(){var Rt=4,Gt=d.geoProjectionMutator(hs),ae=Gt(Rt),ce=ae.stream;return ae.lobes=function(Te){return arguments.length?Gt(Rt=+Te):Rt},ae.stream=function(Te){var ye=ae.rotate(),ze=ce(Te),rr=(ae.rotate([0,0]),ce(Te));return ae.rotate(ye),ze.sphere=function(){d.geoStream(ao(180/Rt),rr)},ze},ae.scale(239.75)}function vs(Rt){var Gt=1+Rt,ae=m(1/Gt),ce=z(ae),Te=2*B(y/(ye=y+4*ce*Gt)),ye,ze=.5*Te*(Gt+B(Rt*(2+Rt))),rr=Rt*Rt,fr=Gt*Gt;function gr(Lr,Hr){var nn=1-m(Hr),cn,Mn;if(nn&&nn<2){var Jn=S-Hr,_a=25,xa;do{var La=m(Jn),ai=r(Jn),Ai=ce+e(La,Gt-ai),mi=1+fr-2*Gt*ai;Jn-=xa=(Jn-rr*ce-Gt*La+mi*Ai-.5*nn*ye)/(2*Gt*La*Ai)}while(A(xa)>x&&--_a>0);cn=Te*B(mi),Mn=Lr*Ai/y}else cn=Te*(Rt+nn),Mn=Lr*ce/y;return[cn*m(Mn),ze-cn*r(Mn)]}return gr.invert=function(Lr,Hr){var nn=Lr*Lr+(Hr-=ze)*Hr,cn=(1+fr-nn/(Te*Te))/(2*Gt),Mn=D(cn),Jn=m(Mn),_a=ce+e(Jn,Gt-cn);return[z(Lr/B(nn))*y/_a,z(1-2*(Mn-rr*ce-Gt*Jn+(1+fr-2*Gt*cn)*_a)/ye)]},gr}function As(){var Rt=1,Gt=d.geoProjectionMutator(vs),ae=Gt(Rt);return ae.ratio=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(167.774).center([0,18.67])}var _o=.7109889596207567,Da=.0528035274542;function li(Rt,Gt){return Gt>-_o?(Rt=Zt(Rt,Gt),Rt[1]+=Da,Rt):ue(Rt,Gt)}li.invert=function(Rt,Gt){return Gt>-_o?Zt.invert(Rt,Gt-Da):ue.invert(Rt,Gt)};function wo(){return d.geoProjection(li).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Ms(Rt,Gt){return A(Gt)>_o?(Rt=Zt(Rt,Gt),Rt[1]-=Gt>0?Da:-Da,Rt):ue(Rt,Gt)}Ms.invert=function(Rt,Gt){return A(Gt)>_o?Zt.invert(Rt,Gt+(Gt>0?Da:-Da)):ue.invert(Rt,Gt)};function Di(){return d.geoProjection(Ms).scale(152.63)}function _s(Rt,Gt,ae,ce){var Te=B(4*y/(2*ae+(1+Rt-Gt/2)*m(2*ae)+(Rt+Gt)/2*m(4*ae)+Gt/2*m(6*ae))),ye=B(ce*m(ae)*B((1+Rt*r(2*ae)+Gt*r(4*ae))/(1+Rt+Gt))),ze=ae*fr(1);function rr(Hr){return B(1+Rt*r(2*Hr)+Gt*r(4*Hr))}function fr(Hr){var nn=Hr*ae;return(2*nn+(1+Rt-Gt/2)*m(2*nn)+(Rt+Gt)/2*m(4*nn)+Gt/2*m(6*nn))/ae}function gr(Hr){return rr(Hr)*m(Hr)}var Lr=function(Hr,nn){var cn=ae*Ct(fr,ze*m(nn)/ae,nn/y);isNaN(cn)&&(cn=ae*g(nn));var Mn=Te*rr(cn);return[Mn*ye*Hr/y*r(cn),Mn/ye*m(cn)]};return Lr.invert=function(Hr,nn){var cn=Ct(gr,nn*ye/Te);return[Hr*y/(r(cn)*Te*ye*rr(cn)),z(ae*fr(cn/ae)/ze)]},ae===0&&(Te=B(ce/y),Lr=function(Hr,nn){return[Hr*Te,m(nn)/Te]},Lr.invert=function(Hr,nn){return[Hr/Te,z(nn*Te)]}),Lr}function No(){var Rt=1,Gt=0,ae=45*_,ce=2,Te=d.geoProjectionMutator(_s),ye=Te(Rt,Gt,ae,ce);return ye.a=function(ze){return arguments.length?Te(Rt=+ze,Gt,ae,ce):Rt},ye.b=function(ze){return arguments.length?Te(Rt,Gt=+ze,ae,ce):Gt},ye.psiMax=function(ze){return arguments.length?Te(Rt,Gt,ae=+ze*_,ce):ae*b},ye.ratio=function(ze){return arguments.length?Te(Rt,Gt,ae,ce=+ze):ce},ye.scale(180.739)}function is(Rt,Gt,ae,ce,Te,ye,ze,rr,fr,gr,Lr){if(Lr.nanEncountered)return NaN;var Hr,nn,cn,Mn,Jn,_a,xa,La,ai,Ai;if(Hr=ae-Gt,nn=Rt(Gt+Hr*.25),cn=Rt(ae-Hr*.25),isNaN(nn)){Lr.nanEncountered=!0;return}if(isNaN(cn)){Lr.nanEncountered=!0;return}return Mn=Hr*(ce+4*nn+Te)/12,Jn=Hr*(Te+4*cn+ye)/12,_a=Mn+Jn,Ai=(_a-ze)/15,gr>fr?(Lr.maxDepthCount++,_a+Ai):Math.abs(Ai)>1;do fr[_a]>cn?Jn=_a:Mn=_a,_a=Mn+Jn>>1;while(_a>Mn);var xa=fr[_a+1]-fr[_a];return xa&&(xa=(cn-fr[_a+1])/xa),(_a+1+xa)/ze}var Hr=2*Lr(1)/y*ye/ae,nn=function(cn,Mn){var Jn=Lr(A(m(Mn))),_a=ce(Jn)*cn;return Jn/=Hr,[_a,Mn>=0?Jn:-Jn]};return nn.invert=function(cn,Mn){var Jn;return Mn*=Hr,A(Mn)<1&&(Jn=g(Mn)*z(Te(A(Mn))*ye)),[cn/ce(A(Mn)),Jn]},nn}function io(){var Rt=0,Gt=2.5,ae=1.183136,ce=d.geoProjectionMutator(ii),Te=ce(Rt,Gt,ae);return Te.alpha=function(ye){return arguments.length?ce(Rt=+ye,Gt,ae):Rt},Te.k=function(ye){return arguments.length?ce(Rt,Gt=+ye,ae):Gt},Te.gamma=function(ye){return arguments.length?ce(Rt,Gt,ae=+ye):ae},Te.scale(152.63)}function co(Rt,Gt){return A(Rt[0]-Gt[0])=0;--fr)ae=Rt[1][fr],ce=ae[0][0],Te=ae[0][1],ye=ae[1][1],ze=ae[2][0],rr=ae[2][1],Gt.push(Is([[ze-l,rr-l],[ze-l,ye+l],[ce+l,ye+l],[ce+l,Te-l]],30));return{type:"Polygon",coordinates:[E.merge(Gt)]}}function Bi(Rt,Gt,ae){var ce,Te;function ye(fr,gr){for(var Lr=gr<0?-1:1,Hr=Gt[+(gr<0)],nn=0,cn=Hr.length-1;nnHr[nn][2][0];++nn);var Mn=Rt(fr-Hr[nn][1][0],gr);return Mn[0]+=Rt(Hr[nn][1][0],Lr*gr>Lr*Hr[nn][0][1]?Hr[nn][0][1]:gr)[0],Mn}ae?ye.invert=ae(ye):Rt.invert&&(ye.invert=function(fr,gr){for(var Lr=Te[+(gr<0)],Hr=Gt[+(gr<0)],nn=0,cn=Lr.length;nnMn&&(Jn=cn,cn=Mn,Mn=Jn),[[Hr,cn],[nn,Mn]]})}),ze):Gt.map(function(gr){return gr.map(function(Lr){return[[Lr[0][0]*b,Lr[0][1]*b],[Lr[1][0]*b,Lr[1][1]*b],[Lr[2][0]*b,Lr[2][1]*b]]})})},Gt!=null&&ze.lobes(Gt),ze}var $s=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function fl(){return Bi(Ut,$s).scale(160.857)}var Jo=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function us(){return Bi(Ms,Jo).scale(152.63)}var Ss=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ls(){return Bi(Zt,Ss).scale(169.529)}var xl=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function bu(){return Bi(Zt,xl).scale(169.529).rotate([20,0])}var au=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function fu(){return Bi(li,au,It).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Ec=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function xc(){return Bi(ue,Ec).scale(152.63).rotate([-20,0])}function cs(Rt,Gt){return[3/h*Rt*B(y*y/3-Gt*Gt),Gt]}cs.invert=function(Rt,Gt){return[h/3*Rt/B(y*y/3-Gt*Gt),Gt]};function Gl(){return d.geoProjection(cs).scale(158.837)}function zc(Rt){function Gt(ae,ce){if(A(A(ce)-S)2)return null;ae/=2,ce/=2;var ye=ae*ae,ze=ce*ce,rr=2*ce/(1+ye+ze);return rr=f((1+rr)/(1-rr),1/Rt),[e(2*ae,1-ye-ze)/Rt,z((rr-1)/(rr+1))]},Gt}function Al(){var Rt=.5,Gt=d.geoProjectionMutator(zc),ae=Gt(Rt);return ae.spacing=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(124.75)}var _l=y/T;function Ml(Rt,Gt){return[Rt*(1+B(r(Gt)))/2,Gt/(r(Gt/2)*r(Rt/6))]}Ml.invert=function(Rt,Gt){var ae=A(Rt),ce=A(Gt),Te=l,ye=S;ce<_l?ye*=ce/_l:Te+=6*D(_l/ce);for(var ze=0;ze<25;ze++){var rr=m(ye),fr=B(r(ye)),gr=m(ye/2),Lr=r(ye/2),Hr=m(Te/6),nn=r(Te/6),cn=.5*Te*(1+fr)-ae,Mn=ye/(Lr*nn)-ce,Jn=fr?-.25*Te*rr/fr:0,_a=.5*(1+fr),xa=(1+.5*ye*gr/Lr)/(Lr*nn),La=ye/Lr*(Hr/6)/(nn*nn),ai=Jn*La-xa*_a,Ai=(cn*La-Mn*_a)/ai,mi=(Mn*Jn-cn*xa)/ai;if(ye-=Ai,Te-=mi,A(Ai)l||A(_a)>l)&&--Te>0);return Te&&[ae,ce]};function bl(){return d.geoProjection(Fs).scale(139.98)}function Fo(Rt,Gt){return[m(Rt)/r(Gt),w(Gt)*r(Rt)]}Fo.invert=function(Rt,Gt){var ae=Rt*Rt,ce=Gt*Gt,Te=ce+1,ye=ae+Te,ze=Rt?M*B((ye-B(ye*ye-4*ae))/ae):1/B(Te);return[z(Rt*ze),g(Gt)*D(ze)]};function bs(){return d.geoProjection(Fo).scale(144.049).clipAngle(90-.001)}function Iu(Rt){var Gt=r(Rt),ae=w(k+Rt/2);function ce(Te,ye){var ze=ye-Rt,rr=A(ze)=0;)Lr=Rt[gr],Hr=Lr[0]+rr*(cn=Hr)-fr*nn,nn=Lr[1]+rr*nn+fr*cn;return Hr=rr*(cn=Hr)-fr*nn,nn=rr*nn+fr*cn,[Hr,nn]}return ae.invert=function(ce,Te){var ye=20,ze=ce,rr=Te;do{for(var fr=Gt,gr=Rt[fr],Lr=gr[0],Hr=gr[1],nn=0,cn=0,Mn;--fr>=0;)gr=Rt[fr],nn=Lr+ze*(Mn=nn)-rr*cn,cn=Hr+ze*cn+rr*Mn,Lr=gr[0]+ze*(Mn=Lr)-rr*Hr,Hr=gr[1]+ze*Hr+rr*Mn;nn=Lr+ze*(Mn=nn)-rr*cn,cn=Hr+ze*cn+rr*Mn,Lr=ze*(Mn=Lr)-rr*Hr-ce,Hr=ze*Hr+rr*Mn-Te;var Jn=nn*nn+cn*cn,_a,xa;ze-=_a=(Lr*nn+Hr*cn)/Jn,rr-=xa=(Hr*nn-Lr*cn)/Jn}while(A(_a)+A(xa)>l*l&&--ye>0);if(ye){var La=B(ze*ze+rr*rr),ai=2*t(La*.5),Ai=m(ai);return[e(ze*Ai,La*r(ai)),La?z(rr*Ai/La):0]}},ae}var Oo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],yf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],os=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Fi=[[.9245,0],[0,0],[.01943,0]],nc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function pu(){return wl(Oo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function ml(){return wl(yf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Lc(){return wl(os,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function qu(){return wl(Fi,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function dc(){return wl(nc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function wl(Rt,Gt){var ae=d.geoProjection(sf(Rt)).rotate(Gt).clipAngle(90),ce=d.geoRotation(Gt),Te=ae.center;return delete ae.rotate,ae.center=function(ye){return arguments.length?Te(ce(ye)):ce.invert(Te())},ae}var Yc=B(6),Fc=B(7);function mc(Rt,Gt){var ae=z(7*m(Gt)/(3*Yc));return[Yc*Rt*(2*r(2*ae/3)-1)/Fc,9*m(ae/3)/Fc]}mc.invert=function(Rt,Gt){var ae=3*z(Gt*Fc/9);return[Rt*Fc/(Yc*(2*r(2*ae/3)-1)),z(m(ae)*3*Yc/7)]};function Wu(){return d.geoProjection(mc).scale(164.859)}function Cc(Rt,Gt){for(var ae=(1+M)*m(Gt),ce=Gt,Te=0,ye;Te<25&&(ce-=ye=(m(ce/2)+m(ce)-ae)/(.5*r(ce/2)+r(ce)),!(A(ye)x&&--ce>0);return ye=ae*ae,ze=ye*ye,rr=ye*ze,[Rt/(.84719-.13063*ye+rr*rr*(-.04515+.05494*ye-.02326*ze+.00331*rr)),ae]};function wu(){return d.geoProjection(Pu).scale(175.295)}function Tl(Rt,Gt){return[Rt*(1+r(Gt))/2,2*(Gt-w(Gt/2))]}Tl.invert=function(Rt,Gt){for(var ae=Gt/2,ce=0,Te=1/0;ce<10&&A(Te)>l;++ce){var ye=r(Gt/2);Gt-=Te=(Gt-w(Gt/2)-ae)/(1-.5/(ye*ye))}return[2*Rt/(1+r(Gt)),Gt]};function Ju(){return d.geoProjection(Tl).scale(152.63)}var Pc=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Es(){return Bi(dt(1/0),Pc).rotate([20,0]).scale(152.63)}function _c(Rt,Gt){var ae=m(Gt),ce=r(Gt),Te=g(Rt);if(Rt===0||A(Gt)===S)return[0,Gt];if(Gt===0)return[Rt,0];if(A(Rt)===S)return[Rt*ce,S*ae];var ye=y/(2*Rt)-2*Rt/y,ze=2*Gt/y,rr=(1-ze*ze)/(ae-ze),fr=ye*ye,gr=rr*rr,Lr=1+fr/gr,Hr=1+gr/fr,nn=(ye*ae/rr-ye/2)/Lr,cn=(gr*ae/fr+rr/2)/Hr,Mn=nn*nn+ce*ce/Lr,Jn=cn*cn-(gr*ae*ae/fr+rr*ae-1)/Hr;return[S*(nn+B(Mn)*Te),S*(cn+B(Jn<0?0:Jn)*g(-Gt*ye)*Te)]}_c.invert=function(Rt,Gt){Rt/=S,Gt/=S;var ae=Rt*Rt,ce=Gt*Gt,Te=ae+ce,ye=y*y;return[Rt?(Te-1+B((1-Te)*(1-Te)+4*ae))/(2*Rt)*S:0,Ct(function(ze){return Te*(y*m(ze)-2*ze)*y+4*ze*ze*(Gt-m(ze))+2*y*ze-ye*Gt},0)]};function lf(){return d.geoProjection(_c).scale(127.267)}var Rc=1.0148,gc=.23185,Nc=-.14499,Zl=.02406,jc=Rc,rl=5*gc,Kl=7*Nc,Gu=9*Zl,Bs=1.790857183;function Ou(Rt,Gt){var ae=Gt*Gt;return[Rt,Gt*(Rc+ae*ae*(gc+ae*(Nc+Zl*ae)))]}Ou.invert=function(Rt,Gt){Gt>Bs?Gt=Bs:Gt<-Bs&&(Gt=-Bs);var ae=Gt,ce;do{var Te=ae*ae;ae-=ce=(ae*(Rc+Te*Te*(gc+Te*(Nc+Zl*Te)))-Gt)/(jc+Te*Te*(rl+Te*(Kl+Gu*Te)))}while(A(ce)>l);return[Rt,ae]};function Rl(){return d.geoProjection(Ou).scale(139.319)}function Yl(Rt,Gt){if(A(Gt)l&&--Te>0);return ze=w(ce),[(A(Gt)=0;)if(ce=Gt[rr],ae[0]===ce[0]&&ae[1]===ce[1]){if(ye)return[ye,ae];ye=ae}}}function iu(Rt){for(var Gt=Rt.length,ae=[],ce=Rt[Gt-1],Te=0;Te0?[-ce[0],0]:[180-ce[0],180])};var Gt=ku.map(function(ae){return{face:ae,project:Rt(ae)}});return[-1,0,0,1,0,1,4,5].forEach(function(ae,ce){var Te=Gt[ae];Te&&(Te.children||(Te.children=[])).push(Gt[ce])}),ic(Gt[0],function(ae,ce){return Gt[ae<-y/2?ce<0?6:4:ae<0?ce<0?2:0:aece^cn>ce&&ae<(nn-gr)*(ce-Lr)/(cn-Lr)+gr&&(Te=!Te)}return Te}function zl(Rt,Gt){var ae=Gt.stream,ce;if(!ae)throw new Error("invalid projection");switch(Rt&&Rt.type){case"Feature":ce=su;break;case"FeatureCollection":ce=Uc;break;default:ce=Au;break}return ce(Rt,ae)}function Uc(Rt,Gt){return{type:"FeatureCollection",features:Rt.features.map(function(ae){return su(ae,Gt)})}}function su(Rt,Gt){return{type:"Feature",id:Rt.id,properties:Rt.properties,geometry:Au(Rt.geometry,Gt)}}function Fu(Rt,Gt){return{type:"GeometryCollection",geometries:Rt.geometries.map(function(ae){return Au(ae,Gt)})}}function Au(Rt,Gt){if(!Rt)return null;if(Rt.type==="GeometryCollection")return Fu(Rt,Gt);var ae;switch(Rt.type){case"Point":ae=Mu;break;case"MultiPoint":ae=Mu;break;case"LineString":ae=lc;break;case"MultiLineString":ae=lc;break;case"Polygon":ae=Su;break;case"MultiPolygon":ae=Su;break;case"Sphere":ae=Su;break;default:return null}return d.geoStream(Rt,Gt(ae)),ae.result()}var il=[],Cs=[],Mu={point:function(Rt,Gt){il.push([Rt,Gt])},result:function(){var Rt=il.length?il.length<2?{type:"Point",coordinates:il[0]}:{type:"MultiPoint",coordinates:il}:null;return il=[],Rt}},lc={lineStart:Yu,point:function(Rt,Gt){il.push([Rt,Gt])},lineEnd:function(){il.length&&(Cs.push(il),il=[])},result:function(){var Rt=Cs.length?Cs.length<2?{type:"LineString",coordinates:Cs[0]}:{type:"MultiLineString",coordinates:Cs}:null;return Cs=[],Rt}},Su={polygonStart:Yu,lineStart:Yu,point:function(Rt,Gt){il.push([Rt,Gt])},lineEnd:function(){var Rt=il.length;if(Rt){do il.push(il[0].slice());while(++Rt<4);Cs.push(il),il=[]}},polygonEnd:Yu,result:function(){if(!Cs.length)return null;var Rt=[],Gt=[];return Cs.forEach(function(ae){yc(ae)?Rt.push([ae]):Gt.push(ae)}),Gt.forEach(function(ae){var ce=ae[0];Rt.some(function(Te){if(cf(Te[0],ce))return Te.push(ae),!0})||Rt.push([ae])}),Cs=[],Rt.length?Rt.length>1?{type:"MultiPolygon",coordinates:Rt}:{type:"Polygon",coordinates:Rt[0]}:null}};function Oc(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ae(ce,Te){var ye=A(ce)0?ce-y:ce+y,Te),rr=(ze[0]-ze[1])*M,fr=(ze[0]+ze[1])*M;if(ye)return[rr,fr];var gr=Gt*M,Lr=rr>0^fr>0?-1:1;return[Lr*rr-g(fr)*gr,Lr*fr-g(rr)*gr]}return Rt.invert&&(ae.invert=function(ce,Te){var ye=(ce+Te)*M,ze=(Te-ce)*M,rr=A(ye)<.5*Gt&&A(ze)<.5*Gt;if(!rr){var fr=Gt*M,gr=ye>0^ze>0?-1:1,Lr=-gr*ce+(ze>0?1:-1)*fr,Hr=-gr*Te+(ye>0?1:-1)*fr;ye=(-Lr-Hr)*M,ze=(Lr-Hr)*M}var nn=Rt.invert(ye,ze);return rr||(nn[0]+=ye>0?y:-y),nn}),d.geoProjection(ae).rotate([-90,-90,45]).clipAngle(180-.001)}function Xe(){return Oc(Qr).scale(176.423)}function yr(){return Oc(Ti).scale(111.48)}function Kr(Rt,Gt){if(!(0<=(Gt=+Gt)&&Gt<=20))throw new Error("invalid digits");function ae(gr){var Lr=gr.length,Hr=2,nn=new Array(Lr);for(nn[0]=+gr[0].toFixed(Gt),nn[1]=+gr[1].toFixed(Gt);Hr2||cn[0]!=Lr[0]||cn[1]!=Lr[1])&&(Hr.push(cn),Lr=cn)}return Hr.length===1&&gr.length>1&&Hr.push(ae(gr[gr.length-1])),Hr}function ye(gr){return gr.map(Te)}function ze(gr){if(gr==null)return gr;var Lr;switch(gr.type){case"GeometryCollection":Lr={type:"GeometryCollection",geometries:gr.geometries.map(ze)};break;case"Point":Lr={type:"Point",coordinates:ae(gr.coordinates)};break;case"MultiPoint":Lr={type:gr.type,coordinates:ce(gr.coordinates)};break;case"LineString":Lr={type:gr.type,coordinates:Te(gr.coordinates)};break;case"MultiLineString":case"Polygon":Lr={type:gr.type,coordinates:ye(gr.coordinates)};break;case"MultiPolygon":Lr={type:"MultiPolygon",coordinates:gr.coordinates.map(ye)};break;default:return gr}return gr.bbox!=null&&(Lr.bbox=gr.bbox),Lr}function rr(gr){var Lr={type:"Feature",properties:gr.properties,geometry:ze(gr.geometry)};return gr.id!=null&&(Lr.id=gr.id),gr.bbox!=null&&(Lr.bbox=gr.bbox),Lr}if(Rt!=null)switch(Rt.type){case"Feature":return rr(Rt);case"FeatureCollection":{var fr={type:"FeatureCollection",features:Rt.features.map(rr)};return Rt.bbox!=null&&(fr.bbox=Rt.bbox),fr}default:return ze(Rt)}return Rt}function Rr(Rt){var Gt=m(Rt);function ae(ce,Te){var ye=Gt?w(ce*Gt/2)/Gt:ce/2;if(!Te)return[2*ye,-Rt];var ze=2*t(ye*m(Te)),rr=1/w(Te);return[m(ze)*rr,Te+(1-r(ze))*rr-Rt]}return ae.invert=function(ce,Te){if(A(Te+=Rt)l&&--rr>0);var nn=ce*(gr=w(ze)),cn=w(A(Te)0?S:-S)*(fr+Te*(Lr-ze)/2+Te*Te*(Lr-2*fr+ze)/2)]}ha.invert=function(Rt,Gt){var ae=Gt/S,ce=ae*90,Te=s(18,A(ce/5)),ye=a(0,n(Te));do{var ze=Pn[ye][1],rr=Pn[ye+1][1],fr=Pn[s(19,ye+2)][1],gr=fr-ze,Lr=fr-2*rr+ze,Hr=2*(A(ae)-rr)/gr,nn=Lr/gr,cn=Hr*(1-nn*Hr*(1-2*nn*Hr));if(cn>=0||ye===1){ce=(Gt>=0?5:-5)*(cn+Te);var Mn=50,Jn;do Te=s(18,A(ce)/5),ye=n(Te),cn=Te-ye,ze=Pn[ye][1],rr=Pn[ye+1][1],fr=Pn[s(19,ye+2)][1],ce-=(Jn=(Gt>=0?S:-S)*(rr+cn*(fr-ze)/2+cn*cn*(fr-2*rr+ze)/2)-Gt)*b;while(A(Jn)>x&&--Mn>0);break}}while(--ye>=0);var _a=Pn[ye][0],xa=Pn[ye+1][0],La=Pn[s(19,ye+2)][0];return[Rt/(xa+cn*(La-_a)/2+cn*cn*(La-2*xa+_a)/2),ce*_]};function Ta(){return d.geoProjection(ha).scale(152.63)}function Ua(Rt){function Gt(ae,ce){var Te=r(ce),ye=(Rt-1)/(Rt-Te*r(ae));return[ye*Te*m(ae),ye*m(ce)]}return Gt.invert=function(ae,ce){var Te=ae*ae+ce*ce,ye=B(Te),ze=(Rt-B(1-Te*(Rt+1)/(Rt-1)))/((Rt-1)/ye+ye/(Rt-1));return[e(ae*ze,ye*B(1-ze*ze)),ye?z(ce*ze/ye):0]},Gt}function Ya(Rt,Gt){var ae=Ua(Rt);if(!Gt)return ae;var ce=r(Gt),Te=m(Gt);function ye(ze,rr){var fr=ae(ze,rr),gr=fr[1],Lr=gr*Te/(Rt-1)+ce;return[fr[0]*ce/Lr,gr/Lr]}return ye.invert=function(ze,rr){var fr=(Rt-1)/(Rt-1-rr*Te);return ae.invert(fr*ze,fr*rr*ce)},ye}function va(){var Rt=2,Gt=0,ae=d.geoProjectionMutator(Ya),ce=ae(Rt,Gt);return ce.distance=function(Te){return arguments.length?ae(Rt=+Te,Gt):Rt},ce.tilt=function(Te){return arguments.length?ae(Rt,Gt=Te*_):Gt*b},ce.scale(432.147).clipAngle(D(1/Rt)*b-1e-6)}var Ba=1e-4,za=1e4,ca=-180,ei=ca+Ba,Vi=180,Oi=Vi-Ba,Wi=-90,Xi=Wi+Ba,ni=90,Za=ni-Ba;function $i(Rt){return Rt.length>0}function Do(Rt){return Math.floor(Rt*za)/za}function ss(Rt){return Rt===Wi||Rt===ni?[0,Rt]:[ca,Do(Rt)]}function Ps(Rt){var Gt=Rt[0],ae=Rt[1],ce=!1;return Gt<=ei?(Gt=ca,ce=!0):Gt>=Oi&&(Gt=Vi,ce=!0),ae<=Xi?(ae=Wi,ce=!0):ae>=Za&&(ae=ni,ce=!0),ce?[Gt,ae]:Rt}function ys(Rt){return Rt.map(Ps)}function Os(Rt,Gt,ae){for(var ce=0,Te=Rt.length;ce=Oi||Lr<=Xi||Lr>=Za){ye[ze]=Ps(fr);for(var Hr=ze+1;Hrei&&cnXi&&Mn=rr)break;ae.push({index:-1,polygon:Gt,ring:ye=ye.slice(Hr-1)}),ye[0]=ss(ye[0][1]),ze=-1,rr=ye.length}}}}function Yo(Rt){var Gt,ae=Rt.length,ce={},Te={},ye,ze,rr,fr,gr;for(Gt=0;Gt0?y-rr:rr)*b],gr=d.geoProjection(Rt(ze)).rotate(fr),Lr=d.geoRotation(fr),Hr=gr.center;return delete gr.rotate,gr.center=function(nn){return arguments.length?Hr(Lr(nn)):Lr.invert(Hr())},gr.clipAngle(90)}function fs(Rt){var Gt=r(Rt);function ae(ce,Te){var ye=d.geoGnomonicRaw(ce,Te);return ye[0]*=Gt,ye}return ae.invert=function(ce,Te){return d.geoGnomonicRaw.invert(ce/Gt,Te)},ae}function Ll(){return $l([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function $l(Rt,Gt){return ws(fs,Rt,Gt)}function jl(Rt){if(!(Rt*=2))return d.geoAzimuthalEquidistantRaw;var Gt=-Rt/2,ae=-Gt,ce=Rt*Rt,Te=w(ae),ye=.5/m(ae);function ze(rr,fr){var gr=D(r(fr)*r(rr-Gt)),Lr=D(r(fr)*r(rr-ae)),Hr=fr<0?-1:1;return gr*=gr,Lr*=Lr,[(gr-Lr)/(2*Rt),Hr*B(4*ce*Lr-(ce-gr+Lr)*(ce-gr+Lr))/(2*Rt)]}return ze.invert=function(rr,fr){var gr=fr*fr,Lr=r(B(gr+(nn=rr+Gt)*nn)),Hr=r(B(gr+(nn=rr+ae)*nn)),nn,cn;return[e(cn=Lr-Hr,nn=(Lr+Hr)*Te),(fr<0?-1:1)*D(B(nn*nn+cn*cn)*ye)]},ze}function Bu(){return Jl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Jl(Rt,Gt){return ws(jl,Rt,Gt)}function Ru(Rt,Gt){if(A(Gt)l&&--rr>0);return[g(Rt)*(B(Te*Te+4)+Te)*y/4,S*ze]};function Dc(){return d.geoProjection(ul).scale(127.16)}function Pt(Rt,Gt,ae,ce,Te){function ye(ze,rr){var fr=ae*m(ce*rr),gr=B(1-fr*fr),Lr=B(2/(1+gr*r(ze*=Te)));return[Rt*gr*Lr*m(ze),Gt*fr*Lr]}return ye.invert=function(ze,rr){var fr=ze/Rt,gr=rr/Gt,Lr=B(fr*fr+gr*gr),Hr=2*z(Lr/2);return[e(ze*w(Hr),Rt*Lr)/Te,Lr&&z(rr*m(Hr)/(Gt*ae*Lr))/ce]},ye}function L(Rt,Gt,ae,ce){var Te=y/3;Rt=a(Rt,l),Gt=a(Gt,l),Rt=s(Rt,S),Gt=s(Gt,y-l),ae=a(ae,0),ae=s(ae,100-l),ce=a(ce,l);var ye=ae/100+1,ze=ce/100,rr=D(ye*r(Te))/Te,fr=m(Rt)/m(rr*S),gr=Gt/y,Lr=B(ze*m(Rt/2)/m(Gt/2)),Hr=Lr/B(gr*fr*rr),nn=1/(Lr*B(gr*fr*rr));return Pt(Hr,nn,fr,rr,gr)}function at(){var Rt=65*_,Gt=60*_,ae=20,ce=200,Te=d.geoProjectionMutator(L),ye=Te(Rt,Gt,ae,ce);return ye.poleline=function(ze){return arguments.length?Te(Rt=+ze*_,Gt,ae,ce):Rt*b},ye.parallels=function(ze){return arguments.length?Te(Rt,Gt=+ze*_,ae,ce):Gt*b},ye.inflation=function(ze){return arguments.length?Te(Rt,Gt,ae=+ze,ce):ae},ye.ratio=function(ze){return arguments.length?Te(Rt,Gt,ae,ce=+ze):ce},ye.scale(163.775)}function xt(){return at().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var kt=4*y+3*B(3),Lt=2*B(2*y*B(3)/kt),le=ee(Lt*B(3)/y,Lt,kt/6);function xe(){return d.geoProjection(le).scale(176.84)}function Pe(Rt,Gt){return[Rt*B(1-3*Gt*Gt/(y*y)),Gt]}Pe.invert=function(Rt,Gt){return[Rt/B(1-3*Gt*Gt/(y*y)),Gt]};function $e(){return d.geoProjection(Pe).scale(152.63)}function hr(Rt,Gt){var ae=r(Gt),ce=r(Rt)*ae,Te=1-ce,ye=r(Rt=e(m(Rt)*ae,-m(Gt))),ze=m(Rt);return ae=B(1-ce*ce),[ze*ae-ye*Te,-ye*ae-ze*Te]}hr.invert=function(Rt,Gt){var ae=(Rt*Rt+Gt*Gt)/-2,ce=B(-ae*(2+ae)),Te=Gt*ae+Rt*ce,ye=Rt*ae-Gt*ce,ze=B(ye*ye+Te*Te);return[e(ce*Te,ze*(1+ae)),ze?-z(ce*ye/ze):0]};function pr(){return d.geoProjection(hr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Br(Rt,Gt){var ae=ct(Rt,Gt);return[(ae[0]+Rt/S)/2,(ae[1]+Gt)/2]}Br.invert=function(Rt,Gt){var ae=Rt,ce=Gt,Te=25;do{var ye=r(ce),ze=m(ce),rr=m(2*ce),fr=ze*ze,gr=ye*ye,Lr=m(ae),Hr=r(ae/2),nn=m(ae/2),cn=nn*nn,Mn=1-gr*Hr*Hr,Jn=Mn?D(ye*Hr)*B(_a=1/Mn):_a=0,_a,xa=.5*(2*Jn*ye*nn+ae/S)-Rt,La=.5*(Jn*ze+ce)-Gt,ai=.5*_a*(gr*cn+Jn*ye*Hr*fr)+.5/S,Ai=_a*(Lr*rr/4-Jn*ze*nn),mi=.125*_a*(rr*nn-Jn*ze*gr*Lr),Yi=.5*_a*(fr*Hr+Jn*cn*ye)+.5,Go=Ai*mi-Yi*ai,Xo=(La*Ai-xa*Yi)/Go,po=(xa*mi-La*ai)/Go;ae-=Xo,ce-=po}while((A(Xo)>l||A(po)>l)&&--Te>0);return[ae,ce]};function Jr(){return d.geoProjection(Br).scale(158.837)}u.geoNaturalEarth=d.geoNaturalEarth1,u.geoNaturalEarthRaw=d.geoNaturalEarth1Raw,u.geoAiry=rt,u.geoAiryRaw=G,u.geoAitoff=st,u.geoAitoffRaw=ct,u.geoArmadillo=Z,u.geoArmadilloRaw=et,u.geoAugust=X,u.geoAugustRaw=ot,u.geoBaker=q,u.geoBakerRaw=J,u.geoBerghaus=nt,u.geoBerghausRaw=it,u.geoBertin1953=te,u.geoBertin1953Raw=Nt,u.geoBoggs=re,u.geoBoggsRaw=Ut,u.geoBonne=We,u.geoBonneRaw=Ce,u.geoBottomley=vr,u.geoBottomleyRaw=qe,u.geoBromley=er,u.geoBromleyRaw=_r,u.geoChamberlin=lt,u.geoChamberlinRaw=Dt,u.geoChamberlinAfrica=_t,u.geoCollignon=St,u.geoCollignonRaw=yt,u.geoCraig=Yt,u.geoCraigRaw=Ht,u.geoCraster=Ee,u.geoCrasterRaw=ke,u.geoCylindricalEqualArea=ir,u.geoCylindricalEqualAreaRaw=Ue,u.geoCylindricalStereographic=Ye,u.geoCylindricalStereographicRaw=ar,u.geoEckert1=pn,u.geoEckert1Raw=Er,u.geoEckert2=bn,u.geoEckert2Raw=dn,u.geoEckert3=En,u.geoEckert3Raw=Zn,u.geoEckert4=da,u.geoEckert4Raw=gn,u.geoEckert5=Se,u.geoEckert5Raw=ra,u.geoEckert6=Ze,u.geoEckert6Raw=Re,u.geoEisenlohr=tn,u.geoEisenlohrRaw=zr,u.geoFahey=In,u.geoFaheyRaw=$r,u.geoFoucaut=Kn,u.geoFoucautRaw=Nn,u.geoFoucautSinusoidal=ia,u.geoFoucautSinusoidalRaw=$n,u.geoGilbert=Ga,u.geoGingery=br,u.geoGingeryRaw=ve,u.geoGinzburg4=kr,u.geoGinzburg4Raw=mr,u.geoGinzburg5=Or,u.geoGinzburg5Raw=Ur,u.geoGinzburg6=Ke,u.geoGinzburg6Raw=pe,u.geoGinzburg8=Gr,u.geoGinzburg8Raw=xr,u.geoGinzburg9=wn,u.geoGinzburg9Raw=ln,u.geoGringorten=Qn,u.geoGringortenRaw=Qr,u.geoGuyou=Hi,u.geoGuyouRaw=Ti,u.geoHammer=wt,u.geoHammerRaw=dt,u.geoHammerRetroazimuthal=zo,u.geoHammerRetroazimuthalRaw=Ho,u.geoHealpix=ts,u.geoHealpixRaw=hs,u.geoHill=As,u.geoHillRaw=vs,u.geoHomolosine=Di,u.geoHomolosineRaw=Ms,u.geoHufnagel=No,u.geoHufnagelRaw=_s,u.geoHyperelliptical=io,u.geoHyperellipticalRaw=ii,u.geoInterrupt=Bi,u.geoInterruptedBoggs=fl,u.geoInterruptedHomolosine=us,u.geoInterruptedMollweide=Ls,u.geoInterruptedMollweideHemispheres=bu,u.geoInterruptedSinuMollweide=fu,u.geoInterruptedSinusoidal=xc,u.geoKavrayskiy7=Gl,u.geoKavrayskiy7Raw=cs,u.geoLagrange=Al,u.geoLagrangeRaw=zc,u.geoLarrivee=hu,u.geoLarriveeRaw=Ml,u.geoLaskowski=bl,u.geoLaskowskiRaw=Fs,u.geoLittrow=bs,u.geoLittrowRaw=Fo,u.geoLoximuthal=Nl,u.geoLoximuthalRaw=Iu,u.geoMiller=qs,u.geoMillerRaw=Hu,u.geoModifiedStereographic=wl,u.geoModifiedStereographicRaw=sf,u.geoModifiedStereographicAlaska=pu,u.geoModifiedStereographicGs48=ml,u.geoModifiedStereographicGs50=Lc,u.geoModifiedStereographicMiller=qu,u.geoModifiedStereographicLee=dc,u.geoMollweide=mt,u.geoMollweideRaw=Zt,u.geoMtFlatPolarParabolic=Wu,u.geoMtFlatPolarParabolicRaw=mc,u.geoMtFlatPolarQuartic=Ic,u.geoMtFlatPolarQuarticRaw=Cc,u.geoMtFlatPolarSinusoidal=Bc,u.geoMtFlatPolarSinusoidalRaw=du,u.geoNaturalEarth2=wu,u.geoNaturalEarth2Raw=Pu,u.geoNellHammer=Ju,u.geoNellHammerRaw=Tl,u.geoInterruptedQuarticAuthalic=Es,u.geoNicolosi=lf,u.geoNicolosiRaw=_c,u.geoPatterson=Rl,u.geoPattersonRaw=Ou,u.geoPolyconic=Ws,u.geoPolyconicRaw=Yl,u.geoPolyhedral=ic,u.geoPolyhedralButterfly=Gs,u.geoPolyhedralCollignon=Xc,u.geoPolyhedralWaterman=Vs,u.geoProject=zl,u.geoGringortenQuincuncial=Xe,u.geoPeirceQuincuncial=yr,u.geoPierceQuincuncial=yr,u.geoQuantize=Kr,u.geoQuincuncial=Oc,u.geoRectangularPolyconic=mn,u.geoRectangularPolyconicRaw=Rr,u.geoRobinson=Ta,u.geoRobinsonRaw=ha,u.geoSatellite=va,u.geoSatelliteRaw=Ya,u.geoSinuMollweide=wo,u.geoSinuMollweideRaw=li,u.geoSinusoidal=Me,u.geoSinusoidalRaw=ue,u.geoStitch=Rs,u.geoTimes=so,u.geoTimesRaw=bi,u.geoTwoPointAzimuthal=$l,u.geoTwoPointAzimuthalRaw=fs,u.geoTwoPointAzimuthalUsa=Ll,u.geoTwoPointEquidistant=Jl,u.geoTwoPointEquidistantRaw=jl,u.geoTwoPointEquidistantUsa=Bu,u.geoVanDerGrinten=nl,u.geoVanDerGrintenRaw=Ru,u.geoVanDerGrinten2=Ui,u.geoVanDerGrinten2Raw=Nu,u.geoVanDerGrinten3=Ql,u.geoVanDerGrinten3Raw=fo,u.geoVanDerGrinten4=Dc,u.geoVanDerGrinten4Raw=ul,u.geoWagner=at,u.geoWagner7=xt,u.geoWagnerRaw=L,u.geoWagner4=xe,u.geoWagner4Raw=le,u.geoWagner6=$e,u.geoWagner6Raw=Pe,u.geoWiechel=pr,u.geoWiechelRaw=hr,u.geoWinkel3=Jr,u.geoWinkel3Raw=Br,Object.defineProperty(u,"__esModule",{value:!0})})}),AE=Vt((K,V)=>{var u=Ni(),d=Xr(),E=ji(),A=Math.PI/180,t=180/Math.PI,e={cursor:"pointer"},r={cursor:"auto"};function i(b,_){var P=b.projection,z;return _._isScoped?z=a:_._isClipped?z=f:z=s,z(b,P)}V.exports=i;function n(b,_){return u.behavior.zoom().translate(_.translate()).scale(_.scale())}function o(b,_,P){var z=b.id,D=b.graphDiv,B=D.layout,R=B[z],I=D._fullLayout,F=I[z],j={},N={};function G(rt,ct){j[z+"."+rt]=d.nestedProperty(R,rt).get(),E.call("_storeDirectGUIEdit",B,I._preGUI,j);var st=d.nestedProperty(F,rt);st.get()!==ct&&(st.set(ct),d.nestedProperty(R,rt).set(ct),N[z+"."+rt]=ct)}P(G),G("projection.scale",_.scale()/b.fitScale),G("fitbounds",!1),D.emit("plotly_relayout",N)}function a(b,_){var P=n(b,_);function z(){u.select(this).style(e)}function D(){_.scale(u.event.scale).translate(u.event.translate),b.render(!0);var I=_.invert(b.midPt);b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.center.lon":I[0],"geo.center.lat":I[1]})}function B(I){var F=_.invert(b.midPt);I("center.lon",F[0]),I("center.lat",F[1])}function R(){u.select(this).style(r),o(b,_,B)}return P.on("zoomstart",z).on("zoom",D).on("zoomend",R),P}function s(b,_){var P=n(b,_),z=2,D,B,R,I,F,j,N,G,rt;function ct(Q){return _.invert(Q)}function st(Q){var ut=ct(Q);if(!ut)return!0;var J=_(ut);return Math.abs(J[0]-Q[0])>z||Math.abs(J[1]-Q[1])>z}function et(){u.select(this).style(e),D=u.mouse(this),B=_.rotate(),R=_.translate(),I=B,F=ct(D)}function Z(){if(j=u.mouse(this),st(D)){P.scale(_.scale()),P.translate(_.translate());return}_.scale(u.event.scale),_.translate([R[0],u.event.translate[1]]),F?ct(j)&&(G=ct(j),N=[I[0]+(G[0]-F[0]),B[1],B[2]],_.rotate(N),I=N):(D=j,F=ct(D)),rt=!0,b.render(!0);var Q=_.rotate(),ut=_.invert(b.midPt);b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.center.lon":ut[0],"geo.center.lat":ut[1],"geo.projection.rotation.lon":-Q[0]})}function ot(){u.select(this).style(r),rt&&o(b,_,X)}function X(Q){var ut=_.rotate(),J=_.invert(b.midPt);Q("projection.rotation.lon",-ut[0]),Q("center.lon",J[0]),Q("center.lat",J[1])}return P.on("zoomstart",et).on("zoom",Z).on("zoomend",ot),P}function f(b,_){_.rotate(),_.scale();var P=n(b,_),z=h(P,"zoomstart","zoom","zoomend"),D=0,B=P.on,R;P.on("zoomstart",function(){u.select(this).style(e);var G=u.mouse(this),rt=_.rotate(),ct=rt,st=_.translate(),et=g(rt);R=v(_,G),B.call(P,"zoom",function(){var Z=u.mouse(this);if(_.scale(u.event.scale),!R)G=Z,R=v(_,G);else if(v(_,Z)){_.rotate(rt).translate(st);var ot=v(_,Z),X=w(R,ot),Q=k(m(et,X)),ut=l(Q,R,ct);(!isFinite(ut[0])||!isFinite(ut[1])||!isFinite(ut[2]))&&(ut=ct),_.rotate(ut),ct=ut}F(z.of(this,arguments))}),I(z.of(this,arguments))}).on("zoomend",function(){u.select(this).style(r),B.call(P,"zoom",null),j(z.of(this,arguments)),o(b,_,N)}).on("zoom.redraw",function(){b.render(!0);var G=_.rotate();b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.projection.rotation.lon":-G[0],"geo.projection.rotation.lat":-G[1]})});function I(G){D++||G({type:"zoomstart"})}function F(G){G({type:"zoom"})}function j(G){--D||G({type:"zoomend"})}function N(G){var rt=_.rotate();G("projection.rotation.lon",-rt[0]),G("projection.rotation.lat",-rt[1])}return u.rebind(P,z,"on")}function v(b,_){var P=b.invert(_);return P&&isFinite(P[0])&&isFinite(P[1])&&M(P)}function g(b){var _=.5*b[0]*A,P=.5*b[1]*A,z=.5*b[2]*A,D=Math.sin(_),B=Math.cos(_),R=Math.sin(P),I=Math.cos(P),F=Math.sin(z),j=Math.cos(z);return[B*I*j+D*R*F,D*I*j-B*R*F,B*R*j+D*I*F,B*I*F-D*R*j]}function m(b,_){var P=b[0],z=b[1],D=b[2],B=b[3],R=_[0],I=_[1],F=_[2],j=_[3];return[P*R-z*I-D*F-B*j,P*I+z*R+D*j-B*F,P*F-z*j+D*R+B*I,P*j+z*F-D*I+B*R]}function w(b,_){if(!(!b||!_)){var P=c(b,_),z=Math.sqrt(T(P,P)),D=.5*Math.acos(Math.max(-1,Math.min(1,T(b,_)))),B=Math.sin(D)/z;return z&&[Math.cos(D),P[2]*B,-P[1]*B,P[0]*B]}}function l(b,_,P){var z=S(_,2,b[0]);z=S(z,1,b[1]),z=S(z,0,b[2]-P[2]);var D=_[0],B=_[1],R=_[2],I=z[0],F=z[1],j=z[2],N=Math.atan2(B,D)*t,G=Math.sqrt(D*D+B*B),rt,ct;Math.abs(F)>G?(ct=(F>0?90:-90)-N,rt=0):(ct=Math.asin(F/G)*t-N,rt=Math.sqrt(G*G-F*F));var st=180-ct-2*N,et=(Math.atan2(j,I)-Math.atan2(R,rt))*t,Z=(Math.atan2(j,I)-Math.atan2(R,-rt))*t,ot=x(P[0],P[1],ct,et),X=x(P[0],P[1],st,Z);return ot<=X?[ct,et,P[2]]:[st,Z,P[2]]}function x(b,_,P,z){var D=y(P-b),B=y(z-_);return Math.sqrt(D*D+B*B)}function y(b){return(b%360+540)%360-180}function S(b,_,P){var z=P*A,D=b.slice(),B=_===0?1:0,R=_===2?1:2,I=Math.cos(z),F=Math.sin(z);return D[B]=b[B]*I-b[R]*F,D[R]=b[R]*I+b[B]*F,D}function k(b){return[Math.atan2(2*(b[0]*b[1]+b[2]*b[3]),1-2*(b[1]*b[1]+b[2]*b[2]))*t,Math.asin(Math.max(-1,Math.min(1,2*(b[0]*b[2]-b[3]*b[1]))))*t,Math.atan2(2*(b[0]*b[3]+b[1]*b[2]),1-2*(b[2]*b[2]+b[3]*b[3]))*t]}function M(b){var _=b[0]*A,P=b[1]*A,z=Math.cos(P);return[z*Math.cos(_),z*Math.sin(_),Math.sin(P)]}function T(b,_){for(var P=0,z=0,D=b.length;z{var u=Ni(),d=D3(),E=d.geoPath,A=d.geoDistance,t=kE(),e=ji(),r=Xr(),i=r.strTranslate,n=Pi(),o=Eo(),a=hc(),s=Uu(),f=yo(),v=Xh().getAutoRange,g=oh(),m=Sc().prepSelect,w=Sc().clearOutline,l=Sc().selectOnClick,x=AE(),y=Mv(),S=Ud(),k=Ex(),M=I3().feature;function T(P){this.id=P.id,this.graphDiv=P.graphDiv,this.container=P.container,this.topojsonURL=P.topojsonURL,this.isStatic=P.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var c=T.prototype;V.exports=function(P){return new T(P)},c.plot=function(P,z,D,B){var R=this;if(B)return R.update(P,z,!0);R._geoCalcData=P,R._fullLayout=z;var I=z[this.id],F=[],j=!1;for(var N in y.layerNameToAdjective)if(N!=="frame"&&I["show"+N]){j=!0;break}for(var G=!1,rt=0;rt0&&F._module.calcGeoJSON(I,z)}if(!D){var j=this.updateProjection(P,z);if(j)return;(!this.viewInitial||this.scope!==B.scope)&&this.saveViewInitial(B)}this.scope=B.scope,this.updateBaseLayers(z,B),this.updateDims(z,B),this.updateFx(z,B),s.generalUpdatePerTraceModule(this.graphDiv,this,P,B);var N=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=N.selectAll(".point"),this.dataPoints.text=N.selectAll("text"),this.dataPaths.line=N.selectAll(".js-line");var G=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=G.selectAll("path"),this._render()},c.updateProjection=function(P,z){var D=this.graphDiv,B=z[this.id],R=z._size,I=B.domain,F=B.projection,j=B.lonaxis,N=B.lataxis,G=j._ax,rt=N._ax,ct=this.projection=h(B),st=[[R.l+R.w*I.x[0],R.t+R.h*(1-I.y[1])],[R.l+R.w*I.x[1],R.t+R.h*(1-I.y[0])]],et=B.center||{},Z=F.rotation||{},ot=j.range||[],X=N.range||[];if(B.fitbounds){G._length=st[1][0]-st[0][0],rt._length=st[1][1]-st[0][1],G.range=v(D,G),rt.range=v(D,rt);var Q=(G.range[0]+G.range[1])/2,ut=(rt.range[0]+rt.range[1])/2;if(B._isScoped)et={lon:Q,lat:ut};else if(B._isClipped){et={lon:Q,lat:ut},Z={lon:Q,lat:ut,roll:Z.roll};var J=F.type,q=y.lonaxisSpan[J]/2||180,it=y.lataxisSpan[J]/2||90;ot=[Q-q,Q+q],X=[ut-it,ut+it]}else et={lon:Q,lat:ut},Z={lon:Q,lat:Z.lat,roll:Z.roll}}ct.center([et.lon-Z.lon,et.lat-Z.lat]).rotate([-Z.lon,-Z.lat,Z.roll]).parallels(F.parallels);var nt=_(ot,X);ct.fitExtent(st,nt);var dt=this.bounds=ct.getBounds(nt),Tt=this.fitScale=ct.scale(),wt=ct.translate();if(B.fitbounds){var Ct=ct.getBounds(_(G.range,rt.range)),It=Math.min((dt[1][0]-dt[0][0])/(Ct[1][0]-Ct[0][0]),(dt[1][1]-dt[0][1])/(Ct[1][1]-Ct[0][1]));isFinite(It)?ct.scale(It*Tt):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ct.scale(F.scale*Tt);var Nt=this.midPt=[(dt[0][0]+dt[1][0])/2,(dt[0][1]+dt[1][1])/2];if(ct.translate([wt[0]+(Nt[0]-wt[0]),wt[1]+(Nt[1]-wt[1])]).clipExtent(dt),B._isAlbersUsa){var te=ct([et.lon,et.lat]),Jt=ct.translate();ct.translate([Jt[0]-(te[0]-Jt[0]),Jt[1]-(te[1]-Jt[1])])}},c.updateBaseLayers=function(P,z){var D=this,B=D.topojson,R=D.layers,I=D.basePaths;function F(st){return st==="lonaxis"||st==="lataxis"}function j(st){return!!y.lineLayers[st]}function N(st){return!!y.fillLayers[st]}var G=this.hasChoropleth?y.layersForChoropleth:y.layers,rt=G.filter(function(st){return j(st)||N(st)?z["show"+st]:F(st)?z[st].showgrid:!0}),ct=D.framework.selectAll(".layer").data(rt,String);ct.exit().each(function(st){delete R[st],delete I[st],u.select(this).remove()}),ct.enter().append("g").attr("class",function(st){return"layer "+st}).each(function(st){var et=R[st]=u.select(this);st==="bg"?D.bgRect=et.append("rect").style("pointer-events","all"):F(st)?I[st]=et.append("path").style("fill","none"):st==="backplot"?et.append("g").classed("choroplethlayer",!0):st==="frontplot"?et.append("g").classed("scatterlayer",!0):j(st)?I[st]=et.append("path").style("fill","none").style("stroke-miterlimit",2):N(st)&&(I[st]=et.append("path").style("stroke","none"))}),ct.order(),ct.each(function(st){var et=I[st],Z=y.layerNameToAdjective[st];st==="frame"?et.datum(y.sphereSVG):j(st)||N(st)?et.datum(M(B,B.objects[st])):F(st)&&et.datum(b(st,z,P)).call(n.stroke,z[st].gridcolor).call(o.dashLine,z[st].griddash,z[st].gridwidth),j(st)?et.call(n.stroke,z[Z+"color"]).call(o.dashLine,"",z[Z+"width"]):N(st)&&et.call(n.fill,z[Z+"color"])})},c.updateDims=function(P,z){var D=this.bounds,B=(z.framewidth||0)/2,R=D[0][0]-B,I=D[0][1]-B,F=D[1][0]-R+B,j=D[1][1]-I+B;o.setRect(this.clipRect,R,I,F,j),this.bgRect.call(o.setRect,R,I,F,j).call(n.fill,z.bgcolor),this.xaxis._offset=R,this.xaxis._length=F,this.yaxis._offset=I,this.yaxis._length=j},c.updateFx=function(P,z){var D=this,B=D.graphDiv,R=D.bgRect,I=P.dragmode,F=P.clickmode;if(D.isStatic)return;function j(){var ct=D.viewInitial,st={};for(var et in ct)st[D.id+"."+et]=ct[et];e.call("_guiRelayout",B,st),B.emit("plotly_doubleclick",null)}function N(ct){return D.projection.invert([ct[0]+D.xaxis._offset,ct[1]+D.yaxis._offset])}var G=function(ct,st){if(st.isRect){var et=ct.range={};et[D.id]=[N([st.xmin,st.ymin]),N([st.xmax,st.ymax])]}else{var Z=ct.lassoPoints={};Z[D.id]=st.map(N)}},rt={element:D.bgRect.node(),gd:B,plotinfo:{id:D.id,xaxis:D.xaxis,yaxis:D.yaxis,fillRangeItems:G},xaxes:[D.xaxis],yaxes:[D.yaxis],subplot:D.id,clickFn:function(ct){ct===2&&w(B)}};I==="pan"?(R.node().onmousedown=null,R.call(x(D,z)),R.on("dblclick.zoom",j),B._context._scrollZoom.geo||R.on("wheel.zoom",null)):(I==="select"||I==="lasso")&&(R.on(".zoom",null),rt.prepFn=function(ct,st,et){m(ct,st,et,rt,I)},g.init(rt)),R.on("mousemove",function(){var ct=D.projection.invert(r.getPositionFromD3Event());if(!ct)return g.unhover(B,u.event);D.xaxis.p2c=function(){return ct[0]},D.yaxis.p2c=function(){return ct[1]},a.hover(B,u.event,D.id)}),R.on("mouseout",function(){B._dragging||g.unhover(B,u.event)}),R.on("click",function(){I!=="select"&&I!=="lasso"&&(F.indexOf("select")>-1&&l(u.event,B,[D.xaxis],[D.yaxis],D.id,rt),F.indexOf("event")>-1&&a.click(B,u.event))})},c.makeFramework=function(){var P=this,z=P.graphDiv,D=z._fullLayout,B="clip"+D._uid+P.id;P.clipDef=D._clips.append("clipPath").attr("id",B),P.clipRect=P.clipDef.append("rect"),P.framework=u.select(P.container).append("g").attr("class","geo "+P.id).call(o.setClipUrl,B,z),P.project=function(R){var I=P.projection(R);return I?[I[0]-P.xaxis._offset,I[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(R){return P.project(R)[0]}},P.yaxis={_id:"y",c2p:function(R){return P.project(R)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(P.mockAxis,D)},c.saveViewInitial=function(P){var z=P.center||{},D=P.projection,B=D.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":D.scale};var R;P._isScoped?R={"center.lon":z.lon,"center.lat":z.lat}:P._isClipped?R={"projection.rotation.lon":B.lon,"projection.rotation.lat":B.lat}:R={"center.lon":z.lon,"center.lat":z.lat,"projection.rotation.lon":B.lon},r.extendFlat(this.viewInitial,R)},c.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},c._render=function(){var P=this.projection,z=P.getPath(),D;function B(I){var F=P(I.lonlat);return F?i(F[0],F[1]):null}function R(I){return P.isLonLatOverEdges(I.lonlat)?"none":null}for(D in this.basePaths)this.basePaths[D].attr("d",z);for(D in this.dataPaths)this.dataPaths[D].attr("d",function(I){return z(I.geojson)});for(D in this.dataPoints)this.dataPoints[D].attr("display",R).attr("transform",B)};function h(P){var z=P.projection,D=z.type,B=y.projNames[D];B="geo"+r.titleCase(B);for(var R=d[B]||t[B],I=R(),F=P._isSatellite?Math.acos(1/z.distance)*180/Math.PI:P._isClipped?y.lonaxisSpan[D]/2:null,j=["center","rotate","parallels","clipExtent"],N=function(ct){return ct?I:[]},G=0;GZ}else return!1},I.getPath=function(){return E().projection(I)},I.getBounds=function(ct){return I.getPath().bounds(ct)},I.precision(y.precision),P._isSatellite&&I.tilt(z.tilt).distance(z.distance),F&&I.clipAngle(F-y.clipPad),I}function b(P,z,D){var B=1e-6,R=2.5,I=z[P],F=y.scopeDefaults[z.scope],j,N,G;P==="lonaxis"?(j=F.lonaxisRange,N=F.lataxisRange,G=function(ut,J){return[ut,J]}):P==="lataxis"&&(j=F.lataxisRange,N=F.lonaxisRange,G=function(ut,J){return[J,ut]});var rt={type:"linear",range:[j[0],j[1]-B],tick0:I.tick0,dtick:I.dtick};f.setConvert(rt,D);var ct=f.calcTicks(rt);!z.isScoped&&P==="lonaxis"&&ct.pop();for(var st=ct.length,et=new Array(st),Z=0;Z0&&R<0&&(R+=360);var j=(R-B)/4;return{type:"Polygon",coordinates:[[[B,I],[B,F],[B+j,F],[B+2*j,F],[B+3*j,F],[R,F],[R,I],[R-j,I],[R-2*j,I],[R-3*j,I],[B,I]]]}}}),F3=Vt((K,V)=>{var u=af(),d=Vu().attributes,E=If().dash,A=Mv(),t=Cu().overrideAll,e=wd(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:u.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:E},i=V.exports=t({domain:d({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:e(A.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:e(A.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:u.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:A.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:A.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:A.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:A.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:u.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:u.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:u.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:u.background},lonaxis:r,lataxis:r},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}),SE=Vt((K,V)=>{var u=Xr(),d=Ld(),E=Pf().getSubplotData,A=Mv(),t=F3(),e=A.axesNames;V.exports=function(i,n,o){d(i,n,o,{type:"geo",attributes:t,handleDefaults:r,fullData:o,partition:"y"})};function r(i,n,o,a){var s=E(a.fullData,"geo",a.id),f=s.map(function(X){return X.index}),v=o("resolution"),g=o("scope"),m=A.scopeDefaults[g],w=o("projection.type",m.projType),l=n._isAlbersUsa=w==="albers usa";l&&(g=n.scope="usa");var x=n._isScoped=g!=="world",y=n._isSatellite=w==="satellite",S=n._isConic=w.indexOf("conic")!==-1||w==="albers",k=n._isClipped=!!A.lonaxisSpan[w];if(i.visible===!1){var M=u.extendDeep({},n._template);M.showcoastlines=!1,M.showcountries=!1,M.showframe=!1,M.showlakes=!1,M.showland=!1,M.showocean=!1,M.showrivers=!1,M.showsubunits=!1,M.lonaxis&&(M.lonaxis.showgrid=!1),M.lataxis&&(M.lataxis.showgrid=!1),n._template=M}for(var T=o("visible"),c,h=0;h0&&N<0&&(N+=360);var G=(j+N)/2,rt;if(!l){var ct=x?m.projRotate:[G,0,0];rt=o("projection.rotation.lon",ct[0]),o("projection.rotation.lat",ct[1]),o("projection.rotation.roll",ct[2]),c=o("showcoastlines",!x&&T),c&&(o("coastlinecolor"),o("coastlinewidth")),c=o("showocean",T?void 0:!1),c&&o("oceancolor")}var st,et;if(l?(st=-96.6,et=38.7):(st=x?G:rt,et=(F[0]+F[1])/2),o("center.lon",st),o("center.lat",et),y&&(o("projection.tilt"),o("projection.distance")),S){var Z=m.projParallels||[0,60];o("projection.parallels",Z)}o("projection.scale"),c=o("showland",T?void 0:!1),c&&o("landcolor"),c=o("showlakes",T?void 0:!1),c&&o("lakecolor"),c=o("showrivers",T?void 0:!1),c&&(o("rivercolor"),o("riverwidth")),c=o("showcountries",x&&g!=="usa"&&T),c&&(o("countrycolor"),o("countrywidth")),(g==="usa"||g==="north america"&&v===50)&&(o("showsubunits",T),o("subunitcolor"),o("subunitwidth")),x||(c=o("showframe",T),c&&(o("framecolor"),o("framewidth"))),o("bgcolor");var ot=o("fitbounds");ot&&(delete n.projection.scale,x?(delete n.center.lon,delete n.center.lat):k?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}}),B3=Vt((K,V)=>{var u=Pf().getSubplotCalcData,d=Xr().counterRegex,E=ME(),A="geo",t=d(A),e={};e[A]={valType:"subplotid",dflt:A,editType:"calc"};function r(o){for(var a=o._fullLayout,s=o.calcdata,f=a._subplots[A],v=0;v{V.exports={attributes:E0(),supplyDefaults:mE(),colorbar:Zf(),formatLabels:gE(),calc:Sx(),calcGeoJSON:O3().calcGeoJSON,plot:O3().plot,style:P3(),styleOnSelect:gh().styleOnSelect,hoverPoints:bE(),eventData:wE(),selectPoints:TE(),moduleType:"trace",name:"scattergeo",basePlotModule:B3(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),zE=Vt((K,V)=>{V.exports=EE()}),Zm=Vt((K,V)=>{var{hovertemplateAttrs:u,templatefallbackAttrs:d}=yl(),E=E0(),A=Wl(),t=kl(),e=af().defaultLine,r=So().extendFlat,i=E.marker.line;V.exports=r({locations:{valType:"data_array",editType:"calc"},locationmode:E.locationmode,z:{valType:"data_array",editType:"calc"},geojson:r({},E.geojson,{}),featureidkey:E.featureidkey,text:r({},E.text,{}),hovertext:r({},E.hovertext,{}),marker:{line:{color:r({},i.color,{dflt:e}),width:r({},i.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:E.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:E.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:r({},t.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:u(),hovertemplatefallback:d(),showlegend:r({},t.showlegend,{dflt:!1})},A("",{cLetter:"z",editTypeOverride:"calc"}))}),LE=Vt((K,V)=>{var u=Xr(),d=vf(),E=Zm(),A=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");V.exports=function(t,e,r,i){function n(m,w){return u.coerce(t,e,E,m,w)}var o=n("locations"),a=n("z");if(!(o&&o.length&&u.isArrayOrTypedArray(a)&&a.length)){e.visible=!1;return}e._length=Math.min(o.length,a.length);var s=n("geojson"),f;(typeof s=="string"&&s!==""||u.isPlainObject(s))&&(f="geojson-id");var v=n("locationmode",f);v==="country names"&&u.warn(A),v==="geojson-id"&&n("featureidkey"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback");var g=n("marker.line.width");g&&n("marker.line.color"),n("marker.opacity"),d(t,e,i,n,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(e,n)}}),Cx=Vt((K,V)=>{var u=Lo(),d=ks().BADNUM,E=ih(),A=vp(),t=Uh();function e(r){return r&&typeof r=="string"}V.exports=function(r,i){var n=i._length,o=new Array(n),a;i.geojson?a=function(m){return e(m)||u(m)}:a=e;for(var s=0;s{var u=Ni(),d=Pi(),E=Eo(),A=xu();function t(i,n){n&&e(i,n)}function e(i,n){var o=n[0].trace,a=n[0].node3,s=a.selectAll(".choroplethlocation"),f=o.marker||{},v=f.line||{},g=A.makeColorScaleFuncFromTrace(o);s.each(function(m){u.select(this).attr("fill",g(m.z)).call(d.stroke,m.mlc||v.color).call(E.dashLine,"",m.mlw||v.width||0).style("opacity",f.opacity)}),E.selectedPointStyle(s,o)}function r(i,n){var o=n[0].node3,a=n[0].trace;a.selectedpoints?E.selectedPointStyle(o.selectAll(".choroplethlocation"),a):e(i,n)}V.exports={style:t,styleOnSelect:r}}),R3=Vt((K,V)=>{var u=Ni(),d=Xr(),E=Ud(),A=Ex().getTopojsonFeatures,t=Xh().findExtremes,e=Ix().style;function r(n,o,a){var s=o.layers.backplot.select(".choroplethlayer");d.makeTraceGroups(s,a,"trace choropleth").each(function(f){var v=u.select(this),g=v.selectAll("path.choroplethlocation").data(d.identity);g.enter().append("path").classed("choroplethlocation",!0),g.exit().remove(),e(n,f)})}function i(n,o){for(var a=n[0].trace,s=o[a.geo],f=s._subplot,v=a.locationmode,g=a._length,m=v==="geojson-id"?E.extractTraceFeature(n):A(a,f.topojson),w=[],l=[],x=0;x{var u=yo(),d=Zm(),E=Xr().fillText;V.exports=function(t,e,r){var i=t.cd,n=i[0].trace,o=t.subplot,a,s,f,v,g=[e,r],m=[e+360,r];for(s=0;s")}}}),Ox=Vt((K,V)=>{V.exports=function(u,d,E,A,t){u.location=d.location,u.z=d.z;var e=A[t];return e.fIn&&e.fIn.properties&&(u.properties=e.fIn.properties),u.ct=e.ct,u}}),Dx=Vt((K,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i,n,o,a;if(d===!1)for(r=0;r{V.exports={attributes:Zm(),supplyDefaults:LE(),colorbar:zd(),calc:Cx(),calcGeoJSON:R3().calcGeoJSON,plot:R3().plot,style:Ix().style,styleOnSelect:Ix().styleOnSelect,hoverPoints:Px(),eventData:Ox(),selectPoints:Dx(),moduleType:"trace",name:"choropleth",basePlotModule:B3(),categories:["geo","noOpacity","showLegend"],meta:{}}}),IE=Vt((K,V)=>{V.exports=CE()}),Fx=Vt((K,V)=>{var u=ji(),d=Xr(),E=Sm();function A(e,r,i,n){var o=e.cd,a=o[0].t,s=o[0].trace,f=e.xa,v=e.ya,g=a.x,m=a.y,w=f.c2p(r),l=v.c2p(i),x=e.distance,y;if(a.tree){var S=f.p2c(w-x),k=f.p2c(w+x),M=v.p2c(l-x),T=v.p2c(l+x);n==="x"?y=a.tree.range(Math.min(S,k),Math.min(v._rl[0],v._rl[1]),Math.max(S,k),Math.max(v._rl[0],v._rl[1])):y=a.tree.range(Math.min(S,k),Math.min(M,T),Math.max(S,k),Math.max(M,T))}else y=a.ids;var c,h,b,_,P,z,D,B,R,I=x;if(n==="x"){var F=!!s.xperiodalignment,j=!!s.yperiodalignment;for(P=0;P=Math.min(N,G)&&w<=Math.max(N,G)?0:1/0}if(z=Math.min(rt,ct)&&l<=Math.max(rt,ct)?0:1/0}R=Math.sqrt(z*z+D*D),h=y[P]}}}else for(P=y.length-1;P>-1;P--)c=y[P],b=g[c],_=m[c],z=f.c2p(b)-w,D=v.c2p(_)-l,B=Math.sqrt(z*z+D*D),B{var u=20;V.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:u,SYMBOL_STROKE:u/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),Ev=Vt((K,V)=>{var u=kl(),d=yu(),E=Qh(),A=pc(),t=fc().axisHoverFormat,e=Wl(),r=wd(),i=So().extendFlat,n=Cu().overrideAll,o=Vd().DASHES,a=A.line,s=A.marker,f=s.line,v=V.exports=n({x:A.x,x0:A.x0,dx:A.dx,y:A.y,y0:A.y0,dy:A.dy,xperiod:A.xperiod,yperiod:A.yperiod,xperiod0:A.xperiod0,yperiod0:A.yperiod0,xperiodalignment:A.xperiodalignment,yperiodalignment:A.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),text:A.text,hovertext:A.hovertext,textposition:A.textposition,textfont:d({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:a.color,width:a.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:r(o),dflt:"solid"}},marker:i({},e("marker"),{symbol:s.symbol,angle:s.angle,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,opacity:s.opacity,colorbar:s.colorbar,line:i({},e("marker.line"),{width:f.width})}),connectgaps:A.connectgaps,fill:i({},A.fill,{dflt:"none"}),fillcolor:E(),selected:{marker:A.selected.marker,textfont:A.selected.textfont},unselected:{marker:A.unselected.marker,textfont:A.unselected.textfont},opacity:u.opacity},"calc","nested");v.x.editType=v.y.editType=v.x0.editType=v.y0.editType="calc+clearAxisTypes",v.hovertemplate=A.hovertemplate,v.hovertemplatefallback=A.hovertemplatefallback,v.texttemplate=A.texttemplate,v.texttemplatefallback=A.texttemplatefallback}),Bx=Vt(K=>{var V=Vd();K.isOpenSymbol=function(u){return typeof u=="string"?V.OPEN_RE.test(u):u%200>100},K.isDotSymbol=function(u){return typeof u=="string"?V.DOT_RE.test(u):u>200}}),PE=Vt((K,V)=>{var u=Xr(),d=ji(),E=Bx(),A=Ev(),t=gp(),e=nu(),r=km(),i=tp(),n=Ch(),o=Rh(),a=ep(),s=Nh();V.exports=function(f,v,g,m){function w(c,h){return u.coerce(f,v,A,c,h)}var l=f.marker?E.isOpenSymbol(f.marker.symbol):!1,x=e.isBubble(f),y=r(f,v,m,w);if(!y){v.visible=!1;return}i(f,v,m,w),w("xhoverformat"),w("yhoverformat");var S=y{var u=t1();V.exports=function(d,E,A){var t=d.i;return"x"in d||(d.x=E._x[t]),"y"in d||(d.y=E._y[t]),u(d,E,A)}}),DE=Vt((K,V)=>{function u(r,i,n,o,a){for(var s=a+1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g>=0?(s=f,a=f-1):o=f+1}return s}function d(r,i,n,o,a){for(var s=a+1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g>0?(s=f,a=f-1):o=f+1}return s}function E(r,i,n,o,a){for(var s=o-1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g<0?(s=f,o=f+1):a=f-1}return s}function A(r,i,n,o,a){for(var s=o-1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g<=0?(s=f,o=f+1):a=f-1}return s}function t(r,i,n,o,a){for(;o<=a;){var s=o+a>>>1,f=r[s],v=n!==void 0?n(f,i):f-i;if(v===0)return s;v<=0?o=s+1:a=s-1}return-1}function e(r,i,n,o,a,s){return typeof n=="function"?s(r,i,n,o===void 0?0:o|0,a===void 0?r.length-1:a|0):s(r,i,void 0,n===void 0?0:n|0,o===void 0?r.length-1:o|0)}V.exports={ge:function(r,i,n,o,a){return e(r,i,n,o,a,u)},gt:function(r,i,n,o,a){return e(r,i,n,o,a,d)},lt:function(r,i,n,o,a){return e(r,i,n,o,a,E)},le:function(r,i,n,o,a){return e(r,i,n,o,a,A)},eq:function(r,i,n,o,a){return e(r,i,n,o,a,t)}}}),_p=Vt((K,V)=>{V.exports=function(E,A,t){var e={},r,i;if(typeof A=="string"&&(A=d(A)),Array.isArray(A)){var n={};for(i=0;i{var u=_p();V.exports=d;function d(E){var A;return arguments.length>1&&(E=arguments),typeof E=="string"?E=E.split(/\s/).map(parseFloat):typeof E=="number"&&(E=[E]),E.length&&typeof E[0]=="number"?E.length===1?A={width:E[0],height:E[0],x:0,y:0}:E.length===2?A={width:E[0],height:E[1],x:0,y:0}:A={x:E[0],y:E[1],width:E[2]-E[0]||0,height:E[3]-E[1]||0}:E&&(E=u(E,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),A={x:E.left||0,y:E.top||0},E.width==null?E.right?A.width=E.right-A.x:A.width=0:A.width=E.width,E.height==null?E.bottom?A.height=E.bottom-A.y:A.height=0:A.height=E.height),A}}),z0=Vt((K,V)=>{V.exports=u;function u(d,E){if(!d||d.length==null)throw Error("Argument should be an array");E==null?E=1:E=Math.floor(E);for(var A=Array(E*2),t=0;te&&(e=d[i]),d[i]{V.exports=function(){for(var u=0;u{var u=wx();V.exports=d;function d(E,A,t){if(!E)throw new TypeError("must specify data as first parameter");if(t=+(t||0)|0,Array.isArray(E)&&E[0]&&typeof E[0][0]=="number"){var e=E[0].length,r=E.length*e,i,n,o,a;(!A||typeof A=="string")&&(A=new(u(A||"float32"))(r+t));var s=A.length-t;if(r!==s)throw new Error("source length "+r+" ("+e+"x"+E.length+") does not match destination length "+s);for(i=0,o=t;i{V.exports=function(u){var d=typeof u;return u!==null&&(d==="object"||d==="function")}}),RE=Vt((K,V)=>{V.exports=Math.log2||function(u){return Math.log(u)*Math.LOG2E}}),NE=Vt((K,V)=>{var u=DE(),d=kv(),E=Km(),A=z0(),t=_p(),e=FE(),r=L0(),i=BE(),n=wx(),o=RE(),a=1073741824;V.exports=function(f,v){v||(v={}),f=r(f,"float64"),v=t(v,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let g=e(v.maxDepth,255),m=e(v.bounds,A(f,2));m[0]===m[2]&&m[2]++,m[1]===m[3]&&m[3]++;let w=s(f,m),l=f.length>>>1,x;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?x=new(n(v.dtype))(l):v.dtype&&(x=v.dtype,Array.isArray(x)&&(x.length=l));for(let P=0;Pg||I>a){for(let Q=0;Qit||N>nt||G=ct||J===q)return;let dt=y[ut];q===void 0&&(q=dt.length);for(let Zt=J;Zt=B&&bt<=I&&vt>=R&&vt<=F&&st.push(mt)}let Tt=S[ut],wt=Tt[J*4+0],Ct=Tt[J*4+1],It=Tt[J*4+2],Nt=Tt[J*4+3],te=Z(Tt,J+1),Jt=Q*.5,ee=ut+1;et(ot,X,Jt,ee,wt,Ct||It||Nt||te),et(ot,X+Jt,Jt,ee,Ct,It||Nt||te),et(ot+Jt,X,Jt,ee,It,Nt||te),et(ot+Jt,X+Jt,Jt,ee,Nt,te)}function Z(ot,X){let Q=null,ut=0;for(;Q===null;)if(Q=ot[X*4+ut],ut++,ut>ot.length)return null;return Q}return st}function b(P,z,D,B,R){let I=[];for(let F=0;F{V.exports=NE()}),N3=Vt((K,V)=>{V.exports=u;function u(d){var E=0,A=0,t=0,e=0;return d.map(function(r){r=r.slice();var i=r[0],n=i.toUpperCase();if(i!=n)switch(r[0]=n,i){case"a":r[6]+=t,r[7]+=e;break;case"v":r[1]+=e;break;case"h":r[1]+=t;break;default:for(var o=1;o{Object.defineProperty(K,"__esModule",{value:!0});var u=(function(){function i(n,o){var a=[],s=!0,f=!1,v=void 0;try{for(var g=n[Symbol.iterator](),m;!(s=(m=g.next()).done)&&(a.push(m.value),!(o&&a.length===o));s=!0);}catch(w){f=!0,v=w}finally{try{!s&&g.return&&g.return()}finally{if(f)throw v}}return a}return function(n,o){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return i(n,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=Math.PI*2,E=function(i,n,o,a,s,f,v){var g=i.x,m=i.y;g*=n,m*=o;var w=a*g-s*m,l=s*g+a*m;return{x:w+f,y:l+v}},A=function(i,n){var o=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),a=Math.cos(i),s=Math.sin(i),f=Math.cos(i+n),v=Math.sin(i+n);return[{x:a-s*o,y:s+a*o},{x:f+v*o,y:v-f*o},{x:f,y:v}]},t=function(i,n,o,a){var s=i*a-n*o<0?-1:1,f=i*o+n*a;return f>1&&(f=1),f<-1&&(f=-1),s*Math.acos(f)},e=function(i,n,o,a,s,f,v,g,m,w,l,x){var y=Math.pow(s,2),S=Math.pow(f,2),k=Math.pow(l,2),M=Math.pow(x,2),T=y*S-y*M-S*k;T<0&&(T=0),T/=y*M+S*k,T=Math.sqrt(T)*(v===g?-1:1);var c=T*s/f*x,h=T*-f/s*l,b=w*c-m*h+(i+o)/2,_=m*c+w*h+(n+a)/2,P=(l-c)/s,z=(x-h)/f,D=(-l-c)/s,B=(-x-h)/f,R=t(1,0,P,z),I=t(P,z,D,B);return g===0&&I>0&&(I-=d),g===1&&I<0&&(I+=d),[b,_,R,I]},r=function(i){var n=i.px,o=i.py,a=i.cx,s=i.cy,f=i.rx,v=i.ry,g=i.xAxisRotation,m=g===void 0?0:g,w=i.largeArcFlag,l=w===void 0?0:w,x=i.sweepFlag,y=x===void 0?0:x,S=[];if(f===0||v===0)return[];var k=Math.sin(m*d/360),M=Math.cos(m*d/360),T=M*(n-a)/2+k*(o-s)/2,c=-k*(n-a)/2+M*(o-s)/2;if(T===0&&c===0)return[];f=Math.abs(f),v=Math.abs(v);var h=Math.pow(T,2)/Math.pow(f,2)+Math.pow(c,2)/Math.pow(v,2);h>1&&(f*=Math.sqrt(h),v*=Math.sqrt(h));var b=e(n,o,a,s,f,v,l,y,k,M,T,c),_=u(b,4),P=_[0],z=_[1],D=_[2],B=_[3],R=Math.abs(B)/(d/4);Math.abs(1-R)<1e-7&&(R=1);var I=Math.max(Math.ceil(R),1);B/=I;for(var F=0;F{V.exports=d;var u=jE();function d(t){for(var e,r=[],i=0,n=0,o=0,a=0,s=null,f=null,v=0,g=0,m=0,w=t.length;m4?(i=l[l.length-4],n=l[l.length-3]):(i=v,n=g),r.push(l)}return r}function E(t,e,r,i){return["C",t,e,r,i,r,i]}function A(t,e,r,i,n,o){return["C",t/3+2/3*r,e/3+2/3*i,n/3+2/3*r,o/3+2/3*i,n,o]}}),j3=Vt((K,V)=>{V.exports=function(u){return typeof u!="string"?!1:(u=u.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(u)&&/[\dz]$/i.test(u)&&u.length>4))}}),VE=Vt((K,V)=>{var u=Dg(),d=N3(),E=UE(),A=j3(),t=av();V.exports=e;function e(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(t(A(r),"String is not an SVG path."),r=u(r)),t(Array.isArray(r),"Argument should be a string or an array of path segments."),r=d(r),r=E(r),!r.length)return[0,0,0,0];for(var i=[1/0,1/0,-1/0,-1/0],n=0,o=r.length;ni[2]&&(i[2]=a[s+0]),a[s+1]>i[3]&&(i[3]=a[s+1]);return i}}),HE=Vt((K,V)=>{var u=Math.PI,d=i(120);V.exports=E;function E(n){for(var o,a=[],s=0,f=0,v=0,g=0,m=null,w=null,l=0,x=0,y=0,S=n.length;y7&&(a.push(k.splice(0,7)),k.unshift("C"));break;case"S":var T=l,c=x;(o=="C"||o=="S")&&(T+=T-s,c+=c-f),k=["C",T,c,k[1],k[2],k[3],k[4]];break;case"T":o=="Q"||o=="T"?(m=l*2-m,w=x*2-w):(m=l,w=x),k=t(l,x,m,w,k[1],k[2]);break;case"Q":m=k[1],w=k[2],k=t(l,x,k[1],k[2],k[3],k[4]);break;case"L":k=A(l,x,k[1],k[2]);break;case"H":k=A(l,x,k[1],x);break;case"V":k=A(l,x,l,k[1]);break;case"Z":k=A(l,x,v,g);break}o=M,l=k[k.length-2],x=k[k.length-1],k.length>4?(s=k[k.length-4],f=k[k.length-3]):(s=l,f=x),a.push(k)}return a}function A(n,o,a,s){return["C",n,o,a,s,a,s]}function t(n,o,a,s,f,v){return["C",n/3+2/3*a,o/3+2/3*s,f/3+2/3*a,v/3+2/3*s,f,v]}function e(n,o,a,s,f,v,g,m,w,l){if(l)_=l[0],P=l[1],h=l[2],b=l[3];else{var x=r(n,o,-f);n=x.x,o=x.y,x=r(m,w,-f),m=x.x,w=x.y;var y=(n-m)/2,S=(o-w)/2,k=y*y/(a*a)+S*S/(s*s);k>1&&(k=Math.sqrt(k),a=k*a,s=k*s);var M=a*a,T=s*s,c=(v==g?-1:1)*Math.sqrt(Math.abs((M*T-M*S*S-T*y*y)/(M*S*S+T*y*y)));c==1/0&&(c=1);var h=c*a*S/s+(n+m)/2,b=c*-s*y/a+(o+w)/2,_=Math.asin(((o-b)/s).toFixed(9)),P=Math.asin(((w-b)/s).toFixed(9));_=nP&&(_=_-u*2),!g&&P>_&&(P=P-u*2)}if(Math.abs(P-_)>d){var z=P,D=m,B=w;P=_+d*(g&&P>_?1:-1),m=h+a*Math.cos(P),w=b+s*Math.sin(P);var R=e(m,w,a,s,f,0,g,D,B,[P,z,h,b])}var I=Math.tan((P-_)/4),F=4/3*a*I,j=4/3*s*I,N=[2*n-(n+F*Math.sin(_)),2*o-(o-j*Math.cos(_)),m+F*Math.sin(P),w-j*Math.cos(P),m,w];if(l)return N;R&&(N=N.concat(R));for(var G=0;G{var u=N3(),d=HE(),E={M:"moveTo",C:"bezierCurveTo"};V.exports=function(A,t){A.beginPath(),d(u(t)).forEach(function(e){var r=e[0],i=e.slice(1);A[E[r]].apply(A,i)}),A.closePath()}}),WE=Vt((K,V)=>{var u=kv();V.exports=E;var d=1e20;function E(e,r){r||(r={});var i=r.cutoff==null?.25:r.cutoff,n=r.radius==null?8:r.radius,o=r.channel||0,a,s,f,v,g,m,w,l,x,y,S;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!r.width||!r.height)throw Error("For raw data width and height should be provided by options");a=r.width,s=r.height,v=e,r.stride?m=r.stride:m=Math.floor(e.length/a/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(l=e,w=l.getContext("2d"),a=l.width,s=l.height,x=w.getImageData(0,0,a,s),v=x.data,m=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(l=e.canvas,w=e,a=l.width,s=l.height,x=w.getImageData(0,0,a,s),v=x.data,m=4):window.ImageData&&e instanceof window.ImageData&&(x=e,a=e.width,s=e.height,v=x.data,m=4);if(f=Math.max(a,s),window.Uint8ClampedArray&&v instanceof window.Uint8ClampedArray||window.Uint8Array&&v instanceof window.Uint8Array)for(g=v,v=Array(a*s),y=0,S=g.length;y{var u=VE(),d=Dg(),E=qE(),A=j3(),t=WE(),e=document.createElement("canvas"),r=e.getContext("2d");V.exports=i;function i(a,s){if(!A(a))throw Error("Argument should be valid svg path string");s||(s={});var f,v;s.shape?(f=s.shape[0],v=s.shape[1]):(f=e.width=s.w||s.width||200,v=e.height=s.h||s.height||200);var g=Math.min(f,v),m=s.stroke||0,w=s.viewbox||s.viewBox||u(a),l=[f/(w[2]-w[0]),v/(w[3]-w[1])],x=Math.min(l[0]||0,l[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,f,v),r.fillStyle="white",m&&(typeof m!="number"&&(m=1),m>0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(m)),r.translate(f*.5,v*.5),r.scale(x,x),o()){var y=new Path2D(a);r.fill(y),m&&r.stroke(y)}else{var S=d(a);E(r,S),r.fill(),m&&r.stroke()}r.setTransform(1,0,0,1,0,0);var k=t(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:g*.5});return k}var n;function o(){if(n!=null)return n;var a=document.createElement("canvas").getContext("2d");if(a.canvas.width=a.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");a.fillStyle="black",a.fill(s);var f=a.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}),C0=Vt((K,V)=>{var u=Lo(),d=GE(),E=Rd(),A=ji(),t=Xr(),e=t.isArrayOrTypedArray,r=Eo(),i=cc(),n=Vp().formatColor,o=nu(),a=bm(),s=Bx(),f=Vd(),v=_d().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=mh().appendArrayPointValue;function w(R,I){var F,j={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},N=R._context.plotGlPixelRatio;if(I.visible!==!0)return j;if(o.hasText(I)&&(j.text=l(R,I),j.textSel=k(R,I,I.selected),j.textUnsel=k(R,I,I.unselected)),o.hasMarkers(I)&&(j.marker=y(R,I),j.markerSel=S(R,I,I.selected),j.markerUnsel=S(R,I,I.unselected),!I.unselected&&e(I.marker.opacity))){var G=I.marker.opacity;for(j.markerUnsel.opacity=new Array(G.length),F=0;F500?"bold":"normal":R}function y(R,I){var F=I._length,j=I.marker,N={},G,rt=e(j.symbol),ct=e(j.angle),st=e(j.color),et=e(j.line.color),Z=e(j.opacity),ot=e(j.size),X=e(j.line.width),Q;if(rt||(Q=s.isOpenSymbol(j.symbol)),rt||st||et||Z||ct){N.symbols=new Array(F),N.angles=new Array(F),N.colors=new Array(F),N.borderColors=new Array(F);var ut=j.symbol,J=j.angle,q=n(j,j.opacity,F),it=n(j.line,j.opacity,F);if(!e(it[0])){var nt=it;for(it=Array(F),G=0;Gf.TOO_MANY_POINTS||o.hasMarkers(I)?"rect":"round";if(et&&I.connectgaps){var ot=G[0],X=G[1];for(rt=0;rt1?st[rt]:st[0]:st,Q=e(et)?et.length>1?et[rt]:et[0]:et,ut=g[X],J=g[Q],q=Z?Z/.8+1:0,it=-J*q-J*.5;G.offset[rt]=[ut*q/ot,it/ot]}}return G}V.exports={style:w,markerStyle:y,markerSelection:S,linePositions:z,errorBarPositions:D,textPosition:B}}),U3=Vt((K,V)=>{var u=Xr();V.exports=function(d,E){var A=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},e={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(A=E._scene={},A.init=function(){u.extendFlat(A,e,t)},A.init(),A.update=function(r){var i=u.repeat(r,A.count);if(A.fill2d&&A.fill2d.update(i),A.scatter2d&&A.scatter2d.update(i),A.line2d&&A.line2d.update(i),A.error2d&&A.error2d.update(i.concat(i)),A.select2d&&A.select2d.update(i),A.glText)for(var n=0;n{var u=Rx(),d=Xr(),E=cc(),A=Xh().findExtremes,t=rp(),e=Vh(),r=e.calcMarkerSize,i=e.calcAxisExpansion,n=e.setFirstScatter,o=jh(),a=C0(),s=U3(),f=ks().BADNUM,v=Vd().TOO_MANY_POINTS;V.exports=function(w,l){var x=w._fullLayout,y=l._xA=E.getFromId(w,l.xaxis,"x"),S=l._yA=E.getFromId(w,l.yaxis,"y"),k=x._plots[l.xaxis+l.yaxis],M=l._length,T=M>=v,c=M*2,h={},b,_=y.makeCalcdata(l,"x"),P=S.makeCalcdata(l,"y"),z=t(l,y,"x",_),D=t(l,S,"y",P),B=z.vals,R=D.vals;l._x=B,l._y=R,l.xperiodalignment&&(l._origX=_,l._xStarts=z.starts,l._xEnds=z.ends),l.yperiodalignment&&(l._origY=P,l._yStarts=D.starts,l._yEnds=D.ends);var I=new Array(c),F=new Array(M);for(b=0;b1&&d.extendFlat(M.line,a.linePositions(w,x,y)),M.errorX||M.errorY){var T=a.errorBarPositions(w,x,y,S,k);M.errorX&&d.extendFlat(M.errorX,T.x),M.errorY&&d.extendFlat(M.errorY,T.y)}return M.text&&(d.extendFlat(M.text,{positions:y},a.textPosition(w,x,M.text,M.marker)),d.extendFlat(M.textSel,{positions:y},a.textPosition(w,x,M.text,M.markerSel)),d.extendFlat(M.textUnsel,{positions:y},a.textPosition(w,x,M.text,M.markerUnsel))),M}}),V3=Vt((K,V)=>{var u=Xr(),d=Pi(),E=_d().DESELECTDIM;function A(t){var e=t[0],r=e.trace,i=e.t,n=i._scene,o=i.index,a=n.selectBatch[o],s=n.unselectBatch[o],f=n.textOptions[o],v=n.textSelectedOptions[o]||{},g=n.textUnselectedOptions[o]||{},m=u.extendFlat({},f),w,l;if(a.length||s.length){var x=v.color,y=g.color,S=f.color,k=u.isArrayOrTypedArray(S);for(m.color=new Array(r._length),w=0;w{var u=nu(),d=V3().styleTextSelection;V.exports=function(E,A){var t=E.cd,e=E.xaxis,r=E.yaxis,i=[],n=t[0].trace,o=t[0].t,a=n._length,s=o.x,f=o.y,v=o._scene,g=o.index;if(!v)return i;var m=u.hasText(n),w=u.hasMarkers(n),l=!w&&!m;if(n.visible!==!0||l)return i;var x=[],y=[];if(A!==!1&&!A.degenerate)for(var S=0;S{var u=Fx();V.exports={moduleType:"trace",name:"scattergl",basePlotModule:Kc(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Ev(),supplyDefaults:PE(),crossTraceDefaults:Db(),colorbar:Zf(),formatLabels:OE(),calc:ZE(),hoverPoints:u.hoverPoints,selectPoints:H3(),meta:{}}}),YE=Vt((K,V)=>{var u=kv();V.exports=d,V.exports.to=d,V.exports.from=E;function d(A,t){t==null&&(t=!0);var e=A[0],r=A[1],i=A[2],n=A[3];n==null&&(n=t?1:255),t&&(e*=255,r*=255,i*=255,n*=255),e=u(e,0,255)&255,r=u(r,0,255)&255,i=u(i,0,255)&255,n=u(n,0,255)&255;var o=e*16777216+(r<<16)+(i<<8)+n;return o}function E(A,t){A=+A;var e=A>>>24,r=(A&16711680)>>>16,i=(A&65280)>>>8,n=A&255;return t===!1?[e,r,i,n]:[e/255,r/255,i/255,n/255]}}),of=Vt((K,V)=>{var u=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;function A(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function t(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},i=0;i<10;i++)r["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(a){o[a]=a}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}V.exports=t()?Object.assign:function(e,r){for(var i,n=A(e),o,a=1;a{V.exports=function(u){typeof u=="string"&&(u=[u]);for(var d=[].slice.call(arguments,1),E=[],A=0;A{V.exports=function(u,d,E){Array.isArray(E)||(E=[].slice.call(arguments,2));for(var A=0,t=E.length;A{V.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),Nx=Vt((K,V)=>{V.exports=E,V.exports.float32=V.exports.float=E,V.exports.fract32=V.exports.fract=d;var u=new Float32Array(1);function d(A,t){if(A.length){if(A instanceof Float32Array)return new Float32Array(A.length);t instanceof Float32Array||(t=E(A));for(var e=0,r=t.length;e{function u(b,_){var P=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(P!=null){var z,D,B,R,I=[],F=!0,j=!1;try{if(B=(P=P.call(b)).next,_!==0)for(;!(F=(z=B.call(P)).done)&&(I.push(z.value),I.length!==_);F=!0);}catch(N){j=!0,D=N}finally{try{if(!F&&P.return!=null&&(R=P.return(),Object(R)!==R))return}finally{if(j)throw D}}return I}}function d(b,_){return t(b)||u(b,_)||r(b,_)||o()}function E(b){return A(b)||e(b)||r(b)||n()}function A(b){if(Array.isArray(b))return i(b)}function t(b){if(Array.isArray(b))return b}function e(b){if(typeof Symbol<"u"&&b[Symbol.iterator]!=null||b["@@iterator"]!=null)return Array.from(b)}function r(b,_){if(b){if(typeof b=="string")return i(b,_);var P=Object.prototype.toString.call(b).slice(8,-1);if(P==="Object"&&b.constructor&&(P=b.constructor.name),P==="Map"||P==="Set")return Array.from(b);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return i(b,_)}}function i(b,_){(_==null||_>b.length)&&(_=b.length);for(var P=0,z=new Array(_);P<_;P++)z[P]=b[P];return z}function n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=Rd(),s=z0(),f=YE(),v=Rx(),g=of(),m=XE(),w=_p(),l=q3(),x=L0(),y=$E(),S=Nx(),k=Km(),M=T;function T(b,_){var P=this;if(!(this instanceof T))return new T(b,_);typeof b=="function"?(_||(_={}),_.regl=b):(_=b,b=null),_&&_.length&&(_.positions=_),b=_.regl;var z=b._gl,D,B=[],R={},I=[],F=[null],j=[null],N=255,G=100;this.tooManyColors=y,D=b.texture({data:new Uint8Array(N*4),width:N,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),g(this,{regl:b,gl:z,groups:I,markerCache:j,markerTextures:F,palette:B,paletteIds:R,paletteTexture:D,maxColors:N,maxSize:G,canvas:z.canvas}),this.update(_);var rt={uniforms:{constPointSize:!!_.constPointSize,opacity:b.prop("opacity"),paletteSize:function(et,Z){return[P.tooManyColors?0:N,D.height]},pixelRatio:b.context("pixelRatio"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translate:b.prop("translate"),translateFract:b.prop("translateFract"),markerTexture:b.prop("markerTexture"),paletteTexture:D},attributes:{x:function(et,Z){return Z.xAttr||{buffer:Z.positionBuffer,stride:8,offset:0}},y:function(et,Z){return Z.yAttr||{buffer:Z.positionBuffer,stride:8,offset:4}},xFract:function(et,Z){return Z.xAttr?{constant:[0,0]}:{buffer:Z.positionFractBuffer,stride:8,offset:0}},yFract:function(et,Z){return Z.yAttr?{constant:[0,0]}:{buffer:Z.positionFractBuffer,stride:8,offset:4}},size:function(et,Z){return Z.size.length?{buffer:Z.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(Z.size*255/P.maxSize)]}},borderSize:function(et,Z){return Z.borderSize.length?{buffer:Z.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(Z.borderSize*255/P.maxSize)]}},colorId:function(et,Z){return Z.color.length?{buffer:Z.colorBuffer,stride:P.tooManyColors?8:4,offset:0}:{constant:P.tooManyColors?B.slice(Z.color*4,Z.color*4+4):[Z.color]}},borderColorId:function(et,Z){return Z.borderColor.length?{buffer:Z.colorBuffer,stride:P.tooManyColors?8:4,offset:P.tooManyColors?4:2}:{constant:P.tooManyColors?B.slice(Z.borderColor*4,Z.borderColor*4+4):[Z.borderColor]}},isActive:function(et,Z){return Z.activation===!0?{constant:[1]}:Z.activation?Z.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:b.prop("elements"),count:b.prop("count"),offset:b.prop("offset"),primitive:"points"},ct=g({},rt);ct.frag=m([`precision highp float; -#define GLSLIFY 1 - -uniform float opacity; -uniform sampler2D markerTexture; - -varying vec4 fragColor, fragBorderColor; -varying float fragWidth, fragBorderColorLevel, fragColorLevel; - -float smoothStep(float x, float y) { - return 1.0 / (1.0 + exp(50.0*(x - y))); -} - -void main() { - float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth; - - // max-distance alpha - if (dist < 0.003) discard; - - // null-border case - if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) { - float colorAmt = smoothstep(.5 - delta, .5 + delta, dist); - gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity); - } - else { - float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist); - float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist); - - vec4 color = fragBorderColor; - color.a *= borderColorAmt; - color = mix(color, fragColor, colorAmt); - color.a *= opacity; - - gl_FragColor = color; - } - -} -`]),ct.vert=m([`precision highp float; -#define GLSLIFY 1 - -attribute float x, y, xFract, yFract; -attribute float size, borderSize; -attribute vec4 colorId, borderColorId; -attribute float isActive; - -// \`invariant\` effectively turns off optimizations for the position. -// We need this because -fast-math on M1 Macs is re-ordering -// floating point operations in a way that causes floating point -// precision limits to put points in the wrong locations. -invariant gl_Position; - -uniform bool constPointSize; -uniform float pixelRatio; -uniform vec2 scale, scaleFract, translate, translateFract, paletteSize; -uniform sampler2D paletteTexture; - -const float maxSize = 100.; -const float borderLevel = .5; - -varying vec4 fragColor, fragBorderColor; -varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel; - -float pointSizeScale = (constPointSize) ? 2. : pixelRatio; - -bool isDirect = (paletteSize.x < 1.); - -vec4 getColor(vec4 id) { - return isDirect ? id / 255. : texture2D(paletteTexture, - vec2( - (id.x + .5) / paletteSize.x, - (id.y + .5) / paletteSize.y - ) - ); -} - -void main() { - // ignore inactive points - if (isActive == 0.) return; - - vec2 position = vec2(x, y); - vec2 positionFract = vec2(xFract, yFract); - - vec4 color = getColor(colorId); - vec4 borderColor = getColor(borderColorId); - - float size = size * maxSize / 255.; - float borderSize = borderSize * maxSize / 255.; - - gl_PointSize = 2. * size * pointSizeScale; - fragPointSize = size * pixelRatio; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - gl_Position = vec4(pos * 2. - 1., 0., 1.); - - fragColor = color; - fragBorderColor = borderColor; - fragWidth = 1. / gl_PointSize; - - fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.); - fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.); -} -`]),this.drawMarker=b(ct);var st=g({},rt);st.frag=m([`precision highp float; -#define GLSLIFY 1 - -varying vec4 fragColor, fragBorderColor; -varying float fragBorderRadius, fragWidth; - -uniform float opacity; - -float smoothStep(float edge0, float edge1, float x) { - float t; - t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -void main() { - float radius, alpha = 1.0, delta = fragWidth; - - radius = length(2.0 * gl_PointCoord.xy - 1.0); - - if (radius > 1.0 + delta) { - discard; - } - - alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); - - float borderRadius = fragBorderRadius; - float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); - vec4 color = mix(fragColor, fragBorderColor, ratio); - color.a *= alpha * opacity; - gl_FragColor = color; -} -`]),st.vert=m([`precision highp float; -#define GLSLIFY 1 - -attribute float x, y, xFract, yFract; -attribute float size, borderSize; -attribute vec4 colorId, borderColorId; -attribute float isActive; - -// \`invariant\` effectively turns off optimizations for the position. -// We need this because -fast-math on M1 Macs is re-ordering -// floating point operations in a way that causes floating point -// precision limits to put points in the wrong locations. -invariant gl_Position; - -uniform bool constPointSize; -uniform float pixelRatio; -uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; -uniform sampler2D paletteTexture; - -const float maxSize = 100.; - -varying vec4 fragColor, fragBorderColor; -varying float fragBorderRadius, fragWidth; - -float pointSizeScale = (constPointSize) ? 2. : pixelRatio; - -bool isDirect = (paletteSize.x < 1.); - -vec4 getColor(vec4 id) { - return isDirect ? id / 255. : texture2D(paletteTexture, - vec2( - (id.x + .5) / paletteSize.x, - (id.y + .5) / paletteSize.y - ) - ); -} - -void main() { - // ignore inactive points - if (isActive == 0.) return; - - vec2 position = vec2(x, y); - vec2 positionFract = vec2(xFract, yFract); - - vec4 color = getColor(colorId); - vec4 borderColor = getColor(borderColorId); - - float size = size * maxSize / 255.; - float borderSize = borderSize * maxSize / 255.; - - gl_PointSize = (size + borderSize) * pointSizeScale; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - gl_Position = vec4(pos * 2. - 1., 0., 1.); - - fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); - fragColor = color; - fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; - fragWidth = 1. / gl_PointSize; -} -`]),y&&(st.frag=st.frag.replace("smoothstep","smoothStep"),ct.frag=ct.frag.replace("smoothstep","smoothStep")),this.drawCircle=b(st)}T.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},T.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},T.prototype.draw=function(){for(var b=this,_=arguments.length,P=new Array(_),z=0;z<_;z++)P[z]=arguments[z];var D=this.groups;if(P.length===1&&Array.isArray(P[0])&&(P[0][0]===null||Array.isArray(P[0][0]))&&(P=P[0]),this.regl._refresh(),P.length)for(var B=0;Bmt)?ee.tree=v(Jt,{bounds:Kt}):mt&&mt.length&&(ee.tree=mt),ee.tree){var ue={primitive:"points",usage:"static",data:ee.tree,type:"uint32"};ee.elements?ee.elements(ue):ee.elements=R.elements(ue)}var Me=S.float32(Jt);bt({data:Me,usage:"dynamic"});var Ce=S.fract32(Jt,Me);return vt({data:Ce,usage:"dynamic"}),Ut({data:new Uint8Array(re),type:"uint8",usage:"stream"}),Jt}},{marker:function(Jt,ee,Zt){var mt=ee.activation;if(mt.forEach(function(Ce){return Ce&&Ce.destroy&&Ce.destroy()}),mt.length=0,!Jt||typeof Jt[0]=="number"){var bt=b.addMarker(Jt);mt[bt]=!0}else{for(var vt=[],Ut=0,re=Math.min(Jt.length,ee.count);Ut=0)return D;var B;if(b instanceof Uint8Array||b instanceof Uint8ClampedArray)B=b;else{B=new Uint8Array(b.length);for(var R=0,I=b.length;Rz*4&&(this.tooManyColors=!0),this.updatePalette(P),D.length===1?D[0]:D},T.prototype.updatePalette=function(b){if(!this.tooManyColors){var _=this.maxColors,P=this.paletteTexture,z=Math.ceil(b.length*.25/_);if(z>1){b=b.slice();for(var D=b.length*.25%_;D{V.exports=u,V.exports.default=u;function u(R,I,F){F=F||2;var j=I&&I.length,N=j?I[0]*F:R.length,G=d(R,0,N,F,!0),rt=[];if(!G||G.next===G.prev)return rt;var ct,st,et,Z,ot,X,Q;if(j&&(G=n(R,I,G,F)),R.length>80*F){ct=et=R[0],st=Z=R[1];for(var ut=F;utet&&(et=ot),X>Z&&(Z=X);Q=Math.max(et-ct,Z-st),Q=Q!==0?32767/Q:0}return A(G,rt,F,ct,st,Q,0),rt}function d(R,I,F,j,N){var G,rt;if(N===B(R,I,F,j)>0)for(G=I;G=I;G-=j)rt=P(G,R[G],R[G+1],rt);return rt&&S(rt,rt.next)&&(z(rt),rt=rt.next),rt}function E(R,I){if(!R)return R;I||(I=R);var F=R,j;do if(j=!1,!F.steiner&&(S(F,F.next)||y(F.prev,F,F.next)===0)){if(z(F),F=I=F.prev,F===F.next)break;j=!0}else F=F.next;while(j||F!==I);return I}function A(R,I,F,j,N,G,rt){if(R){!rt&&G&&v(R,j,N,G);for(var ct=R,st,et;R.prev!==R.next;){if(st=R.prev,et=R.next,G?e(R,j,N,G):t(R)){I.push(st.i/F|0),I.push(R.i/F|0),I.push(et.i/F|0),z(R),R=et.next,ct=et.next;continue}if(R=et,R===ct){rt?rt===1?(R=r(E(R),I,F),A(R,I,F,j,N,G,2)):rt===2&&i(R,I,F,j,N,G):A(E(R),I,F,j,N,G,1);break}}}}function t(R){var I=R.prev,F=R,j=R.next;if(y(I,F,j)>=0)return!1;for(var N=I.x,G=F.x,rt=j.x,ct=I.y,st=F.y,et=j.y,Z=NG?N>rt?N:rt:G>rt?G:rt,Q=ct>st?ct>et?ct:et:st>et?st:et,ut=j.next;ut!==I;){if(ut.x>=Z&&ut.x<=X&&ut.y>=ot&&ut.y<=Q&&l(N,ct,G,st,rt,et,ut.x,ut.y)&&y(ut.prev,ut,ut.next)>=0)return!1;ut=ut.next}return!0}function e(R,I,F,j){var N=R.prev,G=R,rt=R.next;if(y(N,G,rt)>=0)return!1;for(var ct=N.x,st=G.x,et=rt.x,Z=N.y,ot=G.y,X=rt.y,Q=ctst?ct>et?ct:et:st>et?st:et,q=Z>ot?Z>X?Z:X:ot>X?ot:X,it=m(Q,ut,I,F,j),nt=m(J,q,I,F,j),dt=R.prevZ,Tt=R.nextZ;dt&&dt.z>=it&&Tt&&Tt.z<=nt;){if(dt.x>=Q&&dt.x<=J&&dt.y>=ut&&dt.y<=q&&dt!==N&&dt!==rt&&l(ct,Z,st,ot,et,X,dt.x,dt.y)&&y(dt.prev,dt,dt.next)>=0||(dt=dt.prevZ,Tt.x>=Q&&Tt.x<=J&&Tt.y>=ut&&Tt.y<=q&&Tt!==N&&Tt!==rt&&l(ct,Z,st,ot,et,X,Tt.x,Tt.y)&&y(Tt.prev,Tt,Tt.next)>=0))return!1;Tt=Tt.nextZ}for(;dt&&dt.z>=it;){if(dt.x>=Q&&dt.x<=J&&dt.y>=ut&&dt.y<=q&&dt!==N&&dt!==rt&&l(ct,Z,st,ot,et,X,dt.x,dt.y)&&y(dt.prev,dt,dt.next)>=0)return!1;dt=dt.prevZ}for(;Tt&&Tt.z<=nt;){if(Tt.x>=Q&&Tt.x<=J&&Tt.y>=ut&&Tt.y<=q&&Tt!==N&&Tt!==rt&&l(ct,Z,st,ot,et,X,Tt.x,Tt.y)&&y(Tt.prev,Tt,Tt.next)>=0)return!1;Tt=Tt.nextZ}return!0}function r(R,I,F){var j=R;do{var N=j.prev,G=j.next.next;!S(N,G)&&k(N,j,j.next,G)&&h(N,G)&&h(G,N)&&(I.push(N.i/F|0),I.push(j.i/F|0),I.push(G.i/F|0),z(j),z(j.next),j=R=G),j=j.next}while(j!==R);return E(j)}function i(R,I,F,j,N,G){var rt=R;do{for(var ct=rt.next.next;ct!==rt.prev;){if(rt.i!==ct.i&&x(rt,ct)){var st=_(rt,ct);rt=E(rt,rt.next),st=E(st,st.next),A(rt,I,F,j,N,G,0),A(st,I,F,j,N,G,0);return}ct=ct.next}rt=rt.next}while(rt!==R)}function n(R,I,F,j){var N=[],G,rt,ct,st,et;for(G=0,rt=I.length;G=F.next.y&&F.next.y!==F.y){var ct=F.x+(N-F.y)*(F.next.x-F.x)/(F.next.y-F.y);if(ct<=j&&ct>G&&(G=ct,rt=F.x=F.x&&F.x>=et&&j!==F.x&&l(Nrt.x||F.x===rt.x&&f(rt,F)))&&(rt=F,ot=X)),F=F.next;while(F!==st);return rt}function f(R,I){return y(R.prev,R,I.prev)<0&&y(I.next,R,R.next)<0}function v(R,I,F,j){var N=R;do N.z===0&&(N.z=m(N.x,N.y,I,F,j)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==R);N.prevZ.nextZ=null,N.prevZ=null,g(N)}function g(R){var I,F,j,N,G,rt,ct,st,et=1;do{for(F=R,R=null,G=null,rt=0;F;){for(rt++,j=F,ct=0,I=0;I0||st>0&&j;)ct!==0&&(st===0||!j||F.z<=j.z)?(N=F,F=F.nextZ,ct--):(N=j,j=j.nextZ,st--),G?G.nextZ=N:R=N,N.prevZ=G,G=N;F=j}G.nextZ=null,et*=2}while(rt>1);return R}function m(R,I,F,j,N){return R=(R-F)*N|0,I=(I-j)*N|0,R=(R|R<<8)&16711935,R=(R|R<<4)&252645135,R=(R|R<<2)&858993459,R=(R|R<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,R|I<<1}function w(R){var I=R,F=R;do(I.x=(R-rt)*(G-ct)&&(R-rt)*(j-ct)>=(F-rt)*(I-ct)&&(F-rt)*(G-ct)>=(N-rt)*(j-ct)}function x(R,I){return R.next.i!==I.i&&R.prev.i!==I.i&&!c(R,I)&&(h(R,I)&&h(I,R)&&b(R,I)&&(y(R.prev,R,I.prev)||y(R,I.prev,I))||S(R,I)&&y(R.prev,R,R.next)>0&&y(I.prev,I,I.next)>0)}function y(R,I,F){return(I.y-R.y)*(F.x-I.x)-(I.x-R.x)*(F.y-I.y)}function S(R,I){return R.x===I.x&&R.y===I.y}function k(R,I,F,j){var N=T(y(R,I,F)),G=T(y(R,I,j)),rt=T(y(F,j,R)),ct=T(y(F,j,I));return!!(N!==G&&rt!==ct||N===0&&M(R,F,I)||G===0&&M(R,j,I)||rt===0&&M(F,R,j)||ct===0&&M(F,I,j))}function M(R,I,F){return I.x<=Math.max(R.x,F.x)&&I.x>=Math.min(R.x,F.x)&&I.y<=Math.max(R.y,F.y)&&I.y>=Math.min(R.y,F.y)}function T(R){return R>0?1:R<0?-1:0}function c(R,I){var F=R;do{if(F.i!==R.i&&F.next.i!==R.i&&F.i!==I.i&&F.next.i!==I.i&&k(F,F.next,R,I))return!0;F=F.next}while(F!==R);return!1}function h(R,I){return y(R.prev,R,R.next)<0?y(R,I,R.next)>=0&&y(R,R.prev,I)>=0:y(R,I,R.prev)<0||y(R,R.next,I)<0}function b(R,I){var F=R,j=!1,N=(R.x+I.x)/2,G=(R.y+I.y)/2;do F.y>G!=F.next.y>G&&F.next.y!==F.y&&N<(F.next.x-F.x)*(G-F.y)/(F.next.y-F.y)+F.x&&(j=!j),F=F.next;while(F!==R);return j}function _(R,I){var F=new D(R.i,R.x,R.y),j=new D(I.i,I.x,I.y),N=R.next,G=I.prev;return R.next=I,I.prev=R,F.next=N,N.prev=F,j.next=F,F.prev=j,G.next=j,j.prev=G,j}function P(R,I,F,j){var N=new D(R,I,F);return j?(N.next=j.next,N.prev=j,j.next.prev=N,j.next=N):(N.prev=N,N.next=N),N}function z(R){R.next.prev=R.prev,R.prev.next=R.next,R.prevZ&&(R.prevZ.nextZ=R.nextZ),R.nextZ&&(R.nextZ.prevZ=R.prevZ)}function D(R,I,F){this.i=R,this.x=I,this.y=F,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}u.deviation=function(R,I,F,j){var N=I&&I.length,G=N?I[0]*F:R.length,rt=Math.abs(B(R,0,G,F));if(N)for(var ct=0,st=I.length;ct0&&(j+=R[N-1].length,F.holes.push(j))}return F}}),QE=Vt((K,V)=>{var u=z0();V.exports=d;function d(E,A,t){if(!E||E.length==null)throw Error("Argument should be an array");A==null&&(A=1),t==null&&(t=u(E,A));for(var e=0;e{V.exports=function(){var u,d;if(typeof WeakMap!="function")return!1;try{u=new WeakMap([[d={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(u)!=="[object WeakMap]"||typeof u.set!="function"||u.set({},1)!==u||typeof u.delete!="function"||typeof u.has!="function"||u.get(d)!=="one")}}),e7=Vt((K,V)=>{V.exports=function(){}}),Hd=Vt((K,V)=>{var u=e7()();V.exports=function(d){return d!==u&&d!==null}}),G3=Vt((K,V)=>{var u=Object.create,d=Object.getPrototypeOf,E={};V.exports=function(){var A=Object.setPrototypeOf,t=arguments[0]||u;return typeof A!="function"?!1:d(A(t(null),E))===E}}),Z3=Vt((K,V)=>{var u=Hd(),d={function:!0,object:!0};V.exports=function(E){return u(E)&&d[typeof E]||!1}}),Hp=Vt((K,V)=>{var u=Hd();V.exports=function(d){if(!u(d))throw new TypeError("Cannot use null or undefined");return d}}),r7=Vt((K,V)=>{var u=Object.create,d;G3()()||(d=K3()),V.exports=(function(){var E,A,t;return!d||d.level!==1?u:(E={},A={},t={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(e){if(e==="__proto__"){A[e]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}A[e]=t}),Object.defineProperties(E,A),Object.defineProperty(d,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:E}),function(e,r){return u(e===null?E:e,r)})})()}),K3=Vt((K,V)=>{var u=Z3(),d=Hp(),E=Object.prototype.isPrototypeOf,A=Object.defineProperty,t={configurable:!0,enumerable:!1,writable:!0,value:void 0},e;e=function(r,i){if(d(r),i===null||u(i))return r;throw new TypeError("Prototype must be null or an object")},V.exports=(function(r){var i,n;return r?(r.level===2?r.set?(n=r.set,i=function(o,a){return n.call(e(o,a),a),o}):i=function(o,a){return e(o,a).__proto__=a,o}:i=function o(a,s){var f;return e(a,s),f=E.call(o.nullPolyfill,a),f&&delete o.nullPolyfill.__proto__,s===null&&(s=o.nullPolyfill),a.__proto__=s,f&&A(o.nullPolyfill,"__proto__",t),a},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:r.level})):null})((function(){var r=Object.create(null),i={},n,o=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(o){try{n=o.set,n.call(r,i)}catch{}if(Object.getPrototypeOf(r)===i)return{set:n,level:2}}return r.__proto__=i,Object.getPrototypeOf(r)===i?{level:2}:(r={},r.__proto__=i,Object.getPrototypeOf(r)===i?{level:1}:!1)})()),r7()}),jx=Vt((K,V)=>{V.exports=G3()()?Object.setPrototypeOf:K3()}),n7=Vt((K,V)=>{var u=Z3();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not an Object");return d}}),a7=Vt((K,V)=>{var u=Object.create(null),d=Math.random;V.exports=function(){var E;do E=d().toString(36).slice(2);while(u[E]);return E}}),I0=Vt((K,V)=>{var u=void 0;V.exports=function(d){return d!==u&&d!==null}}),Ux=Vt((K,V)=>{var u=I0(),d={object:!0,function:!0,undefined:!0};V.exports=function(E){return u(E)?hasOwnProperty.call(d,typeof E):!1}}),i7=Vt((K,V)=>{var u=Ux();V.exports=function(d){if(!u(d))return!1;try{return d.constructor?d.constructor.prototype===d:!1}catch{return!1}}}),o7=Vt((K,V)=>{var u=i7();V.exports=function(d){if(typeof d!="function"||!hasOwnProperty.call(d,"length"))return!1;try{if(typeof d.length!="number"||typeof d.call!="function"||typeof d.apply!="function")return!1}catch{return!1}return!u(d)}}),Y3=Vt((K,V)=>{var u=o7(),d=/^\s*class[\s{/}]/,E=Function.prototype.toString;V.exports=function(A){return!(!u(A)||d.test(E.call(A)))}}),s7=Vt((K,V)=>{V.exports=function(){var u=Object.assign,d;return typeof u!="function"?!1:(d={foo:"raz"},u(d,{bar:"dwa"},{trzy:"trzy"}),d.foo+d.bar+d.trzy==="razdwatrzy")}}),l7=Vt((K,V)=>{V.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),u7=Vt((K,V)=>{var u=Hd(),d=Object.keys;V.exports=function(E){return d(u(E)?Object(E):E)}}),c7=Vt((K,V)=>{V.exports=l7()()?Object.keys:u7()}),f7=Vt((K,V)=>{var u=c7(),d=Hp(),E=Math.max;V.exports=function(A,t){var e,r,i=E(arguments.length,2),n;for(A=Object(d(A)),n=function(o){try{A[o]=t[o]}catch(a){e||(e=a)}},r=1;r{V.exports=s7()()?Object.assign:f7()}),X3=Vt((K,V)=>{var u=Hd(),d=Array.prototype.forEach,E=Object.create,A=function(t,e){var r;for(r in t)e[r]=t[r]};V.exports=function(t){var e=E(null);return d.call(arguments,function(r){u(r)&&A(Object(r),e)}),e}}),h7=Vt((K,V)=>{var u="razdwatrzy";V.exports=function(){return typeof u.contains!="function"?!1:u.contains("dwa")===!0&&u.contains("foo")===!1}}),p7=Vt((K,V)=>{var u=String.prototype.indexOf;V.exports=function(d){return u.call(this,d,arguments[1])>-1}}),$3=Vt((K,V)=>{V.exports=h7()()?String.prototype.contains:p7()}),qp=Vt((K,V)=>{var u=I0(),d=Y3(),E=Vx(),A=X3(),t=$3(),e=V.exports=function(r,i){var n,o,a,s,f;return arguments.length<2||typeof r!="string"?(s=i,i=r,r=null):s=arguments[2],u(r)?(n=t.call(r,"c"),o=t.call(r,"e"),a=t.call(r,"w")):(n=a=!0,o=!1),f={value:i,configurable:n,enumerable:o,writable:a},s?E(A(s),f):f};e.gs=function(r,i,n){var o,a,s,f;return typeof r!="string"?(s=n,n=i,i=r,r=null):s=arguments[3],u(i)?d(i)?u(n)?d(n)||(s=n,n=void 0):n=void 0:(s=i,i=n=void 0):i=void 0,u(r)?(o=t.call(r,"c"),a=t.call(r,"e")):(o=!0,a=!1),f={get:i,set:n,configurable:o,enumerable:a},s?E(A(s),f):f}}),zv=Vt((K,V)=>{var u=Object.prototype.toString,d=u.call((function(){return arguments})());V.exports=function(E){return u.call(E)===d}}),Lv=Vt((K,V)=>{var u=Object.prototype.toString,d=u.call("");V.exports=function(E){return typeof E=="string"||E&&typeof E=="object"&&(E instanceof String||u.call(E)===d)||!1}}),d7=Vt((K,V)=>{V.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),m7=Vt((K,V)=>{var u=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};V.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return u()}try{return __global__||u()}finally{delete Object.prototype.__global__}})()}),Cv=Vt((K,V)=>{V.exports=d7()()?globalThis:m7()}),g7=Vt((K,V)=>{var u=Cv(),d={object:!0,symbol:!0};V.exports=function(){var E=u.Symbol,A;if(typeof E!="function")return!1;A=E("test symbol");try{String(A)}catch{return!1}return!(!d[typeof E.iterator]||!d[typeof E.toPrimitive]||!d[typeof E.toStringTag])}}),v7=Vt((K,V)=>{V.exports=function(u){return u?typeof u=="symbol"?!0:!u.constructor||u.constructor.name!=="Symbol"?!1:u[u.constructor.toStringTag]==="Symbol":!1}}),J3=Vt((K,V)=>{var u=v7();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not a symbol");return d}}),y7=Vt((K,V)=>{var u=qp(),d=Object.create,E=Object.defineProperty,A=Object.prototype,t=d(null);V.exports=function(e){for(var r=0,i,n;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,i="@@"+e,E(A,i,u.gs(null,function(o){n||(n=!0,E(this,i,u(o)),n=!1)})),i}}),x7=Vt((K,V)=>{var u=qp(),d=Cv().Symbol;V.exports=function(E){return Object.defineProperties(E,{hasInstance:u("",d&&d.hasInstance||E("hasInstance")),isConcatSpreadable:u("",d&&d.isConcatSpreadable||E("isConcatSpreadable")),iterator:u("",d&&d.iterator||E("iterator")),match:u("",d&&d.match||E("match")),replace:u("",d&&d.replace||E("replace")),search:u("",d&&d.search||E("search")),species:u("",d&&d.species||E("species")),split:u("",d&&d.split||E("split")),toPrimitive:u("",d&&d.toPrimitive||E("toPrimitive")),toStringTag:u("",d&&d.toStringTag||E("toStringTag")),unscopables:u("",d&&d.unscopables||E("unscopables"))})}}),_7=Vt((K,V)=>{var u=qp(),d=J3(),E=Object.create(null);V.exports=function(A){return Object.defineProperties(A,{for:u(function(t){return E[t]?E[t]:E[t]=A(String(t))}),keyFor:u(function(t){var e;d(t);for(e in E)if(E[e]===t)return e})})}}),b7=Vt((K,V)=>{var u=qp(),d=J3(),E=Cv().Symbol,A=y7(),t=x7(),e=_7(),r=Object.create,i=Object.defineProperties,n=Object.defineProperty,o,a,s;if(typeof E=="function")try{String(E()),s=!0}catch{}else E=null;a=function(f){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return o(f)},V.exports=o=function f(v){var g;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?E(v):(g=r(a.prototype),v=v===void 0?"":String(v),i(g,{__description__:u("",v),__name__:u("",A(v))}))},t(o),e(o),i(a.prototype,{constructor:u(o),toString:u("",function(){return this.__name__})}),i(o.prototype,{toString:u(function(){return"Symbol ("+d(this).__description__+")"}),valueOf:u(function(){return d(this)})}),n(o.prototype,o.toPrimitive,u("",function(){var f=d(this);return typeof f=="symbol"?f:f.toString()})),n(o.prototype,o.toStringTag,u("c","Symbol")),n(a.prototype,o.toStringTag,u("c",o.prototype[o.toStringTag])),n(a.prototype,o.toPrimitive,u("c",o.prototype[o.toPrimitive]))}),qd=Vt((K,V)=>{V.exports=g7()()?Cv().Symbol:b7()}),w7=Vt((K,V)=>{var u=Hp();V.exports=function(){return u(this).length=0,this}}),Ym=Vt((K,V)=>{V.exports=function(u){if(typeof u!="function")throw new TypeError(u+" is not a function");return u}}),T7=Vt((K,V)=>{var u=I0(),d=Ux(),E=Object.prototype.toString;V.exports=function(A){if(!u(A))return null;if(d(A)){var t=A.toString;if(typeof t!="function"||t===E)return null}try{return""+A}catch{return null}}}),k7=Vt((K,V)=>{V.exports=function(u){try{return u.toString()}catch{try{return String(u)}catch{return null}}}}),A7=Vt((K,V)=>{var u=k7(),d=/[\n\r\u2028\u2029]/g;V.exports=function(E){var A=u(E);return A===null?"":(A.length>100&&(A=A.slice(0,99)+"…"),A=A.replace(d,function(t){switch(t){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),A)}}),Q3=Vt((K,V)=>{var u=I0(),d=Ux(),E=T7(),A=A7(),t=function(e,r){return e.replace("%v",A(r))};V.exports=function(e,r,i){if(!d(i))throw new TypeError(t(r,e));if(!u(e)){if("default"in i)return i.default;if(i.isOptional)return null}var n=E(i.errorMessage);throw u(n)||(n=r),new TypeError(t(n,e))}}),M7=Vt((K,V)=>{var u=Q3(),d=I0();V.exports=function(E){return d(E)?E:u(E,"Cannot use %v",arguments[1])}}),S7=Vt((K,V)=>{var u=Q3(),d=Y3();V.exports=function(E){return d(E)?E:u(E,"%v is not a plain function",arguments[1])}}),E7=Vt((K,V)=>{V.exports=function(){var u=Array.from,d,E;return typeof u!="function"?!1:(d=["raz","dwa"],E=u(d),!!(E&&E!==d&&E[1]==="dwa"))}}),z7=Vt((K,V)=>{var u=Object.prototype.toString,d=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);V.exports=function(E){return typeof E=="function"&&d(u.call(E))}}),L7=Vt((K,V)=>{V.exports=function(){var u=Math.sign;return typeof u!="function"?!1:u(10)===1&&u(-20)===-1}}),C7=Vt((K,V)=>{V.exports=function(u){return u=Number(u),isNaN(u)||u===0?u:u>0?1:-1}}),I7=Vt((K,V)=>{V.exports=L7()()?Math.sign:C7()}),P7=Vt((K,V)=>{var u=I7(),d=Math.abs,E=Math.floor;V.exports=function(A){return isNaN(A)?0:(A=Number(A),A===0||!isFinite(A)?A:u(A)*E(d(A)))}}),O7=Vt((K,V)=>{var u=P7(),d=Math.max;V.exports=function(E){return d(0,u(E))}}),D7=Vt((K,V)=>{var u=qd().iterator,d=zv(),E=z7(),A=O7(),t=Ym(),e=Hp(),r=Hd(),i=Lv(),n=Array.isArray,o=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;V.exports=function(f){var v=arguments[1],g=arguments[2],m,w,l,x,y,S,k,M,T,c;if(f=Object(e(f)),r(v)&&t(v),!this||this===Array||!E(this)){if(!v){if(d(f))return y=f.length,y!==1?Array.apply(null,f):(x=new Array(1),x[0]=f[0],x);if(n(f)){for(x=new Array(y=f.length),w=0;w=55296&&S<=56319&&(c+=f[++w])),c=v?o.call(v,g,c,l):c,m?(a.value=c,s(x,l,a)):x[l]=c,++l;y=l}}if(y===void 0)for(y=A(f.length),m&&(x=new m(y)),w=0;w{V.exports=E7()()?Array.from:D7()}),B7=Vt((K,V)=>{var u=F7(),d=Vx(),E=Hp();V.exports=function(A){var t=Object(E(A)),e=arguments[1],r=Object(arguments[2]);if(t!==A&&!e)return t;var i={};return e?u(e,function(n){(r.ensure||n in A)&&(i[n]=A[n])}):d(i,A),i}}),R7=Vt((K,V)=>{var u=Ym(),d=Hp(),E=Function.prototype.bind,A=Function.prototype.call,t=Object.keys,e=Object.prototype.propertyIsEnumerable;V.exports=function(r,i){return function(n,o){var a,s=arguments[2],f=arguments[3];return n=Object(d(n)),u(o),a=t(n),f&&a.sort(typeof f=="function"?E.call(f,n):void 0),typeof r!="function"&&(r=a[r]),A.call(r,a,function(v,g){return e.call(n,v)?A.call(o,s,n[v],v,n,g):i})}}}),N7=Vt((K,V)=>{V.exports=R7()("forEach")}),j7=Vt((K,V)=>{var u=Ym(),d=N7(),E=Function.prototype.call;V.exports=function(A,t){var e={},r=arguments[2];return u(t),d(A,function(i,n,o,a){e[n]=E.call(t,r,i,n,o,a)}),e}}),U7=Vt((K,V)=>{var u=I0(),d=M7(),E=S7(),A=B7(),t=X3(),e=j7(),r=Function.prototype.bind,i=Object.defineProperty,n=Object.prototype.hasOwnProperty,o;o=function(a,s,f){var v=d(s)&&E(s.value),g;return g=A(s),delete g.writable,delete g.value,g.get=function(){return!f.overwriteDefinition&&n.call(this,a)?v:(s.value=r.call(v,f.resolveContext?f.resolveContext(this):this),i(this,a,s),this[a])},g},V.exports=function(a){var s=t(arguments[1]);return u(s.resolveContext)&&E(s.resolveContext),e(a,function(f,v){return o(v,f,s)})}}),t5=Vt((K,V)=>{var u=w7(),d=Vx(),E=Ym(),A=Hp(),t=qp(),e=U7(),r=qd(),i=Object.defineProperty,n=Object.defineProperties,o;V.exports=o=function(a,s){if(!(this instanceof o))throw new TypeError("Constructor requires 'new'");n(this,{__list__:t("w",A(a)),__context__:t("w",s),__nextIndex__:t("w",0)}),s&&(E(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete o.prototype.constructor,n(o.prototype,d({_next:t(function(){var a;if(this.__list__){if(this.__redo__&&(a=this.__redo__.shift(),a!==void 0))return a;if(this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){i(this,"__redo__",t("c",[a]));return}this.__redo__.forEach(function(s,f){s>=a&&(this.__redo__[f]=++s)},this),this.__redo__.push(a)}}),_onDelete:t(function(a){var s;a>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(a),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(f,v){f>a&&(this.__redo__[v]=--f)},this)))}),_onClear:t(function(){this.__redo__&&u.call(this.__redo__),this.__nextIndex__=0})}))),i(o.prototype,r.iterator,t(function(){return this}))}),V7=Vt((K,V)=>{var u=jx(),d=$3(),E=qp(),A=qd(),t=t5(),e=Object.defineProperty,r;r=V.exports=function(i,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t.call(this,i),n?d.call(n,"key+value")?n="key+value":d.call(n,"key")?n="key":n="value":n="value",e(this,"__kind__",E("",n))},u&&u(r,t),delete r.prototype.constructor,r.prototype=Object.create(t.prototype,{_resolve:E(function(i){return this.__kind__==="value"?this.__list__[i]:this.__kind__==="key+value"?[i,this.__list__[i]]:i})}),e(r.prototype,A.toStringTag,E("c","Array Iterator"))}),H7=Vt((K,V)=>{var u=jx(),d=qp(),E=qd(),A=t5(),t=Object.defineProperty,e;e=V.exports=function(r){if(!(this instanceof e))throw new TypeError("Constructor requires 'new'");r=String(r),A.call(this,r),t(this,"__length__",d("",r.length))},u&&u(e,A),delete e.prototype.constructor,e.prototype=Object.create(A.prototype,{_next:d(function(){if(this.__list__){if(this.__nextIndex__=55296&&n<=56319?i+this.__list__[this.__nextIndex__++]:i)})}),t(e.prototype,E.toStringTag,d("c","String Iterator"))}),q7=Vt((K,V)=>{var u=zv(),d=Hd(),E=Lv(),A=qd().iterator,t=Array.isArray;V.exports=function(e){return d(e)?t(e)||E(e)||u(e)?!0:typeof e[A]=="function":!1}}),W7=Vt((K,V)=>{var u=q7();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not iterable");return d}}),e5=Vt((K,V)=>{var u=zv(),d=Lv(),E=V7(),A=H7(),t=W7(),e=qd().iterator;V.exports=function(r){return typeof t(r)[e]=="function"?r[e]():u(r)?new E(r):d(r)?new A(r):new E(r)}}),G7=Vt((K,V)=>{var u=zv(),d=Ym(),E=Lv(),A=e5(),t=Array.isArray,e=Function.prototype.call,r=Array.prototype.some;V.exports=function(i,n){var o,a=arguments[2],s,f,v,g,m,w,l;if(t(i)||u(i)?o="array":E(i)?o="string":i=A(i),d(n),f=function(){v=!0},o==="array"){r.call(i,function(x){return e.call(n,a,x,f),v});return}if(o==="string"){for(m=i.length,g=0;g=55296&&l<=56319&&(w+=i[++g])),e.call(n,a,w,f),!v);++g);return}for(s=i.next();!s.done;){if(e.call(n,a,s.value,f),v)return;s=i.next()}}}),Z7=Vt((K,V)=>{V.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}),K7=Vt((K,V)=>{var u=Hd(),d=jx(),E=n7(),A=Hp(),t=a7(),e=qp(),r=e5(),i=G7(),n=qd().toStringTag,o=Z7(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf,g;V.exports=g=function(){var m=arguments[0],w;if(!(this instanceof g))throw new TypeError("Constructor requires 'new'");return w=o&&d&&WeakMap!==g?d(new WeakMap,v(this)):this,u(m)&&(a(m)||(m=r(m))),s(w,"__weakMapData__",e("c","$weakMap$"+t())),m&&i(m,function(l){A(l),w.set(l[0],l[1])}),w},o&&(d&&d(g,WeakMap),g.prototype=Object.create(WeakMap.prototype,{constructor:e(g)})),Object.defineProperties(g.prototype,{delete:e(function(m){return f.call(E(m),this.__weakMapData__)?(delete m[this.__weakMapData__],!0):!1}),get:e(function(m){if(f.call(E(m),this.__weakMapData__))return m[this.__weakMapData__]}),has:e(function(m){return f.call(E(m),this.__weakMapData__)}),set:e(function(m,w){return s(E(m),this.__weakMapData__,e("c",w)),this}),toString:e(function(){return"[object WeakMap]"})}),s(g.prototype,n,e("c","WeakMap"))}),r5=Vt((K,V)=>{V.exports=t7()()?WeakMap:K7()}),Y7=Vt((K,V)=>{V.exports=function(u,d,E){if(typeof Array.prototype.findIndex=="function")return u.findIndex(d,E);if(typeof d!="function")throw new TypeError("predicate must be a function");var A=Object(u),t=A.length;if(t===0)return-1;for(var e=0;e{var u=Rd(),d=z0(),E=of(),A=_p(),t=L0(),e=JE(),r=QE(),{float32:i,fract32:n}=Nx(),o=r5(),a=Km(),s=Y7(),f=` -precision highp float; - -attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract; -attribute vec4 color; -attribute float lineEnd, lineTop; - -uniform vec2 scale, scaleFract, translate, translateFract; -uniform float thickness, pixelRatio, id, depth; -uniform vec4 viewport; - -varying vec4 fragColor; -varying vec2 tangent; - -vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) { - // the order is important - return position * scale + translate - + positionFract * scale + translateFract - + position * scaleFract - + positionFract * scaleFract; -} - -void main() { - float lineStart = 1. - lineEnd; - float lineOffset = lineTop * 2. - 1.; - - vec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract); - tangent = normalize(diff * scale * viewport.zw); - vec2 normal = vec2(-tangent.y, tangent.x); - - vec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart - + project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd - - + thickness * normal * .5 * lineOffset / viewport.zw; - - gl_Position = vec4(position * 2.0 - 1.0, depth, 1); - - fragColor = color / 255.; -} -`,v=` -precision highp float; - -uniform float dashLength, pixelRatio, thickness, opacity, id; -uniform sampler2D dashTexture; - -varying vec4 fragColor; -varying vec2 tangent; - -void main() { - float alpha = 1.; - - float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; - float dash = texture2D(dashTexture, vec2(t, .5)).r; - - gl_FragColor = fragColor; - gl_FragColor.a *= alpha * opacity * dash; -} -`,g=` -precision highp float; - -attribute vec2 position, positionFract; - -uniform vec4 color; -uniform vec2 scale, scaleFract, translate, translateFract; -uniform float pixelRatio, id; -uniform vec4 viewport; -uniform float opacity; - -varying vec4 fragColor; - -const float MAX_LINES = 256.; - -void main() { - float depth = (MAX_LINES - 4. - id) / (MAX_LINES); - - vec2 position = position * scale + translate - + positionFract * scale + translateFract - + position * scaleFract - + positionFract * scaleFract; - - gl_Position = vec4(position * 2.0 - 1.0, depth, 1); - - fragColor = color / 255.; - fragColor.a *= opacity; -} -`,m=` -precision highp float; -varying vec4 fragColor; - -void main() { - gl_FragColor = fragColor; -} -`,w=` -precision highp float; - -attribute vec2 aCoord, bCoord, nextCoord, prevCoord; -attribute vec4 aColor, bColor; -attribute float lineEnd, lineTop; - -uniform vec2 scale, translate; -uniform float thickness, pixelRatio, id, depth; -uniform vec4 viewport; -uniform float miterLimit, miterMode; - -varying vec4 fragColor; -varying vec4 startCutoff, endCutoff; -varying vec2 tangent; -varying vec2 startCoord, endCoord; -varying float enableStartMiter, enableEndMiter; - -const float REVERSE_THRESHOLD = -.875; -const float MIN_DIFF = 1e-6; - -// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead -// TODO: precalculate dot products, normalize things beforehead etc. -// TODO: refactor to rectangular algorithm - -float distToLine(vec2 p, vec2 a, vec2 b) { - vec2 diff = b - a; - vec2 perp = normalize(vec2(-diff.y, diff.x)); - return dot(p - a, perp); -} - -bool isNaN( float val ){ - return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; -} - -void main() { - vec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord; - - vec2 adjustedScale; - adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x; - adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y; - - vec2 scaleRatio = adjustedScale * viewport.zw; - vec2 normalWidth = thickness / scaleRatio; - - float lineStart = 1. - lineEnd; - float lineBot = 1. - lineTop; - - fragColor = (lineStart * aColor + lineEnd * bColor) / 255.; - - if (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return; - - if (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord); - if (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord); - - - vec2 prevDiff = aCoord - prevCoord; - vec2 currDiff = bCoord - aCoord; - vec2 nextDiff = nextCoord - bCoord; - - vec2 prevTangent = normalize(prevDiff * scaleRatio); - vec2 currTangent = normalize(currDiff * scaleRatio); - vec2 nextTangent = normalize(nextDiff * scaleRatio); - - vec2 prevNormal = vec2(-prevTangent.y, prevTangent.x); - vec2 currNormal = vec2(-currTangent.y, currTangent.x); - vec2 nextNormal = vec2(-nextTangent.y, nextTangent.x); - - vec2 startJoinDirection = normalize(prevTangent - currTangent); - vec2 endJoinDirection = normalize(currTangent - nextTangent); - - // collapsed/unidirectional segment cases - // FIXME: there should be more elegant solution - vec2 prevTanDiff = abs(prevTangent - currTangent); - vec2 nextTanDiff = abs(nextTangent - currTangent); - if (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) { - startJoinDirection = currNormal; - } - if (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) { - endJoinDirection = currNormal; - } - if (aCoord == bCoord) { - endJoinDirection = startJoinDirection; - currNormal = prevNormal; - currTangent = prevTangent; - } - - tangent = currTangent; - - //calculate join shifts relative to normals - float startJoinShift = dot(currNormal, startJoinDirection); - float endJoinShift = dot(currNormal, endJoinDirection); - - float startMiterRatio = abs(1. / startJoinShift); - float endMiterRatio = abs(1. / endJoinShift); - - vec2 startJoin = startJoinDirection * startMiterRatio; - vec2 endJoin = endJoinDirection * endMiterRatio; - - vec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin; - startTopJoin = sign(startJoinShift) * startJoin * .5; - startBotJoin = -startTopJoin; - - endTopJoin = sign(endJoinShift) * endJoin * .5; - endBotJoin = -endTopJoin; - - vec2 aTopCoord = aCoord + normalWidth * startTopJoin; - vec2 bTopCoord = bCoord + normalWidth * endTopJoin; - vec2 aBotCoord = aCoord + normalWidth * startBotJoin; - vec2 bBotCoord = bCoord + normalWidth * endBotJoin; - - //miter anti-clipping - float baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x))); - float abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x))); - - //prevent close to reverse direction switch - bool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal); - bool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal); - - if (prevReverse) { - //make join rectangular - vec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5; - float normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.); - aBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; - aTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; - } - else if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) { - //handle miter clipping - bTopCoord -= normalWidth * endTopJoin; - bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; - } - - if (nextReverse) { - //make join rectangular - vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; - float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); - bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; - bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; - } - else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { - //handle miter clipping - aBotCoord -= normalWidth * startBotJoin; - aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; - } - - vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; - vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; - - vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; - vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; - - //position is normalized 0..1 coord on the screen - vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; - - startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; - endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; - - gl_Position = vec4(position * 2.0 - 1.0, depth, 1); - - enableStartMiter = step(dot(currTangent, prevTangent), .5); - enableEndMiter = step(dot(currTangent, nextTangent), .5); - - //bevel miter cutoffs - if (miterMode == 1.) { - if (enableStartMiter == 1.) { - vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; - startCutoff = vec4(aCoord, aCoord); - startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; - startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - startCutoff += viewport.xyxy; - startCutoff += startMiterWidth.xyxy; - } - - if (enableEndMiter == 1.) { - vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; - endCutoff = vec4(bCoord, bCoord); - endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; - endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - endCutoff += viewport.xyxy; - endCutoff += endMiterWidth.xyxy; - } - } - - //round miter cutoffs - else if (miterMode == 2.) { - if (enableStartMiter == 1.) { - vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; - startCutoff = vec4(aCoord, aCoord); - startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; - startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - startCutoff += viewport.xyxy; - startCutoff += startMiterWidth.xyxy; - } - - if (enableEndMiter == 1.) { - vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; - endCutoff = vec4(bCoord, bCoord); - endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; - endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - endCutoff += viewport.xyxy; - endCutoff += endMiterWidth.xyxy; - } - } -} -`,l=` -precision highp float; - -uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; -uniform sampler2D dashTexture; - -varying vec4 fragColor; -varying vec2 tangent; -varying vec4 startCutoff, endCutoff; -varying vec2 startCoord, endCoord; -varying float enableStartMiter, enableEndMiter; - -float distToLine(vec2 p, vec2 a, vec2 b) { - vec2 diff = b - a; - vec2 perp = normalize(vec2(-diff.y, diff.x)); - return dot(p - a, perp); -} - -void main() { - float alpha = 1., distToStart, distToEnd; - float cutoff = thickness * .5; - - //bevel miter - if (miterMode == 1.) { - if (enableStartMiter == 1.) { - distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); - if (distToStart < -1.) { - discard; - return; - } - alpha *= min(max(distToStart + 1., 0.), 1.); - } - - if (enableEndMiter == 1.) { - distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); - if (distToEnd < -1.) { - discard; - return; - } - alpha *= min(max(distToEnd + 1., 0.), 1.); - } - } - - // round miter - else if (miterMode == 2.) { - if (enableStartMiter == 1.) { - distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); - if (distToStart < 0.) { - float radius = length(gl_FragCoord.xy - startCoord); - - if(radius > cutoff + .5) { - discard; - return; - } - - alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); - } - } - - if (enableEndMiter == 1.) { - distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); - if (distToEnd < 0.) { - float radius = length(gl_FragCoord.xy - endCoord); - - if(radius > cutoff + .5) { - discard; - return; - } - - alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); - } - } - } - - float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; - float dash = texture2D(dashTexture, vec2(t, .5)).r; - - gl_FragColor = fragColor; - gl_FragColor.a *= alpha * opacity * dash; -} -`;V.exports=x;function x(y,S){if(!(this instanceof x))return new x(y,S);if(typeof y=="function"?(S||(S={}),S.regl=y):S=y,S.length&&(S.positions=S),y=S.regl,!y.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=y._gl,this.regl=y,this.passes=[],this.shaders=x.shaders.has(y)?x.shaders.get(y):x.shaders.set(y,x.createShaders(y)).get(y),this.update(S)}x.dashMult=2,x.maxPatternLength=256,x.precisionThreshold=3e6,x.maxPoints=1e4,x.maxLines=2048,x.shaders=new o,x.createShaders=function(y){let S=y.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),k={primitive:"triangle strip",instances:y.prop("count"),count:4,offset:0,uniforms:{miterMode:(c,h)=>h.join==="round"?2:1,miterLimit:y.prop("miterLimit"),scale:y.prop("scale"),scaleFract:y.prop("scaleFract"),translateFract:y.prop("translateFract"),translate:y.prop("translate"),thickness:y.prop("thickness"),dashTexture:y.prop("dashTexture"),opacity:y.prop("opacity"),pixelRatio:y.context("pixelRatio"),id:y.prop("id"),dashLength:y.prop("dashLength"),viewport:(c,h)=>[h.viewport.x,h.viewport.y,c.viewportWidth,c.viewportHeight],depth:y.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(c,h)=>!h.overlay},stencil:{enable:!1},scissor:{enable:!0,box:y.prop("viewport")},viewport:y.prop("viewport")},M=y(E({vert:f,frag:v,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:y.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},k)),T;try{T=y(E({cull:{enable:!0,face:"back"},vert:w,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:y.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:y.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},k))}catch{T=M}return{fill:y({primitive:"triangle",elements:(c,h)=>h.triangles,offset:0,vert:g,frag:m,uniforms:{scale:y.prop("scale"),color:y.prop("fill"),scaleFract:y.prop("scaleFract"),translateFract:y.prop("translateFract"),translate:y.prop("translate"),opacity:y.prop("opacity"),pixelRatio:y.context("pixelRatio"),id:y.prop("id"),viewport:(c,h)=>[h.viewport.x,h.viewport.y,c.viewportWidth,c.viewportHeight]},attributes:{position:{buffer:y.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:8}},blend:k.blend,depth:{enable:!1},scissor:k.scissor,stencil:k.stencil,viewport:k.viewport}),rect:M,miter:T}},x.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},x.prototype.render=function(...y){y.length&&this.update(...y),this.draw()},x.prototype.draw=function(...y){return(y.length?y:this.passes).forEach((S,k)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>x.precisionThreshold||S.scale[1]*S.viewport.height>x.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=x.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},x.prototype.update=function(y){if(!y)return;y.length!=null?typeof y[0]=="number"&&(y=[{positions:y}]):Array.isArray(y)||(y=[y]);let{regl:S,gl:k}=this;if(y.forEach((T,c)=>{let h=this.passes[c];if(T!==void 0){if(T===null){this.passes[c]=null;return}if(typeof T[0]=="number"&&(T={positions:T}),T=A(T,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),h||(this.passes[c]=h={id:c,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},T=E({},x.defaults,T)),T.thickness!=null&&(h.thickness=parseFloat(T.thickness)),T.opacity!=null&&(h.opacity=parseFloat(T.opacity)),T.miterLimit!=null&&(h.miterLimit=parseFloat(T.miterLimit)),T.overlay!=null&&(h.overlay=!!T.overlay,cst-et),G=[],rt=0,ct=h.hole!=null?h.hole[0]:null;if(ct!=null){let st=s(N,et=>et>=ct);N=N.slice(0,st),N.push(ct)}for(let st=0;stX-ct+(N[st]-rt)),ot=e(et,Z);ot=ot.map(X=>X+rt+(X+rt{y.colorBuffer.destroy(),y.positionBuffer.destroy(),y.dashTexture.destroy()}),this.passes.length=0,this}}),X7=Vt((K,V)=>{var u=z0(),d=Rd(),E=q3(),A=_p(),t=of(),e=L0(),{float32:r,fract32:i}=Nx();V.exports=o;var n=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function o(a,s){if(typeof a=="function"?(s||(s={}),s.regl=a):s=a,s.length&&(s.positions=s),a=s.regl,!a.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let f=a._gl,v,g,m,w,l,x,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return w=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),g=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),x=a.buffer({usage:"static",type:"float",data:n}),c(s),v=a({vert:` - precision highp float; - - attribute vec2 position, positionFract; - attribute vec4 error; - attribute vec4 color; - - attribute vec2 direction, lineOffset, capOffset; - - uniform vec4 viewport; - uniform float lineWidth, capSize; - uniform vec2 scale, scaleFract, translate, translateFract; - - varying vec4 fragColor; - - void main() { - fragColor = color / 255.; - - vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; - - vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; - - vec2 position = position + dxy; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - pos += pixelOffset / viewport.zw; - - gl_Position = vec4(pos * 2. - 1., 0, 1); - } - `,frag:` - precision highp float; - - varying vec4 fragColor; - - uniform float opacity; - - void main() { - gl_FragColor = fragColor; - gl_FragColor.a *= opacity; - } - `,uniforms:{range:a.prop("range"),lineWidth:a.prop("lineWidth"),capSize:a.prop("capSize"),opacity:a.prop("opacity"),scale:a.prop("scale"),translate:a.prop("translate"),scaleFract:a.prop("scaleFract"),translateFract:a.prop("translateFract"),viewport:(b,_)=>[_.viewport.x,_.viewport.y,b.viewportWidth,b.viewportHeight]},attributes:{color:{buffer:w,offset:(b,_)=>_.offset*4,divisor:1},position:{buffer:g,offset:(b,_)=>_.offset*8,divisor:1},positionFract:{buffer:m,offset:(b,_)=>_.offset*8,divisor:1},error:{buffer:l,offset:(b,_)=>_.offset*16,divisor:1},direction:{buffer:x,stride:24,offset:0},lineOffset:{buffer:x,stride:24,offset:8},capOffset:{buffer:x,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:a.prop("viewport")},viewport:a.prop("viewport"),stencil:!1,instances:a.prop("count"),count:n.length}),t(k,{update:c,draw:M,destroy:h,regl:a,gl:f,canvas:f.canvas,groups:S}),k;function k(b){b?c(b):b===null&&h(),M()}function M(b){if(typeof b=="number")return T(b);b&&!Array.isArray(b)&&(b=[b]),a._refresh(),S.forEach((_,P)=>{if(_){if(b&&(b[P]?_.draw=!0:_.draw=!1),!_.draw){_.draw=!0;return}T(P)}})}function T(b){typeof b=="number"&&(b=S[b]),b!=null&&b&&b.count&&b.color&&b.opacity&&b.positions&&b.positions.length>1&&(b.scaleRatio=[b.scale[0]*b.viewport.width,b.scale[1]*b.viewport.height],v(b),b.after&&b.after(b))}function c(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let _=0,P=0;if(k.groups=S=b.map((B,R)=>{let I=S[R];if(B)typeof B=="function"?B={after:B}:typeof B[0]=="number"&&(B={positions:B});else return I;return B=A(B,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),I||(S[R]=I={id:R,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},B=t({},y,B)),E(I,B,[{lineWidth:F=>+F*.5,capSize:F=>+F*.5,opacity:parseFloat,errors:F=>(F=e(F),P+=F.length,F),positions:(F,j)=>(F=e(F,"float64"),j.count=Math.floor(F.length/2),j.bounds=u(F,2),j.offset=_,_+=j.count,F)},{color:(F,j)=>{let N=j.count;if(F||(F="transparent"),!Array.isArray(F)||typeof F[0]=="number"){let rt=F;F=Array(N);for(let ct=0;ct{let G=j.bounds;return F||(F=G),j.scale=[1/(F[2]-F[0]),1/(F[3]-F[1])],j.translate=[-F[0],-F[1]],j.scaleFract=i(j.scale),j.translateFract=i(j.translate),F},viewport:F=>{let j;return Array.isArray(F)?j={x:F[0],y:F[1],width:F[2]-F[0],height:F[3]-F[1]}:F?(j={x:F.x||F.left||0,y:F.y||F.top||0},F.right?j.width=F.right-j.x:j.width=F.w||F.width||0,F.bottom?j.height=F.bottom-j.y:j.height=F.h||F.height||0):j={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},j}}]),I}),_||P){let B=S.reduce((j,N,G)=>j+(N?N.count:0),0),R=new Float64Array(B*2),I=new Uint8Array(B*4),F=new Float32Array(B*4);S.forEach((j,N)=>{if(!j)return;let{positions:G,count:rt,offset:ct,color:st,errors:et}=j;rt&&(I.set(st,ct*4),F.set(et,ct*4),R.set(G,ct*2))});var z=r(R);g(z);var D=i(R,z);m(D),w(I),l(F)}}function h(){g.destroy(),m.destroy(),w.destroy(),l.destroy(),x.destroy()}}}),$7=Vt((K,V)=>{var u=/[\'\"]/;V.exports=function(d){return d?(u.test(d.charAt(0))&&(d=d.substr(1)),u.test(d.charAt(d.length-1))&&(d=d.substr(0,d.length-1)),d):""}}),a5=Vt((K,V)=>{V.exports=["inherit","initial","unset"]}),i5=Vt((K,V)=>{V.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),o5=Vt((K,V)=>{V.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),s5=Vt((K,V)=>{V.exports=["normal","italic","oblique"]}),l5=Vt((K,V)=>{V.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),J7=Vt((K,V)=>{function u(A,t){if(typeof A!="string")return[A];var e=[A];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",n=!!t.flat;r.forEach(function(s){var f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),v=[];function g(m,w,l){var x=e.push(m.slice(s[0].length,-s[1].length))-1;return v.push(x),i+x+i}e.forEach(function(m,w){for(var l,x=0;m!=l;)if(l=m,m=m.replace(f,g),x++>1e4)throw Error("References have circular dependency. Please, check them.");e[w]=m}),v=v.reverse(),e=e.map(function(m){return v.forEach(function(w){m=m.replace(new RegExp("(\\"+i+w+"\\"+i+")","g"),s[0]+"$1"+s[1])}),m})});var o=new RegExp("\\"+i+"([0-9]+)\\"+i);function a(s,f,v){for(var g=[],m,w=0;m=o.exec(s);){if(w++>1e4)throw Error("Circular references in parenthesis");g.push(s.slice(0,m.index)),g.push(a(f[m[1]],f)),s=s.slice(m.index+m[0].length)}return g.push(s),g}return n?e:a(e[0],e)}function d(A,t){if(t&&t.flat){var e=t&&t.escape||"___",r=A[0],i;if(!r)return"";for(var n=new RegExp("\\"+e+"([0-9]+)\\"+e),o=0;r!=i;){if(o++>1e4)throw Error("Circular references in "+A);i=r,r=r.replace(n,a)}return r}return A.reduce(function s(f,v){return Array.isArray(v)&&(v=v.reduce(s,"")),f+v},"");function a(s,f){if(A[f]==null)throw Error("Reference "+f+"is undefined");return A[f]}}function E(A,t){return Array.isArray(A)?d(A,t):u(A,t)}E.parse=u,E.stringify=d,V.exports=E}),Q7=Vt((K,V)=>{var u=J7();V.exports=function(d,E,A){if(d==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");A?(typeof A=="string"||Array.isArray(A))&&(A={ignore:A}):A={},A.escape==null&&(A.escape=!0),A.ignore==null?A.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof A.ignore=="string"&&(A.ignore=[A.ignore]),A.ignore=A.ignore.map(function(s){return s.length===1&&(s=s+s),s}));var t=u.parse(d,{flat:!0,brackets:A.ignore}),e=t[0],r=e.split(E);if(A.escape){for(var i=[],n=0;n{V.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),u5=Vt((K,V)=>{var u=t9();V.exports={isSize:function(d){return/^[\d\.]/.test(d)||d.indexOf("/")!==-1||u.indexOf(d)!==-1}}}),e9=Vt((K,V)=>{var u=$7(),d=a5(),E=i5(),A=o5(),t=s5(),e=l5(),r=Q7(),i=u5().isSize;V.exports=o;var n=o.cache={};function o(s){if(typeof s!="string")throw new Error("Font argument must be a string.");if(n[s])return n[s];if(s==="")throw new Error("Cannot parse an empty string.");if(E.indexOf(s)!==-1)return n[s]={system:s};for(var f={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},v=r(s,/\s+/),g;g=v.shift();){if(d.indexOf(g)!==-1)return["style","variant","weight","stretch"].forEach(function(w){f[w]=g}),n[s]=f;if(t.indexOf(g)!==-1){f.style=g;continue}if(g==="normal"||g==="small-caps"){f.variant=g;continue}if(e.indexOf(g)!==-1){f.stretch=g;continue}if(A.indexOf(g)!==-1){f.weight=g;continue}if(i(g)){var m=r(g,"/");if(f.size=m[0],m[1]!=null?f.lineHeight=a(m[1]):v[0]==="/"&&(v.shift(),f.lineHeight=a(v.shift())),!v.length)throw new Error("Missing required font-family.");return f.family=r(v.join(" "),/\s*,\s*/).map(u),n[s]=f}throw new Error("Unknown or unsupported font token: "+g)}throw new Error("Missing required font-size.")}function a(s){var f=parseFloat(s);return f.toString()===s?f:s}}),c5=Vt((K,V)=>{var u=_p(),d=u5().isSize,E=s(a5()),A=s(i5()),t=s(o5()),e=s(s5()),r=s(l5()),i={normal:1,"small-caps":1},n={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},o={size:"1rem",family:"serif"};V.exports=function(f){if(f=u(f,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),f.system)return f.system&&a(f.system,A),f.system;if(a(f.style,e),a(f.variant,i),a(f.weight,t),a(f.stretch,r),f.size==null&&(f.size=o.size),typeof f.size=="number"&&(f.size+="px"),!d)throw Error("Bad size value `"+f.size+"`");f.family||(f.family=o.family),Array.isArray(f.family)&&(f.family.length||(f.family=[o.family]),f.family=f.family.map(function(g){return n[g]?g:'"'+g+'"'}).join(", "));var v=[];return v.push(f.style),f.variant!==f.style&&v.push(f.variant),f.weight!==f.variant&&f.weight!==f.style&&v.push(f.weight),f.stretch!==f.weight&&f.stretch!==f.variant&&f.stretch!==f.style&&v.push(f.stretch),v.push(f.size+(f.lineHeight==null||f.lineHeight==="normal"||f.lineHeight+""=="1"?"":"/"+f.lineHeight)),v.push(f.family),v.filter(Boolean).join(" ")};function a(f,v){if(f&&!v[f]&&!E[f])throw Error("Unknown keyword `"+f+"`");return f}function s(f){for(var v={},g=0;g{V.exports={parse:e9(),stringify:c5()}}),n9=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?V.exports=d():u.createREGL=d()})(K,function(){var u=function(ie,nr){for(var cr=Object.keys(nr),sn=0;sn1&&nr===cr&&(nr==='"'||nr==="'"))return['"'+r(ie.substr(1,ie.length-2))+'"'];var sn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(ie);if(sn)return i(ie.substr(0,sn.index)).concat(i(sn[1])).concat(i(ie.substr(sn.index+sn[0].length)));var zn=ie.split(".");if(zn.length===1)return['"'+r(ie)+'"'];for(var Tn=[],qr=0;qr"u"?1:window.devicePixelRatio,ka=!1,Ka={},Va=function(Nr){},fa=function(){};if(typeof nr=="string"?cr=document.querySelector(nr):typeof nr=="object"&&(x(nr)?cr=nr:y(nr)?(Tn=nr,zn=Tn.canvas):("gl"in nr?Tn=nr.gl:"canvas"in nr?zn=k(nr.canvas):"container"in nr&&(sn=k(nr.container)),"attributes"in nr&&(qr=nr.attributes),"extensions"in nr&&(Sn=S(nr.extensions)),"optionalExtensions"in nr&&(sa=S(nr.optionalExtensions)),"onDone"in nr&&(Va=nr.onDone),"profile"in nr&&(ka=!!nr.profile),"pixelRatio"in nr&&(ea=+nr.pixelRatio),"cachedCode"in nr&&(Ka=nr.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?zn=cr:sn=cr),!Tn){if(!zn){var Un=w(sn||document.body,Va,ea);if(!Un)return null;zn=Un.canvas,fa=Un.onDestroy}qr.premultipliedAlpha===void 0&&(qr.premultipliedAlpha=!0),Tn=l(zn,qr)}return Tn?{gl:Tn,canvas:zn,container:sn,extensions:Sn,optionalExtensions:sa,pixelRatio:ea,profile:ka,cachedCode:Ka,onDone:Va,onDestroy:fa}:(fa(),Va("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function T(ie,nr){var cr={};function sn(qr){var Sn=qr.toLowerCase(),sa;try{sa=cr[Sn]=ie.getExtension(Sn)}catch{}return!!sa}for(var zn=0;zn65535)<<4,ie>>>=nr,cr=(ie>255)<<3,ie>>>=cr,nr|=cr,cr=(ie>15)<<2,ie>>>=cr,nr|=cr,cr=(ie>3)<<1,ie>>>=cr,nr|=cr,nr|ie>>1}function F(){var ie=c(8,function(){return[]});function nr(Tn){var qr=R(Tn),Sn=ie[I(qr)>>2];return Sn.length>0?Sn.pop():new ArrayBuffer(qr)}function cr(Tn){ie[I(Tn.byteLength)>>2].push(Tn)}function sn(Tn,qr){var Sn=null;switch(Tn){case h:Sn=new Int8Array(nr(qr),0,qr);break;case b:Sn=new Uint8Array(nr(qr),0,qr);break;case _:Sn=new Int16Array(nr(2*qr),0,qr);break;case P:Sn=new Uint16Array(nr(2*qr),0,qr);break;case z:Sn=new Int32Array(nr(4*qr),0,qr);break;case D:Sn=new Uint32Array(nr(4*qr),0,qr);break;case B:Sn=new Float32Array(nr(4*qr),0,qr);break;default:return null}return Sn.length!==qr?Sn.subarray(0,qr):Sn}function zn(Tn){cr(Tn.buffer)}return{alloc:nr,free:cr,allocType:sn,freeType:zn}}var j=F();j.zero=F();var N=3408,G=3410,rt=3411,ct=3412,st=3413,et=3414,Z=3415,ot=33901,X=33902,Q=3379,ut=3386,J=34921,q=36347,it=36348,nt=35661,dt=35660,Tt=34930,wt=36349,Ct=34076,It=34024,Nt=7936,te=7937,Jt=7938,ee=35724,Zt=34047,mt=36063,bt=34852,vt=3553,Ut=34067,re=34069,Kt=33984,ue=6408,Me=5126,Ce=5121,We=36160,qe=36053,vr=36064,_r=16384,er=function(ie,nr){var cr=1;nr.ext_texture_filter_anisotropic&&(cr=ie.getParameter(Zt));var sn=1,zn=1;nr.webgl_draw_buffers&&(sn=ie.getParameter(bt),zn=ie.getParameter(mt));var Tn=!!nr.oes_texture_float;if(Tn){var qr=ie.createTexture();ie.bindTexture(vt,qr),ie.texImage2D(vt,0,ue,1,1,0,ue,Me,null);var Sn=ie.createFramebuffer();if(ie.bindFramebuffer(We,Sn),ie.framebufferTexture2D(We,vr,vt,qr,0),ie.bindTexture(vt,null),ie.checkFramebufferStatus(We)!==qe)Tn=!1;else{ie.viewport(0,0,1,1),ie.clearColor(1,0,0,1),ie.clear(_r);var sa=j.allocType(Me,4);ie.readPixels(0,0,1,1,ue,Me,sa),ie.getError()?Tn=!1:(ie.deleteFramebuffer(Sn),ie.deleteTexture(qr),Tn=sa[0]===1),j.freeType(sa)}}var ea=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ka=!0;if(!ea){var Ka=ie.createTexture(),Va=j.allocType(Ce,36);ie.activeTexture(Kt),ie.bindTexture(Ut,Ka),ie.texImage2D(re,0,ue,3,3,0,ue,Ce,Va),j.freeType(Va),ie.bindTexture(Ut,null),ie.deleteTexture(Ka),ka=!ie.getError()}return{colorBits:[ie.getParameter(G),ie.getParameter(rt),ie.getParameter(ct),ie.getParameter(st)],depthBits:ie.getParameter(et),stencilBits:ie.getParameter(Z),subpixelBits:ie.getParameter(N),extensions:Object.keys(nr).filter(function(fa){return!!nr[fa]}),maxAnisotropic:cr,maxDrawbuffers:sn,maxColorAttachments:zn,pointSizeDims:ie.getParameter(ot),lineWidthDims:ie.getParameter(X),maxViewportDims:ie.getParameter(ut),maxCombinedTextureUnits:ie.getParameter(nt),maxCubeMapSize:ie.getParameter(Ct),maxRenderbufferSize:ie.getParameter(It),maxTextureUnits:ie.getParameter(Tt),maxTextureSize:ie.getParameter(Q),maxAttributes:ie.getParameter(J),maxVertexUniforms:ie.getParameter(q),maxVertexTextureUnits:ie.getParameter(dt),maxVaryingVectors:ie.getParameter(it),maxFragmentUniforms:ie.getParameter(wt),glsl:ie.getParameter(ee),renderer:ie.getParameter(te),vendor:ie.getParameter(Nt),version:ie.getParameter(Jt),readFloat:Tn,npotTextureCube:ka}},Mr=function(ie){return ie instanceof Uint8Array||ie instanceof Uint16Array||ie instanceof Uint32Array||ie instanceof Int8Array||ie instanceof Int16Array||ie instanceof Int32Array||ie instanceof Float32Array||ie instanceof Float64Array||ie instanceof Uint8ClampedArray};function Ir(ie){return!!ie&&typeof ie=="object"&&Array.isArray(ie.shape)&&Array.isArray(ie.stride)&&typeof ie.offset=="number"&&ie.shape.length===ie.stride.length&&(Array.isArray(ie.data)||Mr(ie.data))}var de=function(ie){return Object.keys(ie).map(function(nr){return ie[nr]})},Dt={shape:Ht,flatten:St};function qt(ie,nr,cr){for(var sn=0;sn0){var qa;if(Array.isArray(fn[0])){ya=gn(fn);for(var Rn=1,An=1;An0){if(typeof Rn[0]=="number"){var aa=j.allocType(kn.dtype,Rn.length);zr(aa,Rn),ya(aa,Pa),j.freeType(aa)}else if(Array.isArray(Rn[0])||Mr(Rn[0])){ba=gn(Rn);var oa=En(Rn,ba,kn.dtype);ya(oa,Pa),j.freeType(oa)}}}else if(Ir(Rn)){ba=Rn.shape;var Sa=Rn.stride,_i=0,pi=0,Ma=0,Na=0;ba.length===1?(_i=ba[0],pi=1,Ma=Sa[0],Na=0):ba.length===2&&(_i=ba[0],pi=ba[1],Ma=Sa[0],Na=Sa[1]);var ui=Array.isArray(Rn.data)?kn.dtype:tr(Rn.data),gi=j.allocType(ui,_i*pi);tn(gi,Rn.data,_i,pi,Ma,Na,Rn.offset),ya(gi,Pa),j.freeType(gi)}return Ia}return Xn||Ia(Nr),Ia._reglType="buffer",Ia._buffer=kn,Ia.subdata=qa,cr.profile&&(Ia.stats=kn.stats),Ia.destroy=function(){Va(kn)},Ia}function Un(){de(Tn).forEach(function(Nr){Nr.buffer=ie.createBuffer(),ie.bindBuffer(Nr.type,Nr.buffer),ie.bufferData(Nr.type,Nr.persistentData||Nr.byteLength,Nr.usage)})}return cr.profile&&(nr.getTotalBufferSize=function(){var Nr=0;return Object.keys(Tn).forEach(function(fn){Nr+=Tn[fn].stats.size}),Nr}),{create:fa,createStream:sa,destroyStream:ea,clear:function(){de(Tn).forEach(Va),Sn.forEach(Va)},getBuffer:function(Nr){return Nr&&Nr._buffer instanceof qr?Nr._buffer:null},restore:Un,_initBuffer:Ka}}var $r=0,In=0,Nn=1,Kn=1,$n=4,ia=4,Cn={points:$r,point:In,lines:Nn,line:Kn,triangles:$n,triangle:ia,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Fa=0,Ga=1,ve=4,ge=5120,dr=5121,br=5122,Tr=5123,mr=5124,kr=5125,Ur=34963,Or=35040,pe=35044;function Ke(ie,nr,cr,sn){var zn={},Tn=0,qr={uint8:dr,uint16:Tr};nr.oes_element_index_uint&&(qr.uint32=kr);function Sn(Un){this.id=Tn++,zn[this.id]=this,this.buffer=Un,this.primType=ve,this.vertCount=0,this.type=0}Sn.prototype.bind=function(){this.buffer.bind()};var sa=[];function ea(Un){var Nr=sa.pop();return Nr||(Nr=new Sn(cr.create(null,Ur,!0,!1)._buffer)),Ka(Nr,Un,Or,-1,-1,0,0),Nr}function ka(Un){sa.push(Un)}function Ka(Un,Nr,fn,Xn,jn,kn,Ia){Un.buffer.bind();var ya;if(Nr){var qa=Ia;!Ia&&(!Mr(Nr)||Ir(Nr)&&!Mr(Nr.data))&&(qa=nr.oes_element_index_uint?kr:Tr),cr._initBuffer(Un.buffer,Nr,fn,qa,3)}else ie.bufferData(Ur,kn,fn),Un.buffer.dtype=ya||dr,Un.buffer.usage=fn,Un.buffer.dimension=3,Un.buffer.byteLength=kn;if(ya=Ia,!Ia){switch(Un.buffer.dtype){case dr:case ge:ya=dr;break;case Tr:case br:ya=Tr;break;case kr:case mr:ya=kr;break}Un.buffer.dtype=ya}Un.type=ya;var Rn=jn;Rn<0&&(Rn=Un.buffer.byteLength,ya===Tr?Rn>>=1:ya===kr&&(Rn>>=2)),Un.vertCount=Rn;var An=Xn;if(Xn<0){An=ve;var Pa=Un.buffer.dimension;Pa===1&&(An=Fa),Pa===2&&(An=Ga),Pa===3&&(An=ve)}Un.primType=An}function Va(Un){sn.elementsCount--,delete zn[Un.id],Un.buffer.destroy(),Un.buffer=null}function fa(Un,Nr){var fn=cr.create(null,Ur,!0),Xn=new Sn(fn._buffer);sn.elementsCount++;function jn(kn){if(!kn)fn(),Xn.primType=ve,Xn.vertCount=0,Xn.type=dr;else if(typeof kn=="number")fn(kn),Xn.primType=ve,Xn.vertCount=kn|0,Xn.type=dr;else{var Ia=null,ya=pe,qa=-1,Rn=-1,An=0,Pa=0;Array.isArray(kn)||Mr(kn)||Ir(kn)?Ia=kn:("data"in kn&&(Ia=kn.data),"usage"in kn&&(ya=Zn[kn.usage]),"primitive"in kn&&(qa=Cn[kn.primitive]),"count"in kn&&(Rn=kn.count|0),"type"in kn&&(Pa=qr[kn.type]),"length"in kn?An=kn.length|0:(An=Rn,Pa===Tr||Pa===br?An*=2:(Pa===kr||Pa===mr)&&(An*=4))),Ka(Xn,Ia,ya,qa,Rn,An,Pa)}return jn}return jn(Un),jn._reglType="elements",jn._elements=Xn,jn.subdata=function(kn,Ia){return fn.subdata(kn,Ia),jn},jn.destroy=function(){Va(Xn)},jn}return{create:fa,createStream:ea,destroyStream:ka,getElements:function(Un){return typeof Un=="function"&&Un._elements instanceof Sn?Un._elements:null},clear:function(){de(zn).forEach(Va)}}}var xr=new Float32Array(1),Gr=new Uint32Array(xr.buffer),ln=5123;function wn(ie){for(var nr=j.allocType(ln,ie.length),cr=0;cr>>31<<15,Tn=(sn<<1>>>24)-127,qr=sn>>13&1023;if(Tn<-24)nr[cr]=zn;else if(Tn<-14){var Sn=-14-Tn;nr[cr]=zn+(qr+1024>>Sn)}else Tn>15?nr[cr]=zn+31744:nr[cr]=zn+(Tn+15<<10)+qr}return nr}function rn(ie){return Array.isArray(ie)||Mr(ie)}var Qr=34467,vn=3553,Oa=34067,Qn=34069,Qa=6408,Ja=6406,wi=6407,ci=6409,Ti=6410,Ra=32854,Qi=32855,Hi=36194,Ho=32819,Ci=32820,zo=33635,qi=34042,qo=6402,Po=34041,hs=35904,Gi=35906,uo=36193,yi=33776,ao=33777,ts=33778,vs=33779,As=35986,_o=35987,Da=34798,li=35840,wo=35841,Ms=35842,Di=35843,_s=36196,No=5121,is=5123,al=5125,ii=5126,io=10242,co=10243,Is=10497,Wo=33071,Bi=33648,$s=10240,fl=10241,Jo=9728,us=9729,Ss=9984,Ls=9985,xl=9986,bu=9987,au=33170,fu=4352,Ec=4353,xc=4354,cs=34046,Gl=3317,zc=37440,Al=37441,_l=37443,Ml=37444,hu=33984,Fs=[Ss,xl,Ls,bu],bl=[0,ci,Ti,wi,Qa],Fo={};Fo[ci]=Fo[Ja]=Fo[qo]=1,Fo[Po]=Fo[Ti]=2,Fo[wi]=Fo[hs]=3,Fo[Qa]=Fo[Gi]=4;function bs(ie){return"[object "+ie+"]"}var Iu=bs("HTMLCanvasElement"),Nl=bs("OffscreenCanvas"),Hu=bs("CanvasRenderingContext2D"),qs=bs("ImageBitmap"),sf=bs("HTMLImageElement"),Oo=bs("HTMLVideoElement"),yf=Object.keys(Yt).concat([Iu,Nl,Hu,qs,sf,Oo]),os=[];os[No]=1,os[ii]=4,os[uo]=2,os[is]=2,os[al]=4;var Fi=[];Fi[Ra]=2,Fi[Qi]=2,Fi[Hi]=2,Fi[Po]=4,Fi[yi]=.5,Fi[ao]=.5,Fi[ts]=1,Fi[vs]=1,Fi[As]=.5,Fi[_o]=1,Fi[Da]=1,Fi[li]=.5,Fi[wo]=.25,Fi[Ms]=.5,Fi[Di]=.25,Fi[_s]=.5;function nc(ie){return Array.isArray(ie)&&(ie.length===0||typeof ie[0]=="number")}function pu(ie){if(!Array.isArray(ie))return!1;var nr=ie.length;return!(nr===0||!rn(ie[0]))}function ml(ie){return Object.prototype.toString.call(ie)}function Lc(ie){return ml(ie)===Iu}function qu(ie){return ml(ie)===Nl}function dc(ie){return ml(ie)===Hu}function wl(ie){return ml(ie)===qs}function Yc(ie){return ml(ie)===sf}function Fc(ie){return ml(ie)===Oo}function mc(ie){if(!ie)return!1;var nr=ml(ie);return yf.indexOf(nr)>=0?!0:nc(ie)||pu(ie)||Ir(ie)}function Wu(ie){return Yt[Object.prototype.toString.call(ie)]|0}function Cc(ie,nr){var cr=nr.length;switch(ie.type){case No:case is:case al:case ii:var sn=j.allocType(ie.type,cr);sn.set(nr),ie.data=sn;break;case uo:ie.data=wn(nr);break}}function Ic(ie,nr){return j.allocType(ie.type===uo?ii:ie.type,nr)}function du(ie,nr){ie.type===uo?(ie.data=wn(nr),j.freeType(nr)):ie.data=nr}function Bc(ie,nr,cr,sn,zn,Tn){for(var qr=ie.width,Sn=ie.height,sa=ie.channels,ea=qr*Sn*sa,ka=Ic(ie,ea),Ka=0,Va=0;Va=1;)Sn+=qr*sa*sa,sa/=2;return Sn}else return qr*cr*sn}function wu(ie,nr,cr,sn,zn,Tn,qr){var Sn={"don't care":fu,"dont care":fu,nice:xc,fast:Ec},sa={repeat:Is,clamp:Wo,mirror:Bi},ea={nearest:Jo,linear:us},ka=u({mipmap:bu,"nearest mipmap nearest":Ss,"linear mipmap nearest":Ls,"nearest mipmap linear":xl,"linear mipmap linear":bu},ea),Ka={none:0,browser:Ml},Va={uint8:No,rgba4:Ho,rgb565:zo,"rgb5 a1":Ci},fa={alpha:Ja,luminance:ci,"luminance alpha":Ti,rgb:wi,rgba:Qa,rgba4:Ra,"rgb5 a1":Qi,rgb565:Hi},Un={};nr.ext_srgb&&(fa.srgb=hs,fa.srgba=Gi),nr.oes_texture_float&&(Va.float32=Va.float=ii),nr.oes_texture_half_float&&(Va.float16=Va["half float"]=uo),nr.webgl_depth_texture&&(u(fa,{depth:qo,"depth stencil":Po}),u(Va,{uint16:is,uint32:al,"depth stencil":qi})),nr.webgl_compressed_texture_s3tc&&u(Un,{"rgb s3tc dxt1":yi,"rgba s3tc dxt1":ao,"rgba s3tc dxt3":ts,"rgba s3tc dxt5":vs}),nr.webgl_compressed_texture_atc&&u(Un,{"rgb atc":As,"rgba atc explicit alpha":_o,"rgba atc interpolated alpha":Da}),nr.webgl_compressed_texture_pvrtc&&u(Un,{"rgb pvrtc 4bppv1":li,"rgb pvrtc 2bppv1":wo,"rgba pvrtc 4bppv1":Ms,"rgba pvrtc 2bppv1":Di}),nr.webgl_compressed_texture_etc1&&(Un["rgb etc1"]=_s);var Nr=Array.prototype.slice.call(ie.getParameter(Qr));Object.keys(Un).forEach(function(U){var tt=Un[U];Nr.indexOf(tt)>=0&&(fa[U]=tt)});var fn=Object.keys(fa);cr.textureFormats=fn;var Xn=[];Object.keys(fa).forEach(function(U){var tt=fa[U];Xn[tt]=U});var jn=[];Object.keys(Va).forEach(function(U){var tt=Va[U];jn[tt]=U});var kn=[];Object.keys(ea).forEach(function(U){var tt=ea[U];kn[tt]=U});var Ia=[];Object.keys(ka).forEach(function(U){var tt=ka[U];Ia[tt]=U});var ya=[];Object.keys(sa).forEach(function(U){var tt=sa[U];ya[tt]=U});var qa=fn.reduce(function(U,tt){var Y=fa[tt];return Y===ci||Y===Ja||Y===ci||Y===Ti||Y===qo||Y===Po||nr.ext_srgb&&(Y===hs||Y===Gi)?U[Y]=Y:Y===Qi||tt.indexOf("rgba")>=0?U[Y]=Qa:U[Y]=wi,U},{});function Rn(){this.internalformat=Qa,this.format=Qa,this.type=No,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ml,this.width=0,this.height=0,this.channels=0}function An(U,tt){U.internalformat=tt.internalformat,U.format=tt.format,U.type=tt.type,U.compressed=tt.compressed,U.premultiplyAlpha=tt.premultiplyAlpha,U.flipY=tt.flipY,U.unpackAlignment=tt.unpackAlignment,U.colorSpace=tt.colorSpace,U.width=tt.width,U.height=tt.height,U.channels=tt.channels}function Pa(U,tt){if(!(typeof tt!="object"||!tt)){if("premultiplyAlpha"in tt&&(U.premultiplyAlpha=tt.premultiplyAlpha),"flipY"in tt&&(U.flipY=tt.flipY),"alignment"in tt&&(U.unpackAlignment=tt.alignment),"colorSpace"in tt&&(U.colorSpace=Ka[tt.colorSpace]),"type"in tt){var Y=tt.type;U.type=Va[Y]}var ft=U.width,zt=U.height,Qt=U.channels,ne=!1;"shape"in tt?(ft=tt.shape[0],zt=tt.shape[1],tt.shape.length===3&&(Qt=tt.shape[2],ne=!0)):("radius"in tt&&(ft=zt=tt.radius),"width"in tt&&(ft=tt.width),"height"in tt&&(zt=tt.height),"channels"in tt&&(Qt=tt.channels,ne=!0)),U.width=ft|0,U.height=zt|0,U.channels=Qt|0;var Ft=!1;if("format"in tt){var $t=tt.format,he=U.internalformat=fa[$t];U.format=qa[he],$t in Va&&("type"in tt||(U.type=Va[$t])),$t in Un&&(U.compressed=!0),Ft=!0}!ne&&Ft?U.channels=Fo[U.format]:ne&&!Ft&&U.channels!==bl[U.format]&&(U.format=U.internalformat=bl[U.channels])}}function ba(U){ie.pixelStorei(zc,U.flipY),ie.pixelStorei(Al,U.premultiplyAlpha),ie.pixelStorei(_l,U.colorSpace),ie.pixelStorei(Gl,U.unpackAlignment)}function aa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function oa(U,tt){var Y=null;if(mc(tt)?Y=tt:tt&&(Pa(U,tt),"x"in tt&&(U.xOffset=tt.x|0),"y"in tt&&(U.yOffset=tt.y|0),mc(tt.data)&&(Y=tt.data)),tt.copy){var ft=zn.viewportWidth,zt=zn.viewportHeight;U.width=U.width||ft-U.xOffset,U.height=U.height||zt-U.yOffset,U.needsCopy=!0}else if(!Y)U.width=U.width||1,U.height=U.height||1,U.channels=U.channels||4;else if(Mr(Y))U.channels=U.channels||4,U.data=Y,!("type"in tt)&&U.type===No&&(U.type=Wu(Y));else if(nc(Y))U.channels=U.channels||4,Cc(U,Y),U.alignment=1,U.needsFree=!0;else if(Ir(Y)){var Qt=Y.data;!Array.isArray(Qt)&&U.type===No&&(U.type=Wu(Qt));var ne=Y.shape,Ft=Y.stride,$t,he,Ne,Ie,Fe,He;ne.length===3?(Ne=ne[2],He=Ft[2]):(Ne=1,He=1),$t=ne[0],he=ne[1],Ie=Ft[0],Fe=Ft[1],U.alignment=1,U.width=$t,U.height=he,U.channels=Ne,U.format=U.internalformat=bl[Ne],U.needsFree=!0,Bc(U,Qt,Ie,Fe,He,Y.offset)}else if(Lc(Y)||qu(Y)||dc(Y))Lc(Y)||qu(Y)?U.element=Y:U.element=Y.canvas,U.width=U.element.width,U.height=U.element.height,U.channels=4;else if(wl(Y))U.element=Y,U.width=Y.width,U.height=Y.height,U.channels=4;else if(Yc(Y))U.element=Y,U.width=Y.naturalWidth,U.height=Y.naturalHeight,U.channels=4;else if(Fc(Y))U.element=Y,U.width=Y.videoWidth,U.height=Y.videoHeight,U.channels=4;else if(pu(Y)){var Ge=U.width||Y[0].length,Ae=U.height||Y.length,Oe=U.channels;rn(Y[0][0])?Oe=Oe||Y[0][0].length:Oe=Oe||1;for(var Le=Dt.shape(Y),ur=1,Dr=0;Dr>=zt,Y.height>>=zt,oa(Y,ft[zt]),U.mipmask|=1<=0&&!("faces"in tt)&&(U.genMipmaps=!0)}if("mag"in tt){var ft=tt.mag;U.magFilter=ea[ft]}var zt=U.wrapS,Qt=U.wrapT;if("wrap"in tt){var ne=tt.wrap;typeof ne=="string"?zt=Qt=sa[ne]:Array.isArray(ne)&&(zt=sa[ne[0]],Qt=sa[ne[1]])}else{if("wrapS"in tt){var Ft=tt.wrapS;zt=sa[Ft]}if("wrapT"in tt){var $t=tt.wrapT;Qt=sa[$t]}}if(U.wrapS=zt,U.wrapT=Qt,"anisotropic"in tt&&(tt.anisotropic,U.anisotropic=tt.anisotropic),"mipmap"in tt){var he=!1;switch(typeof tt.mipmap){case"string":U.mipmapHint=Sn[tt.mipmap],U.genMipmaps=!0,he=!0;break;case"boolean":he=U.genMipmaps=tt.mipmap;break;case"object":U.genMipmaps=!1,he=!0;break}he&&!("min"in tt)&&(U.minFilter=Ss)}}function El(U,tt){ie.texParameteri(tt,fl,U.minFilter),ie.texParameteri(tt,$s,U.magFilter),ie.texParameteri(tt,io,U.wrapS),ie.texParameteri(tt,co,U.wrapT),nr.ext_texture_filter_anisotropic&&ie.texParameteri(tt,cs,U.anisotropic),U.genMipmaps&&(ie.hint(au,U.mipmapHint),ie.generateMipmap(tt))}var Cl=0,Hs={},js=cr.maxTextureUnits,Ks=Array(js).map(function(){return null});function Mi(U){Rn.call(this),this.mipmask=0,this.internalformat=Qa,this.id=Cl++,this.refCount=1,this.target=U,this.texture=ie.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Zo,qr.profile&&(this.stats={size:0})}function Ys(U){ie.activeTexture(hu),ie.bindTexture(U.target,U.texture)}function Uo(){var U=Ks[0];U?ie.bindTexture(U.target,U.texture):ie.bindTexture(vn,null)}function tl(U){var tt=U.texture,Y=U.unit,ft=U.target;Y>=0&&(ie.activeTexture(hu+Y),ie.bindTexture(ft,null),Ks[Y]=null),ie.deleteTexture(tt),U.texture=null,U.params=null,U.pixels=null,U.refCount=0,delete Hs[U.id],Tn.textureCount--}u(Mi.prototype,{bind:function(){var U=this;U.bindCount+=1;var tt=U.unit;if(tt<0){for(var Y=0;Y0)continue;ft.unit=-1}Ks[Y]=U,tt=Y;break}qr.profile&&Tn.maxTextureUnits>Fe)-Ne,He.height=He.height||(Y.height>>Fe)-Ie,Ys(Y),_i(He,vn,Ne,Ie,Fe),Uo(),Na(He),ft}function Qt(ne,Ft){var $t=ne|0,he=Ft|0||$t;if($t===Y.width&&he===Y.height)return ft;ft.width=Y.width=$t,ft.height=Y.height=he,Ys(Y);for(var Ne=0;Y.mipmask>>Ne;++Ne){var Ie=$t>>Ne,Fe=he>>Ne;if(!Ie||!Fe)break;ie.texImage2D(vn,Ne,Y.format,Ie,Fe,0,Y.format,Y.type,null)}return Uo(),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,$t,he,!1,!1)),ft}return ft(U,tt),ft.subimage=zt,ft.resize=Qt,ft._reglType="texture2d",ft._texture=Y,qr.profile&&(ft.stats=Y.stats),ft.destroy=function(){Y.decRef()},ft}function vi(U,tt,Y,ft,zt,Qt){var ne=new Mi(Oa);Hs[ne.id]=ne,Tn.cubeCount++;var Ft=new Array(6);function $t(Ie,Fe,He,Ge,Ae,Oe){var Le,ur=ne.texInfo;for(Zo.call(ur),Le=0;Le<6;++Le)Ft[Le]=Zi();if(typeof Ie=="number"||!Ie){var Dr=Ie|0||1;for(Le=0;Le<6;++Le)gi(Ft[Le],Dr,Dr)}else if(typeof Ie=="object")if(Fe)Ri(Ft[0],Ie),Ri(Ft[1],Fe),Ri(Ft[2],He),Ri(Ft[3],Ge),Ri(Ft[4],Ae),Ri(Ft[5],Oe);else if(Qs(ur,Ie),Pa(ne,Ie),"faces"in Ie){var jr=Ie.faces;for(Le=0;Le<6;++Le)An(Ft[Le],ne),Ri(Ft[Le],jr[Le])}else for(Le=0;Le<6;++Le)Ri(Ft[Le],Ie);for(An(ne,Ft[0]),ur.genMipmaps?ne.mipmask=(Ft[0].width<<1)-1:ne.mipmask=Ft[0].mipmask,ne.internalformat=Ft[0].internalformat,$t.width=Ft[0].width,$t.height=Ft[0].height,Ys(ne),Le=0;Le<6;++Le)ds(Ft[Le],Qn+Le);for(El(ur,Oa),Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,ur.genMipmaps,!0)),$t.format=Xn[ne.internalformat],$t.type=jn[ne.type],$t.mag=kn[ur.magFilter],$t.min=Ia[ur.minFilter],$t.wrapS=ya[ur.wrapS],$t.wrapT=ya[ur.wrapT],Le=0;Le<6;++Le)Zs(Ft[Le]);return $t}function he(Ie,Fe,He,Ge,Ae){var Oe=He|0,Le=Ge|0,ur=Ae|0,Dr=Ma();return An(Dr,ne),Dr.width=0,Dr.height=0,oa(Dr,Fe),Dr.width=Dr.width||(ne.width>>ur)-Oe,Dr.height=Dr.height||(ne.height>>ur)-Le,Ys(ne),_i(Dr,Qn+Ie,Oe,Le,ur),Uo(),Na(Dr),$t}function Ne(Ie){var Fe=Ie|0;if(Fe!==ne.width){$t.width=ne.width=Fe,$t.height=ne.height=Fe,Ys(ne);for(var He=0;He<6;++He)for(var Ge=0;ne.mipmask>>Ge;++Ge)ie.texImage2D(Qn+He,Ge,ne.format,Fe>>Ge,Fe>>Ge,0,ne.format,ne.type,null);return Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,!1,!0)),$t}}return $t(U,tt,Y,ft,zt,Qt),$t.subimage=he,$t.resize=Ne,$t._reglType="textureCube",$t._texture=ne,qr.profile&&($t.stats=ne.stats),$t.destroy=function(){ne.decRef()},$t}function lo(){for(var U=0;U>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);else for(var zt=0;zt<6;++zt)ie.texImage2D(Qn+zt,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);El(Y.texInfo,Y.target)})}function $o(){for(var U=0;U=0?Zs=!0:sa.indexOf(Zo)>=0&&(Zs=!1))),("depthTexture"in Mi||"depthStencilTexture"in Mi)&&(Ks=!!(Mi.depthTexture||Mi.depthStencilTexture)),"depth"in Mi&&(typeof Mi.depth=="boolean"?ds=Mi.depth:(Cl=Mi.depth,rs=!1)),"stencil"in Mi&&(typeof Mi.stencil=="boolean"?rs=Mi.stencil:(Hs=Mi.stencil,ds=!1)),"depthStencil"in Mi&&(typeof Mi.depthStencil=="boolean"?ds=rs=Mi.depthStencil:(js=Mi.depthStencil,ds=!1,rs=!1))}var Uo=null,tl=null,Il=null,vi=null;if(Array.isArray(Zi))Uo=Zi.map(Un);else if(Zi)Uo=[Un(Zi)];else for(Uo=new Array(El),ui=0;ui0&&(Na.depth=oa[0].depth,Na.stencil=oa[0].stencil,Na.depthStencil=oa[0].depthStencil),oa[Ma]?oa[Ma](Na):oa[Ma]=An(Na)}return u(Sa,{width:ui,height:ui,color:Zo})}function _i(pi){var Ma,Na=pi|0;if(Na===Sa.width)return Sa;var ui=Sa.color;for(Ma=0;Ma=ui.byteLength?gi.subdata(ui):(gi.destroy(),An.buffers[pi]=null)),An.buffers[pi]||(gi=An.buffers[pi]=zn.create(Ma,Tc,!1,!0)),Na.buffer=zn.getBuffer(gi),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1,Sa[pi]=1}else zn.getBuffer(Ma)?(Na.buffer=zn.getBuffer(Ma),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1):zn.getBuffer(Ma.buffer)?(Na.buffer=zn.getBuffer(Ma.buffer),Na.size=(+Ma.size||Na.buffer.dimension)|0,Na.normalized=!!Ma.normalized||!1,"type"in Ma?Na.type=pn[Ma.type]:Na.type=Na.buffer.dtype,Na.offset=(Ma.offset||0)|0,Na.stride=(Ma.stride||0)|0,Na.divisor=(Ma.divisor||0)|0,Na.state=1):"x"in Ma&&(Na.x=+Ma.x||0,Na.y=+Ma.y||0,Na.z=+Ma.z||0,Na.w=+Ma.w||0,Na.state=2)}for(var Ri=0;Ri1)for(var ba=0;baNr&&(Nr=fn.stats.uniformsCount)}),Nr},cr.getMaxAttributesCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.attributesCount>Nr&&(Nr=fn.stats.attributesCount)}),Nr});function Un(){zn={},Tn={};for(var Nr=0;Nr>>4&15)+nr.charAt(sn&15);return cr}function Fu(ie){for(var nr="",cr=-1,sn,zn;++cr>>6&31,128|sn&63):sn<=65535?nr+=String.fromCharCode(224|sn>>>12&15,128|sn>>>6&63,128|sn&63):sn<=2097151&&(nr+=String.fromCharCode(240|sn>>>18&7,128|sn>>>12&63,128|sn>>>6&63,128|sn&63));return nr}function Au(ie){for(var nr=Array(ie.length>>2),cr=0;cr>5]|=(ie.charCodeAt(cr/8)&255)<<24-cr%32;return nr}function il(ie){for(var nr="",cr=0;cr>5]>>>24-cr%32&255);return nr}function Cs(ie,nr){return ie>>>nr|ie<<32-nr}function Mu(ie,nr){return ie>>>nr}function lc(ie,nr,cr){return ie&nr^~ie&cr}function Su(ie,nr,cr){return ie&nr^ie&cr^nr&cr}function Oc(ie){return Cs(ie,2)^Cs(ie,13)^Cs(ie,22)}function Xe(ie){return Cs(ie,6)^Cs(ie,11)^Cs(ie,25)}function yr(ie){return Cs(ie,7)^Cs(ie,18)^Mu(ie,3)}function Kr(ie){return Cs(ie,17)^Cs(ie,19)^Mu(ie,10)}var Rr=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function mn(ie,nr){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),sn=new Array(64),zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr;for(ie[nr>>5]|=128<<24-nr%32,ie[(nr+64>>9<<4)+15]=nr,Va=0;Va>16)+(nr>>16)+(cr>>16);return sn<<16|cr&65535}function ha(ie){return Array.prototype.slice.call(ie)}function Ta(ie){return ha(ie).join("")}function Ua(ie){var nr=ie&&ie.cache,cr=0,sn=[],zn=[],Tn=[];function qr(Un,Nr){var fn=Nr&&Nr.stable;if(!fn){for(var Xn=0;Xn0&&(Un.push(jn,"="),Un.push.apply(Un,ha(arguments)),Un.push(";")),jn}return u(Nr,{def:Xn,toString:function(){return Ta([fn.length>0?"var "+fn.join(",")+";":"",Ta(Un)])}})}function sa(){var Un=Sn(),Nr=Sn(),fn=Un.toString,Xn=Nr.toString;function jn(kn,Ia){Nr(kn,Ia,"=",Un.def(kn,Ia),";")}return u(function(){Un.apply(Un,ha(arguments))},{def:Un.def,entry:Un,exit:Nr,save:jn,set:function(kn,Ia,ya){jn(kn,Ia),Un(kn,Ia,"=",ya,";")},toString:function(){return fn()+Xn()}})}function ea(){var Un=Ta(arguments),Nr=sa(),fn=sa(),Xn=Nr.toString,jn=fn.toString;return u(Nr,{then:function(){return Nr.apply(Nr,ha(arguments)),this},else:function(){return fn.apply(fn,ha(arguments)),this},toString:function(){var kn=jn();return kn&&(kn="else{"+kn+"}"),Ta(["if(",Un,"){",Xn(),"}",kn])}})}var ka=Sn(),Ka={};function Va(Un,Nr){var fn=[];function Xn(){var qa="a"+fn.length;return fn.push(qa),qa}Nr=Nr||0;for(var jn=0;jn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Hn={cw:Xt,ccw:fe};function Yn(ie){return Array.isArray(ie)||Mr(ie)||Ir(ie)}function na(ie){return ie.sort(function(nr,cr){return nr===ul?-1:cr===ul?1:nr=1,sn>=2,nr)}else if(cr===Wi){var zn=ie.data;return new _n(zn.thisDep,zn.contextDep,zn.propDep,nr)}else{if(cr===Xi)return new _n(!1,!1,!1,nr);if(cr===ni){for(var Tn=!1,qr=!1,Sn=!1,sa=0;sa=1&&(qr=!0),ka>=2&&(Sn=!0)}else ea.type===Wi&&(Tn=Tn||ea.data.thisDep,qr=qr||ea.data.contextDep,Sn=Sn||ea.data.propDep)}return new _n(Tn,qr,Sn,nr)}else return new _n(cr===Oi,cr===Vi,cr===ei,nr)}}var xi=new _n(!1,!1,!1,function(){});function ki(ie,nr,cr,sn,zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr){var fn=ea.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(Xn.min=me,Xn.max=we);var jn=cr.angle_instanced_arrays,kn=cr.webgl_draw_buffers,Ia=cr.oes_vertex_array_object,ya={dirty:!0,profile:Nr.profile},qa={},Rn=[],An={},Pa={};function ba(Ft){return Ft.replace(".","_")}function aa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),qa[Ne]=ya[Ne]=!!he,An[Ne]=$t}function oa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),Array.isArray(he)?(ya[Ne]=he.slice(),qa[Ne]=he.slice()):ya[Ne]=qa[Ne]=he,Pa[Ne]=$t}function Sa(Ft){return!!isNaN(Ft)}aa(Za,gr),aa($i,fr),oa(Do,"blendColor",[0,0,0,0]),oa(ss,"blendEquationSeparate",[Sr,Sr]),oa(Ps,"blendFuncSeparate",[Cr,or,Cr,or]),aa(ys,Hr,!0),oa(Os,"depthFunc",Wr),oa(Yo,"depthRange",[0,1]),oa(ll,"depthMask",!0),oa(el,el,[!0,!0,!0,!0]),aa(Rs,rr),oa(bi,"cullFace",Et),oa(so,so,fe),oa(ws,ws,1),aa(fs,cn),oa(Ll,"polygonOffset",[0,0]),aa($l,Mn),aa(jl,Jn),oa(Bu,"sampleCoverage",[1,!1]),aa(Jl,Lr),oa(Ru,"stencilMask",-1),oa(nl,"stencilFunc",[Ve,0,-1]),oa(Nu,"stencilOpSeparate",[gt,je,je,je]),oa(Ui,"stencilOpSeparate",[Et,je,je,je]),aa(fo,nn),oa(Ql,"scissor",[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]),oa(ul,ul,[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]);var _i={gl:ie,context:Va,strings:nr,next:qa,current:ya,draw:Ka,elements:Tn,buffer:zn,shader:ka,attributes:ea.state,vao:ea,uniforms:sa,framebuffer:Sn,extensions:cr,timer:fa,isBufferArgs:Yn},pi={primTypes:Cn,compareFuncs:hn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:pn,orientationType:Hn};kn&&(pi.backBuffer=[Et],pi.drawBuffer=c(sn.maxDrawbuffers,function(Ft){return Ft===0?[0]:c(Ft,function($t){return on+$t})}));var Ma=0;function Na(){var Ft=Ua({cache:Un}),$t=Ft.link,he=Ft.global;Ft.id=Ma++,Ft.batchId="0";var Ne=$t(_i),Ie=Ft.shared={props:"a0"};Object.keys(_i).forEach(function(Oe){Ie[Oe]=he.def(Ne,".",Oe)});var Fe=Ft.next={},He=Ft.current={};Object.keys(Pa).forEach(function(Oe){Array.isArray(ya[Oe])&&(Fe[Oe]=he.def(Ie.next,".",Oe),He[Oe]=he.def(Ie.current,".",Oe))});var Ge=Ft.constants={};Object.keys(pi).forEach(function(Oe){Ge[Oe]=he.def(JSON.stringify(pi[Oe]))}),Ft.invoke=function(Oe,Le){switch(Le.type){case ca:var ur=["this",Ie.context,Ie.props,Ft.batchId];return Oe.def($t(Le.data),".call(",ur.slice(0,Math.max(Le.data.length+1,4)),")");case ei:return Oe.def(Ie.props,Le.data);case Vi:return Oe.def(Ie.context,Le.data);case Oi:return Oe.def("this",Le.data);case Wi:return Le.data.append(Ft,Oe),Le.data.ref;case Xi:return Le.data.toString();case ni:return Le.data.map(function(Dr){return Ft.invoke(Oe,Dr)})}},Ft.attribCache={};var Ae={};return Ft.scopeAttrib=function(Oe){var Le=nr.id(Oe);if(Le in Ae)return Ae[Le];var ur=ea.scope[Le];ur||(ur=ea.scope[Le]=new fn);var Dr=Ae[Le]=$t(ur);return Dr},Ft}function ui(Ft){var $t=Ft.static,he=Ft.dynamic,Ne;if(Dc in $t){var Ie=!!$t[Dc];Ne=Wa(function(He,Ge){return Ie}),Ne.enable=Ie}else if(Dc in he){var Fe=he[Dc];Ne=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}return Ne}function gi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic;if(Pt in he){var Ie=he[Pt];return Ie?(Ie=Sn.getFramebuffer(Ie),Wa(function(He,Ge){var Ae=He.link(Ie),Oe=He.shared;Ge.set(Oe.framebuffer,".next",Ae);var Le=Oe.context;return Ge.set(Le,"."+pr,Ae+".width"),Ge.set(Le,"."+Br,Ae+".height"),Ae})):Wa(function(He,Ge){var Ae=He.shared;Ge.set(Ae.framebuffer,".next","null");var Oe=Ae.context;return Ge.set(Oe,"."+pr,Oe+"."+ae),Ge.set(Oe,"."+Br,Oe+"."+ce),"null"})}else if(Pt in Ne){var Fe=Ne[Pt];return ri(Fe,function(He,Ge){var Ae=He.invoke(Ge,Fe),Oe=He.shared,Le=Oe.framebuffer,ur=Ge.def(Le,".getFramebuffer(",Ae,")");Ge.set(Le,".next",ur);var Dr=Oe.context;return Ge.set(Dr,"."+pr,ur+"?"+ur+".width:"+Dr+"."+ae),Ge.set(Dr,"."+Br,ur+"?"+ur+".height:"+Dr+"."+ce),ur})}else return null}function Ri(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Ae){if(Ae in Ne){var Oe=Ne[Ae],Le=!0,ur=Oe.x|0,Dr=Oe.y|0,jr,On;return"width"in Oe?jr=Oe.width|0:Le=!1,"height"in Oe?On=Oe.height|0:Le=!1,new _n(!Le&&$t&&$t.thisDep,!Le&&$t&&$t.contextDep,!Le&&$t&&$t.propDep,function(Wn,Dn){var la=Wn.shared.context,qn=jr;"width"in Oe||(qn=Dn.def(la,".",pr,"-",ur));var Gn=On;return"height"in Oe||(Gn=Dn.def(la,".",Br,"-",Dr)),[ur,Dr,qn,Gn]})}else if(Ae in Ie){var Ln=Ie[Ae],xn=ri(Ln,function(Wn,Dn){var la=Wn.invoke(Dn,Ln),qn=Wn.shared.context,Gn=Dn.def(la,".x|0"),ma=Dn.def(la,".y|0"),ti=Dn.def('"width" in ',la,"?",la,".width|0:","(",qn,".",pr,"-",Gn,")"),si=Dn.def('"height" in ',la,"?",la,".height|0:","(",qn,".",Br,"-",ma,")");return[Gn,ma,ti,si]});return $t&&(xn.thisDep=xn.thisDep||$t.thisDep,xn.contextDep=xn.contextDep||$t.contextDep,xn.propDep=xn.propDep||$t.propDep),xn}else return $t?new _n($t.thisDep,$t.contextDep,$t.propDep,function(Wn,Dn){var la=Wn.shared.context;return[0,0,Dn.def(la,".",pr),Dn.def(la,".",Br)]}):null}var He=Fe(ul);if(He){var Ge=He;He=new _n(He.thisDep,He.contextDep,He.propDep,function(Ae,Oe){var Le=Ge.append(Ae,Oe),ur=Ae.shared.context;return Oe.set(ur,"."+Jr,Le[2]),Oe.set(ur,"."+Rt,Le[3]),Le})}return{viewport:He,scissor_box:Fe(Ql)}}function ds(Ft,$t){var he=Ft.static,Ne=typeof he[at]=="string"&&typeof he[L]=="string";if(Ne){if(Object.keys($t.dynamic).length>0)return null;var Ie=$t.static,Fe=Object.keys(Ie);if(Fe.length>0&&typeof Ie[Fe[0]]=="number"){for(var He=[],Ge=0;Ge"+Gn+"?"+Le+".constant["+Gn+"]:0;"}).join(""),"}}else{","if(",jr,"(",Le,".buffer)){",Wn,"=",On,".createStream(",ye,",",Le,".buffer);","}else{",Wn,"=",On,".getBuffer(",Le,".buffer);","}",Dn,'="type" in ',Le,"?",Dr.glTypes,"[",Le,".type]:",Wn,".dtype;",Ln.normalized,"=!!",Le,".normalized;");function la(qn){Oe(Ln[qn],"=",Le,".",qn,"|0;")}return la("size"),la("offset"),la("stride"),la("divisor"),Oe("}}"),Oe.exit("if(",Ln.isStream,"){",On,".destroyStream(",Wn,");","}"),Ln}Ie[Fe]=ri(He,Ge)}),Ie}function El(Ft){var $t=Ft.static,he=Ft.dynamic,Ne={};return Object.keys($t).forEach(function(Ie){var Fe=$t[Ie];Ne[Ie]=Wa(function(He,Ge){return typeof Fe=="number"||typeof Fe=="boolean"?""+Fe:He.link(Fe)})}),Object.keys(he).forEach(function(Ie){var Fe=he[Ie];Ne[Ie]=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}),Ne}function Cl(Ft,$t,he,Ne,Ie){Ft.static,Ft.dynamic;var Fe=ds(Ft,$t),He=gi(Ft),Ge=Ri(Ft,He),Ae=Zi(Ft),Oe=Zs(Ft),Le=rs(Ft,Ie,Fe);function ur(Wn){var Dn=Ge[Wn];Dn&&(Oe[Wn]=Dn)}ur(ul),ur(ba(Ql));var Dr=Object.keys(Oe).length>0,jr={framebuffer:He,draw:Ae,shader:Le,state:Oe,dirty:Dr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(jr.profile=ui(Ft),jr.uniforms=Zo(he),jr.drawVAO=jr.scopeVAO=Ae.vao,!jr.drawVAO&&Le.program&&!Fe&&cr.angle_instanced_arrays&&Ae.static.elements){var On=!0,Ln=Le.program.attributes.map(function(Wn){var Dn=$t.static[Wn];return On=On&&!!Dn,Dn});if(On&&Ln.length>0){var xn=ea.getVAO(ea.createVAO({attributes:Ln,elements:Ae.static.elements}));jr.drawVAO=new _n(null,null,null,function(Wn,Dn){return Wn.link(xn)}),jr.useVAO=!0}}return Fe?jr.useVAO=!0:jr.attributes=Qs($t),jr.context=El(Ne),jr}function Hs(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.context,Fe=Ft.scope();Object.keys(he).forEach(function(He){$t.save(Ie,"."+He);var Ge=he[He],Ae=Ge.append(Ft,$t);Array.isArray(Ae)?Fe(Ie,".",He,"=[",Ae.join(),"];"):Fe(Ie,".",He,"=",Ae,";")}),$t(Fe)}function js(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.framebuffer,Ge;kn&&(Ge=$t.def(Ie.extensions,".webgl_draw_buffers"));var Ae=Ft.constants,Oe=Ae.drawBuffer,Le=Ae.backBuffer,ur;he?ur=he.append(Ft,$t):ur=$t.def(He,".next"),Ne||$t("if(",ur,"!==",He,".cur){"),$t("if(",ur,"){",Fe,".bindFramebuffer(",an,",",ur,".framebuffer);"),kn&&$t(Ge,".drawBuffersWEBGL(",Oe,"[",ur,".colorAttachments.length]);"),$t("}else{",Fe,".bindFramebuffer(",an,",null);"),kn&&$t(Ge,".drawBuffersWEBGL(",Le,");"),$t("}",He,".cur=",ur,";"),Ne||$t("}")}function Ks(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.gl,Fe=Ft.current,He=Ft.next,Ge=Ne.current,Ae=Ne.next,Oe=Ft.cond(Ge,".dirty");Rn.forEach(function(Le){var ur=ba(Le);if(!(ur in he.state)){var Dr,jr;if(ur in He){Dr=He[ur],jr=Fe[ur];var On=c(ya[ur].length,function(xn){return Oe.def(Dr,"[",xn,"]")});Oe(Ft.cond(On.map(function(xn,Wn){return xn+"!=="+jr+"["+Wn+"]"}).join("||")).then(Ie,".",Pa[ur],"(",On,");",On.map(function(xn,Wn){return jr+"["+Wn+"]="+xn}).join(";"),";"))}else{Dr=Oe.def(Ae,".",ur);var Ln=Ft.cond(Dr,"!==",Ge,".",ur);Oe(Ln),ur in An?Ln(Ft.cond(Dr).then(Ie,".enable(",An[ur],");").else(Ie,".disable(",An[ur],");"),Ge,".",ur,"=",Dr,";"):Ln(Ie,".",Pa[ur],"(",Dr,");",Ge,".",ur,"=",Dr,";")}}}),Object.keys(he.state).length===0&&Oe(Ge,".dirty=false;"),$t(Oe)}function Mi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ft.current,He=Ie.current,Ge=Ie.gl,Ae;na(Object.keys(he)).forEach(function(Oe){var Le=he[Oe];if(!(Ne&&!Ne(Le))){var ur=Le.append(Ft,$t);if(An[Oe]){var Dr=An[Oe];Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ft.cond(Ae).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",Ae,";")):($t(Ft.cond(ur).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",ur,";"))}else if(rn(ur)){var jr=Fe[Oe];$t(Ge,".",Pa[Oe],"(",ur,");",ur.map(function(On,Ln){return jr+"["+Ln+"]="+On}).join(";"),";")}else Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ge,".",Pa[Oe],"(",Ae,");",He,".",Oe,"=",Ae,";")):$t(Ge,".",Pa[Oe],"(",ur,");",He,".",Oe,"=",ur,";")}})}function Ys(Ft,$t){jn&&(Ft.instancing=$t.def(Ft.shared.extensions,".angle_instanced_arrays"))}function Uo(Ft,$t,he,Ne,Ie){var Fe=Ft.shared,He=Ft.stats,Ge=Fe.current,Ae=Fe.timer,Oe=he.profile;function Le(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ur,Dr;function jr(la){ur=$t.def(),la(ur,"=",Le(),";"),typeof Ie=="string"?la(He,".count+=",Ie,";"):la(He,".count++;"),fa&&(Ne?(Dr=$t.def(),la(Dr,"=",Ae,".getNumPendingQueries();")):la(Ae,".beginQuery(",He,");"))}function On(la){la(He,".cpuTime+=",Le(),"-",ur,";"),fa&&(Ne?la(Ae,".pushScopeStats(",Dr,",",Ae,".getNumPendingQueries(),",He,");"):la(Ae,".endQuery();"))}function Ln(la){var qn=$t.def(Ge,".profile");$t(Ge,".profile=",la,";"),$t.exit(Ge,".profile=",qn,";")}var xn;if(Oe){if(Ha(Oe)){Oe.enable?(jr($t),On($t.exit),Ln("true")):Ln("false");return}xn=Oe.append(Ft,$t),Ln(xn)}else xn=$t.def(Ge,".profile");var Wn=Ft.block();jr(Wn),$t("if(",xn,"){",Wn,"}");var Dn=Ft.block();On(Dn),$t.exit("if(",xn,"){",Dn,"}")}function tl(Ft,$t,he,Ne,Ie){var Fe=Ft.shared;function He(Ae){switch(Ae){case xa:case mi:case po:return 2;case La:case Yi:case Qo:return 3;case ai:case Go:case Js:return 4;default:return 1}}function Ge(Ae,Oe,Le){var ur=Fe.gl,Dr=$t.def(Ae,".location"),jr=$t.def(Fe.attributes,"[",Dr,"]"),On=Le.state,Ln=Le.buffer,xn=[Le.x,Le.y,Le.z,Le.w],Wn=["buffer","normalized","offset","stride"];function Dn(){$t("if(!",jr,".buffer){",ur,".enableVertexAttribArray(",Dr,");}");var qn=Le.type,Gn;if(Le.size?Gn=$t.def(Le.size,"||",Oe):Gn=Oe,$t("if(",jr,".type!==",qn,"||",jr,".size!==",Gn,"||",Wn.map(function(ti){return jr+"."+ti+"!=="+Le[ti]}).join("||"),"){",ur,".bindBuffer(",ye,",",Ln,".buffer);",ur,".vertexAttribPointer(",[Dr,Gn,qn,Le.normalized,Le.stride,Le.offset],");",jr,".type=",qn,";",jr,".size=",Gn,";",Wn.map(function(ti){return jr+"."+ti+"="+Le[ti]+";"}).join(""),"}"),jn){var ma=Le.divisor;$t("if(",jr,".divisor!==",ma,"){",Ft.instancing,".vertexAttribDivisorANGLE(",[Dr,ma],");",jr,".divisor=",ma,";}")}}function la(){$t("if(",jr,".buffer){",ur,".disableVertexAttribArray(",Dr,");",jr,".buffer=null;","}if(",Ya.map(function(qn,Gn){return jr+"."+qn+"!=="+xn[Gn]}).join("||"),"){",ur,".vertexAttrib4f(",Dr,",",xn,");",Ya.map(function(qn,Gn){return jr+"."+qn+"="+xn[Gn]+";"}).join(""),"}")}On===Ba?Dn():On===za?la():($t("if(",On,"===",Ba,"){"),Dn(),$t("}else{"),la(),$t("}"))}Ne.forEach(function(Ae){var Oe=Ae.name,Le=he.attributes[Oe],ur;if(Le){if(!Ie(Le))return;ur=Le.append(Ft,$t)}else{if(!Ie(xi))return;var Dr=Ft.scopeAttrib(Oe);ur={},Object.keys(new fn).forEach(function(jr){ur[jr]=$t.def(Dr,".",jr)})}Ge(Ft.link(Ae),He(Ae.info.type),ur)})}function Il(Ft,$t,he,Ne,Ie,Fe){for(var He=Ft.shared,Ge=He.gl,Ae,Oe=0;Oe1){for(var Li=[],to=[],ls=0;ls>1)",Ln],");")}function ma(){he(xn,".drawArraysInstancedANGLE(",[Dr,jr,On,Ln],");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}function qn(){function Gn(){he(Fe+".drawElements("+[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)"]+");")}function ma(){he(Fe+".drawArrays("+[Dr,jr,On]+");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}jn&&(typeof Ln!="number"||Ln>=0)?typeof Ln=="string"?(he("if(",Ln,">0){"),la(),he("}else if(",Ln,"<0){"),qn(),he("}")):la():qn()}function lo(Ft,$t,he,Ne,Ie){var Fe=Na(),He=Fe.proc("body",Ie);return jn&&(Fe.instancing=He.def(Fe.shared.extensions,".angle_instanced_arrays")),Ft(Fe,He,he,Ne),Fe.compile().body}function ns(Ft,$t,he,Ne){Ys(Ft,$t),he.useVAO?he.drawVAO?$t(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,$t),");"):$t(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):($t(Ft.shared.vao,".setVAO(null);"),tl(Ft,$t,he,Ne.attributes,function(){return!0})),Il(Ft,$t,he,Ne.uniforms,function(){return!0},!1),vi(Ft,$t,$t,he)}function $o(Ft,$t){var he=Ft.proc("draw",1);Ys(Ft,he),Hs(Ft,he,$t.context),js(Ft,he,$t.framebuffer),Ks(Ft,he,$t),Mi(Ft,he,$t.state),Uo(Ft,he,$t,!1,!0);var Ne=$t.shader.progVar.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Ne,".program);"),$t.shader.program)ns(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Ie=Ft.global.def("{}"),Fe=he.def(Ne,".id"),He=he.def(Ie,"[",Fe,"]");he(Ft.cond(He).then(He,".call(this,a0);").else(He,"=",Ie,"[",Fe,"]=",Ft.link(function(Ge){return lo(ns,Ft,$t,Ge,1)}),"(",Ne,");",He,".call(this,a0);"))}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function U(Ft,$t,he,Ne){Ft.batchId="a1",Ys(Ft,$t);function Ie(){return!0}tl(Ft,$t,he,Ne.attributes,Ie),Il(Ft,$t,he,Ne.uniforms,Ie,!1),vi(Ft,$t,$t,he)}function tt(Ft,$t,he,Ne){Ys(Ft,$t);var Ie=he.contextDep,Fe=$t.def(),He="a0",Ge="a1",Ae=$t.def();Ft.shared.props=Ae,Ft.batchId=Fe;var Oe=Ft.scope(),Le=Ft.scope();$t(Oe.entry,"for(",Fe,"=0;",Fe,"<",Ge,";++",Fe,"){",Ae,"=",He,"[",Fe,"];",Le,"}",Oe.exit);function ur(Wn){return Wn.contextDep&&Ie||Wn.propDep}function Dr(Wn){return!ur(Wn)}if(he.needsContext&&Hs(Ft,Le,he.context),he.needsFramebuffer&&js(Ft,Le,he.framebuffer),Mi(Ft,Le,he.state,ur),he.profile&&ur(he.profile)&&Uo(Ft,Le,he,!1,!0),Ne)he.useVAO?he.drawVAO?ur(he.drawVAO)?Le(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Le),");"):Oe(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Oe),");"):Oe(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):(Oe(Ft.shared.vao,".setVAO(null);"),tl(Ft,Oe,he,Ne.attributes,Dr),tl(Ft,Le,he,Ne.attributes,ur)),Il(Ft,Oe,he,Ne.uniforms,Dr,!1),Il(Ft,Le,he,Ne.uniforms,ur,!0),vi(Ft,Oe,Le,he);else{var jr=Ft.global.def("{}"),On=he.shader.progVar.append(Ft,Le),Ln=Le.def(On,".id"),xn=Le.def(jr,"[",Ln,"]");Le(Ft.shared.gl,".useProgram(",On,".program);","if(!",xn,"){",xn,"=",jr,"[",Ln,"]=",Ft.link(function(Wn){return lo(U,Ft,he,Wn,2)}),"(",On,");}",xn,".call(this,a0[",Fe,"],",Fe,");")}}function Y(Ft,$t){var he=Ft.proc("batch",2);Ft.batchId="0",Ys(Ft,he);var Ne=!1,Ie=!0;Object.keys($t.context).forEach(function(jr){Ne=Ne||$t.context[jr].propDep}),Ne||(Hs(Ft,he,$t.context),Ie=!1);var Fe=$t.framebuffer,He=!1;Fe?(Fe.propDep?Ne=He=!0:Fe.contextDep&&Ne&&(He=!0),He||js(Ft,he,Fe)):js(Ft,he,null),$t.state.viewport&&$t.state.viewport.propDep&&(Ne=!0);function Ge(jr){return jr.contextDep&&Ne||jr.propDep}Ks(Ft,he,$t),Mi(Ft,he,$t.state,function(jr){return!Ge(jr)}),(!$t.profile||!Ge($t.profile))&&Uo(Ft,he,$t,!1,"a1"),$t.contextDep=Ne,$t.needsContext=Ie,$t.needsFramebuffer=He;var Ae=$t.shader.progVar;if(Ae.contextDep&&Ne||Ae.propDep)tt(Ft,he,$t,null);else{var Oe=Ae.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Oe,".program);"),$t.shader.program)tt(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Le=Ft.global.def("{}"),ur=he.def(Oe,".id"),Dr=he.def(Le,"[",ur,"]");he(Ft.cond(Dr).then(Dr,".call(this,a0,a1);").else(Dr,"=",Le,"[",ur,"]=",Ft.link(function(jr){return lo(tt,Ft,$t,jr,2)}),"(",Oe,");",Dr,".call(this,a0,a1);"))}}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function ft(Ft,$t){var he=Ft.proc("scope",3);Ft.batchId="a2";var Ne=Ft.shared,Ie=Ne.current;if(Hs(Ft,he,$t.context),$t.framebuffer&&$t.framebuffer.append(Ft,he),na(Object.keys($t.state)).forEach(function(Ge){var Ae=$t.state[Ge],Oe=Ae.append(Ft,he);rn(Oe)?Oe.forEach(function(Le,ur){Sa(Le)?he.set(Ft.next[Ge],"["+ur+"]",Le):he.set(Ft.next[Ge],"["+ur+"]",Ft.link(Le,{stable:!0}))}):Ha(Ae)?he.set(Ne.next,"."+Ge,Ft.link(Oe,{stable:!0})):he.set(Ne.next,"."+Ge,Oe)}),Uo(Ft,he,$t,!0,!0),[xt,le,Lt,xe,kt].forEach(function(Ge){var Ae=$t.draw[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.draw,"."+Ge,Oe):he.set(Ne.draw,"."+Ge,Ft.link(Oe),{stable:!0})}}),Object.keys($t.uniforms).forEach(function(Ge){var Ae=$t.uniforms[Ge].append(Ft,he);Array.isArray(Ae)&&(Ae="["+Ae.map(function(Oe){return Sa(Oe)?Oe:Ft.link(Oe,{stable:!0})})+"]"),he.set(Ne.uniforms,"["+Ft.link(nr.id(Ge),{stable:!0})+"]",Ae)}),Object.keys($t.attributes).forEach(function(Ge){var Ae=$t.attributes[Ge].append(Ft,he),Oe=Ft.scopeAttrib(Ge);Object.keys(new fn).forEach(function(Le){he.set(Oe,"."+Le,Ae[Le])})}),$t.scopeVAO){var Fe=$t.scopeVAO.append(Ft,he);Sa(Fe)?he.set(Ne.vao,".targetVAO",Fe):he.set(Ne.vao,".targetVAO",Ft.link(Fe,{stable:!0}))}function He(Ge){var Ae=$t.shader[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.shader,"."+Ge,Oe):he.set(Ne.shader,"."+Ge,Ft.link(Oe,{stable:!0}))}}He(L),He(at),Object.keys($t.state).length>0&&(he(Ie,".dirty=true;"),he.exit(Ie,".dirty=true;")),he("a1(",Ft.shared.context,",a0,",Ft.batchId,");")}function zt(Ft){if(!(typeof Ft!="object"||rn(Ft))){for(var $t=Object.keys(Ft),he=0;he<$t.length;++he)if(f.isDynamic(Ft[$t[he]]))return!0;return!1}}function Qt(Ft,$t,he){var Ne=$t.static[he];if(!Ne||!zt(Ne))return;var Ie=Ft.global,Fe=Object.keys(Ne),He=!1,Ge=!1,Ae=!1,Oe=Ft.global.def("{}");Fe.forEach(function(ur){var Dr=Ne[ur];if(f.isDynamic(Dr)){typeof Dr=="function"&&(Dr=Ne[ur]=f.unbox(Dr));var jr=ri(Dr,null);He=He||jr.thisDep,Ae=Ae||jr.propDep,Ge=Ge||jr.contextDep}else{switch(Ie(Oe,".",ur,"="),typeof Dr){case"number":Ie(Dr);break;case"string":Ie('"',Dr,'"');break;case"object":Array.isArray(Dr)&&Ie("[",Dr.join(),"]");break;default:Ie(Ft.link(Dr));break}Ie(";")}});function Le(ur,Dr){Fe.forEach(function(jr){var On=Ne[jr];if(f.isDynamic(On)){var Ln=ur.invoke(Dr,On);Dr(Oe,".",jr,"=",Ln,";")}})}$t.dynamic[he]=new f.DynamicVariable(Wi,{thisDep:He,contextDep:Ge,propDep:Ae,ref:Oe,append:Le}),delete $t.static[he]}function ne(Ft,$t,he,Ne,Ie){var Fe=Na();Fe.stats=Fe.link(Ie),Object.keys($t.static).forEach(function(Ge){Qt(Fe,$t,Ge)}),Te.forEach(function(Ge){Qt(Fe,Ft,Ge)});var He=Cl(Ft,$t,he,Ne,Fe);return He.shader.program&&(He.shader.program.attributes.sort(function(Ge,Ae){return Ge.name=0;--vi){var lo=Sa[vi];lo&&lo(fa,null,0)}cr.flush(),ea&&ea.update()}function gi(){!Na&&Sa.length>0&&(Na=v.next(ui))}function Ri(){Na&&(v.cancel(ui),Na=null)}function ds(vi){vi.preventDefault(),Ri(),_i.forEach(function(lo){lo()})}function rs(vi){cr.getError(),zn.restore(),ya.restore(),Xn.restore(),qa.restore(),Rn.restore(),An.restore(),kn.restore(),ea&&ea.restore(),Pa.procs.refresh(),gi(),pi.forEach(function(lo){lo()})}oa&&(oa.addEventListener(Bo,ds,!1),oa.addEventListener(Ds,rs,!1));function Zi(){Sa.length=0,Ri(),oa&&(oa.removeEventListener(Bo,ds),oa.removeEventListener(Ds,rs)),ya.clear(),An.clear(),Rn.clear(),kn.clear(),qa.clear(),jn.clear(),Xn.clear(),ea&&ea.clear(),Ma.forEach(function(vi){vi()})}function Zs(vi){function lo(Ie){var Fe=u({},Ie);delete Fe.uniforms,delete Fe.attributes,delete Fe.context,delete Fe.vao,"stencil"in Fe&&Fe.stencil.op&&(Fe.stencil.opBack=Fe.stencil.opFront=Fe.stencil.op,delete Fe.stencil.op);function He(Ge){if(Ge in Fe){var Ae=Fe[Ge];delete Fe[Ge],Object.keys(Ae).forEach(function(Oe){Fe[Ge+"."+Oe]=Ae[Oe]})}}return He("blend"),He("depth"),He("cull"),He("stencil"),He("polygonOffset"),He("scissor"),He("sample"),"vao"in Ie&&(Fe.vao=Ie.vao),Fe}function ns(Ie,Fe){var He={},Ge={};return Object.keys(Ie).forEach(function(Ae){var Oe=Ie[Ae];if(f.isDynamic(Oe)){Ge[Ae]=f.unbox(Oe,Ae);return}else if(Fe&&Array.isArray(Oe)){for(var Le=0;Le0)return ne.call(this,he(Ie|0),Ie|0)}else if(Array.isArray(Ie)){if(Ie.length)return ne.call(this,Ie,Ie.length)}else return Qt.call(this,Ie)}return u(Ne,{stats:ft,destroy:function(){zt.destroy()}})}var Zo=An.setFBO=Zs({framebuffer:f.define.call(null,Ts,"framebuffer")});function Qs(vi,lo){var ns=0;Pa.procs.poll();var $o=lo.color;$o&&(cr.clearColor(+$o[0]||0,+$o[1]||0,+$o[2]||0,+$o[3]||0),ns|=pl),"depth"in lo&&(cr.clearDepth(+lo.depth),ns|=Ns),"stencil"in lo&&(cr.clearStencil(lo.stencil|0),ns|=fi),cr.clear(ns)}function El(vi){if("framebuffer"in vi)if(vi.framebuffer&&vi.framebuffer_reglType==="framebufferCube")for(var lo=0;lo<6;++lo)Zo(u({framebuffer:vi.framebuffer.faces[lo]},vi),Qs);else Zo(vi,Qs);else Qs(null,vi)}function Cl(vi){Sa.push(vi);function lo(){var ns=zs(Sa,vi);function $o(){var U=zs(Sa,$o);Sa[U]=Sa[Sa.length-1],Sa.length-=1,Sa.length<=0&&Ri()}Sa[ns]=$o}return gi(),{cancel:lo}}function Hs(){var vi=aa.viewport,lo=aa.scissor_box;vi[0]=vi[1]=lo[0]=lo[1]=0,fa.viewportWidth=fa.framebufferWidth=fa.drawingBufferWidth=vi[2]=lo[2]=cr.drawingBufferWidth,fa.viewportHeight=fa.framebufferHeight=fa.drawingBufferHeight=vi[3]=lo[3]=cr.drawingBufferHeight}function js(){fa.tick+=1,fa.time=Mi(),Hs(),Pa.procs.poll()}function Ks(){qa.refresh(),Hs(),Pa.procs.refresh(),ea&&ea.update()}function Mi(){return(g()-ka)/1e3}Ks();function Ys(vi,lo){var ns;switch(vi){case"frame":return Cl(lo);case"lost":ns=_i;break;case"restore":ns=pi;break;case"destroy":ns=Ma;break}return ns.push(lo),{cancel:function(){for(var $o=0;$o=0},read:ba,destroy:Zi,_gl:cr,_refresh:Ks,poll:function(){js(),ea&&ea.update()},now:Mi,stats:qr,getCachedCode:Uo,preloadCachedCode:tl});return nr.onDone(null,Il),Il}return Eu})}),a9=Vt((K,V)=>{var u=_p();V.exports=function(r){if(r?typeof r=="string"&&(r={container:r}):r={},E(r)?r={container:r}:A(r)?r={container:r}:t(r)?r={gl:r}:r=u(r,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),r.pixelRatio||(r.pixelRatio=window.pixelRatio||1),r.gl)return r.gl;if(r.canvas&&(r.container=r.canvas.parentNode),r.container){if(typeof r.container=="string"){var i=document.querySelector(r.container);if(!i)throw Error("Element "+r.container+" is not found");r.container=i}E(r.container)?(r.canvas=r.container,r.container=r.canvas.parentNode):r.canvas||(r.canvas=e(),r.container.appendChild(r.canvas),d(r))}else if(!r.canvas)if(typeof document<"u")r.container=document.body||document.documentElement,r.canvas=e(),r.container.appendChild(r.canvas),d(r);else throw Error("Not DOM environment. Use headless-gl.");return r.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(n){try{r.gl=r.canvas.getContext(n,r.attrs)}catch{}return r.gl}),r.gl};function d(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var i=r.container.getBoundingClientRect();r.canvas.width=r.width||i.right-i.left,r.canvas.height=r.height||i.bottom-i.top}}function E(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function A(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function t(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function e(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}),i9=Vt((K,V)=>{var u=c5(),d=[32,126];V.exports=E;function E(A){A=A||{};var t=A.shape?A.shape:A.canvas?[A.canvas.width,A.canvas.height]:[512,512],e=A.canvas||document.createElement("canvas"),r=A.font,i=typeof A.step=="number"?[A.step,A.step]:A.step||[32,32],n=A.chars||d;if(r&&typeof r!="string"&&(r=u(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var o=[],a=n[0],s=0;a<=n[1];a++)o[s++]=String.fromCharCode(a);n=o}t=t.slice(),e.width=t[0],e.height=t[1];var f=e.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,e.width,e.height),f.font=r,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";for(var v=i[0]/2,g=i[1]/2,a=0;at[0]-i[0]/2&&(v=i[0]/2,g+=i[1]);return e}}),f5=Vt(K=>{"use restrict";var V=32;K.INT_BITS=V,K.INT_MAX=2147483647,K.INT_MIN=-1<0)-(E<0)},K.abs=function(E){var A=E>>V-1;return(E^A)-A},K.min=function(E,A){return A^(E^A)&-(E65535)<<4,E>>>=A,t=(E>255)<<3,E>>>=t,A|=t,t=(E>15)<<2,E>>>=t,A|=t,t=(E>3)<<1,E>>>=t,A|=t,A|E>>1},K.log10=function(E){return E>=1e9?9:E>=1e8?8:E>=1e7?7:E>=1e6?6:E>=1e5?5:E>=1e4?4:E>=1e3?3:E>=100?2:E>=10?1:0},K.popCount=function(E){return E=E-(E>>>1&1431655765),E=(E&858993459)+(E>>>2&858993459),(E+(E>>>4)&252645135)*16843009>>>24};function u(E){var A=32;return E&=-E,E&&A--,E&65535&&(A-=16),E&16711935&&(A-=8),E&252645135&&(A-=4),E&858993459&&(A-=2),E&1431655765&&(A-=1),A}K.countTrailingZeros=u,K.nextPow2=function(E){return E+=E===0,--E,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E+1},K.prevPow2=function(E){return E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E-(E>>>1)},K.parity=function(E){return E^=E>>>16,E^=E>>>8,E^=E>>>4,E&=15,27030>>>E&1};var d=new Array(256);(function(E){for(var A=0;A<256;++A){var t=A,e=A,r=7;for(t>>>=1;t;t>>>=1)e<<=1,e|=t&1,--r;E[A]=e<>>8&255]<<16|d[E>>>16&255]<<8|d[E>>>24&255]},K.interleave2=function(E,A){return E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E|A<<1},K.deinterleave2=function(E,A){return E=E>>>A&1431655765,E=(E|E>>>1)&858993459,E=(E|E>>>2)&252645135,E=(E|E>>>4)&16711935,E=(E|E>>>16)&65535,E<<16>>16},K.interleave3=function(E,A,t){return E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E|=A<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,E|t<<2},K.deinterleave3=function(E,A){return E=E>>>A&1227133513,E=(E|E>>>2)&3272356035,E=(E|E>>>4)&251719695,E=(E|E>>>8)&4278190335,E=(E|E>>>16)&1023,E<<22>>22},K.nextCombination=function(E){var A=E|E-1;return A+1|(~A&-~A)-1>>>u(E)+1}}),o9=Vt((K,V)=>{function u(A,t,e){var r=A[e]|0;if(r<=0)return[];var i=new Array(r),n;if(e===A.length-1)for(n=0;n"u"&&(t=0),typeof A){case"number":if(A>0)return d(A|0,t);break;case"object":if(typeof A.length=="number")return u(A,t,0);break}return[]}V.exports=E}),s9=Vt(K=>{var V=f5(),u=o9(),d=m0().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:u([32,0]),UINT16:u([32,0]),UINT32:u([32,0]),BIGUINT64:u([32,0]),INT8:u([32,0]),INT16:u([32,0]),INT32:u([32,0]),BIGINT64:u([32,0]),FLOAT:u([32,0]),DOUBLE:u([32,0]),DATA:u([32,0]),UINT8C:u([32,0]),BUFFER:u([32,0])});var E=typeof Uint8ClampedArray<"u",A=typeof BigUint64Array<"u",t=typeof BigInt64Array<"u",e=window.__TYPEDARRAY_POOL;e.UINT8C||(e.UINT8C=u([32,0])),e.BIGUINT64||(e.BIGUINT64=u([32,0])),e.BIGINT64||(e.BIGINT64=u([32,0])),e.BUFFER||(e.BUFFER=u([32,0]));var r=e.DATA,i=e.BUFFER;K.free=function(c){if(d.isBuffer(c))i[V.log2(c.length)].push(c);else{if(Object.prototype.toString.call(c)!=="[object ArrayBuffer]"&&(c=c.buffer),!c)return;var h=c.length||c.byteLength,b=V.log2(h)|0;r[b].push(c)}};function n(c){if(c){var h=c.length||c.byteLength,b=V.log2(h);r[b].push(c)}}function o(c){n(c.buffer)}K.freeUint8=K.freeUint16=K.freeUint32=K.freeBigUint64=K.freeInt8=K.freeInt16=K.freeInt32=K.freeBigInt64=K.freeFloat32=K.freeFloat=K.freeFloat64=K.freeDouble=K.freeUint8Clamped=K.freeDataView=o,K.freeArrayBuffer=n,K.freeBuffer=function(c){i[V.log2(c.length)].push(c)},K.malloc=function(c,h){if(h===void 0||h==="arraybuffer")return a(c);switch(h){case"uint8":return s(c);case"uint16":return f(c);case"uint32":return v(c);case"int8":return g(c);case"int16":return m(c);case"int32":return w(c);case"float":case"float32":return l(c);case"double":case"float64":return x(c);case"uint8_clamped":return y(c);case"bigint64":return k(c);case"biguint64":return S(c);case"buffer":return T(c);case"data":case"dataview":return M(c);default:return null}return null};function a(h){var h=V.nextPow2(h),b=V.log2(h),_=r[b];return _.length>0?_.pop():new ArrayBuffer(h)}K.mallocArrayBuffer=a;function s(c){return new Uint8Array(a(c),0,c)}K.mallocUint8=s;function f(c){return new Uint16Array(a(2*c),0,c)}K.mallocUint16=f;function v(c){return new Uint32Array(a(4*c),0,c)}K.mallocUint32=v;function g(c){return new Int8Array(a(c),0,c)}K.mallocInt8=g;function m(c){return new Int16Array(a(2*c),0,c)}K.mallocInt16=m;function w(c){return new Int32Array(a(4*c),0,c)}K.mallocInt32=w;function l(c){return new Float32Array(a(4*c),0,c)}K.mallocFloat32=K.mallocFloat=l;function x(c){return new Float64Array(a(8*c),0,c)}K.mallocFloat64=K.mallocDouble=x;function y(c){return E?new Uint8ClampedArray(a(c),0,c):s(c)}K.mallocUint8Clamped=y;function S(c){return A?new BigUint64Array(a(8*c),0,c):null}K.mallocBigUint64=S;function k(c){return t?new BigInt64Array(a(8*c),0,c):null}K.mallocBigInt64=k;function M(c){return new DataView(a(c),0,c)}K.mallocDataView=M;function T(c){c=V.nextPow2(c);var h=V.log2(c),b=i[h];return b.length>0?b.pop():new d(c)}K.mallocBuffer=T,K.clearCache=function(){for(var c=0;c<32;++c)e.UINT8[c].length=0,e.UINT16[c].length=0,e.UINT32[c].length=0,e.INT8[c].length=0,e.INT16[c].length=0,e.INT32[c].length=0,e.FLOAT[c].length=0,e.DOUBLE[c].length=0,e.BIGUINT64[c].length=0,e.BIGINT64[c].length=0,e.UINT8C[c].length=0,r[c].length=0,i[c].length=0}}),l9=Vt((K,V)=>{var u=Object.prototype.toString;V.exports=function(d){var E;return u.call(d)==="[object Object]"&&(E=Object.getPrototypeOf(d),E===null||E===Object.getPrototypeOf({}))}}),h5=Vt((K,V)=>{V.exports=function(u,d){d||(d=[0,""]),u=String(u);var E=parseFloat(u,10);return d[0]=E,d[1]=u.match(/[\d.\-\+]*\s*(.*)/)[1]||"",d}}),u9=Vt((K,V)=>{var u=h5();V.exports=t;var d=96;function E(e,r){var i=u(getComputedStyle(e).getPropertyValue(r));return i[0]*t(i[1],e)}function A(e,r){var i=document.createElement("div");i.style["font-size"]="128"+e,r.appendChild(i);var n=E(i,"font-size")/128;return r.removeChild(i),n}function t(e,r){switch(r=r||document.body,e=(e||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),e){case"%":return r.clientHeight/100;case"ch":case"ex":return A(e,r);case"em":return E(r,"font-size");case"rem":return E(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return d;case"cm":return d/2.54;case"mm":return d/25.4;case"pt":return d/72;case"pc":return d/6}return 1}}),c9=Vt((K,V)=>{V.exports=A;var u=A.canvas=document.createElement("canvas"),d=u.getContext("2d"),E=t([32,126]);A.createPairs=t,A.ascii=E;function A(e,r){Array.isArray(e)&&(e=e.join(", "));var i={},n,o=16,a=.05;r&&(r.length===2&&typeof r[0]=="number"?n=t(r):Array.isArray(r)?n=r:(r.o?n=t(r.o):r.pairs&&(n=r.pairs),r.fontSize&&(o=r.fontSize),r.threshold!=null&&(a=r.threshold))),n||(n=E),d.font=o+"px "+e;for(var s=0;so*a){var m=(g-v)/o;i[f]=m*1e3}}return i}function t(e){for(var r=[],i=e[0];i<=e[1];i++)for(var n=String.fromCharCode(i),o=e[0];o{V.exports=u,u.canvas=document.createElement("canvas"),u.cache={};function u(a,e){e||(e={}),(typeof a=="string"||Array.isArray(a))&&(e.family=a);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var i=e.size||e.fontSize||e.em||48,n=e.weight||e.fontWeight||"",o=e.style||e.fontStyle||"",a=[o,n,i].join(" ")+"px "+r,s=e.origin||"top";if(u.cache[r]&&i<=u.cache[r].em)return d(u.cache[r],s);var f=e.canvas||u.canvas,v=f.getContext("2d"),g={upper:e.upper!==void 0?e.upper:"H",lower:e.lower!==void 0?e.lower:"x",descent:e.descent!==void 0?e.descent:"p",ascent:e.ascent!==void 0?e.ascent:"h",tittle:e.tittle!==void 0?e.tittle:"i",overshoot:e.overshoot!==void 0?e.overshoot:"O"},m=Math.ceil(i*1.5);f.height=m,f.width=m*.5,v.font=a;var w="H",l={top:0};v.clearRect(0,0,m,m),v.textBaseline="top",v.fillStyle="black",v.fillText(w,0,0);var x=E(v.getImageData(0,0,m,m));v.clearRect(0,0,m,m),v.textBaseline="bottom",v.fillText(w,0,m);var y=E(v.getImageData(0,0,m,m));l.lineHeight=l.bottom=m-y+x,v.clearRect(0,0,m,m),v.textBaseline="alphabetic",v.fillText(w,0,m);var S=E(v.getImageData(0,0,m,m)),k=m-S-1+x;l.baseline=l.alphabetic=k,v.clearRect(0,0,m,m),v.textBaseline="middle",v.fillText(w,0,m*.5);var M=E(v.getImageData(0,0,m,m));l.median=l.middle=m-M-1+x-m*.5,v.clearRect(0,0,m,m),v.textBaseline="hanging",v.fillText(w,0,m*.5);var T=E(v.getImageData(0,0,m,m));l.hanging=m-T-1+x-m*.5,v.clearRect(0,0,m,m),v.textBaseline="ideographic",v.fillText(w,0,m);var c=E(v.getImageData(0,0,m,m));if(l.ideographic=m-c-1+x,g.upper&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.upper,0,0),l.upper=E(v.getImageData(0,0,m,m)),l.capHeight=l.baseline-l.upper),g.lower&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.lower,0,0),l.lower=E(v.getImageData(0,0,m,m)),l.xHeight=l.baseline-l.lower),g.tittle&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.tittle,0,0),l.tittle=E(v.getImageData(0,0,m,m))),g.ascent&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.ascent,0,0),l.ascent=E(v.getImageData(0,0,m,m))),g.descent&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.descent,0,0),l.descent=A(v.getImageData(0,0,m,m))),g.overshoot){v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.overshoot,0,0);var h=A(v.getImageData(0,0,m,m));l.overshoot=h-k}for(var b in l)l[b]/=i;return l.em=i,u.cache[r]=l,d(l,s)}function d(t,e){var r={};typeof e=="string"&&(e=t[e]);for(var i in t)i!=="em"&&(r[i]=t[i]-e);return r}function E(t){for(var e=t.height,r=t.data,i=3;i0;i-=4)if(r[i]!==0)return Math.floor((i-3)*.25/e)}}),h9=Vt((K,V)=>{var u=r9(),d=_p(),E=n9(),A=a9(),t=r5(),e=Rd(),r=i9(),i=s9(),n=Km(),o=l9(),a=h5(),s=u9(),f=c9(),v=of(),g=f9(),m=L0(),w=f5(),l=w.nextPow2,x=new t,y=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(y=!0),document.body.removeChild(S));var S,k=function(T){M(T)?(T={regl:T},this.gl=T.regl._gl):this.gl=A(T),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=T.regl||E({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(o(T)?T:{})};k.prototype.createShader=function(){var T=this.regl,c=T({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:T.prop("count"),offset:T.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:T.this("sizeBuffer")},width:{offset:0,stride:8,buffer:T.this("sizeBuffer")},char:T.this("charBuffer"),position:T.this("position")},uniforms:{atlasSize:function(b,_){return[_.atlas.width,_.atlas.height]},atlasDim:function(b,_){return[_.atlas.cols,_.atlas.rows]},atlas:function(b,_){return _.atlas.texture},charStep:function(b,_){return _.atlas.step},em:function(b,_){return _.atlas.em},color:T.prop("color"),opacity:T.prop("opacity"),viewport:T.this("viewportArray"),scale:T.this("scale"),align:T.prop("align"),baseline:T.prop("baseline"),translate:T.this("translate"),positionOffset:T.prop("positionOffset")},primitive:"points",viewport:T.this("viewport"),vert:` - precision highp float; - attribute float width, charOffset, char; - attribute vec2 position; - uniform float fontSize, charStep, em, align, baseline; - uniform vec4 viewport; - uniform vec4 color; - uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; - varying vec2 charCoord, charId; - varying float charWidth; - varying vec4 fontColor; - void main () { - vec2 offset = floor(em * (vec2(align + charOffset, baseline) - + vec2(positionOffset.x, -positionOffset.y))) - / (viewport.zw * scale.xy); - - vec2 position = (position + translate) * scale; - position += offset * scale; - - charCoord = position * viewport.zw + viewport.xy; - - gl_Position = vec4(position * 2. - 1., 0, 1); - - gl_PointSize = charStep; - - charId.x = mod(char, atlasDim.x); - charId.y = floor(char / atlasDim.x); - - charWidth = width * em; - - fontColor = color / 255.; - }`,frag:` - precision highp float; - uniform float fontSize, charStep, opacity; - uniform vec2 atlasSize; - uniform vec4 viewport; - uniform sampler2D atlas; - varying vec4 fontColor; - varying vec2 charCoord, charId; - varying float charWidth; - - float lightness(vec4 color) { - return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; - } - - void main () { - vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; - float halfCharStep = floor(charStep * .5 + .5); - - // invert y and shift by 1px (FF expecially needs that) - uv.y = charStep - uv.y; - - // ignore points outside of character bounding box - float halfCharWidth = ceil(charWidth * .5); - if (floor(uv.x) > halfCharStep + halfCharWidth || - floor(uv.x) < halfCharStep - halfCharWidth) return; - - uv += charId * charStep; - uv = uv / atlasSize; - - vec4 color = fontColor; - vec4 mask = texture2D(atlas, uv); - - float maskY = lightness(mask); - // float colorY = lightness(color); - color.a *= maskY; - color.a *= opacity; - - // color.a += .1; - - // antialiasing, see yiq color space y-channel formula - // color.rgb += (1. - color.rgb) * (1. - mask.rgb); - - gl_FragColor = color; - }`}),h={};return{regl:T,draw:c,atlas:h}},k.prototype.update=function(T){var c=this;if(typeof T=="string")T={text:T};else if(!T)return;T=d(T,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),T.opacity!=null&&(Array.isArray(T.opacity)?this.opacity=T.opacity.map(function(bt){return parseFloat(bt)}):this.opacity=parseFloat(T.opacity)),T.viewport!=null&&(this.viewport=n(T.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),T.kerning!=null&&(this.kerning=T.kerning),T.offset!=null&&(typeof T.offset=="number"&&(T.offset=[T.offset,0]),this.positionOffset=m(T.offset)),T.direction&&(this.direction=T.direction),T.range&&(this.range=T.range,this.scale=[1/(T.range[2]-T.range[0]),1/(T.range[3]-T.range[1])],this.translate=[-T.range[0],-T.range[1]]),T.scale&&(this.scale=T.scale),T.translate&&(this.translate=T.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!T.font&&(T.font=k.baseFontSize+"px sans-serif");var h=!1,b=!1;if(T.font&&(Array.isArray(T.font)?T.font:[T.font]).forEach(function(bt,vt){if(typeof bt=="string")try{bt=u.parse(bt)}catch{bt=u.parse(k.baseFontSize+"px "+bt)}else{var Ut=bt.style,re=bt.weight,Kt=bt.stretch,ue=bt.variant;bt=u.parse(u.stringify(bt)),Ut&&(bt.style=Ut),re&&(bt.weight=re),Kt&&(bt.stretch=Kt),ue&&(bt.variant=ue)}var Me=u.stringify({size:k.baseFontSize,family:bt.family,stretch:y?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style}),Ce=a(bt.size),We=Math.round(Ce[0]*s(Ce[1]));if(We!==c.fontSize[vt]&&(b=!0,c.fontSize[vt]=We),(!c.font[vt]||Me!=c.font[vt].baseString)&&(h=!0,c.font[vt]=k.fonts[Me],!c.font[vt])){var qe=bt.family.join(", "),vr=[bt.style];bt.style!=bt.variant&&vr.push(bt.variant),bt.variant!=bt.weight&&vr.push(bt.weight),y&&bt.weight!=bt.stretch&&vr.push(bt.stretch),c.font[vt]={baseString:Me,family:qe,weight:bt.weight,stretch:bt.stretch,style:bt.style,variant:bt.variant,width:{},kerning:{},metrics:g(qe,{origin:"top",fontSize:k.baseFontSize,fontStyle:vr.join(" ")})},k.fonts[Me]=c.font[vt]}}),(h||b)&&this.font.forEach(function(bt,vt){var Ut=u.stringify({size:c.fontSize[vt],family:bt.family,stretch:y?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style});if(c.fontAtlas[vt]=c.shader.atlas[Ut],!c.fontAtlas[vt]){var re=bt.metrics;c.shader.atlas[Ut]=c.fontAtlas[vt]={fontString:Ut,step:Math.ceil(c.fontSize[vt]*re.bottom*.5)*2,em:c.fontSize[vt],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:c.regl.texture()}}T.text==null&&(T.text=c.text)}),typeof T.text=="string"&&T.position&&T.position.length>2){for(var _=Array(T.position.length*.5),P=0;P<_.length;P++)_[P]=T.text;T.text=_}var z;if(T.text!=null||h){if(this.textOffsets=[0],Array.isArray(T.text)){this.count=T.text[0].length,this.counts=[this.count];for(var D=1;D2){for(var B=!T.position[0].length,R=i.mallocFloat(this.count*2),I=0,F=0;I1?c.align[vt]:c.align[0]:c.align;if(typeof Ut=="number")return Ut;switch(Ut){case"right":case"end":return-bt;case"center":case"centre":case"middle":return-bt*.5}return 0})),this.baseline==null&&T.baseline==null&&(T.baseline=0),T.baseline!=null&&(this.baseline=T.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(bt,vt){var Ut=(c.font[vt]||c.font[0]).metrics,re=0;return re+=Ut.bottom*.5,typeof bt=="number"?re+=bt-Ut.baseline:re+=-Ut[bt],re*=-1,re})),T.color!=null)if(T.color||(T.color="transparent"),typeof T.color=="string"||!isNaN(T.color))this.color=e(T.color,"uint8");else{var wt;if(typeof T.color[0]=="number"&&T.color.length>this.counts.length){var Ct=T.color.length;wt=i.mallocUint8(Ct);for(var It=(T.color.subarray||T.color.slice).bind(T.color),Nt=0;Nt4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ee){var Zt=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Zt);for(var mt=0;mt1?this.counts[mt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[mt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(mt*4,mt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[mt]:this.opacity,baseline:this.baselineOffset[mt]!=null?this.baselineOffset[mt]:this.baselineOffset[0],align:this.align?this.alignOffset[mt]!=null?this.alignOffset[mt]:this.alignOffset[0]:0,atlas:this.fontAtlas[mt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(mt*2,mt*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={};function M(T){return typeof T=="function"&&T._gl&&T.prop&&T.texture&&T.buffer}V.exports=k}),p9=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?V.exports=d():u.createREGL=d()})(K,function(){var u=function(ie,nr){for(var cr=Object.keys(nr),sn=0;sn1&&nr===cr&&(nr==='"'||nr==="'"))return['"'+r(ie.substr(1,ie.length-2))+'"'];var sn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(ie);if(sn)return i(ie.substr(0,sn.index)).concat(i(sn[1])).concat(i(ie.substr(sn.index+sn[0].length)));var zn=ie.split(".");if(zn.length===1)return['"'+r(ie)+'"'];for(var Tn=[],qr=0;qr"u"?1:window.devicePixelRatio,ka=!1,Ka={},Va=function(Nr){},fa=function(){};if(typeof nr=="string"?cr=document.querySelector(nr):typeof nr=="object"&&(x(nr)?cr=nr:y(nr)?(Tn=nr,zn=Tn.canvas):("gl"in nr?Tn=nr.gl:"canvas"in nr?zn=k(nr.canvas):"container"in nr&&(sn=k(nr.container)),"attributes"in nr&&(qr=nr.attributes),"extensions"in nr&&(Sn=S(nr.extensions)),"optionalExtensions"in nr&&(sa=S(nr.optionalExtensions)),"onDone"in nr&&(Va=nr.onDone),"profile"in nr&&(ka=!!nr.profile),"pixelRatio"in nr&&(ea=+nr.pixelRatio),"cachedCode"in nr&&(Ka=nr.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?zn=cr:sn=cr),!Tn){if(!zn){var Un=w(sn||document.body,Va,ea);if(!Un)return null;zn=Un.canvas,fa=Un.onDestroy}qr.premultipliedAlpha===void 0&&(qr.premultipliedAlpha=!0),Tn=l(zn,qr)}return Tn?{gl:Tn,canvas:zn,container:sn,extensions:Sn,optionalExtensions:sa,pixelRatio:ea,profile:ka,cachedCode:Ka,onDone:Va,onDestroy:fa}:(fa(),Va("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function T(ie,nr){var cr={};function sn(qr){var Sn=qr.toLowerCase(),sa;try{sa=cr[Sn]=ie.getExtension(Sn)}catch{}return!!sa}for(var zn=0;zn65535)<<4,ie>>>=nr,cr=(ie>255)<<3,ie>>>=cr,nr|=cr,cr=(ie>15)<<2,ie>>>=cr,nr|=cr,cr=(ie>3)<<1,ie>>>=cr,nr|=cr,nr|ie>>1}function F(){var ie=c(8,function(){return[]});function nr(Tn){var qr=R(Tn),Sn=ie[I(qr)>>2];return Sn.length>0?Sn.pop():new ArrayBuffer(qr)}function cr(Tn){ie[I(Tn.byteLength)>>2].push(Tn)}function sn(Tn,qr){var Sn=null;switch(Tn){case h:Sn=new Int8Array(nr(qr),0,qr);break;case b:Sn=new Uint8Array(nr(qr),0,qr);break;case _:Sn=new Int16Array(nr(2*qr),0,qr);break;case P:Sn=new Uint16Array(nr(2*qr),0,qr);break;case z:Sn=new Int32Array(nr(4*qr),0,qr);break;case D:Sn=new Uint32Array(nr(4*qr),0,qr);break;case B:Sn=new Float32Array(nr(4*qr),0,qr);break;default:return null}return Sn.length!==qr?Sn.subarray(0,qr):Sn}function zn(Tn){cr(Tn.buffer)}return{alloc:nr,free:cr,allocType:sn,freeType:zn}}var j=F();j.zero=F();var N=3408,G=3410,rt=3411,ct=3412,st=3413,et=3414,Z=3415,ot=33901,X=33902,Q=3379,ut=3386,J=34921,q=36347,it=36348,nt=35661,dt=35660,Tt=34930,wt=36349,Ct=34076,It=34024,Nt=7936,te=7937,Jt=7938,ee=35724,Zt=34047,mt=36063,bt=34852,vt=3553,Ut=34067,re=34069,Kt=33984,ue=6408,Me=5126,Ce=5121,We=36160,qe=36053,vr=36064,_r=16384,er=function(ie,nr){var cr=1;nr.ext_texture_filter_anisotropic&&(cr=ie.getParameter(Zt));var sn=1,zn=1;nr.webgl_draw_buffers&&(sn=ie.getParameter(bt),zn=ie.getParameter(mt));var Tn=!!nr.oes_texture_float;if(Tn){var qr=ie.createTexture();ie.bindTexture(vt,qr),ie.texImage2D(vt,0,ue,1,1,0,ue,Me,null);var Sn=ie.createFramebuffer();if(ie.bindFramebuffer(We,Sn),ie.framebufferTexture2D(We,vr,vt,qr,0),ie.bindTexture(vt,null),ie.checkFramebufferStatus(We)!==qe)Tn=!1;else{ie.viewport(0,0,1,1),ie.clearColor(1,0,0,1),ie.clear(_r);var sa=j.allocType(Me,4);ie.readPixels(0,0,1,1,ue,Me,sa),ie.getError()?Tn=!1:(ie.deleteFramebuffer(Sn),ie.deleteTexture(qr),Tn=sa[0]===1),j.freeType(sa)}}var ea=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ka=!0;if(!ea){var Ka=ie.createTexture(),Va=j.allocType(Ce,36);ie.activeTexture(Kt),ie.bindTexture(Ut,Ka),ie.texImage2D(re,0,ue,3,3,0,ue,Ce,Va),j.freeType(Va),ie.bindTexture(Ut,null),ie.deleteTexture(Ka),ka=!ie.getError()}return{colorBits:[ie.getParameter(G),ie.getParameter(rt),ie.getParameter(ct),ie.getParameter(st)],depthBits:ie.getParameter(et),stencilBits:ie.getParameter(Z),subpixelBits:ie.getParameter(N),extensions:Object.keys(nr).filter(function(fa){return!!nr[fa]}),maxAnisotropic:cr,maxDrawbuffers:sn,maxColorAttachments:zn,pointSizeDims:ie.getParameter(ot),lineWidthDims:ie.getParameter(X),maxViewportDims:ie.getParameter(ut),maxCombinedTextureUnits:ie.getParameter(nt),maxCubeMapSize:ie.getParameter(Ct),maxRenderbufferSize:ie.getParameter(It),maxTextureUnits:ie.getParameter(Tt),maxTextureSize:ie.getParameter(Q),maxAttributes:ie.getParameter(J),maxVertexUniforms:ie.getParameter(q),maxVertexTextureUnits:ie.getParameter(dt),maxVaryingVectors:ie.getParameter(it),maxFragmentUniforms:ie.getParameter(wt),glsl:ie.getParameter(ee),renderer:ie.getParameter(te),vendor:ie.getParameter(Nt),version:ie.getParameter(Jt),readFloat:Tn,npotTextureCube:ka}},Mr=function(ie){return ie instanceof Uint8Array||ie instanceof Uint16Array||ie instanceof Uint32Array||ie instanceof Int8Array||ie instanceof Int16Array||ie instanceof Int32Array||ie instanceof Float32Array||ie instanceof Float64Array||ie instanceof Uint8ClampedArray};function Ir(ie){return!!ie&&typeof ie=="object"&&Array.isArray(ie.shape)&&Array.isArray(ie.stride)&&typeof ie.offset=="number"&&ie.shape.length===ie.stride.length&&(Array.isArray(ie.data)||Mr(ie.data))}var de=function(ie){return Object.keys(ie).map(function(nr){return ie[nr]})},Dt={shape:Ht,flatten:St};function qt(ie,nr,cr){for(var sn=0;sn0){var qa;if(Array.isArray(fn[0])){ya=gn(fn);for(var Rn=1,An=1;An0){if(typeof Rn[0]=="number"){var aa=j.allocType(kn.dtype,Rn.length);zr(aa,Rn),ya(aa,Pa),j.freeType(aa)}else if(Array.isArray(Rn[0])||Mr(Rn[0])){ba=gn(Rn);var oa=En(Rn,ba,kn.dtype);ya(oa,Pa),j.freeType(oa)}}}else if(Ir(Rn)){ba=Rn.shape;var Sa=Rn.stride,_i=0,pi=0,Ma=0,Na=0;ba.length===1?(_i=ba[0],pi=1,Ma=Sa[0],Na=0):ba.length===2&&(_i=ba[0],pi=ba[1],Ma=Sa[0],Na=Sa[1]);var ui=Array.isArray(Rn.data)?kn.dtype:tr(Rn.data),gi=j.allocType(ui,_i*pi);tn(gi,Rn.data,_i,pi,Ma,Na,Rn.offset),ya(gi,Pa),j.freeType(gi)}return Ia}return Xn||Ia(Nr),Ia._reglType="buffer",Ia._buffer=kn,Ia.subdata=qa,cr.profile&&(Ia.stats=kn.stats),Ia.destroy=function(){Va(kn)},Ia}function Un(){de(Tn).forEach(function(Nr){Nr.buffer=ie.createBuffer(),ie.bindBuffer(Nr.type,Nr.buffer),ie.bufferData(Nr.type,Nr.persistentData||Nr.byteLength,Nr.usage)})}return cr.profile&&(nr.getTotalBufferSize=function(){var Nr=0;return Object.keys(Tn).forEach(function(fn){Nr+=Tn[fn].stats.size}),Nr}),{create:fa,createStream:sa,destroyStream:ea,clear:function(){de(Tn).forEach(Va),Sn.forEach(Va)},getBuffer:function(Nr){return Nr&&Nr._buffer instanceof qr?Nr._buffer:null},restore:Un,_initBuffer:Ka}}var $r=0,In=0,Nn=1,Kn=1,$n=4,ia=4,Cn={points:$r,point:In,lines:Nn,line:Kn,triangles:$n,triangle:ia,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Fa=0,Ga=1,ve=4,ge=5120,dr=5121,br=5122,Tr=5123,mr=5124,kr=5125,Ur=34963,Or=35040,pe=35044;function Ke(ie,nr,cr,sn){var zn={},Tn=0,qr={uint8:dr,uint16:Tr};nr.oes_element_index_uint&&(qr.uint32=kr);function Sn(Un){this.id=Tn++,zn[this.id]=this,this.buffer=Un,this.primType=ve,this.vertCount=0,this.type=0}Sn.prototype.bind=function(){this.buffer.bind()};var sa=[];function ea(Un){var Nr=sa.pop();return Nr||(Nr=new Sn(cr.create(null,Ur,!0,!1)._buffer)),Ka(Nr,Un,Or,-1,-1,0,0),Nr}function ka(Un){sa.push(Un)}function Ka(Un,Nr,fn,Xn,jn,kn,Ia){Un.buffer.bind();var ya;if(Nr){var qa=Ia;!Ia&&(!Mr(Nr)||Ir(Nr)&&!Mr(Nr.data))&&(qa=nr.oes_element_index_uint?kr:Tr),cr._initBuffer(Un.buffer,Nr,fn,qa,3)}else ie.bufferData(Ur,kn,fn),Un.buffer.dtype=ya||dr,Un.buffer.usage=fn,Un.buffer.dimension=3,Un.buffer.byteLength=kn;if(ya=Ia,!Ia){switch(Un.buffer.dtype){case dr:case ge:ya=dr;break;case Tr:case br:ya=Tr;break;case kr:case mr:ya=kr;break}Un.buffer.dtype=ya}Un.type=ya;var Rn=jn;Rn<0&&(Rn=Un.buffer.byteLength,ya===Tr?Rn>>=1:ya===kr&&(Rn>>=2)),Un.vertCount=Rn;var An=Xn;if(Xn<0){An=ve;var Pa=Un.buffer.dimension;Pa===1&&(An=Fa),Pa===2&&(An=Ga),Pa===3&&(An=ve)}Un.primType=An}function Va(Un){sn.elementsCount--,delete zn[Un.id],Un.buffer.destroy(),Un.buffer=null}function fa(Un,Nr){var fn=cr.create(null,Ur,!0),Xn=new Sn(fn._buffer);sn.elementsCount++;function jn(kn){if(!kn)fn(),Xn.primType=ve,Xn.vertCount=0,Xn.type=dr;else if(typeof kn=="number")fn(kn),Xn.primType=ve,Xn.vertCount=kn|0,Xn.type=dr;else{var Ia=null,ya=pe,qa=-1,Rn=-1,An=0,Pa=0;Array.isArray(kn)||Mr(kn)||Ir(kn)?Ia=kn:("data"in kn&&(Ia=kn.data),"usage"in kn&&(ya=Zn[kn.usage]),"primitive"in kn&&(qa=Cn[kn.primitive]),"count"in kn&&(Rn=kn.count|0),"type"in kn&&(Pa=qr[kn.type]),"length"in kn?An=kn.length|0:(An=Rn,Pa===Tr||Pa===br?An*=2:(Pa===kr||Pa===mr)&&(An*=4))),Ka(Xn,Ia,ya,qa,Rn,An,Pa)}return jn}return jn(Un),jn._reglType="elements",jn._elements=Xn,jn.subdata=function(kn,Ia){return fn.subdata(kn,Ia),jn},jn.destroy=function(){Va(Xn)},jn}return{create:fa,createStream:ea,destroyStream:ka,getElements:function(Un){return typeof Un=="function"&&Un._elements instanceof Sn?Un._elements:null},clear:function(){de(zn).forEach(Va)}}}var xr=new Float32Array(1),Gr=new Uint32Array(xr.buffer),ln=5123;function wn(ie){for(var nr=j.allocType(ln,ie.length),cr=0;cr>>31<<15,Tn=(sn<<1>>>24)-127,qr=sn>>13&1023;if(Tn<-24)nr[cr]=zn;else if(Tn<-14){var Sn=-14-Tn;nr[cr]=zn+(qr+1024>>Sn)}else Tn>15?nr[cr]=zn+31744:nr[cr]=zn+(Tn+15<<10)+qr}return nr}function rn(ie){return Array.isArray(ie)||Mr(ie)}var Qr=34467,vn=3553,Oa=34067,Qn=34069,Qa=6408,Ja=6406,wi=6407,ci=6409,Ti=6410,Ra=32854,Qi=32855,Hi=36194,Ho=32819,Ci=32820,zo=33635,qi=34042,qo=6402,Po=34041,hs=35904,Gi=35906,uo=36193,yi=33776,ao=33777,ts=33778,vs=33779,As=35986,_o=35987,Da=34798,li=35840,wo=35841,Ms=35842,Di=35843,_s=36196,No=5121,is=5123,al=5125,ii=5126,io=10242,co=10243,Is=10497,Wo=33071,Bi=33648,$s=10240,fl=10241,Jo=9728,us=9729,Ss=9984,Ls=9985,xl=9986,bu=9987,au=33170,fu=4352,Ec=4353,xc=4354,cs=34046,Gl=3317,zc=37440,Al=37441,_l=37443,Ml=37444,hu=33984,Fs=[Ss,xl,Ls,bu],bl=[0,ci,Ti,wi,Qa],Fo={};Fo[ci]=Fo[Ja]=Fo[qo]=1,Fo[Po]=Fo[Ti]=2,Fo[wi]=Fo[hs]=3,Fo[Qa]=Fo[Gi]=4;function bs(ie){return"[object "+ie+"]"}var Iu=bs("HTMLCanvasElement"),Nl=bs("OffscreenCanvas"),Hu=bs("CanvasRenderingContext2D"),qs=bs("ImageBitmap"),sf=bs("HTMLImageElement"),Oo=bs("HTMLVideoElement"),yf=Object.keys(Yt).concat([Iu,Nl,Hu,qs,sf,Oo]),os=[];os[No]=1,os[ii]=4,os[uo]=2,os[is]=2,os[al]=4;var Fi=[];Fi[Ra]=2,Fi[Qi]=2,Fi[Hi]=2,Fi[Po]=4,Fi[yi]=.5,Fi[ao]=.5,Fi[ts]=1,Fi[vs]=1,Fi[As]=.5,Fi[_o]=1,Fi[Da]=1,Fi[li]=.5,Fi[wo]=.25,Fi[Ms]=.5,Fi[Di]=.25,Fi[_s]=.5;function nc(ie){return Array.isArray(ie)&&(ie.length===0||typeof ie[0]=="number")}function pu(ie){if(!Array.isArray(ie))return!1;var nr=ie.length;return!(nr===0||!rn(ie[0]))}function ml(ie){return Object.prototype.toString.call(ie)}function Lc(ie){return ml(ie)===Iu}function qu(ie){return ml(ie)===Nl}function dc(ie){return ml(ie)===Hu}function wl(ie){return ml(ie)===qs}function Yc(ie){return ml(ie)===sf}function Fc(ie){return ml(ie)===Oo}function mc(ie){if(!ie)return!1;var nr=ml(ie);return yf.indexOf(nr)>=0?!0:nc(ie)||pu(ie)||Ir(ie)}function Wu(ie){return Yt[Object.prototype.toString.call(ie)]|0}function Cc(ie,nr){var cr=nr.length;switch(ie.type){case No:case is:case al:case ii:var sn=j.allocType(ie.type,cr);sn.set(nr),ie.data=sn;break;case uo:ie.data=wn(nr);break}}function Ic(ie,nr){return j.allocType(ie.type===uo?ii:ie.type,nr)}function du(ie,nr){ie.type===uo?(ie.data=wn(nr),j.freeType(nr)):ie.data=nr}function Bc(ie,nr,cr,sn,zn,Tn){for(var qr=ie.width,Sn=ie.height,sa=ie.channels,ea=qr*Sn*sa,ka=Ic(ie,ea),Ka=0,Va=0;Va=1;)Sn+=qr*sa*sa,sa/=2;return Sn}else return qr*cr*sn}function wu(ie,nr,cr,sn,zn,Tn,qr){var Sn={"don't care":fu,"dont care":fu,nice:xc,fast:Ec},sa={repeat:Is,clamp:Wo,mirror:Bi},ea={nearest:Jo,linear:us},ka=u({mipmap:bu,"nearest mipmap nearest":Ss,"linear mipmap nearest":Ls,"nearest mipmap linear":xl,"linear mipmap linear":bu},ea),Ka={none:0,browser:Ml},Va={uint8:No,rgba4:Ho,rgb565:zo,"rgb5 a1":Ci},fa={alpha:Ja,luminance:ci,"luminance alpha":Ti,rgb:wi,rgba:Qa,rgba4:Ra,"rgb5 a1":Qi,rgb565:Hi},Un={};nr.ext_srgb&&(fa.srgb=hs,fa.srgba=Gi),nr.oes_texture_float&&(Va.float32=Va.float=ii),nr.oes_texture_half_float&&(Va.float16=Va["half float"]=uo),nr.webgl_depth_texture&&(u(fa,{depth:qo,"depth stencil":Po}),u(Va,{uint16:is,uint32:al,"depth stencil":qi})),nr.webgl_compressed_texture_s3tc&&u(Un,{"rgb s3tc dxt1":yi,"rgba s3tc dxt1":ao,"rgba s3tc dxt3":ts,"rgba s3tc dxt5":vs}),nr.webgl_compressed_texture_atc&&u(Un,{"rgb atc":As,"rgba atc explicit alpha":_o,"rgba atc interpolated alpha":Da}),nr.webgl_compressed_texture_pvrtc&&u(Un,{"rgb pvrtc 4bppv1":li,"rgb pvrtc 2bppv1":wo,"rgba pvrtc 4bppv1":Ms,"rgba pvrtc 2bppv1":Di}),nr.webgl_compressed_texture_etc1&&(Un["rgb etc1"]=_s);var Nr=Array.prototype.slice.call(ie.getParameter(Qr));Object.keys(Un).forEach(function(U){var tt=Un[U];Nr.indexOf(tt)>=0&&(fa[U]=tt)});var fn=Object.keys(fa);cr.textureFormats=fn;var Xn=[];Object.keys(fa).forEach(function(U){var tt=fa[U];Xn[tt]=U});var jn=[];Object.keys(Va).forEach(function(U){var tt=Va[U];jn[tt]=U});var kn=[];Object.keys(ea).forEach(function(U){var tt=ea[U];kn[tt]=U});var Ia=[];Object.keys(ka).forEach(function(U){var tt=ka[U];Ia[tt]=U});var ya=[];Object.keys(sa).forEach(function(U){var tt=sa[U];ya[tt]=U});var qa=fn.reduce(function(U,tt){var Y=fa[tt];return Y===ci||Y===Ja||Y===ci||Y===Ti||Y===qo||Y===Po||nr.ext_srgb&&(Y===hs||Y===Gi)?U[Y]=Y:Y===Qi||tt.indexOf("rgba")>=0?U[Y]=Qa:U[Y]=wi,U},{});function Rn(){this.internalformat=Qa,this.format=Qa,this.type=No,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ml,this.width=0,this.height=0,this.channels=0}function An(U,tt){U.internalformat=tt.internalformat,U.format=tt.format,U.type=tt.type,U.compressed=tt.compressed,U.premultiplyAlpha=tt.premultiplyAlpha,U.flipY=tt.flipY,U.unpackAlignment=tt.unpackAlignment,U.colorSpace=tt.colorSpace,U.width=tt.width,U.height=tt.height,U.channels=tt.channels}function Pa(U,tt){if(!(typeof tt!="object"||!tt)){if("premultiplyAlpha"in tt&&(U.premultiplyAlpha=tt.premultiplyAlpha),"flipY"in tt&&(U.flipY=tt.flipY),"alignment"in tt&&(U.unpackAlignment=tt.alignment),"colorSpace"in tt&&(U.colorSpace=Ka[tt.colorSpace]),"type"in tt){var Y=tt.type;U.type=Va[Y]}var ft=U.width,zt=U.height,Qt=U.channels,ne=!1;"shape"in tt?(ft=tt.shape[0],zt=tt.shape[1],tt.shape.length===3&&(Qt=tt.shape[2],ne=!0)):("radius"in tt&&(ft=zt=tt.radius),"width"in tt&&(ft=tt.width),"height"in tt&&(zt=tt.height),"channels"in tt&&(Qt=tt.channels,ne=!0)),U.width=ft|0,U.height=zt|0,U.channels=Qt|0;var Ft=!1;if("format"in tt){var $t=tt.format,he=U.internalformat=fa[$t];U.format=qa[he],$t in Va&&("type"in tt||(U.type=Va[$t])),$t in Un&&(U.compressed=!0),Ft=!0}!ne&&Ft?U.channels=Fo[U.format]:ne&&!Ft&&U.channels!==bl[U.format]&&(U.format=U.internalformat=bl[U.channels])}}function ba(U){ie.pixelStorei(zc,U.flipY),ie.pixelStorei(Al,U.premultiplyAlpha),ie.pixelStorei(_l,U.colorSpace),ie.pixelStorei(Gl,U.unpackAlignment)}function aa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function oa(U,tt){var Y=null;if(mc(tt)?Y=tt:tt&&(Pa(U,tt),"x"in tt&&(U.xOffset=tt.x|0),"y"in tt&&(U.yOffset=tt.y|0),mc(tt.data)&&(Y=tt.data)),tt.copy){var ft=zn.viewportWidth,zt=zn.viewportHeight;U.width=U.width||ft-U.xOffset,U.height=U.height||zt-U.yOffset,U.needsCopy=!0}else if(!Y)U.width=U.width||1,U.height=U.height||1,U.channels=U.channels||4;else if(Mr(Y))U.channels=U.channels||4,U.data=Y,!("type"in tt)&&U.type===No&&(U.type=Wu(Y));else if(nc(Y))U.channels=U.channels||4,Cc(U,Y),U.alignment=1,U.needsFree=!0;else if(Ir(Y)){var Qt=Y.data;!Array.isArray(Qt)&&U.type===No&&(U.type=Wu(Qt));var ne=Y.shape,Ft=Y.stride,$t,he,Ne,Ie,Fe,He;ne.length===3?(Ne=ne[2],He=Ft[2]):(Ne=1,He=1),$t=ne[0],he=ne[1],Ie=Ft[0],Fe=Ft[1],U.alignment=1,U.width=$t,U.height=he,U.channels=Ne,U.format=U.internalformat=bl[Ne],U.needsFree=!0,Bc(U,Qt,Ie,Fe,He,Y.offset)}else if(Lc(Y)||qu(Y)||dc(Y))Lc(Y)||qu(Y)?U.element=Y:U.element=Y.canvas,U.width=U.element.width,U.height=U.element.height,U.channels=4;else if(wl(Y))U.element=Y,U.width=Y.width,U.height=Y.height,U.channels=4;else if(Yc(Y))U.element=Y,U.width=Y.naturalWidth,U.height=Y.naturalHeight,U.channels=4;else if(Fc(Y))U.element=Y,U.width=Y.videoWidth,U.height=Y.videoHeight,U.channels=4;else if(pu(Y)){var Ge=U.width||Y[0].length,Ae=U.height||Y.length,Oe=U.channels;rn(Y[0][0])?Oe=Oe||Y[0][0].length:Oe=Oe||1;for(var Le=Dt.shape(Y),ur=1,Dr=0;Dr>=zt,Y.height>>=zt,oa(Y,ft[zt]),U.mipmask|=1<=0&&!("faces"in tt)&&(U.genMipmaps=!0)}if("mag"in tt){var ft=tt.mag;U.magFilter=ea[ft]}var zt=U.wrapS,Qt=U.wrapT;if("wrap"in tt){var ne=tt.wrap;typeof ne=="string"?zt=Qt=sa[ne]:Array.isArray(ne)&&(zt=sa[ne[0]],Qt=sa[ne[1]])}else{if("wrapS"in tt){var Ft=tt.wrapS;zt=sa[Ft]}if("wrapT"in tt){var $t=tt.wrapT;Qt=sa[$t]}}if(U.wrapS=zt,U.wrapT=Qt,"anisotropic"in tt&&(tt.anisotropic,U.anisotropic=tt.anisotropic),"mipmap"in tt){var he=!1;switch(typeof tt.mipmap){case"string":U.mipmapHint=Sn[tt.mipmap],U.genMipmaps=!0,he=!0;break;case"boolean":he=U.genMipmaps=tt.mipmap;break;case"object":U.genMipmaps=!1,he=!0;break}he&&!("min"in tt)&&(U.minFilter=Ss)}}function El(U,tt){ie.texParameteri(tt,fl,U.minFilter),ie.texParameteri(tt,$s,U.magFilter),ie.texParameteri(tt,io,U.wrapS),ie.texParameteri(tt,co,U.wrapT),nr.ext_texture_filter_anisotropic&&ie.texParameteri(tt,cs,U.anisotropic),U.genMipmaps&&(ie.hint(au,U.mipmapHint),ie.generateMipmap(tt))}var Cl=0,Hs={},js=cr.maxTextureUnits,Ks=Array(js).map(function(){return null});function Mi(U){Rn.call(this),this.mipmask=0,this.internalformat=Qa,this.id=Cl++,this.refCount=1,this.target=U,this.texture=ie.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Zo,qr.profile&&(this.stats={size:0})}function Ys(U){ie.activeTexture(hu),ie.bindTexture(U.target,U.texture)}function Uo(){var U=Ks[0];U?ie.bindTexture(U.target,U.texture):ie.bindTexture(vn,null)}function tl(U){var tt=U.texture,Y=U.unit,ft=U.target;Y>=0&&(ie.activeTexture(hu+Y),ie.bindTexture(ft,null),Ks[Y]=null),ie.deleteTexture(tt),U.texture=null,U.params=null,U.pixels=null,U.refCount=0,delete Hs[U.id],Tn.textureCount--}u(Mi.prototype,{bind:function(){var U=this;U.bindCount+=1;var tt=U.unit;if(tt<0){for(var Y=0;Y0)continue;ft.unit=-1}Ks[Y]=U,tt=Y;break}qr.profile&&Tn.maxTextureUnits>Fe)-Ne,He.height=He.height||(Y.height>>Fe)-Ie,Ys(Y),_i(He,vn,Ne,Ie,Fe),Uo(),Na(He),ft}function Qt(ne,Ft){var $t=ne|0,he=Ft|0||$t;if($t===Y.width&&he===Y.height)return ft;ft.width=Y.width=$t,ft.height=Y.height=he,Ys(Y);for(var Ne=0;Y.mipmask>>Ne;++Ne){var Ie=$t>>Ne,Fe=he>>Ne;if(!Ie||!Fe)break;ie.texImage2D(vn,Ne,Y.format,Ie,Fe,0,Y.format,Y.type,null)}return Uo(),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,$t,he,!1,!1)),ft}return ft(U,tt),ft.subimage=zt,ft.resize=Qt,ft._reglType="texture2d",ft._texture=Y,qr.profile&&(ft.stats=Y.stats),ft.destroy=function(){Y.decRef()},ft}function vi(U,tt,Y,ft,zt,Qt){var ne=new Mi(Oa);Hs[ne.id]=ne,Tn.cubeCount++;var Ft=new Array(6);function $t(Ie,Fe,He,Ge,Ae,Oe){var Le,ur=ne.texInfo;for(Zo.call(ur),Le=0;Le<6;++Le)Ft[Le]=Zi();if(typeof Ie=="number"||!Ie){var Dr=Ie|0||1;for(Le=0;Le<6;++Le)gi(Ft[Le],Dr,Dr)}else if(typeof Ie=="object")if(Fe)Ri(Ft[0],Ie),Ri(Ft[1],Fe),Ri(Ft[2],He),Ri(Ft[3],Ge),Ri(Ft[4],Ae),Ri(Ft[5],Oe);else if(Qs(ur,Ie),Pa(ne,Ie),"faces"in Ie){var jr=Ie.faces;for(Le=0;Le<6;++Le)An(Ft[Le],ne),Ri(Ft[Le],jr[Le])}else for(Le=0;Le<6;++Le)Ri(Ft[Le],Ie);for(An(ne,Ft[0]),ur.genMipmaps?ne.mipmask=(Ft[0].width<<1)-1:ne.mipmask=Ft[0].mipmask,ne.internalformat=Ft[0].internalformat,$t.width=Ft[0].width,$t.height=Ft[0].height,Ys(ne),Le=0;Le<6;++Le)ds(Ft[Le],Qn+Le);for(El(ur,Oa),Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,ur.genMipmaps,!0)),$t.format=Xn[ne.internalformat],$t.type=jn[ne.type],$t.mag=kn[ur.magFilter],$t.min=Ia[ur.minFilter],$t.wrapS=ya[ur.wrapS],$t.wrapT=ya[ur.wrapT],Le=0;Le<6;++Le)Zs(Ft[Le]);return $t}function he(Ie,Fe,He,Ge,Ae){var Oe=He|0,Le=Ge|0,ur=Ae|0,Dr=Ma();return An(Dr,ne),Dr.width=0,Dr.height=0,oa(Dr,Fe),Dr.width=Dr.width||(ne.width>>ur)-Oe,Dr.height=Dr.height||(ne.height>>ur)-Le,Ys(ne),_i(Dr,Qn+Ie,Oe,Le,ur),Uo(),Na(Dr),$t}function Ne(Ie){var Fe=Ie|0;if(Fe!==ne.width){$t.width=ne.width=Fe,$t.height=ne.height=Fe,Ys(ne);for(var He=0;He<6;++He)for(var Ge=0;ne.mipmask>>Ge;++Ge)ie.texImage2D(Qn+He,Ge,ne.format,Fe>>Ge,Fe>>Ge,0,ne.format,ne.type,null);return Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,!1,!0)),$t}}return $t(U,tt,Y,ft,zt,Qt),$t.subimage=he,$t.resize=Ne,$t._reglType="textureCube",$t._texture=ne,qr.profile&&($t.stats=ne.stats),$t.destroy=function(){ne.decRef()},$t}function lo(){for(var U=0;U>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);else for(var zt=0;zt<6;++zt)ie.texImage2D(Qn+zt,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);El(Y.texInfo,Y.target)})}function $o(){for(var U=0;U=0?Zs=!0:sa.indexOf(Zo)>=0&&(Zs=!1))),("depthTexture"in Mi||"depthStencilTexture"in Mi)&&(Ks=!!(Mi.depthTexture||Mi.depthStencilTexture)),"depth"in Mi&&(typeof Mi.depth=="boolean"?ds=Mi.depth:(Cl=Mi.depth,rs=!1)),"stencil"in Mi&&(typeof Mi.stencil=="boolean"?rs=Mi.stencil:(Hs=Mi.stencil,ds=!1)),"depthStencil"in Mi&&(typeof Mi.depthStencil=="boolean"?ds=rs=Mi.depthStencil:(js=Mi.depthStencil,ds=!1,rs=!1))}var Uo=null,tl=null,Il=null,vi=null;if(Array.isArray(Zi))Uo=Zi.map(Un);else if(Zi)Uo=[Un(Zi)];else for(Uo=new Array(El),ui=0;ui0&&(Na.depth=oa[0].depth,Na.stencil=oa[0].stencil,Na.depthStencil=oa[0].depthStencil),oa[Ma]?oa[Ma](Na):oa[Ma]=An(Na)}return u(Sa,{width:ui,height:ui,color:Zo})}function _i(pi){var Ma,Na=pi|0;if(Na===Sa.width)return Sa;var ui=Sa.color;for(Ma=0;Ma=ui.byteLength?gi.subdata(ui):(gi.destroy(),An.buffers[pi]=null)),An.buffers[pi]||(gi=An.buffers[pi]=zn.create(Ma,Tc,!1,!0)),Na.buffer=zn.getBuffer(gi),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1,Sa[pi]=1}else zn.getBuffer(Ma)?(Na.buffer=zn.getBuffer(Ma),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1):zn.getBuffer(Ma.buffer)?(Na.buffer=zn.getBuffer(Ma.buffer),Na.size=(+Ma.size||Na.buffer.dimension)|0,Na.normalized=!!Ma.normalized||!1,"type"in Ma?Na.type=pn[Ma.type]:Na.type=Na.buffer.dtype,Na.offset=(Ma.offset||0)|0,Na.stride=(Ma.stride||0)|0,Na.divisor=(Ma.divisor||0)|0,Na.state=1):"x"in Ma&&(Na.x=+Ma.x||0,Na.y=+Ma.y||0,Na.z=+Ma.z||0,Na.w=+Ma.w||0,Na.state=2)}for(var Ri=0;Ri1)for(var ba=0;baNr&&(Nr=fn.stats.uniformsCount)}),Nr},cr.getMaxAttributesCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.attributesCount>Nr&&(Nr=fn.stats.attributesCount)}),Nr});function Un(){zn={},Tn={};for(var Nr=0;Nr>>4&15)+nr.charAt(sn&15);return cr}function Fu(ie){for(var nr="",cr=-1,sn,zn;++cr>>6&31,128|sn&63):sn<=65535?nr+=String.fromCharCode(224|sn>>>12&15,128|sn>>>6&63,128|sn&63):sn<=2097151&&(nr+=String.fromCharCode(240|sn>>>18&7,128|sn>>>12&63,128|sn>>>6&63,128|sn&63));return nr}function Au(ie){for(var nr=Array(ie.length>>2),cr=0;cr>5]|=(ie.charCodeAt(cr/8)&255)<<24-cr%32;return nr}function il(ie){for(var nr="",cr=0;cr>5]>>>24-cr%32&255);return nr}function Cs(ie,nr){return ie>>>nr|ie<<32-nr}function Mu(ie,nr){return ie>>>nr}function lc(ie,nr,cr){return ie&nr^~ie&cr}function Su(ie,nr,cr){return ie&nr^ie&cr^nr&cr}function Oc(ie){return Cs(ie,2)^Cs(ie,13)^Cs(ie,22)}function Xe(ie){return Cs(ie,6)^Cs(ie,11)^Cs(ie,25)}function yr(ie){return Cs(ie,7)^Cs(ie,18)^Mu(ie,3)}function Kr(ie){return Cs(ie,17)^Cs(ie,19)^Mu(ie,10)}var Rr=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function mn(ie,nr){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),sn=new Array(64),zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr;for(ie[nr>>5]|=128<<24-nr%32,ie[(nr+64>>9<<4)+15]=nr,Va=0;Va>16)+(nr>>16)+(cr>>16);return sn<<16|cr&65535}function ha(ie){return Array.prototype.slice.call(ie)}function Ta(ie){return ha(ie).join("")}function Ua(ie){var nr=ie&&ie.cache,cr=0,sn=[],zn=[],Tn=[];function qr(Un,Nr){var fn=Nr&&Nr.stable;if(!fn){for(var Xn=0;Xn0&&(Un.push(jn,"="),Un.push.apply(Un,ha(arguments)),Un.push(";")),jn}return u(Nr,{def:Xn,toString:function(){return Ta([fn.length>0?"var "+fn.join(",")+";":"",Ta(Un)])}})}function sa(){var Un=Sn(),Nr=Sn(),fn=Un.toString,Xn=Nr.toString;function jn(kn,Ia){Nr(kn,Ia,"=",Un.def(kn,Ia),";")}return u(function(){Un.apply(Un,ha(arguments))},{def:Un.def,entry:Un,exit:Nr,save:jn,set:function(kn,Ia,ya){jn(kn,Ia),Un(kn,Ia,"=",ya,";")},toString:function(){return fn()+Xn()}})}function ea(){var Un=Ta(arguments),Nr=sa(),fn=sa(),Xn=Nr.toString,jn=fn.toString;return u(Nr,{then:function(){return Nr.apply(Nr,ha(arguments)),this},else:function(){return fn.apply(fn,ha(arguments)),this},toString:function(){var kn=jn();return kn&&(kn="else{"+kn+"}"),Ta(["if(",Un,"){",Xn(),"}",kn])}})}var ka=Sn(),Ka={};function Va(Un,Nr){var fn=[];function Xn(){var qa="a"+fn.length;return fn.push(qa),qa}Nr=Nr||0;for(var jn=0;jn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Hn={cw:Xt,ccw:fe};function Yn(ie){return Array.isArray(ie)||Mr(ie)||Ir(ie)}function na(ie){return ie.sort(function(nr,cr){return nr===ul?-1:cr===ul?1:nr=1,sn>=2,nr)}else if(cr===Wi){var zn=ie.data;return new _n(zn.thisDep,zn.contextDep,zn.propDep,nr)}else{if(cr===Xi)return new _n(!1,!1,!1,nr);if(cr===ni){for(var Tn=!1,qr=!1,Sn=!1,sa=0;sa=1&&(qr=!0),ka>=2&&(Sn=!0)}else ea.type===Wi&&(Tn=Tn||ea.data.thisDep,qr=qr||ea.data.contextDep,Sn=Sn||ea.data.propDep)}return new _n(Tn,qr,Sn,nr)}else return new _n(cr===Oi,cr===Vi,cr===ei,nr)}}var xi=new _n(!1,!1,!1,function(){});function ki(ie,nr,cr,sn,zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr){var fn=ea.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(Xn.min=me,Xn.max=we);var jn=cr.angle_instanced_arrays,kn=cr.webgl_draw_buffers,Ia=cr.oes_vertex_array_object,ya={dirty:!0,profile:Nr.profile},qa={},Rn=[],An={},Pa={};function ba(Ft){return Ft.replace(".","_")}function aa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),qa[Ne]=ya[Ne]=!!he,An[Ne]=$t}function oa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),Array.isArray(he)?(ya[Ne]=he.slice(),qa[Ne]=he.slice()):ya[Ne]=qa[Ne]=he,Pa[Ne]=$t}function Sa(Ft){return!!isNaN(Ft)}aa(Za,gr),aa($i,fr),oa(Do,"blendColor",[0,0,0,0]),oa(ss,"blendEquationSeparate",[Sr,Sr]),oa(Ps,"blendFuncSeparate",[Cr,or,Cr,or]),aa(ys,Hr,!0),oa(Os,"depthFunc",Wr),oa(Yo,"depthRange",[0,1]),oa(ll,"depthMask",!0),oa(el,el,[!0,!0,!0,!0]),aa(Rs,rr),oa(bi,"cullFace",Et),oa(so,so,fe),oa(ws,ws,1),aa(fs,cn),oa(Ll,"polygonOffset",[0,0]),aa($l,Mn),aa(jl,Jn),oa(Bu,"sampleCoverage",[1,!1]),aa(Jl,Lr),oa(Ru,"stencilMask",-1),oa(nl,"stencilFunc",[Ve,0,-1]),oa(Nu,"stencilOpSeparate",[gt,je,je,je]),oa(Ui,"stencilOpSeparate",[Et,je,je,je]),aa(fo,nn),oa(Ql,"scissor",[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]),oa(ul,ul,[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]);var _i={gl:ie,context:Va,strings:nr,next:qa,current:ya,draw:Ka,elements:Tn,buffer:zn,shader:ka,attributes:ea.state,vao:ea,uniforms:sa,framebuffer:Sn,extensions:cr,timer:fa,isBufferArgs:Yn},pi={primTypes:Cn,compareFuncs:hn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:pn,orientationType:Hn};kn&&(pi.backBuffer=[Et],pi.drawBuffer=c(sn.maxDrawbuffers,function(Ft){return Ft===0?[0]:c(Ft,function($t){return on+$t})}));var Ma=0;function Na(){var Ft=Ua({cache:Un}),$t=Ft.link,he=Ft.global;Ft.id=Ma++,Ft.batchId="0";var Ne=$t(_i),Ie=Ft.shared={props:"a0"};Object.keys(_i).forEach(function(Oe){Ie[Oe]=he.def(Ne,".",Oe)});var Fe=Ft.next={},He=Ft.current={};Object.keys(Pa).forEach(function(Oe){Array.isArray(ya[Oe])&&(Fe[Oe]=he.def(Ie.next,".",Oe),He[Oe]=he.def(Ie.current,".",Oe))});var Ge=Ft.constants={};Object.keys(pi).forEach(function(Oe){Ge[Oe]=he.def(JSON.stringify(pi[Oe]))}),Ft.invoke=function(Oe,Le){switch(Le.type){case ca:var ur=["this",Ie.context,Ie.props,Ft.batchId];return Oe.def($t(Le.data),".call(",ur.slice(0,Math.max(Le.data.length+1,4)),")");case ei:return Oe.def(Ie.props,Le.data);case Vi:return Oe.def(Ie.context,Le.data);case Oi:return Oe.def("this",Le.data);case Wi:return Le.data.append(Ft,Oe),Le.data.ref;case Xi:return Le.data.toString();case ni:return Le.data.map(function(Dr){return Ft.invoke(Oe,Dr)})}},Ft.attribCache={};var Ae={};return Ft.scopeAttrib=function(Oe){var Le=nr.id(Oe);if(Le in Ae)return Ae[Le];var ur=ea.scope[Le];ur||(ur=ea.scope[Le]=new fn);var Dr=Ae[Le]=$t(ur);return Dr},Ft}function ui(Ft){var $t=Ft.static,he=Ft.dynamic,Ne;if(Dc in $t){var Ie=!!$t[Dc];Ne=Wa(function(He,Ge){return Ie}),Ne.enable=Ie}else if(Dc in he){var Fe=he[Dc];Ne=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}return Ne}function gi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic;if(Pt in he){var Ie=he[Pt];return Ie?(Ie=Sn.getFramebuffer(Ie),Wa(function(He,Ge){var Ae=He.link(Ie),Oe=He.shared;Ge.set(Oe.framebuffer,".next",Ae);var Le=Oe.context;return Ge.set(Le,"."+pr,Ae+".width"),Ge.set(Le,"."+Br,Ae+".height"),Ae})):Wa(function(He,Ge){var Ae=He.shared;Ge.set(Ae.framebuffer,".next","null");var Oe=Ae.context;return Ge.set(Oe,"."+pr,Oe+"."+ae),Ge.set(Oe,"."+Br,Oe+"."+ce),"null"})}else if(Pt in Ne){var Fe=Ne[Pt];return ri(Fe,function(He,Ge){var Ae=He.invoke(Ge,Fe),Oe=He.shared,Le=Oe.framebuffer,ur=Ge.def(Le,".getFramebuffer(",Ae,")");Ge.set(Le,".next",ur);var Dr=Oe.context;return Ge.set(Dr,"."+pr,ur+"?"+ur+".width:"+Dr+"."+ae),Ge.set(Dr,"."+Br,ur+"?"+ur+".height:"+Dr+"."+ce),ur})}else return null}function Ri(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Ae){if(Ae in Ne){var Oe=Ne[Ae],Le=!0,ur=Oe.x|0,Dr=Oe.y|0,jr,On;return"width"in Oe?jr=Oe.width|0:Le=!1,"height"in Oe?On=Oe.height|0:Le=!1,new _n(!Le&&$t&&$t.thisDep,!Le&&$t&&$t.contextDep,!Le&&$t&&$t.propDep,function(Wn,Dn){var la=Wn.shared.context,qn=jr;"width"in Oe||(qn=Dn.def(la,".",pr,"-",ur));var Gn=On;return"height"in Oe||(Gn=Dn.def(la,".",Br,"-",Dr)),[ur,Dr,qn,Gn]})}else if(Ae in Ie){var Ln=Ie[Ae],xn=ri(Ln,function(Wn,Dn){var la=Wn.invoke(Dn,Ln),qn=Wn.shared.context,Gn=Dn.def(la,".x|0"),ma=Dn.def(la,".y|0"),ti=Dn.def('"width" in ',la,"?",la,".width|0:","(",qn,".",pr,"-",Gn,")"),si=Dn.def('"height" in ',la,"?",la,".height|0:","(",qn,".",Br,"-",ma,")");return[Gn,ma,ti,si]});return $t&&(xn.thisDep=xn.thisDep||$t.thisDep,xn.contextDep=xn.contextDep||$t.contextDep,xn.propDep=xn.propDep||$t.propDep),xn}else return $t?new _n($t.thisDep,$t.contextDep,$t.propDep,function(Wn,Dn){var la=Wn.shared.context;return[0,0,Dn.def(la,".",pr),Dn.def(la,".",Br)]}):null}var He=Fe(ul);if(He){var Ge=He;He=new _n(He.thisDep,He.contextDep,He.propDep,function(Ae,Oe){var Le=Ge.append(Ae,Oe),ur=Ae.shared.context;return Oe.set(ur,"."+Jr,Le[2]),Oe.set(ur,"."+Rt,Le[3]),Le})}return{viewport:He,scissor_box:Fe(Ql)}}function ds(Ft,$t){var he=Ft.static,Ne=typeof he[at]=="string"&&typeof he[L]=="string";if(Ne){if(Object.keys($t.dynamic).length>0)return null;var Ie=$t.static,Fe=Object.keys(Ie);if(Fe.length>0&&typeof Ie[Fe[0]]=="number"){for(var He=[],Ge=0;Ge"+Gn+"?"+Le+".constant["+Gn+"]:0;"}).join(""),"}}else{","if(",jr,"(",Le,".buffer)){",Wn,"=",On,".createStream(",ye,",",Le,".buffer);","}else{",Wn,"=",On,".getBuffer(",Le,".buffer);","}",Dn,'="type" in ',Le,"?",Dr.glTypes,"[",Le,".type]:",Wn,".dtype;",Ln.normalized,"=!!",Le,".normalized;");function la(qn){Oe(Ln[qn],"=",Le,".",qn,"|0;")}return la("size"),la("offset"),la("stride"),la("divisor"),Oe("}}"),Oe.exit("if(",Ln.isStream,"){",On,".destroyStream(",Wn,");","}"),Ln}Ie[Fe]=ri(He,Ge)}),Ie}function El(Ft){var $t=Ft.static,he=Ft.dynamic,Ne={};return Object.keys($t).forEach(function(Ie){var Fe=$t[Ie];Ne[Ie]=Wa(function(He,Ge){return typeof Fe=="number"||typeof Fe=="boolean"?""+Fe:He.link(Fe)})}),Object.keys(he).forEach(function(Ie){var Fe=he[Ie];Ne[Ie]=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}),Ne}function Cl(Ft,$t,he,Ne,Ie){Ft.static,Ft.dynamic;var Fe=ds(Ft,$t),He=gi(Ft),Ge=Ri(Ft,He),Ae=Zi(Ft),Oe=Zs(Ft),Le=rs(Ft,Ie,Fe);function ur(Wn){var Dn=Ge[Wn];Dn&&(Oe[Wn]=Dn)}ur(ul),ur(ba(Ql));var Dr=Object.keys(Oe).length>0,jr={framebuffer:He,draw:Ae,shader:Le,state:Oe,dirty:Dr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(jr.profile=ui(Ft),jr.uniforms=Zo(he),jr.drawVAO=jr.scopeVAO=Ae.vao,!jr.drawVAO&&Le.program&&!Fe&&cr.angle_instanced_arrays&&Ae.static.elements){var On=!0,Ln=Le.program.attributes.map(function(Wn){var Dn=$t.static[Wn];return On=On&&!!Dn,Dn});if(On&&Ln.length>0){var xn=ea.getVAO(ea.createVAO({attributes:Ln,elements:Ae.static.elements}));jr.drawVAO=new _n(null,null,null,function(Wn,Dn){return Wn.link(xn)}),jr.useVAO=!0}}return Fe?jr.useVAO=!0:jr.attributes=Qs($t),jr.context=El(Ne),jr}function Hs(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.context,Fe=Ft.scope();Object.keys(he).forEach(function(He){$t.save(Ie,"."+He);var Ge=he[He],Ae=Ge.append(Ft,$t);Array.isArray(Ae)?Fe(Ie,".",He,"=[",Ae.join(),"];"):Fe(Ie,".",He,"=",Ae,";")}),$t(Fe)}function js(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.framebuffer,Ge;kn&&(Ge=$t.def(Ie.extensions,".webgl_draw_buffers"));var Ae=Ft.constants,Oe=Ae.drawBuffer,Le=Ae.backBuffer,ur;he?ur=he.append(Ft,$t):ur=$t.def(He,".next"),Ne||$t("if(",ur,"!==",He,".cur){"),$t("if(",ur,"){",Fe,".bindFramebuffer(",an,",",ur,".framebuffer);"),kn&&$t(Ge,".drawBuffersWEBGL(",Oe,"[",ur,".colorAttachments.length]);"),$t("}else{",Fe,".bindFramebuffer(",an,",null);"),kn&&$t(Ge,".drawBuffersWEBGL(",Le,");"),$t("}",He,".cur=",ur,";"),Ne||$t("}")}function Ks(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.gl,Fe=Ft.current,He=Ft.next,Ge=Ne.current,Ae=Ne.next,Oe=Ft.cond(Ge,".dirty");Rn.forEach(function(Le){var ur=ba(Le);if(!(ur in he.state)){var Dr,jr;if(ur in He){Dr=He[ur],jr=Fe[ur];var On=c(ya[ur].length,function(xn){return Oe.def(Dr,"[",xn,"]")});Oe(Ft.cond(On.map(function(xn,Wn){return xn+"!=="+jr+"["+Wn+"]"}).join("||")).then(Ie,".",Pa[ur],"(",On,");",On.map(function(xn,Wn){return jr+"["+Wn+"]="+xn}).join(";"),";"))}else{Dr=Oe.def(Ae,".",ur);var Ln=Ft.cond(Dr,"!==",Ge,".",ur);Oe(Ln),ur in An?Ln(Ft.cond(Dr).then(Ie,".enable(",An[ur],");").else(Ie,".disable(",An[ur],");"),Ge,".",ur,"=",Dr,";"):Ln(Ie,".",Pa[ur],"(",Dr,");",Ge,".",ur,"=",Dr,";")}}}),Object.keys(he.state).length===0&&Oe(Ge,".dirty=false;"),$t(Oe)}function Mi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ft.current,He=Ie.current,Ge=Ie.gl,Ae;na(Object.keys(he)).forEach(function(Oe){var Le=he[Oe];if(!(Ne&&!Ne(Le))){var ur=Le.append(Ft,$t);if(An[Oe]){var Dr=An[Oe];Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ft.cond(Ae).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",Ae,";")):($t(Ft.cond(ur).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",ur,";"))}else if(rn(ur)){var jr=Fe[Oe];$t(Ge,".",Pa[Oe],"(",ur,");",ur.map(function(On,Ln){return jr+"["+Ln+"]="+On}).join(";"),";")}else Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ge,".",Pa[Oe],"(",Ae,");",He,".",Oe,"=",Ae,";")):$t(Ge,".",Pa[Oe],"(",ur,");",He,".",Oe,"=",ur,";")}})}function Ys(Ft,$t){jn&&(Ft.instancing=$t.def(Ft.shared.extensions,".angle_instanced_arrays"))}function Uo(Ft,$t,he,Ne,Ie){var Fe=Ft.shared,He=Ft.stats,Ge=Fe.current,Ae=Fe.timer,Oe=he.profile;function Le(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ur,Dr;function jr(la){ur=$t.def(),la(ur,"=",Le(),";"),typeof Ie=="string"?la(He,".count+=",Ie,";"):la(He,".count++;"),fa&&(Ne?(Dr=$t.def(),la(Dr,"=",Ae,".getNumPendingQueries();")):la(Ae,".beginQuery(",He,");"))}function On(la){la(He,".cpuTime+=",Le(),"-",ur,";"),fa&&(Ne?la(Ae,".pushScopeStats(",Dr,",",Ae,".getNumPendingQueries(),",He,");"):la(Ae,".endQuery();"))}function Ln(la){var qn=$t.def(Ge,".profile");$t(Ge,".profile=",la,";"),$t.exit(Ge,".profile=",qn,";")}var xn;if(Oe){if(Ha(Oe)){Oe.enable?(jr($t),On($t.exit),Ln("true")):Ln("false");return}xn=Oe.append(Ft,$t),Ln(xn)}else xn=$t.def(Ge,".profile");var Wn=Ft.block();jr(Wn),$t("if(",xn,"){",Wn,"}");var Dn=Ft.block();On(Dn),$t.exit("if(",xn,"){",Dn,"}")}function tl(Ft,$t,he,Ne,Ie){var Fe=Ft.shared;function He(Ae){switch(Ae){case xa:case mi:case po:return 2;case La:case Yi:case Qo:return 3;case ai:case Go:case Js:return 4;default:return 1}}function Ge(Ae,Oe,Le){var ur=Fe.gl,Dr=$t.def(Ae,".location"),jr=$t.def(Fe.attributes,"[",Dr,"]"),On=Le.state,Ln=Le.buffer,xn=[Le.x,Le.y,Le.z,Le.w],Wn=["buffer","normalized","offset","stride"];function Dn(){$t("if(!",jr,".buffer){",ur,".enableVertexAttribArray(",Dr,");}");var qn=Le.type,Gn;if(Le.size?Gn=$t.def(Le.size,"||",Oe):Gn=Oe,$t("if(",jr,".type!==",qn,"||",jr,".size!==",Gn,"||",Wn.map(function(ti){return jr+"."+ti+"!=="+Le[ti]}).join("||"),"){",ur,".bindBuffer(",ye,",",Ln,".buffer);",ur,".vertexAttribPointer(",[Dr,Gn,qn,Le.normalized,Le.stride,Le.offset],");",jr,".type=",qn,";",jr,".size=",Gn,";",Wn.map(function(ti){return jr+"."+ti+"="+Le[ti]+";"}).join(""),"}"),jn){var ma=Le.divisor;$t("if(",jr,".divisor!==",ma,"){",Ft.instancing,".vertexAttribDivisorANGLE(",[Dr,ma],");",jr,".divisor=",ma,";}")}}function la(){$t("if(",jr,".buffer){",ur,".disableVertexAttribArray(",Dr,");",jr,".buffer=null;","}if(",Ya.map(function(qn,Gn){return jr+"."+qn+"!=="+xn[Gn]}).join("||"),"){",ur,".vertexAttrib4f(",Dr,",",xn,");",Ya.map(function(qn,Gn){return jr+"."+qn+"="+xn[Gn]+";"}).join(""),"}")}On===Ba?Dn():On===za?la():($t("if(",On,"===",Ba,"){"),Dn(),$t("}else{"),la(),$t("}"))}Ne.forEach(function(Ae){var Oe=Ae.name,Le=he.attributes[Oe],ur;if(Le){if(!Ie(Le))return;ur=Le.append(Ft,$t)}else{if(!Ie(xi))return;var Dr=Ft.scopeAttrib(Oe);ur={},Object.keys(new fn).forEach(function(jr){ur[jr]=$t.def(Dr,".",jr)})}Ge(Ft.link(Ae),He(Ae.info.type),ur)})}function Il(Ft,$t,he,Ne,Ie,Fe){for(var He=Ft.shared,Ge=He.gl,Ae,Oe=0;Oe1){for(var Li=[],to=[],ls=0;ls>1)",Ln],");")}function ma(){he(xn,".drawArraysInstancedANGLE(",[Dr,jr,On,Ln],");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}function qn(){function Gn(){he(Fe+".drawElements("+[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)"]+");")}function ma(){he(Fe+".drawArrays("+[Dr,jr,On]+");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}jn&&(typeof Ln!="number"||Ln>=0)?typeof Ln=="string"?(he("if(",Ln,">0){"),la(),he("}else if(",Ln,"<0){"),qn(),he("}")):la():qn()}function lo(Ft,$t,he,Ne,Ie){var Fe=Na(),He=Fe.proc("body",Ie);return jn&&(Fe.instancing=He.def(Fe.shared.extensions,".angle_instanced_arrays")),Ft(Fe,He,he,Ne),Fe.compile().body}function ns(Ft,$t,he,Ne){Ys(Ft,$t),he.useVAO?he.drawVAO?$t(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,$t),");"):$t(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):($t(Ft.shared.vao,".setVAO(null);"),tl(Ft,$t,he,Ne.attributes,function(){return!0})),Il(Ft,$t,he,Ne.uniforms,function(){return!0},!1),vi(Ft,$t,$t,he)}function $o(Ft,$t){var he=Ft.proc("draw",1);Ys(Ft,he),Hs(Ft,he,$t.context),js(Ft,he,$t.framebuffer),Ks(Ft,he,$t),Mi(Ft,he,$t.state),Uo(Ft,he,$t,!1,!0);var Ne=$t.shader.progVar.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Ne,".program);"),$t.shader.program)ns(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Ie=Ft.global.def("{}"),Fe=he.def(Ne,".id"),He=he.def(Ie,"[",Fe,"]");he(Ft.cond(He).then(He,".call(this,a0);").else(He,"=",Ie,"[",Fe,"]=",Ft.link(function(Ge){return lo(ns,Ft,$t,Ge,1)}),"(",Ne,");",He,".call(this,a0);"))}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function U(Ft,$t,he,Ne){Ft.batchId="a1",Ys(Ft,$t);function Ie(){return!0}tl(Ft,$t,he,Ne.attributes,Ie),Il(Ft,$t,he,Ne.uniforms,Ie,!1),vi(Ft,$t,$t,he)}function tt(Ft,$t,he,Ne){Ys(Ft,$t);var Ie=he.contextDep,Fe=$t.def(),He="a0",Ge="a1",Ae=$t.def();Ft.shared.props=Ae,Ft.batchId=Fe;var Oe=Ft.scope(),Le=Ft.scope();$t(Oe.entry,"for(",Fe,"=0;",Fe,"<",Ge,";++",Fe,"){",Ae,"=",He,"[",Fe,"];",Le,"}",Oe.exit);function ur(Wn){return Wn.contextDep&&Ie||Wn.propDep}function Dr(Wn){return!ur(Wn)}if(he.needsContext&&Hs(Ft,Le,he.context),he.needsFramebuffer&&js(Ft,Le,he.framebuffer),Mi(Ft,Le,he.state,ur),he.profile&&ur(he.profile)&&Uo(Ft,Le,he,!1,!0),Ne)he.useVAO?he.drawVAO?ur(he.drawVAO)?Le(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Le),");"):Oe(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Oe),");"):Oe(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):(Oe(Ft.shared.vao,".setVAO(null);"),tl(Ft,Oe,he,Ne.attributes,Dr),tl(Ft,Le,he,Ne.attributes,ur)),Il(Ft,Oe,he,Ne.uniforms,Dr,!1),Il(Ft,Le,he,Ne.uniforms,ur,!0),vi(Ft,Oe,Le,he);else{var jr=Ft.global.def("{}"),On=he.shader.progVar.append(Ft,Le),Ln=Le.def(On,".id"),xn=Le.def(jr,"[",Ln,"]");Le(Ft.shared.gl,".useProgram(",On,".program);","if(!",xn,"){",xn,"=",jr,"[",Ln,"]=",Ft.link(function(Wn){return lo(U,Ft,he,Wn,2)}),"(",On,");}",xn,".call(this,a0[",Fe,"],",Fe,");")}}function Y(Ft,$t){var he=Ft.proc("batch",2);Ft.batchId="0",Ys(Ft,he);var Ne=!1,Ie=!0;Object.keys($t.context).forEach(function(jr){Ne=Ne||$t.context[jr].propDep}),Ne||(Hs(Ft,he,$t.context),Ie=!1);var Fe=$t.framebuffer,He=!1;Fe?(Fe.propDep?Ne=He=!0:Fe.contextDep&&Ne&&(He=!0),He||js(Ft,he,Fe)):js(Ft,he,null),$t.state.viewport&&$t.state.viewport.propDep&&(Ne=!0);function Ge(jr){return jr.contextDep&&Ne||jr.propDep}Ks(Ft,he,$t),Mi(Ft,he,$t.state,function(jr){return!Ge(jr)}),(!$t.profile||!Ge($t.profile))&&Uo(Ft,he,$t,!1,"a1"),$t.contextDep=Ne,$t.needsContext=Ie,$t.needsFramebuffer=He;var Ae=$t.shader.progVar;if(Ae.contextDep&&Ne||Ae.propDep)tt(Ft,he,$t,null);else{var Oe=Ae.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Oe,".program);"),$t.shader.program)tt(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Le=Ft.global.def("{}"),ur=he.def(Oe,".id"),Dr=he.def(Le,"[",ur,"]");he(Ft.cond(Dr).then(Dr,".call(this,a0,a1);").else(Dr,"=",Le,"[",ur,"]=",Ft.link(function(jr){return lo(tt,Ft,$t,jr,2)}),"(",Oe,");",Dr,".call(this,a0,a1);"))}}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function ft(Ft,$t){var he=Ft.proc("scope",3);Ft.batchId="a2";var Ne=Ft.shared,Ie=Ne.current;if(Hs(Ft,he,$t.context),$t.framebuffer&&$t.framebuffer.append(Ft,he),na(Object.keys($t.state)).forEach(function(Ge){var Ae=$t.state[Ge],Oe=Ae.append(Ft,he);rn(Oe)?Oe.forEach(function(Le,ur){Sa(Le)?he.set(Ft.next[Ge],"["+ur+"]",Le):he.set(Ft.next[Ge],"["+ur+"]",Ft.link(Le,{stable:!0}))}):Ha(Ae)?he.set(Ne.next,"."+Ge,Ft.link(Oe,{stable:!0})):he.set(Ne.next,"."+Ge,Oe)}),Uo(Ft,he,$t,!0,!0),[xt,le,Lt,xe,kt].forEach(function(Ge){var Ae=$t.draw[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.draw,"."+Ge,Oe):he.set(Ne.draw,"."+Ge,Ft.link(Oe),{stable:!0})}}),Object.keys($t.uniforms).forEach(function(Ge){var Ae=$t.uniforms[Ge].append(Ft,he);Array.isArray(Ae)&&(Ae="["+Ae.map(function(Oe){return Sa(Oe)?Oe:Ft.link(Oe,{stable:!0})})+"]"),he.set(Ne.uniforms,"["+Ft.link(nr.id(Ge),{stable:!0})+"]",Ae)}),Object.keys($t.attributes).forEach(function(Ge){var Ae=$t.attributes[Ge].append(Ft,he),Oe=Ft.scopeAttrib(Ge);Object.keys(new fn).forEach(function(Le){he.set(Oe,"."+Le,Ae[Le])})}),$t.scopeVAO){var Fe=$t.scopeVAO.append(Ft,he);Sa(Fe)?he.set(Ne.vao,".targetVAO",Fe):he.set(Ne.vao,".targetVAO",Ft.link(Fe,{stable:!0}))}function He(Ge){var Ae=$t.shader[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.shader,"."+Ge,Oe):he.set(Ne.shader,"."+Ge,Ft.link(Oe,{stable:!0}))}}He(L),He(at),Object.keys($t.state).length>0&&(he(Ie,".dirty=true;"),he.exit(Ie,".dirty=true;")),he("a1(",Ft.shared.context,",a0,",Ft.batchId,");")}function zt(Ft){if(!(typeof Ft!="object"||rn(Ft))){for(var $t=Object.keys(Ft),he=0;he<$t.length;++he)if(f.isDynamic(Ft[$t[he]]))return!0;return!1}}function Qt(Ft,$t,he){var Ne=$t.static[he];if(!Ne||!zt(Ne))return;var Ie=Ft.global,Fe=Object.keys(Ne),He=!1,Ge=!1,Ae=!1,Oe=Ft.global.def("{}");Fe.forEach(function(ur){var Dr=Ne[ur];if(f.isDynamic(Dr)){typeof Dr=="function"&&(Dr=Ne[ur]=f.unbox(Dr));var jr=ri(Dr,null);He=He||jr.thisDep,Ae=Ae||jr.propDep,Ge=Ge||jr.contextDep}else{switch(Ie(Oe,".",ur,"="),typeof Dr){case"number":Ie(Dr);break;case"string":Ie('"',Dr,'"');break;case"object":Array.isArray(Dr)&&Ie("[",Dr.join(),"]");break;default:Ie(Ft.link(Dr));break}Ie(";")}});function Le(ur,Dr){Fe.forEach(function(jr){var On=Ne[jr];if(f.isDynamic(On)){var Ln=ur.invoke(Dr,On);Dr(Oe,".",jr,"=",Ln,";")}})}$t.dynamic[he]=new f.DynamicVariable(Wi,{thisDep:He,contextDep:Ge,propDep:Ae,ref:Oe,append:Le}),delete $t.static[he]}function ne(Ft,$t,he,Ne,Ie){var Fe=Na();Fe.stats=Fe.link(Ie),Object.keys($t.static).forEach(function(Ge){Qt(Fe,$t,Ge)}),Te.forEach(function(Ge){Qt(Fe,Ft,Ge)});var He=Cl(Ft,$t,he,Ne,Fe);return He.shader.program&&(He.shader.program.attributes.sort(function(Ge,Ae){return Ge.name=0;--vi){var lo=Sa[vi];lo&&lo(fa,null,0)}cr.flush(),ea&&ea.update()}function gi(){!Na&&Sa.length>0&&(Na=v.next(ui))}function Ri(){Na&&(v.cancel(ui),Na=null)}function ds(vi){vi.preventDefault(),Ri(),_i.forEach(function(lo){lo()})}function rs(vi){cr.getError(),zn.restore(),ya.restore(),Xn.restore(),qa.restore(),Rn.restore(),An.restore(),kn.restore(),ea&&ea.restore(),Pa.procs.refresh(),gi(),pi.forEach(function(lo){lo()})}oa&&(oa.addEventListener(Bo,ds,!1),oa.addEventListener(Ds,rs,!1));function Zi(){Sa.length=0,Ri(),oa&&(oa.removeEventListener(Bo,ds),oa.removeEventListener(Ds,rs)),ya.clear(),An.clear(),Rn.clear(),kn.clear(),qa.clear(),jn.clear(),Xn.clear(),ea&&ea.clear(),Ma.forEach(function(vi){vi()})}function Zs(vi){function lo(Ie){var Fe=u({},Ie);delete Fe.uniforms,delete Fe.attributes,delete Fe.context,delete Fe.vao,"stencil"in Fe&&Fe.stencil.op&&(Fe.stencil.opBack=Fe.stencil.opFront=Fe.stencil.op,delete Fe.stencil.op);function He(Ge){if(Ge in Fe){var Ae=Fe[Ge];delete Fe[Ge],Object.keys(Ae).forEach(function(Oe){Fe[Ge+"."+Oe]=Ae[Oe]})}}return He("blend"),He("depth"),He("cull"),He("stencil"),He("polygonOffset"),He("scissor"),He("sample"),"vao"in Ie&&(Fe.vao=Ie.vao),Fe}function ns(Ie,Fe){var He={},Ge={};return Object.keys(Ie).forEach(function(Ae){var Oe=Ie[Ae];if(f.isDynamic(Oe)){Ge[Ae]=f.unbox(Oe,Ae);return}else if(Fe&&Array.isArray(Oe)){for(var Le=0;Le0)return ne.call(this,he(Ie|0),Ie|0)}else if(Array.isArray(Ie)){if(Ie.length)return ne.call(this,Ie,Ie.length)}else return Qt.call(this,Ie)}return u(Ne,{stats:ft,destroy:function(){zt.destroy()}})}var Zo=An.setFBO=Zs({framebuffer:f.define.call(null,Ts,"framebuffer")});function Qs(vi,lo){var ns=0;Pa.procs.poll();var $o=lo.color;$o&&(cr.clearColor(+$o[0]||0,+$o[1]||0,+$o[2]||0,+$o[3]||0),ns|=pl),"depth"in lo&&(cr.clearDepth(+lo.depth),ns|=Ns),"stencil"in lo&&(cr.clearStencil(lo.stencil|0),ns|=fi),cr.clear(ns)}function El(vi){if("framebuffer"in vi)if(vi.framebuffer&&vi.framebuffer_reglType==="framebufferCube")for(var lo=0;lo<6;++lo)Zo(u({framebuffer:vi.framebuffer.faces[lo]},vi),Qs);else Zo(vi,Qs);else Qs(null,vi)}function Cl(vi){Sa.push(vi);function lo(){var ns=zs(Sa,vi);function $o(){var U=zs(Sa,$o);Sa[U]=Sa[Sa.length-1],Sa.length-=1,Sa.length<=0&&Ri()}Sa[ns]=$o}return gi(),{cancel:lo}}function Hs(){var vi=aa.viewport,lo=aa.scissor_box;vi[0]=vi[1]=lo[0]=lo[1]=0,fa.viewportWidth=fa.framebufferWidth=fa.drawingBufferWidth=vi[2]=lo[2]=cr.drawingBufferWidth,fa.viewportHeight=fa.framebufferHeight=fa.drawingBufferHeight=vi[3]=lo[3]=cr.drawingBufferHeight}function js(){fa.tick+=1,fa.time=Mi(),Hs(),Pa.procs.poll()}function Ks(){qa.refresh(),Hs(),Pa.procs.refresh(),ea&&ea.update()}function Mi(){return(g()-ka)/1e3}Ks();function Ys(vi,lo){var ns;switch(vi){case"frame":return Cl(lo);case"lost":ns=_i;break;case"restore":ns=pi;break;case"destroy":ns=Ma;break}return ns.push(lo),{cancel:function(){for(var $o=0;$o=0},read:ba,destroy:Zi,_gl:cr,_refresh:Ks,poll:function(){js(),ea&&ea.update()},now:Mi,stats:qr,getCachedCode:Uo,preloadCachedCode:tl});return nr.onDone(null,Il),Il}return Eu})}),Hx=Vt((K,V)=>{var u=T3(),d=p9();V.exports=function(E,A,t){var e=E._fullLayout,r=!0;return e._glcanvas.each(function(i){if(i.regl){i.regl.preloadCachedCode(t);return}if(!(i.pick&&!e._has("parcoords"))){try{i.regl=d({canvas:this,attributes:{antialias:!i.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:A||[],cachedCode:t||{}})}catch{r=!1}i.regl||(r=!1),r&&this.addEventListener("webglcontextlost",function(n){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:n,layer:i.key})},!1)}}),r||u({container:e._glcontainer.node()}),r}}),p5=Vt((f,V)=>{var u=W3(),d=n5(),E=X7(),A=h9(),t=Xr(),e=Jh().selectMode,r=Hx(),i=nu(),n=Bb(),o=V3().styleTextSelection,a={};function s(v,g,m,w){var l=v._size,x=v.width*w,y=v.height*w,S=l.l*w,k=l.b*w,M=l.r*w,T=l.t*w,c=l.w*w,h=l.h*w;return[S+g.domain[0]*c,k+m.domain[0]*h,x-M-(1-g.domain[1])*c,y-T-(1-m.domain[1])*h]}var f=V.exports=function(v,g,m){if(m.length){var w=v._fullLayout,l=g._scene,x=g.xaxis,y=g.yaxis,S,k;if(l){var M=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!M){l.init();return}var T=l.count,c=w._glcanvas.data()[0].regl;if(n(v,g,m),l.dirty){if((l.line2d||l.error2d)&&!(l.scatter2d||l.fill2d||l.glText)&&c.clear({color:!0,depth:!0}),l.error2d===!0&&(l.error2d=E(c)),l.line2d===!0&&(l.line2d=d(c)),l.scatter2d===!0&&(l.scatter2d=u(c)),l.fill2d===!0&&(l.fill2d=d(c)),l.glText===!0)for(l.glText=new Array(T),S=0;Sl.glText.length){var h=T-l.glText.length;for(S=0;Sit&&(isNaN(q[nt])||isNaN(q[nt+1]));)nt-=2;J.positions=q.slice(it,nt+2)}return J}),l.line2d.update(l.lineOptions)),l.error2d){var P=(l.errorXOptions||[]).concat(l.errorYOptions||[]);l.error2d.update(P)}l.scatter2d&&l.scatter2d.update(l.markerOptions),l.fillOrder=t.repeat(null,T),l.fill2d&&(l.fillOptions=l.fillOptions.map(function(J,q){var it=m[q];if(!(!J||!it||!it[0]||!it[0].trace)){var nt=it[0],dt=nt.trace,Tt=nt.t,wt=l.lineOptions[q],Ct,It,Nt=[];dt._ownfill&&Nt.push(q),dt._nexttrace&&Nt.push(q+1),Nt.length&&(l.fillOrder[q]=Nt);var te=[],Jt=wt&&wt.positions||Tt.positions,ee,Zt;if(dt.fill==="tozeroy"){for(ee=0;eeee&&isNaN(Jt[Zt+1]);)Zt-=2;Jt[ee+1]!==0&&(te=[Jt[ee],0]),te=te.concat(Jt.slice(ee,Zt+2)),Jt[Zt+1]!==0&&(te=te.concat([Jt[Zt],0]))}else if(dt.fill==="tozerox"){for(ee=0;eeee&&isNaN(Jt[Zt]);)Zt-=2;Jt[ee]!==0&&(te=[0,Jt[ee+1]]),te=te.concat(Jt.slice(ee,Zt+2)),Jt[Zt]!==0&&(te=te.concat([0,Jt[Zt+1]]))}else if(dt.fill==="toself"||dt.fill==="tonext"){for(te=[],Ct=0,J.splitNull=!0,It=0;It-1;for(S=0;S{var u=KE();u.plot=p5(),V.exports=u}),m9=Vt((K,V)=>{V.exports=d9()}),d5=Vt((K,V)=>{var u=pc(),d=Wl(),E=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:t}=yl(),e=Ev(),r=Mf().idRegex,i=cl().templatedArray,n=So().extendFlat,o=u.marker,a=o.line,s=n(d("marker.line",{editTypeOverride:"calc"}),{width:n({},a.width,{editType:"calc"}),editType:"calc"}),f=n(d("marker"),{symbol:o.symbol,angle:o.angle,size:n({},o.size,{editType:"markerSize"}),sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,opacity:o.opacity,colorbar:o.colorbar,line:s,editType:"calc"});f.color.editType=f.cmin.editType=f.cmax.editType="style";function v(g){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:r[g],editType:"plot"}}}V.exports={dimensions:i("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:n({},e.text,{}),hovertext:n({},e.hovertext,{}),hovertemplate:A(),hovertemplatefallback:t(),xhoverformat:E("x"),yhoverformat:E("y"),marker:f,xaxes:v("x"),yaxes:v("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:e.selected.marker,editType:"calc"},unselected:{marker:e.unselected.marker,editType:"calc"},opacity:e.opacity}}),qx=Vt((K,V)=>{V.exports=function(u,d,E,A){A||(A=1/0);var t,e;for(t=0;t{var u=Xr(),d=Gf(),E=d5(),A=nu(),t=Ch(),e=qx(),r=Bx().isOpenSymbol;V.exports=function(o,a,s,f){function v(k,M){return u.coerce(o,a,E,k,M)}var g=d(o,a,{name:"dimensions",handleItemDefaults:i}),m=v("diagonal.visible"),w=v("showupperhalf"),l=v("showlowerhalf"),x=e(a,g,"values");if(!x||!m&&!w&&!l){a.visible=!1;return}v("text"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("xhoverformat"),v("yhoverformat"),t(o,a,s,f,v,{noAngleRef:!0,noStandOff:!0});var y=r(a.marker.symbol),S=A.isBubble(a);v("marker.line.width",y||S?1:0),n(o,a,f,v),u.coerceSelectionMarkerOpacity(a,v)};function i(o,a){function s(v,g){return u.coerce(o,a,E.dimensions,v,g)}s("label");var f=s("values");f&&f.length?s("visible"):a.visible=!1,s("axis.type"),s("axis.matches")}function n(o,a,s,f){var v=a.dimensions,g=v.length,m=a.showupperhalf,w=a.showlowerhalf,l=a.diagonal.visible,x,y,S=new Array(g),k=new Array(g);for(x=0;xy&&m||x{var u=Xr();V.exports=function(d,E){var A=d._fullLayout,t=E.uid,e=A._splomScenes;e||(e=A._splomScenes={});var r={dirty:!0,selectBatch:[],unselectBatch:[]},i={matrix:!1,selectBatch:[],unselectBatch:[]},n=e[E.uid];return n||(n=e[t]=u.extendFlat({},r,i),n.draw=function(){n.matrix&&n.matrix.draw&&(n.selectBatch.length||n.unselectBatch.length?n.matrix.draw(n.unselectBatch,n.selectBatch):n.matrix.draw()),n.dirty=!1},n.destroy=function(){n.matrix&&n.matrix.destroy&&n.matrix.destroy(),n.matrixOptions=null,n.selectBatch=null,n.unselectBatch=null,n=null}),n.dirty||u.extendFlat(n,r),n}}),y9=Vt((K,V)=>{var u=Xr(),d=cc(),E=Vh().calcMarkerSize,A=Vh().calcAxisExpansion,t=jh(),e=C0().markerSelection,r=C0().markerStyle,i=v9(),n=ks().BADNUM,o=Vd().TOO_MANY_POINTS;V.exports=function(a,s){var f=s.dimensions,v=s._length,g={},m=g.cdata=[],w=g.data=[],l=s._visibleDims=[],x,y,S,k,M;function T(P,z){for(var D=P.makeCalcdata({v:z.values,vcalendar:s.calendar},"v"),B=0;Bo,b;for(h?b=g.sizeAvg||Math.max(g.size,3):b=E(s,v),y=0;y{(function(){var u,d,E,A,t,e;typeof performance<"u"&&performance!==null&&performance.now?V.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(V.exports=function(){return(u()-t)/1e6},d=process.hrtime,u=function(){var r;return r=d(),r[0]*1e9+r[1]},A=u(),e=process.uptime()*1e9,t=A-e):Date.now?(V.exports=function(){return Date.now()-E},E=Date.now()):(V.exports=function(){return new Date().getTime()-E},E=new Date().getTime())}).call(K)}),_9=Vt((K,V)=>{var u=x9(),d=window,E=["moz","webkit"],A="AnimationFrame",t=d["request"+A],e=d["cancel"+A]||d["cancelRequest"+A];for(r=0;!t&&r{V.exports=function(u,d){var E=typeof u=="number",A=typeof d=="number";E&&!A?(d=u,u=0):!E&&!A&&(u=0,d=0),u=u|0,d=d|0;var t=d-u;if(t<0)throw new Error("array length must be positive");for(var e=new Array(t),r=0,i=u;r{var u=W3(),d=_p(),E=z0(),A=_9(),t=b9(),e=Km(),r=L0();V.exports=i;function i(s,f){if(!(this instanceof i))return new i(s);this.traces=[],this.passes={},this.regl=s,this.scatter=u(s),this.canvas=this.scatter.canvas}i.prototype.render=function(...s){return s.length&&this.update(...s),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=A(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,A(()=>{this.dirty=!1})),this)},i.prototype.update=function(...s){if(!s.length)return;for(let g=0;g_||!m.lower&&b<_)continue;let P=n(m.id,b,_),z=this.passes[P]||(this.passes[P]={});if(g.data&&(g.transpose?z.positions={x:{buffer:m.buffer,offset:_,count:y,stride:x},y:{buffer:m.buffer,offset:b,count:y,stride:x}}:z.positions={x:{buffer:m.buffer,offset:_*y,count:y},y:{buffer:m.buffer,offset:b*y,count:y}},z.bounds=o(m.bounds,b,_)),g.domain||g.viewport||g.data){let D=l?o(m.padding,b,_):m.padding;if(m.domain){let[B,R,I,F]=o(m.domain,b,_);z.viewport=[M+B*S+D[0],T+R*k+D[1],M+I*S-D[2],T+F*k-D[3]]}else z.viewport=[M+_*c+c*D[0],T+b*h+h*D[1],M+(_+1)*c-c*D[2],T+(b+1)*h-h*D[3]]}g.color&&(z.color=m.color),g.size&&(z.size=m.size),g.marker&&(z.marker=m.marker),g.borderSize&&(z.borderSize=m.borderSize),g.borderColor&&(z.borderColor=m.borderColor),g.opacity&&(z.opacity=m.opacity),g.range&&(z.range=w?o(m.range,b,_):m.range||z.bounds),m.passes.push(P)}return this},i.prototype.draw=function(...s){if(!s.length)this.scatter.draw();else{let f=[];for(let v=0;v{f[w+x]=g})}this.scatter.draw(...f)}return this},i.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function n(s,f,v){let g=s.id!=null?s.id:s,m=f,w=v;return g<<16|(m&255)<<8|w&255}function o(s,f,v){let g,m,w,l,x=s[f],y=s[v];return x.length>2?(x[0],x[2],g=x[1],m=x[3]):x.length?(g=x[0],m=x[1]):(x.x,g=x.y,x.x+x.width,m=x.y+x.height),y.length>2?(w=y[0],l=y[2],y[1],y[3]):y.length?(w=y[0],l=y[1]):(w=y.x,y.y,l=y.x+y.width,y.y+y.height),[w,g,l,m]}function a(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let f=e(s);return[f.x,f.y,f.x+f.width,f.y+f.height]}}}),T9=Vt((K,V)=>{var u=w9(),d=Xr(),E=cc(),A=Jh().selectMode;V.exports=function(e,r,i){if(i.length)for(var n=0;n-1,R=A(m)||!!o.selectedpoints||B,I=!0;if(R){var F=o._length;if(o.selectedpoints){s.selectBatch=o.selectedpoints;var j=o.selectedpoints,N={};for(x=0;x{K.getDimIndex=function(V,u){for(var d=u._id,E=d.charAt(0),A={x:0,y:1}[E],t=V._visibleDims,e=0;e{var u=m5(),d=Fx().calcHover,E=yo().getFromId,A=So().extendFlat;function t(r,i,n,o,a){a||(a={});var s=(o||"").charAt(0)==="x",f=(o||"").charAt(0)==="y",v=e(r,i,n);if((s||f)&&a.hoversubplots==="axis"&&v[0])for(var g=(s?r.xa:r.ya)._subplotsWith,m=a.gd,w=A({},r),l=0;l{var u=Xr(),d=u.pushUnique,E=nu(),A=m5();V.exports=function(t,e){var r=t.cd,i=r[0].trace,n=r[0].t,o=t.scene,a=o.matrixOptions.cdata,s=t.xaxis,f=t.yaxis,v=[];if(!o)return v;var g=!E.hasMarkers(i)&&!E.hasText(i);if(i.visible!==!0||g)return v;var m=A.getDimIndex(i,s),w=A.getDimIndex(i,f);if(m===!1||w===!1)return v;var l=n.xpx[m],x=n.ypx[w],y=a[m],S=a[w],k=(t.scene.selectBatch||[]).slice(),M=[];if(e!==!1&&!e.degenerate)for(var T=0;T{var u=Xr(),d=jh(),E=C0().markerStyle;V.exports=function(A,t){var e=t.trace,r=A._fullLayout._splomScenes[e.uid];if(r){d(A,e),u.extendFlat(r.matrixOptions,E(A,e));var i=u.extendFlat({},r.matrixOptions,r.viewOpts);r.matrix.update(i,null)}}}),S9=Vt((K,V)=>{var u=ji(),d=Zb();V.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:d5(),supplyDefaults:g9(),colorbar:Zf(),calc:y9(),plot:T9(),hoverPoints:k9().hoverPoints,selectPoints:A9(),editStyle:M9(),meta:{}},u.register(d)}),E9=Vt((K,V)=>{var u=n5(),d=ji(),E=Hx(),A=Pf().getModuleCalcData,t=Kc(),e=cc().getFromId,r=yo().shouldShowZeroLine,i="splom",n={};function o(m){var w=m._fullLayout,l=d.getModule(i),x=A(m.calcdata,l)[0],y=E(m,["ANGLE_instanced_arrays","OES_element_index_uint"],n);y&&(w._hasOnlyLargeSploms&&f(m),l.plot(m,{},x))}function a(m){var w=m.calcdata,l=m._fullLayout;l._hasOnlyLargeSploms&&f(m);for(var x=0;x{var u=S9();u.basePlotModule=E9(),V.exports=u}),L9=Vt((K,V)=>{V.exports=z9()}),g5=Vt((K,V)=>{var u=Wl(),d=Of(),E=yu(),A=Vu().attributes,t=So().extendFlat,e=cl().templatedArray;V.exports={domain:A({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:E({editType:"plot"}),tickfont:E({autoShadowDflt:!0,editType:"plot"}),rangefont:E({editType:"plot"}),dimensions:e("dimension",{label:{valType:"string",editType:"plot"},tickvals:t({},d.tickvals,{editType:"plot"}),ticktext:t({},d.ticktext,{editType:"plot"}),tickformat:t({},d.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:t({editType:"calc"},u("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),Iv=Vt((K,V)=>{V.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),bp=Vt((K,V)=>{var u=Og();function d(E){return[E]}V.exports={keyFun:function(E){return E.key},repeat:d,descend:u,wrap:d,unwrap:function(E){return E[0]}}}),v5=Vt((K,V)=>{var u=Iv(),d=Ni(),E=bp().keyFun,A=bp().repeat,t=Xr().sorterAsc,e=Xr().strTranslate,r=u.bar.snapRatio;function i(N,G){return N*(1-r)+G*r}var n=u.bar.snapClose;function o(N,G){return N*(1-n)+G*n}function a(N,G,rt,ct){if(s(rt,ct))return rt;var st=N?-1:1,et=0,Z=G.length-1;if(st<0){var ot=et;et=Z,Z=ot}for(var X=G[et],Q=X,ut=et;st*ut=G[rt][0]&&N<=G[rt][1])return!0;return!1}function f(N){N.attr("x",-u.bar.captureWidth/2).attr("width",u.bar.captureWidth)}function v(N){N.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function g(N){if(!N.brush.filterSpecified)return"0,"+N.height;for(var G=m(N.brush.filter.getConsolidated(),N.height),rt=[0],ct,st,et,Z=G.length?G[0][0]:null,ot=0;otN[1]+rt||G=.9*N[1]+.1*N[0]?"n":G<=.9*N[0]+.1*N[1]?"s":"ns"}function l(){d.select(document.body).style("cursor",null)}function x(N){N.attr("stroke-dasharray",g)}function y(N,G){var rt=d.select(N).selectAll(".highlight, .highlight-shadow"),ct=G?rt.transition().duration(u.bar.snapDuration).each("end",G):rt;x(ct)}function S(N,G){var rt=N.brush,ct=rt.filterSpecified,st=NaN,et={},Z;if(ct){var ot=N.height,X=rt.filter.getConsolidated(),Q=m(X,ot),ut=NaN,J=NaN,q=NaN;for(Z=0;Z<=Q.length;Z++){var it=Q[Z];if(it&&it[0]<=G&&G<=it[1]){ut=Z;break}else if(J=Z?Z-1:NaN,it&&it[0]>G){q=Z;break}}if(st=ut,isNaN(st)&&(isNaN(J)||isNaN(q)?st=isNaN(J)?q:J:st=G-Q[J][1]=Ct[0]&&wt<=Ct[1]){et.clickableOrdinalRange=Ct;break}}}return et}function k(N,G){d.event.sourceEvent.stopPropagation();var rt=G.height-d.mouse(N)[1]-2*u.verticalPadding,ct=G.unitToPaddedPx.invert(rt),st=G.brush,et=S(G,rt),Z=et.interval,ot=st.svgBrush;if(ot.wasDragged=!1,ot.grabbingBar=et.region==="ns",ot.grabbingBar){var X=Z.map(G.unitToPaddedPx);ot.grabPoint=rt-X[0]-u.verticalPadding,ot.barLength=X[1]-X[0]}ot.clickableOrdinalRange=et.clickableOrdinalRange,ot.stayingIntervals=G.multiselect&&st.filterSpecified?st.filter.getConsolidated():[],Z&&(ot.stayingIntervals=ot.stayingIntervals.filter(function(Q){return Q[0]!==Z[0]&&Q[1]!==Z[1]})),ot.startExtent=et.region?Z[et.region==="s"?1:0]:ct,G.parent.inBrushDrag=!0,ot.brushStartCallback()}function M(N,G){d.event.sourceEvent.stopPropagation();var rt=G.height-d.mouse(N)[1]-2*u.verticalPadding,ct=G.brush.svgBrush;ct.wasDragged=!0,ct._dragging=!0,ct.grabbingBar?ct.newExtent=[rt-ct.grabPoint,rt+ct.barLength-ct.grabPoint].map(G.unitToPaddedPx.invert):ct.newExtent=[ct.startExtent,G.unitToPaddedPx.invert(rt)].sort(t),G.brush.filterSpecified=!0,ct.extent=ct.stayingIntervals.concat([ct.newExtent]),ct.brushCallback(G),y(N.parentNode)}function T(N,G){var rt=G.brush,ct=rt.filter,st=rt.svgBrush;st._dragging||(c(N,G),M(N,G),G.brush.svgBrush.wasDragged=!1),st._dragging=!1;var et=d.event;et.sourceEvent.stopPropagation();var Z=st.grabbingBar;if(st.grabbingBar=!1,st.grabLocation=void 0,G.parent.inBrushDrag=!1,l(),!st.wasDragged){st.wasDragged=void 0,st.clickableOrdinalRange?rt.filterSpecified&&G.multiselect?st.extent.push(st.clickableOrdinalRange):(st.extent=[st.clickableOrdinalRange],rt.filterSpecified=!0):Z?(st.extent=st.stayingIntervals,st.extent.length===0&&D(rt)):D(rt),st.brushCallback(G),y(N.parentNode),st.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[]);return}var ot=function(){ct.set(ct.getConsolidated())};if(G.ordinal){var X=G.unitTickvals;X[X.length-1]st.newExtent[0];st.extent=st.stayingIntervals.concat(Q?[st.newExtent]:[]),st.extent.length||D(rt),st.brushCallback(G),Q?y(N.parentNode,ot):(ot(),y(N.parentNode))}else ot();st.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[])}function c(N,G){var rt=G.height-d.mouse(N)[1]-2*u.verticalPadding,ct=S(G,rt),st="crosshair";ct.clickableOrdinalRange?st="pointer":ct.region&&(st=ct.region+"-resize"),d.select(document.body).style("cursor",st)}function h(N){N.on("mousemove",function(G){d.event.preventDefault(),G.parent.inBrushDrag||c(this,G)}).on("mouseleave",function(G){G.parent.inBrushDrag||l()}).call(d.behavior.drag().on("dragstart",function(G){k(this,G)}).on("drag",function(G){M(this,G)}).on("dragend",function(G){T(this,G)}))}function b(N,G){return N[0]-G[0]}function _(N,G,rt){var ct=rt._context.staticPlot,st=N.selectAll(".background").data(A);st.enter().append("rect").classed("background",!0).call(f).call(v).style("pointer-events",ct?"none":"auto").attr("transform",e(0,u.verticalPadding)),st.call(h).attr("height",function(ot){return ot.height-u.verticalPadding});var et=N.selectAll(".highlight-shadow").data(A);et.enter().append("line").classed("highlight-shadow",!0).attr("x",-u.bar.width/2).attr("stroke-width",u.bar.width+u.bar.strokeWidth).attr("stroke",G).attr("opacity",u.bar.strokeOpacity).attr("stroke-linecap","butt"),et.attr("y1",function(ot){return ot.height}).call(x);var Z=N.selectAll(".highlight").data(A);Z.enter().append("line").classed("highlight",!0).attr("x",-u.bar.width/2).attr("stroke-width",u.bar.width-u.bar.strokeWidth).attr("stroke",u.bar.fillColor).attr("opacity",u.bar.fillOpacity).attr("stroke-linecap","butt"),Z.attr("y1",function(ot){return ot.height}).call(x)}function P(N,G,rt){var ct=N.selectAll("."+u.cn.axisBrush).data(A,E);ct.enter().append("g").classed(u.cn.axisBrush,!0),_(ct,G,rt)}function z(N){return N.svgBrush.extent.map(function(G){return G.slice()})}function D(N){N.filterSpecified=!1,N.svgBrush.extent=[[-1/0,1/0]]}function B(N){return function(G){var rt=G.brush,ct=z(rt),st=ct.slice();rt.filter.set(st),N()}}function R(N){for(var G=N.slice(),rt=[],ct,st=G.shift();st;){for(ct=st.slice();(st=G.shift())&&st[0]<=ct[1];)ct[1]=Math.max(ct[1],st[1]);rt.push(ct)}return rt.length===1&&rt[0][0]>rt[0][1]&&(rt=[]),rt}function I(){var N=[],G,rt;return{set:function(ct){N=ct.map(function(st){return st.slice().sort(t)}).sort(b),N.length===1&&N[0][0]===-1/0&&N[0][1]===1/0&&(N=[[0,-1]]),G=R(N),rt=N.reduce(function(st,et){return[Math.min(st[0],et[0]),Math.max(st[1],et[1])]},[1/0,-1/0])},get:function(){return N.slice()},getConsolidated:function(){return G},getBounds:function(){return rt}}}function F(N,G,rt,ct,st,et){var Z=I();return Z.set(rt),{filter:Z,filterSpecified:G,svgBrush:{extent:[],brushStartCallback:ct,brushCallback:B(st),brushEndCallback:et}}}function j(N,G){if(Array.isArray(N[0])?(N=N.map(function(ct){return ct.sort(t)}),G.multiselect?N=R(N.sort(b)):N=[N[0]]):N=[N.sort(t)],G.tickvals){var rt=G.tickvals.slice().sort(t);if(N=N.map(function(ct){var st=[a(0,rt,ct[0],[]),a(1,rt,ct[1],[])];if(st[1]>st[0])return st}).filter(function(ct){return ct}),!N.length)return}return N.length>1?N:N[0]}V.exports={makeBrush:F,ensureAxisBrush:P,cleanRanges:j}}),C9=Vt((K,V)=>{var u=Xr(),d=ah().hasColorscale,E=vf(),A=Vu().defaults,t=Gf(),e=yo(),r=g5(),i=v5(),n=Iv().maxDimensionCount,o=qx();function a(f,v,g,m,w){var l=w("line.color",g);if(d(f,"line")&&u.isArrayOrTypedArray(l)){if(l.length)return w("line.colorscale"),E(f,v,m,w,{prefix:"line.",cLetter:"c"}),l.length;v.line.color=g}return 1/0}function s(f,v,g,m){function w(k,M){return u.coerce(f,v,r.dimensions,k,M)}var l=w("values"),x=w("visible");if(l&&l.length||(x=v.visible=!1),x){w("label"),w("tickvals"),w("ticktext"),w("tickformat");var y=w("range");v._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:y},e.setConvert(v._ax,m.layout),w("multiselect");var S=w("constraintrange");S&&(v.constraintrange=i.cleanRanges(S,v))}}V.exports=function(f,v,g,m){function w(k,M){return u.coerce(f,v,r,k,M)}var l=f.dimensions;Array.isArray(l)&&l.length>n&&(u.log("parcoords traces support up to "+n+" dimensions at the moment"),l.splice(n));var x=t(f,v,{name:"dimensions",layout:m,handleItemDefaults:s}),y=a(f,v,g,m,w);A(v,m,w),(!Array.isArray(x)||!x.length)&&(v.visible=!1),o(v,x,"values",y);var S=u.extendFlat({},m.font,{size:Math.round(m.font.size/1.2)});u.coerceFont(w,"labelfont",S),u.coerceFont(w,"tickfont",S,{autoShadowDflt:!0}),u.coerceFont(w,"rangefont",S),w("labelangle"),w("labelside"),w("unselected.line.color"),w("unselected.line.opacity")}}),I9=Vt((K,V)=>{var u=Xr().isArrayOrTypedArray,d=xu(),E=bp().wrap;V.exports=function(t,e){var r,i;return d.hasColorscale(e,"line")&&u(e.line.color)?(r=e.line.color,i=d.extractOpts(e.line).colorscale,d.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=A(e._length),i=[[0,e.line.color],[1,e.line.color]]),E({lineColor:r,cscale:i})};function A(t){for(var e=new Array(t),r=0;r>>16,(K&65280)>>>8,K&255],alpha:1};if(typeof K=="number")return{space:"rgb",values:[K>>>16,(K&65280)>>>8,K&255],alpha:1};if(K=String(K).toLowerCase(),Wx.default[K])E=Wx.default[K].slice(),t="rgb";else if(K==="transparent")A=0,t="rgb",E=[0,0,0];else if(K[0]==="#"){var e=K.slice(1),r=e.length,i=r<=4;A=1,i?(E=[parseInt(e[0]+e[0],16),parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16)],r===4&&(A=parseInt(e[3]+e[3],16)/255)):(E=[parseInt(e[0]+e[1],16),parseInt(e[2]+e[3],16),parseInt(e[4]+e[5],16)],r===8&&(A=parseInt(e[6]+e[7],16)/255)),E[0]||(E[0]=0),E[1]||(E[1]=0),E[2]||(E[2]=0),t="rgb"}else if(d=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(K)){var n=d[1];t=n.replace(/a$/,"");var o=t==="cmyk"?4:t==="gray"?1:3;E=d[2].trim().split(/\s*[,\/]\s*|\s+/),t==="color"&&(t=E.shift()),E=E.map(function(a,s){if(a[a.length-1]==="%")return a=parseFloat(a)/100,s===3?a:t==="rgb"?a*255:t[0]==="h"||t[0]==="l"&&!s?a*100:t==="lab"?a*125:t==="lch"?s<2?a*150:a*360:t[0]==="o"&&!s?a:t==="oklab"?a*.4:t==="oklch"?s<2?a*.4:a*360:a;if(t[s]==="h"||s===2&&t[t.length-1]==="h"){if(Gx[a]!==void 0)return Gx[a];if(a.endsWith("deg"))return parseFloat(a);if(a.endsWith("turn"))return parseFloat(a)*360;if(a.endsWith("grad"))return parseFloat(a)*360/400;if(a.endsWith("rad"))return parseFloat(a)*180/Math.PI}return a==="none"?0:parseFloat(a)}),A=E.length>o?E.pop():1}else/[0-9](?:\s|\/|,)/.test(K)&&(E=K.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),t=((u=(V=K.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:u.toLowerCase())||"rgb");return{space:t,values:E,alpha:A}}var Wx,y5,Gx,O9=Bl(()=>{Wx=H4(_3()),y5=P9,Gx={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),Pv,x5=Bl(()=>{Pv={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),Ov,D9=Bl(()=>{x5(),Ov={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(K){var V=K[0]/360,u=K[1]/100,d=K[2]/100,E,A,t,e,r,i=0;if(u===0)return r=d*255,[r,r,r];for(A=d<.5?d*(1+u):d+u-d*u,E=2*d-A,e=[0,0,0];i<3;)t=V+1/3*-(i-1),t<0?t++:t>1&&t--,r=6*t<1?E+(A-E)*6*t:2*t<1?A:3*t<2?E+(A-E)*(2/3-t)*6:E,e[i++]=r*255;return e}},Pv.hsl=function(K){var V=K[0]/255,u=K[1]/255,d=K[2]/255,E=Math.min(V,u,d),A=Math.max(V,u,d),t=A-E,e,r,i;return A===E?e=0:V===A?e=(u-d)/t:u===A?e=2+(d-V)/t:d===A&&(e=4+(V-u)/t),e=Math.min(e*60,360),e<0&&(e+=360),i=(E+A)/2,A===E?r=0:i<=.5?r=t/(A+E):r=t/(2-A-E),[e,r*100,i*100]}}),_5={};Z_(_5,{default:()=>F9});function F9(K){Array.isArray(K)&&K.raw&&(K=String.raw(...arguments)),K instanceof Number&&(K=+K);var V,u=y5(K);if(!u.space)return[];let d=u.space[0]==="h"?Ov.min:Pv.min,E=u.space[0]==="h"?Ov.max:Pv.max;return V=Array(3),V[0]=Math.min(Math.max(u.values[0],d[0]),E[0]),V[1]=Math.min(Math.max(u.values[1],d[1]),E[1]),V[2]=Math.min(Math.max(u.values[2],d[2]),E[2]),u.space[0]==="h"&&(V=Ov.rgb(V)),V.push(Math.min(Math.max(u.alpha,0),1)),V}var B9=Bl(()=>{O9(),x5(),D9()}),b5=Vt(K=>{var V=Xr().isTypedArray;K.convertTypedArray=function(u){return V(u)?Array.prototype.slice.call(u):u},K.isOrdinal=function(u){return!!u.tickvals},K.isVisible=function(u){return u.visible||!("visible"in u)}}),R9=Vt((K,V)=>{var u=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` -`),d=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),E=Iv().maxDimensionCount,A=Xr(),t=1e-6,e=2048,r=new Uint8Array(4),i=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function o(T){T.read({x:0,y:0,width:1,height:1,data:r})}function a(T,c,h,b,_){var P=T._gl;P.enable(P.SCISSOR_TEST),P.scissor(c,h,b,_),T.clear({color:[0,0,0,0],depth:1})}function s(T,c,h,b,_,P){var z=P.key;function D(B){var R=Math.min(b,_-B*b);B===0&&(window.cancelAnimationFrame(h.currentRafs[z]),delete h.currentRafs[z],a(T,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!h.clearOnly&&(P.count=2*R,P.offset=2*B*b,c(P),B*b+R<_&&(h.currentRafs[z]=window.requestAnimationFrame(function(){D(B+1)})),h.drawCompleted=!1)}h.drawCompleted||(o(T),h.drawCompleted=!0),D(0)}function f(T){return Math.max(t,Math.min(1-t,T))}function v(T,c){for(var h=new Array(256),b=0;b<256;b++)h[b]=T(b/255).concat(c);return h}function g(T,c){return(T>>>8*c)%256/255}function m(T,c,h){for(var b=new Array(T*(E+4)),_=0,P=0;PIt&&(It=J[dt].dim1.canvasX,wt=dt);nt===0&&a(_,0,0,R.canvasWidth,R.canvasHeight);var Nt=Z(h);for(dt=0;dt{var u=Ni(),d=Xr(),E=d.isArrayOrTypedArray,A=d.numberFormat,t=(B9(),yd(_5)).default,e=yo(),r=d.strRotate,i=d.strTranslate,n=Dl(),o=Eo(),a=xu(),s=bp(),f=s.keyFun,v=s.repeat,g=s.unwrap,m=b5(),w=Iv(),l=v5(),x=R9();function y(ct,st,et){return d.aggNums(ct,null,st,et)}function S(ct,st){return M(y(Math.min,ct,st),y(Math.max,ct,st))}function k(ct){var st=ct.range;return st?M(st[0],st[1]):S(ct.values,ct._length)}function M(ct,st){return(isNaN(ct)||!isFinite(ct))&&(ct=0),(isNaN(st)||!isFinite(st))&&(st=0),ct===st&&(ct===0?(ct-=1,st+=1):(ct*=.9,st*=1.1)),[ct,st]}function T(ct,st){return st?function(et,Z){var ot=st[Z];return ot??ct(et)}:ct}function c(ct,st,et,Z,ot){var X=k(et);return Z?u.scale.ordinal().domain(Z.map(T(A(et.tickformat),ot))).range(Z.map(function(Q){var ut=(Q-X[0])/(X[1]-X[0]);return ct-st+ut*(2*st-ct)})):u.scale.linear().domain(X).range([ct-st,st])}function h(ct,st){return u.scale.linear().range([st,ct-st])}function b(ct,st){return u.scale.linear().domain(k(ct)).range([st,1-st])}function _(ct){if(ct.tickvals){var st=k(ct);return u.scale.ordinal().domain(ct.tickvals).range(ct.tickvals.map(function(et){return(et-st[0])/(st[1]-st[0])}))}}function P(ct){var st=ct.map(function(X){return X[0]}),et=ct.map(function(X){var Q=t(X[1]);return u.rgb("rgb("+Q[0]+","+Q[1]+","+Q[2]+")")}),Z=function(X){return function(Q){return Q[X]}},ot="rgb".split("").map(function(X){return u.scale.linear().clamp(!0).domain(st).range(et.map(Z(X)))});return function(X){return ot.map(function(Q){return Q(X)})}}function z(ct){return ct.dimensions.some(function(st){return st.brush.filterSpecified})}function D(ct,st,et){var Z=g(st),ot=Z.trace,X=m.convertTypedArray(Z.lineColor),Q=ot.line,ut={color:t(ot.unselected.line.color),opacity:ot.unselected.line.opacity},J=a.extractOpts(Q),q=J.reversescale?a.flipScale(Z.cscale):Z.cscale,it=ot.domain,nt=ot.dimensions,dt=ct.width,Tt=ot.labelangle,wt=ot.labelside,Ct=ot.labelfont,It=ot.tickfont,Nt=ot.rangefont,te=d.extendDeepNoArrays({},Q,{color:X.map(u.scale.linear().domain(k({values:X,range:[J.min,J.max],_length:ot._length}))),blockLineCount:w.blockLineCount,canvasOverdrag:w.overdrag*w.canvasPixelRatio}),Jt=Math.floor(dt*(it.x[1]-it.x[0])),ee=Math.floor(ct.height*(it.y[1]-it.y[0])),Zt=ct.margin||{l:80,r:80,t:100,b:80},mt=Jt,bt=ee;return{key:et,colCount:nt.filter(m.isVisible).length,dimensions:nt,tickDistance:w.tickDistance,unitToColor:P(q),lines:te,deselectedLines:ut,labelAngle:Tt,labelSide:wt,labelFont:Ct,tickFont:It,rangeFont:Nt,layoutWidth:dt,layoutHeight:ct.height,domain:it,translateX:it.x[0]*dt,translateY:ct.height-it.y[1]*ct.height,pad:Zt,canvasWidth:mt*w.canvasPixelRatio+2*te.canvasOverdrag,canvasHeight:bt*w.canvasPixelRatio,width:mt,height:bt,canvasPixelRatio:w.canvasPixelRatio}}function B(ct,st,et){var Z=et.width,ot=et.height,X=et.dimensions,Q=et.canvasPixelRatio,ut=function(dt){return Z*dt/Math.max(1,et.colCount-1)},J=w.verticalPadding/ot,q=h(ot,w.verticalPadding),it={key:et.key,xScale:ut,model:et,inBrushDrag:!1},nt={};return it.dimensions=X.filter(m.isVisible).map(function(dt,Tt){var wt=b(dt,J),Ct=nt[dt.label];nt[dt.label]=(Ct||0)+1;var It=dt.label+(Ct?"__"+Ct:""),Nt=dt.constraintrange,te=Nt&&Nt.length;te&&!E(Nt[0])&&(Nt=[Nt]);var Jt=te?Nt.map(function(Me){return Me.map(wt)}):[[-1/0,1/0]],ee=function(){var Me=it;Me.focusLayer&&Me.focusLayer.render(Me.panels,!0);var Ce=z(Me);!ct.contextShown()&&Ce?(Me.contextLayer&&Me.contextLayer.render(Me.panels,!0),ct.contextShown(!0)):ct.contextShown()&&!Ce&&(Me.contextLayer&&Me.contextLayer.render(Me.panels,!0,!0),ct.contextShown(!1))},Zt=dt.values;Zt.length>dt._length&&(Zt=Zt.slice(0,dt._length));var mt=dt.tickvals,bt;function vt(Me,Ce){return{val:Me,text:bt[Ce]}}function Ut(Me,Ce){return Me.val-Ce.val}if(E(mt)&&mt.length){d.isTypedArray(mt)&&(mt=Array.from(mt)),bt=dt.ticktext,!E(bt)||!bt.length?bt=mt.map(A(dt.tickformat)):bt.length>mt.length?bt=bt.slice(0,mt.length):mt.length>bt.length&&(mt=mt.slice(0,bt.length));for(var re=1;re=Me||vr>=Ce)return;var _r=Kt.lineLayer.readPixel(qe,Ce-1-vr),er=_r[3]!==0,Mr=er?_r[2]+256*(_r[1]+256*_r[0]):null,Ir={x:qe,y:vr,clientX:ue.clientX,clientY:ue.clientY,dataIndex:Kt.model.key,curveNumber:Mr};Mr!==Tt&&(er?Z.hover(Ir):Z.unhover&&Z.unhover(Ir),Tt=Mr)}}),dt.style("opacity",function(Kt){return Kt.pick?0:1}),Q.style("background","rgba(255, 255, 255, 0)");var Ct=Q.selectAll("."+w.cn.parcoords).data(nt,f);Ct.exit().remove(),Ct.enter().append("g").classed(w.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ct.attr("transform",function(Kt){return i(Kt.model.translateX,Kt.model.translateY)});var It=Ct.selectAll("."+w.cn.parcoordsControlView).data(v,f);It.enter().append("g").classed(w.cn.parcoordsControlView,!0),It.attr("transform",function(Kt){return i(Kt.model.pad.l,Kt.model.pad.t)});var Nt=It.selectAll("."+w.cn.yAxis).data(function(Kt){return Kt.dimensions},f);Nt.enter().append("g").classed(w.cn.yAxis,!0),It.each(function(Kt){j(Nt,Kt,J)}),dt.each(function(Kt){if(Kt.viewModel){!Kt.lineLayer||Z?Kt.lineLayer=x(this,Kt):Kt.lineLayer.update(Kt),(Kt.key||Kt.key===0)&&(Kt.viewModel[Kt.key]=Kt.lineLayer);var ue=!Kt.context||Z;Kt.lineLayer.render(Kt.viewModel.panels,ue)}}),Nt.attr("transform",function(Kt){return i(Kt.xScale(Kt.xIndex),0)}),Nt.call(u.behavior.drag().origin(function(Kt){return Kt}).on("drag",function(Kt){var ue=Kt.parent;it.linePickActive(!1),Kt.x=Math.max(-w.overdrag,Math.min(Kt.model.width+w.overdrag,u.event.x)),Kt.canvasX=Kt.x*Kt.model.canvasPixelRatio,Nt.sort(function(Me,Ce){return Me.x-Ce.x}).each(function(Me,Ce){Me.xIndex=Ce,Me.x=Kt===Me?Me.x:Me.xScale(Me.xIndex),Me.canvasX=Me.x*Me.model.canvasPixelRatio}),j(Nt,ue,J),Nt.filter(function(Me){return Math.abs(Kt.xIndex-Me.xIndex)!==0}).attr("transform",function(Me){return i(Me.xScale(Me.xIndex),0)}),u.select(this).attr("transform",i(Kt.x,0)),Nt.each(function(Me,Ce,We){We===Kt.parent.key&&(ue.dimensions[Ce]=Me)}),ue.contextLayer&&ue.contextLayer.render(ue.panels,!1,!z(ue)),ue.focusLayer.render&&ue.focusLayer.render(ue.panels)}).on("dragend",function(Kt){var ue=Kt.parent;Kt.x=Kt.xScale(Kt.xIndex),Kt.canvasX=Kt.x*Kt.model.canvasPixelRatio,j(Nt,ue,J),u.select(this).attr("transform",function(Me){return i(Me.x,0)}),ue.contextLayer&&ue.contextLayer.render(ue.panels,!1,!z(ue)),ue.focusLayer&&ue.focusLayer.render(ue.panels),ue.pickLayer&&ue.pickLayer.render(ue.panels,!0),it.linePickActive(!0),Z&&Z.axesMoved&&Z.axesMoved(ue.key,ue.dimensions.map(function(Me){return Me.crossfilterDimensionIndex}))})),Nt.exit().remove();var te=Nt.selectAll("."+w.cn.axisOverlays).data(v,f);te.enter().append("g").classed(w.cn.axisOverlays,!0),te.selectAll("."+w.cn.axis).remove();var Jt=te.selectAll("."+w.cn.axis).data(v,f);Jt.enter().append("g").classed(w.cn.axis,!0),Jt.each(function(Kt){var ue=Kt.model.height/Kt.model.tickDistance,Me=Kt.domainScale,Ce=Me.domain();u.select(this).call(u.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(ue,Kt.tickFormat).tickValues(Kt.ordinal?Ce:null).tickFormat(function(We){return m.isOrdinal(Kt)?We:G(Kt.model.dimensions[Kt.visibleIndex],We)}).scale(Me)),o.font(Jt.selectAll("text"),Kt.model.tickFont)}),Jt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Jt.selectAll("text").style("cursor","default");var ee=te.selectAll("."+w.cn.axisHeading).data(v,f);ee.enter().append("g").classed(w.cn.axisHeading,!0);var Zt=ee.selectAll("."+w.cn.axisTitle).data(v,f);Zt.enter().append("text").classed(w.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ot?"none":"auto"),Zt.text(function(Kt){return Kt.label}).each(function(Kt){var ue=u.select(this);o.font(ue,Kt.model.labelFont),n.convertToTspans(ue,ct)}).attr("transform",function(Kt){var ue=F(Kt.model.labelAngle,Kt.model.labelSide),Me=w.axisTitleOffset;return(ue.dir>0?"":i(0,2*Me+Kt.model.height))+r(ue.degrees)+i(-Me*ue.dx,-Me*ue.dy)}).attr("text-anchor",function(Kt){var ue=F(Kt.model.labelAngle,Kt.model.labelSide),Me=Math.abs(ue.dx),Ce=Math.abs(ue.dy);return 2*Me>Ce?ue.dir*ue.dx<0?"start":"end":"middle"});var mt=te.selectAll("."+w.cn.axisExtent).data(v,f);mt.enter().append("g").classed(w.cn.axisExtent,!0);var bt=mt.selectAll("."+w.cn.axisExtentTop).data(v,f);bt.enter().append("g").classed(w.cn.axisExtentTop,!0),bt.attr("transform",i(0,-w.axisExtentOffset));var vt=bt.selectAll("."+w.cn.axisExtentTopText).data(v,f);vt.enter().append("text").classed(w.cn.axisExtentTopText,!0).call(R),vt.text(function(Kt){return rt(Kt,!0)}).each(function(Kt){o.font(u.select(this),Kt.model.rangeFont)});var Ut=mt.selectAll("."+w.cn.axisExtentBottom).data(v,f);Ut.enter().append("g").classed(w.cn.axisExtentBottom,!0),Ut.attr("transform",function(Kt){return i(0,Kt.model.height+w.axisExtentOffset)});var re=Ut.selectAll("."+w.cn.axisExtentBottomText).data(v,f);re.enter().append("text").classed(w.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(R),re.text(function(Kt){return rt(Kt,!1)}).each(function(Kt){o.font(u.select(this),Kt.model.rangeFont)}),l.ensureAxisBrush(te,q,ct)}}),w5=Vt((r,V)=>{var u=N9(),d=Hx(),E=b5().isVisible,A={};function t(i,n,o){var a=n.indexOf(o),s=i.indexOf(a);return s===-1&&(s+=n.length),s}function e(i,n){return function(o,a){return t(i,n,o)-t(i,n,a)}}var r=V.exports=function(i,n){var o=i._fullLayout,a=d(i,[],A);if(a){var s={},f={},v={},g={},m=o._size;n.forEach(function(S,k){var M=S[0].trace;v[k]=M.index;var T=g[k]=M.index;s[k]=i.data[T].dimensions,f[k]=i.data[T].dimensions.slice()});var w=function(S,k,M){var T=f[S][k],c=M.map(function(D){return D.slice()}),h="dimensions["+k+"].constraintrange",b=o._tracePreGUI[i._fullData[v[S]]._fullInput.uid];if(b[h]===void 0){var _=T.constraintrange;b[h]=_||null}var P=i._fullData[v[S]].dimensions[k];c.length?(c.length===1&&(c=c[0]),T.constraintrange=c,P.constraintrange=c.slice(),c=[c]):(delete T.constraintrange,delete P.constraintrange,c=null);var z={};z[h]=c,i.emit("plotly_restyle",[z,[g[S]]])},l=function(S){i.emit("plotly_hover",S)},x=function(S){i.emit("plotly_unhover",S)},y=function(S,k){var M=e(k,f[S].filter(E));s[S].sort(M),f[S].filter(function(T){return!E(T)}).sort(function(T){return f[S].indexOf(T)}).forEach(function(T){s[S].splice(s[S].indexOf(T),1),s[S].splice(f[S].indexOf(T),0,T)}),i.emit("plotly_restyle",[{dimensions:[s[S]]},[g[S]]])};u(i,n,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{filterChanged:w,hover:l,unhover:x,axesMoved:y})}};r.reglPrecompiled=A}),j9=Vt(K=>{var V=Ni(),u=Pf().getModuleCalcData,d=w5(),E=Lh();K.name="parcoords",K.plot=function(A){var t=u(A.calcdata,"parcoords")[0];t.length&&d(A,t)},K.clean=function(A,t,e,r){var i=r._has&&r._has("parcoords"),n=t._has&&t._has("parcoords");i&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},K.toSVG=function(A){var t=A._fullLayout._glimages,e=V.select(A).selectAll(".svg-container"),r=e.filter(function(n,o){return o===e.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function i(){var n=this,o=n.toDataURL("image/png"),a=t.append("svg:image");a.attr({xmlns:E.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(i),window.setTimeout(function(){V.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),U9=Vt((K,V)=>{V.exports={attributes:g5(),supplyDefaults:C9(),calc:I9(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:j9(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),V9=Vt((K,V)=>{var u=U9();u.plot=w5(),V.exports=u}),H9=Vt((K,V)=>{V.exports=V9()}),T5=Vt((K,V)=>{var u=So().extendFlat,d=kl(),E=yu(),A=Wl(),{hovertemplateAttrs:t,templatefallbackAttrs:e}=yl(),r=Vu().attributes,i=u({editType:"calc"},A("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:e({editType:"plot"})});V.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:u({},d.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:e({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:E({editType:"calc"}),tickfont:E({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:i,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),q9=Vt((K,V)=>{var u=Xr(),d=ah().hasColorscale,E=vf(),A=Vu().defaults,t=Gf(),e=T5(),r=qx(),i=nh().isTypedArraySpec;function n(a,s,f,v,g){g("line.shape"),g("line.hovertemplate"),g("line.hovertemplatefallback");var m=g("line.color",v.colorway[0]);if(d(a,"line")&&u.isArrayOrTypedArray(m)){if(m.length)return g("line.colorscale"),E(a,s,v,g,{prefix:"line.",cLetter:"c"}),m.length;s.line.color=f}return 1/0}function o(a,s){function f(y,S){return u.coerce(a,s,e.dimensions,y,S)}var v=f("values"),g=f("visible");if(v&&v.length||(g=s.visible=!1),g){f("label"),f("displayindex",s._index);var m=a.categoryarray,w=u.isArrayOrTypedArray(m)&&m.length>0||i(m),l;w&&(l="array");var x=f("categoryorder",l);x==="array"?(f("categoryarray"),f("ticktext")):(delete a.categoryarray,delete a.ticktext),!w&&x==="array"&&(s.categoryorder="trace")}}V.exports=function(a,s,f,v){function g(x,y){return u.coerce(a,s,e,x,y)}var m=t(a,s,{name:"dimensions",handleItemDefaults:o}),w=n(a,s,f,v,g);A(s,v,g),(!Array.isArray(m)||!m.length)&&(s.visible=!1),r(s,m,"values",w),g("hoveron"),g("hovertemplate"),g("hovertemplatefallback"),g("arrangement"),g("bundlecolors"),g("sortpaths"),g("counts");var l=v.font;u.coerceFont(g,"labelfont",l,{overrideDflt:{size:Math.round(l.size)}}),u.coerceFont(g,"tickfont",l,{autoShadowDflt:!0,overrideDflt:{size:Math.round(l.size/1.2)}})}}),W9=Vt((K,V)=>{var u=bp().wrap,d=ah().hasColorscale,E=ih(),A=nb(),t=Eo(),e=Xr(),r=Lo();V.exports=function(l,x){var y=e.filterVisible(x.dimensions);if(y.length===0)return[];var S=y.map(function(et){var Z;if(et.categoryorder==="trace")Z=null;else if(et.categoryorder==="array")Z=et.categoryarray;else{Z=A(et.values);for(var ot=!0,X=0;X=l.length||x[l[y]]!==void 0)return!1;x[l[y]]=!0}return!0}}),G9=Vt((K,V)=>{var u=Ni(),d=(M0(),yd(Bd)).interpolateNumber,E=$y(),A=hc(),t=Xr(),e=t.strTranslate,r=Eo(),i=Af(),n=Dl();function o(Q,ut,J,q){var it=ut._context.staticPlot,nt=Q.map(st.bind(0,ut,J)),dt=q.selectAll("g.parcatslayer").data([null]);dt.enter().append("g").attr("class","parcatslayer").style("pointer-events",it?"none":"all");var Tt=dt.selectAll("g.trace.parcats").data(nt,a),wt=Tt.enter().append("g").attr("class","trace parcats");Tt.attr("transform",function(vt){return e(vt.x,vt.y)}),wt.append("g").attr("class","paths");var Ct=Tt.select("g.paths"),It=Ct.selectAll("path.path").data(function(vt){return vt.paths},a);It.attr("fill",function(vt){return vt.model.color});var Nt=It.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(vt){return vt.model.color}).attr("fill-opacity",0);x(Nt),It.attr("d",function(vt){return vt.svgD}),Nt.empty()||It.sort(f),It.exit().remove(),It.on("mouseover",v).on("mouseout",g).on("click",l),wt.append("g").attr("class","dimensions");var te=Tt.select("g.dimensions"),Jt=te.selectAll("g.dimension").data(function(vt){return vt.dimensions},a);Jt.enter().append("g").attr("class","dimension"),Jt.attr("transform",function(vt){return e(vt.x,0)}),Jt.exit().remove();var ee=Jt.selectAll("g.category").data(function(vt){return vt.categories},a),Zt=ee.enter().append("g").attr("class","category");ee.attr("transform",function(vt){return e(0,vt.y)}),Zt.append("rect").attr("class","catrect").attr("pointer-events","none"),ee.select("rect.catrect").attr("fill","none").attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}),k(Zt);var mt=ee.selectAll("rect.bandrect").data(function(vt){return vt.bands},a);mt.each(function(){t.raiseToTop(this)}),mt.attr("fill",function(vt){return vt.color});var bt=mt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(vt){return vt.color}).attr("fill-opacity",0);mt.attr("fill",function(vt){return vt.color}).attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}).attr("y",function(vt){return vt.y}).attr("cursor",function(vt){return vt.parcatsViewModel.arrangement==="fixed"?"default":vt.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),T(bt),mt.exit().remove(),Zt.append("text").attr("class","catlabel").attr("pointer-events","none"),ee.select("text.catlabel").attr("text-anchor",function(vt){return s(vt)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(vt){return s(vt)?vt.width+5:-5}).attr("y",function(vt){return vt.height/2}).text(function(vt){return vt.model.categoryLabel}).each(function(vt){r.font(u.select(this),vt.parcatsViewModel.categorylabelfont),n.convertToTspans(u.select(this),ut)}),Zt.append("text").attr("class","dimlabel"),ee.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(vt){return vt.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(vt){return vt.width/2}).attr("y",-5).text(function(vt,Ut){return Ut===0?vt.parcatsViewModel.model.dimensions[vt.model.dimensionInd].dimensionLabel:null}).each(function(vt){r.font(u.select(this),vt.parcatsViewModel.labelfont)}),ee.selectAll("rect.bandrect").on("mouseover",R).on("mouseout",I),ee.exit().remove(),Jt.call(u.behavior.drag().origin(function(vt){return{x:vt.x,y:0}}).on("dragstart",F).on("drag",j).on("dragend",N)),Tt.each(function(vt){vt.traceSelection=u.select(this),vt.pathSelection=u.select(this).selectAll("g.paths").selectAll("path.path"),vt.dimensionSelection=u.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Tt.exit().remove()}V.exports=function(Q,ut,J,q){o(J,Q,q,ut)};function a(Q){return Q.key}function s(Q){var ut=Q.parcatsViewModel.dimensions.length,J=Q.parcatsViewModel.dimensions[ut-1].model.dimensionInd;return Q.model.dimensionInd===J}function f(Q,ut){return Q.model.rawColor>ut.model.rawColor?1:Q.model.rawColor"),ue=u.mouse(it)[0];A.loneHover({trace:nt,x:ee-Tt.left+wt.left,y:Zt-Tt.top+wt.top,text:Kt,color:Q.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:mt,idealAlign:ue1&&Ct.displayInd===wt.dimensions.length-1?(te=dt.left,Jt="left"):(te=dt.left+dt.width,Jt="right");var ee=Tt.model.count,Zt=Tt.model.categoryLabel,mt=ee/Tt.parcatsViewModel.model.count,bt={countLabel:ee,categoryLabel:Zt,probabilityLabel:mt.toFixed(3)},vt=[];Tt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&vt.push(["Count:",bt.countLabel].join(" ")),Tt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&vt.push(["P("+bt.categoryLabel+"):",bt.probabilityLabel].join(" "));var Ut=vt.join("
                ");return{trace:It,x:q*(te-ut.left),y:it*(Nt-ut.top),text:Ut,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Jt,hovertemplate:It.hovertemplate,hovertemplateLabels:bt,eventData:[{data:It._input,fullData:It,count:ee,category:Zt,probability:mt}]}}function D(Q,ut,J){var q=[];return u.select(J.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var it=this;q.push(z(Q,ut,it))}),q}function B(Q,ut,J){Q._fullLayout._calcInverseTransform(Q);var q=Q._fullLayout._invScaleX,it=Q._fullLayout._invScaleY,nt=J.getBoundingClientRect(),dt=u.select(J).datum(),Tt=dt.categoryViewModel,wt=Tt.parcatsViewModel,Ct=wt.model.dimensions[Tt.model.dimensionInd],It=wt.trace,Nt=nt.y+nt.height/2,te,Jt;wt.dimensions.length>1&&Ct.displayInd===wt.dimensions.length-1?(te=nt.left,Jt="left"):(te=nt.left+nt.width,Jt="right");var ee=Tt.model.categoryLabel,Zt=dt.parcatsViewModel.model.count,mt=0;dt.categoryViewModel.bands.forEach(function(qe){qe.color===dt.color&&(mt+=qe.count)});var bt=Tt.model.count,vt=0;wt.pathSelection.each(function(qe){qe.model.color===dt.color&&(vt+=qe.model.count)});var Ut=mt/Zt,re=mt/vt,Kt=mt/bt,ue={countLabel:mt,categoryLabel:ee,probabilityLabel:Ut.toFixed(3)},Me=[];Tt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Me.push(["Count:",ue.countLabel].join(" ")),Tt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Me.push("P(color ∩ "+ee+"): "+ue.probabilityLabel),Me.push("P("+ee+" | color): "+re.toFixed(3)),Me.push("P(color | "+ee+"): "+Kt.toFixed(3)));var Ce=Me.join("
                "),We=i.mostReadable(dt.color,["black","white"]);return{trace:It,x:q*(te-ut.left),y:it*(Nt-ut.top),text:Ce,color:dt.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:We,fontSize:10,idealAlign:Jt,hovertemplate:It.hovertemplate,hovertemplateLabels:ue,eventData:[{data:It._input,fullData:It,category:ee,count:Zt,probability:Ut,categorycount:bt,colorcount:vt,bandcolorcount:mt}]}}function R(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ut=u.mouse(this)[1];if(ut<-1)return;var J=Q.parcatsViewModel.graphDiv,q=J._fullLayout,it=q._paperdiv.node().getBoundingClientRect(),nt=Q.parcatsViewModel.hoveron,dt=this;if(nt==="color"?(b(dt),P(dt,"plotly_hover",u.event)):(h(dt),_(dt,"plotly_hover",u.event)),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Tt;nt==="category"?Tt=z(J,it,dt):nt==="color"?Tt=B(J,it,dt):nt==="dimension"&&(Tt=D(J,it,dt)),Tt&&A.loneHover(Tt,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:J})}}}function I(Q){var ut=Q.parcatsViewModel;if(!ut.dragDimension&&(x(ut.pathSelection),k(ut.dimensionSelection.selectAll("g.category")),T(ut.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),A.loneUnhover(ut.graphDiv._fullLayout._hoverlayer.node()),ut.pathSelection.sort(f),ut.hoverinfoItems.indexOf("skip")===-1)){var J=Q.parcatsViewModel.hoveron,q=this;J==="color"?P(q,"plotly_unhover",u.event):_(q,"plotly_unhover",u.event)}}function F(Q){Q.parcatsViewModel.arrangement!=="fixed"&&(Q.dragDimensionDisplayInd=Q.model.displayInd,Q.initialDragDimensionDisplayInds=Q.parcatsViewModel.model.dimensions.map(function(ut){return ut.displayInd}),Q.dragHasMoved=!1,Q.dragCategoryDisplayInd=null,u.select(this).selectAll("g.category").select("rect.catrect").each(function(ut){var J=u.mouse(this)[0],q=u.mouse(this)[1];-2<=J&&J<=ut.width+2&&-2<=q&&q<=ut.height+2&&(Q.dragCategoryDisplayInd=ut.model.displayInd,Q.initialDragCategoryDisplayInds=Q.model.categories.map(function(it){return it.displayInd}),ut.model.dragY=ut.y,t.raiseToTop(this.parentNode),u.select(this.parentNode).selectAll("rect.bandrect").each(function(it){it.yIt.y+It.height/2&&(nt.model.displayInd=It.model.displayInd,It.model.displayInd=Tt),Q.dragCategoryDisplayInd=nt.model.displayInd}if(Q.dragCategoryDisplayInd===null||Q.parcatsViewModel.arrangement==="freeform"){it.model.dragX=u.event.x;var Nt=Q.parcatsViewModel.dimensions[J],te=Q.parcatsViewModel.dimensions[q];Nt!==void 0&&it.model.dragXte.x&&(it.model.displayInd=te.model.displayInd,te.model.displayInd=Q.dragDimensionDisplayInd),Q.dragDimensionDisplayInd=it.model.displayInd}ot(Q.parcatsViewModel),Z(Q.parcatsViewModel),ct(Q.parcatsViewModel),rt(Q.parcatsViewModel)}}function N(Q){if(Q.parcatsViewModel.arrangement!=="fixed"&&Q.dragDimensionDisplayInd!==null){u.select(this).selectAll("text").attr("font-weight","normal");var ut={},J=G(Q.parcatsViewModel),q=Q.parcatsViewModel.model.dimensions.map(function(te){return te.displayInd}),it=Q.initialDragDimensionDisplayInds.some(function(te,Jt){return te!==q[Jt]});it&&q.forEach(function(te,Jt){var ee=Q.parcatsViewModel.model.dimensions[Jt].containerInd;ut["dimensions["+ee+"].displayindex"]=te});var nt=!1;if(Q.dragCategoryDisplayInd!==null){var dt=Q.model.categories.map(function(te){return te.displayInd});if(nt=Q.initialDragCategoryDisplayInds.some(function(te,Jt){return te!==dt[Jt]}),nt){var Tt=Q.model.categories.slice().sort(function(te,Jt){return te.displayInd-Jt.displayInd}),wt=Tt.map(function(te){return te.categoryValue}),Ct=Tt.map(function(te){return te.categoryLabel});ut["dimensions["+Q.model.containerInd+"].categoryarray"]=[wt],ut["dimensions["+Q.model.containerInd+"].ticktext"]=[Ct],ut["dimensions["+Q.model.containerInd+"].categoryorder"]="array"}}if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!Q.dragHasMoved&&Q.potentialClickBand&&(Q.parcatsViewModel.hoveron==="color"?P(Q.potentialClickBand,"plotly_click",u.event.sourceEvent):_(Q.potentialClickBand,"plotly_click",u.event.sourceEvent)),Q.model.dragX=null,Q.dragCategoryDisplayInd!==null){var It=Q.parcatsViewModel.dimensions[Q.dragDimensionDisplayInd].categories[Q.dragCategoryDisplayInd];It.model.dragY=null,Q.dragCategoryDisplayInd=null}Q.dragDimensionDisplayInd=null,Q.parcatsViewModel.dragDimension=null,Q.dragHasMoved=null,Q.potentialClickBand=null,ot(Q.parcatsViewModel),Z(Q.parcatsViewModel);var Nt=u.transition().duration(300).ease("cubic-in-out");Nt.each(function(){ct(Q.parcatsViewModel,!0),rt(Q.parcatsViewModel,!0)}).each("end",function(){(it||nt)&&E.restyle(Q.parcatsViewModel.graphDiv,ut,[J])})}}function G(Q){for(var ut,J=Q.graphDiv._fullData,q=0;q=0;wt--)Ct+="C"+dt[wt]+","+(ut[wt+1]+q)+" "+nt[wt]+","+(ut[wt]+q)+" "+(Q[wt]+J[wt])+","+(ut[wt]+q),Ct+="l-"+J[wt]+",0 ";return Ct+="Z",Ct}function Z(Q){var ut=Q.dimensions,J=Q.model,q=ut.map(function(er){return er.categories.map(function(Mr){return Mr.y})}),it=Q.model.dimensions.map(function(er){return er.categories.map(function(Mr){return Mr.displayInd})}),nt=Q.model.dimensions.map(function(er){return er.displayInd}),dt=Q.dimensions.map(function(er){return er.model.dimensionInd}),Tt=ut.map(function(er){return er.x}),wt=ut.map(function(er){return er.width}),Ct=[];for(var It in J.paths)J.paths.hasOwnProperty(It)&&Ct.push(J.paths[It]);function Nt(er){var Mr=er.categoryInds.map(function(de,Dt){return it[Dt][de]}),Ir=dt.map(function(de){return Mr[de]});return Ir}Ct.sort(function(er,Mr){var Ir=Nt(er),de=Nt(Mr);return Q.sortpaths==="backward"&&(Ir.reverse(),de.reverse()),Ir.push(er.valueInds[0]),de.push(Mr.valueInds[0]),Q.bundlecolors&&(Ir.unshift(er.rawColor),de.unshift(Mr.rawColor)),Irde?1:0});for(var te=new Array(Ct.length),Jt=ut[0].model.count,ee=ut[0].categories.map(function(er){return er.height}).reduce(function(er,Mr){return er+Mr}),Zt=0;Zt0?bt=ee*(mt.count/Jt):bt=0;for(var vt=new Array(q.length),Ut=0;Ut1?dt=(Q.width-2*J-q)/(it-1):dt=0,Tt=J,wt=Tt+dt*nt;var Ct=[],It=Q.model.maxCats,Nt=ut.categories.length,te=8,Jt=ut.count,ee=Q.height-te*(It-1),Zt,mt,bt,vt,Ut,re=(It-Nt)*te/2,Kt=ut.categories.map(function(ue){return{displayInd:ue.displayInd,categoryInd:ue.categoryInd}});for(Kt.sort(function(ue,Me){return ue.displayInd-Me.displayInd}),Ut=0;Ut0?Zt=mt.count/Jt*ee:Zt=0,bt={key:mt.valueInds[0],model:mt,width:q,height:Zt,y:mt.dragY!==null?mt.dragY:re,bands:[],parcatsViewModel:Q},re=re+Zt+te,Ct.push(bt);return{key:ut.dimensionInd,x:ut.dragX!==null?ut.dragX:wt,y:0,width:q,model:ut,categories:Ct,parcatsViewModel:Q,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),k5=Vt((K,V)=>{var u=G9();V.exports=function(d,E,A,t){var e=d._fullLayout,r=e._paper,i=e._size;u(d,r,E,{width:i.w,height:i.h,margin:{t:i.t,r:i.r,b:i.b,l:i.l}},A,t)}}),Z9=Vt(K=>{var V=Pf().getModuleCalcData,u=k5(),d="parcats";K.name=d,K.plot=function(E,A,t,e){var r=V(E.calcdata,d);if(r.length){var i=r[0];u(E,i,t,e)}},K.clean=function(E,A,t,e){var r=e._has&&e._has("parcats"),i=A._has&&A._has("parcats");r&&!i&&e._paperdiv.selectAll(".parcats").remove()}}),K9=Vt((K,V)=>{V.exports={attributes:T5(),supplyDefaults:q9(),calc:W9(),plot:k5(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:Z9(),categories:["noOpacity"],meta:{}}}),Y9=Vt((K,V)=>{V.exports=K9()}),Wp=Vt((K,V)=>{var u=wd(),d="1.13.4",E='© OpenStreetMap contributors',A=['© Carto',E].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:A,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:A,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},i=u(r);V.exports={requiredVersion:d,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+d+"."].join(` -`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` -`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` -`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),Dv=Vt((K,V)=>{var u=Xr(),d=Pi().defaultLine,E=Vu().attributes,A=yu(),t=pc().textposition,e=Cu().overrideAll,r=cl().templatedArray,i=Wp(),n=A({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=V.exports=e({_arrayAttrRegexps:[u.counterRegex("mapbox",".layers",!0)],domain:E({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:i.styleValuesMapbox.concat(i.styleValuesNonMapbox),dflt:i.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:d},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:d}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:u.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),Zx=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Qh(),t=E0(),e=pc(),r=Dv(),i=kl(),n=Wl(),o=So().extendFlat,a=Cu().overrideAll,s=Dv(),f=t.line,v=t.marker;V.exports=a({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:o({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:o({},v.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:o({},e.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:e.connectgaps,marker:o({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:v.opacity,size:v.size,sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode},n("marker")),fill:t.fill,fillcolor:A(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),A5=Vt((K,V)=>{var u=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(d){return u.indexOf(d)!==-1}}}),X9=Vt((K,V)=>{var u=Xr(),d=nu(),E=Ch(),A=Rh(),t=Nh(),e=ep(),r=Zx(),i=A5().isSupportedFont;V.exports=function(o,a,s,f){function v(h,b){return u.coerce(o,a,r,h,b)}function g(h,b){return u.coerce2(o,a,r,h,b)}var m=n(o,a,v);if(!m){a.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),d.hasMarkers(a)){E(o,a,s,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var w=a.marker;w.symbol!=="circle"&&(u.isArrayOrTypedArray(w.size)&&(w.size=w.size[0]),u.isArrayOrTypedArray(w.color)&&(w.color=w.color[0]))}d.hasLines(a)&&(A(o,a,s,f,v,{noDash:!0}),v("connectgaps"));var l=g("cluster.maxzoom"),x=g("cluster.step"),y=g("cluster.color",a.marker&&a.marker.color||s),S=g("cluster.size"),k=g("cluster.opacity"),M=l!==!1||x!==!1||y!==!1||S!==!1||k!==!1,T=v("cluster.enabled",M);if(T||d.hasText(a)){var c=f.font.family;t(o,a,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(c)?c:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),u.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var f=s("lon")||[],v=s("lat")||[],g=Math.min(f.length,v.length);return a._length=g,g}}),M5=Vt((K,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),S5=Vt((K,V)=>{var u=Xr();V.exports=function(d,E){var A=d.split(" "),t=A[0],e=A[1],r=u.isArrayOrTypedArray(E)?u.mean(E):E,i=.5+r/100,n=1.5+r/100,o=["",""],a=[0,0];switch(t){case"top":o[0]="top",a[1]=-n;break;case"bottom":o[0]="bottom",a[1]=n;break}switch(e){case"left":o[1]="right",a[0]=-i;break;case"right":o[1]="left",a[0]=i;break}var s;return o[0]&&o[1]?s=o.join("-"):o[0]?s=o[0]:o[1]?s=o[1]:s="center",{anchor:s,offset:a}}}),$9=Vt((K,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM,A=jd(),t=xu(),e=Eo(),r=bm(),i=nu(),n=A5().isSupportedFont,o=S5(),a=mh().appendArrayPointValue,s=Dl().NEWLINES,f=Dl().BR_TAG_ALL;V.exports=function(k,M){var T=M[0].trace,c=T.visible===!0&&T._length!==0,h=T.fill!=="none",b=i.hasLines(T),_=i.hasMarkers(T),P=i.hasText(T),z=_&&T.marker.symbol==="circle",D=_&&T.marker.symbol!=="circle",B=T.cluster&&T.cluster.enabled,R=v("fill"),I=v("line"),F=v("circle"),j=v("symbol"),N={fill:R,line:I,circle:F,symbol:j};if(!c)return N;var G;if((h||b)&&(G=A.calcTraceToLineCoords(M)),h&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",d.extendFlat(R.paint,{"fill-color":T.fillcolor})),b&&(I.geojson=A.makeLine(G),I.layout.visibility="visible",d.extendFlat(I.paint,{"line-width":T.line.width,"line-color":T.line.color,"line-opacity":T.opacity})),z){var rt=g(M);F.geojson=rt.geojson,F.layout.visibility="visible",B&&(F.filter=["!",["has","point_count"]],N.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":y(T.cluster.color,T.cluster.step),"circle-radius":y(T.cluster.size,T.cluster.step),"circle-opacity":y(T.cluster.opacity,T.cluster.step)}},N.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(T),"text-size":12}}),d.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(z&&B&&(F.filter=["!",["has","point_count"]]),(D||P)&&(j.geojson=m(M,k),d.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),D&&(d.extendFlat(j.layout,{"icon-size":T.marker.size/10}),"angle"in T.marker&&T.marker.angle!=="auto"&&d.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=T.marker.allowoverlap,d.extendFlat(j.paint,{"icon-opacity":T.opacity*T.marker.opacity,"icon-color":T.marker.color})),P)){var ct=(T.marker||{}).size,st=o(T.textposition,ct);d.extendFlat(j.layout,{"text-size":T.textfont.size,"text-anchor":st.anchor,"text-offset":st.offset,"text-font":S(T)}),d.extendFlat(j.paint,{"text-color":T.textfont.color,"text-opacity":T.opacity})}return N};function v(k){return{type:k,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(k){var M=k[0].trace,T=M.marker,c=M.selectedpoints,h=d.isArrayOrTypedArray(T.color),b=d.isArrayOrTypedArray(T.size),_=d.isArrayOrTypedArray(T.opacity),P;function z(st){return M.opacity*st}function D(st){return st/2}var B;h&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(T):B=d.identity);var R;b&&(R=r(M));var I;_&&(I=function(st){var et=u(st)?+d.constrain(st,0,1):0;return z(et)});var F=[];for(P=0;P850?P+=" Black":h>750?P+=" Extra Bold":h>650?P+=" Bold":h>550?P+=" Semi Bold":h>450?P+=" Medium":h>350?P+=" Regular":h>250?P+=" Light":h>150?P+=" Extra Light":P+=" Thin"):b.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",h>750?P+=" Extrabold":h>650?P+=" Bold":h>550?P+=" Semibold":h>350?P+=" Regular":P+=" Light"):b.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",b[3]==="CJK"&&(P+=" CJK"),P+=h>500?" Bold":" Regular")),_&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),n(P)||(P=T);var z=P.split(", ");return z}}),J9=Vt((K,V)=>{var u=Xr(),d=$9(),E=Wp().traceLayerPrefix,A={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,i,n,o){this.type="scattermapbox",this.subplot=r,this.uid=i,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:E+i+"-fill",line:E+i+"-line",circle:E+i+"-circle",symbol:E+i+"-symbol",cluster:E+i+"-cluster",clusterCount:E+i+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,i,n){var o={type:"geojson",data:i.geojson};n&&n.enabled&&u.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},e.addLayer=function(r,i,n){var o={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(o.filter=i.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),v=0;v=0;b--){var _=h[b];o.removeLayer(g.layerIds[_])}c||o.removeSource(g.sourceIds.circle)}function l(c){for(var h=A.nonCluster,b=0;b=0;b--){var _=h[b];o.removeLayer(g.layerIds[_]),c||o.removeSource(g.sourceIds[_])}}function y(c){v?w(c):x(c)}function S(c){f?m(c):l(c)}function k(){for(var c=f?A.cluster:A.nonCluster,h=0;h=0;n--){var o=i[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},V.exports=function(r,i){var n=i[0].trace,o=n.cluster&&n.cluster.enabled,a=n.visible!==!0,s=new t(r,n.uid,o,a),f=d(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],g,m,w;if(o)for(s.addSource("circle",f.circle,n.cluster),g=0;g{var u=hc(),d=Xr(),E=Sm(),A=d.fillText,t=ks().BADNUM,e=Wp().traceLayerPrefix;function r(n,o,a){var s=n.cd,f=s[0].trace,v=n.xa,g=n.ya,m=n.subplot,w=[],l=e+f.uid+"-circle",x=f.cluster&&f.cluster.enabled;if(x){var y=m.map.queryRenderedFeatures(null,{layers:[l]});w=y.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),k=S*360,M=o-k;function T(R){var I=R.lonlat;if(I[0]===t||x&&w.indexOf(R.i+1)===-1)return 1/0;var F=d.modHalf(I[0],360),j=I[1],N=m.project([F,j]),G=N.x-v.c2p([M,j]),rt=N.y-g.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(u.getClosest(s,T,n),n.index!==!1){var c=s[n.index],h=c.lonlat,b=[d.modHalf(h[0],360)+k,h[1]],_=v.c2p(b),P=g.c2p(b),z=c.mrc||1;n.x0=_-z,n.x1=_+z,n.y0=P-z,n.y1=P+z;var D={};D[f.subplot]={_subplot:m};var B=f._module.formatLabels(c,f,D);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(f,c),n.extraText=i(f,c,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),v=f.indexOf("all")!==-1,g=f.indexOf("lon")!==-1,m=f.indexOf("lat")!==-1,w=o.lonlat,l=[];function x(y){return y+"°"}return v||g&&m?l.push("("+x(w[1])+", "+x(w[0])+")"):g?l.push(a.lon+x(w[0])):m&&l.push(a.lat+x(w[1])),(v||f.indexOf("text")!==-1)&&A(o,n,l),l.join("
                ")}V.exports={hoverPoints:r,getExtraText:i}}),Q9=Vt((K,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u}}),tz=Vt((K,V)=>{var u=Xr(),d=nu(),E=ks().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!d.hasMarkers(o))return[];if(t===!1)for(a=0;a{(function(u,d){typeof K=="object"&&typeof V<"u"?V.exports=d():(u=u||self,u.mapboxgl=d())})(K,function(){var u,d,E;function A(t,e){if(!u)u=e;else if(!d)d=e;else{var r="var sharedChunk = {}; ("+u+")(sharedChunk); ("+d+")(sharedChunk);",i={};u(i),E=e(i),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return A(["exports"],function(t){function e(p,O){return O={exports:{}},p(O,O.exports),O.exports}var r="1.13.4",i=n;function n(p,O,W,pt){this.cx=3*p,this.bx=3*(W-p)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*O,this.by=3*(pt-O)-this.cy,this.ay=1-this.cy-this.by,this.p1x=p,this.p1y=pt,this.p2x=W,this.p2y=pt}n.prototype.sampleCurveX=function(p){return((this.ax*p+this.bx)*p+this.cx)*p},n.prototype.sampleCurveY=function(p){return((this.ay*p+this.by)*p+this.cy)*p},n.prototype.sampleCurveDerivativeX=function(p){return(3*this.ax*p+2*this.bx)*p+this.cx},n.prototype.solveCurveX=function(p,O){typeof O>"u"&&(O=1e-6);var W,pt,At,Ot,Wt;for(At=p,Wt=0;Wt<8;Wt++){if(Ot=this.sampleCurveX(At)-p,Math.abs(Ot)pt)return pt;for(;WOt?W=At:pt=At,At=(pt-W)*.5+W}return At},n.prototype.solve=function(p,O){return this.sampleCurveY(this.solveCurveX(p,O))};var o=a;function a(p,O){this.x=p,this.y=O}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(p){return this.clone()._add(p)},sub:function(p){return this.clone()._sub(p)},multByPoint:function(p){return this.clone()._multByPoint(p)},divByPoint:function(p){return this.clone()._divByPoint(p)},mult:function(p){return this.clone()._mult(p)},div:function(p){return this.clone()._div(p)},rotate:function(p){return this.clone()._rotate(p)},rotateAround:function(p,O){return this.clone()._rotateAround(p,O)},matMult:function(p){return this.clone()._matMult(p)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(p){return this.x===p.x&&this.y===p.y},dist:function(p){return Math.sqrt(this.distSqr(p))},distSqr:function(p){var O=p.x-this.x,W=p.y-this.y;return O*O+W*W},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(p){return Math.atan2(this.y-p.y,this.x-p.x)},angleWith:function(p){return this.angleWithSep(p.x,p.y)},angleWithSep:function(p,O){return Math.atan2(this.x*O-this.y*p,this.x*p+this.y*O)},_matMult:function(p){var O=p[0]*this.x+p[1]*this.y,W=p[2]*this.x+p[3]*this.y;return this.x=O,this.y=W,this},_add:function(p){return this.x+=p.x,this.y+=p.y,this},_sub:function(p){return this.x-=p.x,this.y-=p.y,this},_mult:function(p){return this.x*=p,this.y*=p,this},_div:function(p){return this.x/=p,this.y/=p,this},_multByPoint:function(p){return this.x*=p.x,this.y*=p.y,this},_divByPoint:function(p){return this.x/=p.x,this.y/=p.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var p=this.y;return this.y=this.x,this.x=-p,this},_rotate:function(p){var O=Math.cos(p),W=Math.sin(p),pt=O*this.x-W*this.y,At=W*this.x+O*this.y;return this.x=pt,this.y=At,this},_rotateAround:function(p,O){var W=Math.cos(p),pt=Math.sin(p),At=O.x+W*(this.x-O.x)-pt*(this.y-O.y),Ot=O.y+pt*(this.x-O.x)+W*(this.y-O.y);return this.x=At,this.y=Ot,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(p){return p instanceof a?p:Array.isArray(p)?new a(p[0],p[1]):p};var s=typeof self<"u"?self:{};function f(p,O){if(Array.isArray(p)){if(!Array.isArray(O)||p.length!==O.length)return!1;for(var W=0;W=1)return 1;var O=p*p,W=O*p;return 4*(p<.5?W:3*(p-O)+W-.75)}function m(p,O,W,pt){var At=new i(p,O,W,pt);return function(Ot){return At.solve(Ot)}}var w=m(.25,.1,.25,1);function l(p,O,W){return Math.min(W,Math.max(O,p))}function x(p,O,W){var pt=W-O,At=((p-O)%pt+pt)%pt+O;return At===O?W:At}function y(p,O,W){if(!p.length)return W(null,[]);var pt=p.length,At=new Array(p.length),Ot=null;p.forEach(function(Wt,_e){O(Wt,function(De,Je){De&&(Ot=De),At[_e]=Je,--pt===0&&W(Ot,At)})})}function S(p){var O=[];for(var W in p)O.push(p[W]);return O}function k(p,O){var W=[];for(var pt in p)pt in O||W.push(pt);return W}function M(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];for(var pt=0,At=O;pt>O/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,p)}return p()}function _(p){return p<=1?1:Math.pow(2,Math.ceil(Math.log(p)/Math.LN2))}function P(p){return p?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(p):!1}function z(p,O){p.forEach(function(W){O[W]&&(O[W]=O[W].bind(O))})}function D(p,O){return p.indexOf(O,p.length-O.length)!==-1}function B(p,O,W){var pt={};for(var At in p)pt[At]=O.call(W||this,p[At],At,p);return pt}function R(p,O,W){var pt={};for(var At in p)O.call(W||this,p[At],At,p)&&(pt[At]=p[At]);return pt}function I(p){return Array.isArray(p)?p.map(I):typeof p=="object"&&p?B(p,I):p}function F(p,O){for(var W=0;W=0)return!0;return!1}var j={};function N(p){j[p]||(typeof console<"u"&&console.warn(p),j[p]=!0)}function G(p,O,W){return(W.y-p.y)*(O.x-p.x)>(O.y-p.y)*(W.x-p.x)}function rt(p){for(var O=0,W=0,pt=p.length,At=pt-1,Ot=void 0,Wt=void 0;W@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,W={};if(p.replace(O,function(At,Ot,Wt,_e){var De=Wt||_e;return W[Ot]=De?De.toLowerCase():!0,""}),W["max-age"]){var pt=parseInt(W["max-age"],10);isNaN(pt)?delete W["max-age"]:W["max-age"]=pt}return W}var Z=null;function ot(p){if(Z==null){var O=p.navigator?p.navigator.userAgent:null;Z=!!p.safari||!!(O&&(/\b(iPad|iPhone|iPod)\b/.test(O)||O.match("Safari")&&!O.match("Chrome")))}return Z}function X(p){try{var O=s[p];return O.setItem("_mapbox_test_",1),O.removeItem("_mapbox_test_"),!0}catch{return!1}}function Q(p){return s.btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,function(O,W){return String.fromCharCode(+("0x"+W))}))}function ut(p){return decodeURIComponent(s.atob(p).split("").map(function(O){return"%"+("00"+O.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var J=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,it=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,nt,dt,Tt={now:J,frame:function(p){var O=q(p);return{cancel:function(){return it(O)}}},getImageData:function(p,O){O===void 0&&(O=0);var W=s.document.createElement("canvas"),pt=W.getContext("2d");if(!pt)throw new Error("failed to create canvas 2d context");return W.width=p.width,W.height=p.height,pt.drawImage(p,0,0,p.width,p.height),pt.getImageData(-O,-O,p.width+2*O,p.height+2*O)},resolveURL:function(p){return nt||(nt=s.document.createElement("a")),nt.href=p,nt.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(dt==null&&(dt=s.matchMedia("(prefers-reduced-motion: reduce)")),dt.matches):!1}},wt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ct={supported:!1,testSupport:ee},It,Nt=!1,te,Jt=!1;s.document&&(te=s.document.createElement("img"),te.onload=function(){It&&Zt(It),It=null,Jt=!0},te.onerror=function(){Nt=!0,It=null},te.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function ee(p){Nt||!te||(Jt?Zt(p):It=p)}function Zt(p){var O=p.createTexture();p.bindTexture(p.TEXTURE_2D,O);try{if(p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,te),p.isContextLost())return;Ct.supported=!0}catch{}p.deleteTexture(O),Nt=!0}var mt="01";function bt(){for(var p="1",O="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",W="",pt=0;pt<10;pt++)W+=O[Math.floor(Math.random()*62)];var At=720*60*1e3,Ot=[p,mt,W].join(""),Wt=Date.now()+At;return{token:Ot,tokenExpiresAt:Wt}}var vt=function(p,O){this._transformRequestFn=p,this._customAccessToken=O,this._createSkuToken()};vt.prototype._createSkuToken=function(){var p=bt();this._skuToken=p.token,this._skuTokenExpiresAt=p.tokenExpiresAt},vt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},vt.prototype.transformRequest=function(p,O){return this._transformRequestFn?this._transformRequestFn(p,O)||{url:p}:{url:p}},vt.prototype.normalizeStyleURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/styles/v1"+W.path,this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeGlyphsURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/fonts/v1"+W.path,this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeSourceURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/v4/"+W.authority+".json",W.params.push("secure"),this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeSpriteURL=function(p,O,W,pt){var At=We(p);return Ut(p)?(At.path="/styles/v1"+At.path+"/sprite"+O+W,this._makeAPIURL(At,this._customAccessToken||pt)):(At.path+=""+O+W,qe(At))},vt.prototype.normalizeTileURL=function(p,O){if(this._isSkuTokenExpired()&&this._createSkuToken(),p&&!Ut(p))return p;var W=We(p),pt=/(\.(png|jpg)\d*)(?=$)/,At=/^.+\/v4\//,Ot=Tt.devicePixelRatio>=2||O===512?"@2x":"",Wt=Ct.supported?".webp":"$1";W.path=W.path.replace(pt,""+Ot+Wt),W.path=W.path.replace(At,"/"),W.path="/v4"+W.path;var _e=this._customAccessToken||Me(W.params)||wt.ACCESS_TOKEN;return wt.REQUIRE_ACCESS_TOKEN&&_e&&this._skuToken&&W.params.push("sku="+this._skuToken),this._makeAPIURL(W,_e)},vt.prototype.canonicalizeTileURL=function(p,O){var W="/v4/",pt=/\.[\w]+$/,At=We(p);if(!At.path.match(/(^\/v4\/)/)||!At.path.match(pt))return p;var Ot="mapbox://tiles/";Ot+=At.path.replace(W,"");var Wt=At.params;return O&&(Wt=Wt.filter(function(_e){return!_e.match(/^access_token=/)})),Wt.length&&(Ot+="?"+Wt.join("&")),Ot},vt.prototype.canonicalizeTileset=function(p,O){for(var W=O?Ut(O):!1,pt=[],At=0,Ot=p.tiles||[];At=0&&p.params.splice(At,1)}if(pt.path!=="/"&&(p.path=""+pt.path+p.path),!wt.REQUIRE_ACCESS_TOKEN)return qe(p);if(O=O||wt.ACCESS_TOKEN,!O)throw new Error("An API access token is required to use Mapbox GL. "+W);if(O[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+W);return p.params=p.params.filter(function(Ot){return Ot.indexOf("access_token")===-1}),p.params.push("access_token="+O),qe(p)};function Ut(p){return p.indexOf("mapbox:")===0}var re=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Kt(p){return re.test(p)}function ue(p){return p.indexOf("sku=")>0&&Kt(p)}function Me(p){for(var O=0,W=p;O=1&&s.localStorage.setItem(O,JSON.stringify(this.eventData))}catch{N("Unable to write to LocalStorage")}},er.prototype.processRequests=function(p){},er.prototype.postEvent=function(p,O,W,pt){var At=this;if(wt.EVENTS_URL){var Ot=We(wt.EVENTS_URL);Ot.params.push("access_token="+(pt||wt.ACCESS_TOKEN||""));var Wt={event:this.type,created:new Date(p).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:mt,userId:this.anonId},_e=O?M(Wt,O):Wt,De={url:qe(Ot),headers:{"Content-Type":"text/plain"},body:JSON.stringify([_e])};this.pendingRequest=$r(De,function(Je){At.pendingRequest=null,W(Je),At.saveEventData(),At.processRequests(pt)})}},er.prototype.queueRequest=function(p,O){this.queue.push(p),this.processRequests(O)};var Mr=(function(p){function O(){p.call(this,"map.load"),this.success={},this.skuToken=""}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.postMapLoadEvent=function(W,pt,At,Ot){this.skuToken=At,(wt.EVENTS_URL&&Ot||wt.ACCESS_TOKEN&&Array.isArray(W)&&W.some(function(Wt){return Ut(Wt)||Kt(Wt)}))&&this.queueRequest({id:pt,timestamp:Date.now()},Ot)},O.prototype.processRequests=function(W){var pt=this;if(!(this.pendingRequest||this.queue.length===0)){var At=this.queue.shift(),Ot=At.id,Wt=At.timestamp;Ot&&this.success[Ot]||(this.anonId||this.fetchEventData(),P(this.anonId)||(this.anonId=b()),this.postEvent(Wt,{skuToken:this.skuToken},function(_e){_e||Ot&&(pt.success[Ot]=!0)},W))}},O})(er),Ir=(function(p){function O(W){p.call(this,"appUserTurnstile"),this._customAccessToken=W}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.postTurnstileEvent=function(W,pt){wt.EVENTS_URL&&wt.ACCESS_TOKEN&&Array.isArray(W)&&W.some(function(At){return Ut(At)||Kt(At)})&&this.queueRequest(Date.now(),pt)},O.prototype.processRequests=function(W){var pt=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var At=_r(wt.ACCESS_TOKEN),Ot=At?At.u:wt.ACCESS_TOKEN,Wt=Ot!==this.eventData.tokenU;P(this.anonId)||(this.anonId=b(),Wt=!0);var _e=this.queue.shift();if(this.eventData.lastSuccess){var De=new Date(this.eventData.lastSuccess),Je=new Date(_e),sr=(_e-this.eventData.lastSuccess)/(1440*60*1e3);Wt=Wt||sr>=1||sr<-1||De.getDate()!==Je.getDate()}else Wt=!0;if(!Wt)return this.processRequests();this.postEvent(_e,{"enabled.telemetry":!1},function(Ar){Ar||(pt.eventData.lastSuccess=_e,pt.eventData.tokenU=Ot)},W)}},O})(er),de=new Ir,Dt=de.postTurnstileEvent.bind(de),qt=new Mr,_t=qt.postMapLoadEvent.bind(qt),lt="mapbox-tiles",yt=500,St=50,Ht=1e3*60*7,Yt;function se(){s.caches&&!Yt&&(Yt=s.caches.open(lt))}var ke;function Ee(p,O){if(ke===void 0)try{new Response(new ReadableStream),ke=!0}catch{ke=!1}ke?O(p.body):p.blob().then(O)}function Ue(p,O,W){if(se(),!!Yt){var pt={status:O.status,statusText:O.statusText,headers:new s.Headers};O.headers.forEach(function(Wt,_e){return pt.headers.set(_e,Wt)});var At=et(O.headers.get("Cache-Control")||"");if(!At["no-store"]){At["max-age"]&&pt.headers.set("Expires",new Date(W+At["max-age"]*1e3).toUTCString());var Ot=new Date(pt.headers.get("Expires")).getTime()-W;OtDate.now()&&!W["no-cache"]}var Er=1/0;function pn(p){Er++,Er>St&&(p.getActor().send("enforceCacheSizeLimit",yt),Er=0)}function dn(p){se(),Yt&&Yt.then(function(O){O.keys().then(function(W){for(var pt=0;pt=200&&W.status<300||W.status===0)&&W.response!==null){var At=W.response;if(p.type==="json")try{At=JSON.parse(W.response)}catch(Ot){return O(Ot)}O(null,At,W.getResponseHeader("Cache-Control"),W.getResponseHeader("Expires"))}else O(new ra(W.statusText,W.status,p.url))},W.send(p.body),{cancel:function(){return W.abort()}}}var zr=function(p,O){if(!Re(p.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Ze(p,O);if(st()&&self.worker&&self.worker.actor){var W=!0;return self.worker.actor.send("getResource",p,O,void 0,W)}}return tr(p,O)},tn=function(p,O){return zr(M(p,{type:"json"}),O)},Yr=function(p,O){return zr(M(p,{type:"arrayBuffer"}),O)},$r=function(p,O){return zr(M(p,{method:"POST"}),O)};function In(p){var O=s.document.createElement("a");return O.href=p,O.protocol===s.document.location.protocol&&O.host===s.document.location.host}var Nn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Kn(p,O,W,pt){var At=new s.Image,Ot=s.URL;At.onload=function(){O(null,At),Ot.revokeObjectURL(At.src),At.onload=null,s.requestAnimationFrame(function(){At.src=Nn})},At.onerror=function(){return O(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var Wt=new s.Blob([new Uint8Array(p)],{type:"image/png"});At.cacheControl=W,At.expires=pt,At.src=p.byteLength?Ot.createObjectURL(Wt):Nn}function $n(p,O){var W=new s.Blob([new Uint8Array(p)],{type:"image/png"});s.createImageBitmap(W).then(function(pt){O(null,pt)}).catch(function(pt){O(new Error("Could not load image because of "+pt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var ia,Cn,Fa=function(){ia=[],Cn=0};Fa();var Ga=function(p,O){if(Ct.supported&&(p.headers||(p.headers={}),p.headers.accept="image/webp,*/*"),Cn>=wt.MAX_PARALLEL_IMAGE_REQUESTS){var W={requestParameters:p,callback:O,cancelled:!1,cancel:function(){this.cancelled=!0}};return ia.push(W),W}Cn++;var pt=!1,At=function(){if(!pt)for(pt=!0,Cn--;ia.length&&Cn0||this._oneTimeListeners&&this._oneTimeListeners[p]&&this._oneTimeListeners[p].length>0||this._eventedParent&&this._eventedParent.listens(p)},mr.prototype.setEventedParent=function(p,O){return this._eventedParent=p,this._eventedParentData=O,this};var kr=8,Ur={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Or={"*":{type:"source"}},pe=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Ke={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},xr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Gr={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},ln={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},wn={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},rn={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Qr={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},vn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Oa={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qn={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qa={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ja={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},wi={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ci={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ti={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ra={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qi={type:"array",value:"*"},Hi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Ho={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Ci={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},zo={type:"array",value:"*",minimum:1},qi={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},qo=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Po={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},hs={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},Gi={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},uo={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},yi={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},ao={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ts={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},vs={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},As={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},_o={"*":{type:"string"}},Da={$version:kr,$root:Ur,sources:Or,source:pe,source_vector:Ke,source_raster:xr,source_raster_dem:Gr,source_geojson:ln,source_video:wn,source_image:rn,layer:Qr,layout:vn,layout_background:Oa,layout_fill:Qn,layout_circle:Qa,layout_heatmap:Ja,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:wi,layout_symbol:ci,layout_raster:Ti,layout_hillshade:Ra,filter:Qi,filter_operator:Hi,geometry_type:Ho,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:Ci,expression:zo,light:qi,paint:qo,paint_fill:Po,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:hs,paint_circle:Gi,paint_heatmap:uo,paint_symbol:yi,paint_raster:ao,paint_hillshade:ts,paint_background:vs,transition:As,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:_o},li=function(p,O,W,pt){this.message=(p?p+": ":"")+W,pt&&(this.identifier=pt),O!=null&&O.__line__&&(this.line=O.__line__)};function wo(p){var O=p.key,W=p.value;return W?[new li(O,W,"constants have been deprecated as of v8")]:[]}function Ms(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];for(var pt=0,At=O;pt":p.itemType.kind==="value"?"array":"array<"+O+">"}else return p.kind}var xl=[al,ii,io,co,Is,Jo,Wo,Ss(Bi),us];function bu(p,O){if(O.kind==="error")return null;if(p.kind==="array"){if(O.kind==="array"&&(O.N===0&&O.itemType.kind==="value"||!bu(p.itemType,O.itemType))&&(typeof p.N!="number"||p.N===O.N))return null}else{if(p.kind===O.kind)return null;if(p.kind==="value")for(var W=0,pt=xl;W255?255:Je}function At(Je){return Je<0?0:Je>1?1:Je}function Ot(Je){return Je[Je.length-1]==="%"?pt(parseFloat(Je)/100*255):pt(parseInt(Je))}function Wt(Je){return Je[Je.length-1]==="%"?At(parseFloat(Je)/100):At(parseFloat(Je))}function _e(Je,sr,Ar){return Ar<0?Ar+=1:Ar>1&&(Ar-=1),Ar*6<1?Je+(sr-Je)*Ar*6:Ar*2<1?sr:Ar*3<2?Je+(sr-Je)*(2/3-Ar)*6:Je}function De(Je){var sr=Je.replace(/ /g,"").toLowerCase();if(sr in W)return W[sr].slice();if(sr[0]==="#"){if(sr.length===4){var Ar=parseInt(sr.substr(1),16);return Ar>=0&&Ar<=4095?[(Ar&3840)>>4|(Ar&3840)>>8,Ar&240|(Ar&240)>>4,Ar&15|(Ar&15)<<4,1]:null}else if(sr.length===7){var Ar=parseInt(sr.substr(1),16);return Ar>=0&&Ar<=16777215?[(Ar&16711680)>>16,(Ar&65280)>>8,Ar&255,1]:null}return null}var Pr=sr.indexOf("("),Vr=sr.indexOf(")");if(Pr!==-1&&Vr+1===sr.length){var un=sr.substr(0,Pr),Fn=sr.substr(Pr+1,Vr-(Pr+1)).split(","),ga=1;switch(un){case"rgba":if(Fn.length!==4)return null;ga=Wt(Fn.pop());case"rgb":return Fn.length!==3?null:[Ot(Fn[0]),Ot(Fn[1]),Ot(Fn[2]),ga];case"hsla":if(Fn.length!==4)return null;ga=Wt(Fn.pop());case"hsl":if(Fn.length!==3)return null;var pa=(parseFloat(Fn[0])%360+360)%360/360,Ea=Wt(Fn[1]),ja=Wt(Fn[2]),Aa=ja<=.5?ja*(Ea+1):ja+Ea-ja*Ea,$a=ja*2-Aa;return[pt(_e($a,Aa,pa+1/3)*255),pt(_e($a,Aa,pa)*255),pt(_e($a,Aa,pa-1/3)*255),ga];default:return null}}return null}try{O.parseCSSColor=De}catch{}}),xc=Ec.parseCSSColor,cs=function(p,O,W,pt){pt===void 0&&(pt=1),this.r=p,this.g=O,this.b=W,this.a=pt};cs.parse=function(p){if(p){if(p instanceof cs)return p;if(typeof p=="string"){var O=xc(p);if(O)return new cs(O[0]/255*O[3],O[1]/255*O[3],O[2]/255*O[3],O[3])}}},cs.prototype.toString=function(){var p=this.toArray(),O=p[0],W=p[1],pt=p[2],At=p[3];return"rgba("+Math.round(O)+","+Math.round(W)+","+Math.round(pt)+","+At+")"},cs.prototype.toArray=function(){var p=this,O=p.r,W=p.g,pt=p.b,At=p.a;return At===0?[0,0,0,0]:[O*255/At,W*255/At,pt*255/At,At]},cs.black=new cs(0,0,0,1),cs.white=new cs(1,1,1,1),cs.transparent=new cs(0,0,0,0),cs.red=new cs(1,0,0,1);var Gl=function(p,O,W){p?this.sensitivity=O?"variant":"case":this.sensitivity=O?"accent":"base",this.locale=W,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Gl.prototype.compare=function(p,O){return this.collator.compare(p,O)},Gl.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var zc=function(p,O,W,pt,At){this.text=p,this.image=O,this.scale=W,this.fontStack=pt,this.textColor=At},Al=function(p){this.sections=p};Al.fromString=function(p){return new Al([new zc(p,null,null,null,null)])},Al.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(p){return p.text.length!==0||p.image&&p.image.name.length!==0})},Al.factory=function(p){return p instanceof Al?p:Al.fromString(p)},Al.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(p){return p.text}).join("")},Al.prototype.serialize=function(){for(var p=["format"],O=0,W=this.sections;O=0&&p<=255&&typeof O=="number"&&O>=0&&O<=255&&typeof W=="number"&&W>=0&&W<=255)){var At=typeof pt=="number"?[p,O,W,pt]:[p,O,W];return"Invalid rgba value ["+At.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof pt>"u"||typeof pt=="number"&&pt>=0&&pt<=1?null:"Invalid rgba value ["+[p,O,W,pt].join(", ")+"]: 'a' must be between 0 and 1."}function hu(p){if(p===null||typeof p=="string"||typeof p=="boolean"||typeof p=="number"||p instanceof cs||p instanceof Gl||p instanceof Al||p instanceof _l)return!0;if(Array.isArray(p)){for(var O=0,W=p;O2){var Wt=p[1];if(typeof Wt!="string"||!(Wt in Iu)||Wt==="object")return O.error('The item type argument of "array" must be one of string, number, boolean',1);Ot=Iu[Wt],W++}else Ot=Bi;var _e;if(p.length>3){if(p[2]!==null&&(typeof p[2]!="number"||p[2]<0||p[2]!==Math.floor(p[2])))return O.error('The length argument to "array" must be a positive integer literal',2);_e=p[2],W++}pt=Ss(Ot,_e)}else pt=Iu[At];for(var De=[];W1)&&O.push(pt)}}return O.concat(this.args.map(function(At){return At.serialize()}))};var Hu=function(p){this.type=Jo,this.sections=p};Hu.parse=function(p,O){if(p.length<2)return O.error("Expected at least one argument.");var W=p[1];if(!Array.isArray(W)&&typeof W=="object")return O.error("First argument must be an image or text section.");for(var pt=[],At=!1,Ot=1;Ot<=p.length-1;++Ot){var Wt=p[Ot];if(At&&typeof Wt=="object"&&!Array.isArray(Wt)){At=!1;var _e=null;if(Wt["font-scale"]&&(_e=O.parse(Wt["font-scale"],1,ii),!_e))return null;var De=null;if(Wt["text-font"]&&(De=O.parse(Wt["text-font"],1,Ss(io)),!De))return null;var Je=null;if(Wt["text-color"]&&(Je=O.parse(Wt["text-color"],1,Is),!Je))return null;var sr=pt[pt.length-1];sr.scale=_e,sr.font=De,sr.textColor=Je}else{var Ar=O.parse(p[Ot],1,Bi);if(!Ar)return null;var Pr=Ar.type.kind;if(Pr!=="string"&&Pr!=="value"&&Pr!=="null"&&Pr!=="resolvedImage")return O.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");At=!0,pt.push({content:Ar,scale:null,font:null,textColor:null})}}return new Hu(pt)},Hu.prototype.evaluate=function(p){var O=function(W){var pt=W.content.evaluate(p);return Fs(pt)===us?new zc("",pt,null,null,null):new zc(bl(pt),null,W.scale?W.scale.evaluate(p):null,W.font?W.font.evaluate(p).join(","):null,W.textColor?W.textColor.evaluate(p):null)};return new Al(this.sections.map(O))},Hu.prototype.eachChild=function(p){for(var O=0,W=this.sections;O-1),W},qs.prototype.eachChild=function(p){p(this.input)},qs.prototype.outputDefined=function(){return!1},qs.prototype.serialize=function(){return["image",this.input.serialize()]};var sf={"to-boolean":co,"to-color":Is,"to-number":ii,"to-string":io},Oo=function(p,O){this.type=p,this.args=O};Oo.parse=function(p,O){if(p.length<2)return O.error("Expected at least one argument.");var W=p[0];if((W==="to-boolean"||W==="to-string")&&p.length!==2)return O.error("Expected one argument.");for(var pt=sf[W],At=[],Ot=1;Ot4?W="Invalid rbga value "+JSON.stringify(O)+": expected an array containing either three or four numeric values.":W=Ml(O[0],O[1],O[2],O[3]),!W))return new cs(O[0]/255,O[1]/255,O[2]/255,O[3])}throw new bs(W||"Could not parse color from value '"+(typeof O=="string"?O:String(JSON.stringify(O)))+"'")}else if(this.type.kind==="number"){for(var _e=null,De=0,Je=this.args;De=O[2]||p[1]<=O[1]||p[3]>=O[3])}function Yc(p,O){var W=qu(p[0]),pt=dc(p[1]),At=Math.pow(2,O.z);return[Math.round(W*At*ml),Math.round(pt*At*ml)]}function Fc(p,O,W){var pt=p[0]-O[0],At=p[1]-O[1],Ot=p[0]-W[0],Wt=p[1]-W[1];return pt*Wt-Ot*At===0&&pt*Ot<=0&&At*Wt<=0}function mc(p,O,W){return O[1]>p[1]!=W[1]>p[1]&&p[0]<(W[0]-O[0])*(p[1]-O[1])/(W[1]-O[1])+O[0]}function Wu(p,O){for(var W=!1,pt=0,At=O.length;pt0&&Ar<0||sr<0&&Ar>0}function Bc(p,O,W,pt){var At=[O[0]-p[0],O[1]-p[1]],Ot=[pt[0]-W[0],pt[1]-W[1]];return Ic(Ot,At)===0?!1:!!(du(p,O,W,pt)&&du(W,pt,p,O))}function Pu(p,O,W){for(var pt=0,At=W;ptW[2]){var At=pt*.5,Ot=p[0]-W[0]>At?-pt:W[0]-p[0]>At?pt:0;Ot===0&&(Ot=p[0]-W[2]>At?-pt:W[2]-p[0]>At?pt:0),p[0]+=Ot}Lc(O,p)}function _c(p){p[0]=p[1]=1/0,p[2]=p[3]=-1/0}function lf(p,O,W,pt){for(var At=Math.pow(2,pt.z)*ml,Ot=[pt.x*ml,pt.y*ml],Wt=[],_e=0,De=p;_e=0)return!1;var W=!0;return p.eachChild(function(pt){W&&!Kl(pt,O)&&(W=!1)}),W}var Gu=function(p,O){this.type=O.type,this.name=p,this.boundExpression=O};Gu.parse=function(p,O){if(p.length!==2||typeof p[1]!="string")return O.error("'var' expression requires exactly one string literal argument.");var W=p[1];return O.scope.has(W)?new Gu(W,O.scope.get(W)):O.error('Unknown variable "'+W+'". Make sure "'+W+'" has been bound in an enclosing "let" expression before using it.',1)},Gu.prototype.evaluate=function(p){return this.boundExpression.evaluate(p)},Gu.prototype.eachChild=function(){},Gu.prototype.outputDefined=function(){return!1},Gu.prototype.serialize=function(){return["var",this.name]};var Bs=function(p,O,W,pt,At){O===void 0&&(O=[]),pt===void 0&&(pt=new is),At===void 0&&(At=[]),this.registry=p,this.path=O,this.key=O.map(function(Ot){return"["+Ot+"]"}).join(""),this.scope=pt,this.errors=At,this.expectedType=W};Bs.prototype.parse=function(p,O,W,pt,At){return At===void 0&&(At={}),O?this.concat(O,W,pt)._parse(p,At):this._parse(p,At)},Bs.prototype._parse=function(p,O){(p===null||typeof p=="string"||typeof p=="boolean"||typeof p=="number")&&(p=["literal",p]);function W(Je,sr,Ar){return Ar==="assert"?new Nl(sr,[Je]):Ar==="coerce"?new Oo(sr,[Je]):Je}if(Array.isArray(p)){if(p.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var pt=p[0];if(typeof pt!="string")return this.error("Expression name must be a string, but found "+typeof pt+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var At=this.registry[pt];if(At){var Ot=At.parse(p,this);if(!Ot)return null;if(this.expectedType){var Wt=this.expectedType,_e=Ot.type;if((Wt.kind==="string"||Wt.kind==="number"||Wt.kind==="boolean"||Wt.kind==="object"||Wt.kind==="array")&&_e.kind==="value")Ot=W(Ot,Wt,O.typeAnnotation||"assert");else if((Wt.kind==="color"||Wt.kind==="formatted"||Wt.kind==="resolvedImage")&&(_e.kind==="value"||_e.kind==="string"))Ot=W(Ot,Wt,O.typeAnnotation||"coerce");else if(this.checkSubtype(Wt,_e))return null}if(!(Ot instanceof Fo)&&Ot.type.kind!=="resolvedImage"&&Ou(Ot)){var De=new os;try{Ot=new Fo(Ot.type,Ot.evaluate(De))}catch(Je){return this.error(Je.message),null}}return Ot}return this.error('Unknown expression "'+pt+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof p>"u"?this.error("'undefined' value invalid. Use null instead."):typeof p=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof p+" instead.")},Bs.prototype.concat=function(p,O,W){var pt=typeof p=="number"?this.path.concat(p):this.path,At=W?this.scope.concat(W):this.scope;return new Bs(this.registry,pt,O||null,At,this.errors)},Bs.prototype.error=function(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];var pt=""+this.key+O.map(function(At){return"["+At+"]"}).join("");this.errors.push(new No(pt,p))},Bs.prototype.checkSubtype=function(p,O){var W=bu(p,O);return W&&this.error(W),W};function Ou(p){if(p instanceof Gu)return Ou(p.boundExpression);if(p instanceof Fi&&p.name==="error"||p instanceof pu||p instanceof Zl)return!1;var O=p instanceof Oo||p instanceof Nl,W=!0;return p.eachChild(function(pt){O?W=W&&Ou(pt):W=W&&pt instanceof Fo}),W?jc(p)&&Kl(p,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Rl(p,O){for(var W=p.length-1,pt=0,At=W,Ot=0,Wt,_e;pt<=At;)if(Ot=Math.floor((pt+At)/2),Wt=p[Ot],_e=p[Ot+1],Wt<=O){if(Ot===W||O<_e)return Ot;pt=Ot+1}else if(Wt>O)At=Ot-1;else throw new bs("Input is not a number.");return 0}var Yl=function(p,O,W){this.type=p,this.input=O,this.labels=[],this.outputs=[];for(var pt=0,At=W;pt=Wt)return O.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',De);var sr=O.parse(_e,Je,At);if(!sr)return null;At=At||sr.type,pt.push([Wt,sr])}return new Yl(At,W,pt)},Yl.prototype.evaluate=function(p){var O=this.labels,W=this.outputs;if(O.length===1)return W[0].evaluate(p);var pt=this.input.evaluate(p);if(pt<=O[0])return W[0].evaluate(p);var At=O.length;if(pt>=O[At-1])return W[At-1].evaluate(p);var Ot=Rl(O,pt);return W[Ot].evaluate(p)},Yl.prototype.eachChild=function(p){p(this.input);for(var O=0,W=this.outputs;O0&&p.push(this.labels[O]),p.push(this.outputs[O].serialize());return p};function Ws(p,O,W){return p*(1-W)+O*W}function ac(p,O,W){return new cs(Ws(p.r,O.r,W),Ws(p.g,O.g,W),Ws(p.b,O.b,W),Ws(p.a,O.a,W))}function Tu(p,O,W){return p.map(function(pt,At){return Ws(pt,O[At],W)})}var Zu=Object.freeze({__proto__:null,number:Ws,color:ac,array:Tu}),bc=.95047,uf=1,Sf=1.08883,ic=4/29,wc=6/29,Fl=3*wc*wc,oc=wc*wc*wc,iu=Math.PI/180,sc=180/Math.PI;function Tc(p){return p>oc?Math.pow(p,1/3):p/Fl+ic}function ku(p){return p>wc?p*p*p:Fl*(p-ic)}function Gs(p){return 255*(p<=.0031308?12.92*p:1.055*Math.pow(p,1/2.4)-.055)}function Du(p){return p/=255,p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4)}function Xl(p){var O=Du(p.r),W=Du(p.g),pt=Du(p.b),At=Tc((.4124564*O+.3575761*W+.1804375*pt)/bc),Ot=Tc((.2126729*O+.7151522*W+.072175*pt)/uf),Wt=Tc((.0193339*O+.119192*W+.9503041*pt)/Sf);return{l:116*Ot-16,a:500*(At-Ot),b:200*(Ot-Wt),alpha:p.a}}function Xc(p){var O=(p.l+16)/116,W=isNaN(p.a)?O:O+p.a/500,pt=isNaN(p.b)?O:O-p.b/200;return O=uf*ku(O),W=bc*ku(W),pt=Sf*ku(pt),new cs(Gs(3.2404542*W-1.5371385*O-.4985314*pt),Gs(-.969266*W+1.8760108*O+.041556*pt),Gs(.0556434*W-.2040259*O+1.0572252*pt),p.alpha)}function Vs(p,O,W){return{l:Ws(p.l,O.l,W),a:Ws(p.a,O.a,W),b:Ws(p.b,O.b,W),alpha:Ws(p.alpha,O.alpha,W)}}function vc(p){var O=Xl(p),W=O.l,pt=O.a,At=O.b,Ot=Math.atan2(At,pt)*sc;return{h:Ot<0?Ot+360:Ot,c:Math.sqrt(pt*pt+At*At),l:W,alpha:p.a}}function Ku(p){var O=p.h*iu,W=p.c,pt=p.l;return Xc({l:pt,a:Math.cos(O)*W,b:Math.sin(O)*W,alpha:p.alpha})}function ou(p,O,W){var pt=O-p;return p+W*(pt>180||pt<-180?pt-360*Math.round(pt/360):pt)}function Qu(p,O,W){return{h:ou(p.h,O.h,W),c:Ws(p.c,O.c,W),l:Ws(p.l,O.l,W),alpha:Ws(p.alpha,O.alpha,W)}}var Yu={forward:Xl,reverse:Xc,interpolate:Vs},yc={forward:vc,reverse:Ku,interpolate:Qu},cf=Object.freeze({__proto__:null,lab:Yu,hcl:yc}),zl=function(p,O,W,pt,At){this.type=p,this.operator=O,this.interpolation=W,this.input=pt,this.labels=[],this.outputs=[];for(var Ot=0,Wt=At;Ot1}))return O.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);pt={name:"cubic-bezier",controlPoints:_e}}else return O.error("Unknown interpolation type "+String(pt[0]),1,0);if(p.length-1<4)return O.error("Expected at least 4 arguments, but found only "+(p.length-1)+".");if((p.length-1)%2!==0)return O.error("Expected an even number of arguments.");if(At=O.parse(At,2,ii),!At)return null;var De=[],Je=null;W==="interpolate-hcl"||W==="interpolate-lab"?Je=Is:O.expectedType&&O.expectedType.kind!=="value"&&(Je=O.expectedType);for(var sr=0;sr=Ar)return O.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Vr);var Fn=O.parse(Pr,un,Je);if(!Fn)return null;Je=Je||Fn.type,De.push([Ar,Fn])}return Je.kind!=="number"&&Je.kind!=="color"&&!(Je.kind==="array"&&Je.itemType.kind==="number"&&typeof Je.N=="number")?O.error("Type "+Ls(Je)+" is not interpolatable."):new zl(Je,W,pt,At,De)},zl.prototype.evaluate=function(p){var O=this.labels,W=this.outputs;if(O.length===1)return W[0].evaluate(p);var pt=this.input.evaluate(p);if(pt<=O[0])return W[0].evaluate(p);var At=O.length;if(pt>=O[At-1])return W[At-1].evaluate(p);var Ot=Rl(O,pt),Wt=O[Ot],_e=O[Ot+1],De=zl.interpolationFactor(this.interpolation,pt,Wt,_e),Je=W[Ot].evaluate(p),sr=W[Ot+1].evaluate(p);return this.operator==="interpolate"?Zu[this.type.kind.toLowerCase()](Je,sr,De):this.operator==="interpolate-hcl"?yc.reverse(yc.interpolate(yc.forward(Je),yc.forward(sr),De)):Yu.reverse(Yu.interpolate(Yu.forward(Je),Yu.forward(sr),De))},zl.prototype.eachChild=function(p){p(this.input);for(var O=0,W=this.outputs;O=W.length)throw new bs("Array index out of bounds: "+O+" > "+(W.length-1)+".");if(O!==Math.floor(O))throw new bs("Array index must be an integer, but found "+O+" instead.");return W[O]},Au.prototype.eachChild=function(p){p(this.index),p(this.input)},Au.prototype.outputDefined=function(){return!1},Au.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var il=function(p,O){this.type=co,this.needle=p,this.haystack=O};il.parse=function(p,O){if(p.length!==3)return O.error("Expected 2 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,Bi);return!W||!pt?null:au(W.type,[co,io,ii,al,Bi])?new il(W,pt):O.error("Expected first argument to be of type boolean, string, number or null, but found "+Ls(W.type)+" instead")},il.prototype.evaluate=function(p){var O=this.needle.evaluate(p),W=this.haystack.evaluate(p);if(!W)return!1;if(!fu(O,["boolean","string","number","null"]))throw new bs("Expected first argument to be of type boolean, string, number or null, but found "+Ls(Fs(O))+" instead.");if(!fu(W,["string","array"]))throw new bs("Expected second argument to be of type array or string, but found "+Ls(Fs(W))+" instead.");return W.indexOf(O)>=0},il.prototype.eachChild=function(p){p(this.needle),p(this.haystack)},il.prototype.outputDefined=function(){return!0},il.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cs=function(p,O,W){this.type=ii,this.needle=p,this.haystack=O,this.fromIndex=W};Cs.parse=function(p,O){if(p.length<=2||p.length>=5)return O.error("Expected 3 or 4 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,Bi);if(!W||!pt)return null;if(!au(W.type,[co,io,ii,al,Bi]))return O.error("Expected first argument to be of type boolean, string, number or null, but found "+Ls(W.type)+" instead");if(p.length===4){var At=O.parse(p[3],3,ii);return At?new Cs(W,pt,At):null}else return new Cs(W,pt)},Cs.prototype.evaluate=function(p){var O=this.needle.evaluate(p),W=this.haystack.evaluate(p);if(!fu(O,["boolean","string","number","null"]))throw new bs("Expected first argument to be of type boolean, string, number or null, but found "+Ls(Fs(O))+" instead.");if(!fu(W,["string","array"]))throw new bs("Expected second argument to be of type array or string, but found "+Ls(Fs(W))+" instead.");if(this.fromIndex){var pt=this.fromIndex.evaluate(p);return W.indexOf(O,pt)}return W.indexOf(O)},Cs.prototype.eachChild=function(p){p(this.needle),p(this.haystack),this.fromIndex&&p(this.fromIndex)},Cs.prototype.outputDefined=function(){return!1},Cs.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var p=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),p]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Mu=function(p,O,W,pt,At,Ot){this.inputType=p,this.type=O,this.input=W,this.cases=pt,this.outputs=At,this.otherwise=Ot};Mu.parse=function(p,O){if(p.length<5)return O.error("Expected at least 4 arguments, but found only "+(p.length-1)+".");if(p.length%2!==1)return O.error("Expected an even number of arguments.");var W,pt;O.expectedType&&O.expectedType.kind!=="value"&&(pt=O.expectedType);for(var At={},Ot=[],Wt=2;WtNumber.MAX_SAFE_INTEGER)return Je.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Pr=="number"&&Math.floor(Pr)!==Pr)return Je.error("Numeric branch labels must be integer values.");if(!W)W=Fs(Pr);else if(Je.checkSubtype(W,Fs(Pr)))return null;if(typeof At[String(Pr)]<"u")return Je.error("Branch labels must be unique.");At[String(Pr)]=Ot.length}var Vr=O.parse(De,Wt,pt);if(!Vr)return null;pt=pt||Vr.type,Ot.push(Vr)}var un=O.parse(p[1],1,Bi);if(!un)return null;var Fn=O.parse(p[p.length-1],p.length-1,pt);return!Fn||un.type.kind!=="value"&&O.concat(1).checkSubtype(W,un.type)?null:new Mu(W,pt,un,At,Ot,Fn)},Mu.prototype.evaluate=function(p){var O=this.input.evaluate(p),W=Fs(O)===this.inputType&&this.outputs[this.cases[O]]||this.otherwise;return W.evaluate(p)},Mu.prototype.eachChild=function(p){p(this.input),this.outputs.forEach(p),p(this.otherwise)},Mu.prototype.outputDefined=function(){return this.outputs.every(function(p){return p.outputDefined()})&&this.otherwise.outputDefined()},Mu.prototype.serialize=function(){for(var p=this,O=["match",this.input.serialize()],W=Object.keys(this.cases).sort(),pt=[],At={},Ot=0,Wt=W;Ot=5)return O.error("Expected 3 or 4 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,ii);if(!W||!pt)return null;if(!au(W.type,[Ss(Bi),io,Bi]))return O.error("Expected first argument to be of type array or string, but found "+Ls(W.type)+" instead");if(p.length===4){var At=O.parse(p[3],3,ii);return At?new Su(W.type,W,pt,At):null}else return new Su(W.type,W,pt)},Su.prototype.evaluate=function(p){var O=this.input.evaluate(p),W=this.beginIndex.evaluate(p);if(!fu(O,["string","array"]))throw new bs("Expected first argument to be of type array or string, but found "+Ls(Fs(O))+" instead.");if(this.endIndex){var pt=this.endIndex.evaluate(p);return O.slice(W,pt)}return O.slice(W)},Su.prototype.eachChild=function(p){p(this.input),p(this.beginIndex),this.endIndex&&p(this.endIndex)},Su.prototype.outputDefined=function(){return!1},Su.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var p=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),p]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Oc(p,O){return p==="=="||p==="!="?O.kind==="boolean"||O.kind==="string"||O.kind==="number"||O.kind==="null"||O.kind==="value":O.kind==="string"||O.kind==="number"||O.kind==="value"}function Xe(p,O,W){return O===W}function yr(p,O,W){return O!==W}function Kr(p,O,W){return OW}function mn(p,O,W){return O<=W}function Pn(p,O,W){return O>=W}function ha(p,O,W,pt){return pt.compare(O,W)===0}function Ta(p,O,W,pt){return!ha(p,O,W,pt)}function Ua(p,O,W,pt){return pt.compare(O,W)<0}function Ya(p,O,W,pt){return pt.compare(O,W)>0}function va(p,O,W,pt){return pt.compare(O,W)<=0}function Ba(p,O,W,pt){return pt.compare(O,W)>=0}function za(p,O,W){var pt=p!=="=="&&p!=="!=";return(function(){function At(Ot,Wt,_e){this.type=co,this.lhs=Ot,this.rhs=Wt,this.collator=_e,this.hasUntypedArgument=Ot.type.kind==="value"||Wt.type.kind==="value"}return At.parse=function(Ot,Wt){if(Ot.length!==3&&Ot.length!==4)return Wt.error("Expected two or three arguments.");var _e=Ot[0],De=Wt.parse(Ot[1],1,Bi);if(!De)return null;if(!Oc(_e,De.type))return Wt.concat(1).error('"'+_e+`" comparisons are not supported for type '`+Ls(De.type)+"'.");var Je=Wt.parse(Ot[2],2,Bi);if(!Je)return null;if(!Oc(_e,Je.type))return Wt.concat(2).error('"'+_e+`" comparisons are not supported for type '`+Ls(Je.type)+"'.");if(De.type.kind!==Je.type.kind&&De.type.kind!=="value"&&Je.type.kind!=="value")return Wt.error("Cannot compare types '"+Ls(De.type)+"' and '"+Ls(Je.type)+"'.");pt&&(De.type.kind==="value"&&Je.type.kind!=="value"?De=new Nl(Je.type,[De]):De.type.kind!=="value"&&Je.type.kind==="value"&&(Je=new Nl(De.type,[Je])));var sr=null;if(Ot.length===4){if(De.type.kind!=="string"&&Je.type.kind!=="string"&&De.type.kind!=="value"&&Je.type.kind!=="value")return Wt.error("Cannot use collator to compare non-string types.");if(sr=Wt.parse(Ot[3],3,fl),!sr)return null}return new At(De,Je,sr)},At.prototype.evaluate=function(Ot){var Wt=this.lhs.evaluate(Ot),_e=this.rhs.evaluate(Ot);if(pt&&this.hasUntypedArgument){var De=Fs(Wt),Je=Fs(_e);if(De.kind!==Je.kind||!(De.kind==="string"||De.kind==="number"))throw new bs('Expected arguments for "'+p+'" to be (string, string) or (number, number), but found ('+De.kind+", "+Je.kind+") instead.")}if(this.collator&&!pt&&this.hasUntypedArgument){var sr=Fs(Wt),Ar=Fs(_e);if(sr.kind!=="string"||Ar.kind!=="string")return O(Ot,Wt,_e)}return this.collator?W(Ot,Wt,_e,this.collator.evaluate(Ot)):O(Ot,Wt,_e)},At.prototype.eachChild=function(Ot){Ot(this.lhs),Ot(this.rhs),this.collator&&Ot(this.collator)},At.prototype.outputDefined=function(){return!0},At.prototype.serialize=function(){var Ot=[p];return this.eachChild(function(Wt){Ot.push(Wt.serialize())}),Ot},At})()}var ca=za("==",Xe,ha),ei=za("!=",yr,Ta),Vi=za("<",Kr,Ua),Oi=za(">",Rr,Ya),Wi=za("<=",mn,va),Xi=za(">=",Pn,Ba),ni=function(p,O,W,pt,At){this.type=io,this.number=p,this.locale=O,this.currency=W,this.minFractionDigits=pt,this.maxFractionDigits=At};ni.parse=function(p,O){if(p.length!==3)return O.error("Expected two arguments.");var W=O.parse(p[1],1,ii);if(!W)return null;var pt=p[2];if(typeof pt!="object"||Array.isArray(pt))return O.error("NumberFormat options argument must be an object.");var At=null;if(pt.locale&&(At=O.parse(pt.locale,1,io),!At))return null;var Ot=null;if(pt.currency&&(Ot=O.parse(pt.currency,1,io),!Ot))return null;var Wt=null;if(pt["min-fraction-digits"]&&(Wt=O.parse(pt["min-fraction-digits"],1,ii),!Wt))return null;var _e=null;return pt["max-fraction-digits"]&&(_e=O.parse(pt["max-fraction-digits"],1,ii),!_e)?null:new ni(W,At,Ot,Wt,_e)},ni.prototype.evaluate=function(p){return new Intl.NumberFormat(this.locale?this.locale.evaluate(p):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(p):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(p):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(p):void 0}).format(this.number.evaluate(p))},ni.prototype.eachChild=function(p){p(this.number),this.locale&&p(this.locale),this.currency&&p(this.currency),this.minFractionDigits&&p(this.minFractionDigits),this.maxFractionDigits&&p(this.maxFractionDigits)},ni.prototype.outputDefined=function(){return!1},ni.prototype.serialize=function(){var p={};return this.locale&&(p.locale=this.locale.serialize()),this.currency&&(p.currency=this.currency.serialize()),this.minFractionDigits&&(p["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(p["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),p]};var Za=function(p){this.type=ii,this.input=p};Za.parse=function(p,O){if(p.length!==2)return O.error("Expected 1 argument, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1);return W?W.type.kind!=="array"&&W.type.kind!=="string"&&W.type.kind!=="value"?O.error("Expected argument of type string or array, but found "+Ls(W.type)+" instead."):new Za(W):null},Za.prototype.evaluate=function(p){var O=this.input.evaluate(p);if(typeof O=="string"||Array.isArray(O))return O.length;throw new bs("Expected value to be of type string or array, but found "+Ls(Fs(O))+" instead.")},Za.prototype.eachChild=function(p){p(this.input)},Za.prototype.outputDefined=function(){return!1},Za.prototype.serialize=function(){var p=["length"];return this.eachChild(function(O){p.push(O.serialize())}),p};var $i={"==":ca,"!=":ei,">":Oi,"<":Vi,">=":Xi,"<=":Wi,array:Nl,at:Au,boolean:Nl,case:lc,coalesce:su,collator:pu,format:Hu,image:qs,in:il,"index-of":Cs,interpolate:zl,"interpolate-hcl":zl,"interpolate-lab":zl,length:Za,let:Fu,literal:Fo,match:Mu,number:Nl,"number-format":ni,object:Nl,slice:Su,step:Yl,string:Nl,"to-boolean":Oo,"to-color":Oo,"to-number":Oo,"to-string":Oo,var:Gu,within:Zl};function Do(p,O){var W=O[0],pt=O[1],At=O[2],Ot=O[3];W=W.evaluate(p),pt=pt.evaluate(p),At=At.evaluate(p);var Wt=Ot?Ot.evaluate(p):1,_e=Ml(W,pt,At,Wt);if(_e)throw new bs(_e);return new cs(W/255*Wt,pt/255*Wt,At/255*Wt,Wt)}function ss(p,O){return p in O}function Ps(p,O){var W=O[p];return typeof W>"u"?null:W}function ys(p,O,W,pt){for(;W<=pt;){var At=W+pt>>1;if(O[At]===p)return!0;O[At]>p?pt=At-1:W=At+1}return!1}function Os(p){return{type:p}}Fi.register($i,{error:[$s,[io],function(p,O){var W=O[0];throw new bs(W.evaluate(p))}],typeof:[io,[Bi],function(p,O){var W=O[0];return Ls(Fs(W.evaluate(p)))}],"to-rgba":[Ss(ii,4),[Is],function(p,O){var W=O[0];return W.evaluate(p).toArray()}],rgb:[Is,[ii,ii,ii],Do],rgba:[Is,[ii,ii,ii,ii],Do],has:{type:co,overloads:[[[io],function(p,O){var W=O[0];return ss(W.evaluate(p),p.properties())}],[[io,Wo],function(p,O){var W=O[0],pt=O[1];return ss(W.evaluate(p),pt.evaluate(p))}]]},get:{type:Bi,overloads:[[[io],function(p,O){var W=O[0];return Ps(W.evaluate(p),p.properties())}],[[io,Wo],function(p,O){var W=O[0],pt=O[1];return Ps(W.evaluate(p),pt.evaluate(p))}]]},"feature-state":[Bi,[io],function(p,O){var W=O[0];return Ps(W.evaluate(p),p.featureState||{})}],properties:[Wo,[],function(p){return p.properties()}],"geometry-type":[io,[],function(p){return p.geometryType()}],id:[Bi,[],function(p){return p.id()}],zoom:[ii,[],function(p){return p.globals.zoom}],"heatmap-density":[ii,[],function(p){return p.globals.heatmapDensity||0}],"line-progress":[ii,[],function(p){return p.globals.lineProgress||0}],accumulated:[Bi,[],function(p){return p.globals.accumulated===void 0?null:p.globals.accumulated}],"+":[ii,Os(ii),function(p,O){for(var W=0,pt=0,At=O;pt":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At>Ot}],"filter-id->":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt>At}],"filter-<=":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At<=Ot}],"filter-id-<=":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt<=At}],"filter->=":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At>=Ot}],"filter-id->=":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt>=At}],"filter-has":[co,[Bi],function(p,O){var W=O[0];return W.value in p.properties()}],"filter-has-id":[co,[],function(p){return p.id()!==null&&p.id()!==void 0}],"filter-type-in":[co,[Ss(io)],function(p,O){var W=O[0];return W.value.indexOf(p.geometryType())>=0}],"filter-id-in":[co,[Ss(Bi)],function(p,O){var W=O[0];return W.value.indexOf(p.id())>=0}],"filter-in-small":[co,[io,Ss(Bi)],function(p,O){var W=O[0],pt=O[1];return pt.value.indexOf(p.properties()[W.value])>=0}],"filter-in-large":[co,[io,Ss(Bi)],function(p,O){var W=O[0],pt=O[1];return ys(p.properties()[W.value],pt.value,0,pt.value.length-1)}],all:{type:co,overloads:[[[co,co],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)&&pt.evaluate(p)}],[Os(co),function(p,O){for(var W=0,pt=O;W-1}function bi(p){return!!p.expression&&p.expression.interpolated}function so(p){return p instanceof Number?"number":p instanceof String?"string":p instanceof Boolean?"boolean":Array.isArray(p)?"array":p===null?"null":typeof p}function ws(p){return typeof p=="object"&&p!==null&&!Array.isArray(p)}function fs(p){return p}function Ll(p,O){var W=O.type==="color",pt=p.stops&&typeof p.stops[0][0]=="object",At=pt||p.property!==void 0,Ot=pt||!At,Wt=p.type||(bi(O)?"exponential":"interval");if(W&&(p=Ms({},p),p.stops&&(p.stops=p.stops.map(function(Ei){return[Ei[0],cs.parse(Ei[1])]})),p.default?p.default=cs.parse(p.default):p.default=cs.parse(O.default)),p.colorSpace&&p.colorSpace!=="rgb"&&!cf[p.colorSpace])throw new Error("Unknown color space: "+p.colorSpace);var _e,De,Je;if(Wt==="exponential")_e=Jl;else if(Wt==="interval")_e=Bu;else if(Wt==="categorical"){_e=jl,De=Object.create(null);for(var sr=0,Ar=p.stops;sr=p.stops[pt-1][0])return p.stops[pt-1][1];var At=Rl(p.stops.map(function(Ot){return Ot[0]}),W);return p.stops[At][1]}function Jl(p,O,W){var pt=p.base!==void 0?p.base:1;if(so(W)!=="number")return $l(p.default,O.default);var At=p.stops.length;if(At===1||W<=p.stops[0][0])return p.stops[0][1];if(W>=p.stops[At-1][0])return p.stops[At-1][1];var Ot=Rl(p.stops.map(function(Ar){return Ar[0]}),W),Wt=nl(W,pt,p.stops[Ot][0],p.stops[Ot+1][0]),_e=p.stops[Ot][1],De=p.stops[Ot+1][1],Je=Zu[O.type]||fs;if(p.colorSpace&&p.colorSpace!=="rgb"){var sr=cf[p.colorSpace];Je=function(Ar,Pr){return sr.reverse(sr.interpolate(sr.forward(Ar),sr.forward(Pr),Wt))}}return typeof _e.evaluate=="function"?{evaluate:function(){for(var Ar=[],Pr=arguments.length;Pr--;)Ar[Pr]=arguments[Pr];var Vr=_e.evaluate.apply(void 0,Ar),un=De.evaluate.apply(void 0,Ar);if(!(Vr===void 0||un===void 0))return Je(Vr,un,Wt)}}:Je(_e,De,Wt)}function Ru(p,O,W){return O.type==="color"?W=cs.parse(W):O.type==="formatted"?W=Al.fromString(W.toString()):O.type==="resolvedImage"?W=_l.fromString(W.toString()):so(W)!==O.type&&(O.type!=="enum"||!O.values[W])&&(W=void 0),$l(W,p.default,O.default)}function nl(p,O,W,pt){var At=pt-W,Ot=p-W;return At===0?0:O===1?Ot/At:(Math.pow(O,Ot)-1)/(Math.pow(O,At)-1)}var Nu=function(p,O){this.expression=p,this._warningHistory={},this._evaluator=new os,this._defaultValue=O?kt(O):null,this._enumValues=O&&O.type==="enum"?O.values:null};Nu.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._evaluator.globals=p,this._evaluator.feature=O,this._evaluator.featureState=W,this._evaluator.canonical=pt,this._evaluator.availableImages=At||null,this._evaluator.formattedSection=Ot,this.expression.evaluate(this._evaluator)},Nu.prototype.evaluate=function(p,O,W,pt,At,Ot){this._evaluator.globals=p,this._evaluator.feature=O||null,this._evaluator.featureState=W||null,this._evaluator.canonical=pt,this._evaluator.availableImages=At||null,this._evaluator.formattedSection=Ot||null;try{var Wt=this.expression.evaluate(this._evaluator);if(Wt==null||typeof Wt=="number"&&Wt!==Wt)return this._defaultValue;if(this._enumValues&&!(Wt in this._enumValues))throw new bs("Expected value to be one of "+Object.keys(this._enumValues).map(function(_e){return JSON.stringify(_e)}).join(", ")+", but found "+JSON.stringify(Wt)+" instead.");return Wt}catch(_e){return this._warningHistory[_e.message]||(this._warningHistory[_e.message]=!0,typeof console<"u"&&console.warn(_e.message)),this._defaultValue}};function Ui(p){return Array.isArray(p)&&p.length>0&&typeof p[0]=="string"&&p[0]in $i}function fo(p,O){var W=new Bs($i,[],O?xt(O):void 0),pt=W.parse(p,void 0,void 0,void 0,O&&O.type==="string"?{typeAnnotation:"coerce"}:void 0);return pt?Yo(new Nu(pt,O)):ll(W.errors)}var Ql=function(p,O){this.kind=p,this._styleExpression=O,this.isStateDependent=p!=="constant"&&!rl(O.expression)};Ql.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluateWithoutErrorHandling(p,O,W,pt,At,Ot)},Ql.prototype.evaluate=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluate(p,O,W,pt,At,Ot)};var ul=function(p,O,W,pt){this.kind=p,this.zoomStops=W,this._styleExpression=O,this.isStateDependent=p!=="camera"&&!rl(O.expression),this.interpolationType=pt};ul.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluateWithoutErrorHandling(p,O,W,pt,At,Ot)},ul.prototype.evaluate=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluate(p,O,W,pt,At,Ot)},ul.prototype.interpolationFactor=function(p,O,W){return this.interpolationType?zl.interpolationFactor(this.interpolationType,p,O,W):0};function Dc(p,O){if(p=fo(p,O),p.result==="error")return p;var W=p.value.expression,pt=jc(W);if(!pt&&!el(O))return ll([new No("","data expressions not supported")]);var At=Kl(W,["zoom"]);if(!At&&!Rs(O))return ll([new No("","zoom expressions not supported")]);var Ot=at(W);if(!Ot&&!At)return ll([new No("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ot instanceof No)return ll([Ot]);if(Ot instanceof zl&&!bi(O))return ll([new No("",'"interpolate" expressions cannot be used with this property')]);if(!Ot)return Yo(pt?new Ql("constant",p.value):new Ql("source",p.value));var Wt=Ot instanceof zl?Ot.interpolation:void 0;return Yo(pt?new ul("camera",p.value,Ot.labels,Wt):new ul("composite",p.value,Ot.labels,Wt))}var Pt=function(p,O){this._parameters=p,this._specification=O,Ms(this,Ll(this._parameters,this._specification))};Pt.deserialize=function(p){return new Pt(p._parameters,p._specification)},Pt.serialize=function(p){return{_parameters:p._parameters,_specification:p._specification}};function L(p,O){if(ws(p))return new Pt(p,O);if(Ui(p)){var W=Dc(p,O);if(W.result==="error")throw new Error(W.value.map(function(At){return At.key+": "+At.message}).join(", "));return W.value}else{var pt=p;return typeof p=="string"&&O.type==="color"&&(pt=cs.parse(p)),{kind:"constant",evaluate:function(){return pt}}}}function at(p){var O=null;if(p instanceof Fu)O=at(p.result);else if(p instanceof su)for(var W=0,pt=p.args;Wpt.maximum?[new li(O,W,W+" is greater than the maximum value "+pt.maximum)]:[]}function Pe(p){var O=p.valueSpec,W=Di(p.value.type),pt,At={},Ot,Wt,_e=W!=="categorical"&&p.value.property===void 0,De=!_e,Je=so(p.value.stops)==="array"&&so(p.value.stops[0])==="array"&&so(p.value.stops[0][0])==="object",sr=Lt({key:p.key,value:p.value,valueSpec:p.styleSpec.function,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{stops:Ar,default:un}});return W==="identity"&&_e&&sr.push(new li(p.key,p.value,'missing required property "property"')),W!=="identity"&&!p.value.stops&&sr.push(new li(p.key,p.value,'missing required property "stops"')),W==="exponential"&&p.valueSpec.expression&&!bi(p.valueSpec)&&sr.push(new li(p.key,p.value,"exponential functions not supported")),p.styleSpec.$version>=8&&(De&&!el(p.valueSpec)?sr.push(new li(p.key,p.value,"property functions not supported")):_e&&!Rs(p.valueSpec)&&sr.push(new li(p.key,p.value,"zoom functions not supported"))),(W==="categorical"||Je)&&p.value.property===void 0&&sr.push(new li(p.key,p.value,'"property" property is required')),sr;function Ar(Fn){if(W==="identity")return[new li(Fn.key,Fn.value,'identity function may not have a "stops" property')];var ga=[],pa=Fn.value;return ga=ga.concat(le({key:Fn.key,value:pa,valueSpec:Fn.valueSpec,style:Fn.style,styleSpec:Fn.styleSpec,arrayElementValidator:Pr})),so(pa)==="array"&&pa.length===0&&ga.push(new li(Fn.key,pa,"array must have at least one stop")),ga}function Pr(Fn){var ga=[],pa=Fn.value,Ea=Fn.key;if(so(pa)!=="array")return[new li(Ea,pa,"array expected, "+so(pa)+" found")];if(pa.length!==2)return[new li(Ea,pa,"array length 2 expected, length "+pa.length+" found")];if(Je){if(so(pa[0])!=="object")return[new li(Ea,pa,"object expected, "+so(pa[0])+" found")];if(pa[0].zoom===void 0)return[new li(Ea,pa,"object stop key must have zoom")];if(pa[0].value===void 0)return[new li(Ea,pa,"object stop key must have value")];if(Wt&&Wt>Di(pa[0].zoom))return[new li(Ea,pa[0].zoom,"stop zoom values must appear in ascending order")];Di(pa[0].zoom)!==Wt&&(Wt=Di(pa[0].zoom),Ot=void 0,At={}),ga=ga.concat(Lt({key:Ea+"[0]",value:pa[0],valueSpec:{zoom:{}},style:Fn.style,styleSpec:Fn.styleSpec,objectElementValidators:{zoom:xe,value:Vr}}))}else ga=ga.concat(Vr({key:Ea+"[0]",value:pa[0],style:Fn.style,styleSpec:Fn.styleSpec},pa));return Ui(_s(pa[1]))?ga.concat([new li(Ea+"[1]",pa[1],"expressions are not allowed in function stops.")]):ga.concat(Xo({key:Ea+"[1]",value:pa[1],valueSpec:O,style:Fn.style,styleSpec:Fn.styleSpec}))}function Vr(Fn,ga){var pa=so(Fn.value),Ea=Di(Fn.value),ja=Fn.value!==null?Fn.value:ga;if(!pt)pt=pa;else if(pa!==pt)return[new li(Fn.key,ja,pa+" stop domain type must match previous stop domain type "+pt)];if(pa!=="number"&&pa!=="string"&&pa!=="boolean")return[new li(Fn.key,ja,"stop domain value must be a number, string, or boolean")];if(pa!=="number"&&W!=="categorical"){var Aa="number expected, "+pa+" found";return el(O)&&W===void 0&&(Aa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new li(Fn.key,ja,Aa)]}return W==="categorical"&&pa==="number"&&(!isFinite(Ea)||Math.floor(Ea)!==Ea)?[new li(Fn.key,ja,"integer expected, found "+Ea)]:W!=="categorical"&&pa==="number"&&Ot!==void 0&&Ea=2&&p[1]!=="$id"&&p[1]!=="$type";case"in":return p.length>=3&&(typeof p[1]!="string"||Array.isArray(p[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return p.length!==3||Array.isArray(p[1])||Array.isArray(p[2]);case"any":case"all":for(var O=0,W=p.slice(1);OO?1:0}function ce(p){if(!Array.isArray(p))return!1;if(p[0]==="within")return!0;for(var O=1;O"||O==="<="||O===">="?ye(p[1],p[2],O):O==="any"?ze(p.slice(1)):O==="all"?["all"].concat(p.slice(1).map(Te)):O==="none"?["all"].concat(p.slice(1).map(Te).map(gr)):O==="in"?rr(p[1],p.slice(2)):O==="!in"?gr(rr(p[1],p.slice(2))):O==="has"?fr(p[1]):O==="!has"?gr(fr(p[1])):O==="within"?p:!0;return W}function ye(p,O,W){switch(p){case"$type":return["filter-type-"+W,O];case"$id":return["filter-id-"+W,O];default:return["filter-"+W,p,O]}}function ze(p){return["any"].concat(p.map(Te))}function rr(p,O){if(O.length===0)return!1;switch(p){case"$type":return["filter-type-in",["literal",O]];case"$id":return["filter-id-in",["literal",O]];default:return O.length>200&&!O.some(function(W){return typeof W!=typeof O[0]})?["filter-in-large",p,["literal",O.sort(ae)]]:["filter-in-small",p,["literal",O]]}}function fr(p){switch(p){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",p]}}function gr(p){return["!",p]}function Lr(p){return Jr(_s(p.value))?$e(Ms({},p,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hr(p)}function Hr(p){var O=p.value,W=p.key;if(so(O)!=="array")return[new li(W,O,"array expected, "+so(O)+" found")];var pt=p.styleSpec,At,Ot=[];if(O.length<1)return[new li(W,O,"filter array must have at least 1 element")];switch(Ot=Ot.concat(Br({key:W+"[0]",value:O[0],valueSpec:pt.filter_operator,style:p.style,styleSpec:p.styleSpec})),Di(O[0])){case"<":case"<=":case">":case">=":O.length>=2&&Di(O[1])==="$type"&&Ot.push(new li(W,O,'"$type" cannot be use with operator "'+O[0]+'"'));case"==":case"!=":O.length!==3&&Ot.push(new li(W,O,'filter array for operator "'+O[0]+'" must have 3 elements'));case"in":case"!in":O.length>=2&&(At=so(O[1]),At!=="string"&&Ot.push(new li(W+"[1]",O[1],"string expected, "+At+" found")));for(var Wt=2;Wt=sr[Vr+0]&&pt>=sr[Vr+1])?(Wt[Pr]=!0,Ot.push(Je[Pr])):Wt[Pr]=!1}}},Xt.prototype._forEachCell=function(p,O,W,pt,At,Ot,Wt,_e){for(var De=this._convertToCellCoord(p),Je=this._convertToCellCoord(O),sr=this._convertToCellCoord(W),Ar=this._convertToCellCoord(pt),Pr=De;Pr<=sr;Pr++)for(var Vr=Je;Vr<=Ar;Vr++){var un=this.d*Vr+Pr;if(!(_e&&!_e(this._convertFromCellCoord(Pr),this._convertFromCellCoord(Vr),this._convertFromCellCoord(Pr+1),this._convertFromCellCoord(Vr+1)))&&At.call(this,p,O,W,pt,un,Ot,Wt,_e))return}},Xt.prototype._convertFromCellCoord=function(p){return(p-this.padding)/this.scale},Xt.prototype._convertToCellCoord=function(p){return Math.max(0,Math.min(this.d-1,Math.floor(p*this.scale)+this.padding))},Xt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var p=this.cells,O=Et+this.cells.length+1+1,W=0,pt=0;pt=0)){var Ar=p[sr];Je[sr]=we[De].shallow.indexOf(sr)>=0?Ar:Sr(Ar,O)}p instanceof Error&&(Je.message=p.message)}if(Je.$name)throw new Error("$name property is reserved for worker serialization logic.");return De!=="Object"&&(Je.$name=De),Je}throw new Error("can't serialize object of type "+typeof p)}function Wr(p){if(p==null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||p instanceof Boolean||p instanceof Number||p instanceof String||p instanceof Date||p instanceof RegExp||or(p)||Cr(p)||ArrayBuffer.isView(p)||p instanceof fe)return p;if(Array.isArray(p))return p.map(Wr);if(typeof p=="object"){var O=p.$name||"Object",W=we[O],pt=W.klass;if(!pt)throw new Error("can't deserialize unregistered class "+O);if(pt.deserialize)return pt.deserialize(p);for(var At=Object.create(pt.prototype),Ot=0,Wt=Object.keys(p);Ot=0?De:Wr(De)}}return At}throw new Error("can't deserialize object of type "+typeof p)}var an=function(){this.first=!0};an.prototype.update=function(p,O){var W=Math.floor(p);return this.first?(this.first=!1,this.lastIntegerZoom=W,this.lastIntegerZoomTime=0,this.lastZoom=p,this.lastFloorZoom=W,!0):(this.lastFloorZoom>W?(this.lastIntegerZoom=W+1,this.lastIntegerZoomTime=O):this.lastFloorZoom=128&&p<=255},Arabic:function(p){return p>=1536&&p<=1791},"Arabic Supplement":function(p){return p>=1872&&p<=1919},"Arabic Extended-A":function(p){return p>=2208&&p<=2303},"Hangul Jamo":function(p){return p>=4352&&p<=4607},"Unified Canadian Aboriginal Syllabics":function(p){return p>=5120&&p<=5759},Khmer:function(p){return p>=6016&&p<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(p){return p>=6320&&p<=6399},"General Punctuation":function(p){return p>=8192&&p<=8303},"Letterlike Symbols":function(p){return p>=8448&&p<=8527},"Number Forms":function(p){return p>=8528&&p<=8591},"Miscellaneous Technical":function(p){return p>=8960&&p<=9215},"Control Pictures":function(p){return p>=9216&&p<=9279},"Optical Character Recognition":function(p){return p>=9280&&p<=9311},"Enclosed Alphanumerics":function(p){return p>=9312&&p<=9471},"Geometric Shapes":function(p){return p>=9632&&p<=9727},"Miscellaneous Symbols":function(p){return p>=9728&&p<=9983},"Miscellaneous Symbols and Arrows":function(p){return p>=11008&&p<=11263},"CJK Radicals Supplement":function(p){return p>=11904&&p<=12031},"Kangxi Radicals":function(p){return p>=12032&&p<=12255},"Ideographic Description Characters":function(p){return p>=12272&&p<=12287},"CJK Symbols and Punctuation":function(p){return p>=12288&&p<=12351},Hiragana:function(p){return p>=12352&&p<=12447},Katakana:function(p){return p>=12448&&p<=12543},Bopomofo:function(p){return p>=12544&&p<=12591},"Hangul Compatibility Jamo":function(p){return p>=12592&&p<=12687},Kanbun:function(p){return p>=12688&&p<=12703},"Bopomofo Extended":function(p){return p>=12704&&p<=12735},"CJK Strokes":function(p){return p>=12736&&p<=12783},"Katakana Phonetic Extensions":function(p){return p>=12784&&p<=12799},"Enclosed CJK Letters and Months":function(p){return p>=12800&&p<=13055},"CJK Compatibility":function(p){return p>=13056&&p<=13311},"CJK Unified Ideographs Extension A":function(p){return p>=13312&&p<=19903},"Yijing Hexagram Symbols":function(p){return p>=19904&&p<=19967},"CJK Unified Ideographs":function(p){return p>=19968&&p<=40959},"Yi Syllables":function(p){return p>=40960&&p<=42127},"Yi Radicals":function(p){return p>=42128&&p<=42191},"Hangul Jamo Extended-A":function(p){return p>=43360&&p<=43391},"Hangul Syllables":function(p){return p>=44032&&p<=55215},"Hangul Jamo Extended-B":function(p){return p>=55216&&p<=55295},"Private Use Area":function(p){return p>=57344&&p<=63743},"CJK Compatibility Ideographs":function(p){return p>=63744&&p<=64255},"Arabic Presentation Forms-A":function(p){return p>=64336&&p<=65023},"Vertical Forms":function(p){return p>=65040&&p<=65055},"CJK Compatibility Forms":function(p){return p>=65072&&p<=65103},"Small Form Variants":function(p){return p>=65104&&p<=65135},"Arabic Presentation Forms-B":function(p){return p>=65136&&p<=65279},"Halfwidth and Fullwidth Forms":function(p){return p>=65280&&p<=65519}};function ta(p){for(var O=0,W=p;O=65097&&p<=65103)||on["CJK Compatibility Ideographs"](p)||on["CJK Compatibility"](p)||on["CJK Radicals Supplement"](p)||on["CJK Strokes"](p)||on["CJK Symbols and Punctuation"](p)&&!(p>=12296&&p<=12305)&&!(p>=12308&&p<=12319)&&p!==12336||on["CJK Unified Ideographs Extension A"](p)||on["CJK Unified Ideographs"](p)||on["Enclosed CJK Letters and Months"](p)||on["Hangul Compatibility Jamo"](p)||on["Hangul Jamo Extended-A"](p)||on["Hangul Jamo Extended-B"](p)||on["Hangul Jamo"](p)||on["Hangul Syllables"](p)||on.Hiragana(p)||on["Ideographic Description Characters"](p)||on.Kanbun(p)||on["Kangxi Radicals"](p)||on["Katakana Phonetic Extensions"](p)||on.Katakana(p)&&p!==12540||on["Halfwidth and Fullwidth Forms"](p)&&p!==65288&&p!==65289&&p!==65293&&!(p>=65306&&p<=65310)&&p!==65339&&p!==65341&&p!==65343&&!(p>=65371&&p<=65503)&&p!==65507&&!(p>=65512&&p<=65519)||on["Small Form Variants"](p)&&!(p>=65112&&p<=65118)&&!(p>=65123&&p<=65126)||on["Unified Canadian Aboriginal Syllabics"](p)||on["Unified Canadian Aboriginal Syllabics Extended"](p)||on["Vertical Forms"](p)||on["Yijing Hexagram Symbols"](p)||on["Yi Syllables"](p)||on["Yi Radicals"](p))}function na(p){return!!(on["Latin-1 Supplement"](p)&&(p===167||p===169||p===174||p===177||p===188||p===189||p===190||p===215||p===247)||on["General Punctuation"](p)&&(p===8214||p===8224||p===8225||p===8240||p===8241||p===8251||p===8252||p===8258||p===8263||p===8264||p===8265||p===8273)||on["Letterlike Symbols"](p)||on["Number Forms"](p)||on["Miscellaneous Technical"](p)&&(p>=8960&&p<=8967||p>=8972&&p<=8991||p>=8996&&p<=9e3||p===9003||p>=9085&&p<=9114||p>=9150&&p<=9165||p===9167||p>=9169&&p<=9179||p>=9186&&p<=9215)||on["Control Pictures"](p)&&p!==9251||on["Optical Character Recognition"](p)||on["Enclosed Alphanumerics"](p)||on["Geometric Shapes"](p)||on["Miscellaneous Symbols"](p)&&!(p>=9754&&p<=9759)||on["Miscellaneous Symbols and Arrows"](p)&&(p>=11026&&p<=11055||p>=11088&&p<=11097||p>=11192&&p<=11243)||on["CJK Symbols and Punctuation"](p)||on.Katakana(p)||on["Private Use Area"](p)||on["CJK Compatibility Forms"](p)||on["Small Form Variants"](p)||on["Halfwidth and Fullwidth Forms"](p)||p===8734||p===8756||p===8757||p>=9984&&p<=10087||p>=10102&&p<=10131||p===65532||p===65533)}function _n(p){return!(Yn(p)||na(p))}function Ha(p){return on.Arabic(p)||on["Arabic Supplement"](p)||on["Arabic Extended-A"](p)||on["Arabic Presentation Forms-A"](p)||on["Arabic Presentation Forms-B"](p)}function Wa(p){return p>=1424&&p<=2303||on["Arabic Presentation Forms-A"](p)||on["Arabic Presentation Forms-B"](p)}function ri(p,O){return!(!O&&Wa(p)||p>=2304&&p<=3583||p>=3840&&p<=4255||on.Khmer(p))}function xi(p){for(var O=0,W=p;O-1&&(Ii=zi.error),jo&&jo(p)};function pl(){Ns.fire(new br("pluginStateChange",{pluginStatus:Ii,pluginURL:Ji}))}var Ns=new mr,fi=function(){return Ii},Ao=function(p){return p({pluginStatus:Ii,pluginURL:Ji}),Ns.on("pluginStateChange",p),p},Bo=function(p,O,W){if(W===void 0&&(W=!1),Ii===zi.deferred||Ii===zi.loading||Ii===zi.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=Tt.resolveURL(p),Ii=zi.deferred,jo=O,pl(),W||Ds()},Ds=function(){if(Ii!==zi.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ii=zi.loading,pl(),Ji&&Yr({url:Ji},function(p){p?es(p):(Ii=zi.loaded,pl())})},Ts={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ii===zi.loaded||Ts.applyArabicShaping!=null},isLoading:function(){return Ii===zi.loading},setState:function(p){Ii=p.pluginStatus,Ji=p.pluginURL},isParsed:function(){return Ts.applyArabicShaping!=null&&Ts.processBidirectionalText!=null&&Ts.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},lu=function(){!Ts.isLoading()&&!Ts.isLoaded()&&fi()==="deferred"&&Ds()},ps=function(p,O){this.zoom=p,O?(this.now=O.now,this.fadeDuration=O.fadeDuration,this.zoomHistory=O.zoomHistory,this.transition=O.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new an,this.transition={})};ps.prototype.isSupportedScript=function(p){return ki(p,Ts.isLoaded())},ps.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ps.prototype.getCrossfadeParameters=function(){var p=this.zoom,O=p-Math.floor(p),W=this.crossFadingFactor();return p>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:O+(1-O)*W}:{fromScale:.5,toScale:1,t:1-(1-W)*O}};var zs=function(p,O){this.property=p,this.value=O,this.expression=L(O===void 0?p.specification.default:O,p.specification)};zs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},zs.prototype.possiblyEvaluate=function(p,O,W){return this.property.possiblyEvaluate(this,p,O,W)};var Eu=function(p){this.property=p,this.value=new zs(p,void 0)};Eu.prototype.transitioned=function(p,O){return new nr(this.property,this.value,O,M({},p.transition,this.transition),p.now)},Eu.prototype.untransitioned=function(){return new nr(this.property,this.value,null,{},0)};var ie=function(p){this._properties=p,this._values=Object.create(p.defaultTransitionablePropertyValues)};ie.prototype.getValue=function(p){return I(this._values[p].value.value)},ie.prototype.setValue=function(p,O){this._values.hasOwnProperty(p)||(this._values[p]=new Eu(this._values[p].property)),this._values[p].value=new zs(this._values[p].property,O===null?void 0:I(O))},ie.prototype.getTransition=function(p){return I(this._values[p].transition)},ie.prototype.setTransition=function(p,O){this._values.hasOwnProperty(p)||(this._values[p]=new Eu(this._values[p].property)),this._values[p].transition=I(O)||void 0},ie.prototype.serialize=function(){for(var p={},O=0,W=Object.keys(this._values);Othis.end)return this.prior=null,At;if(this.value.isDataDriven())return this.prior=null,At;if(ptOt.zoomHistory.lastIntegerZoom?{from:W,to:pt}:{from:At,to:pt}},O.prototype.interpolate=function(W){return W},O})(Sn),ea=function(p){this.specification=p};ea.prototype.possiblyEvaluate=function(p,O,W,pt){if(p.value!==void 0)if(p.expression.kind==="constant"){var At=p.expression.evaluate(O,null,{},W,pt);return this._calculate(At,At,At,O)}else return this._calculate(p.expression.evaluate(new ps(Math.floor(O.zoom-1),O)),p.expression.evaluate(new ps(Math.floor(O.zoom),O)),p.expression.evaluate(new ps(Math.floor(O.zoom+1),O)),O)},ea.prototype._calculate=function(p,O,W,pt){var At=pt.zoom;return At>pt.zoomHistory.lastIntegerZoom?{from:p,to:O}:{from:W,to:O}},ea.prototype.interpolate=function(p){return p};var ka=function(p){this.specification=p};ka.prototype.possiblyEvaluate=function(p,O,W,pt){return!!p.expression.evaluate(O,null,{},W,pt)},ka.prototype.interpolate=function(){return!1};var Ka=function(p){this.properties=p,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var O in p){var W=p[O];W.specification.overridable&&this.overridableProperties.push(O);var pt=this.defaultPropertyValues[O]=new zs(W,void 0),At=this.defaultTransitionablePropertyValues[O]=new Eu(W);this.defaultTransitioningPropertyValues[O]=At.untransitioned(),this.defaultPossiblyEvaluatedValues[O]=pt.possiblyEvaluate({})}};Ve("DataDrivenProperty",Sn),Ve("DataConstantProperty",qr),Ve("CrossFadedDataDrivenProperty",sa),Ve("CrossFadedProperty",ea),Ve("ColorRampProperty",ka);var Va="-transition",fa=(function(p){function O(W,pt){if(p.call(this),this.id=W.id,this.type=W.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},W.type!=="custom"&&(W=W,this.metadata=W.metadata,this.minzoom=W.minzoom,this.maxzoom=W.maxzoom,W.type!=="background"&&(this.source=W.source,this.sourceLayer=W["source-layer"],this.filter=W.filter),pt.layout&&(this._unevaluatedLayout=new sn(pt.layout)),pt.paint)){this._transitionablePaint=new ie(pt.paint);for(var At in W.paint)this.setPaintProperty(At,W.paint[At],{validate:!1});for(var Ot in W.layout)this.setLayoutProperty(Ot,W.layout[Ot],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Tn(pt.paint)}}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},O.prototype.getLayoutProperty=function(W){return W==="visibility"?this.visibility:this._unevaluatedLayout.getValue(W)},O.prototype.setLayoutProperty=function(W,pt,At){if(At===void 0&&(At={}),pt!=null){var Ot="layers."+this.id+".layout."+W;if(this._validate(Sl,Ot,W,pt,At))return}if(W==="visibility"){this.visibility=pt;return}this._unevaluatedLayout.setValue(W,pt)},O.prototype.getPaintProperty=function(W){return D(W,Va)?this._transitionablePaint.getTransition(W.slice(0,-Va.length)):this._transitionablePaint.getValue(W)},O.prototype.setPaintProperty=function(W,pt,At){if(At===void 0&&(At={}),pt!=null){var Ot="layers."+this.id+".paint."+W;if(this._validate(hl,Ot,W,pt,At))return!1}if(D(W,Va))return this._transitionablePaint.setTransition(W.slice(0,-Va.length),pt||void 0),!1;var Wt=this._transitionablePaint._values[W],_e=Wt.property.specification["property-type"]==="cross-faded-data-driven",De=Wt.value.isDataDriven(),Je=Wt.value;this._transitionablePaint.setValue(W,pt),this._handleSpecialPaintPropertyUpdate(W);var sr=this._transitionablePaint._values[W].value,Ar=sr.isDataDriven();return Ar||De||_e||this._handleOverridablePaintPropertyUpdate(W,Je,sr)},O.prototype._handleSpecialPaintPropertyUpdate=function(W){},O.prototype._handleOverridablePaintPropertyUpdate=function(W,pt,At){return!1},O.prototype.isHidden=function(W){return this.minzoom&&W=this.maxzoom?!0:this.visibility==="none"},O.prototype.updateTransitions=function(W){this._transitioningPaint=this._transitionablePaint.transitioned(W,this._transitioningPaint)},O.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},O.prototype.recalculate=function(W,pt){W.getCrossfadeParameters&&(this._crossfadeParameters=W.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(W,void 0,pt)),this.paint=this._transitioningPaint.possiblyEvaluate(W,void 0,pt)},O.prototype.serialize=function(){var W={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(W.layout=W.layout||{},W.layout.visibility=this.visibility),R(W,function(pt,At){return pt!==void 0&&!(At==="layout"&&!Object.keys(pt).length)&&!(At==="paint"&&!Object.keys(pt).length)})},O.prototype._validate=function(W,pt,At,Ot,Wt){return Wt===void 0&&(Wt={}),Wt&&Wt.validate===!1?!1:tu(this,W.call(To,{key:pt,layerType:this.type,objectKey:At,value:Ot,styleSpec:Da,style:{glyphs:!0,sprite:!0}}))},O.prototype.is3D=function(){return!1},O.prototype.isTileClipped=function(){return!1},O.prototype.hasOffscreenPass=function(){return!1},O.prototype.resize=function(){},O.prototype.isStateDependent=function(){for(var W in this.paint._values){var pt=this.paint.get(W);if(!(!(pt instanceof zn)||!el(pt.property.specification))&&(pt.value.kind==="source"||pt.value.kind==="composite")&&pt.value.isStateDependent)return!0}return!1},O})(mr),Un={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Nr=function(p,O){this._structArray=p,this._pos1=O*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},fn=128,Xn=5,jn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};jn.serialize=function(p,O){return p._trim(),O&&(p.isTransferred=!0,O.push(p.arrayBuffer)),{length:p.length,arrayBuffer:p.arrayBuffer}},jn.deserialize=function(p){var O=Object.create(this.prototype);return O.arrayBuffer=p.arrayBuffer,O.length=p.length,O.capacity=p.arrayBuffer.byteLength/O.bytesPerElement,O._refreshViews(),O},jn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},jn.prototype.clear=function(){this.length=0},jn.prototype.resize=function(p){this.reserve(p),this.length=p},jn.prototype.reserve=function(p){if(p>this.capacity){this.capacity=Math.max(p,Math.floor(this.capacity*Xn),fn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var O=this.uint8;this._refreshViews(),O&&this.uint8.set(O)}},jn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function kn(p,O){O===void 0&&(O=1);var W=0,pt=0,At=p.map(function(Wt){var _e=Ia(Wt.type),De=W=ya(W,Math.max(O,_e)),Je=Wt.components||1;return pt=Math.max(pt,_e),W+=_e*Je,{name:Wt.name,type:Wt.type,components:Je,offset:De}}),Ot=ya(W,Math.max(pt,O));return{members:At,size:Ot,alignment:O}}function Ia(p){return Un[p].BYTES_PER_ELEMENT}function ya(p,O){return Math.ceil(p/O)*O}var qa=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.int16[Ot+0]=pt,this.int16[Ot+1]=At,W},O})(jn);qa.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",qa);var Rn=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*4;return this.int16[_e+0]=pt,this.int16[_e+1]=At,this.int16[_e+2]=Ot,this.int16[_e+3]=Wt,W},O})(jn);Rn.prototype.bytesPerElement=8,Ve("StructArrayLayout4i8",Rn);var An=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*6;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.int16[Je+2]=Ot,this.int16[Je+3]=Wt,this.int16[Je+4]=_e,this.int16[Je+5]=De,W},O})(jn);An.prototype.bytesPerElement=12,Ve("StructArrayLayout2i4i12",An);var Pa=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*4,sr=W*8;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.uint8[sr+4]=Ot,this.uint8[sr+5]=Wt,this.uint8[sr+6]=_e,this.uint8[sr+7]=De,W},O})(jn);Pa.prototype.bytesPerElement=8,Ve("StructArrayLayout2i4ub8",Pa);var ba=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.float32[Ot+0]=pt,this.float32[Ot+1]=At,W},O})(jn);ba.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",ba);var aa=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){var Pr=this.length;return this.resize(Pr+1),this.emplace(Pr,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr){var Vr=W*10;return this.uint16[Vr+0]=pt,this.uint16[Vr+1]=At,this.uint16[Vr+2]=Ot,this.uint16[Vr+3]=Wt,this.uint16[Vr+4]=_e,this.uint16[Vr+5]=De,this.uint16[Vr+6]=Je,this.uint16[Vr+7]=sr,this.uint16[Vr+8]=Ar,this.uint16[Vr+9]=Pr,W},O})(jn);aa.prototype.bytesPerElement=20,Ve("StructArrayLayout10ui20",aa);var oa=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr){var un=this.length;return this.resize(un+1),this.emplace(un,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un){var Fn=W*12;return this.int16[Fn+0]=pt,this.int16[Fn+1]=At,this.int16[Fn+2]=Ot,this.int16[Fn+3]=Wt,this.uint16[Fn+4]=_e,this.uint16[Fn+5]=De,this.uint16[Fn+6]=Je,this.uint16[Fn+7]=sr,this.int16[Fn+8]=Ar,this.int16[Fn+9]=Pr,this.int16[Fn+10]=Vr,this.int16[Fn+11]=un,W},O})(jn);oa.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",oa);var Sa=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.float32[Wt+0]=pt,this.float32[Wt+1]=At,this.float32[Wt+2]=Ot,W},O})(jn);Sa.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",Sa);var _i=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.uint32[At+0]=pt,W},O})(jn);_i.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",_i);var pi=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr){var Ar=this.length;return this.resize(Ar+1),this.emplace(Ar,W,pt,At,Ot,Wt,_e,De,Je,sr)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){var Pr=W*10,Vr=W*5;return this.int16[Pr+0]=pt,this.int16[Pr+1]=At,this.int16[Pr+2]=Ot,this.int16[Pr+3]=Wt,this.int16[Pr+4]=_e,this.int16[Pr+5]=De,this.uint32[Vr+3]=Je,this.uint16[Pr+8]=sr,this.uint16[Pr+9]=Ar,W},O})(jn);pi.prototype.bytesPerElement=20,Ve("StructArrayLayout6i1ul2ui20",pi);var Ma=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*6;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.int16[Je+2]=Ot,this.int16[Je+3]=Wt,this.int16[Je+4]=_e,this.int16[Je+5]=De,W},O})(jn);Ma.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",Ma);var Na=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt){var _e=this.length;return this.resize(_e+1),this.emplace(_e,W,pt,At,Ot,Wt)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e){var De=W*4,Je=W*8;return this.float32[De+0]=pt,this.float32[De+1]=At,this.float32[De+2]=Ot,this.int16[Je+6]=Wt,this.int16[Je+7]=_e,W},O})(jn);Na.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",Na);var ui=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*12,De=W*3;return this.uint8[_e+0]=pt,this.uint8[_e+1]=At,this.float32[De+1]=Ot,this.float32[De+2]=Wt,W},O})(jn);ui.prototype.bytesPerElement=12,Ve("StructArrayLayout2ub2f12",ui);var gi=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.uint16[Wt+0]=pt,this.uint16[Wt+1]=At,this.uint16[Wt+2]=Ot,W},O})(jn);gi.prototype.bytesPerElement=6,Ve("StructArrayLayout3ui6",gi);var Ri=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea){var ja=this.length;return this.resize(ja+1),this.emplace(ja,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja){var Aa=W*24,$a=W*12,hi=W*48;return this.int16[Aa+0]=pt,this.int16[Aa+1]=At,this.uint16[Aa+2]=Ot,this.uint16[Aa+3]=Wt,this.uint32[$a+2]=_e,this.uint32[$a+3]=De,this.uint32[$a+4]=Je,this.uint16[Aa+10]=sr,this.uint16[Aa+11]=Ar,this.uint16[Aa+12]=Pr,this.float32[$a+7]=Vr,this.float32[$a+8]=un,this.uint8[hi+36]=Fn,this.uint8[hi+37]=ga,this.uint8[hi+38]=pa,this.uint32[$a+10]=Ea,this.int16[Aa+22]=ja,W},O})(jn);Ri.prototype.bytesPerElement=48,Ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ri);var ds=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo){var vo=this.length;return this.resize(vo+1),this.emplace(vo,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo,vo){var bo=W*34,ol=W*17;return this.int16[bo+0]=pt,this.int16[bo+1]=At,this.int16[bo+2]=Ot,this.int16[bo+3]=Wt,this.int16[bo+4]=_e,this.int16[bo+5]=De,this.int16[bo+6]=Je,this.int16[bo+7]=sr,this.uint16[bo+8]=Ar,this.uint16[bo+9]=Pr,this.uint16[bo+10]=Vr,this.uint16[bo+11]=un,this.uint16[bo+12]=Fn,this.uint16[bo+13]=ga,this.uint16[bo+14]=pa,this.uint16[bo+15]=Ea,this.uint16[bo+16]=ja,this.uint16[bo+17]=Aa,this.uint16[bo+18]=$a,this.uint16[bo+19]=hi,this.uint16[bo+20]=Si,this.uint16[bo+21]=Ei,this.uint16[bo+22]=ro,this.uint32[ol+12]=no,this.float32[ol+13]=go,this.float32[ol+14]=Mo,this.float32[ol+15]=Vo,this.float32[ol+16]=vo,W},O})(jn);ds.prototype.bytesPerElement=68,Ve("StructArrayLayout8i15ui1ul4f68",ds);var rs=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.float32[At+0]=pt,W},O})(jn);rs.prototype.bytesPerElement=4,Ve("StructArrayLayout1f4",rs);var Zi=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.int16[Wt+0]=pt,this.int16[Wt+1]=At,this.int16[Wt+2]=Ot,W},O})(jn);Zi.prototype.bytesPerElement=6,Ve("StructArrayLayout3i6",Zi);var Zs=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*2,_e=W*4;return this.uint32[Wt+0]=pt,this.uint16[_e+2]=At,this.uint16[_e+3]=Ot,W},O})(jn);Zs.prototype.bytesPerElement=8,Ve("StructArrayLayout1ul2ui8",Zs);var Zo=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.uint16[Ot+0]=pt,this.uint16[Ot+1]=At,W},O})(jn);Zo.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Zo);var Qs=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.uint16[At+0]=pt,W},O})(jn);Qs.prototype.bytesPerElement=2,Ve("StructArrayLayout1ui2",Qs);var El=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*4;return this.float32[_e+0]=pt,this.float32[_e+1]=At,this.float32[_e+2]=Ot,this.float32[_e+3]=Wt,W},O})(jn);El.prototype.bytesPerElement=16,Ve("StructArrayLayout4f16",El);var Cl=(function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return W.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},W.x1.get=function(){return this._structArray.int16[this._pos2+2]},W.y1.get=function(){return this._structArray.int16[this._pos2+3]},W.x2.get=function(){return this._structArray.int16[this._pos2+4]},W.y2.get=function(){return this._structArray.int16[this._pos2+5]},W.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},W.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},W.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},W.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(O.prototype,W),O})(Nr);Cl.prototype.size=20;var Hs=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Cl(this,W)},O})(pi);Ve("CollisionBoxArray",Hs);var js=(function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return W.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},W.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},W.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},W.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},W.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},W.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},W.segment.get=function(){return this._structArray.uint16[this._pos2+10]},W.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},W.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},W.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},W.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},W.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},W.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},W.placedOrientation.set=function(pt){this._structArray.uint8[this._pos1+37]=pt},W.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},W.hidden.set=function(pt){this._structArray.uint8[this._pos1+38]=pt},W.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},W.crossTileID.set=function(pt){this._structArray.uint32[this._pos4+10]=pt},W.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(O.prototype,W),O})(Nr);js.prototype.size=48;var Ks=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new js(this,W)},O})(Ri);Ve("PlacedSymbolArray",Ks);var Mi=(function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return W.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},W.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},W.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},W.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},W.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},W.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},W.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},W.key.get=function(){return this._structArray.uint16[this._pos2+8]},W.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},W.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},W.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},W.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},W.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},W.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},W.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},W.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},W.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},W.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},W.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},W.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},W.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},W.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},W.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},W.crossTileID.set=function(pt){this._structArray.uint32[this._pos4+12]=pt},W.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},W.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},W.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},W.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(O.prototype,W),O})(Nr);Mi.prototype.size=68;var Ys=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Mi(this,W)},O})(ds);Ve("SymbolInstanceArray",Ys);var Uo=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getoffsetX=function(W){return this.float32[W*1+0]},O})(rs);Ve("GlyphOffsetArray",Uo);var tl=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getx=function(W){return this.int16[W*3+0]},O.prototype.gety=function(W){return this.int16[W*3+1]},O.prototype.gettileUnitDistanceFromAnchor=function(W){return this.int16[W*3+2]},O})(Zi);Ve("SymbolLineVertexArray",tl);var Il=(function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return W.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},W.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},W.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(O.prototype,W),O})(Nr);Il.prototype.size=8;var vi=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Il(this,W)},O})(Zs);Ve("FeatureIndexArray",vi);var lo=kn([{name:"a_pos",components:2,type:"Int16"}],4),ns=lo.members,$o=function(p){p===void 0&&(p=[]),this.segments=p};$o.prototype.prepareSegment=function(p,O,W,pt){var At=this.segments[this.segments.length-1];return p>$o.MAX_VERTEX_ARRAY_LENGTH&&N("Max vertices per segment is "+$o.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+p),(!At||At.vertexLength+p>$o.MAX_VERTEX_ARRAY_LENGTH||At.sortKey!==pt)&&(At={vertexOffset:O.length,primitiveOffset:W.length,vertexLength:0,primitiveLength:0},pt!==void 0&&(At.sortKey=pt),this.segments.push(At)),At},$o.prototype.get=function(){return this.segments},$o.prototype.destroy=function(){for(var p=0,O=this.segments;p>>16)*De&65535)<<16)&4294967295,sr=sr<<15|sr>>>17,sr=(sr&65535)*Je+(((sr>>>16)*Je&65535)<<16)&4294967295,Wt^=sr,Wt=Wt<<13|Wt>>>19,_e=(Wt&65535)*5+(((Wt>>>16)*5&65535)<<16)&4294967295,Wt=(_e&65535)+27492+(((_e>>>16)+58964&65535)<<16);switch(sr=0,At){case 3:sr^=(W.charCodeAt(Ar+2)&255)<<16;case 2:sr^=(W.charCodeAt(Ar+1)&255)<<8;case 1:sr^=W.charCodeAt(Ar)&255,sr=(sr&65535)*De+(((sr>>>16)*De&65535)<<16)&4294967295,sr=sr<<15|sr>>>17,sr=(sr&65535)*Je+(((sr>>>16)*Je&65535)<<16)&4294967295,Wt^=sr}return Wt^=W.length,Wt^=Wt>>>16,Wt=(Wt&65535)*2246822507+(((Wt>>>16)*2246822507&65535)<<16)&4294967295,Wt^=Wt>>>13,Wt=(Wt&65535)*3266489909+(((Wt>>>16)*3266489909&65535)<<16)&4294967295,Wt^=Wt>>>16,Wt>>>0}p.exports=O}),ft=e(function(p){function O(W,pt){for(var At=W.length,Ot=pt^At,Wt=0,_e;At>=4;)_e=W.charCodeAt(Wt)&255|(W.charCodeAt(++Wt)&255)<<8|(W.charCodeAt(++Wt)&255)<<16|(W.charCodeAt(++Wt)&255)<<24,_e=(_e&65535)*1540483477+(((_e>>>16)*1540483477&65535)<<16),_e^=_e>>>24,_e=(_e&65535)*1540483477+(((_e>>>16)*1540483477&65535)<<16),Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16)^_e,At-=4,++Wt;switch(At){case 3:Ot^=(W.charCodeAt(Wt+2)&255)<<16;case 2:Ot^=(W.charCodeAt(Wt+1)&255)<<8;case 1:Ot^=W.charCodeAt(Wt)&255,Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16)}return Ot^=Ot>>>13,Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16),Ot^=Ot>>>15,Ot>>>0}p.exports=O}),zt=Y,Qt=Y,ne=ft;zt.murmur3=Qt,zt.murmur2=ne;var Ft=function(){this.ids=[],this.positions=[],this.indexed=!1};Ft.prototype.add=function(p,O,W,pt){this.ids.push(he(p)),this.positions.push(O,W,pt)},Ft.prototype.getPositions=function(p){for(var O=he(p),W=0,pt=this.ids.length-1;W>1;this.ids[At]>=O?pt=At:W=At+1}for(var Ot=[];this.ids[W]===O;){var Wt=this.positions[3*W],_e=this.positions[3*W+1],De=this.positions[3*W+2];Ot.push({index:Wt,start:_e,end:De}),W++}return Ot},Ft.serialize=function(p,O){var W=new Float64Array(p.ids),pt=new Uint32Array(p.positions);return Ne(W,pt,0,W.length-1),O&&O.push(W.buffer,pt.buffer),{ids:W,positions:pt}},Ft.deserialize=function(p){var O=new Ft;return O.ids=p.ids,O.positions=p.positions,O.indexed=!0,O};var $t=Math.pow(2,53)-1;function he(p){var O=+p;return!isNaN(O)&&O<=$t?O:zt(String(p))}function Ne(p,O,W,pt){for(;W>1],Ot=W-1,Wt=pt+1;;){do Ot++;while(p[Ot]At);if(Ot>=Wt)break;Ie(p,Ot,Wt),Ie(O,3*Ot,3*Wt),Ie(O,3*Ot+1,3*Wt+1),Ie(O,3*Ot+2,3*Wt+2)}Wt-WWt.x+1||DeWt.y+1)&&N("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return W}function gs(p,O){return{type:p.type,id:p.id,properties:p.properties,geometry:O?Ko(p):[]}}function Pl(p,O,W,pt,At){p.emplaceBack(O*2+(pt+1)/2,W*2+(At+1)/2)}var mo=function(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(O){return O.id}),this.index=p.index,this.hasPattern=!1,this.layoutVertexArray=new qa,this.indexArray=new gi,this.segments=new $o,this.programConfigurations=new Gn(p.layers,p.zoom),this.stateDependentLayerIds=this.layers.filter(function(O){return O.isStateDependent()}).map(function(O){return O.id})};mo.prototype.populate=function(p,O,W){var pt=this.layers[0],At=[],Ot=null;pt.type==="circle"&&(Ot=pt.layout.get("circle-sort-key"));for(var Wt=0,_e=p;Wt<_e.length;Wt+=1){var De=_e[Wt],Je=De.feature,sr=De.id,Ar=De.index,Pr=De.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,un=gs(Je,Vr);if(this.layers[0]._featureFilter.filter(new ps(this.zoom),un,W)){var Fn=Ot?Ot.evaluate(un,{},W):void 0,ga={id:sr,properties:Je.properties,type:Je.type,sourceLayerIndex:Pr,index:Ar,geometry:Vr?un.geometry:Ko(Je),patterns:{},sortKey:Fn};At.push(ga)}}Ot&&At.sort(function(ro,no){return ro.sortKey-no.sortKey});for(var pa=0,Ea=At;pa=Li||Ar<0||Ar>=Li)){var Pr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,p.sortKey),Vr=Pr.vertexLength;Pl(this.layoutVertexArray,sr,Ar,-1,-1),Pl(this.layoutVertexArray,sr,Ar,1,-1),Pl(this.layoutVertexArray,sr,Ar,1,1),Pl(this.layoutVertexArray,sr,Ar,-1,1),this.indexArray.emplaceBack(Vr,Vr+1,Vr+2),this.indexArray.emplaceBack(Vr,Vr+3,Vr+2),Pr.vertexLength+=4,Pr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,W,{},pt)},Ve("CircleBucket",mo,{omit:["layers"]});function Xs(p,O){for(var W=0;W=3){for(var Ot=0;Ot1){if(Kf(p,O))return!0;for(var pt=0;pt1?p.distSqr(W):p.distSqr(W.sub(O)._mult(At)._add(O))}function Xf(p,O){for(var W=!1,pt,At,Ot,Wt=0;WtO.y!=Ot.y>O.y&&O.x<(Ot.x-At.x)*(O.y-At.y)/(Ot.y-At.y)+At.x&&(W=!W)}return W}function xf(p,O){for(var W=!1,pt=0,At=p.length-1;ptO.y!=Wt.y>O.y&&O.x<(Wt.x-Ot.x)*(O.y-Ot.y)/(Wt.y-Ot.y)+Ot.x&&(W=!W)}return W}function Ph(p,O,W,pt,At){for(var Ot=0,Wt=p;Ot=_e.x&&At>=_e.y)return!0}var De=[new o(O,W),new o(O,At),new o(pt,At),new o(pt,W)];if(p.length>2)for(var Je=0,sr=De;JeAt.x&&O.x>At.x||p.yAt.y&&O.y>At.y)return!1;var Ot=G(p,O,W[0]);return Ot!==G(p,O,W[1])||Ot!==G(p,O,W[2])||Ot!==G(p,O,W[3])}function $f(p,O,W){var pt=O.paint.get(p).value;return pt.kind==="constant"?pt.value:W.programConfigurations.get(O.id).getMaxValue(p)}function Jf(p){return Math.sqrt(p[0]*p[0]+p[1]*p[1])}function zf(p,O,W,pt,At){if(!O[0]&&!O[1])return p;var Ot=o.convert(O)._mult(At);W==="viewport"&&Ot._rotate(-pt);for(var Wt=[],_e=0;_e0&&(Ot=1/Math.sqrt(Ot)),p[0]=O[0]*Ot,p[1]=O[1]*Ot,p[2]=O[2]*Ot,p}function c_(p,O){return p[0]*O[0]+p[1]*O[1]+p[2]*O[2]}function f_(p,O,W){var pt=O[0],At=O[1],Ot=O[2],Wt=W[0],_e=W[1],De=W[2];return p[0]=At*De-Ot*_e,p[1]=Ot*Wt-pt*De,p[2]=pt*_e-At*Wt,p}function h_(p,O,W){var pt=O[0],At=O[1],Ot=O[2];return p[0]=pt*W[0]+At*W[3]+Ot*W[6],p[1]=pt*W[1]+At*W[4]+Ot*W[7],p[2]=pt*W[2]+At*W[5]+Ot*W[8],p}var p_=Xm;(function(){var p=O0();return function(O,W,pt,At,Ot,Wt){var _e,De;for(W||(W=3),pt||(pt=0),At?De=Math.min(At*W+pt,O.length):De=O.length,_e=pt;_ep.width||At.height>p.height||W.x>p.width-At.width||W.y>p.height-At.height)throw new RangeError("out of range source coordinates for image copy");if(At.width>O.width||At.height>O.height||pt.x>O.width-At.width||pt.y>O.height-At.height)throw new RangeError("out of range destination coordinates for image copy");for(var Wt=p.data,_e=O.data,De=0;De80*W){_e=Je=p[0],De=sr=p[1];for(var un=W;unJe&&(Je=Ar),Pr>sr&&(sr=Pr);Vr=Math.max(Je-_e,sr-De),Vr=Vr!==0?1/Vr:0}return Sp(Ot,Wt,W,_e,De,Vr),Wt}function tg(p,O,W,pt,At){var Ot,Wt;if(At===og(p,O,W,pt)>0)for(Ot=O;Ot=O;Ot-=pt)Wt=Wv(Ot,p[Ot],p[Ot+1],Wt);return Wt&&Qp(Wt,Wt.next)&&(Xd(Wt),Wt=Wt.next),Wt}function Kh(p,O){if(!p)return p;O||(O=p);var W=p,pt;do if(pt=!1,!W.steiner&&(Qp(W,W.next)||uc(W.prev,W,W.next)===0)){if(Xd(W),W=O=W.prev,W===W.next)break;pt=!0}else W=W.next;while(pt||W!==O);return O}function Sp(p,O,W,pt,At,Ot,Wt){if(p){!Wt&&Ot&&rg(p,pt,At,Ot);for(var _e=p,De,Je;p.prev!==p.next;){if(De=p.prev,Je=p.next,Ot?__(p,pt,At,Ot):eg(p)){O.push(De.i/W),O.push(p.i/W),O.push(Je.i/W),Xd(p),p=Je.next,_e=Je.next;continue}if(p=Je,p===_e){Wt?Wt===1?(p=b_(Kh(p),O,W),Sp(p,O,W,pt,At,Ot,2)):Wt===2&&Vv(p,O,W,pt,At,Ot):Sp(Kh(p),O,W,pt,At,Ot,1);break}}}}function eg(p){var O=p.prev,W=p,pt=p.next;if(uc(O,W,pt)>=0)return!1;for(var At=p.next.next;At!==p.prev;){if(fp(O.x,O.y,W.x,W.y,pt.x,pt.y,At.x,At.y)&&uc(At.prev,At,At.next)>=0)return!1;At=At.next}return!0}function __(p,O,W,pt){var At=p.prev,Ot=p,Wt=p.next;if(uc(At,Ot,Wt)>=0)return!1;for(var _e=At.xOt.x?At.x>Wt.x?At.x:Wt.x:Ot.x>Wt.x?Ot.x:Wt.x,sr=At.y>Ot.y?At.y>Wt.y?At.y:Wt.y:Ot.y>Wt.y?Ot.y:Wt.y,Ar=ng(_e,De,O,W,pt),Pr=ng(Je,sr,O,W,pt),Vr=p.prevZ,un=p.nextZ;Vr&&Vr.z>=Ar&&un&&un.z<=Pr;){if(Vr!==p.prev&&Vr!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,Vr.x,Vr.y)&&uc(Vr.prev,Vr,Vr.next)>=0||(Vr=Vr.prevZ,un!==p.prev&&un!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,un.x,un.y)&&uc(un.prev,un,un.next)>=0))return!1;un=un.nextZ}for(;Vr&&Vr.z>=Ar;){if(Vr!==p.prev&&Vr!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,Vr.x,Vr.y)&&uc(Vr.prev,Vr,Vr.next)>=0)return!1;Vr=Vr.prevZ}for(;un&&un.z<=Pr;){if(un!==p.prev&&un!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,un.x,un.y)&&uc(un.prev,un,un.next)>=0)return!1;un=un.nextZ}return!0}function b_(p,O,W){var pt=p;do{var At=pt.prev,Ot=pt.next.next;!Qp(At,Ot)&&Ep(At,pt,pt.next,Ot)&&td(At,Ot)&&td(Ot,At)&&(O.push(At.i/W),O.push(pt.i/W),O.push(Ot.i/W),Xd(pt),Xd(pt.next),pt=p=Ot),pt=pt.next}while(pt!==p);return Kh(pt)}function Vv(p,O,W,pt,At,Ot){var Wt=p;do{for(var _e=Wt.next.next;_e!==Wt.prev;){if(Wt.i!==_e.i&&T_(Wt,_e)){var De=ig(Wt,_e);Wt=Kh(Wt,Wt.next),De=Kh(De,De.next),Sp(Wt,O,W,pt,At,Ot),Sp(De,O,W,pt,At,Ot);return}_e=_e.next}Wt=Wt.next}while(Wt!==p)}function Hv(p,O,W,pt){var At=[],Ot,Wt,_e,De,Je;for(Ot=0,Wt=O.length;Ot=W.next.y&&W.next.y!==W.y){var _e=W.x+(At-W.y)*(W.next.x-W.x)/(W.next.y-W.y);if(_e<=pt&&_e>Ot){if(Ot=_e,_e===pt){if(At===W.y)return W;if(At===W.next.y)return W.next}Wt=W.x=W.x&&W.x>=Je&&pt!==W.x&&fp(AtWt.x||W.x===Wt.x&&qv(Wt,W)))&&(Wt=W,Ar=Pr)),W=W.next;while(W!==De);return Wt}function qv(p,O){return uc(p.prev,p,O.prev)<0&&uc(O.next,p,p.next)<0}function rg(p,O,W,pt){var At=p;do At.z===null&&(At.z=ng(At.x,At.y,O,W,pt)),At.prevZ=At.prev,At.nextZ=At.next,At=At.next;while(At!==p);At.prevZ.nextZ=null,At.prevZ=null,w_(At)}function w_(p){var O,W,pt,At,Ot,Wt,_e,De,Je=1;do{for(W=p,p=null,Ot=null,Wt=0;W;){for(Wt++,pt=W,_e=0,O=0;O0||De>0&&pt;)_e!==0&&(De===0||!pt||W.z<=pt.z)?(At=W,W=W.nextZ,_e--):(At=pt,pt=pt.nextZ,De--),Ot?Ot.nextZ=At:p=At,At.prevZ=Ot,Ot=At;W=pt}Ot.nextZ=null,Je*=2}while(Wt>1);return p}function ng(p,O,W,pt,At){return p=32767*(p-W)*At,O=32767*(O-pt)*At,p=(p|p<<8)&16711935,p=(p|p<<4)&252645135,p=(p|p<<2)&858993459,p=(p|p<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,p|O<<1}function H0(p){var O=p,W=p;do(O.x=0&&(p-Wt)*(pt-_e)-(W-Wt)*(O-_e)>=0&&(W-Wt)*(Ot-_e)-(At-Wt)*(pt-_e)>=0}function T_(p,O){return p.next.i!==O.i&&p.prev.i!==O.i&&!ag(p,O)&&(td(p,O)&&td(O,p)&&q0(p,O)&&(uc(p.prev,p,O.prev)||uc(p,O.prev,O))||Qp(p,O)&&uc(p.prev,p,p.next)>0&&uc(O.prev,O,O.next)>0)}function uc(p,O,W){return(O.y-p.y)*(W.x-O.x)-(O.x-p.x)*(W.y-O.y)}function Qp(p,O){return p.x===O.x&&p.y===O.y}function Ep(p,O,W,pt){var At=Yd(uc(p,O,W)),Ot=Yd(uc(p,O,pt)),Wt=Yd(uc(W,pt,p)),_e=Yd(uc(W,pt,O));return!!(At!==Ot&&Wt!==_e||At===0&&Kd(p,W,O)||Ot===0&&Kd(p,pt,O)||Wt===0&&Kd(W,p,pt)||_e===0&&Kd(W,O,pt))}function Kd(p,O,W){return O.x<=Math.max(p.x,W.x)&&O.x>=Math.min(p.x,W.x)&&O.y<=Math.max(p.y,W.y)&&O.y>=Math.min(p.y,W.y)}function Yd(p){return p>0?1:p<0?-1:0}function ag(p,O){var W=p;do{if(W.i!==p.i&&W.next.i!==p.i&&W.i!==O.i&&W.next.i!==O.i&&Ep(W,W.next,p,O))return!0;W=W.next}while(W!==p);return!1}function td(p,O){return uc(p.prev,p,p.next)<0?uc(p,O,p.next)>=0&&uc(p,p.prev,O)>=0:uc(p,O,p.prev)<0||uc(p,p.next,O)<0}function q0(p,O){var W=p,pt=!1,At=(p.x+O.x)/2,Ot=(p.y+O.y)/2;do W.y>Ot!=W.next.y>Ot&&W.next.y!==W.y&&At<(W.next.x-W.x)*(Ot-W.y)/(W.next.y-W.y)+W.x&&(pt=!pt),W=W.next;while(W!==p);return pt}function ig(p,O){var W=new W0(p.i,p.x,p.y),pt=new W0(O.i,O.x,O.y),At=p.next,Ot=O.prev;return p.next=O,O.prev=p,W.next=At,At.prev=W,pt.next=W,W.prev=pt,Ot.next=pt,pt.prev=Ot,pt}function Wv(p,O,W,pt){var At=new W0(p,O,W);return pt?(At.next=pt.next,At.prev=pt,pt.next.prev=At,pt.next=At):(At.prev=At,At.next=At),At}function Xd(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function W0(p,O,W){this.i=p,this.x=O,this.y=W,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}V0.deviation=function(p,O,W,pt){var At=O&&O.length,Ot=At?O[0]*W:p.length,Wt=Math.abs(og(p,0,Ot,W));if(At)for(var _e=0,De=O.length;_e0&&(pt+=p[At-1].length,W.holes.push(pt))}return W},U0.default=Uv;function k_(p,O,W,pt,At){Gv(p,O,W,pt||p.length-1,At||sg)}function Gv(p,O,W,pt,At){for(;pt>W;){if(pt-W>600){var Ot=pt-W+1,Wt=O-W+1,_e=Math.log(Ot),De=.5*Math.exp(2*_e/3),Je=.5*Math.sqrt(_e*De*(Ot-De)/Ot)*(Wt-Ot/2<0?-1:1),sr=Math.max(W,Math.floor(O-Wt*De/Ot+Je)),Ar=Math.min(pt,Math.floor(O+(Ot-Wt)*De/Ot+Je));Gv(p,O,sr,Ar,At)}var Pr=p[O],Vr=W,un=pt;for($d(p,W,O),At(p[pt],Pr)>0&&$d(p,W,pt);Vr0;)un--}At(p[W],Pr)===0?$d(p,W,un):(un++,$d(p,un,pt)),un<=O&&(W=un+1),O<=un&&(pt=un-1)}}function $d(p,O,W){var pt=p[O];p[O]=p[W],p[W]=pt}function sg(p,O){return pO?1:0}function Dh(p,O){var W=p.length;if(W<=1)return[p];for(var pt=[],At,Ot,Wt=0;Wt1)for(var De=0;De>3}if(pt--,W===1||W===2)At+=p.readSVarint(),Ot+=p.readSVarint(),W===1&&(_e&&Wt.push(_e),_e=[]),_e.push(new o(At,Ot));else if(W===7)_e&&_e.push(_e[0].clone());else throw new Error("unknown command "+W)}return _e&&Wt.push(_e),Wt},zp.prototype.bbox=function(){var p=this._pbf;p.pos=this._geometry;for(var O=p.readVarint()+p.pos,W=1,pt=0,At=0,Ot=0,Wt=1/0,_e=-1/0,De=1/0,Je=-1/0;p.pos>3}if(pt--,W===1||W===2)At+=p.readSVarint(),Ot+=p.readSVarint(),At_e&&(_e=At),OtJe&&(Je=Ot);else if(W!==7)throw new Error("unknown command "+W)}return[Wt,De,_e,Je]},zp.prototype.toGeoJSON=function(p,O,W){var pt=this.extent*Math.pow(2,W),At=this.extent*p,Ot=this.extent*O,Wt=this.loadGeometry(),_e=zp.types[this.type],De,Je;function sr(Vr){for(var un=0;un>3;O=pt===1?p.readString():pt===2?p.readFloat():pt===3?p.readDouble():pt===4?p.readVarint64():pt===5?p.readVarint():pt===6?p.readSVarint():pt===7?p.readBoolean():null}return O}ey.prototype.feature=function(p){if(p<0||p>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[p];var O=this._pbf.readVarint()+this._pbf.pos;return new ed(this._pbf,O,this.extent,this._keys,this._values)};var ny=ay;function ay(p,O){this.layers=p.readFields(iy,{},O)}function iy(p,O,W){if(p===3){var pt=new cg(W,W.readVarint()+W.pos);pt.length&&(O[pt.name]=pt)}}var oy=ny,A_=ed,M_=cg,Lp={VectorTile:oy,VectorTileFeature:A_,VectorTileLayer:M_},rd=Lp.VectorTileFeature.types,sy=500,nd=Math.pow(2,13);function ad(p,O,W,pt,At,Ot,Wt,_e){p.emplaceBack(O,W,Math.floor(pt*nd)*2+Wt,At*nd*2,Ot*nd*2,Math.round(_e))}var ch=function(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(O){return O.id}),this.index=p.index,this.hasPattern=!1,this.layoutVertexArray=new An,this.indexArray=new gi,this.programConfigurations=new Gn(p.layers,p.zoom),this.segments=new $o,this.stateDependentLayerIds=this.layers.filter(function(O){return O.isStateDependent()}).map(function(O){return O.id})};ch.prototype.populate=function(p,O,W){this.features=[],this.hasPattern=G0("fill-extrusion",this.layers,O);for(var pt=0,At=p;pt=1){var ja=Fn[pa-1];if(!K0(Ea,ja)){Pr.vertexLength+4>$o.MAX_VERTEX_ARRAY_LENGTH&&(Pr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Aa=Ea.sub(ja)._perp()._unit(),$a=ja.dist(Ea);ga+$a>32768&&(ga=0),ad(this.layoutVertexArray,Ea.x,Ea.y,Aa.x,Aa.y,0,0,ga),ad(this.layoutVertexArray,Ea.x,Ea.y,Aa.x,Aa.y,0,1,ga),ga+=$a,ad(this.layoutVertexArray,ja.x,ja.y,Aa.x,Aa.y,0,0,ga),ad(this.layoutVertexArray,ja.x,ja.y,Aa.x,Aa.y,0,1,ga);var hi=Pr.vertexLength;this.indexArray.emplaceBack(hi,hi+2,hi+1),this.indexArray.emplaceBack(hi+1,hi+2,hi+3),Pr.vertexLength+=4,Pr.primitiveLength+=2}}}}if(Pr.vertexLength+De>$o.MAX_VERTEX_ARRAY_LENGTH&&(Pr=this.segments.prepareSegment(De,this.layoutVertexArray,this.indexArray)),rd[p.type]==="Polygon"){for(var Si=[],Ei=[],ro=Pr.vertexLength,no=0,go=_e;noLi)||p.y===O.y&&(p.y<0||p.y>Li)}function Y0(p){return p.every(function(O){return O.x<0})||p.every(function(O){return O.x>Li})||p.every(function(O){return O.y<0})||p.every(function(O){return O.y>Li})}var S_=new Ka({"fill-extrusion-opacity":new qr(Da["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new qr(Da["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new qr(Da["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new sa(Da["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new qr(Da["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),E_={paint:S_},z_=(function(p){function O(W){p.call(this,W,E_)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.createBucket=function(W){return new ch(W)},O.prototype.queryRadius=function(){return Jf(this.paint.get("fill-extrusion-translate"))},O.prototype.is3D=function(){return!0},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De,Je){var sr=zf(W,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),_e.angle,De),Ar=this.paint.get("fill-extrusion-height").evaluate(pt,At),Pr=this.paint.get("fill-extrusion-base").evaluate(pt,At),Vr=ly(sr,Je,_e,0),un=fg(Ot,Pr,Ar,Je),Fn=un[0],ga=un[1];return pp(Fn,ga,Vr)},O})(fa);function Fh(p,O){return p.x*O.x+p.y*O.y}function ff(p,O){if(p.length===1){for(var W=0,pt=O[W++],At;!At||pt.equals(At);)if(At=O[W++],!At)return 1/0;for(;W=2&&p[De-1].equals(p[De-2]);)De--;for(var Je=0;Je0;if(Si&&pa>Je){var ro=Pr.dist(Vr);if(ro>2*sr){var no=Pr.sub(Pr.sub(Vr)._mult(sr/ro)._round());this.updateDistance(Vr,no),this.addCurrentVertex(no,Fn,0,0,Ar),Vr=no}}var go=Vr&&un,Mo=go?W:_e?"butt":pt;if(go&&Mo==="round"&&($aAt&&(Mo="bevel"),Mo==="bevel"&&($a>2&&(Mo="flipbevel"),$a100)Ea=ga.mult(-1);else{var Vo=$a*Fn.add(ga).mag()/Fn.sub(ga).mag();Ea._perp()._mult(Vo*(Ei?-1:1))}this.addCurrentVertex(Pr,Ea,0,0,Ar),this.addCurrentVertex(Pr,Ea.mult(-1),0,0,Ar)}else if(Mo==="bevel"||Mo==="fakeround"){var vo=-Math.sqrt($a*$a-1),bo=Ei?vo:0,ol=Ei?0:vo;if(Vr&&this.addCurrentVertex(Pr,Fn,bo,ol,Ar),Mo==="fakeround")for(var Hl=Math.round(hi*180/Math.PI/dg),vu=1;vu2*sr){var Zc=Pr.add(un.sub(Pr)._mult(sr/kf)._round());this.updateDistance(Pr,Zc),this.addCurrentVertex(Zc,ga,0,0,Ar),Pr=Zc}}}}},bf.prototype.addCurrentVertex=function(p,O,W,pt,At,Ot){Ot===void 0&&(Ot=!1);var Wt=O.x+O.y*W,_e=O.y-O.x*W,De=-O.x+O.y*pt,Je=-O.y-O.x*pt;this.addHalfVertex(p,Wt,_e,Ot,!1,W,At),this.addHalfVertex(p,De,Je,Ot,!0,-pt,At),this.distance>X0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(p,O,W,pt,At,Ot))},bf.prototype.addHalfVertex=function(p,O,W,pt,At,Ot,Wt){var _e=p.x,De=p.y,Je=this.lineClips?this.scaledDistance*(X0-1):this.scaledDistance,sr=Je*id;if(this.layoutVertexArray.emplaceBack((_e<<1)+(pt?1:0),(De<<1)+(At?1:0),Math.round(hy*O)+128,Math.round(hy*W)+128,(Ot===0?0:Ot<0?-1:1)+1|(sr&63)<<2,sr>>6),this.lineClips){var Ar=this.scaledDistance-this.lineClips.start,Pr=this.lineClips.end-this.lineClips.start,Vr=Ar/Pr;this.layoutVertexArray2.emplaceBack(Vr,this.lineClipsArray.length)}var un=Wt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,un),Wt.primitiveLength++),At?this.e2=un:this.e1=un},bf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},bf.prototype.updateDistance=function(p,O){this.distance+=p.dist(O),this.updateScaledDistance()},Ve("LineBucket",bf,{omit:["layers","patternFeatures"]});var mg=new Ka({"line-cap":new qr(Da.layout_line["line-cap"]),"line-join":new Sn(Da.layout_line["line-join"]),"line-miter-limit":new qr(Da.layout_line["line-miter-limit"]),"line-round-limit":new qr(Da.layout_line["line-round-limit"]),"line-sort-key":new Sn(Da.layout_line["line-sort-key"])}),$0=new Ka({"line-opacity":new Sn(Da.paint_line["line-opacity"]),"line-color":new Sn(Da.paint_line["line-color"]),"line-translate":new qr(Da.paint_line["line-translate"]),"line-translate-anchor":new qr(Da.paint_line["line-translate-anchor"]),"line-width":new Sn(Da.paint_line["line-width"]),"line-gap-width":new Sn(Da.paint_line["line-gap-width"]),"line-offset":new Sn(Da.paint_line["line-offset"]),"line-blur":new Sn(Da.paint_line["line-blur"]),"line-dasharray":new ea(Da.paint_line["line-dasharray"]),"line-pattern":new sa(Da.paint_line["line-pattern"]),"line-gradient":new ka(Da.paint_line["line-gradient"])}),od={paint:$0,layout:mg},gg=(function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.possiblyEvaluate=function(W,pt){return pt=new ps(Math.floor(pt.zoom),{now:pt.now,fadeDuration:pt.fadeDuration,zoomHistory:pt.zoomHistory,transition:pt.transition}),p.prototype.possiblyEvaluate.call(this,W,pt)},O.prototype.evaluate=function(W,pt,At,Ot){return pt=M({},pt,{zoom:Math.floor(pt.zoom)}),p.prototype.evaluate.call(this,W,pt,At,Ot)},O})(Sn),J0=new gg(od.paint.properties["line-width"].specification);J0.useIntegerZoom=!0;var vg=(function(p){function O(W){p.call(this,W,od),this.gradientVersion=0}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._handleSpecialPaintPropertyUpdate=function(W){if(W==="line-gradient"){var pt=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=pt._styleExpression.expression instanceof Yl,this.gradientVersion=(this.gradientVersion+1)%v}},O.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},O.prototype.recalculate=function(W,pt){p.prototype.recalculate.call(this,W,pt),this.paint._values["line-floorwidth"]=J0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,W)},O.prototype.createBucket=function(W){return new bf(W)},O.prototype.queryRadius=function(W){var pt=W,At=my($f("line-width",this,pt),$f("line-gap-width",this,pt)),Ot=$f("line-offset",this,pt);return At/2+Math.abs(Ot)+Jf(this.paint.get("line-translate"))},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De){var Je=zf(W,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_e.angle,De),sr=De/2*my(this.paint.get("line-width").evaluate(pt,At),this.paint.get("line-gap-width").evaluate(pt,At)),Ar=this.paint.get("line-offset").evaluate(pt,At);return Ar&&(Ot=H(Ot,Ar*De)),uh(Je,Ot,sr)},O.prototype.isTileClipped=function(){return!0},O})(fa);function my(p,O){return O>0?O+2*p:p}function H(p,O){for(var W=[],pt=new o(0,0),At=0;At":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Qe(p){for(var O="",W=0;W>1,sr=-7,Ar=W?At-1:0,Pr=W?-1:1,Vr=p[O+Ar];for(Ar+=Pr,Ot=Vr&(1<<-sr)-1,Vr>>=-sr,sr+=_e;sr>0;Ot=Ot*256+p[O+Ar],Ar+=Pr,sr-=8);for(Wt=Ot&(1<<-sr)-1,Ot>>=-sr,sr+=pt;sr>0;Wt=Wt*256+p[O+Ar],Ar+=Pr,sr-=8);if(Ot===0)Ot=1-Je;else{if(Ot===De)return Wt?NaN:(Vr?-1:1)*(1/0);Wt=Wt+Math.pow(2,pt),Ot=Ot-Je}return(Vr?-1:1)*Wt*Math.pow(2,Ot-pt)},Fr=function(p,O,W,pt,At,Ot){var Wt,_e,De,Je=Ot*8-At-1,sr=(1<>1,Pr=At===23?Math.pow(2,-24)-Math.pow(2,-77):0,Vr=pt?0:Ot-1,un=pt?1:-1,Fn=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(_e=isNaN(O)?1:0,Wt=sr):(Wt=Math.floor(Math.log(O)/Math.LN2),O*(De=Math.pow(2,-Wt))<1&&(Wt--,De*=2),Wt+Ar>=1?O+=Pr/De:O+=Pr*Math.pow(2,1-Ar),O*De>=2&&(Wt++,De/=2),Wt+Ar>=sr?(_e=0,Wt=sr):Wt+Ar>=1?(_e=(O*De-1)*Math.pow(2,At),Wt=Wt+Ar):(_e=O*Math.pow(2,Ar-1)*Math.pow(2,At),Wt=0));At>=8;p[W+Vr]=_e&255,Vr+=un,_e/=256,At-=8);for(Wt=Wt<0;p[W+Vr]=Wt&255,Vr+=un,Wt/=256,Je-=8);p[W+Vr-un]|=Fn*128},Zr={read:wr,write:Fr},en=yn;function yn(p){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(p)?p:new Uint8Array(p||0),this.pos=0,this.type=0,this.length=this.buf.length}yn.Varint=0,yn.Fixed64=1,yn.Bytes=2,yn.Fixed32=5;var Vn=65536*65536,Ca=1/Vn,ua=12,wa=typeof TextDecoder>"u"?null:new TextDecoder("utf8");yn.prototype={destroy:function(){this.buf=null},readFields:function(p,O,W){for(W=W||this.length;this.pos>3,Ot=this.pos;this.type=pt&7,p(At,O,this),this.pos===Ot&&this.skip(pt)}return O},readMessage:function(p,O){return this.readFields(p,O,this.readVarint()+this.pos)},readFixed32:function(){var p=Qf(this.buf,this.pos);return this.pos+=4,p},readSFixed32:function(){var p=Hc(this.buf,this.pos);return this.pos+=4,p},readFixed64:function(){var p=Qf(this.buf,this.pos)+Qf(this.buf,this.pos+4)*Vn;return this.pos+=8,p},readSFixed64:function(){var p=Qf(this.buf,this.pos)+Hc(this.buf,this.pos+4)*Vn;return this.pos+=8,p},readFloat:function(){var p=Zr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,p},readDouble:function(){var p=Zr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,p},readVarint:function(p){var O=this.buf,W,pt;return pt=O[this.pos++],W=pt&127,pt<128||(pt=O[this.pos++],W|=(pt&127)<<7,pt<128)||(pt=O[this.pos++],W|=(pt&127)<<14,pt<128)||(pt=O[this.pos++],W|=(pt&127)<<21,pt<128)?W:(pt=O[this.pos],W|=(pt&15)<<28,Xa(W,p,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var p=this.readVarint();return p%2===1?(p+1)/-2:p/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var p=this.readVarint()+this.pos,O=this.pos;return this.pos=p,p-O>=ua&&wa?Nf(this.buf,O,p):Rf(this.buf,O,p)},readBytes:function(){var p=this.readVarint()+this.pos,O=this.buf.subarray(this.pos,p);return this.pos=p,O},readPackedVarint:function(p,O){if(this.type!==yn.Bytes)return p.push(this.readVarint(O));var W=di(this);for(p=p||[];this.pos127;);else if(O===yn.Bytes)this.pos=this.readVarint()+this.pos;else if(O===yn.Fixed32)this.pos+=4;else if(O===yn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+O)},writeTag:function(p,O){this.writeVarint(p<<3|O)},realloc:function(p){for(var O=this.length||16;O268435455||p<0){as(p,this);return}this.realloc(4),this.buf[this.pos++]=p&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=(p>>>=7)&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=(p>>>=7)&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=p>>>7&127)))},writeSVarint:function(p){this.writeVarint(p<0?-p*2-1:p*2)},writeBoolean:function(p){this.writeVarint(!!p)},writeString:function(p){p=String(p),this.realloc(p.length*4),this.pos++;var O=this.pos;this.pos=jf(this.buf,p,this.pos);var W=this.pos-O;W>=128&&Co(O,W,this),this.pos=O-1,this.writeVarint(W),this.pos+=W},writeFloat:function(p){this.realloc(4),Zr.write(this.buf,p,this.pos,!0,23,4),this.pos+=4},writeDouble:function(p){this.realloc(8),Zr.write(this.buf,p,this.pos,!0,52,8),this.pos+=8},writeBytes:function(p){var O=p.length;this.writeVarint(O),this.realloc(O);for(var W=0;W=128&&Co(W,pt,this),this.pos=W-1,this.writeVarint(pt),this.pos+=pt},writeMessage:function(p,O,W){this.writeTag(p,yn.Bytes),this.writeRawMessage(O,W)},writePackedVarint:function(p,O){O.length&&this.writeMessage(p,xo,O)},writePackedSVarint:function(p,O){O.length&&this.writeMessage(p,ho,O)},writePackedBoolean:function(p,O){O.length&&this.writeMessage(p,Io,O)},writePackedFloat:function(p,O){O.length&&this.writeMessage(p,oi,O)},writePackedDouble:function(p,O){O.length&&this.writeMessage(p,Ro,O)},writePackedFixed32:function(p,O){O.length&&this.writeMessage(p,xs,O)},writePackedSFixed32:function(p,O){O.length&&this.writeMessage(p,mu,O)},writePackedFixed64:function(p,O){O.length&&this.writeMessage(p,uu,O)},writePackedSFixed64:function(p,O){O.length&&this.writeMessage(p,tf,O)},writeBytesField:function(p,O){this.writeTag(p,yn.Bytes),this.writeBytes(O)},writeFixed32Field:function(p,O){this.writeTag(p,yn.Fixed32),this.writeFixed32(O)},writeSFixed32Field:function(p,O){this.writeTag(p,yn.Fixed32),this.writeSFixed32(O)},writeFixed64Field:function(p,O){this.writeTag(p,yn.Fixed64),this.writeFixed64(O)},writeSFixed64Field:function(p,O){this.writeTag(p,yn.Fixed64),this.writeSFixed64(O)},writeVarintField:function(p,O){this.writeTag(p,yn.Varint),this.writeVarint(O)},writeSVarintField:function(p,O){this.writeTag(p,yn.Varint),this.writeSVarint(O)},writeStringField:function(p,O){this.writeTag(p,yn.Bytes),this.writeString(O)},writeFloatField:function(p,O){this.writeTag(p,yn.Fixed32),this.writeFloat(O)},writeDoubleField:function(p,O){this.writeTag(p,yn.Fixed64),this.writeDouble(O)},writeBooleanField:function(p,O){this.writeVarintField(p,!!O)}};function Xa(p,O,W){var pt=W.buf,At,Ot;if(Ot=pt[W.pos++],At=(Ot&112)>>4,Ot<128||(Ot=pt[W.pos++],At|=(Ot&127)<<3,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<10,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<17,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<24,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&1)<<31,Ot<128))return oo(p,At,O);throw new Error("Expected varint not more than 10 bytes")}function di(p){return p.type===yn.Bytes?p.readVarint()+p.pos:p.pos+1}function oo(p,O,W){return W?O*4294967296+(p>>>0):(O>>>0)*4294967296+(p>>>0)}function as(p,O){var W,pt;if(p>=0?(W=p%4294967296|0,pt=p/4294967296|0):(W=~(-p%4294967296),pt=~(-p/4294967296),W^4294967295?W=W+1|0:(W=0,pt=pt+1|0)),p>=18446744073709552e3||p<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");O.realloc(10),eo(W,pt,O),Ki(pt,O)}function eo(p,O,W){W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos]=p&127}function Ki(p,O){var W=(p&7)<<4;O.buf[O.pos++]|=W|((p>>>=3)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127)))))}function Co(p,O,W){var pt=O<=16383?1:O<=2097151?2:O<=268435455?3:Math.floor(Math.log(O)/(Math.LN2*7));W.realloc(pt);for(var At=W.pos-1;At>=p;At--)W.buf[At+pt]=W.buf[At]}function xo(p,O){for(var W=0;W>>8,p[W+2]=O>>>16,p[W+3]=O>>>24}function Hc(p,O){return(p[O]|p[O+1]<<8|p[O+2]<<16)+(p[O+3]<<24)}function Rf(p,O,W){for(var pt="",At=O;At239?4:Ot>223?3:Ot>191?2:1;if(At+_e>W)break;var De,Je,sr;_e===1?Ot<128&&(Wt=Ot):_e===2?(De=p[At+1],(De&192)===128&&(Wt=(Ot&31)<<6|De&63,Wt<=127&&(Wt=null))):_e===3?(De=p[At+1],Je=p[At+2],(De&192)===128&&(Je&192)===128&&(Wt=(Ot&15)<<12|(De&63)<<6|Je&63,(Wt<=2047||Wt>=55296&&Wt<=57343)&&(Wt=null))):_e===4&&(De=p[At+1],Je=p[At+2],sr=p[At+3],(De&192)===128&&(Je&192)===128&&(sr&192)===128&&(Wt=(Ot&15)<<18|(De&63)<<12|(Je&63)<<6|sr&63,(Wt<=65535||Wt>=1114112)&&(Wt=null))),Wt===null?(Wt=65533,_e=1):Wt>65535&&(Wt-=65536,pt+=String.fromCharCode(Wt>>>10&1023|55296),Wt=56320|Wt&1023),pt+=String.fromCharCode(Wt),At+=_e}return pt}function Nf(p,O,W){return wa.decode(p.subarray(O,W))}function jf(p,O,W){for(var pt=0,At,Ot;pt55295&&At<57344)if(Ot)if(At<56320){p[W++]=239,p[W++]=191,p[W++]=189,Ot=At;continue}else At=Ot-55296<<10|At-56320|65536,Ot=null;else{At>56319||pt+1===O.length?(p[W++]=239,p[W++]=191,p[W++]=189):Ot=At;continue}else Ot&&(p[W++]=239,p[W++]=191,p[W++]=189,Ot=null);At<128?p[W++]=At:(At<2048?p[W++]=At>>6|192:(At<65536?p[W++]=At>>12|224:(p[W++]=At>>18|240,p[W++]=At>>12&63|128),p[W++]=At>>6&63|128),p[W++]=At&63|128)}return W}var rc=3;function ef(p,O,W){p===1&&W.readMessage(Lf,O)}function Lf(p,O,W){if(p===3){var pt=W.readMessage(wf,{}),At=pt.id,Ot=pt.bitmap,Wt=pt.width,_e=pt.height,De=pt.left,Je=pt.top,sr=pt.advance;O.push({id:At,bitmap:new Vc({width:Wt+2*rc,height:_e+2*rc},Ot),metrics:{width:Wt,height:_e,left:De,top:Je,advance:sr}})}}function wf(p,O,W){p===1?O.id=W.readVarint():p===2?O.bitmap=W.readBytes():p===3?O.width=W.readVarint():p===4?O.height=W.readVarint():p===5?O.left=W.readSVarint():p===6?O.top=W.readSVarint():p===7&&(O.advance=W.readVarint())}function Uf(p){return new en(p).readFields(ef,[])}var hf=rc;function fh(p){for(var O=0,W=0,pt=0,At=p;pt=0;Vr--){var un=_e[Vr];if(!(Pr.w>un.w||Pr.h>un.h)){if(Pr.x=un.x,Pr.y=un.y,Je=Math.max(Je,Pr.y+Pr.h),De=Math.max(De,Pr.x+Pr.w),Pr.w===un.w&&Pr.h===un.h){var Fn=_e.pop();Vr<_e.length&&(_e[Vr]=Fn)}else Pr.h===un.h?(un.x+=Pr.w,un.w-=Pr.w):Pr.w===un.w?(un.y+=Pr.h,un.h-=Pr.h):(_e.push({x:un.x+Pr.w,y:un.y,w:un.w-Pr.w,h:Pr.h}),un.y+=Pr.h,un.h-=Pr.h);break}}return{w:De,h:Je,fill:O/(De*Je)||0}}var zu=1,vl=function(p,O){var W=O.pixelRatio,pt=O.version,At=O.stretchX,Ot=O.stretchY,Wt=O.content;this.paddedRect=p,this.pixelRatio=W,this.stretchX=At,this.stretchY=Ot,this.content=Wt,this.version=pt},Vl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Vl.tl.get=function(){return[this.paddedRect.x+zu,this.paddedRect.y+zu]},Vl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-zu,this.paddedRect.y+this.paddedRect.h-zu]},Vl.tlbr.get=function(){return this.tl.concat(this.br)},Vl.displaySize.get=function(){return[(this.paddedRect.w-zu*2)/this.pixelRatio,(this.paddedRect.h-zu*2)/this.pixelRatio]},Object.defineProperties(vl.prototype,Vl);var eu=function(p,O){var W={},pt={};this.haveRenderCallbacks=[];var At=[];this.addImages(p,W,At),this.addImages(O,pt,At);var Ot=fh(At),Wt=Ot.w,_e=Ot.h,De=new _f({width:Wt||1,height:_e||1});for(var Je in p){var sr=p[Je],Ar=W[Je].paddedRect;_f.copy(sr.data,De,{x:0,y:0},{x:Ar.x+zu,y:Ar.y+zu},sr.data)}for(var Pr in O){var Vr=O[Pr],un=pt[Pr].paddedRect,Fn=un.x+zu,ga=un.y+zu,pa=Vr.data.width,Ea=Vr.data.height;_f.copy(Vr.data,De,{x:0,y:0},{x:Fn,y:ga},Vr.data),_f.copy(Vr.data,De,{x:0,y:Ea-1},{x:Fn,y:ga-1},{width:pa,height:1}),_f.copy(Vr.data,De,{x:0,y:0},{x:Fn,y:ga+Ea},{width:pa,height:1}),_f.copy(Vr.data,De,{x:pa-1,y:0},{x:Fn-1,y:ga},{width:1,height:Ea}),_f.copy(Vr.data,De,{x:0,y:0},{x:Fn+pa,y:ga},{width:1,height:Ea})}this.image=De,this.iconPositions=W,this.patternPositions=pt};eu.prototype.addImages=function(p,O,W){for(var pt in p){var At=p[pt],Ot={x:0,y:0,w:At.data.width+2*zu,h:At.data.height+2*zu};W.push(Ot),O[pt]=new vl(Ot,At),At.hasRenderCallback&&this.haveRenderCallbacks.push(pt)}},eu.prototype.patchUpdatedImages=function(p,O){p.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var W in p.updatedImages)this.patchUpdatedImage(this.iconPositions[W],p.getImage(W),O),this.patchUpdatedImage(this.patternPositions[W],p.getImage(W),O)},eu.prototype.patchUpdatedImage=function(p,O,W){if(!(!p||!O)&&p.version!==O.version){p.version=O.version;var pt=p.tl,At=pt[0],Ot=pt[1];W.update(O.data,void 0,{x:At,y:Ot})}},Ve("ImagePosition",vl),Ve("ImageAtlas",eu);var Xu={horizontal:1,vertical:2,horizontalOnly:3},Lu=-17;function sd(p){for(var O=0,W=p;O=0&&pt>=p&&hh[this.text.charCodeAt(pt)];pt--)W--;this.text=this.text.substring(p,W),this.sectionIndex=this.sectionIndex.slice(p,W)},gu.prototype.substring=function(p,O){var W=new gu;return W.text=this.text.substring(p,O),W.sectionIndex=this.sectionIndex.slice(p,O),W.sections=this.sections,W},gu.prototype.toString=function(){return this.text},gu.prototype.getMaxScale=function(){var p=this;return this.sectionIndex.reduce(function(O,W){return Math.max(O,p.sections[W].scale)},0)},gu.prototype.addTextSection=function(p,O){this.text+=p.text,this.sections.push(Cf.forText(p.scale,p.fontStack||O));for(var W=this.sections.length-1,pt=0;pt=Ah?null:++this.imageSectionID:(this.imageSectionID=kh,this.imageSectionID)};function pf(p,O){for(var W=[],pt=p.text,At=0,Ot=0,Wt=O;Ot=0,sr=0,Ar=0;Ar0&&cu>ro&&(ro=cu)}else{var Mc=W[go.fontStack],kf=Mc&&Mc[Vo];if(kf&&kf.rect)ol=kf.rect,bo=kf.metrics;else{var Zc=O[go.fontStack],Hf=Zc&&Zc[Vo];if(!Hf)continue;bo=Hf.metrics}vo=($a-go.scale)*lr}dl?(p.verticalizable=!0,Ei.push({glyph:Vo,imageName:Hl,x:Pr,y:Vr+vo,vertical:dl,scale:go.scale,fontStack:go.fontStack,sectionIndex:Mo,metrics:bo,rect:ol}),Pr+=vu*go.scale+Je):(Ei.push({glyph:Vo,imageName:Hl,x:Pr,y:Vr+vo,vertical:dl,scale:go.scale,fontStack:go.fontStack,sectionIndex:Mo,metrics:bo,rect:ol}),Pr+=bo.advance*go.scale+Je)}if(Ei.length!==0){var qf=Pr-Je;un=Math.max(qf,un),I_(Ei,0,Ei.length-1,ga,ro)}Pr=0;var Wf=Ot*$a+ro;Si.lineOffset=Math.max(ro,hi),Vr+=Wf,Fn=Math.max(Wf,Fn),++pa}var mf=Vr-Lu,th=Tg(Wt),eh=th.horizontalAlign,rf=th.verticalAlign;P_(p.positionedLines,ga,eh,rf,un,Fn,Ot,mf,At.length),p.top+=-rf*mf,p.bottom=p.top+mf,p.left+=-eh*un,p.right=p.left+un}function I_(p,O,W,pt,At){if(!(!pt&&!At))for(var Ot=p[W],Wt=Ot.metrics.advance*Ot.scale,_e=(p[W].x+Wt)*pt,De=O;De<=W;De++)p[De].x-=_e,p[De].y+=At}function P_(p,O,W,pt,At,Ot,Wt,_e,De){var Je=(O-W)*At,sr=0;Ot!==Wt?sr=-_e*pt-Lu:sr=(-pt*De+.5)*Wt;for(var Ar=0,Pr=p;Ar-W/2;){if(Wt--,Wt<0)return!1;_e-=p[Wt].dist(Ot),Ot=p[Wt]}_e+=p[Wt].dist(p[Wt+1]),Wt++;for(var De=[],Je=0;_ept;)Je-=De.shift().angleDelta;if(Je>At)return!1;Wt++,_e+=Ar.dist(Pr)}return!0}function Tf(p){for(var O=0,W=0;WJe){var un=(Je-De)/Vr,Fn=Ws(Ar.x,Pr.x,un),ga=Ws(Ar.y,Pr.y,un),pa=new ld(Fn,ga,Pr.angleTo(Ar),sr);return pa._round(),!Wt||yy(p,pa,_e,Wt,O)?pa:void 0}De+=Vr}}function Cp(p,O,W,pt,At,Ot,Wt,_e,De){var Je=ph(pt,Ot,Wt),sr=dp(pt,At),Ar=sr*Wt,Pr=p[0].x===0||p[0].x===De||p[0].y===0||p[0].y===De;O-Ar=0&&Aa=0&&$a=0&&Pr+Je<=sr){var hi=new ld(Aa,$a,Ea,un);hi._round(),(!pt||yy(p,hi,Ot,pt,At))&&Vr.push(hi)}}Ar+=pa}return!_e&&!Vr.length&&!Wt&&(Vr=Sh(p,Ar/2,W,pt,At,Ot,Wt,!0,De)),Vr}function m4(p,O,W,pt,At){for(var Ot=[],Wt=0;Wt=pt&&Ar.x>=pt)&&(sr.x>=pt?sr=new o(pt,sr.y+(Ar.y-sr.y)*((pt-sr.x)/(Ar.x-sr.x)))._round():Ar.x>=pt&&(Ar=new o(pt,sr.y+(Ar.y-sr.y)*((pt-sr.x)/(Ar.x-sr.x)))._round()),!(sr.y>=At&&Ar.y>=At)&&(sr.y>=At?sr=new o(sr.x+(Ar.x-sr.x)*((At-sr.y)/(Ar.y-sr.y)),At)._round():Ar.y>=At&&(Ar=new o(sr.x+(Ar.x-sr.x)*((At-sr.y)/(Ar.y-sr.y)),At)._round()),(!De||!sr.equals(De[De.length-1]))&&(De=[sr],Ot.push(De)),De.push(Ar)))))}return Ot}var tm=zu;function g4(p,O,W,pt){var At=[],Ot=p.image,Wt=Ot.pixelRatio,_e=Ot.paddedRect.w-2*tm,De=Ot.paddedRect.h-2*tm,Je=p.right-p.left,sr=p.bottom-p.top,Ar=Ot.stretchX||[[0,_e]],Pr=Ot.stretchY||[[0,De]],Vr=function(ql,sl){return ql+sl[1]-sl[0]},un=Ar.reduce(Vr,0),Fn=Pr.reduce(Vr,0),ga=_e-un,pa=De-Fn,Ea=0,ja=un,Aa=0,$a=Fn,hi=0,Si=ga,Ei=0,ro=pa;if(Ot.content&&pt){var no=Ot.content;Ea=xy(Ar,0,no[0]),Aa=xy(Pr,0,no[1]),ja=xy(Ar,no[0],no[2]),$a=xy(Pr,no[1],no[3]),hi=no[0]-Ea,Ei=no[1]-Aa,Si=no[2]-no[0]-ja,ro=no[3]-no[1]-$a}var go=function(ql,sl,ju,cu){var Mc=_y(ql.stretch-Ea,ja,Je,p.left),kf=by(ql.fixed-hi,Si,ql.stretch,un),Zc=_y(sl.stretch-Aa,$a,sr,p.top),Hf=by(sl.fixed-Ei,ro,sl.stretch,Fn),qf=_y(ju.stretch-Ea,ja,Je,p.left),Wf=by(ju.fixed-hi,Si,ju.stretch,un),mf=_y(cu.stretch-Aa,$a,sr,p.top),th=by(cu.fixed-Ei,ro,cu.stretch,Fn),eh=new o(Mc,Zc),rf=new o(qf,Zc),rh=new o(qf,mf),_h=new o(Mc,mf),Op=new o(kf/Wt,Hf/Wt),hd=new o(Wf/Wt,th/Wt),pd=O*Math.PI/180;if(pd){var dd=Math.sin(pd),lm=Math.cos(pd),Bh=[lm,-dd,dd,lm];eh._matMult(Bh),rf._matMult(Bh),_h._matMult(Bh),rh._matMult(Bh)}var Sy=ql.stretch+ql.fixed,H_=ju.stretch+ju.fixed,Ey=sl.stretch+sl.fixed,q_=cu.stretch+cu.fixed,Eh={x:Ot.paddedRect.x+tm+Sy,y:Ot.paddedRect.y+tm+Ey,w:H_-Sy,h:q_-Ey},um=Si/Wt/Je,zy=ro/Wt/sr;return{tl:eh,tr:rf,bl:_h,br:rh,tex:Eh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Op,pixelOffsetBR:hd,minFontScaleX:um,minFontScaleY:zy,isSDF:W}};if(!pt||!Ot.stretchX&&!Ot.stretchY)At.push(go({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:_e+1},{fixed:0,stretch:De+1}));else for(var Mo=v4(Ar,ga,un),Vo=v4(Pr,pa,Fn),vo=0;vo0&&(Vr=Math.max(10,Vr),this.circleDiameter=Vr)}else{var un=Ot.top*Wt-_e,Fn=Ot.bottom*Wt+_e,ga=Ot.left*Wt-_e,pa=Ot.right*Wt+_e,Ea=Ot.collisionPadding;if(Ea&&(ga-=Ea[0]*Wt,un-=Ea[1]*Wt,pa+=Ea[2]*Wt,Fn+=Ea[3]*Wt),Je){var ja=new o(ga,un),Aa=new o(pa,un),$a=new o(ga,Fn),hi=new o(pa,Fn),Si=Je*Math.PI/180;ja._rotate(Si),Aa._rotate(Si),$a._rotate(Si),hi._rotate(Si),ga=Math.min(ja.x,Aa.x,$a.x,hi.x),pa=Math.max(ja.x,Aa.x,$a.x,hi.x),un=Math.min(ja.y,Aa.y,$a.y,hi.y),Fn=Math.max(ja.y,Aa.y,$a.y,hi.y)}p.emplaceBack(O.x,O.y,ga,un,pa,Fn,W,pt,At)}this.boxEndIndex=p.length},em=function(p,O){if(p===void 0&&(p=[]),O===void 0&&(O=rI),this.data=p,this.length=this.data.length,this.compare=O,this.length>0)for(var W=(this.length>>1)-1;W>=0;W--)this._down(W)};em.prototype.push=function(p){this.data.push(p),this.length++,this._up(this.length-1)},em.prototype.pop=function(){if(this.length!==0){var p=this.data[0],O=this.data.pop();return this.length--,this.length>0&&(this.data[0]=O,this._down(0)),p}},em.prototype.peek=function(){return this.data[0]},em.prototype._up=function(p){for(var O=this,W=O.data,pt=O.compare,At=W[p];p>0;){var Ot=p-1>>1,Wt=W[Ot];if(pt(At,Wt)>=0)break;W[p]=Wt,p=Ot}W[p]=At},em.prototype._down=function(p){for(var O=this,W=O.data,pt=O.compare,At=this.length>>1,Ot=W[p];p=0)break;W[p]=_e,p=Wt}W[p]=Ot};function rI(p,O){return pO?1:0}function nI(p,O,W){W===void 0&&(W=!1);for(var pt=1/0,At=1/0,Ot=-1/0,Wt=-1/0,_e=p[0],De=0;De<_e.length;De++){var Je=_e[De];(!De||Je.xOt)&&(Ot=Je.x),(!De||Je.y>Wt)&&(Wt=Je.y)}var sr=Ot-pt,Ar=Wt-At,Pr=Math.min(sr,Ar),Vr=Pr/2,un=new em([],aI);if(Pr===0)return new o(pt,At);for(var Fn=pt;Fnpa.d||!pa.d)&&(pa=ja,W&&console.log("found best %d after %d probes",Math.round(1e4*ja.d)/1e4,Ea)),!(ja.max-pa.d<=O)&&(Vr=ja.h/2,un.push(new rm(ja.p.x-Vr,ja.p.y-Vr,Vr,p)),un.push(new rm(ja.p.x+Vr,ja.p.y-Vr,Vr,p)),un.push(new rm(ja.p.x-Vr,ja.p.y+Vr,Vr,p)),un.push(new rm(ja.p.x+Vr,ja.p.y+Vr,Vr,p)),Ea+=4)}return W&&(console.log("num probes: "+Ea),console.log("best distance: "+pa.d)),pa.p}function aI(p,O){return O.max-p.max}function rm(p,O,W,pt){this.p=new o(p,O),this.h=W,this.d=iI(this.p,pt),this.max=this.d+this.h*Math.SQRT2}function iI(p,O){for(var W=!1,pt=1/0,At=0;Atp.y!=sr.y>p.y&&p.x<(sr.x-Je.x)*(p.y-Je.y)/(sr.y-Je.y)+Je.x&&(W=!W),pt=Math.min(pt,Ef(p,Je,sr))}return(W?1:-1)*Math.sqrt(pt)}function oI(p){for(var O=0,W=0,pt=0,At=p[0],Ot=0,Wt=At.length,_e=Wt-1;Ot=Li||Bh.y<0||Bh.y>=Li||uI(p,Bh,lm,W,pt,At,Vo,p.layers[0],p.collisionBoxArray,O.index,O.sourceLayerIndex,p.index,pa,$a,Ei,De,ja,hi,ro,Vr,O,Ot,Je,sr,Wt)};if(no==="line")for(var bo=0,ol=m4(O.geometry,0,0,Li,Li);bo1){var Zc=Mh(kf,Si,W.vertical||un,pt,Fn,Ea);Zc&&vo(kf,Zc)}}else if(O.type==="Polygon")for(var Hf=0,qf=Dh(O.geometry,0);Hfcd&&N(p.layerIds[0]+': Value for "text-size" is >= '+Ag+'. Reduce your "text-size".')):ga.kind==="composite"&&(pa=[qc*Vr.compositeTextSizes[0].evaluate(Wt,{},un),qc*Vr.compositeTextSizes[1].evaluate(Wt,{},un)],(pa[0]>cd||pa[1]>cd)&&N(p.layerIds[0]+': Value for "text-size" is >= '+Ag+'. Reduce your "text-size".')),p.addSymbols(p.text,Fn,pa,_e,Ot,Wt,Je,O,De.lineStartIndex,De.lineLength,Pr,un);for(var Ea=0,ja=sr;Eacd&&N(p.layerIds[0]+': Value for "icon-size" is >= '+Ag+'. Reduce your "icon-size".')):eh.kind==="composite"&&(rf=[qc*$a.compositeIconSizes[0].evaluate(Aa,{},Si),qc*$a.compositeIconSizes[1].evaluate(Aa,{},Si)],(rf[0]>cd||rf[1]>cd)&&N(p.layerIds[0]+': Value for "icon-size" is >= '+Ag+'. Reduce your "icon-size".')),p.addSymbols(p.icon,mf,rf,ja,Ea,Aa,!1,O,no.lineStartIndex,no.lineLength,-1,Si),dl=p.icon.placedSymbolArray.length-1,th&&(ol=th.length*4,p.addSymbols(p.icon,th,rf,ja,Ea,Aa,Xu.vertical,O,no.lineStartIndex,no.lineLength,-1,Si),ql=p.icon.placedSymbolArray.length-1)}for(var rh in pt.horizontal){var _h=pt.horizontal[rh];if(!go){ju=zt(_h.text);var Op=_e.layout.get("text-rotate").evaluate(Aa,{},Si);go=new wy(De,O,Je,sr,Ar,_h,Pr,Vr,un,Op)}var hd=_h.positionedLines.length===1;if(Hl+=x4(p,O,_h,Ot,_e,un,Aa,Fn,no,pt.vertical?Xu.horizontal:Xu.horizontalOnly,hd?Object.keys(pt.horizontal):[rh],sl,dl,$a,Si),hd)break}pt.vertical&&(vu+=x4(p,O,pt.vertical,Ot,_e,un,Aa,Fn,no,Xu.vertical,["vertical"],sl,ql,$a,Si));var pd=go?go.boxStartIndex:p.collisionBoxArray.length,dd=go?go.boxEndIndex:p.collisionBoxArray.length,lm=Vo?Vo.boxStartIndex:p.collisionBoxArray.length,Bh=Vo?Vo.boxEndIndex:p.collisionBoxArray.length,Sy=Mo?Mo.boxStartIndex:p.collisionBoxArray.length,H_=Mo?Mo.boxEndIndex:p.collisionBoxArray.length,Ey=vo?vo.boxStartIndex:p.collisionBoxArray.length,q_=vo?vo.boxEndIndex:p.collisionBoxArray.length,Eh=-1,um=function(Eg,F4){return Eg&&Eg.circleDiameter?Math.max(Eg.circleDiameter,F4):F4};Eh=um(go,Eh),Eh=um(Vo,Eh),Eh=um(Mo,Eh),Eh=um(vo,Eh);var zy=Eh>-1?1:0;zy&&(Eh*=Ei/lr),p.glyphOffsetArray.length>=ru.MAX_GLYPHS&&N("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Aa.sortKey!==void 0&&p.addToSortKeyRanges(p.symbolInstances.length,Aa.sortKey),p.symbolInstances.emplaceBack(O.x,O.y,sl.right>=0?sl.right:-1,sl.center>=0?sl.center:-1,sl.left>=0?sl.left:-1,sl.vertical||-1,dl,ql,ju,pd,dd,lm,Bh,Sy,H_,Ey,q_,Je,Hl,vu,bo,ol,zy,0,Pr,cu,Mc,Eh)}function cI(p,O,W,pt){var At=p.compareText;if(!(O in At))At[O]=[];else for(var Ot=At[O],Wt=Ot.length-1;Wt>=0;Wt--)if(pt.dist(Ot[Wt])0)&&(Ot.value.kind!=="constant"||Ot.value.value.length>0),Je=_e.value.kind!=="constant"||!!_e.value.value||Object.keys(_e.parameters).length>0,sr=At.get("symbol-sort-key");if(this.features=[],!(!De&&!Je)){for(var Ar=O.iconDependencies,Pr=O.glyphDependencies,Vr=O.availableImages,un=new ps(this.zoom),Fn=0,ga=p;Fn=0;for(var Hl=0,vu=Ei.sections;Hl=0;_e--)Ot[_e]={x:O[_e].x,y:O[_e].y,tileUnitDistanceFromAnchor:At},_e>0&&(At+=O[_e-1].dist(O[_e]));for(var De=0;De0},ru.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ru.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ru.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ru.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ru.prototype.addIndicesForPlacedSymbol=function(p,O){for(var W=p.placedSymbolArray.get(O),pt=W.vertexStartIndex+W.numGlyphs*4,At=W.vertexStartIndex;At1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(p),this.sortedAngle=p,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var W=0,pt=this.symbolInstanceIndexes;W=0&&De.indexOf(Wt)===_e&&O.addIndicesForPlacedSymbol(O.text,Wt)}),Ot.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ot.verticalPlacedTextSymbolIndex),Ot.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ot.placedIconSymbolIndex),Ot.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ot.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ve("SymbolBucket",ru,{omit:["layers","collisionBoxArray","features","compareText"]}),ru.MAX_GLYPHS=65535,ru.addDynamicAttributes=R_;function dI(p,O){return O.replace(/{([^{}]+)}/g,function(W,pt){return pt in p?String(p[pt]):""})}var mI=new Ka({"symbol-placement":new qr(Da.layout_symbol["symbol-placement"]),"symbol-spacing":new qr(Da.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new qr(Da.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Sn(Da.layout_symbol["symbol-sort-key"]),"symbol-z-order":new qr(Da.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new qr(Da.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new qr(Da.layout_symbol["icon-ignore-placement"]),"icon-optional":new qr(Da.layout_symbol["icon-optional"]),"icon-rotation-alignment":new qr(Da.layout_symbol["icon-rotation-alignment"]),"icon-size":new Sn(Da.layout_symbol["icon-size"]),"icon-text-fit":new qr(Da.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new qr(Da.layout_symbol["icon-text-fit-padding"]),"icon-image":new Sn(Da.layout_symbol["icon-image"]),"icon-rotate":new Sn(Da.layout_symbol["icon-rotate"]),"icon-padding":new qr(Da.layout_symbol["icon-padding"]),"icon-keep-upright":new qr(Da.layout_symbol["icon-keep-upright"]),"icon-offset":new Sn(Da.layout_symbol["icon-offset"]),"icon-anchor":new Sn(Da.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new qr(Da.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new qr(Da.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new qr(Da.layout_symbol["text-rotation-alignment"]),"text-field":new Sn(Da.layout_symbol["text-field"]),"text-font":new Sn(Da.layout_symbol["text-font"]),"text-size":new Sn(Da.layout_symbol["text-size"]),"text-max-width":new Sn(Da.layout_symbol["text-max-width"]),"text-line-height":new qr(Da.layout_symbol["text-line-height"]),"text-letter-spacing":new Sn(Da.layout_symbol["text-letter-spacing"]),"text-justify":new Sn(Da.layout_symbol["text-justify"]),"text-radial-offset":new Sn(Da.layout_symbol["text-radial-offset"]),"text-variable-anchor":new qr(Da.layout_symbol["text-variable-anchor"]),"text-anchor":new Sn(Da.layout_symbol["text-anchor"]),"text-max-angle":new qr(Da.layout_symbol["text-max-angle"]),"text-writing-mode":new qr(Da.layout_symbol["text-writing-mode"]),"text-rotate":new Sn(Da.layout_symbol["text-rotate"]),"text-padding":new qr(Da.layout_symbol["text-padding"]),"text-keep-upright":new qr(Da.layout_symbol["text-keep-upright"]),"text-transform":new Sn(Da.layout_symbol["text-transform"]),"text-offset":new Sn(Da.layout_symbol["text-offset"]),"text-allow-overlap":new qr(Da.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new qr(Da.layout_symbol["text-ignore-placement"]),"text-optional":new qr(Da.layout_symbol["text-optional"])}),gI=new Ka({"icon-opacity":new Sn(Da.paint_symbol["icon-opacity"]),"icon-color":new Sn(Da.paint_symbol["icon-color"]),"icon-halo-color":new Sn(Da.paint_symbol["icon-halo-color"]),"icon-halo-width":new Sn(Da.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Sn(Da.paint_symbol["icon-halo-blur"]),"icon-translate":new qr(Da.paint_symbol["icon-translate"]),"icon-translate-anchor":new qr(Da.paint_symbol["icon-translate-anchor"]),"text-opacity":new Sn(Da.paint_symbol["text-opacity"]),"text-color":new Sn(Da.paint_symbol["text-color"],{runtimeType:Is,getOverride:function(p){return p.textColor},hasOverride:function(p){return!!p.textColor}}),"text-halo-color":new Sn(Da.paint_symbol["text-halo-color"]),"text-halo-width":new Sn(Da.paint_symbol["text-halo-width"]),"text-halo-blur":new Sn(Da.paint_symbol["text-halo-blur"]),"text-translate":new qr(Da.paint_symbol["text-translate"]),"text-translate-anchor":new qr(Da.paint_symbol["text-translate-anchor"])}),N_={paint:gI,layout:mI},im=function(p){this.type=p.property.overrides?p.property.overrides.runtimeType:al,this.defaultValue=p};im.prototype.evaluate=function(p){if(p.formattedSection){var O=this.defaultValue.property.overrides;if(O&&O.hasOverride(p.formattedSection))return O.getOverride(p.formattedSection)}return p.feature&&p.featureState?this.defaultValue.evaluate(p.feature,p.featureState):this.defaultValue.property.specification.default},im.prototype.eachChild=function(p){if(!this.defaultValue.isConstant()){var O=this.defaultValue.value;p(O._styleExpression.expression)}},im.prototype.outputDefined=function(){return!1},im.prototype.serialize=function(){return null},Ve("FormatSectionOverride",im,{omit:["defaultValue"]});var vI=(function(p){function O(W){p.call(this,W,N_)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.recalculate=function(W,pt){if(p.prototype.recalculate.call(this,W,pt),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var At=this.layout.get("text-writing-mode");if(At){for(var Ot=[],Wt=0,_e=At;Wt<_e.length;Wt+=1){var De=_e[Wt];Ot.indexOf(De)<0&&Ot.push(De)}this.layout._values["text-writing-mode"]=Ot}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},O.prototype.getValueAndResolveTokens=function(W,pt,At,Ot){var Wt=this.layout.get(W).evaluate(pt,{},At,Ot),_e=this._unevaluatedLayout._values[W];return!_e.isDataDriven()&&!Ui(_e.value)&&Wt?dI(pt.properties,Wt):Wt},O.prototype.createBucket=function(W){return new ru(W)},O.prototype.queryRadius=function(){return 0},O.prototype.queryIntersectsFeature=function(){return!1},O.prototype._setPaintOverrides=function(){for(var W=0,pt=N_.paint.overridableProperties;W",targetMapId:pt,sourceMapId:Ot.mapId})}}},om.prototype.receive=function(p){var O=p.data,W=O.id;if(W&&!(O.targetMapId&&this.mapId!==O.targetMapId))if(O.type===""){delete this.tasks[W];var pt=this.cancelCallbacks[W];delete this.cancelCallbacks[W],pt&&pt()}else st()||O.mustQueue?(this.tasks[W]=O,this.taskQueue.push(W),this.invoker.trigger()):this.processTask(W,O)},om.prototype.process=function(){if(this.taskQueue.length){var p=this.taskQueue.shift(),O=this.tasks[p];delete this.tasks[p],this.taskQueue.length&&this.invoker.trigger(),O&&this.processTask(p,O)}},om.prototype.processTask=function(p,O){var W=this;if(O.type===""){var pt=this.callbacks[p];delete this.callbacks[p],pt&&(O.error?pt(Wr(O.error)):pt(null,Wr(O.data)))}else{var At=!1,Ot=ot(this.globalScope)?void 0:[],Wt=O.hasCallback?function(Ar,Pr){At=!0,delete W.cancelCallbacks[p],W.target.postMessage({id:p,type:"",sourceMapId:W.mapId,error:Ar?Sr(Ar):null,data:Sr(Pr,Ot)},Ot)}:function(Ar){At=!0},_e=null,De=Wr(O.data);if(this.parent[O.type])_e=this.parent[O.type](O.sourceMapId,De,Wt);else if(this.parent.getWorkerSource){var Je=O.type.split("."),sr=this.parent.getWorkerSource(O.sourceMapId,Je[0],De.source);_e=sr[Je[1]](De,Wt)}else Wt(new Error("Could not find function "+O.type));!At&&_e&&_e.cancel&&(this.cancelCallbacks[p]=_e.cancel)}},om.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function EI(p,O,W){O=Math.pow(2,W)-O-1;var pt=A4(p*256,O*256,W),At=A4((p+1)*256,(O+1)*256,W);return pt[0]+","+pt[1]+","+At[0]+","+At[1]}function A4(p,O,W){var pt=2*Math.PI*6378137/256/Math.pow(2,W),At=p*pt-2*Math.PI*6378137/2,Ot=O*pt-2*Math.PI*6378137/2;return[At,Ot]}var Wc=function(p,O){p&&(O?this.setSouthWest(p).setNorthEast(O):p.length===4?this.setSouthWest([p[0],p[1]]).setNorthEast([p[2],p[3]]):this.setSouthWest(p[0]).setNorthEast(p[1]))};Wc.prototype.setNorthEast=function(p){return this._ne=p instanceof $u?new $u(p.lng,p.lat):$u.convert(p),this},Wc.prototype.setSouthWest=function(p){return this._sw=p instanceof $u?new $u(p.lng,p.lat):$u.convert(p),this},Wc.prototype.extend=function(p){var O=this._sw,W=this._ne,pt,At;if(p instanceof $u)pt=p,At=p;else if(p instanceof Wc){if(pt=p._sw,At=p._ne,!pt||!At)return this}else{if(Array.isArray(p))if(p.length===4||p.every(Array.isArray)){var Ot=p;return this.extend(Wc.convert(Ot))}else{var Wt=p;return this.extend($u.convert(Wt))}return this}return!O&&!W?(this._sw=new $u(pt.lng,pt.lat),this._ne=new $u(At.lng,At.lat)):(O.lng=Math.min(pt.lng,O.lng),O.lat=Math.min(pt.lat,O.lat),W.lng=Math.max(At.lng,W.lng),W.lat=Math.max(At.lat,W.lat)),this},Wc.prototype.getCenter=function(){return new $u((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Wc.prototype.getSouthWest=function(){return this._sw},Wc.prototype.getNorthEast=function(){return this._ne},Wc.prototype.getNorthWest=function(){return new $u(this.getWest(),this.getNorth())},Wc.prototype.getSouthEast=function(){return new $u(this.getEast(),this.getSouth())},Wc.prototype.getWest=function(){return this._sw.lng},Wc.prototype.getSouth=function(){return this._sw.lat},Wc.prototype.getEast=function(){return this._ne.lng},Wc.prototype.getNorth=function(){return this._ne.lat},Wc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Wc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Wc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Wc.prototype.contains=function(p){var O=$u.convert(p),W=O.lng,pt=O.lat,At=this._sw.lat<=pt&&pt<=this._ne.lat,Ot=this._sw.lng<=W&&W<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ot=this._sw.lng>=W&&W>=this._ne.lng),At&&Ot},Wc.convert=function(p){return!p||p instanceof Wc?p:new Wc(p)};var M4=63710088e-1,$u=function(p,O){if(isNaN(p)||isNaN(O))throw new Error("Invalid LngLat object: ("+p+", "+O+")");if(this.lng=+p,this.lat=+O,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};$u.prototype.wrap=function(){return new $u(x(this.lng,-180,180),this.lat)},$u.prototype.toArray=function(){return[this.lng,this.lat]},$u.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},$u.prototype.distanceTo=function(p){var O=Math.PI/180,W=this.lat*O,pt=p.lat*O,At=Math.sin(W)*Math.sin(pt)+Math.cos(W)*Math.cos(pt)*Math.cos((p.lng-this.lng)*O),Ot=M4*Math.acos(Math.min(At,1));return Ot},$u.prototype.toBounds=function(p){p===void 0&&(p=0);var O=40075017,W=360*p/O,pt=W/Math.cos(Math.PI/180*this.lat);return new Wc(new $u(this.lng-pt,this.lat-W),new $u(this.lng+pt,this.lat+W))},$u.convert=function(p){if(p instanceof $u)return p;if(Array.isArray(p)&&(p.length===2||p.length===3))return new $u(Number(p[0]),Number(p[1]));if(!Array.isArray(p)&&typeof p=="object"&&p!==null)return new $u(Number("lng"in p?p.lng:p.lon),Number(p.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var S4=2*Math.PI*M4;function E4(p){return S4*Math.cos(p*Math.PI/180)}function z4(p){return(180+p)/360}function L4(p){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+p*Math.PI/360)))/360}function C4(p,O){return p/E4(O)}function zI(p){return p*360-180}function U_(p){var O=180-p*360;return 360/Math.PI*Math.atan(Math.exp(O*Math.PI/180))-90}function LI(p,O){return p*E4(U_(O))}function CI(p){return 1/Math.cos(p*Math.PI/180)}var t0=function(p,O,W){W===void 0&&(W=0),this.x=+p,this.y=+O,this.z=+W};t0.fromLngLat=function(p,O){O===void 0&&(O=0);var W=$u.convert(p);return new t0(z4(W.lng),L4(W.lat),C4(O,W.lat))},t0.prototype.toLngLat=function(){return new $u(zI(this.x),U_(this.y))},t0.prototype.toAltitude=function(){return LI(this.z,this.y)},t0.prototype.meterInMercatorCoordinateUnits=function(){return 1/S4*CI(U_(this.y))};var e0=function(p,O,W){this.z=p,this.x=O,this.y=W,this.key=Sg(0,p,p,O,W)};e0.prototype.equals=function(p){return this.z===p.z&&this.x===p.x&&this.y===p.y},e0.prototype.url=function(p,O){var W=EI(this.x,this.y,this.z),pt=II(this.z,this.x,this.y);return p[(this.x+this.y)%p.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(O==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",pt).replace("{bbox-epsg-3857}",W)},e0.prototype.getTilePoint=function(p){var O=Math.pow(2,this.z);return new o((p.x*O-this.x)*Li,(p.y*O-this.y)*Li)},e0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var I4=function(p,O){this.wrap=p,this.canonical=O,this.key=Sg(p,O.z,O.z,O.x,O.y)},Gc=function(p,O,W,pt,At){this.overscaledZ=p,this.wrap=O,this.canonical=new e0(W,+pt,+At),this.key=Sg(O,p,W,pt,At)};Gc.prototype.equals=function(p){return this.overscaledZ===p.overscaledZ&&this.wrap===p.wrap&&this.canonical.equals(p.canonical)},Gc.prototype.scaledTo=function(p){var O=this.canonical.z-p;return p>this.canonical.z?new Gc(p,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gc(p,this.wrap,p,this.canonical.x>>O,this.canonical.y>>O)},Gc.prototype.calculateScaledKey=function(p,O){var W=this.canonical.z-p;return p>this.canonical.z?Sg(this.wrap*+O,p,this.canonical.z,this.canonical.x,this.canonical.y):Sg(this.wrap*+O,p,p,this.canonical.x>>W,this.canonical.y>>W)},Gc.prototype.isChildOf=function(p){if(p.wrap!==this.wrap)return!1;var O=this.canonical.z-p.canonical.z;return p.overscaledZ===0||p.overscaledZ>O&&p.canonical.y===this.canonical.y>>O},Gc.prototype.children=function(p){if(this.overscaledZ>=p)return[new Gc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var O=this.canonical.z+1,W=this.canonical.x*2,pt=this.canonical.y*2;return[new Gc(O,this.wrap,O,W,pt),new Gc(O,this.wrap,O,W+1,pt),new Gc(O,this.wrap,O,W,pt+1),new Gc(O,this.wrap,O,W+1,pt+1)]},Gc.prototype.isLessThan=function(p){return this.wrapp.wrap?!1:this.overscaledZp.overscaledZ?!1:this.canonical.xp.canonical.x?!1:this.canonical.y0;Ot--)At=1<=this.dim+1||O<-1||O>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(O+1)*this.stride+(p+1)},Ip.prototype._unpackMapbox=function(p,O,W){return(p*256*256+O*256+W)/10-1e4},Ip.prototype._unpackTerrarium=function(p,O,W){return p*256+O+W/256-32768},Ip.prototype.getPixels=function(){return new _f({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ip.prototype.backfillBorder=function(p,O,W){if(this.dim!==p.dim)throw new Error("dem dimension mismatch");var pt=O*this.dim,At=O*this.dim+this.dim,Ot=W*this.dim,Wt=W*this.dim+this.dim;switch(O){case-1:pt=At-1;break;case 1:At=pt+1;break}switch(W){case-1:Ot=Wt-1;break;case 1:Wt=Ot+1;break}for(var _e=-O*this.dim,De=-W*this.dim,Je=Ot;Je=0&&sr[3]>=0&&_e.insert(Wt,sr[0],sr[1],sr[2],sr[3])}},Pp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Lp.VectorTile(new en(this.rawTileData)).layers,this.sourceLayerCoder=new Ay(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Pp.prototype.query=function(p,O,W,pt){var At=this;this.loadVTLayers();for(var Ot=p.params||{},Wt=Li/p.tileSize/p.scale,_e=Gt(Ot.filter),De=p.queryGeometry,Je=p.queryPadding*Wt,sr=O4(De),Ar=this.grid.query(sr.minX-Je,sr.minY-Je,sr.maxX+Je,sr.maxY+Je),Pr=O4(p.cameraQueryGeometry),Vr=this.grid3D.query(Pr.minX-Je,Pr.minY-Je,Pr.maxX+Je,Pr.maxY+Je,function($a,hi,Si,Ei){return Ph(p.cameraQueryGeometry,$a-Je,hi-Je,Si+Je,Ei+Je)}),un=0,Fn=Vr;unpt)At=!1;else if(!O)At=!0;else if(this.expirationTime=mr.maxzoom)&&mr.visibility!=="none"){f(Tr,this.zoom,Ze);var kr=In[mr.id]=mr.createBucket({index:$r.bucketLayerIDs.length,layers:Tr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Cn,sourceID:this.source});kr.populate(Fa,Nn,this.tileID.canonical),$r.bucketLayerIDs.push(Tr.map(function(rn){return rn.id}))}}}}var Ur,Or,pe,Ke,xr=t.mapObject(Nn.glyphDependencies,function(rn){return Object.keys(rn).map(Number)});Object.keys(xr).length?tr.send("getGlyphs",{uid:this.uid,stacks:xr},function(rn,Qr){Ur||(Ur=rn,Or=Qr,wn.call(tn))}):Or={};var Gr=Object.keys(Nn.iconDependencies);Gr.length?tr.send("getImages",{icons:Gr,source:this.source,tileID:this.tileID,type:"icons"},function(rn,Qr){Ur||(Ur=rn,pe=Qr,wn.call(tn))}):pe={};var ln=Object.keys(Nn.patternDependencies);ln.length?tr.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},function(rn,Qr){Ur||(Ur=rn,Ke=Qr,wn.call(tn))}):Ke={},wn.call(this);function wn(){if(Ur)return zr(Ur);if(Or&&pe&&Ke){var rn=new a(Or),Qr=new t.ImageAtlas(pe,Ke);for(var vn in In){var Oa=In[vn];Oa instanceof t.SymbolBucket?(f(Oa.layers,this.zoom,Ze),t.performSymbolLayout(Oa,Or,rn.positions,pe,Qr.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Oa.hasPattern&&(Oa instanceof t.LineBucket||Oa instanceof t.FillBucket||Oa instanceof t.FillExtrusionBucket)&&(f(Oa.layers,this.zoom,Ze),Oa.addFeatures(Nn,this.tileID.canonical,Qr.patternPositions))}this.status="done",zr(null,{buckets:t.values(In).filter(function(Qn){return!Qn.isEmpty()}),featureIndex:$r,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:rn.image,imageAtlas:Qr,glyphMap:this.returnDependencies?Or:null,iconMap:this.returnDependencies?pe:null,glyphPositions:this.returnDependencies?rn.positions:null})}}};function f(Se,Re,Ze){for(var tr=new t.EvaluationParameters(Re),zr=0,tn=Se;zr=0!=!!Re&&Se.reverse()}var k=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,M=function(Se){this._feature=Se,this.extent=t.EXTENT,this.type=Se.type,this.properties=Se.tags,"id"in Se&&!isNaN(Se.id)&&(this.id=parseInt(Se.id,10))};M.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Se=[],Re=0,Ze=this._feature.geometry;Re"u"&&(tr.push($r),In=tr.length-1,tn[$r]=In),Re.writeVarint(In);var Nn=Ze.properties[$r],Kn=typeof Nn;Kn!=="string"&&Kn!=="boolean"&&Kn!=="number"&&(Nn=JSON.stringify(Nn));var $n=Kn+":"+Nn,ia=Yr[$n];typeof ia>"u"&&(zr.push(Nn),ia=zr.length-1,Yr[$n]=ia),Re.writeVarint(ia)}}function rt(Se,Re){return(Re<<3)+(Se&7)}function ct(Se){return Se<<1^Se>>31}function st(Se,Re){for(var Ze=Se.loadGeometry(),tr=Se.type,zr=0,tn=0,Yr=Ze.length,$r=0;$r>1;ot(Se,Re,Yr,tr,zr,tn%2),Z(Se,Re,Ze,tr,Yr-1,tn+1),Z(Se,Re,Ze,Yr+1,zr,tn+1)}}function ot(Se,Re,Ze,tr,zr,tn){for(;zr>tr;){if(zr-tr>600){var Yr=zr-tr+1,$r=Ze-tr+1,In=Math.log(Yr),Nn=.5*Math.exp(2*In/3),Kn=.5*Math.sqrt(In*Nn*(Yr-Nn)/Yr)*($r-Yr/2<0?-1:1),$n=Math.max(tr,Math.floor(Ze-$r*Nn/Yr+Kn)),ia=Math.min(zr,Math.floor(Ze+(Yr-$r)*Nn/Yr+Kn));ot(Se,Re,Ze,$n,ia,tn)}var Cn=Re[2*Ze+tn],Fa=tr,Ga=zr;for(X(Se,Re,tr,Ze),Re[2*zr+tn]>Cn&&X(Se,Re,tr,zr);FaCn;)Ga--}Re[2*tr+tn]===Cn?X(Se,Re,tr,Ga):(Ga++,X(Se,Re,Ga,zr)),Ga<=Ze&&(tr=Ga+1),Ze<=Ga&&(zr=Ga-1)}}function X(Se,Re,Ze,tr){Q(Se,Ze,tr),Q(Re,2*Ze,2*tr),Q(Re,2*Ze+1,2*tr+1)}function Q(Se,Re,Ze){var tr=Se[Re];Se[Re]=Se[Ze],Se[Ze]=tr}function ut(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=[0,Se.length-1,0],In=[],Nn,Kn;$r.length;){var $n=$r.pop(),ia=$r.pop(),Cn=$r.pop();if(ia-Cn<=Yr){for(var Fa=Cn;Fa<=ia;Fa++)Nn=Re[2*Fa],Kn=Re[2*Fa+1],Nn>=Ze&&Nn<=zr&&Kn>=tr&&Kn<=tn&&In.push(Se[Fa]);continue}var Ga=Math.floor((Cn+ia)/2);Nn=Re[2*Ga],Kn=Re[2*Ga+1],Nn>=Ze&&Nn<=zr&&Kn>=tr&&Kn<=tn&&In.push(Se[Ga]);var ve=($n+1)%2;($n===0?Ze<=Nn:tr<=Kn)&&($r.push(Cn),$r.push(Ga-1),$r.push(ve)),($n===0?zr>=Nn:tn>=Kn)&&($r.push(Ga+1),$r.push(ia),$r.push(ve))}return In}function J(Se,Re,Ze,tr,zr,tn){for(var Yr=[0,Se.length-1,0],$r=[],In=zr*zr;Yr.length;){var Nn=Yr.pop(),Kn=Yr.pop(),$n=Yr.pop();if(Kn-$n<=tn){for(var ia=$n;ia<=Kn;ia++)q(Re[2*ia],Re[2*ia+1],Ze,tr)<=In&&$r.push(Se[ia]);continue}var Cn=Math.floor(($n+Kn)/2),Fa=Re[2*Cn],Ga=Re[2*Cn+1];q(Fa,Ga,Ze,tr)<=In&&$r.push(Se[Cn]);var ve=(Nn+1)%2;(Nn===0?Ze-zr<=Fa:tr-zr<=Ga)&&(Yr.push($n),Yr.push(Cn-1),Yr.push(ve)),(Nn===0?Ze+zr>=Fa:tr+zr>=Ga)&&(Yr.push(Cn+1),Yr.push(Kn),Yr.push(ve))}return $r}function q(Se,Re,Ze,tr){var zr=Se-Ze,tn=Re-tr;return zr*zr+tn*tn}var it=function(Se){return Se[0]},nt=function(Se){return Se[1]},dt=function(Se,Re,Ze,tr,zr){Re===void 0&&(Re=it),Ze===void 0&&(Ze=nt),tr===void 0&&(tr=64),zr===void 0&&(zr=Float64Array),this.nodeSize=tr,this.points=Se;for(var tn=Se.length<65536?Uint16Array:Uint32Array,Yr=this.ids=new tn(Se.length),$r=this.coords=new zr(Se.length*2),In=0;In=tr;Nn--){var Kn=+Date.now();$r=this._cluster($r,Nn),this.trees[Nn]=new dt($r,vt,Ut,tn,Float32Array),Ze&&console.log("z%d: %d clusters in %dms",Nn,$r.length,+Date.now()-Kn)}return Ze&&console.timeEnd("total time"),this},wt.prototype.getClusters=function(Se,Re){var Ze=((Se[0]+180)%360+360)%360-180,tr=Math.max(-90,Math.min(90,Se[1])),zr=Se[2]===180?180:((Se[2]+180)%360+360)%360-180,tn=Math.max(-90,Math.min(90,Se[3]));if(Se[2]-Se[0]>=360)Ze=-180,zr=180;else if(Ze>zr){var Yr=this.getClusters([Ze,tr,180,tn],Re),$r=this.getClusters([-180,tr,zr,tn],Re);return Yr.concat($r)}for(var In=this.trees[this._limitZoom(Re)],Nn=In.range(Jt(Ze),ee(tn),Jt(zr),ee(tr)),Kn=[],$n=0,ia=Nn;$nRe&&(Fa+=dr.numPoints||1)}if(Fa>=$r){for(var br=Kn.x*Cn,Tr=Kn.y*Cn,mr=Yr&&Cn>1?this._map(Kn,!0):null,kr=(Nn<<5)+(Re+1)+this.points.length,Ur=0,Or=ia;Ur1)for(var Gr=0,ln=ia;Gr>5},wt.prototype._getOriginZoom=function(Se){return(Se-this.points.length)%32},wt.prototype._map=function(Se,Re){if(Se.numPoints)return Re?bt({},Se.properties):Se.properties;var Ze=this.points[Se.index].properties,tr=this.options.map(Ze);return Re&&tr===Ze?bt({},tr):tr};function Ct(Se,Re,Ze,tr,zr){return{x:Se,y:Re,zoom:1/0,id:Ze,parentId:-1,numPoints:tr,properties:zr}}function It(Se,Re){var Ze=Se.geometry.coordinates,tr=Ze[0],zr=Ze[1];return{x:Jt(tr),y:ee(zr),zoom:1/0,index:Re,parentId:-1}}function Nt(Se){return{type:"Feature",id:Se.id,properties:te(Se),geometry:{type:"Point",coordinates:[Zt(Se.x),mt(Se.y)]}}}function te(Se){var Re=Se.numPoints,Ze=Re>=1e4?Math.round(Re/1e3)+"k":Re>=1e3?Math.round(Re/100)/10+"k":Re;return bt(bt({},Se.properties),{cluster:!0,cluster_id:Se.id,point_count:Re,point_count_abbreviated:Ze})}function Jt(Se){return Se/360+.5}function ee(Se){var Re=Math.sin(Se*Math.PI/180),Ze=.5-.25*Math.log((1+Re)/(1-Re))/Math.PI;return Ze<0?0:Ze>1?1:Ze}function Zt(Se){return(Se-.5)*360}function mt(Se){var Re=(180-Se*360)*Math.PI/180;return 360*Math.atan(Math.exp(Re))/Math.PI-90}function bt(Se,Re){for(var Ze in Re)Se[Ze]=Re[Ze];return Se}function vt(Se){return Se.x}function Ut(Se){return Se.y}function re(Se,Re,Ze,tr){for(var zr=tr,tn=Ze-Re>>1,Yr=Ze-Re,$r,In=Se[Re],Nn=Se[Re+1],Kn=Se[Ze],$n=Se[Ze+1],ia=Re+3;iazr)$r=ia,zr=Cn;else if(Cn===zr){var Fa=Math.abs(ia-tn);Fatr&&($r-Re>3&&re(Se,Re,$r,tr),Se[$r+2]=zr,Ze-$r>3&&re(Se,$r,Ze,tr))}function Kt(Se,Re,Ze,tr,zr,tn){var Yr=zr-Ze,$r=tn-tr;if(Yr!==0||$r!==0){var In=((Se-Ze)*Yr+(Re-tr)*$r)/(Yr*Yr+$r*$r);In>1?(Ze=zr,tr=tn):In>0&&(Ze+=Yr*In,tr+=$r*In)}return Yr=Se-Ze,$r=Re-tr,Yr*Yr+$r*$r}function ue(Se,Re,Ze,tr){var zr={id:typeof Se>"u"?null:Se,type:Re,geometry:Ze,tags:tr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Me(zr),zr}function Me(Se){var Re=Se.geometry,Ze=Se.type;if(Ze==="Point"||Ze==="MultiPoint"||Ze==="LineString")Ce(Se,Re);else if(Ze==="Polygon"||Ze==="MultiLineString")for(var tr=0;tr0&&(tr?Yr+=(zr*Nn-In*tn)/2:Yr+=Math.sqrt(Math.pow(In-zr,2)+Math.pow(Nn-tn,2))),zr=In,tn=Nn}var Kn=Re.length-3;Re[2]=1,re(Re,0,Kn,Ze),Re[Kn+2]=1,Re.size=Math.abs(Yr),Re.start=0,Re.end=Re.size}function er(Se,Re,Ze,tr){for(var zr=0;zr1?1:Ze}function de(Se,Re,Ze,tr,zr,tn,Yr,$r){if(Ze/=Re,tr/=Re,tn>=Ze&&Yr=tr)return null;for(var In=[],Nn=0;Nn=Ze&&Fa=tr)continue;var Ga=[];if(ia==="Point"||ia==="MultiPoint")Dt($n,Ga,Ze,tr,zr);else if(ia==="LineString")qt($n,Ga,Ze,tr,zr,!1,$r.lineMetrics);else if(ia==="MultiLineString")lt($n,Ga,Ze,tr,zr,!1);else if(ia==="Polygon")lt($n,Ga,Ze,tr,zr,!0);else if(ia==="MultiPolygon")for(var ve=0;ve<$n.length;ve++){var ge=[];lt($n[ve],ge,Ze,tr,zr,!0),ge.length&&Ga.push(ge)}if(Ga.length){if($r.lineMetrics&&ia==="LineString"){for(ve=0;ve=Ze&&Yr<=tr&&(Re.push(Se[tn]),Re.push(Se[tn+1]),Re.push(Se[tn+2]))}}function qt(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=_t(Se),In=zr===0?St:Ht,Nn=Se.start,Kn,$n,ia=0;iaZe&&($n=In($r,Cn,Fa,ve,ge,Ze),Yr&&($r.start=Nn+Kn*$n)):dr>tr?br=Ze&&($n=In($r,Cn,Fa,ve,ge,Ze),Tr=!0),br>tr&&dr<=tr&&($n=In($r,Cn,Fa,ve,ge,tr),Tr=!0),!tn&&Tr&&(Yr&&($r.end=Nn+Kn*$n),Re.push($r),$r=_t(Se)),Yr&&(Nn+=Kn)}var mr=Se.length-3;Cn=Se[mr],Fa=Se[mr+1],Ga=Se[mr+2],dr=zr===0?Cn:Fa,dr>=Ze&&dr<=tr&&yt($r,Cn,Fa,Ga),mr=$r.length-3,tn&&mr>=3&&($r[mr]!==$r[0]||$r[mr+1]!==$r[1])&&yt($r,$r[0],$r[1],$r[2]),$r.length&&Re.push($r)}function _t(Se){var Re=[];return Re.size=Se.size,Re.start=Se.start,Re.end=Se.end,Re}function lt(Se,Re,Ze,tr,zr,tn){for(var Yr=0;YrYr.maxX&&(Yr.maxX=Kn),$n>Yr.maxY&&(Yr.maxY=$n)}return Yr}function ar(Se,Re,Ze,tr){var zr=Re.geometry,tn=Re.type,Yr=[];if(tn==="Point"||tn==="MultiPoint")for(var $r=0;$r0&&Re.size<(zr?Yr:tr)){Ze.numPoints+=Re.length/3;return}for(var $r=[],In=0;InYr)&&(Ze.numSimplified++,$r.push(Re[In]),$r.push(Re[In+1])),Ze.numPoints++;zr&&Er($r,tn),Se.push($r)}function Er(Se,Re){for(var Ze=0,tr=0,zr=Se.length,tn=zr-2;tr0===Re)for(tr=0,zr=Se.length;tr24)throw new Error("maxZoom should be in the 0-24 range");if(Re.promoteId&&Re.generateId)throw new Error("promoteId and generateId cannot be used together.");var tr=We(Se,Re);this.tiles={},this.tileCoords=[],Ze&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Re.indexMaxZoom,Re.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),tr=Yt(tr,Re),tr.length&&this.splitTile(tr,0,0,0),Ze&&(tr.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}dn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},dn.prototype.splitTile=function(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=[Se,Re,Ze,tr],In=this.options,Nn=In.debug;$r.length;){tr=$r.pop(),Ze=$r.pop(),Re=$r.pop(),Se=$r.pop();var Kn=1<1&&console.time("creation"),ia=this.tiles[$n]=ir(Se,Re,Ze,tr,In),this.tileCoords.push({z:Re,x:Ze,y:tr}),Nn)){Nn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Re,Ze,tr,ia.numFeatures,ia.numPoints,ia.numSimplified),console.timeEnd("creation"));var Cn="z"+Re;this.stats[Cn]=(this.stats[Cn]||0)+1,this.total++}if(ia.source=Se,zr){if(Re===In.maxZoom||Re===zr)continue;var Fa=1<1&&console.time("clipping");var Ga=.5*In.buffer/In.extent,ve=.5-Ga,ge=.5+Ga,dr=1+Ga,br,Tr,mr,kr,Ur,Or;br=Tr=mr=kr=null,Ur=de(Se,Kn,Ze-Ga,Ze+ge,0,ia.minX,ia.maxX,In),Or=de(Se,Kn,Ze+ve,Ze+dr,0,ia.minX,ia.maxX,In),Se=null,Ur&&(br=de(Ur,Kn,tr-Ga,tr+ge,1,ia.minY,ia.maxY,In),Tr=de(Ur,Kn,tr+ve,tr+dr,1,ia.minY,ia.maxY,In),Ur=null),Or&&(mr=de(Or,Kn,tr-Ga,tr+ge,1,ia.minY,ia.maxY,In),kr=de(Or,Kn,tr+ve,tr+dr,1,ia.minY,ia.maxY,In),Or=null),Nn>1&&console.timeEnd("clipping"),$r.push(br||[],Re+1,Ze*2,tr*2),$r.push(Tr||[],Re+1,Ze*2,tr*2+1),$r.push(mr||[],Re+1,Ze*2+1,tr*2),$r.push(kr||[],Re+1,Ze*2+1,tr*2+1)}}},dn.prototype.getTile=function(Se,Re,Ze){var tr=this.options,zr=tr.extent,tn=tr.debug;if(Se<0||Se>24)return null;var Yr=1<1&&console.log("drilling down to z%d-%d-%d",Se,Re,Ze);for(var In=Se,Nn=Re,Kn=Ze,$n;!$n&&In>0;)In--,Nn=Math.floor(Nn/2),Kn=Math.floor(Kn/2),$n=this.tiles[bn(In,Nn,Kn)];return!$n||!$n.source?null:(tn>1&&console.log("found parent tile z%d-%d-%d",In,Nn,Kn),tn>1&&console.time("drilling down"),this.splitTile($n.source,In,Nn,Kn,Se,Re,Ze),tn>1&&console.timeEnd("drilling down"),this.tiles[$r]?Ee(this.tiles[$r],zr):null)};function bn(Se,Re,Ze){return((1<=0?0:U.button},r.remove=function(U){U.parentNode&&U.parentNode.removeChild(U)};function m(U,tt,Y){var ft,zt,Qt,ne=t.browser.devicePixelRatio>1?"@2x":"",Ft=t.getJSON(tt.transformRequest(tt.normalizeSpriteURL(U,ne,".json"),t.ResourceType.SpriteJSON),function(Ne,Ie){Ft=null,Qt||(Qt=Ne,ft=Ie,he())}),$t=t.getImage(tt.transformRequest(tt.normalizeSpriteURL(U,ne,".png"),t.ResourceType.SpriteImage),function(Ne,Ie){$t=null,Qt||(Qt=Ne,zt=Ie,he())});function he(){if(Qt)Y(Qt);else if(ft&&zt){var Ne=t.browser.getImageData(zt),Ie={};for(var Fe in ft){var He=ft[Fe],Ge=He.width,Ae=He.height,Oe=He.x,Le=He.y,ur=He.sdf,Dr=He.pixelRatio,jr=He.stretchX,On=He.stretchY,Ln=He.content,xn=new t.RGBAImage({width:Ge,height:Ae});t.RGBAImage.copy(Ne,xn,{x:Oe,y:Le},{x:0,y:0},{width:Ge,height:Ae}),Ie[Fe]={data:xn,pixelRatio:Dr,sdf:ur,stretchX:jr,stretchY:On,content:Ln}}Y(null,Ie)}}return{cancel:function(){Ft&&(Ft.cancel(),Ft=null),$t&&($t.cancel(),$t=null)}}}function w(U){var tt=U.userImage;if(tt&&tt.render){var Y=tt.render();if(Y)return U.data.replace(new Uint8Array(tt.data.buffer)),!0}return!1}var l=1,x=(function(U){function tt(){U.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.isLoaded=function(){return this.loaded},tt.prototype.setLoaded=function(Y){if(this.loaded!==Y&&(this.loaded=Y,Y)){for(var ft=0,zt=this.requestors;ft=0?1.2:1))}T.prototype.draw=function(U){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(U,this.buffer,this.middle);for(var tt=this.ctx.getImageData(0,0,this.size,this.size),Y=new Uint8ClampedArray(this.size*this.size),ft=0;ft65535){he(new Error("glyphs > 65535 not supported"));return}if(Fe.ranges[Ge]){he(null,{stack:Ne,id:Ie,glyph:He});return}var Ae=Fe.requests[Ge];Ae||(Ae=Fe.requests[Ge]=[],b.loadGlyphRange(Ne,Ge,Y.url,Y.requestManager,function(Oe,Le){if(Le){for(var ur in Le)Y._doesCharSupportLocalGlyph(+ur)||(Fe.glyphs[+ur]=Le[+ur]);Fe.ranges[Ge]=!0}for(var Dr=0,jr=Ae;Dr1&&($t=U[++Ft]);var Ne=Math.abs(he-$t.left),Ie=Math.abs(he-$t.right),Fe=Math.min(Ne,Ie),He=void 0,Ge=zt/Y*(ft+1);if($t.isDash){var Ae=ft-Math.abs(Ge);He=Math.sqrt(Fe*Fe+Ae*Ae)}else He=ft-Math.sqrt(Fe*Fe+Ge*Ge);this.data[ne+he]=Math.max(0,Math.min(255,He+128))}},B.prototype.addRegularDash=function(U){for(var tt=U.length-1;tt>=0;--tt){var Y=U[tt],ft=U[tt+1];Y.zeroLength?U.splice(tt,1):ft&&ft.isDash===Y.isDash&&(ft.left=Y.left,U.splice(tt,1))}var zt=U[0],Qt=U[U.length-1];zt.isDash===Qt.isDash&&(zt.left=Qt.left-this.width,Qt.right=zt.right+this.width);for(var ne=this.width*this.nextRow,Ft=0,$t=U[Ft],he=0;he1&&($t=U[++Ft]);var Ne=Math.abs(he-$t.left),Ie=Math.abs(he-$t.right),Fe=Math.min(Ne,Ie),He=$t.isDash?Fe:-Fe;this.data[ne+he]=Math.max(0,Math.min(255,He+128))}},B.prototype.addDash=function(U,tt){var Y=tt?7:0,ft=2*Y+1;if(this.nextRow+ft>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var zt=0,Qt=0;Qt=Y.minX&&U.x=Y.minY&&U.y0&&(he[new t.OverscaledTileID(Y.overscaledZ,ne,ft.z,Qt,ft.y-1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,Y.wrap,ft.z,ft.x,ft.y-1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,$t,ft.z,Ft,ft.y-1).key]={backfilled:!1}),ft.y+10&&(zt.resourceTiming=Y._resourceTiming,Y._resourceTiming=[]),Y.fire(new t.Event("data",zt))})},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.setData=function(Y){var ft=this;return this._data=Y,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(zt){if(zt){ft.fire(new t.ErrorEvent(zt));return}var Qt={dataType:"source",sourceDataType:"content"};ft._collectResourceTiming&&ft._resourceTiming&&ft._resourceTiming.length>0&&(Qt.resourceTiming=ft._resourceTiming,ft._resourceTiming=[]),ft.fire(new t.Event("data",Qt))}),this},tt.prototype.getClusterExpansionZoom=function(Y,ft){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:Y,source:this.id},ft),this},tt.prototype.getClusterChildren=function(Y,ft){return this.actor.send("geojson.getClusterChildren",{clusterId:Y,source:this.id},ft),this},tt.prototype.getClusterLeaves=function(Y,ft,zt,Qt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:Y,limit:ft,offset:zt},Qt),this},tt.prototype._updateWorkerData=function(Y){var ft=this;this._loaded=!1;var zt=t.extend({},this.workerOptions),Qt=this._data;typeof Qt=="string"?(zt.request=this.map._requestManager.transformRequest(t.browser.resolveURL(Qt),t.ResourceType.Source),zt.request.collectResourceTiming=this._collectResourceTiming):zt.data=JSON.stringify(Qt),this.actor.send(this.type+".loadData",zt,function(ne,Ft){ft._removed||Ft&&Ft.abandoned||(ft._loaded=!0,Ft&&Ft.resourceTiming&&Ft.resourceTiming[ft.id]&&(ft._resourceTiming=Ft.resourceTiming[ft.id].slice(0)),ft.actor.send(ft.type+".coalesce",{source:zt.source},null),Y(ne))})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.loadTile=function(Y,ft){var zt=this,Qt=Y.actor?"reloadTile":"loadTile";Y.actor=this.actor;var ne={type:this.type,uid:Y.uid,tileID:Y.tileID,zoom:Y.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Y.request=this.actor.send(Qt,ne,function(Ft,$t){return delete Y.request,Y.unloadVectorData(),Y.aborted?ft(null):Ft?ft(Ft):(Y.loadVectorData($t,zt.map.painter,Qt==="reloadTile"),ft(null))})},tt.prototype.abortTile=function(Y){Y.request&&(Y.request.cancel(),delete Y.request),Y.aborted=!0},tt.prototype.unloadTile=function(Y){Y.unloadVectorData(),this.actor.send("removeTile",{uid:Y.uid,type:this.type,source:this.id})},tt.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},tt.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},tt.prototype.hasTransition=function(){return!1},tt})(t.Evented),ct=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),st=(function(U){function tt(Y,ft,zt,Qt){U.call(this),this.id=Y,this.dispatcher=zt,this.coordinates=ft.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Qt),this.options=ft}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(Y,ft){var zt=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(Qt,ne){zt._loaded=!0,Qt?zt.fire(new t.ErrorEvent(Qt)):ne&&(zt.image=ne,Y&&(zt.coordinates=Y),ft&&ft(),zt._finishLoading())})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.updateImage=function(Y){var ft=this;return!this.image||!Y.url?this:(this.options.url=Y.url,this.load(Y.coordinates,function(){ft.texture=null}),this)},tt.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.setCoordinates=function(Y){var ft=this;this.coordinates=Y;var zt=Y.map(t.MercatorCoordinate.fromLngLat);this.tileID=et(zt),this.minzoom=this.maxzoom=this.tileID.z;var Qt=zt.map(function(ne){return ft.tileID.getTilePoint(ne)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(Qt[0].x,Qt[0].y,0,0),this._boundsArray.emplaceBack(Qt[1].x,Qt[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(Qt[3].x,Qt[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(Qt[2].x,Qt[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},tt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var Y=this.map.painter.context,ft=Y.gl;this.boundsBuffer||(this.boundsBuffer=Y.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(Y,this.image,ft.RGBA),this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE));for(var zt in this.tiles){var Qt=this.tiles[zt];Qt.state!=="loaded"&&(Qt.state="loaded",Qt.texture=this.texture)}}},tt.prototype.loadTile=function(Y,ft){this.tileID&&this.tileID.equals(Y.tileID.canonical)?(this.tiles[String(Y.tileID.wrap)]=Y,Y.buckets={},ft(null)):(Y.state="errored",ft(null))},tt.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return!1},tt})(t.Evented);function et(U){for(var tt=1/0,Y=1/0,ft=-1/0,zt=-1/0,Qt=0,ne=U;Qtft.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+ft.start(0)+" and "+ft.end(0)+"-second mark."))):this.video.currentTime=Y}},tt.prototype.getVideo=function(){return this.video},tt.prototype.onAdd=function(Y){this.map||(this.map=Y,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},tt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var Y=this.map.painter.context,ft=Y.gl;this.boundsBuffer||(this.boundsBuffer=Y.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE),ft.texSubImage2D(ft.TEXTURE_2D,0,0,0,ft.RGBA,ft.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(Y,this.video,ft.RGBA),this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE));for(var zt in this.tiles){var Qt=this.tiles[zt];Qt.state!=="loaded"&&(Qt.state="loaded",Qt.texture=this.texture)}}},tt.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return this.video&&!this.video.paused},tt})(st),ot=(function(U){function tt(Y,ft,zt,Qt){U.call(this,Y,ft,zt,Qt),ft.coordinates?(!Array.isArray(ft.coordinates)||ft.coordinates.length!==4||ft.coordinates.some(function(ne){return!Array.isArray(ne)||ne.length!==2||ne.some(function(Ft){return typeof Ft!="number"})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'missing required property "coordinates"'))),ft.animate&&typeof ft.animate!="boolean"&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'optional "animate" property must be a boolean value'))),ft.canvas?typeof ft.canvas!="string"&&!(ft.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'missing required property "canvas"'))),this.options=ft,this.animate=ft.animate!==void 0?ft.animate:!0}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},tt.prototype.getCanvas=function(){return this.canvas},tt.prototype.onAdd=function(Y){this.map=Y,this.load(),this.canvas&&this.animate&&this.play()},tt.prototype.onRemove=function(){this.pause()},tt.prototype.prepare=function(){var Y=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,Y=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,Y=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var ft=this.map.painter.context,zt=ft.gl;this.boundsBuffer||(this.boundsBuffer=ft.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(Y||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(ft,this.canvas,zt.RGBA,{premultiply:!0});for(var Qt in this.tiles){var ne=this.tiles[Qt];ne.state!=="loaded"&&(ne.state="loaded",ne.texture=this.texture)}}},tt.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return this._playing},tt.prototype._hasInvalidDimensions=function(){for(var Y=0,ft=[this.canvas.width,this.canvas.height];Ythis.max){var ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this},It.prototype.has=function(U){return U.wrapped().key in this.data},It.prototype.getAndRemove=function(U){return this.has(U)?this._getAndRemoveByKey(U.wrapped().key):null},It.prototype._getAndRemoveByKey=function(U){var tt=this.data[U].shift();return tt.timeout&&clearTimeout(tt.timeout),this.data[U].length===0&&delete this.data[U],this.order.splice(this.order.indexOf(U),1),tt.value},It.prototype.getByKey=function(U){var tt=this.data[U];return tt?tt[0].value:null},It.prototype.get=function(U){if(!this.has(U))return null;var tt=this.data[U.wrapped().key][0];return tt.value},It.prototype.remove=function(U,tt){if(!this.has(U))return this;var Y=U.wrapped().key,ft=tt===void 0?0:this.data[Y].indexOf(tt),zt=this.data[Y][ft];return this.data[Y].splice(ft,1),zt.timeout&&clearTimeout(zt.timeout),this.data[Y].length===0&&delete this.data[Y],this.onRemove(zt.value),this.order.splice(this.order.indexOf(Y),1),this},It.prototype.setMaxSize=function(U){for(this.max=U;this.order.length>this.max;){var tt=this._getAndRemoveByKey(this.order[0]);tt&&this.onRemove(tt)}return this},It.prototype.filter=function(U){var tt=[];for(var Y in this.data)for(var ft=0,zt=this.data[Y];ft1||(Math.abs(Ne)>1&&(Math.abs(Ne+Fe)===1?Ne+=Fe:Math.abs(Ne-Fe)===1&&(Ne-=Fe)),!(!he.dem||!$t.dem)&&($t.dem.backfillBorder(he.dem,Ne,Ie),$t.neighboringTiles&&$t.neighboringTiles[He]&&($t.neighboringTiles[He].backfilled=!0)))}},tt.prototype.getTile=function(Y){return this.getTileByID(Y.key)},tt.prototype.getTileByID=function(Y){return this._tiles[Y]},tt.prototype._retainLoadedChildren=function(Y,ft,zt,Qt){for(var ne in this._tiles){var Ft=this._tiles[ne];if(!(Qt[ne]||!Ft.hasData()||Ft.tileID.overscaledZ<=ft||Ft.tileID.overscaledZ>zt)){for(var $t=Ft.tileID;Ft&&Ft.tileID.overscaledZ>ft+1;){var he=Ft.tileID.scaledTo(Ft.tileID.overscaledZ-1);Ft=this._tiles[he.key],Ft&&Ft.hasData()&&($t=he)}for(var Ne=$t;Ne.overscaledZ>ft;)if(Ne=Ne.scaledTo(Ne.overscaledZ-1),Y[Ne.key]){Qt[$t.key]=$t;break}}}},tt.prototype.findLoadedParent=function(Y,ft){if(Y.key in this._loadedParentTiles){var zt=this._loadedParentTiles[Y.key];return zt&&zt.tileID.overscaledZ>=ft?zt:null}for(var Qt=Y.overscaledZ-1;Qt>=ft;Qt--){var ne=Y.scaledTo(Qt),Ft=this._getLoadedTile(ne);if(Ft)return Ft}},tt.prototype._getLoadedTile=function(Y){var ft=this._tiles[Y.key];if(ft&&ft.hasData())return ft;var zt=this._cache.getByKey(Y.wrapped().key);return zt},tt.prototype.updateCacheSize=function(Y){var ft=Math.ceil(Y.width/this._source.tileSize)+1,zt=Math.ceil(Y.height/this._source.tileSize)+1,Qt=ft*zt,ne=5,Ft=Math.floor(Qt*ne),$t=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ft):Ft;this._cache.setMaxSize($t)},tt.prototype.handleWrapJump=function(Y){var ft=this._prevLng===void 0?Y:this._prevLng,zt=Y-ft,Qt=zt/360,ne=Math.round(Qt);if(this._prevLng=Y,ne){var Ft={};for(var $t in this._tiles){var he=this._tiles[$t];he.tileID=he.tileID.unwrapTo(he.tileID.wrap+ne),Ft[he.tileID.key]=he}this._tiles=Ft;for(var Ne in this._timers)clearTimeout(this._timers[Ne]),delete this._timers[Ne];for(var Ie in this._tiles){var Fe=this._tiles[Ie];this._setTileReloadTimer(Ie,Fe)}}},tt.prototype.update=function(Y){var ft=this;if(this.transform=Y,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(Y),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var zt;this.used?this._source.tileID?zt=Y.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Dn){return new t.OverscaledTileID(Dn.canonical.z,Dn.wrap,Dn.canonical.z,Dn.canonical.x,Dn.canonical.y)}):(zt=Y.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(zt=zt.filter(function(Dn){return ft._source.hasTile(Dn)}))):zt=[];var Qt=Y.coveringZoomLevel(this._source),ne=Math.max(Qt-tt.maxOverzooming,this._source.minzoom),Ft=Math.max(Qt+tt.maxUnderzooming,this._source.minzoom),$t=this._updateRetainedTiles(zt,Qt);if(In(this._source.type)){for(var he={},Ne={},Ie=Object.keys($t),Fe=0,He=Ie;Fethis._source.maxzoom){var Le=Ae.children(this._source.maxzoom)[0],ur=this.getTile(Le);if(ur&&ur.hasData()){zt[Le.key]=Le;continue}}else{var Dr=Ae.children(this._source.maxzoom);if(zt[Dr[0].key]&&zt[Dr[1].key]&&zt[Dr[2].key]&&zt[Dr[3].key])continue}for(var jr=Oe.wasRequested(),On=Ae.overscaledZ-1;On>=ne;--On){var Ln=Ae.scaledTo(On);if(Qt[Ln.key]||(Qt[Ln.key]=!0,Oe=this.getTile(Ln),!Oe&&jr&&(Oe=this._addTile(Ln)),Oe&&(zt[Ln.key]=Ln,jr=Oe.wasRequested(),Oe.hasData())))break}}}return zt},tt.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var Y in this._tiles){for(var ft=[],zt=void 0,Qt=this._tiles[Y].tileID;Qt.overscaledZ>0;){if(Qt.key in this._loadedParentTiles){zt=this._loadedParentTiles[Qt.key];break}ft.push(Qt.key);var ne=Qt.scaledTo(Qt.overscaledZ-1);if(zt=this._getLoadedTile(ne),zt)break;Qt=ne}for(var Ft=0,$t=ft;Ft<$t.length;Ft+=1){var he=$t[Ft];this._loadedParentTiles[he]=zt}}},tt.prototype._addTile=function(Y){var ft=this._tiles[Y.key];if(ft)return ft;ft=this._cache.getAndRemove(Y),ft&&(this._setTileReloadTimer(Y.key,ft),ft.tileID=Y,this._state.initializeTileState(ft,this.map?this.map.painter:null),this._cacheTimers[Y.key]&&(clearTimeout(this._cacheTimers[Y.key]),delete this._cacheTimers[Y.key],this._setTileReloadTimer(Y.key,ft)));var zt=!!ft;return zt||(ft=new t.Tile(Y,this._source.tileSize*Y.overscaleFactor()),this._loadTile(ft,this._tileLoaded.bind(this,ft,Y.key,ft.state))),ft?(ft.uses++,this._tiles[Y.key]=ft,zt||this._source.fire(new t.Event("dataloading",{tile:ft,coord:ft.tileID,dataType:"source"})),ft):null},tt.prototype._setTileReloadTimer=function(Y,ft){var zt=this;Y in this._timers&&(clearTimeout(this._timers[Y]),delete this._timers[Y]);var Qt=ft.getExpiryTimeout();Qt&&(this._timers[Y]=setTimeout(function(){zt._reloadTile(Y,"expired"),delete zt._timers[Y]},Qt))},tt.prototype._removeTile=function(Y){var ft=this._tiles[Y];ft&&(ft.uses--,delete this._tiles[Y],this._timers[Y]&&(clearTimeout(this._timers[Y]),delete this._timers[Y]),!(ft.uses>0)&&(ft.hasData()&&ft.state!=="reloading"?this._cache.add(ft.tileID,ft,ft.getExpiryTimeout()):(ft.aborted=!0,this._abortTile(ft),this._unloadTile(ft))))},tt.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var Y in this._tiles)this._removeTile(Y);this._cache.reset()},tt.prototype.tilesIn=function(Y,ft,zt){var Qt=this,ne=[],Ft=this.transform;if(!Ft)return ne;for(var $t=zt?Ft.getCameraQueryGeometry(Y):Y,he=Y.map(function(On){return Ft.pointCoordinate(On)}),Ne=$t.map(function(On){return Ft.pointCoordinate(On)}),Ie=this.getIds(),Fe=1/0,He=1/0,Ge=-1/0,Ae=-1/0,Oe=0,Le=Ne;Oe=0&&la[1].y+Dn>=0){var qn=he.map(function(ma){return xn.getTilePoint(ma)}),Gn=Ne.map(function(ma){return xn.getTilePoint(ma)});ne.push({tile:Ln,tileID:xn,queryGeometry:qn,cameraQueryGeometry:Gn,scale:Wn})}}},jr=0;jr=t.browser.now())return!0}return!1},tt.prototype.setFeatureState=function(Y,ft,zt){Y=Y||"_geojsonTileLayer",this._state.updateState(Y,ft,zt)},tt.prototype.removeFeatureState=function(Y,ft,zt){Y=Y||"_geojsonTileLayer",this._state.removeFeatureState(Y,ft,zt)},tt.prototype.getFeatureState=function(Y,ft){return Y=Y||"_geojsonTileLayer",this._state.getState(Y,ft)},tt.prototype.setDependencies=function(Y,ft,zt){var Qt=this._tiles[Y];Qt&&Qt.setDependencies(ft,zt)},tt.prototype.reloadTilesForDependencies=function(Y,ft){for(var zt in this._tiles){var Qt=this._tiles[zt];Qt.hasDependency(Y,ft)&&this._reloadTile(zt,"reloading")}this._cache.filter(function(ne){return!ne.hasDependency(Y,ft)})},tt})(t.Evented);Yr.maxOverzooming=10,Yr.maxUnderzooming=3;function $r(U,tt){var Y=Math.abs(U.wrap*2)-+(U.wrap<0),ft=Math.abs(tt.wrap*2)-+(tt.wrap<0);return U.overscaledZ-tt.overscaledZ||ft-Y||tt.canonical.y-U.canonical.y||tt.canonical.x-U.canonical.x}function In(U){return U==="raster"||U==="image"||U==="video"}function Nn(){return new t.window.Worker($o.workerUrl)}var Kn="mapboxgl_preloaded_worker_pool",$n=function(){this.active={}};$n.prototype.acquire=function(U){if(!this.workers)for(this.workers=[];this.workers.length<$n.workerCount;)this.workers.push(new Nn);return this.active[U]=!0,this.workers.slice()},$n.prototype.release=function(U){delete this.active[U],this.numActive()===0&&(this.workers.forEach(function(tt){tt.terminate()}),this.workers=null)},$n.prototype.isPreloaded=function(){return!!this.active[Kn]},$n.prototype.numActive=function(){return Object.keys(this.active).length};var ia=Math.floor(t.browser.hardwareConcurrency/2);$n.workerCount=Math.max(Math.min(ia,6),1);var Cn;function Fa(){return Cn||(Cn=new $n),Cn}function Ga(){var U=Fa();U.acquire(Kn)}function ve(){var U=Cn;U&&(U.isPreloaded()&&U.numActive()===1?(U.release(Kn),Cn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}function ge(U,tt){var Y={};for(var ft in U)ft!=="ref"&&(Y[ft]=U[ft]);return t.refProperties.forEach(function(zt){zt in tt&&(Y[zt]=tt[zt])}),Y}function dr(U){U=U.slice();for(var tt=Object.create(null),Y=0;Y0?(ft-Qt)/ne:0;return this.points[zt].mult(1-Ft).add(this.points[tt].mult(Ft))};var Qr=function(U,tt,Y){var ft=this.boxCells=[],zt=this.circleCells=[];this.xCellCount=Math.ceil(U/Y),this.yCellCount=Math.ceil(tt/Y);for(var Qt=0;Qtthis.width||ft<0||tt>this.height)return zt?!1:[];var ne=[];if(U<=0&&tt<=0&&this.width<=Y&&this.height<=ft){if(zt)return!0;for(var Ft=0;Ft0:ne}},Qr.prototype._queryCircle=function(U,tt,Y,ft,zt){var Qt=U-Y,ne=U+Y,Ft=tt-Y,$t=tt+Y;if(ne<0||Qt>this.width||$t<0||Ft>this.height)return ft?!1:[];var he=[],Ne={hitTest:ft,circle:{x:U,y:tt,radius:Y},seenUids:{box:{},circle:{}}};return this._forEachCell(Qt,Ft,ne,$t,this._queryCellCircle,he,Ne,zt),ft?he.length>0:he},Qr.prototype.query=function(U,tt,Y,ft,zt){return this._query(U,tt,Y,ft,!1,zt)},Qr.prototype.hitTest=function(U,tt,Y,ft,zt){return this._query(U,tt,Y,ft,!0,zt)},Qr.prototype.hitTestCircle=function(U,tt,Y,ft){return this._queryCircle(U,tt,Y,!0,ft)},Qr.prototype._queryCell=function(U,tt,Y,ft,zt,Qt,ne,Ft){var $t=ne.seenUids,he=this.boxCells[zt];if(he!==null)for(var Ne=this.bboxes,Ie=0,Fe=he;Ie=Ne[Ge+0]&&ft>=Ne[Ge+1]&&(!Ft||Ft(this.boxKeys[He]))){if(ne.hitTest)return Qt.push(!0),!0;Qt.push({key:this.boxKeys[He],x1:Ne[Ge],y1:Ne[Ge+1],x2:Ne[Ge+2],y2:Ne[Ge+3]})}}}var Ae=this.circleCells[zt];if(Ae!==null)for(var Oe=this.circles,Le=0,ur=Ae;Lene*ne+Ft*Ft},Qr.prototype._circleAndRectCollide=function(U,tt,Y,ft,zt,Qt,ne){var Ft=(Qt-ft)/2,$t=Math.abs(U-(ft+Ft));if($t>Ft+Y)return!1;var he=(ne-zt)/2,Ne=Math.abs(tt-(zt+he));if(Ne>he+Y)return!1;if($t<=Ft||Ne<=he)return!0;var Ie=$t-Ft,Fe=Ne-he;return Ie*Ie+Fe*Fe<=Y*Y};function vn(U,tt,Y,ft,zt){var Qt=t.create();return tt?(t.scale(Qt,Qt,[1/zt,1/zt,1]),Y||t.rotateZ(Qt,Qt,ft.angle)):t.multiply(Qt,ft.labelPlaneMatrix,U),Qt}function Oa(U,tt,Y,ft,zt){if(tt){var Qt=t.clone(U);return t.scale(Qt,Qt,[zt,zt,1]),Y||t.rotateZ(Qt,Qt,-ft.angle),Qt}else return ft.glCoordMatrix}function Qn(U,tt){var Y=[U.x,U.y,0,1];zo(Y,Y,tt);var ft=Y[3];return{point:new t.Point(Y[0]/ft,Y[1]/ft),signedDistanceFromCamera:ft}}function Qa(U,tt){return .5+.5*(U/tt)}function Ja(U,tt){var Y=U[0]/U[3],ft=U[1]/U[3],zt=Y>=-tt[0]&&Y<=tt[0]&&ft>=-tt[1]&&ft<=tt[1];return zt}function wi(U,tt,Y,ft,zt,Qt,ne,Ft){var $t=ft?U.textSizeData:U.iconSizeData,he=t.evaluateSizeForZoom($t,Y.transform.zoom),Ne=[256/Y.width*2+1,256/Y.height*2+1],Ie=ft?U.text.dynamicLayoutVertexArray:U.icon.dynamicLayoutVertexArray;Ie.clear();for(var Fe=U.lineVertexArray,He=ft?U.text.placedSymbolArray:U.icon.placedSymbolArray,Ge=Y.transform.width/Y.transform.height,Ae=!1,Oe=0;OeQt)return{useVertical:!0}}return(U===t.WritingMode.vertical?tt.yY.x)?{needsFlipping:!0}:null}function Ra(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie,Fe,He){var Ge=tt/24,Ae=U.lineOffsetX*Ge,Oe=U.lineOffsetY*Ge,Le;if(U.numGlyphs>1){var ur=U.glyphStartIndex+U.numGlyphs,Dr=U.lineStartIndex,jr=U.lineStartIndex+U.lineLength,On=ci(Ge,Ft,Ae,Oe,Y,Ne,Ie,U,$t,Qt,Fe);if(!On)return{notEnoughRoom:!0};var Ln=Qn(On.first.point,ne).point,xn=Qn(On.last.point,ne).point;if(ft&&!Y){var Wn=Ti(U.writingMode,Ln,xn,He);if(Wn)return Wn}Le=[On.first];for(var Dn=U.glyphStartIndex+1;Dn0?ma.point:Qi(Ie,Gn,la,1,zt),si=Ti(U.writingMode,la,ti,He);if(si)return si}var Li=Hi(Ge*Ft.getoffsetX(U.glyphStartIndex),Ae,Oe,Y,Ne,Ie,U.segment,U.lineStartIndex,U.lineStartIndex+U.lineLength,$t,Qt,Fe);if(!Li)return{notEnoughRoom:!0};Le=[Li]}for(var to=0,ls=Le;to0?1:-1,Ge=0;ft&&(He*=-1,Ge=Math.PI),He<0&&(Ge+=Math.PI);for(var Ae=He>0?Ft+ne:Ft+ne+1,Oe=zt,Le=zt,ur=0,Dr=0,jr=Math.abs(Fe),On=[];ur+Dr<=jr;){if(Ae+=He,Ae=$t)return null;if(Le=Oe,On.push(Oe),Oe=Ie[Ae],Oe===void 0){var Ln=new t.Point(he.getx(Ae),he.gety(Ae)),xn=Qn(Ln,Ne);if(xn.signedDistanceFromCamera>0)Oe=Ie[Ae]=xn.point;else{var Wn=Ae-He,Dn=ur===0?Qt:new t.Point(he.getx(Wn),he.gety(Wn));Oe=Qi(Dn,Ln,Le,jr-ur+1,Ne)}}ur+=Dr,Dr=Le.dist(Oe)}var la=(jr-ur)/Dr,qn=Oe.sub(Le),Gn=qn.mult(la)._add(Le);Gn._add(qn._unit()._perp()._mult(Y*He));var ma=Ge+Math.atan2(Oe.y-Le.y,Oe.x-Le.x);return On.push(Gn),{point:Gn,angle:ma,path:On}}var Ho=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ci(U,tt){for(var Y=0;Y=1;ls--)to.push(si.path[ls]);for(var ms=1;ms0){for(var mo=to[0].clone(),Xs=to[0].clone(),tc=1;tc=Gn.x&&Xs.x<=ma.x&&mo.y>=Gn.y&&Xs.y<=ma.y?Pl=[to]:Xs.xma.x||Xs.yma.y?Pl=[]:Pl=t.clipLine([to],Gn.x,Gn.y,ma.x,ma.y)}for(var kc=0,uh=Pl;kc=this.screenRightBoundary||ftthis.screenBottomBoundary},qo.prototype.isInsideGrid=function(U,tt,Y,ft){return Y>=0&&U=0&&tt0){var Dr;return this.prevPlacement&&this.prevPlacement.variableOffsets[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID].text&&(Dr=this.prevPlacement.variableOffsets[Ie.crossTileID].anchor),this.variableOffsets[Ie.crossTileID]={textOffset:Ae,width:Y,height:ft,anchor:U,textBoxScale:zt,prevAnchor:Dr},this.markUsedJustification(Fe,U,Ie,He),Fe.allowVerticalPlacement&&(this.markUsedOrientation(Fe,He,Ie),this.placedOrientations[Ie.crossTileID]=He),{shift:Oe,placedGlyphBoxes:Le}}},_o.prototype.placeLayerBucketPart=function(U,tt,Y){var ft=this,zt=U.parameters,Qt=zt.bucket,ne=zt.layout,Ft=zt.posMatrix,$t=zt.textLabelPlaneMatrix,he=zt.labelToScreenMatrix,Ne=zt.textPixelRatio,Ie=zt.holdingForFade,Fe=zt.collisionBoxArray,He=zt.partiallyEvaluatedTextSize,Ge=zt.collisionGroup,Ae=ne.get("text-optional"),Oe=ne.get("icon-optional"),Le=ne.get("text-allow-overlap"),ur=ne.get("icon-allow-overlap"),Dr=ne.get("text-rotation-alignment")==="map",jr=ne.get("text-pitch-alignment")==="map",On=ne.get("icon-text-fit")!=="none",Ln=ne.get("symbol-z-order")==="viewport-y",xn=Le&&(ur||!Qt.hasIconData()||Oe),Wn=ur&&(Le||!Qt.hasTextData()||Ae);!Qt.collisionArrays&&Fe&&Qt.deserializeCollisionBoxes(Fe);var Dn=function(si,Li){if(!tt[si.crossTileID]){if(Ie){ft.placements[si.crossTileID]=new uo(!1,!1,!1);return}var to=!1,ls=!1,ms=!0,Ko=null,gs={box:null,offscreen:null},Pl={box:null,offscreen:null},mo=null,Xs=null,tc=null,kc=0,uh=0,vh=0;Li.textFeatureIndex?kc=Li.textFeatureIndex:si.useRuntimeCollisionCircles&&(kc=si.featureIndex),Li.verticalTextFeatureIndex&&(uh=Li.verticalTextFeatureIndex);var Kf=Li.textBox;if(Kf){var Yf=function(ec){var Qc=t.WritingMode.horizontal;if(Qt.allowVerticalPlacement&&!ec&&ft.prevPlacement){var Ol=ft.prevPlacement.placedOrientations[si.crossTileID];Ol&&(ft.placedOrientations[si.crossTileID]=Ol,Qc=Ol,ft.markUsedOrientation(Qt,Qc,si))}return Qc},bh=function(ec,Qc){if(Qt.allowVerticalPlacement&&si.numVerticalGlyphVertices>0&&Li.verticalTextBox)for(var Ol=0,Ap=Qt.writingModes;Ol0&&(Ef=Ef.filter(function(ec){return ec!==Xf.anchor}),Ef.unshift(Xf.anchor))}var xf=function(ec,Qc,Ol){for(var Ap=ec.x2-ec.x1,Kp=ec.y2-ec.y1,P0=si.textBoxScale,Ul=On&&!ur?Qc:null,Zh={box:[],offscreen:!1},O0=Le?Ef.length*2:Ef.length,Mp=0;Mp=Ef.length,Yp=ft.attemptAnchorPlacement(Th,ec,Ap,Kp,P0,Dr,jr,Ne,Ft,Ge,Xm,si,Qt,Ol,Ul);if(Yp&&(Zh=Yp.placedGlyphBoxes,Zh&&Zh.box&&Zh.box.length)){to=!0,Ko=Yp.shift;break}}return Zh},Ph=function(){return xf(Kf,Li.iconBox,t.WritingMode.horizontal)},ip=function(){var ec=Li.verticalTextBox,Qc=gs&&gs.box&&gs.box.length;return Qt.allowVerticalPlacement&&!Qc&&si.numVerticalGlyphVertices>0&&ec?xf(ec,Li.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}};bh(Ph,ip),gs&&(to=gs.box,ms=gs.offscreen);var $f=Yf(gs&&gs.box);if(!to&&ft.prevPlacement){var Jf=ft.prevPlacement.variableOffsets[si.crossTileID];Jf&&(ft.variableOffsets[si.crossTileID]=Jf,ft.markUsedJustification(Qt,Jf.anchor,si,$f))}}else{var zf=function(ec,Qc){var Ol=ft.collisionIndex.placeCollisionBox(ec,Le,Ne,Ft,Ge.predicate);return Ol&&Ol.box&&Ol.box.length&&(ft.markUsedOrientation(Qt,Qc,si),ft.placedOrientations[si.crossTileID]=Qc),Ol},op=function(){return zf(Kf,t.WritingMode.horizontal)},wp=function(){var ec=Li.verticalTextBox;return Qt.allowVerticalPlacement&&si.numVerticalGlyphVertices>0&&ec?zf(ec,t.WritingMode.vertical):{box:null,offscreen:null}};bh(op,wp),Yf(gs&&gs.box&&gs.box.length)}}if(mo=gs,to=mo&&mo.box&&mo.box.length>0,ms=mo&&mo.offscreen,si.useRuntimeCollisionCircles){var sp=Qt.text.placedSymbolArray.get(si.centerJustifiedTextSymbolIndex),$c=t.evaluateSizeForFeature(Qt.textSizeData,He,sp),Gh=ne.get("text-padding"),Tp=si.collisionCircleDiameter;Xs=ft.collisionIndex.placeCollisionCircles(Le,sp,Qt.lineVertexArray,Qt.glyphOffsetArray,$c,Ft,$t,he,Y,jr,Ge.predicate,Tp,Gh),to=Le||Xs.circles.length>0&&!Xs.collisionDetected,ms=ms&&Xs.offscreen}if(Li.iconFeatureIndex&&(vh=Li.iconFeatureIndex),Li.iconBox){var Jc=function(ec){var Qc=On&&Ko?As(ec,Ko.x,Ko.y,Dr,jr,ft.transform.angle):ec;return ft.collisionIndex.placeCollisionBox(Qc,ur,Ne,Ft,Ge.predicate)};Pl&&Pl.box&&Pl.box.length&&Li.verticalIconBox?(tc=Jc(Li.verticalIconBox),ls=tc.box.length>0):(tc=Jc(Li.iconBox),ls=tc.box.length>0),ms=ms&&tc.offscreen}var lp=Ae||si.numHorizontalGlyphVertices===0&&si.numVerticalGlyphVertices===0,Gp=Oe||si.numIconVertices===0;if(!lp&&!Gp?ls=to=ls&&to:Gp?lp||(ls=ls&&to):to=ls&&to,to&&mo&&mo.box&&(Pl&&Pl.box&&uh?ft.collisionIndex.insertCollisionBox(mo.box,ne.get("text-ignore-placement"),Qt.bucketInstanceId,uh,Ge.ID):ft.collisionIndex.insertCollisionBox(mo.box,ne.get("text-ignore-placement"),Qt.bucketInstanceId,kc,Ge.ID)),ls&&tc&&ft.collisionIndex.insertCollisionBox(tc.box,ne.get("icon-ignore-placement"),Qt.bucketInstanceId,vh,Ge.ID),Xs&&(to&&ft.collisionIndex.insertCollisionCircles(Xs.circles,ne.get("text-ignore-placement"),Qt.bucketInstanceId,kc,Ge.ID),Y)){var Zp=Qt.bucketInstanceId,wh=ft.collisionCircleArrays[Zp];wh===void 0&&(wh=ft.collisionCircleArrays[Zp]=new yi);for(var kp=0;kp=0;--qn){var Gn=la[qn];Dn(Qt.symbolInstances.get(Gn),Qt.collisionArrays[Gn])}else for(var ma=U.symbolInstanceStart;ma=0&&(Qt>=0&&he!==Qt?U.text.placedSymbolArray.get(he).crossTileID=0:U.text.placedSymbolArray.get(he).crossTileID=Y.crossTileID)}},_o.prototype.markUsedOrientation=function(U,tt,Y){for(var ft=tt===t.WritingMode.horizontal||tt===t.WritingMode.horizontalOnly?tt:0,zt=tt===t.WritingMode.vertical?tt:0,Qt=[Y.leftJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.rightJustifiedTextSymbolIndex],ne=0,Ft=Qt;ne0||jr>0,Dn=ur.numIconVertices>0,la=ft.placedOrientations[ur.crossTileID],qn=la===t.WritingMode.vertical,Gn=la===t.WritingMode.horizontal||la===t.WritingMode.horizontalOnly;if(Wn){var ma=al(xn.text),ti=qn?ii:ma;He(U.text,Dr,ti);var si=Gn?ii:ma;He(U.text,jr,si);var Li=xn.text.isHidden();[ur.rightJustifiedTextSymbolIndex,ur.centerJustifiedTextSymbolIndex,ur.leftJustifiedTextSymbolIndex].forEach(function(vh){vh>=0&&(U.text.placedSymbolArray.get(vh).hidden=Li||qn?1:0)}),ur.verticalPlacedTextSymbolIndex>=0&&(U.text.placedSymbolArray.get(ur.verticalPlacedTextSymbolIndex).hidden=Li||Gn?1:0);var to=ft.variableOffsets[ur.crossTileID];to&&ft.markUsedJustification(U,to.anchor,ur,la);var ls=ft.placedOrientations[ur.crossTileID];ls&&(ft.markUsedJustification(U,"left",ur,ls),ft.markUsedOrientation(U,ls,ur))}if(Dn){var ms=al(xn.icon),Ko=!(Ie&&ur.verticalPlacedIconSymbolIndex&&qn);if(ur.placedIconSymbolIndex>=0){var gs=Ko?ms:ii;He(U.icon,ur.numIconVertices,gs),U.icon.placedSymbolArray.get(ur.placedIconSymbolIndex).hidden=xn.icon.isHidden()}if(ur.verticalPlacedIconSymbolIndex>=0){var Pl=Ko?ii:ms;He(U.icon,ur.numVerticalIconVertices,Pl),U.icon.placedSymbolArray.get(ur.verticalPlacedIconSymbolIndex).hidden=xn.icon.isHidden()}}if(U.hasIconCollisionBoxData()||U.hasTextCollisionBoxData()){var mo=U.collisionArrays[Le];if(mo){var Xs=new t.Point(0,0);if(mo.textBox||mo.verticalTextBox){var tc=!0;if($t){var kc=ft.variableOffsets[On];kc?(Xs=vs(kc.anchor,kc.width,kc.height,kc.textOffset,kc.textBoxScale),he&&Xs._rotate(Ne?ft.transform.angle:-ft.transform.angle)):tc=!1}mo.textBox&&Da(U.textCollisionBox.collisionVertexArray,xn.text.placed,!tc||qn,Xs.x,Xs.y),mo.verticalTextBox&&Da(U.textCollisionBox.collisionVertexArray,xn.text.placed,!tc||Gn,Xs.x,Xs.y)}var uh=!!(!Gn&&mo.verticalIconBox);mo.iconBox&&Da(U.iconCollisionBox.collisionVertexArray,xn.icon.placed,uh,Ie?Xs.x:0,Ie?Xs.y:0),mo.verticalIconBox&&Da(U.iconCollisionBox.collisionVertexArray,xn.icon.placed,!uh,Ie?Xs.x:0,Ie?Xs.y:0)}}},Ae=0;AeU},_o.prototype.setStale=function(){this.stale=!0};function Da(U,tt,Y,ft,zt){U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0)}var li=Math.pow(2,25),wo=Math.pow(2,24),Ms=Math.pow(2,17),Di=Math.pow(2,16),_s=Math.pow(2,9),No=Math.pow(2,8),is=Math.pow(2,1);function al(U){if(U.opacity===0&&!U.placed)return 0;if(U.opacity===1&&U.placed)return 4294967295;var tt=U.placed?1:0,Y=Math.floor(U.opacity*127);return Y*li+tt*wo+Y*Ms+tt*Di+Y*_s+tt*No+Y*is+tt}var ii=0,io=function(U){this._sortAcrossTiles=U.layout.get("symbol-z-order")!=="viewport-y"&&U.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};io.prototype.continuePlacement=function(U,tt,Y,ft,zt){for(var Qt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ne=U[this._currentPlacementIndex],Ft=tt[ne],$t=this.placement.collisionIndex.transform.zoom;if(Ft.type==="symbol"&&(!Ft.minzoom||Ft.minzoom<=$t)&&(!Ft.maxzoom||Ft.maxzoom>$t)){this._inProgressLayer||(this._inProgressLayer=new io(Ft));var he=this._inProgressLayer.continuePlacement(Y[Ft.source],this.placement,this._showCollisionBoxes,Ft,Qt);if(he)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},co.prototype.commit=function(U){return this.placement.commit(U),this.placement};var Is=512/t.EXTENT/2,Wo=function(U,tt,Y){this.tileID=U,this.indexedSymbolInstances={},this.bucketInstanceId=Y;for(var ft=0;ftU.overscaledZ)for(var $t in Ft){var he=Ft[$t];he.tileID.isChildOf(U)&&he.findMatches(tt.symbolInstances,U,Qt)}else{var Ne=U.scaledTo(Number(ne)),Ie=Ft[Ne.key];Ie&&Ie.findMatches(tt.symbolInstances,U,Qt)}}for(var Fe=0;Fe0)throw new Error("Unimplemented: "+Qt.map(function(ne){return ne.command}).join(", ")+".");return zt.forEach(function(ne){ne.command!=="setTransition"&&ft[ne.command].apply(ft,ne.args)}),this.stylesheet=Y,!0},tt.prototype.addImage=function(Y,ft){if(this.getImage(Y))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(Y,ft),this._afterImageUpdated(Y)},tt.prototype.updateImage=function(Y,ft){this.imageManager.updateImage(Y,ft)},tt.prototype.getImage=function(Y){return this.imageManager.getImage(Y)},tt.prototype.removeImage=function(Y){if(!this.getImage(Y))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(Y),this._afterImageUpdated(Y)},tt.prototype._afterImageUpdated=function(Y){this._availableImages=this.imageManager.listImages(),this._changedImages[Y]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},tt.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},tt.prototype.addSource=function(Y,ft,zt){var Qt=this;if(zt===void 0&&(zt={}),this._checkLoaded(),this.sourceCaches[Y]!==void 0)throw new Error("There is already a source with this ID");if(!ft.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(ft).join(", ")+".");var ne=["vector","raster","geojson","video","image"],Ft=ne.indexOf(ft.type)>=0;if(!(Ft&&this._validate(t.validateStyle.source,"sources."+Y,ft,null,zt))){this.map&&this.map._collectResourceTiming&&(ft.collectResourceTiming=!0);var $t=this.sourceCaches[Y]=new Yr(Y,ft,this.dispatcher);$t.style=this,$t.setEventedParent(this,function(){return{isSourceLoaded:Qt.loaded(),source:$t.serialize(),sourceId:Y}}),$t.onAdd(this.map),this._changed=!0}},tt.prototype.removeSource=function(Y){if(this._checkLoaded(),this.sourceCaches[Y]===void 0)throw new Error("There is no source with this ID");for(var ft in this._layers)if(this._layers[ft].source===Y)return this.fire(new t.ErrorEvent(new Error('Source "'+Y+'" cannot be removed while layer "'+ft+'" is using it.')));var zt=this.sourceCaches[Y];delete this.sourceCaches[Y],delete this._updatedSources[Y],zt.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:Y})),zt.setEventedParent(null),zt.clearTiles(),zt.onRemove&&zt.onRemove(this.map),this._changed=!0},tt.prototype.setGeoJSONSourceData=function(Y,ft){this._checkLoaded();var zt=this.sourceCaches[Y].getSource();zt.setData(ft),this._changed=!0},tt.prototype.getSource=function(Y){return this.sourceCaches[Y]&&this.sourceCaches[Y].getSource()},tt.prototype.addLayer=function(Y,ft,zt){zt===void 0&&(zt={}),this._checkLoaded();var Qt=Y.id;if(this.getLayer(Qt)){this.fire(new t.ErrorEvent(new Error('Layer with id "'+Qt+'" already exists on this map')));return}var ne;if(Y.type==="custom"){if(Jo(this,t.validateCustomStyleLayer(Y)))return;ne=t.createStyleLayer(Y)}else{if(typeof Y.source=="object"&&(this.addSource(Qt,Y.source),Y=t.clone$1(Y),Y=t.extend(Y,{source:Qt})),this._validate(t.validateStyle.layer,"layers."+Qt,Y,{arrayIndex:-1},zt))return;ne=t.createStyleLayer(Y),this._validateLayer(ne),ne.setEventedParent(this,{layer:{id:Qt}}),this._serializedLayers[ne.id]=ne.serialize()}var Ft=ft?this._order.indexOf(ft):this._order.length;if(ft&&Ft===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+ft+'" does not exist on this map.')));return}if(this._order.splice(Ft,0,Qt),this._layerOrderChanged=!0,this._layers[Qt]=ne,this._removedLayers[Qt]&&ne.source&&ne.type!=="custom"){var $t=this._removedLayers[Qt];delete this._removedLayers[Qt],$t.type!==ne.type?this._updatedSources[ne.source]="clear":(this._updatedSources[ne.source]="reload",this.sourceCaches[ne.source].pause())}this._updateLayer(ne),ne.onAdd&&ne.onAdd(this.map)},tt.prototype.moveLayer=function(Y,ft){this._checkLoaded(),this._changed=!0;var zt=this._layers[Y];if(!zt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be moved.")));return}if(Y!==ft){var Qt=this._order.indexOf(Y);this._order.splice(Qt,1);var ne=ft?this._order.indexOf(ft):this._order.length;if(ft&&ne===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+ft+'" does not exist on this map.')));return}this._order.splice(ne,0,Y),this._layerOrderChanged=!0}},tt.prototype.removeLayer=function(Y){this._checkLoaded();var ft=this._layers[Y];if(!ft){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be removed.")));return}ft.setEventedParent(null);var zt=this._order.indexOf(Y);this._order.splice(zt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[Y]=ft,delete this._layers[Y],delete this._serializedLayers[Y],delete this._updatedLayers[Y],delete this._updatedPaintProps[Y],ft.onRemove&&ft.onRemove(this.map)},tt.prototype.getLayer=function(Y){return this._layers[Y]},tt.prototype.hasLayer=function(Y){return Y in this._layers},tt.prototype.setLayerZoomRange=function(Y,ft,zt){this._checkLoaded();var Qt=this.getLayer(Y);if(!Qt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot have zoom extent.")));return}Qt.minzoom===ft&&Qt.maxzoom===zt||(ft!=null&&(Qt.minzoom=ft),zt!=null&&(Qt.maxzoom=zt),this._updateLayer(Qt))},tt.prototype.setFilter=function(Y,ft,zt){zt===void 0&&(zt={}),this._checkLoaded();var Qt=this.getLayer(Y);if(!Qt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be filtered.")));return}if(!t.deepEqual(Qt.filter,ft)){if(ft==null){Qt.filter=void 0,this._updateLayer(Qt);return}this._validate(t.validateStyle.filter,"layers."+Qt.id+".filter",ft,null,zt)||(Qt.filter=t.clone$1(ft),this._updateLayer(Qt))}},tt.prototype.getFilter=function(Y){return t.clone$1(this.getLayer(Y).filter)},tt.prototype.setLayoutProperty=function(Y,ft,zt,Qt){Qt===void 0&&(Qt={}),this._checkLoaded();var ne=this.getLayer(Y);if(!ne){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be styled.")));return}t.deepEqual(ne.getLayoutProperty(ft),zt)||(ne.setLayoutProperty(ft,zt,Qt),this._updateLayer(ne))},tt.prototype.getLayoutProperty=function(Y,ft){var zt=this.getLayer(Y);if(!zt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style.")));return}return zt.getLayoutProperty(ft)},tt.prototype.setPaintProperty=function(Y,ft,zt,Qt){Qt===void 0&&(Qt={}),this._checkLoaded();var ne=this.getLayer(Y);if(!ne){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be styled.")));return}if(!t.deepEqual(ne.getPaintProperty(ft),zt)){var Ft=ne.setPaintProperty(ft,zt,Qt);Ft&&this._updateLayer(ne),this._changed=!0,this._updatedPaintProps[Y]=!0}},tt.prototype.getPaintProperty=function(Y,ft){return this.getLayer(Y).getPaintProperty(ft)},tt.prototype.setFeatureState=function(Y,ft){this._checkLoaded();var zt=Y.source,Qt=Y.sourceLayer,ne=this.sourceCaches[zt];if(ne===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+zt+"' does not exist in the map's style.")));return}var Ft=ne.getSource().type;if(Ft==="geojson"&&Qt){this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Ft==="vector"&&!Qt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}Y.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),ne.setFeatureState(Qt,Y.id,ft)},tt.prototype.removeFeatureState=function(Y,ft){this._checkLoaded();var zt=Y.source,Qt=this.sourceCaches[zt];if(Qt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+zt+"' does not exist in the map's style.")));return}var ne=Qt.getSource().type,Ft=ne==="vector"?Y.sourceLayer:void 0;if(ne==="vector"&&!Ft){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(ft&&typeof Y.id!="string"&&typeof Y.id!="number"){this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Qt.removeFeatureState(Ft,Y.id,ft)},tt.prototype.getFeatureState=function(Y){this._checkLoaded();var ft=Y.source,zt=Y.sourceLayer,Qt=this.sourceCaches[ft];if(Qt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+ft+"' does not exist in the map's style.")));return}var ne=Qt.getSource().type;if(ne==="vector"&&!zt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return Y.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),Qt.getFeatureState(zt,Y.id)},tt.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},tt.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(Y){return Y.serialize()}),layers:this._serializeLayers(this._order)},function(Y){return Y!==void 0})},tt.prototype._updateLayer=function(Y){this._updatedLayers[Y.id]=!0,Y.source&&!this._updatedSources[Y.source]&&this.sourceCaches[Y.source].getSource().type!=="raster"&&(this._updatedSources[Y.source]="reload",this.sourceCaches[Y.source].pause()),this._changed=!0},tt.prototype._flattenAndSortRenderedFeatures=function(Y){for(var ft=this,zt=function(Gn){return ft._layers[Gn].type==="fill-extrusion"},Qt={},ne=[],Ft=this._order.length-1;Ft>=0;Ft--){var $t=this._order[Ft];if(zt($t)){Qt[$t]=Ft;for(var he=0,Ne=Y;he=0;Le--){var ur=this._order[Le];if(zt(ur))for(var Dr=ne.length-1;Dr>=0;Dr--){var jr=ne[Dr].feature;if(Qt[jr.layer.id] 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,wl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Yc=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,Fc=`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,mc="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Wu=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Cc="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Ic=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,du=` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Bc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Pu=` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,wu=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Tl=` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,Ju=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Pc=` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Es=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,_c="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",lf=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Rc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,gc=`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Nc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,Zl=`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,jc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,rl=Vs(au,fu),Kl=Vs(Ec,xc),Gu=Vs(cs,Gl),Bs=Vs(zc,Al),Ou=Vs(_l,Ml),Rl=Vs(hu,Fs),Yl=Vs(bl,Fo),Ws=Vs(bs,Iu),ac=Vs(Nl,Hu),Tu=Vs(qs,sf),Zu=Vs(Oo,yf),bc=Vs(os,Fi),uf=Vs(nc,pu),Sf=Vs(ml,Lc),ic=Vs(qu,dc),wc=Vs(wl,Yc),Fl=Vs(Fc,mc),oc=Vs(Wu,Cc),iu=Vs(Ic,du),sc=Vs(Bc,Pu),Tc=Vs(wu,Tl),ku=Vs(Ju,Pc),Gs=Vs(Es,_c),Du=Vs(lf,Rc),Xl=Vs(gc,Nc),Xc=Vs(Zl,jc);function Vs(U,tt){var Y=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,ft=tt.match(/attribute ([\w]+) ([\w]+)/g),zt=U.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Qt=tt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ne=Qt?Qt.concat(zt):zt,Ft={};return U=U.replace(Y,function($t,he,Ne,Ie,Fe){return Ft[Fe]=!0,he==="define"?` -#ifndef HAS_UNIFORM_u_`+Fe+` -varying `+Ne+" "+Ie+" "+Fe+`; -#else -uniform `+Ne+" "+Ie+" u_"+Fe+`; -#endif -`:` -#ifdef HAS_UNIFORM_u_`+Fe+` - `+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`; -#endif -`}),tt=tt.replace(Y,function($t,he,Ne,Ie,Fe){var He=Ie==="float"?"vec2":"vec4",Ge=Fe.match(/color/)?"color":He;return Ft[Fe]?he==="define"?` -#ifndef HAS_UNIFORM_u_`+Fe+` -uniform lowp float u_`+Fe+`_t; -attribute `+Ne+" "+He+" a_"+Fe+`; -varying `+Ne+" "+Ie+" "+Fe+`; -#else -uniform `+Ne+" "+Ie+" u_"+Fe+`; -#endif -`:Ge==="vec4"?` -#ifndef HAS_UNIFORM_u_`+Fe+` - `+Fe+" = a_"+Fe+`; -#else - `+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`; -#endif -`:` -#ifndef HAS_UNIFORM_u_`+Fe+` - `+Fe+" = unpack_mix_"+Ge+"(a_"+Fe+", u_"+Fe+`_t); -#else - `+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`; -#endif -`:he==="define"?` -#ifndef HAS_UNIFORM_u_`+Fe+` -uniform lowp float u_`+Fe+`_t; -attribute `+Ne+" "+He+" a_"+Fe+`; -#else -uniform `+Ne+" "+Ie+" u_"+Fe+`; -#endif -`:Ge==="vec4"?` -#ifndef HAS_UNIFORM_u_`+Fe+` - `+Ne+" "+Ie+" "+Fe+" = a_"+Fe+`; -#else - `+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`; -#endif -`:` -#ifndef HAS_UNIFORM_u_`+Fe+` - `+Ne+" "+Ie+" "+Fe+" = unpack_mix_"+Ge+"(a_"+Fe+", u_"+Fe+`_t); -#else - `+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`; -#endif -`}),{fragmentSource:U,vertexSource:tt,staticAttributes:ft,staticUniforms:ne}}var vc=Object.freeze({__proto__:null,prelude:rl,background:Kl,backgroundPattern:Gu,circle:Bs,clippingMask:Ou,heatmap:Rl,heatmapTexture:Yl,collisionBox:Ws,collisionCircle:ac,debug:Tu,fill:Zu,fillOutline:bc,fillOutlinePattern:uf,fillPattern:Sf,fillExtrusion:ic,fillExtrusionPattern:wc,hillshadePrepare:Fl,hillshade:oc,line:iu,lineGradient:sc,linePattern:Tc,lineSDF:ku,raster:Gs,symbolIcon:Du,symbolSDF:Xl,symbolTextAndIcon:Xc}),Ku=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Ku.prototype.bind=function(U,tt,Y,ft,zt,Qt,ne,Ft){this.context=U;for(var $t=this.boundPaintVertexBuffers.length!==ft.length,he=0;!$t&&he>16,Ft>>16],u_pixel_coord_lower:[ne&65535,Ft&65535]}}function yc(U,tt,Y,ft){var zt=Y.imageManager.getPattern(U.from.toString()),Qt=Y.imageManager.getPattern(U.to.toString()),ne=Y.imageManager.getPixelSize(),Ft=ne.width,$t=ne.height,he=Math.pow(2,ft.tileID.overscaledZ),Ne=ft.tileSize*Math.pow(2,Y.transform.tileZoom)/he,Ie=Ne*(ft.tileID.canonical.x+ft.tileID.wrap*he),Fe=Ne*ft.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:zt.tl,u_pattern_br_a:zt.br,u_pattern_tl_b:Qt.tl,u_pattern_br_b:Qt.br,u_texsize:[Ft,$t],u_mix:tt.t,u_pattern_size_a:zt.displaySize,u_pattern_size_b:Qt.displaySize,u_scale_a:tt.fromScale,u_scale_b:tt.toScale,u_tile_units_to_pixels:1/Po(ft,1,Y.transform.tileZoom),u_pixel_coord_upper:[Ie>>16,Fe>>16],u_pixel_coord_lower:[Ie&65535,Fe&65535]}}var cf=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_lightpos:new t.Uniform3f(U,tt.u_lightpos),u_lightintensity:new t.Uniform1f(U,tt.u_lightintensity),u_lightcolor:new t.Uniform3f(U,tt.u_lightcolor),u_vertical_gradient:new t.Uniform1f(U,tt.u_vertical_gradient),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},zl=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_lightpos:new t.Uniform3f(U,tt.u_lightpos),u_lightintensity:new t.Uniform1f(U,tt.u_lightintensity),u_lightcolor:new t.Uniform3f(U,tt.u_lightcolor),u_vertical_gradient:new t.Uniform1f(U,tt.u_vertical_gradient),u_height_factor:new t.Uniform1f(U,tt.u_height_factor),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},Uc=function(U,tt,Y,ft){var zt=tt.style.light,Qt=zt.properties.get("position"),ne=[Qt.x,Qt.y,Qt.z],Ft=t.create$1();zt.properties.get("anchor")==="viewport"&&t.fromRotation(Ft,-tt.transform.angle),t.transformMat3(ne,ne,Ft);var $t=zt.properties.get("color");return{u_matrix:U,u_lightpos:ne,u_lightintensity:zt.properties.get("intensity"),u_lightcolor:[$t.r,$t.g,$t.b],u_vertical_gradient:+Y,u_opacity:ft}},su=function(U,tt,Y,ft,zt,Qt,ne){return t.extend(Uc(U,tt,Y,ft),Yu(Qt,tt,ne),{u_height_factor:-Math.pow(2,zt.overscaledZ)/ne.tileSize/8})},Fu=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Au=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},il=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world)}},Cs=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},Mu=function(U){return{u_matrix:U}},lc=function(U,tt,Y,ft){return t.extend(Mu(U),Yu(Y,tt,ft))},Su=function(U,tt){return{u_matrix:U,u_world:tt}},Oc=function(U,tt,Y,ft,zt){return t.extend(lc(U,tt,Y,ft),{u_world:zt})},Xe=function(U,tt){return{u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(U,tt.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(U,tt.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},yr=function(U,tt,Y,ft){var zt=U.transform,Qt,ne;if(ft.paint.get("circle-pitch-alignment")==="map"){var Ft=Po(Y,1,zt.zoom);Qt=!0,ne=[Ft,Ft]}else Qt=!1,ne=zt.pixelsToGLUnits;return{u_camera_to_center_distance:zt.cameraToCenterDistance,u_scale_with_map:+(ft.paint.get("circle-pitch-scale")==="map"),u_matrix:U.translatePosMatrix(tt.posMatrix,Y,ft.paint.get("circle-translate"),ft.paint.get("circle-translate-anchor")),u_pitch_with_map:+Qt,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:ne}},Kr=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(U,tt.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(U,tt.u_extrude_scale),u_overscale_factor:new t.Uniform1f(U,tt.u_overscale_factor)}},Rr=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_inv_matrix:new t.UniformMatrix4f(U,tt.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(U,tt.u_viewport_size)}},mn=function(U,tt,Y){var ft=Po(Y,1,tt.zoom),zt=Math.pow(2,tt.zoom-Y.tileID.overscaledZ),Qt=Y.tileID.overscaleFactor();return{u_matrix:U,u_camera_to_center_distance:tt.cameraToCenterDistance,u_pixels_to_tile_units:ft,u_extrude_scale:[tt.pixelsToGLUnits[0]/(ft*zt),tt.pixelsToGLUnits[1]/(ft*zt)],u_overscale_factor:Qt}},Pn=function(U,tt,Y){return{u_matrix:U,u_inv_matrix:tt,u_camera_to_center_distance:Y.cameraToCenterDistance,u_viewport_size:[Y.width,Y.height]}},ha=function(U,tt){return{u_color:new t.UniformColor(U,tt.u_color),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_overlay:new t.Uniform1i(U,tt.u_overlay),u_overlay_scale:new t.Uniform1f(U,tt.u_overlay_scale)}},Ta=function(U,tt,Y){return Y===void 0&&(Y=1),{u_matrix:U,u_color:tt,u_overlay:0,u_overlay_scale:Y}},Ua=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Ya=function(U){return{u_matrix:U}},va=function(U,tt){return{u_extrude_scale:new t.Uniform1f(U,tt.u_extrude_scale),u_intensity:new t.Uniform1f(U,tt.u_intensity),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Ba=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world),u_image:new t.Uniform1i(U,tt.u_image),u_color_ramp:new t.Uniform1i(U,tt.u_color_ramp),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},za=function(U,tt,Y,ft){return{u_matrix:U,u_extrude_scale:Po(tt,1,Y),u_intensity:ft}},ca=function(U,tt,Y,ft){var zt=t.create();t.ortho(zt,0,U.width,U.height,0,0,1);var Qt=U.context.gl;return{u_matrix:zt,u_world:[Qt.drawingBufferWidth,Qt.drawingBufferHeight],u_image:Y,u_color_ramp:ft,u_opacity:tt.paint.get("heatmap-opacity")}},ei=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_latrange:new t.Uniform2f(U,tt.u_latrange),u_light:new t.Uniform2f(U,tt.u_light),u_shadow:new t.UniformColor(U,tt.u_shadow),u_highlight:new t.UniformColor(U,tt.u_highlight),u_accent:new t.UniformColor(U,tt.u_accent)}},Vi=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_dimension:new t.Uniform2f(U,tt.u_dimension),u_zoom:new t.Uniform1f(U,tt.u_zoom),u_unpack:new t.Uniform4f(U,tt.u_unpack)}},Oi=function(U,tt,Y){var ft=Y.paint.get("hillshade-shadow-color"),zt=Y.paint.get("hillshade-highlight-color"),Qt=Y.paint.get("hillshade-accent-color"),ne=Y.paint.get("hillshade-illumination-direction")*(Math.PI/180);Y.paint.get("hillshade-illumination-anchor")==="viewport"&&(ne-=U.transform.angle);var Ft=!U.options.moving;return{u_matrix:U.transform.calculatePosMatrix(tt.tileID.toUnwrapped(),Ft),u_image:0,u_latrange:Xi(U,tt.tileID),u_light:[Y.paint.get("hillshade-exaggeration"),ne],u_shadow:ft,u_highlight:zt,u_accent:Qt}},Wi=function(U,tt){var Y=tt.stride,ft=t.create();return t.ortho(ft,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(ft,ft,[0,-t.EXTENT,0]),{u_matrix:ft,u_image:1,u_dimension:[Y,Y],u_zoom:U.overscaledZ,u_unpack:tt.getUnpackVector()}};function Xi(U,tt){var Y=Math.pow(2,tt.canonical.z),ft=tt.canonical.y;return[new t.MercatorCoordinate(0,ft/Y).toLngLat().lat,new t.MercatorCoordinate(0,(ft+1)/Y).toLngLat().lat]}var ni=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels)}},Za=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_image:new t.Uniform1i(U,tt.u_image),u_image_height:new t.Uniform1f(U,tt.u_image_height)}},$i=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_image:new t.Uniform1i(U,tt.u_image),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},Do=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(U,tt.u_patternscale_a),u_patternscale_b:new t.Uniform2f(U,tt.u_patternscale_b),u_sdfgamma:new t.Uniform1f(U,tt.u_sdfgamma),u_image:new t.Uniform1i(U,tt.u_image),u_tex_y_a:new t.Uniform1f(U,tt.u_tex_y_a),u_tex_y_b:new t.Uniform1f(U,tt.u_tex_y_b),u_mix:new t.Uniform1f(U,tt.u_mix)}},ss=function(U,tt,Y){var ft=U.transform;return{u_matrix:ll(U,tt,Y),u_ratio:1/Po(tt,1,ft.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/ft.pixelsToGLUnits[0],1/ft.pixelsToGLUnits[1]]}},Ps=function(U,tt,Y,ft){return t.extend(ss(U,tt,Y),{u_image:0,u_image_height:ft})},ys=function(U,tt,Y,ft){var zt=U.transform,Qt=Yo(tt,zt);return{u_matrix:ll(U,tt,Y),u_texsize:tt.imageAtlasTexture.size,u_ratio:1/Po(tt,1,zt.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[Qt,ft.fromScale,ft.toScale],u_fade:ft.t,u_units_to_pixels:[1/zt.pixelsToGLUnits[0],1/zt.pixelsToGLUnits[1]]}},Os=function(U,tt,Y,ft,zt){var Qt=U.transform,ne=U.lineAtlas,Ft=Yo(tt,Qt),$t=Y.layout.get("line-cap")==="round",he=ne.getDash(ft.from,$t),Ne=ne.getDash(ft.to,$t),Ie=he.width*zt.fromScale,Fe=Ne.width*zt.toScale;return t.extend(ss(U,tt,Y),{u_patternscale_a:[Ft/Ie,-he.height/2],u_patternscale_b:[Ft/Fe,-Ne.height/2],u_sdfgamma:ne.width/(Math.min(Ie,Fe)*256*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:he.y,u_tex_y_b:Ne.y,u_mix:zt.t})};function Yo(U,tt){return 1/Po(U,1,tt.tileZoom)}function ll(U,tt,Y){return U.translatePosMatrix(tt.tileID.posMatrix,tt,Y.paint.get("line-translate"),Y.paint.get("line-translate-anchor"))}var el=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_tl_parent:new t.Uniform2f(U,tt.u_tl_parent),u_scale_parent:new t.Uniform1f(U,tt.u_scale_parent),u_buffer_scale:new t.Uniform1f(U,tt.u_buffer_scale),u_fade_t:new t.Uniform1f(U,tt.u_fade_t),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_image0:new t.Uniform1i(U,tt.u_image0),u_image1:new t.Uniform1i(U,tt.u_image1),u_brightness_low:new t.Uniform1f(U,tt.u_brightness_low),u_brightness_high:new t.Uniform1f(U,tt.u_brightness_high),u_saturation_factor:new t.Uniform1f(U,tt.u_saturation_factor),u_contrast_factor:new t.Uniform1f(U,tt.u_contrast_factor),u_spin_weights:new t.Uniform3f(U,tt.u_spin_weights)}},Rs=function(U,tt,Y,ft,zt){return{u_matrix:U,u_tl_parent:tt,u_scale_parent:Y,u_buffer_scale:1,u_fade_t:ft.mix,u_opacity:ft.opacity*zt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:zt.paint.get("raster-brightness-min"),u_brightness_high:zt.paint.get("raster-brightness-max"),u_saturation_factor:ws(zt.paint.get("raster-saturation")),u_contrast_factor:so(zt.paint.get("raster-contrast")),u_spin_weights:bi(zt.paint.get("raster-hue-rotate"))}};function bi(U){U*=Math.PI/180;var tt=Math.sin(U),Y=Math.cos(U);return[(2*Y+1)/3,(-Math.sqrt(3)*tt-Y+1)/3,(Math.sqrt(3)*tt-Y+1)/3]}function so(U){return U>0?1/(1-U):1+U}function ws(U){return U>0?1-1/(1.001-U):-U}var fs=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texture:new t.Uniform1i(U,tt.u_texture)}},Ll=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texture:new t.Uniform1i(U,tt.u_texture),u_gamma_scale:new t.Uniform1f(U,tt.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(U,tt.u_is_halo)}},$l=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texsize_icon:new t.Uniform2f(U,tt.u_texsize_icon),u_texture:new t.Uniform1i(U,tt.u_texture),u_texture_icon:new t.Uniform1i(U,tt.u_texture_icon),u_gamma_scale:new t.Uniform1f(U,tt.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(U,tt.u_is_halo)}},jl=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he){var Ne=zt.transform;return{u_is_size_zoom_constant:+(U==="constant"||U==="source"),u_is_size_feature_constant:+(U==="constant"||U==="camera"),u_size_t:tt?tt.uSizeT:0,u_size:tt?tt.uSize:0,u_camera_to_center_distance:Ne.cameraToCenterDistance,u_pitch:Ne.pitch/360*2*Math.PI,u_rotate_symbol:+Y,u_aspect_ratio:Ne.width/Ne.height,u_fade_change:zt.options.fadeDuration?zt.symbolFadeChange:1,u_matrix:Qt,u_label_plane_matrix:ne,u_coord_matrix:Ft,u_is_text:+$t,u_pitch_with_map:+ft,u_texsize:he,u_texture:0}},Bu=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne){var Ie=zt.transform;return t.extend(jl(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he),{u_gamma_scale:ft?Math.cos(Ie._pitch)*Ie.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},Jl=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he){return t.extend(Bu(U,tt,Y,ft,zt,Qt,ne,Ft,!0,$t),{u_texsize_icon:he,u_texture_icon:1})},Ru=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_color:new t.UniformColor(U,tt.u_color)}},nl=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_image:new t.Uniform1i(U,tt.u_image),u_pattern_tl_a:new t.Uniform2f(U,tt.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(U,tt.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(U,tt.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(U,tt.u_pattern_br_b),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_mix:new t.Uniform1f(U,tt.u_mix),u_pattern_size_a:new t.Uniform2f(U,tt.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(U,tt.u_pattern_size_b),u_scale_a:new t.Uniform1f(U,tt.u_scale_a),u_scale_b:new t.Uniform1f(U,tt.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(U,tt.u_tile_units_to_pixels)}},Nu=function(U,tt,Y){return{u_matrix:U,u_opacity:tt,u_color:Y}},Ui=function(U,tt,Y,ft,zt,Qt){return t.extend(yc(ft,Qt,Y,zt),{u_matrix:U,u_opacity:tt})},fo={fillExtrusion:cf,fillExtrusionPattern:zl,fill:Fu,fillPattern:Au,fillOutline:il,fillOutlinePattern:Cs,circle:Xe,collisionBox:Kr,collisionCircle:Rr,debug:ha,clippingMask:Ua,heatmap:va,heatmapTexture:Ba,hillshade:ei,hillshadePrepare:Vi,line:ni,lineGradient:Za,linePattern:$i,lineSDF:Do,raster:el,symbolIcon:fs,symbolSDF:Ll,symbolTextAndIcon:$l,background:Ru,backgroundPattern:nl},Ql;function ul(U,tt,Y,ft,zt,Qt,ne){for(var Ft=U.context,$t=Ft.gl,he=U.useProgram("collisionBox"),Ne=[],Ie=0,Fe=0,He=0;He0){var jr=t.create(),On=Le;t.mul(jr,Oe.placementInvProjMatrix,U.transform.glCoordMatrix),t.mul(jr,jr,Oe.placementViewportMatrix),Ne.push({circleArray:Dr,circleOffset:Fe,transform:On,invTransform:jr}),Ie+=Dr.length/4,Fe=Ie}ur&&he.draw(Ft,$t.LINES,bn.disabled,gn.disabled,U.colorModeForRenderPass(),zr.disabled,mn(Le,U.transform,Ae),Y.id,ur.layoutVertexBuffer,ur.indexBuffer,ur.segments,null,U.transform.zoom,null,null,ur.collisionVertexBuffer)}}if(!(!ne||!Ne.length)){var Ln=U.useProgram("collisionCircle"),xn=new t.StructArrayLayout2f1f2i16;xn.resize(Ie*4),xn._trim();for(var Wn=0,Dn=0,la=Ne;Dn=0&&(Ge[Oe.associatedIconIndex]={shiftedAnchor:ma,angle:ti})}}if(Ne){He.clear();for(var Li=U.icon.placedSymbolArray,to=0;to0){var ne=t.browser.now(),Ft=(ne-U.timeAdded)/Qt,$t=tt?(ne-tt.timeAdded)/Qt:-1,he=Y.getSource(),Ne=zt.coveringZoomLevel({tileSize:he.tileSize,roundZoom:he.roundZoom}),Ie=!tt||Math.abs(tt.tileID.overscaledZ-Ne)>Math.abs(U.tileID.overscaledZ-Ne),Fe=Ie&&U.refreshedUponExpiration?1:t.clamp(Ie?Ft:1-$t,0,1);return U.refreshedUponExpiration&&Ft>=1&&(U.refreshedUponExpiration=!1),tt?{opacity:1,mix:1-Fe}:{opacity:Fe,mix:0}}else return{opacity:1,mix:0}}function gr(U,tt,Y){var ft=Y.paint.get("background-color"),zt=Y.paint.get("background-opacity");if(zt!==0){var Qt=U.context,ne=Qt.gl,Ft=U.transform,$t=Ft.tileSize,he=Y.paint.get("background-pattern");if(!U.isPatternMissing(he)){var Ne=!he&&ft.a===1&&zt===1&&U.opaquePassEnabledForLayer()?"opaque":"translucent";if(U.renderPass===Ne){var Ie=gn.disabled,Fe=U.depthModeForSublayer(0,Ne==="opaque"?bn.ReadWrite:bn.ReadOnly),He=U.colorModeForRenderPass(),Ge=U.useProgram(he?"backgroundPattern":"background"),Ae=Ft.coveringTiles({tileSize:$t});he&&(Qt.activeTexture.set(ne.TEXTURE0),U.imageManager.bind(U.context));for(var Oe=Y.getCrossfadeParameters(),Le=0,ur=Ae;Le "+Y.overscaledZ);var Le=Oe+" "+He+"kb";Yi(U,Le),ne.draw(ft,zt.TRIANGLES,Ft,$t,Re.alphaBlended,zr.disabled,Ta(Qt,t.Color.transparent,Ae),Ne,U.debugBuffer,U.quadTriangleIndexBuffer,U.debugSegments)}function Yi(U,tt){U.initDebugOverlayCanvas();var Y=U.debugOverlayCanvas,ft=U.context.gl,zt=U.debugOverlayCanvas.getContext("2d");zt.clearRect(0,0,Y.width,Y.height),zt.shadowColor="white",zt.shadowBlur=2,zt.lineWidth=1.5,zt.strokeStyle="white",zt.textBaseline="top",zt.font="bold 36px Open Sans, sans-serif",zt.fillText(tt,5,5),zt.strokeText(tt,5,5),U.debugOverlayTexture.update(Y),U.debugOverlayTexture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE)}function Go(U,tt,Y){var ft=U.context,zt=Y.implementation;if(U.renderPass==="offscreen"){var Qt=zt.prerender;Qt&&(U.setCustomLayerDefaults(),ft.setColorMode(U.colorModeForRenderPass()),Qt.call(zt,ft.gl,U.transform.customLayerMatrix()),ft.setDirty(),U.setBaseState())}else if(U.renderPass==="translucent"){U.setCustomLayerDefaults(),ft.setColorMode(U.colorModeForRenderPass()),ft.setStencilMode(gn.disabled);var ne=zt.renderingMode==="3d"?new bn(U.context.gl.LEQUAL,bn.ReadWrite,U.depthRangeFor3D):U.depthModeForSublayer(0,bn.ReadOnly);ft.setDepthMode(ne),zt.render(ft.gl,U.transform.customLayerMatrix()),ft.setDirty(),U.setBaseState(),ft.bindFramebuffer.set(null)}}var Xo={symbol:L,circle:Pe,heatmap:$e,line:Jr,fill:Rt,"fill-extrusion":ae,hillshade:Te,raster:rr,background:gr,debug:Ai,custom:Go},po=function(U,tt){this.context=new tn(U),this.transform=tt,this._tileTextures={},this.setup(),this.numSublayers=Yr.maxUnderzooming+Yr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fl,this.gpuTimers={}};po.prototype.resize=function(U,tt){if(this.width=U*t.browser.devicePixelRatio,this.height=tt*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var Y=0,ft=this.style._order;Y256&&this.clearStencil(),Y.setColorMode(Re.disabled),Y.setDepthMode(bn.disabled);var zt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Qt=0,ne=tt;Qt256&&this.clearStencil();var U=this.nextStencilID++,tt=this.context.gl;return new gn({func:tt.NOTEQUAL,mask:255},U,255,tt.KEEP,tt.KEEP,tt.REPLACE)},po.prototype.stencilModeForClipping=function(U){var tt=this.context.gl;return new gn({func:tt.EQUAL,mask:255},this._tileClippingMaskIDs[U.key],0,tt.KEEP,tt.KEEP,tt.REPLACE)},po.prototype.stencilConfigForOverlap=function(U){var tt,Y=this.context.gl,ft=U.sort(function($t,he){return he.overscaledZ-$t.overscaledZ}),zt=ft[ft.length-1].overscaledZ,Qt=ft[0].overscaledZ-zt+1;if(Qt>1){this.currentStencilSource=void 0,this.nextStencilID+Qt>256&&this.clearStencil();for(var ne={},Ft=0;Ft=0;this.currentLayer--){var Dr=this.style._layers[ft[this.currentLayer]],jr=zt[Dr.source],On=Ft[Dr.source];this._renderTileClippingMasks(Dr,On),this.renderLayer(this,jr,Dr,On)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?tt.pop():null},po.prototype.isPatternMissing=function(U){if(!U)return!1;if(!U.from||!U.to)return!0;var tt=this.imageManager.getPattern(U.from.toString()),Y=this.imageManager.getPattern(U.to.toString());return!tt||!Y},po.prototype.useProgram=function(U,tt){this.cache=this.cache||{};var Y=""+U+(tt?tt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[Y]||(this.cache[Y]=new Qu(this.context,U,vc[U],tt,fo[U],this._showOverdrawInspector)),this.cache[Y]},po.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},po.prototype.setBaseState=function(){var U=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(U.FUNC_ADD)},po.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var U=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,U.RGBA)}},po.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Qo=function(U,tt){this.points=U,this.planes=tt};Qo.fromInvProjectionMatrix=function(U,tt,Y){var ft=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],zt=Math.pow(2,Y),Qt=ft.map(function($t){return t.transformMat4([],$t,U)}).map(function($t){return t.scale$1([],$t,1/$t[3]/tt*zt)}),ne=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Ft=ne.map(function($t){var he=t.sub([],Qt[$t[0]],Qt[$t[1]]),Ne=t.sub([],Qt[$t[2]],Qt[$t[1]]),Ie=t.normalize([],t.cross([],he,Ne)),Fe=-t.dot(Ie,Qt[$t[1]]);return Ie.concat(Fe)});return new Qo(Qt,Ft)};var Js=function(U,tt){this.min=U,this.max=tt,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Js.prototype.quadrant=function(U){for(var tt=[U%2===0,U<2],Y=t.clone$2(this.min),ft=t.clone$2(this.max),zt=0;zt=0;if(Qt===0)return 0;Qt!==tt.length&&(Y=!1)}if(Y)return 2;for(var Ft=0;Ft<3;Ft++){for(var $t=Number.MAX_VALUE,he=-Number.MAX_VALUE,Ne=0;Nethis.max[Ft]-this.min[Ft])return 0}return 1};var Us=function(U,tt,Y,ft){if(U===void 0&&(U=0),tt===void 0&&(tt=0),Y===void 0&&(Y=0),ft===void 0&&(ft=0),isNaN(U)||U<0||isNaN(tt)||tt<0||isNaN(Y)||Y<0||isNaN(ft)||ft<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=U,this.bottom=tt,this.left=Y,this.right=ft};Us.prototype.interpolate=function(U,tt,Y){return tt.top!=null&&U.top!=null&&(this.top=t.number(U.top,tt.top,Y)),tt.bottom!=null&&U.bottom!=null&&(this.bottom=t.number(U.bottom,tt.bottom,Y)),tt.left!=null&&U.left!=null&&(this.left=t.number(U.left,tt.left,Y)),tt.right!=null&&U.right!=null&&(this.right=t.number(U.right,tt.right,Y)),this},Us.prototype.getCenter=function(U,tt){var Y=t.clamp((this.left+U-this.right)/2,0,U),ft=t.clamp((this.top+tt-this.bottom)/2,0,tt);return new t.Point(Y,ft)},Us.prototype.equals=function(U){return this.top===U.top&&this.bottom===U.bottom&&this.left===U.left&&this.right===U.right},Us.prototype.clone=function(){return new Us(this.top,this.bottom,this.left,this.right)},Us.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var To=function(U,tt,Y,ft,zt){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=zt===void 0?!0:zt,this._minZoom=U||0,this._maxZoom=tt||22,this._minPitch=Y??0,this._maxPitch=ft??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Us,this._posMatrixCache={},this._alignedPosMatrixCache={}},ko={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};To.prototype.clone=function(){var U=new To(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return U.tileSize=this.tileSize,U.latRange=this.latRange,U.width=this.width,U.height=this.height,U._center=this._center,U.zoom=this.zoom,U.angle=this.angle,U._fov=this._fov,U._pitch=this._pitch,U._unmodified=this._unmodified,U._edgeInsets=this._edgeInsets.clone(),U._calcMatrices(),U},ko.minZoom.get=function(){return this._minZoom},ko.minZoom.set=function(U){this._minZoom!==U&&(this._minZoom=U,this.zoom=Math.max(this.zoom,U))},ko.maxZoom.get=function(){return this._maxZoom},ko.maxZoom.set=function(U){this._maxZoom!==U&&(this._maxZoom=U,this.zoom=Math.min(this.zoom,U))},ko.minPitch.get=function(){return this._minPitch},ko.minPitch.set=function(U){this._minPitch!==U&&(this._minPitch=U,this.pitch=Math.max(this.pitch,U))},ko.maxPitch.get=function(){return this._maxPitch},ko.maxPitch.set=function(U){this._maxPitch!==U&&(this._maxPitch=U,this.pitch=Math.min(this.pitch,U))},ko.renderWorldCopies.get=function(){return this._renderWorldCopies},ko.renderWorldCopies.set=function(U){U===void 0?U=!0:U===null&&(U=!1),this._renderWorldCopies=U},ko.worldSize.get=function(){return this.tileSize*this.scale},ko.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ko.size.get=function(){return new t.Point(this.width,this.height)},ko.bearing.get=function(){return-this.angle/Math.PI*180},ko.bearing.set=function(U){var tt=-t.wrap(U,-180,180)*Math.PI/180;this.angle!==tt&&(this._unmodified=!1,this.angle=tt,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ko.pitch.get=function(){return this._pitch/Math.PI*180},ko.pitch.set=function(U){var tt=t.clamp(U,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==tt&&(this._unmodified=!1,this._pitch=tt,this._calcMatrices())},ko.fov.get=function(){return this._fov/Math.PI*180},ko.fov.set=function(U){U=Math.max(.01,Math.min(60,U)),this._fov!==U&&(this._unmodified=!1,this._fov=U/180*Math.PI,this._calcMatrices())},ko.zoom.get=function(){return this._zoom},ko.zoom.set=function(U){var tt=Math.min(Math.max(U,this.minZoom),this.maxZoom);this._zoom!==tt&&(this._unmodified=!1,this._zoom=tt,this.scale=this.zoomScale(tt),this.tileZoom=Math.floor(tt),this.zoomFraction=tt-this.tileZoom,this._constrain(),this._calcMatrices())},ko.center.get=function(){return this._center},ko.center.set=function(U){U.lat===this._center.lat&&U.lng===this._center.lng||(this._unmodified=!1,this._center=U,this._constrain(),this._calcMatrices())},ko.padding.get=function(){return this._edgeInsets.toJSON()},ko.padding.set=function(U){this._edgeInsets.equals(U)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,U,1),this._calcMatrices())},ko.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},To.prototype.isPaddingEqual=function(U){return this._edgeInsets.equals(U)},To.prototype.interpolatePadding=function(U,tt,Y){this._unmodified=!1,this._edgeInsets.interpolate(U,tt,Y),this._constrain(),this._calcMatrices()},To.prototype.coveringZoomLevel=function(U){var tt=(U.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/U.tileSize));return Math.max(0,tt)},To.prototype.getVisibleUnwrappedCoordinates=function(U){var tt=[new t.UnwrappedTileID(0,U)];if(this._renderWorldCopies)for(var Y=this.pointCoordinate(new t.Point(0,0)),ft=this.pointCoordinate(new t.Point(this.width,0)),zt=this.pointCoordinate(new t.Point(this.width,this.height)),Qt=this.pointCoordinate(new t.Point(0,this.height)),ne=Math.floor(Math.min(Y.x,ft.x,zt.x,Qt.x)),Ft=Math.floor(Math.max(Y.x,ft.x,zt.x,Qt.x)),$t=1,he=ne-$t;he<=Ft+$t;he++)he!==0&&tt.push(new t.UnwrappedTileID(he,U));return tt},To.prototype.coveringTiles=function(U){var tt=this.coveringZoomLevel(U),Y=tt;if(U.minzoom!==void 0&&ttU.maxzoom&&(tt=U.maxzoom);var ft=t.MercatorCoordinate.fromLngLat(this.center),zt=Math.pow(2,tt),Qt=[zt*ft.x,zt*ft.y,0],ne=Qo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,tt),Ft=U.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Ft=tt);var $t=3,he=function(qn){return{aabb:new Js([qn*zt,0,0],[(qn+1)*zt,zt,0]),zoom:0,x:0,y:0,wrap:qn,fullyVisible:!1}},Ne=[],Ie=[],Fe=tt,He=U.reparseOverscaled?Y:tt;if(this._renderWorldCopies)for(var Ge=1;Ge<=3;Ge++)Ne.push(he(-Ge)),Ne.push(he(Ge));for(Ne.push(he(0));Ne.length>0;){var Ae=Ne.pop(),Oe=Ae.x,Le=Ae.y,ur=Ae.fullyVisible;if(!ur){var Dr=Ae.aabb.intersects(ne);if(Dr===0)continue;ur=Dr===2}var jr=Ae.aabb.distanceX(Qt),On=Ae.aabb.distanceY(Qt),Ln=Math.max(Math.abs(jr),Math.abs(On)),xn=$t+(1<xn&&Ae.zoom>=Ft){Ie.push({tileID:new t.OverscaledTileID(Ae.zoom===Fe?He:Ae.zoom,Ae.wrap,Ae.zoom,Oe,Le),distanceSq:t.sqrLen([Qt[0]-.5-Oe,Qt[1]-.5-Le])});continue}for(var Wn=0;Wn<4;Wn++){var Dn=(Oe<<1)+Wn%2,la=(Le<<1)+(Wn>>1);Ne.push({aabb:Ae.aabb.quadrant(Wn),zoom:Ae.zoom+1,x:Dn,y:la,wrap:Ae.wrap,fullyVisible:ur})}}return Ie.sort(function(qn,Gn){return qn.distanceSq-Gn.distanceSq}).map(function(qn){return qn.tileID})},To.prototype.resize=function(U,tt){this.width=U,this.height=tt,this.pixelsToGLUnits=[2/U,-2/tt],this._constrain(),this._calcMatrices()},ko.unmodified.get=function(){return this._unmodified},To.prototype.zoomScale=function(U){return Math.pow(2,U)},To.prototype.scaleZoom=function(U){return Math.log(U)/Math.LN2},To.prototype.project=function(U){var tt=t.clamp(U.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(U.lng)*this.worldSize,t.mercatorYfromLat(tt)*this.worldSize)},To.prototype.unproject=function(U){return new t.MercatorCoordinate(U.x/this.worldSize,U.y/this.worldSize).toLngLat()},ko.point.get=function(){return this.project(this.center)},To.prototype.setLocationAtPoint=function(U,tt){var Y=this.pointCoordinate(tt),ft=this.pointCoordinate(this.centerPoint),zt=this.locationCoordinate(U),Qt=new t.MercatorCoordinate(zt.x-(Y.x-ft.x),zt.y-(Y.y-ft.y));this.center=this.coordinateLocation(Qt),this._renderWorldCopies&&(this.center=this.center.wrap())},To.prototype.locationPoint=function(U){return this.coordinatePoint(this.locationCoordinate(U))},To.prototype.pointLocation=function(U){return this.coordinateLocation(this.pointCoordinate(U))},To.prototype.locationCoordinate=function(U){return t.MercatorCoordinate.fromLngLat(U)},To.prototype.coordinateLocation=function(U){return U.toLngLat()},To.prototype.pointCoordinate=function(U){var tt=0,Y=[U.x,U.y,0,1],ft=[U.x,U.y,1,1];t.transformMat4(Y,Y,this.pixelMatrixInverse),t.transformMat4(ft,ft,this.pixelMatrixInverse);var zt=Y[3],Qt=ft[3],ne=Y[0]/zt,Ft=ft[0]/Qt,$t=Y[1]/zt,he=ft[1]/Qt,Ne=Y[2]/zt,Ie=ft[2]/Qt,Fe=Ne===Ie?0:(tt-Ne)/(Ie-Ne);return new t.MercatorCoordinate(t.number(ne,Ft,Fe)/this.worldSize,t.number($t,he,Fe)/this.worldSize)},To.prototype.coordinatePoint=function(U){var tt=[U.x*this.worldSize,U.y*this.worldSize,0,1];return t.transformMat4(tt,tt,this.pixelMatrix),new t.Point(tt[0]/tt[3],tt[1]/tt[3])},To.prototype.getBounds=function(){return new t.LngLatBounds().extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},To.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},To.prototype.setMaxBounds=function(U){U?(this.lngRange=[U.getWest(),U.getEast()],this.latRange=[U.getSouth(),U.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},To.prototype.calculatePosMatrix=function(U,tt){tt===void 0&&(tt=!1);var Y=U.key,ft=tt?this._alignedPosMatrixCache:this._posMatrixCache;if(ft[Y])return ft[Y];var zt=U.canonical,Qt=this.worldSize/this.zoomScale(zt.z),ne=zt.x+Math.pow(2,zt.z)*U.wrap,Ft=t.identity(new Float64Array(16));return t.translate(Ft,Ft,[ne*Qt,zt.y*Qt,0]),t.scale(Ft,Ft,[Qt/t.EXTENT,Qt/t.EXTENT,1]),t.multiply(Ft,tt?this.alignedProjMatrix:this.projMatrix,Ft),ft[Y]=new Float32Array(Ft),ft[Y]},To.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},To.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var U=-90,tt=90,Y=-180,ft=180,zt,Qt,ne,Ft,$t=this.size,he=this._unmodified;if(this.latRange){var Ne=this.latRange;U=t.mercatorYfromLat(Ne[1])*this.worldSize,tt=t.mercatorYfromLat(Ne[0])*this.worldSize,zt=tt-U<$t.y?$t.y/(tt-U):0}if(this.lngRange){var Ie=this.lngRange;Y=t.mercatorXfromLng(Ie[0])*this.worldSize,ft=t.mercatorXfromLng(Ie[1])*this.worldSize,Qt=ft-Y<$t.x?$t.x/(ft-Y):0}var Fe=this.point,He=Math.max(Qt||0,zt||0);if(He){this.center=this.unproject(new t.Point(Qt?(ft+Y)/2:Fe.x,zt?(tt+U)/2:Fe.y)),this.zoom+=this.scaleZoom(He),this._unmodified=he,this._constraining=!1;return}if(this.latRange){var Ge=Fe.y,Ae=$t.y/2;Ge-Aett&&(Ft=tt-Ae)}if(this.lngRange){var Oe=Fe.x,Le=$t.x/2;Oe-Left&&(ne=ft-Le)}(ne!==void 0||Ft!==void 0)&&(this.center=this.unproject(new t.Point(ne!==void 0?ne:Fe.x,Ft!==void 0?Ft:Fe.y))),this._unmodified=he,this._constraining=!1}},To.prototype._calcMatrices=function(){if(this.height){var U=this._fov/2,tt=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(U)*this.height;var Y=Math.PI/2+this._pitch,ft=this._fov*(.5+tt.y/this.height),zt=Math.sin(ft)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-Y-ft,.01,Math.PI-.01)),Qt=this.point,ne=Qt.x,Ft=Qt.y,$t=Math.cos(Math.PI/2-this._pitch)*zt+this.cameraToCenterDistance,he=$t*1.01,Ne=this.height/50,Ie=new Float64Array(16);t.perspective(Ie,this._fov,this.width/this.height,Ne,he),Ie[8]=-tt.x*2/this.width,Ie[9]=tt.y*2/this.height,t.scale(Ie,Ie,[1,-1,1]),t.translate(Ie,Ie,[0,0,-this.cameraToCenterDistance]),t.rotateX(Ie,Ie,this._pitch),t.rotateZ(Ie,Ie,this.angle),t.translate(Ie,Ie,[-ne,-Ft,0]),this.mercatorMatrix=t.scale([],Ie,[this.worldSize,this.worldSize,this.worldSize]),t.scale(Ie,Ie,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ie,this.invProjMatrix=t.invert([],this.projMatrix);var Fe=this.width%2/2,He=this.height%2/2,Ge=Math.cos(this.angle),Ae=Math.sin(this.angle),Oe=ne-Math.round(ne)+Ge*Fe+Ae*He,Le=Ft-Math.round(Ft)+Ge*He+Ae*Fe,ur=new Float64Array(Ie);if(t.translate(ur,ur,[Oe>.5?Oe-1:Oe,Le>.5?Le-1:Le,0]),this.alignedProjMatrix=ur,Ie=t.create(),t.scale(Ie,Ie,[this.width/2,-this.height/2,1]),t.translate(Ie,Ie,[1,-1,0]),this.labelPlaneMatrix=Ie,Ie=t.create(),t.scale(Ie,Ie,[1,-1,1]),t.translate(Ie,Ie,[-1,-1,0]),t.scale(Ie,Ie,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ie,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Ie=t.invert(new Float64Array(16),this.pixelMatrix),!Ie)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ie,this._posMatrixCache={},this._alignedPosMatrixCache={}}},To.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var U=this.pointCoordinate(new t.Point(0,0)),tt=[U.x*this.worldSize,U.y*this.worldSize,0,1],Y=t.transformMat4(tt,tt,this.pixelMatrix);return Y[3]/this.cameraToCenterDistance},To.prototype.getCameraPoint=function(){var U=this._pitch,tt=Math.tan(U)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,tt))},To.prototype.getCameraQueryGeometry=function(U){var tt=this.getCameraPoint();if(U.length===1)return[U[0],tt];for(var Y=tt.x,ft=tt.y,zt=tt.x,Qt=tt.y,ne=0,Ft=U;ne=3&&!U.some(function(Y){return isNaN(Y)})){var tt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(U[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+U[2],+U[1]],zoom:+U[0],bearing:tt,pitch:+(U[4]||0)}),!0}return!1},Sl.prototype._updateHashUnthrottled=function(){var U=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,U)}catch{}};var tu={linearity:.3,easing:t.bezier(0,0,.3,1)},gt=t.extend({deceleration:2500,maxSpeed:1400},tu),Et=t.extend({deceleration:20,maxSpeed:1400},tu),Xt=t.extend({deceleration:1e3,maxSpeed:360},tu),fe=t.extend({deceleration:1e3,maxSpeed:90},tu),me=function(U){this._map=U,this.clear()};me.prototype.clear=function(){this._inertiaBuffer=[]},me.prototype.record=function(U){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:U})},me.prototype._drainInertiaBuffer=function(){for(var U=this._inertiaBuffer,tt=t.browser.now(),Y=160;U.length>0&&tt-U[0].time>Y;)U.shift()},me.prototype._onMoveEnd=function(U){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var tt={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},Y=0,ft=this._inertiaBuffer;Y=this._clickTolerance||this._map.fire(new je(U.type,this._map,U))},Sr.prototype.dblclick=function(U){return this._firePreventable(new je(U.type,this._map,U))},Sr.prototype.mouseover=function(U){this._map.fire(new je(U.type,this._map,U))},Sr.prototype.mouseout=function(U){this._map.fire(new je(U.type,this._map,U))},Sr.prototype.touchstart=function(U){return this._firePreventable(new or(U.type,this._map,U))},Sr.prototype.touchmove=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype.touchend=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype.touchcancel=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype._firePreventable=function(U){if(this._map.fire(U),U.defaultPrevented)return{}},Sr.prototype.isEnabled=function(){return!0},Sr.prototype.isActive=function(){return!1},Sr.prototype.enable=function(){},Sr.prototype.disable=function(){};var Wr=function(U){this._map=U};Wr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Wr.prototype.mousemove=function(U){this._map.fire(new je(U.type,this._map,U))},Wr.prototype.mousedown=function(){this._delayContextMenu=!0},Wr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new je("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Wr.prototype.contextmenu=function(U){this._delayContextMenu?this._contextMenuEvent=U:this._map.fire(new je(U.type,this._map,U)),this._map.listens("contextmenu")&&U.preventDefault()},Wr.prototype.isEnabled=function(){return!0},Wr.prototype.isActive=function(){return!1},Wr.prototype.enable=function(){},Wr.prototype.disable=function(){};var an=function(U,tt){this._map=U,this._el=U.getCanvasContainer(),this._container=U.getContainer(),this._clickTolerance=tt.clickTolerance||1};an.prototype.isEnabled=function(){return!!this._enabled},an.prototype.isActive=function(){return!!this._active},an.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},an.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},an.prototype.mousedown=function(U,tt){this.isEnabled()&&U.shiftKey&&U.button===0&&(r.disableDrag(),this._startPos=this._lastPos=tt,this._active=!0)},an.prototype.mousemoveWindow=function(U,tt){if(this._active){var Y=tt;if(!(this._lastPos.equals(Y)||!this._box&&Y.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=U.timeStamp),Y.length===this.numTouches&&(this.centroid=ta(tt),this.touches=on(Y,tt)))},Yn.prototype.touchmove=function(U,tt,Y){if(!(this.aborted||!this.centroid)){var ft=on(Y,tt);for(var zt in this.touches){var Qt=this.touches[zt],ne=ft[zt];(!ne||ne.dist(Qt)>Hn)&&(this.aborted=!0)}}},Yn.prototype.touchend=function(U,tt,Y){if((!this.centroid||U.timeStamp-this.startTime>Bn)&&(this.aborted=!0),Y.length===0){var ft=!this.aborted&&this.centroid;if(this.reset(),ft)return ft}};var na=function(U){this.singleTap=new Yn(U),this.numTaps=U.numTaps,this.reset()};na.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},na.prototype.touchstart=function(U,tt,Y){this.singleTap.touchstart(U,tt,Y)},na.prototype.touchmove=function(U,tt,Y){this.singleTap.touchmove(U,tt,Y)},na.prototype.touchend=function(U,tt,Y){var ft=this.singleTap.touchend(U,tt,Y);if(ft){var zt=U.timeStamp-this.lastTime0&&(this._active=!0);var ft=on(Y,tt),zt=new t.Point(0,0),Qt=new t.Point(0,0),ne=0;for(var Ft in ft){var $t=ft[Ft],he=this._touches[Ft];he&&(zt._add($t),Qt._add($t.sub(he)),ne++,ft[Ft]=$t)}if(this._touches=ft,!(neMath.abs(U.x)}var ps=100,zs=(function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.reset=function(){U.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},tt.prototype._start=function(Y){this._lastPoints=Y,lu(Y[0].sub(Y[1]))&&(this._valid=!1)},tt.prototype._move=function(Y,ft,zt){var Qt=Y[0].sub(this._lastPoints[0]),ne=Y[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Qt,ne,zt.timeStamp),!!this._valid){this._lastPoints=Y,this._active=!0;var Ft=(Qt.y+ne.y)/2,$t=-.5;return{pitchDelta:Ft*$t}}},tt.prototype.gestureBeginsVertically=function(Y,ft,zt){if(this._valid!==void 0)return this._valid;var Qt=2,ne=Y.mag()>=Qt,Ft=ft.mag()>=Qt;if(!(!ne&&!Ft)){if(!ne||!Ft)return this._firstMove===void 0&&(this._firstMove=zt),zt-this._firstMove0==ft.y>0;return lu(Y)&&lu(ft)&&$t}},tt})(es),Eu={panStep:100,bearingStep:15,pitchStep:10},ie=function(){var U=Eu;this._panStep=U.panStep,this._bearingStep=U.bearingStep,this._pitchStep=U.pitchStep,this._rotationDisabled=!1};ie.prototype.reset=function(){this._active=!1},ie.prototype.keydown=function(U){var tt=this;if(!(U.altKey||U.ctrlKey||U.metaKey)){var Y=0,ft=0,zt=0,Qt=0,ne=0;switch(U.keyCode){case 61:case 107:case 171:case 187:Y=1;break;case 189:case 109:case 173:Y=-1;break;case 37:U.shiftKey?ft=-1:(U.preventDefault(),Qt=-1);break;case 39:U.shiftKey?ft=1:(U.preventDefault(),Qt=1);break;case 38:U.shiftKey?zt=1:(U.preventDefault(),ne=-1);break;case 40:U.shiftKey?zt=-1:(U.preventDefault(),ne=1);break;default:return}return this._rotationDisabled&&(ft=0,zt=0),{cameraAnimation:function(Ft){var $t=Ft.getZoom();Ft.easeTo({duration:300,easeId:"keyboardHandler",easing:nr,zoom:Y?Math.round($t)+Y*(U.shiftKey?2:1):$t,bearing:Ft.getBearing()+ft*tt._bearingStep,pitch:Ft.getPitch()+zt*tt._pitchStep,offset:[-Qt*tt._panStep,-ne*tt._panStep],center:Ft.getCenter()},{originalEvent:U})}}}},ie.prototype.enable=function(){this._enabled=!0},ie.prototype.disable=function(){this._enabled=!1,this.reset()},ie.prototype.isEnabled=function(){return this._enabled},ie.prototype.isActive=function(){return this._active},ie.prototype.disableRotation=function(){this._rotationDisabled=!0},ie.prototype.enableRotation=function(){this._rotationDisabled=!1};function nr(U){return U*(2-U)}var cr=4.000244140625,sn=1/100,zn=1/450,Tn=2,qr=function(U,tt){this._map=U,this._el=U.getCanvasContainer(),this._handler=tt,this._delta=0,this._defaultZoomRate=sn,this._wheelZoomRate=zn,t.bindAll(["_onTimeout"],this)};qr.prototype.setZoomRate=function(U){this._defaultZoomRate=U},qr.prototype.setWheelZoomRate=function(U){this._wheelZoomRate=U},qr.prototype.isEnabled=function(){return!!this._enabled},qr.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},qr.prototype.isZooming=function(){return!!this._zooming},qr.prototype.enable=function(U){this.isEnabled()||(this._enabled=!0,this._aroundCenter=U&&U.around==="center")},qr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},qr.prototype.wheel=function(U){if(this.isEnabled()){var tt=U.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?U.deltaY*40:U.deltaY,Y=t.browser.now(),ft=Y-(this._lastWheelEventTime||0);this._lastWheelEventTime=Y,tt!==0&&tt%cr===0?this._type="wheel":tt!==0&&Math.abs(tt)<4?this._type="trackpad":ft>400?(this._type=null,this._lastValue=tt,this._timeout=setTimeout(this._onTimeout,40,U)):this._type||(this._type=Math.abs(ft*tt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,tt+=this._lastValue)),U.shiftKey&&tt&&(tt=tt/4),this._type&&(this._lastWheelEvent=U,this._delta-=tt,this._active||this._start(U)),U.preventDefault()}},qr.prototype._onTimeout=function(U){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(U)},qr.prototype._start=function(U){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var tt=r.mousePos(this._el,U);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(tt)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},qr.prototype.renderFrame=function(){var U=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var tt=this._map.transform;if(this._delta!==0){var Y=this._type==="wheel"&&Math.abs(this._delta)>cr?this._wheelZoomRate:this._defaultZoomRate,ft=Tn/(1+Math.exp(-Math.abs(this._delta*Y)));this._delta<0&&ft!==0&&(ft=1/ft);var zt=typeof this._targetZoom=="number"?tt.zoomScale(this._targetZoom):tt.scale;this._targetZoom=Math.min(tt.maxZoom,Math.max(tt.minZoom,tt.scaleZoom(zt*ft))),this._type==="wheel"&&(this._startZoom=tt.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Qt=typeof this._targetZoom=="number"?this._targetZoom:tt.zoom,ne=this._startZoom,Ft=this._easing,$t=!1,he;if(this._type==="wheel"&&ne&&Ft){var Ne=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),Ie=Ft(Ne);he=t.number(ne,Qt,Ie),Ne<1?this._frameId||(this._frameId=!0):$t=!0}else he=Qt,$t=!0;return this._active=!0,$t&&(this._active=!1,this._finishTimeout=setTimeout(function(){U._zooming=!1,U._handler._triggerRenderFrame(),delete U._targetZoom,delete U._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!$t,zoomDelta:he-tt.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},qr.prototype._smoothOutEasing=function(U){var tt=t.ease;if(this._prevEase){var Y=this._prevEase,ft=(t.browser.now()-Y.start)/Y.duration,zt=Y.easing(ft+.01)-Y.easing(ft),Qt=.27/Math.sqrt(zt*zt+1e-4)*.01,ne=Math.sqrt(.27*.27-Qt*Qt);tt=t.bezier(Qt,ne,.25,1)}return this._prevEase={start:t.browser.now(),duration:U,easing:tt},tt},qr.prototype.reset=function(){this._active=!1};var Sn=function(U,tt){this._clickZoom=U,this._tapZoom=tt};Sn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Sn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Sn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Sn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var sa=function(){this.reset()};sa.prototype.reset=function(){this._active=!1},sa.prototype.dblclick=function(U,tt){return U.preventDefault(),{cameraAnimation:function(Y){Y.easeTo({duration:300,zoom:Y.getZoom()+(U.shiftKey?-1:1),around:Y.unproject(tt)},{originalEvent:U})}}},sa.prototype.enable=function(){this._enabled=!0},sa.prototype.disable=function(){this._enabled=!1,this.reset()},sa.prototype.isEnabled=function(){return this._enabled},sa.prototype.isActive=function(){return this._active};var ea=function(){this._tap=new na({numTouches:1,numTaps:1}),this.reset()};ea.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ea.prototype.touchstart=function(U,tt,Y){this._swipePoint||(this._tapTime&&U.timeStamp-this._tapTime>hn&&this.reset(),this._tapTime?Y.length>0&&(this._swipePoint=tt[0],this._swipeTouch=Y[0].identifier):this._tap.touchstart(U,tt,Y))},ea.prototype.touchmove=function(U,tt,Y){if(!this._tapTime)this._tap.touchmove(U,tt,Y);else if(this._swipePoint){if(Y[0].identifier!==this._swipeTouch)return;var ft=tt[0],zt=ft.y-this._swipePoint.y;return this._swipePoint=ft,U.preventDefault(),this._active=!0,{zoomDelta:zt/128}}},ea.prototype.touchend=function(U,tt,Y){if(this._tapTime)this._swipePoint&&Y.length===0&&this.reset();else{var ft=this._tap.touchend(U,tt,Y);ft&&(this._tapTime=U.timeStamp)}},ea.prototype.touchcancel=function(){this.reset()},ea.prototype.enable=function(){this._enabled=!0},ea.prototype.disable=function(){this._enabled=!1,this.reset()},ea.prototype.isEnabled=function(){return this._enabled},ea.prototype.isActive=function(){return this._active};var ka=function(U,tt,Y){this._el=U,this._mousePan=tt,this._touchPan=Y};ka.prototype.enable=function(U){this._inertiaOptions=U||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ka.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ka.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ka.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ka=function(U,tt,Y){this._pitchWithRotate=U.pitchWithRotate,this._mouseRotate=tt,this._mousePitch=Y};Ka.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ka.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ka.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ka.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Va=function(U,tt,Y,ft){this._el=U,this._touchZoom=tt,this._touchRotate=Y,this._tapDragZoom=ft,this._rotationDisabled=!1,this._enabled=!0};Va.prototype.enable=function(U){this._touchZoom.enable(U),this._rotationDisabled||this._touchRotate.enable(U),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Va.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Va.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Va.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Va.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Va.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fa=function(U){return U.zoom||U.drag||U.pitch||U.rotate},Un=(function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt})(t.Event);function Nr(U){return U.panDelta&&U.panDelta.mag()||U.zoomDelta||U.bearingDelta||U.pitchDelta}var fn=function(U,tt){this._map=U,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new me(U),this._bearingSnap=tt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(tt),t.bindAll(["handleEvent","handleWindowEvent"],this);var Y=this._el;this._listeners=[[Y,"touchstart",{passive:!0}],[Y,"touchmove",{passive:!1}],[Y,"touchend",void 0],[Y,"touchcancel",void 0],[Y,"mousedown",void 0],[Y,"mousemove",void 0],[Y,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[Y,"mouseover",void 0],[Y,"mouseout",void 0],[Y,"dblclick",void 0],[Y,"click",void 0],[Y,"keydown",{capture:!1}],[Y,"keyup",void 0],[Y,"wheel",{passive:!1}],[Y,"contextmenu",void 0],[t.window,"blur",void 0]];for(var ft=0,zt=this._listeners;ftne?Math.min(2,jr):Math.max(.5,jr),qn=Math.pow(la,1-Wn),Gn=Qt.unproject(ur.add(Dr.mult(Wn*qn)).mult(Dn));Qt.setLocationAtPoint(Qt.renderWorldCopies?Gn.wrap():Gn,Ae)}zt._fireMoveEvents(ft)},function(Wn){zt._afterEase(ft,Wn)},Y),this},tt.prototype._prepareEase=function(Y,ft,zt){zt===void 0&&(zt={}),this._moving=!0,!ft&&!zt.moving&&this.fire(new t.Event("movestart",Y)),this._zooming&&!zt.zooming&&this.fire(new t.Event("zoomstart",Y)),this._rotating&&!zt.rotating&&this.fire(new t.Event("rotatestart",Y)),this._pitching&&!zt.pitching&&this.fire(new t.Event("pitchstart",Y))},tt.prototype._fireMoveEvents=function(Y){this.fire(new t.Event("move",Y)),this._zooming&&this.fire(new t.Event("zoom",Y)),this._rotating&&this.fire(new t.Event("rotate",Y)),this._pitching&&this.fire(new t.Event("pitch",Y))},tt.prototype._afterEase=function(Y,ft){if(!(this._easeId&&ft&&this._easeId===ft)){delete this._easeId;var zt=this._zooming,Qt=this._rotating,ne=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,zt&&this.fire(new t.Event("zoomend",Y)),Qt&&this.fire(new t.Event("rotateend",Y)),ne&&this.fire(new t.Event("pitchend",Y)),this.fire(new t.Event("moveend",Y))}},tt.prototype.flyTo=function(Y,ft){var zt=this;if(!Y.essential&&t.browser.prefersReducedMotion){var Qt=t.pick(Y,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Qt,ft)}this.stop(),Y=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},Y);var ne=this.transform,Ft=this.getZoom(),$t=this.getBearing(),he=this.getPitch(),Ne=this.getPadding(),Ie="zoom"in Y?t.clamp(+Y.zoom,ne.minZoom,ne.maxZoom):Ft,Fe="bearing"in Y?this._normalizeBearing(Y.bearing,$t):$t,He="pitch"in Y?+Y.pitch:he,Ge="padding"in Y?Y.padding:ne.padding,Ae=ne.zoomScale(Ie-Ft),Oe=t.Point.convert(Y.offset),Le=ne.centerPoint.add(Oe),ur=ne.pointLocation(Le),Dr=t.LngLat.convert(Y.center||ur);this._normalizeCenter(Dr);var jr=ne.project(ur),On=ne.project(Dr).sub(jr),Ln=Y.curve,xn=Math.max(ne.width,ne.height),Wn=xn/Ae,Dn=On.mag();if("minZoom"in Y){var la=t.clamp(Math.min(Y.minZoom,Ft,Ie),ne.minZoom,ne.maxZoom),qn=xn/ne.zoomScale(la-Ft);Ln=Math.sqrt(qn/Dn*2)}var Gn=Ln*Ln;function ma(mo){var Xs=(Wn*Wn-xn*xn+(mo?-1:1)*Gn*Gn*Dn*Dn)/(2*(mo?Wn:xn)*Gn*Dn);return Math.log(Math.sqrt(Xs*Xs+1)-Xs)}function ti(mo){return(Math.exp(mo)-Math.exp(-mo))/2}function si(mo){return(Math.exp(mo)+Math.exp(-mo))/2}function Li(mo){return ti(mo)/si(mo)}var to=ma(0),ls=function(mo){return si(to)/si(to+Ln*mo)},ms=function(mo){return xn*((si(to)*Li(to+Ln*mo)-ti(to))/Gn)/Dn},Ko=(ma(1)-to)/Ln;if(Math.abs(Dn)<1e-6||!isFinite(Ko)){if(Math.abs(xn-Wn)<1e-6)return this.easeTo(Y,ft);var gs=WnY.maxDuration&&(Y.duration=0),this._zooming=!0,this._rotating=$t!==Fe,this._pitching=He!==he,this._padding=!ne.isPaddingEqual(Ge),this._prepareEase(ft,!1),this._ease(function(mo){var Xs=mo*Ko,tc=1/ls(Xs);ne.zoom=mo===1?Ie:Ft+ne.scaleZoom(tc),zt._rotating&&(ne.bearing=t.number($t,Fe,mo)),zt._pitching&&(ne.pitch=t.number(he,He,mo)),zt._padding&&(ne.interpolatePadding(Ne,Ge,mo),Le=ne.centerPoint.add(Oe));var kc=mo===1?Dr:ne.unproject(jr.add(On.mult(ms(Xs))).mult(tc));ne.setLocationAtPoint(ne.renderWorldCopies?kc.wrap():kc,Le),zt._fireMoveEvents(ft)},function(){return zt._afterEase(ft)},Y),this},tt.prototype.isEasing=function(){return!!this._easeFrameId},tt.prototype.stop=function(){return this._stop()},tt.prototype._stop=function(Y,ft){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var zt=this._onEaseEnd;delete this._onEaseEnd,zt.call(this,ft)}if(!Y){var Qt=this.handlers;Qt&&Qt.stop(!1)}return this},tt.prototype._ease=function(Y,ft,zt){zt.animate===!1||zt.duration===0?(Y(1),ft()):(this._easeStart=t.browser.now(),this._easeOptions=zt,this._onEaseFrame=Y,this._onEaseEnd=ft,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},tt.prototype._renderFrameCallback=function(){var Y=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Y)),Y<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},tt.prototype._normalizeBearing=function(Y,ft){Y=t.wrap(Y,-180,180);var zt=Math.abs(Y-ft);return Math.abs(Y-360-ft)180?-360:zt<-180?360:0}},tt})(t.Evented),jn=function(U){U===void 0&&(U={}),this.options=U,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};jn.prototype.getDefaultPosition=function(){return"bottom-right"},jn.prototype.onAdd=function(U){var tt=this.options&&this.options.compact;return this._map=U,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),tt&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),tt===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},jn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},jn.prototype._setElementTitle=function(U,tt){var Y=this._map._getUIString("AttributionControl."+tt);U.title=Y,U.setAttribute("aria-label",Y)},jn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},jn.prototype._updateEditLink=function(){var U=this._editLink;U||(U=this._editLink=this._container.querySelector(".mapbox-improve-map"));var tt=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(U){var Y=tt.reduce(function(ft,zt,Qt){return zt.value&&(ft+=zt.key+"="+zt.value+(Qt=0)return!1;return!0});var ne=U.join(" | ");ne!==this._attribHTML&&(this._attribHTML=ne,U.length?(this._innerContainer.innerHTML=ne,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},jn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var kn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};kn.prototype.onAdd=function(U){this._map=U,this._container=r.create("div","mapboxgl-ctrl");var tt=r.create("a","mapboxgl-ctrl-logo");return tt.target="_blank",tt.rel="noopener nofollow",tt.href="https://www.mapbox.com/",tt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),tt.setAttribute("rel","noopener nofollow"),this._container.appendChild(tt),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},kn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},kn.prototype.getDefaultPosition=function(){return"bottom-left"},kn.prototype._updateLogo=function(U){(!U||U.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},kn.prototype._logoRequired=function(){if(this._map.style){var U=this._map.style.sourceCaches;for(var tt in U){var Y=U[tt].getSource();if(Y.mapbox_logo)return!0}return!1}},kn.prototype._updateCompact=function(){var U=this._container.children;if(U.length){var tt=U[0];this._map.getCanvasContainer().offsetWidth<250?tt.classList.add("mapboxgl-compact"):tt.classList.remove("mapboxgl-compact")}};var Ia=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ia.prototype.add=function(U){var tt=++this._id,Y=this._queue;return Y.push({callback:U,id:tt,cancelled:!1}),tt},Ia.prototype.remove=function(U){for(var tt=this._currentlyRunning,Y=tt?this._queue.concat(tt):this._queue,ft=0,zt=Y;ftft.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(ft.minPitch!=null&&ft.maxPitch!=null&&ft.minPitch>ft.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(ft.minPitch!=null&&ft.minPitchoa)throw new Error("maxPitch must be less than or equal to "+oa);var Qt=new To(ft.minZoom,ft.maxZoom,ft.minPitch,ft.maxPitch,ft.renderWorldCopies);if(U.call(this,Qt,ft),this._interactive=ft.interactive,this._maxTileCacheSize=ft.maxTileCacheSize,this._failIfMajorPerformanceCaveat=ft.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=ft.preserveDrawingBuffer,this._antialias=ft.antialias,this._trackResize=ft.trackResize,this._bearingSnap=ft.bearingSnap,this._refreshExpiredTiles=ft.refreshExpiredTiles,this._fadeDuration=ft.fadeDuration,this._crossSourceCollisions=ft.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=ft.collectResourceTiming,this._renderTaskQueue=new Ia,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},ya,ft.locale),this._clickTolerance=ft.clickTolerance,this._requestManager=new t.RequestManager(ft.transformRequest,ft.accessToken),typeof ft.container=="string"){if(this._container=t.window.document.getElementById(ft.container),!this._container)throw new Error("Container '"+ft.container+"' not found.")}else if(ft.container instanceof Rn)this._container=ft.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(ft.maxBounds&&this.setMaxBounds(ft.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return zt._update(!1)}),this.on("moveend",function(){return zt._update(!1)}),this.on("zoom",function(){return zt._update(!0)}),typeof t.window<"u"&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new fn(this,ft);var ne=typeof ft.hash=="string"&&ft.hash||void 0;this._hash=ft.hash&&new Sl(ne).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:ft.center,zoom:ft.zoom,bearing:ft.bearing,pitch:ft.pitch}),ft.bounds&&(this.resize(),this.fitBounds(ft.bounds,t.extend({},ft.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=ft.localIdeographFontFamily,ft.style&&this.setStyle(ft.style,{localIdeographFontFamily:ft.localIdeographFontFamily}),ft.attributionControl&&this.addControl(new jn({customAttribution:ft.customAttribution})),this.addControl(new kn,ft.logoPosition),this.on("style.load",function(){zt.transform.unmodified&&zt.jumpTo(zt.style.stylesheet)}),this.on("data",function(Ft){zt._update(Ft.dataType==="style"),zt.fire(new t.Event(Ft.dataType+"data",Ft))}),this.on("dataloading",function(Ft){zt.fire(new t.Event(Ft.dataType+"dataloading",Ft))})}U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt;var Y={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return tt.prototype._getMapId=function(){return this._mapId},tt.prototype.addControl=function(ft,zt){if(zt===void 0&&(ft.getDefaultPosition?zt=ft.getDefaultPosition():zt="top-right"),!ft||!ft.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var Qt=ft.onAdd(this);this._controls.push(ft);var ne=this._controlPositions[zt];return zt.indexOf("bottom")!==-1?ne.insertBefore(Qt,ne.firstChild):ne.appendChild(Qt),this},tt.prototype.removeControl=function(ft){if(!ft||!ft.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var zt=this._controls.indexOf(ft);return zt>-1&&this._controls.splice(zt,1),ft.onRemove(this),this},tt.prototype.hasControl=function(ft){return this._controls.indexOf(ft)>-1},tt.prototype.resize=function(ft){var zt=this._containerDimensions(),Qt=zt[0],ne=zt[1];this._resizeCanvas(Qt,ne),this.transform.resize(Qt,ne),this.painter.resize(Qt,ne);var Ft=!this._moving;return Ft&&(this.stop(),this.fire(new t.Event("movestart",ft)).fire(new t.Event("move",ft))),this.fire(new t.Event("resize",ft)),Ft&&this.fire(new t.Event("moveend",ft)),this},tt.prototype.getBounds=function(){return this.transform.getBounds()},tt.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},tt.prototype.setMaxBounds=function(ft){return this.transform.setMaxBounds(t.LngLatBounds.convert(ft)),this._update()},tt.prototype.setMinZoom=function(ft){if(ft=ft??Pa,ft>=Pa&&ft<=this.transform.maxZoom)return this.transform.minZoom=ft,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=ft,this._update(),this.getZoom()>ft&&this.setZoom(ft),this;throw new Error("maxZoom must be greater than the current minZoom")},tt.prototype.getMaxZoom=function(){return this.transform.maxZoom},tt.prototype.setMinPitch=function(ft){if(ft=ft??aa,ft=aa&&ft<=this.transform.maxPitch)return this.transform.minPitch=ft,this._update(),this.getPitch()oa)throw new Error("maxPitch must be less than or equal to "+oa);if(ft>=this.transform.minPitch)return this.transform.maxPitch=ft,this._update(),this.getPitch()>ft&&this.setPitch(ft),this;throw new Error("maxPitch must be greater than the current minPitch")},tt.prototype.getMaxPitch=function(){return this.transform.maxPitch},tt.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},tt.prototype.setRenderWorldCopies=function(ft){return this.transform.renderWorldCopies=ft,this._update()},tt.prototype.project=function(ft){return this.transform.locationPoint(t.LngLat.convert(ft))},tt.prototype.unproject=function(ft){return this.transform.pointLocation(t.Point.convert(ft))},tt.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},tt.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},tt.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},tt.prototype._createDelegatedListener=function(ft,zt,Qt){var ne=this,Ft;if(ft==="mouseenter"||ft==="mouseover"){var $t=!1,he=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length?$t||($t=!0,Qt.call(ne,new je(ft,ne,Ae.originalEvent,{features:Oe}))):$t=!1},Ne=function(){$t=!1};return{layer:zt,listener:Qt,delegates:{mousemove:he,mouseout:Ne}}}else if(ft==="mouseleave"||ft==="mouseout"){var Ie=!1,Fe=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length?Ie=!0:Ie&&(Ie=!1,Qt.call(ne,new je(ft,ne,Ae.originalEvent)))},He=function(Ae){Ie&&(Ie=!1,Qt.call(ne,new je(ft,ne,Ae.originalEvent)))};return{layer:zt,listener:Qt,delegates:{mousemove:Fe,mouseout:He}}}else{var Ge=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length&&(Ae.features=Oe,Qt.call(ne,Ae),delete Ae.features)};return{layer:zt,listener:Qt,delegates:(Ft={},Ft[ft]=Ge,Ft)}}},tt.prototype.on=function(ft,zt,Qt){if(Qt===void 0)return U.prototype.on.call(this,ft,zt);var ne=this._createDelegatedListener(ft,zt,Qt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[ft]=this._delegatedListeners[ft]||[],this._delegatedListeners[ft].push(ne);for(var Ft in ne.delegates)this.on(Ft,ne.delegates[Ft]);return this},tt.prototype.once=function(ft,zt,Qt){if(Qt===void 0)return U.prototype.once.call(this,ft,zt);var ne=this._createDelegatedListener(ft,zt,Qt);for(var Ft in ne.delegates)this.once(Ft,ne.delegates[Ft]);return this},tt.prototype.off=function(ft,zt,Qt){var ne=this;if(Qt===void 0)return U.prototype.off.call(this,ft,zt);var Ft=function($t){for(var he=$t[ft],Ne=0;Ne180;){var ne=Y.locationPoint(U);if(ne.x>=0&&ne.y>=0&&ne.x<=Y.width&&ne.y<=Y.height)break;U.lng>Y.center.lng?U.lng-=360:U.lng+=360}return U}var Ri={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function ds(U,tt,Y){var ft=U.classList;for(var zt in Ri)ft.remove("mapboxgl-"+Y+"-anchor-"+zt);ft.add("mapboxgl-"+Y+"-anchor-"+tt)}var rs=(function(U){function tt(Y,ft){if(U.call(this),(Y instanceof t.window.HTMLElement||ft)&&(Y=t.extend({element:Y},ft)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=Y&&Y.anchor||"center",this._color=Y&&Y.color||"#3FB1CE",this._scale=Y&&Y.scale||1,this._draggable=Y&&Y.draggable||!1,this._clickTolerance=Y&&Y.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=Y&&Y.rotation||0,this._rotationAlignment=Y&&Y.rotationAlignment||"auto",this._pitchAlignment=Y&&Y.pitchAlignment&&Y.pitchAlignment!=="auto"?Y.pitchAlignment:this._rotationAlignment,!Y||!Y.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var zt=r.createNS("http://www.w3.org/2000/svg","svg"),Qt=41,ne=27;zt.setAttributeNS(null,"display","block"),zt.setAttributeNS(null,"height",Qt+"px"),zt.setAttributeNS(null,"width",ne+"px"),zt.setAttributeNS(null,"viewBox","0 0 "+ne+" "+Qt);var Ft=r.createNS("http://www.w3.org/2000/svg","g");Ft.setAttributeNS(null,"stroke","none"),Ft.setAttributeNS(null,"stroke-width","1"),Ft.setAttributeNS(null,"fill","none"),Ft.setAttributeNS(null,"fill-rule","evenodd");var $t=r.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"fill-rule","nonzero");var he=r.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(3.0, 29.0)"),he.setAttributeNS(null,"fill","#000000");for(var Ne=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Ie=0,Fe=Ne;Ie=ft}this._isDragging&&(this._pos=Y.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},tt.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.Event("dragend")),this._state="inactive"},tt.prototype._addDragHandler=function(Y){this._element.contains(Y.originalEvent.target)&&(Y.preventDefault(),this._positionDelta=Y.point.sub(this._pos).add(this._offset),this._pointerdownPos=Y.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},tt.prototype.setDraggable=function(Y){return this._draggable=!!Y,this._map&&(Y?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},tt.prototype.isDraggable=function(){return this._draggable},tt.prototype.setRotation=function(Y){return this._rotation=Y||0,this._update(),this},tt.prototype.getRotation=function(){return this._rotation},tt.prototype.setRotationAlignment=function(Y){return this._rotationAlignment=Y||"auto",this._update(),this},tt.prototype.getRotationAlignment=function(){return this._rotationAlignment},tt.prototype.setPitchAlignment=function(Y){return this._pitchAlignment=Y&&Y!=="auto"?Y:this._rotationAlignment,this._update(),this},tt.prototype.getPitchAlignment=function(){return this._pitchAlignment},tt})(t.Evented),Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Zs;function Zo(U){Zs!==void 0?U(Zs):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(tt){Zs=tt.state!=="denied",U(Zs)}):(Zs=!!t.window.navigator.geolocation,U(Zs))}var Qs=0,El=!1,Cl=(function(U){function tt(Y){U.call(this),this.options=t.extend({},Zi,Y),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.onAdd=function(Y){return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Zo(this._setupUI),this._container},tt.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Qs=0,El=!1},tt.prototype._isOutOfMapMaxBounds=function(Y){var ft=this._map.getMaxBounds(),zt=Y.coords;return ft&&(zt.longitudeft.getEast()||zt.latitudeft.getNorth())},tt.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},tt.prototype._onSuccess=function(Y){if(this._map){if(this._isOutOfMapMaxBounds(Y)){this._setErrorState(),this.fire(new t.Event("outofmaxbounds",Y)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=Y,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(Y),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(Y),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",Y)),this._finish()}},tt.prototype._updateCamera=function(Y){var ft=new t.LngLat(Y.coords.longitude,Y.coords.latitude),zt=Y.coords.accuracy,Qt=this._map.getBearing(),ne=t.extend({bearing:Qt},this.options.fitBoundsOptions);this._map.fitBounds(ft.toBounds(zt),ne,{geolocateSource:!0})},tt.prototype._updateMarker=function(Y){if(Y){var ft=new t.LngLat(Y.coords.longitude,Y.coords.latitude);this._accuracyCircleMarker.setLngLat(ft).addTo(this._map),this._userLocationDotMarker.setLngLat(ft).addTo(this._map),this._accuracy=Y.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},tt.prototype._updateCircleRadius=function(){var Y=this._map._container.clientHeight/2,ft=this._map.unproject([0,Y]),zt=this._map.unproject([1,Y]),Qt=ft.distanceTo(zt),ne=Math.ceil(2*this._accuracy/Qt);this._circleElement.style.width=ne+"px",this._circleElement.style.height=ne+"px"},tt.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},tt.prototype._onError=function(Y){if(this._map){if(this.options.trackUserLocation)if(Y.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var ft=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ft,this._geolocateButton.setAttribute("aria-label",ft),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(Y.code===3&&El)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",Y)),this._finish()}},tt.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},tt.prototype._setupUI=function(Y){var ft=this;if(this._container.addEventListener("contextmenu",function(ne){return ne.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",Y===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var zt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=zt,this._geolocateButton.setAttribute("aria-label",zt)}else{var Qt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Qt,this._geolocateButton.setAttribute("aria-label",Qt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new rs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rs({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(ne){var Ft=ne.originalEvent&&ne.originalEvent.type==="resize";!ne.geolocateSource&&ft._watchState==="ACTIVE_LOCK"&&!Ft&&(ft._watchState="BACKGROUND",ft._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),ft._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),ft.fire(new t.Event("trackuserlocationend")))})},tt.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Qs--,El=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Qs++;var Y;Qs>1?(Y={maximumAge:6e5,timeout:0},El=!0):(Y=this.options.positionOptions,El=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Y)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},tt.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},tt})(t.Evented),Hs={maxWidth:100,unit:"metric"},js=function(U){this.options=t.extend({},Hs,U),t.bindAll(["_onMove","setUnit"],this)};js.prototype.getDefaultPosition=function(){return"bottom-left"},js.prototype._onMove=function(){Ks(this._map,this._container,this.options)},js.prototype.onAdd=function(U){return this._map=U,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",U.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},js.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},js.prototype.setUnit=function(U){this.options.unit=U,Ks(this._map,this._container,this.options)};function Ks(U,tt,Y){var ft=Y&&Y.maxWidth||100,zt=U._container.clientHeight/2,Qt=U.unproject([0,zt]),ne=U.unproject([ft,zt]),Ft=Qt.distanceTo(ne);if(Y&&Y.unit==="imperial"){var $t=3.2808*Ft;if($t>5280){var he=$t/5280;Mi(tt,ft,he,U._getUIString("ScaleControl.Miles"))}else Mi(tt,ft,$t,U._getUIString("ScaleControl.Feet"))}else if(Y&&Y.unit==="nautical"){var Ne=Ft/1852;Mi(tt,ft,Ne,U._getUIString("ScaleControl.NauticalMiles"))}else Ft>=1e3?Mi(tt,ft,Ft/1e3,U._getUIString("ScaleControl.Kilometers")):Mi(tt,ft,Ft,U._getUIString("ScaleControl.Meters"))}function Mi(U,tt,Y,ft){var zt=Uo(Y),Qt=zt/Y;U.style.width=tt*Qt+"px",U.innerHTML=zt+" "+ft}function Ys(U){var tt=Math.pow(10,Math.ceil(-Math.log(U)/Math.LN10));return Math.round(U*tt)/tt}function Uo(U){var tt=Math.pow(10,(""+Math.floor(U)).length-1),Y=U/tt;return Y=Y>=10?10:Y>=5?5:Y>=3?3:Y>=2?2:Y>=1?1:Ys(Y),tt*Y}var tl=function(U){this._fullscreen=!1,U&&U.container&&(U.container instanceof t.window.HTMLElement?this._container=U.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};tl.prototype.onAdd=function(U){return this._map=U,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},tl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},tl.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},tl.prototype._setupUI=function(){var U=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",U).setAttribute("aria-hidden",!0),U.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},tl.prototype._updateTitle=function(){var U=this._getTitle();this._fullscreenButton.setAttribute("aria-label",U),this._fullscreenButton.title=U},tl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},tl.prototype._isFullscreen=function(){return this._fullscreen},tl.prototype._changeIcon=function(){var U=t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement;U===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},tl.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Il={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},vi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),lo=(function(U){function tt(Y){U.call(this),this.options=t.extend(Object.create(Il),Y),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.addTo=function(Y){return this._map&&this.remove(),this._map=Y,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},tt.prototype.isOpen=function(){return!!this._map},tt.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},tt.prototype.getLngLat=function(){return this._lngLat},tt.prototype.setLngLat=function(Y){return this._lngLat=t.LngLat.convert(Y),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},tt.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},tt.prototype.getElement=function(){return this._container},tt.prototype.setText=function(Y){return this.setDOMContent(t.window.document.createTextNode(Y))},tt.prototype.setHTML=function(Y){var ft=t.window.document.createDocumentFragment(),zt=t.window.document.createElement("body"),Qt;for(zt.innerHTML=Y;Qt=zt.firstChild,!!Qt;)ft.appendChild(Qt);return this.setDOMContent(ft)},tt.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},tt.prototype.setMaxWidth=function(Y){return this.options.maxWidth=Y,this._update(),this},tt.prototype.setDOMContent=function(Y){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(Y),this._createCloseButton(),this._update(),this._focusFirstElement(),this},tt.prototype.addClassName=function(Y){this._container&&this._container.classList.add(Y)},tt.prototype.removeClassName=function(Y){this._container&&this._container.classList.remove(Y)},tt.prototype.setOffset=function(Y){return this.options.offset=Y,this._update(),this},tt.prototype.toggleClassName=function(Y){if(this._container)return this._container.classList.toggle(Y)},tt.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},tt.prototype._onMouseUp=function(Y){this._update(Y.point)},tt.prototype._onMouseMove=function(Y){this._update(Y.point)},tt.prototype._onDrag=function(Y){this._update(Y.point)},tt.prototype._update=function(Y){var ft=this,zt=this._lngLat||this._trackPointer;if(!(!this._map||!zt||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Fe){return ft._container.classList.add(Fe)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=gi(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!Y))){var Qt=this._pos=this._trackPointer&&Y?Y:this._map.project(this._lngLat),ne=this.options.anchor,Ft=ns(this.options.offset);if(!ne){var $t=this._container.offsetWidth,he=this._container.offsetHeight,Ne;Qt.y+Ft.bottom.ythis._map.transform.height-he?Ne=["bottom"]:Ne=[],Qt.x<$t/2?Ne.push("left"):Qt.x>this._map.transform.width-$t/2&&Ne.push("right"),Ne.length===0?ne="bottom":ne=Ne.join("-")}var Ie=Qt.add(Ft[ne]).round();r.setTransform(this._container,Ri[ne]+" translate("+Ie.x+"px,"+Ie.y+"px)"),ds(this._container,ne,"popup")}},tt.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var Y=this._container.querySelector(vi);Y&&Y.focus()}},tt.prototype._onClose=function(){this.remove()},tt})(t.Evented);function ns(U){if(U)if(typeof U=="number"){var tt=Math.round(Math.sqrt(.5*Math.pow(U,2)));return{center:new t.Point(0,0),top:new t.Point(0,U),"top-left":new t.Point(tt,tt),"top-right":new t.Point(-tt,tt),bottom:new t.Point(0,-U),"bottom-left":new t.Point(tt,-tt),"bottom-right":new t.Point(-tt,-tt),left:new t.Point(U,0),right:new t.Point(-U,0)}}else if(U instanceof t.Point||Array.isArray(U)){var Y=t.Point.convert(U);return{center:Y,top:Y,"top-left":Y,"top-right":Y,bottom:Y,"bottom-left":Y,"bottom-right":Y,left:Y,right:Y}}else return{center:t.Point.convert(U.center||[0,0]),top:t.Point.convert(U.top||[0,0]),"top-left":t.Point.convert(U["top-left"]||[0,0]),"top-right":t.Point.convert(U["top-right"]||[0,0]),bottom:t.Point.convert(U.bottom||[0,0]),"bottom-left":t.Point.convert(U["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(U["bottom-right"]||[0,0]),left:t.Point.convert(U.left||[0,0]),right:t.Point.convert(U.right||[0,0])};else return ns(new t.Point(0,0))}var $o={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:_i,NavigationControl:Na,GeolocateControl:Cl,AttributionControl:jn,ScaleControl:js,FullscreenControl:tl,Popup:lo,Marker:rs,Style:xl,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:Ga,clearPrewarmedResources:ve,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(U){t.config.ACCESS_TOKEN=U},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(U){t.config.API_URL=U},get workerCount(){return $n.workerCount},set workerCount(U){$n.workerCount=U},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(U){t.config.MAX_PARALLEL_IMAGE_REQUESTS=U},clearStorage:function(U){t.clearTileCache(U)},workerUrl:""};return $o}),E})}),ez=Vt((K,V)=>{var u=Xr(),d=Dl().sanitizeHTML,E=S5(),A=Wp();function t(o,a){this.subplot=o,this.uid=o.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=A.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var e=t.prototype;e.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},e.needsNewImage=function(o){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&o.sourcetype==="image"&&(this.source!==o.source||JSON.stringify(this.coordinates)!==JSON.stringify(o.coordinates))},e.needsNewSource=function(o){return this.sourceType!==o.sourcetype||JSON.stringify(this.source)!==JSON.stringify(o.source)||this.layerType!==o.type},e.needsNewLayer=function(o){return this.layerType!==o.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},e.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},e.updateImage=function(o){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:o.source,coordinates:o.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},e.updateSource=function(o){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);a.addSource(this.idSource,s)}},e.findFollowingMapboxLayerId=function(o){if(o==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function i(o){var a={},s={};switch(o.type){case"circle":u.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":u.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":u.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,v=E(f.textposition,f.iconsize);u.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":f.placement}),u.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":u.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:a,paint:s}}function n(o){var a=o.sourcetype,s=o.source,f={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",f.tileSize=256):a==="image"&&(v="url",f.coordinates=o.coordinates),f[v]=s,o.sourceattribution&&(f.attribution=d(o.sourceattribution)),f}V.exports=function(o,a,s){var f=new t(o,a);return f.update(s),f}}),rz=Vt((K,V)=>{var u=E5(),d=Xr(),E=Ud(),A=ji(),t=yo(),e=oh(),r=hc(),i=Jh(),n=i.drawMode,o=i.selectMode,a=Sc().prepSelect,s=Sc().clearOutline,f=Sc().clearSelectionsCache,v=Sc().selectOnClick,g=Wp(),m=ez();function w(M,T){this.id=T,this.gd=M;var c=M._fullLayout,h=M._context;this.container=c._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=c._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(c),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=w.prototype;l.plot=function(M,T,c){var h=this,b=T[h.id];h.map&&b.accesstoken!==h.accessToken&&(h.map.remove(),h.map=null,h.styleObj=null,h.traceHash={},h.layerList=[]);var _;h.map?_=new Promise(function(P,z){h.updateMap(M,T,P,z)}):_=new Promise(function(P,z){h.createMap(M,T,P,z)}),c.push(_)},l.createMap=function(M,T,c,h){var b=this,_=T[b.id],P=b.styleObj=y(_.style,T);b.accessToken=_.accesstoken;var z=_.bounds,D=z?[[z.west,z.south],[z.east,z.north]]:null,B=b.map=new u.Map({container:b.div,style:P.style,center:k(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:D,interactive:!b.isStatic,preserveDrawingBuffer:b.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new u.AttributionControl({compact:!0}));B._canvas.style.left="0px",B._canvas.style.top="0px",b.rejectOnError(h),b.isStatic||b.initFx(M,T);var R=[];R.push(new Promise(function(I){B.once("load",I)})),R=R.concat(E.fetchTraceGeoData(M)),Promise.all(R).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.updateMap=function(M,T,c,h){var b=this,_=b.map,P=T[this.id];b.rejectOnError(h);var z=[],D=y(P.style,T);JSON.stringify(b.styleObj)!==JSON.stringify(D)&&(b.styleObj=D,_.setStyle(D.style),b.traceHash={},z.push(new Promise(function(B){_.once("styledata",B)}))),z=z.concat(E.fetchTraceGeoData(M)),Promise.all(z).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.fillBelowLookup=function(M,T){var c=T[this.id],h=c.layers,b,_,P=this.belowLookup={},z=!1;for(b=0;b1)for(b=0;b-1&&v(D.originalEvent,h,[c.xaxis],[c.yaxis],c.id,z),B.indexOf("event")>-1&&r.click(h,D.originalEvent)}}},l.updateFx=function(M){var T=this,c=T.map,h=T.gd;if(T.isStatic)return;function b(D){var B=T.map.unproject(D);return[B.lng,B.lat]}var _=M.dragmode,P;P=function(D,B){if(B.isRect){var R=D.range={};R[T.id]=[b([B.xmin,B.ymin]),b([B.xmax,B.ymax])]}else{var I=D.lassoPoints={};I[T.id]=B.map(b)}};var z=T.dragOptions;T.dragOptions=d.extendDeep(z||{},{dragmode:M.dragmode,element:T.div,gd:h,plotinfo:{id:T.id,domain:M[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:P},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),c.off("click",T.onClickInPanHandler),o(_)||n(_)?(c.dragPan.disable(),c.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(D,B,R){a(D,B,R,T.dragOptions,_)},e.init(T.dragOptions)):(c.dragPan.enable(),c.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),c.on("click",T.onClickInPanHandler))},l.updateFramework=function(M){var T=M[this.id].domain,c=M._size,h=this.div.style;h.width=c.w*(T.x[1]-T.x[0])+"px",h.height=c.h*(T.y[1]-T.y[0])+"px",h.left=c.l+T.x[0]*c.w+"px",h.top=c.t+(1-T.y[1])*c.h+"px",this.xaxis._offset=c.l+T.x[0]*c.w,this.xaxis._length=c.w*(T.x[1]-T.x[0]),this.yaxis._offset=c.t+(1-T.y[1])*c.h,this.yaxis._length=c.h*(T.y[1]-T.y[0])},l.updateLayers=function(M){var T=M[this.id],c=T.layers,h=this.layerList,b;if(c.length!==h.length){for(b=0;b{var u=Xr(),d=Ld(),E=Gf(),A=Dv();V.exports=function(r,i,n){d(r,i,n,{type:"mapbox",attributes:A,handleDefaults:t,partition:"y",accessToken:i._mapboxAccessToken})};function t(r,i,n,o){n("accesstoken",o.accessToken),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var a=n("bounds.west"),s=n("bounds.east"),f=n("bounds.south"),v=n("bounds.north");(a===void 0||s===void 0||f===void 0||v===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(g,m){return u.coerce(r,i,A.layers,g,m)}var o=n("visible");if(o){var a=n("sourcetype"),s=a==="raster"||a==="image";n("source"),n("sourceattribution"),a==="vector"&&n("sourcelayer"),a==="image"&&n("coordinates");var f;s&&(f="raster");var v=n("type",f);s&&v!=="raster"&&(v=i.type="raster",u.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),v==="circle"&&n("circle.radius"),v==="line"&&(n("line.width"),n("line.dash")),v==="fill"&&n("fill.outlinecolor"),v==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),u.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Yx=Vt(K=>{var V=E5(),u=Xr(),d=u.strTranslate,E=u.strScale,A=Pf().getSubplotCalcData,t=Lh(),e=Ni(),r=Eo(),i=Dl(),n=rz(),o="mapbox",a=K.constants=Wp();K.name=o,K.attr="subplot",K.idRoot=o,K.idRegex=K.attrRegex=u.counterRegex(o);var s=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");K.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},K.layoutAttributes=Dv(),K.supplyLayoutDefaults=nz();var f=!0;K.plot=function(m){f&&(f=!1,u.warn(s));var w=m._fullLayout,l=m.calcdata,x=w._subplots[o];if(V.version!==a.requiredVersion)throw new Error(a.wrongVersionErrorMsg);var y=v(m,x);V.accessToken=y;for(var S=0;SR/2){var I=P.split("|").join("
                ");D.text(I).attr("data-unformatted",I).call(i.convertToTspans,m),B=r.bBox(D.node())}D.attr("transform",d(-3,-B.height+8)),z.insert("rect",".static-attribution").attr({x:-B.width-6,y:-B.height-3,width:B.width+6,height:B.height+3,fill:"rgba(255, 255, 255, 0.75)"});var F=1;B.width+6>R&&(F=R/(B.width+6));var j=[x.l+x.w*k.x[1],x.t+x.h*(1-k.y[0])];z.attr("transform",d(j[0],j[1])+E(F))}};function v(m,w){var l=m._fullLayout,x=m._context;if(x.mapboxAccessToken==="")return"";for(var y=[],S=[],k=!1,M=!1,T=0;T1&&u.warn(a.multipleTokensErrorMsg),y[0]):(S.length&&u.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function g(m){return typeof m=="string"&&(a.styleValuesMapbox.indexOf(m)!==-1||m.indexOf("mapbox://")===0||m.indexOf("stamen")===0)}K.updateFx=function(m){for(var w=m._fullLayout,l=w._subplots[o],x=0;x{V.exports={attributes:Zx(),supplyDefaults:X9(),colorbar:Zf(),formatLabels:M5(),calc:Sx(),plot:J9(),hoverPoints:Kx().hoverPoints,eventData:Q9(),selectPoints:tz(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.update(d)}},moduleType:"trace",name:"scattermapbox",basePlotModule:Yx(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),iz=Vt((K,V)=>{V.exports=az()}),z5=Vt((K,V)=>{var u=Zm(),d=Wl(),{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=kl(),e=So().extendFlat;V.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},u.featureidkey,{}),below:{valType:"string",editType:"plot"},text:u.text,hovertext:u.hovertext,marker:{line:{color:e({},u.marker.line.color,{editType:"plot"}),width:e({},u.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},u.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},u.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},u.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:u.hoverinfo,hovertemplate:E({},{keys:["properties"]}),hovertemplatefallback:A(),showlegend:e({},t.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),oz=Vt((K,V)=>{var u=Xr(),d=vf(),E=z5();V.exports=function(A,t,e,r){function i(f,v){return u.coerce(A,t,E,f,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!u.isArrayOrTypedArray(n)||!n.length||!u.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||u.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),d(A,t,r,i,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(t,i)}}),L5=Vt((K,V)=>{var u=Lo(),d=Xr(),E=xu(),A=Eo(),t=jd().makeBlank,e=Ud();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:f,geojson:t()};if(!a)return v;var g=e.extractTraceFeature(n);if(!g)return v;var m=E.makeColorScaleFuncFromTrace(o),w=o.marker,l=w.line||{},x;d.isArrayOrTypedArray(w.opacity)&&(x=function(b){var _=b.mo;return u(_)?+d.constrain(_,0,1):0});var y;d.isArrayOrTypedArray(l.color)&&(y=function(b){return b.mlc});var S;d.isArrayOrTypedArray(l.width)&&(S=function(b){return b.mlw});for(var k=0;k{var u=L5().convert,d=L5().convertOnSelect,E=Wp().traceLayerPrefix;function A(e,r){this.type="choroplethmapbox",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",E+r+"-fill"],["line",E+r+"-line"]],this.below=null}var t=A.prototype;t.update=function(e){this._update(u(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(d(e))},t._update=function(e){var r=this.subplot,i=this.layerList,n=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var o=0;o=0;i--)e.removeLayer(r[i][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(e,r){var i=r[0].trace,n=new A(e,i.uid),o=n.sourceId,a=u(r),s=n.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:a.geojson}),n._addLayers(a,s),r[0].trace._glTrace=n,n}}),lz=Vt((K,V)=>{V.exports={attributes:z5(),supplyDefaults:oz(),colorbar:zd(),calc:Cx(),plot:sz(),hoverPoints:Px(),eventData:Ox(),selectPoints:Dx(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.updateOnSelect(d)}},getBelow:function(u,d){for(var E=d.getMapLayers(),A=E.length-2;A>=0;A--){var t=E[A].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=A+1;e{V.exports=lz()}),C5=Vt((K,V)=>{var u=Wl(),{hovertemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=kl(),t=Zx(),e=So().extendFlat;V.exports=e({lon:t.lon,lat:t.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:t.text,hovertext:t.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:E(),showlegend:e({},A.showlegend,{dflt:!1})},u("",{cLetter:"z",editTypeOverride:"calc"}))}),cz=Vt((K,V)=>{var u=Xr(),d=vf(),E=C5();V.exports=function(A,t,e,r){function i(s,f){return u.coerce(A,t,E,s,f)}var n=i("lon")||[],o=i("lat")||[],a=Math.min(n.length,o.length);if(!a){t.visible=!1;return}t._length=a,i("z"),i("radius"),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),d(A,t,r,i,{prefix:"",cLetter:"z"})}}),fz=Vt((K,V)=>{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ih(),t=Xr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=d(o)&&o.length,s=0;s{var u=Lo(),d=Xr(),E=Pi(),A=xu(),t=ks().BADNUM,e=jd().makeBlank;V.exports=function(r){var i=r[0].trace,n=i.visible===!0&&i._length!==0,o={layout:{visibility:"none"},paint:{}},a=i._opts={heatmap:o,geojson:e()};if(!n)return a;var s=[],f,v=i.z,g=i.radius,m=d.isArrayOrTypedArray(v)&&v.length,w=d.isArrayOrTypedArray(g);for(f=0;f0?+g[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:y})}}var k=A.extractOpts(i),M=k.reversescale?A.flipScale(k.colorscale):k.colorscale,T=M[0][1],c=E.opacity(T)<1?T:E.addOpacity(T,0),h=["interpolate",["linear"],["heatmap-density"],0,c];for(f=1;f{var u=hz(),d=Wp().traceLayerPrefix;function E(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",d+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=u(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(i,n),this.below=n);for(var o=0;o=0;r--)t.removeLayer(e[r][1])},A.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(t,e){var r=e[0].trace,i=new E(t,r.uid),n=i.sourceId,o=u(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),dz=Vt((K,V)=>{var u=yo(),d=Kx().hoverPoints,E=Kx().getExtraText;V.exports=function(A,t,e){var r=d(A,t,e);if(r){var i=r[0],n=i.cd,o=n[0].trace,a=n[i.index];if(delete i.color,"z"in a){var s=i.subplot.mockAxis;i.z=a.z,i.zLabel=u.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),mz=Vt((K,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u.z=d.z,u}}),gz=Vt((K,V)=>{V.exports={attributes:C5(),supplyDefaults:cz(),colorbar:zd(),formatLabels:M5(),calc:fz(),plot:pz(),hoverPoints:dz(),eventData:mz(),getBelow:function(u,d){for(var E=d.getMapLayers(),A=0;A{V.exports=gz()}),yz=Vt((K,V)=>{V.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} -{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),xz=Vt((K,V)=>{V.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),Wd=Vt((K,V)=>{var u=wd(),d=yz(),E=xz(),A='© OpenStreetMap contributors',t="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",e="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",a={basic:r,streets:r,outdoors:r,light:t,dark:e,satellite:E,"satellite-streets":d,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":t,"carto-darkmatter":e,"carto-voyager":r,"carto-positron-nolabels":i,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":o},s=u(a);V.exports={styleValueDflt:"basic",stylesMap:a,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error."}}),Fv=Vt((K,V)=>{var u=Xr(),d=Pi().defaultLine,E=Vu().attributes,A=yu(),t=pc().textposition,e=Cu().overrideAll,r=cl().templatedArray,i=Wd(),n=A({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=V.exports=e({_arrayAttrRegexps:[u.counterRegex("map",".layers",!0)],domain:E({name:"map"}),style:{valType:"any",values:i.styleValuesMap,dflt:i.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:d},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:d}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:u.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),Xx=Vt((K,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=Qh(),t=E0(),e=pc(),r=Fv(),i=kl(),n=Wl(),o=So().extendFlat,a=Cu().overrideAll,s=Fv(),f=t.line,v=t.marker;V.exports=a({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:o({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:o({},v.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:o({},e.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:e.connectgaps,marker:o({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:v.opacity,size:v.size,sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode},n("marker")),fill:t.fill,fillcolor:A(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),I5=Vt((K,V)=>{var u=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(d){return u.indexOf(d)!==-1}}}),_z=Vt((K,V)=>{var u=Xr(),d=nu(),E=Ch(),A=Rh(),t=Nh(),e=ep(),r=Xx(),i=I5().isSupportedFont;V.exports=function(o,a,s,f){function v(h,b){return u.coerce(o,a,r,h,b)}function g(h,b){return u.coerce2(o,a,r,h,b)}var m=n(o,a,v);if(!m){a.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),d.hasMarkers(a)){E(o,a,s,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var w=a.marker;w.symbol!=="circle"&&(u.isArrayOrTypedArray(w.size)&&(w.size=w.size[0]),u.isArrayOrTypedArray(w.color)&&(w.color=w.color[0]))}d.hasLines(a)&&(A(o,a,s,f,v,{noDash:!0}),v("connectgaps"));var l=g("cluster.maxzoom"),x=g("cluster.step"),y=g("cluster.color",a.marker&&a.marker.color||s),S=g("cluster.size"),k=g("cluster.opacity"),M=l!==!1||x!==!1||y!==!1||S!==!1||k!==!1,T=v("cluster.enabled",M);if(T||d.hasText(a)){var c=f.font.family;t(o,a,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(c)?c:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),u.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var f=s("lon")||[],v=s("lat")||[],g=Math.min(f.length,v.length);return a._length=g,g}}),P5=Vt((K,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),O5=Vt((K,V)=>{var u=Xr();V.exports=function(d,E){var A=d.split(" "),t=A[0],e=A[1],r=u.isArrayOrTypedArray(E)?u.mean(E):E,i=.5+r/100,n=1.5+r/100,o=["",""],a=[0,0];switch(t){case"top":o[0]="top",a[1]=-n;break;case"bottom":o[0]="bottom",a[1]=n;break}switch(e){case"left":o[1]="right",a[0]=-i;break;case"right":o[1]="left",a[0]=i;break}var s;return o[0]&&o[1]?s=o.join("-"):o[0]?s=o[0]:o[1]?s=o[1]:s="center",{anchor:s,offset:a}}}),bz=Vt((K,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM,A=jd(),t=xu(),e=Eo(),r=bm(),i=nu(),n=I5().isSupportedFont,o=O5(),a=mh().appendArrayPointValue,s=Dl().NEWLINES,f=Dl().BR_TAG_ALL;V.exports=function(k,M){var T=M[0].trace,c=T.visible===!0&&T._length!==0,h=T.fill!=="none",b=i.hasLines(T),_=i.hasMarkers(T),P=i.hasText(T),z=_&&T.marker.symbol==="circle",D=_&&T.marker.symbol!=="circle",B=T.cluster&&T.cluster.enabled,R=v("fill"),I=v("line"),F=v("circle"),j=v("symbol"),N={fill:R,line:I,circle:F,symbol:j};if(!c)return N;var G;if((h||b)&&(G=A.calcTraceToLineCoords(M)),h&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",d.extendFlat(R.paint,{"fill-color":T.fillcolor})),b&&(I.geojson=A.makeLine(G),I.layout.visibility="visible",d.extendFlat(I.paint,{"line-width":T.line.width,"line-color":T.line.color,"line-opacity":T.opacity})),z){var rt=g(M);F.geojson=rt.geojson,F.layout.visibility="visible",B&&(F.filter=["!",["has","point_count"]],N.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":y(T.cluster.color,T.cluster.step),"circle-radius":y(T.cluster.size,T.cluster.step),"circle-opacity":y(T.cluster.opacity,T.cluster.step)}},N.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(T),"text-size":12}}),d.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(z&&B&&(F.filter=["!",["has","point_count"]]),(D||P)&&(j.geojson=m(M,k),d.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),D&&(d.extendFlat(j.layout,{"icon-size":T.marker.size/10}),"angle"in T.marker&&T.marker.angle!=="auto"&&d.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=T.marker.allowoverlap,d.extendFlat(j.paint,{"icon-opacity":T.opacity*T.marker.opacity,"icon-color":T.marker.color})),P)){var ct=(T.marker||{}).size,st=o(T.textposition,ct);d.extendFlat(j.layout,{"text-size":T.textfont.size,"text-anchor":st.anchor,"text-offset":st.offset,"text-font":S(T)}),d.extendFlat(j.paint,{"text-color":T.textfont.color,"text-opacity":T.opacity})}return N};function v(k){return{type:k,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(k){var M=k[0].trace,T=M.marker,c=M.selectedpoints,h=d.isArrayOrTypedArray(T.color),b=d.isArrayOrTypedArray(T.size),_=d.isArrayOrTypedArray(T.opacity),P;function z(st){return M.opacity*st}function D(st){return st/2}var B;h&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(T):B=d.identity);var R;b&&(R=r(M));var I;_&&(I=function(st){var et=u(st)?+d.constrain(st,0,1):0;return z(et)});var F=[];for(P=0;P850?P+=" Black":h>750?P+=" Extra Bold":h>650?P+=" Bold":h>550?P+=" Semi Bold":h>450?P+=" Medium":h>350?P+=" Regular":h>250?P+=" Light":h>150?P+=" Extra Light":P+=" Thin"):b.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",h>750?P+=" Extrabold":h>650?P+=" Bold":h>550?P+=" Semibold":h>350?P+=" Regular":P+=" Light"):b.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",b[3]==="CJK"&&(P+=" CJK"),P+=h>500?" Bold":" Regular")),_&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),n(P)||(P=T);var z=P.split(", ");return z}}),wz=Vt((K,V)=>{var u=Xr(),d=bz(),E=Wd().traceLayerPrefix,A={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,i,n,o){this.type="scattermap",this.subplot=r,this.uid=i,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:E+i+"-fill",line:E+i+"-line",circle:E+i+"-circle",symbol:E+i+"-symbol",cluster:E+i+"-cluster",clusterCount:E+i+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,i,n){var o={type:"geojson",data:i.geojson};n&&n.enabled&&u.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},e.addLayer=function(r,i,n){var o={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(o.filter=i.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),v=0;v=0;b--){var _=h[b];o.removeLayer(g.layerIds[_])}c||o.removeSource(g.sourceIds.circle)}function l(c){for(var h=A.nonCluster,b=0;b=0;b--){var _=h[b];o.removeLayer(g.layerIds[_]),c||o.removeSource(g.sourceIds[_])}}function y(c){v?w(c):x(c)}function S(c){f?m(c):l(c)}function k(){for(var c=f?A.cluster:A.nonCluster,h=0;h=0;n--){var o=i[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},V.exports=function(r,i){var n=i[0].trace,o=n.cluster&&n.cluster.enabled,a=n.visible!==!0,s=new t(r,n.uid,o,a),f=d(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],g,m,w;if(o)for(s.addSource("circle",f.circle,n.cluster),g=0;g{var u=hc(),d=Xr(),E=Sm(),A=d.fillText,t=ks().BADNUM,e=Wd().traceLayerPrefix;function r(n,o,a){var s=n.cd,f=s[0].trace,v=n.xa,g=n.ya,m=n.subplot,w=[],l=e+f.uid+"-circle",x=f.cluster&&f.cluster.enabled;if(x){var y=m.map.queryRenderedFeatures(null,{layers:[l]});w=y.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),k=S*360,M=o-k;function T(R){var I=R.lonlat;if(I[0]===t||x&&w.indexOf(R.i+1)===-1)return 1/0;var F=d.modHalf(I[0],360),j=I[1],N=m.project([F,j]),G=N.x-v.c2p([M,j]),rt=N.y-g.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(u.getClosest(s,T,n),n.index!==!1){var c=s[n.index],h=c.lonlat,b=[d.modHalf(h[0],360)+k,h[1]],_=v.c2p(b),P=g.c2p(b),z=c.mrc||1;n.x0=_-z,n.x1=_+z,n.y0=P-z,n.y1=P+z;var D={};D[f.subplot]={_subplot:m};var B=f._module.formatLabels(c,f,D);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(f,c),n.extraText=i(f,c,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),v=f.indexOf("all")!==-1,g=f.indexOf("lon")!==-1,m=f.indexOf("lat")!==-1,w=o.lonlat,l=[];function x(y){return y+"°"}return v||g&&m?l.push("("+x(w[1])+", "+x(w[0])+")"):g?l.push(a.lon+x(w[0])):m&&l.push(a.lat+x(w[1])),(v||f.indexOf("text")!==-1)&&A(o,n,l),l.join("
                ")}V.exports={hoverPoints:r,getExtraText:i}}),Tz=Vt((K,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u}}),kz=Vt((K,V)=>{var u=Xr(),d=nu(),E=ks().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!d.hasMarkers(o))return[];if(t===!1)for(a=0;a{(function(u,d){typeof K=="object"&&typeof V<"u"?V.exports=d():(u=typeof globalThis<"u"?globalThis:u||self,u.maplibregl=d())})(K,function(){var u={},d={};function E(t,e,r){if(d[t]=r,t==="index"){var i="var sharedModule = {}; ("+d.shared+")(sharedModule); ("+d.worker+")(sharedModule);",n={};return d.shared(n),d.index(u,n),typeof window<"u"&&u.setWorkerUrl(window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))),u}}E("shared",["exports"],function(t){function e(H,C,$,ht){return new($||($=Promise))(function(Mt,Bt){function jt(Be){try{be(ht.next(Be))}catch(Qe){Bt(Qe)}}function oe(Be){try{be(ht.throw(Be))}catch(Qe){Bt(Qe)}}function be(Be){var Qe;Be.done?Mt(Be.value):(Qe=Be.value,Qe instanceof $?Qe:new $(function(lr){lr(Qe)})).then(jt,oe)}be((ht=ht.apply(H,C||[])).next())})}function r(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}typeof SuppressedError=="function"&&SuppressedError;var i=n;function n(H,C){this.x=H,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(H){return this.clone()._add(H)},sub:function(H){return this.clone()._sub(H)},multByPoint:function(H){return this.clone()._multByPoint(H)},divByPoint:function(H){return this.clone()._divByPoint(H)},mult:function(H){return this.clone()._mult(H)},div:function(H){return this.clone()._div(H)},rotate:function(H){return this.clone()._rotate(H)},rotateAround:function(H,C){return this.clone()._rotateAround(H,C)},matMult:function(H){return this.clone()._matMult(H)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(H){return this.x===H.x&&this.y===H.y},dist:function(H){return Math.sqrt(this.distSqr(H))},distSqr:function(H){var C=H.x-this.x,$=H.y-this.y;return C*C+$*$},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(H){return Math.atan2(this.y-H.y,this.x-H.x)},angleWith:function(H){return this.angleWithSep(H.x,H.y)},angleWithSep:function(H,C){return Math.atan2(this.x*C-this.y*H,this.x*H+this.y*C)},_matMult:function(H){var C=H[2]*this.x+H[3]*this.y;return this.x=H[0]*this.x+H[1]*this.y,this.y=C,this},_add:function(H){return this.x+=H.x,this.y+=H.y,this},_sub:function(H){return this.x-=H.x,this.y-=H.y,this},_mult:function(H){return this.x*=H,this.y*=H,this},_div:function(H){return this.x/=H,this.y/=H,this},_multByPoint:function(H){return this.x*=H.x,this.y*=H.y,this},_divByPoint:function(H){return this.x/=H.x,this.y/=H.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var H=this.y;return this.y=this.x,this.x=-H,this},_rotate:function(H){var C=Math.cos(H),$=Math.sin(H),ht=$*this.x+C*this.y;return this.x=C*this.x-$*this.y,this.y=ht,this},_rotateAround:function(H,C){var $=Math.cos(H),ht=Math.sin(H),Mt=C.y+ht*(this.x-C.x)+$*(this.y-C.y);return this.x=C.x+$*(this.x-C.x)-ht*(this.y-C.y),this.y=Mt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(H){return H instanceof n?H:Array.isArray(H)?new n(H[0],H[1]):H};var o=r(i),a=s;function s(H,C,$,ht){this.cx=3*H,this.bx=3*($-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ht-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=C,this.p2x=$,this.p2y=ht}s.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,C){if(C===void 0&&(C=1e-6),H<0)return 0;if(H>1)return 1;for(var $=H,ht=0;ht<8;ht++){var Mt=this.sampleCurveX($)-H;if(Math.abs(Mt)Mt?jt=$:oe=$,$=.5*(oe-jt)+jt;return $},solve:function(H,C){return this.sampleCurveY(this.solveCurveX(H,C))}};var f=r(a);let v,g;function m(){return v==null&&(v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),v}function w(){if(g==null&&(g=!1,m())){let H=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(H){for(let $=0;$<25;$++){let ht=4*$;H.fillStyle=`rgb(${ht},${ht+1},${ht+2})`,H.fillRect($%5,Math.floor($/5),1,1)}let C=H.getImageData(0,0,5,5).data;for(let $=0;$<100;$++)if($%4!=3&&C[$]!==$){g=!0;break}}}return g||!1}function l(H,C,$,ht){let Mt=new f(H,C,$,ht);return Bt=>Mt.solve(Bt)}let x=l(.25,.1,.25,1);function y(H,C,$){return Math.min($,Math.max(C,H))}function S(H,C,$){let ht=$-C,Mt=((H-C)%ht+ht)%ht+C;return Mt===C?$:Mt}function k(H,...C){for(let $ of C)for(let ht in $)H[ht]=$[ht];return H}let M=1;function T(H,C,$){let ht={};for(let Mt in H)ht[Mt]=C.call(this,H[Mt],Mt,H);return ht}function c(H,C,$){let ht={};for(let Mt in H)C.call(this,H[Mt],Mt,H)&&(ht[Mt]=H[Mt]);return ht}function h(H){return Array.isArray(H)?H.map(h):typeof H=="object"&&H?T(H,h):H}let b={};function _(H){b[H]||(typeof console<"u"&&console.warn(H),b[H]=!0)}function P(H,C,$){return($.y-H.y)*(C.x-H.x)>(C.y-H.y)*($.x-H.x)}function z(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let D=null;function B(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}let R="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function I(H,C,$,ht,Mt){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Bt=new VideoFrame(H,{timestamp:0});try{let jt=Bt?.format;if(!jt||!jt.startsWith("BGR")&&!jt.startsWith("RGB"))throw new Error(`Unrecognized format ${jt}`);let oe=jt.startsWith("BGR"),be=new Uint8ClampedArray(ht*Mt*4);if(yield Bt.copyTo(be,(function(Be,Qe,lr,wr,Fr){let Zr=4*Math.max(-Qe,0),en=(Math.max(0,lr)-lr)*wr*4+Zr,yn=4*wr,Vn=Math.max(0,Qe),Ca=Math.max(0,lr);return{rect:{x:Vn,y:Ca,width:Math.min(Be.width,Qe+wr)-Vn,height:Math.min(Be.height,lr+Fr)-Ca},layout:[{offset:en,stride:yn}]}})(H,C,$,ht,Mt)),oe)for(let Be=0;Bez(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ot=function(H,C){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){let ht=ct(H.url);if(ht)return ht(H,C);if(z(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:st},C)}if(!(/^file:/.test($=H.url)||/^file:/.test(Z())&&!/^\w+:/.test($))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(ht,Mt){return e(this,void 0,void 0,function*(){let Bt=new Request(ht.url,{method:ht.method||"GET",body:ht.body,credentials:ht.credentials,headers:ht.headers,cache:ht.cache,referrer:Z(),signal:Mt.signal});ht.type!=="json"||Bt.headers.has("Accept")||Bt.headers.set("Accept","application/json");let jt=yield fetch(Bt);if(!jt.ok){let Be=yield jt.blob();throw new et(jt.status,jt.statusText,ht.url,Be)}let oe;oe=ht.type==="arrayBuffer"||ht.type==="image"?jt.arrayBuffer():ht.type==="json"?jt.json():jt.text();let be=yield oe;if(Mt.signal.aborted)throw G();return{data:be,cacheControl:jt.headers.get("Cache-Control"),expires:jt.headers.get("Expires")}})})(H,C);if(z(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:st},C)}var $;return(function(ht,Mt){return new Promise((Bt,jt)=>{var oe;let be=new XMLHttpRequest;be.open(ht.method||"GET",ht.url,!0),ht.type!=="arrayBuffer"&&ht.type!=="image"||(be.responseType="arraybuffer");for(let Be in ht.headers)be.setRequestHeader(Be,ht.headers[Be]);ht.type==="json"&&(be.responseType="text",!((oe=ht.headers)===null||oe===void 0)&&oe.Accept||be.setRequestHeader("Accept","application/json")),be.withCredentials=ht.credentials==="include",be.onerror=()=>{jt(new Error(be.statusText))},be.onload=()=>{if(!Mt.signal.aborted)if((be.status>=200&&be.status<300||be.status===0)&&be.response!==null){let Be=be.response;if(ht.type==="json")try{Be=JSON.parse(be.response)}catch(Qe){return void jt(Qe)}Bt({data:Be,cacheControl:be.getResponseHeader("Cache-Control"),expires:be.getResponseHeader("Expires")})}else{let Be=new Blob([be.response],{type:be.getResponseHeader("Content-Type")});jt(new et(be.status,be.statusText,ht.url,Be))}},Mt.signal.addEventListener("abort",()=>{be.abort(),jt(G())}),be.send(ht.body)})})(H,C)};function X(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;let C=new URL(H),$=window.location;return C.protocol===$.protocol&&C.host===$.host}function Q(H,C,$){$[H]&&$[H].indexOf(C)!==-1||($[H]=$[H]||[],$[H].push(C))}function ut(H,C,$){if($&&$[H]){let ht=$[H].indexOf(C);ht!==-1&&$[H].splice(ht,1)}}class J{constructor(C,$={}){k(this,$),this.type=C}}class q extends J{constructor(C,$={}){super("error",k({error:C},$))}}class it{on(C,$){return this._listeners=this._listeners||{},Q(C,$,this._listeners),this}off(C,$){return ut(C,$,this._listeners),ut(C,$,this._oneTimeListeners),this}once(C,$){return $?(this._oneTimeListeners=this._oneTimeListeners||{},Q(C,$,this._oneTimeListeners),this):new Promise(ht=>this.once(C,ht))}fire(C,$){typeof C=="string"&&(C=new J(C,$||{}));let ht=C.type;if(this.listens(ht)){C.target=this;let Mt=this._listeners&&this._listeners[ht]?this._listeners[ht].slice():[];for(let oe of Mt)oe.call(this,C);let Bt=this._oneTimeListeners&&this._oneTimeListeners[ht]?this._oneTimeListeners[ht].slice():[];for(let oe of Bt)ut(ht,oe,this._oneTimeListeners),oe.call(this,C);let jt=this._eventedParent;jt&&(k(C,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),jt.fire(C))}else C instanceof q&&console.error(C.error);return this}listens(C){return this._listeners&&this._listeners[C]&&this._listeners[C].length>0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)}setEventedParent(C,$){return this._eventedParent=C,this._eventedParentData=$,this}}var nt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let dt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Tt(H,C){let $={};for(let ht in H)ht!=="ref"&&($[ht]=H[ht]);return dt.forEach(ht=>{ht in C&&($[ht]=C[ht])}),$}function wt(H,C){if(Array.isArray(H)){if(!Array.isArray(C)||H.length!==C.length)return!1;for(let $=0;$`:H.itemType.kind==="value"?"array":`array<${C}>`}return H.kind}let _t=[Kt,ue,Me,Ce,We,er,qe,Dt(vr),Mr,Ir,de];function lt(H,C){if(C.kind==="error")return null;if(H.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!lt(H.itemType,C.itemType))&&(typeof H.N!="number"||H.N===C.N))return null}else{if(H.kind===C.kind)return null;if(H.kind==="value"){for(let $ of _t)if(!lt($,C))return null}}return`Expected ${qt(H)} but found ${qt(C)} instead.`}function yt(H,C){return C.some($=>$.kind===H.kind)}function St(H,C){return C.some($=>$==="null"?H===null:$==="array"?Array.isArray(H):$==="object"?H&&!Array.isArray(H)&&typeof H=="object":$===typeof H)}function Ht(H,C){return H.kind==="array"&&C.kind==="array"?H.itemType.kind===C.itemType.kind&&typeof H.N=="number":H.kind===C.kind}let Yt=.96422,se=.82521,ke=4/29,Ee=6/29,Ue=3*Ee*Ee,ir=Ee*Ee*Ee,ar=Math.PI/180,Ye=180/Math.PI;function Er(H){return(H%=360)<0&&(H+=360),H}function pn([H,C,$,ht]){let Mt,Bt,jt=bn((.2225045*(H=dn(H))+.7168786*(C=dn(C))+.0606169*($=dn($)))/1);H===C&&C===$?Mt=Bt=jt:(Mt=bn((.4360747*H+.3850649*C+.1430804*$)/Yt),Bt=bn((.0139322*H+.0971045*C+.7141733*$)/se));let oe=116*jt-16;return[oe<0?0:oe,500*(Mt-jt),200*(jt-Bt),ht]}function dn(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function bn(H){return H>ir?Math.pow(H,1/3):H/Ue+ke}function Zn([H,C,$,ht]){let Mt=(H+16)/116,Bt=isNaN(C)?Mt:Mt+C/500,jt=isNaN($)?Mt:Mt-$/200;return Mt=1*gn(Mt),Bt=Yt*gn(Bt),jt=se*gn(jt),[En(3.1338561*Bt-1.6168667*Mt-.4906146*jt),En(-.9787684*Bt+1.9161415*Mt+.033454*jt),En(.0719453*Bt-.2289914*Mt+1.4052427*jt),ht]}function En(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function gn(H){return H>Ee?H*H*H:Ue*(H-ke)}function da(H){return parseInt(H.padEnd(2,H),16)/255}function ra(H,C){return Se(C?H/100:H,0,1)}function Se(H,C,$){return Math.min(Math.max(C,H),$)}function Re(H){return!H.some(Number.isNaN)}let Ze={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class tr{constructor(C,$,ht,Mt=1,Bt=!0){this.r=C,this.g=$,this.b=ht,this.a=Mt,Bt||(this.r*=Mt,this.g*=Mt,this.b*=Mt,Mt||this.overwriteGetter("rgb",[C,$,ht,Mt]))}static parse(C){if(C instanceof tr)return C;if(typeof C!="string")return;let $=(function(ht){if((ht=ht.toLowerCase().trim())==="transparent")return[0,0,0,0];let Mt=Ze[ht];if(Mt){let[jt,oe,be]=Mt;return[jt/255,oe/255,be/255,1]}if(ht.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(ht)){let jt=ht.length<6?1:2,oe=1;return[da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+jt)||"ff")]}if(ht.startsWith("rgb")){let jt=ht.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(jt){let[oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca]=jt,ua=[Qe||" ",Fr||" ",yn].join("");if(ua===" "||ua===" /"||ua===",,"||ua===",,,"){let wa=[Be,wr,en].join(""),Xa=wa==="%%%"?100:wa===""?255:0;if(Xa){let di=[Se(+be/Xa,0,1),Se(+lr/Xa,0,1),Se(+Zr/Xa,0,1),Vn?ra(+Vn,Ca):1];if(Re(di))return di}}return}}let Bt=ht.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Bt){let[jt,oe,be,Be,Qe,lr,wr,Fr,Zr]=Bt,en=[be||" ",Qe||" ",wr].join("");if(en===" "||en===" /"||en===",,"||en===",,,"){let yn=[+oe,Se(+Be,0,100),Se(+lr,0,100),Fr?ra(+Fr,Zr):1];if(Re(yn))return(function([Vn,Ca,ua,wa]){function Xa(di){let oo=(di+Vn/30)%12,as=Ca*Math.min(ua,1-ua);return ua-as*Math.max(-1,Math.min(oo-3,9-oo,1))}return Vn=Er(Vn),Ca/=100,ua/=100,[Xa(0),Xa(8),Xa(4),wa]})(yn)}}})(C);return $?new tr(...$,!1):void 0}get rgb(){let{r:C,g:$,b:ht,a:Mt}=this,Bt=Mt||1/0;return this.overwriteGetter("rgb",[C/Bt,$/Bt,ht/Bt,Mt])}get hcl(){return this.overwriteGetter("hcl",(function(C){let[$,ht,Mt,Bt]=pn(C),jt=Math.sqrt(ht*ht+Mt*Mt);return[Math.round(1e4*jt)?Er(Math.atan2(Mt,ht)*Ye):NaN,jt,$,Bt]})(this.rgb))}get lab(){return this.overwriteGetter("lab",pn(this.rgb))}overwriteGetter(C,$){return Object.defineProperty(this,C,{value:$}),$}toString(){let[C,$,ht,Mt]=this.rgb;return`rgba(${[C,$,ht].map(Bt=>Math.round(255*Bt)).join(",")},${Mt})`}}tr.black=new tr(0,0,0,1),tr.white=new tr(1,1,1,1),tr.transparent=new tr(0,0,0,0),tr.red=new tr(1,0,0,1);class zr{constructor(C,$,ht){this.sensitivity=C?$?"variant":"case":$?"accent":"base",this.locale=ht,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(C,$){return this.collator.compare(C,$)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tn{constructor(C,$,ht,Mt,Bt){this.text=C,this.image=$,this.scale=ht,this.fontStack=Mt,this.textColor=Bt}}class Yr{constructor(C){this.sections=C}static fromString(C){return new Yr([new tn(C,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(C=>C.text.length!==0||C.image&&C.image.name.length!==0)}static factory(C){return C instanceof Yr?C:Yr.fromString(C)}toString(){return this.sections.length===0?"":this.sections.map(C=>C.text).join("")}}class $r{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof $r)return C;if(typeof C=="number")return new $r([C,C,C,C]);if(Array.isArray(C)&&!(C.length<1||C.length>4)){for(let $ of C)if(typeof $!="number")return;switch(C.length){case 1:C=[C[0],C[0],C[0],C[0]];break;case 2:C=[C[0],C[1],C[0],C[1]];break;case 3:C=[C[0],C[1],C[2],C[1]]}return new $r(C)}}toString(){return JSON.stringify(this.values)}}let In=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Nn{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof Nn)return C;if(Array.isArray(C)&&!(C.length<1)&&C.length%2==0){for(let $=0;$=0&&H<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof $=="number"&&$>=0&&$<=255?ht===void 0||typeof ht=="number"&&ht>=0&&ht<=1?null:`Invalid rgba value [${[H,C,$,ht].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof ht=="number"?[H,C,$,ht]:[H,C,$]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ia(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof tr||H instanceof zr||H instanceof Yr||H instanceof $r||H instanceof Nn||H instanceof Kn)return!0;if(Array.isArray(H)){for(let C of H)if(!ia(C))return!1;return!0}if(typeof H=="object"){for(let C in H)if(!ia(H[C]))return!1;return!0}return!1}function Cn(H){if(H===null)return Kt;if(typeof H=="string")return Me;if(typeof H=="boolean")return Ce;if(typeof H=="number")return ue;if(H instanceof tr)return We;if(H instanceof zr)return _r;if(H instanceof Yr)return er;if(H instanceof $r)return Mr;if(H instanceof Nn)return de;if(H instanceof Kn)return Ir;if(Array.isArray(H)){let C=H.length,$;for(let ht of H){let Mt=Cn(ht);if($){if($===Mt)continue;$=vr;break}$=Mt}return Dt($||vr,C)}return qe}function Fa(H){let C=typeof H;return H===null?"":C==="string"||C==="number"||C==="boolean"?String(H):H instanceof tr||H instanceof Yr||H instanceof $r||H instanceof Nn||H instanceof Kn?H.toString():JSON.stringify(H)}class Ga{constructor(C,$){this.type=C,this.value=$}static parse(C,$){if(C.length!==2)return $.error(`'literal' expression requires exactly one argument, but found ${C.length-1} instead.`);if(!ia(C[1]))return $.error("invalid value");let ht=C[1],Mt=Cn(ht),Bt=$.expectedType;return Mt.kind!=="array"||Mt.N!==0||!Bt||Bt.kind!=="array"||typeof Bt.N=="number"&&Bt.N!==0||(Mt=Bt),new Ga(Mt,ht)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ve{constructor(C){this.name="ExpressionEvaluationError",this.message=C}toJSON(){return this.message}}let ge={string:Me,number:ue,boolean:Ce,object:qe};class dr{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht,Mt=1,Bt=C[0];if(Bt==="array"){let oe,be;if(C.length>2){let Be=C[1];if(typeof Be!="string"||!(Be in ge)||Be==="object")return $.error('The item type argument of "array" must be one of string, number, boolean',1);oe=ge[Be],Mt++}else oe=vr;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return $.error('The length argument to "array" must be a positive integer literal',2);be=C[2],Mt++}ht=Dt(oe,be)}else{if(!ge[Bt])throw new Error(`Types doesn't contain name = ${Bt}`);ht=ge[Bt]}let jt=[];for(;MtC.outputDefined())}}let br={"to-boolean":Ce,"to-color":We,"to-number":ue,"to-string":Me};class Tr{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht=C[0];if(!br[ht])throw new Error(`Can't parse ${ht} as it is not part of the known types`);if((ht==="to-boolean"||ht==="to-string")&&C.length!==2)return $.error("Expected one argument.");let Mt=br[ht],Bt=[];for(let jt=1;jt4?`Invalid rbga value ${JSON.stringify($)}: expected an array containing either three or four numeric values.`:$n($[0],$[1],$[2],$[3]),!ht))return new tr($[0]/255,$[1]/255,$[2]/255,$[3])}throw new ve(ht||`Could not parse color from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"padding":{let $;for(let ht of this.args){$=ht.evaluate(C);let Mt=$r.parse($);if(Mt)return Mt}throw new ve(`Could not parse padding from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"variableAnchorOffsetCollection":{let $;for(let ht of this.args){$=ht.evaluate(C);let Mt=Nn.parse($);if(Mt)return Mt}throw new ve(`Could not parse variableAnchorOffsetCollection from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"number":{let $=null;for(let ht of this.args){if($=ht.evaluate(C),$===null)return 0;let Mt=Number($);if(!isNaN(Mt))return Mt}throw new ve(`Could not convert ${JSON.stringify($)} to number.`)}case"formatted":return Yr.fromString(Fa(this.args[0].evaluate(C)));case"resolvedImage":return Kn.fromString(Fa(this.args[0].evaluate(C)));default:return Fa(this.args[0].evaluate(C))}}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}let mr=["Unknown","Point","LineString","Polygon"];class kr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?mr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(C){let $=this._parseColorCache[C];return $||($=this._parseColorCache[C]=tr.parse(C)),$}}class Ur{constructor(C,$,ht=[],Mt,Bt=new re,jt=[]){this.registry=C,this.path=ht,this.key=ht.map(oe=>`[${oe}]`).join(""),this.scope=Bt,this.errors=jt,this.expectedType=Mt,this._isConstant=$}parse(C,$,ht,Mt,Bt={}){return $?this.concat($,ht,Mt)._parse(C,Bt):this._parse(C,Bt)}_parse(C,$){function ht(Mt,Bt,jt){return jt==="assert"?new dr(Bt,[Mt]):jt==="coerce"?new Tr(Bt,[Mt]):Mt}if(C!==null&&typeof C!="string"&&typeof C!="boolean"&&typeof C!="number"||(C=["literal",C]),Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Mt=C[0];if(typeof Mt!="string")return this.error(`Expression name must be a string, but found ${typeof Mt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Bt=this.registry[Mt];if(Bt){let jt=Bt.parse(C,this);if(!jt)return null;if(this.expectedType){let oe=this.expectedType,be=jt.type;if(oe.kind!=="string"&&oe.kind!=="number"&&oe.kind!=="boolean"&&oe.kind!=="object"&&oe.kind!=="array"||be.kind!=="value")if(oe.kind!=="color"&&oe.kind!=="formatted"&&oe.kind!=="resolvedImage"||be.kind!=="value"&&be.kind!=="string")if(oe.kind!=="padding"||be.kind!=="value"&&be.kind!=="number"&&be.kind!=="array")if(oe.kind!=="variableAnchorOffsetCollection"||be.kind!=="value"&&be.kind!=="array"){if(this.checkSubtype(oe,be))return null}else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"assert")}if(!(jt instanceof Ga)&&jt.type.kind!=="resolvedImage"&&this._isConstant(jt)){let oe=new kr;try{jt=new Ga(jt.type,jt.evaluate(oe))}catch(be){return this.error(be.message),null}}return jt}return this.error(`Unknown expression "${Mt}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(C===void 0?"'undefined' value invalid. Use null instead.":typeof C=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof C} instead.`)}concat(C,$,ht){let Mt=typeof C=="number"?this.path.concat(C):this.path,Bt=ht?this.scope.concat(ht):this.scope;return new Ur(this.registry,this._isConstant,Mt,$||null,Bt,this.errors)}error(C,...$){let ht=`${this.key}${$.map(Mt=>`[${Mt}]`).join("")}`;this.errors.push(new Ut(ht,C))}checkSubtype(C,$){let ht=lt(C,$);return ht&&this.error(ht),ht}}class Or{constructor(C,$){this.type=$.type,this.bindings=[].concat(C),this.result=$}evaluate(C){return this.result.evaluate(C)}eachChild(C){for(let $ of this.bindings)C($[1]);C(this.result)}static parse(C,$){if(C.length<4)return $.error(`Expected at least 3 arguments, but found ${C.length-1} instead.`);let ht=[];for(let Bt=1;Bt=ht.length)throw new ve(`Array index out of bounds: ${$} > ${ht.length-1}.`);if($!==Math.floor($))throw new ve(`Array index must be an integer, but found ${$} instead.`);return ht[$]}eachChild(C){C(this.index),C(this.input)}outputDefined(){return!1}}class xr{constructor(C,$){this.type=Ce,this.needle=C,this.haystack=$}static parse(C,$){if(C.length!==3)return $.error(`Expected 2 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,vr);return ht&&Mt?yt(ht.type,[Ce,Me,ue,Kt,vr])?new xr(ht,Mt):$.error(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ht.type)} instead`):null}evaluate(C){let $=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!ht)return!1;if(!St($,["boolean","string","number","null"]))throw new ve(`Expected first argument to be of type boolean, string, number or null, but found ${qt(Cn($))} instead.`);if(!St(ht,["string","array"]))throw new ve(`Expected second argument to be of type array or string, but found ${qt(Cn(ht))} instead.`);return ht.indexOf($)>=0}eachChild(C){C(this.needle),C(this.haystack)}outputDefined(){return!0}}class Gr{constructor(C,$,ht){this.type=ue,this.needle=C,this.haystack=$,this.fromIndex=ht}static parse(C,$){if(C.length<=2||C.length>=5)return $.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,vr);if(!ht||!Mt)return null;if(!yt(ht.type,[Ce,Me,ue,Kt,vr]))return $.error(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ht.type)} instead`);if(C.length===4){let Bt=$.parse(C[3],3,ue);return Bt?new Gr(ht,Mt,Bt):null}return new Gr(ht,Mt)}evaluate(C){let $=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!St($,["boolean","string","number","null"]))throw new ve(`Expected first argument to be of type boolean, string, number or null, but found ${qt(Cn($))} instead.`);let Mt;if(this.fromIndex&&(Mt=this.fromIndex.evaluate(C)),St(ht,["string"])){let Bt=ht.indexOf($,Mt);return Bt===-1?-1:[...ht.slice(0,Bt)].length}if(St(ht,["array"]))return ht.indexOf($,Mt);throw new ve(`Expected second argument to be of type array or string, but found ${qt(Cn(ht))} instead.`)}eachChild(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)}outputDefined(){return!1}}class ln{constructor(C,$,ht,Mt,Bt,jt){this.inputType=C,this.type=$,this.input=ht,this.cases=Mt,this.outputs=Bt,this.otherwise=jt}static parse(C,$){if(C.length<5)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if(C.length%2!=1)return $.error("Expected an even number of arguments.");let ht,Mt;$.expectedType&&$.expectedType.kind!=="value"&&(Mt=$.expectedType);let Bt={},jt=[];for(let Be=2;BeNumber.MAX_SAFE_INTEGER)return wr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Zr=="number"&&Math.floor(Zr)!==Zr)return wr.error("Numeric branch labels must be integer values.");if(ht){if(wr.checkSubtype(ht,Cn(Zr)))return null}else ht=Cn(Zr);if(Bt[String(Zr)]!==void 0)return wr.error("Branch labels must be unique.");Bt[String(Zr)]=jt.length}let Fr=$.parse(lr,Be,Mt);if(!Fr)return null;Mt=Mt||Fr.type,jt.push(Fr)}let oe=$.parse(C[1],1,vr);if(!oe)return null;let be=$.parse(C[C.length-1],C.length-1,Mt);return be?oe.type.kind!=="value"&&$.concat(1).checkSubtype(ht,oe.type)?null:new ln(ht,Mt,oe,Bt,jt,be):null}evaluate(C){let $=this.input.evaluate(C);return(Cn($)===this.inputType&&this.outputs[this.cases[$]]||this.otherwise).evaluate(C)}eachChild(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)}outputDefined(){return this.outputs.every(C=>C.outputDefined())&&this.otherwise.outputDefined()}}class wn{constructor(C,$,ht){this.type=C,this.branches=$,this.otherwise=ht}static parse(C,$){if(C.length<4)return $.error(`Expected at least 3 arguments, but found only ${C.length-1}.`);if(C.length%2!=0)return $.error("Expected an odd number of arguments.");let ht;$.expectedType&&$.expectedType.kind!=="value"&&(ht=$.expectedType);let Mt=[];for(let jt=1;jt$.outputDefined())&&this.otherwise.outputDefined()}}class rn{constructor(C,$,ht,Mt){this.type=C,this.input=$,this.beginIndex=ht,this.endIndex=Mt}static parse(C,$){if(C.length<=2||C.length>=5)return $.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,ue);if(!ht||!Mt)return null;if(!yt(ht.type,[Dt(vr),Me,vr]))return $.error(`Expected first argument to be of type array or string, but found ${qt(ht.type)} instead`);if(C.length===4){let Bt=$.parse(C[3],3,ue);return Bt?new rn(ht.type,ht,Mt,Bt):null}return new rn(ht.type,ht,Mt)}evaluate(C){let $=this.input.evaluate(C),ht=this.beginIndex.evaluate(C),Mt;if(this.endIndex&&(Mt=this.endIndex.evaluate(C)),St($,["string"]))return[...$].slice(ht,Mt).join("");if(St($,["array"]))return $.slice(ht,Mt);throw new ve(`Expected first argument to be of type array or string, but found ${qt(Cn($))} instead.`)}eachChild(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)}outputDefined(){return!1}}function Qr(H,C){let $=H.length-1,ht,Mt,Bt=0,jt=$,oe=0;for(;Bt<=jt;)if(oe=Math.floor((Bt+jt)/2),ht=H[oe],Mt=H[oe+1],ht<=C){if(oe===$||CC))throw new ve("Input is not a number.");jt=oe-1}return 0}class vn{constructor(C,$,ht){this.type=C,this.input=$,this.labels=[],this.outputs=[];for(let[Mt,Bt]of ht)this.labels.push(Mt),this.outputs.push(Bt)}static parse(C,$){if(C.length-1<4)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return $.error("Expected an even number of arguments.");let ht=$.parse(C[1],1,ue);if(!ht)return null;let Mt=[],Bt=null;$.expectedType&&$.expectedType.kind!=="value"&&(Bt=$.expectedType);for(let jt=1;jt=oe)return $.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Be);let lr=$.parse(be,Qe,Bt);if(!lr)return null;Bt=Bt||lr.type,Mt.push([oe,lr])}return new vn(Bt,ht,Mt)}evaluate(C){let $=this.labels,ht=this.outputs;if($.length===1)return ht[0].evaluate(C);let Mt=this.input.evaluate(C);if(Mt<=$[0])return ht[0].evaluate(C);let Bt=$.length;return Mt>=$[Bt-1]?ht[Bt-1].evaluate(C):ht[Qr($,Mt)].evaluate(C)}eachChild(C){C(this.input);for(let $ of this.outputs)C($)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function Oa(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Qn=Qa;function Qa(H,C,$,ht){this.cx=3*H,this.bx=3*($-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ht-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=C,this.p2x=$,this.p2y=ht}Qa.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,C){if(C===void 0&&(C=1e-6),H<0)return 0;if(H>1)return 1;for(var $=H,ht=0;ht<8;ht++){var Mt=this.sampleCurveX($)-H;if(Math.abs(Mt)Mt?jt=$:oe=$,$=.5*(oe-jt)+jt;return $},solve:function(H,C){return this.sampleCurveY(this.solveCurveX(H,C))}};var Ja=Oa(Qn);function wi(H,C,$){return H+$*(C-H)}function ci(H,C,$){return H.map((ht,Mt)=>wi(ht,C[Mt],$))}let Ti={number:wi,color:function(H,C,$,ht="rgb"){switch(ht){case"rgb":{let[Mt,Bt,jt,oe]=ci(H.rgb,C.rgb,$);return new tr(Mt,Bt,jt,oe,!1)}case"hcl":{let[Mt,Bt,jt,oe]=H.hcl,[be,Be,Qe,lr]=C.hcl,wr,Fr;if(isNaN(Mt)||isNaN(be))isNaN(Mt)?isNaN(be)?wr=NaN:(wr=be,jt!==1&&jt!==0||(Fr=Be)):(wr=Mt,Qe!==1&&Qe!==0||(Fr=Bt));else{let Ca=be-Mt;be>Mt&&Ca>180?Ca-=360:be180&&(Ca+=360),wr=Mt+$*Ca}let[Zr,en,yn,Vn]=(function([Ca,ua,wa,Xa]){return Ca=isNaN(Ca)?0:Ca*ar,Zn([wa,Math.cos(Ca)*ua,Math.sin(Ca)*ua,Xa])})([wr,Fr??wi(Bt,Be,$),wi(jt,Qe,$),wi(oe,lr,$)]);return new tr(Zr,en,yn,Vn,!1)}case"lab":{let[Mt,Bt,jt,oe]=Zn(ci(H.lab,C.lab,$));return new tr(Mt,Bt,jt,oe,!1)}}},array:ci,padding:function(H,C,$){return new $r(ci(H.values,C.values,$))},variableAnchorOffsetCollection:function(H,C,$){let ht=H.values,Mt=C.values;if(ht.length!==Mt.length)throw new ve(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${C.toString()}`);let Bt=[];for(let jt=0;jttypeof Qe!="number"||Qe<0||Qe>1))return $.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Mt={name:"cubic-bezier",controlPoints:Be}}}if(C.length-1<4)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return $.error("Expected an even number of arguments.");if(Bt=$.parse(Bt,2,ue),!Bt)return null;let oe=[],be=null;ht==="interpolate-hcl"||ht==="interpolate-lab"?be=We:$.expectedType&&$.expectedType.kind!=="value"&&(be=$.expectedType);for(let Be=0;Be=Qe)return $.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',wr);let Zr=$.parse(lr,Fr,be);if(!Zr)return null;be=be||Zr.type,oe.push([Qe,Zr])}return Ht(be,ue)||Ht(be,We)||Ht(be,Mr)||Ht(be,de)||Ht(be,Dt(ue))?new Ra(be,ht,Mt,Bt,oe):$.error(`Type ${qt(be)} is not interpolatable.`)}evaluate(C){let $=this.labels,ht=this.outputs;if($.length===1)return ht[0].evaluate(C);let Mt=this.input.evaluate(C);if(Mt<=$[0])return ht[0].evaluate(C);let Bt=$.length;if(Mt>=$[Bt-1])return ht[Bt-1].evaluate(C);let jt=Qr($,Mt),oe=Ra.interpolationFactor(this.interpolation,Mt,$[jt],$[jt+1]),be=ht[jt].evaluate(C),Be=ht[jt+1].evaluate(C);switch(this.operator){case"interpolate":return Ti[this.type.kind](be,Be,oe);case"interpolate-hcl":return Ti.color(be,Be,oe,"hcl");case"interpolate-lab":return Ti.color(be,Be,oe,"lab")}}eachChild(C){C(this.input);for(let $ of this.outputs)C($)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function Qi(H,C,$,ht){let Mt=ht-$,Bt=H-$;return Mt===0?0:C===1?Bt/Mt:(Math.pow(C,Bt)-1)/(Math.pow(C,Mt)-1)}class Hi{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expectected at least one argument.");let ht=null,Mt=$.expectedType;Mt&&Mt.kind!=="value"&&(ht=Mt);let Bt=[];for(let oe of C.slice(1)){let be=$.parse(oe,1+Bt.length,ht,void 0,{typeAnnotation:"omit"});if(!be)return null;ht=ht||be.type,Bt.push(be)}if(!ht)throw new Error("No output type");let jt=Mt&&Bt.some(oe=>lt(Mt,oe.type));return new Hi(jt?vr:ht,Bt)}evaluate(C){let $,ht=null,Mt=0;for(let Bt of this.args)if(Mt++,ht=Bt.evaluate(C),ht&&ht instanceof Kn&&!ht.available&&($||($=ht.name),ht=null,Mt===this.args.length&&(ht=$)),ht!==null)break;return ht}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}function Ho(H,C){return H==="=="||H==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Ci(H,C,$,ht){return ht.compare(C,$)===0}function zo(H,C,$){let ht=H!=="=="&&H!=="!=";return class j4{constructor(Bt,jt,oe){this.type=Ce,this.lhs=Bt,this.rhs=jt,this.collator=oe,this.hasUntypedArgument=Bt.type.kind==="value"||jt.type.kind==="value"}static parse(Bt,jt){if(Bt.length!==3&&Bt.length!==4)return jt.error("Expected two or three arguments.");let oe=Bt[0],be=jt.parse(Bt[1],1,vr);if(!be)return null;if(!Ho(oe,be.type))return jt.concat(1).error(`"${oe}" comparisons are not supported for type '${qt(be.type)}'.`);let Be=jt.parse(Bt[2],2,vr);if(!Be)return null;if(!Ho(oe,Be.type))return jt.concat(2).error(`"${oe}" comparisons are not supported for type '${qt(Be.type)}'.`);if(be.type.kind!==Be.type.kind&&be.type.kind!=="value"&&Be.type.kind!=="value")return jt.error(`Cannot compare types '${qt(be.type)}' and '${qt(Be.type)}'.`);ht&&(be.type.kind==="value"&&Be.type.kind!=="value"?be=new dr(Be.type,[be]):be.type.kind!=="value"&&Be.type.kind==="value"&&(Be=new dr(be.type,[Be])));let Qe=null;if(Bt.length===4){if(be.type.kind!=="string"&&Be.type.kind!=="string"&&be.type.kind!=="value"&&Be.type.kind!=="value")return jt.error("Cannot use collator to compare non-string types.");if(Qe=jt.parse(Bt[3],3,_r),!Qe)return null}return new j4(be,Be,Qe)}evaluate(Bt){let jt=this.lhs.evaluate(Bt),oe=this.rhs.evaluate(Bt);if(ht&&this.hasUntypedArgument){let be=Cn(jt),Be=Cn(oe);if(be.kind!==Be.kind||be.kind!=="string"&&be.kind!=="number")throw new ve(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${be.kind}, ${Be.kind}) instead.`)}if(this.collator&&!ht&&this.hasUntypedArgument){let be=Cn(jt),Be=Cn(oe);if(be.kind!=="string"||Be.kind!=="string")return C(Bt,jt,oe)}return this.collator?$(Bt,jt,oe,this.collator.evaluate(Bt)):C(Bt,jt,oe)}eachChild(Bt){Bt(this.lhs),Bt(this.rhs),this.collator&&Bt(this.collator)}outputDefined(){return!0}}}let qi=zo("==",function(H,C,$){return C===$},Ci),qo=zo("!=",function(H,C,$){return C!==$},function(H,C,$,ht){return!Ci(0,C,$,ht)}),Po=zo("<",function(H,C,$){return C<$},function(H,C,$,ht){return ht.compare(C,$)<0}),hs=zo(">",function(H,C,$){return C>$},function(H,C,$,ht){return ht.compare(C,$)>0}),Gi=zo("<=",function(H,C,$){return C<=$},function(H,C,$,ht){return ht.compare(C,$)<=0}),uo=zo(">=",function(H,C,$){return C>=$},function(H,C,$,ht){return ht.compare(C,$)>=0});class yi{constructor(C,$,ht){this.type=_r,this.locale=ht,this.caseSensitive=C,this.diacriticSensitive=$}static parse(C,$){if(C.length!==2)return $.error("Expected one argument.");let ht=C[1];if(typeof ht!="object"||Array.isArray(ht))return $.error("Collator options argument must be an object.");let Mt=$.parse(ht["case-sensitive"]!==void 0&&ht["case-sensitive"],1,Ce);if(!Mt)return null;let Bt=$.parse(ht["diacritic-sensitive"]!==void 0&&ht["diacritic-sensitive"],1,Ce);if(!Bt)return null;let jt=null;return ht.locale&&(jt=$.parse(ht.locale,1,Me),!jt)?null:new yi(Mt,Bt,jt)}evaluate(C){return new zr(this.caseSensitive.evaluate(C),this.diacriticSensitive.evaluate(C),this.locale?this.locale.evaluate(C):null)}eachChild(C){C(this.caseSensitive),C(this.diacriticSensitive),this.locale&&C(this.locale)}outputDefined(){return!1}}class ao{constructor(C,$,ht,Mt,Bt){this.type=Me,this.number=C,this.locale=$,this.currency=ht,this.minFractionDigits=Mt,this.maxFractionDigits=Bt}static parse(C,$){if(C.length!==3)return $.error("Expected two arguments.");let ht=$.parse(C[1],1,ue);if(!ht)return null;let Mt=C[2];if(typeof Mt!="object"||Array.isArray(Mt))return $.error("NumberFormat options argument must be an object.");let Bt=null;if(Mt.locale&&(Bt=$.parse(Mt.locale,1,Me),!Bt))return null;let jt=null;if(Mt.currency&&(jt=$.parse(Mt.currency,1,Me),!jt))return null;let oe=null;if(Mt["min-fraction-digits"]&&(oe=$.parse(Mt["min-fraction-digits"],1,ue),!oe))return null;let be=null;return Mt["max-fraction-digits"]&&(be=$.parse(Mt["max-fraction-digits"],1,ue),!be)?null:new ao(ht,Bt,jt,oe,be)}evaluate(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))}eachChild(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)}outputDefined(){return!1}}class ts{constructor(C){this.type=er,this.sections=C}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht=C[1];if(!Array.isArray(ht)&&typeof ht=="object")return $.error("First argument must be an image or text section.");let Mt=[],Bt=!1;for(let jt=1;jt<=C.length-1;++jt){let oe=C[jt];if(Bt&&typeof oe=="object"&&!Array.isArray(oe)){Bt=!1;let be=null;if(oe["font-scale"]&&(be=$.parse(oe["font-scale"],1,ue),!be))return null;let Be=null;if(oe["text-font"]&&(Be=$.parse(oe["text-font"],1,Dt(Me)),!Be))return null;let Qe=null;if(oe["text-color"]&&(Qe=$.parse(oe["text-color"],1,We),!Qe))return null;let lr=Mt[Mt.length-1];lr.scale=be,lr.font=Be,lr.textColor=Qe}else{let be=$.parse(C[jt],1,vr);if(!be)return null;let Be=be.type.kind;if(Be!=="string"&&Be!=="value"&&Be!=="null"&&Be!=="resolvedImage")return $.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Bt=!0,Mt.push({content:be,scale:null,font:null,textColor:null})}}return new ts(Mt)}evaluate(C){return new Yr(this.sections.map($=>{let ht=$.content.evaluate(C);return Cn(ht)===Ir?new tn("",ht,null,null,null):new tn(Fa(ht),null,$.scale?$.scale.evaluate(C):null,$.font?$.font.evaluate(C).join(","):null,$.textColor?$.textColor.evaluate(C):null)}))}eachChild(C){for(let $ of this.sections)C($.content),$.scale&&C($.scale),$.font&&C($.font),$.textColor&&C($.textColor)}outputDefined(){return!1}}class vs{constructor(C){this.type=Ir,this.input=C}static parse(C,$){if(C.length!==2)return $.error("Expected two arguments.");let ht=$.parse(C[1],1,Me);return ht?new vs(ht):$.error("No image name provided.")}evaluate(C){let $=this.input.evaluate(C),ht=Kn.fromString($);return ht&&C.availableImages&&(ht.available=C.availableImages.indexOf($)>-1),ht}eachChild(C){C(this.input)}outputDefined(){return!1}}class As{constructor(C){this.type=ue,this.input=C}static parse(C,$){if(C.length!==2)return $.error(`Expected 1 argument, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1);return ht?ht.type.kind!=="array"&&ht.type.kind!=="string"&&ht.type.kind!=="value"?$.error(`Expected argument of type string or array, but found ${qt(ht.type)} instead.`):new As(ht):null}evaluate(C){let $=this.input.evaluate(C);if(typeof $=="string")return[...$].length;if(Array.isArray($))return $.length;throw new ve(`Expected value to be of type string or array, but found ${qt(Cn($))} instead.`)}eachChild(C){C(this.input)}outputDefined(){return!1}}let _o=8192;function Da(H,C){let $=(180+H[0])/360,ht=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Mt=Math.pow(2,C.z);return[Math.round($*Mt*_o),Math.round(ht*Mt*_o)]}function li(H,C){let $=Math.pow(2,C.z);return[(Mt=(H[0]/_o+C.x)/$,360*Mt-180),(ht=(H[1]/_o+C.y)/$,360/Math.PI*Math.atan(Math.exp((180-360*ht)*Math.PI/180))-90)];var ht,Mt}function wo(H,C){H[0]=Math.min(H[0],C[0]),H[1]=Math.min(H[1],C[1]),H[2]=Math.max(H[2],C[0]),H[3]=Math.max(H[3],C[1])}function Ms(H,C){return!(H[0]<=C[0]||H[2]>=C[2]||H[1]<=C[1]||H[3]>=C[3])}function Di(H,C,$){let ht=H[0]-C[0],Mt=H[1]-C[1],Bt=H[0]-$[0],jt=H[1]-$[1];return ht*jt-Bt*Mt==0&&ht*Bt<=0&&Mt*jt<=0}function _s(H,C,$,ht){return(Mt=[ht[0]-$[0],ht[1]-$[1]])[0]*(Bt=[C[0]-H[0],C[1]-H[1]])[1]-Mt[1]*Bt[0]!=0&&!(!co(H,C,$,ht)||!co($,ht,H,C));var Mt,Bt}function No(H,C,$){for(let ht of $)for(let Mt=0;Mt(Mt=H)[1]!=(jt=oe[be+1])[1]>Mt[1]&&Mt[0]<(jt[0]-Bt[0])*(Mt[1]-Bt[1])/(jt[1]-Bt[1])+Bt[0]&&(ht=!ht)}var Mt,Bt,jt;return ht}function al(H,C){for(let $ of C)if(is(H,$))return!0;return!1}function ii(H,C){for(let $ of H)if(!is($,C))return!1;for(let $=0;$0&&oe<0||jt<0&&oe>0}function Is(H,C,$){let ht=[];for(let Mt=0;Mt$[2]){let Mt=.5*ht,Bt=H[0]-$[0]>Mt?-ht:$[0]-H[0]>Mt?ht:0;Bt===0&&(Bt=H[0]-$[2]>Mt?-ht:$[2]-H[0]>Mt?ht:0),H[0]+=Bt}wo(C,H)}function $s(H,C,$,ht){let Mt=Math.pow(2,ht.z)*_o,Bt=[ht.x*_o,ht.y*_o],jt=[];for(let oe of H)for(let be of oe){let Be=[be.x+Bt[0],be.y+Bt[1]];Bi(Be,C,$,Mt),jt.push(Be)}return jt}function fl(H,C,$,ht){let Mt=Math.pow(2,ht.z)*_o,Bt=[ht.x*_o,ht.y*_o],jt=[];for(let be of H){let Be=[];for(let Qe of be){let lr=[Qe.x+Bt[0],Qe.y+Bt[1]];wo(C,lr),Be.push(lr)}jt.push(Be)}if(C[2]-C[0]<=Mt/2){(oe=C)[0]=oe[1]=1/0,oe[2]=oe[3]=-1/0;for(let be of jt)for(let Be of be)Bi(Be,C,$,Mt)}var oe;return jt}class Jo{constructor(C,$){this.type=Ce,this.geojson=C,this.geometries=$}static parse(C,$){if(C.length!==2)return $.error(`'within' expression requires exactly one argument, but found ${C.length-1} instead.`);if(ia(C[1])){let ht=C[1];if(ht.type==="FeatureCollection"){let Mt=[];for(let Bt of ht.features){let{type:jt,coordinates:oe}=Bt.geometry;jt==="Polygon"&&Mt.push(oe),jt==="MultiPolygon"&&Mt.push(...oe)}if(Mt.length)return new Jo(ht,{type:"MultiPolygon",coordinates:Mt})}else if(ht.type==="Feature"){let Mt=ht.geometry.type;if(Mt==="Polygon"||Mt==="MultiPolygon")return new Jo(ht,ht.geometry)}else if(ht.type==="Polygon"||ht.type==="MultiPolygon")return new Jo(ht,ht)}return $.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return(function($,ht){let Mt=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=$.canonicalID();if(ht.type==="Polygon"){let oe=Is(ht.coordinates,Bt,jt),be=$s($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!is(Be,oe))return!1}if(ht.type==="MultiPolygon"){let oe=Wo(ht.coordinates,Bt,jt),be=$s($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!al(Be,oe))return!1}return!0})(C,this.geometries);if(C.geometryType()==="LineString")return(function($,ht){let Mt=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=$.canonicalID();if(ht.type==="Polygon"){let oe=Is(ht.coordinates,Bt,jt),be=fl($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!ii(Be,oe))return!1}if(ht.type==="MultiPolygon"){let oe=Wo(ht.coordinates,Bt,jt),be=fl($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!io(Be,oe))return!1}return!0})(C,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let us=class{constructor(H=[],C=($,ht)=>$ht?1:0){if(this.data=H,this.length=this.data.length,this.compare=C,this.length>0)for(let $=(this.length>>1)-1;$>=0;$--)this._down($)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;let H=this.data[0],C=this.data.pop();return--this.length>0&&(this.data[0]=C,this._down(0)),H}peek(){return this.data[0]}_up(H){let{data:C,compare:$}=this,ht=C[H];for(;H>0;){let Mt=H-1>>1,Bt=C[Mt];if($(ht,Bt)>=0)break;C[H]=Bt,H=Mt}C[H]=ht}_down(H){let{data:C,compare:$}=this,ht=this.length>>1,Mt=C[H];for(;H=0)break;C[H]=C[Bt],H=Bt}C[H]=Mt}};function Ss(H,C,$,ht,Mt){Ls(H,C,$,ht||H.length-1,Mt||bu)}function Ls(H,C,$,ht,Mt){for(;ht>$;){if(ht-$>600){var Bt=ht-$+1,jt=C-$+1,oe=Math.log(Bt),be=.5*Math.exp(2*oe/3),Be=.5*Math.sqrt(oe*be*(Bt-be)/Bt)*(jt-Bt/2<0?-1:1);Ls(H,C,Math.max($,Math.floor(C-jt*be/Bt+Be)),Math.min(ht,Math.floor(C+(Bt-jt)*be/Bt+Be)),Mt)}var Qe=H[C],lr=$,wr=ht;for(xl(H,$,C),Mt(H[ht],Qe)>0&&xl(H,$,ht);lr0;)wr--}Mt(H[$],Qe)===0?xl(H,$,wr):xl(H,++wr,ht),wr<=C&&($=wr+1),C<=wr&&(ht=wr-1)}}function xl(H,C,$){var ht=H[C];H[C]=H[$],H[$]=ht}function bu(H,C){return HC?1:0}function au(H,C){if(H.length<=1)return[H];let $=[],ht,Mt;for(let Bt of H){let jt=Ec(Bt);jt!==0&&(Bt.area=Math.abs(jt),Mt===void 0&&(Mt=jt<0),Mt===jt<0?(ht&&$.push(ht),ht=[Bt]):ht.push(Bt))}if(ht&&$.push(ht),C>1)for(let Bt=0;Bt<$.length;Bt++)$[Bt].length<=C||(Ss($[Bt],C,1,$[Bt].length-1,fu),$[Bt]=$[Bt].slice(0,C));return $}function fu(H,C){return C.area-H.area}function Ec(H){let C=0;for(let $,ht,Mt=0,Bt=H.length,jt=Bt-1;Mt1?(Be=C[be+1][0],Qe=C[be+1][1]):Fr>0&&(Be+=lr/this.kx*Fr,Qe+=wr/this.ky*Fr)),lr=this.wrap($[0]-Be)*this.kx,wr=($[1]-Qe)*this.ky;let Zr=lr*lr+wr*wr;Zr180;)C-=360;return C}}function Al(H,C){return C[0]-H[0]}function _l(H){return H[1]-H[0]+1}function Ml(H,C){return H[1]>=H[0]&&H[1]H[1])return[null,null];let $=_l(H);if(C){if($===2)return[H,null];let Mt=Math.floor($/2);return[[H[0],H[0]+Mt],[H[0]+Mt,H[1]]]}if($===1)return[H,null];let ht=Math.floor($/2)-1;return[[H[0],H[0]+ht],[H[0]+ht+1,H[1]]]}function Fs(H,C){if(!Ml(C,H.length))return[1/0,1/0,-1/0,-1/0];let $=[1/0,1/0,-1/0,-1/0];for(let ht=C[0];ht<=C[1];++ht)wo($,H[ht]);return $}function bl(H){let C=[1/0,1/0,-1/0,-1/0];for(let $ of H)for(let ht of $)wo(C,ht);return C}function Fo(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function bs(H,C,$){if(!Fo(H)||!Fo(C))return NaN;let ht=0,Mt=0;return H[2]C[2]&&(ht=H[0]-C[2]),H[1]>C[3]&&(Mt=H[1]-C[3]),H[3]=ht)return ht;if(Ms(Mt,Bt)){if(yf(H,C))return 0}else if(yf(C,H))return 0;let jt=1/0;for(let oe of H)for(let be=0,Be=oe.length,Qe=Be-1;be0;){let be=jt.pop();if(be[0]>=Bt)continue;let Be=be[1],Qe=C?50:100;if(_l(Be)<=Qe){if(!Ml(Be,H.length))return NaN;if(C){let lr=Oo(H,Be,$,ht);if(isNaN(lr)||lr===0)return lr;Bt=Math.min(Bt,lr)}else for(let lr=Be[0];lr<=Be[1];++lr){let wr=sf(H[lr],$,ht);if(Bt=Math.min(Bt,wr),Bt===0)return 0}}else{let lr=hu(Be,C);Fi(jt,Bt,ht,H,oe,lr[0]),Fi(jt,Bt,ht,H,oe,lr[1])}}return Bt}function ml(H,C,$,ht,Mt,Bt=1/0){let jt=Math.min(Bt,Mt.distance(H[0],$[0]));if(jt===0)return jt;let oe=new us([[0,[0,H.length-1],[0,$.length-1]]],Al);for(;oe.length>0;){let be=oe.pop();if(be[0]>=jt)continue;let Be=be[1],Qe=be[2],lr=C?50:100,wr=ht?50:100;if(_l(Be)<=lr&&_l(Qe)<=wr){if(!Ml(Be,H.length)&&Ml(Qe,$.length))return NaN;let Fr;if(C&&ht)Fr=Hu(H,Be,$,Qe,Mt),jt=Math.min(jt,Fr);else if(C&&!ht){let Zr=H.slice(Be[0],Be[1]+1);for(let en=Qe[0];en<=Qe[1];++en)if(Fr=Iu($[en],Zr,Mt),jt=Math.min(jt,Fr),jt===0)return jt}else if(!C&&ht){let Zr=$.slice(Qe[0],Qe[1]+1);for(let en=Be[0];en<=Be[1];++en)if(Fr=Iu(H[en],Zr,Mt),jt=Math.min(jt,Fr),jt===0)return jt}else Fr=qs(H,Be,$,Qe,Mt),jt=Math.min(jt,Fr)}else{let Fr=hu(Be,C),Zr=hu(Qe,ht);nc(oe,jt,Mt,H,$,Fr[0],Zr[0]),nc(oe,jt,Mt,H,$,Fr[0],Zr[1]),nc(oe,jt,Mt,H,$,Fr[1],Zr[0]),nc(oe,jt,Mt,H,$,Fr[1],Zr[1])}}return jt}function Lc(H){return H.type==="MultiPolygon"?H.coordinates.map(C=>({type:"Polygon",coordinates:C})):H.type==="MultiLineString"?H.coordinates.map(C=>({type:"LineString",coordinates:C})):H.type==="MultiPoint"?H.coordinates.map(C=>({type:"Point",coordinates:C})):[H]}class qu{constructor(C,$){this.type=ue,this.geojson=C,this.geometries=$}static parse(C,$){if(C.length!==2)return $.error(`'distance' expression requires exactly one argument, but found ${C.length-1} instead.`);if(ia(C[1])){let ht=C[1];if(ht.type==="FeatureCollection")return new qu(ht,ht.features.map(Mt=>Lc(Mt.geometry)).flat());if(ht.type==="Feature")return new qu(ht,Lc(ht.geometry));if("type"in ht&&"coordinates"in ht)return new qu(ht,Lc(ht))}return $.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return(function($,ht){let Mt=$.geometry(),Bt=Mt.flat().map(be=>li([be.x,be.y],$.canonical));if(Mt.length===0)return NaN;let jt=new zc(Bt[0][1]),oe=1/0;for(let be of ht){switch(be.type){case"Point":oe=Math.min(oe,ml(Bt,!1,[be.coordinates],!1,jt,oe));break;case"LineString":oe=Math.min(oe,ml(Bt,!1,be.coordinates,!0,jt,oe));break;case"Polygon":oe=Math.min(oe,pu(Bt,!1,be.coordinates,jt,oe))}if(oe===0)return oe}return oe})(C,this.geometries);if(C.geometryType()==="LineString")return(function($,ht){let Mt=$.geometry(),Bt=Mt.flat().map(be=>li([be.x,be.y],$.canonical));if(Mt.length===0)return NaN;let jt=new zc(Bt[0][1]),oe=1/0;for(let be of ht){switch(be.type){case"Point":oe=Math.min(oe,ml(Bt,!0,[be.coordinates],!1,jt,oe));break;case"LineString":oe=Math.min(oe,ml(Bt,!0,be.coordinates,!0,jt,oe));break;case"Polygon":oe=Math.min(oe,pu(Bt,!0,be.coordinates,jt,oe))}if(oe===0)return oe}return oe})(C,this.geometries);if(C.geometryType()==="Polygon")return(function($,ht){let Mt=$.geometry();if(Mt.length===0||Mt[0].length===0)return NaN;let Bt=au(Mt,0).map(be=>be.map(Be=>Be.map(Qe=>li([Qe.x,Qe.y],$.canonical)))),jt=new zc(Bt[0][0][0][1]),oe=1/0;for(let be of ht)for(let Be of Bt){switch(be.type){case"Point":oe=Math.min(oe,pu([be.coordinates],!1,Be,jt,oe));break;case"LineString":oe=Math.min(oe,pu(be.coordinates,!0,Be,jt,oe));break;case"Polygon":oe=Math.min(oe,os(Be,be.coordinates,jt,oe))}if(oe===0)return oe}return oe})(C,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let dc={"==":qi,"!=":qo,">":hs,"<":Po,">=":uo,"<=":Gi,array:dr,at:Ke,boolean:dr,case:wn,coalesce:Hi,collator:yi,format:ts,image:vs,in:xr,"index-of":Gr,interpolate:Ra,"interpolate-hcl":Ra,"interpolate-lab":Ra,length:As,let:Or,literal:Ga,match:ln,number:dr,"number-format":ao,object:dr,slice:rn,step:vn,string:dr,"to-boolean":Tr,"to-color":Tr,"to-number":Tr,"to-string":Tr,var:pe,within:Jo,distance:qu};class wl{constructor(C,$,ht,Mt){this.name=C,this.type=$,this._evaluate=ht,this.args=Mt}evaluate(C){return this._evaluate(C,this.args)}eachChild(C){this.args.forEach(C)}outputDefined(){return!1}static parse(C,$){let ht=C[0],Mt=wl.definitions[ht];if(!Mt)return $.error(`Unknown expression "${ht}". If you wanted a literal array, use ["literal", [...]].`,0);let Bt=Array.isArray(Mt)?Mt[0]:Mt.type,jt=Array.isArray(Mt)?[[Mt[1],Mt[2]]]:Mt.overloads,oe=jt.filter(([Be])=>!Array.isArray(Be)||Be.length===C.length-1),be=null;for(let[Be,Qe]of oe){be=new Ur($.registry,Cc,$.path,null,$.scope);let lr=[],wr=!1;for(let Fr=1;Fr{return wr=lr,Array.isArray(wr)?`(${wr.map(qt).join(", ")})`:`(${qt(wr.type)}...)`;var wr}).join(" | "),Qe=[];for(let lr=1;lr{$=C?$&&Cc(ht):$&&ht instanceof Ga}),!!$&&Ic(H)&&Bc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ic(H){if(H instanceof wl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof Jo||H instanceof qu)return!1;let C=!0;return H.eachChild($=>{C&&!Ic($)&&(C=!1)}),C}function du(H){if(H instanceof wl&&H.name==="feature-state")return!1;let C=!0;return H.eachChild($=>{C&&!du($)&&(C=!1)}),C}function Bc(H,C){if(H instanceof wl&&C.indexOf(H.name)>=0)return!1;let $=!0;return H.eachChild(ht=>{$&&!Bc(ht,C)&&($=!1)}),$}function Pu(H){return{result:"success",value:H}}function wu(H){return{result:"error",value:H}}function Tl(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Ju(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function Pc(H){return!!H.expression&&H.expression.interpolated}function Es(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function _c(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function lf(H){return H}function Rc(H,C){let $=C.type==="color",ht=H.stops&&typeof H.stops[0][0]=="object",Mt=ht||!(ht||H.property!==void 0),Bt=H.type||(Pc(C)?"exponential":"interval");if($||C.type==="padding"){let Qe=$?tr.parse:$r.parse;(H=vt({},H)).stops&&(H.stops=H.stops.map(lr=>[lr[0],Qe(lr[1])])),H.default=Qe(H.default?H.default:C.default)}if(H.colorSpace&&(jt=H.colorSpace)!=="rgb"&&jt!=="hcl"&&jt!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var jt;let oe,be,Be;if(Bt==="exponential")oe=jc;else if(Bt==="interval")oe=Zl;else if(Bt==="categorical"){oe=Nc,be=Object.create(null);for(let Qe of H.stops)be[Qe[0]]=Qe[1];Be=typeof H.stops[0][0]}else{if(Bt!=="identity")throw new Error(`Unknown function type "${Bt}"`);oe=rl}if(ht){let Qe={},lr=[];for(let Zr=0;ZrZr[0]),evaluate:({zoom:Zr},en)=>jc({stops:wr,base:H.base},C,Zr).evaluate(Zr,en)}}if(Mt){let Qe=Bt==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:Qe,interpolationFactor:Ra.interpolationFactor.bind(void 0,Qe),zoomStops:H.stops.map(lr=>lr[0]),evaluate:({zoom:lr})=>oe(H,C,lr,be,Be)}}return{kind:"source",evaluate(Qe,lr){let wr=lr&&lr.properties?lr.properties[H.property]:void 0;return wr===void 0?gc(H.default,C.default):oe(H,C,wr,be,Be)}}}function gc(H,C,$){return H!==void 0?H:C!==void 0?C:$!==void 0?$:void 0}function Nc(H,C,$,ht,Mt){return gc(typeof $===Mt?ht[$]:void 0,H.default,C.default)}function Zl(H,C,$){if(Es($)!=="number")return gc(H.default,C.default);let ht=H.stops.length;if(ht===1||$<=H.stops[0][0])return H.stops[0][1];if($>=H.stops[ht-1][0])return H.stops[ht-1][1];let Mt=Qr(H.stops.map(Bt=>Bt[0]),$);return H.stops[Mt][1]}function jc(H,C,$){let ht=H.base!==void 0?H.base:1;if(Es($)!=="number")return gc(H.default,C.default);let Mt=H.stops.length;if(Mt===1||$<=H.stops[0][0])return H.stops[0][1];if($>=H.stops[Mt-1][0])return H.stops[Mt-1][1];let Bt=Qr(H.stops.map(Qe=>Qe[0]),$),jt=(function(Qe,lr,wr,Fr){let Zr=Fr-wr,en=Qe-wr;return Zr===0?0:lr===1?en/Zr:(Math.pow(lr,en)-1)/(Math.pow(lr,Zr)-1)})($,ht,H.stops[Bt][0],H.stops[Bt+1][0]),oe=H.stops[Bt][1],be=H.stops[Bt+1][1],Be=Ti[C.type]||lf;return typeof oe.evaluate=="function"?{evaluate(...Qe){let lr=oe.evaluate.apply(void 0,Qe),wr=be.evaluate.apply(void 0,Qe);if(lr!==void 0&&wr!==void 0)return Be(lr,wr,jt,H.colorSpace)}}:Be(oe,be,jt,H.colorSpace)}function rl(H,C,$){switch(C.type){case"color":$=tr.parse($);break;case"formatted":$=Yr.fromString($.toString());break;case"resolvedImage":$=Kn.fromString($.toString());break;case"padding":$=$r.parse($);break;default:Es($)===C.type||C.type==="enum"&&C.values[$]||($=void 0)}return gc($,H.default,C.default)}wl.register(dc,{error:[{kind:"error"},[Me],(H,[C])=>{throw new ve(C.evaluate(H))}],typeof:[Me,[vr],(H,[C])=>qt(Cn(C.evaluate(H)))],"to-rgba":[Dt(ue,4),[We],(H,[C])=>{let[$,ht,Mt,Bt]=C.evaluate(H).rgb;return[255*$,255*ht,255*Mt,Bt]}],rgb:[We,[ue,ue,ue],Yc],rgba:[We,[ue,ue,ue,ue],Yc],has:{type:Ce,overloads:[[[Me],(H,[C])=>Fc(C.evaluate(H),H.properties())],[[Me,qe],(H,[C,$])=>Fc(C.evaluate(H),$.evaluate(H))]]},get:{type:vr,overloads:[[[Me],(H,[C])=>mc(C.evaluate(H),H.properties())],[[Me,qe],(H,[C,$])=>mc(C.evaluate(H),$.evaluate(H))]]},"feature-state":[vr,[Me],(H,[C])=>mc(C.evaluate(H),H.featureState||{})],properties:[qe,[],H=>H.properties()],"geometry-type":[Me,[],H=>H.geometryType()],id:[vr,[],H=>H.id()],zoom:[ue,[],H=>H.globals.zoom],"heatmap-density":[ue,[],H=>H.globals.heatmapDensity||0],"line-progress":[ue,[],H=>H.globals.lineProgress||0],accumulated:[vr,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[ue,Wu(ue),(H,C)=>{let $=0;for(let ht of C)$+=ht.evaluate(H);return $}],"*":[ue,Wu(ue),(H,C)=>{let $=1;for(let ht of C)$*=ht.evaluate(H);return $}],"-":{type:ue,overloads:[[[ue,ue],(H,[C,$])=>C.evaluate(H)-$.evaluate(H)],[[ue],(H,[C])=>-C.evaluate(H)]]},"/":[ue,[ue,ue],(H,[C,$])=>C.evaluate(H)/$.evaluate(H)],"%":[ue,[ue,ue],(H,[C,$])=>C.evaluate(H)%$.evaluate(H)],ln2:[ue,[],()=>Math.LN2],pi:[ue,[],()=>Math.PI],e:[ue,[],()=>Math.E],"^":[ue,[ue,ue],(H,[C,$])=>Math.pow(C.evaluate(H),$.evaluate(H))],sqrt:[ue,[ue],(H,[C])=>Math.sqrt(C.evaluate(H))],log10:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))/Math.LN10],ln:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))],log2:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))/Math.LN2],sin:[ue,[ue],(H,[C])=>Math.sin(C.evaluate(H))],cos:[ue,[ue],(H,[C])=>Math.cos(C.evaluate(H))],tan:[ue,[ue],(H,[C])=>Math.tan(C.evaluate(H))],asin:[ue,[ue],(H,[C])=>Math.asin(C.evaluate(H))],acos:[ue,[ue],(H,[C])=>Math.acos(C.evaluate(H))],atan:[ue,[ue],(H,[C])=>Math.atan(C.evaluate(H))],min:[ue,Wu(ue),(H,C)=>Math.min(...C.map($=>$.evaluate(H)))],max:[ue,Wu(ue),(H,C)=>Math.max(...C.map($=>$.evaluate(H)))],abs:[ue,[ue],(H,[C])=>Math.abs(C.evaluate(H))],round:[ue,[ue],(H,[C])=>{let $=C.evaluate(H);return $<0?-Math.round(-$):Math.round($)}],floor:[ue,[ue],(H,[C])=>Math.floor(C.evaluate(H))],ceil:[ue,[ue],(H,[C])=>Math.ceil(C.evaluate(H))],"filter-==":[Ce,[Me,vr],(H,[C,$])=>H.properties()[C.value]===$.value],"filter-id-==":[Ce,[vr],(H,[C])=>H.id()===C.value],"filter-type-==":[Ce,[Me],(H,[C])=>H.geometryType()===C.value],"filter-<":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht>Mt}],"filter-id->":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$>ht}],"filter-<=":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht<=Mt}],"filter-id-<=":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$<=ht}],"filter->=":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht>=Mt}],"filter-id->=":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$>=ht}],"filter-has":[Ce,[vr],(H,[C])=>C.value in H.properties()],"filter-has-id":[Ce,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[Ce,[Dt(Me)],(H,[C])=>C.value.indexOf(H.geometryType())>=0],"filter-id-in":[Ce,[Dt(vr)],(H,[C])=>C.value.indexOf(H.id())>=0],"filter-in-small":[Ce,[Me,Dt(vr)],(H,[C,$])=>$.value.indexOf(H.properties()[C.value])>=0],"filter-in-large":[Ce,[Me,Dt(vr)],(H,[C,$])=>(function(ht,Mt,Bt,jt){for(;Bt<=jt;){let oe=Bt+jt>>1;if(Mt[oe]===ht)return!0;Mt[oe]>ht?jt=oe-1:Bt=oe+1}return!1})(H.properties()[C.value],$.value,0,$.value.length-1)],all:{type:Ce,overloads:[[[Ce,Ce],(H,[C,$])=>C.evaluate(H)&&$.evaluate(H)],[Wu(Ce),(H,C)=>{for(let $ of C)if(!$.evaluate(H))return!1;return!0}]]},any:{type:Ce,overloads:[[[Ce,Ce],(H,[C,$])=>C.evaluate(H)||$.evaluate(H)],[Wu(Ce),(H,C)=>{for(let $ of C)if($.evaluate(H))return!0;return!1}]]},"!":[Ce,[Ce],(H,[C])=>!C.evaluate(H)],"is-supported-script":[Ce,[Me],(H,[C])=>{let $=H.globals&&H.globals.isSupportedScript;return!$||$(C.evaluate(H))}],upcase:[Me,[Me],(H,[C])=>C.evaluate(H).toUpperCase()],downcase:[Me,[Me],(H,[C])=>C.evaluate(H).toLowerCase()],concat:[Me,Wu(vr),(H,C)=>C.map($=>Fa($.evaluate(H))).join("")],"resolved-locale":[Me,[_r],(H,[C])=>C.evaluate(H).resolvedLocale()]});class Kl{constructor(C,$){var ht;this.expression=C,this._warningHistory={},this._evaluator=new kr,this._defaultValue=$?(ht=$).type==="color"&&_c(ht.default)?new tr(0,0,0,0):ht.type==="color"?tr.parse(ht.default)||null:ht.type==="padding"?$r.parse(ht.default)||null:ht.type==="variableAnchorOffsetCollection"?Nn.parse(ht.default)||null:ht.default===void 0?null:ht.default:null,this._enumValues=$&&$.type==="enum"?$.values:null}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._evaluator.globals=C,this._evaluator.feature=$,this._evaluator.featureState=ht,this._evaluator.canonical=Mt,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt,this.expression.evaluate(this._evaluator)}evaluate(C,$,ht,Mt,Bt,jt){this._evaluator.globals=C,this._evaluator.feature=$||null,this._evaluator.featureState=ht||null,this._evaluator.canonical=Mt,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt||null;try{let oe=this.expression.evaluate(this._evaluator);if(oe==null||typeof oe=="number"&&oe!=oe)return this._defaultValue;if(this._enumValues&&!(oe in this._enumValues))throw new ve(`Expected value to be one of ${Object.keys(this._enumValues).map(be=>JSON.stringify(be)).join(", ")}, but found ${JSON.stringify(oe)} instead.`);return oe}catch(oe){return this._warningHistory[oe.message]||(this._warningHistory[oe.message]=!0,typeof console<"u"&&console.warn(oe.message)),this._defaultValue}}}function Gu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in dc}function Bs(H,C){let $=new Ur(dc,Cc,[],C?(function(Mt){let Bt={color:We,string:Me,number:ue,enum:Me,boolean:Ce,formatted:er,padding:Mr,resolvedImage:Ir,variableAnchorOffsetCollection:de};return Mt.type==="array"?Dt(Bt[Mt.value]||vr,Mt.length):Bt[Mt.type]})(C):void 0),ht=$.parse(H,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ht?Pu(new Kl(ht,C)):wu($.errors)}class Ou{constructor(C,$){this.kind=C,this._styleExpression=$,this.isStateDependent=C!=="constant"&&!du($.expression)}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt)}evaluate(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluate(C,$,ht,Mt,Bt,jt)}}class Rl{constructor(C,$,ht,Mt){this.kind=C,this.zoomStops=ht,this._styleExpression=$,this.isStateDependent=C!=="camera"&&!du($.expression),this.interpolationType=Mt}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt)}evaluate(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluate(C,$,ht,Mt,Bt,jt)}interpolationFactor(C,$,ht){return this.interpolationType?Ra.interpolationFactor(this.interpolationType,C,$,ht):0}}function Yl(H,C){let $=Bs(H,C);if($.result==="error")return $;let ht=$.value.expression,Mt=Ic(ht);if(!Mt&&!Tl(C))return wu([new Ut("","data expressions not supported")]);let Bt=Bc(ht,["zoom"]);if(!Bt&&!Ju(C))return wu([new Ut("","zoom expressions not supported")]);let jt=ac(ht);return jt||Bt?jt instanceof Ut?wu([jt]):jt instanceof Ra&&!Pc(C)?wu([new Ut("",'"interpolate" expressions cannot be used with this property')]):Pu(jt?new Rl(Mt?"camera":"composite",$.value,jt.labels,jt instanceof Ra?jt.interpolation:void 0):new Ou(Mt?"constant":"source",$.value)):wu([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ws{constructor(C,$){this._parameters=C,this._specification=$,vt(this,Rc(this._parameters,this._specification))}static deserialize(C){return new Ws(C._parameters,C._specification)}static serialize(C){return{_parameters:C._parameters,_specification:C._specification}}}function ac(H){let C=null;if(H instanceof Or)C=ac(H.result);else if(H instanceof Hi){for(let $ of H.args)if(C=ac($),C)break}else(H instanceof vn||H instanceof Ra)&&H.input instanceof wl&&H.input.name==="zoom"&&(C=H);return C instanceof Ut||H.eachChild($=>{let ht=ac($);ht instanceof Ut?C=ht:!C&&ht?C=new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):C&&ht&&C!==ht&&(C=new Ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),C}function Tu(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(let C of H.slice(1))if(!Tu(C)&&typeof C!="boolean")return!1;return!0;default:return!0}}let Zu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bc(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Tu(H)||(H=ic(H));let C=Bs(H,Zu);if(C.result==="error")throw new Error(C.value.map($=>`${$.key}: ${$.message}`).join(", "));return{filter:($,ht,Mt)=>C.value.evaluate($,ht,{},Mt),needGeometry:Sf(H)}}function uf(H,C){return HC?1:0}function Sf(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let C=1;C"||C==="<="||C===">="?wc(H[1],H[2],C):C==="any"?($=H.slice(1),["any"].concat($.map(ic))):C==="all"?["all"].concat(H.slice(1).map(ic)):C==="none"?["all"].concat(H.slice(1).map(ic).map(iu)):C==="in"?Fl(H[1],H.slice(2)):C==="!in"?iu(Fl(H[1],H.slice(2))):C==="has"?oc(H[1]):C!=="!has"||iu(oc(H[1]));var $}function wc(H,C,$){switch(H){case"$type":return[`filter-type-${$}`,C];case"$id":return[`filter-id-${$}`,C];default:return[`filter-${$}`,H,C]}}function Fl(H,C){if(C.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some($=>typeof $!=typeof C[0])?["filter-in-large",H,["literal",C.sort(uf)]]:["filter-in-small",H,["literal",C]]}}function oc(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function iu(H){return["!",H]}function sc(H){let C=typeof H;if(C==="number"||C==="boolean"||C==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Mt="[";for(let Bt of H)Mt+=`${sc(Bt)},`;return`${Mt}]`}let $=Object.keys(H).sort(),ht="{";for(let Mt=0;Mt<$.length;Mt++)ht+=`${JSON.stringify($[Mt])}:${sc(H[$[Mt]])},`;return`${ht}}`}function Tc(H){let C="";for(let $ of dt)C+=`/${sc(H[$])}`;return C}function ku(H){let C=H.value;return C?[new bt(H.key,C,"constants have been deprecated as of v8")]:[]}function Gs(H){return H instanceof Number||H instanceof String||H instanceof Boolean?H.valueOf():H}function Du(H){if(Array.isArray(H))return H.map(Du);if(H instanceof Object&&!(H instanceof Number||H instanceof String||H instanceof Boolean)){let C={};for(let $ in H)C[$]=Du(H[$]);return C}return Gs(H)}function Xl(H){let C=H.key,$=H.value,ht=H.valueSpec||{},Mt=H.objectElementValidators||{},Bt=H.style,jt=H.styleSpec,oe=H.validateSpec,be=[],Be=Es($);if(Be!=="object")return[new bt(C,$,`object expected, ${Be} found`)];for(let Qe in $){let lr=Qe.split(".")[0],wr=ht[lr]||ht["*"],Fr;if(Mt[lr])Fr=Mt[lr];else if(ht[lr])Fr=oe;else if(Mt["*"])Fr=Mt["*"];else{if(!ht["*"]){be.push(new bt(C,$[Qe],`unknown property "${Qe}"`));continue}Fr=oe}be=be.concat(Fr({key:(C&&`${C}.`)+Qe,value:$[Qe],valueSpec:wr,style:Bt,styleSpec:jt,object:$,objectKey:Qe,validateSpec:oe},$))}for(let Qe in ht)Mt[Qe]||ht[Qe].required&&ht[Qe].default===void 0&&$[Qe]===void 0&&be.push(new bt(C,$,`missing required property "${Qe}"`));return be}function Xc(H){let C=H.value,$=H.valueSpec,ht=H.style,Mt=H.styleSpec,Bt=H.key,jt=H.arrayElementValidator||H.validateSpec;if(Es(C)!=="array")return[new bt(Bt,C,`array expected, ${Es(C)} found`)];if($.length&&C.length!==$.length)return[new bt(Bt,C,`array length ${$.length} expected, length ${C.length} found`)];if($["min-length"]&&C.length<$["min-length"])return[new bt(Bt,C,`array length at least ${$["min-length"]} expected, length ${C.length} found`)];let oe={type:$.value,values:$.values};Mt.$version<7&&(oe.function=$.function),Es($.value)==="object"&&(oe=$.value);let be=[];for(let Be=0;Beht.maximum?[new bt(C,$,`${$} is greater than the maximum value ${ht.maximum}`)]:[]}function vc(H){let C=H.valueSpec,$=Gs(H.value.type),ht,Mt,Bt,jt={},oe=$!=="categorical"&&H.value.property===void 0,be=!oe,Be=Es(H.value.stops)==="array"&&Es(H.value.stops[0])==="array"&&Es(H.value.stops[0][0])==="object",Qe=Xl({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Fr){if($==="identity")return[new bt(Fr.key,Fr.value,'identity function may not have a "stops" property')];let Zr=[],en=Fr.value;return Zr=Zr.concat(Xc({key:Fr.key,value:en,valueSpec:Fr.valueSpec,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec,arrayElementValidator:lr})),Es(en)==="array"&&en.length===0&&Zr.push(new bt(Fr.key,en,"array must have at least one stop")),Zr},default:function(Fr){return Fr.validateSpec({key:Fr.key,value:Fr.value,valueSpec:C,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec})}}});return $==="identity"&&oe&&Qe.push(new bt(H.key,H.value,'missing required property "property"')),$==="identity"||H.value.stops||Qe.push(new bt(H.key,H.value,'missing required property "stops"')),$==="exponential"&&H.valueSpec.expression&&!Pc(H.valueSpec)&&Qe.push(new bt(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(be&&!Tl(H.valueSpec)?Qe.push(new bt(H.key,H.value,"property functions not supported")):oe&&!Ju(H.valueSpec)&&Qe.push(new bt(H.key,H.value,"zoom functions not supported"))),$!=="categorical"&&!Be||H.value.property!==void 0||Qe.push(new bt(H.key,H.value,'"property" property is required')),Qe;function lr(Fr){let Zr=[],en=Fr.value,yn=Fr.key;if(Es(en)!=="array")return[new bt(yn,en,`array expected, ${Es(en)} found`)];if(en.length!==2)return[new bt(yn,en,`array length 2 expected, length ${en.length} found`)];if(Be){if(Es(en[0])!=="object")return[new bt(yn,en,`object expected, ${Es(en[0])} found`)];if(en[0].zoom===void 0)return[new bt(yn,en,"object stop key must have zoom")];if(en[0].value===void 0)return[new bt(yn,en,"object stop key must have value")];if(Bt&&Bt>Gs(en[0].zoom))return[new bt(yn,en[0].zoom,"stop zoom values must appear in ascending order")];Gs(en[0].zoom)!==Bt&&(Bt=Gs(en[0].zoom),Mt=void 0,jt={}),Zr=Zr.concat(Xl({key:`${yn}[0]`,value:en[0],valueSpec:{zoom:{}},validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec,objectElementValidators:{zoom:Vs,value:wr}}))}else Zr=Zr.concat(wr({key:`${yn}[0]`,value:en[0],validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec},en));return Gu(Du(en[1]))?Zr.concat([new bt(`${yn}[1]`,en[1],"expressions are not allowed in function stops.")]):Zr.concat(Fr.validateSpec({key:`${yn}[1]`,value:en[1],valueSpec:C,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec}))}function wr(Fr,Zr){let en=Es(Fr.value),yn=Gs(Fr.value),Vn=Fr.value!==null?Fr.value:Zr;if(ht){if(en!==ht)return[new bt(Fr.key,Vn,`${en} stop domain type must match previous stop domain type ${ht}`)]}else ht=en;if(en!=="number"&&en!=="string"&&en!=="boolean")return[new bt(Fr.key,Vn,"stop domain value must be a number, string, or boolean")];if(en!=="number"&&$!=="categorical"){let Ca=`number expected, ${en} found`;return Tl(C)&&$===void 0&&(Ca+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new bt(Fr.key,Vn,Ca)]}return $!=="categorical"||en!=="number"||isFinite(yn)&&Math.floor(yn)===yn?$!=="categorical"&&en==="number"&&Mt!==void 0&&ynnew bt(`${H.key}${ht.key}`,H.value,ht.message));let $=C.value.expression||C.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!$.outputDefined())return[new bt(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!du($))return[new bt(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!du($))return[new bt(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Bc($,["zoom","feature-state"]))return[new bt(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!Ic($))return[new bt(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ou(H){let C=H.key,$=H.value,ht=H.valueSpec,Mt=[];return Array.isArray(ht.values)?ht.values.indexOf(Gs($))===-1&&Mt.push(new bt(C,$,`expected one of [${ht.values.join(", ")}], ${JSON.stringify($)} found`)):Object.keys(ht.values).indexOf(Gs($))===-1&&Mt.push(new bt(C,$,`expected one of [${Object.keys(ht.values).join(", ")}], ${JSON.stringify($)} found`)),Mt}function Qu(H){return Tu(Du(H.value))?Ku(vt({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Yu(H)}function Yu(H){let C=H.value,$=H.key;if(Es(C)!=="array")return[new bt($,C,`array expected, ${Es(C)} found`)];let ht=H.styleSpec,Mt,Bt=[];if(C.length<1)return[new bt($,C,"filter array must have at least 1 element")];switch(Bt=Bt.concat(ou({key:`${$}[0]`,value:C[0],valueSpec:ht.filter_operator,style:H.style,styleSpec:H.styleSpec})),Gs(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Gs(C[1])==="$type"&&Bt.push(new bt($,C,`"$type" cannot be use with operator "${C[0]}"`));case"==":case"!=":C.length!==3&&Bt.push(new bt($,C,`filter array for operator "${C[0]}" must have 3 elements`));case"in":case"!in":C.length>=2&&(Mt=Es(C[1]),Mt!=="string"&&Bt.push(new bt(`${$}[1]`,C[1],`string expected, ${Mt} found`)));for(let jt=2;jt{Be in $&&C.push(new bt(ht,$[Be],`"${Be}" is prohibited for ref layers`))}),Mt.layers.forEach(Be=>{Gs(Be.id)===oe&&(be=Be)}),be?be.ref?C.push(new bt(ht,$.ref,"ref cannot reference another ref layer")):jt=Gs(be.type):C.push(new bt(ht,$.ref,`ref layer "${oe}" not found`))}else if(jt!=="background")if($.source){let be=Mt.sources&&Mt.sources[$.source],Be=be&&Gs(be.type);be?Be==="vector"&&jt==="raster"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a raster source`)):Be!=="raster-dem"&&jt==="hillshade"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a raster-dem source`)):Be==="raster"&&jt!=="raster"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a vector source`)):Be!=="vector"||$["source-layer"]?Be==="raster-dem"&&jt!=="hillshade"?C.push(new bt(ht,$.source,"raster-dem source can only be used with layer type 'hillshade'.")):jt!=="line"||!$.paint||!$.paint["line-gradient"]||Be==="geojson"&&be.lineMetrics||C.push(new bt(ht,$,`layer "${$.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):C.push(new bt(ht,$,`layer "${$.id}" must specify a "source-layer"`)):C.push(new bt(ht,$.source,`source "${$.source}" not found`))}else C.push(new bt(ht,$,'missing required property "source"'));return C=C.concat(Xl({key:ht,value:$,valueSpec:Bt.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${ht}.type`,value:$.type,valueSpec:Bt.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:$,objectKey:"type"}),filter:Qu,layout:be=>Xl({layer:$,key:be.key,value:be.value,style:be.style,styleSpec:be.styleSpec,validateSpec:be.validateSpec,objectElementValidators:{"*":Be=>zl(vt({layerType:jt},Be))}}),paint:be=>Xl({layer:$,key:be.key,value:be.value,style:be.style,styleSpec:be.styleSpec,validateSpec:be.validateSpec,objectElementValidators:{"*":Be=>cf(vt({layerType:jt},Be))}})}})),C}function su(H){let C=H.value,$=H.key,ht=Es(C);return ht!=="string"?[new bt($,C,`string expected, ${ht} found`)]:[]}let Fu={promoteId:function({key:H,value:C}){if(Es(C)==="string")return su({key:H,value:C});{let $=[];for(let ht in C)$.push(...su({key:`${H}.${ht}`,value:C[ht]}));return $}}};function Au(H){let C=H.value,$=H.key,ht=H.styleSpec,Mt=H.style,Bt=H.validateSpec;if(!C.type)return[new bt($,C,'"type" is required')];let jt=Gs(C.type),oe;switch(jt){case"vector":case"raster":return oe=Xl({key:$,value:C,valueSpec:ht[`source_${jt.replace("-","_")}`],style:H.style,styleSpec:ht,objectElementValidators:Fu,validateSpec:Bt}),oe;case"raster-dem":return oe=(function(be){var Be;let Qe=(Be=be.sourceName)!==null&&Be!==void 0?Be:"",lr=be.value,wr=be.styleSpec,Fr=wr.source_raster_dem,Zr=be.style,en=[],yn=Es(lr);if(lr===void 0)return en;if(yn!=="object")return en.push(new bt("source_raster_dem",lr,`object expected, ${yn} found`)),en;let Vn=Gs(lr.encoding)==="custom",Ca=["redFactor","greenFactor","blueFactor","baseShift"],ua=be.value.encoding?`"${be.value.encoding}"`:"Default";for(let wa in lr)!Vn&&Ca.includes(wa)?en.push(new bt(wa,lr[wa],`In "${Qe}": "${wa}" is only valid when "encoding" is set to "custom". ${ua} encoding found`)):Fr[wa]?en=en.concat(be.validateSpec({key:wa,value:lr[wa],valueSpec:Fr[wa],validateSpec:be.validateSpec,style:Zr,styleSpec:wr})):en.push(new bt(wa,lr[wa],`unknown property "${wa}"`));return en})({sourceName:$,value:C,style:H.style,styleSpec:ht,validateSpec:Bt}),oe;case"geojson":if(oe=Xl({key:$,value:C,valueSpec:ht.source_geojson,style:Mt,styleSpec:ht,validateSpec:Bt,objectElementValidators:Fu}),C.cluster)for(let be in C.clusterProperties){let[Be,Qe]=C.clusterProperties[be],lr=typeof Be=="string"?[Be,["accumulated"],["get",be]]:Be;oe.push(...Ku({key:`${$}.${be}.map`,value:Qe,expressionContext:"cluster-map"})),oe.push(...Ku({key:`${$}.${be}.reduce`,value:lr,expressionContext:"cluster-reduce"}))}return oe;case"video":return Xl({key:$,value:C,valueSpec:ht.source_video,style:Mt,validateSpec:Bt,styleSpec:ht});case"image":return Xl({key:$,value:C,valueSpec:ht.source_image,style:Mt,validateSpec:Bt,styleSpec:ht});case"canvas":return[new bt($,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ou({key:`${$}.type`,value:C.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function il(H){let C=H.value,$=H.styleSpec,ht=$.light,Mt=H.style,Bt=[],jt=Es(C);if(C===void 0)return Bt;if(jt!=="object")return Bt=Bt.concat([new bt("light",C,`object expected, ${jt} found`)]),Bt;for(let oe in C){let be=oe.match(/^(.*)-transition$/);Bt=Bt.concat(be&&ht[be[1]]&&ht[be[1]].transition?H.validateSpec({key:oe,value:C[oe],valueSpec:$.transition,validateSpec:H.validateSpec,style:Mt,styleSpec:$}):ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],validateSpec:H.validateSpec,style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)])}return Bt}function Cs(H){let C=H.value,$=H.styleSpec,ht=$.sky,Mt=H.style,Bt=Es(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("sky",C,`object expected, ${Bt} found`)];let jt=[];for(let oe in C)jt=jt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return jt}function Mu(H){let C=H.value,$=H.styleSpec,ht=$.terrain,Mt=H.style,Bt=[],jt=Es(C);if(C===void 0)return Bt;if(jt!=="object")return Bt=Bt.concat([new bt("terrain",C,`object expected, ${jt} found`)]),Bt;for(let oe in C)Bt=Bt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],validateSpec:H.validateSpec,style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return Bt}function lc(H){let C=[],$=H.value,ht=H.key;if(Array.isArray($)){let Mt=[],Bt=[];for(let jt in $)$[jt].id&&Mt.includes($[jt].id)&&C.push(new bt(ht,$,`all the sprites' ids must be unique, but ${$[jt].id} is duplicated`)),Mt.push($[jt].id),$[jt].url&&Bt.includes($[jt].url)&&C.push(new bt(ht,$,`all the sprites' URLs must be unique, but ${$[jt].url} is duplicated`)),Bt.push($[jt].url),C=C.concat(Xl({key:`${ht}[${jt}]`,value:$[jt],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return C}return su({key:ht,value:$})}let Su={"*":()=>[],array:Xc,boolean:function(H){let C=H.value,$=H.key,ht=Es(C);return ht!=="boolean"?[new bt($,C,`boolean expected, ${ht} found`)]:[]},number:Vs,color:function(H){let C=H.key,$=H.value,ht=Es($);return ht!=="string"?[new bt(C,$,`color expected, ${ht} found`)]:tr.parse(String($))?[]:[new bt(C,$,`color expected, "${$}" found`)]},constants:ku,enum:ou,filter:Qu,function:vc,layer:Uc,object:Xl,source:Au,light:il,sky:Cs,terrain:Mu,projection:function(H){let C=H.value,$=H.styleSpec,ht=$.projection,Mt=H.style,Bt=Es(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("projection",C,`object expected, ${Bt} found`)];let jt=[];for(let oe in C)jt=jt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return jt},string:su,formatted:function(H){return su(H).length===0?[]:Ku(H)},resolvedImage:function(H){return su(H).length===0?[]:Ku(H)},padding:function(H){let C=H.key,$=H.value;if(Es($)==="array"){if($.length<1||$.length>4)return[new bt(C,$,`padding requires 1 to 4 values; ${$.length} values found`)];let ht={type:"number"},Mt=[];for(let Bt=0;Bt<$.length;Bt++)Mt=Mt.concat(H.validateSpec({key:`${C}[${Bt}]`,value:$[Bt],validateSpec:H.validateSpec,valueSpec:ht}));return Mt}return Vs({key:C,value:$,valueSpec:{}})},variableAnchorOffsetCollection:function(H){let C=H.key,$=H.value,ht=Es($),Mt=H.styleSpec;if(ht!=="array"||$.length<1||$.length%2!=0)return[new bt(C,$,"variableAnchorOffsetCollection requires a non-empty array of even length")];let Bt=[];for(let jt=0;jt<$.length;jt+=2)Bt=Bt.concat(ou({key:`${C}[${jt}]`,value:$[jt],valueSpec:Mt.layout_symbol["text-anchor"]})),Bt=Bt.concat(Xc({key:`${C}[${jt+1}]`,value:$[jt+1],valueSpec:{length:2,value:"number"},validateSpec:H.validateSpec,style:H.style,styleSpec:Mt}));return Bt},sprite:lc};function Oc(H){let C=H.value,$=H.valueSpec,ht=H.styleSpec;return H.validateSpec=Oc,$.expression&&_c(Gs(C))?vc(H):$.expression&&Gu(Du(C))?Ku(H):$.type&&Su[$.type]?Su[$.type](H):Xl(vt({},H,{valueSpec:$.type?ht[$.type]:$}))}function Xe(H){let C=H.value,$=H.key,ht=su(H);return ht.length||(C.indexOf("{fontstack}")===-1&&ht.push(new bt($,C,'"glyphs" url must include a "{fontstack}" token')),C.indexOf("{range}")===-1&&ht.push(new bt($,C,'"glyphs" url must include a "{range}" token'))),ht}function yr(H,C=nt){let $=[];return $=$.concat(Oc({key:"",value:H,valueSpec:C.$root,styleSpec:C,style:H,validateSpec:Oc,objectElementValidators:{glyphs:Xe,"*":()=>[]}})),H.constants&&($=$.concat(ku({key:"constants",value:H.constants}))),Rr($)}function Kr(H){return function(C){return H(hm(vd({},C),{validateSpec:Oc}))}}function Rr(H){return[].concat(H).sort((C,$)=>C.line-$.line)}function mn(H){return function(...C){return Rr(H.apply(this,C))}}yr.source=mn(Kr(Au)),yr.sprite=mn(Kr(lc)),yr.glyphs=mn(Kr(Xe)),yr.light=mn(Kr(il)),yr.sky=mn(Kr(Cs)),yr.terrain=mn(Kr(Mu)),yr.layer=mn(Kr(Uc)),yr.filter=mn(Kr(Qu)),yr.paintProperty=mn(Kr(cf)),yr.layoutProperty=mn(Kr(zl));let Pn=yr,ha=Pn.light,Ta=Pn.sky,Ua=Pn.paintProperty,Ya=Pn.layoutProperty;function va(H,C){let $=!1;if(C&&C.length)for(let ht of C)H.fire(new q(new Error(ht.message))),$=!0;return $}class Ba{constructor(C,$,ht){let Mt=this.cells=[];if(C instanceof ArrayBuffer){this.arrayBuffer=C;let jt=new Int32Array(this.arrayBuffer);C=jt[0],this.d=($=jt[1])+2*(ht=jt[2]);for(let be=0;be=lr[Zr+0]&&Mt>=lr[Zr+1])?(oe[Fr]=!0,jt.push(Qe[Fr])):oe[Fr]=!1}}}}_forEachCell(C,$,ht,Mt,Bt,jt,oe,be){let Be=this._convertToCellCoord(C),Qe=this._convertToCellCoord($),lr=this._convertToCellCoord(ht),wr=this._convertToCellCoord(Mt);for(let Fr=Be;Fr<=lr;Fr++)for(let Zr=Qe;Zr<=wr;Zr++){let en=this.d*Zr+Fr;if((!be||be(this._convertFromCellCoord(Fr),this._convertFromCellCoord(Zr),this._convertFromCellCoord(Fr+1),this._convertFromCellCoord(Zr+1)))&&Bt.call(this,C,$,ht,Mt,en,jt,oe,be))return}}_convertFromCellCoord(C){return(C-this.padding)/this.scale}_convertToCellCoord(C){return Math.max(0,Math.min(this.d-1,Math.floor(C*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let C=this.cells,$=3+this.cells.length+1+1,ht=0;for(let jt=0;jt=0)continue;let jt=H[Bt];Mt[Bt]=za[$].shallow.indexOf(Bt)>=0?jt:Wi(jt,C)}H instanceof Error&&(Mt.message=H.message)}if(Mt.$name)throw new Error("$name property is reserved for worker serialization logic.");return $!=="Object"&&(Mt.$name=$),Mt}function Xi(H){if(Oi(H))return H;if(Array.isArray(H))return H.map(Xi);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);let C=Vi(H)||"Object";if(!za[C])throw new Error(`can't deserialize unregistered class ${C}`);let{klass:$}=za[C];if(!$)throw new Error(`can't deserialize unregistered class ${C}`);if($.deserialize)return $.deserialize(H);let ht=Object.create($.prototype);for(let Mt of Object.keys(H)){if(Mt==="$name")continue;let Bt=H[Mt];ht[Mt]=za[C].shallow.indexOf(Mt)>=0?Bt:Xi(Bt)}return ht}class ni{constructor(){this.first=!0}update(C,$){let ht=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=ht,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=ht,!0):(this.lastFloorZoom>ht?(this.lastIntegerZoom=ht+1,this.lastIntegerZoomTime=$):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function $i(H){for(let C of H)if(Yo(C.charCodeAt(0)))return!0;return!1}function Do(H){for(let C of H)if(!ys(C.charCodeAt(0)))return!1;return!0}function ss(H){let C=H.map($=>{try{return new RegExp(`\\p{sc=${$}}`,"u").source}catch{return null}}).filter($=>$);return new RegExp(C.join("|"),"u")}let Ps=ss(["Arab","Dupl","Mong","Ougr","Syrc"]);function ys(H){return!Ps.test(String.fromCodePoint(H))}let Os=ss(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Yo(H){return!(H!==746&&H!==747&&(H<4352||!(Za["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||Za["CJK Compatibility"](H)||Za["CJK Strokes"](H)||!(!Za["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||Za["Enclosed CJK Letters and Months"](H)||Za["Ideographic Description Characters"](H)||Za.Kanbun(H)||Za.Katakana(H)&&H!==12540||!(!Za["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!Za["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||Za["Vertical Forms"](H)||Za["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||Os.test(String.fromCodePoint(H)))))}function ll(H){return!(Yo(H)||(function(C){return!!(Za["Latin-1 Supplement"](C)&&(C===167||C===169||C===174||C===177||C===188||C===189||C===190||C===215||C===247)||Za["General Punctuation"](C)&&(C===8214||C===8224||C===8225||C===8240||C===8241||C===8251||C===8252||C===8258||C===8263||C===8264||C===8265||C===8273)||Za["Letterlike Symbols"](C)||Za["Number Forms"](C)||Za["Miscellaneous Technical"](C)&&(C>=8960&&C<=8967||C>=8972&&C<=8991||C>=8996&&C<=9e3||C===9003||C>=9085&&C<=9114||C>=9150&&C<=9165||C===9167||C>=9169&&C<=9179||C>=9186&&C<=9215)||Za["Control Pictures"](C)&&C!==9251||Za["Optical Character Recognition"](C)||Za["Enclosed Alphanumerics"](C)||Za["Geometric Shapes"](C)||Za["Miscellaneous Symbols"](C)&&!(C>=9754&&C<=9759)||Za["Miscellaneous Symbols and Arrows"](C)&&(C>=11026&&C<=11055||C>=11088&&C<=11097||C>=11192&&C<=11243)||Za["CJK Symbols and Punctuation"](C)||Za.Katakana(C)||Za["Private Use Area"](C)||Za["CJK Compatibility Forms"](C)||Za["Small Form Variants"](C)||Za["Halfwidth and Fullwidth Forms"](C)||C===8734||C===8756||C===8757||C>=9984&&C<=10087||C>=10102&&C<=10131||C===65532||C===65533)})(H))}let el=ss(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Rs(H){return el.test(String.fromCodePoint(H))}function bi(H,C){return!(!C&&Rs(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||Za.Khmer(H))}function so(H){for(let C of H)if(Rs(C.charCodeAt(0)))return!0;return!1}let ws=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class fs{constructor(C,$){this.zoom=C,$?(this.now=$.now,this.fadeDuration=$.fadeDuration,this.zoomHistory=$.zoomHistory,this.transition=$.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ni,this.transition={})}isSupportedScript(C){return(function($,ht){for(let Mt of $)if(!bi(Mt.charCodeAt(0),ht))return!1;return!0})(C,ws.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let C=this.zoom,$=C-Math.floor(C),ht=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:$+(1-$)*ht}:{fromScale:.5,toScale:1,t:1-(1-ht)*$}}}class Ll{constructor(C,$){this.property=C,this.value=$,this.expression=(function(ht,Mt){if(_c(ht))return new Ws(ht,Mt);if(Gu(ht)){let Bt=Yl(ht,Mt);if(Bt.result==="error")throw new Error(Bt.value.map(jt=>`${jt.key}: ${jt.message}`).join(", "));return Bt.value}{let Bt=ht;return Mt.type==="color"&&typeof ht=="string"?Bt=tr.parse(ht):Mt.type!=="padding"||typeof ht!="number"&&!Array.isArray(ht)?Mt.type==="variableAnchorOffsetCollection"&&Array.isArray(ht)&&(Bt=Nn.parse(ht)):Bt=$r.parse(ht),{kind:"constant",evaluate:()=>Bt}}})($===void 0?C.specification.default:$,C.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(C,$,ht){return this.property.possiblyEvaluate(this,C,$,ht)}}class $l{constructor(C){this.property=C,this.value=new Ll(C,void 0)}transitioned(C,$){return new Bu(this.property,this.value,$,k({},C.transition,this.transition),C.now)}untransitioned(){return new Bu(this.property,this.value,null,{},0)}}class jl{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)}getValue(C){return h(this._values[C].value.value)}setValue(C,$){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new $l(this._values[C].property)),this._values[C].value=new Ll(this._values[C].property,$===null?void 0:h($))}getTransition(C){return h(this._values[C].transition)}setTransition(C,$){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new $l(this._values[C].property)),this._values[C].transition=h($)||void 0}serialize(){let C={};for(let $ of Object.keys(this._values)){let ht=this.getValue($);ht!==void 0&&(C[$]=ht);let Mt=this.getTransition($);Mt!==void 0&&(C[`${$}-transition`]=Mt)}return C}transitioned(C,$){let ht=new Jl(this._properties);for(let Mt of Object.keys(this._values))ht._values[Mt]=this._values[Mt].transitioned(C,$._values[Mt]);return ht}untransitioned(){let C=new Jl(this._properties);for(let $ of Object.keys(this._values))C._values[$]=this._values[$].untransitioned();return C}}class Bu{constructor(C,$,ht,Mt,Bt){this.property=C,this.value=$,this.begin=Bt+Mt.delay||0,this.end=this.begin+Mt.duration||0,C.specification.transition&&(Mt.delay||Mt.duration)&&(this.prior=ht)}possiblyEvaluate(C,$,ht){let Mt=C.now||0,Bt=this.value.possiblyEvaluate(C,$,ht),jt=this.prior;if(jt){if(Mt>this.end)return this.prior=null,Bt;if(this.value.isDataDriven())return this.prior=null,Bt;if(Mt=1)return 1;let Be=be*be,Qe=Be*be;return 4*(be<.5?Qe:3*(be-Be)+Qe-.75)})(oe))}}return Bt}}class Jl{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)}possiblyEvaluate(C,$,ht){let Mt=new Nu(this._properties);for(let Bt of Object.keys(this._values))Mt._values[Bt]=this._values[Bt].possiblyEvaluate(C,$,ht);return Mt}hasTransition(){for(let C of Object.keys(this._values))if(this._values[C].prior)return!0;return!1}}class Ru{constructor(C){this._properties=C,this._values=Object.create(C.defaultPropertyValues)}hasValue(C){return this._values[C].value!==void 0}getValue(C){return h(this._values[C].value)}setValue(C,$){this._values[C]=new Ll(this._values[C].property,$===null?void 0:h($))}serialize(){let C={};for(let $ of Object.keys(this._values)){let ht=this.getValue($);ht!==void 0&&(C[$]=ht)}return C}possiblyEvaluate(C,$,ht){let Mt=new Nu(this._properties);for(let Bt of Object.keys(this._values))Mt._values[Bt]=this._values[Bt].possiblyEvaluate(C,$,ht);return Mt}}class nl{constructor(C,$,ht){this.property=C,this.value=$,this.parameters=ht}isConstant(){return this.value.kind==="constant"}constantOr(C){return this.value.kind==="constant"?this.value.value:C}evaluate(C,$,ht,Mt){return this.property.evaluate(this.value,this.parameters,C,$,ht,Mt)}}class Nu{constructor(C){this._properties=C,this._values=Object.create(C.defaultPossiblyEvaluatedValues)}get(C){return this._values[C]}}class Ui{constructor(C){this.specification=C}possiblyEvaluate(C,$){if(C.isDataDriven())throw new Error("Value should not be data driven");return C.expression.evaluate($)}interpolate(C,$,ht){let Mt=Ti[this.specification.type];return Mt?Mt(C,$,ht):C}}class fo{constructor(C,$){this.specification=C,this.overrides=$}possiblyEvaluate(C,$,ht,Mt){return new nl(this,C.expression.kind==="constant"||C.expression.kind==="camera"?{kind:"constant",value:C.expression.evaluate($,null,{},ht,Mt)}:C.expression,$)}interpolate(C,$,ht){if(C.value.kind!=="constant"||$.value.kind!=="constant")return C;if(C.value.value===void 0||$.value.value===void 0)return new nl(this,{kind:"constant",value:void 0},C.parameters);let Mt=Ti[this.specification.type];if(Mt){let Bt=Mt(C.value.value,$.value.value,ht);return new nl(this,{kind:"constant",value:Bt},C.parameters)}return C}evaluate(C,$,ht,Mt,Bt,jt){return C.kind==="constant"?C.value:C.evaluate($,ht,Mt,Bt,jt)}}class Ql extends fo{possiblyEvaluate(C,$,ht,Mt){if(C.value===void 0)return new nl(this,{kind:"constant",value:void 0},$);if(C.expression.kind==="constant"){let Bt=C.expression.evaluate($,null,{},ht,Mt),jt=C.property.specification.type==="resolvedImage"&&typeof Bt!="string"?Bt.name:Bt,oe=this._calculate(jt,jt,jt,$);return new nl(this,{kind:"constant",value:oe},$)}if(C.expression.kind==="camera"){let Bt=this._calculate(C.expression.evaluate({zoom:$.zoom-1}),C.expression.evaluate({zoom:$.zoom}),C.expression.evaluate({zoom:$.zoom+1}),$);return new nl(this,{kind:"constant",value:Bt},$)}return new nl(this,C.expression,$)}evaluate(C,$,ht,Mt,Bt,jt){if(C.kind==="source"){let oe=C.evaluate($,ht,Mt,Bt,jt);return this._calculate(oe,oe,oe,$)}return C.kind==="composite"?this._calculate(C.evaluate({zoom:Math.floor($.zoom)-1},ht,Mt),C.evaluate({zoom:Math.floor($.zoom)},ht,Mt),C.evaluate({zoom:Math.floor($.zoom)+1},ht,Mt),$):C.value}_calculate(C,$,ht,Mt){return Mt.zoom>Mt.zoomHistory.lastIntegerZoom?{from:C,to:$}:{from:ht,to:$}}interpolate(C){return C}}class ul{constructor(C){this.specification=C}possiblyEvaluate(C,$,ht,Mt){if(C.value!==void 0){if(C.expression.kind==="constant"){let Bt=C.expression.evaluate($,null,{},ht,Mt);return this._calculate(Bt,Bt,Bt,$)}return this._calculate(C.expression.evaluate(new fs(Math.floor($.zoom-1),$)),C.expression.evaluate(new fs(Math.floor($.zoom),$)),C.expression.evaluate(new fs(Math.floor($.zoom+1),$)),$)}}_calculate(C,$,ht,Mt){return Mt.zoom>Mt.zoomHistory.lastIntegerZoom?{from:C,to:$}:{from:ht,to:$}}interpolate(C){return C}}class Dc{constructor(C){this.specification=C}possiblyEvaluate(C,$,ht,Mt){return!!C.expression.evaluate($,null,{},ht,Mt)}interpolate(){return!1}}class Pt{constructor(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let $ in C){let ht=C[$];ht.specification.overridable&&this.overridableProperties.push($);let Mt=this.defaultPropertyValues[$]=new Ll(ht,void 0),Bt=this.defaultTransitionablePropertyValues[$]=new $l(ht);this.defaultTransitioningPropertyValues[$]=Bt.untransitioned(),this.defaultPossiblyEvaluatedValues[$]=Mt.possiblyEvaluate({})}}}ca("DataDrivenProperty",fo),ca("DataConstantProperty",Ui),ca("CrossFadedDataDrivenProperty",Ql),ca("CrossFadedProperty",ul),ca("ColorRampProperty",Dc);let L="-transition";class at extends it{constructor(C,$){if(super(),this.id=C.id,this.type=C.type,this._featureFilter={filter:()=>!0,needGeometry:!1},C.type!=="custom"&&(this.metadata=C.metadata,this.minzoom=C.minzoom,this.maxzoom=C.maxzoom,C.type!=="background"&&(this.source=C.source,this.sourceLayer=C["source-layer"],this.filter=C.filter),$.layout&&(this._unevaluatedLayout=new Ru($.layout)),$.paint)){this._transitionablePaint=new jl($.paint);for(let ht in C.paint)this.setPaintProperty(ht,C.paint[ht],{validate:!1});for(let ht in C.layout)this.setLayoutProperty(ht,C.layout[ht],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Nu($.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(C){return C==="visibility"?this.visibility:this._unevaluatedLayout.getValue(C)}setLayoutProperty(C,$,ht={}){$!=null&&this._validate(Ya,`layers.${this.id}.layout.${C}`,C,$,ht)||(C!=="visibility"?this._unevaluatedLayout.setValue(C,$):this.visibility=$)}getPaintProperty(C){return C.endsWith(L)?this._transitionablePaint.getTransition(C.slice(0,-11)):this._transitionablePaint.getValue(C)}setPaintProperty(C,$,ht={}){if($!=null&&this._validate(Ua,`layers.${this.id}.paint.${C}`,C,$,ht))return!1;if(C.endsWith(L))return this._transitionablePaint.setTransition(C.slice(0,-11),$||void 0),!1;{let Mt=this._transitionablePaint._values[C],Bt=Mt.property.specification["property-type"]==="cross-faded-data-driven",jt=Mt.value.isDataDriven(),oe=Mt.value;this._transitionablePaint.setValue(C,$),this._handleSpecialPaintPropertyUpdate(C);let be=this._transitionablePaint._values[C].value;return be.isDataDriven()||jt||Bt||this._handleOverridablePaintPropertyUpdate(C,oe,be)}}_handleSpecialPaintPropertyUpdate(C){}_handleOverridablePaintPropertyUpdate(C,$,ht){return!1}isHidden(C){return!!(this.minzoom&&C=this.maxzoom)||this.visibility==="none"}updateTransitions(C){this._transitioningPaint=this._transitionablePaint.transitioned(C,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(C,$){C.getCrossfadeParameters&&(this._crossfadeParameters=C.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(C,void 0,$)),this.paint=this._transitioningPaint.possiblyEvaluate(C,void 0,$)}serialize(){let C={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(C.layout=C.layout||{},C.layout.visibility=this.visibility),c(C,($,ht)=>!($===void 0||ht==="layout"&&!Object.keys($).length||ht==="paint"&&!Object.keys($).length))}_validate(C,$,ht,Mt,Bt={}){return(!Bt||Bt.validate!==!1)&&va(this,C.call(Pn,{key:$,layerType:this.type,objectKey:ht,value:Mt,styleSpec:nt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let C in this.paint._values){let $=this.paint.get(C);if($ instanceof nl&&Tl($.property.specification)&&($.value.kind==="source"||$.value.kind==="composite")&&$.value.isStateDependent)return!0}return!1}}let xt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class kt{constructor(C,$){this._structArray=C,this._pos1=$*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Lt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(C,$){return C._trim(),$&&(C.isTransferred=!0,$.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}}static deserialize(C){let $=Object.create(this.prototype);return $.arrayBuffer=C.arrayBuffer,$.length=C.length,$.capacity=C.arrayBuffer.byteLength/$.bytesPerElement,$._refreshViews(),$}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(C){this.reserve(C),this.length=C}reserve(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let $=this.uint8;this._refreshViews(),$&&this.uint8.set($)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function le(H,C=1){let $=0,ht=0;return{members:H.map(Mt=>{let Bt=xt[Mt.type].BYTES_PER_ELEMENT,jt=$=xe($,Math.max(C,Bt)),oe=Mt.components||1;return ht=Math.max(ht,Bt),$+=Bt*oe,{name:Mt.name,type:Mt.type,components:oe,offset:jt}}),size:xe($,Math.max(ht,C)),alignment:C}}function xe(H,C){return Math.ceil(H/C)*C}class Pe extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.int16[Mt+0]=$,this.int16[Mt+1]=ht,C}}Pe.prototype.bytesPerElement=4,ca("StructArrayLayout2i4",Pe);class $e extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.int16[Bt+0]=$,this.int16[Bt+1]=ht,this.int16[Bt+2]=Mt,C}}$e.prototype.bytesPerElement=6,ca("StructArrayLayout3i6",$e);class hr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,$,ht,Mt)}emplace(C,$,ht,Mt,Bt){let jt=4*C;return this.int16[jt+0]=$,this.int16[jt+1]=ht,this.int16[jt+2]=Mt,this.int16[jt+3]=Bt,C}}hr.prototype.bytesPerElement=8,ca("StructArrayLayout4i8",hr);class pr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=6*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.int16[be+2]=Mt,this.int16[be+3]=Bt,this.int16[be+4]=jt,this.int16[be+5]=oe,C}}pr.prototype.bytesPerElement=12,ca("StructArrayLayout2i4i12",pr);class Br extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=4*C,Be=8*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.uint8[Be+4]=Mt,this.uint8[Be+5]=Bt,this.uint8[Be+6]=jt,this.uint8[Be+7]=oe,C}}Br.prototype.bytesPerElement=8,ca("StructArrayLayout2i4ub8",Br);class Jr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.float32[Mt+0]=$,this.float32[Mt+1]=ht,C}}Jr.prototype.bytesPerElement=8,ca("StructArrayLayout2f8",Jr);class Rt extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=this.length;return this.resize(lr+1),this.emplace(lr,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr){let wr=10*C;return this.uint16[wr+0]=$,this.uint16[wr+1]=ht,this.uint16[wr+2]=Mt,this.uint16[wr+3]=Bt,this.uint16[wr+4]=jt,this.uint16[wr+5]=oe,this.uint16[wr+6]=be,this.uint16[wr+7]=Be,this.uint16[wr+8]=Qe,this.uint16[wr+9]=lr,C}}Rt.prototype.bytesPerElement=20,ca("StructArrayLayout10ui20",Rt);class Gt extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr){let Fr=this.length;return this.resize(Fr+1),this.emplace(Fr,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr){let Zr=12*C;return this.int16[Zr+0]=$,this.int16[Zr+1]=ht,this.int16[Zr+2]=Mt,this.int16[Zr+3]=Bt,this.uint16[Zr+4]=jt,this.uint16[Zr+5]=oe,this.uint16[Zr+6]=be,this.uint16[Zr+7]=Be,this.int16[Zr+8]=Qe,this.int16[Zr+9]=lr,this.int16[Zr+10]=wr,this.int16[Zr+11]=Fr,C}}Gt.prototype.bytesPerElement=24,ca("StructArrayLayout4i4ui4i24",Gt);class ae extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.float32[Bt+0]=$,this.float32[Bt+1]=ht,this.float32[Bt+2]=Mt,C}}ae.prototype.bytesPerElement=12,ca("StructArrayLayout3f12",ae);class ce extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.uint32[1*C+0]=$,C}}ce.prototype.bytesPerElement=4,ca("StructArrayLayout1ul4",ce);class Te extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be){let Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,C,$,ht,Mt,Bt,jt,oe,be,Be)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=10*C,wr=5*C;return this.int16[lr+0]=$,this.int16[lr+1]=ht,this.int16[lr+2]=Mt,this.int16[lr+3]=Bt,this.int16[lr+4]=jt,this.int16[lr+5]=oe,this.uint32[wr+3]=be,this.uint16[lr+8]=Be,this.uint16[lr+9]=Qe,C}}Te.prototype.bytesPerElement=20,ca("StructArrayLayout6i1ul2ui20",Te);class ye extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=6*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.int16[be+2]=Mt,this.int16[be+3]=Bt,this.int16[be+4]=jt,this.int16[be+5]=oe,C}}ye.prototype.bytesPerElement=12,ca("StructArrayLayout2i2i2i12",ye);class ze extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,C,$,ht,Mt,Bt)}emplace(C,$,ht,Mt,Bt,jt){let oe=4*C,be=8*C;return this.float32[oe+0]=$,this.float32[oe+1]=ht,this.float32[oe+2]=Mt,this.int16[be+6]=Bt,this.int16[be+7]=jt,C}}ze.prototype.bytesPerElement=16,ca("StructArrayLayout2f1f2i16",ze);class rr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=16*C,Be=4*C,Qe=8*C;return this.uint8[be+0]=$,this.uint8[be+1]=ht,this.float32[Be+1]=Mt,this.float32[Be+2]=Bt,this.int16[Qe+6]=jt,this.int16[Qe+7]=oe,C}}rr.prototype.bytesPerElement=16,ca("StructArrayLayout2ub2f2i16",rr);class fr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.uint16[Bt+0]=$,this.uint16[Bt+1]=ht,this.uint16[Bt+2]=Mt,C}}fr.prototype.bytesPerElement=6,ca("StructArrayLayout3ui6",fr);class gr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn){let Ca=this.length;return this.resize(Ca+1),this.emplace(Ca,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca){let ua=24*C,wa=12*C,Xa=48*C;return this.int16[ua+0]=$,this.int16[ua+1]=ht,this.uint16[ua+2]=Mt,this.uint16[ua+3]=Bt,this.uint32[wa+2]=jt,this.uint32[wa+3]=oe,this.uint32[wa+4]=be,this.uint16[ua+10]=Be,this.uint16[ua+11]=Qe,this.uint16[ua+12]=lr,this.float32[wa+7]=wr,this.float32[wa+8]=Fr,this.uint8[Xa+36]=Zr,this.uint8[Xa+37]=en,this.uint8[Xa+38]=yn,this.uint32[wa+10]=Vn,this.int16[ua+22]=Ca,C}}gr.prototype.bytesPerElement=48,ca("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",gr);class Lr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo){let ho=this.length;return this.resize(ho+1),this.emplace(ho,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo,ho){let oi=32*C,Ro=16*C;return this.int16[oi+0]=$,this.int16[oi+1]=ht,this.int16[oi+2]=Mt,this.int16[oi+3]=Bt,this.int16[oi+4]=jt,this.int16[oi+5]=oe,this.int16[oi+6]=be,this.int16[oi+7]=Be,this.uint16[oi+8]=Qe,this.uint16[oi+9]=lr,this.uint16[oi+10]=wr,this.uint16[oi+11]=Fr,this.uint16[oi+12]=Zr,this.uint16[oi+13]=en,this.uint16[oi+14]=yn,this.uint16[oi+15]=Vn,this.uint16[oi+16]=Ca,this.uint16[oi+17]=ua,this.uint16[oi+18]=wa,this.uint16[oi+19]=Xa,this.uint16[oi+20]=di,this.uint16[oi+21]=oo,this.uint16[oi+22]=as,this.uint32[Ro+12]=eo,this.float32[Ro+13]=Ki,this.float32[Ro+14]=Co,this.uint16[oi+30]=xo,this.uint16[oi+31]=ho,C}}Lr.prototype.bytesPerElement=64,ca("StructArrayLayout8i15ui1ul2f2ui64",Lr);class Hr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.float32[1*C+0]=$,C}}Hr.prototype.bytesPerElement=4,ca("StructArrayLayout1f4",Hr);class nn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.uint16[6*C+0]=$,this.float32[Bt+1]=ht,this.float32[Bt+2]=Mt,C}}nn.prototype.bytesPerElement=12,ca("StructArrayLayout1ui2f12",nn);class cn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=4*C;return this.uint32[2*C+0]=$,this.uint16[Bt+2]=ht,this.uint16[Bt+3]=Mt,C}}cn.prototype.bytesPerElement=8,ca("StructArrayLayout1ul2ui8",cn);class Mn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.uint16[Mt+0]=$,this.uint16[Mt+1]=ht,C}}Mn.prototype.bytesPerElement=4,ca("StructArrayLayout2ui4",Mn);class Jn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.uint16[1*C+0]=$,C}}Jn.prototype.bytesPerElement=2,ca("StructArrayLayout1ui2",Jn);class _a extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,$,ht,Mt)}emplace(C,$,ht,Mt,Bt){let jt=4*C;return this.float32[jt+0]=$,this.float32[jt+1]=ht,this.float32[jt+2]=Mt,this.float32[jt+3]=Bt,C}}_a.prototype.bytesPerElement=16,ca("StructArrayLayout4f16",_a);class xa extends kt{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new o(this.anchorPointX,this.anchorPointY)}}xa.prototype.size=20;class La extends Te{get(C){return new xa(this,C)}}ca("CollisionBoxArray",La);class ai extends kt{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(C){this._structArray.uint8[this._pos1+37]=C}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(C){this._structArray.uint8[this._pos1+38]=C}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(C){this._structArray.uint32[this._pos4+10]=C}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ai.prototype.size=48;class Ai extends gr{get(C){return new ai(this,C)}}ca("PlacedSymbolArray",Ai);class mi extends kt{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(C){this._structArray.uint32[this._pos4+12]=C}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}mi.prototype.size=64;class Yi extends Lr{get(C){return new mi(this,C)}}ca("SymbolInstanceArray",Yi);class Go extends Hr{getoffsetX(C){return this.float32[1*C+0]}}ca("GlyphOffsetArray",Go);class Xo extends $e{getx(C){return this.int16[3*C+0]}gety(C){return this.int16[3*C+1]}gettileUnitDistanceFromAnchor(C){return this.int16[3*C+2]}}ca("SymbolLineVertexArray",Xo);class po extends kt{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}po.prototype.size=12;class Qo extends nn{get(C){return new po(this,C)}}ca("TextAnchorOffsetArray",Qo);class Js extends kt{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Js.prototype.size=8;class Us extends cn{get(C){return new Js(this,C)}}ca("FeatureIndexArray",Us);class To extends Pe{}class ko extends Pe{}class hl extends Pe{}class Sl extends pr{}class tu extends Br{}class gt extends Jr{}class Et extends Rt{}class Xt extends Gt{}class fe extends ae{}class me extends ce{}class we extends ye{}class Ve extends rr{}class je extends fr{}class or extends Mn{}let Cr=le([{name:"a_pos",components:2,type:"Int16"}],4),{members:Sr}=Cr;class Wr{constructor(C=[]){this.segments=C}prepareSegment(C,$,ht,Mt){let Bt=this.segments[this.segments.length-1];return C>Wr.MAX_VERTEX_ARRAY_LENGTH&&_(`Max vertices per segment is ${Wr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${C}`),(!Bt||Bt.vertexLength+C>Wr.MAX_VERTEX_ARRAY_LENGTH||Bt.sortKey!==Mt)&&(Bt={vertexOffset:$.length,primitiveOffset:ht.length,vertexLength:0,primitiveLength:0},Mt!==void 0&&(Bt.sortKey=Mt),this.segments.push(Bt)),Bt}get(){return this.segments}destroy(){for(let C of this.segments)for(let $ in C.vaos)C.vaos[$].destroy()}static simpleSegment(C,$,ht,Mt){return new Wr([{vertexOffset:C,primitiveOffset:$,vertexLength:ht,primitiveLength:Mt,vaos:{},sortKey:0}])}}function an(H,C){return 256*(H=y(Math.floor(H),0,255))+y(Math.floor(C),0,255)}Wr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ca("SegmentVector",Wr);let on=le([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ta={exports:{}},hn={exports:{}};hn.exports=function(H,C){var $,ht,Mt,Bt,jt,oe,be,Be;for(ht=H.length-($=3&H.length),Mt=C,jt=3432918353,oe=461845907,Be=0;Be>>16)*jt&65535)<<16)&4294967295)<<15|be>>>17))*oe+(((be>>>16)*oe&65535)<<16)&4294967295)<<13|Mt>>>19))+((5*(Mt>>>16)&65535)<<16)&4294967295))+((58964+(Bt>>>16)&65535)<<16);switch(be=0,$){case 3:be^=(255&H.charCodeAt(Be+2))<<16;case 2:be^=(255&H.charCodeAt(Be+1))<<8;case 1:Mt^=be=(65535&(be=(be=(65535&(be^=255&H.charCodeAt(Be)))*jt+(((be>>>16)*jt&65535)<<16)&4294967295)<<15|be>>>17))*oe+(((be>>>16)*oe&65535)<<16)&4294967295}return Mt^=H.length,Mt=2246822507*(65535&(Mt^=Mt>>>16))+((2246822507*(Mt>>>16)&65535)<<16)&4294967295,Mt=3266489909*(65535&(Mt^=Mt>>>13))+((3266489909*(Mt>>>16)&65535)<<16)&4294967295,(Mt^=Mt>>>16)>>>0};var Bn=hn.exports,Hn={exports:{}};Hn.exports=function(H,C){for(var $,ht=H.length,Mt=C^ht,Bt=0;ht>=4;)$=1540483477*(65535&($=255&H.charCodeAt(Bt)|(255&H.charCodeAt(++Bt))<<8|(255&H.charCodeAt(++Bt))<<16|(255&H.charCodeAt(++Bt))<<24))+((1540483477*($>>>16)&65535)<<16),Mt=1540483477*(65535&Mt)+((1540483477*(Mt>>>16)&65535)<<16)^($=1540483477*(65535&($^=$>>>24))+((1540483477*($>>>16)&65535)<<16)),ht-=4,++Bt;switch(ht){case 3:Mt^=(255&H.charCodeAt(Bt+2))<<16;case 2:Mt^=(255&H.charCodeAt(Bt+1))<<8;case 1:Mt=1540483477*(65535&(Mt^=255&H.charCodeAt(Bt)))+((1540483477*(Mt>>>16)&65535)<<16)}return Mt=1540483477*(65535&(Mt^=Mt>>>13))+((1540483477*(Mt>>>16)&65535)<<16),(Mt^=Mt>>>15)>>>0};var Yn=Bn,na=Hn.exports;ta.exports=Yn,ta.exports.murmur3=Yn,ta.exports.murmur2=na;var _n=r(ta.exports);class Ha{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(C,$,ht,Mt){this.ids.push(Wa(C)),this.positions.push($,ht,Mt)}getPositions(C){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let $=Wa(C),ht=0,Mt=this.ids.length-1;for(;ht>1;this.ids[jt]>=$?Mt=jt:ht=jt+1}let Bt=[];for(;this.ids[ht]===$;)Bt.push({index:this.positions[3*ht],start:this.positions[3*ht+1],end:this.positions[3*ht+2]}),ht++;return Bt}static serialize(C,$){let ht=new Float64Array(C.ids),Mt=new Uint32Array(C.positions);return ri(ht,Mt,0,ht.length-1),$&&$.push(ht.buffer,Mt.buffer),{ids:ht,positions:Mt}}static deserialize(C){let $=new Ha;return $.ids=C.ids,$.positions=C.positions,$.indexed=!0,$}}function Wa(H){let C=+H;return!isNaN(C)&&C<=Number.MAX_SAFE_INTEGER?C:_n(String(H))}function ri(H,C,$,ht){for(;$>1],Bt=$-1,jt=ht+1;for(;;){do Bt++;while(H[Bt]Mt);if(Bt>=jt)break;xi(H,Bt,jt),xi(C,3*Bt,3*jt),xi(C,3*Bt+1,3*jt+1),xi(C,3*Bt+2,3*jt+2)}jt-$`u_${Mt}`),this.type=ht}setUniform(C,$,ht){C.set(ht.constantOr(this.value))}getBinding(C,$,ht){return this.type==="color"?new Ii(C,$):new zi(C,$)}}class Ns{constructor(C,$){this.uniformNames=$.map(ht=>`u_${ht}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(C,$){this.pixelRatioFrom=$.pixelRatio,this.pixelRatioTo=C.pixelRatio,this.patternFrom=$.tlbr,this.patternTo=C.tlbr}setUniform(C,$,ht,Mt){let Bt=Mt==="u_pattern_to"?this.patternTo:Mt==="u_pattern_from"?this.patternFrom:Mt==="u_pixel_ratio_to"?this.pixelRatioTo:Mt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Bt&&C.set(Bt)}getBinding(C,$,ht){return ht.substr(0,9)==="u_pattern"?new jo(C,$):new zi(C,$)}}class fi{constructor(C,$,ht,Mt){this.expression=C,this.type=ht,this.maxValue=0,this.paintVertexAttributes=$.map(Bt=>({name:`a_${Bt}`,type:"Float32",components:ht==="color"?2:1,offset:0})),this.paintVertexArray=new Mt}populatePaintArray(C,$,ht,Mt,Bt){let jt=this.paintVertexArray.length,oe=this.expression.evaluate(new fs(0),$,{},Mt,[],Bt);this.paintVertexArray.resize(C),this._setPaintValue(jt,C,oe)}updatePaintArray(C,$,ht,Mt){let Bt=this.expression.evaluate({zoom:0},ht,Mt);this._setPaintValue(C,$,Bt)}_setPaintValue(C,$,ht){if(this.type==="color"){let Mt=es(ht);for(let Bt=C;Bt<$;Bt++)this.paintVertexArray.emplace(Bt,Mt[0],Mt[1])}else{for(let Mt=C;Mt<$;Mt++)this.paintVertexArray.emplace(Mt,ht);this.maxValue=Math.max(this.maxValue,Math.abs(ht))}}upload(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ao{constructor(C,$,ht,Mt,Bt,jt){this.expression=C,this.uniformNames=$.map(oe=>`u_${oe}_t`),this.type=ht,this.useIntegerZoom=Mt,this.zoom=Bt,this.maxValue=0,this.paintVertexAttributes=$.map(oe=>({name:`a_${oe}`,type:"Float32",components:ht==="color"?4:2,offset:0})),this.paintVertexArray=new jt}populatePaintArray(C,$,ht,Mt,Bt){let jt=this.expression.evaluate(new fs(this.zoom),$,{},Mt,[],Bt),oe=this.expression.evaluate(new fs(this.zoom+1),$,{},Mt,[],Bt),be=this.paintVertexArray.length;this.paintVertexArray.resize(C),this._setPaintValue(be,C,jt,oe)}updatePaintArray(C,$,ht,Mt){let Bt=this.expression.evaluate({zoom:this.zoom},ht,Mt),jt=this.expression.evaluate({zoom:this.zoom+1},ht,Mt);this._setPaintValue(C,$,Bt,jt)}_setPaintValue(C,$,ht,Mt){if(this.type==="color"){let Bt=es(ht),jt=es(Mt);for(let oe=C;oe<$;oe++)this.paintVertexArray.emplace(oe,Bt[0],Bt[1],jt[0],jt[1])}else{for(let Bt=C;Bt<$;Bt++)this.paintVertexArray.emplace(Bt,ht,Mt);this.maxValue=Math.max(this.maxValue,Math.abs(ht),Math.abs(Mt))}}upload(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(C,$){let ht=this.useIntegerZoom?Math.floor($.zoom):$.zoom,Mt=y(this.expression.interpolationFactor(ht,this.zoom,this.zoom+1),0,1);C.set(Mt)}getBinding(C,$,ht){return new zi(C,$)}}class Bo{constructor(C,$,ht,Mt,Bt,jt){this.expression=C,this.type=$,this.useIntegerZoom=ht,this.zoom=Mt,this.layerId=jt,this.zoomInPaintVertexArray=new Bt,this.zoomOutPaintVertexArray=new Bt}populatePaintArray(C,$,ht){let Mt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(C),this.zoomOutPaintVertexArray.resize(C),this._setPaintValues(Mt,C,$.patterns&&$.patterns[this.layerId],ht)}updatePaintArray(C,$,ht,Mt,Bt){this._setPaintValues(C,$,ht.patterns&&ht.patterns[this.layerId],Bt)}_setPaintValues(C,$,ht,Mt){if(!Mt||!ht)return;let{min:Bt,mid:jt,max:oe}=ht,be=Mt[Bt],Be=Mt[jt],Qe=Mt[oe];if(be&&Be&&Qe)for(let lr=C;lr<$;lr++)this.zoomInPaintVertexArray.emplace(lr,Be.tl[0],Be.tl[1],Be.br[0],Be.br[1],be.tl[0],be.tl[1],be.br[0],be.br[1],Be.pixelRatio,be.pixelRatio),this.zoomOutPaintVertexArray.emplace(lr,Be.tl[0],Be.tl[1],Be.br[0],Be.br[1],Qe.tl[0],Qe.tl[1],Qe.br[0],Qe.br[1],Be.pixelRatio,Qe.pixelRatio)}upload(C){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=C.createVertexBuffer(this.zoomInPaintVertexArray,on.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=C.createVertexBuffer(this.zoomOutPaintVertexArray,on.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ds{constructor(C,$,ht){this.binders={},this._buffers=[];let Mt=[];for(let Bt in C.paint._values){if(!ht(Bt))continue;let jt=C.paint.get(Bt);if(!(jt instanceof nl&&Tl(jt.property.specification)))continue;let oe=lu(Bt,C.type),be=jt.value,Be=jt.property.specification.type,Qe=jt.property.useIntegerZoom,lr=jt.property.specification["property-type"],wr=lr==="cross-faded"||lr==="cross-faded-data-driven";if(be.kind==="constant")this.binders[Bt]=wr?new Ns(be.value,oe):new pl(be.value,oe,Be),Mt.push(`/u_${Bt}`);else if(be.kind==="source"||wr){let Fr=ps(Bt,Be,"source");this.binders[Bt]=wr?new Bo(be,Be,Qe,$,Fr,C.id):new fi(be,oe,Be,Fr),Mt.push(`/a_${Bt}`)}else{let Fr=ps(Bt,Be,"composite");this.binders[Bt]=new Ao(be,oe,Be,Qe,$,Fr),Mt.push(`/z_${Bt}`)}}this.cacheKey=Mt.sort().join("")}getMaxValue(C){let $=this.binders[C];return $ instanceof fi||$ instanceof Ao?$.maxValue:0}populatePaintArrays(C,$,ht,Mt,Bt){for(let jt in this.binders){let oe=this.binders[jt];(oe instanceof fi||oe instanceof Ao||oe instanceof Bo)&&oe.populatePaintArray(C,$,ht,Mt,Bt)}}setConstantPatternPositions(C,$){for(let ht in this.binders){let Mt=this.binders[ht];Mt instanceof Ns&&Mt.setConstantPatternPositions(C,$)}}updatePaintArrays(C,$,ht,Mt,Bt){let jt=!1;for(let oe in C){let be=$.getPositions(oe);for(let Be of be){let Qe=ht.feature(Be.index);for(let lr in this.binders){let wr=this.binders[lr];if((wr instanceof fi||wr instanceof Ao||wr instanceof Bo)&&wr.expression.isStateDependent===!0){let Fr=Mt.paint.get(lr);wr.expression=Fr.value,wr.updatePaintArray(Be.start,Be.end,Qe,C[oe],Bt),jt=!0}}}}return jt}defines(){let C=[];for(let $ in this.binders){let ht=this.binders[$];(ht instanceof pl||ht instanceof Ns)&&C.push(...ht.uniformNames.map(Mt=>`#define HAS_UNIFORM_${Mt}`))}return C}getBinderAttributes(){let C=[];for(let $ in this.binders){let ht=this.binders[$];if(ht instanceof fi||ht instanceof Ao)for(let Mt=0;Mt!0){this.programConfigurations={};for(let Mt of C)this.programConfigurations[Mt.id]=new Ds(Mt,$,ht);this.needsUpload=!1,this._featureMap=new Ha,this._bufferOffset=0}populatePaintArrays(C,$,ht,Mt,Bt,jt){for(let oe in this.programConfigurations)this.programConfigurations[oe].populatePaintArrays(C,$,Mt,Bt,jt);$.id!==void 0&&this._featureMap.add($.id,ht,this._bufferOffset,C),this._bufferOffset=C,this.needsUpload=!0}updatePaintArrays(C,$,ht,Mt){for(let Bt of ht)this.needsUpload=this.programConfigurations[Bt.id].updatePaintArrays(C,this._featureMap,$,Bt,Mt)||this.needsUpload}get(C){return this.programConfigurations[C]}upload(C){if(this.needsUpload){for(let $ in this.programConfigurations)this.programConfigurations[$].upload(C);this.needsUpload=!1}}destroy(){for(let C in this.programConfigurations)this.programConfigurations[C].destroy()}}function lu(H,C){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${C}-`,"").replace(/-/g,"_")]}function ps(H,C,$){let ht={color:{source:Jr,composite:_a},number:{source:Hr,composite:Jr}},Mt=(function(Bt){return{"line-pattern":{source:Et,composite:Et},"fill-pattern":{source:Et,composite:Et},"fill-extrusion-pattern":{source:Et,composite:Et}}[Bt]})(H);return Mt&&Mt[$]||ht[C][$]}ca("ConstantBinder",pl),ca("CrossFadedConstantBinder",Ns),ca("SourceExpressionBinder",fi),ca("CrossFadedCompositeBinder",Bo),ca("CompositeExpressionBinder",Ao),ca("ProgramConfiguration",Ds,{omit:["_buffers"]}),ca("ProgramConfigurationSet",Ts);let zs=8192,Eu=Math.pow(2,14)-1,ie=-Eu-1;function nr(H){let C=zs/H.extent,$=H.loadGeometry();for(let ht=0;ht<$.length;ht++){let Mt=$[ht];for(let Bt=0;Btjt.x+1||bejt.y+1)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return $}function cr(H,C){return{type:H.type,id:H.id,properties:H.properties,geometry:C?nr(H):[]}}function sn(H,C,$,ht,Mt){H.emplaceBack(2*C+(ht+1)/2,2*$+(Mt+1)/2)}class zn{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new ko,this.indexArray=new je,this.segments=new Wr,this.programConfigurations=new Ts(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){let Mt=this.layers[0],Bt=[],jt=null,oe=!1;Mt.type==="circle"&&(jt=Mt.layout.get("circle-sort-key"),oe=!jt.isConstant());for(let{feature:be,id:Be,index:Qe,sourceLayerIndex:lr}of C){let wr=this.layers[0]._featureFilter.needGeometry,Fr=cr(be,wr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),Fr,ht))continue;let Zr=oe?jt.evaluate(Fr,{},ht):void 0,en={id:Be,properties:be.properties,type:be.type,sourceLayerIndex:lr,index:Qe,geometry:wr?Fr.geometry:nr(be),patterns:{},sortKey:Zr};Bt.push(en)}oe&&Bt.sort((be,Be)=>be.sortKey-Be.sortKey);for(let be of Bt){let{geometry:Be,index:Qe,sourceLayerIndex:lr}=be,wr=C[Qe].feature;this.addFeature(be,Be,Qe,ht),$.featureIndex.insert(wr,Be,Qe,lr,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Sr),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(C,$,ht,Mt){for(let Bt of $)for(let jt of Bt){let oe=jt.x,be=jt.y;if(oe<0||oe>=zs||be<0||be>=zs)continue;let Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Qe=Be.vertexLength;sn(this.layoutVertexArray,oe,be,-1,-1),sn(this.layoutVertexArray,oe,be,1,-1),sn(this.layoutVertexArray,oe,be,1,1),sn(this.layoutVertexArray,oe,be,-1,1),this.indexArray.emplaceBack(Qe,Qe+1,Qe+2),this.indexArray.emplaceBack(Qe,Qe+3,Qe+2),Be.vertexLength+=4,Be.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,{},Mt)}}function Tn(H,C){for(let $=0;$1){if(ea(H,C))return!0;for(let ht=0;ht1?$:$.sub(C)._mult(Mt)._add(C))}function fa(H,C){let $,ht,Mt,Bt=!1;for(let jt=0;jtC.y!=Mt.y>C.y&&C.x<(Mt.x-ht.x)*(C.y-ht.y)/(Mt.y-ht.y)+ht.x&&(Bt=!Bt)}return Bt}function Un(H,C){let $=!1;for(let ht=0,Mt=H.length-1;htC.y!=jt.y>C.y&&C.x<(jt.x-Bt.x)*(C.y-Bt.y)/(jt.y-Bt.y)+Bt.x&&($=!$)}return $}function Nr(H,C,$){let ht=$[0],Mt=$[2];if(H.xMt.x&&C.x>Mt.x||H.yMt.y&&C.y>Mt.y)return!1;let Bt=P(H,C,$[0]);return Bt!==P(H,C,$[1])||Bt!==P(H,C,$[2])||Bt!==P(H,C,$[3])}function fn(H,C,$){let ht=C.paint.get(H).value;return ht.kind==="constant"?ht.value:$.programConfigurations.get(C.id).getMaxValue(H)}function Xn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function jn(H,C,$,ht,Mt){if(!C[0]&&!C[1])return H;let Bt=o.convert(C)._mult(Mt);$==="viewport"&&Bt._rotate(-ht);let jt=[];for(let oe=0;oe_i(yn,en))})(Be,be),Fr=lr?Qe*oe:Qe;for(let Zr of Mt)for(let en of Zr){let yn=lr?en:_i(en,be),Vn=Fr,Ca=oa([],[en.x,en.y,0,1],be);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Vn*=Ca[3]/jt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Vn*=jt.cameraToCenterDistance/Ca[3]),qr(wr,yn,Vn))return!0}return!1}}function _i(H,C){let $=oa([],[H.x,H.y,0,1],C);return new o($[0]/$[3],$[1]/$[3])}class pi extends zn{}let Ma;ca("HeatmapBucket",pi,{omit:["layers"]});var Na={get paint(){return Ma=Ma||new Pt({"heatmap-radius":new fo(nt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new fo(nt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ui(nt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Dc(nt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ui(nt.paint_heatmap["heatmap-opacity"])})}};function ui(H,{width:C,height:$},ht,Mt){if(Mt){if(Mt instanceof Uint8ClampedArray)Mt=new Uint8Array(Mt.buffer);else if(Mt.length!==C*$*ht)throw new RangeError(`mismatched image size. expected: ${Mt.length} but got: ${C*$*ht}`)}else Mt=new Uint8Array(C*$*ht);return H.width=C,H.height=$,H.data=Mt,H}function gi(H,{width:C,height:$},ht){if(C===H.width&&$===H.height)return;let Mt=ui({},{width:C,height:$},ht);Ri(H,Mt,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,C),height:Math.min(H.height,$)},ht),H.width=C,H.height=$,H.data=Mt.data}function Ri(H,C,$,ht,Mt,Bt){if(Mt.width===0||Mt.height===0)return C;if(Mt.width>H.width||Mt.height>H.height||$.x>H.width-Mt.width||$.y>H.height-Mt.height)throw new RangeError("out of range source coordinates for image copy");if(Mt.width>C.width||Mt.height>C.height||ht.x>C.width-Mt.width||ht.y>C.height-Mt.height)throw new RangeError("out of range destination coordinates for image copy");let jt=H.data,oe=C.data;if(jt===oe)throw new Error("srcData equals dstData, so image is already copied");for(let be=0;be{C[H.evaluationKey]=be;let Be=H.expression.evaluate(C);Mt.data[jt+oe+0]=Math.floor(255*Be.r/Be.a),Mt.data[jt+oe+1]=Math.floor(255*Be.g/Be.a),Mt.data[jt+oe+2]=Math.floor(255*Be.b/Be.a),Mt.data[jt+oe+3]=Math.floor(255*Be.a)};if(H.clips)for(let jt=0,oe=0;jt80*$){oe=1/0,be=1/0;let Qe=-1/0,lr=-1/0;for(let wr=$;wrQe&&(Qe=Fr),Zr>lr&&(lr=Zr)}Be=Math.max(Qe-oe,lr-be),Be=Be!==0?32767/Be:0}return Uo(Bt,jt,$,oe,be,Be,0),jt}function Mi(H,C,$,ht,Mt){let Bt;if(Mt===(function(jt,oe,be,Be){let Qe=0;for(let lr=oe,wr=be-Be;lr0)for(let jt=C;jt<$;jt+=ht)Bt=Fe(jt/ht|0,H[jt],H[jt+1],Bt);else for(let jt=$-ht;jt>=C;jt-=ht)Bt=Fe(jt/ht|0,H[jt],H[jt+1],Bt);return Bt&&ne(Bt,Bt.next)&&(He(Bt),Bt=Bt.next),Bt}function Ys(H,C){if(!H)return H;C||(C=H);let $,ht=H;do if($=!1,ht.steiner||!ne(ht,ht.next)&&Qt(ht.prev,ht,ht.next)!==0)ht=ht.next;else{if(He(ht),ht=C=ht.prev,ht===ht.next)break;$=!0}while($||ht!==C);return C}function Uo(H,C,$,ht,Mt,Bt,jt){if(!H)return;!jt&&Bt&&(function(be,Be,Qe,lr){let wr=be;do wr.z===0&&(wr.z=tt(wr.x,wr.y,Be,Qe,lr)),wr.prevZ=wr.prev,wr.nextZ=wr.next,wr=wr.next;while(wr!==be);wr.prevZ.nextZ=null,wr.prevZ=null,(function(Fr){let Zr,en=1;do{let yn,Vn=Fr;Fr=null;let Ca=null;for(Zr=0;Vn;){Zr++;let ua=Vn,wa=0;for(let di=0;di0||Xa>0&&ua;)wa!==0&&(Xa===0||!ua||Vn.z<=ua.z)?(yn=Vn,Vn=Vn.nextZ,wa--):(yn=ua,ua=ua.nextZ,Xa--),Ca?Ca.nextZ=yn:Fr=yn,yn.prevZ=Ca,Ca=yn;Vn=ua}Ca.nextZ=null,en*=2}while(Zr>1)})(wr)})(H,ht,Mt,Bt);let oe=H;for(;H.prev!==H.next;){let be=H.prev,Be=H.next;if(Bt?Il(H,ht,Mt,Bt):tl(H))C.push(be.i,H.i,Be.i),He(H),H=Be.next,oe=Be.next;else if((H=Be)===oe){jt?jt===1?Uo(H=vi(Ys(H),C),C,$,ht,Mt,Bt,2):jt===2&&lo(H,C,$,ht,Mt,Bt):Uo(Ys(H),C,$,ht,Mt,Bt,1);break}}}function tl(H){let C=H.prev,$=H,ht=H.next;if(Qt(C,$,ht)>=0)return!1;let Mt=C.x,Bt=$.x,jt=ht.x,oe=C.y,be=$.y,Be=ht.y,Qe=MtBt?Mt>jt?Mt:jt:Bt>jt?Bt:jt,Fr=oe>be?oe>Be?oe:Be:be>Be?be:Be,Zr=ht.next;for(;Zr!==C;){if(Zr.x>=Qe&&Zr.x<=wr&&Zr.y>=lr&&Zr.y<=Fr&&ft(Mt,oe,Bt,be,jt,Be,Zr.x,Zr.y)&&Qt(Zr.prev,Zr,Zr.next)>=0)return!1;Zr=Zr.next}return!0}function Il(H,C,$,ht){let Mt=H.prev,Bt=H,jt=H.next;if(Qt(Mt,Bt,jt)>=0)return!1;let oe=Mt.x,be=Bt.x,Be=jt.x,Qe=Mt.y,lr=Bt.y,wr=jt.y,Fr=oebe?oe>Be?oe:Be:be>Be?be:Be,yn=Qe>lr?Qe>wr?Qe:wr:lr>wr?lr:wr,Vn=tt(Fr,Zr,C,$,ht),Ca=tt(en,yn,C,$,ht),ua=H.prevZ,wa=H.nextZ;for(;ua&&ua.z>=Vn&&wa&&wa.z<=Ca;){if(ua.x>=Fr&&ua.x<=en&&ua.y>=Zr&&ua.y<=yn&&ua!==Mt&&ua!==jt&&ft(oe,Qe,be,lr,Be,wr,ua.x,ua.y)&&Qt(ua.prev,ua,ua.next)>=0||(ua=ua.prevZ,wa.x>=Fr&&wa.x<=en&&wa.y>=Zr&&wa.y<=yn&&wa!==Mt&&wa!==jt&&ft(oe,Qe,be,lr,Be,wr,wa.x,wa.y)&&Qt(wa.prev,wa,wa.next)>=0))return!1;wa=wa.nextZ}for(;ua&&ua.z>=Vn;){if(ua.x>=Fr&&ua.x<=en&&ua.y>=Zr&&ua.y<=yn&&ua!==Mt&&ua!==jt&&ft(oe,Qe,be,lr,Be,wr,ua.x,ua.y)&&Qt(ua.prev,ua,ua.next)>=0)return!1;ua=ua.prevZ}for(;wa&&wa.z<=Ca;){if(wa.x>=Fr&&wa.x<=en&&wa.y>=Zr&&wa.y<=yn&&wa!==Mt&&wa!==jt&&ft(oe,Qe,be,lr,Be,wr,wa.x,wa.y)&&Qt(wa.prev,wa,wa.next)>=0)return!1;wa=wa.nextZ}return!0}function vi(H,C){let $=H;do{let ht=$.prev,Mt=$.next.next;!ne(ht,Mt)&&Ft(ht,$,$.next,Mt)&&Ne(ht,Mt)&&Ne(Mt,ht)&&(C.push(ht.i,$.i,Mt.i),He($),He($.next),$=H=Mt),$=$.next}while($!==H);return Ys($)}function lo(H,C,$,ht,Mt,Bt){let jt=H;do{let oe=jt.next.next;for(;oe!==jt.prev;){if(jt.i!==oe.i&&zt(jt,oe)){let be=Ie(jt,oe);return jt=Ys(jt,jt.next),be=Ys(be,be.next),Uo(jt,C,$,ht,Mt,Bt,0),void Uo(be,C,$,ht,Mt,Bt,0)}oe=oe.next}jt=jt.next}while(jt!==H)}function ns(H,C){return H.x-C.x}function $o(H,C){let $=(function(Mt,Bt){let jt=Bt,oe=Mt.x,be=Mt.y,Be,Qe=-1/0;do{if(be<=jt.y&&be>=jt.next.y&&jt.next.y!==jt.y){let en=jt.x+(be-jt.y)*(jt.next.x-jt.x)/(jt.next.y-jt.y);if(en<=oe&&en>Qe&&(Qe=en,Be=jt.x=jt.x&&jt.x>=wr&&oe!==jt.x&&ft(beBe.x||jt.x===Be.x&&U(Be,jt)))&&(Be=jt,Zr=en)}jt=jt.next}while(jt!==lr);return Be})(H,C);if(!$)return C;let ht=Ie($,H);return Ys(ht,ht.next),Ys($,$.next)}function U(H,C){return Qt(H.prev,H,C.prev)<0&&Qt(C.next,H,H.next)<0}function tt(H,C,$,ht,Mt){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-$)*Mt|0)|H<<8))|H<<4))|H<<2))|H<<1))|(C=1431655765&((C=858993459&((C=252645135&((C=16711935&((C=(C-ht)*Mt|0)|C<<8))|C<<4))|C<<2))|C<<1))<<1}function Y(H){let C=H,$=H;do(C.x<$.x||C.x===$.x&&C.y<$.y)&&($=C),C=C.next;while(C!==H);return $}function ft(H,C,$,ht,Mt,Bt,jt,oe){return(Mt-jt)*(C-oe)>=(H-jt)*(Bt-oe)&&(H-jt)*(ht-oe)>=($-jt)*(C-oe)&&($-jt)*(Bt-oe)>=(Mt-jt)*(ht-oe)}function zt(H,C){return H.next.i!==C.i&&H.prev.i!==C.i&&!(function($,ht){let Mt=$;do{if(Mt.i!==$.i&&Mt.next.i!==$.i&&Mt.i!==ht.i&&Mt.next.i!==ht.i&&Ft(Mt,Mt.next,$,ht))return!0;Mt=Mt.next}while(Mt!==$);return!1})(H,C)&&(Ne(H,C)&&Ne(C,H)&&(function($,ht){let Mt=$,Bt=!1,jt=($.x+ht.x)/2,oe=($.y+ht.y)/2;do Mt.y>oe!=Mt.next.y>oe&&Mt.next.y!==Mt.y&&jt<(Mt.next.x-Mt.x)*(oe-Mt.y)/(Mt.next.y-Mt.y)+Mt.x&&(Bt=!Bt),Mt=Mt.next;while(Mt!==$);return Bt})(H,C)&&(Qt(H.prev,H,C.prev)||Qt(H,C.prev,C))||ne(H,C)&&Qt(H.prev,H,H.next)>0&&Qt(C.prev,C,C.next)>0)}function Qt(H,C,$){return(C.y-H.y)*($.x-C.x)-(C.x-H.x)*($.y-C.y)}function ne(H,C){return H.x===C.x&&H.y===C.y}function Ft(H,C,$,ht){let Mt=he(Qt(H,C,$)),Bt=he(Qt(H,C,ht)),jt=he(Qt($,ht,H)),oe=he(Qt($,ht,C));return Mt!==Bt&&jt!==oe||!(Mt!==0||!$t(H,$,C))||!(Bt!==0||!$t(H,ht,C))||!(jt!==0||!$t($,H,ht))||!(oe!==0||!$t($,C,ht))}function $t(H,C,$){return C.x<=Math.max(H.x,$.x)&&C.x>=Math.min(H.x,$.x)&&C.y<=Math.max(H.y,$.y)&&C.y>=Math.min(H.y,$.y)}function he(H){return H>0?1:H<0?-1:0}function Ne(H,C){return Qt(H.prev,H,H.next)<0?Qt(H,C,H.next)>=0&&Qt(H,H.prev,C)>=0:Qt(H,C,H.prev)<0||Qt(H,H.next,C)<0}function Ie(H,C){let $=Ge(H.i,H.x,H.y),ht=Ge(C.i,C.x,C.y),Mt=H.next,Bt=C.prev;return H.next=C,C.prev=H,$.next=Mt,Mt.prev=$,ht.next=$,$.prev=ht,Bt.next=ht,ht.prev=Bt,ht}function Fe(H,C,$,ht){let Mt=Ge(H,C,$);return ht?(Mt.next=ht.next,Mt.prev=ht,ht.next.prev=Mt,ht.next=Mt):(Mt.prev=Mt,Mt.next=Mt),Mt}function He(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Ge(H,C,$){return{i:H,x:C,y:$,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ae(H,C,$){let ht=$.patternDependencies,Mt=!1;for(let Bt of C){let jt=Bt.paint.get(`${H}-pattern`);jt.isConstant()||(Mt=!0);let oe=jt.constantOr(null);oe&&(Mt=!0,ht[oe.to]=!0,ht[oe.from]=!0)}return Mt}function Oe(H,C,$,ht,Mt){let Bt=Mt.patternDependencies;for(let jt of C){let oe=jt.paint.get(`${H}-pattern`).value;if(oe.kind!=="constant"){let be=oe.evaluate({zoom:ht-1},$,{},Mt.availableImages),Be=oe.evaluate({zoom:ht},$,{},Mt.availableImages),Qe=oe.evaluate({zoom:ht+1},$,{},Mt.availableImages);be=be&&be.name?be.name:be,Be=Be&&Be.name?Be.name:Be,Qe=Qe&&Qe.name?Qe.name:Qe,Bt[be]=!0,Bt[Be]=!0,Bt[Qe]=!0,$.patterns[jt.id]={min:be,mid:Be,max:Qe}}}return $}class Le{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new hl,this.indexArray=new je,this.indexArray2=new or,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.segments2=new Wr,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.hasPattern=Ae("fill",this.layers,$);let Mt=this.layers[0].layout.get("fill-sort-key"),Bt=!Mt.isConstant(),jt=[];for(let{feature:oe,id:be,index:Be,sourceLayerIndex:Qe}of C){let lr=this.layers[0]._featureFilter.needGeometry,wr=cr(oe,lr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),wr,ht))continue;let Fr=Bt?Mt.evaluate(wr,{},ht,$.availableImages):void 0,Zr={id:be,properties:oe.properties,type:oe.type,sourceLayerIndex:Qe,index:Be,geometry:lr?wr.geometry:nr(oe),patterns:{},sortKey:Fr};jt.push(Zr)}Bt&&jt.sort((oe,be)=>oe.sortKey-be.sortKey);for(let oe of jt){let{geometry:be,index:Be,sourceLayerIndex:Qe}=oe;if(this.hasPattern){let lr=Oe("fill",this.layers,oe,this.zoom,$);this.patternFeatures.push(lr)}else this.addFeature(oe,be,Be,ht,{});$.featureIndex.insert(C[Be].feature,be,Be,Qe,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}addFeatures(C,$,ht){for(let Mt of this.patternFeatures)this.addFeature(Mt,Mt.geometry,Mt.index,$,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,js),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.indexBuffer2=C.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(C,$,ht,Mt,Bt){for(let jt of au($,500)){let oe=0;for(let Fr of jt)oe+=Fr.length;let be=this.segments.prepareSegment(oe,this.layoutVertexArray,this.indexArray),Be=be.vertexLength,Qe=[],lr=[];for(let Fr of jt){if(Fr.length===0)continue;Fr!==jt[0]&&lr.push(Qe.length/2);let Zr=this.segments2.prepareSegment(Fr.length,this.layoutVertexArray,this.indexArray2),en=Zr.vertexLength;this.layoutVertexArray.emplaceBack(Fr[0].x,Fr[0].y),this.indexArray2.emplaceBack(en+Fr.length-1,en),Qe.push(Fr[0].x),Qe.push(Fr[0].y);for(let yn=1;yn>3}if(Mt--,ht===1||ht===2)Bt+=H.readSVarint(),jt+=H.readSVarint(),ht===1&&(C&&oe.push(C),C=[]),C.push(new la(Bt,jt));else{if(ht!==7)throw new Error("unknown command "+ht);C&&C.push(C[0].clone())}}return C&&oe.push(C),oe},Gn.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var C=H.readVarint()+H.pos,$=1,ht=0,Mt=0,Bt=0,jt=1/0,oe=-1/0,be=1/0,Be=-1/0;H.pos>3}if(ht--,$===1||$===2)(Mt+=H.readSVarint())oe&&(oe=Mt),(Bt+=H.readSVarint())Be&&(Be=Bt);else if($!==7)throw new Error("unknown command "+$)}return[jt,be,oe,Be]},Gn.prototype.toGeoJSON=function(H,C,$){var ht,Mt,Bt=this.extent*Math.pow(2,$),jt=this.extent*H,oe=this.extent*C,be=this.loadGeometry(),Be=Gn.types[this.type];function Qe(Fr){for(var Zr=0;Zr>3;Mt=jt===1?ht.readString():jt===2?ht.readFloat():jt===3?ht.readDouble():jt===4?ht.readVarint64():jt===5?ht.readVarint():jt===6?ht.readSVarint():jt===7?ht.readBoolean():null}return Mt})($))}to.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var C=this._pbf.readVarint()+this._pbf.pos;return new si(this._pbf,C,this.extent,this._keys,this._values)};var ms=Li;function Ko(H,C,$){if(H===3){var ht=new ms($,$.readVarint()+$.pos);ht.length&&(C[ht.name]=ht)}}Dn.VectorTile=function(H,C){this.layers=H.readFields(Ko,{},C)},Dn.VectorTileFeature=qn,Dn.VectorTileLayer=Li;let gs=Dn.VectorTileFeature.types,Pl=Math.pow(2,13);function mo(H,C,$,ht,Mt,Bt,jt,oe){H.emplaceBack(C,$,2*Math.floor(ht*Pl)+jt,Mt*Pl*2,Bt*Pl*2,Math.round(oe))}class Xs{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Sl,this.centroidVertexArray=new To,this.indexArray=new je,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.features=[],this.hasPattern=Ae("fill-extrusion",this.layers,$);for(let{feature:Mt,id:Bt,index:jt,sourceLayerIndex:oe}of C){let be=this.layers[0]._featureFilter.needGeometry,Be=cr(Mt,be);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),Be,ht))continue;let Qe={id:Bt,sourceLayerIndex:oe,index:jt,geometry:be?Be.geometry:nr(Mt),properties:Mt.properties,type:Mt.type,patterns:{}};this.hasPattern?this.features.push(Oe("fill-extrusion",this.layers,Qe,this.zoom,$)):this.addFeature(Qe,Qe.geometry,jt,ht,{}),$.featureIndex.insert(Mt,Qe.geometry,jt,oe,this.index,!0)}}addFeatures(C,$,ht){for(let Mt of this.features){let{geometry:Bt}=Mt;this.addFeature(Mt,Bt,Mt.index,$,ht)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Wn),this.centroidVertexBuffer=C.createVertexBuffer(this.centroidVertexArray,xn.members,!0),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(C,$,ht,Mt,Bt){for(let jt of au($,500)){let oe={x:0,y:0,vertexCount:0},be=0;for(let Zr of jt)be+=Zr.length;let Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Zr of jt){if(Zr.length===0||kc(Zr))continue;let en=0;for(let yn=0;yn=1){let Ca=Zr[yn-1];if(!tc(Vn,Ca)){Be.vertexLength+4>Wr.MAX_VERTEX_ARRAY_LENGTH&&(Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let ua=Vn.sub(Ca)._perp()._unit(),wa=Ca.dist(Vn);en+wa>32768&&(en=0),mo(this.layoutVertexArray,Vn.x,Vn.y,ua.x,ua.y,0,0,en),mo(this.layoutVertexArray,Vn.x,Vn.y,ua.x,ua.y,0,1,en),oe.x+=2*Vn.x,oe.y+=2*Vn.y,oe.vertexCount+=2,en+=wa,mo(this.layoutVertexArray,Ca.x,Ca.y,ua.x,ua.y,0,0,en),mo(this.layoutVertexArray,Ca.x,Ca.y,ua.x,ua.y,0,1,en),oe.x+=2*Ca.x,oe.y+=2*Ca.y,oe.vertexCount+=2;let Xa=Be.vertexLength;this.indexArray.emplaceBack(Xa,Xa+2,Xa+1),this.indexArray.emplaceBack(Xa+1,Xa+2,Xa+3),Be.vertexLength+=4,Be.primitiveLength+=2}}}}if(Be.vertexLength+be>Wr.MAX_VERTEX_ARRAY_LENGTH&&(Be=this.segments.prepareSegment(be,this.layoutVertexArray,this.indexArray)),gs[C.type]!=="Polygon")continue;let Qe=[],lr=[],wr=Be.vertexLength;for(let Zr of jt)if(Zr.length!==0){Zr!==jt[0]&&lr.push(Qe.length/2);for(let en=0;enzs)||H.y===C.y&&(H.y<0||H.y>zs)}function kc(H){return H.every(C=>C.x<0)||H.every(C=>C.x>zs)||H.every(C=>C.y<0)||H.every(C=>C.y>zs)}let uh;ca("FillExtrusionBucket",Xs,{omit:["layers","features"]});var vh={get paint(){return uh=uh||new Pt({"fill-extrusion-opacity":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new fo(nt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ql(nt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new fo(nt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new fo(nt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Kf extends at{constructor(C){super(C,vh)}createBucket(C){return new Xs(C)}queryRadius(){return Xn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe,be){let Be=jn(C,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,oe),Qe=this.paint.get("fill-extrusion-height").evaluate($,ht),lr=this.paint.get("fill-extrusion-base").evaluate($,ht),wr=(function(Zr,en,yn,Vn){let Ca=[];for(let ua of Zr){let wa=[ua.x,ua.y,0,1];oa(wa,wa,en),Ca.push(new o(wa[0]/wa[3],wa[1]/wa[3]))}return Ca})(Be,be),Fr=(function(Zr,en,yn,Vn){let Ca=[],ua=[],wa=Vn[8]*en,Xa=Vn[9]*en,di=Vn[10]*en,oo=Vn[11]*en,as=Vn[8]*yn,eo=Vn[9]*yn,Ki=Vn[10]*yn,Co=Vn[11]*yn;for(let xo of Zr){let ho=[],oi=[];for(let Ro of xo){let Io=Ro.x,xs=Ro.y,mu=Vn[0]*Io+Vn[4]*xs+Vn[12],uu=Vn[1]*Io+Vn[5]*xs+Vn[13],tf=Vn[2]*Io+Vn[6]*xs+Vn[14],Qf=Vn[3]*Io+Vn[7]*xs+Vn[15],Ac=tf+di,Hc=Qf+oo,Rf=mu+as,Nf=uu+eo,jf=tf+Ki,rc=Qf+Co,ef=new o((mu+wa)/Hc,(uu+Xa)/Hc);ef.z=Ac/Hc,ho.push(ef);let Lf=new o(Rf/rc,Nf/rc);Lf.z=jf/rc,oi.push(Lf)}Ca.push(ho),ua.push(oi)}return[Ca,ua]})(Mt,lr,Qe,be);return(function(Zr,en,yn){let Vn=1/0;Sn(yn,en)&&(Vn=bh(yn,en[0]));for(let Ca=0;Ca$.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach($=>{this.gradients[$.id]={}}),this.layoutVertexArray=new tu,this.layoutVertexArray2=new gt,this.indexArray=new je,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.hasPattern=Ae("line",this.layers,$);let Mt=this.layers[0].layout.get("line-sort-key"),Bt=!Mt.isConstant(),jt=[];for(let{feature:oe,id:be,index:Be,sourceLayerIndex:Qe}of C){let lr=this.layers[0]._featureFilter.needGeometry,wr=cr(oe,lr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),wr,ht))continue;let Fr=Bt?Mt.evaluate(wr,{},ht):void 0,Zr={id:be,properties:oe.properties,type:oe.type,sourceLayerIndex:Qe,index:Be,geometry:lr?wr.geometry:nr(oe),patterns:{},sortKey:Fr};jt.push(Zr)}Bt&&jt.sort((oe,be)=>oe.sortKey-be.sortKey);for(let oe of jt){let{geometry:be,index:Be,sourceLayerIndex:Qe}=oe;if(this.hasPattern){let lr=Oe("line",this.layers,oe,this.zoom,$);this.patternFeatures.push(lr)}else this.addFeature(oe,be,Be,ht,{});$.featureIndex.insert(C[Be].feature,be,Be,Qe,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}addFeatures(C,$,ht){for(let Mt of this.patternFeatures)this.addFeature(Mt,Mt.geometry,Mt.index,$,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=C.createVertexBuffer(this.layoutVertexArray2,Ph)),this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(C){if(C.properties&&Object.prototype.hasOwnProperty.call(C.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(C.properties,"mapbox_clip_end"))return{start:+C.properties.mapbox_clip_start,end:+C.properties.mapbox_clip_end}}addFeature(C,$,ht,Mt,Bt){let jt=this.layers[0].layout,oe=jt.get("line-join").evaluate(C,{}),be=jt.get("line-cap"),Be=jt.get("line-miter-limit"),Qe=jt.get("line-round-limit");this.lineClips=this.lineFeatureClips(C);for(let lr of $)this.addLine(lr,C,oe,be,Be,Qe);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,Mt)}addLine(C,$,ht,Mt,Bt,jt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Vn=0;Vn=2&&C[be-1].equals(C[be-2]);)be--;let Be=0;for(;Be0;if(oo&&Vn>Be){let Co=wr.dist(Fr);if(Co>2*Qe){let xo=wr.sub(wr.sub(Fr)._mult(Qe/Co)._round());this.updateDistance(Fr,xo),this.addCurrentVertex(xo,en,0,0,lr),Fr=xo}}let eo=Fr&&Zr,Ki=eo?ht:oe?"butt":Mt;if(eo&&Ki==="round"&&(XaBt&&(Ki="bevel"),Ki==="bevel"&&(Xa>2&&(Ki="flipbevel"),Xa100)Ca=yn.mult(-1);else{let Co=Xa*en.add(yn).mag()/en.sub(yn).mag();Ca._perp()._mult(Co*(as?-1:1))}this.addCurrentVertex(wr,Ca,0,0,lr),this.addCurrentVertex(wr,Ca.mult(-1),0,0,lr)}else if(Ki==="bevel"||Ki==="fakeround"){let Co=-Math.sqrt(Xa*Xa-1),xo=as?Co:0,ho=as?0:Co;if(Fr&&this.addCurrentVertex(wr,en,xo,ho,lr),Ki==="fakeround"){let oi=Math.round(180*di/Math.PI/20);for(let Ro=1;Ro2*Qe){let xo=wr.add(Zr.sub(wr)._mult(Qe/Co)._round());this.updateDistance(wr,xo),this.addCurrentVertex(xo,yn,0,0,lr),wr=xo}}}}addCurrentVertex(C,$,ht,Mt,Bt,jt=!1){let oe=$.y*Mt-$.x,be=-$.y-$.x*Mt;this.addHalfVertex(C,$.x+$.y*ht,$.y-$.x*ht,jt,!1,ht,Bt),this.addHalfVertex(C,oe,be,jt,!0,-Mt,Bt),this.distance>Jf/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(C,$,ht,Mt,Bt,jt))}addHalfVertex({x:C,y:$},ht,Mt,Bt,jt,oe,be){let Be=.5*(this.lineClips?this.scaledDistance*(Jf-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((C<<1)+(Bt?1:0),($<<1)+(jt?1:0),Math.round(63*ht)+128,Math.round(63*Mt)+128,1+(oe===0?0:oe<0?-1:1)|(63&Be)<<2,Be>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Qe=be.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Qe),be.primitiveLength++),jt?this.e2=Qe:this.e1=Qe}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(C,$){this.distance+=C.dist($),this.updateScaledDistance()}}let op,wp;ca("LineBucket",zf,{omit:["layers","patternFeatures"]});var sp={get paint(){return wp=wp||new Pt({"line-opacity":new fo(nt.paint_line["line-opacity"]),"line-color":new fo(nt.paint_line["line-color"]),"line-translate":new Ui(nt.paint_line["line-translate"]),"line-translate-anchor":new Ui(nt.paint_line["line-translate-anchor"]),"line-width":new fo(nt.paint_line["line-width"]),"line-gap-width":new fo(nt.paint_line["line-gap-width"]),"line-offset":new fo(nt.paint_line["line-offset"]),"line-blur":new fo(nt.paint_line["line-blur"]),"line-dasharray":new ul(nt.paint_line["line-dasharray"]),"line-pattern":new Ql(nt.paint_line["line-pattern"]),"line-gradient":new Dc(nt.paint_line["line-gradient"])})},get layout(){return op=op||new Pt({"line-cap":new Ui(nt.layout_line["line-cap"]),"line-join":new fo(nt.layout_line["line-join"]),"line-miter-limit":new Ui(nt.layout_line["line-miter-limit"]),"line-round-limit":new Ui(nt.layout_line["line-round-limit"]),"line-sort-key":new fo(nt.layout_line["line-sort-key"])})}};class $c extends fo{possiblyEvaluate(C,$){return $=new fs(Math.floor($.zoom),{now:$.now,fadeDuration:$.fadeDuration,zoomHistory:$.zoomHistory,transition:$.transition}),super.possiblyEvaluate(C,$)}evaluate(C,$,ht,Mt){return $=k({},$,{zoom:Math.floor($.zoom)}),super.evaluate(C,$,ht,Mt)}}let Gh;class Tp extends at{constructor(C){super(C,sp),this.gradientVersion=0,Gh||(Gh=new $c(sp.paint.properties["line-width"].specification),Gh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(C){if(C==="line-gradient"){let $=this.gradientExpression();this.stepInterpolant=!!(function(ht){return ht._styleExpression!==void 0})($)&&$._styleExpression.expression instanceof vn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(C,$){super.recalculate(C,$),this.paint._values["line-floorwidth"]=Gh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,C)}createBucket(C){return new zf(C)}queryRadius(C){let $=C,ht=Jc(fn("line-width",this,$),fn("line-gap-width",this,$)),Mt=fn("line-offset",this,$);return ht/2+Math.abs(Mt)+Xn(this.paint.get("line-translate"))}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe){let be=jn(C,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,oe),Be=oe/2*Jc(this.paint.get("line-width").evaluate($,ht),this.paint.get("line-gap-width").evaluate($,ht)),Qe=this.paint.get("line-offset").evaluate($,ht);return Qe&&(Mt=(function(lr,wr){let Fr=[];for(let Zr=0;Zr=3){for(let yn=0;yn0?C+2*H:H}let lp=le([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gp=le([{name:"a_projected_pos",components:3,type:"Float32"}],4);le([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Zp=le([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);le([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let wh=le([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kp=le([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ec(H,C,$){return H.sections.forEach(ht=>{ht.text=(function(Mt,Bt,jt){let oe=Bt.layout.get("text-transform").evaluate(jt,{});return oe==="uppercase"?Mt=Mt.toLocaleUpperCase():oe==="lowercase"&&(Mt=Mt.toLocaleLowerCase()),ws.applyArabicShaping&&(Mt=ws.applyArabicShaping(Mt)),Mt})(ht.text,C,$)}),H}le([{name:"triangle",components:3,type:"Uint16"}]),le([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),le([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),le([{type:"Float32",name:"offsetX"}]),le([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),le([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Qc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ol=24,Ap=Ul,Kp=function(H,C,$,ht,Mt){var Bt,jt,oe=8*Mt-ht-1,be=(1<>1,Qe=-7,lr=Mt-1,wr=-1,Fr=H[C+lr];for(lr+=wr,Bt=Fr&(1<<-Qe)-1,Fr>>=-Qe,Qe+=oe;Qe>0;Bt=256*Bt+H[C+lr],lr+=wr,Qe-=8);for(jt=Bt&(1<<-Qe)-1,Bt>>=-Qe,Qe+=ht;Qe>0;jt=256*jt+H[C+lr],lr+=wr,Qe-=8);if(Bt===0)Bt=1-Be;else{if(Bt===be)return jt?NaN:1/0*(Fr?-1:1);jt+=Math.pow(2,ht),Bt-=Be}return(Fr?-1:1)*jt*Math.pow(2,Bt-ht)},P0=function(H,C,$,ht,Mt,Bt){var jt,oe,be,Be=8*Bt-Mt-1,Qe=(1<>1,wr=Mt===23?Math.pow(2,-24)-Math.pow(2,-77):0,Fr=0,Zr=1,en=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(oe=isNaN(C)?1:0,jt=Qe):(jt=Math.floor(Math.log(C)/Math.LN2),C*(be=Math.pow(2,-jt))<1&&(jt--,be*=2),(C+=jt+lr>=1?wr/be:wr*Math.pow(2,1-lr))*be>=2&&(jt++,be/=2),jt+lr>=Qe?(oe=0,jt=Qe):jt+lr>=1?(oe=(C*be-1)*Math.pow(2,Mt),jt+=lr):(oe=C*Math.pow(2,lr-1)*Math.pow(2,Mt),jt=0));Mt>=8;H[$+Fr]=255&oe,Fr+=Zr,oe/=256,Mt-=8);for(jt=jt<0;H[$+Fr]=255&jt,Fr+=Zr,jt/=256,Be-=8);H[$+Fr-Zr]|=128*en};function Ul(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Ul.Varint=0,Ul.Fixed64=1,Ul.Bytes=2,Ul.Fixed32=5;var Zh=4294967296,O0=1/Zh,Mp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Th(H){return H.type===Ul.Bytes?H.readVarint()+H.pos:H.pos+1}function Xm(H,C,$){return $?4294967296*C+(H>>>0):4294967296*(C>>>0)+(H>>>0)}function Yp(H,C,$){var ht=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(7*Math.LN2));$.realloc(ht);for(var Mt=$.pos-1;Mt>=H;Mt--)$.buf[Mt+ht]=$.buf[Mt]}function u_(H,C){for(var $=0;$>>8,H[$+2]=C>>>16,H[$+3]=C>>>24}function Rv(H,C){return(H[C]|H[C+1]<<8|H[C+2]<<16)+(H[C+3]<<24)}Ul.prototype={destroy:function(){this.buf=null},readFields:function(H,C,$){for($=$||this.length;this.pos<$;){var ht=this.readVarint(),Mt=ht>>3,Bt=this.pos;this.type=7&ht,H(Mt,C,this),this.pos===Bt&&this.skip(ht)}return C},readMessage:function(H,C){return this.readFields(H,C,this.readVarint()+this.pos)},readFixed32:function(){var H=F0(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Rv(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=F0(this.buf,this.pos)+F0(this.buf,this.pos+4)*Zh;return this.pos+=8,H},readSFixed64:function(){var H=F0(this.buf,this.pos)+Rv(this.buf,this.pos+4)*Zh;return this.pos+=8,H},readFloat:function(){var H=Kp(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Kp(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var C,$,ht=this.buf;return C=127&($=ht[this.pos++]),$<128?C:(C|=(127&($=ht[this.pos++]))<<7,$<128?C:(C|=(127&($=ht[this.pos++]))<<14,$<128?C:(C|=(127&($=ht[this.pos++]))<<21,$<128?C:(function(Mt,Bt,jt){var oe,be,Be=jt.buf;if(oe=(112&(be=Be[jt.pos++]))>>4,be<128||(oe|=(127&(be=Be[jt.pos++]))<<3,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<10,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<17,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<24,be<128)||(oe|=(1&(be=Be[jt.pos++]))<<31,be<128))return Xm(Mt,oe,Bt);throw new Error("Expected varint not more than 10 bytes")})(C|=(15&($=ht[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,C=this.pos;return this.pos=H,H-C>=12&&Mp?(function($,ht,Mt){return Mp.decode($.subarray(ht,Mt))})(this.buf,C,H):(function($,ht,Mt){for(var Bt="",jt=ht;jt239?4:Qe>223?3:Qe>191?2:1;if(jt+wr>Mt)break;wr===1?Qe<128&&(lr=Qe):wr===2?(192&(oe=$[jt+1]))==128&&(lr=(31&Qe)<<6|63&oe)<=127&&(lr=null):wr===3?(be=$[jt+2],(192&(oe=$[jt+1]))==128&&(192&be)==128&&((lr=(15&Qe)<<12|(63&oe)<<6|63&be)<=2047||lr>=55296&&lr<=57343)&&(lr=null)):wr===4&&(be=$[jt+2],Be=$[jt+3],(192&(oe=$[jt+1]))==128&&(192&be)==128&&(192&Be)==128&&((lr=(15&Qe)<<18|(63&oe)<<12|(63&be)<<6|63&Be)<=65535||lr>=1114112)&&(lr=null)),lr===null?(lr=65533,wr=1):lr>65535&&(lr-=65536,Bt+=String.fromCharCode(lr>>>10&1023|55296),lr=56320|1023&lr),Bt+=String.fromCharCode(lr),jt+=wr}return Bt})(this.buf,C,H)},readBytes:function(){var H=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,H);return this.pos=H,C},readPackedVarint:function(H,C){if(this.type!==Ul.Bytes)return H.push(this.readVarint(C));var $=Th(this);for(H=H||[];this.pos<$;)H.push(this.readVarint(C));return H},readPackedSVarint:function(H){if(this.type!==Ul.Bytes)return H.push(this.readSVarint());var C=Th(this);for(H=H||[];this.pos127;);else if(C===Ul.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Ul.Fixed32)this.pos+=4;else{if(C!==Ul.Fixed64)throw new Error("Unimplemented type: "+C);this.pos+=8}},writeTag:function(H,C){this.writeVarint(H<<3|C)},realloc:function(H){for(var C=this.length||16;C268435455||H<0?(function(C,$){var ht,Mt;if(C>=0?(ht=C%4294967296|0,Mt=C/4294967296|0):(Mt=~(-C/4294967296),4294967295^(ht=~(-C%4294967296))?ht=ht+1|0:(ht=0,Mt=Mt+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");$.realloc(10),(function(Bt,jt,oe){oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,oe.buf[oe.pos]=127&(Bt>>>=7)})(ht,0,$),(function(Bt,jt){var oe=(7&Bt)<<4;jt.buf[jt.pos++]|=oe|((Bt>>>=3)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt)))))})(Mt,$)})(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var C=this.pos;this.pos=(function(ht,Mt,Bt){for(var jt,oe,be=0;be55295&&jt<57344){if(!oe){jt>56319||be+1===Mt.length?(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189):oe=jt;continue}if(jt<56320){ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,oe=jt;continue}jt=oe-55296<<10|jt-56320|65536,oe=null}else oe&&(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,oe=null);jt<128?ht[Bt++]=jt:(jt<2048?ht[Bt++]=jt>>6|192:(jt<65536?ht[Bt++]=jt>>12|224:(ht[Bt++]=jt>>18|240,ht[Bt++]=jt>>12&63|128),ht[Bt++]=jt>>6&63|128),ht[Bt++]=63&jt|128)}return Bt})(this.buf,H,this.pos);var $=this.pos-C;$>=128&&Yp(C,$,this),this.pos=C-1,this.writeVarint($),this.pos+=$},writeFloat:function(H){this.realloc(4),P0(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),P0(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var C=H.length;this.writeVarint(C),this.realloc(C);for(var $=0;$=128&&Yp($,ht,this),this.pos=$-1,this.writeVarint(ht),this.pos+=ht},writeMessage:function(H,C,$){this.writeTag(H,Ul.Bytes),this.writeRawMessage(C,$)},writePackedVarint:function(H,C){C.length&&this.writeMessage(H,u_,C)},writePackedSVarint:function(H,C){C.length&&this.writeMessage(H,c_,C)},writePackedBoolean:function(H,C){C.length&&this.writeMessage(H,p_,C)},writePackedFloat:function(H,C){C.length&&this.writeMessage(H,f_,C)},writePackedDouble:function(H,C){C.length&&this.writeMessage(H,h_,C)},writePackedFixed32:function(H,C){C.length&&this.writeMessage(H,d_,C)},writePackedSFixed32:function(H,C){C.length&&this.writeMessage(H,m_,C)},writePackedFixed64:function(H,C){C.length&&this.writeMessage(H,g_,C)},writePackedSFixed64:function(H,C){C.length&&this.writeMessage(H,D0,C)},writeBytesField:function(H,C){this.writeTag(H,Ul.Bytes),this.writeBytes(C)},writeFixed32Field:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeSFixed64(C)},writeVarintField:function(H,C){this.writeTag(H,Ul.Varint),this.writeVarint(C)},writeSVarintField:function(H,C){this.writeTag(H,Ul.Varint),this.writeSVarint(C)},writeStringField:function(H,C){this.writeTag(H,Ul.Bytes),this.writeString(C)},writeFloatField:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeFloat(C)},writeDoubleField:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeDouble(C)},writeBooleanField:function(H,C){this.writeVarintField(H,!!C)}};var $m=r(Ap);let B0=3;function v_(H,C,$){H===1&&$.readMessage(Nv,C)}function Nv(H,C,$){if(H===3){let{id:ht,bitmap:Mt,width:Bt,height:jt,left:oe,top:be,advance:Be}=$.readMessage(Jm,{});C.push({id:ht,bitmap:new ds({width:Bt+2*B0,height:jt+2*B0},Mt),metrics:{width:Bt,height:jt,left:oe,top:be,advance:Be}})}}function Jm(H,C,$){H===1?C.id=$.readVarint():H===2?C.bitmap=$.readBytes():H===3?C.width=$.readVarint():H===4?C.height=$.readVarint():H===5?C.left=$.readSVarint():H===6?C.top=$.readSVarint():H===7&&(C.advance=$.readVarint())}let Qm=B0;function R0(H){let C=0,$=0;for(let jt of H)C+=jt.w*jt.h,$=Math.max($,jt.w);H.sort((jt,oe)=>oe.h-jt.h);let ht=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(C/.95)),$),h:1/0}],Mt=0,Bt=0;for(let jt of H)for(let oe=ht.length-1;oe>=0;oe--){let be=ht[oe];if(!(jt.w>be.w||jt.h>be.h)){if(jt.x=be.x,jt.y=be.y,Bt=Math.max(Bt,jt.y+jt.h),Mt=Math.max(Mt,jt.x+jt.w),jt.w===be.w&&jt.h===be.h){let Be=ht.pop();oe=0&&ht>=C&&j0[this.text.charCodeAt(ht)];ht--)$--;this.text=this.text.substring(C,$),this.sectionIndex=this.sectionIndex.slice(C,$)}substring(C,$){let ht=new Jp;return ht.text=this.text.substring(C,$),ht.sectionIndex=this.sectionIndex.slice(C,$),ht.sections=this.sections,ht}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((C,$)=>Math.max(C,this.sections[$].scale),0)}addTextSection(C,$){this.text+=C.text,this.sections.push(Gd.forText(C.scale,C.fontStack||$));let ht=this.sections.length-1;for(let Mt=0;Mt=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function N0(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr){let en=Jp.fromFeature(H,Mt),yn;lr===t.ah.vertical&&en.verticalizePunctuation();let{processBidirectionalText:Vn,processStyledBidirectionalText:Ca}=ws;if(Vn&&en.sections.length===1){yn=[];let Xa=Vn(en.toString(),Sp(en,Be,Bt,C,ht,Fr));for(let di of Xa){let oo=new Jp;oo.text=di,oo.sections=en.sections;for(let as=0;as0&&xh>hf&&(hf=xh)}else{let gu=oo[vl.fontStack],pf=gu&&gu[eu];if(pf&&pf.rect)sd=pf.rect,Lu=pf.metrics;else{let xh=di[vl.fontStack],hh=xh&&xh[eu];if(!hh)continue;Lu=hh.metrics}Xu=(ef-vl.scale)*Ol}Cf?(Xa.verticalizable=!0,Uf.push({glyph:eu,imageName:kh,x:xs,y:mu+Xu,vertical:Cf,scale:vl.scale,fontStack:vl.fontStack,sectionIndex:Vl,metrics:Lu,rect:sd}),xs+=Ah*vl.scale+oi):(Uf.push({glyph:eu,imageName:kh,x:xs,y:mu+Xu,vertical:Cf,scale:vl.scale,fontStack:vl.fontStack,sectionIndex:Vl,metrics:Lu,rect:sd}),xs+=Lu.advance*vl.scale+oi)}Uf.length!==0&&(uu=Math.max(xs-oi,uu),__(Uf,0,Uf.length-1,Qf,hf)),xs=0;let fh=Ki*ef+hf;wf.lineOffset=Math.max(hf,Lf),mu+=fh,tf=Math.max(fh,tf),++Ac}var Hc;let Rf=mu-$p,{horizontalAlign:Nf,verticalAlign:jf}=eg(Co);(function(rc,ef,Lf,wf,Uf,hf,fh,zu,vl){let Vl=(ef-Lf)*Uf,eu=0;eu=hf!==fh?-zu*wf-$p:(-wf*vl+.5)*fh;for(let Xu of rc)for(let Lu of Xu.positionedGlyphs)Lu.x+=Vl,Lu.y+=eu})(Xa.positionedLines,Qf,Nf,jf,uu,tf,Ki,Rf,eo.length),Xa.top+=-jf*Rf,Xa.bottom=Xa.top+Rf,Xa.left+=-Nf*uu,Xa.right=Xa.left+uu})(wa,C,$,ht,yn,jt,oe,be,lr,Be,wr,Zr),!(function(Xa){for(let di of Xa)if(di.positionedGlyphs.length!==0)return!1;return!0})(ua)&&wa}let j0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},y_={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},x_={40:!0};function U0(H,C,$,ht,Mt,Bt){if(C.imageName){let jt=ht[C.imageName];return jt?jt.displaySize[0]*C.scale*Ol/Bt+Mt:0}{let jt=$[C.fontStack],oe=jt&&jt[H];return oe?oe.metrics.advance*C.scale+Mt:0}}function Uv(H,C,$,ht){let Mt=Math.pow(H-C,2);return ht?H=0,Be=0;for(let lr=0;lrBe){let Qe=Math.ceil(Bt/Be);Mt*=Qe/jt,jt=Qe}return{x1:ht,y1:Mt,x2:ht+Bt,y2:Mt+jt}}function Hv(H,C,$,ht,Mt,Bt){let jt=H.image,oe;if(jt.content){let yn=jt.content,Vn=jt.pixelRatio||1;oe=[yn[0]/Vn,yn[1]/Vn,jt.displaySize[0]-yn[2]/Vn,jt.displaySize[1]-yn[3]/Vn]}let be=C.left*Bt,Be=C.right*Bt,Qe,lr,wr,Fr;$==="width"||$==="both"?(Fr=Mt[0]+be-ht[3],lr=Mt[0]+Be+ht[1]):(Fr=Mt[0]+(be+Be-jt.displaySize[0])/2,lr=Fr+jt.displaySize[0]);let Zr=C.top*Bt,en=C.bottom*Bt;return $==="height"||$==="both"?(Qe=Mt[1]+Zr-ht[0],wr=Mt[1]+en+ht[2]):(Qe=Mt[1]+(Zr+en-jt.displaySize[1])/2,wr=Qe+jt.displaySize[1]),{image:jt,top:Qe,right:lr,bottom:wr,left:Fr,collisionPadding:oe}}let Zd=255,Oh=128,cp=Zd*Oh;function qv(H,C){let{expression:$}=C;if($.kind==="constant")return{kind:"constant",layoutSize:$.evaluate(new fs(H+1))};if($.kind==="source")return{kind:"source"};{let{zoomStops:ht,interpolationType:Mt}=$,Bt=0;for(;Btjt.id),this.index=C.index,this.pixelRatio=C.pixelRatio,this.sourceLayerIndex=C.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=An([]),this.placementViewportMatrix=An([]);let $=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qv(this.zoom,$["text-size"]),this.iconSizeData=qv(this.zoom,$["icon-size"]);let ht=this.layers[0].layout,Mt=ht.get("symbol-sort-key"),Bt=ht.get("symbol-z-order");this.canOverlap=rg(ht,"text-overlap","text-allow-overlap")!=="never"||rg(ht,"icon-overlap","icon-allow-overlap")!=="never"||ht.get("text-ignore-placement")||ht.get("icon-ignore-placement"),this.sortFeaturesByKey=Bt!=="viewport-y"&&!Mt.isConstant(),this.sortFeaturesByY=(Bt==="viewport-y"||Bt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,ht.get("symbol-placement")==="point"&&(this.writingModes=ht.get("text-writing-mode").map(jt=>t.ah[jt])),this.stateDependentLayerIds=this.layers.filter(jt=>jt.isStateDependent()).map(jt=>jt.id),this.sourceID=C.sourceID}createArrays(){this.text=new uc(new Ts(this.layers,this.zoom,C=>/^text/.test(C))),this.icon=new uc(new Ts(this.layers,this.zoom,C=>/^icon/.test(C))),this.glyphOffsetArray=new Go,this.lineVertexArray=new Xo,this.symbolInstances=new Yi,this.textAnchorOffsets=new Qo}calculateGlyphDependencies(C,$,ht,Mt,Bt){for(let jt=0;jt0)&&(jt.value.kind!=="constant"||jt.value.value.length>0),Qe=be.value.kind!=="constant"||!!be.value.value||Object.keys(be.parameters).length>0,lr=Bt.get("symbol-sort-key");if(this.features=[],!Be&&!Qe)return;let wr=$.iconDependencies,Fr=$.glyphDependencies,Zr=$.availableImages,en=new fs(this.zoom);for(let{feature:yn,id:Vn,index:Ca,sourceLayerIndex:ua}of C){let wa=Mt._featureFilter.needGeometry,Xa=cr(yn,wa);if(!Mt._featureFilter.filter(en,Xa,ht))continue;let di,oo;if(wa||(Xa.geometry=nr(yn)),Be){let eo=Mt.getValueAndResolveTokens("text-field",Xa,ht,Zr),Ki=Yr.factory(eo),Co=this.hasRTLText=this.hasRTLText||T_(Ki);(!Co||ws.getRTLTextPluginStatus()==="unavailable"||Co&&ws.isParsed())&&(di=ec(Ki,Mt,Xa))}if(Qe){let eo=Mt.getValueAndResolveTokens("icon-image",Xa,ht,Zr);oo=eo instanceof Kn?eo:Kn.fromString(eo)}if(!di&&!oo)continue;let as=this.sortFeaturesByKey?lr.evaluate(Xa,{},ht):void 0;if(this.features.push({id:Vn,text:di,icon:oo,index:Ca,sourceLayerIndex:ua,geometry:Xa.geometry,properties:yn.properties,type:w_[yn.type],sortKey:as}),oo&&(wr[oo.name]=!0),di){let eo=jt.evaluate(Xa,{},ht).join(","),Ki=Bt.get("text-rotation-alignment")!=="viewport"&&Bt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let Co of di.sections)if(Co.image)wr[Co.image.name]=!0;else{let xo=$i(di.toString()),ho=Co.fontStack||eo,oi=Fr[ho]=Fr[ho]||{};this.calculateGlyphDependencies(Co.text,oi,Ki,this.allowVerticalPlacement,xo)}}}Bt.get("symbol-placement")==="line"&&(this.features=(function(yn){let Vn={},Ca={},ua=[],wa=0;function Xa(eo){ua.push(yn[eo]),wa++}function di(eo,Ki,Co){let xo=Ca[eo];return delete Ca[eo],Ca[Ki]=xo,ua[xo].geometry[0].pop(),ua[xo].geometry[0]=ua[xo].geometry[0].concat(Co[0]),xo}function oo(eo,Ki,Co){let xo=Vn[Ki];return delete Vn[Ki],Vn[eo]=xo,ua[xo].geometry[0].shift(),ua[xo].geometry[0]=Co[0].concat(ua[xo].geometry[0]),xo}function as(eo,Ki,Co){let xo=Co?Ki[0][Ki[0].length-1]:Ki[0][0];return`${eo}:${xo.x}:${xo.y}`}for(let eo=0;eoeo.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((yn,Vn)=>yn.sortKey-Vn.sortKey)}update(C,$,ht){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(C,$,this.layers,ht),this.icon.programConfigurations.updatePaintArrays(C,$,this.layers,ht))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(C){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(C),this.iconCollisionBox.upload(C)),this.text.upload(C,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(C,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(C,$){let ht=this.lineVertexArray.length;if(C.segment!==void 0){let Mt=C.dist($[C.segment+1]),Bt=C.dist($[C.segment]),jt={};for(let oe=C.segment+1;oe<$.length;oe++)jt[oe]={x:$[oe].x,y:$[oe].y,tileUnitDistanceFromAnchor:Mt},oe<$.length-1&&(Mt+=$[oe+1].dist($[oe]));for(let oe=C.segment||0;oe>=0;oe--)jt[oe]={x:$[oe].x,y:$[oe].y,tileUnitDistanceFromAnchor:Bt},oe>0&&(Bt+=$[oe-1].dist($[oe]));for(let oe=0;oe<$.length;oe++){let be=jt[oe];this.lineVertexArray.emplaceBack(be.x,be.y,be.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ht,lineLength:this.lineVertexArray.length-ht}}addSymbols(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr){let Fr=C.indexArray,Zr=C.layoutVertexArray,en=C.segments.prepareSegment(4*$.length,Zr,Fr,this.canOverlap?jt.sortKey:void 0),yn=this.glyphOffsetArray.length,Vn=en.vertexLength,Ca=this.allowVerticalPlacement&&oe===t.ah.vertical?Math.PI/2:0,ua=jt.text&&jt.text.sections;for(let wa=0;wa<$.length;wa++){let{tl:Xa,tr:di,bl:oo,br:as,tex:eo,pixelOffsetTL:Ki,pixelOffsetBR:Co,minFontScaleX:xo,minFontScaleY:ho,glyphOffset:oi,isSDF:Ro,sectionIndex:Io}=$[wa],xs=en.vertexLength,mu=oi[1];H0(Zr,be.x,be.y,Xa.x,mu+Xa.y,eo.x,eo.y,ht,Ro,Ki.x,Ki.y,xo,ho),H0(Zr,be.x,be.y,di.x,mu+di.y,eo.x+eo.w,eo.y,ht,Ro,Co.x,Ki.y,xo,ho),H0(Zr,be.x,be.y,oo.x,mu+oo.y,eo.x,eo.y+eo.h,ht,Ro,Ki.x,Co.y,xo,ho),H0(Zr,be.x,be.y,as.x,mu+as.y,eo.x+eo.w,eo.y+eo.h,ht,Ro,Co.x,Co.y,xo,ho),fp(C.dynamicLayoutVertexArray,be,Ca),Fr.emplaceBack(xs,xs+1,xs+2),Fr.emplaceBack(xs+1,xs+2,xs+3),en.vertexLength+=4,en.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(oi[0]),wa!==$.length-1&&Io===$[wa+1].sectionIndex||C.programConfigurations.populatePaintArrays(Zr.length,jt,jt.index,{},wr,ua&&ua[Io])}C.placedSymbolArray.emplaceBack(be.x,be.y,yn,this.glyphOffsetArray.length-yn,Vn,Be,Qe,be.segment,ht?ht[0]:0,ht?ht[1]:0,Mt[0],Mt[1],oe,0,!1,0,lr)}_addCollisionDebugVertex(C,$,ht,Mt,Bt,jt){return $.emplaceBack(0,0),C.emplaceBack(ht.x,ht.y,Mt,Bt,Math.round(jt.x),Math.round(jt.y))}addCollisionDebugVertices(C,$,ht,Mt,Bt,jt,oe){let be=Bt.segments.prepareSegment(4,Bt.layoutVertexArray,Bt.indexArray),Be=be.vertexLength,Qe=Bt.layoutVertexArray,lr=Bt.collisionVertexArray,wr=oe.anchorX,Fr=oe.anchorY;this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(C,$)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(ht,$)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(ht,Mt)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(C,Mt)),be.vertexLength+=4;let Zr=Bt.indexArray;Zr.emplaceBack(Be,Be+1),Zr.emplaceBack(Be+1,Be+2),Zr.emplaceBack(Be+2,Be+3),Zr.emplaceBack(Be+3,Be),be.primitiveLength+=4}addDebugCollisionBoxes(C,$,ht,Mt){for(let Bt=C;Bt<$;Bt++){let jt=this.collisionBoxArray.get(Bt);this.addCollisionDebugVertices(jt.x1,jt.y1,jt.x2,jt.y2,Mt?this.textCollisionBox:this.iconCollisionBox,jt.anchorPoint,ht)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Qp(we,wh.members,or),this.iconCollisionBox=new Qp(we,wh.members,or);for(let C=0;C0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(C,$){let ht=C.placedSymbolArray.get($),Mt=ht.vertexStartIndex+4*ht.numGlyphs;for(let Bt=ht.vertexStartIndex;BtMt[oe]-Mt[be]||Bt[be]-Bt[oe]),jt}addToSortKeyRanges(C,$){let ht=this.sortKeyRanges[this.sortKeyRanges.length-1];ht&&ht.sortKey===$?ht.symbolInstanceEnd=C+1:this.sortKeyRanges.push({sortKey:$,symbolInstanceStart:C,symbolInstanceEnd:C+1})}sortFeatures(C){if(this.sortFeaturesByY&&this.sortedAngle!==C&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let $ of this.symbolInstanceIndexes){let ht=this.symbolInstances.get($);this.featureSortOrder.push(ht.featureIndex),[ht.rightJustifiedTextSymbolIndex,ht.centerJustifiedTextSymbolIndex,ht.leftJustifiedTextSymbolIndex].forEach((Mt,Bt,jt)=>{Mt>=0&&jt.indexOf(Mt)===Bt&&this.addIndicesForPlacedSymbol(this.text,Mt)}),ht.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,ht.verticalPlacedTextSymbolIndex),ht.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ht.placedIconSymbolIndex),ht.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ht.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Kd,Yd;ca("SymbolBucket",Ep,{omit:["layers","collisionBoxArray","features","compareText"]}),Ep.MAX_GLYPHS=65535,Ep.addDynamicAttributes=fp;var ag={get paint(){return Yd=Yd||new Pt({"icon-opacity":new fo(nt.paint_symbol["icon-opacity"]),"icon-color":new fo(nt.paint_symbol["icon-color"]),"icon-halo-color":new fo(nt.paint_symbol["icon-halo-color"]),"icon-halo-width":new fo(nt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new fo(nt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ui(nt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ui(nt.paint_symbol["icon-translate-anchor"]),"text-opacity":new fo(nt.paint_symbol["text-opacity"]),"text-color":new fo(nt.paint_symbol["text-color"],{runtimeType:We,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new fo(nt.paint_symbol["text-halo-color"]),"text-halo-width":new fo(nt.paint_symbol["text-halo-width"]),"text-halo-blur":new fo(nt.paint_symbol["text-halo-blur"]),"text-translate":new Ui(nt.paint_symbol["text-translate"]),"text-translate-anchor":new Ui(nt.paint_symbol["text-translate-anchor"])})},get layout(){return Kd=Kd||new Pt({"symbol-placement":new Ui(nt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ui(nt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ui(nt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new fo(nt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ui(nt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ui(nt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ui(nt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ui(nt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ui(nt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ui(nt.layout_symbol["icon-rotation-alignment"]),"icon-size":new fo(nt.layout_symbol["icon-size"]),"icon-text-fit":new Ui(nt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ui(nt.layout_symbol["icon-text-fit-padding"]),"icon-image":new fo(nt.layout_symbol["icon-image"]),"icon-rotate":new fo(nt.layout_symbol["icon-rotate"]),"icon-padding":new fo(nt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ui(nt.layout_symbol["icon-keep-upright"]),"icon-offset":new fo(nt.layout_symbol["icon-offset"]),"icon-anchor":new fo(nt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ui(nt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ui(nt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ui(nt.layout_symbol["text-rotation-alignment"]),"text-field":new fo(nt.layout_symbol["text-field"]),"text-font":new fo(nt.layout_symbol["text-font"]),"text-size":new fo(nt.layout_symbol["text-size"]),"text-max-width":new fo(nt.layout_symbol["text-max-width"]),"text-line-height":new Ui(nt.layout_symbol["text-line-height"]),"text-letter-spacing":new fo(nt.layout_symbol["text-letter-spacing"]),"text-justify":new fo(nt.layout_symbol["text-justify"]),"text-radial-offset":new fo(nt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ui(nt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new fo(nt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new fo(nt.layout_symbol["text-anchor"]),"text-max-angle":new Ui(nt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ui(nt.layout_symbol["text-writing-mode"]),"text-rotate":new fo(nt.layout_symbol["text-rotate"]),"text-padding":new Ui(nt.layout_symbol["text-padding"]),"text-keep-upright":new Ui(nt.layout_symbol["text-keep-upright"]),"text-transform":new fo(nt.layout_symbol["text-transform"]),"text-offset":new fo(nt.layout_symbol["text-offset"]),"text-allow-overlap":new Ui(nt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ui(nt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ui(nt.layout_symbol["text-ignore-placement"]),"text-optional":new Ui(nt.layout_symbol["text-optional"])})}};class td{constructor(C){if(C.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=C.property.overrides?C.property.overrides.runtimeType:Kt,this.defaultValue=C}evaluate(C){if(C.formattedSection){let $=this.defaultValue.property.overrides;if($&&$.hasOverride(C.formattedSection))return $.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default}eachChild(C){this.defaultValue.isConstant()||C(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ca("FormatSectionOverride",td,{omit:["defaultValue"]});class q0 extends at{constructor(C){super(C,ag)}recalculate(C,$){if(super.recalculate(C,$),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let ht=this.layout.get("text-writing-mode");if(ht){let Mt=[];for(let Bt of ht)Mt.indexOf(Bt)<0&&Mt.push(Bt);this.layout._values["text-writing-mode"]=Mt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(C,$,ht,Mt){let Bt=this.layout.get(C).evaluate($,{},ht,Mt),jt=this._unevaluatedLayout._values[C];return jt.isDataDriven()||Gu(jt.value)||!Bt?Bt:(function(oe,be){return be.replace(/{([^{}]+)}/g,(Be,Qe)=>oe&&Qe in oe?String(oe[Qe]):"")})($.properties,Bt)}createBucket(C){return new Ep(C)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let C of ag.paint.overridableProperties){if(!q0.hasPaintOverride(this.layout,C))continue;let $=this.paint.get(C),ht=new td($),Mt=new Kl(ht,$.property.specification),Bt=null;Bt=$.value.kind==="constant"||$.value.kind==="source"?new Ou("source",Mt):new Rl("composite",Mt,$.value.zoomStops),this.paint._values[C]=new nl($.property,Bt,$.parameters)}}_handleOverridablePaintPropertyUpdate(C,$,ht){return!(!this.layout||$.isDataDriven()||ht.isDataDriven())&&q0.hasPaintOverride(this.layout,C)}static hasPaintOverride(C,$){let ht=C.get("text-field"),Mt=ag.paint.properties[$],Bt=!1,jt=oe=>{for(let be of oe)if(Mt.overrides&&Mt.overrides.hasOverride(be))return void(Bt=!0)};if(ht.value.kind==="constant"&&ht.value.value instanceof Yr)jt(ht.value.value.sections);else if(ht.value.kind==="source"){let oe=Be=>{Bt||(Be instanceof Ga&&Cn(Be.value)===er?jt(Be.value.sections):Be instanceof ts?jt(Be.sections):Be.eachChild(oe))},be=ht.value;be._styleExpression&&oe(be._styleExpression.expression)}return Bt}}let ig;var Wv={get paint(){return ig=ig||new Pt({"background-color":new Ui(nt.paint_background["background-color"]),"background-pattern":new ul(nt.paint_background["background-pattern"]),"background-opacity":new Ui(nt.paint_background["background-opacity"])})}};class Xd extends at{constructor(C){super(C,Wv)}}let W0;var og={get paint(){return W0=W0||new Pt({"raster-opacity":new Ui(nt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ui(nt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ui(nt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ui(nt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ui(nt.paint_raster["raster-saturation"]),"raster-contrast":new Ui(nt.paint_raster["raster-contrast"]),"raster-resampling":new Ui(nt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ui(nt.paint_raster["raster-fade-duration"])})}};class k_ extends at{constructor(C){super(C,og)}}class Gv extends at{constructor(C){super(C,{}),this.onAdd=$=>{this.implementation.onAdd&&this.implementation.onAdd($,$.painter.context.gl)},this.onRemove=$=>{this.implementation.onRemove&&this.implementation.onRemove($,$.painter.context.gl)},this.implementation=C}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class $d{constructor(C){this._methodToThrottle=C,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let sg=63710088e-1;class Dh{constructor(C,$){if(isNaN(C)||isNaN($))throw new Error(`Invalid LngLat object: (${C}, ${$})`);if(this.lng=+C,this.lat=+$,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Dh(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(C){let $=Math.PI/180,ht=this.lat*$,Mt=C.lat*$,Bt=Math.sin(ht)*Math.sin(Mt)+Math.cos(ht)*Math.cos(Mt)*Math.cos((C.lng-this.lng)*$);return sg*Math.acos(Math.min(Bt,1))}static convert(C){if(C instanceof Dh)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Dh(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Dh(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Zv=2*Math.PI*sg;function G0(H){return Zv*Math.cos(H*Math.PI/180)}function Z0(H){return(180+H)/360}function Kv(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function yh(H,C){return H/G0(C)}function lg(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class Jd{constructor(C,$,ht=0){this.x=+C,this.y=+$,this.z=+ht}static fromLngLat(C,$=0){let ht=Dh.convert(C);return new Jd(Z0(ht.lng),Kv(ht.lat),yh($,ht.lat))}toLngLat(){return new Dh(360*this.x-180,lg(this.y))}toAltitude(){return this.z*G0(lg(this.y))}meterInMercatorCoordinateUnits(){return 1/Zv*(C=lg(this.y),1/Math.cos(C*Math.PI/180));var C}}function Yv(H,C,$){var ht=2*Math.PI*6378137/256/Math.pow(2,$);return[H*ht-2*Math.PI*6378137/2,C*ht-2*Math.PI*6378137/2]}class ug{constructor(C,$,ht){if(!(function(Mt,Bt,jt){return!(Mt<0||Mt>25||jt<0||jt>=Math.pow(2,Mt)||Bt<0||Bt>=Math.pow(2,Mt))})(C,$,ht))throw new Error(`x=${$}, y=${ht}, z=${C} outside of bounds. 0<=x<${Math.pow(2,C)}, 0<=y<${Math.pow(2,C)} 0<=z<=25 `);this.z=C,this.x=$,this.y=ht,this.key=ed(0,C,C,$,ht)}equals(C){return this.z===C.z&&this.x===C.x&&this.y===C.y}url(C,$,ht){let Mt=(jt=this.y,oe=this.z,be=Yv(256*(Bt=this.x),256*(jt=Math.pow(2,oe)-jt-1),oe),Be=Yv(256*(Bt+1),256*(jt+1),oe),be[0]+","+be[1]+","+Be[0]+","+Be[1]);var Bt,jt,oe,be,Be;let Qe=(function(lr,wr,Fr){let Zr,en="";for(let yn=lr;yn>0;yn--)Zr=1<1?"@2x":"").replace(/{quadkey}/g,Qe).replace(/{bbox-epsg-3857}/g,Mt)}isChildOf(C){let $=this.z-C.z;return $>0&&C.x===this.x>>$&&C.y===this.y>>$}getTilePoint(C){let $=Math.pow(2,this.z);return new o((C.x*$-this.x)*zs,(C.y*$-this.y)*zs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Xv{constructor(C,$){this.wrap=C,this.canonical=$,this.key=ed(C,$.z,$.z,$.x,$.y)}}class dh{constructor(C,$,ht,Mt,Bt){if(C= z; overscaledZ = ${C}; z = ${ht}`);this.overscaledZ=C,this.wrap=$,this.canonical=new ug(ht,+Mt,+Bt),this.key=ed($,C,ht,Mt,Bt)}clone(){return new dh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)}scaledTo(C){if(C>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${C}; overscaledZ = ${this.overscaledZ}`);let $=this.canonical.z-C;return C>this.canonical.z?new dh(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new dh(C,this.wrap,C,this.canonical.x>>$,this.canonical.y>>$)}calculateScaledKey(C,$){if(C>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${C}; overscaledZ = ${this.overscaledZ}`);let ht=this.canonical.z-C;return C>this.canonical.z?ed(this.wrap*+$,C,this.canonical.z,this.canonical.x,this.canonical.y):ed(this.wrap*+$,C,C,this.canonical.x>>ht,this.canonical.y>>ht)}isChildOf(C){if(C.wrap!==this.wrap)return!1;let $=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>$&&C.canonical.y===this.canonical.y>>$}children(C){if(this.overscaledZ>=C)return[new dh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let $=this.canonical.z+1,ht=2*this.canonical.x,Mt=2*this.canonical.y;return[new dh($,this.wrap,$,ht,Mt),new dh($,this.wrap,$,ht+1,Mt),new dh($,this.wrap,$,ht,Mt+1),new dh($,this.wrap,$,ht+1,Mt+1)]}isLessThan(C){return this.wrapC.wrap)&&(this.overscaledZC.overscaledZ)&&(this.canonical.xC.canonical.x)&&this.canonical.ythis.max&&(this.max=lr),lr=this.dim+1||$<-1||$>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return($+1)*this.stride+(C+1)}unpack(C,$,ht){return C*this.redFactor+$*this.greenFactor+ht*this.blueFactor-this.baseShift}getPixels(){return new rs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(C,$,ht){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");let Mt=$*this.dim,Bt=$*this.dim+this.dim,jt=ht*this.dim,oe=ht*this.dim+this.dim;switch($){case-1:Mt=Bt-1;break;case 1:Bt=Mt+1}switch(ht){case-1:jt=oe-1;break;case 1:oe=jt+1}let be=-$*this.dim,Be=-ht*this.dim;for(let Qe=jt;Qe=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${C} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[C]}}class Jv{constructor(C,$,ht,Mt,Bt){this.type="Feature",this._vectorTileFeature=C,C._z=$,C._x=ht,C._y=Mt,this.properties=C.properties,this.id=Bt}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(C){this._geometry=C}toJSON(){let C={geometry:this.geometry};for(let $ in this)$!=="_geometry"&&$!=="_vectorTileFeature"&&(C[$]=this[$]);return C}}class Qv{constructor(C,$){this.tileID=C,this.x=C.canonical.x,this.y=C.canonical.y,this.z=C.canonical.z,this.grid=new Ba(zs,16,0),this.grid3D=new Ba(zs,16,0),this.featureIndexArray=new Us,this.promoteId=$}insert(C,$,ht,Mt,Bt,jt){let oe=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ht,Mt,Bt);let be=jt?this.grid3D:this.grid;for(let Be=0;Be<$.length;Be++){let Qe=$[Be],lr=[1/0,1/0,-1/0,-1/0];for(let wr=0;wr=0&&lr[3]>=0&&be.insert(oe,lr[0],lr[1],lr[2],lr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Dn.VectorTile(new $m(this.rawTileData)).layers,this.sourceLayerCoder=new $v(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(C,$,ht,Mt){this.loadVTLayers();let Bt=C.params||{},jt=zs/C.tileSize/C.scale,oe=bc(Bt.filter),be=C.queryGeometry,Be=C.queryPadding*jt,Qe=cg(be),lr=this.grid.query(Qe.minX-Be,Qe.minY-Be,Qe.maxX+Be,Qe.maxY+Be),wr=cg(C.cameraQueryGeometry),Fr=this.grid3D.query(wr.minX-Be,wr.minY-Be,wr.maxX+Be,wr.maxY+Be,(yn,Vn,Ca,ua)=>(function(wa,Xa,di,oo,as){for(let Ki of wa)if(Xa<=Ki.x&&di<=Ki.y&&oo>=Ki.x&&as>=Ki.y)return!0;let eo=[new o(Xa,di),new o(Xa,as),new o(oo,as),new o(oo,di)];if(wa.length>2){for(let Ki of eo)if(Un(wa,Ki))return!0}for(let Ki=0;Ki(ua||(ua=nr(wa)),Xa.queryIntersectsFeature(be,wa,di,ua,this.z,C.transform,jt,C.pixelPosMatrix)))}return Zr}loadMatchingFeature(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr){let wr=this.bucketLayerIDs[$];if(jt&&!(function(yn,Vn){for(let Ca=0;Ca=0)return!0;return!1})(jt,wr))return;let Fr=this.sourceLayerCoder.decode(ht),Zr=this.vtLayers[Fr].feature(Mt);if(Bt.needGeometry){let yn=cr(Zr,!0);if(!Bt.filter(new fs(this.tileID.overscaledZ),yn,this.tileID.canonical))return}else if(!Bt.filter(new fs(this.tileID.overscaledZ),Zr))return;let en=this.getId(Zr,Fr);for(let yn=0;yn{let oe=C instanceof Nu?C.get(jt):null;return oe&&oe.evaluate?oe.evaluate($,ht,Mt):oe})}function cg(H){let C=1/0,$=1/0,ht=-1/0,Mt=-1/0;for(let Bt of H)C=Math.min(C,Bt.x),$=Math.min($,Bt.y),ht=Math.max(ht,Bt.x),Mt=Math.max(Mt,Bt.y);return{minX:C,minY:$,maxX:ht,maxY:Mt}}function ey(H,C){return C-H}function ry(H,C,$,ht,Mt){let Bt=[];for(let jt=0;jt=ht&&lr.x>=ht||(Qe.x>=ht?Qe=new o(ht,Qe.y+(ht-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round():lr.x>=ht&&(lr=new o(ht,Qe.y+(ht-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round()),Qe.y>=Mt&&lr.y>=Mt||(Qe.y>=Mt?Qe=new o(Qe.x+(Mt-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),Mt)._round():lr.y>=Mt&&(lr=new o(Qe.x+(Mt-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),Mt)._round()),be&&Qe.equals(be[be.length-1])||(be=[Qe],Bt.push(be)),be.push(lr)))))}}return Bt}ca("FeatureIndex",Qv,{omit:["rawTileData","sourceLayerCoder"]});class hp extends o{constructor(C,$,ht,Mt){super(C,$),this.angle=ht,Mt!==void 0&&(this.segment=Mt)}clone(){return new hp(this.x,this.y,this.angle,this.segment)}}function ny(H,C,$,ht,Mt){if(C.segment===void 0||$===0)return!0;let Bt=C,jt=C.segment+1,oe=0;for(;oe>-$/2;){if(jt--,jt<0)return!1;oe-=H[jt].dist(Bt),Bt=H[jt]}oe+=H[jt].dist(H[jt+1]),jt++;let be=[],Be=0;for(;oe<$/2;){let Qe=H[jt],lr=H[jt+1];if(!lr)return!1;let wr=H[jt-1].angleTo(Qe)-Qe.angleTo(lr);for(wr=Math.abs((wr+3*Math.PI)%(2*Math.PI)-Math.PI),be.push({distance:oe,angleDelta:wr}),Be+=wr;oe-be[0].distance>ht;)Be-=be.shift().angleDelta;if(Be>Mt)return!1;jt++,oe+=Qe.dist(lr)}return!0}function ay(H){let C=0;for(let $=0;$Be){let Zr=(Be-be)/Fr,en=Ti.number(lr.x,wr.x,Zr),yn=Ti.number(lr.y,wr.y,Zr),Vn=new hp(en,yn,wr.angleTo(lr),Qe);return Vn._round(),!jt||ny(H,Vn,oe,jt,C)?Vn:void 0}be+=Fr}}function M_(H,C,$,ht,Mt,Bt,jt,oe,be){let Be=iy(ht,Bt,jt),Qe=oy(ht,Mt),lr=Qe*jt,wr=H[0].x===0||H[0].x===be||H[0].y===0||H[0].y===be;return C-lr=0&&wa=0&&Xa=0&&wr+Be<=Qe){let di=new hp(wa,Xa,Ca,Zr);di._round(),ht&&!ny(H,di,Bt,ht,Mt)||Fr.push(di)}}lr+=Vn}return oe||Fr.length||jt||(Fr=Lp(H,lr/2,$,ht,Mt,Bt,jt,!0,be)),Fr}ca("Anchor",hp);let rd=Vc;function sy(H,C,$,ht){let Mt=[],Bt=H.image,jt=Bt.pixelRatio,oe=Bt.paddedRect.w-2*rd,be=Bt.paddedRect.h-2*rd,Be={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom},Qe=Bt.stretchX||[[0,oe]],lr=Bt.stretchY||[[0,be]],wr=(oi,Ro)=>oi+Ro[1]-Ro[0],Fr=Qe.reduce(wr,0),Zr=lr.reduce(wr,0),en=oe-Fr,yn=be-Zr,Vn=0,Ca=Fr,ua=0,wa=Zr,Xa=0,di=en,oo=0,as=yn;if(Bt.content&&ht){let oi=Bt.content,Ro=oi[2]-oi[0],Io=oi[3]-oi[1];(Bt.textFitWidth||Bt.textFitHeight)&&(Be=Vv(H)),Vn=nd(Qe,0,oi[0]),ua=nd(lr,0,oi[1]),Ca=nd(Qe,oi[0],oi[2]),wa=nd(lr,oi[1],oi[3]),Xa=oi[0]-Vn,oo=oi[1]-ua,di=Ro-Ca,as=Io-wa}let eo=Be.x1,Ki=Be.y1,Co=Be.x2-eo,xo=Be.y2-Ki,ho=(oi,Ro,Io,xs)=>{let mu=ch(oi.stretch-Vn,Ca,Co,eo),uu=K0(oi.fixed-Xa,di,oi.stretch,Fr),tf=ch(Ro.stretch-ua,wa,xo,Ki),Qf=K0(Ro.fixed-oo,as,Ro.stretch,Zr),Ac=ch(Io.stretch-Vn,Ca,Co,eo),Hc=K0(Io.fixed-Xa,di,Io.stretch,Fr),Rf=ch(xs.stretch-ua,wa,xo,Ki),Nf=K0(xs.fixed-oo,as,xs.stretch,Zr),jf=new o(mu,tf),rc=new o(Ac,tf),ef=new o(Ac,Rf),Lf=new o(mu,Rf),wf=new o(uu/jt,Qf/jt),Uf=new o(Hc/jt,Nf/jt),hf=C*Math.PI/180;if(hf){let vl=Math.sin(hf),Vl=Math.cos(hf),eu=[Vl,-vl,vl,Vl];jf._matMult(eu),rc._matMult(eu),Lf._matMult(eu),ef._matMult(eu)}let fh=oi.stretch+oi.fixed,zu=Ro.stretch+Ro.fixed;return{tl:jf,tr:rc,bl:Lf,br:ef,tex:{x:Bt.paddedRect.x+rd+fh,y:Bt.paddedRect.y+rd+zu,w:Io.stretch+Io.fixed-fh,h:xs.stretch+xs.fixed-zu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:wf,pixelOffsetBR:Uf,minFontScaleX:di/jt/Co,minFontScaleY:as/jt/xo,isSDF:$}};if(ht&&(Bt.stretchX||Bt.stretchY)){let oi=ad(Qe,en,Fr),Ro=ad(lr,yn,Zr);for(let Io=0;Io0&&(en=Math.max(10,en),this.circleDiameter=en)}else{let wr=!((lr=jt.image)===null||lr===void 0)&&lr.content&&(jt.image.textFitWidth||jt.image.textFitHeight)?Vv(jt):{x1:jt.left,y1:jt.top,x2:jt.right,y2:jt.bottom};wr.y1=wr.y1*oe-be[0],wr.y2=wr.y2*oe+be[2],wr.x1=wr.x1*oe-be[3],wr.x2=wr.x2*oe+be[1];let Fr=jt.collisionPadding;if(Fr&&(wr.x1-=Fr[0]*oe,wr.y1-=Fr[1]*oe,wr.x2+=Fr[2]*oe,wr.y2+=Fr[3]*oe),Qe){let Zr=new o(wr.x1,wr.y1),en=new o(wr.x2,wr.y1),yn=new o(wr.x1,wr.y2),Vn=new o(wr.x2,wr.y2),Ca=Qe*Math.PI/180;Zr._rotate(Ca),en._rotate(Ca),yn._rotate(Ca),Vn._rotate(Ca),wr.x1=Math.min(Zr.x,en.x,yn.x,Vn.x),wr.x2=Math.max(Zr.x,en.x,yn.x,Vn.x),wr.y1=Math.min(Zr.y,en.y,yn.y,Vn.y),wr.y2=Math.max(Zr.y,en.y,yn.y,Vn.y)}C.emplaceBack($.x,$.y,wr.x1,wr.y1,wr.x2,wr.y2,ht,Mt,Bt)}this.boxEndIndex=C.length}}class S_{constructor(C=[],$=(ht,Mt)=>htMt?1:0){if(this.data=C,this.length=this.data.length,this.compare=$,this.length>0)for(let ht=(this.length>>1)-1;ht>=0;ht--)this._down(ht)}push(C){this.data.push(C),this._up(this.length++)}pop(){if(this.length===0)return;let C=this.data[0],$=this.data.pop();return--this.length>0&&(this.data[0]=$,this._down(0)),C}peek(){return this.data[0]}_up(C){let{data:$,compare:ht}=this,Mt=$[C];for(;C>0;){let Bt=C-1>>1,jt=$[Bt];if(ht(Mt,jt)>=0)break;$[C]=jt,C=Bt}$[C]=Mt}_down(C){let{data:$,compare:ht}=this,Mt=this.length>>1,Bt=$[C];for(;C=0)break;$[C]=$[jt],C=jt}$[C]=Bt}}function E_(H,C=1,$=!1){let ht=1/0,Mt=1/0,Bt=-1/0,jt=-1/0,oe=H[0];for(let Fr=0;FrBt)&&(Bt=Zr.x),(!Fr||Zr.y>jt)&&(jt=Zr.y)}let be=Math.min(Bt-ht,jt-Mt),Be=be/2,Qe=new S_([],z_);if(be===0)return new o(ht,Mt);for(let Fr=ht;Frlr.d||!lr.d)&&(lr=Fr,$&&console.log("found best %d after %d probes",Math.round(1e4*Fr.d)/1e4,wr)),Fr.max-lr.d<=C||(Be=Fr.h/2,Qe.push(new Fh(Fr.p.x-Be,Fr.p.y-Be,Be,H)),Qe.push(new Fh(Fr.p.x+Be,Fr.p.y-Be,Be,H)),Qe.push(new Fh(Fr.p.x-Be,Fr.p.y+Be,Be,H)),Qe.push(new Fh(Fr.p.x+Be,Fr.p.y+Be,Be,H)),wr+=4)}return $&&(console.log(`num probes: ${wr}`),console.log(`best distance: ${lr.d}`)),lr.p}function z_(H,C){return C.max-H.max}function Fh(H,C,$,ht){this.p=new o(H,C),this.h=$,this.d=(function(Mt,Bt){let jt=!1,oe=1/0;for(let be=0;beMt.y!=Zr.y>Mt.y&&Mt.x<(Zr.x-Fr.x)*(Mt.y-Fr.y)/(Zr.y-Fr.y)+Fr.x&&(jt=!jt),oe=Math.min(oe,Va(Mt,Fr,Zr))}}return(jt?1:-1)*Math.sqrt(oe)})(this.p,ht),this.max=this.d+this.h*Math.SQRT2}var ff;t.aq=void 0,(ff=t.aq||(t.aq={}))[ff.center=1]="center",ff[ff.left=2]="left",ff[ff.right=3]="right",ff[ff.top=4]="top",ff[ff.bottom=5]="bottom",ff[ff["top-left"]=6]="top-left",ff[ff["top-right"]=7]="top-right",ff[ff["bottom-left"]=8]="bottom-left",ff[ff["bottom-right"]=9]="bottom-right";let pp=7,fg=Number.POSITIVE_INFINITY;function ly(H,C){return C[1]!==fg?(function($,ht,Mt){let Bt=0,jt=0;switch(ht=Math.abs(ht),Mt=Math.abs(Mt),$){case"top-right":case"top-left":case"top":jt=Mt-pp;break;case"bottom-right":case"bottom-left":case"bottom":jt=-Mt+pp}switch($){case"top-right":case"bottom-right":case"right":Bt=-ht;break;case"top-left":case"bottom-left":case"left":Bt=ht}return[Bt,jt]})(H,C[0],C[1]):(function($,ht){let Mt=0,Bt=0;ht<0&&(ht=0);let jt=ht/Math.SQRT2;switch($){case"top-right":case"top-left":Bt=jt-pp;break;case"bottom-right":case"bottom-left":Bt=-jt+pp;break;case"bottom":Bt=-ht+pp;break;case"top":Bt=ht-pp}switch($){case"top-right":case"bottom-right":Mt=-jt;break;case"top-left":case"bottom-left":Mt=jt;break;case"left":Mt=ht;break;case"right":Mt=-ht}return[Mt,Bt]})(H,C[0])}function uy(H,C,$){var ht;let Mt=H.layout,Bt=(ht=Mt.get("text-variable-anchor-offset"))===null||ht===void 0?void 0:ht.evaluate(C,{},$);if(Bt){let oe=Bt.values,be=[];for(let Be=0;Bewr*Ol);Qe.startsWith("top")?lr[1]-=pp:Qe.startsWith("bottom")&&(lr[1]+=pp),be[Be+1]=lr}return new Nn(be)}let jt=Mt.get("text-variable-anchor");if(jt){let oe;oe=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Mt.get("text-radial-offset").evaluate(C,{},$)*Ol,fg]:Mt.get("text-offset").evaluate(C,{},$).map(Be=>Be*Ol);let be=[];for(let Be of jt)be.push(Be,ly(Be,oe));return new Nn(be)}return null}function hg(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function L_(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=Bt.textMaxSize.evaluate(C,{});lr===void 0&&(lr=jt);let wr=H.layers[0].layout,Fr=wr.get("icon-offset").evaluate(C,{},Qe),Zr=fy($.horizontal),en=jt/24,yn=H.tilePixelRatio*en,Vn=H.tilePixelRatio*lr/24,Ca=H.tilePixelRatio*oe,ua=H.tilePixelRatio*wr.get("symbol-spacing"),wa=wr.get("text-padding")*H.tilePixelRatio,Xa=(function(oi,Ro,Io,xs=1){let mu=oi.get("icon-padding").evaluate(Ro,{},Io),uu=mu&&mu.values;return[uu[0]*xs,uu[1]*xs,uu[2]*xs,uu[3]*xs]})(wr,C,Qe,H.tilePixelRatio),di=wr.get("text-max-angle")/180*Math.PI,oo=wr.get("text-rotation-alignment")!=="viewport"&&wr.get("symbol-placement")!=="point",as=wr.get("icon-rotation-alignment")==="map"&&wr.get("symbol-placement")!=="point",eo=wr.get("symbol-placement"),Ki=ua/2,Co=wr.get("icon-text-fit"),xo;ht&&Co!=="none"&&(H.allowVerticalPlacement&&$.vertical&&(xo=Hv(ht,$.vertical,Co,wr.get("icon-text-fit-padding"),Fr,en)),Zr&&(ht=Hv(ht,Zr,Co,wr.get("icon-text-fit-padding"),Fr,en)));let ho=(oi,Ro)=>{Ro.x<0||Ro.x>=zs||Ro.y<0||Ro.y>=zs||(function(Io,xs,mu,uu,tf,Qf,Ac,Hc,Rf,Nf,jf,rc,ef,Lf,wf,Uf,hf,fh,zu,vl,Vl,eu,Xu,Lu,sd){let kh=Io.addToLineVertexArray(xs,mu),Ah,Cf,gu,pf,xh=0,hh=0,Vf=0,yg=0,xg=-1,Q0=-1,Yh={},_g=_n("");if(Io.allowVerticalPlacement&&uu.vertical){let Tf=Hc.layout.get("text-rotate").evaluate(Vl,{},Lu)+90;gu=new Y0(Rf,xs,Nf,jf,rc,uu.vertical,ef,Lf,wf,Tf),Ac&&(pf=new Y0(Rf,xs,Nf,jf,rc,Ac,hf,fh,wf,Tf))}if(tf){let Tf=Hc.layout.get("icon-rotate").evaluate(Vl,{}),ph=Hc.layout.get("icon-text-fit")!=="none",dp=sy(tf,Tf,Xu,ph),Mh=Ac?sy(Ac,Tf,Xu,ph):void 0;Cf=new Y0(Rf,xs,Nf,jf,rc,tf,hf,fh,!1,Tf),xh=4*dp.length;let Cp=Io.iconSizeData,Sh=null;Cp.kind==="source"?(Sh=[Oh*Hc.layout.get("icon-size").evaluate(Vl,{})],Sh[0]>cp&&_(`${Io.layerIds[0]}: Value for "icon-size" is >= ${Zd}. Reduce your "icon-size".`)):Cp.kind==="composite"&&(Sh=[Oh*eu.compositeIconSizes[0].evaluate(Vl,{},Lu),Oh*eu.compositeIconSizes[1].evaluate(Vl,{},Lu)],(Sh[0]>cp||Sh[1]>cp)&&_(`${Io.layerIds[0]}: Value for "icon-size" is >= ${Zd}. Reduce your "icon-size".`)),Io.addSymbols(Io.icon,dp,Sh,vl,zu,Vl,t.ah.none,xs,kh.lineStartIndex,kh.lineLength,-1,Lu),xg=Io.icon.placedSymbolArray.length-1,Mh&&(hh=4*Mh.length,Io.addSymbols(Io.icon,Mh,Sh,vl,zu,Vl,t.ah.vertical,xs,kh.lineStartIndex,kh.lineLength,-1,Lu),Q0=Io.icon.placedSymbolArray.length-1)}let bg=Object.keys(uu.horizontal);for(let Tf of bg){let ph=uu.horizontal[Tf];if(!Ah){_g=_n(ph.text);let Mh=Hc.layout.get("text-rotate").evaluate(Vl,{},Lu);Ah=new Y0(Rf,xs,Nf,jf,rc,ph,ef,Lf,wf,Mh)}let dp=ph.positionedLines.length===1;if(Vf+=cy(Io,xs,ph,Qf,Hc,wf,Vl,Uf,kh,uu.vertical?t.ah.horizontal:t.ah.horizontalOnly,dp?bg:[Tf],Yh,xg,eu,Lu),dp)break}uu.vertical&&(yg+=cy(Io,xs,uu.vertical,Qf,Hc,wf,Vl,Uf,kh,t.ah.vertical,["vertical"],Yh,Q0,eu,Lu));let wg=Ah?Ah.boxStartIndex:Io.collisionBoxArray.length,Tg=Ah?Ah.boxEndIndex:Io.collisionBoxArray.length,C_=gu?gu.boxStartIndex:Io.collisionBoxArray.length,I_=gu?gu.boxEndIndex:Io.collisionBoxArray.length,P_=Cf?Cf.boxStartIndex:Io.collisionBoxArray.length,O_=Cf?Cf.boxEndIndex:Io.collisionBoxArray.length,gy=pf?pf.boxStartIndex:Io.collisionBoxArray.length,ld=pf?pf.boxEndIndex:Io.collisionBoxArray.length,qc=-1,ud=(Tf,ph)=>Tf&&Tf.circleDiameter?Math.max(Tf.circleDiameter,ph):ph;qc=ud(Ah,qc),qc=ud(gu,qc),qc=ud(Cf,qc),qc=ud(pf,qc);let kg=qc>-1?1:0;kg&&(qc*=sd/Ol),Io.glyphOffsetArray.length>=Ep.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vl.sortKey!==void 0&&Io.addToSortKeyRanges(Io.symbolInstances.length,Vl.sortKey);let vy=uy(Hc,Vl,Lu),[D_,yy]=(function(Tf,ph){let dp=Tf.length,Mh=ph?.values;if(Mh?.length>0)for(let Cp=0;Cp=0?Yh.right:-1,Yh.center>=0?Yh.center:-1,Yh.left>=0?Yh.left:-1,Yh.vertical||-1,xg,Q0,_g,wg,Tg,C_,I_,P_,O_,gy,ld,Nf,Vf,yg,xh,hh,kg,0,ef,qc,D_,yy)})(H,Ro,oi,$,ht,Mt,xo,H.layers[0],H.collisionBoxArray,C.index,C.sourceLayerIndex,H.index,yn,[wa,wa,wa,wa],oo,be,Ca,Xa,as,Fr,C,Bt,Be,Qe,jt)};if(eo==="line")for(let oi of ry(C.geometry,0,0,zs,zs)){let Ro=M_(oi,ua,di,$.vertical||Zr,ht,24,Vn,H.overscaling,zs);for(let Io of Ro)Zr&&hy(H,Zr.text,Ki,Io)||ho(oi,Io)}else if(eo==="line-center"){for(let oi of C.geometry)if(oi.length>1){let Ro=A_(oi,di,$.vertical||Zr,ht,24,Vn);Ro&&ho(oi,Ro)}}else if(C.type==="Polygon")for(let oi of au(C.geometry,0)){let Ro=E_(oi,16);ho(oi[0],new hp(Ro.x,Ro.y,0))}else if(C.type==="LineString")for(let oi of C.geometry)ho(oi,new hp(oi[0].x,oi[0].y,0));else if(C.type==="Point")for(let oi of C.geometry)for(let Ro of oi)ho([Ro],new hp(Ro.x,Ro.y,0))}function cy(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr){let en=(function(Ca,ua,wa,Xa,di,oo,as,eo){let Ki=Xa.layout.get("text-rotate").evaluate(oo,{})*Math.PI/180,Co=[];for(let xo of ua.positionedLines)for(let ho of xo.positionedGlyphs){if(!ho.rect)continue;let oi=ho.rect||{},Ro=Qm+1,Io=!0,xs=1,mu=0,uu=(di||eo)&&ho.vertical,tf=ho.metrics.advance*ho.scale/2;if(eo&&ua.verticalizable&&(mu=xo.lineOffset/2-(ho.imageName?-(Ol-ho.metrics.width*ho.scale)/2:(ho.scale-1)*Ol)),ho.imageName){let vl=as[ho.imageName];Io=vl.sdf,xs=vl.pixelRatio,Ro=Vc/xs}let Qf=di?[ho.x+tf,ho.y]:[0,0],Ac=di?[0,0]:[ho.x+tf+wa[0],ho.y+wa[1]-mu],Hc=[0,0];uu&&(Hc=Ac,Ac=[0,0]);let Rf=ho.metrics.isDoubleResolution?2:1,Nf=(ho.metrics.left-Ro)*ho.scale-tf+Ac[0],jf=(-ho.metrics.top-Ro)*ho.scale+Ac[1],rc=Nf+oi.w/Rf*ho.scale/xs,ef=jf+oi.h/Rf*ho.scale/xs,Lf=new o(Nf,jf),wf=new o(rc,jf),Uf=new o(Nf,ef),hf=new o(rc,ef);if(uu){let vl=new o(-tf,tf-$p),Vl=-Math.PI/2,eu=Ol/2-tf,Xu=new o(5-$p-eu,-(ho.imageName?eu:0)),Lu=new o(...Hc);Lf._rotateAround(Vl,vl)._add(Xu)._add(Lu),wf._rotateAround(Vl,vl)._add(Xu)._add(Lu),Uf._rotateAround(Vl,vl)._add(Xu)._add(Lu),hf._rotateAround(Vl,vl)._add(Xu)._add(Lu)}if(Ki){let vl=Math.sin(Ki),Vl=Math.cos(Ki),eu=[Vl,-vl,vl,Vl];Lf._matMult(eu),wf._matMult(eu),Uf._matMult(eu),hf._matMult(eu)}let fh=new o(0,0),zu=new o(0,0);Co.push({tl:Lf,tr:wf,bl:Uf,br:hf,tex:oi,writingMode:ua.writingMode,glyphOffset:Qf,sectionIndex:ho.sectionIndex,isSDF:Io,pixelOffsetTL:fh,pixelOffsetBR:zu,minFontScaleX:0,minFontScaleY:0})}return Co})(0,$,oe,Mt,Bt,jt,ht,H.allowVerticalPlacement),yn=H.textSizeData,Vn=null;yn.kind==="source"?(Vn=[Oh*Mt.layout.get("text-size").evaluate(jt,{})],Vn[0]>cp&&_(`${H.layerIds[0]}: Value for "text-size" is >= ${Zd}. Reduce your "text-size".`)):yn.kind==="composite"&&(Vn=[Oh*Fr.compositeTextSizes[0].evaluate(jt,{},Zr),Oh*Fr.compositeTextSizes[1].evaluate(jt,{},Zr)],(Vn[0]>cp||Vn[1]>cp)&&_(`${H.layerIds[0]}: Value for "text-size" is >= ${Zd}. Reduce your "text-size".`)),H.addSymbols(H.text,en,Vn,oe,Bt,jt,Be,C,be.lineStartIndex,be.lineLength,wr,Zr);for(let Ca of Qe)lr[Ca]=H.text.placedSymbolArray.length-1;return 4*en.length}function fy(H){for(let C in H)return H[C];return null}function hy(H,C,$,ht){let Mt=H.compareText;if(C in Mt){let Bt=Mt[C];for(let jt=Bt.length-1;jt>=0;jt--)if(ht.dist(Bt[jt])<$)return!0}else Mt[C]=[];return Mt[C].push(ht),!1}let py=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class pg{static from(C){if(!(C instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[$,ht]=new Uint8Array(C,0,2);if($!==219)throw new Error("Data does not appear to be in a KDBush format.");let Mt=ht>>4;if(Mt!==1)throw new Error(`Got v${Mt} data when expected v1.`);let Bt=py[15&ht];if(!Bt)throw new Error("Unrecognized array type.");let[jt]=new Uint16Array(C,2,1),[oe]=new Uint32Array(C,4,1);return new pg(oe,jt,Bt,C)}constructor(C,$=64,ht=Float64Array,Mt){if(isNaN(C)||C<0)throw new Error(`Unpexpected numItems value: ${C}.`);this.numItems=+C,this.nodeSize=Math.min(Math.max(+$,2),65535),this.ArrayType=ht,this.IndexArrayType=C<65536?Uint16Array:Uint32Array;let Bt=py.indexOf(this.ArrayType),jt=2*C*this.ArrayType.BYTES_PER_ELEMENT,oe=C*this.IndexArrayType.BYTES_PER_ELEMENT,be=(8-oe%8)%8;if(Bt<0)throw new Error(`Unexpected typed array class: ${ht}.`);Mt&&Mt instanceof ArrayBuffer?(this.data=Mt,this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+oe+be,2*C),this._pos=2*C,this._finished=!0):(this.data=new ArrayBuffer(8+jt+oe+be),this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+oe+be,2*C),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Bt]),new Uint16Array(this.data,2,1)[0]=$,new Uint32Array(this.data,4,1)[0]=C)}add(C,$){let ht=this._pos>>1;return this.ids[ht]=ht,this.coords[this._pos++]=C,this.coords[this._pos++]=$,ht}finish(){let C=this._pos>>1;if(C!==this.numItems)throw new Error(`Added ${C} items when expected ${this.numItems}.`);return dg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(C,$,ht,Mt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Bt,coords:jt,nodeSize:oe}=this,be=[0,Bt.length-1,0],Be=[];for(;be.length;){let Qe=be.pop()||0,lr=be.pop()||0,wr=be.pop()||0;if(lr-wr<=oe){for(let yn=wr;yn<=lr;yn++){let Vn=jt[2*yn],Ca=jt[2*yn+1];Vn>=C&&Vn<=ht&&Ca>=$&&Ca<=Mt&&Be.push(Bt[yn])}continue}let Fr=wr+lr>>1,Zr=jt[2*Fr],en=jt[2*Fr+1];Zr>=C&&Zr<=ht&&en>=$&&en<=Mt&&Be.push(Bt[Fr]),(Qe===0?C<=Zr:$<=en)&&(be.push(wr),be.push(Fr-1),be.push(1-Qe)),(Qe===0?ht>=Zr:Mt>=en)&&(be.push(Fr+1),be.push(lr),be.push(1-Qe))}return Be}within(C,$,ht){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Mt,coords:Bt,nodeSize:jt}=this,oe=[0,Mt.length-1,0],be=[],Be=ht*ht;for(;oe.length;){let Qe=oe.pop()||0,lr=oe.pop()||0,wr=oe.pop()||0;if(lr-wr<=jt){for(let yn=wr;yn<=lr;yn++)bf(Bt[2*yn],Bt[2*yn+1],C,$)<=Be&&be.push(Mt[yn]);continue}let Fr=wr+lr>>1,Zr=Bt[2*Fr],en=Bt[2*Fr+1];bf(Zr,en,C,$)<=Be&&be.push(Mt[Fr]),(Qe===0?C-ht<=Zr:$-ht<=en)&&(oe.push(wr),oe.push(Fr-1),oe.push(1-Qe)),(Qe===0?C+ht>=Zr:$+ht>=en)&&(oe.push(Fr+1),oe.push(lr),oe.push(1-Qe))}return be}}function dg(H,C,$,ht,Mt,Bt){if(Mt-ht<=$)return;let jt=ht+Mt>>1;dy(H,C,jt,ht,Mt,Bt),dg(H,C,$,ht,jt-1,1-Bt),dg(H,C,$,jt+1,Mt,1-Bt)}function dy(H,C,$,ht,Mt,Bt){for(;Mt>ht;){if(Mt-ht>600){let Be=Mt-ht+1,Qe=$-ht+1,lr=Math.log(Be),wr=.5*Math.exp(2*lr/3),Fr=.5*Math.sqrt(lr*wr*(Be-wr)/Be)*(Qe-Be/2<0?-1:1);dy(H,C,$,Math.max(ht,Math.floor($-Qe*wr/Be+Fr)),Math.min(Mt,Math.floor($+(Be-Qe)*wr/Be+Fr)),Bt)}let jt=C[2*$+Bt],oe=ht,be=Mt;for(id(H,C,ht,$),C[2*Mt+Bt]>jt&&id(H,C,ht,Mt);oejt;)be--}C[2*ht+Bt]===jt?id(H,C,ht,be):(be++,id(H,C,be,Mt)),be<=$&&(ht=be+1),$<=be&&(Mt=be-1)}}function id(H,C,$,ht){X0(H,$,ht),X0(C,2*$,2*ht),X0(C,2*$+1,2*ht+1)}function X0(H,C,$){let ht=H[C];H[C]=H[$],H[$]=ht}function bf(H,C,$,ht){let Mt=H-$,Bt=C-ht;return Mt*Mt+Bt*Bt}var mg;t.bg=void 0,(mg=t.bg||(t.bg={})).create="create",mg.load="load",mg.fullLoad="fullLoad";let $0=null,od=[],gg=1e3/60,J0="loadTime",vg="fullLoadTime",my={mark(H){performance.mark(H)},frame(H){let C=H;$0!=null&&od.push(C-$0),$0=C},clearMetrics(){$0=null,od=[],performance.clearMeasures(J0),performance.clearMeasures(vg);for(let H in t.bg)performance.clearMarks(t.bg[H])},getPerformanceMetrics(){performance.measure(J0,t.bg.create,t.bg.load),performance.measure(vg,t.bg.create,t.bg.fullLoad);let H=performance.getEntriesByName(J0)[0].duration,C=performance.getEntriesByName(vg)[0].duration,$=od.length,ht=1/(od.reduce((Bt,jt)=>Bt+jt,0)/$/1e3),Mt=od.filter(Bt=>Bt>gg).reduce((Bt,jt)=>Bt+(jt-gg)/gg,0);return{loadTime:H,fullLoadTime:C,fps:ht,percentDroppedFrames:Mt/($+Mt)*100,totalFrames:$}}};t.$=class extends hr{},t.A=Rn,t.B=Ta,t.C=function(H){if(D==null){let C=H.navigator?H.navigator.userAgent:null;D=!!H.safari||!(!C||!(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return D},t.D=Ui,t.E=it,t.F=class{constructor(H,C){this.target=H,this.mapId=C,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new $d(()=>this.process()),this.subscription=(function($,ht,Mt,Bt){return $.addEventListener(ht,Mt,!1),{unsubscribe:()=>{$.removeEventListener(ht,Mt,!1)}}})(this.target,"message",$=>this.receive($)),this.globalScope=z(self)?H:window}registerMessageHandler(H,C){this.messageHandlers[H]=C}sendAsync(H,C){return new Promise(($,ht)=>{let Mt=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Mt]={resolve:$,reject:ht},C&&C.signal.addEventListener("abort",()=>{delete this.resolveRejects[Mt];let oe={id:Mt,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(oe)},{once:!0});let Bt=[],jt=Object.assign(Object.assign({},H),{id:Mt,sourceMapId:this.mapId,origin:location.origin,data:Wi(H.data,Bt)});this.target.postMessage(jt,{transfer:Bt})})}receive(H){let C=H.data,$=C.id;if(!(C.origin!=="file://"&&location.origin!=="file://"&&C.origin!=="resource://android"&&location.origin!=="resource://android"&&C.origin!==location.origin||C.targetMapId&&this.mapId!==C.targetMapId)){if(C.type===""){delete this.tasks[$];let ht=this.abortControllers[$];return delete this.abortControllers[$],void(ht&&ht.abort())}if(z(self)||C.mustQueue)return this.tasks[$]=C,this.taskQueue.push($),void this.invoker.trigger();this.processTask($,C)}}process(){if(this.taskQueue.length===0)return;let H=this.taskQueue.shift(),C=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),C&&this.processTask(H,C)}processTask(H,C){return e(this,void 0,void 0,function*(){if(C.type===""){let Mt=this.resolveRejects[H];return delete this.resolveRejects[H],Mt?void(C.error?Mt.reject(Xi(C.error)):Mt.resolve(Xi(C.data))):void 0}if(!this.messageHandlers[C.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${C.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let $=Xi(C.data),ht=new AbortController;this.abortControllers[H]=ht;try{let Mt=yield this.messageHandlers[C.type](C.sourceMapId,$,ht);this.completeTask(H,null,Mt)}catch(Mt){this.completeTask(H,Mt)}})}completeTask(H,C,$){let ht=[];delete this.abortControllers[H];let Mt={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:C?Wi(C):null,data:Wi($,ht)};this.target.postMessage(Mt,{transfer:ht})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=st,t.H=function(){var H=new Rn(16);return Rn!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},t.I=_f,t.J=function(H,C,$){var ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en=$[0],yn=$[1],Vn=$[2];return C===H?(H[12]=C[0]*en+C[4]*yn+C[8]*Vn+C[12],H[13]=C[1]*en+C[5]*yn+C[9]*Vn+C[13],H[14]=C[2]*en+C[6]*yn+C[10]*Vn+C[14],H[15]=C[3]*en+C[7]*yn+C[11]*Vn+C[15]):(Mt=C[1],Bt=C[2],jt=C[3],oe=C[4],be=C[5],Be=C[6],Qe=C[7],lr=C[8],wr=C[9],Fr=C[10],Zr=C[11],H[0]=ht=C[0],H[1]=Mt,H[2]=Bt,H[3]=jt,H[4]=oe,H[5]=be,H[6]=Be,H[7]=Qe,H[8]=lr,H[9]=wr,H[10]=Fr,H[11]=Zr,H[12]=ht*en+oe*yn+lr*Vn+C[12],H[13]=Mt*en+be*yn+wr*Vn+C[13],H[14]=Bt*en+Be*yn+Fr*Vn+C[14],H[15]=jt*en+Qe*yn+Zr*Vn+C[15]),H},t.K=function(H,C,$){var ht=$[0],Mt=$[1],Bt=$[2];return H[0]=C[0]*ht,H[1]=C[1]*ht,H[2]=C[2]*ht,H[3]=C[3]*ht,H[4]=C[4]*Mt,H[5]=C[5]*Mt,H[6]=C[6]*Mt,H[7]=C[7]*Mt,H[8]=C[8]*Bt,H[9]=C[9]*Bt,H[10]=C[10]*Bt,H[11]=C[11]*Bt,H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15],H},t.L=Pa,t.M=function(H,C){let $={};for(let ht=0;ht{let C=window.document.createElement("video");return C.muted=!0,new Promise($=>{C.onloadstart=()=>{$(C)};for(let ht of H){let Mt=window.document.createElement("source");X(ht)||(C.crossOrigin="Anonymous"),Mt.src=ht,C.appendChild(Mt)}})},t.a4=function(){return M++},t.a5=La,t.a6=Ep,t.a7=bc,t.a8=cr,t.a9=Jv,t.aA=function(H){if(H.type==="custom")return new Gv(H);switch(H.type){case"background":return new Xd(H);case"circle":return new Sa(H);case"fill":return new On(H);case"fill-extrusion":return new Kf(H);case"heatmap":return new Zo(H);case"hillshade":return new Cl(H);case"line":return new Tp(H);case"raster":return new k_(H);case"symbol":return new q0(H)}},t.aB=h,t.aC=function(H,C){if(!H)return[{command:"setStyle",args:[C]}];let $=[];try{if(!wt(H.version,C.version))return[{command:"setStyle",args:[C]}];wt(H.center,C.center)||$.push({command:"setCenter",args:[C.center]}),wt(H.zoom,C.zoom)||$.push({command:"setZoom",args:[C.zoom]}),wt(H.bearing,C.bearing)||$.push({command:"setBearing",args:[C.bearing]}),wt(H.pitch,C.pitch)||$.push({command:"setPitch",args:[C.pitch]}),wt(H.sprite,C.sprite)||$.push({command:"setSprite",args:[C.sprite]}),wt(H.glyphs,C.glyphs)||$.push({command:"setGlyphs",args:[C.glyphs]}),wt(H.transition,C.transition)||$.push({command:"setTransition",args:[C.transition]}),wt(H.light,C.light)||$.push({command:"setLight",args:[C.light]}),wt(H.terrain,C.terrain)||$.push({command:"setTerrain",args:[C.terrain]}),wt(H.sky,C.sky)||$.push({command:"setSky",args:[C.sky]}),wt(H.projection,C.projection)||$.push({command:"setProjection",args:[C.projection]});let ht={},Mt=[];(function(jt,oe,be,Be){let Qe;for(Qe in oe=oe||{},jt=jt||{})Object.prototype.hasOwnProperty.call(jt,Qe)&&(Object.prototype.hasOwnProperty.call(oe,Qe)||Nt(Qe,be,Be));for(Qe in oe)Object.prototype.hasOwnProperty.call(oe,Qe)&&(Object.prototype.hasOwnProperty.call(jt,Qe)?wt(jt[Qe],oe[Qe])||(jt[Qe].type==="geojson"&&oe[Qe].type==="geojson"&&Jt(jt,oe,Qe)?Ct(be,{command:"setGeoJSONSourceData",args:[Qe,oe[Qe].data]}):te(Qe,oe,be,Be)):It(Qe,oe,be))})(H.sources,C.sources,Mt,ht);let Bt=[];H.layers&&H.layers.forEach(jt=>{"source"in jt&&ht[jt.source]?$.push({command:"removeLayer",args:[jt.id]}):Bt.push(jt)}),$=$.concat(Mt),(function(jt,oe,be){oe=oe||[];let Be=(jt=jt||[]).map(Zt),Qe=oe.map(Zt),lr=jt.reduce(mt,{}),wr=oe.reduce(mt,{}),Fr=Be.slice(),Zr=Object.create(null),en,yn,Vn,Ca,ua;for(let wa=0,Xa=0;wa@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,($,ht,Mt,Bt)=>{let jt=Mt||Bt;return C[ht]=!jt||jt.toLowerCase(),""}),C["max-age"]){let $=parseInt(C["max-age"],10);isNaN($)?delete C["max-age"]:C["max-age"]=$}return C},t.ab=function(H,C){let $=[];for(let ht in H)ht in C||$.push(ht);return $},t.ac=y,t.ad=function(H,C,$){var ht=Math.sin($),Mt=Math.cos($),Bt=C[0],jt=C[1],oe=C[2],be=C[3],Be=C[4],Qe=C[5],lr=C[6],wr=C[7];return C!==H&&(H[8]=C[8],H[9]=C[9],H[10]=C[10],H[11]=C[11],H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15]),H[0]=Bt*Mt+Be*ht,H[1]=jt*Mt+Qe*ht,H[2]=oe*Mt+lr*ht,H[3]=be*Mt+wr*ht,H[4]=Be*Mt-Bt*ht,H[5]=Qe*Mt-jt*ht,H[6]=lr*Mt-oe*ht,H[7]=wr*Mt-be*ht,H},t.ae=function(H){var C=new Rn(16);return C[0]=H[0],C[1]=H[1],C[2]=H[2],C[3]=H[3],C[4]=H[4],C[5]=H[5],C[6]=H[6],C[7]=H[7],C[8]=H[8],C[9]=H[9],C[10]=H[10],C[11]=H[11],C[12]=H[12],C[13]=H[13],C[14]=H[14],C[15]=H[15],C},t.af=oa,t.ag=function(H,C){let $=0,ht=0;if(H.kind==="constant")ht=H.layoutSize;else if(H.kind!=="source"){let{interpolationType:Mt,minZoom:Bt,maxZoom:jt}=H,oe=Mt?y(Ra.interpolationFactor(Mt,C,Bt,jt),0,1):0;H.kind==="camera"?ht=Ti.number(H.minSize,H.maxSize,oe):$=oe}return{uSizeT:$,uSize:ht}},t.ai=function(H,{uSize:C,uSizeT:$},{lowerSize:ht,upperSize:Mt}){return H.kind==="source"?ht/Oh:H.kind==="composite"?Ti.number(ht/Oh,Mt/Oh,$):C},t.aj=fp,t.ak=function(H,C,$,ht){let Mt=C.y-H.y,Bt=C.x-H.x,jt=ht.y-$.y,oe=ht.x-$.x,be=jt*Bt-oe*Mt;if(be===0)return null;let Be=(oe*(H.y-$.y)-jt*(H.x-$.x))/be;return new o(H.x+Be*Bt,H.y+Be*Mt)},t.al=ry,t.am=Tn,t.an=An,t.ao=function(H){let C=1/0,$=1/0,ht=-1/0,Mt=-1/0;for(let Bt of H)C=Math.min(C,Bt.x),$=Math.min($,Bt.y),ht=Math.max(ht,Bt.x),Mt=Math.max(Mt,Bt.y);return[C,$,ht,Mt]},t.ap=Ol,t.ar=rg,t.as=function(H,C){var $=C[0],ht=C[1],Mt=C[2],Bt=C[3],jt=C[4],oe=C[5],be=C[6],Be=C[7],Qe=C[8],lr=C[9],wr=C[10],Fr=C[11],Zr=C[12],en=C[13],yn=C[14],Vn=C[15],Ca=$*oe-ht*jt,ua=$*be-Mt*jt,wa=$*Be-Bt*jt,Xa=ht*be-Mt*oe,di=ht*Be-Bt*oe,oo=Mt*Be-Bt*be,as=Qe*en-lr*Zr,eo=Qe*yn-wr*Zr,Ki=Qe*Vn-Fr*Zr,Co=lr*yn-wr*en,xo=lr*Vn-Fr*en,ho=wr*Vn-Fr*yn,oi=Ca*ho-ua*xo+wa*Co+Xa*Ki-di*eo+oo*as;return oi?(H[0]=(oe*ho-be*xo+Be*Co)*(oi=1/oi),H[1]=(Mt*xo-ht*ho-Bt*Co)*oi,H[2]=(en*oo-yn*di+Vn*Xa)*oi,H[3]=(wr*di-lr*oo-Fr*Xa)*oi,H[4]=(be*Ki-jt*ho-Be*eo)*oi,H[5]=($*ho-Mt*Ki+Bt*eo)*oi,H[6]=(yn*wa-Zr*oo-Vn*ua)*oi,H[7]=(Qe*oo-wr*wa+Fr*ua)*oi,H[8]=(jt*xo-oe*Ki+Be*as)*oi,H[9]=(ht*Ki-$*xo-Bt*as)*oi,H[10]=(Zr*di-en*wa+Vn*Ca)*oi,H[11]=(lr*wa-Qe*di-Fr*Ca)*oi,H[12]=(oe*eo-jt*Co-be*as)*oi,H[13]=($*Co-ht*eo+Mt*as)*oi,H[14]=(en*ua-Zr*Xa-yn*Ca)*oi,H[15]=(Qe*Xa-lr*ua+wr*Ca)*oi,H):null},t.at=hg,t.au=eg,t.av=pg,t.aw=function(){let H={},C=nt.$version;for(let $ in nt.$root){let ht=nt.$root[$];if(ht.required){let Mt=null;Mt=$==="version"?C:ht.type==="array"?[]:{},Mt!=null&&(H[$]=Mt)}}return H},t.ax=ni,t.ay=Z,t.az=function(H){H=H.slice();let C=Object.create(null);for(let $=0;$25||ht<0||ht>=1||$<0||$>=1)},t.bc=function(H,C){return H[0]=C[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=C[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=C[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},t.bd=class extends $e{},t.be=sg,t.bf=my,t.bh=et,t.bi=function(H,C){rt.REGISTERED_PROTOCOLS[H]=C},t.bj=function(H){delete rt.REGISTERED_PROTOCOLS[H]},t.bk=function(H,C){let $={};for(let Mt=0;Mtho*Ol)}let eo=jt?"center":$.get("text-justify").evaluate(Be,{},H.canonical),Ki=$.get("symbol-placement")==="point"?$.get("text-max-width").evaluate(Be,{},H.canonical)*Ol:1/0,Co=()=>{H.bucket.allowVerticalPlacement&&$i(wa)&&(Zr.vertical=N0(en,H.glyphMap,H.glyphPositions,H.imagePositions,Qe,Ki,Bt,oo,"left",di,Vn,t.ah.vertical,!0,wr,lr))};if(!jt&&as){let xo=new Set;if(eo==="auto")for(let oi=0;oie(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));let C=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(C)}catch($){throw new Error(`Could not load image because of ${$.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=k,t.f=H=>new Promise((C,$)=>{let ht=new Image;ht.onload=()=>{C(ht),URL.revokeObjectURL(ht.src),ht.onload=null,window.requestAnimationFrame(()=>{ht.src=R})},ht.onerror=()=>$(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Mt=new Blob([new Uint8Array(H)],{type:"image/png"});ht.src=H.byteLength?URL.createObjectURL(Mt):R}),t.g=ct,t.h=(H,C)=>ot(k(H,{type:"json"}),C),t.i=z,t.j=q,t.k=J,t.l=(H,C)=>ot(k(H,{type:"arrayBuffer"}),C),t.m=ot,t.n=function(H){return new $m(H).readFields(v_,[])},t.o=ds,t.p=R0,t.q=Pt,t.r=ha,t.s=X,t.t=va,t.u=Pn,t.v=nt,t.w=_,t.x=function([H,C,$]){return C+=90,C*=Math.PI/180,$*=Math.PI/180,{x:H*Math.cos(C)*Math.sin($),y:H*Math.sin(C)*Math.sin($),z:H*Math.cos($)}},t.y=Ti,t.z=fs}),E("worker",["./shared"],function(t){class e{constructor(Dt){this.keyCache={},Dt&&this.replace(Dt)}replace(Dt){this._layerConfigs={},this._layers={},this.update(Dt,[])}update(Dt,qt){for(let lt of Dt){this._layerConfigs[lt.id]=lt;let yt=this._layers[lt.id]=t.aA(lt);yt._featureFilter=t.a7(yt.filter),this.keyCache[lt.id]&&delete this.keyCache[lt.id]}for(let lt of qt)delete this.keyCache[lt],delete this._layerConfigs[lt],delete this._layers[lt];this.familiesBySource={};let _t=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let lt of _t){let yt=lt.map(Ee=>this._layers[Ee.id]),St=yt[0];if(St.visibility==="none")continue;let Ht=St.source||"",Yt=this.familiesBySource[Ht];Yt||(Yt=this.familiesBySource[Ht]={});let se=St.sourceLayer||"_geojsonTileLayer",ke=Yt[se];ke||(ke=Yt[se]=[]),ke.push(yt)}}}class r{constructor(Dt){let qt={},_t=[];for(let Ht in Dt){let Yt=Dt[Ht],se=qt[Ht]={};for(let ke in Yt){let Ee=Yt[+ke];if(!Ee||Ee.bitmap.width===0||Ee.bitmap.height===0)continue;let Ue={x:0,y:0,w:Ee.bitmap.width+2,h:Ee.bitmap.height+2};_t.push(Ue),se[ke]={rect:Ue,metrics:Ee.metrics}}}let{w:lt,h:yt}=t.p(_t),St=new t.o({width:lt||1,height:yt||1});for(let Ht in Dt){let Yt=Dt[Ht];for(let se in Yt){let ke=Yt[+se];if(!ke||ke.bitmap.width===0||ke.bitmap.height===0)continue;let Ee=qt[Ht][se].rect;t.o.copy(ke.bitmap,St,{x:0,y:0},{x:Ee.x+1,y:Ee.y+1},ke.bitmap)}}this.image=St,this.positions=qt}}t.bl("GlyphAtlas",r);class i{constructor(Dt){this.tileID=new t.S(Dt.tileID.overscaledZ,Dt.tileID.wrap,Dt.tileID.canonical.z,Dt.tileID.canonical.x,Dt.tileID.canonical.y),this.uid=Dt.uid,this.zoom=Dt.zoom,this.pixelRatio=Dt.pixelRatio,this.tileSize=Dt.tileSize,this.source=Dt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Dt.showCollisionBoxes,this.collectResourceTiming=!!Dt.collectResourceTiming,this.returnDependencies=!!Dt.returnDependencies,this.promoteId=Dt.promoteId,this.inFlightDependencies=[]}parse(Dt,qt,_t,lt){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=Dt,this.collisionBoxArray=new t.a5;let yt=new t.bm(Object.keys(Dt.layers).sort()),St=new t.bn(this.tileID,this.promoteId);St.bucketLayerIDs=[];let Ht={},Yt={featureIndex:St,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:_t},se=qt.familiesBySource[this.source];for(let En in se){let gn=Dt.layers[En];if(!gn)continue;gn.version===1&&t.w(`Vector tile source "${this.source}" layer "${En}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let da=yt.encode(En),ra=[];for(let Se=0;Se=Re.maxzoom||Re.visibility!=="none"&&(n(Se,this.zoom,_t),(Ht[Re.id]=Re.createBucket({index:St.bucketLayerIDs.length,layers:Se,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:da,sourceID:this.source})).populate(ra,Yt,this.tileID.canonical),St.bucketLayerIDs.push(Se.map(Ze=>Ze.id)))}}let ke=t.aF(Yt.glyphDependencies,En=>Object.keys(En).map(Number));this.inFlightDependencies.forEach(En=>En?.abort()),this.inFlightDependencies=[];let Ee=Promise.resolve({});if(Object.keys(ke).length){let En=new AbortController;this.inFlightDependencies.push(En),Ee=lt.sendAsync({type:"GG",data:{stacks:ke,source:this.source,tileID:this.tileID,type:"glyphs"}},En)}let Ue=Object.keys(Yt.iconDependencies),ir=Promise.resolve({});if(Ue.length){let En=new AbortController;this.inFlightDependencies.push(En),ir=lt.sendAsync({type:"GI",data:{icons:Ue,source:this.source,tileID:this.tileID,type:"icons"}},En)}let ar=Object.keys(Yt.patternDependencies),Ye=Promise.resolve({});if(ar.length){let En=new AbortController;this.inFlightDependencies.push(En),Ye=lt.sendAsync({type:"GI",data:{icons:ar,source:this.source,tileID:this.tileID,type:"patterns"}},En)}let[Er,pn,dn]=yield Promise.all([Ee,ir,Ye]),bn=new r(Er),Zn=new t.bo(pn,dn);for(let En in Ht){let gn=Ht[En];gn instanceof t.a6?(n(gn.layers,this.zoom,_t),t.bp({bucket:gn,glyphMap:Er,glyphPositions:bn.positions,imageMap:pn,imagePositions:Zn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):gn.hasPattern&&(gn instanceof t.bq||gn instanceof t.br||gn instanceof t.bs)&&(n(gn.layers,this.zoom,_t),gn.addFeatures(Yt,this.tileID.canonical,Zn.patternPositions))}return this.status="done",{buckets:Object.values(Ht).filter(En=>!En.isEmpty()),featureIndex:St,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bn.image,imageAtlas:Zn,glyphMap:this.returnDependencies?Er:null,iconMap:this.returnDependencies?pn:null,glyphPositions:this.returnDependencies?bn.positions:null}})}}function n(de,Dt,qt){let _t=new t.z(Dt);for(let lt of de)lt.recalculate(_t,qt)}class o{constructor(Dt,qt,_t){this.actor=Dt,this.layerIndex=qt,this.availableImages=_t,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Dt,qt){return t._(this,void 0,void 0,function*(){let _t=yield t.l(Dt.request,qt);try{return{vectorTile:new t.bt.VectorTile(new t.bu(_t.data)),rawData:_t.data,cacheControl:_t.cacheControl,expires:_t.expires}}catch(lt){let yt=new Uint8Array(_t.data),St=`Unable to parse the tile at ${Dt.request.url}, `;throw St+=yt[0]===31&&yt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${lt.message}`,new Error(St)}})}loadTile(Dt){return t._(this,void 0,void 0,function*(){let qt=Dt.uid,_t=!!(Dt&&Dt.request&&Dt.request.collectResourceTiming)&&new t.bv(Dt.request),lt=new i(Dt);this.loading[qt]=lt;let yt=new AbortController;lt.abort=yt;try{let St=yield this.loadVectorTile(Dt,yt);if(delete this.loading[qt],!St)return null;let Ht=St.rawData,Yt={};St.expires&&(Yt.expires=St.expires),St.cacheControl&&(Yt.cacheControl=St.cacheControl);let se={};if(_t){let Ee=_t.finish();Ee&&(se.resourceTiming=JSON.parse(JSON.stringify(Ee)))}lt.vectorTile=St.vectorTile;let ke=lt.parse(St.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[qt]=lt,this.fetching[qt]={rawTileData:Ht,cacheControl:Yt,resourceTiming:se};try{let Ee=yield ke;return t.e({rawTileData:Ht.slice(0)},Ee,Yt,se)}finally{delete this.fetching[qt]}}catch(St){throw delete this.loading[qt],lt.status="done",this.loaded[qt]=lt,St}})}reloadTile(Dt){return t._(this,void 0,void 0,function*(){let qt=Dt.uid;if(!this.loaded||!this.loaded[qt])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let _t=this.loaded[qt];if(_t.showCollisionBoxes=Dt.showCollisionBoxes,_t.status==="parsing"){let lt=yield _t.parse(_t.vectorTile,this.layerIndex,this.availableImages,this.actor),yt;if(this.fetching[qt]){let{rawTileData:St,cacheControl:Ht,resourceTiming:Yt}=this.fetching[qt];delete this.fetching[qt],yt=t.e({rawTileData:St.slice(0)},lt,Ht,Yt)}else yt=lt;return yt}if(_t.status==="done"&&_t.vectorTile)return _t.parse(_t.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Dt){return t._(this,void 0,void 0,function*(){let qt=this.loading,_t=Dt.uid;qt&&qt[_t]&&qt[_t].abort&&(qt[_t].abort.abort(),delete qt[_t])})}removeTile(Dt){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Dt.uid]&&delete this.loaded[Dt.uid]})}}class a{constructor(){this.loaded={}}loadTile(Dt){return t._(this,void 0,void 0,function*(){let{uid:qt,encoding:_t,rawImageData:lt,redFactor:yt,greenFactor:St,blueFactor:Ht,baseShift:Yt}=Dt,se=lt.width+2,ke=lt.height+2,Ee=t.b(lt)?new t.R({width:se,height:ke},yield t.bw(lt,-1,-1,se,ke)):lt,Ue=new t.bx(qt,Ee,_t,yt,St,Ht,Yt);return this.loaded=this.loaded||{},this.loaded[qt]=Ue,Ue})}removeTile(Dt){let qt=this.loaded,_t=Dt.uid;qt&&qt[_t]&&delete qt[_t]}}function s(de,Dt){if(de.length!==0){f(de[0],Dt);for(var qt=1;qt=Math.abs(Ht)?qt-Yt+Ht:Ht-Yt+qt,qt=Yt}qt+_t>=0!=!!Dt&&de.reverse()}var v=t.by(function de(Dt,qt){var _t,lt=Dt&&Dt.type;if(lt==="FeatureCollection")for(_t=0;_t>31}function z(de,Dt){for(var qt=de.loadGeometry(),_t=de.type,lt=0,yt=0,St=qt.length,Ht=0;Htde},I=Math.fround||(F=new Float32Array(1),de=>(F[0]=+de,F[0]));var F;let j=3,N=5,G=6;class rt{constructor(Dt){this.options=Object.assign(Object.create(R),Dt),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Dt){let{log:qt,minZoom:_t,maxZoom:lt}=this.options;qt&&console.time("total time");let yt=`prepare ${Dt.length} points`;qt&&console.time(yt),this.points=Dt;let St=[];for(let Yt=0;Yt=_t;Yt--){let se=+Date.now();Ht=this.trees[Yt]=this._createTree(this._cluster(Ht,Yt)),qt&&console.log("z%d: %d clusters in %dms",Yt,Ht.numItems,+Date.now()-se)}return qt&&console.timeEnd("total time"),this}getClusters(Dt,qt){let _t=((Dt[0]+180)%360+360)%360-180,lt=Math.max(-90,Math.min(90,Dt[1])),yt=Dt[2]===180?180:((Dt[2]+180)%360+360)%360-180,St=Math.max(-90,Math.min(90,Dt[3]));if(Dt[2]-Dt[0]>=360)_t=-180,yt=180;else if(_t>yt){let Ee=this.getClusters([_t,lt,180,St],qt),Ue=this.getClusters([-180,lt,yt,St],qt);return Ee.concat(Ue)}let Ht=this.trees[this._limitZoom(qt)],Yt=Ht.range(et(_t),Z(St),et(yt),Z(lt)),se=Ht.data,ke=[];for(let Ee of Yt){let Ue=this.stride*Ee;ke.push(se[Ue+N]>1?ct(se,Ue,this.clusterProps):this.points[se[Ue+j]])}return ke}getChildren(Dt){let qt=this._getOriginId(Dt),_t=this._getOriginZoom(Dt),lt="No cluster with the specified id.",yt=this.trees[_t];if(!yt)throw new Error(lt);let St=yt.data;if(qt*this.stride>=St.length)throw new Error(lt);let Ht=this.options.radius/(this.options.extent*Math.pow(2,_t-1)),Yt=yt.within(St[qt*this.stride],St[qt*this.stride+1],Ht),se=[];for(let ke of Yt){let Ee=ke*this.stride;St[Ee+4]===Dt&&se.push(St[Ee+N]>1?ct(St,Ee,this.clusterProps):this.points[St[Ee+j]])}if(se.length===0)throw new Error(lt);return se}getLeaves(Dt,qt,_t){let lt=[];return this._appendLeaves(lt,Dt,qt=qt||10,_t=_t||0,0),lt}getTile(Dt,qt,_t){let lt=this.trees[this._limitZoom(Dt)],yt=Math.pow(2,Dt),{extent:St,radius:Ht}=this.options,Yt=Ht/St,se=(_t-Yt)/yt,ke=(_t+1+Yt)/yt,Ee={features:[]};return this._addTileFeatures(lt.range((qt-Yt)/yt,se,(qt+1+Yt)/yt,ke),lt.data,qt,_t,yt,Ee),qt===0&&this._addTileFeatures(lt.range(1-Yt/yt,se,1,ke),lt.data,yt,_t,yt,Ee),qt===yt-1&&this._addTileFeatures(lt.range(0,se,Yt/yt,ke),lt.data,-1,_t,yt,Ee),Ee.features.length?Ee:null}getClusterExpansionZoom(Dt){let qt=this._getOriginZoom(Dt)-1;for(;qt<=this.options.maxZoom;){let _t=this.getChildren(Dt);if(qt++,_t.length!==1)break;Dt=_t[0].properties.cluster_id}return qt}_appendLeaves(Dt,qt,_t,lt,yt){let St=this.getChildren(qt);for(let Ht of St){let Yt=Ht.properties;if(Yt&&Yt.cluster?yt+Yt.point_count<=lt?yt+=Yt.point_count:yt=this._appendLeaves(Dt,Yt.cluster_id,_t,lt,yt):yt1,ke,Ee,Ue;if(se)ke=st(qt,Yt,this.clusterProps),Ee=qt[Yt],Ue=qt[Yt+1];else{let Ye=this.points[qt[Yt+j]];ke=Ye.properties;let[Er,pn]=Ye.geometry.coordinates;Ee=et(Er),Ue=Z(pn)}let ir={type:1,geometry:[[Math.round(this.options.extent*(Ee*yt-_t)),Math.round(this.options.extent*(Ue*yt-lt))]],tags:ke},ar;ar=se||this.options.generateId?qt[Yt+j]:this.points[qt[Yt+j]].id,ar!==void 0&&(ir.id=ar),St.features.push(ir)}}_limitZoom(Dt){return Math.max(this.options.minZoom,Math.min(Math.floor(+Dt),this.options.maxZoom+1))}_cluster(Dt,qt){let{radius:_t,extent:lt,reduce:yt,minPoints:St}=this.options,Ht=_t/(lt*Math.pow(2,qt)),Yt=Dt.data,se=[],ke=this.stride;for(let Ee=0;Eeqt&&(Er+=Yt[dn+N])}if(Er>Ye&&Er>=St){let pn,dn=Ue*Ye,bn=ir*Ye,Zn=-1,En=((Ee/ke|0)<<5)+(qt+1)+this.points.length;for(let gn of ar){let da=gn*ke;if(Yt[da+2]<=qt)continue;Yt[da+2]=qt;let ra=Yt[da+N];dn+=Yt[da]*ra,bn+=Yt[da+1]*ra,Yt[da+4]=En,yt&&(pn||(pn=this._map(Yt,Ee,!0),Zn=this.clusterProps.length,this.clusterProps.push(pn)),yt(pn,this._map(Yt,da)))}Yt[Ee+4]=En,se.push(dn/Er,bn/Er,1/0,En,-1,Er),yt&&se.push(Zn)}else{for(let pn=0;pn1)for(let pn of ar){let dn=pn*ke;if(!(Yt[dn+2]<=qt)){Yt[dn+2]=qt;for(let bn=0;bn>5}_getOriginZoom(Dt){return(Dt-this.points.length)%32}_map(Dt,qt,_t){if(Dt[qt+N]>1){let St=this.clusterProps[Dt[qt+G]];return _t?Object.assign({},St):St}let lt=this.points[Dt[qt+j]].properties,yt=this.options.map(lt);return _t&&yt===lt?Object.assign({},yt):yt}}function ct(de,Dt,qt){return{type:"Feature",id:de[Dt+j],properties:st(de,Dt,qt),geometry:{type:"Point",coordinates:[(_t=de[Dt],360*(_t-.5)),ot(de[Dt+1])]}};var _t}function st(de,Dt,qt){let _t=de[Dt+N],lt=_t>=1e4?`${Math.round(_t/1e3)}k`:_t>=1e3?Math.round(_t/100)/10+"k":_t,yt=de[Dt+G],St=yt===-1?{}:Object.assign({},qt[yt]);return Object.assign(St,{cluster:!0,cluster_id:de[Dt+j],point_count:_t,point_count_abbreviated:lt})}function et(de){return de/360+.5}function Z(de){let Dt=Math.sin(de*Math.PI/180),qt=.5-.25*Math.log((1+Dt)/(1-Dt))/Math.PI;return qt<0?0:qt>1?1:qt}function ot(de){let Dt=(180-360*de)*Math.PI/180;return 360*Math.atan(Math.exp(Dt))/Math.PI-90}function X(de,Dt,qt,_t){let lt=_t,yt=Dt+(qt-Dt>>1),St,Ht=qt-Dt,Yt=de[Dt],se=de[Dt+1],ke=de[qt],Ee=de[qt+1];for(let Ue=Dt+3;Uelt)St=Ue,lt=ir;else if(ir===lt){let ar=Math.abs(Ue-yt);ar_t&&(St-Dt>3&&X(de,Dt,St,_t),de[St+2]=lt,qt-St>3&&X(de,St,qt,_t))}function Q(de,Dt,qt,_t,lt,yt){let St=lt-qt,Ht=yt-_t;if(St!==0||Ht!==0){let Yt=((de-qt)*St+(Dt-_t)*Ht)/(St*St+Ht*Ht);Yt>1?(qt=lt,_t=yt):Yt>0&&(qt+=St*Yt,_t+=Ht*Yt)}return St=de-qt,Ht=Dt-_t,St*St+Ht*Ht}function ut(de,Dt,qt,_t){let lt={id:de??null,type:Dt,geometry:qt,tags:_t,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Dt==="Point"||Dt==="MultiPoint"||Dt==="LineString")J(lt,qt);else if(Dt==="Polygon")J(lt,qt[0]);else if(Dt==="MultiLineString")for(let yt of qt)J(lt,yt);else if(Dt==="MultiPolygon")for(let yt of qt)J(lt,yt[0]);return lt}function J(de,Dt){for(let qt=0;qt0&&(St+=_t?(lt*ke-se*yt)/2:Math.sqrt(Math.pow(se-lt,2)+Math.pow(ke-yt,2))),lt=se,yt=ke}let Ht=Dt.length-3;Dt[2]=1,X(Dt,0,Ht,qt),Dt[Ht+2]=1,Dt.size=Math.abs(St),Dt.start=0,Dt.end=Dt.size}function dt(de,Dt,qt,_t){for(let lt=0;lt1?1:qt}function Ct(de,Dt,qt,_t,lt,yt,St,Ht){if(_t/=Dt,yt>=(qt/=Dt)&&St<_t)return de;if(St=_t)return null;let Yt=[];for(let se of de){let ke=se.geometry,Ee=se.type,Ue=lt===0?se.minX:se.minY,ir=lt===0?se.maxX:se.maxY;if(Ue>=qt&&ir<_t){Yt.push(se);continue}if(ir=_t)continue;let ar=[];if(Ee==="Point"||Ee==="MultiPoint")It(ke,ar,qt,_t,lt);else if(Ee==="LineString")Nt(ke,ar,qt,_t,lt,!1,Ht.lineMetrics);else if(Ee==="MultiLineString")Jt(ke,ar,qt,_t,lt,!1);else if(Ee==="Polygon")Jt(ke,ar,qt,_t,lt,!0);else if(Ee==="MultiPolygon")for(let Ye of ke){let Er=[];Jt(Ye,Er,qt,_t,lt,!0),Er.length&&ar.push(Er)}if(ar.length){if(Ht.lineMetrics&&Ee==="LineString"){for(let Ye of ar)Yt.push(ut(se.id,Ee,Ye,se.tags));continue}Ee!=="LineString"&&Ee!=="MultiLineString"||(ar.length===1?(Ee="LineString",ar=ar[0]):Ee="MultiLineString"),Ee!=="Point"&&Ee!=="MultiPoint"||(Ee=ar.length===3?"Point":"MultiPoint"),Yt.push(ut(se.id,Ee,ar,se.tags))}}return Yt.length?Yt:null}function It(de,Dt,qt,_t,lt){for(let yt=0;yt=qt&&St<=_t&&ee(Dt,de[yt],de[yt+1],de[yt+2])}}function Nt(de,Dt,qt,_t,lt,yt,St){let Ht=te(de),Yt=lt===0?Zt:mt,se,ke,Ee=de.start;for(let Er=0;Erqt&&(ke=Yt(Ht,pn,dn,Zn,En,qt),St&&(Ht.start=Ee+se*ke)):gn>_t?da<_t&&(ke=Yt(Ht,pn,dn,Zn,En,_t),St&&(Ht.start=Ee+se*ke)):ee(Ht,pn,dn,bn),da=qt&&(ke=Yt(Ht,pn,dn,Zn,En,qt),ra=!0),da>_t&&gn<=_t&&(ke=Yt(Ht,pn,dn,Zn,En,_t),ra=!0),!yt&&ra&&(St&&(Ht.end=Ee+se*ke),Dt.push(Ht),Ht=te(de)),St&&(Ee+=se)}let Ue=de.length-3,ir=de[Ue],ar=de[Ue+1],Ye=lt===0?ir:ar;Ye>=qt&&Ye<=_t&&ee(Ht,ir,ar,de[Ue+2]),Ue=Ht.length-3,yt&&Ue>=3&&(Ht[Ue]!==Ht[0]||Ht[Ue+1]!==Ht[1])&&ee(Ht,Ht[0],Ht[1],Ht[2]),Ht.length&&Dt.push(Ht)}function te(de){let Dt=[];return Dt.size=de.size,Dt.start=de.start,Dt.end=de.end,Dt}function Jt(de,Dt,qt,_t,lt,yt){for(let St of de)Nt(St,Dt,qt,_t,lt,yt,!1)}function ee(de,Dt,qt,_t){de.push(Dt,qt,_t)}function Zt(de,Dt,qt,_t,lt,yt){let St=(yt-Dt)/(_t-Dt);return ee(de,yt,qt+(lt-qt)*St,1),St}function mt(de,Dt,qt,_t,lt,yt){let St=(yt-qt)/(lt-qt);return ee(de,Dt+(_t-Dt)*St,yt,1),St}function bt(de,Dt){let qt=[];for(let _t=0;_t0&&Dt.size<(lt?St:_t))return void(qt.numPoints+=Dt.length/3);let Ht=[];for(let Yt=0;YtSt)&&(qt.numSimplified++,Ht.push(Dt[Yt],Dt[Yt+1])),qt.numPoints++;lt&&(function(Yt,se){let ke=0;for(let Ee=0,Ue=Yt.length,ir=Ue-2;Ee0===se)for(let Ee=0,Ue=Yt.length;Ee24)throw new Error("maxZoom should be in the 0-24 range");if(qt.promoteId&&qt.generateId)throw new Error("promoteId and generateId cannot be used together.");let lt=(function(yt,St){let Ht=[];if(yt.type==="FeatureCollection")for(let Yt=0;Yt1&&console.time("creation"),ir=this.tiles[Ue]=Kt(Dt,qt,_t,lt,se),this.tileCoords.push({z:qt,x:_t,y:lt}),ke)){ke>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,_t,lt,ir.numFeatures,ir.numPoints,ir.numSimplified),console.timeEnd("creation"));let ra=`z${qt}`;this.stats[ra]=(this.stats[ra]||0)+1,this.total++}if(ir.source=Dt,yt==null){if(qt===se.indexMaxZoom||ir.numPoints<=se.indexMaxPoints)continue}else{if(qt===se.maxZoom||qt===yt)continue;if(yt!=null){let ra=yt-qt;if(_t!==St>>ra||lt!==Ht>>ra)continue}}if(ir.source=null,Dt.length===0)continue;ke>1&&console.time("clipping");let ar=.5*se.buffer/se.extent,Ye=.5-ar,Er=.5+ar,pn=1+ar,dn=null,bn=null,Zn=null,En=null,gn=Ct(Dt,Ee,_t-ar,_t+Er,0,ir.minX,ir.maxX,se),da=Ct(Dt,Ee,_t+Ye,_t+pn,0,ir.minX,ir.maxX,se);Dt=null,gn&&(dn=Ct(gn,Ee,lt-ar,lt+Er,1,ir.minY,ir.maxY,se),bn=Ct(gn,Ee,lt+Ye,lt+pn,1,ir.minY,ir.maxY,se),gn=null),da&&(Zn=Ct(da,Ee,lt-ar,lt+Er,1,ir.minY,ir.maxY,se),En=Ct(da,Ee,lt+Ye,lt+pn,1,ir.minY,ir.maxY,se),da=null),ke>1&&console.timeEnd("clipping"),Yt.push(dn||[],qt+1,2*_t,2*lt),Yt.push(bn||[],qt+1,2*_t,2*lt+1),Yt.push(Zn||[],qt+1,2*_t+1,2*lt),Yt.push(En||[],qt+1,2*_t+1,2*lt+1)}}getTile(Dt,qt,_t){Dt=+Dt,qt=+qt,_t=+_t;let lt=this.options,{extent:yt,debug:St}=lt;if(Dt<0||Dt>24)return null;let Ht=1<1&&console.log("drilling down to z%d-%d-%d",Dt,qt,_t);let se,ke=Dt,Ee=qt,Ue=_t;for(;!se&&ke>0;)ke--,Ee>>=1,Ue>>=1,se=this.tiles[qe(ke,Ee,Ue)];return se&&se.source?(St>1&&(console.log("found parent tile z%d-%d-%d",ke,Ee,Ue),console.time("drilling down")),this.splitTile(se.source,ke,Ee,Ue,Dt,qt,_t),St>1&&console.timeEnd("drilling down"),this.tiles[Yt]?Ut(this.tiles[Yt],yt):null):null}}function qe(de,Dt,qt){return 32*((1<{Ee.properties=ir;let ar={};for(let Ye of Ue)ar[Ye]=Yt[Ye].evaluate(ke,Ee);return ar},St.reduce=(ir,ar)=>{Ee.properties=ar;for(let Ye of Ue)ke.accumulated=ir[Ye],ir[Ye]=se[Ye].evaluate(ke,Ee)},St})(Dt)).load((yield this._pendingData).features):(lt=yield this._pendingData,new We(lt,Dt.geojsonVtOptions)),this.loaded={};let yt={};if(_t){let St=_t.finish();St&&(yt.resourceTiming={},yt.resourceTiming[Dt.source]=JSON.parse(JSON.stringify(St)))}return yt}catch(yt){if(delete this._pendingRequest,t.bB(yt))return{abandoned:!0};throw yt}var lt})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Dt){let qt=this.loaded;return qt&&qt[Dt.uid]?super.reloadTile(Dt):this.loadTile(Dt)}loadAndProcessGeoJSON(Dt,qt){return t._(this,void 0,void 0,function*(){let _t=yield this.loadGeoJSON(Dt,qt);if(delete this._pendingRequest,typeof _t!="object")throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`);if(v(_t,!0),Dt.filter){let lt=t.bC(Dt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(lt.result==="error")throw new Error(lt.value.map(yt=>`${yt.key}: ${yt.message}`).join(", "));_t={type:"FeatureCollection",features:_t.features.filter(yt=>lt.value.evaluate({zoom:0},yt))}}return _t})}loadGeoJSON(Dt,qt){return t._(this,void 0,void 0,function*(){let{promoteId:_t}=Dt;if(Dt.request){let lt=yield t.h(Dt.request,qt);return this._dataUpdateable=_r(lt.data,_t)?er(lt.data,_t):void 0,lt.data}if(typeof Dt.data=="string")try{let lt=JSON.parse(Dt.data);return this._dataUpdateable=_r(lt,_t)?er(lt,_t):void 0,lt}catch{throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`)}if(!Dt.dataDiff)throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Dt.source}`);return(function(lt,yt,St){var Ht,Yt,se,ke;if(yt.removeAll&<.clear(),yt.remove)for(let Ee of yt.remove)lt.delete(Ee);if(yt.add)for(let Ee of yt.add){let Ue=vr(Ee,St);Ue!=null&<.set(Ue,Ee)}if(yt.update)for(let Ee of yt.update){let Ue=lt.get(Ee.id);if(Ue==null)continue;let ir=!Ee.removeAllProperties&&(((Ht=Ee.removeProperties)===null||Ht===void 0?void 0:Ht.length)>0||((Yt=Ee.addOrUpdateProperties)===null||Yt===void 0?void 0:Yt.length)>0);if((Ee.newGeometry||Ee.removeAllProperties||ir)&&(Ue=Object.assign({},Ue),lt.set(Ee.id,Ue),ir&&(Ue.properties=Object.assign({},Ue.properties))),Ee.newGeometry&&(Ue.geometry=Ee.newGeometry),Ee.removeAllProperties)Ue.properties={};else if(((se=Ee.removeProperties)===null||se===void 0?void 0:se.length)>0)for(let ar of Ee.removeProperties)Object.prototype.hasOwnProperty.call(Ue.properties,ar)&&delete Ue.properties[ar];if(((ke=Ee.addOrUpdateProperties)===null||ke===void 0?void 0:ke.length)>0)for(let{key:ar,value:Ye}of Ee.addOrUpdateProperties)Ue.properties[ar]=Ye}})(this._dataUpdateable,Dt.dataDiff,_t),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Dt){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Dt){return this._geoJSONIndex.getClusterExpansionZoom(Dt.clusterId)}getClusterChildren(Dt){return this._geoJSONIndex.getChildren(Dt.clusterId)}getClusterLeaves(Dt){return this._geoJSONIndex.getLeaves(Dt.clusterId,Dt.limit,Dt.offset)}}class Ir{constructor(Dt){this.self=Dt,this.actor=new t.F(Dt),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(qt,_t)=>{if(this.externalWorkerSourceTypes[qt])throw new Error(`Worker source with name "${qt}" already registered.`);this.externalWorkerSourceTypes[qt]=_t},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=qt=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(qt)},this.actor.registerMessageHandler("LDT",(qt,_t)=>this._getDEMWorkerSource(qt,_t.source).loadTile(_t)),this.actor.registerMessageHandler("RDT",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(qt,_t.source).removeTile(_t)})),this.actor.registerMessageHandler("GCEZ",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterExpansionZoom(_t)})),this.actor.registerMessageHandler("GCC",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterChildren(_t)})),this.actor.registerMessageHandler("GCL",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterLeaves(_t)})),this.actor.registerMessageHandler("LD",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).loadData(_t)),this.actor.registerMessageHandler("GD",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).getData()),this.actor.registerMessageHandler("LT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).loadTile(_t)),this.actor.registerMessageHandler("RT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).reloadTile(_t)),this.actor.registerMessageHandler("AT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).abortTile(_t)),this.actor.registerMessageHandler("RMT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).removeTile(_t)),this.actor.registerMessageHandler("RS",(qt,_t)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[qt]||!this.workerSources[qt][_t.type]||!this.workerSources[qt][_t.type][_t.source])return;let lt=this.workerSources[qt][_t.type][_t.source];delete this.workerSources[qt][_t.type][_t.source],lt.removeSource!==void 0&<.removeSource(_t)})),this.actor.registerMessageHandler("RM",qt=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[qt],delete this.availableImages[qt],delete this.workerSources[qt],delete this.demWorkerSources[qt]})),this.actor.registerMessageHandler("SR",(qt,_t)=>t._(this,void 0,void 0,function*(){this.referrer=_t})),this.actor.registerMessageHandler("SRPS",(qt,_t)=>this._syncRTLPluginState(qt,_t)),this.actor.registerMessageHandler("IS",(qt,_t)=>t._(this,void 0,void 0,function*(){this.self.importScripts(_t)})),this.actor.registerMessageHandler("SI",(qt,_t)=>this._setImages(qt,_t)),this.actor.registerMessageHandler("UL",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).update(_t.layers,_t.removedIds)})),this.actor.registerMessageHandler("SL",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).replace(_t)}))}_setImages(Dt,qt){return t._(this,void 0,void 0,function*(){this.availableImages[Dt]=qt;for(let _t in this.workerSources[Dt]){let lt=this.workerSources[Dt][_t];for(let yt in lt)lt[yt].availableImages=qt}})}_syncRTLPluginState(Dt,qt){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if(qt.pluginStatus!=="loading")return t.bD.setState(qt),qt;let _t=qt.pluginURL;if(this.self.importScripts(_t),t.bD.isParsed()){let lt={pluginStatus:"loaded",pluginURL:_t};return t.bD.setState(lt),lt}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${_t}`)})}_getAvailableImages(Dt){let qt=this.availableImages[Dt];return qt||(qt=[]),qt}_getLayerIndex(Dt){let qt=this.layerIndexes[Dt];return qt||(qt=this.layerIndexes[Dt]=new e),qt}_getWorkerSource(Dt,qt,_t){if(this.workerSources[Dt]||(this.workerSources[Dt]={}),this.workerSources[Dt][qt]||(this.workerSources[Dt][qt]={}),!this.workerSources[Dt][qt][_t]){let lt={sendAsync:(yt,St)=>(yt.targetMapId=Dt,this.actor.sendAsync(yt,St))};switch(qt){case"vector":this.workerSources[Dt][qt][_t]=new o(lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;case"geojson":this.workerSources[Dt][qt][_t]=new Mr(lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;default:this.workerSources[Dt][qt][_t]=new this.externalWorkerSourceTypes[qt](lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt))}}return this.workerSources[Dt][qt][_t]}_getDEMWorkerSource(Dt,qt){return this.demWorkerSources[Dt]||(this.demWorkerSources[Dt]={}),this.demWorkerSources[Dt][qt]||(this.demWorkerSources[Dt][qt]=new a),this.demWorkerSources[Dt][qt]}}return t.i(self)&&(self.worker=new Ir(self)),Ir}),E("index",["exports","./shared"],function(t,e){var r="4.7.1";let i,n,o={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Pt=>new Promise((L,at)=>{let xt=requestAnimationFrame(L);Pt.signal.addEventListener("abort",()=>{cancelAnimationFrame(xt),at(e.c())})}),getImageData(Pt,L=0){return this.getImageCanvasContext(Pt).getImageData(-L,-L,Pt.width+2*L,Pt.height+2*L)},getImageCanvasContext(Pt){let L=window.document.createElement("canvas"),at=L.getContext("2d",{willReadFrequently:!0});if(!at)throw new Error("failed to create canvas 2d context");return L.width=Pt.width,L.height=Pt.height,at.drawImage(Pt,0,0,Pt.width,Pt.height),at},resolveURL:Pt=>(i||(i=document.createElement("a")),i.href=Pt,i.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(L){if(!a.docStyle)return L[0];for(let at=0;at{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(L){let at=L.getBoundingClientRect();return{x:at.width/L.offsetWidth||1,y:at.height/L.offsetHeight||1,boundingClientRect:at}}static getPoint(L,at,xt){let kt=at.boundingClientRect;return new e.P((xt.clientX-kt.left)/at.x-L.clientLeft,(xt.clientY-kt.top)/at.y-L.clientTop)}static mousePos(L,at){let xt=a.getScale(L);return a.getPoint(L,xt,at)}static touchPos(L,at){let xt=[],kt=a.getScale(L);for(let Lt=0;Lt{f&&w(f),f=null,m=!0},v.onerror=()=>{g=!0,f=null},v.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Pt){let L,at,xt,kt;Pt.resetRequestQueue=()=>{L=[],at=0,xt=0,kt={}},Pt.addThrottleControl=Pe=>{let $e=xt++;return kt[$e]=Pe,$e},Pt.removeThrottleControl=Pe=>{delete kt[Pe],le()},Pt.getImage=(Pe,$e,hr=!0)=>new Promise((pr,Br)=>{s.supported&&(Pe.headers||(Pe.headers={}),Pe.headers.accept="image/webp,*/*"),e.e(Pe,{type:"image"}),L.push({abortController:$e,requestParameters:Pe,supportImageRefresh:hr,state:"queued",onError:Jr=>{Br(Jr)},onSuccess:Jr=>{pr(Jr)}}),le()});let Lt=Pe=>e._(this,void 0,void 0,function*(){Pe.state="running";let{requestParameters:$e,supportImageRefresh:hr,onError:pr,onSuccess:Br,abortController:Jr}=Pe,Rt=hr===!1&&!e.i(self)&&!e.g($e.url)&&(!$e.headers||Object.keys($e.headers).reduce((ce,Te)=>ce&&Te==="accept",!0));at++;let Gt=Rt?xe($e,Jr):e.m($e,Jr);try{let ce=yield Gt;delete Pe.abortController,Pe.state="completed",ce.data instanceof HTMLImageElement||e.b(ce.data)?Br(ce):ce.data&&Br({data:yield(ae=ce.data,typeof createImageBitmap=="function"?e.d(ae):e.f(ae)),cacheControl:ce.cacheControl,expires:ce.expires})}catch(ce){delete Pe.abortController,pr(ce)}finally{at--,le()}var ae}),le=()=>{let Pe=(()=>{for(let $e of Object.keys(kt))if(kt[$e]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let $e=at;$e0;$e++){let hr=L.shift();hr.abortController.signal.aborted?$e--:Lt(hr)}},xe=(Pe,$e)=>new Promise((hr,pr)=>{let Br=new Image,Jr=Pe.url,Rt=Pe.credentials;Rt&&Rt==="include"?Br.crossOrigin="use-credentials":(Rt&&Rt==="same-origin"||!e.s(Jr))&&(Br.crossOrigin="anonymous"),$e.signal.addEventListener("abort",()=>{Br.src="",pr(e.c())}),Br.fetchPriority="high",Br.onload=()=>{Br.onerror=Br.onload=null,hr({data:Br})},Br.onerror=()=>{Br.onerror=Br.onload=null,$e.signal.aborted||pr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Br.src=Jr})})(l||(l={})),l.resetRequestQueue();class x{constructor(L){this._transformRequestFn=L}transformRequest(L,at){return this._transformRequestFn&&this._transformRequestFn(L,at)||{url:L}}setTransformRequest(L){this._transformRequestFn=L}}function y(Pt){var L=new e.A(3);return L[0]=Pt[0],L[1]=Pt[1],L[2]=Pt[2],L}var S,k=function(Pt,L,at){return Pt[0]=L[0]-at[0],Pt[1]=L[1]-at[1],Pt[2]=L[2]-at[2],Pt};S=new e.A(3),e.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var M=function(Pt){var L=Pt[0],at=Pt[1];return L*L+at*at};function T(Pt){let L=[];if(typeof Pt=="string")L.push({id:"default",url:Pt});else if(Pt&&Pt.length>0){let at=[];for(let{id:xt,url:kt}of Pt){let Lt=`${xt}${kt}`;at.indexOf(Lt)===-1&&(at.push(Lt),L.push({id:xt,url:kt}))}}return L}function c(Pt,L,at){let xt=Pt.split("?");return xt[0]+=`${L}${at}`,xt.join("?")}(function(){var Pt=new e.A(2);e.A!=Float32Array&&(Pt[0]=0,Pt[1]=0)})();class h{constructor(L,at,xt,kt){this.context=L,this.format=xt,this.texture=L.gl.createTexture(),this.update(at,kt)}update(L,at,xt){let{width:kt,height:Lt}=L,le=!(this.size&&this.size[0]===kt&&this.size[1]===Lt||xt),{context:xe}=this,{gl:Pe}=xe;if(this.useMipmap=!!(at&&at.useMipmap),Pe.bindTexture(Pe.TEXTURE_2D,this.texture),xe.pixelStoreUnpackFlipY.set(!1),xe.pixelStoreUnpack.set(1),xe.pixelStoreUnpackPremultiplyAlpha.set(this.format===Pe.RGBA&&(!at||at.premultiply!==!1)),le)this.size=[kt,Lt],L instanceof HTMLImageElement||L instanceof HTMLCanvasElement||L instanceof HTMLVideoElement||L instanceof ImageData||e.b(L)?Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,this.format,Pe.UNSIGNED_BYTE,L):Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,kt,Lt,0,this.format,Pe.UNSIGNED_BYTE,L.data);else{let{x:$e,y:hr}=xt||{x:0,y:0};L instanceof HTMLImageElement||L instanceof HTMLCanvasElement||L instanceof HTMLVideoElement||L instanceof ImageData||e.b(L)?Pe.texSubImage2D(Pe.TEXTURE_2D,0,$e,hr,Pe.RGBA,Pe.UNSIGNED_BYTE,L):Pe.texSubImage2D(Pe.TEXTURE_2D,0,$e,hr,kt,Lt,Pe.RGBA,Pe.UNSIGNED_BYTE,L.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Pe.generateMipmap(Pe.TEXTURE_2D)}bind(L,at,xt){let{context:kt}=this,{gl:Lt}=kt;Lt.bindTexture(Lt.TEXTURE_2D,this.texture),xt!==Lt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(xt=Lt.LINEAR),L!==this.filter&&(Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MAG_FILTER,L),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MIN_FILTER,xt||L),this.filter=L),at!==this.wrap&&(Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_S,at),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_T,at),this.wrap=at)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:L}=this.context;L.deleteTexture(this.texture),this.texture=null}}function b(Pt){let{userImage:L}=Pt;return!!(L&&L.render&&L.render())&&(Pt.data.replace(new Uint8Array(L.data.buffer)),!0)}class _ extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(L){if(this.loaded!==L&&(this.loaded=L,L)){for(let{ids:at,promiseResolve:xt}of this.requestors)xt(this._getImagesForIds(at));this.requestors=[]}}getImage(L){let at=this.images[L];if(at&&!at.data&&at.spriteData){let xt=at.spriteData;at.data=new e.R({width:xt.width,height:xt.height},xt.context.getImageData(xt.x,xt.y,xt.width,xt.height).data),at.spriteData=null}return at}addImage(L,at){if(this.images[L])throw new Error(`Image id ${L} already exist, use updateImage instead`);this._validate(L,at)&&(this.images[L]=at)}_validate(L,at){let xt=!0,kt=at.data||at.spriteData;return this._validateStretch(at.stretchX,kt&&kt.width)||(this.fire(new e.j(new Error(`Image "${L}" has invalid "stretchX" value`))),xt=!1),this._validateStretch(at.stretchY,kt&&kt.height)||(this.fire(new e.j(new Error(`Image "${L}" has invalid "stretchY" value`))),xt=!1),this._validateContent(at.content,at)||(this.fire(new e.j(new Error(`Image "${L}" has invalid "content" value`))),xt=!1),xt}_validateStretch(L,at){if(!L)return!0;let xt=0;for(let kt of L){if(kt[0]{let kt=!0;if(!this.isLoaded())for(let Lt of L)this.images[Lt]||(kt=!1);this.isLoaded()||kt?at(this._getImagesForIds(L)):this.requestors.push({ids:L,promiseResolve:at})})}_getImagesForIds(L){let at={};for(let xt of L){let kt=this.getImage(xt);kt||(this.fire(new e.k("styleimagemissing",{id:xt})),kt=this.getImage(xt)),kt?at[xt]={data:kt.data.clone(),pixelRatio:kt.pixelRatio,sdf:kt.sdf,version:kt.version,stretchX:kt.stretchX,stretchY:kt.stretchY,content:kt.content,textFitWidth:kt.textFitWidth,textFitHeight:kt.textFitHeight,hasRenderCallback:!!(kt.userImage&&kt.userImage.render)}:e.w(`Image "${xt}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return at}getPixelSize(){let{width:L,height:at}=this.atlasImage;return{width:L,height:at}}getPattern(L){let at=this.patterns[L],xt=this.getImage(L);if(!xt)return null;if(at&&at.position.version===xt.version)return at.position;if(at)at.position.version=xt.version;else{let kt={w:xt.data.width+2,h:xt.data.height+2,x:0,y:0},Lt=new e.I(kt,xt);this.patterns[L]={bin:kt,position:Lt}}return this._updatePatternAtlas(),this.patterns[L].position}bind(L){let at=L.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new h(L,this.atlasImage,at.RGBA),this.atlasTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}_updatePatternAtlas(){let L=[];for(let Lt in this.patterns)L.push(this.patterns[Lt].bin);let{w:at,h:xt}=e.p(L),kt=this.atlasImage;kt.resize({width:at||1,height:xt||1});for(let Lt in this.patterns){let{bin:le}=this.patterns[Lt],xe=le.x+1,Pe=le.y+1,$e=this.getImage(Lt).data,hr=$e.width,pr=$e.height;e.R.copy($e,kt,{x:0,y:0},{x:xe,y:Pe},{width:hr,height:pr}),e.R.copy($e,kt,{x:0,y:pr-1},{x:xe,y:Pe-1},{width:hr,height:1}),e.R.copy($e,kt,{x:0,y:0},{x:xe,y:Pe+pr},{width:hr,height:1}),e.R.copy($e,kt,{x:hr-1,y:0},{x:xe-1,y:Pe},{width:1,height:pr}),e.R.copy($e,kt,{x:0,y:0},{x:xe+hr,y:Pe},{width:1,height:pr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(L){for(let at of L){if(this.callbackDispatchedThisFrame[at])continue;this.callbackDispatchedThisFrame[at]=!0;let xt=this.getImage(at);xt||e.w(`Image with ID: "${at}" was not found`),b(xt)&&this.updateImage(at,xt)}}}let P=1e20;function z(Pt,L,at,xt,kt,Lt,le,xe,Pe){for(let $e=L;$e-1);Pe++,Lt[Pe]=xe,le[Pe]=$e,le[Pe+1]=P}for(let xe=0,Pe=0;xe65535)throw new Error("glyphs > 65535 not supported");if(xt.ranges[Lt])return{stack:L,id:at,glyph:kt};if(!this.url)throw new Error("glyphsUrl is not set");if(!xt.requests[Lt]){let xe=B.loadGlyphRange(L,Lt,this.url,this.requestManager);xt.requests[Lt]=xe}let le=yield xt.requests[Lt];for(let xe in le)this._doesCharSupportLocalGlyph(+xe)||(xt.glyphs[+xe]=le[+xe]);return xt.ranges[Lt]=!0,{stack:L,id:at,glyph:le[at]||null}})}_doesCharSupportLocalGlyph(L){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(L))}_tinySDF(L,at,xt){let kt=this.localIdeographFontFamily;if(!kt||!this._doesCharSupportLocalGlyph(xt))return;let Lt=L.tinySDF;if(!Lt){let xe="400";/bold/i.test(at)?xe="900":/medium/i.test(at)?xe="500":/light/i.test(at)&&(xe="200"),Lt=L.tinySDF=new B.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:kt,fontWeight:xe})}let le=Lt.draw(String.fromCharCode(xt));return{id:xt,bitmap:new e.o({width:le.width||60,height:le.height||60},le.data),metrics:{width:le.glyphWidth/2||24,height:le.glyphHeight/2||24,left:le.glyphLeft/2+.5||0,top:le.glyphTop/2-27.5||-8,advance:le.glyphAdvance/2||24,isDoubleResolution:!0}}}}B.loadGlyphRange=function(Pt,L,at,xt){return e._(this,void 0,void 0,function*(){let kt=256*L,Lt=kt+255,le=xt.transformRequest(at.replace("{fontstack}",Pt).replace("{range}",`${kt}-${Lt}`),"Glyphs"),xe=yield e.l(le,new AbortController);if(!xe||!xe.data)throw new Error(`Could not load glyph range. range: ${L}, ${kt}-${Lt}`);let Pe={};for(let $e of e.n(xe.data))Pe[$e.id]=$e;return Pe})},B.TinySDF=class{constructor({fontSize:Pt=24,buffer:L=3,radius:at=8,cutoff:xt=.25,fontFamily:kt="sans-serif",fontWeight:Lt="normal",fontStyle:le="normal"}={}){this.buffer=L,this.cutoff=xt,this.radius=at;let xe=this.size=Pt+4*L,Pe=this._createCanvas(xe),$e=this.ctx=Pe.getContext("2d",{willReadFrequently:!0});$e.font=`${le} ${Lt} ${Pt}px ${kt}`,$e.textBaseline="alphabetic",$e.textAlign="left",$e.fillStyle="black",this.gridOuter=new Float64Array(xe*xe),this.gridInner=new Float64Array(xe*xe),this.f=new Float64Array(xe),this.z=new Float64Array(xe+1),this.v=new Uint16Array(xe)}_createCanvas(Pt){let L=document.createElement("canvas");return L.width=L.height=Pt,L}draw(Pt){let{width:L,actualBoundingBoxAscent:at,actualBoundingBoxDescent:xt,actualBoundingBoxLeft:kt,actualBoundingBoxRight:Lt}=this.ctx.measureText(Pt),le=Math.ceil(at),xe=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Lt-kt))),Pe=Math.min(this.size-this.buffer,le+Math.ceil(xt)),$e=xe+2*this.buffer,hr=Pe+2*this.buffer,pr=Math.max($e*hr,0),Br=new Uint8ClampedArray(pr),Jr={data:Br,width:$e,height:hr,glyphWidth:xe,glyphHeight:Pe,glyphTop:le,glyphLeft:0,glyphAdvance:L};if(xe===0||Pe===0)return Jr;let{ctx:Rt,buffer:Gt,gridInner:ae,gridOuter:ce}=this;Rt.clearRect(Gt,Gt,xe,Pe),Rt.fillText(Pt,Gt,Gt+le);let Te=Rt.getImageData(Gt,Gt,xe,Pe);ce.fill(P,0,pr),ae.fill(0,0,pr);for(let ye=0;ye0?gr*gr:0,ae[fr]=gr<0?gr*gr:0}}z(ce,0,0,$e,hr,$e,this.f,this.v,this.z),z(ae,Gt,Gt,xe,Pe,$e,this.f,this.v,this.z);for(let ye=0;ye1&&(Pe=L[++xe]);let hr=Math.abs($e-Pe.left),pr=Math.abs($e-Pe.right),Br=Math.min(hr,pr),Jr,Rt=Lt/xt*(kt+1);if(Pe.isDash){let Gt=kt-Math.abs(Rt);Jr=Math.sqrt(Br*Br+Gt*Gt)}else Jr=kt-Math.sqrt(Br*Br+Rt*Rt);this.data[le+$e]=Math.max(0,Math.min(255,Jr+128))}}}addRegularDash(L){for(let xe=L.length-1;xe>=0;--xe){let Pe=L[xe],$e=L[xe+1];Pe.zeroLength?L.splice(xe,1):$e&&$e.isDash===Pe.isDash&&($e.left=Pe.left,L.splice(xe,1))}let at=L[0],xt=L[L.length-1];at.isDash===xt.isDash&&(at.left=xt.left-this.width,xt.right=at.right+this.width);let kt=this.width*this.nextRow,Lt=0,le=L[Lt];for(let xe=0;xe1&&(le=L[++Lt]);let Pe=Math.abs(xe-le.left),$e=Math.abs(xe-le.right),hr=Math.min(Pe,$e);this.data[kt+xe]=Math.max(0,Math.min(255,(le.isDash?hr:-hr)+128))}}addDash(L,at){let xt=at?7:0,kt=2*xt+1;if(this.nextRow+kt>this.height)return e.w("LineAtlas out of space"),null;let Lt=0;for(let xe=0;xe{at.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[rt]}numActive(){return Object.keys(this.active).length}}let st=Math.floor(o.hardwareConcurrency/2),et,Z;function ot(){return et||(et=new ct),et}ct.workerCount=e.C(globalThis)?Math.max(Math.min(st,3),1):1;class X{constructor(L,at){this.workerPool=L,this.actors=[],this.currentActor=0,this.id=at;let xt=this.workerPool.acquire(at);for(let kt=0;kt{at.remove()}),this.actors=[],L&&this.workerPool.release(this.id)}registerMessageHandler(L,at){for(let xt of this.actors)xt.registerMessageHandler(L,at)}}function Q(){return Z||(Z=new X(ot(),e.G),Z.registerMessageHandler("GR",(Pt,L,at)=>e.m(L,at))),Z}function ut(Pt,L){let at=e.H();return e.J(at,at,[1,1,0]),e.K(at,at,[.5*Pt.width,.5*Pt.height,1]),e.L(at,at,Pt.calculatePosMatrix(L.toUnwrapped()))}function J(Pt,L,at,xt,kt,Lt){let le=(function(pr,Br,Jr){if(pr)for(let Rt of pr){let Gt=Br[Rt];if(Gt&&Gt.source===Jr&&Gt.type==="fill-extrusion")return!0}else for(let Rt in Br){let Gt=Br[Rt];if(Gt.source===Jr&&Gt.type==="fill-extrusion")return!0}return!1})(kt&&kt.layers,L,Pt.id),xe=Lt.maxPitchScaleFactor(),Pe=Pt.tilesIn(xt,xe,le);Pe.sort(q);let $e=[];for(let pr of Pe)$e.push({wrappedTileID:pr.tileID.wrapped().key,queryResults:pr.tile.queryRenderedFeatures(L,at,Pt._state,pr.queryGeometry,pr.cameraQueryGeometry,pr.scale,kt,Lt,xe,ut(Pt.transform,pr.tileID))});let hr=(function(pr){let Br={},Jr={};for(let Rt of pr){let Gt=Rt.queryResults,ae=Rt.wrappedTileID,ce=Jr[ae]=Jr[ae]||{};for(let Te in Gt){let ye=Gt[Te],ze=ce[Te]=ce[Te]||{},rr=Br[Te]=Br[Te]||[];for(let fr of ye)ze[fr.featureIndex]||(ze[fr.featureIndex]=!0,rr.push(fr))}}return Br})($e);for(let pr in hr)hr[pr].forEach(Br=>{let Jr=Br.feature,Rt=Pt.getFeatureState(Jr.layer["source-layer"],Jr.id);Jr.source=Jr.layer.source,Jr.layer["source-layer"]&&(Jr.sourceLayer=Jr.layer["source-layer"]),Jr.state=Rt});return hr}function q(Pt,L){let at=Pt.tileID,xt=L.tileID;return at.overscaledZ-xt.overscaledZ||at.canonical.y-xt.canonical.y||at.wrap-xt.wrap||at.canonical.x-xt.canonical.x}function it(Pt,L,at){return e._(this,void 0,void 0,function*(){let xt=Pt;if(Pt.url?xt=(yield e.h(L.transformRequest(Pt.url,"Source"),at)).data:yield o.frameAsync(at),!xt)return null;let kt=e.M(e.e(xt,Pt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in xt&&xt.vector_layers&&(kt.vectorLayerIds=xt.vector_layers.map(Lt=>Lt.id)),kt})}class nt{constructor(L,at){L&&(at?this.setSouthWest(L).setNorthEast(at):Array.isArray(L)&&(L.length===4?this.setSouthWest([L[0],L[1]]).setNorthEast([L[2],L[3]]):this.setSouthWest(L[0]).setNorthEast(L[1])))}setNorthEast(L){return this._ne=L instanceof e.N?new e.N(L.lng,L.lat):e.N.convert(L),this}setSouthWest(L){return this._sw=L instanceof e.N?new e.N(L.lng,L.lat):e.N.convert(L),this}extend(L){let at=this._sw,xt=this._ne,kt,Lt;if(L instanceof e.N)kt=L,Lt=L;else{if(!(L instanceof nt))return Array.isArray(L)?L.length===4||L.every(Array.isArray)?this.extend(nt.convert(L)):this.extend(e.N.convert(L)):L&&("lng"in L||"lon"in L)&&"lat"in L?this.extend(e.N.convert(L)):this;if(kt=L._sw,Lt=L._ne,!kt||!Lt)return this}return at||xt?(at.lng=Math.min(kt.lng,at.lng),at.lat=Math.min(kt.lat,at.lat),xt.lng=Math.max(Lt.lng,xt.lng),xt.lat=Math.max(Lt.lat,xt.lat)):(this._sw=new e.N(kt.lng,kt.lat),this._ne=new e.N(Lt.lng,Lt.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(L){let{lng:at,lat:xt}=e.N.convert(L),kt=this._sw.lng<=at&&at<=this._ne.lng;return this._sw.lng>this._ne.lng&&(kt=this._sw.lng>=at&&at>=this._ne.lng),this._sw.lat<=xt&&xt<=this._ne.lat&&kt}static convert(L){return L instanceof nt?L:L&&new nt(L)}static fromLngLat(L,at=0){let xt=360*at/40075017,kt=xt/Math.cos(Math.PI/180*L.lat);return new nt(new e.N(L.lng-kt,L.lat-xt),new e.N(L.lng+kt,L.lat+xt))}adjustAntiMeridian(){let L=new e.N(this._sw.lng,this._sw.lat),at=new e.N(this._ne.lng,this._ne.lat);return new nt(L,L.lng>at.lng?new e.N(at.lng+360,at.lat):at)}}class dt{constructor(L,at,xt){this.bounds=nt.convert(this.validateBounds(L)),this.minzoom=at||0,this.maxzoom=xt||24}validateBounds(L){return Array.isArray(L)&&L.length===4?[Math.max(-180,L[0]),Math.max(-90,L[1]),Math.min(180,L[2]),Math.min(90,L[3])]:[-180,-90,180,90]}contains(L){let at=Math.pow(2,L.z),xt=Math.floor(e.O(this.bounds.getWest())*at),kt=Math.floor(e.Q(this.bounds.getNorth())*at),Lt=Math.ceil(e.O(this.bounds.getEast())*at),le=Math.ceil(e.Q(this.bounds.getSouth())*at);return L.x>=xt&&L.x=kt&&L.y{this._options.tiles=L}),this}setUrl(L){return this.setSourceProperty(()=>{this.url=L,this._options.url=L}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(L){return e._(this,void 0,void 0,function*(){let at=L.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xt={request:this.map._requestManager.transformRequest(at,"Tile"),uid:L.uid,tileID:L.tileID,zoom:L.tileID.overscaledZ,tileSize:this.tileSize*L.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};xt.request.collectResourceTiming=this._collectResourceTiming;let kt="RT";if(L.actor&&L.state!=="expired"){if(L.state==="loading")return new Promise((Lt,le)=>{L.reloadPromise={resolve:Lt,reject:le}})}else L.actor=this.dispatcher.getActor(),kt="LT";L.abortController=new AbortController;try{let Lt=yield L.actor.sendAsync({type:kt,data:xt},L.abortController);if(delete L.abortController,L.aborted)return;this._afterTileLoadWorkerResponse(L,Lt)}catch(Lt){if(delete L.abortController,L.aborted)return;if(Lt&&Lt.status!==404)throw Lt;this._afterTileLoadWorkerResponse(L,null)}})}_afterTileLoadWorkerResponse(L,at){if(at&&at.resourceTiming&&(L.resourceTiming=at.resourceTiming),at&&this.map._refreshExpiredTiles&&L.setExpiryData(at),L.loadVectorData(at,this.map.painter),L.reloadPromise){let xt=L.reloadPromise;L.reloadPromise=null,this.loadTile(L).then(xt.resolve).catch(xt.reject)}}abortTile(L){return e._(this,void 0,void 0,function*(){L.abortController&&(L.abortController.abort(),delete L.abortController),L.actor&&(yield L.actor.sendAsync({type:"AT",data:{uid:L.uid,type:this.type,source:this.id}}))})}unloadTile(L){return e._(this,void 0,void 0,function*(){L.unloadVectorData(),L.actor&&(yield L.actor.sendAsync({type:"RMT",data:{uid:L.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class wt extends e.E{constructor(L,at,xt,kt){super(),this.id=L,this.dispatcher=xt,this.setEventedParent(kt),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},at),e.e(this,e.M(at,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let L=yield it(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,L&&(e.e(this,L),L.bounds&&(this.tileBounds=new dt(L.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(L){this._tileJSONRequest=null,this.fire(new e.j(L))}})}loaded(){return this._loaded}onAdd(L){this.map=L,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(L){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),L(),this.load()}setTiles(L){return this.setSourceProperty(()=>{this._options.tiles=L}),this}setUrl(L){return this.setSourceProperty(()=>{this.url=L,this._options.url=L}),this}serialize(){return e.e({},this._options)}hasTile(L){return!this.tileBounds||this.tileBounds.contains(L.canonical)}loadTile(L){return e._(this,void 0,void 0,function*(){let at=L.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);L.abortController=new AbortController;try{let xt=yield l.getImage(this.map._requestManager.transformRequest(at,"Tile"),L.abortController,this.map._refreshExpiredTiles);if(delete L.abortController,L.aborted)return void(L.state="unloaded");if(xt&&xt.data){this.map._refreshExpiredTiles&&xt.cacheControl&&xt.expires&&L.setExpiryData({cacheControl:xt.cacheControl,expires:xt.expires});let kt=this.map.painter.context,Lt=kt.gl,le=xt.data;L.texture=this.map.painter.getTileTexture(le.width),L.texture?L.texture.update(le,{useMipmap:!0}):(L.texture=new h(kt,le,Lt.RGBA,{useMipmap:!0}),L.texture.bind(Lt.LINEAR,Lt.CLAMP_TO_EDGE,Lt.LINEAR_MIPMAP_NEAREST)),L.state="loaded"}}catch(xt){if(delete L.abortController,L.aborted)L.state="unloaded";else if(xt)throw L.state="errored",xt}})}abortTile(L){return e._(this,void 0,void 0,function*(){L.abortController&&(L.abortController.abort(),delete L.abortController)})}unloadTile(L){return e._(this,void 0,void 0,function*(){L.texture&&this.map.painter.saveTileTexture(L.texture)})}hasTransition(){return!1}}class Ct extends wt{constructor(L,at,xt,kt){super(L,at,xt,kt),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},at),this.encoding=at.encoding||"mapbox",this.redFactor=at.redFactor,this.greenFactor=at.greenFactor,this.blueFactor=at.blueFactor,this.baseShift=at.baseShift}loadTile(L){return e._(this,void 0,void 0,function*(){let at=L.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xt=this.map._requestManager.transformRequest(at,"Tile");L.neighboringTiles=this._getNeighboringTiles(L.tileID),L.abortController=new AbortController;try{let kt=yield l.getImage(xt,L.abortController,this.map._refreshExpiredTiles);if(delete L.abortController,L.aborted)return void(L.state="unloaded");if(kt&&kt.data){let Lt=kt.data;this.map._refreshExpiredTiles&&kt.cacheControl&&kt.expires&&L.setExpiryData({cacheControl:kt.cacheControl,expires:kt.expires});let le=e.b(Lt)&&e.U()?Lt:yield this.readImageNow(Lt),xe={type:this.type,uid:L.uid,source:this.id,rawImageData:le,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!L.actor||L.state==="expired"){L.actor=this.dispatcher.getActor();let Pe=yield L.actor.sendAsync({type:"LDT",data:xe});L.dem=Pe,L.needsHillshadePrepare=!0,L.needsTerrainPrepare=!0,L.state="loaded"}}}catch(kt){if(delete L.abortController,L.aborted)L.state="unloaded";else if(kt)throw L.state="errored",kt}})}readImageNow(L){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){let at=L.width+2,xt=L.height+2;try{return new e.R({width:at,height:xt},yield e.W(L,-1,-1,at,xt))}catch{}}return o.getImageData(L,1)})}_getNeighboringTiles(L){let at=L.canonical,xt=Math.pow(2,at.z),kt=(at.x-1+xt)%xt,Lt=at.x===0?L.wrap-1:L.wrap,le=(at.x+1+xt)%xt,xe=at.x+1===xt?L.wrap+1:L.wrap,Pe={};return Pe[new e.S(L.overscaledZ,Lt,at.z,kt,at.y).key]={backfilled:!1},Pe[new e.S(L.overscaledZ,xe,at.z,le,at.y).key]={backfilled:!1},at.y>0&&(Pe[new e.S(L.overscaledZ,Lt,at.z,kt,at.y-1).key]={backfilled:!1},Pe[new e.S(L.overscaledZ,L.wrap,at.z,at.x,at.y-1).key]={backfilled:!1},Pe[new e.S(L.overscaledZ,xe,at.z,le,at.y-1).key]={backfilled:!1}),at.y+10&&e.e(Lt,{resourceTiming:kt}),this.fire(new e.k("data",Object.assign(Object.assign({},Lt),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},Lt),{sourceDataType:"content"})))}catch(xt){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(xt))}})}loaded(){return this._pendingLoads===0}loadTile(L){return e._(this,void 0,void 0,function*(){let at=L.actor?"RT":"LT";L.actor=this.actor;let xt={type:this.type,uid:L.uid,tileID:L.tileID,zoom:L.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};L.abortController=new AbortController;let kt=yield this.actor.sendAsync({type:at,data:xt},L.abortController);delete L.abortController,L.unloadVectorData(),L.aborted||L.loadVectorData(kt,this.map.painter,at==="RT")})}abortTile(L){return e._(this,void 0,void 0,function*(){L.abortController&&(L.abortController.abort(),delete L.abortController),L.aborted=!0})}unloadTile(L){return e._(this,void 0,void 0,function*(){L.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:L.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Nt=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class te extends e.E{constructor(L,at,xt,kt){super(),this.id=L,this.dispatcher=xt,this.coordinates=at.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(kt),this.options=at}load(L){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let at=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,at&&at.data&&(this.image=at.data,L&&(this.coordinates=L),this._finishLoading())}catch(at){this._request=null,this._loaded=!0,this.fire(new e.j(at))}})}loaded(){return this._loaded}updateImage(L){return L.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=L.url,this.load(L.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(L){this.map=L,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(L){this.coordinates=L;let at=L.map(e.Z.fromLngLat);this.tileID=(function(kt){let Lt=1/0,le=1/0,xe=-1/0,Pe=-1/0;for(let Br of kt)Lt=Math.min(Lt,Br.x),le=Math.min(le,Br.y),xe=Math.max(xe,Br.x),Pe=Math.max(Pe,Br.y);let $e=Math.max(xe-Lt,Pe-le),hr=Math.max(0,Math.floor(-Math.log($e)/Math.LN2)),pr=Math.pow(2,hr);return new e.a1(hr,Math.floor((Lt+xe)/2*pr),Math.floor((le+Pe)/2*pr))})(at),this.minzoom=this.maxzoom=this.tileID.z;let xt=at.map(kt=>this.tileID.getTilePoint(kt)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(xt[0].x,xt[0].y,0,0),this._boundsArray.emplaceBack(xt[1].x,xt[1].y,e.X,0),this._boundsArray.emplaceBack(xt[3].x,xt[3].y,0,e.X),this._boundsArray.emplaceBack(xt[2].x,xt[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let L=this.map.painter.context,at=L.gl;this.boundsBuffer||(this.boundsBuffer=L.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new h(L,this.image,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let xt=!1;for(let kt in this.tiles){let Lt=this.tiles[kt];Lt.state!=="loaded"&&(Lt.state="loaded",Lt.texture=this.texture,xt=!0)}xt&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(L){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(L.tileID.canonical)?(this.tiles[String(L.tileID.wrap)]=L,L.buckets={}):L.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Jt extends te{constructor(L,at,xt,kt){super(L,at,xt,kt),this.roundZoom=!0,this.type="video",this.options=at}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;let L=this.options;this.urls=[];for(let at of L.urls)this.urls.push(this.map._requestManager.transformRequest(at,"Source").url);try{let at=yield e.a3(this.urls);if(this._loaded=!0,!at)return;this.video=at,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(at){this.fire(new e.j(at))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(L){if(this.video){let at=this.video.seekable;Lat.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${at.start(0)} and ${at.end(0)}-second mark.`))):this.video.currentTime=L}}getVideo(){return this.video}onAdd(L){this.map||(this.map=L,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let L=this.map.painter.context,at=L.gl;this.boundsBuffer||(this.boundsBuffer=L.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE),at.texSubImage2D(at.TEXTURE_2D,0,0,0,at.RGBA,at.UNSIGNED_BYTE,this.video)):(this.texture=new h(L,this.video,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let xt=!1;for(let kt in this.tiles){let Lt=this.tiles[kt];Lt.state!=="loaded"&&(Lt.state="loaded",Lt.texture=this.texture,xt=!0)}xt&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class ee extends te{constructor(L,at,xt,kt){super(L,at,xt,kt),at.coordinates?Array.isArray(at.coordinates)&&at.coordinates.length===4&&!at.coordinates.some(Lt=>!Array.isArray(Lt)||Lt.length!==2||Lt.some(le=>typeof le!="number"))||this.fire(new e.j(new e.a2(`sources.${L}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${L}`,null,'missing required property "coordinates"'))),at.animate&&typeof at.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${L}`,null,'optional "animate" property must be a boolean value'))),at.canvas?typeof at.canvas=="string"||at.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${L}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${L}`,null,'missing required property "canvas"'))),this.options=at,this.animate=at.animate===void 0||at.animate}load(){return e._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(L){this.map=L,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let L=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,L=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,L=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let at=this.map.painter.context,xt=at.gl;this.boundsBuffer||(this.boundsBuffer=at.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(L||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new h(at,this.canvas,xt.RGBA,{premultiply:!0});let kt=!1;for(let Lt in this.tiles){let le=this.tiles[Lt];le.state!=="loaded"&&(le.state="loaded",le.texture=this.texture,kt=!0)}kt&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let L of[this.canvas.width,this.canvas.height])if(isNaN(L)||L<=0)return!0;return!1}}let Zt={},mt=Pt=>{switch(Pt){case"geojson":return It;case"image":return te;case"raster":return wt;case"raster-dem":return Ct;case"vector":return Tt;case"video":return Jt;case"canvas":return ee}return Zt[Pt]},bt="RTLPluginLoaded";class vt extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Q()}_syncState(L){return this.status=L,this.dispatcher.broadcast("SRPS",{pluginStatus:L,pluginURL:this.url}).catch(at=>{throw this.status="error",at})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(L){return e._(this,arguments,void 0,function*(at,xt=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=o.resolveURL(at),!this.url)throw new Error(`requested url ${at} is invalid`);if(this.status==="unavailable"){if(!xt)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(bt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ut=null;function re(){return Ut||(Ut=new vt),Ut}class Kt{constructor(L,at){this.timeAdded=0,this.fadeEndTime=0,this.tileID=L,this.uid=e.a4(),this.uses=0,this.tileSize=at,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(L){let at=L+this.timeAdded;atLt.getLayer($e)).filter(Boolean);if(Pe.length!==0){xe.layers=Pe,xe.stateDependentLayerIds&&(xe.stateDependentLayers=xe.stateDependentLayerIds.map($e=>Pe.filter(hr=>hr.id===$e)[0]));for(let $e of Pe)le[$e.id]=xe}}return le})(L.buckets,at.style),this.hasSymbolBuckets=!1;for(let kt in this.buckets){let Lt=this.buckets[kt];if(Lt instanceof e.a6){if(this.hasSymbolBuckets=!0,!xt)break;Lt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let kt in this.buckets){let Lt=this.buckets[kt];if(Lt instanceof e.a6&&Lt.hasRTLText){this.hasRTLText=!0,re().lazyLoad();break}}this.queryPadding=0;for(let kt in this.buckets){let Lt=this.buckets[kt];this.queryPadding=Math.max(this.queryPadding,at.style.getLayer(kt).queryRadius(Lt))}L.imageAtlas&&(this.imageAtlas=L.imageAtlas),L.glyphAtlasImage&&(this.glyphAtlasImage=L.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let L in this.buckets)this.buckets[L].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(L){return this.buckets[L.id]}upload(L){for(let xt in this.buckets){let kt=this.buckets[xt];kt.uploadPending()&&kt.upload(L)}let at=L.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new h(L,this.imageAtlas.image,at.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new h(L,this.glyphAtlasImage,at.ALPHA),this.glyphAtlasImage=null)}prepare(L){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(L,this.imageAtlasTexture)}queryRenderedFeatures(L,at,xt,kt,Lt,le,xe,Pe,$e,hr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:kt,cameraQueryGeometry:Lt,scale:le,tileSize:this.tileSize,pixelPosMatrix:hr,transform:Pe,params:xe,queryPadding:this.queryPadding*$e},L,at,xt):{}}querySourceFeatures(L,at){let xt=this.latestFeatureIndex;if(!xt||!xt.rawTileData)return;let kt=xt.loadVTLayers(),Lt=at&&at.sourceLayer?at.sourceLayer:"",le=kt._geojsonTileLayer||kt[Lt];if(!le)return;let xe=e.a7(at&&at.filter),{z:Pe,x:$e,y:hr}=this.tileID.canonical,pr={z:Pe,x:$e,y:hr};for(let Br=0;Brxt)kt=!1;else if(at)if(this.expirationTime{this.remove(L,Lt)},xt)),this.data[kt].push(Lt),this.order.push(kt),this.order.length>this.max){let le=this._getAndRemoveByKey(this.order[0]);le&&this.onRemove(le)}return this}has(L){return L.wrapped().key in this.data}getAndRemove(L){return this.has(L)?this._getAndRemoveByKey(L.wrapped().key):null}_getAndRemoveByKey(L){let at=this.data[L].shift();return at.timeout&&clearTimeout(at.timeout),this.data[L].length===0&&delete this.data[L],this.order.splice(this.order.indexOf(L),1),at.value}getByKey(L){let at=this.data[L];return at?at[0].value:null}get(L){return this.has(L)?this.data[L.wrapped().key][0].value:null}remove(L,at){if(!this.has(L))return this;let xt=L.wrapped().key,kt=at===void 0?0:this.data[xt].indexOf(at),Lt=this.data[xt][kt];return this.data[xt].splice(kt,1),Lt.timeout&&clearTimeout(Lt.timeout),this.data[xt].length===0&&delete this.data[xt],this.onRemove(Lt.value),this.order.splice(this.order.indexOf(xt),1),this}setMaxSize(L){for(this.max=L;this.order.length>this.max;){let at=this._getAndRemoveByKey(this.order[0]);at&&this.onRemove(at)}return this}filter(L){let at=[];for(let xt in this.data)for(let kt of this.data[xt])L(kt.value)||at.push(kt);for(let xt of at)this.remove(xt.value.tileID,xt)}}class Me{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(L,at,xt){let kt=String(at);if(this.stateChanges[L]=this.stateChanges[L]||{},this.stateChanges[L][kt]=this.stateChanges[L][kt]||{},e.e(this.stateChanges[L][kt],xt),this.deletedStates[L]===null){this.deletedStates[L]={};for(let Lt in this.state[L])Lt!==kt&&(this.deletedStates[L][Lt]=null)}else if(this.deletedStates[L]&&this.deletedStates[L][kt]===null){this.deletedStates[L][kt]={};for(let Lt in this.state[L][kt])xt[Lt]||(this.deletedStates[L][kt][Lt]=null)}else for(let Lt in xt)this.deletedStates[L]&&this.deletedStates[L][kt]&&this.deletedStates[L][kt][Lt]===null&&delete this.deletedStates[L][kt][Lt]}removeFeatureState(L,at,xt){if(this.deletedStates[L]===null)return;let kt=String(at);if(this.deletedStates[L]=this.deletedStates[L]||{},xt&&at!==void 0)this.deletedStates[L][kt]!==null&&(this.deletedStates[L][kt]=this.deletedStates[L][kt]||{},this.deletedStates[L][kt][xt]=null);else if(at!==void 0)if(this.stateChanges[L]&&this.stateChanges[L][kt])for(xt in this.deletedStates[L][kt]={},this.stateChanges[L][kt])this.deletedStates[L][kt][xt]=null;else this.deletedStates[L][kt]=null;else this.deletedStates[L]=null}getState(L,at){let xt=String(at),kt=e.e({},(this.state[L]||{})[xt],(this.stateChanges[L]||{})[xt]);if(this.deletedStates[L]===null)return{};if(this.deletedStates[L]){let Lt=this.deletedStates[L][at];if(Lt===null)return{};for(let le in Lt)delete kt[le]}return kt}initializeTileState(L,at){L.setFeatureState(this.state,at)}coalesceChanges(L,at){let xt={};for(let kt in this.stateChanges){this.state[kt]=this.state[kt]||{};let Lt={};for(let le in this.stateChanges[kt])this.state[kt][le]||(this.state[kt][le]={}),e.e(this.state[kt][le],this.stateChanges[kt][le]),Lt[le]=this.state[kt][le];xt[kt]=Lt}for(let kt in this.deletedStates){this.state[kt]=this.state[kt]||{};let Lt={};if(this.deletedStates[kt]===null)for(let le in this.state[kt])Lt[le]={},this.state[kt][le]={};else for(let le in this.deletedStates[kt]){if(this.deletedStates[kt][le]===null)this.state[kt][le]={};else for(let xe of Object.keys(this.deletedStates[kt][le]))delete this.state[kt][le][xe];Lt[le]=this.state[kt][le]}xt[kt]=xt[kt]||{},e.e(xt[kt],Lt)}if(this.stateChanges={},this.deletedStates={},Object.keys(xt).length!==0)for(let kt in L)L[kt].setFeatureState(xt,at)}}class Ce extends e.E{constructor(L,at,xt){super(),this.id=L,this.dispatcher=xt,this.on("data",kt=>this._dataHandler(kt)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((kt,Lt,le,xe)=>{let Pe=new(mt(Lt.type))(kt,Lt,le,xe);if(Pe.id!==kt)throw new Error(`Expected Source id to be ${kt} instead of ${Pe.id}`);return Pe})(L,at,xt,this),this._tiles={},this._cache=new ue(0,kt=>this._unloadTile(kt)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Me,this._didEmitContent=!1,this._updated=!1}onAdd(L){this.map=L,this._maxTileCacheSize=L?L._maxTileCacheSize:null,this._maxTileCacheZoomLevels=L?L._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(L)}onRemove(L){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(L)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let L in this._tiles){let at=this._tiles[L];if(at.state!=="loaded"&&at.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let L=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,L&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(L,at,xt){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(L),this._tileLoaded(L,at,xt)}catch(kt){L.state="errored",kt.status!==404?this._source.fire(new e.j(kt,{tile:L})):this.update(this.transform,this.terrain)}})}_unloadTile(L){this._source.unloadTile&&this._source.unloadTile(L)}_abortTile(L){this._source.abortTile&&this._source.abortTile(L),this._source.fire(new e.k("dataabort",{tile:L,coord:L.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(L){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let at in this._tiles){let xt=this._tiles[at];xt.upload(L),xt.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(L=>L.tileID).sort(We).map(L=>L.key)}getRenderableIds(L){let at=[];for(let xt in this._tiles)this._isIdRenderable(xt,L)&&at.push(this._tiles[xt]);return L?at.sort((xt,kt)=>{let Lt=xt.tileID,le=kt.tileID,xe=new e.P(Lt.canonical.x,Lt.canonical.y)._rotate(this.transform.angle),Pe=new e.P(le.canonical.x,le.canonical.y)._rotate(this.transform.angle);return Lt.overscaledZ-le.overscaledZ||Pe.y-xe.y||Pe.x-xe.x}).map(xt=>xt.tileID.key):at.map(xt=>xt.tileID).sort(We).map(xt=>xt.key)}hasRenderableParent(L){let at=this.findLoadedParent(L,0);return!!at&&this._isIdRenderable(at.tileID.key)}_isIdRenderable(L,at){return this._tiles[L]&&this._tiles[L].hasData()&&!this._coveredTiles[L]&&(at||!this._tiles[L].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let L in this._tiles)this._tiles[L].state!=="errored"&&this._reloadTile(L,"reloading")}}_reloadTile(L,at){return e._(this,void 0,void 0,function*(){let xt=this._tiles[L];xt&&(xt.state!=="loading"&&(xt.state=at),yield this._loadTile(xt,L,at))})}_tileLoaded(L,at,xt){L.timeAdded=o.now(),xt==="expired"&&(L.refreshedUponExpiration=!0),this._setTileReloadTimer(at,L),this.getSource().type==="raster-dem"&&L.dem&&this._backfillDEM(L),this._state.initializeTileState(L,this.map?this.map.painter:null),L.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:L,coord:L.tileID}))}_backfillDEM(L){let at=this.getRenderableIds();for(let kt=0;kt1||(Math.abs(le)>1&&(Math.abs(le+Pe)===1?le+=Pe:Math.abs(le-Pe)===1&&(le-=Pe)),Lt.dem&&kt.dem&&(kt.dem.backfillBorder(Lt.dem,le,xe),kt.neighboringTiles&&kt.neighboringTiles[$e]&&(kt.neighboringTiles[$e].backfilled=!0)))}}getTile(L){return this.getTileByID(L.key)}getTileByID(L){return this._tiles[L]}_retainLoadedChildren(L,at,xt,kt){for(let Lt in this._tiles){let le=this._tiles[Lt];if(kt[Lt]||!le.hasData()||le.tileID.overscaledZ<=at||le.tileID.overscaledZ>xt)continue;let xe=le.tileID;for(;le&&le.tileID.overscaledZ>at+1;){let $e=le.tileID.scaledTo(le.tileID.overscaledZ-1);le=this._tiles[$e.key],le&&le.hasData()&&(xe=$e)}let Pe=xe;for(;Pe.overscaledZ>at;)if(Pe=Pe.scaledTo(Pe.overscaledZ-1),L[Pe.key]){kt[xe.key]=xe;break}}}findLoadedParent(L,at){if(L.key in this._loadedParentTiles){let xt=this._loadedParentTiles[L.key];return xt&&xt.tileID.overscaledZ>=at?xt:null}for(let xt=L.overscaledZ-1;xt>=at;xt--){let kt=L.scaledTo(xt),Lt=this._getLoadedTile(kt);if(Lt)return Lt}}findLoadedSibling(L){return this._getLoadedTile(L)}_getLoadedTile(L){let at=this._tiles[L.key];return at&&at.hasData()?at:this._cache.getByKey(L.wrapped().key)}updateCacheSize(L){let at=Math.ceil(L.width/this._source.tileSize)+1,xt=Math.ceil(L.height/this._source.tileSize)+1,kt=Math.floor(at*xt*(this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Lt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,kt):kt;this._cache.setMaxSize(Lt)}handleWrapJump(L){let at=Math.round((L-(this._prevLng===void 0?L:this._prevLng))/360);if(this._prevLng=L,at){let xt={};for(let kt in this._tiles){let Lt=this._tiles[kt];Lt.tileID=Lt.tileID.unwrapTo(Lt.tileID.wrap+at),xt[Lt.tileID.key]=Lt}this._tiles=xt;for(let kt in this._timers)clearTimeout(this._timers[kt]),delete this._timers[kt];for(let kt in this._tiles)this._setTileReloadTimer(kt,this._tiles[kt])}}_updateCoveredAndRetainedTiles(L,at,xt,kt,Lt,le){let xe={},Pe={},$e=Object.keys(L),hr=o.now();for(let pr of $e){let Br=L[pr],Jr=this._tiles[pr];if(!Jr||Jr.fadeEndTime!==0&&Jr.fadeEndTime<=hr)continue;let Rt=this.findLoadedParent(Br,at),Gt=this.findLoadedSibling(Br),ae=Rt||Gt||null;ae&&(this._addTile(ae.tileID),xe[ae.tileID.key]=ae.tileID),Pe[pr]=Br}this._retainLoadedChildren(Pe,kt,xt,L);for(let pr in xe)L[pr]||(this._coveredTiles[pr]=!0,L[pr]=xe[pr]);if(le){let pr={},Br={};for(let Jr of Lt)this._tiles[Jr.key].hasData()?pr[Jr.key]=Jr:Br[Jr.key]=Jr;for(let Jr in Br){let Rt=Br[Jr].children(this._source.maxzoom);this._tiles[Rt[0].key]&&this._tiles[Rt[1].key]&&this._tiles[Rt[2].key]&&this._tiles[Rt[3].key]&&(pr[Rt[0].key]=L[Rt[0].key]=Rt[0],pr[Rt[1].key]=L[Rt[1].key]=Rt[1],pr[Rt[2].key]=L[Rt[2].key]=Rt[2],pr[Rt[3].key]=L[Rt[3].key]=Rt[3],delete Br[Jr])}for(let Jr in Br){let Rt=Br[Jr],Gt=this.findLoadedParent(Rt,this._source.minzoom),ae=this.findLoadedSibling(Rt),ce=Gt||ae||null;if(ce){pr[ce.tileID.key]=L[ce.tileID.key]=ce.tileID;for(let Te in pr)pr[Te].isChildOf(ce.tileID)&&delete pr[Te]}}for(let Jr in this._tiles)pr[Jr]||(this._coveredTiles[Jr]=!0)}}update(L,at){if(!this._sourceLoaded||this._paused)return;let xt;this.transform=L,this.terrain=at,this.updateCacheSize(L),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?xt=L.getVisibleUnwrappedCoordinates(this._source.tileID).map(hr=>new e.S(hr.canonical.z,hr.wrap,hr.canonical.z,hr.canonical.x,hr.canonical.y)):(xt=L.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:at}),this._source.hasTile&&(xt=xt.filter(hr=>this._source.hasTile(hr)))):xt=[];let kt=L.coveringZoomLevel(this._source),Lt=Math.max(kt-Ce.maxOverzooming,this._source.minzoom),le=Math.max(kt+Ce.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let hr={};for(let pr of xt)if(pr.canonical.z>this._source.minzoom){let Br=pr.scaledTo(pr.canonical.z-1);hr[Br.key]=Br;let Jr=pr.scaledTo(Math.max(this._source.minzoom,Math.min(pr.canonical.z,5)));hr[Jr.key]=Jr}xt=xt.concat(Object.values(hr))}let xe=xt.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,xe&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Pe=this._updateRetainedTiles(xt,kt);qe(this._source.type)&&this._updateCoveredAndRetainedTiles(Pe,Lt,le,kt,xt,at);for(let hr in Pe)this._tiles[hr].clearFadeHold();let $e=e.ab(this._tiles,Pe);for(let hr of $e){let pr=this._tiles[hr];pr.hasSymbolBuckets&&!pr.holdingForFade()?pr.setHoldDuration(this.map._fadeDuration):pr.hasSymbolBuckets&&!pr.symbolFadeFinished()||this._removeTile(hr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let L in this._tiles)this._tiles[L].holdingForFade()&&this._removeTile(L)}_updateRetainedTiles(L,at){var xt;let kt={},Lt={},le=Math.max(at-Ce.maxOverzooming,this._source.minzoom),xe=Math.max(at+Ce.maxUnderzooming,this._source.minzoom),Pe={};for(let $e of L){let hr=this._addTile($e);kt[$e.key]=$e,hr.hasData()||atthis._source.maxzoom){let Br=$e.children(this._source.maxzoom)[0],Jr=this.getTile(Br);if(Jr&&Jr.hasData()){kt[Br.key]=Br;continue}}else{let Br=$e.children(this._source.maxzoom);if(kt[Br[0].key]&&kt[Br[1].key]&&kt[Br[2].key]&&kt[Br[3].key])continue}let pr=hr.wasRequested();for(let Br=$e.overscaledZ-1;Br>=le;--Br){let Jr=$e.scaledTo(Br);if(Lt[Jr.key])break;if(Lt[Jr.key]=!0,hr=this.getTile(Jr),!hr&&pr&&(hr=this._addTile(Jr)),hr){let Rt=hr.hasData();if((Rt||!(!((xt=this.map)===null||xt===void 0)&&xt.cancelPendingTileRequestsWhileZooming)||pr)&&(kt[Jr.key]=Jr),pr=hr.wasRequested(),Rt)break}}}return kt}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let L in this._tiles){let at=[],xt,kt=this._tiles[L].tileID;for(;kt.overscaledZ>0;){if(kt.key in this._loadedParentTiles){xt=this._loadedParentTiles[kt.key];break}at.push(kt.key);let Lt=kt.scaledTo(kt.overscaledZ-1);if(xt=this._getLoadedTile(Lt),xt)break;kt=Lt}for(let Lt of at)this._loadedParentTiles[Lt]=xt}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let L in this._tiles){let at=this._tiles[L].tileID,xt=this._getLoadedTile(at);this._loadedSiblingTiles[at.key]=xt}}_addTile(L){let at=this._tiles[L.key];if(at)return at;at=this._cache.getAndRemove(L),at&&(this._setTileReloadTimer(L.key,at),at.tileID=L,this._state.initializeTileState(at,this.map?this.map.painter:null),this._cacheTimers[L.key]&&(clearTimeout(this._cacheTimers[L.key]),delete this._cacheTimers[L.key],this._setTileReloadTimer(L.key,at)));let xt=at;return at||(at=new Kt(L,this._source.tileSize*L.overscaleFactor()),this._loadTile(at,L.key,at.state)),at.uses++,this._tiles[L.key]=at,xt||this._source.fire(new e.k("dataloading",{tile:at,coord:at.tileID,dataType:"source"})),at}_setTileReloadTimer(L,at){L in this._timers&&(clearTimeout(this._timers[L]),delete this._timers[L]);let xt=at.getExpiryTimeout();xt&&(this._timers[L]=setTimeout(()=>{this._reloadTile(L,"expired"),delete this._timers[L]},xt))}_removeTile(L){let at=this._tiles[L];at&&(at.uses--,delete this._tiles[L],this._timers[L]&&(clearTimeout(this._timers[L]),delete this._timers[L]),at.uses>0||(at.hasData()&&at.state!=="reloading"?this._cache.add(at.tileID,at,at.getExpiryTimeout()):(at.aborted=!0,this._abortTile(at),this._unloadTile(at))))}_dataHandler(L){let at=L.sourceDataType;L.dataType==="source"&&at==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&L.dataType==="source"&&at==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let L in this._tiles)this._removeTile(L);this._cache.reset()}tilesIn(L,at,xt){let kt=[],Lt=this.transform;if(!Lt)return kt;let le=xt?Lt.getCameraQueryGeometry(L):L,xe=L.map(Rt=>Lt.pointCoordinate(Rt,this.terrain)),Pe=le.map(Rt=>Lt.pointCoordinate(Rt,this.terrain)),$e=this.getIds(),hr=1/0,pr=1/0,Br=-1/0,Jr=-1/0;for(let Rt of Pe)hr=Math.min(hr,Rt.x),pr=Math.min(pr,Rt.y),Br=Math.max(Br,Rt.x),Jr=Math.max(Jr,Rt.y);for(let Rt=0;Rt<$e.length;Rt++){let Gt=this._tiles[$e[Rt]];if(Gt.holdingForFade())continue;let ae=Gt.tileID,ce=Math.pow(2,Lt.zoom-Gt.tileID.overscaledZ),Te=at*Gt.queryPadding*e.X/Gt.tileSize/ce,ye=[ae.getTilePoint(new e.Z(hr,pr)),ae.getTilePoint(new e.Z(Br,Jr))];if(ye[0].x-Te=0&&ye[1].y+Te>=0){let ze=xe.map(fr=>ae.getTilePoint(fr)),rr=Pe.map(fr=>ae.getTilePoint(fr));kt.push({tile:Gt,tileID:ae,queryGeometry:ze,cameraQueryGeometry:rr,scale:ce})}}return kt}getVisibleCoordinates(L){let at=this.getRenderableIds(L).map(xt=>this._tiles[xt].tileID);for(let xt of at)xt.posMatrix=this.transform.calculatePosMatrix(xt.toUnwrapped());return at}hasTransition(){if(this._source.hasTransition())return!0;if(qe(this._source.type)){let L=o.now();for(let at in this._tiles)if(this._tiles[at].fadeEndTime>=L)return!0}return!1}setFeatureState(L,at,xt){this._state.updateState(L=L||"_geojsonTileLayer",at,xt)}removeFeatureState(L,at,xt){this._state.removeFeatureState(L=L||"_geojsonTileLayer",at,xt)}getFeatureState(L,at){return this._state.getState(L=L||"_geojsonTileLayer",at)}setDependencies(L,at,xt){let kt=this._tiles[L];kt&&kt.setDependencies(at,xt)}reloadTilesForDependencies(L,at){for(let xt in this._tiles)this._tiles[xt].hasDependency(L,at)&&this._reloadTile(xt,"reloading");this._cache.filter(xt=>!xt.hasDependency(L,at))}}function We(Pt,L){let at=Math.abs(2*Pt.wrap)-+(Pt.wrap<0),xt=Math.abs(2*L.wrap)-+(L.wrap<0);return Pt.overscaledZ-L.overscaledZ||xt-at||L.canonical.y-Pt.canonical.y||L.canonical.x-Pt.canonical.x}function qe(Pt){return Pt==="raster"||Pt==="image"||Pt==="video"}Ce.maxOverzooming=10,Ce.maxUnderzooming=3;class vr{constructor(L,at){this.reset(L,at)}reset(L,at){this.points=L||[],this._distances=[0];for(let xt=1;xt0?(kt-le)/xe:0;return this.points[Lt].mult(1-Pe).add(this.points[at].mult(Pe))}}function _r(Pt,L){let at=!0;return Pt==="always"||Pt!=="never"&&L!=="never"||(at=!1),at}class er{constructor(L,at,xt){let kt=this.boxCells=[],Lt=this.circleCells=[];this.xCellCount=Math.ceil(L/xt),this.yCellCount=Math.ceil(at/xt);for(let le=0;lethis.width||kt<0||at>this.height)return[];let Pe=[];if(L<=0&&at<=0&&this.width<=xt&&this.height<=kt){if(Lt)return[{key:null,x1:L,y1:at,x2:xt,y2:kt}];for(let $e=0;$e0}hitTestCircle(L,at,xt,kt,Lt){let le=L-xt,xe=L+xt,Pe=at-xt,$e=at+xt;if(xe<0||le>this.width||$e<0||Pe>this.height)return!1;let hr=[];return this._forEachCell(le,Pe,xe,$e,this._queryCellCircle,hr,{hitTest:!0,overlapMode:kt,circle:{x:L,y:at,radius:xt},seenUids:{box:{},circle:{}}},Lt),hr.length>0}_queryCell(L,at,xt,kt,Lt,le,xe,Pe){let{seenUids:$e,hitTest:hr,overlapMode:pr}=xe,Br=this.boxCells[Lt];if(Br!==null){let Rt=this.bboxes;for(let Gt of Br)if(!$e.box[Gt]){$e.box[Gt]=!0;let ae=4*Gt,ce=this.boxKeys[Gt];if(L<=Rt[ae+2]&&at<=Rt[ae+3]&&xt>=Rt[ae+0]&&kt>=Rt[ae+1]&&(!Pe||Pe(ce))&&(!hr||!_r(pr,ce.overlapMode))&&(le.push({key:ce,x1:Rt[ae],y1:Rt[ae+1],x2:Rt[ae+2],y2:Rt[ae+3]}),hr))return!0}}let Jr=this.circleCells[Lt];if(Jr!==null){let Rt=this.circles;for(let Gt of Jr)if(!$e.circle[Gt]){$e.circle[Gt]=!0;let ae=3*Gt,ce=this.circleKeys[Gt];if(this._circleAndRectCollide(Rt[ae],Rt[ae+1],Rt[ae+2],L,at,xt,kt)&&(!Pe||Pe(ce))&&(!hr||!_r(pr,ce.overlapMode))){let Te=Rt[ae],ye=Rt[ae+1],ze=Rt[ae+2];if(le.push({key:ce,x1:Te-ze,y1:ye-ze,x2:Te+ze,y2:ye+ze}),hr)return!0}}}return!1}_queryCellCircle(L,at,xt,kt,Lt,le,xe,Pe){let{circle:$e,seenUids:hr,overlapMode:pr}=xe,Br=this.boxCells[Lt];if(Br!==null){let Rt=this.bboxes;for(let Gt of Br)if(!hr.box[Gt]){hr.box[Gt]=!0;let ae=4*Gt,ce=this.boxKeys[Gt];if(this._circleAndRectCollide($e.x,$e.y,$e.radius,Rt[ae+0],Rt[ae+1],Rt[ae+2],Rt[ae+3])&&(!Pe||Pe(ce))&&!_r(pr,ce.overlapMode))return le.push(!0),!0}}let Jr=this.circleCells[Lt];if(Jr!==null){let Rt=this.circles;for(let Gt of Jr)if(!hr.circle[Gt]){hr.circle[Gt]=!0;let ae=3*Gt,ce=this.circleKeys[Gt];if(this._circlesCollide(Rt[ae],Rt[ae+1],Rt[ae+2],$e.x,$e.y,$e.radius)&&(!Pe||Pe(ce))&&!_r(pr,ce.overlapMode))return le.push(!0),!0}}}_forEachCell(L,at,xt,kt,Lt,le,xe,Pe){let $e=this._convertToXCellCoord(L),hr=this._convertToYCellCoord(at),pr=this._convertToXCellCoord(xt),Br=this._convertToYCellCoord(kt);for(let Jr=$e;Jr<=pr;Jr++)for(let Rt=hr;Rt<=Br;Rt++)if(Lt.call(this,L,at,xt,kt,this.xCellCount*Rt+Jr,le,xe,Pe))return}_convertToXCellCoord(L){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(L*this.xScale)))}_convertToYCellCoord(L){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(L*this.yScale)))}_circlesCollide(L,at,xt,kt,Lt,le){let xe=kt-L,Pe=Lt-at,$e=xt+le;return $e*$e>xe*xe+Pe*Pe}_circleAndRectCollide(L,at,xt,kt,Lt,le,xe){let Pe=(le-kt)/2,$e=Math.abs(L-(kt+Pe));if($e>Pe+xt)return!1;let hr=(xe-Lt)/2,pr=Math.abs(at-(Lt+hr));if(pr>hr+xt)return!1;if($e<=Pe||pr<=hr)return!0;let Br=$e-Pe,Jr=pr-hr;return Br*Br+Jr*Jr<=xt*xt}}function Mr(Pt,L,at,xt,kt){let Lt=e.H();return L?(e.K(Lt,Lt,[1/kt,1/kt,1]),at||e.ad(Lt,Lt,xt.angle)):e.L(Lt,xt.labelPlaneMatrix,Pt),Lt}function Ir(Pt,L,at,xt,kt){if(L){let Lt=e.ae(Pt);return e.K(Lt,Lt,[kt,kt,1]),at||e.ad(Lt,Lt,-xt.angle),Lt}return xt.glCoordMatrix}function de(Pt,L,at,xt){let kt;xt?(kt=[Pt,L,xt(Pt,L),1],e.af(kt,kt,at)):(kt=[Pt,L,0,1],Ye(kt,kt,at));let Lt=kt[3];return{point:new e.P(kt[0]/Lt,kt[1]/Lt),signedDistanceFromCamera:Lt,isOccluded:!1}}function Dt(Pt,L){return .5+Pt/L*.5}function qt(Pt,L){return Pt.x>=-L[0]&&Pt.x<=L[0]&&Pt.y>=-L[1]&&Pt.y<=L[1]}function _t(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt){let Gt=xt?Pt.textSizeData:Pt.iconSizeData,ae=e.ag(Gt,at.transform.zoom),ce=[256/at.width*2+1,256/at.height*2+1],Te=xt?Pt.text.dynamicLayoutVertexArray:Pt.icon.dynamicLayoutVertexArray;Te.clear();let ye=Pt.lineVertexArray,ze=xt?Pt.text.placedSymbolArray:Pt.icon.placedSymbolArray,rr=at.transform.width/at.transform.height,fr=!1;for(let gr=0;grMath.abs(at.x-L.x)*xt?{useVertical:!0}:(Pt===e.ah.vertical?L.yat.x)?{needsFlipping:!0}:null}function St(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr){let pr=at/24,Br=L.lineOffsetX*pr,Jr=L.lineOffsetY*pr,Rt;if(L.numGlyphs>1){let Gt=L.glyphStartIndex+L.numGlyphs,ae=L.lineStartIndex,ce=L.lineStartIndex+L.lineLength,Te=lt(pr,xe,Br,Jr,xt,L,hr,Pt);if(!Te)return{notEnoughRoom:!0};let ye=de(Te.first.point.x,Te.first.point.y,le,Pt.getElevation).point,ze=de(Te.last.point.x,Te.last.point.y,le,Pt.getElevation).point;if(kt&&!xt){let rr=yt(L.writingMode,ye,ze,$e);if(rr)return rr}Rt=[Te.first];for(let rr=L.glyphStartIndex+1;rr0?ye.point:(function(fr,gr,Lr,Hr,nn,cn){return Ht(fr,gr,Lr,1,nn,cn)})(Pt.tileAnchorPoint,Te,ae,0,Lt,Pt),rr=yt(L.writingMode,ae,ze,$e);if(rr)return rr}let Gt=Ue(pr*xe.getoffsetX(L.glyphStartIndex),Br,Jr,xt,L.segment,L.lineStartIndex,L.lineStartIndex+L.lineLength,Pt,hr);if(!Gt||Pt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Rt=[Gt]}for(let Gt of Rt)e.aj(Pe,Gt.point,Gt.angle);return{}}function Ht(Pt,L,at,xt,kt,Lt){let le=Pt.add(Pt.sub(L)._unit()),xe=kt!==void 0?de(le.x,le.y,kt,Lt.getElevation).point:se(le.x,le.y,Lt).point,Pe=at.sub(xe);return at.add(Pe._mult(xt/Pe.mag()))}function Yt(Pt,L,at){let xt=L.projectionCache;if(xt.projections[Pt])return xt.projections[Pt];let kt=new e.P(L.lineVertexArray.getx(Pt),L.lineVertexArray.gety(Pt)),Lt=se(kt.x,kt.y,L);if(Lt.signedDistanceFromCamera>0)return xt.projections[Pt]=Lt.point,xt.anyProjectionOccluded=xt.anyProjectionOccluded||Lt.isOccluded,Lt.point;let le=Pt-at.direction;return(function(xe,Pe,$e,hr,pr){return Ht(xe,Pe,$e,hr,void 0,pr)})(at.distanceFromAnchor===0?L.tileAnchorPoint:new e.P(L.lineVertexArray.getx(le),L.lineVertexArray.gety(le)),kt,at.previousVertex,at.absOffsetX-at.distanceFromAnchor+1,L)}function se(Pt,L,at){let xt=Pt+at.translation[0],kt=L+at.translation[1],Lt;return!at.pitchWithMap&&at.projection.useSpecialProjectionForSymbols?(Lt=at.projection.projectTileCoordinates(xt,kt,at.unwrappedTileID,at.getElevation),Lt.point.x=(.5*Lt.point.x+.5)*at.width,Lt.point.y=(.5*-Lt.point.y+.5)*at.height):(Lt=de(xt,kt,at.labelPlaneMatrix,at.getElevation),Lt.isOccluded=!1),Lt}function ke(Pt,L,at){return Pt._unit()._perp()._mult(L*at)}function Ee(Pt,L,at,xt,kt,Lt,le,xe,Pe){if(xe.projectionCache.offsets[Pt])return xe.projectionCache.offsets[Pt];let $e=at.add(L);if(Pt+Pe.direction=kt)return xe.projectionCache.offsets[Pt]=$e,$e;let hr=Yt(Pt+Pe.direction,xe,Pe),pr=ke(hr.sub(at),le,Pe.direction),Br=at.add(pr),Jr=hr.add(pr);return xe.projectionCache.offsets[Pt]=e.ak(Lt,$e,Br,Jr)||$e,xe.projectionCache.offsets[Pt]}function Ue(Pt,L,at,xt,kt,Lt,le,xe,Pe){let $e=xt?Pt-L:Pt+L,hr=$e>0?1:-1,pr=0;xt&&(hr*=-1,pr=Math.PI),hr<0&&(pr+=Math.PI);let Br,Jr=hr>0?Lt+kt:Lt+kt+1;xe.projectionCache.cachedAnchorPoint?Br=xe.projectionCache.cachedAnchorPoint:(Br=se(xe.tileAnchorPoint.x,xe.tileAnchorPoint.y,xe).point,xe.projectionCache.cachedAnchorPoint=Br);let Rt,Gt,ae=Br,ce=Br,Te=0,ye=0,ze=Math.abs($e),rr=[],fr;for(;Te+ye<=ze;){if(Jr+=hr,Jr=le)return null;Te+=ye,ce=ae,Gt=Rt;let Hr={absOffsetX:ze,direction:hr,distanceFromAnchor:Te,previousVertex:ce};if(ae=Yt(Jr,xe,Hr),at===0)rr.push(ce),fr=ae.sub(ce);else{let nn,cn=ae.sub(ce);nn=cn.mag()===0?ke(Yt(Jr+hr,xe,Hr).sub(ae),at,hr):ke(cn,at,hr),Gt||(Gt=ce.add(nn)),Rt=Ee(Jr,nn,ae,Lt,le,Gt,at,xe,Hr),rr.push(Gt),fr=Rt.sub(Gt)}ye=fr.mag()}let gr=fr._mult((ze-Te)/ye)._add(Gt||ce),Lr=pr+Math.atan2(ae.y-ce.y,ae.x-ce.x);return rr.push(gr),{point:gr,angle:Pe?Lr:0,path:rr}}let ir=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ar(Pt,L){for(let at=0;at=1;mi--)La.push(_a.path[mi]);for(let mi=1;miYi.signedDistanceFromCamera<=0)?[]:mi.map(Yi=>Yi.point)}let Ai=[];if(La.length>0){let mi=La[0].clone(),Yi=La[0].clone();for(let Go=1;Go=cn.x&&Yi.x<=Mn.x&&mi.y>=cn.y&&Yi.y<=Mn.y?[La]:Yi.xMn.x||Yi.yMn.y?[]:e.al([La],cn.x,cn.y,Mn.x,Mn.y)}for(let mi of Ai){Jn.reset(mi,.25*nn);let Yi=0;Yi=Jn.length<=.5*nn?1:Math.ceil(Jn.paddedLength/ai)+1;for(let Go=0;Gode(kt.x,kt.y,xt,at.getElevation))}queryRenderedSymbols(L){if(L.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let at=[],xt=1/0,kt=1/0,Lt=-1/0,le=-1/0;for(let hr of L){let pr=new e.P(hr.x+Er,hr.y+Er);xt=Math.min(xt,pr.x),kt=Math.min(kt,pr.y),Lt=Math.max(Lt,pr.x),le=Math.max(le,pr.y),at.push(pr)}let xe=this.grid.query(xt,kt,Lt,le).concat(this.ignoredGrid.query(xt,kt,Lt,le)),Pe={},$e={};for(let hr of xe){let pr=hr.key;if(Pe[pr.bucketInstanceId]===void 0&&(Pe[pr.bucketInstanceId]={}),Pe[pr.bucketInstanceId][pr.featureIndex])continue;let Br=[new e.P(hr.x1,hr.y1),new e.P(hr.x2,hr.y1),new e.P(hr.x2,hr.y2),new e.P(hr.x1,hr.y2)];e.am(at,Br)&&(Pe[pr.bucketInstanceId][pr.featureIndex]=!0,$e[pr.bucketInstanceId]===void 0&&($e[pr.bucketInstanceId]=[]),$e[pr.bucketInstanceId].push(pr.featureIndex))}return $e}insertCollisionBox(L,at,xt,kt,Lt,le){(xt?this.ignoredGrid:this.grid).insert({bucketInstanceId:kt,featureIndex:Lt,collisionGroupID:le,overlapMode:at},L[0],L[1],L[2],L[3])}insertCollisionCircles(L,at,xt,kt,Lt,le){let xe=xt?this.ignoredGrid:this.grid,Pe={bucketInstanceId:kt,featureIndex:Lt,collisionGroupID:le,overlapMode:at};for(let $e=0;$e=this.screenRightBoundary||ktthis.screenBottomBoundary}isInsideGrid(L,at,xt,kt){return xt>=0&&L=0&&atthis.projectAndGetPerspectiveRatio(xt,nn.x,nn.y,kt,$e));Lr=Hr.some(nn=>!nn.isOccluded),gr=Hr.map(nn=>nn.point)}else Lr=!0;return{box:e.ao(gr),allPointsOccluded:!Lr}}}function dn(Pt,L,at){return L*(e.X/(Pt.tileSize*Math.pow(2,at-Pt.tileID.overscaledZ)))}class bn{constructor(L,at,xt,kt){this.opacity=L?Math.max(0,Math.min(1,L.opacity+(L.placed?at:-at))):kt&&xt?1:0,this.placed=xt}isHidden(){return this.opacity===0&&!this.placed}}class Zn{constructor(L,at,xt,kt,Lt){this.text=new bn(L?L.text:null,at,xt,Lt),this.icon=new bn(L?L.icon:null,at,kt,Lt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class En{constructor(L,at,xt){this.text=L,this.icon=at,this.skipFade=xt}}class gn{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class da{constructor(L,at,xt,kt,Lt){this.bucketInstanceId=L,this.featureIndex=at,this.sourceLayerIndex=xt,this.bucketIndex=kt,this.tileID=Lt}}class ra{constructor(L){this.crossSourceCollisions=L,this.maxGroupID=0,this.collisionGroups={}}get(L){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[L]){let at=++this.maxGroupID;this.collisionGroups[L]={ID:at,predicate:xt=>xt.collisionGroupID===at}}return this.collisionGroups[L]}}function Se(Pt,L,at,xt,kt){let{horizontalAlign:Lt,verticalAlign:le}=e.au(Pt);return new e.P(-(Lt-.5)*L+xt[0]*kt,-(le-.5)*at+xt[1]*kt)}class Re{constructor(L,at,xt,kt,Lt,le){this.transform=L.clone(),this.terrain=xt,this.collisionIndex=new pn(this.transform,at),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=kt,this.retainedQueryData={},this.collisionGroups=new ra(Lt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=le,le&&(le.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(L){let at=this.terrain;return at?(xt,kt)=>at.getElevation(L,xt,kt):null}getBucketParts(L,at,xt,kt){let Lt=xt.getBucket(at),le=xt.latestFeatureIndex;if(!Lt||!le||at.id!==Lt.layerIds[0])return;let xe=xt.collisionBoxArray,Pe=Lt.layers[0].layout,$e=Lt.layers[0].paint,hr=Math.pow(2,this.transform.zoom-xt.tileID.overscaledZ),pr=xt.tileSize/e.X,Br=xt.tileID.toUnwrapped(),Jr=this.transform.calculatePosMatrix(Br),Rt=Pe.get("text-pitch-alignment")==="map",Gt=Pe.get("text-rotation-alignment")==="map",ae=dn(xt,1,this.transform.zoom),ce=this.collisionIndex.mapProjection.translatePosition(this.transform,xt,$e.get("text-translate"),$e.get("text-translate-anchor")),Te=this.collisionIndex.mapProjection.translatePosition(this.transform,xt,$e.get("icon-translate"),$e.get("icon-translate-anchor")),ye=Mr(Jr,Rt,Gt,this.transform,ae),ze=null;if(Rt){let fr=Ir(Jr,Rt,Gt,this.transform,ae);ze=e.L([],this.transform.labelPlaneMatrix,fr)}this.retainedQueryData[Lt.bucketInstanceId]=new da(Lt.bucketInstanceId,le,Lt.sourceLayerIndex,Lt.index,xt.tileID);let rr={bucket:Lt,layout:Pe,translationText:ce,translationIcon:Te,posMatrix:Jr,unwrappedTileID:Br,textLabelPlaneMatrix:ye,labelToScreenMatrix:ze,scale:hr,textPixelRatio:pr,holdingForFade:xt.holdingForFade(),collisionBoxArray:xe,partiallyEvaluatedTextSize:e.ag(Lt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Lt.sourceID)};if(kt)for(let fr of Lt.sortKeyRanges){let{sortKey:gr,symbolInstanceStart:Lr,symbolInstanceEnd:Hr}=fr;L.push({sortKey:gr,symbolInstanceStart:Lr,symbolInstanceEnd:Hr,parameters:rr})}else L.push({symbolInstanceStart:0,symbolInstanceEnd:Lt.symbolInstances.length,parameters:rr})}attemptAnchorPlacement(L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt,Gt,ae,ce,Te,ye){let ze=e.aq[L.textAnchor],rr=[L.textOffset0,L.textOffset1],fr=Se(ze,xt,kt,rr,Lt),gr=this.collisionIndex.placeCollisionBox(at,Br,Pe,$e,hr,xe,le,ae,pr.predicate,ye,fr);if((!Te||this.collisionIndex.placeCollisionBox(Te,Br,Pe,$e,hr,xe,le,ce,pr.predicate,ye,fr).placeable)&&gr.placeable){let Lr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Jr.crossTileID]&&this.prevPlacement.placements[Jr.crossTileID]&&this.prevPlacement.placements[Jr.crossTileID].text&&(Lr=this.prevPlacement.variableOffsets[Jr.crossTileID].anchor),Jr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Jr.crossTileID]={textOffset:rr,width:xt,height:kt,anchor:ze,textBoxScale:Lt,prevAnchor:Lr},this.markUsedJustification(Rt,ze,Jr,Gt),Rt.allowVerticalPlacement&&(this.markUsedOrientation(Rt,Gt,Jr),this.placedOrientations[Jr.crossTileID]=Gt),{shift:fr,placedGlyphBoxes:gr}}}placeLayerBucketPart(L,at,xt){let{bucket:kt,layout:Lt,translationText:le,translationIcon:xe,posMatrix:Pe,unwrappedTileID:$e,textLabelPlaneMatrix:hr,labelToScreenMatrix:pr,textPixelRatio:Br,holdingForFade:Jr,collisionBoxArray:Rt,partiallyEvaluatedTextSize:Gt,collisionGroup:ae}=L.parameters,ce=Lt.get("text-optional"),Te=Lt.get("icon-optional"),ye=e.ar(Lt,"text-overlap","text-allow-overlap"),ze=ye==="always",rr=e.ar(Lt,"icon-overlap","icon-allow-overlap"),fr=rr==="always",gr=Lt.get("text-rotation-alignment")==="map",Lr=Lt.get("text-pitch-alignment")==="map",Hr=Lt.get("icon-text-fit")!=="none",nn=Lt.get("symbol-z-order")==="viewport-y",cn=ze&&(fr||!kt.hasIconData()||Te),Mn=fr&&(ze||!kt.hasTextData()||ce);!kt.collisionArrays&&Rt&&kt.deserializeCollisionBoxes(Rt);let Jn=this._getTerrainElevationFunc(this.retainedQueryData[kt.bucketInstanceId].tileID),_a=(xa,La,ai)=>{var Ai,mi;if(at[xa.crossTileID])return;if(Jr)return void(this.placements[xa.crossTileID]=new En(!1,!1,!1));let Yi=!1,Go=!1,Xo=!0,po=null,Qo={box:null,placeable:!1,offscreen:null},Js={placeable:!1},Us=null,To=null,ko=null,hl=0,Sl=0,tu=0;La.textFeatureIndex?hl=La.textFeatureIndex:xa.useRuntimeCollisionCircles&&(hl=xa.featureIndex),La.verticalTextFeatureIndex&&(Sl=La.verticalTextFeatureIndex);let gt=La.textBox;if(gt){let me=or=>{let Cr=e.ah.horizontal;if(kt.allowVerticalPlacement&&!or&&this.prevPlacement){let Sr=this.prevPlacement.placedOrientations[xa.crossTileID];Sr&&(this.placedOrientations[xa.crossTileID]=Sr,Cr=Sr,this.markUsedOrientation(kt,Cr,xa))}return Cr},we=(or,Cr)=>{if(kt.allowVerticalPlacement&&xa.numVerticalGlyphVertices>0&&La.verticalTextBox){for(let Sr of kt.writingModes)if(Sr===e.ah.vertical?(Qo=Cr(),Js=Qo):Qo=or(),Qo&&Qo.placeable)break}else Qo=or()},Ve=xa.textAnchorOffsetStartIndex,je=xa.textAnchorOffsetEndIndex;if(je===Ve){let or=(Cr,Sr)=>{let Wr=this.collisionIndex.placeCollisionBox(Cr,ye,Br,Pe,$e,Lr,gr,le,ae.predicate,Jn);return Wr&&Wr.placeable&&(this.markUsedOrientation(kt,Sr,xa),this.placedOrientations[xa.crossTileID]=Sr),Wr};we(()=>or(gt,e.ah.horizontal),()=>{let Cr=La.verticalTextBox;return kt.allowVerticalPlacement&&xa.numVerticalGlyphVertices>0&&Cr?or(Cr,e.ah.vertical):{box:null,offscreen:null}}),me(Qo&&Qo.placeable)}else{let or=e.aq[(mi=(Ai=this.prevPlacement)===null||Ai===void 0?void 0:Ai.variableOffsets[xa.crossTileID])===null||mi===void 0?void 0:mi.anchor],Cr=(Wr,an,on)=>{let ta=Wr.x2-Wr.x1,hn=Wr.y2-Wr.y1,Bn=xa.textBoxScale,Hn=Hr&&rr==="never"?an:null,Yn=null,na=ye==="never"?1:2,_n="never";or&&na++;for(let Ha=0;HaCr(gt,La.iconBox,e.ah.horizontal),()=>{let Wr=La.verticalTextBox;return kt.allowVerticalPlacement&&(!Qo||!Qo.placeable)&&xa.numVerticalGlyphVertices>0&&Wr?Cr(Wr,La.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Qo&&(Yi=Qo.placeable,Xo=Qo.offscreen);let Sr=me(Qo&&Qo.placeable);if(!Yi&&this.prevPlacement){let Wr=this.prevPlacement.variableOffsets[xa.crossTileID];Wr&&(this.variableOffsets[xa.crossTileID]=Wr,this.markUsedJustification(kt,Wr.anchor,xa,Sr))}}}if(Us=Qo,Yi=Us&&Us.placeable,Xo=Us&&Us.offscreen,xa.useRuntimeCollisionCircles){let me=kt.text.placedSymbolArray.get(xa.centerJustifiedTextSymbolIndex),we=e.ai(kt.textSizeData,Gt,me),Ve=Lt.get("text-padding");To=this.collisionIndex.placeCollisionCircles(ye,me,kt.lineVertexArray,kt.glyphOffsetArray,we,Pe,$e,hr,pr,xt,Lr,ae.predicate,xa.collisionCircleDiameter,Ve,le,Jn),To.circles.length&&To.collisionDetected&&!xt&&e.w("Collisions detected, but collision boxes are not shown"),Yi=ze||To.circles.length>0&&!To.collisionDetected,Xo=Xo&&To.offscreen}if(La.iconFeatureIndex&&(tu=La.iconFeatureIndex),La.iconBox){let me=we=>this.collisionIndex.placeCollisionBox(we,rr,Br,Pe,$e,Lr,gr,xe,ae.predicate,Jn,Hr&&po?po:void 0);Js&&Js.placeable&&La.verticalIconBox?(ko=me(La.verticalIconBox),Go=ko.placeable):(ko=me(La.iconBox),Go=ko.placeable),Xo=Xo&&ko.offscreen}let Et=ce||xa.numHorizontalGlyphVertices===0&&xa.numVerticalGlyphVertices===0,Xt=Te||xa.numIconVertices===0;Et||Xt?Xt?Et||(Go=Go&&Yi):Yi=Go&&Yi:Go=Yi=Go&&Yi;let fe=Go&&ko.placeable;if(Yi&&Us.placeable&&this.collisionIndex.insertCollisionBox(Us.box,ye,Lt.get("text-ignore-placement"),kt.bucketInstanceId,Js&&Js.placeable&&Sl?Sl:hl,ae.ID),fe&&this.collisionIndex.insertCollisionBox(ko.box,rr,Lt.get("icon-ignore-placement"),kt.bucketInstanceId,tu,ae.ID),To&&Yi&&this.collisionIndex.insertCollisionCircles(To.circles,ye,Lt.get("text-ignore-placement"),kt.bucketInstanceId,hl,ae.ID),xt&&this.storeCollisionData(kt.bucketInstanceId,ai,La,Us,ko,To),xa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(kt.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[xa.crossTileID]=new En(Yi||cn,Go||Mn,Xo||kt.justReloaded),at[xa.crossTileID]=!0};if(nn){if(L.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let xa=kt.getSortedSymbolIndexes(this.transform.angle);for(let La=xa.length-1;La>=0;--La){let ai=xa[La];_a(kt.symbolInstances.get(ai),kt.collisionArrays[ai],ai)}}else for(let xa=L.symbolInstanceStart;xa=0&&(L.text.placedSymbolArray.get(xe).crossTileID=Lt>=0&&xe!==Lt?0:xt.crossTileID)}markUsedOrientation(L,at,xt){let kt=at===e.ah.horizontal||at===e.ah.horizontalOnly?at:0,Lt=at===e.ah.vertical?at:0,le=[xt.leftJustifiedTextSymbolIndex,xt.centerJustifiedTextSymbolIndex,xt.rightJustifiedTextSymbolIndex];for(let xe of le)L.text.placedSymbolArray.get(xe).placedOrientation=kt;xt.verticalPlacedTextSymbolIndex&&(L.text.placedSymbolArray.get(xt.verticalPlacedTextSymbolIndex).placedOrientation=Lt)}commit(L){this.commitTime=L,this.zoomAtLastRecencyCheck=this.transform.zoom;let at=this.prevPlacement,xt=!1;this.prevZoomAdjustment=at?at.zoomAdjustment(this.transform.zoom):0;let kt=at?at.symbolFadeChange(L):1,Lt=at?at.opacities:{},le=at?at.variableOffsets:{},xe=at?at.placedOrientations:{};for(let Pe in this.placements){let $e=this.placements[Pe],hr=Lt[Pe];hr?(this.opacities[Pe]=new Zn(hr,kt,$e.text,$e.icon),xt=xt||$e.text!==hr.text.placed||$e.icon!==hr.icon.placed):(this.opacities[Pe]=new Zn(null,kt,$e.text,$e.icon,$e.skipFade),xt=xt||$e.text||$e.icon)}for(let Pe in Lt){let $e=Lt[Pe];if(!this.opacities[Pe]){let hr=new Zn($e,kt,!1,!1);hr.isHidden()||(this.opacities[Pe]=hr,xt=xt||$e.text.placed||$e.icon.placed)}}for(let Pe in le)this.variableOffsets[Pe]||!this.opacities[Pe]||this.opacities[Pe].isHidden()||(this.variableOffsets[Pe]=le[Pe]);for(let Pe in xe)this.placedOrientations[Pe]||!this.opacities[Pe]||this.opacities[Pe].isHidden()||(this.placedOrientations[Pe]=xe[Pe]);if(at&&at.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");xt?this.lastPlacementChangeTime=L:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=at?at.lastPlacementChangeTime:L)}updateLayerOpacities(L,at){let xt={};for(let kt of at){let Lt=kt.getBucket(L);Lt&&kt.latestFeatureIndex&&L.id===Lt.layerIds[0]&&this.updateBucketOpacities(Lt,kt.tileID,xt,kt.collisionBoxArray)}}updateBucketOpacities(L,at,xt,kt){L.hasTextData()&&(L.text.opacityVertexArray.clear(),L.text.hasVisibleVertices=!1),L.hasIconData()&&(L.icon.opacityVertexArray.clear(),L.icon.hasVisibleVertices=!1),L.hasIconCollisionBoxData()&&L.iconCollisionBox.collisionVertexArray.clear(),L.hasTextCollisionBoxData()&&L.textCollisionBox.collisionVertexArray.clear();let Lt=L.layers[0],le=Lt.layout,xe=new Zn(null,0,!1,!1,!0),Pe=le.get("text-allow-overlap"),$e=le.get("icon-allow-overlap"),hr=Lt._unevaluatedLayout.hasValue("text-variable-anchor")||Lt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),pr=le.get("text-rotation-alignment")==="map",Br=le.get("text-pitch-alignment")==="map",Jr=le.get("icon-text-fit")!=="none",Rt=new Zn(null,0,Pe&&($e||!L.hasIconData()||le.get("icon-optional")),$e&&(Pe||!L.hasTextData()||le.get("text-optional")),!0);!L.collisionArrays&&kt&&(L.hasIconCollisionBoxData()||L.hasTextCollisionBoxData())&&L.deserializeCollisionBoxes(kt);let Gt=(ce,Te,ye)=>{for(let ze=0;ze0,Lr=this.placedOrientations[Te.crossTileID],Hr=Lr===e.ah.vertical,nn=Lr===e.ah.horizontal||Lr===e.ah.horizontalOnly;if(ye>0||ze>0){let Mn=Kn(fr.text);Gt(L.text,ye,Hr?$n:Mn),Gt(L.text,ze,nn?$n:Mn);let Jn=fr.text.isHidden();[Te.rightJustifiedTextSymbolIndex,Te.centerJustifiedTextSymbolIndex,Te.leftJustifiedTextSymbolIndex].forEach(La=>{La>=0&&(L.text.placedSymbolArray.get(La).hidden=Jn||Hr?1:0)}),Te.verticalPlacedTextSymbolIndex>=0&&(L.text.placedSymbolArray.get(Te.verticalPlacedTextSymbolIndex).hidden=Jn||nn?1:0);let _a=this.variableOffsets[Te.crossTileID];_a&&this.markUsedJustification(L,_a.anchor,Te,Lr);let xa=this.placedOrientations[Te.crossTileID];xa&&(this.markUsedJustification(L,"left",Te,xa),this.markUsedOrientation(L,xa,Te))}if(gr){let Mn=Kn(fr.icon),Jn=!(Jr&&Te.verticalPlacedIconSymbolIndex&&Hr);Te.placedIconSymbolIndex>=0&&(Gt(L.icon,Te.numIconVertices,Jn?Mn:$n),L.icon.placedSymbolArray.get(Te.placedIconSymbolIndex).hidden=fr.icon.isHidden()),Te.verticalPlacedIconSymbolIndex>=0&&(Gt(L.icon,Te.numVerticalIconVertices,Jn?$n:Mn),L.icon.placedSymbolArray.get(Te.verticalPlacedIconSymbolIndex).hidden=fr.icon.isHidden())}let cn=ae&&ae.has(ce)?ae.get(ce):{text:null,icon:null};if(L.hasIconCollisionBoxData()||L.hasTextCollisionBoxData()){let Mn=L.collisionArrays[ce];if(Mn){let Jn=new e.P(0,0);if(Mn.textBox||Mn.verticalTextBox){let _a=!0;if(hr){let xa=this.variableOffsets[rr];xa?(Jn=Se(xa.anchor,xa.width,xa.height,xa.textOffset,xa.textBoxScale),pr&&Jn._rotate(Br?this.transform.angle:-this.transform.angle)):_a=!1}if(Mn.textBox||Mn.verticalTextBox){let xa;Mn.textBox&&(xa=Hr),Mn.verticalTextBox&&(xa=nn),Ze(L.textCollisionBox.collisionVertexArray,fr.text.placed,!_a||xa,cn.text,Jn.x,Jn.y)}}if(Mn.iconBox||Mn.verticalIconBox){let _a=!!(!nn&&Mn.verticalIconBox),xa;Mn.iconBox&&(xa=_a),Mn.verticalIconBox&&(xa=!_a),Ze(L.iconCollisionBox.collisionVertexArray,fr.icon.placed,xa,cn.icon,Jr?Jn.x:0,Jr?Jn.y:0)}}}}if(L.sortFeatures(this.transform.angle),this.retainedQueryData[L.bucketInstanceId]&&(this.retainedQueryData[L.bucketInstanceId].featureSortOrder=L.featureSortOrder),L.hasTextData()&&L.text.opacityVertexBuffer&&L.text.opacityVertexBuffer.updateData(L.text.opacityVertexArray),L.hasIconData()&&L.icon.opacityVertexBuffer&&L.icon.opacityVertexBuffer.updateData(L.icon.opacityVertexArray),L.hasIconCollisionBoxData()&&L.iconCollisionBox.collisionVertexBuffer&&L.iconCollisionBox.collisionVertexBuffer.updateData(L.iconCollisionBox.collisionVertexArray),L.hasTextCollisionBoxData()&&L.textCollisionBox.collisionVertexBuffer&&L.textCollisionBox.collisionVertexBuffer.updateData(L.textCollisionBox.collisionVertexArray),L.text.opacityVertexArray.length!==L.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${L.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${L.text.layoutVertexArray.length}) / 4`);if(L.icon.opacityVertexArray.length!==L.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${L.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${L.icon.layoutVertexArray.length}) / 4`);if(L.bucketInstanceId in this.collisionCircleArrays){let ce=this.collisionCircleArrays[L.bucketInstanceId];L.placementInvProjMatrix=ce.invProjMatrix,L.placementViewportMatrix=ce.viewportMatrix,L.collisionCircleArray=ce.circles,delete this.collisionCircleArrays[L.bucketInstanceId]}}symbolFadeChange(L){return this.fadeDuration===0?1:(L-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(L){return Math.max(0,(this.transform.zoom-L)/1.5)}hasTransitions(L){return this.stale||L-this.lastPlacementChangeTimeL}setStale(){this.stale=!0}}function Ze(Pt,L,at,xt,kt,Lt){xt&&xt.length!==0||(xt=[0,0,0,0]);let le=xt[0]-Er,xe=xt[1]-Er,Pe=xt[2]-Er,$e=xt[3]-Er;Pt.emplaceBack(L?1:0,at?1:0,kt||0,Lt||0,le,xe),Pt.emplaceBack(L?1:0,at?1:0,kt||0,Lt||0,Pe,xe),Pt.emplaceBack(L?1:0,at?1:0,kt||0,Lt||0,Pe,$e),Pt.emplaceBack(L?1:0,at?1:0,kt||0,Lt||0,le,$e)}let tr=Math.pow(2,25),zr=Math.pow(2,24),tn=Math.pow(2,17),Yr=Math.pow(2,16),$r=Math.pow(2,9),In=Math.pow(2,8),Nn=Math.pow(2,1);function Kn(Pt){if(Pt.opacity===0&&!Pt.placed)return 0;if(Pt.opacity===1&&Pt.placed)return 4294967295;let L=Pt.placed?1:0,at=Math.floor(127*Pt.opacity);return at*tr+L*zr+at*tn+L*Yr+at*$r+L*In+at*Nn+L}let $n=0;function ia(){return{isOccluded:(Pt,L,at)=>!1,getPitchedTextCorrection:(Pt,L,at)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Pt,L,at,xt){throw new Error("Not implemented.")},translatePosition:(Pt,L,at,xt)=>(function(kt,Lt,le,xe,Pe=!1){if(!le[0]&&!le[1])return[0,0];let $e=Pe?xe==="map"?kt.angle:0:xe==="viewport"?-kt.angle:0;if($e){let hr=Math.sin($e),pr=Math.cos($e);le=[le[0]*pr-le[1]*hr,le[0]*hr+le[1]*pr]}return[Pe?le[0]:dn(Lt,le[0],kt.zoom),Pe?le[1]:dn(Lt,le[1],kt.zoom)]})(Pt,L,at,xt),getCircleRadiusCorrection:Pt=>1}}class Cn{constructor(L){this._sortAcrossTiles=L.layout.get("symbol-z-order")!=="viewport-y"&&!L.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(L,at,xt,kt,Lt){let le=this._bucketParts;for(;this._currentTileIndexxe.sortKey-Pe.sortKey));this._currentPartIndex!this._forceFullPlacement&&o.now()-kt>2;for(;this._currentPlacementIndex>=0;){let le=at[L[this._currentPlacementIndex]],xe=this.placement.collisionIndex.transform.zoom;if(le.type==="symbol"&&(!le.minzoom||le.minzoom<=xe)&&(!le.maxzoom||le.maxzoom>xe)){if(this._inProgressLayer||(this._inProgressLayer=new Cn(le)),this._inProgressLayer.continuePlacement(xt[le.source],this.placement,this._showCollisionBoxes,le,Lt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(L){return this.placement.commit(L),this.placement}}let Ga=512/e.X/2;class ve{constructor(L,at,xt){this.tileID=L,this.bucketInstanceId=xt,this._symbolsByKey={};let kt=new Map;for(let Lt=0;Lt({x:Math.floor(Pe.anchorX*Ga),y:Math.floor(Pe.anchorY*Ga)})),crossTileIDs:le.map(Pe=>Pe.crossTileID)};if(xe.positions.length>128){let Pe=new e.av(xe.positions.length,16,Uint16Array);for(let{x:$e,y:hr}of xe.positions)Pe.add($e,hr);Pe.finish(),delete xe.positions,xe.index=Pe}this._symbolsByKey[Lt]=xe}}getScaledCoordinates(L,at){let{x:xt,y:kt,z:Lt}=this.tileID.canonical,{x:le,y:xe,z:Pe}=at.canonical,$e=Ga/Math.pow(2,Pe-Lt),hr=(xe*e.X+L.anchorY)*$e,pr=kt*e.X*Ga;return{x:Math.floor((le*e.X+L.anchorX)*$e-xt*e.X*Ga),y:Math.floor(hr-pr)}}findMatches(L,at,xt){let kt=this.tileID.canonical.zL)}}class ge{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class dr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(L){let at=Math.round((L-this.lng)/360);if(at!==0)for(let xt in this.indexes){let kt=this.indexes[xt],Lt={};for(let le in kt){let xe=kt[le];xe.tileID=xe.tileID.unwrapTo(xe.tileID.wrap+at),Lt[xe.tileID.key]=xe}this.indexes[xt]=Lt}this.lng=L}addBucket(L,at,xt){if(this.indexes[L.overscaledZ]&&this.indexes[L.overscaledZ][L.key]){if(this.indexes[L.overscaledZ][L.key].bucketInstanceId===at.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(L.overscaledZ,this.indexes[L.overscaledZ][L.key])}for(let Lt=0;LtL.overscaledZ)for(let xe in le){let Pe=le[xe];Pe.tileID.isChildOf(L)&&Pe.findMatches(at.symbolInstances,L,kt)}else{let xe=le[L.scaledTo(Number(Lt)).key];xe&&xe.findMatches(at.symbolInstances,L,kt)}}for(let Lt=0;Lt{at[xt]=!0});for(let xt in this.layerIndexes)at[xt]||delete this.layerIndexes[xt]}}let Tr=(Pt,L)=>e.t(Pt,L&&L.filter(at=>at.identifier!=="source.canvas")),mr=e.aw();class kr extends e.E{constructor(L,at={}){super(),this._rtlPluginLoaded=()=>{for(let xt in this.sourceCaches){let kt=this.sourceCaches[xt].getSource().type;kt!=="vector"&&kt!=="geojson"||this.sourceCaches[xt].reload()}},this.map=L,this.dispatcher=new X(ot(),L._getMapId()),this.dispatcher.registerMessageHandler("GG",(xt,kt)=>this.getGlyphs(xt,kt)),this.dispatcher.registerMessageHandler("GI",(xt,kt)=>this.getImages(xt,kt)),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new B(L._requestManager,at.localIdeographFontFamily),this.lineAtlas=new G(256,512),this.crossTileSymbolIndex=new br,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),re().on(bt,this._rtlPluginLoaded),this.on("data",xt=>{if(xt.dataType!=="source"||xt.sourceDataType!=="metadata")return;let kt=this.sourceCaches[xt.sourceId];if(!kt)return;let Lt=kt.getSource();if(Lt&&Lt.vectorLayerIds)for(let le in this._layers){let xe=this._layers[le];xe.source===Lt.id&&this._validateLayer(xe)}})}loadURL(L,at={},xt){this.fire(new e.k("dataloading",{dataType:"style"})),at.validate=typeof at.validate!="boolean"||at.validate;let kt=this.map._requestManager.transformRequest(L,"Style");this._loadStyleRequest=new AbortController;let Lt=this._loadStyleRequest;e.h(kt,this._loadStyleRequest).then(le=>{this._loadStyleRequest=null,this._load(le.data,at,xt)}).catch(le=>{this._loadStyleRequest=null,le&&!Lt.signal.aborted&&this.fire(new e.j(le))})}loadJSON(L,at={},xt){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,at.validate=at.validate!==!1,this._load(L,at,xt)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(mr,{validate:!1})}_load(L,at,xt){var kt;let Lt=at.transformStyle?at.transformStyle(xt,L):L;if(!at.validate||!Tr(this,e.u(Lt))){this._loaded=!0,this.stylesheet=Lt;for(let le in Lt.sources)this.addSource(le,Lt.sources[le],{validate:!1});Lt.sprite?this._loadSprite(Lt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Lt.glyphs),this._createLayers(),this.light=new F(this.stylesheet.light),this.sky=new N(this.stylesheet.sky),this.map.setTerrain((kt=this.stylesheet.terrain)!==null&&kt!==void 0?kt:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let L=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",L),this._order=L.map(at=>at.id),this._layers={},this._serializedLayers=null;for(let at of L){let xt=e.aA(at);xt.setEventedParent(this,{layer:{id:at.id}}),this._layers[at.id]=xt}}_loadSprite(L,at=!1,xt=void 0){let kt;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Lt,le,xe,Pe){return e._(this,void 0,void 0,function*(){let $e=T(Lt),hr=xe>1?"@2x":"",pr={},Br={};for(let{id:Jr,url:Rt}of $e){let Gt=le.transformRequest(c(Rt,hr,".json"),"SpriteJSON");pr[Jr]=e.h(Gt,Pe);let ae=le.transformRequest(c(Rt,hr,".png"),"SpriteImage");Br[Jr]=l.getImage(ae,Pe)}return yield Promise.all([...Object.values(pr),...Object.values(Br)]),(function(Jr,Rt){return e._(this,void 0,void 0,function*(){let Gt={};for(let ae in Jr){Gt[ae]={};let ce=o.getImageCanvasContext((yield Rt[ae]).data),Te=(yield Jr[ae]).data;for(let ye in Te){let{width:ze,height:rr,x:fr,y:gr,sdf:Lr,pixelRatio:Hr,stretchX:nn,stretchY:cn,content:Mn,textFitWidth:Jn,textFitHeight:_a}=Te[ye];Gt[ae][ye]={data:null,pixelRatio:Hr,sdf:Lr,stretchX:nn,stretchY:cn,content:Mn,textFitWidth:Jn,textFitHeight:_a,spriteData:{width:ze,height:rr,x:fr,y:gr,context:ce}}}}return Gt})})(pr,Br)})})(L,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Lt=>{if(this._spriteRequest=null,Lt)for(let le in Lt){this._spritesImagesIds[le]=[];let xe=this._spritesImagesIds[le]?this._spritesImagesIds[le].filter(Pe=>!(Pe in Lt)):[];for(let Pe of xe)this.imageManager.removeImage(Pe),this._changedImages[Pe]=!0;for(let Pe in Lt[le]){let $e=le==="default"?Pe:`${le}:${Pe}`;this._spritesImagesIds[le].push($e),$e in this.imageManager.images?this.imageManager.updateImage($e,Lt[le][Pe],!1):this.imageManager.addImage($e,Lt[le][Pe]),at&&(this._changedImages[$e]=!0)}}}).catch(Lt=>{this._spriteRequest=null,kt=Lt,this.fire(new e.j(kt))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),at&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),xt&&xt(kt)})}_unloadSprite(){for(let L of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(L),this._changedImages[L]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(L){let at=this.sourceCaches[L.source];if(!at)return;let xt=L.sourceLayer;if(!xt)return;let kt=at.getSource();(kt.type==="geojson"||kt.vectorLayerIds&&kt.vectorLayerIds.indexOf(xt)===-1)&&this.fire(new e.j(new Error(`Source layer "${xt}" does not exist on source "${kt.id}" as specified by style layer "${L.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let L in this.sourceCaches)if(!this.sourceCaches[L].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(L,at=!1){let xt=this._serializedAllLayers();if(!L||L.length===0)return Object.values(at?e.aB(xt):xt);let kt=[];for(let Lt of L)if(xt[Lt]){let le=at?e.aB(xt[Lt]):xt[Lt];kt.push(le)}return kt}_serializedAllLayers(){let L=this._serializedLayers;if(L)return L;L=this._serializedLayers={};let at=Object.keys(this._layers);for(let xt of at){let kt=this._layers[xt];kt.type!=="custom"&&(L[xt]=kt.serialize())}return L}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let L in this.sourceCaches)if(this.sourceCaches[L].hasTransition())return!0;for(let L in this._layers)if(this._layers[L].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(L){if(!this._loaded)return;let at=this._changed;if(at){let kt=Object.keys(this._updatedLayers),Lt=Object.keys(this._removedLayers);(kt.length||Lt.length)&&this._updateWorkerLayers(kt,Lt);for(let le in this._updatedSources){let xe=this._updatedSources[le];if(xe==="reload")this._reloadSource(le);else{if(xe!=="clear")throw new Error(`Invalid action ${xe}`);this._clearSource(le)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let le in this._updatedPaintProps)this._layers[le].updateTransitions(L);this.light.updateTransitions(L),this.sky.updateTransitions(L),this._resetUpdates()}let xt={};for(let kt in this.sourceCaches){let Lt=this.sourceCaches[kt];xt[kt]=Lt.used,Lt.used=!1}for(let kt of this._order){let Lt=this._layers[kt];Lt.recalculate(L,this._availableImages),!Lt.isHidden(L.zoom)&&Lt.source&&(this.sourceCaches[Lt.source].used=!0)}for(let kt in xt){let Lt=this.sourceCaches[kt];!!xt[kt]!=!!Lt.used&&Lt.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:kt}))}this.light.recalculate(L),this.sky.recalculate(L),this.z=L.zoom,at&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let L=Object.keys(this._changedImages);if(L.length){for(let at in this.sourceCaches)this.sourceCaches[at].reloadTilesForDependencies(["icons","patterns"],L);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let L in this.sourceCaches)this.sourceCaches[L].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(L,at){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(L,!1),removedIds:at})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(L,at={}){var xt;this._checkLoaded();let kt=this.serialize();if(L=at.transformStyle?at.transformStyle(kt,L):L,((xt=at.validate)===null||xt===void 0||xt)&&Tr(this,e.u(L)))return!1;(L=e.aB(L)).layers=e.az(L.layers);let Lt=e.aC(kt,L),le=this._getOperationsToPerform(Lt);if(le.unimplemented.length>0)throw new Error(`Unimplemented: ${le.unimplemented.join(", ")}.`);if(le.operations.length===0)return!1;for(let xe of le.operations)xe();return this.stylesheet=L,this._serializedLayers=null,!0}_getOperationsToPerform(L){let at=[],xt=[];for(let kt of L)switch(kt.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":at.push(()=>this.addLayer.apply(this,kt.args));break;case"removeLayer":at.push(()=>this.removeLayer.apply(this,kt.args));break;case"setPaintProperty":at.push(()=>this.setPaintProperty.apply(this,kt.args));break;case"setLayoutProperty":at.push(()=>this.setLayoutProperty.apply(this,kt.args));break;case"setFilter":at.push(()=>this.setFilter.apply(this,kt.args));break;case"addSource":at.push(()=>this.addSource.apply(this,kt.args));break;case"removeSource":at.push(()=>this.removeSource.apply(this,kt.args));break;case"setLayerZoomRange":at.push(()=>this.setLayerZoomRange.apply(this,kt.args));break;case"setLight":at.push(()=>this.setLight.apply(this,kt.args));break;case"setGeoJSONSourceData":at.push(()=>this.setGeoJSONSourceData.apply(this,kt.args));break;case"setGlyphs":at.push(()=>this.setGlyphs.apply(this,kt.args));break;case"setSprite":at.push(()=>this.setSprite.apply(this,kt.args));break;case"setSky":at.push(()=>this.setSky.apply(this,kt.args));break;case"setTerrain":at.push(()=>this.map.setTerrain.apply(this,kt.args));break;case"setTransition":at.push(()=>{});break;default:xt.push(kt.command)}return{operations:at,unimplemented:xt}}addImage(L,at){if(this.getImage(L))return this.fire(new e.j(new Error(`An image named "${L}" already exists.`)));this.imageManager.addImage(L,at),this._afterImageUpdated(L)}updateImage(L,at){this.imageManager.updateImage(L,at)}getImage(L){return this.imageManager.getImage(L)}removeImage(L){if(!this.getImage(L))return this.fire(new e.j(new Error(`An image named "${L}" does not exist.`)));this.imageManager.removeImage(L),this._afterImageUpdated(L)}_afterImageUpdated(L){this._availableImages=this.imageManager.listImages(),this._changedImages[L]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(L,at,xt={}){if(this._checkLoaded(),this.sourceCaches[L]!==void 0)throw new Error(`Source "${L}" already exists.`);if(!at.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(at).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(at.type)>=0&&this._validate(e.u.source,`sources.${L}`,at,null,xt))return;this.map&&this.map._collectResourceTiming&&(at.collectResourceTiming=!0);let kt=this.sourceCaches[L]=new Ce(L,at,this.dispatcher);kt.style=this,kt.setEventedParent(this,()=>({isSourceLoaded:kt.loaded(),source:kt.serialize(),sourceId:L})),kt.onAdd(this.map),this._changed=!0}removeSource(L){if(this._checkLoaded(),this.sourceCaches[L]===void 0)throw new Error("There is no source with this ID");for(let xt in this._layers)if(this._layers[xt].source===L)return this.fire(new e.j(new Error(`Source "${L}" cannot be removed while layer "${xt}" is using it.`)));let at=this.sourceCaches[L];delete this.sourceCaches[L],delete this._updatedSources[L],at.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:L})),at.setEventedParent(null),at.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(L,at){if(this._checkLoaded(),this.sourceCaches[L]===void 0)throw new Error(`There is no source with this ID=${L}`);let xt=this.sourceCaches[L].getSource();if(xt.type!=="geojson")throw new Error(`geojsonSource.type is ${xt.type}, which is !== 'geojson`);xt.setData(at),this._changed=!0}getSource(L){return this.sourceCaches[L]&&this.sourceCaches[L].getSource()}addLayer(L,at,xt={}){this._checkLoaded();let kt=L.id;if(this.getLayer(kt))return void this.fire(new e.j(new Error(`Layer "${kt}" already exists on this map.`)));let Lt;if(L.type==="custom"){if(Tr(this,e.aD(L)))return;Lt=e.aA(L)}else{if("source"in L&&typeof L.source=="object"&&(this.addSource(kt,L.source),L=e.aB(L),L=e.e(L,{source:kt})),this._validate(e.u.layer,`layers.${kt}`,L,{arrayIndex:-1},xt))return;Lt=e.aA(L),this._validateLayer(Lt),Lt.setEventedParent(this,{layer:{id:kt}})}let le=at?this._order.indexOf(at):this._order.length;if(at&&le===-1)this.fire(new e.j(new Error(`Cannot add layer "${kt}" before non-existing layer "${at}".`)));else{if(this._order.splice(le,0,kt),this._layerOrderChanged=!0,this._layers[kt]=Lt,this._removedLayers[kt]&&Lt.source&&Lt.type!=="custom"){let xe=this._removedLayers[kt];delete this._removedLayers[kt],xe.type!==Lt.type?this._updatedSources[Lt.source]="clear":(this._updatedSources[Lt.source]="reload",this.sourceCaches[Lt.source].pause())}this._updateLayer(Lt),Lt.onAdd&&Lt.onAdd(this.map)}}moveLayer(L,at){if(this._checkLoaded(),this._changed=!0,!this._layers[L])return void this.fire(new e.j(new Error(`The layer '${L}' does not exist in the map's style and cannot be moved.`)));if(L===at)return;let xt=this._order.indexOf(L);this._order.splice(xt,1);let kt=at?this._order.indexOf(at):this._order.length;at&&kt===-1?this.fire(new e.j(new Error(`Cannot move layer "${L}" before non-existing layer "${at}".`))):(this._order.splice(kt,0,L),this._layerOrderChanged=!0)}removeLayer(L){this._checkLoaded();let at=this._layers[L];if(!at)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${L}".`)));at.setEventedParent(null);let xt=this._order.indexOf(L);this._order.splice(xt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[L]=at,delete this._layers[L],this._serializedLayers&&delete this._serializedLayers[L],delete this._updatedLayers[L],delete this._updatedPaintProps[L],at.onRemove&&at.onRemove(this.map)}getLayer(L){return this._layers[L]}getLayersOrder(){return[...this._order]}hasLayer(L){return L in this._layers}setLayerZoomRange(L,at,xt){this._checkLoaded();let kt=this.getLayer(L);kt?kt.minzoom===at&&kt.maxzoom===xt||(at!=null&&(kt.minzoom=at),xt!=null&&(kt.maxzoom=xt),this._updateLayer(kt)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${L}".`)))}setFilter(L,at,xt={}){this._checkLoaded();let kt=this.getLayer(L);if(kt){if(!e.aE(kt.filter,at))return at==null?(kt.filter=void 0,void this._updateLayer(kt)):void(this._validate(e.u.filter,`layers.${kt.id}.filter`,at,null,xt)||(kt.filter=e.aB(at),this._updateLayer(kt)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${L}".`)))}getFilter(L){return e.aB(this.getLayer(L).filter)}setLayoutProperty(L,at,xt,kt={}){this._checkLoaded();let Lt=this.getLayer(L);Lt?e.aE(Lt.getLayoutProperty(at),xt)||(Lt.setLayoutProperty(at,xt,kt),this._updateLayer(Lt)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${L}".`)))}getLayoutProperty(L,at){let xt=this.getLayer(L);if(xt)return xt.getLayoutProperty(at);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${L}".`)))}setPaintProperty(L,at,xt,kt={}){this._checkLoaded();let Lt=this.getLayer(L);Lt?e.aE(Lt.getPaintProperty(at),xt)||(Lt.setPaintProperty(at,xt,kt)&&this._updateLayer(Lt),this._changed=!0,this._updatedPaintProps[L]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${L}".`)))}getPaintProperty(L,at){return this.getLayer(L).getPaintProperty(at)}setFeatureState(L,at){this._checkLoaded();let xt=L.source,kt=L.sourceLayer,Lt=this.sourceCaches[xt];if(Lt===void 0)return void this.fire(new e.j(new Error(`The source '${xt}' does not exist in the map's style.`)));let le=Lt.getSource().type;le==="geojson"&&kt?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):le!=="vector"||kt?(L.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),Lt.setFeatureState(kt,L.id,at)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(L,at){this._checkLoaded();let xt=L.source,kt=this.sourceCaches[xt];if(kt===void 0)return void this.fire(new e.j(new Error(`The source '${xt}' does not exist in the map's style.`)));let Lt=kt.getSource().type,le=Lt==="vector"?L.sourceLayer:void 0;Lt!=="vector"||le?at&&typeof L.id!="string"&&typeof L.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):kt.removeFeatureState(le,L.id,at):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(L){this._checkLoaded();let at=L.source,xt=L.sourceLayer,kt=this.sourceCaches[at];if(kt!==void 0)return kt.getSource().type!=="vector"||xt?(L.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),kt.getFeatureState(xt,L.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${at}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let L=e.aF(this.sourceCaches,Lt=>Lt.serialize()),at=this._serializeByIds(this._order,!0),xt=this.map.getTerrain()||void 0,kt=this.stylesheet;return e.aG({version:kt.version,name:kt.name,metadata:kt.metadata,light:kt.light,sky:kt.sky,center:kt.center,zoom:kt.zoom,bearing:kt.bearing,pitch:kt.pitch,sprite:kt.sprite,glyphs:kt.glyphs,transition:kt.transition,sources:L,layers:at,terrain:xt},Lt=>Lt!==void 0)}_updateLayer(L){this._updatedLayers[L.id]=!0,L.source&&!this._updatedSources[L.source]&&this.sourceCaches[L.source].getSource().type!=="raster"&&(this._updatedSources[L.source]="reload",this.sourceCaches[L.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(L){let at=le=>this._layers[le].type==="fill-extrusion",xt={},kt=[];for(let le=this._order.length-1;le>=0;le--){let xe=this._order[le];if(at(xe)){xt[xe]=le;for(let Pe of L){let $e=Pe[xe];if($e)for(let hr of $e)kt.push(hr)}}}kt.sort((le,xe)=>xe.intersectionZ-le.intersectionZ);let Lt=[];for(let le=this._order.length-1;le>=0;le--){let xe=this._order[le];if(at(xe))for(let Pe=kt.length-1;Pe>=0;Pe--){let $e=kt[Pe].feature;if(xt[$e.layer.id]{let Lr=ce.featureSortOrder;if(Lr){let Hr=Lr.indexOf(fr.featureIndex);return Lr.indexOf(gr.featureIndex)-Hr}return gr.featureIndex-fr.featureIndex});for(let fr of rr)ze.push(fr)}}for(let ce in Rt)Rt[ce].forEach(Te=>{let ye=Te.feature,ze=$e[xe[ce].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ze});return Rt})(this._layers,le,this.sourceCaches,L,at,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Lt)}querySourceFeatures(L,at){at&&at.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",at.filter,null,at);let xt=this.sourceCaches[L];return xt?(function(kt,Lt){let le=kt.getRenderableIds().map($e=>kt.getTileByID($e)),xe=[],Pe={};for(let $e=0;$eBr.getTileByID(Jr)).sort((Jr,Rt)=>Rt.tileID.overscaledZ-Jr.tileID.overscaledZ||(Jr.tileID.isLessThan(Rt.tileID)?-1:1))}let pr=this.crossTileSymbolIndex.addLayer(hr,Pe[hr.source],L.center.lng);le=le||pr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Lt=Lt||this._layerOrderChanged||xt===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.now(),L.zoom))&&(this.pauseablePlacement=new Fa(L,this.map.terrain,this._order,Lt,at,xt,kt,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Pe),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.now()),xe=!0),le&&this.pauseablePlacement.placement.setStale()),xe||le)for(let $e of this._order){let hr=this._layers[$e];hr.type==="symbol"&&this.placement.updateLayerOpacities(hr,Pe[hr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.now())}_releaseSymbolFadeTiles(){for(let L in this.sourceCaches)this.sourceCaches[L].releaseSymbolFadeTiles()}getImages(L,at){return e._(this,void 0,void 0,function*(){let xt=yield this.imageManager.getImages(at.icons);this._updateTilesForChangedImages();let kt=this.sourceCaches[at.source];return kt&&kt.setDependencies(at.tileID.key,at.type,at.icons),xt})}getGlyphs(L,at){return e._(this,void 0,void 0,function*(){let xt=yield this.glyphManager.getGlyphs(at.stacks),kt=this.sourceCaches[at.source];return kt&&kt.setDependencies(at.tileID.key,at.type,[""]),xt})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(L,at={}){this._checkLoaded(),L&&this._validate(e.u.glyphs,"glyphs",L,null,at)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=L,this.glyphManager.entries={},this.glyphManager.setURL(L))}addSprite(L,at,xt={},kt){this._checkLoaded();let Lt=[{id:L,url:at}],le=[...T(this.stylesheet.sprite),...Lt];this._validate(e.u.sprite,"sprite",le,null,xt)||(this.stylesheet.sprite=le,this._loadSprite(Lt,!0,kt))}removeSprite(L){this._checkLoaded();let at=T(this.stylesheet.sprite);if(at.find(xt=>xt.id===L)){if(this._spritesImagesIds[L])for(let xt of this._spritesImagesIds[L])this.imageManager.removeImage(xt),this._changedImages[xt]=!0;at.splice(at.findIndex(xt=>xt.id===L),1),this.stylesheet.sprite=at.length>0?at:void 0,delete this._spritesImagesIds[L],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${L}" doesn't exists on this map.`)))}getSprite(){return T(this.stylesheet.sprite)}setSprite(L,at={},xt){this._checkLoaded(),L&&this._validate(e.u.sprite,"sprite",L,null,at)||(this.stylesheet.sprite=L,L?this._loadSprite(L,!0,xt):(this._unloadSprite(),xt&&xt(null)))}}var Ur=e.Y([{name:"a_pos",type:"Int16",components:2}]);let Or={prelude:pe(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(vec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}`),background:pe(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:pe(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:pe(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:pe("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:pe(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:pe(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:pe("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:pe("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:pe("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:pe(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:pe(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:pe(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:pe(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:pe(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:pe(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:pe(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:pe(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:pe(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:pe(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),linePattern:pe(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:pe(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:pe(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:pe(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:pe(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:pe(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:pe("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:pe("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:pe("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:pe("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function pe(Pt,L){let at=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,xt=L.match(/attribute ([\w]+) ([\w]+)/g),kt=Pt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Lt=L.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),le=Lt?Lt.concat(kt):kt,xe={};return{fragmentSource:Pt=Pt.replace(at,(Pe,$e,hr,pr,Br)=>(xe[Br]=!0,$e==="define"?` -#ifndef HAS_UNIFORM_u_${Br} -varying ${hr} ${pr} ${Br}; -#else -uniform ${hr} ${pr} u_${Br}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${Br} - ${hr} ${pr} ${Br} = u_${Br}; -#endif -`)),vertexSource:L=L.replace(at,(Pe,$e,hr,pr,Br)=>{let Jr=pr==="float"?"vec2":"vec4",Rt=Br.match(/color/)?"color":Jr;return xe[Br]?$e==="define"?` -#ifndef HAS_UNIFORM_u_${Br} -uniform lowp float u_${Br}_t; -attribute ${hr} ${Jr} a_${Br}; -varying ${hr} ${pr} ${Br}; -#else -uniform ${hr} ${pr} u_${Br}; -#endif -`:Rt==="vec4"?` -#ifndef HAS_UNIFORM_u_${Br} - ${Br} = a_${Br}; -#else - ${hr} ${pr} ${Br} = u_${Br}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${Br} - ${Br} = unpack_mix_${Rt}(a_${Br}, u_${Br}_t); -#else - ${hr} ${pr} ${Br} = u_${Br}; -#endif -`:$e==="define"?` -#ifndef HAS_UNIFORM_u_${Br} -uniform lowp float u_${Br}_t; -attribute ${hr} ${Jr} a_${Br}; -#else -uniform ${hr} ${pr} u_${Br}; -#endif -`:Rt==="vec4"?` -#ifndef HAS_UNIFORM_u_${Br} - ${hr} ${pr} ${Br} = a_${Br}; -#else - ${hr} ${pr} ${Br} = u_${Br}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${Br} - ${hr} ${pr} ${Br} = unpack_mix_${Rt}(a_${Br}, u_${Br}_t); -#else - ${hr} ${pr} ${Br} = u_${Br}; -#endif -`}),staticAttributes:xt,staticUniforms:le}}class Ke{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(L,at,xt,kt,Lt,le,xe,Pe,$e){this.context=L;let hr=this.boundPaintVertexBuffers.length!==kt.length;for(let pr=0;!hr&&pr({u_matrix:Pt,u_texture:0,u_ele_delta:L,u_fog_matrix:at,u_fog_color:xt?xt.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:xt?xt.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:xt?xt.calculateFogBlendOpacity(kt):0,u_horizon_color:xt?xt.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:xt?xt.properties.get("horizon-fog-blend"):1});function Gr(Pt){let L=[];for(let at=0;at({u_depth:new e.aH(fr,gr.u_depth),u_terrain:new e.aH(fr,gr.u_terrain),u_terrain_dim:new e.aI(fr,gr.u_terrain_dim),u_terrain_matrix:new e.aJ(fr,gr.u_terrain_matrix),u_terrain_unpack:new e.aK(fr,gr.u_terrain_unpack),u_terrain_exaggeration:new e.aI(fr,gr.u_terrain_exaggeration)}))(L,rr),this.binderUniforms=xt?xt.getUniforms(L,rr):[]}draw(L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt,Gt,ae,ce,Te){let ye=L.gl;if(this.failedToCreate)return;if(L.program.set(this.program),L.setDepthMode(xt),L.setStencilMode(kt),L.setColorMode(Lt),L.setCullFace(le),Pe){L.activeTexture.set(ye.TEXTURE2),ye.bindTexture(ye.TEXTURE_2D,Pe.depthTexture),L.activeTexture.set(ye.TEXTURE3),ye.bindTexture(ye.TEXTURE_2D,Pe.texture);for(let rr in this.terrainUniforms)this.terrainUniforms[rr].set(Pe[rr])}for(let rr in this.fixedUniforms)this.fixedUniforms[rr].set(xe[rr]);Gt&&Gt.setUniforms(L,this.binderUniforms,Jr,{zoom:Rt});let ze=0;switch(at){case ye.LINES:ze=2;break;case ye.TRIANGLES:ze=3;break;case ye.LINE_STRIP:ze=1}for(let rr of Br.get()){let fr=rr.vaos||(rr.vaos={});(fr[$e]||(fr[$e]=new Ke)).bind(L,this,hr,Gt?Gt.getPaintVertexBuffers():[],pr,rr.vertexOffset,ae,ce,Te),ye.drawElements(at,rr.primitiveLength*ze,ye.UNSIGNED_SHORT,rr.primitiveOffset*ze*2)}}}function wn(Pt,L,at){let xt=1/dn(at,1,L.transform.tileZoom),kt=Math.pow(2,at.tileID.overscaledZ),Lt=at.tileSize*Math.pow(2,L.transform.tileZoom)/kt,le=Lt*(at.tileID.canonical.x+at.tileID.wrap*kt),xe=Lt*at.tileID.canonical.y;return{u_image:0,u_texsize:at.imageAtlasTexture.size,u_scale:[xt,Pt.fromScale,Pt.toScale],u_fade:Pt.t,u_pixel_coord_upper:[le>>16,xe>>16],u_pixel_coord_lower:[65535&le,65535&xe]}}let rn=(Pt,L,at,xt)=>{let kt=L.style.light,Lt=kt.properties.get("position"),le=[Lt.x,Lt.y,Lt.z],xe=(function(){var $e=new e.A(9);return e.A!=Float32Array&&($e[1]=0,$e[2]=0,$e[3]=0,$e[5]=0,$e[6]=0,$e[7]=0),$e[0]=1,$e[4]=1,$e[8]=1,$e})();kt.properties.get("anchor")==="viewport"&&(function($e,hr){var pr=Math.sin(hr),Br=Math.cos(hr);$e[0]=Br,$e[1]=pr,$e[2]=0,$e[3]=-pr,$e[4]=Br,$e[5]=0,$e[6]=0,$e[7]=0,$e[8]=1})(xe,-L.transform.angle),(function($e,hr,pr){var Br=hr[0],Jr=hr[1],Rt=hr[2];$e[0]=Br*pr[0]+Jr*pr[3]+Rt*pr[6],$e[1]=Br*pr[1]+Jr*pr[4]+Rt*pr[7],$e[2]=Br*pr[2]+Jr*pr[5]+Rt*pr[8]})(le,le,xe);let Pe=kt.properties.get("color");return{u_matrix:Pt,u_lightpos:le,u_lightintensity:kt.properties.get("intensity"),u_lightcolor:[Pe.r,Pe.g,Pe.b],u_vertical_gradient:+at,u_opacity:xt}},Qr=(Pt,L,at,xt,kt,Lt,le)=>e.e(rn(Pt,L,at,xt),wn(Lt,L,le),{u_height_factor:-Math.pow(2,kt.overscaledZ)/le.tileSize/8}),vn=Pt=>({u_matrix:Pt}),Oa=(Pt,L,at,xt)=>e.e(vn(Pt),wn(at,L,xt)),Qn=(Pt,L)=>({u_matrix:Pt,u_world:L}),Qa=(Pt,L,at,xt,kt)=>e.e(Oa(Pt,L,at,xt),{u_world:kt}),Ja=(Pt,L,at,xt)=>{let kt=Pt.transform,Lt,le;if(xt.paint.get("circle-pitch-alignment")==="map"){let xe=dn(at,1,kt.zoom);Lt=!0,le=[xe,xe]}else Lt=!1,le=kt.pixelsToGLUnits;return{u_camera_to_center_distance:kt.cameraToCenterDistance,u_scale_with_map:+(xt.paint.get("circle-pitch-scale")==="map"),u_matrix:Pt.translatePosMatrix(L.posMatrix,at,xt.paint.get("circle-translate"),xt.paint.get("circle-translate-anchor")),u_pitch_with_map:+Lt,u_device_pixel_ratio:Pt.pixelRatio,u_extrude_scale:le}},wi=(Pt,L,at)=>({u_matrix:Pt,u_inv_matrix:L,u_camera_to_center_distance:at.cameraToCenterDistance,u_viewport_size:[at.width,at.height]}),ci=(Pt,L,at=1)=>({u_matrix:Pt,u_color:L,u_overlay:0,u_overlay_scale:at}),Ti=Pt=>({u_matrix:Pt}),Ra=(Pt,L,at,xt)=>({u_matrix:Pt,u_extrude_scale:dn(L,1,at),u_intensity:xt}),Qi=(Pt,L,at,xt)=>{let kt=e.H();e.aP(kt,0,Pt.width,Pt.height,0,0,1);let Lt=Pt.context.gl;return{u_matrix:kt,u_world:[Lt.drawingBufferWidth,Lt.drawingBufferHeight],u_image:at,u_color_ramp:xt,u_opacity:L.paint.get("heatmap-opacity")}};function Hi(Pt,L){let at=Math.pow(2,L.canonical.z),xt=L.canonical.y;return[new e.Z(0,xt/at).toLngLat().lat,new e.Z(0,(xt+1)/at).toLngLat().lat]}let Ho=(Pt,L,at,xt)=>{let kt=Pt.transform;return{u_matrix:Po(Pt,L,at,xt),u_ratio:1/dn(L,1,kt.zoom),u_device_pixel_ratio:Pt.pixelRatio,u_units_to_pixels:[1/kt.pixelsToGLUnits[0],1/kt.pixelsToGLUnits[1]]}},Ci=(Pt,L,at,xt,kt)=>e.e(Ho(Pt,L,at,kt),{u_image:0,u_image_height:xt}),zo=(Pt,L,at,xt,kt)=>{let Lt=Pt.transform,le=qo(L,Lt);return{u_matrix:Po(Pt,L,at,kt),u_texsize:L.imageAtlasTexture.size,u_ratio:1/dn(L,1,Lt.zoom),u_device_pixel_ratio:Pt.pixelRatio,u_image:0,u_scale:[le,xt.fromScale,xt.toScale],u_fade:xt.t,u_units_to_pixels:[1/Lt.pixelsToGLUnits[0],1/Lt.pixelsToGLUnits[1]]}},qi=(Pt,L,at,xt,kt,Lt)=>{let le=Pt.lineAtlas,xe=qo(L,Pt.transform),Pe=at.layout.get("line-cap")==="round",$e=le.getDash(xt.from,Pe),hr=le.getDash(xt.to,Pe),pr=$e.width*kt.fromScale,Br=hr.width*kt.toScale;return e.e(Ho(Pt,L,at,Lt),{u_patternscale_a:[xe/pr,-$e.height/2],u_patternscale_b:[xe/Br,-hr.height/2],u_sdfgamma:le.width/(256*Math.min(pr,Br)*Pt.pixelRatio)/2,u_image:0,u_tex_y_a:$e.y,u_tex_y_b:hr.y,u_mix:kt.t})};function qo(Pt,L){return 1/dn(Pt,1,L.tileZoom)}function Po(Pt,L,at,xt){return Pt.translatePosMatrix(xt?xt.posMatrix:L.tileID.posMatrix,L,at.paint.get("line-translate"),at.paint.get("line-translate-anchor"))}let hs=(Pt,L,at,xt,kt)=>{return{u_matrix:Pt,u_tl_parent:L,u_scale_parent:at,u_buffer_scale:1,u_fade_t:xt.mix,u_opacity:xt.opacity*kt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:kt.paint.get("raster-brightness-min"),u_brightness_high:kt.paint.get("raster-brightness-max"),u_saturation_factor:(le=kt.paint.get("raster-saturation"),le>0?1-1/(1.001-le):-le),u_contrast_factor:(Lt=kt.paint.get("raster-contrast"),Lt>0?1/(1-Lt):1+Lt),u_spin_weights:Gi(kt.paint.get("raster-hue-rotate"))};var Lt,le};function Gi(Pt){Pt*=Math.PI/180;let L=Math.sin(Pt),at=Math.cos(Pt);return[(2*at+1)/3,(-Math.sqrt(3)*L-at+1)/3,(Math.sqrt(3)*L-at+1)/3]}let uo=(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr)=>{let Rt=le.transform;return{u_is_size_zoom_constant:+(Pt==="constant"||Pt==="source"),u_is_size_feature_constant:+(Pt==="constant"||Pt==="camera"),u_size_t:L?L.uSizeT:0,u_size:L?L.uSize:0,u_camera_to_center_distance:Rt.cameraToCenterDistance,u_pitch:Rt.pitch/360*2*Math.PI,u_rotate_symbol:+at,u_aspect_ratio:Rt.width/Rt.height,u_fade_change:le.options.fadeDuration?le.symbolFadeChange:1,u_matrix:xe,u_label_plane_matrix:Pe,u_coord_matrix:$e,u_is_text:+pr,u_pitch_with_map:+xt,u_is_along_line:kt,u_is_variable_anchor:Lt,u_texsize:Br,u_texture:0,u_translation:hr,u_pitched_scale:Jr}},yi=(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt)=>{let Gt=le.transform;return e.e(uo(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Rt),{u_gamma_scale:xt?Math.cos(Gt._pitch)*Gt.cameraToCenterDistance:1,u_device_pixel_ratio:le.pixelRatio,u_is_halo:1})},ao=(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr)=>e.e(yi(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e,hr,!0,pr,!0,Jr),{u_texsize_icon:Br,u_texture_icon:1}),ts=(Pt,L,at)=>({u_matrix:Pt,u_opacity:L,u_color:at}),vs=(Pt,L,at,xt,kt,Lt)=>e.e((function(le,xe,Pe,$e){let hr=Pe.imageManager.getPattern(le.from.toString()),pr=Pe.imageManager.getPattern(le.to.toString()),{width:Br,height:Jr}=Pe.imageManager.getPixelSize(),Rt=Math.pow(2,$e.tileID.overscaledZ),Gt=$e.tileSize*Math.pow(2,Pe.transform.tileZoom)/Rt,ae=Gt*($e.tileID.canonical.x+$e.tileID.wrap*Rt),ce=Gt*$e.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:hr.tl,u_pattern_br_a:hr.br,u_pattern_tl_b:pr.tl,u_pattern_br_b:pr.br,u_texsize:[Br,Jr],u_mix:xe.t,u_pattern_size_a:hr.displaySize,u_pattern_size_b:pr.displaySize,u_scale_a:xe.fromScale,u_scale_b:xe.toScale,u_tile_units_to_pixels:1/dn($e,1,Pe.transform.tileZoom),u_pixel_coord_upper:[ae>>16,ce>>16],u_pixel_coord_lower:[65535&ae,65535&ce]}})(xt,Lt,at,kt),{u_matrix:Pt,u_opacity:L}),As={fillExtrusion:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_lightpos:new e.aN(Pt,L.u_lightpos),u_lightintensity:new e.aI(Pt,L.u_lightintensity),u_lightcolor:new e.aN(Pt,L.u_lightcolor),u_vertical_gradient:new e.aI(Pt,L.u_vertical_gradient),u_opacity:new e.aI(Pt,L.u_opacity)}),fillExtrusionPattern:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_lightpos:new e.aN(Pt,L.u_lightpos),u_lightintensity:new e.aI(Pt,L.u_lightintensity),u_lightcolor:new e.aN(Pt,L.u_lightcolor),u_vertical_gradient:new e.aI(Pt,L.u_vertical_gradient),u_height_factor:new e.aI(Pt,L.u_height_factor),u_image:new e.aH(Pt,L.u_image),u_texsize:new e.aO(Pt,L.u_texsize),u_pixel_coord_upper:new e.aO(Pt,L.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,L.u_pixel_coord_lower),u_scale:new e.aN(Pt,L.u_scale),u_fade:new e.aI(Pt,L.u_fade),u_opacity:new e.aI(Pt,L.u_opacity)}),fill:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix)}),fillPattern:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_image:new e.aH(Pt,L.u_image),u_texsize:new e.aO(Pt,L.u_texsize),u_pixel_coord_upper:new e.aO(Pt,L.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,L.u_pixel_coord_lower),u_scale:new e.aN(Pt,L.u_scale),u_fade:new e.aI(Pt,L.u_fade)}),fillOutline:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_world:new e.aO(Pt,L.u_world)}),fillOutlinePattern:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_world:new e.aO(Pt,L.u_world),u_image:new e.aH(Pt,L.u_image),u_texsize:new e.aO(Pt,L.u_texsize),u_pixel_coord_upper:new e.aO(Pt,L.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,L.u_pixel_coord_lower),u_scale:new e.aN(Pt,L.u_scale),u_fade:new e.aI(Pt,L.u_fade)}),circle:(Pt,L)=>({u_camera_to_center_distance:new e.aI(Pt,L.u_camera_to_center_distance),u_scale_with_map:new e.aH(Pt,L.u_scale_with_map),u_pitch_with_map:new e.aH(Pt,L.u_pitch_with_map),u_extrude_scale:new e.aO(Pt,L.u_extrude_scale),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_matrix:new e.aJ(Pt,L.u_matrix)}),collisionBox:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_pixel_extrude_scale:new e.aO(Pt,L.u_pixel_extrude_scale)}),collisionCircle:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_inv_matrix:new e.aJ(Pt,L.u_inv_matrix),u_camera_to_center_distance:new e.aI(Pt,L.u_camera_to_center_distance),u_viewport_size:new e.aO(Pt,L.u_viewport_size)}),debug:(Pt,L)=>({u_color:new e.aL(Pt,L.u_color),u_matrix:new e.aJ(Pt,L.u_matrix),u_overlay:new e.aH(Pt,L.u_overlay),u_overlay_scale:new e.aI(Pt,L.u_overlay_scale)}),clippingMask:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix)}),heatmap:(Pt,L)=>({u_extrude_scale:new e.aI(Pt,L.u_extrude_scale),u_intensity:new e.aI(Pt,L.u_intensity),u_matrix:new e.aJ(Pt,L.u_matrix)}),heatmapTexture:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_world:new e.aO(Pt,L.u_world),u_image:new e.aH(Pt,L.u_image),u_color_ramp:new e.aH(Pt,L.u_color_ramp),u_opacity:new e.aI(Pt,L.u_opacity)}),hillshade:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_image:new e.aH(Pt,L.u_image),u_latrange:new e.aO(Pt,L.u_latrange),u_light:new e.aO(Pt,L.u_light),u_shadow:new e.aL(Pt,L.u_shadow),u_highlight:new e.aL(Pt,L.u_highlight),u_accent:new e.aL(Pt,L.u_accent)}),hillshadePrepare:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_image:new e.aH(Pt,L.u_image),u_dimension:new e.aO(Pt,L.u_dimension),u_zoom:new e.aI(Pt,L.u_zoom),u_unpack:new e.aK(Pt,L.u_unpack)}),line:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_ratio:new e.aI(Pt,L.u_ratio),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,L.u_units_to_pixels)}),lineGradient:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_ratio:new e.aI(Pt,L.u_ratio),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,L.u_units_to_pixels),u_image:new e.aH(Pt,L.u_image),u_image_height:new e.aI(Pt,L.u_image_height)}),linePattern:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_texsize:new e.aO(Pt,L.u_texsize),u_ratio:new e.aI(Pt,L.u_ratio),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_image:new e.aH(Pt,L.u_image),u_units_to_pixels:new e.aO(Pt,L.u_units_to_pixels),u_scale:new e.aN(Pt,L.u_scale),u_fade:new e.aI(Pt,L.u_fade)}),lineSDF:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_ratio:new e.aI(Pt,L.u_ratio),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,L.u_units_to_pixels),u_patternscale_a:new e.aO(Pt,L.u_patternscale_a),u_patternscale_b:new e.aO(Pt,L.u_patternscale_b),u_sdfgamma:new e.aI(Pt,L.u_sdfgamma),u_image:new e.aH(Pt,L.u_image),u_tex_y_a:new e.aI(Pt,L.u_tex_y_a),u_tex_y_b:new e.aI(Pt,L.u_tex_y_b),u_mix:new e.aI(Pt,L.u_mix)}),raster:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_tl_parent:new e.aO(Pt,L.u_tl_parent),u_scale_parent:new e.aI(Pt,L.u_scale_parent),u_buffer_scale:new e.aI(Pt,L.u_buffer_scale),u_fade_t:new e.aI(Pt,L.u_fade_t),u_opacity:new e.aI(Pt,L.u_opacity),u_image0:new e.aH(Pt,L.u_image0),u_image1:new e.aH(Pt,L.u_image1),u_brightness_low:new e.aI(Pt,L.u_brightness_low),u_brightness_high:new e.aI(Pt,L.u_brightness_high),u_saturation_factor:new e.aI(Pt,L.u_saturation_factor),u_contrast_factor:new e.aI(Pt,L.u_contrast_factor),u_spin_weights:new e.aN(Pt,L.u_spin_weights)}),symbolIcon:(Pt,L)=>({u_is_size_zoom_constant:new e.aH(Pt,L.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,L.u_is_size_feature_constant),u_size_t:new e.aI(Pt,L.u_size_t),u_size:new e.aI(Pt,L.u_size),u_camera_to_center_distance:new e.aI(Pt,L.u_camera_to_center_distance),u_pitch:new e.aI(Pt,L.u_pitch),u_rotate_symbol:new e.aH(Pt,L.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,L.u_aspect_ratio),u_fade_change:new e.aI(Pt,L.u_fade_change),u_matrix:new e.aJ(Pt,L.u_matrix),u_label_plane_matrix:new e.aJ(Pt,L.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,L.u_coord_matrix),u_is_text:new e.aH(Pt,L.u_is_text),u_pitch_with_map:new e.aH(Pt,L.u_pitch_with_map),u_is_along_line:new e.aH(Pt,L.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,L.u_is_variable_anchor),u_texsize:new e.aO(Pt,L.u_texsize),u_texture:new e.aH(Pt,L.u_texture),u_translation:new e.aO(Pt,L.u_translation),u_pitched_scale:new e.aI(Pt,L.u_pitched_scale)}),symbolSDF:(Pt,L)=>({u_is_size_zoom_constant:new e.aH(Pt,L.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,L.u_is_size_feature_constant),u_size_t:new e.aI(Pt,L.u_size_t),u_size:new e.aI(Pt,L.u_size),u_camera_to_center_distance:new e.aI(Pt,L.u_camera_to_center_distance),u_pitch:new e.aI(Pt,L.u_pitch),u_rotate_symbol:new e.aH(Pt,L.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,L.u_aspect_ratio),u_fade_change:new e.aI(Pt,L.u_fade_change),u_matrix:new e.aJ(Pt,L.u_matrix),u_label_plane_matrix:new e.aJ(Pt,L.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,L.u_coord_matrix),u_is_text:new e.aH(Pt,L.u_is_text),u_pitch_with_map:new e.aH(Pt,L.u_pitch_with_map),u_is_along_line:new e.aH(Pt,L.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,L.u_is_variable_anchor),u_texsize:new e.aO(Pt,L.u_texsize),u_texture:new e.aH(Pt,L.u_texture),u_gamma_scale:new e.aI(Pt,L.u_gamma_scale),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_is_halo:new e.aH(Pt,L.u_is_halo),u_translation:new e.aO(Pt,L.u_translation),u_pitched_scale:new e.aI(Pt,L.u_pitched_scale)}),symbolTextAndIcon:(Pt,L)=>({u_is_size_zoom_constant:new e.aH(Pt,L.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,L.u_is_size_feature_constant),u_size_t:new e.aI(Pt,L.u_size_t),u_size:new e.aI(Pt,L.u_size),u_camera_to_center_distance:new e.aI(Pt,L.u_camera_to_center_distance),u_pitch:new e.aI(Pt,L.u_pitch),u_rotate_symbol:new e.aH(Pt,L.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,L.u_aspect_ratio),u_fade_change:new e.aI(Pt,L.u_fade_change),u_matrix:new e.aJ(Pt,L.u_matrix),u_label_plane_matrix:new e.aJ(Pt,L.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,L.u_coord_matrix),u_is_text:new e.aH(Pt,L.u_is_text),u_pitch_with_map:new e.aH(Pt,L.u_pitch_with_map),u_is_along_line:new e.aH(Pt,L.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,L.u_is_variable_anchor),u_texsize:new e.aO(Pt,L.u_texsize),u_texsize_icon:new e.aO(Pt,L.u_texsize_icon),u_texture:new e.aH(Pt,L.u_texture),u_texture_icon:new e.aH(Pt,L.u_texture_icon),u_gamma_scale:new e.aI(Pt,L.u_gamma_scale),u_device_pixel_ratio:new e.aI(Pt,L.u_device_pixel_ratio),u_is_halo:new e.aH(Pt,L.u_is_halo),u_translation:new e.aO(Pt,L.u_translation),u_pitched_scale:new e.aI(Pt,L.u_pitched_scale)}),background:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_opacity:new e.aI(Pt,L.u_opacity),u_color:new e.aL(Pt,L.u_color)}),backgroundPattern:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_opacity:new e.aI(Pt,L.u_opacity),u_image:new e.aH(Pt,L.u_image),u_pattern_tl_a:new e.aO(Pt,L.u_pattern_tl_a),u_pattern_br_a:new e.aO(Pt,L.u_pattern_br_a),u_pattern_tl_b:new e.aO(Pt,L.u_pattern_tl_b),u_pattern_br_b:new e.aO(Pt,L.u_pattern_br_b),u_texsize:new e.aO(Pt,L.u_texsize),u_mix:new e.aI(Pt,L.u_mix),u_pattern_size_a:new e.aO(Pt,L.u_pattern_size_a),u_pattern_size_b:new e.aO(Pt,L.u_pattern_size_b),u_scale_a:new e.aI(Pt,L.u_scale_a),u_scale_b:new e.aI(Pt,L.u_scale_b),u_pixel_coord_upper:new e.aO(Pt,L.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,L.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(Pt,L.u_tile_units_to_pixels)}),terrain:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_texture:new e.aH(Pt,L.u_texture),u_ele_delta:new e.aI(Pt,L.u_ele_delta),u_fog_matrix:new e.aJ(Pt,L.u_fog_matrix),u_fog_color:new e.aL(Pt,L.u_fog_color),u_fog_ground_blend:new e.aI(Pt,L.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(Pt,L.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(Pt,L.u_horizon_color),u_horizon_fog_blend:new e.aI(Pt,L.u_horizon_fog_blend)}),terrainDepth:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_ele_delta:new e.aI(Pt,L.u_ele_delta)}),terrainCoords:(Pt,L)=>({u_matrix:new e.aJ(Pt,L.u_matrix),u_texture:new e.aH(Pt,L.u_texture),u_terrain_coords_id:new e.aI(Pt,L.u_terrain_coords_id),u_ele_delta:new e.aI(Pt,L.u_ele_delta)}),sky:(Pt,L)=>({u_sky_color:new e.aL(Pt,L.u_sky_color),u_horizon_color:new e.aL(Pt,L.u_horizon_color),u_horizon:new e.aI(Pt,L.u_horizon),u_sky_horizon_blend:new e.aI(Pt,L.u_sky_horizon_blend)})};class _o{constructor(L,at,xt){this.context=L;let kt=L.gl;this.buffer=kt.createBuffer(),this.dynamicDraw=!!xt,this.context.unbindVAO(),L.bindElementBuffer.set(this.buffer),kt.bufferData(kt.ELEMENT_ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?kt.DYNAMIC_DRAW:kt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(L){let at=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),at.bufferSubData(at.ELEMENT_ARRAY_BUFFER,0,L.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Da={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class li{constructor(L,at,xt,kt){this.length=at.length,this.attributes=xt,this.itemSize=at.bytesPerElement,this.dynamicDraw=kt,this.context=L;let Lt=L.gl;this.buffer=Lt.createBuffer(),L.bindVertexBuffer.set(this.buffer),Lt.bufferData(Lt.ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?Lt.DYNAMIC_DRAW:Lt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(L){if(L.length!==this.length)throw new Error(`Length of new data is ${L.length}, which doesn't match current length of ${this.length}`);let at=this.context.gl;this.bind(),at.bufferSubData(at.ARRAY_BUFFER,0,L.arrayBuffer)}enableAttributes(L,at){for(let xt=0;xt0){let fr=e.H();e.aQ(fr,ye.placementInvProjMatrix,Pt.transform.glCoordMatrix),e.aQ(fr,fr,ye.placementViewportMatrix),Pe.push({circleArray:rr,circleOffset:hr,transform:Te.posMatrix,invTransform:fr,coord:Te}),$e+=rr.length/4,hr=$e}ze&&xe.draw(Lt,le.LINES,Oo.disabled,os.disabled,Pt.colorModeForRenderPass(),Fi.disabled,{u_matrix:Te.posMatrix,u_pixel_extrude_scale:[1/(pr=Pt.transform).width,1/pr.height]},Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Te),at.id,ze.layoutVertexBuffer,ze.indexBuffer,ze.segments,null,Pt.transform.zoom,null,null,ze.collisionVertexBuffer)}var pr;if(!kt||!Pe.length)return;let Br=Pt.useProgram("collisionCircle"),Jr=new e.aR;Jr.resize(4*$e),Jr._trim();let Rt=0;for(let ce of Pe)for(let Te=0;Te=0&&(ce[ye.associatedIconIndex]={shiftedAnchor:ai,angle:Ai})}else ar(ye.numGlyphs,Gt)}if($e){ae.clear();let Te=Pt.icon.placedSymbolArray;for(let ye=0;yePt.style.map.terrain.getElevation(cn,on,ta):null,an=at.layout.get("text-rotation-alignment")==="map";_t(Jn,cn.posMatrix,Pt,kt,Sl,gt,ce,$e,an,Gt,cn.toUnwrapped(),Rt.width,Rt.height,Et,Wr)}let me=cn.posMatrix,we=kt&&Lr||fe,Ve=Te||we?ml:Sl,je=tu,or=La&&at.paint.get(kt?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Cr;Cr=La?Jn.iconsInText?ao(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,Xo,Us,nn):yi(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,kt,Xo,!0,nn):uo(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,kt,Xo,nn);let Sr={program:mi,buffers:_a,uniformValues:Cr,atlasTexture:po,atlasTextureIcon:To,atlasInterpolation:Qo,atlasInterpolationIcon:Js,isSDF:La,hasHalo:or};if(rr&&Jn.canOverlap){fr=!0;let Wr=_a.segments.get();for(let an of Wr)Hr.push({segments:new e.a0([an]),sortKey:an.sortKey,state:Sr,terrainData:Go})}else Hr.push({segments:_a.segments,sortKey:0,state:Sr,terrainData:Go})}fr&&Hr.sort((cn,Mn)=>cn.sortKey-Mn.sortKey);for(let cn of Hr){let Mn=cn.state;if(Br.activeTexture.set(Jr.TEXTURE0),Mn.atlasTexture.bind(Mn.atlasInterpolation,Jr.CLAMP_TO_EDGE),Mn.atlasTextureIcon&&(Br.activeTexture.set(Jr.TEXTURE1),Mn.atlasTextureIcon&&Mn.atlasTextureIcon.bind(Mn.atlasInterpolationIcon,Jr.CLAMP_TO_EDGE)),Mn.isSDF){let Jn=Mn.uniformValues;Mn.hasHalo&&(Jn.u_is_halo=1,Fc(Mn.buffers,cn.segments,at,Pt,Mn.program,gr,hr,pr,Jn,cn.terrainData)),Jn.u_is_halo=0}Fc(Mn.buffers,cn.segments,at,Pt,Mn.program,gr,hr,pr,Mn.uniformValues,cn.terrainData)}}function Fc(Pt,L,at,xt,kt,Lt,le,xe,Pe,$e){let hr=xt.context;kt.draw(hr,hr.gl.TRIANGLES,Lt,le,xe,Fi.disabled,Pe,$e,at.id,Pt.layoutVertexBuffer,Pt.indexBuffer,L,at.paint,xt.transform.zoom,Pt.programConfigurations.get(at.id),Pt.dynamicLayoutVertexBuffer,Pt.opacityVertexBuffer)}function mc(Pt,L,at,xt){let kt=Pt.context,Lt=kt.gl,le=os.disabled,xe=new qs([Lt.ONE,Lt.ONE],e.aM.transparent,[!0,!0,!0,!0]),Pe=L.getBucket(at);if(!Pe)return;let $e=xt.key,hr=at.heatmapFbos.get($e);hr||(hr=Cc(kt,L.tileSize,L.tileSize),at.heatmapFbos.set($e,hr)),kt.bindFramebuffer.set(hr.framebuffer),kt.viewport.set([0,0,L.tileSize,L.tileSize]),kt.clear({color:e.aM.transparent});let pr=Pe.programConfigurations.get(at.id),Br=Pt.useProgram("heatmap",pr),Jr=Pt.style.map.terrain.getTerrainData(xt);Br.draw(kt,Lt.TRIANGLES,Oo.disabled,le,xe,Fi.disabled,Ra(xt.posMatrix,L,Pt.transform.zoom,at.paint.get("heatmap-intensity")),Jr,at.id,Pe.layoutVertexBuffer,Pe.indexBuffer,Pe.segments,at.paint,Pt.transform.zoom,pr)}function Wu(Pt,L,at){let xt=Pt.context,kt=xt.gl;xt.setColorMode(Pt.colorModeForRenderPass());let Lt=Ic(xt,L),le=at.key,xe=L.heatmapFbos.get(le);xe&&(xt.activeTexture.set(kt.TEXTURE0),kt.bindTexture(kt.TEXTURE_2D,xe.colorAttachment.get()),xt.activeTexture.set(kt.TEXTURE1),Lt.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),Pt.useProgram("heatmapTexture").draw(xt,kt.TRIANGLES,Oo.disabled,os.disabled,Pt.colorModeForRenderPass(),Fi.disabled,Qi(Pt,L,0,1),null,L.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments,L.paint,Pt.transform.zoom),xe.destroy(),L.heatmapFbos.delete(le))}function Cc(Pt,L,at){var xt,kt;let Lt=Pt.gl,le=Lt.createTexture();Lt.bindTexture(Lt.TEXTURE_2D,le),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_S,Lt.CLAMP_TO_EDGE),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_T,Lt.CLAMP_TO_EDGE),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MIN_FILTER,Lt.LINEAR),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MAG_FILTER,Lt.LINEAR);let xe=(xt=Pt.HALF_FLOAT)!==null&&xt!==void 0?xt:Lt.UNSIGNED_BYTE,Pe=(kt=Pt.RGBA16F)!==null&&kt!==void 0?kt:Lt.RGBA;Lt.texImage2D(Lt.TEXTURE_2D,0,Pe,L,at,0,Lt.RGBA,xe,null);let $e=Pt.createFramebuffer(L,at,!1,!1);return $e.colorAttachment.set(le),$e}function Ic(Pt,L){return L.colorRampTexture||(L.colorRampTexture=new h(Pt,L.colorRamp,Pt.gl.RGBA)),L.colorRampTexture}function du(Pt,L,at,xt,kt){if(!at||!xt||!xt.imageAtlas)return;let Lt=xt.imageAtlas.patternPositions,le=Lt[at.to.toString()],xe=Lt[at.from.toString()];if(!le&&xe&&(le=xe),!xe&&le&&(xe=le),!le||!xe){let Pe=kt.getPaintProperty(L);le=Lt[Pe],xe=Lt[Pe]}le&&xe&&Pt.setConstantPatternPositions(le,xe)}function Bc(Pt,L,at,xt,kt,Lt,le){let xe=Pt.context.gl,Pe="fill-pattern",$e=at.paint.get(Pe),hr=$e&&$e.constantOr(1),pr=at.getCrossfadeParameters(),Br,Jr,Rt,Gt,ae;le?(Jr=hr&&!at.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Br=xe.LINES):(Jr=hr?"fillPattern":"fill",Br=xe.TRIANGLES);let ce=$e.constantOr(null);for(let Te of xt){let ye=L.getTile(Te);if(hr&&!ye.patternsLoaded())continue;let ze=ye.getBucket(at);if(!ze)continue;let rr=ze.programConfigurations.get(at.id),fr=Pt.useProgram(Jr,rr),gr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Te);hr&&(Pt.context.activeTexture.set(xe.TEXTURE0),ye.imageAtlasTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),rr.updatePaintBuffers(pr)),du(rr,Pe,ce,ye,at);let Lr=gr?Te:null,Hr=Pt.translatePosMatrix(Lr?Lr.posMatrix:Te.posMatrix,ye,at.paint.get("fill-translate"),at.paint.get("fill-translate-anchor"));if(le){Gt=ze.indexBuffer2,ae=ze.segments2;let nn=[xe.drawingBufferWidth,xe.drawingBufferHeight];Rt=Jr==="fillOutlinePattern"&&hr?Qa(Hr,Pt,pr,ye,nn):Qn(Hr,nn)}else Gt=ze.indexBuffer,ae=ze.segments,Rt=hr?Oa(Hr,Pt,pr,ye):vn(Hr);fr.draw(Pt.context,Br,kt,Pt.stencilModeForClipping(Te),Lt,Fi.disabled,Rt,gr,at.id,ze.layoutVertexBuffer,Gt,ae,at.paint,Pt.transform.zoom,rr)}}function Pu(Pt,L,at,xt,kt,Lt,le){let xe=Pt.context,Pe=xe.gl,$e="fill-extrusion-pattern",hr=at.paint.get($e),pr=hr.constantOr(1),Br=at.getCrossfadeParameters(),Jr=at.paint.get("fill-extrusion-opacity"),Rt=hr.constantOr(null);for(let Gt of xt){let ae=L.getTile(Gt),ce=ae.getBucket(at);if(!ce)continue;let Te=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Gt),ye=ce.programConfigurations.get(at.id),ze=Pt.useProgram(pr?"fillExtrusionPattern":"fillExtrusion",ye);pr&&(Pt.context.activeTexture.set(Pe.TEXTURE0),ae.imageAtlasTexture.bind(Pe.LINEAR,Pe.CLAMP_TO_EDGE),ye.updatePaintBuffers(Br)),du(ye,$e,Rt,ae,at);let rr=Pt.translatePosMatrix(Gt.posMatrix,ae,at.paint.get("fill-extrusion-translate"),at.paint.get("fill-extrusion-translate-anchor")),fr=at.paint.get("fill-extrusion-vertical-gradient"),gr=pr?Qr(rr,Pt,fr,Jr,Gt,Br,ae):rn(rr,Pt,fr,Jr);ze.draw(xe,xe.gl.TRIANGLES,kt,Lt,le,Fi.backCCW,gr,Te,at.id,ce.layoutVertexBuffer,ce.indexBuffer,ce.segments,at.paint,Pt.transform.zoom,ye,Pt.style.map.terrain&&ce.centroidVertexBuffer)}}function wu(Pt,L,at,xt,kt,Lt,le){let xe=Pt.context,Pe=xe.gl,$e=at.fbo;if(!$e)return;let hr=Pt.useProgram("hillshade"),pr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(L);xe.activeTexture.set(Pe.TEXTURE0),Pe.bindTexture(Pe.TEXTURE_2D,$e.colorAttachment.get()),hr.draw(xe,Pe.TRIANGLES,kt,Lt,le,Fi.disabled,((Br,Jr,Rt,Gt)=>{let ae=Rt.paint.get("hillshade-shadow-color"),ce=Rt.paint.get("hillshade-highlight-color"),Te=Rt.paint.get("hillshade-accent-color"),ye=Rt.paint.get("hillshade-illumination-direction")*(Math.PI/180);Rt.paint.get("hillshade-illumination-anchor")==="viewport"&&(ye-=Br.transform.angle);let ze=!Br.options.moving;return{u_matrix:Gt?Gt.posMatrix:Br.transform.calculatePosMatrix(Jr.tileID.toUnwrapped(),ze),u_image:0,u_latrange:Hi(0,Jr.tileID),u_light:[Rt.paint.get("hillshade-exaggeration"),ye],u_shadow:ae,u_highlight:ce,u_accent:Te}})(Pt,at,xt,pr?L:null),pr,xt.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments)}function Tl(Pt,L,at,xt,kt,Lt){let le=Pt.context,xe=le.gl,Pe=L.dem;if(Pe&&Pe.data){let $e=Pe.dim,hr=Pe.stride,pr=Pe.getPixels();if(le.activeTexture.set(xe.TEXTURE1),le.pixelStoreUnpackPremultiplyAlpha.set(!1),L.demTexture=L.demTexture||Pt.getTileTexture(hr),L.demTexture){let Jr=L.demTexture;Jr.update(pr,{premultiply:!1}),Jr.bind(xe.NEAREST,xe.CLAMP_TO_EDGE)}else L.demTexture=new h(le,pr,xe.RGBA,{premultiply:!1}),L.demTexture.bind(xe.NEAREST,xe.CLAMP_TO_EDGE);le.activeTexture.set(xe.TEXTURE0);let Br=L.fbo;if(!Br){let Jr=new h(le,{width:$e,height:$e,data:null},xe.RGBA);Jr.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),Br=L.fbo=le.createFramebuffer($e,$e,!0,!1),Br.colorAttachment.set(Jr.texture)}le.bindFramebuffer.set(Br.framebuffer),le.viewport.set([0,0,$e,$e]),Pt.useProgram("hillshadePrepare").draw(le,xe.TRIANGLES,xt,kt,Lt,Fi.disabled,((Jr,Rt)=>{let Gt=Rt.stride,ae=e.H();return e.aP(ae,0,e.X,-e.X,0,0,1),e.J(ae,ae,[0,-e.X,0]),{u_matrix:ae,u_image:1,u_dimension:[Gt,Gt],u_zoom:Jr.overscaledZ,u_unpack:Rt.getUnpackVector()}})(L.tileID,Pe),null,at.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments),L.needsHillshadePrepare=!1}}function Ju(Pt,L,at,xt,kt,Lt){let le=xt.paint.get("raster-fade-duration");if(!Lt&&le>0){let xe=o.now(),Pe=(xe-Pt.timeAdded)/le,$e=L?(xe-L.timeAdded)/le:-1,hr=at.getSource(),pr=kt.coveringZoomLevel({tileSize:hr.tileSize,roundZoom:hr.roundZoom}),Br=!L||Math.abs(L.tileID.overscaledZ-pr)>Math.abs(Pt.tileID.overscaledZ-pr),Jr=Br&&Pt.refreshedUponExpiration?1:e.ac(Br?Pe:1-$e,0,1);return Pt.refreshedUponExpiration&&Pe>=1&&(Pt.refreshedUponExpiration=!1),L?{opacity:1,mix:1-Jr}:{opacity:Jr,mix:0}}return{opacity:1,mix:0}}let Pc=new e.aM(1,0,0,1),Es=new e.aM(0,1,0,1),_c=new e.aM(0,0,1,1),lf=new e.aM(1,0,1,1),Rc=new e.aM(0,1,1,1);function gc(Pt,L,at,xt){Zl(Pt,0,L+at/2,Pt.transform.width,at,xt)}function Nc(Pt,L,at,xt){Zl(Pt,L-at/2,0,at,Pt.transform.height,xt)}function Zl(Pt,L,at,xt,kt,Lt){let le=Pt.context,xe=le.gl;xe.enable(xe.SCISSOR_TEST),xe.scissor(L*Pt.pixelRatio,at*Pt.pixelRatio,xt*Pt.pixelRatio,kt*Pt.pixelRatio),le.clear({color:Lt}),xe.disable(xe.SCISSOR_TEST)}function jc(Pt,L,at){let xt=Pt.context,kt=xt.gl,Lt=at.posMatrix,le=Pt.useProgram("debug"),xe=Oo.disabled,Pe=os.disabled,$e=Pt.colorModeForRenderPass(),hr="$debug",pr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(at);xt.activeTexture.set(kt.TEXTURE0);let Br=L.getTileByID(at.key).latestRawTileData,Jr=Math.floor((Br&&Br.byteLength||0)/1024),Rt=L.getTile(at).tileSize,Gt=512/Math.min(Rt,512)*(at.overscaledZ/Pt.transform.zoom)*.5,ae=at.canonical.toString();at.overscaledZ!==at.canonical.z&&(ae+=` => ${at.overscaledZ}`),(function(ce,Te){ce.initDebugOverlayCanvas();let ye=ce.debugOverlayCanvas,ze=ce.context.gl,rr=ce.debugOverlayCanvas.getContext("2d");rr.clearRect(0,0,ye.width,ye.height),rr.shadowColor="white",rr.shadowBlur=2,rr.lineWidth=1.5,rr.strokeStyle="white",rr.textBaseline="top",rr.font="bold 36px Open Sans, sans-serif",rr.fillText(Te,5,5),rr.strokeText(Te,5,5),ce.debugOverlayTexture.update(ye),ce.debugOverlayTexture.bind(ze.LINEAR,ze.CLAMP_TO_EDGE)})(Pt,`${ae} ${Jr}kB`),le.draw(xt,kt.TRIANGLES,xe,Pe,qs.alphaBlended,Fi.disabled,ci(Lt,e.aM.transparent,Gt),null,hr,Pt.debugBuffer,Pt.quadTriangleIndexBuffer,Pt.debugSegments),le.draw(xt,kt.LINE_STRIP,xe,Pe,$e,Fi.disabled,ci(Lt,e.aM.red),pr,hr,Pt.debugBuffer,Pt.tileBorderIndexBuffer,Pt.debugSegments)}function rl(Pt,L,at){let xt=Pt.context,kt=xt.gl,Lt=Pt.colorModeForRenderPass(),le=new Oo(kt.LEQUAL,Oo.ReadWrite,Pt.depthRangeFor3D),xe=Pt.useProgram("terrain"),Pe=L.getTerrainMesh();xt.bindFramebuffer.set(null),xt.viewport.set([0,0,Pt.width,Pt.height]);for(let $e of at){let hr=Pt.renderToTexture.getTexture($e),pr=L.getTerrainData($e.tileID);xt.activeTexture.set(kt.TEXTURE0),kt.bindTexture(kt.TEXTURE_2D,hr.texture);let Br=Pt.transform.calculatePosMatrix($e.tileID.toUnwrapped()),Jr=L.getMeshFrameDelta(Pt.transform.zoom),Rt=Pt.transform.calculateFogMatrix($e.tileID.toUnwrapped()),Gt=xr(Br,Jr,Rt,Pt.style.sky,Pt.transform.pitch);xe.draw(xt,kt.TRIANGLES,le,os.disabled,Lt,Fi.backCCW,Gt,pr,"terrain",Pe.vertexBuffer,Pe.indexBuffer,Pe.segments)}}class Kl{constructor(L,at,xt){this.vertexBuffer=L,this.indexBuffer=at,this.segments=xt}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Gu{constructor(L,at){this.context=new sf(L),this.transform=at,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ce.maxUnderzooming+Ce.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new br}resize(L,at,xt){if(this.width=Math.floor(L*xt),this.height=Math.floor(at*xt),this.pixelRatio=xt,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let kt of this.style._order)this.style._layers[kt].resize()}setup(){let L=this.context,at=new e.aX;at.emplaceBack(0,0),at.emplaceBack(e.X,0),at.emplaceBack(0,e.X),at.emplaceBack(e.X,e.X),this.tileExtentBuffer=L.createVertexBuffer(at,Ur.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let xt=new e.aX;xt.emplaceBack(0,0),xt.emplaceBack(e.X,0),xt.emplaceBack(0,e.X),xt.emplaceBack(e.X,e.X),this.debugBuffer=L.createVertexBuffer(xt,Ur.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let kt=new e.$;kt.emplaceBack(0,0,0,0),kt.emplaceBack(e.X,0,e.X,0),kt.emplaceBack(0,e.X,0,e.X),kt.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=L.createVertexBuffer(kt,Nt.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let Lt=new e.aX;Lt.emplaceBack(0,0),Lt.emplaceBack(1,0),Lt.emplaceBack(0,1),Lt.emplaceBack(1,1),this.viewportBuffer=L.createVertexBuffer(Lt,Ur.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let le=new e.aZ;le.emplaceBack(0),le.emplaceBack(1),le.emplaceBack(3),le.emplaceBack(2),le.emplaceBack(0),this.tileBorderIndexBuffer=L.createIndexBuffer(le);let xe=new e.aY;xe.emplaceBack(0,1,2),xe.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=L.createIndexBuffer(xe);let Pe=this.context.gl;this.stencilClearMode=new os({func:Pe.ALWAYS,mask:0},0,255,Pe.ZERO,Pe.ZERO,Pe.ZERO)}clearStencil(){let L=this.context,at=L.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let xt=e.H();e.aP(xt,0,this.width,this.height,0,0,1),e.K(xt,xt,[at.drawingBufferWidth,at.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(L,at.TRIANGLES,Oo.disabled,this.stencilClearMode,qs.disabled,Fi.disabled,Ti(xt),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(L,at){if(this.currentStencilSource===L.source||!L.isTileClipped()||!at||!at.length)return;this.currentStencilSource=L.source;let xt=this.context,kt=xt.gl;this.nextStencilID+at.length>256&&this.clearStencil(),xt.setColorMode(qs.disabled),xt.setDepthMode(Oo.disabled);let Lt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let le of at){let xe=this._tileClippingMaskIDs[le.key]=this.nextStencilID++,Pe=this.style.map.terrain&&this.style.map.terrain.getTerrainData(le);Lt.draw(xt,kt.TRIANGLES,Oo.disabled,new os({func:kt.ALWAYS,mask:0},xe,255,kt.KEEP,kt.KEEP,kt.REPLACE),qs.disabled,Fi.disabled,Ti(le.posMatrix),Pe,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let L=this.nextStencilID++,at=this.context.gl;return new os({func:at.NOTEQUAL,mask:255},L,255,at.KEEP,at.KEEP,at.REPLACE)}stencilModeForClipping(L){let at=this.context.gl;return new os({func:at.EQUAL,mask:255},this._tileClippingMaskIDs[L.key],0,at.KEEP,at.KEEP,at.REPLACE)}stencilConfigForOverlap(L){let at=this.context.gl,xt=L.sort((le,xe)=>xe.overscaledZ-le.overscaledZ),kt=xt[xt.length-1].overscaledZ,Lt=xt[0].overscaledZ-kt+1;if(Lt>1){this.currentStencilSource=void 0,this.nextStencilID+Lt>256&&this.clearStencil();let le={};for(let xe=0;xe({u_sky_color:ce.properties.get("sky-color"),u_horizon_color:ce.properties.get("horizon-color"),u_horizon:(Te.height/2+Te.getHorizon())*ye,u_sky_horizon_blend:ce.properties.get("sky-horizon-blend")*Te.height/2*ye}))($e,Pe.style.map.transform,Pe.pixelRatio),Jr=new Oo(pr.LEQUAL,Oo.ReadWrite,[0,1]),Rt=os.disabled,Gt=Pe.colorModeForRenderPass(),ae=Pe.useProgram("sky");if(!$e.mesh){let ce=new e.aX;ce.emplaceBack(-1,-1),ce.emplaceBack(1,-1),ce.emplaceBack(1,1),ce.emplaceBack(-1,1);let Te=new e.aY;Te.emplaceBack(0,1,2),Te.emplaceBack(0,2,3),$e.mesh=new Kl(hr.createVertexBuffer(ce,Ur.members),hr.createIndexBuffer(Te),e.a0.simpleSegment(0,0,ce.length,Te.length))}ae.draw(hr,pr.TRIANGLES,Jr,Rt,Gt,Fi.disabled,Br,void 0,"sky",$e.mesh.vertexBuffer,$e.mesh.indexBuffer,$e.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=at.showOverdrawInspector,this.depthRangeFor3D=[0,1-(L._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=xt.length-1;this.currentLayer>=0;this.currentLayer--){let Pe=this.style._layers[xt[this.currentLayer]],$e=kt[Pe.source],hr=Lt[Pe.source];this._renderTileClippingMasks(Pe,hr),this.renderLayer(this,$e,Pe,hr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerae.source&&!ae.isHidden(hr)?[$e.sourceCaches[ae.source]]:[]),Jr=Br.filter(ae=>ae.getSource().type==="vector"),Rt=Br.filter(ae=>ae.getSource().type!=="vector"),Gt=ae=>{(!pr||pr.getSource().maxzoomGt(ae)),pr||Rt.forEach(ae=>Gt(ae)),pr})(this.style,this.transform.zoom);Pe&&(function($e,hr,pr){for(let Br=0;Br0),kt&&(e.b0(at,xt),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Lt,le){let xe=Lt.context,Pe=xe.gl,$e=qs.unblended,hr=new Oo(Pe.LEQUAL,Oo.ReadWrite,[0,1]),pr=le.getTerrainMesh(),Br=le.sourceCache.getRenderableTiles(),Jr=Lt.useProgram("terrainDepth");xe.bindFramebuffer.set(le.getFramebuffer("depth").framebuffer),xe.viewport.set([0,0,Lt.width/devicePixelRatio,Lt.height/devicePixelRatio]),xe.clear({color:e.aM.transparent,depth:1});for(let Rt of Br){let Gt=le.getTerrainData(Rt.tileID),ae={u_matrix:Lt.transform.calculatePosMatrix(Rt.tileID.toUnwrapped()),u_ele_delta:le.getMeshFrameDelta(Lt.transform.zoom)};Jr.draw(xe,Pe.TRIANGLES,hr,os.disabled,$e,Fi.backCCW,ae,Gt,"terrain",pr.vertexBuffer,pr.indexBuffer,pr.segments)}xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Lt.width,Lt.height])})(this,this.style.map.terrain),(function(Lt,le){let xe=Lt.context,Pe=xe.gl,$e=qs.unblended,hr=new Oo(Pe.LEQUAL,Oo.ReadWrite,[0,1]),pr=le.getTerrainMesh(),Br=le.getCoordsTexture(),Jr=le.sourceCache.getRenderableTiles(),Rt=Lt.useProgram("terrainCoords");xe.bindFramebuffer.set(le.getFramebuffer("coords").framebuffer),xe.viewport.set([0,0,Lt.width/devicePixelRatio,Lt.height/devicePixelRatio]),xe.clear({color:e.aM.transparent,depth:1}),le.coordsIndex=[];for(let Gt of Jr){let ae=le.getTerrainData(Gt.tileID);xe.activeTexture.set(Pe.TEXTURE0),Pe.bindTexture(Pe.TEXTURE_2D,Br.texture);let ce={u_matrix:Lt.transform.calculatePosMatrix(Gt.tileID.toUnwrapped()),u_terrain_coords_id:(255-le.coordsIndex.length)/255,u_texture:0,u_ele_delta:le.getMeshFrameDelta(Lt.transform.zoom)};Rt.draw(xe,Pe.TRIANGLES,hr,os.disabled,$e,Fi.backCCW,ce,ae,"terrain",pr.vertexBuffer,pr.indexBuffer,pr.segments),le.coordsIndex.push(Gt.tileID.key)}xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Lt.width,Lt.height])})(this,this.style.map.terrain))}renderLayer(L,at,xt,kt){if(!xt.isHidden(this.transform.zoom)&&(xt.type==="background"||xt.type==="custom"||(kt||[]).length))switch(this.id=xt.id,xt.type){case"symbol":(function(Lt,le,xe,Pe,$e){if(Lt.renderPass!=="translucent")return;let hr=os.disabled,pr=Lt.colorModeForRenderPass();(xe._unevaluatedLayout.hasValue("text-variable-anchor")||xe._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Br,Jr,Rt,Gt,ae,ce,Te,ye,ze){let rr=Jr.transform,fr=ia(),gr=ae==="map",Lr=ce==="map";for(let Hr of Br){let nn=Gt.getTile(Hr),cn=nn.getBucket(Rt);if(!cn||!cn.text||!cn.text.segments.get().length)continue;let Mn=e.ag(cn.textSizeData,rr.zoom),Jn=dn(nn,1,Jr.transform.zoom),_a=Mr(Hr.posMatrix,Lr,gr,Jr.transform,Jn),xa=Rt.layout.get("icon-text-fit")!=="none"&&cn.hasIconData();if(Mn){let La=Math.pow(2,rr.zoom-nn.tileID.overscaledZ),ai=Jr.style.map.terrain?(mi,Yi)=>Jr.style.map.terrain.getElevation(Hr,mi,Yi):null,Ai=fr.translatePosition(rr,nn,Te,ye);dc(cn,gr,Lr,ze,rr,_a,Hr.posMatrix,La,Mn,xa,fr,Ai,Hr.toUnwrapped(),ai)}}})(Pe,Lt,xe,le,xe.layout.get("text-rotation-alignment"),xe.layout.get("text-pitch-alignment"),xe.paint.get("text-translate"),xe.paint.get("text-translate-anchor"),$e),xe.paint.get("icon-opacity").constantOr(1)!==0&&Yc(Lt,le,xe,Pe,!1,xe.paint.get("icon-translate"),xe.paint.get("icon-translate-anchor"),xe.layout.get("icon-rotation-alignment"),xe.layout.get("icon-pitch-alignment"),xe.layout.get("icon-keep-upright"),hr,pr),xe.paint.get("text-opacity").constantOr(1)!==0&&Yc(Lt,le,xe,Pe,!0,xe.paint.get("text-translate"),xe.paint.get("text-translate-anchor"),xe.layout.get("text-rotation-alignment"),xe.layout.get("text-pitch-alignment"),xe.layout.get("text-keep-upright"),hr,pr),le.map.showCollisionBoxes&&(pu(Lt,le,xe,Pe,!0),pu(Lt,le,xe,Pe,!1))})(L,at,xt,kt,this.style.placement.variableOffsets);break;case"circle":(function(Lt,le,xe,Pe){if(Lt.renderPass!=="translucent")return;let $e=xe.paint.get("circle-opacity"),hr=xe.paint.get("circle-stroke-width"),pr=xe.paint.get("circle-stroke-opacity"),Br=!xe.layout.get("circle-sort-key").isConstant();if($e.constantOr(1)===0&&(hr.constantOr(1)===0||pr.constantOr(1)===0))return;let Jr=Lt.context,Rt=Jr.gl,Gt=Lt.depthModeForSublayer(0,Oo.ReadOnly),ae=os.disabled,ce=Lt.colorModeForRenderPass(),Te=[];for(let ye=0;yeye.sortKey-ze.sortKey);for(let ye of Te){let{programConfiguration:ze,program:rr,layoutVertexBuffer:fr,indexBuffer:gr,uniformValues:Lr,terrainData:Hr}=ye.state;rr.draw(Jr,Rt.TRIANGLES,Gt,ae,ce,Fi.disabled,Lr,Hr,xe.id,fr,gr,ye.segments,xe.paint,Lt.transform.zoom,ze)}})(L,at,xt,kt);break;case"heatmap":(function(Lt,le,xe,Pe){if(xe.paint.get("heatmap-opacity")===0)return;let $e=Lt.context;if(Lt.style.map.terrain){for(let hr of Pe){let pr=le.getTile(hr);le.hasRenderableParent(hr)||(Lt.renderPass==="offscreen"?mc(Lt,pr,xe,hr):Lt.renderPass==="translucent"&&Wu(Lt,xe,hr))}$e.viewport.set([0,0,Lt.width,Lt.height])}else Lt.renderPass==="offscreen"?(function(hr,pr,Br,Jr){let Rt=hr.context,Gt=Rt.gl,ae=os.disabled,ce=new qs([Gt.ONE,Gt.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(Te,ye,ze){let rr=Te.gl;Te.activeTexture.set(rr.TEXTURE1),Te.viewport.set([0,0,ye.width/4,ye.height/4]);let fr=ze.heatmapFbos.get(e.aU);fr?(rr.bindTexture(rr.TEXTURE_2D,fr.colorAttachment.get()),Te.bindFramebuffer.set(fr.framebuffer)):(fr=Cc(Te,ye.width/4,ye.height/4),ze.heatmapFbos.set(e.aU,fr))})(Rt,hr,Br),Rt.clear({color:e.aM.transparent});for(let Te=0;Te20&&hr.texParameterf(hr.TEXTURE_2D,$e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$e.extTextureFilterAnisotropicMax);let cn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(Te),Mn=cn?Te:null,Jn=Mn?Mn.posMatrix:Lt.transform.calculatePosMatrix(Te.toUnwrapped(),ce),_a=hs(Jn,Hr||[0,0],Lr||1,gr,xe);pr instanceof te?Br.draw($e,hr.TRIANGLES,ye,os.disabled,Jr,Fi.disabled,_a,cn,xe.id,pr.boundsBuffer,Lt.quadTriangleIndexBuffer,pr.boundsSegments):Br.draw($e,hr.TRIANGLES,ye,Rt[Te.overscaledZ],Jr,Fi.disabled,_a,cn,xe.id,Lt.rasterBoundsBuffer,Lt.quadTriangleIndexBuffer,Lt.rasterBoundsSegments)}})(L,at,xt,kt);break;case"background":(function(Lt,le,xe,Pe){let $e=xe.paint.get("background-color"),hr=xe.paint.get("background-opacity");if(hr===0)return;let pr=Lt.context,Br=pr.gl,Jr=Lt.transform,Rt=Jr.tileSize,Gt=xe.paint.get("background-pattern");if(Lt.isPatternMissing(Gt))return;let ae=!Gt&&$e.a===1&&hr===1&&Lt.opaquePassEnabledForLayer()?"opaque":"translucent";if(Lt.renderPass!==ae)return;let ce=os.disabled,Te=Lt.depthModeForSublayer(0,ae==="opaque"?Oo.ReadWrite:Oo.ReadOnly),ye=Lt.colorModeForRenderPass(),ze=Lt.useProgram(Gt?"backgroundPattern":"background"),rr=Pe||Jr.coveringTiles({tileSize:Rt,terrain:Lt.style.map.terrain});Gt&&(pr.activeTexture.set(Br.TEXTURE0),Lt.imageManager.bind(Lt.context));let fr=xe.getCrossfadeParameters();for(let gr of rr){let Lr=Pe?gr.posMatrix:Lt.transform.calculatePosMatrix(gr.toUnwrapped()),Hr=Gt?vs(Lr,hr,Lt,Gt,{tileID:gr,tileSize:Rt},fr):ts(Lr,hr,$e),nn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(gr);ze.draw(pr,Br.TRIANGLES,Te,ce,ye,Fi.disabled,Hr,nn,xe.id,Lt.tileExtentBuffer,Lt.quadTriangleIndexBuffer,Lt.tileExtentSegments)}})(L,0,xt,kt);break;case"custom":(function(Lt,le,xe){let Pe=Lt.context,$e=xe.implementation;if(Lt.renderPass==="offscreen"){let hr=$e.prerender;hr&&(Lt.setCustomLayerDefaults(),Pe.setColorMode(Lt.colorModeForRenderPass()),hr.call($e,Pe.gl,Lt.transform.customLayerMatrix()),Pe.setDirty(),Lt.setBaseState())}else if(Lt.renderPass==="translucent"){Lt.setCustomLayerDefaults(),Pe.setColorMode(Lt.colorModeForRenderPass()),Pe.setStencilMode(os.disabled);let hr=$e.renderingMode==="3d"?new Oo(Lt.context.gl.LEQUAL,Oo.ReadWrite,Lt.depthRangeFor3D):Lt.depthModeForSublayer(0,Oo.ReadOnly);Pe.setDepthMode(hr),$e.render(Pe.gl,Lt.transform.customLayerMatrix(),{farZ:Lt.transform.farZ,nearZ:Lt.transform.nearZ,fov:Lt.transform._fov,modelViewProjectionMatrix:Lt.transform.modelViewProjectionMatrix,projectionMatrix:Lt.transform.projectionMatrix}),Pe.setDirty(),Lt.setBaseState(),Pe.bindFramebuffer.set(null)}})(L,0,xt)}}translatePosMatrix(L,at,xt,kt,Lt){if(!xt[0]&&!xt[1])return L;let le=Lt?kt==="map"?this.transform.angle:0:kt==="viewport"?-this.transform.angle:0;if(le){let $e=Math.sin(le),hr=Math.cos(le);xt=[xt[0]*hr-xt[1]*$e,xt[0]*$e+xt[1]*hr]}let xe=[Lt?xt[0]:dn(at,xt[0],this.transform.zoom),Lt?xt[1]:dn(at,xt[1],this.transform.zoom),0],Pe=new Float32Array(16);return e.J(Pe,L,xe),Pe}saveTileTexture(L){let at=this._tileTextures[L.size[0]];at?at.push(L):this._tileTextures[L.size[0]]=[L]}getTileTexture(L){let at=this._tileTextures[L];return at&&at.length>0?at.pop():null}isPatternMissing(L){if(!L)return!1;if(!L.from||!L.to)return!0;let at=this.imageManager.getPattern(L.from.toString()),xt=this.imageManager.getPattern(L.to.toString());return!at||!xt}useProgram(L,at){this.cache=this.cache||{};let xt=L+(at?at.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[xt]||(this.cache[xt]=new ln(this.context,Or[L],at,As[L],this._showOverdrawInspector,this.style.map.terrain)),this.cache[xt]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let L=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(L.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new h(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:L,drawingBufferHeight:at}=this.context.gl;return this.width!==L||this.height!==at}}class Bs{constructor(L,at){this.points=L,this.planes=at}static fromInvProjectionMatrix(L,at,xt){let kt=Math.pow(2,xt),Lt=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(xe=>{let Pe=1/(xe=e.af([],xe,L))[3]/at*kt;return e.b1(xe,xe,[Pe,Pe,1/xe[3],Pe])}),le=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(xe=>{let Pe=(function(Br,Jr){var Rt=Jr[0],Gt=Jr[1],ae=Jr[2],ce=Rt*Rt+Gt*Gt+ae*ae;return ce>0&&(ce=1/Math.sqrt(ce)),Br[0]=Jr[0]*ce,Br[1]=Jr[1]*ce,Br[2]=Jr[2]*ce,Br})([],(function(Br,Jr,Rt){var Gt=Jr[0],ae=Jr[1],ce=Jr[2],Te=Rt[0],ye=Rt[1],ze=Rt[2];return Br[0]=ae*ze-ce*ye,Br[1]=ce*Te-Gt*ze,Br[2]=Gt*ye-ae*Te,Br})([],k([],Lt[xe[0]],Lt[xe[1]]),k([],Lt[xe[2]],Lt[xe[1]]))),$e=-((hr=Pe)[0]*(pr=Lt[xe[1]])[0]+hr[1]*pr[1]+hr[2]*pr[2]);var hr,pr;return Pe.concat($e)});return new Bs(Lt,le)}}class Ou{constructor(L,at){this.min=L,this.max=at,this.center=(function(xt,kt,Lt){return xt[0]=.5*kt[0],xt[1]=.5*kt[1],xt[2]=.5*kt[2],xt})([],(function(xt,kt,Lt){return xt[0]=kt[0]+Lt[0],xt[1]=kt[1]+Lt[1],xt[2]=kt[2]+Lt[2],xt})([],this.min,this.max))}quadrant(L){let at=[L%2==0,L<2],xt=y(this.min),kt=y(this.max);for(let Lt=0;Lt=0&&le++;if(le===0)return 0;le!==at.length&&(xt=!1)}if(xt)return 2;for(let kt=0;kt<3;kt++){let Lt=Number.MAX_VALUE,le=-Number.MAX_VALUE;for(let xe=0;xethis.max[kt]-this.min[kt])return 0}return 1}}class Rl{constructor(L=0,at=0,xt=0,kt=0){if(isNaN(L)||L<0||isNaN(at)||at<0||isNaN(xt)||xt<0||isNaN(kt)||kt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=L,this.bottom=at,this.left=xt,this.right=kt}interpolate(L,at,xt){return at.top!=null&&L.top!=null&&(this.top=e.y.number(L.top,at.top,xt)),at.bottom!=null&&L.bottom!=null&&(this.bottom=e.y.number(L.bottom,at.bottom,xt)),at.left!=null&&L.left!=null&&(this.left=e.y.number(L.left,at.left,xt)),at.right!=null&&L.right!=null&&(this.right=e.y.number(L.right,at.right,xt)),this}getCenter(L,at){let xt=e.ac((this.left+L-this.right)/2,0,L),kt=e.ac((this.top+at-this.bottom)/2,0,at);return new e.P(xt,kt)}equals(L){return this.top===L.top&&this.bottom===L.bottom&&this.left===L.left&&this.right===L.right}clone(){return new Rl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Yl=85.051129;class Ws{constructor(L,at,xt,kt,Lt){this.tileSize=512,this._renderWorldCopies=Lt===void 0||!!Lt,this._minZoom=L||0,this._maxZoom=at||22,this._minPitch=xt??0,this._maxPitch=kt??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let L=new Ws(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return L.apply(this),L}apply(L){this.tileSize=L.tileSize,this.latRange=L.latRange,this.lngRange=L.lngRange,this.width=L.width,this.height=L.height,this._center=L._center,this._elevation=L._elevation,this.minElevationForCurrentTile=L.minElevationForCurrentTile,this.zoom=L.zoom,this.angle=L.angle,this._fov=L._fov,this._pitch=L._pitch,this._unmodified=L._unmodified,this._edgeInsets=L._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(L){this._minZoom!==L&&(this._minZoom=L,this.zoom=Math.max(this.zoom,L))}get maxZoom(){return this._maxZoom}set maxZoom(L){this._maxZoom!==L&&(this._maxZoom=L,this.zoom=Math.min(this.zoom,L))}get minPitch(){return this._minPitch}set minPitch(L){this._minPitch!==L&&(this._minPitch=L,this.pitch=Math.max(this.pitch,L))}get maxPitch(){return this._maxPitch}set maxPitch(L){this._maxPitch!==L&&(this._maxPitch=L,this.pitch=Math.min(this.pitch,L))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(L){L===void 0?L=!0:L===null&&(L=!1),this._renderWorldCopies=L}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(L){let at=-e.b3(L,-180,180)*Math.PI/180;this.angle!==at&&(this._unmodified=!1,this.angle=at,this._calcMatrices(),this.rotationMatrix=(function(){var xt=new e.A(4);return e.A!=Float32Array&&(xt[1]=0,xt[2]=0),xt[0]=1,xt[3]=1,xt})(),(function(xt,kt,Lt){var le=kt[0],xe=kt[1],Pe=kt[2],$e=kt[3],hr=Math.sin(Lt),pr=Math.cos(Lt);xt[0]=le*pr+Pe*hr,xt[1]=xe*pr+$e*hr,xt[2]=le*-hr+Pe*pr,xt[3]=xe*-hr+$e*pr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(L){let at=e.ac(L,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==at&&(this._unmodified=!1,this._pitch=at,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(L){L=Math.max(.01,Math.min(60,L)),this._fov!==L&&(this._unmodified=!1,this._fov=L/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(L){let at=Math.min(Math.max(L,this.minZoom),this.maxZoom);this._zoom!==at&&(this._unmodified=!1,this._zoom=at,this.tileZoom=Math.max(0,Math.floor(at)),this.scale=this.zoomScale(at),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(L){L.lat===this._center.lat&&L.lng===this._center.lng||(this._unmodified=!1,this._center=L,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(L){L!==this._elevation&&(this._elevation=L,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(L){this._edgeInsets.equals(L)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,L,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(L){return this._edgeInsets.equals(L)}interpolatePadding(L,at,xt){this._unmodified=!1,this._edgeInsets.interpolate(L,at,xt),this._constrain(),this._calcMatrices()}coveringZoomLevel(L){let at=(L.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/L.tileSize));return Math.max(0,at)}getVisibleUnwrappedCoordinates(L){let at=[new e.b4(0,L)];if(this._renderWorldCopies){let xt=this.pointCoordinate(new e.P(0,0)),kt=this.pointCoordinate(new e.P(this.width,0)),Lt=this.pointCoordinate(new e.P(this.width,this.height)),le=this.pointCoordinate(new e.P(0,this.height)),xe=Math.floor(Math.min(xt.x,kt.x,Lt.x,le.x)),Pe=Math.floor(Math.max(xt.x,kt.x,Lt.x,le.x)),$e=1;for(let hr=xe-$e;hr<=Pe+$e;hr++)hr!==0&&at.push(new e.b4(hr,L))}return at}coveringTiles(L){var at,xt;let kt=this.coveringZoomLevel(L),Lt=kt;if(L.minzoom!==void 0&&ktL.maxzoom&&(kt=L.maxzoom);let le=this.pointCoordinate(this.getCameraPoint()),xe=e.Z.fromLngLat(this.center),Pe=Math.pow(2,kt),$e=[Pe*le.x,Pe*le.y,0],hr=[Pe*xe.x,Pe*xe.y,0],pr=Bs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,kt),Br=L.minzoom||0;!L.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Br=kt);let Jr=L.terrain?2/Math.min(this.tileSize,L.tileSize)*this.tileSize:3,Rt=ye=>({aabb:new Ou([ye*Pe,0,0],[(ye+1)*Pe,Pe,0]),zoom:0,x:0,y:0,wrap:ye,fullyVisible:!1}),Gt=[],ae=[],ce=kt,Te=L.reparseOverscaled?Lt:kt;if(this._renderWorldCopies)for(let ye=1;ye<=3;ye++)Gt.push(Rt(-ye)),Gt.push(Rt(ye));for(Gt.push(Rt(0));Gt.length>0;){let ye=Gt.pop(),ze=ye.x,rr=ye.y,fr=ye.fullyVisible;if(!fr){let cn=ye.aabb.intersects(pr);if(cn===0)continue;fr=cn===2}let gr=L.terrain?$e:hr,Lr=ye.aabb.distanceX(gr),Hr=ye.aabb.distanceY(gr),nn=Math.max(Math.abs(Lr),Math.abs(Hr));if(ye.zoom===ce||nn>Jr+(1<=Br){let cn=ce-ye.zoom,Mn=$e[0]-.5-(ze<>1),_a=ye.zoom+1,xa=ye.aabb.quadrant(cn);if(L.terrain){let La=new e.S(_a,ye.wrap,_a,Mn,Jn),ai=L.terrain.getMinMaxElevation(La),Ai=(at=ai.minElevation)!==null&&at!==void 0?at:this.elevation,mi=(xt=ai.maxElevation)!==null&&xt!==void 0?xt:this.elevation;xa=new Ou([xa.min[0],xa.min[1],Ai],[xa.max[0],xa.max[1],mi])}Gt.push({aabb:xa,zoom:_a,x:Mn,y:Jn,wrap:ye.wrap,fullyVisible:fr})}}return ae.sort((ye,ze)=>ye.distanceSq-ze.distanceSq).map(ye=>ye.tileID)}resize(L,at){this.width=L,this.height=at,this.pixelsToGLUnits=[2/L,-2/at],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(L){return Math.pow(2,L)}scaleZoom(L){return Math.log(L)/Math.LN2}project(L){let at=e.ac(L.lat,-85.051129,Yl);return new e.P(e.O(L.lng)*this.worldSize,e.Q(at)*this.worldSize)}unproject(L){return new e.Z(L.x/this.worldSize,L.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(L){let at=this.elevation,xt=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,kt=this.pointLocation(this.centerPoint,L),Lt=L.getElevationForLngLatZoom(kt,this.tileZoom);if(!(this.elevation-Lt))return;let le=xt+at-Lt,xe=Math.cos(this._pitch)*this.cameraToCenterDistance/le/e.b5(1,kt.lat),Pe=this.scaleZoom(xe/this.tileSize);this._elevation=Lt,this._center=kt,this.zoom=Pe}setLocationAtPoint(L,at){let xt=this.pointCoordinate(at),kt=this.pointCoordinate(this.centerPoint),Lt=this.locationCoordinate(L),le=new e.Z(Lt.x-(xt.x-kt.x),Lt.y-(xt.y-kt.y));this.center=this.coordinateLocation(le),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(L,at){return at?this.coordinatePoint(this.locationCoordinate(L),at.getElevationForLngLatZoom(L,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(L))}pointLocation(L,at){return this.coordinateLocation(this.pointCoordinate(L,at))}locationCoordinate(L){return e.Z.fromLngLat(L)}coordinateLocation(L){return L&&L.toLngLat()}pointCoordinate(L,at){if(at){let Br=at.pointCoordinate(L);if(Br!=null)return Br}let xt=[L.x,L.y,0,1],kt=[L.x,L.y,1,1];e.af(xt,xt,this.pixelMatrixInverse),e.af(kt,kt,this.pixelMatrixInverse);let Lt=xt[3],le=kt[3],xe=xt[1]/Lt,Pe=kt[1]/le,$e=xt[2]/Lt,hr=kt[2]/le,pr=$e===hr?0:(0-$e)/(hr-$e);return new e.Z(e.y.number(xt[0]/Lt,kt[0]/le,pr)/this.worldSize,e.y.number(xe,Pe,pr)/this.worldSize)}coordinatePoint(L,at=0,xt=this.pixelMatrix){let kt=[L.x*this.worldSize,L.y*this.worldSize,at,1];return e.af(kt,kt,xt),new e.P(kt[0]/kt[3],kt[1]/kt[3])}getBounds(){let L=Math.max(0,this.height/2-this.getHorizon());return new nt().extend(this.pointLocation(new e.P(0,L))).extend(this.pointLocation(new e.P(this.width,L))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new nt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(L){L?(this.lngRange=[L.getWest(),L.getEast()],this.latRange=[L.getSouth(),L.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Yl])}calculateTileMatrix(L){let at=L.canonical,xt=this.worldSize/this.zoomScale(at.z),kt=at.x+Math.pow(2,at.z)*L.wrap,Lt=e.an(new Float64Array(16));return e.J(Lt,Lt,[kt*xt,at.y*xt,0]),e.K(Lt,Lt,[xt/e.X,xt/e.X,1]),Lt}calculatePosMatrix(L,at=!1){let xt=L.key,kt=at?this._alignedPosMatrixCache:this._posMatrixCache;if(kt[xt])return kt[xt];let Lt=this.calculateTileMatrix(L);return e.L(Lt,at?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Lt),kt[xt]=new Float32Array(Lt),kt[xt]}calculateFogMatrix(L){let at=L.key,xt=this._fogMatrixCache;if(xt[at])return xt[at];let kt=this.calculateTileMatrix(L);return e.L(kt,this.fogMatrix,kt),xt[at]=new Float32Array(kt),xt[at]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(L,at){at=e.ac(+at,this.minZoom,this.maxZoom);let xt={center:new e.N(L.lng,L.lat),zoom:at},kt=this.lngRange;if(!this._renderWorldCopies&&kt===null){let ye=179.9999999999;kt=[-ye,ye]}let Lt=this.tileSize*this.zoomScale(xt.zoom),le=0,xe=Lt,Pe=0,$e=Lt,hr=0,pr=0,{x:Br,y:Jr}=this.size;if(this.latRange){let ye=this.latRange;le=e.Q(ye[1])*Lt,xe=e.Q(ye[0])*Lt,xe-lexe&&(ce=xe-ye)}if(kt){let ye=(Pe+$e)/2,ze=Rt;this._renderWorldCopies&&(ze=e.b3(Rt,ye-Lt/2,ye+Lt/2));let rr=Br/2;ze-rr$e&&(ae=$e-rr)}if(ae!==void 0||ce!==void 0){let ye=new e.P(ae??Rt,ce??Gt);xt.center=this.unproject.call({worldSize:Lt},ye).wrap()}return xt}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let L=this._unmodified,{center:at,zoom:xt}=this.getConstrained(this.center,this.zoom);this.center=at,this.zoom=xt,this._unmodified=L,this._constraining=!1}_calcMatrices(){if(!this.height)return;let L=this.centerOffset,at=this.point.x,xt=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let kt=e.an(new Float64Array(16));e.K(kt,kt,[this.width/2,-this.height/2,1]),e.J(kt,kt,[1,-1,0]),this.labelPlaneMatrix=kt,kt=e.an(new Float64Array(16)),e.K(kt,kt,[1,-1,1]),e.J(kt,kt,[-1,-1,0]),e.K(kt,kt,[2/this.width,2/this.height,1]),this.glCoordMatrix=kt;let Lt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),le=Math.min(this.elevation,this.minElevationForCurrentTile),xe=Lt-le*this._pixelPerMeter/Math.cos(this._pitch),Pe=le<0?xe:Lt,$e=Math.PI/2+this._pitch,hr=this._fov*(.5+L.y/this.height),pr=Math.sin(hr)*Pe/Math.sin(e.ac(Math.PI-$e-hr,.01,Math.PI-.01)),Br=this.getHorizon(),Jr=2*Math.atan(Br/this.cameraToCenterDistance)*(.5+L.y/(2*Br)),Rt=Math.sin(Jr)*Pe/Math.sin(e.ac(Math.PI-$e-Jr,.01,Math.PI-.01)),Gt=Math.min(pr,Rt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Gt+Pe),this.nearZ=this.height/50,kt=new Float64Array(16),e.b6(kt,this._fov,this.width/this.height,this.nearZ,this.farZ),kt[8]=2*-L.x/this.width,kt[9]=2*L.y/this.height,this.projectionMatrix=e.ae(kt),e.K(kt,kt,[1,-1,1]),e.J(kt,kt,[0,0,-this.cameraToCenterDistance]),e.b7(kt,kt,this._pitch),e.ad(kt,kt,this.angle),e.J(kt,kt,[-at,-xt,0]),this.mercatorMatrix=e.K([],kt,[this.worldSize,this.worldSize,this.worldSize]),e.K(kt,kt,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,kt),e.J(kt,kt,[0,0,-this.elevation]),this.modelViewProjectionMatrix=kt,this.invModelViewProjectionMatrix=e.as([],kt),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,Lt,this.farZ),this.fogMatrix[8]=2*-L.x/this.width,this.fogMatrix[9]=2*L.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-at,-xt,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,kt);let ae=this.width%2/2,ce=this.height%2/2,Te=Math.cos(this.angle),ye=Math.sin(this.angle),ze=at-Math.round(at)+Te*ae+ye*ce,rr=xt-Math.round(xt)+Te*ce+ye*ae,fr=new Float64Array(kt);if(e.J(fr,fr,[ze>.5?ze-1:ze,rr>.5?rr-1:rr,0]),this.alignedModelViewProjectionMatrix=fr,kt=e.as(new Float64Array(16),this.pixelMatrix),!kt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=kt,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let L=this.pointCoordinate(new e.P(0,0)),at=[L.x*this.worldSize,L.y*this.worldSize,0,1];return e.af(at,at,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let L=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,L))}getCameraQueryGeometry(L){let at=this.getCameraPoint();if(L.length===1)return[L[0],at];{let xt=at.x,kt=at.y,Lt=at.x,le=at.y;for(let xe of L)xt=Math.min(xt,xe.x),kt=Math.min(kt,xe.y),Lt=Math.max(Lt,xe.x),le=Math.max(le,xe.y);return[new e.P(xt,kt),new e.P(Lt,kt),new e.P(Lt,le),new e.P(xt,le),new e.P(xt,kt)]}}lngLatToCameraDepth(L,at){let xt=this.locationCoordinate(L),kt=[xt.x*this.worldSize,xt.y*this.worldSize,at,1];return e.af(kt,kt,this.modelViewProjectionMatrix),kt[2]/kt[3]}}function ac(Pt,L){let at,xt=!1,kt=null,Lt=null,le=()=>{kt=null,xt&&(Pt.apply(Lt,at),kt=setTimeout(le,L),xt=!1)};return(...xe)=>(xt=!0,Lt=this,at=xe,kt||le(),kt)}class Tu{constructor(L){this._getCurrentHash=()=>{let at=window.location.hash.replace("#","");if(this._hashName){let xt;return at.split("&").map(kt=>kt.split("=")).forEach(kt=>{kt[0]===this._hashName&&(xt=kt)}),(xt&&xt[1]||"").split("/")}return at.split("/")},this._onHashChange=()=>{let at=this._getCurrentHash();if(at.length>=3&&!at.some(xt=>isNaN(xt))){let xt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(at[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+at[2],+at[1]],zoom:+at[0],bearing:xt,pitch:+(at[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let at=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,at)},this._removeHash=()=>{let at=this._getCurrentHash();if(at.length===0)return;let xt=at.join("/"),kt=xt;kt.split("&").length>0&&(kt=kt.split("&")[0]),this._hashName&&(kt=`${this._hashName}=${xt}`);let Lt=window.location.hash.replace(kt,"");Lt.startsWith("#&")?Lt=Lt.slice(0,1)+Lt.slice(2):Lt==="#"&&(Lt="");let le=window.location.href.replace(/(#.+)?$/,Lt);le=le.replace("&&","&"),window.history.replaceState(window.history.state,null,le)},this._updateHash=ac(this._updateHashUnthrottled,300),this._hashName=L&&encodeURIComponent(L)}addTo(L){return this._map=L,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(L){let at=this._map.getCenter(),xt=Math.round(100*this._map.getZoom())/100,kt=Math.ceil((xt*Math.LN2+Math.log(512/360/.5))/Math.LN10),Lt=Math.pow(10,kt),le=Math.round(at.lng*Lt)/Lt,xe=Math.round(at.lat*Lt)/Lt,Pe=this._map.getBearing(),$e=this._map.getPitch(),hr="";if(hr+=L?`/${le}/${xe}/${xt}`:`${xt}/${xe}/${le}`,(Pe||$e)&&(hr+="/"+Math.round(10*Pe)/10),$e&&(hr+=`/${Math.round($e)}`),this._hashName){let pr=this._hashName,Br=!1,Jr=window.location.hash.slice(1).split("&").map(Rt=>{let Gt=Rt.split("=")[0];return Gt===pr?(Br=!0,`${Gt}=${hr}`):Rt}).filter(Rt=>Rt);return Br||Jr.push(`${pr}=${hr}`),`#${Jr.join("&")}`}return`#${hr}`}}let Zu={linearity:.3,easing:e.b8(0,0,.3,1)},bc=e.e({deceleration:2500,maxSpeed:1400},Zu),uf=e.e({deceleration:20,maxSpeed:1400},Zu),Sf=e.e({deceleration:1e3,maxSpeed:360},Zu),ic=e.e({deceleration:1e3,maxSpeed:90},Zu);class wc{constructor(L){this._map=L,this.clear()}clear(){this._inertiaBuffer=[]}record(L){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.now(),settings:L})}_drainInertiaBuffer(){let L=this._inertiaBuffer,at=o.now();for(;L.length>0&&at-L[0].time>160;)L.shift()}_onMoveEnd(L){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let at={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Lt}of this._inertiaBuffer)at.zoom+=Lt.zoomDelta||0,at.bearing+=Lt.bearingDelta||0,at.pitch+=Lt.pitchDelta||0,Lt.panDelta&&at.pan._add(Lt.panDelta),Lt.around&&(at.around=Lt.around),Lt.pinchAround&&(at.pinchAround=Lt.pinchAround);let xt=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,kt={};if(at.pan.mag()){let Lt=oc(at.pan.mag(),xt,e.e({},bc,L||{}));kt.offset=at.pan.mult(Lt.amount/at.pan.mag()),kt.center=this._map.transform.center,Fl(kt,Lt)}if(at.zoom){let Lt=oc(at.zoom,xt,uf);kt.zoom=this._map.transform.zoom+Lt.amount,Fl(kt,Lt)}if(at.bearing){let Lt=oc(at.bearing,xt,Sf);kt.bearing=this._map.transform.bearing+e.ac(Lt.amount,-179,179),Fl(kt,Lt)}if(at.pitch){let Lt=oc(at.pitch,xt,ic);kt.pitch=this._map.transform.pitch+Lt.amount,Fl(kt,Lt)}if(kt.zoom||kt.bearing){let Lt=at.pinchAround===void 0?at.around:at.pinchAround;kt.around=Lt?this._map.unproject(Lt):this._map.getCenter()}return this.clear(),e.e(kt,{noMoveStart:!0})}}function Fl(Pt,L){(!Pt.duration||Pt.durationat.unproject(Pe)),xe=Lt.reduce((Pe,$e,hr,pr)=>Pe.add($e.div(pr.length)),new e.P(0,0));super(L,{points:Lt,point:xe,lngLats:le,lngLat:at.unproject(xe),originalEvent:xt}),this._defaultPrevented=!1}}class Tc extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(L,at,xt){super(L,{originalEvent:xt}),this._defaultPrevented=!1}}class ku{constructor(L,at){this._map=L,this._clickTolerance=at.clickTolerance}reset(){delete this._mousedownPos}wheel(L){return this._firePreventable(new Tc(L.type,this._map,L))}mousedown(L,at){return this._mousedownPos=at,this._firePreventable(new iu(L.type,this._map,L))}mouseup(L){this._map.fire(new iu(L.type,this._map,L))}click(L,at){this._mousedownPos&&this._mousedownPos.dist(at)>=this._clickTolerance||this._map.fire(new iu(L.type,this._map,L))}dblclick(L){return this._firePreventable(new iu(L.type,this._map,L))}mouseover(L){this._map.fire(new iu(L.type,this._map,L))}mouseout(L){this._map.fire(new iu(L.type,this._map,L))}touchstart(L){return this._firePreventable(new sc(L.type,this._map,L))}touchmove(L){this._map.fire(new sc(L.type,this._map,L))}touchend(L){this._map.fire(new sc(L.type,this._map,L))}touchcancel(L){this._map.fire(new sc(L.type,this._map,L))}_firePreventable(L){if(this._map.fire(L),L.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gs{constructor(L){this._map=L}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(L){this._map.fire(new iu(L.type,this._map,L))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iu("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(L){this._delayContextMenu?this._contextMenuEvent=L:this._ignoreContextMenu||this._map.fire(new iu(L.type,this._map,L)),this._map.listens("contextmenu")&&L.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Du{constructor(L){this._map=L}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(L){return this.transform.pointLocation(e.P.convert(L),this._map.terrain)}}class Xl{constructor(L,at){this._map=L,this._tr=new Du(L),this._el=L.getCanvasContainer(),this._container=L.getContainer(),this._clickTolerance=at.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(L,at){this.isEnabled()&&L.shiftKey&&L.button===0&&(a.disableDrag(),this._startPos=this._lastPos=at,this._active=!0)}mousemoveWindow(L,at){if(!this._active)return;let xt=at;if(this._lastPos.equals(xt)||!this._box&&xt.dist(this._startPos)Lt.fitScreenCoordinates(xt,kt,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",L)}keydown(L){this._active&&L.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",L))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(L,at){return this._map.fire(new e.k(L,{originalEvent:at}))}}function Xc(Pt,L){if(Pt.length!==L.length)throw new Error(`The number of touches and points are not equal - touches ${Pt.length}, points ${L.length}`);let at={};for(let xt=0;xtthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=L.timeStamp),xt.length===this.numTouches&&(this.centroid=(function(kt){let Lt=new e.P(0,0);for(let le of kt)Lt._add(le);return Lt.div(kt.length)})(at),this.touches=Xc(xt,at)))}touchmove(L,at,xt){if(this.aborted||!this.centroid)return;let kt=Xc(xt,at);for(let Lt in this.touches){let le=kt[Lt];(!le||le.dist(this.touches[Lt])>30)&&(this.aborted=!0)}}touchend(L,at,xt){if((!this.centroid||L.timeStamp-this.startTime>500)&&(this.aborted=!0),xt.length===0){let kt=!this.aborted&&this.centroid;if(this.reset(),kt)return kt}}}class vc{constructor(L){this.singleTap=new Vs(L),this.numTaps=L.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(L,at,xt){this.singleTap.touchstart(L,at,xt)}touchmove(L,at,xt){this.singleTap.touchmove(L,at,xt)}touchend(L,at,xt){let kt=this.singleTap.touchend(L,at,xt);if(kt){let Lt=L.timeStamp-this.lastTime<500,le=!this.lastTap||this.lastTap.dist(kt)<30;if(Lt&&le||this.reset(),this.count++,this.lastTime=L.timeStamp,this.lastTap=kt,this.count===this.numTaps)return this.reset(),kt}}}class Ku{constructor(L){this._tr=new Du(L),this._zoomIn=new vc({numTouches:1,numTaps:2}),this._zoomOut=new vc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(L,at,xt){this._zoomIn.touchstart(L,at,xt),this._zoomOut.touchstart(L,at,xt)}touchmove(L,at,xt){this._zoomIn.touchmove(L,at,xt),this._zoomOut.touchmove(L,at,xt)}touchend(L,at,xt){let kt=this._zoomIn.touchend(L,at,xt),Lt=this._zoomOut.touchend(L,at,xt),le=this._tr;return kt?(this._active=!0,L.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:xe=>xe.easeTo({duration:300,zoom:le.zoom+1,around:le.unproject(kt)},{originalEvent:L})}):Lt?(this._active=!0,L.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:xe=>xe.easeTo({duration:300,zoom:le.zoom-1,around:le.unproject(Lt)},{originalEvent:L})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ou{constructor(L){this._enabled=!!L.enable,this._moveStateManager=L.moveStateManager,this._clickTolerance=L.clickTolerance||1,this._moveFunction=L.move,this._activateOnStart=!!L.activateOnStart,L.assignEvents(this),this.reset()}reset(L){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(L)}_move(...L){let at=this._moveFunction(...L);if(at.bearingDelta||at.pitchDelta||at.around||at.panDelta)return this._active=!0,at}dragStart(L,at){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(L)&&(this._moveStateManager.startMove(L),this._lastPoint=at.length?at[0]:at,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(L,at){if(!this.isEnabled())return;let xt=this._lastPoint;if(!xt)return;if(L.preventDefault(),!this._moveStateManager.isValidMoveEvent(L))return void this.reset(L);let kt=at.length?at[0]:at;return!this._moved&&kt.dist(xt){Pt.mousedown=Pt.dragStart,Pt.mousemoveWindow=Pt.dragMove,Pt.mouseup=Pt.dragEnd,Pt.contextmenu=L=>{L.preventDefault()}},zl=({enable:Pt,clickTolerance:L,bearingDegreesPerPixelMoved:at=.8})=>{let xt=new Yu({checkCorrectEvent:kt=>a.mouseButton(kt)===0&&kt.ctrlKey||a.mouseButton(kt)===2});return new ou({clickTolerance:L,move:(kt,Lt)=>({bearingDelta:(Lt.x-kt.x)*at}),moveStateManager:xt,enable:Pt,assignEvents:cf})},Uc=({enable:Pt,clickTolerance:L,pitchDegreesPerPixelMoved:at=-.5})=>{let xt=new Yu({checkCorrectEvent:kt=>a.mouseButton(kt)===0&&kt.ctrlKey||a.mouseButton(kt)===2});return new ou({clickTolerance:L,move:(kt,Lt)=>({pitchDelta:(Lt.y-kt.y)*at}),moveStateManager:xt,enable:Pt,assignEvents:cf})};class su{constructor(L,at){this._clickTolerance=L.clickTolerance||1,this._map=at,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(L){return L<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(L,at,xt){return this._calculateTransform(L,at,xt)}touchmove(L,at,xt){if(this._active){if(!this._shouldBePrevented(xt.length))return L.preventDefault(),this._calculateTransform(L,at,xt);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",L)}}touchend(L,at,xt){this._calculateTransform(L,at,xt),this._active&&this._shouldBePrevented(xt.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(L,at,xt){xt.length>0&&(this._active=!0);let kt=Xc(xt,at),Lt=new e.P(0,0),le=new e.P(0,0),xe=0;for(let $e in kt){let hr=kt[$e],pr=this._touches[$e];pr&&(Lt._add(hr),le._add(hr.sub(pr)),xe++,kt[$e]=hr)}if(this._touches=kt,this._shouldBePrevented(xe)||!le.mag())return;let Pe=le.div(xe);return this._sum._add(Pe),this._sum.mag()Math.abs(Pt.x)}class Oc extends Fu{constructor(L){super(),this._currentTouchCount=0,this._map=L}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(L,at,xt){super.touchstart(L,at,xt),this._currentTouchCount=xt.length}_start(L){this._lastPoints=L,Su(L[0].sub(L[1]))&&(this._valid=!1)}_move(L,at,xt){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let kt=L[0].sub(this._lastPoints[0]),Lt=L[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(kt,Lt,xt.timeStamp),this._valid?(this._lastPoints=L,this._active=!0,{pitchDelta:(kt.y+Lt.y)/2*-.5}):void 0}gestureBeginsVertically(L,at,xt){if(this._valid!==void 0)return this._valid;let kt=L.mag()>=2,Lt=at.mag()>=2;if(!kt&&!Lt)return;if(!kt||!Lt)return this._firstMove===void 0&&(this._firstMove=xt),xt-this._firstMove<100&&void 0;let le=L.y>0==at.y>0;return Su(L)&&Su(at)&&le}}let Xe={panStep:100,bearingStep:15,pitchStep:10};class yr{constructor(L){this._tr=new Du(L);let at=Xe;this._panStep=at.panStep,this._bearingStep=at.bearingStep,this._pitchStep=at.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(L){if(L.altKey||L.ctrlKey||L.metaKey)return;let at=0,xt=0,kt=0,Lt=0,le=0;switch(L.keyCode){case 61:case 107:case 171:case 187:at=1;break;case 189:case 109:case 173:at=-1;break;case 37:L.shiftKey?xt=-1:(L.preventDefault(),Lt=-1);break;case 39:L.shiftKey?xt=1:(L.preventDefault(),Lt=1);break;case 38:L.shiftKey?kt=1:(L.preventDefault(),le=-1);break;case 40:L.shiftKey?kt=-1:(L.preventDefault(),le=1);break;default:return}return this._rotationDisabled&&(xt=0,kt=0),{cameraAnimation:xe=>{let Pe=this._tr;xe.easeTo({duration:300,easeId:"keyboardHandler",easing:Kr,zoom:at?Math.round(Pe.zoom)+at*(L.shiftKey?2:1):Pe.zoom,bearing:Pe.bearing+xt*this._bearingStep,pitch:Pe.pitch+kt*this._pitchStep,offset:[-Lt*this._panStep,-le*this._panStep],center:Pe.center},{originalEvent:L})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Kr(Pt){return Pt*(2-Pt)}let Rr=4.000244140625;class mn{constructor(L,at){this._onTimeout=xt=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(xt)},this._map=L,this._tr=new Du(L),this._triggerRenderFrame=at,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(L){this._defaultZoomRate=L}setWheelZoomRate(L){this._wheelZoomRate=L}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(L){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!L&&L.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(L){return!!this._map.cooperativeGestures.isEnabled()&&!(L.ctrlKey||this._map.cooperativeGestures.isBypassed(L))}wheel(L){if(!this.isEnabled())return;if(this._shouldBePrevented(L))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",L);let at=L.deltaMode===WheelEvent.DOM_DELTA_LINE?40*L.deltaY:L.deltaY,xt=o.now(),kt=xt-(this._lastWheelEventTime||0);this._lastWheelEventTime=xt,at!==0&&at%Rr==0?this._type="wheel":at!==0&&Math.abs(at)<4?this._type="trackpad":kt>400?(this._type=null,this._lastValue=at,this._timeout=setTimeout(this._onTimeout,40,L)):this._type||(this._type=Math.abs(kt*at)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,at+=this._lastValue)),L.shiftKey&&at&&(at/=4),this._type&&(this._lastWheelEvent=L,this._delta-=at,this._active||this._start(L)),L.preventDefault()}_start(L){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let at=a.mousePos(this._map.getCanvas(),L),xt=this._tr;this._around=at.y>xt.transform.height/2-xt.transform.getHorizon()?e.N.convert(this._aroundCenter?xt.center:xt.unproject(at)):e.N.convert(xt.center),this._aroundPoint=xt.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let L=this._tr.transform;if(this._delta!==0){let Pe=this._type==="wheel"&&Math.abs(this._delta)>Rr?this._wheelZoomRate:this._defaultZoomRate,$e=2/(1+Math.exp(-Math.abs(this._delta*Pe)));this._delta<0&&$e!==0&&($e=1/$e);let hr=typeof this._targetZoom=="number"?L.zoomScale(this._targetZoom):L.scale;this._targetZoom=Math.min(L.maxZoom,Math.max(L.minZoom,L.scaleZoom(hr*$e))),this._type==="wheel"&&(this._startZoom=L.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let at=typeof this._targetZoom=="number"?this._targetZoom:L.zoom,xt=this._startZoom,kt=this._easing,Lt,le=!1,xe=o.now()-this._lastWheelEventTime;if(this._type==="wheel"&&xt&&kt&&xe){let Pe=Math.min(xe/200,1),$e=kt(Pe);Lt=e.y.number(xt,at,$e),Pe<1?this._frameId||(this._frameId=!0):le=!0}else Lt=at,le=!0;return this._active=!0,le&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!le,zoomDelta:Lt-L.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(L){let at=e.b9;if(this._prevEase){let xt=this._prevEase,kt=(o.now()-xt.start)/xt.duration,Lt=xt.easing(kt+.01)-xt.easing(kt),le=.27/Math.sqrt(Lt*Lt+1e-4)*.01,xe=Math.sqrt(.0729-le*le);at=e.b8(le,xe,.25,1)}return this._prevEase={start:o.now(),duration:L,easing:at},at}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pn{constructor(L,at){this._clickZoom=L,this._tapZoom=at}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ha{constructor(L){this._tr=new Du(L),this.reset()}reset(){this._active=!1}dblclick(L,at){return L.preventDefault(),{cameraAnimation:xt=>{xt.easeTo({duration:300,zoom:this._tr.zoom+(L.shiftKey?-1:1),around:this._tr.unproject(at)},{originalEvent:L})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ta{constructor(){this._tap=new vc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(L,at,xt){if(!this._swipePoint)if(this._tapTime){let kt=at[0],Lt=L.timeStamp-this._tapTime<500,le=this._tapPoint.dist(kt)<30;Lt&&le?xt.length>0&&(this._swipePoint=kt,this._swipeTouch=xt[0].identifier):this.reset()}else this._tap.touchstart(L,at,xt)}touchmove(L,at,xt){if(this._tapTime){if(this._swipePoint){if(xt[0].identifier!==this._swipeTouch)return;let kt=at[0],Lt=kt.y-this._swipePoint.y;return this._swipePoint=kt,L.preventDefault(),this._active=!0,{zoomDelta:Lt/128}}}else this._tap.touchmove(L,at,xt)}touchend(L,at,xt){if(this._tapTime)this._swipePoint&&xt.length===0&&this.reset();else{let kt=this._tap.touchend(L,at,xt);kt&&(this._tapTime=L.timeStamp,this._tapPoint=kt)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ua{constructor(L,at,xt){this._el=L,this._mousePan=at,this._touchPan=xt}enable(L){this._inertiaOptions=L||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ya{constructor(L,at,xt){this._pitchWithRotate=L.pitchWithRotate,this._mouseRotate=at,this._mousePitch=xt}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class va{constructor(L,at,xt,kt){this._el=L,this._touchZoom=at,this._touchRotate=xt,this._tapDragZoom=kt,this._rotationDisabled=!1,this._enabled=!0}enable(L){this._touchZoom.enable(L),this._rotationDisabled||this._touchRotate.enable(L),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ba{constructor(L,at){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=L,this._options=at,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let L=this._map.getCanvasContainer();L.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",L);let at=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(at=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let xt=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),kt=document.createElement("div");kt.className="maplibregl-desktop-message",kt.textContent=at,this._container.appendChild(kt);let Lt=document.createElement("div");Lt.className="maplibregl-mobile-message",Lt.textContent=xt,this._container.appendChild(Lt),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(L){return L[this._bypassKey]}notifyGestureBlocked(L,at){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:L,originalEvent:at})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let za=Pt=>Pt.zoom||Pt.drag||Pt.pitch||Pt.rotate;class ca extends e.k{}function ei(Pt){return Pt.panDelta&&Pt.panDelta.mag()||Pt.zoomDelta||Pt.bearingDelta||Pt.pitchDelta}class Vi{constructor(L,at){this.handleWindowEvent=kt=>{this.handleEvent(kt,`${kt.type}Window`)},this.handleEvent=(kt,Lt)=>{if(kt.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let le=kt.type==="renderFrame"?void 0:kt,xe={needsRenderFrame:!1},Pe={},$e={},hr=kt.touches,pr=hr?this._getMapTouches(hr):void 0,Br=pr?a.touchPos(this._map.getCanvas(),pr):a.mousePos(this._map.getCanvas(),kt);for(let{handlerName:Gt,handler:ae,allowed:ce}of this._handlers){if(!ae.isEnabled())continue;let Te;this._blockedByActive($e,ce,Gt)?ae.reset():ae[Lt||kt.type]&&(Te=ae[Lt||kt.type](kt,Br,pr),this.mergeHandlerResult(xe,Pe,Te,Gt,le),Te&&Te.needsRenderFrame&&this._triggerRenderFrame()),(Te||ae.isActive())&&($e[Gt]=ae)}let Jr={};for(let Gt in this._previousActiveHandlers)$e[Gt]||(Jr[Gt]=le);this._previousActiveHandlers=$e,(Object.keys(Jr).length||ei(xe))&&(this._changes.push([xe,Pe,Jr]),this._triggerRenderFrame()),(Object.keys($e).length||ei(xe))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Rt}=xe;Rt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Rt(this._map))},this._map=L,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new wc(L),this._bearingSnap=at.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(at);let xt=this._el;this._listeners=[[xt,"touchstart",{passive:!0}],[xt,"touchmove",{passive:!1}],[xt,"touchend",void 0],[xt,"touchcancel",void 0],[xt,"mousedown",void 0],[xt,"mousemove",void 0],[xt,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[xt,"mouseover",void 0],[xt,"mouseout",void 0],[xt,"dblclick",void 0],[xt,"click",void 0],[xt,"keydown",{capture:!1}],[xt,"keyup",void 0],[xt,"wheel",{passive:!1}],[xt,"contextmenu",void 0],[window,"blur",void 0]];for(let[kt,Lt,le]of this._listeners)a.addEventListener(kt,Lt,kt===document?this.handleWindowEvent:this.handleEvent,le)}destroy(){for(let[L,at,xt]of this._listeners)a.removeEventListener(L,at,L===document?this.handleWindowEvent:this.handleEvent,xt)}_addDefaultHandlers(L){let at=this._map,xt=at.getCanvasContainer();this._add("mapEvent",new ku(at,L));let kt=at.boxZoom=new Xl(at,L);this._add("boxZoom",kt),L.interactive&&L.boxZoom&&kt.enable();let Lt=at.cooperativeGestures=new Ba(at,L.cooperativeGestures);this._add("cooperativeGestures",Lt),L.cooperativeGestures&&Lt.enable();let le=new Ku(at),xe=new ha(at);at.doubleClickZoom=new Pn(xe,le),this._add("tapZoom",le),this._add("clickZoom",xe),L.interactive&&L.doubleClickZoom&&at.doubleClickZoom.enable();let Pe=new Ta;this._add("tapDragZoom",Pe);let $e=at.touchPitch=new Oc(at);this._add("touchPitch",$e),L.interactive&&L.touchPitch&&at.touchPitch.enable(L.touchPitch);let hr=zl(L),pr=Uc(L);at.dragRotate=new Ya(L,hr,pr),this._add("mouseRotate",hr,["mousePitch"]),this._add("mousePitch",pr,["mouseRotate"]),L.interactive&&L.dragRotate&&at.dragRotate.enable();let Br=(({enable:Te,clickTolerance:ye})=>{let ze=new Yu({checkCorrectEvent:rr=>a.mouseButton(rr)===0&&!rr.ctrlKey});return new ou({clickTolerance:ye,move:(rr,fr)=>({around:fr,panDelta:fr.sub(rr)}),activateOnStart:!0,moveStateManager:ze,enable:Te,assignEvents:cf})})(L),Jr=new su(L,at);at.dragPan=new Ua(xt,Br,Jr),this._add("mousePan",Br),this._add("touchPan",Jr,["touchZoom","touchRotate"]),L.interactive&&L.dragPan&&at.dragPan.enable(L.dragPan);let Rt=new lc,Gt=new Cs;at.touchZoomRotate=new va(xt,Gt,Rt,Pe),this._add("touchRotate",Rt,["touchPan","touchZoom"]),this._add("touchZoom",Gt,["touchPan","touchRotate"]),L.interactive&&L.touchZoomRotate&&at.touchZoomRotate.enable(L.touchZoomRotate);let ae=at.scrollZoom=new mn(at,()=>this._triggerRenderFrame());this._add("scrollZoom",ae,["mousePan"]),L.interactive&&L.scrollZoom&&at.scrollZoom.enable(L.scrollZoom);let ce=at.keyboard=new yr(at);this._add("keyboard",ce),L.interactive&&L.keyboard&&at.keyboard.enable(),this._add("blockableMapEvent",new Gs(at))}_add(L,at,xt){this._handlers.push({handlerName:L,handler:at,allowed:xt}),this._handlersById[L]=at}stop(L){if(!this._updatingCamera){for(let{handler:at}of this._handlers)at.reset();this._inertia.clear(),this._fireEvents({},{},L),this._changes=[]}}isActive(){for(let{handler:L}of this._handlers)if(L.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!za(this._eventsInProgress)||this.isZooming()}_blockedByActive(L,at,xt){for(let kt in L)if(kt!==xt&&(!at||at.indexOf(kt)<0))return!0;return!1}_getMapTouches(L){let at=[];for(let xt of L)this._el.contains(xt.target)&&at.push(xt);return at}mergeHandlerResult(L,at,xt,kt,Lt){if(!xt)return;e.e(L,xt);let le={handlerName:kt,originalEvent:xt.originalEvent||Lt};xt.zoomDelta!==void 0&&(at.zoom=le),xt.panDelta!==void 0&&(at.drag=le),xt.pitchDelta!==void 0&&(at.pitch=le),xt.bearingDelta!==void 0&&(at.rotate=le)}_applyChanges(){let L={},at={},xt={};for(let[kt,Lt,le]of this._changes)kt.panDelta&&(L.panDelta=(L.panDelta||new e.P(0,0))._add(kt.panDelta)),kt.zoomDelta&&(L.zoomDelta=(L.zoomDelta||0)+kt.zoomDelta),kt.bearingDelta&&(L.bearingDelta=(L.bearingDelta||0)+kt.bearingDelta),kt.pitchDelta&&(L.pitchDelta=(L.pitchDelta||0)+kt.pitchDelta),kt.around!==void 0&&(L.around=kt.around),kt.pinchAround!==void 0&&(L.pinchAround=kt.pinchAround),kt.noInertia&&(L.noInertia=kt.noInertia),e.e(at,Lt),e.e(xt,le);this._updateMapTransform(L,at,xt),this._changes=[]}_updateMapTransform(L,at,xt){let kt=this._map,Lt=kt._getTransformForUpdate(),le=kt.terrain;if(!(ei(L)||le&&this._terrainMovement))return this._fireEvents(at,xt,!0);let{panDelta:xe,zoomDelta:Pe,bearingDelta:$e,pitchDelta:hr,around:pr,pinchAround:Br}=L;Br!==void 0&&(pr=Br),kt._stop(!0),pr=pr||kt.transform.centerPoint;let Jr=Lt.pointLocation(xe?pr.sub(xe):pr);$e&&(Lt.bearing+=$e),hr&&(Lt.pitch+=hr),Pe&&(Lt.zoom+=Pe),le?this._terrainMovement||!at.drag&&!at.zoom?at.drag&&this._terrainMovement?Lt.center=Lt.pointLocation(Lt.centerPoint.sub(xe)):Lt.setLocationAtPoint(Jr,pr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Lt.setLocationAtPoint(Jr,pr)):Lt.setLocationAtPoint(Jr,pr),kt._applyUpdatedTransform(Lt),this._map._update(),L.noInertia||this._inertia.record(L),this._fireEvents(at,xt,!0)}_fireEvents(L,at,xt){let kt=za(this._eventsInProgress),Lt=za(L),le={};for(let pr in L){let{originalEvent:Br}=L[pr];this._eventsInProgress[pr]||(le[`${pr}start`]=Br),this._eventsInProgress[pr]=L[pr]}!kt&&Lt&&this._fireEvent("movestart",Lt.originalEvent);for(let pr in le)this._fireEvent(pr,le[pr]);Lt&&this._fireEvent("move",Lt.originalEvent);for(let pr in L){let{originalEvent:Br}=L[pr];this._fireEvent(pr,Br)}let xe={},Pe;for(let pr in this._eventsInProgress){let{handlerName:Br,originalEvent:Jr}=this._eventsInProgress[pr];this._handlersById[Br].isActive()||(delete this._eventsInProgress[pr],Pe=at[Br]||Jr,xe[`${pr}end`]=Pe)}for(let pr in xe)this._fireEvent(pr,xe[pr]);let $e=za(this._eventsInProgress),hr=(kt||Lt)&&!$e;if(hr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let pr=this._map._getTransformForUpdate();pr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(pr)}if(xt&&hr){this._updatingCamera=!0;let pr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Br=Jr=>Jr!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ca("renderFrame",{timeStamp:L})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Oi extends e.E{constructor(L,at){super(),this._renderFrameCallback=()=>{let xt=Math.min((o.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(xt)),xt<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=L,this._bearingSnap=at.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(L,at){return this.jumpTo({center:L},at)}panBy(L,at,xt){return L=e.P.convert(L).mult(-1),this.panTo(this.transform.center,e.e({offset:L},at),xt)}panTo(L,at,xt){return this.easeTo(e.e({center:L},at),xt)}getZoom(){return this.transform.zoom}setZoom(L,at){return this.jumpTo({zoom:L},at),this}zoomTo(L,at,xt){return this.easeTo(e.e({zoom:L},at),xt)}zoomIn(L,at){return this.zoomTo(this.getZoom()+1,L,at),this}zoomOut(L,at){return this.zoomTo(this.getZoom()-1,L,at),this}getBearing(){return this.transform.bearing}setBearing(L,at){return this.jumpTo({bearing:L},at),this}getPadding(){return this.transform.padding}setPadding(L,at){return this.jumpTo({padding:L},at),this}rotateTo(L,at,xt){return this.easeTo(e.e({bearing:L},at),xt)}resetNorth(L,at){return this.rotateTo(0,e.e({duration:1e3},L),at),this}resetNorthPitch(L,at){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},L),at),this}snapToNorth(L,at){return Math.abs(this.getBearing()){if(this._zooming&&(kt.zoom=e.y.number(Lt,ae,gr)),this._rotating&&(kt.bearing=e.y.number(le,$e,gr)),this._pitching&&(kt.pitch=e.y.number(xe,hr,gr)),this._padding&&(kt.interpolatePadding(Pe,pr,gr),Jr=kt.centerPoint.add(Br)),this.terrain&&!L.freezeElevation&&this._updateElevation(gr),ze)kt.setLocationAtPoint(ze,rr);else{let Lr=kt.zoomScale(kt.zoom-Lt),Hr=ae>Lt?Math.min(2,ye):Math.max(.5,ye),nn=Math.pow(Hr,1-gr),cn=kt.unproject(ce.add(Te.mult(gr*nn)).mult(Lr));kt.setLocationAtPoint(kt.renderWorldCopies?cn.wrap():cn,Jr)}this._applyUpdatedTransform(kt),this._fireMoveEvents(at)},gr=>{this.terrain&&L.freezeElevation&&this._finalizeElevation(),this._afterEase(at,gr)},L),this}_prepareEase(L,at,xt={}){this._moving=!0,at||xt.moving||this.fire(new e.k("movestart",L)),this._zooming&&!xt.zooming&&this.fire(new e.k("zoomstart",L)),this._rotating&&!xt.rotating&&this.fire(new e.k("rotatestart",L)),this._pitching&&!xt.pitching&&this.fire(new e.k("pitchstart",L))}_prepareElevation(L){this._elevationCenter=L,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(L,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(L){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let at=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(L<1&&at!==this._elevationTarget){let xt=this._elevationTarget-this._elevationStart;this._elevationStart+=L*(xt-(at-(xt*L+this._elevationStart))/(1-L)),this._elevationTarget=at}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,L)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(L){let at=L.getCameraPosition(),xt=this.terrain.getElevationForLngLatZoom(at.lngLat,L.zoom);if(at.altitudethis._elevateCameraIfInsideTerrain(kt)),this.transformCameraUpdate&&at.push(kt=>this.transformCameraUpdate(kt)),!at.length)return;let xt=L.clone();for(let kt of at){let Lt=xt.clone(),{center:le,zoom:xe,pitch:Pe,bearing:$e,elevation:hr}=kt(Lt);le&&(Lt.center=le),xe!==void 0&&(Lt.zoom=xe),Pe!==void 0&&(Lt.pitch=Pe),$e!==void 0&&(Lt.bearing=$e),hr!==void 0&&(Lt.elevation=hr),xt.apply(Lt)}this.transform.apply(xt)}_fireMoveEvents(L){this.fire(new e.k("move",L)),this._zooming&&this.fire(new e.k("zoom",L)),this._rotating&&this.fire(new e.k("rotate",L)),this._pitching&&this.fire(new e.k("pitch",L))}_afterEase(L,at){if(this._easeId&&at&&this._easeId===at)return;delete this._easeId;let xt=this._zooming,kt=this._rotating,Lt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,xt&&this.fire(new e.k("zoomend",L)),kt&&this.fire(new e.k("rotateend",L)),Lt&&this.fire(new e.k("pitchend",L)),this.fire(new e.k("moveend",L))}flyTo(L,at){var xt;if(!L.essential&&o.prefersReducedMotion){let La=e.M(L,["center","zoom","bearing","pitch","around"]);return this.jumpTo(La,at)}this.stop(),L=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},L);let kt=this._getTransformForUpdate(),Lt=kt.zoom,le=kt.bearing,xe=kt.pitch,Pe=kt.padding,$e="bearing"in L?this._normalizeBearing(L.bearing,le):le,hr="pitch"in L?+L.pitch:xe,pr="padding"in L?L.padding:kt.padding,Br=e.P.convert(L.offset),Jr=kt.centerPoint.add(Br),Rt=kt.pointLocation(Jr),{center:Gt,zoom:ae}=kt.getConstrained(e.N.convert(L.center||Rt),(xt=L.zoom)!==null&&xt!==void 0?xt:Lt);this._normalizeCenter(Gt,kt);let ce=kt.zoomScale(ae-Lt),Te=kt.project(Rt),ye=kt.project(Gt).sub(Te),ze=L.curve,rr=Math.max(kt.width,kt.height),fr=rr/ce,gr=ye.mag();if("minZoom"in L){let La=e.ac(Math.min(L.minZoom,Lt,ae),kt.minZoom,kt.maxZoom),ai=rr/kt.zoomScale(La-Lt);ze=Math.sqrt(ai/gr*2)}let Lr=ze*ze;function Hr(La){let ai=(fr*fr-rr*rr+(La?-1:1)*Lr*Lr*gr*gr)/(2*(La?fr:rr)*Lr*gr);return Math.log(Math.sqrt(ai*ai+1)-ai)}function nn(La){return(Math.exp(La)-Math.exp(-La))/2}function cn(La){return(Math.exp(La)+Math.exp(-La))/2}let Mn=Hr(!1),Jn=function(La){return cn(Mn)/cn(Mn+ze*La)},_a=function(La){return rr*((cn(Mn)*(nn(ai=Mn+ze*La)/cn(ai))-nn(Mn))/Lr)/gr;var ai},xa=(Hr(!0)-Mn)/ze;if(Math.abs(gr)<1e-6||!isFinite(xa)){if(Math.abs(rr-fr)<1e-6)return this.easeTo(L,at);let La=fr0,Jn=ai=>Math.exp(La*ze*ai)}return L.duration="duration"in L?+L.duration:1e3*xa/("screenSpeed"in L?+L.screenSpeed/ze:+L.speed),L.maxDuration&&L.duration>L.maxDuration&&(L.duration=0),this._zooming=!0,this._rotating=le!==$e,this._pitching=hr!==xe,this._padding=!kt.isPaddingEqual(pr),this._prepareEase(at,!1),this.terrain&&this._prepareElevation(Gt),this._ease(La=>{let ai=La*xa,Ai=1/Jn(ai);kt.zoom=La===1?ae:Lt+kt.scaleZoom(Ai),this._rotating&&(kt.bearing=e.y.number(le,$e,La)),this._pitching&&(kt.pitch=e.y.number(xe,hr,La)),this._padding&&(kt.interpolatePadding(Pe,pr,La),Jr=kt.centerPoint.add(Br)),this.terrain&&!L.freezeElevation&&this._updateElevation(La);let mi=La===1?Gt:kt.unproject(Te.add(ye.mult(_a(ai))).mult(Ai));kt.setLocationAtPoint(kt.renderWorldCopies?mi.wrap():mi,Jr),this._applyUpdatedTransform(kt),this._fireMoveEvents(at)},()=>{this.terrain&&L.freezeElevation&&this._finalizeElevation(),this._afterEase(at)},L),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(L,at){var xt;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let kt=this._onEaseEnd;delete this._onEaseEnd,kt.call(this,at)}return L||(xt=this.handlers)===null||xt===void 0||xt.stop(!1),this}_ease(L,at,xt){xt.animate===!1||xt.duration===0?(L(1),at()):(this._easeStart=o.now(),this._easeOptions=xt,this._onEaseFrame=L,this._onEaseEnd=at,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(L,at){L=e.b3(L,-180,180);let xt=Math.abs(L-at);return Math.abs(L-360-at)180?-360:xt<-180?360:0}queryTerrainElevation(L){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(L),this.transform.tileZoom)-this.transform.elevation:null}}let Wi={compact:!0,customAttribution:'MapLibre'};class Xi{constructor(L=Wi){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=at=>{!at||at.sourceDataType!=="metadata"&&at.sourceDataType!=="visibility"&&at.dataType!=="style"&&at.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=L}getDefaultPosition(){return"bottom-right"}onAdd(L){return this._map=L,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(L,at){let xt=this._map._getUIString(`AttributionControl.${at}`);L.title=xt,L.setAttribute("aria-label",xt)}_updateAttributions(){if(!this._map.style)return;let L=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?L=L.concat(this.options.customAttribution.map(kt=>typeof kt!="string"?"":kt)):typeof this.options.customAttribution=="string"&&L.push(this.options.customAttribution)),this._map.style.stylesheet){let kt=this._map.style.stylesheet;this.styleOwner=kt.owner,this.styleId=kt.id}let at=this._map.style.sourceCaches;for(let kt in at){let Lt=at[kt];if(Lt.used||Lt.usedForTerrain){let le=Lt.getSource();le.attribution&&L.indexOf(le.attribution)<0&&L.push(le.attribution)}}L=L.filter(kt=>String(kt).trim()),L.sort((kt,Lt)=>kt.length-Lt.length),L=L.filter((kt,Lt)=>{for(let le=Lt+1;le=0)return!1;return!0});let xt=L.join(" | ");xt!==this._attribHTML&&(this._attribHTML=xt,L.length?(this._innerContainer.innerHTML=xt,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ni{constructor(L={}){this._updateCompact=()=>{let at=this._container.children;if(at.length){let xt=at[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&xt.classList.add("maplibregl-compact"):xt.classList.remove("maplibregl-compact")}},this.options=L}getDefaultPosition(){return"bottom-left"}onAdd(L){this._map=L,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");let at=a.create("a","maplibregl-ctrl-logo");return at.target="_blank",at.rel="noopener nofollow",at.href="https://maplibre.org/",at.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),at.setAttribute("rel","noopener nofollow"),this._container.appendChild(at),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Za{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(L){let at=++this._id;return this._queue.push({callback:L,id:at,cancelled:!1}),at}remove(L){let at=this._currentlyRunning,xt=at?this._queue.concat(at):this._queue;for(let kt of xt)if(kt.id===L)return void(kt.cancelled=!0)}run(L=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let at=this._currentlyRunning=this._queue;this._queue=[];for(let xt of at)if(!xt.cancelled&&(xt.callback(L),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var $i=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Do extends e.E{constructor(L){super(),this.sourceCache=L,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,L.usedForTerrain=!0,L.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(L,at){this.sourceCache.update(L,at),this._renderableTilesKeys=[];let xt={};for(let kt of L.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:at}))xt[kt.key]=!0,this._renderableTilesKeys.push(kt.key),this._tiles[kt.key]||(kt.posMatrix=new Float64Array(16),e.aP(kt.posMatrix,0,e.X,0,e.X,0,1),this._tiles[kt.key]=new Kt(kt,this.tileSize));for(let kt in this._tiles)xt[kt]||delete this._tiles[kt]}freeRtt(L){for(let at in this._tiles){let xt=this._tiles[at];(!L||xt.tileID.equals(L)||xt.tileID.isChildOf(L)||L.isChildOf(xt.tileID))&&(xt.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(L=>this.getTileByID(L))}getTileByID(L){return this._tiles[L]}getTerrainCoords(L){let at={};for(let xt of this._renderableTilesKeys){let kt=this._tiles[xt].tileID;if(kt.canonical.equals(L.canonical)){let Lt=L.clone();Lt.posMatrix=new Float64Array(16),e.aP(Lt.posMatrix,0,e.X,0,e.X,0,1),at[xt]=Lt}else if(kt.canonical.isChildOf(L.canonical)){let Lt=L.clone();Lt.posMatrix=new Float64Array(16);let le=kt.canonical.z-L.canonical.z,xe=kt.canonical.x-(kt.canonical.x>>le<>le<>le;e.aP(Lt.posMatrix,0,$e,0,$e,0,1),e.J(Lt.posMatrix,Lt.posMatrix,[-xe*$e,-Pe*$e,0]),at[xt]=Lt}else if(L.canonical.isChildOf(kt.canonical)){let Lt=L.clone();Lt.posMatrix=new Float64Array(16);let le=L.canonical.z-kt.canonical.z,xe=L.canonical.x-(L.canonical.x>>le<>le<>le;e.aP(Lt.posMatrix,0,e.X,0,e.X,0,1),e.J(Lt.posMatrix,Lt.posMatrix,[xe*$e,Pe*$e,0]),e.K(Lt.posMatrix,Lt.posMatrix,[1/2**le,1/2**le,0]),at[xt]=Lt}}return at}getSourceTile(L,at){let xt=this.sourceCache._source,kt=L.overscaledZ-this.deltaZoom;if(kt>xt.maxzoom&&(kt=xt.maxzoom),kt=xt.minzoom&&(!Lt||!Lt.dem);)Lt=this.sourceCache.getTileByID(L.scaledTo(kt--).key);return Lt}tilesAfterTime(L=Date.now()){return Object.values(this._tiles).filter(at=>at.timeAdded>=L)}}class ss{constructor(L,at,xt){this.painter=L,this.sourceCache=new Do(at),this.options=xt,this.exaggeration=typeof xt.exaggeration=="number"?xt.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(L,at,xt,kt=e.X){var Lt;if(!(at>=0&&at=0&&xtL.canonical.z&&(L.canonical.z>=kt?Lt=L.canonical.z-kt:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let le=L.canonical.x-(L.canonical.x>>Lt<>Lt<>8<<4|Lt>>8,at[le+3]=0;let xt=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(at.buffer)),kt=new h(L,xt,L.gl.RGBA,{premultiply:!1});return kt.bind(L.gl.NEAREST,L.gl.CLAMP_TO_EDGE),this._coordsTexture=kt,kt}pointCoordinate(L){this.painter.maybeDrawDepthAndCoords(!0);let at=new Uint8Array(4),xt=this.painter.context,kt=xt.gl,Lt=Math.round(L.x*this.painter.pixelRatio/devicePixelRatio),le=Math.round(L.y*this.painter.pixelRatio/devicePixelRatio),xe=Math.round(this.painter.height/devicePixelRatio);xt.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),kt.readPixels(Lt,xe-le-1,1,1,kt.RGBA,kt.UNSIGNED_BYTE,at),xt.bindFramebuffer.set(null);let Pe=at[0]+(at[2]>>4<<8),$e=at[1]+((15&at[2])<<8),hr=this.coordsIndex[255-at[3]],pr=hr&&this.sourceCache.getTileByID(hr);if(!pr)return null;let Br=this._coordsTextureSize,Jr=(1<L.id!==at),this._recentlyUsed.push(L.id)}stampObject(L){L.stamp=++this._stamp}getOrCreateFreeObject(){for(let at of this._recentlyUsed)if(!this._objects[at].inUse)return this._objects[at];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let L=this._createObject(this._objects.length);return this._objects.push(L),L}freeObject(L){L.inUse=!1}freeAllObjects(){for(let L of this._objects)this.freeObject(L)}isFull(){return!(this._objects.length!L.inUse)===!1}}let ys={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Os{constructor(L,at){this.painter=L,this.terrain=at,this.pool=new Ps(L.context,30,at.sourceCache.tileSize*at.qualityFactor)}destruct(){this.pool.destruct()}getTexture(L){return this.pool.getObjectForId(L.rtt[this._stacks.length-1].id).texture}prepareForRender(L,at){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=L._order.filter(xt=>!L._layers[xt].isHidden(at)),this._coordsDescendingInv={};for(let xt in L.sourceCaches){this._coordsDescendingInv[xt]={};let kt=L.sourceCaches[xt].getVisibleCoordinates();for(let Lt of kt){let le=this.terrain.sourceCache.getTerrainCoords(Lt);for(let xe in le)this._coordsDescendingInv[xt][xe]||(this._coordsDescendingInv[xt][xe]=[]),this._coordsDescendingInv[xt][xe].push(le[xe])}}this._coordsDescendingInvStr={};for(let xt of L._order){let kt=L._layers[xt],Lt=kt.source;if(ys[kt.type]&&!this._coordsDescendingInvStr[Lt]){this._coordsDescendingInvStr[Lt]={};for(let le in this._coordsDescendingInv[Lt])this._coordsDescendingInvStr[Lt][le]=this._coordsDescendingInv[Lt][le].map(xe=>xe.key).sort().join()}}for(let xt of this._renderableTiles)for(let kt in this._coordsDescendingInvStr){let Lt=this._coordsDescendingInvStr[kt][xt.tileID.key];Lt&&Lt!==xt.rttCoords[kt]&&(xt.rtt=[])}}renderLayer(L){if(L.isHidden(this.painter.transform.zoom))return!1;let at=L.type,xt=this.painter,kt=this._renderableLayerIds[this._renderableLayerIds.length-1]===L.id;if(ys[at]&&(this._prevType&&ys[this._prevType]||this._stacks.push([]),this._prevType=at,this._stacks[this._stacks.length-1].push(L.id),!kt))return!0;if(ys[this._prevType]||ys[at]&&kt){this._prevType=at;let Lt=this._stacks.length-1,le=this._stacks[Lt]||[];for(let xe of this._renderableTiles){if(this.pool.isFull()&&(rl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(xe),xe.rtt[Lt]){let $e=this.pool.getObjectForId(xe.rtt[Lt].id);if($e.stamp===xe.rtt[Lt].stamp){this.pool.useObject($e);continue}}let Pe=this.pool.getOrCreateFreeObject();this.pool.useObject(Pe),this.pool.stampObject(Pe),xe.rtt[Lt]={id:Pe.id,stamp:Pe.stamp},xt.context.bindFramebuffer.set(Pe.fbo.framebuffer),xt.context.clear({color:e.aM.transparent,stencil:0}),xt.currentStencilSource=void 0;for(let $e=0;$e{Pt.touchstart=Pt.dragStart,Pt.touchmoveWindow=Pt.dragMove,Pt.touchend=Pt.dragEnd},bi={showCompass:!0,showZoom:!0,visualizePitch:!1};class so{constructor(L,at,xt=!1){this.mousedown=le=>{this.startMouse(e.e({},le,{ctrlKey:!0,preventDefault:()=>le.preventDefault()}),a.mousePos(this.element,le)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=le=>{this.moveMouse(le,a.mousePos(this.element,le))},this.mouseup=le=>{this.mouseRotate.dragEnd(le),this.mousePitch&&this.mousePitch.dragEnd(le),this.offTemp()},this.touchstart=le=>{le.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,le.targetTouches)[0],this.startTouch(le,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=le=>{le.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,le.targetTouches)[0],this.moveTouch(le,this._lastPos))},this.touchend=le=>{le.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let kt=L.dragRotate._mouseRotate.getClickTolerance(),Lt=L.dragRotate._mousePitch.getClickTolerance();this.element=at,this.mouseRotate=zl({clickTolerance:kt,enable:!0}),this.touchRotate=(({enable:le,clickTolerance:xe,bearingDegreesPerPixelMoved:Pe=.8})=>{let $e=new yc;return new ou({clickTolerance:xe,move:(hr,pr)=>({bearingDelta:(pr.x-hr.x)*Pe}),moveStateManager:$e,enable:le,assignEvents:Rs})})({clickTolerance:kt,enable:!0}),this.map=L,xt&&(this.mousePitch=Uc({clickTolerance:Lt,enable:!0}),this.touchPitch=(({enable:le,clickTolerance:xe,pitchDegreesPerPixelMoved:Pe=-.5})=>{let $e=new yc;return new ou({clickTolerance:xe,move:(hr,pr)=>({pitchDelta:(pr.y-hr.y)*Pe}),moveStateManager:$e,enable:le,assignEvents:Rs})})({clickTolerance:Lt,enable:!0})),a.addEventListener(at,"mousedown",this.mousedown),a.addEventListener(at,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(at,"touchcancel",this.reset)}startMouse(L,at){this.mouseRotate.dragStart(L,at),this.mousePitch&&this.mousePitch.dragStart(L,at),a.disableDrag()}startTouch(L,at){this.touchRotate.dragStart(L,at),this.touchPitch&&this.touchPitch.dragStart(L,at),a.disableDrag()}moveMouse(L,at){let xt=this.map,{bearingDelta:kt}=this.mouseRotate.dragMove(L,at)||{};if(kt&&xt.setBearing(xt.getBearing()+kt),this.mousePitch){let{pitchDelta:Lt}=this.mousePitch.dragMove(L,at)||{};Lt&&xt.setPitch(xt.getPitch()+Lt)}}moveTouch(L,at){let xt=this.map,{bearingDelta:kt}=this.touchRotate.dragMove(L,at)||{};if(kt&&xt.setBearing(xt.getBearing()+kt),this.touchPitch){let{pitchDelta:Lt}=this.touchPitch.dragMove(L,at)||{};Lt&&xt.setPitch(xt.getPitch()+Lt)}}off(){let L=this.element;a.removeEventListener(L,"mousedown",this.mousedown),a.removeEventListener(L,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(L,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let ws;function fs(Pt,L,at){let xt=new e.N(Pt.lng,Pt.lat);if(Pt=new e.N(Pt.lng,Pt.lat),L){let kt=new e.N(Pt.lng-360,Pt.lat),Lt=new e.N(Pt.lng+360,Pt.lat),le=at.locationPoint(Pt).distSqr(L);at.locationPoint(kt).distSqr(L)180;){let kt=at.locationPoint(Pt);if(kt.x>=0&&kt.y>=0&&kt.x<=at.width&&kt.y<=at.height)break;Pt.lng>at.center.lng?Pt.lng-=360:Pt.lng+=360}return Pt.lng!==xt.lng&&at.locationPoint(Pt).y>at.height/2-at.getHorizon()?Pt:xt}let Ll={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function $l(Pt,L,at){let xt=Pt.classList;for(let kt in Ll)xt.remove(`maplibregl-${at}-anchor-${kt}`);xt.add(`maplibregl-${at}-anchor-${L}`)}class jl extends e.E{constructor(L){if(super(),this._onKeyPress=at=>{let xt=at.code,kt=at.charCode||at.keyCode;xt!=="Space"&&xt!=="Enter"&&kt!==32&&kt!==13||this.togglePopup()},this._onMapClick=at=>{let xt=at.originalEvent.target,kt=this._element;this._popup&&(xt===kt||kt.contains(xt))&&this.togglePopup()},this._update=at=>{var xt;if(!this._map)return;let kt=this._map.loaded()&&!this._map.isMoving();(at?.type==="terrain"||at?.type==="render"&&!kt)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?fs(this._lngLat,this._flatPos,this._map.transform):(xt=this._lngLat)===null||xt===void 0?void 0:xt.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Lt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Lt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Lt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let le="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?le="rotateX(0deg)":this._pitchAlignment==="map"&&(le=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||at&&at.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${Ll[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${le} ${Lt}`),o.frameAsync(new AbortController).then(()=>{this._updateOpacity(at&&at.type==="moveend")}).catch(()=>{})},this._onMove=at=>{if(!this._isDragging){let xt=this._clickTolerance||this._map._clickTolerance;this._isDragging=at.point.dist(this._pointerdownPos)>=xt}this._isDragging&&(this._pos=at.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=at=>{this._element.contains(at.originalEvent.target)&&(at.preventDefault(),this._positionDelta=at.point.sub(this._pos).add(this._offset),this._pointerdownPos=at.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=L&&L.anchor||"center",this._color=L&&L.color||"#3FB1CE",this._scale=L&&L.scale||1,this._draggable=L&&L.draggable||!1,this._clickTolerance=L&&L.clickTolerance||0,this._subpixelPositioning=L&&L.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=L&&L.rotation||0,this._rotationAlignment=L&&L.rotationAlignment||"auto",this._pitchAlignment=L&&L.pitchAlignment&&L.pitchAlignment!=="auto"?L.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(L?.opacity,L?.opacityWhenCovered),L&&L.element)this._element=L.element,this._offset=e.P.convert(L&&L.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");let at=a.createNS("http://www.w3.org/2000/svg","svg"),xt=41,kt=27;at.setAttributeNS(null,"display","block"),at.setAttributeNS(null,"height",`${xt}px`),at.setAttributeNS(null,"width",`${kt}px`),at.setAttributeNS(null,"viewBox",`0 0 ${kt} ${xt}`);let Lt=a.createNS("http://www.w3.org/2000/svg","g");Lt.setAttributeNS(null,"stroke","none"),Lt.setAttributeNS(null,"stroke-width","1"),Lt.setAttributeNS(null,"fill","none"),Lt.setAttributeNS(null,"fill-rule","evenodd");let le=a.createNS("http://www.w3.org/2000/svg","g");le.setAttributeNS(null,"fill-rule","nonzero");let xe=a.createNS("http://www.w3.org/2000/svg","g");xe.setAttributeNS(null,"transform","translate(3.0, 29.0)"),xe.setAttributeNS(null,"fill","#000000");let Pe=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let ce of Pe){let Te=a.createNS("http://www.w3.org/2000/svg","ellipse");Te.setAttributeNS(null,"opacity","0.04"),Te.setAttributeNS(null,"cx","10.5"),Te.setAttributeNS(null,"cy","5.80029008"),Te.setAttributeNS(null,"rx",ce.rx),Te.setAttributeNS(null,"ry",ce.ry),xe.appendChild(Te)}let $e=a.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"fill",this._color);let hr=a.createNS("http://www.w3.org/2000/svg","path");hr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),$e.appendChild(hr);let pr=a.createNS("http://www.w3.org/2000/svg","g");pr.setAttributeNS(null,"opacity","0.25"),pr.setAttributeNS(null,"fill","#000000");let Br=a.createNS("http://www.w3.org/2000/svg","path");Br.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),pr.appendChild(Br);let Jr=a.createNS("http://www.w3.org/2000/svg","g");Jr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Jr.setAttributeNS(null,"fill","#FFFFFF");let Rt=a.createNS("http://www.w3.org/2000/svg","g");Rt.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Gt=a.createNS("http://www.w3.org/2000/svg","circle");Gt.setAttributeNS(null,"fill","#000000"),Gt.setAttributeNS(null,"opacity","0.25"),Gt.setAttributeNS(null,"cx","5.5"),Gt.setAttributeNS(null,"cy","5.5"),Gt.setAttributeNS(null,"r","5.4999962");let ae=a.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#FFFFFF"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962"),Rt.appendChild(Gt),Rt.appendChild(ae),le.appendChild(xe),le.appendChild($e),le.appendChild(pr),le.appendChild(Jr),le.appendChild(Rt),at.appendChild(le),at.setAttributeNS(null,"height",xt*this._scale+"px"),at.setAttributeNS(null,"width",kt*this._scale+"px"),this._element.appendChild(at),this._offset=e.P.convert(L&&L.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",at=>{at.preventDefault()}),this._element.addEventListener("mousedown",at=>{at.preventDefault()}),$l(this._element,this._anchor,"marker"),L&&L.className)for(let at of L.className.split(" "))this._element.classList.add(at);this._popup=null}addTo(L){return this.remove(),this._map=L,this._element.setAttribute("aria-label",L._getUIString("Marker.Title")),L.getCanvasContainer().appendChild(this._element),L.on("move",this._update),L.on("moveend",this._update),L.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(L){return this._lngLat=e.N.convert(L),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(L){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),L){if(!("offset"in L.options)){let at=Math.abs(13.5)/Math.SQRT2;L.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[at,-1*(38.1-13.5+at)],"bottom-right":[-at,-1*(38.1-13.5+at)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=L,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(L){return this._subpixelPositioning=L,this}getPopup(){return this._popup}togglePopup(){let L=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:L?(L.isOpen()?L.remove():(L.setLngLat(this._lngLat),L.addTo(this._map)),this):this}_updateOpacity(L=!1){var at,xt;if(!(!((at=this._map)===null||at===void 0)&&at.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(L)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let kt=this._map,Lt=kt.terrain.depthAtPoint(this._pos),le=kt.terrain.getElevationForLngLatZoom(this._lngLat,kt.transform.tileZoom);if(kt.transform.lngLatToCameraDepth(this._lngLat,le)-Lt<.006)return void(this._element.style.opacity=this._opacity);let xe=-this._offset.y/kt.transform._pixelPerMeter,Pe=Math.sin(kt.getPitch()*Math.PI/180)*xe,$e=kt.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),hr=kt.transform.lngLatToCameraDepth(this._lngLat,le+Pe)-$e>.006;!((xt=this._popup)===null||xt===void 0)&&xt.isOpen()&&hr&&this._popup.remove(),this._element.style.opacity=hr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(L){return this._offset=e.P.convert(L),this._update(),this}addClassName(L){this._element.classList.add(L)}removeClassName(L){this._element.classList.remove(L)}toggleClassName(L){return this._element.classList.toggle(L)}setDraggable(L){return this._draggable=!!L,this._map&&(L?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(L){return this._rotation=L||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(L){return this._rotationAlignment=L||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(L){return this._pitchAlignment=L&&L!=="auto"?L:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(L,at){return L===void 0&&at===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),L!==void 0&&(this._opacity=L),at!==void 0&&(this._opacityWhenCovered=at),this._map&&this._updateOpacity(!0),this}}let Bu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Jl=0,Ru=!1,nl={maxWidth:100,unit:"metric"};function Nu(Pt,L,at){let xt=at&&at.maxWidth||100,kt=Pt._container.clientHeight/2,Lt=Pt.unproject([0,kt]),le=Pt.unproject([xt,kt]),xe=Lt.distanceTo(le);if(at&&at.unit==="imperial"){let Pe=3.2808*xe;Pe>5280?Ui(L,xt,Pe/5280,Pt._getUIString("ScaleControl.Miles")):Ui(L,xt,Pe,Pt._getUIString("ScaleControl.Feet"))}else at&&at.unit==="nautical"?Ui(L,xt,xe/1852,Pt._getUIString("ScaleControl.NauticalMiles")):xe>=1e3?Ui(L,xt,xe/1e3,Pt._getUIString("ScaleControl.Kilometers")):Ui(L,xt,xe,Pt._getUIString("ScaleControl.Meters"))}function Ui(Pt,L,at,xt){let kt=(function(Lt){let le=Math.pow(10,`${Math.floor(Lt)}`.length-1),xe=Lt/le;return xe=xe>=10?10:xe>=5?5:xe>=3?3:xe>=2?2:xe>=1?1:(function(Pe){let $e=Math.pow(10,Math.ceil(-Math.log(Pe)/Math.LN10));return Math.round(Pe*$e)/$e})(xe),le*xe})(at);Pt.style.width=L*(kt/at)+"px",Pt.innerHTML=`${kt} ${xt}`}let fo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Ql=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ul(Pt){if(Pt){if(typeof Pt=="number"){let L=Math.round(Math.abs(Pt)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,Pt),"top-left":new e.P(L,L),"top-right":new e.P(-L,L),bottom:new e.P(0,-Pt),"bottom-left":new e.P(L,-L),"bottom-right":new e.P(-L,-L),left:new e.P(Pt,0),right:new e.P(-Pt,0)}}if(Pt instanceof e.P||Array.isArray(Pt)){let L=e.P.convert(Pt);return{center:L,top:L,"top-left":L,"top-right":L,bottom:L,"bottom-left":L,"bottom-right":L,left:L,right:L}}return{center:e.P.convert(Pt.center||[0,0]),top:e.P.convert(Pt.top||[0,0]),"top-left":e.P.convert(Pt["top-left"]||[0,0]),"top-right":e.P.convert(Pt["top-right"]||[0,0]),bottom:e.P.convert(Pt.bottom||[0,0]),"bottom-left":e.P.convert(Pt["bottom-left"]||[0,0]),"bottom-right":e.P.convert(Pt["bottom-right"]||[0,0]),left:e.P.convert(Pt.left||[0,0]),right:e.P.convert(Pt.right||[0,0])}}return ul(new e.P(0,0))}let Dc=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Xi,t.BoxZoomHandler=Xl,t.CanvasSource=ee,t.CooperativeGesturesHandler=Ba,t.DoubleClickZoomHandler=Pn,t.DragPanHandler=Ua,t.DragRotateHandler=Ya,t.EdgeInsets=Rl,t.FullscreenControl=class extends e.E{constructor(Pt={}){super(),this._onFullscreenChange=()=>{var L;let at=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((L=at?.shadowRoot)===null||L===void 0)&&L.fullscreenElement;)at=at.shadowRoot.fullscreenElement;at===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Pt&&Pt.container&&(Pt.container instanceof HTMLElement?this._container=Pt.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Pt){return this._map=Pt,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Pt=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Pt).setAttribute("aria-hidden","true"),Pt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Pt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Pt),this._fullscreenButton.title=Pt}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=It,t.GeolocateControl=class extends e.E{constructor(Pt){super(),this._onSuccess=L=>{if(this._map){if(this._isOutOfMapMaxBounds(L))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",L)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=L,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(L),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(L),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",L)),this._finish()}},this._updateCamera=L=>{let at=new e.N(L.coords.longitude,L.coords.latitude),xt=L.coords.accuracy,kt=this._map.getBearing(),Lt=e.e({bearing:kt},this.options.fitBoundsOptions),le=nt.fromLngLat(at,xt);this._map.fitBounds(le,Lt,{geolocateSource:!0})},this._updateMarker=L=>{if(L){let at=new e.N(L.coords.longitude,L.coords.latitude);this._accuracyCircleMarker.setLngLat(at).addTo(this._map),this._userLocationDotMarker.setLngLat(at).addTo(this._map),this._accuracy=L.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=L=>{if(this._map){if(this.options.trackUserLocation)if(L.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let at=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(L.code===3&&Ru)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",L)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",L=>L.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=L=>{if(this._map){if(L===!1){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let at=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at)}else{let at=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new jl({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",at=>{at.geolocateSource||this._watchState!=="ACTIVE_LOCK"||at.originalEvent&&at.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},Bu,Pt)}onAdd(Pt){return this._map=Pt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return e._(this,arguments,void 0,function*(L=!1){if(ws!==void 0&&!L)return ws;if(window.navigator.permissions===void 0)return ws=!!window.navigator.geolocation,ws;try{ws=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ws=!!window.navigator.geolocation}return ws})})().then(L=>this._finishSetupUI(L)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Jl=0,Ru=!1}_isOutOfMapMaxBounds(Pt){let L=this._map.getMaxBounds(),at=Pt.coords;return L&&(at.longitudeL.getEast()||at.latitudeL.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Pt=this._map.getBounds(),L=Pt.getSouthEast(),at=Pt.getNorthEast(),xt=L.distanceTo(at),kt=Math.ceil(this._accuracy/(xt/this._map._container.clientHeight)*2);this._circleElement.style.width=`${kt}px`,this._circleElement.style.height=`${kt}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Jl--,Ru=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Pt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Jl++,Jl>1?(Pt={maximumAge:6e5,timeout:0},Ru=!0):(Pt=this.options.positionOptions,Ru=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Pt)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=Tu,t.ImageSource=te,t.KeyboardHandler=yr,t.LngLatBounds=nt,t.LogoControl=ni,t.Map=class extends Oi{constructor(Pt){e.bf.mark(e.bg.create);let L=Object.assign(Object.assign({},el),Pt);if(L.minZoom!=null&&L.maxZoom!=null&&L.minZoom>L.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(L.minPitch!=null&&L.maxPitch!=null&&L.minPitch>L.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(L.minPitch!=null&&L.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(L.maxPitch!=null&&L.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ws(L.minZoom,L.maxZoom,L.minPitch,L.maxPitch,L.renderWorldCopies),{bearingSnap:L.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Za,this._controls=[],this._mapId=e.a4(),this._contextLost=at=>{at.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:at}))},this._contextRestored=at=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:at}))},this._onMapScroll=at=>{if(at.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=L.interactive,this._maxTileCacheSize=L.maxTileCacheSize,this._maxTileCacheZoomLevels=L.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=L.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=L.preserveDrawingBuffer===!0,this._antialias=L.antialias===!0,this._trackResize=L.trackResize===!0,this._bearingSnap=L.bearingSnap,this._refreshExpiredTiles=L.refreshExpiredTiles===!0,this._fadeDuration=L.fadeDuration,this._crossSourceCollisions=L.crossSourceCollisions===!0,this._collectResourceTiming=L.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Yo),L.locale),this._clickTolerance=L.clickTolerance,this._overridePixelRatio=L.pixelRatio,this._maxCanvasSize=L.maxCanvasSize,this.transformCameraUpdate=L.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=L.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new x(L.transformRequest),typeof L.container=="string"){if(this._container=document.getElementById(L.container),!this._container)throw new Error(`Container '${L.container}' not found.`)}else{if(!(L.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=L.container}if(L.maxBounds&&this.setMaxBounds(L.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let at=!1,xt=ac(kt=>{this._trackResize&&!this._removed&&(this.resize(kt),this.redraw())},50);this._resizeObserver=new ResizeObserver(kt=>{at?xt(kt):at=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Vi(this,L),this._hash=L.hash&&new Tu(typeof L.hash=="string"&&L.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:L.center,zoom:L.zoom,bearing:L.bearing,pitch:L.pitch}),L.bounds&&(this.resize(),this.fitBounds(L.bounds,e.e({},L.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=L.localIdeographFontFamily,this._validateStyle=L.validateStyle,L.style&&this.setStyle(L.style,{localIdeographFontFamily:L.localIdeographFontFamily}),L.attributionControl&&this.addControl(new Xi(typeof L.attributionControl=="boolean"?void 0:L.attributionControl)),L.maplibreLogo&&this.addControl(new ni,L.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",at=>{this._update(at.dataType==="style"),this.fire(new e.k(`${at.dataType}data`,at))}),this.on("dataloading",at=>{this.fire(new e.k(`${at.dataType}dataloading`,at))}),this.on("dataabort",at=>{this.fire(new e.k("sourcedataabort",at))})}_getMapId(){return this._mapId}addControl(Pt,L){if(L===void 0&&(L=Pt.getDefaultPosition?Pt.getDefaultPosition():"top-right"),!Pt||!Pt.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let at=Pt.onAdd(this);this._controls.push(Pt);let xt=this._controlPositions[L];return L.indexOf("bottom")!==-1?xt.insertBefore(at,xt.firstChild):xt.appendChild(at),this}removeControl(Pt){if(!Pt||!Pt.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let L=this._controls.indexOf(Pt);return L>-1&&this._controls.splice(L,1),Pt.onRemove(this),this}hasControl(Pt){return this._controls.indexOf(Pt)>-1}calculateCameraOptionsFromTo(Pt,L,at,xt){return xt==null&&this.terrain&&(xt=this.terrain.getElevationForLngLatZoom(at,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Pt,L,at,xt)}resize(Pt){var L;let at=this._containerDimensions(),xt=at[0],kt=at[1],Lt=this._getClampedPixelRatio(xt,kt);if(this._resizeCanvas(xt,kt,Lt),this.painter.resize(xt,kt,Lt),this.painter.overLimit()){let xe=this.painter.context.gl;this._maxCanvasSize=[xe.drawingBufferWidth,xe.drawingBufferHeight];let Pe=this._getClampedPixelRatio(xt,kt);this._resizeCanvas(xt,kt,Pe),this.painter.resize(xt,kt,Pe)}this.transform.resize(xt,kt),(L=this._requestedCameraState)===null||L===void 0||L.resize(xt,kt);let le=!this._moving;return le&&(this.stop(),this.fire(new e.k("movestart",Pt)).fire(new e.k("move",Pt))),this.fire(new e.k("resize",Pt)),le&&this.fire(new e.k("moveend",Pt)),this}_getClampedPixelRatio(Pt,L){let{0:at,1:xt}=this._maxCanvasSize,kt=this.getPixelRatio(),Lt=Pt*kt,le=L*kt;return Math.min(Lt>at?at/Lt:1,le>xt?xt/le:1)*kt}getPixelRatio(){var Pt;return(Pt=this._overridePixelRatio)!==null&&Pt!==void 0?Pt:devicePixelRatio}setPixelRatio(Pt){this._overridePixelRatio=Pt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Pt){return this.transform.setMaxBounds(nt.convert(Pt)),this._update()}setMinZoom(Pt){if((Pt=Pt??-2)>=-2&&Pt<=this.transform.maxZoom)return this.transform.minZoom=Pt,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Pt,this._update(),this.getZoom()>Pt&&this.setZoom(Pt),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Pt){if((Pt=Pt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Pt>=0&&Pt<=this.transform.maxPitch)return this.transform.minPitch=Pt,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Pt>=this.transform.minPitch)return this.transform.maxPitch=Pt,this._update(),this.getPitch()>Pt&&this.setPitch(Pt),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Pt){return this.transform.renderWorldCopies=Pt,this._update()}project(Pt){return this.transform.locationPoint(e.N.convert(Pt),this.style&&this.terrain)}unproject(Pt){return this.transform.pointLocation(e.P.convert(Pt),this.terrain)}isMoving(){var Pt;return this._moving||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isMoving())}isZooming(){var Pt;return this._zooming||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isZooming())}isRotating(){var Pt;return this._rotating||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isRotating())}_createDelegatedListener(Pt,L,at){if(Pt==="mouseenter"||Pt==="mouseover"){let xt=!1;return{layers:L,listener:at,delegates:{mousemove:kt=>{let Lt=L.filter(xe=>this.getLayer(xe)),le=Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[];le.length?xt||(xt=!0,at.call(this,new iu(Pt,this,kt.originalEvent,{features:le}))):xt=!1},mouseout:()=>{xt=!1}}}}if(Pt==="mouseleave"||Pt==="mouseout"){let xt=!1;return{layers:L,listener:at,delegates:{mousemove:kt=>{let Lt=L.filter(le=>this.getLayer(le));(Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[]).length?xt=!0:xt&&(xt=!1,at.call(this,new iu(Pt,this,kt.originalEvent)))},mouseout:kt=>{xt&&(xt=!1,at.call(this,new iu(Pt,this,kt.originalEvent)))}}}}{let xt=kt=>{let Lt=L.filter(xe=>this.getLayer(xe)),le=Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[];le.length&&(kt.features=le,at.call(this,kt),delete kt.features)};return{layers:L,listener:at,delegates:{[Pt]:xt}}}}_saveDelegatedListener(Pt,L){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Pt]=this._delegatedListeners[Pt]||[],this._delegatedListeners[Pt].push(L)}_removeDelegatedListener(Pt,L,at){if(!this._delegatedListeners||!this._delegatedListeners[Pt])return;let xt=this._delegatedListeners[Pt];for(let kt=0;ktL.includes(le))){for(let le in Lt.delegates)this.off(le,Lt.delegates[le]);return void xt.splice(kt,1)}}}on(Pt,L,at){if(at===void 0)return super.on(Pt,L);let xt=this._createDelegatedListener(Pt,typeof L=="string"?[L]:L,at);this._saveDelegatedListener(Pt,xt);for(let kt in xt.delegates)this.on(kt,xt.delegates[kt]);return this}once(Pt,L,at){if(at===void 0)return super.once(Pt,L);let xt=typeof L=="string"?[L]:L,kt=this._createDelegatedListener(Pt,xt,at);for(let Lt in kt.delegates){let le=kt.delegates[Lt];kt.delegates[Lt]=(...xe)=>{this._removeDelegatedListener(Pt,xt,at),le(...xe)}}this._saveDelegatedListener(Pt,kt);for(let Lt in kt.delegates)this.once(Lt,kt.delegates[Lt]);return this}off(Pt,L,at){return at===void 0?super.off(Pt,L):(this._removeDelegatedListener(Pt,typeof L=="string"?[L]:L,at),this)}queryRenderedFeatures(Pt,L){if(!this.style)return[];let at,xt=Pt instanceof e.P||Array.isArray(Pt),kt=xt?Pt:[[0,0],[this.transform.width,this.transform.height]];if(L=L||(xt?{}:Pt)||{},kt instanceof e.P||typeof kt[0]=="number")at=[e.P.convert(kt)];else{let Lt=e.P.convert(kt[0]),le=e.P.convert(kt[1]);at=[Lt,new e.P(le.x,Lt.y),le,new e.P(Lt.x,le.y),Lt]}return this.style.queryRenderedFeatures(at,L,this.transform)}querySourceFeatures(Pt,L){return this.style.querySourceFeatures(Pt,L)}setStyle(Pt,L){return(L=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},L)).diff!==!1&&L.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Pt?(this._diffStyle(Pt,L),this):(this._localIdeographFontFamily=L.localIdeographFontFamily,this._updateStyle(Pt,L))}setTransformRequest(Pt){return this._requestManager.setTransformRequest(Pt),this}_getUIString(Pt){let L=this._locale[Pt];if(L==null)throw new Error(`Missing UI string '${Pt}'`);return L}_updateStyle(Pt,L){if(L.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Pt,L));let at=this.style&&L.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Pt)),Pt?(this.style=new kr(this,L||{}),this.style.setEventedParent(this,{style:this.style}),typeof Pt=="string"?this.style.loadURL(Pt,L,at):this.style.loadJSON(Pt,L,at),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new kr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Pt,L){if(typeof Pt=="string"){let at=this._requestManager.transformRequest(Pt,"Style");e.h(at,new AbortController).then(xt=>{this._updateDiff(xt.data,L)}).catch(xt=>{xt&&this.fire(new e.j(xt))})}else typeof Pt=="object"&&this._updateDiff(Pt,L)}_updateDiff(Pt,L){try{this.style.setState(Pt,L)&&this._update(!0)}catch(at){e.w(`Unable to perform style diff: ${at.message||at.error||at}. Rebuilding the style from scratch.`),this._updateStyle(Pt,L)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(Pt,L){return this._lazyInitEmptyStyle(),this.style.addSource(Pt,L),this._update(!0)}isSourceLoaded(Pt){let L=this.style&&this.style.sourceCaches[Pt];if(L!==void 0)return L.loaded();this.fire(new e.j(new Error(`There is no source with ID '${Pt}'`)))}setTerrain(Pt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Pt){let L=this.style.sourceCaches[Pt.source];if(!L)throw new Error(`cannot load terrain, because there exists no source with ID: ${Pt.source}`);this.terrain===null&&L.reload();for(let at in this.style._layers){let xt=this.style._layers[at];xt.type==="hillshade"&&xt.source===Pt.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ss(this.painter,L,Pt),this.painter.renderToTexture=new Os(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=at=>{at.dataType==="style"?this.terrain.sourceCache.freeRtt():at.dataType==="source"&&at.tile&&(at.sourceId!==Pt.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(at.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:Pt})),this}getTerrain(){var Pt,L;return(L=(Pt=this.terrain)===null||Pt===void 0?void 0:Pt.options)!==null&&L!==void 0?L:null}areTilesLoaded(){let Pt=this.style&&this.style.sourceCaches;for(let L in Pt){let at=Pt[L]._tiles;for(let xt in at){let kt=at[xt];if(kt.state!=="loaded"&&kt.state!=="errored")return!1}}return!0}removeSource(Pt){return this.style.removeSource(Pt),this._update(!0)}getSource(Pt){return this.style.getSource(Pt)}addImage(Pt,L,at={}){let{pixelRatio:xt=1,sdf:kt=!1,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e}=at;if(this._lazyInitEmptyStyle(),!(L instanceof HTMLImageElement||e.b(L))){if(L.width===void 0||L.height===void 0)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:hr,height:pr,data:Br}=L,Jr=L;return this.style.addImage(Pt,{data:new e.R({width:hr,height:pr},new Uint8Array(Br)),pixelRatio:xt,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e,sdf:kt,version:0,userImage:Jr}),Jr.onAdd&&Jr.onAdd(this,Pt),this}}{let{width:hr,height:pr,data:Br}=o.getImageData(L);this.style.addImage(Pt,{data:new e.R({width:hr,height:pr},Br),pixelRatio:xt,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e,sdf:kt,version:0})}}updateImage(Pt,L){let at=this.style.getImage(Pt);if(!at)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let xt=L instanceof HTMLImageElement||e.b(L)?o.getImageData(L):L,{width:kt,height:Lt,data:le}=xt;if(kt===void 0||Lt===void 0)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(kt!==at.data.width||Lt!==at.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let xe=!(L instanceof HTMLImageElement||e.b(L));return at.data.replace(le,xe),this.style.updateImage(Pt,at),this}getImage(Pt){return this.style.getImage(Pt)}hasImage(Pt){return Pt?!!this.style.getImage(Pt):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(Pt){this.style.removeImage(Pt)}loadImage(Pt){return l.getImage(this._requestManager.transformRequest(Pt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Pt,L){return this._lazyInitEmptyStyle(),this.style.addLayer(Pt,L),this._update(!0)}moveLayer(Pt,L){return this.style.moveLayer(Pt,L),this._update(!0)}removeLayer(Pt){return this.style.removeLayer(Pt),this._update(!0)}getLayer(Pt){return this.style.getLayer(Pt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Pt,L,at){return this.style.setLayerZoomRange(Pt,L,at),this._update(!0)}setFilter(Pt,L,at={}){return this.style.setFilter(Pt,L,at),this._update(!0)}getFilter(Pt){return this.style.getFilter(Pt)}setPaintProperty(Pt,L,at,xt={}){return this.style.setPaintProperty(Pt,L,at,xt),this._update(!0)}getPaintProperty(Pt,L){return this.style.getPaintProperty(Pt,L)}setLayoutProperty(Pt,L,at,xt={}){return this.style.setLayoutProperty(Pt,L,at,xt),this._update(!0)}getLayoutProperty(Pt,L){return this.style.getLayoutProperty(Pt,L)}setGlyphs(Pt,L={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Pt,L),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Pt,L,at={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Pt,L,at,xt=>{xt||this._update(!0)}),this}removeSprite(Pt){return this._lazyInitEmptyStyle(),this.style.removeSprite(Pt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Pt,L={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Pt,L,at=>{at||this._update(!0)}),this}setLight(Pt,L={}){return this._lazyInitEmptyStyle(),this.style.setLight(Pt,L),this._update(!0)}getLight(){return this.style.getLight()}setSky(Pt){return this._lazyInitEmptyStyle(),this.style.setSky(Pt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Pt,L){return this.style.setFeatureState(Pt,L),this._update()}removeFeatureState(Pt,L){return this.style.removeFeatureState(Pt,L),this._update()}getFeatureState(Pt){return this.style.getFeatureState(Pt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Pt=0,L=0;return this._container&&(Pt=this._container.clientWidth||400,L=this._container.clientHeight||300),[Pt,L]}_setupContainer(){let Pt=this._container;Pt.classList.add("maplibregl-map");let L=this._canvasContainer=a.create("div","maplibregl-canvas-container",Pt);this._interactive&&L.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",L),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let at=this._containerDimensions(),xt=this._getClampedPixelRatio(at[0],at[1]);this._resizeCanvas(at[0],at[1],xt);let kt=this._controlContainer=a.create("div","maplibregl-control-container",Pt),Lt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(le=>{Lt[le]=a.create("div",`maplibregl-ctrl-${le} `,kt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Pt,L,at){this._canvas.width=Math.floor(at*Pt),this._canvas.height=Math.floor(at*L),this._canvas.style.width=`${Pt}px`,this._canvas.style.height=`${L}px`}_setupPainter(){let Pt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},L=null;this._canvas.addEventListener("webglcontextcreationerror",xt=>{L={requestedAttributes:Pt},xt&&(L.statusMessage=xt.statusMessage,L.type=xt.type)},{once:!0});let at=this._canvas.getContext("webgl2",Pt)||this._canvas.getContext("webgl",Pt);if(!at){let xt="Failed to initialize WebGL";throw L?(L.message=xt,new Error(JSON.stringify(L))):new Error(xt)}this.painter=new Gu(at,this.transform),s.testSupport(at)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Pt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Pt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Pt){return this._update(),this._renderTaskQueue.add(Pt)}_cancelRenderFrame(Pt){this._renderTaskQueue.remove(Pt)}_render(Pt){let L=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Pt),this._removed)return;let at=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let kt=this.transform.zoom,Lt=o.now();this.style.zoomHistory.update(kt,Lt);let le=new e.z(kt,{now:Lt,fadeDuration:L,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),xe=le.crossFadingFactor();xe===1&&xe===this._crossFadingFactor||(at=!0,this._crossFadingFactor=xe),this.style.update(le)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,L,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:L,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||at)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let xt=this._sourcesDirty||this._styleDirty||this._placementDirty;return xt||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||xt||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Pt;this._hash&&this._hash.remove();for(let at of this._controls)at.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Pt=this._resizeObserver)===null||Pt===void 0||Pt.disconnect();let L=this.painter.context.gl.getExtension("WEBGL_lose_context");L!=null&&L.loseContext&&L.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then(Pt=>{e.bf.frame(Pt),this._frameRequest=null,this._render(Pt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Pt){this._showTileBoundaries!==Pt&&(this._showTileBoundaries=Pt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Pt){this._showPadding!==Pt&&(this._showPadding=Pt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Pt){this._showCollisionBoxes!==Pt&&(this._showCollisionBoxes=Pt,Pt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Pt){this._showOverdrawInspector!==Pt&&(this._showOverdrawInspector=Pt,this._update())}get repaint(){return!!this._repaint}set repaint(Pt){this._repaint!==Pt&&(this._repaint=Pt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Pt){this._vertices=Pt,this._update()}get version(){return ll}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=iu,t.MapTouchEvent=sc,t.MapWheelEvent=Tc,t.Marker=jl,t.NavigationControl=class{constructor(Pt){this._updateZoomButtons=()=>{let L=this._map.getZoom(),at=L===this._map.getMaxZoom(),xt=L===this._map.getMinZoom();this._zoomInButton.disabled=at,this._zoomOutButton.disabled=xt,this._zoomInButton.setAttribute("aria-disabled",at.toString()),this._zoomOutButton.setAttribute("aria-disabled",xt.toString())},this._rotateCompassArrow=()=>{let L=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=L},this._setButtonTitle=(L,at)=>{let xt=this._map._getUIString(`NavigationControl.${at}`);L.title=xt,L.setAttribute("aria-label",xt)},this.options=e.e({},bi,Pt),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",L=>L.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",L=>this._map.zoomIn({},{originalEvent:L})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",L=>this._map.zoomOut({},{originalEvent:L})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",L=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:L}):this._map.resetNorth({},{originalEvent:L})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Pt){return this._map=Pt,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new so(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Pt,L){let at=a.create("button",Pt,this._container);return at.type="button",at.addEventListener("click",L),at}},t.Popup=class extends e.E{constructor(Pt){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=L=>{this._update(L.point)},this._onMouseMove=L=>{this._update(L.point)},this._onDrag=L=>{this._update(L.point)},this._update=L=>{var at;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let xe of this.options.className.split(" "))this._container.classList.add(xe);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?fs(this._lngLat,this._flatPos,this._map.transform):(at=this._lngLat)===null||at===void 0?void 0:at.wrap(),this._trackPointer&&!L)return;let xt=this._flatPos=this._pos=this._trackPointer&&L?L:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&L?L:this._map.transform.locationPoint(this._lngLat));let kt=this.options.anchor,Lt=ul(this.options.offset);if(!kt){let xe=this._container.offsetWidth,Pe=this._container.offsetHeight,$e;$e=xt.y+Lt.bottom.ythis._map.transform.height-Pe?["bottom"]:[],xt.xthis._map.transform.width-xe/2&&$e.push("right"),kt=$e.length===0?"bottom":$e.join("-")}let le=xt.add(Lt[kt]);this.options.subpixelPositioning||(le=le.round()),a.setTransform(this._container,`${Ll[kt]} translate(${le.x}px,${le.y}px)`),$l(this._container,kt,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(fo),Pt)}addTo(Pt){return this._map&&this.remove(),this._map=Pt,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Pt){return this._lngLat=e.N.convert(Pt),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Pt){return this.setDOMContent(document.createTextNode(Pt))}setHTML(Pt){let L=document.createDocumentFragment(),at=document.createElement("body"),xt;for(at.innerHTML=Pt;xt=at.firstChild,xt;)L.appendChild(xt);return this.setDOMContent(L)}getMaxWidth(){var Pt;return(Pt=this._container)===null||Pt===void 0?void 0:Pt.style.maxWidth}setMaxWidth(Pt){return this.options.maxWidth=Pt,this._update(),this}setDOMContent(Pt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Pt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Pt){return this._container&&this._container.classList.add(Pt),this}removeClassName(Pt){return this._container&&this._container.classList.remove(Pt),this}setOffset(Pt){return this.options.offset=Pt,this._update(),this}toggleClassName(Pt){if(this._container)return this._container.classList.toggle(Pt)}setSubpixelPositioning(Pt){this.options.subpixelPositioning=Pt}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Pt=this._container.querySelector(Ql);Pt&&Pt.focus()}},t.RasterDEMTileSource=Ct,t.RasterTileSource=wt,t.ScaleControl=class{constructor(Pt){this._onMove=()=>{Nu(this._map,this._container,this.options)},this.setUnit=L=>{this.options.unit=L,Nu(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},nl),Pt)}getDefaultPosition(){return"bottom-left"}onAdd(Pt){return this._map=Pt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Pt.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=mn,t.Style=kr,t.TerrainControl=class{constructor(Pt){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Pt}onAdd(Pt){return this._map=Pt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=Oc,t.TwoFingersTouchRotateHandler=lc,t.TwoFingersTouchZoomHandler=Cs,t.TwoFingersTouchZoomRotateHandler=va,t.VectorTileSource=Tt,t.VideoSource=Jt,t.addSourceType=(Pt,L)=>e._(void 0,void 0,void 0,function*(){if(mt(Pt))throw new Error(`A source type called "${Pt}" already exists.`);((at,xt)=>{Zt[at]=xt})(Pt,L)}),t.clearPrewarmedResources=function(){let Pt=et;Pt&&(Pt.isPreloaded()&&Pt.numActive()===1?(Pt.release(rt),et=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return re().getRTLTextPluginStatus()},t.getVersion=function(){return Dc},t.getWorkerCount=function(){return ct.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(Pt){return Q().broadcast("IS",Pt)},t.prewarm=function(){ot().acquire(rt)},t.setMaxParallelImageRequests=function(Pt){e.a.MAX_PARALLEL_IMAGE_REQUESTS=Pt},t.setRTLTextPlugin=function(Pt,L){return re().setRTLTextPlugin(Pt,L)},t.setWorkerCount=function(Pt){ct.workerCount=Pt},t.setWorkerUrl=function(Pt){e.a.WORKER_URL=Pt}});var A=u;return A})}),Mz=Vt((K,V)=>{var u=Xr(),d=Dl().sanitizeHTML,E=O5(),A=Wd();function t(o,a){this.subplot=o,this.uid=o.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=A.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var e=t.prototype;e.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},e.needsNewImage=function(o){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&o.sourcetype==="image"&&(this.source!==o.source||JSON.stringify(this.coordinates)!==JSON.stringify(o.coordinates))},e.needsNewSource=function(o){return this.sourceType!==o.sourcetype||JSON.stringify(this.source)!==JSON.stringify(o.source)||this.layerType!==o.type},e.needsNewLayer=function(o){return this.layerType!==o.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},e.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},e.updateImage=function(o){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:o.source,coordinates:o.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},e.updateSource=function(o){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);a.addSource(this.idSource,s)}},e.findFollowingMapLayerId=function(o){if(o==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function i(o){var a={},s={};switch(o.type){case"circle":u.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":u.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":u.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,v=E(f.textposition,f.iconsize);u.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":f.placement}),u.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":u.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:a,paint:s}}function n(o){var a=o.sourcetype,s=o.source,f={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",f.tileSize=256):a==="image"&&(v="url",f.coordinates=o.coordinates),f[v]=s,o.sourceattribution&&(f.attribution=d(o.sourceattribution)),f}V.exports=function(o,a,s){var f=new t(o,a);return f.update(s),f}}),Sz=Vt((K,V)=>{var u=Az(),d=Xr(),E=Ud(),A=ji(),t=yo(),e=oh(),r=hc(),i=Jh(),n=i.drawMode,o=i.selectMode,a=Sc().prepSelect,s=Sc().clearOutline,f=Sc().clearSelectionsCache,v=Sc().selectOnClick,g=Wd(),m=Mz();function w(M,T){this.id=T,this.gd=M;var c=M._fullLayout,h=M._context;this.container=c._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=c._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(c),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=w.prototype;l.plot=function(M,T,c){var h=this,b;h.map?b=new Promise(function(_,P){h.updateMap(M,T,_,P)}):b=new Promise(function(_,P){h.createMap(M,T,_,P)}),c.push(b)},l.createMap=function(M,T,c,h){var b=this,_=T[b.id],P=b.styleObj=y(_.style),z=_.bounds,D=z?[[z.west,z.south],[z.east,z.north]]:null,B=b.map=new u.Map({container:b.div,style:P.style,center:k(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:D,interactive:!b.isStatic,preserveDrawingBuffer:b.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new u.AttributionControl({compact:!0})),R={};B.on("styleimagemissing",function(F){var j=F.id;if(!R[j]&&j.includes("-15")){R[j]=!0;var N=new Image(15,15);N.onload=function(){B.addImage(j,N)},N.crossOrigin="Anonymous",N.src="https://unpkg.com/maki@2.1.0/icons/"+j+".svg"}}),B.setTransformRequest(function(F){return F=F.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),F=F.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),F=F.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:F}}),B._canvas.style.left="0px",B._canvas.style.top="0px",b.rejectOnError(h),b.isStatic||b.initFx(M,T);var I=[];I.push(new Promise(function(F){B.once("load",F)})),I=I.concat(E.fetchTraceGeoData(M)),Promise.all(I).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.updateMap=function(M,T,c,h){var b=this,_=b.map,P=T[this.id];b.rejectOnError(h);var z=[],D=y(P.style);JSON.stringify(b.styleObj)!==JSON.stringify(D)&&(b.styleObj=D,_.setStyle(D.style),b.traceHash={},z.push(new Promise(function(B){_.once("styledata",B)}))),z=z.concat(E.fetchTraceGeoData(M)),Promise.all(z).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.fillBelowLookup=function(M,T){var c=T[this.id],h=c.layers,b,_,P=this.belowLookup={},z=!1;for(b=0;b1)for(b=0;b-1&&v(D.originalEvent,h,[c.xaxis],[c.yaxis],c.id,z),B.indexOf("event")>-1&&r.click(h,D.originalEvent)}}},l.updateFx=function(M){var T=this,c=T.map,h=T.gd;if(T.isStatic)return;function b(D){var B=T.map.unproject(D);return[B.lng,B.lat]}var _=M.dragmode,P;P=function(D,B){if(B.isRect){var R=D.range={};R[T.id]=[b([B.xmin,B.ymin]),b([B.xmax,B.ymax])]}else{var I=D.lassoPoints={};I[T.id]=B.map(b)}};var z=T.dragOptions;T.dragOptions=d.extendDeep(z||{},{dragmode:M.dragmode,element:T.div,gd:h,plotinfo:{id:T.id,domain:M[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:P},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),c.off("click",T.onClickInPanHandler),o(_)||n(_)?(c.dragPan.disable(),c.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(D,B,R){a(D,B,R,T.dragOptions,_)},e.init(T.dragOptions)):(c.dragPan.enable(),c.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),c.on("click",T.onClickInPanHandler))},l.updateFramework=function(M){var T=M[this.id].domain,c=M._size,h=this.div.style;h.width=c.w*(T.x[1]-T.x[0])+"px",h.height=c.h*(T.y[1]-T.y[0])+"px",h.left=c.l+T.x[0]*c.w+"px",h.top=c.t+(1-T.y[1])*c.h+"px",this.xaxis._offset=c.l+T.x[0]*c.w,this.xaxis._length=c.w*(T.x[1]-T.x[0]),this.yaxis._offset=c.t+(1-T.y[1])*c.h,this.yaxis._length=c.h*(T.y[1]-T.y[0])},l.updateLayers=function(M){var T=M[this.id],c=T.layers,h=this.layerList,b;if(c.length!==h.length){for(b=0;b{var u=Xr(),d=Ld(),E=Gf(),A=Fv();V.exports=function(r,i,n){d(r,i,n,{type:"map",attributes:A,handleDefaults:t,partition:"y"})};function t(r,i,n){n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var o=n("bounds.west"),a=n("bounds.east"),s=n("bounds.south"),f=n("bounds.north");(o===void 0||a===void 0||s===void 0||f===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(g,m){return u.coerce(r,i,A.layers,g,m)}var o=n("visible");if(o){var a=n("sourcetype"),s=a==="raster"||a==="image";n("source"),n("sourceattribution"),a==="vector"&&n("sourcelayer"),a==="image"&&n("coordinates");var f;s&&(f="raster");var v=n("type",f);s&&v!=="raster"&&(v=i.type="raster",u.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),v==="circle"&&n("circle.radius"),v==="line"&&(n("line.width"),n("line.dash")),v==="fill"&&n("fill.outlinecolor"),v==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),u.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Jx=Vt(K=>{var V=Xr(),u=V.strTranslate,d=V.strScale,E=Pf().getSubplotCalcData,A=Lh(),t=Ni(),e=Eo(),r=Dl(),i=Sz(),n="map";K.name=n,K.attr="subplot",K.idRoot=n,K.idRegex=K.attrRegex=V.counterRegex(n),K.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},K.layoutAttributes=Fv(),K.supplyLayoutDefaults=Ez(),K.plot=function(o){for(var a=o._fullLayout,s=o.calcdata,f=a._subplots[n],v=0;vc/2){var h=S.split("|").join("
                ");M.text(h).attr("data-unformatted",h).call(r.convertToTspans,o),T=e.bBox(M.node())}M.attr("transform",u(-3,-T.height+8)),k.insert("rect",".static-attribution").attr({x:-T.width-6,y:-T.height-3,width:T.width+6,height:T.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;T.width+6>c&&(b=c/(T.width+6));var _=[f.l+f.w*m.x[1],f.t+f.h*(1-m.y[0])];k.attr("transform",u(_[0],_[1])+d(b))}},K.updateFx=function(o){for(var a=o._fullLayout,s=a._subplots[n],f=0;f{V.exports={attributes:Xx(),supplyDefaults:_z(),colorbar:Zf(),formatLabels:P5(),calc:Sx(),plot:wz(),hoverPoints:$x().hoverPoints,eventData:Tz(),selectPoints:kz(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.update(d)}},moduleType:"trace",name:"scattermap",basePlotModule:Jx(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),Lz=Vt((K,V)=>{V.exports=zz()}),D5=Vt((K,V)=>{var u=Zm(),d=Wl(),{hovertemplateAttrs:E,templatefallbackAttrs:A}=yl(),t=kl(),e=So().extendFlat;V.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},u.featureidkey,{}),below:{valType:"string",editType:"plot"},text:u.text,hovertext:u.hovertext,marker:{line:{color:e({},u.marker.line.color,{editType:"plot"}),width:e({},u.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},u.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},u.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},u.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:u.hoverinfo,hovertemplate:E({},{keys:["properties"]}),hovertemplatefallback:A(),showlegend:e({},t.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),Cz=Vt((K,V)=>{var u=Xr(),d=vf(),E=D5();V.exports=function(A,t,e,r){function i(f,v){return u.coerce(A,t,E,f,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!u.isArrayOrTypedArray(n)||!n.length||!u.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||u.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),d(A,t,r,i,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(t,i)}}),F5=Vt((K,V)=>{var u=Lo(),d=Xr(),E=xu(),A=Eo(),t=jd().makeBlank,e=Ud();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:f,geojson:t()};if(!a)return v;var g=e.extractTraceFeature(n);if(!g)return v;var m=E.makeColorScaleFuncFromTrace(o),w=o.marker,l=w.line||{},x;d.isArrayOrTypedArray(w.opacity)&&(x=function(b){var _=b.mo;return u(_)?+d.constrain(_,0,1):0});var y;d.isArrayOrTypedArray(l.color)&&(y=function(b){return b.mlc});var S;d.isArrayOrTypedArray(l.width)&&(S=function(b){return b.mlw});for(var k=0;k{var u=F5().convert,d=F5().convertOnSelect,E=Wd().traceLayerPrefix;function A(e,r){this.type="choroplethmap",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",E+r+"-fill"],["line",E+r+"-line"]],this.below=null}var t=A.prototype;t.update=function(e){this._update(u(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(d(e))},t._update=function(e){var r=this.subplot,i=this.layerList,n=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var o=0;o=0;i--)e.removeLayer(r[i][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(e,r){var i=r[0].trace,n=new A(e,i.uid),o=n.sourceId,a=u(r),s=n.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:a.geojson}),n._addLayers(a,s),r[0].trace._glTrace=n,n}}),Pz=Vt((K,V)=>{V.exports={attributes:D5(),supplyDefaults:Cz(),colorbar:zd(),calc:Cx(),plot:Iz(),hoverPoints:Px(),eventData:Ox(),selectPoints:Dx(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.updateOnSelect(d)}},getBelow:function(u,d){for(var E=d.getMapLayers(),A=E.length-2;A>=0;A--){var t=E[A].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=A+1;e{V.exports=Pz()}),B5=Vt((K,V)=>{var u=Wl(),{hovertemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=kl(),t=Xx(),e=So().extendFlat;V.exports=e({lon:t.lon,lat:t.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:t.text,hovertext:t.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:E(),showlegend:e({},A.showlegend,{dflt:!1})},u("",{cLetter:"z",editTypeOverride:"calc"}))}),Dz=Vt((K,V)=>{var u=Xr(),d=vf(),E=B5();V.exports=function(A,t,e,r){function i(s,f){return u.coerce(A,t,E,s,f)}var n=i("lon")||[],o=i("lat")||[],a=Math.min(n.length,o.length);if(!a){t.visible=!1;return}t._length=a,i("z"),i("radius"),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),d(A,t,r,i,{prefix:"",cLetter:"z"})}}),Fz=Vt((K,V)=>{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ih(),t=Xr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=d(o)&&o.length,s=0;s{var u=Lo(),d=Xr(),E=Pi(),A=xu(),t=ks().BADNUM,e=jd().makeBlank;V.exports=function(r){var i=r[0].trace,n=i.visible===!0&&i._length!==0,o={layout:{visibility:"none"},paint:{}},a=i._opts={heatmap:o,geojson:e()};if(!n)return a;var s=[],f,v=i.z,g=i.radius,m=d.isArrayOrTypedArray(v)&&v.length,w=d.isArrayOrTypedArray(g);for(f=0;f0?+g[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:y})}}var k=A.extractOpts(i),M=k.reversescale?A.flipScale(k.colorscale):k.colorscale,T=M[0][1],c=E.opacity(T)<1?T:E.addOpacity(T,0),h=["interpolate",["linear"],["heatmap-density"],0,c];for(f=1;f{var u=Bz(),d=Wd().traceLayerPrefix;function E(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",d+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=u(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(i,n),this.below=n);for(var o=0;o=0;r--)t.removeLayer(e[r][1])},A.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(t,e){var r=e[0].trace,i=new E(t,r.uid),n=i.sourceId,o=u(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),Nz=Vt((K,V)=>{var u=yo(),d=$x().hoverPoints,E=$x().getExtraText;V.exports=function(A,t,e){var r=d(A,t,e);if(r){var i=r[0],n=i.cd,o=n[0].trace,a=n[i.index];if(delete i.color,"z"in a){var s=i.subplot.mockAxis;i.z=a.z,i.zLabel=u.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),jz=Vt((K,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u.z=d.z,u}}),Uz=Vt((K,V)=>{V.exports={attributes:B5(),supplyDefaults:Dz(),colorbar:zd(),formatLabels:P5(),calc:Fz(),plot:Rz(),hoverPoints:Nz(),eventData:jz(),getBelow:function(u,d){for(var E=d.getMapLayers(),A=0;A{V.exports=Uz()}),R5=Vt((K,V)=>{var u=yu(),d=kl(),E=af(),A=mm(),t=Vu().attributes,{hovertemplateAttrs:e,templatefallbackAttrs:r}=yl(),i=Wl(),n=cl().templatedArray,o=fc().descriptionOnlyNumbers,a=So().extendFlat,s=Cu().overrideAll;V.exports=s({hoverinfo:a({},d.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:A.hoverlabel,domain:t({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:o("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:u({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:A.hoverlabel,hovertemplate:e({},{keys:["value","label"]}),hovertemplatefallback:r(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:A.hoverlabel,hovertemplate:e({},{keys:["value","label"]}),hovertemplatefallback:r(),colorscales:n("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:a(i().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Hz=Vt((K,V)=>{var u=Xr(),d=R5(),E=Pi(),A=Af(),t=Vu().defaults,e=Fg(),r=cl(),i=Gf();V.exports=function(o,a,s,f){function v(P,z){return u.coerce(o,a,d,P,z)}var g=u.extendDeep(f.hoverlabel,o.hoverlabel),m=o.node,w=r.newContainer(a,"node");function l(P,z){return u.coerce(m,w,d.node,P,z)}l("label"),l("groups"),l("x"),l("y"),l("pad"),l("thickness"),l("line.color"),l("line.width"),l("hoverinfo",o.hoverinfo),e(m,w,l,g),l("hovertemplate"),l("align");var x=f.colorway,y=function(P){return x[P%x.length]};l("color",w.label.map(function(P,z){return E.addOpacity(y(z),.8)})),l("customdata");var S=o.link||{},k=r.newContainer(a,"link");function M(P,z){return u.coerce(S,k,d.link,P,z)}M("label"),M("arrowlen"),M("source"),M("target"),M("value"),M("line.color"),M("line.width"),M("hoverinfo",o.hoverinfo),e(S,k,M,g),M("hovertemplate");var T=A(f.paper_bgcolor).getLuminance()<.333,c=T?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",h=M("color",c);function b(P){var z=A(P);if(!z.isValid())return P;var D=z.getAlpha();return D<=.8?z.setAlpha(D+.2):z=T?z.brighten():z.darken(),z.toRgbString()}M("hovercolor",Array.isArray(h)?h.map(b):b(h)),M("customdata"),i(S,k,{name:"colorscales",handleItemDefaults:n}),t(a,f,v),v("orientation"),v("valueformat"),v("valuesuffix");var _;w.x.length&&w.y.length&&(_="freeform"),v("arrangement",_),u.coerceFont(v,"textfont",f.font,{autoShadowDflt:!0}),a._length=null};function n(o,a){function s(f,v){return u.coerce(o,a,d.link.colorscales,f,v)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}),N5=Vt((K,V)=>{V.exports=u;function u(d){for(var E=d.length,A=new Array(E),t=new Array(E),e=new Array(E),r=new Array(E),i=new Array(E),n=new Array(E),o=0;o0;){l=y[y.length-1];var S=d[l];if(r[l]=0&&n[l].push(i[M])}r[l]=k}else{if(t[l]===A[l]){for(var T=[],c=[],h=0,k=x.length-1;k>=0;--k){var b=x[k];if(e[b]=!1,T.push(b),c.push(n[b]),h+=n[b].length,i[b]=s.length,b===l){x.length=k;break}}s.push(T);for(var _=new Array(h),k=0;k{var u=N5(),d=Xr(),E=bp().wrap,A=d.isArrayOrTypedArray,t=d.isIndex,e=xu();function r(n){var o=n.node,a=n.link,s=[],f=A(a.color),v=A(a.hovercolor),g=A(a.customdata),m={},w={},l=a.colorscales.length,x;for(x=0;xM&&(M=a.source[x]),a.target[x]>M&&(M=a.target[x]);var T=M+1;n.node._count=T;var c,h=n.node.groups,b={};for(x=0;x0&&t(R,T)&&t(I,T)&&!(b.hasOwnProperty(R)&&b.hasOwnProperty(I)&&b[R]===b[I])){b.hasOwnProperty(I)&&(I=b[I]),b.hasOwnProperty(R)&&(R=b[R]),R=+R,I=+I,m[R]=m[I]=!0;var F="";a.label&&a.label[x]&&(F=a.label[x]);var j=null;F&&w.hasOwnProperty(F)&&(j=w[F]),s.push({pointNumber:x,label:F,color:f?a.color[x]:a.color,hovercolor:v?a.hovercolor[x]:a.hovercolor,customdata:g?a.customdata[x]:a.customdata,concentrationscale:j,source:R,target:I,value:+B}),D.source.push(R),D.target.push(I)}}var N=T+h.length,G=A(o.color),rt=A(o.customdata),ct=[];for(x=0;xT-1,childrenNodes:[],pointNumber:x,label:st,color:G?o.color[x]:o.color,customdata:rt?o.customdata[x]:o.customdata})}var et=!1;return i(N,D.source,D.target)&&(et=!0),{circular:et,links:s,nodes:ct,groups:h,groupLookup:b}}function i(n,o,a){for(var s=d.init2dArray(n,0),f=0;f1})}V.exports=function(n,o){var a=r(o);return E({circular:a.circular,_nodes:a.nodes,_links:a.links,_groups:a.groups,_groupLookup:a.groupLookup})}}),Wz=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){function d(T){var c=+this._x.call(null,T),h=+this._y.call(null,T);return E(this.cover(c,h),c,h,T)}function E(T,c,h,b){if(isNaN(c)||isNaN(h))return T;var _,P=T._root,z={data:b},D=T._x0,B=T._y0,R=T._x1,I=T._y1,F,j,N,G,rt,ct,st,et;if(!P)return T._root=z,T;for(;P.length;)if((rt=c>=(F=(D+R)/2))?D=F:R=F,(ct=h>=(j=(B+I)/2))?B=j:I=j,_=P,!(P=P[st=ct<<1|rt]))return _[st]=z,T;if(N=+T._x.call(null,P.data),G=+T._y.call(null,P.data),c===N&&h===G)return z.next=P,_?_[st]=z:T._root=z,T;do _=_?_[st]=new Array(4):T._root=new Array(4),(rt=c>=(F=(D+R)/2))?D=F:R=F,(ct=h>=(j=(B+I)/2))?B=j:I=j;while((st=ct<<1|rt)===(et=(G>=j)<<1|N>=F));return _[et]=P,_[st]=z,T}function A(T){var c,h,b=T.length,_,P,z=new Array(b),D=new Array(b),B=1/0,R=1/0,I=-1/0,F=-1/0;for(h=0;hI&&(I=_),PF&&(F=P));if(B>I||R>F)return this;for(this.cover(B,R).cover(I,F),h=0;hT||T>=_||b>c||c>=P;)switch(R=(cI||(D=G.y0)>F||(B=G.x1)<_||(R=G.y1)=st)<<1|T>=ct)&&(G=j[j.length-1],j[j.length-1]=j[j.length-1-rt],j[j.length-1-rt]=G)}else{var et=T-+this._x.call(null,N.data),Z=c-+this._y.call(null,N.data),ot=et*et+Z*Z;if(ot=(j=(z+B)/2))?z=j:B=j,(rt=F>=(N=(D+R)/2))?D=N:R=N,c=h,!(h=h[ct=rt<<1|G]))return this;if(!h.length)break;(c[ct+1&3]||c[ct+2&3]||c[ct+3&3])&&(b=c,st=ct)}for(;h.data!==T;)if(_=h,!(h=h.next))return this;return(P=h.next)&&delete h.next,_?(P?_.next=P:delete _.next,this):c?(P?c[ct]=P:delete c[ct],(h=c[0]||c[1]||c[2]||c[3])&&h===(c[3]||c[2]||c[1]||c[0])&&!h.length&&(b?b[st]=h:this._root=h),this):(this._root=P,this)}function a(T){for(var c=0,h=T.length;c{(function(u,d){d(typeof K=="object"&&typeof V<"u"?K:u.d3=u.d3||{})})(K,function(u){var d="$";function E(){}E.prototype=A.prototype={constructor:E,has:function(m){return d+m in this},get:function(m){return this[d+m]},set:function(m,w){return this[d+m]=w,this},remove:function(m){var w=d+m;return w in this&&delete this[w]},clear:function(){for(var m in this)m[0]===d&&delete this[m]},keys:function(){var m=[];for(var w in this)w[0]===d&&m.push(w.slice(1));return m},values:function(){var m=[];for(var w in this)w[0]===d&&m.push(this[w]);return m},entries:function(){var m=[];for(var w in this)w[0]===d&&m.push({key:w.slice(1),value:this[w]});return m},size:function(){var m=0;for(var w in this)w[0]===d&&++m;return m},empty:function(){for(var m in this)if(m[0]===d)return!1;return!0},each:function(m){for(var w in this)w[0]===d&&m(this[w],w.slice(1),this)}};function A(m,w){var l=new E;if(m instanceof E)m.each(function(M,T){l.set(T,M)});else if(Array.isArray(m)){var x=-1,y=m.length,S;if(w==null)for(;++x=m.length)return l!=null&&M.sort(l),x!=null?x(M):M;for(var b=-1,_=M.length,P=m[T++],z,D,B=A(),R,I=c();++b<_;)(R=B.get(z=P(D=M[b])+""))?R.push(D):B.set(z,[D]);return B.each(function(F,j){h(I,j,S(F,T,c,h))}),I}function k(M,T){if(++T>m.length)return M;var c,h=w[T-1];return x!=null&&T>=m.length?c=M.entries():(c=[],M.each(function(b,_){c.push({key:_,values:k(b,T)})})),h!=null?c.sort(function(b,_){return h(b.key,_.key)}):c}return y={object:function(M){return S(M,0,e,r)},map:function(M){return S(M,0,i,n)},entries:function(M){return k(S(M,0,i,n),0)},key:function(M){return m.push(M),y},sortKeys:function(M){return w[m.length-1]=M,y},sortValues:function(M){return l=M,y},rollup:function(M){return x=M,y}}}function e(){return{}}function r(m,w,l){m[w]=l}function i(){return A()}function n(m,w,l){m.set(w,l)}function o(){}var a=A.prototype;o.prototype=s.prototype={constructor:o,has:a.has,add:function(m){return m+="",this[d+m]=m,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(m,w){var l=new o;if(m instanceof o)m.each(function(S){l.add(S)});else if(m){var x=-1,y=m.length;if(w==null)for(;++x{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){var d={value:function(){}};function E(){for(var i=0,n=arguments.length,o={},a;i=0&&(a=o.slice(s+1),o=o.slice(0,s)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:a}})}A.prototype=E.prototype={constructor:A,on:function(i,n){var o=this._,a=t(i+"",o),s,f=-1,v=a.length;if(arguments.length<2){for(;++f0)for(var o=new Array(s),a=0,s,f;a{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){var d=0,E=0,A=0,t=1e3,e,r,i=0,n=0,o=0,a=typeof performance=="object"&&performance.now?performance:Date,s=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(T){setTimeout(T,17)};function f(){return n||(s(v),n=a.now()+o)}function v(){n=0}function g(){this._call=this._time=this._next=null}g.prototype=m.prototype={constructor:g,restart:function(T,c,h){if(typeof T!="function")throw new TypeError("callback is not a function");h=(h==null?f():+h)+(c==null?0:+c),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=T,this._time=h,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};function m(T,c,h){var b=new g;return b.restart(T,c,h),b}function w(){f(),++d;for(var T=e,c;T;)(c=n-T._time)>=0&&T._call.call(null,c),T=T._next;--d}function l(){n=(i=a.now())+o,d=E=0;try{w()}finally{d=0,y(),n=0}}function x(){var T=a.now(),c=T-i;c>t&&(o-=c,i=T)}function y(){for(var T,c=e,h,b=1/0;c;)c._call?(b>c._time&&(b=c._time),T=c,c=c._next):(h=c._next,c._next=null,c=T?T._next=h:e=h);r=T,S(b)}function S(T){if(!d){E&&(E=clearTimeout(E));var c=T-n;c>24?(T<1/0&&(E=setTimeout(l,T-a.now()-o)),A&&(A=clearInterval(A))):(A||(i=a.now(),A=setInterval(x,t)),d=1,s(l))}}function k(T,c,h){var b=new g;return c=c==null?0:+c,b.restart(function(_){b.stop(),T(_+c)},c,h),b}function M(T,c,h){var b=new g,_=c;return c==null?(b.restart(T,c,h),b):(c=+c,h=h==null?f():+h,b.restart(function P(z){z+=_,b.restart(P,_+=c,h),T(z)},c,h),b)}u.interval=M,u.now=f,u.timeout=k,u.timer=m,u.timerFlush=w,Object.defineProperty(u,"__esModule",{value:!0})})}),Kz=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Wz(),Qx(),Gz(),Zz()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3,u.d3)})(K,function(u,d,E,A,t){function e(T,c){var h;T==null&&(T=0),c==null&&(c=0);function b(){var _,P=h.length,z,D=0,B=0;for(_=0;_F.index){var it=j-ut.x-ut.vx,nt=N-ut.y-ut.vy,dt=it*it+nt*nt;dtj+q||XN+q||QB.r&&(B.r=B[R].r)}function D(){if(c){var B,R=c.length,I;for(h=new Array(R),B=0;B1?(rt==null?D.remove(G):D.set(G,N(rt)),c):D.get(G)},find:function(G,rt,ct){var st=0,et=T.length,Z,ot,X,Q,ut;for(ct==null?ct=1/0:ct*=ct,st=0;st1?(R.on(G,rt),c):R.on(G)}}}function y(){var T,c,h,b=r(-30),_,P=1,z=1/0,D=.81;function B(j){var N,G=T.length,rt=d.quadtree(T,g,m).visitAfter(I);for(h=j,N=0;N=z)){(j.data!==c||j.next)&&(ct===0&&(ct=i(),Z+=ct*ct),st===0&&(st=i(),Z+=st*st),Z{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K):(u=u||self,d(u.d3=u.d3||{}))})(K,function(u){var d=Math.PI,E=2*d,A=1e-6,t=E-A;function e(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function r(){return new e}e.prototype=r.prototype={constructor:e,moveTo:function(i,n){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(i,n){this._+="L"+(this._x1=+i)+","+(this._y1=+n)},quadraticCurveTo:function(i,n,o,a){this._+="Q"+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},bezierCurveTo:function(i,n,o,a,s,f){this._+="C"+ +i+","+ +n+","+ +o+","+ +a+","+(this._x1=+s)+","+(this._y1=+f)},arcTo:function(i,n,o,a,s){i=+i,n=+n,o=+o,a=+a,s=+s;var f=this._x1,v=this._y1,g=o-i,m=a-n,w=f-i,l=v-n,x=w*w+l*l;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=i)+","+(this._y1=n);else if(x>A)if(!(Math.abs(l*g-m*w)>A)||!s)this._+="L"+(this._x1=i)+","+(this._y1=n);else{var y=o-f,S=a-v,k=g*g+m*m,M=y*y+S*S,T=Math.sqrt(k),c=Math.sqrt(x),h=s*Math.tan((d-Math.acos((k+x-M)/(2*T*c)))/2),b=h/c,_=h/T;Math.abs(b-1)>A&&(this._+="L"+(i+b*w)+","+(n+b*l)),this._+="A"+s+","+s+",0,0,"+ +(l*y>w*S)+","+(this._x1=i+_*g)+","+(this._y1=n+_*m)}},arc:function(i,n,o,a,s,f){i=+i,n=+n,o=+o,f=!!f;var v=o*Math.cos(a),g=o*Math.sin(a),m=i+v,w=n+g,l=1^f,x=f?a-s:s-a;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+m+","+w:(Math.abs(this._x1-m)>A||Math.abs(this._y1-w)>A)&&(this._+="L"+m+","+w),o&&(x<0&&(x=x%E+E),x>t?this._+="A"+o+","+o+",0,1,"+l+","+(i-v)+","+(n-g)+"A"+o+","+o+",0,1,"+l+","+(this._x1=m)+","+(this._y1=w):x>A&&(this._+="A"+o+","+o+",0,"+ +(x>=d)+","+l+","+(this._x1=i+o*Math.cos(s))+","+(this._y1=n+o*Math.sin(s))))},rect:function(i,n,o,a){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+n)+"h"+ +o+"v"+ +a+"h"+-o+"Z"},toString:function(){return this._}},u.path=r,Object.defineProperty(u,"__esModule",{value:!0})})}),j5=Vt((K,V)=>{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Yz()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(K,function(u,d){function E(pe){return function(){return pe}}var A=Math.abs,t=Math.atan2,e=Math.cos,r=Math.max,i=Math.min,n=Math.sin,o=Math.sqrt,a=1e-12,s=Math.PI,f=s/2,v=2*s;function g(pe){return pe>1?0:pe<-1?s:Math.acos(pe)}function m(pe){return pe>=1?f:pe<=-1?-f:Math.asin(pe)}function w(pe){return pe.innerRadius}function l(pe){return pe.outerRadius}function x(pe){return pe.startAngle}function y(pe){return pe.endAngle}function S(pe){return pe&&pe.padAngle}function k(pe,Ke,xr,Gr,ln,wn,rn,Qr){var vn=xr-pe,Oa=Gr-Ke,Qn=rn-ln,Qa=Qr-wn,Ja=Qa*vn-Qn*Oa;if(!(Ja*Jats*ts+vs*vs&&(Po=Gi,hs=uo),{cx:Po,cy:hs,x01:-Qn,y01:-Qa,x11:Po*(ln/zo-1),y11:hs*(ln/zo-1)}}function T(){var pe=w,Ke=l,xr=E(0),Gr=null,ln=x,wn=y,rn=S,Qr=null;function vn(){var Oa,Qn,Qa=+pe.apply(this,arguments),Ja=+Ke.apply(this,arguments),wi=ln.apply(this,arguments)-f,ci=wn.apply(this,arguments)-f,Ti=A(ci-wi),Ra=ci>wi;if(Qr||(Qr=Oa=d.path()),Jaa))Qr.moveTo(0,0);else if(Ti>v-a)Qr.moveTo(Ja*e(wi),Ja*n(wi)),Qr.arc(0,0,Ja,wi,ci,!Ra),Qa>a&&(Qr.moveTo(Qa*e(ci),Qa*n(ci)),Qr.arc(0,0,Qa,ci,wi,Ra));else{var Qi=wi,Hi=ci,Ho=wi,Ci=ci,zo=Ti,qi=Ti,qo=rn.apply(this,arguments)/2,Po=qo>a&&(Gr?+Gr.apply(this,arguments):o(Qa*Qa+Ja*Ja)),hs=i(A(Ja-Qa)/2,+xr.apply(this,arguments)),Gi=hs,uo=hs,yi,ao;if(Po>a){var ts=m(Po/Qa*n(qo)),vs=m(Po/Ja*n(qo));(zo-=ts*2)>a?(ts*=Ra?1:-1,Ho+=ts,Ci-=ts):(zo=0,Ho=Ci=(wi+ci)/2),(qi-=vs*2)>a?(vs*=Ra?1:-1,Qi+=vs,Hi-=vs):(qi=0,Qi=Hi=(wi+ci)/2)}var As=Ja*e(Qi),_o=Ja*n(Qi),Da=Qa*e(Ci),li=Qa*n(Ci);if(hs>a){var wo=Ja*e(Hi),Ms=Ja*n(Hi),Di=Qa*e(Ho),_s=Qa*n(Ho),No;if(Tia?uo>a?(yi=M(Di,_s,As,_o,Ja,uo,Ra),ao=M(wo,Ms,Da,li,Ja,uo,Ra),Qr.moveTo(yi.cx+yi.x01,yi.cy+yi.y01),uoa)||!(zo>a)?Qr.lineTo(Da,li):Gi>a?(yi=M(Da,li,wo,Ms,Qa,-Gi,Ra),ao=M(As,_o,Di,_s,Qa,-Gi,Ra),Qr.lineTo(yi.cx+yi.x01,yi.cy+yi.y01),Gi=Ja;--wi)Qr.point(Hi[wi],Ho[wi]);Qr.lineEnd(),Qr.areaEnd()}Ra&&(Hi[Qa]=+pe(Ti,Qa,Qn),Ho[Qa]=+xr(Ti,Qa,Qn),Qr.point(Ke?+Ke(Ti,Qa,Qn):Hi[Qa],Gr?+Gr(Ti,Qa,Qn):Ho[Qa]))}if(Qi)return Qr=null,Qi+""||null}function Oa(){return P().defined(ln).curve(rn).context(wn)}return vn.x=function(Qn){return arguments.length?(pe=typeof Qn=="function"?Qn:E(+Qn),Ke=null,vn):pe},vn.x0=function(Qn){return arguments.length?(pe=typeof Qn=="function"?Qn:E(+Qn),vn):pe},vn.x1=function(Qn){return arguments.length?(Ke=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),vn):Ke},vn.y=function(Qn){return arguments.length?(xr=typeof Qn=="function"?Qn:E(+Qn),Gr=null,vn):xr},vn.y0=function(Qn){return arguments.length?(xr=typeof Qn=="function"?Qn:E(+Qn),vn):xr},vn.y1=function(Qn){return arguments.length?(Gr=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),vn):Gr},vn.lineX0=vn.lineY0=function(){return Oa().x(pe).y(xr)},vn.lineY1=function(){return Oa().x(pe).y(Gr)},vn.lineX1=function(){return Oa().x(Ke).y(xr)},vn.defined=function(Qn){return arguments.length?(ln=typeof Qn=="function"?Qn:E(!!Qn),vn):ln},vn.curve=function(Qn){return arguments.length?(rn=Qn,wn!=null&&(Qr=rn(wn)),vn):rn},vn.context=function(Qn){return arguments.length?(Qn==null?wn=Qr=null:Qr=rn(wn=Qn),vn):wn},vn}function D(pe,Ke){return Kepe?1:Ke>=pe?0:NaN}function B(pe){return pe}function R(){var pe=B,Ke=D,xr=null,Gr=E(0),ln=E(v),wn=E(0);function rn(Qr){var vn,Oa=Qr.length,Qn,Qa,Ja=0,wi=new Array(Oa),ci=new Array(Oa),Ti=+Gr.apply(this,arguments),Ra=Math.min(v,Math.max(-v,ln.apply(this,arguments)-Ti)),Qi,Hi=Math.min(Math.abs(Ra)/Oa,wn.apply(this,arguments)),Ho=Hi*(Ra<0?-1:1),Ci;for(vn=0;vn0&&(Ja+=Ci);for(Ke!=null?wi.sort(function(zo,qi){return Ke(ci[zo],ci[qi])}):xr!=null&&wi.sort(function(zo,qi){return xr(Qr[zo],Qr[qi])}),vn=0,Qa=Ja?(Ra-Oa*Ho)/Ja:0;vn0?Ci*Qa:0)+Ho,ci[Qn]={data:Qr[Qn],index:vn,value:Ci,startAngle:Ti,endAngle:Qi,padAngle:Hi};return ci}return rn.value=function(Qr){return arguments.length?(pe=typeof Qr=="function"?Qr:E(+Qr),rn):pe},rn.sortValues=function(Qr){return arguments.length?(Ke=Qr,xr=null,rn):Ke},rn.sort=function(Qr){return arguments.length?(xr=Qr,Ke=null,rn):xr},rn.startAngle=function(Qr){return arguments.length?(Gr=typeof Qr=="function"?Qr:E(+Qr),rn):Gr},rn.endAngle=function(Qr){return arguments.length?(ln=typeof Qr=="function"?Qr:E(+Qr),rn):ln},rn.padAngle=function(Qr){return arguments.length?(wn=typeof Qr=="function"?Qr:E(+Qr),rn):wn},rn}var I=j(h);function F(pe){this._curve=pe}F.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(pe,Ke){this._curve.point(Ke*Math.sin(pe),Ke*-Math.cos(pe))}};function j(pe){function Ke(xr){return new F(pe(xr))}return Ke._curve=pe,Ke}function N(pe){var Ke=pe.curve;return pe.angle=pe.x,delete pe.x,pe.radius=pe.y,delete pe.y,pe.curve=function(xr){return arguments.length?Ke(j(xr)):Ke()._curve},pe}function G(){return N(P().curve(I))}function rt(){var pe=z().curve(I),Ke=pe.curve,xr=pe.lineX0,Gr=pe.lineX1,ln=pe.lineY0,wn=pe.lineY1;return pe.angle=pe.x,delete pe.x,pe.startAngle=pe.x0,delete pe.x0,pe.endAngle=pe.x1,delete pe.x1,pe.radius=pe.y,delete pe.y,pe.innerRadius=pe.y0,delete pe.y0,pe.outerRadius=pe.y1,delete pe.y1,pe.lineStartAngle=function(){return N(xr())},delete pe.lineX0,pe.lineEndAngle=function(){return N(Gr())},delete pe.lineX1,pe.lineInnerRadius=function(){return N(ln())},delete pe.lineY0,pe.lineOuterRadius=function(){return N(wn())},delete pe.lineY1,pe.curve=function(rn){return arguments.length?Ke(j(rn)):Ke()._curve},pe}function ct(pe,Ke){return[(Ke=+Ke)*Math.cos(pe-=Math.PI/2),Ke*Math.sin(pe)]}var st=Array.prototype.slice;function et(pe){return pe.source}function Z(pe){return pe.target}function ot(pe){var Ke=et,xr=Z,Gr=b,ln=_,wn=null;function rn(){var Qr,vn=st.call(arguments),Oa=Ke.apply(this,vn),Qn=xr.apply(this,vn);if(wn||(wn=Qr=d.path()),pe(wn,+Gr.apply(this,(vn[0]=Oa,vn)),+ln.apply(this,vn),+Gr.apply(this,(vn[0]=Qn,vn)),+ln.apply(this,vn)),Qr)return wn=null,Qr+""||null}return rn.source=function(Qr){return arguments.length?(Ke=Qr,rn):Ke},rn.target=function(Qr){return arguments.length?(xr=Qr,rn):xr},rn.x=function(Qr){return arguments.length?(Gr=typeof Qr=="function"?Qr:E(+Qr),rn):Gr},rn.y=function(Qr){return arguments.length?(ln=typeof Qr=="function"?Qr:E(+Qr),rn):ln},rn.context=function(Qr){return arguments.length?(wn=Qr??null,rn):wn},rn}function X(pe,Ke,xr,Gr,ln){pe.moveTo(Ke,xr),pe.bezierCurveTo(Ke=(Ke+Gr)/2,xr,Ke,ln,Gr,ln)}function Q(pe,Ke,xr,Gr,ln){pe.moveTo(Ke,xr),pe.bezierCurveTo(Ke,xr=(xr+ln)/2,Gr,xr,Gr,ln)}function ut(pe,Ke,xr,Gr,ln){var wn=ct(Ke,xr),rn=ct(Ke,xr=(xr+ln)/2),Qr=ct(Gr,xr),vn=ct(Gr,ln);pe.moveTo(wn[0],wn[1]),pe.bezierCurveTo(rn[0],rn[1],Qr[0],Qr[1],vn[0],vn[1])}function J(){return ot(X)}function q(){return ot(Q)}function it(){var pe=ot(ut);return pe.angle=pe.x,delete pe.x,pe.radius=pe.y,delete pe.y,pe}var nt={draw:function(pe,Ke){var xr=Math.sqrt(Ke/s);pe.moveTo(xr,0),pe.arc(0,0,xr,0,v)}},dt={draw:function(pe,Ke){var xr=Math.sqrt(Ke/5)/2;pe.moveTo(-3*xr,-xr),pe.lineTo(-xr,-xr),pe.lineTo(-xr,-3*xr),pe.lineTo(xr,-3*xr),pe.lineTo(xr,-xr),pe.lineTo(3*xr,-xr),pe.lineTo(3*xr,xr),pe.lineTo(xr,xr),pe.lineTo(xr,3*xr),pe.lineTo(-xr,3*xr),pe.lineTo(-xr,xr),pe.lineTo(-3*xr,xr),pe.closePath()}},Tt=Math.sqrt(1/3),wt=Tt*2,Ct={draw:function(pe,Ke){var xr=Math.sqrt(Ke/wt),Gr=xr*Tt;pe.moveTo(0,-xr),pe.lineTo(Gr,0),pe.lineTo(0,xr),pe.lineTo(-Gr,0),pe.closePath()}},It=.8908130915292852,Nt=Math.sin(s/10)/Math.sin(7*s/10),te=Math.sin(v/10)*Nt,Jt=-Math.cos(v/10)*Nt,ee={draw:function(pe,Ke){var xr=Math.sqrt(Ke*It),Gr=te*xr,ln=Jt*xr;pe.moveTo(0,-xr),pe.lineTo(Gr,ln);for(var wn=1;wn<5;++wn){var rn=v*wn/5,Qr=Math.cos(rn),vn=Math.sin(rn);pe.lineTo(vn*xr,-Qr*xr),pe.lineTo(Qr*Gr-vn*ln,vn*Gr+Qr*ln)}pe.closePath()}},Zt={draw:function(pe,Ke){var xr=Math.sqrt(Ke),Gr=-xr/2;pe.rect(Gr,Gr,xr,xr)}},mt=Math.sqrt(3),bt={draw:function(pe,Ke){var xr=-Math.sqrt(Ke/(mt*3));pe.moveTo(0,xr*2),pe.lineTo(-mt*xr,-xr),pe.lineTo(mt*xr,-xr),pe.closePath()}},vt=-.5,Ut=Math.sqrt(3)/2,re=1/Math.sqrt(12),Kt=(re/2+1)*3,ue={draw:function(pe,Ke){var xr=Math.sqrt(Ke/Kt),Gr=xr/2,ln=xr*re,wn=Gr,rn=xr*re+xr,Qr=-wn,vn=rn;pe.moveTo(Gr,ln),pe.lineTo(wn,rn),pe.lineTo(Qr,vn),pe.lineTo(vt*Gr-Ut*ln,Ut*Gr+vt*ln),pe.lineTo(vt*wn-Ut*rn,Ut*wn+vt*rn),pe.lineTo(vt*Qr-Ut*vn,Ut*Qr+vt*vn),pe.lineTo(vt*Gr+Ut*ln,vt*ln-Ut*Gr),pe.lineTo(vt*wn+Ut*rn,vt*rn-Ut*wn),pe.lineTo(vt*Qr+Ut*vn,vt*vn-Ut*Qr),pe.closePath()}},Me=[nt,dt,Ct,Zt,ee,bt,ue];function Ce(){var pe=E(nt),Ke=E(64),xr=null;function Gr(){var ln;if(xr||(xr=ln=d.path()),pe.apply(this,arguments).draw(xr,+Ke.apply(this,arguments)),ln)return xr=null,ln+""||null}return Gr.type=function(ln){return arguments.length?(pe=typeof ln=="function"?ln:E(ln),Gr):pe},Gr.size=function(ln){return arguments.length?(Ke=typeof ln=="function"?ln:E(+ln),Gr):Ke},Gr.context=function(ln){return arguments.length?(xr=ln??null,Gr):xr},Gr}function We(){}function qe(pe,Ke,xr){pe._context.bezierCurveTo((2*pe._x0+pe._x1)/3,(2*pe._y0+pe._y1)/3,(pe._x0+2*pe._x1)/3,(pe._y0+2*pe._y1)/3,(pe._x0+4*pe._x1+Ke)/6,(pe._y0+4*pe._y1+xr)/6)}function vr(pe){this._context=pe}vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:qe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function _r(pe){return new vr(pe)}function er(pe){this._context=pe}er.prototype={areaStart:We,areaEnd:We,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._x2=pe,this._y2=Ke;break;case 1:this._point=2,this._x3=pe,this._y3=Ke;break;case 2:this._point=3,this._x4=pe,this._y4=Ke,this._context.moveTo((this._x0+4*this._x1+pe)/6,(this._y0+4*this._y1+Ke)/6);break;default:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function Mr(pe){return new er(pe)}function Ir(pe){this._context=pe}Ir.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var xr=(this._x0+4*this._x1+pe)/6,Gr=(this._y0+4*this._y1+Ke)/6;this._line?this._context.lineTo(xr,Gr):this._context.moveTo(xr,Gr);break;case 3:this._point=4;default:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function de(pe){return new Ir(pe)}function Dt(pe,Ke){this._basis=new vr(pe),this._beta=Ke}Dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var pe=this._x,Ke=this._y,xr=pe.length-1;if(xr>0)for(var Gr=pe[0],ln=Ke[0],wn=pe[xr]-Gr,rn=Ke[xr]-ln,Qr=-1,vn;++Qr<=xr;)vn=Qr/xr,this._basis.point(this._beta*pe[Qr]+(1-this._beta)*(Gr+vn*wn),this._beta*Ke[Qr]+(1-this._beta)*(ln+vn*rn));this._x=this._y=null,this._basis.lineEnd()},point:function(pe,Ke){this._x.push(+pe),this._y.push(+Ke)}};var qt=(function pe(Ke){function xr(Gr){return Ke===1?new vr(Gr):new Dt(Gr,Ke)}return xr.beta=function(Gr){return pe(+Gr)},xr})(.85);function _t(pe,Ke,xr){pe._context.bezierCurveTo(pe._x1+pe._k*(pe._x2-pe._x0),pe._y1+pe._k*(pe._y2-pe._y0),pe._x2+pe._k*(pe._x1-Ke),pe._y2+pe._k*(pe._y1-xr),pe._x2,pe._y2)}function lt(pe,Ke){this._context=pe,this._k=(1-Ke)/6}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:_t(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2,this._x1=pe,this._y1=Ke;break;case 2:this._point=3;default:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var yt=(function pe(Ke){function xr(Gr){return new lt(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr})(0);function St(pe,Ke){this._context=pe,this._k=(1-Ke)/6}St.prototype={areaStart:We,areaEnd:We,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._x3=pe,this._y3=Ke;break;case 1:this._point=2,this._context.moveTo(this._x4=pe,this._y4=Ke);break;case 2:this._point=3,this._x5=pe,this._y5=Ke;break;default:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Ht=(function pe(Ke){function xr(Gr){return new St(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr})(0);function Yt(pe,Ke){this._context=pe,this._k=(1-Ke)/6}Yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var se=(function pe(Ke){function xr(Gr){return new Yt(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr})(0);function ke(pe,Ke,xr){var Gr=pe._x1,ln=pe._y1,wn=pe._x2,rn=pe._y2;if(pe._l01_a>a){var Qr=2*pe._l01_2a+3*pe._l01_a*pe._l12_a+pe._l12_2a,vn=3*pe._l01_a*(pe._l01_a+pe._l12_a);Gr=(Gr*Qr-pe._x0*pe._l12_2a+pe._x2*pe._l01_2a)/vn,ln=(ln*Qr-pe._y0*pe._l12_2a+pe._y2*pe._l01_2a)/vn}if(pe._l23_a>a){var Oa=2*pe._l23_2a+3*pe._l23_a*pe._l12_a+pe._l12_2a,Qn=3*pe._l23_a*(pe._l23_a+pe._l12_a);wn=(wn*Oa+pe._x1*pe._l23_2a-Ke*pe._l12_2a)/Qn,rn=(rn*Oa+pe._y1*pe._l23_2a-xr*pe._l12_2a)/Qn}pe._context.bezierCurveTo(Gr,ln,wn,rn,pe._x2,pe._y2)}function Ee(pe,Ke){this._context=pe,this._alpha=Ke}Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;break;case 2:this._point=3;default:ke(this,pe,Ke);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Ue=(function pe(Ke){function xr(Gr){return Ke?new Ee(Gr,Ke):new lt(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr})(.5);function ir(pe,Ke){this._context=pe,this._alpha=Ke}ir.prototype={areaStart:We,areaEnd:We,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=pe,this._y3=Ke;break;case 1:this._point=2,this._context.moveTo(this._x4=pe,this._y4=Ke);break;case 2:this._point=3,this._x5=pe,this._y5=Ke;break;default:ke(this,pe,Ke);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var ar=(function pe(Ke){function xr(Gr){return Ke?new ir(Gr,Ke):new St(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr})(.5);function Ye(pe,Ke){this._context=pe,this._alpha=Ke}Ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ke(this,pe,Ke);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Er=(function pe(Ke){function xr(Gr){return Ke?new Ye(Gr,Ke):new Yt(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr})(.5);function pn(pe){this._context=pe}pn.prototype={areaStart:We,areaEnd:We,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(pe,Ke){pe=+pe,Ke=+Ke,this._point?this._context.lineTo(pe,Ke):(this._point=1,this._context.moveTo(pe,Ke))}};function dn(pe){return new pn(pe)}function bn(pe){return pe<0?-1:1}function Zn(pe,Ke,xr){var Gr=pe._x1-pe._x0,ln=Ke-pe._x1,wn=(pe._y1-pe._y0)/(Gr||ln<0&&-0),rn=(xr-pe._y1)/(ln||Gr<0&&-0),Qr=(wn*ln+rn*Gr)/(Gr+ln);return(bn(wn)+bn(rn))*Math.min(Math.abs(wn),Math.abs(rn),.5*Math.abs(Qr))||0}function En(pe,Ke){var xr=pe._x1-pe._x0;return xr?(3*(pe._y1-pe._y0)/xr-Ke)/2:Ke}function gn(pe,Ke,xr){var Gr=pe._x0,ln=pe._y0,wn=pe._x1,rn=pe._y1,Qr=(wn-Gr)/3;pe._context.bezierCurveTo(Gr+Qr,ln+Qr*Ke,wn-Qr,rn-Qr*xr,wn,rn)}function da(pe){this._context=pe}da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gn(this,this._t0,En(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){var xr=NaN;if(pe=+pe,Ke=+Ke,!(pe===this._x1&&Ke===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;break;case 2:this._point=3,gn(this,En(this,xr=Zn(this,pe,Ke)),xr);break;default:gn(this,this._t0,xr=Zn(this,pe,Ke));break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke,this._t0=xr}}};function ra(pe){this._context=new Se(pe)}(ra.prototype=Object.create(da.prototype)).point=function(pe,Ke){da.prototype.point.call(this,Ke,pe)};function Se(pe){this._context=pe}Se.prototype={moveTo:function(pe,Ke){this._context.moveTo(Ke,pe)},closePath:function(){this._context.closePath()},lineTo:function(pe,Ke){this._context.lineTo(Ke,pe)},bezierCurveTo:function(pe,Ke,xr,Gr,ln,wn){this._context.bezierCurveTo(Ke,pe,Gr,xr,wn,ln)}};function Re(pe){return new da(pe)}function Ze(pe){return new ra(pe)}function tr(pe){this._context=pe}tr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var pe=this._x,Ke=this._y,xr=pe.length;if(xr)if(this._line?this._context.lineTo(pe[0],Ke[0]):this._context.moveTo(pe[0],Ke[0]),xr===2)this._context.lineTo(pe[1],Ke[1]);else for(var Gr=zr(pe),ln=zr(Ke),wn=0,rn=1;rn=0;--Ke)ln[Ke]=(rn[Ke]-ln[Ke+1])/wn[Ke];for(wn[xr-1]=(pe[xr]+ln[xr-1])/2,Ke=0;Ke=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Ke),this._context.lineTo(pe,Ke);else{var xr=this._x*(1-this._t)+pe*this._t;this._context.lineTo(xr,this._y),this._context.lineTo(xr,Ke)}break}}this._x=pe,this._y=Ke}};function $r(pe){return new Yr(pe,.5)}function In(pe){return new Yr(pe,0)}function Nn(pe){return new Yr(pe,1)}function Kn(pe,Ke){if((rn=pe.length)>1)for(var xr=1,Gr,ln,wn=pe[Ke[0]],rn,Qr=wn.length;xr=0;)xr[Ke]=Ke;return xr}function ia(pe,Ke){return pe[Ke]}function Cn(){var pe=E([]),Ke=$n,xr=Kn,Gr=ia;function ln(wn){var rn=pe.apply(this,arguments),Qr,vn=wn.length,Oa=rn.length,Qn=new Array(Oa),Qa;for(Qr=0;Qr0){for(var xr,Gr,ln=0,wn=pe[0].length,rn;ln0)for(var xr,Gr=0,ln,wn,rn,Qr,vn,Oa=pe[Ke[0]].length;Gr0?(ln[0]=rn,ln[1]=rn+=wn):wn<0?(ln[1]=Qr,ln[0]=Qr+=wn):(ln[0]=0,ln[1]=wn)}function ve(pe,Ke){if((ln=pe.length)>0){for(var xr=0,Gr=pe[Ke[0]],ln,wn=Gr.length;xr0)||!((wn=(ln=pe[Ke[0]]).length)>0))){for(var xr=0,Gr=1,ln,wn,rn;Grwn&&(wn=ln,xr=Ke);return xr}function Tr(pe){var Ke=pe.map(mr);return $n(pe).sort(function(xr,Gr){return Ke[xr]-Ke[Gr]})}function mr(pe){for(var Ke=0,xr=-1,Gr=pe.length,ln;++xr{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Sv(),Qx(),j5()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3)})(K,function(u,d,E,A){function t(h){return h.target.depth}function e(h){return h.depth}function r(h,b){return b-1-h.height}function i(h,b){return h.sourceLinks.length?h.depth:b-1}function n(h){return h.targetLinks.length?h.depth:h.sourceLinks.length?d.min(h.sourceLinks,t)-1:0}function o(h){return function(){return h}}function a(h,b){return f(h.source,b.source)||h.index-b.index}function s(h,b){return f(h.target,b.target)||h.index-b.index}function f(h,b){return h.y0-b.y0}function v(h){return h.value}function g(h){return(h.y0+h.y1)/2}function m(h){return g(h.source)*h.value}function w(h){return g(h.target)*h.value}function l(h){return h.index}function x(h){return h.nodes}function y(h){return h.links}function S(h,b){var _=h.get(b);if(!_)throw new Error("missing: "+b);return _}var k=function(){var h=0,b=0,_=1,P=1,z=24,D=8,B=l,R=i,I=x,F=y,j=32,N=2/3;function G(){var ot={nodes:I.apply(null,arguments),links:F.apply(null,arguments)};return rt(ot),ct(ot),st(ot),et(ot),Z(ot),ot}G.update=function(ot){return Z(ot),ot},G.nodeId=function(ot){return arguments.length?(B=typeof ot=="function"?ot:o(ot),G):B},G.nodeAlign=function(ot){return arguments.length?(R=typeof ot=="function"?ot:o(ot),G):R},G.nodeWidth=function(ot){return arguments.length?(z=+ot,G):z},G.nodePadding=function(ot){return arguments.length?(D=+ot,G):D},G.nodes=function(ot){return arguments.length?(I=typeof ot=="function"?ot:o(ot),G):I},G.links=function(ot){return arguments.length?(F=typeof ot=="function"?ot:o(ot),G):F},G.size=function(ot){return arguments.length?(h=b=0,_=+ot[0],P=+ot[1],G):[_-h,P-b]},G.extent=function(ot){return arguments.length?(h=+ot[0][0],_=+ot[1][0],b=+ot[0][1],P=+ot[1][1],G):[[h,b],[_,P]]},G.iterations=function(ot){return arguments.length?(j=+ot,G):j};function rt(ot){ot.nodes.forEach(function(Q,ut){Q.index=ut,Q.sourceLinks=[],Q.targetLinks=[]});var X=E.map(ot.nodes,B);ot.links.forEach(function(Q,ut){Q.index=ut;var J=Q.source,q=Q.target;typeof J!="object"&&(J=Q.source=S(X,J)),typeof q!="object"&&(q=Q.target=S(X,q)),J.sourceLinks.push(Q),q.targetLinks.push(Q)})}function ct(ot){ot.nodes.forEach(function(X){X.value=Math.max(d.sum(X.sourceLinks,v),d.sum(X.targetLinks,v))})}function st(ot){var X,Q,ut;for(X=ot.nodes,Q=[],ut=0;X.length;++ut,X=Q,Q=[])X.forEach(function(q){q.depth=ut,q.sourceLinks.forEach(function(it){Q.indexOf(it.target)<0&&Q.push(it.target)})});for(X=ot.nodes,Q=[],ut=0;X.length;++ut,X=Q,Q=[])X.forEach(function(q){q.height=ut,q.targetLinks.forEach(function(it){Q.indexOf(it.source)<0&&Q.push(it.source)})});var J=(_-h-z)/(ut-1);ot.nodes.forEach(function(q){q.x1=(q.x0=h+Math.max(0,Math.min(ut-1,Math.floor(R.call(null,q,ut))))*J)+z})}function et(ot){var X=E.nest().key(function(dt){return dt.x0}).sortKeys(d.ascending).entries(ot.nodes).map(function(dt){return dt.values});J(),nt();for(var Q=1,ut=j;ut>0;--ut)it(Q*=.99),nt(),q(Q),nt();function J(){var dt=d.max(X,function(Ct){return Ct.length}),Tt=N*(P-b)/(dt-1);D>Tt&&(D=Tt);var wt=d.min(X,function(Ct){return(P-b-(Ct.length-1)*D)/d.sum(Ct,v)});X.forEach(function(Ct){Ct.forEach(function(It,Nt){It.y1=(It.y0=Nt)+It.value*wt})}),ot.links.forEach(function(Ct){Ct.width=Ct.value*wt})}function q(dt){X.forEach(function(Tt){Tt.forEach(function(wt){if(wt.targetLinks.length){var Ct=(d.sum(wt.targetLinks,m)/d.sum(wt.targetLinks,v)-g(wt))*dt;wt.y0+=Ct,wt.y1+=Ct}})})}function it(dt){X.slice().reverse().forEach(function(Tt){Tt.forEach(function(wt){if(wt.sourceLinks.length){var Ct=(d.sum(wt.sourceLinks,w)/d.sum(wt.sourceLinks,v)-g(wt))*dt;wt.y0+=Ct,wt.y1+=Ct}})})}function nt(){X.forEach(function(dt){var Tt,wt,Ct=b,It=dt.length,Nt;for(dt.sort(f),Nt=0;Nt0&&(Tt.y0+=wt,Tt.y1+=wt),Ct=Tt.y1+D;if(wt=Ct-D-P,wt>0)for(Ct=Tt.y0-=wt,Tt.y1-=wt,Nt=It-2;Nt>=0;--Nt)Tt=dt[Nt],wt=Tt.y1+D-Ct,wt>0&&(Tt.y0-=wt,Tt.y1-=wt),Ct=Tt.y0})}}function Z(ot){ot.nodes.forEach(function(X){X.sourceLinks.sort(s),X.targetLinks.sort(a)}),ot.nodes.forEach(function(X){var Q=X.y0,ut=Q;X.sourceLinks.forEach(function(J){J.y0=Q+J.width/2,Q+=J.width}),X.targetLinks.forEach(function(J){J.y1=ut+J.width/2,ut+=J.width})})}return G};function M(h){return[h.source.x1,h.y0]}function T(h){return[h.target.x0,h.y1]}var c=function(){return A.linkHorizontal().source(M).target(T)};u.sankey=k,u.sankeyCenter=n,u.sankeyLeft=e,u.sankeyRight=r,u.sankeyJustify=i,u.sankeyLinkHorizontal=c,Object.defineProperty(u,"__esModule",{value:!0})})}),$z=Vt((K,V)=>{var u=N5();V.exports=function(d,E){var A=[],t=[],e=[],r={},i=[],n;function o(y){e[y]=!1,r.hasOwnProperty(y)&&Object.keys(r[y]).forEach(function(S){delete r[y][S],e[S]&&o(S)})}function a(y){var S=!1;t.push(y),e[y]=!0;var k,M;for(k=0;k=y})}function v(y){f(y);for(var S=d,k=u(S),M=k.components.filter(function(z){return z.length>1}),T=1/0,c,h=0;h{(function(u,d){typeof K=="object"&&typeof V<"u"?d(K,Sv(),Qx(),j5(),$z()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3,null)})(K,function(u,d,E,A,t){t=t&&t.hasOwnProperty("default")?t.default:t;function e(It){return It.target.depth}function r(It){return It.depth}function i(It,Nt){return Nt-1-It.height}function n(It,Nt){return It.sourceLinks.length?It.depth:Nt-1}function o(It){return It.targetLinks.length?It.depth:It.sourceLinks.length?d.min(It.sourceLinks,e)-1:0}function a(It){return function(){return It}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(It){return typeof It}:function(It){return It&&typeof Symbol=="function"&&It.constructor===Symbol&&It!==Symbol.prototype?"symbol":typeof It};function f(It,Nt){return g(It.source,Nt.source)||It.index-Nt.index}function v(It,Nt){return g(It.target,Nt.target)||It.index-Nt.index}function g(It,Nt){return It.partOfCycle===Nt.partOfCycle?It.y0-Nt.y0:It.circularLinkType==="top"||Nt.circularLinkType==="bottom"?-1:1}function m(It){return It.value}function w(It){return(It.y0+It.y1)/2}function l(It){return w(It.source)}function x(It){return w(It.target)}function y(It){return It.index}function S(It){return It.nodes}function k(It){return It.links}function M(It,Nt){var te=It.get(Nt);if(!te)throw new Error("missing: "+Nt);return te}function T(It,Nt){return Nt(It)}var c=25,h=10,b=.3;function _(){var It=0,Nt=0,te=1,Jt=1,ee=24,Zt,mt=y,bt=n,vt=S,Ut=k,re=32,Kt=2,ue,Me=null;function Ce(){var de={nodes:vt.apply(null,arguments),links:Ut.apply(null,arguments)};We(de),P(de,mt,Me),qe(de),er(de),z(de,mt),Mr(de,re,mt),Ir(de);for(var Dt=4,qt=0;qt"u"?"undefined":s(lt))!=="object"&&(lt=qt.source=M(Dt,lt)),(typeof yt>"u"?"undefined":s(yt))!=="object"&&(yt=qt.target=M(Dt,yt)),lt.sourceLinks.push(qt),yt.targetLinks.push(qt)}),de}function qe(de){de.nodes.forEach(function(Dt){Dt.partOfCycle=!1,Dt.value=Math.max(d.sum(Dt.sourceLinks,m),d.sum(Dt.targetLinks,m)),Dt.sourceLinks.forEach(function(qt){qt.circular&&(Dt.partOfCycle=!0,Dt.circularLinkType=qt.circularLinkType)}),Dt.targetLinks.forEach(function(qt){qt.circular&&(Dt.partOfCycle=!0,Dt.circularLinkType=qt.circularLinkType)})})}function vr(de){var Dt=0,qt=0,_t=0,lt=0,yt=d.max(de.nodes,function(St){return St.column});return de.links.forEach(function(St){St.circular&&(St.circularLinkType=="top"?Dt=Dt+St.width:qt=qt+St.width,St.target.column==0&&(lt=lt+St.width),St.source.column==yt&&(_t=_t+St.width))}),Dt=Dt>0?Dt+c+h:Dt,qt=qt>0?qt+c+h:qt,_t=_t>0?_t+c+h:_t,lt=lt>0?lt+c+h:lt,{top:Dt,bottom:qt,left:lt,right:_t}}function _r(de,Dt){var qt=d.max(de.nodes,function(se){return se.column}),_t=te-It,lt=Jt-Nt,yt=_t+Dt.right+Dt.left,St=lt+Dt.top+Dt.bottom,Ht=_t/yt,Yt=lt/St;return It=It*Ht+Dt.left,te=Dt.right==0?te:te*Ht,Nt=Nt*Yt+Dt.top,Jt=Jt*Yt,de.nodes.forEach(function(se){se.x0=It+se.column*((te-It-ee)/qt),se.x1=se.x0+ee}),Yt}function er(de){var Dt,qt,_t;for(Dt=de.nodes,qt=[],_t=0;Dt.length;++_t,Dt=qt,qt=[])Dt.forEach(function(lt){lt.depth=_t,lt.sourceLinks.forEach(function(yt){qt.indexOf(yt.target)<0&&!yt.circular&&qt.push(yt.target)})});for(Dt=de.nodes,qt=[],_t=0;Dt.length;++_t,Dt=qt,qt=[])Dt.forEach(function(lt){lt.height=_t,lt.targetLinks.forEach(function(yt){qt.indexOf(yt.source)<0&&!yt.circular&&qt.push(yt.source)})});de.nodes.forEach(function(lt){lt.column=Math.floor(bt.call(null,lt,_t))})}function Mr(de,Dt,qt){var _t=E.nest().key(function(se){return se.column}).sortKeys(d.ascending).entries(de.nodes).map(function(se){return se.values});St(qt),Yt();for(var lt=1,yt=Dt;yt>0;--yt)Ht(lt*=.99,qt),Yt();function St(se){if(ue){var ke=1/0;_t.forEach(function(ar){var Ye=Jt*ue/(ar.length+1);ke=Ye0))if(ar==0&&ir==1)Er=Ye.y1-Ye.y0,Ye.y0=Jt/2-Er/2,Ye.y1=Jt/2+Er/2;else if(ar==Ee-1&&ir==1)Er=Ye.y1-Ye.y0,Ye.y0=Jt/2-Er/2,Ye.y1=Jt/2+Er/2;else{var pn=0,dn=d.mean(Ye.sourceLinks,x),bn=d.mean(Ye.targetLinks,l);dn&&bn?pn=(dn+bn)/2:pn=dn||bn;var Zn=(pn-w(Ye))*se;Ye.y0+=Zn,Ye.y1+=Zn}})})}function Yt(){_t.forEach(function(se){var ke,Ee,Ue=Nt,ir=se.length,ar;for(se.sort(g),ar=0;ar0&&(ke.y0+=Ee,ke.y1+=Ee),Ue=ke.y1+Zt;if(Ee=Ue-Zt-Jt,Ee>0)for(Ue=ke.y0-=Ee,ke.y1-=Ee,ar=ir-2;ar>=0;--ar)ke=se[ar],Ee=ke.y1+Zt-Ue,Ee>0&&(ke.y0-=Ee,ke.y1-=Ee),Ue=ke.y0})}}function Ir(de){de.nodes.forEach(function(Dt){Dt.sourceLinks.sort(v),Dt.targetLinks.sort(f)}),de.nodes.forEach(function(Dt){var qt=Dt.y0,_t=qt,lt=Dt.y1,yt=lt;Dt.sourceLinks.forEach(function(St){St.circular?(St.y0=lt-St.width/2,lt=lt-St.width):(St.y0=qt+St.width/2,qt+=St.width)}),Dt.targetLinks.forEach(function(St){St.circular?(St.y1=yt-St.width/2,yt=yt-St.width):(St.y1=_t+St.width/2,_t+=St.width)})})}return Ce}function P(It,Nt,te){var Jt=0;if(te===null){for(var ee=[],Zt=0;ZtNt.source.column)}function R(It,Nt){var te=0;It.sourceLinks.forEach(function(ee){te=ee.circular&&!wt(ee,Nt)?te+1:te});var Jt=0;return It.targetLinks.forEach(function(ee){Jt=ee.circular&&!wt(ee,Nt)?Jt+1:Jt}),te+Jt}function I(It){var Nt=It.source.sourceLinks,te=0;Nt.forEach(function(Zt){te=Zt.circular?te+1:te});var Jt=It.target.targetLinks,ee=0;return Jt.forEach(function(Zt){ee=Zt.circular?ee+1:ee}),!(te>1||ee>1)}function F(It,Nt,te){return It.sort(G),It.forEach(function(Jt,ee){var Zt=0;if(wt(Jt,te)&&I(Jt))Jt.circularPathData.verticalBuffer=Zt+Jt.width/2;else{var mt=0;for(mt;mtZt?bt:Zt}Jt.circularPathData.verticalBuffer=Zt+Jt.width/2}}),It}function j(It,Nt,te,Jt){var ee=5,Zt=d.min(It.links,function(vt){return vt.source.y0});It.links.forEach(function(vt){vt.circular&&(vt.circularPathData={})});var mt=It.links.filter(function(vt){return vt.circularLinkType=="top"});F(mt,Nt,Jt);var bt=It.links.filter(function(vt){return vt.circularLinkType=="bottom"});F(bt,Nt,Jt),It.links.forEach(function(vt){if(vt.circular){if(vt.circularPathData.arcRadius=vt.width+h,vt.circularPathData.leftNodeBuffer=ee,vt.circularPathData.rightNodeBuffer=ee,vt.circularPathData.sourceWidth=vt.source.x1-vt.source.x0,vt.circularPathData.sourceX=vt.source.x0+vt.circularPathData.sourceWidth,vt.circularPathData.targetX=vt.target.x0,vt.circularPathData.sourceY=vt.y0,vt.circularPathData.targetY=vt.y1,wt(vt,Jt)&&I(vt))vt.circularPathData.leftSmallArcRadius=h+vt.width/2,vt.circularPathData.leftLargeArcRadius=h+vt.width/2,vt.circularPathData.rightSmallArcRadius=h+vt.width/2,vt.circularPathData.rightLargeArcRadius=h+vt.width/2,vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=vt.source.y1+c+vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.rightLargeArcRadius):(vt.circularPathData.verticalFullExtent=vt.source.y0-c-vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.rightLargeArcRadius);else{var Ut=vt.source.column,re=vt.circularLinkType,Kt=It.links.filter(function(Ce){return Ce.source.column==Ut&&Ce.circularLinkType==re});vt.circularLinkType=="bottom"?Kt.sort(ct):Kt.sort(rt);var ue=0;Kt.forEach(function(Ce,We){Ce.circularLinkID==vt.circularLinkID&&(vt.circularPathData.leftSmallArcRadius=h+vt.width/2+ue,vt.circularPathData.leftLargeArcRadius=h+vt.width/2+We*Nt+ue),ue=ue+Ce.width}),Ut=vt.target.column,Kt=It.links.filter(function(Ce){return Ce.target.column==Ut&&Ce.circularLinkType==re}),vt.circularLinkType=="bottom"?Kt.sort(et):Kt.sort(st),ue=0,Kt.forEach(function(Ce,We){Ce.circularLinkID==vt.circularLinkID&&(vt.circularPathData.rightSmallArcRadius=h+vt.width/2+ue,vt.circularPathData.rightLargeArcRadius=h+vt.width/2+We*Nt+ue),ue=ue+Ce.width}),vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=Math.max(te,vt.source.y1,vt.target.y1)+c+vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.rightLargeArcRadius):(vt.circularPathData.verticalFullExtent=Zt-c-vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.rightLargeArcRadius)}vt.circularPathData.leftInnerExtent=vt.circularPathData.sourceX+vt.circularPathData.leftNodeBuffer,vt.circularPathData.rightInnerExtent=vt.circularPathData.targetX-vt.circularPathData.rightNodeBuffer,vt.circularPathData.leftFullExtent=vt.circularPathData.sourceX+vt.circularPathData.leftLargeArcRadius+vt.circularPathData.leftNodeBuffer,vt.circularPathData.rightFullExtent=vt.circularPathData.targetX-vt.circularPathData.rightLargeArcRadius-vt.circularPathData.rightNodeBuffer}if(vt.circular)vt.path=N(vt);else{var Me=A.linkHorizontal().source(function(Ce){var We=Ce.source.x0+(Ce.source.x1-Ce.source.x0),qe=Ce.y0;return[We,qe]}).target(function(Ce){var We=Ce.target.x0,qe=Ce.y1;return[We,qe]});vt.path=Me(vt)}})}function N(It){var Nt="";return It.circularLinkType=="top"?Nt="M"+It.circularPathData.sourceX+" "+It.circularPathData.sourceY+" L"+It.circularPathData.leftInnerExtent+" "+It.circularPathData.sourceY+" A"+It.circularPathData.leftLargeArcRadius+" "+It.circularPathData.leftSmallArcRadius+" 0 0 0 "+It.circularPathData.leftFullExtent+" "+(It.circularPathData.sourceY-It.circularPathData.leftSmallArcRadius)+" L"+It.circularPathData.leftFullExtent+" "+It.circularPathData.verticalLeftInnerExtent+" A"+It.circularPathData.leftLargeArcRadius+" "+It.circularPathData.leftLargeArcRadius+" 0 0 0 "+It.circularPathData.leftInnerExtent+" "+It.circularPathData.verticalFullExtent+" L"+It.circularPathData.rightInnerExtent+" "+It.circularPathData.verticalFullExtent+" A"+It.circularPathData.rightLargeArcRadius+" "+It.circularPathData.rightLargeArcRadius+" 0 0 0 "+It.circularPathData.rightFullExtent+" "+It.circularPathData.verticalRightInnerExtent+" L"+It.circularPathData.rightFullExtent+" "+(It.circularPathData.targetY-It.circularPathData.rightSmallArcRadius)+" A"+It.circularPathData.rightLargeArcRadius+" "+It.circularPathData.rightSmallArcRadius+" 0 0 0 "+It.circularPathData.rightInnerExtent+" "+It.circularPathData.targetY+" L"+It.circularPathData.targetX+" "+It.circularPathData.targetY:Nt="M"+It.circularPathData.sourceX+" "+It.circularPathData.sourceY+" L"+It.circularPathData.leftInnerExtent+" "+It.circularPathData.sourceY+" A"+It.circularPathData.leftLargeArcRadius+" "+It.circularPathData.leftSmallArcRadius+" 0 0 1 "+It.circularPathData.leftFullExtent+" "+(It.circularPathData.sourceY+It.circularPathData.leftSmallArcRadius)+" L"+It.circularPathData.leftFullExtent+" "+It.circularPathData.verticalLeftInnerExtent+" A"+It.circularPathData.leftLargeArcRadius+" "+It.circularPathData.leftLargeArcRadius+" 0 0 1 "+It.circularPathData.leftInnerExtent+" "+It.circularPathData.verticalFullExtent+" L"+It.circularPathData.rightInnerExtent+" "+It.circularPathData.verticalFullExtent+" A"+It.circularPathData.rightLargeArcRadius+" "+It.circularPathData.rightLargeArcRadius+" 0 0 1 "+It.circularPathData.rightFullExtent+" "+It.circularPathData.verticalRightInnerExtent+" L"+It.circularPathData.rightFullExtent+" "+(It.circularPathData.targetY+It.circularPathData.rightSmallArcRadius)+" A"+It.circularPathData.rightLargeArcRadius+" "+It.circularPathData.rightSmallArcRadius+" 0 0 1 "+It.circularPathData.rightInnerExtent+" "+It.circularPathData.targetY+" L"+It.circularPathData.targetX+" "+It.circularPathData.targetY,Nt}function G(It,Nt){return Z(It)==Z(Nt)?It.circularLinkType=="bottom"?ct(It,Nt):rt(It,Nt):Z(Nt)-Z(It)}function rt(It,Nt){return It.y0-Nt.y0}function ct(It,Nt){return Nt.y0-It.y0}function st(It,Nt){return It.y1-Nt.y1}function et(It,Nt){return Nt.y1-It.y1}function Z(It){return It.target.column-It.source.column}function ot(It){return It.target.x0-It.source.x1}function X(It,Nt){var te=D(It),Jt=ot(Nt)/Math.tan(te),ee=Tt(It)=="up"?It.y1+Jt:It.y1-Jt;return ee}function Q(It,Nt){var te=D(It),Jt=ot(Nt)/Math.tan(te),ee=Tt(It)=="up"?It.y1-Jt:It.y1+Jt;return ee}function ut(It,Nt,te,Jt){It.links.forEach(function(ee){if(!ee.circular&&ee.target.column-ee.source.column>1){var Zt=ee.source.column+1,mt=ee.target.column-1,bt=1,vt=mt-Zt+1;for(bt=1;Zt<=mt;Zt++,bt++)It.nodes.forEach(function(Ut){if(Ut.column==Zt){var re=bt/(vt+1),Kt=Math.pow(1-re,3),ue=3*re*Math.pow(1-re,2),Me=3*Math.pow(re,2)*(1-re),Ce=Math.pow(re,3),We=Kt*ee.y0+ue*ee.y0+Me*ee.y1+Ce*ee.y1,qe=We-ee.width/2,vr=We+ee.width/2,_r;qe>Ut.y0&&qeUt.y0&&vrUt.y1&&q(er,_r,Nt,te)})):qeUt.y1&&(_r=vr-Ut.y0+10,Ut=q(Ut,_r,Nt,te),It.nodes.forEach(function(er){T(er,Jt)==T(Ut,Jt)||er.column!=Ut.column||er.y0Ut.y1&&q(er,_r,Nt,te)}))}})}})}function J(It,Nt){return It.y0>Nt.y0&&It.y0Nt.y0&&It.y1Nt.y1}function q(It,Nt,te,Jt){return It.y0+Nt>=te&&It.y1+Nt<=Jt&&(It.y0=It.y0+Nt,It.y1=It.y1+Nt,It.targetLinks.forEach(function(ee){ee.y1=ee.y1+Nt}),It.sourceLinks.forEach(function(ee){ee.y0=ee.y0+Nt})),It}function it(It,Nt,te,Jt){It.nodes.forEach(function(ee){Jt&&ee.y+(ee.y1-ee.y0)>Nt&&(ee.y=ee.y-(ee.y+(ee.y1-ee.y0)-Nt));var Zt=It.links.filter(function(vt){return T(vt.source,te)==T(ee,te)}),mt=Zt.length;mt>1&&Zt.sort(function(vt,Ut){if(!vt.circular&&!Ut.circular){if(vt.target.column==Ut.target.column)return vt.y1-Ut.y1;if(dt(vt,Ut)){if(vt.target.column>Ut.target.column){var re=Q(Ut,vt);return vt.y1-re}if(Ut.target.column>vt.target.column){var Kt=Q(vt,Ut);return Kt-Ut.y1}}else return vt.y1-Ut.y1}if(vt.circular&&!Ut.circular)return vt.circularLinkType=="top"?-1:1;if(Ut.circular&&!vt.circular)return Ut.circularLinkType=="top"?1:-1;if(vt.circular&&Ut.circular)return vt.circularLinkType===Ut.circularLinkType&&vt.circularLinkType=="top"?vt.target.column===Ut.target.column?vt.target.y1-Ut.target.y1:Ut.target.column-vt.target.column:vt.circularLinkType===Ut.circularLinkType&&vt.circularLinkType=="bottom"?vt.target.column===Ut.target.column?Ut.target.y1-vt.target.y1:vt.target.column-Ut.target.column:vt.circularLinkType=="top"?-1:1});var bt=ee.y0;Zt.forEach(function(vt){vt.y0=bt+vt.width/2,bt=bt+vt.width}),Zt.forEach(function(vt,Ut){if(vt.circularLinkType=="bottom"){var re=Ut+1,Kt=0;for(re;re1&&ee.sort(function(bt,vt){if(!bt.circular&&!vt.circular){if(bt.source.column==vt.source.column)return bt.y0-vt.y0;if(dt(bt,vt)){if(vt.source.column0?"up":"down"}function wt(It,Nt){return T(It.source,Nt)==T(It.target,Nt)}function Ct(It,Nt,te){var Jt=It.nodes,ee=It.links,Zt=!1,mt=!1;if(ee.forEach(function(ue){ue.circularLinkType=="top"?Zt=!0:ue.circularLinkType=="bottom"&&(mt=!0)}),Zt==!1||mt==!1){var bt=d.min(Jt,function(ue){return ue.y0}),vt=d.max(Jt,function(ue){return ue.y1}),Ut=vt-bt,re=te-Nt,Kt=re/Ut;Jt.forEach(function(ue){var Me=(ue.y1-ue.y0)*Kt;ue.y0=(ue.y0-bt)*Kt,ue.y1=ue.y0+Me}),ee.forEach(function(ue){ue.y0=(ue.y0-bt)*Kt,ue.y1=(ue.y1-bt)*Kt,ue.width=ue.width*Kt})}}u.sankeyCircular=_,u.sankeyCenter=o,u.sankeyLeft=r,u.sankeyRight=i,u.sankeyJustify=n,Object.defineProperty(u,"__esModule",{value:!0})})}),U5=Vt((K,V)=>{V.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),Qz=Vt((K,V)=>{var u=Kz(),d=(M0(),yd(Bd)).interpolateNumber,E=Ni(),A=Xz(),t=Jz(),e=U5(),r=Af(),i=Pi(),n=Eo(),o=Xr(),a=o.strTranslate,s=o.strRotate,f=bp(),v=f.keyFun,g=f.repeat,m=f.unwrap,w=Dl(),l=ji(),x=gf(),y=x.CAP_SHIFT,S=x.LINE_SPACING,k=3;function M(X,Q,ut){var J=m(Q),q=J.trace,it=q.domain,nt=q.orientation==="h",dt=q.node.pad,Tt=q.node.thickness,wt={justify:A.sankeyJustify,left:A.sankeyLeft,right:A.sankeyRight,center:A.sankeyCenter}[q.node.align],Ct=X.width*(it.x[1]-it.x[0]),It=X.height*(it.y[1]-it.y[0]),Nt=J._nodes,te=J._links,Jt=J.circular,ee;Jt?ee=t.sankeyCircular().circularLinkGap(0):ee=A.sankey(),ee.iterations(e.sankeyIterations).size(nt?[Ct,It]:[It,Ct]).nodeWidth(Tt).nodePadding(dt).nodeId(function(er){return er.pointNumber}).nodeAlign(wt).nodes(Nt).links(te);var Zt=ee();ee.nodePadding()=Dt||(de=Dt-Ir.y0,de>1e-6&&(Ir.y0+=de,Ir.y1+=de)),Dt=Ir.y1+dt})}function We(er){var Mr=er.map(function(yt,St){return{x0:yt.x0,index:St}}).sort(function(yt,St){return yt.x0-St.x0}),Ir=[],de=-1,Dt,qt=-1/0,_t;for(mt=0;mtqt+Tt&&(de+=1,Dt=lt.x0),qt=lt.x0,Ir[de]||(Ir[de]=[]),Ir[de].push(lt),_t=Dt-lt.x0,lt.x0+=_t,lt.x1+=_t}return Ir}if(q.node.x.length&&q.node.y.length){for(mt=0;mt0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(ut="M "+(q.targetX-Q)+" "+(q.targetY-J)+" L "+(q.rightInnerExtent-Q)+" "+(q.targetY-J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightSmallArcRadius+J)+" 0 0 0 "+(q.rightFullExtent-J-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-J-Q)+" "+q.verticalRightInnerExtent,it&&nt?ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightInnerExtent-J-Q)+" "+(q.verticalFullExtent+J)+" L "+(q.rightFullExtent+J-Q-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent+J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent:it?ut+=" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightFullExtent-Q-J-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" L "+(q.leftFullExtent+J+(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent:ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent+J)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+J)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent,ut+=" L "+(q.leftFullExtent+J)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-J)+" L "+q.sourceX+" "+(q.sourceY-J)+" L "+q.sourceX+" "+(q.sourceY+J)+" L "+q.leftInnerExtent+" "+(q.sourceY+J)+" A "+(q.leftLargeArcRadius-J)+" "+(q.leftSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent-J)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-J)+" "+q.verticalLeftInnerExtent,it&&nt?ut+=" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent-J-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" L "+(q.rightFullExtent+J-Q+(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:it?ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+(q.verticalFullExtent+J)+" L "+(q.rightFullExtent-Q-J)+" "+(q.verticalFullExtent+J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:ut+=" A "+(q.leftLargeArcRadius-J)+" "+(q.leftLargeArcRadius-J)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-J)+" L "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightLargeArcRadius-J)+" 0 0 1 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent,ut+=" L "+(q.rightFullExtent+J-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightInnerExtent-Q)+" "+(q.targetY+J)+" L "+(q.targetX-Q)+" "+(q.targetY+J)+(Q>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),ut}function h(){var X=.5;function Q(ut){var J=ut.linkArrowLength;if(ut.link.circular)return c(ut.link,J);var q=Math.abs((ut.link.target.x0-ut.link.source.x1)/2);J>q&&(J=q);var it=ut.link.source.x1,nt=ut.link.target.x0-J,dt=d(it,nt),Tt=dt(X),wt=dt(1-X),Ct=ut.link.y0-ut.link.width/2,It=ut.link.y0+ut.link.width/2,Nt=ut.link.y1-ut.link.width/2,te=ut.link.y1+ut.link.width/2,Jt="M"+it+","+Ct,ee="C"+Tt+","+Ct+" "+wt+","+Nt+" "+nt+","+Nt,Zt="C"+wt+","+te+" "+Tt+","+It+" "+it+","+It,mt=J>0?"L"+(nt+J)+","+(Nt+ut.link.width/2):"";return mt+="L"+nt+","+te,Jt+ee+mt+Zt+"Z"}return Q}function b(X,Q){var ut=r(Q.color),J=e.nodePadAcross,q=X.nodePad/2;Q.dx=Q.x1-Q.x0,Q.dy=Q.y1-Q.y0;var it=Q.dx,nt=Math.max(.5,Q.dy),dt="node_"+Q.pointNumber;return Q.group&&(dt=o.randstr()),Q.trace=X.trace,Q.curveNumber=X.trace.index,{index:Q.pointNumber,key:dt,partOfGroup:Q.partOfGroup||!1,group:Q.group,traceId:X.key,trace:X.trace,node:Q,nodePad:X.nodePad,nodeLineColor:X.nodeLineColor,nodeLineWidth:X.nodeLineWidth,textFont:X.textFont,size:X.horizontal?X.height:X.width,visibleWidth:Math.ceil(it),visibleHeight:nt,zoneX:-J,zoneY:-q,zoneWidth:it+2*J,zoneHeight:nt+2*q,labelY:X.horizontal?Q.dy/2+1:Q.dx/2+1,left:Q.originalLayer===1,sizeAcross:X.width,forceLayouts:X.forceLayouts,horizontal:X.horizontal,darkBackground:ut.getBrightness()<=128,tinyColorHue:i.tinyRGB(ut),tinyColorAlpha:ut.getAlpha(),valueFormat:X.valueFormat,valueSuffix:X.valueSuffix,sankey:X.sankey,graph:X.graph,arrangement:X.arrangement,uniqueNodeLabelPathId:[X.guid,X.key,dt].join("_"),interactionState:X.interactionState,figure:X}}function _(X){X.attr("transform",function(Q){return a(Q.node.x0.toFixed(3),Q.node.y0.toFixed(3))})}function P(X){X.call(_)}function z(X,Q){X.call(P),Q.attr("d",h())}function D(X){X.attr("width",function(Q){return Q.node.x1-Q.node.x0}).attr("height",function(Q){return Q.visibleHeight})}function B(X){return X.link.width>1||X.linkLineWidth>0}function R(X){var Q=a(X.translateX,X.translateY);return Q+(X.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function I(X,Q,ut){X.on(".basic",null).on("mouseover.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.hover(this,J,Q),J.interactionState.hovered=[this,J])}).on("mousemove.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.follow(this,J),J.interactionState.hovered=[this,J])}).on("mouseout.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.unhover(this,J,Q),J.interactionState.hovered=!1)}).on("click.basic",function(J){J.interactionState.hovered&&(ut.unhover(this,J,Q),J.interactionState.hovered=!1),!J.interactionState.dragInProgress&&!J.partOfGroup&&ut.select(this,J,Q)})}function F(X,Q,ut,J){var q=E.behavior.drag().origin(function(it){return{x:it.node.x0+it.visibleWidth/2,y:it.node.y0+it.visibleHeight/2}}).on("dragstart",function(it){if(it.arrangement!=="fixed"&&(o.ensureSingle(J._fullLayout._infolayer,"g","dragcover",function(dt){J._fullLayout._dragCover=dt}),o.raiseToTop(this),it.interactionState.dragInProgress=it.node,st(it.node),it.interactionState.hovered&&(ut.nodeEvents.unhover.apply(0,it.interactionState.hovered),it.interactionState.hovered=!1),it.arrangement==="snap")){var nt=it.traceId+"|"+it.key;it.forceLayouts[nt]?it.forceLayouts[nt].alpha(1):j(X,nt,it),N(X,Q,it,nt,J)}}).on("drag",function(it){if(it.arrangement!=="fixed"){var nt=E.event.x,dt=E.event.y;it.arrangement==="snap"?(it.node.x0=nt-it.visibleWidth/2,it.node.x1=nt+it.visibleWidth/2,it.node.y0=dt-it.visibleHeight/2,it.node.y1=dt+it.visibleHeight/2):(it.arrangement==="freeform"&&(it.node.x0=nt-it.visibleWidth/2,it.node.x1=nt+it.visibleWidth/2),dt=Math.max(0,Math.min(it.size-it.visibleHeight/2,dt)),it.node.y0=dt-it.visibleHeight/2,it.node.y1=dt+it.visibleHeight/2),st(it.node),it.arrangement!=="snap"&&(it.sankey.update(it.graph),z(X.filter(et(it)),Q))}}).on("dragend",function(it){if(it.arrangement!=="fixed"){it.interactionState.dragInProgress=!1;for(var nt=0;nt0)window.requestAnimationFrame(it);else{var Tt=ut.node.originalX;ut.node.x0=Tt-ut.visibleWidth/2,ut.node.x1=Tt+ut.visibleWidth/2,rt(ut,q)}})}function G(X,Q,ut,J){return function(){for(var q=0,it=0;it0&&J.forceLayouts[Q].alpha(0)}}function rt(X,Q){for(var ut=[],J=[],q=0;q{var u=Ni(),d=Xr(),E=d.numberFormat,A=Qz(),t=hc(),e=Pi(),r=U5().cn,i=d._;function n(y){return y!==""}function o(y,S){return y.filter(function(k){return k.key===S.traceId})}function a(y,S){u.select(y).select("path").style("fill-opacity",S),u.select(y).select("rect").style("fill-opacity",S)}function s(y){u.select(y).select("text.name").style("fill","black")}function f(y){return function(S){return y.node.sourceLinks.indexOf(S.link)!==-1||y.node.targetLinks.indexOf(S.link)!==-1}}function v(y){return function(S){return S.node.sourceLinks.indexOf(y.link)!==-1||S.node.targetLinks.indexOf(y.link)!==-1}}function g(y,S,k){S&&k&&o(k,S).selectAll("."+r.sankeyLink).filter(f(S)).call(w.bind(0,S,k,!1))}function m(y,S,k){S&&k&&o(k,S).selectAll("."+r.sankeyLink).filter(f(S)).call(l.bind(0,S,k,!1))}function w(y,S,k,M){M.style("fill",function(T){if(!T.link.concentrationscale)return T.tinyColorHoverHue}).style("fill-opacity",function(T){if(!T.link.concentrationscale)return T.tinyColorHoverAlpha}),M.each(function(T){var c=T.link.label;c!==""&&o(S,y).selectAll("."+r.sankeyLink).filter(function(h){return h.link.label===c}).style("fill",function(h){if(!h.link.concentrationscale)return h.tinyColorHoverHue}).style("fill-opacity",function(h){if(!h.link.concentrationscale)return h.tinyColorHoverAlpha})}),k&&o(S,y).selectAll("."+r.sankeyNode).filter(v(y)).call(g)}function l(y,S,k,M){M.style("fill",function(T){return T.tinyColorHue}).style("fill-opacity",function(T){return T.tinyColorAlpha}),M.each(function(T){var c=T.link.label;c!==""&&o(S,y).selectAll("."+r.sankeyLink).filter(function(h){return h.link.label===c}).style("fill",function(h){return h.tinyColorHue}).style("fill-opacity",function(h){return h.tinyColorAlpha})}),k&&o(S,y).selectAll(r.sankeyNode).filter(v(y)).call(m)}function x(y,S){var k=y.hoverlabel||{},M=d.nestedProperty(k,S).get();return Array.isArray(M)?!1:M}V.exports=function(y,S){for(var k=y._fullLayout,M=k._paper,T=k._size,c=0;c"),color:x(et,"bgcolor")||e.addOpacity(ut.color,1),borderColor:x(et,"bordercolor"),fontFamily:x(et,"font.family"),fontSize:x(et,"font.size"),fontColor:x(et,"font.color"),fontWeight:x(et,"font.weight"),fontStyle:x(et,"font.style"),fontVariant:x(et,"font.variant"),fontTextcase:x(et,"font.textcase"),fontLineposition:x(et,"font.lineposition"),fontShadow:x(et,"font.shadow"),nameLength:x(et,"namelength"),textAlign:x(et,"align"),idealAlign:u.event.x"),color:x(et,"bgcolor")||st.tinyColorHue,borderColor:x(et,"bordercolor"),fontFamily:x(et,"font.family"),fontSize:x(et,"font.size"),fontColor:x(et,"font.color"),fontWeight:x(et,"font.weight"),fontStyle:x(et,"font.style"),fontVariant:x(et,"font.variant"),fontTextcase:x(et,"font.textcase"),fontLineposition:x(et,"font.lineposition"),fontShadow:x(et,"font.shadow"),nameLength:x(et,"namelength"),textAlign:x(et,"align"),idealAlign:"left",hovertemplate:et.hovertemplate,hovertemplateLabels:q,eventData:[st.node]},{container:k._hoverlayer.node(),outerContainer:k._paper.node(),gd:y});a(dt,.85),s(dt)}}},rt=function(ct,st,et){y._fullLayout.hovermode!==!1&&(u.select(ct).call(m,st,et),st.node.trace.node.hoverinfo!=="skip"&&(st.node.fullData=st.node.trace,y.emit("plotly_unhover",{event:u.event,points:[st.node]})),t.loneUnhover(k._hoverlayer.node()))};A(y,M,S,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{linkEvents:{hover:_,follow:I,unhover:F,select:b},nodeEvents:{hover:N,follow:G,unhover:rt,select:j}})}}),tL=Vt(K=>{var V=Cu().overrideAll,u=Pf().getModuleCalcData,d=V5(),E=xd(),A=$h(),t=oh(),e=Sc().prepSelect,r=Xr(),i=ji(),n="sankey";K.name=n,K.baseLayoutAttrOverrides=V({hoverlabel:E.hoverlabel},"plot","nested"),K.plot=function(a){var s=u(a.calcdata,n)[0];d(a,s),K.updateFx(a)},K.clean=function(a,s,f,v){var g=v._has&&v._has(n),m=s._has&&s._has(n);g&&!m&&(v._paperdiv.selectAll(".sankey").remove(),v._paperdiv.selectAll(".bgsankey").remove())},K.updateFx=function(a){for(var s=0;s{V.exports=function(u,d){for(var E=u.cd,A=[],t=E[0].trace,e=t._sankey.graph.nodes,r=0;r{V.exports={attributes:R5(),supplyDefaults:Hz(),calc:qz(),plot:V5(),moduleType:"trace",name:"sankey",basePlotModule:tL(),selectPoints:eL(),categories:["noOpacity"],meta:{}}}),nL=Vt((K,V)=>{V.exports=rL()}),aL=Vt(K=>{var V=Uu();K.name="indicator",K.plot=function(u,d,E,A){V.plotBasePlot(K.name,u,d,E,A)},K.clean=function(u,d,E,A){V.cleanBasePlot(K.name,u,d,E,A)}}),H5=Vt((K,V)=>{var u=So().extendFlat,d=So().extendDeep,E=Cu().overrideAll,A=yu(),t=af(),e=Vu().attributes,r=Of(),i=cl().templatedArray,n=Pm(),o=fc().descriptionOnlyNumbers,a=A({editType:"plot",colorEditType:"plot"}),s={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:t.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},f={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},v=i("step",d({},s,{range:f}));V.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:e({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:u({},a,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:o("value")},font:u({},a,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:o("value")},increasing:{symbol:{valType:"string",dflt:n.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:n.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:u({},a,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:d({},s,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:t.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:E({range:f,visible:u({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:u({},r.ticks,{dflt:"outside"}),ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:A({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,editType:"plot"},"plot"),steps:v,threshold:{line:{color:u({},s.line.color,{}),width:u({},s.line.width,{dflt:1}),editType:"plot"},thickness:u({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),q5=Vt((K,V)=>{V.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),iL=Vt((K,V)=>{var u=Xr(),d=H5(),E=Vu().defaults,A=cl(),t=Gf(),e=q5(),r=s0(),i=_m(),n=kd(),o=Ad();function a(f,v,g,m){function w(F,j){return u.coerce(f,v,d,F,j)}E(v,m,w),w("mode"),v._hasNumber=v.mode.indexOf("number")!==-1,v._hasDelta=v.mode.indexOf("delta")!==-1,v._hasGauge=v.mode.indexOf("gauge")!==-1;var l=w("value");v._range=[0,typeof l=="number"?1.5*l:1];var x=new Array(2),y;if(v._hasNumber){w("number.valueformat");var S=u.extendFlat({},m.font);S.size=void 0,u.coerceFont(w,"number.font",S),v.number.font.size===void 0&&(v.number.font.size=e.defaultNumberFontSize,x[0]=!0),w("number.prefix"),w("number.suffix"),y=v.number.font.size}var k;if(v._hasDelta){var M=u.extendFlat({},m.font);M.size=void 0,u.coerceFont(w,"delta.font",M),v.delta.font.size===void 0&&(v.delta.font.size=(v._hasNumber?.5:1)*(y||e.defaultNumberFontSize),x[1]=!0),w("delta.reference",v.value),w("delta.relative"),w("delta.valueformat",v.delta.relative?"2%":""),w("delta.increasing.symbol"),w("delta.increasing.color"),w("delta.decreasing.symbol"),w("delta.decreasing.color"),w("delta.position"),w("delta.prefix"),w("delta.suffix"),k=v.delta.font.size}v._scaleNumbers=(!v._hasNumber||x[0])&&(!v._hasDelta||x[1])||!1;var T=u.extendFlat({},m.font);T.size=.25*(y||k||e.defaultNumberFontSize),u.coerceFont(w,"title.font",T),w("title.text");var c,h,b,_;function P(F,j){return u.coerce(c,h,d.gauge,F,j)}function z(F,j){return u.coerce(b,_,d.gauge.axis,F,j)}if(v._hasGauge){c=f.gauge,c||(c={}),h=A.newContainer(v,"gauge"),P("shape");var D=v._isBullet=v.gauge.shape==="bullet";D||w("title.align","center");var B=v._isAngular=v.gauge.shape==="angular";B||w("align","center"),P("bgcolor",m.paper_bgcolor),P("borderwidth"),P("bordercolor"),P("bar.color"),P("bar.line.color"),P("bar.line.width");var R=e.valueThickness*(v.gauge.shape==="bullet"?.5:1);P("bar.thickness",R),t(c,h,{name:"steps",handleItemDefaults:s}),P("threshold.value"),P("threshold.thickness"),P("threshold.line.width"),P("threshold.line.color"),b={},c&&(b=c.axis||{}),_=A.newContainer(h,"axis"),z("visible"),v._range=z("range",v._range);var I={font:m.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(b,_,z,"linear"),o(b,_,z,"linear",I),n(b,_,z,"linear",I),i(b,_,z,I)}else w("title.align","center"),w("align","center"),v._isAngular=v._isBullet=!1;v._length=null}function s(f,v){function g(m,w){return u.coerce(f,v,d.gauge.steps,m,w)}g("color"),g("line.color"),g("line.width"),g("range"),g("thickness")}V.exports={supplyDefaults:a}}),oL=Vt((K,V)=>{function u(d,E){var A=[],t=E.value;typeof E._lastValue!="number"&&(E._lastValue=E.value);var e=E._lastValue,r=e;return E._hasDelta&&typeof E.delta.reference=="number"&&(r=E.delta.reference),A[0]={y:t,lastY:e,delta:t-r,relativeDelta:(t-r)/r},A}V.exports={calc:u}}),sL=Vt((K,V)=>{var u=Ni(),d=(M0(),yd(Bd)).interpolate,E=(M0(),yd(Bd)).interpolateNumber,A=Xr(),t=A.strScale,e=A.strTranslate,r=A.rad2deg,i=gf().MID_SHIFT,n=Eo(),o=q5(),a=Dl(),s=yo(),f=qg(),v=r1(),g=Of(),m=Pi(),w={left:"start",center:"middle",right:"end"},l={left:0,center:.5,right:1},x=/[yzafpnµmkMGTPEZY]/;function y(D){return D&&D.duration>0}V.exports=function(D,B,R,I){var F=D._fullLayout,j;y(R)&&I&&(j=I()),A.makeTraceGroups(F._indicatorlayer,B,"trace").each(function(N){var G=N[0],rt=G.trace,ct=u.select(this),st=rt._hasGauge,et=rt._isAngular,Z=rt._isBullet,ot=rt.domain,X={w:F._size.w*(ot.x[1]-ot.x[0]),h:F._size.h*(ot.y[1]-ot.y[0]),l:F._size.l+F._size.w*ot.x[0],r:F._size.r+F._size.w*(1-ot.x[1]),t:F._size.t+F._size.h*(1-ot.y[1]),b:F._size.b+F._size.h*ot.y[0]},Q=X.l+X.w/2,ut=X.t+X.h/2,J=Math.min(X.w/2,X.h),q=o.innerRadius*J,it,nt,dt,Tt=rt.align||"center";if(nt=ut,!st)it=X.l+l[Tt]*X.w,dt=function(bt){return b(bt,X.w,X.h)};else if(et&&(it=Q,nt=ut+J/2,dt=function(bt){return _(bt,.9*q)}),Z){var wt=o.bulletPadding,Ct=1-o.bulletNumberDomainSize+wt;it=X.l+(Ct+(1-Ct)*l[Tt])*X.w,dt=function(bt){return b(bt,(o.bulletNumberDomainSize-wt)*X.w,X.h)}}M(D,ct,N,{numbersX:it,numbersY:nt,numbersScaler:dt,transitionOpts:R,onComplete:j});var It,Nt;st&&(It={range:rt.gauge.axis.range,color:rt.gauge.bgcolor,line:{color:rt.gauge.bordercolor,width:0},thickness:1},Nt={range:rt.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:rt.gauge.bordercolor,width:rt.gauge.borderwidth},thickness:1});var te=ct.selectAll("g.angular").data(et?N:[]);te.exit().remove();var Jt=ct.selectAll("g.angularaxis").data(et?N:[]);Jt.exit().remove(),et&&k(D,ct,N,{radius:J,innerRadius:q,gauge:te,layer:Jt,size:X,gaugeBg:It,gaugeOutline:Nt,transitionOpts:R,onComplete:j});var ee=ct.selectAll("g.bullet").data(Z?N:[]);ee.exit().remove();var Zt=ct.selectAll("g.bulletaxis").data(Z?N:[]);Zt.exit().remove(),Z&&S(D,ct,N,{gauge:ee,layer:Zt,size:X,gaugeBg:It,gaugeOutline:Nt,transitionOpts:R,onComplete:j});var mt=ct.selectAll("text.title").data(N);mt.exit().remove(),mt.enter().append("text").classed("title",!0),mt.attr("text-anchor",function(){return Z?w.right:w[rt.title.align]}).text(rt.title.text).call(n.font,rt.title.font).call(a.convertToTspans,D),mt.attr("transform",function(){var bt=X.l+X.w*l[rt.title.align],vt,Ut=o.titlePadding,re=n.bBox(mt.node());if(st){if(et)if(rt.gauge.axis.visible){var Kt=n.bBox(Jt.node());vt=Kt.top-Ut-re.bottom}else vt=X.t+X.h/2-J/2-re.bottom-Ut;Z&&(vt=nt-(re.top+re.bottom)/2,bt=X.l-o.bulletPadding*X.w)}else vt=rt._numbersTop-Ut-re.bottom;return e(bt,vt)})})};function S(D,B,R,I){var F=R[0].trace,j=I.gauge,N=I.layer,G=I.gaugeBg,rt=I.gaugeOutline,ct=I.size,st=F.domain,et=I.transitionOpts,Z=I.onComplete,ot,X,Q,ut,J;j.enter().append("g").classed("bullet",!0),j.attr("transform",e(ct.l,ct.t)),N.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),N.selectAll("g.xbulletaxistick,path,text").remove();var q=ct.h,it=F.gauge.bar.thickness*q,nt=st.x[0],dt=st.x[0]+(st.x[1]-st.x[0])*(F._hasNumber||F._hasDelta?1-o.bulletNumberDomainSize:1);ot=h(D,F.gauge.axis),ot._id="xbulletaxis",ot.domain=[nt,dt],ot.setScale(),X=s.calcTicks(ot),Q=s.makeTransTickFn(ot),ut=s.getTickSigns(ot)[2],J=ct.t+ct.h,ot.visible&&(s.drawTicks(D,ot,{vals:ot.ticks==="inside"?s.clipEnds(ot,X):X,layer:N,path:s.makeTickPath(ot,J,ut),transFn:Q}),s.drawLabels(D,ot,{vals:X,layer:N,transFn:Q,labelFns:s.makeLabelFns(ot,J)}));function Tt(ee){ee.attr("width",function(Zt){return Math.max(0,ot.c2p(Zt.range[1])-ot.c2p(Zt.range[0]))}).attr("x",function(Zt){return ot.c2p(Zt.range[0])}).attr("y",function(Zt){return .5*(1-Zt.thickness)*q}).attr("height",function(Zt){return Zt.thickness*q})}var wt=[G].concat(F.gauge.steps),Ct=j.selectAll("g.bg-bullet").data(wt);Ct.enter().append("g").classed("bg-bullet",!0).append("rect"),Ct.select("rect").call(Tt).call(T),Ct.exit().remove();var It=j.selectAll("g.value-bullet").data([F.gauge.bar]);It.enter().append("g").classed("value-bullet",!0).append("rect"),It.select("rect").attr("height",it).attr("y",(q-it)/2).call(T),y(et)?It.select("rect").transition().duration(et.duration).ease(et.easing).each("end",function(){Z&&Z()}).each("interrupt",function(){Z&&Z()}).attr("width",Math.max(0,ot.c2p(Math.min(F.gauge.axis.range[1],R[0].y)))):It.select("rect").attr("width",typeof R[0].y=="number"?Math.max(0,ot.c2p(Math.min(F.gauge.axis.range[1],R[0].y))):0),It.exit().remove();var Nt=R.filter(function(){return F.gauge.threshold.value||F.gauge.threshold.value===0}),te=j.selectAll("g.threshold-bullet").data(Nt);te.enter().append("g").classed("threshold-bullet",!0).append("line"),te.select("line").attr("x1",ot.c2p(F.gauge.threshold.value)).attr("x2",ot.c2p(F.gauge.threshold.value)).attr("y1",(1-F.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-F.gauge.threshold.thickness)/2)*q).call(m.stroke,F.gauge.threshold.line.color).style("stroke-width",F.gauge.threshold.line.width),te.exit().remove();var Jt=j.selectAll("g.gauge-outline").data([rt]);Jt.enter().append("g").classed("gauge-outline",!0).append("rect"),Jt.select("rect").call(Tt).call(T),Jt.exit().remove()}function k(D,B,R,I){var F=R[0].trace,j=I.size,N=I.radius,G=I.innerRadius,rt=I.gaugeBg,ct=I.gaugeOutline,st=[j.l+j.w/2,j.t+j.h/2+N/2],et=I.gauge,Z=I.layer,ot=I.transitionOpts,X=I.onComplete,Q=Math.PI/2;function ut(Me){var Ce=F.gauge.axis.range[0],We=F.gauge.axis.range[1],qe=(Me-Ce)/(We-Ce)*Math.PI-Q;return qe<-Q?-Q:qe>Q?Q:qe}function J(Me){return u.svg.arc().innerRadius((G+N)/2-Me/2*(N-G)).outerRadius((G+N)/2+Me/2*(N-G)).startAngle(-Q)}function q(Me){Me.attr("d",function(Ce){return J(Ce.thickness).startAngle(ut(Ce.range[0])).endAngle(ut(Ce.range[1]))()})}var it,nt,dt,Tt;et.enter().append("g").classed("angular",!0),et.attr("transform",e(st[0],st[1])),Z.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),Z.selectAll("g.xangularaxistick,path,text").remove(),it=h(D,F.gauge.axis),it.type="linear",it.range=F.gauge.axis.range,it._id="xangularaxis",it.ticklabeloverflow="allow",it.setScale();var wt=function(Me){return(it.range[0]-Me.x)/(it.range[1]-it.range[0])*Math.PI+Math.PI},Ct={},It=s.makeLabelFns(it,0),Nt=It.labelStandoff;Ct.xFn=function(Me){var Ce=wt(Me);return Math.cos(Ce)*Nt},Ct.yFn=function(Me){var Ce=wt(Me),We=Math.sin(Ce)>0?.2:1;return-Math.sin(Ce)*(Nt+Me.fontSize*We)+Math.abs(Math.cos(Ce))*(Me.fontSize*i)},Ct.anchorFn=function(Me){var Ce=wt(Me),We=Math.cos(Ce);return Math.abs(We)<.1?"middle":We>0?"start":"end"},Ct.heightFn=function(Me,Ce,We){var qe=wt(Me);return-.5*(1+Math.sin(qe))*We};var te=function(Me){return e(st[0]+N*Math.cos(Me),st[1]-N*Math.sin(Me))};dt=function(Me){return te(wt(Me))};var Jt=function(Me){var Ce=wt(Me);return te(Ce)+"rotate("+-r(Ce)+")"};if(nt=s.calcTicks(it),Tt=s.getTickSigns(it)[2],it.visible){Tt=it.ticks==="inside"?-1:1;var ee=(it.linewidth||1)/2;s.drawTicks(D,it,{vals:nt,layer:Z,path:"M"+Tt*ee+",0h"+Tt*it.ticklen,transFn:Jt}),s.drawLabels(D,it,{vals:nt,layer:Z,transFn:dt,labelFns:Ct})}var Zt=[rt].concat(F.gauge.steps),mt=et.selectAll("g.bg-arc").data(Zt);mt.enter().append("g").classed("bg-arc",!0).append("path"),mt.select("path").call(q).call(T),mt.exit().remove();var bt=J(F.gauge.bar.thickness),vt=et.selectAll("g.value-arc").data([F.gauge.bar]);vt.enter().append("g").classed("value-arc",!0).append("path");var Ut=vt.select("path");y(ot)?(Ut.transition().duration(ot.duration).ease(ot.easing).each("end",function(){X&&X()}).each("interrupt",function(){X&&X()}).attrTween("d",c(bt,ut(R[0].lastY),ut(R[0].y))),F._lastValue=R[0].y):Ut.attr("d",typeof R[0].y=="number"?bt.endAngle(ut(R[0].y)):"M0,0Z"),Ut.call(T),vt.exit().remove(),Zt=[];var re=F.gauge.threshold.value;(re||re===0)&&Zt.push({range:[re,re],color:F.gauge.threshold.color,line:{color:F.gauge.threshold.line.color,width:F.gauge.threshold.line.width},thickness:F.gauge.threshold.thickness});var Kt=et.selectAll("g.threshold-arc").data(Zt);Kt.enter().append("g").classed("threshold-arc",!0).append("path"),Kt.select("path").call(q).call(T),Kt.exit().remove();var ue=et.selectAll("g.gauge-outline").data([ct]);ue.enter().append("g").classed("gauge-outline",!0).append("path"),ue.select("path").call(q).call(T),ue.exit().remove()}function M(D,B,R,I){var F=R[0].trace,j=I.numbersX,N=I.numbersY,G=F.align||"center",rt=w[G],ct=I.transitionOpts,st=I.onComplete,et=A.ensureSingle(B,"g","numbers"),Z,ot,X,Q=[];F._hasNumber&&Q.push("number"),F._hasDelta&&(Q.push("delta"),F.delta.position==="left"&&Q.reverse());var ut=et.selectAll("text").data(Q);ut.enter().append("text"),ut.attr("text-anchor",function(){return rt}).attr("class",function(te){return te}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ut.exit().remove();function J(te,Jt,ee,Zt){if(te.match("s")&&ee>=0!=Zt>=0&&!Jt(ee).slice(-1).match(x)&&!Jt(Zt).slice(-1).match(x)){var mt=te.slice().replace("s","f").replace(/\d+/,function(vt){return parseInt(vt)-1}),bt=h(D,{tickformat:mt});return function(vt){return Math.abs(vt)<1?s.tickText(bt,vt).text:Jt(vt)}}else return Jt}function q(){var te=h(D,{tickformat:F.number.valueformat},F._range);te.setScale(),s.prepTicks(te);var Jt=function(vt){return s.tickText(te,vt).text},ee=F.number.suffix,Zt=F.number.prefix,mt=et.select("text.number");function bt(){var vt=typeof R[0].y=="number"?Zt+Jt(R[0].y)+ee:"-";mt.text(vt).call(n.font,F.number.font).call(a.convertToTspans,D)}return y(ct)?mt.transition().duration(ct.duration).ease(ct.easing).each("end",function(){bt(),st&&st()}).each("interrupt",function(){bt(),st&&st()}).attrTween("text",function(){var vt=u.select(this),Ut=E(R[0].lastY,R[0].y);F._lastValue=R[0].y;var re=J(F.number.valueformat,Jt,R[0].lastY,R[0].y);return function(Kt){vt.text(Zt+re(Ut(Kt))+ee)}}):bt(),Z=P(Zt+Jt(R[0].y)+ee,F.number.font,rt,D),mt}function it(){var te=h(D,{tickformat:F.delta.valueformat},F._range);te.setScale(),s.prepTicks(te);var Jt=function(Kt){return s.tickText(te,Kt).text},ee=F.delta.suffix,Zt=F.delta.prefix,mt=function(Kt){var ue=F.delta.relative?Kt.relativeDelta:Kt.delta;return ue},bt=function(Kt,ue){return Kt===0||typeof Kt!="number"||isNaN(Kt)?"-":(Kt>0?F.delta.increasing.symbol:F.delta.decreasing.symbol)+Zt+ue(Kt)+ee},vt=function(Kt){return Kt.delta>=0?F.delta.increasing.color:F.delta.decreasing.color};F._deltaLastValue===void 0&&(F._deltaLastValue=mt(R[0]));var Ut=et.select("text.delta");Ut.call(n.font,F.delta.font).call(m.fill,vt({delta:F._deltaLastValue}));function re(){Ut.text(bt(mt(R[0]),Jt)).call(m.fill,vt(R[0])).call(a.convertToTspans,D)}return y(ct)?Ut.transition().duration(ct.duration).ease(ct.easing).tween("text",function(){var Kt=u.select(this),ue=mt(R[0]),Me=F._deltaLastValue,Ce=J(F.delta.valueformat,Jt,Me,ue),We=E(Me,ue);return F._deltaLastValue=ue,function(qe){Kt.text(bt(We(qe),Ce)),Kt.call(m.fill,vt({delta:We(qe)}))}}).each("end",function(){re(),st&&st()}).each("interrupt",function(){re(),st&&st()}):re(),ot=P(bt(mt(R[0]),Jt),F.delta.font,rt,D),Ut}var nt=F.mode+F.align,dt;if(F._hasDelta&&(dt=it(),nt+=F.delta.position+F.delta.font.size+F.delta.font.family+F.delta.valueformat,nt+=F.delta.increasing.symbol+F.delta.decreasing.symbol,X=ot),F._hasNumber&&(q(),nt+=F.number.font.size+F.number.font.family+F.number.valueformat+F.number.suffix+F.number.prefix,X=Z),F._hasDelta&&F._hasNumber){var Tt=[(Z.left+Z.right)/2,(Z.top+Z.bottom)/2],wt=[(ot.left+ot.right)/2,(ot.top+ot.bottom)/2],Ct,It,Nt=.75*F.delta.font.size;F.delta.position==="left"&&(Ct=z(F,"deltaPos",0,-1*(Z.width*l[F.align]+ot.width*(1-l[F.align])+Nt),nt,Math.min),It=Tt[1]-wt[1],X={width:Z.width+ot.width+Nt,height:Math.max(Z.height,ot.height),left:ot.left+Ct,right:Z.right,top:Math.min(Z.top,ot.top+It),bottom:Math.max(Z.bottom,ot.bottom+It)}),F.delta.position==="right"&&(Ct=z(F,"deltaPos",0,Z.width*(1-l[F.align])+ot.width*l[F.align]+Nt,nt,Math.max),It=Tt[1]-wt[1],X={width:Z.width+ot.width+Nt,height:Math.max(Z.height,ot.height),left:Z.left,right:ot.right+Ct,top:Math.min(Z.top,ot.top+It),bottom:Math.max(Z.bottom,ot.bottom+It)}),F.delta.position==="bottom"&&(Ct=null,It=ot.height,X={width:Math.max(Z.width,ot.width),height:Z.height+ot.height,left:Math.min(Z.left,ot.left),right:Math.max(Z.right,ot.right),top:Z.bottom-Z.height,bottom:Z.bottom+ot.height}),F.delta.position==="top"&&(Ct=null,It=Z.top,X={width:Math.max(Z.width,ot.width),height:Z.height+ot.height,left:Math.min(Z.left,ot.left),right:Math.max(Z.right,ot.right),top:Z.bottom-Z.height-ot.height,bottom:Z.bottom}),dt.attr({dx:Ct,dy:It})}(F._hasNumber||F._hasDelta)&&et.attr("transform",function(){var te=I.numbersScaler(X);nt+=te[2];var Jt=z(F,"numbersScale",1,te[0],nt,Math.min),ee;F._scaleNumbers||(Jt=1),F._isAngular?ee=N-Jt*X.bottom:ee=N-Jt*(X.top+X.bottom)/2,F._numbersTop=Jt*X.top+ee;var Zt=X[G];G==="center"&&(Zt=(X.left+X.right)/2);var mt=j-Jt*Zt;return mt=z(F,"numbersTranslate",0,mt,nt,Math.max),e(mt,ee)+t(Jt)})}function T(D){D.each(function(B){m.stroke(u.select(this),B.line.color)}).each(function(B){m.fill(u.select(this),B.color)}).style("stroke-width",function(B){return B.line.width})}function c(D,B,R){return function(){var I=d(B,R);return function(F){return D.endAngle(I(F))()}}}function h(D,B,R){var I=D._fullLayout,F=A.extendFlat({type:"linear",ticks:"outside",range:R,showline:!0},B),j={type:"linear",_id:"x"+B._id},N={letter:"x",font:I.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function G(rt,ct){return A.coerce(F,j,g,rt,ct)}return f(F,j,G,N,I),v(F,j,G,N),j}function b(D,B,R){var I=Math.min(B/D.width,R/D.height);return[I,D,B+"x"+R]}function _(D,B){var R=Math.sqrt(D.width/2*(D.width/2)+D.height*D.height),I=B/R;return[I,D,B]}function P(D,B,R,I){var F=document.createElementNS("http://www.w3.org/2000/svg","text"),j=u.select(F);return j.text(D).attr("x",0).attr("y",0).attr("text-anchor",R).attr("data-unformatted",D).call(a.convertToTspans,I).call(n.font,B),n.bBox(j.node())}function z(D,B,R,I,F,j){var N="_cache"+B;D[N]&&D[N].key===F||(D[N]={key:F,value:R});var G=A.aggNums(j,null,[D[N].value,I],2);return D[N].value=G,G}}),lL=Vt((K,V)=>{V.exports={moduleType:"trace",name:"indicator",basePlotModule:aL(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:H5(),supplyDefaults:iL().supplyDefaults,calc:oL().calc,plot:sL(),meta:{}}}),uL=Vt((K,V)=>{V.exports=lL()}),W5=Vt((K,V)=>{var u=c0(),d=So().extendFlat,E=Cu().overrideAll,A=yu(),t=Vu().attributes,e=fc().descriptionOnlyNumbers;V.exports=E({domain:t({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:d({},u.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:d({},A({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:d({},u.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:d({},A({arrayOk:!0}))}},"calc","from-root")}),cL=Vt((K,V)=>{var u=Xr(),d=W5(),E=Vu().defaults;function A(t,e){for(var r=t.columnorder||[],i=t.header.values.length,n=r.slice(0,i),o=n.slice().sort(function(f,v){return f-v}),a=n.map(function(f){return o.indexOf(f)}),s=a.length;s{var u=bp().wrap;V.exports=function(){return u({})}}),G5=Vt((K,V)=>{V.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
                ",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),hL=Vt((K,V)=>{var u=G5(),d=So().extendFlat,E=Lo(),A=nh().isTypedArray,t=nh().isArrayOrTypedArray;V.exports=function(v,g){var m=i(g.cells.values),w=function(G){return G.slice(g.header.values.length,G.length)},l=i(g.header.values);l.length&&!l[0].length&&(l[0]=[""],l=i(l));var x=l.concat(w(m).map(function(){return n((l[0]||[""]).length)})),y=g.domain,S=Math.floor(v._fullLayout._size.w*(y.x[1]-y.x[0])),k=Math.floor(v._fullLayout._size.h*(y.y[1]-y.y[0])),M=g.header.values.length?x[0].map(function(){return g.header.height}):[u.emptyHeaderHeight],T=m.length?m[0].map(function(){return g.cells.height}):[],c=M.reduce(r,0),h=k-c,b=h+u.uplift,_=s(T,b),P=s(M,c),z=a(P,[]),D=a(_,z),B={},R=g._fullInput.columnorder;t(R)&&(R=Array.from(R)),R=R.concat(w(m.map(function(G,rt){return rt})));var I=x.map(function(G,rt){var ct=t(g.columnwidth)?g.columnwidth[Math.min(rt,g.columnwidth.length-1)]:g.columnwidth;return E(ct)?Number(ct):1}),F=I.reduce(r,0);I=I.map(function(G){return G/F*S});var j=Math.max(e(g.header.line.width),e(g.cells.line.width)),N={key:g.uid+v._context.staticPlot,translateX:y.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-y.y[1]),size:v._fullLayout._size,width:S,maxLineWidth:j,height:k,columnOrder:R,groupHeight:k,rowBlocks:D,headerRowBlocks:z,scrollY:0,cells:d({},g.cells,{values:m}),headerCells:d({},g.header,{values:x}),gdColumns:x.map(function(G){return G[0]}),gdColumnsOriginalOrder:x.map(function(G){return G[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:x.map(function(G,rt){var ct=B[G];B[G]=(ct||0)+1;var st=G+"__"+B[G];return{key:st,label:G,specIndex:rt,xIndex:R[rt],xScale:o,x:void 0,calcdata:void 0,columnWidth:I[rt]}})};return N.columns.forEach(function(G){G.calcdata=N,G.x=o(G)}),N};function e(v){if(t(v)){for(var g=0,m=0;m=g||M===v.length-1)&&(m[l]=y,y.key=k++,y.firstRowIndex=S,y.lastRowIndex=M,y=f(),l+=x,S=M+1,x=0);return m}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),pL=Vt(K=>{var V=So().extendFlat;K.splitToPanels=function(d){var E=[0,0],A=V({},d,{key:"header",type:"header",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!0,values:d.calcdata.headerCells.values[d.specIndex],rowBlocks:d.calcdata.headerRowBlocks,calcdata:V({},d.calcdata,{cells:d.calcdata.headerCells})}),t=V({},d,{key:"cells1",type:"cells",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),e=V({},d,{key:"cells2",type:"cells",page:1,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks});return[t,e,A]},K.splitToCells=function(d){var E=u(d);return(d.values||[]).slice(E[0],E[1]).map(function(A,t){var e=typeof A=="string"&&A.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:t+e,key:E[0]+t,column:d,calcdata:d.calcdata,page:d.page,rowBlocks:d.rowBlocks,value:A}})};function u(d){var E=d.rowBlocks[d.page],A=E?E.rows[0].rowIndex:0,t=E?A+E.rows.length:0;return[A,t]}}),Z5=Vt((K,V)=>{var u=G5(),d=Ni(),E=Xr(),A=E.numberFormat,t=bp(),e=Eo(),r=Dl(),i=Xr().raiseToTop,n=Xr().strTranslate,o=Xr().cancelTransition,a=hL(),s=pL(),f=Pi();V.exports=function(it,nt){var dt=!it._context.staticPlot,Tt=it._fullLayout._paper.selectAll("."+u.cn.table).data(nt.map(function(Kt){var ue=t.unwrap(Kt),Me=ue.trace;return a(it,Me)}),t.keyFun);Tt.exit().remove(),Tt.enter().append("g").classed(u.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Tt.attr("width",function(Kt){return Kt.width+Kt.size.l+Kt.size.r}).attr("height",function(Kt){return Kt.height+Kt.size.t+Kt.size.b}).attr("transform",function(Kt){return n(Kt.translateX,Kt.translateY)});var wt=Tt.selectAll("."+u.cn.tableControlView).data(t.repeat,t.keyFun),Ct=wt.enter().append("g").classed(u.cn.tableControlView,!0).style("box-sizing","content-box");if(dt){var It="onwheel"in document?"wheel":"mousewheel";Ct.on("mousemove",function(Kt){wt.filter(function(ue){return Kt===ue}).call(l,it)}).on(It,function(Kt){if(!Kt.scrollbarState.wheeling){Kt.scrollbarState.wheeling=!0;var ue=Kt.scrollY+d.event.deltaY,Me=rt(it,wt,null,ue)(Kt);Me||(d.event.stopPropagation(),d.event.preventDefault()),Kt.scrollbarState.wheeling=!1}}).call(l,it,!0)}wt.attr("transform",function(Kt){return n(Kt.size.l,Kt.size.t)});var Nt=wt.selectAll("."+u.cn.scrollBackground).data(t.repeat,t.keyFun);Nt.enter().append("rect").classed(u.cn.scrollBackground,!0).attr("fill","none"),Nt.attr("width",function(Kt){return Kt.width}).attr("height",function(Kt){return Kt.height}),wt.each(function(Kt){e.setClipUrl(d.select(this),g(it,Kt),it)});var te=wt.selectAll("."+u.cn.yColumn).data(function(Kt){return Kt.columns},t.keyFun);te.enter().append("g").classed(u.cn.yColumn,!0),te.exit().remove(),te.attr("transform",function(Kt){return n(Kt.x,0)}),dt&&te.call(d.behavior.drag().origin(function(Kt){var ue=d.select(this);return R(ue,Kt,-u.uplift),i(this),Kt.calcdata.columnDragInProgress=!0,l(wt.filter(function(Me){return Kt.calcdata.key===Me.key}),it),Kt}).on("drag",function(Kt){var ue=d.select(this),Me=function(qe){return(Kt===qe?d.event.x:qe.x)+qe.columnWidth/2};Kt.x=Math.max(-u.overdrag,Math.min(Kt.calcdata.width+u.overdrag-Kt.columnWidth,d.event.x));var Ce=w(te).filter(function(qe){return qe.calcdata.key===Kt.calcdata.key}),We=Ce.sort(function(qe,vr){return Me(qe)-Me(vr)});We.forEach(function(qe,vr){qe.xIndex=vr,qe.x=Kt===qe?qe.x:qe.xScale(qe)}),te.filter(function(qe){return Kt!==qe}).transition().ease(u.transitionEase).duration(u.transitionDuration).attr("transform",function(qe){return n(qe.x,0)}),ue.call(o).attr("transform",n(Kt.x,-u.uplift))}).on("dragend",function(Kt){var ue=d.select(this),Me=Kt.calcdata;Kt.x=Kt.xScale(Kt),Kt.calcdata.columnDragInProgress=!1,R(ue,Kt,0),D(it,Me,Me.columns.map(function(Ce){return Ce.xIndex}))})),te.each(function(Kt){e.setClipUrl(d.select(this),m(it,Kt),it)});var Jt=te.selectAll("."+u.cn.columnBlock).data(s.splitToPanels,t.keyFun);Jt.enter().append("g").classed(u.cn.columnBlock,!0).attr("id",function(Kt){return Kt.key}),Jt.style("cursor",function(Kt){return Kt.dragHandle?"ew-resize":Kt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ee=Jt.filter(F),Zt=Jt.filter(I);dt&&Zt.call(d.behavior.drag().origin(function(Kt){return d.event.stopPropagation(),Kt}).on("drag",rt(it,wt,-1)).on("dragend",function(){})),x(it,wt,ee,Jt),x(it,wt,Zt,Jt);var mt=wt.selectAll("."+u.cn.scrollAreaClip).data(t.repeat,t.keyFun);mt.enter().append("clipPath").classed(u.cn.scrollAreaClip,!0).attr("id",function(Kt){return g(it,Kt)});var bt=mt.selectAll("."+u.cn.scrollAreaClipRect).data(t.repeat,t.keyFun);bt.enter().append("rect").classed(u.cn.scrollAreaClipRect,!0).attr("x",-u.overdrag).attr("y",-u.uplift).attr("fill","none"),bt.attr("width",function(Kt){return Kt.width+2*u.overdrag}).attr("height",function(Kt){return Kt.height+u.uplift});var vt=te.selectAll("."+u.cn.columnBoundary).data(t.repeat,t.keyFun);vt.enter().append("g").classed(u.cn.columnBoundary,!0);var Ut=te.selectAll("."+u.cn.columnBoundaryClippath).data(t.repeat,t.keyFun);Ut.enter().append("clipPath").classed(u.cn.columnBoundaryClippath,!0),Ut.attr("id",function(Kt){return m(it,Kt)});var re=Ut.selectAll("."+u.cn.columnBoundaryRect).data(t.repeat,t.keyFun);re.enter().append("rect").classed(u.cn.columnBoundaryRect,!0).attr("fill","none"),re.attr("width",function(Kt){return Kt.columnWidth+2*v(Kt)}).attr("height",function(Kt){return Kt.calcdata.height+2*v(Kt)+u.uplift}).attr("x",function(Kt){return-v(Kt)}).attr("y",function(Kt){return-v(Kt)}),G(null,Zt,wt)};function v(it){return Math.ceil(it.calcdata.maxLineWidth/2)}function g(it,nt){return"clip"+it._fullLayout._uid+"_scrollAreaBottomClip_"+nt.key}function m(it,nt){return"clip"+it._fullLayout._uid+"_columnBoundaryClippath_"+nt.calcdata.key+"_"+nt.specIndex}function w(it){return[].concat.apply([],it.map(function(nt){return nt})).map(function(nt){return nt.__data__})}function l(it,nt,dt){function Tt(Jt){var ee=Jt.rowBlocks;return X(ee,ee.length-1)+(ee.length?Q(ee[ee.length-1],1/0):1)}var wt=it.selectAll("."+u.cn.scrollbarKit).data(t.repeat,t.keyFun);wt.enter().append("g").classed(u.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),wt.each(function(Jt){var ee=Jt.scrollbarState;ee.totalHeight=Tt(Jt),ee.scrollableAreaHeight=Jt.groupHeight-j(Jt),ee.currentlyVisibleHeight=Math.min(ee.totalHeight,ee.scrollableAreaHeight),ee.ratio=ee.currentlyVisibleHeight/ee.totalHeight,ee.barLength=Math.max(ee.ratio*ee.currentlyVisibleHeight,u.goldenRatio*u.scrollbarWidth),ee.barWiggleRoom=ee.currentlyVisibleHeight-ee.barLength,ee.wiggleRoom=Math.max(0,ee.totalHeight-ee.scrollableAreaHeight),ee.topY=ee.barWiggleRoom===0?0:Jt.scrollY/ee.wiggleRoom*ee.barWiggleRoom,ee.bottomY=ee.topY+ee.barLength,ee.dragMultiplier=ee.wiggleRoom/ee.barWiggleRoom}).attr("transform",function(Jt){var ee=Jt.width+u.scrollbarWidth/2+u.scrollbarOffset;return n(ee,j(Jt))});var Ct=wt.selectAll("."+u.cn.scrollbar).data(t.repeat,t.keyFun);Ct.enter().append("g").classed(u.cn.scrollbar,!0);var It=Ct.selectAll("."+u.cn.scrollbarSlider).data(t.repeat,t.keyFun);It.enter().append("g").classed(u.cn.scrollbarSlider,!0),It.attr("transform",function(Jt){return n(0,Jt.scrollbarState.topY||0)});var Nt=It.selectAll("."+u.cn.scrollbarGlyph).data(t.repeat,t.keyFun);Nt.enter().append("line").classed(u.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",u.scrollbarWidth).attr("stroke-linecap","round").attr("y1",u.scrollbarWidth/2),Nt.attr("y2",function(Jt){return Jt.scrollbarState.barLength-u.scrollbarWidth/2}).attr("stroke-opacity",function(Jt){return Jt.columnDragInProgress||!Jt.scrollbarState.barWiggleRoom||dt?0:.4}),Nt.transition().delay(0).duration(0),Nt.transition().delay(u.scrollbarHideDelay).duration(u.scrollbarHideDuration).attr("stroke-opacity",0);var te=Ct.selectAll("."+u.cn.scrollbarCaptureZone).data(t.repeat,t.keyFun);te.enter().append("line").classed(u.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",u.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Jt){var ee=d.event.y,Zt=this.getBoundingClientRect(),mt=Jt.scrollbarState,bt=ee-Zt.top,vt=d.scale.linear().domain([0,mt.scrollableAreaHeight]).range([0,mt.totalHeight]).clamp(!0);mt.topY<=bt&&bt<=mt.bottomY||rt(nt,it,null,vt(bt-mt.barLength/2))(Jt)}).call(d.behavior.drag().origin(function(Jt){return d.event.stopPropagation(),Jt.scrollbarState.scrollbarScrollInProgress=!0,Jt}).on("drag",rt(nt,it)).on("dragend",function(){})),te.attr("y2",function(Jt){return Jt.scrollbarState.scrollableAreaHeight}),nt._context.staticPlot&&(Nt.remove(),te.remove())}function x(it,nt,dt,Tt){var wt=y(dt),Ct=S(wt);c(Ct);var It=k(Ct);b(It);var Nt=T(Ct),te=M(Nt);h(te),_(te,nt,Tt,it),ot(Ct)}function y(it){var nt=it.selectAll("."+u.cn.columnCells).data(t.repeat,t.keyFun);return nt.enter().append("g").classed(u.cn.columnCells,!0),nt.exit().remove(),nt}function S(it){var nt=it.selectAll("."+u.cn.columnCell).data(s.splitToCells,function(dt){return dt.keyWithinBlock});return nt.enter().append("g").classed(u.cn.columnCell,!0),nt.exit().remove(),nt}function k(it){var nt=it.selectAll("."+u.cn.cellRect).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("rect").classed(u.cn.cellRect,!0),nt}function M(it){var nt=it.selectAll("."+u.cn.cellText).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("text").classed(u.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){d.event.stopPropagation()}),nt}function T(it){var nt=it.selectAll("."+u.cn.cellTextHolder).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("g").classed(u.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),nt}function c(it){it.each(function(nt,dt){var Tt=nt.calcdata.cells.font,wt=nt.column.specIndex,Ct={size:B(Tt.size,wt,dt),color:B(Tt.color,wt,dt),family:B(Tt.family,wt,dt),weight:B(Tt.weight,wt,dt),style:B(Tt.style,wt,dt),variant:B(Tt.variant,wt,dt),textcase:B(Tt.textcase,wt,dt),lineposition:B(Tt.lineposition,wt,dt),shadow:B(Tt.shadow,wt,dt)};nt.rowNumber=nt.key,nt.align=B(nt.calcdata.cells.align,wt,dt),nt.cellBorderWidth=B(nt.calcdata.cells.line.width,wt,dt),nt.font=Ct})}function h(it){it.each(function(nt){e.font(d.select(this),nt.font)})}function b(it){it.attr("width",function(nt){return nt.column.columnWidth}).attr("stroke-width",function(nt){return nt.cellBorderWidth}).each(function(nt){var dt=d.select(this);f.stroke(dt,B(nt.calcdata.cells.line.color,nt.column.specIndex,nt.rowNumber)),f.fill(dt,B(nt.calcdata.cells.fill.color,nt.column.specIndex,nt.rowNumber))})}function _(it,nt,dt,Tt){it.text(function(wt){var Ct=wt.column.specIndex,It=wt.rowNumber,Nt=wt.value,te=typeof Nt=="string",Jt=te&&Nt.match(/
                /i),ee=!te||Jt;wt.mayHaveMarkup=te&&Nt.match(/[<&>]/);var Zt=P(Nt);wt.latex=Zt;var mt=Zt?"":B(wt.calcdata.cells.prefix,Ct,It)||"",bt=Zt?"":B(wt.calcdata.cells.suffix,Ct,It)||"",vt=Zt?null:B(wt.calcdata.cells.format,Ct,It)||null,Ut=mt+(vt?A(vt)(wt.value):wt.value)+bt,re;wt.wrappingNeeded=!wt.wrapped&&!ee&&!Zt&&(re=z(Ut)),wt.cellHeightMayIncrease=Jt||Zt||wt.mayHaveMarkup||(re===void 0?z(Ut):re),wt.needsConvertToTspans=wt.mayHaveMarkup||wt.wrappingNeeded||wt.latex;var Kt;if(wt.wrappingNeeded){var ue=u.wrapSplitCharacter===" "?Ut.replace(/wt&&Tt.push(Ct),wt+=te}return Tt}function G(it,nt,dt){var Tt=w(nt)[0];if(Tt!==void 0){var wt=Tt.rowBlocks,Ct=Tt.calcdata,It=X(wt,wt.length),Nt=Tt.calcdata.groupHeight-j(Tt),te=Ct.scrollY=Math.max(0,Math.min(It-Nt,Ct.scrollY)),Jt=N(wt,te,Nt);Jt.length===1&&(Jt[0]===wt.length-1?Jt.unshift(Jt[0]-1):Jt.push(Jt[0]+1)),Jt[0]%2&&Jt.reverse(),nt.each(function(ee,Zt){ee.page=Jt[Zt],ee.scrollY=te}),nt.attr("transform",function(ee){var Zt=X(ee.rowBlocks,ee.page)-ee.scrollY;return n(0,Zt)}),it&&(ct(it,dt,nt,Jt,Tt.prevPages,Tt,0),ct(it,dt,nt,Jt,Tt.prevPages,Tt,1),l(dt,it))}}function rt(it,nt,dt,Tt){return function(wt){var Ct=wt.calcdata?wt.calcdata:wt,It=nt.filter(function(ee){return Ct.key===ee.key}),Nt=dt||Ct.scrollbarState.dragMultiplier,te=Ct.scrollY;Ct.scrollY=Tt===void 0?Ct.scrollY+Nt*d.event.dy:Tt;var Jt=It.selectAll("."+u.cn.yColumn).selectAll("."+u.cn.columnBlock).filter(I);return G(it,Jt,It),Ct.scrollY===te}}function ct(it,nt,dt,Tt,wt,Ct,It){var Nt=Tt[It]!==wt[It];Nt&&(clearTimeout(Ct.currentRepaint[It]),Ct.currentRepaint[It]=setTimeout(function(){var te=dt.filter(function(Jt,ee){return ee===It&&Tt[ee]!==wt[ee]});x(it,nt,te,dt),wt[It]=Tt[It]}))}function st(it,nt,dt,Tt){return function(){var wt=d.select(nt.parentNode);wt.each(function(Ct){var It=Ct.fragments;wt.selectAll("tspan.line").each(function(vt,Ut){It[Ut].width=this.getComputedTextLength()});var Nt=It[It.length-1].width,te=It.slice(0,-1),Jt=[],ee,Zt,mt=0,bt=Ct.column.columnWidth-2*u.cellPad;for(Ct.value="";te.length;)ee=te.shift(),Zt=ee.width+Nt,mt+Zt>bt&&(Ct.value+=Jt.join(u.wrapSpacer)+u.lineBreaker,Jt=[],mt=0),Jt.push(ee.text),mt+=Zt;mt&&(Ct.value+=Jt.join(u.wrapSpacer)),Ct.wrapped=!0}),wt.selectAll("tspan.line").remove(),_(wt.select("."+u.cn.cellText),dt,it,Tt),d.select(nt.parentNode.parentNode).call(ot)}}function et(it,nt,dt,Tt,wt){return function(){if(!wt.settledY){var Ct=d.select(nt.parentNode),It=J(wt),Nt=wt.key-It.firstRowIndex,te=It.rows[Nt].rowHeight,Jt=wt.cellHeightMayIncrease?nt.parentNode.getBoundingClientRect().height+2*u.cellPad:te,ee=Math.max(Jt,te),Zt=ee-It.rows[Nt].rowHeight;Zt&&(It.rows[Nt].rowHeight=ee,it.selectAll("."+u.cn.columnCell).call(ot),G(null,it.filter(I),0),l(dt,Tt,!0)),Ct.attr("transform",function(){var mt=this,bt=mt.parentNode,vt=bt.getBoundingClientRect(),Ut=d.select(mt.parentNode).select("."+u.cn.cellRect).node().getBoundingClientRect(),re=mt.transform.baseVal.consolidate(),Kt=Ut.top-vt.top+(re?re.matrix.f:u.cellPad);return n(Z(wt,d.select(mt.parentNode).select("."+u.cn.cellTextHolder).node().getBoundingClientRect().width),Kt)}),wt.settledY=!0}}}function Z(it,nt){switch(it.align){case"left":return u.cellPad;case"right":return it.column.columnWidth-(nt||0)-u.cellPad;case"center":return(it.column.columnWidth-(nt||0))/2;default:return u.cellPad}}function ot(it){it.attr("transform",function(nt){var dt=nt.rowBlocks[0].auxiliaryBlocks.reduce(function(It,Nt){return It+Q(Nt,1/0)},0),Tt=J(nt),wt=Q(Tt,nt.key),Ct=wt+dt;return n(0,Ct)}).selectAll("."+u.cn.cellRect).attr("height",function(nt){return q(J(nt),nt.key).rowHeight})}function X(it,nt){for(var dt=0,Tt=nt-1;Tt>=0;Tt--)dt+=ut(it[Tt]);return dt}function Q(it,nt){for(var dt=0,Tt=0;Tt{var V=Pf().getModuleCalcData,u=Z5(),d="table";K.name=d,K.plot=function(E){var A=V(E.calcdata,d)[0];A.length&&u(E,A)},K.clean=function(E,A,t,e){var r=e._has&&e._has(d),i=A._has&&A._has(d);r&&!i&&e._paperdiv.selectAll(".table").remove()}}),mL=Vt((K,V)=>{V.exports={attributes:W5(),supplyDefaults:cL(),calc:fL(),plot:Z5(),moduleType:"trace",name:"table",basePlotModule:dL(),categories:["noOpacity"],meta:{}}}),gL=Vt((K,V)=>{V.exports=mL()}),vL=Vt((K,V)=>{var u=yu(),d=af(),E=Of(),A=fc().descriptionWithDates,t=Cu().overrideAll,e=If().dash,r=So().extendFlat;V.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:u({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:E.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:r({},E.labelalias,{editType:"calc"}),tickfont:u({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:A("tick label")},tickformatstops:t(E.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:d.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:r({},e,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:r({},e,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:d.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),t_=Vt((K,V)=>{var u=yu(),d=vL(),E=af(),A=u({editType:"calc"}),t=pc().zorder;A.family.dflt='"Open Sans", verdana, arial, sans-serif',A.size.dflt=12,A.color.dflt=E.defaultLine,V.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:d,baxis:d,font:A,color:{valType:"color",dflt:E.defaultLine,editType:"plot"},zorder:t}}),yL=Vt((K,V)=>{var u=Xr().isArray1D;V.exports=function(d,E,A){var t=A("x"),e=t&&t.length,r=A("y"),i=r&&r.length;if(!e&&!i)return!1;if(E._cheater=!t,(!e||u(t))&&(!i||u(r))){var n=e?t.length:1/0;i&&(n=Math.min(n,r.length)),E.a&&E.a.length&&(n=Math.min(n,E.a.length)),E.b&&E.b.length&&(n=Math.min(n,E.b.length)),E._length=n}else E._length=null;return!0}}),xL=Vt((K,V)=>{var u=t_(),d=Pi().addOpacity,E=ji(),A=Xr(),t=s0(),e=kd(),r=Ad(),i=e1(),n=mp(),o=wm();V.exports=function(s,f,v){var g=v.letter,m=v.font||{},w=u[g+"axis"];function l(j,N){return A.coerce(s,f,w,j,N)}function x(j,N){return A.coerce2(s,f,w,j,N)}v.name&&(f._name=v.name,f._id=v.name),l("autotypenumbers",v.autotypenumbersDflt);var y=l("type");if(y==="-"&&(v.data&&a(f,v.data),f.type==="-"?f.type="linear":y=s.type=f.type),l("smoothing"),l("cheatertype"),l("showticklabels"),l("labelprefix",g+" = "),l("labelsuffix"),l("showtickprefix"),l("showticksuffix"),l("separatethousands"),l("tickformat"),l("exponentformat"),l("minexponent"),l("showexponent"),l("categoryorder"),l("tickmode"),l("tickvals"),l("ticktext"),l("tick0"),l("dtick"),f.tickmode==="array"&&(l("arraytick0"),l("arraydtick")),l("labelpadding"),f._hovertitle=g,y==="date"){var S=E.getComponentMethod("calendars","handleDefaults");S(s,f,"calendar",v.calendar)}n(f,v.fullLayout),f.c2p=A.identity;var k=l("color",v.dfltColor),M=k===s.color?k:m.color,T=l("title.text");T&&(A.coerceFont(l,"title.font",m,{overrideDflt:{size:A.bigFont(m.size),color:M}}),l("title.offset")),l("tickangle");var c=l("autorange",!f.isValidRange(s.range));c&&l("rangemode"),l("range"),f.cleanRange(),l("fixedrange"),t(s,f,l,y),r(s,f,l,y,v),e(s,f,l,y,v),i(s,f,l,{data:v.data,dataAttr:g});var h=x("gridcolor",d(k,.3)),b=x("gridwidth"),_=x("griddash"),P=l("showgrid");P||(delete f.gridcolor,delete f.gridwidth,delete f.griddash);var z=x("startlinecolor",k),D=x("startlinewidth",b),B=l("startline",f.showgrid||!!z||!!D);B||(delete f.startlinecolor,delete f.startlinewidth);var R=x("endlinecolor",k),I=x("endlinewidth",b),F=l("endline",f.showgrid||!!R||!!I);return F||(delete f.endlinecolor,delete f.endlinewidth),P?(l("minorgridcount"),l("minorgridwidth",b),l("minorgriddash",_),l("minorgridcolor",d(h,.06)),f.minorgridcount||(delete f.minorgridwidth,delete f.minorgriddash,delete f.minorgridcolor)):(delete f.gridcolor,delete f.gridwidth,delete f.griddash),f.showticklabels==="none"&&(delete f.tickfont,delete f.tickangle,delete f.showexponent,delete f.exponentformat,delete f.minexponent,delete f.tickformat,delete f.showticksuffix,delete f.showtickprefix),f.showticksuffix||delete f.ticksuffix,f.showtickprefix||delete f.tickprefix,l("tickmode"),f};function a(s,f){if(s.type==="-"){var v=s._id,g=v.charAt(0),m=g+"calendar",w=s[m];s.type=o(f,w,{autotypenumbers:s.autotypenumbers})}}}),_L=Vt((K,V)=>{var u=xL(),d=cl();V.exports=function(A,t,e,r,i){var n=r("a");n||(r("da"),r("a0"));var o=r("b");o||(r("db"),r("b0")),E(A,t,e,i)};function E(A,t,e,r){var i=["aaxis","baxis"];i.forEach(function(n){var o=n.charAt(0),a=A[n]||{},s=d.newContainer(t,n),f={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:o+"axis",letter:o,font:t.font,name:n,data:A[o],calendar:t.calendar,dfltColor:r,bgColor:e.paper_bgcolor,autotypenumbersDflt:e.autotypenumbers,fullLayout:e};u(a,s,f),s._categories=s._categories||[],!A[n]&&a.type!=="-"&&(A[n]={type:a.type})})}}),bL=Vt((K,V)=>{var u=Xr(),d=yL(),E=_L(),A=t_(),t=af();V.exports=function(e,r,i,n){function o(f,v){return u.coerce(e,r,A,f,v)}r._clipPathId="clip"+r.uid+"carpet";var a=o("color",t.defaultLine);if(u.coerceFont(o,"font",n.font),o("carpet"),E(e,r,n,o,a),!r.a||!r.b){r.visible=!1;return}r.a.length<3&&(r.aaxis.smoothing=0),r.b.length<3&&(r.baxis.smoothing=0);var s=d(e,r,o);s||(r.visible=!1),r._cheater&&o("cheaterslope"),o("zorder")}}),K5=Vt((K,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A){var t;for(u(d)?d.length>E.length&&(d=d.slice(0,E.length)):d=[],t=0;t{V.exports=function(u,d,E){if(u.length===0)return"";var A,t=[],e=E?3:1;for(A=0;A{V.exports=function(u,d,E,A,t,e){var r=t[0]*u.dpdx(d),i=t[1]*u.dpdy(E),n=1,o=1;if(e){var a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),s=Math.sqrt(e[0]*e[0]+e[1]*e[1]),f=(t[0]*e[0]+t[1]*e[1])/a/s;o=Math.max(0,f)}var v=Math.atan2(i,r)*180/Math.PI;return v<-90?(v+=180,n=-n):v>90&&(v-=180,n=-n),{angle:v,flip:n,p:u.c2p(A,d,E),offsetMultplier:o}}}),TL=Vt((K,V)=>{var u=Ni(),d=Eo(),E=K5(),A=Y5(),t=wL(),e=Dl(),r=Xr(),i=r.strRotate,n=r.strTranslate,o=gf();V.exports=function(l,x,y,S){var k=l._context.staticPlot,M=x.xaxis,T=x.yaxis,c=l._fullLayout,h=c._clips;r.makeTraceGroups(S,y,"trace").each(function(b){var _=u.select(this),P=b[0],z=P.trace,D=z.aaxis,B=z.baxis,R=r.ensureSingle(_,"g","minorlayer"),I=r.ensureSingle(_,"g","majorlayer"),F=r.ensureSingle(_,"g","boundarylayer"),j=r.ensureSingle(_,"g","labellayer");_.style("opacity",z.opacity),s(M,T,I,D,"a",D._gridlines,!0),s(M,T,I,B,"b",B._gridlines,!0),s(M,T,R,D,"a",D._minorgridlines,!0),s(M,T,R,B,"b",B._minorgridlines,!0),s(M,T,F,D,"a-boundary",D._boundarylines,k),s(M,T,F,B,"b-boundary",B._boundarylines,k);var N=f(l,M,T,z,P,j,D._labels,"a-label"),G=f(l,M,T,z,P,j,B._labels,"b-label");v(l,j,z,P,M,T,N,G),a(z,P,h,M,T)})};function a(l,x,y,S,k){var M,T,c,h,b=y.select("#"+l._clipPathId);b.size()||(b=y.append("clipPath").classed("carpetclip",!0));var _=r.ensureSingle(b,"path","carpetboundary"),P=x.clipsegments,z=[];for(h=0;h0?"start":"end","data-notex":1}).call(d.font,P.font).text(P.text).call(e.convertToTspans,l),F=d.bBox(this);I.attr("transform",n(D.p[0],D.p[1])+i(D.angle)+n(P.axis.labelpadding*R,F.height*.3)),b=Math.max(b,F.width+P.axis.labelpadding)}),h.exit().remove(),_.maxExtent=b,_}function v(l,x,y,S,k,M,T,c){var h,b,_,P,z=r.aggNums(Math.min,null,y.a),D=r.aggNums(Math.max,null,y.a),B=r.aggNums(Math.min,null,y.b),R=r.aggNums(Math.max,null,y.b);h=.5*(z+D),b=B,_=y.ab2xy(h,b,!0),P=y.dxyda_rough(h,b),T.angle===void 0&&r.extendFlat(T,t(y,k,M,_,y.dxydb_rough(h,b))),w(l,x,y,S,_,P,y.aaxis,k,M,T,"a-title"),h=z,b=.5*(B+R),_=y.ab2xy(h,b,!0),P=y.dxydb_rough(h,b),c.angle===void 0&&r.extendFlat(c,t(y,k,M,_,y.dxyda_rough(h,b))),w(l,x,y,S,_,P,y.baxis,k,M,c,"b-title")}var g=o.LINE_SPACING,m=(1-o.MID_SHIFT)/g+1;function w(l,x,y,S,k,M,T,c,h,b,_){var P=[];T.title.text&&P.push(T.title.text);var z=x.selectAll("text."+_).data(P),D=b.maxExtent;z.enter().append("text").classed(_,!0),z.each(function(){var B=t(y,c,h,k,M);["start","both"].indexOf(T.showticklabels)===-1&&(D=0);var R=T.title.font.size;D+=R+T.title.offset;var I=b.angle+(b.flip<0?180:0),F=(I-B.angle+450)%360,j=F>90&&F<270,N=u.select(this);N.text(T.title.text).call(e.convertToTspans,l),j&&(D=(-e.lineCount(N)+m)*g*R-D),N.attr("transform",n(B.p[0],B.p[1])+i(B.angle)+n(0,D)).attr("text-anchor","middle").call(d.font,T.title.font)}),z.exit().remove()}}),kL=Vt((K,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A){var t,e,r,i,n,o,a=[],s=u(d)?d.length:d,f=u(E)?E.length:E,v=u(d)?d:null,g=u(E)?E:null;v&&(r=(v.length-1)/(v[v.length-1]-v[0])/(s-1)),g&&(i=(g.length-1)/(g[g.length-1]-g[0])/(f-1));var m,w=1/0,l=-1/0;for(e=0;e{var u=Xr().isArrayOrTypedArray;V.exports=function(E){return d(E,0)};function d(E,A){if(!u(E)||A>=10)return null;for(var t=1/0,e=-1/0,r=E.length,i=0;i{var u=yo(),d=So().extendFlat;V.exports=function(E,A,t){var e,r,i,n,o,a,s,f,v,g,m,w,l,x,y=E["_"+A],S=E[A+"axis"],k=S._gridlines=[],M=S._minorgridlines=[],T=S._boundarylines=[],c=E["_"+t],h=E[t+"axis"];S.tickmode==="array"&&(S.tickvals=y.slice());var b=E._xctrl,_=E._yctrl,P=b[0].length,z=b.length,D=E._a.length,B=E._b.length;u.prepTicks(S),S.tickmode==="array"&&delete S.tickvals;var R=S.smoothing?3:1;function I(j){var N,G,rt,ct,st,et,Z,ot,X,Q,ut,J,q=[],it=[],nt={};if(A==="b")for(G=E.b2j(j),rt=Math.floor(Math.max(0,Math.min(B-2,G))),ct=G-rt,nt.length=B,nt.crossLength=D,nt.xy=function(dt){return E.evalxy([],dt,G)},nt.dxy=function(dt,Tt){return E.dxydi([],dt,rt,Tt,ct)},N=0;N0&&(X=E.dxydi([],N-1,rt,0,ct),q.push(st[0]+X[0]/3),it.push(st[1]+X[1]/3),Q=E.dxydi([],N-1,rt,1,ct),q.push(ot[0]-Q[0]/3),it.push(ot[1]-Q[1]/3)),q.push(ot[0]),it.push(ot[1]),st=ot;else for(N=E.a2i(j),et=Math.floor(Math.max(0,Math.min(D-2,N))),Z=N-et,nt.length=D,nt.crossLength=B,nt.xy=function(dt){return E.evalxy([],N,dt)},nt.dxy=function(dt,Tt){return E.dxydj([],et,dt,Z,Tt)},G=0;G0&&(ut=E.dxydj([],et,G-1,Z,0),q.push(st[0]+ut[0]/3),it.push(st[1]+ut[1]/3),J=E.dxydj([],et,G-1,Z,1),q.push(ot[0]-J[0]/3),it.push(ot[1]-J[1]/3)),q.push(ot[0]),it.push(ot[1]),st=ot;return nt.axisLetter=A,nt.axis=S,nt.crossAxis=h,nt.value=j,nt.constvar=t,nt.index=f,nt.x=q,nt.y=it,nt.smoothing=h.smoothing,nt}function F(j){var N,G,rt,ct,st,et=[],Z=[],ot={};if(ot.length=y.length,ot.crossLength=c.length,A==="b")for(rt=Math.max(0,Math.min(B-2,j)),st=Math.min(1,Math.max(0,j-rt)),ot.xy=function(X){return E.evalxy([],X,j)},ot.dxy=function(X,Q){return E.dxydi([],X,rt,Q,st)},N=0;Ny.length-1)&&k.push(d(F(r),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(f=a;fy.length-1)&&!(m<0||m>y.length-1))for(w=y[i],l=y[m],e=0;ey[y.length-1])&&M.push(d(I(g),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash})));S.startline&&T.push(d(F(0),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&T.push(d(F(y.length-1),{color:S.endlinecolor,width:S.endlinewidth}))}else{for(n=5e-15,o=[Math.floor((y[y.length-1]-S.tick0)/S.dtick*(1+n)),Math.ceil((y[0]-S.tick0)/S.dtick/(1+n))].sort(function(j,N){return j-N}),a=o[0],s=o[1],f=a;f<=s;f++)v=S.tick0+S.dtick*f,k.push(d(I(v),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(f=a-1;fy[y.length-1])&&M.push(d(I(g),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&T.push(d(I(y[0]),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&T.push(d(I(y[y.length-1]),{color:S.endlinecolor,width:S.endlinewidth}))}}}),SL=Vt((K,V)=>{var u=yo(),d=So().extendFlat;V.exports=function(E,A){var t,e,r,i,n,o=A._labels=[],a=A._gridlines;for(t=0;t{V.exports=function(u,d,E,A){var t,e,r,i=[],n=!!E.smoothing,o=!!A.smoothing,a=u[0].length-1,s=u.length-1;for(t=0,e=[],r=[];t<=a;t++)e[t]=u[0][t],r[t]=d[0][t];for(i.push({x:e,y:r,bicubic:n}),t=0,e=[],r=[];t<=s;t++)e[t]=u[t][a],r[t]=d[t][a];for(i.push({x:e,y:r,bicubic:o}),t=a,e=[],r=[];t>=0;t--)e[a-t]=u[s][t],r[a-t]=d[s][t];for(i.push({x:e,y:r,bicubic:n}),t=s,e=[],r=[];t>=0;t--)e[s-t]=u[t][0],r[s-t]=d[t][0];return i.push({x:e,y:r,bicubic:o}),i}}),zL=Vt((K,V)=>{var u=Xr();V.exports=function(d,E,A){var t,e,r,i=[],n=[],o=d[0].length,a=d.length;function s(G,rt){var ct=0,st,et=0;return G>0&&(st=d[rt][G-1])!==void 0&&(et++,ct+=st),G0&&(st=d[rt-1][G])!==void 0&&(et++,ct+=st),rt0&&e0&&tc);return u.log("Smoother converged to",h,"after",_,"iterations"),d}}),LL=Vt((K,V)=>{V.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),CL=Vt((K,V)=>{var u=.5;V.exports=function(d,E,A,t){var e=d[0]-E[0],r=d[1]-E[1],i=A[0]-E[0],n=A[1]-E[1],o=Math.pow(e*e+r*r,u/2),a=Math.pow(i*i+n*n,u/2),s=(a*a*e-o*o*i)*t,f=(a*a*r-o*o*n)*t,v=a*(o+a)*3,g=o*(o+a)*3;return[[E[0]+(v&&s/v),E[1]+(v&&f/v)],[E[0]-(g&&s/g),E[1]-(g&&f/g)]]}}),IL=Vt((K,V)=>{var u=CL(),d=Xr().ensureArray;function E(A,t,e){var r=-.5*e[0]+1.5*t[0],i=-.5*e[1]+1.5*t[1];return[(2*r+A[0])/3,(2*i+A[1])/3]}V.exports=function(A,t,e,r,i,n){var o,a,s,f,v,g,m,w,l,x,y=e[0].length,S=e.length,k=i?3*y-2:y,M=n?3*S-2:S;for(A=d(A,M),t=d(t,M),s=0;s{V.exports=function(u,d,E,A,t){var e=d-2,r=E-2;return A&&t?function(i,n,o){i||(i=[]);var a,s,f,v,g,m,w=Math.max(0,Math.min(Math.floor(n),e)),l=Math.max(0,Math.min(Math.floor(o),r)),x=Math.max(0,Math.min(1,n-w)),y=Math.max(0,Math.min(1,o-l));w*=3,l*=3;var S=x*x,k=S*x,M=1-x,T=M*M,c=T*M,h=y*y,b=h*y,_=1-y,P=_*_,z=P*_;for(m=0;m{V.exports=function(u,d,E){return d&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f,v;t*=3,e*=3;var g=r*r,m=1-r,w=m*m,l=m*r*2,x=-3*w,y=3*(w-l),S=3*(l-g),k=3*g,M=i*i,T=M*i,c=1-i,h=c*c,b=h*c;for(v=0;v{V.exports=function(u,d,E){return d&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f,v;t*=3,e*=3;var g=r*r,m=g*r,w=1-r,l=w*w,x=l*w,y=i*i,S=1-i,k=S*S,M=S*i*2,T=-3*k,c=3*(k-M),h=3*(M-y),b=3*y;for(v=0;v{var u=LL(),d=Ny().findBin,E=IL(),A=PL(),t=OL(),e=DL();V.exports=function(r){var i=r._a,n=r._b,o=i.length,a=n.length,s=r.aaxis,f=r.baxis,v=i[0],g=i[o-1],m=n[0],w=n[a-1],l=i[i.length-1]-i[0],x=n[n.length-1]-n[0],y=l*u.RELATIVE_CULL_TOLERANCE,S=x*u.RELATIVE_CULL_TOLERANCE;v-=y,g+=y,m-=S,w+=S,r.isVisible=function(k,M){return k>v&&km&&Mg||Mw},r.setScale=function(){var k=r._x,M=r._y,T=E(r._xctrl,r._yctrl,k,M,s.smoothing,f.smoothing);r._xctrl=T[0],r._yctrl=T[1],r.evalxy=A([r._xctrl,r._yctrl],o,a,s.smoothing,f.smoothing),r.dxydi=t([r._xctrl,r._yctrl],s.smoothing,f.smoothing),r.dxydj=e([r._xctrl,r._yctrl],s.smoothing,f.smoothing)},r.i2a=function(k){var M=Math.max(0,Math.floor(k[0]),o-2),T=k[0]-M;return(1-T)*i[M]+T*i[M+1]},r.j2b=function(k){var M=Math.max(0,Math.floor(k[1]),o-2),T=k[1]-M;return(1-T)*n[M]+T*n[M+1]},r.ij2ab=function(k){return[r.i2a(k[0]),r.j2b(k[1])]},r.a2i=function(k){var M=Math.max(0,Math.min(d(k,i),o-2)),T=i[M],c=i[M+1];return Math.max(0,Math.min(o-1,M+(k-T)/(c-T)))},r.b2j=function(k){var M=Math.max(0,Math.min(d(k,n),a-2)),T=n[M],c=n[M+1];return Math.max(0,Math.min(a-1,M+(k-T)/(c-T)))},r.ab2ij=function(k){return[r.a2i(k[0]),r.b2j(k[1])]},r.i2c=function(k,M){return r.evalxy([],k,M)},r.ab2xy=function(k,M,T){if(!T&&(ki[o-1]|Mn[a-1]))return[!1,!1];var c=r.a2i(k),h=r.b2j(M),b=r.evalxy([],c,h);if(T){var _=0,P=0,z=[],D,B,R,I;ki[o-1]?(D=o-2,B=1,_=(k-i[o-1])/(i[o-1]-i[o-2])):(D=Math.max(0,Math.min(o-2,Math.floor(c))),B=c-D),Mn[a-1]?(R=a-2,I=1,P=(M-n[a-1])/(n[a-1]-n[a-2])):(R=Math.max(0,Math.min(a-2,Math.floor(h))),I=h-R),_&&(r.dxydi(z,D,R,B,I),b[0]+=z[0]*_,b[1]+=z[1]*_),P&&(r.dxydj(z,D,R,B,I),b[0]+=z[0]*P,b[1]+=z[1]*P)}return b},r.c2p=function(k,M,T){return[M.c2p(k[0]),T.c2p(k[1])]},r.p2x=function(k,M,T){return[M.p2c(k[0]),T.p2c(k[1])]},r.dadi=function(k){var M=Math.max(0,Math.min(i.length-2,k));return i[M+1]-i[M]},r.dbdj=function(k){var M=Math.max(0,Math.min(n.length-2,k));return n[M+1]-n[M]},r.dxyda=function(k,M,T,c){var h=r.dxydi(null,k,M,T,c),b=r.dadi(k,T);return[h[0]/b,h[1]/b]},r.dxydb=function(k,M,T,c){var h=r.dxydj(null,k,M,T,c),b=r.dbdj(M,c);return[h[0]/b,h[1]/b]},r.dxyda_rough=function(k,M,T){var c=l*(T||.1),h=r.ab2xy(k+c,M,!0),b=r.ab2xy(k-c,M,!0);return[(h[0]-b[0])*.5/c,(h[1]-b[1])*.5/c]},r.dxydb_rough=function(k,M,T){var c=x*(T||.1),h=r.ab2xy(k,M+c,!0),b=r.ab2xy(k,M-c,!0);return[(h[0]-b[0])*.5/c,(h[1]-b[1])*.5/c]},r.dpdx=function(k){return k._m},r.dpdy=function(k){return k._m}}}),BL=Vt((K,V)=>{var u=yo(),d=Xr().isArray1D,E=kL(),A=AL(),t=ML(),e=SL(),r=EL(),i=y1(),n=zL(),o=v1(),a=FL();V.exports=function(s,f){var v=u.getFromId(s,f.xaxis),g=u.getFromId(s,f.yaxis),m=f.aaxis,w=f.baxis,l=f.x,x=f.y,y=[];l&&d(l)&&y.push("x"),x&&d(x)&&y.push("y"),y.length&&o(f,m,w,"a","b",y);var S=f._a=f._a||f.a,k=f._b=f._b||f.b;l=f._x||f.x,x=f._y||f.y;var M={};if(f._cheater){var T=m.cheatertype==="index"?S.length:S,c=w.cheatertype==="index"?k.length:k;l=E(T,c,f.cheaterslope)}f._x=l=i(l),f._y=x=i(x),n(l,S,k),n(x,S,k),a(f),f.setScale();var h=A(l),b=A(x),_=.5*(h[1]-h[0]),P=.5*(h[1]+h[0]),z=.5*(b[1]-b[0]),D=.5*(b[1]+b[0]),B=1.3;return h=[P-_*B,P+_*B],b=[D-z*B,D+z*B],f._extremes[v._id]=u.findExtremes(v,h,{padded:!0}),f._extremes[g._id]=u.findExtremes(g,b,{padded:!0}),t(f,"a","b"),t(f,"b","a"),e(f,m),e(f,w),M.clipsegments=r(f._xctrl,f._yctrl,m,w),M.x=l,M.y=x,M.a=S,M.b=k,[M]}}),RL=Vt((K,V)=>{V.exports={attributes:t_(),supplyDefaults:bL(),plot:TL(),calc:BL(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Kc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),NL=Vt((K,V)=>{V.exports=RL()}),X5=Vt((K,V)=>{var u=Qh(),d=pc(),E=kl(),{hovertemplateAttrs:A,texttemplateAttrs:t,templatefallbackAttrs:e}=yl(),r=Wl(),i=So().extendFlat,n=d.marker,o=d.line,a=n.line;V.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:i({},d.mode,{dflt:"markers"}),text:i({},d.text,{}),texttemplate:t({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:e({editType:"plot"}),hovertext:i({},d.hovertext,{}),line:{color:o.color,width:o.width,dash:o.dash,backoff:o.backoff,shape:i({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:d.connectgaps,fill:i({},d.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:u(),marker:i({symbol:n.symbol,opacity:n.opacity,maxdisplayed:n.maxdisplayed,angle:n.angle,angleref:n.angleref,standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:i({width:a.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:d.textfont,textposition:d.textposition,selected:d.selected,unselected:d.unselected,hoverinfo:i({},E.hoverinfo,{flags:["a","b","text","name"]}),hoveron:d.hoveron,hovertemplate:A(),hovertemplatefallback:e(),zorder:d.zorder}}),jL=Vt((K,V)=>{var u=Xr(),d=gp(),E=nu(),A=Ch(),t=Rh(),e=Am(),r=Nh(),i=ep(),n=X5();V.exports=function(o,a,s,f){function v(S,k){return u.coerce(o,a,n,S,k)}v("carpet"),a.xaxis="x",a.yaxis="y";var g=v("a"),m=v("b"),w=Math.min(g.length,m.length);if(!w){a.visible=!1;return}a._length=w,v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext");var l=w{V.exports=function(u,d){var E={},A=d._carpet,t=A.ab2ij([u.a,u.b]),e=Math.floor(t[0]),r=t[0]-e,i=Math.floor(t[1]),n=t[1]-i,o=A.evalxy([],e,i,r,n);return E.yLabel=o[1].toFixed(3),E}}),e_=Vt((K,V)=>{V.exports=function(u,d){for(var E=u._fullData.length,A,t=0;t{var u=Lo(),d=jh(),E=vp(),A=Uh(),t=Vh().calcMarkerSize,e=e_();V.exports=function(r,i){var n=i._carpetTrace=e(r,i);if(!(!n||!n.visible||n.visible==="legendonly")){var o;i.xaxis=n.xaxis,i.yaxis=n.yaxis;var a=i._length,s=new Array(a),f,v,g=!1;for(o=0;o{var u=Mm(),d=yo(),E=Eo();V.exports=function(A,t,e,r){var i,n,o,a=e[0][0].carpet,s=d.getFromId(A,a.xaxis||"x"),f=d.getFromId(A,a.yaxis||"y"),v={xaxis:s,yaxis:f,plot:t.plot};for(i=0;i{var u=Em(),d=Xr().fillText;V.exports=function(E,A,t,e){var r=u(E,A,t,e);if(!r||r[0].index===!1)return;var i=r[0];if(i.index===void 0){var n=1-i.y0/E.ya._length,o=E.xa._length,a=o*n/2,s=o-a;return i.x0=Math.max(Math.min(i.x0,s),a),i.x1=Math.max(Math.min(i.x1,s),a),r}var f=i.cd[i.index];i.a=f.a,i.b=f.b,i.xLabelVal=void 0,i.yLabelVal=void 0;var v=i.trace,g=v._carpet,m=v._module.formatLabels(f,v);i.yLabel=m.yLabel,delete i.text;var w=[];function l(S,k){var M;S.labelprefix&&S.labelprefix.length>0?M=S.labelprefix.replace(/ = $/,""):M=S._hovertitle,w.push(M+": "+k.toFixed(3)+S.labelsuffix)}if(!v.hovertemplate){var x=f.hi||v.hoverinfo,y=x.split("+");y.indexOf("all")!==-1&&(y=["a","b","text"]),y.indexOf("a")!==-1&&l(g.aaxis,f.a),y.indexOf("b")!==-1&&l(g.baxis,f.b),w.push("y: "+i.yLabel),y.indexOf("text")!==-1&&d(f,v,w),i.extraText=w.join("
                ")}return r}}),WL=Vt((K,V)=>{V.exports=function(u,d,E,A,t){var e=A[t];return u.a=e.a,u.b=e.b,u.y=e.y,u}}),GL=Vt((K,V)=>{V.exports={attributes:X5(),supplyDefaults:jL(),colorbar:Zf(),formatLabels:UL(),calc:VL(),plot:HL(),style:gh().style,styleOnSelect:gh().styleOnSelect,hoverPoints:qL(),selectPoints:zm(),eventData:WL(),moduleType:"trace",name:"scattercarpet",basePlotModule:Kc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),ZL=Vt((K,V)=>{V.exports=GL()}),$5=Vt((K,V)=>{var u=Im(),d=$g(),E=Wl(),A=So().extendFlat,t=d.contours;V.exports=A({carpet:{valType:"string",editType:"calc"},z:u.z,a:u.x,a0:u.x0,da:u.dx,b:u.y,b0:u.y0,db:u.dy,text:u.text,hovertext:u.hovertext,transpose:u.transpose,atype:u.xtype,btype:u.ytype,fillcolor:d.fillcolor,autocontour:d.autocontour,ncontours:d.ncontours,contours:{type:t.type,start:t.start,end:t.end,size:t.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:t.showlines,showlabels:t.showlabels,labelfont:t.labelfont,labelformat:t.labelformat,operation:t.operation,value:t.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:d.line.color,width:d.line.width,dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},zorder:d.zorder},E("",{cLetter:"z",autoColorDflt:!1}))}),J5=Vt((K,V)=>{var u=Xr(),d=g1(),E=$5(),A=T2(),t=L1(),e=C1();V.exports=function(r,i,n,o){function a(g,m){return u.coerce(r,i,E,g,m)}function s(g){return u.coerce2(r,i,E,g)}if(a("carpet"),r.a&&r.b){var f=d(r,i,a,o,"a","b");if(!f){i.visible=!1;return}a("text");var v=a("contours.type")==="constraint";v?A(r,i,a,o,n,{hasHover:!1}):(t(r,i,a,s),e(r,i,a,o,{hasHover:!1}))}else i._defaultColor=n,i._length=null;a("zorder")}}),KL=Vt((K,V)=>{var u=ih(),d=Xr(),E=v1(),A=y1(),t=x1(),e=_1(),r=s2(),i=J5(),n=e_(),o=d2();V.exports=function(s,f){var v=f._carpetTrace=n(s,f);if(!(!v||!v.visible||v.visible==="legendonly")){if(!f.a||!f.b){var g=s.data[v.index],m=s.data[f.index];m.a||(m.a=g.a),m.b||(m.b=g.b),i(m,f,f._defaultColor,s._fullLayout)}var w=a(s,f);return o(f,f._z),w}};function a(s,f){var v=f._carpetTrace,g=v.aaxis,m=v.baxis,w,l,x,y,S,k,M;g._minDtick=0,m._minDtick=0,d.isArray1D(f.z)&&E(f,g,m,"a","b",["z"]),w=f._a=f._a||f.a,y=f._b=f._b||f.b,w=w?g.makeCalcdata(f,"_a"):[],y=y?m.makeCalcdata(f,"_b"):[],l=f.a0||0,x=f.da||1,S=f.b0||0,k=f.db||1,M=f._z=A(f._z||f.z,f.transpose),f._emptypoints=e(M),t(M,f._emptypoints);var T=d.maxRowLength(M),c=f.xtype==="scaled"?"":w,h=r(f,c,l,x,T,g),b=f.ytype==="scaled"?"":y,_=r(f,b,S,k,M.length,m),P={a:h,b:_,z:M};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&u(s,f,{vals:M,containerStr:"",cLetter:"z"}),[P]}}),YL=Vt((K,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A,t){var e,r,i,n,o,a,s,f,v,g,m,w,l,x=u(A)?"a":"b",y=x==="a"?d.aaxis:d.baxis,S=y.smoothing,k=x==="a"?d.a2i:d.b2j,M=x==="a"?A:t,T=x==="a"?t:A,c=x==="a"?E.a.length:E.b.length,h=x==="a"?E.b.length:E.a.length,b=Math.floor(x==="a"?d.b2j(T):d.a2i(T)),_=x==="a"?function(ct){return d.evalxy([],ct,b)}:function(ct){return d.evalxy([],b,ct)};S&&(i=Math.max(0,Math.min(h-2,b)),n=b-i,r=x==="a"?function(ct,st){return d.dxydi([],ct,i,st,n)}:function(ct,st){return d.dxydj([],i,ct,n,st)});var P=k(M[0]),z=k(M[1]),D=P0?Math.floor:Math.ceil,I=D>0?Math.ceil:Math.floor,F=D>0?Math.min:Math.max,j=D>0?Math.max:Math.min,N=R(P+B),G=I(z-B);s=_(P);var rt=[[s]];for(e=N;e*D{var u=Ni(),d=K5(),E=Y5(),A=Eo(),t=Xr(),e=g2(),r=v2(),i=I1(),n=Qg(),o=x2(),a=y2(),s=_2(),f=e_(),v=YL();V.exports=function(T,c,h,b){var _=c.xaxis,P=c.yaxis;t.makeTraceGroups(b,h,"contour").each(function(z){var D=u.select(this),B=z[0],R=B.trace,I=R._carpetTrace=f(T,R),F=T.calcdata[I.index][0];if(!I.visible||I.visible==="legendonly")return;var j=B.a,N=B.b,G=R.contours,rt=a(G,c,B),ct=G.type==="constraint",st=G._operation,et=ct?st==="="?"lines":"fill":G.coloring;function Z(wt){var Ct=I.ab2xy(wt[0],wt[1],!0);return[_.c2p(Ct[0]),P.c2p(Ct[1])]}var ot=[[j[0],N[N.length-1]],[j[j.length-1],N[N.length-1]],[j[j.length-1],N[0]],[j[0],N[0]]];e(rt);var X=(j[j.length-1]-j[0])*1e-8,Q=(N[N.length-1]-N[0])*1e-8;r(rt,X,Q);var ut=rt;G.type==="constraint"&&(ut=o(rt,st)),g(rt,Z);var J,q,it,nt,dt=[];for(nt=F.clipsegments.length-1;nt>=0;nt--)J=F.clipsegments[nt],q=d([],J.x,_.c2p),it=d([],J.y,P.c2p),q.reverse(),it.reverse(),dt.push(E(q,it,J.bicubic));var Tt="M"+dt.join("L")+"Z";S(D,F.clipsegments,_,P,ct,et),k(R,D,_,P,ut,ot,Z,I,F,et,Tt),m(D,rt,T,B,G,c,I),A.setClipUrl(D,I._clipPathId,T)})};function g(T,c){var h,b,_,P,z,D,B,R,I;for(h=0;hct&&(b.max=ct),b.len=b.max-b.min}function l(T,c,h){var b=T.getPointAtLength(c),_=T.getPointAtLength(h),P=_.x-b.x,z=_.y-b.y,D=Math.sqrt(P*P+z*z);return[P/D,z/D]}function x(T){var c=Math.sqrt(T[0]*T[0]+T[1]*T[1]);return[T[0]/c,T[1]/c]}function y(T,c){var h=Math.abs(T[0]*c[0]+T[1]*c[1]),b=Math.sqrt(1-h*h);return b/h}function S(T,c,h,b,_,P){var z,D,B,R,I=t.ensureSingle(T,"g","contourbg"),F=I.selectAll("path").data(P==="fill"&&!_?[0]:[]);F.enter().append("path"),F.exit().remove();var j=[];for(R=0;R=0&&(N=it,rt=ct):Math.abs(j[1]-N[1])=0&&(N=it,rt=ct):t.log("endpt to newendpt is not vert. or horz.",j,N,it)}if(rt>=0)break;R+=J(j,N),j=N}if(rt===c.edgepaths.length){t.log("unclosed perimeter path");break}B=rt,F=I.indexOf(B)===-1,F&&(B=I[0],R+=J(j,N)+"Z",j=null)}for(B=0;B{V.exports={attributes:$5(),supplyDefaults:J5(),colorbar:O1(),calc:KL(),plot:XL(),style:P1(),moduleType:"trace",name:"contourcarpet",basePlotModule:Kc(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),JL=Vt((K,V)=>{V.exports=$L()}),r_=Vt((K,V)=>{var u=Xr().extendFlat,d=pc(),E=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:t}=yl(),e=If().dash,r=mm(),i=Pm(),n=i.INCREASING.COLOR,o=i.DECREASING.COLOR,a=d.line;function s(f){return{line:{color:u({},a.color,{dflt:f}),width:a.width,dash:e,editType:"style"},editType:"style"}}V.exports={xperiod:d.xperiod,xperiod0:d.xperiod0,xperiodalignment:d.xperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:u({},a.width,{}),dash:u({},e,{}),editType:"style"},increasing:s(n),decreasing:s(o),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({},{keys:["open","high","low","close"]}),hovertemplatefallback:t(),tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:u({},r.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:d.zorder}}),Q5=Vt((K,V)=>{var u=ji(),d=Xr();V.exports=function(E,A,t,e){var r=t("x"),i=t("open"),n=t("high"),o=t("low"),a=t("close");t("hoverlabel.split");var s=u.getComponentMethod("calendars","handleTraceDefaults");if(s(E,A,["x"],e),!!(i&&n&&o&&a)){var f=Math.min(i.length,n.length,o.length,a.length);return r&&(f=Math.min(f,d.minRowLength(r))),A._length=f,f}}}),QL=Vt((K,V)=>{var u=Xr(),d=Q5(),E=tp(),A=r_();V.exports=function(e,r,i,n){function o(s,f){return u.coerce(e,r,A,s,f)}var a=d(e,r,o,n);if(!a){r.visible=!1;return}E(e,r,n,o,{x:!0}),o("xhoverformat"),o("yhoverformat"),o("line.width"),o("line.dash"),t(e,r,o,"increasing"),t(e,r,o,"decreasing"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("tickwidth"),n._requestRangeslider[r.xaxis]=!0,o("zorder")};function t(e,r,i,n){i(n+".line.color"),i(n+".line.width",r.line.width),i(n+".line.dash",r.line.dash)}}),t4=Vt((K,V)=>{var u=Xr(),d=u._,E=yo(),A=rp(),t=ks().BADNUM;function e(o,a){var s=E.getFromId(o,a.xaxis),f=E.getFromId(o,a.yaxis),v=n(o,s,a),g=a._minDiff;a._minDiff=null;var m=a._origX;a._origX=null;var w=a._xcalc;a._xcalc=null;var l=i(o,a,m,w,f,r);return a._extremes[s._id]=E.findExtremes(s,w,{vpad:g/2}),l.length?(u.extendFlat(l[0].t,{wHover:g/2,tickLen:v}),l):[{t:{empty:!0}}]}function r(o,a,s,f){return{o,h:a,l:s,c:f}}function i(o,a,s,f,v,g){for(var m=v.makeCalcdata(a,"open"),w=v.makeCalcdata(a,"high"),l=v.makeCalcdata(a,"low"),x=v.makeCalcdata(a,"close"),y=u.isArrayOrTypedArray(a.text),S=u.isArrayOrTypedArray(a.hovertext),k=!0,M=null,T=!!a.xperiodalignment,c=[],h=0;hM):k=D>_,M=D;var B=g(_,P,z,D);B.pos=b,B.yc=(_+D)/2,B.i=h,B.dir=k?"increasing":"decreasing",B.x=B.pos,B.y=[z,P],T&&(B.orig_p=s[h]),y&&(B.tx=a.text[h]),S&&(B.htx=a.hovertext[h]),c.push(B)}else c.push({pos:b,empty:!0})}return a._extremes[v._id]=E.findExtremes(v,u.concat(l,w),{padded:!0}),c.length&&(c[0].t={labels:{open:d(o,"open:")+" ",high:d(o,"high:")+" ",low:d(o,"low:")+" ",close:d(o,"close:")+" "}}),c}function n(o,a,s){var f=s._minDiff;if(!f){var v=o._fullData,g=[];f=1/0;var m;for(m=0;m{var u=Ni(),d=Xr();V.exports=function(E,A,t,e){var r=A.yaxis,i=A.xaxis,n=!!i.rangebreaks;d.makeTraceGroups(e,t,"trace ohlc").each(function(o){var a=u.select(this),s=o[0],f=s.t,v=s.trace;if(v.visible!==!0||f.empty){a.remove();return}var g=f.tickLen,m=a.selectAll("path").data(d.identity);m.enter().append("path"),m.exit().remove(),m.attr("d",function(w){if(w.empty)return"M0,0Z";var l=i.c2p(w.pos-g,!0),x=i.c2p(w.pos+g,!0),y=n?(l+x)/2:i.c2p(w.pos,!0),S=r.c2p(w.o,!0),k=r.c2p(w.h,!0),M=r.c2p(w.l,!0),T=r.c2p(w.c,!0);return"M"+l+","+S+"H"+y+"M"+y+","+k+"V"+M+"M"+x+","+T+"H"+y})})}}),eC=Vt((K,V)=>{var u=Ni(),d=Eo(),E=Pi();V.exports=function(A,t,e){var r=e||u.select(A).selectAll("g.ohlclayer").selectAll("g.trace");r.style("opacity",function(i){return i[0].trace.opacity}),r.each(function(i){var n=i[0].trace;u.select(this).selectAll("path").each(function(o){if(!o.empty){var a=n[o.dir].line;u.select(this).style("fill","none").call(E.stroke,a.color).call(d.dashLine,a.dash,a.width).style("opacity",n.selectedpoints&&!o.selected?.3:1)}})})}}),e4=Vt((K,V)=>{var u=yo(),d=Xr(),E=hc(),A=Pi(),t=Xr().fillText,e=Pm(),r={increasing:e.INCREASING.SYMBOL,decreasing:e.DECREASING.SYMBOL};function i(s,f,v,g){var m=s.cd,w=m[0].trace;return w.hoverlabel.split?o(s,f,v,g):a(s,f,v,g)}function n(s,f,v,g){var m=s.cd,w=s.xa,l=m[0].trace,x=m[0].t,y=l.type,S=y==="ohlc"?"l":"min",k=y==="ohlc"?"h":"max",M,T,c=x.bPos||0,h=function(G){return G.pos+c-f},b=x.bdPos||x.tickLen,_=x.wHover,P=Math.min(1,b/Math.abs(w.r2c(w.range[1])-w.r2c(w.range[0])));M=s.maxHoverDistance-P,T=s.maxSpikeDistance-P;function z(G){var rt=h(G);return E.inbox(rt-_,rt+_,M)}function D(G){var rt=G[S],ct=G[k];return rt===ct||E.inbox(rt-v,ct-v,M)}function B(G){return(z(G)+D(G))/2}var R=E.getDistanceFunction(g,z,D,B);if(E.getClosest(m,R,s),s.index===!1)return null;var I=m[s.index];if(I.empty)return null;var F=I.dir,j=l[F],N=j.line.color;return A.opacity(N)&&j.line.width?s.color=N:s.color=j.fillcolor,s.x0=w.c2p(I.pos+c-b,!0),s.x1=w.c2p(I.pos+c+b,!0),s.xLabelVal=I.orig_p!==void 0?I.orig_p:I.pos,s.spikeDistance=B(I)*T/M,s.xSpike=w.c2p(I.pos,!0),s}function o(s,f,v,g){var m=s.cd,w=s.ya,l=m[0].trace,x=m[0].t,y=[],S=n(s,f,v,g);if(!S)return[];var k=m[S.index],M=k.hi||l.hoverinfo||"";if(M==="none"||M==="skip")return[];for(var T=["high","open","close","low"],c={},h=0;h"+x.labels[b]+u.hoverLabelText(w,_,l.yhoverformat)):(z=d.extendFlat({},S),z.y0=z.y1=P,z.yLabelVal=_,z.yLabel=x.labels[b]+u.hoverLabelText(w,_,l.yhoverformat),z.name="",y.push(z),c[_]=z)}return y}function a(s,f,v,g){var m=s.cd,w=s.ya,l=m[0].trace,x=m[0].t,y=n(s,f,v,g);if(!y)return[];var S=y.index,k=m[S],M=y.index=k.i,T=k.dir;function c(B){return x.labels[B]+u.hoverLabelText(w,l[B][M],l.yhoverformat)}var h=k.hi||l.hoverinfo||"",b=h.split("+"),_=h==="all",P=_||b.indexOf("y")!==-1,z=_||b.indexOf("text")!==-1,D=P?[c("open"),c("high"),c("low"),c("close")+" "+r[T]]:[];return z&&t(k,l,D),y.extraText=D.join("
                "),y.y0=y.y1=w.c2p(k.yc,!0),[y]}V.exports={hoverPoints:i,hoverSplit:o,hoverOnPoints:a}}),r4=Vt((K,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i=E[0].t.bPos||0;if(d===!1)for(r=0;r{V.exports={moduleType:"trace",name:"ohlc",basePlotModule:Kc(),categories:["cartesian","svg","showLegend"],meta:{},attributes:r_(),supplyDefaults:QL(),calc:t4().calc,plot:tC(),style:eC(),hoverPoints:e4().hoverPoints,selectPoints:r4()}}),nC=Vt((K,V)=>{V.exports=rC()}),n4=Vt((K,V)=>{var u=Xr().extendFlat,d=fc().axisHoverFormat,E=r_(),A=Zg();function t(e){return{line:{color:u({},A.line.color,{dflt:e}),width:A.line.width,editType:"style"},fillcolor:A.fillcolor,editType:"style"}}V.exports={xperiod:E.xperiod,xperiod0:E.xperiod0,xperiodalignment:E.xperiodalignment,xhoverformat:d("x"),yhoverformat:d("y"),x:E.x,open:E.open,high:E.high,low:E.low,close:E.close,line:{width:u({},A.line.width,{}),editType:"style"},increasing:t(E.increasing.line.color.dflt),decreasing:t(E.decreasing.line.color.dflt),text:E.text,hovertext:E.hovertext,hovertemplate:E.hovertemplate,hovertemplatefallback:E.hovertemplatefallback,whiskerwidth:u({},A.whiskerwidth,{dflt:0}),hoverlabel:E.hoverlabel,zorder:A.zorder}}),aC=Vt((K,V)=>{var u=Xr(),d=Pi(),E=Q5(),A=tp(),t=n4();V.exports=function(r,i,n,o){function a(f,v){return u.coerce(r,i,t,f,v)}var s=E(r,i,a,o);if(!s){i.visible=!1;return}A(r,i,o,a,{x:!0}),a("xhoverformat"),a("yhoverformat"),a("line.width"),e(r,i,a,"increasing"),e(r,i,a,"decreasing"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("whiskerwidth"),o._requestRangeslider[i.xaxis]=!0,a("zorder")};function e(r,i,n,o){var a=n(o+".line.color");n(o+".line.width",i.line.width),n(o+".fillcolor",d.addOpacity(a,.5))}}),iC=Vt((K,V)=>{var u=Xr(),d=yo(),E=rp(),A=t4().calcCommon;V.exports=function(e,r){var i=e._fullLayout,n=d.getFromId(e,r.xaxis),o=d.getFromId(e,r.yaxis),a=n.makeCalcdata(r,"x"),s=E(r,n,"x",a).vals,f=A(e,r,a,s,o,t);return f.length?(u.extendFlat(f[0].t,{num:i._numBoxes,dPos:u.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),i._numBoxes++,f):[{t:{empty:!0}}]};function t(e,r,i,n){return{min:i,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:r}}}),oC=Vt((K,V)=>{V.exports={moduleType:"trace",name:"candlestick",basePlotModule:Kc(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:n4(),layoutAttributes:Kg(),supplyLayoutDefaults:h1().supplyLayoutDefaults,crossTraceCalc:p1().crossTraceCalc,supplyDefaults:aC(),calc:iC(),plot:d1().plot,layerName:"boxlayer",style:m1().style,hoverPoints:e4().hoverPoints,selectPoints:r4()}}),sC=Vt((K,V)=>{V.exports=oC()}),a4=Vt((K,V)=>{var u=Xr(),d=mp(),E=u.deg2rad,A=u.rad2deg;V.exports=function(n,o,a){switch(d(n,a),n._id){case"x":case"radialaxis":t(n,o);break;case"angularaxis":i(n,o);break}};function t(n,o){var a=o._subplot;n.setGeometry=function(){var s=n._rl[0],f=n._rl[1],v=a.innerRadius,g=(a.radius-v)/(f-s),m=v/g,w=s>f?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var x=n.c2l(l)-s;return(w(x)?x:0)+m},n.g2c=function(l){return n.l2c(l+s-m)},n.g2p=function(l){return l*g},n.c2p=function(l){return n.g2p(n.c2g(l))}}}function e(n,o){return o==="degrees"?E(n):n}function r(n,o){return o==="degrees"?A(n):n}function i(n,o){var a=n.type;if(a==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(v,g){return e(s(v),g)},n.c2d=function(v,g){return f(r(v,g))}}n.makeCalcdata=function(v,g){var m=v[g],w=v._length,l,x,y=function(c){return n.d2c(c,v.thetaunit)};if(m)for(l=new Array(w),x=0;x{V.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),a_=Vt((K,V)=>{var u=Xr(),d=jg().tester,E=u.findIndexOfMin,A=u.isAngleInsideSector,t=u.angleDelta,e=u.angleDist;function r(x,y,S,k,M){if(!A(y,k))return!1;var T,c;S[0]0?c:1/0},k=E(y,S),M=u.mod(k+1,y.length);return[y[k],y[M]]}function g(x){return Math.abs(x)>1e-10?x:0}function m(x,y,S){y=y||0,S=S||0;for(var k=x.length,M=new Array(k),T=0;T{function u(r){return r<0?-1:r>0?1:0}function d(r){var i=r[0],n=r[1];if(!isFinite(i)||!isFinite(n))return[1,0];var o=(i+1)*(i+1)+n*n;return[(i*i+n*n-1)/o,2*n/o]}function E(r,i){var n=i[0],o=i[1];return[n*r.radius+r.cx,-o*r.radius+r.cy]}function A(r,i){return i*r.radius}function t(r,i,n,o){var a=E(r,d([n,i])),s=a[0],f=a[1],v=E(r,d([o,i])),g=v[0],m=v[1];if(i===0)return["M"+s+","+f,"L"+g+","+m].join(" ");var w=A(r,1/Math.abs(i));return["M"+s+","+f,"A"+w+","+w+" 0 0,"+(i<0?1:0)+" "+g+","+m].join(" ")}function e(r,i,n,o){var a=A(r,1/(i+1)),s=E(r,d([i,n])),f=s[0],v=s[1],g=E(r,d([i,o])),m=g[0],w=g[1];if(u(n)!==u(o)){var l=E(r,d([i,0])),x=l[0],y=l[1];return["M"+f+","+v,"A"+a+","+a+" 0 0,"+(0{var u=Ni(),d=Af(),E=ji(),A=Xr(),t=A.strRotate,e=A.strTranslate,r=Pi(),i=Eo(),n=Uu(),o=yo(),a=mp(),s=a4(),f=Xh().doAutoRange,v=Cb(),g=oh(),m=hc(),w=l0(),l=Sc().prepSelect,x=Sc().selectOnClick,y=Sc().clearOutline,S=$h(),k=Bg(),M=Ng().redrawReglTraces,T=gf().MID_SHIFT,c=n_(),h=a_(),b=i4(),_=b.smith,P=b.reactanceArc,z=b.resistanceArc,D=b.smithTransform,B=A._,R=A.mod,I=A.deg2rad,F=A.rad2deg;function j(et,Z,ot){this.isSmith=ot||!1,this.id=Z,this.gd=et,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var X=et._fullLayout,Q="clip"+X._uid+Z;this.clipIds.forTraces=Q+"-for-traces",this.clipPaths.forTraces=X._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=X["_"+(ot?"smith":"polar")+"layer"].append("g").attr("class",Z),this.getHole=function(ut){return this.isSmith?0:ut.hole},this.getSector=function(ut){return this.isSmith?[0,360]:ut.sector},this.getRadial=function(ut){return this.isSmith?ut.realaxis:ut.radialaxis},this.getAngular=function(ut){return this.isSmith?ut.imaginaryaxis:ut.angularaxis},ot||(this.radialTickLayout=null,this.angularTickLayout=null)}var N=j.prototype;V.exports=function(et,Z,ot){return new j(et,Z,ot)},N.plot=function(et,Z){for(var ot=this,X=Z[ot.id],Q=!1,ut=0;utte?(Jt=nt,ee=nt*te,bt=(dt-ee)/Q.h/2,Zt=[q[0],q[1]],mt=[it[0]+bt,it[1]-bt]):(Jt=dt/te,ee=dt,bt=(nt-Jt)/Q.w/2,Zt=[q[0]+bt,q[1]-bt],mt=[it[0],it[1]]),ot.xLength2=Jt,ot.yLength2=ee,ot.xDomain2=Zt,ot.yDomain2=mt;var vt=ot.xOffset2=Q.l+Q.w*Zt[0],Ut=ot.yOffset2=Q.t+Q.h*(1-mt[1]),re=ot.radius=Jt/Ct,Kt=ot.innerRadius=ot.getHole(Z)*re,ue=ot.cx=vt-re*wt[0],Me=ot.cy=Ut+re*wt[3],Ce=ot.cxx=ue-vt,We=ot.cyy=Me-Ut,qe=ut.side,vr;qe==="counterclockwise"?(vr=qe,qe="top"):qe==="clockwise"&&(vr=qe,qe="bottom"),ot.radialAxis=ot.mockAxis(et,Z,ut,{_id:"x",side:qe,_trueSide:vr,domain:[Kt/Q.w,re/Q.w]}),ot.angularAxis=ot.mockAxis(et,Z,J,{side:"right",domain:[0,Math.PI],autorange:!1}),ot.doAutoRange(et,Z),ot.updateAngularAxis(et,Z),ot.updateRadialAxis(et,Z),ot.updateRadialAxisTitle(et,Z),ot.xaxis=ot.mockCartesianAxis(et,Z,{_id:"x",domain:Zt}),ot.yaxis=ot.mockCartesianAxis(et,Z,{_id:"y",domain:mt});var _r=ot.pathSubplot();ot.clipPaths.forTraces.select("path").attr("d",_r).attr("transform",e(Ce,We)),X.frontplot.attr("transform",e(vt,Ut)).call(i.setClipUrl,ot._hasClipOnAxisFalse?null:ot.clipIds.forTraces,ot.gd),X.bg.attr("d",_r).attr("transform",e(ue,Me)).call(r.fill,Z.bgcolor)},N.mockAxis=function(et,Z,ot,X){var Q=A.extendFlat({},ot,X);return s(Q,Z,et),Q},N.mockCartesianAxis=function(et,Z,ot){var X=this,Q=X.isSmith,ut=ot._id,J=A.extendFlat({type:"linear"},ot);a(J,et);var q={x:[0,2],y:[1,3]};return J.setRange=function(){var it=X.sectorBBox,nt=q[ut],dt=X.radialAxis._rl,Tt=(dt[1]-dt[0])/(1-X.getHole(Z));J.range=[it[nt[0]]*Tt,it[nt[1]]*Tt]},J.isPtWithinRange=ut==="x"&&!Q?function(it){return X.isPtInside(it)}:function(){return!0},J.setRange(),J.setScale(),J},N.doAutoRange=function(et,Z){var ot=this,X=ot.gd,Q=ot.radialAxis,ut=ot.getRadial(Z);f(X,Q);var J=Q.range;if(ut.range=J.slice(),ut._input.range=J.slice(),Q._rl=[Q.r2l(J[0],null,"gregorian"),Q.r2l(J[1],null,"gregorian")],Q.minallowed!==void 0){var q=Q.r2l(Q.minallowed);Q._rl[0]>Q._rl[1]?Q._rl[1]=Math.max(Q._rl[1],q):Q._rl[0]=Math.max(Q._rl[0],q)}if(Q.maxallowed!==void 0){var it=Q.r2l(Q.maxallowed);Q._rl[0]90&&dt<=270&&(Tt.tickangle=180);var It=Ct?function(re){var Kt=D(ot,_([re.x,0]));return e(Kt[0]-q,Kt[1]-it)}:function(re){return e(Tt.l2p(re.x)+J,0)},Nt=Ct?function(re){return z(ot,re.x,-1/0,1/0)}:function(re){return ot.pathArc(Tt.r2p(re.x)+J)},te=G(nt);if(ot.radialTickLayout!==te&&(Q["radial-axis"].selectAll(".xtick").remove(),ot.radialTickLayout=te),wt){Tt.setScale();var Jt=0,ee=Ct?(Tt.tickvals||[]).filter(function(re){return re>=0}).map(function(re){return o.tickText(Tt,re,!0,!1)}):o.calcTicks(Tt),Zt=Ct?ee:o.clipEnds(Tt,ee),mt=o.getTickSigns(Tt)[2];Ct&&((Tt.ticks==="top"&&Tt.side==="bottom"||Tt.ticks==="bottom"&&Tt.side==="top")&&(mt=-mt),Tt.ticks==="top"&&Tt.side==="top"&&(Jt=-Tt.ticklen),Tt.ticks==="bottom"&&Tt.side==="bottom"&&(Jt=Tt.ticklen)),o.drawTicks(X,Tt,{vals:ee,layer:Q["radial-axis"],path:o.makeTickPath(Tt,0,mt),transFn:It,crisp:!1}),o.drawGrid(X,Tt,{vals:Zt,layer:Q["radial-grid"],path:Nt,transFn:A.noop,crisp:!1}),o.drawLabels(X,Tt,{vals:ee,layer:Q["radial-axis"],transFn:It,labelFns:o.makeLabelFns(Tt,Jt)})}var bt=ot.radialAxisAngle=ot.vangles?F(ct(I(nt.angle),ot.vangles)):nt.angle,vt=e(q,it),Ut=vt+t(-bt);st(Q["radial-axis"],wt&&(nt.showticklabels||nt.ticks),{transform:Ut}),st(Q["radial-grid"],wt&&nt.showgrid,{transform:Ct?"":vt}),st(Q["radial-line"].select("line"),wt&&nt.showline,{x1:Ct?-ut:J,y1:0,x2:ut,y2:0,transform:Ut}).attr("stroke-width",nt.linewidth).call(r.stroke,nt.linecolor)},N.updateRadialAxisTitle=function(et,Z,ot){if(!this.isSmith){var X=this,Q=X.gd,ut=X.radius,J=X.cx,q=X.cy,it=X.getRadial(Z),nt=X.id+"title",dt=0;if(it.title){var Tt=i.bBox(X.layers["radial-axis"].node()).height,wt=it.title.font.size,Ct=it.side;dt=Ct==="top"?wt:Ct==="counterclockwise"?-(Tt+wt*.4):Tt+wt*.8}var It=ot!==void 0?ot:X.radialAxisAngle,Nt=I(It),te=Math.cos(Nt),Jt=Math.sin(Nt),ee=J+ut/2*te+dt*Jt,Zt=q-ut/2*Jt+dt*te;X.layers["radial-axis-title"]=w.draw(Q,nt,{propContainer:it,propName:X.id+".radialaxis.title.text",placeholder:B(Q,"Click to enter radial axis title"),attributes:{x:ee,y:Zt,"text-anchor":"middle"},transform:{rotate:-It}})}},N.updateAngularAxis=function(et,Z){var ot=this,X=ot.gd,Q=ot.layers,ut=ot.radius,J=ot.innerRadius,q=ot.cx,it=ot.cy,nt=ot.getAngular(Z),dt=ot.angularAxis,Tt=ot.isSmith;Tt||(ot.fillViewInitialKey("angularaxis.rotation",nt.rotation),dt.setGeometry(),dt.setScale());var wt=Tt?function(Kt){var ue=D(ot,_([0,Kt.x]));return Math.atan2(ue[0]-q,ue[1]-it)-Math.PI/2}:function(Kt){return dt.t2g(Kt.x)};dt.type==="linear"&&dt.thetaunit==="radians"&&(dt.tick0=F(dt.tick0),dt.dtick=F(dt.dtick));var Ct=function(Kt){return e(q+ut*Math.cos(Kt),it-ut*Math.sin(Kt))},It=Tt?function(Kt){var ue=D(ot,_([0,Kt.x]));return e(ue[0],ue[1])}:function(Kt){return Ct(wt(Kt))},Nt=Tt?function(Kt){var ue=D(ot,_([0,Kt.x])),Me=Math.atan2(ue[0]-q,ue[1]-it)-Math.PI/2;return e(ue[0],ue[1])+t(-F(Me))}:function(Kt){var ue=wt(Kt);return Ct(ue)+t(-F(ue))},te=Tt?function(Kt){return P(ot,Kt.x,0,1/0)}:function(Kt){var ue=wt(Kt),Me=Math.cos(ue),Ce=Math.sin(ue);return"M"+[q+J*Me,it-J*Ce]+"L"+[q+ut*Me,it-ut*Ce]},Jt=o.makeLabelFns(dt,0),ee=Jt.labelStandoff,Zt={};Zt.xFn=function(Kt){var ue=wt(Kt);return Math.cos(ue)*ee},Zt.yFn=function(Kt){var ue=wt(Kt),Me=Math.sin(ue)>0?.2:1;return-Math.sin(ue)*(ee+Kt.fontSize*Me)+Math.abs(Math.cos(ue))*(Kt.fontSize*T)},Zt.anchorFn=function(Kt){var ue=wt(Kt),Me=Math.cos(ue);return Math.abs(Me)<.1?"middle":Me>0?"start":"end"},Zt.heightFn=function(Kt,ue,Me){var Ce=wt(Kt);return-.5*(1+Math.sin(Ce))*Me};var mt=G(nt);ot.angularTickLayout!==mt&&(Q["angular-axis"].selectAll("."+dt._id+"tick").remove(),ot.angularTickLayout=mt);var bt=Tt?[1/0].concat(dt.tickvals||[]).map(function(Kt){return o.tickText(dt,Kt,!0,!1)}):o.calcTicks(dt);Tt&&(bt[0].text="∞",bt[0].fontSize*=1.75);var vt;if(Z.gridshape==="linear"?(vt=bt.map(wt),A.angleDelta(vt[0],vt[1])<0&&(vt=vt.slice().reverse())):vt=null,ot.vangles=vt,dt.type==="category"&&(bt=bt.filter(function(Kt){return A.isAngleInsideSector(wt(Kt),ot.sectorInRad)})),dt.visible){var Ut=dt.ticks==="inside"?-1:1,re=(dt.linewidth||1)/2;o.drawTicks(X,dt,{vals:bt,layer:Q["angular-axis"],path:"M"+Ut*re+",0h"+Ut*dt.ticklen,transFn:Nt,crisp:!1}),o.drawGrid(X,dt,{vals:bt,layer:Q["angular-grid"],path:te,transFn:A.noop,crisp:!1}),o.drawLabels(X,dt,{vals:bt,layer:Q["angular-axis"],repositionOnUpdate:!0,transFn:It,labelFns:Zt})}st(Q["angular-line"].select("path"),nt.showline,{d:ot.pathSubplot(),transform:e(q,it)}).attr("stroke-width",nt.linewidth).call(r.stroke,nt.linecolor)},N.updateFx=function(et,Z){if(!this.gd._context.staticPlot){var ot=!this.isSmith;ot&&(this.updateAngularDrag(et),this.updateRadialDrag(et,Z,0),this.updateRadialDrag(et,Z,1)),this.updateHoverAndMainDrag(et)}},N.updateHoverAndMainDrag=function(et){var Z=this,ot=Z.isSmith,X=Z.gd,Q=Z.layers,ut=et._zoomlayer,J=c.MINZOOM,q=c.OFFEDGE,it=Z.radius,nt=Z.innerRadius,dt=Z.cx,Tt=Z.cy,wt=Z.cxx,Ct=Z.cyy,It=Z.sectorInRad,Nt=Z.vangles,te=Z.radialAxis,Jt=h.clampTiny,ee=h.findXYatLength,Zt=h.findEnclosingVertexAngles,mt=c.cornerHalfWidth,bt=c.cornerLen/2,vt,Ut,re=v.makeDragger(Q,"path","maindrag",et.dragmode===!1?"none":"crosshair");u.select(re).attr("d",Z.pathSubplot()).attr("transform",e(dt,Tt)),re.onmousemove=function(ar){m.hover(X,ar,Z.id),X._fullLayout._lasthover=re,X._fullLayout._hoversubplot=Z.id},re.onmouseout=function(ar){X._dragging||g.unhover(X,ar)};var Kt={element:re,gd:X,subplot:Z.id,plotinfo:{id:Z.id,xaxis:Z.xaxis,yaxis:Z.yaxis},xaxes:[Z.xaxis],yaxes:[Z.yaxis]},ue,Me,Ce,We,qe,vr,_r,er,Mr;function Ir(ar,Ye){return Math.sqrt(ar*ar+Ye*Ye)}function de(ar,Ye){return Ir(ar-wt,Ye-Ct)}function Dt(ar,Ye){return Math.atan2(Ct-Ye,ar-wt)}function qt(ar,Ye){return[ar*Math.cos(Ye),ar*Math.sin(-Ye)]}function _t(ar,Ye){if(ar===0)return Z.pathSector(2*mt);var Er=bt/ar,pn=Ye-Er,dn=Ye+Er,bn=Math.max(0,Math.min(ar,it)),Zn=bn-mt,En=bn+mt;return"M"+qt(Zn,pn)+"A"+[Zn,Zn]+" 0,0,0 "+qt(Zn,dn)+"L"+qt(En,dn)+"A"+[En,En]+" 0,0,1 "+qt(En,pn)+"Z"}function lt(ar,Ye,Er){if(ar===0)return Z.pathSector(2*mt);var pn=qt(ar,Ye),dn=qt(ar,Er),bn=Jt((pn[0]+dn[0])/2),Zn=Jt((pn[1]+dn[1])/2),En,gn;if(bn&&Zn){var da=Zn/bn,ra=-1/da,Se=ee(mt,da,bn,Zn);En=ee(bt,ra,Se[0][0],Se[0][1]),gn=ee(bt,ra,Se[1][0],Se[1][1])}else{var Re,Ze;Zn?(Re=bt,Ze=mt):(Re=mt,Ze=bt),En=[[bn-Re,Zn-Ze],[bn+Re,Zn-Ze]],gn=[[bn-Re,Zn+Ze],[bn+Re,Zn+Ze]]}return"M"+En.join("L")+"L"+gn.reverse().join("L")+"Z"}function yt(){Ce=null,We=null,qe=Z.pathSubplot(),vr=!1;var ar=X._fullLayout[Z.id];_r=d(ar.bgcolor).getLuminance(),er=v.makeZoombox(ut,_r,dt,Tt,qe),er.attr("fill-rule","evenodd"),Mr=v.makeCorners(ut,dt,Tt),y(X)}function St(ar,Ye){return Ye=Math.max(Math.min(Ye,it),nt),arJ?(ar-1&&ar===1&&x(Ye,X,[Z.xaxis],[Z.yaxis],Z.id,Kt),Er.indexOf("event")>-1&&m.click(X,Ye,Z.id)}Kt.prepFn=function(ar,Ye,Er){var pn=X._fullLayout.dragmode,dn=re.getBoundingClientRect();X._fullLayout._calcInverseTransform(X);var bn=X._fullLayout._invTransform;vt=X._fullLayout._invScaleX,Ut=X._fullLayout._invScaleY;var Zn=A.apply3DTransform(bn)(Ye-dn.left,Er-dn.top);if(ue=Zn[0],Me=Zn[1],Nt){var En=h.findPolygonOffset(it,It[0],It[1],Nt);ue+=wt+En[0],Me+=Ct+En[1]}switch(pn){case"zoom":Kt.clickFn=ir,ot||(Nt?Kt.moveFn=ke:Kt.moveFn=Yt,Kt.doneFn=Ee,yt());break;case"select":case"lasso":l(ar,Ye,Er,Kt,pn);break}},g.init(Kt)},N.updateRadialDrag=function(et,Z,ot){var X=this,Q=X.gd,ut=X.layers,J=X.radius,q=X.innerRadius,it=X.cx,nt=X.cy,dt=X.radialAxis,Tt=c.radialDragBoxSize,wt=Tt/2;if(!dt.visible)return;var Ct=I(X.radialAxisAngle),It=dt._rl,Nt=It[0],te=It[1],Jt=It[ot],ee=.75*(It[1]-It[0])/(1-X.getHole(Z))/J,Zt,mt,bt;ot?(Zt=it+(J+wt)*Math.cos(Ct),mt=nt-(J+wt)*Math.sin(Ct),bt="radialdrag"):(Zt=it+(q-wt)*Math.cos(Ct),mt=nt-(q-wt)*Math.sin(Ct),bt="radialdrag-inner");var vt=v.makeRectDragger(ut,bt,"crosshair",-wt,-wt,Tt,Tt),Ut={element:vt,gd:Q};et.dragmode===!1&&(Ut.dragmode=!1),st(u.select(vt),dt.visible&&q0!=(ot?ue>Nt:ue=90||Q>90&&ut>=450?Ct=1:q<=0&&nt<=0?Ct=0:Ct=Math.max(q,nt),Q<=180&&ut>=180||Q>180&&ut>=540?dt=-1:J>=0&&it>=0?dt=0:dt=Math.min(J,it),Q<=270&&ut>=270||Q>270&&ut>=630?Tt=-1:q>=0&&nt>=0?Tt=0:Tt=Math.min(q,nt),ut>=360?wt=1:J<=0&&it<=0?wt=0:wt=Math.max(J,it),[dt,Tt,wt,Ct]}function ct(et,Z){var ot=function(Q){return A.angleDist(et,Q)},X=A.findIndexOfMin(Z,ot);return Z[X]}function st(et,Z,ot){return Z?(et.attr("display",null),et.attr(ot)):et&&et.attr("display","none"),et}}),s4=Vt((K,V)=>{var u=af(),d=Of(),E=Vu().attributes,A=Xr().extendFlat,t=Cu().overrideAll,e=t({color:d.color,showline:A({},d.showline,{dflt:!0}),linecolor:d.linecolor,linewidth:d.linewidth,showgrid:A({},d.showgrid,{dflt:!0}),gridcolor:d.gridcolor,gridwidth:d.gridwidth,griddash:d.griddash},"plot","from-root"),r=t({tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,ticklabelstep:d.ticklabelstep,showticklabels:d.showticklabels,labelalias:d.labelalias,minorloglabels:d.minorloglabels,showtickprefix:d.showtickprefix,tickprefix:d.tickprefix,showticksuffix:d.showticksuffix,ticksuffix:d.ticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,minexponent:d.minexponent,separatethousands:d.separatethousands,tickfont:d.tickfont,tickangle:d.tickangle,tickformat:d.tickformat,tickformatstops:d.tickformatstops,layer:d.layer},"plot","from-root"),i={visible:A({},d.visible,{dflt:!0}),type:A({},d.type,{values:["-","linear","log","date","category"]}),autotypenumbers:d.autotypenumbers,autorangeoptions:{minallowed:d.autorangeoptions.minallowed,maxallowed:d.autorangeoptions.maxallowed,clipmin:d.autorangeoptions.clipmin,clipmax:d.autorangeoptions.clipmax,include:d.autorangeoptions.include,editType:"plot"},autorange:A({},d.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:A({},d.minallowed,{editType:"plot"}),maxallowed:A({},d.maxallowed,{editType:"plot"}),range:A({},d.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:d.categoryorder,categoryarray:d.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:d.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:A({},d.title.text,{editType:"plot",dflt:""}),font:A({},d.title.font,{editType:"plot"}),editType:"plot"},hoverformat:d.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};A(i,e,r);var n={visible:A({},d.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:d.autotypenumbers,categoryorder:d.categoryorder,categoryarray:d.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:d.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};A(n,e,r),V.exports={domain:E({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:u.background},radialaxis:i,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),lC=Vt((K,V)=>{var u=Xr(),d=Pi(),E=cl(),A=Ld(),t=Pf().getSubplotData,e=s0(),r=_m(),i=kd(),n=Ad(),o=e1(),a=Hg(),s=hb(),f=wm(),v=s4(),g=a4(),m=n_(),w=m.axisNames;function l(y,S,k,M){var T=k("bgcolor");M.bgColor=d.combine(T,M.paper_bgcolor);var c=k("sector");k("hole");var h=t(M.fullData,m.name,M.id),b=M.layoutOut,_;function P(Tt,wt){return k(_+"."+Tt,wt)}for(var z=0;z{var u=Pf().getSubplotCalcData,d=Xr().counterRegex,E=o4(),A=n_(),t=A.attr,e=A.name,r=d(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,f=a.calcdata,v=s._subplots[e],g=0;g{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=So().extendFlat,t=Qh(),e=pc(),r=kl(),i=e.line;V.exports={mode:e.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:d({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:A({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:A({},r.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:e.hoveron,hovertemplate:u(),hovertemplatefallback:E(),selected:e.selected,unselected:e.unselected}}),o_=Vt((K,V)=>{var u=Xr(),d=nu(),E=Ch(),A=Rh(),t=Am(),e=Nh(),r=ep(),i=gp().PTS_LINESONLY,n=Bv();function o(s,f,v,g){function m(x,y){return u.coerce(s,f,n,x,y)}var w=a(s,f,g,m);if(!w){f.visible=!1;return}m("thetaunit"),m("mode",w{var u=Xr(),d=yo();V.exports=function(E,A,t){var e={},r=t[A.subplot]._subplot,i,n;r?(i=r.radialAxis,n=r.angularAxis):(r=t[A.subplot],i=r.radialaxis,n=r.angularaxis);var o=i.c2l(E.r);e.rLabel=d.tickText(i,o,!0).text;var a=n.thetaunit==="degrees"?u.rad2deg(E.theta):E.theta;return e.thetaLabel=d.tickText(n,a,!0).text,e}}),uC=Vt((K,V)=>{var u=Lo(),d=ks().BADNUM,E=yo(),A=jh(),t=vp(),e=Uh(),r=Vh().calcMarkerSize;V.exports=function(i,n){for(var o=i._fullLayout,a=n.subplot,s=o[a].radialaxis,f=o[a].angularaxis,v=s.makeCalcdata(n,"r"),g=f.makeCalcdata(n,"theta"),m=n._length,w=new Array(m),l=0;l{var u=Mm(),d=ks().BADNUM;V.exports=function(E,A,t){for(var e=A.layers.frontplot.select("g.scatterlayer"),r=A.xaxis,i=A.yaxis,n={xaxis:r,yaxis:i,plot:A.framework,layerClipId:A._hasClipOnAxisFalse?A.clipIds.forTraces:null},o=A.radialAxis,a=A.angularAxis,s=0;s{var u=Em();function d(A,t,e,r){var i=u(A,t,e,r);if(!(!i||i[0].index===!1)){var n=i[0];if(n.index===void 0)return i;var o=A.subplot,a=n.cd[n.index],s=n.trace;if(o.isPtInside(a))return n.xLabelVal=void 0,n.yLabelVal=void 0,E(a,s,o,n),n.hovertemplate=s.hovertemplate,i}}function E(A,t,e,r){var i=e.radialAxis,n=e.angularAxis;i._hovertitle="r",n._hovertitle="θ";var o={};o[t.subplot]={_subplot:e};var a=t._module.formatLabels(A,t,o);r.rLabel=a.rLabel,r.thetaLabel=a.thetaLabel;var s=A.hi||t.hoverinfo,f=[];function v(m,w){f.push(m._hovertitle+": "+w)}if(!t.hovertemplate){var g=s.split("+");g.indexOf("all")!==-1&&(g=["r","theta","text"]),g.indexOf("r")!==-1&&v(i,r.rLabel),g.indexOf("theta")!==-1&&v(n,r.thetaLabel),g.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("
                ")}}V.exports={hoverPoints:d,makeHoverPointText:E}}),fC=Vt((K,V)=>{V.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:i_(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Bv(),supplyDefaults:o_().supplyDefaults,colorbar:Zf(),formatLabels:s_(),calc:uC(),plot:cC(),style:gh().style,styleOnSelect:gh().styleOnSelect,hoverPoints:l_().hoverPoints,selectPoints:zm(),meta:{}}}),hC=Vt((K,V)=>{V.exports=fC()}),l4=Vt((K,V)=>{var u=Bv(),{cliponaxis:d,hoveron:E}=u,A=V4(u,["cliponaxis","hoveron"]),{connectgaps:t,line:{color:e,dash:r,width:i},fill:n,fillcolor:o,marker:a,textfont:s,textposition:f}=Ev();V.exports=hm(vd({},A),{connectgaps:t,fill:n,fillcolor:o,line:{color:e,dash:r,editType:"calc",width:i},marker:a,textfont:s,textposition:f})}),pC=Vt((K,V)=>{var u=Xr(),d=nu(),E=o_().handleRThetaDefaults,A=Ch(),t=Rh(),e=Nh(),r=ep(),i=gp().PTS_LINESONLY,n=l4();V.exports=function(o,a,s,f){function v(m,w){return u.coerce(o,a,n,m,w)}var g=E(o,a,f,v);if(!g){a.visible=!1;return}v("thetaunit"),v("mode",g{var u=s_();V.exports=function(d,E,A){var t=d.i;return"r"in d||(d.r=E._r[t]),"theta"in d||(d.theta=E._theta[t]),u(d,E,A)}}),mC=Vt((K,V)=>{var u=jh(),d=Vh().calcMarkerSize,E=C0(),A=yo(),t=Vd().TOO_MANY_POINTS;V.exports=function(e,r){var i=e._fullLayout,n=r.subplot,o=i[n].radialaxis,a=i[n].angularaxis,s=r._r=o.makeCalcdata(r,"r"),f=r._theta=a.makeCalcdata(r,"theta"),v=r._length,g={};v{var u=Fx(),d=l_().makeHoverPointText;function E(A,t,e,r){var i=A.cd,n=i[0].t,o=n.r,a=n.theta,s=u.hoverPoints(A,t,e,r);if(!(!s||s[0].index===!1)){var f=s[0];if(f.index===void 0)return s;var v=A.subplot,g=f.cd[f.index],m=f.trace;if(g.r=o[f.index],g.theta=a[f.index],!!v.isPtInside(g))return f.xLabelVal=void 0,f.yLabelVal=void 0,d(g,m,v,f),s}}V.exports={hoverPoints:E}}),vC=Vt((K,V)=>{V.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:i_(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:l4(),supplyDefaults:pC(),colorbar:Zf(),formatLabels:dC(),calc:mC(),hoverPoints:gC().hoverPoints,selectPoints:H3(),meta:{}}}),yC=Vt((K,V)=>{var u=Rx(),d=Lo(),E=p5(),A=U3(),t=C0(),e=Xr(),r=Vd().TOO_MANY_POINTS,i={};V.exports=function(n,o,a){if(a.length){var s=o.radialAxis,f=o.angularAxis,v=A(n,o);return a.forEach(function(g){if(!(!g||!g[0]||!g[0].trace)){var m=g[0],w=m.trace,l=m.t,x=w._length,y=l.r,S=l.theta,k=l.opts,M,T=y.slice(),c=S.slice();for(M=0;M=r&&(k.marker.cluster=l.tree),k.marker&&(k.markerSel.positions=k.markerUnsel.positions=k.marker.positions=h),k.line&&h.length>1&&e.extendFlat(k.line,t.linePositions(n,w,h)),k.text&&(e.extendFlat(k.text,{positions:h},t.textPosition(n,w,k.text,k.marker)),e.extendFlat(k.textSel,{positions:h},t.textPosition(n,w,k.text,k.markerSel)),e.extendFlat(k.textUnsel,{positions:h},t.textPosition(n,w,k.text,k.markerUnsel))),k.fill&&!v.fill2d&&(v.fill2d=!0),k.marker&&!v.scatter2d&&(v.scatter2d=!0),k.line&&!v.line2d&&(v.line2d=!0),k.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(k.line),v.fillOptions.push(k.fill),v.markerOptions.push(k.marker),v.markerSelectedOptions.push(k.markerSel),v.markerUnselectedOptions.push(k.markerUnsel),v.textOptions.push(k.text),v.textSelectedOptions.push(k.textSel),v.textUnselectedOptions.push(k.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),l.x=b,l.y=_,l.rawx=b,l.rawy=_,l.r=y,l.theta=S,l.positions=h,l._scene=v,l.index=v.count,v.count++}}),E(n,o,a)}},V.exports.reglPrecompiled=i}),xC=Vt((K,V)=>{var u=vC();u.plot=yC(),V.exports=u}),_C=Vt((K,V)=>{V.exports=xC()}),u4=Vt((K,V)=>{var{hovertemplateAttrs:u,templatefallbackAttrs:d}=yl(),E=So().extendFlat,A=Bv(),t=yp();V.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:E({},t.base,{}),offset:E({},t.offset,{}),width:E({},t.width,{}),text:E({},t.text,{}),hovertext:E({},t.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:u(),hovertemplatefallback:d(),selected:t.selected,unselected:t.unselected};function e(){var r=E({},t.marker);return delete r.cornerradius,r}}),c4=Vt((K,V)=>{V.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),bC=Vt((K,V)=>{var u=Xr(),d=o_().handleRThetaDefaults,E=c1(),A=u4();V.exports=function(t,e,r,i){function n(a,s){return u.coerce(t,e,A,a,s)}var o=d(t,e,i,n);if(!o){e.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),E(t,e,n,r,i),u.coerceSelectionMarkerOpacity(e,n)}}),wC=Vt((K,V)=>{var u=Xr(),d=c4();V.exports=function(E,A,t){var e={},r;function i(a,s){return u.coerce(E[r]||{},A[r],d,a,s)}for(var n=0;n{var u=ah().hasColorscale,d=ih(),E=Xr().isArrayOrTypedArray,A=Gg(),t=h0().setGroupPositions,e=Uh(),r=ji().traceIs,i=Xr().extendFlat;function n(a,s){for(var f=a._fullLayout,v=s.subplot,g=f[v].radialaxis,m=f[v].angularaxis,w=g.makeCalcdata(s,"r"),l=m.makeCalcdata(s,"theta"),x=s._length,y=new Array(x),S=w,k=l,M=0;M{var u=Ni(),d=Lo(),E=Xr(),A=Eo(),t=a_();V.exports=function(r,i,n){var o=r._context.staticPlot,a=i.xaxis,s=i.yaxis,f=i.radialAxis,v=i.angularAxis,g=e(i),m=i.layers.frontplot.select("g.barlayer");E.makeTraceGroups(m,n,"trace bars").each(function(){var w=u.select(this),l=E.ensureSingle(w,"g","points"),x=l.selectAll("g.point").data(E.identity);x.enter().append("g").style("vector-effect",o?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),x.exit().remove(),x.each(function(y){var S=u.select(this),k=y.rp0=f.c2p(y.s0),M=y.rp1=f.c2p(y.s1),T=y.thetag0=v.c2g(y.p0),c=y.thetag1=v.c2g(y.p1),h;if(!d(k)||!d(M)||!d(T)||!d(c)||k===M||T===c)h="M0,0Z";else{var b=f.c2g(y.s1),_=(T+c)/2;y.ct=[a.c2p(b*Math.cos(_)),s.c2p(b*Math.sin(_))],h=g(k,M,T,c)}E.ensureSingle(S,"path").attr("d",h)}),A.setClipUrl(w,i._hasClipOnAxisFalse?i.clipIds.forTraces:null,r)})};function e(r){var i=r.cxx,n=r.cyy;return r.vangles?function(o,a,s,f){var v,g;E.angleDelta(s,f)>0?(v=s,g=f):(v=f,g=s);var m=t.findEnclosingVertexAngles(v,r.vangles)[0],w=t.findEnclosingVertexAngles(g,r.vangles)[1],l=[m,(v+g)/2,w];return t.pathPolygonAnnulus(o,a,v,g,l,i,n)}:function(o,a,s,f){return E.pathAnnulus(o,a,s,f,i,n)}}}),kC=Vt((K,V)=>{var u=hc(),d=Xr(),E=Lm().getTraceColor,A=d.fillText,t=l_().makeHoverPointText,e=a_().isPtInsidePolygon;V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.subplot,f=s.radialAxis,v=s.angularAxis,g=s.vangles,m=g?e:d.isPtInsideSector,w=r.maxHoverDistance,l=v._period||2*Math.PI,x=Math.abs(f.g2p(Math.sqrt(i*i+n*n))),y=Math.atan2(n,i);f.range[0]>f.range[1]&&(y+=Math.PI);var S=function(c){return m(x,y,[c.rp0,c.rp1],[c.thetag0,c.thetag1],g)?w+Math.min(1,Math.abs(c.thetag1-c.thetag0)/l)-1+(c.rp1-x)/(c.rp1-c.rp0)-1:1/0};if(u.getClosest(o,S,r),r.index!==!1){var k=r.index,M=o[k];r.x0=r.x1=M.ct[0],r.y0=r.y1=M.ct[1];var T=d.extendFlat({},M,{r:M.s,theta:M.p});return A(M,a,r),t(T,a,s,r),r.hovertemplate=a.hovertemplate,r.color=E(a,M),r.xLabelVal=r.yLabelVal=void 0,M.s<0&&(r.idealAlign="left"),[r]}}}),AC=Vt((K,V)=>{V.exports={moduleType:"trace",name:"barpolar",basePlotModule:i_(),categories:["polar","bar","showLegend"],attributes:u4(),layoutAttributes:c4(),supplyDefaults:bC(),supplyLayoutDefaults:wC(),calc:f4().calc,crossTraceCalc:f4().crossTraceCalc,plot:TC(),colorbar:Zf(),formatLabels:s_(),style:Hh().style,styleOnSelect:Hh().styleOnSelect,hoverPoints:kC(),selectPoints:Cm(),meta:{}}}),MC=Vt((K,V)=>{V.exports=AC()}),h4=Vt((K,V)=>{V.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),p4=Vt((K,V)=>{var u=af(),d=Of(),E=Vu().attributes,A=Xr().extendFlat,t=Cu().overrideAll,e=t({color:d.color,showline:A({},d.showline,{dflt:!0}),linecolor:d.linecolor,linewidth:d.linewidth,showgrid:A({},d.showgrid,{dflt:!0}),gridcolor:d.gridcolor,gridwidth:d.gridwidth,griddash:d.griddash},"plot","from-root"),r=t({ticklen:d.ticklen,tickwidth:A({},d.tickwidth,{dflt:2}),tickcolor:d.tickcolor,showticklabels:d.showticklabels,labelalias:d.labelalias,showtickprefix:d.showtickprefix,tickprefix:d.tickprefix,showticksuffix:d.showticksuffix,ticksuffix:d.ticksuffix,tickfont:d.tickfont,tickformat:d.tickformat,hoverformat:d.hoverformat,layer:d.layer},"plot","from-root"),i=A({visible:A({},d.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:A({},d.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},e,r),n=A({visible:A({},d.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:d.ticks,editType:"calc"},e,r);V.exports={domain:E({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:u.background},realaxis:i,imaginaryaxis:n,editType:"calc"}}),SC=Vt((K,V)=>{var u=Xr(),d=Pi(),E=cl(),A=Ld(),t=Pf().getSubplotData,e=Ad(),r=kd(),i=Hg(),n=mp(),o=p4(),a=h4(),s=a.axisNames,f=g(function(m){return u.isTypedArray(m)&&(m=Array.from(m)),m.slice().reverse().map(function(w){return-w}).concat([0]).concat(m)},String);function v(m,w,l,x){var y=l("bgcolor");x.bgColor=d.combine(y,x.paper_bgcolor);var S=t(x.fullData,a.name,x.id),k=x.layoutOut,M;function T(N,G){return l(M+"."+N,G)}for(var c=0;c{var u=Pf().getSubplotCalcData,d=Xr().counterRegex,E=o4(),A=h4(),t=A.attr,e=A.name,r=d(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,f=a.calcdata,v=s._subplots[e],g=0;g{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=yl(),A=So().extendFlat,t=Qh(),e=pc(),r=kl(),i=e.line;V.exports={mode:e.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:d({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:A({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:A({},r.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:e.hoveron,hovertemplate:u(),hovertemplatefallback:E(),selected:e.selected,unselected:e.unselected}}),zC=Vt((K,V)=>{var u=Xr(),d=nu(),E=Ch(),A=Rh(),t=Am(),e=Nh(),r=ep(),i=gp().PTS_LINESONLY,n=d4();V.exports=function(a,s,f,v){function g(l,x){return u.coerce(a,s,n,l,x)}var m=o(a,s,v,g);if(!m){s.visible=!1;return}g("mode",m{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot;return t.realLabel=u.tickText(e.radialAxis,d.real,!0).text,t.imagLabel=u.tickText(e.angularAxis,d.imag,!0).text,t}}),CC=Vt((K,V)=>{var u=Lo(),d=ks().BADNUM,E=jh(),A=vp(),t=Uh(),e=Vh().calcMarkerSize;V.exports=function(r,i){for(var n=r._fullLayout,o=i.subplot,a=n[o].realaxis,s=n[o].imaginaryaxis,f=a.makeCalcdata(i,"real"),v=s.makeCalcdata(i,"imag"),g=i._length,m=new Array(g),w=0;w{var u=Mm(),d=ks().BADNUM,E=i4(),A=E.smith;V.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),n=e.xaxis,o=e.yaxis,a={xaxis:n,yaxis:o,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=0;s{var u=Em();function d(A,t,e,r){var i=u(A,t,e,r);if(!(!i||i[0].index===!1)){var n=i[0];if(n.index===void 0)return i;var o=A.subplot,a=n.cd[n.index],s=n.trace;if(o.isPtInside(a))return n.xLabelVal=void 0,n.yLabelVal=void 0,E(a,s,o,n),n.hovertemplate=s.hovertemplate,i}}function E(A,t,e,r){var i=e.radialAxis,n=e.angularAxis;i._hovertitle="real",n._hovertitle="imag";var o={};o[t.subplot]={_subplot:e};var a=t._module.formatLabels(A,t,o);r.realLabel=a.realLabel,r.imagLabel=a.imagLabel;var s=A.hi||t.hoverinfo,f=[];function v(m,w){f.push(m._hovertitle+": "+w)}if(!t.hovertemplate){var g=s.split("+");g.indexOf("all")!==-1&&(g=["real","imag","text"]),g.indexOf("real")!==-1&&v(i,r.realLabel),g.indexOf("imag")!==-1&&v(n,r.imagLabel),g.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("
                ")}}V.exports={hoverPoints:d,makeHoverPointText:E}}),OC=Vt((K,V)=>{V.exports={moduleType:"trace",name:"scattersmith",basePlotModule:EC(),categories:["smith","symbols","showLegend","scatter-like"],attributes:d4(),supplyDefaults:zC(),colorbar:Zf(),formatLabels:LC(),calc:CC(),plot:IC(),style:gh().style,styleOnSelect:gh().styleOnSelect,hoverPoints:PC().hoverPoints,selectPoints:zm(),meta:{}}}),DC=Vt((K,V)=>{V.exports=OC()}),lh=Vt((K,V)=>{var u=of();function d(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}u(d.prototype,{instance:function(i,n){i=(i||"gregorian").toLowerCase(),n=n||"";var o=this._localCals[i+"-"+n];if(!o&&this.calendars[i]&&(o=new this.calendars[i](n),this._localCals[i+"-"+n]=o),!o)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,i);return o},newDate:function(i,n,o,a,s){return a=(i!=null&&i.year?i.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(i,n,o)},substituteDigits:function(i){return function(n){return(n+"").replace(/[0-9]/g,function(o){return i[o]})}},substituteChineseDigits:function(i,n){return function(o){for(var a="",s=0;o>0;){var f=o%10;a=(f===0?"":i[f]+n[s])+a,s++,o=Math.floor(o/10)}return a.indexOf(i[1]+n[1])===0&&(a=a.substr(1)),a||i[0]}}});function E(i,n,o,a){if(this._calendar=i,this._year=n,this._month=o,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function A(i,n){return i=""+i,"000000".substring(0,n-i.length)+i}u(E.prototype,{newDate:function(i,n,o){return this._calendar.newDate(i??this,n,o)},year:function(i){return arguments.length===0?this._year:this.set(i,"y")},month:function(i){return arguments.length===0?this._month:this.set(i,"m")},day:function(i){return arguments.length===0?this._day:this.set(i,"d")},date:function(i,n,o){if(!this._calendar.isValid(i,n,o))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=i,this._month=n,this._day=o,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(i,n){return this._calendar.add(this,i,n)},set:function(i,n){return this._calendar.set(this,i,n)},compareTo:function(i){if(this._calendar.name!==i._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,i._calendar.local.name);var n=this._year!==i._year?this._year-i._year:this._month!==i._month?this.monthOfYear()-i.monthOfYear():this._day-i._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(i){return this._calendar.fromJD(i)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(i){return this._calendar.fromJSDate(i)},toString:function(){return(this.year()<0?"-":"")+A(Math.abs(this.year()),4)+"-"+A(this.month(),2)+"-"+A(this.day(),2)}});function t(){this.shortYearCutoff="+10"}u(t.prototype,{_validateLevel:0,newDate:function(i,n,o){return i==null?this.today():(i.year&&(this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),o=i.day(),n=i.month(),i=i.year()),new E(this,i,n,o))},today:function(){return this.fromJSDate(new Date)},epoch:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+A(Math.abs(n.year()),4)},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(i,n){var o=this._validate(i,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(o.month()+this.monthsInYear(o)-this.firstMonth)%this.monthsInYear(o)+this.minMonth},fromMonthOfYear:function(i,n){var o=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(i)+this.minMonth;return this._validate(i,o,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),o},daysInYear:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(i,n,o){return this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(i,n,o){return this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(i,this._add(i,n,o),n,o)},_add:function(i,n,o){if(this._validateLevel++,o==="d"||o==="w"){var a=i.toJD()+n*(o==="w"?this.daysInWeek():1),s=i.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var f=i.year()+(o==="y"?n:0),v=i.monthOfYear()+(o==="m"?n:0),s=i.day(),g=function(l){for(;vx-1+l.minMonth;)f++,v-=x,x=l.monthsInYear(f)};o==="y"?(i.month()!==this.fromMonthOfYear(f,v)&&(v=this.newDate(f,i.month(),this.minDay).monthOfYear()),v=Math.min(v,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,v)))):o==="m"&&(g(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,v))));var m=[f,this.fromMonthOfYear(f,v),s];return this._validateLevel--,m}catch(w){throw this._validateLevel--,w}},_correctAdd:function(i,n,o,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(n[0]===0||i.year()>0!=n[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],f=o<0?-1:1;n=this._add(i,o*s[0]+f*s[1],s[2])}return i.date(n[0],n[1],n[2])},set:function(i,n,o){this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=o==="y"?n:i.year(),s=o==="m"?n:i.month(),f=o==="d"?n:i.day();return(o==="y"||o==="m")&&(f=Math.min(f,this.daysInMonth(a,s))),i.date(a,s,f)},isValid:function(i,n,o){this._validateLevel++;var a=this.hasYearZero||i!==0;if(a){var s=this.newDate(i,n,this.minDay);a=n>=this.minMonth&&n-this.minMonth=this.minDay&&o-this.minDay13.5?13:1),w=s-(m>2.5?4716:4715);return w<=0&&w--,this.newDate(w,m,g)},toJSDate:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(i){return this.newDate(i.getFullYear(),i.getMonth()+1,i.getDate())}});var r=V.exports=new d;r.cdate=E,r.baseCalendar=t,r.calendars.gregorian=e}),FC=Vt(()=>{var K=of(),V=lh();K(V.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),V.local=V.regionalOptions[""],K(V.cdate.prototype,{formatDate:function(u,d){return typeof u!="string"&&(d=u,u=""),this._calendar.formatDate(u||"",this,d)}}),K(V.baseCalendar.prototype,{UNIX_EPOCH:V.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:V.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(u,d,E){if(typeof u!="string"&&(E=d,d=u,u=""),!d)return"";if(d.calendar()!==this)throw V.local.invalidFormat||V.regionalOptions[""].invalidFormat;u=u||this.local.dateFormat,E=E||{};for(var A=E.dayNamesShort||this.local.dayNamesShort,t=E.dayNames||this.local.dayNames,e=E.monthNumbers||this.local.monthNumbers,r=E.monthNamesShort||this.local.monthNamesShort,i=E.monthNames||this.local.monthNames,n=E.calculateWeek||this.local.calculateWeek,o=function(S,k){for(var M=1;y+M1},a=function(S,k,M,T){var c=""+k;if(o(S,T))for(;c.length1},x=function(P,z){var D=l(P,z),B=[2,3,D?4:2,D?4:2,10,11,20]["oyYJ@!".indexOf(P)+1],R=new RegExp("^-?\\d{1,"+B+"}"),I=d.substring(c).match(R);if(!I)throw(V.local.missingNumberAt||V.regionalOptions[""].missingNumberAt).replace(/\{0\}/,c);return c+=I[0].length,parseInt(I[0],10)},y=this,S=function(){if(typeof i=="function"){l("m");var P=i.call(y,d.substring(c));return c+=P.length,P}return x("m")},k=function(P,z,D,B){for(var R=l(P,B)?D:z,I=0;I-1){f=1,v=g;for(var _=this.daysInMonth(s,f);v>_;_=this.daysInMonth(s,f))f++,v-=_}return a>-1?this.fromJD(a):this.newDate(s,f,v)},determineDate:function(u,d,E,A,t){E&&typeof E!="object"&&(t=A,A=E,E=null),typeof A!="string"&&(t=A,A="");var e=this,r=function(i){try{return e.parseDate(A,i,t)}catch{}i=i.toLowerCase();for(var n=(i.match(/^c/)&&E?E.newDate():null)||e.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=o.exec(i);a;)n.add(parseInt(a[1],10),a[2]||"d"),a=o.exec(i);return n};return d=d?d.newDate():null,u=u==null?d:typeof u=="string"?r(u):typeof u=="number"?isNaN(u)||u===1/0||u===-1/0?d:e.today().add(u,"d"):e.newDate(u),u}})}),BC=Vt(()=>{var K=lh(),V=of(),u=K.instance();function d(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}d.prototype=new K.baseCalendar,V(d.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var f=a.match(A);return f?f[0]:""}var v=this._validateYear(a),g=a.month(),m=""+this.toChineseMonth(v,g);return s&&m.length<2&&(m="0"+m),this.isIntercalaryMonth(v,g)&&(m+="i"),m},monthNames:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),v=a.month(),g=this.toChineseMonth(f,v),m=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][g-1];return this.isIntercalaryMonth(f,v)&&(m="闰"+m),m},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),v=a.month(),g=this.toChineseMonth(f,v),m=["一","二","三","四","五","六","七","八","九","十","十一","十二"][g-1];return this.isIntercalaryMonth(f,v)&&(m="闰"+m),m},parseMonth:function(a,s){a=this._validateYear(a);var f=parseInt(s),v;if(isNaN(f))s[0]==="闰"&&(v=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var g=s[s.length-1];v=g==="i"||g==="I"}var m=this.toMonthIndex(a,f,v);return m},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,f){var v=this.intercalaryMonth(a),g=f&&s!==v;if(g||s<1||s>12)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return v?!f&&s<=v?m=s-1:m=s:m=s-1,m},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a),v=f?12:11;if(s<0||s>v)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return f?s>13;return f},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a);return!!f&&f===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,f){var v=this._validateYear(a,K.local.invalidyear),g=i[v-i[0]],m=g>>9&4095,w=g>>5&15,l=g&31,x;x=u.newDate(m,w,l),x.add(4-(x.dayOfWeek()||7),"d");var y=this.toJD(a,s,f)-x.toJD();return 1+Math.floor(y/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var f=r[a-r[0]],v=f>>13,g=v?12:11;if(s>g)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var m=f&1<<12-s?30:29;return m},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var v=this._validate(a,m,f,K.local.invalidDate);a=this._validateYear(v.year()),s=v.month(),f=v.day();var g=this.isIntercalaryMonth(a,s),m=this.toChineseMonth(a,s),w=o(a,m,f,g);return u.toJD(w.year,w.month,w.day)},fromJD:function(a){var s=u.fromJD(a),f=n(s.year(),s.month(),s.day()),v=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,v,f.day)},fromString:function(a){var s=a.match(E),f=this._validateYear(+s[1]),v=+s[2],g=!!s[3],m=this.toMonthIndex(f,v,g),w=+s[4];return this.newDate(f,m,w)},add:function(a,s,f){var v=a.year(),g=a.month(),m=this.isIntercalaryMonth(v,g),w=this.toChineseMonth(v,g),l=Object.getPrototypeOf(d.prototype).add.call(this,a,s,f);if(f==="y"){var x=l.year(),y=l.month(),S=this.isIntercalaryMonth(x,w),k=m&&S?this.toMonthIndex(x,w,!0):this.toMonthIndex(x,w,!1);k!==y&&l.month(k)}return l}});var E=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,A=/^\d?\d[iI]?/m,t=/^闰?十?[一二三四五六七八九]?月/m,e=/^闰?十?[一二三四五六七八九]?/m;K.calendars.chinese=d;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],i=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,f,v){var g,m;if(typeof a=="object")g=a,m=s||{};else{var w=typeof a=="number"&&a>=1888&&a<=2111;if(!w)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var x=typeof f=="number"&&f>=1&&f<=31;if(!x)throw new Error("Solar day outside range 1 - 31");g={year:a,month:s,day:f},m={}}var y=i[g.year-i[0]],S=g.year<<9|g.month<<5|g.day;m.year=S>=y?g.year:g.year-1,y=i[m.year-i[0]];var k=y>>9&4095,M=y>>5&15,T=y&31,c,h=new Date(k,M-1,T),b=new Date(g.year,g.month-1,g.day);c=Math.round((b-h)/(24*3600*1e3));var _=r[m.year-r[0]],P;for(P=0;P<13;P++){var z=_&1<<12-P?30:29;if(c>13;return!D||P=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var x=typeof s=="number"&&s>=1&&s<=12;if(!x)throw new Error("Lunar month outside range 1 - 12");var y=typeof f=="number"&&f>=1&&f<=30;if(!y)throw new Error("Lunar day outside range 1 - 30");var S;typeof v=="object"?(S=!1,m=v):(S=!!v,m={}),w={year:a,month:s,day:f,isIntercalary:S}}var k;k=w.day-1;var M=r[w.year-r[0]],T=M>>13,c;T&&(w.month>T||w.isIntercalary)?c=w.month:c=w.month-1;for(var h=0;h>9&4095,z=_>>5&15,D=_&31,B=new Date(P,z-1,D+k);return m.year=B.getFullYear(),m.month=1+B.getMonth(),m.day=B.getDate(),m}}),RC=Vt(()=>{var K=lh(),V=of();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear),13},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,K.local.invalidDate);return d=t.year(),d<0&&d++,t.day()+(t.month()-1)*30+(d-1)*365+Math.floor(d/4)+this.jdEpoch-1},fromJD:function(d){var E=Math.floor(d)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(d)+.5-this.newDate(A,1,1).toJD();var t=Math.floor(E/30)+1,e=E-(t-1)*30+1;return this.newDate(A,t,e)}}),K.calendars.coptic=u}),NC=Vt(()=>{var K=lh(),V=of();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),!1},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),13},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),400},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/8)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,K.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);return(e.day()+1)%8},weekDay:function(E,A,t){var e=this.dayOfWeek(E,A,t);return e>=2&&e<=6},extraInfo:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);return{century:d[Math.floor((e.year()-1)/100)+1]||""}},toJD:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);return E=e.year()+(e.year()<0?1:0),A=e.month(),t=e.day(),t+(A>1?16:0)+(A>2?(A-2)*32:0)+(E-1)*400+this.jdEpoch-1},fromJD:function(E){E=Math.floor(E+.5)-Math.floor(this.jdEpoch)-1;var A=Math.floor(E/400)+1;E-=(A-1)*400,E+=E>15?16:0;var t=Math.floor(E/32)+1,e=E-(t-1)*32+1;return this.newDate(A<=0?A-1:A,t,e)}});var d={20:"Fruitbat",21:"Anchovy"};K.calendars.discworld=u}),jC=Vt(()=>{var K=lh(),V=of();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear),13},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,K.local.invalidDate);return d=t.year(),d<0&&d++,t.day()+(t.month()-1)*30+(d-1)*365+Math.floor(d/4)+this.jdEpoch-1},fromJD:function(d){var E=Math.floor(d)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(d)+.5-this.newDate(A,1,1).toJD();var t=Math.floor(E/30)+1,e=E-(t-1)*30+1;return this.newDate(A,t,e)}}),K.calendars.ethiopian=u}),UC=Vt(()=>{var K=lh(),V=of();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear);return this._leapYear(A.year())},_leapYear:function(E){return E=E<0?E+1:E,d(E*7+1,19)<7},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),this._leapYear(E.year?E.year():E)?13:12},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear);return E=A.year(),this.toJD(E===-1?1:E+1,7,1)-this.toJD(E,7,1)},daysInMonth:function(E,A){return E.year&&(A=E.month(),E=E.year()),this._validate(E,A,this.minDay,K.local.invalidMonth),A===12&&this.leapYear(E)||A===8&&d(this.daysInYear(E),10)===5?30:A===9&&d(this.daysInYear(E),10)===3?29:this.daysPerMonth[A-1]},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==6},extraInfo:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);return{yearType:(this.leapYear(e)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(e)%10-3]}},toJD:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);E=e.year(),A=e.month(),t=e.day();var r=E<=0?E+1:E,i=this.jdEpoch+this._delay1(r)+this._delay2(r)+t+1;if(A<7){for(var n=7;n<=this.monthsInYear(E);n++)i+=this.daysInMonth(E,n);for(var n=1;n=this.toJD(A===-1?1:A+1,7,1);)A++;for(var t=Ethis.toJD(A,t,this.daysInMonth(A,t));)t++;var e=E-this.toJD(A,t,1)+1;return this.newDate(A,t,e)}});function d(E,A){return E-A*Math.floor(E/A)}K.calendars.hebrew=u}),VC=Vt(()=>{var K=lh(),V=of();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(d){var E=this._validate(d,this.minMonth,this.minDay,K.local.invalidYear);return(E.year()*11+14)%30<11},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(d){return this.leapYear(d)?355:354},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===12&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return this.dayOfWeek(d,E,A)!==5},toJD:function(d,E,A){var t=this._validate(d,E,A,K.local.invalidDate);return d=t.year(),E=t.month(),A=t.day(),d=d<=0?d+1:d,A+Math.ceil(29.5*(E-1))+(d-1)*354+Math.floor((3+11*d)/30)+this.jdEpoch-1},fromJD:function(d){d=Math.floor(d)+.5;var E=Math.floor((30*(d-this.jdEpoch)+10646)/10631);E=E<=0?E-1:E;var A=Math.min(12,Math.ceil((d-29-this.toJD(E,1,1))/29.5)+1),t=d-this.toJD(E,A,1)+1;return this.newDate(E,A,t)}}),K.calendars.islamic=u}),HC=Vt(()=>{var K=lh(),V=of();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),A=E.year()<0?E.year()+1:E.year();return A%4===0},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(4-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===2&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,K.local.invalidDate);return d=t.year(),E=t.month(),A=t.day(),d<0&&d++,E<=2&&(d--,E+=12),Math.floor(365.25*(d+4716))+Math.floor(30.6001*(E+1))+A-1524.5},fromJD:function(d){var E=Math.floor(d+.5),A=E+1524,t=Math.floor((A-122.1)/365.25),e=Math.floor(365.25*t),r=Math.floor((A-e)/30.6001),i=r-Math.floor(r<14?1:13),n=t-Math.floor(i>2?4716:4715),o=A-e-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,i,o)}}),K.calendars.julian=u}),qC=Vt(()=>{var K=lh(),V=of();function u(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),!1},formatYear:function(A){var t=this._validate(A,this.minMonth,this.minDay,K.local.invalidYear);A=t.year();var e=Math.floor(A/400);A=A%400,A+=A<0?400:0;var r=Math.floor(A/20);return e+"."+r+"."+A%20},forYear:function(A){if(A=A.split("."),A.length<3)throw"Invalid Mayan year";for(var t=0,e=0;e19||e>0&&r<0)throw"Invalid Mayan year";t=t*20+r}return t},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),18},weekOfYear:function(A,t,e){return this._validate(A,t,e,K.local.invalidDate),0},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,K.local.invalidYear),360},daysInMonth:function(A,t){return this._validate(A,t,this.minDay,K.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(A,t,e){var r=this._validate(A,t,e,K.local.invalidDate);return r.day()},weekDay:function(A,t,e){return this._validate(A,t,e,K.local.invalidDate),!0},extraInfo:function(A,t,e){var r=this._validate(A,t,e,K.local.invalidDate),i=r.toJD(),n=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[n[0]-1],haabMonth:n[0],haabDay:n[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(A){A-=this.jdEpoch;var t=d(A+8+340,365);return[Math.floor(t/20)+1,d(t,20)]},_toTzolkin:function(A){return A-=this.jdEpoch,[E(A+20,20),E(A+4,13)]},toJD:function(A,t,e){var r=this._validate(A,t,e,K.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(A){A=Math.floor(A)+.5-this.jdEpoch;var t=Math.floor(A/360);A=A%360,A+=A<0?360:0;var e=Math.floor(A/20),r=A%20;return this.newDate(t,e,r)}});function d(A,t){return A-t*Math.floor(A/t)}function E(A,t){return d(A-1,t)+1}K.calendars.mayan=u}),WC=Vt(()=>{var K=lh(),V=of();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar;var d=K.instance("gregorian");V(u.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear);return d.leapYear(A.year()+(A.year()<1?1:0)+1469)},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(1-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,K.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,K.local.invalidMonth),r=e.year();r<0&&r++;for(var i=e.day(),n=1;n=this.toJD(A+1,1,1);)A++;for(var t=E-Math.floor(this.toJD(A,1,1)+.5)+1,e=1;t>this.daysInMonth(A,e);)t-=this.daysInMonth(A,e),e++;return this.newDate(A,e,t)}}),K.calendars.nanakshahi=u}),GC=Vt(()=>{var K=lh(),V=of();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(d){return this.daysInYear(d)!==this.daysPerYear},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(d){var E=this._validate(d,this.minMonth,this.minDay,K.local.invalidYear);if(d=E.year(),typeof this.NEPALI_CALENDAR_DATA[d]>"u")return this.daysPerYear;for(var A=0,t=this.minMonth;t<=12;t++)A+=this.NEPALI_CALENDAR_DATA[d][t];return A},daysInMonth:function(d,E){return d.year&&(E=d.month(),d=d.year()),this._validate(d,E,this.minDay,K.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[d]>"u"?this.daysPerMonth[E-1]:this.NEPALI_CALENDAR_DATA[d][E]},weekDay:function(d,E,A){return this.dayOfWeek(d,E,A)!==6},toJD:function(d,E,A){var t=this._validate(d,E,A,K.local.invalidDate);d=t.year(),E=t.month(),A=t.day();var e=K.instance(),r=0,i=E,n=d;this._createMissingCalendarData(d);var o=d-(i>9||i===9&&A>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(E!==9&&(r=A,i--);i!==9;)i<=0&&(i=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][i],i--;return E===9?(r+=A-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=e.daysInYear(o))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],e.newDate(o,1,1).add(r,"d").toJD()},fromJD:function(d){var E=K.instance(),A=E.fromJD(d),t=A.year(),e=A.dayOfYear(),r=t+56;this._createMissingCalendarData(r);for(var i=9,n=this.NEPALI_CALENDAR_DATA[r][0],o=this.NEPALI_CALENDAR_DATA[r][i]-n+1;e>o;)i++,i>12&&(i=1,r++),o+=this.NEPALI_CALENDAR_DATA[r][i];var a=this.NEPALI_CALENDAR_DATA[r][i]-(o-e);return this.newDate(r,i,a)},_createMissingCalendarData:function(d){var E=this.daysPerMonth.slice(0);E.unshift(17);for(var A=d-1;A"u"&&(this.NEPALI_CALENDAR_DATA[A]=E)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),K.calendars.nepali=u}),ZC=Vt(()=>{var K=lh(),V=of();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}function d(E){var A=E-475;E<0&&A++;var t=.242197,e=t*A,r=t*(A+1),i=e-Math.floor(e),n=r-Math.floor(r);return i>n}u.prototype=new K.baseCalendar,V(u.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear);return d(A.year())},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-((e.dayOfWeek()+1)%7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,K.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==5},toJD:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate);E=e.year(),A=e.month(),t=e.day();var r=0;if(E>0)for(var i=1;i0?E-1:E)*365+r+this.jdEpoch-1},fromJD:function(E){E=Math.floor(E)+.5;var A=475+(E-this.toJD(475,1,1))/365.242197,t=Math.floor(A);t<=0&&t--,E>this.toJD(t,12,d(t)?30:29)&&(t++,t===0&&t++);var e=E-this.toJD(t,1,1)+1,r=e<=186?Math.ceil(e/31):Math.ceil((e-6)/30),i=E-this.toJD(t,r,1)+1;return this.newDate(t,r,i)}}),K.calendars.persian=u,K.calendars.jalali=u}),KC=Vt(()=>{var K=lh(),V=of(),u=K.instance();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new K.baseCalendar,V(d.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var A=this._validate(t,this.minMonth,this.minDay,K.local.invalidYear),t=this._t2gYear(A.year());return u.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,K.local.invalidYear),r=this._t2gYear(e.year());return u.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,K.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,K.local.invalidDate),r=this._t2gYear(e.year());return u.toJD(r,e.month(),e.day())},fromJD:function(E){var A=u.fromJD(E),t=this._g2tYear(A.year());return this.newDate(t,A.month(),A.day())},_t2gYear:function(E){return E+this.yearsOffset+(E>=-this.yearsOffset&&E<=-1?1:0)},_g2tYear:function(E){return E-this.yearsOffset-(E>=1&&E<=this.yearsOffset?1:0)}}),K.calendars.taiwan=d}),YC=Vt(()=>{var K=lh(),V=of(),u=K.instance();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new K.baseCalendar,V(d.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var A=this._validate(t,this.minMonth,this.minDay,K.local.invalidYear),t=this._t2gYear(A.year());return u.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,K.local.invalidYear),r=this._t2gYear(e.year());return u.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,K.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,K.local.invalidDate),r=this._t2gYear(e.year());return u.toJD(r,e.month(),e.day())},fromJD:function(E){var A=u.fromJD(E),t=this._g2tYear(A.year());return this.newDate(t,A.month(),A.day())},_t2gYear:function(E){return E-this.yearsOffset-(E>=1&&E<=this.yearsOffset?1:0)},_g2tYear:function(E){return E+this.yearsOffset+(E>=-this.yearsOffset&&E<=-1?1:0)}}),K.calendars.thai=d}),XC=Vt(()=>{var K=lh(),V=of();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new K.baseCalendar,V(u.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear);return this.daysInYear(A.year())===355},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(E){for(var A=0,t=1;t<=12;t++)A+=this.daysInMonth(E,t);return A},daysInMonth:function(E,A){for(var t=this._validate(E,A,this.minDay,K.local.invalidMonth),e=t.toJD()-24e5+.5,r=0,i=0;ie)return d[r]-d[r-1];r++}return 30},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==5},toJD:function(E,A,t){var e=this._validate(E,A,t,K.local.invalidDate),r=12*(e.year()-1)+e.month()-15292,i=e.day()+d[r-1]-1;return i+24e5-.5},fromJD:function(E){for(var A=E-24e5+.5,t=0,e=0;eA);e++)t++;var r=t+15292,i=Math.floor((r-1)/12),n=i+1,o=r-12*i,a=A-d[t-1]+1;return this.newDate(n,o,a)},isValid:function(E,A,t){var e=K.baseCalendar.prototype.isValid.apply(this,arguments);return e&&(E=E.year!=null?E.year:E,e=E>=1276&&E<=1500),e},_validate:function(E,A,t,e){var r=K.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw e.replace(/\{0\}/,this.local.name);return r}}),K.calendars.ummalqura=u;var d=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),$C=Vt((K,V)=>{V.exports=lh(),FC(),BC(),RC(),NC(),jC(),UC(),VC(),HC(),qC(),WC(),GC(),ZC(),KC(),YC(),XC()}),JC=Vt((K,V)=>{var u=$C(),d=Xr(),E=ks(),A=E.EPOCHJD,t=E.ONEDAY,e={valType:"enumerated",values:d.sortObjectKeys(u.calendars),editType:"calc",dflt:"gregorian"},r=function(M,T,c,h){var b={};return b[c]=e,d.coerce(M,T,b,c,h)},i=function(M,T,c,h){for(var b=0;b{V.exports=JC()}),tI=Vt((K,V)=>{var u=C6();u.register([D6(),R6(),V6(),Z6(),$6(),eA(),aA(),mA(),kA(),DA(),WA(),fS(),vS(),n8(),h8(),_8(),S8(),q8(),K8(),X8(),tE(),iE(),cE(),dE(),zE(),IE(),m9(),L9(),H9(),Y9(),iz(),uz(),vz(),Lz(),Oz(),Vz(),nL(),uL(),gL(),NL(),ZL(),JL(),nC(),sC(),hC(),_C(),MC(),DC(),QC()]),V.exports=u});return tI()})();return window.Plotly=md,md})})(Ly)),Ly.exports}var YI=KI();const N4=BI(YI);var XI=WI("
                ");function QI(zg,r0){UI(r0,!0);let md=RI(r0,"loaded_plotly_css",15,!1),gd=GI(()=>r0.value?.plot),zh,cm;function Cy(){if(!md()){cm=document.getElementById("plotly.js-style-global");const nf=cm.cloneNode();zh.appendChild(nf);for(const n0 of cm.sheet.cssRules)nf.sheet.insertRule(n0.cssText);md(!0)}}VI(()=>{if(!zh||!B4(gd))return;Cy();let nf=JSON.parse(B4(gd));nf.config=nf.config||{},nf.config.responsive=!0,nf.responsive=!0,nf.layout.autosize=!0,nf.layout.margin==null&&(nf.layout.margin={}),nf.layout.title&&r0.show_label&&(nf.layout.margin.t=Math.max(100,nf.layout.margin.t||0)),nf.layout.margin.autoexpand=!0,N4.react(zh,nf.data,nf.layout,nf.config),N4.Plots.resize(zh)});var fm=XI();NI(fm,"data-testid","plotly"),jI(fm,nf=>zh=nf,()=>zh),HI(zg,fm),qI()}export{QI as default}; diff --git a/assets/Plus-BDmybZhd.js b/assets/Plus-BDmybZhd.js deleted file mode 100644 index 9fd15dc26c6eb20617bba9938cbeaaeecc6d6a95..0000000000000000000000000000000000000000 --- a/assets/Plus-BDmybZhd.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as t,f as s}from"./index-DydPgVMC.js";var e=s('');function a(o){var r=e();t(o,r)}export{a as P}; diff --git a/assets/ScrollFade-CeVpKVW3.js b/assets/ScrollFade-CeVpKVW3.js deleted file mode 100644 index 2fe5fb0f326757d6a465a5e2e722a7eea708cdcc..0000000000000000000000000000000000000000 --- a/assets/ScrollFade-CeVpKVW3.js +++ /dev/null @@ -1 +0,0 @@ -import{p as o,i as p,b as n}from"./i18n-CPHyzK9b.js";import{a3 as d,N as b,a as l,t as _,R as u}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var h=u("
                ");function g(r,s){let f=o(s,"visible",3,!1),m=o(s,"position",3,"sticky");var t=d(),v=b(t);{var c=a=>{var e=h();let i;_(()=>i=n(e,1,"scroll-fade svelte-t7jji8",null,i,{absolute:m()==="absolute"})),l(a,e)};p(v,a=>{f()&&a(c)})}l(r,t)}export{g as S}; diff --git a/assets/ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js b/assets/ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js deleted file mode 100644 index 0194145dd15c69215df992e4bd01b3f108324c26..0000000000000000000000000000000000000000 --- a/assets/ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js +++ /dev/null @@ -1 +0,0 @@ -import{B as O,p as s,i as b,b as w,a as N,f as Q}from"./i18n-CPHyzK9b.js";import{p as X,E as D,h as G,e as J,t as p,a as n,S as k,R as g,Q as d,ah as F,Z as U,a2 as W,X as K,a3 as Z,N as q,T as v,f as H,M as L,O as Y}from"./index-DydPgVMC.js";import{s as $}from"./snippet-BtHMuX3s.js";function ee(r,e,c){G&&J();var x=new O(r);X(()=>{var f=e()??null;x.ensure(f,f&&(u=>c(u,f)))},D)}var ae=g(' '),te=g("");function xe(r,e){let c=s(e,"label",3,""),x=s(e,"show_label",3,!1),f=s(e,"pending",3,!1),u=s(e,"size",3,"small"),m=s(e,"padded",3,!0),y=s(e,"highlight",3,!1),z=s(e,"disabled",3,!1),A=s(e,"hasPopup",3,!1),h=s(e,"color",3,"var(--block-label-text-color)"),M=s(e,"transparent",3,!1),P=s(e,"background",3,"var(--block-background-fill)"),E=s(e,"border",3,"transparent"),j=W(()=>y()?"var(--color-accent)":h());var i=te();let C;i.__click=function(...l){e.onclick?.apply(this,l)};let R;var B=d(i);{var I=l=>{var _=ae(),T=d(_,!0);v(_),p(()=>K(T,c())),n(l,_)};b(B,l=>{x()&&l(I)})}var S=k(B,2);let V;var t=d(S);ee(t,()=>e.Icon,(l,_)=>{_(l,{})});var a=k(t,2);{var o=l=>{var _=Z(),T=q(_);$(T,()=>e.children),n(l,_)};b(a,l=>{e.children&&l(o)})}v(S),v(i),p(()=>{C=w(i,1,"icon-button svelte-c6nghm",null,C,{pending:f(),padded:m(),highlight:y(),transparent:M()}),i.disabled=z(),N(i,"aria-label",c()),N(i,"aria-haspopup",A()),N(i,"title",c()),R=Q(i,"",R,{"--border-color":E(),color:!z()&&U(j)?U(j):"var(--block-label-text-color)","--bg-color":z()?"auto":P()}),V=w(S,1,"svelte-c6nghm",null,V,{"x-small":u()==="x-small",small:u()==="small",large:u()==="large",medium:u()==="medium"})}),n(r,i)}F(["click"]);var le=H('');function oe(r){var e=le();n(r,e)}var re=H('');function se(r){var e=re();n(r,e)}var ne=H('');function ce(r){var e=ne();n(r,e)}var ie=H('');function de(r){var e=ie();n(r,e)}var ve=H('');function ue(r){var e=ve();n(r,e)}var he=g(''),_e=g(''),be=g(''),ge=g(''),fe=g(''),me=g(' ');function ye(r,e){L(e,!0);let c=s(e,"active_source",15),x=s(e,"handle_clear",3,()=>{}),f=s(e,"handle_select",3,()=>{}),u=W(()=>[...new Set(e.sources)]);async function m(h){x()(),c(h),f()(h)}var y=Z(),z=q(y);{var A=h=>{var M=me(),P=d(M);{var E=t=>{var a=he();let o;a.__click=()=>m("upload");var l=d(a);ce(l),v(a),p(()=>o=w(a,1,"icon svelte-dwjezy",null,o,{selected:c()==="upload"||!c()})),n(t,a)};b(P,t=>{e.sources.includes("upload")&&t(E)})}var j=k(P,2);{var i=t=>{var a=_e();let o;a.__click=()=>m("microphone");var l=d(a);se(l),v(a),p(()=>o=w(a,1,"icon svelte-dwjezy",null,o,{selected:c()==="microphone"})),n(t,a)};b(j,t=>{e.sources.includes("microphone")&&t(i)})}var C=k(j,2);{var R=t=>{var a=be();let o;a.__click=()=>m("webcam");var l=d(a);ue(l),v(a),p(()=>o=w(a,1,"icon svelte-dwjezy",null,o,{selected:c()==="webcam"})),n(t,a)};b(C,t=>{e.sources.includes("webcam")&&t(R)})}var B=k(C,2);{var I=t=>{var a=ge();let o;a.__click=()=>m("webcam-video");var l=d(a);de(l),v(a),p(()=>o=w(a,1,"icon svelte-dwjezy",null,o,{selected:c()==="webcam-video"})),n(t,a)};b(B,t=>{e.sources.includes("webcam-video")&&t(I)})}var S=k(B,2);{var V=t=>{var a=fe();let o;a.__click=()=>m("clipboard");var l=d(a);oe(l),v(a),p(()=>o=w(a,1,"icon svelte-dwjezy",null,o,{selected:c()==="clipboard"})),n(t,a)};b(S,t=>{e.sources.includes("clipboard")&&t(V)})}v(M),n(h,M)};b(z,h=>{(U(u).length>1||e.sources.includes("clipboard"))&&h(A)})}n(r,y),Y()}F(["click"]);export{xe as I,se as M,ye as S,ce as U,de as V,ue as W,oe as a,ee as c}; diff --git a/assets/Send-oZH_TPNw.js b/assets/Send-oZH_TPNw.js deleted file mode 100644 index f8be5649ea8dabde8ecd565854a062499c7ce3c6..0000000000000000000000000000000000000000 --- a/assets/Send-oZH_TPNw.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as C,f as o}from"./index-DydPgVMC.js";var M=o('');function i(L){var r=M();C(L,r)}export{i as S}; diff --git a/assets/Settings-C5X1Bk7G.js b/assets/Settings-C5X1Bk7G.js deleted file mode 100644 index 86f214a57d4d7130f7c04c382ca9acc2f38218d7..0000000000000000000000000000000000000000 --- a/assets/Settings-C5X1Bk7G.js +++ /dev/null @@ -1,7 +0,0 @@ -import{a as Q,u as he,$ as ge,t as _e,p as F,k as pe,O as be,i as E,P as fe,Q as we,b as O}from"./i18n-CPHyzK9b.js";import{M as K,N as Z,Q as t,S as s,T as a,t as L,X as d,U as h,a as g,O as $,R as _,a7 as ye,$ as R,aa as H,ab as ke,Z as u,a5 as P}from"./index-DydPgVMC.js";import{s as Ce}from"./Blocks-C9ppI-He.js";import{C as xe}from"./clear-DRfgZ-Qi.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{b as Se}from"./Dropdown-CVRP4i7q.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";/* empty css */import{C as J}from"./Checkbox-Bh_yH8eu.js";import"./html-BZIV6tyB.js";import"./size-D4lmUoTq.js";import"./state.svelte-DpHZj3x1.js";import"./index-CfM_uZQa.js";import"./Clear-BR8cTgGu.js";import"./index-CMKhGNWj.js";import"./index-tFQomdd2.js";import"./snippet-BtHMuX3s.js";import"./input-BtIxlP_B.js";import"./window-D5YXrKnH.js";import"./BlockTitle-DNiCHWOR.js";import"./Info-DfrMwI06.js";import"./DropdownArrow-Cq3QAKSv.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./index-B_pwUImq.js";import"./universal-C9tCO36V.js";var Re=_('

                ',1);function Pe(T,o){K(o,!0);const i=()=>he(ge,"$_",p),[p,b]=_e();var m=Re(),c=Z(m),n=t(c),f=s(n,2),w=t(f),y=s(w),k=t(y,!0);a(y),a(f),a(c);var v=s(c,2),z=t(v);xe(z),a(v),L(C=>{Q(n,"src",Ce),d(w,`${C??""} `),d(k,o.root)},[()=>i()("common.settings")]),h("click",v,()=>o.onclose?.()),g(T,m),$(),b()}const Le="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23808080'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Te=_(''),ze=_('You can install this app as a Progressive Web App on your device. Visit
                and click the install button in the URL address bar of your browser.',1),Ge=_(`Progressive Web App is not enabled for this app. To enable it, start your - Gradio app with launch(pwa=True).`,1),Me=_(` `,1);function ot(T,o){K(o,!0);let i=F(o,"root",7),p=F(o,"allow_zoom",15),b=F(o,"allow_video_trim",15);i()===""&&i(location.protocol+"//"+location.host+location.pathname),i().endsWith("/")||i(i()+"/");function m(e){const r=new URL(window.location.href);e==="system"?(r.searchParams.delete("__theme"),R(n,"system")):(r.searchParams.set("__theme",e),R(n,e,!0)),r.searchParams.delete("view"),window.location.href=r.toString()}ye(()=>{"parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const r=new URL(window.location.href).searchParams.get("__theme");return R(n,r||"system",!0),()=>{document.body.style.overflow="auto"}});let c=H(ke(pe(be)??"en")),n=H("system");function f(e){we(e)}function w(e){p(e)}function y(e){b(e)}var k=Me(),v=Z(k),z=t(v);Pe(z,{onclose:()=>o.onclose(),get root(){return i()}}),a(v);var C=s(v,2);{var ee=e=>{var r=Te(),l=t(r),A=t(l,!0);a(l);var q=s(l,2),x=t(q),ve=t(x);a(x);var S=s(x,2),de=t(S);a(S);var B=s(S,2),me=t(B);a(B),a(q),a(r),L(ue=>{d(A,ue),O(x,1,`theme-button ${u(n)==="light"?"current-theme":"inactive-theme"}`,"svelte-30aa5s"),O(S,1,`theme-button ${u(n)==="dark"?"current-theme":"inactive-theme"}`,"svelte-30aa5s"),O(B,1,`theme-button ${u(n)==="system"?"current-theme":"inactive-theme"}`,"svelte-30aa5s")},[()=>o.i18n("common.display_theme")]),h("click",ve,()=>m("light")),h("click",de,()=>m("dark")),h("click",me,()=>m("system")),g(e,r)};E(C,e=>{o.space_id===null&&e(ee)})}var G=s(C,2),M=t(G),te=t(M,!0);a(M);var j=s(M,2),ae=t(j);Se(ae,{label:"Language",get choices(){return fe},show_label:!1,on_change:()=>f(u(c)),get value(){return u(c)},set value(e){R(c,e,!0)}}),a(j),a(G);var U=s(G,2),V=t(U),re=t(V,!0);a(V);var N=s(V,2),oe=t(N);{var se=e=>{var r=ze(),l=s(Z(r)),A=t(l,!0);a(l),P(),L(()=>{Q(l,"href",i()),d(A,i())}),g(e,r)},ie=e=>{var r=Ge();P(2),g(e,r)};E(oe,e=>{o.pwa_enabled?e(se):e(ie,!1)})}a(N),a(U);var X=s(U,2),I=t(X),ne=t(I);P(),a(I);var D=s(I,2),Y=s(t(D),13);J(Y,{label:"Include automatic zoom in/out",interactive:!0,get value(){return p()},on_change:w});var le=s(Y,2);J(le,{label:"Include automatic video trimming",interactive:!0,get value(){return b()},on_change:y}),a(D);var W=s(D,2),ce=t(W);P(),a(W),a(X),L((e,r,l)=>{d(te,e),d(re,r),d(ne,`${l??""} `),Q(ce,"src",Le)},[()=>o.i18n("common.language"),()=>o.i18n("common.pwa"),()=>o.i18n("common.screen_studio")]),h("click",W,()=>{o.onclose?.(),o.start_recording?.()}),g(T,k),$()}export{ot as default}; diff --git a/assets/ShareButton-Cuvs43xM.js b/assets/ShareButton-Cuvs43xM.js deleted file mode 100644 index 79b8442a62e0433435c9ef6938946ac51a26e518..0000000000000000000000000000000000000000 --- a/assets/ShareButton-Cuvs43xM.js +++ /dev/null @@ -1 +0,0 @@ -import{p as a,e as p,x as w}from"./i18n-CPHyzK9b.js";import{a as x,f as _,M as y,a1 as A,$ as g,Z as h,O as S,a0 as Z,P as n,ad as M,x as B,v as C}from"./index-DydPgVMC.js";import{I}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var b=_('');function k(i){var t=b();x(i,t)}function L(i,t){y(t,!1);const d=A();let l=a(t,"formatter",12),u=a(t,"value",12),s=a(t,"i18n",12),c=a(t,"onerror",12,void 0),f=a(t,"onshare",12,void 0),m=Z(!1);var v={get formatter(){return l()},set formatter(e){l(e),n()},get value(){return u()},set value(e){u(e),n()},get i18n(){return s()},set i18n(e){s(e),n()},get onerror(){return c()},set onerror(e){c(e),n()},get onshare(){return f()},set onshare(e){f(e),n()}};p();{let e=M(()=>(B(s()),C(()=>s()("common.share"))));I(i,{get Icon(){return k},get label(){return h(e)},get pending(){return h(m)},onclick:async()=>{try{g(m,!0);const r={description:await l()(u())};d("share",r),f()?.(r)}catch(o){console.error(o);let r=o instanceof w?o.message:"Share failed.";d("error",r),c()?.(r)}finally{g(m,!1)}}})}return S(v)}export{k as C,L as S}; diff --git a/assets/SharedSystems-C07l2FX_.js b/assets/SharedSystems-C07l2FX_.js deleted file mode 100644 index a2be5e97eaf5c42250e0a9e5adb86cbe4d09de59..0000000000000000000000000000000000000000 --- a/assets/SharedSystems-C07l2FX_.js +++ /dev/null @@ -1,326 +0,0 @@ -import{F as Oe,v as Fe,l as ie,M as g,x as Le,y as He,S as We,z as oe,E as u,e as F,H as w,I as ze,J as L,K as y,R as H,L as le,N as Ve,t as m,b as f,i as G,w as W,O as X,Q as Ne,c as Q,B as k,j as A,V as je,u as M,k as S,W as P,X as qe,a as $e,Y as ue,Z as de,_ as ce,$ as he,C as U,a0 as Ke,a1 as I,a2 as Z,D as z,a3 as Ye,a4 as Je,P as Xe,d as Qe,T as ee,a5 as te,a6 as v,a7 as Ze,a8 as et}from"./Index-EyePZPlZ.js";import{B as fe,c as tt}from"./colorToUniform-3MxHuUz8.js";var rt=`in vec2 vMaskCoord; -in vec2 vTextureCoord; - -uniform sampler2D uTexture; -uniform sampler2D uMaskTexture; - -uniform float uAlpha; -uniform vec4 uMaskClamp; -uniform float uInverse; - -out vec4 finalColor; - -void main(void) -{ - float clip = step(3.5, - step(uMaskClamp.x, vMaskCoord.x) + - step(uMaskClamp.y, vMaskCoord.y) + - step(vMaskCoord.x, uMaskClamp.z) + - step(vMaskCoord.y, uMaskClamp.w)); - - // TODO look into why this is needed - float npmAlpha = uAlpha; - vec4 original = texture(uTexture, vTextureCoord); - vec4 masky = texture(uMaskTexture, vMaskCoord); - float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a); - - float a = alphaMul * masky.r * npmAlpha * clip; - - if (uInverse == 1.0) { - a = 1.0 - a; - } - - finalColor = original * a; -} -`,st=`in vec2 aPosition; - -out vec2 vTextureCoord; -out vec2 vMaskCoord; - - -uniform vec4 uInputSize; -uniform vec4 uOutputFrame; -uniform vec4 uOutputTexture; -uniform mat3 uFilterMatrix; - -vec4 filterVertexPosition( vec2 aPosition ) -{ - vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - - position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - - return vec4(position, 0.0, 1.0); -} - -vec2 filterTextureCoord( vec2 aPosition ) -{ - return aPosition * (uOutputFrame.zw * uInputSize.zw); -} - -vec2 getFilterCoord( vec2 aPosition ) -{ - return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy; -} - -void main(void) -{ - gl_Position = filterVertexPosition(aPosition); - vTextureCoord = filterTextureCoord(aPosition); - vMaskCoord = getFilterCoord(aPosition); -} -`,re=`struct GlobalFilterUniforms { - uInputSize:vec4, - uInputPixel:vec4, - uInputClamp:vec4, - uOutputFrame:vec4, - uGlobalFrame:vec4, - uOutputTexture:vec4, -}; - -struct MaskUniforms { - uFilterMatrix:mat3x3, - uMaskClamp:vec4, - uAlpha:f32, - uInverse:f32, -}; - -@group(0) @binding(0) var gfu: GlobalFilterUniforms; -@group(0) @binding(1) var uTexture: texture_2d; -@group(0) @binding(2) var uSampler : sampler; - -@group(1) @binding(0) var filterUniforms : MaskUniforms; -@group(1) @binding(1) var uMaskTexture: texture_2d; - -struct VSOutput { - @builtin(position) position: vec4, - @location(0) uv : vec2, - @location(1) filterUv : vec2, -}; - -fn filterVertexPosition(aPosition:vec2) -> vec4 -{ - var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - - position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - - return vec4(position, 0.0, 1.0); -} - -fn filterTextureCoord( aPosition:vec2 ) -> vec2 -{ - return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); -} - -fn globalTextureCoord( aPosition:vec2 ) -> vec2 -{ - return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); -} - -fn getFilterCoord(aPosition:vec2 ) -> vec2 -{ - return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy; -} - -fn getSize() -> vec2 -{ - return gfu.uGlobalFrame.zw; -} - -@vertex -fn mainVertex( - @location(0) aPosition : vec2, -) -> VSOutput { - return VSOutput( - filterVertexPosition(aPosition), - filterTextureCoord(aPosition), - getFilterCoord(aPosition) - ); -} - -@fragment -fn mainFragment( - @location(0) uv: vec2, - @location(1) filterUv: vec2, - @builtin(position) position: vec4 -) -> @location(0) vec4 { - - var maskClamp = filterUniforms.uMaskClamp; - var uAlpha = filterUniforms.uAlpha; - - var clip = step(3.5, - step(maskClamp.x, filterUv.x) + - step(maskClamp.y, filterUv.y) + - step(filterUv.x, maskClamp.z) + - step(filterUv.y, maskClamp.w)); - - var mask = textureSample(uMaskTexture, uSampler, filterUv); - var source = textureSample(uTexture, uSampler, uv); - var alphaMul = 1.0 - uAlpha * (1.0 - mask.a); - - var a: f32 = alphaMul * mask.r * uAlpha * clip; - - if (filterUniforms.uInverse == 1.0) { - a = 1.0 - a; - } - - return source * a; -} -`;class at extends Oe{constructor(e){const{sprite:t,...r}=e,s=new Fe(t.texture),a=new ie({uFilterMatrix:{value:new g,type:"mat3x3"},uMaskClamp:{value:s.uClampFrame,type:"vec4"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),i=Le.from({vertex:{source:re,entryPoint:"mainVertex"},fragment:{source:re,entryPoint:"mainFragment"}}),o=He.from({vertex:st,fragment:rt,name:"mask-filter"});super({...r,gpuProgram:i,glProgram:o,clipToViewport:!1,resources:{filterUniforms:a,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,r,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,s)}}const V=class pe{constructor(e,t){this.state=We.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this)}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new oe({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(const r in this._activeBatches)this._activeBatches[r].begin()}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let r=this._activeBatches[e.batcherName];r||(r=this._activeBatches[e.batcherName]=pe.getBatcher(e.batcherName),r.begin()),this._activeBatch=r}this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){this._activeBatch.break(e);const t=this._activeBatches;for(const r in t){const s=t[r],a=s.geometry;a.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),a.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!1)}}upload(e){const t=this._batchersByInstructionSet[e.uid];for(const r in t){const s=t[r],a=s.geometry;s.dirty&&(s.dirty=!1,a.buffers[0].update(s.attributeSize*4))}}execute(e){if(e.action==="startBatch"){const t=e.batcher,r=t.geometry,s=t.shader;this._adaptor.start(this,r,s)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null}};V.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"batch"};V._availableBatchers=Object.create(null);let me=V;F.handleByMap(u.Batcher,me._availableBatchers);F.add(oe);const At={name:"texture-bit",vertex:{header:` - - struct TextureUniforms { - uTextureMatrix:mat3x3, - } - - @group(2) @binding(2) var textureUniforms : TextureUniforms; - `,main:` - uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy; - `},fragment:{header:` - @group(2) @binding(0) var uTexture: texture_2d; - @group(2) @binding(1) var uSampler: sampler; - - - `,main:` - outColor = textureSample(uTexture, uSampler, vUV); - `}},It={name:"texture-bit",vertex:{header:` - uniform mat3 uTextureMatrix; - `,main:` - uv = (uTextureMatrix * vec3(uv, 1.0)).xy; - `},fragment:{header:` - uniform sampler2D uTexture; - - - `,main:` - outColor = texture(uTexture, vUV); - `}},nt=new L;class it extends le{constructor(){super(),this.filters=[new at({sprite:new Ve(m.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e}}class ge{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,r){const s=this._renderer;if(s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){const a=e.mask;a.includeInBuild=!0,a.collectRenderables(r,s,null),a.includeInBuild=!1}s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){const t=this._renderer,r=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const s=w.get(it);if(s.inverse=e.inverse,r){e.mask.mask.measurable=!0;const a=ze(e.mask.mask,!0,nt);e.mask.mask.measurable=!1,a.ceil();const i=t.renderTarget.renderTarget.colorTexture.source,o=y.getOptimalTexture(a.width,a.height,i._resolution,i.antialias);t.renderTarget.push(o,!0),t.globalUniforms.push({offset:a,worldColor:4294967295});const l=s.sprite;l.texture=o,l.worldTransform.tx=a.minX,l.worldTransform.ty=a.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:o})}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const s=this._activeMaskStage[this._activeMaskStage.length-1];r&&(t.type===H.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const s=this._activeMaskStage.pop();r&&y.returnTexture(s.filterTexture),w.return(s.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}ge.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"alphaMask"};class _e{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,r){this._renderer.renderPipes.batch.break(r);const a=this._colorStack;a[this._colorStackIndex]=a[this._colorStackIndex-1]&e.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(e,t,r){this._renderer.renderPipes.batch.break(r);const a=this._colorStack;this._colorStackIndex--;const i=a[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._renderer=null,this._colorStack=null}}_e.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"colorMask"};class ve{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,r){var s;const a=e,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(a.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const o=a.mask;o.includeInBuild=!0,this._maskHash.has(a)||this._maskHash.set(a,{instructionsStart:0,instructionsLength:0});const l=this._maskHash.get(a);l.instructionsStart=r.instructionSize,o.collectRenderables(r,i,null),o.includeInBuild=!1,i.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const d=r.instructionSize-l.instructionsStart-1;l.instructionsLength=d;const c=i.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0)}pop(e,t,r){const s=e,a=this._renderer;a.renderPipes.batch.break(r),a.renderPipes.blendMode.setBlendMode(s.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:!1});const i=this._maskHash.get(e);for(let o=0;oe.uniformStructures[o]),a=this._adaptor.createUboElements(s),i=this._generateUboSync(a.uboElements);r=this._syncFunctionHash[t]={layout:a,syncFunction:i}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const s=this.getUniformGroupData(e);e.buffer||(e.buffer=new Q({data:new Float32Array(s.layout.size/4),usage:k.UNIFORM|k.COPY_DST}));let a=null;return t||(t=e.buffer.data,a=e.buffer.dataInt32),r||(r=0),s.syncFunction(e.uniforms,t,a,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}}const C=[{type:"mat3x3",test:n=>n.value.a!==void 0,ubo:` - var matrix = uv[name].toArray(true); - data[offset] = matrix[0]; - data[offset + 1] = matrix[1]; - data[offset + 2] = matrix[2]; - data[offset + 4] = matrix[3]; - data[offset + 5] = matrix[4]; - data[offset + 6] = matrix[5]; - data[offset + 8] = matrix[6]; - data[offset + 9] = matrix[7]; - data[offset + 10] = matrix[8]; - `,uniform:` - gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true)); - `},{type:"vec4",test:n=>n.type==="vec4"&&n.size===1&&n.value.width!==void 0,ubo:` - v = uv[name]; - data[offset] = v.x; - data[offset + 1] = v.y; - data[offset + 2] = v.width; - data[offset + 3] = v.height; - `,uniform:` - cv = ud[name].value; - v = uv[name]; - if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) { - cv[0] = v.x; - cv[1] = v.y; - cv[2] = v.width; - cv[3] = v.height; - gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height); - } - `},{type:"vec2",test:n=>n.type==="vec2"&&n.size===1&&n.value.x!==void 0,ubo:` - v = uv[name]; - data[offset] = v.x; - data[offset + 1] = v.y; - `,uniform:` - cv = ud[name].value; - v = uv[name]; - if (cv[0] !== v.x || cv[1] !== v.y) { - cv[0] = v.x; - cv[1] = v.y; - gl.uniform2f(ud[name].location, v.x, v.y); - } - `},{type:"vec4",test:n=>n.type==="vec4"&&n.size===1&&n.value.red!==void 0,ubo:` - v = uv[name]; - data[offset] = v.red; - data[offset + 1] = v.green; - data[offset + 2] = v.blue; - data[offset + 3] = v.alpha; - `,uniform:` - cv = ud[name].value; - v = uv[name]; - if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - cv[3] = v.alpha; - gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha); - } - `},{type:"vec3",test:n=>n.type==="vec3"&&n.size===1&&n.value.red!==void 0,ubo:` - v = uv[name]; - data[offset] = v.red; - data[offset + 1] = v.green; - data[offset + 2] = v.blue; - `,uniform:` - cv = ud[name].value; - v = uv[name]; - if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - gl.uniform3f(ud[name].location, v.red, v.green, v.blue); - } - `}];function Ot(n,e,t,r){const s=[` - var v = null; - var v2 = null; - var t = 0; - var index = 0; - var name = null; - var arrayOffset = null; - `];let a=0;for(let o=0;o1)h=l.offset/4,s.push(t(l,h-a));else{const p=r[l.data.type];h=l.offset/4,s.push(` - v = uv.${d}; - offset += ${h-a}; - ${p}; - `)}a=h}const i=s.join(` -`);return new Function("uv","data","dataInt32","offset",i)}function _(n,e){return` - for (let i = 0; i < ${n*e}; i++) { - data[offset + (((i / ${n})|0) * 4) + (i % ${n})] = v[i]; - } - `}const lt={f32:` - data[offset] = v;`,i32:` - dataInt32[offset] = v;`,"vec2":` - data[offset] = v[0]; - data[offset + 1] = v[1];`,"vec3":` - data[offset] = v[0]; - data[offset + 1] = v[1]; - data[offset + 2] = v[2];`,"vec4":` - data[offset] = v[0]; - data[offset + 1] = v[1]; - data[offset + 2] = v[2]; - data[offset + 3] = v[3];`,"vec2":` - dataInt32[offset] = v[0]; - dataInt32[offset + 1] = v[1];`,"vec3":` - dataInt32[offset] = v[0]; - dataInt32[offset + 1] = v[1]; - dataInt32[offset + 2] = v[2];`,"vec4":` - dataInt32[offset] = v[0]; - dataInt32[offset + 1] = v[1]; - dataInt32[offset + 2] = v[2]; - dataInt32[offset + 3] = v[3];`,"mat2x2":` - data[offset] = v[0]; - data[offset + 1] = v[1]; - data[offset + 4] = v[2]; - data[offset + 5] = v[3];`,"mat3x3":` - data[offset] = v[0]; - data[offset + 1] = v[1]; - data[offset + 2] = v[2]; - data[offset + 4] = v[3]; - data[offset + 5] = v[4]; - data[offset + 6] = v[5]; - data[offset + 8] = v[6]; - data[offset + 9] = v[7]; - data[offset + 10] = v[8];`,"mat4x4":` - for (let i = 0; i < 16; i++) { - data[offset + i] = v[i]; - }`,"mat3x2":_(3,2),"mat4x2":_(4,2),"mat2x3":_(2,3),"mat4x3":_(4,3),"mat2x4":_(2,4),"mat3x4":_(3,4)},Ft={...lt,"mat2x2":` - data[offset] = v[0]; - data[offset + 1] = v[1]; - data[offset + 2] = v[2]; - data[offset + 3] = v[3]; - `};function ut(n,e,t,r,s,a){const i=a?1:-1;return n.identity(),n.a=1/r*2,n.d=i*(1/s*2),n.tx=-1-e*n.a,n.ty=-i-t*n.d,n}const x=new Map;je.register(x);function xe(n,e){if(!x.has(n)){const t=new m({source:new A({resource:n,...e})}),r=()=>{x.get(n)===t&&x.delete(n)};t.once("destroy",r),t.source.once("destroy",r),x.set(n,t)}return x.get(n)}function dt(n){const e=n.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const be=class ye{constructor(e={}){if(this.uid=M("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...ye.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;tr.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof m||e.depthStencilTexture instanceof S?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new S({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,s=!1){this.dirtyId++,this.colorTextures.forEach((a,i)=>{s&&i===0||a.source.resize(e,t,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};be.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let D=be;class Lt{constructor(e){this.rootViewPort=new P,this.viewport=new P,this.onRenderTargetChange=new qe("onRenderTargetChange"),this.projectionMatrix=new g,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:s}){this._renderTargetStack.length=0,this.push(e,t,r,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=dt(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(e,t=!0,r,s){const a=this.getRenderTarget(e),i=this.renderTarget!==a;this.renderTarget=a,this.renderSurface=e;const o=this.getGpuRenderTarget(a);(a.pixelWidth!==o.width||a.pixelHeight!==o.height)&&(this.adaptor.resizeGpuRenderTarget(a),o.width=a.pixelWidth,o.height=a.pixelHeight);const l=a.colorTexture,d=this.viewport,c=l.pixelWidth,h=l.pixelHeight;if(!s&&e instanceof m&&(s=e.frame),s){const p=l._resolution;d.x=s.x*p+.5|0,d.y=s.y*p+.5|0,d.width=s.width*p+.5|0,d.height=s.height*p+.5|0}else d.x=0,d.y=0,d.width=c,d.height=h;return ut(this.projectionMatrix,0,0,d.width/l.resolution,d.height/l.resolution,!a.isRoot),this.adaptor.startRenderPass(a,t,r,d),i&&this.onRenderTargetChange.emit(a),a}clear(e,t=G.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=G.ALL,r,s){const a=this.bind(e,t,r,s);return this._renderTargetStack.push({renderTarget:a,frame:s}),a}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,s,a){r.x<0&&(s.width+=r.x,a.x-=r.x,r.x=0),r.y<0&&(s.height+=r.y,a.y-=r.y,r.y=0);const{pixelWidth:i,pixelHeight:o}=e;return s.width=Math.min(s.width,i-r.x),s.height=Math.min(s.height,o-r.y),this.adaptor.copyToTexture(e,t,r,s,a)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return A.test(e)&&(e=xe(e).source),e instanceof D?t=e:e instanceof S&&(t=new D({colorTextures:[e]}),e.source instanceof A&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null}}class Ht extends $e{constructor({buffer:e,offset:t,size:r}){super(),this.uid=M("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=M("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=M("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()}}class Te{constructor(e){this._renderer=e}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}Te.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"customRender"};function E(n,e){const t=n.instructionSet,r=t.instructions;for(let s=0;s1?1:t,n.worldAlpha=t,n.worldColorAlpha=n.worldColor+((t*255|0)<<24)}function Me(n,e,t){if(e===n.updateTick)return;n.updateTick=e,n.didChange=!1;const r=n.localTransform;n.updateLocalTransform();const s=n.parent;if(s&&!s.renderGroup?(t|=n._updateFlags,n.relativeGroupTransform.appendFrom(r,s.relativeGroupTransform),t&se&&ae(n,s,t)):(t=n._updateFlags,n.relativeGroupTransform.copyFrom(r),t&se&&ae(n,ht,t)),!n.renderGroup){const a=n.children,i=a.length;for(let d=0;d1?1:r,n.groupAlpha=r,n.groupColorAlpha=n.groupColor+((r*255|0)<<24)}t&he&&(n.groupBlendMode=n.localBlendMode==="inherit"?e.groupBlendMode:n.localBlendMode),t&de&&(n.globalDisplayStatus=n.localDisplayStatus&e.globalDisplayStatus),n._updateFlags=0}function pt(n,e){const{list:t}=n.childrenRenderablesToUpdate;let r=!1;for(let s=0;s=0;r--)this._updateCachedRenderGroups(e.renderGroupChildren[r],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){const r=e.root.getLocalBounds();r.ceil();const s=e.texture;e.texture&&y.returnTexture(e.texture,!0);const a=this._renderer,i=e.textureOptions.resolution||a.view.resolution,o=e.textureOptions.antialias??a.view.antialias,l=e.textureOptions.scaleMode??"linear",d=y.getOptimalTexture(r.width,r.height,i,o);d._source.style=new Ke({scaleMode:l}),e.texture=d,e._textureBounds||(e._textureBounds=new L),e._textureBounds.copyFrom(r),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=!0)}}else e.texture&&(y.returnTexture(e.texture,!0),e.texture=null)}_updateRenderGroups(e){const t=this._renderer,r=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=r,e.structureDidChange?O(e.childrenRenderablesToUpdate.list,0):pt(e,r),Ce(e),e.structureDidChange?(e.structureDidChange=!1,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s{if(!n.name)throw new Error("BlendMode extension must have a name property");T[n.name]=n.ref},n=>{delete T[n.name]});class Pe{constructor(e){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(e,t,r){this._blendModeStack.push(t),this.setBlendMode(e,t,r)}popBlendMode(e){this._blendModeStack.pop();const t=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,t,e)}setBlendMode(e,t,r){const s=e instanceof Z;if(this._activeBlendMode===t){this._isAdvanced&&e&&!s&&this._renderableList?.push(e);return}this._isAdvanced&&this._endAdvancedBlendMode(r),this._activeBlendMode=t,e&&(this._isAdvanced=!!T[t],this._isAdvanced&&this._beginAdvancedBlendMode(e,r))}_beginAdvancedBlendMode(e,t){this._renderer.renderPipes.batch.break(t);const r=this._activeBlendMode;if(!T[r]){W(`Unable to assign BlendMode: '${r}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}const s=this._ensureFilterEffect(r),a=e instanceof Z,i={renderPipeId:"filter",action:"pushFilter",filterEffect:s,renderables:a?null:[e],container:a?e.root:null,canBundle:!1};this._renderableList=i.renderables,t.add(i)}_ensureFilterEffect(e){let t=this._filterHash[e];return t||(t=this._filterHash[e]=new le,t.filters=[new T[e]]),t}_endAdvancedBlendMode(e){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}Pe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"blendMode"};const B={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},j=class Ue{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof U||e instanceof m?{target:e,...t}:{...t,...e}}async image(e){const t=z.get().createImage();return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Ue.defaultImageOptions);const{format:t,quality:r}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((a,i)=>{s.toBlob(o=>{if(!o){i(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=i,l.readAsDataURL(o)},B[t],r)});if(s.toDataURL!==void 0)return s.toDataURL(B[t],r);if(s.convertToBlob!==void 0){const a=await s.convertToBlob({type:B[t],quality:r});return new Promise((i,o)=>{const l=new FileReader;l.onload=()=>i(l.result),l.onerror=o,l.readAsDataURL(a)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer;if(t instanceof m)return r.texture.generateCanvas(t);const s=r.textureGenerator.generateTexture(e),a=r.texture.generateCanvas(s);return s.destroy(!0),a}pixels(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer,s=t instanceof m?t:r.textureGenerator.generateTexture(e),a=r.texture.getPixels(s);return t instanceof U&&s.destroy(!0),a}texture(e){return e=this._normalizeOptions(e),e.target instanceof m?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),s=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const a=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",a)}destroy(){this._renderer=null}};j.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"extract"};j.defaultImageOptions={format:"png",quality:1};let _t=j;const vt=new P,xt=new L,bt=[0,0,0,0];class Be{constructor(e){this._renderer=e}generateTexture(e){e instanceof U&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,s=e.target;let a=e.clearColor;a?a=Array.isArray(a)&&a.length===4?a:I.shared.setValue(a).toArray():a=bt;const i=e.frame?.copyTo(vt)||Ye(s,xt).rectangle;i.width=Math.max(i.width,1/t)|0,i.height=Math.max(i.height,1/t)|0;const o=Je.create({...e.textureSourceOptions,width:i.width,height:i.height,resolution:t,antialias:r}),l=g.shared.translate(-i.x,-i.y);return this._renderer.render({container:s,transform:l,target:o,clearColor:a}),o.source.updateMipmaps(),o}destroy(){this._renderer=null}}Be.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGenerator"};const q=class Ge{constructor(e){this._managedResources=[],this._managedResourceHashes=[],this._ready=!1,this._renderer=e}init(e){e={...Ge.defaultOptions,...e},this.maxUnusedTime=e.gcMaxUnusedTime,this._frequency=e.gcFrequency,this.enabled=e.gcActive,this.now=performance.now()}get enabled(){return!!this._handler}set enabled(e){this.enabled!==e&&(e?this._handler=this._renderer.scheduler.repeat(()=>{this._ready=!0},this._frequency,!1):(this._renderer.scheduler.cancel(this._handler),this._handler=0))}prerender({container:e}){this.now=performance.now(),e.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick)}postrender(){!this._ready||!this.enabled||(this.run(),this._ready=!1)}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(const r of e.renderGroupChildren)this._updateInstructionGCTick(r,t)}addResource(e,t){if(e._gcLastUsed!==-1){e._gcLastUsed=this.now,e._onTouch?.(this.now);return}const r=this._managedResources.length;e._gcData={index:r,type:t},e._gcLastUsed=this.now,e._onTouch?.(this.now),e.once("unload",this.removeResource,this),this._managedResources.push(e)}removeResource(e){const t=e._gcData;if(!t)return;const r=t.index,s=this._managedResources.length-1;if(r!==s){const a=this._managedResources[s];this._managedResources[r]=a,a._gcData.index=r}this._managedResources.length--,e._gcData=null,e._gcLastUsed=-1}addResourceHash(e,t,r,s=0){this._managedResourceHashes.push({context:e,hash:t,type:r,priority:s}),this._managedResourceHashes.sort((a,i)=>a.priority-i.priority)}run(){const e=performance.now(),t=this._managedResourceHashes;for(const s of t)this.runOnHash(s,e);let r=0;for(let s=0;s{e.off("unload",this.removeResource,this)}),this._managedResources.length=0,this._managedResourceHashes.length=0,this._renderer=null}};q.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"gc",priority:0};q.defaultOptions={gcActive:!0,gcMaxUnusedTime:6e4,gcFrequency:3e4};let yt=q;class Ae{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e"},uWorldTransformMatrix:{value:new g,type:"mat3x3"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4"},uResolution:{value:[0,0],type:"vec2"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}}Ae.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"globalUniforms"};let Tt=1;class Ie{constructor(){this._tasks=[],this._offset=0}init(){ee.system.add(this._update,this)}repeat(e,t,r=!0){const s=Tt++;let a=0;return r&&(this._offset+=1e3,a=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:a,last:performance.now(),repeat:!0,id:s}),s}cancel(e){for(let t=0;t=r.duration){const s=e-r.start;r.func(s),r.last=e}}}destroy(){ee.system.remove(this._update,this),this._tasks.length=0}}Ie.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"scheduler",priority:0};let ne=!1;function kt(n){if(!ne){if(z.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${te} (${n}) http://www.pixijs.com/ - -`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${te} - ${n} - http://www.pixijs.com/`);ne=!0}}class ${constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===H.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),kt(t)}}}$.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"hello",priority:-2};$.defaultOptions={hello:!1};function Ct(n){let e=!1;for(const r in n)if(n[r]==null){e=!0;break}if(!e)return n;const t=Object.create(null);for(const r in n){const s=n[r];s&&(t[r]=s)}return t}function Mt(n){let e=0;for(let t=0;tthis.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=Ct(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)Mt(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t})}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t})}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=St++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick)}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now)}run(){const e=this._now,t=this._managedRenderables,r=this._renderer.renderPipes;let s=0;for(let a=0;athis.maxUnusedTime){if(!i.destroyed){const d=r;o&&(o.structureDidChange=!0),d[i.renderPipeId].destroyRenderable(i)}i._lastUsed=-1,s++,i.off("destroyed",this._removeRenderable,this)}else t[a-s]=i}t.length-=s}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(e){const t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null)}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(const r of e.renderGroupChildren)this._updateInstructionGCTick(r,t)}};K.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"renderableGC",priority:0};K.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let Rt=K;const Y=class R{get count(){return this._renderer.tick}get checkCount(){return this._checkCount}set checkCount(e){v("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=e}get maxIdle(){return this._renderer.gc.maxUnusedTime/1e3*60}set maxIdle(e){v("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=e/60*1e3}get checkCountMax(){return Math.floor(this._renderer.gc._frequency/1e3)}set checkCountMax(e){v("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.")}get active(){return this._renderer.gc.enabled}set active(e){v("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=e}constructor(e){this._renderer=e,this._checkCount=0}init(e){e.textureGCActive!==R.defaultOptions.textureGCActive&&(this.active=e.textureGCActive),e.textureGCMaxIdle!==R.defaultOptions.textureGCMaxIdle&&(this.maxIdle=e.textureGCMaxIdle),e.textureGCCheckCountMax!==R.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=e.textureGCCheckCountMax)}run(){v("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()}destroy(){this._renderer=null}};Y.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGC"};Y.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let wt=Y;const J=class Ee{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...Ee.defaultOptions,...e},e.view&&(v(Ze,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new P(0,0,e.width,e.height),this.canvas=e.canvas||z.get().createCanvas(),this.antialias=!!e.antialias,this.texture=xe(this.canvas,e),this.renderTarget=new D({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(e=!1){(typeof e=="boolean"?e:e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};J.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"view",priority:0};J.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let Pt=J;const Wt=[gt,Ae,$,Pt,Se,yt,wt,Be,_t,et,Rt,Ie],zt=[Pe,me,Re,ke,ge,ve,_e,Te];export{Ht as B,b as G,Lt as R,Wt as S,Et as U,zt as a,lt as b,Ot as c,C as d,Dt as e,It as f,At as t,Ft as u}; diff --git a/assets/Spinner-C4Ov0as9.js b/assets/Spinner-C4Ov0as9.js deleted file mode 100644 index c3083c763339827b36936f1d4f3302c64c9cb2e6..0000000000000000000000000000000000000000 --- a/assets/Spinner-C4Ov0as9.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as s,f as e}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var a=e('');function f(t){var r=a();s(t,r)}export{f as S}; diff --git a/assets/Square-D8rV3Ea-.js b/assets/Square-D8rV3Ea-.js deleted file mode 100644 index 5bcfdabb65e89e0fad141e1c689e7a71c312e46c..0000000000000000000000000000000000000000 --- a/assets/Square-D8rV3Ea-.js +++ /dev/null @@ -1 +0,0 @@ -import{p as a,a as i}from"./i18n-CPHyzK9b.js";import{M as n,t as u,a as w,O as p,P as l,f as d}from"./index-DydPgVMC.js";var g=d('');function k(f,t){n(t,!1);let e=a(t,"fill",12,"currentColor"),r=a(t,"stroke_width",12,1.5);var h={get fill(){return e()},set fill(o){e(o),l()},get stroke_width(){return r()},set stroke_width(o){r(o),l()}},s=g();return u(()=>{i(s,"fill",e()),i(s,"stroke-width",`${r()}`)}),w(f,s),p(h)}export{k as S}; diff --git a/assets/StaticAudio-BzxlNlBs.js b/assets/StaticAudio-BzxlNlBs.js deleted file mode 100644 index 5e8682cd40b02d18bf62836cb4c779d6a2066bb8..0000000000000000000000000000000000000000 --- a/assets/StaticAudio-BzxlNlBs.js +++ /dev/null @@ -1,27 +0,0 @@ -import{p as se,v as Xn,d as ht,J as Qn,i as Fe,f as Hs,b as wr,a as Ct,M as Mt,A as Jn}from"./i18n-CPHyzK9b.js";import{a as Se,f as ai,ah as kr,M as ms,a7 as oi,ac as Ke,t as xt,O as ps,R as Oe,aa as _e,ab as Zn,Z as P,$ as ge,Q as Te,T as ye,S as ve,X as Pr,N as lt,v as ea,U as xs,a2 as nt,a3 as Fr}from"./index-DydPgVMC.js";import{I as ta}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as sa}from"./BlockLabel-BzVeVrtL.js";import{D as ia}from"./DownloadLink-DM2QmhDx.js";import{E as Or}from"./Empty-B15ItVsj.js";import{S as ra}from"./ShareButton-Cuvs43xM.js";import{D as na}from"./Download-DWSaBiea.js";import{M as Vs}from"./Music-CGJUBXWE.js";import{I as aa}from"./IconButtonWrapper-PnNNNvqI.js";import{g as Nt,u as oa,p as la,s as Ii,M as ca}from"./MinimalAudioPlayer-C59qi7fl.js";import{V as ha,P as ua,T as da}from"./VolumeLevels-B3WBv7ou.js";import{P as fa}from"./Play-CRvn2HoA.js";import{U as ga}from"./Undo-B9SlrYtT.js";var ma=ai('');function pa(a){var e=ma();Se(a,e)}var Ea=ai('CC');function Ta(a){var e=Ea();Se(a,e)}var ya=ai('');function va(a){var e=ya();Se(a,e)}class Mr{constructor(){this.listeners={}}on(e,t,s){if(this.listeners[e]||(this.listeners[e]=new Set),s?.once){const i=(...r)=>{this.un(e,i),t(...r)};return this.listeners[e].add(i),()=>this.un(e,i)}return this.listeners[e].add(t),()=>this.un(e,t)}un(e,t){var s;(s=this.listeners[e])===null||s===void 0||s.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach((s=>s(...t)))}}class xa extends Mr{constructor(e){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=e}onInit(){}_init(e){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach((e=>e())),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}function qt(a,e,t,s,i=3,r=0,n=100){if(!a)return()=>{};const o=matchMedia("(pointer: coarse)").matches;let l=()=>{};const c=h=>{if(h.button!==r)return;h.preventDefault(),h.stopPropagation();let u=h.clientX,d=h.clientY,g=!1;const f=Date.now(),m=A=>{if(A.preventDefault(),A.stopPropagation(),o&&Date.now()-fi||Math.abs(C)>i){const k=a.getBoundingClientRect(),{left:I,top:w}=k;g||(t?.(u-I,d-w),g=!0),e(R,C,x-I,D-w),u=x,d=D}},E=A=>{if(g){const x=A.clientX,D=A.clientY,R=a.getBoundingClientRect(),{left:C,top:k}=R;s?.(x-C,D-k)}l()},T=A=>{A.relatedTarget&&A.relatedTarget!==document.documentElement||E(A)},y=A=>{g&&(A.stopPropagation(),A.preventDefault())},v=A=>{g&&A.preventDefault()};document.addEventListener("pointermove",m),document.addEventListener("pointerup",E),document.addEventListener("pointerout",T),document.addEventListener("pointercancel",T),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("click",y,{capture:!0}),l=()=>{document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",E),document.removeEventListener("pointerout",T),document.removeEventListener("pointercancel",T),document.removeEventListener("touchmove",v),setTimeout((()=>{document.removeEventListener("click",y,{capture:!0})}),10)}};return a.addEventListener("pointerdown",c),()=>{l(),a.removeEventListener("pointerdown",c)}}function Nr(a,e){const t=e.xmlns?document.createElementNS(e.xmlns,a):document.createElement(a);for(const[s,i]of Object.entries(e))if(s==="children"&&i)for(const[r,n]of Object.entries(i))n instanceof Node?t.appendChild(n):typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(Nr(r,n));else s==="style"?Object.assign(t.style,i):s==="textContent"?t.textContent=i:t.setAttribute(s,i.toString());return t}function _t(a,e,t){const s=Nr(a,e||{});return t?.appendChild(s),s}class Di extends Mr{constructor(e,t,s=0){var i,r,n,o,l,c,h,u,d,g;super(),this.totalDuration=t,this.numberOfChannels=s,this.element=null,this.minLength=0,this.maxLength=1/0,this.contentEditable=!1,this.subscriptions=[],this.updatingSide=void 0,this.isRemoved=!1,this.subscriptions=[],this.id=e.id||`region-${Math.random().toString(32).slice(2)}`,this.start=this.clampPosition(e.start),this.end=this.clampPosition((i=e.end)!==null&&i!==void 0?i:e.start),this.drag=(r=e.drag)===null||r===void 0||r,this.resize=(n=e.resize)===null||n===void 0||n,this.resizeStart=(o=e.resizeStart)===null||o===void 0||o,this.resizeEnd=(l=e.resizeEnd)===null||l===void 0||l,this.color=(c=e.color)!==null&&c!==void 0?c:"rgba(0, 0, 0, 0.1)",this.minLength=(h=e.minLength)!==null&&h!==void 0?h:this.minLength,this.maxLength=(u=e.maxLength)!==null&&u!==void 0?u:this.maxLength,this.channelIdx=(d=e.channelIdx)!==null&&d!==void 0?d:-1,this.contentEditable=(g=e.contentEditable)!==null&&g!==void 0?g:this.contentEditable,this.element=this.initElement(),this.setContent(e.content),this.setPart(),this.renderPosition(),this.initMouseEvents()}clampPosition(e){return Math.max(0,Math.min(this.totalDuration,e))}setPart(){var e;const t=this.start===this.end;(e=this.element)===null||e===void 0||e.setAttribute("part",`${t?"marker":"region"} ${this.id}`)}addResizeHandles(e){const t={position:"absolute",zIndex:"2",width:"6px",height:"100%",top:"0",cursor:"ew-resize",wordBreak:"keep-all"},s=_t("div",{part:"region-handle region-handle-left",style:Object.assign(Object.assign({},t),{left:"0",borderLeft:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"2px 0 0 2px"})},e),i=_t("div",{part:"region-handle region-handle-right",style:Object.assign(Object.assign({},t),{right:"0",borderRight:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"0 2px 2px 0"})},e);this.subscriptions.push(qt(s,(r=>this.onResize(r,"start")),(()=>null),(()=>this.onEndResizing("start")),1),qt(i,(r=>this.onResize(r,"end")),(()=>null),(()=>this.onEndResizing("end")),1))}removeResizeHandles(e){const t=e.querySelector('[part*="region-handle-left"]'),s=e.querySelector('[part*="region-handle-right"]');t&&e.removeChild(t),s&&e.removeChild(s)}initElement(){if(this.isRemoved)return null;const e=this.start===this.end;let t=0,s=100;this.channelIdx>=0&&this.numberOfChannels>0&&this.channelIdxthis.emit("click",t))),e.addEventListener("mouseenter",(t=>this.emit("over",t))),e.addEventListener("mouseleave",(t=>this.emit("leave",t))),e.addEventListener("dblclick",(t=>this.emit("dblclick",t))),e.addEventListener("pointerdown",(()=>this.toggleCursor(!0))),e.addEventListener("pointerup",(()=>this.toggleCursor(!1))),this.subscriptions.push(qt(e,(t=>this.onMove(t)),(()=>this.toggleCursor(!0)),(()=>{this.toggleCursor(!1),this.drag&&this.emit("update-end")}))),this.contentEditable&&this.content&&(this.contentClickListener=t=>this.onContentClick(t),this.contentBlurListener=()=>this.onContentBlur(),this.content.addEventListener("click",this.contentClickListener),this.content.addEventListener("blur",this.contentBlurListener)))}_onUpdate(e,t,s){var i;if(!(!((i=this.element)===null||i===void 0)&&i.parentElement))return;const{width:r}=this.element.parentElement.getBoundingClientRect(),n=e/r*this.totalDuration;let o=t&&t!=="start"?this.start:this.start+n,l=t&&t!=="end"?this.end:this.end+n;const c=s!==void 0;c&&this.updatingSide&&this.updatingSide!==t&&(this.updatingSide==="start"?o=s:l=s),o=Math.max(0,o),l=Math.min(this.totalDuration,l);const h=l-o;this.updatingSide=t;const u=h>=this.minLength&&h<=this.maxLength;o<=l&&(u||c)&&(this.start=o,this.end=l,this.renderPosition(),this.emit("update",t))}onMove(e){this.drag&&this._onUpdate(e)}onResize(e,t){this.resize&&(this.resizeStart||t!=="start")&&(this.resizeEnd||t!=="end")&&this._onUpdate(e,t)}onEndResizing(e){this.resize&&(this.emit("update-end",e),this.updatingSide=void 0)}onContentClick(e){e.stopPropagation(),e.target.focus(),this.emit("click",e)}onContentBlur(){this.emit("update-end")}_setTotalDuration(e){this.totalDuration=e,this.renderPosition()}play(e){this.emit("play",e&&this.end!==this.start?this.end:void 0)}getContent(e=!1){var t;return e?this.content||void 0:this.element instanceof HTMLElement?((t=this.content)===null||t===void 0?void 0:t.innerHTML)||void 0:""}setContent(e){var t;if(this.element)if(this.content&&this.contentEditable&&(this.contentClickListener&&this.content.removeEventListener("click",this.contentClickListener),this.contentBlurListener&&this.content.removeEventListener("blur",this.contentBlurListener)),(t=this.content)===null||t===void 0||t.remove(),e){if(typeof e=="string"){const s=this.start===this.end;this.content=_t("div",{style:{padding:`0.2em ${s?.2:.4}em`,display:"inline-block"},textContent:e})}else this.content=e;this.contentEditable&&(this.content.contentEditable="true",this.contentClickListener=s=>this.onContentClick(s),this.contentBlurListener=()=>this.onContentBlur(),this.content.addEventListener("click",this.contentClickListener),this.content.addEventListener("blur",this.contentBlurListener)),this.content.setAttribute("part","region-content"),this.element.appendChild(this.content),this.emit("content-changed")}else this.content=void 0}setOptions(e){var t,s;if(this.element){if(e.color&&(this.color=e.color,this.element.style.backgroundColor=this.color),e.drag!==void 0&&(this.drag=e.drag,this.element.style.cursor=this.drag?"grab":"default"),e.start!==void 0||e.end!==void 0){const i=this.start===this.end;this.start=this.clampPosition((t=e.start)!==null&&t!==void 0?t:this.start),this.end=this.clampPosition((s=e.end)!==null&&s!==void 0?s:i?this.start:this.end),this.renderPosition(),this.setPart()}if(e.content&&this.setContent(e.content),e.id&&(this.id=e.id,this.setPart()),e.resize!==void 0&&e.resize!==this.resize){const i=this.start===this.end;this.resize=e.resize,this.resize&&!i?this.addResizeHandles(this.element):this.removeResizeHandles(this.element)}e.resizeStart!==void 0&&(this.resizeStart=e.resizeStart),e.resizeEnd!==void 0&&(this.resizeEnd=e.resizeEnd)}}remove(){this.isRemoved=!0,this.emit("remove"),this.subscriptions.forEach((e=>e())),this.element&&(this.element.remove(),this.element=null)}}class li extends xa{constructor(e){super(e),this.regions=[],this.regionsContainer=this.initRegionsContainer()}static create(e){return new li(e)}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");this.wavesurfer.getWrapper().appendChild(this.regionsContainer),this.subscriptions.push(this.wavesurfer.on("ready",(t=>{this.regions.forEach((s=>s._setTotalDuration(t)))})));let e=[];this.subscriptions.push(this.wavesurfer.on("timeupdate",(t=>{const s=this.regions.filter((i=>i.start<=t&&(i.end===i.start?i.start+.05:i.end)>=t));s.forEach((i=>{e.includes(i)||this.emit("region-in",i)})),e.forEach((i=>{s.includes(i)||this.emit("region-out",i)})),e=s})))}initRegionsContainer(){return _t("div",{part:"regions-container",style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none"}})}getRegions(){return this.regions}avoidOverlapping(e){e.content&&setTimeout((()=>{const t=e.content,s=t.getBoundingClientRect(),i=this.regions.map((r=>{if(r===e||!r.content)return 0;const n=r.content.getBoundingClientRect();return s.leftr+n),0);t.style.marginTop=`${i}px`}),10)}adjustScroll(e){var t,s;if(!e.element)return;const i=(s=(t=this.wavesurfer)===null||t===void 0?void 0:t.getWrapper())===null||s===void 0?void 0:s.parentElement;if(!i)return;const{clientWidth:r,scrollWidth:n}=i;if(n<=r)return;const o=i.getBoundingClientRect(),l=e.element.getBoundingClientRect(),c=l.left-o.left,h=l.right-o.left;c<0?i.scrollLeft+=c:h>r&&(i.scrollLeft+=h-r)}virtualAppend(e,t,s){const i=()=>{if(!this.wavesurfer)return;const r=this.wavesurfer.getWidth(),n=this.wavesurfer.getScroll(),o=t.clientWidth,l=this.wavesurfer.getDuration(),c=Math.round(e.start/l*o),h=c+(Math.round((e.end-e.start)/l*o)||1)>n&&c{if(!this.wavesurfer||!e.element)return;i();const r=this.wavesurfer.on("scroll",i),n=this.wavesurfer.on("zoom",i);this.subscriptions.push(r,n),e.once("remove",(()=>{r(),n()}))}),0)}saveRegion(e){if(!e.element)return;this.virtualAppend(e,this.regionsContainer,e.element),this.avoidOverlapping(e),this.regions.push(e);const t=[e.on("update",(s=>{s||this.adjustScroll(e),this.emit("region-update",e,s)})),e.on("update-end",(s=>{this.avoidOverlapping(e),this.emit("region-updated",e,s)})),e.on("play",(s=>{var i;(i=this.wavesurfer)===null||i===void 0||i.play(e.start,s)})),e.on("click",(s=>{this.emit("region-clicked",e,s)})),e.on("dblclick",(s=>{this.emit("region-double-clicked",e,s)})),e.on("content-changed",(()=>{this.emit("region-content-changed",e)})),e.once("remove",(()=>{t.forEach((s=>s())),this.regions=this.regions.filter((s=>s!==e)),this.emit("region-removed",e)}))];this.subscriptions.push(...t),this.emit("region-created",e)}addRegion(e){var t,s;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const i=this.wavesurfer.getDuration(),r=(s=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDecodedData())===null||s===void 0?void 0:s.numberOfChannels,n=new Di(e,i,r);return this.emit("region-initialized",n),i?this.saveRegion(n):this.subscriptions.push(this.wavesurfer.once("ready",(o=>{n._setTotalDuration(o),this.saveRegion(n)}))),n}enableDragSelection(e,t=3){var s;const i=(s=this.wavesurfer)===null||s===void 0?void 0:s.getWrapper();if(!(i&&i instanceof HTMLElement))return()=>{};let r=null,n=0,o=0;return qt(i,((l,c,h)=>{r&&r._onUpdate(l,h>n?"end":"start",o)}),(l=>{var c,h;if(n=l,!this.wavesurfer)return;const u=this.wavesurfer.getDuration(),d=(h=(c=this.wavesurfer)===null||c===void 0?void 0:c.getDecodedData())===null||h===void 0?void 0:h.numberOfChannels,{width:g}=this.wavesurfer.getWrapper().getBoundingClientRect();o=n/g*u;const f=l/g*u,m=(l+5)/g*u;r=new Di(Object.assign(Object.assign({},e),{start:f,end:m}),u,d),this.emit("region-initialized",r),r.element&&this.regionsContainer.appendChild(r.element)}),(()=>{r&&(this.saveRegion(r),r.updatingSide=void 0,r=null)}),t)}clearRegions(){this.regions.slice().forEach((e=>e.remove())),this.regions=[]}destroy(){this.clearRegions(),super.destroy(),this.regionsContainer.remove()}}var Sa=Oe('');function La(a,e){ms(e,!0);let t=se(e,"currentVolume",15),s=se(e,"show_volume_slider",15),i;oi(()=>{r()});const r=()=>{let o=i;o&&(o.style.background=`linear-gradient(to right, var(--color-accent) ${(t()??1)*100}%, var(--neutral-400) ${(t()??1)*100}%)`)};Ke(()=>{t(),r()});var n=Sa();Xn(n),n.__focusout=()=>s(!1),n.__input=o=>{o.target instanceof HTMLInputElement&&(t(parseFloat(o.target.value)),e.waveform?.setVolume(t()))},ht(n,o=>i=o,()=>i),xt(()=>Qn(n,t()??1)),Se(a,n),ps()}kr(["focusout","input"]);var Aa=Oe(''),Ra=Oe(''),ba=Oe(''),Ia=Oe(' ',1),Da=Oe(" ",1),Ca=Oe('
                ');function _a(a,e){ms(e,!0);let t=se(e,"show_redo",3,!1),s=se(e,"interactive",3,!1),i=se(e,"mode",15),r=se(e,"waveform_options",19,()=>({})),n=se(e,"trim_region_settings",19,()=>({})),o=se(e,"show_volume_slider",15),l=se(e,"editable",3,!0),c=se(e,"subtitles_toggle",15),h=se(e,"show_subtitles",3,!1),u=se(e,"trimDuration",15),d=[.5,1,1.5,2],g=_e(Zn(d[1])),f=_e(null),m=_e(null),E=_e(null),T=_e(null),y=_e(""),v=_e(1);function A(){e.container&&e.waveform&&!P(f)&&ge(f,e.waveform.registerPlugin(li.create()),!0)}oi(()=>{A()}),Ke(()=>{if(!P(f))return;const z=J=>{J.play()};return P(f).on("region-out",z),()=>{P(f)?.un("region-out",z)}}),Ke(()=>{if(!P(f))return;const z=J=>{u(J.end-J.start)};return P(f).on("region-updated",z),()=>{P(f)?.un("region-updated",z)}}),Ke(()=>{if(!P(f))return;const z=(J,he)=>{he.stopPropagation(),ge(m,J,!0),J.play()};return P(f).on("region-clicked",z),()=>{P(f)?.un("region-clicked",z)}});const x=()=>{P(f)&&(ge(m,P(f)?.addRegion({start:e.audio_duration/4,end:e.audio_duration/2,...n()}),!0),u(P(m).end-P(m).start))};Ke(()=>{if(P(m)){const z=e.container.children[0].shadowRoot;ge(T,z.querySelector('[data-resize="right"]'),!0),ge(E,z.querySelector('[data-resize="left"]'),!0),P(E)&&P(T)&&(P(E).setAttribute("role","button"),P(T).setAttribute("role","button"),P(E)?.setAttribute("aria-label","Drag to adjust start time"),P(T)?.setAttribute("aria-label","Drag to adjust end time"),P(E)?.setAttribute("tabindex","0"),P(T)?.setAttribute("tabindex","0"),P(E).addEventListener("focus",()=>{P(f)&&ge(y,"left")}),P(T).addEventListener("focus",()=>{P(f)&&ge(y,"right")}))}});const D=()=>{if(e.waveform&&P(f)&&P(m)){const z=P(m).start,J=P(m).end;e.handle_trim_audio(z,J),i(""),ge(m,null)}},R=()=>{P(f)?.getRegions().forEach(z=>{z.remove()}),P(f)?.clearRegions()},C=()=>{R(),i()?i(""):(i("edit"),A(),x())},k=()=>{c(!c())},I=(z,J)=>{let he,Ue;P(m)&&(z==="left"?J==="ArrowLeft"?(he=P(m).start-.05,Ue=P(m).end):(he=P(m).start+.05,Ue=P(m).end):J==="ArrowLeft"?(he=P(m).start,Ue=P(m).end-.05):(he=P(m).start,Ue=P(m).end+.05),P(m).setOptions({start:he,end:Ue}),u(P(m).end-P(m).start))};Ke(()=>{if(P(f)){const z=J=>{J.key==="ArrowLeft"?I(P(y),"ArrowLeft"):J.key==="ArrowRight"&&I(P(y),"ArrowRight")};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}}});var w=Ca(),B=Te(w),F=Te(B);F.__click=()=>o(!o());let G;var V=Te(F);ha(V,{get currentVolume(){return P(v)}}),ye(F);var U=ve(F,2);{var Z=z=>{La(z,{get waveform(){return e.waveform},get currentVolume(){return P(v)},set currentVolume(J){ge(v,J,!0)},get show_volume_slider(){return o()},set show_volume_slider(J){o(J)}})};Fe(U,z=>{o()&&z(Z)})}var q=ve(U,2);let O;q.__click=()=>{ge(g,d[(d.indexOf(P(g))+1)%d.length],!0),e.waveform?.setPlaybackRate(P(g))};var M=Te(q),ee=Te(M);ye(M),ye(q),ye(B);var j=ve(B,2),X=Te(j);X.__click=()=>e.waveform?.skip(Nt(e.audio_duration,r().skip_length)*-1);var ae=Te(X);pa(ae),ye(X);var re=ve(X,2);re.__click=()=>e.waveform?.playPause();var de=Te(re);{var Re=z=>{ua(z)},Y=z=>{fa(z)};Fe(de,z=>{e.playing?z(Re):z(Y,!1)})}ye(re);var $=ve(re,2);$.__click=()=>e.waveform?.skip(Nt(e.audio_duration,r().skip_length));var fe=Te($);va(fe),ye($),ye(j);var oe=ve(j,2),be=Te(oe);{var Me=z=>{var J=Aa();J.__click=k;var he=Te(J);Ta(he),ye(J),xt(()=>Hs(J,`color: ${c()?"var(--color-accent)":"var(--neutral-400)"}`)),Se(z,J)};Fe(be,z=>{h()&&z(Me)})}var Ne=ve(be,2);{var et=z=>{var J=Da(),he=lt(J);{var Ue=ke=>{var De=Ra();De.__click=()=>{e.handle_reset_value(),R(),i("")};var ue=Te(De);ga(ue),ye(De),Se(ke,De)};Fe(he,ke=>{t()&&!i()&&ke(Ue)})}var Ot=ve(he,2);{var ys=ke=>{var De=ba();De.__click=C;var ue=Te(De);da(ue),ye(De),Se(ke,De)},vs=ke=>{var De=Ia(),ue=lt(De);ue.__click=D;var Pe=ve(ue,2);Pe.__click=C,Se(ke,De)};Fe(Ot,ke=>{i()?ke(vs,!1):ke(ys)})}Se(z,J)};Fe(Ne,z=>{l()&&s()&&z(et)})}ye(oe),ye(w),xt((z,J,he,Ue)=>{G=Hs(F,"",G,{color:o()?"var(--color-accent)":"var(--neutral-400)"}),O=wr(q,1,"playback icon svelte-lbu5d9",null,O,{hidden:o()}),Ct(q,"aria-label",z),Pr(ee,`${P(g)??""}x`),Ct(X,"aria-label",J),Ct(re,"aria-label",he),Ct($,"aria-label",`Skip forward by ${Ue??""} seconds`)},[()=>`Adjust playback speed to ${d[(d.indexOf(P(g))+1)%d.length]}x`,()=>`Skip backwards by ${Nt(e.audio_duration,r().skip_length)} seconds`,()=>e.playing?e.i18n("audio.pause"):e.i18n("audio.play"),()=>Nt(e.audio_duration,r().skip_length)]),Se(a,w),ps()}kr(["click"]);function wa(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ur={exports:{}};(function(a,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var f=i.exec(g.path);g.netLoc=f[1],g.path=f[2]}g.netLoc&&!g.path&&(g.path="/");var m={scheme:g.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=g.netLoc,d.path[0]!=="/"))if(!d.path)m.path=g.path,d.params||(m.params=g.params,d.query||(m.query=g.query));else{var E=g.path,T=E.substring(0,E.lastIndexOf("/")+1)+d.path;m.path=o.normalizePath(T)}return m.path===null&&(m.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(m)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})(Ur);var ci=Ur.exports;function Ci(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,s)}return t}function Le(a){for(var e=1;e`):ut}function Ua(a,...e){e.forEach(function(t){wt[t]=a[t]?a[t].bind(a):Na(t)})}function Ba(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){Ua(a,"debug","log","info","warn","error");try{wt.log(`Debug logs enabled for "${e}" in hls.js version 1.5.13`)}catch{wt=Ws}}else wt=Ws}const S=wt,Ga=/^(\d+)x(\d+)$/,_i=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ce{constructor(e){typeof e=="string"&&(e=ce.parseAttrList(e)),me(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Ga.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const s={};for(_i.lastIndex=0;(t=_i.exec(e))!==null;){let r=t[2];r.indexOf('"')===0&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1));const n=t[1].trim();s[n]=r}return s}}function $a(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Ka(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Br{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const s=t.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==s[i]){S.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=me(new ce({}),s,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);N(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(N(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&N(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Es{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ie={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Gr{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ie.AUDIO]:null,[ie.VIDEO]:null,[ie.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const s=e.split("@",2);let i;s.length===1?i=t?.byteRangeEndOffset||0:i=parseInt(s[1]),this._byteRange=[i,parseInt(s[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ci.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ss extends Gr{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Es,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!N(this.programDateTime))return null;const e=N(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),s=t.length;if(s>1||s===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ie.AUDIO]=null,e[ie.VIDEO]=null,e[ie.AUDIOVIDEO]=null}}class Ha extends Gr{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Es,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Va=10;class Wa{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?N(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Va}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function hi(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Ya(a){const e=Ys(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function ja(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function za(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=hi(n)):t=Ya(n)}}return t}function Ys(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const At=typeof self<"u"?self:void 0;var le={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},we={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function wi(a){switch(a){case we.FAIRPLAY:return le.FAIRPLAY;case we.PLAYREADY:return le.PLAYREADY;case we.WIDEVINE:return le.WIDEVINE;case we.CLEARKEY:return le.CLEARKEY}}var $r={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function qa(a){if(a===$r.WIDEVINE)return le.WIDEVINE}function ki(a){switch(a){case le.FAIRPLAY:return we.FAIRPLAY;case le.PLAYREADY:return we.PLAYREADY;case le.WIDEVINE:return we.WIDEVINE;case le.CLEARKEY:return we.CLEARKEY}}function Ls(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[le.FAIRPLAY,le.WIDEVINE,le.PLAYREADY,le.CLEARKEY].filter(i=>!!e[i]):[];return!s[le.WIDEVINE]&&t&&s.push(le.WIDEVINE),s}const Kr=(function(a){return At!=null&&(a=At.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null})();function Xa(a,e,t,s){let i;switch(a){case le.FAIRPLAY:i=["cenc","sinf"];break;case le.WIDEVINE:case le.PLAYREADY:i=["cenc"];break;case le.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Qa(i,e,t,s)}function Qa(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs="${r}"`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs="${r}"`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function ft(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const ui=(a,e)=>e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,Hr=(a,e)=>e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,kt=(a,e)=>{const t=e;let s=0;for(;ui(a,e);){s+=10;const i=Ts(a,e+6);s+=i,Hr(a,e+10)&&(s+=10),e+=s}if(s>0)return a.subarray(t,t+s)},Ts=(a,e)=>{let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t},Ja=(a,e)=>ui(a,e)&&Ts(a,e+6)+10<=a.length-e,di=a=>{const e=Wr(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",Za=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Ts(a,4),s=10;return{type:e,size:t,data:a.subarray(s,s+t)}},Wr=a=>{let e=0;const t=[];for(;ui(a,e);){const s=Ts(a,e+6);e+=10;const i=e+s;for(;e+8a.type==="PRIV"?to(a):a.type[0]==="W"?io(a):so(a),to=a=>{if(a.size<2)return;const e=Je(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},so=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const s=Je(a.data.subarray(t),!0);t+=s.length+1;const i=Je(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Je(a.data.subarray(1));return{key:a.type,data:e}},io=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const s=Je(a.data.subarray(t),!0);t+=s.length+1;const i=Je(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Je(a.data);return{key:a.type,data:e}},ro=a=>{if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,t&&(s+=4772185884e-2),Math.round(s)}},Je=(a,e=!1)=>{const t=no();if(t){const c=t.decode(a);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let As;function no(){if(!navigator.userAgent.includes("PlayStation 4"))return!As&&typeof self.TextDecoder<"u"&&(As=new self.TextDecoder("utf-8")),As}const ze={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function oo(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function Q(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const l=Q(a.subarray(i+8,o),e.slice(1));l.length&&ao.apply(t,l)}i=o}return t}function lo(a){const e=[],t=a[0];let s=8;const i=K(a,s);s+=4;let r=0,n=0;t===0?(r=K(a,s),n=K(a,s+4),s+=8):(r=Pi(a,s),n=Pi(a,s+8),s+=16),s+=2;let o=a.length+n;const l=jr(a,s);s+=2;for(let c=0;c>>31===1)return S.warn("SIDX has hierarchical references (not supported)"),null;const f=K(a,h);h+=4,e.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:l,references:e}}function qr(a){const e=[],t=Q(a,["moov","trak"]);for(let i=0;i{const r=K(i,4),n=e[r];n&&(n.default={duration:K(i,12),flags:K(i,20)})}),e}function co(a){const e=a.subarray(8),t=e.subarray(86),s=pe(e.subarray(4,8));let i=s;const r=s==="enca"||s==="encv";if(r){const o=Q(e,[s])[0].subarray(s==="enca"?28:78);Q(o,["sinf"]).forEach(c=>{const h=Q(c,["schm"])[0];if(h){const u=pe(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const d=Q(c,["frma"])[0];d&&(i=pe(d))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const n=Q(t,["avcC"])[0];i+="."+Ut(n[1])+Ut(n[2])+Ut(n[3]);break}case"mp4a":{const n=Q(e,[s])[0],o=Q(n.subarray(28),["esds"])[0];if(o&&o.length>12){let l=4;if(o[l++]!==3)break;l=bs(o,l),l+=2;const c=o[l++];if(c&128&&(l+=2),c&64&&(l+=o[l++]),o[l++]!==4)break;l=bs(o,l);const h=o[l++];if(h===64)i+="."+Ut(h);else break;if(l+=12,o[l++]!==5)break;l=bs(o,l);const u=o[l++];let d=(u&248)>>3;d===31&&(d+=1+((u&7)<<3)+((o[l]&224)>>5)),i+="."+d}break}case"hvc1":case"hev1":{const n=Q(t,["hvcC"])[0],o=n[1],l=["","A","B","C"][o>>6],c=o&31,h=K(n,2),u=(o&32)>>5?"H":"L",d=n[12],g=n.subarray(6,12);i+="."+l+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+d;let f="";for(let m=g.length;m--;){const E=g[m];(E||f)&&(f="."+E.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const n=Q(t,["dvcC"])[0],o=n[2]>>1&127,l=n[2]<<5&32|n[3]>>3&31;i+="."+je(o)+"."+je(l);break}case"vp09":{const n=Q(t,["vpcC"])[0],o=n[4],l=n[5],c=n[6]>>4&15;i+="."+je(o)+"."+je(l)+"."+je(c);break}case"av01":{const n=Q(t,["av1C"])[0],o=n[1]>>>5,l=n[1]&31,c=n[2]>>>7?"H":"M",h=(n[2]&64)>>6,u=(n[2]&32)>>5,d=o===2&&h?u?12:10:h?10:8,g=(n[2]&16)>>4,f=(n[2]&8)>>3,m=(n[2]&4)>>2,E=n[2]&3;i+="."+o+"."+je(l)+c+"."+je(d)+"."+g+"."+f+m+E+"."+je(1)+"."+je(1)+"."+je(1)+"."+0;break}}return{codec:i,encrypted:r}}function bs(a,e){const t=e+5;for(;a[e++]&128&&e{const n=Q(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=Q(n,["enca"]);const l=o.length>0;l||(o=Q(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);Q(h,["sinf"]).forEach(d=>{const g=Xr(d);if(g){const f=g.subarray(8,24);f.some(m=>m!==0)||(S.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${ze.hexDump(f)} -> ${ze.hexDump(t)}`),g.set(t,8))}})})}),a}function Xr(a){const e=Q(a,["schm"])[0];if(e){const t=pe(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Q(a,["schi","tenc"])[0]}return S.error("[eme] missing 'schm' box"),null}function uo(a,e){return Q(e,["moof","traf"]).reduce((t,s)=>{const i=Q(s,["tfdt"])[0],r=i[0],n=Q(s,["tfhd"]).reduce((o,l)=>{const c=K(l,4),h=a[c];if(h){let u=K(i,4);if(r===1){if(u===rs)return S.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=rs+1,u+=K(i,8)}const d=h.timescale||9e4,g=u/d;if(N(g)&&(o===null||gg+f.info.duration||0,0);o=Math.max(o,d+u.earliestPresentationTime/u.timescale),l=o-n}}if(l&&N(l))return l}return s||i}function go(a){const e=K(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let s=0;const i=K(a,4);for(let r=0;r{Q(s,["tfhd"]).forEach(i=>{const r=K(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;Q(s,["tfdt"]).forEach(l=>{const c=l[0],h=t*o;if(h){let u=K(l,4);if(c===0)u-=h,u=Math.max(u,0),Rs(l,4,u);else{u*=Math.pow(2,32),u+=K(l,8),u-=h,u=Math.max(u,0);const d=Math.floor(u/(rs+1)),g=Math.floor(u%(rs+1));Rs(l,4,d),Rs(l,8,g)}}})})})}function po(a){const e={valid:null,remainder:null},t=Q(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=ft(a,0,s.byteOffset-8),e.remainder=ft(a,s.byteOffset-8),e}function He(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Fi(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return Q(s,["moof"]).map(l=>{const c=l.byteOffset-8;Q(l,["traf"]).map(u=>{const d=Q(u,["tfdt"]).map(g=>{const f=g[0];let m=K(g,4);return f===1&&(m*=Math.pow(2,32),m+=K(g,8)),m/i})[0];return d!==void 0&&(a=d),Q(u,["tfhd"]).map(g=>{const f=K(g,4),m=K(g,0)&16777215,E=(m&1)!==0,T=(m&2)!==0,y=(m&8)!==0;let v=0;const A=(m&16)!==0;let x=0;const D=(m&32)!==0;let R=8;f===r&&(E&&(R+=8),T&&(R+=4),y&&(v=K(g,R),R+=4),A&&(x=K(g,R),R+=4),D&&(R+=4),e.type==="video"&&(n=Eo(e.codec)),Q(u,["trun"]).map(C=>{const k=C[0],I=K(C,0)&16777215,w=(I&1)!==0;let B=0;const F=(I&4)!==0,G=(I&256)!==0;let V=0;const U=(I&512)!==0;let Z=0;const q=(I&1024)!==0,O=(I&2048)!==0;let M=0;const ee=K(C,4);let j=8;w&&(B=K(C,j),j+=4),F&&(j+=4);let X=B+c;for(let ae=0;ae>1&63;return t===39||t===40}else return(e&31)===6}function Qr(a,e,t,s){const i=Jr(a);let r=0;r+=e;let n=0,o=0,l=0;for(;r=i.length)break;l=i[r++],n+=l}while(l===255);o=0;do{if(r>=i.length)break;l=i[r++],o+=l}while(l===255);const c=i.length-r;let h=r;if(oc){S.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const d=jr(i,h);if(h+=2,d===49){const g=K(i,h);if(h+=4,g===1195456820){const f=i[h++];if(f===3){const m=i[h++],E=31&m,T=64&m,y=T?2+E*3:0,v=new Uint8Array(y);if(T){v[0]=m;for(let A=1;A16){const u=[];for(let f=0;f<16;f++){const m=i[h++].toString(16);u.push(m.length==1?"0"+m:m),(f===3||f===5||f===7||f===9)&&u.push("-")}const d=o-16,g=new Uint8Array(d);for(let f=0;f>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),vo([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t||new Uint8Array)}function So(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(a),s=t.getUint32(0);if(a.byteLength!==s&&s>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=ze.hexDump(new Uint8Array(a,12,16));const r=t.getUint32(28);if(e.version===0){if(s-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case we.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=xo(s,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=hi(h).subarray(0,16);ja(u),this.keyId=u}}break}default:{let s=t.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=Bt[this.uri];if(!s){const i=Object.keys(Bt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),Bt[this.uri]=s}this.keyId=s}return this}}function Lo(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Zr=/\{\$([a-zA-Z0-9-_]+)\}/g;function Oi(a){return Zr.test(a)}function Ce(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let s=t.length;s--;){const i=t[s],r=e[i];r&&(e[i]=js(a,r))}}function js(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Zr,s=>{const i=s.substring(2,s.length-1),r=t?.[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function Mi(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Ao(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}function gt(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ro(a){return typeof self<"u"&&a===self.ManagedMediaSource}const ns={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function bo(a,e){const t=ns[e];return!!t&&!!t[a.slice(0,4)]}function Is(a,e,t=!0){return!a.split(",").some(s=>!en(s,e,t))}function en(a,e,t=!0){var s;const i=gt(t);return(s=i?.isTypeSupported(Ft(a,e)))!=null?s:!1}function Ft(a,e){return`${e}/mp4;codecs="${a}"`}function Ni(a){if(a){const e=a.substring(0,4);return ns.video[e]}return 2}function as(a){return a.split(",").reduce((e,t)=>{const s=ns.video[t];return s?(s*2+e)/(e?3:2):(ns.audio[t]+e)/(e?2:1)},0)}const Ds={};function Io(a,e=!0){if(Ds[a])return Ds[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let s=0;sIo(t.toLowerCase(),e))}function Ui(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function Co(a){const e=a.split(",");for(let t=0;t2){let i=s.shift()+".";i+=parseInt(s.shift()).toString(16),i+=("000"+parseInt(s.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const Bi=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Gi=/#EXT-X-MEDIA:(.*)/g,_o=/^#EXT(?:INF|-X-TARGETDURATION):/m,$i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),wo=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Xe{static findGroup(e,t){for(let s=0;s0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Gi.lastIndex=0;(i=Gi.exec(e))!==null;){const c=new ce(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,Ce(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const g=c.LANGUAGE,f=c["ASSOC-LANGUAGE"],m=c.CHANNELS,E=c.CHARACTERISTICS,T=c["INSTREAM-ID"],y={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",name:c.NAME||g||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:g,url:c.URI?Xe.resolve(c.URI,t):""};if(f&&(y.assocLang=f),m&&(y.channels=m),E&&(y.characteristics=E),T&&(y.instreamId=T),u!=null&&u.length){const v=Xe.findGroup(u,y.groupId)||u[0];Vi(y,v,"audioCodec"),Vi(y,v,"textCodec")}d.push(y)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){const o=new Wa(t),l=o.fragments;let c=null,h=0,u=0,d=0,g=0,f=null,m=new Ss(i,t),E,T,y,v=-1,A=!1,x=null;for($i.lastIndex=0,o.m3u8=e,o.hasVariableRefs=Oi(e);(E=$i.exec(e))!==null;){A&&(A=!1,m=new Ss(i,t),m.start=d,m.sn=h,m.cc=g,m.level=s,c&&(m.initSegment=c,m.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,x&&(m.setByteRange(x),x=null)));const k=E[1];if(k){m.duration=parseFloat(k);const I=(" "+E[2]).slice(1);m.title=I||null,m.tagList.push(I?["INF",k,I]:["INF",k])}else if(E[3]){if(N(m.duration)){m.start=d,y&&ji(m,y,o),m.sn=h,m.level=s,m.cc=g,l.push(m);const I=(" "+E[3]).slice(1);m.relurl=js(o,I),Wi(m,f),f=m,d+=m.duration,h++,u=0,A=!0}}else if(E[4]){const I=(" "+E[4]).slice(1);f?m.setByteRange(I,f):m.setByteRange(I)}else if(E[5])m.rawProgramDateTime=(" "+E[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),v===-1&&(v=l.length);else{if(E=E[0].match(wo),!E){S.warn("No matches on slow regex match for level playlist!");continue}for(T=1;T0&&F.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=F.optionalFloat("PART-HOLD-BACK",0),o.holdBack=F.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const F=new ce(w);o.partTarget=F.decimalFloatingPoint("PART-TARGET");break}case"PART":{let F=o.partList;F||(F=o.partList=[]);const G=u>0?F[F.length-1]:void 0,V=u++,U=new ce(w);Ce(o,U,["BYTERANGE","URI"]);const Z=new Ha(U,m,t,V,G);F.push(Z),m.duration+=Z.duration;break}case"PRELOAD-HINT":{const F=new ce(w);Ce(o,F,["URI"]),o.preloadHint=F;break}case"RENDITION-REPORT":{const F=new ce(w);Ce(o,F,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(F);break}default:S.warn(`line parsed but not handled: ${E}`);break}}}f&&!f.relurl?(l.pop(),d-=f.duration,o.partList&&(o.fragmentHint=f)):o.partList&&(Wi(m,f),m.cc=g,o.fragmentHint=m,y&&ji(m,y,o));const D=l.length,R=l[0],C=l[D-1];if(d+=o.skippedSegments*o.targetduration,d>0&&D&&C){o.averagetargetduration=d/D;const k=C.sn;o.endSN=k!=="initSegment"?k:0,o.live||(C.endList=!0),R&&(o.startCC=R.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=g,v>0&&Po(l,v),o}}function Ki(a,e,t){var s,i;const r=new ce(a);Ce(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&S.error(`Invalid IV: ${r.IV}`);const u=o?Xe.resolve(o,e):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Pt(n,u,h,d,l)}function Hi(a){const t=new ce(a).decimalFloatingPoint("TIME-OFFSET");return N(t)?t:null}function ko(a,e){let t=(a||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const i=t.filter(r=>bo(r,s));i.length&&(e[`${s}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Vi(a,e,t){const s=e[t];s&&(a[t]=s)}function Po(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Wi(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),N(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Yi(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function ji(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}var te={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},H={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function zi(a){const{type:e}=a;switch(e){case te.AUDIO_TRACK:return H.AUDIO;case te.SUBTITLE_TRACK:return H.SUBTITLE;default:return H.MAIN}}function Cs(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Fo{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,s=t.pLoader,i=t.loader,r=s||i,n=new r(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:s}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:te.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(e,t){const{id:s,level:i,pathwayId:r,url:n,deliveryDirectives:o}=t;this.load({id:s,level:i,pathwayId:r,responseType:"text",type:te.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:te.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:te.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(e){var t;const s=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){S.trace("[playlist-loader]: playlist request ongoing");return}S.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===te.MANIFEST?r=s.manifestLoadPolicy.default:r=me({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),N((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===te.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===te.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===te.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=me({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const g=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=c.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),Xe.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,g):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,o,l)}handleMasterPlaylist(e,t,s,i){const r=this.hls,n=e.data,o=Cs(e,s),l=Xe.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(e,s,l.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f}=l;this.variableList=f;const{AUDIO:m=[],SUBTITLES:E,"CLOSED-CAPTIONS":T}=Xe.parseMasterPlaylistMedia(n,o,l);m.length&&!m.some(v=>!v.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(S.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ce({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:h,audioTracks:m,subtitles:E,captions:T,contentSteering:c,url:o,stats:t,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f})}handleTrackOrLevelPlaylist(e,t,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Cs(e,s),u=0,d=N(l)?l:N(o)?o:0,g=zi(s),f=Xe.parseLevelPlaylist(e.data,h,d,g,u,this.variableList);if(c===te.MANIFEST){const m={attrs:new ce({}),bitrate:0,details:f,name:"",url:h};n.trigger(p.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),s.levelDetails=f,this.handlePlaylistLoaded(f,e,t,s,i,r)}handleManifestParsingError(e,t,s,i,r){this.hls.trigger(p.ERROR,{type:W.NETWORK_ERROR,details:b.MANIFEST_PARSING_ERROR,fatal:t.type===te.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,s=!1,i,r){let n=`A network ${s?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===te.LEVEL?n+=`: ${e.level} id: ${e.id}`:(e.type===te.AUDIO_TRACK||e.type===te.SUBTITLE_TRACK)&&(n+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(n);S.warn(`[playlist-loader]: ${n}`);let l=b.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case te.MANIFEST:l=s?b.MANIFEST_LOAD_TIMEOUT:b.MANIFEST_LOAD_ERROR,c=!0;break;case te.LEVEL:l=s?b.LEVEL_LOAD_TIMEOUT:b.LEVEL_LOAD_ERROR,c=!1;break;case te.AUDIO_TRACK:l=s?b.AUDIO_TRACK_LOAD_TIMEOUT:b.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case te.SUBTITLE_TRACK:l=s?b.SUBTITLE_TRACK_LOAD_TIMEOUT:b.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:W.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const d=t?.url||e.url;u.response=Le({url:d,data:void 0},i)}this.hls.trigger(p.ERROR,u)}handlePlaylistLoaded(e,t,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,g=Cs(t,i),f=zi(i),m=typeof i.level=="number"&&f===H.MAIN?c:void 0;if(!e.fragments.length){const T=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:W.NETWORK_ERROR,details:b.LEVEL_EMPTY_ERROR,fatal:!1,url:g,error:T,reason:T.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const E=e.playlistParsingError;if(E){o.trigger(p.ERROR,{type:W.NETWORK_ERROR,details:b.LEVEL_PARSING_ERROR,fatal:!1,url:g,error:E,reason:E.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case te.MANIFEST:case te.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,level:m||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case te.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case te.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function tn(a,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function sn(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){S.debug(`[texttrack-utils]: ${s}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){S.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function vt(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function zs(a,e,t,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Mo(a.cues,e,t);for(let n=0;na[t].endTime)return-1;let s=0,i=t;for(;s<=i;){const r=Math.floor((i+s)/2);if(ea[r].startTime&&s-1)for(let r=i,n=a.length;r=e&&o.endTime<=t)s.push(o);else if(o.startTime>t)return s}return s}function Xt(a){const e=[];for(let t=0;t"u"))return self.VTTCue||self.TextTrackCue}function qi(a,e,t,s,i){let r=new a(e,t,"");try{r.value=s,i&&(r.type=i)}catch{r=new a(e,t,JSON.stringify(i?Le({type:i},s):s))}return r}const Gt=(()=>{const a=qs();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function _s(a,e){return a.getTime()/1e3-e}function Uo(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Bo{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(vt(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tGt&&(u=Gt),u-h<=0&&(u=h+No);for(let g=0;gh.type===Ye.audioId3&&l:i==="video"?c=h=>h.type===Ye.emsg&&o:c=h=>h.type===Ye.audioId3&&l||h.type===Ye.emsg&&o,zs(r,t,s,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=t,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(g=>{i.removeCue(s[d].cues[g])}),delete s[d]}}const o=t.fragments[t.fragments.length-1];if(n.length===0||!N(o?.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=qs();for(let h=0;h{if(D!==d.id){const R=r[D];if(R.class===d.class&&R.startDate>d.startDate&&(!x||d.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:s,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||t;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,s=this.levelDetails;if(e===null||t===null||s===null)return null;const i=s.edge,r=e-t-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(p.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var s;t.details===b.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&S.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+t.targetduration);if(o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const Xs=["NONE","TYPE-0","TYPE-1",null];function $o(a){return Xs.indexOf(a)>-1}const ls=["SDR","PQ","HLG"];function Ko(a){return!!a&&ls.indexOf(a)>-1}var Qt={No:"",Yes:"YES",v2:"v2"};function Xi(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Ji(this._audioGroups,e)}hasSubtitleGroup(e){return Ji(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Ji(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function ws(a,e){const t=e.startPTS;if(N(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&(i.duration=s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function rn(a,e,t,s,i,r){s-t<=0&&(S.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let o=t,l=s;const c=e.startPTS,h=e.endPTS;if(N(c)){const E=Math.abs(c-t);N(e.deltaPTS)?e.deltaPTS=Math.max(E,e.deltaPTS):e.deltaPTS=E,o=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=s-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const d=e.sn;if(!a||da.endSN)return 0;let g;const f=d-a.startSN,m=a.fragments;for(m[f]=e,g=f;g>0;g--)ws(m[g],m[g-1]);for(g=f;g=0;l--){const c=s[l].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(Yo(a,e,(l,c)=>{l.relurl&&(i=l.cc-c.cc),N(l.startPTS)&&N(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,l.initSegment&&(c.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){S.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=Vo(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const n=e.fragments;if(i){S.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?rn(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):nn(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const l=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=l),e.driftEndTime=o,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function Vo(a,e,t){const s=me({},a);return t&&t.forEach(i=>{delete s[i]}),Object.keys(e).forEach(i=>{const r=new Br(e[i].attr,s[i]);r.isValid?s[i]=r:S.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),s}function Wo(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function Yo(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||Qs(e,s[t].start)}function Qs(a,e){if(e){const t=a.fragments;for(let s=a.skippedSegments;se){const r=s[s.length-1].duration*1e3;r{const{details:s}=e;s!=null&&s.fragments&&s.fragments.forEach(i=>{i.level=t})})}function cs(a){switch(a.details){case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_TIMEOUT:case b.LEVEL_LOAD_TIMEOUT:case b.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function er(a,e){const t=cs(e);return a.default[`${t?"timeout":"error"}Retry`]}function fi(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function tr(a){return Le(Le({},a),{errorRetry:null,timeoutRetry:null})}function hs(a,e,t,s){if(!a)return!1;const i=s?.code,r=e499)}const ln={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function Xo(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!N(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r0&&o<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&Js(t,s,r)===0||Qo(r,a,Math.min(i,s))))return r;const n=ln.search(e,Js.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Qo(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function Js(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function Jo(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function Zo(a,e){return ln.search(a,t=>t.cce?-1:0)}var Ae={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},Ve={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2};class el{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=S.log.bind(S,"[info]:"),this.warn=S.warn.bind(S,"[warning]:"),this.error=S.error.bind(S,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return e?.type===H.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var s,i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case b.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction={action:Ae.DoNothing,flags:Ve.None};return}case b.FRAG_GAP:case b.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Ae.SendAlternateToPenaltyBox;return}case b.LEVEL_EMPTY_ERROR:case b.LEVEL_PARSING_ERROR:{var o,l;const c=t.parent===H.MAIN?t.level:r.loadLevel;t.details===b.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(l=o.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case b.LEVEL_LOAD_ERROR:case b.LEVEL_LOAD_TIMEOUT:typeof n?.level=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case b.AUDIO_TRACK_LOAD_ERROR:case b.AUDIO_TRACK_LOAD_TIMEOUT:case b.SUBTITLE_LOAD_ERROR:case b.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===te.AUDIO_TRACK&&c.hasAudioGroup(n.groupId)||n.type===te.SUBTITLE_TRACK&&c.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Ae.SendAlternateToPenaltyBox,t.errorAction.flags=Ve.MoveAllAlternatesMatchingHost;return}}return;case b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c?.attrs["HDCP-LEVEL"];h?t.errorAction={action:Ae.SendAlternateToPenaltyBox,flags:Ve.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case b.BUFFER_ADD_CODEC_ERROR:case b.REMUX_ALLOC_ERROR:case b.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case b.INTERNAL_EXCEPTION:case b.BUFFER_APPENDING_ERROR:case b.BUFFER_FULL_ERROR:case b.LEVEL_SWITCH_ERROR:case b.BUFFER_STALLED_ERROR:case b.BUFFER_SEEK_OVER_HOLE:case b.BUFFER_NUDGE_ON_STALL:t.errorAction={action:Ae.DoNothing,flags:Ve.None};return}t.type===W.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=er(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(hs(i,r,cs(e),e.response))return{action:Ae.RetryRequest,flags:Ve.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=er(e.details.startsWith("key")?n:r,e),l=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==b.FRAG_GAP&&i.fragmentError++,hs(o,l,cs(e),e.response)))return{action:Ae.RetryRequest,flags:Ve.None,retryConfig:o,retryCount:l};const c=this.getLevelSwitchAction(e,s);return o&&(c.retryConfig=o,c.retryCount=l),c}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const c=e.details;i.loadError++,c===b.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:d,minAutoLevel:g,maxAutoLevel:f}=s;s.autoLevelEnabled||(s.loadLevel=-1);const m=(r=e.frag)==null?void 0:r.type,T=(m===H.AUDIO&&c===b.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===b.BUFFER_ADD_CODEC_ERROR||c===b.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:D})=>i.audioCodec!==D),v=e.sourceBufferName==="video"&&(c===b.BUFFER_ADD_CODEC_ERROR||c===b.BUFFER_APPEND_ERROR)&&u.some(({codecSet:D,audioCodec:R})=>i.codecSet!==D&&i.audioCodec===R),{type:A,groupId:x}=(n=e.context)!=null?n:{};for(let D=u.length;D--;){const R=(D+d)%u.length;if(R!==d&&R>=g&&R<=f&&u[R].loadError===0){var o,l;const C=u[R];if(c===b.FRAG_GAP&&m===H.MAIN&&e.frag){const k=u[R].details;if(k){const I=us(e.frag,k.fragments,e.frag.start);if(I!=null&&I.gap)continue}}else{if(A===te.AUDIO_TRACK&&C.hasAudioGroup(x)||A===te.SUBTITLE_TRACK&&C.hasSubtitleGroup(x))continue;if(m===H.AUDIO&&(o=i.audioGroups)!=null&&o.some(k=>C.hasAudioGroup(k))||m===H.SUBTITLE&&(l=i.subtitleGroups)!=null&&l.some(k=>C.hasSubtitleGroup(k))||T&&i.audioCodec===C.audioCodec||!T&&i.audioCodec!==C.audioCodec||v&&i.codecSet===C.codecSet)continue}h=R;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Ae.SendAlternateToPenaltyBox,flags:Ve.None,nextAutoLevel:h}}return{action:Ae.SendAlternateToPenaltyBox,flags:Ve.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case Ae.DoNothing:break;case Ae.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==b.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case Ve.None:this.switchLevel(e,n);break;case Ve.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=Xs[Xs.indexOf(r)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(e,n)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class gi{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=S.log.bind(S,`${t}:`),this.warn=S.warn.bind(S,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,s){const i=t?.renditionReports;if(i){let r=-1;for(let n=0;n=0&&h>t.partTarget&&(l+=1)}const c=s&&Xi(s);return new Qi(o,l>=0?l:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,s){const{details:i,stats:r}=t,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),s&&i.fragments.length>0&&Ho(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const E=this.hls.config.lowLatencyMode,T=i.lastPartSn,y=i.endSN,v=i.lastPartIndex,A=v!==-1,x=T===y,D=E?0:v;A?(c=x?y+1:T,h=x?D:v+1):c=y+1;const R=i.age,C=R+i.ageHeader;let k=Math.min(C-i.partTarget,i.targetduration*1.5);if(k>0){if(s&&k>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${k} with playlist age: ${i.age}`),k=0;else{const I=Math.floor(k/i.targetduration);if(c+=I,h!==void 0){const w=Math.round(k%i.targetduration/i.partTarget);h+=w}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${k} skip sn ${I} to part ${h}`)}i.tuneInGoal=k}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),E||!x){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,g=(i.edge-d)*1e3,f=jo(i,g);i.updated&&n>this.requestScheduled+f&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+fthis.loadPlaylist(l),m)}else this.clearTimer()}getDeliveryDirectives(e,t,s,i){let r=Xi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(s=t.msn,i=t.part,r=Qt.No),new Qi(s,i,r)}checkRetry(e){const t=e.details,s=cs(e),i=e.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===Ae.RetryRequest||!i.resolved&&r===Ae.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=fi(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return l}}class mt{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class tl{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new mt(e),this.fast_=new mt(t),this.defaultTTFB_=i,this.ttfb_=new mt(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new mt(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new mt(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new mt(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const cn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},sr={};function sl(a,e,t,s,i,r){const n=a.audioCodec?a.audioGroups:null,o=r?.audioCodec,l=r?.channels,c=l?parseInt(l):o?1/0:2;let h=null;if(n!=null&&n.length)try{n.length===1&&n[0]?h=e.groups[n[0]].channels:h=n.reduce((u,d)=>{if(d){const g=e.groups[d];if(!g)throw new Error(`Audio track group ${d} not found`);Object.keys(g.channels).forEach(f=>{u[f]=(u[f]||0)+g.channels[f]})}return u},{2:0})}catch{return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!h&&N(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function il(a,e,t){const s=a.videoCodec,i=a.audioCodec;if(!s||!i||!t)return Promise.resolve(cn);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},n=a.videoRange;n!=="SDR"&&(r.transferFunction=n.toLowerCase());const o=s.split(",").map(l=>({type:"media-source",video:Le(Le({},r),{},{contentType:Ft(l,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(l=>{var c;l&&((c=e.groups[l])==null||c.tracks.forEach(h=>{if(h.groupId===l){const u=h.channels||"",d=parseFloat(u);N(d)&&d>2&&o.push.apply(o,i.split(",").map(g=>({type:"media-source",audio:{contentType:Ft(g,"audio"),channels:""+d}})))}}))}),Promise.all(o.map(l=>{const c=rl(l);return sr[c]||(sr[c]=t.decodingInfo(l))})).then(l=>({supported:!l.some(c=>!c.supported),configurations:o,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:o,decodingInfoResults:[],error:l}))}function rl(a){const{audio:e,video:t}=a,s=t||e;if(s){const i=s.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function nl(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function al(a,e){let t=!1,s=[];return a&&(t=a!=="SDR",s=[a]),e&&(s=e.allowedVideoRanges||ls.slice(0),t=e.preferHDR!==void 0?e.preferHDR:nl(),t?s=s.filter(i=>i!=="SDR"):s=["SDR"]),{preferHDR:t,allowedVideoRanges:s}}function ol(a,e,t,s,i){const r=Object.keys(a),n=s?.channels,o=s?.audioCodec,l=n&&parseInt(n)===2;let c=!0,h=!1,u=1/0,d=1/0,g=1/0,f=0,m=[];const{preferHDR:E,allowedVideoRanges:T}=al(e,i);for(let x=r.length;x--;){const D=a[r[x]];c=D.channels[2]>0,u=Math.min(u,D.minHeight),d=Math.min(d,D.minFramerate),g=Math.min(g,D.minBitrate);const R=T.filter(C=>D.videoRanges[C]>0);R.length>0&&(h=!0,m=R)}u=N(u)?u:0,d=N(d)?d:0;const y=Math.max(1080,u),v=Math.max(30,d);return g=N(g)?g:t,t=Math.max(g,t),h||(e=void 0,m=[]),{codecSet:r.reduce((x,D)=>{const R=a[D];if(D===x)return x;if(R.minBitrate>t)return tt(D,`min bitrate of ${R.minBitrate} > current estimate of ${t}`),x;if(!R.hasDefaultAudio)return tt(D,"no renditions with default or auto-select sound found"),x;if(o&&D.indexOf(o.substring(0,4))%5!==0)return tt(D,`audio codec preference "${o}" not found`),x;if(n&&!l){if(!R.channels[n])return tt(D,`no renditions with ${n} channel sound found (channels options: ${Object.keys(R.channels)})`),x}else if((!o||l)&&c&&R.channels[2]===0)return tt(D,"no renditions with stereo sound found"),x;return R.minHeight>y?(tt(D,`min resolution of ${R.minHeight} > maximum of ${y}`),x):R.minFramerate>v?(tt(D,`min framerate of ${R.minFramerate} > maximum of ${v}`),x):m.some(C=>R.videoRanges[C]>0)?R.maxScore=as(x)||R.fragmentError>a[x].fragmentError)?x:(f=R.maxScore,D):(tt(D,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),x)},void 0),videoRanges:m,preferHDR:E,minFramerate:d,minBitrate:g}}function tt(a,e){S.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function ll(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function cl(a,e,t,s){return a.slice(t,s+1).reduce((i,r)=>{if(!r.codecSet)return i;const n=r.audioGroups;let o=i[r.codecSet];o||(i[r.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!n,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return o.minHeight=Math.min(o.minHeight,l),o.minFramerate=Math.min(o.minFramerate,r.frameRate),o.maxScore=Math.max(o.maxScore,r.score),o.fragmentError+=r.fragmentError,o.videoRanges[r.videoRange]=(o.videoRanges[r.videoRange]||0)+1,n&&n.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{o.channels[u]=(o.channels[u]||0)+h.channels[u]}))}),i},{})}function Qe(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function pt(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function ul(a,e,t,s,i){const r=e[s],o=e.reduce((d,g,f)=>{const m=g.uri;return(d[m]||(d[m]=[])).push(f),d},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const l=r.videoRange,c=r.frameRate,h=r.codecSet.substring(0,4),u=ir(e,s,d=>{if(d.videoRange!==l||d.frameRate!==c||d.codecSet.substring(0,4)!==h)return!1;const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Qe(a,f,i)>-1});return u>-1?u:ir(e,s,d=>{const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Qe(a,f,i)>-1})}function ir(a,e,t){for(let s=e;s;s--)if(t(a[s]))return s;for(let s=e+1;s{const{fragCurrent:t,partCurrent:s,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!t||!n)return;const o=performance.now(),l=s?s.stats:t.stats,c=s?s.duration:t.duration,h=o-l.loading.start,u=i.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const d=i.mainForwardBufferInfo;if(d===null)return;const g=this.bwEstimator.getEstimateTTFB(),f=Math.abs(n.playbackRate);if(h<=Math.max(g,1e3*(c/(f*2))))return;const m=d.len/f,E=l.loading.first?l.loading.first-l.loading.start:-1,T=l.loaded&&E>-1,y=this.getBwEstimate(),v=i.levels,A=v[t.level],x=l.total||Math.max(l.loaded,Math.round(c*A.averageBitrate/8));let D=T?h-E:h;D<1&&T&&(D=Math.min(h,l.loaded*8/y));const R=T?l.loaded*1e3/D:0,C=R?(x-l.loaded)/R:x*8/y+g/1e3;if(C<=m)return;const k=R?R*8:y;let I=Number.POSITIVE_INFINITY,w;for(w=t.level-1;w>u;w--){const F=v[w].maxBitrate;if(I=this.getTimeToLoadFrag(g/1e3,k,c*F,!v[w].details),I=C||I>c*10)return;i.nextLoadLevel=i.nextAutoLevel=w,T?this.bwEstimator.sample(h-Math.min(g,E),l.loaded):this.bwEstimator.sampleTTFB(h);const B=v[w].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>B&&this.resetEstimator(B),this.clearTimer(),S.warn(`[abr] Fragment ${t.sn}${s?" part "+s.index:""} of level ${t.level} is loading too slowly; - Time to underbuffer: ${m.toFixed(3)} s - Estimated load time for current fragment: ${C.toFixed(3)} s - Estimated load time for down switch fragment: ${I.toFixed(3)} s - TTFB estimate: ${E|0} ms - Current BW estimate: ${N(y)?y|0:"Unknown"} bps - New BW estimate: ${this.getBwEstimate()|0} bps - Switching to level ${w} @ ${B|0} bps`),i.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:s,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(S.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new tl(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case b.BUFFER_ADD_CODEC_ERROR:case b.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case b.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,l=n-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(u,c),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;N(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===H.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==H.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return S.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),c=this.getStarvationDelay();let h=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(c){const E=this.findBestLevel(l,n,i,c,0,h,u);if(E>=0)return E}let d=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!c){const E=this.bitrateTestDelay;E&&(d=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-E,S.info(`[abr] bitrate test took ${Math.round(1e3*E)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),h=u=1)}const g=this.findBestLevel(l,n,i,c,d,h,u);if(S.info(`[abr] ${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const f=s.levels[n],m=s.levels[s.loadLevel];return f?.bitrate=t;V--){var G;const U=f[V],Z=V>u;if(!U)continue;if(T.useMediaCapabilities&&!U.supportedResult&&!U.supportedPromise){const ae=navigator.mediaCapabilities;typeof ae?.decodingInfo=="function"&&sl(U,I,D,R,e,C)?(U.supportedPromise=il(U,I,ae),U.supportedPromise.then(re=>{if(!this.hls)return;U.supportedResult=re;const de=this.hls.levels,Re=de.indexOf(U);re.error?S.warn(`[abr] MediaCapabilities decodingInfo error: "${re.error}" for level ${Re} ${JSON.stringify(re)}`):re.supported||(S.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Re} ${JSON.stringify(re)}`),Re>-1&&de.length>1&&(S.log(`[abr] Removing unsupported level ${Re}`),this.hls.removeLevel(Re)))})):U.supportedResult=cn}if(x&&U.codecSet!==x||D&&U.videoRange!==D||Z&&R>U.frameRate||!Z&&R>0&&R=w*2&&r===0?f[V].averageBitrate:f[V].maxBitrate,j=this.getTimeToLoadFrag(B,M,ee*O,q===void 0);if(M>=ee&&(V===h||U.loadError===0&&U.fragmentError===0)&&(j<=B||!N(j)||v&&!this.bitrateTestDelay||j${V} adjustedbw(${Math.round(M)})-bitrate=${Math.round(M-ee)} ttfb:${B.toFixed(1)} avgDuration:${O.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${j.toFixed(1)} firstSelection:${A} codecSet:${x} videoRange:${D} hls.loadLevel:${E}`)),A&&(this.firstSelection=V),V}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls,i=Math.min(Math.max(e,s),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class fl{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var xe={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class gl{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const s=this.activePartLists[t];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=e&&n!==null&&e<=n)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if(n?.body.type===t&&n.buffered){const o=n.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,s,i){this.timeRanges&&(this.timeRanges[e]=t);const r=i?.fragment.sn||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[e];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:s,part:i}=e;if(!t||s.sn==="initSegment")return;const r=Et(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(t).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=t[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),$t(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=s.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=Et(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,l=e.minEndPTS||o,c=e.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu){const g=Math.max(n,i.start(h)),f=Math.min(o,i.end(h));f>g&&(r.partial=!0,r.time.push({startPTS:g,endPTS:f}))}else if(o<=u)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&$t(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||$t(t))}getState(e){const t=Et(e),s=this.fragments[t];return s?s.buffered?$t(s)?xe.PARTIAL:xe.OK:xe.APPENDING:xe.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:s,part:i}=t;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:t,n=Et(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r}=t;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Et(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.starte&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(e){const t=Et(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function $t(a){var e,t,s;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Et(a){return`${a.type}_${a.level}_${a.sn}`}const ml={length:0,start:()=>0,end:()=>0};class ne{static isBuffered(e,t){try{if(e){const s=ne.getBuffered(e);for(let i=0;i=s.start(i)&&t<=s.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,s){try{if(e){const i=ne.getBuffered(e),r=[];let n;for(n=0;nu&&(i[h-1].end=e[c].end):i.push(e[c])}else i.push(e[c])}else i=e;let r=0,n,o=t,l=t;for(let c=0;c=h&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(g=>g[0]==="GAP")){l(or(e));return}else e.gap=!1;const c=this.loader=e.loader=r?new r(i):new n(i),h=ar(e),u=tr(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:nr};e.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,E)=>{this.resetLoader(e,c);let T=g.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(T.slice(0,16)),T=T.slice(16)),o({frag:e,part:null,payload:T,networkDetails:E})},onError:(g,f,m,E)=>{this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Le({url:s,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:E}))},onAbort:(g,f,m)=>{this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))},onProgress:(g,f,m,E)=>{t&&t({frag:e,part:null,payload:m,networkDetails:E})}})})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(or(e,t));return}const c=this.loader=e.loader=r?new r(i):new n(i),h=ar(e,t),u=tr(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:nr};t.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,E)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const T={frag:e,part:t,payload:g.data,networkDetails:E};s(T),o(T)},onError:(g,f,m,E)=>{this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:Le({url:h.url,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:E}))},onAbort:(g,f,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new it({type:W.NETWORK_ERROR,details:b.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(e.duration/t.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function ar(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(N(i)&&N(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function or(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:W.MEDIA_ERROR,details:b.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new it(s)}class it extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class xl{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class Sl{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Ll(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?ft(a,0,e-t):a}class Al{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],l=this.invSubMix,c=l[0],h=l[1],u=l[2],d=l[3],g=new Uint32Array(256);let f=0,m=0,E=0;for(E=0;E<256;E++)E<128?g[E]=E<<1:g[E]=E<<1^283;for(E=0;E<256;E++){let T=m^m<<1^m<<2^m<<3^m<<4;T=T>>>8^T&255^99,e[f]=T,t[T]=f;const y=g[f],v=g[y],A=g[v];let x=g[T]*257^T*16843008;i[f]=x<<24|x>>>8,r[f]=x<<16|x>>>16,n[f]=x<<8|x>>>24,o[f]=x,x=A*16843009^v*65537^y*257^f*16843008,c[T]=x<<24|x>>>8,h[T]=x<<16|x>>>16,u[T]=x<<8|x>>>24,d[T]=x,f?(f=y^g[g[g[A^y]]],m^=g[g[m]]):f=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new xl(this.subtle,new Uint8Array(s)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(S.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,s)))}onWebCryptoError(e,t,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%Rl;return s!==e.length&&(t=ft(e,0,s),this.remainderData=ft(e,s)),t}logOnce(e){this.logEnabled&&(S.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const bl={toString:function(a){let e="";const t=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(e)){(n===_.FRAG_LOADING||!this.fragCurrent&&n===_.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=_.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===_.STOPPED||this.state===_.ERROR||(this.warn(`Frag error: ${r?.message||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:s}=this;if(s.getState(e)===xe.APPENDING){const r=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,n?n.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&s.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===xe.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,s=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:s};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(s=>{if(!s||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=e.decryptdata;if(r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const c=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===_.STOPPED||this.state===_.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state=_.IDLE,e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===H.MAIN?"level":"track"} ${e.level} (frag:[${((s=e.startPTS)!=null?s:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${o?bl.toString(ne.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==H.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(u=>!!h[u])){this.state=_.IDLE;return}}const c=(l=this.levels)==null?void 0:l[e.level];c!=null&&c.fragmentError&&(this.log(`Resetting level fragment error count of ${c.fragmentError} on frag buffered`),c.fragmentError=0)}this.state=_.IDLE,o&&(!this.loadedmetadata&&e.type==H.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:s,part:i,partsLoaded:r}=e,n=!r||r.length===0||r.some(l=>!l),o=new mi(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,s=null,i){var r;const n=t?.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=_.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===_.KEY_LOADING&&(this.state=_.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments),s=Math.max(e.start,s||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const h=n.partList;if(h&&i){s>e.end&&n.fragmentHint&&(e=n.fragmentHint);const u=this.getNextPart(h,e,s);if(u>-1){const d=h[u];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${u}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=_.FRAG_LOADING;let g;return o?g=o.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,d,t,i)).catch(f=>this.handleFragLoadError(f)):g=this.doFragPartsLoad(e,d,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}else if(!e.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),N(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=_.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h?.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(e,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(e,t,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(e,u,i).then(d=>{l[u.index]=d;const g=d.part;this.hls.trigger(p.FRAG_LOADED,d);const f=Zi(s,e.sn,u.index+1)||an(c,e.sn,u.index+1);if(f)h(f);else return r({frag:e,part:g,partsLoaded:l})}).catch(n)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===b.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:W.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==_.PARSING){!this.fragCurrent&&this.state!==_.STOPPED&&this.state!==_.ERROR&&(this.state=_.IDLE);return}const{frag:s,part:i,level:r}=t,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:s}=this,{level:i,sn:r,part:n}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of level ${i}. The current chunk will not be buffered.`),null;const o=t[i],l=n>-1?Zi(o,r,n):null,c=l?l.fragment:zo(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(e,t,s,i,r){var n;if(!e||this.state!==_.PARSING)return;const{data1:o,data2:l}=e;let c=o;if(o&&l&&(c=He(o,l)),!((n=c)!=null&&n.length))return;const h={type:e.type,frag:t,part:s,chunkMeta:i,parent:t.type,data:c};if(this.hls.trigger(p.BUFFER_APPENDING,h),e.dropped&&e.independent&&!s){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!ne.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const s=t.currentTime,i=ne.bufferInfo(t,s,0),r=e.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-n,i.end-n),s+n);e.start-o>n&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const s=this.getLoadPosition();return N(s)?this.getFwdBufferInfoAtPos(e,s,t):null}getFwdBufferInfoAtPos(e,t,s){const{config:{maxBufferHole:i}}=this,r=ne.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(t,s);if(n&&r.nextStart=i?(s.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=H.MAIN){const s=this.fragmentTracker.getAppendedFrag(e,H.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const s=t.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(t.live){const l=r.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,s,i,r){const n=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,n&&e&&!e.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,s){let i=-1,r=!1,n=!0;for(let o=0,l=e.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(e,t){const s=this.fragPrevious;let i=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),i=Xo(t,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=e.startSN&&r<=e.endSN){const n=t[r-e.startSN];s.cc===n.cc&&(i=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Zo(t,s.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,{maxFragLookUpTolerance:c}=i,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(et-c?0:c;d=us(r,n,e,g)}else d=n[n.length-1];if(d){const g=d.sn-s.startSN,f=this.fragmentTracker.getState(d);if((f===xe.OK||f===xe.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const E=n[g+1];d.sn=n-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let s=this.startPosition;if(s ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===b.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=t.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===Ae.RetryRequest&&c){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=fi(c,l);this.warn(`Fragment ${s.sn} of ${e} ${s.level} errored with ${t.details}, retrying loading ${l+1}/${c.maxNumRetry} in ${h}ms`),n.resolved=!0,this.retryDate=self.performance.now()+h,this.state=_.FRAG_LOADING_WAITING_RETRY}else if(c&&n)if(this.resetFragmentErrors(e),l.5;r&&this.reduceMaxBufferLength(i.len,t?.duration||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===H.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==_.STOPPED&&(this.state=_.IDLE)}afterBufferFlushed(e,t,s){if(!e)return;const i=ne.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,s),this.state===_.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,c)=>{const h=e.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${u})`),l||!1;const d=i?0:rn(n,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:e,start:h.startPTS,end:h.endPTS}),!0}return l},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(s.fragmentError===0&&(s.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=_.PARSED,this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class un{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let s;if(e.length)e.length===1?s=e[0]:s=Il(e,t);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Il(a,e){const t=new Uint8Array(e);let s=0;for(let i=0;i0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Ye.audioId3,duration:Number.POSITIVE_INFINITY});i{if(N(a))return a*90;const s=t?t.baseTime*9e4/t.timescale:0;return e*9e4+s};function kl(a,e,t,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>h.length-1){const d=new Error(`invalid ADTS sampling index:${u}`);a.emit(p.ERROR,p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!0,error:d,reason:d.message});return}return n=(e[t+2]&1)<<2,n|=(e[t+3]&192)>>>6,S.log(`manifest codec:${s}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function dn(a,e){return a[e]===255&&(a[e+1]&246)===240}function fn(a,e){return a[e+1]&1?7:9}function yi(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function Pl(a,e){return e+5=a.length)return!1;const s=yi(a,e);if(s<=t)return!1;const i=e+s;return i===a.length||fs(a,i)}return!1}function gn(a,e,t,s,i){if(!a.samplerate){const r=kl(e,t,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,S.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function mn(a){return 1024*9e4/a}function Ml(a,e){const t=fn(a,e);if(e+t<=a.length){const s=yi(a,e)-t;if(s>0)return{headerLength:t,frameLength:s}}}function pn(a,e,t,s,i){const r=mn(a.samplerate),n=s+i*r,o=Ml(e,t);let l;if(o){const{frameLength:u,headerLength:d}=o,g=d+u,f=Math.max(0,t+g-e.length);f?(l=new Uint8Array(g-d),l.set(e.subarray(t+d,e.length),0)):l=e.subarray(t+d,t+g);const m={unit:l,pts:n};return f||a.samples.push(m),{sample:m,length:g,missing:f}}const c=e.length-t;return l=new Uint8Array(c),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}let Ht=null;const Nl=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ul=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Bl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Gl=[0,1,1,4];function En(a,e,t,s,i){if(t+24>e.length)return;const r=Tn(e,t);if(r&&t+r.frameLength<=e.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function Tn(a,e){const t=a[e+1]>>3&3,s=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const n=a[e+2]>>1&1,o=a[e+3]>>6,l=t===3?3-s:s===3?3:4,c=Nl[l*14+i-1]*1e3,u=Ul[(t===3?0:t===2?1:2)*3+r],d=o===3?1:2,g=Bl[t][s],f=Gl[s],m=g*8*f,E=Math.floor(g*c/u+n)*f;if(Ht===null){const v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ht=v?parseInt(v[1]):0}return Ht&&Ht<=87&&s===2&&c>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:u,channelCount:d,frameLength:E,samplesPerFrame:m}}}function vi(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function yn(a,e){return e+1{const n=yo(r);if(Hl.test(n.schemeIdUri)){const o=N(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:Ye.emsg,duration:l})}})}return s}demuxSampleAes(e,t,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const xn=(a,e)=>{let t=0,s=5;e+=s;const i=new Uint32Array(1),r=new Uint32Array(1),n=new Uint8Array(1);for(;s>0;){n[0]=a[e];const o=Math.min(s,8),l=8-o;r[0]=4278190080>>>24+l<>l,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],l=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+r]*2;if(t+h>e.length)return-1;const u=e[t+6]>>5;let d=0;u===2?d+=2:(u&1&&u!==1&&(d+=2),u&4&&(d+=2));const g=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][u]+g,E=e[t+5]>>3,T=e[t+5]&7,y=new Uint8Array([r<<6|E<<1|T>>2,(T&3)<<6|u<<3|g<<2|l>>4,l<<4&224]),v=1536/o*9e4,A=s+i*v,x=e.subarray(t,t+h);return a.config=y,a.channelCount=m,a.samplerate=o,a.samples.push({unit:x,pts:A}),h}class Yl{constructor(){this.VideoSample=null}createVideoSample(e,t,s,i){return{key:e,frame:!1,pts:t,dts:s,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let s=this.VideoSample,i;if((!s||s.units.length===0)&&(s=e[e.length-1]),(t=s)!=null&&t.units){const r=s.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const s=t.samples,i=s.length;if(i){const r=s[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&S.log(e.pts+"/"+e.dts+":"+e.debug)}}class lr{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,s=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(s,s+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const s=this.word>>>32-t;if(e>32&&S.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?s<>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,s=8,i;for(let r=0;r{var u;switch(h.type){case 1:{let m=!1;l=!0;const E=h.data;if(c&&E.length>4){const T=new lr(E).readSliceType();(T===2||T===4||T===7||T===9)&&(m=!0)}if(m){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.frame=!0,o.key=m;break}case 5:l=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.key=!0,o.frame=!0;break;case 6:{l=!0,Qr(h.data,1,s.pts,t.samples);break}case 7:{var g,f;l=!0,c=!0;const m=h.data,T=new lr(m).readSPS();if(!e.sps||e.width!==T.width||e.height!==T.height||((g=e.pixelRatio)==null?void 0:g[0])!==T.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==T.pixelRatio[1]){e.width=T.width,e.height=T.height,e.pixelRatio=T.pixelRatio,e.sps=[m],e.duration=r;const y=m.subarray(1,4);let v="avc1.";for(let A=0;A<3;A++){let x=y[A].toString(16);x.length<2&&(x="0"+x),v+=x}e.codec=v}break}case 8:l=!0,e.pps=[h.data];break;case 9:l=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"");break;case 12:l=!0;break;default:l=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&l&&o.units.push(h)}),i&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const s=t.byteLength;let i=e.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=t[0]&31,i=0,o=1);o=0){const g={data:t.subarray(u,c),type:d};n.push(g)}else{const g=this.getLastNalUnit(e.samples);g&&(r&&o<=4-r&&g.state&&(g.data=g.data.subarray(0,g.data.byteLength-r)),c>0&&(g.data=He(g.data,t.subarray(0,c)),g.state=0))}o=0&&i>=0){const g={data:t.subarray(u,s),type:d,state:i};n.push(g)}if(n.length===0){const g=this.getLastNalUnit(e.samples);g&&(g.data=He(g.data,t))}return e.naluState=i,n}}class zl{constructor(e,t,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new pi(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,s){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(o=>{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,s)})}decryptAacSamples(e,t,s){for(;;t++){if(t>=e.length){s();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(t);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,s+1,i)})}decryptAvcSamples(e,t,s,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,s=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(e,t,s,i,n),!this.decrypter.isSync()))return}}}}const Ee=188;class ot{constructor(e,t,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.videoParser=new jl}static probe(e){const t=ot.syncOffset(e);return t>0&&S.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let s=Math.min(Ee*5,t-Ee)+1,i=0;for(;i1&&(n===0&&o>2||l+Ee>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Yr[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ot.createTrack("video"),this._audioTrack=ot.createTrack("audio",i),this._id3Track=ot.createTrack("id3"),this._txtTrack=ot.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:s}=this;e&&(e.pesData=null),t&&(t.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._videoTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,g=l.pid,f=o.pesData,m=l.pesData,E=null,T=this.pmtParsed,y=this._pmtId,v=e.length;if(this.remainderData&&(e=He(this.remainderData,e),v=e.length,this.remainderData=null),v>4;let w;if(I>1){if(w=R+5+e[R+4],w===R+Ee)continue}else w=R+4;switch(k){case h:C&&(u&&(r=Tt(u))&&this.videoParser.parseAVCPES(n,c,r,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(w,R+Ee)),u.size+=R+Ee-w);break;case d:if(C){if(f&&(r=Tt(f)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(w,R+Ee)),f.size+=R+Ee-w);break;case g:C&&(m&&(r=Tt(m))&&this.parseID3PES(l,r),m={data:[],size:0}),m&&(m.data.push(e.subarray(w,R+Ee)),m.size+=R+Ee-w);break;case 0:C&&(w+=e[w]+1),y=this._pmtId=ql(e,w);break;case y:{C&&(w+=e[w]+1);const B=Xl(e,w,this.typeSupported,s,this.observer);h=B.videoPid,h>0&&(n.pid=h,n.segmentCodec=B.segmentVideoCodec),d=B.audioPid,d>0&&(o.pid=d,o.segmentCodec=B.segmentAudioCodec),g=B.id3Pid,g>0&&(l.pid=g),E!==null&&!T&&(S.warn(`MPEG-TS PMT found at ${R} after unknown PID '${E}'. Backtracking to sync byte @${A} to parse all TS packets.`),E=null,R=A-188),T=this.pmtParsed=!0;break}case 17:case 8191:break;default:E=k;break}}else x++;x>0&&gs(this.observer,new Error(`Found ${x} TS packet/s that do not start with 0x47`)),n.pesData=u,o.pesData=f,l.pesData=m;const D={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:s,id3Track:i,textTrack:r}=e,n=s.pesData,o=t.pesData,l=i.pesData;let c;if(n&&(c=Tt(n))?(this.videoParser.parseAVCPES(s,r,c,!0,this._duration),s.pesData=null):s.pesData=n,o&&(c=Tt(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&S.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(c=Tt(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(e,t,s){const i=this.demux(e,s,!0,!this.config.progressive),r=this.sampleAes=new zl(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{s(e)}):s(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{s(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let s=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1)r=He(i.sample.unit,r);else{const g=d-u;i.sample.unit.set(r.subarray(0,u),g),e.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){S.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=me({},t,{type:this._videoTrack?Ye.emsg:Ye.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function Zs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function ql(a,e){return(a[e+10]&31)<<8|a[e+11]}function Xl(a,e,t,s,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=(a[e+1]&15)<<8|a[e+2],o=e+3+n-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e0){let u=e+5,d=h;for(;d>2;){a[u]===106&&(t.ac3!==!0?S.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=c,r.segmentAudioCodec="ac3"));const f=a[u+1]+2;u+=f,d-=f}}break;case 194:case 135:return gs(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return gs(i,new Error("Unsupported HEVC in M2TS found")),r}e+=h+5}return r}function gs(a,e,t){S.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function ks(a){S.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Tt(a){let e=0,t,s,i,r,n;const o=a.data;if(!a||a.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=He(o[0],o[1]),o.splice(1,1);if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(s=(t[4]<<8)+t[5],s&&s>a.size-6)return null;const c=t[7];c&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,c&64?(n=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-n>60*9e4&&(S.warn(`${Math.round((r-n)/9e4)}s delta between PTS and DTS, align them`),r=n)):n=r),i=t[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,g=o.length;df){h-=f;continue}else t=t.subarray(h),f-=h,h=0;u.set(t,e),e+=f}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}class Ql extends Ti{resetInitSegment(e,t,s,i){super.resetInitSegment(e,t,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=kt(e,0);let s=t?.length||0;if(t&&e[s]===11&&e[s+1]===119&&di(t)!==void 0&&xn(e,s)<=16)return!1;for(let i=e.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(e,4),i=0,s=8;i>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return L.box(L.types.mdia,L.mdhd(e.timescale,e.duration),L.hdlr(e.type),L.minf(e))}static mfhd(e){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(e)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(e))}static moof(e,t,s){return L.box(L.types.moof,L.mfhd(e),L.traf(s,t))}static moov(e){let t=e.length;const s=[];for(;t--;)s[t]=L.trak(e[t]);return L.box.apply(null,[L.types.moov,L.mvhd(e[0].timescale,e[0].duration)].concat(s).concat(L.mvex(e)))}static mvex(e){let t=e.length;const s=[];for(;t--;)s[t]=L.trex(e[t]);return L.box.apply(null,[L.types.mvex,...s])}static mvhd(e,t){t*=e;const s=Math.floor(t/(at+1)),i=Math.floor(t%(at+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return L.box(L.types.mvhd,r)}static sdtp(e){const t=e.samples||[],s=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(n&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=L.box(L.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(s))),l=e.width,c=e.height,h=e.pixelRatio[0],u=e.pixelRatio[1];return L.box(L.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return L.box(L.types.mp4a,L.audioStsd(e),L.box(L.types.esds,L.esds(e)))}static mp3(e){return L.box(L.types[".mp3"],L.audioStsd(e))}static ac3(e){return L.box(L.types["ac-3"],L.audioStsd(e),L.box(L.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(e)):e.segmentCodec==="ac3"?L.box(L.types.stsd,L.STSD,L.ac3(e)):L.box(L.types.stsd,L.STSD,L.mp4a(e)):L.box(L.types.stsd,L.STSD,L.avc1(e))}static tkhd(e){const t=e.id,s=e.duration*e.timescale,i=e.width,r=e.height,n=Math.floor(s/(at+1)),o=Math.floor(s%(at+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const s=L.sdtp(e),i=e.id,r=Math.floor(t/(at+1)),n=Math.floor(t%(at+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),L.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,L.box(L.types.trak,L.tkhd(e),L.mdia(e))}static trex(e){const t=e.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const s=e.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(t+=8+r,n.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return L.box(L.types.trun,n)}static initSegment(e){L.types||L.init();const t=L.moov(e);return He(L.FTYP,t)}}L.types=void 0;L.HDLR_TYPES=void 0;L.STTS=void 0;L.STSC=void 0;L.STCO=void 0;L.STSZ=void 0;L.VMHD=void 0;L.SMHD=void 0;L.STSD=void 0;L.FTYP=void 0;L.DINF=void 0;const Ln=9e4;function xi(a,e,t=1,s=!1){const i=a*e*t;return s?Math.round(i):i}function Jl(a,e,t=1,s=!1){return xi(a,e,1/t,s)}function Dt(a,e=!1){return xi(a,1e3,1/Ln,e)}function Zl(a,e=1){return xi(a,Ln,1/e)}const ec=10*1e3,hr=1024,tc=1152,sc=1536;let yt=null,Ps=null;class Zt{constructor(e,t,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.ISGenerated=!1,yt===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);yt=n?parseInt(n[1]):0}if(Ps===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Ps=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){S.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){S.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){S.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const s=e.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(t=!0,Ge(i,r.pts)):n>0?i:r.pts},e[0].pts);return t&&S.debug("PTS rollover detected"),s}remux(e,t,s,i,r,n,o,l){let c,h,u,d,g,f,m=r,E=r;const T=e.pid>-1,y=t.pid>-1,v=t.samples.length,A=e.samples.length>0,x=o&&v>0||v>1;if((!T||A)&&(!y||x)||this.ISGenerated||o){if(this.ISGenerated){var R,C,k,I;const G=this.videoTrackConfig;G&&(t.width!==G.width||t.height!==G.height||((R=t.pixelRatio)==null?void 0:R[0])!==((C=G.pixelRatio)==null?void 0:C[0])||((k=t.pixelRatio)==null?void 0:k[1])!==((I=G.pixelRatio)==null?void 0:I[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,r,n);const w=this.isVideoContiguous;let B=-1,F;if(x&&(B=ic(t.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,B>0){S.warn(`[mp4-remuxer]: Dropped ${B} out of ${v} video samples due to a missing keyframe`);const G=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(B),t.dropped+=B,E+=(t.samples[0].pts-G)/t.inputTimeScale,F=E}else B===-1&&(S.warn(`[mp4-remuxer]: No keyframe found out of ${v} video samples`),f=!1);if(this.ISGenerated){if(A&&x){const G=this.getVideoStartPts(t.samples),U=(Ge(e.samples[0].pts,G)-G)/t.inputTimeScale;m+=Math.max(0,U),E+=Math.max(0,-U)}if(A){if(e.samplerate||(S.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,n,y||x||l===H.AUDIO?E:void 0),x){const G=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(S.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,n)),c=this.remuxVideo(t,E,w,G)}}else x&&(c=this.remuxVideo(t,E,w,0));c&&(c.firstKeyFrame=B,c.independent=B!==-1,c.firstKeyFramePTS=F)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(g=An(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Rn(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:f,text:d,id3:g}}generateIS(e,t,s,i){const r=e.samples,n=t.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,g,f;if(h&&(d=g=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):L.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(f=e.inputTimeScale,!c||f!==c.timescale?d=g=r[0].pts-Math.round(f*s):h=!1)}if(t.sps&&t.pps&&n.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:L.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(f=t.inputTimeScale,!c||f!==c.timescale){const m=this.getVideoStartPts(n),E=Math.round(f*s);g=Math.min(g,Ge(n[0].dts,m)-E),d=Math.min(d,m-E)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:f},this._initDTS={baseTime:g,timescale:f}):d=f=void 0,{tracks:l,initPTS:d,timescale:f}}remuxVideo(e,t,s,i){const r=e.inputTimeScale,n=e.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,g,f,m=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,T=!1;if(!s||h===null){const O=t*r,M=n[0].pts-Ge(n[0].dts,n[0].pts);yt&&h!==null&&Math.abs(O-M-h)<15e3?s=!0:h=O-M}const y=c.baseTime*r/c.timescale;for(let O=0;O0?O-1:O].dts&&(T=!0)}T&&n.sort(function(O,M){const ee=O.dts-M.dts,j=O.pts-M.pts;return ee||j}),g=n[0].dts,f=n[n.length-1].dts;const v=f-g,A=v?Math.round(v/(l-1)):d||e.inputTimeScale/30;if(s){const O=g-h,M=O>A,ee=O<-1;if((M||ee)&&(M?S.warn(`AVC: ${Dt(O,!0)} ms (${O}dts) hole between fragments detected at ${t.toFixed(3)}`):S.warn(`AVC: ${Dt(-O,!0)} ms (${O}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!ee||h>=n[0].pts||yt)){g=h;const j=n[0].pts-O;if(M)n[0].dts=g,n[0].pts=j;else for(let X=0;Xj);X++)n[X].dts-=O,n[X].pts-=O;S.log(`Video: Initial PTS/DTS adjusted: ${Dt(j,!0)}/${Dt(g,!0)}, delta: ${Dt(O,!0)} ms`)}}g=Math.max(0,g);let x=0,D=0,R=g;for(let O=0;O0?M.dts-n[O-1].dts:A;if(X=O>0?M.pts-n[O-1].pts:A,re.stretchShortVideoTrack&&this.nextAudioPts!==null){const Re=Math.floor(re.maxBufferHole*r),Y=(i?m+i*r:this.nextAudioPts)-M.pts;Y>Re?(d=Y-de,d<0?d=de:w=!0,S.log(`[mp4-remuxer]: It is approximately ${Y/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=de}else d=de}const ae=Math.round(M.pts-M.dts);B=Math.min(B,d),G=Math.max(G,d),F=Math.min(F,X),V=Math.max(V,X),o.push(new ur(M.key,d,j,ae))}if(o.length){if(yt){if(yt<70){const O=o[0].flags;O.dependsOn=2,O.isNonSync=0}}else if(Ps&&V-F0&&(i&&Math.abs(y-T)<9e3||Math.abs(Ge(m[0].pts-v,y)-T)<20*h),m.forEach(function(U){U.pts=Ge(U.pts-v,y)}),!s||T<0){if(m=m.filter(U=>U.pts>=0),!m.length)return;r===0?T=0:i&&!f?T=Math.max(0,y):T=m[0].pts}if(e.segmentCodec==="aac"){const U=this.config.maxAudioFramesDrift;for(let Z=0,q=T;Z=U*h&&j0){R+=E;try{D=new Uint8Array(R)}catch(j){this.observer.emit(p.ERROR,p.ERROR,{type:W.MUX_ERROR,details:b.REMUX_ALLOC_ERROR,fatal:!1,error:j,bytes:R,reason:`fail allocating audio mdat ${R}`});return}d||(new DataView(D.buffer).setUint32(0,R),D.set(L.types.mdat,4))}else return;D.set(O,E);const ee=O.byteLength;E+=ee,g.push(new ur(!0,c,ee,0)),x=M}const k=g.length;if(!k)return;const I=g[g.length-1];this.nextAudioPts=T=x+l*I.duration;const w=d?new Uint8Array(0):L.moof(e.sequenceNumber++,A/l,me({},e,{samples:g}));e.samples=[];const B=A/n,F=T/n,V={data1:w,data2:D,startPTS:B,endPTS:F,startDTS:B,endDTS:F,type:"audio",hasAudio:!0,hasVideo:!1,nb:k};return this.isAudioContiguous=!0,V}remuxEmptyAudio(e,t,s,i){const r=e.inputTimeScale,n=e.samplerate?e.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,g=o*hr,f=Math.ceil((d-u)/g),m=cr.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(S.warn("[mp4-remuxer]: remux empty Audio"),!m){S.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const E=[];for(let T=0;T4294967296;)a+=t;return a}function ic(a){for(let e=0;en.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class ur{constructor(e,t,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=s,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class rc{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,s,i){this.audioCodec=t,this.videoCodec=s,this.generateInitSegment(ho(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:s}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=qr(e);i.audio&&(t=dr(i.audio,ie.AUDIO)),i.video&&(s=dr(i.video,ie.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+s,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:e,id:"main"}:S.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};N(h)||(h=this.lastEndTime=r||0);const d=t.samples;if(!(d!=null&&d.length))return u;const g={initPTS:void 0,timescale:1};let f=this.initData;if((o=f)!=null&&o.length||(this.generateInitSegment(d),f=this.initData),!((l=f)!=null&&l.length))return S.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1);const m=fo(d,f),E=uo(f,d),T=E===null?r:E;(nc(c,T,r,m)||g.timescale!==c.timescale&&n)&&(g.initPTS=T-r,c&&c.timescale===1&&S.warn(`Adjusting initPTS by ${g.initPTS-c.baseTime}`),this.initPTS=c={baseTime:g.initPTS,timescale:1});const y=e?T-c.baseTime/c.timescale:h,v=y+m;mo(f,d,c.baseTime/c.timescale),m>0?this.lastEndTime=v:(S.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const A=!!f.audio,x=!!f.video;let D="";A&&(D+="audio"),x&&(D+="video");const R={data1:d,startPTS:y,startDTS:y,endPTS:v,endDTS:v,type:D,hasAudio:A,hasVideo:x,nb:1,dropped:0};return u.audio=R.type==="audio"?R:void 0,u.video=R.type!=="audio"?R:void 0,u.initSegment=g,u.id3=An(s,r,c,c),i.samples.length&&(u.text=Rn(i,r,c)),u}}function nc(a,e,t,s){if(a===null)return!0;const i=Math.max(s,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function dr(a,e){const t=a?.codec;if(t&&t.length>4)return t;if(e===ie.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return os(t,!1);const s="mp4a.40.5";return S.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${s}"`),s}return S.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let rt;try{rt=self.performance.now.bind(self.performance)}catch{S.debug("Unable to use Performance API on this environment"),rt=At?.Date.now}const es=[{demux:Vl,remux:rc},{demux:ot,remux:Zt},{demux:Kl,remux:Zt},{demux:Ql,remux:Zt}];es.splice(2,0,{demux:Wl,remux:Zt});class fr{constructor(e,t,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=s,this.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,s,i){const r=s.transmuxing;r.executeStart=rt();let n=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:g,initSegmentChange:f}=i||o,{audioCodec:m,videoCodec:E,defaultInitPts:T,duration:y,initSegmentData:v}=l,A=ac(n,t);if(A&&A.method==="AES-128"){const C=this.getDecrypter();if(C.isSync()){let k=C.softwareDecrypt(n,A.key.buffer,A.iv.buffer);if(s.part>-1&&(k=C.flush()),!k)return r.executeEnd=rt(),Fs(s);n=new Uint8Array(k)}else return this.decryptionPromise=C.webCryptoDecrypt(n,A.key.buffer,A.iv.buffer).then(k=>{const I=this.push(k,null,s);return this.decryptionPromise=null,I}),this.decryptionPromise}const x=this.needsProbing(h,u);if(x){const C=this.configureTransmuxer(n);if(C)return S.warn(`[transmuxer] ${C.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,error:C,reason:C.message}),r.executeEnd=rt(),Fs(s)}(h||u||f||x)&&this.resetInitSegment(v,m,E,y,t),(h||f||x)&&this.resetInitialTimestamp(T),c||this.resetContiguity();const D=this.transmux(n,A,g,d,s),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,r.executeEnd=rt(),D}flush(e){const t=e.transmuxing;t.executeStart=rt();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,e))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return t.executeEnd=rt(),[Fs(e)];const h=l.flush(o);return ts(h)?h.then(u=>(this.flushRemux(n,u,e),n)):(this.flushRemux(n,h,e),n)}flushRemux(e,t,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;S.log(`[transmuxer.ts]: Flushed fragment ${s.sn}${s.part>-1?" p: "+s.part:""} of level ${s.level}`);const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);e.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=rt()}resetInitialTimestamp(e){const{demuxer:t,remuxer:s}=this;!t||!s||(t.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(e,t,s,i),o.resetInitSegment(e,t,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,s,i,r){let n;return t&&t.method==="SAMPLE-AES"?n=this.transmuxSampleAes(e,t,s,i,r):n=this.transmuxUnencrypted(e,s,i,r),n}transmuxUnencrypted(e,t,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,t,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,s,i,r){return this.demuxer.demuxSampleAes(e,t,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:s,typeSupported:i,vendor:r}=this;let n;for(let d=0,g=es.length;d0&&e?.key!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Fs=a=>({remuxResult:{},chunkMeta:a});function ts(a){return"then"in a&&a.then instanceof Function}class oc{constructor(e,t,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class lc{constructor(e,t,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var bn={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,u||l,d),f=t?t+c:c;return l._events[f]?l._events[f].fn?l._events[f]=[l._events[f],g]:l._events[f].push(g):(l._events[f]=g,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,g=u.length,f=new Array(g);d{h=h||{},h.frag=this.frag,h.id=this.id,c===p.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new Si,this.observer.on(p.FRAG_DECRYPTED,n),this.observer.on(p.ERROR,n);const o=gt(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||Dl())){try{r.workerPath?(S.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=_l(r.workerPath)):(S.log(`injecting Web Worker for "${t}"`),this.workerContext=Cl()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error(`${u.message} (${u.filename}:${u.lineno})`);r.enableWorker=!1,S.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:W.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:l,vendor:"",id:t,config:JSON.stringify(r)})}catch(h){S.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.resetWorker(),this.error=null,this.transmuxer=new fr(this.observer,l,r,"",t)}return}this.transmuxer=new fr(this.observer,l,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:g}=this,f=n?n.start:r.start,m=r.decryptdata,E=this.frag,T=!(E&&r.cc===E.cc),y=!(E&&c.level===E.level),v=E?c.sn-E.sn:-1,A=this.part?c.part-this.part.index:-1,x=v===0&&c.id>1&&c.id===E?.stats.chunkCount,D=!y&&(v===1||v===0&&(A===1||x&&A<=0)),R=self.performance.now();(y||v||r.stats.parsing.start===0)&&(r.stats.parsing.start=R),n&&(A||!D)&&(n.stats.parsing.start=R);const C=!(E&&((u=r.initSegment)==null?void 0:u.url)===((d=E.initSegment)==null?void 0:d.url)),k=new lc(T,D,l,y,f,C);if(!D||T||C){S.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${c.sn} p: ${c.part} level: ${c.level} id: ${c.id} - discontinuity: ${T} - trackSwitch: ${y} - contiguous: ${D} - accurateTimeOffset: ${l} - timeOffset: ${f} - initSegmentChange: ${C}`);const I=new oc(s,i,t,o,h);this.configureTransmuxer(I)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:k},e instanceof ArrayBuffer?[e]:[]);else if(g){const I=g.push(e,m,c,k);ts(I)?(g.async=!0,I.then(w=>{this.handleTransmuxComplete(w)}).catch(w=>{this.transmuxerError(w,c,"transmuxer-interface push error")})):(g.async=!1,this.handleTransmuxComplete(I))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let s=t.flush(e);ts(s)||t.async?(ts(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(s,e)}}transmuxerError(e,t,s){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,t){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){S.warn(`worker message received with no ${t?"event name":"data"}`);return}const s=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":S[t.data.logType]&&S[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,s.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Dn(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function ei(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}const gr=100;class hc extends Ei{constructor(e,t,s){super(e,t,s,"[audio-stream-controller]",H.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){if(s==="main"){const n=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${n} found from main: ${i}`),this.videoTrackCC=n,this.state===_.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=_.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(gr),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=_.IDLE):(this.loadedmetadata=!1,this.state=_.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case _.IDLE:this.doTickIdle();break;case _.WAITING_TRACK:{var e;const{levels:s,trackId:i}=this,r=s==null||(e=s[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=_.WAITING_INIT_PTS}break}case _.FRAG_LOADING_WAITING_RETRY:{var t;const s=performance.now(),i=this.retryDate;if(!i||s>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:n}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(r?.[n]||null),this.state=_.IDLE}break}case _.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=_.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=ne.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);Js(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${c.end} is needed`),this.clearWaitingFragment())}}else this.state=_.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:s,trackId:i}=this,r=e.config;if(!s&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const n=t[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(o)){this.state=_.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,ie.AUDIO,H.AUDIO));const c=this.getFwdBufferInfo(l,H.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){e.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=_.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,H.MAIN),g=c.len,f=this.getMaxBufferLength(d?.len),m=o.fragments,E=m[0].start;let T=this.flushing?this.getLoadPosition():c.end;if(u&&s){const x=this.getLoadPosition();h&&!bt(u.attrs,h.attrs)&&(T=x),o.PTSKnown&&xE||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=E+.05)}if(g>=f&&!u&&Td.end+o.targetduration;if(A||!(d!=null&&d.len)&&c.len){const x=this.getAppendedFrag(y.start,H.MAIN);if(x===null||(v||(v=!!x.gap||!!A&&d.len===0),A&&!v||v&&c.nextStart&&c.nextStartnew Rt(s))}onAudioTrackSwitching(e,t){const s=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(gr):this.resetTransmuxer(),s?(this.switchingTrack=t,this.state=_.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=_.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(p.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:n}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${n}`);return}this.log(`Audio track ${n} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const h=this.mainDetails;if(r.deltaUpdateFailed||!h)return;if(!o.details&&r.hasProgramDateTime&&h.hasProgramDateTime)ds(r,h),l=r.fragments[0].start;else{var c;l=this.alignPlaylists(r,o.details,(c=this.levelLastLoaded)==null?void 0:c.details)}}o.details=r,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,l),this.state===_.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=_.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{config:n,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new In(this.hls,H.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const g=this.initPTS[s.cc],f=(t=s.initSegment)==null?void 0:t.data;if(g!==void 0){const E=i?i.index:-1,T=E!==-1,y=new mi(s.level,s.sn,s.stats.chunkCount,r.byteLength,E,T);d.push(r,f,u,"",s,i,h.totalduration,!1,y,g)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:m}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new un,complete:!1};m.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=_.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const s=t.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s.type!==H.AUDIO){if(!this.loadedmetadata&&s.type===H.MAIN){const r=this.videoBuffer||this.media;r&&ne.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,Le({},r)))}this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=_.ERROR;return}switch(t.details){case b.FRAG_GAP:case b.FRAG_PARSING_ERROR:case b.FRAG_DECRYPT_ERROR:case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(H.AUDIO,t);break;case b.AUDIO_TRACK_LOAD_ERROR:case b.AUDIO_TRACK_LOAD_TIMEOUT:case b.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===_.WAITING_TRACK&&((s=t.context)==null?void 0:s.type)===te.AUDIO_TRACK&&(this.state=_.IDLE);break;case b.BUFFER_APPEND_ERROR:case b.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===b.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case b.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==ie.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ie.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===_.ENDED&&(this.state=_.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,t,H.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:g,id3:f,initSegment:m}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=_.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const E=l.initSegment||l;this._bufferInitSegment(h,m.tracks,E,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:s,tracks:m.tracks})}if(d){const{startPTS:E,endPTS:T,startDTS:y,endDTS:v}=d;c&&(c.elementaryStreams[ie.AUDIO]={startPTS:E,endPTS:T,startDTS:y,endDTS:v}),l.setElementaryStreamInfo(ie.AUDIO,E,T,y,v),this.bufferFragmentData(d,l,c,n)}if(f!=null&&(t=f.samples)!=null&&t.length){const E=me({id:s,frag:l,details:u},f);i.trigger(p.FRAG_PARSING_METADATA,E)}if(g){const E=me({id:s,frag:l,details:u},g);i.trigger(p.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,s,i){if(this.state!==_.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="audio";const n=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&n.split(",").length===1&&(r.levelCodec=n),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:s,part:null,chunkMeta:i,parent:s.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===xe.NOT_LOADED||i===xe.PARTIAL){var r;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=_.WAITING_INIT_PTS;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&ds(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:s}=this,i=s?.attrs,r=e.attrs;t&&i&&(i.CHANNELS!==r.CHANNELS||s.name!==e.name||s.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,Le({},e))}}class uc extends gi{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Audio track with id:${s} and group:${i} not found in active group ${n?.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Audio track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||i?.length!==s?.length||s!=null&&s.some(o=>i?.indexOf(o)===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(d=>!s||s.indexOf(d.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(d=>d.default)&&(this.selectDefaultTrack=!1),o.forEach((d,g)=>{d.id=g});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!r&&l){const d=Qe(l,o,pt);if(d>-1)r=o[d];else{const g=Qe(l,this.tracks);r=this.tracks[g]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${s?.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,h);const u=this.trackId;if(c!==-1&&u===-1)this.setAudioTrack(c);else if(o.length&&u===-1){var n;const d=new Error(`No audio track selected for current audio group-ID(s): ${(n=this.groupIds)==null?void 0:n.join(",")} track count: ${o.length}`);this.warn(d.message),this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===te.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const i=this.currentTrack;if(i&&St(e,i,pt))return i;const r=Qe(e,this.tracksInGroup,pt);if(r>-1){const n=this.tracksInGroup[r];return this.setAudioTrack(r),n}else if(i){let n=t.loadLevel;n===-1&&(n=t.firstAutoLevel);const o=ul(e,t.levels,s,n,pt);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const n=Qe(e,s);if(n>-1)return s[n]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===s&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,Le({},i)),r))return;const n=this.switchParams(i.url,s?.details,i.details);this.loadPlaylist(n)}findTrackId(e){const t=this.tracksInGroup;for(let s=0;s=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null)}onBufferFlushing(e,t){const{startOffset:s,endOffset:i}=t;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew Rt(s));return}this.tracksBuffered=[],this.levels=t.map(s=>{const i=new Rt(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,H.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var s;if(this.currentTrackId=t.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(mr)}onSubtitleTrackLoaded(e,t){var s;const{currentTrackId:i,levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=r[o];if(o>=r.length||!l)return;this.log(`Subtitle track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(n.live||(s=l.details)!=null&&s.live){const u=this.mainDetails;if(n.deltaUpdateFailed||!u)return;const d=u.fragments[0];if(!l.details)n.hasProgramDateTime&&u.hasProgramDateTime?(ds(n,u),c=n.fragments[0].start):d&&(c=d.start,Qs(n,c));else{var h;c=this.alignPlaylists(n,l.details,(h=this.levelLastLoaded)==null?void 0:h.details),c===0&&d&&(c=d.start,Qs(n,c))}}l.details=n,this.levelLastLoaded=l,o===i&&(!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(this.mainDetails||n,c),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===_.IDLE&&(us(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:s}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&s&&s.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=_.IDLE})}}doTick(){if(!this.media){this.state=_.IDLE;return}if(this.state===_.IDLE){const{currentTrackId:e,levels:t}=this,s=t?.[e];if(!s||!t.length||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=ne.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,H.MAIN),h=s.details,u=this.getMaxBufferLength(c?.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,g=d.length,f=h.edge;let m=null;const E=this.fragPrevious;if(of-T?0:T;m=us(E,d,Math.max(d[0].start,o),y),!m&&E&&E.start{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][s]};this.buffered={get length(){return e.length},end(s){return t("end",s,e.length)},start(s){return t("start",s,e.length)}}}}class gc extends gi{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const s=Xt(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Xt(this.media.textTracks).forEach(t=>{vt(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Subtitle track with id:${s} and group:${i} not found in active group ${n?.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Subtitle track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||i?.length!==s?.length||s!=null&&s.some(n=>i?.indexOf(n)===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const n=this.tracks.filter(h=>!s||s.indexOf(h.groupId)!==-1);if(n.length)this.selectDefaultTrack&&!n.some(h=>h.default)&&(this.selectDefaultTrack=!1),n.forEach((h,u)=>{h.id=u});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=n;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Qe(o,n);if(h>-1)r=n[h];else{const u=Qe(o,this.tracks);r=this.tracks[u]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const c={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${s?.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,c),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,s=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(s)return null;{const r=Qe(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const s=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${s}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:s,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Xt(e.textTracks),s=this.currentTrack;let i;if(s&&(i=t.filter(r=>ei(s,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!N(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===s&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:n,groupId:o="",name:l,type:c,url:h}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(i.url,s?.details,i.details);this.loadPlaylist(u)}}class mc{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,s){const i=this.queues[t];i.push(e),i.length===1&&!s&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const s=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),s}executeNext(e){const t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(i){S.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),s.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const pr=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class pc{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=s=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:s,mediaSource:i}=this;this.log("Media source opened"),s&&(s.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:s,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:i}=this;s!==i&&S.error(`Media element src was set while attaching MediaSource (${i} > ${s})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Ro(gt(e.config.preferManagedMediaSource)),this.log=S.log.bind(S,t),this.warn=S.warn.bind(S,t),this.error=S.error.bind(S,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new mc(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const s=this.media=t.media,i=gt(this.appendSource);if(s&&i){var r;const n=this.mediaSource=new i;this.log(`created media source: ${(r=n.constructor)==null?void 0:r.name}`),n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming));const o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{s.removeAttribute("src");const l=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||l&&n instanceof l,Er(s),Ec(s,o),s.load()}catch{s.src=o}else s.src=o;s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:s}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(e.removeAttribute("src"),this.appendSource&&Er(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(p.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var s;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const s=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(n=>{if(s){const l=this.tracks[n];if(l&&typeof l.buffer.changeType=="function"){var o;const{id:c,codec:h,levelCodec:u,container:d,metadata:g}=t[n],f=Ui(l.codec,l.levelCodec),m=f?.replace(pr,"$1");let E=Ui(h,u);const T=(o=E)==null?void 0:o.replace(pr,"$1");if(E&&m!==T){n.slice(0,5)==="audio"&&(E=os(E,this.appendSource));const y=`${d};codecs=${E}`;this.appendChangeType(n,y),this.log(`switching codec ${f} to ${E}`),this.tracks[n]={buffer:l.buffer,codec:h,container:d,levelCodec:u,metadata:g,id:c}}}}else this.pendingTracks[n]=t[n]}),s)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),s.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};s.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=t,u=h.buffering[o],d=self.performance.now();u.start=d;const g=l.stats.buffering,f=c?c.stats.buffering:null;g.start===0&&(g.start=d),f&&f.start===0&&(f.start=d);const m=r.audio;let E=!1;o==="audio"&&m?.container==="audio/mpeg"&&(E=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const T=l.start,y={execute:()=>{if(u.executeStart=self.performance.now(),E){const v=this.sourceBuffer[o];if(v){const A=T-v.timestampOffset;Math.abs(A)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${T} (delta: ${A}) sn: ${l.sn})`),v.timestampOffset=T)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const v=self.performance.now();u.executeEnd=u.end=v,g.first===0&&(g.first=v),f&&f.first===0&&(f.first=v);const{sourceBuffer:A}=this,x={};for(const D in A)x[D]=ne.getBuffered(A[D]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:x})},onError:v=>{const A={type:W.MEDIA_ERROR,parent:l.type,details:b.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:l,part:c,chunkMeta:h,error:v,err:v,fatal:!1};if(v.code===DOMException.QUOTA_EXCEEDED_ERR)A.details=b.BUFFER_FULL_ERROR;else{const x=++this.appendErrors[o];A.details=b.BUFFER_APPEND_ERROR,this.warn(`Failed ${x}/${s.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),x>=s.config.appendErrorMaxRetry&&(A.fatal=!0)}s.trigger(p.ERROR,A)}};i.append(y,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:r})},onError:n=>{this.warn(`Failed to remove from ${r} SourceBuffer`,n)}});t.type?s.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(e,t){const{frag:s,part:i}=t,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[ie.AUDIOVIDEO]?r.push("audiovideo"):(n[ie.AUDIO]&&r.push("audio"),n[ie.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(o,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!t.type||t.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!n||n.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:s}=this;if(!s||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,n=s.currentTime,o=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(N(l)&&l>0){const c=Math.max(l,o),h=Math.floor(n/o)*o-c;this.flushBackBuffer(n,o,h)}if(N(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),h=Math.max(c,o),u=Math.floor(n/o)*o+h;this.flushFrontBuffer(n,o,u)}}flushBackBuffer(e,t,s){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(o=>{const l=r[o];if(l){const c=ne.getBuffered(l);if(c.length>0&&s>c.start(0)){if(this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:s}),i!=null&&i.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(l.ended&&c.end(c.length-1)-e{const o=i[n];if(o){const l=ne.getBuffered(o),c=l.length;if(c<2)return;const h=l.start(c-1),u=l.end(c-1);if(s>h||e>=h&&e<=u)return;if(o.ended&&e-u<2*t){this.log(`Cannot flush ${n} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:n})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:s,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,n=s.duration,o=N(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>o&&r>n||!N(n))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,s=e.fragments;if(s.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${n}.`),t.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&(!e||i===2||"audiovideo"in s)){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(p.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{t.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);let o=((i=n.levelCodec)==null?void 0:i.indexOf(","))===-1?n.levelCodec:n.codec;o&&r.slice(0,5)==="audio"&&(o=os(o,this.appendSource));const l=`${n.container};codecs=${o}`;this.log(`creating sourceBuffer(${l})`);try{const c=t[r]=s.addSourceBuffer(l),h=r;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(u,d)=>{const g=d.removedRanges;g!=null&&g.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:c,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(c){this.error(`error while trying to add sourceBuffer: ${c.message}`),this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,sourceBufferName:r,mimeType:l})}}}get mediaSrc(){var e;const t=((e=this.media)==null?void 0:e.firstChild)||this.media;return t?.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:s}=this;s.current(e).onComplete(),s.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var s;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[e];if(!i||!r||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),n.shiftAndExecuteNext(e);return}const c=N(i.duration)?i.duration:1/0,h=N(r.duration)?r.duration:1/0,u=Math.max(0,t),d=Math.min(s,c,h);d>u&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),l.remove(u,d)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const s=this.sourceBuffer[t];if(!s){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:s}=this,i=t.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,s){const i=this.sourceBuffer[e];if(!i)return;const r=s.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(s=>{t.removeEventListener(s.event,s.listener)})}}function Er(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ec(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Tc={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Cn=a=>String.fromCharCode(Tc[a]||a),We=15,st=100,yc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},vc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},xc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Sc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Lc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Ac{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const s=typeof t=="function"?t():t;S.log(`${this.time} [${e}] ${s}`)}}}const ct=function(e){const t=[];for(let s=0;sst&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=st)}moveCursor(e){const t=this.pos+e;if(e>1)for(let s=this.pos+1;s=144&&this.backSpace();const t=Cn(e);if(this.pos>=st){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let s="",i=-1;for(let r=0;r0&&(e?s="["+t.join(" | ")+"]":s=t.join(` -`)),s}getTextAndFormat(){return this.rows}}class Tr{constructor(e,t,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Os(s),this.nonDisplayedMemory=new Os(s),this.lastOutputScreen=new Os(s),this.currRollUpRow=this.displayedMemory.rows[We-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[We-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let s=0;st+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const s=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class yr{constructor(e,t,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Dc(),this.logger=void 0;const i=this.logger=new Ac;this.channels=[null,new Tr(e,t,i),new Tr(e+1,s,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let s=0;s"["+ct([t[s],t[s+1]])+"] -> ("+ct([i,r])+")");const l=this.cmdHistory;if(i>=16&&i<=31){if(Ic(i,r,l)){Vt(null,null,l),this.logger.log(3,()=>"Repeated command ("+ct([i,r])+") is dropped");continue}Vt(i,r,this.cmdHistory),n=this.parseCmd(i,r),n||(n=this.parseMidrow(i,r)),n||(n=this.parsePAC(i,r)),n||(n=this.parseBackgroundAttributes(i,r))}else Vt(null,null,l);if(!n&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+ct([i,r])+" orig: "+ct([t[s],t[s+1]]))}}parseCmd(e,t){const s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(s||i))return!1;const r=e===20||e===21||e===23?1:2,n=this.channels[r];return e===20||e===21||e===28||e===29?t===32?n.ccRCL():t===33?n.ccBS():t===34?n.ccAOF():t===35?n.ccAON():t===36?n.ccDER():t===37?n.ccRU(2):t===38?n.ccRU(3):t===39?n.ccRU(4):t===40?n.ccFON():t===41?n.ccRDC():t===42?n.ccTR():t===43?n.ccRTD():t===44?n.ccEDM():t===45?n.ccCR():t===46?n.ccENM():t===47&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let s=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+ct([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let s;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const n=e<=23?1:2;t>=64&&t<=95?s=n===1?yc[e]:xc[e]:s=n===1?vc[e]:Sc[e];const o=this.channels[n];return o?(o.setPAC(this.interpretPAC(s,t)),this.currentChannel=n,!0):!1}interpretPAC(e,t){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?s=t-96:s=t-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(e,t){let s,i=null,r=null;if(e>=25?(s=2,r=e-8):(s=1,r=e),r>=17&&r<=19){let n;r===17?n=t+80:r===18?n=t+112:n=t+144,this.logger.log(2,()=>"Special char '"+Cn(n)+"' in channel "+s),i=[n]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+ct(i).join(",")),i}parseBackgroundAttributes(e,t){const s=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(s||i))return!1;let r;const n={};e===16||e===24?(r=Math.floor((t-32)/2),n.background=Lc[r],t%2===1&&(n.background=n.background+"_semi")):t===45?n.background="transparent":(n.foreground="black",t===47&&(n.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(n),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Li=(function(){if(At!=null&&At.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");D=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return R},set:function(I){const w=i(I);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return C},set:function(I){if(I<0||I>100)throw new Error("Size must be between 0 and 100.");C=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return k},set:function(I){const w=i(I);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");k=w,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n})();class Cc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function wn(a){function e(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class _c{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,s){return s?this.has(e)?this.values[e]:t[s]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,s){for(let i=0;i=0&&s<=100)return this.set(e,s),!0}return!1}}function kn(a,e,t,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(t);if(n.length!==2)continue;const o=n[0],l=n[1];e(o,l)}}const ti=new Li(0,0,""),Yt=ti.align==="middle"?"middle":"center";function wc(a,e,t){const s=a;function i(){const o=wn(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new _c;kn(o,function(d,g){let f;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===g){c.set(d,t[m].region);break}break;case"vertical":c.alt(d,g,["rl","lr"]);break;case"line":f=g.split(","),c.integer(d,f[0]),c.percent(d,f[0])&&c.set("snapToLines",!1),c.alt(d,f[0],["auto"]),f.length===2&&c.alt("lineAlign",f[1],["start",Yt,"end"]);break;case"position":f=g.split(","),c.percent(d,f[0]),f.length===2&&c.alt("positionAlign",f[1],["start",Yt,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,g);break;case"align":c.alt(d,g,["start",Yt,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&ti.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",Yt);let u=c.get("position","auto");u==="auto"&&ti.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),e.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),e.endTime=i(),n(),r(a,e)}function Pn(a){return a.replace(//gi,` -`)}class kc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Cc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function s(){let r=t.buffer,n=0;for(r=Pn(r);n")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{wc(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` -`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` - -`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Pc=/\r\n|\n\r|\n|\r/g,Ms=function(e,t,s=0){return e.slice(s,s+t.length)===t},Fc=function(e){let t=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!N(t)||!N(s)||!N(i)||!N(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*s,t+=60*1e3*i,t+=3600*1e3*r,t},Ns=function(e){let t=5381,s=e.length;for(;s;)t=t*33^e.charCodeAt(--s);return(t>>>0).toString()};function Ai(a,e,t){return Ns(a.toString())+Ns(e.toString())+Ns(t)}const Oc=function(e,t,s){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=s};function Mc(a,e,t,s,i,r,n){const o=new kc,l=Je(new Uint8Array(a)).trim().replace(Pc,` -`).split(` -`),c=[],h=e?Zl(e.baseTime,e.timescale):0;let u="00:00.000",d=0,g=0,f,m=!0;o.oncue=function(E){const T=t[s];let y=t.ccOffset;const v=(d-h)/9e4;if(T!=null&&T.new&&(g!==void 0?y=t.ccOffset=T.start:Oc(t,s,v)),v){if(!e){f=new Error("Missing initPTS for VTT MPEGTS");return}y=v-t.presentationOffset}const A=E.endTime-E.startTime,x=Ge((E.startTime+y-g)*9e4,i*9e4)/9e4;E.startTime=Math.max(x,0),E.endTime=Math.max(x+A,0);const D=E.text.trim();E.text=decodeURIComponent(encodeURIComponent(D)),E.id||(E.id=Ai(E.startTime,E.endTime,D)),E.endTime>0&&c.push(E)},o.onparsingerror=function(E){f=E},o.onflush=function(){if(f){n(f);return}r(c)},l.forEach(E=>{if(m)if(Ms(E,"X-TIMESTAMP-MAP=")){m=!1,E.slice(16).split(",").forEach(T=>{Ms(T,"LOCAL:")?u=T.slice(6):Ms(T,"MPEGTS:")&&(d=parseInt(T.slice(7)))});try{g=Fc(u)/1e3}catch(T){f=T}return}else E===""&&(m=!1);o.parse(E+` -`)}),o.flush()}const Us="stpp.ttml.im1t",Fn=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,On=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Nc={left:"start",center:"center",right:"end",start:"start",end:"end"};function vr(a,e,t,s){const i=Q(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Je(o)),n=Jl(e.baseTime,1,e.timescale);try{r.forEach(o=>t(Uc(o,n)))}catch(o){s(o)}}function Uc(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute(`ttp:${d}`)||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=xr(Bs(i,"styling","style")),c=xr(Bs(i,"layout","region")),h=Bs(i,"body","[begin]");return[].map.call(h,u=>{const d=Mn(u,o);if(!d||!u.hasAttribute("begin"))return null;const g=$s(u.getAttribute("begin"),n),f=$s(u.getAttribute("dur"),n);let m=$s(u.getAttribute("end"),n);if(g===null)throw Sr(u);if(m===null){if(f===null)throw Sr(u);m=g+f}const E=new Li(g-e,m-e,d);E.id=Ai(E.startTime,E.endTime,E.text);const T=c[u.getAttribute("region")],y=l[u.getAttribute("style")],v=Bc(T,y,l),{textAlign:A}=v;if(A){const x=Nc[A];x&&(E.lineAlign=x),E.align=A}return me(E,v),E}).filter(u=>u!==null)}function Bs(a,e,t){const s=a.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(t)):[]}function xr(a){return a.reduce((e,t)=>{const s=t.getAttribute("xml:id");return s&&(e[s]=t),e},{})}function Mn(a,e){return[].slice.call(a.childNodes).reduce((t,s,i)=>{var r;return s.nodeName==="br"&&i?t+` -`:(r=s.childNodes)!=null&&r.length?Mn(s,e):e?t+s.textContent.trim().replace(/\s+/g," "):t+s.textContent},"")}function Bc(a,e,t){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&t.hasOwnProperty(n)&&(i=t[n]),r.reduce((o,l)=>{const c=Gs(e,s,l)||Gs(a,s,l)||Gs(i,s,l);return c&&(o[l]=c),o},{})}function Gs(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Sr(a){return new Error(`Could not parse ttml timestamp ${a}`)}function $s(a,e){if(!a)return null;let t=wn(a);return t===null&&(Fn.test(a)?t=Gc(a,e):On.test(a)&&(t=$c(a,e))),t}function Gc(a,e){const t=Fn.exec(a),s=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+s/e.frameRate}function $c(a,e){const t=On.exec(a),s=Number(t[1]);switch(t[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class Kc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Ar(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Wt(this,"textTrack1"),t=new Wt(this,"textTrack2"),s=new Wt(this,"textTrack3"),i=new Wt(this,"textTrack4");this.cea608Parser1=new yr(1,e,t),this.cea608Parser2=new yr(3,s,i)}}addCues(e,t,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=Hc(l[0],l[1],t,s);if(c>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],s),n=!0,c/(s-t)>.5))return}if(n||r.push([t,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,s,i)}else{const o=this.Cues.newCue(null,t,s,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(p.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:s}=this;if(s)for(let i=0;i{vt(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Ar(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let s=0;sr.textCodec===Us);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Dn(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media,o=n?Xt(n.textTracks):null;if(this.tracks.forEach((l,c)=>{let h;if(o){let u=null;for(let d=0;dc!==null).map(c=>c.label);l.length&&S.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const n=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r=`textTrack${i[1]}`,n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t?.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===H.MAIN){var s,i;const{cea608Parser1:r,cea608Parser2:n,lastSn:o}=this,{cc:l,sn:c}=t.frag,h=(s=(i=t.part)==null?void 0:i.index)!=null?s:-1;r&&n&&(c!==o+1||c===o&&h!==this.lastPartIndex+1||l!==this.lastCc)&&(r.reset(),n.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:s,payload:i}=t;if(s.type===H.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in t;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===Us?this._parseIMSC1(s,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const s=this.hls;vr(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{S.log(`Failed to parse IMSC1: ${i}`),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:s,payload:i}=e,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(e);return}const l=this.hls,c=(t=s.initSegment)!=null&&t.data?He(s.initSegment.data,new Uint8Array(i)):i;Mc(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(e):this._fallbackToIMSC1(s,i),S.log(`Failed to parse VTT cue: ${h}`),!(u&&o>s.cc)&&l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(e,t){const s=this.tracks[e.level];s.textCodec||vr(t,this.initPTS[e.cc],()=>{s.textCodec=Us,this._parseIMSC1(e,t)},()=>{s.textCodec="wvtt"})}_appendCues(e,t){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>sn(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;s.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:s}=t;s.type===H.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!s||!i)return;const{frag:r,samples:n}=t;if(!(r.type===H.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;ozs(o[l],t,s))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>zs(o[l],t,i))}}}extractCea608Data(e){const t=[[],[]],s=e[0]&31;let i=2;for(let r=0;rthis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const s=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ri.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const s=e.getBoundingClientRect();t.width=s.width,t.height=s.height,!t.width&&!t.height&&(t.width=s.right-s.left||e.width||0,t.height=s.bottom-s.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,t,s){if(!(e!=null&&e.length))return-1;const i=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let r=e.length-1;const n=Math.max(t,s);for(let o=0;o=n||l.height>=n)&&i(l,e[o+1])){r=o;break}}return r}}class Vc{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,s){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(p.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;S.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const jt="[eme]";class Lt{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Lt.CDMCleanupPromise?[Lt.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=S.debug.bind(S,jt),this.log=S.log.bind(S,jt),this.warn=S.warn.bind(S,jt),this.error=S.error.bind(S,jt),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:s}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===le.WIDEVINE&&s)return s;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,s=t[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=t.map(n=>n.audioCodec).filter(s),r=t.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof Be?o(u):o(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Kr===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return s(e,t)}getMediaKeysPromise(e,t,s){const i=Xa(e,t,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let n=r?.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),n.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=l.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),c.then(u=>u?this.setMediaKeysServerCertificate(h,e,u):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:s}){this.log(`Creating key-system session "${t}" keyId: ${ze.hexDump(e.keyId||[])}`);const i=s.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const s=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return ze.hexDump(e.keyId)}updateKeySession(e,t){var s;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${ze.hexDump(((s=e.decryptdata)==null?void 0:s.keyId)||[])} - } (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,s)=>{const i=Ls(this.config),r=e.map(wi).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=ki(n);o?t(o):s(new Error(`Unable to find format for key-system "${n}"`))}).catch(s)})}loadKey(e){const t=e.keyInfo.decryptdata,s=this.getKeyIdString(t),i=`(keyId: ${s} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(t).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Be?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),s=this.keyIdToKeySessionPromise[t];if(!s){const i=wi(e.keyFormat),r=i?[i]:Ls(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=Ls(this.config)),e.length===0)throw new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:s}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),s===null)return;let i,r;if(t==="sinf"&&this.config.drmSystems[le.FAIRPLAY]){const h=pe(new Uint8Array(s));try{const u=hi(JSON.parse(h).sinf),d=Xr(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=le.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=So(s);if(h===null)return;h.version===0&&h.systemId===$r.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=qa(h.systemId)}if(!r||!i)return;const n=ze.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,t,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const g=new Pt("ISO-23001-7",n,(d=ki(h))!=null?d:"");return g.pssh=new Uint8Array(s),g.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:g,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[e.keySystem])==null?void 0:n.generateRequest;if(o)try{const f=o.call(this.hls,t,s,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,s=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var l;if(this.warn(f.message),(l=this.hls)!=null&&l.config.debug)throw f}if(s===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${s?s.byteLength:null})`);const h=new Si,u=e._onmessage=f=>{const m=e.mediaKeysSession;if(!m){h.emit("error",new Error("invalid state"));return}const{messageType:E,message:T}=f;this.log(`"${E}" message event for session "${m.sessionId}" message size: ${T.byteLength}`),E==="license-request"||E==="license-renewal"?this.renewLicense(e,T).catch(y=>{this.handleError(y),h.emit("error",y)}):E==="license-release"?e.keySystem===le.FAIRPLAY&&(this.updateKeySession(e,Ys("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${E}"`)},d=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const E=e.keyStatus;h.emit("keyStatus",E),E==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",d);const g=new Promise((f,m)=>{h.on("error",m),h.on("keyStatus",E=>{E.startsWith("usable")?f():E==="output-restricted"?m(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):E==="internal-error"?m(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${E}"`)):E==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${E}"`)})});return e.mediaKeysSession.generateRequest(t,s).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${c}`)}).catch(f=>{throw new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>g).catch(f=>{throw h.removeAllListeners(),this.removeSession(e),f}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,s)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${ze.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${ze.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,s=t.loader,i=new s(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{n(d.data)},onError:(d,g,f,m)=>{o(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:Le({url:l.url,data:void 0},d)},`"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`))},onTimeout:(d,g,f)=>{o(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(d,g,f)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,s){return new Promise((i,r)=>{e.setServerCertificate(s).then(n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${s?.byteLength}) on "${t}"`),i(e)}).catch(n=>{r(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(i=>{throw new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const s=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(s,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let u=0,d=r.length;u in key message");return Ys(atob(c))}setupLicenseXHR(e,t,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return e.open("POST",t,!0),r.call(this.hls,e,t,s,i)}).then(n=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${n}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,e)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new Be({type:W.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${n}). Status: ${o.status} (${o.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,n,e,t).then(({xhr:l,licenseChallenge:c})=>{e.keySystem==le.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(l,c)),l.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const s=t.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Pt.clearKeyUriToKeyIdMap();const s=t.length;Lt.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e?.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:s}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Lt.CDMCleanupPromise=void 0;class Be extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Ie;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(Ie||(Ie={}));var si;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(si||(si={}));var dt;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(dt||(dt={}));const Wc={[dt.OBJECT]:["br","d","ot","tb"],[dt.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[dt.SESSION]:["cid","pr","sf","sid","st","v"],[dt.STATUS]:["bs","rtp"]};class It{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(s=>s instanceof It?s:new It(s))),this.value=e,this.params=t}}class Un{constructor(e){this.description=void 0,this.description=e}}const Yc="Dict";function jc(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function zc(a,e,t,s){return new Error(`failed to ${a} "${jc(e)}" as ${t}`,{cause:s})}const Rr="Bare Item",qc="Boolean",Xc="Byte Sequence",Qc="Decimal",Jc="Integer";function Zc(a){return a<-999999999999999||99999999999999912)throw Ze(a,Qc);const t=e.toString();return t.includes(".")?t:`${t}.0`}const lh="String";function ch(a){if(eh.test(a))throw Ze(a,lh);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function hh(a){return a.description||a.toString().slice(7,-1)}function br(a){const e=hh(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ze(e,th);return e}function ii(a){switch(typeof a){case"number":if(!N(a))throw Ze(a,Rr);return Number.isInteger(a)?Bn(a):oh(a);case"string":return ch(a);case"symbol":return br(a);case"boolean":return ih(a);case"object":if(a instanceof Date)return ah(a);if(a instanceof Uint8Array)return nh(a);if(a instanceof Un)return br(a);default:throw Ze(a,Rr)}}function ri(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ze(a,sh);return a}function bi(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${ri(e)}`:`;${ri(e)}=${ii(t)}`).join("")}function $n(a){return a instanceof It?`${ii(a.value)}${bi(a.params)}`:ii(a)}function uh(a){return`(${a.value.map($n).join(" ")})${bi(a.params)}`}function dh(a,e={whitespace:!0}){if(typeof a!="object")throw Ze(a,Yc);const t=a instanceof Map?a.entries():Object.entries(a),s=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof It||(r=new It(r));let n=ri(i);return r.value===!0?n+=bi(r.params):(n+="=",Array.isArray(r.value)?n+=uh(r):n+=$n(r)),n}).join(`,${s}`)}function fh(a,e){return dh(a,e)}const gh=a=>a==="ot"||a==="sf"||a==="st",mh=a=>typeof a=="number"?N(a):a!=null&&a!==""&&a!==!1;function ph(a,e){const t=new URL(a),s=new URL(e);if(t.origin!==s.origin)return a;const i=t.pathname.split("/").slice(1),r=s.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function Eh(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}const ss=a=>Math.round(a),Th=(a,e)=>(e!=null&&e.baseUrl&&(a=ph(a,e.baseUrl)),encodeURIComponent(a)),zt=a=>ss(a/100)*100,yh={br:ss,d:ss,bl:zt,dl:zt,mtp:zt,nor:Th,rtp:zt,tb:ss};function vh(a,e){const t={};if(a==null||typeof a!="object")return t;const s=Object.keys(a).sort(),i=me({},yh,e?.formatters),r=e?.filter;return s.forEach(n=>{if(r!=null&&r(n))return;let o=a[n];const l=i[n];l&&(o=l(o,e)),!(n==="v"&&o===1)&&(n=="pr"&&o===1||mh(o)&&(gh(n)&&typeof o=="string"&&(o=new Un(o)),t[n]=o))}),t}function Kn(a,e={}){return a?fh(vh(a,e),me({whitespace:!1},e)):""}function xh(a,e={}){if(!a)return{};const t=Object.entries(a),s=Object.entries(Wc).concat(Object.entries(e?.customHeaderMap||{})),i=t.reduce((r,n)=>{var o,l;const[c,h]=n,u=((o=s.find(d=>d[1].includes(c)))==null?void 0:o[0])||dt.REQUEST;return(l=r[u])!=null||(r[u]={}),r[u][c]=h,r},{});return Object.entries(i).reduce((r,[n,o])=>(r[n]=Kn(o,e),r),{})}function Sh(a,e,t){return me(a,xh(e,t))}const Lh="CMCD";function Ah(a,e={}){if(!a)return"";const t=Kn(a,e);return`${Lh}=${encodeURIComponent(t)}`}const Ir=/CMCD=[^&#]+/;function Rh(a,e,t){const s=Ah(e,t);if(!s)return a;if(Ir.test(a))return a.replace(Ir,s);const i=a.includes("?")?"&":"?";return`${a}${i}${s}`}class bh{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Ie.MANIFEST,su:!this.initialized})}catch(r){S.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===Ie.VIDEO||o===Ie.AUDIO||o==Ie.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){S.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:s}=t;s!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Eh(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var s,i;this.audioBuffer=(s=t.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:si.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){me(t,this.createData());const s=t.ot===Ie.INIT||t.ot===Ie.VIDEO||t.ot===Ie.MUXED;this.starved&&s&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((r,n)=>(i.includes(n)&&(r[n]=t[n]),r),{})),this.useHeaders?(e.headers||(e.headers={}),Sh(e.headers,t)):e.url=Rh(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ie.TIMED_TEXT;if(e.sn==="initSegment")return Ie.INIT;if(t==="audio")return Ie.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ie.VIDEO:Ie.MUXED}getTopBandwidth(e){let t=0,s;const i=this.hls;if(e===Ie.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,s=e===Ie.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!t?NaN:ne.bufferInfo(s,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}}const Ih=3e5;class Dh{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=S.log.bind(S,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:s}=t;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:s}=t;if(s?.action===Ae.SendAlternateToPenaltyBox&&s.flags===Ve.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,n=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:c}=t.context;o&&i?n=this.getPathwayForGroupId(o,c,n):l&&(n=l)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!r&&i&&(r=i.reduce((o,l)=>(o.indexOf(l.pathwayId)===-1&&o.push(l.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),s.resolved=this.pathwayId!==n),s.resolved||S.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${n} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),t=this.getLevelsForPathway(s),this.pathwayId=s}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>Ih&&delete s[r]});for(let r=0;r0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,on(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,s){const i=this.getLevelsForPathway(s).concat(this.levels||[]);for(let r=0;r{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(t.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=new ce(h.attrs);u["PATHWAY-ID"]=n;const d=u.AUDIO&&`${u.AUDIO}_clone_${n}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${n}`;d&&(s[u.AUDIO]=d,u.AUDIO=d),g&&(i[u.SUBTITLES]=g,u.SUBTITLES=g);const f=Hn(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),m=new Rt({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:f,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let E=1;E{this.log(`Loaded steering manifest: "${i}"`);const f=h.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":E,"PATHWAY-PRIORITY":T}=f;if(m)try{this.uri=new self.URL(m,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),E&&this.clonePathways(E);const y={steeringManifest:f,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,y),T&&this.updatePathwayPriority(T)},onError:(h,u,d,g)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(h.code===429){const m=this.loader;if(typeof m?.getResponseHeader=="function"){const E=m.getResponseHeader("Retry-After");E&&(f=parseFloat(E)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(h,u,d)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,l,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const i=(s=this.hls)==null?void 0:s.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Dr(a,e,t,s){a&&Object.keys(e).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=me({},n);return o.details=void 0,o.attrs=new ce(o.attrs),o.url=o.attrs.URI=Hn(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function Hn(a,e,t,s){const{HOST:i,PARAMS:r,[t]:n}=s;let o;e&&(o=n?.[e],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const Ch=/^age:\s*[\d.]+\s*$/im;class Vn{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Es,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return r(s,t.url)}).catch(n=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",t.url,!0),r(s,t.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,t,e)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},t,s,i)}):this.openAndSendXhr(s,t,e)}openAndSendXhr(e,t,s){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&N(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:s}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,o=t.responseType!=="text";if(n>=200&&n<300&&(o&&t.response||t.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?t.response:t.responseText,c=t.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,e,l,t),!this.callbacks)return;const u={url:t.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,e,t)}else{const l=r.loadPolicy.errorRetry,c=s.retry,h={url:e.url,data:void 0,code:n};hs(l,c,!1,h)?this.retry(l):(S.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,s))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(hs(e,t,!0))this.retry(e);else{var s;S.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:s}=this;this.retryDelay=fi(e,s.retry),s.retry++,S.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t?.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Ch.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function _h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const wh=/(\d+)-(\d+)\/(\d+)/;class Cr{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Oh,this.controller=new self.AbortController,this.stats=new Es}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=kh(e,this.controller.signal),n=s.onProgress,o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=s,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&N(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},h-(d-i.loading.start)),!u.ok){const{status:g,statusText:f}=u;throw new Mh(f||"fetch, bad network response",g,u)}return i.loading.first=d,i.total=Fh(u.headers)||i.total,n&&N(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,n):o?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const d=this.response;if(!d)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const g=u[l];g&&(i.loaded=i.total=g);const f={url:d.url,data:u,code:d.status};n&&!N(t.highWaterMark)&&n(i,e,u,d),s.onSuccess(f,i,e,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,g=u?u.message:null;s.onError({code:d,text:g},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,s,i=0,r){const n=new un,o=e.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(t,s,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u=i&&r(t,s,n.flush(),e)):r(t,s,h,e),l()}).catch(()=>Promise.reject());return l()}}function kh(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(me({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Ph(a){const e=wh.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Fh(a){const e=a.get("Content-Range");if(e){const s=Ph(e);if(N(s))return s}const t=a.get("Content-Length");if(t)return parseInt(t)}function Oh(a,e){return new self.Request(a.url,e)}class Mh extends Error{constructor(e,t,s){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=s}}const Nh=/\s/,Uh={newCue(a,e,t,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const g=Pn(c.trim()),f=Ai(e,t,g);a!=null&&(u=a.cues)!=null&&u.getCueById(f)||(n=new h(e,t,g),n.id=f,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,g)=>d.line==="auto"||g.line==="auto"?0:d.line>8&&g.line>8?g.line-d.line:d.line-g.line),i.forEach(d=>sn(a,d))),i}},Bh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Wn=Le(Le({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Vn,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:dl,bufferController:pc,capLevelController:Ri,errorController:el,fpsController:Vc,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Kr,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:Bh},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Gh()),{},{subtitleStreamController:dc,subtitleTrackController:gc,timelineController:Kc,audioStreamController:hc,audioTrackController:uc,emeController:Lt,cmcdController:bh,contentSteeringController:Dh});function Gh(){return{cueHandler:Uh,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function $h(a,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=ni(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n=`${r==="level"?"playlist":r}LoadPolicy`,o=e[n]===void 0,l=[];i.forEach(c=>{const h=`${r}Loading${c}`,u=e[h];if(u!==void 0&&o){l.push(h);const d=t[n].default;switch(e[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&S.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${n}": ${JSON.stringify(e[n])}`)}),Le(Le({},t),e)}function ni(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ni):Object.keys(a).reduce((e,t)=>(e[t]=ni(a[t]),e),{}):a}function Kh(a){const e=a.loader;e!==Cr&&e!==Vn?(S.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):_h()&&(a.loader=Cr,a.progressive=!0,a.enableSoftwareAES=!0,S.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Ks;class Hh extends gi{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const s=this.hls.config.preferManagedMediaSource,i=[],r={},n={};let o=!1,l=!1,c=!1;t.levels.forEach(h=>{var u,d;const g=h.attrs;let{audioCodec:f,videoCodec:m}=h;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(Ks||(Ks=/chrome|firefox/i.test(navigator.userAgent)),Ks&&(h.audioCodec=f=void 0)),f&&(h.audioCodec=f=os(f,s)),((d=m)==null?void 0:d.indexOf("avc1"))===0&&(m=h.videoCodec=Co(m));const{width:E,height:T,unknownCodecs:y}=h;if(o||(o=!!(E&&T)),l||(l=!!m),c||(c=!!f),y!=null&&y.length||f&&!Is(f,"audio",s)||m&&!Is(m,"video",s))return;const{CODECS:v,"FRAME-RATE":A,"HDCP-LEVEL":x,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":C}=g,I=`${`${D||"."}-`}${h.bitrate}-${R}-${A}-${v}-${C}-${x}`;if(r[I])if(r[I].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const w=n[I]+=1;h.attrs["PATHWAY-ID"]=new Array(w+1).join(".");const B=new Rt(h);r[I]=B,i.push(B)}else r[I].addGroupId("audio",g.AUDIO),r[I].addGroupId("text",g.SUBTITLES);else{const w=new Rt(h);r[I]=w,n[I]=1,i.push(w)}}),this.filterAndSortMediaOptions(i,t,o,l,c)}filterAndSortMediaOptions(e,t,s,i,r){let n=[],o=[],l=e;if((s||i)&&r&&(l=l.filter(({videoCodec:f,videoRange:m,width:E,height:T})=>(!!f||!!(E&&T))&&Ko(m))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;n=t.audioTracks.filter(m=>!m.audioCodec||Is(m.audioCodec,"audio",f)),_r(n)}t.subtitles&&(o=t.subtitles,_r(o));const c=l.slice(0);l.sort((f,m)=>{if(f.attrs["HDCP-LEVEL"]!==m.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(m.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&f.height!==m.height)return f.height-m.height;if(f.frameRate!==m.frameRate)return f.frameRate-m.frameRate;if(f.videoRange!==m.videoRange)return ls.indexOf(f.videoRange)-ls.indexOf(m.videoRange);if(f.videoCodec!==m.videoCodec){const E=Ni(f.videoCodec),T=Ni(m.videoCodec);if(E!==T)return T-E}if(f.uri===m.uri&&f.codecSet!==m.codecSet){const E=as(f.codecSet),T=as(m.codecSet);if(E!==T)return T-E}return f.averageBitrate!==m.averageBitrate?f.averageBitrate-m.averageBitrate:0});let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;fE&&E===Wn.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=T)}break}const d=r&&!i,g={levels:l,audioTracks:n,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!d&&n.some(f=>!!f.url)};this.hls.trigger(p.MANIFEST_PARSED,g),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(p.ERROR,{type:W.OTHER_ERROR,details:b.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,s===e&&n.details&&i&&r===o)return;this.log(`Switching to level ${e} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${o?" with Pathway "+o:""} from level ${s}${r?" with Pathway "+r:""}`);const l={level:e,attrs:n.attrs,details:n.details,bitrate:n.bitrate,averageBitrate:n.averageBitrate,maxBitrate:n.maxBitrate,realBitrate:n.realBitrate,width:n.width,height:n.height,codecSet:n.codecSet,audioCodec:n.audioCodec,videoCodec:n.videoCodec,audioGroups:n.audioGroups,subtitleGroups:n.subtitleGroups,loaded:n.loaded,loadError:n.loadError,fragmentError:n.fragmentError,name:n.name,id:n.id,uri:n.uri,url:n.url,urlId:0,audioGroupIds:n.audioGroupIds,textGroupIds:n.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i?.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===te.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===H.MAIN){const s=t.elementaryStreams;if(!Object.keys(s).some(r=>!!s[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var s;const{level:i,details:r}=t,n=this._levels[i];if(!n){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):(s=t.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,s=this.currentLevel;if(s&&this.shouldLoadPlaylist(s)){let i=s.uri;if(e)try{i=e.addDirectives(i)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}const r=s.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${e?.msn!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(p.LEVEL_LOADING,{url:i,level:t,pathwayId:s.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const s=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(n=>n.level=-1)),!1));on(s),this._levels=s,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(p.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function _r(a){const e={};a.forEach(t=>{const s=t.groupId||"";t.id=e[s]=e[s]||0,e[s]++})}class Vh{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[s].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=b.KEY_LOAD_ERROR,s,i,r){return new it({type:W.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:s,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=e;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var s,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const s={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,s))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(e,t){const s=this.config,i=s.loader,r=new i(s);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{const{frag:E,keyInfo:T,url:y}=f;if(!E.decryptdata||T!==this.keyUriToKeyInfo[y])return o(this.createKeyLoadError(E,b.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));T.decryptdata.key=E.decryptdata.key=new Uint8Array(d.data),E.keyLoader=null,T.loader=null,n({frag:E,keyInfo:T})},onError:(d,g,f,m)=>{this.resetLoader(g),o(this.createKeyLoadError(t,b.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),f,Le({url:l.url,data:void 0},d)))},onTimeout:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,b.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,b.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};r.load(l,h,u)})}resetLoader(e){const{frag:t,keyInfo:s,url:i}=e,r=s.loader;t.keyLoader===r&&(t.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Yn(){return self.SourceBuffer||self.WebKitSourceBuffer}function jn(){if(!gt())return!1;const e=Yn();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Wh(){if(!jn())return!1;const a=gt();return typeof a?.isTypeSupported=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(Ft(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ft(e,"audio"))))}function Yh(){var a;const e=Yn();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const jh=250,is=2,zh=.1,qh=.05;class Xh{constructor(e,t,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==e){if(this.moved=!0,o||(this.nudgeRetry=0),r!==null){if(this.stallReported){const E=self.performance.now()-r;S.warn(`playback not stuck anymore @${n}, after ${Math.round(E)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!ne.getBuffered(i).length){this.nudgeRetry=0;return}const h=ne.bufferInfo(i,n,0),u=h.nextStart||0;if(o){const E=h.len>is,T=!u||t&&t.start<=n||u-n>is&&!this.fragmentTracker.getPartialFragment(n);if(E||T)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;if(!(h.len>0)&&!u)return;const T=Math.max(u,h.start||0)-n,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,A=(y==null||(d=y.details)==null?void 0:d.live)?y.details.targetduration*2:is,x=this.fragmentTracker.getPartialFragment(n);if(T>0&&(T<=A||x)){i.paused||this._trySkipBufferHole(x);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const f=g-r;if(!o&&f>=jh&&(this._reportStall(h),!this.media))return;const m=ne.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(m,f)}_tryFixBufferStall(e,t){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>s.maxBufferHole||e.nextStart&&e.nextStart-ns.highBufferWatchdogPeriod*1e3&&(S.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${JSON.stringify(e)})`);S.warn(r.message),t.trigger(p.ERROR,{type:W.MEDIA_ERROR,details:b.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=ne.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>t.maxBufferHole){const{fragmentTracker:d}=this;let g=!1;if(r===0){const f=d.getAppendedFrag(0,H.MAIN);f&&o1?(i=0,this.bitrateTest=!0):i=s.firstAutoLevel),s.nextLoadLevel=i,this.level=s.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=_.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=_.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case _.WAITING_LEVEL:{const{levels:t,level:s}=this,i=t?.[s],r=i?.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=_.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=_.IDLE;break}break}case _.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),s=this.retryDate;if(!s||t>=s||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,n=i?.[r];this.resetStartWhenNotLoaded(n||null),this.state=_.IDLE}}break}this.state===_.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:s,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=e.nextLoadLevel;if(!(s!=null&&s[r]))return;const n=s[r],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger(p.BUFFER_EOS,m),this.state=_.ENDED;return}e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const c=n.details;if(!c||this.state===_.WAITING_LEVEL||c.live&&this.levelLastLoaded!==n){this.level=r,this.state=_.WAITING_LEVEL;return}const h=o.len,u=this.getMaxBufferLength(n.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==xe.OK){var f;const E=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,T=c.fragments[E-1];T&&g.cc===T.cc&&(g=T,this.fragmentTracker.removeFragment(T))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const E=this.audioOnly&&!this.altAudio?ie.AUDIO:ie.VIDEO,T=(E===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;T&&this.afterBufferFlushed(T,E,H.MAIN)}g=this.getNextFragmentLoopLoading(g,c,o,H.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,n,d))}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===xe.NOT_LOADED||i===xe.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,s)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,H.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let s;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{const n=r.audioCodec;n&&(s=s||n.indexOf("mp4a.40.2")!==-1,i=i||n.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&i&&!Yh(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:s}=this;if(!s||this.state!==_.IDLE)return;const i=s[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=_.WAITING_LEVEL)}onLevelLoaded(e,t){var s;const{levels:i}=this,r=t.level,n=t.details,o=n.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${o}`);const l=i[r],c=this.fragCurrent;c&&(this.state===_.FRAG_LOADING||this.state===_.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){var u;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(l.details=n,this.levelLastLoaded=l,this.hls.trigger(p.LEVEL_UPDATED,{details:n,level:r}),this.state===_.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=_.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{levels:n}=this;if(!n){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const o=n[s.level],l=o.details;if(!l){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(t=s.initSegment)==null?void 0:t.data,d=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new In(this.hls,H.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,m=f!==-1,E=new mi(s.level,s.sn,s.stats.chunkCount,r.byteLength,f,m),T=this.initPTS[s.cc];g.push(r,u,d,c,s,i,l.totalduration,h,E,T)}onAudioTrackSwitching(e,t){const s=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const s=t.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const s=t.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s&&s.type!==H.MAIN)return;if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===_.PARSED&&(this.state=_.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=_.ERROR;return}switch(t.details){case b.FRAG_GAP:case b.FRAG_PARSING_ERROR:case b.FRAG_DECRYPT_ERROR:case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(H.MAIN,t);break;case b.LEVEL_LOAD_ERROR:case b.LEVEL_LOAD_TIMEOUT:case b.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===_.WAITING_LEVEL&&((s=t.context)==null?void 0:s.type)===te.LEVEL&&(this.state=_.IDLE);break;case b.BUFFER_APPEND_ERROR:case b.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===b.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case b.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!ne.getBuffered(e).length){const s=this.state!==_.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,s)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=_.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ie.AUDIO||this.audioOnly&&!this.altAudio){const s=(t===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,t,H.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let s=this.startPosition;if(s>=0&&t0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(e))return;t.fragmentError=0,this.state=_.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,s),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:g,initSegment:f}=r,{details:m}=h,E=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=_.PARSING,f){if(f!=null&&f.tracks){const v=l.initSegment||l;this._bufferInitSegment(h,f.tracks,v,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:v,id:s,tracks:f.tracks})}const T=f.initPTS,y=f.timescale;N(T)&&(this.initPTS[l.cc]={baseTime:T,timescale:y},i.trigger(p.INIT_PTS_FOUND,{frag:l,id:s,initPTS:T,timescale:y}))}if(u&&m&&l.sn!=="initSegment"){const T=m.fragments[l.sn-1-m.startSN],y=l.sn===m.startSN,v=!T||l.cc>T.cc;if(r.independent!==!1){const{startPTS:A,endPTS:x,startDTS:D,endDTS:R}=u;if(c)c.elementaryStreams[u.type]={startPTS:A,endPTS:x,startDTS:D,endDTS:R};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!v&&(this.couldBacktrack=!0),u.dropped&&u.independent){const C=this.getMainFwdBufferInfo(),k=(C?C.end:this.getLoadPosition())+this.config.maxBufferHole,I=u.firstKeyFramePTS?u.firstKeyFramePTS:A;if(!y&&kis&&(l.gap=!0);l.setElementaryStreamInfo(u.type,A,x,D,R),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(u,l,c,n,y||v)}else if(y||v)l.gap=!0;else{this.backtrack(l);return}}if(E){const{startPTS:T,endPTS:y,startDTS:v,endDTS:A}=E;c&&(c.elementaryStreams[ie.AUDIO]={startPTS:T,endPTS:y,startDTS:v,endDTS:A}),l.setElementaryStreamInfo(ie.AUDIO,T,y,v,A),this.bufferFragmentData(E,l,c,n)}if(m&&g!=null&&(t=g.samples)!=null&&t.length){const T={id:s,frag:l,details:m,samples:g.samples};i.trigger(p.FRAG_PARSING_METADATA,T)}if(m&&d){const T={id:s,frag:l,details:m,samples:d.samples};i.trigger(p.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(e,t,s,i){if(this.state!==_.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:n,audiovideo:o}=t;if(r){let l=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const h=r.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),r.levelCodec=l,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${r.codec}]`)}n&&(n.levelCodec=e.videoCodec,n.id="main",this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(p.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const h=t[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,H.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=_.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(ne.isBuffered(e,s)?t=this.getAppendedFrag(s):ne.isBuffered(e,s+.1)&&(t=this.getAppendedFrag(s+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,s=this.currentFrag;if(s&&N(t)&&N(s.programDateTime)){const i=s.programDateTime+(t-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class $e{static get version(){return"1.5.13"}static isMSESupported(){return jn()}static isSupported(){return Wh()}static getMediaSource(){return gt()}static get Events(){return p}static get ErrorTypes(){return W}static get ErrorDetails(){return b}static get DefaultConfig(){return $e.defaultConfig?$e.defaultConfig:Wn}static set DefaultConfig(e){$e.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Si,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,Ba(e.debug||!1,"Hls instance");const t=this.config=$h($e.DefaultConfig,e);this.userConfig=e,t.progressive&&Kh(t);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=t,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),g=new Fo(this),f=new Bo(this),m=t.contentSteeringController,E=m?new m(this):null,T=this.levelController=new Hh(this,E),y=new gl(this),v=new Vh(this.config),A=this.streamController=new Jh(this,y,v);u.setStreamController(A),d.setStreamController(A);const x=[g,T,A];E&&x.splice(1,0,E),this.networkControllers=x;const D=[c,h,u,d,f,y];this.audioTrackController=this.createController(t.audioTrackController,x);const R=t.audioStreamController;R&&x.push(new R(this,y,v)),this.subtitleTrackController=this.createController(t.subtitleTrackController,x);const C=t.subtitleStreamController;C&&x.push(new C(this,y,v)),this.createController(t.timelineController,D),v.emeController=this.emeController=this.createController(t.emeController,D),this.cmcdController=this.createController(t.cmcdController,D),this.latencyController=this.createController(Go,D),this.coreComponents=D,x.push(l);const k=l.onErrorOut;typeof k=="function"&&this.on(p.ERROR,k,l)}createController(e,t){if(e){const s=new e(this);return t&&t.push(s),s}return null}on(e,t,s=this){this._emitter.on(e,t,s)}once(e,t,s=this){this._emitter.once(e,t,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,s=this,i){this._emitter.off(e,t,s,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,s){return this._emitter.emit(e,t,s)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(s){if(S.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:W.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,fatal:i,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){S.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){S.log("attachMedia"),this._media=e,this.trigger(p.MEDIA_ATTACHING,{media:e})}detachMedia(){S.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,s=this.url,i=this.url=ci.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,S.log(`loadSource:${i}`),t&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}startLoad(e=-1){S.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){S.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){S.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){S.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){S.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){S.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){S.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){S.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){S.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(S.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){$o(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const s=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:s}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,s)for(let r=i;r--;){const n=e[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}$e.defaultConfig=void 0;var Zh=Oe(''),eu=Oe('
                '),tu=Oe(' ',1);function su(a,e){ms(e,!0);let t=se(e,"value",3,null),s=se(e,"subtitles",3,null),i=se(e,"dispatch_blob",3,()=>Promise.resolve()),r=se(e,"interactive",3,!1),n=se(e,"editable",3,!0),o=se(e,"trim_region_settings",19,()=>({})),l=se(e,"mode",15),c=se(e,"handle_reset_value",3,()=>{}),h=se(e,"playback_position",15),u=nt(()=>t()?.url),d=_e(0),g,f,m=_e(!1),E,T=_e(!1),y,v,A,x=_e(0),D=_e(0),R=_e(!1),C,k=!1,I=_e(!0),w=[],B=nt(()=>e.waveform_options.show_recording_waveform&&!t()?.is_stream);Ke(()=>{P(m)&&h()!==void 0&&P(d)!==h()&&P(x)&&(f?.seekTo(h()/P(x)),ge(d,h(),!0))});const F=()=>{f=oa.create({container:g,...e.waveform_settings}),s()&&f&&(P(I)?Z(f,s()):q()),f?.on("init",()=>{ge(m,!0)}),f?.on("decode",$=>{ge(x,$,!0),A&&(A.textContent=Mt($))});let Y=!0;f?.on("timeupdate",$=>{if(v&&(v.textContent=Mt($)),Y){Y=!1;return}h($),ge(d,$,!0)}),f?.on("interaction",()=>{const $=f?.getCurrentTime()||0;v&&(v.textContent=Mt($)),h($),ge(d,$,!0)}),f?.on("ready",()=>{e.waveform_settings.autoplay?f?.play():f?.stop()}),f?.on("finish",()=>{e.loop?f?.play():(ge(T,!1),e.onstop?.())}),f?.on("pause",()=>{ge(T,!1),e.onpause?.()}),f?.on("play",()=>{ge(T,!0),e.onplay?.()}),f?.on("load",()=>{e.onload?.()})};Ke(()=>{P(u)&&P(m)&&ea(()=>{t()?.url&&f&&f.load(t().url).catch(Y=>{Y.name!=="AbortError"&&console.error("Waveform load error:",Y)})})});const G=async(Y,$)=>{l("");const fe=f?.getDecodedData();if(fe){const oe=await la(fe,Y,$,e.waveform_settings.sampleRate);await i()([oe],"change")}e.onedit?.()};async function V(Y){k=!1,e.waveform_options.show_recording_waveform?f?.load(Y):C&&(C.src=Y)}Ke(()=>{s()&&f&&(P(I)?Z(f,s()):q())});function U(Y){if(!(!Y||!Y.is_stream||!Y.url))if($e.isSupported()&&!k){const $=new $e({maxBufferLength:1,maxMaxBufferLength:1,lowLatencyMode:!0});$.loadSource(Y.url),$.attachMedia(C),$.on($e.Events.MANIFEST_PARSED,function(){e.waveform_settings.autoplay&&C.play()}),$.on($e.Events.ERROR,function(fe,oe){if(console.error("HLS error:",fe,oe),oe.fatal)switch(oe.type){case $e.ErrorTypes.NETWORK_ERROR:console.error("Fatal network error encountered, trying to recover"),$.startLoad();break;case $e.ErrorTypes.MEDIA_ERROR:console.error("Fatal media error encountered, trying to recover"),$.recoverMediaError();break;default:console.error("Fatal error, cannot recover"),$.destroy();break}}),k=!0}else k||(C.src=Y.url,e.waveform_settings.autoplay&&C.play(),k=!0)}Ke(()=>{C&&P(u)&&P(m)&&P(u)&&V(P(u))}),Ke(()=>{C&&t()?.is_stream&&U(t())}),oi(()=>{F();const Y=$=>{!f||P(R)||!(E&&E.contains(document.activeElement))||($.key==="ArrowRight"&&l()!=="edit"?Ii(f,.1):$.key==="ArrowLeft"&&l()!=="edit"&&Ii(f,-.1))};return window.addEventListener("keydown",Y),()=>{f?.destroy(),window.removeEventListener("keydown",Y)}});async function Z(Y,$){O();try{let fe;if(Array.isArray($))fe=$;else{const be=await(await fetch($)).text();fe=M(be)}if(fe.length>0){let oe="";if(y){y.style.display="";const be=Me=>{const Ne=fe.find(et=>Me>=et.start&&Me<=et.end);Ne&&Ne.text!==oe?(oe=Ne.text,y.textContent=oe):!Ne&&oe!==""&&(oe="",y.textContent="")};Y.on("audioprocess",be),w.push(()=>{Y.un("audioprocess",be)})}}}catch{}}function q(){y&&(y.style.display="none")}function O(){y&&(y.textContent=""),w.forEach(Y=>Y()),w=[]}function M(Y){const $=Y.split(` -`),fe=[];for(let oe=0;oe<$.length;oe++){const be=$[oe].trim();if(be.includes(" --> ")){const[Me,Ne]=be.split(" --> "),et=ee(Me),z=ee(Ne);let J="";for(let he=oe+1;he<$.length&&$[he].trim()!=="";he++)J&&(J+=" "),J+=$[he].trim();J&&fe.push({start:et,end:z,text:J})}}return fe}function ee(Y){const $=Y.split(":");if($.length===3){const fe=parseInt($[0]),oe=parseInt($[1]),be=parseFloat($[2]);return fe*3600+oe*60+be}return 0}var j=tu(),X=lt(j);let ae;ht(X,Y=>C=Y,()=>C);var re=ve(X,2);{var de=Y=>{Or(Y,{size:"small",children:($,fe)=>{Vs($)},$$slots:{default:!0}})},Re=Y=>{var $=Fr(),fe=lt($);{var oe=be=>{var Me=eu(),Ne=Te(Me),et=Te(Ne);let z;ht(et,ue=>g=ue,()=>g),ye(Ne);var J=ve(Ne,2),he=Te(J);ht(he,ue=>v=ue,()=>v);var Ue=ve(he,2),Ot=Te(Ue);{var ys=ue=>{var Pe=Zh(),zn=Te(Pe,!0);ye(Pe),xt(qn=>Pr(zn,qn),[()=>Mt(P(D))]),Se(ue,Pe)};Fe(Ot,ue=>{l()==="edit"&&P(D)>0&&ue(ys)})}var vs=ve(Ot,2);ht(vs,ue=>A=ue,()=>A),ye(Ue),ye(J);var ke=ve(J,2);ht(ke,ue=>y=ue,()=>y);var De=ve(ke,2);{let ue=nt(()=>s()!==null);_a(De,{get container(){return g},get waveform(){return f},get playing(){return P(T)},get audio_duration(){return P(x)},get i18n(){return e.i18n},get interactive(){return r()},handle_trim_audio:G,get show_redo(){return r()},get handle_reset_value(){return c()},get waveform_options(){return e.waveform_options},get trim_region_settings(){return o()},get editable(){return n()},get show_subtitles(){return P(ue)},get mode(){return l()},set mode(Pe){l(Pe)},get trimDuration(){return P(D)},set trimDuration(Pe){ge(D,Pe,!0)},get show_volume_slider(){return P(R)},set show_volume_slider(Pe){ge(R,Pe,!0)},get subtitles_toggle(){return P(I)},set subtitles_toggle(Pe){ge(I,Pe,!0)}})}ye(Me),ht(Me,ue=>E=ue,()=>E),xt(()=>{Ct(Me,"data-testid",e.label?"waveform-"+e.label:"unlabelled-audio"),z=Hs(et,"",z,{height:g?null:"58px"})}),Se(be,Me)};Fe(fe,be=>{P(B)&&be(oe)},!0)}Se(Y,$)};Fe(re,Y=>{t()===null?Y(de):Y(Re,!1)})}xt(()=>{ae=wr(X,1,"standard-player svelte-17b6jj5",null,ae,{hidden:P(B)}),X.autoplay=e.waveform_settings.autoplay}),xs("load",X,function(...Y){e.onload?.apply(this,Y)}),xs("ended",X,()=>e.onstop?.()),xs("play",X,()=>e.onplay?.()),Se(a,j),ps()}var iu=Oe(" ",1),ru=Oe(" ",1),nu=Oe(" ",1);function au(a,e){ms(e,!0);let t=se(e,"value",3,null),s=se(e,"subtitles",3,null),i=se(e,"show_label",3,!0),r=se(e,"buttons",19,()=>[]),n=se(e,"on_custom_button_click",3,null),o=se(e,"waveform_settings",19,()=>({})),l=se(e,"waveform_options",19,()=>({show_recording_waveform:!0})),c=se(e,"editable",3,!0),h=se(e,"display_icon_button_wrapper_top_corner",3,!1),u=se(e,"minimal",3,!1),d=se(e,"playback_position",15);Ke(()=>{t()&&e.onchange?.(t())});var g=nu(),f=lt(g);{let y=nt(()=>e.label||e.i18n("audio.audio"));sa(f,{get show_label(){return i()},get Icon(){return Vs},float:!1,get label(){return P(y)}})}var m=ve(f,2);{var E=y=>{var v=Fr(),A=lt(v);{var x=R=>{{let C=nt(()=>e.label||e.i18n("audio.audio"));ca(R,{get value(){return t()},get label(){return P(C)},get loop(){return e.loop}})}},D=R=>{var C=ru(),k=lt(C);aa(k,{get display_top_corner(){return h()},get buttons(){return r()},get on_custom_button_click(){return n()},children:(w,B)=>{var F=iu(),G=lt(F);{var V=q=>{{let O=nt(()=>t().is_stream?t().url?.replace("playlist.m3u8","playlist-file"):t().url),M=nt(()=>t().orig_name||t().path);ia(q,{get href(){return P(O)},get download(){return P(M)},children:(ee,j)=>{{let X=nt(()=>e.i18n("common.download"));ta(ee,{get Icon(){return na},get label(){return P(X)}})}},$$slots:{default:!0}})}};Fe(G,q=>{r().some(O=>typeof O=="string"&&O==="download")&&q(V)})}var U=ve(G,2);{var Z=q=>{ra(q,{get i18n(){return e.i18n},get onerror(){return e.onerror},get onshare(){return e.onshare},formatter:async O=>!O||!O.url?"":``,get value(){return t()}})};Fe(U,q=>{r().some(O=>typeof O=="string"&&O==="share")&&q(Z)})}Se(w,F)},$$slots:{default:!0}});var I=ve(k,2);{let w=nt(()=>Array.isArray(s())?s():s()?.url);su(I,{get value(){return t()},get subtitles(){return P(w)},get label(){return e.label},get i18n(){return e.i18n},get waveform_settings(){return o()},get waveform_options(){return l()},get editable(){return c()},get loop(){return e.loop},get onpause(){return e.onpause},get onplay(){return e.onplay},get onstop(){return e.onstop},onload:()=>{},get playback_position(){return d()},set playback_position(B){d(B)}})}Se(R,C)};Fe(A,R=>{u()?R(x):R(D,!1)})}Se(y,v)},T=y=>{Or(y,{size:"small",children:(v,A)=>{Vs(v)},$$slots:{default:!0}})};Fe(m,y=>{t()!==null?y(E):y(T,!1)})}Se(a,g),ps()}const Lu=Object.freeze(Object.defineProperty({__proto__:null,default:au},Symbol.toStringTag,{value:"Module"}));export{su as A,au as S,_a as W,Lu as a}; diff --git a/assets/StreamingBar-CzgHaKX0.js b/assets/StreamingBar-CzgHaKX0.js deleted file mode 100644 index 13a7428b71e8e6732f008a8faa0d42f854229ee0..0000000000000000000000000000000000000000 --- a/assets/StreamingBar-CzgHaKX0.js +++ /dev/null @@ -1 +0,0 @@ -import{i as l,f as n}from"./i18n-CPHyzK9b.js";import{a3 as v,N as _,a as m,t as d,R as c}from"./index-DydPgVMC.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";var p=c('
                ');function u(s,a){var i=v(),o=_(i);{var f=t=>{var e=p();let r;d(()=>r=n(e,"",r,{"animation-duration":`${a.time_limit??""}s`})),m(t,e)};l(o,t=>{a.time_limit&&t(f)})}m(s,i)}export{u as S}; diff --git a/assets/StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js b/assets/StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js deleted file mode 100644 index e99ab779e257545f3553db7b86efdcf3e7420bd2..0000000000000000000000000000000000000000 --- a/assets/StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js +++ /dev/null @@ -1,3 +0,0 @@ -import{p as _t,i as z,d as St,b as L,f as ht,q as zt}from"./i18n-CPHyzK9b.js";import{b as Lt,aU as $t,E as jt,aV as It,aW as Ot,u as Rt,v as Bt,aX as Ut,aY as Wt,aZ as Dt,a9 as yt,a_ as Ht,J as Pt,a$ as P,a as y,f as q,D as Xt,b0 as qt,ah as Vt,M as Yt,ac as Zt,Z as u,S as O,t as G,X as pt,O as Gt,aa as J,a2 as X,$ as U,Q as F,a3 as st,N as K,R as W,T as M}from"./index-DydPgVMC.js";import{h as Jt}from"./html-BZIV6tyB.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{A as Kt}from"./index-B_pwUImq.js";const Qt=()=>performance.now(),A={tick:e=>requestAnimationFrame(e),now:()=>Qt(),tasks:new Set};function kt(){const e=A.now();A.tasks.forEach(t=>{t.c(e)||(A.tasks.delete(t),t.f())}),A.tasks.size!==0&&A.tick(kt)}function te(e){let t;return A.tasks.size===0&&A.tick(kt),{promise:new Promise(r=>{A.tasks.add(t={c:e,f:r})}),abort(){A.tasks.delete(t)}}}function Q(e,t){yt(()=>{e.dispatchEvent(new CustomEvent(t))})}function ee(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function gt(e){const t={},r=e.split(";");for(const o of r){const[s,n]=o.split(":");if(!s||n===void 0)break;const v=ee(s.trim());t[v]=n.trim()}return t}const ae=e=>e;function it(e,t,r,o){var s=(e&Wt)!==0,n=(e&Dt)!==0,v=s&&n,f=(e&Ut)!==0,x=v?"both":s?"in":"out",d,i=t.inert,b=t.style.overflow,g,h;function k(){return yt(()=>d??=r()(t,o?.()??{},{direction:x}))}var l={is_global:f,in(){if(t.inert=i,!s){h?.abort(),h?.reset?.();return}n||g?.abort(),Q(t,"introstart"),g=ct(t,k(),h,1,()=>{Q(t,"introend"),g?.abort(),g=d=void 0,t.style.overflow=b})},out($){if(!n){$?.(),d=void 0;return}t.inert=!0,Q(t,"outrostart"),h=ct(t,k(),g,0,()=>{Q(t,"outroend"),$?.()})},stop:()=>{g?.abort(),h?.abort()}},p=Lt;if((p.nodes.t??=[]).push(l),s&&$t){var c=f;if(!c){for(var m=p.parent;m&&(m.f&jt)!==0;)for(;(m=m.parent)&&(m.f&It)===0;);c=!m||(m.f&Ot)!==0}c&&Rt(()=>{Bt(()=>l.in())})}}function ct(e,t,r,o,s){var n=o===1;if(Ht(t)){var v,f=!1;return Pt(()=>{if(!f){var p=t({direction:n?"in":"out"});v=ct(e,p,r,o,s)}}),{abort:()=>{f=!0,v?.abort()},deactivate:()=>v.deactivate(),reset:()=>v.reset(),t:()=>v.t()}}if(r?.deactivate(),!t?.duration)return s(),{abort:P,deactivate:P,reset:P,t:()=>o};const{delay:x=0,css:d,tick:i,easing:b=ae}=t;var g=[];if(n&&r===void 0&&(i&&i(0,1),d)){var h=gt(d(0,1));g.push(h,h)}var k=()=>1-o,l=e.animate(g,{duration:x,fill:"forwards"});return l.onfinish=()=>{l.cancel();var p=r?.t()??1-o;r?.abort();var c=o-p,m=t.duration*Math.abs(c),$=[];if(m>0){var w=!1;if(d)for(var E=Math.ceil(m/16.666666666666668),N=0;N<=E;N+=1){var V=p+c*b(N/E),Y=gt(d(V,1-V));$.push(Y),w||=Y.overflow==="hidden"}w&&(e.style.overflow="hidden"),k=()=>{var R=l.currentTime;return p+c*b(R/m)},i&&te(()=>{if(l.playState!=="running")return!1;var R=k();return i(R,1-R),!0})}l=e.animate($,{duration:m,fill:"forwards"}),l.onfinish=()=>{k=()=>o,i?.(o,1-o),s()}},{abort:()=>{l&&(l.cancel(),l.effect=null,l.onfinish=P)},deactivate:()=>{s=P},reset:()=>{o===0&&i?.(1,0)},t:()=>k()}}var re=q('');function oe(e){var t=re();y(e,t)}var ne=q('');function se(e){var t=ne();y(e,t)}var ie=q('');function le(e){var t=ie();y(e,t)}var ce=q('');function de(e){var t=ce();y(e,t)}var ue=q('');function ve(e){var t=ue();y(e,t)}const fe=(e,t=location.href)=>{try{return!!e&&new URL(e).origin!==new URL(t).origin}catch{return!1}};function _e(e){const t=new Kt,r=new DOMParser().parseFromString(e,"text/html");return bt(r.body,"A",o=>{o instanceof HTMLElement&&"target"in o&&fe(o.getAttribute("href"),location.href)&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}),t.sanitize(r).body.innerHTML}function bt(e,t,r){e&&(e.nodeName===t||typeof t=="function")&&r(e);const o=e?.childNodes||[];for(let s=0;se;function xt(e){const t=e-1;return t*t*t+1}function mt(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function wt(e,{delay:t=0,duration:r=400,easing:o=he}={}){const s=+getComputedStyle(e).opacity;return{delay:t,duration:r,easing:o,css:n=>`opacity: ${n*s}`}}function Ae(e,{delay:t=0,duration:r=400,easing:o=xt,x:s=0,y:n=0,opacity:v=0}={}){const f=getComputedStyle(e),x=+f.opacity,d=f.transform==="none"?"":f.transform,i=x*(1-v),[b,g]=mt(s),[h,k]=mt(n);return{delay:t,duration:r,easing:o,css:(l,p)=>` - transform: ${d} translate(${(1-l)*b}${g}, ${(1-l)*h}${k}); - opacity: ${x-i*p}`}}var lt=!1;function pe(e,{delay:t=0,duration:r=400,easing:o=xt,axis:s="y"}={}){const n=getComputedStyle(e);Xt&&!lt&&/(contents|inline|table)/.test(n.display)&&(lt=!0,Promise.resolve().then(()=>lt=!1),qt(n.display));const v=+n.opacity,f=s==="y"?"height":"width",x=parseFloat(n[f]),d=s==="y"?["top","bottom"]:["left","right"],i=d.map(c=>`${c[0].toUpperCase()}${c.slice(1)}`),b=parseFloat(n[`padding${i[0]}`]),g=parseFloat(n[`padding${i[1]}`]),h=parseFloat(n[`margin${i[0]}`]),k=parseFloat(n[`margin${i[1]}`]),l=parseFloat(n[`border${i[0]}Width`]),p=parseFloat(n[`border${i[1]}Width`]);return{delay:t,duration:r,easing:o,css:c=>`overflow: hidden;opacity: ${Math.min(c*20,1)*v};${f}: ${c*x}px;padding-${d[0]}: ${c*b}px;padding-${d[1]}: ${c*g}px;margin-${d[0]}: ${c*h}px;margin-${d[1]}: ${c*k}px;border-${d[0]}-width: ${c*l}px;border-${d[1]}-width: ${c*p}px;min-${f}: 0`}}var ge=W(' '),me=W('
                '),we=W('
                ',1),ye=W('
                '),ke=W("
                "),be=W('
                ');function Ee(e,t){Yt(t,!0);let r=_t(t,"messages",19,()=>[]),o=_t(t,"expanded",3,!0),s=J(0),n=J(0),v=J(0),f=J(!1),x;const d={error:"An error occurred.",warning:"Warning.",success:"Success.",info:"Info."};let i=X(()=>r().length),b=X(()=>r()[0]),g=X(()=>t.type.charAt(0).toUpperCase()+t.type.slice(1)),h=X(()=>u(b)?.duration!==null),k=X(()=>u(h)?`${u(b).duration}s`:"0s");function l(){t.ontoggle?.()}function p(){r().forEach(a=>{t.onclose?.(a.id)})}function c(a){U(s,a.touches[0].clientX,!0),U(n,a.touches[0].clientY,!0),U(f,!0)}function m(a){if(!u(f))return;const _=a.touches[0].clientX,C=a.touches[0].clientY,j=_-u(s),D=C-u(n);Math.abs(j)>Math.abs(D)&&Math.abs(j)>10&&(a.preventDefault(),U(v,j))}function $(){u(f)&&(Math.abs(u(v))>100?p():U(v,0),U(f,!1))}Zt(()=>{u(h)&&r().length===1&&setTimeout(p,u(b).duration*1e3)});var w=be();w.__touchstart=c,w.__touchmove=m,w.__touchend=$;var E=F(w);E.__click=l,E.__keydown=a=>{(a.key==="Enter"||a.key===" ")&&l()};var N=F(E),V=F(N);{var Y=a=>{ve(a)},R=a=>{var _=st(),C=K(_);{var j=T=>{le(T)},D=T=>{var I=st(),H=K(I);{var at=S=>{de(S)},rt=S=>{var B=st(),ot=K(B);{var Nt=nt=>{se(nt)};z(ot,nt=>{t.type==="error"&&nt(Nt)},!0)}y(S,B)};z(H,S=>{t.type==="success"?S(at):S(rt,!1)},!0)}y(T,I)};z(C,T=>{t.type==="info"?T(j):T(D,!1)},!0)}y(a,_)};z(V,a=>{t.type==="warning"?a(Y):a(R,!1)})}M(N);var tt=O(N,2),Z=F(tt),dt=F(Z),Mt=O(dt);{var Ct=a=>{var _=ge(),C=F(_);M(_),G(()=>pt(C,`(${u(i)??""})`)),y(a,_)};z(Mt,a=>{u(i)>1&&a(Ct)})}M(Z);var et=O(Z,2);let ut;var Tt=F(et);oe(Tt),M(et),M(tt);var vt=O(tt,2);vt.__click=a=>{a.stopPropagation(),p()},M(E);var ft=O(E,2);{var Ft=a=>{var _=ye();zt(_,23,r,C=>C.id,(C,j,D)=>{var T=we(),I=K(T),H=F(I),at=F(H);Jt(at,()=>_e(u(j).message||d[t.type])),M(H),M(I);var rt=O(I,2);{var S=B=>{var ot=me();y(B,ot)};z(rt,B=>{u(D){L(I,1,`toast-message-item ${t.type??""}`,"svelte-9uywol"),L(H,1,`toast-message-text ${t.type??""}`,"svelte-9uywol")}),y(C,T)}),M(_),it(3,_,()=>pe,()=>({duration:200})),y(a,_)};z(ft,a=>{o()&&a(Ft)})}var At=O(ft,2);{var Et=a=>{var _=ke();G(()=>{L(_,1,`timer ${t.type??""}`,"svelte-9uywol"),ht(_,`animation-duration: ${u(k)??""}`)}),y(a,_)};z(At,a=>{u(h)&&a(Et)})}M(w),St(w,a=>x=a,()=>x),G(a=>{L(w,1,`toast-body ${t.type??""}`,"svelte-9uywol"),ht(w,`transform: translateX(${u(v)??""}px); opacity: ${a??""};`),L(N,1,`toast-icon ${t.type??""}`,"svelte-9uywol"),L(Z,1,`toast-title ${t.type??""}`,"svelte-9uywol"),pt(dt,`${u(g)??""} `),ut=L(et,1,"chevron svelte-9uywol",null,ut,{expanded:o(),visible:u(i)>0}),L(vt,1,`toast-close ${t.type??""}`,"svelte-9uywol")},[()=>1-Math.abs(u(v))/300]),it(1,w,()=>wt,()=>({duration:200,delay:100})),it(2,w,()=>wt,()=>({duration:200})),y(e,w),Gt()}Vt(["touchstart","touchmove","touchend","click","keydown"]);export{Ee as T,Ae as a,wt as f,te as l,A as r,pe as s,it as t}; diff --git a/assets/Textbox-BhB0hOv8.js b/assets/Textbox-BhB0hOv8.js deleted file mode 100644 index 103cd8c0bf81c3f7a99f0997d26b55e06ecca3e3..0000000000000000000000000000000000000000 --- a/assets/Textbox-BhB0hOv8.js +++ /dev/null @@ -1 +0,0 @@ -import{p as u,i as k,b as C,d as V,a as o,f as kt,v as ut}from"./i18n-CPHyzK9b.js";import{M as Qt,ac as F,$ as H,ag as Ut,Z as _,N as D,t as w,a as m,O as Wt,aa as L,G as P,S as Y,a2 as dt,R as T,ah as Xt,Q as M,X as $,a3 as tt,a5 as Zt,T as O,ai as Jt,aj as et,u as Vt,U as h,a4 as wt}from"./index-DydPgVMC.js";import{a as $t}from"./actions-4RaHFoGI.js";import{b as at}from"./input-BtIxlP_B.js";import{I as te}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as ee}from"./BlockTitle-DNiCHWOR.js";import{C as ae}from"./Check-2f8HlfSn.js";import{C as le}from"./Copy-B3jzejpA.js";import{S as oe}from"./Send-oZH_TPNw.js";import{S as ne}from"./Square-D8rV3Ea-.js";import{I as ie}from"./IconButtonWrapper-PnNNNvqI.js";var re=T('
                '),se=T(" ",1),ce=T(''),ue=T(''),de=T(''),_e=T(''),fe=T(''),ve=T(''),he=T('');function Ce(Ht,l){Qt(l,!0);let x=u(l,"value",15,""),Tt=u(l,"value_is_output",15,!1),y=u(l,"lines",3,1),A=u(l,"placeholder",3,""),zt=u(l,"info",3,void 0),G=u(l,"disabled",3,!1),lt=u(l,"show_label",3,!0),Ct=u(l,"container",3,!0),ot=u(l,"max_lines",3,void 0),K=u(l,"type",3,"text"),N=u(l,"buttons",3,null),It=u(l,"oncustombuttonclick",3,null),I=u(l,"submit_btn",3,null),B=u(l,"stop_btn",3,null),_t=u(l,"rtl",3,!1),E=u(l,"autofocus",3,!1),R=u(l,"text_align",3,void 0),ft=u(l,"autoscroll",3,!0),j=u(l,"max_length",3,void 0),n=u(l,"html_attributes",3,null),z=u(l,"validation_error",3,void 0),f,q=L(!1),nt,it=L(!1),vt=L(0),Q=L(!1),p=L(1);const St=!I();F(()=>{ot()===void 0||ot()===null?K()==="text"?H(p,Math.max(y(),20),!0):H(p,1):H(p,Math.max(ot(),y()),!0)}),F(()=>{x(),z(),f&&y()!==_(p)&&_(p)>1&&X({target:f})}),F(()=>{x()===null&&x("")}),Ut(()=>{!_(Q)&&f&&f.offsetHeight+f.scrollTop>f.scrollHeight-100&&H(it,!0)});const Bt=()=>{_(it)&&ft()&&!_(Q)&&f.scrollTo(0,f.scrollHeight)};async function Et(){await P(),l.onchange?.(x())}F(()=>{E()&&f&&f.focus(),_(it)&&ft()&&Bt(),Tt(!1)}),F(()=>{x(),Et()});async function Ft(){if("clipboard"in navigator){try{await navigator.clipboard.writeText(x()),l.oncopy?.({value:x()})}catch(a){console.error("COPYING CLIPBOARD FAILED",a)}Dt()}}function Dt(){H(q,!0),nt&&clearTimeout(nt),nt=setTimeout(()=>{H(q,!1)},1e3)}function U(a){const t=a.target,r=t.value,i=[t.selectionStart,t.selectionEnd];l.onselect?.({value:r.substring(...i),index:i})}async function W(a){a.key==="Enter"&&a.shiftKey&&y()>1?(a.preventDefault(),await P(),l.onsubmit?.()):a.key==="Enter"&&!a.shiftKey&&y()===1&&_(p)>=1&&(a.preventDefault(),await P(),l.onsubmit?.()),await P(),l.oninput?.(x())}function Lt(a){const t=a.target,r=t.scrollTop;r<_(vt)&&H(Q,!0),H(vt,r,!0);const i=t.scrollHeight-t.clientHeight;r>=i&&H(Q,!1)}function Pt(){l.onstop?.()}function Yt(){l.onsubmit?.()}async function X(a){if(await P(),y()===_(p))return;const t=a.target,r=window.getComputedStyle(t),i=parseFloat(r.paddingTop),b=parseFloat(r.paddingBottom),v=parseFloat(r.lineHeight);let e=_(p)===void 0?!1:i+b+v*_(p),s=i+b+y()*v;t.style.height="1px";let g;e&&t.scrollHeight>e?g=e:t.scrollHeightr+i?a.style.overflowY="scroll":a.style.overflowY="hidden"}function Ot(a,t){if(!(y()===_(p)||y()===1&&_(p)===1))return a.addEventListener("input",X),t.trim()&&(a.style.overflowY="scroll",X({target:a})),{destroy:()=>a.removeEventListener("input",X)}}var Z=he();let ht;var bt=M(Z);{var At=a=>{ie(a,{get buttons(){return N()},get on_custom_button_click(){return It()},children:(t,r)=>{var i=tt(),b=D(i);{var v=e=>{{let s=dt(()=>_(q)?ae:le),g=dt(()=>_(q)?"Copied":"Copy");te(e,{get Icon(){return _(s)},onclick:Ft,get label(){return _(g)}})}};k(b,e=>{N().some(s=>typeof s=="string"&&s==="copy")&&e(v)})}m(t,i)},$$slots:{default:!0}})};k(bt,a=>{lt()&&N()&&N().length>0&&a(At)})}var mt=Y(bt,2);{let a=dt(()=>z()?!0:lt());ee(mt,{get show_label(){return _(a)},get info(){return zt()},children:(t,r)=>{Zt();var i=se(),b=D(i),v=Y(b);{var e=s=>{var g=re(),rt=M(g,!0);O(g),w(()=>$(rt,z())),m(s,g)};k(v,s=>{z()&&s(e)})}w(()=>$(b,`${l.label??""} `)),m(t,i)},$$slots:{default:!0}})}var gt=Y(mt,2),xt=M(gt);{var Gt=a=>{var t=tt(),r=D(t);{var i=v=>{var e=ce();ut(e);let s;et(e,E()),V(e,g=>f=g,()=>f),w(()=>{s=C(e,1,"scroll-hide svelte-10de8l0",null,s,{"validation-error":z()}),o(e,"dir",_t()?"rtl":"ltr"),o(e,"placeholder",A()),e.disabled=G(),o(e,"maxlength",j()),kt(e,R()?"text-align: "+R():""),o(e,"autocapitalize",n()?.autocapitalize),o(e,"autocorrect",n()?.autocorrect),o(e,"spellcheck",n()?.spellcheck),o(e,"autocomplete",n()?.autocomplete),o(e,"tabindex",n()?.tabindex),o(e,"enterkeyhint",n()?.enterkeyhint),o(e,"lang",n()?.lang),e.dir=e.dir}),h("keypress",e,W),h("blur",e,()=>l.onblur?.()),h("select",e,U),h("focus",e,()=>l.onfocus?.()),at(e,x),m(v,e)},b=v=>{var e=tt(),s=D(e);{var g=S=>{var c=ue();ut(c);let J;et(c,E()),V(c,st=>f=st,()=>f),w(()=>{J=C(c,1,"scroll-hide svelte-10de8l0",null,J,{"validation-error":z()}),o(c,"placeholder",A()),c.disabled=G(),o(c,"maxlength",j()),o(c,"autocapitalize",n()?.autocapitalize),o(c,"autocorrect",n()?.autocorrect),o(c,"spellcheck",n()?.spellcheck),o(c,"tabindex",n()?.tabindex),o(c,"enterkeyhint",n()?.enterkeyhint),o(c,"lang",n()?.lang)}),h("keypress",c,W),h("blur",c,()=>l.onblur?.()),h("select",c,U),h("focus",c,()=>l.onfocus?.()),at(c,x),m(S,c)},rt=S=>{var c=tt(),J=D(c);{var st=ct=>{var d=de();ut(d);let yt;et(d,E()),V(d,qt=>f=qt,()=>f),w(()=>{yt=C(d,1,"scroll-hide svelte-10de8l0",null,yt,{"validation-error":z()}),o(d,"placeholder",A()),d.disabled=G(),o(d,"maxlength",j()),o(d,"autocapitalize",n()?.autocapitalize),o(d,"autocorrect",n()?.autocorrect),o(d,"spellcheck",n()?.spellcheck),o(d,"tabindex",n()?.tabindex),o(d,"enterkeyhint",n()?.enterkeyhint),o(d,"lang",n()?.lang)}),h("keypress",d,W),h("blur",d,()=>l.onblur?.()),h("select",d,U),h("focus",d,()=>l.onfocus?.()),at(d,x),m(ct,d)};k(J,ct=>{K()==="email"&&ct(st)},!0)}m(S,c)};k(s,S=>{K()==="password"?S(g):S(rt,!1)},!0)}m(v,e)};k(r,v=>{K()==="text"?v(i):v(b,!1)})}m(a,t)},Kt=a=>{var t=_e();Jt(t),et(t,E());let r;$t(t,(i,b)=>Ot?.(i,b),x),Vt(()=>at(t,x)),V(t,i=>f=i,()=>f),w(()=>{o(t,"dir",_t()?"rtl":"ltr"),o(t,"placeholder",A()),o(t,"rows",y()),t.disabled=G(),o(t,"maxlength",j()),kt(t,R()?"text-align: "+R():""),o(t,"autocapitalize",n()?.autocapitalize),o(t,"autocorrect",n()?.autocorrect),o(t,"spellcheck",n()?.spellcheck),o(t,"autocomplete",n()?.autocomplete),o(t,"tabindex",n()?.tabindex),o(t,"enterkeyhint",n()?.enterkeyhint),o(t,"lang",n()?.lang),r=C(t,1,"svelte-10de8l0",null,r,{"no-label":!lt()&&(I()||B()),"validation-error":z()}),t.dir=t.dir}),h("keypress",t,W),h("blur",t,()=>l.onblur?.()),h("select",t,U),h("focus",t,()=>l.onfocus?.()),h("scroll",t,Lt),m(a,t)};k(xt,a=>{y()===1&&_(p)===1?a(Gt):a(Kt,!1)})}var pt=Y(xt,2);{var Nt=a=>{var t=fe();let r;t.__click=Yt;var i=M(t);{var b=e=>{oe(e)},v=e=>{var s=wt();w(()=>$(s,I())),m(e,s)};k(i,e=>{I()===!0?e(b):e(v,!1)})}O(t),w(()=>r=C(t,1,"submit-button svelte-10de8l0",null,r,{"padded-button":I()!==!0})),m(a,t)};k(pt,a=>{I()&&a(Nt)})}var Rt=Y(pt,2);{var jt=a=>{var t=ve();let r;t.__click=Pt;var i=M(t);{var b=e=>{ne(e,{fill:"none",stroke_width:2.5})},v=e=>{var s=wt();w(()=>$(s,B())),m(e,s)};k(i,e=>{B()===!0?e(b):e(v,!1)})}O(t),w(()=>r=C(t,1,"stop-button svelte-10de8l0",null,r,{"padded-button":B()!==!0})),m(a,t)};k(Rt,a=>{B()&&a(jt)})}O(gt),O(Z),w(()=>ht=C(Z,1,"svelte-10de8l0",null,ht,{container:Ct(),show_textbox_border:St})),m(Ht,Z),Wt()}Xt(["click"]);export{Ce as T}; diff --git a/assets/Trash-CJrspSVZ.js b/assets/Trash-CJrspSVZ.js deleted file mode 100644 index b26bff50cd76ab3cb77a235fdb89e8b8244efe30..0000000000000000000000000000000000000000 --- a/assets/Trash-CJrspSVZ.js +++ /dev/null @@ -1,3 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as r,f as a}from"./index-DydPgVMC.js";var h=a(``);function c(t){var e=h();r(t,e)}export{c as T}; diff --git a/assets/Undo-B9SlrYtT.js b/assets/Undo-B9SlrYtT.js deleted file mode 100644 index 55ffbbcdc90e13eb9ce994e8f8353a7f8e0607ff..0000000000000000000000000000000000000000 --- a/assets/Undo-B9SlrYtT.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as t,f as e}from"./index-DydPgVMC.js";var a=e('');function i(o){var r=a();t(o,r)}export{i as U}; diff --git a/assets/Upload-Bq9KuxCu.js b/assets/Upload-Bq9KuxCu.js deleted file mode 100644 index 68bcd04c822bfa0d767287993cef2067b62fc9a5..0000000000000000000000000000000000000000 --- a/assets/Upload-Bq9KuxCu.js +++ /dev/null @@ -1,2 +0,0 @@ -import{i as I,b as ee,J as ke,p as c,a as Z,f as ie}from"./i18n-CPHyzK9b.js";import{M as oe,aa as q,ab as Ee,a7 as Le,Z as g,$ as F,ae as xe,ac as de,Q as E,T as L,S as se,t as B,X as $,a as x,O as fe,a2 as Ae,R as H,a3 as J,N,as as Pe,G as We,ah as Te}from"./index-DydPgVMC.js";import{s as le}from"./snippet-BtHMuX3s.js";import{a as Ce}from"./actions-4RaHFoGI.js";var Fe=H('
                '),ze=H('
                ');function De(a,e){oe(e,!0);let s,v=q(!1),l=q(void 0),u=q(Ee(e.files.map(d=>({...d,progress:0})))),m=Ae(()=>g(l)||g(u)[0]);function W(d,o){F(u,g(u).map(h=>(h.orig_name===d&&(h.progress+=o),h)),!0)}function y(d){return d.progress*100/(d.size||0)||0}Le(async()=>{if(s=await e.stream_handler(new URL(`${e.root}/gradio_api/upload_progress?upload_id=${e.upload_id}`)),s==null)throw new Error("Event source is not defined");s.onmessage=async function(d){const o=JSON.parse(d.data);g(v)||F(v,!0),o.msg==="done"?(s?.close(),e.ondone?.()):(F(l,o,!0),W(o.orig_name,o.chunk_size))}}),xe(()=>{(s!=null||s!=null)&&s.close()});function b(d){let o=0;return d.forEach(h=>{o+=y(h)}),document.documentElement.style.setProperty("--upload-progress-width",(o/d.length).toFixed(2)+"%"),o/d.length}de(()=>{b(g(u))});var p=ze();let n;var w=E(p),z=E(w);L(w);var K=se(w,2);{var V=d=>{var o=Fe(),h=E(o),M=E(h),S=E(M),D=E(S,!0);L(S),L(M),L(h);var O=se(h,2),A=E(O,!0);L(O),L(o),B((R,te)=>{ke(S,R),$(D,te),$(A,g(m).orig_name)},[()=>y(g(m)),()=>y(g(m))]),x(d,o)};I(K,d=>{g(m)&&d(V)})}L(p),B(()=>{n=ee(p,1,"wrap svelte-6s1kiy",null,n,{progress:g(v)}),$(z,`Uploading ${g(u).length??""} - ${g(u).length>1?"files":"file"}...`)}),x(a,p),fe()}function Oe(a,e,s){if(!a||a==="*"||a==="file/*"||Array.isArray(a)&&a.some(l=>l==="*"||l==="file/*"))return!0;let v;if(typeof a=="string")v=a.split(",").map(l=>l.trim());else if(Array.isArray(a))v=a;else return!1;return v.includes(e)||v.some(l=>{const[u]=l.split("/").map(m=>m.trim());return l.endsWith("/*")&&s.startsWith(u+"/")})}function Ue(){let a,e;return{drag(s,v={}){e=v;function l(){a=document.createElement("input"),a.type="file",a.style.display="none",a.setAttribute("aria-label","File upload"),a.setAttribute("data-testid","file-upload");const n=Array.isArray(e.accepted_types)?e.accepted_types.join(","):e.accepted_types||void 0;n&&(a.accept=n),a.multiple=e.mode==="multiple"||!1,e.mode==="directory"&&(a.webkitdirectory=!0,a.setAttribute("directory",""),a.setAttribute("mozdirectory","")),s.appendChild(a)}l();function u(n){n.preventDefault(),n.stopPropagation()}function m(n){n.preventDefault(),n.stopPropagation(),e.on_drag_change?.(!0)}function W(n){n.preventDefault(),n.stopPropagation(),e.on_drag_change?.(!1)}function y(n){if(n.preventDefault(),n.stopPropagation(),e.on_drag_change?.(!1),!n.dataTransfer?.files)return;const w=Array.from(n.dataTransfer.files);w.length>0&&e.on_files?.(w)}function b(){e.disable_click||(a.value="",a.click())}function p(){if(a.files){const n=Array.from(a.files);n.length>0&&e.on_files?.(n)}}return s.addEventListener("drag",u),s.addEventListener("dragstart",u),s.addEventListener("dragend",u),s.addEventListener("dragover",u),s.addEventListener("dragenter",m),s.addEventListener("dragleave",W),s.addEventListener("drop",y),s.addEventListener("click",b),a.addEventListener("change",p),{update(n){e=n,a.remove(),l(),a.addEventListener("change",p)},destroy(){s.removeEventListener("drag",u),s.removeEventListener("dragstart",u),s.removeEventListener("dragend",u),s.removeEventListener("dragover",u),s.removeEventListener("dragenter",m),s.removeEventListener("dragleave",W),s.removeEventListener("drop",y),s.removeEventListener("click",b),a.removeEventListener("change",p),a.remove()}}},open_file_upload(){a&&(a.value="",a.click())}}}var Ie=H(""),Me=H('');function Re(a,e){oe(e,!0);const{drag:s,open_file_upload:v}=Ue();let l=c(e,"filetype",3,null),u=c(e,"dragging",15,!1),m=c(e,"boundedheight",3,!0),W=c(e,"center",3,!0),y=c(e,"flex",3,!0),b=c(e,"file_count",3,"single"),p=c(e,"disable_click",3,!1),n=c(e,"hidden",3,!1),w=c(e,"format",3,"file"),z=c(e,"uploading",15,!1),K=c(e,"show_progress",3,!0),V=c(e,"max_file_size",3,null),d=c(e,"icon_upload",3,!1),o=c(e,"height",3,void 0),h=c(e,"aria_label",3,void 0),M=c(e,"upload_promise",15);function S(){v()}let D="",O,A=q(null),R=null,G=(()=>{if(typeof navigator<"u"){const t=navigator.userAgent.toLowerCase();return t.indexOf("iphone")>-1||t.indexOf("ipad")>-1}return!1})();const ue=["image","video","audio","text","file"],Y=t=>G&&t.startsWith(".")?(R=!0,t):G&&t.includes("file/*")?"*":t.startsWith(".")||t.endsWith("/*")?t:ue.includes(t)?t+"/*":"."+t;de(()=>{if(l()==null)F(A,null);else if(typeof l()=="string")F(A,Y(l()),!0);else if(G&&l().includes("file/*"))F(A,"*");else{const t=l().map(Y);F(A,t.join(", "),!0)}});function ae(){navigator.clipboard.read().then(async t=>{for(let i=0;ir.startsWith("image/"));if(f){t[i].getType(f).then(async r=>{const T=new File([r],`clipboard.${f.replace("image/","")}`);await Q([T])});break}}})}function ce(){v()}async function _e(t,i){return i?D=i:D=Math.random().toString(36).substring(2,15),await We(),z(!0),M(new Promise(async f=>{try{const r=await e.upload(t,e.root,D,V()??1/0)||[];b()==="single"?r[0]!==void 0&&e.onload?.(r[0]):e.onload?.(r),f(r),z(!1)}catch(r){e.onerror?.(r.message),z(!1),f([])}})),M()}async function Q(t,i){if(!t.length)return;let f=t.map(r=>new File([r],r instanceof File?r.name:"file",{type:r.type}));return G&&R&&(f=f.filter(r=>re(r)?!0:(e.onerror?.(`Invalid file type: ${r.name}. Only ${l()} allowed.`),!1)),f.length===0)?[]:(O=await Pe(f),await _e(O,i))}function re(t){return l()?(Array.isArray(l())?l():[l()]).some(f=>{const r=Y(f);if(r.startsWith("."))return t.name.toLowerCase().endsWith(r.toLowerCase());if(r==="*")return!0;if(r.endsWith("/*")){const[T]=r.split("/");return t.type.startsWith(T+"/")}return t.type===r}):!0}async function ge(t){const i=t.filter(f=>{const r="."+f.name.toLowerCase().split(".").pop();return r&&Oe(g(A),r,f.type)||(r&&Array.isArray(l())?l().includes(r):r===l())?!0:(e.onerror?.(`Invalid file type only ${l()} allowed.`),!1)});if(w()!="blob")await Q(i);else{if(b()==="single"){e.onload?.(i[0]);return}e.onload?.(i)}}async function ve(t){if(u(!1),!t.dataTransfer?.files)return;const i=Array.from(t.dataTransfer.files).filter(re);if(w()!="blob")await Q(i);else{if(b()==="single"){e.onload?.(i[0]);return}e.onload?.(i)}}var me={open_upload:S,paste_clipboard:ae,open_file_upload:ce,load_files:Q,load_files_from_drop:ve},ne=J(),he=N(ne);{var pe=t=>{var i=Ie();i.__click=ae;let f,r;var T=E(i);{var P=_=>{var C=J(),U=N(C);le(U,()=>e.children),x(_,C)};I(T,_=>{e.children&&_(P)})}L(i),B(()=>{Z(i,"tabindex",n()?-1:0),Z(i,"aria-label",h()||"Paste from clipboard"),f=ee(i,1,"svelte-1v0ekon",null,f,{hidden:n(),center:W(),boundedheight:m(),flex:y(),"icon-mode":d()}),r=ie(i,"",r,{height:d()?"":o()?typeof o()=="number"?o()+"px":o():"100%"})}),x(t,i)},ye=t=>{var i=J(),f=N(i);{var r=P=>{var _=J(),C=N(_);{var U=j=>{De(j,{get root(){return e.root},get upload_id(){return D},get files(){return O},get stream_handler(){return e.stream_handler}})};I(C,j=>{n()||j(U)})}x(P,_)},T=P=>{var _=Me();let C,U;var j=E(_);{var be=k=>{var X=J(),we=N(X);le(we,()=>e.children),x(k,X)};I(j,k=>{e.children&&k(be)})}L(_),Ce(_,(k,X)=>s?.(k,X),()=>({on_drag_change:k=>u(k),on_files:k=>ge(k),accepted_types:g(A),mode:b(),disable_click:p()})),B(()=>{Z(_,"tabindex",n()?-1:0),Z(_,"aria-label",h()||"Click to upload or drop files"),C=ee(_,1,"svelte-1v0ekon",null,C,{hidden:n(),center:W(),boundedheight:m(),flex:y(),disable_click:p(),"icon-mode":d()}),U=ie(_,"",U,{height:d()?"":o()?typeof o()=="number"?o()+"px":o():"100%"})}),x(P,_)};I(f,P=>{z()&&K()?P(r):P(T,!1)},!0)}x(t,i)};I(he,t=>{l()==="clipboard"?t(pe):t(ye,!1)})}return x(a,ne),fe(me)}Te(["click"]);export{Re as U,De as a,Ue as c,Oe as i}; diff --git a/assets/UploadText-CYQRFBCv.js b/assets/UploadText-CYQRFBCv.js deleted file mode 100644 index 2e992c02046ebe14fcc47cfbb1534dc3a7e5e48c..0000000000000000000000000000000000000000 --- a/assets/UploadText-CYQRFBCv.js +++ /dev/null @@ -1 +0,0 @@ -import{p,e as L,i as b,b as V}from"./i18n-CPHyzK9b.js";import{M as W,Y as $,Z as d,x as c,_ as ee,S as N,t as k,a as f,O as ae,a0 as H,P as m,Q as z,N as j,v as A,X as U,R as u,ar as te,$ as M,T as w}from"./index-DydPgVMC.js";import{a as re,U as se}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";const oe=/^(#\s*)(.+)$/m;function O(P){const a=P.trim(),s=a.match(oe);if(!s)return[!1,a||!1];const[l,,i]=s,t=i.trim();if(a===l)return[t,!1];const v=s.index!==void 0?s.index+l.length:0,g=a.substring(v).trim()||!1;return[t,g]}var le=u('

                '),ne=u('

                '),de=u(" ",1),ie=u(' ',1),_e=u(" ",1),ve=u('
                ');function me(P,a){W(a,!1);const s=H(),l=H();let i=p(a,"type",12,"file"),t=p(a,"i18n",12),v=p(a,"message",12,void 0),E=p(a,"mode",12,"full"),g=p(a,"hovered",12,!1),h=p(a,"placeholder",12,void 0);const D={image:"upload_text.drop_image",video:"upload_text.drop_video",audio:"upload_text.drop_audio",file:"upload_text.drop_file",csv:"upload_text.drop_csv",gallery:"upload_text.drop_gallery",clipboard:"upload_text.paste_clipboard"};$(()=>(d(s),d(l),c(h()),O),()=>{(e=>{var n=te(e,2);M(s,n[0]),M(l,n[1])})(h()?O(h()):[!1,!1])}),ee();var Q={get type(){return i()},set type(e){i(e),m()},get i18n(){return t()},set i18n(e){t(e),m()},get message(){return v()},set message(e){v(e),m()},get mode(){return E()},set mode(e){E(e),m()},get hovered(){return g()},set hovered(e){g(e),m()},get placeholder(){return h()},set placeholder(e){h(e),m()}};L();var R=ve(),I=z(R);let G;var X=z(I);{var Y=e=>{re(e)},Z=e=>{se(e)};b(X,e=>{i()==="clipboard"?e(Y):e(Z,!1)})}w(I);var q=N(I,2);{var B=e=>{var n=de(),x=j(n);{var S=o=>{var r=le(),y=z(r,!0);w(r),k(()=>U(y,d(s))),f(o,r)};b(x,o=>{d(s)&&o(S)})}var T=N(x,2);{var _=o=>{var r=ne(),y=z(r,!0);w(r),k(()=>U(y,d(l))),f(o,r)};b(T,o=>{d(l)&&o(_)})}f(e,n)},C=e=>{var n=_e(),x=j(n),S=N(x);{var T=_=>{var o=ie(),r=j(o),y=z(r);w(r);var F=N(r);k((J,K)=>{U(y,`- ${J??""} -`),U(F,` ${K??""}`)},[()=>(c(t()),A(()=>t()("common.or"))),()=>(c(v()),c(t()),A(()=>v()||t()("upload_text.click_to_upload")))]),f(_,o)};b(S,_=>{E()!=="short"&&_(T)})}k(_=>U(x,`${_??""} `),[()=>(c(t()),c(i()),A(()=>t()(D[i()]||D.file)))]),f(e,n)};b(q,e=>{d(s)||d(l)?e(B):e(C,!1)})}return w(R),k(()=>G=V(I,1,"icon-wrap svelte-14zk9l1",null,G,{hovered:g()})),f(P,R),ae(Q)}export{me as U}; diff --git a/assets/Video-BOdhnjQz.js b/assets/Video-BOdhnjQz.js deleted file mode 100644 index ae7f2fe79bbee40a3f40473022b8de2825a65220..0000000000000000000000000000000000000000 --- a/assets/Video-BOdhnjQz.js +++ /dev/null @@ -1,40 +0,0 @@ -import{p as Oe,i as za,d as Xa,b as Qa,a as bs}from"./i18n-CPHyzK9b.js";import{w as Za,I as Ja,a8 as eo,u as ss,M as to,ac as ji,$ as qi,N as zi,t as so,U as We,a as Xi,O as io,aa as ro,Z as no,S as ao,R as oo,ah as lo,Q as co,a3 as ho,T as uo}from"./index-DydPgVMC.js";import{s as fo}from"./snippet-BtHMuX3s.js";import{a as go}from"./actions-4RaHFoGI.js";import{b as mo}from"./universal-C9tCO36V.js";function po(a,e,t=e){var s,i,r=()=>{cancelAnimationFrame(s),a.paused||(s=requestAnimationFrame(r));var n=a.currentTime;i!==n&&t(i=n)};s=requestAnimationFrame(r),a.addEventListener("timeupdate",r),Za(()=>{var n=Number(e());i!==n&&!isNaN(n)&&(a.currentTime=i=n)}),Ja(()=>{cancelAnimationFrame(s),a.removeEventListener("timeupdate",r)})}function Eo(a,e,t=e){var s=e(),i=()=>{s!==a.paused&&t(s=a.paused)};eo(a,["play","pause","canplay"],i,s==null),ss(()=>{(s=!!e())!==a.paused&&(s?a.pause():a.play().catch(()=>{t(s=!0)}))})}const yo=new Error("failed to get response body reader"),To=new Error("failed to complete download"),vo="Content-Length",So=async(a,e)=>{const t=await fetch(a);let s;try{const i=parseInt(t.headers.get(vo)||"-1"),r=t.body?.getReader();if(!r)throw yo;const n=[];let o=0;for(;;){const{done:h,value:d}=await r.read(),u=d?d.length:0;if(h){if(i!=-1&&i!==o)throw To;e&&e({url:a,total:i,received:o,delta:u,done:h});break}n.push(d),o+=u,e&&e({url:a,total:i,received:o,delta:u,done:h})}const c=new Uint8Array(o);let l=0;for(const h of n)c.set(h,l),l+=h.length;s=c.buffer}catch(i){console.log("failed to send download progress event: ",i),s=await t.arrayBuffer()}return s},Zs=async(a,e,t=!1,s)=>{const i=t?await So(a,s):await(await fetch(a)).arrayBuffer(),r=new Blob([i],{type:e});return URL.createObjectURL(r)};var te;(function(a){a.LOAD="LOAD",a.EXEC="EXEC",a.FFPROBE="FFPROBE",a.WRITE_FILE="WRITE_FILE",a.READ_FILE="READ_FILE",a.DELETE_FILE="DELETE_FILE",a.RENAME="RENAME",a.CREATE_DIR="CREATE_DIR",a.LIST_DIR="LIST_DIR",a.DELETE_DIR="DELETE_DIR",a.ERROR="ERROR",a.DOWNLOAD="DOWNLOAD",a.PROGRESS="PROGRESS",a.LOG="LOG",a.MOUNT="MOUNT",a.UNMOUNT="UNMOUNT"})(te||(te={}));const xo=(()=>{let a=0;return()=>a++})(),Ao=new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"),Io=new Error("called FFmpeg.terminate()");class Lo{#t=null;#i={};#s={};#r=[];#n=[];loaded=!1;#a=()=>{this.#t&&(this.#t.onmessage=({data:{id:e,type:t,data:s}})=>{switch(t){case te.LOAD:this.loaded=!0,this.#i[e](s);break;case te.MOUNT:case te.UNMOUNT:case te.EXEC:case te.FFPROBE:case te.WRITE_FILE:case te.READ_FILE:case te.DELETE_FILE:case te.RENAME:case te.CREATE_DIR:case te.LIST_DIR:case te.DELETE_DIR:this.#i[e](s);break;case te.LOG:this.#r.forEach(i=>i(s));break;case te.PROGRESS:this.#n.forEach(i=>i(s));break;case te.ERROR:this.#s[e](s);break}delete this.#i[e],delete this.#s[e]})};#e=({type:e,data:t},s=[],i)=>this.#t?new Promise((r,n)=>{const o=xo();this.#t&&this.#t.postMessage({id:o,type:e,data:t},s),this.#i[o]=r,this.#s[o]=n,i?.addEventListener("abort",()=>{n(new DOMException(`Message # ${o} was aborted`,"AbortError"))},{once:!0})}):Promise.reject(Ao);on(e,t){e==="log"?this.#r.push(t):e==="progress"&&this.#n.push(t)}off(e,t){e==="log"?this.#r=this.#r.filter(s=>s!==t):e==="progress"&&(this.#n=this.#n.filter(s=>s!==t))}load=({classWorkerURL:e,...t}={},{signal:s}={})=>(this.#t||(this.#t=e?new Worker(new URL(e,import.meta.url),{type:"module"}):new Worker(new URL(""+new URL("worker-BAOIWoxA.js",import.meta.url).href,import.meta.url),{type:"module"}),this.#a()),this.#e({type:te.LOAD,data:t},void 0,s));exec=(e,t=-1,{signal:s}={})=>this.#e({type:te.EXEC,data:{args:e,timeout:t}},void 0,s);ffprobe=(e,t=-1,{signal:s}={})=>this.#e({type:te.FFPROBE,data:{args:e,timeout:t}},void 0,s);terminate=()=>{const e=Object.keys(this.#s);for(const t of e)this.#s[t](Io),delete this.#s[t],delete this.#i[t];this.#t&&(this.#t.terminate(),this.#t=null,this.loaded=!1)};writeFile=(e,t,{signal:s}={})=>{const i=[];return t instanceof Uint8Array&&i.push(t.buffer),this.#e({type:te.WRITE_FILE,data:{path:e,data:t}},i,s)};mount=(e,t,s)=>{const i=[];return this.#e({type:te.MOUNT,data:{fsType:e,options:t,mountPoint:s}},i)};unmount=e=>{const t=[];return this.#e({type:te.UNMOUNT,data:{mountPoint:e}},t)};readFile=(e,t="binary",{signal:s}={})=>this.#e({type:te.READ_FILE,data:{path:e,encoding:t}},void 0,s);deleteFile=(e,{signal:t}={})=>this.#e({type:te.DELETE_FILE,data:{path:e}},void 0,t);rename=(e,t,{signal:s}={})=>this.#e({type:te.RENAME,data:{oldPath:e,newPath:t}},void 0,s);createDir=(e,{signal:t}={})=>this.#e({type:te.CREATE_DIR,data:{path:e}},void 0,t);listDir=(e,{signal:t}={})=>this.#e({type:te.LIST_DIR,data:{path:e}},void 0,t);deleteDir=(e,{signal:t}={})=>this.#e({type:te.DELETE_DIR,data:{path:e}},void 0,t)}var Qi;(function(a){a.MEMFS="MEMFS",a.NODEFS="NODEFS",a.NODERAWFS="NODERAWFS",a.IDBFS="IDBFS",a.WORKERFS="WORKERFS",a.PROXYFS="PROXYFS"})(Qi||(Qi={}));const Ro={"3g2":"video/3gpp2","3gp":"video/3gpp","3gpp":"video/3gpp","3mf":"model/3mf",aac:"audio/aac",ac:"application/pkix-attr-cert",adp:"audio/adpcm",adts:"audio/aac",ai:"application/postscript",aml:"application/automationml-aml+xml",amlx:"application/automationml-amlx+zip",amr:"audio/amr",apng:"image/apng",appcache:"text/cache-manifest",appinstaller:"application/appinstaller",appx:"application/appx",appxbundle:"application/appxbundle",asc:"application/pgp-keys",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomdeleted:"application/atomdeleted+xml",atomsvc:"application/atomsvc+xml",au:"audio/basic",avci:"image/avci",avcs:"image/avcs",avif:"image/avif",aw:"application/applixware",bdoc:"application/bdoc",bin:"application/octet-stream",bmp:"image/bmp",bpk:"application/octet-stream",btf:"image/prs.btif",btif:"image/prs.btif",buffer:"application/octet-stream",ccxml:"application/ccxml+xml",cdfx:"application/cdfx+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cer:"application/pkix-cert",cgm:"image/cgm",cjs:"application/node",class:"application/java-vm",coffee:"text/coffeescript",conf:"text/plain",cpl:"application/cpl+xml",cpt:"application/mac-compactpro",crl:"application/pkix-crl",css:"text/css",csv:"text/csv",cu:"application/cu-seeme",cwl:"application/cwl",cww:"application/prs.cww",davmount:"application/davmount+xml",dbk:"application/docbook+xml",deb:"application/octet-stream",def:"text/plain",deploy:"application/octet-stream",dib:"image/bmp","disposition-notification":"message/disposition-notification",dist:"application/octet-stream",distz:"application/octet-stream",dll:"application/octet-stream",dmg:"application/octet-stream",dms:"application/octet-stream",doc:"application/msword",dot:"application/msword",dpx:"image/dpx",drle:"image/dicom-rle",dsc:"text/prs.lines.tag",dssc:"application/dssc+der",dtd:"application/xml-dtd",dump:"application/octet-stream",dwd:"application/atsc-dwd+xml",ear:"application/java-archive",ecma:"application/ecmascript",elc:"application/octet-stream",emf:"image/emf",eml:"message/rfc822",emma:"application/emma+xml",emotionml:"application/emotionml+xml",eps:"application/postscript",epub:"application/epub+zip",exe:"application/octet-stream",exi:"application/exi",exp:"application/express",exr:"image/aces",ez:"application/andrew-inset",fdf:"application/fdf",fdt:"application/fdt+xml",fits:"image/fits",g3:"image/g3fax",gbr:"application/rpki-ghostbusters",geojson:"application/geo+json",gif:"image/gif",glb:"model/gltf-binary",gltf:"model/gltf+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gram:"application/srgs",grxml:"application/srgs+xml",gxf:"application/gxf",gz:"application/gzip",h261:"video/h261",h263:"video/h263",h264:"video/h264",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",held:"application/atsc-held+xml",hjson:"application/hjson",hlp:"application/winhlp",hqx:"application/mac-binhex40",hsj2:"image/hsj2",htm:"text/html",html:"text/html",ics:"text/calendar",ief:"image/ief",ifb:"text/calendar",iges:"model/iges",igs:"model/iges",img:"application/octet-stream",in:"text/plain",ini:"text/plain",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",iso:"application/octet-stream",its:"application/its+xml",jade:"text/jade",jar:"application/java-archive",jhc:"image/jphc",jls:"image/jls",jp2:"image/jp2",jpe:"image/jpeg",jpeg:"image/jpeg",jpf:"image/jpx",jpg:"image/jpeg",jpg2:"image/jp2",jpgm:"image/jpm",jpgv:"video/jpeg",jph:"image/jph",jpm:"image/jpm",jpx:"image/jpx",js:"text/javascript",json:"application/json",json5:"application/json5",jsonld:"application/ld+json",jsonml:"application/jsonml+json",jsx:"text/jsx",jt:"model/jt",jxl:"image/jxl",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",kar:"audio/midi",ktx:"image/ktx",ktx2:"image/ktx2",less:"text/less",lgr:"application/lgr+xml",list:"text/plain",litcoffee:"text/coffeescript",log:"text/plain",lostxml:"application/lost+xml",lrf:"application/octet-stream",m1v:"video/mpeg",m21:"application/mp21",m2a:"audio/mpeg",m2t:"video/mp2t",m2ts:"video/mp2t",m2v:"video/mpeg",m3a:"audio/mpeg",m4a:"audio/mp4",m4p:"application/mp4",m4s:"video/iso.segment",ma:"application/mathematica",mads:"application/mads+xml",maei:"application/mmt-aei+xml",man:"text/troff",manifest:"text/cache-manifest",map:"application/json",mar:"application/octet-stream",markdown:"text/markdown",mathml:"application/mathml+xml",mb:"application/mathematica",mbox:"application/mbox",md:"text/markdown",mdx:"text/mdx",me:"text/troff",mesh:"model/mesh",meta4:"application/metalink4+xml",metalink:"application/metalink+xml",mets:"application/mets+xml",mft:"application/rpki-manifest",mid:"audio/midi",midi:"audio/midi",mime:"message/rfc822",mj2:"video/mj2",mjp2:"video/mj2",mjs:"text/javascript",mml:"text/mathml",mods:"application/mods+xml",mov:"video/quicktime",mp2:"audio/mpeg",mp21:"application/mp21",mp2a:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mp4a:"audio/mp4",mp4s:"application/mp4",mp4v:"video/mp4",mpd:"application/dash+xml",mpe:"video/mpeg",mpeg:"video/mpeg",mpf:"application/media-policy-dataset+xml",mpg:"video/mpeg",mpg4:"video/mp4",mpga:"audio/mpeg",mpp:"application/dash-patch+xml",mrc:"application/marc",mrcx:"application/marcxml+xml",ms:"text/troff",mscml:"application/mediaservercontrol+xml",msh:"model/mesh",msi:"application/octet-stream",msix:"application/msix",msixbundle:"application/msixbundle",msm:"application/octet-stream",msp:"application/octet-stream",mtl:"model/mtl",mts:"video/mp2t",musd:"application/mmt-usd+xml",mxf:"application/mxf",mxmf:"audio/mobile-xmf",mxml:"application/xv+xml",n3:"text/n3",nb:"application/mathematica",nq:"application/n-quads",nt:"application/n-triples",obj:"model/obj",oda:"application/oda",oga:"audio/ogg",ogg:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",omdoc:"application/omdoc+xml",onepkg:"application/onenote",onetmp:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",opf:"application/oebps-package+xml",opus:"audio/ogg",otf:"font/otf",owl:"application/rdf+xml",oxps:"application/oxps",p10:"application/pkcs10",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",pdf:"application/pdf",pfr:"application/font-tdpfr",pgp:"application/pgp-encrypted",pkg:"application/octet-stream",pki:"application/pkixcmp",pkipath:"application/pkix-pkipath",pls:"application/pls+xml",png:"image/png",prc:"model/prc",prf:"application/pics-rules",provx:"application/provenance+xml",ps:"application/postscript",pskcxml:"application/pskc+xml",pti:"image/prs.pti",qt:"video/quicktime",raml:"application/raml+yaml",rapd:"application/route-apd+xml",rdf:"application/rdf+xml",relo:"application/p2p-overlay+xml",rif:"application/reginfo+xml",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rmi:"audio/midi",rnc:"application/relax-ng-compact-syntax",rng:"application/xml",roa:"application/rpki-roa",roff:"text/troff",rq:"application/sparql-query",rs:"application/rls-services+xml",rsat:"application/atsc-rsat+xml",rsd:"application/rsd+xml",rsheet:"application/urc-ressheet+xml",rss:"application/rss+xml",rtf:"text/rtf",rtx:"text/richtext",rusd:"application/route-usd+xml",s3m:"audio/s3m",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",senmlx:"application/senml+xml",sensmlx:"application/sensml+xml",ser:"application/java-serialized-object",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgi:"image/sgi",sgm:"text/sgml",sgml:"text/sgml",shex:"text/shex",shf:"application/shf+xml",shtml:"text/html",sieve:"application/sieve",sig:"application/pgp-signature",sil:"audio/silk",silo:"model/mesh",siv:"application/sieve",slim:"text/slim",slm:"text/slim",sls:"application/route-s-tsid+xml",smi:"application/smil+xml",smil:"application/smil+xml",snd:"audio/basic",so:"application/octet-stream",spdx:"text/spdx",spp:"application/scvp-vp-response",spq:"application/scvp-vp-request",spx:"audio/ogg",sql:"application/sql",sru:"application/sru+xml",srx:"application/sparql-results+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",stk:"application/hyperstudio",stl:"model/stl",stpx:"model/step+xml",stpxz:"model/step-xml+zip",stpz:"model/step+zip",styl:"text/stylus",stylus:"text/stylus",svg:"image/svg+xml",svgz:"image/svg+xml",swidtag:"application/swid+xml",t:"text/troff",t38:"image/t38",td:"application/urc-targetdesc+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",text:"text/plain",tfi:"application/thraud+xml",tfx:"image/tiff-fx",tif:"image/tiff",tiff:"image/tiff",toml:"application/toml",tr:"text/troff",trig:"application/trig",ts:"video/mp2t",tsd:"application/timestamped-data",tsv:"text/tab-separated-values",ttc:"font/collection",ttf:"font/ttf",ttl:"text/turtle",ttml:"application/ttml+xml",txt:"text/plain",u3d:"model/u3d",u8dsn:"message/global-delivery-status",u8hdr:"message/global-headers",u8mdn:"message/global-disposition-notification",u8msg:"message/global",ubj:"application/ubjson",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",vrml:"model/vrml",vtt:"text/vtt",vxml:"application/voicexml+xml",war:"application/java-archive",wasm:"application/wasm",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webmanifest:"application/manifest+json",webp:"image/webp",wgsl:"text/wgsl",wgt:"application/widget",wif:"application/watcherinfo+xml",wmf:"image/wmf",woff:"font/woff",woff2:"font/woff2",wrl:"model/vrml",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml",x3d:"model/x3d+xml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3dz:"model/x3d+xml",xaml:"application/xaml+xml",xav:"application/xcap-att+xml",xca:"application/xcap-caps+xml",xcs:"application/calendar+xml",xdf:"application/xcap-diff+xml",xdssc:"application/dssc+xml",xel:"application/xcap-el+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",xfdf:"application/xfdf",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xhvml:"application/xv+xml",xlf:"application/xliff+xml",xm:"audio/xm",xml:"text/xml",xns:"application/xcap-ns+xml",xop:"application/xop+xml",xpl:"application/xproc+xml",xsd:"application/xml",xsf:"application/prs.xsf+xml",xsl:"application/xml",xslt:"application/xml",xspf:"application/xspf+xml",xvm:"application/xv+xml",xvml:"application/xv+xml",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",yml:"text/yaml",zip:"application/zip"};function bo(a){let e=(""+a).trim().toLowerCase(),t=e.lastIndexOf(".");return Ro[~t?e.substring(++t):e]}const $u=a=>{let e=["B","KB","MB","GB","PB"],t=0;for(;a>1024;)a/=1024,t++;let s=e[t];return a.toFixed(1)+" "+s},Gu=()=>!0;function _o(a,{autoplay:e}){async function t(){e&&await a.play()}return a.addEventListener("loadeddata",t),{destroy(){a.removeEventListener("loadeddata",t)}}}async function Ku(){const a=new Lo,t=`${typeof window<"u"&&window.gradio_config?.root||""}/static/ffmpeg`;return await a.load({coreURL:await Zs(`${t}/ffmpeg-core.js`,"text/javascript"),wasmURL:await Zs(`${t}/ffmpeg-core.wasm`,"application/wasm")}),a}async function Vu(a,e,t,s){const i=s.src,r=bo(s.src)||"video/mp4",n=await Zs(i,r),c=await(await fetch(n)).blob(),l=Do(r)||"mp4",h=`input.${l}`,d=`output.${l}`;try{if(e===0&&t===0)return c;await a.writeFile(h,new Uint8Array(await c.arrayBuffer()));let u=["-i",h,...e!==0?["-ss",e.toString()]:[],...t!==0?["-to",t.toString()]:[],"-c:a","copy",d];await a.exec(u);const f=await a.readFile(d),g=typeof f=="string"?f:new Uint8Array(f);return new Blob([g],{type:`video/${l}`})}catch(u){return console.error("Error initializing FFmpeg:",u),c}}const Do=a=>({"video/mp4":"mp4","video/webm":"webm","video/ogg":"ogv","video/quicktime":"mov","video/x-msvideo":"avi","video/x-matroska":"mkv","video/mpeg":"mpeg","video/3gpp":"3gp","video/3gpp2":"3g2","video/h261":"h261","video/h263":"h263","video/h264":"h264","video/jpeg":"jpgv","video/jpm":"jpm","video/mj2":"mj2","video/mpv":"mpv","video/vnd.ms-playready.media.pyv":"pyv","video/vnd.uvvu.mp4":"uvu","video/vnd.vivo":"viv","video/x-f4v":"f4v","video/x-fli":"fli","video/x-flv":"flv","video/x-m4v":"m4v","video/x-ms-asf":"asf","video/x-ms-wm":"wm","video/x-ms-wmv":"wmv","video/x-ms-wmx":"wmx","video/x-ms-wvx":"wvx","video/x-sgi-movie":"movie","video/x-smv":"smv"})[a]||null,M=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Co=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Po},Po=Number.MAX_SAFE_INTEGER||9007199254740991;let V=(function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a})({}),b=(function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a})({}),m=(function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a})({});var Q={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},B={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class ft{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class ko{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ft(e),this.fast_=new ft(t),this.defaultTTFB_=i,this.ttfb_=new ft(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new ft(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new ft(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new ft(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function wo(a,e,t){return(e=Fo(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function re(){return re=Object.assign?Object.assign.bind():function(a){for(var e=1;e`):Je}function Ji(a,e,t){return e[a]?e[a].bind(e):No(a,t)}const ei=Js();function Bo(a,e,t){const s=Js();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{s[r]=Ji(r,a,t)});try{s.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return Js()}i.forEach(r=>{ei[r]=Ji(r,a)})}else re(ei,s);return s}const ie=ei;function st(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Uo(a){return typeof self<"u"&&a===self.ManagedMediaSource}function pn(a,e){const t=Object.keys(a),s=Object.keys(e),i=t.length,r=s.length;return!i||!r||i===r&&!t.some(n=>s.indexOf(n)===-1)}function _e(a,e=!1){if(typeof TextDecoder<"u"){const l=new TextDecoder("utf-8").decode(a);if(e){const h=l.indexOf("\0");return h!==-1?l.substring(0,h):l}return l.replace(/\0/g,"")}const t=a.length;let s,i,r,n="",o=0;for(;o>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(s);break;case 12:case 13:i=a[o++],n+=String.fromCharCode((s&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],n+=String.fromCharCode((s&15)<<12|(i&63)<<6|(r&63)<<0);break}}return n}function pe(a){let e="";for(let t=0;t1||i===1&&(t=this.levelkeys[s[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!M(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return he(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var s;const i=t[e];i&&!((s=this._decryptdata)!=null&&s.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,s),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class Ko extends yn{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Tn(a,e){const t=Object.getPrototypeOf(a);if(t){const s=Object.getOwnPropertyDescriptor(t,e);return s||Tn(t,e)}}function Vo(a,e){const t=Tn(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const tr=Math.pow(2,32)-1,Ho=[].push,vn={video:1,audio:2,id3:3,text:4};function de(a){return String.fromCharCode.apply(null,a)}function Sn(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function W(a,e){const t=xn(a,e);return t<0?4294967296+t:t}function sr(a,e){let t=W(a,e);return t*=Math.pow(2,32),t+=W(a,e+4),t}function xn(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Yo(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function X(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=X(a.subarray(i+8,o),e.slice(1));c.length&&Ho.apply(t,c)}i=o}return t}function Wo(a){const e=[],t=a[0];let s=8;const i=W(a,s);s+=4;let r=0,n=0;t===0?(r=W(a,s),n=W(a,s+4),s+=8):(r=sr(a,s),n=sr(a,s+8),s+=16),s+=2;let o=a.length+n;const c=Sn(a,s);s+=2;for(let l=0;l>>31===1)return ie.warn("SIDX has hierarchical references (not supported)"),null;const g=W(a,h);h+=4,e.push({referenceSize:u,subsegmentDuration:g,info:{duration:g/i,start:o,end:o+u-1}}),o+=u,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function An(a){const e=[],t=X(a,["moov","trak"]);for(let i=0;i{const r=W(i,4),n=e[r];n&&(n.default={duration:W(i,12),flags:W(i,20)})}),e}function jo(a){const e=a.subarray(8),t=e.subarray(86),s=de(e.subarray(4,8));let i=s,r;const n=s==="enca"||s==="encv";if(n){const l=X(e,[s])[0].subarray(s==="enca"?28:78);X(l,["sinf"]).forEach(d=>{const u=X(d,["schm"])[0];if(u){const f=de(u.subarray(4,8));if(f==="cbcs"||f==="cenc"){const g=X(d,["frma"])[0];g&&(i=de(g))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=X(t,["avcC"])[0];c&&c.length>3&&(i+="."+Kt(c[1])+Kt(c[2])+Kt(c[3]),r=Gt(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=X(e,[s])[0],l=X(c.subarray(28),["esds"])[0];if(l&&l.length>7){let h=4;if(l[h++]!==3)break;h=Cs(l,h),h+=2;const d=l[h++];if(d&128&&(h+=2),d&64&&(h+=l[h++]),l[h++]!==4)break;h=Cs(l,h);const u=l[h++];if(u===64)i+="."+Kt(u);else break;if(h+=12,l[h++]!==5)break;h=Cs(l,h);const f=l[h++];let g=(f&248)>>3;g===31&&(g+=1+((f&7)<<3)+((l[h]&224)>>5)),i+="."+g}break}case"hvc1":case"hev1":{const c=X(t,["hvcC"])[0];if(c&&c.length>12){const l=c[1],h=["","A","B","C"][l>>6],d=l&31,u=W(c,2),f=(l&32)>>5?"H":"L",g=c[12],p=c.subarray(6,12);i+="."+h+d,i+="."+qo(u).toString(16).toUpperCase(),i+="."+f+g;let E="";for(let y=p.length;y--;){const T=p[y];(T||E)&&(E="."+T.toString(16).toUpperCase()+E)}i+=E}r=Gt(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=Gt(i,t)||i;break}case"vp09":{const c=X(t,["vpcC"])[0];if(c&&c.length>6){const l=c[4],h=c[5],d=c[6]>>4&15;i+="."+$e(l)+"."+$e(h)+"."+$e(d)}break}case"av01":{const c=X(t,["av1C"])[0];if(c&&c.length>2){const l=c[1]>>>5,h=c[1]&31,d=c[2]>>>7?"H":"M",u=(c[2]&64)>>6,f=(c[2]&32)>>5,g=l===2&&u?f?12:10:u?10:8,p=(c[2]&16)>>4,E=(c[2]&8)>>3,y=(c[2]&4)>>2,T=c[2]&3;i+="."+l+"."+$e(h)+d+"."+$e(g)+"."+p+"."+E+y+T+"."+$e(1)+"."+$e(1)+"."+$e(1)+"."+0,r=Gt("dav1",t)}break}}return{codec:i,encrypted:n,supplemental:r}}function Gt(a,e){const t=X(e,["dvvC"]),s=t.length?t[0]:X(e,["dvcC"])[0];if(s){const i=s[2]>>1&127,r=s[2]<<5&32|s[3]>>3&31;return a+"."+$e(i)+"."+$e(r)}}function qo(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function Cs(a,e){const t=e+5;for(;a[e++]&128&&e{const r=s.subarray(8,24);r.some(n=>n!==0)||(ie.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${pe(r)} -> ${pe(t)}`),s.set(t,8))})}function Xo(a){const e=[];return In(a,t=>e.push(t.subarray(8,24))),e}function In(a,e){X(a,["moov","trak"]).forEach(s=>{const i=X(s,["mdia","minf","stbl","stsd"])[0];if(!i)return;const r=i.subarray(8);let n=X(r,["enca"]);const o=n.length>0;o||(n=X(r,["encv"])),n.forEach(c=>{const l=o?c.subarray(28):c.subarray(78);X(l,["sinf"]).forEach(d=>{const u=Ln(d);u&&e(u,o)})})})}function Ln(a){const e=X(a,["schm"])[0];if(e){const t=de(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const s=X(a,["schi","tenc"])[0];if(s)return s}}}function Qo(a,e,t){const s={},i=X(a,["moof","traf"]);for(let r=0;rs[r].duration)){let r=1/0,n=0;const o=X(a,["sidx"]);for(let c=0;cd+u.info.duration||0,0);n=Math.max(n,h+l.earliestPresentationTime/l.timescale)}}n&&M(n)&&Object.keys(s).forEach(c=>{s[c].duration||(s[c].duration=n*s[c].timescale-s[c].start)})}return s}function Zo(a){const e={valid:null,remainder:null},t=X(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=a.slice(0,s.byteOffset-8),e.remainder=a.slice(s.byteOffset-8),e}function Pe(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function ir(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return X(s,["moof"]).map(c=>{const l=c.byteOffset-8;X(c,["traf"]).map(d=>{const u=X(d,["tfdt"]).map(f=>{const g=f[0];let p=W(f,4);return g===1&&(p*=Math.pow(2,32),p+=W(f,8)),p/i})[0];return u!==void 0&&(a=u),X(d,["tfhd"]).map(f=>{const g=W(f,4),p=W(f,0)&16777215,E=(p&1)!==0,y=(p&2)!==0,T=(p&8)!==0;let v=0;const S=(p&16)!==0;let x=0;const D=(p&32)!==0;let A=8;g===r&&(E&&(A+=8),y&&(A+=4),T&&(v=W(f,A),A+=4),S&&(x=W(f,A),A+=4),D&&(A+=4),e.type==="video"&&(n=xs(e.codec)),X(d,["trun"]).map(R=>{const _=R[0],I=W(R,0)&16777215,P=(I&1)!==0;let F=0;const U=(I&4)!==0,H=(I&256)!==0;let $=0;const k=(I&512)!==0;let G=0;const N=(I&1024)!==0,K=(I&2048)!==0;let Y=0;const w=W(R,4);let O=8;P&&(F=W(R,O),O+=4),U&&(O+=4);let q=F+l;for(let ee=0;ee>1&63;return t===39||t===40}else return(e&31)===6}function vi(a,e,t,s){const i=Rn(a);let r=0;r+=e;let n=0,o=0,c=0;for(;r=i.length)break;c=i[r++],n+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const l=i.length-r;let h=r;if(ol){ie.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const u=Sn(i,h);if(h+=2,u===49){const f=W(i,h);if(h+=4,f===1195456820){const g=i[h++];if(g===3){const p=i[h++],E=31&p,y=64&p,T=y?2+E*3:0,v=new Uint8Array(T);if(y){v[0]=p;for(let S=1;S16){const d=[];for(let g=0;g<16;g++){const p=i[h++].toString(16);d.push(p.length==1?"0"+p:p),(g===3||g===5||g===7||g===9)&&d.push("-")}const u=o-16,f=new Uint8Array(u);for(let g=0;g>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),tl([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t)}function il(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let s=0;for(;s+32>>24;if(r!==0&&r!==1)return{offset:t,size:e};const n=a.buffer,o=pe(new Uint8Array(n,t+12,16));let c=null,l=null,h=0;if(r===0)h=28;else{const u=a.getUint32(28);if(!u||s<32+u*16)return{offset:t,size:e};c=[];for(let f=0;f/\(Windows.+Firefox\//i.test(navigator.userAgent),It={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Si(a,e){const t=It[e];return!!t&&!!t[a.slice(0,4)]}function wt(a,e,t=!0){return!a.split(",").some(s=>!xi(s,e,t))}function xi(a,e,t=!0){var s;const i=st(t);return(s=i?.isTypeSupported(Ot(a,e)))!=null?s:!1}function Ot(a,e){return`${e}/mp4;codecs=${a}`}function rr(a){if(a){const e=a.substring(0,4);return It.video[e]}return 2}function ds(a){const e=bn();return a.split(",").reduce((t,s)=>{const r=e&&xs(s)?9:It.video[s];return r?(r*2+t)/(t?3:2):(It.audio[s]+t)/(t?2:1)},0)}const Ps={};function nl(a,e=!0){if(Ps[a])return Ps[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;inl(t.toLowerCase(),e))}function ol(a,e){const t=[];if(a){const s=a.split(",");for(let i=0;i4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(nr(a,"audio")||nr(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let s=t.length;s--;)if(t[s].substring(0,4)===a.substring(0,4))return t[s]}return t[0]}}return e||a}function nr(a,e){return Si(a,e)&&xi(a,e)}function ll(a){const e=a.split(",");for(let t=0;t2&&s[0]==="avc1"&&(e[t]=`avc1.${parseInt(s[1]).toString(16)}${("000"+parseInt(s[2]).toString(16)).slice(-4)}`)}return e.join(",")}function cl(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let s=e.length;s>4&&s<10;s++)e[s]=t[s-4];return e.join(".")}return a}function ar(a){const e=st(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function ti(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const hl={supported:!0,powerEfficient:!0,smooth:!0},dl={supported:!1,smooth:!1,powerEfficient:!1},_n={supported:!0,configurations:[],decodingInfoResults:[hl]};function Dn(a,e){return{supported:!1,configurations:e,decodingInfoResults:[dl],error:a}}function ul(a,e,t,s,i,r){const n=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=r?.audioCodec,l=r?.channels,h=l?parseInt(l):c?1/0:2;let d=null;if(o!=null&&o.length)try{o.length===1&&o[0]?d=e.groups[o[0]].channels:d=o.reduce((u,f)=>{if(f){const g=e.groups[f];if(!g)throw new Error(`Audio track group ${f} not found`);Object.keys(g.channels).forEach(p=>{u[p]=(u[p]||0)+g.channels[p]})}return u},{2:0})}catch{return!0}return n!==void 0&&(n.split(",").some(u=>xs(u))||a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!d&&M(h)&&Object.keys(d).some(u=>parseInt(u)>h)}function Cn(a,e,t,s={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(_n);const r=[],n=fl(a),o=n.length,c=gl(a,e,o>0),l=c.length;for(let h=o||1*l||1;h--;){const d={type:"media-source"};if(o&&(d.video=n[h%o]),l){d.audio=c[h%l];const u=d.audio.bitrate;d.video&&u&&(d.video.bitrate-=u)}r.push(d)}if(i){const h=navigator.userAgent;if(i.split(",").some(d=>xs(d))&&bn())return Promise.resolve(Dn(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${h})`),r))}return Promise.all(r.map(h=>{const d=pl(h);return s[d]||(s[d]=t.decodingInfo(h))})).then(h=>({supported:!h.some(d=>!d.supported),configurations:r,decodingInfoResults:h})).catch(h=>({supported:!1,configurations:r,decodingInfoResults:[],error:h}))}function fl(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),s=Pn(a),i=a.width||640,r=a.height||480,n=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const l={contentType:Ot(cl(c),"video"),width:i,height:r,bitrate:s,framerate:n};return o!=="sdr"&&(l.transferFunction=o),l}):[]}function gl(a,e,t){var s;const i=(s=a.audioCodec)==null?void 0:s.split(","),r=Pn(a);return i&&a.audioGroups?a.audioGroups.reduce((n,o)=>{var c;const l=o?(c=e.groups[o])==null?void 0:c.tracks:null;return l?l.reduce((h,d)=>{if(d.groupId===o){const u=parseFloat(d.channels||"");i.forEach(f=>{const g={contentType:Ot(f,"audio"),bitrate:t?ml(f,r):r};u&&(g.channels=""+u),h.push(g)})}return h},n):n},[]):[]}function ml(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function Pn(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function pl(a){let e="";const{audio:t,video:s}=a;if(s){const i=ti(s.contentType);e+=`${i}_r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${Math.ceil(s.bitrate/1e5)}`}if(t){const i=ti(t.contentType);e+=`${s?"_":""}${i}_c${t.channels}`}return e}const si=["NONE","TYPE-0","TYPE-1",null];function El(a){return si.indexOf(a)>-1}const fs=["SDR","PQ","HLG"];function yl(a){return!!a&&fs.indexOf(a)>-1}var rs={No:"",Yes:"YES",v2:"v2"};function or(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!s).map(s=>s.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const s=(t=e.supplemental)==null?void 0:t.videoCodec;s&&s!==e.videoCodec&&(this.codecSet+=`,${s.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return cr(this._audioGroups,e)}hasSubtitleGroup(e){return cr(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function cr(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Tl(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function vl(a,e){let t=!1,s=[];if(a&&(t=a!=="SDR",s=[a]),e){s=e.allowedVideoRanges||fs.slice(0);const i=s.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Tl(),t||(s=["SDR"])}return{preferHDR:t,allowedVideoRanges:s}}const Sl=a=>{const e=new WeakSet;return(t,s)=>{if(a&&(s=a(t,s)),typeof s=="object"&&s!==null){if(e.has(s))return;e.add(s)}return s}},ae=(a,e)=>JSON.stringify(a,Sl(e));function xl(a,e,t,s,i){const r=Object.keys(a),n=s?.channels,o=s?.audioCodec,c=i?.videoCodec,l=n&&parseInt(n)===2;let h=!1,d=!1,u=1/0,f=1/0,g=1/0,p=1/0,E=0,y=[];const{preferHDR:T,allowedVideoRanges:v}=vl(e,i);for(let R=r.length;R--;){const _=a[r[R]];h||(h=_.channels[2]>0),u=Math.min(u,_.minHeight),f=Math.min(f,_.minFramerate),g=Math.min(g,_.minBitrate),v.filter(P=>_.videoRanges[P]>0).length>0&&(d=!0)}u=M(u)?u:0,f=M(f)?f:0;const S=Math.max(1080,u),x=Math.max(30,f);g=M(g)?g:t,t=Math.max(g,t),d||(e=void 0);const D=r.length>1;return{codecSet:r.reduce((R,_)=>{const I=a[_];if(_===R)return R;if(y=d?v.filter(P=>I.videoRanges[P]>0):[],D){if(I.minBitrate>t)return Be(_,`min bitrate of ${I.minBitrate} > current estimate of ${t}`),R;if(!I.hasDefaultAudio)return Be(_,"no renditions with default or auto-select sound found"),R;if(o&&_.indexOf(o.substring(0,4))%5!==0)return Be(_,`audio codec preference "${o}" not found`),R;if(n&&!l){if(!I.channels[n])return Be(_,`no renditions with ${n} channel sound found (channels options: ${Object.keys(I.channels)})`),R}else if((!o||l)&&h&&I.channels[2]===0)return Be(_,"no renditions with stereo sound found"),R;if(I.minHeight>S)return Be(_,`min resolution of ${I.minHeight} > maximum of ${S}`),R;if(I.minFramerate>x)return Be(_,`min framerate of ${I.minFramerate} > maximum of ${x}`),R;if(!y.some(P=>I.videoRanges[P]>0))return Be(_,`no variants with VIDEO-RANGE of ${ae(y)} found`),R;if(c&&_.indexOf(c.substring(0,4))%5!==0)return Be(_,`video codec preference "${c}" not found`),R;if(I.maxScore=ds(R)||I.fragmentError>a[R].fragmentError)?R:(p=I.minIndex,E=I.maxScore,_)},void 0),videoRanges:y,preferHDR:T,minFramerate:f,minBitrate:g,minIndex:p}}function Be(a,e){ie.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function kn(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Al(a,e,t,s){return a.slice(t,s+1).reduce((i,r,n)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:n,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,l),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,n),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(h=>{if(!h)return;const d=e.groups[h];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(u=>{c.channels[u]=(c.channels[u]||0)+d.channels[u]}))}),i},{})}function hr(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:s,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:s,channels:i,audioCodec:r}}function Ke(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function ct(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function Rl(a,e,t,s,i){const r=e[s],o=e.reduce((u,f,g)=>{const p=f.uri;return(u[p]||(u[p]=[])).push(g),u},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const c=r.videoRange,l=r.frameRate,h=r.codecSet.substring(0,4),d=dr(e,s,u=>{if(u.videoRange!==c||u.frameRate!==l||u.codecSet.substring(0,4)!==h)return!1;const f=u.audioGroups,g=t.filter(p=>!f||f.indexOf(p.groupId)!==-1);return Ke(a,g,i)>-1});return d>-1?d:dr(e,s,u=>{const f=u.audioGroups,g=t.filter(p=>!f||f.indexOf(p.groupId)!==-1);return Ke(a,g,i)>-1})}function dr(a,e,t){for(let s=e;s>-1;s--)if(t(a[s]))return s;for(let s=e+1;s{var s;const{fragCurrent:i,partCurrent:r,hls:n}=this,{autoLevelEnabled:o,media:c}=n;if(!i||!c)return;const l=performance.now(),h=r?r.stats:i.stats,d=r?r.duration:i.duration,u=l-h.loading.start,f=n.minAutoLevel,g=i.level,p=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||g<=f){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const E=p>-1&&p!==g,y=!!t||E;if(!y&&(c.paused||!c.playbackRate||!c.readyState))return;const T=n.mainForwardBufferInfo;if(!y&&T===null)return;const v=this.bwEstimator.getEstimateTTFB(),S=Math.abs(c.playbackRate);if(u<=Math.max(v,1e3*(d/(S*2))))return;const x=T?T.len/S:0,D=h.loading.first?h.loading.first-h.loading.start:-1,A=h.loaded&&D>-1,R=this.getBwEstimate(),_=n.levels,I=_[g],P=Math.max(h.loaded,Math.round(d*(i.bitrate||I.averageBitrate)/8));let F=A?u-D:u;F<1&&A&&(F=Math.min(u,h.loaded*8/R));const U=A?h.loaded*1e3/F:0,H=v/1e3,$=U?(P-h.loaded)/U:P*8/R+H;if($<=x)return;const k=U?U*8:R,G=((s=t?.details||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,N=this.hls.config.abrBandWidthUpFactor;let K=Number.POSITIVE_INFINITY,Y;for(Y=g-1;Y>f;Y--){const ee=_[Y].maxBitrate,z=!_[Y].details||G;if(K=this.getTimeToLoadFrag(H,k,d*ee,z),K=$||K>d*10)return;A?this.bwEstimator.sample(u-Math.min(v,D),h.loaded):this.bwEstimator.sampleTTFB(u);const w=_[Y].maxBitrate;this.getBwEstimate()*N>w&&this.resetEstimator(w);const O=this.findBestLevel(w,f,Y,0,x,1,1);O>-1&&(Y=O),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${g} is loading too slowly; - Fragment duration: ${i.duration.toFixed(3)} - Time to underbuffer: ${x.toFixed(3)} s - Estimated load time for current fragment: ${$.toFixed(3)} s - Estimated load time for down switch fragment: ${K.toFixed(3)} s - TTFB estimate: ${D|0} ms - Current BW estimate: ${M(R)?R|0:"Unknown"} bps - New BW estimate: ${this.getBwEstimate()|0} bps - Switching to level ${Y} @ ${w|0} bps`),n.nextLoadLevel=n.nextAutoLevel=Y,this.clearTimer();const q=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Y&&Y>0){const ee=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Y>0?"and switching down":""} - Fragment duration: ${i.duration.toFixed(3)} s - Time to underbuffer: ${ee.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Y>f){let z=this.findBestLevel(this.hls.levels[f].bitrate,f,Y,0,ee,1,1);z===-1&&(z=f),this.hls.nextLoadLevel=this.hls.nextAutoLevel=z,this.resetEstimator(this.hls.levels[z].bitrate)}}};E||$>K*2?q():this.timer=self.setInterval(q,K*1e3),n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:h})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new ko(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(m.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case b.BUFFER_ADD_CODEC_ERROR:case b.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case b.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,c=n-o.loading.start,l=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&l>-1){const d=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(d,l),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?e+this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;M(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===B.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,c=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:c},n.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(m.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==B.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this;if(s.levels.length<=1)return s.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),l=this.getStarvationDelay();let h=r.abrBandWidthFactor,d=r.abrBandWidthUpFactor;if(l){const E=this.findBestLevel(c,n,i,l,0,h,d);if(E>=0)return this.rebufferNotice=-1,E}let u=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const E=this.bitrateTestDelay;E&&(u=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-E,this.info(`bitrate test took ${Math.round(1e3*E)}ms, set first fragment max fetchDuration to ${Math.round(1e3*u)} ms`),h=d=1)}const f=this.findBestLevel(c,n,i,l,u,h,d);if(this.rebufferNotice!==f&&(this.rebufferNotice=f,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${f}`)),f>-1)return f;const g=s.levels[n],p=s.loadLevelObj;return p&&g?.bitrate=t;k--){var $;const G=g[k],N=k>d;if(!G)continue;if(y.useMediaCapabilities&&!G.supportedResult&&!G.supportedPromise){const z=navigator.mediaCapabilities;typeof z?.decodingInfo=="function"&&ul(G,I,D,A,e,R)?(G.supportedPromise=Cn(G,I,z,this.supportedCache),G.supportedPromise.then(Z=>{if(!this.hls)return;G.supportedResult=Z;const ye=this.hls.levels,ge=ye.indexOf(G);Z.error?this.warn(`MediaCapabilities decodingInfo error: "${Z.error}" for level ${ge} ${ae(Z)}`):Z.supported?Z.decodingInfoResults.some(De=>De.smooth===!1||De.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${ge} not smooth or powerEfficient: ${ae(Z)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${ge} ${ae(Z)}`),ge>-1&&ye.length>1&&(this.log(`Removing unsupported level ${ge}`),this.hls.removeLevel(ge),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Z=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Z}`)})):G.supportedResult=_n}if((x&&G.codecSet!==x||D&&G.videoRange!==D||N&&A>G.frameRate||!N&&A>0&&Az.smooth===!1))&&(!S||k!==P)){H.push(k);continue}const K=G.details,Y=(f?K?.partTarget:K?.averagetargetduration)||F;let w;N?w=o*e:w=n*e;const O=F&&i>=F*2&&r===0?G.averageBitrate:G.maxBitrate,q=this.getTimeToLoadFrag(U,w,O*Y,K===void 0);if(w>=O&&(k===h||G.loadError===0&&G.fragmentError===0)&&(q<=U||!M(q)||v&&!this.bitrateTestDelay||q${k} adjustedbw(${Math.round(w)})-bitrate=${Math.round(w-O)} ttfb:${U.toFixed(1)} avgDuration:${Y.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${q.toFixed(1)} firstSelection:${S} codecSet:${G.codecSet} videoRange:${G.videoRange} hls.loadLevel:${E}`)),S&&(this.firstSelection=k),k}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls;return Math.min(Math.max(e,s),t)}}const wn={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function _l(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!M(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;for(let r=0;r0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&ur(t,s,r)===0||Dl(r,a,Math.min(i,s))))return r;const n=wn.search(e,ur.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Dl(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function ur(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function Cl(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function On(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let s=a.fragments;const{fragmentHint:i}=a;i&&(s=s.concat(i));let r;return wn.search(s,n=>n.cce?-1:(r=n,n.end<=t?1:n.start>t?-1:0)),r||null}return null}function ms(a){switch(a.details){case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_TIMEOUT:case b.LEVEL_LOAD_TIMEOUT:case b.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Fn(a){return a.details.startsWith("key")}function Mn(a){return Fn(a)&&!!a.frag&&!a.frag.decryptdata}function fr(a,e){const t=ms(e);return a.default[`${t?"timeout":"error"}Retry`]}function Ai(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function gr(a){return se(se({},a),{errorRetry:null,timeoutRetry:null})}function ps(a,e,t,s){if(!a)return!1;const i=s?.code,r=e499)}function ii(a){return a===0&&navigator.onLine===!1}var me={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},Ie={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class kl extends ke{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.ERROR,this.onError,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.ERROR,this.onError,this),e.off(m.ERROR,this.onErrorOut,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return e?.type===B.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,s=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||s===-1?t.loadLevel:s}variantHasKey(e,t){if(e){var s;if((s=e.details)!=null&&s.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(n=>i.indexOf(n.groupId)>=0).some(n=>{var o;return(o=n.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var s;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case b.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction=vt();return}case b.FRAG_GAP:case b.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=me.SendAlternateToPenaltyBox;return}case b.LEVEL_EMPTY_ERROR:case b.LEVEL_PARSING_ERROR:{var n;const c=t.parent===B.MAIN?t.level:i.loadLevel;t.details===b.LEVEL_EMPTY_ERROR&&((n=t.context)!=null&&(n=n.levelDetails)!=null&&n.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case b.LEVEL_LOAD_ERROR:case b.LEVEL_LOAD_TIMEOUT:typeof r?.level=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case b.AUDIO_TRACK_LOAD_ERROR:case b.AUDIO_TRACK_LOAD_TIMEOUT:case b.SUBTITLE_LOAD_ERROR:case b.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=i.loadLevelObj;if(c&&(r.type===Q.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===Q.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=me.SendAlternateToPenaltyBox,t.errorAction.flags=Ie.MoveAllAlternatesMatchingHost;return}}return;case b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:me.SendAlternateToPenaltyBox,flags:Ie.MoveAllAlternatesMatchingHDCP};return;case b.KEY_SYSTEM_SESSION_UPDATE_FAILED:case b.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case b.KEY_SYSTEM_NO_SESSION:t.errorAction={action:me.SendAlternateToPenaltyBox,flags:Ie.MoveAllAlternatesMatchingKey};return;case b.BUFFER_ADD_CODEC_ERROR:case b.REMUX_ALLOC_ERROR:case b.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case b.INTERNAL_EXCEPTION:case b.BUFFER_APPENDING_ERROR:case b.BUFFER_FULL_ERROR:case b.LEVEL_SWITCH_ERROR:case b.BUFFER_STALLED_ERROR:case b.BUFFER_SEEK_OVER_HOLE:case b.BUFFER_NUDGE_ON_STALL:t.errorAction=vt();return}t.type===V.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=vt())}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=fr(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(ps(i,r,ms(e),e.response))return{action:me.RetryRequest,flags:Ie.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=fr(Fn(e)?n:r,e),c=t.levels.reduce((h,d)=>h+d.fragmentError,0);if(i&&(e.details!==b.FRAG_GAP&&i.fragmentError++,!Mn(e)&&ps(o,c,ms(e),e.response)))return{action:me.RetryRequest,flags:Ie.None,retryConfig:o,retryCount:c};const l=this.getLevelSwitchAction(e,s);return o&&(l.retryConfig=o,l.retryCount=c),l}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const l=e.details;i.loadError++,l===b.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:d,loadLevel:u,minAutoLevel:f,maxAutoLevel:g}=s;!s.autoLevelEnabled&&!s.config.preserveManualLevelOnError&&(s.loadLevel=-1);const p=(r=e.frag)==null?void 0:r.type,y=(p===B.AUDIO&&l===b.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===b.BUFFER_ADD_CODEC_ERROR||l===b.BUFFER_APPEND_ERROR))&&d.some(({audioCodec:D})=>i.audioCodec!==D),v=e.sourceBufferName==="video"&&(l===b.BUFFER_ADD_CODEC_ERROR||l===b.BUFFER_APPEND_ERROR)&&d.some(({codecSet:D,audioCodec:A})=>i.codecSet!==D&&i.audioCodec===A),{type:S,groupId:x}=(n=e.context)!=null?n:{};for(let D=d.length;D--;){const A=(D+u)%d.length;if(A!==u&&A>=f&&A<=g&&d[A].loadError===0){var o,c;const R=d[A];if(l===b.FRAG_GAP&&p===B.MAIN&&e.frag){const _=d[A].details;if(_){const I=dt(e.frag,_.fragments,e.frag.start);if(I!=null&&I.gap)continue}}else{if(S===Q.AUDIO_TRACK&&R.hasAudioGroup(x)||S===Q.SUBTITLE_TRACK&&R.hasSubtitleGroup(x))continue;if(p===B.AUDIO&&(o=i.audioGroups)!=null&&o.some(_=>R.hasAudioGroup(_))||p===B.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(_=>R.hasSubtitleGroup(_))||y&&i.audioCodec===R.audioCodec||v&&i.codecSet===R.codecSet||!y&&i.codecSet!==R.codecSet)continue}h=A;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:me.SendAlternateToPenaltyBox,flags:Ie.None,nextAutoLevel:h}}return{action:me.SendAlternateToPenaltyBox,flags:Ie.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case me.DoNothing:break;case me.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==b.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i}=s,r=s.nextAutoLevel;switch(i){case Ie.None:this.switchLevel(e,r);break;case Ie.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),l=t.levels[c],h=l?.attrs["HDCP-LEVEL"];if(s.hdcpLevel=h,h==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(h){t.maxHdcpLevel=si[si.indexOf(h)-1],s.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Ie.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const l=this.hls.levels,h=l.length;for(let u=h;u--;)if(this.variantHasKey(l[u],c)){var n,o;this.log(`Banned key found in level ${u} (${l[u].bitrate}bps) or audio group "${(n=l[u].audioGroups)==null?void 0:n.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${pe(c.keyId||[])}`),l[u].fragmentError++,l[u].loadError++,this.log(`Removing level ${u} with key error (${e.error})`),this.hls.removeLevel(u)}const d=e.frag;if(this.hls.levels.length{const c=this.fragments[o];if(!c||n>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===s&&this.removeFragment(c.body);return}const l=c.range[e];if(l){if(l.time.length===0){this.removeFragment(c.body);return}l.time.some(h=>{const d=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return d&&this.removeFragment(c.body),d})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const s=e.frag,i=gt(s),r=this.fragments[i];if(!r||r.buffered&&s.gap)return;const n=!s.relurl;Object.keys(t).forEach(o=>{const c=s.elementaryStreams[o];if(!c)return;const l=t[o],h=n||c.partial===!0;r.range[o]=this.getBufferedTimes(s,e.part,h,l)}),r.loaded=null,Object.keys(r.range).length?(this.bufferedEnd(r,s),Vt(r)||this.removeParts(s.sn-1,s.type)):this.removeFragment(r.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=mr(s,i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=gt(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,this.bufferedEnd(i,e))}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,c=e.minEndPTS||o,l=e.maxStartPTS||n;for(let h=0;h=d&&c<=u){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nd){const f=Math.max(n,i.start(h)),g=Math.min(o,i.end(h));g>f&&(r.partial=!0,r.time.push({startPTS:f,endPTS:g}))}else if(o<=d)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(l=>{const h=c[l];h&&Vt(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Vt(t))}getState(e){const t=gt(e),s=this.fragments[t];return s?s.buffered?Vt(s)?ue.PARTIAL:ue.OK:ue.APPENDING:ue.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const s=t.frag,i=t.part?null:t,r=gt(s);this.fragments[r]={body:s,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r,type:n}=t;if(s.sn==="initSegment")return;const o=s.type;if(i){let l=this.activePartLists[o];l||(this.activePartLists[o]=l=[]),l.push(i)}this.timeRanges=r;const c=r[n];this.detectEvictedFragments(n,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=gt(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,s=Object.keys(t);if(!e)return s.length>0;for(let i=s.length;i--;){const r=t[s[i]];if(r?.body.type===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const c=o.body;c.type!==s||i&&!c.gap||c.starte&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=gt(e);e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=mr(s,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(s=>s.clearElementaryStreamInfo())}}function Vt(a){var e,t,s;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(s=a.range.audiovideo)!=null&&s.partial)}function gt(a){return`${a.type}_${a.level}_${a.sn}`}function mr(a,e){return a.filter(t=>{const s=e(t);return s||t.clearElementaryStreamInfo(),s})}var it={cbc:0,ctr:1};class Ol{constructor(e,t,s){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=s}decrypt(e,t){switch(this.aesMode){case it.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case it.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function Fl(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Ml{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],c=this.invSubMix,l=c[0],h=c[1],d=c[2],u=c[3],f=new Uint32Array(256);let g=0,p=0,E=0;for(E=0;E<256;E++)E<128?f[E]=E<<1:f[E]=E<<1^283;for(E=0;E<256;E++){let y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^y&255^99,e[g]=y,t[y]=g;const T=f[g],v=f[T],S=f[v];let x=f[y]*257^y*16843008;i[g]=x<<24|x>>>8,r[g]=x<<16|x>>>16,n[g]=x<<8|x>>>24,o[g]=x,x=S*16843009^v*65537^T*257^g*16843008,l[y]=x<<24|x>>>8,h[y]=x<<16|x>>>16,d[y]=x<<8|x>>>24,u[y]=x,g?(g=T^f[f[f[S^T]]],p^=f[f[p]]):g=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;i{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,s,i);const c=this.flush();c?r(c.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,s,i)}softwareDecrypt(e,t,s,i){const{currentIV:r,currentResult:n,remainderData:o}=this;if(i!==it.cbc||t.byteLength!==16)return ie.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Pe(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(s=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Ml),l.expandKey(t);const h=n;return this.currentResult=l.decrypt(c.buffer,0,s),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(e,t,s,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,s,i));this.key=t,this.fastAesKey=new Nl(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Ol(this.subtle,new Uint8Array(s),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(ie.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,s,i)))}onWebCryptoError(e,t,s,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s,i);const n=this.flush();if(n)return n.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%Ul;return s!==e.length&&(t=e.slice(0,s),this.remainderData=e.slice(s)),t}logOnce(e){this.logEnabled&&(ie.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr=Math.pow(2,17);class $l{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const s=e.url;if(!s)return Promise.reject(new ze({type:V.NETWORK_ERROR,details:b.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(g=>g[0]==="GAP")){c(yr(e));return}else e.gap=!1;const l=this.loader=r?new r(i):new n(i),h=Er(e);e.loader=l;const d=gr(i.fragLoadPolicy.default),u={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:pr};e.stats=l.stats;const f={onSuccess:(g,p,E,y)=>{this.resetLoader(e,l);let T=g.data;E.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(T.slice(0,16)),T=T.slice(16)),o({frag:e,part:null,payload:T,networkDetails:y})},onError:(g,p,E,y)=>{this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:se({url:s,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:E,stats:y}))},onAbort:(g,p,E)=>{this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:E,stats:g}))},onTimeout:(g,p,E)=>{this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:E,stats:g}))}};t&&(f.onProgress=(g,p,E,y)=>t({frag:e,part:null,payload:E,networkDetails:y})),l.load(h,u,f)})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(yr(e,t));return}const l=this.loader=r?new r(i):new n(i),h=Er(e,t);e.loader=l;const d=gr(i.fragLoadPolicy.default),u={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:pr};t.stats=l.stats,l.load(h,u,{onSuccess:(f,g,p,E)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const y={frag:e,part:t,payload:f.data,networkDetails:E};s(y),o(y)},onError:(f,g,p,E)=>{this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:se({url:h.url,data:void 0},f),error:new Error(`HTTP Error ${f.code} ${f.text}`),networkDetails:p,stats:E}))},onAbort:(f,g,p)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:p,stats:f}))},onTimeout:(f,g,p)=>{this.resetLoader(e,l),c(new ze({type:V.NETWORK_ERROR,details:b.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:p,stats:f}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),l=Math.min(Math.round(s.loaded/r),c),d=(c-l)*Math.round(s.loaded/l);s.total=s.loaded+d}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Er(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(M(i)&&M(r)){var n;let o=i,c=r;if(a.sn==="initSegment"&&Gl((n=a.decryptdata)==null?void 0:n.method)){const l=r-i;l%16&&(c=r+(16-l%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=c}return s}function yr(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:V.MEDIA_ERROR,details:b.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new ze(s)}function Gl(a){return a==="AES-128"||a==="AES-256"}class ze extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Nn extends ke{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Li{constructor(e,t,s,i=0,r=-1,n=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Ht(),this.buffering={audio:Ht(),video:Ht(),audiovideo:Ht()},this.level=e,this.sn=t,this.id=s,this.size=i,this.part=r,this.partial=n}}function Ht(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Tr={length:0,start:()=>0,end:()=>0};class j{static isBuffered(e,t){if(e){const s=j.getBuffered(e);for(let i=s.length;i--;)if(t>=s.start(i)&&t<=s.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=j.getBuffered(e);return j.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let s=0;s1&&e.sort((h,d)=>h.start-d.start||d.end-h.end);let i=-1,r=[];if(s)for(let h=0;h=e[h].start&&t<=e[h].end&&(i=h);const d=r.length;if(d){const u=r[d-1].end;e[h].start-uu&&(r[d-1].end=e[h].end):r.push(e[h])}else r.push(e[h])}else r=e;let n=0,o,c=t,l=t;for(let h=0;h=d&&t<=u&&(i=h),t+s>=d&&t{const i=s.substring(2,s.length-1),r=t?.[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function Sr(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Kl(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const Vl=/^(\d+)x(\d+)$/,xr=/(.+?)=(".*?"|.*?)(?:,|$)/g;class oe{constructor(e,t){typeof e=="string"&&(e=oe.parseAttrList(e,t)),re(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const s=this[e];return(s?s.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Vl.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let s;const i={};for(xr.lastIndex=0;(s=xr.exec(e))!==null;){const n=s[1].trim();let o=s[2];const c=o.indexOf('"')===0&&o.lastIndexOf('"')===o.length-1;let l=!1;if(c)o=o.slice(1,-1);else switch(n){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(c||l))o=ri(t,o);else if(!l&&!c)switch(n){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":ie.warn(`${e}: attribute ${n} is missing quotes`)}i[n]=o}return i}}const Hl="com.apple.hls.interstitial";function Yl(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Wl(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Un{constructor(e,t,s=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=t?.tagAnchor||null,this.tagOrder=(i=t?.tagOrder)!=null?i:s,t){const r=t.attr;for(const n in r)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==r[n]){ie.warn(`DATERANGE tag attribute: "${n}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=n;break}e=re(new oe({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=t?.endDate||new Date(this.attr["END-DATE"]);M(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(ie.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(M(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Hl}get isValid(){return!!this.id&&!this._badValueForSameId&&M(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const jl=10;class ql{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let s=t.decryptdata;return s||(t.setKeyFormat(e.keyFormat),s=t.decryptdata),!!s&&e.matches(s)})}get hasProgramDateTime(){return this.fragments.length?M(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||jl}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let s=e.length;s--;)if(e[s].index>t)return e[s].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Es(a,e){return a.length===e.length?!a.some((t,s)=>t!==e[s]):!1}function Ar(a,e){return!a&&!e?!0:!a||!e?!1:Es(a,e)}function St(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Ri(a){switch(a){case"AES-128":case"AES-256":return it.cbc;case"AES-256-CTR":return it.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function bi(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function ni(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function zl(a){const e=ni(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function $n(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Gn(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=bi(n)):t=zl(n)}}return t}const ys=typeof self<"u"?self:void 0;var le={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Ee={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ns(a){switch(a){case Ee.FAIRPLAY:return le.FAIRPLAY;case Ee.PLAYREADY:return le.PLAYREADY;case Ee.WIDEVINE:return le.WIDEVINE;case Ee.CLEARKEY:return le.CLEARKEY}}function ks(a){switch(a){case le.FAIRPLAY:return Ee.FAIRPLAY;case le.PLAYREADY:return Ee.PLAYREADY;case le.WIDEVINE:return Ee.WIDEVINE;case le.CLEARKEY:return Ee.CLEARKEY}}function Dt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[le.FAIRPLAY,le.WIDEVINE,le.PLAYREADY,le.CLEARKEY].filter(i=>!!e[i]):[];return!s[le.WIDEVINE]&&t&&s.push(le.WIDEVINE),s}const Kn=(function(a){return ys!=null&&(a=ys.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null})();function Xl(a,e,t,s){let i;switch(a){case le.FAIRPLAY:i=["cenc","sinf"];break;case le.WIDEVINE:case le.PLAYREADY:i=["cenc"];break;case le.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ql(i,e,t,s)}function Ql(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Zl(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Vn(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),s=t.substring(t.indexOf("<"),t.length),n=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(n){const o=n.childNodes[0]?n.childNodes[0].nodeValue:n.getAttribute("VALUE");if(o){const c=bi(o).subarray(0,16);return $n(c),c}}return null}let mt={};class tt{static clearKeyUriToKeyIdMap(){mt={}}static setKeyIdForUri(e,t){mt[e]=t}static addKeyIdForUri(e){const t=Object.keys(mt).length%Number.MAX_SAFE_INTEGER,s=new Uint8Array(16);return new DataView(s.buffer,12,4).setUint32(0,t),mt[e]=s,s}constructor(e,t,s,i=[1],r=null,n){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=s,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!St(e),n!=null&&n.startsWith("0x")&&(this.keyId=new Uint8Array(En(n)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Es(e.keyFormatVersions,this.keyFormatVersions)&&Ar(e.iv,this.iv)&&Ar(e.keyId,this.keyId)}isSupported(){if(this.method){if(St(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Ee.FAIRPLAY:case Ee.WIDEVINE:case Ee.PLAYREADY:case Ee.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(St(this.method)){let r=this.iv;return r||(typeof e!="number"&&(ie.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),r=ec(e)),new tt(this.method,this.uri,"identity",this.keyFormatVersions,r)}if(this.keyId){const r=mt[this.uri];if(r&&!Es(this.keyId,r)&&tt.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const s=Gn(this.uri);if(s)switch(this.keyFormat){case Ee.WIDEVINE:if(this.pssh=s,!this.keyId){const r=il(s.buffer);if(r.length){var i;const n=r[0];this.keyId=(i=n.kids)!=null&&i.length?n.kids[0]:null}}this.keyId||(this.keyId=Ir(t));break;case Ee.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=sl(r,null,s),this.keyId=Vn(s);break}default:{let r=s.subarray(0,16);if(r.length!==16){const n=new Uint8Array(16);n.set(r,16-r.length),r=n}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r;r=Jl(t),r||(r=Ir(t),r||(r=mt[this.uri])),r&&(this.keyId=r,tt.setKeyIdForUri(this.uri,r))}return this}}function Jl(a){const e=a?.[Ee.WIDEVINE];return e?e.keyId:null}function Ir(a){const e=a?.[Ee.PLAYREADY];if(e){const t=Gn(e.uri);if(t)return Vn(t)}return null}function ec(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Lr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Rr=/#EXT-X-MEDIA:(.*)/g,tc=/^#EXT(?:INF|-X-TARGETDURATION):/m,ws=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),sc=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ve{static findGroup(e,t){for(let s=0;s0&&r.length({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:n.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Rr.lastIndex=0;(i=Rr.exec(e))!==null;){const l=new oe(i[1],s),h=l.TYPE;if(h){const d=o[h],u=r[h]||[];r[h]=u;const f=l.LANGUAGE,g=l["ASSOC-LANGUAGE"],p=l.CHANNELS,E=l.CHARACTERISTICS,y=l["INSTREAM-ID"],T={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",name:l.NAME||f||"",type:h,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:f,url:l.URI?Ve.resolve(l.URI,t):""};if(g&&(T.assocLang=g),p&&(T.channels=p),E&&(T.characteristics=E),y&&(T.instreamId=y),d!=null&&d.length){const v=Ve.findGroup(d,T.groupId)||d[0];Cr(T,v,"audioCodec"),Cr(T,v,"textCodec")}u.push(T)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){var o;const c={url:t},l=new ql(t),h=l.fragments,d=[];let u=null,f=0,g=0,p=0,E=0,y=0,T=null,v=new Ds(i,c),S,x,D,A=-1,R=!1,_=null,I;if(ws.lastIndex=0,l.m3u8=e,l.hasVariableRefs=vr(e),((o=ws.exec(e))==null?void 0:o[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(S=ws.exec(e))!==null;){R&&(R=!1,v=new Ds(i,c),v.playlistOffset=p,v.setStart(p),v.sn=f,v.cc=E,y&&(v.bitrate=y),v.level=s,u&&(v.initSegment=u,u.rawProgramDateTime&&(v.rawProgramDateTime=u.rawProgramDateTime,u.rawProgramDateTime=null),_&&(v.setByteRange(_),_=null)));const H=S[1];if(H){v.duration=parseFloat(H);const $=(" "+S[2]).slice(1);v.title=$||null,v.tagList.push($?["INF",H,$]:["INF",H])}else if(S[3]){if(M(v.duration)){v.playlistOffset=p,v.setStart(p),D&&kr(v,D,l),v.sn=f,v.level=s,v.cc=E,h.push(v);const $=(" "+S[3]).slice(1);v.relurl=ri(l,$),ai(v,T,d),T=v,p+=v.duration,f++,g=0,R=!0}}else{if(S=S[0].match(sc),!S){ie.warn("No matches on slow regex match for level playlist!");continue}for(x=1;x0&&wr(l,$,S),f=l.startSN=parseInt(k);break;case"SKIP":{l.skippedSegments&&je(l,$,S);const N=new oe(k,l),K=N.decimalInteger("SKIPPED-SEGMENTS");if(M(K)){l.skippedSegments+=K;for(let w=K;w--;)h.push(null);f+=K}const Y=N.enumeratedString("RECENTLY-REMOVED-DATERANGES");Y&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(Y.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&je(l,$,S),l.targetduration=Math.max(parseInt(k),1);break;case"VERSION":l.version!==null&&je(l,$,S),l.version=parseInt(k);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||je(l,$,S),l.live=!1;break;case"#":(k||G)&&v.tagList.push(G?[k,G]:[k]);break;case"DISCONTINUITY":E++,v.tagList.push(["DIS"]);break;case"GAP":v.gap=!0,v.tagList.push([$]);break;case"BITRATE":v.tagList.push([$,k]),y=parseInt(k)*1e3,M(y)?v.bitrate=y:y=0;break;case"DATERANGE":{const N=new oe(k,l),K=new Un(N,l.dateRanges[N.ID],l.dateRangeTagCount);l.dateRangeTagCount++,K.isValid||l.skippedSegments?l.dateRanges[K.id]=K:ie.warn(`Ignoring invalid DATERANGE tag: "${k}"`),v.tagList.push(["EXT-X-DATERANGE",k]);break}case"DEFINE":{{const N=new oe(k,l);"IMPORT"in N?Kl(l,N,n):Sr(l,N,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?je(l,$,S):h.length>0&&wr(l,$,S),l.startCC=E=parseInt(k);break;case"KEY":{const N=br(k,t,l);if(N.isSupported()){if(N.method==="NONE"){D=void 0;break}D||(D={});const K=D[N.keyFormat];K!=null&&K.matches(N)||(K&&(D=re({},D)),D[N.keyFormat]=N)}else ie.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${k}"`);break}case"START":l.startTimeOffset=_r(k);break;case"MAP":{const N=new oe(k,l);if(v.duration){const K=new Ds(i,c);Pr(K,N,s,D),u=K,v.initSegment=u,u.rawProgramDateTime&&!v.rawProgramDateTime&&(v.rawProgramDateTime=u.rawProgramDateTime)}else{const K=v.byteRangeEndOffset;if(K){const Y=v.byteRangeStartOffset;_=`${K-Y}@${Y}`}else _=null;Pr(v,N,s,D),u=v,R=!0}u.cc=E;break}case"SERVER-CONTROL":{I&&je(l,$,S),I=new oe(k),l.canBlockReload=I.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=I.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&I.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=I.optionalFloat("PART-HOLD-BACK",0),l.holdBack=I.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&je(l,$,S);const N=new oe(k);l.partTarget=N.decimalFloatingPoint("PART-TARGET");break}case"PART":{let N=l.partList;N||(N=l.partList=[]);const K=g>0?N[N.length-1]:void 0,Y=g++,w=new oe(k,l),O=new Ko(w,v,c,Y,K);N.push(O),v.duration+=O.duration;break}case"PRELOAD-HINT":{const N=new oe(k,l);l.preloadHint=N;break}case"RENDITION-REPORT":{const N=new oe(k,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(N);break}default:ie.warn(`line parsed but not handled: ${S}`);break}}}T&&!T.relurl?(h.pop(),p-=T.duration,l.partList&&(l.fragmentHint=T)):l.partList&&(ai(v,T,d),v.cc=E,l.fragmentHint=v,D&&kr(v,D,l)),l.targetduration||(l.playlistParsingError=new Error("Missing Target Duration"));const P=h.length,F=h[0],U=h[P-1];if(p+=l.skippedSegments*l.targetduration,p>0&&P&&U){l.averagetargetduration=p/P;const H=U.sn;l.endSN=H!=="initSegment"?H:0,l.live||(U.endList=!0),A>0&&(rc(h,A),F&&d.unshift(F))}return l.fragmentHint&&(p+=l.fragmentHint.duration),l.totalduration=p,d.length&&l.dateRangeTagCount&&F&&Hn(d,l),l.endCC=E,l}}function Hn(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const s=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const c=e.dateRanges[r[o]],l=c.startDate.getTime();c.tagAnchor=s.ref;for(let h=t;h--;){var n;if(((n=a[h])==null?void 0:n.sn)=o||s===0){var n;const c=(((n=t[s+1])==null?void 0:n.start)||i)-r.start;if(e<=o+c*1e3){const l=t[s].sn-a.startSN;if(l<0)return-1;const h=a.fragments;if(h.length>t.length){const u=(t[s+1]||h[h.length-1]).sn-a.startSN;for(let f=u;f>l;f--){const g=h[f].programDateTime;if(e>=g&&es);["video","audio","text"].forEach(s=>{const i=t.filter(r=>Si(r,s));i.length&&(e[`${s}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Cr(a,e,t){const s=e[t];s&&(a[t]=s)}function rc(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function ai(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Pr(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function kr(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}function je(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function wr(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Os(a,e){const t=e.startPTS;if(M(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&i.setDuration(s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function Yn(a,e,t,s,i,r,n){s-t<=0&&(n.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let c=t,l=s;const h=e.startPTS,d=e.endPTS;if(M(h)){const y=Math.abs(h-t);a&&y>a.totalduration?n.warn(`media timestamps and playlist times differ by ${y}s for level ${e.level} ${a.url}`):M(e.deltaPTS)?e.deltaPTS=Math.max(y,e.deltaPTS):e.deltaPTS=y,c=Math.max(t,h),t=Math.min(t,h),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,l=Math.min(s,d),s=Math.max(s,d),r=e.endDTS!==void 0?Math.max(r,e.endDTS):r}const u=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(s-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const f=e.sn;if(!a||fa.endSN)return 0;let g;const p=f-a.startSN,E=a.fragments;for(E[p]=e,g=p;g>0;g--)Os(E[g],E[g-1]);for(g=p;g=0;h--){const d=i[h].initSegment;if(d){s=d;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;lc(a,e,(h,d,u,f)=>{if((!e.startCC||e.skippedSegments)&&d.cc!==h.cc){const g=h.cc-d.cc;for(let p=u;p{var d;h&&(!h.initSegment||h.initSegment.relurl===((d=s)==null?void 0:d.relurl))&&(h.initSegment=s)}),e.skippedSegments){if(e.deltaUpdateFailed=n.some(h=>!h),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let h=e.skippedSegments;h--;)n.shift();e.startSN=n[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=ac(a.dateRanges,e,t));const h=a.fragments.filter(d=>d.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let d=1;d{d.elementaryStreams=h.elementaryStreams,d.stats=h.stats}),r?Yn(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS,t):Wn(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const h=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=h),e.driftEndTime=l,e.driftEnd=h}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function ac(a,e,t){const{dateRanges:s,recentlyRemovedDateranges:i}=e,r=re({},a);i&&i.forEach(c=>{delete r[c]});const o=Object.keys(r).length;return o?(Object.keys(s).forEach(c=>{const l=r[c],h=new Un(s[c].attr,l);h.isValid?(r[c]=h,l||(h.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ae(s[c].attr)}"`)}),r):s}function oc(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function lc(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let l=i;l<=r;l++){const h=c[n+l];let d=o[l];if(s&&!d&&h&&(d=e.fragments[l]=h),h&&d){t(h,d,l,o);const u=h.relurl,f=d.relurl;if(u&&cc(u,f)){e.playlistParsingError=Or(`media sequence mismatch ${d.sn}:`,a,e,h,d);return}else if(h.cc!==d.cc){e.playlistParsingError=Or(`discontinuity sequence mismatch (${h.cc}!=${d.cc})`,a,e,h,d);return}}}}function Or(a,e,t,s,i){return new Error(`${a} ${i.url} -Playlist starting @${e.startSN} -${e.m3u8} - -Playlist starting @${t.startSN} -${t.m3u8}`)}function Wn(a,e,t=!0){const s=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=s>=0;let n=0;if(r&&se){const r=s[s.length-1].duration*1e3;r{var s;(s=e.details)==null||s.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function cc(a,e){return a!==e&&e?Mr(a)!==Mr(e):!1}function Mr(a){return a.replace(/\?[^?]*$/,"")}function Ct(a,e){for(let s=0,i=a.length;sa.startCC)}function Nr(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function Qn(a,e){const t=e.fragments;for(let s=0,i=t.length;s{const{config:n,fragCurrent:o,media:c,mediaBuffer:l,state:h}=this,d=c?c.currentTime:0,u=j.bufferInfo(l||c,d,n.maxBufferHole),f=!u.len;if(this.log(`Media seeking to ${M(d)?d.toFixed(3):d}, state: ${h}, ${f?"out of":"in"} buffer`),this.state===C.ENDED)this.resetLoadingState();else if(o){const g=n.maxFragLookUpTolerance,p=o.start-g,E=o.start+o.duration+g;if(f||Eu.end){const y=d>E;(dg&&(this.lastCurrentTime=d),!this.loadingParts){const p=Math.max(u.end,d),E=this.shouldLoadParts(this.getLevelDetails(),p);E&&(this.log(`LL-Part loading ON after seeking to ${d.toFixed(2)} with buffer @${p.toFixed(2)}`),this.loadingParts=E)}}this.hls.hasEnoughToStart||(this.log(`Setting ${f?"startPosition":"nextLoadPosition"} to ${d} for seek without enough to start`),this.nextLoadPosition=d,f&&(this.startPosition=d)),f&&this.state===C.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new $l(e.config),this.keyLoader=s,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Ii(e.config)}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===C.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=C.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const s=e.end||0,i=this.config.timelineOffset||0;if(s<=i)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=j.bufferedInfo(r,e.start,0));const n=e.nextStart;if(n&&n>i&&n{const n=r.frag;if(this.fragContextChanged(n)){this.warn(`${n.type} sn: ${n.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(n,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(n);return}n.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,s,i).then(r=>{if(!r)return;const n=this.state,o=r.frag;if(this.fragContextChanged(o)){(n===C.FRAG_LOADING||!this.fragCurrent&&n===C.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=C.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(m.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(`Frag error: ${r?.message||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:s}=this;if(s.getState(e)===ue.APPENDING){const r=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,n?n.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&s.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===ue.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return t?.live&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,s=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:s};this.hls.trigger(m.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(s=>{const i=s?.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{frag:r,payload:n}=s,o=r.decryptdata;if(n&&n.byteLength>0&&o!=null&&o.key&&o.iv&&St(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),o.key.buffer,o.iv.buffer,Ri(o.method)).catch(l=>{throw i.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:r}),l}).then(l=>{const h=self.performance.now();return i.trigger(m.FRAG_DECRYPTED,{frag:r,payload:l,stats:{tstart:c,tdecrypt:h}}),s.payload=l,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state!==C.STOPPED&&(this.state=C.IDLE),e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var s,i;const r=e.tracks;if(r&&!t.encrypted&&((s=r.audio)!=null&&s.encrypted||(i=r.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const n=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${n?"attached mediaKeys: "+n.mediaKeys:"detached"})`);return this.warn(o.message),!n||n.mediaKeys?!1:(this.hls.trigger(m.ERROR,{type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const s=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${s?uc.toString(j.getBuffered(s)):"(detached)"})`),he(e)){var i;if(e.type!==B.SUBTITLE){const n=e.elementaryStreams;if(!Object.keys(n).some(o=>!!n[o])){this.state=C.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=C.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:s,part:i,partsLoaded:r}=e,n=!r||r.length===0||r.some(c=>!c),o=new Li(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,s=null,i){var r;this.fragCurrent=e;const n=t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)){if(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=C.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(u=>{if(!this.fragContextChanged(u.frag))return this.hls.trigger(m.KEY_LOADED,u),this.state===C.KEY_LOADING&&(this.state=C.IDLE),u}),this.hls.trigger(m.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,n.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(he(e)&&(!c||e.sn!==c.sn)){const u=this.shouldLoadParts(t.details,e.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} loading sn ${c?.sn}->${e.sn}`),this.loadingParts=u)}if(s=Math.max(e.start,s||0),this.loadingParts&&he(e)){const u=n.partList;if(u&&i){s>n.fragmentEnd&&n.fragmentHint&&(e=n.fragmentHint);const f=this.getNextPart(u,e,s);if(f>-1){const g=u[f];e=this.fragCurrent=g.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${g.index} (${f}/${u.length-1}) of ${this.fragInfo(e,!1,g)}) cc: ${e.cc} [${n.startSN}-${n.endSN}], target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=g.start+g.duration,this.state=C.FRAG_LOADING;let p;return o?p=o.then(E=>!E||this.fragContextChanged(E.frag)?null:this.doFragPartsLoad(e,g,t,i)).catch(E=>this.handleFragLoadError(E)):p=this.doFragPartsLoad(e,g,t,i).catch(E=>this.handleFragLoadError(E)),this.hls.trigger(m.FRAG_LOADING,{frag:e,part:g,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):p}else if(!e.url||this.loadedEndOfParts(u,s))return Promise.resolve(null)}}if(he(e)&&this.loadingParts){var l;this.log(`LL-Part loading OFF after next part miss @${s.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(l=n.partList)==null?void 0:l.filter(u=>u.loaded).map(u=>`[${u.start}-${u.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+n.startSN+"-"+n.endSN+"]"}, target: ${parseFloat(s.toFixed(3))}`),M(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=C.FRAG_LOADING;const h=this.config.progressive&&e.type!==B.SUBTITLE;let d;return h&&o?d=o.then(u=>!u||this.fragContextChanged(u.frag)?null:this.fragmentLoader.load(e,i)).catch(u=>this.handleFragLoadError(u)):d=Promise.all([this.fragmentLoader.load(e,h?i:void 0),o]).then(([u])=>(!h&&i&&i(u),u)).catch(u=>this.handleFragLoadError(u)),this.hls.trigger(m.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):d}doFragPartsLoad(e,t,s,i){return new Promise((r,n)=>{var o;const c=[],l=(o=s.details)==null?void 0:o.partList,h=d=>{this.fragmentLoader.loadPart(e,d,i).then(u=>{c[d.index]=u;const f=u.part;this.hls.trigger(m.FRAG_LOADED,u);const g=Fr(s.details,e.sn,d.index+1)||zn(l,e.sn,d.index+1);if(g)h(g);else return r({frag:e,part:f,partsLoaded:c})}).catch(n)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===b.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===V.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(m.ERROR,t)}else this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==C.PARSING){!this.fragCurrent&&this.state!==C.STOPPED&&this.state!==C.ERROR&&(this.state=C.IDLE);return}const{frag:s,part:i,level:r}=t,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n);const o=this.getLevelDetails(),l=o&&s.sn>o.endSN||this.shouldLoadParts(o,s.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${s.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(s,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var s;const r=e.partList[0];if(r.fragment.type===B.SUBTITLE)return!1;const n=r.end+(((s=e.fragmentHint)==null?void 0:s.duration)||0);if(t>=n){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:s}=this,{level:i,sn:r,part:n}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],c=o.details,l=n>-1?Fr(c,r,n):null,h=l?l.fragment:qn(c,r,s);return h?(s&&s!==h&&(h.stats=s.stats),{frag:h,part:l,level:o}):null}bufferFragmentData(e,t,s,i,r){if(this.state!==C.PARSING)return;const{data1:n,data2:o}=e;let c=n;if(o&&(c=Pe(n,o)),!c.length)return;const l=this.initPTS[t.cc],h=l?-l.baseTime/l.timescale:void 0,d={type:e.type,frag:t,part:s,chunkMeta:i,offset:h,parent:t.type,data:c};if(this.hls.trigger(m.BUFFER_APPENDING,d),e.dropped&&e.independent&&!s){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!j.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const s=t.currentTime,i=j.bufferInfo(t,s,0),r=e.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-n,i.end-n),s+n);e.start-o>n&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var s;const i=this.getLoadPosition();if(!M(i))return null;const n=this.lastCurrentTime>i||(s=this.media)!=null&&s.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,n)}getFwdBufferInfoAtPos(e,t,s,i){const r=j.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(t,s);if(n&&(r.nextStart<=n.end||n.gap)){const o=Math.max(Math.min(r.nextStart,n.end)-t,i);return j.bufferInfo(e,t,o)}}return r}getMaxBufferLength(e){const{config:t}=this;let s;return e?s=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):s=t.maxBufferLength,Math.min(s,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const s=this.config,i=Math.max(Math.min(e-t,s.maxBufferLength),t),r=Math.max(e-t*3,s.maxMaxBufferLength/2,i);return r>=i?(s.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=B.MAIN){const s=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const s=t.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start,o=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const d=r.initialLiveManifestSize;if(i=n?u:f)||c.start:e;this.log(`Setting startPosition to ${g} to match start frag at live edge. mainStart: ${u} liveSyncPosition: ${f} frag.start: ${(l=c)==null?void 0:l.start}`),this.startPosition=this.nextLoadPosition=g}}else e<=n&&(c=s[0]);if(!c){const d=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,d,t)}let h=this.filterReplacedPrimary(c,t);if(!h&&c){const d=c.sn-t.startSN;h=this.filterReplacedPrimary(s[d+1]||null,t)}return this.mapToInitFragWhenRequired(h)}isLoopLoading(e,t){const s=this.fragmentTracker.getState(e);return(s===ue.OK||s===ue.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,s,i,r){let n=null;if(e.gap&&(n=this.getNextFragment(this.nextLoadPosition,t),n&&!n.gap&&s.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i,0);if(o!==null&&s.len+o.len>=r){const c=n.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,n}get primaryPrefetch(){if(Br(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Br(this.config)&&e.type!==B.SUBTITLE){const s=this.hls.interstitialsManager,i=s?.bufferingItem;if(i){const n=i.event;if(n){if(n.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&t?.live===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=s?.playerQueue;if(r)for(let n=r.length;n--;){const o=r[n].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,s){let i=-1,r=!1,n=!0;for(let o=0,c=e.length;o-1&&ss.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,s=this.fragPrevious;let i=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),i=_l(t,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=e.startSN&&r<=e.endSN){const n=t[r-e.startSN];s.cc===n.cc&&(i=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=On(e,s.cc,s.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:c}=s,{maxFragLookUpTolerance:l}=i,h=s.partList,d=!!(this.loadingParts&&h!=null&&h.length&&c);d&&!this.bitrateTest&&h[h.length-1].fragment.sn===c.sn&&(n=n.concat(c),o=c.sn);let u;if(et-l||(f=this.media)!=null&&f.paused||!this.startFragRequested?0:l;u=dt(r,n,e,p)}else u=n[n.length-1];if(u){const g=u.sn-s.startSN,p=this.fragmentTracker.getState(u);if((p===ue.OK||p===ue.PARTIAL&&u.gap)&&(r=u),r&&u.sn===r.sn&&(!d||h[0].fragment.sn>u.sn||!s.live)&&u.level===r.level){const y=n[g+1];u.sn${e.startSN} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let s=this.startPosition;s=0&&(s=this.nextLoadPosition),s}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&he(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==C.FRAG_LOADING_WAITING_RETRY)&&(this.state=C.IDLE)}onFragmentOrKeyLoadError(e,t){var s;if(t.chunkMeta&&!t.frag){const y=this.getCurrentContext(t.chunkMeta);y&&(t.frag=y.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const n=t.details===b.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction;if(!o){this.state=C.ERROR;return}const{action:c,flags:l,retryCount:h=0,retryConfig:d}=o,u=!!d,f=u&&c===me.RetryRequest,g=u&&!o.resolved&&l===Ie.MoveAllAlternatesMatchingHost,p=(s=this.hls.latestLevelDetails)==null?void 0:s.live;if(!f&&g&&he(i)&&!i.endList&&p&&!Mn(t))this.resetFragmentErrors(e),this.treatAsGap(i),o.resolved=!0;else if((f||g)&&h=t||s&&!ii(0))&&(s&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=C.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===C.PARSING||this.state===C.PARSED){const t=e.frag,s=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,s),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,t?.duration||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${s} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===B.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==C.STOPPED&&(this.state=C.IDLE)}afterBufferFlushed(e,t,s){if(!e)return;const i=j.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,s),this.state===C.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==C.STOPPED&&(this.state=C.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,s,i){const r=s.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,l)=>{const h=e.elementaryStreams[l];if(h){const d=h.endPTS-h.startPTS;if(d<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${d})`),c||!1;const u=i?0:Yn(r,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS,this);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:r,level:s,drift:u,type:l,frag:e,start:h.startPTS,end:h.endPTS}),!0}return c},!1)){var o;const c=((o=this.transmuxer)==null?void 0:o.error)===null;if((s.fragmentError===0||c&&(s.fragmentError<2||e.endList))&&this.treatAsGap(e,s),c){const l=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(l.message),this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=C.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(m.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===B.MAIN?"level":"track"}fragInfo(e,t=!0,s){var i,r;return`${this.playlistLabel()} ${e.level} (${s?"part":"frag"}:[${((i=t&&!s?e.startPTS:(s||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!s?e.endPTS:(s||e).end)!=null?r:NaN).toFixed(3)}]${s&&e.type==="main"?"INDEPENDENT="+(s.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Br(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Jn{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let s;if(e.length)e.length===1?s=e[0]:s=fc(e,t);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function fc(a,e){const t=new Uint8Array(e);let s=0;for(let i=0;i0)return a.subarray(t,t+s)}function vc(a,e,t,s){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],n=r>>2&15;if(n>12){const f=new Error(`invalid ADTS sampling index:${n}`);a.emit(m.ERROR,m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!0,error:f,reason:f.message});return}const o=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,l="mp4a.40."+o,h=i[n];let d=n;(o===5||o===29)&&(d-=3);const u=[o<<3|(d&14)>>1,(d&1)<<7|c<<3];return ie.log(`manifest codec:${s}, parsed codec:${l}, channels:${c}, rate:${h} (ADTS object type:${o} sampling index:${n})`),{config:u,samplerate:h,channelCount:c,codec:l,parsedCodec:l,manifestCodec:s}}function ta(a,e){return a[e]===255&&(a[e+1]&246)===240}function sa(a,e){return a[e+1]&1?7:9}function Pi(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function Sc(a,e){return e+5=a.length)return!1;const s=Pi(a,e);if(s<=t)return!1;const i=e+s;return i===a.length||vs(a,i)}return!1}function ia(a,e,t,s,i){if(!a.samplerate){const r=vc(e,t,s,i);if(!r)return;re(a,r)}}function ra(a){return 1024*9e4/a}function Ic(a,e){const t=sa(a,e);if(e+t<=a.length){const s=Pi(a,e)-t;if(s>0)return{headerLength:t,frameLength:s}}}function na(a,e,t,s,i){const r=ra(a.samplerate),n=s+i*r,o=Ic(e,t);let c;if(o){const{frameLength:d,headerLength:u}=o,f=u+d,g=Math.max(0,t+f-e.length);g?(c=new Uint8Array(f-u),c.set(e.subarray(t+u,e.length),0)):c=e.subarray(t+u,t+f);const p={unit:c,pts:n};return g||a.samples.push(p),{sample:p,length:f,missing:g}}const l=e.length-t;return c=new Uint8Array(l),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:n},length:l,missing:-1}}function Lc(a,e){return Ci(a,e)&&As(a,e+6)+10<=a.length-e}function Rc(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function Ms(a,e=0,t=1/0){return bc(a,e,t,Uint8Array)}function bc(a,e,t,s){const i=_c(a);let r=1;"BYTES_PER_ELEMENT"in s&&(r=s.BYTES_PER_ELEMENT);const n=Dc(a)?a.byteOffset:0,o=(n+a.byteLength)/r,c=(n+e)/r,l=Math.floor(Math.max(0,Math.min(c,o))),h=Math.floor(Math.min(l+Math.max(t,0),o));return new s(i,l,h-l)}function _c(a){return a instanceof ArrayBuffer?a:a.buffer}function Dc(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function Cc(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const s=a.data.subarray(1).indexOf(0);if(s===-1)return;const i=_e(Ms(a.data,1,s)),r=a.data[2+s],n=a.data.subarray(3+s).indexOf(0);if(n===-1)return;const o=_e(Ms(a.data,3+s,n));let c;return i==="-->"?c=_e(Ms(a.data,4+s+n)):c=Rc(a.data.subarray(4+s+n)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=c,e}function Pc(a){if(a.size<2)return;const e=_e(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function kc(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const s=_e(a.data.subarray(t),!0);t+=s.length+1;const i=_e(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=_e(a.data.subarray(1));return{key:a.type,info:"",data:e}}function wc(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const s=_e(a.data.subarray(t),!0);t+=s.length+1;const i=_e(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=_e(a.data);return{key:a.type,info:"",data:e}}function Oc(a){return a.type==="PRIV"?Pc(a):a.type[0]==="W"?wc(a):a.type==="APIC"?Cc(a):kc(a)}function Fc(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=As(a,4),s=10;return{type:e,size:t,data:a.subarray(s,s+t)}}const Yt=10,Mc=10;function aa(a){let e=0;const t=[];for(;Ci(a,e);){const s=As(a,e+6);a[e+5]>>6&1&&(e+=Yt),e+=Yt;const i=e+s;for(;e+Mc0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Re.audioId3,duration:Number.POSITIVE_INFINITY});i{if(M(a))return a*90;const s=t?t.baseTime*9e4/t.timescale:0;return e*9e4+s};let Wt=null;const Uc=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],$c=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Gc=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Kc=[0,1,1,4];function la(a,e,t,s,i){if(t+24>e.length)return;const r=ca(e,t);if(r&&t+r.frameLength<=e.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,c={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function ca(a,e){const t=a[e+1]>>3&3,s=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const n=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-s:s===3?3:4,l=Uc[c*14+i-1]*1e3,d=$c[(t===3?0:t===2?1:2)*3+r],u=o===3?1:2,f=Gc[t][s],g=Kc[s],p=f*8*g,E=Math.floor(f*l/d+n)*g;if(Wt===null){const v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Wt=v?parseInt(v[1]):0}return Wt&&Wt<=87&&s===2&&l>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:d,channelCount:u,frameLength:E,samplesPerFrame:p}}}function Oi(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function ha(a,e){return e+1{let t=0,s=5;e+=s;const i=new Uint32Array(1),r=new Uint32Array(1),n=new Uint8Array(1);for(;s>0;){n[0]=a[e];const o=Math.min(s,8),c=8-o;r[0]=4278190080>>>24+c<>c,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],c=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+h>e.length)return-1;const d=e[t+6]>>5;let u=0;d===2?u+=2:(d&1&&d!==1&&(u+=2),d&4&&(u+=2));const f=(e[t+6]<<8|e[t+7])>>12-u&1,p=[2,1,2,3,3,4,4,5][d]+f,E=e[t+5]>>3,y=e[t+5]&7,T=new Uint8Array([r<<6|E<<1|y>>2,(y&3)<<6|d<<3|f<<2|c>>4,c<<4&224]),v=1536/o*9e4,S=s+i*v,x=e.subarray(t,t+h);return a.config=T,a.channelCount=p,a.samplerate=o,a.samples.push({unit:x,pts:S}),h}class Wc extends wi{resetInitSegment(e,t,s,i){super.resetInitSegment(e,t,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Nt(e,0);let s=t?.length||0;if(t&&e[s]===11&&e[s+1]===119&&ki(t)!==void 0&&ua(e,s)<=16)return!1;for(let i=e.length;s{const n=el(r);if(jc.test(n.schemeIdUri)){const o=$r(n,t);let c=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const l=n.payload;s.samples.push({data:l,len:l.byteLength,dts:o,pts:o,type:Re.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&n.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=$r(n,t);s.samples.push({data:n.payload,len:n.payload.byteLength,dts:o,pts:o,type:Re.misbklv,duration:Number.POSITIVE_INFINITY})}})}return s}demuxSampleAes(e,t,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function $r(a,e){return M(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class zc{constructor(e,t,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new Ii(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,it.cbc)}decryptAacSample(e,t,s){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(o=>{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,s)}).catch(s)}decryptAacSamples(e,t,s){for(;;t++){if(t>=e.length){s();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(t);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,s+1,i)}).catch(i)}decryptAvcSamples(e,t,s,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,s=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(e,t,s,i,n),!this.decrypter.isSync()))return}}}}class ga{constructor(){this.VideoSample=null}createVideoSample(e,t,s){return{key:e,frame:!1,pts:t,dts:s,units:[],length:0}}getLastNalUnit(e){var t;let s=this.VideoSample,i;if((!s||s.units.length===0)&&(s=e[e.length-1]),(t=s)!=null&&t.units){const r=s.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const s=t.samples,i=s.length;if(i){const r=s[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,s){const i=t.byteLength;let r=e.naluState||0;const n=r,o=[];let c=0,l,h,d,u=-1,f=0;for(r===-1&&(u=0,f=this.getNALuType(t,0),r=0,c=1);c=0){const g={data:t.subarray(u,h),type:f};o.push(g)}else{const g=this.getLastNalUnit(e.samples);g&&(n&&c<=4-n&&g.state&&(g.data=g.data.subarray(0,g.data.byteLength-n)),h>0&&(g.data=Pe(g.data,t.subarray(0,h)),g.state=0))}c=0&&r>=0){const g={data:t.subarray(u,i),type:f,state:r};o.push(g)}if(o.length===0){const g=this.getLastNalUnit(e.samples);g&&(g.data=Pe(g.data,t))}return e.naluState=r,o}}class Pt{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,s=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(s,s+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const s=this.word>>>32-t;if(e>32&&ie.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?s<>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Xc extends ga{parsePES(e,t,s,i){const r=this.parseNALu(e,s.data,i);let n=this.VideoSample,o,c=!1;s.data=null,n&&r.length&&!e.audFound&&(this.pushAccessUnit(n,e),n=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),r.forEach(l=>{var h,d;switch(l.type){case 1:{let p=!1;o=!0;const E=l.data;if(c&&E.length>4){const y=this.readSliceType(E);(y===2||y===4||y===7||y===9)&&(p=!0)}if(p){var u;(u=n)!=null&&u.frame&&!n.key&&(this.pushAccessUnit(n,e),n=this.VideoSample=null)}n||(n=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),n.frame=!0,n.key=p;break}case 5:o=!0,(h=n)!=null&&h.frame&&!n.key&&(this.pushAccessUnit(n,e),n=this.VideoSample=null),n||(n=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),n.key=!0,n.frame=!0;break;case 6:{o=!0,vi(l.data,1,s.pts,t.samples);break}case 7:{var f,g;o=!0,c=!0;const p=l.data,E=this.readSPS(p);if(!e.sps||e.width!==E.width||e.height!==E.height||((f=e.pixelRatio)==null?void 0:f[0])!==E.pixelRatio[0]||((g=e.pixelRatio)==null?void 0:g[1])!==E.pixelRatio[1]){e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.sps=[p];const y=p.subarray(1,4);let T="avc1.";for(let v=0;v<3;v++){let S=y[v].toString(16);S.length<2&&(S="0"+S),T+=S}e.codec=T}break}case 8:o=!0,e.pps=[l.data];break;case 9:o=!0,e.audFound=!0,(d=n)!=null&&d.frame&&(this.pushAccessUnit(n,e),n=null),n||(n=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;case 12:o=!0;break;default:o=!1;break}n&&o&&n.units.push(l)}),i&&n&&(this.pushAccessUnit(n,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Pt(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let s=8,i=8,r;for(let n=0;n{var h,d;switch(l.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:n||(n=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),n.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var u;(u=n)!=null&&u.frame&&!n.key&&(this.pushAccessUnit(n,e),n=this.VideoSample=null)}n||(n=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),n.key=!0,n.frame=!0;break;case 19:case 20:o=!0,(h=n)!=null&&h.frame&&!n.key&&(this.pushAccessUnit(n,e),n=this.VideoSample=null),n||(n=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),n.key=!0,n.frame=!0;break;case 39:o=!0,vi(l.data,2,s.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=re(e.params,this.readVPS(l.data)),this.initVPS=l.data),e.vps=[l.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],l.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const f=this.readSPS(l.data);e.width=f.width,e.height=f.height,e.pixelRatio=f.pixelRatio,e.codec=f.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const g in f.params)e.params[g]=f.params[g]}this.pushParameterSet(e.sps,l.data,e.vps),n||(n=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),n.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const f=this.readPPS(l.data);for(const g in f)e.params[g]=f[g]}this.pushParameterSet(e.pps,l.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(d=n)!=null&&d.frame&&(this.pushAccessUnit(n,e),n=null),n||(n=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;default:o=!1;break}n&&o&&n.units.push(l)}),i&&n&&(this.pushAccessUnit(n,e),this.VideoSample=null)}pushParameterSet(e,t,s){(s&&s[0]===this.initVPS||!s&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let s=0;for(let i=0;i=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[s]=e[i],s++);return new Uint8Array(t.buffer,0,s)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Pt(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const s=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:s+1,temporalIdNested:i}}readSPS(e){const t=new Pt(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const s=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),n=t.readBits(5),o=t.readUByte(),c=t.readUByte(),l=t.readUByte(),h=t.readUByte(),d=t.readUByte(),u=t.readUByte(),f=t.readUByte(),g=t.readUByte(),p=t.readUByte(),E=t.readUByte(),y=t.readUByte(),T=[],v=[];for(let J=0;J0)for(let J=s;J<8;J++)t.readBits(2);for(let J=0;J1&&t.readEG();for(let ut=0;ut0&&at<16?(O=Ki[at-1],q=$t[at-1]):at===255&&(O=t.readBits(16),q=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),ye=t.readBoolean(),ye&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(z=t.readBits(32),Z=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const $t=t.readBoolean(),Vi=t.readBoolean();let Rt=!1;($t||Vi)&&(Rt=t.readBoolean(),Rt&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Rt&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Hi=0;Hi<=s;Hi++){ee=t.readBoolean();const qa=ee||t.readBoolean();let Yi=!1;qa?t.readEG():Yi=t.readBoolean();const Wi=Yi?1:t.readUEG()+1;if($t)for(let bt=0;bt>J&1)<<31-J)>>>0;let Rs=Ls.toString(16);return n===1&&Rs==="2"&&(Rs="6"),{codecString:`hvc1.${rt}${n}.${Rs}.${r?"H":"L"}${y}.B0`,params:{general_tier_flag:r,general_profile_idc:n,general_profile_space:i,general_profile_compatibility_flags:[o,c,l,h],general_constraint_indicator_flags:[d,u,f,g,p,E],general_level_idc:y,bit_depth:F+8,bit_depth_luma_minus8:F,bit_depth_chroma_minus8:U,min_spatial_segmentation_idc:w,chroma_format_idc:S,frame_rate:{fixed:ee,fps:Z/z}},width:De,height:Ne,pixelRatio:[O,q]}}readPPS(e){const t=new Pt(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),r=t.readBoolean();let n=1;return r&&i?n=0:r?n=3:i&&(n=2),{parallelismType:n}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const fe=188;class et{constructor(e,t,s,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.logger=i,this.videoParser=null}static probe(e,t){const s=et.syncOffset(e);return s>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(e){const t=e.length;let s=Math.min(fe*5,t-fe)+1,i=0;for(;i1&&(n===0&&o>2||c+fe>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:vn[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=et.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=et.createTrack("audio",i),this._id3Track=et.createTrack("id3"),this._txtTrack=et.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=s}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:s}=this;e&&(e.pesData=null),t&&(t.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._videoTrack,o=this._audioTrack,c=this._id3Track,l=this._txtTrack;let h=n.pid,d=n.pesData,u=o.pid,f=c.pid,g=o.pesData,p=c.pesData,E=null,y=this.pmtParsed,T=this._pmtId,v=e.length;if(this.remainderData&&(e=Pe(this.remainderData,e),v=e.length,this.remainderData=null),v>4;let P;if(I>1){if(P=A+5+e[A+4],P===A+fe)continue}else P=A+4;switch(_){case h:R&&(d&&(r=pt(d,this.logger))&&(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(n,l,r,!1)),d={data:[],size:0}),d&&(d.data.push(e.subarray(P,A+fe)),d.size+=A+fe-P);break;case u:if(R){if(g&&(r=pt(g,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}g={data:[],size:0}}g&&(g.data.push(e.subarray(P,A+fe)),g.size+=A+fe-P);break;case f:R&&(p&&(r=pt(p,this.logger))&&this.parseID3PES(c,r),p={data:[],size:0}),p&&(p.data.push(e.subarray(P,A+fe)),p.size+=A+fe-P);break;case 0:R&&(P+=e[P]+1),T=this._pmtId=Zc(e,P);break;case T:{R&&(P+=e[P]+1);const F=Jc(e,P,this.typeSupported,s,this.observer,this.logger);h=F.videoPid,h>0&&(n.pid=h,n.segmentCodec=F.segmentVideoCodec),u=F.audioPid,u>0&&(o.pid=u,o.segmentCodec=F.segmentAudioCodec),f=F.id3Pid,f>0&&(c.pid=f),E!==null&&!y&&(this.logger.warn(`MPEG-TS PMT found at ${A} after unknown PID '${E}'. Backtracking to sync byte @${S} to parse all TS packets.`),E=null,A=S-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:E=_;break}}else x++;x>0&&ci(this.observer,new Error(`Found ${x} TS packet/s that do not start with 0x47`),void 0,this.logger),n.pesData=d,o.pesData=g,c.pesData=p;const D={audioTrack:o,videoTrack:n,id3Track:c,textTrack:l};return i&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:s,id3Track:i,textTrack:r}=e,n=s.pesData,o=t.pesData,c=i.pesData;let l;if(n&&(l=pt(n,this.logger))?(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(s,r,l,!0),s.pesData=null)):s.pesData=n,o&&(l=pt(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(l=pt(c,this.logger))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,s){const i=this.demux(e,s,!0,!this.config.progressive),r=this.sampleAes=new zc(this.observer,this.config,t);return this.decrypt(i,r)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Xc:e==="hevc"&&(this.videoParser=new Qc))}decrypt(e,t){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{s(e)}):s(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{s(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let s=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const d=i.missing,u=i.sample.unit.byteLength;if(d===-1)r=Pe(i.sample.unit,r);else{const f=u-d;i.sample.unit.set(r.subarray(0,d),f),e.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=re({},t,{type:this._videoTrack?Re.emsg:Re.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function li(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Zc(a,e){return(a[e+10]&31)<<8|a[e+11]}function Jc(a,e,t,s,i,r){const n={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e0){let u=e+5,f=d;for(;f>2;){a[u]===106&&(t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(n.audioPid=h,n.segmentAudioCodec="ac3"));const p=a[u+1]+2;u+=p,f-=p}}break;case 194:case 135:return ci(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),n;case 36:n.videoPid===-1&&(n.videoPid=h,n.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=d+5}return n}function ci(a,e,t,s){s.warn(`parsing error: ${e.message}`),a.emit(m.ERROR,m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Ns(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function pt(a,e){let t=0,s,i,r,n,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Pe(c[0],c[1]),c.splice(1,1);if(s=c[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(i=(s[4]<<8)+s[5],i&&i>a.size-6)return null;const h=s[7];h&192&&(n=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,h&64?(o=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,n-o>60*9e4&&(e.warn(`${Math.round((n-o)/9e4)}s delta between PTS and DTS, align them`),n=o)):o=n),r=s[8];let d=r+9;if(a.size<=d)return null;a.size-=d;const u=new Uint8Array(a.size);for(let f=0,g=c.length;fp){d-=p;continue}else s=s.subarray(d),p-=d,d=0;u.set(s,t),t+=p}return i&&(i-=r+3),{data:u,pts:n,dts:o,len:i}}return null}class eh{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Qe=Math.pow(2,32)-1;class L{static init(){L.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in L.types)L.types.hasOwnProperty(e)&&(L.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),s=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);L.HDLR_TYPES={video:t,audio:s};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=r,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const n=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,n,c,n,o),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,i))}static box(e,...t){let s=8,i=t.length;const r=i;for(;i--;)s+=t[i].byteLength;const n=new Uint8Array(s);for(n[0]=s>>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(e,4),i=0,s=8;i>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return L.box(L.types.mdia,L.mdhd(e.timescale||0,e.duration||0),L.hdlr(e.type),L.minf(e))}static mfhd(e){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(e)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(e))}static moof(e,t,s){return L.box(L.types.moof,L.mfhd(e),L.traf(s,t))}static moov(e){let t=e.length;const s=[];for(;t--;)s[t]=L.trak(e[t]);return L.box.apply(null,[L.types.moov,L.mvhd(e[0].timescale||0,e[0].duration||0)].concat(s).concat(L.mvex(e)))}static mvex(e){let t=e.length;const s=[];for(;t--;)s[t]=L.trex(e[t]);return L.box.apply(null,[L.types.mvex,...s])}static mvhd(e,t){t*=e;const s=Math.floor(t/(Qe+1)),i=Math.floor(t%(Qe+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return L.box(L.types.mvhd,r)}static sdtp(e){const t=e.samples||[],s=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(n&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=L.box(L.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(s))),c=e.width,l=e.height,h=e.pixelRatio[0],d=e.pixelRatio[1];return L.box(L.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,d>>24,d>>16&255,d>>8&255,d&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return L.box(L.types.mp4a,L.audioStsd(e),L.box(L.types.esds,L.esds(e)))}static mp3(e){return L.box(L.types[".mp3"],L.audioStsd(e))}static ac3(e){return L.box(L.types["ac-3"],L.audioStsd(e),L.box(L.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return L.box(L.types.stsd,L.STSD,L.mp4a(e));if(t==="ac3"&&e.config)return L.box(L.types.stsd,L.STSD,L.ac3(e));if(t==="mp3"&&e.codec==="mp3")return L.box(L.types.stsd,L.STSD,L.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return L.box(L.types.stsd,L.STSD,L.avc1(e));if(t==="hevc"&&e.vps)return L.box(L.types.stsd,L.STSD,L.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,s=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,n=Math.floor(s/(Qe+1)),o=Math.floor(s%(Qe+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const s=L.sdtp(e),i=e.id,r=Math.floor(t/(Qe+1)),n=Math.floor(t%(Qe+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),L.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,L.box(L.types.trak,L.tkhd(e),L.mdia(e))}static trex(e){const t=e.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const s=e.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,c,l,h,d,u;for(t+=8+r,n.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,l>>>16&255,l>>>8&255,l&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&61440,d.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*o);return L.box(L.types.trun,n)}static initSegment(e){L.types||L.init();const t=L.moov(e);return Pe(L.FTYP,t)}static hvc1(e){const t=e.params,s=[e.vps,e.sps,e.pps],i=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),s.length]);let n=r.length;for(let g=0;g>8,s[g][p].length&255]),n),n+=2,o.set(s[g][p],n),n+=s[g][p].length}const l=L.box(L.types.hvcC,o),h=e.width,d=e.height,u=e.pixelRatio[0],f=e.pixelRatio[1];return L.box(L.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h>>8&255,h&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255])))}}L.types=void 0;L.HDLR_TYPES=void 0;L.STTS=void 0;L.STSC=void 0;L.STCO=void 0;L.STSZ=void 0;L.VMHD=void 0;L.SMHD=void 0;L.STSD=void 0;L.FTYP=void 0;L.DINF=void 0;const ma=9e4;function Fi(a,e,t=1,s=!1){const i=a*e*t;return s?Math.round(i):i}function th(a,e,t=1,s=!1){return Fi(a,e,1/t,s)}function _t(a,e=!1){return Fi(a,1e3,1/ma,e)}function sh(a,e=1){return Fi(a,ma,1/e)}function Gr(a){const{baseTime:e,timescale:t,trackId:s}=a;return`${e/t} (${e}/${t}) trackId: ${s}`}const ih=10*1e3,rh=1024,nh=1152,ah=1536;let Et=null,Bs=null;function Kr(a,e,t,s){return{duration:e,size:t,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class as extends ke{constructor(e,t,s,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.ISGenerated=!1,Et===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Et=n?parseInt(n[1]):0}if(Bs===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Bs=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&Gr(t)} > ${e&&Gr(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const s=e[0].pts,i=e.reduce((r,n)=>{let o=n.pts,c=o-r;return c<-4294967296&&(t=!0,o=Le(o,s),c=o-r),c>0?r:o},s);return t&&this.debug("PTS rollover detected"),i}remux(e,t,s,i,r,n,o,c){let l,h,d,u,f,g,p=r,E=r;const y=e.pid>-1,T=t.pid>-1,v=t.samples.length,S=e.samples.length>0,x=o&&v>0||v>1;if((!y||S)&&(!T||x)||this.ISGenerated||o){if(this.ISGenerated){var A,R,_,I;const H=this.videoTrackConfig;(H&&(t.width!==H.width||t.height!==H.height||((A=t.pixelRatio)==null?void 0:A[0])!==((R=H.pixelRatio)==null?void 0:R[0])||((_=t.pixelRatio)==null?void 0:_[1])!==((I=H.pixelRatio)==null?void 0:I[1]))||!H&&x||this.nextAudioTs===null&&S)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(e,t,r,n));const P=this.isVideoContiguous;let F=-1,U;if(x&&(F=oh(t.samples),!P&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,F>0){this.warn(`Dropped ${F} out of ${v} video samples due to a missing keyframe`);const H=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(F),t.dropped+=F,E+=(t.samples[0].pts-H)/t.inputTimeScale,U=E}else F===-1&&(this.warn(`No keyframe found out of ${v} video samples`),g=!1);if(this.ISGenerated){if(S&&x){const H=this.getVideoStartPts(t.samples),k=(Le(e.samples[0].pts,H)-H)/t.inputTimeScale;p+=Math.max(0,k),E+=Math.max(0,-k)}if(S){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),d=this.generateIS(e,t,r,n)),h=this.remuxAudio(e,p,this.isAudioContiguous,n,T||x||c===B.AUDIO?E:void 0),x){const H=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),d=this.generateIS(e,t,r,n)),l=this.remuxVideo(t,E,P,H)}}else x&&(l=this.remuxVideo(t,E,P,0));l&&(l.firstKeyFrame=F,l.independent=F!==-1,l.firstKeyFramePTS=U)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(f=pa(s,r,this._initPTS,this._initDTS)),i.samples.length&&(u=Ea(i,r,this._initPTS))),{audio:h,video:l,initSegment:d,independent:g,text:u,id3:f}}computeInitPts(e,t,s,i){const r=Math.round(s*t);let n=Le(e,r);if(n0?w-1:w].dts&&(T=!0)}T&&n.sort(function(w,O){const q=w.dts-O.dts,ee=w.pts-O.pts;return q||ee}),g=n[0].dts,p=n[n.length-1].dts;const S=p-g,x=S?Math.round(S/(c-1)):f||e.inputTimeScale/30;if(s){const w=g-v,O=w>x,q=w<-1;if((O||q)&&(O?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${_t(w,!0)} ms (${w}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${_t(-w,!0)} ms (${w}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!q||v>=n[0].pts||Et)){g=v;const ee=n[0].pts-w;if(O)n[0].dts=g,n[0].pts=ee;else{let z=!0;for(let Z=0;Zee&&z);Z++){const ye=n[Z].pts;if(n[Z].dts-=w,n[Z].pts-=w,Z0?O.dts-n[w-1].dts:x;if(z=w>0?O.pts-n[w-1].pts:x,ye.stretchShortVideoTrack&&this.nextAudioTs!==null){const De=Math.floor(ye.maxBufferHole*r),Ne=(i?E+i*r:this.nextAudioTs+h)-O.pts;Ne>De?(f=Ne-ge,f<0?f=ge:F=!0,this.log(`It is approximately ${Ne/90} ms to the next segment; using duration ${f/90} ms for the last video frame.`)):f=ge}else f=ge}const Z=Math.round(O.pts-O.dts);U=Math.min(U,f),$=Math.max($,f),H=Math.min(H,z),k=Math.max(k,z),o.push(Kr(O.key,f,ee,Z))}if(o.length){if(Et){if(Et<70){const w=o[0].flags;w.dependsOn=2,w.isNonSync=0}}else if(Bs&&k-H<$-U&&x/$<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let w=g;for(let O=0,q=o.length;O0&&(i&&Math.abs(v-(y+T))<9e3||Math.abs(Le(p[0].pts,v)-(y+T))<20*h),p.forEach(function(k){k.pts=Le(k.pts,v)}),!s||y<0){const k=p.length;if(p=p.filter(G=>G.pts>=0),k!==p.length&&this.warn(`Removed ${p.length-k} of ${k} samples (initPTS ${T} / ${n})`),!p.length)return;r===0?y=0:i&&!g?y=Math.max(0,v-T):y=p[0].pts-T}if(e.segmentCodec==="aac"){const k=this.config.maxAudioFramesDrift;for(let G=0,N=y+T;G=k*h&&O0){A+=E;try{D=new Uint8Array(A)}catch(O){this.observer.emit(m.ERROR,m.ERROR,{type:V.MUX_ERROR,details:b.REMUX_ALLOC_ERROR,fatal:!1,error:O,bytes:A,reason:`fail allocating audio mdat ${A}`});return}u||(new DataView(D.buffer).setUint32(0,A),D.set(L.types.mdat,4))}else return;D.set(K,E);const w=K.byteLength;E+=w,f.push(Kr(!0,l,w,0)),x=Y}const _=f.length;if(!_)return;const I=f[f.length-1];y=x-T,this.nextAudioTs=y+c*I.duration;const P=u?new Uint8Array(0):L.moof(e.sequenceNumber++,S/c,re({},e,{samples:f}));e.samples=[];const F=(S-T)/n,U=this.nextAudioTs/n,$={data1:P,data2:D,startPTS:F,endPTS:U,startDTS:F,endDTS:U,type:"audio",hasAudio:!0,hasVideo:!1,nb:_};return this.isAudioContiguous=!0,$}}function Le(a,e){let t;if(e===null)return a;for(e4294967296;)a+=t;return a}function oh(a){for(let e=0;en.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class lh extends ke{constructor(e,t,s,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,s,i){this.audioCodec=t,this.videoCodec=s,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:s,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:r,video:n}=this.initData=An(e);if(t)zo(e,t);else{const c=r||n;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}r&&(s=Vr(r,ne.AUDIO,this)),n&&(i=Vr(n,ne.VIDEO,this));const o={};r&&n?o.audiovideo={container:"video/mp4",codec:s+","+i,supplemental:n.supplemental,encrypted:n.encrypted,initSegment:e,id:"main"}:r?o.audio={container:"audio/mp4",codec:s,encrypted:r.encrypted,initSegment:e,id:"audio"}:n?o.video={container:"video/mp4",codec:i,supplemental:n.supplemental,encrypted:n.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,s,i,r,n){var o,c;let{initPTS:l,lastEndTime:h}=this;const d={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};M(h)||(h=this.lastEndTime=r||0);const u=t.samples;if(!u.length)return d;const f={initPTS:void 0,timescale:void 0,trackId:void 0};let g=this.initData;if((o=g)!=null&&o.length||(this.generateInitSegment(u),g=this.initData),!((c=g)!=null&&c.length))return this.warn("Failed to generate initSegment."),d;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const p=Qo(u,g,this),E=g.audio?p[g.audio.id]:null,y=g.video?p[g.video.id]:null,T=jt(y,1/0),v=jt(E,1/0),S=jt(y,0,!0),x=jt(E,0,!0);let D=r,A=0;const R=E&&(!y||!l&&v0?this.lastEndTime=P:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const F=!!g.audio,U=!!g.video;let H="";F&&(H+="audio"),U&&(H+="video");const $=(g.audio?g.audio.encrypted:!1)||(g.video?g.video.encrypted:!1),k={data1:u,startPTS:I,startDTS:I,endPTS:P,endDTS:P,type:H,hasAudio:F,hasVideo:U,nb:1,dropped:0,encrypted:$};d.audio=F&&!U?k:void 0,d.video=U?k:void 0;const G=y?.sampleCount;if(G){const N=y.keyFrameIndex,K=N!==-1;k.nb=G,k.dropped=N===0||this.isVideoContiguous?0:K?N:G,k.independent=K,k.firstKeyFrame=N,K&&y.keyFrameStart&&(k.firstKeyFramePTS=(y.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(d.independent=K),this.isVideoContiguous||(this.isVideoContiguous=K),k.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${N}/${G} dropped: ${k.dropped} start: ${k.firstKeyFramePTS||"NA"}`)}return d.initSegment=f,d.id3=pa(s,r,l,l),i.samples.length&&(d.text=Ea(i,r,l)),d}}function jt(a,e,t=!1){return a?.start!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function ch(a,e,t,s){if(a===null)return!0;const i=Math.max(s,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Vr(a,e,t){const s=a.codec;return s&&s.length>4?s:e===ne.AUDIO?s==="ec-3"||s==="ac-3"||s==="alac"?s:s==="fLaC"||s==="Opus"?us(s,!1):(t.warn(`Unhandled audio codec "${s}" in mp4 MAP`),s||"mp4a"):(t.warn(`Unhandled video codec "${s}" in mp4 MAP`),s||"avc1")}let Xe;try{Xe=self.performance.now.bind(self.performance)}catch{Xe=Date.now}const os=[{demux:qc,remux:lh},{demux:et,remux:as},{demux:Hc,remux:as},{demux:Wc,remux:as}];os.splice(2,0,{demux:Yc,remux:as});class Hr{constructor(e,t,s,i,r,n){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=s,this.id=r,this.logger=n}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,s,i){const r=s.transmuxing;r.executeStart=Xe();let n=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:h,trackSwitch:d,accurateTimeOffset:u,timeOffset:f,initSegmentChange:g}=i||o,{audioCodec:p,videoCodec:E,defaultInitPts:y,duration:T,initSegmentData:v}=c,S=hh(n,t);if(S&&St(S.method)){const R=this.getDecrypter(),_=Ri(S.method);if(R.isSync()){let I=R.softwareDecrypt(n,S.key.buffer,S.iv.buffer,_);if(s.part>-1){const F=R.flush();I=F&&F.buffer}if(!I)return r.executeEnd=Xe(),Us(s);n=new Uint8Array(I)}else return this.asyncResult=!0,this.decryptionPromise=R.webCryptoDecrypt(n,S.key.buffer,S.iv.buffer,_).then(I=>{const P=this.push(I,null,s);return this.decryptionPromise=null,P}),this.decryptionPromise}const x=this.needsProbing(h,d);if(x){const R=this.configureTransmuxer(n);if(R)return this.logger.warn(`[transmuxer] ${R.message}`),this.observer.emit(m.ERROR,m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message}),r.executeEnd=Xe(),Us(s)}(h||d||g||x)&&this.resetInitSegment(v,p,E,T,t),(h||g||x)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const D=this.transmux(n,S,f,u,s);this.asyncResult=Bt(D);const A=this.currentTransmuxState;return A.contiguous=!0,A.discontinuity=!1,A.trackSwitch=!1,r.executeEnd=Xe(),D}flush(e){const t=e.transmuxing;t.executeStart=Xe();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const n=[],{timeOffset:o}=i;if(s){const d=s.flush();d&&n.push(this.push(d.buffer,null,e))}const{demuxer:c,remuxer:l}=this;if(!c||!l){t.executeEnd=Xe();const d=[Us(e)];return this.asyncResult?Promise.resolve(d):d}const h=c.flush(o);return Bt(h)?(this.asyncResult=!0,h.then(d=>(this.flushRemux(n,d,e),n))):(this.flushRemux(n,h,e),this.asyncResult?Promise.resolve(n):n)}flushRemux(e,t,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${s.sn}${s.part>-1?" part: "+s.part:""} of ${this.id===B.MAIN?"level":"track"} ${s.level}`);const h=this.remuxer.remux(i,r,n,o,l,c,!0,this.id);e.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=Xe()}resetInitialTimestamp(e){const{demuxer:t,remuxer:s}=this;!t||!s||(t.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(e,t,s,i),o.resetInitSegment(e,t,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,s,i,r){let n;return t&&t.method==="SAMPLE-AES"?n=this.transmuxSampleAes(e,t,s,i,r):n=this.transmuxUnencrypted(e,s,i,r),n}transmuxUnencrypted(e,t,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,c,t,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,s,i,r){return this.demuxer.demuxSampleAes(e,t,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:s,typeSupported:i}=this;let r;for(let d=0,u=os.length;d0&&e?.key!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Us=a=>({remuxResult:{},chunkMeta:a});function Bt(a){return"then"in a&&a.then instanceof Function}class dh{constructor(e,t,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class uh{constructor(e,t,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}let Yr=0;class ya{constructor(e,t,s,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Yr++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const l=c.data,h=this.hls;if(!(!h||!(l!=null&&l.event)||l.instanceNo!==this.instanceNo))switch(l.event){case"init":{var d;const u=(d=this.workerContext)==null?void 0:d.objectURL;u&&self.URL.revokeObjectURL(u);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}case"workerLog":{h.logger[l.data.logType]&&h.logger[l.data.logType](l.data.message);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.part=this.part,l.data.id=this.id,h.trigger(l.event,l.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const l=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:l})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=s,this.onFlush=i;const n=(c,l)=>{l=l||{},l.frag=this.frag||void 0,c===m.ERROR&&(l=l,l.parent=this.id,l.part=this.part,this.error=l.error),this.hls.trigger(c,l)};this.observer=new Di,this.observer.on(m.FRAG_DECRYPTED,n),this.observer.on(m.ERROR,n);const o=ar(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const c=this.hls.logger;if(r.workerPath||pc()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=yc(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=Ec());const{worker:h}=this.workerContext;h.addEventListener("message",this.onWorkerMessage),h.addEventListener("error",this.onWorkerError),h.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:ae(r)})}catch(h){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.terminateWorker(),this.error=null,this.transmuxer=new Hr(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new Hr(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Yr++;const t=this.hls.config,s=ar(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:s,id:this.id,config:ae(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Tc(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,s,i,r,n,o,c,l,h){var d,u;l.transmuxing.start=self.performance.now();const{instanceNo:f,transmuxer:g}=this,p=n?n.start:r.start,E=r.decryptdata,y=this.frag,T=!(y&&r.cc===y.cc),v=!(y&&l.level===y.level),S=y?l.sn-y.sn:-1,x=this.part?l.part-this.part.index:-1,D=S===0&&l.id>1&&l.id===y?.stats.chunkCount,A=!v&&(S===1||S===0&&(x===1||D&&x<=0)),R=self.performance.now();(v||S||r.stats.parsing.start===0)&&(r.stats.parsing.start=R),n&&(x||!A)&&(n.stats.parsing.start=R);const _=!(y&&((d=r.initSegment)==null?void 0:d.url)===((u=y.initSegment)==null?void 0:u.url)),I=new uh(T,A,c,v,p,_);if(!A||T||_){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===B.MAIN?"level":"track"}: ${l.level} id: ${l.id} - discontinuity: ${T} - trackSwitch: ${v} - contiguous: ${A} - accurateTimeOffset: ${c} - timeOffset: ${p} - initSegmentChange: ${_}`);const P=new dh(s,i,t,o,h);this.configureTransmuxer(P)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({instanceNo:f,cmd:"demux",data:e,decryptdata:E,chunkMeta:l,state:I},e instanceof ArrayBuffer?[e]:[]);else if(g){const P=g.push(e,E,l,I);Bt(P)?P.then(F=>{this.handleTransmuxComplete(F)}).catch(F=>{this.transmuxerError(F,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(P)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(s){const i=s.flush(e);Bt(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,s){this.hls&&(this.error=e,this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,t){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):s&&s.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Wr=100;class fh extends _i{constructor(e,t,s){super(e,t,s,"audio-stream-controller",B.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r,trackId:n}){if(s===B.MAIN){const o=t.cc,c=this.fragCurrent;if(this.initPTS[o]={baseTime:i,timescale:r,trackId:n},this.log(`InitPTS for cc: ${o} found from main: ${i/r} (${i}/${r}) trackId: ${n}`),this.mainAnchor=t,this.state===C.WAITING_INIT_PTS){const l=this.waitingData;(!l&&!this.loadingParts||l&&l.frag.cc!==o)&&this.syncWithAnchor(t,l?.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==o?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===C.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var s;const i=((s=this.mainFragLoading)==null?void 0:s.frag)||null;if(t&&i?.cc===t.cc)return;const r=(i||e).cc,n=this.getLevelDetails(),o=this.getLoadPosition(),c=On(n,r,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===C.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=C.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(Wr),s>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s,this.state=C.IDLE):this.state=C.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case C.IDLE:this.doTickIdle();break;case C.WAITING_TRACK:{const{levels:e,trackId:t}=this,s=e?.[t],i=s?.details;if(i&&!this.waitForLive(s)){if(this.waitForCdnTuneIn(i))break;this.state=C.WAITING_INIT_PTS}break}case C.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case C.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:s,cache:i,complete:r}=e,n=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=C.FRAG_LOADING;const o=i.flush().buffer,c={frag:t,part:s,payload:o,networkDetails:null};this._handleFragmentLoadProgress(c),r&&super._handleFragmentLoadComplete(c)}else n&&n.cc!==e.frag.cc&&this.syncWithAnchor(n,e.frag)}else this.state=C.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:s,media:i,trackId:r}=this,n=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!n.startFragPrefetch)||!(s!=null&&s[r]))return;const o=s[r],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=C.WAITING_TRACK,this.startFragRequested=!1;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,ne.AUDIO,B.AUDIO));const h=this.getFwdBufferInfo(l,B.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,c)){t.trigger(m.BUFFER_EOS,{type:"audio"}),this.state=C.ENDED;return}const d=h.len,u=t.maxBufferLength,f=c.fragments,g=f[0].start,p=this.getLoadPosition(),E=this.flushing?p:h.end;if(this.switchingTrack&&i){const v=p;c.PTSKnown&&vg||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=g+.05)}if(d>=u&&!this.switchingTrack&&ET.end){const S=this.fragmentTracker.getFragAtPos(E,B.MAIN);S&&S.end>T.end&&(T=S,this.mainFragLoading={frag:S,targetBufferTime:null})}if(y.start>T.end)return}this.loadFragment(y,o,E)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(s=>new Ft(s))}onAudioTrackSwitching(e,t){const s=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==C.STOPPED&&(this.setInterval(Wr),this.state=C.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const s=this.cachedTrackLoadedData;s&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(m.AUDIO_TRACK_LOADED,s))}onAudioTrackLoaded(e,t){var s;const{levels:i}=this,{details:r,id:n,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${n} "${c.name}" of "${o}"`);return}const l=this.mainDetails;if(!l||r.endCC>l.endCC||l.expired){this.cachedTrackLoadedData=t,this.state!==C.STOPPED&&(this.state=C.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${n} "${c.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const h=i[n];let d=0;if(r.live||(s=h.details)!=null&&s.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(h.details){var u;d=this.alignPlaylists(r,h.details,(u=this.levelLastLoaded)==null?void 0:u.details)}r.alignedSliding||(Zn(r,l),r.alignedSliding||Ts(r,l),d=r.fragmentStart)}h.details=r,this.levelLastLoaded=h,this.startFragRequested||this.setStartPosition(l,d),this.hls.trigger(m.AUDIO_TRACK_UPDATED,{details:r,id:n,groupId:t.groupId}),this.state===C.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=C.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const s=e.frag,{part:i,payload:r}=e,{config:n,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const l=c[o];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const h=l.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const d=n.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let u=this.transmuxer;u||(u=this.transmuxer=new ya(this.hls,B.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const f=this.initPTS[s.cc],g=(t=s.initSegment)==null?void 0:t.data;if(f!==void 0){const E=i?i.index:-1,y=E!==-1,T=new Li(s.level,s.sn,s.stats.chunkCount,r.byteLength,E,y);u.push(r,g,d,"",s,i,h.totalduration,!1,T,f)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:p}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new Jn,complete:!1};p.push(new Uint8Array(r)),this.state!==C.STOPPED&&(this.state=C.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const s=t.tracks.audio;s&&(this.mediaBuffer=s.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===B.MAIN&&he(t.frag)&&(this.mainFragLoading=t,this.state===C.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s.type!==B.AUDIO){!this.audioOnly&&s.type===B.MAIN&&!s.elementaryStreams.video&&!s.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(he(s)){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,se({},r)))}this.fragBufferedComplete(s,i),this.media&&this.tick()}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case b.FRAG_GAP:case b.FRAG_PARSING_ERROR:case b.FRAG_DECRYPT_ERROR:case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(B.AUDIO,t);break;case b.AUDIO_TRACK_LOAD_ERROR:case b.AUDIO_TRACK_LOAD_TIMEOUT:case b.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_TRACK&&((s=t.context)==null?void 0:s.type)===Q.AUDIO_TRACK&&(this.state=C.IDLE);break;case b.BUFFER_ADD_CODEC_ERROR:case b.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case b.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case b.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==ne.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ne.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===C.ENDED&&(this.state=C.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,t,B.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:c,part:l,level:h}=o,{details:d}=h,{audio:u,text:f,id3:g,initSegment:p}=r;if(this.fragContextChanged(c)||!d){this.fragmentTracker.removeFragment(c);return}if(this.state=C.PARSING,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),p!=null&&p.tracks){const E=c.initSegment||c;if(this.unhandledEncryptionError(p,c))return;this._bufferInitSegment(h,p.tracks,E,n),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:s,tracks:p.tracks})}if(u){const{startPTS:E,endPTS:y,startDTS:T,endDTS:v}=u;l&&(l.elementaryStreams[ne.AUDIO]={startPTS:E,endPTS:y,startDTS:T,endDTS:v}),c.setElementaryStreamInfo(ne.AUDIO,E,y,T,v),this.bufferFragmentData(u,c,l,n)}if(g!=null&&(t=g.samples)!=null&&t.length){const E=re({id:s,frag:c,details:d},g);i.trigger(m.FRAG_PARSING_METADATA,E)}if(f){const E=re({id:s,frag:c,details:d},f);i.trigger(m.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=B.AUDIO;const n=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&n.split(",").length===1&&(r.levelCodec=n),this.hls.trigger(m.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:s,part:null,chunkMeta:i,parent:s.type,data:o};this.hls.trigger(m.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===ue.NOT_LOADED||i===ue.PARTIAL){var r;if(!he(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=C.WAITING_INIT_PTS;const n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&Ts(t.details,n)}else super.loadFragment(e,t,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:s,assocLang:i,characteristics:r,audioCodec:n,channels:o}=this.bufferedTrack;ht({name:t,lang:s,assocLang:i,characteristics:r,audioCodec:n,channels:o},e,ct)||(gs(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(m.AUDIO_TRACK_SWITCHED,se({},e))}}class Mi extends ke{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,s){const i=t?.renditionReports;if(i){let r=-1;for(let n=0;n=0&&h>t.partTarget&&(c+=1)}const l=s&&or(s);return new lr(o,c>=0?c:void 0,l)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}return e}playlistLoaded(e,t,s){const{details:i,stats:r}=t,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;i.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const h=Math.max(c||0,0);i.appliedTimelineOffset=h,i.fragments.forEach(d=>{d.setStart(d.playlistOffset+h)})}if(i.live||s!=null&&s.live){const h="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(s),s&&i.fragments.length>0){nc(s,i,this);const T=i.playlistParsingError;if(T){this.warn(T);const v=this.hls;if(!v.config.ignorePlaylistParsingErrors){var l;const{networkDetails:S}=t;v.trigger(m.ERROR,{type:V.NETWORK_ERROR,details:b.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:T,reason:T.message,level:t.level||void 0,parent:(l=i.fragments[0])==null?void 0:l.type,networkDetails:S,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const d=this.hls.mainForwardBufferInfo,u=d?d.end-d.len:0,f=(i.edge-u)*1e3,g=jn(i,f);if(i.requestScheduled+g0){if(_>i.targetduration*3)this.log(`Playlist last advanced ${R.toFixed(2)}s ago. Omitting segment and part directives.`),E=void 0,y=void 0;else if(s!=null&&s.tuneInGoal&&_-i.partTarget>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${I} with playlist age: ${i.age}`),I=0;else{const P=Math.floor(I/i.targetduration);if(E+=P,y!==void 0){const F=Math.round(I%i.targetduration/i.partTarget);y+=F}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${I} skip sn ${P} to part ${y}`)}i.tuneInGoal=I}if(p=this.getDeliveryDirectives(i,t.deliveryDirectives,E,y),T||!A){i.requestScheduled=n,this.loadingPlaylist(h,p);return}}else(i.canBlockReload||i.canSkipUntil)&&(p=this.getDeliveryDirectives(i,t.deliveryDirectives,E,y));p&&E!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(g-o*2,g/2)),this.scheduleLoading(h,p,i)}else this.clearTimer()}scheduleLoading(e,t,s){const i=s||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),n=i.requestScheduled;if(r>=n){this.loadingPlaylist(e,t);return}const o=n-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,s,i){let r=or(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(s=t.msn,i=t.part,r=rs.No),new lr(s,i,r)}checkRetry(e){const t=e.details,s=ms(e),i=e.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},c=!!i&&!!o&&(r===me.RetryRequest||!i.resolved&&r===me.SendAlternateToPenaltyBox);if(c){var l;if(n>=o.maxNumRetry)return!1;if(s&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Ai(o,n);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function Ta(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function hi(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class gh extends Mi{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Audio track with id:${s} and group:${i} not found in active group ${n?.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Audio track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||i?.length!==s?.length||s!=null&&s.some(o=>i?.indexOf(o)===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(u=>!s||s.indexOf(u.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(u=>u.default)&&(this.selectDefaultTrack=!1),o.forEach((u,f)=>{u.id=f});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!r&&c){const u=Ke(c,o,ct);if(u>-1)r=o[u];else{const f=Ke(c,this.tracks);r=this.tracks[f]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${s?.join(",")}`),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,h);const d=this.trackId;if(l!==-1&&d===-1)this.setAudioTrack(l);else if(o.length&&d===-1){var n;const u=new Error(`No audio track selected for current audio group-ID(s): ${(n=this.groupIds)==null?void 0:n.join(",")} track count: ${o.length}`);this.warn(u.message),this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:u})}}}onError(e,t){t.fatal||!t.context||t.context.type===Q.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const i=this.currentTrack;if(i&&ht(e,i,ct))return i;const r=Ke(e,this.tracksInGroup,ct);if(r>-1){const n=this.tracksInGroup[r];return this.setAudioTrack(r),n}else if(i){let n=t.loadLevel;n===-1&&(n=t.firstAutoLevel);const o=Rl(e,t.levels,s,n,ct);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const n=Ke(e,s);if(n>-1)return s[n]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===s&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,se({},i)),r))return;const n=this.switchParams(i.url,s?.details,i.details);this.loadPlaylist(n)}findTrackId(e){const t=this.tracksInGroup;for(let s=0;s{const s={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(s,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const s={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(s)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const s=(t=e[0])==null?void 0:t.label;(s==="async-blocker"||s==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(r){var s;if(i.onError(r),this.queues===null||this.tracks===null)return;const n=(s=this.tracks[e])==null?void 0:s.buffer;n!=null&&n.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"":` -${this.list("video")} -${this.list("audio")} -${this.list("audiovideo")}}`}list(e){var t,s;return(t=this.queues)!=null&&t[e]||(s=this.tracks)!=null&&s[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const s=(t=this.tracks)==null?void 0:t[e],i=s?.buffer;return i?`SourceBuffer${i.updating?" updating":""}${s.ended?" ended":""}${s.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(s=>s.label).join(", "))||""}}const jr=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,va="HlsJsTrackRemovedError";class ph extends Error{constructor(e){super(e),this.name=va}}class Eh extends ke{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=s=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=s=>{const{media:i,mediaSource:r}=this;s&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(m.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:i}=this;s!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${s})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Uo(st(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_APPENDING,this.onBufferAppending,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.BUFFER_EOS,this.onBufferEos,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.FRAG_PARSED,this.onFragParsed,this),e.on(m.FRAG_CHANGED,this.onFragChanged,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_APPENDING,this.onBufferAppending,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_EOS,this.onBufferEos,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.FRAG_PARSED,this.onFragParsed,this),e.off(m.FRAG_CHANGED,this.onFragChanged,this),e.off(m.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const s={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const n=this.isQueued();(r||n)&&this.warn(`Transfering MediaSource with${n?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?re(s,i.tracks):this.sourceBuffers.forEach(r=>{const[n]=r;n&&(s[n]=re({},this.tracks[n]),this.removeBuffer(n)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:s}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var s;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(s=this.transferData)!=null&&s.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const s=this.media=t.media;this.transferData=this.overrides=void 0;const i=st(this.appendSource);if(i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const n=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(n),r)this._objectUrl=s.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{s.removeAttribute("src");const c=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||c&&n instanceof c,qr(s),yh(s,o),s.load()}catch{s.src=o}else s.src=o}s.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,s;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(s=e.constructor)==null?void 0:s.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const s=this.tracks,i=t.tracks,r=i?Object.keys(i):null,n=r?r.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&r&&n){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal}) -required tracks: ${ae(s,(c,l)=>c==="initSegment"?void 0:l)}; -transfer tracks: ${ae(i,(c,l)=>c==="initSegment"?void 0:l)}}`),!pn(i,s)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,l=this.details,h=Math.max(c,l?.fragments[0].start||0);if(h-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${h}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(s)}") start time: ${h} currentTime: ${c}`),this.onMediaDetaching(m.MEDIA_DETACHING,{}),this.onMediaAttaching(m.MEDIA_ATTACHING,t),e.currentTime=h;return}this.transferData=void 0,r.forEach(c=>{const l=c,h=i[l];if(h){const d=h.buffer;if(d){const u=this.fragmentTracker,f=h.id;if(u.hasFragments(f)||u.hasParts(f)){const E=j.getBuffered(d);u.detectEvictedFragments(l,E,f,null,!0)}const g=$s(l),p=[l,d];this.sourceBuffers[g]=p,d.updating&&this.operationQueue&&this.operationQueue.prependBlocker(l),this.trackSourceBuffer(l,h)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const s=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:n}=this;if(r){if(this.log(`media source ${s?"transferring":"detaching"}`),s)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const c=r.sourceBuffers;for(let l=c.length;l--;)o&&c[l].abort(),r.removeSourceBuffer(c[l]);o&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),s||(n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(i.removeAttribute("src"),this.appendSource&&qr(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(m.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const s=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),s)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[$s(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new mh(this.tracks)}onBufferCodecs(e,t){var s;const i=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const n="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),o=!n&&this.sourceBufferCount&&this.media&&r.some(c=>!i[c]);if(n||o){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${r}" SourceBuffers`);return}r.forEach(c=>{var l,h;const d=t[c],{id:u,codec:f,levelCodec:g,container:p,metadata:E,supplemental:y}=d;let T=i[c];const v=(l=this.transferData)==null||(l=l.tracks)==null?void 0:l[c],S=v!=null&&v.buffer?v:T,x=S?.pendingCodec||S?.codec,D=S?.levelCodec;T||(T=i[c]={buffer:void 0,listeners:[],codec:f,supplemental:y,container:p,levelCodec:g,metadata:E,id:u});const A=is(x,D),R=A?.replace(jr,"$1");let _=is(f,g);const I=(h=_)==null?void 0:h.replace(jr,"$1");_&&A&&R!==I&&(c.slice(0,5)==="audio"&&(_=us(_,this.appendSource)),this.log(`switching codec ${x} to ${_}`),_!==(T.pendingCodec||T.codec)&&(T.pendingCodec=_),T.container=p,this.appendChangeType(c,p,_))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((s=t.audio)==null?void 0:s.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const s=this.tracks[t];return e[t]={id:s.id,container:s.container,codec:s.codec,levelCodec:s.levelCodec},e},{})}appendChangeType(e,t,s){const i=`${t};codecs=${s}`,r={label:`change-type=${i}`,execute:()=>{const n=this.tracks[e];if(n){const o=n.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),n.codec=s,n.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:n=>{this.warn(`Failed to change ${e} SourceBuffer type`,n)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const s=e.start,i=s+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(s,B.MAIN))==null?void 0:t.gap)===!0)return;const n={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&j.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,B.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:n,frag:e},this.append(n,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:s}=this,{data:i,type:r,parent:n,frag:o,part:c,chunkMeta:l,offset:h}=t,d=l.buffering[r],{sn:u,cc:f}=o,g=self.performance.now();d.start=g;const p=o.stats.buffering,E=c?c.stats.buffering:null;p.start===0&&(p.start=g),E&&E.start===0&&(E.start=g);const y=s.audio;let T=!1;r==="audio"&&y?.container==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const v=s.video,S=v?.buffer;if(S&&u!=="initSegment"){const A=c||o,R=this.blockedAudioAppend;if(r==="audio"&&n!=="main"&&!this.blockedAudioAppend&&!(v.ending||v.ended)){const I=A.start+A.duration*.05,P=S.buffered,F=this.currentOp("video");!P.length&&!F?this.blockAudio(A):!F&&!j.isBuffered(S,I)&&this.lastVideoAppendEndI||_{var A;d.executeStart=self.performance.now();const R=(A=this.tracks[r])==null?void 0:A.buffer;R&&(T?this.updateTimestampOffset(R,x,.1,r,u,f):h!==void 0&&M(h)&&this.updateTimestampOffset(R,h,1e-6,r,u,f)),this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const A=self.performance.now();d.executeEnd=d.end=A,p.first===0&&(p.first=A),E&&E.first===0&&(E.first=A);const R={};this.sourceBuffers.forEach(([_,I])=>{_&&(R[_]=j.getBuffered(I))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(m.BUFFER_APPENDED,{type:r,frag:o,part:c,chunkMeta:l,parent:o.type,timeRanges:R})},onError:A=>{var R;const _={type:V.MEDIA_ERROR,parent:o.type,details:b.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:c,chunkMeta:l,error:A,err:A,fatal:!1},I=(R=this.media)==null?void 0:R.error;if(A.code===DOMException.QUOTA_EXCEEDED_ERR||A.name=="QuotaExceededError"||"quota"in A)_.details=b.BUFFER_FULL_ERROR;else if(A.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!I)_.errorAction=vt(!0);else if(A.name===va&&this.sourceBufferCount===0)_.errorAction=vt(!0);else{const P=++this.appendErrors[r];this.warn(`Failed ${P}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${I||"no media error"})`),(P>=this.hls.config.appendErrorMaxRetry||I)&&(_.fatal=!0)}this.hls.trigger(m.ERROR,_)}};this.log(`queuing "${r}" append sn: ${u}${c?" p: "+c.index:""} of ${o.type===B.MAIN?"level":"track"} ${o.level} cc: ${f}`),this.append(D,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,s){return this.log(`queuing "${e}" remove ${t}-${s}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,s)},onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${s} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:s,startOffset:i,endOffset:r}=t;s?this.append(this.getFlushOp(s,i,r),s):this.sourceBuffers.forEach(([n])=>{n&&this.append(this.getFlushOp(n,i,r),n)})}onFragParsed(e,t){const{frag:s,part:i}=t,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[ne.AUDIOVIDEO]?r.push("audiovideo"):(n[ne.AUDIO]&&r.push("audio"),n[ne.VIDEO]&&r.push("video"));const o=()=>{const c=self.performance.now();s.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const l=i?i.stats:s.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:s,part:i,stats:l,id:s.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(o,r).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var s;this.sourceBuffers.forEach(([n])=>{if(n){const o=this.tracks[n];(!t.type||t.type===n)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${n} buffer reached EOS`)))}});const i=((s=this.overrides)==null?void 0:s.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([n])=>{var o;return n&&!((o=this.tracks[n])!=null&&o.ended)})?i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:n}=this;if(!n||n.readyState!=="open"){n&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${n.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),n.endOfStream(),this.hls.trigger(m.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(m.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===b.BUFFER_APPEND_ERROR&&t.frag){var s;const i=(s=t.errorAction)==null?void 0:s.nextAutoLevel;M(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:s}=this;if(!s||t===null||!this.sourceBufferCount)return;const i=e.config,r=s.currentTime,n=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(M(o)&&o>=0){const l=Math.max(o,n),h=Math.floor(r/n)*n-l;this.flushBackBuffer(r,n,h)}const c=i.frontBufferFlushThreshold;if(M(c)&&c>0){const l=Math.max(i.maxBufferLength,c),h=Math.max(l,n),d=Math.floor(r/n)*n+h;this.flushFrontBuffer(r,n,d)}}flushBackBuffer(e,t,s){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=j.getBuffered(r);if(o.length>0&&s>o.start(0)){var n;this.hls.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:s});const c=this.tracks[i];if((n=this.details)!=null&&n.live)this.hls.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:i})}}})}flushFrontBuffer(e,t,s){this.sourceBuffers.forEach(([i,r])=>{if(r){const n=j.getBuffered(r),o=n.length;if(o<2)return;const c=n.start(o-1),l=n.end(o-1);if(s>c||e>=c&&e<=l)return;this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:s}=this;if(!t||!this.media||s?.readyState!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&s.setLiveSeekableRange){const l=Math.max(0,t.fragmentStart),h=Math.max(l,i);return{duration:1/0,start:l,end:h}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return M(r)?{duration:r}:null;const n=this.media.duration,o=M(s.duration)?s.duration:0;return i>o&&i>n||!M(n)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:s}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(M(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&s!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${s}.`),i.setLiveSeekableRange(t,s)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:s}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${ae(s)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,s])=>{if(t){const i=this.tracks[t];e[t]={buffer:s,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(m.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:s}=this;if(!s)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const n=r,o=e[n];if(this.isPending(o)){const c=this.getTrackCodec(o,n),l=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${l})${this.currentOp(n)?" Queued":""} ${ae(o)}`);try{const h=s.addSourceBuffer(l),d=$s(n),u=[n,h];t[d]=u,o.buffer=h}catch(h){var i;this.error(`error while trying to add sourceBuffer: ${h.message}`),this.shiftAndExecuteNext(n),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[n],this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:n,mimeType:l,parent:o.id});return}this.trackSourceBuffer(n,o)}}this.bufferCreated()}getTrackCodec(e,t){const s=e.supplemental;let i=e.codec;s&&(t==="video"||t==="audiovideo")&&wt(s,"video")&&(i=ol(i,s));const r=is(i,e.levelCodec);return r?t.slice(0,5)==="audio"?us(r,this.appendSource):r:""}trackSourceBuffer(e,t){const s=t.buffer;if(!s)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:s,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,n)=>{const o=n.removedRanges;o!=null&&o.length&&this.hls.trigger(m.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const s=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return s?.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const s=this.currentOp(e);s&&(s.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var s;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${i}`,t),this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,s,i,r,n){const o=t-e.timestampOffset;Math.abs(o)>=s&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${n})`),e.timestampOffset=t)}removeExecutor(e,t,s){const{media:i,mediaSource:r}=this,n=this.tracks[e],o=n?.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=M(i.duration)?i.duration:1/0,l=M(r.duration)?r.duration:1/0,h=Math.max(0,t),d=Math.min(s,c,l);d>h&&(!n.ending||n.ended)?(n.ended=!1,this.log(`Removing [${h},${d}] from the ${e} SourceBuffer`),o.remove(h,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const s=this.tracks[t],i=s?.buffer;if(!i)throw new ph(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);s.ending=!1,s.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:s}=this,i=t.map(n=>this.appendBlocker(n));return t.length>1&&this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(n=>{s===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var s;const i=(s=this.tracks[t])==null?void 0:s.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,s){this.operationQueue&&this.operationQueue.append(e,t,s)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,s){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const n=s.bind(this,e);i.listeners.push({event:t,listener:n}),r.addEventListener(t,n)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const s=t.buffer;s&&(t.listeners.forEach(i=>{s.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function qr(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function yh(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function $s(a){return a==="audio"?1:0}class Ni{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const s=this.hls.levels[t.droppedLevel];this.isLevelAllowed(s)&&this.restrictedLevels.push({bitrate:s.bitrate,height:s.height,width:s.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const s=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,s.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&M(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,s=this.getMaxLevel(e.length-1);s!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${s}: ${e[s].height}p@${e[s].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=s,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const s=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ni.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const s=e.getBoundingClientRect();t.width=s.width,t.height=s.height,!t.width&&!t.height&&(t.width=s.right-s.left||e.width||0,t.height=s.bottom-s.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,t,s){if(!(e!=null&&e.length))return-1;const i=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let r=e.length-1;const n=Math.max(t,s);for(let o=0;o=n||c.height>=n)&&i(c,e[o+1])){r=o;break}}return r}}const Th={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Se=Th,vh={HLS:"h"},Sh=vh;class He{constructor(e,t){Array.isArray(e)&&(e=e.map(s=>s instanceof He?s:new He(s))),this.value=e,this.params=t}}const xh="Dict";function Ah(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function Ih(a,e,t,s){return new Error(`failed to ${a} "${Ah(e)}" as ${t}`,{cause:s})}function Ye(a,e,t){return Ih("serialize",a,e,t)}class Sa{constructor(e){this.description=e}}const zr="Bare Item",Lh="Boolean";function Rh(a){if(typeof a!="boolean")throw Ye(a,Lh);return a?"?1":"?0"}function bh(a){return btoa(String.fromCharCode(...a))}const _h="Byte Sequence";function Dh(a){if(ArrayBuffer.isView(a)===!1)throw Ye(a,_h);return`:${bh(a)}:`}const Ch="Integer";function Ph(a){return a<-999999999999999||99999999999999912)throw Ye(a,wh);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Fh="String",Mh=/[\x00-\x1f\x7f]+/;function Nh(a){if(Mh.test(a))throw Ye(a,Fh);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Bh(a){return a.description||a.toString().slice(7,-1)}const Uh="Token";function Xr(a){const e=Bh(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ye(e,Uh);return e}function di(a){switch(typeof a){case"number":if(!M(a))throw Ye(a,zr);return Number.isInteger(a)?xa(a):Oh(a);case"string":return Nh(a);case"symbol":return Xr(a);case"boolean":return Rh(a);case"object":if(a instanceof Date)return kh(a);if(a instanceof Uint8Array)return Dh(a);if(a instanceof Sa)return Xr(a);default:throw Ye(a,zr)}}const $h="Key";function ui(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ye(a,$h);return a}function Bi(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${ui(e)}`:`;${ui(e)}=${di(t)}`).join("")}function Ia(a){return a instanceof He?`${di(a.value)}${Bi(a.params)}`:di(a)}function Gh(a){return`(${a.value.map(Ia).join(" ")})${Bi(a.params)}`}function Kh(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw Ye(a,xh);const t=a instanceof Map?a.entries():Object.entries(a),s=e?.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof He||(r=new He(r));let n=ui(i);return r.value===!0?n+=Bi(r.params):(n+="=",Array.isArray(r.value)?n+=Gh(r):n+=Ia(r)),n}).join(`,${s}`)}function La(a,e){return Kh(a,e)}const Ue="CMCD-Object",ce="CMCD-Request",ot="CMCD-Session",Ze="CMCD-Status",Vh={br:Ue,ab:Ue,d:Ue,ot:Ue,tb:Ue,tpb:Ue,lb:Ue,tab:Ue,lab:Ue,url:Ue,pb:ce,bl:ce,tbl:ce,dl:ce,ltc:ce,mtp:ce,nor:ce,nrr:ce,rc:ce,sn:ce,sta:ce,su:ce,ttfb:ce,ttfbb:ce,ttlb:ce,cmsdd:ce,cmsds:ce,smrt:ce,df:ce,cs:ce,ts:ce,cid:ot,pr:ot,sf:ot,sid:ot,st:ot,v:ot,msd:ot,bs:Ze,bsd:Ze,cdn:Ze,rtp:Ze,bg:Ze,pt:Ze,ec:Ze,e:Ze},Hh={REQUEST:ce};function Yh(a){return Object.keys(a).reduce((e,t)=>{var s;return(s=a[t])===null||s===void 0||s.forEach(i=>e[i]=t),e},{})}function Wh(a,e){const t={};if(!a)return t;const s=Object.keys(a),i=e?Yh(e):{};return s.reduce((r,n)=>{var o;const c=Vh[n]||i[n]||Hh.REQUEST,l=(o=r[c])!==null&&o!==void 0?o:r[c]={};return l[n]=a[n],r},t)}function jh(a){return["ot","sf","st","e","sta"].includes(a)}function qh(a){return typeof a=="number"?M(a):a!=null&&a!==""&&a!==!1}const Ra="event";function zh(a,e){const t=new URL(a),s=new URL(e);if(t.origin!==s.origin)return a;const i=t.pathname.split("/").slice(1),r=s.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")+t.search+t.hash}const ls=a=>Math.round(a),fi=(a,e)=>Array.isArray(a)?a.map(t=>fi(t,e)):a instanceof He&&typeof a.value=="string"?new He(fi(a.value,e),a.params):(e.baseUrl&&(a=zh(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),qt=a=>ls(a/100)*100,Xh=(a,e)=>{let t=a;return e.version>=2&&(a instanceof He&&typeof a.value=="string"?t=new He([a]):typeof a=="string"&&(t=[a])),fi(t,e)},Qh={br:ls,d:ls,bl:qt,dl:qt,mtp:qt,nor:Xh,rtp:qt,tb:ls},ba="request",_a="response",Ui=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],Zh=["e"],Jh=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Is(a){return Jh.test(a)}function ed(a){return Ui.includes(a)||Zh.includes(a)||Is(a)}const Da=["d","dl","nor","ot","rtp","su"];function td(a){return Ui.includes(a)||Da.includes(a)||Is(a)}const sd=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function id(a){return Ui.includes(a)||Da.includes(a)||sd.includes(a)||Is(a)}const rd=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function nd(a){return rd.includes(a)||Is(a)}const ad={[_a]:id,[Ra]:ed,[ba]:td};function Ca(a,e={}){const t={};if(a==null||typeof a!="object")return t;const s=e.version||a.v||1,i=e.reportingMode||ba,r=s===1?nd:ad[i];let n=Object.keys(a).filter(r);const o=e.filter;typeof o=="function"&&(n=n.filter(o));const c=i===_a||i===Ra;c&&!n.includes("ts")&&n.push("ts"),s>1&&!n.includes("v")&&n.push("v");const l=re({},Qh,e.formatters),h={version:s,reportingMode:i,baseUrl:e.baseUrl};return n.sort().forEach(d=>{let u=a[d];const f=l[d];if(typeof f=="function"&&(u=f(u,h)),d==="v"){if(s===1)return;u=s}d=="pr"&&u===1||(c&&d==="ts"&&!M(u)&&(u=Date.now()),qh(u)&&(jh(d)&&typeof u=="string"&&(u=new Sa(u)),t[d]=u))}),t}function od(a,e={}){const t={};if(!a)return t;const s=Ca(a,e),i=Wh(s,e?.customHeaderMap);return Object.entries(i).reduce((r,[n,o])=>{const c=La(o,{whitespace:!1});return c&&(r[n]=c),r},t)}function ld(a,e,t){return re(a,od(e,t))}const cd="CMCD";function hd(a,e={}){return a?La(Ca(a,e),{whitespace:!1}):""}function dd(a,e={}){if(!a)return"";const t=hd(a,e);return encodeURIComponent(t)}function ud(a,e={}){if(!a)return"";const t=dd(a,e);return`${cd}=${t}`}const Qr=/CMCD=[^&#]+/;function fd(a,e,t){const s=ud(e,t);if(!s)return a;if(Qr.test(a))return a.replace(Qr,s);const i=a.includes("?")?"&":"?";return`${a}${i}${s}`}class gd{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Se.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:n}=i,o=this.hls.levels[r.level],c=this.getObjectType(r),l={d:(n||r).duration*1e3,ot:c};(c===Se.VIDEO||c===Se.AUDIO||c==Se.MUXED)&&(l.br=o.bitrate/1e3,l.tb=this.getTopBandwidth(c)/1e3,l.bl=this.getBufferLength(c));const h=n?this.getNextPart(n):this.getNextFrag(r);h!=null&&h.url&&h.url!==r.url&&(l.nor=h.url),this.apply(i,l)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:s}=t;s!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||e.sessionId,this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHED,this.onMediaDetached,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHED,this.onMediaDetached,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var s,i;this.audioBuffer=(s=t.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Sh.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){re(t,this.createData());const s=t.ot===Se.INIT||t.ot===Se.VIDEO||t.ot===Se.MUXED;this.starved&&s&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((n,o)=>(i.includes(o)&&(n[o]=t[o]),n),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ld(e.headers,t,r)):e.url=fd(e.url,t,r)}getNextFrag(e){var t;const s=(t=this.hls.levels[e.level])==null?void 0:t.details;if(s){const i=e.sn-s.startSN;return s.fragments[i+1]}}getNextPart(e){var t;const{index:s,fragment:i}=e,r=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(r){const{sn:n}=i;for(let o=r.length-1;o>=0;o--){const c=r[o];if(c.index===s&&c.fragment.sn===n)return r[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Se.TIMED_TEXT;if(e.sn==="initSegment")return Se.INIT;if(t==="audio")return Se.AUDIO;if(t==="main")return this.hls.audioTracks.length?Se.VIDEO:Se.MUXED}getTopBandwidth(e){let t=0,s;const i=this.hls;if(e===Se.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}return s.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,s=e===Se.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!t?NaN:j.bufferInfo(s,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}}const md=3e5;class pd extends ke{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:s}=t;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:s}=t;if(s?.action===me.SendAlternateToPenaltyBox&&s.flags===Ie.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,n=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:l}=t.context;o&&i?n=this.getPathwayForGroupId(o,l,n):c&&(n=c)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),s.resolved=this.pathwayId!==n),t.details===b.BUFFER_APPEND_ERROR&&!t.fatal?s.resolved=!0:s.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${n} levels: ${i&&i.length} priorities: ${ae(r)} penalized: ${ae(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),t=this.getLevelsForPathway(s),this.pathwayId=s}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>md&&delete s[r]});for(let r=0;r0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,Xn(t),this.hls.trigger(m.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[o];c&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,s){const i=this.getLevelsForPathway(s).concat(this.levels||[]);for(let r=0;r{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":c}=r;if(t.some(h=>h.pathwayId===n))return;const l=this.getLevelsForPathway(o).map(h=>{const d=new oe(h.attrs);d["PATHWAY-ID"]=n;const u=d.AUDIO&&`${d.AUDIO}_clone_${n}`,f=d.SUBTITLES&&`${d.SUBTITLES}_clone_${n}`;u&&(s[d.AUDIO]=u,d.AUDIO=u),f&&(i[d.SUBTITLES]=f,d.SUBTITLES=f);const g=Pa(h.uri,d["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),p=new Ft({attrs:d,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:g,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let E=1;E{this.log(`Loaded steering manifest: "${i}"`);const g=h.data;if(g?.VERSION!==1){this.log(`Steering VERSION ${g.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=g.TTL;const{"RELOAD-URI":p,"PATHWAY-CLONES":E,"PATHWAY-PRIORITY":y}=g;if(p)try{this.uri=new self.URL(p,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${p}`);return}this.scheduleRefresh(this.uri||u.url),E&&this.clonePathways(E);const T={steeringManifest:g,url:i.toString()};this.hls.trigger(m.STEERING_MANIFEST_LOADED,T),y&&this.updatePathwayPriority(y)},onError:(h,d,u,f)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${d.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${d.url} no longer available`);return}let g=this.timeToLoad*1e3;if(h.code===429){const p=this.loader;if(typeof p?.getResponseHeader=="function"){const E=p.getResponseHeader("Retry-After");E&&(g=parseFloat(E)*1e3)}this.log(`Steering manifest ${d.url} rate limited`);return}this.scheduleRefresh(this.uri||d.url,g)},onTimeout:(h,d,u)=>{this.log(`Timeout loading steering manifest (${d.url})`),this.scheduleRefresh(this.uri||d.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const i=(s=this.hls)==null?void 0:s.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Zr(a,e,t,s){a&&Object.keys(e).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=re({},n);return o.details=void 0,o.attrs=new oe(o.attrs),o.url=o.attrs.URI=Pa(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function Pa(a,e,t,s){const{HOST:i,PARAMS:r,[t]:n}=s;let o;e&&(o=n?.[e],o&&(a=o));const c=new self.URL(a);return i&&!o&&(c.host=i),r&&Object.keys(r).sort().forEach(l=>{l&&c.searchParams.set(l,r[l])}),c.href}class xt extends ke{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=xt.CDMCleanupPromise?[xt.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:s,initData:i}=t,r=`"${t.type}" event: init data type: "${s}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let n=Object.keys(this.keySystemAccessPromises);n.length||(n=Dt(this.config));const o=n.map(ks).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(n=>{const o=ns(n);if(s!=="sinf"||o!==le.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${s}" for selected key-system ${o}`);return}let c;try{const f=de(new Uint8Array(i)),g=bi(JSON.parse(f).sinf),p=Ln(g);if(!p)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(p.subarray(8,24))}catch(f){this.warn(`${r} Failed to parse sinf: ${f}`);return}const l=pe(c),{keyIdToKeySessionPromise:h,mediaKeySessions:d}=this;let u=h[l];for(let f=0;fthis.generateRequestWithPreferredKeySession(g,s,i,"encrypted-event-key-match")),u.catch(y=>this.handleError(y));break}}u||this.handleError(new Error(`Key ID ${l} not encountered in playlist. Key-system sessions ${d.length}.`))}).catch(n=>this.handleError(n))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(m.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(m.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:s}=this.config,i=t?.[e];if(i)return i.licenseUrl;if(e===le.WIDEVINE&&s)return s}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,s=t?.[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,s=(n,o,c)=>!!n&&c.indexOf(n)===o,i=t.map(n=>n.audioCodec).filter(s),r=t.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const c=l=>{const h=l.shift();this.getMediaKeysPromise(h,i,r).then(d=>n({keySystem:h,mediaKeys:d})).catch(d=>{l.length?c(l):d instanceof Ae?o(d):o(new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_ACCESS,error:d,fatal:!0},d.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Kn===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return s(e,t)}getMediaKeysPromise(e,t,s){var i;const r=Xl(e,t,s,this.config.drmSystemOptions||{});let n=this.keySystemAccessPromises[e],o=(i=n)==null?void 0:i.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${ae(r)}`),o=this.requestMediaKeySystemAccess(e,r);const c=n=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),o.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const h=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const d=c.mediaKeys=l.createMediaKeys().then(u=>(this.log(`Media-keys created for "${e}"`),c.hasMediaKeys=!0,h.then(f=>f?this.setMediaKeysServerCertificate(u,e,f):u)));return d.catch(u=>{this.error(`Failed to create media-keys for "${e}"}: ${u}`)}),d})}return o.then(()=>n.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:s}){this.log(`Creating key-system session "${t}" keyId: ${pe(e.keyId||[])} keyUri: ${e.uri}`);const i=s.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const s=this.createMediaKeySessionContext(e),i=zt(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const s=e.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyId ${pe(e.decryptdata.keyId||[])} - } (data length: ${t.byteLength})`),s.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>ks(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:s})=>this.attemptSetMediaKeys(t,s))}selectKeySystem(e){return new Promise((t,s)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const r=ks(i);r?t(r):s(new Error(`Unable to find format for key-system "${i}"`))}).catch(s)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Dt(this.config),s=e.map(ns).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(s)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let s=0;s(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(c,l).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:c,mediaKeys:l,decryptdata:t}))))).then(c=>{const l="cenc",h=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(c,l,h,"playlist-key")});return o.catch(c=>this.handleError(c,e.frag)),this.keyIdToKeySessionPromise[s]=o,o}return n.catch(o=>{if(o instanceof Ae){const c=se({},o.data);this.getKeyStatus(t)==="internal-error"&&(c.decryptdata=t);const l=new Ae(c,o.message);this.handleError(l,e.frag)}}),n}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Ae){t&&(e.data.frag=t);const s=e.data.decryptdata;this.error(`${e.message}${s?` (${pe(s.keyId||[])})`:""}`),this.hls.trigger(m.ERROR,e.data)}else this.error(e.message),this.hls.trigger(m.ERROR,{type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=zt(e),s=this.keyIdToKeySessionPromise[t];if(!s){const i=ns(e.keyFormat),r=i?[i]:Dt(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=Dt(this.config)),e.length===0)throw new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${ae({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(s).then(()=>this.media?this.media.setMediaKeys(t):new Promise((r,n)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return n(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(r).catch(n)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,s,i){var r;const n=(r=this.config.drmSystems)==null||(r=r[e.keySystem])==null?void 0:r.generateRequest;if(n)try{const g=n.call(this.hls,t,s,e);if(!g)throw new Error("Invalid response from configured generateRequest filter");t=g.initDataType,s=g.initData?g.initData:null,e.decryptdata.pssh=s?new Uint8Array(s):null}catch(g){if(this.warn(g.message),this.hls&&this.hls.config.debug)throw g}if(s===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const o=zt(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${o} URI: ${c} (init data type: ${t} length: ${s.byteLength})`);const l=new Di,h=e._onmessage=g=>{const p=e.mediaKeysSession;if(!p){l.emit("error",new Error("invalid state"));return}const{messageType:E,message:y}=g;this.log(`"${E}" message event for session "${p.sessionId}" message size: ${y.byteLength}`),E==="license-request"||E==="license-renewal"?this.renewLicense(e,y).catch(T=>{l.eventNames().length?l.emit("error",T):this.handleError(T)}):E==="license-release"?e.keySystem===le.FAIRPLAY&&this.updateKeySession(e,ni("acknowledged")).then(()=>this.removeSession(e)).catch(T=>this.handleError(T)):this.warn(`unhandled media key message type "${E}"`)},d=(g,p)=>{p.keyStatus=g;let E;g.startsWith("usable")?l.emit("resolved"):g==="internal-error"||g==="output-restricted"||g==="output-downscaled"?E=Jr(g,p.decryptdata):g==="expired"?E=new Error(`key expired (keyId: ${o})`):g==="released"?E=new Error("key released"):g==="status-pending"||this.warn(`unhandled key status change "${g}" (keyId: ${o})`),E&&(l.eventNames().length?l.emit("error",E):this.handleError(E))},u=e._onkeystatuseschange=g=>{if(!e.mediaKeysSession){l.emit("error",new Error("invalid state"));return}const E=this.getKeyStatuses(e);if(!Object.keys(E).some(S=>E[S]!=="status-pending"))return;if(E[o]==="expired"){this.log(`Expired key ${ae(E)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let T=E[o];if(T)d(T,e);else{var v;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(v=e.keyStatusTimeouts)[o]||(v[o]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const x=this.getKeyStatus(e.decryptdata);if(x&&x!=="status-pending")return this.log(`No status for keyId ${o} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${x} from other session.`),d(x,e);this.log(`key status for ${o} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),T="internal-error",d(T,e)},1e3)),this.log(`No status for keyId ${o} (${ae(E)}).`)}};ve(e.mediaKeysSession,"message",h),ve(e.mediaKeysSession,"keystatuseschange",u);const f=new Promise((g,p)=>{l.on("error",p),l.on("resolved",g)});return e.mediaKeysSession.generateRequest(t,s).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o} URI: ${c}`)}).catch(g=>{throw new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_NO_SESSION,error:g,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${g}`)}).then(()=>f).catch(g=>(l.removeAllListeners(),this.removeSession(e).then(()=>{throw g}))).then(()=>(l.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((s,i)=>{if(typeof i=="string"&&typeof s=="object"){const o=i;i=s,s=o}const r="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);if(e.keySystem===le.PLAYREADY&&r.length===16){const o=pe(r);t[o]=s,$n(r)}const n=pe(r);s==="internal-error"&&(this.bannedKeyIds[n]=s),this.log(`key status change "${s}" for keyStatuses keyId: ${n} key-session "${e.mediaKeysSession.sessionId}"`),t[n]=s}),t}fetchServerCertificate(e){const t=this.config,s=t.loader,i=new s(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{const c={responseType:"arraybuffer",url:r},l=t.certLoadPolicy.default,h={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(u,f,g,p)=>{n(u.data)},onError:(u,f,g,p)=>{o(new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:se({url:c.url,data:void 0},u)},`"${e}" certificate request failed (${r}). Status: ${u.code} (${u.text})`))},onTimeout:(u,f,g)=>{o(new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(u,f,g)=>{o(new Error("aborted"))}};i.load(c,h,d)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,s){return new Promise((i,r)=>{e.setServerCertificate(s).then(n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${s.byteLength}) on "${t}"`),i(e)}).catch(n=>{r(new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(i=>{throw new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:i,fatal:!1},i.message)}))}unpackPlayReadyKeyMessage(e,t){const s=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(s,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let d=0,u=r.length;d in key message");return ni(atob(l))}setupLicenseXHR(e,t,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return e.open("POST",t,!0),r.call(this.hls,e,t,s,i)}).then(n=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${n}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const l=this.config.licenseResponseCallback;if(l)try{c=l.call(this.hls,o,n,e)}catch(h){this.error(h)}i(c)}else{const c=s.errorRetry,l=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||o.status>=400&&o.status<500)r(new Ae({type:V.KEY_SYSTEM_ERROR,details:b.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${n}). Status: ${o.status} (${o.statusText})`));else{const h=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,n,e,t).then(({xhr:c,licenseChallenge:l})=>{e.keySystem==le.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(c,l)),c.send(l)}).catch(r)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const s=t.media;this.media=s,ve(s,"encrypted",this.onMediaEncrypted),ve(s,"waitingforkey",this.onWaitingForKey);const i=this.mediaResolved;i?i():this.mediaKeys=s.mediaKeys}onMediaDetached(){const e=this.media;e&&(xe(e,"encrypted",this.onMediaEncrypted),xe(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const s=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,tt.clearKeyUriToKeyIdMap();const r=i.length;xt.CDMCleanupPromise=Promise.all(i.map(n=>this.removeSession(n)).concat((s==null||(e=s.setMediaKeys(null))==null?void 0:e.catch(n=>{this.log(`Could not clear media keys: ${n}`),this.hls&&this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${n}`)})}))||Promise.resolve())).catch(n=>{this.log(`Could not close sessions and clear media keys: ${n}`),this.hls&&this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${n}`)})}).then(()=>{r&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:s,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${pe(i?.keyId||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{keyStatusTimeouts:n}=e;n&&Object.keys(n).forEach(l=>self.clearTimeout(n[l]));const{drmSystemOptions:o}=this.config;return(Zl(o)?new Promise((l,h)=>{self.setTimeout(()=>h(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(l).catch(h)}):Promise.resolve()).catch(l=>{this.log(`Could not remove session: ${l}`),this.hls&&this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${l}`)})}).then(()=>t.close()).catch(l=>{this.log(`Could not close session: ${l}`),this.hls&&this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${l}`)})})}return Promise.resolve()}}xt.CDMCleanupPromise=void 0;function zt(a){if(!a)throw new Error("Could not read keyId of undefined decryptdata");if(a.keyId===null)throw new Error("keyId is null");return pe(a.keyId)}function Ed(a,e){if(a.keyId&&e.mediaKeysSession.keyStatuses.has(a.keyId))return e.mediaKeysSession.keyStatuses.get(a.keyId);if(a.matches(e.decryptdata))return e.keyStatus}class Ae extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Jr(a,e){const t=a==="output-restricted",s=t?b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:b.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Ae({type:V.KEY_SYSTEM_ERROR,details:s,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${a}"`)}class yd{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,s){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*n/r,l=this.hls;if(l.trigger(m.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),c>0&&n>l.config.fpsDroppedMonitoringThreshold*o){let h=l.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=h)&&(h=h-1,l.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:l.currentLevel}),l.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function ka(a,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function wa(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){ie.debug(`[texttrack-utils]: ${s}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){ie.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Tt(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let s=a.cues.length;s--;)e&&a.cues[s].removeEventListener("enter",e),a.removeCue(a.cues[s]);t==="disabled"&&(a.mode=t)}function gi(a,e,t,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=vd(a.cues,e,t);for(let n=0;na[t].endTime)return-1;let s=0,i=t,r;for(;s<=i;)if(r=Math.floor((i+s)/2),ea[r].startTime&&s-1)for(let r=i,n=a.length;r=e&&o.endTime<=t)s.push(o);else if(o.startTime>t)return s}return s}function cs(a){const e=[];for(let t=0;tthis.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const s=cs(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const s=this.media;if(!s)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||s.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;cs(s.textTracks).forEach(n=>{Tt(n)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Subtitle track with id:${s} and group:${i} not found in active group ${n?.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Subtitle track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||i?.length!==s?.length||s!=null&&s.some(n=>i?.indexOf(n)===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const n=this.tracks.filter(h=>!s||s.indexOf(h.groupId)!==-1);if(n.length)this.selectDefaultTrack&&!n.some(h=>h.default)&&(this.selectDefaultTrack=!1),n.forEach((h,d)=>{h.id=d});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=n;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Ke(o,n);if(h>-1)r=n[h];else{const d=Ke(o,this.tracks);r=this.tracks[d]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const l={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${s?.join(",")}" group-id`),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,l),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,s=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(s)return null;{const r=Ke(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const s=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),n=e.details,o=n?.age;this.log(`Loading subtitle ${s} "${e.name}" lang:${e.lang} group:${i}${t?.msn!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&n.live?" age "+o.toFixed(1)+(n.type&&" "+n.type||""):""} ${r}`),this.hls.trigger(m.SUBTITLE_TRACK_LOADING,{url:r,id:s,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=cs(e.textTracks),s=this.currentTrack;let i;if(s&&(i=t.filter(r=>hi(s,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!M(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===s&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:n,groupId:o="",name:c,type:l,url:h}=i;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:c,type:l,url:h});const d=this.switchParams(i.url,s?.details,i.details);this.loadPlaylist(d)}}function xd(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function kt(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const At=.025;let Ss=(function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a})({});function Ad(a,e,t){return`${a.identifier}-${t+1}-${kt(e)}`}class Id{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const s=this.playoutLimit;return e<=0||isNaN(s)?!1:s===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>s}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Gs(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,s=Gs(t,e);return t-s<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=M(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return Gs(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)0||this.assetListResponse!==null}toString(){return Ld(this)}}function Gs(a,e){return a-e.start":a.cue.post?"":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function yt(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Rd{constructor(e,t,s,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(m.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=s,this.assetItem=i;const n=()=>{this.hasDetails=!0};r.once(m.LEVEL_LOADED,n),r.once(m.AUDIO_TRACK_LOADED,n),r.once(m.SUBTITLE_TRACK_LOADED,n),r.on(m.MEDIA_ATTACHING,(o,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(m.BUFFER_APPENDED,()=>{const h=this.bufferedEnd;this.reachedPlayout(h)&&(this._bufferedEosTime=h,r.trigger(m.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Oa(t,e.config.primarySessionId||"").href}catch{}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const s=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,r=j.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=s-.02}reachedPlayout(e){const s=this.interstitial.playoutLimit;return this.startOffset+e>=s}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=j.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const s=t-this.startOffset;if(s>0&&s1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,s=this.duration;return Math.min(Math.max(0,e-t),s)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=s=>delete s.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,s){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,s){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,s){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${yt(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const en=.033;class bd extends ke{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((s,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,s+1):s,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let s=-1;e.nextEvent?s=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(s=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[s]||(t===void 0&&(t=e.start),s=this.findItemIndexAtTime(t));s>=0&&(r=i[s])!=null&&r.event;){var r;s--}return s}findItemIndexAtTime(e,t){const s=this.items;if(s)for(let i=0;ir.start&&e1)for(let r=0;ro&&(t!o.includes(l.identifier)):[];n.length&&n.sort((l,h)=>{const d=l.cue.pre,u=l.cue.post,f=h.cue.pre,g=h.cue.post;if(d&&!f)return-1;if(f&&!d||u&&!g)return 1;if(g&&!u)return-1;if(!d&&!f&&!u&&!g){const p=l.startTime,E=h.startTime;if(p!==E)return p-E}return l.dateRange.tagOrder-h.dateRange.tagOrder}),this.events=n,c.forEach(l=>{this.removeEvent(l)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],s=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,n=this.parseSchedule(i,e);(s||t.length||r?.length!==n.length||n.some((c,l)=>Math.abs(c.playout.start-r[l].playout.start)>.005||Math.abs(c.playout.end-r[l].playout.end)>.005))&&(this.items=n,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,s){const i=[],r=Object.keys(e);for(let n=0;n!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,l=0;if(e.forEach((h,d)=>{const u=h.cue.pre,f=h.cue.post,g=e[d-1]||null,p=h.appendInPlace,E=f?r:h.startOffset,y=h.duration,T=h.timelineOccupancy===Ss.Range?y:0,v=h.resumptionOffset,S=g?.startTime===E,x=E+h.cumulativeDuration;let D=p?x+y:E+v;if(u||!f&&E<=0){const R=l;l+=T,h.timelineStart=x;const _=n;n+=y,s.push({event:h,start:x,end:D,playout:{start:_,end:n},integrated:{start:R,end:l}})}else if(E<=r){if(!S){const I=E-c;if(I>en){const P=c,F=l;l+=I;const U=n;n+=I;const H={previousEvent:e[d-1]||null,nextEvent:h,start:P,end:P+I,playout:{start:U,end:n},integrated:{start:F,end:l}};s.push(H)}else I>0&&g&&(g.cumulativeDuration+=I,s[s.length-1].end=E)}f&&(D=x),h.timelineStart=x;const R=l;l+=T;const _=n;n+=y,s.push({event:h,start:x,end:D,playout:{start:_,end:n},integrated:{start:R,end:l}})}else return;const A=h.resumeTime;f||A>r?c=r:c=A}),c{const l=o.cue.pre,h=o.cue.post,d=l?0:h?i:o.startTime;this.updateAssetDurations(o),n===d?o.cumulativeDuration=r:(r=0,n=d),!h&&o.snapOptions.in&&(o.resumeAnchor=dt(null,s.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1At?(this.log(`"${e.identifier}" resumption ${s} not aligned with estimated timeline end ${i}`),!1):!Object.keys(t).some(n=>{const o=t[n].details,c=o.edge;if(s>=c)return this.log(`"${e.identifier}" resumption ${s} past ${n} playlist end ${c}`),!1;const l=dt(null,o.fragments,s);if(!l)return this.log(`"${e.identifier}" resumption ${s} does not align with any fragments in ${n} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const h=n==="audio"?.175:0;return Math.abs(l.start-s){const E=u.data,y=E?.ASSETS;if(!Array.isArray(y)){const T=this.assignAssetListError(e,b.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),g.url,f,p);this.hls.trigger(m.ERROR,T);return}e.assetListResponse=E,this.hls.trigger(m.ASSET_LIST_LOADED,{event:e,assetListResponse:E,networkDetails:p})},onError:(u,f,g,p)=>{const E=this.assignAssetListError(e,b.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${u.code} ${u.text} (${f.url})`),f.url,p,g);this.hls.trigger(m.ERROR,E)},onTimeout:(u,f,g)=>{const p=this.assignAssetListError(e,b.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${f.url})`),f.url,u,g);this.hls.trigger(m.ERROR,p)}};return o.load(c,h,d),this.hls.trigger(m.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,s,i,r,n){return e.error=s,{type:V.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:s,networkDetails:n,stats:r}}}function tn(a){var e;a==null||(e=a.play())==null||e.catch(()=>{})}function Xt(a,e){return`[${a}] Advancing timeline position to ${e}`}class Dd extends ke{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled||!this.schedule)return;const i=s-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const n=i<=-.01;this.timelinePos=s,this.bufferedPos=s;const o=this.playingItem;if(!o){this.checkBuffer();return}if(n&&this.schedule.resetErrorsInRange(s,s-i)&&this.updateSchedule(!0),this.checkBuffer(),n&&s=o.end){var c;const f=this.findItemIndex(o);let g=this.schedule.findItemIndexAtTime(s);if(g===-1&&(g=f+(n?-1:1),this.log(`seeked ${n?"back ":""}to position not covered by schedule ${s} (resolving from ${f} to ${g})`)),!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!n&&g>f){const p=this.schedule.findJumpRestrictedIndex(f+1,g);if(p>f){this.setSchedulePosition(p);return}}this.setSchedulePosition(g);return}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(o)){const f=o.event.assetList[0];f&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(s,f))}return}const h=l.timelineStart,d=l.duration||0;if(n&&s=h+d){var u;(u=o.event)!=null&&u.appendInPlace&&(this.clearAssetPlayers(o.event,o),this.flushFrontBuffer(s)),this.setScheduleToAssetAtTime(s,l)}},this.onTimeupdate=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled)return;if(s>this.timelinePos)this.timelinePos=s,s>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(s>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const r=this.playingAsset;if(!r)return;const n=r.timelineStart+(r.duration||0);s>=n&&this.setScheduleToAssetAtTime(s,r)},this.onScheduleUpdate=(s,i)=>{const r=this.schedule;if(!r)return;const n=this.playingItem,o=r.events||[],c=r.items||[],l=r.durations,h=s.map(p=>p.identifier),d=!!(o.length||h.length);(d||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o} -Schedule: ${c.map(p=>Fe(p))} pos: ${this.timelinePos}`),h.length&&this.log(`Removed events ${h}`);let u=null,f=null;n&&(u=this.updateItem(n,this.timelinePos),this.itemsMatch(n,u)?this.playingItem=u:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const g=this.bufferingItem;if(g&&(f=this.updateItem(g,this.bufferedPos),this.itemsMatch(g,f)?this.bufferingItem=f:g.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(g.event,null))),s.forEach(p=>{p.assetList.forEach(E=>{this.clearAssetPlayer(E.identifier,null)})}),this.playerQueue.forEach(p=>{if(p.interstitial.appendInPlace){const E=p.assetItem.timelineStart,y=p.timelineOffset-E;if(y)try{p.timelineOffset=E}catch(T){Math.abs(y)>At&&this.warn(`${T} ("${p.assetId}" ${p.timelineOffset}->${E})`)}}}),d||i){if(this.hls.trigger(m.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:l,removedIds:h}),this.isInterstitial(n)&&h.includes(n.event.identifier)){this.warn(`Interstitial "${n.event.identifier}" removed while playing`),this.primaryFallback(n.event);return}n&&this.trimInPlace(u,n),g&&f!==u&&this.trimInPlace(f,g),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new _d(e),this.schedule=new bd(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(m.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(m.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(m.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(m.BUFFER_APPENDED,this.onBufferAppended,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(m.MEDIA_ENDED,this.onMediaEnded,this),e.on(m.ERROR,this.onError,this),e.on(m.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(m.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(m.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(m.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_APPENDED,this.onBufferAppended,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(m.MEDIA_ENDED,this.onMediaEnded,this),e.off(m.ERROR,this.onError,this),e.off(m.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){xe(e,"play",this.onPlay),xe(e,"pause",this.onPause),xe(e,"seeking",this.onSeeking),xe(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const s=this.media=t.media;ve(s,"seeking",this.onSeeking),ve(s,"timeupdate",this.onTimeupdate),ve(s,"play",this.onPlay),ve(s,"pause",this.onPause)}onMediaAttached(e,t){const s=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,s===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(s);this.setSchedulePosition(r)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const s=!!t.transferMedia,i=this.media;if(this.media=null,!s&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.log(`Removing schedule state for detachedData and ${r}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,s=d=>d&&e.getAssetPlayer(d.identifier),i=(d,u,f,g,p)=>{if(d){let E=d[u].start;const y=d.event;if(y){if(u==="playout"||y.timelineOccupancy!==Ss.Point){const T=s(f);T?.interstitial===y&&(E+=T.assetItem.startOffset+T[p])}}else{const T=g==="bufferedPos"?n():e[g];E+=T-d.start}return E}return 0},r=(d,u)=>{var f;if(d!==0&&u!=="primary"&&(f=e.schedule)!=null&&f.length){var g;const p=e.schedule.findItemIndexAtTime(d),E=(g=e.schedule.items)==null?void 0:g[p];if(E){const y=E[u].start-E.start;return d+y}}return d},n=()=>{const d=e.bufferedPos;return d===Number.MAX_VALUE?o("primary"):Math.max(d,0)},o=d=>{var u,f;return(u=e.primaryDetails)!=null&&u.live?e.primaryDetails.edge:((f=e.schedule)==null?void 0:f.durations[d])||0},c=(d,u)=>{var f,g;const p=e.effectivePlayingItem;if(p!=null&&(f=p.event)!=null&&f.restrictions.skip||!e.schedule)return;e.log(`seek to ${d} "${u}"`);const E=e.effectivePlayingItem,y=e.schedule.findItemIndexAtTime(d,u),T=(g=e.schedule.items)==null?void 0:g[y],v=e.getBufferingPlayer(),S=v?.interstitial,x=S?.appendInPlace,D=E&&e.itemsMatch(E,T);if(E&&(x||D)){const A=s(e.playingAsset),R=A?.media||e.primaryMedia;if(R){const _=u==="primary"?R.currentTime:i(E,u,e.playingAsset,"timelinePos","currentTime"),I=d-_,P=(x?_:R.currentTime)+I;if(P>=0&&(!A||x||P<=A.duration)){R.currentTime=P;return}}}if(T){let A=d;if(u!=="primary"){const _=T[u].start,I=d-_;A=T.start+I}const R=!e.isInterstitial(T);if((!e.isInterstitial(E)||E.event.appendInPlace)&&(R||T.event.appendInPlace)){const _=e.media||(x?v?.media:null);_&&(_.currentTime=A)}else if(E){const _=e.findItemIndex(E);if(y>_){const P=e.schedule.findJumpRestrictedIndex(_+1,y);if(P>_){e.setSchedulePosition(P);return}}let I=0;if(R)e.timelinePos=A,e.checkBuffer();else{const P=T.event.assetList,F=d-(T[u]||T).start;for(let U=P.length;U--;){const H=P[U];if(H.duration&&F>=H.startOffset&&F{const d=e.effectivePlayingItem;if(e.isInterstitial(d))return d;const u=t();return e.isInterstitial(u)?u:null},h={get bufferedEnd(){const d=t(),u=e.bufferingItem;if(u&&u===d){var f;return i(u,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-u.playout.start||((f=e.bufferingAsset)==null?void 0:f.startOffset)||0}return 0},get currentTime(){const d=l(),u=e.effectivePlayingItem;return u&&u===d?i(u,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-u.playout.start:0},set currentTime(d){const u=l(),f=e.effectivePlayingItem;f&&f===u&&c(d+f.playout.start,"playout")},get duration(){const d=l();return d?d.playout.end-d.playout.start:0},get assetPlayers(){var d;const u=(d=l())==null?void 0:d.event.assetList;return u?u.map(f=>e.getAssetPlayer(f.identifier)):[]},get playingIndex(){var d;const u=(d=l())==null?void 0:d.event;return u&&e.effectivePlayingAsset?u.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};return this.manager={get events(){var d;return((d=e.schedule)==null||(d=d.events)==null?void 0:d.slice(0))||[]},get schedule(){var d;return((d=e.schedule)==null||(d=d.items)==null?void 0:d.slice(0))||[]},get interstitialPlayer(){return l()?h:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const d=t();return e.findItemIndex(d)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const d=e.effectivePlayingItem;return e.findItemIndex(d)},primary:{get bufferedEnd(){return n()},get currentTime(){const d=e.timelinePos;return d>0?d:0},set currentTime(d){c(d,"primary")},get duration(){return o("primary")},get seekableStart(){var d;return((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(d){c(d,"integrated")},get duration(){return o("integrated")},get seekableStart(){var d;return r(((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0,"integrated")}},skip:()=>{const d=e.effectivePlayingItem,u=d?.event;if(u&&!u.restrictions.skip){const f=e.findItemIndex(d);if(u.appendInPlace){const g=d.playout.start+d.event.duration;c(g+.001,"playout")}else e.advanceAfterAssetEnded(u,f,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,s=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!s?!1:this.findItemIndex(t)===s.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const s=this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&!s.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const r=(t=i)==null?void 0:t.currentTime;if(!(r===void 0||!M(r)))return r}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const s=this.getAssetPlayer(e);s&&this.transferMediaFromPlayer(s,t)}transferMediaFromPlayer(e,t){const s=e.interstitial.appendInPlace,i=e.media;if(s&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${ae(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var s,i;if(e.media===t)return;let r=null;const n=this.hls,o=e!==n,c=o&&e.interstitial.appendInPlace,l=(s=this.detachedData)==null?void 0:s.mediaSource;let h;if(n.media)c&&(r=n.transferMedia(),this.detachedData=r),h="Primary";else if(l){const g=this.getBufferingPlayer();g?(r=g.transferMedia(),h=`${g}`):h="detached MediaSource"}else h="detached media";if(!r){if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${ae(r)}`);else if(!this.detachedData||n.media===t){const g=this.playerQueue;g.length>1&&g.forEach(p=>{if(o&&p.interstitial.appendInPlace!==c){const E=p.interstitial;this.clearInterstitial(p.interstitial,null),E.appendInPlace=!1,E.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${E}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const d=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",u=d&&r?r:t;this.log(`${d?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${h} (media.currentTime: ${t.currentTime})`);const f=this.schedule;if(u===r&&f){const g=o&&e.assetId===f.assetIdAtEnd;u.overrides={duration:f.duration,endOfStream:!o||g,cueRemoval:!o}}e.attachMedia(u)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e?.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const s=this.timelinePos,i=this.effectivePlayingItem;if(s===-1){const r=this.hls.startPosition;if(this.log(Xt("checkStart",r)),this.timelinePos=r,t.length&&t[0].cue.pre){const n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(r>=0||!this.primaryLive){const n=this.timelinePos=r>0?r:0,o=e.findItemIndexAtTime(n);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAssetBuffering(e,t){const s=e.event,i=s.findAssetIndex(t),r=Ks(s,i);if(!s.isAssetPastPlayoutLimit(r))this.bufferedToEvent(e,r);else if(this.schedule){var n;const o=(n=this.schedule.items)==null?void 0:n[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,s){const i=Ks(e,s);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const r=this.schedule.items;if(r){const n=t+1,o=r.length;if(n>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r&&Fe(r)}) pos: ${this.timelinePos}`);const n=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(n)){const h=n.event,d=this.playingAsset,u=d?.identifier,f=u?this.getAssetPlayer(u):null;if(f&&u&&(!this.eventItemsMatch(n,r)||t!==void 0&&u!==h.assetList[t].identifier)){var c;const g=h.findAssetIndex(d);if(this.log(`INTERSTITIAL_ASSET_ENDED ${g+1}/${h.assetList.length} ${yt(d)}`),this.endedAsset=d,this.playingAsset=null,this.hls.trigger(m.INTERSTITIAL_ASSET_ENDED,{asset:d,assetListIndex:g,event:h,schedule:i.slice(0),scheduleIndex:e,player:f}),n!==this.playingItem){this.itemsMatch(n,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(h,this.findItemIndex(this.playingItem),g);return}this.retreiveMediaSource(u,r),f.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&f.detachMedia()}if(!this.eventItemsMatch(n,r)&&(this.endedItem=n,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${h} ${Fe(n)}`),h.hasPlayed=!0,this.hls.trigger(m.INTERSTITIAL_ENDED,{event:h,schedule:i.slice(0),scheduleIndex:e}),h.cue.once)){var l;this.updateSchedule();const g=(l=this.schedule)==null?void 0:l.items;if(r&&g){const p=this.findItemIndex(r);this.advanceSchedule(p,g,t,n,o)}return}}this.advanceSchedule(e,i,t,n,o)}advanceSchedule(e,t,s,i,r){const n=this.schedule;if(!n)return;const o=t[e]||null,c=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach(h=>{const d=h.interstitial,u=n.findEventIndex(d.identifier);(ue+1)&&this.clearInterstitial(d,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const h=o.event;if(s===void 0){s=n.findAssetIndex(h,this.timelinePos);const g=Ks(h,s-1);if(h.isAssetPastPlayoutLimit(g)||h.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(h,e,s);return}s=g}const d=this.waitingItem;this.assetsBuffered(o,c)||this.setBufferingItem(o);let u=this.preloadAssets(h,s);if(this.eventItemsMatch(o,d||i)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Fe(o)} ${h.appendInPlace?"append in place":""}`),this.hls.trigger(m.INTERSTITIAL_STARTED,{event:h,schedule:t.slice(0),scheduleIndex:e})),!h.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${h}`);return}if(h.assetListLoader&&(h.assetListLoader.destroy(),h.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${h}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const f=h.assetList[s];if(!f){this.advanceAfterAssetEnded(h,e,s||0);return}if(u||(u=this.getAssetPlayer(f.identifier)),u===null||u.destroyed){const g=h.assetList.length;this.warn(`asset ${s+1}/${g} player destroyed ${h}`),u=this.createAssetPlayer(h,f,s),u.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&h.appendInPlace&&this.isAssetBuffered(f))return;this.startAssetPlayer(u,s,t,e,c),this.shouldPlay&&tn(u.media)}else o?(this.resumePrimary(o,e,i),this.shouldPlay&&tn(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(n.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,s){var i,r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Fe(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let o=this.timelinePos;(o=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(Xt("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!s)return;const n=(r=this.schedule)==null?void 0:r.items;n&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Fe(e)}`),this.hls.trigger(m.INTERSTITIALS_PRIMARY_RESUMED,{schedule:n.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const s=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(si.edge))return this.hls.liveSyncPosition||-1}return s}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:j.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,s){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),s&&this.startLoadingPrimaryAt(e,s)),s||(this.log(Xt("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,s))}startLoadingPrimaryAt(e,t){var s;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((s=i.mainForwardBufferInfo)==null?void 0:s.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(m.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(m.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const s=this.hls.levels[t.level];if(!s.details)return;const i=se(se({},this.mediaSelection||this.altSelection),{},{main:s});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const s=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=se(se({},this.altSelection),{},{audio:s});return}const r=se(se({},i),{},{audio:s});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const s=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=se(se({},this.altSelection),{},{subtitles:s});return}const r=se(se({},i),{},{subtitles:s});this.mediaSelection=r}onAudioTrackSwitching(e,t){const s=hr(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(s)))}onSubtitleTrackSwitch(e,t){const s=hr(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.setSubtitleOption(s)))}onBufferCodecs(e,t){const s=t.tracks;s&&(this.requiredTracks=s)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const s=this.playingItem;if(s&&!this.itemsMatch(s,this.bufferingItem)&&!this.isInterstitial(s)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos.25){e.event.assetList.forEach((r,n)=>{e.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(r.identifier,null)});const s=e.end+.25,i=j.bufferInfo(this.primaryMedia,s,0);(i.end>s||(i.nextStart||0)>s)&&(this.log(`trim buffered interstitial ${Fe(e)} (was ${Fe(t)})`),this.attachPrimary(s,null,!0),this.flushFrontBuffer(s))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var s;return!!t&&(e===t||e.event.identifier===((s=t.event)==null?void 0:s.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const s=this.mediaSelection;s&&((t=this.schedule)==null||t.updateSchedule(s,[],e))}checkBuffer(e){var t;const s=(t=this.schedule)==null?void 0:t.items;if(!s)return;const i=j.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,s,e)}updateBufferedPos(e,t,s){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const n=this.playingItem,o=this.findItemIndex(n);let c=i.findItemIndexAtTime(e);if(this.bufferedPos=r.end||(l=u.event)!=null&&l.appendInPlace&&e+.01>=u.start)&&(c=d),this.isInterstitial(r)){const f=r.event;if(d-o>1&&f.appendInPlace===!1||f.assetList.length===0&&f.assetListLoader)return}if(this.bufferedPos=e,c>h&&c>o)this.bufferedToItem(u);else{const f=this.primaryDetails;this.primaryLive&&f&&e>f.edge-f.targetduration&&u.start{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,s=this.schedule;if(!this.itemsMatch(e,t)&&s){const{items:i,events:r}=s;if(!i||!r)return t;const n=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Fe(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(n){const l=s.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((h,d)=>{const u=this.getAssetPlayer(h.identifier);u&&(d===l&&u.loadSource(),u.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(l=>l.pauseBuffering());this.hls.trigger(m.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const s=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(s!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),s=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(s)}bufferedToEvent(e,t){const s=e.event,i=s.assetList.length===0&&!s.assetListLoader,r=s.cue.once;if(i||!r){const n=this.preloadAssets(s,t);if(n!=null&&n.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(n,o)}}}preloadAssets(e,t){const s=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,n=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var o;const u=this.playingItem;!this.isInterstitial(u)&&(u==null||(o=u.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let l,h=0;if(!this.playingItem&&this.primaryLive&&(h=this.hls.startPosition,h===-1&&(h=this.hls.liveSyncPosition||0)),h&&!(e.cue.pre||e.cue.post)){const u=h-c;u>0&&(l=Math.round(u*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${s?1:i} ${e}${l?` live-start: ${h} start-offset: ${l}`:""}`),s)return this.createAsset(e,0,0,c,e.duration,s);const d=this.assetListLoader.loadAssetList(e,l);d&&(e.assetListLoader=d)}else if(!n&&i){for(let l=t;l{this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let s=0;s1){const x=t.duration;x&&S{if(S.live){var x;const R=new Error(`Interstitials MUST be VOD assets ${e}`),_={fatal:!0,type:V.OTHER_ERROR,details:b.INTERSTITIAL_ASSET_ITEM_ERROR,error:R},I=((x=this.schedule)==null?void 0:x.findEventIndex(e.identifier))||-1;this.handleAssetItemError(_,e,I,s,R.message);return}const D=S.edge-S.fragmentStart,A=t.duration;(p||A===null||D>A)&&(p=!1,this.log(`Interstitial asset "${d}" duration change ${A} > ${D}`),t.duration=D,this.updateSchedule())};g.on(m.LEVEL_UPDATED,(S,{details:x})=>E(x)),g.on(m.LEVEL_PTS_UPDATED,(S,{details:x})=>E(x)),g.on(m.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const y=(S,x)=>{const D=this.getAssetPlayer(d);if(D&&x.tracks){D.off(m.BUFFER_CODECS,y),D.tracks=x.tracks;const A=this.primaryMedia;this.bufferingAsset===D.assetItem&&A&&!D.media&&this.bufferAssetPlayer(D,A)}};g.on(m.BUFFER_CODECS,y);const T=()=>{var S;const x=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${x}`),!x||!this.schedule)return;const D=this.schedule.findEventIndex(e.identifier),A=(S=this.schedule.items)==null?void 0:S[D];this.isInterstitial(A)&&this.advanceAssetBuffering(A,t)};g.on(m.BUFFERED_TO_END,T);const v=S=>()=>{if(!this.getAssetPlayer(d)||!this.schedule)return;this.shouldPlay=!0;const D=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,D,S)};return g.once(m.MEDIA_ENDED,v(s)),g.once(m.PLAYOUT_LIMIT_REACHED,v(1/0)),g.on(m.ERROR,(S,x)=>{if(!this.schedule)return;const D=this.getAssetPlayer(d);if(x.details===b.BUFFER_STALLED_ERROR){if(D!=null&&D.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(x,e,this.schedule.findEventIndex(e.identifier),s,`Asset player error ${x.error} ${e}`)}),g.on(m.DESTROYING,()=>{if(!this.getAssetPlayer(d)||!this.schedule)return;const x=new Error(`Asset player destroyed unexpectedly ${d}`),D={fatal:!0,type:V.OTHER_ERROR,details:b.INTERSTITIAL_ASSET_ITEM_ERROR,error:x};this.handleAssetItemError(D,e,this.schedule.findEventIndex(e.identifier),s,x.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${yt(t)}`),this.hls.trigger(m.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:s,event:e,player:g}),g}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(s=>{this.clearAssetPlayer(s.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const s=this.playerQueue[t];this.transferMediaFromPlayer(s,null),s.resetDetails()}}clearAssetPlayer(e,t){const s=this.getAssetPlayerQueueIndex(e);if(s!==-1){const i=this.playerQueue[s];this.log(`clear ${i} toSegment: ${t&&Fe(t)}`),this.transferMediaFromPlayer(i,t),this.playerQueue.splice(s,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,s,i,r){const{interstitial:n,assetItem:o,assetId:c}=e,l=n.assetList.length,h=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!h||h.identifier!==c)&&(h&&(this.clearAssetPlayer(h.identifier,s[i]),delete h.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${yt(o)}`),this.hls.trigger(m.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:n,schedule:s.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var s,i;if(!this.schedule)return;const{interstitial:r,assetItem:n}=e,o=this.schedule.findEventIndex(r.identifier),c=(s=this.schedule.items)==null?void 0:s[o];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=n;const l=this.getBufferingPlayer();if(l===e)return;const h=r.appendInPlace;if(h&&l?.interstitial.appendInPlace===!1)return;const d=l?.tracks||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(h&&n!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(d&&!pn(d,e.tracks)){const u=new Error(`Asset ${yt(n)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(d)}')`),f={fatal:!0,type:V.OTHER_ERROR,details:b.INTERSTITIAL_ASSET_ITEM_ERROR,error:u},g=r.findAssetIndex(n);this.handleAssetItemError(f,r,o,g,u.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,s=this.primaryMedia;if(!t||!s)return;const i=s.currentTime,r=t.findAssetIndex(e,i),n=e.assetList[r];if(n){const o=this.getAssetPlayer(n.identifier);if(o){const c=o.currentTime||i-n.timelineStart,l=o.duration-c;if(this.warn(`Stalled at ${c} of ${c+l} in ${o} ${e} (media.currentTime: ${i})`),c&&(l/s.playbackRate<.5||o.bufferedInPlaceToEnd(s))&&o.hls){const h=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,h,r)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime!p.error))t.error=g;else for(let p=i;p{const y=parseFloat(p.DURATION);this.createAsset(r,E,h,c+h,y,p.URI),h+=y}),r.duration=h,this.log(`Loaded asset-list with duration: ${h} (was: ${l}) ${r}`);const d=this.waitingItem,u=d?.event.identifier===n;this.updateSchedule();const f=(i=this.bufferingItem)==null?void 0:i.event;if(u){var g;const p=this.schedule.findEventIndex(n),E=(g=this.schedule.items)==null?void 0:g[p];if(E){if(!this.playingItem&&this.timelinePos>E.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==p){r.error=new Error(`Interstitial ${o.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${r}`),this.log(r.error.message),this.updateSchedule(!0),this.primaryFallback(r);return}this.setBufferingItem(E)}this.setSchedulePosition(p)}else if(f?.identifier===n){const p=r.assetList[0];if(p){const E=this.getAssetPlayer(p.identifier);if(f.appendInPlace){const y=this.primaryMedia;E&&y&&this.bufferAssetPlayer(E,y)}else E&&E.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case b.ASSET_LIST_PARSING_ERROR:case b.ASSET_LIST_LOAD_ERROR:case b.ASSET_LIST_LOAD_TIMEOUT:{const s=t.interstitial;s&&(this.updateSchedule(!0),this.primaryFallback(s));break}case b.BUFFER_STALLED_ERROR:{const s=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&s.event.appendInPlace){this.handleInPlaceStall(s.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const sn=500;class Cd extends _i{constructor(e,t,s){super(e,t,s,"subtitle-stream-controller",B.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=C.IDLE,this.setInterval(sn),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:s,success:i}=t;if(this.fragContextChanged(s)||(he(s)&&(this.fragPrevious=s),this.state=C.IDLE),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let n;const o=s.start;for(let l=0;l=r[l].start&&o<=r[l].end){n=r[l];break}const c=s.start+s.duration;n?n.end=c:(n={start:o,end:c},r.push(n)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:s,endOffset:i}=t;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew Ft(s));return}this.tracksBuffered=[],this.levels=t.map(s=>{const i=new Ft(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,B.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var s;if(this.currentTrackId=t.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==C.STOPPED&&this.setInterval(sn)}onSubtitleTrackLoaded(e,t){var s;const{currentTrackId:i,levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=r[o];if(o>=r.length||!c)return;this.log(`Subtitle track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(n.live||(s=c.details)!=null&&s.live){if(n.deltaUpdateFailed)return;const d=this.mainDetails;if(!d){this.startFragRequested=!1;return}const u=d.fragments[0];if(!c.details)n.hasProgramDateTime&&d.hasProgramDateTime?(Ts(n,d),l=n.fragmentStart):u&&(l=u.start,oi(n,l));else{var h;l=this.alignPlaylists(n,c.details,(h=this.levelLastLoaded)==null?void 0:h.details),l===0&&u&&(l=u.start,oi(n,l))}d&&!this.startFragRequested&&this.setStartPosition(d,l)}c.details=n,this.levelLastLoaded=c,o===i&&(this.hls.trigger(m.SUBTITLE_TRACK_UPDATED,{details:n,id:o,groupId:t.groupId}),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===C.IDLE&&(dt(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:s}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&s&&s.byteLength>0&&i!=null&&i.key&&i.iv&&St(i.method)){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer,Ri(i.method)).catch(o=>{throw r.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();r.trigger(m.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:n,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=C.IDLE})}}doTick(){if(!this.media){this.state=C.IDLE;return}if(this.state===C.IDLE){const{currentTrackId:e,levels:t}=this,s=t?.[e];if(!s||!t.length||!s.details||this.waitForLive(s))return;const{config:i}=this,r=this.getLoadPosition(),n=j.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:c}=n,l=s.details,h=this.hls.maxBufferLength+l.levelTargetDuration;if(c>h)return;const d=l.fragments,u=d.length,f=l.edge;let g=null;const p=this.fragPrevious;if(of-T?0:T;g=dt(p,d,Math.max(d[0].start,o),v),!g&&p&&p.start{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][s]};this.buffered={get length(){return e.length},end(s){return t("end",s,e.length)},start(s){return t("start",s,e.length)}}}}const kd={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Fa=a=>String.fromCharCode(kd[a]||a),Me=15,qe=100,wd={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Od={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Fd={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Md={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Nd=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Bd{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const s=typeof t=="function"?t():t;ie.log(`${this.time} [${e}] ${s}`)}}}const lt=function(e){const t=[];for(let s=0;sqe&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=qe)}moveCursor(e){const t=this.pos+e;if(e>1)for(let s=this.pos+1;s=144&&this.backSpace();const t=Fa(e);if(this.pos>=qe){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+ae(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+ae(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let s="",i=-1;for(let r=0;r0&&(e?s="["+t.join(" | ")+"]":s=t.join(` -`)),s}getTextAndFormat(){return this.rows}}class rn{constructor(e,t,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Vs(s),this.nonDisplayedMemory=new Vs(s),this.lastOutputScreen=new Vs(s),this.currRollUpRow=this.displayedMemory.rows[Me-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Me-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let s=0;st+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const s=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[s]}this.logger.log(2,"MIDROW: "+ae(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class nn{constructor(e,t,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Kd(),this.logger=void 0;const i=this.logger=new Bd;this.channels=[null,new rn(e,t,i),new rn(e+1,s,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let s=0;s"["+lt([t[s],t[s+1]])+"] -> ("+lt([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(Gd(i,r,c)){Qt(null,null,c),this.logger.log(3,()=>"Repeated command ("+lt([i,r])+") is dropped");continue}Qt(i,r,this.cmdHistory),n=this.parseCmd(i,r),n||(n=this.parseMidrow(i,r)),n||(n=this.parsePAC(i,r)),n||(n=this.parseBackgroundAttributes(i,r))}else Qt(null,null,c);if(!n&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+lt([i,r])+" orig: "+lt([t[s],t[s+1]]))}}parseCmd(e,t){const s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(s||i))return!1;const r=e===20||e===21||e===23?1:2,n=this.channels[r];return e===20||e===21||e===28||e===29?t===32?n.ccRCL():t===33?n.ccBS():t===34?n.ccAOF():t===35?n.ccAON():t===36?n.ccDER():t===37?n.ccRU(2):t===38?n.ccRU(3):t===39?n.ccRU(4):t===40?n.ccFON():t===41?n.ccRDC():t===42?n.ccTR():t===43?n.ccRTD():t===44?n.ccEDM():t===45?n.ccCR():t===46?n.ccENM():t===47&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let s=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+lt([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let s;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const n=e<=23?1:2;t>=64&&t<=95?s=n===1?wd[e]:Fd[e]:s=n===1?Od[e]:Md[e];const o=this.channels[n];return o?(o.setPAC(this.interpretPAC(s,t)),this.currentChannel=n,!0):!1}interpretPAC(e,t){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?s=t-96:s=t-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(e,t){let s,i=null,r=null;if(e>=25?(s=2,r=e-8):(s=1,r=e),r>=17&&r<=19){let n;r===17?n=t+80:r===18?n=t+112:n=t+144,this.logger.log(2,()=>"Special char '"+Fa(n)+"' in channel "+s),i=[n]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+lt(i).join(",")),i}parseBackgroundAttributes(e,t){const s=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(s||i))return!1;let r;const n={};e===16||e===24?(r=Math.floor((t-32)/2),n.background=Nd[r],t%2===1&&(n.background=n.background+"_semi")):t===45?n.background="transparent":(n.foreground="black",t===47&&(n.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(n),!0}reset(){for(let e=0;e100)throw new Error("Position must be between 0 and 100.");D=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},d,{get:function(){return A},set:function(I){const P=i(I);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");A=P,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},d,{get:function(){return R},set:function(I){if(I<0||I>100)throw new Error("Size must be between 0 and 100.");R=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},d,{get:function(){return _},set:function(I){const P=i(I);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");_=P,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n})();class Vd{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Na(a){function e(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class Hd{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,s){return s?this.has(e)?this.values[e]:t[s]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,s){for(let i=0;i=0&&s<=100)return this.set(e,s),!0}return!1}}function Ba(a,e,t,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(t);if(n.length!==2)continue;const o=n[0],c=n[1];e(o,c)}}const mi=new $i(0,0,""),Zt=mi.align==="middle"?"middle":"center";function Yd(a,e,t){const s=a;function i(){const o=Na(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,c){const l=new Hd;Ba(o,function(u,f){let g;switch(u){case"region":for(let p=t.length-1;p>=0;p--)if(t[p].id===f){l.set(u,t[p].region);break}break;case"vertical":l.alt(u,f,["rl","lr"]);break;case"line":g=f.split(","),l.integer(u,g[0]),l.percent(u,g[0])&&l.set("snapToLines",!1),l.alt(u,g[0],["auto"]),g.length===2&&l.alt("lineAlign",g[1],["start",Zt,"end"]);break;case"position":g=f.split(","),l.percent(u,g[0]),g.length===2&&l.alt("positionAlign",g[1],["start",Zt,"end","line-left","line-right","auto"]);break;case"size":l.percent(u,f);break;case"align":l.alt(u,f,["start",Zt,"end","left","right"]);break}},/:/,/\s/),c.region=l.get("region",null),c.vertical=l.get("vertical","");let h=l.get("line","auto");h==="auto"&&mi.line===-1&&(h=-1),c.line=h,c.lineAlign=l.get("lineAlign","start"),c.snapToLines=l.get("snapToLines",!0),c.size=l.get("size",100),c.align=l.get("align",Zt);let d=l.get("position","auto");d==="auto"&&mi.position===50&&(d=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=d}function n(){a=a.replace(/^\s+/,"")}if(n(),e.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),e.endTime=i(),n(),r(a,e)}function Ua(a){return a.replace(//gi,` -`)}class Wd{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Vd,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function s(){let r=t.buffer,n=0;for(r=Ua(r);n")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Yd(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` -`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` - -`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const jd=/\r\n|\n\r|\n|\r/g,Hs=function(e,t,s=0){return e.slice(s,s+t.length)===t},qd=function(e){let t=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!M(t)||!M(s)||!M(i)||!M(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*s,t+=60*1e3*i,t+=3600*1e3*r,t};function Gi(a,e,t){return kt(a.toString())+kt(e.toString())+kt(t)}const zd=function(e,t,s){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=s};function Xd(a,e,t,s,i,r,n){const o=new Wd,c=_e(new Uint8Array(a)).trim().replace(jd,` -`).split(` -`),l=[],h=e?sh(e.baseTime,e.timescale):0;let d="00:00.000",u=0,f=0,g,p=!0;o.oncue=function(E){const y=t[s];let T=t.ccOffset;const v=(u-h)/9e4;if(y!=null&&y.new&&(f!==void 0?T=t.ccOffset=y.start:zd(t,s,v)),v){if(!e){g=new Error("Missing initPTS for VTT MPEGTS");return}T=v-t.presentationOffset}const S=E.endTime-E.startTime,x=Le((E.startTime+T-f)*9e4,i*9e4)/9e4;E.startTime=Math.max(x,0),E.endTime=Math.max(x+S,0);const D=E.text.trim();E.text=decodeURIComponent(encodeURIComponent(D)),E.id||(E.id=Gi(E.startTime,E.endTime,D)),E.endTime>0&&l.push(E)},o.onparsingerror=function(E){g=E},o.onflush=function(){if(g){n(g);return}r(l)},c.forEach(E=>{if(p)if(Hs(E,"X-TIMESTAMP-MAP=")){p=!1,E.slice(16).split(",").forEach(y=>{Hs(y,"LOCAL:")?d=y.slice(6):Hs(y,"MPEGTS:")&&(u=parseInt(y.slice(7)))});try{f=qd(d)/1e3}catch(y){g=y}return}else E===""&&(p=!1);o.parse(E+` -`)}),o.flush()}const Ys="stpp.ttml.im1t",$a=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ga=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Qd={left:"start",center:"center",right:"end",start:"start",end:"end"};function an(a,e,t,s){const i=X(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>_e(o)),n=th(e.baseTime,1,e.timescale);try{r.forEach(o=>t(Zd(o,n)))}catch(o){s(o)}}function Zd(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((d,u)=>(d[u]=i.getAttribute(`ttp:${u}`)||r[u],d),{}),o=i.getAttribute("xml:space")!=="preserve",c=on(Ws(i,"styling","style")),l=on(Ws(i,"layout","region")),h=Ws(i,"body","[begin]");return[].map.call(h,d=>{const u=Ka(d,o);if(!u||!d.hasAttribute("begin"))return null;const f=qs(d.getAttribute("begin"),n),g=qs(d.getAttribute("dur"),n);let p=qs(d.getAttribute("end"),n);if(f===null)throw ln(d);if(p===null){if(g===null)throw ln(d);p=f+g}const E=new $i(f-e,p-e,u);E.id=Gi(E.startTime,E.endTime,E.text);const y=l[d.getAttribute("region")],T=c[d.getAttribute("style")],v=Jd(y,T,c),{textAlign:S}=v;if(S){const x=Qd[S];x&&(E.lineAlign=x),E.align=S}return re(E,v),E}).filter(d=>d!==null)}function Ws(a,e,t){const s=a.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(t)):[]}function on(a){return a.reduce((e,t)=>{const s=t.getAttribute("xml:id");return s&&(e[s]=t),e},{})}function Ka(a,e){return[].slice.call(a.childNodes).reduce((t,s,i)=>{var r;return s.nodeName==="br"&&i?t+` -`:(r=s.childNodes)!=null&&r.length?Ka(s,e):e?t+s.textContent.trim().replace(/\s+/g," "):t+s.textContent},"")}function Jd(a,e,t){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&t.hasOwnProperty(n)&&(i=t[n]),r.reduce((o,c)=>{const l=js(e,s,c)||js(a,s,c)||js(i,s,c);return l&&(o[c]=l),o},{})}function js(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function ln(a){return new Error(`Could not parse ttml timestamp ${a}`)}function qs(a,e){if(!a)return null;let t=Na(a);return t===null&&($a.test(a)?t=eu(a,e):Ga.test(a)&&(t=tu(a,e))),t}function eu(a,e){const t=$a.exec(a),s=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+s/e.frameRate}function tu(a,e){const t=Ga.exec(a),s=Number(t[1]);switch(t[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class Jt{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,s){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class su{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=hn(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Jt(this,"textTrack1"),t=new Jt(this,"textTrack2"),s=new Jt(this,"textTrack3"),i=new Jt(this,"textTrack4");this.cea608Parser1=new nn(1,e,t),this.cea608Parser2=new nn(3,s,i)}addCues(e,t,s,i,r){let n=!1;for(let o=r.length;o--;){const c=r[o],l=iu(c[0],c[1],t,s);if(l>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],s),n=!0,l/(s-t)>.5))return}if(n||r.push([t,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,s,i)}else{const o=this.Cues.newCue(null,t,s,i);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r,trackId:n}){const{unparsedVttFrags:o}=this;s===B.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r,trackId:n}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(m.FRAG_LOADED,c):this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:s}=this;if(s)for(let i=0;i{Tt(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=hn(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let s=0;sr.textCodec===Ys);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Ta(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media,o=n?cs(n.textTracks):null;if(this.tracks.forEach((c,l)=>{let h;if(o){let d=null;for(let u=0;ul!==null).map(l=>l.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const n=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r=`textTrack${i[1]}`,n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t?.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===B.MAIN){var s,i;const{cea608Parser1:r,cea608Parser2:n,lastSn:o}=this,{cc:c,sn:l}=t.frag,h=(s=(i=t.part)==null?void 0:i.index)!=null?s:-1;r&&n&&(l!==o+1||l===o&&h!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),n.reset()),this.lastCc=c,this.lastSn=l,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:s,payload:i}=t;if(s.type===B.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in t;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],c=this.vttCCs;c[s.cc]||(c[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===Ys?this._parseIMSC1(s,i):this._parseVTTs(t)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const s=this.hls;an(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{s.logger.log(`Failed to parse IMSC1: ${i}`),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:s,payload:i}=e,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(e);return}const c=this.hls,l=(t=s.initSegment)!=null&&t.data?Pe(s.initSegment.data,new Uint8Array(i)).buffer:i;Xd(l,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),c.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const d=h.message==="Missing initPTS for VTT MPEGTS";d?n.push(e):this._fallbackToIMSC1(s,i),c.logger.log(`Failed to parse VTT cue: ${h}`),!(d&&o>s.cc)&&c.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(e,t){const s=this.tracks[e.level];s.textCodec||an(t,this.initPTS[e.cc],()=>{s.textCodec=Ys,this._parseIMSC1(e,t)},()=>{s.textCodec="wvtt"})}_appendCues(e,t){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>wa(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;s.trigger(m.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:s}=t;s.type===B.SUBTITLE&&this.onFragLoaded(m.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:s,samples:i}=t;if(!(s.type===B.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let r=0;rgi(o[c],t,s))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>gi(o[c],t,i))}}}extractCea608Data(e){const t=[[],[]],s=e[0]&31;let i=2;for(let r=0;r=16?c--:c++;const f=Ua(l.trim()),g=Gi(e,t,f);a!=null&&(d=a.cues)!=null&&d.getCueById(g)||(n=new h(e,t,f),n.id=g,n.line=u+1,n.align="left",n.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((u,f)=>u.line==="auto"||f.line==="auto"?0:u.line>8&&f.line>8?f.line-u.line:u.line-f.line),i.forEach(u=>wa(a,u))),i}};function au(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const ou=/(\d+)-(\d+)\/(\d+)/;class dn{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||du,this.controller=new self.AbortController,this.stats=new Ti}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=lu(e,this.controller.signal),n=e.responseType==="arraybuffer",o=n?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=s,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&M(c)?c:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(Bt(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var u;this.response=this.loader=d;const f=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},l-(f-i.loading.start)),!d.ok){const{status:p,statusText:E}=d;throw new uu(E||"fetch, bad network response",p,d)}i.loading.first=f,i.total=hu(d.headers)||i.total;const g=(u=this.callbacks)==null?void 0:u.onProgress;return g&&M(t.highWaterMark)?this.loadProgressively(d,i,e,t.highWaterMark,g):n?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var u,f;const g=this.response;if(!g)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const p=d[o];p&&(i.loaded=i.total=p);const E={url:g.url,data:d,code:g.status},y=(u=this.callbacks)==null?void 0:u.onProgress;y&&!M(t.highWaterMark)&&y(i,e,d,g),(f=this.callbacks)==null||f.onSuccess(E,i,e,g)}).catch(d=>{var u;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const f=d&&d.code||0,g=d?d.message:null;(u=this.callbacks)==null||u.onError({code:f,text:g},e,d?d.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,s,i=0,r){const n=new Jn,o=e.body.getReader(),c=()=>o.read().then(l=>{if(l.done)return n.dataLength&&r(t,s,n.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const h=l.value,d=h.length;return t.loaded+=d,d=i&&r(t,s,n.flush().buffer,e)):r(t,s,h.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function lu(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(re({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function cu(a){const e=ou.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function hu(a){const e=a.get("Content-Range");if(e){const s=cu(e);if(M(s))return s}const t=a.get("Content-Length");if(t)return parseInt(t)}function du(a,e){return new self.Request(a.url,e)}class uu extends Error{constructor(e,t,s){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=s}}const fu=/^age:\s*[\d.]+\s*$/im;class Ha{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ti,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return r(s,t.url)}).catch(n=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",t.url,!0),r(s,t.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,t,e)}).catch(n=>{var o;(o=this.callbacks)==null||o.onError({code:s.status,text:n.message},t,s,i)}):this.openAndSendXhr(s,t,e)}openAndSendXhr(e,t,s){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&M(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:s}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const l=t.status,h=t.responseType==="text"?t.responseText:null;if(l>=200&&l<300){const g=h??t.response;if(g!=null){var n,o;s.loading.end=Math.max(self.performance.now(),s.loading.first);const p=t.responseType==="arraybuffer"?g.byteLength:g.length;s.loaded=s.total=p,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first);const E=(n=this.callbacks)==null?void 0:n.onProgress;E&&E(s,e,g,t);const y={url:t.responseURL,data:g,code:l};(o=this.callbacks)==null||o.onSuccess(y,s,e,t);return}}const d=r.loadPolicy.errorRetry,u=s.retry,f={url:e.url,data:void 0,code:l};if(ps(d,u,!1,f))this.retry(d);else{var c;ie.error(`${l} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:l,text:t.statusText},e,t,s)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(ps(e,t,!0))this.retry(e);else{var s;ie.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:s}=this;this.retryDelay=Ai(e,s.retry),s.retry++,ie.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t?.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&fu.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const gu={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},mu=se(se({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Ha,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:bl,bufferController:Eh,capLevelController:Ni,errorController:kl,fpsController:yd,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Kn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:gu},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},pu()),{},{subtitleStreamController:Cd,subtitleTrackController:Sd,timelineController:su,audioStreamController:fh,audioTrackController:gh,emeController:xt,cmcdController:gd,contentSteeringController:pd,interstitialsController:Dd});function pu(){return{cueHandler:nu,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Eu(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=pi(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(n=>{const o=`${n==="level"?"playlist":n}LoadPolicy`,c=e[o]===void 0,l=[];r.forEach(h=>{const d=`${n}Loading${h}`,u=e[d];if(u!==void 0&&c){l.push(d);const f=s[o].default;switch(e[o]={default:f},h){case"TimeOut":f.maxLoadTimeMs=u,f.maxTimeToFirstByteMs=u;break;case"MaxRetry":f.errorRetry.maxNumRetry=u,f.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":f.errorRetry.retryDelayMs=u,f.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":f.errorRetry.maxRetryDelayMs=u,f.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${ae(e[o])}`)}),se(se({},s),e)}function pi(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(pi):Object.keys(a).reduce((e,t)=>(e[t]=pi(a[t]),e),{}):a}function yu(a,e){const t=a.loader;t!==dn&&t!==Ha?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):au()&&(a.loader=dn,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const hs=2,Tu=.1,vu=.05,Su=100;class xu extends Nn{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var s;(s=this.media)!=null&&s.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var s;this.ended=((s=this.media)==null?void 0:s.currentTime)||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Su),this.mediaSource=t.mediaSource;const s=this.media=t.media;ve(s,"playing",this.onMediaPlaying),ve(s,"waiting",this.onMediaWaiting),ve(s,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:s}=this;s&&(xe(s,"playing",this.onMediaPlaying),xe(s,"waiting",this.onMediaWaiting),xe(s,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var s,i;const r=(s=this.hls)==null?void 0:s.config;if(!r)return;const n=this.media;if(!n)return;const{seeking:o}=n,c=this.seeking&&!o,l=!this.seeking&&o,h=n.paused&&!o||n.ended||n.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!h&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(l||c){c&&this.stallResolved(e);return}if(h){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&n.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!1}));return}if(!j.getBuffered(n).length){this.nudgeRetry=0;return}const d=j.bufferInfo(n,e,0),u=d.nextStart||0,f=this.fragmentTracker;if(o&&f&&this.hls){const D=un(this.hls.inFlightFragments,e),A=d.len>hs,R=!u||D||u-e>hs&&!f.getPartialFragment(e);if(A||R)return;this.moved=!1}const g=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&f){if(!(d.len>0)&&!u)return;const A=Math.max(u,d.start||0)-e,_=!!(g!=null&&g.live)?g.targetduration*2:hs,I=es(e,f);if(A>0&&(A<=_||I)){n.paused||this._trySkipBufferHole(I);return}}const p=r.detectStallWithCurrentTimeMs,E=self.performance.now(),y=this.waiting;let T=this.stalled;if(T===null)if(y>0&&E-y=p||y)&&this.hls){var S;if(((S=this.mediaSource)==null?void 0:S.readyState)==="ended"&&!(g!=null&&g.live)&&Math.abs(e-(g?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(d),!this.media||!this.hls)return}const x=j.bufferInfo(n,e,r.maxBufferHole);this._tryFixBufferStall(x,v,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const s=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(s)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(m.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var s;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(s=this.buffered.audio)!=null&&s.length&&i&&i.length>1&&e>i.end(0)){const r=j.bufferedInfo(j.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const n=j.timeRangesToArray(i),o=j.bufferedInfo(n,t,0).bufferedIndex;if(o>-1&&oo)&&h-l<1&&e-l<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${h} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;let u=es(e,this.fragmentTracker);u&&"fragment"in u?u=u.fragment:u||(u=void 0);const f=j.bufferInfo(this.media,e,0);this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:u,buffer:f.len,bufferInfo:f})}}}}}_tryFixBufferStall(e,t,s){var i,r;const{fragmentTracker:n,media:o}=this,c=(i=this.hls)==null?void 0:i.config;if(!o||!n||!c)return;const l=(r=this.hls)==null?void 0:r.latestLevelDetails,h=es(s,n);if((h||l!=null&&l.live&&s1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-sc.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const s=this.fragmentTracker,i=e.nextStart;if(s&&i){const r=s.getFragAtPos(t,B.MAIN),n=s.getFragAtPos(i,B.MAIN);if(r&&n)return n.sn-r.sn<2}return!1}_reportStall(e){const{hls:t,media:s,stallReported:i,stalled:r}=this;if(!i&&r!==null&&s&&t){this.stallReported=!0;const n=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${ae(e)})`);this.warn(n.message),t.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:s,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!s||!r)return 0;const n=i.currentTime,o=j.bufferInfo(i,n,0),c=n0&&o.len<1&&i.readyState<3,u=c-n;if(u>0&&(h||d)){if(u>r.maxBufferHole){let g=!1;if(n===0){const p=s.getAppendedFrag(0,B.MAIN);p&&c"u"))return self.VTTCue||self.TextTrackCue}function zs(a,e,t,s,i){let r=new a(e,t,"");try{r.value=s,i&&(r.type=i)}catch{r=new a(e,t,ae(i?se({type:i},s):s))}return r}const ts=(()=>{const a=Ei();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Iu{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(m.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var s;this.media=t.media,((s=t.overrides)==null?void 0:s.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Tt(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tts&&(d=ts),d-h<=0&&(d=h+Au);for(let f=0;fh.type===Re.audioId3&&c:i==="video"?l=h=>h.type===Re.emsg&&o:l=h=>h.type===Re.audioId3&&c||h.type===Re.emsg&&o,gi(r,t,s,l)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:s,timelineOffset:i,enableDateRangeMetadataCues:r,interstitialsController:n}=this.hls.config;if(!r)return;const o=Ei();if(s&&i&&!n){const{fragmentStart:p,fragmentEnd:E}=e;let y=this.assetCue;y?(y.startTime=p,y.endTime=E):o&&(y=this.assetCue=zs(o,p,E,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),y&&(y.id=s,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(y),y.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:l}=e,h=Object.keys(l);let d=this.dateRangeCuesAppended;if(c&&t){var u;if((u=c.cues)!=null&&u.length){const p=Object.keys(d).filter(E=>!h.includes(E));for(let E=p.length;E--;){var f;const y=p[E],T=(f=d[y])==null?void 0:f.cues;delete d[y],T&&Object.keys(T).forEach(v=>{const S=T[v];if(S){S.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(S)}catch{}}})}}else d=this.dateRangeCuesAppended={}}const g=e.fragments[e.fragments.length-1];if(!(h.length===0||!M(g?.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let p=0;p{if(F!==y.id){const U=l[F];if(U.class===y.class&&U.startDate>y.startDate&&(!P||y.startDate.01&&(F.startTime=T,F.endTime=D);else if(o){let U=y.attr[P];Wl(P)&&(U=En(U));const $=zs(o,T,D,{key:P,data:U},Re.dateRange);$&&($.id=E,this.id3Track.addCue($),S[P]=$,n&&(P==="X-ASSET-LIST"||P==="X-ASSET-URL")&&$.addEventListener("enter",this.onEventCueEnter))}}d[E]={cues:S,dateRange:y,durationKnown:x}}}}}class Lu{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,s=this.levelDetails;if(!t||!s)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:n}=this.config;if(!r||n===1||!s.live)return;const o=this.targetLatency;if(o===null)return;const c=i-o,l=Math.min(this.maxLatency,o+s.targetduration);if(c.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,n)),u=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,f=Math.min(d,Math.max(1,u));this.changeMediaPlaybackRate(t,f)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:s,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let l=o&&s||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||l===0)&&(l=r!==void 0?r:n*i);const h=i;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,h)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const s=this.levelDetails;if(s===null)return null;const i=s.edge,r=e-t-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var s;t.details===b.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(s=this.levelDetails)!=null&&s.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var s,i;e.playbackRate!==t&&((s=this.hls)==null||s.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Ru extends Mi{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const s=this.hls.config.preferManagedMediaSource,i=[],r={},n={};let o=!1,c=!1,l=!1;t.levels.forEach(h=>{const d=h.attrs;let{audioCodec:u,videoCodec:f}=h;u&&(h.audioCodec=u=us(u,s)||void 0),f&&(f=h.videoCodec=ll(f));const{width:g,height:p,unknownCodecs:E}=h,y=E?.length||0;if(o||(o=!!(g&&p)),c||(c=!!f),l||(l=!!u),y||u&&!this.isAudioSupported(u)||f&&!this.isVideoSupported(f)){this.log(`Some or all CODECS not supported "${d.CODECS}"`);return}const{CODECS:T,"FRAME-RATE":v,"HDCP-LEVEL":S,"PATHWAY-ID":x,RESOLUTION:D,"VIDEO-RANGE":A}=d,_=`${`${x||"."}-`}${h.bitrate}-${D}-${v}-${T}-${A}-${S}`;if(r[_])if(r[_].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const I=n[_]+=1;h.attrs["PATHWAY-ID"]=new Array(I+1).join(".");const P=this.createLevel(h);r[_]=P,i.push(P)}else r[_].addGroupId("audio",d.AUDIO),r[_].addGroupId("text",d.SUBTITLES);else{const I=this.createLevel(h);r[_]=I,n[_]=1,i.push(I)}}),this.filterAndSortMediaOptions(i,t,o,c,l)}createLevel(e){const t=new Ft(e),s=e.supplemental;if(s!=null&&s.videoCodec&&!this.isVideoSupported(s.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${s.videoCodec}"`);this.log(i.message),t.supportedResult=Dn(i,[])}return t}isAudioSupported(e){return wt(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return wt(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,s,i,r){var n;let o=[],c=[],l=e;const h=((n=t.stats)==null?void 0:n.parsing)||{};if((s||i)&&r&&(l=l.filter(({videoCodec:T,videoRange:v,width:S,height:x})=>(!!T||!!(S&&x))&&yl(v))),l.length===0){Promise.resolve().then(()=>{if(this.hls){let T="no level with compatible codecs found in manifest",v=T;t.levels.length&&(v=`one or more CODECS in variant not supported: ${ae(t.levels.map(x=>x.attrs.CODECS).filter((x,D,A)=>A.indexOf(x)===D))}`,this.warn(v),T+=` (${v})`);const S=new Error(T);this.hls.trigger(m.ERROR,{type:V.MEDIA_ERROR,details:b.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:S,reason:v})}}),h.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(T=>!T.audioCodec||this.isAudioSupported(T.audioCodec)),gn(o)),t.subtitles&&(c=t.subtitles,gn(c));const d=l.slice(0);l.sort((T,v)=>{if(T.attrs["HDCP-LEVEL"]!==v.attrs["HDCP-LEVEL"])return(T.attrs["HDCP-LEVEL"]||"")>(v.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&T.height!==v.height)return T.height-v.height;if(T.frameRate!==v.frameRate)return T.frameRate-v.frameRate;if(T.videoRange!==v.videoRange)return fs.indexOf(T.videoRange)-fs.indexOf(v.videoRange);if(T.videoCodec!==v.videoCodec){const S=rr(T.videoCodec),x=rr(v.videoCodec);if(S!==x)return x-S}if(T.uri===v.uri&&T.codecSet!==v.codecSet){const S=ds(T.codecSet),x=ds(v.codecSet);if(S!==x)return x-S}return T.averageBitrate!==v.averageBitrate?T.averageBitrate-v.averageBitrate:0});let u=d[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==d.length)){for(let T=0;TS&&S===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=x)}break}const g=r&&!i,p=this.hls.config,E=!!(p.audioStreamController&&p.audioTrackController),y={levels:l,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:E&&!g&&o.some(T=>!!T.url)};h.end=performance.now(),this.hls.trigger(m.MANIFEST_PARSED,y)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:h,reason:h.message}),d)return;e=Math.min(e,t.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,s===e&&i&&r===o)return;this.log(`Switching to level ${e} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${o?" with Pathway "+o:""} from level ${s}${r?" with Pathway "+r:""}`);const c={level:e,attrs:n.attrs,details:n.details,bitrate:n.bitrate,averageBitrate:n.averageBitrate,maxBitrate:n.maxBitrate,realBitrate:n.realBitrate,width:n.width,height:n.height,codecSet:n.codecSet,audioCodec:n.audioCodec,videoCodec:n.videoCodec,audioGroups:n.audioGroups,subtitleGroups:n.subtitleGroups,loaded:n.loaded,loadError:n.loadError,fragmentError:n.fragmentError,name:n.name,id:n.id,uri:n.uri,url:n.url,urlId:0,audioGroupIds:n.audioGroupIds,textGroupIds:n.textGroupIds};this.hls.trigger(m.LEVEL_SWITCHING,c);const l=n.details;if(!l||l.live){const h=this.switchParams(n.uri,i?.details,l);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),s=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=s}}onError(e,t){t.fatal||!t.context||t.context.type===Q.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===B.MAIN){const s=t.elementaryStreams;if(!Object.keys(s).some(r=>!!s[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var s;const{level:i,details:r}=t,n=t.levelInfo;if(!n){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(n===this.currentLevel||t.withoutMultiVariant){n.fragmentError===0&&(n.loadError=0);let c=n.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}else(s=t.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const s=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],n=e.details,o=n?.age;this.log(`Loading level index ${i}${t?.msn!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${o&&n.live?" age "+o.toFixed(1)+(n.type&&" "+n.type||""):""} ${s}`),this.hls.trigger(m.LEVEL_LOADING,{url:s,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const s=this._levels.filter((r,n)=>n!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(o=>o.level=-1)),!1));Xn(s),this._levels=s,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=s.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(m.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(m.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function gn(a){const e={};a.forEach(t=>{const s=t.groupId||"";t.id=e[s]=e[s]||0,e[s]++})}function Ya(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wa(){if(!st())return!1;const e=Ya();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function bu(){if(!Wa())return!1;const a=st();return typeof a?.isTypeSupported=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(Ot(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ot(e,"audio"))))}function _u(){var a;const e=Ya();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Du=100;class Cu extends _i{constructor(e,t,s){super(e,t,s,"stream-controller",B.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,r=i?i.currentTime:null;if(r===null||!M(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const n=this.getFwdBufferInfoAtPos(i,r,B.MAIN,0);if(n===null||n.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${n?n.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:s,hls:i}=this;if(this.stopLoad(),this.setInterval(Du),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}s>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s),this.state=C.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=C.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case C.WAITING_LEVEL:{const{levels:e,level:t}=this,s=e?.[t],i=s?.details;if(i&&(!i.live||this.levelLastLoaded===s&&!this.waitForLive(s))){if(this.waitForCdnTuneIn(i))break;this.state=C.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=C.IDLE;break}break}case C.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===C.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:s,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(s!=null&&s[r]))return;const n=s[r],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const p={};this.altAudio===2&&(p.type="video"),this.hls.trigger(m.BUFFER_EOS,p),this.state=C.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const l=n.details;if(!l||this.state===C.WAITING_LEVEL||this.waitForLive(n)){this.level=r,this.state=C.WAITING_LEVEL,this.startFragRequested=!1;return}const h=o.len,d=this.getMaxBufferLength(n.maxBitrate);if(h>=d)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const u=this.backtrackFragment?this.backtrackFragment.start:o.end;let f=this.getNextFragment(u,l);if(this.couldBacktrack&&!this.fragPrevious&&f&&he(f)&&this.fragmentTracker.getState(f)!==ue.OK){var g;const E=((g=this.backtrackFragment)!=null?g:f).sn-l.startSN,y=l.fragments[E-1];y&&f.cc===y.cc&&(f=y,this.fragmentTracker.removeFragment(y))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,u)){if(!f.gap){const E=this.audioOnly&&!this.altAudio?ne.AUDIO:ne.VIDEO,y=(E===ne.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;y&&this.afterBufferFlushed(y,E,B.MAIN)}f=this.getNextFragmentLoopLoading(f,l,o,B.MAIN,d)}f&&(f.initSegment&&!f.initSegment.data&&!this.bitrateTest&&(f=f.initSegment),this.loadFragment(f,n,u))}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);i===ue.NOT_LOADED||i===ue.PARTIAL?he(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,s):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,B.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let s;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len=n-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r{this.hls&&this.hls.trigger(m.AUDIO_TRACK_SWITCHED,t)}),s.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}s.trigger(m.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const s=gs(t.url,this.hls);if(s){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=s?2:0,this.tick()}onBufferCreated(e,t){const s=t.tracks;let i,r,n=!1;for(const o in s){const c=s[o];if(c.id==="main"){if(r=o,i=c,o==="video"){const l=s[o];l&&(this.videoBuffer=l.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:s,part:i}=t,r=s.type===B.MAIN;if(r){if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===C.PARSED&&(this.state=C.IDLE);return}const o=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),he(s)&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}const n=this.media;n&&(!this._hasEnoughToStart&&j.getBuffered(n).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case b.FRAG_GAP:case b.FRAG_PARSING_ERROR:case b.FRAG_DECRYPT_ERROR:case b.FRAG_LOAD_ERROR:case b.FRAG_LOAD_TIMEOUT:case b.KEY_LOAD_ERROR:case b.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(B.MAIN,t);break;case b.LEVEL_LOAD_ERROR:case b.LEVEL_LOAD_TIMEOUT:case b.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_LEVEL&&((s=t.context)==null?void 0:s.type)===Q.LEVEL&&(this.state=C.IDLE);break;case b.BUFFER_ADD_CODEC_ERROR:case b.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case b.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case b.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=C.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ne.AUDIO||!this.altAudio){const s=(t===ne.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;s&&(this.afterBufferFlushed(s,t,B.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let s=this.startPosition;if(s>=0&&t0&&(c{const{hls:i}=this,r=s?.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=C.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const n=r.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),i.trigger(m.FRAG_LOADED,s),r.bitrateTest=!1}).catch(s=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:s}=this,{remuxResult:i,chunkMeta:r}=e,n=this.getCurrentContext(r);if(!n){this.resetWhenMissingContext(r);return}const{frag:o,part:c,level:l}=n,{video:h,text:d,id3:u,initSegment:f}=i,{details:g}=l,p=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=C.PARSING,f){const E=f.tracks;if(E){const S=o.initSegment||o;if(this.unhandledEncryptionError(f,o))return;this._bufferInitSegment(l,E,S,r),s.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:t,tracks:E})}const y=f.initPTS,T=f.timescale,v=this.initPTS[o.cc];if(M(y)&&(!v||v.baseTime!==y||v.timescale!==T)){const S=f.trackId;this.initPTS[o.cc]={baseTime:y,timescale:T,trackId:S},s.trigger(m.INIT_PTS_FOUND,{frag:o,id:t,initPTS:y,timescale:T,trackId:S})}}if(h&&g){p&&h.type==="audiovideo"&&this.logMuxedErr(o);const E=g.fragments[o.sn-1-g.startSN],y=o.sn===g.startSN,T=!E||o.cc>E.cc;if(i.independent!==!1){const{startPTS:v,endPTS:S,startDTS:x,endDTS:D}=h;if(c)c.elementaryStreams[h.type]={startPTS:v,endPTS:S,startDTS:x,endDTS:D};else if(h.firstKeyFrame&&h.independent&&r.id===1&&!T&&(this.couldBacktrack=!0),h.dropped&&h.independent){const A=this.getMainFwdBufferInfo(),R=(A?A.end:this.getLoadPosition())+this.config.maxBufferHole,_=h.firstKeyFramePTS?h.firstKeyFramePTS:v;if(!y&&R<_-this.config.maxBufferHole&&!T){this.backtrack(o);return}else T&&(o.gap=!0);o.setElementaryStreamInfo(h.type,o.start,S,o.start,D,!0)}else y&&v-(g.appliedTimelineOffset||0)>hs&&(o.gap=!0);o.setElementaryStreamInfo(h.type,v,S,x,D),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(h,o,c,r,y||T)}else if(y||T)o.gap=!0;else{this.backtrack(o);return}}if(p){const{startPTS:E,endPTS:y,startDTS:T,endDTS:v}=p;c&&(c.elementaryStreams[ne.AUDIO]={startPTS:E,endPTS:y,startDTS:T,endDTS:v}),o.setElementaryStreamInfo(ne.AUDIO,E,y,T,v),this.bufferFragmentData(p,o,c,r)}if(g&&u!=null&&u.samples.length){const E={id:t,frag:o,details:g,samples:u.samples};s.trigger(m.FRAG_PARSING_METADATA,E)}if(g&&d){const E={id:t,frag:o,details:g,samples:d.samples};s.trigger(m.FRAG_PARSING_USERDATA,E)}}logMuxedErr(e){this.warn(`${he(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(s));const{audio:r,video:n,audiovideo:o}=t;if(r){const l=e.audioCodec;let h=is(r.codec,l);h==="mp4a"&&(h="mp4a.40.5");const d=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){h&&(h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5");const u=r.metadata;u&&"channelCount"in u&&(u.channelCount||1)!==1&&d.indexOf("firefox")===-1&&(h="mp4a.40.5")}h&&h.indexOf("mp4a.40.5")!==-1&&d.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(h="mp4a.40.2",this.log(`Android: force audio codec to ${h}`)),l&&l!==h&&this.log(`Swapping manifest audio codec "${l}" for "${h}"`),r.levelCodec=h,r.id=B.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${h||""}/${l||""}/${r.codec}]`),delete t.audiovideo}if(n){n.levelCodec=e.videoCodec,n.id=B.MAIN;const l=n.codec;if(l?.length===4)switch(l){case"hvc1":case"hev1":n.codec="hvc1.1.6.L120.90";break;case"av01":n.codec="av01.0.04M.08";break;case"avc1":n.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l}]${n.codec!==l?" parsed-corrected="+n.codec:""}${n.supplemental?" supplemental="+n.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(m.BUFFER_CODECS,t),!this.hls)return;c.forEach(l=>{const d=t[l].initSegment;d!=null&&d.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:l,data:d,frag:s,part:null,chunkMeta:i,parent:s.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,B.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,s=e?.[t];return s?this.getMaxBufferLength(s.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=C.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(j.isBuffered(e,s)?t=this.getAppendedFrag(s):j.isBuffered(e,s+.1)&&(t=this.getAppendedFrag(s+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(m.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(m.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return M(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(M(t)){const s=this.getLevelDetails(),i=this.currentFrag||(s?dt(null,s.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const n=r+(t-i.start)*1e3;return new Date(n)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Pu extends ke{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[s].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=b.KEY_LOAD_ERROR,s,i,r){return new ze({type:V.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:s,networkDetails:i})}loadClear(e,t,s){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i{if(!this.emeController)return;n.setKeyFormat(o);const c=ns(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const i=Dt(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var s,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,l))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));const o=Xs(r);let c=this.keyIdToKeyInfo[o];if((s=c)!=null&&s.decryptdata.key)return r.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(i=c)!=null&&i.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(h=>{const{keyInfo:d}=h;return r.key=d.decryptdata.key,{frag:e,keyInfo:d}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${r.keyId?" keyId: "+pe(r.keyId):""} URI: ${r.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,b.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const s={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var i;if(!e.decryptdata.keyId&&(i=t.initSegment)!=null&&i.data){const n=Xo(t.initSegment.data);if(n.length){let o=n[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${pe(o)}`),tt.setKeyIdForUri(e.decryptdata.uri,o)):(o=tt.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${pe(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!he(t))return Promise.resolve(s);const r=this.emeController.loadKey(s);return(e.keyLoadPromise=r.then(n=>(e.mediaKeySessionContext=n,s))).catch(n=>{throw e.keyLoadPromise=null,"data"in n&&(n.data.frag=t),n})}return Promise.resolve(s)}loadKeyHTTP(e,t){const s=this.config,i=s.loader,r=new i(s);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((n,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=s.keyLoadPolicy.default,h={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(u,f,g,p)=>{const{frag:E,keyInfo:y}=g,T=Xs(y.decryptdata);if(!E.decryptdata||y!==this.keyIdToKeyInfo[T])return o(this.createKeyLoadError(E,b.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),p));y.decryptdata.key=E.decryptdata.key=new Uint8Array(u.data),E.keyLoader=null,y.loader=null,n({frag:E,keyInfo:y})},onError:(u,f,g,p)=>{this.resetLoader(f),o(this.createKeyLoadError(t,b.KEY_LOAD_ERROR,new Error(`HTTP Error ${u.code} loading key ${u.text}`),g,se({url:c.url,data:void 0},u)))},onTimeout:(u,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(t,b.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),g))},onAbort:(u,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(t,b.INTERNAL_ABORTED,new Error("key loading aborted"),g))}};r.load(c,h,d)})}resetLoader(e){const{frag:t,keyInfo:s,url:i}=e,r=s.loader;t.keyLoader===r&&(t.keyLoader=null,s.loader=null);const n=Xs(s.decryptdata)||i;delete this.keyIdToKeyInfo[n],r&&r.destroy()}}function Xs(a){if(a.keyFormat!==Ee.FAIRPLAY){const e=a.keyId;if(e)return pe(e)}return a.uri}function mn(a){const{type:e}=a;switch(e){case Q.AUDIO_TRACK:return B.AUDIO;case Q.SUBTITLE_TRACK:return B.SUBTITLE;default:return B.MAIN}}function Qs(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class ku{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,s=t.pLoader,i=t.loader,r=s||i,n=new r(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:s}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Q.MANIFEST,url:s,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:s,level:i,pathwayId:r,url:n,deliveryDirectives:o,levelInfo:c}=t;this.load({id:s,level:i,pathwayId:r,responseType:"text",type:Q.LEVEL,url:n,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n,track:o}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Q.AUDIO_TRACK,url:r,deliveryDirectives:n,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n,track:o}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Q.SUBTITLE_TRACK,url:r,deliveryDirectives:n,levelOrTrack:o})}onLevelsUpdated(e,t){const s=this.loaders[Q.LEVEL];if(s){const i=s.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(s.abort(),delete this.loaders[Q.LEVEL])}}load(e){var t;const s=this.hls.config;let i=this.getInternalLoader(e);if(i){const l=this.hls.logger,h=i.context;if(h&&h.levelOrTrack===e.levelOrTrack&&(h.url===e.url||h.deliveryDirectives&&!e.deliveryDirectives)){h.url===e.url?l.log(`[playlist-loader]: ignore ${e.url} ongoing request`):l.log(`[playlist-loader]: ignore ${e.url} in favor of ${h.url}`);return}l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Q.MANIFEST?r=s.manifestLoadPolicy.default:r=re({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),M((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===Q.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===Q.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===Q.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const h=l.partTarget,d=l.targetduration;if(h&&d){const u=Math.max(h*3,d*.8)*1e3;r=re({},r,{maxTimeToFirstByteMs:Math.min(u,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(u,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},c={onSuccess:(l,h,d,u)=>{const f=this.getInternalLoader(d);this.resetInternalLoader(d.type);const g=l.data;h.parsing.start=performance.now(),Ve.isMediaPlaylist(g)||d.type!==Q.MANIFEST?this.handleTrackOrLevelPlaylist(l,h,d,u||null,f):this.handleMasterPlaylist(l,h,d,u)},onError:(l,h,d,u)=>{this.handleNetworkError(h,d,!1,l,u)},onTimeout:(l,h,d)=>{this.handleNetworkError(h,d,!0,void 0,l)}};i.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:s}=this.hls;(e||s)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,s,i){const r=this.hls,n=e.data,o=Qs(e,s),c=Ve.parseMasterPlaylist(n,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,s,c.playlistParsingError,i,t);return}const{contentSteering:l,levels:h,sessionData:d,sessionKeys:u,startTimeOffset:f,variableList:g}=c;this.variableList=g,h.forEach(T=>{const{unknownCodecs:v}=T;if(v){const{preferManagedMediaSource:S}=this.hls.config;let{audioCodec:x,videoCodec:D}=T;for(let A=v.length;A--;){const R=v[A];wt(R,"audio",S)?(T.audioCodec=x=x?`${x},${R}`:R,It.audio[x.substring(0,4)]=2,v.splice(A,1)):wt(R,"video",S)&&(T.videoCodec=D=D?`${D},${R}`:R,It.video[D.substring(0,4)]=2,v.splice(A,1))}}});const{AUDIO:p=[],SUBTITLES:E,"CLOSED-CAPTIONS":y}=Ve.parseMasterPlaylistMedia(n,o,c);p.length&&!p.some(v=>!v.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new oe({}),bitrate:0,url:""})),r.trigger(m.MANIFEST_LOADED,{levels:h,audioTracks:p,subtitles:E,captions:y,contentSteering:l,url:o,stats:t,networkDetails:i,sessionData:d,sessionKeys:u,startTimeOffset:f,variableList:g})}handleTrackOrLevelPlaylist(e,t,s,i,r){const n=this.hls,{id:o,level:c,type:l}=s,h=Qs(e,s),d=M(c)?c:M(o)?o:0,u=mn(s),f=Ve.parseLevelPlaylist(e.data,h,d,u,0,this.variableList);if(l===Q.MANIFEST){const g={attrs:new oe({}),bitrate:0,details:f,name:"",url:h};f.requestScheduled=t.loading.start+jn(f,0),n.trigger(m.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),s.levelDetails=f,this.handlePlaylistLoaded(f,e,t,s,i,r)}handleManifestParsingError(e,t,s,i,r){this.hls.trigger(m.ERROR,{type:V.NETWORK_ERROR,details:b.MANIFEST_PARSING_ERROR,fatal:t.type===Q.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,s=!1,i,r){let n=`A network ${s?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Q.LEVEL?n+=`: ${e.level} id: ${e.id}`:(e.type===Q.AUDIO_TRACK||e.type===Q.SUBTITLE_TRACK)&&(n+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(n);this.hls.logger.warn(`[playlist-loader]: ${n}`);let c=b.UNKNOWN,l=!1;const h=this.getInternalLoader(e);switch(e.type){case Q.MANIFEST:c=s?b.MANIFEST_LOAD_TIMEOUT:b.MANIFEST_LOAD_ERROR,l=!0;break;case Q.LEVEL:c=s?b.LEVEL_LOAD_TIMEOUT:b.LEVEL_LOAD_ERROR,l=!1;break;case Q.AUDIO_TRACK:c=s?b.AUDIO_TRACK_LOAD_TIMEOUT:b.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Q.SUBTITLE_TRACK:c=s?b.SUBTITLE_TRACK_LOAD_TIMEOUT:b.SUBTITLE_LOAD_ERROR,l=!1;break}h&&this.resetInternalLoader(e.type);const d={type:V.NETWORK_ERROR,details:c,fatal:l,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const u=t?.url||e.url;d.response=se({url:u,data:void 0},i)}this.hls.trigger(m.ERROR,d)}handlePlaylistLoaded(e,t,s,i,r,n){const o=this.hls,{type:c,level:l,levelOrTrack:h,id:d,groupId:u,deliveryDirectives:f}=i,g=Qs(t,i),p=mn(i);let E=typeof i.level=="number"&&p===B.MAIN?l:void 0;const y=e.playlistParsingError;if(y){if(this.hls.logger.warn(`${y} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(m.ERROR,{type:V.NETWORK_ERROR,details:b.LEVEL_PARSING_ERROR,fatal:!1,url:g,error:y,reason:y.message,response:t,context:i,level:E,parent:p,networkDetails:r,stats:s});return}e.playlistParsingError=null}if(!e.fragments.length){const T=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(m.ERROR,{type:V.NETWORK_ERROR,details:b.LEVEL_EMPTY_ERROR,fatal:!1,url:g,error:T,reason:T.message,response:t,context:i,level:E,parent:p,networkDetails:r,stats:s});return}switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case Q.MANIFEST:case Q.LEVEL:if(E){if(!h)E=0;else if(h!==o.levels[E]){const T=o.levels.indexOf(h);T>-1&&(E=T)}}o.trigger(m.LEVEL_LOADED,{details:e,levelInfo:h||o.levels[0],level:E||0,id:d||0,stats:s,networkDetails:r,deliveryDirectives:f,withoutMultiVariant:c===Q.MANIFEST});break;case Q.AUDIO_TRACK:o.trigger(m.AUDIO_TRACK_LOADED,{details:e,track:h,id:d||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:f});break;case Q.SUBTITLE_TRACK:o.trigger(m.SUBTITLE_TRACK_LOADED,{details:e,track:h,id:d||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:f});break}}}class be{static get version(){return Mt}static isMSESupported(){return Wa()}static isSupported(){return bu()}static getMediaSource(){return st()}static get Events(){return m}static get MetadataSchema(){return Re}static get ErrorTypes(){return V}static get ErrorDetails(){return b}static get DefaultConfig(){return be.defaultConfig?be.defaultConfig:mu}static set DefaultConfig(e){be.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Di,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=Bo(e.debug||!1,"Hls instance",e.assetPlayerId),s=this.config=Eu(be.DefaultConfig,e,t);this.userConfig=e,s.progressive&&yu(s,t);const{abrController:i,bufferController:r,capLevelController:n,errorController:o,fpsController:c}=s,l=new o(this),h=this.abrController=new i(this),d=new wl(this),u=s.interstitialsController,f=u?this.interstitialsController=new u(this,be):null,g=this.bufferController=new r(this,d),p=this.capLevelController=new n(this),E=new c(this),y=new ku(this),T=s.contentSteeringController,v=T?new T(this):null,S=this.levelController=new Ru(this,v),x=new Iu(this),D=new Pu(this.config,this.logger),A=this.streamController=new Cu(this,d,D),R=this.gapController=new xu(this,d);p.setStreamController(A),E.setStreamController(A);const _=[y,S,A];f&&_.splice(1,0,f),v&&_.splice(1,0,v),this.networkControllers=_;const I=[h,g,R,p,E,x,d];this.audioTrackController=this.createController(s.audioTrackController,_);const P=s.audioStreamController;P&&_.push(this.audioStreamController=new P(this,d,D)),this.subtitleTrackController=this.createController(s.subtitleTrackController,_);const F=s.subtitleStreamController;F&&_.push(this.subtititleStreamController=new F(this,d,D)),this.createController(s.timelineController,I),D.emeController=this.emeController=this.createController(s.emeController,I),this.cmcdController=this.createController(s.cmcdController,I),this.latencyController=this.createController(Lu,I),this.coreComponents=I,_.push(l);const U=l.onErrorOut;typeof U=="function"&&this.on(m.ERROR,U,l),this.on(m.MANIFEST_LOADED,y.onManifestLoaded,y)}createController(e,t){if(e){const s=new e(this);return t&&t.push(s),s}return null}on(e,t,s=this){this._emitter.on(e,t,s)}once(e,t,s=this){this._emitter.once(e,t,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,s=this,i){this._emitter.off(e,t,s,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,s){return this._emitter.emit(e,t,s)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(s){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const i=e===m.ERROR;this.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.INTERNAL_EXCEPTION,fatal:i,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(m.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(m.ERROR,{type:V.OTHER_ERROR,details:b.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,s=t?e.media:e,i=t?e:{media:s};this._media=s,this.trigger(m.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(m.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,s=this._url,i=this._url=yi.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(m.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", ":"")})`),this.started=!0,this.resumeBuffering();for(let s=0;s{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[B.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[B.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[B.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=xd()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){El(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const s=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:s}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,s)for(let r=i;r--;){const n=e[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const s=kn(t);return Cn(e,s,navigator.mediaCapabilities)}}be.defaultConfig=void 0;var wu=oo('
                ',3);function Wu(a,e){to(e,!0);let t=Oe(e,"src",3,void 0),s=Oe(e,"muted",3,void 0),i=Oe(e,"playsinline",3,void 0),r=Oe(e,"preload",3,void 0),n=Oe(e,"autoplay",3,void 0),o=Oe(e,"controls",3,void 0),c=Oe(e,"currentTime",15,void 0),l=Oe(e,"duration",15,void 0),h=Oe(e,"paused",15,void 0),d=Oe(e,"node",15,void 0),u=Oe(e,"processingVideo",3,!1),f=ro(!1);function g(x,D,A){if(!(!x||!D)&&be.isSupported()&&!no(f)){const R=new be({maxBufferLength:1,maxMaxBufferLength:1,lowLatencyMode:!0});R.loadSource(x),R.attachMedia(A),R.on(be.Events.MANIFEST_PARSED,function(){A.play()}),R.on(be.Events.ERROR,function(_,I){if(console.error("HLS error:",_,I),I.fatal)switch(I.type){case be.ErrorTypes.NETWORK_ERROR:console.error("Fatal network error encountered, trying to recover"),R.startLoad();break;case be.ErrorTypes.MEDIA_ERROR:console.error("Fatal media error encountered, trying to recover"),R.recoverMediaError();break;default:console.error("Fatal error, cannot recover"),R.destroy();break}}),qi(f,!0)}}ji(()=>{t(),qi(f,!1)}),ji(()=>{d()&&t()&&e.is_stream&&g(t(),e.is_stream,d())});var p=wu(),E=zi(p);let y;var T=ao(E,2);T.__click=()=>e.onclick?.(),T.__mouseover=()=>e.onmouseover?.(),T.__mouseout=()=>e.onmouseout?.();var v=co(T);{var S=x=>{var D=ho(),A=zi(D);fo(A,()=>e.children),Xi(x,D)};za(v,x=>{e.children&&x(S)})}uo(T),ss(()=>po(T,c)),ss(()=>mo("duration","durationchange",T,l)),ss(()=>Eo(T,h)),Xa(T,x=>d(x),()=>d()),go(T,(x,D)=>_o?.(x,D),()=>({autoplay:n()??!1})),so(()=>{y=Qa(E,1,"overlay svelte-azaofy",null,y,{hidden:!u()}),bs(T,"src",t()),T.muted=s(),T.playsInline=i(),bs(T,"preload",r()),T.autoplay=n(),T.controls=o(),T.loop=e.loop,bs(T,"data-testid",e["data-testid"])}),We("loadeddata",T,()=>e.onloadeddata?.()),We("play",T,()=>e.onplay?.()),We("pause",T,()=>e.onpause?.()),We("ended",T,()=>e.onended?.()),We("focus",T,()=>e.onfocus?.()),We("blur",T,()=>e.onblur?.()),We("error",T,()=>e.onerror?.("Video not playable")),We("loadstart",T,()=>e.onloadstart?.()),We("loadedmetadata",T,()=>e.onloadedmetadata?.()),Xi(a,p),io()}lo(["click","mouseover","mouseout"]);export{Wu as V,Gu as a,Ku as b,_o as l,$u as p,Vu as t}; diff --git a/assets/VideoPreview-C1GJVo16.js b/assets/VideoPreview-C1GJVo16.js deleted file mode 100644 index 966b69463ba1a9723a6d6d8cc060053d60de712e..0000000000000000000000000000000000000000 --- a/assets/VideoPreview-C1GJVo16.js +++ /dev/null @@ -1 +0,0 @@ -import{p as l,i as X,q as Ce,a as _e,w as Xe,f as de,b as oe,M as fe,v as Fe,d as He,J as Ee,A as Ue}from"./i18n-CPHyzK9b.js";import{ah as ve,M as se,aa as y,ab as Oe,ac as W,Z as e,a7 as ie,ae as Te,Q as M,T as x,a as D,O as ue,a2 as Z,$ as u,S as L,t as ee,U as ge,R as S,N as Y,X as pe,a3 as ze,as as Ne,G as We}from"./index-DydPgVMC.js";import{k as Ge}from"./key-CFGu0zzg.js";import{I as he,V as ke}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as Je}from"./BlockLabel-BzVeVrtL.js";import{D as Qe}from"./DownloadLink-DM2QmhDx.js";import{E as Ze}from"./Empty-B15ItVsj.js";import{S as Ke}from"./ShareButton-Cuvs43xM.js";import{D as Ye}from"./Download-DWSaBiea.js";import{I as $e}from"./IconButtonWrapper-PnNNNvqI.js";import{M as et}from"./Maximize-DWbY8BRa.js";import{T as tt,V as at,P as rt}from"./VolumeLevels-B3WBv7ou.js";import{P as nt}from"./Play-CRvn2HoA.js";import{U as Ve}from"./Undo-B9SlrYtT.js";import{b as lt,t as ot,V as it}from"./Video-BOdhnjQz.js";import"./Upload-Bq9KuxCu.js";import{M as st}from"./ModifyUpload-BL388q45.js";var ut=S('
                '),dt=S(''),vt=S('
                '),ct=S('
                ');function mt(G,t){se(t,!0);let r=l(t,"videoElement",7),U=l(t,"trimmedDuration",15,null),F=l(t,"dragStart",15,0),g=l(t,"dragEnd",15,0),w=l(t,"loadingTimeline",15,!1),k=y(Oe([])),J=10,B,E=y(0),T=y(100),h=y(null);const R=i=>{u(h,i,!0)};let p=Z(()=>e(k).length!==J);W(()=>{w(e(p))});const _=()=>{u(h,null)},C=(i,v)=>{if(e(h)){const b=document.getElementById("timeline");if(!b)return;const P=b.getBoundingClientRect();let d=(i.clientX-P.left)/P.width*100;if(v?d=e(h)==="left"?e(E)+v:e(T)+v:d=(i.clientX-P.left)/P.width*100,d=Math.max(0,Math.min(d,100)),e(h)==="left"){u(E,Math.min(d,e(T)),!0);const s=e(E)/100*B;r().currentTime=s,F(s)}else if(e(h)==="right"){u(T,Math.max(d,e(E)),!0);const s=e(T)/100*B;r().currentTime=s,g(s)}const f=e(E)/100*B,c=e(T)/100*B;U(c-f),u(E,e(E),!0),u(T,e(T),!0)}},a=i=>{if(e(h)){const v=1/B*100;i.key==="ArrowLeft"?C({clientX:0},-v):i.key==="ArrowRight"&&C({clientX:0},v)}},j=()=>{const i=document.createElement("canvas"),v=i.getContext("2d");if(!v)return;i.width=r().videoWidth,i.height=r().videoHeight,v.drawImage(r(),0,0,i.width,i.height);const b=i.toDataURL("image/jpeg",.7);u(k,[...e(k),b],!0)};ie(()=>{const i=()=>{B=r().duration;const v=B/J;let b=0;const P=()=>{j(),b++,b=1?i():r().addEventListener("loadedmetadata",i)}),Te(()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",_),window.removeEventListener("keydown",a)}),ie(()=>{window.addEventListener("mousemove",C),window.addEventListener("mouseup",_),window.addEventListener("keydown",a)});var V=ct(),I=M(V);{var H=i=>{var v=ut();D(i,v)},O=i=>{var v=vt(),b=M(v);b.__mousedown=()=>R("left"),b.__keydown=c=>{(c.key==="ArrowLeft"||c.key=="ArrowRight")&&R("left")};var P=L(b,2),d=L(P,2);Ce(d,17,()=>e(k),Xe,(c,s,m)=>{var q=dt();_e(q,"alt",`frame-${m}`),ee(()=>_e(q,"src",e(s))),D(c,q)});var f=L(d,2);f.__mousedown=()=>R("right"),f.__keydown=c=>{(c.key==="ArrowLeft"||c.key=="ArrowRight")&&R("right")},x(v),ee(()=>{de(b,`left: ${e(E)??""}%;`),de(P,`left: ${e(E)??""}%; right: ${100-e(T)}%`),de(f,`left: ${e(T)??""}%;`)}),ge("blur",b,_),ge("blur",f,_),D(i,v)};X(I,i=>{e(p)?i(H):i(O,!1)})}x(V),D(G,V),ue()}ve(["mousedown","keydown"]);var _t=S('
                '),ft=S('
                ',1),gt=S('
                '),ht=S(" ",1),bt=S('
                ',1);function wt(G,t){se(t,!0);let r=l(t,"videoElement",3,void 0),U=l(t,"showRedo",3,!1),F=l(t,"interactive",3,!0),g=l(t,"mode",15,""),w=l(t,"processingVideo",15,!1),k=l(t,"value",3,null),J=l(t,"show_download_button",3,!1),B=l(t,"handle_clear",3,()=>{}),E=l(t,"has_change_history",3,!1),T;ie(async()=>{T=await lt()}),W(()=>{g()==="edit"&&e(h)===null&&r()&&u(h,r().duration,!0)});let h=y(null),R=y(0),p=y(0),_=y(!1);const C=()=>{g()==="edit"?(g(""),r()&&u(h,r().duration,!0)):g("edit")};var a=bt(),j=Y(a);let V;var I=M(j);{var H=d=>{var f=_t(),c=M(f);mt(c,{get videoElement(){return r()},get dragStart(){return e(R)},set dragStart(s){u(R,s,!0)},get dragEnd(){return e(p)},set dragEnd(s){u(p,s,!0)},get trimmedDuration(){return e(h)},set trimmedDuration(s){u(h,s,!0)},get loadingTimeline(){return e(_)},set loadingTimeline(s){u(_,s,!0)}}),x(f),D(d,f)};X(I,d=>{g()==="edit"&&r()&&d(H)})}var O=L(I,2),i=M(O);{var v=d=>{var f=ft(),c=Y(f);let s;var m=M(c,!0);x(c);var q=L(c,2),N=M(q);let Q;N.__click=()=>{r()&&(g(""),w(!0),ot(T,e(R),e(p),r()).then(ae=>{t.handle_trim_video(ae)}).then(()=>{w(!1)}))};var A=L(N,2);let $;A.__click=C,x(q),ee(ae=>{s=oe(c,1,"svelte-s6tu9w",null,s,{hidden:e(_)}),pe(m,ae),Q=oe(N,1,"text-button svelte-s6tu9w",null,Q,{hidden:e(_)}),$=oe(A,1,"text-button svelte-s6tu9w",null,$,{hidden:e(_)})},[()=>fe(e(h))]),D(d,f)},b=d=>{var f=gt();D(d,f)};X(i,d=>{g()==="edit"&&e(h)!==null?d(v):d(b,!1)})}x(O),x(j);var P=L(j,2);{let d=Z(()=>J()?k()?.url:null);st(P,{get i18n(){return t.i18n},onclear:()=>B()(),get download(){return e(d)},children:(f,c)=>{var s=ht(),m=Y(s);{var q=A=>{{let $=Z(()=>w()||!E());he(A,{get Icon(){return Ve},label:"Reset video to initial value",get disabled(){return e($)},onclick:()=>{t.handle_reset_value(),g("")}})}};X(m,A=>{U()&&g()===""&&A(q)})}var N=L(m,2);{var Q=A=>{he(A,{get Icon(){return tt},label:"Trim video to selection",get disabled(){return w()},onclick:C})};X(N,A=>{F()&&g()===""&&A(Q)})}D(f,s)},$$slots:{default:!0}})}ee(()=>V=oe(j,1,"container svelte-s6tu9w",null,V,{hidden:g()!=="edit"})),D(G,a),ue()}ve(["click"]);var yt=S('');function kt(G,t){se(t,!0);let r=l(t,"current_volume",15),U=l(t,"show_volume_slider",15,!1),F=y(void 0);ie(()=>{g()});const g=()=>{let k=e(F);k&&(k.style.background=`linear-gradient(to right, white ${(r()??1)*100}%, rgba(255, 255, 255, 0.3) ${(r()??1)*100}%)`)};W(()=>{r(),g()});var w=yt();Fe(w),w.__focusout=()=>U(!1),w.__input=k=>{k.target instanceof HTMLInputElement&&r(parseFloat(k.target.value))},He(w,k=>u(F,k),()=>e(F)),ee(()=>Ee(w,r()??1)),D(G,w),ue()}ve(["focusout","input"]);var Et=S(''),Tt=S('
                '),pt=S('
                ',1);function Vt(G,t){se(t,!0);let r=l(t,"root",3,""),U=l(t,"subtitle",3,null),F=l(t,"label",3,"test"),g=l(t,"interactive",3,!1),w=l(t,"handle_change",3,()=>{}),k=l(t,"handle_reset_value",3,()=>{}),J=l(t,"is_stream",3,!1),B=l(t,"show_download_button",3,!1),E=l(t,"value",3,null),T=l(t,"handle_clear",3,()=>{}),h=l(t,"has_change_history",3,!1),R=l(t,"playback_position",15),p=y(0),_=y(0),C=y(!0),a=y(void 0),j=y(!1),V=y(!1),I=y(1),H=y(!1);function O(n){if(!e(_))return;if(n.type==="click"){v(n);return}if(n.type!=="touchmove"&&!(n.buttons&1))return;const o=n.type==="touchmove"?n.touches[0].clientX:n.clientX,{left:z,right:K}=n.currentTarget.getBoundingClientRect();u(p,e(_)*(o-z)/(K-z))}async function i(){e(a)&&document.fullscreenElement!=e(a)&&(e(a).currentTime>0&&!e(a).paused&&!e(a).ended&&e(a).readyState>e(a).HAVE_CURRENT_DATA?e(a).pause():await e(a).play())}function v(n){if(!e(_))return;const{left:o,right:z}=n.currentTarget.getBoundingClientRect();u(p,e(_)*(n.clientX-o)/(z-o))}function b(){t.onstop?.(),t.onend?.()}const P=async n=>{let o=new File([n],"video.mp4");const z=await Ne([o]);let K=(await t.upload(z,r()))?.filter(Boolean)[0];w()(K)};function d(){e(a)&&(e(H)?document.exitFullscreen():e(a).requestFullscreen())}function f(){u(H,document.fullscreenElement===e(a)),e(a)&&(e(a).controls=e(H))}let c=1,s;const m=.001;function q(){e(a)&&Math.abs(e(a).volume-c)>m&&(u(I,e(a).volume,!0),c=e(a).volume)}ie(()=>(document.addEventListener("fullscreenchange",f),()=>{document.removeEventListener("fullscreenchange",f)})),Te(()=>{e(a)&&e(a).removeEventListener("volumechange",q)}),W(()=>{e(a)&&e(a)!==s&&(s&&s.removeEventListener("volumechange",q),e(a).addEventListener("volumechange",q),s=e(a))}),W(()=>{R(e(p))}),W(()=>{R()!==void 0&&R()!==e(p)&&e(a)&&(e(a).currentTime=R())}),W(()=>{e(a)&&!e(H)&&(Math.abs(e(a).volume-e(I))>m&&(e(a).volume=e(I),c=e(I)),e(a).controls=!1)}),W(()=>{e(a)&&e(H)&&(c=e(a).volume)});var N=pt(),Q=Y(N),A=M(Q);let $;var ae=M(A);{let n=Z(()=>`${F()}-player`);it(ae,{get src(){return t.src},preload:"auto",get autoplay(){return t.autoplay},get loop(){return t.loop},get is_stream(){return J()},get controls(){return e(H)},onclick:i,onplay:()=>t.onplay?.(),onpause:()=>t.onpause?.(),onerror:o=>t.onerror?.(o),onended:b,get"data-testid"(){return e(n)},get processingVideo(){return e(j)},onloadstart:()=>t.onloadstart?.(),onloadeddata:()=>t.onloadeddata?.(),onloadedmetadata:()=>t.onloadedmetadata?.(),get currentTime(){return e(p)},set currentTime(o){u(p,o,!0)},get duration(){return e(_)},set duration(o){u(_,o,!0)},get paused(){return e(C)},set paused(o){u(C,o,!0)},get node(){return e(a)},set node(o){u(a,o,!0)},children:(o,z)=>{var K=Et();ee(()=>_e(K,"src",U())),D(o,K)},$$slots:{default:!0}})}x(A);var be=L(A,2),we=M(be),re=M(we);re.__click=i,re.__keydown=i;var Le=M(re);{var Pe=n=>{Ve(n)},Me=n=>{var o=ze(),z=Y(o);{var K=te=>{nt(te)},Be=te=>{rt(te)};X(z,te=>{e(C)?te(K):te(Be,!1)},!0)}D(n,o)};X(Le,n=>{e(p)===e(_)?n(Pe):n(Me,!1)})}x(re);var ce=L(re,2),xe=M(ce);x(ce);var ne=L(ce,2);ne.__mousemove=O,ne.__touchmove=n=>{n.preventDefault(),O(n)},ne.__click=n=>{n.stopPropagation(),n.preventDefault(),v(n)};var me=L(ne,2),le=M(me);le.__click=()=>u(V,!e(V));let ye;var De=M(le);at(De,{get currentVolume(){return e(I)}}),x(le);var Re=L(le,2);{var Se=n=>{kt(n,{get current_volume(){return e(I)},set current_volume(o){u(I,o,!0)},get show_volume_slider(){return e(V)},set show_volume_slider(o){u(V,o,!0)}})};X(Re,n=>{e(V)&&n(Se)})}x(me);var je=L(me,2);{var Ie=n=>{var o=Tt();o.__click=d;var z=M(o);et(z),x(o),ge("keypress",o,d),D(n,o)};X(je,n=>{e(V)||n(Ie)})}x(we),x(be),x(Q);var qe=L(Q,2);{var Ae=n=>{wt(n,{get videoElement(){return e(a)},showRedo:!0,handle_trim_video:P,get handle_reset_value(){return k()},get value(){return E()},get i18n(){return t.i18n},get show_download_button(){return B()},get handle_clear(){return T()},get has_change_history(){return h()},get processingVideo(){return e(j)},set processingVideo(o){u(j,o,!0)}})};X(qe,n=>{g()&&n(Ae)})}ee((n,o)=>{$=oe(A,1,"mirror-wrap svelte-1v1chr2",null,$,{mirror:t.mirror}),pe(xe,`${n??""} / ${o??""}`),Ee(ne,e(p)/e(_)||0),ye=de(le,"",ye,{color:e(V)?"var(--color-accent)":"white"})},[()=>fe(e(p)),()=>fe(e(_))]),D(G,N),ue()}ve(["click","keydown","mousemove","touchmove"]);var Lt=S(" ",1),Pt=S('
                ',1),Mt=S(" ",1);function xt(G,t){se(t,!0);let r=l(t,"value",15,null),U=l(t,"subtitle",3,null),F=l(t,"label",3,void 0),g=l(t,"show_label",3,!0),w=l(t,"buttons",3,null),k=l(t,"on_custom_button_click",3,null),J=l(t,"display_icon_button_wrapper_top_corner",3,!1),B=l(t,"playback_position",15),E=y(null),T=y(null);W(()=>{r()&&t.onchange?.(r())}),W(()=>{async function a(){r()!==e(E)&&U()!==e(T)&&e(T)!==null&&(u(E,r(),!0),r(null),await We(),r(e(E))),u(E,r(),!0),u(T,U())}a()});var h=Mt(),R=Y(h);{let a=Z(()=>F()||"Video");Je(R,{get show_label(){return g()},get Icon(){return ke},get label(){return e(a)}})}var p=L(R,2);{var _=a=>{Ze(a,{unpadded_box:!0,size:"large",children:(j,V)=>{ke(j)},$$slots:{default:!0}})},C=a=>{var j=Pt(),V=Y(j);Ge(V,()=>r().url,O=>{{let i=Z(()=>U()?.url);Vt(O,{get src(){return r().url},get subtitle(){return e(i)},get is_stream(){return r().is_stream},get autoplay(){return t.autoplay},onplay:()=>t.onplay?.(),onpause:()=>t.onpause?.(),onstop:()=>t.onstop?.(),onend:()=>t.onend?.(),onloadedmetadata:()=>{t.onload?.()},mirror:!1,get label(){return F()},get loop(){return t.loop},interactive:!1,get upload(){return t.upload},get i18n(){return t.i18n},get playback_position(){return B()},set playback_position(v){B(v)}})}});var I=L(V,2),H=M(I);{let O=Z(()=>w()??["download","share"]);$e(H,{get display_top_corner(){return J()},get buttons(){return e(O)},get on_custom_button_click(){return k()},children:(i,v)=>{var b=Lt(),P=Y(b);{var d=s=>{{let m=Z(()=>r().is_stream?r().url?.replace("playlist.m3u8","playlist-file"):r().url),q=Z(()=>r().orig_name||r().path);Qe(s,{get href(){return e(m)},get download(){return e(q)},children:(N,Q)=>{he(N,{get Icon(){return Ye},label:"Download"})},$$slots:{default:!0}})}};X(P,s=>{w()?.some(m=>typeof m=="string"&&m==="download")&&s(d)})}var f=L(P,2);{var c=s=>{Ke(s,{get i18n(){return t.i18n},onerror:m=>t.onerror?.(m),onshare:m=>t.onshare?.(m),get value(){return r()},formatter:async m=>m?await Ue(m.data):""})};X(f,s=>{w()?.some(m=>typeof m=="string"&&m==="share")&&s(c)})}D(i,b)},$$slots:{default:!0}})}x(I),D(a,j)};X(p,a=>{!r()||r().url===void 0?a(_):a(C,!1)})}D(G,h),ue()}const Gt=Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"}));export{Vt as P,xt as V,Gt as a}; diff --git a/assets/VolumeLevels-B3WBv7ou.js b/assets/VolumeLevels-B3WBv7ou.js deleted file mode 100644 index d97e41f2faeec261f3d92922c7b055b8581f009c..0000000000000000000000000000000000000000 --- a/assets/VolumeLevels-B3WBv7ou.js +++ /dev/null @@ -1 +0,0 @@ -import{i as s}from"./i18n-CPHyzK9b.js";import{a as e,f as l,a3 as a,N as h}from"./index-DydPgVMC.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";var x=l('');function T(r){var t=x();e(r,t)}var V=l('');function b(r){var t=V();e(r,t)}var L=l('Low volume');function M(r){var t=L();e(r,t)}var _=l('High volume');function y(r){var t=_();e(r,t)}var H=l('Muted volume');function j(r){var t=H();e(r,t)}function N(r,t){var c=a(),d=h(c);{var u=o=>{j(o)},g=o=>{var v=a(),p=h(v);{var C=i=>{M(i)},f=i=>{var w=a(),k=h(w);{var m=n=>{y(n)};s(k,n=>{t.currentVolume>=.5&&n(m)},!0)}e(i,w)};s(p,i=>{t.currentVolume<.5?i(C):i(f,!1)},!0)}e(o,v)};s(d,o=>{t.currentVolume==0?o(u):o(g,!1)})}e(r,c)}export{T as P,b as T,N as V}; diff --git a/assets/Walkthrough-BWP9RaPo.js b/assets/Walkthrough-BWP9RaPo.js deleted file mode 100644 index da880d140ec40fa56b0ae1cee5ff3996037fad92..0000000000000000000000000000000000000000 --- a/assets/Walkthrough-BWP9RaPo.js +++ /dev/null @@ -1 +0,0 @@ -import{p as $,F as qe,i as V,s as Ve,b as A,a as I,f as je,u as Ce,t as Ae,N as O,q as ye,d as re,w as ze}from"./i18n-CPHyzK9b.js";import{a as h,f as De,M as He,ab as de,aa as U,ac as ee,v as Ne,G as Be,ax as Me,$ as f,Z as e,U as Fe,t as P,O as Ge,a2 as Ie,S as X,R as j,au as Le,ah as Qe,Q as p,a3 as Re,N as fe,T as u,X as ue,a4 as Je}from"./index-DydPgVMC.js";var Ke=De('');function Ye(g){var r=Ke();h(g,r)}const Ue={};function Q(g){return!!g&&g.visible!==!1&&g.visible!=="hidden"}function $e(g,r){const c=g.findIndex(m=>m?.id===r);return c===-1?0:c}var et=j(''),tt=j(''),it=j(""),at=j('
                '),lt=j("
                ");function bt(g,r){He(r,!0);const c=()=>Ce(ie,"$selected_tab",be),m=()=>Ce(T,"$selected_tab_index",be),[be,Se]=Ae();let he=$(r,"visible",3,!0),Te=$(r,"elem_id",3,""),We=$(r,"elem_classes",19,()=>[]),R=$(r,"selected",15),s=de([...r.initial_tabs]),z=U(de([...r.initial_tabs])),k=U(de([])),F=U(!1),L,te=new Set;ee(()=>{const t=r.initial_tabs;Ne(()=>xe(t))});function xe(t){Be().then(()=>{Ne(()=>{for(let a=0;as.length>0),S;const ie=qe(R()??s[0]?.id??!1),T=qe($e(s,R()));let ae=U(!1),D=U(!1),oe=de({});function pe(t,a){s[a]=t,f(z,e(z).map(l=>l?.id===t.id?t:l),!0),f(k,e(k).map(l=>l?.id===t.id?t:l),!0)}Me(Ue,{register_tab:(t,a)=>(te.add(a),pe(t,a),c()===!1&&Q(t)&&t.interactive?(O(ie,t.id),O(T,a)):c()===t.id&&O(T,a),H(),a),unregister_tab:(t,a)=>{te.delete(a),c()===t.id&&O(ie,s[0]?.id??!1),s[a]=null,f(z,e(z).filter(l=>l?.id!==t.id),!0),f(k,e(k).filter(l=>l?.id!==t.id),!0),H()},selected_tab:ie,selected_tab_index:T});function ge(t){const a=s.find(l=>l?.id===t);t!==void 0&&a&&a.interactive&&Q(a)&&c()!==a.id&&(R(t),O(ie,t),O(T,s.findIndex(l=>l?.id===t)),r.onchange?.(),f(F,!1))}ee(()=>{R()!==null&&ge(R())}),ee(()=>{if(!S)return;H();const t=new ResizeObserver(()=>{H()});return t.observe(S),()=>t.disconnect()});function J(t){e(F)&&L&&!L.contains(t.target)&&f(F,!1)}const ke=48;async function H(){if(!S||(await Be(),await new Promise(i=>requestAnimationFrame(i)),!S))return;const t=S.clientWidth;let a=0,l=s.length;for(let i=0;iQ(le))?t-ke:t;if(a>ce){l=i;break}}f(z,s.slice(0,l),!0),f(k,s.slice(l),!0),f(D,me(c()),!0),f(ae,e(k).filter(i=>Q(i)).length>0)}ee(()=>{f(D,me(c()),!0)});function me(t){return t===!1?!1:e(k).some(a=>a?.id===t)}let Ee=Ie(()=>s[m()>=0?m():0]?.scale);var K=lt();Fe("resize",Le,H),Fe("click",Le,J);let d,w;var q=p(K);{var Y=t=>{var a=at(),l=p(a);ye(l,21,()=>s,ze,(o,n)=>{var W=Re(),M=fe(W);{var se=G=>{var y=et(),v=p(y,!0);u(y),re(y,(E,ne)=>oe[ne.id]=E,E=>oe?.[E.id],()=>[e(n)]),P(()=>ue(v,e(n)?.label)),h(G,y)};V(M,G=>{Q(e(n))&&G(se)})}h(o,W)}),u(l);var i=X(l,2);ye(i,21,()=>e(z),ze,(o,n,W)=>{var M=Re(),se=fe(M);{var G=y=>{var v=tt();v.__click=()=>{e(n).id!==c()&&(ge(e(n).id),r.onselect?.({value:e(n).label,index:W,id:e(n).id,component_id:e(n).component_id}))};let E;var ne=p(v,!0);u(v),P(()=>{I(v,"aria-selected",e(n).id===c()),I(v,"aria-controls",e(n).elem_id),v.disabled=!e(n).interactive,I(v,"aria-disabled",!e(n).interactive),I(v,"id",e(n).elem_id?e(n).elem_id+"-button":null),I(v,"data-tab-id",e(n).id),E=A(v,1,"svelte-1kbb2ai",null,E,{selected:e(n).id===c()}),ue(ne,e(n)?.label!==void 0?e(n)?.label:"Tab "+(W+1))}),h(y,v)};V(se,y=>{Q(e(n))&&y(G)})}h(o,M)}),u(i),re(i,o=>S=o,()=>S);var _=X(i,2);let C;var B=p(_);B.__click=o=>{o.stopPropagation(),f(F,!e(F))};let ce;var le=p(B);Ye(le),u(B);var _e=X(B,2);let ve;ye(_e,21,()=>e(k),ze,(o,n,W)=>{var M=Re(),se=fe(M);{var G=y=>{var v=it();v.__click=()=>{ge(e(n)?.id),r.onselect?.({value:e(n).label,index:W,id:e(n).id,component_id:e(n).component_id})};let E;var ne=p(v,!0);u(v),P(()=>{E=A(v,1,"svelte-1kbb2ai",null,E,{selected:e(n)?.id===c()}),ue(ne,e(n)?.label)}),h(y,v)};V(se,y=>{Q(e(n))&&y(G)})}h(o,M)}),u(_e),u(_),re(_,o=>L=o,()=>L),u(a),P(o=>{C=A(_,1,"overflow-menu svelte-1kbb2ai",null,C,o),ce=A(B,1,"svelte-1kbb2ai",null,ce,{"overflow-item-selected":e(D)}),ve=A(_e,1,"overflow-dropdown svelte-1kbb2ai",null,ve,{hide:!e(F)})},[()=>({hide:!e(ae)||!e(k).some(o=>Q(o))})]),h(t,a)};V(q,t=>{e(Z)&&t(Y)})}var N=X(q,2);Ve(N,r,"default",{}),u(K),P(t=>{d=A(K,1,`tabs ${t??""}`,"svelte-1kbb2ai",d,{hide:he()===!1,hidden:he()==="hidden"}),I(K,"id",Te()),w=je(K,"",w,{"flex-grow":e(Ee)})},[()=>We().join(" ")]),h(g,K),Ge(),Se()}Qe(["click"]);function Pe(g){return!!g&&g.visible!==!1&&g.visible!=="hidden"}function st(g,r){const c=g.findIndex(m=>m?.id===r);return c===-1?0:c}var nt=j('

                '),rt=De(''),dt=j(" "),ot=j("
                "),ct=j('
                ',1),_t=j('
                ',1),vt=j("
                ");function ht(g,r){He(r,!0);const c=()=>Ce(T,"$selected_tab",be),m=()=>Ce(ae,"$selected_tab_index",be),[be,Se]=Ae();let he=$(r,"visible",3,!0),Te=$(r,"elem_id",3,""),We=$(r,"elem_classes",19,()=>[]),R=$(r,"selected",15),s=de([...r.initial_tabs]),z,k=U(!0),F,L=de([]),te=de([]),xe=U(0),Z=U(!1),S=U(!0),ie=Ie(()=>s.length>0);const T=qe(R()??s[0]?.id??!1),ae=qe(st(s,R()));async function D(){if(!z||!F||!e(S))return;f(S,!1),await Be(),f(k,!0),await Be();const w=L[0].getBoundingClientRect().width*L.length+50*(L.length-1),q=z.getBoundingClientRect().width;if(!(wN&&(N=i),a&&C-10{D();const d=new ResizeObserver(w=>{w[0].contentRect.width!==oe&&(oe=w[0].contentRect.width,f(Z,!1),f(S,!0),D())});return z&&d.observe(z),()=>{d.disconnect()}}),Me(Ue,{register_tab:(d,w)=>(s[w]=d,c()===!1&&Pe(d)&&d.interactive&&(O(T,d.id),O(ae,w)),w),unregister_tab:(d,w)=>{c()===d.id&&O(T,s[0]?.id??!1),s[w]=null},selected_tab:T,selected_tab_index:ae});function pe(d,w){const q=s.find(Y=>Y?.id===d);d!==void 0&&q&&q.interactive&&Pe(q)&&c()!==q.id&&(R(d),O(T,d),O(ae,s.findIndex(Y=>Y?.id===d)),r.onchange?.())}ee(()=>{R()!==null&&pe(R(),s.findIndex(d=>d?.id===R()))}),ee(()=>{D()}),ee(()=>{m(),D()});let ge=Ie(()=>s[m()>=0?m():0]?.scale);var J=vt();Fe("resize",Le,D);let ke,H;var me=p(J);{var Ee=d=>{var w=_t(),q=fe(w);{var Y=l=>{var i=nt(),_=p(i),C=p(_);u(_);var B=X(_);u(i),P(()=>{ue(C,`Step ${(m()||0)+1}/${s.length??""}:`),ue(B,` ${(s[m()]?.label||"Walkthrough")??""}`)}),h(l,i)};V(q,l=>{e(Z)&&l(Y)})}var N=X(q,2);let t;var a=p(N);ye(a,21,()=>s,ze,(l,i,_)=>{var C=Re(),B=fe(C);{var ce=le=>{var _e=ct(),ve=fe(_e),o=p(ve);let n;o.__click=()=>{_<=m()&&e(i).id!==c()&&(pe(e(i).id),r.onselect?.({value:e(i).label,index:_,id:e(i).id,component_id:e(i).component_id}))};var W=p(o),M=p(W);{var se=b=>{var x=rt();h(b,x)},G=b=>{var x=Je();x.nodeValue=_+1,h(b,x)};V(M,b=>{e(i).id{var x=dt();let we;var Xe=p(x,!0);u(x),re(x,(Oe,Ze)=>te[Ze]=Oe,Oe=>te?.[Oe],()=>[_]),P(()=>{we=A(x,1,"step-label svelte-1ywzgq4",null,we,{visible:e(k)||_===m()}),ue(Xe,e(i)?.label!==void 0?e(i)?.label:"Step "+(_+1))}),h(b,x)};V(y,b=>{e(Z)||b(v)})}u(o),re(o,(b,x)=>L[x]=b,b=>L?.[b],()=>[_]),u(ve);var E=X(ve,2);{var ne=b=>{var x=ot();let we;P(()=>we=A(x,1,"step-connector svelte-1ywzgq4",null,we,{completed:_{_{n=A(o,1,"step-button svelte-1ywzgq4",null,n,{active:e(i).id===c(),completed:e(i).idc()}),I(o,"aria-selected",e(i).id===c()),I(o,"aria-controls",e(i).elem_id),o.disabled=!e(i).interactive||_>m(),I(o,"aria-disabled",!e(i).interactive||_>m()),I(o,"id",e(i).elem_id?e(i).elem_id+"-button":null),I(o,"data-tab-id",e(i).id)}),h(le,_e)};V(B,le=>{Pe(e(i))&&le(ce)})}h(l,C)}),u(a),re(a,l=>F=l,()=>F),u(N),re(N,l=>z=l,()=>z),P(()=>t=je(N,"",t,{"--label-height":e(xe)+"px"})),h(d,w)};V(me,d=>{e(ie)&&d(Ee)})}var K=X(me,2);Ve(K,r,"default",{}),u(J),P(d=>{ke=A(J,1,`stepper ${d??""}`,"svelte-1ywzgq4",ke,{hide:he()===!1,hidden:he()==="hidden",compact:e(Z)}),I(J,"id",Te()),H=je(J,"",H,{"flex-grow":e(ge)})},[()=>We().join(" ")]),h(g,J),Ge(),Se()}Qe(["click"]);export{bt as T,ht as W,Ue as a}; diff --git a/assets/WebGLRenderer-DBblrsTz.js b/assets/WebGLRenderer-DBblrsTz.js deleted file mode 100644 index 4e58b0e2f0d66399cf88e9ee561ac7ec76ea85d8..0000000000000000000000000000000000000000 --- a/assets/WebGLRenderer-DBblrsTz.js +++ /dev/null @@ -1,156 +0,0 @@ -import{S as G,E as d,G as U,B as T,w as m,D as p,O as K,y as Be,s as F,t as b,a9 as Ae,k as $,aa as Ne,b as S,W as w,j as B,i as A,l as O,M as z,ab as Y,ac as ye,ad as q,ae as Ce,af as De,A as Ie,R as Ge,e as v}from"./Index-EyePZPlZ.js";import{b as Z}from"./colorToUniform-3MxHuUz8.js";import{e as Ue,G as Fe,c as Oe,b as Pe,U as Me,R as Le,B as Q,d as N,f as we,S as He,a as ke}from"./SharedSystems-C07l2FX_.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";import"./misc-Dkc5KZ-v.js";import"./ImagePreview-C41duyJ0.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./BlockLabel-BzVeVrtL.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";import"./Image-DBmW1mOo.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./FullscreenButton-BuyUU5Yj.js";import"./Maximize-DWbY8BRa.js";import"./Image-CZ1Hb99p.js";/* empty css *//* empty css */import"./Block-WPcVj6Bq.js";import"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";/* empty css */import"./Upload-Bq9KuxCu.js";import"./actions-4RaHFoGI.js";/* empty css */import"./Webcam-B-wg5Ly_.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";import"./window-D5YXrKnH.js";import"./tinycolor-D4ULLcDx.js";import"./Plus-BDmybZhd.js";import"./input-BtIxlP_B.js";import"./Check-2f8HlfSn.js";import"./event-modifiers-CdEA5IGF.js";import"./ArrowUp-aILrPIpo.js";import"./Trash-CJrspSVZ.js";import"./Undo-B9SlrYtT.js";class J{constructor(){this._tempState=G.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,s){const n=e.renderer,i=this._didUploadHash[s.uid];n.shader.bind(s,i),i||(this._didUploadHash[s.uid]=!0),n.shader.updateUniformGroup(n.globalUniforms.uniformGroup),n.geometry.bind(r,s.glProgram)}execute(e,r){const s=e.renderer;this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(x||{});class Ve{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class ee{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new U({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,s.bindBufferBase(s.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let s=0,n=this._nextBindBaseIndex;for(;s<2;){n>=this._maxBindings&&(n=this._minBaseLocation,s++);const i=this._boundBufferBases[n];if(i&&i._lastBindCallId===this._bindCallId){n++;continue}break}return r=n,this._nextBindBaseIndex=n+1,s>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,s,n){const{_gl:i}=this;s||(s=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,s*256,n||256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data,i=e.descriptor.usage&T.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return n?s.byteLength>=n.byteLength?r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT):(s.byteLength=n.byteLength,r.bufferData(s.type,n,i)):(s.byteLength=e.descriptor.size,r.bufferData(s.type,s.byteLength,i)),s}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const s=e._gpuData[this._renderer.uid];s&&(r||this._gl.deleteBuffer(s.buffer))}createGLBuffer(e){const{_gl:r}=this;let s=x.ARRAY_BUFFER;e.descriptor.usage&T.INDEX?s=x.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&T.UNIFORM&&(s=x.UNIFORM_BUFFER);const n=new Ve(r.createBuffer(),s);return e._gpuData[this._renderer.uid]=n,this._managedBuffers.add(e),n}resetState(){this._boundBufferBases=Object.create(null)}}ee.extension={type:[d.WebGLSystem],name:"buffer"};const P=class te{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...te.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(m("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=p.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const s=this._renderer.background.alpha<1,n=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:s,premultipliedAlpha:n,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&m("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};P.extension={type:[d.WebGLSystem],name:"context"};P.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let Xe=P;var D=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(D||{}),re=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(re||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const H={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function We(t){return H[t]??H.float32}const je={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class Ke{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class se{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new U({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s":8,"vec3":12,"vec4":16,"vec2":8,"vec3":12,"vec4":16,"mat2x2":32,"mat3x3":48,"mat4x4":64};function qe(t){const e=t.map(i=>({data:i,offset:0,size:0})),r=16;let s=0,n=0;for(let i=0;i1&&(s=Math.max(s,r)*a.data.size);const o=s===12?16:s;a.size=s;const c=n%r;c>0&&r-c=0?"dataInt32":"data";return` - v = uv.${t.data.name}; - offset += ${e}; - - arrayOffset = offset; - - t = 0; - - for(var i=0; i < ${t.data.size*r}; i++) - { - for(var j = 0; j < ${s}; j++) - { - ${i}[arrayOffset++] = v[t++]; - } - ${n!==0?`arrayOffset += ${n};`:""} - } - `}function Qe(t){return Oe(t,"uboStd40",Ze,Pe)}class _e extends Me{constructor(){super({createUboElements:qe,generateUboSync:Qe})}}_e.extension={type:[d.WebGLSystem],name:"ubo"};class Je{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new w}init(e,r){this._renderer=e,this._renderTargetSystem=r,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new w;const e=this._renderer.gl;this._drawBuffersCache=[];for(let r=1;r<=16;r++)this._drawBuffersCache[r]=Array.from({length:r},(s,n)=>e.COLOR_ATTACHMENT0+n)}copyToTexture(e,r,s,n,i){const a=this._renderTargetSystem,o=this._renderer,c=a.getGpuRenderTarget(e),u=o.gl;return this.finishRenderPass(e),u.bindFramebuffer(u.FRAMEBUFFER,c.resolveTargetFramebuffer),o.texture.bind(r,0),u.copyTexSubImage2D(u.TEXTURE_2D,0,i.x,i.y,s.x,s.y,n.width,n.height),r}startRenderPass(e,r=!0,s,n){const i=this._renderTargetSystem,a=e.colorTexture,o=i.getGpuRenderTarget(e);let c=n.y;e.isRoot&&(c=a.pixelHeight-n.height-n.y),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h)});const u=this._renderer.gl;u.bindFramebuffer(u.FRAMEBUFFER,o.framebuffer),e.colorTextures.length>1&&this._setDrawBuffers(e,u);const _=this._viewPortCache;(_.x!==n.x||_.y!==c||_.width!==n.width||_.height!==n.height)&&(_.x=n.x,_.y=c,_.width=n.width,_.height=n.height,u.viewport(n.x,c,n.width,n.height)),!o.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(o),this.clear(e,r,s)}finishRenderPass(e){const s=this._renderTargetSystem.getGpuRenderTarget(e);if(!s.msaa)return;const n=this._renderer.gl;n.bindFramebuffer(n.FRAMEBUFFER,s.resolveTargetFramebuffer),n.bindFramebuffer(n.READ_FRAMEBUFFER,s.framebuffer),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST),n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(e){const s=this._renderer.gl,n=new Ye;return e.colorTexture instanceof B?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),n.framebuffer=null,n):(this._initColor(e,n),s.bindFramebuffer(s.FRAMEBUFFER,null),n)}destroyGpuRenderTarget(e){const r=this._renderer.gl;e.framebuffer&&(r.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(r.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(r.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(s=>{r.deleteRenderbuffer(s)}),e.msaaRenderBuffer=null}clear(e,r,s){if(!r)return;const n=this._renderTargetSystem;typeof r=="boolean"&&(r=r?A.ALL:A.NONE);const i=this._renderer.gl;if(r&A.COLOR){s??(s=n.defaultClearColor);const a=this._clearColorCache,o=s;(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3])&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],i.clearColor(o[0],o[1],o[2],o[3]))}i.clear(r)}resizeGpuRenderTarget(e){if(e.isRoot)return;const s=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,s),(e.stencil||e.depth)&&this._resizeStencil(s)}_initColor(e,r){const s=this._renderer,n=s.gl,i=n.createFramebuffer();if(r.resolveTargetFramebuffer=i,n.bindFramebuffer(n.FRAMEBUFFER,i),r.width=e.colorTexture.source.pixelWidth,r.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((o,c)=>{const u=o.source;u.antialias&&(s.context.supports.msaa?r.msaa=!0:m("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(u,0);const h=s.texture.getGlSource(u).texture;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+c,3553,h,0)}),r.msaa){const o=n.createFramebuffer();r.framebuffer=o,n.bindFramebuffer(n.FRAMEBUFFER,o),e.colorTextures.forEach((c,u)=>{const _=n.createRenderbuffer();r.msaaRenderBuffer[u]=_})}else r.framebuffer=i;this._resizeColor(e,r)}_resizeColor(e,r){const s=e.colorTexture.source;if(r.width=s.pixelWidth,r.height=s.pixelHeight,e.colorTextures.forEach((n,i)=>{i!==0&&n.source.resize(s.width,s.height,s._resolution)}),r.msaa){const n=this._renderer,i=n.gl,a=r.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=o.source;n.texture.bindSource(u,0);const h=n.texture.getGlSource(u).internalFormat,l=r.msaaRenderBuffer[c];i.bindRenderbuffer(i.RENDERBUFFER,l),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,h,u.pixelWidth,u.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+c,i.RENDERBUFFER,l)})}}_initStencil(e){if(e.framebuffer===null)return;const r=this._renderer.gl,s=r.createRenderbuffer();e.depthStencilRenderBuffer=s,r.bindRenderbuffer(r.RENDERBUFFER,s),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s),this._resizeStencil(e)}_resizeStencil(e){const r=this._renderer.gl;r.bindRenderbuffer(r.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?r.renderbufferStorageMultisample(r.RENDERBUFFER,4,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,this._renderer.context.webGLVersion===2?r.DEPTH24_STENCIL8:r.DEPTH_STENCIL,e.width,e.height)}prerender(e){const r=e.colorTexture.resource;this._renderer.context.multiView&&B.test(r)&&this._renderer.context.ensureCanvasSize(r)}postrender(e){if(this._renderer.context.multiView&&B.test(e.colorTexture.resource)){const r=this._renderer.context.canvas,s=e.colorTexture;s.context2D.drawImage(r,0,s.pixelHeight-r.height)}}_setDrawBuffers(e,r){const s=e.colorTextures.length,n=this._drawBuffersCache[s];if(this._renderer.context.webGLVersion===1){const i=this._renderer.context.extensions.drawBuffers;i?i.drawBuffersWEBGL(n):m("[RenderTexture] This WebGL1 context does not support rendering to multiple targets")}else r.drawBuffers(n)}}class fe extends Le{constructor(e){super(e),this.adaptor=new Je,this.adaptor.init(e,this)}}fe.extension={type:[d.WebGLSystem],name:"renderTarget"};function et(t,e){const r=[],s=[` - var g = s.groups; - var sS = r.shader; - var p = s.glProgram; - var ugS = r.uniformGroup; - var resources; - `];let n=!1,i=0;const a=e._getProgramData(t.glProgram);for(const c in t.groups){const u=t.groups[c];r.push(` - resources = g[${c}].resources; - `);for(const _ in u.resources){const h=u.resources[_];if(h instanceof O)if(h.ubo){const l=t._uniformBindMap[c][Number(_)];r.push(` - sS.bindUniformBlock( - resources[${_}], - '${l}', - ${t.glProgram._uniformBlockData[l].index} - ); - `)}else r.push(` - ugS.updateUniformGroup(resources[${_}], p, sD); - `);else if(h instanceof Q){const l=t._uniformBindMap[c][Number(_)];r.push(` - sS.bindUniformBlock( - resources[${_}], - '${l}', - ${t.glProgram._uniformBlockData[l].index} - ); - `)}else if(h instanceof $){const l=t._uniformBindMap[c][_],E=a.uniformData[l];E&&(n||(n=!0,s.push(` - var tS = r.texture; - `)),e._gl.uniform1i(E.location,i),r.push(` - tS.bind(resources[${_}], ${i}); - `),i++)}}}const o=[...s,...r].join(` -`);return new Function("r","s","sD",o)}class tt{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function k(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function y(t){const e=new Array(t);for(let r=0;ra>o?1:-1);for(let a=0;a`${_}: ${u}`),s=t.getShaderInfoLog(e),n=s.split(` -`),i={},a=n.map(u=>parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(u=>u&&!i[u]?(i[u]=!0,!0):!1),o=[""];a.forEach(u=>{r[u-1]=`%c${r[u-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(` -`);o[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function ot(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||X(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||X(t,s),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}function ct(t,e){const r=k(t,t.VERTEX_SHADER,e.vertex),s=k(t,t.FRAGMENT_SHADER,e.fragment),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,s);const i=e.transformFeedbackVaryings;i&&(typeof t.transformFeedbackVaryings!="function"?m("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,i.names,i.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||ot(t,n,r,s),e._attributeData=nt(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=at(n,t),e._uniformBlockData=it(n,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const c in e._uniformData){const u=e._uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:he(u.type,u.size)}}return new tt(n,a)}const R={textureCount:0,blockIndex:0};class de{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(e,r){if(this._setProgram(e.glProgram),r)return;R.textureCount=0,R.blockIndex=0;let s=this._shaderSyncFunctions[e.glProgram._key];s||(s=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),s(this._renderer,e,R)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,R)}bindUniformBlock(e,r,s=0){const n=this._renderer.buffer,i=this._getProgramData(this._activeProgram),a=e._bufferResource;a||this._renderer.ubo.updateUniformGroup(e);const o=e.buffer,c=n.updateBuffer(o),u=n.freeLocationForBufferBase(c);if(a){const{offset:h,size:l}=e;h===0&&l===o.data.byteLength?n.bindBufferBase(c,u):n.bindBufferRange(c,u,h)}else n.getLastBindBaseLocation(c)!==u&&n.bindBufferBase(c,u);const _=this._activeProgram._uniformBlockData[r].index;i.uniformBlockBindings[s]!==u&&(i.uniformBlockBindings[s]=u,this._renderer.gl.uniformBlockBinding(i.program,_,u))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const r=this._getProgramData(e);this._gl.useProgram(r.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const r=e._key;return this._programDataHash[r]=ct(this._gl,e),this._programDataHash[r]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy();this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null}_generateShaderSync(e,r){return et(e,r)}resetState(){this._activeProgram=null}}de.extension={type:[d.WebGLSystem],name:"shader"};const ut={f32:`if (cv !== v) { - cu.value = v; - gl.uniform1f(location, v); - }`,"vec2":`if (cv[0] !== v[0] || cv[1] !== v[1]) { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2f(location, v[0], v[1]); - }`,"vec3":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - gl.uniform3f(location, v[0], v[1], v[2]); - }`,"vec4":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - gl.uniform4f(location, v[0], v[1], v[2], v[3]); - }`,i32:`if (cv !== v) { - cu.value = v; - gl.uniform1i(location, v); - }`,"vec2":`if (cv[0] !== v[0] || cv[1] !== v[1]) { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2i(location, v[0], v[1]); - }`,"vec3":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - gl.uniform3i(location, v[0], v[1], v[2]); - }`,"vec4":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,u32:`if (cv !== v) { - cu.value = v; - gl.uniform1ui(location, v); - }`,"vec2":`if (cv[0] !== v[0] || cv[1] !== v[1]) { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2ui(location, v[0], v[1]); - }`,"vec3":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - gl.uniform3ui(location, v[0], v[1], v[2]); - }`,"vec4":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - }`,bool:`if (cv !== v) { - cu.value = v; - gl.uniform1i(location, v); - }`,"vec2":`if (cv[0] !== v[0] || cv[1] !== v[1]) { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2i(location, v[0], v[1]); - }`,"vec3":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - gl.uniform3i(location, v[0], v[1], v[2]); - }`,"vec4":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,"mat2x2":"gl.uniformMatrix2fv(location, false, v);","mat3x3":"gl.uniformMatrix3fv(location, false, v);","mat4x4":"gl.uniformMatrix4fv(location, false, v);"},_t={f32:"gl.uniform1fv(location, v);","vec2":"gl.uniform2fv(location, v);","vec3":"gl.uniform3fv(location, v);","vec4":"gl.uniform4fv(location, v);","mat2x2":"gl.uniformMatrix2fv(location, false, v);","mat3x3":"gl.uniformMatrix3fv(location, false, v);","mat4x4":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);"};function ft(t,e){const r=[` - var v = null; - var cv = null; - var cu = null; - var t = 0; - var gl = renderer.gl; - var name = null; - `];for(const s in t.uniforms){if(!e[s]){t.uniforms[s]instanceof O?t.uniforms[s].ubo?r.push(` - renderer.shader.bindUniformBlock(uv.${s}, "${s}"); - `):r.push(` - renderer.shader.updateUniformGroup(uv.${s}); - `):t.uniforms[s]instanceof Q&&r.push(` - renderer.shader.bindBufferResource(uv.${s}, "${s}"); - `);continue}const n=t.uniformStructures[s];let i=!1;for(let a=0;a>=1,s++;this.stateId=e.data}for(let r=0;r>1,1),n=Math.max(n>>1,1)}}},be={id:"image",upload(t,e,r,s){const n=e.width,i=e.height,a=t.pixelWidth,o=t.pixelHeight,c=t.resourceWidth,u=t.resourceHeight;c1){const u=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[n](c,s.TEXTURE_MAX_ANISOTROPY_EXT,u)}t.compare&&e[n](c,e.TEXTURE_COMPARE_FUNC,At[t.compare])}function Nt(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}function yt(t,e){let r={},s=t.RGBA;return t instanceof p.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function Ct(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}const Dt=4;class pe{constructor(e){this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:be,buffer:Rt,video:Tt,compressed:vt},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=e,this._managedTextures=new U({renderer:e,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"})}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=yt(e,this._renderer.context.extensions),this._mapFormatToType=Ct(e),this._mapFormatToFormat=Nt(e)),this._managedTextures.removeAll(!0),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let r=0;r<16;r++)this.bind(b.EMPTY,r)}initSource(e){this.bind(e)}bind(e,r=0){const s=e.source;e?(this.bindSource(s,r),this._useSeparateSamplers&&this._bindSampler(s.style,r)):(this.bindSource(null,r),this._useSeparateSamplers&&this._bindSampler(null,r))}bindSource(e,r=0){const s=this._gl;if(e._gcLastUsed=this._renderer.gc.now,this._boundTextures[r]!==e){this._boundTextures[r]=e,this._activateLocation(r),e||(e=b.EMPTY.source);const n=this.getGlSource(e);s.bindTexture(n.target,n.texture)}}_bindSampler(e,r=0){const s=this._gl;if(!e){this._boundSamplers[r]=null,s.bindSampler(r,null);return}const n=this._getGlSampler(e);this._boundSamplers[r]!==n&&(this._boundSamplers[r]=n,s.bindSampler(r,n))}unbind(e){const r=e.source,s=this._boundTextures,n=this._gl;for(let i=0;i1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,r)}onSourceUnload(e,r=!1){const s=e._gpuData[this._renderer.uid];s&&(r||(this.unbind(e),this._gl.deleteTexture(s.texture)),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this))}onSourceUpdate(e){const r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e;const n=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==n&&(this._premultiplyAlpha=n,r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,s,r,this._renderer.context.webGLVersion):r.texImage2D(r.TEXTURE_2D,0,s.internalFormat,e.pixelWidth,e.pixelHeight,0,s.format,s.type,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,r=!0){r&&this.bindSource(e,0);const s=this.getGlSource(e);this._gl.generateMipmap(s.target)}_initSampler(e){const r=this._gl,s=this._gl.createSampler();return this._glSamplers[e._resourceId]=s,j(e,r,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this._initSource(e)}generateCanvas(e){const{pixels:r,width:s,height:n}=this.getPixels(e),i=p.get().createCanvas();i.width=s,i.height=n;const a=i.getContext("2d");if(a){const o=a.createImageData(s,n);o.data.set(r),a.putImageData(o,0,0)}return i}getPixels(e){const r=e.source.resolution,s=e.frame,n=Math.max(Math.round(s.width*r),1),i=Math.max(Math.round(s.height*r),1),a=new Uint8Array(Dt*n*i),o=this._renderer,c=o.renderTarget.getRenderTarget(e),u=o.renderTarget.getGpuRenderTarget(c),_=o.gl;return _.bindFramebuffer(_.FRAMEBUFFER,u.resolveTargetFramebuffer),_.readPixels(Math.round(s.x*r),Math.round(s.y*r),n,i,_.RGBA,_.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:n,height:i}}destroy(){this._managedTextures.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(b.EMPTY.source),this._boundSamplers=Object.create(null);const e=this._gl;this._premultiplyAlpha=!1,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}pe.extension={type:[d.WebGLSystem],name:"texture"};class Se{contextChange(e){const r=new O({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uTransformMatrix:{value:new z,type:"mat3x3"},uRound:{value:0,type:"f32"}}),s=e.limits.maxBatchableTextures,n=Y({name:"graphics",bits:[ye,Ce(s),Z,q]});this.shader=new F({glProgram:n,resources:{localUniforms:r,batchSamplers:De(s)}})}execute(e,r){const s=r.context,n=s.customShader||this.shader,i=e.renderer,a=i.graphicsContext,{batcher:o,instructions:c}=a.getContextRenderData(s);n.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(n),i.geometry.bind(o.geometry,n.glProgram);const u=c.instructions;for(let _=0;_",value:new z}}}})}execute(e,r){const s=e.renderer;let n=r._shader;if(n){if(!n.glProgram){m("Mesh shader has no glProgram",r.shader);return}}else{n=this._shader;const i=r.texture,a=i.source;n.resources.uTexture=a,n.resources.uSampler=a.style,n.resources.textureUniforms.uniforms.uTextureMatrix=i.textureMatrix.mapCoord}n.groups[100]=s.globalUniforms.bindGroup,n.groups[101]=e.localUniformsBindGroup,s.encoder.draw({geometry:r._geometry,shader:n,state:r.state})}destroy(){this._shader.destroy(!0),this._shader=null}}ge.extension={type:[d.WebGLPipesAdaptor],name:"mesh"};const It=[...He,_e,ze,Xe,oe,ee,pe,fe,se,me,de,ae,St,ce,ie],Gt=[...ke],Ut=[J,ge,Se],Re=[],xe=[],ve=[];v.handleByNamedList(d.WebGLSystem,Re);v.handleByNamedList(d.WebGLPipes,xe);v.handleByNamedList(d.WebGLPipesAdaptor,ve);v.add(...It,...Gt,...Ut);class Br extends Ie{constructor(){const e={name:"webgl",type:Ge.WEBGL,systems:Re,renderPipes:xe,renderPipeAdaptors:ve};super(e)}}export{Br as WebGLRenderer}; diff --git a/assets/WebGPURenderer-CSJjM6oL.js b/assets/WebGPURenderer-CSJjM6oL.js deleted file mode 100644 index 8308a4a9dcb84063cb6f64d083e459c0ded71a4d..0000000000000000000000000000000000000000 --- a/assets/WebGPURenderer-CSJjM6oL.js +++ /dev/null @@ -1,41 +0,0 @@ -import{g as E,S as L,E as f,G as A,u as ue,f as ce,D as P,b as v,B as T,c as de,d as D,h as M,w as C,i as x,j as he,k as pe,l as k,m as w,M as z,n as F,o as le,p as I,q as fe,s as O,t as R,A as me,R as ge,e as B}from"./Index-EyePZPlZ.js";import{l as _e,a as be}from"./colorToUniform-3MxHuUz8.js";import{c as xe,u as ye,U as Ge,B as Pe,G as Be,e as Se,R as Te,t as ve,S as Ce,a as Ue}from"./SharedSystems-C07l2FX_.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";import"./misc-Dkc5KZ-v.js";import"./ImagePreview-C41duyJ0.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./BlockLabel-BzVeVrtL.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";import"./Image-DBmW1mOo.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./FullscreenButton-BuyUU5Yj.js";import"./Maximize-DWbY8BRa.js";import"./Image-CZ1Hb99p.js";/* empty css *//* empty css */import"./Block-WPcVj6Bq.js";import"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";/* empty css */import"./Upload-Bq9KuxCu.js";import"./actions-4RaHFoGI.js";/* empty css */import"./Webcam-B-wg5Ly_.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";import"./window-D5YXrKnH.js";import"./tinycolor-D4ULLcDx.js";import"./Plus-BDmybZhd.js";import"./input-BtIxlP_B.js";import"./Check-2f8HlfSn.js";import"./event-modifiers-CdEA5IGF.js";import"./ArrowUp-aILrPIpo.js";import"./Trash-CJrspSVZ.js";import"./Undo-B9SlrYtT.js";const y=L.for2d();class W{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),y.blendMode="normal",s.pipeline.getPipeline(t,n,y);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count,s.limits.maxBatchableTextures)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}W.extension={type:[f.WebGPUPipesAdaptor],name:"batch"};class H{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const l in i){const p=e.resources[l]??e.resources[i[l]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const _=d.buffer;h={buffer:o.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getGpuSource(d).createView()}n.push({binding:i[l],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}H.extension={type:[f.WebGPUSystem],name:"bindGroup"};class Me{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class V{constructor(e){this._renderer=e,this._managedBuffers=new A({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=ue("resource"),e.data&&(ce(e.data.buffer,t.getMappedRange()),t.unmap()),e._gpuData[this._renderer.uid]=new Me(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}V.extension={type:[f.WebGPUSystem],name:"buffer"};class we{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await P.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[f.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class j{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}j.extension={type:[f.WebGPUSystem],name:"encoder",priority:1};class K{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}K.extension={type:[f.WebGPUSystem],name:"limits"};class q{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:v.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}q.extension={type:[f.WebGPUSystem],name:"stencil"};const G={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};function Re(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ee(a,e){const{size:t,align:r}=G[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return` - v = uv.${a.data.name}; - ${e!==0?`offset += ${e};`:""} - - arrayOffset = offset; - - t = 0; - - for(var i=0; i < ${a.data.size*(t/4)}; i++) - { - for(var j = 0; j < ${t/4}; j++) - { - ${i}[arrayOffset++] = v[t++]; - } - ${s!==0?`arrayOffset += ${s};`:""} - } - `}function Le(a){return xe(a,"uboWgsl",Ee,ye)}class Y extends Ge{constructor(){super({createUboElements:Re,generateUboSync:Le})}}Y.extension={type:[f.WebGPUSystem],name:"ubo"};const b=128;class ${constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new we({minUniformOffsetAlignment:b});const t=256/b;for(let r=0;r{const n={arrayStride:0,stepMode:"vertex",attributes:[]},o=n.attributes;for(const u in t.attributeData){const c=e.attributes[u];(c.divisor??1)!==1&&C(`Attribute ${u} has an invalid divisor value of '${c.divisor}'. WebGPU only supports a divisor value of 1`),c.buffer===i&&(n.arrayStride=c.stride,n.stepMode=c.instance?"instance":"vertex",o.push({shaderLocation:t.attributeData[u].location,offset:c.offset,format:c.format}))}o.length&&s.push(n)}),this._bufferLayoutsCache[r]=s,s}_updatePipeHash(){const e=ke(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}X.extension={type:[f.WebGPUSystem],name:"pipeline"};class ze{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class Fe{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,s,i){const n=this._renderer,o=this._getGpuColorTexture(e),u=n.texture.getGpuSource(t.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:u,origin:i},s),t}startRenderPass(e,t=!0,r,s){const n=this._renderTargetSystem.getGpuRenderTarget(e),o=this.getDescriptor(e,t,r);n.descriptor=o,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){typeof t=="boolean"&&(t=t?x.ALL:x.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(e),n=e.colorTextures.map((c,l)=>{const p=i.contexts[l];let h,d;p?h=p.getCurrentTexture().createView():h=this._renderer.texture.getGpuSource(c).createView({mipLevelCount:1}),i.msaaTextures[l]&&(d=h,h=this._renderer.texture.getTextureView(i.msaaTextures[l]));const _=t&x.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:h,resolveTarget:d,clearValue:r,storeOp:"store",loadOp:_}});let o;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=i.msaa?4:1),e.depthStencilTexture){const c=t&x.STENCIL?"clear":"load",l=t&x.DEPTH?"clear":"load";o={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:c,depthClearValue:1,depthLoadOp:l,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:o}}clear(e,t=!0,r,s){if(!t)return;const{gpu:i,encoder:n}=this._renderer,o=i.device;if(n.commandEncoder===null){const c=o.createCommandEncoder(),l=this.getDescriptor(e,t,r),p=c.beginRenderPass(l);p.setViewport(s.x,s.y,s.width,s.height,0,1),p.end();const h=c.finish();o.queue.submit([h])}else this.startRenderPass(e,t,r,s)}initGpuRenderTarget(e){e.isRoot=!0;const t=new ze;return t.colorTargetCount=e.colorTextures.length,e.colorTextures.forEach((r,s)=>{if(r instanceof he){const i=r.resource.getContext("webgpu"),n=r.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(o){console.error(o)}t.contexts[s]=i}if(t.msaa=r.source.antialias,r.source.antialias){const i=new pe({width:0,height:0,sampleCount:4});t.msaaTextures[s]=i}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((r,s)=>{t.msaaTextures[s]?.resize(r.source.width,r.source.height,r.source._resolution)})}}class Z extends Te{constructor(e){super(e),this.adaptor=new Fe,this.adaptor.init(e,this)}}Z.extension={type:[f.WebGPUSystem],name:"renderTarget"};class J{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map(i=>t.createBindGroupLayout({entries:i})),s={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}J.extension={type:[f.WebGPUSystem],name:"shader"};const m={};m.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};m.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};m.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};m.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};m["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};m["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};m["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};m.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};m.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};m.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};class Q{constructor(){this.defaultState=new L,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e,t){const r=m[e.blendMode]||m.normal,s=[],i={format:"bgra8unorm",writeMask:0,blend:r};for(let n=0;n>1,1),s=Math.max(s>>1,1)}}},te={type:"image",upload(a,e,t){const r=a.resource;if(!r)return;if(globalThis.HTMLImageElement&&r instanceof HTMLImageElement){const o=P.get().createCanvas(r.width,r.height);o.getContext("2d").drawImage(r,0,0,r.width,r.height),a.resource=o,C("ImageSource: Image element passed, converting to canvas and replacing resource.")}const s=Math.min(e.width,a.resourceWidth||a.pixelWidth),i=Math.min(e.height,a.resourceHeight||a.pixelHeight),n=a.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:n},{width:s,height:i})}},He={type:"video",upload(a,e,t){te.upload(a,e,t)}};class Ve{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:` - var pos : array, 3> = array, 3>( - vec2(-1.0, -1.0), vec2(-1.0, 3.0), vec2(3.0, -1.0)); - - struct VertexOutput { - @builtin(position) position : vec4, - @location(0) texCoord : vec2, - }; - - @vertex - fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput { - var output : VertexOutput; - output.texCoord = pos[vertexIndex] * vec2(0.5, -0.5) + vec2(0.5); - output.position = vec4(pos[vertexIndex], 0.0, 1.0); - return output; - } - - @group(0) @binding(0) var imgSampler : sampler; - @group(0) @binding(1) var img : texture_2d; - - @fragment - fn fragmentMain(@location(0) texCoord : vec2) -> @location(0) vec4 { - return textureSample(img, imgSampler, texCoord); - } - `})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const s=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(u)}const n=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let u=0;u1&&this.onUpdateMipmaps(e))}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new Ve(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceUnload(e){e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this)}onSourceResize(e){e._gcLastUsed=this._renderer.gc.now;const t=e._gpuData[this._renderer.uid],r=t?.gpuTexture;r?(r.width!==e.pixelWidth||r.height!==e.pixelHeight)&&(t.destroy(),this._bindGroupHash[e.uid]=null,e._gpuData[this._renderer.uid]=null,this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuTexture||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]||this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source;return this._bindGroupHash[e.uid]=new D({0:t,1:t.style,2:new k({uTextureMatrix:{type:"mat3x3",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){const t=e.source;t._gcLastUsed=this._renderer.gc.now;let r=t._gpuData[this._renderer.uid],s=null;return r||(this.initSource(t),r=t._gpuData[this._renderer.uid]),s=r.textureView||r.gpuTexture.createView(),s}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),s=P.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:P.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([r.finish()]),s}getPixels(e){const t=this.generateCanvas(e),r=w.getOptimalCanvasAndContext(t.width,t.height),s=r.context;s.drawImage(t,0,0);const{width:i,height:n}=t,o=s.getImageData(0,0,i,n),u=new Uint8ClampedArray(o.data.buffer);return w.returnCanvasAndContext(r),{pixels:u,width:i,height:n}}destroy(){this._managedTextures.destroy();for(const e of Object.keys(this._bindGroupHash)){const t=Number(e);this._bindGroupHash[t]?.destroy()}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null}}re.extension={type:[f.WebGPUSystem],name:"texture"};class se{constructor(){this._maxTextures=0}contextChange(e){const t=new k({uTransformMatrix:{value:new z,type:"mat3x3"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;const r=F({name:"graphics",bits:[le,fe(this._maxTextures),_e,I]});this.shader=new O({gpuProgram:r,resources:{localUniforms:t}})}execute(e,t){const r=t.context,s=r.customShader||this.shader,i=e.renderer,n=i.graphicsContext,{batcher:o,instructions:u}=n.getContextRenderData(r),c=i.encoder;c.setGeometry(o.geometry,s.gpuProgram);const l=i.globalUniforms.bindGroup;c.setBindGroup(0,l,s.gpuProgram);const p=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);c.setBindGroup(2,p,s.gpuProgram);const h=u.instructions;let d=null;for(let _=0;_",value:new z}}}})}execute(e,t){const r=e.renderer;let s=t._shader;if(!s)s=this._shader,s.groups[2]=r.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){C("Mesh shader has no gpuProgram",t.shader);return}const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const n=e.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(n,!0)}r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}ie.extension={type:[f.WebGPUPipesAdaptor],name:"mesh"};const je=[...Ce,Y,j,U,K,V,re,Z,J,Q,X,N,q,H],Ke=[...Ue,$],qe=[W,ie,se],ne=[],oe=[],ae=[];B.handleByNamedList(f.WebGPUSystem,ne);B.handleByNamedList(f.WebGPUPipes,oe);B.handleByNamedList(f.WebGPUPipesAdaptor,ae);B.add(...je,...Ke,...qe);class It extends me{constructor(){const e={name:"webgpu",type:ge.WEBGPU,systems:ne,renderPipes:oe,renderPipeAdaptors:ae};super(e)}}export{It as WebGPURenderer}; diff --git a/assets/Webcam-B-wg5Ly_.js b/assets/Webcam-B-wg5Ly_.js deleted file mode 100644 index 2b44dabf3239e204ca03602c926bd31e352d348c..0000000000000000000000000000000000000000 --- a/assets/Webcam-B-wg5Ly_.js +++ /dev/null @@ -1 +0,0 @@ -import{e as Ie,f as ze,p as h,d as Fe,i as A,b as ke,a as xe,q as Ve,U as Ke,w as Qe}from"./i18n-CPHyzK9b.js";import{I as Xe,aK as Ze,a as u,f as Me,M as Se,a1 as We,Q as o,T as n,S as T,U as $,O as Re,R as x,a7 as Ge,ae as Je,t as H,P as w,Z as t,a0 as q,$ as D,x as V,v as W,as as Ye,N as Y,a3 as ge,u as $e,X as K}from"./index-DydPgVMC.js";import{t as et,f as tt}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{a as at}from"./actions-4RaHFoGI.js";import{D as it}from"./DropdownArrow-Cq3QAKSv.js";import{W as rt}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{S as st}from"./Square-D8rV3Ea-.js";import{S as ot}from"./Spinner-C4Ov0as9.js";import{S as nt}from"./StreamingBar-CzgHaKX0.js";/* empty css */function lt(l,a,r){var s=Ze(l,a);s&&s.set&&(l[a]=r,Xe(()=>{l[a]=null}))}var ct=Me('');function vt(l){var a=ct();u(l,a)}var dt=Me('');function ut(l){var a=dt();u(l,a)}var mt=x('');function _t(l,a){Se(a,!1);const r=We();Ie();var s=mt();ze(s,"",{},{height:"100%"});var I=o(s),b=o(I),j=o(b);rt(j),n(b);var m=T(b);m.nodeValue=" Click to Access Webcam",n(I),n(s),$("click",s,()=>r("click")),u(l,s),Re()}function ft(){return navigator.mediaDevices.enumerateDevices()}async function gt(l,a){a.srcObject=l,a.muted=!0,await a.play()}async function De(l,a,r,s){const I={video:s?{deviceId:{exact:s},...r?.video}:r?.video||{width:{ideal:1920},height:{ideal:1440}},audio:l&&(r?.audio??!0)};return navigator.mediaDevices.getUserMedia(I).then(b=>(gt(b,a),b))}function pt(l){return l.filter(r=>r.kind==="videoinput")}var ht=x('
                '),wt=x('
                '),bt=x('
                '),yt=x('
                '),kt=x('
                '),xt=x(''),Dt=x(''),It=x(''),Mt=x(''),St=x('
                ',1),Wt=x('
                ',2);function Ot(l,a){Se(a,!1);let r=q(),s=q([]),I=q(null),b=h(a,"stream_state",12,"closed"),j,m=h(a,"streaming",12,!1),ee=h(a,"pending",12,!1),te=h(a,"root",12,""),ae=h(a,"stream_every",12,1),C=h(a,"mode",12,"image"),Q=h(a,"mirror_webcam",12),X=h(a,"include_audio",12),Z=h(a,"webcam_constraints",12,null),y=h(a,"i18n",12),ie=h(a,"upload",12),O=h(a,"value",12,null),re=h(a,"time_limit",12,null);const B=We();Ge(()=>{j=document.createElement("canvas"),m()&&C()==="image"&&window.setInterval(()=>{t(r)&&!ee()&&pe()},ae()*1e3)});const Ee=async e=>{const c=e.target.value;await De(X(),t(r),Z(),c).then(async p=>{P=p,D(I,t(s).find(F=>F.deviceId===c)||null),D(J,!1)})};async function Te(){try{De(X(),t(r),Z()).then(async e=>{D(N,!0),D(s,await ft()),P=e}).then(()=>pt(t(s))).then(e=>{D(s,e);const i=P.getTracks().map(c=>c.getSettings()?.deviceId)[0];D(I,i?e.find(c=>c.deviceId===i)||t(s)[0]:t(s)[0])}),(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)&&B("error",y()("image.no_webcam_support"))}catch(e){if(e instanceof DOMException&&e.name=="NotAllowedError")B("error",y()("image.allow_webcam_access"));else throw e}}function pe(){if((!m()||m()&&t(M))&&t(r).videoWidth&&t(r).videoHeight){var e=j.getContext("2d");if(j.width=t(r).videoWidth,j.height=t(r).videoHeight,e.drawImage(t(r),0,0,t(r).videoWidth,t(r).videoHeight),Q()&&(e.scale(-1,1),e.drawImage(t(r),-t(r).videoWidth,0)),m()&&(!t(M)||b()==="waiting"))return;if(m()){const i=j.toDataURL("image/jpeg");B("stream",i);return}j.toBlob(i=>{B(m()?"stream":"capture",i)},`image/${m()?"jpeg":"png"}`,.8)}}let M=q(!1),se=[],P,z,G;function je(){if(t(M)){G.stop();let e=new Blob(se,{type:z}),i=new FileReader;i.onload=async function(c){if(c.target){let p=new File([e],"sample."+z.substring(6));const F=await Ye([p]);let ve=(await ie()(F,te()))?.filter(Boolean)[0];B("capture",ve),B("stop_recording")}},i.readAsDataURL(e)}else if(typeof MediaRecorder<"u"){B("start_recording"),se=[];let e=["video/webm","video/mp4"];for(let i of e)if(MediaRecorder.isTypeSupported(i)){z=i;break}if(z===null){console.error("No supported MediaRecorder mimeType");return}G=new MediaRecorder(P,{mimeType:z}),G.addEventListener("dataavailable",function(i){se.push(i.data)}),G.start(200)}D(M,!t(M))}let N=q(!1);function he({destroy:e}={}){C()==="image"&&m()&&D(M,!t(M)),e||(C()==="image"?pe():je()),!t(M)&&P&&B("close_stream")}let J=q(!1);function oe(e,i){const c=p=>{e&&!e.contains(p.target)&&!p.defaultPrevented&&i(p)};return document.addEventListener("click",c,!0),{destroy(){document.removeEventListener("click",c,!0)}}}function Be(e){e.preventDefault(),e.stopPropagation(),D(J,!1)}Je(()=>{typeof window>"u"||(he({destroy:!0}),P?.getTracks().forEach(e=>e.stop()))});var Ce={click_outside:oe,get stream_state(){return b()},set stream_state(e){b(e),w()},get streaming(){return m()},set streaming(e){m(e),w()},get pending(){return ee()},set pending(e){ee(e),w()},get root(){return te()},set root(e){te(e),w()},get stream_every(){return ae()},set stream_every(e){ae(e),w()},get mode(){return C()},set mode(e){C(e),w()},get mirror_webcam(){return Q()},set mirror_webcam(e){Q(e),w()},get include_audio(){return X()},set include_audio(e){X(e),w()},get webcam_constraints(){return Z()},set webcam_constraints(e){Z(e),w()},get i18n(){return y()},set i18n(e){y(e),w()},get upload(){return ie()},set upload(e){ie(e),w()},get value(){return O()},set value(e){O(e),w()},get time_limit(){return re()},set time_limit(e){re(e),w()}};Ie();var ne=Wt(),we=o(ne);nt(we,{get time_limit(){return re()}});var le=T(we,2);let be;Fe(le,e=>D(r,e),()=>t(r));var ce=T(le,2);let ye;var Ue=T(ce,2);{var Le=e=>{var i=ht(),c=o(i);_t(c,{$$events:{click:async()=>Te()}}),n(i),et(1,i,()=>tt,()=>({delay:100,duration:200})),u(e,i)},Ae=e=>{var i=St(),c=Y(i),p=o(c),F=o(p);{var ve=g=>{var v=ge(),U=Y(v);{var de=_=>{var d=wt(),R=o(d),L=o(R);ot(L),n(R);var k=T(R);n(d),H(f=>K(k,` ${f??""}`),[()=>(V(y()),W(()=>y()("audio.waiting")))]),u(_,d)},ue=_=>{var d=ge(),R=Y(d);{var L=f=>{var E=bt(),S=o(E),me=o(S);st(me,{}),n(S);var _e=T(S);n(E),H(fe=>K(_e,` ${fe??""}`),[()=>(V(y()),W(()=>y()("audio.stop")))]),u(f,E)},k=f=>{var E=yt(),S=o(E),me=o(S);ut(me),n(S);var _e=T(S);n(E),H(fe=>K(_e,` ${fe??""}`),[()=>(V(y()),W(()=>y()("audio.record")))]),u(f,E)};A(R,f=>{m()&&b()==="open"||!m()&&t(M)?f(L):f(k,!1)},!0)}u(_,d)};A(U,_=>{m()&&b()==="waiting"?_(de):_(ue,!1)})}u(g,v)},He=g=>{var v=kt(),U=o(v);vt(U),n(v),u(g,v)};A(F,g=>{C()==="video"||m()?g(ve):g(He,!1)})}n(p);var Oe=T(p,2);{var Pe=g=>{var v=xt(),U=o(v);it(U),n(v),$("click",v,()=>D(J,!0)),u(g,v)};A(Oe,g=>{t(M)||g(Pe)})}n(c);var Ne=T(c,2);{var qe=g=>{var v=Mt(),U=o(v);{var de=_=>{var d=Dt(),R=o(d,!0);n(d),d.value=d.__value="",H(L=>K(R,L),[()=>(V(y()),W(()=>y()("common.no_devices")))]),u(_,d)},ue=_=>{var d=ge(),R=Y(d);Ve(R,1,()=>t(s),Qe,(L,k)=>{var f=It(),E=o(f,!0);n(f);var S={};H(()=>{Ke(f,(t(I),t(k),W(()=>t(I).deviceId===t(k).deviceId))),K(E,(t(k),W(()=>t(k).label))),S!==(S=(t(k),W(()=>t(k).deviceId)))&&(f.value=(f.__value=(t(k),W(()=>t(k).deviceId)))??"")}),u(L,f)}),u(_,d)};A(U,_=>{t(s),W(()=>t(s).length===0)?_(de):_(ue,!1)})}n(v),at(v,(_,d)=>oe?.(_,d),()=>Be),$e(()=>$("change",v,Ee)),u(g,v)};A(Ne,g=>{t(J)&&t(I)&&g(qe)})}H(()=>xe(p,"aria-label",C()==="image"?"capture photo":"start recording")),$("click",p,()=>he()),u(e,i)};A(Ue,e=>{t(N)?e(Ae,!1):e(Le)})}return n(ne),H(()=>{be=ke(le,1,"svelte-5v4i78",null,be,{flip:Q(),hide:!t(N)||t(N)&&!!O()}),xe(ce,"src",(V(O()),W(()=>O()?.url))),ye=ke(ce,1,"svelte-5v4i78",null,ye,{hide:!t(N)||t(N)&&!O()})}),u(l,ne),lt(a,"click_outside",oe),Re(Ce)}export{ut as C,Ot as W,lt as b}; diff --git a/assets/_baseUniq-BFKEI0vc.js b/assets/_baseUniq-BFKEI0vc.js deleted file mode 100644 index 1961c28655d03aad601da5099bc597a657f388c2..0000000000000000000000000000000000000000 --- a/assets/_baseUniq-BFKEI0vc.js +++ /dev/null @@ -1 +0,0 @@ -import{az as x,aP as ln,an as A,ax as v,am as W,aQ as gn,aR as dn,aS as hn,aT as z,aU as pn,aV as An,aW as m,aA as N,aF as U,aI as R,aX as _n,aD as on,aY as wn,aZ as On,ao as V,a_ as Pn,a$ as S}from"./mermaid.core-BcqUqpnI.js";var vn="[object Symbol]";function b(n){return typeof n=="symbol"||x(n)&&ln(n)==vn}function yn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e-1}function M(n){return W(n)?gn(n):dn(n)}var xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bn=/^\w*$/;function $(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||b(n)?!0:bn.test(n)||!xn.test(n)||r!=null&&n in Object(r)}var Mn=500;function $n(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var Cn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,Fn=$n(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(Cn,function(e,i,f,t){r.push(f?t.replace(Dn,"$1"):i||e)}),r});function Gn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:$(n,r)?[n]:Fn(Gn(n))}function I(n){if(typeof n=="string"||b(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&eu))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new y:void 0;for(t.set(n,r),t.set(r,n);++l=Br){var h=r?null:Ur(n);if(h)return C(h);s=!1,f=tn,a=new y}else a=r?[]:u;n:for(;++i{t[s]=o,t._internalCount++,t._internalCount===6&&n(t)},l=(o,f)=>{r&&o&&r(o.status+" "+o.statusText,f)};this._loadFile(i,a,void 0,void 0,!0,l)};x.prototype._cascadeLoadFiles=function(i,s,t,n=null){const r=[];r._internalCount=0;for(let a=0;a<6;a++)this._partialLoadFile(t[a],a,r,s,n)};x.prototype._cascadeLoadImgs=function(i,s,t,n,r=null,a){const l=[];l._internalCount=0;for(let o=0;o<6;o++)this._partialLoadImg(n[o],o,l,i,s,t,r,a)};x.prototype._partialLoadImg=function(i,s,t,n,r,a,l=null,o){const f=D();A(i,_=>{t[s]=_,t._internalCount++,n&&n.removePendingData(f),t._internalCount===6&&a&&a(r,t)},(_,c)=>{n&&n.removePendingData(f),l&&l(_,c)},n?n.offlineProvider:null,o),n&&n.addPendingData(f)};x.prototype.createCubeTextureBase=function(i,s,t,n,r=null,a=null,l,o=null,f=!1,L=0,T=0,_=null,c=null,C=null,y=!1,g=null){const e=_||new R(this,7);e.isCube=!0,e.url=i,e.generateMipMaps=!n,e._lodGenerationScale=L,e._lodGenerationOffset=T,e._useSRGBBuffer=!!y&&this._caps.supportSRGBBuffers&&(this.version>1||this.isWebGPU||!!n),e!==_&&(e.label=i.substring(0,60)),this._doNotHandleContextLost||(e._extension=o,e._files=t,e._buffer=g);const m=i;this._transformTextureUrl&&!_&&(i=this._transformTextureUrl(i));const P=o??W(i),G=B(P),p=(u,d)=>{e.dispose(),a?a(u,d):u&&I.Warn(u)},F=(u,d)=>{i===m?u&&p(u.status+" "+u.statusText,d):(I.Warn(`Failed to load ${i}, falling back to the ${m}`),this.createCubeTextureBase(m,s,t,!!n,r,p,l,o,f,L,T,e,c,C,y,g))};if(G)G.then(u=>{const d=h=>{c&&c(e,h),u.loadCubeData(h,e,f,r,(w,v)=>{p(w,v)})};g?d(g):t&&t.length===6?u.supportCascades?this._cascadeLoadFiles(s,h=>d(h.map(w=>new Uint8Array(w))),t,p):p("Textures type does not support cascades."):this._loadFile(i,h=>d(new Uint8Array(h)),void 0,s?s.offlineProvider||null:void 0,!0,F)});else{if(!t||t.length===0)throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");this._cascadeLoadImgs(s,e,(u,d)=>{C&&C(u,d)},t,p)}return this._internalTexturesCache.push(e),e}; diff --git a/assets/abstractSoundInstance-Bnv14BnJ.js b/assets/abstractSoundInstance-Bnv14BnJ.js deleted file mode 100644 index db0982db89944885778a08d2c440f3835556ab9f..0000000000000000000000000000000000000000 --- a/assets/abstractSoundInstance-Bnv14BnJ.js +++ /dev/null @@ -1 +0,0 @@ -import{O as i}from"./index-GY9JDBGV.js";import{A as r}from"./abstractSoundSource-Dkzp9Tp9.js";import{A as o}from"./audioEngine-D1fuR8_P.js";class l extends r{constructor(t,s,e){super(t,s,e,3),this._newestInstance=null,this._privateInstances=new Set,this._state=1,this._instances=this._privateInstances,this.onEndedObservable=new i,this._onInstanceEnded=n=>{this._newestInstance===n&&(this._newestInstance=null),this._privateInstances.delete(n),this._instances.size===0&&(this._state=1,this.onEndedObservable.notifyObservers(this)),n.dispose()}}get activeInstancesCount(){return this._instances.size}get autoplay(){return this._options.autoplay}get currentTime(){const t=this._getNewestInstance();return t?t.currentTime:0}set currentTime(t){this.startOffset=t;const s=this._getNewestInstance();s&&(s.currentTime=t)}get loop(){return this._options.loop}set loop(t){this._options.loop=t}get maxInstances(){return this._options.maxInstances}set maxInstances(t){this._options.maxInstances=t}get startOffset(){return this._options.startOffset}set startOffset(t){this._options.startOffset=t}get state(){return this._state}dispose(){super.dispose(),this.stop(),this._newestInstance=null,this._privateInstances.clear(),this.onEndedObservable.clear()}pause(){const t=this._instances.values();for(let s=t.next();!s.done;s=t.next())s.value.pause();this._state=5}resume(){if(this._state!==5)return;const t=this._instances.values();for(let s=t.next();!s.done;s=t.next())s.value.resume();this._state=3}_beforePlay(t){if(this.state===5&&this._instances.size>0){this.resume();return}t.onEndedObservable.addOnce(this._onInstanceEnded),this._privateInstances.add(t),this._newestInstance=t}_afterPlay(t){this._state=t.state}_getNewestInstance(){if(this._instances.size===0)return null;if(!this._newestInstance){const t=this._instances.values();for(let s=t.next();!s.done;s=t.next())this._newestInstance=s.value}return this._newestInstance}_setState(t){this._state=t}_stopExcessInstances(){if(this.maxInstances<1/0){const t=Array.from(this._instances).filter(e=>e.state===3).length-this.maxInstances,s=this._instances.values();for(let e=0;e{this._outBus=null},this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}get spatial(){return this._spatial?this._spatial:this._initSpatialProperty()}dispose(){super.dispose(),this._spatial?.dispose(),this._spatial=null,this._outBus&&this._onOutBusDisposed&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),this._onOutBusDisposed=null),this._outBus=null}_initSpatialProperty(){return this._spatial=this._createSpatialProperty(this._spatialAutoUpdate,this._spatialMinUpdateTime)}get _isSpatial(){return this._spatial!==null}set _isSpatial(t){t&&!this._spatial?this._initSpatialProperty():!t&&this._spatial&&(this._spatial.dispose(),this._spatial=null)}}export{p as A}; diff --git a/assets/actions-4RaHFoGI.js b/assets/actions-4RaHFoGI.js deleted file mode 100644 index 2c4a91932baca925fbeab7c0c518bcd3ead794f4..0000000000000000000000000000000000000000 --- a/assets/actions-4RaHFoGI.js +++ /dev/null @@ -1 +0,0 @@ -import{u as d,v as u,w as n,x as c,y as p}from"./index-DydPgVMC.js";function y(s,o,r){d(()=>{var a=u(()=>o(s,r?.())||{});if(r&&a?.update){var t=!1,f={};n(()=>{var e=r();c(e),t&&p(f,e)&&(f=e,a.update(e))}),t=!0}if(a?.destroy)return()=>a.destroy()})}export{y as a}; diff --git a/assets/animationGroup-R6N9NYXv.js b/assets/animationGroup-R6N9NYXv.js deleted file mode 100644 index def74246438833771b1ebcb76dc9360875353786..0000000000000000000000000000000000000000 --- a/assets/animationGroup-R6N9NYXv.js +++ /dev/null @@ -1 +0,0 @@ -import{as as A,M as F,bs as x,bt as E,bu as R,bv as M,bw as N,bx as B,by as k,O as P,c as T,ao as S,V as C,b as D,aq as W,bi as w,aY as K}from"./index-GY9JDBGV.js";import{B as Y}from"./bone-CnpD8dWY.js";import"./index-DydPgVMC.js";class U{get currentFrame(){return this._currentFrame}get weight(){return this._weight}get currentValue(){return this._currentValue}get targetPath(){return this._targetPath}get target(){return this._currentActiveTarget}get isAdditive(){return this._host&&this._host.isAdditive}constructor(t,e,i,n){if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._absoluteFrameOffset=0,this._previousElapsedTime=0,this._yoyoDirection=1,this._previousAbsoluteFrame=0,this._targetIsArray=!1,this._coreRuntimeAnimation=null,this._animation=e,this._target=t,this._scene=i,this._host=n,this._activeTargets=[],e._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===A.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=F.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minFrame!==0){const a={frame:0,value:this._keys[0].value};this._keys.splice(0,0,a)}if(this._target instanceof Array){let a=0;for(const o of this._target)this._preparePath(o,a),this._getOriginalValues(a),a++;this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];const s=e.getEvents();if(s&&s.length>0)for(const a of s)this._events.push(a._clone());this._enableBlending=t&&t.animationPropertiesOverride?t.animationPropertiesOverride.enableBlending:this._animation.enableBlending}_preparePath(t,e=0){const i=this._animation.targetPropertyPath;if(i.length>1){let n=t;for(let s=0;s-1&&this._animation.runtimeAnimations.splice(t,1)}setValue(t,e){if(this._targetIsArray){for(let i=0;ii[i.length-1].frame&&(t=i[i.length-1].frame);const n=this._events;if(n.length)for(let a=0;athis._maxFrame)&&(e=this._minFrame),(ithis._maxFrame)&&(i=this._maxFrame),g=i-e;let _,m=t*(o.framePerSecond*s)/1e3+this._absoluteFrameOffset,b=0,O=!1;const v=n&&this._animationState.loopMode===A.ANIMATIONLOOPMODE_YOYO;if(v){const f=(m-e)/g,p=Math.sin(f*Math.PI);m=Math.abs(p)*g+e;const I=p>=0?1:-1;this._yoyoDirection!==I&&(O=!0),this._yoyoDirection=I}if(this._previousElapsedTime=t,this._previousAbsoluteFrame=m,!n&&i>=e&&(m>=g&&s>0||m<=0&&s<0))l=!1,b=o.evaluate(i);else if(!n&&e>=i&&(m<=g&&s<0||m>=0&&s>0))l=!1,b=o.evaluate(e);else if(this._animationState.loopMode!==A.ANIMATIONLOOPMODE_CYCLE){const f=i.toString()+e.toString();if(!this._offsetsCache[f]){this._animationState.repeatCount=0,this._animationState.loopMode=A.ANIMATIONLOOPMODE_CYCLE;const p=o._interpolate(e,this._animationState),y=o._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),o.dataType){case A.ANIMATIONTYPE_FLOAT:this._offsetsCache[f]=y-p;break;case A.ANIMATIONTYPE_QUATERNION:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_VECTOR3:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_VECTOR2:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_SIZE:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_COLOR3:this._offsetsCache[f]=y.subtract(p);break}this._highLimitsCache[f]=y}b=this._highLimitsCache[f],_=this._offsetsCache[f]}if(_===void 0)switch(o.dataType){case A.ANIMATIONTYPE_FLOAT:_=0;break;case A.ANIMATIONTYPE_QUATERNION:_=B;break;case A.ANIMATIONTYPE_VECTOR3:_=N;break;case A.ANIMATIONTYPE_VECTOR2:_=M;break;case A.ANIMATIONTYPE_SIZE:_=R;break;case A.ANIMATIONTYPE_COLOR3:_=E;break;case A.ANIMATIONTYPE_COLOR4:_=x;break}if(this._host&&this._host.syncRoot){const f=this._host.syncRoot,p=(f.masterFrame-f.fromFrame)/(f.toFrame-f.fromFrame);u=e+g*p}else m>0&&e>i||m<0&&e0&&this.currentFrame>u||s<0&&this.currentFrame0?0:o.getKeys().length-1}this._currentFrame=u,this._animationState.repeatCount=g===0?0:m/g>>0,this._animationState.highLimitValue=b,this._animationState.offsetValue=_}const d=o._interpolate(u,this._animationState);if(this.setValue(d,a),c.length){for(let _=0;_=0&&u>=c[_].frame&&c[_].frame>=e||g<0&&u<=c[_].frame&&c[_].frame<=e){const m=c[_];m.isDone||(m.onlyOnce&&(c.splice(_,1),_--),m.isDone=!0,m.action(u))}}return l||(this._stopped=!0),l}}class L{get syncRoot(){return this._syncRoot}get masterFrame(){return this._runtimeAnimations.length===0?0:this._runtimeAnimations[0].currentFrame}get weight(){return this._weight}set weight(t){if(t===-1){this._weight=-1;return}this._weight=Math.min(Math.max(t,0),1)}get speedRatio(){return this._speedRatio}set speedRatio(t){for(let e=0;e-1&&(this._scene._activeAnimatables.splice(e,1),this._scene._activeAnimatables.push(this))}return this}getAnimations(){return this._runtimeAnimations}appendAnimations(t,e){for(let i=0;i{this.onAnimationLoopObservable.notifyObservers(this),this.onAnimationLoop&&this.onAnimationLoop()},this._runtimeAnimations.push(s)}}getAnimationByTargetProperty(t){const e=this._runtimeAnimations;for(let i=0;i-1){const a=this._runtimeAnimations;for(let o=a.length-1;o>=0;o--){const r=a[o];t&&r.animation.name!=t||e&&!e(r.target)||(r.dispose(),a.splice(o,1))}a.length==0&&(i||this._scene._activeAnimatables.splice(s,1),n||this._raiseOnAnimationEnd())}}else{const s=this._scene._activeAnimatables.indexOf(this);if(s>-1){i||this._scene._activeAnimatables.splice(s,1);const a=this._runtimeAnimations;for(let o=0;o{this.onAnimationEndObservable.add(()=>{t(this)},void 0,void 0,this,!0)})}_animate(t){if(this._paused)return this.animationStarted=!1,this._pausedDelay===null&&(this._pausedDelay=t),!0;if(this._localDelayOffset===null?(this._localDelayOffset=t,this._pausedDelay=null):this._pausedDelay!==null&&(this._localDelayOffset+=t-this._pausedDelay,this._pausedDelay=null),this._manualJumpDelay!==null&&(this._localDelayOffset+=this.speedRatio<0?-this._manualJumpDelay:this._manualJumpDelay,this._manualJumpDelay=null,this._frameToSyncFromJump=null),this._goToFrame=null,!L.ProcessPausedAnimatables&&this._weight===0&&this._previousWeight===0)return!0;this._previousWeight=this._weight;let e=!1;const i=this._runtimeAnimations;let n;for(n=0;n0?r:-r,n),d.scaleAndAddToRef(r,e)}n.normalize()}for(let c=0;c0)n.copyFrom(i);else if(h.animations.length===1){if(S.SlerpToRef(i,e.currentValue,Math.min(1,h.totalWeight),n),h.totalAdditiveWeight===0)return n}else if(h.animations.length>1){let s=1,a,o;if(h.totalWeight<1){const l=1-h.totalWeight;a=[],o=[],a.push(i),o.push(l)}else{if(h.animations.length===2&&(S.SlerpToRef(h.animations[0].currentValue,h.animations[1].currentValue,h.animations[1].weight/h.totalWeight,t),h.totalAdditiveWeight===0))return t;a=[],o=[],s=h.totalWeight}for(let l=0;l=r&&v.frame<=l&&(s?(p=v.value.clone(),_?(f=p.getTranslation(),p.setTranslation(f.scaleInPlace(m))):b&&a?(f=p.getTranslation(),p.setTranslation(f.multiplyInPlace(a))):p=v.value):p=v.value,O.push({frame:v.frame+n,value:p}));return this.animations[0].createRange(i,r+n,l+n),!0}),h&&(h.prototype._animate=function(e){if(!this.animationsEnabled)return;const i=k.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=i}this.deltaTime=e!==void 0?e:this.useConstantAnimationDeltaTime?16:(i-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=i;const n=this._activeAnimatables;if(n.length===0)return;this._animationTime+=this.deltaTime;const s=this._animationTime;for(let a=0;ae.playOrder-i.playOrder)},h.prototype.beginWeightedAnimation=function(e,i,n,s=1,a,o=1,r,l,u,c,g=!1){const d=this.beginAnimation(e,i,n,a,o,r,l,!1,u,c,g);return d.weight=s,d},h.prototype.beginAnimation=function(e,i,n,s,a=1,o,r,l=!0,u,c,g=!1){if(a<0){const _=i;i=n,n=_,a=-a}i>n&&(a=-a),l&&this.stopAnimation(e,void 0,u),r||(r=new L(this,e,i,n,s,a,o,void 0,c,g));const d=u?u(e):!0;if(e.animations&&d&&r.appendAnimations(e,e.animations),e.getAnimatables){const _=e.getAnimatables();for(let m=0;m<_.length;m++)this.beginAnimation(_[m],i,n,s,a,o,r,l,u,c)}return r.reset(),r},h.prototype.beginHierarchyAnimation=function(e,i,n,s,a,o=1,r,l,u=!0,c,g,d=!1){const _=e.getDescendants(i),m=[];m.push(this.beginAnimation(e,n,s,a,o,r,l,u,c,void 0,d));for(const b of _)m.push(this.beginAnimation(b,n,s,a,o,r,l,u,c,void 0,d));return m},h.prototype.beginDirectAnimation=function(e,i,n,s,a,o=1,r,l,u=!1){if(o<0){const g=n;n=s,s=g,o=-o}return n>s&&(o=-o),new L(this,e,n,s,a,o,r,i,l,u)},h.prototype.beginDirectHierarchyAnimation=function(e,i,n,s,a,o,r,l,u,c=!1){const g=e.getDescendants(i),d=[];d.push(this.beginDirectAnimation(e,n,s,a,o,r,l,u,c));for(const _ of g)d.push(this.beginDirectAnimation(_,n,s,a,o,r,l,u,c));return d},h.prototype.getAnimatableByTarget=function(e){for(let i=0;i0)){for(let e=0;ea&&(a=r.to);const o=new V(t[0].name+"_merged",t[0]._scene,n);for(const r of t){i&&r.normalize(s,a);for(const l of r.targetedAnimations)o.addTargetedAnimation(l.animation,l.target);e&&r.dispose()}return o}getScene(){return this._scene}constructor(t,e=null,i=-1,n=0){this.name=t,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this._weight=-1,this._playOrder=0,this._enableBlending=null,this._blendingSpeed=null,this._numActiveAnimatables=0,this._shouldStart=!0,this._parentContainer=null,this.onAnimationEndObservable=new P,this.onAnimationLoopObservable=new P,this.onAnimationGroupLoopObservable=new P,this.onAnimationGroupEndObservable=new P,this.onAnimationGroupPauseObservable=new P,this.onAnimationGroupPlayObservable=new P,this.metadata=null,this._mask=null,this._animationLoopFlags=[],this._scene=e||W.LastCreatedScene,this._weight=i,this._playOrder=n,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}addTargetedAnimation(t,e){const i=new q(this);i.animation=t,i.target=e;const n=t.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to-1;e--)this._targetedAnimations[e].animation===t&&this._targetedAnimations.splice(e,1)}normalize(t=null,e=null){t==null&&(t=this._from),e==null&&(e=this._to);for(let i=0;it){const r={frame:t,value:a.value,inTangent:a.inTangent,outTangent:a.outTangent,interpolation:a.interpolation};s.splice(0,0,r)}if(o.frame{this.onAnimationLoopObservable.notifyObservers(e),!this._animationLoopFlags[i]&&(this._animationLoopFlags[i]=!0,this._animationLoopCount++,this._animationLoopCount===this._numActiveAnimatables&&(this.onAnimationGroupLoopObservable.notifyObservers(this),this._animationLoopCount=0,this._animationLoopFlags.length=0))}}start(t=!1,e=1,i,n,s){if(this._isStarted||this._targetedAnimations.length===0)return this;this._loopAnimation=t,this._shouldStart=!1,this._animationLoopCount=0,this._animationLoopFlags.length=0;for(let a=0;a{this.onAnimationEndObservable.notifyObservers(o),this._checkAnimationGroupEnded(r)},this._processLoop(r,o,a),this._animatables.push(r)}return this.syncWithMask(),this._scene.sortActiveAnimatables(),this._speedRatio=e,this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}pause(){if(!this._isStarted)return this;this._isPaused=!0;for(let t=0;t0?this._scene._activeAnimatables[i++]=s:t&&this._checkAnimationGroupEnded(s,t)}return this._scene._activeAnimatables.length=i,this._isStarted=!1,this}setWeightForAllAnimatables(t){for(let e=0;e-1&&this._parentContainer.animationGroups.splice(t,1),this._parentContainer=null}this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()}_checkAnimationGroupEnded(t,e=!1){const i=this._animatables.indexOf(t);i>-1&&this._animatables.splice(i,1),this._animatables.length===this._targetedAnimations.length-this._numActiveAnimatables&&(this._isStarted=!1,e||this.onAnimationGroupEndObservable.notifyObservers(this),this._animatables.length=0)}clone(t,e,i=!1){const n=new V(t||this.name,this._scene,this._weight,this._playOrder);n._from=this.from,n._to=this.to,n._speedRatio=this.speedRatio,n._loopAnimation=this.loopAnimation,n._isAdditive=this.isAdditive,n._enableBlending=this.enableBlending,n._blendingSpeed=this.blendingSpeed,n.metadata=this.metadata,n.mask=this.mask;for(const s of this._targetedAnimations)n.addTargetedAnimation(i?s.animation.clone():s.animation,e?e(s.target):s.target);return n}serialize(){const t={};t.name=this.name,t.from=this.from,t.to=this.to,t.speedRatio=this.speedRatio,t.loopAnimation=this.loopAnimation,t.isAdditive=this.isAdditive,t.weight=this.weight,t.playOrder=this.playOrder,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,t.targetedAnimations=[];for(let e=0;em[0].frame&&(l=m[0].frame),u=e&&m<=i||s&&b.frame>=e&&b.frame<=i){const O={frame:b.frame,value:b.value.clone?b.value.clone():b.value,inTangent:b.inTangent,outTangent:b.outTangent,interpolation:b.interpolation,lockedTangent:b.lockedTangent};_===Number.MAX_VALUE&&(_=O.frame),O.frame-=_,d.push(O)}}if(d.length===0){r.splice(l,1),l--;continue}a>d[0].frame&&(a=d[0].frame),oo?(this.rect.x-=(this.labelWidth-o)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(o+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(s+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>s?(this.rect.y-=(this.labelHeight-s)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(s+this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(t){var o=this.rect.x;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var s=this.rect.y;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var c=new l(o,s),f=t.inverseTransformPoint(c);this.setLocation(f.x,f.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},M.exports=i}),(function(M,G,N){var d=N(0);function h(){}for(var a in d)h[a]=d[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=h}),(function(M,G,N){function d(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(h){this.x=h},d.prototype.setY=function(h){this.y=h},d.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},M.exports=d}),(function(M,G,N){var d=N(2),h=N(10),a=N(0),e=N(7),r=N(3),l=N(1),i=N(13),u=N(12),t=N(11);function o(c,f,T){d.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,f!=null&&f instanceof e?this.graphManager=f:f!=null&&f instanceof Layout&&(this.graphManager=f.graphManager)}o.prototype=Object.create(d.prototype);for(var s in d)o[s]=d[s];o.prototype.getNodes=function(){return this.nodes},o.prototype.getEdges=function(){return this.edges},o.prototype.getGraphManager=function(){return this.graphManager},o.prototype.getParent=function(){return this.parent},o.prototype.getLeft=function(){return this.left},o.prototype.getRight=function(){return this.right},o.prototype.getTop=function(){return this.top},o.prototype.getBottom=function(){return this.bottom},o.prototype.isConnected=function(){return this.isConnected},o.prototype.add=function(c,f,T){if(f==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var v=c;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(f.owner==T.owner&&f.owner==this))throw"Both owners must be this graph!";return f.owner!=T.owner?null:(v.source=f,v.target=T,v.isInterGraph=!1,this.getEdges().push(v),f.edges.push(v),T!=f&&T.edges.push(v),v)}},o.prototype.remove=function(c){var f=c;if(c instanceof r){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=f.edges.slice(),g,v=T.length,L=0;L-1&&b>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(b,1);var F=g.source.owner.getEdges().indexOf(g);if(F==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(F,1)}},o.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,f=h.MAX_VALUE,T,g,v,L=this.getNodes(),F=L.length,A=0;AT&&(c=T),f>g&&(f=g)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?v=L[0].getParent().paddingLeft:v=this.margin,this.left=f-v,this.top=c-v,new u(this.left,this.top))},o.prototype.updateBounds=function(c){for(var f=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,v=-h.MAX_VALUE,L,F,A,b,k,U=this.nodes,K=U.length,D=0;DL&&(f=L),TA&&(g=A),vL&&(f=L),TA&&(g=A),v=this.nodes.length){var K=0;T.forEach(function(D){D.owner==c&&K++}),K==this.nodes.length&&(this.isConnected=!0)}},M.exports=o}),(function(M,G,N){var d,h=N(1);function a(e){d=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),r=this.layout.newNode(null),l=this.add(e,r);return this.setRootGraph(l),this.rootGraph},a.prototype.add=function(e,r,l,i,u){if(l==null&&i==null&&u==null){if(e==null)throw"Graph is null!";if(r==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(r.child!=null)throw"Already has a child!";return e.parent=r,r.child=e,e}else{u=l,i=r,l=e;var t=i.getOwner(),o=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(o!=null&&o.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==o)return l.isInterGraph=!1,t.add(l,i,u);if(l.isInterGraph=!0,l.source=i,l.target=u,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},a.prototype.remove=function(e){if(e instanceof d){var r=e;if(r.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(r==this.rootGraph||r.parent!=null&&r.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(r.getEdges());for(var i,u=l.length,t=0;t=e.getRight()?r[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(r[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(r[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*r[0],o=r[1]/u;r[0]t)return r[0]=l,r[1]=s,r[2]=u,r[3]=U,!1;if(iu)return r[0]=o,r[1]=i,r[2]=b,r[3]=t,!1;if(lu?(r[0]=f,r[1]=T,n=!0):(r[0]=c,r[1]=s,n=!0):p===y&&(l>u?(r[0]=o,r[1]=s,n=!0):(r[0]=g,r[1]=T,n=!0)),-E===y?u>l?(r[2]=k,r[3]=U,m=!0):(r[2]=b,r[3]=A,m=!0):E===y&&(u>l?(r[2]=F,r[3]=A,m=!0):(r[2]=K,r[3]=U,m=!0)),n&&m)return!1;if(l>u?i>t?(I=this.getCardinalDirection(p,y,4),w=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),w=this.getCardinalDirection(-E,y,1)):i>t?(I=this.getCardinalDirection(-p,y,1),w=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),w=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=s,R=l+-L/y,r[0]=R,r[1]=W;break;case 2:R=g,W=i+v*y,r[0]=R,r[1]=W;break;case 3:W=T,R=l+L/y,r[0]=R,r[1]=W;break;case 4:R=f,W=i+-v*y,r[0]=R,r[1]=W;break}if(!m)switch(w){case 1:q=A,x=u+-it/y,r[2]=x,r[3]=q;break;case 2:x=K,q=t+D*y,r[2]=x,r[3]=q;break;case 3:q=U,x=u+it/y,r[2]=x,r[3]=q;break;case 4:x=k,q=t+-D*y,r[2]=x,r[3]=q;break}}return!1},h.getCardinalDirection=function(a,e,r){return a>e?r:1+r%4},h.getIntersection=function(a,e,r,l){if(l==null)return this.getIntersection2(a,e,r);var i=a.x,u=a.y,t=e.x,o=e.y,s=r.x,c=r.y,f=l.x,T=l.y,g=void 0,v=void 0,L=void 0,F=void 0,A=void 0,b=void 0,k=void 0,U=void 0,K=void 0;return L=o-u,A=i-t,k=t*u-i*o,F=T-c,b=s-f,U=f*c-s*T,K=L*b-F*A,K===0?null:(g=(A*U-b*k)/K,v=(F*k-L*U)/K,new d(g,v))},h.angleOfVector=function(a,e,r,l){var i=void 0;return a!==r?(i=Math.atan((l-e)/(r-a)),r=0){var T=(-s+Math.sqrt(s*s-4*o*c))/(2*o),g=(-s-Math.sqrt(s*s-4*o*c))/(2*o),v=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:v}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,M.exports=h}),(function(M,G,N){function d(){}d.sign=function(h){return h>0?1:h<0?-1:0},d.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},d.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},M.exports=d}),(function(M,G,N){function d(){}d.MAX_VALUE=2147483647,d.MIN_VALUE=-2147483648,M.exports=d}),(function(M,G,N){var d=(function(){function i(u,t){for(var o=0;o"u"?"undefined":d(a);return a==null||e!="object"&&e!="function"},M.exports=h}),(function(M,G,N){function d(s){if(Array.isArray(s)){for(var c=0,f=Array(s.length);c0&&c;){for(L.push(A[0]);L.length>0&&c;){var b=L[0];L.splice(0,1),v.add(b);for(var k=b.getEdges(),g=0;g-1&&A.splice(it,1)}v=new Set,F=new Map}}return s},o.prototype.createDummyNodesForBendpoints=function(s){for(var c=[],f=s.source,T=this.graphManager.calcLowestCommonAncestor(s.source,s.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(f),g=0;g=0&&c.splice(U,1);var K=F.getNeighborsList();K.forEach(function(n){if(f.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&b.push(n),T.set(n,p)}})}f=f.concat(b),(c.length==1||c.length==2)&&(g=!0,v=c[0])}return v},o.prototype.setGraphManager=function(s){this.graphManager=s},M.exports=o}),(function(M,G,N){function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=Math.sin(d.seed++)*1e4,d.x-Math.floor(d.x)},M.exports=d}),(function(M,G,N){var d=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,r=this.lworldExtX;return r!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/r),e},h.prototype.transformY=function(a){var e=0,r=this.lworldExtY;return r!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/r),e},h.prototype.inverseTransformX=function(a){var e=0,r=this.ldeviceExtX;return r!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/r),e},h.prototype.inverseTransformY=function(a){var e=0,r=this.ldeviceExtY;return r!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/r),e},h.prototype.inverseTransformPoint=function(a){var e=new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},M.exports=h}),(function(M,G,N){function d(t){if(Array.isArray(t)){for(var o=0,s=Array(t.length);oa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),o,s=0;s0&&arguments[0]!==void 0?arguments[0]:!0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s,c,f,T,g=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),v=new Set,s=0;sL||v>L)&&(t.gravitationForceX=-this.gravityConstant*f,t.gravitationForceY=-this.gravityConstant*T)):(L=o.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||v>L)&&(t.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},i.prototype.isConverged=function(){var t,o=!1;return this.totalIterations>this.maxIterations/3&&(o=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var F=0;Fi}}]),r})();M.exports=e}),(function(M,G,N){function d(){}d.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),r=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),l=!0,i=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;V--){if((function(Tt,Ct){return Tt&&Ct})(V0;){var Q=void 0,It=void 0;for(Q=n-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(e[Q])<=ht+_*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[Q]=0;break}if(Q===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=Q&&Nt!==Q;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==Q+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+_*vt){this.s[Nt]=0;break}}Nt===Q?It=3:Nt===n-1?It=1:(It=2,Q=Nt)}switch(Q++,It){case 1:{var rt=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=Q;gt--){var mt=d.hypot(this.s[gt],rt),At=this.s[gt]/mt,Ot=rt/mt;this.s[gt]=mt,gt!==Q&&(rt=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=this.s[Q+1]);){var Lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=Lt,QMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},M.exports=d}),(function(M,G,N){var d=(function(){function e(r,l){for(var i=0;i2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=r,this.sequence2=l,this.match_score=i,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=r.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;r--){var l=this.listeners[r];l.event===a&&l.callback===e&&this.listeners.splice(r,1)}},h.emit=function(a,e){for(var r=0;r{var G={45:((a,e,r)=>{var l={};l.layoutBase=r(551),l.CoSEConstants=r(806),l.CoSEEdge=r(767),l.CoSEGraph=r(880),l.CoSEGraphManager=r(578),l.CoSELayout=r(765),l.CoSENode=r(991),l.ConstraintHandler=r(902),a.exports=l}),806:((a,e,r)=>{var l=r(551).FDLayoutConstants;function i(){}for(var u in l)i[u]=l[u];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,a.exports=i}),767:((a,e,r)=>{var l=r(551).FDLayoutEdge;function i(t,o,s){l.call(this,t,o,s)}i.prototype=Object.create(l.prototype);for(var u in l)i[u]=l[u];a.exports=i}),880:((a,e,r)=>{var l=r(551).LGraph;function i(t,o,s){l.call(this,t,o,s)}i.prototype=Object.create(l.prototype);for(var u in l)i[u]=l[u];a.exports=i}),578:((a,e,r)=>{var l=r(551).LGraphManager;function i(t){l.call(this,t)}i.prototype=Object.create(l.prototype);for(var u in l)i[u]=l[u];a.exports=i}),765:((a,e,r)=>{var l=r(551).FDLayout,i=r(578),u=r(880),t=r(991),o=r(767),s=r(806),c=r(902),f=r(551).FDLayoutConstants,T=r(551).LayoutConstants,g=r(551).Point,v=r(551).PointD,L=r(551).DimensionD,F=r(551).Layout,A=r(551).Integer,b=r(551).IGeometry,k=r(551).LGraph,U=r(551).Transform,K=r(551).LinkedList;function D(){l.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(l.prototype);for(var it in l)D[it]=l[it];D.prototype.newGraphManager=function(){var n=new i(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new o(null,null,n)},D.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.isSubLayout||(s.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(s.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),s.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),s.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),s.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var w=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;_--)H=Math.floor(Math.random()*(_+1)),$=O[_],O[_]=O[H],O[H]=$;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=w.has(O.left)?w.get(O.left):O.left,$=w.has(O.right)?w.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes($)||(n.nodesInRelativeHorizontal.push($),n.nodeToRelativeConstraintMapHorizontal.set($,[]),n.dummyToNodeForVerticalAlignment.has($)?n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get($)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get($).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:$,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get($).push({left:H,gap:O.gap})}else{var _=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(_)||(n.nodesInRelativeVertical.push(_),n.nodeToRelativeConstraintMapVertical.set(_,[]),n.dummyToNodeForHorizontalAlignment.has(_)?n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(_).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(_).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:_,gap:O.gap})}});else{var q=new Map,V=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=w.has(O.left)?w.get(O.left):O.left,$=w.has(O.right)?w.get(O.right):O.right;q.has(H)?q.get(H).push($):q.set(H,[$]),q.has($)?q.get($).push(H):q.set($,[H])}else{var _=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;V.has(_)?V.get(_).push(ht):V.set(_,[ht]),V.has(ht)?V.get(ht).push(_):V.set(ht,[_])}});var Y=function(H,$){var _=[],ht=[],Q=new K,It=new Set,Nt=0;return H.forEach(function(vt,rt){if(!It.has(rt)){_[Nt]=[],ht[Nt]=!1;var gt=rt;for(Q.push(gt),It.add(gt),_[Nt].push(gt);Q.length!=0;){gt=Q.shift(),$.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(Q.push(At),It.add(At),_[Nt].push(At))})}Nt++}}),{components:_,isFixed:ht}},et=Y(q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=et.components,this.fixedComponentsOnHorizontal=et.isFixed;var z=Y(V,n.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var O=n.idToNodeMap.get(z.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;RE&&(E=Math.floor(w.y)),I=Math.floor(w.x+s.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(T.WORLD_CENTER_X-w.x/2,T.WORLD_CENTER_Y-w.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),s.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=k.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var w=0;w1;){var $=H[0];H.splice(0,1);var _=V.indexOf($);_>=0&&V.splice(_,1),z--,Y--}m!=null?O=(V.indexOf(H[0])+1)%z:O=0;for(var ht=Math.abs(E-p)/Y,Q=O;et!=Y;Q=++Q%z){var It=V[Q].getOtherEnd(n);if(It!=m){var Nt=(p+et*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),et++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;pm&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var q=m[W][0].getParent(),V=new t(n.graphManager);V.id=x,V.paddingLeft=q.paddingLeft||0,V.paddingRight=q.paddingRight||0,V.paddingBottom=q.paddingBottom||0,V.paddingTop=q.paddingTop||0,n.idToDummyNode[x]=V;var Y=n.getGraphManager().add(n.newGraph(),V),et=q.getChild();et.add(V);for(var z=0;zy?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,w=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,w)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,w=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,w,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;Eq&&(q=Y.rect.height)}p+=q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,s.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,w=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(w+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>w?(y.rect.y-=(y.labelHeight-w)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-w)/2):y.labelPosVertical=="bottom"&&y.setHeight(w+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),w;return IR&&(R=z.getWidth())});var W=I/y,x=w/y,q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,V=(E-p+Math.sqrt(q))/(2*(W+E)),Y;m?(Y=Math.ceil(V),Y==V&&Y++):Y=Math.floor(V);var et=Y*(W+E)-E;return R>et&&(et=R),et+=E*2,et},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=s.TILING_PADDING_VERTICAL,y=s.TILING_PADDING_HORIZONTAL,I=s.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(w.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function(z,O){var H=W;return w.idealRowWidth?(H=I,H(z.id,O.id)):H(z,O)});for(var x=0,q=0,V=0;V0&&(w+=n.horizontalPadding),n.rowWidth[p]=w,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var w=n.rowWidth[I];if(w+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-w>=m+n.horizontalPadding?W=(n.height+R)/(w+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var w=Number.MIN_VALUE,R=0;Rw&&(w=E[R].height);m>0&&(w+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=w,n.rowHeight[p]0)for(var et=y;et<=I;et++)Y[0]+=this.grid[et][w-1].length+this.grid[et][w].length-1;if(I0)for(var et=w;et<=R;et++)Y[3]+=this.grid[y-1][et].length+this.grid[y][et].length-1;for(var z=A.MAX_VALUE,O,H,$=0;${var l=r(551).FDLayoutNode,i=r(551).IMath;function u(o,s,c,f){l.call(this,o,s,c,f)}u.prototype=Object.create(l.prototype);for(var t in l)u[t]=l[t];u.prototype.calculateDisplacement=function(){var o=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementX=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementY=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(o,s){for(var c=this.getChild().getNodes(),f,T=0;T{function l(c){if(Array.isArray(c)){for(var f=0,T=Array(c.length);f0){var Lt=0;ot.forEach(function(st){B=="horizontal"?(tt.set(st,g.has(st)?v[g.get(st)]:Z.get(st)),Lt+=tt.get(st)):(tt.set(st,g.has(st)?L[g.get(st)]:Z.get(st)),Lt+=tt.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){J.has(st)||tt.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){B=="horizontal"?ft+=g.has(st)?v[g.get(st)]:Z.get(st):ft+=g.has(st)?L[g.get(st)]:Z.get(st)}),ft=ft/lt.length,lt.forEach(function(st){tt.set(st,ft)})}});for(var Mt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(tt.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;tt.set(te,tt.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return tt},it=function(P){var B=0,J=0,Z=0,at=0;if(P.forEach(function(j){j.left?v[g.get(j.left)]-v[g.get(j.right)]>=0?B++:J++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?Z++:at++}),B>J&&Z>at)for(var ct=0;ctJ)for(var nt=0;ntat)for(var tt=0;tt1)f.fixedNodeConstraint.forEach(function(S,P){E[P]=[S.position.x,S.position.y],y[P]=[v[g.get(S.nodeId)],L[g.get(S.nodeId)]]}),I=!0;else if(f.alignmentConstraint)(function(){var S=0;if(f.alignmentConstraint.vertical){for(var P=f.alignmentConstraint.vertical,B=function(tt){var j=new Set;P[tt].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(l(j)).filter(function(pt){return R.has(pt)})),Mt=void 0;ut.size>0?Mt=v[g.get(ut.values().next().value)]:Mt=K(j).x,P[tt].forEach(function(pt){E[S]=[Mt,L[g.get(pt)]],y[S]=[v[g.get(pt)],L[g.get(pt)]],S++})},J=0;J0?Mt=v[g.get(ut.values().next().value)]:Mt=K(j).y,Z[tt].forEach(function(pt){E[S]=[v[g.get(pt)],Mt],y[S]=[v[g.get(pt)],L[g.get(pt)]],S++})},ct=0;ctV&&(V=q[et].length,Y=et);if(V0){var Et={x:0,y:0};f.fixedNodeConstraint.forEach(function(S,P){var B={x:v[g.get(S.nodeId)],y:L[g.get(S.nodeId)]},J=S.position,Z=U(J,B);Et.x+=Z.x,Et.y+=Z.y}),Et.x/=f.fixedNodeConstraint.length,Et.y/=f.fixedNodeConstraint.length,v.forEach(function(S,P){v[P]+=Et.x}),L.forEach(function(S,P){L[P]+=Et.y}),f.fixedNodeConstraint.forEach(function(S){v[g.get(S.nodeId)]=S.position.x,L[g.get(S.nodeId)]=S.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var Dt=f.alignmentConstraint.vertical,Rt=function(P){var B=new Set;Dt[P].forEach(function(at){B.add(at)});var J=new Set([].concat(l(B)).filter(function(at){return R.has(at)})),Z=void 0;J.size>0?Z=v[g.get(J.values().next().value)]:Z=K(B).x,B.forEach(function(at){R.has(at)||(v[g.get(at)]=Z)})},Ht=0;Ht0?Z=L[g.get(J.values().next().value)]:Z=K(B).y,B.forEach(function(at){R.has(at)||(L[g.get(at)]=Z)})},Ft=0;Ft{a.exports=M})},N={};function d(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return G[a](r,r.exports,d),r.exports}var h=d(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,X){(function(G,N){C.exports=N(dr())})(vr,function(M){return(()=>{var G={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var r=arguments.length,l=Array(r>1?r-1:0),i=1;i{var l=(function(){function t(o,s){var c=[],f=!0,T=!1,g=void 0;try{for(var v=o[Symbol.iterator](),L;!(f=(L=v.next()).done)&&(c.push(L.value),!(s&&c.length===s));f=!0);}catch(F){T=!0,g=F}finally{try{!f&&v.return&&v.return()}finally{if(T)throw g}}return c}return function(o,s){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return t(o,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=r(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var o={},s=0;s0&&I.merge(x)});for(var w=0;w1){L=g[0],F=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),k),U},u.relocateComponent=function(t,o,s){if(!s.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(s.quality=="draft"){var v=!0,L=!1,F=void 0;try{for(var A=o.nodeIndexes[Symbol.iterator](),b;!(v=(b=A.next()).done);v=!0){var k=b.value,U=l(k,2),K=U[0],D=U[1],it=s.cy.getElementById(K);if(it){var n=it.boundingBox(),m=o.xCoords[D]-n.w/2,p=o.xCoords[D]+n.w/2,E=o.yCoords[D]-n.h/2,y=o.yCoords[D]+n.h/2;mf&&(f=p),Eg&&(g=y)}}}catch(x){L=!0,F=x}finally{try{!v&&A.return&&A.return()}finally{if(L)throw F}}var I=t.x-(f+c)/2,w=t.y-(g+T)/2;o.xCoords=o.xCoords.map(function(x){return x+I}),o.yCoords=o.yCoords.map(function(x){return x+w})}else{Object.keys(o).forEach(function(x){var q=o[x],V=q.getRect().x,Y=q.getRect().x+q.getRect().width,et=q.getRect().y,z=q.getRect().y+q.getRect().height;Vf&&(f=Y),etg&&(g=z)});var R=t.x-(f+c)/2,W=t.y-(g+T)/2;Object.keys(o).forEach(function(x){var q=o[x];q.setCenter(q.getCenterX()+R,q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,o,s,c){for(var f=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,L=void 0,F=void 0,A=void 0,b=void 0,k=t.descendants().not(":parent"),U=k.length,K=0;KL&&(f=L),TA&&(g=A),v{var l=r(548),i=r(140).CoSELayout,u=r(140).CoSENode,t=r(140).layoutBase.PointD,o=r(140).layoutBase.DimensionD,s=r(140).layoutBase.LayoutConstants,c=r(140).layoutBase.FDLayoutConstants,f=r(140).CoSEConstants,T=function(v,L){var F=v.cy,A=v.eles,b=A.nodes(),k=A.edges(),U=void 0,K=void 0,D=void 0,it={};v.randomize&&(U=L.nodeIndexes,K=L.xCoords,D=L.yCoords);var n=function(x){return typeof x=="function"},m=function(x,q){return n(x)?x(q):x},p=l.calcParentsWithoutChildren(F,A),E=function W(x,q,V,Y){for(var et=q.length,z=0;z0){var Q=void 0;Q=V.getGraphManager().add(V.newGraph(),$),W(Q,H,V,Y)}}},y=function(x,q,V){for(var Y=0,et=0,z=0;z0?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/et:n(v.idealEdgeLength)?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,f.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,q){q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(x.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};v.nestingFactor!=null&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(f.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(f.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(f.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?s.QUALITY=2:s.QUALITY=0,f.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!v.randomize,f.ANIMATE=c.ANIMATE=s.ANIMATE=v.animate,f.TILE=v.tile,f.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!v.randomize,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1),v.step=="enforced"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1),v.step=="cose"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?f.TREE_REDUCTION_ON_INCREMENTAL=!1:f.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,R=w.newGraphManager();return E(R.addRoot(),l.getTopMostNodes(b),w,v),y(w,R,k),I(w,v),w.runLayout(),it};a.exports={coseLayout:T}}),212:((a,e,r)=>{var l=(function(){function v(L,F){for(var A=0;A0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(b,A.eles,I),D.forEach(function(vt){var rt=vt.boundingBox();it.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,U.push(s(A))}),A.quality=="default"||A.quality=="proof"){var w=b.collection();if(A.tile){var R=new Map,W=[],x=[],q=0,V={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,rt){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){w.merge(vt.nodes()[mt]),gt.isParent()||(V.nodeIndexes.set(vt.nodes()[mt].id(),q++),V.xCoords.push(vt.nodes()[0].position().x),V.yCoords.push(vt.nodes()[0].position().y))}),Y.push(rt))}),w.length>1){var et=w.boundingBox();it.push({x:et.x1+et.w/2,y:et.y1+et.h/2}),D.push(w),U.push(V);for(var z=Y.length-1;z>=0;z--)D.splice(Y[z],1),U.splice(Y[z],1),it.splice(Y[z],1)}}D.forEach(function(vt,rt){A.eles=vt,K.push(f(A,U[rt])),t.relocateComponent(it[rt],K[rt],A)})}else D.forEach(function(vt,rt){t.relocateComponent(it[rt],U[rt],A)});var O=new Set;if(D.length>1){var H=[],$=k.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,rt){var gt=void 0;if(A.quality=="draft"&&(gt=U[rt].nodeIndexes),vt.nodes().not($).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not($).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:U[rt].xCoords[At]-Ot.boundingbox().w/2,y:U[rt].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,U[rt].xCoords,U[rt].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else K[rt][Ot.id()]&&mt.nodes.push({x:K[rt][Ot.id()].getLeft(),y:K[rt][Ot.id()].getTop(),width:K[rt][Ot.id()].getWidth(),height:K[rt][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,U[rt].xCoords,U[rt].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[rt].xCoords[Rt]),Ut.push(U[rt].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[rt].xCoords,U[rt].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[rt].xCoords[Ht]),Pt.push(U[rt].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else K[rt][Et.id()]&&K[rt][Dt.id()]&&mt.edges.push({startX:K[rt][Et.id()].getCenterX(),startY:K[rt][Et.id()].getCenterY(),endX:K[rt][Dt.id()].getCenterX(),endY:K[rt][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(rt))}});var _=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")U.forEach(function(vt,rt){var gt=vt.xCoords.map(function(At){return At+_[rt].dx}),mt=vt.yCoords.map(function(At){return At+_[rt].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(K[vt]).forEach(function(rt){var gt=K[vt][rt];gt.setCenter(gt.getCenterX()+_[ht].dx,gt.getCenterY()+_[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(it.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=s(A);U.push(y)}A.quality=="default"||A.quality=="proof"?(K.push(f(A,U[0])),t.relocateComponent(it[0],K[0],A)):t.relocateComponent(it[0],U[0],A)}var Q=function(rt,gt){if(A.quality=="default"||A.quality=="proof"){typeof rt=="number"&&(rt=gt);var mt=void 0,At=void 0,Ot=rt.data("id");return K.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:rt.position("x"),y:rt.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(rt.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:rt.position("x"),y:rt.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(b,k),Nt=k.filter(function(vt){return vt.css("display")=="none"});A.eles=k.not(Nt),k.nodes().not(":parent").not(Nt).layoutPositions(F,A,Q),It.length>0&&It.forEach(function(vt){vt.position(Q(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v})();a.exports=g}),657:((a,e,r)=>{var l=r(548),i=r(140).layoutBase.Matrix,u=r(140).layoutBase.SVD,t=function(s){var c=s.cy,f=s.eles,T=f.nodes(),g=f.nodes(":parent"),v=new Map,L=new Map,F=new Map,A=[],b=[],k=[],U=[],K=[],D=[],it=[],n=[],m=void 0,p=1e8,E=1e-9,y=s.piTol,I=s.samplingType,w=s.nodeSeparation,R=void 0,W=function(){for(var P=0,B=0,J=!1;B=at;){nt=Z[at++];for(var xt=A[nt],lt=0;ltut&&(ut=K[Lt],Mt=Lt)}return Mt},q=function(P){var B=void 0;if(P){B=Math.floor(Math.random()*m);for(var Z=0;Z=1)break;j=tt}for(var pt=0;pt=1)break;j=tt}for(var lt=0;lt0&&(B.isParent()?A[P].push(F.get(B.id())):A[P].push(B.id()))})});var Nt=function(P){var B=L.get(P),J=void 0;v.get(P).forEach(function(Z){c.getElementById(Z).isParent()?J=F.get(Z):J=Z,A[B].push(J),A[L.get(J)].push(P)})},vt=!0,rt=!1,gt=void 0;try{for(var mt=v.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(S){rt=!0,gt=S}finally{try{!vt&&mt.return&&mt.return()}finally{if(rt)throw gt}}m=L.size;var Et=void 0;if(m>2){R=m{var l=r(212),i=function(t){t&&t("layout","fcose",l)};typeof cytoscape<"u"&&i(cytoscape),a.exports=i}),140:(a=>{a.exports=M})},N={};function d(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return G[a](r,r.exports,d),r.exports}var h=d(579);return h})()})})(se)),se.exports}var yr=pr();const Er=lr(yr);var De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,X)=>C-X+2,"L"),R:dt((C,X)=>C-2,"R"),T:dt((C,X)=>C-X+2,"T"),B:dt((C,X)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const X=C;return X==="L"||X==="R"||X==="T"||X==="B"},"isArchitectureDirection"),Wt=dt(function(C){const X=C;return X==="L"||X==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const X=C;return X==="T"||X==="B"},"isArchitectureDirectionY"),me=dt(function(C,X){const M=Wt(C)&&qt(X),G=qt(C)&&Wt(X);return M||G},"isArchitectureDirectionXY"),Tr=dt(function(C){const X=C[0],M=C[1],G=Wt(X)&&qt(M),N=qt(X)&&Wt(M);return G||N},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,X){const M=`${C}${X}`;return Nr(M)?M:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,X],M){const G=M[0],N=M[1];return Wt(G)?qt(N)?[C+(G==="L"?-1:1),X+(N==="T"?1:-1)]:[C+(G==="L"?-1:1),X]:Wt(N)?[C+(N==="L"?1:-1),X+(G==="T"?1:-1)]:[C,X+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,X){return me(C,X)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=dt(function(C){return C.type==="service"},"isArchitectureService"),wr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=er.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=ke,this.getAccTitle=qe,this.setDiagramTitle=Qe,this.getDiagramTitle=Je,this.getAccDescription=Ke,this.setAccDescription=je,this.clear()}static{dt(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},_e()}addService({id:C,icon:X,in:M,title:G,iconText:N}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(M!==void 0){if(C===M)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[M]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[M]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:X,iconText:N,title:G,edges:[],in:M}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:C,in:X}){this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:X}}getJunctions(){return Object.values(this.nodes).filter(wr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:X,in:M,title:G}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(M!==void 0){if(C===M)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[M]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[M]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:X,title:G,in:M}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:X,lhsDir:M,rhsDir:G,lhsInto:N,rhsInto:d,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(M))throw new Error(`Invalid direction given for left hand side of edge ${C}--${X}. Expected (L,R,T,B) got ${String(M)}`);if(!Ie(G))throw new Error(`Invalid direction given for right hand side of edge ${C}--${X}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[X]===void 0&&this.groups[X]===void 0)throw new Error(`The right-hand id [${X}] does not yet exist. Please create the service/group before declaring an edge to it.`);const r=this.nodes[C].in,l=this.nodes[X].in;if(h&&r&&l&&r==l)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&l&&r==l)throw new Error(`The right-hand id [${X}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const i={lhsId:C,lhsDir:M,lhsInto:N,lhsGroup:h,rhsId:X,rhsDir:G,rhsInto:d,rhsGroup:a,title:e};this.edges.push(i),this.nodes[C]&&this.nodes[X]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[X].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},X=Object.entries(this.nodes).reduce((a,[e,r])=>(a[e]=r.edges.reduce((l,i)=>{const u=this.getNode(i.lhsId)?.in,t=this.getNode(i.rhsId)?.in;if(u&&t&&u!==t){const o=Ar(i.lhsDir,i.rhsDir);o!=="bend"&&(C[u]??={},C[u][t]=o,C[t]??={},C[t][u]=o)}if(i.lhsId===e){const o=pe(i.lhsDir,i.rhsDir);o&&(l[o]=i.rhsId)}else{const o=pe(i.rhsDir,i.lhsDir);o&&(l[o]=i.lhsId)}return l},{}),a),{}),M=Object.keys(X)[0],G={[M]:1},N=Object.keys(X).reduce((a,e)=>e===M?a:{...a,[e]:1},{}),d=dt(a=>{const e={[a]:[0,0]},r=[a];for(;r.length>0;){const l=r.shift();if(l){G[l]=1,delete N[l];const i=X[l],[u,t]=e[l];Object.entries(i).forEach(([o,s])=>{G[s]||(e[s]=Lr([u,t],o),r.push(s))})}}return e},"BFS"),h=[d(M)];for(;Object.keys(N).length>0;)h.push(d(Object.keys(N)[0]));this.dataStructures={adjList:X,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,X){this.elements[C]=X}getElementById(C){return this.elements[C]}getConfig(){return tr({...Or,...rr().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,X)=>{sr(C,X),C.groups.map(M=>X.addGroup(M)),C.services.map(M=>X.addService({...M,type:"service"})),C.junctions.map(M=>X.addJunction({...M,type:"junction"})),C.edges.map(M=>X.addEdge(M))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const X=await hr("architecture",C);Re.debug(X);const M=Pe.parser?.yy;if(!(M instanceof be))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(X,M)},"parse")},xr=dt(C=>` - .edge { - stroke-width: ${C.archEdgeWidth}; - stroke: ${C.archEdgeColor}; - fill: none; - } - - .arrow { - fill: ${C.archEdgeArrowColor}; - } - - .node-bkg { - fill: none; - stroke: ${C.archGroupBorderColor}; - stroke-width: ${C.archGroupBorderWidth}; - stroke-dasharray: 8; - } - .node-icon-text { - display: flex; - align-items: center; - } - - .node-icon-text > div { - color: #fff; - margin: 1px; - height: fit-content; - text-align: center; - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - } -`,"getStyles"),Ir=xr,re=dt(C=>`${C}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:or,blank:{body:re("")}}},Rr=dt(async function(C,X,M){const G=M.getConfigField("padding"),N=M.getConfigField("iconSize"),d=N/2,h=N/6,a=h/2;await Promise.all(X.edges().map(async e=>{const{source:r,sourceDir:l,sourceArrow:i,sourceGroup:u,target:t,targetDir:o,targetArrow:s,targetGroup:c,label:f}=Fe(e);let{x:T,y:g}=e[0].sourceEndpoint();const{x:v,y:L}=e[0].midpoint();let{x:F,y:A}=e[0].targetEndpoint();const b=G+4;if(u&&(Wt(l)?T+=l==="L"?-b:b:g+=l==="T"?-b:b+18),c&&(Wt(o)?F+=o==="L"?-b:b:A+=o==="T"?-b:b+18),!u&&M.getNode(r)?.type==="junction"&&(Wt(l)?T+=l==="L"?d:-d:g+=l==="T"?d:-d),!c&&M.getNode(t)?.type==="junction"&&(Wt(o)?F+=o==="L"?d:-d:A+=o==="T"?d:-d),e[0]._private.rscratch){const k=C.insert("g");if(k.insert("path").attr("d",`M ${T},${g} L ${v},${L} L${F},${A} `).attr("class","edge").attr("id",ar(r,t,{prefix:"L"})),i){const U=Wt(l)?oe[l](T,h):T-a,K=qt(l)?oe[l](g,h):g-a;k.insert("polygon").attr("points",xe[l](h)).attr("transform",`translate(${U},${K})`).attr("class","arrow")}if(s){const U=Wt(o)?oe[o](F,h):F-a,K=qt(o)?oe[o](A,h):A-a;k.insert("polygon").attr("points",xe[o](h)).attr("transform",`translate(${U},${K})`).attr("class","arrow")}if(f){const U=me(l,o)?"XY":Wt(l)?"X":"Y";let K=0;U==="X"?K=Math.abs(T-F):U==="Y"?K=Math.abs(g-A)/1.5:K=Math.abs(T-F)/2;const D=k.append("g");if(await Ee(D,f,{useHtmlLabels:!1,width:K,classes:"architecture-service-label"},ye()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),U==="X")D.attr("transform","translate("+v+", "+L+")");else if(U==="Y")D.attr("transform","translate("+v+", "+L+") rotate(-90)");else if(U==="XY"){const it=pe(l,o);if(it&&Tr(it)){const n=D.node().getBoundingClientRect(),[m,p]=Cr(it);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*p*45})`);const E=D.node().getBoundingClientRect();D.attr("transform",` - translate(${v}, ${L-n.height/2}) - translate(${m*E.width/2}, ${p*E.height/2}) - rotate(${-1*m*p*45}, 0, ${n.height/2}) - `)}}}}}))},"drawEdges"),Sr=dt(async function(C,X,M){const N=M.getConfigField("padding")*.75,d=M.getConfigField("fontSize"),a=M.getConfigField("iconSize")/2;await Promise.all(X.nodes().map(async e=>{const r=ie(e);if(r.type==="group"){const{h:l,w:i,x1:u,y1:t}=e.boundingBox(),o=C.append("rect");o.attr("id",`group-${r.id}`).attr("x",u+a).attr("y",t+a).attr("width",i).attr("height",l).attr("class","node-bkg");const s=C.append("g");let c=u,f=t;if(r.icon){const T=s.append("g");T.html(`${await ve(r.icon,{height:N,width:N,fallbackPrefix:ae.prefix})}`),T.attr("transform","translate("+(c+a+1)+", "+(f+a+1)+")"),c+=N,f+=d/2-1-2}if(r.label){const T=s.append("g");await Ee(T,r.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},ye()),T.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),T.attr("transform","translate("+(c+a+4)+", "+(f+a+2)+")")}M.setElementForId(r.id,o)}}))},"drawGroups"),Fr=dt(async function(C,X,M){const G=ye();for(const N of M){const d=X.append("g"),h=C.getConfigField("iconSize");if(N.title){const l=d.append("g");await Ee(l,N.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},G),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),l.attr("transform","translate("+h/2+", "+h+")")}const a=d.append("g");if(N.icon)a.html(`${await ve(N.icon,{height:h,width:h,fallbackPrefix:ae.prefix})}`);else if(N.iconText){a.html(`${await ve("blank",{height:h,width:h,fallbackPrefix:ae.prefix})}`);const u=a.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(ir(N.iconText,G)),t=parseInt(window.getComputedStyle(u.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;u.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/t)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+N.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);d.attr("id",`service-${N.id}`).attr("class","architecture-service");const{width:e,height:r}=d.node().getBBox();N.width=e,N.height=r,C.setElementForId(N.id,d)}return 0},"drawServices"),br=dt(function(C,X,M){M.forEach(G=>{const N=X.append("g"),d=C.getConfigField("iconSize");N.append("g").append("rect").attr("id","node-"+G.id).attr("fill-opacity","0").attr("width",d).attr("height",d),N.attr("class","architecture-junction");const{width:a,height:e}=N._groups[0][0].getBBox();N.width=a,N.height=e,C.setElementForId(G.id,N)})},"drawJunctions");nr([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,X,M){C.forEach(G=>{X.add({group:"nodes",data:{type:"service",id:G.id,icon:G.icon,label:G.title,parent:G.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,X,M){C.forEach(G=>{X.add({group:"nodes",data:{type:"junction",id:G.id,parent:G.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,X){X.nodes().map(M=>{const G=ie(M);if(G.type==="group")return;G.x=M.position().x,G.y=M.position().y,C.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,X){C.forEach(M=>{X.add({group:"nodes",data:{type:"group",id:M.id,icon:M.icon,label:M.title,parent:M.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,X){C.forEach(M=>{const{lhsId:G,rhsId:N,lhsInto:d,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:r,rhsGroup:l,title:i}=M,u=me(M.lhsDir,M.rhsDir)?"segments":"straight",t={id:`${G}-${N}`,label:i,source:G,sourceDir:e,sourceArrow:d,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:N,targetDir:r,targetArrow:a,targetGroup:l,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};X.add({group:"edges",data:t,classes:u})})}dt(He,"addEdges");function We(C,X,M){const G=dt((a,e)=>Object.entries(a).reduce((r,[l,i])=>{let u=0;const t=Object.entries(i);if(t.length===1)return r[l]=t[0][1],r;for(let o=0;o{const e={},r={};return Object.entries(a).forEach(([l,[i,u]])=>{const t=C.getNode(l)?.in??"default";e[u]??={},e[u][t]??=[],e[u][t].push(l),r[i]??={},r[i][t]??=[],r[i][t].push(l)}),{horiz:Object.values(G(e,"horizontal")).filter(l=>l.length>1),vert:Object.values(G(r,"vertical")).filter(l=>l.length>1)}}),[d,h]=N.reduce(([a,e],{horiz:r,vert:l})=>[[...a,...r],[...e,...l]],[[],[]]);return{horizontal:d,vertical:h}}dt(We,"getAlignments");function Ve(C,X){const M=[],G=dt(d=>`${d[0]},${d[1]}`,"posToStr"),N=dt(d=>d.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(d=>{const h=Object.fromEntries(Object.entries(d).map(([l,i])=>[G(i),l])),a=[G([0,0])],e={},r={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const l=a.shift();if(l){e[l]=1;const i=h[l];if(i){const u=N(l);Object.entries(r).forEach(([t,o])=>{const s=G([u[0]+o[0],u[1]+o[1]]),c=h[s];c&&!e[s]&&(a.push(s),M.push({[De[t]]:c,[De[mr(t)]]:i,gap:1.5*X.getConfigField("iconSize")}))})}}}}),M}dt(Ve,"getRelativeConstraints");function ze(C,X,M,G,N,{spatialMaps:d,groupAlignments:h}){return new Promise(a=>{const e=fr("body").append("div").attr("id","cy").attr("style","display:none"),r=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(M,r),Ge(C,r,N),Ue(X,r,N),He(G,r);const l=We(N,d,h),i=Ve(d,N),u=r.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?1.5*N.getConfigField("iconSize"):.5*N.getConfigField("iconSize")},edgeElasticity(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?.45:.001},alignmentConstraint:l,relativePlacementConstraint:i});u.one("layoutstop",()=>{function t(o,s,c,f){let T,g;const{x:v,y:L}=o,{x:F,y:A}=s;g=(f-L+(v-c)*(L-A)/(v-F))/Math.sqrt(1+Math.pow((L-A)/(v-F),2)),T=Math.sqrt(Math.pow(f-L,2)+Math.pow(c-v,2)-Math.pow(g,2));const b=Math.sqrt(Math.pow(F-v,2)+Math.pow(A-L,2));T=T/b;let k=(F-v)*(f-L)-(A-L)*(c-v);switch(!0){case k>=0:k=1;break;case k<0:k=-1;break}let U=(F-v)*(c-v)+(A-L)*(f-L);switch(!0){case U>=0:U=1;break;case U<0:U=-1;break}return g=Math.abs(g)*k,T=T*U,{distances:g,weights:T}}dt(t,"getSegmentWeights"),r.startBatch();for(const o of Object.values(r.edges()))if(o.data?.()){const{x:s,y:c}=o.source().position(),{x:f,y:T}=o.target().position();if(s!==f&&c!==T){const g=o.sourceEndpoint(),v=o.targetEndpoint(),{sourceDir:L}=Fe(o),[F,A]=qt(L)?[g.x,v.y]:[v.x,g.y],{weights:b,distances:k}=t(g,v,F,A);o.style("segment-distances",k),o.style("segment-weights",b)}}r.endBatch(),u.run()}),u.run(),r.ready(t=>{Re.info("Ready",t),a(r)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,X,M,G)=>{const N=G.db,d=N.getServices(),h=N.getJunctions(),a=N.getGroups(),e=N.getEdges(),r=N.getDataStructures(),l=Be(X),i=l.append("g");i.attr("class","architecture-edges");const u=l.append("g");u.attr("class","architecture-services");const t=l.append("g");t.attr("class","architecture-groups"),await Fr(N,u,d),br(N,u,h);const o=await ze(d,h,a,e,N,r);await Rr(i,o,N),await Sr(t,o,N),Ye(N,o),Ze(void 0,l,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},qr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{qr as diagram}; diff --git a/assets/assetContainer-X8dc1NDD.js b/assets/assetContainer-X8dc1NDD.js deleted file mode 100644 index 99a9376074abcdf6b4f4bf39503d4a8095813088..0000000000000000000000000000000000000000 --- a/assets/assetContainer-X8dc1NDD.js +++ /dev/null @@ -1 +0,0 @@ -import{bg as B,d as b,L as y,J as N,bh as A,M as k,c as O,at as P,l as x,R as V,aq as D,aI as C,b1 as L,bi as w}from"./index-GY9JDBGV.js";x._instancedMeshFactory=(u,e)=>{const t=new T(u,e);if(e.instancedBuffers){t.instancedBuffers={};for(const s in e.instancedBuffers)t.instancedBuffers[s]=e.instancedBuffers[s]}return t};class T extends B{constructor(e,t){super(e,t.getScene()),this._indexInSourceMeshInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const s of t.getAnimationRanges())s!=null&&this.createAnimationRange(s.name,s.from,s.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),!t.skeleton&&!t.morphTargetManager&&t.hasBoundingInfo){const s=t.getBoundingInfo();this.buildBoundingInfo(s.minimum,s.maximum)}else this.refreshBoundingInfo(!0,!0);this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){this._sourceMesh?.receiveShadows!==e&&b.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){this._sourceMesh?.material!==e&&b.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){this._sourceMesh?.visibility!==e&&b.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){this._sourceMesh?.skeleton!==e&&b.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||y.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}get geometry(){return this._sourceMesh._geometry}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,s){return this._sourceMesh.getVerticesData(e,t,s)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._sourceMesh.getVertexBuffer(e,t)}setVerticesData(e,t,s,n){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,s,n),this.sourceMesh}updateVerticesData(e,t,s,n){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,s,n),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let s;typeof e=="object"?s=e:s={applySkeleton:e,applyMorph:t};const n=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(s,null,N.PositionKind),n),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||y.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==A.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new k);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,O.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(O.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const s=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,s.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e{this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{for(const t of this.geometries)t._rebuild();for(const t of this.meshes)t._rebuild();for(const t of this.particleSystems)t.rebuild();for(const t of this.textures)t._rebuild()}))}_topologicalSort(e){const t=new Map;for(const c of e)t.set(c.uniqueId,c);const s={dependsOn:new Map,dependedBy:new Map};for(const c of e){const o=c.uniqueId;s.dependsOn.set(o,new Set),s.dependedBy.set(o,new Set)}for(const c of e){const o=c.uniqueId,a=s.dependsOn.get(o);if(c instanceof T){const g=c.sourceMesh;t.has(g.uniqueId)&&(a.add(g.uniqueId),s.dependedBy.get(g.uniqueId).add(o))}const _=s.dependedBy.get(o);for(const g of c.getDescendants()){const I=g.uniqueId;t.has(I)&&(_.add(I),s.dependsOn.get(I).add(o))}}const n=[],r=[];for(const c of e){const o=c.uniqueId;s.dependsOn.get(o).size===0&&(r.push(c),t.delete(o))}const l=r;for(;l.length>0;){const c=l.shift();n.push(c);const o=s.dependedBy.get(c.uniqueId);for(const a of Array.from(o.values())){const _=s.dependsOn.get(a);_.delete(c.uniqueId),_.size===0&&t.get(a)&&(l.push(t.get(a)),t.delete(a))}}return t.size>0&&(y.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(c=>{y.Error(c.name)})),n}_addNodeAndDescendantsToList(e,t,s,n){if(!(!s||n&&!n(s)||t.has(s.uniqueId))){e.push(s),t.add(s.uniqueId);for(const r of s.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,r,n)}}_isNodeInContainer(e){return e instanceof B&&this.meshes.indexOf(e)!==-1||e instanceof A&&this.transformNodes.indexOf(e)!==-1||e instanceof C&&this.lights.indexOf(e)!==-1||e instanceof L&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return y.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return y.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return y.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return y.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;return!0}instantiateModelsToScene(e,t=!1,s){this._isValidHierarchy()||b.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const n={},r={},l=new G,c=[],o=[],a={doNotInstantiate:!0,...s},_=(i,h)=>{if(n[i.uniqueId]=h.uniqueId,r[h.uniqueId]=h,e&&(h.name=e(i.name)),h instanceof x){const d=h;if(d.morphTargetManager){const m=i.morphTargetManager;d.morphTargetManager=m.clone();for(let p=0;p{if(_(i,h),i.parent){const d=n[i.parent.uniqueId],m=r[d];m?h.parent=m:h.parent=i.parent}if(h.position&&i.position&&h.position.copyFrom(i.position),h.rotationQuaternion&&i.rotationQuaternion&&h.rotationQuaternion.copyFrom(i.rotationQuaternion),h.rotation&&i.rotation&&h.rotation.copyFrom(i.rotation),h.scaling&&i.scaling&&h.scaling.copyFrom(i.scaling),h.material){const d=h;if(d.material)if(t){const m=i.material;if(o.indexOf(m)===-1){let p=m.clone(e?e(m.name):"Clone of "+m.name);if(o.push(m),n[m.uniqueId]=p.uniqueId,r[p.uniqueId]=p,m.getClassName()==="MultiMaterial"){const v=m;for(const M of v.subMaterials)M&&(p=M.clone(e?e(M.name):"Clone of "+M.name),o.push(M),n[M.uniqueId]=p.uniqueId,r[p.uniqueId]=p);v.subMaterials=v.subMaterials.map(M=>M&&r[n[M.uniqueId]])}}d.getClassName()!=="InstancedMesh"&&(d.material=r[n[m.uniqueId]])}else d.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(d.material)===-1&&this.scene.addMultiMaterial(d.material):this.scene.materials.indexOf(d.material)===-1&&this.scene.addMaterial(d.material)}h.parent===null&&l.rootNodes.push(h)};for(const i of S)if(i.getClassName()==="InstancedMesh"){const h=i,d=h.sourceMesh,m=n[d.uniqueId],v=(typeof m=="number"?r[m]:d).createInstance(h.name);f(h,v)}else{let h=!0;i.getClassName()==="TransformNode"||i.getClassName()==="Node"||i.skeleton||!i.getTotalVertices||i.getTotalVertices()===0?h=!1:a.doNotInstantiate&&(typeof a.doNotInstantiate=="function"?h=!a.doNotInstantiate(i):h=!a.doNotInstantiate);const d=h?i.createInstance(`instance of ${i.name}`):i.clone(`Clone of ${i.name}`,null,!0);if(!d)throw new Error(`Could not clone or instantiate node on Asset Container ${i.name}`);f(i,d)}for(const i of this.skeletons){if(a.predicate&&!a.predicate(i))continue;const h=i.clone(e?e(i.name):"Clone of "+i.name);for(const d of this.meshes)if(d.skeleton===i&&!d.isAnInstance){const m=r[n[d.uniqueId]];if(!m||m.isAnInstance||(m.skeleton=h,c.indexOf(h)!==-1))continue;c.push(h);for(const p of h.bones)p._linkedTransformNode&&(p._linkedTransformNode=r[n[p._linkedTransformNode.uniqueId]])}l.skeletons.push(h)}for(const i of this.animationGroups){if(a.predicate&&!a.predicate(i))continue;const h=i.clone(e?e(i.name):"Clone of "+i.name,d=>r[n[d.uniqueId]]||d);l.animationGroups.push(h)}return l}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||b.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){const t=[];for(const s of this.cameras)e&&!e(s)||(this.scene.addCamera(s),t.push(s));for(const s of this.lights)e&&!e(s)||(this.scene.addLight(s),t.push(s));for(const s of this.meshes)e&&!e(s)||(this.scene.addMesh(s),t.push(s));for(const s of this.skeletons)e&&!e(s)||this.scene.addSkeleton(s);for(const s of this.animations)e&&!e(s)||this.scene.addAnimation(s);for(const s of this.animationGroups)e&&!e(s)||this.scene.addAnimationGroup(s);for(const s of this.multiMaterials)e&&!e(s)||this.scene.addMultiMaterial(s);for(const s of this.materials)e&&!e(s)||this.scene.addMaterial(s);for(const s of this.morphTargetManagers)e&&!e(s)||this.scene.addMorphTargetManager(s);for(const s of this.geometries)e&&!e(s)||this.scene.addGeometry(s);for(const s of this.transformNodes)e&&!e(s)||(this.scene.addTransformNode(s),t.push(s));for(const s of this.actionManagers)e&&!e(s)||this.scene.addActionManager(s);for(const s of this.textures)e&&!e(s)||this.scene.addTexture(s);for(const s of this.reflectionProbes)e&&!e(s)||this.scene.addReflectionProbe(s);if(t.length){const s=new Set(this.scene.meshes);for(const n of this.scene.lights)s.add(n);for(const n of this.scene.cameras)s.add(n);for(const n of this.scene.transformNodes)s.add(n);for(const n of this.skeletons)for(const r of n.bones)s.add(r);for(const n of t)n.parent&&!s.has(n.parent)&&(n.setParent?n.setParent(null):n.parent=null)}}removeAllFromScene(){this._isValidHierarchy()||b.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){for(const t of this.cameras)e&&!e(t)||this.scene.removeCamera(t);for(const t of this.lights)e&&!e(t)||this.scene.removeLight(t);for(const t of this.meshes)e&&!e(t)||this.scene.removeMesh(t,!0);for(const t of this.skeletons)e&&!e(t)||this.scene.removeSkeleton(t);for(const t of this.animations)e&&!e(t)||this.scene.removeAnimation(t);for(const t of this.animationGroups)e&&!e(t)||this.scene.removeAnimationGroup(t);for(const t of this.multiMaterials)e&&!e(t)||this.scene.removeMultiMaterial(t);for(const t of this.materials)e&&!e(t)||this.scene.removeMaterial(t);for(const t of this.morphTargetManagers)e&&!e(t)||this.scene.removeMorphTargetManager(t);for(const t of this.geometries)e&&!e(t)||this.scene.removeGeometry(t);for(const t of this.transformNodes)e&&!e(t)||this.scene.removeTransformNode(t);for(const t of this.actionManagers)e&&!e(t)||this.scene.removeActionManager(t);for(const t of this.textures)e&&!e(t)||this.scene.removeTexture(t);for(const t of this.reflectionProbes)e&&!e(t)||this.scene.removeReflectionProbe(t)}dispose(){const e=this.cameras.slice(0);for(const f of e)f.dispose();this.cameras.length=0;const t=this.lights.slice(0);for(const f of t)f.dispose();this.lights.length=0;const s=this.meshes.slice(0);for(const f of s)f.dispose();this.meshes.length=0;const n=this.skeletons.slice(0);for(const f of n)f.dispose();this.skeletons.length=0;const r=this.animationGroups.slice(0);for(const f of r)f.dispose();this.animationGroups.length=0;const l=this.multiMaterials.slice(0);for(const f of l)f.dispose();this.multiMaterials.length=0;const c=this.materials.slice(0);for(const f of c)f.dispose();this.materials.length=0;const o=this.geometries.slice(0);for(const f of o)f.dispose();this.geometries.length=0;const a=this.transformNodes.slice(0);for(const f of a)f.dispose();this.transformNodes.length=0;const _=this.actionManagers.slice(0);for(const f of _)f.dispose();this.actionManagers.length=0;const g=this.textures.slice(0);for(const f of g)f.dispose();this.textures.length=0;const I=this.reflectionProbes.slice(0);for(const f of I)f.dispose();this.reflectionProbes.length=0;const S=this.morphTargetManagers.slice(0);for(const f of S)f.dispose();this.morphTargetManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const f of this.scene._serializableComponents)f.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,s){if(!(!e||!t))for(const n of e){let r=!0;if(s){for(const l of s)if(n===l){r=!1;break}}r&&(t.push(n),n._parentContainer=this)}}moveAllFromScene(e){this._wasAddedToScene=!1,e===void 0&&(e=new q);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||(t==="_environmentTexture"?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){const e=new x("assetContainerRootMesh",this.scene);for(const t of this.meshes)t.parent||e.addChild(t);return this.meshes.unshift(e),e}mergeAnimationsTo(e=D.LastCreatedScene,t,s=null){if(!e)return y.Error("No scene available to merge animations to"),[];const n=s||(o=>{let a=null;const _=o.animations.length?o.animations[0].targetProperty:"",g=o.name.split(".").join("").split("_primitive")[0];switch(_){case"position":case"rotationQuaternion":a=e.getTransformNodeByName(o.name)||e.getTransformNodeByName(g);break;case"influence":a=e.getMorphTargetByName(o.name)||e.getMorphTargetByName(g);break;default:a=e.getNodeByName(o.name)||e.getNodeByName(g)}return a}),r=this.getNodes();for(const o of r){const a=n(o);if(a!==null){for(const _ of o.animations){const g=a.animations.filter(I=>I.targetProperty===_.targetProperty);for(const I of g){const S=a.animations.indexOf(I,0);S>-1&&a.animations.splice(S,1)}}a.animations=a.animations.concat(o.animations)}}const l=[],c=this.animationGroups.slice();for(const o of c){l.push(o.clone(o.name,n));for(const a of o.animatables)a.stop()}for(const o of t){const a=n(o.target);a&&(e.beginAnimation(a,o.fromFrame,o.toFrame,o.loopAnimation,o.speedRatio,o.onAnimationEnd?o.onAnimationEnd:void 0,void 0,!0,void 0,o.onAnimationLoop?o.onAnimationLoop:void 0),e.stopAnimation(o.target))}return l}populateRootNodes(){this.rootNodes.length=0;for(const e of this.meshes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.transformNodes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.lights)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.cameras)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}addAllAssetsToContainer(e){if(!e)return;const t=[],s=new Set;for(t.push(e);t.length>0;){const n=t.pop();if(n instanceof x?(n.geometry&&this.geometries.indexOf(n.geometry)===-1&&this.geometries.push(n.geometry),this.meshes.push(n)):n instanceof T?this.meshes.push(n):n instanceof A?this.transformNodes.push(n):n instanceof C?this.lights.push(n):n instanceof L&&this.cameras.push(n),n instanceof B){if(n.material&&this.materials.indexOf(n.material)===-1){this.materials.push(n.material);for(const r of n.material.getActiveTextures())this.textures.indexOf(r)===-1&&this.textures.push(r)}n.skeleton&&this.skeletons.indexOf(n.skeleton)===-1&&this.skeletons.push(n.skeleton),n.morphTargetManager&&this.morphTargetManagers.indexOf(n.morphTargetManager)===-1&&this.morphTargetManagers.push(n.morphTargetManager)}for(const r of n.getChildren())s.has(r)||t.push(r);s.add(n)}this.populateRootNodes()}_getByTags(e,t,s){if(t===void 0)return e;const n=[];for(const r in e){const l=e[r];w&&w.MatchesQuery(l,t)&&(!s||s(l))&&n.push(l)}return n}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialsByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}}export{F as A}; diff --git a/assets/audioEngine-D1fuR8_P.js b/assets/audioEngine-D1fuR8_P.js deleted file mode 100644 index 30cb60ac3bb5ef5b0052e5ba9182fe87fa3b05a0..0000000000000000000000000000000000000000 --- a/assets/audioEngine-D1fuR8_P.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./webAudioBus-Q_viYsTX.js","./abstractAudioBus-BwRA3WE-.js","./webAudioBaseSubGraph-CgvRUdPi.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./spatialWebAudio-D-sfHE2Z.js","./webAudioMainBus-C6O3d5Ad.js","./webAudioStaticSound-BEsC4sEN.js","./abstractSoundInstance-Bnv14BnJ.js","./abstractSoundSource-Dkzp9Tp9.js","./webAudioSoundSource-3sgwHR9P.js","./webAudioStreamingSound-C_Kgt28o.js"])))=>i.map(i=>d[i]); -import{af as l}from"./index-DydPgVMC.js";import{O as h,V as o,ao as _,L as v,by as R,M as N,aq as E,A as P}from"./index-GY9JDBGV.js";var y;(function(n){n[n.HAS_INPUTS=1]="HAS_INPUTS",n[n.HAS_OUTPUTS=2]="HAS_OUTPUTS",n[n.HAS_INPUTS_AND_OUTPUTS=3]="HAS_INPUTS_AND_OUTPUTS"})(y||(y={}));class T{constructor(t,e){this.onDisposeObservable=new h,this.engine=t,e&1&&(this._upstreamNodes=new Set),e&2&&(this._downstreamNodes=new Set)}dispose(){if(this._downstreamNodes){for(const t of Array.from(this._downstreamNodes))if(!this._disconnect(t))throw new Error("Disconnect failed");this._downstreamNodes.clear()}if(this._upstreamNodes){for(const t of Array.from(this._upstreamNodes))if(!t._disconnect(this))throw new Error("Disconnect failed");this._upstreamNodes.clear()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}_connect(t){return!this._downstreamNodes||this._downstreamNodes.has(t)||!t._onConnect(this)?!1:(this._downstreamNodes.add(t),!0)}_disconnect(t){return!this._downstreamNodes||!this._downstreamNodes.delete(t)?!1:t._onDisconnect(this)}_onConnect(t){return!this._upstreamNodes||this._upstreamNodes.has(t)?!1:(this._upstreamNodes.add(t),!0)}_onDisconnect(t){return this._upstreamNodes?.delete(t)??!1}}class K extends T{constructor(t,e,i){super(e,i),this.onNameChangedObservable=new h,this._name=t}get name(){return this._name}set name(t){if(this._name===t)return;const e=this._name;this._name=t,this.onNameChangedObservable.notifyObservers({newName:t,oldName:e,node:this})}dispose(){super.dispose(),this.onNameChangedObservable.clear()}}class C{constructor(t){this._attachmentType=3,this._position=new o,this._rotationQuaternion=new _,this._sceneNode=null,this._useBoundingBox=!1,this.dispose=()=>{this.detach()},this._spatialAudioNode=t}get isAttached(){return this._sceneNode!==null}attach(t,e,i){this._sceneNode!==t&&(this.detach(),t&&(this._attachmentType=i,this._sceneNode=t,this._sceneNode.onDisposeObservable.add(this.dispose),this._useBoundingBox=e))}detach(){this._sceneNode?.onDisposeObservable.removeCallback(this.dispose),this._sceneNode=null}update(){this._attachmentType&1&&(this._useBoundingBox&&this._sceneNode.getBoundingInfo?this._position.copyFrom(this._sceneNode.getBoundingInfo().boundingBox.centerWorld):this._sceneNode?.getWorldMatrix().getTranslationToRef(this._position),this._spatialAudioNode.position.copyFrom(this._position),this._spatialAudioNode._updatePosition()),this._attachmentType&2&&(this._sceneNode?.getWorldMatrix().decompose(void 0,this._rotationQuaternion),this._spatialAudioNode.rotationQuaternion.copyFrom(this._rotationQuaternion),this._spatialAudioNode._updateRotation())}}const tt=new RegExp("\\.(\\w{3,4})($|\\?)"),d=100,A=new Float32Array([0,0]);let m=null,c=null,p=null;function I(){if(!c){c=new Float32Array(d);const n=1/(d-1);let t=n;for(let e=1;e{if(!this._autoUpdate)return;let a=!1;if(0{this._button&&(this._engine.state==="running"?this._hide():this._show())},this._engine=t;const i=e||E.LastCreatedEngine?.getInputElement()?.parentElement||document.body,s=(i?.offsetTop||0)+20;this._style=document.createElement("style"),this._style.appendChild(document.createTextNode(`.babylonUnmute{position:absolute;top:${s}px;margin-left:20px;height:40px;width:60px;background-color:rgba(51,51,51,0.7);background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");background-size:80%;background-repeat:no-repeat;background-position:center;background-position-y:4px;border:none;outline:none;transition:transform 0.125s ease-out;cursor:pointer;z-index:9999;}.babylonUnmute:hover{transform:scale(1.05)}`)),document.head.appendChild(this._style),this._button=document.createElement("button"),this._button.className="babylonUnmute",this._button.id="babylonUnmuteButton",this._button.addEventListener("click",()=>{this._engine.unlockAsync()}),i.appendChild(this._button),this._engine.stateChangedObservable.add(this._onStateChanged)}dispose(){this._button?.remove(),this._button=null,this._style?.remove(),this._style=null,this._engine.stateChangedObservable.removeCallback(this._onStateChanged)}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?this._engine.state!=="running"&&this._show():this._hide()}_show(){!this._button||!this._enabled||(this._button.style.display="block")}_hide(){this._button&&(this._button.style.display="none")}}const H={aac:"audio/aac",ac3:"audio/ac3",flac:"audio/flac",m4a:"audio/mp4",mp3:'audio/mpeg; codecs="mp3"',mp4:"audio/mp4",ogg:'audio/ogg; codecs="vorbis"',wav:"audio/wav",webm:'audio/webm; codecs="vorbis"'};class q extends k{constructor(t={}){super(t),this._audioContextStarted=!1,this._destinationNode=null,this._invalidFormats=new Set,this._isUpdating=!1,this._listener=null,this._listenerAutoUpdate=!0,this._listenerMinUpdateTime=0,this._pauseCalled=!1,this._resumeOnInteraction=!0,this._resumeOnPause=!0,this._resumeOnPauseRetryInterval=1e3,this._resumeOnPauseTimerId=null,this._resumePromise=null,this._silentHtmlAudio=null,this._unmuteUI=null,this._updateObservable=null,this._validFormats=new Set,this._volume=1,this._isUsingOfflineAudioContext=!1,this.isReadyPromise=new Promise(e=>{this._resolveIsReadyPromise=e}),this.stateChangedObservable=new h,this.userGestureObservable=new h,this._initAudioContextAsync=async()=>{this._audioContext.addEventListener("statechange",this._onAudioContextStateChange),this._mainOut=new Y(this),this._mainOut.volume=this._volume,await this.createMainBusAsync("default")},this._onAudioContextStateChange=()=>{this.state==="running"&&(clearInterval(this._resumeOnPauseTimerId),this._audioContextStarted=!0,this._resumePromise=null),(this.state==="suspended"||this.state==="interrupted")&&this._audioContextStarted&&this._resumeOnPause&&!this._pauseCalled&&(clearInterval(this._resumeOnPauseTimerId),this._resumeOnPauseTimerId=setInterval(()=>{this.resumeAsync()},this._resumeOnPauseRetryInterval)),this.stateChangedObservable.notifyObservers(this.state)},this._onUserGestureAsync=async()=>{if(this._resumeOnInteraction&&await this._audioContext.resume(),!this._silentHtmlAudio){this._silentHtmlAudio=document.createElement("audio");const e=this._silentHtmlAudio;e.controls=!1,e.preload="auto",e.loop=!0,e.src="data:audio/wav;base64,UklGRjAAAABXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAAZGF0YQwAAAAAAAEA/v8CAP//AQA=",e.play()}this.userGestureObservable.notifyObservers()},this._startUpdating=()=>{if(!this._isUpdating)if(this._isUpdating=!0,this.state==="running")this._update();else{const e=()=>{this.state==="running"&&(this._update(),this.stateChangedObservable.removeCallback(e))};this.stateChangedObservable.add(e)}},this._update=()=>{this._updateObservable?.hasObservers()?(this._updateObservable.notifyObservers(),requestAnimationFrame(this._update)):this._isUpdating=!1},typeof t.listenerAutoUpdate=="boolean"&&(this._listenerAutoUpdate=t.listenerAutoUpdate),typeof t.listenerMinUpdateTime=="number"&&(this._listenerMinUpdateTime=t.listenerMinUpdateTime),this._volume=t.volume??1,t.audioContext?(this._isUsingOfflineAudioContext=t.audioContext instanceof OfflineAudioContext,this._audioContext=t.audioContext):this._audioContext=new AudioContext,t.disableDefaultUI||(this._unmuteUI=new z(this,t.defaultUIParentElement))}async _initAsync(t){this._resumeOnInteraction=typeof t.resumeOnInteraction=="boolean"?t.resumeOnInteraction:!0,this._resumeOnPause=typeof t.resumeOnPause=="boolean"?t.resumeOnPause:!0,this._resumeOnPauseRetryInterval=t.resumeOnPauseRetryInterval??1e3,document.addEventListener("click",this._onUserGestureAsync),await this._initAudioContextAsync(),W(t)&&(this._listener=x(this,this._listenerAutoUpdate,this._listenerMinUpdateTime),this._listener.setOptions(t)),this._resolveIsReadyPromise()}get currentTime(){return this._audioContext.currentTime??0}get _inNode(){return this._audioContext.destination}get mainOut(){return this._mainOut}get listener(){return this._listener??(this._listener=x(this,this._listenerAutoUpdate,this._listenerMinUpdateTime))}get state(){return this._isUsingOfflineAudioContext?"running":this._audioContext.state}get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,this._mainOut&&(this._mainOut.volume=t))}get _audioDestination(){return this._destinationNode?this._destinationNode:this._destinationNode=this._audioContext.destination}set _audioDestination(t){this._destinationNode=t}get _unmuteUIEnabled(){return this._unmuteUI?this._unmuteUI.enabled:!1}set _unmuteUIEnabled(t){this._unmuteUI&&(this._unmuteUI.enabled=t)}async createBusAsync(t,e={}){const i=await l(()=>import("./webAudioBus-Q_viYsTX.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),s=new i._WebAudioBus(t,this,e);return await s._initAsync(e),s}async createMainBusAsync(t,e={}){const i=await l(()=>import("./webAudioMainBus-C6O3d5Ad.js"),__vite__mapDeps([7,1,2,3,4,5]),import.meta.url),s=new i._WebAudioMainBus(t,this);return await s._initAsync(e),s}async createMicrophoneSoundSourceAsync(t,e){let i;try{i=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(s){throw new Error("Unable to access microphone: "+s)}return await this.createSoundSourceAsync(t,new MediaStreamAudioSourceNode(this._audioContext,{mediaStream:i}),{outBusAutoDefault:!1,...e})}async createSoundAsync(t,e,i={}){const s=await l(()=>import("./webAudioStaticSound-BEsC4sEN.js"),__vite__mapDeps([8,9,3,4,5,10,2,6]),import.meta.url),a=new s._WebAudioStaticSound(t,this,i);return await a._initAsync(e,i),a}async createSoundBufferAsync(t,e={}){const i=await l(()=>import("./webAudioStaticSound-BEsC4sEN.js"),__vite__mapDeps([8,9,3,4,5,10,2,6]),import.meta.url),s=new i._WebAudioStaticSoundBuffer(this);return await s._initAsync(t,e),s}async createSoundSourceAsync(t,e,i={}){const s=await l(()=>import("./webAudioSoundSource-3sgwHR9P.js"),__vite__mapDeps([11,10,2,3,4,5,6]),import.meta.url),a=new s._WebAudioSoundSource(t,e,this,i);return await a._initAsync(i),a}async createStreamingSoundAsync(t,e,i={}){const s=await l(()=>import("./webAudioStreamingSound-C_Kgt28o.js"),__vite__mapDeps([12,3,4,5,9,10,2,6]),import.meta.url),a=new s._WebAudioStreamingSound(t,this,i);return await a._initAsync(e,i),a}dispose(){super.dispose(),this._listener?.dispose(),this._listener=null,this._audioContext.state!=="closed"&&!this._isUsingOfflineAudioContext&&this._audioContext.close(),document.removeEventListener("click",this._onUserGestureAsync),this._audioContext.removeEventListener("statechange",this._onAudioContextStateChange),this._silentHtmlAudio?.remove(),this._updateObservable?.clear(),this._updateObservable=null,this._unmuteUI?.dispose(),this._unmuteUI=null,this.stateChangedObservable.clear()}flagInvalidFormat(t){this._invalidFormats.add(t)}isFormatValid(t){if(this._validFormats.has(t))return!0;if(this._invalidFormats.has(t))return!1;const e=H[t];return e===void 0?!1:new Audio().canPlayType(e)===""?(this._invalidFormats.add(t),!1):(this._validFormats.add(t),!0)}async pauseAsync(){await this._audioContext.suspend(),this._pauseCalled=!0}resumeAsync(){return this._pauseCalled=!1,this._resumePromise?this._resumePromise:(this._resumePromise=this._audioContext.resume(),this.stateChangedObservable.notifyObservers(this.state),this._resumePromise)}setVolume(t,e=null){if(this._mainOut)this._mainOut.setVolume(t,e);else throw new Error("Main output not initialized yet.")}_addMainBus(t){super._addMainBus(t)}_removeMainBus(t){super._removeMainBus(t)}_addNode(t){super._addNode(t)}_removeNode(t){super._removeNode(t)}_addSound(t){super._addSound(t)}_removeSound(t){super._removeSound(t)}_addUpdateObserver(t){this._updateObservable||(this._updateObservable=new h),this._updateObservable.add(t),this._startUpdating()}_removeUpdateObserver(t){this._updateObservable&&this._updateObservable.removeCallback(t)}}P.AudioEngineFactory=(n,t,e)=>new $(n,t,e);class ${get masterGain(){return this._masterGain}set masterGain(t){this._masterGain=this._v2.mainOut._inNode=t}get useCustomUnlockedButton(){return this._useCustomUnlockedButton}set useCustomUnlockedButton(t){this._useCustomUnlockedButton=t,this._v2._unmuteUIEnabled=!t}get audioContext(){return this._v2.state==="running"&&this._triggerRunningStateAsync(),this._v2._audioContext}constructor(t=null,e=null,i=null){this._tryToRun=!1,this._useCustomUnlockedButton=!1,this.canUseWebAudio=!0,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.onAudioUnlockedObservable=new h,this.onAudioLockedObservable=new h;const s=new q({audioContext:e||void 0,defaultUIParentElement:t?.parentElement?t.parentElement:void 0});s._unmuteUIEnabled=!1,this._masterGain=new GainNode(s._audioContext),s._audioDestination=i,s.stateChangedObservable.add(a=>{a==="running"?(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)):(this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this))}),s._initAsync({resumeOnInteraction:!1}).then(()=>{const a=s.defaultMainBus._outNode;a&&(a.disconnect(s.mainOut._inNode),a.connect(this._masterGain)),s.mainOut._inNode=this._masterGain,s.stateChangedObservable.notifyObservers(s.state)}),this.isMP3supported=s.isFormatValid("mp3"),this.isOGGsupported=s.isFormatValid("ogg"),this._v2=s}lock(){this._v2._audioContext.suspend(),this._useCustomUnlockedButton||(this._v2._unmuteUIEnabled=!0)}unlock(){if(this._v2._audioContext?.state==="running"){this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this));return}this._triggerRunningStateAsync()}_resumeAudioContextOnStateChange(){this._v2._audioContext?.addEventListener("statechange",()=>{this.unlocked&&this._v2._audioContext?.state!=="running"&&this._resumeAudioContextAsync()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContextAsync(){return this._v2._isUsingOfflineAudioContext?Promise.resolve():(this._v2._audioContext.state==="suspended"&&!this._useCustomUnlockedButton&&(this._v2._unmuteUIEnabled=!0),this._v2._audioContext.resume())}dispose(){this._v2.dispose(),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){return this.masterGain.gain.value}setGlobalVolume(t){this.masterGain.gain.value=t}connectToAnalyser(t){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=t,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._v2._audioContext.destination)}async _triggerRunningStateAsync(){if(this._tryToRun){this._v2._audioContext.resume();return}this._tryToRun=!0,await this._resumeAudioContextAsync(),this._tryToRun=!1,this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)}}export{T as A,et as _,tt as a,u as b,C as c,V as d,K as e}; diff --git a/assets/background.fragment-BRWQc8fp.js b/assets/background.fragment-BRWQc8fp.js deleted file mode 100644 index c19e93c0edc334073c3f1013800fc28c0ad06ae4..0000000000000000000000000000000000000000 --- a/assets/background.fragment-BRWQc8fp.js +++ /dev/null @@ -1,237 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./backgroundUboDeclaration-C0OM7ptD.js";import"./helperFunctions-tBt4f_K3.js";import"./shadowsFragmentFunctions-dMCKkVlT.js";import"./imageProcessingFunctions-BwYIAaLN.js";import"./lightsFragmentFunctions-BfknEtlf.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./fogFragment-M_o52SDz.js";import"./lightFragment-CZjYZOQF.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";const i="backgroundFragmentDeclaration",f=`uniform vec4 vEyePosition;uniform vec4 vPrimaryColor; -#ifdef USEHIGHLIGHTANDSHADOWCOLORS -uniform vec4 vPrimaryColorShadow; -#endif -uniform float shadowLevel;uniform float alpha; -#ifdef DIFFUSE -uniform vec2 vDiffuseInfos; -#endif -#ifdef REFLECTION -uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos; -#endif -#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL) -uniform vec3 vBackgroundCenter; -#endif -#ifdef REFLECTIONFRESNEL -uniform vec4 vReflectionControl; -#endif -#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) -uniform mat4 view; -#endif -#ifdef PROJECTED_GROUND -uniform vec2 projectedGroundInfos; -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=f);const r="intersectionFunctions",l=`float diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; } -vec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q) -#include -varying vec3 vPositionW; -#ifdef MAINUV1 -varying vec2 vMainUV1; -#endif -#ifdef MAINUV2 -varying vec2 vMainUV2; -#endif -#ifdef NORMAL -varying vec3 vNormalW; -#endif -#ifdef DIFFUSE -#if DIFFUSEDIRECTUV==1 -#define vDiffuseUV vMainUV1 -#elif DIFFUSEDIRECTUV==2 -#define vDiffuseUV vMainUV2 -#else -varying vec2 vDiffuseUV; -#endif -uniform sampler2D diffuseSampler; -#endif -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -#define sampleReflection(s,c) textureCube(s,c) -uniform samplerCube reflectionSampler; -#ifdef TEXTURELODSUPPORT -#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l) -#else -uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh; -#endif -#else -#define sampleReflection(s,c) texture2D(s,c) -uniform sampler2D reflectionSampler; -#ifdef TEXTURELODSUPPORT -#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l) -#else -uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#endif -#include -#endif -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE; -#endif -#ifndef SHADOWONLY -#define SHADOWONLY; -#endif -#include -#include<__decl__lightFragment>[0..maxSimultaneousLights] -#include -#include -#include -#ifdef LOGARITHMICDEPTH -#extension GL_EXT_frag_depth : enable -#endif -#include -#include -#include -#ifdef REFLECTIONFRESNEL -#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 -vec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness) -{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));} -#endif -#ifdef PROJECTED_GROUND -#include -vec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersectFromOrigin(eyePosition,camDir,radius).x;vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersectFromOrigin(eyePosition,p,radius).x;vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;} -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); -#ifdef NORMAL -vec3 normalW=normalize(vNormalW); -#else -vec3 normalW=vec3(0.0,1.0,0.0); -#endif -float shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.; -#include[0..maxSimultaneousLights] -#ifdef SHADOWINUSE -globalShadow/=shadowLightCount; -#else -globalShadow=1.0; -#endif -#ifndef BACKMAT_SHADOWONLY -vec4 reflectionColor=vec4(1.,1.,1.,1.); -#ifdef REFLECTION -#ifdef PROJECTED_GROUND -vec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.)); -#else -vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW); -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -vec3 reflectionCoords=reflectionVector; -#else -vec2 reflectionCoords=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0-reflectionCoords.y; -#endif -#ifdef REFLECTIONBLUR -float reflectionLOD=vReflectionInfos.y; -#ifdef TEXTURELODSUPPORT -reflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD); -#else -float lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix( -sampleReflection(reflectionSamplerHigh,reflectionCoords), -reflectionSpecularMid, -lodReflectionNormalizedDoubled -);} else {reflectionColor=mix( -reflectionSpecularMid, -sampleReflection(reflectionSamplerLow,reflectionCoords), -lodReflectionNormalizedDoubled-1.0 -);} -#endif -#else -vec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample; -#endif -#ifdef RGBDREFLECTION -reflectionColor.rgb=fromRGBD(reflectionColor); -#endif -#ifdef GAMMAREFLECTION -reflectionColor.rgb=toLinearSpace(reflectionColor.rgb); -#endif -#ifdef REFLECTIONBGR -reflectionColor.rgb=reflectionColor.bgr; -#endif -reflectionColor.rgb*=vReflectionInfos.x; -#endif -vec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha; -#ifdef DIFFUSE -vec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV); -#ifdef GAMMADIFFUSE -diffuseMap.rgb=toLinearSpace(diffuseMap.rgb); -#endif -diffuseMap.rgb*=vDiffuseInfos.y; -#ifdef DIFFUSEHASALPHA -finalAlpha*=diffuseMap.a; -#endif -diffuseColor=diffuseMap.rgb; -#endif -#ifdef REFLECTIONFRESNEL -vec3 colorBase=diffuseColor; -#else -vec3 colorBase=reflectionColor.rgb*diffuseColor; -#endif -colorBase=max(colorBase,0.0); -#ifdef USERGBCOLOR -vec3 finalColor=colorBase; -#else -#ifdef USEHIGHLIGHTANDSHADOWCOLORS -vec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase); -#else -vec3 mainColor=vPrimaryColor.rgb; -#endif -vec3 finalColor=colorBase*mainColor; -#endif -#ifdef REFLECTIONFRESNEL -vec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel; -#ifdef REFLECTIONFALLOFF -float reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff; -#endif -finalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount)); -#endif -#ifdef OPACITYFRESNEL -float viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor; -#endif -#ifdef SHADOWINUSE -finalColor=mix(finalColor*shadowLevel,finalColor,globalShadow); -#endif -vec4 color=vec4(finalColor,finalAlpha); -#else -vec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha); -#endif -#include -#include -#ifdef IMAGEPROCESSINGPOSTPROCESS -#if !defined(SKIPFINALCOLORCLAMP) -color.rgb=clamp(color.rgb,0.,30.0); -#endif -#else -color=applyImageProcessing(color); -#endif -#ifdef PREMULTIPLYALPHA -color.rgb*=color.a; -#endif -#ifdef NOISE -color.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0); -#endif -gl_FragColor=color; -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStore[o]||(e.ShadersStore[o]=n);const p={name:o,shader:n};export{p as backgroundPixelShader}; diff --git a/assets/background.fragment-DRaBFk7O.js b/assets/background.fragment-DRaBFk7O.js deleted file mode 100644 index fea89afc094a6e7d915320a7cd9a693e5bc3afd4..0000000000000000000000000000000000000000 --- a/assets/background.fragment-DRaBFk7O.js +++ /dev/null @@ -1,204 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./backgroundUboDeclaration-DLt8IcTD.js";import"./helperFunctions-Wgh3PIP0.js";import"./shadowsFragmentFunctions-CHKo52s6.js";import"./imageProcessingFunctions-DMSN1d-p.js";import"./lightsFragmentFunctions-BGx5-0G-.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./fogFragment-DjadYfQv.js";import"./lightFragment-Jwj6l9Y8.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";const o="intersectionFunctions",i=`fn diskIntersectWithBackFaceCulling(ro: vec3f,rd: vec3f,c: vec3f,r: f32)->f32 {var d: f32=rd.y;if(d>0.0) { return 1e6; } -var o: vec3f=ro-c;var t: f32=-o.y/d;var q: vec3f=o+rd*t;return select(1e6,t,(dot(q,q)vec2f {var oc: vec3f=ro-ce;var b: f32=dot(oc,rd);var c: f32=dot(oc,oc)-ra*ra;var h: f32=b*b-c;if(h<0.0) { return vec2f(-1.,-1.); } -h=sqrt(h);return vec2f(-b+h,-b-h);} -fn sphereIntersectFromOrigin(ro: vec3f,rd: vec3f,ra: f32)->vec2f {var b: f32=dot(ro,rd);var c: f32=dot(ro,ro)-ra*ra;var h: f32=b*b-c;if(h<0.0) { return vec2f(-1.,-1.); } -h=sqrt(h);return vec2f(-b+h,-b-h);}`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=i);const r="backgroundPixelShader",f=`#include -#include -varying vPositionW: vec3f; -#ifdef MAINUV1 -varying vMainUV1: vec2f; -#endif -#ifdef MAINUV2 -varying vMainUV2: vec2f; -#endif -#ifdef NORMAL -varying vNormalW: vec3f; -#endif -#ifdef DIFFUSE -#if DIFFUSEDIRECTUV==1 -#define vDiffuseUV vMainUV1 -#elif DIFFUSEDIRECTUV==2 -#define vDiffuseUV vMainUV2 -#else -varying vDiffuseUV: vec2f; -#endif -var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d; -#endif -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube; -#ifdef TEXTURELODSUPPORT -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube; -#endif -#else -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d; -#ifdef TEXTURELODSUPPORT -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#endif -#include -#endif -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE; -#endif -#ifndef SHADOWONLY -#define SHADOWONLY; -#endif -#include -#include[0..maxSimultaneousLights] -#include -#include -#include -#include -#include -#include -#ifdef REFLECTIONFRESNEL -#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 -fn fresnelSchlickEnvironmentGGX(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f -{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));} -#endif -#ifdef PROJECTED_GROUND -#include -fn project(viewDirectionW: vec3f,eyePosition: vec3f)->vec3f {var radius: f32=uniforms.projectedGroundInfos.x;var height: f32=uniforms.projectedGroundInfos.y;var camDir: vec3f=-viewDirectionW;var skySphereDistance: f32=sphereIntersectFromOrigin(eyePosition,camDir,radius).x;var skySpherePositionW: vec3f=eyePosition+camDir*skySphereDistance;var p: vec3f=normalize(skySpherePositionW);var upEyePosition=vec3f(eyePosition.x,eyePosition.y-height,eyePosition.z);var sIntersection: f32=sphereIntersectFromOrigin(upEyePosition,p,radius).x;var h: vec3f= vec3f(0.0,-height,0.0);var dIntersection: f32=diskIntersectWithBackFaceCulling(upEyePosition,p,h,radius);p=(upEyePosition+min(sIntersection,dIntersection)*p);return p;} -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW); -#ifdef NORMAL -var normalW: vec3f=normalize(fragmentInputs.vNormalW); -#else -var normalW: vec3f= vec3f(0.0,1.0,0.0); -#endif -var shadow: f32=1.;var globalShadow: f32=0.;var shadowLightCount: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.; -#include[0..maxSimultaneousLights] -#ifdef SHADOWINUSE -globalShadow/=shadowLightCount; -#else -globalShadow=1.0; -#endif -#ifndef BACKMAT_SHADOWONLY -var reflectionColor: vec4f= vec4f(1.,1.,1.,1.); -#ifdef REFLECTION -#ifdef PROJECTED_GROUND -var reflectionVector: vec3f=project(viewDirectionW,scene.vEyePosition.xyz);reflectionVector= (uniforms.reflectionMatrix*vec4f(reflectionVector,1.)).xyz; -#else -var reflectionVector: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW); -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -var reflectionCoords: vec3f=reflectionVector; -#else -var reflectionCoords: vec2f=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0-reflectionCoords.y; -#endif -#ifdef REFLECTIONBLUR -var reflectionLOD: f32=uniforms.vReflectionInfos.y; -#ifdef TEXTURELODSUPPORT -reflectionLOD=reflectionLOD*log2(uniforms.vReflectionMicrosurfaceInfos.x)*uniforms.vReflectionMicrosurfaceInfos.y+uniforms.vReflectionMicrosurfaceInfos.z;reflectionColor=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD); -#else -var lodReflectionNormalized: f32=saturate(reflectionLOD);var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var reflectionSpecularMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix( -textureSample(reflectionrHighSampler,reflectionrHighSamplerSampler,reflectionCoords), -reflectionSpecularMid, -lodReflectionNormalizedDoubled -);} else {reflectionColor=mix( -reflectionSpecularMid, -textureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords), -lodReflectionNormalizedDoubled-1.0 -);} -#endif -#else -var reflectionSample: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);reflectionColor=reflectionSample; -#endif -#ifdef RGBDREFLECTION -reflectionColor=vec4f(fromRGBD(reflectionColor).rgb,reflectionColor.a); -#endif -#ifdef GAMMAREFLECTION -reflectionColor=vec4f(toLinearSpaceVec3(reflectionColor.rgb),reflectionColor.a); -#endif -#ifdef REFLECTIONBGR -reflectionColor=vec4f(reflectionColor.bgr,reflectionColor.a); -#endif -reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a); -#endif -var diffuseColor: vec3f= vec3f(1.,1.,1.);var finalAlpha: f32=uniforms.alpha; -#ifdef DIFFUSE -var diffuseMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,input.vDiffuseUV); -#ifdef GAMMADIFFUSE -diffuseMap=vec4f(toLinearSpaceVec3(diffuseMap.rgb),diffuseMap.a); -#endif -diffuseMap=vec4f(diffuseMap.rgb *uniforms.vDiffuseInfos.y,diffuseMap.a); -#ifdef DIFFUSEHASALPHA -finalAlpha*=diffuseMap.a; -#endif -diffuseColor=diffuseMap.rgb; -#endif -#ifdef REFLECTIONFRESNEL -var colorBase: vec3f=diffuseColor; -#else -var colorBase: vec3f=reflectionColor.rgb*diffuseColor; -#endif -colorBase=max(colorBase,vec3f(0.0)); -#ifdef USERGBCOLOR -var finalColor: vec3f=colorBase; -#else -#ifdef USEHIGHLIGHTANDSHADOWCOLORS -var mainColor: vec3f=mix(uniforms.vPrimaryColorShadow.rgb,uniforms.vPrimaryColor.rgb,colorBase); -#else -var mainColor: vec3f=uniforms.vPrimaryColor.rgb; -#endif -var finalColor: vec3f=colorBase*mainColor; -#endif -#ifdef REFLECTIONFRESNEL -var reflectionAmount: vec3f=uniforms.vReflectionControl.xxx;var reflectionReflectance0: vec3f=uniforms.vReflectionControl.yyy;var reflectionReflectance90: vec3f=uniforms.vReflectionControl.zzz;var VdotN: f32=dot(normalize(scene.vEyePosition.xyz),normalW);var planarReflectionFresnel: vec3f=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel; -#ifdef REFLECTIONFALLOFF -var reflectionDistanceFalloff: f32=1.0-saturate(length(vPositionW.xyz-uniforms.vBackgroundCenter)*uniforms.vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff; -#endif -finalColor=mix(finalColor,reflectionColor.rgb,saturateVec3(reflectionAmount)); -#endif -#ifdef OPACITYFRESNEL -var viewAngleToFloor: f32=dot(normalW,normalize(scene.vEyePosition.xyz-uniforms.vBackgroundCenter));const startAngle: f32=0.1;var fadeFactor: f32=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor; -#endif -#ifdef SHADOWINUSE -finalColor=mix(finalColor*uniforms.shadowLevel,finalColor,globalShadow); -#endif -var color: vec4f= vec4f(finalColor,finalAlpha); -#else -var color: vec4f= vec4f(uniforms.vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*uniforms.alpha); -#endif -#include -#include -#ifdef IMAGEPROCESSINGPOSTPROCESS -#if !defined(SKIPFINALCOLORCLAMP) -color=vec4f(clamp(color.rgb,vec3f(0.),vec3f(30.0)),color.a); -#endif -#else -color=applyImageProcessing(color); -#endif -#ifdef PREMULTIPLYALPHA -color=vec4f(color.rgb *color.a,color.a); -#endif -#ifdef NOISE -color=vec4f(color.rgb+dither(fragmentInputs.vPositionW.xy,0.5),color.a);color=max(color,vec4f(0.0)); -#endif -fragmentOutputs.color=color; -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=f);const E={name:r,shader:f};export{E as backgroundPixelShaderWGSL}; diff --git a/assets/background.vertex-B2aEBa4o.js b/assets/background.vertex-B2aEBa4o.js deleted file mode 100644 index d5a0ece54ef619a903641a3b4e7c3b3d5c99dae0..0000000000000000000000000000000000000000 --- a/assets/background.vertex-B2aEBa4o.js +++ /dev/null @@ -1,112 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./backgroundUboDeclaration-C0OM7ptD.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./logDepthVertex-zXeqwUWs.js";import"./shadowsVertex-w5DW1avO.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";const n="backgroundVertexDeclaration",f=`uniform mat4 view;uniform mat4 viewProjection; -#ifdef MULTIVIEW -uniform mat4 viewProjectionR; -#endif -uniform float shadowLevel; -#ifdef DIFFUSE -uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; -#endif -#ifdef REFLECTION -uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier; -#endif -#ifdef POINTSIZE -uniform float pointSize; -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=f);const i="backgroundVertexShader",o=`precision highp float; -#include<__decl__backgroundVertex> -#include -attribute vec3 position; -#ifdef NORMAL -attribute vec3 normal; -#endif -#include -#include -#include -varying vec3 vPositionW; -#ifdef NORMAL -varying vec3 vNormalW; -#endif -#ifdef UV1 -attribute vec2 uv; -#endif -#ifdef UV2 -attribute vec2 uv2; -#endif -#ifdef MAINUV1 -varying vec2 vMainUV1; -#endif -#ifdef MAINUV2 -varying vec2 vMainUV2; -#endif -#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0 -varying vec2 vDiffuseUV; -#endif -#include -#include -#include<__decl__lightVxFragment>[0..maxSimultaneousLights] -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -#ifdef REFLECTIONMAP_SKYBOX -vPositionUVW=position; -#endif -#include -#include -#include -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);} -#else -gl_Position=viewProjection*finalWorld*vec4(position,1.0); -#endif -vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos); -#ifdef NORMAL -mat3 normalWorld=mat3(finalWorld); -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vNormalW=normalize(normalWorld*normal); -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vDirectionW=normalize(vec3(finalWorld*vec4(position,0.0))); -#ifdef EQUIRECTANGULAR_RELFECTION_FOV -mat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));} -#endif -#endif -#ifndef UV1 -vec2 uv=vec2(0.,0.); -#endif -#ifndef UV2 -vec2 uv2=vec2(0.,0.); -#endif -#ifdef MAINUV1 -vMainUV1=uv; -#endif -#ifdef MAINUV2 -vMainUV2=uv2; -#endif -#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0 -if (vDiffuseInfos.x==0.) -{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} -else -{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} -#endif -#include -#include -#include[0..maxSimultaneousLights] -#ifdef VERTEXCOLOR -vColor=colorUpdated; -#endif -#if defined(POINTSIZE) && !defined(WEBGPU) -gl_PointSize=pointSize; -#endif -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=o);const I={name:i,shader:o};export{I as backgroundVertexShader}; diff --git a/assets/background.vertex-DMWJ0ykJ.js b/assets/background.vertex-DMWJ0ykJ.js deleted file mode 100644 index d375fb6d3157a3cccadf1571edf7381c4fa8ad32..0000000000000000000000000000000000000000 --- a/assets/background.vertex-DMWJ0ykJ.js +++ /dev/null @@ -1,99 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./backgroundUboDeclaration-DLt8IcTD.js";import"./helperFunctions-Wgh3PIP0.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./instancesDeclaration-ConO0l1b.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./logDepthVertex-CfHieHf5.js";import"./shadowsVertex-DKtacRyL.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";const e="backgroundVertexShader",t=`#include -#include -attribute position: vec3f; -#ifdef NORMAL -attribute normal: vec3f; -#endif -#include -#include -#include -varying vPositionW: vec3f; -#ifdef NORMAL -varying vNormalW: vec3f; -#endif -#ifdef UV1 -attribute uv: vec2f; -#endif -#ifdef UV2 -attribute uv2: vec2f; -#endif -#ifdef MAINUV1 -varying vMainUV1: vec2f; -#endif -#ifdef MAINUV2 -varying vMainUV2: vec2f; -#endif -#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0 -varying vDiffuseUV: vec2f; -#endif -#include -#include -#include[0..maxSimultaneousLights] -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -#ifdef REFLECTIONMAP_SKYBOX -vertexOutputs.vPositionUVW=input.position; -#endif -#include -#include -#include -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0);} else {vertexOutputs.position=scene.viewProjectionR*finalWorld* vec4f(input.position,1.0);} -#else -vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0); -#endif -var worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.vPositionW= worldPos.xyz; -#ifdef NORMAL -var normalWorld: mat3x3f=mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz); -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vertexOutputs.vNormalW=normalize(normalWorld*input.normal); -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(input.position,0.0)).xyz); -#ifdef EQUIRECTANGULAR_RELFECTION_FOV -var screenToWorld: mat3x3f=inverseMat3( mat3x3f(finalWorld*scene.viewProjection));var segment: vec3f=mix(vertexOutputs.vDirectionW,screenToWorld* vec3f(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vertexOutputs.vDirectionW=normalize(segment);} else {vertexOutputs.vDirectionW=normalize(vertexOutputs.vDirectionW+(vertexOutputs.vDirectionW-segment));} -#endif -#endif -#ifndef UV1 -var uv: vec2f=vec2f(0.,0.); -#else -var uv=input.uv; -#endif -#ifndef UV2 -var uv2: vec2f=vec2f(0.,0.); -#else -var uv2=input.uv2; -#endif -#ifdef MAINUV1 -vertexOutputs.vMainUV1=uv; -#endif -#ifdef MAINUV2 -vertexOutputs.vMainUV2=uv2; -#endif -#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0 -if (uniforms.vDiffuseInfos.x==0.) -{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;} -else -{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;} -#endif -#include -#include -#include[0..maxSimultaneousLights] -#ifdef VERTEXCOLOR -vertexOutputs.vColor=vertexInputs.color; -#endif -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;i.ShadersStoreWGSL[e]||(i.ShadersStoreWGSL[e]=t);const m={name:e,shader:t};export{m as backgroundVertexShaderWGSL}; diff --git a/assets/backgroundUboDeclaration-C0OM7ptD.js b/assets/backgroundUboDeclaration-C0OM7ptD.js deleted file mode 100644 index 3f49dc9d9644ffc43e063aef3be48997bd3053a0..0000000000000000000000000000000000000000 --- a/assets/backgroundUboDeclaration-C0OM7ptD.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-3A3jW23h.js";const r="backgroundUboDeclaration",e=`layout(std140,column_major) uniform;uniform Material -{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform mat4 diffuseMatrix;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;}; -#include -`;o.IncludesShadersStore[r]||(o.IncludesShadersStore[r]=e); diff --git a/assets/backgroundUboDeclaration-DLt8IcTD.js b/assets/backgroundUboDeclaration-DLt8IcTD.js deleted file mode 100644 index dc390de09e3200fa256370e0ec50dcaa236749f7..0000000000000000000000000000000000000000 --- a/assets/backgroundUboDeclaration-DLt8IcTD.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-mnAEeY6M.js";const f="backgroundUboDeclaration",r=`uniform vPrimaryColor: vec4f;uniform vPrimaryColorShadow: vec4f;uniform vDiffuseInfos : vec2f;uniform diffuseMatrix : mat4x4f;uniform fFovMultiplier: f32;uniform pointSize: f32;uniform shadowLevel: f32;uniform alpha: f32;uniform vBackgroundCenter: vec3f;uniform vReflectionControl: vec4f;uniform projectedGroundInfos: vec2f;uniform vReflectionInfos : vec2f;uniform reflectionMatrix : mat4x4f;uniform vReflectionMicrosurfaceInfos : vec3f; -#include -`;o.IncludesShadersStoreWGSL[f]||(o.IncludesShadersStoreWGSL[f]=r); diff --git a/assets/bakedVertexAnimation-Bs9it648.js b/assets/bakedVertexAnimation-Bs9it648.js deleted file mode 100644 index 1951b616bc2fa540196354ae8e395407ce7e6c49..0000000000000000000000000000000000000000 --- a/assets/bakedVertexAnimation-Bs9it648.js +++ /dev/null @@ -1,32 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="bakedVertexAnimation",r=`#ifdef BAKED_VERTEX_ANIMATION_TEXTURE -{ -#ifdef INSTANCES -let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w; -#else -let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w; -#endif -let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3]; -#endif -finalWorld=finalWorld*VATInfluence;} -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=r); diff --git a/assets/bakedVertexAnimation-CaTOZtWZ.js b/assets/bakedVertexAnimation-CaTOZtWZ.js deleted file mode 100644 index d697ea49d2e07f6b5fe0540191ec8c99e9d9a5e1..0000000000000000000000000000000000000000 --- a/assets/bakedVertexAnimation-CaTOZtWZ.js +++ /dev/null @@ -1,133 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="bonesDeclaration",m=`#if NUM_BONE_INFLUENCERS>0 -attribute vec4 matricesIndices;attribute vec4 matricesWeights; -#if NUM_BONE_INFLUENCERS>4 -attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra; -#endif -#ifndef BAKED_VERTEX_ANIMATION_TEXTURE -#ifdef BONETEXTURE -uniform highp sampler2D boneSampler;uniform float boneTextureWidth; -#else -uniform mat4 mBones[BonesPerMesh]; -#endif -#ifdef BONES_VELOCITY_ENABLED -uniform mat4 mPreviousBones[BonesPerMesh]; -#endif -#ifdef BONETEXTURE -#define inline -mat4 readMatrixFromRawSampler(sampler2D smp,float index) -{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);} -#endif -#endif -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=m);const r="bakedVertexAnimationDeclaration",d=`#ifdef BAKED_VERTEX_ANIMATION_TEXTURE -uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture; -#ifdef INSTANCES -attribute vec4 bakedVertexAnimationSettingsInstanced; -#endif -#define inline -mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame) -{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);} -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=d);const a="instancesVertex",f=`#ifdef INSTANCES -mat4 finalWorld=mat4(world0,world1,world2,world3); -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1, -previousWorld2,previousWorld3); -#endif -#ifdef THIN_INSTANCES -finalWorld=world*finalWorld; -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -finalPreviousWorld=previousWorld*finalPreviousWorld; -#endif -#endif -#else -mat4 finalWorld=world; -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -mat4 finalPreviousWorld=previousWorld; -#endif -#endif -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=f);const t="bonesVertex",s=`#ifndef BAKED_VERTEX_ANIMATION_TEXTURE -#if NUM_BONE_INFLUENCERS>0 -mat4 influence; -#ifdef BONETEXTURE -influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3]; -#endif -#else -influence=mBones[int(matricesIndices[0])]*matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -influence+=mBones[int(matricesIndices[1])]*matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -influence+=mBones[int(matricesIndices[2])]*matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -influence+=mBones[int(matricesIndices[3])]*matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3]; -#endif -#endif -finalWorld=finalWorld*influence; -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=s);const n="bakedVertexAnimation",o=`#ifdef BAKED_VERTEX_ANIMATION_TEXTURE -{ -#ifdef INSTANCES -#define BVASNAME bakedVertexAnimationSettingsInstanced -#else -#define BVASNAME bakedVertexAnimationSettings -#endif -float VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3]; -#endif -finalWorld=finalWorld*VATInfluence;} -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=o); diff --git a/assets/basisTextureLoader-BWMwkKgk.js b/assets/basisTextureLoader-BWMwkKgk.js deleted file mode 100644 index 3ad4d5b1c846cb50a33323792b270baccc2f52d3..0000000000000000000000000000000000000000 --- a/assets/basisTextureLoader-BWMwkKgk.js +++ /dev/null @@ -1 +0,0 @@ -import{d as h,I as R,T as U}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";function D(){const e={cTFETC1:0,cTFETC2:1,cTFBC1:2,cTFBC3:3,cTFBC7:6,cTFPVRTC1_4_RGB:8,cTFPVRTC1_4_RGBA:9,cTFASTC_4x4:10,cTFRGB565:14};let n=null;onmessage=t=>{if(t.data.action==="init"){if(t.data.url)try{importScripts(t.data.url)}catch(o){postMessage({action:"error",error:o})}n||(n=BASIS({wasmBinary:t.data.wasmBinary})),n!==null&&n.then(o=>{BASIS=o,o.initializeBasis(),postMessage({action:"init"})})}else if(t.data.action==="transcode"){const o=t.data.config,a=t.data.imageData,f=new BASIS.BasisFile(a),r=l(f);let d=t.data.ignoreSupportedFormats?null:s(t.data.config,r),p=!1;d===null&&(p=!0,d=r.hasAlpha?e.cTFBC3:e.cTFBC1);let g=!0;f.startTranscoding()||(g=!1);const T=[];for(let m=0;m>2&3],d[y++]=r[u>>4&3],d[y++]=r[u>>6&3]}}return d}}async function W(e,n,s){return await new Promise((l,i)=>{const c=t=>{t.data.action==="init"?(e.removeEventListener("message",c),l(e)):t.data.action==="error"&&i(t.data.error||"error initializing worker")};e.addEventListener("message",c),e.postMessage({action:"init",url:s?h.GetBabylonScriptURL(s):void 0,wasmBinary:n},[n])})}var C;(function(e){e[e.cTFETC1=0]="cTFETC1",e[e.cTFETC2=1]="cTFETC2",e[e.cTFBC1=2]="cTFBC1",e[e.cTFBC3=3]="cTFBC3",e[e.cTFBC4=4]="cTFBC4",e[e.cTFBC5=5]="cTFBC5",e[e.cTFBC7=6]="cTFBC7",e[e.cTFPVRTC1_4_RGB=8]="cTFPVRTC1_4_RGB",e[e.cTFPVRTC1_4_RGBA=9]="cTFPVRTC1_4_RGBA",e[e.cTFASTC_4x4=10]="cTFASTC_4x4",e[e.cTFATC_RGB=11]="cTFATC_RGB",e[e.cTFATC_RGBA_INTERPOLATED_ALPHA=12]="cTFATC_RGBA_INTERPOLATED_ALPHA",e[e.cTFRGBA32=13]="cTFRGBA32",e[e.cTFRGB565=14]="cTFRGB565",e[e.cTFBGR565=15]="cTFBGR565",e[e.cTFRGBA4444=16]="cTFRGBA4444",e[e.cTFFXT1_RGB=17]="cTFFXT1_RGB",e[e.cTFPVRTC2_4_RGB=18]="cTFPVRTC2_4_RGB",e[e.cTFPVRTC2_4_RGBA=19]="cTFPVRTC2_4_RGBA",e[e.cTFETC2_EAC_R11=20]="cTFETC2_EAC_R11",e[e.cTFETC2_EAC_RG11=21]="cTFETC2_EAC_RG11"})(C||(C={}));const b={JSModuleURL:`${h._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`,WasmModuleURL:`${h._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm`},V=(e,n)=>{let s;switch(e){case C.cTFETC1:s=36196;break;case C.cTFBC1:s=33776;break;case C.cTFBC4:s=33779;break;case C.cTFASTC_4x4:s=37808;break;case C.cTFETC2:s=37496;break;case C.cTFBC7:s=36492;break}if(s===void 0)throw"The chosen Basis transcoder format is not currently supported";return s};let G=null,L=null,k=0;const H=!1,x=async()=>(G||(G=new Promise((e,n)=>{L?e(L):h.LoadFileAsync(h.GetBabylonScriptURL(b.WasmModuleURL)).then(s=>{if(typeof URL!="function")return n("Basis transcoder requires an environment with a URL constructor");const l=URL.createObjectURL(new Blob([`(${D})()`],{type:"application/javascript"}));L=new Worker(l),W(L,s,b.JSModuleURL).then(e,n)}).catch(n)})),await G),_=async(e,n)=>{const s=e instanceof ArrayBuffer?new Uint8Array(e):e;return await new Promise((l,i)=>{x().then(()=>{const c=k++,t=a=>{a.data.action==="transcode"&&a.data.id===c&&(L.removeEventListener("message",t),a.data.success?l(a.data):i("Transcode is not supported on this device"))};L.addEventListener("message",t);const o=new Uint8Array(s.byteLength);o.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),L.postMessage({action:"transcode",id:c,imageData:o,config:n,ignoreSupportedFormats:H},[o.buffer])},c=>{i(c)})})},E=(e,n)=>{let s=n._gl?.TEXTURE_2D;e.isCube&&(s=n._gl?.TEXTURE_CUBE_MAP),n._bindTextureDirectly(s,e,!0)},P=(e,n)=>{const s=e.getEngine();for(let l=0;l{s._releaseTexture(c),E(e,s)})}else e._invertVScale=!e.invertY,e.width=i.width+3&-4,e.height=i.height+3&-4,e.samplingMode=2,E(e,s),s._uploadDataToTextureDirectly(e,new Uint16Array(i.transcodedPixels.buffer),l,0,4,!0);else{e.width=i.width,e.height=i.height,e.generateMipMaps=n.fileInfo.images[l].levels.length>1;const c=v.GetInternalFormatFromBasisFormat(n.format,s);e.format=c,E(e,s);const t=n.fileInfo.images[l].levels;for(let o=0;o{const f=a.fileInfo.images[0].levels.length>1&&s.generateMipMaps;P(s,a),s.getEngine()._setCubeMapTextureParams(s,f),s.isReady=!0,s.onLoadedObservable.notifyObservers(s),s.onLoadedObservable.clear(),i&&i()}).catch(a=>{h.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),s.isReady=!0,c&&c(a)})}loadData(n,s,l){const i=s.getEngine().getCaps(),c={supportedCompressionFormats:{etc1:!!i.etc1,s3tc:!!i.s3tc,pvrtc:!!i.pvrtc,etc2:!!i.etc2,astc:!!i.astc,bc7:!!i.bptc}};_(n,c).then(t=>{const o=t.fileInfo.images[0].levels[0],a=t.fileInfo.images[0].levels.length>1&&s.generateMipMaps;l(o.width,o.height,a,t.format!==-1,()=>{P(s,t)})}).catch(t=>{h.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),h.Warn(`Failed to transcode Basis file: ${t}`),l(0,0,!1,!1,()=>{},!0)})}}export{N as _BasisTextureLoader}; diff --git a/assets/blockDiagram-VD42YOAC-B07cvJHo.js b/assets/blockDiagram-VD42YOAC-B07cvJHo.js deleted file mode 100644 index dd9cf6c020415a124f98c0dcd7fd85f239ac8ae8..0000000000000000000000000000000000000000 --- a/assets/blockDiagram-VD42YOAC-B07cvJHo.js +++ /dev/null @@ -1,122 +0,0 @@ -import{g as oe}from"./chunk-FMBD7UC4-Drrjy9J2.js";import{_ as d,G as rt,d as he,l as L,y as de,A as ge,a2 as ue,c as R,P as pe,a3 as j,a4 as Wt,a5 as fe,u as $,j as xe,a6 as ye,a7 as xt,h as yt,a8 as be}from"./mermaid.core-BcqUqpnI.js";import{c as we}from"./clone-BVbdztFw.js";import{G as me}from"./graph-CmFD0A_p.js";import{c as Le}from"./channel-Dg8q-JvW.js";import{s as O}from"./select-BigU4G0v.js";import{l as Se,k as ke}from"./step-B-Gbak1k.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./dispatch-kxCwF96_.js";import"./_baseUniq-BFKEI0vc.js";var bt=(function(){var e=d(function(D,y,g,f){for(g=g||{},f=D.length;f--;g[D[f]]=y);return g},"o"),t=[1,15],a=[1,7],i=[1,13],l=[1,14],s=[1,19],r=[1,16],n=[1,17],c=[1,18],u=[8,30],o=[8,10,21,28,29,30,31,39,43,46],x=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],k={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(y,g,f,m,E,h,W){var p=h.length-1;switch(E){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",h[p-1]),m.setHierarchy(h[p-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:m.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:m.getLogger().debug("Rule: link: ",h[p],y),this.$={edgeTypeStr:h[p],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const I=parseInt(h[p]),Z=m.generateId();this.$={id:Z,type:"space",label:"",width:I,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const V=m.edgeStrToEdgeData(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",directions:h[p].directions,arrowTypeEnd:V,arrowTypeStart:"arrow_open"},{id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:m.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),m.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const at=m.generateId();this.$={id:at,type:"composite",label:"",children:h[p-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:m.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:i,29:l,31:s,39:r,43:n,46:c}),e(o,[2,16],{14:22,15:x,16:w}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(b,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:s},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:x,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(y,g){if(g.recoverable)this.trace(y);else{var f=new Error(y);throw f.hash=g,f}},"parseError"),parse:d(function(y){var g=this,f=[0],m=[],E=[null],h=[],W=this.table,p="",I=0,Z=0,V=2,at=1,ne=h.slice.call(arguments,1),z=Object.create(this.lexer),q={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(q.yy[gt]=this.yy[gt]);z.setInput(y,q.yy),q.yy.lexer=z,q.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var ut=z.yylloc;h.push(ut);var le=z.options&&z.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(P){f.length=f.length-2*P,E.length=E.length-P,h.length=h.length-P}d(ce,"popStack");function Nt(){var P;return P=m.pop()||z.lex()||at,typeof P!="number"&&(P instanceof Array&&(m=P,P=m.pop()),P=g.symbols_[P]||P),P}d(Nt,"lex");for(var F,J,H,pt,Q={},st,G,Tt,it;;){if(J=f[f.length-1],this.defaultActions[J]?H=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=Nt()),H=W[J]&&W[J][F]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in W[J])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");z.showPosition?ft="Parse error on line "+(I+1)+`: -`+z.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ft="Parse error on line "+(I+1)+": Unexpected "+(F==at?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ft,{text:z.match,token:this.terminals_[F]||F,line:z.yylineno,loc:ut,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:f.push(F),E.push(z.yytext),h.push(z.yylloc),f.push(H[1]),F=null,Z=z.yyleng,p=z.yytext,I=z.yylineno,ut=z.yylloc;break;case 2:if(G=this.productions_[H[1]][1],Q.$=E[E.length-G],Q._$={first_line:h[h.length-(G||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(G||1)].first_column,last_column:h[h.length-1].last_column},le&&(Q._$.range=[h[h.length-(G||1)].range[0],h[h.length-1].range[1]]),pt=this.performAction.apply(Q,[p,Z,I,q.yy,H[1],E,h].concat(ne)),typeof pt<"u")return pt;G&&(f=f.slice(0,-1*G*2),E=E.slice(0,-1*G),h=h.slice(0,-1*G)),f.push(this.productions_[H[1]][0]),E.push(Q.$),h.push(Q._$),Tt=W[f[f.length-2]][f[f.length-1]],f.push(Tt);break;case 3:return!0}}return!0},"parse")},B=(function(){var D={EOF:1,parseError:d(function(g,f){if(this.yy.parser)this.yy.parser.parseError(g,f);else throw new Error(g)},"parseError"),setInput:d(function(y,g){return this.yy=g||this.yy||{},this._input=y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var g=y.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:d(function(y){var g=y.length,f=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(y){this.unput(this.match.slice(y))},"less"),pastInput:d(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var y=this.pastInput(),g=new Array(y.length+1).join("-");return y+this.upcomingInput()+` -`+g+"^"},"showPosition"),test_match:d(function(y,g){var f,m,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),m=y[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(y[0].length),this.matched+=y[0],f=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,g,f,m;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hg[0].length)){if(g=f,m=h,this.options.backtrack_lexer){if(y=this.test_match(f,E[h]),y!==!1)return y;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(y=this.test_match(g,E[m]),y!==!1?y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(g,f,m,E){switch(m){case 0:return g.getLogger().debug("Found block-beta"),10;case 1:return g.getLogger().debug("Found id-block"),29;case 2:return g.getLogger().debug("Found block"),10;case 3:g.getLogger().debug(".",f.yytext);break;case 4:g.getLogger().debug("_",f.yytext);break;case 5:return 5;case 6:return f.yytext=-1,28;case 7:return f.yytext=f.yytext.replace(/columns\s+/,""),g.getLogger().debug("COLUMNS (LEX)",f.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:g.getLogger().debug("LEX: POPPING STR:",f.yytext),this.popState();break;case 13:return g.getLogger().debug("LEX: STR end:",f.yytext),"STR";case 14:return f.yytext=f.yytext.replace(/space\:/,""),g.getLogger().debug("SPACE NUM (LEX)",f.yytext),21;case 15:return f.yytext="1",g.getLogger().debug("COLUMNS (LEX)",f.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),g.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),g.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),g.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),g.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),g.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),g.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),g.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),g.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),g.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),g.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return g.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return g.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return g.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return g.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return g.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return g.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return g.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),g.getLogger().debug("LEX ARR START"),37;case 74:return g.getLogger().debug("Lex: NODE_ID",f.yytext),31;case 75:return g.getLogger().debug("Lex: EOF",f.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:g.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:g.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return g.getLogger().debug("LEX: NODE_DESCR:",f.yytext),"NODE_DESCR";case 83:g.getLogger().debug("LEX POPPING"),this.popState();break;case 84:g.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (right): dir:",f.yytext),"DIR";case 86:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (left):",f.yytext),"DIR";case 87:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (x):",f.yytext),"DIR";case 88:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (y):",f.yytext),"DIR";case 89:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (up):",f.yytext),"DIR";case 90:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (down):",f.yytext),"DIR";case 91:return f.yytext="]>",g.getLogger().debug("Lex (ARROW_DIR end):",f.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 93:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 94:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 95:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 96:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 97:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 98:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return g.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 102:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 103:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 104:return g.getLogger().debug("Lex: COLON",f.yytext),f.yytext=f.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D})();k.lexer=B;function _(){this.yy={}}return d(_,"Parser"),_.prototype=k,k.Parser=_,new _})();bt.parser=bt;var ve=bt,X=new Map,kt=[],wt=new Map,Bt="color",Ct="fill",Ee="bgFill",Pt=",",_e=R(),ct=new Map,De=d(e=>xe.sanitizeText(e,_e),"sanitizeText"),Ne=d(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Pt).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Bt).exec(i)){const r=l.replace(Ct,Ee).replace(Bt,Ct);a.textStyles.push(r)}a.styles.push(l)})},"addStyleClass"),Te=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Pt))},"addStyle2Node"),Be=d(function(e,t){e.split(",").forEach(function(a){let i=X.get(a);if(i===void 0){const l=a.trim();i={id:l,type:"na",children:[]},X.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=d((e,t)=>{const a=e.flat(),i=[],s=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof s=="number"&&s>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>s&&L.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`),r.label&&(r.label=De(r.label)),r.type==="classDef"){Ne(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&Te(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const c=r.width??1;for(let u=0;u{L.debug("Clear called"),de(),et={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",et]]),vt=[],ct=new Map,kt=[],wt=new Map},"clear");function Ht(e){switch(L.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return L.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(Ht,"typeStr2Type");function Kt(e){return L.debug("typeStr2Type",e),e==="=="?"thick":"normal"}d(Kt,"edgeTypeStr2Type");function Xt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Xt,"edgeStrToEdgeData");var It=0,Ie=d(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Oe=d(e=>{et.children=e,Yt(e,et),vt=et.children},"setHierarchy"),Re=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=d(()=>[...X.values()],"getBlocksFlat"),Ae=d(()=>vt||[],"getBlocks"),Me=d(()=>kt,"getEdges"),Fe=d(e=>X.get(e),"getBlock"),We=d(e=>{X.set(e.id,e)},"setBlock"),Pe=d(()=>L,"getLogger"),Ye=d(function(){return ct},"getClasses"),He={getConfig:d(()=>rt().block,"getConfig"),typeStr2Type:Ht,edgeTypeStr2Type:Kt,edgeStrToEdgeData:Xt,getLogger:Pe,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Oe,getBlock:Fe,setBlock:We,getColumns:Re,getClasses:Ye,clear:Ce,generateId:Ie},Ke=He,nt=d((e,t)=>{const a=Le,i=a(e,"r"),l=a(e,"g"),s=a(e,"b");return ge(i,l,s,t)},"fade"),Xe=d(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span,p { - color: ${e.titleColor}; - } - - - - .label text,span,p { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - .flowchart-label text { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePath .path { - stroke: ${e.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${nt(e.edgeLabelBackground,.5)}; - // background-color: - } - - .node .cluster { - // fill: ${nt(e.mainBkg,.5)}; - fill: ${nt(e.clusterBkg,.5)}; - stroke: ${nt(e.clusterBorder,.2)}; - box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span,p { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - ${oe()} -`,"getStyles"),Ue=Xe,je=d((e,t,a,i)=>{t.forEach(l=>{rr[l](e,a,i)})},"insertMarkers"),Ve=d((e,t,a)=>{L.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ge=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ze=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),qe=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Je=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),$e=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),tr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),er=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),rr={extension:Ve,composition:Ge,aggregation:Ze,dependency:qe,lollipop:Je,point:Qe,circle:$e,cross:tr,barb:er},ar=je,C=R()?.block?.padding??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,i=Math.floor(t/e);return{px:a,py:i}}d(Ut,"calculateBlockPosition");var sr=d(e=>{let t=0,a=0;for(const i of e.children){const{width:l,height:s,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};L.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",s,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),s>a&&(a=s))}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,i=0){L.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:i,x:0,y:0});let l=0,s=0;if(e.children?.length>0){for(const b of e.children)ot(b,t);const r=sr(e);l=r.width,s=r.height,L.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,s);for(const b of e.children)b.size&&(L.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${s} ${JSON.stringify(b.size)}`),b.size.width=l*(b.widthInColumns??1)+C*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,L.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${s}`));for(const b of e.children)ot(b,t,l,s);const n=e.columns??-1;let c=0;for(const b of e.children)c+=b.widthInColumns??1;let u=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(b>0){const S=(x-b*C-C)/b;L.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,S);for(const v of e.children)v.size&&(v.size.width=S)}}e.size={width:x,height:w,x:0,y:0}}L.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Et(e,t){L.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(L.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,l=e.children.length*i+(e.children.length-1)*C;L.debug("widthOfChildren 88",l,"posX");let s=0;L.debug("abc91 block?.size?.x",e.id,e?.size?.x);let r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,n=0;for(const c of e.children){const u=e;if(!c.size)continue;const{width:o,height:x}=c.size,{px:w,py:b}=Ut(a,s);if(b!=n&&(n=b,r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,L.debug("New row in layout for block",e.id," and child ",c.id,n)),L.debug(`abc89 layout blocks (child) id: ${c.id} Pos: ${s} (px, py) ${w},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${o}${C}`),u.size){const v=o/2;c.size.x=r+C+v,L.debug(`abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${r} new startingPosX${c.size.x} ${v} padding=${C} width=${o} halfWidth=${v} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(c?.widthInColumns??1)/2}`),r=c.size.x+v,c.size.y=u.size.y-u.size.height/2+b*(x+C)+x/2+C,L.debug(`abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${r}${C}${v}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${o*(c?.widthInColumns??1)/2}`)}c.children&&Et(c);let S=c?.widthInColumns??1;a>0&&(S=Math.min(S,a-s%a)),s+=S,L.debug("abc88 columnsPos",c,s)}}L.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Et,"layoutBlocks");function _t(e,{minX:t,minY:a,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:s,y:r,width:n,height:c}=e.size;s-n/2i&&(i=s+n/2),r+c/2>l&&(l=r+c/2)}if(e.children)for(const s of e.children)({minX:t,minY:a,maxX:i,maxY:l}=_t(s,{minX:t,minY:a,maxX:i,maxY:l}));return{minX:t,minY:a,maxX:i,maxY:l}}d(_t,"findBounds");function jt(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Et(t),L.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:i,maxX:l,maxY:s}=_t(t),r=s-i,n=l-a;return{x:a,y:i,width:n,height:r}}d(jt,"layout");function mt(e,t){t&&e.attr("style",t)}d(mt,"applyStyle");function Vt(e,t){const a=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=a.append("xhtml:div"),l=e.label,s=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(yt(l,t)),mt(r,e.labelStyle),r.attr("class",s),mt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}d(Vt,"addHtmlLabel");var ir=d(async(e,t,a,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const s=R();if(j(s.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"
                "),L.debug("vertexText"+l);const r=await ye(xt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Vt(n,s)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|/gi):Array.isArray(l)?n=l:n=[];for(const c of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),a?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=c.trim(),r.appendChild(u)}return r}},"createLabel"),K=ir,nr=d((e,t,a,i,l)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,a,i,l)},"addEdgeMarkers"),lr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=d((e,t,a,i,l,s)=>{const r=lr[a];if(!r){L.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${s}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},cr=d(async(e,t)=>{const a=R(),i=j(a.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},a):await K(t.label,t.labelStyle),s=e.insert("g").attr("class","edgeLabel"),r=s.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],o=O(l);n=u.getBoundingClientRect(),o.attr("width",n.width),o.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=s,t.width=n.width,t.height=n.height;let c;if(t.startLabelLeft){const u=await K(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startLeft=o,tt(c,t.startLabelLeft)}if(t.startLabelRight){const u=await K(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=o.node().appendChild(u),x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startRight=o,tt(c,t.startLabelRight)}if(t.endLabelLeft){const u=await K(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endLeft=o,tt(c,t.endLabelLeft)}if(t.endLabelRight){const u=await K(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endRight=o,tt(c,t.endLabelRight)}return l},"insertEdgeLabel");function tt(e,t){R().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(tt,"setTerminalWidth");var or=d((e,t)=>{L.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=R(),{subGraphTitleTotalMargin:l}=fe(i);if(e.label){const s=Lt[e.id];let r=e.x,n=e.y;if(a){const c=$.calcLabelPosition(a);L.debug("Moving label "+e.label+" from (",r,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(r=c.x,n=c.y)}s.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const s=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const s=M[e.id].startRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const s=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const s=M[e.id].endRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=d((e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),s=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||s>=n},"outsideNode"),dr=d((e,t,a)=>{L.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(t)} - insidePoint : ${JSON.stringify(a)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,s=Math.abs(i-a.x),r=e.width/2;let n=a.xMath.abs(i-t.x)*c){let x=a.y{L.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],l=!1;return e.forEach(s=>{if(!hr(t,s)&&!l){const r=dr(t,i,s);let n=!1;a.forEach(c=>{n=n||c.x===r.x&&c.y===r.y}),a.some(c=>c.x===r.x&&c.y===r.y)||a.push(r),l=!0}else i=s,l||a.push(s)}),a},"cutPathAtIntersect"),gr=d(function(e,t,a,i,l,s,r){let n=a.points;L.debug("abc88 InsertEdge: edge=",a,"e=",t);let c=!1;const u=s.node(t.v);var o=s.node(t.w);o?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(L.debug("to cluster abc88",i[a.toCluster]),n=Rt(a.points,i[a.toCluster].node),c=!0),a.fromCluster&&(L.debug("from cluster abc88",i[a.fromCluster]),n=Rt(n.reverse(),i[a.fromCluster].node).reverse(),c=!0);const x=n.filter(y=>!Number.isNaN(y.y));let w=ke;a.curve&&(l==="graph"||l==="flowchart")&&(w=a.curve);const{x:b,y:S}=ue(a),v=Se().x(b).y(S).curve(w);let k;switch(a.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(a.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const B=e.append("path").attr("d",v(x)).attr("id",a.id).attr("class"," "+k+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=pe(!0)),nr(B,a,_,r,l);let D={};return c&&(D.updatedPath=n),D.originalPath=a.points,D},"insertEdge"),ur=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),pr=d((e,t,a)=>{const i=ur(e),l=2,s=t.height+2*a.padding,r=s/l,n=t.width+2*r+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*c},{x:n-r,y:0},{x:n,y:0},{x:n,y:-s/3},{x:n+2*c,y:-s/2},{x:n,y:-2*s/3},{x:n,y:-s},{x:n-r,y:-s},{x:n/2,y:-s-2*c},{x:r,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*c,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-s},{x:n-r,y:-s},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-s+r},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-s+r},{x:n,y:-s}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-s}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-s}]:i.has("right")?[{x:r,y:-c},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s+c}]:i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}d(Gt,"intersectNode");var fr=Gt;function Zt(e,t,a,i){var l=e.x,s=e.y,r=l-i.x,n=s-i.y,c=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/c);i.x0}d(St,"sameSign");var yr=Qt,br=$t;function $t(e,t,a){var i=e.x,l=e.y,s=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(S){r=Math.min(r,S.x),n=Math.min(n,S.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-r,u=l-e.height/2-n,o=0;o1&&s.sort(function(S,v){var k=S.x-a.x,B=S.y-a.y,_=Math.sqrt(k*k+B*B),D=v.x-a.x,y=v.y-a.y,g=Math.sqrt(D*D+y*y);return _{var a=e.x,i=e.y,l=t.x-a,s=t.y-i,r=e.width/2,n=e.height/2,c,u;return Math.abs(s)*r>Math.abs(l)*n?(s<0&&(n=-n),c=s===0?0:n*l/s,u=n):(l<0&&(r=-r),c=r,u=l===0?0:r*s/l),{x:a+c,y:i+u}},"intersectRect"),mr=wr,N={node:fr,circle:xr,ellipse:qt,polygon:br,rect:mr},A=d(async(e,t,a,i)=>{const l=R();let s;const r=t.useHtmlLabels||j(l.flowchart.htmlLabels);a?s=a:s="node default";const n=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=c.node();let x;t.labelType==="markdown"?x=Wt(c,yt(xt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):x=o.appendChild(await K(yt(xt(u),l),t.labelStyle,!1,i));let w=x.getBBox();const b=t.padding/2;if(j(l.flowchart.htmlLabels)){const S=x.children[0],v=O(x),k=S.getElementsByTagName("img");if(k){const B=u.replace(/]*>/g,"").trim()==="";await Promise.all([...k].map(_=>new Promise(D=>{function y(){if(_.style.display="flex",_.style.flexDirection="column",B){const g=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,m=parseInt(g,10)*5+"px";_.style.minWidth=m,_.style.maxWidth=m}else _.style.width="100%";D(_)}d(y,"setupImage"),setTimeout(()=>{_.complete&&y()}),_.addEventListener("error",y),_.addEventListener("load",y)})))}w=S.getBoundingClientRect(),v.attr("width",w.width),v.attr("height",w.height)}return r?c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"):c.attr("transform","translate(0, "+-w.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:n,bbox:w,halfPadding:b,label:c}},"labelHelper"),T=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function U(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(U,"insertPolygonShape");var Lr=d(async(e,t)=>{t.useHtmlLabels||R().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:s}=await A(e,t,"node "+t.classes,!0);L.info("Classes = ",t.classes);const r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-s).attr("y",-l.height/2-s).attr("width",l.width+t.padding).attr("height",l.height+t.padding),T(t,r),t.intersect=function(n){return N.rect(t,n)},i},"note"),Sr=Lr,zt=d(e=>e?" "+e:"","formatClass"),Y=d((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),At=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=l+s,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];L.info("Question main (Circle)");const c=U(a,r,r,n);return c.attr("style",t.style),T(t,c),t.intersect=function(u){return L.warn("Intersect called"),N.polygon(t,n,u)},a},"question"),kr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return N.circle(t,14,r)},a},"choice"),vr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=4,s=i.height+t.padding,r=s/l,n=i.width+2*r+t.padding,c=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}],u=U(a,n,s,c);return u.attr("style",t.style),T(t,u),t.intersect=function(o){return N.polygon(t,c,o)},a},"hexagon"),Er=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,void 0,!0),l=2,s=i.height+2*t.padding,r=s/l,n=i.width+2*r+t.padding,c=pr(t.directions,i,t),u=U(a,n,s,c);return u.attr("style",t.style),T(t,u),t.intersect=function(o){return N.polygon(t,c,o)},a},"block_arrow"),_r=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-s/2,y:0},{x:l,y:0},{x:l,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return U(a,l,s,r).attr("style",t.style),t.width=l+s,t.height=s,t.intersect=function(c){return N.polygon(t,r,c)},a},"rect_left_inv_arrow"),Dr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"lean_right"),Nr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:2*s/6,y:0},{x:l+s/6,y:0},{x:l-2*s/6,y:-s},{x:-s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"lean_left"),Tr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l+2*s/6,y:0},{x:l-s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"trapezoid"),Br=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:-2*s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"inv_trapezoid"),Cr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l+s/2,y:0},{x:l,y:-s/2},{x:l+s/2,y:-s},{x:0,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"rect_right_inv_arrow"),Ir=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=l/2,r=s/(2.5+l/50),n=i.height+r+t.padding,c="M 0,"+r+" a "+s+","+r+" 0,0,0 "+l+" 0 a "+s+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+s+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return T(t,u),t.intersect=function(o){const x=N.rect(t,o),w=x.x-t.x;if(s!=0&&(Math.abs(w)t.height/2-r)){let b=r*r*(1-w*w/(s*s));b!=0&&(b=Math.sqrt(b)),b=r-b,o.y-t.y>0&&(b=-b),x.y+=b}return x},a},"cylinder"),Or=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes+" "+t.class,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return T(t,s),t.intersect=function(o){return N.rect(t,o)},a},"rect"),Rr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return T(t,s),t.intersect=function(o){return N.rect(t,o)},a},"composite"),zr=d(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);L.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,s=0;if(i.attr("width",l).attr("height",s),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(i,t.props.borders,l,s),r.delete("borders")),r.forEach(n=>{L.warn(`Unknown node property ${n}`)})}return T(t,i),t.intersect=function(r){return N.rect(t,r)},a},"labelRect");function ht(e,t,a,i){const l=[],s=d(n=>{l.push(n,0)},"addBorder"),r=d(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(L.debug("add top border"),s(a)):r(a),t.includes("r")?(L.debug("add right border"),s(i)):r(i),t.includes("b")?(L.debug("add bottom border"),s(a)):r(a),t.includes("l")?(L.debug("add left border"),s(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}d(ht,"applyNodePropertyBorders");var Ar=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),s=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,L.info("Label text abc79",c,n,typeof n=="object");const u=r.node().appendChild(await K(c,t.labelStyle,!0,!0));let o={width:0,height:0};if(j(R().flowchart.htmlLabels)){const v=u.children[0],k=O(u);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}L.info("Text 2",n);const x=n.slice(1,n.length);let w=u.getBBox();const b=r.node().appendChild(await K(x.join?x.join("
                "):x,t.labelStyle,!0,!0));if(j(R().flowchart.htmlLabels)){const v=b.children[0],k=O(b);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}const S=t.padding/2;return O(b).attr("transform","translate( "+(o.width>w.width?0:(w.width-o.width)/2)+", "+(w.height+S+5)+")"),O(u).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.height+t.padding,s=i.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l);return T(t,r),t.intersect=function(n){return N.rect(t,n)},a},"stadium"),Fr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=a.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("Circle main"),T(t,s),t.intersect=function(r){return L.info("Circle intersect",t,i.width/2+l,r),N.circle(t,i.width/2+l,r)},a},"circle"),Wr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=5,r=a.insert("g",":first-child"),n=r.insert("circle"),c=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+s).attr("width",i.width+t.padding+s*2).attr("height",i.height+t.padding+s*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("DoubleCircle main"),T(t,n),t.intersect=function(u){return L.info("DoubleCircle intersect",t,i.width/2+l+s,u),N.circle(t,i.width/2+l+s,u)},a},"doublecircle"),Pr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"subroutine"),Yr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),T(t,i),t.intersect=function(l){return N.circle(t,7,l)},a},"start"),Mt=d((e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,s=10;a==="LR"&&(l=10,s=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*s/2).attr("width",l).attr("height",s).attr("class","fork-join");return T(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return N.rect(t,n)},i},"forkJoin"),Hr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),T(t,l),t.intersect=function(s){return N.circle(t,7,s)},a},"end"),Kr=d(async(e,t)=>{const a=t.padding/2,i=4,l=8;let s;t.classes?s="node "+t.classes:s="node default";const r=e.insert("g").attr("class",s).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),c=r.insert("line"),u=r.insert("line");let o=0,x=i;const w=r.insert("g").attr("class","label");let b=0;const S=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",k=w.node().appendChild(await K(v,t.labelStyle,!0,!0));let B=k.getBBox();if(j(R().flowchart.htmlLabels)){const E=k.children[0],h=O(k);B=E.getBoundingClientRect(),h.attr("width",B.width),h.attr("height",B.height)}t.classData.annotations[0]&&(x+=B.height+i,o+=B.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R().flowchart.htmlLabels?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const D=w.node().appendChild(await K(_,t.labelStyle,!0,!0));O(D).attr("class","classTitle");let y=D.getBBox();if(j(R().flowchart.htmlLabels)){const E=D.children[0],h=O(D);y=E.getBoundingClientRect(),h.attr("width",y.width),h.attr("height",y.height)}x+=y.height+i,y.width>o&&(o=y.width);const g=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,g.push(p)}),x+=l;const f=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,f.push(p)}),x+=l,S){let E=(o-B.width)/2;O(k).attr("transform","translate( "+(-1*o/2+E)+", "+-1*x/2+")"),b=B.height+i}let m=(o-y.width)/2;return O(D).attr("transform","translate( "+(-1*o/2+m)+", "+(-1*x/2+b)+")"),b+=y.height+i,c.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,g.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b+l/2)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),b+=l,u.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,f.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(x/2)-a).attr("width",o+t.padding).attr("height",x+t.padding),T(t,n),t.intersect=function(E){return N.rect(t,E)},r},"class_box"),Ft={rhombus:At,composite:Rr,question:At,rect:Or,labelRect:zr,rectWithTitle:Ar,choice:kr,circle:Fr,doublecircle:Wr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:_r,lean_right:Dr,lean_left:Nr,trapezoid:Tr,inv_trapezoid:Br,rect_right_inv_arrow:Cr,cylinder:Ir,start:Yr,end:Hr,note:Sr,subroutine:Pr,fork:Mt,join:Mt,class_box:Kr},lt={},te=d(async(e,t,a)=>{let i,l;if(t.link){let s;R().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),l=await Ft[t.shape](i,t,a)}else l=await Ft[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Xr=d(e=>{const t=lt[e.id];L.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,a=!1){const i=e;let l="default";(i?.classes?.length||0)>0&&(l=(i?.classes??[]).join(" ")),l=l+" flowchart-label";let s=0,r="",n;switch(i.type){case"round":s=5,r="rect";break;case"composite":s=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const c=be(i?.styles??[]),u=i.label,o=i.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:r,labelText:u,rx:s,ry:s,class:l,style:c.style,id:i.id,directions:i.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:i.type,padding:n??rt()?.block?.padding??0}}d(Dt,"getNodeFromBlock");async function ee(e,t,a){const i=Dt(t,a,!1);if(i.type==="group")return;const l=rt(),s=await te(e,i,{config:l}),r=s.node().getBBox(),n=a.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:s},a.setBlock(n),s.remove()}d(ee,"calculateBlockSize");async function re(e,t,a){const i=Dt(t,a,!0);if(a.getBlock(i.id).type!=="space"){const s=rt();await te(e,i,{config:s}),t.intersect=i?.intersect,Xr(i)}}d(re,"insertBlockPositioned");async function dt(e,t,a,i){for(const l of t)await i(e,l,a),l.children&&await dt(e,l.children,a,i)}d(dt,"performOperations");async function ae(e,t,a){await dt(e,t,a,ee)}d(ae,"calculateBlockSizes");async function se(e,t,a){await dt(e,t,a,re)}d(se,"insertBlocks");async function ie(e,t,a,i,l){const s=new me({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&s.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),c=i.getBlock(r.end);if(n?.size&&c?.size){const u=n.size,o=c.size,x=[{x:u.x,y:u.y},{x:u.x+(o.x-u.x)/2,y:u.y+(o.y-u.y)/2},{x:o.x,y:o.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,l),r.label&&(await cr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),or({...r,x:x[1].x,y:x[1].y},{originalPath:x}))}}}d(ie,"insertEdges");var Ur=d(function(e,t){return t.db.getClasses()},"getClasses"),jr=d(async function(e,t,a,i){const{securityLevel:l,block:s}=rt(),r=i.db;let n;l==="sandbox"&&(n=O("#i"+t));const c=l==="sandbox"?O(n.nodes()[0].contentDocument.body):O("body"),u=l==="sandbox"?c.select(`[id="${t}"]`):O(`[id="${t}"]`);ar(u,["point","circle","cross"],i.type,t);const x=r.getBlocks(),w=r.getBlocksFlat(),b=r.getEdges(),S=u.insert("g").attr("class","block");await ae(S,x,r);const v=jt(r);if(await se(S,x,r),await ie(S,b,w,r,t),v){const k=v,B=Math.max(1,Math.round(.125*(k.width/k.height))),_=k.height+B+10,D=k.width+10,{useMaxWidth:y}=s;he(u,_,D,!!y),L.debug("Here Bounds",v,k),u.attr("viewBox",`${k.x-5} ${k.y-5} ${k.width+10} ${k.height+10}`)}},"draw"),Vr={draw:jr,getClasses:Ur},ia={parser:ve,db:Ke,renderer:Vr,styles:Ue};export{ia as diagram}; diff --git a/assets/bone-CnpD8dWY.js b/assets/bone-CnpD8dWY.js deleted file mode 100644 index 3d018fbff88e3da80b977b73e4b48e82086ac682..0000000000000000000000000000000000000000 --- a/assets/bone-CnpD8dWY.js +++ /dev/null @@ -1 +0,0 @@ -import{an as _,M as l,c as p,ao as u,V as h,ap as f}from"./index-GY9JDBGV.js";class r extends _{get _matrix(){return this._compose(),this._localMatrix}set _matrix(t){t.updateFlag===this._localMatrix.updateFlag&&!this._needToCompose||(this._needToCompose=!1,this._localMatrix.copyFrom(t),this._markAsDirtyAndDecompose())}constructor(t,i,e=null,s=null,o=null,n=null,a=null){super(t,i.getScene(),!1),this.name=t,this.children=[],this.animations=[],this._index=null,this._scalingDeterminant=1,this._needToDecompose=!0,this._needToCompose=!1,this._linkedTransformNode=null,this._waitingTransformNodeId=null,this._skeleton=i,this._localMatrix=s?.clone()??l.Identity(),this._restMatrix=o??this._localMatrix.clone(),this._bindMatrix=n??this._localMatrix.clone(),this._index=a,this._absoluteMatrix=new l,this._absoluteBindMatrix=new l,this._absoluteInverseBindMatrix=new l,this._finalMatrix=new l,i.bones.push(this),this.setParent(e,!1),this._updateAbsoluteBindMatrices()}getClassName(){return"Bone"}getSkeleton(){return this._skeleton}get parent(){return this._parentNode}getParent(){return this.parent}getChildren(){return this.children}getIndex(){return this._index===null?this.getSkeleton().bones.indexOf(this):this._index}set parent(t){this.setParent(t)}setParent(t,i=!0){if(this.parent!==t){if(this.parent){const e=this.parent.children.indexOf(this);e!==-1&&this.parent.children.splice(e,1)}this._parentNode=t,this.parent&&this.parent.children.push(this),i&&this._updateAbsoluteBindMatrices(),this.markAsDirty()}}getLocalMatrix(){return this._compose(),this._localMatrix}getBindMatrix(){return this._bindMatrix}getBaseMatrix(){return this.getBindMatrix()}getRestMatrix(){return this._restMatrix}getRestPose(){return this.getRestMatrix()}setRestMatrix(t){this._restMatrix.copyFrom(t)}setRestPose(t){this.setRestMatrix(t)}getBindPose(){return this.getBindMatrix()}setBindMatrix(t){this.updateMatrix(t)}setBindPose(t){this.setBindMatrix(t)}getFinalMatrix(){return this._finalMatrix}getWorldMatrix(){return this.getFinalMatrix()}returnToRest(){if(this._linkedTransformNode){const t=p.Vector3[0],i=p.Quaternion[0],e=p.Vector3[1];this.getRestMatrix().decompose(t,i,e),this._linkedTransformNode.position.copyFrom(e),this._linkedTransformNode.rotationQuaternion=this._linkedTransformNode.rotationQuaternion??u.Identity(),this._linkedTransformNode.rotationQuaternion.copyFrom(i),this._linkedTransformNode.scaling.copyFrom(t)}else this._matrix=this._restMatrix}getAbsoluteInverseBindMatrix(){return this._absoluteInverseBindMatrix}getInvertedAbsoluteTransform(){return this.getAbsoluteInverseBindMatrix()}getAbsoluteMatrix(){return this._skeleton.computeAbsoluteMatrices(),this._absoluteMatrix}getAbsoluteTransform(){return this.getAbsoluteMatrix()}linkTransformNode(t){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=t,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++}getTransformNode(){return this._linkedTransformNode}get position(){return this._decompose(),this._localPosition}set position(t){this._decompose(),this._localPosition.copyFrom(t),this._markAsDirtyAndCompose()}get rotation(){return this.getRotation()}set rotation(t){this.setRotation(t)}get rotationQuaternion(){return this._decompose(),this._localRotation}set rotationQuaternion(t){this.setRotationQuaternion(t)}get scaling(){return this.getScale()}set scaling(t){this.setScale(t)}get animationPropertiesOverride(){return this._skeleton.animationPropertiesOverride}_decompose(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=h.Zero(),this._localRotation=u.Zero(),this._localPosition=h.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))}_compose(){if(this._needToCompose){if(!this._localScaling){this._needToCompose=!1;return}this._needToCompose=!1,l.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)}}updateMatrix(t,i=!0,e=!0){this._bindMatrix.copyFrom(t),i&&this._updateAbsoluteBindMatrices(),e?this._matrix=t:this.markAsDirty()}_updateAbsoluteBindMatrices(t,i=!0){if(t||(t=this._bindMatrix),this.parent?t.multiplyToRef(this.parent._absoluteBindMatrix,this._absoluteBindMatrix):this._absoluteBindMatrix.copyFrom(t),this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix),i)for(let e=0;e0 -attribute matricesIndices : vec4f;attribute matricesWeights : vec4f; -#if NUM_BONE_INFLUENCERS>4 -attribute matricesIndicesExtra : vec4f;attribute matricesWeightsExtra : vec4f; -#endif -#ifndef BAKED_VERTEX_ANIMATION_TEXTURE -#ifdef BONETEXTURE -var boneSampler : texture_2d;uniform boneTextureWidth : f32; -#else -uniform mBones : array; -#endif -#ifdef BONES_VELOCITY_ENABLED -uniform mPreviousBones : array; -#endif -#ifdef BONETEXTURE -fn readMatrixFromRawSampler(smp : texture_2d,index : f32)->mat4x4f -{let offset=i32(index) *4; -let m0=textureLoad(smp,vec2(offset+0,0),0);let m1=textureLoad(smp,vec2(offset+1,0),0);let m2=textureLoad(smp,vec2(offset+2,0),0);let m3=textureLoad(smp,vec2(offset+3,0),0);return mat4x4f(m0,m1,m2,m3);} -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=r); diff --git a/assets/bonesVertex-W7KXt3j6.js b/assets/bonesVertex-W7KXt3j6.js deleted file mode 100644 index 7c9bb38f30f7282778f48c72e656ec4f2f257cb3..0000000000000000000000000000000000000000 --- a/assets/bonesVertex-W7KXt3j6.js +++ /dev/null @@ -1,54 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const n="bonesVertex",i=`#ifndef BAKED_VERTEX_ANIMATION_TEXTURE -#if NUM_BONE_INFLUENCERS>0 -var influence : mat4x4; -#ifdef BONETEXTURE -influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3]; -#endif -#else -influence=uniforms.mBones[i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3]; -#endif -#endif -finalWorld=finalWorld*influence; -#endif -#endif -`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=i); diff --git a/assets/browserAll-DkqSnwnO.js b/assets/browserAll-DkqSnwnO.js deleted file mode 100644 index 618b3684e440fb01a34f955ddbc49568ad17be12..0000000000000000000000000000000000000000 --- a/assets/browserAll-DkqSnwnO.js +++ /dev/null @@ -1,14 +0,0 @@ -import{T as M,U as Z,P as f,r as te,E as y,a as ie,w as g,e as P,C as V}from"./Index-EyePZPlZ.js";import"./webworkerAll-CFOMp2SO.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";import"./misc-Dkc5KZ-v.js";import"./ImagePreview-C41duyJ0.js";import"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import"./snippet-BtHMuX3s.js";import"./BlockLabel-BzVeVrtL.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";import"./Image-DBmW1mOo.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./FullscreenButton-BuyUU5Yj.js";import"./Maximize-DWbY8BRa.js";import"./Image-CZ1Hb99p.js";/* empty css *//* empty css */import"./Block-WPcVj6Bq.js";import"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./Clear-BR8cTgGu.js";/* empty css */import"./Upload-Bq9KuxCu.js";import"./actions-4RaHFoGI.js";/* empty css */import"./Webcam-B-wg5Ly_.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";import"./window-D5YXrKnH.js";import"./tinycolor-D4ULLcDx.js";import"./Plus-BDmybZhd.js";import"./input-BtIxlP_B.js";import"./Check-2f8HlfSn.js";import"./event-modifiers-CdEA5IGF.js";import"./ArrowUp-aILrPIpo.js";import"./Trash-CJrspSVZ.js";import"./Undo-B9SlrYtT.js";import"./colorToUniform-3MxHuUz8.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new f,this.page=new f,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,Y=/BlackBerry/i,H=/BB10/i,F=/Opera Mini/i,N=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,K=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function G(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||K(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||K(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(Y),blackberry10:n(H),opera:n(F),firefox:n($),chrome:n(N),device:n(Y)||n(H)||n(F)||n($)||n(N)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=G.default??G,oe=se(globalThis.navigator),re=9,W=100,ae=0,le=0,j=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=j.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i title : ${e.title}
                tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=` - color: transparent; - pointer-events: none; - padding: 0; - margin: 0; - border: 0; - outline: 0; - background: transparent; - box-sizing: border-box; - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - `,e.accessibleText&&(i.innerText=e.accessibleText)),i.style.width=`${W}px`,i.style.height=`${W}px`,i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=j.toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=e.accessiblePointerEvents,i.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?i.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(i.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&i.setAttribute("aria-label",e.accessibleHint),e.interactive?i.tabIndex=e.tabIndex:i.tabIndex=0,this.debug&&this._updateDebugHTML(i),e._accessibleActive=!0,e._accessibleDiv=i,i.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new w(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode!==re||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};L.extension={type:[y.WebGLSystem,y.WebGPUSystem],name:"accessibility"};L.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let ue=L;const pe={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1};class Q{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new q({domElement:this._domElement,renderer:this._renderer})}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e)}updateRenderable(e){}validateRenderable(e){return!0}postrender(){const e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}this._canvasObserver.ensureAttached();for(let t=0;ti.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;_--){const c=h[_],p=this.hitTestMoveRecursive(c,this._isInteractive(t)?t:c.eventMode,i,n,s,o||s(e,i));if(p){if(p.length>0&&!p[p.length-1].parent)continue;const D=e.isInteractive();(p.length>0||D)&&(D&&this._allInteractiveElements.push(e),p.push(e)),this._hitElements.length===0&&(this._hitElements=p),r=!0}}}const l=this._isInteractive(t),d=e.isInteractive();return d&&d&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:r?this._hitElements:l&&!s(e,i)&&n(e,i)?d?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(m.pauseUpdate=!1),e.interactiveChildren&&e.children){const l=e.children,d=i;for(let h=l.length-1;h>=0;h--){const _=l[h],c=this.hitTestRecursive(_,this._isInteractive(t)?t:_.eventMode,d,n,s);if(c){if(c.length>0&&!c[c.length-1].parent)continue;const p=e.isInteractive();return(c.length>0||p)&&c.push(e),c}}}const o=this._isInteractive(t),r=e.isInteractive();return o&&n(e,i)?r?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,T),!e.hitArea.contains(T.x,T.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const l=e.type==="mousemove"?"mouseout":"pointerout",d=this.createPointerEvent(e,l,s);if(this.dispatchEvent(d,"pointerout"),i&&this.dispatchEvent(d,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(d)}if(s!==t.target){const l=e.type==="mousemove"?"mouseover":"pointerover",d=this.clonePointerEvent(t,l);this.dispatchEvent(d,"pointerover"),i&&this.dispatchEvent(d,"mouseover");let h=s?.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const c=this.clonePointerEvent(t,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==s&&c.target!==this.rootTarget.parent;)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseenter"),c.target=c.target.parent;this.freeEvent(c)}this.freeEvent(d)}const o=[],r=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),r&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),r&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),r&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof u)){g("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof u)){g("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof u)){g("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const r=i.button===2;this.dispatchEvent(i,r?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let r=s;for(;r&&!i.composedPath().includes(r);){if(i.currentTarget=r,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const l=i.button===2;this.notifyTarget(i,l?"rightupoutside":"mouseupoutside")}r=r.parent}delete n.pressTargetsByButton[e.button],o=r}if(o){const r=this.clonePointerEvent(i,"click");r.target=o,r.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:r.target,timeStamp:t});const l=n.clicksByButton[e.button];if(l.target===r.target&&t-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=r.target,l.timeStamp=t,r.detail=l.clickCount,r.pointerType==="mouse"){const d=r.button===2;this.dispatchEvent(r,d?"rightclick":"click")}else r.pointerType==="touch"&&this.dispatchEvent(r,"tap");this.dispatchEvent(r,"pointertap"),this.freeEvent(r)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof u)){g("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof E)){g("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){m.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||(e="default");let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=ge),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ye[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};S.extension={name:"events",type:[y.WebGLSystem,y.CanvasSystem,y.WebGPUSystem],priority:-1};S.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let ee=S;const be={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(a){this.eventMode=a?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??ee.defaultEventMode},set eventMode(a){this._internalEventMode=a},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(a,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;a=i?`${a}capture`:a;const r=typeof e=="function"?e:e.handleEvent,l=this;n&&n.addEventListener("abort",()=>{l.off(a,r,o)}),s?l.once(a,r,o):l.on(a,r,o)},removeEventListener(a,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;a=i?`${a}capture`:a,e=typeof e=="function"?e:e.handleEvent,this.off(a,e,n)},dispatchEvent(a){if(!(a instanceof w))throw new Error("Container cannot propagate events outside of the Federated Events API");return a.defaultPrevented=!1,a.path=null,a.target=this,a.manager.dispatchEvent(a),!a.defaultPrevented}};P.add(ue);P.mixin(V,pe);P.add(ee);P.mixin(V,be);P.add(Q); diff --git a/assets/bumpFragment-DEyymZuF.js b/assets/bumpFragment-DEyymZuF.js deleted file mode 100644 index 55561cbbd241a20f44bc96019f79d40ba8f5d431..0000000000000000000000000000000000000000 --- a/assets/bumpFragment-DEyymZuF.js +++ /dev/null @@ -1,123 +0,0 @@ -import{S as a}from"./index-GY9JDBGV.js";import"./samplerFragmentDeclaration-Bn5G_87U.js";const e="bumpFragmentMainFunctions",f=`#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL) -#if defined(TANGENT) && defined(NORMAL) -varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f; -#endif -#ifdef OBJECTSPACE_NORMALMAP -uniform normalMatrix: mat4x4f;fn toNormalMatrix(m: mat4x4f)->mat4x4f -{var a00=m[0][0];var a01=m[0][1];var a02=m[0][2];var a03=m[0][3];var a10=m[1][0];var a11=m[1][1];var a12=m[1][2];var a13=m[1][3];var a20=m[2][0]; -var a21=m[2][1];var a22=m[2][2];var a23=m[2][3];var a30=m[3][0]; -var a31=m[3][1];var a32=m[3][2];var a33=m[3][3];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;var mi=mat4x4( -(a11*b11-a12*b10+a13*b09)/det, -(a02*b10-a01*b11-a03*b09)/det, -(a31*b05-a32*b04+a33*b03)/det, -(a22*b04-a21*b05-a23*b03)/det, -(a12*b08-a10*b11-a13*b07)/det, -(a00*b11-a02*b08+a03*b07)/det, -(a32*b02-a30*b05-a33*b01)/det, -(a20*b05-a22*b02+a23*b01)/det, -(a10*b10-a11*b08+a13*b06)/det, -(a01*b08-a00*b10-a03*b06)/det, -(a30*b04-a31*b02+a33*b00)/det, -(a21*b02-a20*b04-a23*b00)/det, -(a11*b07-a10*b09-a12*b06)/det, -(a00*b09-a01*b07+a02*b06)/det, -(a31*b01-a30*b03-a32*b00)/det, -(a20*b03-a21*b01+a22*b00)/det);return mat4x4(mi[0][0],mi[1][0],mi[2][0],mi[3][0], -mi[0][1],mi[1][1],mi[2][1],mi[3][1], -mi[0][2],mi[1][2],mi[2][2],mi[3][2], -mi[0][3],mi[1][3],mi[2][3],mi[3][3]);} -#endif -fn perturbNormalBase(cotangentFrame: mat3x3f,normal: vec3f,scale: f32)->vec3f -{var output=normal; -#ifdef NORMALXYSCALE -output=normalize(output* vec3f(scale,scale,1.0)); -#endif -return normalize(cotangentFrame*output);} -fn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f -{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);} -fn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f -{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);} -#endif -`;a.IncludesShadersStoreWGSL[e]||(a.IncludesShadersStoreWGSL[e]=f);const r="bumpFragmentFunctions",m=`#if defined(BUMP) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump) -#endif -#if defined(DETAIL) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail) -#endif -#if defined(BUMP) && defined(PARALLAX) -const minSamples: f32=4.;const maxSamples: f32=15.;const iMaxSamples: i32=15;fn parallaxOcclusion(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32)->vec2f {var parallaxLimit: f32=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;var vOffsetDir: vec2f=normalize(vViewDirCoT.xy);var vMaxOffset: vec2f=vOffsetDir*parallaxLimit;var numSamples: f32=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));var stepSize: f32=1.0/numSamples;var currRayHeight: f32=1.0;var vCurrOffset: vec2f= vec2f(0,0);var vLastOffset: vec2f= vec2f(0,0);var lastSampledHeight: f32=1.0;var currSampledHeight: f32=1.0;var keepWorking: bool=true;for (var i: i32=0; icurrRayHeight) -{var delta1: f32=currSampledHeight-currRayHeight;var delta2: f32=(currRayHeight+stepSize)-lastSampledHeight;var ratio: f32=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;} -else -{currRayHeight-=stepSize;vLastOffset=vCurrOffset; -#ifdef PARALLAX_RHS -vCurrOffset-=stepSize*vMaxOffset; -#else -vCurrOffset+=stepSize*vMaxOffset; -#endif -lastSampledHeight=currSampledHeight;}} -return vCurrOffset;} -fn parallaxOffset(viewDir: vec3f,heightScale: f32)->vec2f -{var height: f32=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).w;var texCoordOffset: vec2f=heightScale*viewDir.xy*height; -#ifdef PARALLAX_RHS -return texCoordOffset; -#else -return -texCoordOffset; -#endif -} -#endif -`;a.IncludesShadersStoreWGSL[r]||(a.IncludesShadersStoreWGSL[r]=m);const t="bumpFragment",n=`var uvOffset: vec2f= vec2f(0.0,0.0); -#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL) -#ifdef NORMALXYSCALE -var normalScale: f32=1.0; -#elif defined(BUMP) -var normalScale: f32=uniforms.vBumpInfos.y; -#else -var normalScale: f32=1.0; -#endif -#if defined(TANGENT) && defined(NORMAL) -var TBN: mat3x3f=mat3x3(input.vTBN0,input.vTBN1,input.vTBN2); -#elif defined(BUMP) -var TBNUV: vec2f=select(-fragmentInputs.vBumpUV,fragmentInputs.vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams); -#else -var TBNUV: vec2f=select(-fragmentInputs.vDetailUV,fragmentInputs.vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.)); -#endif -#elif defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -var TBN: mat3x3f=mat3x3(input.vTBN0,input.vTBN1,input.vTBN2); -#else -var TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.)); -#endif -#endif -#ifdef PARALLAX -var invTBN: mat3x3f=transposeMat3(TBN); -#ifdef PARALLAXOCCLUSION -uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,fragmentInputs.vBumpUV,uniforms.vBumpInfos.z); -#else -uvOffset=parallaxOffset(invTBN*viewDirectionW,uniforms.vBumpInfos.z); -#endif -#endif -#ifdef DETAIL -var detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,fragmentInputs.vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB); -#endif -#ifdef BUMP -#ifdef OBJECTSPACE_NORMALMAP -#define CUSTOM_FRAGMENT_BUMP_FRAGMENT -normalW=normalize(textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW); -#elif !defined(DETAIL) -normalW=perturbNormal(TBN,textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz,uniforms.vBumpInfos.y); -#else -var bumpNormal: vec3f=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz*2.0-1.0; -#if DETAIL_NORMALBLENDMETHOD==0 -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z)); -#elif DETAIL_NORMALBLENDMETHOD==1 -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal; -#endif -normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y); -#endif -#elif defined(DETAIL) -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z); -#endif -`;a.IncludesShadersStoreWGSL[t]||(a.IncludesShadersStoreWGSL[t]=n); diff --git a/assets/bumpFragment-Dn7_UB6Q.js b/assets/bumpFragment-Dn7_UB6Q.js deleted file mode 100644 index e6d49cfed6be8c0bf386928a1bd671ab3800e45c..0000000000000000000000000000000000000000 --- a/assets/bumpFragment-Dn7_UB6Q.js +++ /dev/null @@ -1,162 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const a="samplerFragmentDeclaration",l=`#ifdef _DEFINENAME_ -#if _DEFINENAME_DIRECTUV==1 -#define v_VARYINGNAME_UV vMainUV1 -#elif _DEFINENAME_DIRECTUV==2 -#define v_VARYINGNAME_UV vMainUV2 -#elif _DEFINENAME_DIRECTUV==3 -#define v_VARYINGNAME_UV vMainUV3 -#elif _DEFINENAME_DIRECTUV==4 -#define v_VARYINGNAME_UV vMainUV4 -#elif _DEFINENAME_DIRECTUV==5 -#define v_VARYINGNAME_UV vMainUV5 -#elif _DEFINENAME_DIRECTUV==6 -#define v_VARYINGNAME_UV vMainUV6 -#else -varying vec2 v_VARYINGNAME_UV; -#endif -uniform sampler2D _SAMPLERNAME_Sampler; -#endif -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=l);const t="bumpFragmentMainFunctions",n=`#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL) -#if defined(TANGENT) && defined(NORMAL) -varying mat3 vTBN; -#endif -#ifdef OBJECTSPACE_NORMALMAP -uniform mat4 normalMatrix; -#if defined(WEBGL2) || defined(WEBGPU) -mat4 toNormalMatrix(mat4 wMatrix) -{mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;} -#else -mat4 toNormalMatrix(mat4 m) -{float -a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3], -a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3], -a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3], -a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3], -b00=a00*a11-a01*a10, -b01=a00*a12-a02*a10, -b02=a00*a13-a03*a10, -b03=a01*a12-a02*a11, -b04=a01*a13-a03*a11, -b05=a02*a13-a03*a12, -b06=a20*a31-a21*a30, -b07=a20*a32-a22*a30, -b08=a20*a33-a23*a30, -b09=a21*a32-a22*a31, -b10=a21*a33-a23*a31, -b11=a22*a33-a23*a32, -det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4( -a11*b11-a12*b10+a13*b09, -a02*b10-a01*b11-a03*b09, -a31*b05-a32*b04+a33*b03, -a22*b04-a21*b05-a23*b03, -a12*b08-a10*b11-a13*b07, -a00*b11-a02*b08+a03*b07, -a32*b02-a30*b05-a33*b01, -a20*b05-a22*b02+a23*b01, -a10*b10-a11*b08+a13*b06, -a01*b08-a00*b10-a03*b06, -a30*b04-a31*b02+a33*b00, -a21*b02-a20*b04-a23*b00, -a11*b07-a10*b09-a12*b06, -a00*b09-a01*b07+a02*b06, -a31*b01-a30*b03-a32*b00, -a20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0], -mi[0][1],mi[1][1],mi[2][1],mi[3][1], -mi[0][2],mi[1][2],mi[2][2],mi[3][2], -mi[0][3],mi[1][3],mi[2][3],mi[3][3]);} -#endif -#endif -vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale) -{ -#ifdef NORMALXYSCALE -normal=normalize(normal*vec3(scale,scale,1.0)); -#endif -return normalize(cotangentFrame*normal);} -vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale) -{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);} -mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams) -{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);} -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=n);const r="bumpFragmentFunctions",m=`#if defined(BUMP) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump) -#endif -#if defined(DETAIL) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail) -#endif -#if defined(BUMP) && defined(PARALLAX) -const float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; icurrRayHeight) -{float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;} -else -{currRayHeight-=stepSize;vLastOffset=vCurrOffset; -#ifdef PARALLAX_RHS -vCurrOffset-=stepSize*vMaxOffset; -#else -vCurrOffset+=stepSize*vMaxOffset; -#endif -lastSampledHeight=currSampledHeight;}} -return vCurrOffset;} -vec2 parallaxOffset(vec3 viewDir,float heightScale) -{float height=texture2D(bumpSampler,vBumpUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height; -#ifdef PARALLAX_RHS -return texCoordOffset; -#else -return -texCoordOffset; -#endif -} -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=m);const i="bumpFragment",f=`vec2 uvOffset=vec2(0.0,0.0); -#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL) -#ifdef NORMALXYSCALE -float normalScale=1.0; -#elif defined(BUMP) -float normalScale=vBumpInfos.y; -#else -float normalScale=1.0; -#endif -#if defined(TANGENT) && defined(NORMAL) -mat3 TBN=vTBN; -#elif defined(BUMP) -vec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams); -#else -vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.)); -#endif -#elif defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -mat3 TBN=vTBN; -#else -vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.)); -#endif -#endif -#ifdef PARALLAX -mat3 invTBN=transposeMat3(TBN); -#ifdef PARALLAXOCCLUSION -uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z); -#else -uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z); -#endif -#endif -#ifdef DETAIL -vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB); -#endif -#ifdef BUMP -#ifdef OBJECTSPACE_NORMALMAP -#define CUSTOM_FRAGMENT_BUMP_FRAGMENT -normalW=normalize(texture2D(bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW); -#elif !defined(DETAIL) -normalW=perturbNormal(TBN,texture2D(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y); -#else -vec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0; -#if DETAIL_NORMALBLENDMETHOD==0 -detailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z)); -#elif DETAIL_NORMALBLENDMETHOD==1 -detailNormal.xy*=vDetailInfos.z;bumpNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal; -#endif -normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y); -#endif -#elif defined(DETAIL) -detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z); -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=f); diff --git a/assets/bumpVertex-DVPnlCbV.js b/assets/bumpVertex-DVPnlCbV.js deleted file mode 100644 index b992ee2ccfb9c63751227b2d6aab6f0979e7c675..0000000000000000000000000000000000000000 --- a/assets/bumpVertex-DVPnlCbV.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="bumpVertex",n=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2]; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=n); diff --git a/assets/bumpVertex-dKv8gF7O.js b/assets/bumpVertex-dKv8gF7O.js deleted file mode 100644 index 9aa0d280133578a9c45a1f3de5a860b02519cf10..0000000000000000000000000000000000000000 --- a/assets/bumpVertex-dKv8gF7O.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const n="bumpVertex",t=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal); -#endif -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=t); diff --git a/assets/bumpVertexDeclaration-DMtCfYrP.js b/assets/bumpVertexDeclaration-DMtCfYrP.js deleted file mode 100644 index 7b7634c221489ac2104b9ddcb854754aba40c958..0000000000000000000000000000000000000000 --- a/assets/bumpVertexDeclaration-DMtCfYrP.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const d="bumpVertexDeclaration",n=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -varying mat3 vTBN; -#endif -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=n); diff --git a/assets/bumpVertexDeclaration-p9pSA1UA.js b/assets/bumpVertexDeclaration-p9pSA1UA.js deleted file mode 100644 index b6c7f8999afc393de5198076b4d4fef463e16eaf..0000000000000000000000000000000000000000 --- a/assets/bumpVertexDeclaration-p9pSA1UA.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const d="bumpVertexDeclaration",n=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) -#if defined(TANGENT) && defined(NORMAL) -varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=n); diff --git a/assets/bvhFileLoader-DjFjUG50.js b/assets/bvhFileLoader-DjFjUG50.js deleted file mode 100644 index efc4060e154c148e9c709a75455dcc8b7bc1b159..0000000000000000000000000000000000000000 --- a/assets/bvhFileLoader-DjFjUG50.js +++ /dev/null @@ -1,3 +0,0 @@ -import{as as p,V as E,M as h,d as Y,ao as R,bf as g,ax as U}from"./index-GY9JDBGV.js";import{A as b}from"./assetContainer-X8dc1NDD.js";import{B as V}from"./bone-CnpD8dWY.js";import{S as D}from"./skeleton-CQeK9qOO.js";import"./index-DydPgVMC.js";import"./rawTexture-BDsvmix4.js";const O="Xposition",x="Yposition",F="Zposition",k="Xrotation",M="Yrotation",v="Zrotation",j="HIERARCHY",K="MOTION";class X{constructor(t){this.loopMode=p.ANIMATIONLOOPMODE_CYCLE,this.list=[],this.root=_(),this.numFrames=0,this.frameRate=0,this.skeleton=t}}function _(){return{name:"",type:"",offset:new E,channels:[],children:[],frames:[],parent:null}}function Z(){return{frame:0,position:new E,rotation:new R}}function z(n){const t=n.offset.x,o=n.offset.y,i=n.offset.z;return h.Translation(t,o,i)}function Q(n,t){if(n.frames.length===0)return[];const o=[],i=n.channels.some(f=>f===O||f===x||f===F),e=n.channels.some(f=>f===k||f===M||f===v),r=new p(`${n.name}_pos`,"position",t.frameRate,p.ANIMATIONTYPE_VECTOR3,t.loopMode),a=new p(`${n.name}_rot`,"rotationQuaternion",t.frameRate,p.ANIMATIONTYPE_QUATERNION,t.loopMode),s=[],l=[];for(let f=0;f0&&(r.setKeys(s),o.push(r)),l.length>0&&(a.setKeys(l),o.push(a)),o}function P(n,t,o){const i=z(n),e=new V(n.name,o.skeleton,t,i),r=Q(n,o);for(const a of r)a.getKeys()&&a.getKeys().length>0&&e.animations.push(a);for(const a of n.children)P(a,e,o)}function B(n,t,o,i){if(o.type==="ENDSITE")return;const e=Z();e.frame=t,e.position=new E,e.rotation=new R,o.frames.push(e);let r=h.Identity();for(let a=0;a0;){const l=n.shift()?.trim();if(l==="}")return e;l&&e.children.push(L(n,l,e,i))}throw new Error("Unexpected end of file: missing closing brace")}function T(n,t,o,i){const e=n.split(` -`),{loopMode:r}=i;t._blockEntityCollection=!!o;const a=new D("","",t);a._parentContainer=o,t._blockEntityCollection=!1;const s=new X(a);s.loopMode=r;const l=e.shift();if(!l||l.trim().toUpperCase()!==j)throw new Error("HIERARCHY expected");const f=e.shift();if(!f)throw new Error("Unexpected end of file after HIERARCHY");const c=L(e,f.trim(),null,s),m=e.shift();if(!m||m.trim().toUpperCase()!==K)throw new Error("MOTION expected");const y=e.shift();if(!y)throw new Error("Unexpected end of file before frame count");const C=y.trim().split(/[\s]+/);if(C.length<2)throw new Error("Invalid frame count line");const w=parseInt(C[1]);if(isNaN(w))throw new Error("Failed to read number of frames.");s.numFrames=w;const H=e.shift();if(!H)throw new Error("Unexpected end of file before frame time");const A=H.trim().split(/[\s]+/);if(A.length<3)throw new Error("Invalid frame time line");const u=parseFloat(A[2]);if(isNaN(u))throw new Error("Failed to read frame time.");if(u<=0)throw new Error("Failed to read frame time. Invalid value "+u);s.frameRate=1/u;for(let N=0;N{})}loadAssetContainerAsync(t,o){if(typeof o!="string")return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(o))return Promise.reject("BVH loader expects HIERARCHY header.");const i=new b(t);try{const e=T(o,t,i,this._loadingOptions);return i.skeletons.push(e),Promise.resolve(i)}catch(e){return Promise.reject(e)}}}U(new d);export{d as BVHFileLoader}; diff --git a/assets/c4Diagram-YG6GDRKO-CT6IHYx9.js b/assets/c4Diagram-YG6GDRKO-CT6IHYx9.js deleted file mode 100644 index 77a923091b6ae22abc8da4a4a2d4d40e5f74c9e0..0000000000000000000000000000000000000000 --- a/assets/c4Diagram-YG6GDRKO-CT6IHYx9.js +++ /dev/null @@ -1,10 +0,0 @@ -import{g as Oe,d as Re}from"./chunk-TZMSLE5B-xeQXGdbb.js";import{s as Se,g as De,a as Pe,b as Be,_ as g,c as Dt,l as he,d as Ie,e as Me,f as Tt,h as pe,i as Le,w as Ne,j as Jt,k as ue}from"./mermaid.core-BcqUqpnI.js";import{s as Nt}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var jt=(function(){var e=g(function(_t,x,m,v){for(m=m||{},v=_t.length;v--;m[_t[v]]=x);return m},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],y=[1,68],p=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],rt=[1,47],st=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],k=[1,82],A=[1,83],C=[1,84],w=[1,85],T=[12,14,42],re=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:g(function(x,m,v,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:k,77:A,79:C,80:w},{35:86,75:81,76:k,77:A,79:C,80:w},{35:87,75:81,76:k,77:A,79:C,80:w},{35:88,75:81,76:k,77:A,79:C,80:w},{35:89,75:81,76:k,77:A,79:C,80:w},{35:90,75:81,76:k,77:A,79:C,80:w},{35:91,75:81,76:k,77:A,79:C,80:w},{35:92,75:81,76:k,77:A,79:C,80:w},{35:93,75:81,76:k,77:A,79:C,80:w},{35:94,75:81,76:k,77:A,79:C,80:w},{35:95,75:81,76:k,77:A,79:C,80:w},{35:96,75:81,76:k,77:A,79:C,80:w},{35:97,75:81,76:k,77:A,79:C,80:w},{35:98,75:81,76:k,77:A,79:C,80:w},{35:99,75:81,76:k,77:A,79:C,80:w},{35:100,75:81,76:k,77:A,79:C,80:w},{35:101,75:81,76:k,77:A,79:C,80:w},{35:102,75:81,76:k,77:A,79:C,80:w},{35:103,75:81,76:k,77:A,79:C,80:w},{35:104,75:81,76:k,77:A,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:k,77:A,79:C,80:w},{35:106,75:81,76:k,77:A,79:C,80:w},{35:107,75:81,76:k,77:A,79:C,80:w},{35:108,75:81,76:k,77:A,79:C,80:w},{35:109,75:81,76:k,77:A,79:C,80:w},{35:110,75:81,76:k,77:A,79:C,80:w},{35:111,75:81,76:k,77:A,79:C,80:w},{35:112,75:81,76:k,77:A,79:C,80:w},{35:113,75:81,76:k,77:A,79:C,80:w},{35:114,75:81,76:k,77:A,79:C,80:w},{35:115,75:81,76:k,77:A,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:k,77:A,79:C,80:w},{35:120,75:81,76:k,77:A,79:C,80:w},{35:121,75:81,76:k,77:A,79:C,80:w},{35:122,75:81,76:k,77:A,79:C,80:w},{35:123,75:81,76:k,77:A,79:C,80:w},{35:124,75:81,76:k,77:A,79:C,80:w},{35:125,75:81,76:k,77:A,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(re,[2,71],{75:81,35:132,76:k,77:A,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(re,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:g(function(x,m){if(m.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=m,v}},"parseError"),parse:g(function(x){var m=this,v=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,se=0,Ae=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),kt={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(kt.yy[Ht]=this.yy[Ht]);D.setInput(x,kt.yy),kt.yy.lexer=D,kt.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}g(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=m.symbols_[L]||L),L}g(oe,"lex");for(var I,At,N,Gt,wt={},Mt,W,ce,Lt;;){if(At=v[v.length-1],this.defaultActions[At]?N=this.defaultActions[At]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[At]&&Rt[At][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[At])this.terminals_[Mt]&&Mt>Ae&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: -`+D.showPosition()+` -Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+I);switch(N[0]){case 1:v.push(I),R.push(D.yytext),h.push(D.yylloc),v.push(N[1]),I=null,se=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,se,Et,kt.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(v=v.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),v.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[v[v.length-2]][v[v.length-1]],v.push(ce);break;case 3:return!0}}return!0},"parse")},ke=(function(){var _t={EOF:1,parseError:g(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:g(function(x,m){return this.yy=m||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var m=x.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:g(function(x){var m=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===b.length?this.yylloc.first_column:0)+b[b.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(x){this.unput(this.match.slice(x))},"less"),pastInput:g(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var x=this.pastInput(),m=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+m+"^"},"showPosition"),test_match:g(function(x,m){var v,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,m,v,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hm[0].length)){if(m=v,b=h,this.options.backtrack_lexer){if(x=this.test_match(v,R[h]),x!==!1)return x;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(x=this.test_match(m,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var m=this.next();return m||this.lex()},"lex"),begin:g(function(m){this.conditionStack.push(m)},"begin"),popState:g(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:g(function(m){this.begin(m)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(m,v,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=ke;function It(){this.yy={}}return g(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=g(function(){return ye},"getC4Type"),Ue=g(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=g(function(e,t,s,o,l,a,r,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(y=>y.from===t&&y.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[y,p]=Object.entries(l)[0];u[y]={text:p}}else u.techn={text:l};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[y,p]=Object.entries(a)[0];u[y]={text:p}}else u.descr={text:a};if(typeof r=="object"){let[y,p]=Object.entries(r)[0];u[y]=p}else u.sprite=r;if(typeof n=="object"){let[y,p]=Object.entries(n)[0];u[y]=p}else u.tags=n;if(typeof i=="object"){let[y,p]=Object.entries(i)[0];u[y]=p}else u.link=i;u.wrap=mt()},"addRel"),Ve=g(function(e,t,s,o,l,a,r){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.tags=a;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.link=r;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=g(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=g(function(e,t,s,o,l,a,r,n,i,u,d){let y=V.find(p=>p.alias===t);if(!(y===void 0&&(y=X.find(p=>p.alias===t),y===void 0))){if(s!=null)if(typeof s=="object"){let[p,E]=Object.entries(s)[0];y[p]=E}else y.bgColor=s;if(o!=null)if(typeof o=="object"){let[p,E]=Object.entries(o)[0];y[p]=E}else y.fontColor=o;if(l!=null)if(typeof l=="object"){let[p,E]=Object.entries(l)[0];y[p]=E}else y.borderColor=l;if(a!=null)if(typeof a=="object"){let[p,E]=Object.entries(a)[0];y[p]=E}else y.shadowing=a;if(r!=null)if(typeof r=="object"){let[p,E]=Object.entries(r)[0];y[p]=E}else y.shape=r;if(n!=null)if(typeof n=="object"){let[p,E]=Object.entries(n)[0];y[p]=E}else y.sprite=n;if(i!=null)if(typeof i=="object"){let[p,E]=Object.entries(i)[0];y[p]=E}else y.techn=i;if(u!=null)if(typeof u=="object"){let[p,E]=Object.entries(u)[0];y[p]=E}else y.legendText=u;if(d!=null)if(typeof d=="object"){let[p,E]=Object.entries(d)[0];y[p]=E}else y.legendSprite=d}},"updateElStyle"),Ke=g(function(e,t,s,o,l,a,r){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(a);if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(r)}},"updateRelStyle"),Je=g(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const a=Object.values(t)[0];o=parseInt(a)}else o=parseInt(t);if(typeof s=="object"){const a=Object.values(s)[0];l=parseInt(a)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=g(function(){return Ut},"getC4ShapeInRow"),$e=g(function(){return Ft},"getC4BoundaryInRow"),t0=g(function(){return B},"getCurrentBoundaryParse"),e0=g(function(){return F},"getParentBoundaryParse"),ge=g(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=g(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=g(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=g(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,r0=g(function(){return Pt},"getRels"),s0=g(function(){return ee},"getTitle"),l0=g(function(e){ae=e},"setWrap"),mt=g(function(){return ae},"autoWrap"),o0=g(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=g(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:r0,getTitle:s0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:g(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=g(function(e,t){return Re(e,t)},"drawRect"),_e=g(function(e,t,s,o,l,a){const r=e.append("image");r.attr("width",t),r.attr("height",s),r.attr("x",o),r.attr("y",l);let n=a.startsWith("data:image/png;base64")?a:Le.sanitizeUrl(a);r.attr("xlink:href",n)},"drawImage"),f0=g((e,t,s)=>{const o=e.append("g");let l=0;for(let a of t){let r=a.textColor?a.textColor:"#444444",n=a.lineColor?a.lineColor:"#444444",i=a.offsetX?parseInt(a.offsetX):0,u=a.offsetY?parseInt(a.offsetY):0,d="";if(l===0){let p=o.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",n),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)"),l=-1}else{let p=o.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",n).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)")}let y=s.messageFont();Q(s)(a.label.text,o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+u,a.label.width,a.label.height,{fill:r},y),a.techn&&a.techn.text!==""&&(y=s.messageFont(),Q(s)("["+a.techn.text+"]",o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+u,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:r,"font-style":"italic"},y))}},"drawRels"),p0=g(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",a=t.borderColor?t.borderColor:"#444444",r=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=r,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=r,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=r,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=g(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],a=t.fontColor?t.fontColor:"#FFFFFF",r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,r);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=a,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:a},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=a,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:a,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:a,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=a,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:a},d)),t.height},"drawC4Shape"),g0=g(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=g(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=g(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=g(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=g(function(e){e.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=g(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=g(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),k0=g(function(e){const s=e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);s.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),s.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,a,r,n,i,u,d){const y=a.append("text").attr("x",r+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(y,d)}g(e,"byText");function t(l,a,r,n,i,u,d,y){const{fontSize:p,fontFamily:E,fontWeight:O}=y,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=g(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=g(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),C0=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let a=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=a.length;let r=0;t[e].height=0,t[e].width=0;for(const n of a)t[e].width=Math.max(Tt(n,o),t[e].width),r=ue(n,o),t[e].height=t[e].height+r}}g(j,"calcC4ShapeTextWH");var ve=g(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let a=Tt(t.label.text,l);j("label",t,o,l,a),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=g(function(e,t,s,o){let l=0;for(const a of o){l=0;const r=s[a];let n=St(_,r.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,r.typeC4Shape.width=Tt("«"+r.typeC4Shape.text+"»",n),r.typeC4Shape.height=n.fontSize+2,r.typeC4Shape.Y=_.c4ShapePadding,l=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height;break}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height);let i=r.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,r.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",r,i,d,u),r.label.Y=l+8,l=r.label.Y+r.label.height,r.type&&r.type.text!==""){r.type.text="["+r.type.text+"]";let E=St(_,r.typeC4Shape.text);j("type",r,i,E,u),r.type.Y=l+5,l=r.type.Y+r.type.height}else if(r.techn&&r.techn.text!==""){r.techn.text="["+r.techn.text+"]";let E=St(_,r.techn.text);j("techn",r,i,E,u),r.techn.Y=l+5,l=r.techn.Y+r.techn.height}let y=l,p=r.label.width;if(r.descr&&r.descr.text!==""){let E=St(_,r.typeC4Shape.text);j("descr",r,i,E,u),r.descr.Y=l+20,l=r.descr.Y+r.descr.height,p=Math.max(r.label.width,r.descr.width),y=l-r.descr.textLines*5}p=p+_.c4ShapePadding,r.width=Math.max(r.width||_.width,p,_.width),r.height=Math.max(r.height||_.height,y,_.height),r.margin=r.margin||_.c4ShapeMargin,e.insert(r),z.drawC4Shape(t,r,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{g(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=g(function(e,t){let s=e.x,o=e.y,l=t.x,a=t.y,r=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-a),d=u/i,y=e.height/e.width,p=null;return o==a&&sl?p=new Y(s,n):s==l&&oa&&(p=new Y(r,o)),s>l&&o=d?p=new Y(s,n+d*e.width/2):p=new Y(r-i/u*e.height/2,o+e.height):s=d?p=new Y(s+e.width,n+d*e.width/2):p=new Y(r+i/u*e.height/2,o+e.height):sa?y>=d?p=new Y(s+e.width,n-d*e.width/2):p=new Y(r+e.height/2*i/u,o):s>l&&o>a&&(y>=d?p=new Y(s,n-e.width/2*d):p=new Y(r-e.height/2*i/u,o)),p},"getIntersectPoint"),w0=g(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),T0=g(function(e,t,s,o){let l=0;for(let a of t){l=l+1;let r=a.wrap&&_.wrap,n=C0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=l+": "+a.label.text);let u=Tt(a.label.text,n);j("label",a,r,n,u),a.techn&&a.techn.text!==""&&(u=Tt(a.techn.text,n),j("techn",a,r,n,u)),a.descr&&a.descr.text!==""&&(u=Tt(a.descr.text,n),j("descr",a,r,n,u));let d=s(a.from),y=s(a.to),p=w0(d,y);a.startPoint=p.startPoint,a.endPoint=p.endPoint}z.drawRels(e,t,_)},"drawRels");function ne(e,t,s,o,l){let a=new me(l);a.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[r,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,a.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,a.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,a.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(r==0||r%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;a.setData(O,O,S,S)}else{let O=a.data.stopx!==a.data.startx?a.data.stopx+_.diagramMarginX:a.data.startx,S=a.data.starty;a.setData(O,O,S,S)}a.name=n.alias;let y=l.db.getC4ShapeArray(n.alias),p=l.db.getC4ShapeKeys(n.alias);p.length>0&&Ee(a,e,y,p),t=n.alias;let E=l.db.getBoundaries(t);E.length>0&&ne(e,t,a,E,l),n.alias!=="global"&&ve(e,n,a),s.data.stopy=Math.max(a.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(a.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}g(ne,"drawInsideBoundary");var O0=g(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let a;l==="sandbox"&&(a=Nt("#i"+t));const r=l==="sandbox"?Nt(a.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?r.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i),z.insertDatabaseIcon(i),z.insertClockIcon(i);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let y=o.db.getBoundaries("");ne(i,"",u,y,o),z.insertArrowHead(i),z.insertArrowEnd(i),z.insertArrowCrossHead(i),z.insertArrowFilledHead(i),T0(i,o.db.getRels(),o.db.getC4Shape,o),u.data.stopx=Vt,u.data.stopy=zt;const p=u.data;let O=p.stopy-p.starty+2*_.diagramMarginY;const P=p.stopx-p.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(p.stopx-p.startx)/2-4*_.diagramMarginX).attr("y",p.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",p.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",p)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:O0},R0=g(e=>`.person { - stroke: ${e.personBorder}; - fill: ${e.personBkg}; - } -`,"getStyles"),S0=R0,Y0={parser:Ye,db:Zt,renderer:fe,styles:S0,init:g(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{Y0 as diagram}; diff --git a/assets/channel-Dg8q-JvW.js b/assets/channel-Dg8q-JvW.js deleted file mode 100644 index fa2546f047fb829b0b5c7abc2a1931a5a3362f3d..0000000000000000000000000000000000000000 --- a/assets/channel-Dg8q-JvW.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,C as n}from"./mermaid.core-BcqUqpnI.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/assets/chunk-4BX2VUAB-BSrsJ5gp.js b/assets/chunk-4BX2VUAB-BSrsJ5gp.js deleted file mode 100644 index d06932feaef9b2d00f3362d7e039bffec505355d..0000000000000000000000000000000000000000 --- a/assets/chunk-4BX2VUAB-BSrsJ5gp.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./mermaid.core-BcqUqpnI.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/assets/chunk-55IACEB6-CzYB-Zls.js b/assets/chunk-55IACEB6-CzYB-Zls.js deleted file mode 100644 index 0784d8b4a88ae94695ec69a8d9ffbad6ed673f38..0000000000000000000000000000000000000000 --- a/assets/chunk-55IACEB6-CzYB-Zls.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s}from"./mermaid.core-BcqUqpnI.js";import{s as o}from"./select-BigU4G0v.js";var d=s((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/assets/chunk-B4BG7PRW-C6IGDcdb.js b/assets/chunk-B4BG7PRW-C6IGDcdb.js deleted file mode 100644 index 8f72ac0851347a1c3f611234bcac9799a36eb264..0000000000000000000000000000000000000000 --- a/assets/chunk-B4BG7PRW-C6IGDcdb.js +++ /dev/null @@ -1,165 +0,0 @@ -import{g as Ze}from"./chunk-FMBD7UC4-Drrjy9J2.js";import{g as $e}from"./chunk-55IACEB6-CzYB-Zls.js";import{s as et}from"./chunk-QN33PNHL-DUQNEUQT.js";import{_ as p,l as ve,c as D,o as tt,r as st,u as Ie,b as it,a as at,s as nt,g as rt,p as ut,q as lt,j as x,y as ot,x as ct,h as ht,R as M}from"./mermaid.core-BcqUqpnI.js";import{s as J}from"./select-BigU4G0v.js";var Oe=(function(){var e=p(function(v,l,o,d){for(o=o||{},d=v.length;d--;o[v[d]]=l);return o},"o"),i=[1,18],r=[1,19],u=[1,20],a=[1,41],c=[1,42],A=[1,26],f=[1,24],k=[1,25],_=[1,32],he=[1,33],de=[1,34],m=[1,45],pe=[1,35],Ae=[1,36],fe=[1,37],ge=[1,38],me=[1,27],Ce=[1,28],be=[1,29],Ee=[1,30],ye=[1,31],C=[1,44],b=[1,46],E=[1,43],y=[1,47],Te=[1,9],h=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],ke=[1,63],De=[1,64],R=[1,8,9,41],we=[1,76],V=[1,8,9,12,13,22,39,41,44,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,50,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],Ve=[13,60,68,69,70,71,72,86,100,102,103],Fe=[1,100],U=[1,117],z=[1,113],K=[1,109],Y=[1,115],j=[1,110],Q=[1,111],W=[1,112],X=[1,114],q=[1,116],Pe=[22,48,60,61,82,86,87,88,89,90],Be=[1,8,9,39,41,44],ne=[1,8,9,22],Me=[1,145],Re=[1,8,9,61],N=[1,8,9,22,48,60,61,82,86,87,88,89,90],_e={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,emptyBody:47,SPACE:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",48:"SPACE",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[43,2],[43,3],[47,0],[47,2],[47,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:p(function(l,o,d,n,g,t,H){var s=t.length-1;switch(g){case 8:this.$=t[s-1];break;case 9:case 10:case 13:case 15:this.$=t[s];break;case 11:case 14:this.$=t[s-2]+"."+t[s];break;case 12:case 16:this.$=t[s-1]+t[s];break;case 17:case 18:this.$=t[s-1]+"~"+t[s]+"~";break;case 19:n.addRelation(t[s]);break;case 20:t[s-1].title=n.cleanupLabel(t[s]),n.addRelation(t[s-1]);break;case 31:this.$=t[s].trim(),n.setAccTitle(this.$);break;case 32:case 33:this.$=t[s].trim(),n.setAccDescription(this.$);break;case 34:n.addClassesToNamespace(t[s-3],t[s-1]);break;case 35:n.addClassesToNamespace(t[s-4],t[s-1]);break;case 36:this.$=t[s],n.addNamespace(t[s]);break;case 37:this.$=[t[s]];break;case 38:this.$=[t[s-1]];break;case 39:t[s].unshift(t[s-2]),this.$=t[s];break;case 41:n.setCssClass(t[s-2],t[s]);break;case 42:n.addMembers(t[s-3],t[s-1]);break;case 44:n.setCssClass(t[s-5],t[s-3]),n.addMembers(t[s-5],t[s-1]);break;case 45:this.$=t[s],n.addClass(t[s]);break;case 46:this.$=t[s-1],n.addClass(t[s-1]),n.setClassLabel(t[s-1],t[s]);break;case 50:n.addAnnotation(t[s],t[s-2]);break;case 51:case 64:this.$=[t[s]];break;case 52:t[s].push(t[s-1]),this.$=t[s];break;case 53:break;case 54:n.addMember(t[s-1],n.cleanupLabel(t[s]));break;case 55:break;case 56:break;case 57:this.$={id1:t[s-2],id2:t[s],relation:t[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 58:this.$={id1:t[s-3],id2:t[s],relation:t[s-1],relationTitle1:t[s-2],relationTitle2:"none"};break;case 59:this.$={id1:t[s-3],id2:t[s],relation:t[s-2],relationTitle1:"none",relationTitle2:t[s-1]};break;case 60:this.$={id1:t[s-4],id2:t[s],relation:t[s-2],relationTitle1:t[s-3],relationTitle2:t[s-1]};break;case 61:n.addNote(t[s],t[s-1]);break;case 62:n.addNote(t[s]);break;case 63:this.$=t[s-2],n.defineClass(t[s-1],t[s]);break;case 65:this.$=t[s-2].concat([t[s]]);break;case 66:n.setDirection("TB");break;case 67:n.setDirection("BT");break;case 68:n.setDirection("RL");break;case 69:n.setDirection("LR");break;case 70:this.$={type1:t[s-2],type2:t[s],lineType:t[s-1]};break;case 71:this.$={type1:"none",type2:t[s],lineType:t[s-1]};break;case 72:this.$={type1:t[s-1],type2:"none",lineType:t[s]};break;case 73:this.$={type1:"none",type2:"none",lineType:t[s]};break;case 74:this.$=n.relationType.AGGREGATION;break;case 75:this.$=n.relationType.EXTENSION;break;case 76:this.$=n.relationType.COMPOSITION;break;case 77:this.$=n.relationType.DEPENDENCY;break;case 78:this.$=n.relationType.LOLLIPOP;break;case 79:this.$=n.lineType.LINE;break;case 80:this.$=n.lineType.DOTTED_LINE;break;case 81:case 87:this.$=t[s-2],n.setClickEvent(t[s-1],t[s]);break;case 82:case 88:this.$=t[s-3],n.setClickEvent(t[s-2],t[s-1]),n.setTooltip(t[s-2],t[s]);break;case 83:this.$=t[s-2],n.setLink(t[s-1],t[s]);break;case 84:this.$=t[s-3],n.setLink(t[s-2],t[s-1],t[s]);break;case 85:this.$=t[s-3],n.setLink(t[s-2],t[s-1]),n.setTooltip(t[s-2],t[s]);break;case 86:this.$=t[s-4],n.setLink(t[s-3],t[s-2],t[s]),n.setTooltip(t[s-3],t[s-1]);break;case 89:this.$=t[s-3],n.setClickEvent(t[s-2],t[s-1],t[s]);break;case 90:this.$=t[s-4],n.setClickEvent(t[s-3],t[s-2],t[s-1]),n.setTooltip(t[s-3],t[s]);break;case 91:this.$=t[s-3],n.setLink(t[s-2],t[s]);break;case 92:this.$=t[s-4],n.setLink(t[s-3],t[s-1],t[s]);break;case 93:this.$=t[s-4],n.setLink(t[s-3],t[s-1]),n.setTooltip(t[s-3],t[s]);break;case 94:this.$=t[s-5],n.setLink(t[s-4],t[s-2],t[s]),n.setTooltip(t[s-4],t[s-1]);break;case 95:this.$=t[s-2],n.setCssStyle(t[s-1],t[s]);break;case 96:n.setCssClass(t[s-1],t[s]);break;case 97:this.$=[t[s]];break;case 98:t[s-2].push(t[s]),this.$=t[s-2];break;case 100:this.$=t[s-1]+t[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:r,37:u,38:22,42:a,43:23,46:c,49:A,51:f,52:k,54:_,56:he,57:de,60:m,62:pe,63:Ae,64:fe,65:ge,75:me,76:Ce,78:be,82:Ee,83:ye,86:C,100:b,102:E,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(Te,[2,5],{8:[1,48]}),{8:[1,49]},e(h,[2,19],{22:[1,50]}),e(h,[2,21]),e(h,[2,22]),e(h,[2,23]),e(h,[2,24]),e(h,[2,25]),e(h,[2,26]),e(h,[2,27]),e(h,[2,28]),e(h,[2,29]),e(h,[2,30]),{34:[1,51]},{36:[1,52]},e(h,[2,33]),e(h,[2,53],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:ke,74:De}),{39:[1,65]},e(R,[2,40],{39:[1,67],44:[1,66]}),e(h,[2,55]),e(h,[2,56]),{16:68,60:m,86:C,100:b,102:E},{16:39,17:40,19:69,60:m,86:C,100:b,102:E,103:y},{16:39,17:40,19:70,60:m,86:C,100:b,102:E,103:y},{16:39,17:40,19:71,60:m,86:C,100:b,102:E,103:y},{60:[1,72]},{13:[1,73]},{16:39,17:40,19:74,60:m,86:C,100:b,102:E,103:y},{13:we,55:75},{58:77,60:[1,78]},e(h,[2,66]),e(h,[2,67]),e(h,[2,68]),e(h,[2,69]),e(V,[2,13],{16:39,17:40,19:80,18:[1,79],20:[1,81],60:m,86:C,100:b,102:E,103:y}),e(V,[2,15],{20:[1,82]}),{15:83,16:84,17:85,60:m,86:C,100:b,102:E,103:y},{16:39,17:40,19:86,60:m,86:C,100:b,102:E,103:y},e(ie,[2,123]),e(ie,[2,124]),e(ie,[2,125]),e(ie,[2,126]),e([1,8,9,12,13,20,22,39,41,44,68,69,70,71,72,73,74,79,81],[2,127]),e(Te,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:87,33:i,35:r,37:u,42:a,46:c,49:A,51:f,52:k,54:_,56:he,57:de,60:m,62:pe,63:Ae,64:fe,65:ge,75:me,76:Ce,78:be,82:Ee,83:ye,86:C,100:b,102:E,103:y}),{5:88,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:r,37:u,38:22,42:a,43:23,46:c,49:A,51:f,52:k,54:_,56:he,57:de,60:m,62:pe,63:Ae,64:fe,65:ge,75:me,76:Ce,78:be,82:Ee,83:ye,86:C,100:b,102:E,103:y},e(h,[2,20]),e(h,[2,31]),e(h,[2,32]),{13:[1,90],16:39,17:40,19:89,60:m,86:C,100:b,102:E,103:y},{53:91,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:ke,74:De},e(h,[2,54]),{67:92,73:ke,74:De},e(ae,[2,73],{66:93,68:Z,69:$,70:ee,71:te,72:se}),e(G,[2,74]),e(G,[2,75]),e(G,[2,76]),e(G,[2,77]),e(G,[2,78]),e(Ve,[2,79]),e(Ve,[2,80]),{8:[1,95],24:96,40:94,43:23,46:c},{16:97,60:m,86:C,100:b,102:E},{41:[1,99],45:98,51:Fe},{50:[1,101]},{13:[1,102]},{13:[1,103]},{79:[1,104],81:[1,105]},{22:U,48:z,59:106,60:K,82:Y,84:107,85:108,86:j,87:Q,88:W,89:X,90:q},{60:[1,118]},{13:we,55:119},e(h,[2,62]),e(h,[2,128]),{22:U,48:z,59:120,60:K,61:[1,121],82:Y,84:107,85:108,86:j,87:Q,88:W,89:X,90:q},e(Pe,[2,64]),{16:39,17:40,19:122,60:m,86:C,100:b,102:E,103:y},e(V,[2,16]),e(V,[2,17]),e(V,[2,18]),{39:[2,36]},{15:124,16:84,17:85,18:[1,123],39:[2,9],60:m,86:C,100:b,102:E,103:y},{39:[2,10]},e(Be,[2,45],{11:125,12:[1,126]}),e(Te,[2,7]),{9:[1,127]},e(ne,[2,57]),{16:39,17:40,19:128,60:m,86:C,100:b,102:E,103:y},{13:[1,130],16:39,17:40,19:129,60:m,86:C,100:b,102:E,103:y},e(ae,[2,72],{66:131,68:Z,69:$,70:ee,71:te,72:se}),e(ae,[2,71]),{41:[1,132]},{24:96,40:133,43:23,46:c},{8:[1,134],41:[2,37]},e(R,[2,41],{39:[1,135]}),{41:[1,136]},e(R,[2,43]),{41:[2,51],45:137,51:Fe},{16:39,17:40,19:138,60:m,86:C,100:b,102:E,103:y},e(h,[2,81],{13:[1,139]}),e(h,[2,83],{13:[1,141],77:[1,140]}),e(h,[2,87],{13:[1,142],80:[1,143]}),{13:[1,144]},e(h,[2,95],{61:Me}),e(Re,[2,97],{85:146,22:U,48:z,60:K,82:Y,86:j,87:Q,88:W,89:X,90:q}),e(N,[2,99]),e(N,[2,101]),e(N,[2,102]),e(N,[2,103]),e(N,[2,104]),e(N,[2,105]),e(N,[2,106]),e(N,[2,107]),e(N,[2,108]),e(N,[2,109]),e(h,[2,96]),e(h,[2,61]),e(h,[2,63],{61:Me}),{60:[1,147]},e(V,[2,14]),{15:148,16:84,17:85,60:m,86:C,100:b,102:E,103:y},{39:[2,12]},e(Be,[2,46]),{13:[1,149]},{1:[2,4]},e(ne,[2,59]),e(ne,[2,58]),{16:39,17:40,19:150,60:m,86:C,100:b,102:E,103:y},e(ae,[2,70]),e(h,[2,34]),{41:[1,151]},{24:96,40:152,41:[2,38],43:23,46:c},{45:153,51:Fe},e(R,[2,42]),{41:[2,52]},e(h,[2,50]),e(h,[2,82]),e(h,[2,84]),e(h,[2,85],{77:[1,154]}),e(h,[2,88]),e(h,[2,89],{13:[1,155]}),e(h,[2,91],{13:[1,157],77:[1,156]}),{22:U,48:z,60:K,82:Y,84:158,85:108,86:j,87:Q,88:W,89:X,90:q},e(N,[2,100]),e(Pe,[2,65]),{39:[2,11]},{14:[1,159]},e(ne,[2,60]),e(h,[2,35]),{41:[2,39]},{41:[1,160]},e(h,[2,86]),e(h,[2,90]),e(h,[2,92]),e(h,[2,93],{77:[1,161]}),e(Re,[2,98],{85:146,22:U,48:z,60:K,82:Y,86:j,87:Q,88:W,89:X,90:q}),e(Be,[2,8]),e(R,[2,44]),e(h,[2,94])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,36],85:[2,10],124:[2,12],127:[2,4],137:[2,52],148:[2,11],152:[2,39]},parseError:p(function(l,o){if(o.recoverable)this.trace(l);else{var d=new Error(l);throw d.hash=o,d}},"parseError"),parse:p(function(l){var o=this,d=[0],n=[],g=[null],t=[],H=this.table,s="",ue=0,Ge=0,Xe=2,Ue=1,qe=t.slice.call(arguments,1),T=Object.create(this.lexer),I={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(I.yy[Se]=this.yy[Se]);T.setInput(l,I.yy),I.yy.lexer=T,I.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var Ne=T.yylloc;t.push(Ne);var He=T.options&&T.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Je(B){d.length=d.length-2*B,g.length=g.length-B,t.length=t.length-B}p(Je,"popStack");function ze(){var B;return B=n.pop()||T.lex()||Ue,typeof B!="number"&&(B instanceof Array&&(n=B,B=n.pop()),B=o.symbols_[B]||B),B}p(ze,"lex");for(var F,O,S,Le,P={},le,L,Ke,oe;;){if(O=d[d.length-1],this.defaultActions[O]?S=this.defaultActions[O]:((F===null||typeof F>"u")&&(F=ze()),S=H[O]&&H[O][F]),typeof S>"u"||!S.length||!S[0]){var xe="";oe=[];for(le in H[O])this.terminals_[le]&&le>Xe&&oe.push("'"+this.terminals_[le]+"'");T.showPosition?xe="Parse error on line "+(ue+1)+`: -`+T.showPosition()+` -Expecting `+oe.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xe="Parse error on line "+(ue+1)+": Unexpected "+(F==Ue?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xe,{text:T.match,token:this.terminals_[F]||F,line:T.yylineno,loc:Ne,expected:oe})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+F);switch(S[0]){case 1:d.push(F),g.push(T.yytext),t.push(T.yylloc),d.push(S[1]),F=null,Ge=T.yyleng,s=T.yytext,ue=T.yylineno,Ne=T.yylloc;break;case 2:if(L=this.productions_[S[1]][1],P.$=g[g.length-L],P._$={first_line:t[t.length-(L||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(L||1)].first_column,last_column:t[t.length-1].last_column},He&&(P._$.range=[t[t.length-(L||1)].range[0],t[t.length-1].range[1]]),Le=this.performAction.apply(P,[s,Ge,ue,I.yy,S[1],g,t].concat(qe)),typeof Le<"u")return Le;L&&(d=d.slice(0,-1*L*2),g=g.slice(0,-1*L),t=t.slice(0,-1*L)),d.push(this.productions_[S[1]][0]),g.push(P.$),t.push(P._$),Ke=H[d[d.length-2]][d[d.length-1]],d.push(Ke);break;case 3:return!0}}return!0},"parse")},We=(function(){var v={EOF:1,parseError:p(function(o,d){if(this.yy.parser)this.yy.parser.parseError(o,d);else throw new Error(o)},"parseError"),setInput:p(function(l,o){return this.yy=o||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var o=l.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:p(function(l){var o=l.length,d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===n.length?this.yylloc.first_column:0)+n[n.length-d.length].length-d[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(l){this.unput(this.match.slice(l))},"less"),pastInput:p(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var l=this.pastInput(),o=new Array(l.length+1).join("-");return l+this.upcomingInput()+` -`+o+"^"},"showPosition"),test_match:p(function(l,o){var d,n,g;if(this.options.backtrack_lexer&&(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(g.yylloc.range=this.yylloc.range.slice(0))),n=l[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],d=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var t in g)this[t]=g[t];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,o,d,n;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),t=0;to[0].length)){if(o=d,n=t,this.options.backtrack_lexer){if(l=this.test_match(d,g[t]),l!==!1)return l;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(l=this.test_match(o,g[n]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:p(function(o,d,n,g){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:return this.popState(),41;case 34:return"EOF_IN_STRUCT";case 35:return 8;case 36:break;case 37:return"EDGE_STATE";case 38:return this.begin("class"),46;case 39:return this.popState(),8;case 40:break;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 43:return this.popState(),41;case 44:return"EOF_IN_STRUCT";case 45:return"EDGE_STATE";case 46:return"OPEN_IN_STRUCT";case 47:break;case 48:return"MEMBER";case 49:return 83;case 50:return 75;case 51:return 76;case 52:return 78;case 53:return 54;case 54:return 56;case 55:return 49;case 56:return 50;case 57:return 81;case 58:this.popState();break;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 61:this.popState();break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:return 77;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 69;case 69:return 69;case 70:return 71;case 71:return 71;case 72:return 70;case 73:return 68;case 74:return 72;case 75:return 73;case 76:return 74;case 77:return 22;case 78:return 44;case 79:return 100;case 80:return 18;case 81:return"PLUS";case 82:return 87;case 83:return 61;case 84:return 89;case 85:return 89;case 86:return 90;case 87:return"EQUALS";case 88:return"EQUALS";case 89:return 60;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 86;case 94:return 102;case 95:return 48;case 96:return 48;case 97:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return v})();_e.lexer=We;function re(){this.yy={}}return p(re,"Parser"),re.prototype=_e,_e.Parser=re,new re})();Oe.parser=Oe;var yt=Oe,Ye=["#","+","~","-",""],je=class{static{p(this,"ClassMember")}constructor(e,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const r=ht(e,D());this.parseMember(r)}getDisplayDetails(){let e=this.visibility+M(this.id);this.memberType==="method"&&(e+=`(${M(this.parameters.trim())})`,this.returnType&&(e+=" : "+M(this.returnType))),e=e.trim();const i=this.parseClassifier();return{displayText:e,cssStyle:i}}parseMember(e){let i="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const c=a[1]?a[1].trim():"";if(Ye.includes(c)&&(this.visibility=c),this.id=a[2],this.parameters=a[3]?a[3].trim():"",i=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",i===""){const A=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(A)&&(i=A,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const u=e.length,a=e.substring(0,1),c=e.substring(u-1);Ye.includes(a)&&(this.visibility=a),/[$*]/.exec(c)&&(i=c),this.id=e.substring(this.visibility===""?0:1,i===""?u:u-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const r=`${this.visibility?"\\"+this.visibility:""}${M(this.id)}${this.memberType==="method"?`(${M(this.parameters)})${this.returnType?" : "+M(this.returnType):""}`:""}`;this.text=r.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},ce="classId-",Qe=0,w=p(e=>x.sanitizeText(e,D()),"sanitizeText"),Tt=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=p(e=>{let i=J(".mermaidTooltip");(i._groups||i)[0][0]===null&&(i=J("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),J(e).select("svg").selectAll("g.node").on("mouseover",a=>{const c=J(a.currentTarget);if(c.attr("title")===null)return;const f=this.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(c.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.top-14+document.body.scrollTop+"px"),i.html(i.html().replace(/<br\/>/g,"
                ")),c.classed("hover",!0)}).on("mouseout",a=>{i.transition().duration(500).style("opacity",0),J(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=it,this.getAccTitle=at,this.setAccDescription=nt,this.getAccDescription=rt,this.setDiagramTitle=ut,this.getDiagramTitle=lt,this.getConfig=p(()=>D().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{p(this,"ClassDB")}splitClassNameAndType(e){const i=x.sanitizeText(e,D());let r="",u=i;if(i.indexOf("~")>0){const a=i.split("~");u=w(a[0]),r=w(a[1])}return{className:u,type:r}}setClassLabel(e,i){const r=x.sanitizeText(e,D());i&&(i=w(i));const{className:u}=this.splitClassNameAndType(r);this.classes.get(u).label=i,this.classes.get(u).text=`${i}${this.classes.get(u).type?`<${this.classes.get(u).type}>`:""}`}addClass(e){const i=x.sanitizeText(e,D()),{className:r,type:u}=this.splitClassNameAndType(i);if(this.classes.has(r))return;const a=x.sanitizeText(r,D());this.classes.set(a,{id:a,type:u,label:a,text:`${a}${u?`<${u}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:ce+a+"-"+Qe}),Qe++}addInterface(e,i){const r={id:`interface${this.interfaces.length}`,label:e,classId:i};this.interfaces.push(r)}lookUpDomId(e){const i=x.sanitizeText(e,D());if(this.classes.has(i))return this.classes.get(i).domId;throw new Error("Class not found: "+i)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",ot()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(e){ve.debug("Adding relation: "+JSON.stringify(e));const i=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!i.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!i.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=x.sanitizeText(e.relationTitle1.trim(),D()),e.relationTitle2=x.sanitizeText(e.relationTitle2.trim(),D()),this.relations.push(e)}addAnnotation(e,i){const r=this.splitClassNameAndType(e).className;this.classes.get(r).annotations.push(i)}addMember(e,i){this.addClass(e);const r=this.splitClassNameAndType(e).className,u=this.classes.get(r);if(typeof i=="string"){const a=i.trim();a.startsWith("<<")&&a.endsWith(">>")?u.annotations.push(w(a.substring(2,a.length-2))):a.indexOf(")")>0?u.methods.push(new je(a,"method")):a&&u.members.push(new je(a,"attribute"))}}addMembers(e,i){Array.isArray(i)&&(i.reverse(),i.forEach(r=>this.addMember(e,r)))}addNote(e,i){const r={id:`note${this.notes.length}`,class:i,text:e};this.notes.push(r)}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),w(e.trim())}setCssClass(e,i){e.split(",").forEach(r=>{let u=r;/\d/.exec(r[0])&&(u=ce+u);const a=this.classes.get(u);a&&(a.cssClasses+=" "+i)})}defineClass(e,i){for(const r of e){let u=this.styleClasses.get(r);u===void 0&&(u={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,u)),i&&i.forEach(a=>{if(/color/.exec(a)){const c=a.replace("fill","bgFill");u.textStyles.push(c)}u.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(r)&&a.styles.push(...i.flatMap(c=>c.split(",")))})}}setTooltip(e,i){e.split(",").forEach(r=>{i!==void 0&&(this.classes.get(r).tooltip=w(i))})}getTooltip(e,i){return i&&this.namespaces.has(i)?this.namespaces.get(i).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,i,r){const u=D();e.split(",").forEach(a=>{let c=a;/\d/.exec(a[0])&&(c=ce+c);const A=this.classes.get(c);A&&(A.link=Ie.formatUrl(i,u),u.securityLevel==="sandbox"?A.linkTarget="_top":typeof r=="string"?A.linkTarget=w(r):A.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,i,r){e.split(",").forEach(u=>{this.setClickFunc(u,i,r),this.classes.get(u).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,i,r){const u=x.sanitizeText(e,D());if(D().securityLevel!=="loose"||i===void 0)return;const c=u;if(this.classes.has(c)){const A=this.lookUpDomId(c);let f=[];if(typeof r=="string"){f=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let k=0;k{const k=document.querySelector(`[id="${A}"]`);k!==null&&k.addEventListener("click",()=>{Ie.runFunc(i,...f)},!1)})}}bindFunctions(e){this.functions.forEach(i=>{i(e)})}getDirection(){return this.direction}setDirection(e){this.direction=e}addNamespace(e){this.namespaces.has(e)||(this.namespaces.set(e,{id:e,classes:new Map,children:{},domId:ce+e+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,i){if(this.namespaces.has(e))for(const r of i){const{className:u}=this.splitClassNameAndType(r);this.classes.get(u).parent=e,this.namespaces.get(e).classes.set(u,this.classes.get(u))}}setCssStyle(e,i){const r=this.classes.get(e);if(!(!i||!r))for(const u of i)u.includes(",")?r.styles.push(...u.split(",")):r.styles.push(u)}getArrowMarker(e){let i;switch(e){case 0:i="aggregation";break;case 1:i="extension";break;case 2:i="composition";break;case 3:i="dependency";break;case 4:i="lollipop";break;default:i="none"}return i}getData(){const e=[],i=[],r=D();for(const a of this.namespaces.keys()){const c=this.namespaces.get(a);if(c){const A={id:c.id,label:c.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:r.look};e.push(A)}}for(const a of this.classes.keys()){const c=this.classes.get(a);if(c){const A=c;A.parentId=c.parent,A.look=r.look,e.push(A)}}let u=0;for(const a of this.notes){u++;const c={id:a.id,label:a.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look};e.push(c);const A=this.classes.get(a.class)?.id??"";if(A){const f={id:`edgeNote${u}`,start:a.id,end:A,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};i.push(f)}}for(const a of this.interfaces){const c={id:a.id,label:a.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};e.push(c)}u=0;for(const a of this.relations){u++;const c={id:ct(a.id1,a.id2,{prefix:"id",counter:u}),start:a.id1,end:a.id2,type:"normal",label:a.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(a.relation.type1),arrowTypeEnd:this.getArrowMarker(a.relation.type2),startLabelRight:a.relationTitle1==="none"?"":a.relationTitle1,endLabelLeft:a.relationTitle2==="none"?"":a.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:a.style||"",pattern:a.relation.lineType==1?"dashed":"solid",look:r.look};i.push(c)}return{nodes:e,edges:i,other:{},config:r,direction:this.getDirection()}}},dt=p(e=>`g.classGroup text { - fill: ${e.nodeBorder||e.classText}; - stroke: none; - font-family: ${e.fontFamily}; - font-size: 10px; - - .title { - font-weight: bolder; - } - -} - -.nodeLabel, .edgeLabel { - color: ${e.classText}; -} -.edgeLabel .label rect { - fill: ${e.mainBkg}; -} -.label text { - fill: ${e.classText}; -} - -.labelBkg { - background: ${e.mainBkg}; -} -.edgeLabel .label span { - background: ${e.mainBkg}; -} - -.classTitle { - font-weight: bolder; -} -.node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - - -.divider { - stroke: ${e.nodeBorder}; - stroke-width: 1; -} - -g.clickable { - cursor: pointer; -} - -g.classGroup rect { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; -} - -g.classGroup line { - stroke: ${e.nodeBorder}; - stroke-width: 1; -} - -.classLabel .box { - stroke: none; - stroke-width: 0; - fill: ${e.mainBkg}; - opacity: 0.5; -} - -.classLabel .label { - fill: ${e.nodeBorder}; - font-size: 10px; -} - -.relation { - stroke: ${e.lineColor}; - stroke-width: 1; - fill: none; -} - -.dashed-line{ - stroke-dasharray: 3; -} - -.dotted-line{ - stroke-dasharray: 1 2; -} - -#compositionStart, .composition { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#compositionEnd, .composition { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#dependencyStart, .dependency { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#dependencyStart, .dependency { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#extensionStart, .extension { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#extensionEnd, .extension { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#aggregationStart, .aggregation { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#aggregationEnd, .aggregation { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#lollipopStart, .lollipop { - fill: ${e.mainBkg} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -#lollipopEnd, .lollipop { - fill: ${e.mainBkg} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -.edgeTerminals { - font-size: 11px; - line-height: initial; -} - -.classTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; -} - ${Ze()} -`,"getStyles"),kt=dt,pt=p((e,i="TB")=>{if(!e.doc)return i;let r=i;for(const u of e.doc)u.stmt==="dir"&&(r=u.value);return r},"getDir"),At=p(function(e,i){return i.db.getClasses()},"getClasses"),ft=p(async function(e,i,r,u){ve.info("REF0:"),ve.info("Drawing class diagram (v3)",i);const{securityLevel:a,state:c,layout:A}=D(),f=u.db.getData(),k=$e(i,a);f.type=u.type,f.layoutAlgorithm=tt(A),f.nodeSpacing=c?.nodeSpacing||50,f.rankSpacing=c?.rankSpacing||50,f.markers=["aggregation","extension","composition","dependency","lollipop"],f.diagramId=i,await st(f,k);const _=8;Ie.insertTitle(k,"classDiagramTitleText",c?.titleTopMargin??25,u.db.getDiagramTitle()),et(k,_,"classDiagram",c?.useMaxWidth??!0)},"draw"),Dt={getClasses:At,draw:ft,getDir:pt};export{Tt as C,yt as a,Dt as c,kt as s}; diff --git a/assets/chunk-DI55MBZ5-CXTRmq1s.js b/assets/chunk-DI55MBZ5-CXTRmq1s.js deleted file mode 100644 index 131dffd1d7c911d84c33a160d01525c3b19f844e..0000000000000000000000000000000000000000 --- a/assets/chunk-DI55MBZ5-CXTRmq1s.js +++ /dev/null @@ -1,220 +0,0 @@ -import{g as Zt}from"./chunk-55IACEB6-CzYB-Zls.js";import{s as te}from"./chunk-QN33PNHL-DUQNEUQT.js";import{_ as d,l as _,c as w,r as ee,u as se,a as ie,b as re,g as ae,s as ne,p as oe,q as le,S as ce,j as U,y as he}from"./mermaid.core-BcqUqpnI.js";var kt=(function(){var t=d(function(Y,a,c,r){for(c=c||{},r=Y.length;r--;c[Y[r]]=a);return c},"o"),e=[1,2],o=[1,3],s=[1,4],h=[2,4],u=[1,9],S=[1,11],g=[1,16],n=[1,17],T=[1,18],b=[1,19],C=[1,33],A=[1,20],k=[1,21],f=[1,22],D=[1,23],R=[1,24],L=[1,26],$=[1,27],I=[1,28],P=[1,29],et=[1,30],st=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],j=[1,34],p=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],At=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:d(function(a,c,r,y,E,i,X){var l=i.length-1;switch(E){case 3:return y.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const J=i[l-1];J.description=y.trimColon(i[l]),this.$=J;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=y.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var B=i[l],H=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");B=ht[0],H=[H,ht[1]]}this.$={stmt:"state",id:B,type:"default",description:H};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],h,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:u,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:b,24:C,25:A,26:k,27:f,28:D,29:R,32:25,33:L,35:$,37:I,38:P,41:et,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:b,24:C,25:A,26:k,27:f,28:D,29:R,32:25,33:L,35:$,37:I,38:P,41:et,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:C,57:j},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:C,57:j},t(p,[2,17]),t(At,h,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(p,[2,14],{14:[1,71]}),{4:u,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,72],22:b,24:C,25:A,26:k,27:f,28:D,29:R,32:25,33:L,35:$,37:I,38:P,41:et,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(p,[2,15]),t(p,[2,19]),t(At,h,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:u,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,81],22:b,24:C,25:A,26:k,27:f,28:D,29:R,32:25,33:L,35:$,37:I,38:P,41:et,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:d(function(a,c){if(c.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=c,r}},"parseError"),parse:d(function(a){var c=this,r=[0],y=[],E=[null],i=[],X=this.table,l="",B=0,H=0,ht=2,J=1,gt=i.slice.call(arguments,1),m=Object.create(this.lexer),V={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(V.yy[Tt]=this.yy[Tt]);m.setInput(a,V.yy),V.yy.lexer=m,V.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Et=m.yylloc;i.push(Et);var qt=m.options&&m.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(O){r.length=r.length-2*O,E.length=E.length-O,i.length=i.length-O}d(Qt,"popStack");function xt(){var O;return O=y.pop()||m.lex()||J,typeof O!="number"&&(O instanceof Array&&(y=O,O=y.pop()),O=c.symbols_[O]||O),O}d(xt,"lex");for(var x,M,N,_t,W={},ut,F,Lt,dt;;){if(M=r[r.length-1],this.defaultActions[M]?N=this.defaultActions[M]:((x===null||typeof x>"u")&&(x=xt()),N=X[M]&&X[M][x]),typeof N>"u"||!N.length||!N[0]){var mt="";dt=[];for(ut in X[M])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");m.showPosition?mt="Parse error on line "+(B+1)+`: -`+m.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[x]||x)+"'":mt="Parse error on line "+(B+1)+": Unexpected "+(x==J?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(mt,{text:m.match,token:this.terminals_[x]||x,line:m.yylineno,loc:Et,expected:dt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+x);switch(N[0]){case 1:r.push(x),E.push(m.yytext),i.push(m.yylloc),r.push(N[1]),x=null,H=m.yyleng,l=m.yytext,B=m.yylineno,Et=m.yylloc;break;case 2:if(F=this.productions_[N[1]][1],W.$=E[E.length-F],W._$={first_line:i[i.length-(F||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(F||1)].first_column,last_column:i[i.length-1].last_column},qt&&(W._$.range=[i[i.length-(F||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(W,[l,H,B,V.yy,N[1],E,i].concat(gt)),typeof _t<"u")return _t;F&&(r=r.slice(0,-1*F*2),E=E.slice(0,-1*F),i=i.slice(0,-1*F)),r.push(this.productions_[N[1]][0]),E.push(W.$),i.push(W._$),Lt=X[r[r.length-2]][r[r.length-1]],r.push(Lt);break;case 3:return!0}}return!0},"parse")},Jt=(function(){var Y={EOF:1,parseError:d(function(c,r){if(this.yy.parser)this.yy.parser.parseError(c,r);else throw new Error(c)},"parseError"),setInput:d(function(a,c){return this.yy=c||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var c=a.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:d(function(a){var c=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===y.length?this.yylloc.first_column:0)+y[y.length-r.length].length-r[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(a){this.unput(this.match.slice(a))},"less"),pastInput:d(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var a=this.pastInput(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:d(function(a,c){var r,y,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),y=a[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,r,y;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=r,y=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,E[y]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var c=this.next();return c||this.lex()},"lex"),begin:d(function(c){this.conditionStack.push(c)},"begin"),popState:d(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:d(function(c){this.begin(c)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(c,r,y,E){switch(y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 70:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return r.yytext=r.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return Y})();yt.lexer=Jt;function ct(){this.yy={}}return d(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();kt.parser=kt;var Ge=kt,ue="TB",Ft="TB",It="dir",K="state",z="root",vt="relation",de="classDef",fe="style",pe="applyClass",Z="default",Yt="divider",Gt="fill:none",Bt="fill: #333",Vt="c",Mt="text",Ut="normal",bt="rect",Dt="rectWithTitle",Se="stateStart",ye="stateEnd",Ot="divider",Rt="roundedWithTitle",ge="note",Te="noteGroup",tt="statediagram",Ee="state",_e=`${tt}-${Ee}`,jt="transition",me="note",be="note-edge",De=`${jt} ${be}`,ke=`${tt}-${me}`,ve="cluster",Ce=`${tt}-${ve}`,Ae="cluster-alt",xe=`${tt}-${Ae}`,Ht="parent",Wt="note",Le="state",Ct="----",Ie=`${Ct}${Wt}`,Nt=`${Ct}${Ht}`,zt=d((t,e=Ft)=>{if(!t.doc)return e;let o=e;for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir"),Oe=d(function(t,e){return e.db.getClasses()},"getClasses"),Re=d(async function(t,e,o,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:h,state:u,layout:S}=w();s.db.extract(s.db.getRootDocV2());const g=s.db.getData(),n=Zt(e,h);g.type=s.type,g.layoutAlgorithm=S,g.nodeSpacing=u?.nodeSpacing||50,g.rankSpacing=u?.rankSpacing||50,g.markers=["barb"],g.diagramId=e,await ee(g,n);const T=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((C,A)=>{const k=typeof A=="string"?A:typeof A?.id=="string"?A.id:"";if(!k){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(A));return}const f=n.node()?.querySelectorAll("g");let D;if(f?.forEach(I=>{I.textContent?.trim()===k&&(D=I)}),!D){_.warn("⚠️ Could not find node matching text:",k);return}const R=D.parentNode;if(!R){_.warn("⚠️ Node has no parent, cannot wrap:",k);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),$=C.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$),L.setAttribute("target","_blank"),C.tooltip){const I=C.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}R.replaceChild(L,D),L.appendChild(D),_.info("🔗 Wrapped node in tag for:",k,C.url)})}catch(b){_.error("❌ Error injecting clickable links:",b)}se.insertTitle(n,"statediagramTitleText",u?.titleTopMargin??25,s.db.getDiagramTitle()),te(n,T,tt,u?.useMaxWidth??!0)},"draw"),Be={getClasses:Oe,draw:Re,getDir:zt},pt=new Map,G=0;function St(t="",e=0,o="",s=Ct){const h=o!==null&&o.length>0?`${s}${o}`:"";return`${Le}-${t}${h}-${e}`}d(St,"stateDomId");var Ne=d((t,e,o,s,h,u,S,g)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case K:Q(t,n,o,s,h,u,S,g);break;case Z:Q(t,n,o,s,h,u,S,g);break;case vt:{Q(t,n.state1,o,s,h,u,S,g),Q(t,n.state2,o,s,h,u,S,g);const T={id:"edge"+G,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Gt,labelStyle:"",label:U.sanitizeText(n.description??"",w()),arrowheadStyle:Bt,labelpos:Vt,labelType:Mt,thickness:Ut,classes:jt,look:S};h.push(T),G++}break}})},"setupDoc"),wt=d((t,e=Ft)=>{let o=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir");function q(t,e,o){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(h=>{const u=o.get(h);u&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...u.styles])}));const s=t.find(h=>h.id===e.id);s?Object.assign(s,e):t.push(e)}d(q,"insertOrUpdateNode");function Kt(t){return t?.classes?.join(" ")??""}d(Kt,"getClassesFromDbInfo");function Xt(t){return t?.styles??[]}d(Xt,"getStylesFromDbInfo");var Q=d((t,e,o,s,h,u,S,g)=>{const n=e.id,T=o.get(n),b=Kt(T),C=Xt(T),A=w();if(_.info("dataFetcher parsedItem",e,T,C),n!=="root"){let k=bt;e.start===!0?k=Se:e.start===!1&&(k=ye),e.type!==Z&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:U.sanitizeText(n,A),cssClasses:`${b} ${_e}`,cssStyles:C});const f=pt.get(n);e.description&&(Array.isArray(f.description)?(f.shape=Dt,f.description.push(e.description)):f.description?.length&&f.description.length>0?(f.shape=Dt,f.description===n?f.description=[e.description]:f.description=[f.description,e.description]):(f.shape=bt,f.description=e.description),f.description=U.sanitizeTextOrArray(f.description,A)),f.description?.length===1&&f.shape===Dt&&(f.type==="group"?f.shape=Rt:f.shape=bt),!f.type&&e.doc&&(_.info("Setting cluster for XCX",n,wt(e)),f.type="group",f.isGroup=!0,f.dir=wt(e),f.shape=e.type===Yt?Ot:Rt,f.cssClasses=`${f.cssClasses} ${Ce} ${u?xe:""}`);const D={labelStyle:"",shape:f.shape,label:f.description,cssClasses:f.cssClasses,cssCompiledStyles:[],cssStyles:f.cssStyles,id:n,dir:f.dir,domId:St(n,G),type:f.type,isGroup:f.type==="group",padding:8,rx:10,ry:10,look:S};if(D.shape===Ot&&(D.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),D.parentId=t.id),D.centerLabel=!0,e.note){const R={labelStyle:"",shape:ge,label:e.note.text,cssClasses:ke,cssStyles:[],cssCompiledStyles:[],id:n+Ie+"-"+G,domId:St(n,G,Wt),type:f.type,isGroup:f.type==="group",padding:A.flowchart?.padding,look:S,position:e.note.position},L=n+Nt,$={labelStyle:"",shape:Te,label:e.note.text,cssClasses:f.cssClasses,cssStyles:[],id:n+Nt,domId:St(n,G,Ht),type:"group",isGroup:!0,padding:16,look:S,position:e.note.position};G++,$.id=L,R.parentId=L,q(s,$,g),q(s,R,g),q(s,D,g);let I=n,P=R.id;e.note.position==="left of"&&(I=R.id,P=n),h.push({id:I+"-"+P,start:I,end:P,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:De,arrowheadStyle:Bt,labelpos:Vt,labelType:Mt,thickness:Ut,look:S})}else q(s,D,g)}e.doc&&(_.trace("Adding nodes children "),Ne(e,e.doc,o,s,h,!u,S,g))},"dataFetcher"),we=d(()=>{pt.clear(),G=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$t=d(()=>new Map,"newClassesList"),Pt=d(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=d(t=>JSON.parse(JSON.stringify(t)),"clone"),Ve=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$t(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{d(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case K:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case de:this.addStyleClass(s.id.trim(),s.classes);break;case fe:this.handleStyleDef(s);break;case pe:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),o=w();we(),Q(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,o.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),o=t.styleClass.split(",");for(const s of e){let h=this.getState(s);if(!h){const u=s.trim();this.addState(u),h=this.getState(u)}h&&(h.styles=o.map(u=>u.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,o){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===K&&(e.id===v.START_NODE?(e.id=t.id+(o?"_start":"_end"),e.start=o):e.id=e.id.trim()),e.stmt!==z&&e.stmt!==K||!e.doc)return;const s=[];let h=[];for(const u of e.doc)if(u.type===Yt){const S=ft(u);S.doc=ft(h),s.push(S),h=[]}else h.push(u);if(s.length>0&&h.length>0){const u={stmt:K,id:ce(),type:"divider",doc:ft(h)};s.push(ft(u)),e.doc=s}e.doc.forEach(u=>this.docTranslator(e,u,!0))}getRootDocV2(){return this.docTranslator({id:z,stmt:z},{id:z,stmt:z,doc:this.rootDoc},!0),{id:z,doc:this.rootDoc}}addState(t,e=Z,o=void 0,s=void 0,h=void 0,u=void 0,S=void 0,g=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:K,id:n,descriptions:[],type:e,doc:o,note:h,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=o),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(b=>this.addDescription(n,b.trim()))),h){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=h,T.note.text=U.sanitizeText(T.note.text,w())}u&&(_.info("Setting state classes",n,u),(Array.isArray(u)?u:[u]).forEach(b=>this.setCssClass(n,b.trim()))),S&&(_.info("Setting state styles",n,S),(Array.isArray(S)?S:[S]).forEach(b=>this.setStyle(n,b.trim()))),g&&(_.info("Setting state styles",n,S),(Array.isArray(g)?g:[g]).forEach(b=>this.setTextStyle(n,b.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$t(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,o){this.links.set(t,{url:e,tooltip:o}),_.warn("Adding link",t,e,o)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=Z){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=Z){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,o=""){const s=this.startIdIfNeeded(t.id.trim()),h=this.startTypeIfNeeded(t.id.trim(),t.type),u=this.startIdIfNeeded(e.id.trim()),S=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,h,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(u,S,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:u,relationTitle:U.sanitizeText(o,w())})}addRelation(t,e,o){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,o);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),h=this.startTypeIfNeeded(t),u=this.endIdIfNeeded(e.trim()),S=this.endTypeIfNeeded(e);this.addState(s,h),this.addState(u,S),this.currentDocument.relations.push({id1:s,id2:u,relationTitle:o?U.sanitizeText(o,w()):void 0})}}addDescription(t,e){const o=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;o?.descriptions?.push(U.sanitizeText(s,w()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const o=this.classes.get(t);e&&o&&e.split(v.STYLECLASS_SEP).forEach(s=>{const h=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){const S=h.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);o.textStyles.push(S)}o.styles.push(h)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(o=>{let s=this.getState(o);if(!s){const h=o.trim();this.addState(h),s=this.getState(h)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===It)}getDirection(){return this.getDirectionStatement()?.value??ue}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:It,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=w();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:zt(this.getRootDocV2())}}getConfig(){return w().state}},$e=d(t=>` -defs #statediagram-barbEnd { - fill: ${t.transitionColor}; - stroke: ${t.transitionColor}; - } -g.stateGroup text { - fill: ${t.nodeBorder}; - stroke: none; - font-size: 10px; -} -g.stateGroup text { - fill: ${t.textColor}; - stroke: none; - font-size: 10px; - -} -g.stateGroup .state-title { - font-weight: bolder; - fill: ${t.stateLabelColor}; -} - -g.stateGroup rect { - fill: ${t.mainBkg}; - stroke: ${t.nodeBorder}; -} - -g.stateGroup line { - stroke: ${t.lineColor}; - stroke-width: 1; -} - -.transition { - stroke: ${t.transitionColor}; - stroke-width: 1; - fill: none; -} - -.stateGroup .composit { - fill: ${t.background}; - border-bottom: 1px -} - -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} - -.state-note { - stroke: ${t.noteBorderColor}; - fill: ${t.noteBkgColor}; - - text { - fill: ${t.noteTextColor}; - stroke: none; - font-size: 10px; - } -} - -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${t.mainBkg}; - opacity: 0.5; -} - -.edgeLabel .label rect { - fill: ${t.labelBackgroundColor}; - opacity: 0.5; -} -.edgeLabel { - background-color: ${t.edgeLabelBackground}; - p { - background-color: ${t.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${t.edgeLabelBackground}; - fill: ${t.edgeLabelBackground}; - } - text-align: center; -} -.edgeLabel .label text { - fill: ${t.transitionLabelColor||t.tertiaryTextColor}; -} -.label div .edgeLabel { - color: ${t.transitionLabelColor||t.tertiaryTextColor}; -} - -.stateLabel text { - fill: ${t.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} - -.node circle.state-start { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node .fork-join { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node circle.state-end { - fill: ${t.innerEndBackground}; - stroke: ${t.background}; - stroke-width: 1.5 -} -.end-state-inner { - fill: ${t.compositeBackground||t.background}; - // stroke: ${t.background}; - stroke-width: 1.5 -} - -.node rect { - fill: ${t.stateBkg||t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: 1px; -} -.node polygon { - fill: ${t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder};; - stroke-width: 1px; -} -#statediagram-barbEnd { - fill: ${t.lineColor}; -} - -.statediagram-cluster rect { - fill: ${t.compositeTitleBackground}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: 1px; -} - -.cluster-label, .nodeLabel { - color: ${t.stateLabelColor}; - // line-height: 1; -} - -.statediagram-cluster rect.outer { - rx: 5px; - ry: 5px; -} -.statediagram-state .divider { - stroke: ${t.stateBorder||t.nodeBorder}; -} - -.statediagram-state .title-state { - rx: 5px; - ry: 5px; -} -.statediagram-cluster.statediagram-cluster .inner { - fill: ${t.compositeBackground||t.background}; -} -.statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.statediagram-cluster .inner { - rx:0; - ry:0; -} - -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.note-edge { - stroke-dasharray: 5; -} - -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} - -.statediagram-note text { - fill: ${t.noteTextColor}; -} - -.statediagram-note .nodeLabel { - color: ${t.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${t.noteTextColor}; -} - -#dependencyStart, #dependencyEnd { - fill: ${t.lineColor}; - stroke: ${t.lineColor}; - stroke-width: 1; -} - -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.textColor}; -} -`,"getStyles"),Me=$e;export{Ve as S,Ge as a,Be as b,Me as s}; diff --git a/assets/chunk-FMBD7UC4-Drrjy9J2.js b/assets/chunk-FMBD7UC4-Drrjy9J2.js deleted file mode 100644 index 9cb5b7b886999ae56933c585a315fd8cc3a74f5d..0000000000000000000000000000000000000000 --- a/assets/chunk-FMBD7UC4-Drrjy9J2.js +++ /dev/null @@ -1,15 +0,0 @@ -import{_ as e}from"./mermaid.core-BcqUqpnI.js";var l=e(()=>` - /* Font Awesome icon styling - consolidated */ - .label-icon { - display: inline-block; - height: 1em; - overflow: visible; - vertical-align: -0.125em; - } - - .node .label-icon path { - fill: currentColor; - stroke: revert; - stroke-width: revert; - } -`,"getIconStyles");export{l as g}; diff --git a/assets/chunk-QN33PNHL-DUQNEUQT.js b/assets/chunk-QN33PNHL-DUQNEUQT.js deleted file mode 100644 index b1ae52d87b177f1b8d87fbf13e00b2a7683c2236..0000000000000000000000000000000000000000 --- a/assets/chunk-QN33PNHL-DUQNEUQT.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,d as w,l as x}from"./mermaid.core-BcqUqpnI.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s}; diff --git a/assets/chunk-QZHKN3VN-CdTgv_Ss.js b/assets/chunk-QZHKN3VN-CdTgv_Ss.js deleted file mode 100644 index 16c610a9a1c520a6faddfb7998d62fd3f7020dc6..0000000000000000000000000000000000000000 --- a/assets/chunk-QZHKN3VN-CdTgv_Ss.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./mermaid.core-BcqUqpnI.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/assets/chunk-TZMSLE5B-xeQXGdbb.js b/assets/chunk-TZMSLE5B-xeQXGdbb.js deleted file mode 100644 index d832ce04fa0749afa101f8cc062e5a7933f9226f..0000000000000000000000000000000000000000 --- a/assets/chunk-TZMSLE5B-xeQXGdbb.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as n,m as o,i as l}from"./mermaid.core-BcqUqpnI.js";var x=n((s,t)=>{const e=s.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const r in t.attrs)e.attr(r,t.attrs[r]);return t.class&&e.attr("class",t.class),e},"drawRect"),d=n((s,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(s,e).lower()},"drawBackgroundRect"),g=n((s,t)=>{const e=t.text.replace(o," "),r=s.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const a=r.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),r},"drawText"),m=n((s,t,e,r)=>{const a=s.append("image");a.attr("x",t),a.attr("y",e);const i=l.sanitizeUrl(r);a.attr("xlink:href",i)},"drawImage"),h=n((s,t,e,r)=>{const a=s.append("use");a.attr("x",t),a.attr("y",e);const i=l.sanitizeUrl(r);a.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),y=n(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=n(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");export{d as a,p as b,h as c,x as d,m as e,g as f,y as g}; diff --git a/assets/classDiagram-2ON5EDUG-BXSbpGZa.js b/assets/classDiagram-2ON5EDUG-BXSbpGZa.js deleted file mode 100644 index e1c8e3a00edb01eeaf8d00c81f8c7c63d6ce365c..0000000000000000000000000000000000000000 --- a/assets/classDiagram-2ON5EDUG-BXSbpGZa.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-C6IGDcdb.js";import{_ as i}from"./mermaid.core-BcqUqpnI.js";import"./chunk-FMBD7UC4-Drrjy9J2.js";import"./chunk-55IACEB6-CzYB-Zls.js";import"./select-BigU4G0v.js";import"./chunk-QN33PNHL-DUQNEUQT.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram}; diff --git a/assets/classDiagram-v2-WZHVMYZB-BXSbpGZa.js b/assets/classDiagram-v2-WZHVMYZB-BXSbpGZa.js deleted file mode 100644 index e1c8e3a00edb01eeaf8d00c81f8c7c63d6ce365c..0000000000000000000000000000000000000000 --- a/assets/classDiagram-v2-WZHVMYZB-BXSbpGZa.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-C6IGDcdb.js";import{_ as i}from"./mermaid.core-BcqUqpnI.js";import"./chunk-FMBD7UC4-Drrjy9J2.js";import"./chunk-55IACEB6-CzYB-Zls.js";import"./select-BigU4G0v.js";import"./chunk-QN33PNHL-DUQNEUQT.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram}; diff --git a/assets/clear-DRfgZ-Qi.js b/assets/clear-DRfgZ-Qi.js deleted file mode 100644 index 110677f452f2c690ea2bc31b9907f55abc6a940a..0000000000000000000000000000000000000000 --- a/assets/clear-DRfgZ-Qi.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as t,f as o}from"./index-DydPgVMC.js";var i=o('');function n(r){var e=i();t(r,e)}export{n as C}; diff --git a/assets/clipPlaneFragment-BmMK1U8A.js b/assets/clipPlaneFragment-BmMK1U8A.js deleted file mode 100644 index 7d92e40908119d23f1feb01becf889a7258318b8..0000000000000000000000000000000000000000 --- a/assets/clipPlaneFragment-BmMK1U8A.js +++ /dev/null @@ -1,46 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="clipPlaneFragmentDeclaration",n=`#ifdef CLIPPLANE -varying fClipDistance: f32; -#endif -#ifdef CLIPPLANE2 -varying fClipDistance2: f32; -#endif -#ifdef CLIPPLANE3 -varying fClipDistance3: f32; -#endif -#ifdef CLIPPLANE4 -varying fClipDistance4: f32; -#endif -#ifdef CLIPPLANE5 -varying fClipDistance5: f32; -#endif -#ifdef CLIPPLANE6 -varying fClipDistance6: f32; -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=n);const f="clipPlaneFragment",d=`#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) -if (false) {} -#endif -#ifdef CLIPPLANE -else if (fragmentInputs.fClipDistance>0.0) -{discard;} -#endif -#ifdef CLIPPLANE2 -else if (fragmentInputs.fClipDistance2>0.0) -{discard;} -#endif -#ifdef CLIPPLANE3 -else if (fragmentInputs.fClipDistance3>0.0) -{discard;} -#endif -#ifdef CLIPPLANE4 -else if (fragmentInputs.fClipDistance4>0.0) -{discard;} -#endif -#ifdef CLIPPLANE5 -else if (fragmentInputs.fClipDistance5>0.0) -{discard;} -#endif -#ifdef CLIPPLANE6 -else if (fragmentInputs.fClipDistance6>0.0) -{discard;} -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=d); diff --git a/assets/clipPlaneFragment-CmkC_xqs.js b/assets/clipPlaneFragment-CmkC_xqs.js deleted file mode 100644 index f7689a188bb65f02da48b0ea3f16eaaa37448cf6..0000000000000000000000000000000000000000 --- a/assets/clipPlaneFragment-CmkC_xqs.js +++ /dev/null @@ -1,46 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="clipPlaneFragmentDeclaration",d=`#ifdef CLIPPLANE -varying float fClipDistance; -#endif -#ifdef CLIPPLANE2 -varying float fClipDistance2; -#endif -#ifdef CLIPPLANE3 -varying float fClipDistance3; -#endif -#ifdef CLIPPLANE4 -varying float fClipDistance4; -#endif -#ifdef CLIPPLANE5 -varying float fClipDistance5; -#endif -#ifdef CLIPPLANE6 -varying float fClipDistance6; -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=d);const f="clipPlaneFragment",n=`#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) -if (false) {} -#endif -#ifdef CLIPPLANE -else if (fClipDistance>0.0) -{discard;} -#endif -#ifdef CLIPPLANE2 -else if (fClipDistance2>0.0) -{discard;} -#endif -#ifdef CLIPPLANE3 -else if (fClipDistance3>0.0) -{discard;} -#endif -#ifdef CLIPPLANE4 -else if (fClipDistance4>0.0) -{discard;} -#endif -#ifdef CLIPPLANE5 -else if (fClipDistance5>0.0) -{discard;} -#endif -#ifdef CLIPPLANE6 -else if (fClipDistance6>0.0) -{discard;} -#endif -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=n); diff --git a/assets/clipPlaneVertex-CThh3FEJ.js b/assets/clipPlaneVertex-CThh3FEJ.js deleted file mode 100644 index f46469cb05f37df98728796d0156122b1f8aa813..0000000000000000000000000000000000000000 --- a/assets/clipPlaneVertex-CThh3FEJ.js +++ /dev/null @@ -1,37 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="clipPlaneVertexDeclaration",n=`#ifdef CLIPPLANE -uniform vec4 vClipPlane;varying float fClipDistance; -#endif -#ifdef CLIPPLANE2 -uniform vec4 vClipPlane2;varying float fClipDistance2; -#endif -#ifdef CLIPPLANE3 -uniform vec4 vClipPlane3;varying float fClipDistance3; -#endif -#ifdef CLIPPLANE4 -uniform vec4 vClipPlane4;varying float fClipDistance4; -#endif -#ifdef CLIPPLANE5 -uniform vec4 vClipPlane5;varying float fClipDistance5; -#endif -#ifdef CLIPPLANE6 -uniform vec4 vClipPlane6;varying float fClipDistance6; -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=n);const f="clipPlaneVertex",l=`#ifdef CLIPPLANE -fClipDistance=dot(worldPos,vClipPlane); -#endif -#ifdef CLIPPLANE2 -fClipDistance2=dot(worldPos,vClipPlane2); -#endif -#ifdef CLIPPLANE3 -fClipDistance3=dot(worldPos,vClipPlane3); -#endif -#ifdef CLIPPLANE4 -fClipDistance4=dot(worldPos,vClipPlane4); -#endif -#ifdef CLIPPLANE5 -fClipDistance5=dot(worldPos,vClipPlane5); -#endif -#ifdef CLIPPLANE6 -fClipDistance6=dot(worldPos,vClipPlane6); -#endif -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=l); diff --git a/assets/clipPlaneVertex-D5g8dBQb.js b/assets/clipPlaneVertex-D5g8dBQb.js deleted file mode 100644 index a85482e78284c49a3c84b2fd0631a2f8281cf422..0000000000000000000000000000000000000000 --- a/assets/clipPlaneVertex-D5g8dBQb.js +++ /dev/null @@ -1,37 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="clipPlaneVertexDeclaration",n=`#ifdef CLIPPLANE -uniform vClipPlane: vec4;varying fClipDistance: f32; -#endif -#ifdef CLIPPLANE2 -uniform vClipPlane2: vec4;varying fClipDistance2: f32; -#endif -#ifdef CLIPPLANE3 -uniform vClipPlane3: vec4;varying fClipDistance3: f32; -#endif -#ifdef CLIPPLANE4 -uniform vClipPlane4: vec4;varying fClipDistance4: f32; -#endif -#ifdef CLIPPLANE5 -uniform vClipPlane5: vec4;varying fClipDistance5: f32; -#endif -#ifdef CLIPPLANE6 -uniform vClipPlane6: vec4;varying fClipDistance6: f32; -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=n);const f="clipPlaneVertex",l=`#ifdef CLIPPLANE -vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane); -#endif -#ifdef CLIPPLANE2 -vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2); -#endif -#ifdef CLIPPLANE3 -vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3); -#endif -#ifdef CLIPPLANE4 -vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4); -#endif -#ifdef CLIPPLANE5 -vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5); -#endif -#ifdef CLIPPLANE6 -vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6); -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=l); diff --git a/assets/clone-BVbdztFw.js b/assets/clone-BVbdztFw.js deleted file mode 100644 index fa12f02fafe70330e20b92e354097096c609cb65..0000000000000000000000000000000000000000 --- a/assets/clone-BVbdztFw.js +++ /dev/null @@ -1 +0,0 @@ -import{b as r}from"./graph-CmFD0A_p.js";var e=4;function a(o){return r(o,e)}export{a as c}; diff --git a/assets/color-Be3KLOYu.js b/assets/color-Be3KLOYu.js deleted file mode 100644 index e2484d2448699e039dd1fa1cae8145a7444bb668..0000000000000000000000000000000000000000 --- a/assets/color-Be3KLOYu.js +++ /dev/null @@ -1 +0,0 @@ -import{o}from"./i18n-CPHyzK9b.js";const t=r=>o[r%o.length];export{t as g}; diff --git a/assets/copyTexture3DLayerToTexture.fragment-CpKHumte.js b/assets/copyTexture3DLayerToTexture.fragment-CpKHumte.js deleted file mode 100644 index 223c9c1898ed80f743f72cbe07879ab9b0787767..0000000000000000000000000000000000000000 --- a/assets/copyTexture3DLayerToTexture.fragment-CpKHumte.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="copyTexture3DLayerToTexturePixelShader",t=`var textureSampler: texture_3d;uniform layerNum: i32;varying vUV: vec2f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {let coord=vec3f(vec2f(input.vUV.x,input.vUV.y)*vec2f(textureDimensions(textureSampler,0).xy),f32(uniforms.layerNum));let color=textureLoad(textureSampler,vec3i(coord),0).rgb;fragmentOutputs.color= vec4f(color,1);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const u={name:e,shader:t};export{u as copyTexture3DLayerToTexturePixelShaderWGSL}; diff --git a/assets/copyTexture3DLayerToTexture.fragment-D0qr2EcB.js b/assets/copyTexture3DLayerToTexture.fragment-D0qr2EcB.js deleted file mode 100644 index ac1164d6d46a26c83c5a6cc37e4ccd104e5d8f2b..0000000000000000000000000000000000000000 --- a/assets/copyTexture3DLayerToTexture.fragment-D0qr2EcB.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="copyTexture3DLayerToTexturePixelShader",o=`precision highp sampler3D;uniform sampler3D textureSampler;uniform int layerNum;varying vec2 vUV;void main(void) {vec3 coord=vec3(0.0,0.0,float(layerNum));coord.xy=vec2(vUV.x,vUV.y)*vec2(textureSize(textureSampler,0).xy);vec3 color=texelFetch(textureSampler,ivec3(coord),0).rgb;gl_FragColor=vec4(color,1);} -`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const c={name:e,shader:o};export{c as copyTexture3DLayerToTexturePixelShader}; diff --git a/assets/cose-bilkent-S5V4N54A-AyIH2MZ_.js b/assets/cose-bilkent-S5V4N54A-AyIH2MZ_.js deleted file mode 100644 index 40ffb8b9263ad79db914efaa0bd2a2b0c8899078..0000000000000000000000000000000000000000 --- a/assets/cose-bilkent-S5V4N54A-AyIH2MZ_.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as V,l as $}from"./mermaid.core-BcqUqpnI.js";import{c as tt}from"./cytoscape.esm-5J0xJHOV.js";import{L as lt}from"./i18n-CPHyzK9b.js";import{s as gt}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ct=Lt;export{Ct as render}; diff --git a/assets/cubeTexture-C4jc6f6g.js b/assets/cubeTexture-C4jc6f6g.js deleted file mode 100644 index 5c981fe0a4c1cab3b3e9aae22e3698662e82bc28..0000000000000000000000000000000000000000 --- a/assets/cubeTexture-C4jc6f6g.js +++ /dev/null @@ -1 +0,0 @@ -import{B as z,M as g,O as C,V as p,T as M,c as S,d as P,e as R,G as D,_ as o,s as _,f as v,g as A,R as E}from"./index-GY9JDBGV.js";import"./abstractEngine.cubeTexture-BED8U2gm.js";import"./index-DydPgVMC.js";const L=.8;class a extends z{set boundingBoxSize(t){if(this._boundingBoxSize&&this._boundingBoxSize.equals(t))return;this._boundingBoxSize=t;const i=this.getScene();i&&i.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}set rotationY(t){this._rotationY=t,this.setReflectionTextureMatrix(g.RotationY(this._rotationY))}get rotationY(){return this._rotationY}get noMipmap(){return this._noMipmap}get forcedExtension(){return this._forcedExtension}static CreateFromImages(t,i,e){let r="";for(const s of t)r+=s;return new a(r,i,null,e,t)}static CreateFromPrefilteredData(t,i,e=null,r=!0){const s=i.useDelayedTextureLoading;i.useDelayedTextureLoading=!1;const l=new a(t,i,null,!1,null,null,null,void 0,!0,e,r);return i.useDelayedTextureLoading=s,l}constructor(t,i,e=null,r=!1,s=null,l=null,n=null,u=5,c=!1,h=null,f=!1,m=L,x=0,b,d){super(i),this.onLoadObservable=new C,this.boundingBoxPosition=p.Zero(),this._rotationY=0,this._files=null,this._forcedExtension=null,this._extensions=null,this._textureMatrixRefraction=new g,this._buffer=null,this.name=t,this.url=t,this._noMipmap=r,this.hasAlpha=!1,this.isCube=!0,this._textureMatrix=g.Identity(),this.coordinatesMode=M.CUBIC_MODE;let y=null,B=null;e!==null&&!Array.isArray(e)?(y=e.extensions??null,this._noMipmap=e.noMipmap??!1,s=e.files??null,B=e.buffer??null,this._format=e.format??5,c=e.prefiltered??!1,h=e.forcedExtension??null,this._createPolynomials=e.createPolynomials??!1,this._lodScale=e.lodScale??L,this._lodOffset=e.lodOffset??0,this._loaderOptions=e.loaderOptions,this._useSRGBBuffer=e.useSRGBBuffer,l=e.onLoad??null,n=e.onError??null):(this._noMipmap=r,this._format=u,this._createPolynomials=f,y=e,this._loaderOptions=b,this._useSRGBBuffer=d,this._lodScale=m,this._lodOffset=x),!(!t&&!s)&&this.updateURL(t,h,l,c,n,y,this.getScene()?.useDelayedTextureLoading,s,B)}getClassName(){return"CubeTexture"}updateURL(t,i=null,e=null,r=!1,s=null,l=null,n=!1,u=null,c=null){(!this.name||this.name.startsWith("data:"))&&(this.name=t),this.url=t,i&&(this._forcedExtension=i);const h=t.lastIndexOf("."),f=i||(h>-1?t.substring(h).toLowerCase():""),m=f.indexOf(".dds")===0,x=f.indexOf(".env")===0,b=f.indexOf(".basis")===0;if(x?(this.gammaSpace=!1,this._prefiltered=!1,this.anisotropicFilteringLevel=1):(this._prefiltered=r,r&&(this.gammaSpace=!1,this.anisotropicFilteringLevel=1)),u)this._files=u;else if(!b&&!x&&!m&&!l&&(l=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),this._files=this._files||[],this._files.length=0,l){for(let d=0;ds.getActiveTextures().indexOf(this)!==-1),this._textureMatrix=t,!this.getScene()?.useRightHandedSystem))return;const i=S.Vector3[0],e=S.Quaternion[0],r=S.Vector3[1];this._textureMatrix.decompose(i,e,r),e.z*=-1,e.w*=-1,g.ComposeToRef(i,e,r,this._textureMatrixRefraction)}getRefractionTextureMatrix(){return this.getScene()?.useRightHandedSystem?this._textureMatrixRefraction:this._textureMatrix}_loadTexture(t=null,i=null){const e=this.getScene(),r=this._texture;this._texture=this._getFromCache(this.url,this._noMipmap,void 0,void 0,this._useSRGBBuffer,this.isCube);const s=()=>{this.onLoadObservable.notifyObservers(this),r&&(r.dispose(),this.getScene()?.markAllMaterialsAsDirty(1)),t&&t()},l=(n,u)=>{this._loadingError=!0,this._errorObject={message:n,exception:u},i&&i(n,u),M.OnTextureLoadErrorObservable.notifyObservers(this)};this._texture?this._texture.isReady?P.SetImmediate(()=>s()):this._texture.onLoadedObservable.add(()=>s()):(this._prefiltered?this._texture=this._getEngine().createPrefilteredCubeTexture(this.url,e,this._lodScale,this._lodOffset,t,l,this._format,this._forcedExtension,this._createPolynomials):this._texture=this._getEngine().createCubeTexture(this.url,e,this._files,this._noMipmap,t,l,this._format,this._forcedExtension,!1,this._lodScale,this._lodOffset,null,this._loaderOptions,!!this._useSRGBBuffer,this._buffer),this._texture?.onLoadedObservable.add(()=>this.onLoadObservable.notifyObservers(this)))}static Parse(t,i,e){const r=R.Parse(()=>{let s=!1;return t.prefiltered&&(s=t.prefiltered),new a(e+(t.url??t.name),i,t.extensions,!1,t.files||null,null,null,void 0,s,t.forcedExtension)},t,i);if(t.boundingBoxPosition&&(r.boundingBoxPosition=p.FromArray(t.boundingBoxPosition)),t.boundingBoxSize&&(r.boundingBoxSize=p.FromArray(t.boundingBoxSize)),t.animations)for(let s=0;s{const e=new a(this.url,this.getScene()||this._getEngine(),this._extensions,this._noMipmap,this._files);return t=e.uniqueId,e},this);return i.uniqueId=t,i}}o([_()],a.prototype,"url",void 0);o([v()],a.prototype,"boundingBoxPosition",void 0);o([v()],a.prototype,"boundingBoxSize",null);o([_("rotationY")],a.prototype,"rotationY",null);o([_("files")],a.prototype,"_files",void 0);o([_("forcedExtension")],a.prototype,"_forcedExtension",void 0);o([_("extensions")],a.prototype,"_extensions",void 0);o([A("textureMatrix")],a.prototype,"_textureMatrix",void 0);o([A("textureMatrixRefraction")],a.prototype,"_textureMatrixRefraction",void 0);M._CubeTextureParser=a.Parse;E("BABYLON.CubeTexture",a);export{a as CubeTexture}; diff --git a/assets/dagre-6UL2VRFP-Btl9zFEK.js b/assets/dagre-6UL2VRFP-Btl9zFEK.js deleted file mode 100644 index 0fe3880a1abbeae5ef1d0b17a4a97e53391b53e5..0000000000000000000000000000000000000000 --- a/assets/dagre-6UL2VRFP-Btl9zFEK.js +++ /dev/null @@ -1,4 +0,0 @@ -import{_ as w,ac as F,ad as Y,ae as _,af as H,l as i,c as V,ag as $,ah as U,a0 as q,a5 as z,a1 as P,$ as K,ai as Q,aj as W,ak as Z}from"./mermaid.core-BcqUqpnI.js";import{i as b,G as B}from"./graph-CmFD0A_p.js";import{l as I}from"./layout-Blpw3L9v.js";import{c as L}from"./clone-BVbdztFw.js";import{m as A}from"./min-Rtq3U8dQ.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./_baseUniq-BFKEI0vc.js";function h(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ee(e),edges:ne(e)};return b(e.graph())||(t.value=L(e.graph())),t}function ee(e){return A(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),r={v:t};return b(n)||(r.value=n),b(a)||(r.parent=a),r})}function ne(e){return A(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return b(t.name)||(a.name=t.name),b(n)||(a.value=n),a})}var d=new Map,X=new Map,J=new Map,te=w(()=>{X.clear(),J.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=X.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),se=w((e,t)=>{const n=X.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{i.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const r=t.children(e)||[];e!==a&&r.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);i.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(i.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",a,"data",t.node(e),a),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);i.debug("Copying Edges",u),u.forEach(c=>{i.info("Edge",c);const m=t.edge(c.v,c.w,c.name);i.info("Edge data",m,a);try{se(c,a)?(i.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(v){i.error(v)}})}i.debug("Removing node",o),t.removeNode(o)})},"copy"),R=w((e,t)=>{const n=t.children(e);let a=[...n];for(const r of n)J.set(r,e),a=[...a,...R(r,t)];return a},"extractDescendants"),ie=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),r=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=r.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(i.trace("Searching children of id ",e,a),a.length<1)return e;let r;for(const o of a){const l=C(o,t,n),u=ie(t,n,l);if(l)if(u.length>0)r=l;else return l}return r},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),re=w((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),X.set(n,R(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),r=e.edges();a.length>0?(i.debug("Cluster identified",n,X),r.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",X.get(n)),d.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,X)});for(let n of d.keys()){const a=d.get(n).id,r=e.parent(a);r!==n&&d.has(r)&&!d.get(r).externalConnections&&(d.get(n).id=r)}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,o=n.w;if(i.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const l=e.parent(r);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",r,o,n.name),e.setEdge(r,o,a,n.name)}}),i.warn("Adjusted Graph",h(e)),T(e,0),i.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(i.warn("extractor - ",t,h(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),a=!1;for(const r of n){const o=e.children(r);a=a||o.length>0}if(!a){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,d,d.has(r)&&!d.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!d.has(r))i.debug("Not a cluster",r,t);else if(!d.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(r)?.clusterData?.dir&&(l=d.get(r).clusterData.dir,i.warn("Fixing dir",d.get(r).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",h(e)),G(r,e,u,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:d.get(r).clusterData,label:d.get(r).label,graph:u}),i.warn("New graph after copy node: (",r,")",h(u)),i.debug("Old graph after copy",h(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!d.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(d);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const o=e.node(r);i.warn(" Now next level",r,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),M=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const r=e.children(a),o=M(e,r);n=[...n,...o]}),n},"sorter"),oe=w(e=>M(e,e.children()),"sortNodesByHierarchy"),j=w(async(e,t,n,a,r,o)=>{i.warn("Graph in recursive render:XAX",h(t),r);const l=t.graph().rankdir;i.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),v=u.insert("g").attr("class","edgeLabels"),p=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(r!==void 0){const g=JSON.parse(JSON.stringify(r.clusterData));i.trace(`Setting data for parent cluster XXX - Node.id = `,f,` - data=`,g.height,` -Parent cluster`,r.height),t.setNode(r.id,g),t.parent(f)||(i.trace("Setting parent",f,r.id),t.setParent(f,r.id,g))}if(i.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){i.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const N=await j(p,s.graph,n,a,t.node(f),o),x=N.elem;$(s,x),s.diff=N.diff||0,i.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),U(x,s)}else t.children(f).length>0?(i.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),i.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",f,p,t.node(f),l),await q(p,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await Z(v,g)});await Promise.all(f)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(h(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(h(t)));let O=0,{subGraphTitleTotalMargin:S}=z(o);return await Promise.all(oe(t).map(async function(f){const s=t.node(f);if(i.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,i.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){i.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,N=E-g||0;i.debug("OffsetY",N,"labelHeight",E,"halfPadding",g),await K(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);i.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const N=Q(m,s,d,n,g,E,a);W(s,N)}),t.nodes().forEach(function(f){const s=t.node(f);i.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),i.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),pe=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");F(a,e.markers,e.type,e.diagramId),Y(),_(),H(),te(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const v=structuredClone(o),p=structuredClone(o),y=structuredClone(o);v.label="",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-1",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=l+"-cyclic-special-mid",y.label="",m.isGroup&&(v.fromCluster=l,y.toCluster=l),y.id=l+"-cyclic-special-2",y.arrowTypeStart="none",n.setEdge(l,u,v,l+"-cyclic-special-0"),n.setEdge(u,c,p,l+"-cyclic-special-1"),n.setEdge(c,l,y,l+"-cyc>8&255,_>>16&255,_>>24&255)}const S=E("DXT1"),v=E("DXT3"),tt=E("DXT5"),z=E("DX10"),rt=113,et=116,at=2,ft=10,Ft=88,W=31,pt=0,Ct=1,st=2,ot=3,T=4,nt=7,j=20,ct=21,Gt=22,Bt=23,bt=24,mt=25,Rt=26,_t=28,ht=32;class A{static GetDDSInfo(a){const o=new Int32Array(a.buffer,a.byteOffset,W),s=new Int32Array(a.buffer,a.byteOffset,W+4);let n=1;o[st]&Q&&(n=Math.max(1,o[nt]));const u=o[ct],F=u===z?s[ht]:0;let r=0;switch(u){case rt:r=2;break;case et:r=1;break;case z:if(F===ft){r=2;break}if(F===at){r=1;break}}return{width:o[T],height:o[ot],mipmapCount:n,isFourCC:(o[j]&Y)===Y,isRGB:(o[j]&Z)===Z,isLuminance:(o[j]&$)===$,isCube:(o[_t]&V)===V,isCompressed:u===S||u===v||u===tt,dxgiFormat:F,textureType:r}}static _GetHalfFloatAsFloatRGBAArrayBuffer(a,o,s,n,u,F){const r=new Float32Array(n),c=new Uint16Array(u,s);let t=0;for(let e=0;e>8)}static _GetRGBArrayBuffer(a,o,s,n,u,F,r,c){const t=new Uint8Array(n),e=new Uint8Array(u,s);let l=0;for(let f=0;f0?n.sphericalPolynomial=it.ConvertCubeMapToSphericalPolynomial({size:f[T],right:e[0],left:e[1],up:e[2],down:e[3],front:e[4],back:e[5],format:5,type:1,gammaSpace:!1}):n.sphericalPolynomial=void 0}}A.StoreLODInAlphaChannel=!1;export{A as DDSTools}; diff --git a/assets/ddsTextureLoader-CIEz961C.js b/assets/ddsTextureLoader-CIEz961C.js deleted file mode 100644 index 69c202282e5d05c8f3a70e17d8589277f41b8bd5..0000000000000000000000000000000000000000 --- a/assets/ddsTextureLoader-CIEz961C.js +++ /dev/null @@ -1 +0,0 @@ -import{ay as t}from"./index-GY9JDBGV.js";import{DDSTools as n}from"./dds-XXPZerKI.js";import"./index-DydPgVMC.js";import"./abstractEngine.cubeTexture-BED8U2gm.js";class M{constructor(){this.supportCascades=!0}loadCubeData(e,i,m,o){const p=i.getEngine();let a,l=!1,d=1e3;if(Array.isArray(e))for(let s=0;s1)&&i.generateMipMaps,p._unpackFlipY(a.isCompressed),n.UploadDDSLevels(p,i,h,a,l,6,-1,s),!a.isFourCC&&a.mipmapCount===1?p.generateMipMapsForCubemap(i):d=a.mipmapCount-1}else{const s=e;a=n.GetDDSInfo(s),i.width=a.width,i.height=a.height,m&&(a.sphericalPolynomial=new t),l=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&i.generateMipMaps,p._unpackFlipY(a.isCompressed),n.UploadDDSLevels(p,i,s,a,l,6),!a.isFourCC&&a.mipmapCount===1?p.generateMipMapsForCubemap(i,!1):d=a.mipmapCount-1}p._setCubeMapTextureParams(i,l,d),i.isReady=!0,i.onLoadedObservable.notifyObservers(i),i.onLoadedObservable.clear(),o&&o({isDDS:!0,width:i.width,info:a,data:e,texture:i})}loadData(e,i,m){const o=n.GetDDSInfo(e),p=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&i.generateMipMaps&&Math.max(o.width,o.height)>>o.mipmapCount-1===1;m(o.width,o.height,p,o.isFourCC,()=>{n.UploadDDSLevels(i.getEngine(),i,e,o,p,1)})}}export{M as _DDSTextureLoader}; diff --git a/assets/decalFragment-1pWMlRR5.js b/assets/decalFragment-1pWMlRR5.js deleted file mode 100644 index 08f0400f7eee73696c758dcde5e35cff957f5435..0000000000000000000000000000000000000000 --- a/assets/decalFragment-1pWMlRR5.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="decalFragment",o=`#ifdef DECAL -#ifdef GAMMADECAL -decalColor.rgb=toLinearSpace(decalColor.rgb); -#endif -#ifdef DECAL_SMOOTHALPHA -decalColor.a*=decalColor.a; -#endif -surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a); -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=o); diff --git a/assets/decalFragment-zjU901jg.js b/assets/decalFragment-zjU901jg.js deleted file mode 100644 index 7f58507b71410577a5d8116eb467706ec456c5e1..0000000000000000000000000000000000000000 --- a/assets/decalFragment-zjU901jg.js +++ /dev/null @@ -1,11 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const a="decalFragment",l=`#ifdef DECAL -var decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a; -#ifdef GAMMADECAL -decalTempColor=toLinearSpaceVec3(decalColor.rgb); -#endif -#ifdef DECAL_SMOOTHALPHA -decalTempAlpha=decalColor.a*decalColor.a; -#endif -surfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha); -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=l); diff --git a/assets/declarationMapper--DEn7iYN.js b/assets/declarationMapper--DEn7iYN.js deleted file mode 100644 index 3cac198db9fdf21053d62cc4216db4589968a472..0000000000000000000000000000000000000000 --- a/assets/declarationMapper--DEn7iYN.js +++ /dev/null @@ -1 +0,0 @@ -import{R as S,ah as I,V,ao as k,M as D,ai as q,b9 as L,C as Q,L as m}from"./index-GY9JDBGV.js";class p{constructor(e){this.value=this._toInt(e)}_toInt(e){return e|0}add(e){return new p(this.value+e.value)}subtract(e){return new p(this.value-e.value)}multiply(e){return new p(Math.imul(this.value,e.value))}divide(e){return new p(this.value/e.value)}getClassName(){return p.ClassName}equals(e){return this.value===e.value}static FromValue(e){return new p(e)}toString(){return this.value.toString()}}p.ClassName="FlowGraphInteger";S("FlowGraphInteger",p);class h{constructor(e=[1,0,0,1]){this._m=e}get m(){return this._m}transformVector(e){return this.transformVectorToRef(e,new I)}transformVectorToRef(e,n){return n.x=e.x*this._m[0]+e.y*this._m[1],n.y=e.x*this._m[2]+e.y*this._m[3],n}asArray(){return this.toArray()}toArray(e=[]){for(let n=0;n<4;n++)e[n]=this._m[n];return e}fromArray(e){for(let n=0;n<4;n++)this._m[n]=e[n];return this}multiplyToRef(e,n){const o=e._m,t=this._m,a=n._m;return a[0]=o[0]*t[0]+o[1]*t[2],a[1]=o[0]*t[1]+o[1]*t[3],a[2]=o[2]*t[0]+o[3]*t[2],a[3]=o[2]*t[1]+o[3]*t[3],n}multiply(e){return this.multiplyToRef(e,new h)}divideToRef(e,n){const o=this._m,t=e._m,a=n._m;return a[0]=o[0]/t[0],a[1]=o[1]/t[1],a[2]=o[2]/t[2],a[3]=o[3]/t[3],n}divide(e){return this.divideToRef(e,new h)}addToRef(e,n){const o=this._m,t=e.m,a=n.m;return a[0]=o[0]+t[0],a[1]=o[1]+t[1],a[2]=o[2]+t[2],a[3]=o[3]+t[3],n}add(e){return this.addToRef(e,new h)}subtractToRef(e,n){const o=this._m,t=e.m,a=n.m;return a[0]=o[0]-t[0],a[1]=o[1]-t[1],a[2]=o[2]-t[2],a[3]=o[3]-t[3],n}subtract(e){return this.subtractToRef(e,new h)}transpose(){const e=this._m;return new h([e[0],e[2],e[1],e[3]])}determinant(){const e=this._m;return e[0]*e[3]-e[1]*e[2]}inverse(){const e=this.determinant();if(e===0)throw new Error("Matrix is not invertible");const n=this._m,o=1/e;return new h([n[3]*o,-n[1]*o,-n[2]*o,n[0]*o])}equals(e,n=0){const o=this._m,t=e.m;return n===0?o[0]===t[0]&&o[1]===t[1]&&o[2]===t[2]&&o[3]===t[3]:Math.abs(o[0]-t[0]){if(r.getClassName){if(r.getClassName()==="Vector4")return k.FromArray(r.asArray());if(r.getClassName()==="Vector3")return k.FromEulerVector(r);if(r.getClassName()==="Matrix")return k.FromRotationMatrix(r)}return r};const E=new c("FlowGraphInteger",new p(0),0);function H(r){const e=r;switch(typeof r){case"string":return C;case"number":return d;case"boolean":return P;case"object":if(e.getClassName)switch(e.getClassName()){case"Vector2":return B;case"Vector3":return _;case"Vector4":return A;case"Matrix":return F;case"Color3":return G;case"Color4":return T;case"Quaternion":return y;case"FlowGraphInteger":return E;case"Matrix2D":return M;case"Matrix3D":return R}return b;default:return b}}function K(r){switch(r){case"string":return C;case"number":return d;case"boolean":return P;case"Vector2":return B;case"Vector3":return _;case"Vector4":return A;case"Matrix":return F;case"Color3":return G;case"Color4":return T;case"Quaternion":return y;case"FlowGraphInteger":return E;case"Matrix2D":return M;case"Matrix3D":return R;default:return b}}function J(r){switch(r){case"number":return 0;case"Vector2":return 5;case"Vector3":return 1;case"Matrix":return 3;case"Color3":return 4;case"Color4":return 7;case"Quaternion":return 2;default:return 0}}function U(r){switch(r){case 0:return d;case 5:return B;case 1:return _;case 3:return F;case 4:return G;case 7:return T;case 2:return y;default:return b}}function X(r){const[e,n]=r.split(":");return $({op:e,extension:n})}function $(r,e=!0){const n=r.extension?w[r.extension]?.[r.op]:W[r.op];if(!n&&(m.Warn(`No mapping found for operation ${r.op} and extension ${r.extension||"KHR_interactivity"}`),e)){const o={},t={flows:{}};if(r.inputValueSockets){o.values={};for(const a in r.inputValueSockets)o.values[a]={name:a}}return r.outputValueSockets&&(t.values={},Object.keys(r.outputValueSockets).forEach(a=>{t.values[a]={name:a}})),{blocks:[],inputs:o,outputs:t}}return n}function Y(r,e,n){w[e]||(w[e]={}),w[e][r]=n}const w={BABYLON:{"flow/log":{blocks:["FlowGraphConsoleLogBlock"],inputs:{values:{message:{name:"message"}}}}}},W={"event/onStart":{blocks:["FlowGraphSceneReadyEventBlock"],outputs:{flows:{out:{name:"done"}}}},"event/onTick":{blocks:["FlowGraphSceneTickEventBlock"],inputs:{},outputs:{values:{timeSinceLastTick:{name:"deltaTime",gltfType:"number"}},flows:{out:{name:"done"}}}},"event/send":{blocks:["FlowGraphSendCustomEventBlock"],extraProcessor(r,e,n,o,t){if(e.op!=="event/send"||!r.configuration||Object.keys(r.configuration).length!==1)throw new Error("Receive event should have a single configuration object, the event itself");const l=r.configuration.event.value?.[0];if(typeof l!="number")throw new Error("Event id should be a number");const i=o.arrays.events[l],s=t[0];return s.config||(s.config={}),s.config.eventId=i.eventId,s.config.eventData=i.eventData,t}},"event/receive":{blocks:["FlowGraphReceiveCustomEventBlock"],outputs:{flows:{out:{name:"done"}}},validation(r,e){if(!r.configuration)return m.Error("Receive event should have a configuration object"),{valid:!1,error:"Receive event should have a configuration object"};const n=r.configuration.event;if(!n)return m.Error("Receive event should have a single configuration object, the event itself"),{valid:!1,error:"Receive event should have a single configuration object, the event itself"};const o=n.value?.[0];return typeof o!="number"?(m.Error("Event id should be a number"),{valid:!1,error:"Event id should be a number"}):e.events?.[o]?{valid:!0}:(m.Error(`Event with id ${o} not found`),{valid:!1,error:`Event with id ${o} not found`})},extraProcessor(r,e,n,o,t){if(e.op!=="event/receive"||!r.configuration||Object.keys(r.configuration).length!==1)throw new Error("Receive event should have a single configuration object, the event itself");const l=r.configuration.event.value?.[0];if(typeof l!="number")throw new Error("Event id should be a number");const i=o.arrays.events[l],s=t[0];return s.config||(s.config={}),s.config.eventId=i.eventId,s.config.eventData=i.eventData,t}},"math/E":u("FlowGraphEBlock"),"math/Pi":u("FlowGraphPIBlock"),"math/Inf":u("FlowGraphInfBlock"),"math/NaN":u("FlowGraphNaNBlock"),"math/abs":u("FlowGraphAbsBlock"),"math/sign":u("FlowGraphSignBlock"),"math/trunc":u("FlowGraphTruncBlock"),"math/floor":u("FlowGraphFloorBlock"),"math/ceil":u("FlowGraphCeilBlock"),"math/round":{blocks:["FlowGraphRoundBlock"],configuration:{},inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t){var a;return(a=t[0]).config||(a.config={}),t[0].config.roundHalfAwayFromZero=!0,t}},"math/fract":u("FlowGraphFractBlock"),"math/neg":u("FlowGraphNegationBlock"),"math/add":u("FlowGraphAddBlock",["a","b"],!0),"math/sub":u("FlowGraphSubtractBlock",["a","b"],!0),"math/mul":{blocks:["FlowGraphMultiplyBlock"],extraProcessor(r,e,n,o,t){var a;(a=t[0]).config||(a.config={}),t[0].config.useMatrixPerComponent=!0,t[0].config.preventIntegerFloatArithmetic=!0;let l=-1;return Object.keys(r.values||{}).find(i=>r.values?.[i].type!==void 0?(l=r.values[i].type,!0):!1),l!==-1&&(t[0].config.type=o.arrays.types[l].flowGraphType),t},validation(r){return r.values?N(r):{valid:!0}}},"math/div":u("FlowGraphDivideBlock",["a","b"],!0),"math/rem":u("FlowGraphModuloBlock",["a","b"]),"math/min":u("FlowGraphMinBlock",["a","b"]),"math/max":u("FlowGraphMaxBlock",["a","b"]),"math/clamp":u("FlowGraphClampBlock",["a","b","c"]),"math/saturate":u("FlowGraphSaturateBlock"),"math/mix":u("FlowGraphMathInterpolationBlock",["a","b","c"]),"math/eq":u("FlowGraphEqualityBlock",["a","b"]),"math/lt":u("FlowGraphLessThanBlock",["a","b"]),"math/le":u("FlowGraphLessThanOrEqualBlock",["a","b"]),"math/gt":u("FlowGraphGreaterThanBlock",["a","b"]),"math/ge":u("FlowGraphGreaterThanOrEqualBlock",["a","b"]),"math/isNaN":u("FlowGraphIsNaNBlock"),"math/isInf":u("FlowGraphIsInfBlock"),"math/select":{blocks:["FlowGraphConditionalBlock"],inputs:{values:{condition:{name:"condition"},a:{name:"onTrue"},b:{name:"onFalse"}}},outputs:{values:{value:{name:"output"}}}},"math/random":{blocks:["FlowGraphRandomBlock"],outputs:{values:{value:{name:"value"}}}},"math/sin":u("FlowGraphSinBlock"),"math/cos":u("FlowGraphCosBlock"),"math/tan":u("FlowGraphTanBlock"),"math/asin":u("FlowGraphASinBlock"),"math/acos":u("FlowGraphACosBlock"),"math/atan":u("FlowGraphATanBlock"),"math/atan2":u("FlowGraphATan2Block",["a","b"]),"math/sinh":u("FlowGraphSinhBlock"),"math/cosh":u("FlowGraphCoshBlock"),"math/tanh":u("FlowGraphTanhBlock"),"math/asinh":u("FlowGraphASinhBlock"),"math/acosh":u("FlowGraphACoshBlock"),"math/atanh":u("FlowGraphATanhBlock"),"math/exp":u("FlowGraphExponentialBlock"),"math/log":u("FlowGraphLogBlock"),"math/log2":u("FlowGraphLog2Block"),"math/log10":u("FlowGraphLog10Block"),"math/sqrt":u("FlowGraphSquareRootBlock"),"math/cbrt":u("FlowGraphCubeRootBlock"),"math/pow":u("FlowGraphPowerBlock",["a","b"]),"math/length":u("FlowGraphLengthBlock"),"math/normalize":u("FlowGraphNormalizeBlock"),"math/dot":u("FlowGraphDotBlock",["a","b"]),"math/cross":u("FlowGraphCrossBlock",["a","b"]),"math/rotate2D":{blocks:["FlowGraphRotate2DBlock"],inputs:{values:{a:{name:"a"},angle:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/rotate3D":{blocks:["FlowGraphRotate3DBlock"],inputs:{values:{a:{name:"a"},rotation:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/transform":{blocks:["FlowGraphTransformVectorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/combine2":{blocks:["FlowGraphCombineVector2Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine3":{blocks:["FlowGraphCombineVector3Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine4":{blocks:["FlowGraphCombineVector4Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/extract2":{blocks:["FlowGraphExtractVector2Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"}}}},"math/extract3":{blocks:["FlowGraphExtractVector3Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"}}}},"math/extract4":{blocks:["FlowGraphExtractVector4Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/transpose":u("FlowGraphTransposeBlock"),"math/determinant":u("FlowGraphDeterminantBlock"),"math/inverse":u("FlowGraphInvertMatrixBlock"),"math/matMul":u("FlowGraphMatrixMultiplicationBlock",["a","b"]),"math/matCompose":{blocks:["FlowGraphMatrixCompose"],inputs:{values:{translation:{name:"position",gltfType:"float3"},rotation:{name:"rotationQuaternion",gltfType:"float4"},scale:{name:"scaling",gltfType:"float3"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t,a){const l=t[0].dataInputs.find(i=>i.name==="rotationQuaternion");if(!l)throw new Error("Rotation quaternion input not found");return a._connectionValues[l.uniqueId]&&(a._connectionValues[l.uniqueId].type="Quaternion"),t}},"math/matDecompose":{blocks:["FlowGraphMatrixDecompose"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{translation:{name:"position"},rotation:{name:"rotationQuaternion"},scale:{name:"scaling"}}}},"math/quatConjugate":u("FlowGraphConjugateBlock",["a"]),"math/quatMul":{blocks:["FlowGraphMultiplyBlock"],inputs:{values:{a:{name:"a",gltfType:"vector4"},b:{name:"b",gltfType:"vector4"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t){var a;return(a=t[0]).config||(a.config={}),t[0].config.type="Quaternion",t}},"math/quatAngleBetween":u("FlowGraphAngleBetweenBlock",["a","b"]),"math/quatFromAxisAngle":{blocks:["FlowGraphQuaternionFromAxisAngleBlock"],inputs:{values:{axis:{name:"a",gltfType:"float3"},angle:{name:"b",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/quatToAxisAngle":u("FlowGraphAxisAngleFromQuaternionBlock",["a"]),"math/quatFromDirections":u("FlowGraphQuaternionFromDirectionsBlock",["a","b"]),"math/combine2x2":{blocks:["FlowGraphCombineMatrix2DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t){var a;return(a=t[0]).config||(a.config={}),t[0].config.inputIsColumnMajor=!0,t}},"math/extract2x2":{blocks:["FlowGraphExtractMatrix2DBlock"],inputs:{values:{a:{name:"input",gltfType:"float2x2"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/combine3x3":{blocks:["FlowGraphCombineMatrix3DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t){var a;return(a=t[0]).config||(a.config={}),t[0].config.inputIsColumnMajor=!0,t}},"math/extract3x3":{blocks:["FlowGraphExtractMatrix3DBlock"],inputs:{values:{a:{name:"input",gltfType:"float3x3"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"}}}},"math/combine4x4":{blocks:["FlowGraphCombineMatrixBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"},j:{name:"input_9",gltfType:"number"},k:{name:"input_10",gltfType:"number"},l:{name:"input_11",gltfType:"number"},m:{name:"input_12",gltfType:"number"},n:{name:"input_13",gltfType:"number"},o:{name:"input_14",gltfType:"number"},p:{name:"input_15",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t){var a;return(a=t[0]).config||(a.config={}),t[0].config.inputIsColumnMajor=!0,t}},"math/extract4x4":{blocks:["FlowGraphExtractMatrixBlock"],configuration:{},inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"},9:{name:"output_9"},10:{name:"output_10"},11:{name:"output_11"},12:{name:"output_12"},13:{name:"output_13"},14:{name:"output_14"},15:{name:"output_15"}}}},"math/not":{blocks:["FlowGraphBitwiseNotBlock"],inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t,a){var l;(l=t[0]).config||(l.config={});const i=t[0].dataInputs[0];return t[0].config.valueType=a._connectionValues[i.uniqueId]?.type??"FlowGraphInteger",t}},"math/and":{blocks:["FlowGraphBitwiseAndBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t,a){var l;(l=t[0]).config||(l.config={});const i=t[0].dataInputs[0],s=t[0].dataInputs[1];return t[0].config.valueType=a._connectionValues[i.uniqueId]?.type??a._connectionValues[s.uniqueId]?.type??"FlowGraphInteger",t}},"math/or":{blocks:["FlowGraphBitwiseOrBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t,a){var l;(l=t[0]).config||(l.config={});const i=t[0].dataInputs[0],s=t[0].dataInputs[1];return t[0].config.valueType=a._connectionValues[i.uniqueId]?.type??a._connectionValues[s.uniqueId]?.type??"FlowGraphInteger",t}},"math/xor":{blocks:["FlowGraphBitwiseXorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(r,e,n,o,t,a){var l;(l=t[0]).config||(l.config={});const i=t[0].dataInputs[0],s=t[0].dataInputs[1];return t[0].config.valueType=a._connectionValues[i.uniqueId]?.type??a._connectionValues[s.uniqueId]?.type??"FlowGraphInteger",t}},"math/asr":u("FlowGraphBitwiseRightShiftBlock",["a","b"]),"math/lsl":u("FlowGraphBitwiseLeftShiftBlock",["a","b"]),"math/clz":u("FlowGraphLeadingZerosBlock"),"math/ctz":u("FlowGraphTrailingZerosBlock"),"math/popcnt":u("FlowGraphOneBitsCounterBlock"),"math/rad":u("FlowGraphDegToRadBlock"),"math/deg":u("FlowGraphRadToDegBlock"),"type/boolToInt":u("FlowGraphBooleanToInt"),"type/boolToFloat":u("FlowGraphBooleanToFloat"),"type/intToBool":u("FlowGraphIntToBoolean"),"type/intToFloat":u("FlowGraphIntToFloat"),"type/floatToInt":u("FlowGraphFloatToInt"),"type/floatToBool":u("FlowGraphFloatToBoolean"),"flow/sequence":{blocks:["FlowGraphSequenceBlock"],extraProcessor(r,e,n,o,t){const a=t[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(r.flows||[]).length,a.signalOutputs.forEach((l,i)=>{l.name="out_"+i}),t}},"flow/branch":{blocks:["FlowGraphBranchBlock"],outputs:{flows:{true:{name:"onTrue"},false:{name:"onFalse"}}}},"flow/switch":{blocks:["FlowGraphSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"},default:{name:"default"}}},validation(r){const e=r.configuration?.cases;if(e&&e.value){if(!e.value.every(t=>typeof t=="number"&&/^-?\d+$/.test(t.toString())))return m.Warn("Switch cases should be integers. Using empty array instead."),e.value=[],{valid:!0};const o=new Set(e.value);e.value=Array.from(o)}return{valid:!0}},extraProcessor(r,e,n,o,t){if(e.op!=="flow/switch"||!r.flows||Object.keys(r.flows).length===0)throw new Error("Switch should have a single configuration object, the cases array");return t[0].signalOutputs.forEach(l=>{l.name!=="default"&&(l.name="out_"+l.name)}),t}},"flow/while":{blocks:["FlowGraphWhileLoopBlock"],outputs:{flows:{loopBody:{name:"executionFlow"}}}},"flow/for":{blocks:["FlowGraphForLoopBlock"],configuration:{initialIndex:{name:"initialIndex",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{values:{startIndex:{name:"startIndex",gltfType:"number"},endIndex:{name:"endIndex",gltfType:"number"}}},outputs:{values:{index:{name:"index"}},flows:{loopBody:{name:"executionFlow"}}},extraProcessor(r,e,n,o,t){const a=t[0];return a.config||(a.config={}),a.config.incrementIndexWhenLoopDone=!0,t}},"flow/doN":{blocks:["FlowGraphDoNBlock"],configuration:{},inputs:{values:{n:{name:"maxExecutions",gltfType:"number"}}},outputs:{values:{currentCount:{name:"executionCount"}}}},"flow/multiGate":{blocks:["FlowGraphMultiGateBlock"],configuration:{isRandom:{name:"isRandom",gltfType:"boolean",inOptions:!0,defaultValue:!1},isLoop:{name:"isLoop",gltfType:"boolean",inOptions:!0,defaultValue:!1}},extraProcessor(r,e,n,o,t){if(e.op!=="flow/multiGate"||!r.flows||Object.keys(r.flows).length===0)throw new Error("MultiGate should have a single configuration object, the number of output flows");const a=t[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(r.flows).length,a.signalOutputs.forEach((l,i)=>{l.name="out_"+i}),t}},"flow/waitAll":{blocks:["FlowGraphWaitAllBlock"],configuration:{inputFlows:{name:"inputSignalCount",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{flows:{reset:{name:"reset"},"[segment]":{name:"in_$1"}}},validation(r){return typeof r.configuration?.inputFlows?.value?.[0]!="number"&&(r.configuration=r.configuration||{inputFlows:{value:[0]}},r.configuration.inputFlows.value=[0]),{valid:!0}}},"flow/throttle":{blocks:["FlowGraphThrottleBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/setDelay":{blocks:["FlowGraphSetDelayBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/cancelDelay":{blocks:["FlowGraphCancelDelayBlock"]},"variable/get":{blocks:["FlowGraphGetVariableBlock"],validation(r){return r.configuration?.variable?.value?{valid:!0}:(m.Error("Variable get block should have a variable configuration"),{valid:!1,error:"Variable get block should have a variable configuration"})},configuration:{variable:{name:"variable",gltfType:"number",flowGraphType:"string",inOptions:!0,isVariable:!0,dataTransformer(r,e){return e.getVariableName(r)}}}},"variable/set":{blocks:["FlowGraphSetVariableBlock"],configuration:{variables:{name:"variables",gltfType:"number",flowGraphType:"string",inOptions:!0,isArray:!0,dataTransformer(r,e){return r.map(n=>e.getVariableName(n))}}},extraProcessor(r,e,n,o,t){return t[0].dataInputs.forEach(l=>{l.name=o.getVariableName(+l.name)}),t}},"variable/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphContextBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing","FlowGraphGetVariableBlock"],configuration:{variable:{name:"propertyName",inOptions:!0,isVariable:!0,dataTransformer(r,e){return e.getVariableName(r)}},useSlerp:{name:"animationType",inOptions:!0,defaultValue:!1,dataTransformer(r){return r===!0?"Quaternion":void 0}}},inputs:{values:{value:{name:"value_1"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"userVariables",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:4,isVariable:!0}],extraProcessor(r,e,n,o,t){var a,l;const i=t[0],s=r.configuration?.variable.value?.[0];if(typeof s!="number")throw m.Error("Variable index is not defined for variable interpolation block"),new Error("Variable index is not defined for variable interpolation block");const v=o.arrays.staticVariables[s];typeof i.config?.animationType?.value>"u"&&(i.config||(i.config={}),(a=i.config).animationType||(a.animationType={}),i.config.animationType.value=J(v.type));const g=t[4];return g.config||(g.config={}),(l=g.config).variable||(l.variable={}),g.config.variable.value=o.getVariableName(s),t}},"pointer/get":{blocks:["FlowGraphGetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customGetFunction",output:"getFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor(r,e,n,o,t){return t.forEach(a=>{a.className==="FlowGraphJsonPointerParserBlock"&&(a.config||(a.config={}),a.config.outputValue=!0)}),t}},"pointer/set":{blocks:["FlowGraphSetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customSetFunction",output:"setFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor(r,e,n,o,t){return t.forEach(a=>{a.className==="FlowGraphJsonPointerParserBlock"&&(a.config||(a.config={}),a.config.outputValue=!0)}),t}},"pointer/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphJsonPointerParserBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value_1"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customBuildAnimation",output:"generateAnimationsFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor(r,e,n,o,t){return t.forEach(a=>{a.className==="FlowGraphJsonPointerParserBlock"?(a.config||(a.config={}),a.config.outputValue=!0):a.className==="FlowGraphInterpolationBlock"&&(a.config||(a.config={}),Object.keys(r.values||[]).forEach(l=>{const i=r.values?.[l];if(l==="value"&&i){const s=i.type;s!==void 0&&(a.config.animationType=o.arrays.types[s].flowGraphType)}}))}),t}},"animation/start":{blocks:["FlowGraphPlayAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},speed:{name:"speed",gltfType:"number"},startTime:{name:"from",gltfType:"number",dataTransformer:(r,e)=>[r[0]*e._animationTargetFps]},endTime:{name:"to",gltfType:"number",dataTransformer:(r,e)=>[r[0]*e._animationTargetFps]}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(r,e,n,o,t,a,l){const i=t[t.length-1];return i.config||(i.config={}),i.config.glTF=l,t}},"animation/stop":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(r,e,n,o,t,a,l){const i=t[t.length-1];return i.config||(i.config={}),i.config.glTF=l,t}},"animation/stopAt":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{},inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},stopTime:{name:"stopAtFrame",gltfType:"number",dataTransformer:(r,e)=>[r[0]*e._animationTargetFps]}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(r,e,n,o,t,a,l){const i=t[t.length-1];return i.config||(i.config={}),i.config.glTF=l,t}},"math/switch":{blocks:["FlowGraphDataSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"}}},validation(r){const e=r.configuration?.cases;if(e&&e.value){if(!e.value.every(t=>typeof t=="number"&&/^-?\d+$/.test(t.toString())))return m.Warn("Switch cases should be integers. Using empty array instead."),e.value=[],{valid:!0};const o=new Set(e.value);e.value=Array.from(o)}return{valid:!0}},extraProcessor(r,e,n,o,t){const a=t[0];return a.dataInputs.forEach(l=>{l.name!=="default"&&l.name!=="case"&&(l.name="in_"+l.name)}),a.config||(a.config={}),a.config.treatCasesAsIntegers=!0,t}},"debug/log":{blocks:["FlowGraphConsoleLogBlock"],configuration:{message:{name:"messageTemplate",inOptions:!0}}}};function u(r,e=["a"],n){return{blocks:[r],inputs:{values:e.reduce((o,t)=>(o[t]={name:t},o),{})},outputs:{values:{value:{name:"value"}}},extraProcessor(o,t,a,l,i){var s;if(n){(s=i[0]).config||(s.config={}),i[0].config.preventIntegerFloatArithmetic=!0;let v=-1;Object.keys(o.values||{}).find(g=>o.values?.[g].type!==void 0?(v=o.values[g].type,!0):!1),v!==-1&&(i[0].config.type=l.arrays.types[v].flowGraphType)}return i},validation(o){return n?N(o):{valid:!0}}}}function N(r){if(r.values){const e=Object.keys(r.values).map(o=>r.values[o].type).filter(o=>o!==void 0);if(!e.every(o=>o===e[0]))return{valid:!1,error:"All inputs must be of the same type"}}return{valid:!0}}export{p as F,b as R,Y as a,d as b,P as c,U as d,_ as e,y as f,K as g,F as h,E as i,H as j,A as k,B as l,M as m,h as n,R as o,f as p,C as q,$ as r,X as s}; diff --git a/assets/default.fragment-75ZDpbcd.js b/assets/default.fragment-75ZDpbcd.js deleted file mode 100644 index b8b9c34b87842a09de2de6ada3d0f94016ab0a13..0000000000000000000000000000000000000000 --- a/assets/default.fragment-75ZDpbcd.js +++ /dev/null @@ -1,367 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./defaultUboDeclaration-D9mC3D5S.js";import"./oitFragment-CXBNy3dk.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";import"./helperFunctions-Wgh3PIP0.js";import"./shadowsFragmentFunctions-CHKo52s6.js";import"./lightsFragmentFunctions-BGx5-0G-.js";import"./samplerFragmentDeclaration-Bn5G_87U.js";import"./fresnelFunction-xm2bLg9t.js";import"./imageProcessingFunctions-DMSN1d-p.js";import"./bumpFragment-DEyymZuF.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./fogFragment-DjadYfQv.js";import"./decalFragment-zjU901jg.js";import"./lightFragment-Jwj6l9Y8.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const e="defaultPixelShader",f=`#include -#include[SCENE_MRT_COUNT] -#include -#define CUSTOM_FRAGMENT_BEGIN -varying vPositionW: vec3f; -#ifdef NORMAL -varying vNormalW: vec3f; -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vColor: vec4f; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying vViewDepth: f32; -#endif -#include[1..7] -#include -#include[0..maxSimultaneousLights] -#include -#include -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef REFRACTION -#ifdef REFRACTIONMAP_3D -var refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube; -#else -var refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d; -#endif -#endif -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular) -#endif -#include -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -var reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube; -#else -var reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d; -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#endif -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a; -#ifdef NORMAL -var normalW: vec3f=normalize(fragmentInputs.vNormalW); -#else -var normalW: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))* scene.vEyePosition.w; -#endif -#include -#ifdef TWOSIDEDLIGHTING -normalW=select(-normalW,normalW,fragmentInputs.frontFacing); -#endif -#ifdef DIFFUSE -baseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset); -#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS) -if (baseColor.a(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_) -#endif -#include -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -baseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a); -#endif -#ifdef DETAIL -baseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a); -#endif -#if defined(DECAL) && defined(DECAL_AFTER_DETAIL) -var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset); -#include(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_) -#endif -#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE -var baseAmbientColor: vec3f= vec3f(1.,1.,1.); -#ifdef AMBIENT -baseAmbientColor=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y; -#endif -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -var glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb; -#ifdef SPECULARTERM -#ifdef SPECULAR -var specularMapColor: vec4f=textureSample(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb; -#ifdef GLOSSINESS -glossiness=glossiness*specularMapColor.a; -#endif -#endif -#endif -var diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo; -#ifdef SPECULARTERM -var specularBase: vec3f= vec3f(0.,0.,0.); -#endif -var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.; -#ifdef LIGHTMAP -var lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset); -#ifdef RGBDLIGHTMAP -lightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a); -#endif -lightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a); -#endif -#include[0..maxSimultaneousLights] -aggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.); -#ifdef REFRACTION -var refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y)); -#ifdef REFRACTIONMAP_3D -#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC -refractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition); -#endif -refractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;} -#else -var vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords); -#endif -#ifdef RGBDREFRACTION -refractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a); -#endif -#ifdef IS_REFRACTION_LINEAR -refractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a); -#endif -refractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a); -#endif -var reflectionColor: vec4f= vec4f(0.,0.,0.,1.); -#ifdef REFLECTION -var vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -vReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0); -#endif -#ifdef REFLECTIONMAP_3D -#ifdef ROUGHNESS -var bias: f32=uniforms.vReflectionInfos.y; -#ifdef SPECULARTERM -#ifdef SPECULAR -#ifdef GLOSSINESS -bias*=(1.0-specularMapColor.a); -#endif -#endif -#endif -reflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias); -#else -reflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW); -#endif -#else -var coords: vec2f=vReflectionUVW.xy; -#ifdef REFLECTIONMAP_PROJECTION -coords/=vReflectionUVW.z; -#endif -coords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords); -#endif -#ifdef RGBDREFLECTION -reflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a); -#endif -#ifdef IS_REFLECTION_LINEAR -reflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a); -#endif -reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a); -#ifdef REFLECTIONFRESNEL -var reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a); -#ifdef REFLECTIONFRESNELFROMSPECULAR -#ifdef SPECULARTERM -reflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a); -#else -reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a); -#endif -#else -reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a); -#endif -#endif -#endif -#ifdef REFRACTIONFRESNEL -var refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a); -#endif -#ifdef OPACITY -var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset); -#ifdef OPACITYRGB -opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* uniforms.vOpacityInfos.y; -#else -alpha*=opacityMap.a*uniforms.vOpacityInfos.y; -#endif -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=fragmentInputs.vColor.a; -#endif -#ifdef OPACITYFRESNEL -var opacityFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.opacityParts.z,uniforms.opacityParts.w);alpha+=uniforms.opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*uniforms.opacityParts.y; -#endif -#ifdef ALPHATEST -#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS -if (alpha -#include -#ifdef IMAGEPROCESSINGPOSTPROCESS -color=vec4f(toLinearSpaceVec3(color.rgb),color.a); -#else -#ifdef IMAGEPROCESSING -color=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color); -#endif -#endif -color=vec4f(color.rgb,color.a*mesh.visibility); -#ifdef PREMULTIPLYALPHA -color=vec4f(color.rgb*color.a, color.a); -#endif -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#if SCENE_MRT_COUNT>0 -var writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);var fragData: array,SCENE_MRT_COUNT>; -#ifdef PREPASS_COLOR -fragData[PREPASS_COLOR_INDEX]=color; -#endif -#ifdef PREPASS_POSITION -fragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo); -#endif -#ifdef PREPASS_LOCAL_POSITION -fragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo); -#endif -#ifdef PREPASS_VELOCITY -var a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo); -#elif defined(PREPASS_VELOCITY_LINEAR) -var velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) - -(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_IRRADIANCE -fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_DEPTH -fragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_SCREENSPACE_DEPTH -fragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -fragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMAL -#ifdef PREPASS_NORMAL_WORLDSPACE -fragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo); -#else -fragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo); -#endif -#endif -#ifdef PREPASS_WORLD_NORMAL -fragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO -fragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -fragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo); -#endif -#ifdef PREPASS_REFLECTIVITY -#if defined(SPECULAR) -fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; -#else -fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo; -#endif -#endif -#if SCENE_MRT_COUNT>0 -fragmentOutputs.fragData0=fragData[0]; -#endif -#if SCENE_MRT_COUNT>1 -fragmentOutputs.fragData1=fragData[1]; -#endif -#if SCENE_MRT_COUNT>2 -fragmentOutputs.fragData2=fragData[2]; -#endif -#if SCENE_MRT_COUNT>3 -fragmentOutputs.fragData3=fragData[3]; -#endif -#if SCENE_MRT_COUNT>4 -fragmentOutputs.fragData4=fragData[4]; -#endif -#if SCENE_MRT_COUNT>5 -fragmentOutputs.fragData5=fragData[5]; -#endif -#if SCENE_MRT_COUNT>6 -fragmentOutputs.fragData6=fragData[6]; -#endif -#if SCENE_MRT_COUNT>7 -fragmentOutputs.fragData7=fragData[7]; -#endif -#endif -#endif -#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY) -fragmentOutputs.color=color; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;} -#endif -#define CUSTOM_FRAGMENT_MAIN_END -} -`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=f);const g={name:e,shader:f};export{g as defaultPixelShaderWGSL}; diff --git a/assets/default.fragment-DCtdE8mC.js b/assets/default.fragment-DCtdE8mC.js deleted file mode 100644 index 52d06d9fdbdd750d5e5cdb81983734710a00c367..0000000000000000000000000000000000000000 --- a/assets/default.fragment-DCtdE8mC.js +++ /dev/null @@ -1,422 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./oitFragment-cUdAGBvC.js";import"./defaultUboDeclaration-D-KK91Cl.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";import"./helperFunctions-tBt4f_K3.js";import"./shadowsFragmentFunctions-dMCKkVlT.js";import"./lightsFragmentFunctions-BfknEtlf.js";import"./bumpFragment-Dn7_UB6Q.js";import"./imageProcessingFunctions-BwYIAaLN.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./fogFragment-M_o52SDz.js";import"./decalFragment-1pWMlRR5.js";import"./lightFragment-CZjYZOQF.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const o="defaultFragmentDeclaration",n=`uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 vSpecularColor;uniform vec3 vEmissiveColor;uniform vec3 vAmbientColor;uniform float visibility; -#ifdef DIFFUSE -uniform vec2 vDiffuseInfos; -#endif -#ifdef AMBIENT -uniform vec2 vAmbientInfos; -#endif -#ifdef OPACITY -uniform vec2 vOpacityInfos; -#endif -#ifdef EMISSIVE -uniform vec2 vEmissiveInfos; -#endif -#ifdef LIGHTMAP -uniform vec2 vLightmapInfos; -#endif -#ifdef BUMP -uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams; -#endif -#ifdef ALPHATEST -uniform float alphaCutOff; -#endif -#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS) -uniform mat4 view; -#endif -#ifdef REFRACTION -uniform vec4 vRefractionInfos; -#ifndef REFRACTIONMAP_3D -uniform mat4 refractionMatrix; -#endif -#ifdef REFRACTIONFRESNEL -uniform vec4 refractionLeftColor;uniform vec4 refractionRightColor; -#endif -#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D) -uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; -#endif -#endif -#if defined(SPECULAR) && defined(SPECULARTERM) -uniform vec2 vSpecularInfos; -#endif -#ifdef DIFFUSEFRESNEL -uniform vec4 diffuseLeftColor;uniform vec4 diffuseRightColor; -#endif -#ifdef OPACITYFRESNEL -uniform vec4 opacityParts; -#endif -#ifdef EMISSIVEFRESNEL -uniform vec4 emissiveLeftColor;uniform vec4 emissiveRightColor; -#endif -#if defined(REFLECTION) || (defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)) -uniform vec2 vReflectionInfos; -#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX) -uniform mat4 reflectionMatrix; -#endif -#ifndef REFLECTIONMAP_SKYBOX -#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC) -uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; -#endif -#endif -#ifdef REFLECTIONFRESNEL -uniform vec4 reflectionLeftColor;uniform vec4 reflectionRightColor; -#endif -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos; -#endif -#include -#define ADDITIONAL_FRAGMENT_DECLARATION -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=n);const r="fresnelFunction",a=`#ifdef FRESNEL -float computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power) -{float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);} -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=a);const i="defaultPixelShader",f=`#define CUSTOM_FRAGMENT_EXTENSION -#include<__decl__defaultFragment> -#if defined(BUMP) || !defined(NORMAL) -#extension GL_OES_standard_derivatives : enable -#endif -#include[SCENE_MRT_COUNT] -#include -#define CUSTOM_FRAGMENT_BEGIN -#ifdef LOGARITHMICDEPTH -#extension GL_EXT_frag_depth : enable -#endif -varying vec3 vPositionW; -#ifdef NORMAL -varying vec3 vNormalW; -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vec4 vColor; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying float vViewDepth; -#endif -#include[1..7] -#include -#include<__decl__lightFragment>[0..maxSimultaneousLights] -#include -#include -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef REFRACTION -#ifdef REFRACTIONMAP_3D -uniform samplerCube refractionCubeSampler; -#else -uniform sampler2D refraction2DSampler; -#endif -#endif -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular) -#endif -#include -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -uniform samplerCube reflectionCubeSampler; -#else -uniform sampler2D reflection2DSampler; -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#endif -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; -#ifdef NORMAL -vec3 normalW=normalize(vNormalW); -#else -vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w; -#endif -#include -#ifdef TWOSIDEDLIGHTING -normalW=gl_FrontFacing ? normalW : -normalW; -#endif -#ifdef DIFFUSE -baseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset); -#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS) -if (baseColor.a(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_) -#endif -#include -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -baseColor.rgb*=vColor.rgb; -#endif -#ifdef DETAIL -baseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y); -#endif -#if defined(DECAL) && defined(DECAL_AFTER_DETAIL) -vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset); -#include(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_) -#endif -#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE -vec3 baseAmbientColor=vec3(1.,1.,1.); -#ifdef AMBIENT -baseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y; -#endif -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb; -#ifdef SPECULARTERM -#ifdef SPECULAR -vec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);specularColor=specularMapColor.rgb; -#ifdef GLOSSINESS -glossiness=glossiness*specularMapColor.a; -#endif -#endif -#endif -vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info; -#ifdef SPECULARTERM -vec3 specularBase=vec3(0.,0.,0.); -#endif -float shadow=1.;float aggShadow=0.;float numLights=0.; -#ifdef LIGHTMAP -vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset); -#ifdef RGBDLIGHTMAP -lightmapColor.rgb=fromRGBD(lightmapColor); -#endif -lightmapColor.rgb*=vLightmapInfos.y; -#endif -#include[0..maxSimultaneousLights] -aggShadow=aggShadow/numLights;vec4 refractionColor=vec4(0.,0.,0.,1.); -#ifdef REFRACTION -vec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y)); -#ifdef REFRACTIONMAP_3D -#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC -refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition); -#endif -refractionVector.y=refractionVector.y*vRefractionInfos.w;vec4 refractionLookup=textureCube(refractionCubeSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;} -#else -vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=texture2D(refraction2DSampler,refractionCoords); -#endif -#ifdef RGBDREFRACTION -refractionColor.rgb=fromRGBD(refractionColor); -#endif -#ifdef IS_REFRACTION_LINEAR -refractionColor.rgb=toGammaSpace(refractionColor.rgb); -#endif -refractionColor.rgb*=vRefractionInfos.x; -#endif -vec4 reflectionColor=vec4(0.,0.,0.,1.); -#ifdef REFLECTION -vec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -vReflectionUVW.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -#ifdef ROUGHNESS -float bias=vReflectionInfos.y; -#ifdef SPECULARTERM -#ifdef SPECULAR -#ifdef GLOSSINESS -bias*=(1.0-specularMapColor.a); -#endif -#endif -#endif -reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias); -#else -reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW); -#endif -#else -vec2 coords=vReflectionUVW.xy; -#ifdef REFLECTIONMAP_PROJECTION -coords/=vReflectionUVW.z; -#endif -coords.y=1.0-coords.y;reflectionColor=texture2D(reflection2DSampler,coords); -#endif -#ifdef RGBDREFLECTION -reflectionColor.rgb=fromRGBD(reflectionColor); -#endif -#ifdef IS_REFLECTION_LINEAR -reflectionColor.rgb=toGammaSpace(reflectionColor.rgb); -#endif -reflectionColor.rgb*=vReflectionInfos.x; -#ifdef REFLECTIONFRESNEL -float reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a); -#ifdef REFLECTIONFRESNELFROMSPECULAR -#ifdef SPECULARTERM -reflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb; -#else -reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb; -#endif -#else -reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb; -#endif -#endif -#endif -#ifdef REFRACTIONFRESNEL -float refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);refractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb; -#endif -#ifdef OPACITY -vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset); -#ifdef OPACITYRGB -opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y; -#else -alpha*=opacityMap.a*vOpacityInfos.y; -#endif -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=vColor.a; -#endif -#ifdef OPACITYFRESNEL -float opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);alpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y; -#endif -#ifdef ALPHATEST -#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS -if (alpha -#include -#ifdef IMAGEPROCESSINGPOSTPROCESS -color.rgb=toLinearSpace(color.rgb); -#else -#ifdef IMAGEPROCESSING -color.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color); -#endif -#endif -color.a*=visibility; -#ifdef PREMULTIPLYALPHA -color.rgb*=color.a; -#endif -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#if SCENE_MRT_COUNT>0 -float writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0; -#ifdef PREPASS_COLOR -gl_FragData[PREPASS_COLOR_INDEX]=color; -#endif -#ifdef PREPASS_POSITION -gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo); -#endif -#ifdef PREPASS_LOCAL_POSITION -gl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo); -#endif -#if defined(PREPASS_VELOCITY) -vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo); -#elif defined(PREPASS_VELOCITY_LINEAR) -vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_IRRADIANCE -gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_DEPTH -gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_SCREENSPACE_DEPTH -gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -gl_FragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4(vNormViewDepth,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMAL -#ifdef PREPASS_NORMAL_WORLDSPACE -gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo); -#else -gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); -#endif -#endif -#ifdef PREPASS_WORLD_NORMAL -gl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO -gl_FragData[PREPASS_ALBEDO_INDEX]=vec4(baseColor.rgb,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqrt(baseColor.rgb),writeGeometryInfo); -#endif -#ifdef PREPASS_REFLECTIVITY -#if defined(SPECULAR) -gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; -#else -gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo; -#endif -#endif -#endif -#endif -#if !defined(PREPASS) || defined(WEBGL2) -gl_FragColor=color; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {frontColor.rgb+=color.rgb*color.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-color.a);} else {backColor+=color;} -#endif -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=f);const L={name:i,shader:f};export{L as defaultPixelShader}; diff --git a/assets/default.vertex-BJO2DRWc.js b/assets/default.vertex-BJO2DRWc.js deleted file mode 100644 index c52e08a83ab8028781f7c3419fb3838795971409..0000000000000000000000000000000000000000 --- a/assets/default.vertex-BJO2DRWc.js +++ /dev/null @@ -1,193 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./vertexColorMixing-DoZiZfly.js";import"./defaultUboDeclaration-D-KK91Cl.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";import"./bumpVertexDeclaration-DMtCfYrP.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./logDepthVertex-zXeqwUWs.js";import"./shadowsVertex-w5DW1avO.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./bumpVertex-dKv8gF7O.js";import"./pointCloudVertex-wpVdAlmJ.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const n="defaultVertexDeclaration",d=`uniform mat4 viewProjection; -#ifdef MULTIVIEW -mat4 viewProjectionR; -#endif -uniform mat4 view; -#ifdef DIFFUSE -uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; -#endif -#ifdef AMBIENT -uniform mat4 ambientMatrix;uniform vec2 vAmbientInfos; -#endif -#ifdef OPACITY -uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos; -#endif -#ifdef EMISSIVE -uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix; -#endif -#ifdef LIGHTMAP -uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix; -#endif -#if defined(SPECULAR) && defined(SPECULARTERM) -uniform vec2 vSpecularInfos;uniform mat4 specularMatrix; -#endif -#ifdef BUMP -uniform vec3 vBumpInfos;uniform mat4 bumpMatrix; -#endif -#ifdef REFLECTION -uniform mat4 reflectionMatrix; -#endif -#ifdef POINTSIZE -uniform float pointSize; -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos;uniform mat4 detailMatrix; -#endif -uniform vec4 cameraInfo; -#include -#define ADDITIONAL_VERTEX_DECLARATION -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=d);const i="defaultVertexShader",t=`#define CUSTOM_VERTEX_EXTENSION -#include<__decl__defaultVertex> -#define CUSTOM_VERTEX_BEGIN -attribute vec3 position; -#ifdef NORMAL -attribute vec3 normal; -#endif -#ifdef TANGENT -attribute vec4 tangent; -#endif -#ifdef UV1 -attribute vec2 uv; -#endif -#include[2..7] -#ifdef VERTEXCOLOR -attribute vec4 color; -#endif -#include -#include -#include -#include -#include -#include[1..7] -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap) -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular) -#endif -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -varying vec3 vPositionW; -#ifdef NORMAL -varying vec3 vNormalW; -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vec4 vColor; -#endif -#include -#include -#include -#include<__decl__lightVxFragment>[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying float vViewDepth; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -vec3 positionUpdated=position; -#ifdef NORMAL -vec3 normalUpdated=normal; -#endif -#ifdef TANGENT -vec4 tangentUpdated=tangent; -#endif -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#ifdef VERTEXCOLOR -vec4 colorUpdated=color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0); -#ifdef NORMAL -mat3 normalWorld=mat3(finalWorld); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vNormalW=normalize(normalWorld*normalUpdated); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;} -#else -gl_Position=viewProjection*worldPos; -#endif -vPositionW=vec3(worldPos); -#ifdef PREPASS -#include -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0))); -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#ifdef RIGHT_HANDED -vViewDepth=-(view*worldPos).z; -#else -vViewDepth=(view*worldPos).z; -#endif -#endif -#ifndef UV1 -vec2 uvUpdated=vec2(0.,0.); -#endif -#ifndef UV2 -vec2 uv2Updated=vec2(0.,0.); -#endif -#ifdef MAINUV1 -vMainUV1=uvUpdated; -#endif -#ifdef MAINUV2 -vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x) -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x) -#endif -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=t);const T={name:i,shader:t};export{T as defaultVertexShader}; diff --git a/assets/default.vertex-Ck1DuK1F.js b/assets/default.vertex-Ck1DuK1F.js deleted file mode 100644 index faf2660cf87f6c5f381bf6868da8149ed6303210..0000000000000000000000000000000000000000 --- a/assets/default.vertex-Ck1DuK1F.js +++ /dev/null @@ -1,181 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./defaultUboDeclaration-D9mC3D5S.js";import"./vertexColorMixing-BV8k1N8l.js";import"./helperFunctions-Wgh3PIP0.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./instancesDeclaration-ConO0l1b.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";import"./bumpVertexDeclaration-p9pSA1UA.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./logDepthVertex-CfHieHf5.js";import"./shadowsVertex-DKtacRyL.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./bumpVertex-DVPnlCbV.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const t="lightVxFragmentDeclaration",r=`#ifdef LIGHT{X} -uniform vLightData{X}: vec4f;uniform vLightDiffuse{X}: vec4f; -#ifdef SPECULARTERM -uniform vLightSpecular{X}: vec4f; -#else -var vLightSpecular{X}: vec4f= vec4f(0.); -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform lightMatrix{X}: mat4x4f[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromLight{X}: vec4f[SHADOWCSMNUM_CASCADES{X}];varying var vDepthMetric{X}: f32[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromCamera{X}: vec4f; -#elif defined(SHADOWCUBE{X}) -#else -varying var vPositionFromLight{X}: vec4f;varying var vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f; -#endif -uniform shadowsInfo{X}: vec4f;uniform depthValues{X}: vec2f; -#endif -#ifdef SPOTLIGHT{X} -uniform vLightDirection{X}: vec4f;uniform vLightFalloff{X}: vec4f; -#elif defined(POINTLIGHT{X}) -uniform vLightFalloff{X}: vec4f; -#elif defined(HEMILIGHT{X}) -uniform vLightGround{X}: vec3f; -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -uniform vLightWidth{X}: vec4f;uniform vLightHeight{X}: vec4f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=r);const i="defaultVertexShader",n=`#include -#define CUSTOM_VERTEX_BEGIN -attribute position: vec3f; -#ifdef NORMAL -attribute normal: vec3f; -#endif -#ifdef TANGENT -attribute tangent: vec4f; -#endif -#ifdef UV1 -attribute uv: vec2f; -#endif -#include[2..7] -#ifdef VERTEXCOLOR -attribute color: vec4f; -#endif -#include -#include -#include -#include -#include -#include[1..7] -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap) -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular) -#endif -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -varying vPositionW: vec3f; -#ifdef NORMAL -varying vNormalW: vec3f; -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vColor: vec4f; -#endif -#include -#include -#include -#include<__decl__lightVxFragment>[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying vViewDepth: f32; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -var positionUpdated: vec3f=vertexInputs.position; -#ifdef NORMAL -var normalUpdated: vec3f=vertexInputs.normal; -#endif -#ifdef TANGENT -var tangentUpdated: vec4f=vertexInputs.tangent; -#endif -#ifdef UV1 -var uvUpdated: vec2f=vertexInputs.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=vertexInputs.uv2; -#endif -#ifdef VERTEXCOLOR -var colorUpdated: vec4f=vertexInputs.color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vertexOutputs.vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0); -#endif -#include -#include -var worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0); -#ifdef NORMAL -var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;} -#else -vertexOutputs.position=scene.viewProjection*worldPos; -#endif -vertexOutputs.vPositionW= worldPos.xyz; -#ifdef PREPASS -#include -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz); -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#ifdef RIGHT_HANDED -vertexOutputs.vViewDepth=-(scene.view*worldPos).z; -#else -vertexOutputs.vViewDepth=(scene.view*worldPos).z; -#endif -#endif -#ifndef UV1 -var uvUpdated: vec2f=vec2f(0.,0.); -#endif -#ifdef MAINUV1 -vertexOutputs.vMainUV1=uvUpdated; -#endif -#ifndef UV2 -var uv2Updated: vec2f=vec2f(0.,0.); -#endif -#ifdef MAINUV2 -vertexOutputs.vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x) -#if defined(SPECULARTERM) -#include(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x) -#endif -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;e.ShadersStoreWGSL[i]||(e.ShadersStoreWGSL[i]=n);const S={name:i,shader:n};export{S as defaultVertexShaderWGSL}; diff --git a/assets/defaultUboDeclaration-D-KK91Cl.js b/assets/defaultUboDeclaration-D-KK91Cl.js deleted file mode 100644 index d4afbd6024ee99ccee0358ad80b30cb8ae94a6f9..0000000000000000000000000000000000000000 --- a/assets/defaultUboDeclaration-D-KK91Cl.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const o="defaultUboDeclaration",i=`layout(std140,column_major) uniform;uniform Material -{vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor;vec4 cameraInfo;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionPosition;vec3 vReflectionSize; -#define ADDITIONAL_UBO_DECLARATION -}; -#include -#include -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=i); diff --git a/assets/defaultUboDeclaration-D9mC3D5S.js b/assets/defaultUboDeclaration-D9mC3D5S.js deleted file mode 100644 index e28289fccc39f37fea7ed9e4a961bcb9eb111f2d..0000000000000000000000000000000000000000 --- a/assets/defaultUboDeclaration-D9mC3D5S.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as f}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const o="defaultUboDeclaration",i=`uniform diffuseLeftColor: vec4f;uniform diffuseRightColor: vec4f;uniform opacityParts: vec4f;uniform reflectionLeftColor: vec4f;uniform reflectionRightColor: vec4f;uniform refractionLeftColor: vec4f;uniform refractionRightColor: vec4f;uniform emissiveLeftColor: vec4f;uniform emissiveRightColor: vec4f;uniform vDiffuseInfos: vec2f;uniform vAmbientInfos: vec2f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vSpecularInfos: vec2f;uniform vBumpInfos: vec3f;uniform diffuseMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform specularMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform pointSize: f32;uniform alphaCutOff: f32;uniform refractionMatrix: mat4x4f;uniform vRefractionInfos: vec4f;uniform vRefractionPosition: vec3f;uniform vRefractionSize: vec3f;uniform vSpecularColor: vec4f;uniform vEmissiveColor: vec3f;uniform vDiffuseColor: vec4f;uniform vAmbientColor: vec3f;uniform cameraInfo: vec4f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f; -#define ADDITIONAL_UBO_DECLARATION -#include -#include -`;f.IncludesShadersStoreWGSL[o]||(f.IncludesShadersStoreWGSL[o]=i); diff --git a/assets/depth.fragment-CTRWe7YE.js b/assets/depth.fragment-CTRWe7YE.js deleted file mode 100644 index ba74babab46d23f92328b1fd82d72d7d9f763292..0000000000000000000000000000000000000000 --- a/assets/depth.fragment-CTRWe7YE.js +++ /dev/null @@ -1,40 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./packingFunctions-Dod19T_v.js";import"./index-DydPgVMC.js";const e="depthPixelShader",t=`#ifdef ALPHATEST -varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d; -#endif -#include -varying vDepthMetric: f32; -#ifdef PACKED -#include -#endif -#ifdef STORE_CAMERASPACE_Z -varying vViewPos: vec4f; -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#include -#ifdef ALPHATEST -if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;} -#endif -#ifdef STORE_CAMERASPACE_Z -#ifdef PACKED -fragmentOutputs.color=pack(input.vViewPos.z); -#else -fragmentOutputs.color= vec4f(input.vViewPos.z,0.0,0.0,1.0); -#endif -#else -#ifdef NONLINEARDEPTH -#ifdef PACKED -fragmentOutputs.color=pack(input.position.z); -#else -fragmentOutputs.color= vec4f(input.position.z,0.0,0.0,0.0); -#endif -#else -#ifdef PACKED -fragmentOutputs.color=pack(input.vDepthMetric); -#else -fragmentOutputs.color= vec4f(input.vDepthMetric,0.0,0.0,1.0); -#endif -#endif -#endif -}`;i.ShadersStoreWGSL[e]||(i.ShadersStoreWGSL[e]=t);const p={name:e,shader:t};export{p as depthPixelShaderWGSL}; diff --git a/assets/depth.vertex-BAaQWRpW.js b/assets/depth.vertex-BAaQWRpW.js deleted file mode 100644 index cb759c2bcb058a65e48e9ba2df3150ed71b45b38..0000000000000000000000000000000000000000 --- a/assets/depth.vertex-BAaQWRpW.js +++ /dev/null @@ -1,57 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./instancesDeclaration-ConO0l1b.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./index-DydPgVMC.js";const e="depthVertexShader",i=`attribute position: vec3f; -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -uniform viewProjection: mat4x4f;uniform depthValues: vec2f; -#if defined(ALPHATEST) || defined(NEED_UV) -varying vUV: vec2f;uniform diffuseMatrix: mat4x4f; -#ifdef UV1 -attribute uv: vec2f; -#endif -#ifdef UV2 -attribute uv2: vec2f; -#endif -#endif -#ifdef STORE_CAMERASPACE_Z -uniform view: mat4x4f;varying vViewPos: vec4f; -#endif -varying vDepthMetric: f32; -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position; -#ifdef UV1 -var uvUpdated: vec2f=input.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=input.uv2; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0); -#include -vertexOutputs.position=uniforms.viewProjection*worldPos; -#ifdef STORE_CAMERASPACE_Z -vertexOutputs.vViewPos=uniforms.view*worldPos; -#else -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y)); -#else -vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y)); -#endif -#endif -#if defined(ALPHATEST) || defined(BASIC_RENDER) -#ifdef UV1 -vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#ifdef UV2 -vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#endif -} -`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=i);const c={name:e,shader:i};export{c as depthVertexShaderWGSL}; diff --git a/assets/depthBoxBlur.fragment-CZANnozR.js b/assets/depthBoxBlur.fragment-CZANnozR.js deleted file mode 100644 index 92f243aeb0ecc1ca8f236f158fd6118335ff4ed8..0000000000000000000000000000000000000000 --- a/assets/depthBoxBlur.fragment-CZANnozR.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="depthBoxBlurPixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d;uniform screenSize: vec2f; -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var colorDepth: vec4f=vec4f(0.0);for (var x: i32=-OFFSET; x<=OFFSET; x++) {for (var y: i32=-OFFSET; y<=OFFSET; y++) {colorDepth+=textureSample(textureSampler,textureSamplerSampler,input.vUV+ vec2f(f32(x),f32(y))/uniforms.screenSize);}} -fragmentOutputs.color=(colorDepth/ f32((OFFSET*2+1)*(OFFSET*2+1)));}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const o={name:e,shader:t};export{o as depthBoxBlurPixelShaderWGSL}; diff --git a/assets/depthBoxBlur.fragment-n0OjllU-.js b/assets/depthBoxBlur.fragment-n0OjllU-.js deleted file mode 100644 index 80a9e1688a4b8c47a2d896fa36457add96d8a761..0000000000000000000000000000000000000000 --- a/assets/depthBoxBlur.fragment-n0OjllU-.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="depthBoxBlurPixelShader",o=`varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize; -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{vec4 colorDepth=vec4(0.0);for (int x=-OFFSET; x<=OFFSET; x++) -for (int y=-OFFSET; y<=OFFSET; y++) -colorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const i={name:e,shader:o};export{i as depthBoxBlurPixelShader}; diff --git a/assets/diagram-PSM6KHXK-Bwe0eN86.js b/assets/diagram-PSM6KHXK-Bwe0eN86.js deleted file mode 100644 index 49774def80fd6e174955ed4a31399e1cc5cf1504..0000000000000000000000000000000000000000 --- a/assets/diagram-PSM6KHXK-Bwe0eN86.js +++ /dev/null @@ -1,24 +0,0 @@ -import{_ as h,E as j,G as q,I as re,d as ne,l as B,a9 as L,b as oe,a as ie,p as ce,q as pe,g as de,s as he,F as me,aa as ue,y as fe}from"./mermaid.core-BcqUqpnI.js";import{s as ye}from"./chunk-QN33PNHL-DUQNEUQT.js";import{p as ge}from"./chunk-4BX2VUAB-BSrsJ5gp.js";import{p as Se}from"./treemap-KMMF4GRG-BAURD4mW.js";import{f as P}from"./defaultLocale-CzDG__Ur.js";import{o as R}from"./ordinal-BeghXfj9.js";import{h as xe,t as be}from"./index-BU4IRnz1.js";import{s as W}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";import"./init-Dmth1JHB.js";var U=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=oe,this.getAccTitle=ie,this.setDiagramTitle=ce,this.getDiagramTitle=pe,this.getAccDescription=de,this.setAccDescription=he}static{h(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const s=me,a=q();return j({...s.treemap,...a.treemap??{}})}addNode(s,a){this.nodes.push(s),this.levels.set(s,a),a===0&&(this.outerNodes.push(s),this.root??=s)}getRoot(){return{name:"",children:this.outerNodes}}addClass(s,a){const o=this.classes.get(s)??{id:s,styles:[],textStyles:[]},i=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(p=>{ue(p)&&(o?.textStyles?o.textStyles.push(p):o.textStyles=[p]),o?.styles?o.styles.push(p):o.styles=[p]}),this.classes.set(s,o)}getClasses(){return this.classes}getStylesForClass(s){return this.classes.get(s)?.styles??[]}clear(){fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function J(s){if(!s.length)return[];const a=[],o=[];return s.forEach(i=>{const p={name:i.name,children:i.type==="Leaf"?void 0:[]};for(p.classSelector=i?.classSelector,i?.cssCompiledStyles&&(p.cssCompiledStyles=[i.cssCompiledStyles]),i.type==="Leaf"&&i.value!==void 0&&(p.value=i.value);o.length>0&&o[o.length-1].level>=i.level;)o.pop();if(o.length===0)a.push(p);else{const n=o[o.length-1].node;n.children?n.children.push(p):n.children=[p]}i.type!=="Leaf"&&o.push({node:p,level:i.level})}),a}h(J,"buildHierarchy");var ve=h((s,a)=>{ge(s,a);const o=[];for(const n of s.TreemapRows??[])n.$type==="ClassDefStatement"&&a.addClass(n.className??"",n.styleText??"");for(const n of s.TreemapRows??[]){const d=n.item;if(!d)continue;const u=n.indent?parseInt(n.indent):0,M=Ce(d),l=d.classSelector?a.getStylesForClass(d.classSelector):[],F=l.length>0?l.join(";"):void 0,b={level:u,name:M,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:F};o.push(b)}const i=J(o),p=h((n,d)=>{for(const u of n)a.addNode(u,d),u.children&&u.children.length>0&&p(u.children,d+1)},"addNodesRecursively");p(i,0)},"populate"),Ce=h(s=>s.name?String(s.name):"","getItemName"),K={parser:{yy:void 0},parse:h(async s=>{try{const o=await Se("treemap",s);B.debug("Treemap AST:",o);const i=K.parser?.yy;if(!(i instanceof U))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ve(o,i)}catch(a){throw B.error("Error parsing treemap:",a),a}},"parse")},we=10,$=10,D=25,Te=h((s,a,o,i)=>{const p=i.db,n=p.getConfig(),d=n.padding??we,u=p.getDiagramTitle(),M=p.getRoot(),{themeVariables:l}=q();if(!M)return;const F=u?30:0,b=re(a),I=n.nodeWidth?n.nodeWidth*$:960,G=n.nodeHeight?n.nodeHeight*$:500,_=I,O=G+F;b.attr("viewBox",`0 0 ${_} ${O}`),ne(b,O,_,n.useMaxWidth);let v;try{const e=n.valueFormat||",";if(e==="$0,0")v=h(t=>"$"+P(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const t=/\.\d+/.exec(e),r=t?t[0]:"";v=h(m=>"$"+P(","+r)(m),"valueFormat")}else if(e.startsWith("$")){const t=e.substring(1);v=h(r=>"$"+P(t||"")(r),"valueFormat")}else v=P(e)}catch(e){B.error("Error creating format function:",e),v=P(",")}const z=R().range(["transparent",l.cScale0,l.cScale1,l.cScale2,l.cScale3,l.cScale4,l.cScale5,l.cScale6,l.cScale7,l.cScale8,l.cScale9,l.cScale10,l.cScale11]),Q=R().range(["transparent",l.cScalePeer0,l.cScalePeer1,l.cScalePeer2,l.cScalePeer3,l.cScalePeer4,l.cScalePeer5,l.cScalePeer6,l.cScalePeer7,l.cScalePeer8,l.cScalePeer9,l.cScalePeer10,l.cScalePeer11]),V=R().range([l.cScaleLabel0,l.cScaleLabel1,l.cScaleLabel2,l.cScaleLabel3,l.cScaleLabel4,l.cScaleLabel5,l.cScaleLabel6,l.cScaleLabel7,l.cScaleLabel8,l.cScaleLabel9,l.cScaleLabel10,l.cScaleLabel11]);u&&b.append("text").attr("x",_/2).attr("y",F/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const X=b.append("g").attr("transform",`translate(0, ${F})`).attr("class","treemapContainer"),Z=xe(M).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),Y=be().size([I,G]).paddingTop(e=>e.children&&e.children.length>0?D+$:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?$:0).paddingRight(e=>e.children&&e.children.length>0?$:0).paddingBottom(e=>e.children&&e.children.length>0?$:0).round(!0)(Z),ee=Y.descendants().filter(e=>e.children&&e.children.length>0),N=X.selectAll(".treemapSection").data(ee).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);N.append("rect").attr("width",e=>e.x1-e.x0).attr("height",D).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),N.append("clipPath").attr("id",(e,t)=>`clip-section-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",D),N.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>z(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>Q(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const t=L({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),N.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",D/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const t="dominant-baseline: middle; font-size: 12px; fill:"+V(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",r=L({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const t=W(this),r=e.data.name;t.text(r);const m=e.x1-e.x0,y=6;let g;n.showValues!==!1&&e.value?g=m-10-30-10-y:g=m-y-6;const S=Math.max(15,g),c=t.node();if(c.getComputedTextLength()>S){let f=r;for(;f.length>0;){if(f=r.substring(0,f.length-1),f.length===0){t.text("..."),c.getComputedTextLength()>S&&t.text("");break}if(t.text(f+"..."),c.getComputedTextLength()<=S)break}}}),n.showValues!==!1&&N.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",D/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?v(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+V(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",r=L({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")});const te=Y.leaves(),E=X.selectAll(".treemapLeafGroup").data(te).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?z(e.parent.data.name):z(e.data.name)).attr("style",e=>L({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?z(e.parent.data.name):z(e.data.name)).attr("stroke-width",3),E.append("clipPath").attr("id",(e,t)=>`clip-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),E.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const t="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+V(e.data.name)+";",r=L({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.data.name).each(function(e){const t=W(this),r=e.x1-e.x0,m=e.y1-e.y0,y=t.node(),g=4,T=r-2*g,S=m-2*g;if(T<10||S<10){t.style("display","none");return}let c=parseInt(t.style("font-size"),10);const C=8,x=28,f=.6,w=6,A=2;for(;y.getComputedTextLength()>T&&c>C;)c--,t.style("font-size",`${c}px`);let k=Math.max(w,Math.min(x,Math.round(c*f))),H=c+A+k;for(;H>S&&c>C&&(c--,k=Math.max(w,Math.min(x,Math.round(c*f))),!(kT||c(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{const r="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+V(t.data.name)+";",m=L({cssCompiledStyles:t.data.cssCompiledStyles});return r+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,r)=>`url(#clip-${a}-${r})`).text(t=>t.value?v(t.value):"").each(function(t){const r=W(this),m=this.parentNode;if(!m){r.style("display","none");return}const y=W(m).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){r.style("display","none");return}const g=parseFloat(y.style("font-size")),T=28,S=.6,c=6,C=2,x=Math.max(c,Math.min(T,Math.round(g*S)));r.style("font-size",`${x}px`);const w=(t.y1-t.y0)/2+g/2+C;r.attr("y",w);const A=t.x1-t.x0,le=t.y1-t.y0-4,se=A-8;r.node().getComputedTextLength()>se||w+x>le||x{const a=j(Fe,s);return` - .treemapNode.section { - stroke: ${a.sectionStrokeColor}; - stroke-width: ${a.sectionStrokeWidth}; - fill: ${a.sectionFillColor}; - } - .treemapNode.leaf { - stroke: ${a.leafStrokeColor}; - stroke-width: ${a.leafStrokeWidth}; - fill: ${a.leafFillColor}; - } - .treemapLabel { - fill: ${a.labelColor}; - font-size: ${a.labelFontSize}; - } - .treemapValue { - fill: ${a.valueColor}; - font-size: ${a.valueFontSize}; - } - .treemapTitle { - fill: ${a.titleColor}; - font-size: ${a.titleFontSize}; - } - `},"getStyles"),Ne=ze,je={parser:K,get db(){return new U},renderer:$e,styles:Ne};export{je as diagram}; diff --git a/assets/diagram-QEK2KX5R-CH0Hw6Ub.js b/assets/diagram-QEK2KX5R-CH0Hw6Ub.js deleted file mode 100644 index 7657fe67dc1cacdbc210debc74d770698e720530..0000000000000000000000000000000000000000 --- a/assets/diagram-QEK2KX5R-CH0Hw6Ub.js +++ /dev/null @@ -1,43 +0,0 @@ -import{s as k,g as I,q as R,p as E,a as F,b as _,_ as l,I as D,y as G,E as f,F as P,G as C,l as z,L as V}from"./mermaid.core-BcqUqpnI.js";import{p as W}from"./chunk-4BX2VUAB-BSrsJ5gp.js";import{p as B}from"./treemap-KMMF4GRG-BAURD4mW.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:h},m=structuredClone(w),H=P.radar,j=l(()=>f({...H,...C().radar}),"getConfig"),b=l(()=>m.axes,"getAxes"),q=l(()=>m.curves,"getCurves"),N=l(()=>m.options,"getOptions"),U=l(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Z=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule}},"setOptions"),J=l(()=>{G(),m=structuredClone(w)},"clear"),$={getAxes:b,getCurves:q,getOptions:N,setAxes:U,setCurves:X,setOptions:Z,getConfig:j,clear:J,setAccTitle:_,getAccTitle:F,setDiagramTitle:E,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},K=l(a=>{W(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),Q={parse:l(async a=>{const t=await B("radar",a);z.debug(t),K(t)},"parse")},tt=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),u=D(t),p=et(u,c),g=n.max??Math.max(...i.map(y=>Math.max(...y.entries))),x=n.min,v=Math.min(c.width,c.height)/2;at(p,o,v,n.ticks,n.graticule),rt(p,o,v,c),M(p,o,i,x,g,n.graticule,c),T(p,i,n.showLegend,c),p.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),et=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return a.attr("viewbox",`0 0 ${e} ${r}`).attr("width",e).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),at=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const p=2*u*Math.PI/o-Math.PI/2,g=n*Math.cos(p),x=n*Math.sin(p);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),rt=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const p=d.entries.map((g,x)=>{const v=2*Math.PI*x/n-Math.PI/2,y=A(g,r,s,c),O=y*Math.cos(v),S=y*Math.sin(v);return{x:O,y:S}});o==="circle"?a.append("path").attr("d",L(p,i.curveTension)).attr("class",`radarCurve-${u}`):o==="polygon"&&a.append("polygon").attr("points",p.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${u}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var st={draw:tt},nt=l((a,t)=>{let e="";for(let r=0;r{const t=V(),e=C(),r=f(t,e.themeVariables),s=f(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),it=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=ot(a);return` - .radarTitle { - font-size: ${t.fontSize}; - color: ${t.titleColor}; - dominant-baseline: hanging; - text-anchor: middle; - } - .radarAxisLine { - stroke: ${e.axisColor}; - stroke-width: ${e.axisStrokeWidth}; - } - .radarAxisLabel { - dominant-baseline: middle; - text-anchor: middle; - font-size: ${e.axisLabelFontSize}px; - color: ${e.axisColor}; - } - .radarGraticule { - fill: ${e.graticuleColor}; - fill-opacity: ${e.graticuleOpacity}; - stroke: ${e.graticuleColor}; - stroke-width: ${e.graticuleStrokeWidth}; - } - .radarLegendText { - text-anchor: start; - font-size: ${e.legendFontSize}px; - dominant-baseline: hanging; - } - ${nt(t,e)} - `},"styles"),$t={parser:Q,db:$,renderer:st,styles:it};export{$t as diagram}; diff --git a/assets/diagram-S2PKOQOG-DWalJcdR.js b/assets/diagram-S2PKOQOG-DWalJcdR.js deleted file mode 100644 index 22589c8ba4c56e9f8185cd619b73e7db37dc5b60..0000000000000000000000000000000000000000 --- a/assets/diagram-S2PKOQOG-DWalJcdR.js +++ /dev/null @@ -1,24 +0,0 @@ -import{_ as b,E as m,I as $,d as B,l as u,b as C,a as S,p as D,q as T,g as E,s as F,F as P,G as z,y as A}from"./mermaid.core-BcqUqpnI.js";import{p as W}from"./chunk-4BX2VUAB-BSrsJ5gp.js";import{p as _}from"./treemap-KMMF4GRG-BAURD4mW.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";var N=P.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=E,this.setAccDescription=F}static{b(this,"PacketDB")}getConfig(){const t=m({...N,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){A(),this.packet=[]}},I=1e4,L=b((t,e)=>{W(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");u.debug(e),L(e,r)},"parse")},Y=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewbox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())G(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),G=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),O={draw:Y},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=m(j,t);return` - .packetByte { - font-size: ${e.byteFontSize}; - } - .packetByte.start { - fill: ${e.startByteColor}; - } - .packetByte.end { - fill: ${e.endByteColor}; - } - .packetLabel { - fill: ${e.labelColor}; - font-size: ${e.labelFontSize}; - } - .packetTitle { - fill: ${e.titleColor}; - font-size: ${e.titleFontSize}; - } - .packetBlock { - stroke: ${e.blockStrokeColor}; - stroke-width: ${e.blockStrokeWidth}; - fill: ${e.blockFillColor}; - } - `},"styles"),et={parser:v,get db(){return new w},renderer:O,styles:q};export{et as diagram}; diff --git a/assets/discBuilder-BQQfCSDg.js b/assets/discBuilder-BQQfCSDg.js deleted file mode 100644 index 42df5fbf41f02e6de699451be31e1f3522f34ce3..0000000000000000000000000000000000000000 --- a/assets/discBuilder-BQQfCSDg.js +++ /dev/null @@ -1 +0,0 @@ -import{l as h,m as c}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";function x(e){const t=[],a=[],n=[],s=[],o=e.radius||.5,u=e.tessellation||64,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,p=e.sideOrientation===0?0:e.sideOrientation||c.DEFAULTSIDE;t.push(0,0,0),s.push(.5,.5);const D=Math.PI*2*l,v=l===1?D/u:D/(u-1);let d=0;for(let r=0;rO(e,{radius:t,tessellation:a,sideOrientation:o,updatable:s},n);export{O as CreateDisc,x as CreateDiscVertexData,U as DiscBuilder}; diff --git a/assets/dumpTools-CmFNDulw.js b/assets/dumpTools-CmFNDulw.js deleted file mode 100644 index ac6ca4bfa59d2987f13d41cbbaa0b697dc03d8a7..0000000000000000000000000000000000000000 --- a/assets/dumpTools-CmFNDulw.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./pass.fragment-nyUGT5FF.js"])))=>i.map(i=>d[i]); -import{af as y}from"./index-DydPgVMC.js";import{aB as A,d,L as v,aC as b,aq as g,aD as T,aE as C,_ as I,aF as x}from"./index-GY9JDBGV.js";let c=null;async function S(){const n=g.LastCreatedEngine?.createCanvas(100,100)??new OffscreenCanvas(100,100);n instanceof OffscreenCanvas&&v.Warn("DumpData: OffscreenCanvas will be used for dumping data. This may result in lossy alpha values.");const{ThinEngine:i}=await y(async()=>{const{ThinEngine:t}=await import("./index-GY9JDBGV.js").then(a=>a.cv);return{ThinEngine:t}},__vite__mapDeps([0,1,2]),import.meta.url);if(!i.IsSupported)throw new Error("DumpData: No WebGL context available. Cannot dump data.");const r={preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1},e=new i(n,!1,r);g.Instances.pop(),g.OnEnginesDisposedObservable.add(t=>{e&&t!==e&&!e.isDisposed&&g.Instances.length===0&&_()}),e.getCaps().parallelShaderCompile=void 0;const o=new T(e),{passPixelShader:s}=await y(async()=>{const{passPixelShader:t}=await import("./pass.fragment-nyUGT5FF.js");return{passPixelShader:t}},__vite__mapDeps([3,0,1,2]),import.meta.url),p=new C({engine:e,name:s.name,fragmentShader:s.shader,samplerNames:["textureSampler"]});return{canvas:n,dumpEngine:{engine:e,renderer:o,wrapper:p}}}async function P(){return c||(c=S()),await c}class E{static async EncodeImageAsync(i,r,e,o,s,p){const t=await P(),a=t.dumpEngine;a.engine.setSize(r,e,!0);const f=a.engine.createRawTexture(i,r,e,5,!1,!s,1);return a.renderer.setViewport(),a.renderer.applyEffectWrapper(a.wrapper),a.wrapper.effect._bindTexture("textureSampler",f),a.renderer.draw(),f.dispose(),await new Promise((l,u)=>{d.ToBlob(t.canvas,m=>{m?l(m):u(new Error("EncodeImageAsync: Failed to convert canvas to blob."))},o,p)})}}I([x],E,"EncodeImageAsync",null);const R=E.EncodeImageAsync;async function h(n,i,r,e,o="image/png",s,p){const t=await r.readPixels(0,0,n,i),a=new Uint8Array(t.buffer);D(n,i,a,e,o,s,!0,void 0,p)}async function w(n,i,r,e="image/png",o,s=!1,p=!1,t){if(r instanceof Float32Array){const l=new Uint8Array(r.length);let u=r.length;for(;u--;){const m=r[u];l[u]=Math.round(A(m)*255)}r=l}const a=await E.EncodeImageAsync(r,n,i,e,s,t);o!==void 0&&d.DownloadBlob(a,o),a.type!==e&&v.Warn(`DumpData: The requested mimeType '${e}' is not supported. The result has mimeType '${a.type}' instead.`);const f=await a.arrayBuffer();return p?f:`data:${e};base64,${b(f)}`}function D(n,i,r,e,o="image/png",s,p=!1,t=!1,a){s===void 0&&!e&&(s=""),w(n,i,r,o,s,p,t,a).then(f=>{e&&e(f)})}function _(){c&&(c?.then(n=>{n.canvas instanceof HTMLCanvasElement&&n.canvas.remove(),n.dumpEngine&&(n.dumpEngine.engine.dispose(),n.dumpEngine.renderer.dispose(),n.dumpEngine.wrapper.dispose())}),c=null)}const F={DumpData:D,DumpDataAsync:w,DumpFramebuffer:h,Dispose:_},O=()=>{d.DumpData=D,d.DumpDataAsync=w,d.DumpFramebuffer=h};O();export{_ as Dispose,D as DumpData,w as DumpDataAsync,h as DumpFramebuffer,F as DumpTools,R as EncodeImageAsync}; diff --git a/assets/engine.multiRender-C5ZmXIwg.js b/assets/engine.multiRender-C5ZmXIwg.js deleted file mode 100644 index 3228d5143da74068399c97ea77079f11b366eb96..0000000000000000000000000000000000000000 --- a/assets/engine.multiRender-C5ZmXIwg.js +++ /dev/null @@ -1 +0,0 @@ -import{L as V,I as X}from"./index-GY9JDBGV.js";import{WebGPUEngine as f}from"./webgpuEngine-deh0dULk.js";import"./index-DydPgVMC.js";import"./instancesVertex-BZz8JvZy.js";import"./bakedVertexAnimation-Bs9it648.js";import"./instancesDeclaration-ConO0l1b.js";import"./helperFunctions-Wgh3PIP0.js";import"./fresnelFunction-xm2bLg9t.js";import"./meshUboDeclaration-BeSl_gjF.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./decalFragment-zjU901jg.js";import"./audioEngine-D1fuR8_P.js";f.prototype.unBindMultiColorAttachmentFramebuffer=function(t,e=!1,n){n&&n(),this._endCurrentRenderPass(),t.disableAutomaticMSAAResolve||this.resolveMultiFramebuffer(t,!1),e||this.generateMipMapsMultiFramebuffer(t),this._currentRenderTarget=null,this._mrtAttachments=[],this._cacheRenderPipeline.setMRT([]),this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments)};f.prototype.createMultipleRenderTarget=function(t,e,n){let a=!1,l=!0,i=!1,m=!1,c=15,g=1,o=1;const U=0,v=3,H=!1,k=5,N=3553;let x=[],T=[],M=[],_=[],y=[],R=[],b=[],S=[],F=[],A=[],d=!1;const u=this._createHardwareRenderTargetWrapper(!0,!1,t);e!==void 0&&(a=e.generateMipMaps??!1,l=e.generateDepthBuffer??!0,i=e.generateStencilBuffer??!1,m=e.generateDepthTexture??!1,g=e.textureCount??1,c=e.depthTextureFormat??15,x=e.types||x,T=e.samplingModes||T,M=e.useSRGBBuffers||M,_=e.formats||_,y=e.targetTypes||y,R=e.faceIndex||R,b=e.layerIndex||b,S=e.layerCounts||S,F=e.labels||F,A=e.creationFlags||A,o=e.samples??o,d=e.dontCreateTextures??!1);const D=t.width??t,G=t.height??t,B=[],I=[],P=[];u.label=e?.label??"MultiRenderTargetWrapper",u._generateDepthBuffer=l,u._generateStencilBuffer=i,u._attachments=I,u._defaultAttachments=P;let h=null;(l||i||m)&&!d&&(m||(l&&i?c=13:l?c=14:c=19),h=u.createDepthStencilTexture(0,!1,i,1,c,u.label+"-DepthStencil"));const w=e!==void 0&&typeof e=="object"&&e.createMipMaps&&!a;for(let s=0;s;uniform shadowOpacity : f32;uniform renderTargetSize: vec2;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {let uvBasedOpacity=1.0-pow(clamp(length(input.vUV*vec2(2.0)-vec2(1.0)),0.0,1.0),2.0);let screenUv=fragmentInputs.position.xy/uniforms.renderTargetSize;let shadowValue=textureSampleLevel(shadowTexture,shadowTextureSampler,screenUv,0.0).rrr;let totalOpacity=uniforms.shadowOpacity*uvBasedOpacity;let finalShadowValue=mix(vec3(1.0),shadowValue,totalOpacity);let invertedShadowValue=vec3(1.0)-shadowValue;fragmentOutputs.color=vec4f(finalShadowValue,invertedShadowValue.r*totalOpacity);}`;a.ShadersStoreWGSL[e]||(a.ShadersStoreWGSL[e]=t);const n={name:e,shader:t};export{n as envShadowGroundPixelShaderWGSL}; diff --git a/assets/envShadowGround.fragment-L1sPCORS-B5x_mewm.js b/assets/envShadowGround.fragment-L1sPCORS-B5x_mewm.js deleted file mode 100644 index 2c0fd2ead14f59b26ed8fc9726c8ccdeb3abb79f..0000000000000000000000000000000000000000 --- a/assets/envShadowGround.fragment-L1sPCORS-B5x_mewm.js +++ /dev/null @@ -1 +0,0 @@ -import{S as a}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="envShadowGroundPixelShader",r="precision highp float;uniform sampler2D shadowTexture;uniform vec2 renderTargetSize;uniform float shadowOpacity;varying vec2 vUV;void main(void) {float uvBasedOpacity=clamp(length(vUV*vec2(2.0)-vec2(1.0)),0.0,1.0);uvBasedOpacity=uvBasedOpacity*uvBasedOpacity;uvBasedOpacity=1.0-uvBasedOpacity;vec2 screenUv=gl_FragCoord.xy/renderTargetSize;vec3 shadowValue=texture2D(shadowTexture,screenUv).rrr;float totalOpacity=shadowOpacity*uvBasedOpacity;vec3 invertedShadowValue=vec3(1.0)-shadowValue;gl_FragColor.rgb=shadowValue;gl_FragColor.a=invertedShadowValue.r*totalOpacity;}";a.ShadersStore[e]||(a.ShadersStore[e]=r);const d={name:e,shader:r};export{d as envShadowGroundPixelShader}; diff --git a/assets/envShadowGround.vertex-6NXvyWvr-CkOMn0qQ.js b/assets/envShadowGround.vertex-6NXvyWvr-CkOMn0qQ.js deleted file mode 100644 index 0598ecf73b3f3e57cd8a044ccbbebe8edf496232..0000000000000000000000000000000000000000 --- a/assets/envShadowGround.vertex-6NXvyWvr-CkOMn0qQ.js +++ /dev/null @@ -1 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="envShadowGroundVertexShader",r="precision highp float;attribute vec3 position;attribute vec2 uv;uniform mat4 worldViewProjection;varying vec2 vUV;void main(void) {gl_Position=worldViewProjection*vec4(position,1.0);vUV=uv;}";e.ShadersStore[o]||(e.ShadersStore[o]=r);const n={name:o,shader:r};export{n as envShadowGroundVertexShader}; diff --git a/assets/envShadowGround.vertex-oRlsSdho-giHSzg4k.js b/assets/envShadowGround.vertex-oRlsSdho-giHSzg4k.js deleted file mode 100644 index faaccc77790b9d4b5e22850bfbb5f0a07b45c24c..0000000000000000000000000000000000000000 --- a/assets/envShadowGround.vertex-oRlsSdho-giHSzg4k.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const t="envShadowGroundVertexShader",r=`attribute position: vec3f;attribute uv: vec2f;uniform viewProjection: mat4x4f;uniform worldViewProjection: mat4x4f;varying vUV: vec2f;@vertex -fn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position=uniforms.worldViewProjection*vec4f(input.position,1.0);vertexOutputs.vUV=input.uv;}`;e.ShadersStoreWGSL[t]||(e.ShadersStoreWGSL[t]=r);const i={name:t,shader:r};export{i as envShadowGroundVertexShaderWGSL}; diff --git a/assets/envTextureLoader-BUPXVV5g.js b/assets/envTextureLoader-BUPXVV5g.js deleted file mode 100644 index cc7e6fc33c6bc607ecda727a4045548e545a30db..0000000000000000000000000000000000000000 --- a/assets/envTextureLoader-BUPXVV5g.js +++ /dev/null @@ -1 +0,0 @@ -import{G as l,U as t,a as r}from"./environmentTextureTools-4Y2q4Eto.js";import"./index-DydPgVMC.js";import"./index-GY9JDBGV.js";import"./dumpTools-CmFNDulw.js";class m{constructor(){this.supportCascades=!1}loadCubeData(o,a,p,s,n){if(Array.isArray(o))return;const e=l(o);if(e){a.width=e.width,a.height=e.width;try{t(a,e),r(a,o,e).then(()=>{a.isReady=!0,a.onLoadedObservable.notifyObservers(a),a.onLoadedObservable.clear(),s&&s()},i=>{n?.("Can not upload environment levels",i)})}catch(i){n?.("Can not upload environment file",i)}}else n&&n("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}export{m as _ENVTextureLoader}; diff --git a/assets/environmentTextureTools-4Y2q4Eto.js b/assets/environmentTextureTools-4Y2q4Eto.js deleted file mode 100644 index 0c33aecee7f21f37acd1404c578fbefde65136d2..0000000000000000000000000000000000000000 --- a/assets/environmentTextureTools-4Y2q4Eto.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./rgbdDecode.fragment-Bwx0l1La.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./helperFunctions-Wgh3PIP0.js","./rgbdDecode.fragment-BVeFs8hQ.js","./helperFunctions-tBt4f_K3.js"])))=>i.map(i=>d[i]); -import{af as F}from"./index-DydPgVMC.js";import{L as P,ay as z,V as d,I as C,B as O,d as G,az as V,aA as k}from"./index-GY9JDBGV.js";import"./dumpTools-CmFNDulw.js";const v="image/png",E=2,S=[134,22,135,150,246,214,150,54];function J(e){const n=new DataView(e.buffer,e.byteOffset,e.byteLength);let r=0;for(let o=0;oE)throw new Error(`Unsupported babylon environment map version "${e.version}". Latest supported version is "${E}".`);return e.version===2||(e={...e,version:2,imageType:v}),e}function H(e,n){n=R(n);const r=n.specular;let t=Math.log2(n.width);if(t=Math.round(t)+1,r.mipmaps.length!==6*t)throw new Error(`Unsupported specular mipmaps number "${r.mipmaps.length}"`);const i=new Array(t);for(let a=0;a{if(r){const g=n.createTexture(null,!0,!0,null,1,null,s=>{I(s)},e);t?.onEffectCreatedObservable.addOnce(s=>{s.executeWhenCompiled(()=>{t.externalTextureSamplerBinding=!0,t.onApply=c=>{c._bindTexture("textureSampler",g),c.setFloat2("scale",1,n._features.needsInvertingBitmap&&e instanceof ImageBitmap?-1:1)},n.scenes.length&&(n.scenes[0].postProcessManager.directRender([t],m,!0,a,o),n.restoreDefaultFramebuffer(),g.dispose(),URL.revokeObjectURL(i),y())})})}else{if(n._uploadImageToTexture(w,e,a,o),l){const g=p[o];g&&n._uploadImageToTexture(g._texture,e,a,0)}y()}})}async function D(e,n,r=v){const t=e.getEngine();e.format=5,e.type=0,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,t.updateTextureSamplingMode(3,e),await B(e,n,!0,r),e.isReady=!0}async function $(e,n,r,t=v,i=null){const a=e.getEngine(),o=new C(a,5),l=new O(a,o);e._irradianceTexture=l,l._dominantDirection=i,o.isCube=!0,o.format=5,o.type=0,o.generateMipMaps=!0,o._cachedAnisotropicFilteringLevel=null,o.generateMipMaps=!0,o.width=r,o.height=r,a.updateTextureSamplingMode(3,o),await B(o,[n],!1,t),a.generateMipMapsForCubemap(o),o.isReady=!0}async function B(e,n,r,t=v){if(!G.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");const i=V(e.width)+1,a=e.getEngine();let o=!1,l=!1,p=null,m=null,w=null;const y=a.getCaps();y.textureLOD?a._features.supportRenderAndCopyToLodForFloatTextures?y.textureHalfFloatRender&&y.textureHalfFloatLinearFiltering?(o=!0,e.type=2):y.textureFloatRender&&y.textureFloatLinearFiltering&&(o=!0,e.type=1):o=!1:(o=!1,l=r);let I=0;if(o)a.isWebGPU?(I=1,await F(()=>import("./rgbdDecode.fragment-Bwx0l1La.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)):await F(()=>import("./rgbdDecode.fragment-BVeFs8hQ.js"),__vite__mapDeps([5,1,2,3,6]),import.meta.url),p=new k("rgbdDecode","rgbdDecode",null,null,1,null,3,a,!1,void 0,e.type,void 0,null,!1,void 0,I),e._isRGBD=!1,e.invertY=!1,m=a.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:3,type:e.type,format:5});else if(e._isRGBD=!0,e.invertY=!0,l){w={};const c=e._lodGenerationScale,_=e._lodGenerationOffset;for(let u=0;u<3;u++){const b=1-u/2,f=_,L=(i-1)*c+_,M=f+(L-f)*b,A=Math.round(Math.min(Math.max(M,0),L)),x=new C(a,2);x.isCube=!0,x.invertY=!0,x.generateMipMaps=!1,a.updateTextureSamplingMode(2,x);const T=new O(null);switch(T._isCube=!0,T._texture=x,w[A]=T,u){case 0:e._lodTextureLow=T;break;case 1:e._lodTextureMid=T;break;case 2:e._lodTextureHigh=T;break}}}const g=[];for(let s=0;sawait U(f,a,o,p,h,c,s,l,w,m,e));else{const f=new Image;f.src=h,b=new Promise((L,M)=>{f.onload=()=>{U(f,a,o,p,h,c,s,l,w,m,e).then(()=>L()).catch(A=>{M(A)})},f.onerror=A=>{M(A)}})}g.push(b)}if(await Promise.all(g),n.lengthe);return e.onRebuildCallback=l=>({proxy:o,isReady:!0,isAsync:!0}),e._source=13,e._bufferViewArrayArray=n,e._lodGenerationScale=t,e._lodGenerationOffset=i,e._sphericalPolynomial=r,D(e,n).then(()=>(e.isReady=!0,e))}export{J as G,K as U,Q as _,q as a}; diff --git a/assets/erDiagram-Q2GNP2WA-DqmHcY0h.js b/assets/erDiagram-Q2GNP2WA-DqmHcY0h.js deleted file mode 100644 index ea1912bde50b83c9a49e169a831aa694a49e33ca..0000000000000000000000000000000000000000 --- a/assets/erDiagram-Q2GNP2WA-DqmHcY0h.js +++ /dev/null @@ -1,60 +0,0 @@ -import{g as vt}from"./chunk-55IACEB6-CzYB-Zls.js";import{s as Dt}from"./chunk-QN33PNHL-DUQNEUQT.js";import{_ as l,b as wt,a as Vt,s as Lt,g as Mt,p as Bt,q as Ft,c as $,l as D,y as Yt,x as Pt,A as zt,B as Gt,o as Kt,r as Zt,u as Ut}from"./mermaid.core-BcqUqpnI.js";import{c as jt}from"./channel-Dg8q-JvW.js";import{s as Wt}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var ut=(function(){var e=l(function(N,n,a,c){for(a=a||{},c=N.length;c--;a[N[c]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],d=[1,10],o=[1,11],h=[1,12],p=[1,13],R=[1,20],g=[1,21],m=[1,22],w=[1,23],K=[1,24],k=[1,19],tt=[1,25],Z=[1,26],S=[1,18],V=[1,33],et=[1,34],st=[1,35],it=[1,36],rt=[1,37],dt=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],T=[1,42],O=[1,43],L=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],A=[1,58],Y=[1,62],P=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],pt=[63,64,65,66,67],ft=[1,81],yt=[1,80],_t=[1,78],gt=[1,79],bt=[6,10,42,47],C=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],Q=[1,87],z=[19,56],mt=[1,98],Et=[1,97],nt=[19,56,58,60],at={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:l(function(n,a,c,r,u,t,G){var s=t.length-1;switch(u){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 56:case 64:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 76:case 77:this.$=t[s].replace(/"/g,"");break;case 55:case 78:this.$=t[s];break;case 57:t[s].push(t[s-1]),this.$=t[s];break;case 58:this.$={type:t[s-1],name:t[s]};break;case 59:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 60:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 61:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 62:case 63:case 66:this.$=t[s];break;case 65:t[s-2].push(t[s]),this.$=t[s-2];break;case 67:this.$=t[s].replace(/"/g,"");break;case 68:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 69:this.$=r.Cardinality.ZERO_OR_ONE;break;case 70:this.$=r.Cardinality.ZERO_OR_MORE;break;case 71:this.$=r.Cardinality.ONE_OR_MORE;break;case 72:this.$=r.Cardinality.ONLY_ONE;break;case 73:this.$=r.Cardinality.MD_PARENT;break;case 74:this.$=r.Identification.NON_IDENTIFYING;break;case 75:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:d,24:o,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:K,40:k,43:tt,44:Z,50:S},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:27,11:9,22:d,24:o,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:K,40:k,43:tt,44:Z,50:S},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:V,64:et,65:st,66:it,67:rt}),{23:[1,38]},{25:[1,39]},{27:[1,40]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(dt,[2,54]),e(dt,[2,55]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:41,40:T,41:O},{16:44,40:T,41:O},{16:45,40:T,41:O},e(i,[2,4]),{11:46,40:k,50:S},{16:47,40:T,41:O},{18:48,19:[1,49],51:50,52:51,56:L},{11:53,40:k,50:S},{62:54,68:[1,55],69:[1,56]},e(M,[2,69]),e(M,[2,70]),e(M,[2,71]),e(M,[2,72]),e(M,[2,73]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:B,38:57,41:F,42:A,45:59,46:60,48:Y,49:P},e(U,[2,37]),e(U,[2,38]),{16:65,40:T,41:O,42:A},{13:B,38:66,41:F,42:A,45:59,46:60,48:Y,49:P},{13:[1,67],15:[1,68]},e(i,[2,17],{61:32,12:69,17:[1,70],42:A,63:V,64:et,65:st,66:it,67:rt}),{19:[1,71]},e(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:L},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:V,64:et,65:st,66:it,67:rt},e(pt,[2,74]),e(pt,[2,75]),{6:ft,10:yt,39:77,42:_t,47:gt},{40:[1,82],41:[1,83]},e(bt,[2,43],{46:84,13:B,41:F,48:Y,49:P}),e(C,[2,45]),e(C,[2,50]),e(C,[2,51]),e(C,[2,52]),e(C,[2,53]),e(i,[2,41],{42:A}),{6:ft,10:yt,39:85,42:_t,47:gt},{14:86,40:j,50:W,70:Q},{16:90,40:T,41:O},{11:91,40:k,50:S},{18:92,19:[1,93],51:50,52:51,56:L},e(i,[2,12]),{19:[2,57]},e(z,[2,58],{54:94,55:95,57:96,59:mt,60:Et}),e([19,56,59,60],[2,63]),e(i,[2,22],{15:[1,100],17:[1,99]}),e([40,50],[2,68]),e(i,[2,36]),{13:B,41:F,45:101,46:60,48:Y,49:P},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(U,[2,39]),e(U,[2,40]),e(C,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,76]),e(i,[2,77]),e(i,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},e(i,[2,15]),e(z,[2,59],{55:106,58:[1,107],60:Et}),e(z,[2,60]),e(nt,[2,64]),e(z,[2,67]),e(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:L},{16:110,40:T,41:O},e(bt,[2,44],{46:84,13:B,41:F,48:Y,49:P}),{14:111,40:j,50:W,70:Q},{16:112,40:T,41:O},{14:113,40:j,50:W,70:Q},e(i,[2,13]),e(z,[2,61]),{57:114,59:mt},{19:[1,115]},e(i,[2,20]),e(i,[2,23],{17:[1,116],42:A}),e(i,[2,11]),{13:[1,117],42:A},e(i,[2,10]),e(nt,[2,65]),e(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:L},{14:120,40:j,50:W,70:Q},{19:[1,121]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:l(function(n,a){if(a.recoverable)this.trace(n);else{var c=new Error(n);throw c.hash=a,c}},"parseError"),parse:l(function(n){var a=this,c=[0],r=[],u=[null],t=[],G=this.table,s="",q=0,kt=0,Rt=2,St=1,xt=t.slice.call(arguments,1),f=Object.create(this.lexer),x={yy:{}};for(var ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ct)&&(x.yy[ct]=this.yy[ct]);f.setInput(n,x.yy),x.yy.lexer=f,x.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var ot=f.yylloc;t.push(ot);var It=f.options&&f.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(_){c.length=c.length-2*_,u.length=u.length-_,t.length=t.length-_}l(Ct,"popStack");function Tt(){var _;return _=r.pop()||f.lex()||St,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=a.symbols_[_]||_),_}l(Tt,"lex");for(var y,I,b,lt,v={},H,E,Ot,J;;){if(I=c[c.length-1],this.defaultActions[I]?b=this.defaultActions[I]:((y===null||typeof y>"u")&&(y=Tt()),b=G[I]&&G[I][y]),typeof b>"u"||!b.length||!b[0]){var ht="";J=[];for(H in G[I])this.terminals_[H]&&H>Rt&&J.push("'"+this.terminals_[H]+"'");f.showPosition?ht="Parse error on line "+(q+1)+`: -`+f.showPosition()+` -Expecting `+J.join(", ")+", got '"+(this.terminals_[y]||y)+"'":ht="Parse error on line "+(q+1)+": Unexpected "+(y==St?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(ht,{text:f.match,token:this.terminals_[y]||y,line:f.yylineno,loc:ot,expected:J})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+y);switch(b[0]){case 1:c.push(y),u.push(f.yytext),t.push(f.yylloc),c.push(b[1]),y=null,kt=f.yyleng,s=f.yytext,q=f.yylineno,ot=f.yylloc;break;case 2:if(E=this.productions_[b[1]][1],v.$=u[u.length-E],v._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},It&&(v._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(v,[s,kt,q,x.yy,b[1],u,t].concat(xt)),typeof lt<"u")return lt;E&&(c=c.slice(0,-1*E*2),u=u.slice(0,-1*E),t=t.slice(0,-1*E)),c.push(this.productions_[b[1]][0]),u.push(v.$),t.push(v._$),Ot=G[c[c.length-2]][c[c.length-1]],c.push(Ot);break;case 3:return!0}}return!0},"parse")},Nt=(function(){var N={EOF:1,parseError:l(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:l(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var a=n.length,c=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===r.length?this.yylloc.first_column:0)+r[r.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+` -`+a+"^"},"showPosition"),test_match:l(function(n,a){var c,r,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,c,r;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;ta[0].length)){if(a=c,r=t,this.options.backtrack_lexer){if(n=this.test_match(c,u[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,u[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var a=this.next();return a||this.lex()},"lex"),begin:l(function(a){this.conditionStack.push(a)},"begin"),popState:l(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:l(function(a){this.begin(a)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(a,c,r,u){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return c.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return c.yytext[0];case 74:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74],inclusive:!0}}};return N})();at.lexer=Nt;function X(){this.yy={}}return l(X,"Parser"),X.prototype=at,at.Parser=X,new X})();ut.parser=ut;var Qt=ut,Xt=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=wt,this.getAccTitle=Vt,this.setAccDescription=Lt,this.getAccDescription=Mt,this.setDiagramTitle=Bt,this.getDiagramTitle=Ft,this.getConfig=l(()=>$().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,D.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:$().look??"default",cssClasses:"default",cssStyles:[]}),D.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const d=this.addEntity(e);let o;for(o=i.length-1;o>=0;o--)i[o].keys||(i[o].keys=[]),i[o].comment||(i[o].comment=""),d.attributes.push(i[o]),D.debug("Added attribute ",i[o].name)}addRelationship(e,i,d,o){const h=this.entities.get(e),p=this.entities.get(d);if(!h||!p)return;const R={entityA:h.id,roleA:i,entityB:p.id,relSpec:o};this.relationships.push(R),D.debug("Added new relationship :",R)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const d of e){const o=this.classes.get(d);o?.styles&&(i=[...i,...o.styles??[]].map(h=>h.trim())),o?.textStyles&&(i=[...i,...o.textStyles??[]].map(h=>h.trim()))}return i}addCssStyles(e,i){for(const d of e){const o=this.entities.get(d);if(!i||!o)return;for(const h of i)o.cssStyles.push(h)}}addClass(e,i){e.forEach(d=>{let o=this.classes.get(d);o===void 0&&(o={id:d,styles:[],textStyles:[]},this.classes.set(d,o)),i&&i.forEach(function(h){if(/color/.exec(h)){const p=h.replace("fill","bgFill");o.textStyles.push(p)}o.styles.push(h)})})}setClass(e,i){for(const d of e){const o=this.entities.get(d);if(o)for(const h of i)o.cssClasses+=" "+h}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Yt()}getData(){const e=[],i=[],d=$();for(const h of this.entities.keys()){const p=this.entities.get(h);p&&(p.cssCompiledStyles=this.getCompiledStyles(p.cssClasses.split(" ")),e.push(p))}let o=0;for(const h of this.relationships){const p={id:Pt(h.entityA,h.entityB,{prefix:"id",counter:o++}),type:"normal",curve:"basis",start:h.entityA,end:h.entityB,label:h.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:h.relSpec.cardB.toLowerCase(),arrowTypeEnd:h.relSpec.cardA.toLowerCase(),pattern:h.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look};i.push(p)}return{nodes:e,edges:i,other:{},config:d,direction:"TB"}}},At={};Gt(At,{draw:()=>qt});var qt=l(async function(e,i,d,o){D.info("REF0:"),D.info("Drawing er diagram (unified)",i);const{securityLevel:h,er:p,layout:R}=$(),g=o.db.getData(),m=vt(i,h);g.type=o.type,g.layoutAlgorithm=Kt(R),g.config.flowchart.nodeSpacing=p?.nodeSpacing||140,g.config.flowchart.rankSpacing=p?.rankSpacing||80,g.direction=o.db.getDirection(),g.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],g.diagramId=i,await Zt(g,m),g.layoutAlgorithm==="elk"&&m.select(".edges").lower();const w=m.selectAll('[id*="-background"]');Array.from(w).length>0&&w.each(function(){const k=Wt(this),Z=k.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(Z)}`);if(!S.empty()){const V=S.attr("transform");k.attr("transform",V)}});const K=8;Ut.insertTitle(m,"erDiagramTitleText",p?.titleTopMargin??25,o.db.getDiagramTitle()),Dt(m,K,"erDiagram",p?.useMaxWidth??!0)},"draw"),Ht=l((e,i)=>{const d=jt,o=d(e,"r"),h=d(e,"g"),p=d(e,"b");return zt(o,h,p,i)},"fade"),Jt=l(e=>` - .entityBox { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - } - - .relationshipLabelBox { - fill: ${e.tertiaryColor}; - opacity: 0.7; - background-color: ${e.tertiaryColor}; - rect { - opacity: 0.5; - } - } - - .labelBkg { - background-color: ${Ht(e.tertiaryColor,.5)}; - } - - .edgeLabel .label { - fill: ${e.nodeBorder}; - font-size: 14px; - } - - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - - .edge-pattern-dashed { - stroke-dasharray: 8,8; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon - { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - - .relationshipLine { - stroke: ${e.lineColor}; - stroke-width: 1; - fill: none; - } - - .marker { - fill: none !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; - } -`,"getStyles"),$t=Jt,le={parser:Qt,get db(){return new Xt},renderer:At,styles:$t};export{le as diagram}; diff --git a/assets/exrTextureLoader-DDtz4347.js b/assets/exrTextureLoader-DDtz4347.js deleted file mode 100644 index c84ded6fa447b3eee1aa8714b4bce67629763801..0000000000000000000000000000000000000000 --- a/assets/exrTextureLoader-DDtz4347.js +++ /dev/null @@ -1 +0,0 @@ -import{aB as vn,L as B,d as Y}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const an=4,K=4,sn=1,N=2,bn=8,H=65536,d=H>>3,gn=16,T=14,D=(1<>-i-14,l[a|256]=1024>>-i-14|32768,r[a]=-i-1,r[a|256]=-i-1):i<=15?(l[a]=i+15<<10,l[a|256]=i+15<<10|32768,r[a]=13,r[a|256]=13):i<128?(l[a]=31744,l[a|256]=64512,r[a]=24,r[a|256]=24):(l[a]=31744,l[a|256]=64512,r[a]=13,r[a|256]=13)}const c=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let a=1;a<1024;++a){let i=a<<13,u=0;for(;(i&8388608)===0;)i<<=1,u-=8388608;i&=-8388609,u+=947912704,c[a]=i|u}for(let a=1024;a<2048;++a)c[a]=939524096+(a-1024<<13);for(let a=1;a<31;++a)s[a]=a<<23;s[31]=1199570944,s[32]=2147483648;for(let a=33;a<63;++a)s[a]=2147483648+(a-32<<23);s[63]=3347054592;for(let a=1;a<64;++a)a!==32&&(o[a]=1024);return{floatView:t,uint32View:e,baseTable:l,shiftTable:r,mantissaTable:c,exponentTable:s,offsetTable:o}}function J(n,t){const e=new Uint8Array(n);let l=0;for(;e[t.value+l]!=0;)l+=1;const r=new TextDecoder().decode(e.slice(t.value,t.value+l));return t.value=t.value+l+1,r}function U(n,t){const e=n.getInt32(t.value,!0);return t.value+=an,e}function m(n,t){const e=n.getUint32(t.value,!0);return t.value+=an,e}function W(n,t){const e=n.getUint8(t.value);return t.value+=sn,e}function Z(n,t){const e=n.getUint16(t.value,!0);return t.value+=N,e}function on(n,t){const e=n[t.value];return t.value+=sn,e}function On(n,t){let e;return"getBigInt64"in DataView.prototype?e=Number(n.getBigInt64(t.value,!0)):e=n.getUint32(t.value+4,!0)+Number(n.getUint32(t.value,!0)<<32),t.value+=bn,e}function b(n,t){const e=n.getFloat32(t.value,!0);return t.value+=K,e}function Pn(n,t){return Un(Z(n,t))}function Un(n){const t=(n&31744)>>10,e=n&1023;return(n>>15?-1:1)*(t?t===31?e?NaN:1/0:Math.pow(2,t-15)*(1+e/1024):6103515625e-14*(e/1024))}function Rn(n){if(Math.abs(n)>65504)throw new Error("Value out of range.Consider using float instead of half-float.");n=vn(n,-65504,65504),z.floatView[0]=n;const t=z.uint32View[0],e=t>>23&511;return z.baseTable[e]+((t&8388607)>>z.shiftTable[e])}function mn(n,t){return Rn(b(n,t))}function Tn(n,t,e){const l=new TextDecoder().decode(new Uint8Array(n).slice(t.value,t.value+e));return t.value=t.value+e,l}function Cn(n,t){const e=U(n,t),l=m(n,t);return[e,l]}function _n(n,t){const e=m(n,t),l=m(n,t);return[e,l]}function Nn(n,t){const e=b(n,t),l=b(n,t);return[e,l]}function Mn(n,t){const e=b(n,t),l=b(n,t),r=b(n,t);return[e,l,r]}function Fn(n,t,e){const l=t.value,r=[];for(;t.valuec||(t[r++]=n[e++],r>c));)t[r++]=n[l++]}const Hn=20000630;function pn(n,t){if(n.getUint32(0,!0)!=Hn)throw new Error("Incorrect OpenEXR format");const e=n.getUint8(4),l=n.getUint8(5),r={singleTile:!!(l&2),longName:!!(l&4),deepFormat:!!(l&8),multiPart:!!(l&16)};t.value=8;const c={};let s=!0;for(;s;){const o=J(n.buffer,t);if(!o)s=!1;else{const a=J(n.buffer,t),i=m(n,t),u=Bn(n,t,a,i);u===void 0?B.Warn(`Unknown header attribute type ${a}'.`):c[o]=u}}if((l&-5)!=0)throw new Error("Unsupported file format");return{version:e,spec:r,...c}}const fn=16,Zn=1<>3]&1<<(r&7))&&(t[e++]=r);const l=e-1;for(;e>e&(1<>l;if(i=new Uint8Array([i])[0],o.value+i>a)return null;const u=s[o.value-1];for(;i-- >0;)s[o.value++]=u}else if(o.value0;--e){const l=t+F[e]>>1;F[e]=t,t=l}for(let e=0;e0&&(n[e]=l|F[l]++<<6)}}function Xn(n,t,e,l,r,c){const s=t;let o=0,a=0;for(;l<=r;l++){if(s.value-t.value>e)return;let i=en(6,o,a,n,s);const u=i.l;if(o=i.c,a=i.lc,c[l]=u,u==cn){if(s.value-t.value>e)throw new Error("Error in HufUnpackEncTable");i=en(8,o,a,n,s);let p=i.l+In;if(o=i.c,a=i.lc,l+p>r+1)throw new Error("Error in HufUnpackEncTable");for(;p--;)c[l++]=0;l--}else if(u>=q){let p=u-q+2;if(l+p>r+1)throw new Error("Error in HufUnpackEncTable");for(;p--;)c[l++]=0;l--}}Yn(c)}function wn(n){return n&63}function yn(n){return n>>6}function Kn(n,t,e,l){for(;t<=e;t++){const r=yn(n[t]),c=wn(n[t]);if(r>>c)throw new Error("Invalid table entry");if(c>T){const s=l[r>>c-T];if(s.len)throw new Error("Invalid table entry");if(s.lit++,s.p){const o=s.p;s.p=new Array(s.lit);for(let a=0;a0;o--){const a=l[(r<=T;){const w=i>>u-T&nn,y=t[w];if(y.len){u-=y.len;const f=X(y.lit,c,i,u,e,l,o,a,p);f&&(i=f.c,u=f.lc)}else{if(!y.p)throw new Error("hufDecode issues");let f;for(f=0;f=v&&yn(n[y.p[f]])==(i>>u-v&(1<>=I,u-=I;u>0;){const h=t[i<=D||i<0||i>=D)throw new Error("Wrong HUF_ENCSIZE");const p=new Array(D),x=new Array(j);Gn(x);const I=l-(e.value-o);if(Xn(n,e,I,a,i,p),u>8*(l-(e.value-o)))throw new Error("Wrong hufUncompress");Kn(p,a,i,x),qn(p,x,n,e,u,i,c,r,s)}function V(n){return n&65535}function rn(n){const t=V(n);return t>32767?t-65536:t}function C(n,t){const e=rn(n),r=rn(t),c=e+(r&1)+(r>>1),s=c,o=c-r;return{a:s,b:o}}function _(n,t){const e=V(n),l=V(t),r=e-(l>>1)&tn;return{a:l+r-Zn&tn,b:r}}function Jn(n,t,e,l,r,c,s){const o=s<16384,a=e>r?r:e;let i=1,u,p;for(;i<=a;)i<<=1;for(i>>=1,u=i,i>>=1;i>=1;){p=0;const x=p+c*(r-u),I=c*i,h=c*u,w=l*i,y=l*u;let f,v,O,k;for(;p<=x;p+=h){let S=p;const G=p+l*(e-u);for(;S<=G;S+=y){const A=S+w,g=S+I,L=g+w;if(o){let E=C(n[S+t],n[g+t]);f=E.a,O=E.b,E=C(n[A+t],n[L+t]),v=E.a,k=E.b,E=C(f,v),n[S+t]=E.a,n[A+t]=E.b,E=C(O,k),n[g+t]=E.a,n[L+t]=E.b}else{let E=_(n[S+t],n[g+t]);f=E.a,O=E.b,E=_(n[A+t],n[L+t]),v=E.a,k=E.b,E=_(f,v),n[S+t]=E.a,n[A+t]=E.b,E=_(O,k),n[g+t]=E.a,n[L+t]=E.b}}if(e&i){const A=S+I;let g;o?g=C(n[S+t],n[A+t]):g=_(n[S+t],n[A+t]),f=g.a,n[A+t]=g.b,n[S+t]=f}}if(r&i){let S=p;const G=p+l*(e-u);for(;S<=G;S+=y){const A=S+w;let g;o?g=C(n[S+t],n[A+t]):g=_(n[S+t],n[A+t]),f=g.a,n[A+t]=g.b,n[S+t]=f}}u=i,i>>=1}return p}function Qn(n,t,e){for(let l=0;l0;){const c=r.getInt8(l++);if(c<0){const s=-c;t-=s+1;for(let o=0;o=d)throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");if(o<=a)for(let h=0;h0,bytesPerLine:0,outLineWidth:0,lines:0,scanlineBlockSize:0,inputSize:null,type:0,uncompress:null,getter:()=>0,format:5,outputChannels:0,decodeChannels:{},blockCount:null,byteArray:null,linearSpace:!1,textureType:0};switch(n.compression){case R.NO_COMPRESSION:r.lines=1,r.uncompress=En;break;case R.RLE_COMPRESSION:r.lines=1,r.uncompress=jn;break;case R.ZIPS_COMPRESSION:r.lines=1,r.uncompress=ln,await Y.LoadScriptAsync(M.FFLATEUrl);break;case R.ZIP_COMPRESSION:r.lines=16,r.uncompress=ln,await Y.LoadScriptAsync(M.FFLATEUrl);break;case R.PIZ_COMPRESSION:r.lines=32,r.uncompress=nt;break;case R.PXR24_COMPRESSION:r.lines=16,r.uncompress=dn,await Y.LoadScriptAsync(M.FFLATEUrl);break;default:throw new Error(R[n.compression]+" is unsupported")}r.scanlineBlockSize=r.lines;const c={};for(const i of n.channels)switch(i.name){case"R":case"G":case"B":case"A":c[i.name]=!0,r.type=i.pixelType;break;case"Y":c[i.name]=!0,r.type=i.pixelType;break}let s=!1;if(c.R&&c.G&&c.B&&c.A)r.outputChannels=4,r.decodeChannels={R:0,G:1,B:2,A:3};else if(c.R&&c.G&&c.B)s=!0,r.outputChannels=4,r.decodeChannels={R:0,G:1,B:2,A:3};else if(c.R&&c.G)r.outputChannels=2,r.decodeChannels={R:0,G:1};else if(c.R)r.outputChannels=1,r.decodeChannels={R:0};else if(c.Y)r.outputChannels=1,r.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(r.type===1)switch(l){case P.Float:r.getter=Pn,r.inputSize=N;break;case P.HalfFloat:r.getter=Z,r.inputSize=N;break}else if(r.type===2)switch(l){case P.Float:r.getter=b,r.inputSize=K;break;case P.HalfFloat:r.getter=mn,r.inputSize=K}else throw new Error("Unsupported pixelType "+r.type+" for "+n.compression);r.blockCount=r.height/r.scanlineBlockSize;for(let i=0;ii:r.scanOrder=i=>r.height-1-i,r.outputChannels==4?(r.format=5,r.linearSpace=!0):(r.format=6,r.linearSpace=!1),r}function xn(n,t,e,l){const r={value:0};for(let c=0;cn.height?n.height-s:n.scanlineBlockSize;const a=n.size=n.height)continue;const x=i*n.bytesPerLine,I=(n.height-1-p)*n.outLineWidth;for(let h=0;h{xn(o,s,r,c);const a=s.dataWindow.xMax-s.dataWindow.xMin+1,i=s.dataWindow.yMax-s.dataWindow.yMin+1;l(a,i,e.generateMipMaps,!1,()=>{const u=e.getEngine();e.format=s.format,e.type=o.textureType,e.invertY=!1,e._gammaSpace=!s.linearSpace,o.byteArray&&u._uploadDataToTextureDirectly(e,o.byteArray,0,0,void 0,!0)})}).catch(o=>{B.Error("Failed to load EXR texture: ",o)})}}async function lt(n){const t=new DataView(n),e={value:0},l=pn(t,e);try{const r=await Sn(l,t,e,P.Float);return xn(r,l,t,e),r.byteArray?{width:l.dataWindow.xMax-l.dataWindow.xMin+1,height:l.dataWindow.yMax-l.dataWindow.yMin+1,data:new Float32Array(r.byteArray)}:(B.Error("Failed to decode EXR data: No byte array available."),{width:0,height:0,data:null})}catch(r){B.Error("Failed to load EXR data: ",r)}return{width:0,height:0,data:null}}export{lt as ReadExrDataAsync,rt as _ExrTextureLoader}; diff --git a/assets/flowDiagram-NV44I4VS-DElR_B5J.js b/assets/flowDiagram-NV44I4VS-DElR_B5J.js deleted file mode 100644 index 4deccefd0e8711fefc0f21b73db96bc4f29c9648..0000000000000000000000000000000000000000 --- a/assets/flowDiagram-NV44I4VS-DElR_B5J.js +++ /dev/null @@ -1,162 +0,0 @@ -import{g as Yt}from"./chunk-FMBD7UC4-Drrjy9J2.js";import{_ as A,n as Pt,l as $,c as g1,o as qt,r as Ht,u as st,b as Xt,s as Qt,p as Jt,a as Zt,g as $t,q as te,j as ee,t as se,J as ie,v as re,x as et,y as ae,z as ne,A as ue}from"./mermaid.core-BcqUqpnI.js";import{g as oe}from"./chunk-55IACEB6-CzYB-Zls.js";import{s as le}from"./chunk-QN33PNHL-DUQNEUQT.js";import{c as ce}from"./channel-Dg8q-JvW.js";import{s as E1}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var he="flowchart-",de=class{constructor(){this.vertexCounter=0,this.config=g1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Xt,this.setAccDescription=Qt,this.setDiagramTitle=Jt,this.getAccTitle=Zt,this.getAccDescription=$t,this.getDiagramTitle=te,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{A(this,"FlowDB")}sanitizeText(t){return ee.sanitizeText(t,this.config)}lookUpDomId(t){for(const i of this.vertices.values())if(i.id===t)return i.domId;return t}addVertex(t,i,r,a,o,d,l={},b){if(!t||t.trim().length===0)return;let u;if(b!==void 0){let D;b.includes(` -`)?D=b+` -`:D=`{ -`+b+` -}`,u=se(D,{schema:ie})}const p=this.edges.find(D=>D.id===t);if(p){const D=u;D?.animate!==void 0&&(p.animate=D.animate),D?.animation!==void 0&&(p.animation=D.animation),D?.curve!==void 0&&(p.interpolate=D.curve);return}let S,g=this.vertices.get(t);if(g===void 0&&(g={id:t,labelType:"text",domId:he+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,g)),this.vertexCounter++,i!==void 0?(this.config=g1(),S=this.sanitizeText(i.text.trim()),g.labelType=i.type,S.startsWith('"')&&S.endsWith('"')&&(S=S.substring(1,S.length-1)),g.text=S):g.text===void 0&&(g.text=t),r!==void 0&&(g.type=r),a?.forEach(D=>{g.styles.push(D)}),o?.forEach(D=>{g.classes.push(D)}),d!==void 0&&(g.dir=d),g.props===void 0?g.props=l:l!==void 0&&Object.assign(g.props,l),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!re(u.shape))throw new Error(`No such shape: ${u.shape}.`);g.type=u?.shape}u?.label&&(g.text=u?.label),u?.icon&&(g.icon=u?.icon,!u.label?.trim()&&g.text===t&&(g.text="")),u?.form&&(g.form=u?.form),u?.pos&&(g.pos=u?.pos),u?.img&&(g.img=u?.img,!u.label?.trim()&&g.text===t&&(g.text="")),u?.constraint&&(g.constraint=u.constraint),u.w&&(g.assetWidth=Number(u.w)),u.h&&(g.assetHeight=Number(u.h))}}addSingleLink(t,i,r,a){const l={start:t,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};$.info("abc78 Got edge...",l);const b=r.text;if(b!==void 0&&(l.text=this.sanitizeText(b.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=b.type),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(u=>u.id===a))l.id=a,l.isUserDefinedId=!0;else{const u=this.edges.filter(p=>p.start===l.start&&p.end===l.end);u.length===0?l.id=et(l.start,l.end,{counter:0,prefix:"L"}):l.id=et(l.start,l.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))$.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. - -Initialize mermaid with maxEdges set to a higher number to allow more edges. -You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t=="object"&&"id"in t&&typeof t.id=="string"}addLink(t,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;$.info("addLink",t,i,a);for(const o of t)for(const d of i){const l=o===t[t.length-1],b=d===i[0];l&&b?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(t,i){t.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(t,i){t.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(t,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(t){this.direction=t.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(t,i){for(const r of t.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(t,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(t,i,r){const a=this.lookUpDomId(t);if(g1().securityLevel!=="loose"||i===void 0)return;let o=[];if(typeof r=="string"){o=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=document.querySelector(`[id="${a}"]`);l!==null&&l.addEventListener("click",()=>{st.runFunc(i,...o)},!1)}))}setLink(t,i,r){t.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=st.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,i,r){t.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(i=>{i(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let i=E1(".mermaidTooltip");(i._groups||i)[0][0]===null&&(i=E1("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),E1(t).select("svg").selectAll("g.node").on("mouseover",o=>{const d=E1(o.currentTarget);if(d.attr("title")===null)return;const b=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),i.html(i.html().replace(/<br\/>/g,"
                ")),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),E1(o.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=g1(),ae()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,i,r){let a=t.text.trim(),o=r.text;t===r&&/\s/.exec(r.text)&&(a=void 0);const l=A(g=>{const D={boolean:{},number:{},string:{}},K=[];let x;return{nodeList:g.filter(function(U){const J=typeof U;return U.stmt&&U.stmt==="dir"?(x=U.value,!1):U.trim()===""?!1:J in D?D[J].hasOwnProperty(U)?!1:D[J][U]=!0:K.includes(U)?!1:K.push(U)}),dir:x}},"uniq")(i.flat()),b=l.nodeList;let u=l.dir;const p=g1().flowchart??{};if(u=u??(p.inheritDir?this.getDirection()??g1().direction??void 0:void 0),this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===t)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(t,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(t){let i=t.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(t,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(t,i){const r=this.destructEndLink(t);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(t,i){for(const r of t)if(r.nodes.includes(i))return!0;return!1}makeUniq(t,i){const r=[];return t.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(t.nodes[o])}),{nodes:r}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return t.form==="circle"?"iconCircle":t.form==="square"?"iconSquare":t.form==="rounded"?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,i){return t.find(r=>r.id===i)}destructEdgeType(t){let i="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=t.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(t,i,r,a,o,d){const l=r.get(t.id),b=a.get(t.id)??!1,u=this.findNode(i,t.id);if(u)u.cssStyles=t.styles,u.cssCompiledStyles=this.getCompiledStyles(t.classes),u.cssClasses=t.classes.join(" ");else{const p={id:t.id,label:t.text,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:d,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};b?i.push({...p,isGroup:!0,shape:"rect"}):i.push({...p,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let i=[];for(const r of t){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const t=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let u=a.length-1;u>=0;u--){const p=a[u];p.nodes.length>0&&d.set(p.id,!0);for(const S of p.nodes)o.set(S,p.id)}for(let u=a.length-1;u>=0;u--){const p=a[u];i.push({id:p.id,label:p.title,labelStyle:"",parentId:o.get(p.id),padding:8,cssCompiledStyles:this.getCompiledStyles(p.classes),cssClasses:p.classes.join(" "),shape:"rect",dir:p.dir,isGroup:!0,look:t.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,i,o,d,t,t.look||"classic")});const b=this.getEdges();return b.forEach((u,p)=>{const{arrowTypeStart:S,arrowTypeEnd:g}=this.destructEdgeType(u.type),D=[...b.defaultStyle??[]];u.style&&D.push(...u.style);const K={id:et(u.start,u.end,{counter:p,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:u?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":S,arrowTypeEnd:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":g,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:D,style:D,pattern:u.stroke,look:t.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};r.push(K)}),{nodes:i,edges:r,other:{},config:t}}defaultConfig(){return ne.flowchart}},pe=A(function(t,i){return i.db.getClasses()},"getClasses"),fe=A(async function(t,i,r,a){$.info("REF0:"),$.info("Drawing state diagram (v2)",i);const{securityLevel:o,flowchart:d,layout:l}=g1();let b;o==="sandbox"&&(b=E1("#i"+i));const u=o==="sandbox"?b.nodes()[0].contentDocument:document;$.debug("Before getData: ");const p=a.db.getData();$.debug("Data: ",p);const S=oe(i,o),g=a.db.getDirection();p.type=a.type,p.layoutAlgorithm=qt(l),p.layoutAlgorithm==="dagre"&&l==="elk"&&$.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),p.direction=g,p.nodeSpacing=d?.nodeSpacing||50,p.rankSpacing=d?.rankSpacing||50,p.markers=["point","circle","cross"],p.diagramId=i,$.debug("REF1:",p),await Ht(p,S);const D=p.config.flowchart?.diagramPadding??8;st.insertTitle(S,"flowchartTitleText",d?.titleTopMargin||0,a.db.getDiagramTitle()),le(S,D,"flowchart",d?.useMaxWidth||!1);for(const K of p.nodes){const x=E1(`#${i} [id="${K.id}"]`);if(!x||!K.link)continue;const F=u.createElementNS("http://www.w3.org/2000/svg","a");F.setAttributeNS("http://www.w3.org/2000/svg","class",K.cssClasses),F.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),o==="sandbox"?F.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):K.linkTarget&&F.setAttributeNS("http://www.w3.org/2000/svg","target",K.linkTarget);const U=x.insert(function(){return F},":first-child"),J=x.select(".label-container");J&&U.append(function(){return J.node()});const b1=x.select(".label");b1&&U.append(function(){return b1.node()})}},"draw"),ge={getClasses:pe,draw:fe},it=(function(){var t=A(function(f1,c,h,f){for(h=h||{},f=f1.length;f--;h[f1[f]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],d=[2,2],l=[1,13],b=[1,14],u=[1,15],p=[1,16],S=[1,23],g=[1,25],D=[1,26],K=[1,27],x=[1,49],F=[1,48],U=[1,29],J=[1,30],b1=[1,31],P1=[1,32],O1=[1,33],L=[1,44],V=[1,46],w=[1,42],I=[1,47],R=[1,43],N=[1,50],G=[1,45],P=[1,51],O=[1,52],M1=[1,34],U1=[1,35],W1=[1,36],z1=[1,37],d1=[1,57],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],t1=[1,61],e1=[1,60],s1=[1,62],C1=[8,9,11,75,77,78],rt=[1,78],D1=[1,91],S1=[1,96],x1=[1,95],T1=[1,92],y1=[1,88],F1=[1,94],_1=[1,90],B1=[1,97],v1=[1,93],L1=[1,98],V1=[1,89],A1=[8,9,10,11,40,75,77,78],W=[8,9,10,11,40,46,75,77,78],q=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],at=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],w1=[44,60,89,102,105,106,109,111,114,115,116],nt=[1,121],ut=[1,122],j1=[1,124],K1=[1,123],ot=[44,60,62,74,89,102,105,106,109,111,114,115,116],lt=[1,133],ct=[1,147],ht=[1,148],dt=[1,149],pt=[1,150],ft=[1,135],gt=[1,137],bt=[1,141],At=[1,142],kt=[1,143],mt=[1,144],Et=[1,145],Ct=[1,146],Dt=[1,151],St=[1,152],xt=[1,131],Tt=[1,132],yt=[1,139],Ft=[1,134],_t=[1,138],Bt=[1,136],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],vt=[1,154],Lt=[1,156],B=[8,9,11],H=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],k=[1,176],z=[1,172],j=[1,173],m=[1,177],E=[1,174],C=[1,175],I1=[77,116,119],y=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Vt=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],i1=[1,247],r1=[1,245],a1=[1,249],n1=[1,243],u1=[1,244],o1=[1,246],l1=[1,248],c1=[1,250],R1=[1,268],wt=[8,9,11,106],Z=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:A(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:A(function(c,h,f,n,_,e,G1){var s=e.length-1;switch(_){case 2:this.$=[];break;case 3:(!Array.isArray(e[s])||e[s].length>0)&&e[s-1].push(e[s]),this.$=e[s-1];break;case 4:case 183:this.$=e[s];break;case 11:n.setDirection("TB"),this.$="TB";break;case 12:n.setDirection(e[s-1]),this.$=e[s-1];break;case 27:this.$=e[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=n.addSubGraph(e[s-6],e[s-1],e[s-4]);break;case 34:this.$=n.addSubGraph(e[s-3],e[s-1],e[s-3]);break;case 35:this.$=n.addSubGraph(void 0,e[s-1],void 0);break;case 37:this.$=e[s].trim(),n.setAccTitle(this.$);break;case 38:case 39:this.$=e[s].trim(),n.setAccDescription(this.$);break;case 43:this.$=e[s-1]+e[s];break;case 44:this.$=e[s];break;case 45:n.addVertex(e[s-1][e[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[s]),n.addLink(e[s-3].stmt,e[s-1],e[s-2]),this.$={stmt:e[s-1],nodes:e[s-1].concat(e[s-3].nodes)};break;case 46:n.addLink(e[s-2].stmt,e[s],e[s-1]),this.$={stmt:e[s],nodes:e[s].concat(e[s-2].nodes)};break;case 47:n.addLink(e[s-3].stmt,e[s-1],e[s-2]),this.$={stmt:e[s-1],nodes:e[s-1].concat(e[s-3].nodes)};break;case 48:this.$={stmt:e[s-1],nodes:e[s-1]};break;case 49:n.addVertex(e[s-1][e[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[s]),this.$={stmt:e[s-1],nodes:e[s-1],shapeData:e[s]};break;case 50:this.$={stmt:e[s],nodes:e[s]};break;case 51:this.$=[e[s]];break;case 52:n.addVertex(e[s-5][e[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[s-4]),this.$=e[s-5].concat(e[s]);break;case 53:this.$=e[s-4].concat(e[s]);break;case 54:this.$=e[s];break;case 55:this.$=e[s-2],n.setClass(e[s-2],e[s]);break;case 56:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"square");break;case 57:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"doublecircle");break;case 58:this.$=e[s-5],n.addVertex(e[s-5],e[s-2],"circle");break;case 59:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"ellipse");break;case 60:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"stadium");break;case 61:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"subroutine");break;case 62:this.$=e[s-7],n.addVertex(e[s-7],e[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[e[s-5],e[s-3]]]));break;case 63:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"cylinder");break;case 64:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"round");break;case 65:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"diamond");break;case 66:this.$=e[s-5],n.addVertex(e[s-5],e[s-2],"hexagon");break;case 67:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"odd");break;case 68:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"trapezoid");break;case 69:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"inv_trapezoid");break;case 70:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"lean_right");break;case 71:this.$=e[s-3],n.addVertex(e[s-3],e[s-1],"lean_left");break;case 72:this.$=e[s],n.addVertex(e[s]);break;case 73:e[s-1].text=e[s],this.$=e[s-1];break;case 74:case 75:e[s-2].text=e[s-1],this.$=e[s-2];break;case 76:this.$=e[s];break;case 77:var v=n.destructLink(e[s],e[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:e[s-1]};break;case 78:var v=n.destructLink(e[s],e[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:e[s-1],id:e[s-3]};break;case 79:this.$={text:e[s],type:"text"};break;case 80:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 81:this.$={text:e[s],type:"string"};break;case 82:this.$={text:e[s],type:"markdown"};break;case 83:var v=n.destructLink(e[s]);this.$={type:v.type,stroke:v.stroke,length:v.length};break;case 84:var v=n.destructLink(e[s]);this.$={type:v.type,stroke:v.stroke,length:v.length,id:e[s-1]};break;case 85:this.$=e[s-1];break;case 86:this.$={text:e[s],type:"text"};break;case 87:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 88:this.$={text:e[s],type:"string"};break;case 89:case 104:this.$={text:e[s],type:"markdown"};break;case 101:this.$={text:e[s],type:"text"};break;case 102:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 103:this.$={text:e[s],type:"text"};break;case 105:this.$=e[s-4],n.addClass(e[s-2],e[s]);break;case 106:this.$=e[s-4],n.setClass(e[s-2],e[s]);break;case 107:case 115:this.$=e[s-1],n.setClickEvent(e[s-1],e[s]);break;case 108:case 116:this.$=e[s-3],n.setClickEvent(e[s-3],e[s-2]),n.setTooltip(e[s-3],e[s]);break;case 109:this.$=e[s-2],n.setClickEvent(e[s-2],e[s-1],e[s]);break;case 110:this.$=e[s-4],n.setClickEvent(e[s-4],e[s-3],e[s-2]),n.setTooltip(e[s-4],e[s]);break;case 111:this.$=e[s-2],n.setLink(e[s-2],e[s]);break;case 112:this.$=e[s-4],n.setLink(e[s-4],e[s-2]),n.setTooltip(e[s-4],e[s]);break;case 113:this.$=e[s-4],n.setLink(e[s-4],e[s-2],e[s]);break;case 114:this.$=e[s-6],n.setLink(e[s-6],e[s-4],e[s]),n.setTooltip(e[s-6],e[s-2]);break;case 117:this.$=e[s-1],n.setLink(e[s-1],e[s]);break;case 118:this.$=e[s-3],n.setLink(e[s-3],e[s-2]),n.setTooltip(e[s-3],e[s]);break;case 119:this.$=e[s-3],n.setLink(e[s-3],e[s-2],e[s]);break;case 120:this.$=e[s-5],n.setLink(e[s-5],e[s-4],e[s]),n.setTooltip(e[s-5],e[s-2]);break;case 121:this.$=e[s-4],n.addVertex(e[s-2],void 0,void 0,e[s]);break;case 122:this.$=e[s-4],n.updateLink([e[s-2]],e[s]);break;case 123:this.$=e[s-4],n.updateLink(e[s-2],e[s]);break;case 124:this.$=e[s-8],n.updateLinkInterpolate([e[s-6]],e[s-2]),n.updateLink([e[s-6]],e[s]);break;case 125:this.$=e[s-8],n.updateLinkInterpolate(e[s-6],e[s-2]),n.updateLink(e[s-6],e[s]);break;case 126:this.$=e[s-6],n.updateLinkInterpolate([e[s-4]],e[s]);break;case 127:this.$=e[s-6],n.updateLinkInterpolate(e[s-4],e[s]);break;case 128:case 130:this.$=[e[s]];break;case 129:case 131:e[s-2].push(e[s]),this.$=e[s-2];break;case 133:this.$=e[s-1]+e[s];break;case 181:this.$=e[s];break;case 182:this.$=e[s-1]+""+e[s];break;case 184:this.$=e[s-1]+""+e[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},t(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:b,10:u,11:p,20:17,22:18,23:19,24:20,25:21,26:22,27:S,33:24,34:g,36:D,38:K,42:28,43:38,44:x,45:39,47:40,60:F,84:U,85:J,86:b1,87:P1,88:O1,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O,121:M1,122:U1,123:W1,124:z1},t(o,[2,9]),t(o,[2,10]),t(o,[2,11]),{8:[1,54],9:[1,55],10:d1,15:53,18:56},t(T,[2,3]),t(T,[2,4]),t(T,[2,5]),t(T,[2,6]),t(T,[2,7]),t(T,[2,8]),{8:t1,9:e1,11:s1,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:t1,9:e1,11:s1,21:67},{8:t1,9:e1,11:s1,21:68},{8:t1,9:e1,11:s1,21:69},{8:t1,9:e1,11:s1,21:70},{8:t1,9:e1,11:s1,21:71},{8:t1,9:e1,10:[1,72],11:s1,21:73},t(T,[2,36]),{35:[1,74]},{37:[1,75]},t(T,[2,39]),t(C1,[2,50],{18:76,39:77,10:d1,40:rt}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:D1,44:S1,60:x1,80:[1,86],89:T1,95:[1,83],97:[1,84],101:85,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:87},t(T,[2,185]),t(T,[2,186]),t(T,[2,187]),t(T,[2,188]),t(A1,[2,51]),t(A1,[2,54],{46:[1,99]}),t(W,[2,72],{113:112,29:[1,100],44:x,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:F,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:L,102:V,105:w,106:I,109:R,111:N,114:G,115:P,116:O}),t(q,[2,181]),t(q,[2,142]),t(q,[2,143]),t(q,[2,144]),t(q,[2,145]),t(q,[2,146]),t(q,[2,147]),t(q,[2,148]),t(q,[2,149]),t(q,[2,150]),t(q,[2,151]),t(q,[2,152]),t(o,[2,12]),t(o,[2,18]),t(o,[2,19]),{9:[1,113]},t(at,[2,26],{18:114,10:d1}),t(T,[2,27]),{42:115,43:38,44:x,45:39,47:40,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},t(T,[2,40]),t(T,[2,41]),t(T,[2,42]),t(w1,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:nt,81:ut,116:j1,119:K1},{75:[1,125],77:[1,126]},t(ot,[2,83]),t(T,[2,28]),t(T,[2,29]),t(T,[2,30]),t(T,[2,31]),t(T,[2,32]),{10:lt,12:ct,14:ht,27:dt,28:127,32:pt,44:ft,60:gt,75:bt,80:[1,129],81:[1,130],83:140,84:At,85:kt,86:mt,87:Et,88:Ct,89:Dt,90:St,91:128,105:xt,109:Tt,111:yt,114:Ft,115:_t,116:Bt},t(X1,d,{5:153}),t(T,[2,37]),t(T,[2,38]),t(C1,[2,48],{44:vt}),t(C1,[2,49],{18:155,10:d1,40:Lt}),t(A1,[2,44]),{44:x,47:157,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},{102:[1,158],103:159,105:[1,160]},{44:x,47:161,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},{44:x,47:162,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},t(B,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(B,[2,115],{120:167,10:[1,166],14:D1,44:S1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),t(B,[2,117],{10:[1,168]}),t(H,[2,183]),t(H,[2,170]),t(H,[2,171]),t(H,[2,172]),t(H,[2,173]),t(H,[2,174]),t(H,[2,175]),t(H,[2,176]),t(H,[2,177]),t(H,[2,178]),t(H,[2,179]),t(H,[2,180]),{44:x,47:169,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},{30:170,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:178,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:180,50:[1,179],67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:181,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:182,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:183,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{109:[1,184]},{30:185,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:186,65:[1,187],67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:188,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:189,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{30:190,67:k,80:z,81:j,82:171,116:m,117:E,118:C},t(q,[2,182]),t(o,[2,20]),t(at,[2,25]),t(C1,[2,46],{39:191,18:192,10:d1,40:rt}),t(w1,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{77:[1,196],79:197,116:j1,119:K1},t(I1,[2,79]),t(I1,[2,81]),t(I1,[2,82]),t(I1,[2,168]),t(I1,[2,169]),{76:198,79:120,80:nt,81:ut,116:j1,119:K1},t(ot,[2,84]),{8:t1,9:e1,10:lt,11:s1,12:ct,14:ht,21:200,27:dt,29:[1,199],32:pt,44:ft,60:gt,75:bt,83:140,84:At,85:kt,86:mt,87:Et,88:Ct,89:Dt,90:St,91:201,105:xt,109:Tt,111:yt,114:Ft,115:_t,116:Bt},t(y,[2,101]),t(y,[2,103]),t(y,[2,104]),t(y,[2,157]),t(y,[2,158]),t(y,[2,159]),t(y,[2,160]),t(y,[2,161]),t(y,[2,162]),t(y,[2,163]),t(y,[2,164]),t(y,[2,165]),t(y,[2,166]),t(y,[2,167]),t(y,[2,90]),t(y,[2,91]),t(y,[2,92]),t(y,[2,93]),t(y,[2,94]),t(y,[2,95]),t(y,[2,96]),t(y,[2,97]),t(y,[2,98]),t(y,[2,99]),t(y,[2,100]),{6:11,7:12,8:l,9:b,10:u,11:p,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,202],33:24,34:g,36:D,38:K,42:28,43:38,44:x,45:39,47:40,60:F,84:U,85:J,86:b1,87:P1,88:O1,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O,121:M1,122:U1,123:W1,124:z1},{10:d1,18:203},{44:[1,204]},t(A1,[2,43]),{10:[1,205],44:x,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:112,114:G,115:P,116:O},{10:[1,206]},{10:[1,207],106:[1,208]},t(Vt,[2,128]),{10:[1,209],44:x,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:112,114:G,115:P,116:O},{10:[1,210],44:x,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:112,114:G,115:P,116:O},{80:[1,211]},t(B,[2,109],{10:[1,212]}),t(B,[2,111],{10:[1,213]}),{80:[1,214]},t(H,[2,184]),{80:[1,215],98:[1,216]},t(A1,[2,55],{113:112,44:x,60:F,89:L,102:V,105:w,106:I,109:R,111:N,114:G,115:P,116:O}),{31:[1,217],67:k,82:218,116:m,117:E,118:C},t(p1,[2,86]),t(p1,[2,88]),t(p1,[2,89]),t(p1,[2,153]),t(p1,[2,154]),t(p1,[2,155]),t(p1,[2,156]),{49:[1,219],67:k,82:218,116:m,117:E,118:C},{30:220,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{51:[1,221],67:k,82:218,116:m,117:E,118:C},{53:[1,222],67:k,82:218,116:m,117:E,118:C},{55:[1,223],67:k,82:218,116:m,117:E,118:C},{57:[1,224],67:k,82:218,116:m,117:E,118:C},{60:[1,225]},{64:[1,226],67:k,82:218,116:m,117:E,118:C},{66:[1,227],67:k,82:218,116:m,117:E,118:C},{30:228,67:k,80:z,81:j,82:171,116:m,117:E,118:C},{31:[1,229],67:k,82:218,116:m,117:E,118:C},{67:k,69:[1,230],71:[1,231],82:218,116:m,117:E,118:C},{67:k,69:[1,233],71:[1,232],82:218,116:m,117:E,118:C},t(C1,[2,45],{18:155,10:d1,40:Lt}),t(C1,[2,47],{44:vt}),t(w1,[2,75]),t(w1,[2,74]),{62:[1,234],67:k,82:218,116:m,117:E,118:C},t(w1,[2,77]),t(I1,[2,80]),{77:[1,235],79:197,116:j1,119:K1},{30:236,67:k,80:z,81:j,82:171,116:m,117:E,118:C},t(X1,d,{5:237}),t(y,[2,102]),t(T,[2,35]),{43:238,44:x,45:39,47:40,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},{10:d1,18:239},{10:i1,60:r1,84:a1,92:240,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:251,104:[1,252],105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:253,104:[1,254],105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{105:[1,255]},{10:i1,60:r1,84:a1,92:256,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{44:x,47:257,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},t(B,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(B,[2,116]),t(B,[2,118],{10:[1,261]}),t(B,[2,119]),t(W,[2,56]),t(p1,[2,87]),t(W,[2,57]),{51:[1,262],67:k,82:218,116:m,117:E,118:C},t(W,[2,64]),t(W,[2,59]),t(W,[2,60]),t(W,[2,61]),{109:[1,263]},t(W,[2,63]),t(W,[2,65]),{66:[1,264],67:k,82:218,116:m,117:E,118:C},t(W,[2,67]),t(W,[2,68]),t(W,[2,70]),t(W,[2,69]),t(W,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(w1,[2,78]),{31:[1,265],67:k,82:218,116:m,117:E,118:C},{6:11,7:12,8:l,9:b,10:u,11:p,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,266],33:24,34:g,36:D,38:K,42:28,43:38,44:x,45:39,47:40,60:F,84:U,85:J,86:b1,87:P1,88:O1,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O,121:M1,122:U1,123:W1,124:z1},t(A1,[2,53]),{43:267,44:x,45:39,47:40,60:F,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O},t(B,[2,121],{106:R1}),t(wt,[2,130],{108:269,10:i1,60:r1,84:a1,105:n1,109:u1,110:o1,111:l1,112:c1}),t(Z,[2,132]),t(Z,[2,134]),t(Z,[2,135]),t(Z,[2,136]),t(Z,[2,137]),t(Z,[2,138]),t(Z,[2,139]),t(Z,[2,140]),t(Z,[2,141]),t(B,[2,122],{106:R1}),{10:[1,270]},t(B,[2,123],{106:R1}),{10:[1,271]},t(Vt,[2,129]),t(B,[2,105],{106:R1}),t(B,[2,106],{113:112,44:x,60:F,89:L,102:V,105:w,106:I,109:R,111:N,114:G,115:P,116:O}),t(B,[2,110]),t(B,[2,112],{10:[1,272]}),t(B,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:t1,9:e1,11:s1,21:277},t(T,[2,34]),t(A1,[2,52]),{10:i1,60:r1,84:a1,105:n1,107:278,108:242,109:u1,110:o1,111:l1,112:c1},t(Z,[2,133]),{14:D1,44:S1,60:x1,89:T1,101:279,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:87},{14:D1,44:S1,60:x1,89:T1,101:280,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:87},{98:[1,281]},t(B,[2,120]),t(W,[2,58]),{30:282,67:k,80:z,81:j,82:171,116:m,117:E,118:C},t(W,[2,66]),t(X1,d,{5:283}),t(wt,[2,131],{108:269,10:i1,60:r1,84:a1,105:n1,109:u1,110:o1,111:l1,112:c1}),t(B,[2,126],{120:167,10:[1,284],14:D1,44:S1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),t(B,[2,127],{120:167,10:[1,285],14:D1,44:S1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),t(B,[2,114]),{31:[1,286],67:k,82:218,116:m,117:E,118:C},{6:11,7:12,8:l,9:b,10:u,11:p,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,287],33:24,34:g,36:D,38:K,42:28,43:38,44:x,45:39,47:40,60:F,84:U,85:J,86:b1,87:P1,88:O1,89:L,102:V,105:w,106:I,109:R,111:N,113:41,114:G,115:P,116:O,121:M1,122:U1,123:W1,124:z1},{10:i1,60:r1,84:a1,92:288,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:289,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},t(W,[2,62]),t(T,[2,33]),t(B,[2,124],{106:R1}),t(B,[2,125],{106:R1})],defaultActions:{},parseError:A(function(c,h){if(h.recoverable)this.trace(c);else{var f=new Error(c);throw f.hash=h,f}},"parseError"),parse:A(function(c){var h=this,f=[0],n=[],_=[null],e=[],G1=this.table,s="",v=0,It=0,Wt=2,Rt=1,zt=e.slice.call(arguments,1),M=Object.create(this.lexer),k1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(k1.yy[J1]=this.yy[J1]);M.setInput(c,k1.yy),k1.yy.lexer=M,k1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;e.push(Z1);var jt=M.options&&M.options.ranges;typeof k1.yy.parseError=="function"?this.parseError=k1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Kt(X){f.length=f.length-2*X,_.length=_.length-X,e.length=e.length-X}A(Kt,"popStack");function Nt(){var X;return X=n.pop()||M.lex()||Rt,typeof X!="number"&&(X instanceof Array&&(n=X,X=n.pop()),X=h.symbols_[X]||X),X}A(Nt,"lex");for(var Y,m1,Q,$1,N1={},q1,h1,Gt,H1;;){if(m1=f[f.length-1],this.defaultActions[m1]?Q=this.defaultActions[m1]:((Y===null||typeof Y>"u")&&(Y=Nt()),Q=G1[m1]&&G1[m1][Y]),typeof Q>"u"||!Q.length||!Q[0]){var tt="";H1=[];for(q1 in G1[m1])this.terminals_[q1]&&q1>Wt&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?tt="Parse error on line "+(v+1)+`: -`+M.showPosition()+` -Expecting `+H1.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":tt="Parse error on line "+(v+1)+": Unexpected "+(Y==Rt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(tt,{text:M.match,token:this.terminals_[Y]||Y,line:M.yylineno,loc:Z1,expected:H1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m1+", token: "+Y);switch(Q[0]){case 1:f.push(Y),_.push(M.yytext),e.push(M.yylloc),f.push(Q[1]),Y=null,It=M.yyleng,s=M.yytext,v=M.yylineno,Z1=M.yylloc;break;case 2:if(h1=this.productions_[Q[1]][1],N1.$=_[_.length-h1],N1._$={first_line:e[e.length-(h1||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(h1||1)].first_column,last_column:e[e.length-1].last_column},jt&&(N1._$.range=[e[e.length-(h1||1)].range[0],e[e.length-1].range[1]]),$1=this.performAction.apply(N1,[s,It,v,k1.yy,Q[1],_,e].concat(zt)),typeof $1<"u")return $1;h1&&(f=f.slice(0,-1*h1*2),_=_.slice(0,-1*h1),e=e.slice(0,-1*h1)),f.push(this.productions_[Q[1]][0]),_.push(N1.$),e.push(N1._$),Gt=G1[f[f.length-2]][f[f.length-1]],f.push(Gt);break;case 3:return!0}}return!0},"parse")},Ut=(function(){var f1={EOF:1,parseError:A(function(h,f){if(this.yy.parser)this.yy.parser.parseError(h,f);else throw new Error(h)},"parseError"),setInput:A(function(c,h){return this.yy=h||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:A(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:A(function(c){var h=c.length,f=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===n.length?this.yylloc.first_column:0)+n[n.length-f.length].length-f[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:A(function(){return this._more=!0,this},"more"),reject:A(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:A(function(c){this.unput(this.match.slice(c))},"less"),pastInput:A(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:A(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:A(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` -`+h+"^"},"showPosition"),test_match:A(function(c,h){var f,n,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),n=c[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],f=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var e in _)this[e]=_[e];return!1}return!1},"test_match"),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,f,n;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),e=0;e<_.length;e++)if(f=this._input.match(this.rules[_[e]]),f&&(!h||f[0].length>h[0].length)){if(h=f,n=e,this.options.backtrack_lexer){if(c=this.test_match(f,_[e]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,_[n]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:A(function(){var h=this.next();return h||this.lex()},"lex"),begin:A(function(h){this.conditionStack.push(h)},"begin"),popState:A(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:A(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:A(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:A(function(h){this.begin(h)},"pushState"),stateStackSize:A(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:A(function(h,f,n,_){switch(n){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),f.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const e=/\n\s*/g;return f.yytext=f.yytext.replace(e,"
                "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:return 119;case 71:return this.popState(),77;case 72:return this.pushState("thickEdgeText"),75;case 73:return 119;case 74:return this.popState(),77;case 75:return this.pushState("dottedEdgeText"),75;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;case 79:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 101:return 115;case 102:return 111;case 103:return 44;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return f1})();Q1.lexer=Ut;function Y1(){this.yy={}}return A(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();it.parser=it;var Ot=it,Mt=Object.assign({},Ot);Mt.parse=t=>{const i=t.replace(/}\s*\n/g,`} -`);return Ot.parse(i)};var be=Mt,Ae=A((t,i)=>{const r=ce,a=r(t,"r"),o=r(t,"g"),d=r(t,"b");return ue(a,o,d,i)},"fade"),ke=A(t=>`.label { - font-family: ${t.fontFamily}; - color: ${t.nodeTextColor||t.textColor}; - } - .cluster-label text { - fill: ${t.titleColor}; - } - .cluster-label span { - color: ${t.titleColor}; - } - .cluster-label span p { - background-color: transparent; - } - - .label text,span { - fill: ${t.nodeTextColor||t.textColor}; - color: ${t.nodeTextColor||t.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${t.mainBkg}; - stroke: ${t.nodeBorder}; - stroke-width: 1px; - } - .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .katex path { - fill: #000; - stroke: #000; - stroke-width: 1px; - } - - .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - - .root .anchor path { - fill: ${t.lineColor} !important; - stroke-width: 0; - stroke: ${t.lineColor}; - } - - .arrowheadPath { - fill: ${t.arrowheadColor}; - } - - .edgePath .path { - stroke: ${t.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${t.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${t.edgeLabelBackground}; - p { - background-color: ${t.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${t.edgeLabelBackground}; - fill: ${t.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${Ae(t.edgeLabelBackground,.5)}; - // background-color: - } - - .cluster rect { - fill: ${t.clusterBkg}; - stroke: ${t.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${t.titleColor}; - } - - .cluster span { - color: ${t.titleColor}; - } - /* .cluster div { - color: ${t.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${t.fontFamily}; - font-size: 12px; - background: ${t.tertiaryColor}; - border: 1px solid ${t.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.textColor}; - } - - rect.text { - fill: none; - stroke-width: 0; - } - - .icon-shape, .image-shape { - background-color: ${t.edgeLabelBackground}; - p { - background-color: ${t.edgeLabelBackground}; - padding: 2px; - } - rect { - opacity: 0.5; - background-color: ${t.edgeLabelBackground}; - fill: ${t.edgeLabelBackground}; - } - text-align: center; - } - ${Yt()} -`,"getStyles"),me=ke,ve={parser:be,get db(){return new de},renderer:ge,styles:me,init:A(t=>{t.flowchart||(t.flowchart={}),t.layout&&Pt({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Pt({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};export{ve as diagram}; diff --git a/assets/flowGraphArrayIndexBlock-DmxisnJu.js b/assets/flowGraphArrayIndexBlock-DmxisnJu.js deleted file mode 100644 index 5783a58f9240e3e23f49ac85b50d4b9124b319fb..0000000000000000000000000000000000000000 --- a/assets/flowGraphArrayIndexBlock-DmxisnJu.js +++ /dev/null @@ -1 +0,0 @@ -import{F as s,g as i}from"./KHR_interactivity-DnpPVqY7.js";import{R as t,F as l}from"./declarationMapper--DEn7iYN.js";import{R as u}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class o extends s{constructor(e){super(e),this.config=e,this.array=this.registerDataInput("array",t),this.index=this.registerDataInput("index",t,new l(-1)),this.value=this.registerDataOutput("value",t)}_updateOutputs(e){const r=this.array.getValue(e),a=i(this.index.getValue(e));r&&a>=0&&a=o&&(this.out._activateSignal(t),t._setExecutionVariable(this,"debounceCount",0))}getClassName(){return"FlowGraphDebounceBlock"}}s("FlowGraphDebounceBlock",n);export{n as FlowGraphDebounceBlock}; diff --git a/assets/flowGraphDoNBlock-BUmWFhhp.js b/assets/flowGraphDoNBlock-BUmWFhhp.js deleted file mode 100644 index a89866cf24d3b008736c5a9512745b0b5d963463..0000000000000000000000000000000000000000 --- a/assets/flowGraphDoNBlock-BUmWFhhp.js +++ /dev/null @@ -1 +0,0 @@ -import{F as e,i}from"./declarationMapper--DEn7iYN.js";import{b as a}from"./KHR_interactivity-DnpPVqY7.js";import{R as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class u extends a{constructor(t={}){super(t),this.config=t,this.config.startIndex=t.startIndex??new e(0),this.reset=this._registerSignalInput("reset"),this.maxExecutions=this.registerDataInput("maxExecutions",i),this.executionCount=this.registerDataOutput("executionCount",i,new e(0))}_execute(t,o){if(o===this.reset)this.executionCount.setValue(this.config.startIndex,t);else{const s=this.executionCount.getValue(t);s.values.MaxLoopIterations*a));i+=a);this.config?.incrementIndexWhenLoopDone&&this.index.setValue(new r(t(this.index.getValue(e))+a),e),this.completed._activateSignal(e)}getClassName(){return"FlowGraphForLoopBlock"}}s.MaxLoopIterations=1e3;d("FlowGraphForLoopBlock",s);export{s as FlowGraphForLoopBlock}; diff --git a/assets/flowGraphFunctionReferenceBlock-BEE10xFF.js b/assets/flowGraphFunctionReferenceBlock-BEE10xFF.js deleted file mode 100644 index 84e16e43ef634abe2f605555ad5f64f48b266f8e..0000000000000000000000000000000000000000 --- a/assets/flowGraphFunctionReferenceBlock-BEE10xFF.js +++ /dev/null @@ -1 +0,0 @@ -import{F as u}from"./KHR_interactivity-DnpPVqY7.js";import{q as r,R as o}from"./declarationMapper--DEn7iYN.js";import{R as a}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class c extends u{constructor(t){super(t),this.functionName=this.registerDataInput("functionName",r),this.object=this.registerDataInput("object",o),this.context=this.registerDataInput("context",o,null),this.output=this.registerDataOutput("output",o)}_updateOutputs(t){const i=this.functionName.getValue(t),s=this.object.getValue(t),n=this.context.getValue(t);if(s&&i){const e=s[i];e&&typeof e=="function"&&this.output.setValue(e.bind(n),t)}}getClassName(){return"FlowGraphFunctionReference"}}a("FlowGraphFunctionReference",c);export{c as FlowGraphFunctionReferenceBlock}; diff --git a/assets/flowGraphGLTFDataProvider-6e5hvgTT.js b/assets/flowGraphGLTFDataProvider-6e5hvgTT.js deleted file mode 100644 index 7aa45717bc19c6387502ea0ab852ba732b272a77..0000000000000000000000000000000000000000 --- a/assets/flowGraphGLTFDataProvider-6e5hvgTT.js +++ /dev/null @@ -1 +0,0 @@ -import{F as n}from"./KHR_interactivity-DnpPVqY7.js";import{R as a}from"./declarationMapper--DEn7iYN.js";import"./index-DydPgVMC.js";import"./index-GY9JDBGV.js";import"./objectModelMapping-CpTIXcMS.js";class c extends n{constructor(r){super();const t=r.glTF,s=t.animations?.map(o=>o._babylonAnimationGroup)||[];this.animationGroups=this.registerDataOutput("animationGroups",a,s);const i=t.nodes?.map(o=>o._babylonTransformNode)||[];this.nodes=this.registerDataOutput("nodes",a,i)}getClassName(){return"FlowGraphGLTFDataProvider"}}export{c as FlowGraphGLTFDataProvider}; diff --git a/assets/flowGraphGetAssetBlock-BH52hwPP.js b/assets/flowGraphGetAssetBlock-BH52hwPP.js deleted file mode 100644 index 77f05e1cb106e24a1bcdb9714e4e4648275462a1..0000000000000000000000000000000000000000 --- a/assets/flowGraphGetAssetBlock-BH52hwPP.js +++ /dev/null @@ -1 +0,0 @@ -import{F as p,g as s,G as o}from"./KHR_interactivity-DnpPVqY7.js";import{R as e,F as l}from"./declarationMapper--DEn7iYN.js";import{R as u}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class h extends p{constructor(t){super(t),this.config=t,this.type=this.registerDataInput("type",e,t.type),this.value=this.registerDataOutput("value",e),this.index=this.registerDataInput("index",e,new l(s(t.index??-1)))}_updateOutputs(t){const a=this.type.getValue(t),r=this.index.getValue(t),i=o(t.assetsContext,a,s(r),this.config.useIndexAsUniqueId);this.value.setValue(i,t)}getClassName(){return"FlowGraphGetAssetBlock"}}u("FlowGraphGetAssetBlock",h);export{h as FlowGraphGetAssetBlock}; diff --git a/assets/flowGraphGetPropertyBlock-Ar6QWCqC.js b/assets/flowGraphGetPropertyBlock-Ar6QWCqC.js deleted file mode 100644 index 0d411dbb3daf97c8118d23a35440cef876e24b28..0000000000000000000000000000000000000000 --- a/assets/flowGraphGetPropertyBlock-Ar6QWCqC.js +++ /dev/null @@ -1 +0,0 @@ -import{R as s}from"./declarationMapper--DEn7iYN.js";import{R as a}from"./index-GY9JDBGV.js";import{F as i}from"./flowGraphCachedOperationBlock-C58XZTsG.js";import"./index-DydPgVMC.js";import"./KHR_interactivity-DnpPVqY7.js";import"./objectModelMapping-CpTIXcMS.js";class u extends i{constructor(t){super(s,t),this.config=t,this.object=this.registerDataInput("object",s,t.object),this.propertyName=this.registerDataInput("propertyName",s,t.propertyName),this.customGetFunction=this.registerDataInput("customGetFunction",s)}_doOperation(t){const o=this.customGetFunction.getValue(t);let r;if(o)r=o(this.object.getValue(t),this.propertyName.getValue(t),t);else{const e=this.object.getValue(t),p=this.propertyName.getValue(t);r=e&&p?this._getPropertyValue(e,p):void 0}return r}_getPropertyValue(t,o){const r=o.split(".");let e=t;for(const p of r)if(e=e[p],e===void 0)return;return e}getClassName(){return"FlowGraphGetPropertyBlock"}}a("FlowGraphGetPropertyBlock",u);export{u as FlowGraphGetPropertyBlock}; diff --git a/assets/flowGraphGetVariableBlock-BmI0H3Mo.js b/assets/flowGraphGetVariableBlock-BmI0H3Mo.js deleted file mode 100644 index 6dca49fb8266a634115f58484fb61ea5777ba6c2..0000000000000000000000000000000000000000 --- a/assets/flowGraphGetVariableBlock-BmI0H3Mo.js +++ /dev/null @@ -1 +0,0 @@ -import{F as r}from"./KHR_interactivity-DnpPVqY7.js";import{R as i}from"./declarationMapper--DEn7iYN.js";import{R as l}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class s extends r{constructor(a){super(a),this.config=a,this.value=this.registerDataOutput("value",i,a.initialValue)}_updateOutputs(a){const e=this.config.variable;a.hasVariable(e)&&this.value.setValue(a.getVariable(e),a)}serialize(a){super.serialize(a),a.config.variable=this.config.variable}getClassName(){return"FlowGraphGetVariableBlock"}}l("FlowGraphGetVariableBlock",s);export{s as FlowGraphGetVariableBlock}; diff --git a/assets/flowGraphIndexOfBlock-1sUrEqt1.js b/assets/flowGraphIndexOfBlock-1sUrEqt1.js deleted file mode 100644 index 3bdfb82d5ce43c7da2416ea380450e9f9f88c008..0000000000000000000000000000000000000000 --- a/assets/flowGraphIndexOfBlock-1sUrEqt1.js +++ /dev/null @@ -1 +0,0 @@ -import{F as i}from"./KHR_interactivity-DnpPVqY7.js";import{R as r,i as o,F as a}from"./declarationMapper--DEn7iYN.js";import{R as p}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class h extends i{constructor(e){super(e),this.config=e,this.object=this.registerDataInput("object",r),this.array=this.registerDataInput("array",r),this.index=this.registerDataOutput("index",o,new a(-1))}_updateOutputs(e){const s=this.object.getValue(e),t=this.array.getValue(e);t&&this.index.setValue(new a(t.indexOf(s)),e)}serialize(e){super.serialize(e)}getClassName(){return"FlowGraphIndexOfBlock"}}p("FlowGraphIndexOfBlock",h);export{h as FlowGraphIndexOfBlock}; diff --git a/assets/flowGraphInterpolationBlock-C2GVXWth.js b/assets/flowGraphInterpolationBlock-C2GVXWth.js deleted file mode 100644 index 2a6c15793dd55e962ac2b331cf283e675cc70bc3..0000000000000000000000000000000000000000 --- a/assets/flowGraphInterpolationBlock-C2GVXWth.js +++ /dev/null @@ -1 +0,0 @@ -import{F as c}from"./KHR_interactivity-DnpPVqY7.js";import{g as d,d as g,b as h,R as p}from"./declarationMapper--DEn7iYN.js";import{as as y,R as F}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class f extends c{constructor(t={}){super(t),this.keyFrames=[];const e=typeof t?.animationType=="string"?d(t.animationType):g(t?.animationType??0),i=t?.keyFramesCount??1,n=this.registerDataInput("duration_0",h,0),a=this.registerDataInput("value_0",e);this.keyFrames.push({duration:n,value:a});for(let s=1;s{const o=y.CreateAnimation(m,n.animationType,60,i);return o.setKeys(a),o})}getClassName(){return"FlowGraphInterpolationBlock"}}F("FlowGraphInterpolationBlock",f);export{f as FlowGraphInterpolationBlock}; diff --git a/assets/flowGraphJsonPointerParserBlock-CbgFrsq4.js b/assets/flowGraphJsonPointerParserBlock-CbgFrsq4.js deleted file mode 100644 index c5e3546ba790f7227c921c97acd1e1b9865bca51..0000000000000000000000000000000000000000 --- a/assets/flowGraphJsonPointerParserBlock-CbgFrsq4.js +++ /dev/null @@ -1 +0,0 @@ -import{i as A,F,R as c}from"./declarationMapper--DEn7iYN.js";import{C as w,b9 as y,V as j,ai as I,R as _}from"./index-GY9JDBGV.js";import{F as N}from"./flowGraphCachedOperationBlock-C58XZTsG.js";import"./index-DydPgVMC.js";import"./KHR_interactivity-DnpPVqY7.js";import"./objectModelMapping-CpTIXcMS.js";const g=new RegExp(/\/\{(\w+)\}(?=\/|$)/g);class V{constructor(r,s){this.path=r,this.ownerBlock=s,this.templatedInputs=[];let n=g.exec(r);const o=new Set;for(;n;){const[,e]=n;if(o.has(e))throw new Error("Duplicate template variable detected.");o.add(e),this.templatedInputs.push(s.registerDataInput(e,A,new F(0))),n=g.exec(r)}}getAccessor(r,s){let n=this.path;for(const o of this.templatedInputs){const e=o.getValue(s).value;if(typeof e!="number"||e<0)throw new Error("Invalid value for templated input.");n=n.replace(`{${o.name}}`,e.toString())}return r.convert(n)}}class D extends N{constructor(r){super(c,r),this.config=r,this.object=this.registerDataOutput("object",c),this.propertyName=this.registerDataOutput("propertyName",c),this.setterFunction=this.registerDataOutput("setFunction",c,this._setPropertyValue.bind(this)),this.getterFunction=this.registerDataOutput("getFunction",c,this._getPropertyValue.bind(this)),this.generateAnimationsFunction=this.registerDataOutput("generateAnimationsFunction",c,this._getInterpolationAnimationPropertyInfo.bind(this)),this.templateComponent=new V(r.jsonPointer,this)}_doOperation(r){const s=this.templateComponent.getAccessor(this.config.pathConverter,r),n=s.info.get(s.object),o=s.info.getTarget?.(s.object),e=s.info.getPropertyName?.[0](s.object);if(o)this.object.setValue(o,r),e&&this.propertyName.setValue(e,r);else throw new Error("Object is undefined");return n}_setPropertyValue(r,s,n,o){const e=this.templateComponent.getAccessor(this.config.pathConverter,o),a=e.info.type;a.startsWith("Color")&&(n=C(n,a)),e.info.set?.(n,e.object)}_getPropertyValue(r,s,n){const o=this.templateComponent.getAccessor(this.config.pathConverter,n),e=o.info.type,a=o.info.get(o.object);return e.startsWith("Color")?G(a):a}_getInterpolationAnimationPropertyInfo(r,s,n){const o=this.templateComponent.getAccessor(this.config.pathConverter,n);return(e,a,b,h)=>{const m=[],l=o.info.type;return l.startsWith("Color")&&(e=e.map(p=>({frame:p.frame,value:C(p.value,l)}))),o.info.interpolation?.forEach((p,f)=>{const d=o.info.getPropertyName?.[f](o.object)||"Animation-interpolation-"+f;let u=e;b!==p.type&&(u=e.map(i=>({frame:i.frame,value:p.getValue(void 0,i.value.asArray?i.value.asArray():[i.value],0,1)})));const P=p.buildAnimations(o.object,d,60,u);for(const i of P)h&&i.babylonAnimation.setEasingFunction(h),m.push(i.babylonAnimation)}),m}}getClassName(){return"FlowGraphJsonPointerParserBlock"}}function C(t,r){return t.getClassName().startsWith("Color")?t:r==="Color3"?new w(t.x,t.y,t.z):r==="Color4"?new y(t.x,t.y,t.z,t.w):t}function G(t){if(t instanceof w)return new j(t.r,t.g,t.b);if(t instanceof y)return new I(t.r,t.g,t.b,t.a);throw new Error("Invalid color type")}_("FlowGraphJsonPointerParserBlock",D);export{D as FlowGraphJsonPointerParserBlock}; diff --git a/assets/flowGraphMathBlocks-WHnmoWh_.js b/assets/flowGraphMathBlocks-WHnmoWh_.js deleted file mode 100644 index a9d442421cdcdd2f40bb9577521e3b4bda3f26d0..0000000000000000000000000000000000000000 --- a/assets/flowGraphMathBlocks-WHnmoWh_.js +++ /dev/null @@ -1 +0,0 @@ -import{ai as B,M as d,ao as N,V as v,ah as S,R as s}from"./index-GY9JDBGV.js";import{i as G,F as y,g as i,R as l,b as a,c as k,n as x,p as _}from"./declarationMapper--DEn7iYN.js";import{F as w}from"./flowGraphBinaryOperationBlock-BCZdn6kI.js";import{F as R}from"./flowGraphCachedOperationBlock-C58XZTsG.js";import{F as c}from"./flowGraphUnaryOperationBlock-DezHCHpH.js";import{i as I,g as m,h as F,j as f,k as M,l as g}from"./KHR_interactivity-DnpPVqY7.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class T extends R{constructor(r,o,t,n){super(r,n),this._operation=o,this._className=t}_doOperation(r){return this._operation(r)}getClassName(){return this._className}}class D extends R{constructor(r,o,t,n,p,u,O){super(n,O),this._operation=p,this._className=u,this.a=this.registerDataInput("a",r),this.b=this.registerDataInput("b",o),this.c=this.registerDataInput("c",t)}_doOperation(r){return this._operation(this.a.getValue(r),this.b.getValue(r),this.c.getValue(r))}getClassName(){return this._className}}class L extends w{constructor(r){super(i(r?.type),i(r?.type),i(r?.type),(o,t)=>this._polymorphicAdd(o,t),"FlowGraphAddBlock",r)}_polymorphicAdd(r,o){const t=F(r),n=F(o);if(f(t,n)||M(t,n)||g(t,n))return r.add(o);if(t==="Quaternion"||n==="Vector4")return new B(r.x,r.y,r.z,r.w).addInPlace(o);if(t==="Vector4"||n==="Quaternion")return r.add(o);if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof o)throw new Error("Cannot add different types of numbers.");return m(r)+m(o)}}s("FlowGraphAddBlock",L);class V extends w{constructor(r){super(i(r?.type),i(r?.type),i(r?.type),(o,t)=>this._polymorphicSubtract(o,t),"FlowGraphSubtractBlock",r)}_polymorphicSubtract(r,o){const t=F(r),n=F(o);if(f(t,n)||g(t,n)||M(t,n))return r.subtract(o);if(t==="Quaternion"||n==="Vector4")return new B(r.x,r.y,r.z,r.w).subtractInPlace(o);if(t==="Vector4"||n==="Quaternion")return r.subtract(o);if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof o)throw new Error("Cannot add different types of numbers.");return m(r)-m(o)}}s("FlowGraphSubtractBlock",V);class z extends w{constructor(r){super(i(r?.type),i(r?.type),i(r?.type),(o,t)=>this._polymorphicMultiply(o,t),"FlowGraphMultiplyBlock",r)}_polymorphicMultiply(r,o){const t=F(r),n=F(o);if(f(t,n)||g(t,n))return r.multiply(o);if(t==="Quaternion"||n==="Vector4")return new B(r.x,r.y,r.z,r.w).multiplyInPlace(o);if(t==="Vector4"||n==="Quaternion")return r.multiply(o);if(M(t,n))if(this.config?.useMatrixPerComponent){const p=r.m;for(let u=0;uthis._polymorphicDivide(o,t),"FlowGraphDivideBlock",r)}_polymorphicDivide(r,o){const t=F(r),n=F(o);if(f(t,n)||g(t,n))return r.divide(o);if(t==="Quaternion"||n==="Quaternion"){const p=r.clone();return p.x/=o.x,p.y/=o.y,p.z/=o.z,p.w/=o.w,p}else{if(t==="Quaternion"||n==="Vector4")return new B(r.x,r.y,r.z,r.w).divideInPlace(o);if(t==="Vector4"||n==="Quaternion")return r.divide(o);if(M(t,n))if(this.config?.useMatrixPerComponent){const p=r.m;for(let u=0;uthis._random(o),"FlowGraphRandomBlock",r),this.min=this.registerDataInput("min",a,r?.min??0),this.max=this.registerDataInput("max",a,r?.max??1),r?.seed&&(this._seed=r.seed)}_isSeed(r=this._seed){return r!==void 0}_getRandomValue(){if(this._isSeed(this._seed)){const r=Math.sin(this._seed++)*1e4;return r-Math.floor(r)}return Math.random()}_random(r){const o=this.min.getValue(r),t=this.max.getValue(r);return this._getRandomValue()*(t-o)+o}}s("FlowGraphRandomBlock",P);class Q extends T{constructor(r){super(a,()=>Math.E,"FlowGraphEBlock",r)}}s("FlowGraphEBlock",Q);class $ extends T{constructor(r){super(a,()=>Math.PI,"FlowGraphPIBlock",r)}}s("FlowGraphPIBlock",$);class j extends T{constructor(r){super(a,()=>Number.POSITIVE_INFINITY,"FlowGraphInfBlock",r)}}s("FlowGraphInfBlock",j);class Z extends T{constructor(r){super(a,()=>Number.NaN,"FlowGraphNaNBlock",r)}}s("FlowGraphNaNBlock",Z);function h(e,r){switch(F(e)){case"FlowGraphInteger":return e=e,new y(r(e.value));case"Vector2":return e=e,new S(r(e.x),r(e.y));case"Vector3":return e=e,new v(r(e.x),r(e.y),r(e.z));case"Vector4":return e=e,new B(r(e.x),r(e.y),r(e.z),r(e.w));case"Quaternion":return e=e,new N(r(e.x),r(e.y),r(e.z),r(e.w));case"Matrix":return e=e,d.FromArray(e.m.map(r));case"Matrix2D":return e=e,new x(e.m.map(r));case"Matrix3D":return e=e,new _(e.m.map(r));default:return e=e,r(e)}}class X extends c{constructor(r){super(a,a,o=>this._polymorphicAbs(o),"FlowGraphAbsBlock",r)}_polymorphicAbs(r){return h(r,Math.abs)}}s("FlowGraphAbsBlock",X);class W extends c{constructor(r){super(a,a,o=>this._polymorphicSign(o),"FlowGraphSignBlock",r)}_polymorphicSign(r){return h(r,Math.sign)}}s("FlowGraphSignBlock",W);class U extends c{constructor(r){super(a,a,o=>this._polymorphicTrunc(o),"FlowGraphTruncBlock",r)}_polymorphicTrunc(r){return h(r,Math.trunc)}}s("FlowGraphTruncBlock",U);class H extends c{constructor(r){super(a,a,o=>this._polymorphicFloor(o),"FlowGraphFloorBlock",r)}_polymorphicFloor(r){return h(r,Math.floor)}}s("FlowGraphFloorBlock",H);class Y extends c{constructor(r){super(l,l,o=>this._polymorphicCeiling(o),"FlowGraphCeilBlock",r)}_polymorphicCeiling(r){return h(r,Math.ceil)}}s("FlowGraphCeilBlock",Y);class J extends c{constructor(r){super(l,l,o=>this._polymorphicRound(o),"FlowGraphRoundBlock",r)}_polymorphicRound(r){return h(r,o=>o<0&&this.config?.roundHalfAwayFromZero?-Math.round(-o):Math.round(o))}}s("FlowGraphRoundBlock",J);class K extends c{constructor(r){super(l,l,o=>this._polymorphicFraction(o),"FlowGraphFractBlock",r)}_polymorphicFraction(r){return h(r,o=>o-Math.floor(o))}}s("FlowGraphFractBlock",K);class b extends c{constructor(r){super(l,l,o=>this._polymorphicNeg(o),"FlowGraphNegationBlock",r)}_polymorphicNeg(r){return h(r,o=>-o)}}s("FlowGraphNegationBlock",b);function C(e,r,o){switch(F(e)){case"FlowGraphInteger":return e=e,r=r,new y(o(e.value,r.value));case"Vector2":return e=e,r=r,new S(o(e.x,r.x),o(e.y,r.y));case"Vector3":return e=e,r=r,new v(o(e.x,r.x),o(e.y,r.y),o(e.z,r.z));case"Vector4":return e=e,r=r,new B(o(e.x,r.x),o(e.y,r.y),o(e.z,r.z),o(e.w,r.w));case"Quaternion":return e=e,r=r,new N(o(e.x,r.x),o(e.y,r.y),o(e.z,r.z),o(e.w,r.w));case"Matrix":return e=e,d.FromArray(e.m.map((n,p)=>o(n,r.m[p])));case"Matrix2D":return e=e,new x(e.m.map((n,p)=>o(n,r.m[p])));case"Matrix3D":return e=e,new _(e.m.map((n,p)=>o(n,r.m[p])));default:return o(m(e),m(r))}}class rr extends w{constructor(r){super(l,l,l,(o,t)=>this._polymorphicRemainder(o,t),"FlowGraphModuloBlock",r)}_polymorphicRemainder(r,o){return C(r,o,(t,n)=>t%n)}}s("FlowGraphModuloBlock",rr);class or extends w{constructor(r){super(l,l,l,(o,t)=>this._polymorphicMin(o,t),"FlowGraphMinBlock",r)}_polymorphicMin(r,o){return C(r,o,Math.min)}}s("FlowGraphMinBlock",or);class er extends w{constructor(r){super(l,l,l,(o,t)=>this._polymorphicMax(o,t),"FlowGraphMaxBlock",r)}_polymorphicMax(r,o){return C(r,o,Math.max)}}s("FlowGraphMaxBlock",er);function tr(e,r,o){return Math.min(Math.max(e,Math.min(r,o)),Math.max(r,o))}function E(e,r,o,t){switch(F(e)){case"FlowGraphInteger":return e=e,r=r,o=o,new y(t(e.value,r.value,o.value));case"Vector2":return e=e,r=r,o=o,new S(t(e.x,r.x,o.x),t(e.y,r.y,o.y));case"Vector3":return e=e,r=r,o=o,new v(t(e.x,r.x,o.x),t(e.y,r.y,o.y),t(e.z,r.z,o.z));case"Vector4":return e=e,r=r,o=o,new B(t(e.x,r.x,o.x),t(e.y,r.y,o.y),t(e.z,r.z,o.z),t(e.w,r.w,o.w));case"Quaternion":return e=e,r=r,o=o,new N(t(e.x,r.x,o.x),t(e.y,r.y,o.y),t(e.z,r.z,o.z),t(e.w,r.w,o.w));case"Matrix":return d.FromArray(e.m.map((p,u)=>t(p,r.m[u],o.m[u])));case"Matrix2D":return new x(e.m.map((p,u)=>t(p,r.m[u],o.m[u])));case"Matrix3D":return new _(e.m.map((p,u)=>t(p,r.m[u],o.m[u])));default:return t(m(e),m(r),m(o))}}class lr extends D{constructor(r){super(l,l,l,l,(o,t,n)=>this._polymorphicClamp(o,t,n),"FlowGraphClampBlock",r)}_polymorphicClamp(r,o,t){return E(r,o,t,tr)}}s("FlowGraphClampBlock",lr);function sr(e){return Math.min(Math.max(e,0),1)}class nr extends c{constructor(r){super(l,l,o=>this._polymorphicSaturate(o),"FlowGraphSaturateBlock",r)}_polymorphicSaturate(r){return h(r,sr)}}s("FlowGraphSaturateBlock",nr);function ar(e,r,o){return(1-o)*e+o*r}class cr extends D{constructor(r){super(l,l,l,l,(o,t,n)=>this._polymorphicInterpolate(o,t,n),"FlowGraphMathInterpolationBlock",r)}_polymorphicInterpolate(r,o,t){return E(r,o,t,ar)}}s("FlowGraphMathInterpolationBlock",cr);class pr extends w{constructor(r){super(l,l,k,(o,t)=>this._polymorphicEq(o,t),"FlowGraphEqualityBlock",r)}_polymorphicEq(r,o){const t=F(r),n=F(o);return typeof r!=typeof o?!1:f(t,n)||M(t,n)||g(t,n)?r.equals(o):r===o}}s("FlowGraphEqualityBlock",pr);function A(e,r,o){if(I(e)&&I(r))return o(m(e),m(r));throw new Error(`Cannot compare ${e} and ${r}`)}class hr extends w{constructor(r){super(l,l,k,(o,t)=>this._polymorphicLessThan(o,t),"FlowGraphLessThanBlock",r)}_polymorphicLessThan(r,o){return A(r,o,(t,n)=>tthis._polymorphicLessThanOrEqual(o,t),"FlowGraphLessThanOrEqualBlock",r)}_polymorphicLessThanOrEqual(r,o){return A(r,o,(t,n)=>t<=n)}}s("FlowGraphLessThanOrEqualBlock",ir);class ur extends w{constructor(r){super(l,l,k,(o,t)=>this._polymorphicGreaterThan(o,t),"FlowGraphGreaterThanBlock",r)}_polymorphicGreaterThan(r,o){return A(r,o,(t,n)=>t>n)}}s("FlowGraphGreaterThanBlock",ur);class wr extends w{constructor(r){super(l,l,k,(o,t)=>this._polymorphicGreaterThanOrEqual(o,t),"FlowGraphGreaterThanOrEqualBlock",r)}_polymorphicGreaterThanOrEqual(r,o){return A(r,o,(t,n)=>t>=n)}}s("FlowGraphGreaterThanOrEqualBlock",wr);class mr extends c{constructor(r){super(l,k,o=>this._polymorphicIsNan(o),"FlowGraphIsNaNBlock",r)}_polymorphicIsNan(r){if(I(r,!0))return isNaN(m(r));throw new Error(`Cannot get NaN of ${r}`)}}s("FlowGraphIsNaNBlock",mr);class Fr extends c{constructor(r){super(l,k,o=>this._polymorphicIsInf(o),"FlowGraphIsInfBlock",r)}_polymorphicIsInf(r){if(I(r))return!isFinite(m(r));throw new Error(`Cannot get isInf of ${r}`)}}s("FlowGraphIsInfBlock",Fr);class Gr extends c{constructor(r){super(l,l,o=>this._polymorphicDegToRad(o),"FlowGraphDegToRadBlock",r)}_degToRad(r){return r*Math.PI/180}_polymorphicDegToRad(r){return h(r,this._degToRad)}}s("FlowGraphDegToRadBlock",Gr);class yr extends c{constructor(r){super(l,l,o=>this._polymorphicRadToDeg(o),"FlowGraphRadToDegBlock",r)}_radToDeg(r){return r*180/Math.PI}_polymorphicRadToDeg(r){return h(r,this._radToDeg)}}s("FlowGraphRadToDegBlock",yr);class br extends c{constructor(r){super(a,a,o=>this._polymorphicSin(o),"FlowGraphSinBlock",r)}_polymorphicSin(r){return h(r,Math.sin)}}class ro extends c{constructor(r){super(a,a,o=>this._polymorphicCos(o),"FlowGraphCosBlock",r)}_polymorphicCos(r){return h(r,Math.cos)}}class oo extends c{constructor(r){super(a,a,o=>this._polymorphicTan(o),"FlowGraphTanBlock",r)}_polymorphicTan(r){return h(r,Math.tan)}}class Br extends c{constructor(r){super(a,a,o=>this._polymorphicAsin(o),"FlowGraphASinBlock",r)}_polymorphicAsin(r){return h(r,Math.asin)}}s("FlowGraphASinBlock",Br);class kr extends c{constructor(r){super(a,a,o=>this._polymorphicAcos(o),"FlowGraphACosBlock",r)}_polymorphicAcos(r){return h(r,Math.acos)}}s("FlowGraphACosBlock",kr);class dr extends c{constructor(r){super(a,a,o=>this._polymorphicAtan(o),"FlowGraphATanBlock",r)}_polymorphicAtan(r){return h(r,Math.atan)}}s("FlowGraphATanBlock",dr);class xr extends w{constructor(r){super(l,l,l,(o,t)=>this._polymorphicAtan2(o,t),"FlowGraphATan2Block",r)}_polymorphicAtan2(r,o){return C(r,o,Math.atan2)}}s("FlowGraphATan2Block",xr);class _r extends c{constructor(r){super(l,l,o=>this._polymorphicSinh(o),"FlowGraphSinhBlock",r)}_polymorphicSinh(r){return h(r,Math.sinh)}}s("FlowGraphSinhBlock",_r);class fr extends c{constructor(r){super(l,l,o=>this._polymorphicCosh(o),"FlowGraphCoshBlock",r)}_polymorphicCosh(r){return h(r,Math.cosh)}}s("FlowGraphCoshBlock",fr);class Mr extends c{constructor(r){super(l,l,o=>this._polymorphicTanh(o),"FlowGraphTanhBlock",r)}_polymorphicTanh(r){return h(r,Math.tanh)}}s("FlowGraphTanhBlock",Mr);class gr extends c{constructor(r){super(l,a,o=>this._polymorphicAsinh(o),"FlowGraphASinhBlock",r)}_polymorphicAsinh(r){return h(r,Math.asinh)}}s("FlowGraphASinhBlock",gr);class Tr extends c{constructor(r){super(l,a,o=>this._polymorphicAcosh(o),"FlowGraphACoshBlock",r)}_polymorphicAcosh(r){return h(r,Math.acosh)}}s("FlowGraphACoshBlock",Tr);class Cr extends c{constructor(r){super(l,a,o=>this._polymorphicAtanh(o),"FlowGraphATanhBlock",r)}_polymorphicAtanh(r){return h(r,Math.atanh)}}s("FlowGraphATanhBlock",Cr);class Ir extends c{constructor(r){super(l,a,o=>this._polymorphicExp(o),"FlowGraphExponentialBlock",r)}_polymorphicExp(r){return h(r,Math.exp)}}s("FlowGraphExponentialBlock",Ir);class Ar extends c{constructor(r){super(l,a,o=>this._polymorphicLog(o),"FlowGraphLogBlock",r)}_polymorphicLog(r){return h(r,Math.log)}}s("FlowGraphLogBlock",Ar);class Nr extends c{constructor(r){super(l,a,o=>this._polymorphicLog2(o),"FlowGraphLog2Block",r)}_polymorphicLog2(r){return h(r,Math.log2)}}s("FlowGraphLog2Block",Nr);class vr extends c{constructor(r){super(l,a,o=>this._polymorphicLog10(o),"FlowGraphLog10Block",r)}_polymorphicLog10(r){return h(r,Math.log10)}}s("FlowGraphLog10Block",vr);class Sr extends c{constructor(r){super(l,a,o=>this._polymorphicSqrt(o),"FlowGraphSquareRootBlock",r)}_polymorphicSqrt(r){return h(r,Math.sqrt)}}s("FlowGraphSquareRootBlock",Sr);class Rr extends c{constructor(r){super(l,a,o=>this._polymorphicCubeRoot(o),"FlowGraphCubeRootBlock",r)}_polymorphicCubeRoot(r){return h(r,Math.cbrt)}}s("FlowGraphCubeRootBlock",Rr);class Dr extends w{constructor(r){super(l,a,a,(o,t)=>this._polymorphicPow(o,t),"FlowGraphPowerBlock",r)}_polymorphicPow(r,o){return C(r,o,Math.pow)}}s("FlowGraphPowerBlock",Dr);class Er extends c{constructor(r){super(i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),o=>typeof o=="boolean"?!o:typeof o=="number"?~o:new y(~o.value),"FlowGraphBitwiseNotBlock",r)}}s("FlowGraphBitwiseNotBlock",Er);class Or extends w{constructor(r){super(i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),(o,t)=>{if(typeof o=="boolean"&&typeof t=="boolean")return o&&t;if(typeof o=="number"&&typeof t=="number")return o&t;if(typeof o=="object"&&typeof t=="object")return new y(o.value&t.value);throw new Error(`Cannot perform bitwise AND on ${o} and ${t}`)},"FlowGraphBitwiseAndBlock",r)}}s("FlowGraphBitwiseAndBlock",Or);class Lr extends w{constructor(r){super(i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),(o,t)=>{if(typeof o=="boolean"&&typeof t=="boolean")return o||t;if(typeof o=="number"&&typeof t=="number")return o|t;if(typeof o=="object"&&typeof t=="object")return new y(o.value|t.value);throw new Error(`Cannot perform bitwise OR on ${o} and ${t}`)},"FlowGraphBitwiseOrBlock",r)}}s("FlowGraphBitwiseOrBlock",Lr);class Vr extends w{constructor(r){super(i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),i(r?.valueType||"FlowGraphInteger"),(o,t)=>{if(typeof o=="boolean"&&typeof t=="boolean")return o!==t;if(typeof o=="number"&&typeof t=="number")return o^t;if(typeof o=="object"&&typeof t=="object")return new y(o.value^t.value);throw new Error(`Cannot perform bitwise XOR on ${o} and ${t}`)},"FlowGraphBitwiseXorBlock",r)}}s("FlowGraphBitwiseXorBlock",Vr);class zr extends w{constructor(r){super(G,G,G,(o,t)=>new y(o.value<new y(o.value>>t.value),"FlowGraphBitwiseRightShiftBlock",r)}}s("FlowGraphBitwiseRightShiftBlock",qr);class Pr extends c{constructor(r){super(G,G,o=>new y(Math.clz32(o.value)),"FlowGraphLeadingZerosBlock",r)}}s("FlowGraphLeadingZerosBlock",Pr);class Qr extends c{constructor(r){super(G,G,o=>new y(o.value?31-Math.clz32(o.value&-o.value):32),"FlowGraphTrailingZerosBlock",r)}}s("FlowGraphTrailingZerosBlock",Qr);function $r(e){let r=0;for(;e;)r+=e&1,e>>=1;return r}class jr extends c{constructor(r){super(G,G,o=>new y($r(o.value)),"FlowGraphOneBitsCounterBlock",r)}}s("FlowGraphOneBitsCounterBlock",jr);export{X as FlowGraphAbsBlock,kr as FlowGraphAcosBlock,Tr as FlowGraphAcoshBlock,L as FlowGraphAddBlock,Br as FlowGraphAsinBlock,gr as FlowGraphAsinhBlock,xr as FlowGraphAtan2Block,dr as FlowGraphAtanBlock,Cr as FlowGraphAtanhBlock,Or as FlowGraphBitwiseAndBlock,zr as FlowGraphBitwiseLeftShiftBlock,Er as FlowGraphBitwiseNotBlock,Lr as FlowGraphBitwiseOrBlock,qr as FlowGraphBitwiseRightShiftBlock,Vr as FlowGraphBitwiseXorBlock,Y as FlowGraphCeilBlock,lr as FlowGraphClampBlock,ro as FlowGraphCosBlock,fr as FlowGraphCoshBlock,Rr as FlowGraphCubeRootBlock,Gr as FlowGraphDegToRadBlock,q as FlowGraphDivideBlock,Q as FlowGraphEBlock,pr as FlowGraphEqualityBlock,Ir as FlowGraphExpBlock,H as FlowGraphFloorBlock,K as FlowGraphFractionBlock,ur as FlowGraphGreaterThanBlock,wr as FlowGraphGreaterThanOrEqualBlock,j as FlowGraphInfBlock,Fr as FlowGraphIsInfinityBlock,mr as FlowGraphIsNanBlock,Pr as FlowGraphLeadingZerosBlock,hr as FlowGraphLessThanBlock,ir as FlowGraphLessThanOrEqualBlock,vr as FlowGraphLog10Block,Nr as FlowGraphLog2Block,Ar as FlowGraphLogBlock,cr as FlowGraphMathInterpolationBlock,er as FlowGraphMaxBlock,or as FlowGraphMinBlock,rr as FlowGraphModuloBlock,z as FlowGraphMultiplyBlock,Z as FlowGraphNaNBlock,b as FlowGraphNegationBlock,jr as FlowGraphOneBitsCounterBlock,$ as FlowGraphPiBlock,Dr as FlowGraphPowerBlock,yr as FlowGraphRadToDegBlock,P as FlowGraphRandomBlock,J as FlowGraphRoundBlock,nr as FlowGraphSaturateBlock,W as FlowGraphSignBlock,br as FlowGraphSinBlock,_r as FlowGraphSinhBlock,Sr as FlowGraphSquareRootBlock,V as FlowGraphSubtractBlock,oo as FlowGraphTanBlock,Mr as FlowGraphTanhBlock,Qr as FlowGraphTrailingZerosBlock,U as FlowGraphTruncBlock}; diff --git a/assets/flowGraphMathCombineExtractBlocks-BLZz5aaG.js b/assets/flowGraphMathCombineExtractBlocks-BLZz5aaG.js deleted file mode 100644 index 76616c31f0dc64e303b31f89fa2b8adc1358db63..0000000000000000000000000000000000000000 --- a/assets/flowGraphMathCombineExtractBlocks-BLZz5aaG.js +++ /dev/null @@ -1 +0,0 @@ -import{F}from"./flowGraphCachedOperationBlock-C58XZTsG.js";import{h as l,k as n,e as h,l as g,b as o,m as V,n as c,o as _,p as D}from"./declarationMapper--DEn7iYN.js";import{F as G}from"./KHR_interactivity-DnpPVqY7.js";import{M as I,ai as m,V as w,ah as d,R as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class s extends F{constructor(t,a,e){super(a,e);for(let p=0;pi.transpose?i.transpose():d.Transpose(i),"FlowGraphTransposeBlock",t)}}r("FlowGraphTransposeBlock",b);class E extends V{constructor(t){super(e(t?.matrixType||"Matrix"),k,i=>i.determinant(),"FlowGraphDeterminantBlock",t)}}r("FlowGraphDeterminantBlock",E);class _ extends V{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),i=>i.inverse?i.inverse():d.Invert(i),"FlowGraphInvertMatrixBlock",t)}}r("FlowGraphInvertMatrixBlock",_);class v extends D{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),(i,a)=>a.multiply(i),"FlowGraphMatrixMultiplicationBlock",t)}}r("FlowGraphMatrixMultiplicationBlock",v);class R extends M{constructor(t){super(t),this.input=this.registerDataInput("input",w),this.position=this.registerDataOutput("position",u),this.rotationQuaternion=this.registerDataOutput("rotationQuaternion",g),this.scaling=this.registerDataOutput("scaling",u),this.isValid=this.registerDataOutput("isValid",T,!1)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedPosition",null),s=t._getExecutionVariable(this,"cachedRotation",null),p=t._getExecutionVariable(this,"cachedScaling",null);if(i===t.executionId&&a&&s&&p)this.position.setValue(a,t),this.rotationQuaternion.setValue(s,t),this.scaling.setValue(p,t);else{const l=this.input.getValue(t),h=a||new n,c=s||new x,m=p||new n,F=Math.round(l.m[3]*1e4)/1e4,G=Math.round(l.m[7]*1e4)/1e4,y=Math.round(l.m[11]*1e4)/1e4,B=Math.round(l.m[15]*1e4)/1e4;if(F!==0||G!==0||y!==0||B!==1){this.isValid.setValue(!1,t),this.position.setValue(n.Zero(),t),this.rotationQuaternion.setValue(x.Identity(),t),this.scaling.setValue(n.One(),t);return}const I=l.decompose(m,c,h);this.isValid.setValue(I,t),this.position.setValue(h,t),this.rotationQuaternion.setValue(c,t),this.scaling.setValue(m,t),t._setExecutionVariable(this,"cachedPosition",h),t._setExecutionVariable(this,"cachedRotation",c),t._setExecutionVariable(this,"cachedScaling",m),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixDecompose"}}r("FlowGraphMatrixDecompose",R);class O extends M{constructor(t){super(t),this.position=this.registerDataInput("position",u),this.rotationQuaternion=this.registerDataInput("rotationQuaternion",g),this.scaling=this.registerDataInput("scaling",u),this.value=this.registerDataOutput("value",w)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedMatrix",null);if(i===t.executionId&&a)this.value.setValue(a,t);else{const s=d.Compose(this.scaling.getValue(t),this.rotationQuaternion.getValue(t),this.position.getValue(t));this.value.setValue(s,t),t._setExecutionVariable(this,"cachedMatrix",s),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixCompose"}}r("FlowGraphMatrixCompose",O);export{E as FlowGraphDeterminantBlock,_ as FlowGraphInvertMatrixBlock,O as FlowGraphMatrixComposeBlock,R as FlowGraphMatrixDecomposeBlock,v as FlowGraphMatrixMultiplicationBlock,b as FlowGraphTransposeBlock}; diff --git a/assets/flowGraphMeshPickEventBlock-BO0FoK9f.js b/assets/flowGraphMeshPickEventBlock-BO0FoK9f.js deleted file mode 100644 index faeebea393e7136565e69fd5e13feb77a9a16538..0000000000000000000000000000000000000000 --- a/assets/flowGraphMeshPickEventBlock-BO0FoK9f.js +++ /dev/null @@ -1 +0,0 @@ -import{c as p,_ as a}from"./KHR_interactivity-DnpPVqY7.js";import{aQ as h,R as n}from"./index-GY9JDBGV.js";import{R as s,e as r,b as o}from"./declarationMapper--DEn7iYN.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class u extends p{constructor(e){super(e),this.config=e,this.type="MeshPick",this.asset=this.registerDataInput("asset",s,e?.targetMesh),this.pickedPoint=this.registerDataOutput("pickedPoint",r),this.pickOrigin=this.registerDataOutput("pickOrigin",r),this.pointerId=this.registerDataOutput("pointerId",o),this.pickedMesh=this.registerDataOutput("pickedMesh",s),this.pointerType=this.registerDataInput("pointerType",s,h.POINTERPICK)}_getReferencedMesh(e){return this.asset.getValue(e)}_executeEvent(e,t){if(this.pointerType.getValue(e)!==t.type)return!0;const i=this._getReferencedMesh(e);return i&&t.pickInfo?.pickedMesh&&(t.pickInfo?.pickedMesh===i||a(t.pickInfo?.pickedMesh,i))?(this.pointerId.setValue(t.event.pointerId,e),this.pickOrigin.setValue(t.pickInfo.ray?.origin,e),this.pickedPoint.setValue(t.pickInfo.pickedPoint,e),this.pickedMesh.setValue(t.pickInfo.pickedMesh,e),this._execute(e),!this.config?.stopPropagation):(this.pointerId.resetToDefaultValue(e),this.pickOrigin.resetToDefaultValue(e),this.pickedPoint.resetToDefaultValue(e),this.pickedMesh.resetToDefaultValue(e),!0)}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){return"FlowGraphMeshPickEventBlock"}}n("FlowGraphMeshPickEventBlock",u);export{u as FlowGraphMeshPickEventBlock}; diff --git a/assets/flowGraphMultiGateBlock-BrH1iWnE.js b/assets/flowGraphMultiGateBlock-BrH1iWnE.js deleted file mode 100644 index 2b8d4ad7522465915438c412b6a30b417b5db014..0000000000000000000000000000000000000000 --- a/assets/flowGraphMultiGateBlock-BrH1iWnE.js +++ /dev/null @@ -1 +0,0 @@ -import{R as a}from"./index-GY9JDBGV.js";import{e as l}from"./KHR_interactivity-DnpPVqY7.js";import{i as u,F as n}from"./declarationMapper--DEn7iYN.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class o extends l{constructor(t){super(t),this.config=t,this.outputSignals=[],this.reset=this._registerSignalInput("reset"),this.lastIndex=this.registerDataOutput("lastIndex",u,new n(-1)),this.setNumberOfOutputSignals(t?.outputSignalCount)}_getNextIndex(t){if(t.includes(!1)||this.config.isLoop&&t.fill(!1),this.config.isRandom){const e=t.map((s,i)=>s?-1:i).filter(s=>s!==-1);return e.length?e[Math.floor(Math.random()*e.length)]:-1}else return t.indexOf(!1)}setNumberOfOutputSignals(t=1){for(;this.outputSignals.length>t;){const e=this.outputSignals.pop();e&&(e.disconnectFromAll(),this._unregisterSignalOutput(e.name))}for(;this.outputSignals.length!1)),e===this.reset){t._deleteExecutionVariable(this,"indexesUsed"),this.lastIndex.setValue(new n(-1),t);return}const s=t._getExecutionVariable(this,"indexesUsed",[]),i=this._getNextIndex(s);i>-1&&(this.lastIndex.setValue(new n(i),t),s[i]=!0,t._setExecutionVariable(this,"indexesUsed",s),this.outputSignals[i]._activateSignal(t))}getClassName(){return"FlowGraphMultiGateBlock"}serialize(t){super.serialize(t),t.config.outputSignalCount=this.config.outputSignalCount,t.config.isRandom=this.config.isRandom,t.config.loop=this.config.isLoop,t.config.startIndex=this.config.startIndex}}a("FlowGraphMultiGateBlock",o);export{o as FlowGraphMultiGateBlock}; diff --git a/assets/flowGraphPauseAnimationBlock-CF3wQXZ2.js b/assets/flowGraphPauseAnimationBlock-CF3wQXZ2.js deleted file mode 100644 index 77222ca8d72727a7f4cd295d921beef54b1efbf9..0000000000000000000000000000000000000000 --- a/assets/flowGraphPauseAnimationBlock-CF3wQXZ2.js +++ /dev/null @@ -1 +0,0 @@ -import{b as o}from"./KHR_interactivity-DnpPVqY7.js";import{R as t}from"./declarationMapper--DEn7iYN.js";import{R as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class e extends o{constructor(a){super(a),this.animationToPause=this.registerDataInput("animationToPause",t)}_execute(a){this.animationToPause.getValue(a).pause(),this.out._activateSignal(a)}getClassName(){return"FlowGraphPauseAnimationBlock"}}i("FlowGraphPauseAnimationBlock",e);export{e as FlowGraphPauseAnimationBlock}; diff --git a/assets/flowGraphPlayAnimationBlock-BYGPLYtZ.js b/assets/flowGraphPlayAnimationBlock-BYGPLYtZ.js deleted file mode 100644 index 3b7c5d7167ab948af97645810e8dc89c614ab6b4..0000000000000000000000000000000000000000 --- a/assets/flowGraphPlayAnimationBlock-BYGPLYtZ.js +++ /dev/null @@ -1 +0,0 @@ -import{a as f}from"./KHR_interactivity-DnpPVqY7.js";import{b as u,c as _,R as l}from"./declarationMapper--DEn7iYN.js";import{R as b}from"./index-GY9JDBGV.js";import{AnimationGroup as y}from"./animationGroup-R6N9NYXv.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";import"./bone-CnpD8dWY.js";class V extends f{constructor(i){super(i,["animationLoop","animationEnd","animationGroupLoop"]),this.config=i,this.speed=this.registerDataInput("speed",u),this.loop=this.registerDataInput("loop",_),this.from=this.registerDataInput("from",u,0),this.to=this.registerDataInput("to",u),this.currentFrame=this.registerDataOutput("currentFrame",u),this.currentTime=this.registerDataOutput("currentTime",u),this.currentAnimationGroup=this.registerDataOutput("currentAnimationGroup",l),this.animationGroup=this.registerDataInput("animationGroup",l,i?.animationGroup),this.animation=this.registerDataInput("animation",l),this.object=this.registerDataInput("object",l)}_preparePendingTasks(i){const t=this.animationGroup.getValue(i),r=this.animation.getValue(i);if(!t&&!r)return this._reportError(i,"No animation or animation group provided");{const a=this.currentAnimationGroup.getValue(i);a&&a!==t&&a.dispose();let n=t;if(r&&!n){const o=this.object.getValue(i);if(!o)return this._reportError(i,"No target object provided");const h=Array.isArray(r)?r:[r],G=h[0].name;n=new y("flowGraphAnimationGroup-"+G+"-"+o.name,i.configuration.scene);let g=!1;const A=i._getGlobalContextVariable("interpolationAnimations",[]);for(const c of h)n.addTargetedAnimation(c,o),A.indexOf(c.uniqueId)!==-1&&(g=!0);g&&this._checkInterpolationDuplications(i,h,o)}const s=this.speed.getValue(i)||1,e=this.from.getValue(i)??0,p=this.to.getValue(i)||n.to,d=!isFinite(p)||this.loop.getValue(i);this.currentAnimationGroup.setValue(n,i);const m=i._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);m.indexOf(n.uniqueId)!==-1&&n.stop();try{n.start(d,s,e,p),n.onAnimationGroupEndObservable.add(()=>this._onAnimationGroupEnd(i)),n.onAnimationEndObservable.add(()=>this._eventsSignalOutputs.animationEnd._activateSignal(i)),n.onAnimationLoopObservable.add(()=>this._eventsSignalOutputs.animationLoop._activateSignal(i)),n.onAnimationGroupLoopObservable.add(()=>this._eventsSignalOutputs.animationGroupLoop._activateSignal(i)),m.push(n.uniqueId),i._setGlobalContextVariable("currentlyRunningAnimationGroups",m)}catch(o){this._reportError(i,o)}}}_reportError(i,t){super._reportError(i,t),this.currentFrame.setValue(-1,i),this.currentTime.setValue(-1,i)}_executeOnTick(i){const t=this.currentAnimationGroup.getValue(i);t&&(this.currentFrame.setValue(t.getCurrentFrame(),i),this.currentTime.setValue(t.animatables[0]?.elapsedTime??0,i))}_execute(i){this._startPendingTasks(i)}_onAnimationGroupEnd(i){this._removeFromCurrentlyRunning(i,this.currentAnimationGroup.getValue(i)),this._resetAfterCanceled(i),this.done._activateSignal(i)}_checkInterpolationDuplications(i,t,r){const a=i._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const n of a){const s=i.assetsContext.animationGroups.find(e=>e.uniqueId===n);if(s)for(const e of s.targetedAnimations)for(const p of t)e.animation.targetProperty===p.targetProperty&&e.target===r&&this._stopAnimationGroup(i,s)}}_stopAnimationGroup(i,t){t.stop(!0),t.dispose(),this._removeFromCurrentlyRunning(i,t)}_removeFromCurrentlyRunning(i,t){const r=i._getGlobalContextVariable("currentlyRunningAnimationGroups",[]),a=r.indexOf(t.uniqueId);a!==-1&&(r.splice(a,1),i._setGlobalContextVariable("currentlyRunningAnimationGroups",r))}_cancelPendingTasks(i){const t=this.currentAnimationGroup.getValue(i);t&&this._stopAnimationGroup(i,t)}getClassName(){return"FlowGraphPlayAnimationBlock"}}b("FlowGraphPlayAnimationBlock",V);export{V as FlowGraphPlayAnimationBlock}; diff --git a/assets/flowGraphPointerOutEventBlock-zex71JkY.js b/assets/flowGraphPointerOutEventBlock-zex71JkY.js deleted file mode 100644 index db83368e6d25e95b42f30edf3a317c2741c09141..0000000000000000000000000000000000000000 --- a/assets/flowGraphPointerOutEventBlock-zex71JkY.js +++ /dev/null @@ -1 +0,0 @@ -import{c as n,_ as r}from"./KHR_interactivity-DnpPVqY7.js";import{b as h,R as i}from"./declarationMapper--DEn7iYN.js";import{R as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class u extends n{constructor(t){super(t),this.type="PointerOut",this.pointerId=this.registerDataOutput("pointerId",h),this.targetMesh=this.registerDataInput("targetMesh",i,t?.targetMesh),this.meshOutOfPointer=this.registerDataOutput("meshOutOfPointer",i)}_executeEvent(t,e){const s=this.targetMesh.getValue(t);return this.meshOutOfPointer.setValue(e.mesh,t),this.pointerId.setValue(e.pointerId,t),!(e.over&&r(e.mesh,s))&&(e.mesh===s||r(e.mesh,s))?(this._execute(t),!this.config?.stopPropagation):!0}_preparePendingTasks(t){}_cancelPendingTasks(t){}getClassName(){return"FlowGraphPointerOutEventBlock"}}o("FlowGraphPointerOutEventBlock",u);export{u as FlowGraphPointerOutEventBlock}; diff --git a/assets/flowGraphPointerOverEventBlock-DBLNmcpf.js b/assets/flowGraphPointerOverEventBlock-DBLNmcpf.js deleted file mode 100644 index 32f777393bd63fe100dfd8b6b78c2c34eee29e74..0000000000000000000000000000000000000000 --- a/assets/flowGraphPointerOverEventBlock-DBLNmcpf.js +++ /dev/null @@ -1 +0,0 @@ -import{c as o,_ as s}from"./KHR_interactivity-DnpPVqY7.js";import{b as h,R as i}from"./declarationMapper--DEn7iYN.js";import{R as a}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class p extends o{constructor(e){super(e),this.type="PointerOver",this.pointerId=this.registerDataOutput("pointerId",h),this.targetMesh=this.registerDataInput("targetMesh",i,e?.targetMesh),this.meshUnderPointer=this.registerDataOutput("meshUnderPointer",i)}_executeEvent(e,t){const r=this.targetMesh.getValue(e);this.meshUnderPointer.setValue(t.mesh,e);const n=t.out&&s(t.out,r);return this.pointerId.setValue(t.pointerId,e),!n&&(t.mesh===r||s(t.mesh,r))?(this._execute(e),!this.config?.stopPropagation):!0}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){return"FlowGraphPointerOverEventBlock"}}a("FlowGraphPointerOverEventBlock",p);export{p as FlowGraphPointerOverEventBlock}; diff --git a/assets/flowGraphReceiveCustomEventBlock-BQt26_dH.js b/assets/flowGraphReceiveCustomEventBlock-BQt26_dH.js deleted file mode 100644 index 33d17a7c72bd5e934a9540420ec2e9075a909f21..0000000000000000000000000000000000000000 --- a/assets/flowGraphReceiveCustomEventBlock-BQt26_dH.js +++ /dev/null @@ -1 +0,0 @@ -import{c as a,d as n}from"./KHR_interactivity-DnpPVqY7.js";import{d as v,R as c}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./declarationMapper--DEn7iYN.js";import"./objectModelMapping-CpTIXcMS.js";class l extends a{constructor(e){super(e),this.config=e,this.initPriority=1;for(const t in this.config.eventData)this.registerDataOutput(t,this.config.eventData[t].type)}_preparePendingTasks(e){const t=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(t&&t.hasObservers()&&t.observers.length>n.MaxEventsPerType){this._reportError(e,`FlowGraphReceiveCustomEventBlock: Too many observers for event ${this.config.eventId}. Max is ${n.MaxEventsPerType}.`);return}const r=t.add(s=>{const i=Object.keys(s);for(const o of i)this.getDataOutput(o)?.setValue(s[o],e);this._execute(e)});e._setExecutionVariable(this,"_eventObserver",r)}_cancelPendingTasks(e){const t=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(t){const r=e._getExecutionVariable(this,"_eventObserver",null);t.remove(r)}else v.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`)}_executeEvent(e,t){return!0}getClassName(){return"FlowGraphReceiveCustomEventBlock"}}c("FlowGraphReceiveCustomEventBlock",l);export{l as FlowGraphReceiveCustomEventBlock}; diff --git a/assets/flowGraphSceneReadyEventBlock-BwcOTioF.js b/assets/flowGraphSceneReadyEventBlock-BwcOTioF.js deleted file mode 100644 index c8e75780863276d7104ae837d4c1703c42a30002..0000000000000000000000000000000000000000 --- a/assets/flowGraphSceneReadyEventBlock-BwcOTioF.js +++ /dev/null @@ -1 +0,0 @@ -import{c as t}from"./KHR_interactivity-DnpPVqY7.js";import{R as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./declarationMapper--DEn7iYN.js";import"./objectModelMapping-CpTIXcMS.js";class n extends t{constructor(){super(...arguments),this.initPriority=-1,this.type="SceneReady"}_executeEvent(e,a){return this._execute(e),!0}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){return"FlowGraphSceneReadyEventBlock"}}r("FlowGraphSceneReadyEventBlock",n);export{n as FlowGraphSceneReadyEventBlock}; diff --git a/assets/flowGraphSceneTickEventBlock-DpbQfpZL.js b/assets/flowGraphSceneTickEventBlock-DpbQfpZL.js deleted file mode 100644 index 469a11eb1139a9d9b9f073591eb7704d970669a0..0000000000000000000000000000000000000000 --- a/assets/flowGraphSceneTickEventBlock-DpbQfpZL.js +++ /dev/null @@ -1 +0,0 @@ -import{c as i}from"./KHR_interactivity-DnpPVqY7.js";import{R as s}from"./index-GY9JDBGV.js";import{b as r}from"./declarationMapper--DEn7iYN.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class a extends i{constructor(){super(),this.type="SceneBeforeRender",this.timeSinceStart=this.registerDataOutput("timeSinceStart",r),this.deltaTime=this.registerDataOutput("deltaTime",r)}_preparePendingTasks(e){}_executeEvent(e,t){return this.timeSinceStart.setValue(t.timeSinceStart,e),this.deltaTime.setValue(t.deltaTime,e),this._execute(e),!0}_cancelPendingTasks(e){}getClassName(){return"FlowGraphSceneTickEventBlock"}}s("FlowGraphSceneTickEventBlock",a);export{a as FlowGraphSceneTickEventBlock}; diff --git a/assets/flowGraphSendCustomEventBlock-COjyDDOI.js b/assets/flowGraphSendCustomEventBlock-COjyDDOI.js deleted file mode 100644 index 729eb0c1e820fd6243194c4f57eec8a14d816060..0000000000000000000000000000000000000000 --- a/assets/flowGraphSendCustomEventBlock-COjyDDOI.js +++ /dev/null @@ -1 +0,0 @@ -import{b as i}from"./KHR_interactivity-DnpPVqY7.js";import{R as n}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./declarationMapper--DEn7iYN.js";import"./objectModelMapping-CpTIXcMS.js";class s extends i{constructor(t){super(t),this.config=t;for(const e in this.config.eventData)this.registerDataInput(e,this.config.eventData[e].type,this.config.eventData[e].value)}_execute(t){const e=this.config.eventId,o={};for(const a of this.dataInputs)o[a.name]=a.getValue(t);t.configuration.coordinator.notifyCustomEvent(e,o),this.out._activateSignal(t)}getClassName(){return"FlowGraphReceiveCustomEventBlock"}}n("FlowGraphReceiveCustomEventBlock",s);export{s as FlowGraphSendCustomEventBlock}; diff --git a/assets/flowGraphSequenceBlock-CsGWl_9B.js b/assets/flowGraphSequenceBlock-CsGWl_9B.js deleted file mode 100644 index aaa209d65b3c10b9460218204686d149965285b1..0000000000000000000000000000000000000000 --- a/assets/flowGraphSequenceBlock-CsGWl_9B.js +++ /dev/null @@ -1 +0,0 @@ -import{R as i}from"./index-GY9JDBGV.js";import{e as s}from"./KHR_interactivity-DnpPVqY7.js";import"./index-DydPgVMC.js";import"./declarationMapper--DEn7iYN.js";import"./objectModelMapping-CpTIXcMS.js";class n extends s{constructor(e){super(e),this.config=e,this.executionSignals=[],this.setNumberOfOutputSignals(this.config.outputSignalCount)}_execute(e){for(let t=0;te;){const t=this.executionSignals.pop();t&&(t.disconnectFromAll(),this._unregisterSignalOutput(t.name))}for(;this.executionSignals.length{const i=Date.now();this._timer=i-this._startTime;const s={startTime:this._startTime,currentTime:i,deltaTime:this._timer,completeRate:this._timer/this._timeToEnd,payload:t},a=this._breakOnNextTick||this._breakCondition(s);a||this._timer>=this._timeToEnd?this._stop(s,a):this.onEachCountObservable.notifyObservers(s)},this._setState(0),this._contextObservable=e.contextObservable,this._observableParameters=e.observableParameters??{},this._breakCondition=e.breakCondition??(()=>!1),this._timeToEnd=e.timeout,e.onEnded&&this.onTimerEndedObservable.add(e.onEnded),e.onTick&&this.onEachCountObservable.add(e.onTick),e.onAborted&&this.onTimerAbortedObservable.add(e.onAborted)}set breakCondition(e){this._breakCondition=e}clearObservables(){this.onEachCountObservable.clear(),this.onTimerAbortedObservable.clear(),this.onTimerEndedObservable.clear(),this.onStateChangedObservable.clear()}start(e=this._timeToEnd){if(this._state===1)throw new Error("Timer already started. Please stop it before starting again");this._timeToEnd=e,this._startTime=Date.now(),this._timer=0,this._observer=this._contextObservable.add(this._tick,this._observableParameters.mask,this._observableParameters.insertFirst,this._observableParameters.scope),this._setState(1)}stop(){this._state===1&&(this._breakOnNextTick=!0)}dispose(){this._observer&&this._contextObservable.remove(this._observer),this.clearObservables()}_setState(e){this._state=e,this.onStateChangedObservable.notifyObservers(this._state)}_stop(e,t=!1){this._contextObservable.remove(this._observer),this._setState(2),t?this.onTimerAbortedObservable.notifyObservers(e):this.onTimerEndedObservable.notifyObservers(e)}}class l extends m{constructor(e){super(e),this.cancel=this._registerSignalInput("cancel"),this.duration=this.registerDataInput("duration",u),this.lastDelayIndex=this.registerDataOutput("lastDelayIndex",v,new h(-1))}_preparePendingTasks(e){const t=this.duration.getValue(e);if(t<0||isNaN(t)||!isFinite(t))return this._reportError(e,"Invalid duration in SetDelay block");if(e._getGlobalContextVariable("activeDelays",0)>=l.MaxParallelDelayCount)return this._reportError(e,"Max parallel delays reached");const s=e._getGlobalContextVariable("lastDelayIndex",-1),a=e._getExecutionVariable(this,"pendingDelays",[]),c=e.configuration.scene,o=new T({timeout:t*1e3,contextObservable:c.onBeforeRenderObservable,onEnded:()=>this._onEnded(o,e)});o.start();const b=s+1;this.lastDelayIndex.setValue(new h(b),e),e._setGlobalContextVariable("lastDelayIndex",b),a[b]=o,e._setExecutionVariable(this,"pendingDelays",a),this._updateGlobalTimers(e)}_cancelPendingTasks(e){const t=e._getExecutionVariable(this,"pendingDelays",[]);for(const i of t)i?.dispose();e._deleteExecutionVariable(this,"pendingDelays"),this.lastDelayIndex.setValue(new h(-1),e),this._updateGlobalTimers(e)}_execute(e,t){if(t===this.cancel){this._cancelPendingTasks(e);return}else this._preparePendingTasks(e),this.out._activateSignal(e)}getClassName(){return"FlowGraphSetDelayBlock"}_onEnded(e,t){const i=t._getExecutionVariable(this,"pendingDelays",[]),s=i.indexOf(e);s!==-1?i.splice(s,1):d.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list"),t._removePendingBlock(this),this.done._activateSignal(t),this._updateGlobalTimers(t)}_updateGlobalTimers(e){const t=e._getExecutionVariable(this,"pendingDelays",[]),i=e._getGlobalContextVariable("pendingDelays",[]);for(let s=0;sn.uniqueId===i);if(r){for(const n of r.targetedAnimations)if(n.target===s&&n.animation.targetProperty===o){r.stop(!0),r.dispose();const p=e.indexOf(i);p!==-1&&(e.splice(p,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",e))}}}}_setPropertyValue(t,s,o){const e=s.split(".");let i=t;for(let r=0;rr.uniqueId==s);if(l){for(const r of l.targetedAnimations)if(r.target===a&&r.animation.targetProperty===i){l.stop();const o=e.indexOf(s);o>-1&&e.splice(o,1),a._setGlobalContextVariable("currentlyRunningAnimationGroups",e);break}}}const b=this.getDataInput(t||i)?.getValue(a);a.setVariable(i,b)}getClassName(){return"FlowGraphSetVariableBlock"}serialize(a){super.serialize(a),a.config.variable=this.config?.variable}}u("FlowGraphSetVariableBlock",f);export{f as FlowGraphSetVariableBlock}; diff --git a/assets/flowGraphStopAnimationBlock-BECrV18a.js b/assets/flowGraphStopAnimationBlock-BECrV18a.js deleted file mode 100644 index 5b394682d3cf99d12749a133a561079ecd4d4308..0000000000000000000000000000000000000000 --- a/assets/flowGraphStopAnimationBlock-BECrV18a.js +++ /dev/null @@ -1 +0,0 @@ -import{R as a,b as e}from"./declarationMapper--DEn7iYN.js";import{L as s,R as r}from"./index-GY9JDBGV.js";import{a as p}from"./KHR_interactivity-DnpPVqY7.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class l extends p{constructor(i){super(i),this.animationGroup=this.registerDataInput("animationGroup",a),this.stopAtFrame=this.registerDataInput("stopAtFrame",e,-1)}_preparePendingTasks(i){const o=this.animationGroup.getValue(i),t=this.stopAtFrame.getValue(i)??-1,n=i._getGlobalContextVariable("pendingStopAnimations",[]);n.push({uniqueId:o.uniqueId,stopAtFrame:t}),i._setGlobalContextVariable("pendingStopAnimations",n)}_cancelPendingTasks(i){const o=this.animationGroup.getValue(i),t=i._getGlobalContextVariable("pendingStopAnimations",[]);for(let n=0;n0?this._startPendingTasks(i):this._stopAnimation(o,i),this.out._activateSignal(i)}_executeOnTick(i){const o=this.animationGroup.getValue(i),t=i._getGlobalContextVariable("pendingStopAnimations",[]);for(let n=0;n=t[n].stopAtFrame){this._stopAnimation(o,i),t.splice(n,1),i._setGlobalContextVariable("pendingStopAnimations",t),this.done._activateSignal(i),i._removePendingBlock(this);break}}getClassName(){return"FlowGraphStopAnimationBlock"}_stopAnimation(i,o){const t=o._getGlobalContextVariable("currentlyRunningAnimationGroups",[]),n=t.indexOf(i.uniqueId);n!==-1&&(i.stop(),t.splice(n,1),o._setGlobalContextVariable("currentlyRunningAnimationGroups",t))}}r("FlowGraphStopAnimationBlock",l);export{l as FlowGraphStopAnimationBlock}; diff --git a/assets/flowGraphSwitchBlock-Bvo_J2Tt.js b/assets/flowGraphSwitchBlock-Bvo_J2Tt.js deleted file mode 100644 index 52379a360bff6cedd8b94a017dc3a399243b164d..0000000000000000000000000000000000000000 --- a/assets/flowGraphSwitchBlock-Bvo_J2Tt.js +++ /dev/null @@ -1 +0,0 @@ -import{e as a,i as o,g as u}from"./KHR_interactivity-DnpPVqY7.js";import{R as c}from"./declarationMapper--DEn7iYN.js";import{R as l}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class r extends a{constructor(t){super(t),this.config=t,this.default=this._registerSignalOutput("default"),this._caseToOutputFlow=new Map,this.case=this.registerDataInput("case",c);const e=this.config.cases||[];for(const s of e)this._caseToOutputFlow.set(s,this._registerSignalOutput(`out_${s}`))}_execute(t,e){const s=this.case.getValue(t);let i;o(s)?i=this._getOutputFlowForCase(u(s)):i=this._getOutputFlowForCase(s),i?i._activateSignal(t):this.default._activateSignal(t)}addCase(t){this.config.cases.includes(t)||(this.config.cases.push(t),this._caseToOutputFlow.set(t,this._registerSignalOutput(`out_${t}`)))}removeCase(t){if(!this.config.cases.includes(t))return;const e=this.config.cases.indexOf(t);this.config.cases.splice(e,1),this._caseToOutputFlow.delete(t)}_getOutputFlowForCase(t){return this._caseToOutputFlow.get(t)}getClassName(){return"FlowGraphSwitchBlock"}serialize(t){super.serialize(t),t.cases=this.config.cases}}l("FlowGraphSwitchBlock",r);export{r as FlowGraphSwitchBlock}; diff --git a/assets/flowGraphThrottleBlock-DvCQTEiE.js b/assets/flowGraphThrottleBlock-DvCQTEiE.js deleted file mode 100644 index 322a849a54c1cdd17994e436e3287f92d1d00dd0..0000000000000000000000000000000000000000 --- a/assets/flowGraphThrottleBlock-DvCQTEiE.js +++ /dev/null @@ -1 +0,0 @@ -import{b as l}from"./declarationMapper--DEn7iYN.js";import{b as u}from"./KHR_interactivity-DnpPVqY7.js";import{R as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class h extends u{constructor(i){super(i),this.reset=this._registerSignalInput("reset"),this.duration=this.registerDataInput("duration",l),this.lastRemainingTime=this.registerDataOutput("lastRemainingTime",l,NaN)}_execute(i,n){if(n===this.reset){this.lastRemainingTime.setValue(NaN,i),i._setExecutionVariable(this,"lastRemainingTime",NaN),i._setExecutionVariable(this,"timestamp",0);return}const e=this.duration.getValue(i);if(e<=0||isNaN(e)||!isFinite(e))return this._reportError(i,"Invalid duration in Throttle block");const m=i._getExecutionVariable(this,"lastRemainingTime",NaN),t=Date.now();if(isNaN(m))return this.lastRemainingTime.setValue(0,i),i._setExecutionVariable(this,"lastRemainingTime",0),i._setExecutionVariable(this,"timestamp",t),this.out._activateSignal(i);{const a=t-i._getExecutionVariable(this,"timestamp",0),s=e*1e3;if(s<=a)return this.lastRemainingTime.setValue(0,i),i._setExecutionVariable(this,"lastRemainingTime",0),i._setExecutionVariable(this,"timestamp",t),this.out._activateSignal(i);{const r=s-a;this.lastRemainingTime.setValue(r/1e3,i),i._setExecutionVariable(this,"lastRemainingTime",r)}}}getClassName(){return"FlowGraphThrottleBlock"}}o("FlowGraphThrottleBlock",h);export{h as FlowGraphThrottleBlock}; diff --git a/assets/flowGraphTransformCoordinatesSystemBlock-Cdsh0cBZ.js b/assets/flowGraphTransformCoordinatesSystemBlock-Cdsh0cBZ.js deleted file mode 100644 index 159d5d8b183be9ef7c715ca78a8e51a3268a051e..0000000000000000000000000000000000000000 --- a/assets/flowGraphTransformCoordinatesSystemBlock-Cdsh0cBZ.js +++ /dev/null @@ -1 +0,0 @@ -import{F as c}from"./KHR_interactivity-DnpPVqY7.js";import{R as e,e as r}from"./declarationMapper--DEn7iYN.js";import{c as i,V as d,R as h}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class y extends c{constructor(t){super(t),this.sourceSystem=this.registerDataInput("sourceSystem",e),this.destinationSystem=this.registerDataInput("destinationSystem",e),this.inputCoordinates=this.registerDataInput("inputCoordinates",r),this.outputCoordinates=this.registerDataOutput("outputCoordinates",r)}_updateOutputs(t){const a=this.sourceSystem.getValue(t),n=this.destinationSystem.getValue(t),u=this.inputCoordinates.getValue(t),p=a.getWorldMatrix(),m=n.getWorldMatrix(),s=i.Matrix[0].copyFrom(m);s.invert();const o=i.Matrix[1];s.multiplyToRef(p,o);const l=this.outputCoordinates.getValue(t);d.TransformCoordinatesToRef(u,o,l)}getClassName(){return"FlowGraphTransformCoordinatesSystemBlock"}}h("FlowGraphTransformCoordinatesSystemBlock",y);export{y as FlowGraphTransformCoordinatesSystemBlock}; diff --git a/assets/flowGraphTypeToTypeBlocks-CdqQYaY1.js b/assets/flowGraphTypeToTypeBlocks-CdqQYaY1.js deleted file mode 100644 index 750795a6e203ce8dc24e8ff1dd14fddd929e623f..0000000000000000000000000000000000000000 --- a/assets/flowGraphTypeToTypeBlocks-CdqQYaY1.js +++ /dev/null @@ -1 +0,0 @@ -import{F as a}from"./flowGraphUnaryOperationBlock-DezHCHpH.js";import{b as n,i as s,F as e,c as F}from"./declarationMapper--DEn7iYN.js";import{R as l}from"./index-GY9JDBGV.js";import"./flowGraphCachedOperationBlock-C58XZTsG.js";import"./KHR_interactivity-DnpPVqY7.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class p extends a{constructor(r){super(F,n,o=>+o,"FlowGraphBooleanToFloat",r)}}l("FlowGraphBooleanToFloat",p);class u extends a{constructor(r){super(F,s,o=>e.FromValue(+o),"FlowGraphBooleanToInt",r)}}l("FlowGraphBooleanToInt",u);class c extends a{constructor(r){super(n,F,o=>!!o,"FlowGraphFloatToBoolean",r)}}l("FlowGraphFloatToBoolean",c);class h extends a{constructor(r){super(s,F,o=>!!o.value,"FlowGraphIntToBoolean",r)}}l("FlowGraphIntToBoolean",h);class w extends a{constructor(r){super(s,n,o=>o.value,"FlowGraphIntToFloat",r)}}l("FlowGraphIntToFloat",w);class G extends a{constructor(r){super(n,s,o=>{switch(r?.roundingMode){case"floor":return e.FromValue(Math.floor(o));case"ceil":return e.FromValue(Math.ceil(o));case"round":return e.FromValue(Math.round(o));default:return e.FromValue(o)}},"FlowGraphFloatToInt",r)}}l("FlowGraphFloatToInt",G);export{p as FlowGraphBooleanToFloat,u as FlowGraphBooleanToInt,c as FlowGraphFloatToBoolean,G as FlowGraphFloatToInt,h as FlowGraphIntToBoolean,w as FlowGraphIntToFloat}; diff --git a/assets/flowGraphUnaryOperationBlock-DezHCHpH.js b/assets/flowGraphUnaryOperationBlock-DezHCHpH.js deleted file mode 100644 index 8d121d51c833331c32e5aeb020b3517ef5a8292f..0000000000000000000000000000000000000000 --- a/assets/flowGraphUnaryOperationBlock-DezHCHpH.js +++ /dev/null @@ -1 +0,0 @@ -import{F as o}from"./flowGraphCachedOperationBlock-C58XZTsG.js";class p extends o{constructor(a,t,s,e,r){super(t,r),this._operation=s,this._className=e,this.a=this.registerDataInput("a",a)}_doOperation(a){return this._operation(this.a.getValue(a))}getClassName(){return this._className}}export{p as F}; diff --git a/assets/flowGraphVectorMathBlocks-9N0EGpm7.js b/assets/flowGraphVectorMathBlocks-9N0EGpm7.js deleted file mode 100644 index 027acf3902f1ffb9107ae326b8fd4a3c3d3fab47..0000000000000000000000000000000000000000 --- a/assets/flowGraphVectorMathBlocks-9N0EGpm7.js +++ /dev/null @@ -1 +0,0 @@ -import{F as f,h as u}from"./KHR_interactivity-DnpPVqY7.js";import{e as a,f as c,b as i,c as y,h as A,g as m,l as d,R as h}from"./declarationMapper--DEn7iYN.js";import{ao as w,aB as k,V as F,ai as C,R as s}from"./index-GY9JDBGV.js";import{F as n}from"./flowGraphBinaryOperationBlock-BCZdn6kI.js";import{F as B}from"./flowGraphUnaryOperationBlock-DezHCHpH.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";import"./flowGraphCachedOperationBlock-C58XZTsG.js";function D(e,o){return e.x*o.x+e.y*o.y+e.z*o.z}function T(e,o){return e.x*o.x+e.y*o.y+e.z*o.z+e.w*o.w}function R(e,o){return Math.acos(k(T(e,o),-1,1))*2}function N(e,o){const r=new w;return Q(e,o,r),r}function Q(e,o,r){const t=F.Cross(e,o),l=Math.acos(k(D(e,o),-1,1));return w.RotationAxisToRef(t,l,r),r}const G="cachedOperationAxis",V="cachedOperationAngle",x="cachedExecutionId";class z extends B{constructor(o){super(h,i,r=>this._polymorphicLength(r),"FlowGraphLengthBlock",o)}_polymorphicLength(o){switch(u(o)){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":return o.length();default:throw new Error(`Cannot compute length of value ${o}`)}}}s("FlowGraphLengthBlock",z);class _ extends B{constructor(o){super(h,h,r=>this._polymorphicNormalize(r),"FlowGraphNormalizeBlock",o)}_polymorphicNormalize(o){const r=u(o);let t;switch(r){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":return t=o.normalizeToNew(),this.config?.nanOnZeroLength&&o.length()===0&&t.setAll(NaN),t;default:throw new Error(`Cannot normalize value ${o}`)}}}s("FlowGraphNormalizeBlock",_);class E extends n{constructor(o){super(h,h,i,(r,t)=>this._polymorphicDot(r,t),"FlowGraphDotBlock",o)}_polymorphicDot(o,r){switch(u(o)){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":return o.dot(r);default:throw new Error(`Cannot get dot product of ${o} and ${r}`)}}}s("FlowGraphDotBlock",E);class O extends n{constructor(o){super(a,a,a,(r,t)=>F.Cross(r,t),"FlowGraphCrossBlock",o)}}s("FlowGraphCrossBlock",O);class I extends n{constructor(o){super(d,i,d,(r,t)=>r.rotate(t),"FlowGraphRotate2DBlock",o)}}s("FlowGraphRotate2DBlock",I);class L extends n{constructor(o){super(a,c,a,(r,t)=>r.applyRotationQuaternion(t),"FlowGraphRotate3DBlock",o)}}s("FlowGraphRotate3DBlock",L);function M(e,o){switch(u(e)){case"Vector2":return o.transformVector(e);case"Vector3":return o.transformVector(e);case"Vector4":return e=e,new C(e.x*o.m[0]+e.y*o.m[1]+e.z*o.m[2]+e.w*o.m[3],e.x*o.m[4]+e.y*o.m[5]+e.z*o.m[6]+e.w*o.m[7],e.x*o.m[8]+e.y*o.m[9]+e.z*o.m[10]+e.w*o.m[11],e.x*o.m[12]+e.y*o.m[13]+e.z*o.m[14]+e.w*o.m[15]);default:throw new Error(`Cannot transform value ${e}`)}}class v extends n{constructor(o){const r=o?.vectorType||"Vector3",t=r==="Vector2"?"Matrix2D":r==="Vector3"?"Matrix3D":"Matrix";super(m(r),m(t),m(r),M,"FlowGraphTransformVectorBlock",o)}}s("FlowGraphTransformVectorBlock",v);class $ extends n{constructor(o){super(a,A,a,(r,t)=>F.TransformCoordinates(r,t),"FlowGraphTransformCoordinatesBlock",o)}}s("FlowGraphTransformCoordinatesBlock",$);class j extends B{constructor(o){super(c,c,r=>r.conjugate(),"FlowGraphConjugateBlock",o)}}s("FlowGraphConjugateBlock",j);class U extends n{constructor(o){super(c,c,i,(r,t)=>R(r,t),"FlowGraphAngleBetweenBlock",o)}}s("FlowGraphAngleBetweenBlock",U);class Z extends n{constructor(o){super(a,i,c,(r,t)=>w.RotationAxis(r,t),"FlowGraphQuaternionFromAxisAngleBlock",o)}}s("FlowGraphQuaternionFromAxisAngleBlock",Z);class q extends f{constructor(o){super(o),this.a=this.registerDataInput("a",c),this.axis=this.registerDataOutput("axis",a),this.angle=this.registerDataOutput("angle",i),this.isValid=this.registerDataOutput("isValid",y)}_updateOutputs(o){const r=o._getExecutionVariable(this,x,-1),t=o._getExecutionVariable(this,G,null),l=o._getExecutionVariable(this,V,null);if(t!=null&&l!==void 0&&l!==null&&r===o.executionId)this.axis.setValue(t,o),this.angle.setValue(l,o);else try{const{axis:p,angle:g}=this.a.getValue(o).toAxisAngle();o._setExecutionVariable(this,G,p),o._setExecutionVariable(this,V,g),o._setExecutionVariable(this,x,o.executionId),this.axis.setValue(p,o),this.angle.setValue(g,o),this.isValid.setValue(!0,o)}catch{this.isValid.setValue(!1,o)}}getClassName(){return"FlowGraphAxisAngleFromQuaternionBlock"}}s("FlowGraphAxisAngleFromQuaternionBlock",q);class b extends n{constructor(o){super(a,a,c,(r,t)=>N(r,t),"FlowGraphQuaternionFromDirectionsBlock",o)}}export{U as FlowGraphAngleBetweenBlock,q as FlowGraphAxisAngleFromQuaternionBlock,j as FlowGraphConjugateBlock,O as FlowGraphCrossBlock,E as FlowGraphDotBlock,z as FlowGraphLengthBlock,_ as FlowGraphNormalizeBlock,Z as FlowGraphQuaternionFromAxisAngleBlock,b as FlowGraphQuaternionFromDirectionsBlock,I as FlowGraphRotate2DBlock,L as FlowGraphRotate3DBlock,v as FlowGraphTransformBlock,$ as FlowGraphTransformCoordinatesBlock}; diff --git a/assets/flowGraphWaitAllBlock-CkaEjrg9.js b/assets/flowGraphWaitAllBlock-CkaEjrg9.js deleted file mode 100644 index 1c36743a1ba53f4513750198fd7d7316232a71fd..0000000000000000000000000000000000000000 --- a/assets/flowGraphWaitAllBlock-CkaEjrg9.js +++ /dev/null @@ -1 +0,0 @@ -import{b as a}from"./KHR_interactivity-DnpPVqY7.js";import{R as o}from"./index-GY9JDBGV.js";import{i as r,F as n}from"./declarationMapper--DEn7iYN.js";import"./index-DydPgVMC.js";import"./objectModelMapping-CpTIXcMS.js";class l extends a{constructor(i){super(i),this.config=i,this.inFlows=[],this._cachedActivationState=[],this.reset=this._registerSignalInput("reset"),this.completed=this._registerSignalOutput("completed"),this.remainingInputs=this.registerDataOutput("remainingInputs",r,new n(this.config.inputSignalCount||0));for(let e=0;e=0&&(s[t]=!0)}if(this.remainingInputs.setValue(new n(s.filter(t=>!t).length),i),i._setExecutionVariable(this,"activationState",s.slice()),s.includes(!1))e!==this.reset&&this.out._activateSignal(i);else{this.completed._activateSignal(i);for(let t=0;t=t.MaxLoopCount){l.Warn("FlowGraphWhileLoopBlock: Max loop count reached. Breaking.");break}o=this.condition.getValue(i)}this.completed._activateSignal(i)}getClassName(){return"FlowGraphWhileLoopBlock"}}t.MaxLoopCount=1e3;n("FlowGraphWhileLoopBlock",t);export{t as FlowGraphWhileLoopBlock}; diff --git a/assets/fogFragment-DjadYfQv.js b/assets/fogFragment-DjadYfQv.js deleted file mode 100644 index e48378726ae96a575678ea203964174d4f897bce..0000000000000000000000000000000000000000 --- a/assets/fogFragment-DjadYfQv.js +++ /dev/null @@ -1,25 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";const f="fogFragmentDeclaration",r=`#ifdef FOG -#define FOGMODE_NONE 0. -#define FOGMODE_EXP 1. -#define FOGMODE_EXP2 2. -#define FOGMODE_LINEAR 3. -const E=2.71828;uniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32 -{var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x) -{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);} -else if (FOGMODE_EXP==uniforms.vFogInfos.x) -{fogCoeff=1.0/pow(E,fogDistance*fogDensity);} -else if (FOGMODE_EXP2==uniforms.vFogInfos.x) -{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);} -return clamp(fogCoeff,0.0,1.0);} -#endif -`;o.IncludesShadersStoreWGSL[f]||(o.IncludesShadersStoreWGSL[f]=r);const e="logDepthFragment",s=`#ifdef LOGARITHMICDEPTH -fragmentOutputs.fragDepth=log2(fragmentInputs.vFragmentDepth)*uniforms.logarithmicDepthConstant*0.5; -#endif -`;o.IncludesShadersStoreWGSL[e]||(o.IncludesShadersStoreWGSL[e]=s);const n="fogFragment",t=`#ifdef FOG -var fog: f32=CalcFogFactor(); -#ifdef PBR -fog=toLinearSpace(fog); -#endif -color= vec4f(mix(uniforms.vFogColor,color.rgb,fog),color.a); -#endif -`;o.IncludesShadersStoreWGSL[n]||(o.IncludesShadersStoreWGSL[n]=t); diff --git a/assets/fogFragment-M_o52SDz.js b/assets/fogFragment-M_o52SDz.js deleted file mode 100644 index 066b01878b4f3be90a714331fc921fde6030e598..0000000000000000000000000000000000000000 --- a/assets/fogFragment-M_o52SDz.js +++ /dev/null @@ -1,26 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";const e="fogFragmentDeclaration",t=`#ifdef FOG -#define FOGMODE_NONE 0. -#define FOGMODE_EXP 1. -#define FOGMODE_EXP2 2. -#define FOGMODE_LINEAR 3. -#define E 2.71828 -uniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor() -{float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x) -{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);} -else if (FOGMODE_EXP==vFogInfos.x) -{fogCoeff=1.0/pow(E,fogDistance*fogDensity);} -else if (FOGMODE_EXP2==vFogInfos.x) -{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);} -return clamp(fogCoeff,0.0,1.0);} -#endif -`;o.IncludesShadersStore[e]||(o.IncludesShadersStore[e]=t);const f="logDepthFragment",g=`#ifdef LOGARITHMICDEPTH -gl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5; -#endif -`;o.IncludesShadersStore[f]||(o.IncludesShadersStore[f]=g);const n="fogFragment",a=`#ifdef FOG -float fog=CalcFogFactor(); -#ifdef PBR -fog=toLinearSpace(fog); -#endif -color.rgb=mix(vFogColor,color.rgb,fog); -#endif -`;o.IncludesShadersStore[n]||(o.IncludesShadersStore[n]=a); diff --git a/assets/fresnelFunction-xm2bLg9t.js b/assets/fresnelFunction-xm2bLg9t.js deleted file mode 100644 index 42fc3666da261f3cb6e755ed1286d5ec11c33bc8..0000000000000000000000000000000000000000 --- a/assets/fresnelFunction-xm2bLg9t.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="fresnelFunction",o=`#ifdef FRESNEL -fn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32 -{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);} -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=o); diff --git a/assets/frontmatter-FN0veR8a.js b/assets/frontmatter-FN0veR8a.js deleted file mode 100644 index 26a235ea8f9706652bb4ed485589032d8e4bdf2b..0000000000000000000000000000000000000000 --- a/assets/frontmatter-FN0veR8a.js +++ /dev/null @@ -1 +0,0 @@ -import{p as s,s as m,f as l,c as i,S as p,t as o}from"./Code-Bhm2YgEI.js";import{yaml as f}from"./yaml-DsCXHVTH.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";const n=/^---\s*$/m,M={defineNodes:[{name:"Frontmatter",block:!0},"FrontmatterMark"],props:[m({Frontmatter:[o.documentMeta,o.monospace],FrontmatterMark:o.processingInstruction}),l.add({Frontmatter:i,FrontmatterMark:()=>null})],wrap:s(t=>{const{parser:e}=p.define(f);return t.type.name==="Frontmatter"?{parser:e,overlay:[{from:t.from+4,to:t.to-4}]}:null}),parseBlock:[{name:"Frontmatter",before:"HorizontalRule",parse:(t,e)=>{let r;const a=new Array;if(t.lineStart===0&&n.test(e.text)){for(a.push(t.elt("FrontmatterMark",0,4));t.nextLine();)if(n.test(e.text)){r=t.lineStart+4;break}return r!==void 0&&(a.push(t.elt("FrontmatterMark",r-4,r)),t.addElement(t.elt("Frontmatter",0,r,a))),!0}return!1}}]};export{M as frontmatter}; diff --git a/assets/ganttDiagram-JELNMOA3-B-_v82D_.js b/assets/ganttDiagram-JELNMOA3-B-_v82D_.js deleted file mode 100644 index b2c2649471ab323008030bb8a64d0f51040d88a6..0000000000000000000000000000000000000000 --- a/assets/ganttDiagram-JELNMOA3-B-_v82D_.js +++ /dev/null @@ -1,267 +0,0 @@ -import{g as ve,s as xe,q as Te,p as be,a as we,b as _e,_ as c,c as lt,d as De,as as G,l as nt,j as Se,i as Me,y as Ce,u as Ee}from"./mermaid.core-BcqUqpnI.js";import{L as Et}from"./i18n-CPHyzK9b.js";import{t as Ie,m as Ae,a as Fe,i as $e,b as Ut,c as Zt,d as Ye,e as Le,f as We,g as Oe,h as Pe,j as Ve,k as ze,l as Qt,n as Kt,o as Jt,s as te,p as ee}from"./time-BMaLdJ6b.js";import{l as Ne}from"./linear-8mDBZVC7.js";import{s as pt}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./defaultLocale-CzDG__Ur.js";function Re(t){return t}var xt=1,At=2,$t=3,vt=4,re=1e-6;function He(t){return"translate("+t+",0)"}function Be(t){return"translate(0,"+t+")"}function qe(t){return i=>+t(i)}function je(t,i){return i=Math.max(0,t.bandwidth()-i*2)/2,t.round()&&(i=Math.round(i)),n=>+t(n)+i}function Ge(){return!this.__axis}function ue(t,i){var n=[],s=null,a=null,m=6,h=6,b=3,E=typeof window<"u"&&window.devicePixelRatio>1?0:.5,F=t===xt||t===vt?-1:1,T=t===vt||t===At?"x":"y",L=t===xt||t===$t?He:Be;function M(D){var N=s??(i.ticks?i.ticks.apply(i,n):i.domain()),I=a??(i.tickFormat?i.tickFormat.apply(i,n):Re),S=Math.max(m,0)+b,C=i.range(),O=+C[0]+E,Y=+C[C.length-1]+E,R=(i.bandwidth?je:qe)(i.copy(),E),H=D.selection?D.selection():D,A=H.selectAll(".domain").data([null]),p=H.selectAll(".tick").data(N,i).order(),d=p.exit(),u=p.enter().append("g").attr("class","tick"),x=p.select("line"),v=p.select("text");A=A.merge(A.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),p=p.merge(u),x=x.merge(u.append("line").attr("stroke","currentColor").attr(T+"2",F*m)),v=v.merge(u.append("text").attr("fill","currentColor").attr(T,F*S).attr("dy",t===xt?"0em":t===$t?"0.71em":"0.32em")),D!==H&&(A=A.transition(D),p=p.transition(D),x=x.transition(D),v=v.transition(D),d=d.transition(D).attr("opacity",re).attr("transform",function(k){return isFinite(k=R(k))?L(k+E):this.getAttribute("transform")}),u.attr("opacity",re).attr("transform",function(k){var f=this.parentNode.__axis;return L((f&&isFinite(f=f(k))?f:R(k))+E)})),d.remove(),A.attr("d",t===vt||t===At?h?"M"+F*h+","+O+"H"+E+"V"+Y+"H"+F*h:"M"+E+","+O+"V"+Y:h?"M"+O+","+F*h+"V"+E+"H"+Y+"V"+F*h:"M"+O+","+E+"H"+Y),p.attr("opacity",1).attr("transform",function(k){return L(R(k)+E)}),x.attr(T+"2",F*m),v.attr(T,F*S).text(I),H.filter(Ge).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===At?"start":t===vt?"end":"middle"),H.each(function(){this.__axis=R})}return M.scale=function(D){return arguments.length?(i=D,M):i},M.ticks=function(){return n=Array.from(arguments),M},M.tickArguments=function(D){return arguments.length?(n=D==null?[]:Array.from(D),M):n.slice()},M.tickValues=function(D){return arguments.length?(s=D==null?null:Array.from(D),M):s&&s.slice()},M.tickFormat=function(D){return arguments.length?(a=D,M):a},M.tickSize=function(D){return arguments.length?(m=h=+D,M):m},M.tickSizeInner=function(D){return arguments.length?(m=+D,M):m},M.tickSizeOuter=function(D){return arguments.length?(h=+D,M):h},M.tickPadding=function(D){return arguments.length?(b=+D,M):b},M.offset=function(D){return arguments.length?(E=+D,M):E},M}function Xe(t){return ue(xt,t)}function Ue(t){return ue($t,t)}var Tt={exports:{}},Ze=Tt.exports,ie;function Qe(){return ie||(ie=1,(function(t,i){(function(n,s){t.exports=s()})(Ze,(function(){var n="day";return function(s,a,m){var h=function(F){return F.add(4-F.isoWeekday(),n)},b=a.prototype;b.isoWeekYear=function(){return h(this).year()},b.isoWeek=function(F){if(!this.$utils().u(F))return this.add(7*(F-this.isoWeek()),n);var T,L,M,D,N=h(this),I=(T=this.isoWeekYear(),L=this.$u,M=(L?m.utc:m)().year(T).startOf("year"),D=4-M.isoWeekday(),M.isoWeekday()>4&&(D+=7),M.add(D,n));return N.diff(I,"week")+1},b.isoWeekday=function(F){return this.$utils().u(F)?this.day()||7:this.day(this.day()%7?F:F-7)};var E=b.startOf;b.startOf=function(F,T){var L=this.$utils(),M=!!L.u(T)||T;return L.p(F)==="isoweek"?M?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):E.bind(this)(F,T)}}}))})(Tt)),Tt.exports}var Ke=Qe();const Je=Et(Ke);var bt={exports:{}},tr=bt.exports,se;function er(){return se||(se=1,(function(t,i){(function(n,s){t.exports=s()})(tr,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},s=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,m=/\d\d/,h=/\d\d?/,b=/\d*[^-_:/,()\s\d]+/,E={},F=function(S){return(S=+S)+(S>68?1900:2e3)},T=function(S){return function(C){this[S]=+C}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(S){(this.zone||(this.zone={})).offset=(function(C){if(!C||C==="Z")return 0;var O=C.match(/([+-]|\d\d)/g),Y=60*O[1]+(+O[2]||0);return Y===0?0:O[0]==="+"?-Y:Y})(S)}],M=function(S){var C=E[S];return C&&(C.indexOf?C:C.s.concat(C.f))},D=function(S,C){var O,Y=E.meridiem;if(Y){for(var R=1;R<=24;R+=1)if(S.indexOf(Y(R,0,C))>-1){O=R>12;break}}else O=S===(C?"pm":"PM");return O},N={A:[b,function(S){this.afternoon=D(S,!1)}],a:[b,function(S){this.afternoon=D(S,!0)}],Q:[a,function(S){this.month=3*(S-1)+1}],S:[a,function(S){this.milliseconds=100*+S}],SS:[m,function(S){this.milliseconds=10*+S}],SSS:[/\d{3}/,function(S){this.milliseconds=+S}],s:[h,T("seconds")],ss:[h,T("seconds")],m:[h,T("minutes")],mm:[h,T("minutes")],H:[h,T("hours")],h:[h,T("hours")],HH:[h,T("hours")],hh:[h,T("hours")],D:[h,T("day")],DD:[m,T("day")],Do:[b,function(S){var C=E.ordinal,O=S.match(/\d+/);if(this.day=O[0],C)for(var Y=1;Y<=31;Y+=1)C(Y).replace(/\[|\]/g,"")===S&&(this.day=Y)}],w:[h,T("week")],ww:[m,T("week")],M:[h,T("month")],MM:[m,T("month")],MMM:[b,function(S){var C=M("months"),O=(M("monthsShort")||C.map((function(Y){return Y.slice(0,3)}))).indexOf(S)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[b,function(S){var C=M("months").indexOf(S)+1;if(C<1)throw new Error;this.month=C%12||C}],Y:[/[+-]?\d+/,T("year")],YY:[m,function(S){this.year=F(S)}],YYYY:[/\d{4}/,T("year")],Z:L,ZZ:L};function I(S){var C,O;C=S,O=E&&E.formats;for(var Y=(S=C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,v,k){var f=k&&k.toUpperCase();return v||O[k]||n[k]||O[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(o,l,y){return l||y.slice(1)}))}))).match(s),R=Y.length,H=0;H-1)return new Date((w==="X"?1e3:1)*g);var e=I(w)(g),_=e.year,V=e.month,P=e.day,W=e.hours,j=e.minutes,$=e.seconds,Q=e.milliseconds,rt=e.zone,ot=e.week,ft=new Date,ht=P||(_||V?1:ft.getDate()),ct=_||ft.getFullYear(),B=0;_&&!V||(B=V>0?V-1:ft.getMonth());var Z,X=W||0,st=j||0,K=$||0,it=Q||0;return rt?new Date(Date.UTC(ct,B,ht,X,st,K,it+60*rt.offset*1e3)):r?new Date(Date.UTC(ct,B,ht,X,st,K,it)):(Z=new Date(ct,B,ht,X,st,K,it),ot&&(Z=z(Z).week(ot).toDate()),Z)}catch{return new Date("")}})(A,u,p,O),this.init(),f&&f!==!0&&(this.$L=this.locale(f).$L),k&&A!=this.format(u)&&(this.$d=new Date("")),E={}}else if(u instanceof Array)for(var o=u.length,l=1;l<=o;l+=1){d[1]=u[l-1];var y=O.apply(this,d);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}l===o&&(this.$d=new Date(""))}else R.call(this,H)}}}))})(bt)),bt.exports}var rr=er();const ir=Et(rr);var wt={exports:{}},sr=wt.exports,ne;function nr(){return ne||(ne=1,(function(t,i){(function(n,s){t.exports=s()})(sr,(function(){return function(n,s){var a=s.prototype,m=a.format;a.format=function(h){var b=this,E=this.$locale();if(!this.isValid())return m.bind(this)(h);var F=this.$utils(),T=(h||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(L){switch(L){case"Q":return Math.ceil((b.$M+1)/3);case"Do":return E.ordinal(b.$D);case"gggg":return b.weekYear();case"GGGG":return b.isoWeekYear();case"wo":return E.ordinal(b.week(),"W");case"w":case"ww":return F.s(b.week(),L==="w"?1:2,"0");case"W":case"WW":return F.s(b.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return F.s(String(b.$H===0?24:b.$H),L==="k"?1:2,"0");case"X":return Math.floor(b.$d.getTime()/1e3);case"x":return b.$d.getTime();case"z":return"["+b.offsetName()+"]";case"zzz":return"["+b.offsetName("long")+"]";default:return L}}));return m.bind(this)(T)}}}))})(wt)),wt.exports}var ar=nr();const or=Et(ar);var _t={exports:{}},cr=_t.exports,ae;function lr(){return ae||(ae=1,(function(t,i){(function(n,s){t.exports=s()})(cr,(function(){var n,s,a=1e3,m=6e4,h=36e5,b=864e5,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F=31536e6,T=2628e6,L=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,M={years:F,months:T,days:b,hours:h,minutes:m,seconds:a,milliseconds:1,weeks:6048e5},D=function(A){return A instanceof R},N=function(A,p,d){return new R(A,d,p.$l)},I=function(A){return s.p(A)+"s"},S=function(A){return A<0},C=function(A){return S(A)?Math.ceil(A):Math.floor(A)},O=function(A){return Math.abs(A)},Y=function(A,p){return A?S(A)?{negative:!0,format:""+O(A)+p}:{negative:!1,format:""+A+p}:{negative:!1,format:""}},R=(function(){function A(d,u,x){var v=this;if(this.$d={},this.$l=x,d===void 0&&(this.$ms=0,this.parseFromMilliseconds()),u)return N(d*M[I(u)],this);if(typeof d=="number")return this.$ms=d,this.parseFromMilliseconds(),this;if(typeof d=="object")return Object.keys(d).forEach((function(o){v.$d[I(o)]=d[o]})),this.calMilliseconds(),this;if(typeof d=="string"){var k=d.match(L);if(k){var f=k.slice(2).map((function(o){return o!=null?Number(o):0}));return this.$d.years=f[0],this.$d.months=f[1],this.$d.weeks=f[2],this.$d.days=f[3],this.$d.hours=f[4],this.$d.minutes=f[5],this.$d.seconds=f[6],this.calMilliseconds(),this}}return this}var p=A.prototype;return p.calMilliseconds=function(){var d=this;this.$ms=Object.keys(this.$d).reduce((function(u,x){return u+(d.$d[x]||0)*M[x]}),0)},p.parseFromMilliseconds=function(){var d=this.$ms;this.$d.years=C(d/F),d%=F,this.$d.months=C(d/T),d%=T,this.$d.days=C(d/b),d%=b,this.$d.hours=C(d/h),d%=h,this.$d.minutes=C(d/m),d%=m,this.$d.seconds=C(d/a),d%=a,this.$d.milliseconds=d},p.toISOString=function(){var d=Y(this.$d.years,"Y"),u=Y(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var v=Y(x,"D"),k=Y(this.$d.hours,"H"),f=Y(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var l=Y(o,"S"),y=d.negative||u.negative||v.negative||k.negative||f.negative||l.negative,g=k.format||f.format||l.format?"T":"",w=(y?"-":"")+"P"+d.format+u.format+v.format+g+k.format+f.format+l.format;return w==="P"||w==="-P"?"P0D":w},p.toJSON=function(){return this.toISOString()},p.format=function(d){var u=d||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return u.replace(E,(function(v,k){return k||String(x[v])}))},p.as=function(d){return this.$ms/M[I(d)]},p.get=function(d){var u=this.$ms,x=I(d);return x==="milliseconds"?u%=1e3:u=x==="weeks"?C(u/M[x]):this.$d[x],u||0},p.add=function(d,u,x){var v;return v=u?d*M[I(u)]:D(d)?d.$ms:N(d,this).$ms,N(this.$ms+v*(x?-1:1),this)},p.subtract=function(d,u){return this.add(d,u,!0)},p.locale=function(d){var u=this.clone();return u.$l=d,u},p.clone=function(){return N(this.$ms,this)},p.humanize=function(d){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!d)},p.valueOf=function(){return this.asMilliseconds()},p.milliseconds=function(){return this.get("milliseconds")},p.asMilliseconds=function(){return this.as("milliseconds")},p.seconds=function(){return this.get("seconds")},p.asSeconds=function(){return this.as("seconds")},p.minutes=function(){return this.get("minutes")},p.asMinutes=function(){return this.as("minutes")},p.hours=function(){return this.get("hours")},p.asHours=function(){return this.as("hours")},p.days=function(){return this.get("days")},p.asDays=function(){return this.as("days")},p.weeks=function(){return this.get("weeks")},p.asWeeks=function(){return this.as("weeks")},p.months=function(){return this.get("months")},p.asMonths=function(){return this.as("months")},p.years=function(){return this.get("years")},p.asYears=function(){return this.as("years")},A})(),H=function(A,p,d){return A.add(p.years()*d,"y").add(p.months()*d,"M").add(p.days()*d,"d").add(p.hours()*d,"h").add(p.minutes()*d,"m").add(p.seconds()*d,"s").add(p.milliseconds()*d,"ms")};return function(A,p,d){n=d,s=d().$utils(),d.duration=function(v,k){var f=d.locale();return N(v,{$l:f},k)},d.isDuration=D;var u=p.prototype.add,x=p.prototype.subtract;p.prototype.add=function(v,k){return D(v)?H(this,v,1):u.bind(this)(v,k)},p.prototype.subtract=function(v,k){return D(v)?H(this,v,-1):x.bind(this)(v,k)}}}))})(_t)),_t.exports}var ur=lr();const dr=Et(ur);var Yt=(function(){var t=c(function(f,o,l,y){for(l=l||{},y=f.length;y--;l[f[y]]=o);return l},"o"),i=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],s=[1,27],a=[1,28],m=[1,29],h=[1,30],b=[1,31],E=[1,32],F=[1,33],T=[1,34],L=[1,9],M=[1,10],D=[1,11],N=[1,12],I=[1,13],S=[1,14],C=[1,15],O=[1,16],Y=[1,19],R=[1,20],H=[1,21],A=[1,22],p=[1,23],d=[1,25],u=[1,35],x={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:c(function(o,l,y,g,w,r,z){var e=r.length-1;switch(w){case 1:return r[e-1];case 2:this.$=[];break;case 3:r[e-1].push(r[e]),this.$=r[e-1];break;case 4:case 5:this.$=r[e];break;case 6:case 7:this.$=[];break;case 8:g.setWeekday("monday");break;case 9:g.setWeekday("tuesday");break;case 10:g.setWeekday("wednesday");break;case 11:g.setWeekday("thursday");break;case 12:g.setWeekday("friday");break;case 13:g.setWeekday("saturday");break;case 14:g.setWeekday("sunday");break;case 15:g.setWeekend("friday");break;case 16:g.setWeekend("saturday");break;case 17:g.setDateFormat(r[e].substr(11)),this.$=r[e].substr(11);break;case 18:g.enableInclusiveEndDates(),this.$=r[e].substr(18);break;case 19:g.TopAxis(),this.$=r[e].substr(8);break;case 20:g.setAxisFormat(r[e].substr(11)),this.$=r[e].substr(11);break;case 21:g.setTickInterval(r[e].substr(13)),this.$=r[e].substr(13);break;case 22:g.setExcludes(r[e].substr(9)),this.$=r[e].substr(9);break;case 23:g.setIncludes(r[e].substr(9)),this.$=r[e].substr(9);break;case 24:g.setTodayMarker(r[e].substr(12)),this.$=r[e].substr(12);break;case 27:g.setDiagramTitle(r[e].substr(6)),this.$=r[e].substr(6);break;case 28:this.$=r[e].trim(),g.setAccTitle(this.$);break;case 29:case 30:this.$=r[e].trim(),g.setAccDescription(this.$);break;case 31:g.addSection(r[e].substr(8)),this.$=r[e].substr(8);break;case 33:g.addTask(r[e-1],r[e]),this.$="task";break;case 34:this.$=r[e-1],g.setClickEvent(r[e-1],r[e],null);break;case 35:this.$=r[e-2],g.setClickEvent(r[e-2],r[e-1],r[e]);break;case 36:this.$=r[e-2],g.setClickEvent(r[e-2],r[e-1],null),g.setLink(r[e-2],r[e]);break;case 37:this.$=r[e-3],g.setClickEvent(r[e-3],r[e-2],r[e-1]),g.setLink(r[e-3],r[e]);break;case 38:this.$=r[e-2],g.setClickEvent(r[e-2],r[e],null),g.setLink(r[e-2],r[e-1]);break;case 39:this.$=r[e-3],g.setClickEvent(r[e-3],r[e-1],r[e]),g.setLink(r[e-3],r[e-2]);break;case 40:this.$=r[e-1],g.setLink(r[e-1],r[e]);break;case 41:case 47:this.$=r[e-1]+" "+r[e];break;case 42:case 43:case 45:this.$=r[e-2]+" "+r[e-1]+" "+r[e];break;case 44:case 46:this.$=r[e-3]+" "+r[e-2]+" "+r[e-1]+" "+r[e];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:s,14:a,15:m,16:h,17:b,18:E,19:18,20:F,21:T,22:L,23:M,24:D,25:N,26:I,27:S,28:C,29:O,30:Y,31:R,33:H,35:A,36:p,37:24,38:d,40:u},t(i,[2,7],{1:[2,1]}),t(i,[2,3]),{9:36,11:17,12:n,13:s,14:a,15:m,16:h,17:b,18:E,19:18,20:F,21:T,22:L,23:M,24:D,25:N,26:I,27:S,28:C,29:O,30:Y,31:R,33:H,35:A,36:p,37:24,38:d,40:u},t(i,[2,5]),t(i,[2,6]),t(i,[2,17]),t(i,[2,18]),t(i,[2,19]),t(i,[2,20]),t(i,[2,21]),t(i,[2,22]),t(i,[2,23]),t(i,[2,24]),t(i,[2,25]),t(i,[2,26]),t(i,[2,27]),{32:[1,37]},{34:[1,38]},t(i,[2,30]),t(i,[2,31]),t(i,[2,32]),{39:[1,39]},t(i,[2,8]),t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),t(i,[2,12]),t(i,[2,13]),t(i,[2,14]),t(i,[2,15]),t(i,[2,16]),{41:[1,40],43:[1,41]},t(i,[2,4]),t(i,[2,28]),t(i,[2,29]),t(i,[2,33]),t(i,[2,34],{42:[1,42],43:[1,43]}),t(i,[2,40],{41:[1,44]}),t(i,[2,35],{43:[1,45]}),t(i,[2,36]),t(i,[2,38],{42:[1,46]}),t(i,[2,37]),t(i,[2,39])],defaultActions:{},parseError:c(function(o,l){if(l.recoverable)this.trace(o);else{var y=new Error(o);throw y.hash=l,y}},"parseError"),parse:c(function(o){var l=this,y=[0],g=[],w=[null],r=[],z=this.table,e="",_=0,V=0,P=2,W=1,j=r.slice.call(arguments,1),$=Object.create(this.lexer),Q={yy:{}};for(var rt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,rt)&&(Q.yy[rt]=this.yy[rt]);$.setInput(o,Q.yy),Q.yy.lexer=$,Q.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var ot=$.yylloc;r.push(ot);var ft=$.options&&$.options.ranges;typeof Q.yy.parseError=="function"?this.parseError=Q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ht(U){y.length=y.length-2*U,w.length=w.length-U,r.length=r.length-U}c(ht,"popStack");function ct(){var U;return U=g.pop()||$.lex()||W,typeof U!="number"&&(U instanceof Array&&(g=U,U=g.pop()),U=l.symbols_[U]||U),U}c(ct,"lex");for(var B,Z,X,st,K={},it,J,Xt,gt;;){if(Z=y[y.length-1],this.defaultActions[Z]?X=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=ct()),X=z[Z]&&z[Z][B]),typeof X>"u"||!X.length||!X[0]){var It="";gt=[];for(it in z[Z])this.terminals_[it]&&it>P&>.push("'"+this.terminals_[it]+"'");$.showPosition?It="Parse error on line "+(_+1)+`: -`+$.showPosition()+` -Expecting `+gt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":It="Parse error on line "+(_+1)+": Unexpected "+(B==W?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(It,{text:$.match,token:this.terminals_[B]||B,line:$.yylineno,loc:ot,expected:gt})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+B);switch(X[0]){case 1:y.push(B),w.push($.yytext),r.push($.yylloc),y.push(X[1]),B=null,V=$.yyleng,e=$.yytext,_=$.yylineno,ot=$.yylloc;break;case 2:if(J=this.productions_[X[1]][1],K.$=w[w.length-J],K._$={first_line:r[r.length-(J||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(J||1)].first_column,last_column:r[r.length-1].last_column},ft&&(K._$.range=[r[r.length-(J||1)].range[0],r[r.length-1].range[1]]),st=this.performAction.apply(K,[e,V,_,Q.yy,X[1],w,r].concat(j)),typeof st<"u")return st;J&&(y=y.slice(0,-1*J*2),w=w.slice(0,-1*J),r=r.slice(0,-1*J)),y.push(this.productions_[X[1]][0]),w.push(K.$),r.push(K._$),Xt=z[y[y.length-2]][y[y.length-1]],y.push(Xt);break;case 3:return!0}}return!0},"parse")},v=(function(){var f={EOF:1,parseError:c(function(l,y){if(this.yy.parser)this.yy.parser.parseError(l,y);else throw new Error(l)},"parseError"),setInput:c(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:c(function(o){var l=o.length,y=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1&&(this.yylineno-=y.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===g.length?this.yylloc.first_column:0)+g[g.length-y.length].length-y[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(o){this.unput(this.match.slice(o))},"less"),pastInput:c(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` -`+l+"^"},"showPosition"),test_match:c(function(o,l){var y,g,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],y=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var r in w)this[r]=w[r];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,y,g;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),r=0;rl[0].length)){if(l=y,g=r,this.options.backtrack_lexer){if(o=this.test_match(y,w[r]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,w[g]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var l=this.next();return l||this.lex()},"lex"),begin:c(function(l){this.conditionStack.push(l)},"begin"),popState:c(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:c(function(l){this.begin(l)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(l,y,g,w){switch(g){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return f})();x.lexer=v;function k(){this.yy={}}return c(k,"Parser"),k.prototype=x,x.Parser=k,new k})();Yt.parser=Yt;var fr=Yt;G.extend(Je);G.extend(ir);G.extend(or);var oe={friday:5,saturday:6},tt="",Pt="",Vt=void 0,zt="",mt=[],kt=[],Nt=new Map,Rt=[],Mt=[],dt="",Ht="",de=["active","done","crit","milestone","vert"],Bt=[],yt=!1,qt=!1,jt="sunday",Ct="saturday",Lt=0,hr=c(function(){Rt=[],Mt=[],dt="",Bt=[],Dt=0,Ot=void 0,St=void 0,q=[],tt="",Pt="",Ht="",Vt=void 0,zt="",mt=[],kt=[],yt=!1,qt=!1,Lt=0,Nt=new Map,Ce(),jt="sunday",Ct="saturday"},"clear"),mr=c(function(t){Pt=t},"setAxisFormat"),kr=c(function(){return Pt},"getAxisFormat"),yr=c(function(t){Vt=t},"setTickInterval"),gr=c(function(){return Vt},"getTickInterval"),pr=c(function(t){zt=t},"setTodayMarker"),vr=c(function(){return zt},"getTodayMarker"),xr=c(function(t){tt=t},"setDateFormat"),Tr=c(function(){yt=!0},"enableInclusiveEndDates"),br=c(function(){return yt},"endDatesAreInclusive"),wr=c(function(){qt=!0},"enableTopAxis"),_r=c(function(){return qt},"topAxisEnabled"),Dr=c(function(t){Ht=t},"setDisplayMode"),Sr=c(function(){return Ht},"getDisplayMode"),Mr=c(function(){return tt},"getDateFormat"),Cr=c(function(t){mt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),Er=c(function(){return mt},"getIncludes"),Ir=c(function(t){kt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),Ar=c(function(){return kt},"getExcludes"),Fr=c(function(){return Nt},"getLinks"),$r=c(function(t){dt=t,Rt.push(t)},"addSection"),Yr=c(function(){return Rt},"getSections"),Lr=c(function(){let t=ce();const i=10;let n=0;for(;!t&&n{const E=b.trim();return E==="x"||E==="X"},"isTimestampFormat")(i)&&/^\d+$/.test(n))return new Date(Number(n));const m=/^after\s+(?[\d\w- ]+)/.exec(n);if(m!==null){let b=null;for(const F of m.groups.ids.split(" ")){let T=at(F);T!==void 0&&(!b||T.endTime>b.endTime)&&(b=T)}if(b)return b.endTime;const E=new Date;return E.setHours(0,0,0,0),E}let h=G(n,i.trim(),!0);if(h.isValid())return h.toDate();{nt.debug("Invalid date:"+n),nt.debug("With date format:"+i.trim());const b=new Date(n);if(b===void 0||isNaN(b.getTime())||b.getFullYear()<-1e4||b.getFullYear()>1e4)throw new Error("Invalid date:"+n);return b}},"getStartDate"),me=c(function(t){const i=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return i!==null?[Number.parseFloat(i[1]),i[2]]:[NaN,"ms"]},"parseDuration"),ke=c(function(t,i,n,s=!1){n=n.trim();const m=/^until\s+(?[\d\w- ]+)/.exec(n);if(m!==null){let T=null;for(const M of m.groups.ids.split(" ")){let D=at(M);D!==void 0&&(!T||D.startTime{window.open(n,"_self")}),Nt.set(s,n))}),ge(t,"clickable")},"setLink"),ge=c(function(t,i){t.split(",").forEach(function(n){let s=at(n);s!==void 0&&s.classes.push(i)})},"setClass"),qr=c(function(t,i,n){if(lt().securityLevel!=="loose"||i===void 0)return;let s=[];if(typeof n=="string"){s=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{Ee.runFunc(i,...s)})},"setClickFun"),pe=c(function(t,i){Bt.push(function(){const n=document.querySelector(`[id="${t}"]`);n!==null&&n.addEventListener("click",function(){i()})},function(){const n=document.querySelector(`[id="${t}-text"]`);n!==null&&n.addEventListener("click",function(){i()})})},"pushFun"),jr=c(function(t,i,n){t.split(",").forEach(function(s){qr(s,i,n)}),ge(t,"clickable")},"setClickEvent"),Gr=c(function(t){Bt.forEach(function(i){i(t)})},"bindFunctions"),Xr={getConfig:c(()=>lt().gantt,"getConfig"),clear:hr,setDateFormat:xr,getDateFormat:Mr,enableInclusiveEndDates:Tr,endDatesAreInclusive:br,enableTopAxis:wr,topAxisEnabled:_r,setAxisFormat:mr,getAxisFormat:kr,setTickInterval:yr,getTickInterval:gr,setTodayMarker:pr,getTodayMarker:vr,setAccTitle:_e,getAccTitle:we,setDiagramTitle:be,getDiagramTitle:Te,setDisplayMode:Dr,getDisplayMode:Sr,setAccDescription:xe,getAccDescription:ve,addSection:$r,getSections:Yr,getTasks:Lr,addTask:Rr,findTaskById:at,addTaskOrg:Hr,setIncludes:Cr,getIncludes:Er,setExcludes:Ir,getExcludes:Ar,setClickEvent:jr,setLink:Br,getLinks:Fr,bindFunctions:Gr,parseDuration:me,isInvalidDate:fe,setWeekday:Wr,getWeekday:Or,setWeekend:Pr};function Gt(t,i,n){let s=!0;for(;s;)s=!1,n.forEach(function(a){const m="^\\s*"+a+"\\s*$",h=new RegExp(m);t[0].match(h)&&(i[a]=!0,t.shift(1),s=!0)})}c(Gt,"getTaskTags");G.extend(dr);var Ur=c(function(){nt.debug("Something is calling, setConf, remove the call")},"setConf"),le={monday:ze,tuesday:Ve,wednesday:Pe,thursday:Oe,friday:We,saturday:Le,sunday:Ye},Zr=c((t,i)=>{let n=[...t].map(()=>-1/0),s=[...t].sort((m,h)=>m.startTime-h.startTime||m.order-h.order),a=0;for(const m of s)for(let h=0;h=n[h]){n[h]=m.endTime,m.order=h+i,h>a&&(a=h);break}return a},"getMaxIntersections"),et,Ft=1e4,Qr=c(function(t,i,n,s){const a=lt().gantt,m=lt().securityLevel;let h;m==="sandbox"&&(h=pt("#i"+i));const b=m==="sandbox"?pt(h.nodes()[0].contentDocument.body):pt("body"),E=m==="sandbox"?h.nodes()[0].contentDocument:document,F=E.getElementById(i);et=F.parentElement.offsetWidth,et===void 0&&(et=1200),a.useWidth!==void 0&&(et=a.useWidth);const T=s.db.getTasks();let L=[];for(const u of T)L.push(u.type);L=d(L);const M={};let D=2*a.topPadding;if(s.db.getDisplayMode()==="compact"||a.displayMode==="compact"){const u={};for(const v of T)u[v.section]===void 0?u[v.section]=[v]:u[v.section].push(v);let x=0;for(const v of Object.keys(u)){const k=Zr(u[v],x)+1;x+=k,D+=k*(a.barHeight+a.barGap),M[v]=k}}else{D+=T.length*(a.barHeight+a.barGap);for(const u of L)M[u]=T.filter(x=>x.type===u).length}F.setAttribute("viewBox","0 0 "+et+" "+D);const N=b.select(`[id="${i}"]`),I=Ie().domain([Ae(T,function(u){return u.startTime}),Fe(T,function(u){return u.endTime})]).rangeRound([0,et-a.leftPadding-a.rightPadding]);function S(u,x){const v=u.startTime,k=x.startTime;let f=0;return v>k?f=1:ve.vert===_.vert?0:e.vert?1:-1);const g=[...new Set(u.map(e=>e.order))].map(e=>u.find(_=>_.order===e));N.append("g").selectAll("rect").data(g).enter().append("rect").attr("x",0).attr("y",function(e,_){return _=e.order,_*x+v-2}).attr("width",function(){return l-a.rightPadding/2}).attr("height",x).attr("class",function(e){for(const[_,V]of L.entries())if(e.type===V)return"section section"+_%a.numberSectionStyles;return"section section0"}).enter();const w=N.append("g").selectAll("rect").data(u).enter(),r=s.db.getLinks();if(w.append("rect").attr("id",function(e){return e.id}).attr("rx",3).attr("ry",3).attr("x",function(e){return e.milestone?I(e.startTime)+k+.5*(I(e.endTime)-I(e.startTime))-.5*f:I(e.startTime)+k}).attr("y",function(e,_){return _=e.order,e.vert?a.gridLineStartPadding:_*x+v}).attr("width",function(e){return e.milestone?f:e.vert?.08*f:I(e.renderEndTime||e.endTime)-I(e.startTime)}).attr("height",function(e){return e.vert?T.length*(a.barHeight+a.barGap)+a.barHeight*2:f}).attr("transform-origin",function(e,_){return _=e.order,(I(e.startTime)+k+.5*(I(e.endTime)-I(e.startTime))).toString()+"px "+(_*x+v+.5*f).toString()+"px"}).attr("class",function(e){const _="task";let V="";e.classes.length>0&&(V=e.classes.join(" "));let P=0;for(const[j,$]of L.entries())e.type===$&&(P=j%a.numberSectionStyles);let W="";return e.active?e.crit?W+=" activeCrit":W=" active":e.done?e.crit?W=" doneCrit":W=" done":e.crit&&(W+=" crit"),W.length===0&&(W=" task"),e.milestone&&(W=" milestone "+W),e.vert&&(W=" vert "+W),W+=P,W+=" "+V,_+W}),w.append("text").attr("id",function(e){return e.id+"-text"}).text(function(e){return e.task}).attr("font-size",a.fontSize).attr("x",function(e){let _=I(e.startTime),V=I(e.renderEndTime||e.endTime);if(e.milestone&&(_+=.5*(I(e.endTime)-I(e.startTime))-.5*f,V=_+f),e.vert)return I(e.startTime)+k;const P=this.getBBox().width;return P>V-_?V+P+1.5*a.leftPadding>l?_+k-5:V+k+5:(V-_)/2+_+k}).attr("y",function(e,_){return e.vert?a.gridLineStartPadding+T.length*(a.barHeight+a.barGap)+60:(_=e.order,_*x+a.barHeight/2+(a.fontSize/2-2)+v)}).attr("text-height",f).attr("class",function(e){const _=I(e.startTime);let V=I(e.endTime);e.milestone&&(V=_+f);const P=this.getBBox().width;let W="";e.classes.length>0&&(W=e.classes.join(" "));let j=0;for(const[Q,rt]of L.entries())e.type===rt&&(j=Q%a.numberSectionStyles);let $="";return e.active&&(e.crit?$="activeCritText"+j:$="activeText"+j),e.done?e.crit?$=$+" doneCritText"+j:$=$+" doneText"+j:e.crit&&($=$+" critText"+j),e.milestone&&($+=" milestoneText"),e.vert&&($+=" vertText"),P>V-_?V+P+1.5*a.leftPadding>l?W+" taskTextOutsideLeft taskTextOutside"+j+" "+$:W+" taskTextOutsideRight taskTextOutside"+j+" "+$+" width-"+P:W+" taskText taskText"+j+" "+$+" width-"+P}),lt().securityLevel==="sandbox"){let e;e=pt("#i"+i);const _=e.nodes()[0].contentDocument;w.filter(function(V){return r.has(V.id)}).each(function(V){var P=_.querySelector("#"+V.id),W=_.querySelector("#"+V.id+"-text");const j=P.parentNode;var $=_.createElement("a");$.setAttribute("xlink:href",r.get(V.id)),$.setAttribute("target","_top"),j.appendChild($),$.appendChild(P),$.appendChild(W)})}}c(O,"drawRects");function Y(u,x,v,k,f,o,l,y){if(l.length===0&&y.length===0)return;let g,w;for(const{startTime:P,endTime:W}of o)(g===void 0||Pw)&&(w=W);if(!g||!w)return;if(G(w).diff(G(g),"year")>5){nt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const r=s.db.getDateFormat(),z=[];let e=null,_=G(g);for(;_.valueOf()<=w;)s.db.isInvalidDate(_,r,l,y)?e?e.end=_:e={start:_,end:_}:e&&(z.push(e),e=null),_=_.add(1,"d");N.append("g").selectAll("rect").data(z).enter().append("rect").attr("id",P=>"exclude-"+P.start.format("YYYY-MM-DD")).attr("x",P=>I(P.start.startOf("day"))+v).attr("y",a.gridLineStartPadding).attr("width",P=>I(P.end.endOf("day"))-I(P.start.startOf("day"))).attr("height",f-x-a.gridLineStartPadding).attr("transform-origin",function(P,W){return(I(P.start)+v+.5*(I(P.end)-I(P.start))).toString()+"px "+(W*u+.5*f).toString()+"px"}).attr("class","exclude-range")}c(Y,"drawExcludeDays");function R(u,x,v,k){if(v<=0||u>x)return 1/0;const f=x-u,o=G.duration({[k??"day"]:v}).asMilliseconds();return o<=0?1/0:Math.ceil(f/o)}c(R,"getEstimatedTickCount");function H(u,x,v,k){const f=s.db.getDateFormat(),o=s.db.getAxisFormat();let l;o?l=o:f==="D"?l="%d":l=a.axisFormat??"%Y-%m-%d";let y=Ue(I).tickSize(-k+x+a.gridLineStartPadding).tickFormat(Ut(l));const w=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(s.db.getTickInterval()||a.tickInterval);if(w!==null){const r=parseInt(w[1],10);if(isNaN(r)||r<=0)nt.warn(`Invalid tick interval value: "${w[1]}". Skipping custom tick interval.`);else{const z=w[2],e=s.db.getWeekday()||a.weekday,_=I.domain(),V=_[0],P=_[1],W=R(V,P,r,z);if(W>Ft)nt.warn(`The tick interval "${r}${z}" would generate ${W} ticks, which exceeds the maximum allowed (${Ft}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(z){case"millisecond":y.ticks(ee.every(r));break;case"second":y.ticks(te.every(r));break;case"minute":y.ticks(Jt.every(r));break;case"hour":y.ticks(Kt.every(r));break;case"day":y.ticks(Qt.every(r));break;case"week":y.ticks(le[e].every(r));break;case"month":y.ticks(Zt.every(r));break}}}if(N.append("g").attr("class","grid").attr("transform","translate("+u+", "+(k-50)+")").call(y).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),s.db.topAxisEnabled()||a.topAxis){let r=Xe(I).tickSize(-k+x+a.gridLineStartPadding).tickFormat(Ut(l));if(w!==null){const z=parseInt(w[1],10);if(isNaN(z)||z<=0)nt.warn(`Invalid tick interval value: "${w[1]}". Skipping custom tick interval.`);else{const e=w[2],_=s.db.getWeekday()||a.weekday,V=I.domain(),P=V[0],W=V[1];if(R(P,W,z,e)<=Ft)switch(e){case"millisecond":r.ticks(ee.every(z));break;case"second":r.ticks(te.every(z));break;case"minute":r.ticks(Jt.every(z));break;case"hour":r.ticks(Kt.every(z));break;case"day":r.ticks(Qt.every(z));break;case"week":r.ticks(le[_].every(z));break;case"month":r.ticks(Zt.every(z));break}}}N.append("g").attr("class","grid").attr("transform","translate("+u+", "+x+")").call(r).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}c(H,"makeGrid");function A(u,x){let v=0;const k=Object.keys(M).map(f=>[f,M[f]]);N.append("g").selectAll("text").data(k).enter().append(function(f){const o=f[0].split(Se.lineBreakRegex),l=-(o.length-1)/2,y=E.createElementNS("http://www.w3.org/2000/svg","text");y.setAttribute("dy",l+"em");for(const[g,w]of o.entries()){const r=E.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttribute("alignment-baseline","central"),r.setAttribute("x","10"),g>0&&r.setAttribute("dy","1em"),r.textContent=w,y.appendChild(r)}return y}).attr("x",10).attr("y",function(f,o){if(o>0)for(let l=0;l` - .mermaid-main-font { - font-family: ${t.fontFamily}; - } - - .exclude-range { - fill: ${t.excludeBkgColor}; - } - - .section { - stroke: none; - opacity: 0.2; - } - - .section0 { - fill: ${t.sectionBkgColor}; - } - - .section2 { - fill: ${t.sectionBkgColor2}; - } - - .section1, - .section3 { - fill: ${t.altSectionBkgColor}; - opacity: 0.2; - } - - .sectionTitle0 { - fill: ${t.titleColor}; - } - - .sectionTitle1 { - fill: ${t.titleColor}; - } - - .sectionTitle2 { - fill: ${t.titleColor}; - } - - .sectionTitle3 { - fill: ${t.titleColor}; - } - - .sectionTitle { - text-anchor: start; - font-family: ${t.fontFamily}; - } - - - /* Grid and axis */ - - .grid .tick { - stroke: ${t.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - } - - .grid .tick text { - font-family: ${t.fontFamily}; - fill: ${t.textColor}; - } - - .grid path { - stroke-width: 0; - } - - - /* Today line */ - - .today { - fill: none; - stroke: ${t.todayLineColor}; - stroke-width: 2px; - } - - - /* Task styling */ - - /* Default task */ - - .task { - stroke-width: 2; - } - - .taskText { - text-anchor: middle; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideRight { - fill: ${t.taskTextDarkColor}; - text-anchor: start; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideLeft { - fill: ${t.taskTextDarkColor}; - text-anchor: end; - } - - - /* Special case clickable */ - - .task.clickable { - cursor: pointer; - } - - .taskText.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - - /* Specific task settings for the sections*/ - - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${t.taskTextColor}; - } - - .task0, - .task1, - .task2, - .task3 { - fill: ${t.taskBkgColor}; - stroke: ${t.taskBorderColor}; - } - - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${t.taskTextOutsideColor}; - } - - .taskTextOutside1, - .taskTextOutside3 { - fill: ${t.taskTextOutsideColor}; - } - - - /* Active task */ - - .active0, - .active1, - .active2, - .active3 { - fill: ${t.activeTaskBkgColor}; - stroke: ${t.activeTaskBorderColor}; - } - - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${t.taskTextDarkColor} !important; - } - - - /* Completed task */ - - .done0, - .done1, - .done2, - .done3 { - stroke: ${t.doneTaskBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - } - - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${t.taskTextDarkColor} !important; - } - - - /* Tasks on the critical line */ - - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${t.critBorderColor}; - fill: ${t.critBkgColor}; - stroke-width: 2; - } - - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.activeTaskBkgColor}; - stroke-width: 2; - } - - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; - } - - .milestone { - transform: rotate(45deg) scale(0.8,0.8); - } - - .milestoneText { - font-style: italic; - } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - .vert { - stroke: ${t.vertLineColor}; - } - - .vertText { - font-size: 15px; - text-anchor: middle; - fill: ${t.vertLineColor} !important; - } - - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.titleColor||t.textColor}; - font-family: ${t.fontFamily}; - } -`,"getStyles"),ti=Jr,di={parser:fr,db:Xr,renderer:Kr,styles:ti};export{di as diagram}; diff --git a/assets/geometry.fragment-CQxE8frp.js b/assets/geometry.fragment-CQxE8frp.js deleted file mode 100644 index 42182dd15a301908c09d1cbe486bf697a098f97c..0000000000000000000000000000000000000000 --- a/assets/geometry.fragment-CQxE8frp.js +++ /dev/null @@ -1,171 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./bumpFragment-DEyymZuF.js";import"./helperFunctions-Wgh3PIP0.js";import"./index-DydPgVMC.js";import"./samplerFragmentDeclaration-Bn5G_87U.js";const e="geometryPixelShader",f=`#ifdef BUMP -varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;varying vNormalW: vec3f; -#else -varying vNormalV: vec3f; -#endif -varying vViewPos: vec4f; -#if defined(POSITION) || defined(BUMP) -varying vPositionW: vec3f; -#endif -#if defined(VELOCITY) || defined(VELOCITY_LINEAR) -varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f; -#endif -#ifdef NEED_UV -varying vUV: vec2f; -#endif -#ifdef BUMP -uniform vBumpInfos: vec3f;uniform vTangentSpaceParams: vec2f; -#endif -#if defined(REFLECTIVITY) -#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE) -var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d;varying vReflectivityUV: vec2f; -#else -#ifdef METALLIC_TEXTURE -var metallicSamplerSampler: sampler;var metallicSampler: texture_2d;varying vMetallicUV: vec2f; -#endif -#ifdef ROUGHNESS_TEXTURE -var roughnessSamplerSampler: sampler;var roughnessSampler: texture_2d;varying vRoughnessUV: vec2f; -#endif -#endif -#ifdef ALBEDOTEXTURE -varying vAlbedoUV: vec2f;var albedoSamplerSampler: sampler;var albedoSampler: texture_2d; -#endif -#ifdef REFLECTIVITYCOLOR -uniform reflectivityColor: vec3f; -#endif -#ifdef ALBEDOCOLOR -uniform albedoColor: vec3f; -#endif -#ifdef METALLIC -uniform metallic: f32; -#endif -#if defined(ROUGHNESS) || defined(GLOSSINESS) -uniform glossiness: f32; -#endif -#endif -#if defined(ALPHATEST) && defined(NEED_UV) -var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d; -#endif -#include -#include -#include -#include -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#include -#ifdef ALPHATEST -if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;} -#endif -var normalOutput: vec3f; -#ifdef BUMP -var normalW: vec3f=normalize(input.vNormalW); -#include -#ifdef NORMAL_WORLDSPACE -normalOutput=normalW; -#else -normalOutput=normalize( (mat4x4f(input.vWorldView0,input.vWorldView1,input.vWorldView2,input.vWorldView3)* vec4f(normalW,0.0)).xyz); -#endif -#elif defined(HAS_NORMAL_ATTRIBUTE) -normalOutput=normalize(input.vNormalV); -#elif defined(POSITION) -normalOutput=normalize(-cross(dpdx(input.vPositionW),dpdy(input.vPositionW))); -#endif -#ifdef ENCODE_NORMAL -normalOutput=normalOutput*0.5+0.5; -#endif -var fragData: array,SCENE_MRT_COUNT>; -#ifdef DEPTH -fragData[DEPTH_INDEX]=vec4f(input.vViewPos.z/input.vViewPos.w,0.0,0.0,1.0); -#endif -#ifdef NORMAL -fragData[NORMAL_INDEX]=vec4f(normalOutput,1.0); -#endif -#ifdef SCREENSPACE_DEPTH -fragData[SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,1.0); -#endif -#ifdef POSITION -fragData[POSITION_INDEX]= vec4f(input.vPositionW,1.0); -#endif -#ifdef VELOCITY -var a: vec2f=(input.vCurrentPosition.xy/input.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(input.vPreviousPosition.xy/input.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[VELOCITY_INDEX]= vec4f(velocity,0.0,1.0); -#endif -#ifdef VELOCITY_LINEAR -var velocity : vec2f=vec2f(0.5)*((input.vPreviousPosition.xy / -input.vPreviousPosition.w) - -(input.vCurrentPosition.xy / -input.vCurrentPosition.w));fragData[VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,1.0); -#endif -#ifdef REFLECTIVITY -var reflectivity: vec4f= vec4f(0.0,0.0,0.0,1.0); -#ifdef METALLICWORKFLOW -var metal: f32=1.0;var roughness: f32=1.0; -#ifdef ORMTEXTURE -metal*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).b;roughness*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).g; -#else -#ifdef METALLIC_TEXTURE -metal*=textureSample(metallicSampler,metallicSamplerSampler,input.vMetallicUV).r; -#endif -#ifdef ROUGHNESS_TEXTURE -roughness*=textureSample(roughnessSampler,roughnessSamplerSampler,input.vRoughnessUV).r; -#endif -#endif -#ifdef METALLIC -metal*=uniforms.metallic; -#endif -#ifdef ROUGHNESS -roughness*=(1.0-uniforms.glossiness); -#endif -reflectivity=vec4f(reflectivity.rgb,reflectivity.a-roughness);var color: vec3f= vec3f(1.0); -#ifdef ALBEDOTEXTURE -color=textureSample(albedoSampler,albedoSamplerSampler,input.vAlbedoUV).rgb; -#ifdef GAMMAALBEDO -color=toLinearSpaceVec4(color); -#endif -#endif -#ifdef ALBEDOCOLOR -color*=uniforms.albedoColor.xyz; -#endif -reflectivity=vec4f(mix( vec3f(0.04),color,metal),reflectivity.a); -#else -#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE) -reflectivity=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV); -#ifdef GAMMAREFLECTIVITYTEXTURE -reflectivity=vec4f(toLinearSpaceVec3(reflectivity.rgb),reflectivity.a); -#endif -#else -#ifdef REFLECTIVITYCOLOR -reflectivity=vec4f(toLinearSpaceVec3(uniforms.reflectivityColor.xyz),1.0); -#endif -#endif -#ifdef GLOSSINESSS -reflectivity=vec4f(reflectivity.rgb,reflectivity.a*glossiness); -#endif -#endif -fragData[REFLECTIVITY_INDEX]=reflectivity; -#endif -#if SCENE_MRT_COUNT>0 -fragmentOutputs.fragData0=fragData[0]; -#endif -#if SCENE_MRT_COUNT>1 -fragmentOutputs.fragData1=fragData[1]; -#endif -#if SCENE_MRT_COUNT>2 -fragmentOutputs.fragData2=fragData[2]; -#endif -#if SCENE_MRT_COUNT>3 -fragmentOutputs.fragData3=fragData[3]; -#endif -#if SCENE_MRT_COUNT>4 -fragmentOutputs.fragData4=fragData[4]; -#endif -#if SCENE_MRT_COUNT>5 -fragmentOutputs.fragData5=fragData[5]; -#endif -#if SCENE_MRT_COUNT>6 -fragmentOutputs.fragData6=fragData[6]; -#endif -#if SCENE_MRT_COUNT>7 -fragmentOutputs.fragData7=fragData[7]; -#endif -} -`;i.ShadersStoreWGSL[e]||(i.ShadersStoreWGSL[e]=f);const d={name:e,shader:f};export{d as geometryPixelShaderWGSL}; diff --git a/assets/geometry.vertex-DGCzhZYO.js b/assets/geometry.vertex-DGCzhZYO.js deleted file mode 100644 index ca9fd8faf52fa2f39a886372af978f83e063b162..0000000000000000000000000000000000000000 --- a/assets/geometry.vertex-DGCzhZYO.js +++ /dev/null @@ -1,169 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./instancesDeclaration-ConO0l1b.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./bumpVertex-DVPnlCbV.js";import"./index-DydPgVMC.js";const e="geometryVertexShader",t=`#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -attribute position: vec3f; -#ifdef HAS_NORMAL_ATTRIBUTE -attribute normal: vec3f; -#endif -#ifdef NEED_UV -varying vUV: vec2f; -#ifdef ALPHATEST -uniform diffuseMatrix: mat4x4f; -#endif -#ifdef BUMP -uniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f; -#endif -#ifdef REFLECTIVITY -uniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f; -#endif -#ifdef METALLIC_TEXTURE -varying vMetallicUV: vec2f;uniform metallicMatrix: mat4x4f; -#endif -#ifdef ROUGHNESS_TEXTURE -varying vRoughnessUV: vec2f;uniform roughnessMatrix: mat4x4f; -#endif -#ifdef UV1 -attribute uv: vec2f; -#endif -#ifdef UV2 -attribute uv2: vec2f; -#endif -#endif -#ifdef BUMP -varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f; -#endif -#ifdef BUMP -varying vNormalW: vec3f; -#else -varying vNormalV: vec3f; -#endif -varying vViewPos: vec4f; -#if defined(POSITION) || defined(BUMP) -varying vPositionW: vec3f; -#endif -#if defined(VELOCITY) || defined(VELOCITY_LINEAR) -uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f; -#endif -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position; -#ifdef HAS_NORMAL_ATTRIBUTE -var normalUpdated: vec3f=input.normal; -#else -var normalUpdated: vec3f=vec3f(0.0,0.0,0.0); -#endif -#ifdef UV1 -var uvUpdated: vec2f=input.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=input.uv2; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0); -#endif -#include -#include -var worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0)); -#ifdef BUMP -let vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated); -#else -#ifdef NORMAL_WORLDSPACE -vertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz); -#else -vertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz); -#endif -#endif -vertexOutputs.vViewPos=scene.view*worldPos; -#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED) -vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0); -#if NUM_BONE_INFLUENCERS>0 -var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3]; -#endif -vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0); -#else -vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0); -#endif -#endif -#if defined(POSITION) || defined(BUMP) -vertexOutputs.vPositionW=worldPos.xyz/worldPos.w; -#endif -vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0); -#include -#ifdef NEED_UV -#ifdef UV1 -#if defined(ALPHATEST) && defined(ALPHATEST_UV1) -vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#else -vertexOutputs.vUV=uvUpdated; -#endif -#ifdef BUMP_UV1 -vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#ifdef REFLECTIVITY_UV1 -vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#else -#ifdef METALLIC_UV1 -vertexOutputs.vMetallicUV=(uniforms.metallicMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#ifdef ROUGHNESS_UV1 -vertexOutputs.vRoughnessUV=(uniforms.roughnessMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#endif -#ifdef ALBEDO_UV1 -vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#endif -#ifdef UV2 -#if defined(ALPHATEST) && defined(ALPHATEST_UV2) -vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#else -vertexOutputs.vUV=uv2Updated; -#endif -#ifdef BUMP_UV2 -vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#ifdef REFLECTIVITY_UV2 -vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#else -#ifdef METALLIC_UV2 -vertexOutputs.vMetallicUV=(uniforms.metallicMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#ifdef ROUGHNESS_UV2 -vertexOutputs.vRoughnessUV=(uniforms.roughnessMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#endif -#ifdef ALBEDO_UV2 -vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#endif -#endif -#include -} -`;i.ShadersStoreWGSL[e]||(i.ShadersStoreWGSL[e]=t);const m={name:e,shader:t};export{m as geometryVertexShaderWGSL}; diff --git a/assets/geometryBufferRenderer-DviLW_b_.js b/assets/geometryBufferRenderer-DviLW_b_.js deleted file mode 100644 index 374c0664000a3c730f1266eb548e31499a79bbc1..0000000000000000000000000000000000000000 --- a/assets/geometryBufferRenderer-DviLW_b_.js +++ /dev/null @@ -1,325 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometry.vertex-DGCzhZYO.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./bonesDeclaration-DUXz5WB4.js","./instancesVertex-BZz8JvZy.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./instancesDeclaration-ConO0l1b.js","./sceneUboDeclaration-mnAEeY6M.js","./clipPlaneVertex-D5g8dBQb.js","./morphTargetsVertex-W8O8GW2p.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./bumpVertex-DVPnlCbV.js","./geometry.fragment-CQxE8frp.js","./clipPlaneFragment-BmMK1U8A.js","./bumpFragment-DEyymZuF.js","./samplerFragmentDeclaration-Bn5G_87U.js","./helperFunctions-Wgh3PIP0.js"])))=>i.map(i=>d[i]); -import{af as O}from"./index-DydPgVMC.js";import{S as E,b9 as D,J as p,a7 as F,b3 as z,b2 as G,b4 as j,bz as $,T as W,M as K,b5 as q,a2 as J,a5 as Q,o as N,Y as Z,be as ee}from"./index-GY9JDBGV.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./bumpFragment-Dn7_UB6Q.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./bumpVertex-dKv8gF7O.js";const B="mrtFragmentDeclaration",te=`#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -layout(location=0) out vec4 glFragData[{X}]; -#endif -`;E.IncludesShadersStore[B]||(E.IncludesShadersStore[B]=te);const A="geometryPixelShader",w=`#extension GL_EXT_draw_buffers : require -#if defined(BUMP) || !defined(NORMAL) -#extension GL_OES_standard_derivatives : enable -#endif -precision highp float; -#ifdef BUMP -varying mat4 vWorldView;varying vec3 vNormalW; -#else -varying vec3 vNormalV; -#endif -varying vec4 vViewPos; -#if defined(POSITION) || defined(BUMP) -varying vec3 vPositionW; -#endif -#if defined(VELOCITY) || defined(VELOCITY_LINEAR) -varying vec4 vCurrentPosition;varying vec4 vPreviousPosition; -#endif -#ifdef NEED_UV -varying vec2 vUV; -#endif -#ifdef BUMP -uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams; -#endif -#if defined(REFLECTIVITY) -#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE) -uniform sampler2D reflectivitySampler;varying vec2 vReflectivityUV; -#else -#ifdef METALLIC_TEXTURE -uniform sampler2D metallicSampler;varying vec2 vMetallicUV; -#endif -#ifdef ROUGHNESS_TEXTURE -uniform sampler2D roughnessSampler;varying vec2 vRoughnessUV; -#endif -#endif -#ifdef ALBEDOTEXTURE -varying vec2 vAlbedoUV;uniform sampler2D albedoSampler; -#endif -#ifdef REFLECTIVITYCOLOR -uniform vec3 reflectivityColor; -#endif -#ifdef ALBEDOCOLOR -uniform vec3 albedoColor; -#endif -#ifdef METALLIC -uniform float metallic; -#endif -#if defined(ROUGHNESS) || defined(GLOSSINESS) -uniform float glossiness; -#endif -#endif -#if defined(ALPHATEST) && defined(NEED_UV) -uniform sampler2D diffuseSampler; -#endif -#include -#include[SCENE_MRT_COUNT] -#include -#include -#include -void main() { -#include -#ifdef ALPHATEST -if (texture2D(diffuseSampler,vUV).a<0.4) -discard; -#endif -vec3 normalOutput; -#ifdef BUMP -vec3 normalW=normalize(vNormalW); -#include -#ifdef NORMAL_WORLDSPACE -normalOutput=normalW; -#else -normalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0))); -#endif -#elif defined(HAS_NORMAL_ATTRIBUTE) -normalOutput=normalize(vNormalV); -#elif defined(POSITION) -normalOutput=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW))); -#endif -#ifdef ENCODE_NORMAL -normalOutput=normalOutput*0.5+0.5; -#endif -#ifdef DEPTH -gl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0); -#endif -#ifdef NORMAL -gl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0); -#endif -#ifdef SCREENSPACE_DEPTH -gl_FragData[SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,1.0); -#endif -#ifdef POSITION -gl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0); -#endif -#ifdef VELOCITY -vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0); -#endif -#ifdef VELOCITY_LINEAR -vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w) - -(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,1.0); -#endif -#ifdef REFLECTIVITY -vec4 reflectivity=vec4(0.0,0.0,0.0,1.0); -#ifdef METALLICWORKFLOW -float metal=1.0;float roughness=1.0; -#ifdef ORMTEXTURE -metal*=texture2D(reflectivitySampler,vReflectivityUV).b;roughness*=texture2D(reflectivitySampler,vReflectivityUV).g; -#else -#ifdef METALLIC_TEXTURE -metal*=texture2D(metallicSampler,vMetallicUV).r; -#endif -#ifdef ROUGHNESS_TEXTURE -roughness*=texture2D(roughnessSampler,vRoughnessUV).r; -#endif -#endif -#ifdef METALLIC -metal*=metallic; -#endif -#ifdef ROUGHNESS -roughness*=(1.0-glossiness); -#endif -reflectivity.a-=roughness;vec3 color=vec3(1.0); -#ifdef ALBEDOTEXTURE -color=texture2D(albedoSampler,vAlbedoUV).rgb; -#ifdef GAMMAALBEDO -color=toLinearSpace(color); -#endif -#endif -#ifdef ALBEDOCOLOR -color*=albedoColor.xyz; -#endif -reflectivity.rgb=mix(vec3(0.04),color,metal); -#else -#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE) -reflectivity=texture2D(reflectivitySampler,vReflectivityUV); -#ifdef GAMMAREFLECTIVITYTEXTURE -reflectivity.rgb=toLinearSpace(reflectivity.rgb); -#endif -#else -#ifdef REFLECTIVITYCOLOR -reflectivity.rgb=toLinearSpace(reflectivityColor.xyz);reflectivity.a=1.0; -#endif -#endif -#ifdef GLOSSINESSS -reflectivity.a*=glossiness; -#endif -#endif -gl_FragData[REFLECTIVITY_INDEX]=reflectivity; -#endif -} -`;E.ShadersStore[A]||(E.ShadersStore[A]=w);const ie={name:A,shader:w},se=Object.freeze(Object.defineProperty({__proto__:null,geometryPixelShader:ie},Symbol.toStringTag,{value:"Module"})),Y="geometryVertexDeclaration",re="uniform mat4 viewProjection;uniform mat4 view;";E.IncludesShadersStore[Y]||(E.IncludesShadersStore[Y]=re);const X="geometryUboDeclaration",ne=`#include -`;E.IncludesShadersStore[X]||(E.IncludesShadersStore[X]=ne);const y="geometryVertexShader",H=`precision highp float; -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include<__decl__geometryVertex> -#include -attribute vec3 position; -#ifdef HAS_NORMAL_ATTRIBUTE -attribute vec3 normal; -#endif -#ifdef NEED_UV -varying vec2 vUV; -#ifdef ALPHATEST -uniform mat4 diffuseMatrix; -#endif -#ifdef BUMP -uniform mat4 bumpMatrix;varying vec2 vBumpUV; -#endif -#ifdef REFLECTIVITY -uniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV; -#endif -#ifdef METALLIC_TEXTURE -varying vec2 vMetallicUV;uniform mat4 metallicMatrix; -#endif -#ifdef ROUGHNESS_TEXTURE -varying vec2 vRoughnessUV;uniform mat4 roughnessMatrix; -#endif -#ifdef UV1 -attribute vec2 uv; -#endif -#ifdef UV2 -attribute vec2 uv2; -#endif -#endif -#ifdef BUMP -varying mat4 vWorldView; -#endif -#ifdef BUMP -varying vec3 vNormalW; -#else -varying vec3 vNormalV; -#endif -varying vec4 vViewPos; -#if defined(POSITION) || defined(BUMP) -varying vec3 vPositionW; -#endif -#if defined(VELOCITY) || defined(VELOCITY_LINEAR) -uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition; -#endif -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) -{vec3 positionUpdated=position; -#ifdef HAS_NORMAL_ATTRIBUTE -vec3 normalUpdated=normal; -#else -vec3 normalUpdated=vec3(0.0,0.0,0.0); -#endif -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#include -#include -vec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0)); -#ifdef BUMP -vWorldView=view*finalWorld;mat3 normalWorld=mat3(finalWorld);vNormalW=normalize(normalWorld*normalUpdated); -#else -#ifdef NORMAL_WORLDSPACE -vNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0))); -#else -vNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0))); -#endif -#endif -vViewPos=view*worldPos; -#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0); -#if NUM_BONE_INFLUENCERS>0 -mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3]; -#endif -vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0); -#else -vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#endif -#if defined(POSITION) || defined(BUMP) -vPositionW=worldPos.xyz/worldPos.w; -#endif -gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0); -#include -#ifdef NEED_UV -#ifdef UV1 -#if defined(ALPHATEST) && defined(ALPHATEST_UV1) -vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0)); -#else -vUV=uvUpdated; -#endif -#ifdef BUMP_UV1 -vBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#ifdef REFLECTIVITY_UV1 -vReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0)); -#else -#ifdef METALLIC_UV1 -vMetallicUV=vec2(metallicMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#ifdef ROUGHNESS_UV1 -vRoughnessUV=vec2(roughnessMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#endif -#ifdef ALBEDO_UV1 -vAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#endif -#ifdef UV2 -#if defined(ALPHATEST) && defined(ALPHATEST_UV2) -vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0)); -#else -vUV=uv2Updated; -#endif -#ifdef BUMP_UV2 -vBumpUV=vec2(bumpMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#ifdef REFLECTIVITY_UV2 -vReflectivityUV=vec2(reflectivityMatrix*vec4(uv2Updated,1.0,0.0)); -#else -#ifdef METALLIC_UV2 -vMetallicUV=vec2(metallicMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#ifdef ROUGHNESS_UV2 -vRoughnessUV=vec2(roughnessMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#endif -#ifdef ALBEDO_UV2 -vAlbedoUV=vec2(albedoMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#endif -#endif -#include -} -`;E.ShadersStore[y]||(E.ShadersStore[y]=H);const ae={name:y,shader:H},le=Object.freeze(Object.defineProperty({__proto__:null,geometryVertexShader:ae},Symbol.toStringTag,{value:"Module"})),k=["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","bumpMatrix","reflectivityMatrix","albedoMatrix","reflectivityColor","albedoColor","metallic","glossiness","vTangentSpaceParams","vBumpInfos","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","boneTextureWidth"];Z(k);class l{get normalsAreUnsigned(){return this._normalsAreUnsigned}_linkPrePassRenderer(t){this._linkedWithPrePass=!0,this._prePassRenderer=t,this._multiRenderTarget&&(this._multiRenderTarget.onClearObservable.clear(),this._multiRenderTarget.onClearObservable.add(()=>{}))}_unlinkPrePassRenderer(){this._linkedWithPrePass=!1,this._createRenderTargets()}_resetLayout(){this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableReflectivity=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableScreenspaceDepth=!1,this._attachmentsFromPrePass=[]}_forceTextureType(t,u){t===l.POSITION_TEXTURE_TYPE?(this._positionIndex=u,this._enablePosition=!0):t===l.VELOCITY_TEXTURE_TYPE?(this._velocityIndex=u,this._enableVelocity=!0):t===l.VELOCITY_LINEAR_TEXTURE_TYPE?(this._velocityLinearIndex=u,this._enableVelocityLinear=!0):t===l.REFLECTIVITY_TEXTURE_TYPE?(this._reflectivityIndex=u,this._enableReflectivity=!0):t===l.DEPTH_TEXTURE_TYPE?(this._depthIndex=u,this._enableDepth=!0):t===l.NORMAL_TEXTURE_TYPE?(this._normalIndex=u,this._enableNormal=!0):t===l.SCREENSPACE_DEPTH_TEXTURE_TYPE&&(this._screenspaceDepthIndex=u,this._enableScreenspaceDepth=!0)}_setAttachments(t){this._attachmentsFromPrePass=t}_linkInternalTexture(t){this._multiRenderTarget.setInternalTexture(t,0,!1)}get renderList(){return this._multiRenderTarget.renderList}set renderList(t){this._multiRenderTarget.renderList=t}get isSupported(){return this._multiRenderTarget.isSupported}getTextureIndex(t){switch(t){case l.POSITION_TEXTURE_TYPE:return this._positionIndex;case l.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;case l.VELOCITY_LINEAR_TEXTURE_TYPE:return this._velocityLinearIndex;case l.REFLECTIVITY_TEXTURE_TYPE:return this._reflectivityIndex;case l.DEPTH_TEXTURE_TYPE:return this._depthIndex;case l.NORMAL_TEXTURE_TYPE:return this._normalIndex;case l.SCREENSPACE_DEPTH_TEXTURE_TYPE:return this._screenspaceDepthIndex;default:return-1}}get enableDepth(){return this._enableDepth}set enableDepth(t){this._enableDepth=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableNormal(){return this._enableNormal}set enableNormal(t){this._enableNormal=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enablePosition(){return this._enablePosition}set enablePosition(t){this._enablePosition=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableVelocity(){return this._enableVelocity}set enableVelocity(t){this._enableVelocity=t,t||(this._previousTransformationMatrices={}),this._linkedWithPrePass||(this.dispose(),this._createRenderTargets()),this._scene.needsPreviousWorldMatrices=t}get enableVelocityLinear(){return this._enableVelocityLinear}set enableVelocityLinear(t){this._enableVelocityLinear=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableReflectivity(){return this._enableReflectivity}set enableReflectivity(t){this._enableReflectivity=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableScreenspaceDepth(){return this._enableScreenspaceDepth}set enableScreenspaceDepth(t){this._enableScreenspaceDepth=t,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get scene(){return this._scene}get ratio(){return typeof this._ratioOrDimensions=="object"?1:this._ratioOrDimensions}get shaderLanguage(){return this._shaderLanguage}constructor(t,u=1,i=15,e){this._previousTransformationMatrices={},this._previousBonesTransformationMatrices={},this.excludedSkinnedMeshesFromVelocity=[],this.renderTransparentMeshes=!0,this.generateNormalsInWorldSpace=!1,this._normalsAreUnsigned=!1,this._resizeObserver=null,this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableReflectivity=!1,this._enableScreenspaceDepth=!1,this._clearColor=new D(0,0,0,0),this._clearDepthColor=new D(0,0,0,1),this._positionIndex=-1,this._velocityIndex=-1,this._velocityLinearIndex=-1,this._reflectivityIndex=-1,this._depthIndex=-1,this._normalIndex=-1,this._screenspaceDepthIndex=-1,this._linkedWithPrePass=!1,this.useSpecificClearForDepthTexture=!1,this._shaderLanguage=0,this._shadersLoaded=!1,this._scene=t,this._ratioOrDimensions=u,this._useUbo=t.getEngine().supportsUniformBuffers,this._depthFormat=i,this._textureTypesAndFormats=e||{},this._initShaderSourceAsync(),l._SceneComponentInitialization(this._scene),this._createRenderTargets()}async _initShaderSourceAsync(){this._scene.getEngine().isWebGPU&&!l.ForceGLSL?(this._shaderLanguage=1,await Promise.all([O(()=>import("./geometry.vertex-DGCzhZYO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),O(()=>import("./geometry.fragment-CQxE8frp.js"),__vite__mapDeps([14,1,2,3,15,16,17,18]),import.meta.url)])):await Promise.all([O(()=>Promise.resolve().then(()=>le),void 0,import.meta.url),O(()=>Promise.resolve().then(()=>se),void 0,import.meta.url)]),this._shadersLoaded=!0}isReady(t,u){if(!this._shadersLoaded)return!1;const i=t.getMaterial();if(i&&i.disableDepthWrite)return!1;const e=[],h=[p.PositionKind],c=t.getMesh();c.isVerticesDataPresent(p.NormalKind)&&(e.push("#define HAS_NORMAL_ATTRIBUTE"),h.push(p.NormalKind));let g=!1,R=!1;const S=!1;if(i){let n=!1;if(i.needAlphaTestingForMesh(c)&&i.getAlphaTestTexture()&&(e.push("#define ALPHATEST"),e.push(`#define ALPHATEST_UV${i.getAlphaTestTexture().coordinatesIndex+1}`),n=!0),(i.bumpTexture||i.normalTexture||i.geometryNormalTexture)&&F.BumpTextureEnabled){const a=i.bumpTexture||i.normalTexture||i.geometryNormalTexture;e.push("#define BUMP"),e.push(`#define BUMP_UV${a.coordinatesIndex+1}`),n=!0}if(this._enableReflectivity){let a=!1;if(i.getClassName()==="PBRMetallicRoughnessMaterial")i.metallicRoughnessTexture&&(e.push("#define ORMTEXTURE"),e.push(`#define REFLECTIVITY_UV${i.metallicRoughnessTexture.coordinatesIndex+1}`),e.push("#define METALLICWORKFLOW"),n=!0,a=!0),i.metallic!=null&&(e.push("#define METALLIC"),e.push("#define METALLICWORKFLOW"),a=!0),i.roughness!=null&&(e.push("#define ROUGHNESS"),e.push("#define METALLICWORKFLOW"),a=!0),a&&(i.baseTexture&&(e.push("#define ALBEDOTEXTURE"),e.push(`#define ALBEDO_UV${i.baseTexture.coordinatesIndex+1}`),i.baseTexture.gammaSpace&&e.push("#define GAMMAALBEDO"),n=!0),i.baseColor&&e.push("#define ALBEDOCOLOR"));else if(i.getClassName()==="PBRSpecularGlossinessMaterial")i.specularGlossinessTexture?(e.push("#define SPECULARGLOSSINESSTEXTURE"),e.push(`#define REFLECTIVITY_UV${i.specularGlossinessTexture.coordinatesIndex+1}`),n=!0,i.specularGlossinessTexture.gammaSpace&&e.push("#define GAMMAREFLECTIVITYTEXTURE")):i.specularColor&&e.push("#define REFLECTIVITYCOLOR"),i.glossiness!=null&&e.push("#define GLOSSINESS");else if(i.getClassName()==="PBRMaterial")i.metallicTexture&&(e.push("#define ORMTEXTURE"),e.push(`#define REFLECTIVITY_UV${i.metallicTexture.coordinatesIndex+1}`),e.push("#define METALLICWORKFLOW"),n=!0,a=!0),i.metallic!=null&&(e.push("#define METALLIC"),e.push("#define METALLICWORKFLOW"),a=!0),i.roughness!=null&&(e.push("#define ROUGHNESS"),e.push("#define METALLICWORKFLOW"),a=!0),a?(i.albedoTexture&&(e.push("#define ALBEDOTEXTURE"),e.push(`#define ALBEDO_UV${i.albedoTexture.coordinatesIndex+1}`),i.albedoTexture.gammaSpace&&e.push("#define GAMMAALBEDO"),n=!0),i.albedoColor&&e.push("#define ALBEDOCOLOR")):(i.reflectivityTexture?(e.push("#define SPECULARGLOSSINESSTEXTURE"),e.push(`#define REFLECTIVITY_UV${i.reflectivityTexture.coordinatesIndex+1}`),i.reflectivityTexture.gammaSpace&&e.push("#define GAMMAREFLECTIVITYTEXTURE"),n=!0):i.reflectivityColor&&e.push("#define REFLECTIVITYCOLOR"),i.microSurface!=null&&e.push("#define GLOSSINESS"));else if(i.getClassName()==="StandardMaterial")i.specularTexture&&(e.push("#define REFLECTIVITYTEXTURE"),e.push(`#define REFLECTIVITY_UV${i.specularTexture.coordinatesIndex+1}`),i.specularTexture.gammaSpace&&e.push("#define GAMMAREFLECTIVITYTEXTURE"),n=!0),i.specularColor&&e.push("#define REFLECTIVITYCOLOR");else if(i.getClassName()==="OpenPBRMaterial"){const d=i;e.push("#define METALLICWORKFLOW"),a=!0,e.push("#define METALLIC"),e.push("#define ROUGHNESS"),d._useRoughnessFromMetallicTextureGreen&&d.baseMetalnessTexture?(e.push("#define ORMTEXTURE"),e.push(`#define REFLECTIVITY_UV${d.baseMetalnessTexture.coordinatesIndex+1}`),n=!0):d.baseMetalnessTexture?(e.push("#define METALLIC_TEXTURE"),e.push(`#define METALLIC_UV${d.baseMetalnessTexture.coordinatesIndex+1}`),n=!0):d.specularRoughnessTexture&&(e.push("#define ROUGHNESS_TEXTURE"),e.push(`#define ROUGHNESS_UV${d.specularRoughnessTexture.coordinatesIndex+1}`),n=!0),d.baseColorTexture&&(e.push("#define ALBEDOTEXTURE"),e.push(`#define ALBEDO_UV${d.baseColorTexture.coordinatesIndex+1}`),d.baseColorTexture.gammaSpace&&e.push("#define GAMMAALBEDO"),n=!0),d.baseColor&&e.push("#define ALBEDOCOLOR")}}n&&(e.push("#define NEED_UV"),c.isVerticesDataPresent(p.UVKind)&&(h.push(p.UVKind),e.push("#define UV1"),g=!0),c.isVerticesDataPresent(p.UV2Kind)&&(h.push(p.UV2Kind),e.push("#define UV2"),R=!0))}this._enableDepth&&(e.push("#define DEPTH"),e.push("#define DEPTH_INDEX "+this._depthIndex)),this._enableNormal&&(e.push("#define NORMAL"),e.push("#define NORMAL_INDEX "+this._normalIndex)),this._enablePosition&&(e.push("#define POSITION"),e.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(e.push("#define VELOCITY"),e.push("#define VELOCITY_INDEX "+this._velocityIndex),this.excludedSkinnedMeshesFromVelocity.indexOf(c)===-1&&e.push("#define BONES_VELOCITY_ENABLED")),this._enableVelocityLinear&&(e.push("#define VELOCITY_LINEAR"),e.push("#define VELOCITY_LINEAR_INDEX "+this._velocityLinearIndex),this.excludedSkinnedMeshesFromVelocity.indexOf(c)===-1&&e.push("#define BONES_VELOCITY_ENABLED")),this._enableReflectivity&&(e.push("#define REFLECTIVITY"),e.push("#define REFLECTIVITY_INDEX "+this._reflectivityIndex)),this._enableScreenspaceDepth&&this._screenspaceDepthIndex!==-1&&(e.push("#define SCREENSPACE_DEPTH_INDEX "+this._screenspaceDepthIndex),e.push("#define SCREENSPACE_DEPTH")),this.generateNormalsInWorldSpace&&e.push("#define NORMAL_WORLDSPACE"),this._normalsAreUnsigned&&e.push("#define ENCODE_NORMAL"),c.useBones&&c.computeBonesUsingShaders&&c.skeleton?(h.push(p.MatricesIndicesKind),h.push(p.MatricesWeightsKind),c.numBoneInfluencers>4&&(h.push(p.MatricesIndicesExtraKind),h.push(p.MatricesWeightsExtraKind)),e.push("#define NUM_BONE_INFLUENCERS "+c.numBoneInfluencers),e.push("#define BONETEXTURE "+c.skeleton.isUsingTextureForMatrices),e.push("#define BonesPerMesh "+(c.skeleton.bones.length+1))):(e.push("#define NUM_BONE_INFLUENCERS 0"),e.push("#define BONETEXTURE false"),e.push("#define BonesPerMesh 0"));const U=c.morphTargetManager?z(c.morphTargetManager,e,h,c,!0,!0,!1,g,R,S):0;u&&(e.push("#define INSTANCES"),G(h,this._enableVelocity||this._enableVelocityLinear),t.getRenderingMesh().hasThinInstances&&e.push("#define THIN_INSTANCES")),this._linkedWithPrePass?e.push("#define SCENE_MRT_COUNT "+this._attachmentsFromPrePass.length):e.push("#define SCENE_MRT_COUNT "+this._multiRenderTarget.textures.length),j(i,this._scene,e);const L=this._scene.getEngine(),M=t._getDrawWrapper(void 0,!0),C=M.defines,_=e.join(` -`);return C!==_&&M.setEffect(L.createEffect("geometry",{attributes:h,uniformsNames:k,samplers:["diffuseSampler","bumpSampler","reflectivitySampler","albedoSampler","morphTargets","boneSampler"],defines:_,onCompiled:null,fallbacks:null,onError:null,uniformBuffersNames:["Scene"],indexParameters:{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:U},shaderLanguage:this.shaderLanguage},L),_),M.effect.isReady()}getGBuffer(){return this._multiRenderTarget}get samples(){return this._multiRenderTarget.samples}set samples(t){this._multiRenderTarget.samples=t}dispose(){this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this.getGBuffer().dispose()}_assignRenderTargetIndices(){const t=[],u=[];let i=0;return this._enableDepth&&(this._depthIndex=i,i++,t.push("gBuffer_Depth"),u.push(this._textureTypesAndFormats[l.DEPTH_TEXTURE_TYPE])),this._enableNormal&&(this._normalIndex=i,i++,t.push("gBuffer_Normal"),u.push(this._textureTypesAndFormats[l.NORMAL_TEXTURE_TYPE])),this._enablePosition&&(this._positionIndex=i,i++,t.push("gBuffer_Position"),u.push(this._textureTypesAndFormats[l.POSITION_TEXTURE_TYPE])),this._enableVelocity&&(this._velocityIndex=i,i++,t.push("gBuffer_Velocity"),u.push(this._textureTypesAndFormats[l.VELOCITY_TEXTURE_TYPE])),this._enableVelocityLinear&&(this._velocityLinearIndex=i,i++,t.push("gBuffer_VelocityLinear"),u.push(this._textureTypesAndFormats[l.VELOCITY_LINEAR_TEXTURE_TYPE])),this._enableReflectivity&&(this._reflectivityIndex=i,i++,t.push("gBuffer_Reflectivity"),u.push(this._textureTypesAndFormats[l.REFLECTIVITY_TEXTURE_TYPE])),this._enableScreenspaceDepth&&(this._screenspaceDepthIndex=i,i++,t.push("gBuffer_ScreenspaceDepth"),u.push(this._textureTypesAndFormats[l.SCREENSPACE_DEPTH_TEXTURE_TYPE])),[i,t,u]}_createRenderTargets(){const t=this._scene.getEngine(),[u,i,e]=this._assignRenderTargetIndices();let h=0;t._caps.textureFloat&&t._caps.textureFloatLinearFiltering?h=1:t._caps.textureHalfFloat&&t._caps.textureHalfFloatLinearFiltering&&(h=2);const c=this._ratioOrDimensions.width!==void 0?this._ratioOrDimensions:{width:t.getRenderWidth()*this._ratioOrDimensions,height:t.getRenderHeight()*this._ratioOrDimensions},v=[],g=[];for(const n of e)n?(v.push(n.textureType),g.push(n.textureFormat)):(v.push(h),g.push(5));if(this._normalsAreUnsigned=v[l.NORMAL_TEXTURE_TYPE]===11||v[l.NORMAL_TEXTURE_TYPE]===13,this._multiRenderTarget=new $("gBuffer",c,u,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,types:v,formats:g,depthTextureFormat:this._depthFormat},i.concat("gBuffer_DepthBuffer")),!this.isSupported)return;this._multiRenderTarget.wrapU=W.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=W.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null;const R=[!0],S=[!1],U=[!0];for(let n=1;n{n.bindAttachments(this.useSpecificClearForDepthTexture?M:L),n.clear(this._clearColor,!0,!0,!0),this.useSpecificClearForDepthTexture&&(n.bindAttachments(C),n.clear(this._clearDepthColor,!0,!0,!0)),n.bindAttachments(L)}),this._resizeObserver=t.onResizeObservable.add(()=>{if(this._multiRenderTarget){const n=this._ratioOrDimensions.width!==void 0?this._ratioOrDimensions:{width:t.getRenderWidth()*this._ratioOrDimensions,height:t.getRenderHeight()*this._ratioOrDimensions};this._multiRenderTarget.resize(n)}});const _=n=>{const a=n.getRenderingMesh(),d=n.getEffectiveMesh(),T=this._scene,f=T.getEngine(),s=n.getMaterial();if(!s)return;if(d._internalAbstractMeshDataInfo._isActiveIntermediate=!1,(this._enableVelocity||this._enableVelocityLinear)&&!this._previousTransformationMatrices[d.uniqueId]&&(this._previousTransformationMatrices[d.uniqueId]={world:K.Identity(),viewProjection:T.getTransformMatrix()},a.skeleton)){const m=a.skeleton.getTransformMatrices(a);this._previousBonesTransformationMatrices[a.uniqueId]=this._copyBonesTransformationMatrices(m,new Float32Array(m.length))}const x=a._getInstancesRenderList(n._id,!!n.getReplacementMesh());if(x.mustReturn)return;const I=f.getCaps().instancedArrays&&(x.visibleInstances[n._id]!==null||a.hasThinInstances),b=d.getWorldMatrix();if(this.isReady(n,I)){const m=n._getDrawWrapper();if(!m)return;const r=m.effect;f.enableEffect(m),I||a._bind(n,r,s.fillMode),this._useUbo?(q(r,this._scene.getSceneUniformBuffer()),this._scene.finalizeSceneUbo()):(r.setMatrix("viewProjection",T.getTransformMatrix()),r.setMatrix("view",T.getViewMatrix()));let P;if(!a._instanceDataStorage.isFrozen&&(s.backFaceCulling||s.sideOrientation!==null)){const o=d._getWorldMatrixDeterminant();P=s._getEffectiveOrientation(a),o<0&&(P=P===N.ClockWiseSideOrientation?N.CounterClockWiseSideOrientation:N.ClockWiseSideOrientation)}else P=a._effectiveSideOrientation;if(s._preBind(m,P),s.needAlphaTestingForMesh(d)){const o=s.getAlphaTestTexture();o&&(r.setTexture("diffuseSampler",o),r.setMatrix("diffuseMatrix",o.getTextureMatrix()))}if((s.bumpTexture||s.normalTexture||s.geometryNormalTexture)&&T.getEngine().getCaps().standardDerivatives&&F.BumpTextureEnabled){const o=s.bumpTexture||s.normalTexture||s.geometryNormalTexture;r.setFloat3("vBumpInfos",o.coordinatesIndex,1/o.level,s.parallaxScaleBias),r.setMatrix("bumpMatrix",o.getTextureMatrix()),r.setTexture("bumpSampler",o),r.setFloat2("vTangentSpaceParams",s.invertNormalMapX?-1:1,s.invertNormalMapY?-1:1)}if(this._enableReflectivity){if(s.getClassName()==="PBRMetallicRoughnessMaterial")s.metallicRoughnessTexture!==null&&(r.setTexture("reflectivitySampler",s.metallicRoughnessTexture),r.setMatrix("reflectivityMatrix",s.metallicRoughnessTexture.getTextureMatrix())),s.metallic!==null&&r.setFloat("metallic",s.metallic),s.roughness!==null&&r.setFloat("glossiness",1-s.roughness),s.baseTexture!==null&&(r.setTexture("albedoSampler",s.baseTexture),r.setMatrix("albedoMatrix",s.baseTexture.getTextureMatrix())),s.baseColor!==null&&r.setColor3("albedoColor",s.baseColor);else if(s.getClassName()==="PBRSpecularGlossinessMaterial")s.specularGlossinessTexture!==null?(r.setTexture("reflectivitySampler",s.specularGlossinessTexture),r.setMatrix("reflectivityMatrix",s.specularGlossinessTexture.getTextureMatrix())):s.specularColor!==null&&r.setColor3("reflectivityColor",s.specularColor),s.glossiness!==null&&r.setFloat("glossiness",s.glossiness);else if(s.getClassName()==="PBRMaterial")s.metallicTexture!==null&&(r.setTexture("reflectivitySampler",s.metallicTexture),r.setMatrix("reflectivityMatrix",s.metallicTexture.getTextureMatrix())),s.metallic!==null&&r.setFloat("metallic",s.metallic),s.roughness!==null&&r.setFloat("glossiness",1-s.roughness),s.roughness!==null||s.metallic!==null||s.metallicTexture!==null?(s.albedoTexture!==null&&(r.setTexture("albedoSampler",s.albedoTexture),r.setMatrix("albedoMatrix",s.albedoTexture.getTextureMatrix())),s.albedoColor!==null&&r.setColor3("albedoColor",s.albedoColor)):(s.reflectivityTexture!==null?(r.setTexture("reflectivitySampler",s.reflectivityTexture),r.setMatrix("reflectivityMatrix",s.reflectivityTexture.getTextureMatrix())):s.reflectivityColor!==null&&r.setColor3("reflectivityColor",s.reflectivityColor),s.microSurface!==null&&r.setFloat("glossiness",s.microSurface));else if(s.getClassName()==="StandardMaterial")s.specularTexture!==null&&(r.setTexture("reflectivitySampler",s.specularTexture),r.setMatrix("reflectivityMatrix",s.specularTexture.getTextureMatrix())),s.specularColor!==null&&r.setColor3("reflectivityColor",s.specularColor);else if(s.getClassName()==="OpenPBRMaterial"){const o=s;o._useRoughnessFromMetallicTextureGreen&&o.baseMetalnessTexture?(r.setTexture("reflectivitySampler",o.baseMetalnessTexture),r.setMatrix("reflectivityMatrix",o.baseMetalnessTexture.getTextureMatrix())):o.baseMetalnessTexture?(r.setTexture("metallicSampler",o.baseMetalnessTexture),r.setMatrix("metallicMatrix",o.baseMetalnessTexture.getTextureMatrix())):o.specularRoughnessTexture&&(r.setTexture("roughnessSampler",o.specularRoughnessTexture),r.setMatrix("roughnessMatrix",o.specularRoughnessTexture.getTextureMatrix())),r.setFloat("metallic",o.baseMetalness),r.setFloat("glossiness",1-o.specularRoughness),o.baseColorTexture!==null&&(r.setTexture("albedoSampler",o.baseColorTexture),r.setMatrix("albedoMatrix",o.baseColorTexture.getTextureMatrix())),o.baseColor!==null&&r.setColor3("albedoColor",o.baseColor)}}if(J(r,s,this._scene),a.useBones&&a.computeBonesUsingShaders&&a.skeleton){const o=a.skeleton;if(o.isUsingTextureForMatrices&&r.getUniformIndex("boneTextureWidth")>-1){const V=o.getTransformMatrixTexture(a);r.setTexture("boneSampler",V),r.setFloat("boneTextureWidth",4*(o.bones.length+1))}else r.setMatrices("mBones",a.skeleton.getTransformMatrices(a));(this._enableVelocity||this._enableVelocityLinear)&&r.setMatrices("mPreviousBones",this._previousBonesTransformationMatrices[a.uniqueId])}Q(a,r),a.morphTargetManager&&a.morphTargetManager.isUsingTextureForTargets&&a.morphTargetManager._bind(r),(this._enableVelocity||this._enableVelocityLinear)&&(r.setMatrix("previousWorld",this._previousTransformationMatrices[d.uniqueId].world),r.setMatrix("previousViewProjection",this._previousTransformationMatrices[d.uniqueId].viewProjection)),I&&a.hasThinInstances&&r.setMatrix("world",b),a._processRendering(d,n,r,s.fillMode,x,I,(o,V)=>{o||r.setMatrix("world",V)})}(this._enableVelocity||this._enableVelocityLinear)&&(this._previousTransformationMatrices[d.uniqueId].world=b.clone(),this._previousTransformationMatrices[d.uniqueId].viewProjection=this._scene.getTransformMatrix().clone(),a.skeleton&&this._copyBonesTransformationMatrices(a.skeleton.getTransformMatrices(a),this._previousBonesTransformationMatrices[d.uniqueId]))};this._multiRenderTarget.customIsReadyFunction=(n,a,d)=>{if((d||a===0)&&n.subMeshes)for(let T=0;T{let f;if(this._linkedWithPrePass){if(!this._prePassRenderer.enabled)return;this._scene.getEngine().bindAttachments(this._attachmentsFromPrePass)}if(T.length){for(t.setColorWrite(!1),f=0;f{throw ee("GeometryBufferRendererSceneComponent")};export{l as G}; diff --git a/assets/geometryBufferRendererSceneComponent-DhSOci2A.js b/assets/geometryBufferRendererSceneComponent-DhSOci2A.js deleted file mode 100644 index 4ca213e4ddbbdea25d1e57caf70f4c38ada6dfd6..0000000000000000000000000000000000000000 --- a/assets/geometryBufferRendererSceneComponent-DhSOci2A.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t,b as n}from"./index-GY9JDBGV.js";import{G as o}from"./geometryBufferRenderer-DviLW_b_.js";import"./index-DydPgVMC.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./bumpFragment-Dn7_UB6Q.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./bumpVertex-dKv8gF7O.js";Object.defineProperty(n.prototype,"geometryBufferRenderer",{get:function(){return this._geometryBufferRenderer},set:function(e){e&&e.isSupported&&(this._geometryBufferRenderer=e)},enumerable:!0,configurable:!0});n.prototype.enableGeometryBufferRenderer=function(e=1,r=15,i){return this._geometryBufferRenderer?this._geometryBufferRenderer:(this._geometryBufferRenderer=new o(this,e,r,i),this._geometryBufferRenderer.isSupported||(this._geometryBufferRenderer=null),this._geometryBufferRenderer)};n.prototype.disableGeometryBufferRenderer=function(){this._geometryBufferRenderer&&(this._geometryBufferRenderer.dispose(),this._geometryBufferRenderer=null)};class f{constructor(r){this.name=t.NAME_GEOMETRYBUFFERRENDERER,this.scene=r}register(){this.scene._gatherRenderTargetsStage.registerStep(t.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER,this,this._gatherRenderTargets)}rebuild(){}dispose(){}_gatherRenderTargets(r){this.scene._geometryBufferRenderer&&r.push(this.scene._geometryBufferRenderer.getGBuffer())}}o._SceneComponentInitialization=e=>{let r=e._getComponent(t.NAME_GEOMETRYBUFFERRENDERER);r||(r=new f(e),e._addComponent(r))};export{f as GeometryBufferRendererSceneComponent}; diff --git a/assets/gitGraphDiagram-NY62KEGX-BnrtNi3E.js b/assets/gitGraphDiagram-NY62KEGX-BnrtNi3E.js deleted file mode 100644 index db53a394aea695b08b467ecd84890202afdf3a22..0000000000000000000000000000000000000000 --- a/assets/gitGraphDiagram-NY62KEGX-BnrtNi3E.js +++ /dev/null @@ -1,65 +0,0 @@ -import{p as Y}from"./chunk-4BX2VUAB-BSrsJ5gp.js";import{I as K}from"./chunk-QZHKN3VN-CdTgv_Ss.js";import{q as U,p as V,s as X,g as J,a as Q,b as Z,_ as l,l as m,u as rr,D as er,y as tr,j as C,E as ar,F as sr,G as nr,c as or,H as cr}from"./mermaid.core-BcqUqpnI.js";import{p as ir}from"./treemap-KMMF4GRG-BAURD4mW.js";import{s as dr}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},hr=sr.gitGraph,I=l(()=>ar({...hr,...nr().gitGraph}),"getConfig"),c=new K(()=>{const t=I(),r=t.mainBranchName,s=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:s}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function A(){return cr({length:7})}l(A,"getID");function F(t,r){const s=Object.create(null);return t.reduce((n,e)=>{const a=r(e);return s[a]||(s[a]=!0,n.push(e)),n},[])}l(F,"uniqBy");var lr=l(function(t){c.records.direction=t},"setDirection"),$r=l(function(t){m.debug("options str",t),t=t?.trim(),t=t||"{}";try{c.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),fr=l(function(){return c.records.options},"getOptions"),gr=l(function(t){let r=t.msg,s=t.id;const n=t.type;let e=t.tags;m.info("commit",r,s,n,e),m.debug("Entering commit:",r,s,n,e);const a=I();s=C.sanitizeText(s,a),r=C.sanitizeText(r,a),e=e?.map(o=>C.sanitizeText(o,a));const d={id:s||c.records.seq+"-"+A(),message:r,seq:c.records.seq++,type:n??x.NORMAL,tags:e??[],parents:c.records.head==null?[]:[c.records.head.id],branch:c.records.currBranch};c.records.head=d,m.info("main branch",a.mainBranchName),c.records.commits.has(d.id)&&m.warn(`Commit ID ${d.id} already exists`),c.records.commits.set(d.id,d),c.records.branches.set(c.records.currBranch,d.id),m.debug("in pushCommit "+d.id)},"commit"),yr=l(function(t){let r=t.name;const s=t.order;if(r=C.sanitizeText(r,I()),c.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);c.records.branches.set(r,c.records.head!=null?c.records.head.id:null),c.records.branchConfig.set(r,{name:r,order:s}),z(r),m.debug("in createBranch")},"branch"),ur=l(t=>{let r=t.branch,s=t.id;const n=t.type,e=t.tags,a=I();r=C.sanitizeText(r,a),s&&(s=C.sanitizeText(s,a));const d=c.records.branches.get(c.records.currBranch),o=c.records.branches.get(r),f=d?c.records.commits.get(d):void 0,h=o?c.records.commits.get(o):void 0;if(f&&h&&f.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(c.records.currBranch===r){const i=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(f===void 0||!f){const i=new Error(`Incorrect usage of "merge". Current branch (${c.records.currBranch})has no commits`);throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},i}if(!c.records.branches.has(r)){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},i}if(h===void 0||!h){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},i}if(f===h){const i=new Error('Incorrect usage of "merge". Both branches have same head');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(s&&c.records.commits.has(s)){const i=new Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom id");throw i.hash={text:`merge ${r} ${s} ${n} ${e?.join(" ")}`,token:`merge ${r} ${s} ${n} ${e?.join(" ")}`,expected:[`merge ${r} ${s}_UNIQUE ${n} ${e?.join(" ")}`]},i}const $=o||"",g={id:s||`${c.records.seq}-${A()}`,message:`merged branch ${r} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,$],branch:c.records.currBranch,type:x.MERGE,customType:n,customId:!!s,tags:e??[]};c.records.head=g,c.records.commits.set(g.id,g),c.records.branches.set(c.records.currBranch,g.id),m.debug(c.records.branches),m.debug("in mergeBranch")},"merge"),pr=l(function(t){let r=t.id,s=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,s,n);const a=I();if(r=C.sanitizeText(r,a),s=C.sanitizeText(s,a),n=n?.map(f=>C.sanitizeText(f,a)),e=C.sanitizeText(e,a),!r||!c.records.commits.has(r)){const f=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw f.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},f}const d=c.records.commits.get(r);if(d===void 0||!d)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(d.parents)&&d.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=d.branch;if(d.type===x.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||!c.records.commits.has(s)){if(o===c.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const f=c.records.branches.get(c.records.currBranch);if(f===void 0||!f){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const h=c.records.commits.get(f);if(h===void 0||!h){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const $={id:c.records.seq+"-"+A(),message:`cherry-picked ${d?.message} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,d.id],branch:c.records.currBranch,type:x.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${d.id}${d.type===x.MERGE?`|parent:${e}`:""}`]};c.records.head=$,c.records.commits.set($.id,$),c.records.branches.set(c.records.currBranch,$.id),m.debug(c.records.branches),m.debug("in cherryPick")}},"cherryPick"),z=l(function(t){if(t=C.sanitizeText(t,I()),c.records.branches.has(t)){c.records.currBranch=t;const r=c.records.branches.get(c.records.currBranch);r===void 0||!r?c.records.head=null:c.records.head=c.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function _(t,r,s){const n=t.indexOf(r);n===-1?t.push(s):t.splice(n,1,s)}l(_,"upsert");function P(t){const r=t.reduce((e,a)=>e.seq>a.seq?e:a,t[0]);let s="";t.forEach(function(e){e===r?s+=" *":s+=" |"});const n=[s,r.id,r.seq];for(const e in c.records.branches)c.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=c.records.commits.get(r.parents[0]);_(t,r,e),r.parents[1]&&t.push(c.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=c.records.commits.get(r.parents[0]);_(t,r,e)}}t=F(t,e=>e.id),P(t)}l(P,"prettyPrintCommitHistory");var xr=l(function(){m.debug(c.records.commits);const t=N()[0];P([t])},"prettyPrint"),mr=l(function(){c.reset(),tr()},"clear"),br=l(function(){return[...c.records.branchConfig.values()].map((r,s)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${s}`)}).sort((r,s)=>(r.order??0)-(s.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),wr=l(function(){return c.records.branches},"getBranches"),vr=l(function(){return c.records.commits},"getCommits"),N=l(function(){const t=[...c.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,s)=>r.seq-s.seq),t},"getCommitsArray"),Cr=l(function(){return c.records.currBranch},"getCurrentBranch"),Er=l(function(){return c.records.direction},"getDirection"),Tr=l(function(){return c.records.head},"getHead"),S={commitType:x,getConfig:I,setDirection:lr,setOptions:$r,getOptions:fr,commit:gr,branch:yr,merge:ur,cherryPick:pr,checkout:z,prettyPrint:xr,clear:mr,getBranchesAsObjArray:br,getBranches:wr,getCommits:vr,getCommitsArray:N,getCurrentBranch:Cr,getDirection:Er,getHead:Tr,setAccTitle:Z,getAccTitle:Q,getAccDescription:J,setAccDescription:X,setDiagramTitle:V,getDiagramTitle:U},Br=l((t,r)=>{Y(t,r),t.dir&&r.setDirection(t.dir);for(const s of t.statements)Lr(s,r)},"populate"),Lr=l((t,r)=>{const n={Commit:l(e=>r.commit(kr(e)),"Commit"),Branch:l(e=>r.branch(Mr(e)),"Branch"),Merge:l(e=>r.merge(Ir(e)),"Merge"),Checkout:l(e=>r.checkout(Rr(e)),"Checkout"),CherryPicking:l(e=>r.cherryPick(Gr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),kr=l(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),Mr=l(t=>({name:t.name,order:t.order??0}),"parseBranch"),Ir=l(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Rr=l(t=>t.branch,"parseCheckout"),Gr=l(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Or={parse:l(async t=>{const r=await ir("gitGraph",t);m.debug(r),Br(r,S)},"parse")},qr=or(),v=qr?.gitGraph,L=10,k=40,E=4,T=2,M=8,b=new Map,w=new Map,O=30,R=new Map,q=[],B=0,u="LR",Ar=l(()=>{b.clear(),w.clear(),R.clear(),B=0,q=[],u="LR"},"clear"),W=l(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=n.trim(),r.appendChild(e)}),r},"drawText"),j=l(t=>{let r,s,n;return u==="BT"?(s=l((e,a)=>e<=a,"comparisonFunc"),n=1/0):(s=l((e,a)=>e>=a,"comparisonFunc"),n=0),t.forEach(e=>{const a=u==="TB"||u=="BT"?w.get(e)?.y:w.get(e)?.x;a!==void 0&&s(a,n)&&(r=e,n=a)}),r},"findClosestParent"),Hr=l(t=>{let r="",s=1/0;return t.forEach(n=>{const e=w.get(n).y;e<=s&&(r=n,s=e)}),r||void 0},"findClosestParentBT"),_r=l((t,r,s)=>{let n=s,e=s;const a=[];t.forEach(d=>{const o=r.get(d);if(!o)throw new Error(`Commit not found for key ${d}`);o.parents.length?(n=Dr(o),e=Math.max(n,e)):a.push(o),Fr(o,n)}),n=e,a.forEach(d=>{zr(d,n,s)}),t.forEach(d=>{const o=r.get(d);if(o?.parents.length){const f=Hr(o.parents);n=w.get(f).y-k,n<=e&&(e=n);const h=b.get(o.branch).pos,$=n-L;w.set(o.id,{x:h,y:$})}})},"setParallelBTPos"),Pr=l(t=>{const r=j(t.parents.filter(n=>n!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const s=w.get(r)?.y;if(s===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return s},"findClosestParentPos"),Dr=l(t=>Pr(t)+k,"calculateCommitPosition"),Fr=l((t,r)=>{const s=b.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const n=s.pos,e=r+L;return w.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),zr=l((t,r,s)=>{const n=b.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+s,a=n.pos;w.set(t.id,{x:a,y:e})},"setRootPosition"),Nr=l((t,r,s,n,e,a)=>{if(a===x.HIGHLIGHT)t.append("rect").attr("x",s.x-10).attr("y",s.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%M} ${n}-outer`),t.append("rect").attr("x",s.x-6).attr("y",s.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%M} ${n}-inner`);else if(a===x.CHERRY_PICK)t.append("circle").attr("cx",s.x).attr("cy",s.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x-3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x+3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x+3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x-3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const d=t.append("circle");if(d.attr("cx",s.x),d.attr("cy",s.y),d.attr("r",r.type===x.MERGE?9:10),d.attr("class",`commit ${r.id} commit${e%M}`),a===x.MERGE){const o=t.append("circle");o.attr("cx",s.x),o.attr("cy",s.y),o.attr("r",6),o.attr("class",`commit ${n} ${r.id} commit${e%M}`)}a===x.REVERSE&&t.append("path").attr("d",`M ${s.x-5},${s.y-5}L${s.x+5},${s.y+5}M${s.x-5},${s.y+5}L${s.x+5},${s.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%M}`)}},"drawCommitBullet"),Sr=l((t,r,s,n)=>{if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&v?.showCommitLabel){const e=t.append("g"),a=e.insert("rect").attr("class","commit-label-bkg"),d=e.append("text").attr("x",n).attr("y",s.y+25).attr("class","commit-label").text(r.id),o=d.node()?.getBBox();if(o&&(a.attr("x",s.posWithOffset-o.width/2-T).attr("y",s.y+13.5).attr("width",o.width+2*T).attr("height",o.height+2*T),u==="TB"||u==="BT"?(a.attr("x",s.x-(o.width+4*E+5)).attr("y",s.y-12),d.attr("x",s.x-(o.width+4*E)).attr("y",s.y+o.height-12)):d.attr("x",s.posWithOffset-o.width/2),v.rotateCommitLabel))if(u==="TB"||u==="BT")d.attr("transform","rotate(-45, "+s.x+", "+s.y+")"),a.attr("transform","rotate(-45, "+s.x+", "+s.y+")");else{const f=-7.5-(o.width+10)/25*9.5,h=10+o.width/25*8.5;e.attr("transform","translate("+f+", "+h+") rotate(-45, "+n+", "+s.y+")")}}},"drawCommitLabel"),Wr=l((t,r,s,n)=>{if(r.tags.length>0){let e=0,a=0,d=0;const o=[];for(const f of r.tags.reverse()){const h=t.insert("polygon"),$=t.append("circle"),g=t.append("text").attr("y",s.y-16-e).attr("class","tag-label").text(f),i=g.node()?.getBBox();if(!i)throw new Error("Tag bbox not found");a=Math.max(a,i.width),d=Math.max(d,i.height),g.attr("x",s.posWithOffset-i.width/2),o.push({tag:g,hole:$,rect:h,yOffset:e}),e+=20}for(const{tag:f,hole:h,rect:$,yOffset:g}of o){const i=d/2,y=s.y-19.2-g;if($.attr("class","tag-label-bkg").attr("points",` - ${n-a/2-E/2},${y+T} - ${n-a/2-E/2},${y-T} - ${s.posWithOffset-a/2-E},${y-i-T} - ${s.posWithOffset+a/2+E},${y-i-T} - ${s.posWithOffset+a/2+E},${y+i+T} - ${s.posWithOffset-a/2-E},${y+i+T}`),h.attr("cy",y).attr("cx",n-a/2+E/2).attr("r",1.5).attr("class","tag-hole"),u==="TB"||u==="BT"){const p=n+g;$.attr("class","tag-label-bkg").attr("points",` - ${s.x},${p+2} - ${s.x},${p-2} - ${s.x+L},${p-i-2} - ${s.x+L+a+4},${p-i-2} - ${s.x+L+a+4},${p+i+2} - ${s.x+L},${p+i+2}`).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),h.attr("cx",s.x+E/2).attr("cy",p).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),f.attr("x",s.x+5).attr("y",p+3).attr("transform","translate(14,14) rotate(45, "+s.x+","+n+")")}}}},"drawCommitTags"),jr=l(t=>{switch(t.customType??t.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Yr=l((t,r,s,n)=>{const e={x:0,y:0};if(t.parents.length>0){const a=j(t.parents);if(a){const d=n.get(a)??e;return r==="TB"?d.y+k:r==="BT"?(n.get(t.id)??e).y-k:d.x+k}}else return r==="TB"?O:r==="BT"?(n.get(t.id)??e).y-k:0;return 0},"calculatePosition"),Kr=l((t,r,s)=>{const n=u==="BT"&&s?r:r+L,e=u==="TB"||u==="BT"?n:b.get(t.branch)?.pos,a=u==="TB"||u==="BT"?b.get(t.branch)?.pos:n;if(a===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:e,posWithOffset:n}},"getCommitPosition"),D=l((t,r,s)=>{if(!v)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),e=t.append("g").attr("class","commit-labels");let a=u==="TB"||u==="BT"?O:0;const d=[...r.keys()],o=v?.parallelCommits??!1,f=l(($,g)=>{const i=r.get($)?.seq,y=r.get(g)?.seq;return i!==void 0&&y!==void 0?i-y:0},"sortKeys");let h=d.sort(f);u==="BT"&&(o&&_r(h,r,a),h=h.reverse()),h.forEach($=>{const g=r.get($);if(!g)throw new Error(`Commit not found for key ${$}`);o&&(a=Yr(g,u,a,w));const i=Kr(g,a,o);if(s){const y=jr(g),p=g.customType??g.type,H=b.get(g.branch)?.index??0;Nr(n,g,i,y,H,p),Sr(e,g,i,a),Wr(e,g,i,a)}u==="TB"||u==="BT"?w.set(g.id,{x:i.x,y:i.posWithOffset}):w.set(g.id,{x:i.posWithOffset,y:i.y}),a=u==="BT"&&o?a+k:a+k+L,a>B&&(B=a)})},"drawCommits"),Ur=l((t,r,s,n,e)=>{const d=(u==="TB"||u==="BT"?s.xh.branch===d,"isOnBranchToGetCurve"),f=l(h=>h.seq>t.seq&&h.seqf(h)&&o(h))},"shouldRerouteArrow"),G=l((t,r,s=0)=>{const n=t+Math.abs(t-r)/2;if(s>5)return n;if(q.every(d=>Math.abs(d-n)>=10))return q.push(n),n;const a=Math.abs(t-r);return G(t,r-a/5,s+1)},"findLane"),Vr=l((t,r,s,n)=>{const e=w.get(r.id),a=w.get(s.id);if(e===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${s.id}`);const d=Ur(r,s,e,a,n);let o="",f="",h=0,$=0,g=b.get(s.branch)?.index;s.type===x.MERGE&&r.id!==s.parents[0]&&(g=b.get(r.branch)?.index);let i;if(d){o="A 10 10, 0, 0, 0,",f="A 10 10, 0, 0, 1,",h=10,$=10;const y=e.ya.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y-h} ${f} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x+h} ${e.y} ${o} ${a.x} ${e.y+$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):u==="BT"?(e.xa.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${o} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):(e.ya.y&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${f} ${e.x+$} ${a.y} L ${a.x} ${a.y}`),e.y===a.y&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`));if(i===void 0)throw new Error("Line definition not found");t.append("path").attr("d",i).attr("class","arrow arrow"+g%M)},"drawArrow"),Xr=l((t,r)=>{const s=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(n=>{const e=r.get(n);e.parents&&e.parents.length>0&&e.parents.forEach(a=>{Vr(s,r.get(a),e,r)})})},"drawArrows"),Jr=l((t,r)=>{const s=t.append("g");r.forEach((n,e)=>{const a=e%M,d=b.get(n.name)?.pos;if(d===void 0)throw new Error(`Position not found for branch ${n.name}`);const o=s.append("line");o.attr("x1",0),o.attr("y1",d),o.attr("x2",B),o.attr("y2",d),o.attr("class","branch branch"+a),u==="TB"?(o.attr("y1",O),o.attr("x1",d),o.attr("y2",B),o.attr("x2",d)):u==="BT"&&(o.attr("y1",B),o.attr("x1",d),o.attr("y2",O),o.attr("x2",d)),q.push(d);const f=n.name,h=W(f),$=s.insert("rect"),i=s.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);i.node().appendChild(h);const y=h.getBBox();$.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-y.width-4-(v?.rotateCommitLabel===!0?30:0)).attr("y",-y.height/2+8).attr("width",y.width+18).attr("height",y.height+4),i.attr("transform","translate("+(-y.width-14-(v?.rotateCommitLabel===!0?30:0))+", "+(d-y.height/2-1)+")"),u==="TB"?($.attr("x",d-y.width/2-10).attr("y",0),i.attr("transform","translate("+(d-y.width/2-5)+", 0)")):u==="BT"?($.attr("x",d-y.width/2-10).attr("y",B),i.attr("transform","translate("+(d-y.width/2-5)+", "+B+")")):$.attr("transform","translate(-19, "+(d-y.height/2)+")")})},"drawBranches"),Qr=l(function(t,r,s,n,e){return b.set(t,{pos:r,index:s}),r+=50+(e?40:0)+(u==="TB"||u==="BT"?n.width/2:0),r},"setBranchPosition"),Zr=l(function(t,r,s,n){if(Ar(),m.debug("in gitgraph renderer",t+` -`,"id:",r,s),!v)throw new Error("GitGraph config not found");const e=v.rotateCommitLabel??!1,a=n.db;R=a.getCommits();const d=a.getBranchesAsObjArray();u=a.getDirection();const o=dr(`[id="${r}"]`);let f=0;d.forEach((h,$)=>{const g=W(h.name),i=o.append("g"),y=i.insert("g").attr("class","branchLabel"),p=y.insert("g").attr("class","label branch-label");p.node()?.appendChild(g);const H=g.getBBox();f=Qr(h.name,f,$,H,e),p.remove(),y.remove(),i.remove()}),D(o,R,!1),v.showBranches&&Jr(o,d),Xr(o,R),D(o,R,!0),rr.insertTitle(o,"gitTitleText",v.titleTopMargin??0,a.getDiagramTitle()),er(void 0,o,v.diagramPadding,v.useMaxWidth)},"draw"),re={draw:Zr},ee=l(t=>` - .commit-id, - .commit-msg, - .branch-label { - fill: lightgrey; - color: lightgrey; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - } - ${[0,1,2,3,4,5,6,7].map(r=>` - .branch-label${r} { fill: ${t["gitBranchLabel"+r]}; } - .commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } - .commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } - .label${r} { fill: ${t["git"+r]}; } - .arrow${r} { stroke: ${t["git"+r]}; } - `).join(` -`)} - - .branch { - stroke-width: 1; - stroke: ${t.lineColor}; - stroke-dasharray: 2; - } - .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};} - .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; } - .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} - .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; } - .tag-hole { fill: ${t.textColor}; } - - .commit-merge { - stroke: ${t.primaryColor}; - fill: ${t.primaryColor}; - } - .commit-reverse { - stroke: ${t.primaryColor}; - fill: ${t.primaryColor}; - stroke-width: 3; - } - .commit-highlight-outer { - } - .commit-highlight-inner { - stroke: ${t.primaryColor}; - fill: ${t.primaryColor}; - } - - .arrow { stroke-width: 8; stroke-linecap: round; fill: none} - .gitTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.textColor}; - } -`,"getStyles"),te=ee,ge={parser:Or,db:S,renderer:re,styles:te};export{ge as diagram}; diff --git a/assets/glTFLoader-CdfQ_yvy.js b/assets/glTFLoader-CdfQ_yvy.js deleted file mode 100644 index 9b14171548d8af584219b5c460db4546aef65a5d..0000000000000000000000000000000000000000 --- a/assets/glTFLoader-CdfQ_yvy.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./animationGroup-R6N9NYXv.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./bone-CnpD8dWY.js","./glTFLoaderAnimation-DM5M4v5g.js","./objectModelMapping-CpTIXcMS.js","./openpbrMaterial-D1CYjggx.js","./pbrMaterialLoadingAdapter-DhdH9hHA.js"])))=>i.map(i=>d[i]); -import{af as G}from"./index-DydPgVMC.js";import{d as S,bG as ye,V as v,_ as g,s as b,bH as j,O as x,aQ as E,bI as ge,M as B,bJ as be,bK as ve,A as Ae,ah as Ce,f as ue,R as we,aq as de,e as re,G as Me,J as m,T as w,n as xe,L as T,bL as Te,bM as K,bN as H,bO as ce,bP as Oe,bQ as Pe,ax as Ee,aH as Se,aG as ke,o as $,bR as Re,l as oe,bg as Ie,bh as ae,bS as Le,bp as De,ao as q,b1 as Ne,bT as _e,au as $e,C as z,aM as Ve,bU as Ue,bV as Be,bW as Fe,bX as Ge,c as le,av as We}from"./index-GY9JDBGV.js";import{B as Xe}from"./bone-CnpD8dWY.js";import{S as Ye}from"./skeleton-CQeK9qOO.js";import{A as Ze}from"./assetContainer-X8dc1NDD.js";import{b as J}from"./objectModelMapping-CpTIXcMS.js";import"./rawTexture-BDsvmix4.js";class I{constructor(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this.rotationSpeed=.5,this.keysRotateLeft=[],this.keysRotateRight=[],this.keysRotateUp=[],this.keysRotateDown=[],this._keys=new Array}attachControl(e){e=S.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{const s=t.event;if(!s.metaKey){if(t.type===ye.KEYDOWN)(this.keysUp.indexOf(s.keyCode)!==-1||this.keysDown.indexOf(s.keyCode)!==-1||this.keysLeft.indexOf(s.keyCode)!==-1||this.keysRight.indexOf(s.keyCode)!==-1||this.keysUpward.indexOf(s.keyCode)!==-1||this.keysDownward.indexOf(s.keyCode)!==-1||this.keysRotateLeft.indexOf(s.keyCode)!==-1||this.keysRotateRight.indexOf(s.keyCode)!==-1||this.keysRotateUp.indexOf(s.keyCode)!==-1||this.keysRotateDown.indexOf(s.keyCode)!==-1)&&(this._keys.indexOf(s.keyCode)===-1&&this._keys.push(s.keyCode),e||s.preventDefault());else if(this.keysUp.indexOf(s.keyCode)!==-1||this.keysDown.indexOf(s.keyCode)!==-1||this.keysLeft.indexOf(s.keyCode)!==-1||this.keysRight.indexOf(s.keyCode)!==-1||this.keysUpward.indexOf(s.keyCode)!==-1||this.keysDownward.indexOf(s.keyCode)!==-1||this.keysRotateLeft.indexOf(s.keyCode)!==-1||this.keysRotateRight.indexOf(s.keyCode)!==-1||this.keysRotateUp.indexOf(s.keyCode)!==-1||this.keysRotateDown.indexOf(s.keyCode)!==-1){const n=this._keys.indexOf(s.keyCode);n>=0&&this._keys.splice(n,1),e||s.preventDefault()}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t{const i=n.event,r=i.pointerType==="touch";if(!this.touchEnabled&&r||n.type!==E.POINTERMOVE&&this.buttons.indexOf(i.button)===-1)return;const o=i.target;if(n.type===E.POINTERDOWN){if(r&&this._activePointerId!==-1||!r&&this._currentActiveButton!==-1)return;this._activePointerId=i.pointerId;try{o?.setPointerCapture(i.pointerId)}catch{}this._currentActiveButton===-1&&(this._currentActiveButton=i.button),this._previousPosition={x:i.clientX,y:i.clientY},e||(i.preventDefault(),s&&s.focus()),t.isPointerLock&&this._onMouseMove&&this._onMouseMove(n.event)}else if(n.type===E.POINTERUP){if(r&&this._activePointerId!==i.pointerId||!r&&this._currentActiveButton!==i.button)return;try{o?.releasePointerCapture(i.pointerId)}catch{}this._currentActiveButton=-1,this._previousPosition=null,e||i.preventDefault(),this._activePointerId=-1}else if(n.type===E.POINTERMOVE&&(this._activePointerId===i.pointerId||!r)){if(t.isPointerLock&&this._onMouseMove)this._onMouseMove(n.event);else if(this._previousPosition){const a=this.camera._calculateHandednessMultiplier(),l=(i.clientX-this._previousPosition.x)*a,h=(i.clientY-this._previousPosition.y)*a;this._allowCameraRotation&&(this.camera.cameraRotation.y+=l/this.angularSensibility,this.camera.cameraRotation.x+=h/this.angularSensibility),this.onPointerMovedObservable.notifyObservers({offsetX:l,offsetY:h}),this._previousPosition={x:i.clientX,y:i.clientY},e||i.preventDefault()}}}),this._onMouseMove=n=>{if(!t.isPointerLock)return;const i=this.camera._calculateHandednessMultiplier();this.camera.cameraRotation.y+=n.movementX*i/this.angularSensibility,this.camera.cameraRotation.x+=n.movementY*i/this.angularSensibility,this._previousPosition=null,e||n.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,E.POINTERDOWN|E.POINTERUP|E.POINTERMOVE),s&&(this._contextMenuBind=n=>this.onContextMenu(n),s.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(e){e.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}}g([b()],ee.prototype,"buttons",void 0);g([b()],ee.prototype,"angularSensibility",void 0);j.FreeCameraMouseInput=ee;class te{constructor(){this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new x,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(e){e=S.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==E.POINTERWHEEL)return;const s=t.event,n=s.deltaMode===ge.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*n*s.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*n*s.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*n*s.deltaZ/this._normalize,s.preventDefault&&(e||s.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,E.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}}g([b()],te.prototype,"wheelPrecisionX",void 0);g([b()],te.prototype,"wheelPrecisionY",void 0);g([b()],te.prototype,"wheelPrecisionZ",void 0);var y;(function(c){c[c.MoveRelative=0]="MoveRelative",c[c.RotateRelative=1]="RotateRelative",c[c.MoveScene=2]="MoveScene"})(y||(y={}));class D extends te{constructor(){super(...arguments),this._moveRelative=v.Zero(),this._rotateRelative=v.Zero(),this._moveScene=v.Zero(),this._wheelXAction=y.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=y.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(e){e===null&&this._wheelXAction!==y.MoveRelative||(this._wheelXAction=y.MoveRelative,this._wheelXActionCoordinate=e)}get wheelXMoveRelative(){return this._wheelXAction!==y.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(e){e===null&&this._wheelYAction!==y.MoveRelative||(this._wheelYAction=y.MoveRelative,this._wheelYActionCoordinate=e)}get wheelYMoveRelative(){return this._wheelYAction!==y.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(e){e===null&&this._wheelZAction!==y.MoveRelative||(this._wheelZAction=y.MoveRelative,this._wheelZActionCoordinate=e)}get wheelZMoveRelative(){return this._wheelZAction!==y.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(e){e===null&&this._wheelXAction!==y.RotateRelative||(this._wheelXAction=y.RotateRelative,this._wheelXActionCoordinate=e)}get wheelXRotateRelative(){return this._wheelXAction!==y.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(e){e===null&&this._wheelYAction!==y.RotateRelative||(this._wheelYAction=y.RotateRelative,this._wheelYActionCoordinate=e)}get wheelYRotateRelative(){return this._wheelYAction!==y.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(e){e===null&&this._wheelZAction!==y.RotateRelative||(this._wheelZAction=y.RotateRelative,this._wheelZActionCoordinate=e)}get wheelZRotateRelative(){return this._wheelZAction!==y.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(e){e===null&&this._wheelXAction!==y.MoveScene||(this._wheelXAction=y.MoveScene,this._wheelXActionCoordinate=e)}get wheelXMoveScene(){return this._wheelXAction!==y.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(e){e===null&&this._wheelYAction!==y.MoveScene||(this._wheelYAction=y.MoveScene,this._wheelYActionCoordinate=e)}get wheelYMoveScene(){return this._wheelYAction!==y.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(e){e===null&&this._wheelZAction!==y.MoveScene||(this._wheelZAction=y.MoveScene,this._wheelZActionCoordinate=e)}get wheelZMoveScene(){return this._wheelZAction!==y.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){if(this._wheelDeltaX===0&&this._wheelDeltaY===0&&this._wheelDeltaZ==0)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const e=B.Zero();this.camera.getViewMatrix().invertToRef(e);const t=v.Zero();v.TransformNormalToRef(this._moveRelative,e,t),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(t),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(e,t,s){if(e===0||t===null||s===null)return;let n=null;switch(t){case y.MoveRelative:n=this._moveRelative;break;case y.RotateRelative:n=this._rotateRelative;break;case y.MoveScene:n=this._moveScene;break}switch(s){case 0:n.set(e,0,0);break;case 1:n.set(0,e,0);break;case 2:n.set(0,0,e);break}}}g([b()],D.prototype,"wheelXMoveRelative",null);g([b()],D.prototype,"wheelYMoveRelative",null);g([b()],D.prototype,"wheelZMoveRelative",null);g([b()],D.prototype,"wheelXRotateRelative",null);g([b()],D.prototype,"wheelYRotateRelative",null);g([b()],D.prototype,"wheelZRotateRelative",null);g([b()],D.prototype,"wheelXMoveScene",null);g([b()],D.prototype,"wheelYMoveScene",null);g([b()],D.prototype,"wheelZMoveScene",null);j.FreeCameraMouseWheelInput=D;class se{constructor(e=!1){this.allowMouse=e,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this.singleFingerRotate=!1,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=S.IsSafari()}attachControl(e){e=S.BackCompatCameraNoPreventDefault(arguments);let t=null;if(this._pointerInput===void 0&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=s=>{const n=s.event,i=n.pointerType==="mouse"||this._isSafari&&typeof n.pointerType>"u";if(!(!this.allowMouse&&i)){if(s.type===E.POINTERDOWN){if(e||n.preventDefault(),this._pointerPressed.push(n.pointerId),this._pointerPressed.length!==1)return;t={x:n.clientX,y:n.clientY}}else if(s.type===E.POINTERUP){e||n.preventDefault();const r=this._pointerPressed.indexOf(n.pointerId);if(r===-1||(this._pointerPressed.splice(r,1),r!=0))return;t=null,this._offsetX=null,this._offsetY=null}else if(s.type===E.POINTERMOVE){if(e||n.preventDefault(),!t||this._pointerPressed.indexOf(n.pointerId)!=0)return;this._offsetX=n.clientX-t.x,this._offsetY=-(n.clientY-t.y)}}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,E.POINTERDOWN|E.POINTERUP|E.POINTERMOVE),this._onLostFocus){const n=this.camera.getEngine().getInputElement();n&&n.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){if(this._offsetX===null||this._offsetY===null||this._offsetX===0&&this._offsetY===0)return;const e=this.camera,t=e._calculateHandednessMultiplier();if(e.cameraRotation.y=this._offsetX*t/this.touchAngularSensibility,this.singleFingerRotate&&this._pointerPressed.length===1||!this.singleFingerRotate&&this._pointerPressed.length>1)e.cameraRotation.x=-(this._offsetY*t)/this.touchAngularSensibility;else{const n=e._computeLocalCameraSpeed(),i=new v(0,0,this.touchMoveSensibility!==0?n*this._offsetY/this.touchMoveSensibility:0);B.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(v.TransformCoordinates(i,e._cameraRotationMatrix))}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}}g([b()],se.prototype,"touchAngularSensibility",void 0);g([b()],se.prototype,"touchMoveSensibility",void 0);j.FreeCameraTouchInput=se;class Ke extends be{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new I),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new ee(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new D,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new se),this}clear(){super.clear(),this._mouseInput=null}}class X extends ve{get angularSensibility(){const e=this.inputs.attached.mouse;return e?e.angularSensibility:0}set angularSensibility(e){const t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)}get keysUp(){const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysUpward(){const e=this.inputs.attached.keyboard;return e?e.keysUpward:[]}set keysUpward(e){const t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)}get keysDown(){const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysDownward(){const e=this.inputs.attached.keyboard;return e?e.keysDownward:[]}set keysDownward(e){const t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)}get keysLeft(){const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get keysRotateLeft(){const e=this.inputs.attached.keyboard;return e?e.keysRotateLeft:[]}set keysRotateLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateLeft=e)}get keysRotateRight(){const e=this.inputs.attached.keyboard;return e?e.keysRotateRight:[]}set keysRotateRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateRight=e)}get keysRotateUp(){const e=this.inputs.attached.keyboard;return e?e.keysRotateUp:[]}set keysRotateUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateUp=e)}get keysRotateDown(){const e=this.inputs.attached.keyboard;return e?e.keysRotateDown:[]}set keysRotateDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateDown=e)}constructor(e,t,s,n=!0){super(e,t,s,n),this.ellipsoid=new v(.5,1,.5),this.ellipsoidOffset=new v(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this._needMoveForGravity=!1,this._oldPosition=v.Zero(),this._diffPosition=v.Zero(),this._newPosition=v.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(i,r,o=null)=>{this._newPosition.copyFrom(r),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Ae.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&o&&this.onCollide(o))},this.inputs=new Ke(this),this.inputs.addKeyboard().addMouse()}attachControl(e,t){t=S.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new v(0,0,0),this.cameraRotation=new Ce(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(e){this._collisionMask=isNaN(e)?-1:e}_collideWithWorld(e){let t;this.parent?t=v.TransformCoordinates(this.position,this.parent.getWorldMatrix()):t=this.position,t.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const s=this.getScene().collisionCoordinator;this._collider||(this._collider=s.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let n=e;this.applyGravity&&(n=e.add(this.getScene().gravity)),s.getNewPosition(this._oldPosition,n,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=v.Zero(),this._transformedDirection=v.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(e){this._needMoveForGravity=e}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}}g([ue()],X.prototype,"ellipsoid",void 0);g([ue()],X.prototype,"ellipsoidOffset",void 0);g([b()],X.prototype,"checkCollisions",void 0);g([b()],X.prototype,"applyGravity",void 0);we("BABYLON.FreeCamera",X);class F{get influence(){return this._influence}set influence(e){if(this._influence===e)return;const t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(t===0||e===0)}get animationPropertiesOverride(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}constructor(e,t=0,s=null){this.name=e,this.animations=[],this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uv2s=null,this._colors=null,this._uniqueId=0,this.onInfluenceChanged=new x,this._onDataLayoutChanged=new x,this._animationPropertiesOverride=null,this.id=e,this._scene=s||de.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}get uniqueId(){return this._uniqueId}get hasPositions(){return!!this._positions}get hasNormals(){return!!this._normals}get hasTangents(){return!!this._tangents}get hasUVs(){return!!this._uvs}get hasUV2s(){return!!this._uv2s}get hasColors(){return!!this._colors}get vertexCount(){return this._positions?this._positions.length/3:this._normals?this._normals.length/3:this._tangents?this._tangents.length/3:this._uvs?this._uvs.length/2:this._uv2s?this._uv2s.length/2:this._colors?this._colors.length/4:0}setPositions(e){const t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)}getPositions(){return this._positions}setNormals(e){const t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)}getNormals(){return this._normals}setTangents(e){const t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)}getTangents(){return this._tangents}setUVs(e){const t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)}getUVs(){return this._uvs}setUV2s(e){const t=this.hasUV2s;this._uv2s=e,t!==this.hasUV2s&&this._onDataLayoutChanged.notifyObservers(void 0)}getUV2s(){return this._uv2s}setColors(e){const t=this.hasColors;this._colors=e,t!==this.hasColors&&this._onDataLayoutChanged.notifyObservers(void 0)}getColors(){return this._colors}clone(){const e=re.Clone(()=>new F(this.name,this.influence,this._scene),this);return e._positions=this._positions,e._normals=this._normals,e._tangents=this._tangents,e._uvs=this._uvs,e._uv2s=this._uv2s,e._colors=this._colors,e}serialize(){const e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),this.id!=null&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),this.hasUV2s&&(e.uv2s=Array.prototype.slice.call(this.getUV2s())),this.hasColors&&(e.colors=Array.prototype.slice.call(this.getColors())),re.AppendSerializedAnimations(this,e),e}getClassName(){return"MorphTarget"}static Parse(e,t){const s=new F(e.name,e.influence);if(s.setPositions(e.positions),e.id!=null&&(s.id=e.id),e.normals&&s.setNormals(e.normals),e.tangents&&s.setTangents(e.tangents),e.uvs&&s.setUVs(e.uvs),e.uv2s&&s.setUV2s(e.uv2s),e.colors&&s.setColors(e.colors),e.animations){for(let n=0;n0}constructor(e=null){if(this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new xe(16),this._supportsPositions=!1,this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._supportsUV2s=!1,this._supportsColors=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this._canUseTextureForTargets=!1,this._blockCounter=0,this._mustSynchronize=!0,this._forceUpdateWhenUnfrozen=!1,this._textureVertexStride=0,this._textureWidth=0,this._textureHeight=1,this._parentContainer=null,this.optimizeInfluencers=!0,this.enablePositionMorphing=!0,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,this.enableUV2Morphing=!0,this.enableColorMorphing=!0,this._numMaxInfluencers=0,this._useTextureToStoreTargets=!0,this.metadata=null,this._influencesAreDirty=!1,this._needUpdateInfluences=!1,e||(e=de.LastCreatedScene),this._scene=e,this._scene){this._scene.addMorphTargetManager(this),this._uniqueId=this._scene.getUniqueId();const t=this._scene.getEngine().getCaps();this._canUseTextureForTargets=t.canUseGLVertexID&&t.textureFloat&&t.maxVertexTextureImageUnits>0&&t.texture2DArrayMaxLayerCount>1}}get numMaxInfluencers(){return L.ConstantTargetCountForTextureMode>0&&this.isUsingTextureForTargets?L.ConstantTargetCountForTextureMode:this._numMaxInfluencers}set numMaxInfluencers(e){this._numMaxInfluencers!==e&&(this._numMaxInfluencers=e,this._mustSynchronize=!0,this._syncActiveTargets())}get uniqueId(){return this._uniqueId}get vertexCount(){return this._vertexCount}get supportsPositions(){return this._supportsPositions&&this.enablePositionMorphing}get supportsNormals(){return this._supportsNormals&&this.enableNormalMorphing}get supportsTangents(){return this._supportsTangents&&this.enableTangentMorphing}get supportsUVs(){return this._supportsUVs&&this.enableUVMorphing}get supportsUV2s(){return this._supportsUV2s&&this.enableUV2Morphing}get supportsColors(){return this._supportsColors&&this.enableColorMorphing}get hasPositions(){return this._supportsPositions}get hasNormals(){return this._supportsNormals}get hasTangents(){return this._supportsTangents}get hasUVs(){return this._supportsUVs}get hasUV2s(){return this._supportsUV2s}get hasColors(){return this._supportsColors}get numTargets(){return this._targets.length}get numInfluencers(){return this._influencesAreDirty&&this._syncActiveTargets(),this._activeTargets.length}get influences(){return this._influencesAreDirty&&this._syncActiveTargets(),this._influences}get useTextureToStoreTargets(){return this._useTextureToStoreTargets}set useTextureToStoreTargets(e){this._useTextureToStoreTargets!==e&&(this._useTextureToStoreTargets=e,this._mustSynchronize=!0,this._syncActiveTargets())}get isUsingTextureForTargets(){return L.EnableTextureStorage&&this.useTextureToStoreTargets&&this._canUseTextureForTargets&&!this._scene?.getEngine().getCaps().disableMorphTargetTexture}getActiveTarget(e){return this._influencesAreDirty&&this._syncActiveTargets(),this._activeTargets.data[e]}getTarget(e){return this._targets[e]}getTargetByName(e){for(const t of this._targets)if(t.name===e)return t;return null}addTarget(e){this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add(t=>{this.areUpdatesFrozen&&t&&(this._forceUpdateWhenUnfrozen=!0),this._influencesAreDirty=!0,this._needUpdateInfluences=this._needUpdateInfluences||t})),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(()=>{this._mustSynchronize=!0,this._syncActiveTargets()})),this._mustSynchronize=!0,this._syncActiveTargets()}removeTarget(e){const t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._mustSynchronize=!0,this._syncActiveTargets()),this._scene&&this._scene.stopAnimation(e)}_bind(e){this._influencesAreDirty&&this._syncActiveTargets(),e.setFloat3("morphTargetTextureInfo",this._textureVertexStride,this._textureWidth,this._textureHeight),e.setFloatArray("morphTargetTextureIndices",this._morphTargetTextureIndices),e.setTexture("morphTargets",this._targetStoreTexture),e.setFloat("morphTargetCount",this.numInfluencers)}clone(){const e=new L(this._scene);e.areUpdatesFrozen=!0;for(const t of this._targets)e.addTarget(t.clone());return e.areUpdatesFrozen=!1,e.enablePositionMorphing=this.enablePositionMorphing,e.enableNormalMorphing=this.enableNormalMorphing,e.enableTangentMorphing=this.enableTangentMorphing,e.enableUVMorphing=this.enableUVMorphing,e.enableUV2Morphing=this.enableUV2Morphing,e.enableColorMorphing=this.enableColorMorphing,e.metadata=this.metadata,e}serialize(){const e={};e.id=this.uniqueId,e.targets=[];for(const t of this._targets)e.targets.push(t.serialize());return this.metadata&&(e.metadata=this.metadata),e}_syncActiveTargets(e=!1){if(this.areUpdatesFrozen)return;e=e||this._needUpdateInfluences,this._needUpdateInfluences=!1,this._influencesAreDirty=!1;const t=!!this._targetStoreTexture,s=this.isUsingTextureForTargets;(this._mustSynchronize||t!==s)&&(this._mustSynchronize=!1,this.synchronize());let n=0;this._activeTargets.reset(),(!this._morphTargetTextureIndices||this._morphTargetTextureIndices.length!==this._targets.length)&&(this._morphTargetTextureIndices=new Float32Array(this._targets.length));let i=-1;for(const r of this._targets)if(i++,!(r.influence===0&&this.optimizeInfluencers)){if(this._activeTargets.length>=L.MaxActiveMorphTargetsInVertexAttributeMode&&!this.isUsingTextureForTargets)break;this._activeTargets.push(r),this._morphTargetTextureIndices[n]=i,this._tempInfluences[n++]=r.influence}this._morphTargetTextureIndices.length!==n&&(this._morphTargetTextureIndices=this._morphTargetTextureIndices.slice(0,n)),(!this._influences||this._influences.length!==n)&&(this._influences=new Float32Array(n));for(let r=0;re.getCaps().texture2DArrayMaxLayerCount&&(this.useTextureToStoreTargets=!1);for(const t of this._targets){this._supportsPositions=this._supportsPositions&&t.hasPositions,this._supportsNormals=this._supportsNormals&&t.hasNormals,this._supportsTangents=this._supportsTangents&&t.hasTangents,this._supportsUVs=this._supportsUVs&&t.hasUVs,this._supportsUV2s=this._supportsUV2s&&t.hasUV2s,this._supportsColors=this._supportsColors&&t.hasColors;const s=t.vertexCount;if(this._vertexCount===0)this._vertexCount=s;else if(this._vertexCount!==s){T.Error(`Incompatible target. Targets must all have the same vertices count. Current vertex count: ${this._vertexCount}, vertex count for target "${t.name}": ${s}`);return}}if(this.isUsingTextureForTargets){this._textureVertexStride=0,this._supportsPositions&&this._textureVertexStride++,this._supportsNormals&&this._textureVertexStride++,this._supportsTangents&&this._textureVertexStride++,this._supportsUVs&&this._textureVertexStride++,this._supportsUV2s&&this._textureVertexStride++,this._supportsColors&&this._textureVertexStride++,this._textureWidth=this._vertexCount*this._textureVertexStride||1,this._textureHeight=1;const t=e.getCaps().maxTextureSize;this._textureWidth>t&&(this._textureHeight=Math.ceil(this._textureWidth/t),this._textureWidth=t);const s=this._targets.length,n=new Float32Array(s*this._textureWidth*this._textureHeight*4);let i=0;for(let r=0;r-1&&this._parentContainer.morphTargetManagers.splice(e,1),this._parentContainer=null}for(const e of this._targets)this._scene.stopAnimation(e)}}static Parse(e,t){const s=new L(t);for(const n of e.targets)s.addTarget(F.Parse(n,t));return e.metadata&&(s.metadata=e.metadata),s}}L.EnableTextureStorage=!0;L.MaxActiveMorphTargetsInVertexAttributeMode=8;L.ConstantTargetCountForTextureMode=0;class Q{constructor(e){this.byteOffset=0,this.buffer=e}async loadAsync(e){const t=await this.buffer.readAsync(this.byteOffset,e);this._dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),this._dataByteOffset=0}readUint32(){const e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e}readUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t}readString(e){return Te(this.readUint8Array(e))}skipBytes(e){this._dataByteOffset+=e,this.byteOffset+=e}}function ne(c,e,t,s){const n={externalResourceFunction:s};return t&&(n.uri=e==="file:"?t:e+t),ArrayBuffer.isView(c)?GLTFValidator.validateBytes(c,n):GLTFValidator.validateString(c,n)}function He(){const c=[];onmessage=e=>{const t=e.data;switch(t.id){case"init":{importScripts(t.url);break}case"validate":{ne(t.data,t.rootUrl,t.fileName,s=>new Promise((n,i)=>{const r=c.length;c.push({resolve:n,reject:i}),postMessage({id:"getExternalResource",index:r,uri:s})})).then(s=>{postMessage({id:"validate.resolve",value:s})},s=>{postMessage({id:"validate.reject",reason:s})});break}case"getExternalResource.resolve":{c[t.index].resolve(t.value);break}case"getExternalResource.reject":{c[t.index].reject(t.reason);break}}}}class fe{static ValidateAsync(e,t,s,n){return typeof Worker=="function"?new Promise((i,r)=>{const o=`${ne}(${He})()`,a=URL.createObjectURL(new Blob([o],{type:"application/javascript"})),l=new Worker(a),h=d=>{l.removeEventListener("error",h),l.removeEventListener("message",u),r(d)},u=d=>{const p=d.data;switch(p.id){case"getExternalResource":{n(p.uri).then(_=>{l.postMessage({id:"getExternalResource.resolve",index:p.index,value:_},[_.buffer])},_=>{l.postMessage({id:"getExternalResource.reject",index:p.index,reason:_})});break}case"validate.resolve":{l.removeEventListener("error",h),l.removeEventListener("message",u),i(p.value),l.terminate();break}case"validate.reject":l.removeEventListener("error",h),l.removeEventListener("message",u),r(p.reason),l.terminate()}};if(l.addEventListener("error",h),l.addEventListener("message",u),l.postMessage({id:"init",url:S.GetBabylonScriptURL(this.Configuration.url)}),ArrayBuffer.isView(e)){const d=e.slice();l.postMessage({id:"validate",data:d,rootUrl:t,fileName:s},[d.buffer])}else l.postMessage({id:"validate",data:e,rootUrl:t,fileName:s})}):(this._LoadScriptPromise||(this._LoadScriptPromise=S.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then(()=>ne(e,t,s,n)))}}fe.Configuration={url:`${S._DefaultCdnUrl}/gltf_validator.js`};function he(c,e,t){try{return Promise.resolve(new Uint8Array(c,e,t))}catch(s){return Promise.reject(s)}}function qe(c,e,t){try{if(e<0||e>=c.byteLength)throw new RangeError("Offset is out of range.");if(e+t>c.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(c.buffer,c.byteOffset+e,t))}catch(s){return Promise.reject(s)}}var Y;(function(c){c[c.AUTO=0]="AUTO",c[c.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"})(Y||(Y={}));var W;(function(c){c[c.NONE=0]="NONE",c[c.FIRST=1]="FIRST",c[c.ALL=2]="ALL"})(W||(W={}));var k;(function(c){c[c.LOADING=0]="LOADING",c[c.READY=1]="READY",c[c.COMPLETE=2]="COMPLETE"})(k||(k={}));class pe{constructor(){this.alwaysComputeBoundingBox=!1,this.alwaysComputeSkeletonRootNode=!1,this.animationStartMode=W.FIRST,this.compileMaterials=!1,this.compileShadowGenerators=!1,this.coordinateSystemMode=Y.AUTO,this.createInstances=!0,this.loadAllMaterials=!1,this.loadMorphTargets=!0,this.loadNodeAnimations=!0,this.loadOnlyMaterials=!1,this.loadSkins=!0,this.skipMaterials=!1,this.targetFps=60,this.transparencyAsCoverage=!1,this.useClipPlane=!1,this.useGltfTextureNames=!1,this.useRangeRequests=!1,this.useSRGBBuffers=!0,this.validate=!1,this.useOpenPBR=!1,this.dontUseTransmissionHelper=!1}}const ze=new pe;class Je extends pe{constructor(){super(...arguments),this.extensionOptions={},this.preprocessUrlAsync=e=>Promise.resolve(e)}copyFrom(e){e&&(this.alwaysComputeBoundingBox=e.alwaysComputeBoundingBox??this.alwaysComputeBoundingBox,this.alwaysComputeSkeletonRootNode=e.alwaysComputeSkeletonRootNode??this.alwaysComputeSkeletonRootNode,this.animationStartMode=e.animationStartMode??this.animationStartMode,this.capturePerformanceCounters=e.capturePerformanceCounters??this.capturePerformanceCounters,this.compileMaterials=e.compileMaterials??this.compileMaterials,this.compileShadowGenerators=e.compileShadowGenerators??this.compileShadowGenerators,this.coordinateSystemMode=e.coordinateSystemMode??this.coordinateSystemMode,this.createInstances=e.createInstances??this.createInstances,this.customRootNode=e.customRootNode,this.extensionOptions=e.extensionOptions??this.extensionOptions,this.loadAllMaterials=e.loadAllMaterials??this.loadAllMaterials,this.loadMorphTargets=e.loadMorphTargets??this.loadMorphTargets,this.loadNodeAnimations=e.loadNodeAnimations??this.loadNodeAnimations,this.loadOnlyMaterials=e.loadOnlyMaterials??this.loadOnlyMaterials,this.loadSkins=e.loadSkins??this.loadSkins,this.loggingEnabled=e.loggingEnabled??this.loggingEnabled,this.onCameraLoaded=e.onCameraLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onMeshLoaded=e.onMeshLoaded,this.onParsed=e.onParsed,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onValidated=e.onValidated,this.preprocessUrlAsync=e.preprocessUrlAsync??this.preprocessUrlAsync,this.skipMaterials=e.skipMaterials??this.skipMaterials,this.targetFps=e.targetFps??this.targetFps,this.transparencyAsCoverage=e.transparencyAsCoverage??this.transparencyAsCoverage,this.useClipPlane=e.useClipPlane??this.useClipPlane,this.useGltfTextureNames=e.useGltfTextureNames??this.useGltfTextureNames,this.useOpenPBR=e.useOpenPBR??this.useOpenPBR,this.useRangeRequests=e.useRangeRequests??this.useRangeRequests,this.useSRGBBuffers=e.useSRGBBuffers??this.useSRGBBuffers,this.validate=e.validate??this.validate,this.dontUseTransmissionHelper=e.dontUseTransmissionHelper??this.dontUseTransmissionHelper)}}class R extends Je{constructor(e){super(),this.onParsedObservable=new x,this.onMeshLoadedObservable=new x,this.onSkinLoadedObservable=new x,this.onTextureLoadedObservable=new x,this.onMaterialLoadedObservable=new x,this.onCameraLoadedObservable=new x,this.onCompleteObservable=new x,this.onErrorObservable=new x,this.onDisposeObservable=new x,this.onExtensionLoadedObservable=new x,this.onValidatedObservable=new x,this._loader=null,this._state=null,this._requests=new Array,this.name=K.name,this.extensions=K.extensions,this.onLoaderStateChangedObservable=new x,this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled,this.copyFrom(Object.assign({...ze},e))}set onParsed(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))}set onMeshLoaded(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))}set onSkinLoaded(e){this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add(t=>e(t.node,t.skinnedNode)))}set onTextureLoaded(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))}set onMaterialLoaded(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))}set onCameraLoaded(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))}set onComplete(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)}set onError(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onExtensionLoaded(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)}get loggingEnabled(){return this._loggingEnabled}set loggingEnabled(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)}get capturePerformanceCounters(){return this._capturePerformanceCounters}set capturePerformanceCounters(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))}set onValidated(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)}dispose(){this._loader&&(this._loader.dispose(),this._loader=null);for(const e of this._requests)e.abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=e=>Promise.resolve(e),this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()}loadFile(e,t,s,n,i,r,o,a){if(ArrayBuffer.isView(t))return this._loadBinary(e,t,s,n,o,a),null;this._progressCallback=i;const l=t.name||S.GetFilename(t);if(r){if(this.useRangeRequests){this.validate&&T.Warn("glTF validation is not supported when range requests are enabled");const h={abort:()=>{},onCompleteObservable:new x},u={readAsync:(d,p)=>new Promise((_,O)=>{this._loadFile(e,t,M=>{_(new Uint8Array(M))},!0,M=>{O(M)},M=>{M.setRequestHeader("Range",`bytes=${d}-${d+p-1}`)})}),byteLength:0};return this._unpackBinaryAsync(new Q(u)).then(d=>{h.onCompleteObservable.notifyObservers(h),n(d)},o?d=>o(void 0,d):void 0),h}return this._loadFile(e,t,h=>{this._validate(e,new Uint8Array(h,0,h.byteLength),s,l),this._unpackBinaryAsync(new Q({readAsync:(u,d)=>he(h,u,d),byteLength:h.byteLength})).then(u=>{n(u)},o?u=>o(void 0,u):void 0)},!0,o)}else return this._loadFile(e,t,h=>{try{this._validate(e,h,s,l),n({json:this._parseJson(h)})}catch{o&&o()}},!1,o)}_loadBinary(e,t,s,n,i,r){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s,r),this._unpackBinaryAsync(new Q({readAsync:(o,a)=>qe(t,o,a),byteLength:t.byteLength})).then(o=>{n(o)},i?o=>i(void 0,o):void 0)}importMeshAsync(e,t,s,n,i,r){return Promise.resolve().then(()=>(this.onParsedObservable.notifyObservers(s),this.onParsedObservable.clear(),this._log(`Loading ${r||""}`),this._loader=this._getLoader(s),this._loader.importMeshAsync(e,t,null,s,n,i,r)))}loadAsync(e,t,s,n,i){return Promise.resolve().then(()=>(this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t),this._loader.loadAsync(e,t,s,n,i)))}loadAssetContainerAsync(e,t,s,n,i){return Promise.resolve().then(()=>{this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t);const r=new Ze(e),o=[];this.onMaterialLoadedObservable.add(u=>{o.push(u)});const a=[];this.onTextureLoadedObservable.add(u=>{a.push(u)});const l=[];this.onCameraLoadedObservable.add(u=>{l.push(u)});const h=[];return this.onMeshLoadedObservable.add(u=>{u.morphTargetManager&&h.push(u.morphTargetManager)}),this._loader.importMeshAsync(null,e,r,t,s,n,i).then(u=>(Array.prototype.push.apply(r.geometries,u.geometries),Array.prototype.push.apply(r.meshes,u.meshes),Array.prototype.push.apply(r.particleSystems,u.particleSystems),Array.prototype.push.apply(r.skeletons,u.skeletons),Array.prototype.push.apply(r.animationGroups,u.animationGroups),Array.prototype.push.apply(r.materials,o),Array.prototype.push.apply(r.textures,a),Array.prototype.push.apply(r.lights,u.lights),Array.prototype.push.apply(r.transformNodes,u.transformNodes),Array.prototype.push.apply(r.cameras,l),Array.prototype.push.apply(r.morphTargetManagers,h),r))})}canDirectLoad(e){return K.canDirectLoad(e)}directLoad(e,t){if(t.startsWith("base64,"+H)||t.startsWith(";base64,"+H)||t.startsWith("application/octet-stream;base64,"+H)||t.startsWith("model/gltf-binary;base64,"+H)){const s=ce(t);return this._validate(e,new Uint8Array(s,0,s.byteLength)),this._unpackBinaryAsync(new Q({readAsync:(n,i)=>he(s,n,i),byteLength:s.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})}createPlugin(e){return new R(e[K.name])}get loaderState(){return this._state}whenCompleteAsync(){return new Promise((e,t)=>{this.onCompleteObservable.addOnce(()=>{e()}),this.onErrorObservable.addOnce(s=>{t(s)})})}_setState(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(k[this._state]))}_loadFile(e,t,s,n,i,r){const o=e._loadFile(t,s,a=>{this._onProgress(a,o)},!0,n,i,r);return o.onCompleteObservable.add(()=>{o._lengthComputable=!0,o._total=o._loaded}),this._requests.push(o),o}_onProgress(e,t){if(!this._progressCallback)return;t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;let s=!0,n=0,i=0;for(const r of this._requests){if(r._lengthComputable===void 0||r._loaded===void 0||r._total===void 0)return;s=s&&r._lengthComputable,n+=r._loaded,i+=r._total}this._progressCallback({lengthComputable:s,loaded:n,total:s?i:0})}_validate(e,t,s="",n=""){this.validate&&(this._startPerformanceCounter("Validate JSON"),fe.ValidateAsync(t,s,n,i=>this.preprocessUrlAsync(s+i).then(r=>e._loadFileAsync(r,void 0,!0,!0).then(o=>new Uint8Array(o,0,o.byteLength)))).then(i=>{this._endPerformanceCounter("Validate JSON"),this.onValidatedObservable.notifyObservers(i),this.onValidatedObservable.clear()},i=>{this._endPerformanceCounter("Validate JSON"),S.Warn(`Failed to validate: ${i.message}`),this.onValidatedObservable.clear()}))}_getLoader(e){const t=e.json.asset||{};this._log(`Asset version: ${t.version}`),t.minVersion&&this._log(`Asset minimum version: ${t.minVersion}`),t.generator&&this._log(`Asset generator: ${t.generator}`);const s=R._parseVersion(t.version);if(!s)throw new Error("Invalid version: "+t.version);if(t.minVersion!==void 0){const r=R._parseVersion(t.minVersion);if(!r)throw new Error("Invalid minimum version: "+t.minVersion);if(R._compareVersion(r,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+t.minVersion)}const i={1:R._CreateGLTF1Loader,2:R._CreateGLTF2Loader}[s.major];if(!i)throw new Error("Unsupported version: "+t.version);return i(this)}_parseJson(e){this._startPerformanceCounter("Parse JSON"),this._log(`JSON length: ${e.length}`);const t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t}_unpackBinaryAsync(e){return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then(()=>{const t={Magic:1179937895},s=e.readUint32();if(s!==t.Magic)throw new Oe("Unexpected magic: "+s,Pe.GLTFLoaderUnexpectedMagicError);const n=e.readUint32();this.loggingEnabled&&this._log(`Binary version: ${n}`);const i=e.readUint32();!this.useRangeRequests&&i!==e.buffer.byteLength&&T.Warn(`Length in header does not match actual data length: ${i} != ${e.buffer.byteLength}`);let r;switch(n){case 1:{r=this._unpackBinaryV1Async(e,i);break}case 2:{r=this._unpackBinaryV2Async(e,i);break}default:throw new Error("Unsupported version: "+n)}return this._endPerformanceCounter("Unpack Binary"),r})}_unpackBinaryV1Async(e,t){const s={JSON:0},n=e.readUint32(),i=e.readUint32();if(i!==s.JSON)throw new Error(`Unexpected content format: ${i}`);const r=t-e.byteOffset,o={json:this._parseJson(e.readString(n)),bin:null};if(r!==0){const a=e.byteOffset;o.bin={readAsync:(l,h)=>e.buffer.readAsync(a+l,h),byteLength:r}}return Promise.resolve(o)}_unpackBinaryV2Async(e,t){const s={JSON:1313821514,BIN:5130562},n=e.readUint32();if(e.readUint32()!==s.JSON)throw new Error("First chunk format is not JSON");return e.byteOffset+n===t?e.loadAsync(n).then(()=>({json:this._parseJson(e.readString(n)),bin:null})):e.loadAsync(n+8).then(()=>{const r={json:this._parseJson(e.readString(n)),bin:null},o=()=>{const a=e.readUint32();switch(e.readUint32()){case s.JSON:throw new Error("Unexpected JSON chunk");case s.BIN:{const h=e.byteOffset;r.bin={readAsync:(u,d)=>e.buffer.readAsync(h+u,d),byteLength:a},e.skipBytes(a);break}default:{e.skipBytes(a);break}}return e.byteOffset!==t?e.loadAsync(8).then(o):Promise.resolve(r)};return o()})}static _parseVersion(e){if(e==="1.0"||e==="1.0.1")return{major:1,minor:0};const t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null}static _compareVersion(e,t){return e.major>t.major?1:e.majort.minor?1:e.minorG(()=>import("./animationGroup-R6N9NYXv.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),je=new _e(()=>G(()=>import("./glTFLoaderAnimation-DM5M4v5g.js"),__vite__mapDeps([5,1,2,3,6]),import.meta.url));class f{static Get(e,t,s){if(!t||s==null||!t[s])throw new Error(`${e}: Failed to find index (${s})`);return t[s]}static TryGet(e,t){return!e||t==null||!e[t]?null:e[t]}static Assign(e){if(e)for(let t=0;te.dispose&&e.dispose()),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())}async importMeshAsync(e,t,s,n,i,r,o=""){return await Promise.resolve().then(async()=>{this._babylonScene=t,this._assetContainer=s,this._loadData(n);let a=null;if(e){const l={};if(this._gltf.nodes)for(const u of this._gltf.nodes)u.name&&(l[u.name]=u.index);a=(e instanceof Array?e:[e]).map(u=>{const d=l[u];if(d===void 0)throw new Error(`Failed to find node '${u}'`);return d})}return await this._loadAsync(i,o,a,()=>({meshes:this._getMeshes(),particleSystems:[],skeletons:this._getSkeletons(),animationGroups:this._getAnimationGroups(),lights:this._babylonLights,transformNodes:this._getTransformNodes(),geometries:this._getGeometries(),spriteManagers:[]}))})}async loadAsync(e,t,s,n,i=""){return this._babylonScene=e,this._loadData(t),await this._loadAsync(s,i,null,()=>{})}async _loadAsync(e,t,s,n){return await Promise.resolve().then(async()=>{this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:`${e}${Date.now()}/`,this._fileName=t,this._allMaterialsDirtyRequired=!1,await this._loadExtensionsAsync(),!this.parent.skipMaterials&&this._pbrMaterialImpl==null&&(this.parent.useOpenPBR||this.isExtensionUsed("KHR_materials_openpbr")?this._pbrMaterialImpl={materialClass:(await G(async()=>{const{OpenPBRMaterial:h}=await import("./openpbrMaterial-D1CYjggx.js");return{OpenPBRMaterial:h}},__vite__mapDeps([7,2,3,1]),import.meta.url)).OpenPBRMaterial,adapterClass:(await G(async()=>{const{OpenPBRMaterialLoadingAdapter:h}=await import("./openpbrMaterialLoadingAdapter-DUmKUa7I.js");return{OpenPBRMaterialLoadingAdapter:h}},[],import.meta.url)).OpenPBRMaterialLoadingAdapter}:this._pbrMaterialImpl={materialClass:(await G(async()=>{const{PBRMaterial:h}=await import("./index-GY9JDBGV.js").then(u=>u.cw);return{PBRMaterial:h}},__vite__mapDeps([1,2,3]),import.meta.url)).PBRMaterial,adapterClass:(await G(async()=>{const{PBRMaterialLoadingAdapter:h}=await import("./pbrMaterialLoadingAdapter-DhdH9hHA.js");return{PBRMaterialLoadingAdapter:h}},__vite__mapDeps([8,1,2,3]),import.meta.url)).PBRMaterialLoadingAdapter});const i=`${k[k.LOADING]} => ${k[k.READY]}`,r=`${k[k.LOADING]} => ${k[k.COMPLETE]}`;this._parent._startPerformanceCounter(i),this._parent._startPerformanceCounter(r),this._parent._setState(k.LOADING),this._extensionsOnLoading();const o=new Array,a=this._babylonScene.blockMaterialDirtyMechanism;if(this._babylonScene.blockMaterialDirtyMechanism=!0,!this.parent.loadOnlyMaterials){if(s)o.push(this.loadSceneAsync("/nodes",{nodes:s,index:-1}));else if(this._gltf.scene!=null||this._gltf.scenes&&this._gltf.scenes[0]){const h=f.Get("/scene",this._gltf.scenes,this._gltf.scene||0);o.push(this.loadSceneAsync(`/scenes/${h.index}`,h))}}if(!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(let h=0;h{}))}return this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=a:this._babylonScene._forceBlockMaterialDirtyMechanism(a),this._parent.compileMaterials&&o.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&o.push(this._compileShadowGeneratorsAsync()),await Promise.all(o).then(()=>{this._rootBabylonMesh&&this._rootBabylonMesh!==this._parent.customRootNode&&this._rootBabylonMesh.setEnabled(!0);for(const h of this._babylonScene.materials){const u=h;u.maxSimultaneousLights!==void 0&&(u.maxSimultaneousLights=Math.max(u.maxSimultaneousLights,this._babylonScene.lights.length))}return this._extensionsOnReady(),this._parent._setState(k.READY),this._skipStartAnimationStep||this._startAnimations(),n()}).then(h=>(this._parent._endPerformanceCounter(i),S.SetImmediate(()=>{this._disposed||Promise.all(this._completePromises).then(()=>{this._parent._endPerformanceCounter(r),this._parent._setState(k.COMPLETE),this._parent.onCompleteObservable.notifyObservers(void 0),this._parent.onCompleteObservable.clear(),this.dispose()},u=>{this._parent.onErrorObservable.notifyObservers(u),this._parent.onErrorObservable.clear(),this.dispose()})}),h))}).catch(i=>{throw this._disposed||(this._parent.onErrorObservable.notifyObservers(i),this._parent.onErrorObservable.clear(),this.dispose()),i})}_loadData(e){if(this._gltf=e.json,this._setupData(),e.bin){const t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){const s=t[0];(s.byteLengthe.bin.byteLength)&&T.Warn(`Binary buffer length (${s.byteLength}) from JSON does not match chunk length (${e.bin.byteLength})`),this._bin=e.bin}else T.Warn("Unexpected BIN chunk")}}_setupData(){if(f.Assign(this._gltf.accessors),f.Assign(this._gltf.animations),f.Assign(this._gltf.buffers),f.Assign(this._gltf.bufferViews),f.Assign(this._gltf.cameras),f.Assign(this._gltf.images),f.Assign(this._gltf.materials),f.Assign(this._gltf.meshes),f.Assign(this._gltf.nodes),f.Assign(this._gltf.samplers),f.Assign(this._gltf.scenes),f.Assign(this._gltf.skins),f.Assign(this._gltf.textures),this._gltf.nodes){const e={};for(const s of this._gltf.nodes)if(s.children)for(const n of s.children)e[n]=s.index;const t=this._createRootNode();for(const s of this._gltf.nodes){const n=e[s.index];s.parent=n===void 0?t:this._gltf.nodes[n]}}}async _loadExtensionsAsync(){const e=[];if(Re.forEach((t,s)=>{this.parent.extensionOptions[s]?.enabled===!1?t.isGLTFExtension&&this.isExtensionUsed(s)&&T.Warn(`Extension ${s} is used but has been explicitly disabled.`):(!t.isGLTFExtension||this.isExtensionUsed(s))&&e.push((async()=>{const n=await t.factory(this);return n.name!==s&&T.Warn(`The name of the glTF loader extension instance does not match the registered name: ${n.name} !== ${s}`),this._parent.onExtensionLoadedObservable.notifyObservers(n),n})())}),this._extensions.push(...await Promise.all(e)),this._extensions.sort((t,s)=>(t.order||Number.MAX_VALUE)-(s.order||Number.MAX_VALUE)),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired){for(const t of this._gltf.extensionsRequired)if(!this._extensions.some(n=>n.name===t&&n.enabled))throw this.parent.extensionOptions[t]?.enabled===!1?new Error(`Required extension ${t} is disabled`):new Error(`Required extension ${t} is not available`)}}_createRootNode(){if(this._parent.customRootNode!==void 0)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:this._rootBabylonMesh===null?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;const e=new oe("__root__",this._babylonScene);this._rootBabylonMesh=e,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);const t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case Y.AUTO:{this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],A._LoadTransform(t,this._rootBabylonMesh));break}case Y.FORCE_RIGHT_HANDED:{this._babylonScene.useRightHandedSystem=!0;break}default:throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`)}return this._parent.onMeshLoadedObservable.notifyObservers(e),t}loadSceneAsync(e,t){const s=this._extensionsLoadSceneAsync(e,t);if(s)return s;const n=new Array;if(this.logOpen(`${e} ${t.name||""}`),t.nodes)for(const i of t.nodes){const r=f.Get(`${e}/nodes/${i}`,this._gltf.nodes,i);n.push(this.loadNodeAsync(`/nodes/${r.index}`,r,o=>{o.parent=this._rootBabylonMesh}))}for(const i of this._postSceneLoadActions)i();return n.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(n).then(()=>{})}_forEachPrimitive(e,t){if(e._primitiveBabylonMeshes)for(const s of e._primitiveBabylonMeshes)t(s)}_getGeometries(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,n=>{const i=n.geometry;i&&e.indexOf(i)===-1&&e.push(i)});return e}_getMeshes(){const e=[];this._rootBabylonMesh instanceof Ie&&e.push(this._rootBabylonMesh);const t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,n=>{e.push(n)});return e}_getTransformNodes(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)s._babylonTransformNode&&s._babylonTransformNode.getClassName()==="TransformNode"&&e.push(s._babylonTransformNode),s._babylonTransformNodeForSkin&&e.push(s._babylonTransformNodeForSkin);return e}_getSkeletons(){const e=[],t=this._gltf.skins;if(t)for(const s of t)s._data&&e.push(s._data.babylonSkeleton);return e}_getAnimationGroups(){const e=[],t=this._gltf.animations;if(t)for(const s of t)s._babylonAnimationGroup&&e.push(s._babylonAnimationGroup);return e}_startAnimations(){switch(this._parent.animationStartMode){case W.NONE:break;case W.FIRST:{const e=this._getAnimationGroups();e.length!==0&&e[0].start(!0);break}case W.ALL:{const e=this._getAnimationGroups();for(const t of e)t.start(!0);break}default:{T.Error(`Invalid animation start mode (${this._parent.animationStartMode})`);return}}}loadNodeAsync(e,t,s=()=>{}){const n=this._extensionsLoadNodeAsync(e,t,s);if(n)return n;if(t._babylonTransformNode)throw new Error(`${e}: Invalid recursive node hierarchy`);const i=new Array;this.logOpen(`${e} ${t.name||""}`);const r=l=>{if(A.AddPointerMetadata(l,e),A._LoadTransform(t,l),t.camera!=null){const h=f.Get(`${e}/camera`,this._gltf.cameras,t.camera);i.push(this.loadCameraAsync(`/cameras/${h.index}`,h,u=>{u.parent=l,this._babylonScene.useRightHandedSystem||(l.scaling.x=-1)}))}if(t.children)for(const h of t.children){const u=f.Get(`${e}/children/${h}`,this._gltf.nodes,h);i.push(this.loadNodeAsync(`/nodes/${u.index}`,u,d=>{d.parent=l}))}s(l)},o=t.mesh!=null,a=this._parent.loadSkins&&t.skin!=null;if(!o||a){const l=t.name||`node${t.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const h=new ae(l,this._babylonScene);h._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t.mesh==null?t._babylonTransformNode=h:t._babylonTransformNodeForSkin=h,r(h)}if(o)if(a){const l=f.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${l.index}`,t,l,h=>{const u=t._babylonTransformNodeForSkin;h.metadata=Le(u.metadata,h.metadata||{});const d=f.Get(`${e}/skin`,this._gltf.skins,t.skin);i.push(this._loadSkinAsync(`/skins/${d.index}`,t,d,p=>{this._forEachPrimitive(t,_=>{_.skeleton=p}),this._postSceneLoadActions.push(()=>{if(d.skeleton!=null){const _=f.Get(`/skins/${d.index}/skeleton`,this._gltf.nodes,d.skeleton).parent;t.index===_.index?h.parent=u.parent:h.parent=_._babylonTransformNode}else h.parent=this._rootBabylonMesh;this._parent.onSkinLoadedObservable.notifyObservers({node:u,skinnedNode:h})})}))}))}else{const l=f.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${l.index}`,t,l,r))}return this.logClose(),Promise.all(i).then(()=>(this._forEachPrimitive(t,l=>{const h=l;!h.isAnInstance&&h.geometry&&h.geometry.useBoundingInfoFromGeometry?l._updateBoundingInfo():l.refreshBoundingInfo(!0,!0)}),t._babylonTransformNode))}_loadMeshAsync(e,t,s,n){const i=s.primitives;if(!i||!i.length)throw new Error(`${e}: Primitives are missing`);i[0].index==null&&f.Assign(i);const r=new Array;this.logOpen(`${e} ${s.name||""}`);const o=t.name||`node${t.index}`;if(i.length===1){const a=s.primitives[0];r.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${a.index}`,o,t,s,a,l=>{t._babylonTransformNode=l,t._primitiveBabylonMeshes=[l]}))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new ae(o,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(const a of i)r.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${a.index}`,`${o}_primitive${a.index}`,t,s,a,l=>{l.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(l)}))}return n(t._babylonTransformNode),this.logClose(),Promise.all(r).then(()=>t._babylonTransformNode)}_loadMeshPrimitiveAsync(e,t,s,n,i,r){const o=this._extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,r);if(o)return o;this.logOpen(`${e}`);const a=this._disableInstancedMesh===0&&this._parent.createInstances&&s.skin==null&&!n.primitives[0].targets;let l,h;if(a&&i._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,l=i._instanceData.babylonSourceMesh.createInstance(t),l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,h=i._instanceData.promise;else{const u=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;const d=new oe(t,this._babylonScene);if(d._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,d.sideOrientation=this._babylonScene.useRightHandedSystem?$.CounterClockWiseSideOrientation:$.ClockWiseSideOrientation,this._createMorphTargets(e,s,n,i,d),u.push(this._loadVertexDataAsync(e,i,d).then(async p=>await this._loadMorphTargetsAsync(e,i,d,p).then(()=>{this._disposed||(this._babylonScene._blockEntityCollection=!!this._assetContainer,p.applyToMesh(d),p._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1)}))),!this.parent.skipMaterials){const p=A._GetDrawMode(e,i.mode);if(i.material==null){let _=this._defaultBabylonMaterialData[p];_||(_=this._createDefaultMaterial("__GLTFLoader._default",p),this._parent.onMaterialLoadedObservable.notifyObservers(_),this._defaultBabylonMaterialData[p]=_),d.material=_}else{const _=f.Get(`${e}/material`,this._gltf.materials,i.material);u.push(this._loadMaterialAsync(`/materials/${_.index}`,_,d,p,O=>{d.material=O}))}}h=Promise.all(u),a&&(i._instanceData={babylonSourceMesh:d,promise:h}),l=d}return A.AddPointerMetadata(l,e),this._parent.onMeshLoadedObservable.notifyObservers(l),r(l),this.logClose(),h.then(()=>l)}_loadVertexDataAsync(e,t,s){const n=this._extensionsLoadVertexDataAsync(e,t,s);if(n)return n;const i=t.attributes;if(!i)throw new Error(`${e}: Attributes are missing`);const r=new Array,o=new De(s.name,this._babylonScene);if(t.indices==null)s.isUnIndexed=!0;else{const l=f.Get(`${e}/indices`,this._gltf.accessors,t.indices);r.push(this._loadIndicesAccessorAsync(`/accessors/${l.index}`,l).then(h=>{o.setIndices(h)}))}const a=(l,h,u)=>{if(i[l]==null)return;s._delayInfo=s._delayInfo||[],s._delayInfo.indexOf(h)===-1&&s._delayInfo.push(h);const d=f.Get(`${e}/attributes/${l}`,this._gltf.accessors,i[l]);r.push(this._loadVertexAccessorAsync(`/accessors/${d.index}`,d,h).then(p=>{if(p.getKind()===m.PositionKind&&!this.parent.alwaysComputeBoundingBox&&!s.skeleton){const _=et(d);_&&(o._boundingInfo=_,o.useBoundingInfoFromGeometry=!0)}o.setVerticesBuffer(p,d.count)})),h==m.MatricesIndicesExtraKind&&(s.numBoneInfluencers=8),u&&u(d)};return a("POSITION",m.PositionKind),a("NORMAL",m.NormalKind),a("TANGENT",m.TangentKind),a("TEXCOORD_0",m.UVKind),a("TEXCOORD_1",m.UV2Kind),a("TEXCOORD_2",m.UV3Kind),a("TEXCOORD_3",m.UV4Kind),a("TEXCOORD_4",m.UV5Kind),a("TEXCOORD_5",m.UV6Kind),a("JOINTS_0",m.MatricesIndicesKind),a("WEIGHTS_0",m.MatricesWeightsKind),a("JOINTS_1",m.MatricesIndicesExtraKind),a("WEIGHTS_1",m.MatricesWeightsExtraKind),a("COLOR_0",m.ColorKind,l=>{l.type==="VEC4"&&(s.hasVertexAlpha=!0)}),Promise.all(r).then(()=>o)}_createMorphTargets(e,t,s,n,i){if(!n.targets||!this._parent.loadMorphTargets)return;if(t._numMorphTargets==null)t._numMorphTargets=n.targets.length;else if(n.targets.length!==t._numMorphTargets)throw new Error(`${e}: Primitives do not have the same number of targets`);const r=s.extras?s.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,i.morphTargetManager=new L(this._babylonScene),i.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,i.morphTargetManager.areUpdatesFrozen=!0;for(let o=0;o{r.areUpdatesFrozen=!1})}async _loadMorphTargetVertexDataAsync(e,t,s,n){const i=new Array,r=(o,a,l)=>{if(s[o]==null)return;const h=t.getVertexBuffer(a);if(!h)return;const u=f.Get(`${e}/${o}`,this._gltf.accessors,s[o]);i.push(this._loadFloatAccessorAsync(`/accessors/${u.index}`,u).then(d=>{l(h,d)}))};return r("POSITION",m.PositionKind,(o,a)=>{const l=new Float32Array(a.length);o.forEach(a.length,(h,u)=>{l[u]=a[u]+h}),n.setPositions(l)}),r("NORMAL",m.NormalKind,(o,a)=>{const l=new Float32Array(a.length);o.forEach(l.length,(h,u)=>{l[u]=a[u]+h}),n.setNormals(l)}),r("TANGENT",m.TangentKind,(o,a)=>{const l=new Float32Array(a.length/3*4);let h=0;o.forEach(a.length/3*4,(u,d)=>{(d+1)%4!==0&&(l[h]=a[h]+u,h++)}),n.setTangents(l)}),r("TEXCOORD_0",m.UVKind,(o,a)=>{const l=new Float32Array(a.length);o.forEach(a.length,(h,u)=>{l[u]=a[u]+h}),n.setUVs(l)}),r("TEXCOORD_1",m.UV2Kind,(o,a)=>{const l=new Float32Array(a.length);o.forEach(a.length,(h,u)=>{l[u]=a[u]+h}),n.setUV2s(l)}),r("COLOR_0",m.ColorKind,(o,a)=>{let l=null;const h=o.getSize();if(h===3){l=new Float32Array(a.length/3*4),o.forEach(a.length,(u,d)=>{const p=Math.floor(d/3),_=d%3;l[4*p+_]=a[3*p+_]+u});for(let u=0;u{l[d]=a[d]+u});else throw new Error(`${e}: Invalid number of components (${h}) for COLOR_0 attribute`);n.setColors(l)}),await Promise.all(i).then(()=>{})}static _LoadTransform(e,t){if(e.skin!=null)return;let s=v.Zero(),n=q.Identity(),i=v.One();e.matrix?B.FromArray(e.matrix).decompose(i,n,s):(e.translation&&(s=v.FromArray(e.translation)),e.rotation&&(n=q.FromArray(e.rotation)),e.scale&&(i=v.FromArray(e.scale))),t.position=s,t.rotationQuaternion=n,t.scaling=i}_loadSkinAsync(e,t,s,n){if(!this._parent.loadSkins)return Promise.resolve();const i=this._extensionsLoadSkinAsync(e,t,s);if(i)return i;if(s._data)return n(s._data.babylonSkeleton),s._data.promise;const r=`skeleton${s.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const o=new Ye(s.name||r,r,this._babylonScene);o._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,s,o);const a=this._loadSkinInverseBindMatricesDataAsync(e,s).then(l=>{this._updateBoneMatrices(o,l)});return s._data={babylonSkeleton:o,promise:a},n(o),a}_loadBones(e,t,s){if(t.skeleton==null||this._parent.alwaysComputeSkeletonRootNode){const i=this._findSkeletonRootNode(`${e}/joints`,t.joints);if(i)if(t.skeleton===void 0)t.skeleton=i.index;else{const r=(a,l)=>{for(;l.parent;l=l.parent)if(l.parent===a)return!0;return!1},o=f.Get(`${e}/skeleton`,this._gltf.nodes,t.skeleton);o!==i&&!r(o,i)&&(T.Warn(`${e}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`),t.skeleton=i.index)}else T.Warn(`${e}: Failed to find common root`)}const n={};for(const i of t.joints){const r=f.Get(`${e}/joints/${i}`,this._gltf.nodes,i);this._loadBone(r,t,s,n)}}_findSkeletonRootNode(e,t){if(t.length===0)return null;const s={};for(const i of t){const r=[];let o=f.Get(`${e}/${i}`,this._gltf.nodes,i);for(;o.index!==-1;)r.unshift(o),o=o.parent;s[i]=r}let n=null;for(let i=0;;++i){let r=s[t[0]];if(i>=r.length)return n;const o=r[i];for(let a=1;a=r.length||o!==r[i])return n;n=o}}_loadBone(e,t,s,n){e._isJoint=!0;let i=n[e.index];if(i)return i;let r=null;e.index!==t.skeleton&&(e.parent&&e.parent.index!==-1?r=this._loadBone(e.parent,t,s,n):t.skeleton!==void 0&&T.Warn(`/skins/${t.index}/skeleton: Skeleton node is not a common root`));const o=t.joints.indexOf(e.index);return i=new Xe(e.name||`joint${e.index}`,s,r,this._getNodeMatrix(e),null,null,o),n[e.index]=i,this._postSceneLoadActions.push(()=>{i.linkTransformNode(e._babylonTransformNode)}),i}_loadSkinInverseBindMatricesDataAsync(e,t){if(t.inverseBindMatrices==null)return Promise.resolve(null);const s=f.Get(`${e}/inverseBindMatrices`,this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync(`/accessors/${s.index}`,s)}_updateBoneMatrices(e,t){for(const s of e.bones){const n=B.Identity(),i=s._index;t&&i!==-1&&(B.FromArrayToRef(t,i*16,n),n.invertToRef(n));const r=s.getParent();r&&n.multiplyToRef(r.getAbsoluteInverseBindMatrix(),n),s.updateMatrix(n,!1,!1),s._updateAbsoluteBindMatrices(void 0,!1)}}_getNodeMatrix(e){return e.matrix?B.FromArray(e.matrix):B.Compose(e.scale?v.FromArray(e.scale):v.One(),e.rotation?q.FromArray(e.rotation):q.Identity(),e.translation?v.FromArray(e.translation):v.Zero())}loadCameraAsync(e,t,s=()=>{}){const n=this._extensionsLoadCameraAsync(e,t,s);if(n)return n;const i=new Array;this.logOpen(`${e} ${t.name||""}`),this._babylonScene._blockEntityCollection=!!this._assetContainer;const r=new X(t.name||`camera${t.index}`,v.Zero(),this._babylonScene,!1);switch(r._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonCamera=r,r.setTarget(new v(0,0,-1)),t.type){case"perspective":{const o=t.perspective;if(!o)throw new Error(`${e}: Camera perspective properties are missing`);r.fov=o.yfov,r.minZ=o.znear,r.maxZ=o.zfar||0;break}case"orthographic":{if(!t.orthographic)throw new Error(`${e}: Camera orthographic properties are missing`);r.mode=Ne.ORTHOGRAPHIC_CAMERA,r.orthoLeft=-t.orthographic.xmag,r.orthoRight=t.orthographic.xmag,r.orthoBottom=-t.orthographic.ymag,r.orthoTop=t.orthographic.ymag,r.minZ=t.orthographic.znear,r.maxZ=t.orthographic.zfar;break}default:throw new Error(`${e}: Invalid camera type (${t.type})`)}return A.AddPointerMetadata(r,e),this._parent.onCameraLoadedObservable.notifyObservers(r),s(r),this.logClose(),Promise.all(i).then(()=>r)}_loadAnimationsAsync(){this._parent._startPerformanceCounter("Load animations");const e=this._gltf.animations;if(!e)return Promise.resolve();const t=new Array;for(let s=0;s{i.targetedAnimations.length===0&&i.dispose()}))}return Promise.all(t).then(()=>{this._parent._endPerformanceCounter("Load animations")})}loadAnimationAsync(e,t){this._parent._startPerformanceCounter("Load animation");const s=this._extensionsLoadAnimationAsync(e,t);return s||Qe.value.then(({AnimationGroup:n})=>{this._babylonScene._blockEntityCollection=!!this._assetContainer;const i=new n(t.name||`animation${t.index}`,this._babylonScene);i._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=i;const r=new Array;f.Assign(t.channels),f.Assign(t.samplers);for(const o of t.channels)r.push(this._loadAnimationChannelAsync(`${e}/channels/${o.index}`,e,t,o,(a,l)=>{a.animations=a.animations||[],a.animations.push(l),i.addTargetedAnimation(l,a)}));return this._parent._endPerformanceCounter("Load animation"),Promise.all(r).then(()=>(i.normalize(0),i))})}_loadAnimationChannelAsync(e,t,s,n,i){const r=this._extensionsLoadAnimationChannelAsync(e,t,s,n,i);if(r)return r;if(n.target.node==null)return Promise.resolve();const o=f.Get(`${e}/target/node`,this._gltf.nodes,n.target.node),a=n.target.path,l=a==="weights";return l&&!o._numMorphTargets||!l&&!o._babylonTransformNode||!this._parent.loadNodeAnimations&&!l&&!o._isJoint?Promise.resolve():je.value.then(()=>{let h;switch(a){case"translation":{h=J("/nodes/{}/translation")?.interpolation;break}case"rotation":{h=J("/nodes/{}/rotation")?.interpolation;break}case"scale":{h=J("/nodes/{}/scale")?.interpolation;break}case"weights":{h=J("/nodes/{}/weights")?.interpolation;break}default:throw new Error(`${e}/target/path: Invalid value (${n.target.path})`)}if(!h)throw new Error(`${e}/target/path: Could not find interpolation properties for target path (${n.target.path})`);const u={object:o,info:h};return this._loadAnimationChannelFromTargetInfoAsync(e,t,s,n,u,i)})}_loadAnimationChannelFromTargetInfoAsync(e,t,s,n,i,r){const o=this.parent.targetFps,a=1/o,l=f.Get(`${e}/sampler`,s.samplers,n.sampler);return this._loadAnimationSamplerAsync(`${t}/samplers/${n.sampler}`,l).then(h=>{let u=0;const d=i.object,p=i.info;for(const _ of p){const O=_.getStride(d),M=h.input,V=h.output,N=new Array(M.length);let P=0;switch(h.interpolation){case"STEP":{for(let C=0;C0){const C=`${s.name||`animation${s.index}`}_channel${n.index}_${u}`,U=_.buildAnimations(d,C,o,N);for(const Z of U)u++,r(Z.babylonAnimatable,Z.babylonAnimation)}}})}_loadAnimationSamplerAsync(e,t){if(t._data)return t._data;const s=t.interpolation||"LINEAR";switch(s){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(`${e}/interpolation: Invalid value (${t.interpolation})`)}const n=f.Get(`${e}/input`,this._gltf.accessors,t.input),i=f.Get(`${e}/output`,this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync(`/accessors/${n.index}`,n),this._loadFloatAccessorAsync(`/accessors/${i.index}`,i)]).then(([r,o])=>({input:r,interpolation:s,output:o})),t._data}loadBufferAsync(e,t,s,n){const i=this._extensionsLoadBufferAsync(e,t,s,n);if(i)return i;if(!t._data)if(t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{if(!this._bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then(r=>{try{return new Uint8Array(r.buffer,r.byteOffset+s,n)}catch(o){throw new Error(`${e}: ${o.message}`)}})}loadBufferViewAsync(e,t){const s=this._extensionsLoadBufferViewAsync(e,t);if(s)return s;if(t._data)return t._data;const n=f.Get(`${e}/buffer`,this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync(`/buffers/${n.index}`,n,t.byteOffset||0,t.byteLength),t._data}_loadAccessorAsync(e,t,s){if(t._data)return t._data;const n=A._GetNumComponents(e,t.type),i=n*m.GetTypeByteLength(t.componentType),r=n*t.count;if(t.bufferView==null)t._data=Promise.resolve(new s(r));else{const o=f.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${o.index}`,o).then(a=>{if(t.componentType===5126&&!t.normalized&&(!o.byteStride||o.byteStride===i))return A._GetTypedArray(e,t.componentType,a,t.byteOffset,r);{const l=new s(r);return m.ForEach(a,t.byteOffset||0,o.byteStride||i,n,t.componentType,l.length,t.normalized||!1,(h,u)=>{l[u]=h}),l}})}if(t.sparse){const o=t.sparse;t._data=t._data.then(a=>{const l=a,h=f.Get(`${e}/sparse/indices/bufferView`,this._gltf.bufferViews,o.indices.bufferView),u=f.Get(`${e}/sparse/values/bufferView`,this._gltf.bufferViews,o.values.bufferView);return Promise.all([this.loadBufferViewAsync(`/bufferViews/${h.index}`,h),this.loadBufferViewAsync(`/bufferViews/${u.index}`,u)]).then(([d,p])=>{const _=A._GetTypedArray(`${e}/sparse/indices`,o.indices.componentType,d,o.indices.byteOffset,o.count),O=n*o.count;let M;if(t.componentType===5126&&!t.normalized)M=A._GetTypedArray(`${e}/sparse/values`,t.componentType,p,o.values.byteOffset,O);else{const N=A._GetTypedArray(`${e}/sparse/values`,t.componentType,p,o.values.byteOffset,O);M=new s(O),m.ForEach(N,0,i,n,t.componentType,M.length,t.normalized||!1,(P,C)=>{M[C]=P})}let V=0;for(let N=0;N<_.length;N++){let P=_[N]*n;for(let C=0;CA._GetTypedArray(e,t.componentType,n,t.byteOffset,t.count))}return t._data}_loadVertexBufferViewAsync(e){if(e._babylonBuffer)return e._babylonBuffer;const t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync(`/bufferViews/${e.index}`,e).then(s=>new $e(t,s,!1)),e._babylonBuffer}_loadVertexAccessorAsync(e,t,s){if(t._babylonVertexBuffer?.[s])return t._babylonVertexBuffer[s];t._babylonVertexBuffer||(t._babylonVertexBuffer={});const n=this._babylonScene.getEngine();if(t.sparse||t.bufferView==null)t._babylonVertexBuffer[s]=this._loadFloatAccessorAsync(e,t).then(i=>new m(n,i,s,!1));else{const i=f.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._babylonVertexBuffer[s]=this._loadVertexBufferViewAsync(i).then(r=>{const o=A._GetNumComponents(e,t.type);return new m(n,r,s,!1,void 0,i.byteStride,void 0,t.byteOffset,o,t.componentType,t.normalized,!0,void 0,!0)})}return t._babylonVertexBuffer[s]}_loadMaterialMetallicRoughnessPropertiesAsync(e,t,s){const n=new Array,i=this._getOrCreateMaterialAdapter(s);return t&&(t.baseColorFactor?(i.baseColor=z.FromArray(t.baseColorFactor),i.geometryOpacity=t.baseColorFactor[3]):i.baseColor=z.White(),i.baseMetalness=t.metallicFactor==null?1:t.metallicFactor,i.specularRoughness=t.roughnessFactor==null?1:t.roughnessFactor,t.baseColorTexture&&n.push(this.loadTextureInfoAsync(`${e}/baseColorTexture`,t.baseColorTexture,r=>{r.name=`${s.name} (Base Color)`,i.baseColorTexture=r})),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/metallicRoughnessTexture`,t.metallicRoughnessTexture,r=>{r.name=`${s.name} (Metallic Roughness)`,i.baseMetalnessTexture=r,i.specularRoughnessTexture=r})),i.useRoughnessFromMetallicTextureGreen=!0,i.useMetallicFromMetallicTextureBlue=!0)),Promise.all(n).then(()=>{})}_loadMaterialAsync(e,t,s,n,i=()=>{}){const r=this._extensionsLoadMaterialAsync(e,t,s,n,i);if(r)return r;t._data=t._data||{};let o=t._data[n];if(!o){this.logOpen(`${e} ${t.name||""}`);const a=this.createMaterial(e,t,n);o={babylonMaterial:a,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(e,t,a)},t._data[n]=o,A.AddPointerMetadata(a,e),this._parent.onMaterialLoadedObservable.notifyObservers(a),this.logClose()}return s&&(o.babylonMeshes.push(s),s.onDisposeObservable.addOnce(()=>{const a=o.babylonMeshes.indexOf(s);a!==-1&&o.babylonMeshes.splice(a,1)})),i(o.babylonMaterial),o.promise.then(()=>o.babylonMaterial)}_createDefaultMaterial(e,t){if(!this._pbrMaterialImpl)throw new Error("PBR Material class not loaded");this._babylonScene._blockEntityCollection=!!this._assetContainer;const s=new this._pbrMaterialImpl.materialClass(e,this._babylonScene);s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,s.fillMode=t,s.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE;const n=this._getOrCreateMaterialAdapter(s);return n.transparencyAsAlphaCoverage=this._parent.transparencyAsCoverage,n.baseMetalness=1,n.specularRoughness=1,s}createMaterial(e,t,s){const n=this._extensionsCreateMaterial(e,t,s);if(n)return n;const i=t.name||`material${t.index}`;return this._createDefaultMaterial(i,s)}loadMaterialPropertiesAsync(e,t,s){const n=this._extensionsLoadMaterialPropertiesAsync(e,t,s);if(n)return n;const i=new Array;return i.push(this.loadMaterialBasePropertiesAsync(e,t,s)),t.pbrMetallicRoughness&&i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${e}/pbrMetallicRoughness`,t.pbrMetallicRoughness,s)),this.loadMaterialAlphaProperties(e,t,s),Promise.all(i).then(()=>{})}loadMaterialBasePropertiesAsync(e,t,s){const n=new Array,i=this._getOrCreateMaterialAdapter(s);i.emissionColor=t.emissiveFactor?z.FromArray(t.emissiveFactor):new z(0,0,0),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/normalTexture`,t.normalTexture,l=>{l.name=`${s.name} (Normal)`,i.geometryNormalTexture=l,t.normalTexture?.scale!=null&&(l.level=t.normalTexture.scale)})),i.setNormalMapInversions(!this._babylonScene.useRightHandedSystem,this._babylonScene.useRightHandedSystem));let r,o=1,a;return t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/occlusionTexture`,t.occlusionTexture,l=>{l.name=`${s.name} (Occlusion)`,r=l})),t.occlusionTexture.strength!=null&&(o=t.occlusionTexture.strength)),t.emissiveTexture&&n.push(this.loadTextureInfoAsync(`${e}/emissiveTexture`,t.emissiveTexture,l=>{l.name=`${s.name} (Emissive)`,a=l})),Promise.all(n).then(()=>{r&&(i.ambientOcclusionTexture=r,i.ambientOcclusionTextureStrength=o),a&&(i.emissionColorTexture=a)})}loadMaterialAlphaProperties(e,t,s){if(!this._pbrMaterialImpl)throw new Error(`${e}: Material type not supported`);const n=this._getOrCreateMaterialAdapter(s),i=n.baseColorTexture;switch(t.alphaMode||"OPAQUE"){case"OPAQUE":{s.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE,s.alpha=1;break}case"MASK":{s.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHATEST,n.alphaCutOff=t.alphaCutoff==null?.5:t.alphaCutoff,i&&(i.hasAlpha=!0);break}case"BLEND":{s.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHABLEND,i&&(i.hasAlpha=!0,n.useAlphaFromBaseColorTexture=!0);break}default:throw new Error(`${e}/alphaMode: Invalid value (${t.alphaMode})`)}}loadTextureInfoAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureInfoAsync(e,t,s);if(n)return n;if(this.logOpen(`${e}`),t.texCoord>=6)throw new Error(`${e}/texCoord: Invalid value (${t.texCoord})`);const i=f.Get(`${e}/index`,this._gltf.textures,t.index);i._textureInfo=t;const r=this._loadTextureAsync(`/textures/${t.index}`,i,o=>{o.coordinatesIndex=t.texCoord||0,A.AddPointerMetadata(o,e),this._parent.onTextureLoadedObservable.notifyObservers(o),s(o)});return this.logClose(),r}_loadTextureAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureAsync(e,t,s);if(n)return n;this.logOpen(`${e} ${t.name||""}`);const i=t.sampler==null?A.DefaultSampler:f.Get(`${e}/sampler`,this._gltf.samplers,t.sampler),r=f.Get(`${e}/source`,this._gltf.images,t.source),o=this._createTextureAsync(e,i,r,s,void 0,!t._textureInfo.nonColorData);return this.logClose(),o}_createTextureAsync(e,t,s,n=()=>{},i,r){const o=this._loadSampler(`/samplers/${t.index}`,t),a=new Array,l=new Ve;this._babylonScene._blockEntityCollection=!!this._assetContainer;const h={noMipmap:o.noMipMaps,invertY:!1,samplingMode:o.samplingMode,onLoad:()=>{this._disposed||l.resolve()},onError:(d,p)=>{this._disposed||l.reject(new Error(`${e}: ${p&&p.message?p.message:d||"Failed to load texture"}`))},mimeType:s.mimeType??Ue(s.uri??""),loaderOptions:i,useSRGBBuffer:!!r&&this._parent.useSRGBBuffers},u=new w(null,this._babylonScene,h);return u._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.push(l.promise),a.push(this.loadImageAsync(`/images/${s.index}`,s).then(d=>{const p=s.uri||`${this._fileName}#image${s.index}`,_=`data:${this._uniqueRootUrl}${p}`;u.updateURL(_,d);const O=u.getInternalTexture();O&&(O.label=s.name)})),u.wrapU=o.wrapU,u.wrapV=o.wrapV,n(u),this._parent.useGltfTextureNames&&(u.name=s.name||s.uri||`image${s.index}`),Promise.all(a).then(()=>u)}_loadSampler(e,t){return t._data||(t._data={noMipMaps:t.minFilter===9728||t.minFilter===9729,samplingMode:A._GetTextureSamplingMode(e,t),wrapU:A._GetTextureWrapMode(`${e}/wrapS`,t.wrapS),wrapV:A._GetTextureWrapMode(`${e}/wrapT`,t.wrapT)}),t._data}loadImageAsync(e,t){if(!t._data){if(this.logOpen(`${e} ${t.name||""}`),t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{const s=f.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}this.logClose()}return t._data}loadUriAsync(e,t,s){const n=this._extensionsLoadUriAsync(e,t,s);if(n)return n;if(!A._ValidateUri(s))throw new Error(`${e}: '${s}' is invalid`);if(Be(s)){const i=new Uint8Array(ce(s));return this.log(`${e}: Decoded ${s.substring(0,64)}... (${i.length} bytes)`),Promise.resolve(i)}return this.log(`${e}: Loading ${s}`),this._parent.preprocessUrlAsync(this._rootUrl+s).then(i=>new Promise((r,o)=>{this._parent._loadFile(this._babylonScene,i,a=>{this._disposed||(this.log(`${e}: Loaded ${s} (${a.byteLength} bytes)`),r(new Uint8Array(a)))},!0,a=>{o(new Fe(`${e}: Failed to load '${s}'${a?": "+a.status+" "+a.statusText:""}`,a))})}))}static AddPointerMetadata(e,t){e.metadata=e.metadata||{};const s=e._internalMetadata=e._internalMetadata||{},n=s.gltf=s.gltf||{};(n.pointers=n.pointers||[]).push(t)}static _GetTextureWrapMode(e,t){switch(t=t??10497,t){case 33071:return w.CLAMP_ADDRESSMODE;case 33648:return w.MIRROR_ADDRESSMODE;case 10497:return w.WRAP_ADDRESSMODE;default:return T.Warn(`${e}: Invalid value (${t})`),w.WRAP_ADDRESSMODE}}static _GetTextureSamplingMode(e,t){const s=t.magFilter==null?9729:t.magFilter,n=t.minFilter==null?9987:t.minFilter;if(s===9729)switch(n){case 9728:return w.LINEAR_NEAREST;case 9729:return w.LINEAR_LINEAR;case 9984:return w.LINEAR_NEAREST_MIPNEAREST;case 9985:return w.LINEAR_LINEAR_MIPNEAREST;case 9986:return w.LINEAR_NEAREST_MIPLINEAR;case 9987:return w.LINEAR_LINEAR_MIPLINEAR;default:return T.Warn(`${e}/minFilter: Invalid value (${n})`),w.LINEAR_LINEAR_MIPLINEAR}else switch(s!==9728&&T.Warn(`${e}/magFilter: Invalid value (${s})`),n){case 9728:return w.NEAREST_NEAREST;case 9729:return w.NEAREST_LINEAR;case 9984:return w.NEAREST_NEAREST_MIPNEAREST;case 9985:return w.NEAREST_LINEAR_MIPNEAREST;case 9986:return w.NEAREST_NEAREST_MIPLINEAR;case 9987:return w.NEAREST_LINEAR_MIPLINEAR;default:return T.Warn(`${e}/minFilter: Invalid value (${n})`),w.NEAREST_NEAREST_MIPNEAREST}}static _GetTypedArrayConstructor(e,t){try{return Ge(t)}catch(s){throw new Error(`${e}: ${s.message}`)}}static _GetTypedArray(e,t,s,n,i){const r=s.buffer;n=s.byteOffset+(n||0);const o=A._GetTypedArrayConstructor(`${e}/componentType`,t),a=m.GetTypeByteLength(t);return n%a!==0?(T.Warn(`${e}: Copying buffer as byte offset (${n}) is not a multiple of component type byte length (${a})`),new o(r.slice(n,n+i*a),0)):new o(r,n,i)}static _GetNumComponents(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error(`${e}: Invalid type (${t})`)}static _ValidateUri(e){return S.IsBase64(e)||e.indexOf("..")===-1}static _GetDrawMode(e,t){switch(t==null&&(t=4),t){case 0:return $.PointListDrawMode;case 1:return $.LineListDrawMode;case 2:return $.LineLoopDrawMode;case 3:return $.LineStripDrawMode;case 4:return $.TriangleFillMode;case 5:return $.TriangleStripDrawMode;case 6:return $.TriangleFanDrawMode}throw new Error(`${e}: Invalid mesh primitive mode (${t})`)}_compileMaterialsAsync(){this._parent._startPerformanceCounter("Compile materials");const e=new Array;if(this._gltf.materials){for(const t of this._gltf.materials)if(t._data)for(const s in t._data){const n=t._data[s];for(const i of n.babylonMeshes){i.computeWorldMatrix(!0);const r=n.babylonMaterial;e.push(r.forceCompilationAsync(i)),e.push(r.forceCompilationAsync(i,{useInstances:!0})),this._parent.useClipPlane&&(e.push(r.forceCompilationAsync(i,{clipPlane:!0})),e.push(r.forceCompilationAsync(i,{clipPlane:!0,useInstances:!0})))}}}return Promise.all(e).then(()=>{this._parent._endPerformanceCounter("Compile materials")})}_compileShadowGeneratorsAsync(){this._parent._startPerformanceCounter("Compile shadow generators");const e=new Array,t=this._babylonScene.lights;for(const s of t){const n=s.getShadowGenerator();n&&e.push(n.forceCompilationAsync())}return Promise.all(e).then(()=>{this._parent._endPerformanceCounter("Compile shadow generators")})}_forEachExtensions(e){for(const t of this._extensions)t.enabled&&e(t)}_applyExtensions(e,t,s){for(const n of this._extensions)if(n.enabled){const i=`${n.name}.${t}`,r=e;r._activeLoaderExtensionFunctions=r._activeLoaderExtensionFunctions||{};const o=r._activeLoaderExtensionFunctions;if(!o[i]){o[i]=!0;try{const a=s(n);if(a)return a}finally{delete o[i]}}}return null}_extensionsOnLoading(){this._forEachExtensions(e=>e.onLoading&&e.onLoading())}_extensionsOnReady(){this._forEachExtensions(e=>e.onReady&&e.onReady())}_extensionsLoadSceneAsync(e,t){return this._applyExtensions(t,"loadScene",s=>s.loadSceneAsync&&s.loadSceneAsync(e,t))}_extensionsLoadNodeAsync(e,t,s){return this._applyExtensions(t,"loadNode",n=>n.loadNodeAsync&&n.loadNodeAsync(e,t,s))}_extensionsLoadCameraAsync(e,t,s){return this._applyExtensions(t,"loadCamera",n=>n.loadCameraAsync&&n.loadCameraAsync(e,t,s))}_extensionsLoadVertexDataAsync(e,t,s){return this._applyExtensions(t,"loadVertexData",n=>n._loadVertexDataAsync&&n._loadVertexDataAsync(e,t,s))}_extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,r){return this._applyExtensions(i,"loadMeshPrimitive",o=>o._loadMeshPrimitiveAsync&&o._loadMeshPrimitiveAsync(e,t,s,n,i,r))}_extensionsLoadMaterialAsync(e,t,s,n,i){return this._applyExtensions(t,"loadMaterial",r=>r._loadMaterialAsync&&r._loadMaterialAsync(e,t,s,n,i))}_extensionsCreateMaterial(e,t,s){return this._applyExtensions(t,"createMaterial",n=>n.createMaterial&&n.createMaterial(e,t,s))}_extensionsLoadMaterialPropertiesAsync(e,t,s){return this._applyExtensions(t,"loadMaterialProperties",n=>n.loadMaterialPropertiesAsync&&n.loadMaterialPropertiesAsync(e,t,s))}_extensionsLoadTextureInfoAsync(e,t,s){return this._applyExtensions(t,"loadTextureInfo",n=>n.loadTextureInfoAsync&&n.loadTextureInfoAsync(e,t,s))}_extensionsLoadTextureAsync(e,t,s){return this._applyExtensions(t,"loadTexture",n=>n._loadTextureAsync&&n._loadTextureAsync(e,t,s))}_extensionsLoadAnimationAsync(e,t){return this._applyExtensions(t,"loadAnimation",s=>s.loadAnimationAsync&&s.loadAnimationAsync(e,t))}_extensionsLoadAnimationChannelAsync(e,t,s,n,i){return this._applyExtensions(s,"loadAnimationChannel",r=>r._loadAnimationChannelAsync&&r._loadAnimationChannelAsync(e,t,s,n,i))}_extensionsLoadSkinAsync(e,t,s){return this._applyExtensions(s,"loadSkin",n=>n._loadSkinAsync&&n._loadSkinAsync(e,t,s))}_extensionsLoadUriAsync(e,t,s){return this._applyExtensions(t,"loadUri",n=>n._loadUriAsync&&n._loadUriAsync(e,t,s))}_extensionsLoadBufferViewAsync(e,t){return this._applyExtensions(t,"loadBufferView",s=>s.loadBufferViewAsync&&s.loadBufferViewAsync(e,t))}_extensionsLoadBufferAsync(e,t,s,n){return this._applyExtensions(t,"loadBuffer",i=>i.loadBufferAsync&&i.loadBufferAsync(e,t,s,n))}static LoadExtensionAsync(e,t,s,n){if(!t.extensions)return null;const r=t.extensions[s];return r?n(`${e}/extensions/${s}`,r):null}static LoadExtraAsync(e,t,s,n){if(!t.extras)return null;const r=t.extras[s];return r?n(`${e}/extras/${s}`,r):null}isExtensionUsed(e){return!!this._gltf.extensionsUsed&&this._gltf.extensionsUsed.indexOf(e)!==-1}logOpen(e){this._parent._logOpen(e)}logClose(){this._parent._logClose()}log(e){this._parent._log(e)}startPerformanceCounter(e){this._parent._startPerformanceCounter(e)}endPerformanceCounter(e){this._parent._endPerformanceCounter(e)}}A.DefaultSampler={index:-1};R._CreateGLTF2Loader=c=>new A(c);export{f as ArrayItem,R as GLTFFileLoader,A as GLTFLoader,et as LoadBoundingInfoFromPositionAccessor}; diff --git a/assets/glTFLoaderAnimation-DM5M4v5g.js b/assets/glTFLoaderAnimation-DM5M4v5g.js deleted file mode 100644 index f8bb00a10995f4416331402bfc8f83ef38c107c0..0000000000000000000000000000000000000000 --- a/assets/glTFLoaderAnimation-DM5M4v5g.js +++ /dev/null @@ -1 +0,0 @@ -import{as as l,ao as c,V as h}from"./index-GY9JDBGV.js";import{S as m}from"./objectModelMapping-CpTIXcMS.js";import"./index-DydPgVMC.js";function g(r,n,t,e){return h.FromArray(n,t).scaleInPlace(e)}function f(r,n,t,e){return c.FromArray(n,t).scaleInPlace(e)}function y(r,n,t,e){const o=new Array(r._numMorphTargets);for(let i=0;i({frame:a.frame,inTangent:a.inTangent?a.inTangent[s]:void 0,value:a.value[s],outTangent:a.outTangent?a.outTangent[s]:void 0,interpolation:a.interpolation})),!0),n._primitiveBabylonMeshes){for(const a of n._primitiveBabylonMeshes)if(a.morphTargetManager){const A=a.morphTargetManager.getTarget(s),T=b.clone();A.animations.push(T),i.push({babylonAnimatable:A,babylonAnimation:T})}}}return i}}m("/nodes/{}/translation",[new u(l.ANIMATIONTYPE_VECTOR3,"position",g,()=>3)]);m("/nodes/{}/rotation",[new u(l.ANIMATIONTYPE_QUATERNION,"rotationQuaternion",f,()=>4)]);m("/nodes/{}/scale",[new u(l.ANIMATIONTYPE_VECTOR3,"scaling",g,()=>3)]);m("/nodes/{}/weights",[new d(l.ANIMATIONTYPE_FLOAT,"influence",y,r=>r._numMorphTargets)]);export{p as AnimationPropertyInfo,u as TransformNodeAnimationPropertyInfo,d as WeightAnimationPropertyInfo,f as getQuaternion,g as getVector3,y as getWeights}; diff --git a/assets/glowBlurPostProcess.fragment-Dvn82thy.js b/assets/glowBlurPostProcess.fragment-Dvn82thy.js deleted file mode 100644 index 05aed484bea1164d7bd862aca0350b7c94b58837..0000000000000000000000000000000000000000 --- a/assets/glowBlurPostProcess.fragment-Dvn82thy.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="glowBlurPostProcessPixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d;uniform screenSize: vec2f;uniform direction: vec2f;uniform blurWidth: f32;fn getLuminance(color: vec3f)->f32 -{return dot(color, vec3f(0.2126,0.7152,0.0722));} -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var weights: array;weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;var texelSize: vec2f= vec2f(1.0/uniforms.screenSize.x,1.0/uniforms.screenSize.y);var texelStep: vec2f=texelSize*uniforms.direction*uniforms.blurWidth;var start: vec2f=input.vUV-3.0*texelStep;var baseColor: vec4f= vec4f(0.,0.,0.,0.);var texelOffset: vec2f= vec2f(0.,0.);for (var i: i32=0; i<7; i++) -{var texel: vec4f=textureSample(textureSampler,textureSamplerSampler,start+texelOffset);baseColor=vec4f(baseColor.rgb,baseColor.a+texel.a*weights[i]);var luminance: f32=getLuminance(baseColor.rgb);var luminanceTexel: f32=getLuminance(texel.rgb);var choice: f32=step(luminanceTexel,luminance);baseColor=vec4f(choice*baseColor.rgb+(1.0-choice)*texel.rgb,baseColor.a);texelOffset+=texelStep;} -fragmentOutputs.color=baseColor;}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const i={name:e,shader:t};export{i as glowBlurPostProcessPixelShaderWGSL}; diff --git a/assets/glowBlurPostProcess.fragment-tls0-pJE.js b/assets/glowBlurPostProcess.fragment-tls0-pJE.js deleted file mode 100644 index 19ec84ccfd7ba4dec2221b6d3db3d237929fde07..0000000000000000000000000000000000000000 --- a/assets/glowBlurPostProcess.fragment-tls0-pJE.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="glowBlurPostProcessPixelShader",r=`varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color) -{return dot(color,vec3(0.2126,0.7152,0.0722));} -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++) -{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;} -gl_FragColor=baseColor;}`;t.ShadersStore[e]||(t.ShadersStore[e]=r);const l={name:e,shader:r};export{l as glowBlurPostProcessPixelShader}; diff --git a/assets/graph-CmFD0A_p.js b/assets/graph-CmFD0A_p.js deleted file mode 100644 index 6ddd6f21d237fc93e3bb25add1f2249e74bb747d..0000000000000000000000000000000000000000 --- a/assets/graph-CmFD0A_p.js +++ /dev/null @@ -1 +0,0 @@ -import{at as T,au as C,av as Z,aw as R,ax as v,ay as k,az as K,aA as L,aB as V,aC as j,aD as ee,aE as te,aF as re,aG as se,aH as ne,aI as ie,an as ae,aJ as oe,aK as ue,aL as he,aM as y,aN as S,aO as $}from"./mermaid.core-BcqUqpnI.js";import{k as d,g as H,s as de,e as ce,f as fe,h as ge,j as le,d as _e,l as be,b as pe,m,n as g,r as ye}from"./_baseUniq-BFKEI0vc.js";function me(t,e){return t&&T(e,d(e),t)}function je(t,e){return t&&T(e,C(e),t)}function Te(t,e){return T(t,H(t),e)}var Oe=Object.getOwnPropertySymbols,Y=Oe?function(t){for(var e=[];t;)ce(e,H(t)),t=Z(t);return e}:de;function Ae(t,e){return T(t,Y(t),e)}function Ee(t){return fe(t,C,Y)}var Ce=Object.prototype,Le=Ce.hasOwnProperty;function we(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Le.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Ne(t,e){var r=e?R(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Fe=/\w*$/;function Pe(t){var e=new t.constructor(t.source,Fe.exec(t));return e.lastIndex=t.lastIndex,e}var I=v?v.prototype:void 0,D=I?I.valueOf:void 0;function ve(t){return D?Object(D.call(t)):{}}var Se="[object Boolean]",$e="[object Date]",Ie="[object Map]",De="[object Number]",Me="[object RegExp]",Ge="[object Set]",xe="[object String]",Ue="[object Symbol]",Be="[object ArrayBuffer]",Re="[object DataView]",Ke="[object Float32Array]",Ve="[object Float64Array]",He="[object Int8Array]",Ye="[object Int16Array]",qe="[object Int32Array]",Je="[object Uint8Array]",We="[object Uint8ClampedArray]",ze="[object Uint16Array]",Qe="[object Uint32Array]";function Xe(t,e,r){var s=t.constructor;switch(e){case Be:return R(t);case Se:case $e:return new s(+t);case Re:return Ne(t,r);case Ke:case Ve:case He:case Ye:case qe:case Je:case We:case ze:case Qe:return k(t,r);case Ie:return new s;case De:case xe:return new s(t);case Me:return Pe(t);case Ge:return new s;case Ue:return ve(t)}}var Ze="[object Map]";function ke(t){return K(t)&&L(t)==Ze}var M=j&&j.isMap,et=M?V(M):ke,tt="[object Set]";function rt(t){return K(t)&&L(t)==tt}var G=j&&j.isSet,st=G?V(G):rt,nt=1,it=2,at=4,q="[object Arguments]",ot="[object Array]",ut="[object Boolean]",ht="[object Date]",dt="[object Error]",J="[object Function]",ct="[object GeneratorFunction]",ft="[object Map]",gt="[object Number]",W="[object Object]",lt="[object RegExp]",_t="[object Set]",bt="[object String]",pt="[object Symbol]",yt="[object WeakMap]",mt="[object ArrayBuffer]",jt="[object DataView]",Tt="[object Float32Array]",Ot="[object Float64Array]",At="[object Int8Array]",Et="[object Int16Array]",Ct="[object Int32Array]",Lt="[object Uint8Array]",wt="[object Uint8ClampedArray]",Nt="[object Uint16Array]",Ft="[object Uint32Array]",o={};o[q]=o[ot]=o[mt]=o[jt]=o[ut]=o[ht]=o[Tt]=o[Ot]=o[At]=o[Et]=o[Ct]=o[ft]=o[gt]=o[W]=o[lt]=o[_t]=o[bt]=o[pt]=o[Lt]=o[wt]=o[Nt]=o[Ft]=!0;o[dt]=o[J]=o[yt]=!1;function O(t,e,r,s,n,a){var i,u=e&nt,h=e&it,Q=e&at;if(i!==void 0)return i;if(!ee(t))return t;var w=ae(t);if(w){if(i=we(t),!u)return te(t,i)}else{var _=L(t),N=_==J||_==ct;if(re(t))return se(t,u);if(_==W||_==q||N&&!n){if(i=h||N?{}:ne(t),!u)return h?Ae(t,je(i,t)):Te(t,me(i,t))}else{if(!o[_])return n?t:{};i=Xe(t,_,u)}}a||(a=new ie);var F=a.get(t);if(F)return F;a.set(t,i),st(t)?t.forEach(function(c){i.add(O(c,e,r,c,t,a))}):et(t)&&t.forEach(function(c,f){i.set(f,O(c,e,r,f,t,a))});var X=Q?h?Ee:le:h?C:d,P=w?void 0:X(t);return ge(P||t,function(c,f){P&&(f=c,c=t[f]),oe(i,f,O(c,e,r,f,t,a))}),i}function Pt(t,e){return _e(e,function(r){return t[r]})}function A(t){return t==null?[]:Pt(t,d(t))}function b(t){return t===void 0}var vt=ue(function(t){return be(pe(t,1,he,!0))}),St="\0",l="\0",x="";class z{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=y(void 0),this._defaultEdgeLabelFn=y(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[l]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return S(e)||(e=y(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return d(this._nodes)}sources(){var e=this;return m(this.nodes(),function(r){return $(e._in[r])})}sinks(){var e=this;return m(this.nodes(),function(r){return $(e._out[r])})}setNodes(e,r){var s=arguments,n=this;return g(e,function(a){s.length>1?n.setNode(a,r):n.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],g(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),g(d(this._in[e]),r),delete this._in[e],delete this._preds[e],g(d(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(b(r))r=l;else{r+="";for(var s=r;!b(s);s=this.parent(s))if(s===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==l)return r}}children(e){if(b(e)&&(e=l),this._isCompound){var r=this._children[e];if(r)return d(r)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return d(r)}successors(e){var r=this._sucs[e];if(r)return d(r)}neighbors(e){var r=this.predecessors(e);if(r)return vt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var s=this;g(this._nodes,function(i,u){e(u)&&r.setNode(u,i)}),g(this._edgeObjs,function(i){r.hasNode(i.v)&&r.hasNode(i.w)&&r.setEdge(i,s.edge(i))});var n={};function a(i){var u=s.parent(i);return u===void 0||r.hasNode(u)?(n[i]=u,u):u in n?n[u]:a(u)}return this._isCompound&&g(r.nodes(),function(i){r.setParent(i,a(i))}),r}setDefaultEdgeLabel(e){return S(e)||(e=y(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return A(this._edgeObjs)}setPath(e,r){var s=this,n=arguments;return ye(e,function(a,i){return n.length>1?s.setEdge(a,i,r):s.setEdge(a,i),i}),this}setEdge(){var e,r,s,n,a=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(e=i.v,r=i.w,s=i.name,arguments.length===2&&(n=arguments[1],a=!0)):(e=i,r=arguments[1],s=arguments[3],arguments.length>2&&(n=arguments[2],a=!0)),e=""+e,r=""+r,b(s)||(s=""+s);var u=p(this._isDirected,e,r,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,u))return a&&(this._edgeLabels[u]=n),this;if(!b(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[u]=a?n:this._defaultEdgeLabelFn(e,r,s);var h=$t(this._isDirected,e,r,s);return e=h.v,r=h.w,Object.freeze(h),this._edgeObjs[u]=h,U(this._preds[r],e),U(this._sucs[e],r),this._in[r][u]=h,this._out[e][u]=h,this._edgeCount++,this}edge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return this._edgeLabels[n]}hasEdge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s),a=this._edgeObjs[n];return a&&(e=a.v,r=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],B(this._preds[r],e),B(this._sucs[e],r),delete this._in[r][n],delete this._out[e][n],this._edgeCount--),this}inEdges(e,r){var s=this._in[e];if(s){var n=A(s);return r?m(n,function(a){return a.v===r}):n}}outEdges(e,r){var s=this._out[e];if(s){var n=A(s);return r?m(n,function(a){return a.w===r}):n}}nodeEdges(e,r){var s=this.inEdges(e,r);if(s)return s.concat(this.outEdges(e,r))}}z.prototype._nodeCount=0;z.prototype._edgeCount=0;function U(t,e){t[e]?t[e]++:t[e]=1}function B(t,e){--t[e]||delete t[e]}function p(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}return n+x+a+x+(b(s)?St:s)}function $t(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}var u={v:n,w:a};return s&&(u.name=s),u}function E(t,e){return p(t,e.v,e.w,e.name)}export{z as G,O as b,b as i,A as v}; diff --git a/assets/harmonicsFunctions-B8ViGQkZ.js b/assets/harmonicsFunctions-B8ViGQkZ.js deleted file mode 100644 index 64d2ae7e200c3b7d4cbfa636612c084d13734993..0000000000000000000000000000000000000000 --- a/assets/harmonicsFunctions-B8ViGQkZ.js +++ /dev/null @@ -1,16 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";const a="harmonicsFunctions",e=`#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00 -+ uniforms.vSphericalL1_1*(normal.y) -+ uniforms.vSphericalL10*(normal.z) -+ uniforms.vSphericalL11*(normal.x) -+ uniforms.vSphericalL2_2*(normal.y*normal.x) -+ uniforms.vSphericalL2_1*(normal.y*normal.z) -+ uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0) -+ uniforms.vSphericalL21*(normal.z*normal.x) -+ uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));} -#else -fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {var Nx: f32=normal.x;var Ny: f32=normal.y;var Nz: f32=normal.z;var C1: vec3f=uniforms.vSphericalZZ.rgb;var Cx: vec3f=uniforms.vSphericalX.rgb;var Cy: vec3f=uniforms.vSphericalY.rgb;var Cz: vec3f=uniforms.vSphericalZ.rgb;var Cxx_zz: vec3f=uniforms.vSphericalXX_ZZ.rgb;var Cyy_zz: vec3f=uniforms.vSphericalYY_ZZ.rgb;var Cxy: vec3f=uniforms.vSphericalXY.rgb;var Cyz: vec3f=uniforms.vSphericalYZ.rgb;var Czx: vec3f=uniforms.vSphericalZX.rgb;var a1: vec3f=Cyy_zz*Ny+Cy;var a2: vec3f=Cyz*Nz+a1;var b1: vec3f=Czx*Nz+Cx;var b2: vec3f=Cxy*Ny+b1;var b3: vec3f=Cxx_zz*Nx+b2;var t1: vec3f=Cz *Nz+C1;var t2: vec3f=a2 *Ny+t1;var t3: vec3f=b3 *Nx+t2;return t3;} -#endif -#endif -`;r.IncludesShadersStoreWGSL[a]||(r.IncludesShadersStoreWGSL[a]=e); diff --git a/assets/harmonicsFunctions-DgiK80M3.js b/assets/harmonicsFunctions-DgiK80M3.js deleted file mode 100644 index 9bc24d1eab04544ed77fa5145fbc387044a03128..0000000000000000000000000000000000000000 --- a/assets/harmonicsFunctions-DgiK80M3.js +++ /dev/null @@ -1,16 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";const e="harmonicsFunctions",a=`#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -vec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00 -+ vSphericalL1_1*(normal.y) -+ vSphericalL10*(normal.z) -+ vSphericalL11*(normal.x) -+ vSphericalL2_2*(normal.y*normal.x) -+ vSphericalL2_1*(normal.y*normal.z) -+ vSphericalL20*((3.0*normal.z*normal.z)-1.0) -+ vSphericalL21*(normal.z*normal.x) -+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));} -#else -vec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;} -#endif -#endif -`;r.IncludesShadersStore[e]||(r.IncludesShadersStore[e]=a); diff --git a/assets/hdr-BUlPhc1F.js b/assets/hdr-BUlPhc1F.js deleted file mode 100644 index ebcb20fc73a69664f418bf02fa3763eb38a08105..0000000000000000000000000000000000000000 --- a/assets/hdr-BUlPhc1F.js +++ /dev/null @@ -1,2 +0,0 @@ -import{V as h}from"./index-GY9JDBGV.js";class b{static ConvertPanoramaToCubemap(e,a,t,n,o=!1,s=!0){if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";let l=0;if(e.length!=a*t*3){if(e.length!=a*t*4)throw"ConvertPanoramaToCubemap: input size is wrong";l=4}else l=3;const w=this.CreateCubemapTexture(n,this.FACE_FRONT,e,a,t,o,s,l),f=this.CreateCubemapTexture(n,this.FACE_BACK,e,a,t,o,s,l),C=this.CreateCubemapTexture(n,this.FACE_LEFT,e,a,t,o,s,l),u=this.CreateCubemapTexture(n,this.FACE_RIGHT,e,a,t,o,s,l),c=this.CreateCubemapTexture(n,this.FACE_UP,e,a,t,o,s,l),i=this.CreateCubemapTexture(n,this.FACE_DOWN,e,a,t,o,s,l);return{front:w,back:f,left:C,right:u,up:c,down:i,size:n,type:1,format:4,gammaSpace:!1}}static CreateCubemapTexture(e,a,t,n,o,s,l,w){const f=new ArrayBuffer(e*e*4*3),C=new Float32Array(f),u=s?Math.max(1,Math.round(n/4/e)):1,c=1/u,i=c*c,d=a[1].subtract(a[0]).scale(c/e),R=a[3].subtract(a[2]).scale(c/e),m=1/e;let F=0;for(let M=0;MMath.PI;)l-=2*Math.PI;let f=l/Math.PI;const C=w/Math.PI;f=f*.5+.5;let u=Math.round(f*t);u<0?u=0:u>=t&&(u=t-1);let c=Math.round(C*n);c<0?c=0:c>=n&&(c=n-1);const i=s?n-c-1:c,d=a[i*t*o+u*o+0],R=a[i*t*o+u*o+1],m=a[i*t*o+u*o+2];return{r:d,g:R,b:m}}}b.FACE_LEFT=[new h(-1,-1,-1),new h(1,-1,-1),new h(-1,1,-1),new h(1,1,-1)];b.FACE_RIGHT=[new h(1,-1,1),new h(-1,-1,1),new h(1,1,1),new h(-1,1,1)];b.FACE_FRONT=[new h(1,-1,-1),new h(1,-1,1),new h(1,1,-1),new h(1,1,1)];b.FACE_BACK=[new h(-1,-1,1),new h(-1,-1,-1),new h(-1,1,1),new h(-1,1,-1)];b.FACE_DOWN=[new h(1,1,-1),new h(1,1,1),new h(-1,1,-1),new h(-1,1,1)];b.FACE_UP=[new h(-1,-1,-1),new h(-1,-1,1),new h(1,-1,-1),new h(1,-1,1)];function D(r,e){return e>1023?r*Math.pow(2,1023)*Math.pow(2,e-1023):e<-1074?r*Math.pow(2,-1074)*Math.pow(2,e+1074):r*Math.pow(2,e)}function L(r,e,a,t,n,o){n>0?(n=D(1,n-136),r[o+0]=e*n,r[o+1]=a*n,r[o+2]=t*n):(r[o+0]=0,r[o+1]=0,r[o+2]=0)}function A(r,e){let a="",t="";for(let n=e;n32767)throw"HDR Bad header format, unsupported size";return s+=t.length+1,{height:e,width:a,dataPosition:s}}function j(r,e,a=!1){const t=new Uint8Array(r),n=G(t),o=O(t,n);return b.ConvertPanoramaToCubemap(o,n.width,n.height,e,a)}function O(r,e){return N(r,e)}function N(r,e){let a=e.height;const t=e.width;let n,o,s,l,w,f=e.dataPosition,C=0,u=0,c=0;const i=new ArrayBuffer(t*4),d=new Uint8Array(i),R=new ArrayBuffer(e.width*e.height*4*3),m=new Float32Array(R);for(;a>0;){if(n=r[f++],o=r[f++],s=r[f++],l=r[f++],n!=2||o!=2||s&128||e.width<8||e.width>32767)return U(r,e);if((s<<8|l)!=t)throw"HDR Bad header format, wrong scan line width";for(C=0,c=0;c<4;c++)for(u=(c+1)*t;C128){if(w=n-128,w==0||w>u-C)throw"HDR Bad Format, bad scanline data (run)";for(;w-- >0;)d[C++]=o}else{if(w=n,w==0||w>u-C)throw"HDR Bad Format, bad scanline data (non-run)";if(d[C++]=o,--w>0)for(let F=0;F0;){for(w=0;wi.map(i=>d[i]); -import{az as M,V as i,aE as R,aD as F,B as I,M as b,O as P,T as L,d as A,ay as E,aP as v,br as x,aO as y,R as D}from"./index-GY9JDBGV.js";import{af as u}from"./index-DydPgVMC.js";import{I as W}from"./iblCdfGenerator-D-umVdZE.js";import{G as z}from"./hdr-BUlPhc1F.js";import"./rawTexture-BDsvmix4.js";class G{constructor(e,t={}){this._lodGenerationOffset=0,this._lodGenerationScale=.8,this.quality=4096,this.hdrScale=1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.quality||this.quality}_createRenderTarget(e){let t=0;this._engine.getCaps().textureHalfFloatRender?t=2:this._engine.getCaps().textureFloatRender&&(t=1);const r=this._engine.createRenderTargetCubeTexture(e,{format:5,type:t,createMipMaps:!0,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:1,label:"HDR_Radiance_Filtering_Target"});return this._engine.updateTextureWrappingMode(r.texture,0,0,0),this._engine.updateTextureSamplingMode(3,r.texture,!0),r}_prefilterInternal(e){const t=e.getSize().width,r=M(t)+1,a=this._effectWrapper.effect,h=this._createRenderTarget(t);this._effectRenderer.saveStates(),this._effectRenderer.setViewport();const d=e.getInternalTexture();d&&this._engine.updateTextureSamplingMode(3,d,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper);const f=[[new i(0,0,-1),new i(0,-1,0),new i(1,0,0)],[new i(0,0,1),new i(0,-1,0),new i(-1,0,0)],[new i(1,0,0),new i(0,0,1),new i(0,1,0)],[new i(1,0,0),new i(0,0,-1),new i(0,-1,0)],[new i(1,0,0),new i(0,-1,0),new i(0,0,1)],[new i(-1,0,0),new i(0,-1,0),new i(0,0,-1)]];a.setFloat("hdrScale",this.hdrScale),a.setFloat2("vFilteringInfo",e.getSize().width,r),a.setTexture("inputTexture",e);for(let c=0;c<6;c++){a.setVector3("up",f[c][0]),a.setVector3("right",f[c][1]),a.setVector3("front",f[c][2]);for(let s=0;s{a?await Promise.all([u(()=>import("./hdrFiltering.vertex-DSIHntlp.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),u(()=>import("./hdrFiltering.fragment-B_3KFg3V.js"),__vite__mapDeps([4,1,2,3,5,6,7]),import.meta.url)]):await Promise.all([u(()=>import("./hdrFiltering.vertex-CkiWi0gY.js"),__vite__mapDeps([8,1,2,3]),import.meta.url),u(()=>import("./hdrFiltering.fragment-CqsXPwjX.js"),__vite__mapDeps([9,1,2,3,10,11,12]),import.meta.url)])}})}isReady(e){return e.isReady()&&this._effectWrapper.effect.isReady()}async prefilter(e){if(!this._engine._features.allowTexturePrefiltering)throw new Error("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");this._effectRenderer=new F(this._engine),this._effectWrapper=this._createEffect(e),await this._effectWrapper.effect.whenCompiledAsync(),this._prefilterInternal(e),this._effectRenderer.dispose(),this._effectWrapper.dispose()}}class O{constructor(e,t={}){this.quality=4096,this.hdrScale=1,this.useCdf=!1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.quality||this.quality,this.useCdf=t.useCdf||this.useCdf}_createRenderTarget(e){let t=0;this._engine.getCaps().textureHalfFloatRender?t=2:this._engine.getCaps().textureFloatRender&&(t=1);const r=this._engine.createRenderTargetCubeTexture(e,{format:5,type:t,createMipMaps:!1,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:2,label:"HDR_Irradiance_Filtering_Target"});return this._engine.updateTextureWrappingMode(r.texture,0,0,0),r}_prefilterInternal(e){const t=e.getSize().width,r=M(t),a=this._effectWrapper.effect,h=Math.max(32,1<>3)),d=this._createRenderTarget(h);this._effectRenderer.saveStates(),this._effectRenderer.setViewport(),this._effectRenderer.applyEffectWrapper(this._effectWrapper);const f=[[new i(0,0,-1),new i(0,-1,0),new i(1,0,0)],[new i(0,0,1),new i(0,-1,0),new i(-1,0,0)],[new i(1,0,0),new i(0,0,1),new i(0,1,0)],[new i(1,0,0),new i(0,0,-1),new i(0,-1,0)],[new i(1,0,0),new i(0,-1,0),new i(0,0,1)],[new i(-1,0,0),new i(0,-1,0),new i(0,0,-1)]];a.setFloat("hdrScale",this.hdrScale),a.setFloat2("vFilteringInfo",e.getSize().width,r),a.setTexture("inputTexture",e),this._cdfGenerator&&a.setTexture("icdfTexture",this._cdfGenerator.getIcdfTexture());for(let o=0;o<6;o++)a.setVector3("up",f[o][0]),a.setVector3("right",f[o][1]),a.setVector3("front",f[o][2]),this._engine.bindFramebuffer(d,o,void 0,void 0,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper),this._effectRenderer.draw();this._effectRenderer.restoreStates(),this._engine.restoreDefaultFramebuffer(),a.setTexture("inputTexture",null),a.setTexture("icdfTexture",null);const l=new I(e.getScene(),d.texture);return l.name=e.name+"_irradiance",l.displayName=e.name+"_irradiance",l.gammaSpace=!1,l}_createEffect(e,t){const r=[];e.gammaSpace&&r.push("#define GAMMA_INPUT"),r.push("#define NUM_SAMPLES "+this.quality+"u");const a=this._engine.isWebGPU,h=["inputTexture"];return this._cdfGenerator&&(h.push("icdfTexture"),r.push("#define IBL_CDF_FILTERING")),new R({engine:this._engine,name:"HDRIrradianceFiltering",vertexShader:"hdrIrradianceFiltering",fragmentShader:"hdrIrradianceFiltering",samplerNames:h,uniformNames:["vSampleDirections","vWeights","up","right","front","vFilteringInfo","hdrScale"],useShaderStore:!0,defines:r,onCompiled:t,shaderLanguage:a?1:0,extraInitializationsAsync:async()=>{a?await Promise.all([u(()=>import("./hdrIrradianceFiltering.vertex-Bji2KZhD.js"),__vite__mapDeps([13,1,2,3]),import.meta.url),u(()=>import("./hdrIrradianceFiltering.fragment-BOnH3hN_.js"),__vite__mapDeps([14,1,2,3,5,6,7]),import.meta.url)]):await Promise.all([u(()=>import("./hdrIrradianceFiltering.vertex-Dmgv4nxH.js"),__vite__mapDeps([15,1,2,3]),import.meta.url),u(()=>import("./hdrIrradianceFiltering.fragment-uh7XTruA.js"),__vite__mapDeps([16,1,2,3,10,11,12]),import.meta.url)])}})}isReady(e){return e.isReady()&&this._effectWrapper.effect.isReady()}async prefilter(e){if(!this._engine._features.allowTexturePrefiltering)throw new Error("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");this.useCdf&&(this._cdfGenerator=new W(this._engine),this._cdfGenerator.iblSource=e,await this._cdfGenerator.renderWhenReady()),this._effectRenderer=new F(this._engine),this._effectWrapper=this._createEffect(e),await this._effectWrapper.effect.whenCompiledAsync();const t=this._prefilterInternal(e);return this.useCdf&&await this._cdfGenerator.findDominantDirection().then(r=>{t._dominantDirection=r}),this._effectRenderer.dispose(),this._effectWrapper.dispose(),this._cdfGenerator?.dispose(),t}}class p extends I{set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}set rotationY(e){this._rotationY=e,this.setReflectionTextureMatrix(b.RotationY(this._rotationY))}get rotationY(){return this._rotationY}set boundingBoxSize(e){if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;const t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}constructor(e,t,r,a=!1,h=!0,d=!1,f=!1,l=null,o=null,c=!1,s=!1,n=!1){super(t),this._generateHarmonics=!0,this._onError=null,this._isBlocking=!0,this._rotationY=0,this.boundingBoxPosition=i.Zero(),this.onLoadObservable=new P,e&&(this._coordinatesMode=L.CUBIC_MODE,this.name=e,this.url=e,this.hasAlpha=!1,this.isCube=!0,this._textureMatrix=b.Identity(),this._prefilterOnLoad=f,this._prefilterIrradianceOnLoad=s,this._prefilterUsingCdf=n,this._onLoad=()=>{this.onLoadObservable.notifyObservers(this),l&&l()},this._onError=o,this.gammaSpace=d,this._noMipmap=a,this._size=r,this._supersample=c||n,this._generateHarmonics=h,this._texture=this._getFromCache(e,this._noMipmap,void 0,void 0,void 0,this.isCube),this._texture?this._texture.isReady?A.SetImmediate(()=>this._onLoad()):this._texture.onLoadedObservable.add(this._onLoad):this.getScene()?.useDelayedTextureLoading?this.delayLoadState=4:this._loadTexture())}getClassName(){return"EnvCubeTexture"}_loadTexture(){const e=this._getEngine(),t=e.getCaps();let r=0;t.textureFloat&&t.textureFloatLinearFiltering?r=1:t.textureHalfFloat&&t.textureHalfFloatLinearFiltering&&(r=2);const a=async h=>{this.lodGenerationOffset=0,this.lodGenerationScale=.8;const d=await this._getCubeMapTextureDataAsync(h,this._size,this._supersample);if(this._generateHarmonics){const c=v.ConvertCubeMapToSphericalPolynomial(d);this.sphericalPolynomial=c}const f=[];let l=null,o=null;for(let c=0;c<6;c++){r===2?o=new Uint16Array(this._size*this._size*3):r===0&&(l=new Uint8Array(this._size*this._size*3));const s=d[p._FacesMapping[c]];if(this.gammaSpace||o||l){for(let n=0;n255){const S=255/T;g*=S,m*=S,w*=S}l[n*3+0]=g,l[n*3+1]=m,l[n*3+2]=w}}o?f.push(o):l?f.push(l):f.push(s)}return f};if(e._features.allowTexturePrefiltering&&(this._prefilterOnLoad||this._prefilterIrradianceOnLoad)){const h=this._onLoad,d=new G(e);this._onLoad=()=>{let f=Promise.resolve(null),l=Promise.resolve();this._prefilterIrradianceOnLoad&&(f=new O(e,{useCdf:this._prefilterUsingCdf}).prefilter(this)),this._prefilterOnLoad&&(l=d.prefilter(this)),Promise.all([f,l]).then(o=>{const c=o[0];if(this._prefilterIrradianceOnLoad&&c){this.irradianceTexture=c;const s=this.getScene();s&&s.markAllMaterialsAsDirty(1)}h&&h()})}}this._texture=e.createRawCubeTextureFromUrl(this.url,this.getScene(),this._size,4,r,this._noMipmap,a,null,this._onLoad,this._onError),!this._generateHarmonics&&!this._texture._sphericalPolynomial&&(this._texture._sphericalPolynomial=new E)}delayLoad(){this.delayLoadState===4&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||this._loadTexture())}getReflectionTextureMatrix(){return this._textureMatrix}setReflectionTextureMatrix(e){this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene()?.markAllMaterialsAsDirty(1,t=>t.getActiveTextures().indexOf(this)!==-1)}dispose(){this.onLoadObservable.clear(),super.dispose()}serialize(){if(!this.name)return null;const e={};return e.name=this.name,e.hasAlpha=this.hasAlpha,e.isCube=!0,e.level=this.level,e.size=this._size,e.coordinatesMode=this.coordinatesMode,e.useInGammaSpace=this.gammaSpace,e.generateHarmonics=this._generateHarmonics,e.noMipmap=this._noMipmap,e.isBlocking=this._isBlocking,e.rotationY=this._rotationY,e}clone(){const e=this._instantiateClone();return e.level=this.level,e.wrapU=this.wrapU,e.wrapV=this.wrapV,e.coordinatesIndex=this.coordinatesIndex,e.coordinatesMode=this.coordinatesMode,e}static _Parse(e,t){t.name=e.name,t.hasAlpha=e.hasAlpha,t.level=e.level,t.coordinatesMode=e.coordinatesMode,t.isBlocking=e.isBlocking,e.boundingBoxPosition&&(t.boundingBoxPosition=i.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(t.boundingBoxSize=i.FromArray(e.boundingBoxSize)),e.rotationY&&(t.rotationY=e.rotationY)}}p._FacesMapping=["right","left","up","down","front","back"];class _ extends p{constructor(e,t,r,a=!1,h=!0,d=!1,f=!1,l=null,o=null,c=!1,s=!1,n=!1){super(e,t,r,a,h,d,f,l,o,c,s,n)}getClassName(){return"HDRCubeTexture"}async _getCubeMapTextureDataAsync(e,t,r){return z(e,t,r)}_instantiateClone(){return new _(this.url,this.getScene()||this._getEngine(),this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace)}serialize(){const e=super.serialize();return e?(e.customType="BABYLON.HDRCubeTexture",e):null}static Parse(e,t,r){if(!e.name||e.isRenderTarget)return null;const a=new _(r+e.name,t,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace);return this._Parse(e,a),a}}D("BABYLON.HDRCubeTexture",_);export{_ as HDRCubeTexture}; diff --git a/assets/hdrFiltering.fragment-B_3KFg3V.js b/assets/hdrFiltering.fragment-B_3KFg3V.js deleted file mode 100644 index 3b6b1175a59b29754b129862f46b40365df0de18..0000000000000000000000000000000000000000 --- a/assets/hdrFiltering.fragment-B_3KFg3V.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./helperFunctions-Wgh3PIP0.js";import"./hdrFilteringFunctions-BDy1DXPD.js";import"./pbrBRDFFunctions-BKKbkltP.js";import"./index-DydPgVMC.js";const r="hdrFilteringPixelShader",i=`#include -#include -#include -#include -uniform alphaG: f32;var inputTextureSampler: sampler;var inputTexture: texture_cube;uniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=radiance(uniforms.alphaG,inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=i);const c={name:r,shader:i};export{c as hdrFilteringPixelShaderWGSL}; diff --git a/assets/hdrFiltering.fragment-CqsXPwjX.js b/assets/hdrFiltering.fragment-CqsXPwjX.js deleted file mode 100644 index adafeaa2597f6b1ecda3632941bf018e70846581..0000000000000000000000000000000000000000 --- a/assets/hdrFiltering.fragment-CqsXPwjX.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./hdrFilteringFunctions-B6pmqAql.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./index-DydPgVMC.js";const r="hdrFilteringPixelShader",e=`#include -#include -#include -#include -uniform float alphaG;uniform samplerCube inputTexture;uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);gl_FragColor=vec4(color*hdrScale,1.0);}`;i.ShadersStore[r]||(i.ShadersStore[r]=e);const c={name:r,shader:e};export{c as hdrFilteringPixelShader}; diff --git a/assets/hdrFiltering.vertex-CkiWi0gY.js b/assets/hdrFiltering.vertex-CkiWi0gY.js deleted file mode 100644 index 8a85e8d669a2832fce096f55e688eea735e10221..0000000000000000000000000000000000000000 --- a/assets/hdrFiltering.vertex-CkiWi0gY.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="hdrFilteringVertexShader",r=`attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front; -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -mat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;i.ShadersStore[e]||(i.ShadersStore[e]=r);const n={name:e,shader:r};export{n as hdrFilteringVertexShader}; diff --git a/assets/hdrFiltering.vertex-DSIHntlp.js b/assets/hdrFiltering.vertex-DSIHntlp.js deleted file mode 100644 index af2dc83ade18fbbb0a2e5363da4444d8066f8650..0000000000000000000000000000000000000000 --- a/assets/hdrFiltering.vertex-DSIHntlp.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="hdrFilteringVertexShader",r=`attribute position: vec2f;varying direction: vec3f;uniform up: vec3f;uniform right: vec3f;uniform front: vec3f; -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -var view: mat3x3f= mat3x3f(uniforms.up,uniforms.right,uniforms.front);vertexOutputs.direction=view*vec3f(input.position,1.0);vertexOutputs.position= vec4f(input.position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=r);const o={name:e,shader:r};export{o as hdrFilteringVertexShaderWGSL}; diff --git a/assets/hdrFilteringFunctions-B6pmqAql.js b/assets/hdrFilteringFunctions-B6pmqAql.js deleted file mode 100644 index 7edeadda9a0e5aba7f93d032151061a165f3e34f..0000000000000000000000000000000000000000 --- a/assets/hdrFilteringFunctions-B6pmqAql.js +++ /dev/null @@ -1,155 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="importanceSampling",a=`vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} -vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} -vec3 hemisphereImportanceSampleDggxAnisotropic(vec2 Xi,float alphaTangent,float alphaBitangent) -{alphaTangent=max(alphaTangent,0.0001);alphaBitangent=max(alphaBitangent,0.0001);float phi=atan(alphaBitangent/alphaTangent*tan(2.0*3.14159265*Xi.x));if (Xi.x>0.5) phi+=3.14159265; -float cosPhi=cos(phi);float sinPhi=sin(phi);float alpha2=(cosPhi*cosPhi)/(alphaTangent*alphaTangent) + -(sinPhi*sinPhi)/(alphaBitangent*alphaBitangent);float tanTheta2=Xi.y/(1.0-Xi.y)/alpha2;float cosTheta=1.0/sqrt(1.0+tanTheta2);float sinTheta=sqrt(max(0.0,1.0-cosTheta*cosTheta));return vec3(sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);} -vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { -float phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=a);const i="hdrFilteringFunctions",n=`#if NUM_SAMPLES -#if NUM_SAMPLES>0 -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -float radicalInverse_VdC(uint bits) -{bits=(bits<<16u) | (bits>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10; } -vec2 hammersley(uint i,uint N) -{return vec2(float(i)/float(N),radicalInverse_VdC(i));} -#else -float vanDerCorpus(int n,int base) -{float invBase=1.0/float(base);float denom =1.0;float result =0.0;for(int i=0; i<32; ++i) -{if(n>0) -{denom =mod(float(n),2.0);result+=denom*invBase;invBase=invBase/2.0;n =int(float(n)/2.0);}} -return result;} -vec2 hammersley(int i,int N) -{return vec2(float(i)/float(N),vanDerCorpus(i,2));} -#endif -float log4(float x) {return log2(x)/2.;} -vec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.*PI;float phi=uvRange.y*PI;float sinPhi=sin(phi);N.x=cos(theta)*sinPhi;N.z=sin(theta)*sinPhi;N.y=cos(phi);return N;} -const float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;const float K=4.; -#define inline -vec3 irradiance( -#ifdef CUSTOM_IRRADIANCE_FILTERING_INPUT -CUSTOM_IRRADIANCE_FILTERING_INPUT -#else -samplerCube inputTexture, -#endif -vec3 inputN,vec2 filteringInfo, -float diffuseRoughness, -vec3 surfaceAlbedo, -vec3 inputV -#if IBL_CDF_FILTERING -,sampler2D icdfSampler -#endif -) -{vec3 n=normalize(inputN);vec3 result=vec3(0.); -#ifndef IBL_CDF_FILTERING -vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);mat3 tbnInverse=mat3(tangent.x,bitangent.x,n.x,tangent.y,bitangent.y,n.y,tangent.z,bitangent.z,n.z); -#endif -float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0)); -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -for(uint i=0u; i0.) { -#if IBL_CDF_FILTERING -float pdf=texture2D(icdfSampler,T).z;vec3 c=textureCubeLodEXT(inputTexture,Ls,0.).rgb; -#else -float pdf_inversed=PI/NoL;float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(l,0.,maxLevel); -#ifdef CUSTOM_IRRADIANCE_FILTERING_FUNCTION -CUSTOM_IRRADIANCE_FILTERING_FUNCTION -#else -vec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb; -#endif -#endif -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -vec3 diffuseRoughnessTerm=vec3(1.0); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI; -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -#if IBL_CDF_FILTERING -vec3 light=pdf<1e-6 ? vec3(0.0) : vec3(1.0)/vec3(pdf)*c;result+=NoL*diffuseRoughnessTerm*light; -#else -result+=c*diffuseRoughnessTerm; -#endif -}} -result=result*NUM_SAMPLES_FLOAT_INVERSED; -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -result=result/clampedAlbedo; -#endif -return result;} -#define inline -vec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo) -{vec3 n=normalize(inputN);vec3 c=textureCube(inputTexture,n).rgb; -if (alphaG==0.) { -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -return c;} else {vec3 result=vec3(0.);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);float weight=0.; -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -for(uint i=0u; i0.) {float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb; -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -result+=c*NoL;}} -result=result/weight;return result;}} -#ifdef ANISOTROPIC -#define inline -vec3 radianceAnisotropic( -float alphaTangent, -float alphaBitangent, -samplerCube inputTexture, -vec3 inputView, -vec3 inputTangent, -vec3 inputBitangent, -vec3 inputNormal, -vec2 filteringInfo, -vec2 noiseInput -) -{vec3 V=inputView;vec3 N=inputNormal;vec3 T=inputTangent;vec3 B=inputBitangent;vec3 R=reflect(-V,N);if (alphaTangent==0. && alphaBitangent==0.) {vec3 c=textureCube(inputTexture,R).rgb; -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -return c;} -vec3 result=vec3(0.);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float effectiveDim=dim0*sqrt(alphaTangent*alphaBitangent);float omegaP=(4.*PI)/(6.*effectiveDim*effectiveDim);const float noiseScale=clamp(log2(float(NUM_SAMPLES))/12.0f,0.0f,1.0f);float weight=0.; -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -for(uint i=0u; i0.) {float pdf_inversed=4./normalDistributionFunction_BurleyGGX_Anisotropic( -H_tangent.z,H_tangent.x,H_tangent.y,vec2(alphaTangent,alphaBitangent) -);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,L,mipLevel).rgb; -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -result+=c*NoL;}} -result=result/weight;return result;} -#endif -#endif -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=n); diff --git a/assets/hdrFilteringFunctions-BDy1DXPD.js b/assets/hdrFilteringFunctions-BDy1DXPD.js deleted file mode 100644 index ca796225639774b5307a0e20c8e5df0492a7522e..0000000000000000000000000000000000000000 --- a/assets/hdrFilteringFunctions-BDy1DXPD.js +++ /dev/null @@ -1,127 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const a="importanceSampling",t=`fn hemisphereCosSample(u: vec2f)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=1.-u.y;var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} -fn hemisphereImportanceSampleDggx(u: vec2f,a: f32)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} -fn hemisphereImportanceSampleDggxAnisotropic(Xi: vec2f,alphaTangent: f32,alphaBitangent: f32)->vec3f -{let alphaT: f32=max(alphaTangent,0.0001);let alphaB: f32=max(alphaBitangent,0.0001);var phi: f32=atan(alphaB/alphaT*tan(2.0f*PI*Xi.x));if (Xi.x>0.5) {phi+=PI; } -let cosPhi: f32=cos(phi);let sinPhi: f32=sin(phi);let alpha2: f32=(cosPhi*cosPhi)/(alphaTangent*alphaTangent) + -(sinPhi*sinPhi)/(alphaB*alphaB);let tanTheta2: f32=Xi.y/(1.0f-Xi.y)/alpha2;let cosTheta: f32=1.0f/sqrt(1.0f+tanTheta2);let sinTheta: f32=sqrt(max(0.0f,1.0f-cosTheta*cosTheta));return vec3f(sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);} -fn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f { -var phi: f32=2.*PI*u.x;var sinTheta: f32=pow(u.y,a/(2.*a+1.));var cosTheta: f32=sqrt(1.-sinTheta*sinTheta);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=t);const f="hdrFilteringFunctions",i=`#ifdef NUM_SAMPLES -#if NUM_SAMPLES>0 -fn radicalInverse_VdC(value: u32)->f32 -{var bits=(value<<16u) | (value>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return f32(bits)*2.3283064365386963e-10; } -fn hammersley(i: u32,N: u32)->vec2f -{return vec2f( f32(i)/ f32(N),radicalInverse_VdC(i));} -fn log4(x: f32)->f32 {return log2(x)/2.;} -fn uv_to_normal(uv: vec2f)->vec3f {var N: vec3f;var uvRange: vec2f=uv;var theta: f32=uvRange.x*2.0*PI;var phi: f32=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;} -const NUM_SAMPLES_FLOAT: f32= f32(NUM_SAMPLES);const NUM_SAMPLES_FLOAT_INVERSED: f32=1./NUM_SAMPLES_FLOAT;const K: f32=4.;fn irradiance( -#ifdef CUSTOM_IRRADIANCE_FILTERING_INPUT -CUSTOM_IRRADIANCE_FILTERING_INPUT -#else -inputTexture: texture_cube,inputSampler: sampler, -#endif -inputN: vec3f, -filteringInfo: vec2f, -diffuseRoughness: f32, -surfaceAlbedo: vec3f, -inputV: vec3f -#ifdef IBL_CDF_FILTERING -,icdfSampler: texture_2d,icdfSamplerSampler: sampler -#endif -)->vec3f -{var n: vec3f=normalize(inputN);var result: vec3f= vec3f(0.0); -#ifndef IBL_CDF_FILTERING -var tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var tbnInverse: mat3x3f=transpose(tbn); -#endif -var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);var clampedAlbedo: vec3f=clamp(surfaceAlbedo,vec3f(0.1),vec3f(1.0));for(var i: u32=0u; i0.) { -#ifdef IBL_CDF_FILTERING -var pdf: f32=textureSampleLevel(icdfSampler,icdfSamplerSampler,T,0.0).z;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,Ls,0.0).rgb; -#else -var pdf_inversed: f32=PI/NoL;var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp(l,0.0,maxLevel); -#ifdef CUSTOM_IRRADIANCE_FILTERING_FUNCTION -CUSTOM_IRRADIANCE_FILTERING_FUNCTION -#else -var c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*Ls,mipLevel).rgb; -#endif -#endif -#ifdef GAMMA_INPUT -c=toLinearSpaceVec3(c); -#endif -var diffuseRoughnessTerm: vec3f=vec3f(1.0); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI; -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseRoughnessTerm=vec3f(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -#ifdef IBL_CDF_FILTERING -var light: vec3f=vec3f(0.0);if (pdf>1e-6) {light=vec3f(1.0)/vec3f(pdf)*c;} -result+=NoL*diffuseRoughnessTerm*light; -#else -result+=c*diffuseRoughnessTerm; -#endif -}} -result=result*NUM_SAMPLES_FLOAT_INVERSED; -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -result=result/clampedAlbedo; -#endif -return result;} -fn radiance(alphaG: f32,inputTexture: texture_cube,inputSampler: sampler,inputN: vec3f,filteringInfo: vec2f)->vec3f -{var n: vec3f=normalize(inputN);var c: vec3f=textureSample(inputTexture,inputSampler,n).rgb; -if (alphaG==0.) { -#ifdef GAMMA_INPUT -c=toLinearSpace(c); -#endif -return c;} else {var result: vec3f= vec3f(0.);var tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);var weight: f32=0.;for(var i: u32=0u; i0.) {var pdf_inversed: f32=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp( f32(l),0.0,maxLevel);weight+=NoL;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*L,mipLevel).rgb; -#ifdef GAMMA_INPUT -c=toLinearSpace(c); -#endif -result+=c*NoL;}} -result=result/weight;return result;}} -#ifdef ANISOTROPIC -fn radianceAnisotropic( -alphaTangent: f32, -alphaBitangent: f32, -inputTexture: texture_cube, -inputSampler: sampler, -inputView: vec3f, -inputTangent: vec3f, -inputBitangent: vec3f, -inputNormal: vec3f, -filteringInfo: vec2f, -noiseInput: vec2f -)->vec3f {var V: vec3f=inputView;var N: vec3f=inputNormal;var T: vec3f=inputTangent;var B: vec3f=inputBitangent;var R: vec3f=reflect(-V,N);var c: vec3f=textureSample(inputTexture,inputSampler,R).rgb;if (alphaTangent==0.f && alphaBitangent==0.f) { -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -return c;} -var result: vec3f=vec3f(0.f);var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var effectiveDim: f32=dim0*sqrt(alphaTangent*alphaBitangent);var omegaP: f32=(4.f*PI)/(6.f*effectiveDim*effectiveDim);let noiseScale: f32=clamp(log2(f32(NUM_SAMPLES))/12.0f,0.0f,1.0f);var weight: f32=0.f;for(var i: u32=0u; i0.f) {var pdf_inversed: f32=4./normalDistributionFunction_BurleyGGX_Anisotropic( -H_tangent.z,H_tangent.x,H_tangent.y,vec2(alphaTangent,alphaBitangent) -);var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp(l,0.0f,maxLevel);weight+=NoL;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,L,mipLevel).rgb; -#if GAMMA_INPUT -c=toLinearSpace(c); -#endif -result+=c*NoL;}} -result=result/weight;return result;} -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=i); diff --git a/assets/hdrIrradianceFiltering.fragment-BOnH3hN_.js b/assets/hdrIrradianceFiltering.fragment-BOnH3hN_.js deleted file mode 100644 index a461babdec665b720f52c9fde651cfd3366cf21b..0000000000000000000000000000000000000000 --- a/assets/hdrIrradianceFiltering.fragment-BOnH3hN_.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-Wgh3PIP0.js";import"./hdrFilteringFunctions-BDy1DXPD.js";import"./pbrBRDFFunctions-BKKbkltP.js";import"./index-DydPgVMC.js";const e="hdrIrradianceFilteringPixelShader",i=`#include -#include -#include -#include -var inputTextureSampler: sampler;var inputTexture: texture_cube; -#ifdef IBL_CDF_FILTERING -var icdfTextureSampler: sampler;var icdfTexture: texture_2d; -#endif -uniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=irradiance(inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo,0.0,vec3f(1.0),input.direction -#ifdef IBL_CDF_FILTERING -,icdfTexture,icdfTextureSampler -#endif -);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=i);const o={name:e,shader:i};export{o as hdrIrradianceFilteringPixelShaderWGSL}; diff --git a/assets/hdrIrradianceFiltering.fragment-uh7XTruA.js b/assets/hdrIrradianceFiltering.fragment-uh7XTruA.js deleted file mode 100644 index ad08f4d6ba8cfe45d5e75a7a0b2b984a2f13b689..0000000000000000000000000000000000000000 --- a/assets/hdrIrradianceFiltering.fragment-uh7XTruA.js +++ /dev/null @@ -1,13 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./hdrFilteringFunctions-B6pmqAql.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./index-DydPgVMC.js";const e="hdrIrradianceFilteringPixelShader",i=`#include -#include -#include -#include -uniform samplerCube inputTexture; -#ifdef IBL_CDF_FILTERING -uniform sampler2D icdfTexture; -#endif -uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=irradiance(inputTexture,direction,vFilteringInfo,0.0,vec3(1.0),direction -#ifdef IBL_CDF_FILTERING -,icdfTexture -#endif -);gl_FragColor=vec4(color*hdrScale,1.0);}`;r.ShadersStore[e]||(r.ShadersStore[e]=i);const a={name:e,shader:i};export{a as hdrIrradianceFilteringPixelShader}; diff --git a/assets/hdrIrradianceFiltering.vertex-Bji2KZhD.js b/assets/hdrIrradianceFiltering.vertex-Bji2KZhD.js deleted file mode 100644 index 67c0c821f2ea308e6509c27c38d0aeaa2a540783..0000000000000000000000000000000000000000 --- a/assets/hdrIrradianceFiltering.vertex-Bji2KZhD.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="hdrIrradianceFilteringVertexShader",t=`attribute position: vec2f;varying direction: vec3f;uniform up: vec3f;uniform right: vec3f;uniform front: vec3f; -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -var view: mat3x3f= mat3x3f(uniforms.up,uniforms.right,uniforms.front);vertexOutputs.direction=view*vec3f(input.position,1.0);vertexOutputs.position= vec4f(input.position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const o={name:e,shader:t};export{o as hdrIrradianceFilteringVertexShaderWGSL}; diff --git a/assets/hdrIrradianceFiltering.vertex-Dmgv4nxH.js b/assets/hdrIrradianceFiltering.vertex-Dmgv4nxH.js deleted file mode 100644 index 0336f79dccb94c3cdfd12ba48ec513c4192c3b4d..0000000000000000000000000000000000000000 --- a/assets/hdrIrradianceFiltering.vertex-Dmgv4nxH.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="hdrIrradianceFilteringVertexShader",r=`attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front; -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -mat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;i.ShadersStore[e]||(i.ShadersStore[e]=r);const n={name:e,shader:r};export{n as hdrIrradianceFilteringVertexShader}; diff --git a/assets/hdrTextureLoader-D7MVlk8u.js b/assets/hdrTextureLoader-D7MVlk8u.js deleted file mode 100644 index c6ae61fd517d51a84659ed3f4096c580d873e550..0000000000000000000000000000000000000000 --- a/assets/hdrTextureLoader-D7MVlk8u.js +++ /dev/null @@ -1 +0,0 @@ -import{R as l,a as c}from"./hdr-BUlPhc1F.js";import"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";class R{constructor(){this.supportCascades=!1}loadCubeData(){throw".hdr not supported in Cube."}loadData(s,e,p){const i=new Uint8Array(s.buffer,s.byteOffset,s.byteLength),t=l(i),r=c(i,t),n=t.width*t.height,o=new Float32Array(n*4);for(let a=0;a{const a=e.getEngine();e.type=1,e.format=5,e._gammaSpace=!1,a._uploadDataToTextureDirectly(e,o)})}}export{R as _HDRTextureLoader}; diff --git a/assets/helperFunctions-Wgh3PIP0.js b/assets/helperFunctions-Wgh3PIP0.js deleted file mode 100644 index 9043bb4e7faa7b1b1fc487728c88c2178dbc8852..0000000000000000000000000000000000000000 --- a/assets/helperFunctions-Wgh3PIP0.js +++ /dev/null @@ -1,76 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="helperFunctions",a=`const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08; -const LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3f=vec3f(0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;} -fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);} -fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));} -fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);} -fn maxEps(x: f32)->f32 {return max(x,Epsilon);} -fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));} -fn absEps(x: f32)->f32 {return abs(x)+Epsilon;} -fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f( -vec3(i0.x,i1.x,i2.x), -vec3(i0.y,i1.y,i2.y), -vec3(i0.z,i1.z,i2.z) -);return outMatrix;} -fn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det, -b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det, -b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);} -#if USE_EXACT_SRGB_CONVERSIONS -fn toLinearSpaceExact(color: vec3f)->vec3f -{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.04045)));} -fn toGammaSpaceExact(color: vec3f)->vec3f -{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.0031308)));} -#endif -fn toLinearSpace(color: f32)->f32 -{ -#if USE_EXACT_SRGB_CONVERSIONS -var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045); -#else -return pow(color,LinearEncodePowerApprox); -#endif -} -fn toLinearSpaceVec3(color: vec3f)->vec3f -{ -#if USE_EXACT_SRGB_CONVERSIONS -return toLinearSpaceExact(color); -#else -return pow(color,vec3f(LinearEncodePowerApprox)); -#endif -} -fn toLinearSpaceVec4(color: vec4)->vec4 -{ -#if USE_EXACT_SRGB_CONVERSIONS -return vec4f(toLinearSpaceExact(color.rgb),color.a); -#else -return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a); -#endif -} -fn toGammaSpace(color: vec4)->vec4 -{ -#if USE_EXACT_SRGB_CONVERSIONS -return vec4(toGammaSpaceExact(color.rgb),color.a); -#else -return vec4(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a); -#endif -} -fn toGammaSpaceVec3(color: vec3f)->vec3f -{ -#if USE_EXACT_SRGB_CONVERSIONS -return toGammaSpaceExact(color); -#else -return pow(color,vec3f(GammaEncodePowerApprox)); -#endif -} -fn squareVec3(value: vec3f)->vec3f -{return value*value;} -fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;} -fn getLuminance(color: vec3f)->f32 -{return saturate(dot(color,LuminanceEncodeApprox));} -fn getRand(seed: vec2)->f32 {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);} -fn dither(seed: vec2,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;} -const rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4 {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4(saturateVec3(rgb),D);} -fn fromRGBD(rgbd: vec4)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;} -fn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;} -fn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;} -fn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));} -fn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));} -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=a); diff --git a/assets/helperFunctions-tBt4f_K3.js b/assets/helperFunctions-tBt4f_K3.js deleted file mode 100644 index 809a0c508a2da102046132a8f7ed8bb02d9c51a7..0000000000000000000000000000000000000000 --- a/assets/helperFunctions-tBt4f_K3.js +++ /dev/null @@ -1,108 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const o="helperFunctions",a=`const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08; -const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001; -#define saturate(x) clamp(x,0.0,1.0) -#define absEps(x) abs(x)+Epsilon -#define maxEps(x) max(x,Epsilon) -#define saturateEps(x) clamp(x,Epsilon,1.0) -mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3( -vec3(i0.x,i1.x,i2.x), -vec3(i0.y,i1.y,i2.y), -vec3(i0.z,i1.z,i2.z) -);return outMatrix;} -mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11), -b11,(a22*a00-a02*a20),(-a12*a00+a02*a10), -b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;} -#if USE_EXACT_SRGB_CONVERSIONS -vec3 toLinearSpaceExact(vec3 color) -{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4)); -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045))); -#else -return -vec3( -color.r<=0.04045 ? nearZeroSection.r : remainingSection.r, -color.g<=0.04045 ? nearZeroSection.g : remainingSection.g, -color.b<=0.04045 ? nearZeroSection.b : remainingSection.b); -#endif -} -vec3 toGammaSpaceExact(vec3 color) -{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055); -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308))); -#else -return -vec3( -color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r, -color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g, -color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b); -#endif -} -#endif -float toLinearSpace(float color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection; -#else -return pow(color,LinearEncodePowerApprox); -#endif -} -vec3 toLinearSpace(vec3 color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -return toLinearSpaceExact(color); -#else -return pow(color,vec3(LinearEncodePowerApprox)); -#endif -} -vec4 toLinearSpace(vec4 color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -return vec4(toLinearSpaceExact(color.rgb),color.a); -#else -return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a); -#endif -} -float toGammaSpace(float color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection; -#else -return pow(color,GammaEncodePowerApprox); -#endif -} -vec3 toGammaSpace(vec3 color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -return toGammaSpaceExact(color); -#else -return pow(color,vec3(GammaEncodePowerApprox)); -#endif -} -vec4 toGammaSpace(vec4 color) -{ -#if USE_EXACT_SRGB_CONVERSIONS -return vec4(toGammaSpaceExact(color.rgb),color.a); -#else -return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a); -#endif -} -float square(float value) -{return value*value;} -vec3 square(vec3 value) -{return value*value;} -float pow5(float value) {float sq=value*value;return sq*sq*value;} -float getLuminance(vec3 color) -{return saturate(dot(color,LuminanceEncodeApprox));} -float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);} -float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;} -const float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);} -vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;} -vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;} -vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;} -float sqrtClamped(float value) {return sqrt(max(value,0.));} -float avg(vec3 value) {return dot(value,vec3(0.333333333));} -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -uint extractBits(uint value,int offset,int width) {return (value>>offset) & ((1u<>23)-0x7f;} -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=a); diff --git a/assets/html-BZIV6tyB.js b/assets/html-BZIV6tyB.js deleted file mode 100644 index 5574e78de464f1f34fc668d77cf27afafa0b6708..0000000000000000000000000000000000000000 --- a/assets/html-BZIV6tyB.js +++ /dev/null @@ -1 +0,0 @@ -import{t as E,b as $,r as N,c as b,d as h,g as l,h as m,e as u,i as v,C as D,j as O,k as R,H as w,D as C,s as M,l as T,m as g,F as y,n as k,o as A}from"./index-DydPgVMC.js";function F(_,o,i){if(!o||o===T(String(i??"")))return;let a;const t=_.__svelte_meta?.loc;t?a=`near ${t.file}:${t.line}:${t.column}`:g?.[y]&&(a=`in ${g[y]}`),k(A(a))}function I(_,o,i=!1,a=!1,t=!1){var d=_,n="";E(()=>{var f=$;if(n===(n=o()??"")){m&&u();return}if(f.nodes!==null&&(N(f.nodes.start,f.nodes.end),f.nodes=null),n!==""){if(m){for(var p=v.data,e=u(),c=e;e!==null&&(e.nodeType!==D||e.data!=="");)c=e,e=O(e);if(e===null)throw R(),w;C&&!t&&F(e.parentNode,p,n),h(v,c),d=M(e);return}var r=n+"";i?r=`${r}`:a&&(r=`${r}`);var s=b(r);if((i||a)&&(s=l(s)),h(l(s),s.lastChild),i||a)for(;l(s);)d.before(l(s));else d.before(s)}})}export{I as h}; diff --git a/assets/i18n-CPHyzK9b.js b/assets/i18n-CPHyzK9b.js deleted file mode 100644 index 098f3d9d7f62b78554908c812240a7f72b152695..0000000000000000000000000000000000000000 --- a/assets/i18n-CPHyzK9b.js +++ /dev/null @@ -1,14 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Index-DCmnrJma.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./Block-WPcVj6Bq.js","./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js","./snippet-BtHMuX3s.js","./ScrollFade-FmR1tTNV.css","./index-CfM_uZQa.js","./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js","./html-BZIV6tyB.js","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BR8cTgGu.js","./Index.svelte_svelte_type_style_lang-glBt5fcY.js","./Index-B186V_yQ.css","./Index-DvrXZaOJ.css","./Index-BdR5tpCt.js","./BlockLabel-BzVeVrtL.js","./Empty-B15ItVsj.js","./Image-DBmW1mOo.js","./IconButtonWrapper-PnNNNvqI.js","./FullscreenButton-BuyUU5Yj.js","./Maximize-DWbY8BRa.js","./Index-BjEXz2Gh.css","./StaticAudio-BzxlNlBs.js","./DownloadLink-DM2QmhDx.js","./ShareButton-Cuvs43xM.js","./Download-DWSaBiea.js","./Music-CGJUBXWE.js","./MinimalAudioPlayer-C59qi7fl.js","./MinimalAudioPlayer-D1oBZzHX.css","./VolumeLevels-B3WBv7ou.js","./Play-CRvn2HoA.js","./Undo-B9SlrYtT.js","./StaticAudio-CFEfmObW.css","./Example-DXbKzhJW.js","./Example-BtwnqNJe.css","./index-tDF4sm9q.js","./Upload-Bq9KuxCu.js","./actions-4RaHFoGI.js","./Upload-DNsX9s0p.css","./ModifyUpload-BL388q45.js","./Edit-G5CCT_vc.js","./StreamingBar-CzgHaKX0.js","./record.esm-EHLfhwCm.js","./Spinner-C4Ov0as9.js","./UploadText-CYQRFBCv.js","./index--7bATQTw.css","./Index-rdevcKty.js","./Index-Pd9Hkw9h.js","./__vite-browser-external-D7Ct-6yo.js","./Index-CMb7sSjM.js","./Button-CV36sOqf.js","./Image-CZ1Hb99p.js","./misc-Dkc5KZ-v.js","./Image-dcYq_y3_.css","./Button-hbTB5kNr.css","./ImagePreview-BZaoS7p0.css","./Index-DwTi2bAp.js","./input-BtIxlP_B.js","./Check-2f8HlfSn.js","./Copy-B3jzejpA.js","./File-_VpQFuKr.js","./MarkdownCode-BTj729_f.js","./prism-python-BGiTAEDL.js","./MarkdownCode-IpEvB2op.css","./event-modifiers-CdEA5IGF.js","./Trash-CJrspSVZ.js","./Index-MOOuImgb.css","./Example-ByqvSEWx.js","./Example-DBxJzwqA.css","./Index-C1l8r8dW.js","./Info-DfrMwI06.js","./Checkbox-Bh_yH8eu.js","./universal-C9tCO36V.js","./Checkbox-CeUlgVWK.css","./Example-BeGmkx97.js","./Example-DurgdhUf.css","./Index-D9gv-97d.js","./BlockTitle-DNiCHWOR.js","./index-tFQomdd2.js","./Index-Dy9inwsT.css","./Example-CCIKPQQj.js","./Example-DJcb6y4A.css","./Index-DHLZt6aU.js","./Code-Bhm2YgEI.js","./Code-C-hu7Aas.css","./Code-D1inKIZZ.js","./Example-Cjtz6ob8.js","./Example-By1kwJfU.css","./Index-BwNRdNZh.js","./tinycolor-D4ULLcDx.js","./Index-Ihta0Riu.css","./Index-DoGUZ99P.js","./index-CMKhGNWj.js","./Example-DeD_Ynkp.js","./Example-7fnN8czV.css","./Index-AN_eS0Ag.js","./size-D4lmUoTq.js","./DropdownArrow-Cq3QAKSv.js","./dsv-DB8NKgIY.js","./Index-CJla75AA.css","./Index-DEV3zA_w.js","./key-CFGu0zzg.js","./Textbox-BhB0hOv8.js","./Send-oZH_TPNw.js","./Square-D8rV3Ea-.js","./Textbox-D-AXA9VE.css","./Example-Cr4dhaJx.js","./Example-DR0uKad_.css","./Index-D1gOIZ6s.css","./Example-BfoDEvJC.js","./Index-BhX9aXr4.js","./Index-gKhMYaJ-.css","./Example-FH892lPu.js","./Example-CP3d5i8y.css","./Index-BrbNPUGv.js","./Plus-BDmybZhd.js","./Dropdown-CVRP4i7q.js","./window-D5YXrKnH.js","./Dropdown-DBcOp-Nh.css","./Index-C-YHoOo7.css","./Example-nXsgr46n.css","./Index-uGItVsFZ.js","./Index-CazkECwp.css","./Index-C7w0jeUn.js","./Index-wkVPQfMp.css","./Example-BGlyl4O8.js","./Index-D7qviIOH.js","./Example-BPjTUpdK.js","./Example-CY4ljyPT.css","./Index-HqnXgC8B.js","./FileUpload-CCPLw8R5.js","./FileUpload-BnnMQTkb.css","./Example-CXAPpj07.js","./Example-CTHygmei.css","./Index-BSJNfw0b.js","./Index-DYfwvh_i.css","./Index-DMgk5BHD.js","./BaseForm-DAripPNq.js","./BaseForm-LdQUnEHK.css","./Gallery-CRb8iS3j.js","./Video-BOdhnjQz.js","./Video-DyLrJtRU.css","./Gallery-Beg009e0.css","./Example-aWuNv4qC.js","./Example-CesCik-g.css","./Index-CqEPR_xM.js","./Webcam-B-wg5Ly_.js","./ImageUploader-BRUNiKXB.css","./Index-DdSwbuz1.css","./Example-DEQ0XKtP.css","./Index-CST2XYRw.js","./Index-4dt4eNOM.css","./Index-C8Nr7g5M.js","./color-Be3KLOYu.js","./Index-upnJsz5h.css","./HTML-Bcdz-vxU.js","./HTML-DW76ylkb.css","./Example-q7qW2djY.js","./Example-CxswVN_j.css","./Index-BCvXC7_h.js","./Index-tGw5fzaP.css","./ImagePreview-C41duyJ0.js","./Example-oI9QHs-R.js","./Index-BzE3i7lA.js","./Example-D-alj4yz.js","./Example-CM-hX66J.css","./Index-EyePZPlZ.js","./ArrowUp-aILrPIpo.js","./Index-AdotVEes.css","./Example-CT_gDfRl.js","./Example-KSJSwGi6.css","./Index-BFeI9nh0.js","./select-BigU4G0v.js","./dispatch-kxCwF96_.js","./Index-CTgIn-jJ.css","./Example-DT5PcEOk.js","./JSON-DVsUg528.js","./JSON-D8u3VAXJ.css","./Example-DmI1TLZY.css","./Index-DHTKmW0i.js","./Index-DdDmW6aI.js","./LineChart-DuGokVK_.js","./Index-CPWW4ysP.css","./Example-DuOJfHh3.js","./Example--4J3Orww.css","./Index-BJ4MJC7J.js","./Index.svelte_svelte_type_style_lang-C-orki39.js","./Index-D-Qschx6.css","./ScrollFade-CeVpKVW3.js","./Model3D-gDU5RKVo.js","./Model3D-cNy47jlJ.css","./Example-7FcnnBll.js","./Example-CkquX_0q.css","./Index-BGogXhGp.js","./Index-DEciOB5z.css","./Example-CxjbLxdV.js","./Example-3fmdhxWO.css","./Index-CvbBGSYW.js","./Index-VmWwlqWT.css","./Example-Biakqy76.js","./Index-CbuW6Q7r.js","./Index-DasIhDPn.css","./Index-sTTH5Ggb.js","./Example-BZRf8B4s.js","./Example-DCvUey5Q.js","./Example-CXu17WvP.css","./Index-CXTNaUIU.js","./Index-D1R2QBzt.css","./Example-9DdwI8aj.js","./Example-BK62E0Ka.css","./Index-D2aFMIjl.js","./Index-C1ggaBnW.css","./Plot-CYQ3vpBc.js","./Index-CdACL_KS.js","./Example-I6GSpyxR.js","./Example-CF05pux8.css","./Index-Df136VmG.js","./Index-Dp4tkqBJ.css","./Index-BxmsNHzG.js","./Index-DtUEnvDs.css","./Index-bS4AvZnj.js","./Index-BQ7JPxWG.css","./Example-B3rqw2Wc.js","./Example-z8fy9-fN.css","./Index-B1nUzmPt.js","./Index-CWSBFuBl.css","./Index-CXv3_vP_.js","./index-cG1Y315J.js","./state.svelte-DpHZj3x1.js","./Index-Da0Ogfu8.js","./Walkthrough-BWP9RaPo.js","./Walkthrough-DQW4_m0-.css","./Index-CoEg4HcU.css","./Index-ft-iSOp9.js","./Index-Dynj1EXQ.js","./Index-C_R__XCO.js","./Index-Cp7-lnfK.js","./Index-DwhGy66B.css","./Index-9wedEojI.js","./Index-DfYZbHJT.css","./VideoPreview-C1GJVo16.js","./VideoPreview-CU187u-n.css","./Example-Cpd2Jjnh.js","./Example-BtQ1P_jx.css","./index-CeMVyRym.js","./index-CPvQEOxi.css","./Index-D8iPfACD.js","./Index-rSt4w3ma.css","./Example-BswZLX-K.js","./Example-CFO0bQ11.css","./Index-CT81CJxE.js","./Index-CAMpVLqe.css"])))=>i.map(i=>d[i]); -import{D as z,W as kt,b2 as Gr,b3 as ni,B as he,b4 as $t,b5 as ne,b6 as zt,am as Se,b7 as oe,b8 as ii,b9 as jr,h as D,i as Ae,p as Fr,E as oi,e as Xt,ba as kr,aG as $r,aH as Ot,s as ze,ap as ie,Z as w,az as lr,bb as zr,ad as Xr,bc as Wt,bd as ai,be as si,a0 as Le,aD as It,bf as ui,bg as Y,bh as ct,J as Zt,bi as li,bj as fi,j as ci,g as hi,C as pi,bk as _i,bl as Wr,u as tt,bm as di,L as mi,I as Zr,z as bi,K as vi,bn as gi,aN as Ei,bo as yi,bp as xi,bq as Ti,br as Ai,ah as Pi,aj as Oi,bs as Ii,aE as Si,bt as Li,bu as wi,bv as Ri,bw as Hi,w as Di,v as Z,bx as qt,by as Bi,ag as Ni,ac as we,bz as St,bA as Ci,x as Xe,bB as qr,a$ as ee,y as Mi,$ as te,bC as Vi,aK as Lt,bD as Ui,bE as Yr,ab as wt,b as Yt,bF as Gi,bG as ji,bH as Fi,bI as ki,bJ as $i,a_ as ge,bK as Qr,aL as fr,bL as cr,bM as zi,bN as Xi,bO as Wi,bP as Zi,bQ as qi,bR as Yi,bS as Qi,M as Ji,Y as ht,_ as Ki,t as Ge,a as je,O as eo,R as rt,P as j,S as Ee,Q as $,X as Fe,a2 as to,ar as ro,T as F,a5 as hr,af as c,aa as pt}from"./index-DydPgVMC.js";var no="font-weight: bold",io="font-weight: normal";function pr(e){z?console.warn(`%c[svelte] state_snapshot_uncloneable -%c${e?`The following properties cannot be cloned with \`$state.snapshot\` — the return value contains the originals: - -${e}`:"Value cannot be cloned with `$state.snapshot` — the original value was returned"} -https://svelte.dev/e/state_snapshot_uncloneable`,no,io):console.warn("https://svelte.dev/e/state_snapshot_uncloneable")}const oo=[];function ao(e,t=!1,r=!1){if(z&&!t){const n=[],i=Re(e,new Map,"",n,null,r);if(n.length===1&&n[0]==="")pr();else if(n.length>0){const o=n.length>10?n.slice(0,7):n.slice(0,10),a=n.length-o.length;let s=o.map(u=>`- ${u}`).join(` -`);a>0&&(s+=` -- ...and ${a} more`),pr(s)}return i}return Re(e,new Map,"",oo,null,r)}function Re(e,t,r,n,i=null,o=!1){if(typeof e=="object"&&e!==null){var a=t.get(e);if(a!==void 0)return a;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(kt(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var u=0;u{var t=he;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#r.get(r);if(n)$t(n),this.#n.delete(r);else{var i=this.#e.get(r);i&&(this.#r.set(r,i.effect),this.#e.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[o,a]of this.#t){if(this.#t.delete(o),o===t)break;const s=this.#e.get(a);s&&(ne(s.effect),this.#e.delete(a))}for(const[o,a]of this.#r){if(o===r||this.#n.has(o))continue;const s=()=>{if(Array.from(this.#t.values()).includes(o)){var l=document.createDocumentFragment();ii(a,l),l.append(Se()),this.#e.set(o,{effect:a,fragment:l})}else ne(a);this.#n.delete(o),this.#r.delete(o)};this.#i||!n?(this.#n.add(o),zt(a,s,!1)):s()}}};#a=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,i]of this.#e)r.includes(n)||(ne(i.effect),this.#e.delete(n))};ensure(t,r){var n=he,i=jr();if(r&&!this.#r.has(t)&&!this.#e.has(t))if(i){var o=document.createDocumentFragment(),a=Se();o.append(a),this.#e.set(t,{effect:oe(()=>r(a)),fragment:o})}else this.#r.set(t,oe(()=>r(this.anchor)));if(this.#t.set(n,t),i){for(const[s,u]of this.#r)s===t?n.skipped_effects.delete(u):n.skipped_effects.add(u);for(const[s,u]of this.#e)s===t?n.skipped_effects.delete(u.effect):n.skipped_effects.add(u.effect);n.oncommit(this.#o),n.ondiscard(this.#a)}else D&&(this.anchor=Ae),this.#o()}}function _r(e,t,r=!1){D&&Xt();var n=new so(e),i=r?oi:0;function o(a,s){if(D){const l=kr(e)===$r;if(a===l){var u=Ot();ze(u),n.anchor=u,ie(!1),n.ensure(a,s),ie(!0);return}}n.ensure(a,s)}Fr(()=>{var a=!1;t((s,u=!0)=>{a=!0,o(u,s)}),a||o(!1,null)},i)}function uo(e,t){return t}function lo(e,t,r){for(var n=[],i=t.length,o,a=t.length,s=0;s{if(o){if(o.pending.delete(_),o.done.add(_),o.pending.size===0){var h=e.outrogroups;Rt(Wt(o.done)),h.delete(o),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var u=n.length===0&&r!==null;if(u){var l=r,f=l.parentNode;fi(f),f.append(l),e.items.clear()}Rt(t,!u)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Rt(e,t=!0){for(var r=0;r{var p=r();return kt(p)?p:p==null?[]:Wt(p)}),h,b=!0;function g(){d.fallback=f,co(d,h,a,t,n),f!==null&&(h.length===0?(f.f&Y)===0?$t(f):(f.f^=Y,Pe(f,null,a)):zt(f,()=>{f=null}))}var x=Fr(()=>{h=w(_);var p=h.length;let v=!1;if(D){var m=kr(a)===$r;m!==(p===0)&&(a=Ot(),ze(a),ie(!1),v=!0)}for(var y=new Set,A=he,E=jr(),P=0;Po(a)):(f=oe(()=>o(dr??=Se())),f.f|=Y)),D&&p>0&&ze(Ot()),!b)if(E){for(const[ue,le]of s)y.has(ue)||A.skipped_effects.add(le.e);A.oncommit(g),A.ondiscard(()=>{})}else g();v&&ie(!0),w(_)}),d={effect:x,items:s,outrogroups:null,fallback:f};b=!1,D&&(a=Ae)}function co(e,t,r,n,i){var o=(n&li)!==0,a=t.length,s=e.items,u=e.effect.first,l,f=null,_,h=[],b=[],g,x,d,p;if(o)for(p=0;p0){var C=(n&zr)!==0&&a===0?r:null;if(o){for(p=0;p{if(_!==void 0)for(d of _)d.nodes?.a?.apply()})}function ho(e,t,r,n,i,o,a,s){var u=(a&ai)!==0?(a&si)===0?Le(r,!1,!1):It(r):null,l=(a&ui)!==0?It(i):null;return z&&u&&(u.trace=()=>{s()[l?.v??i]}),{v:u,i:l,e:oe(()=>(o(t,u??r,l??i,s),()=>{e.delete(n)}))}}function Pe(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,o=t&&(t.f&Y)===0?t.nodes.start:r;n!==null;){var a=ci(n);if(o.before(n),n===i)return;n=a}}function Q(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function po(e,t,r,n,i){D&&Xt();var o=t.$$slots?.[r],a=!1;o===!0&&(o=t[r==="default"?"children":r],a=!0),o===void 0||o(e,a?()=>n:n)}function _o(e,t){var r=void 0,n;Wr(()=>{r!==(r=t())&&(n&&(ne(n),n=null),r&&(n=oe(()=>{tt(()=>r(e))})))})}function Jr(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=a+o;(a===0||mr.includes(n[a-1]))&&(s===n.length||mr.includes(n[s]))?n=(a===0?"":n.substring(0,a))+n.substring(s+1):a=s}}return n===""?null:n}function br(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var o=e[i];o!=null&&o!==""&&(n+=" "+i+": "+o+r)}return n}function _t(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function go(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,s=!1,u=[];n&&u.push(...Object.keys(n).map(_t)),i&&u.push(...Object.keys(i).map(_t));var l=0,f=-1;const x=e.length;for(var _=0;_{qe(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Zr(()=>{t.disconnect()})}function Vs(e,t,r=t){var n=new WeakSet,i=!0;bi(e,"change",o=>{var a=o?"[selected]":":checked",s;if(e.multiple)s=[].map.call(e.querySelectorAll(a),He);else{var u=e.querySelector(a)??e.querySelector("option:not([disabled])");s=u&&He(u)}r(s),he!==null&&n.add(he)}),tt(()=>{var o=t();if(e===document.activeElement){var a=vi??he;if(n.has(a))return}if(qe(e,o,i),i&&o===void 0){var s=e.querySelector(":checked");s!==null&&(o=He(s),r(o))}e.__value=o,i=!1}),en(e)}function He(e){return"__value"in e?e.__value:e.value}const ye=Symbol("class"),xe=Symbol("style"),tn=Symbol("is custom element"),rn=Symbol("is html");function Eo(e){if(D){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;q(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var i=e.checked;q(e,"checked",null),e.checked=i}}};e.__on_r=r,Zt(r),Ri()}}function Us(e,t){var r=nt(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function Gs(e,t){var r=nt(e);r.checked!==(r.checked=t??void 0)&&(e.checked=t)}function yo(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function q(e,t,r,n){var i=nt(e);if(D&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")){n||To(e,t,r??"");return}i[t]!==(i[t]=r)&&(t==="loading"&&(e[gi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&nn(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function xo(e,t,r,n,i=!1,o=!1){if(D&&i&&e.tagName==="INPUT"){var a=e,s=a.type==="checkbox"?"defaultChecked":"defaultValue";s in r||Eo(a)}var u=nt(e),l=u[tn],f=!u[rn];let _=D&&l;_&&ie(!1);var h=t||{},b=e.tagName==="OPTION";for(var g in t)g in r||(r[g]=null);r.class?r.class=bo(r.class):(n||r[ye])&&(r.class=null),r[xe]&&(r.style??=null);var x=nn(e);for(const E in r){let P=r[E];if(b&&E==="value"&&P==null){e.value=e.__value="",h[E]=P;continue}if(E==="class"){var d=e.namespaceURI==="http://www.w3.org/1999/xhtml";Oe(e,d,P,n,t?.[ye],r[ye]),h[E]=P,h[ye]=r[ye];continue}if(E==="style"){Kr(e,P,t?.[xe],r[xe]),h[E]=P,h[xe]=r[xe];continue}var p=h[E];if(!(P===p&&!(P===void 0&&e.hasAttribute(E)))){h[E]=P;var v=E[0]+E[1];if(v!=="$$")if(v==="on"){const H={},C="$$"+E;let O=E.slice(2);var m=Li(O);if(Ti(O)&&(O=O.slice(0,-7),H.capture=!0),!m&&p){if(P!=null)continue;e.removeEventListener(O,h[C],H),h[C]=null}if(P!=null)if(m)e[`__${O}`]=P,Pi([O]);else{let ue=function(le){h[E].call(this,le)};h[C]=Ai(O,e,ue,H)}else m&&(e[`__${O}`]=void 0)}else if(E==="style")q(e,E,P);else if(E==="autofocus")Oi(e,!!P);else if(!l&&(E==="__value"||E==="value"&&P!=null))e.value=e.__value=P;else if(E==="selected"&&b)yo(e,P);else{var y=E;f||(y=Ii(y));var A=y==="defaultValue"||y==="defaultChecked";if(P==null&&!l&&!A)if(u[E]=null,y==="value"||y==="checked"){let H=e;const C=t===void 0;if(y==="value"){let O=H.defaultValue;H.removeAttribute(y),H.defaultValue=O,H.value=H.__value=C?O:null}else{let O=H.defaultChecked;H.removeAttribute(y),H.defaultChecked=O,H.checked=C?O:!1}}else e.removeAttribute(E);else A||x.includes(y)&&(l||typeof P!="string")?(e[y]=P,y in u&&(u[y]=Si)):typeof P!="function"&&q(e,y,P,o)}}}return _&&ie(!0),h}function js(e,t,r=[],n=[],i=[],o,a=!1,s=!1){Ei(i,r,n,u=>{var l=void 0,f={},_=e.nodeName==="SELECT",h=!1;if(Wr(()=>{var g=t(...u.map(w)),x=xo(e,l,g,o,a,s);h&&_&&"value"in g&&qe(e,g.value);for(let p of Object.getOwnPropertySymbols(f))g[p]||ne(f[p]);for(let p of Object.getOwnPropertySymbols(g)){var d=g[p];p.description===yi&&(!l||d!==l[p])&&(f[p]&&ne(f[p]),f[p]=oe(()=>_o(e,()=>d))),x[p]=d}l=x}),_){var b=e;tt(()=>{qe(b,l.value,!0),en(b)})}h=!0})}function nt(e){return e.__attributes??={[tn]:e.nodeName.includes("-"),[rn]:e.namespaceURI===xi}}var vr=new Map;function nn(e){var t=e.getAttribute("is")||e.nodeName,r=vr.get(t);if(r)return r;vr.set(t,r=[]);for(var n,i=e,o=Element.prototype;o!==i;){n=wi(i);for(var a in n)n[a].set&&r.push(a);i=Gr(i)}return r}function To(e,t,r){z&&(t==="srcset"&&Ao(e,r)||Ht(e.getAttribute(t)??"",r)||Hi(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(r)))}function Ht(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function gr(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function Ao(e,t){var r=gr(e.srcset),n=gr(t);return n.length===r.length&&n.every(([i,o],a)=>o===r[a][1]&&(Ht(r[a][0],i)||Ht(i,r[a][0])))}function Er(e,t){return e===t||e?.[qt]===t}function Po(e={},t,r,n){return tt(()=>{var i,o;return Di(()=>{i=o,o=n?.()||[],Z(()=>{e!==r(...o)&&(t(e,...o),i&&Er(r(...i),e)&&t(null,...i))})}),()=>{Zt(()=>{o&&Er(r(...o),e)&&t(null,...o)})}}),e}function Oo(e=!1){const t=Bi,r=t.l.u;if(!r)return;let n=()=>Xe(t.s);if(e){let i=0,o={};const a=qr(()=>{let s=!1;const u=t.s;for(const l in u)u[l]!==o[l]&&(o[l]=u[l],s=!0);return s&&i++,i});n=()=>w(a)}r.b.length&&Ni(()=>{yr(t,n),St(r.b)}),we(()=>{const i=Z(()=>r.m.map(Ci));return()=>{for(const o of i)typeof o=="function"&&o()}}),r.a.length&&we(()=>{yr(t,n),St(r.a)})}function yr(e,t){if(e.l.s)for(const r of e.l.s)w(r);t()}function Qt(e,t,r){if(e==null)return t(void 0),r&&r(void 0),ee;const n=Z(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}const fe=[];function Io(e,t){return{subscribe:Ce(e,t).subscribe}}function Ce(e,t=ee){let r=null;const n=new Set;function i(s){if(Mi(e,s)&&(e=s,r)){const u=!fe.length;for(const l of n)l[1](),fe.push(l,e);if(u){for(let l=0;l{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:a}}function ae(e,t,r){const n=!Array.isArray(e),i=n?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return Io(r,(a,s)=>{let u=!1;const l=[];let f=0,_=ee;const h=()=>{if(f)return;_();const g=t(n?l[0]:l,a,s);o?a(g):_=typeof g=="function"?g:ee},b=i.map((g,x)=>Qt(g,d=>{l[x]=d,f&=~(1<{f|=1<t=r)(),t}let ke=!1,Dt=Symbol();function xr(e,t,r){const n=r[t]??={store:null,source:Le(void 0),unsubscribe:ee};if(z&&(n.source.label=t),n.store!==e&&!(Dt in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=ee;else{var i=!0;n.unsubscribe=Qt(e,o=>{i?n.source.v=o:te(n.source,o)}),i=!1}return e&&Dt in r?Jt(e):w(n.source)}function Fs(e,t){return e.set(t),t}function So(){const e={};function t(){Zr(()=>{for(var r in e)e[r].unsubscribe();Vi(e,Dt,{enumerable:!1,value:!0})})}return[e,t]}function Lo(e){var t=ke;try{return ke=!1,[e(),ke]}finally{ke=t}}function ks(e,t=1){const r=e();return e(r+t),r}const wo={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return z&&zi(`${e.name}.${String(t)}`),!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function $s(e,t,r){return new Proxy(z?{props:e,exclude:t,name:r,other:{},to_proxy:[]}:{props:e,exclude:t},wo)}const Ro={get(e,t){if(!e.exclude.includes(t))return w(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,r){if(!(t in e.special)){var n=Yt;try{cr(e.parent_effect),e.special[t]=G({get[t](){return e.props[t]}},t,Yr)}finally{cr(n)}}return e.special[t](r),fr(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),fr(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function zs(e,t){return new Proxy({props:e,exclude:t,special:{},version:It(0),parent_effect:Yt},Ro)}const Ho={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(ge(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let i=e.props[n];ge(i)&&(i=i());const o=Lt(i,t);if(o&&o.set)return o.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(ge(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const i=Lt(n,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===qt||t===Qr)return!1;for(let r of e.props)if(ge(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(ge(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function Xs(...e){return new Proxy({props:e},Ho)}function G(e,t,r,n){var i=!Xi||(r&Wi)!==0,o=(r&ji)!==0,a=(r&ki)!==0,s=n,u=!0,l=()=>(u&&(u=!1,s=a?Z(n):n),s),f;if(o){var _=qt in e||Qr in e;f=Lt(e,t)?.set??(_&&t in e?m=>e[t]=m:void 0)}var h,b=!1;o?[h,b]=Lo(()=>e[t]):h=e[t],h===void 0&&n!==void 0&&(h=l(),f&&(i&&Ui(t),f(h)));var g;if(i?g=()=>{var m=e[t];return m===void 0?l():(u=!0,m)}:g=()=>{var m=e[t];return m!==void 0&&(s=void 0),m===void 0?s:m},i&&(r&Yr)===0)return g;if(f){var x=e.$$legacy;return(function(m,y){return arguments.length>0?((!i||!y||x||b)&&f(y?g():m),m):g()})}var d=!1,p=((r&Fi)!==0?qr:Xr)(()=>(d=!1,g()));z&&(p.label=t),o&&w(p);var v=Yt;return(function(m,y){if(arguments.length>0){const A=y?w(p):i&&o?wt(m):m;return te(p,A),d=!0,s!==void 0&&(s=A),m}return $i&&d||(v.f&Gi)!==0?p.v:w(p)})}Zi();qi();function Do(e){let t;const r=Yi(i=>{let o=!1;const a=e.subscribe(s=>{t=s,o&&i()});return o=!0,a});function n(){return Qi()?(r(),t):Jt(e)}return"set"in e?{get current(){return n()},set current(i){e.set(i)}}:{get current(){return n()}}}const Bo="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='10'%20fill='none'%3e%3cpath%20fill='%23FF3270'%20d='M1.93%206.03v2.04h2.04V6.03H1.93Z'/%3e%3cpath%20fill='%23861FFF'%20d='M6.03%206.03v2.04h2.04V6.03H6.03Z'/%3e%3cpath%20fill='%23097EFF'%20d='M1.93%201.93v2.04h2.04V1.93H1.93Z'/%3e%3cpath%20fill='%23000'%20fill-rule='evenodd'%20d='M.5%201.4c0-.5.4-.9.9-.9h3.1a.9.9%200%200%201%20.87.67A2.44%202.44%200%200%201%209.5%202.95c0%20.65-.25%201.24-.67%201.68.39.1.67.46.67.88v3.08c0%20.5-.4.91-.9.91H1.4a.9.9%200%200%201-.9-.9V1.4Zm1.43.53v2.04h2.04V1.93H1.93Zm0%206.14V6.03h2.04v2.04H1.93Zm4.1%200V6.03h2.04v2.04H6.03Zm0-5.12a1.02%201.02%200%201%201%202.04%200%201.02%201.02%200%200%201-2.04%200Z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23FFD702'%20d='M7.05%201.93a1.02%201.02%200%201%200%200%202.04%201.02%201.02%200%200%200%200-2.04Z'/%3e%3c/svg%3e";var Ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zs(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var mt,Tr;function Co(){if(Tr)return mt;Tr=1;var e=function(v){return t(v)&&!r(v)};function t(p){return!!p&&typeof p=="object"}function r(p){var v=Object.prototype.toString.call(p);return v==="[object RegExp]"||v==="[object Date]"||o(p)}var n=typeof Symbol=="function"&&Symbol.for,i=n?Symbol.for("react.element"):60103;function o(p){return p.$$typeof===i}function a(p){return Array.isArray(p)?[]:{}}function s(p,v){return v.clone!==!1&&v.isMergeableObject(p)?x(a(p),p,v):p}function u(p,v,m){return p.concat(v).map(function(y){return s(y,m)})}function l(p,v){if(!v.customMerge)return x;var m=v.customMerge(p);return typeof m=="function"?m:x}function f(p){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(p).filter(function(v){return Object.propertyIsEnumerable.call(p,v)}):[]}function _(p){return Object.keys(p).concat(f(p))}function h(p,v){try{return v in p}catch{return!1}}function b(p,v){return h(p,v)&&!(Object.hasOwnProperty.call(p,v)&&Object.propertyIsEnumerable.call(p,v))}function g(p,v,m){var y={};return m.isMergeableObject(p)&&_(p).forEach(function(A){y[A]=s(p[A],m)}),_(v).forEach(function(A){b(p,A)||(h(p,A)&&m.isMergeableObject(v[A])?y[A]=l(A,m)(p[A],v[A],m):y[A]=s(v[A],m))}),y}function x(p,v,m){m=m||{},m.arrayMerge=m.arrayMerge||u,m.isMergeableObject=m.isMergeableObject||e,m.cloneUnlessOtherwiseSpecified=s;var y=Array.isArray(v),A=Array.isArray(p),E=y===A;return E?y?m.arrayMerge(p,v,m):g(p,v,m):s(v,m)}x.all=function(v,m){if(!Array.isArray(v))throw new Error("first argument should be an array");return v.reduce(function(y,A){return x(y,A,m)},{})};var d=x;return mt=d,mt}var Mo=Co();const Vo=No(Mo);var Bt=function(e,t){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Bt(e,t)};function it(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Bt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var L=function(){return L=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u"&&(o=e.call(this,n),t.set(i,o)),o}function on(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function an(e,t,r,n,i){return r.bind(t,e,n,i)}function Fo(e,t){var r=e.length===1?jo:on;return an(e,this,r,t.cache.create(),t.serializer)}function ko(e,t){return an(e,this,on,t.cache.create(),t.serializer)}var $o=function(){return JSON.stringify(arguments)},zo=(function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,r){this.cache[t]=r},e})(),Xo={create:function(){return new zo}},gt={variadic:ko},I;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(I||(I={}));var R;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(R||(R={}));var pe;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(pe||(pe={}));function Ar(e){return e.type===R.literal}function Wo(e){return e.type===R.argument}function sn(e){return e.type===R.number}function un(e){return e.type===R.date}function ln(e){return e.type===R.time}function fn(e){return e.type===R.select}function cn(e){return e.type===R.plural}function Zo(e){return e.type===R.pound}function hn(e){return e.type===R.tag}function pn(e){return!!(e&&typeof e=="object"&&e.type===pe.number)}function Nt(e){return!!(e&&typeof e=="object"&&e.type===pe.dateTime)}var _n=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,qo=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Yo(e){var t={};return e.replace(qo,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"long":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var Qo=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Jo(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(Qo).filter(function(h){return h.length>0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(ea,function(u,l,f,_,h,b){if(l)t.minimumIntegerDigits=f.length;else{if(_&&h)throw new Error("We currently do not support maximum integer digits");if(b)throw new Error("We currently do not support exact integer digits")}return""});continue}if(mn.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Pr.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Pr,function(u,l,f,_,h,b){return f==="*"?t.minimumFractionDigits=l.length:_&&_[0]==="#"?t.maximumFractionDigits=_.length:h&&b?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+b.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var o=i.options[0];o==="w"?t=L(L({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=L(L({},t),Or(o)));continue}if(dn.test(i.stem)){t=L(L({},t),Or(i.stem));continue}var a=bn(i.stem);a&&(t=L(L({},t),a));var s=ta(i.stem);s&&(t=L(L({},t),s))}return t}var $e={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function na(e,t){for(var r="",n=0;n>1),u="a",l=ia(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=u;for(;a-- >0;)r=l+r}else i==="J"?r+="H":r+=i}return r}function ia(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var i=$e[n||""]||$e[r||""]||$e["".concat(r,"-001")]||$e["001"];return i[0]}var Et,oa=new RegExp("^".concat(_n.source,"*")),aa=new RegExp("".concat(_n.source,"*$"));function S(e,t){return{start:e,end:t}}var sa=!!String.prototype.startsWith&&"_a".startsWith("a",1),ua=!!String.fromCodePoint,la=!!Object.fromEntries,fa=!!String.prototype.codePointAt,ca=!!String.prototype.trimStart,ha=!!String.prototype.trimEnd,pa=!!Number.isSafeInteger,_a=pa?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ct=!0;try{var da=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ct=((Et=da.exec("a"))===null||Et===void 0?void 0:Et[0])==="a"}catch{Ct=!1}var Sr=sa?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Mt=ua?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(a=t[o++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},Lr=la?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},ma=ca?function(t){return t.trimStart()}:function(t){return t.replace(oa,"")},ba=ha?function(t){return t.trimEnd()}:function(t){return t.replace(aa,"")};function gn(e,t){return new RegExp(e,t)}var Vt;if(Ct){var wr=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Vt=function(t,r){var n;wr.lastIndex=r;var i=wr.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else Vt=function(t,r){for(var n=[];;){var i=vn(t,r);if(i===void 0||En(i)||ya(i))break;n.push(i),r+=i>=65536?2:1}return Mt.apply(void 0,n)};var va=(function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var a=this.parseArgument(t,n);if(a.err)return a;i.push(a.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),i.push({type:R.pound,location:S(s,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(I.UNMATCHED_CLOSING_TAG,S(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Ut(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;i.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;i.push(a.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:R.literal,value:"<".concat(i,"/>"),location:S(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var a=o.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:R.tag,value:i,children:a,location:S(n,this.clonePosition())},err:null}:this.error(I.INVALID_TAG,S(s,this.clonePosition())))}else return this.error(I.UNCLOSED_TAG,S(n,this.clonePosition()))}else return this.error(I.INVALID_TAG,S(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Ea(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var a=this.tryParseUnquoted(t,r);if(a){i+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){i+=s;continue}break}var u=S(n,this.clonePosition());return{val:{type:R.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!ga(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Mt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Mt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE,S(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(I.EMPTY_ARGUMENT,S(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(I.MALFORMED_ARGUMENT,S(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE,S(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:R.argument,value:i,location:S(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE,S(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(I.MALFORMED_ARGUMENT,S(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Vt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),a=S(t,o);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(s){case"":return this.error(I.EXPECT_ARGUMENT_TYPE,S(a,u));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),_=this.parseSimpleArgStyleIfPossible();if(_.err)return _;var h=ba(_.val);if(h.length===0)return this.error(I.EXPECT_ARGUMENT_STYLE,S(this.clonePosition(),this.clonePosition()));var b=S(f,this.clonePosition());l={style:h,styleLocation:b}}var g=this.tryParseArgumentClose(i);if(g.err)return g;var x=S(i,this.clonePosition());if(l&&Sr(l?.style,"::",0)){var d=ma(l.style.slice(2));if(s==="number"){var _=this.parseNumberSkeletonFromString(d,l.styleLocation);return _.err?_:{val:{type:R.number,value:n,location:x,style:_.val},err:null}}else{if(d.length===0)return this.error(I.EXPECT_DATE_TIME_SKELETON,x);var p=d;this.locale&&(p=na(d,this.locale));var h={type:pe.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Yo(p):{}},v=s==="date"?R.date:R.time;return{val:{type:v,value:n,location:x,style:h},err:null}}}return{val:{type:s==="number"?R.number:s==="date"?R.date:R.time,value:n,location:x,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(I.EXPECT_SELECT_ARGUMENT_OPTIONS,S(m,L({},m)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),A=0;if(s!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,S(this.clonePosition(),this.clonePosition()));this.bumpSpace();var _=this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,I.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(_.err)return _;this.bumpSpace(),y=this.parseIdentifierIfPossible(),A=_.val}var E=this.tryParsePluralOrSelectOptions(t,s,r,y);if(E.err)return E;var g=this.tryParseArgumentClose(i);if(g.err)return g;var P=S(i,this.clonePosition());return s==="select"?{val:{type:R.select,value:n,options:Lr(E.val),location:P},err:null}:{val:{type:R.plural,value:n,options:Lr(E.val),offset:A,pluralType:s==="plural"?"cardinal":"ordinal",location:P},err:null}}default:return this.error(I.INVALID_ARGUMENT_TYPE,S(a,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE,S(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(I.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,S(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=Jo(t)}catch{return this.error(I.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?ra(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,a=!1,s=[],u=new Set,l=i.value,f=i.location;;){if(l.length===0){var _=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_SELECTOR,I.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;f=S(_,this.clonePosition()),l=this.message.slice(_.offset,this.offset())}else break}if(u.has(l))return this.error(r==="select"?I.DUPLICATE_SELECT_ARGUMENT_SELECTOR:I.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);l==="other"&&(a=!0),this.bumpSpace();var b=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?I.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:I.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,S(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(t+1,r,n);if(g.err)return g;var x=this.tryParseArgumentClose(b);if(x.err)return x;s.push([l,{value:g.val,location:S(b,this.clonePosition())}]),u.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,f=o.location}return s.length===0?this.error(r==="select"?I.EXPECT_SELECT_ARGUMENT_SELECTOR:I.EXPECT_PLURAL_ARGUMENT_SELECTOR,S(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(I.MISSING_OTHER_CLAUSE,S(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)o=!0,a=a*10+(s-48),this.bump();else break}var u=S(i,this.clonePosition());return o?(a*=n,_a(a)?{val:a,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=vn(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Sr(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&En(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e})();function Ut(e){return e>=97&&e<=122||e>=65&&e<=90}function ga(e){return Ut(e)||e===47}function Ea(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function En(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ya(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Gt(e){e.forEach(function(t){if(delete t.location,fn(t)||cn(t))for(var r in t.options)delete t.options[r].location,Gt(t.options[r].value);else sn(t)&&pn(t.style)||(un(t)||ln(t))&&Nt(t.style)?delete t.style.location:hn(t)&&Gt(t.children)})}function xa(e,t){t===void 0&&(t={}),t=L({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new va(e,t).parse();if(r.err){var n=SyntaxError(I[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Gt(r.val),r.val}var _e;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(_e||(_e={}));var ot=(function(e){it(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error),Rr=(function(e){it(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),_e.INVALID_VALUE,o)||this}return t})(ot),Ta=(function(e){it(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),_e.INVALID_VALUE,i)||this}return t})(ot),Aa=(function(e){it(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),_e.MISSING_VALUE,n)||this}return t})(ot),V;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(V||(V={}));function Pa(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==V.literal||r.type!==V.literal?t.push(r):n.value+=r.value,t},[])}function Oa(e){return typeof e=="function"}function We(e,t,r,n,i,o,a){if(e.length===1&&Ar(e[0]))return[{type:V.literal,value:e[0].value}];for(var s=[],u=0,l=e;u"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=xa,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();function wa(e,t){if(t==null)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let i=0;i0){const o=r.slice(i,r.length).join(".");if(o in n){n=n[o];break}}n=n[r[i]]}else n=void 0;return n}const K={},Ra=(e,t,r)=>r&&(t in K||(K[t]={}),e in K[t]||(K[t][e]=r),r),xn=(e,t)=>{if(t==null)return;if(t in K&&e in K[t])return K[t][e];const r=Me(t);for(let n=0;n(r[e]=Vo.all([r[e]||{},...t]),r))}ae([me],([e])=>Object.keys(e));me.subscribe(e=>Kt=e);const De={};function Na(e){De[e]=new Set}function Ca(e,t){De[e].delete(t),De[e].size===0&&delete De[e]}function Be(e){return De[e]}function Ma(e){return Me(e).map(t=>{const r=Be(t);return[t,r?[...r]:[]]}).filter(([,t])=>t.length>0)}function Ye(e){return e==null?!1:Me(e).some(t=>{var r;return(r=Be(t))==null?void 0:r.size})}function Va(e,t){return Promise.all(t.map(n=>(Ca(e,n),n().then(i=>i.default||i)))).then(n=>Ze(e,...n))}const Te={};function Tn(e){if(!Ye(e))return e in Te?Te[e]:Promise.resolve();const t=Ma(e);return Te[e]=Promise.all(t.map(([r,n])=>Va(r,n))).then(()=>{if(Ye(e))return Tn(e);delete Te[e]}),Te[e]}function Ua(e,t){Be(e)||Na(e);const r=Be(e);Be(e).has(t)||(er(e)||me.update(n=>(n[e]={},n)),r.add(t))}var Hr=Object.getOwnPropertySymbols,Ga=Object.prototype.hasOwnProperty,ja=Object.prototype.propertyIsEnumerable,Fa=(e,t)=>{var r={};for(var n in e)Ga.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hr)for(var n of Hr(e))t.indexOf(n)<0&&ja.call(e,n)&&(r[n]=e[n]);return r};const ka={number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}};function $a({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${Me(e).join('", "')}".${Ye(re())?` - -Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const za={fallbackLocale:null,loadingDelay:200,formats:ka,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},Ie=za;function de(){return Ie}function Xa(e){const t=e,{formats:r}=t,n=Fa(t,["formats"]);let i=e.fallbackLocale;if(e.initialLocale)try{yn.resolveLocale(e.initialLocale)&&(i=e.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=$a:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(Ie,n,{initialLocale:i}),r&&("number"in r&&Object.assign(Ie.formats.number,r.number),"date"in r&&Object.assign(Ie.formats.date,r.date),"time"in r&&Object.assign(Ie.formats.time,r.time)),se.set(i)}const xt=Ce(!1);var Wa=Object.defineProperty,Za=Object.defineProperties,qa=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Br=(e,t,r)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ja=(e,t)=>{for(var r in t||(t={}))Ya.call(t,r)&&Br(e,r,t[r]);if(Dr)for(var r of Dr(t))Qa.call(t,r)&&Br(e,r,t[r]);return e},Ka=(e,t)=>Za(e,qa(t));let jt;const Qe=Ce(null);function Nr(e){return e.split("-").map((t,r,n)=>n.slice(0,r+1).join("-")).reverse()}function Me(e,t=de().fallbackLocale){const r=Nr(e);return t?[...new Set([...r,...Nr(t)])]:r}function re(){return jt??void 0}Qe.subscribe(e=>{jt=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const es=e=>{if(e&&Ba(e)&&Ye(e)){const{loadingDelay:t}=de();let r;return typeof window<"u"&&re()!=null&&t?r=window.setTimeout(()=>xt.set(!0),t):xt.set(!0),Tn(e).then(()=>{Qe.set(e)}).finally(()=>{clearTimeout(r),xt.set(!1)})}return Qe.set(e)},se=Ka(Ja({},Qe),{set:es}),ts=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],at=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}};var rs=Object.defineProperty,Je=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,Cr=(e,t,r)=>t in e?rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tr=(e,t)=>{for(var r in t||(t={}))An.call(t,r)&&Cr(e,r,t[r]);if(Je)for(var r of Je(t))Pn.call(t,r)&&Cr(e,r,t[r]);return e},be=(e,t)=>{var r={};for(var n in e)An.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Je)for(var n of Je(e))t.indexOf(n)<0&&Pn.call(e,n)&&(r[n]=e[n]);return r};const Ne=(e,t)=>{const{formats:r}=de();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},ns=at(e=>{var t=e,{locale:r,format:n}=t,i=be(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=Ne("number",n)),new Intl.NumberFormat(r,i)}),is=at(e=>{var t=e,{locale:r,format:n}=t,i=be(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=Ne("date",n):Object.keys(i).length===0&&(i=Ne("date","short")),new Intl.DateTimeFormat(r,i)}),os=at(e=>{var t=e,{locale:r,format:n}=t,i=be(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=Ne("time",n):Object.keys(i).length===0&&(i=Ne("time","short")),new Intl.DateTimeFormat(r,i)}),as=(e={})=>{var t=e,{locale:r=re()}=t,n=be(t,["locale"]);return ns(tr({locale:r},n))},ss=(e={})=>{var t=e,{locale:r=re()}=t,n=be(t,["locale"]);return is(tr({locale:r},n))},us=(e={})=>{var t=e,{locale:r=re()}=t,n=be(t,["locale"]);return os(tr({locale:r},n))},ls=at((e,t=re())=>new yn(e,t,de().formats,{ignoreTag:de().ignoreTag})),fs=(e,t={})=>{var r,n,i,o;let a=t;typeof e=="object"&&(a=e,e=a.id);const{values:s,locale:u=re(),default:l}=a;if(u==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=xn(e,u);if(!f)f=(o=(i=(n=(r=de()).handleMissingMessage)==null?void 0:n.call(r,{locale:u,id:e,defaultValue:l}))!=null?i:l)!=null?o:e;else if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f;if(!s)return f;let _=f;try{_=ls(f,u).format(s)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return _},cs=(e,t)=>us(t).format(e),hs=(e,t)=>ss(t).format(e),ps=(e,t)=>as(t).format(e),_s=(e,t=re())=>xn(e,t),rr=ae([se,me],()=>fs);ae([se],()=>cs);ae([se],()=>hs);ae([se],()=>ps);ae([se,me],()=>_s);const Mr=Ce(null);var ds=rt('
                '),ms=rt(''),bs=rt(''),vs=rt('
                ');function qs(e,t){Ji(t,!1);const r=()=>xr(Mr,"$navbar_config",i),n=()=>xr(rr,"$_",i),[i,o]=So(),a=Le(),s=Le();let u=G(t,"wrapper",12),l=G(t,"version",12),f=G(t,"initial_height",12),_=G(t,"fill_width",12),h=G(t,"is_embed",12),b=G(t,"space",12),g=G(t,"display",12),x=G(t,"info",12),d=G(t,"loaded",12),p=G(t,"pages",28,()=>[]),v=G(t,"current_page",12,""),m=G(t,"root",12),y=G(t,"components",28,()=>[]),A=y().find(T=>T.type==="navbar"),E=Le(A?{visible:A.props.visible,main_page_name:A.props.main_page_name,value:A.props.value}:null);w(E)&&Mr.set(w(E));function P(T){let B=T.split("?")[0].split("#")[0];return B=B.replace(/^\/+|\/+$/g,""),B}function H(T,B){return T.startsWith("http://")||T.startsWith("https://")?!1:P(T)===P(B)}ht(()=>r(),()=>{r()&&te(E,{visible:r().visible??!0,main_page_name:r().main_page_name??"Home",value:r().value??null})}),ht(()=>(Xe(p()),w(E)),()=>{te(a,p().length>1&&(w(E)===null||w(E).visible!==!1))}),ht(()=>(Xe(p()),w(E)),()=>{te(s,(()=>{let T=p().filter(([N,U,k],X)=>X===0&&N===""?w(E)?.main_page_name!==!1:k!==!1),B=w(E)&&w(E).main_page_name!==!1&&w(E).main_page_name!=="Home"?T.map(([N,U,k],X)=>X===0&&N===""&&U==="Home"?[N,w(E).main_page_name]:[N,U]):T.map(([N,U])=>[N,U]);if(w(E)?.value&&w(E).value.length>0){const N=new Set(B.map(([k])=>k)),U=w(E).value.map(([k,X])=>[X,k]).filter(([k])=>!N.has(k));return[...B,...U]}return B})())}),Ki();var C={get wrapper(){return u()},set wrapper(T){u(T),j()},get version(){return l()},set version(T){l(T),j()},get initial_height(){return f()},set initial_height(T){f(T),j()},get fill_width(){return _()},set fill_width(T){_(T),j()},get is_embed(){return h()},set is_embed(T){h(T),j()},get space(){return b()},set space(T){b(T),j()},get display(){return g()},set display(T){g(T),j()},get info(){return x()},set info(T){x(T),j()},get loaded(){return d()},set loaded(T){d(T),j()},get pages(){return p()},set pages(T){p(T),j()},get current_page(){return v()},set current_page(T){v(T),j()},get root(){return m()},set root(T){m(T),j()},get components(){return y()},set components(T){y(T),j()}};Oo();var O=vs();let ue,le;var or=$(O);{var Qn=T=>{var B=ms(),N=$(B);let U;fo(N,5,()=>w(s),uo,(k,X)=>{var Ve=to(()=>ro(w(X),2));let M=()=>w(Ve)[0],Ue=()=>w(Ve)[1];var W=ds();let ve;var ut=$(W,!0);F(W),Ge((lt,ft,ti,ri)=>{q(W,"href",lt),q(W,"target",ft),q(W,"rel",ti),ve=Oe(W,1,"svelte-13a2ddb",null,ve,ri),Fe(ut,Ue())},[()=>(M(),Xe(m()),Z(()=>M().startsWith("http://")||M().startsWith("https://")?M():`${m()}/${M()}`)),()=>(M(),Z(()=>M().startsWith("http://")||M().startsWith("https://")?"_blank":"_self")),()=>(M(),Z(()=>M().startsWith("http://")||M().startsWith("https://")?"noopener noreferrer":"")),()=>({active:H(M(),v())})]),je(k,W)}),F(N),F(B),Ge(()=>U=Oe(N,1,"fillable svelte-13a2ddb",null,U,{fill_width:_()})),je(T,B)};_r(or,T=>{w(a)&&T(Qn)})}var st=Ee(or,2);let ar;var sr=$(st);po(sr,t,"default",{});var ur=Ee(sr,2),Jn=$(ur);{var Kn=T=>{var B=bs(),N=$(B),U=$(N),k=$(U,!0);F(U),F(N);var X=Ee(N,2),Ve=$(X);hr(2),F(X);var M=Ee(X,2),Ue=$(M),W=Ee(Ue),ve=$(W),ut=$(ve);F(ve),hr(),F(W),F(M),F(B),Ge((lt,ft)=>{q(U,"href",`https://huggingface.co/spaces/${b()??""}`),Fe(k,b()),Fe(Ve,`${lt??""} `),Fe(Ue,`${ft??""} `),q(ut,"src",Bo)},[()=>(n(),Z(()=>n()("common.built_with"))),()=>(n(),Z(()=>n()("common.hosted_on")))]),je(T,B)};_r(Jn,T=>{g()&&b()&&x()&&T(Kn)})}F(ur),F(st),F(O),Po(O,T=>u(T),()=>u()),Ge(()=>{ue=Oe(O,1,`gradio-container gradio-container-${l()??""}`,"svelte-13a2ddb",ue,{fill_width:_(),"embed-container":g(),"with-info":x()}),le=Kr(O,"",le,{"min-height":d()?"initial":f(),"flex-grow":g()?"auto":"1"}),ar=Oe(st,1,"main fillable svelte-13a2ddb",null,ar,{fill_width:_(),app:!g()&&!h()})}),je(e,O);var ei=eo(C);return o(),ei}let On=!1;typeof window<"u"&&"attachShadow"in Element.prototype&&"adoptedStyleSheets"in Document.prototype&&(On="adoptedStyleSheets"in document.createElement("div").attachShadow({mode:"open"}));function Ys(e,t){const r=new URL(import.meta.url).origin;var n=e;if(window.location.origin!==r&&(n=new URL(e,r).href),document.querySelector(`link[href='${n}']`))return Promise.resolve();const o=document.createElement("link");return o.rel="stylesheet",o.href=n,new Promise((a,s)=>{o.addEventListener("load",()=>a()),o.addEventListener("error",()=>{console.error(`Unable to preload CSS for ${n}`),a()}),t.appendChild(o)})}function Qs(e,t,r){if(!On)return e;r||(r=document.createElement("style")),r.remove();const n=new CSSStyleSheet;n.replaceSync(e);let i="";e=e.replace(/@import\s+url\((.*?)\);\s*/g,(u,l)=>(i+=`@import url(${l}); -`,""));const o=n.cssRules;let a="",s=`.gradio-container.gradio-container-${t} .contain `;for(let u=0;u`${f?".dark":""} ${s} ${b.trim()} `).join(",");a+=l.cssText,a+=l.cssText.replace(_,h)}}else if(l instanceof CSSMediaRule){let _=`@media ${l.media.mediaText} {`;for(let h=0;h`${g?".dark":""} ${s} ${p.trim()} `).join(",");_+=b.cssText.replace(x,d)}}_+="}",a+=_}else if(l instanceof CSSKeyframesRule){a+=`@keyframes ${l.name} {`;for(let _=0;_c(()=>import("./Index-DCmnrJma.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)},annotatedimage:{component:()=>c(()=>import("./Index-BdR5tpCt.js"),__vite__mapDeps([16,1,2,3,4,5,6,17,18,19,20,21,22,7,8,9,10,11,12,23]),import.meta.url)},audio:{base:()=>c(()=>import("./StaticAudio-BzxlNlBs.js").then(e=>e.a),__vite__mapDeps([24,1,2,4,5,6,17,25,18,26,27,28,20,29,30,31,32,33,34]),import.meta.url),example:()=>c(()=>import("./Example-DXbKzhJW.js"),__vite__mapDeps([35,1,2,36]),import.meta.url),component:()=>c(()=>import("./index-tDF4sm9q.js"),__vite__mapDeps([37,1,2,7,8,9,4,5,6,10,11,12,24,17,25,18,26,27,28,20,29,30,31,32,33,34,38,39,40,41,42,43,44,45,3,46,35,36,47]),import.meta.url)},box:{component:()=>c(()=>import("./Index-rdevcKty.js"),__vite__mapDeps([48,1,2,3,4,5,6]),import.meta.url)},browserstate:{component:()=>c(()=>import("./Index-Pd9Hkw9h.js"),__vite__mapDeps([49,1,2,50]),import.meta.url)},button:{component:()=>c(()=>import("./Index-CMb7sSjM.js"),__vite__mapDeps([51,1,2,52,5,53,54,55,4,6,56,57]),import.meta.url)},chatbot:{component:()=>c(()=>import("./Index-DwTi2bAp.js"),__vite__mapDeps([58,1,2,39,59,53,54,55,4,5,6,60,61,12,27,42,33,25,26,20,62,63,9,64,10,65,8,11,66,67,28,3,17,7,68,57]),import.meta.url)},checkbox:{example:()=>c(()=>import("./Example-ByqvSEWx.js"),__vite__mapDeps([69,1,2,70]),import.meta.url),component:()=>c(()=>import("./Index-C1l8r8dW.js"),__vite__mapDeps([71,1,2,3,4,5,6,72,9,20,7,8,10,11,12,73,59,74,75]),import.meta.url)},checkboxgroup:{example:()=>c(()=>import("./Example-BeGmkx97.js"),__vite__mapDeps([76,1,2,77]),import.meta.url),component:()=>c(()=>import("./Index-D9gv-97d.js"),__vite__mapDeps([78,1,2,3,4,5,6,79,72,9,20,7,8,10,11,12,80,81]),import.meta.url)},code:{example:()=>c(()=>import("./Example-CCIKPQQj.js"),__vite__mapDeps([82,1,2,83]),import.meta.url),component:()=>c(()=>import("./Index-DHLZt6aU.js"),__vite__mapDeps([84,1,2,7,8,9,4,5,6,10,11,12,85,86,60,61,27,25,20,3,17,18,87,82,83]),import.meta.url)},colorpicker:{example:()=>c(()=>import("./Example-Cjtz6ob8.js"),__vite__mapDeps([88,1,2,89]),import.meta.url),component:()=>c(()=>import("./Index-BwNRdNZh.js"),__vite__mapDeps([90,1,2,39,59,91,4,5,6,79,72,9,3,7,8,10,11,12,88,89,92]),import.meta.url)},column:{component:()=>c(()=>import("./Index-DoGUZ99P.js"),__vite__mapDeps([93,1,2,13,7,8,9,4,5,6,10,11,12,14]),import.meta.url)},core:{component:()=>c(()=>import("./index-CMKhGNWj.js"),__vite__mapDeps([94,1,2,80]),import.meta.url)},dataframe:{example:()=>c(()=>import("./Example-DeD_Ynkp.js"),__vite__mapDeps([95,1,2,96]),import.meta.url),component:()=>c(()=>import("./Index-AN_eS0Ag.js"),__vite__mapDeps([97,1,2,9,39,98,38,5,40,4,6,63,64,10,65,59,8,11,73,74,75,60,99,61,21,22,100,7,12,3,95,96,101]),import.meta.url)},dataset:{component:()=>c(()=>import("./Index-DEV3zA_w.js"),__vite__mapDeps([102,1,2,3,4,5,6,103,104,39,59,79,72,9,60,61,105,106,20,107,8,10,11,108,98,109,110]),import.meta.url)},datetime:{example:()=>c(()=>import("./Example-BfoDEvJC.js"),__vite__mapDeps([111,1,2]),import.meta.url),component:()=>c(()=>import("./Index-BhX9aXr4.js"),__vite__mapDeps([112,1,2,59,3,4,5,6,79,72,9,20,111,113]),import.meta.url)},dialogue:{example:()=>c(()=>import("./Example-FH892lPu.js"),__vite__mapDeps([114,1,2,115]),import.meta.url),component:()=>c(()=>import("./Index-BrbNPUGv.js"),__vite__mapDeps([116,1,2,8,9,4,5,6,10,11,59,79,72,60,61,117,105,67,20,118,119,99,120,3,7,12,114,115,121,122]),import.meta.url)},downloadbutton:{component:()=>c(()=>import("./Index-uGItVsFZ.js"),__vite__mapDeps([123,1,2,5,52,53,54,55,4,6,56,57,124]),import.meta.url)},draggable:{component:()=>c(()=>import("./Index-C7w0jeUn.js"),__vite__mapDeps([125,1,2,7,8,9,4,5,6,10,11,12,126]),import.meta.url)},dropdown:{example:()=>c(()=>import("./Example-BGlyl4O8.js"),__vite__mapDeps([127,1,2,122]),import.meta.url),component:()=>c(()=>import("./Index-D7qviIOH.js"),__vite__mapDeps([128,1,2,59,66,4,5,6,79,72,9,99,20,118,8,10,11,119,120,3,7,12,127,122]),import.meta.url)},file:{example:()=>c(()=>import("./Example-BPjTUpdK.js"),__vite__mapDeps([129,1,2,130]),import.meta.url),component:()=>c(()=>import("./Index-HqnXgC8B.js"),__vite__mapDeps([131,1,2,4,5,6,17,18,62,20,132,38,39,40,12,9,25,133,3,46,7,8,10,11,129,130]),import.meta.url)},fileexplorer:{example:()=>c(()=>import("./Example-CXAPpj07.js"),__vite__mapDeps([134,1,2,135]),import.meta.url),component:()=>c(()=>import("./Index-BSJNfw0b.js"),__vite__mapDeps([136,1,2,103,4,5,6,62,3,17,20,59,7,8,9,10,11,12,137]),import.meta.url)},form:{component:()=>c(()=>import("./Index-DMgk5BHD.js"),__vite__mapDeps([138,1,2,139,140]),import.meta.url)},gallery:{base:()=>c(()=>import("./Gallery-CRb8iS3j.js").then(e=>e.a),__vite__mapDeps([141,1,2,119,66,4,5,6,17,18,26,12,27,19,32,20,21,22,38,39,40,41,25,42,33,53,54,55,142,74,143,80,144,57]),import.meta.url),example:()=>c(()=>import("./Example-aWuNv4qC.js"),__vite__mapDeps([145,1,2,146]),import.meta.url),component:()=>c(()=>import("./Index-CqEPR_xM.js"),__vite__mapDeps([147,1,2,54,3,4,5,6,46,141,119,66,17,18,26,12,27,19,32,20,21,22,38,39,40,41,25,42,33,53,55,142,74,143,80,144,57,7,8,9,10,11,132,62,133,148,99,106,45,43,149,145,146,150,130,151]),import.meta.url)},group:{component:()=>c(()=>import("./Index-CST2XYRw.js"),__vite__mapDeps([152,1,2,153]),import.meta.url)},highlightedtext:{component:()=>c(()=>import("./Index-C8Nr7g5M.js"),__vite__mapDeps([154,1,2,155,12,4,5,6,3,17,18,20,7,8,9,10,11,156]),import.meta.url)},html:{base:()=>c(()=>import("./HTML-Bcdz-vxU.js"),__vite__mapDeps([157,1,2,5,158]),import.meta.url),example:()=>c(()=>import("./Example-q7qW2djY.js"),__vite__mapDeps([159,1,2,9,160]),import.meta.url),component:()=>c(()=>import("./Index-BCvXC7_h.js"),__vite__mapDeps([161,1,2,157,5,158,7,8,9,4,6,10,11,12,3,17,87,20,159,160,162]),import.meta.url)},image:{base:()=>c(()=>import("./ImagePreview-C41duyJ0.js").then(e=>e.a),__vite__mapDeps([163,1,2,54,4,5,6,17,25,18,26,27,19,20,21,22,53,55,57]),import.meta.url),example:()=>c(()=>import("./Example-oI9QHs-R.js"),__vite__mapDeps([164,1,2,53,54,55,151]),import.meta.url),component:()=>c(()=>import("./Index-BzE3i7lA.js"),__vite__mapDeps([165,1,2,163,54,4,5,6,17,25,18,26,27,19,20,21,22,53,55,57,12,148,8,9,10,11,39,99,106,45,43,149,38,40,3,46,7,164,151]),import.meta.url)},imageeditor:{example:()=>c(()=>import("./Example-D-alj4yz.js"),__vite__mapDeps([166,1,2,4,5,6,53,54,55,8,9,10,11,38,39,40,167,57,149,151]),import.meta.url),component:()=>c(()=>import("./Index-EyePZPlZ.js").then(e=>e.au),__vite__mapDeps([168,1,2,54,163,4,5,6,17,25,18,26,27,19,20,21,22,53,55,57,3,7,8,9,10,11,12,38,39,40,148,99,106,45,43,149,119,91,117,59,60,66,169,67,33,170,151]),import.meta.url)},imageslider:{example:()=>c(()=>import("./Example-CT_gDfRl.js"),__vite__mapDeps([171,1,2,172]),import.meta.url),component:()=>c(()=>import("./Index-BFeI9nh0.js"),__vite__mapDeps([173,1,2,98,174,175,4,5,6,17,25,18,12,27,19,33,20,21,22,8,9,10,11,7,54,38,39,40,3,46,176]),import.meta.url)},json:{example:()=>c(()=>import("./Example-DT5PcEOk.js"),__vite__mapDeps([177,1,2,178,60,61,4,5,6,18,20,179,180]),import.meta.url),component:()=>c(()=>import("./Index-DHTKmW0i.js"),__vite__mapDeps([181,1,2,98,178,60,61,4,5,6,18,20,179,3,17,7,8,9,10,11,12]),import.meta.url)},label:{component:()=>c(()=>import("./Index-DdDmW6aI.js"),__vite__mapDeps([182,1,2,4,5,6,183,3,17,18,20,7,8,9,10,11,12,184]),import.meta.url)},markdown:{example:()=>c(()=>import("./Example-DuOJfHh3.js"),__vite__mapDeps([185,1,2,63,9,64,10,65,186]),import.meta.url),component:()=>c(()=>import("./Index-BJ4MJC7J.js"),__vite__mapDeps([187,1,2,188,39,60,61,4,5,6,20,63,9,64,10,65,189,7,8,11,12,3,190,185,186]),import.meta.url)},model3d:{base:()=>c(()=>import("./Model3D-gDU5RKVo.js"),__vite__mapDeps([191,1,2,4,5,6,17,27,62,33,20,80,192]),import.meta.url),example:()=>c(()=>import("./Example-7FcnnBll.js"),__vite__mapDeps([193,1,2,194]),import.meta.url),component:()=>c(()=>import("./Index-BGogXhGp.js"),__vite__mapDeps([195,1,2,191,4,5,6,17,27,62,33,20,80,192,38,39,40,41,25,12,42,3,18,46,7,8,9,10,11,193,194,196]),import.meta.url)},multimodaltextbox:{example:()=>c(()=>import("./Example-CxjbLxdV.js"),__vite__mapDeps([197,1,2,98,53,54,55,4,5,6,142,39,74,143,198,57]),import.meta.url),component:()=>c(()=>import("./Index-CvbBGSYW.js"),__vite__mapDeps([199,1,2,39,59,4,5,6,79,72,9,169,60,12,62,28,106,190,38,40,53,54,55,29,30,44,3,7,8,10,11,197,98,142,74,143,198,57,200]),import.meta.url)},nativeplot:{example:()=>c(()=>import("./Example-Biakqy76.js"),__vite__mapDeps([201,1,2]),import.meta.url),component:()=>c(()=>import("./Index-CbuW6Q7r.js"),__vite__mapDeps([202,1,2,3,4,5,6,79,72,9,18,27,183,20,21,22,7,8,10,11,12,203]),import.meta.url)},navbar:{base:()=>c(()=>import("./Index-sTTH5Ggb.js"),__vite__mapDeps([204,1,2]),import.meta.url),example:()=>c(()=>import("./Example-BZRf8B4s.js"),__vite__mapDeps([205,1,2]),import.meta.url),component:()=>c(()=>import("./Index-sTTH5Ggb.js"),__vite__mapDeps([204,1,2]),import.meta.url)},number:{example:()=>c(()=>import("./Example-DCvUey5Q.js"),__vite__mapDeps([206,1,2,207]),import.meta.url),component:()=>c(()=>import("./Index-CXTNaUIU.js"),__vite__mapDeps([208,1,2,59,3,4,5,6,79,72,9,20,7,8,10,11,12,209]),import.meta.url)},paramviewer:{example:()=>c(()=>import("./Example-9DdwI8aj.js"),__vite__mapDeps([210,1,2,211]),import.meta.url),component:()=>c(()=>import("./Index-D2aFMIjl.js"),__vite__mapDeps([212,1,2,9,64,213]),import.meta.url)},plot:{base:()=>c(()=>import("./Plot-CYQ3vpBc.js").then(e=>e.b),__vite__mapDeps([214,1,2,103,4,5,6,18]),import.meta.url),component:()=>c(()=>import("./Index-CdACL_KS.js"),__vite__mapDeps([215,1,2,214,103,4,5,6,18,3,17,20,21,22,7,8,9,10,11,12]),import.meta.url)},radio:{example:()=>c(()=>import("./Example-I6GSpyxR.js"),__vite__mapDeps([216,1,2,217]),import.meta.url),component:()=>c(()=>import("./Index-Df136VmG.js"),__vite__mapDeps([218,1,2,3,4,5,6,79,72,9,20,7,8,10,11,12,59,216,217,219]),import.meta.url)},row:{component:()=>c(()=>import("./Index-BxmsNHzG.js"),__vite__mapDeps([220,1,2,7,8,9,4,5,6,10,11,12,221]),import.meta.url)},sidebar:{component:()=>c(()=>import("./Index-bS4AvZnj.js"),__vite__mapDeps([222,1,2,7,8,9,4,5,6,10,11,12,13,14,223]),import.meta.url)},slider:{example:()=>c(()=>import("./Example-B3rqw2Wc.js"),__vite__mapDeps([224,1,2,225]),import.meta.url),component:()=>c(()=>import("./Index-B1nUzmPt.js"),__vite__mapDeps([226,1,2,59,3,4,5,6,79,72,9,7,8,10,11,12,227]),import.meta.url)},state:{component:()=>c(()=>import("./Index-CXv3_vP_.js"),__vite__mapDeps([228,1,2]),import.meta.url)},statustracker:{component:()=>c(()=>import("./index-cG1Y315J.js"),__vite__mapDeps([229,7,1,2,8,9,4,5,6,10,11,12,230,43]),import.meta.url)},tabitem:{component:()=>c(()=>import("./Index-Da0Ogfu8.js"),__vite__mapDeps([231,1,2,232,233,13,7,8,9,4,5,6,10,11,12,14,234]),import.meta.url)},tabs:{component:()=>c(()=>import("./Index-ft-iSOp9.js"),__vite__mapDeps([235,1,2,232,233]),import.meta.url)},textbox:{example:()=>c(()=>import("./Example-Cr4dhaJx.js"),__vite__mapDeps([108,1,2,98,109]),import.meta.url),component:()=>c(()=>import("./Index-Dynj1EXQ.js"),__vite__mapDeps([236,1,2,104,39,59,4,5,6,79,72,9,60,61,105,106,20,107,7,8,10,11,12,3,108,98,109]),import.meta.url)},timer:{component:()=>c(()=>import("./Index-C_R__XCO.js"),__vite__mapDeps([237,1,2]),import.meta.url)},uploadbutton:{component:()=>c(()=>import("./Index-Cp7-lnfK.js"),__vite__mapDeps([238,1,2,5,52,53,54,55,4,6,56,57,38,39,40,239]),import.meta.url)},vibeeditor:{component:()=>c(()=>import("./Index-9wedEojI.js"),__vite__mapDeps([240,1,2,59,8,9,4,5,6,10,11,85,86,188,39,60,61,20,63,64,65,189,241,83,186]),import.meta.url)},video:{base:()=>c(()=>import("./VideoPreview-C1GJVo16.js").then(e=>e.a),__vite__mapDeps([242,1,2,103,4,5,6,17,25,18,26,27,20,22,31,32,33,142,39,74,143,38,40,41,12,42,243]),import.meta.url),example:()=>c(()=>import("./Example-Cpd2Jjnh.js"),__vite__mapDeps([244,1,2,142,5,39,74,143,245]),import.meta.url),component:()=>c(()=>import("./index-CeMVyRym.js"),__vite__mapDeps([246,1,2,103,5,38,39,40,4,6,17,148,8,9,10,11,99,106,45,43,149,142,74,143,242,25,18,26,27,20,22,31,32,33,41,12,42,243,244,245,3,46,7,247,55,57,151]),import.meta.url)},workflowcanvas:{component:()=>c(()=>import("./Index-D8iPfACD.js"),__vite__mapDeps([248,1,2,103,8,9,4,5,6,10,11,104,39,59,79,72,60,61,105,106,20,107,163,54,17,25,18,26,27,19,21,22,53,55,57,38,40,249,109,149,151]),import.meta.url)},walkthrough:{component:()=>c(()=>import("./Index-ft-iSOp9.js"),__vite__mapDeps([235,1,2,232,233]),import.meta.url)},walkthroughstep:{component:()=>c(()=>import("./Index-Da0Ogfu8.js"),__vite__mapDeps([231,1,2,232,233,13,7,8,9,4,5,6,10,11,12,14,234]),import.meta.url)}},J={},ce={},Ke=typeof window<"u";function Es({api_url:e,name:t,id:r,variant:n}){const i=Ke&&window.__GRADIO__CC__,o={...gs,...i||{}};let a=r||t;if(J[`${a}-${n}`])return{component:J[`${a}-${n}`],name:t,runtime:ce[`${a}-${n}`]};try{if(!o?.[a]?.[n]&&!o?.[t]?.[n])throw new Error;return J[`${a}-${n}`]=(o?.[a]?.[n]||o?.[t]?.[n])(),ce[`${a}-${n}`]=Ke&&window.__GRADIO__CC__RUNTIMES__?.[r]||!1,{name:t,component:J[`${a}-${n}`],runtime:ce[`${a}-${n}`]}}catch{if(!a)throw new Error(`Component not found: ${t}`);try{const u=xs(e,a,n),[l,f]=u;return J[`${a}-${n}`]=l,ce[`${a}-${n}`]=f,{name:t,component:J[`${a}-${n}`],runtime:ce[`${a}-${n}`]}}catch(u){if(n==="example")return J[`${a}-${n}`]=c(()=>import("./Example-BswZLX-K.js"),__vite__mapDeps([250,1,2,251]),import.meta.url),{name:t,component:J[`${a}-${n}`],runtime:ce[`${a}-${n}`]};throw console.error(`failed to load: ${t}`),console.error(u),u}}}function ys(e){return Ke?new Promise((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,document.head.appendChild(n),n.onload=()=>t(),n.onerror=()=>r()}):Promise.resolve()}function xs(e,t,r){const n=Ke?"client":"server";if(n==="server")return[c(()=>import("./Index-CT81CJxE.js"),__vite__mapDeps([252,1,2,3,4,5,6,7,8,9,10,11,12,253]),import.meta.url),Promise.resolve(!1)];const i=`${e}/custom_component/${t}/${n}/${r}/index.js`;return[Promise.all([ys(`${e}/custom_component/${t}/${n}/${r}/style.css`),import(i)]).then(([o,a])=>a),c(()=>import(`${e}/custom_component/${t}/${n}/${r}/svelte_runtime_entry.js`),[],import.meta.url)]}function Js(e,t,r,n="component"){return e==="api"&&(e="state"),Es({api_url:r,name:e,id:t,variant:n})}function Ks(e){const t=new Set,r=new Set;for(const n of e)n.inputs.forEach(i=>t.add(i)),n.outputs.forEach(i=>r.add(i));return[t,r]}function eu(e,t,r,n){const[i,o]=n;return t===!1?!1:t===!0?!0:!!(i.has(e)||!o.has(e)&&Ts(r))}function Ts(e){return Array.isArray(e)&&e.length===0||e===""||e===0||!e}const tu=Object.getPrototypeOf(async function(){}).constructor,ru=["red","green","blue","yellow","purple","teal","orange","cyan","lime","pink"],As=[{color:"red",primary:600,secondary:100},{color:"green",primary:600,secondary:100},{color:"blue",primary:600,secondary:100},{color:"yellow",primary:500,secondary:100},{color:"purple",primary:600,secondary:100},{color:"teal",primary:600,secondary:100},{color:"orange",primary:600,secondary:100},{color:"cyan",primary:600,secondary:100},{color:"lime",primary:500,secondary:100},{color:"pink",primary:600,secondary:100}],Vr={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},nu=As.reduce((e,{color:t,primary:r,secondary:n})=>({...e,[t]:{primary:Vr[t][r],secondary:Vr[t][n]}}),{}),et="__i18n__",Ps=["label","info","placeholder","description","title","value"];class Tt extends Error{constructor(t){super(t),this.name="ShareError"}}async function iu(e,t){if(window.__gradio_space__==null)throw new Tt("Must be on Spaces to share.");let r,n,i;{let u;if(typeof e=="object"&&e.url)u=e.url;else if(typeof e=="string")u=e;else throw new Error("Invalid data format for URL type");const l=await fetch(u);r=await l.blob(),n=l.headers.get("content-type")||"",i=l.headers.get("content-disposition")||""}const o=new File([r],i,{type:n}),a=await fetch("https://huggingface.co/uploads",{method:"POST",body:o,headers:{"Content-Type":o.type,"X-Requested-With":"XMLHttpRequest"}});if(!a.ok){if(a.headers.get("content-type")?.includes("application/json")){const u=await a.json();throw new Tt(`Upload failed: ${u.error}`)}throw new Tt("Upload failed.")}return await a.text()}function ou(e){e.addEventListener("click",t);async function t(r){const n=r.composedPath(),[i]=n.filter(o=>o?.tagName==="BUTTON"&&o.classList.contains("copy_code_button"));if(i){let o=function(l){l.style.opacity="1",setTimeout(()=>{l.style.opacity="0"},2e3)};r.stopImmediatePropagation();const a=i.parentElement.innerText.trim(),s=Array.from(i.children)[1];await Os(a)&&o(s)}}return{destroy(){e.removeEventListener("click",t)}}}async function Os(e){let t=!1;if("clipboard"in navigator)await navigator.clipboard.writeText(e),t=!0;else{const r=document.createElement("textarea");r.value=e,r.style.position="absolute",r.style.left="-999999px",document.body.prepend(r),r.select();try{document.execCommand("copy"),t=!0}catch(n){console.error(n),t=!1}finally{r.remove()}}return t}const au=e=>{const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.round(e)%60,i=`${r<10?"0":""}${r}`,o=`${n<10?"0":""}${n}`;return t>0?`${t}:${i}:${o}`:`${r}:${o}`},Is=["elem_id","elem_classes","visible","interactive","server_fns","server","id","target","theme_mode","version","root","autoscroll","max_file_size","formatter","client","load_component","scale","min_width","theme","padding","loading_status","label","show_label","validation_error","show_progress","api_prefix","container","attached_events","register_component","dispatcher"];function Ss(e){return typeof e=="string"&&e.includes(et)}function Ls(e,t){const r=e.indexOf(et);if(r===-1)return e;const n=r+et.length,i=e.indexOf("}",n)+1;if(i===0)return e;try{const o=JSON.parse(e.slice(n,i));if(o?.key){const a=t(o.key),s=a!==o.key?a:o.key;return e.slice(0,r)+s+e.slice(i)}}catch{}return e}class su{load_component;#t=pt(wt({}));get shared(){return w(this.#t)}set shared(t){te(this.#t,t,!0)}#r=pt(wt({}));get props(){return w(this.#r)}set props(t){te(this.#r,t,!0)}#e=pt(t=>t);get i18n(){return w(this.#e)}set i18n(t){te(this.#e,t,!0)}i18n_store;_i18n_from_store;translatable_props={};dispatcher;last_update=null;shared_props=Is;mounted=!1;old_value;register_component;constructor(t,r){for(const n in t.shared_props)this.shared[n]=t.shared_props[n];for(const n in t.props)n!=="i18n_store"&&(this.props[n]=t.props[n]);if(r)for(const n in r)this.props[n]===void 0&&(this.props[n]=r[n]);this.i18n=this.props.i18n??(n=>n),this.i18n_store=t.props.i18n_store,this._i18n_from_store=this.i18n_store?Do(this.i18n_store):void 0;for(const n of Ps)this.shared[n]=this._translate_and_store("shared",n,t.shared_props[n]),this.props[n]=this._translate_and_store("props",n,t.props[n]);this.load_component=this.shared.load_component,this.register_component=this.shared.register_component||(()=>{}),this.dispatcher=this.shared.dispatcher||(()=>{}),this.register_component(t.shared_props.id,this.set_data.bind(this),this.get_data.bind(this)),we(()=>{for(const n in t.shared_props)this._is_i18n_managed(`shared.${n}`,t.shared_props[n])||(this.shared[n]=t.shared_props[n]);for(const n in t.props)n!=="i18n_store"&&(this._is_i18n_managed(`props.${n}`,t.props[n])||(this.props[n]=t.props[n]));this.register_component(t.shared_props.id,this.set_data.bind(this),this.get_data.bind(this)),Z(()=>{this.shared.id=t.shared_props.id})}),we(()=>this.i18n_store?this.i18n_store.subscribe(()=>{for(const[i,o]of Object.entries(this.translatable_props)){const[a,s]=i.split("."),u=this.i18n(o);a==="shared"?this.shared[s]=u:this.props[s]=u}}):void 0)}_is_i18n_managed(t,r){const n=this.translatable_props[t];return n?r===n?!0:(delete this.translatable_props[t],!1):!1}_translate_and_store(t,r,n){if(typeof n!="string")return n;const i=this.i18n(n);return i!==n&&(this.translatable_props[`${t}.${r}`]=n),i}live_i18n=t=>(this._i18n_from_store?.current,this.i18n(t));dispatch(t,r){this.dispatcher(this.shared.id,t,r)}async get_data(){return ao(this.props)}update(t){this.set_data(t)}set_data(t){for(const r in t){const n=t[r],i=Ss(n)?this._translate_and_store(this.shared_props.includes(r)?"shared":"props",r,n):n;if(this.shared_props.includes(r)){const o=r;this.shared[o]=i;continue}this.props[r]=i}}watch_for_change(){we(()=>{this.mounted||(this.old_value=this.props.value,this.mounted=!0),this.old_value!=this.props.value&&(this.old_value=this.props.value,this.dispatch("change"))})}}const uu=e=>typeof e=="number"?e+"px":e;function lu(e){if(!e)return!1;const t=e.scrollHeight>e.clientHeight,r=e.scrollTop>=e.scrollHeight-e.clientHeight-1;return t&&!r}function ws(e){if(e==null)return"";const t=String(e),r=Jt(rr);if(t.includes(et))return Ls(t,r);const n=r(t);return typeof n=="string"&&n!==t?n:t}const fu=ae(rr,()=>ws),Ur={ar:"جاري التحميل",ca:"S'està carregant",ckb:"بارکردن",de:"Laden",en:"Loading",es:"Cargando",et:"Laen",eu:"Kargatzen",fa:"در حال بارگذاری",fi:"Ladataan",fr:"Chargement",he:"טוען",hi:"लोड हो रहा है",ja:"読み込み中",ko:"로딩 중",lt:"Kraunama",nb:"Laster",nl:"Laden",pl:"Ładowanie","pt-BR":"Carregando",pt:"A carregar",ro:"Se încarcă",ru:"Загрузка",sv:"Laddar",ta:"ஏற்றுகிறது",th:"กำลังโหลด",tr:"Yükleniyor",uk:"Завантаження",ur:"لوڈ ہو رہا ہے",uz:"Yuklanmoqda","zh-CN":"加载中","zh-TW":"載入中"},In="English",Sn={annotated_image:"Annotated Image"},Ln={allow_recording_access:"Please allow access to the microphone for recording.",audio:"Audio",drop_to_upload:"Drop an audio file here to upload",record_from_microphone:"Record from microphone",stop_recording:"Stop recording",no_device_support:"Media devices could not be accessed. Check that you are running on a secure origin (https) or localhost (or you have passed a valid SSL certificate to ssl_verify), and you have allowed browser access to your device.",stop:"Stop",resume:"Resume",record:"Record",no_microphone:"No microphone found",pause:"Pause",play:"Play",waiting:"Waiting"},wn={connection_can_break:"On mobile, the connection can break if this tab is unfocused or the device sleeps, losing your position in queue.",long_requests_queue:"There is a long queue of requests pending. Duplicate this Space to skip.",lost_connection:"Lost connection due to leaving page. Rejoining queue...",waiting_for_inputs:"Waiting for file(s) to finish uploading, please retry."},Rn={edit:"Edit",retry:"Retry",undo:"Undo",submit:"Submit",cancel:"Cancel",like:"Like",dislike:"Dislike",clear:"Clear",copy_message:"Copy message",copied_message:"Copied message"},Hn={new_chat:"New chat",message_placeholder:"Type a message...",additional_inputs:"Additional inputs",chatbot:"Chatbot",conversation:"Conversation"},Dn={checkbox:"Checkbox",checkbox_group:"Checkbox Group"},Bn={code:"Code"},Nn={color_picker:"Color Picker"},Cn={built_with:"built with",built_with_gradio:"Built with Gradio",clear:"Clear",download:"Download",edit:"Edit",empty:"Empty",error:"Error",hosted_on:"Hosted on",loading:"Loading",logo:"logo",or:"or",remove:"Remove",settings:"Settings",share:"Share",submit:"Submit",undo:"Undo",no_devices:"No devices found",language:"Language",display_theme:"Display Theme",pwa:"Progressive Web App",record:"Record",stop_recording:"Stop Recording",screen_studio:"Screen Studio",share_gradio_tab:"[Sharing] Gradio Tab",run:"Run"},Mn={incorrect_format:"Incorrect format, only CSV and TSV files are supported",new_column:"Add column",new_row:"New row",add_row_above:"Add row above",add_row_below:"Add row below",delete_row:"Delete row",delete_column:"Delete column",add_column_left:"Add column to the left",add_column_right:"Add column to the right",sort_column:"Sort column",sort_ascending:"Sort ascending",sort_descending:"Sort descending",drop_to_upload:"Drop CSV or TSV files here to import data into dataframe",clear_sort:"Clear sort",filter:"Filter",clear_filter:"Clear filters"},Vn={dropdown:"Dropdown"},Un={build_error:"there is a build error",config_error:"there is a config error",contact_page_author:"Please contact the author of the page to let them know.",no_app_file:"there is no app file",runtime_error:"there is a runtime error",space_not_working:`"Space isn't working because" {0}`,space_paused:"the space is paused",use_via_api:"Use via API",use_via_api_or_mcp:"Use via API or MCP"},Gn={uploading:"Uploading..."},jn={highlighted_text:"Highlighted Text"},Fn={allow_webcam_access:"Please allow access to the webcam for recording.",brush_color:"Brush color",brush_radius:"Brush radius",image:"Image",remove_image:"Remove Image",select_brush_color:"Select brush color",start_drawing:"Start drawing",use_brush:"Use brush",drop_to_upload:"Drop an image file here to upload"},kn={label:"Label"},$n={enable_cookies:"If you are visiting a HuggingFace Space in Incognito mode, you must enable third party cookies.",incorrect_credentials:"Incorrect Credentials",username:"username",password:"password",login:"Login"},zn={number:"Number"},Xn={plot:"Plot"},Wn={radio:"Radio"},Zn={slider:"Slider"},qn={click_to_upload:"Click to Upload",drop_audio:"Drop Audio Here",drop_csv:"Drop CSV Here",drop_file:"Drop File Here",drop_image:"Drop Image Here",drop_video:"Drop Video Here",drop_gallery:"Drop Media Here",paste_clipboard:"Paste from Clipboard"},Yn={drop_to_upload:"Drop a video file here to upload"},nr={_name:In,"3D_model":{"3d_model":"3D Model",drop_to_upload:"Drop a 3D model (.obj, .glb, .stl, .gltf, .splat, or .ply) file here to upload"},annotated_image:Sn,audio:Ln,blocks:wn,chatbot:Rn,chat_interface:Hn,checkbox:Dn,code:Bn,color_picker:Nn,common:Cn,dataframe:Mn,dropdown:Vn,errors:Un,file:Gn,highlighted_text:jn,image:Fn,label:kn,login:$n,number:zn,plot:Xn,radio:Wn,slider:Zn,upload_text:qn,video:Yn},Rs=Object.freeze(Object.defineProperty({__proto__:null,_name:In,annotated_image:Sn,audio:Ln,blocks:wn,chat_interface:Hn,chatbot:Rn,checkbox:Dn,code:Bn,color_picker:Nn,common:Cn,dataframe:Mn,default:nr,dropdown:Vn,errors:Un,file:Gn,highlighted_text:jn,image:Fn,label:kn,login:$n,number:zn,plot:Xn,radio:Wn,slider:Zn,upload_text:qn,video:Yn},Symbol.toStringTag,{value:"Module"})),Hs={ar:"العربية",ca:"Català",ckb:"کوردی",de:"Deutsch",en:"English",es:"Español",et:"eesti keel",eu:"Euskara",fa:"فارسی",fi:"Suomi",fr:"Français",he:"עברית",hi:"हिंदी",ja:"日本語",ko:"한국어",lt:"Lietuvių",nb:"Norsk bokmål",nl:"Nederlands",pl:"Polski","pt-BR":"Português do Brasil",pt:"Português",ro:"Română",ru:"Русский",sv:"Svenska",ta:"தமிழ்",th:"ภาษาไทย",tr:"Türkçe",uk:"Українська",ur:"اردو",uz:"O'zbek","zh-CN":"简体中文","zh-TW":"繁體中文"},Ds=Object.assign({"./lang/ar.json":()=>c(()=>import("./ar-DI02TNDn.js"),[],import.meta.url),"./lang/ca.json":()=>c(()=>import("./ca-MwjfTPYe.js"),[],import.meta.url),"./lang/ckb.json":()=>c(()=>import("./ckb-DEn8SQcv.js"),[],import.meta.url),"./lang/de.json":()=>c(()=>import("./de-BczWVYc-.js"),[],import.meta.url),"./lang/en.json":()=>c(()=>Promise.resolve().then(()=>Rs),void 0,import.meta.url),"./lang/es.json":()=>c(()=>import("./es-5B0rLSyK.js"),[],import.meta.url),"./lang/et.json":()=>c(()=>import("./et-BS1B_BYV.js"),[],import.meta.url),"./lang/eu.json":()=>c(()=>import("./eu-FEV4b8Yc.js"),[],import.meta.url),"./lang/fa.json":()=>c(()=>import("./fa-xqCN2YBh.js"),[],import.meta.url),"./lang/fi.json":()=>c(()=>import("./fi-CzBLDS5V.js"),[],import.meta.url),"./lang/fr.json":()=>c(()=>import("./fr-D-jLF3ix.js"),[],import.meta.url),"./lang/he.json":()=>c(()=>import("./he-D0pPJnuh.js"),[],import.meta.url),"./lang/hi.json":()=>c(()=>import("./hi-ui5-o8Zq.js"),[],import.meta.url),"./lang/id.json":()=>c(()=>import("./id-ClfVqkNd.js"),[],import.meta.url),"./lang/ja.json":()=>c(()=>import("./ja-us1feo4m.js"),[],import.meta.url),"./lang/ko.json":()=>c(()=>import("./ko-olQgpapS.js"),[],import.meta.url),"./lang/lt.json":()=>c(()=>import("./lt-C3SHU62J.js"),[],import.meta.url),"./lang/nb.json":()=>c(()=>import("./nb-FznSaSMV.js"),[],import.meta.url),"./lang/nl.json":()=>c(()=>import("./nl-B4KNpP3D.js"),[],import.meta.url),"./lang/pl.json":()=>c(()=>import("./pl-DgzvenUF.js"),[],import.meta.url),"./lang/pt-BR.json":()=>c(()=>import("./pt-BR-BumPWABt.js"),[],import.meta.url),"./lang/pt.json":()=>c(()=>import("./pt-CMxRi3jz.js"),[],import.meta.url),"./lang/ro.json":()=>c(()=>import("./ro-BwkPWvaL.js"),[],import.meta.url),"./lang/ru.json":()=>c(()=>import("./ru-Cyxgs-16.js"),[],import.meta.url),"./lang/sv.json":()=>c(()=>import("./sv-DRLxo-M4.js"),[],import.meta.url),"./lang/ta.json":()=>c(()=>import("./ta-ChNEShjw.js"),[],import.meta.url),"./lang/th.json":()=>c(()=>import("./th-CTbdxu88.js"),[],import.meta.url),"./lang/tr.json":()=>c(()=>import("./tr-yUbHBZLl.js"),[],import.meta.url),"./lang/uk.json":()=>c(()=>import("./uk-CaUFw2Pq.js"),[],import.meta.url),"./lang/ur.json":()=>c(()=>import("./ur-Z4lbsgev.js"),[],import.meta.url),"./lang/uz.json":()=>c(()=>import("./uz-CDq7fxDa.js"),[],import.meta.url),"./lang/zh-CN.json":()=>c(()=>import("./zh-CN-D4oMFiss.js"),[],import.meta.url),"./lang/zh-TW.json":()=>c(()=>import("./zh-TW-R6BiSpm2.js"),[],import.meta.url)});function cu(e){return e&&typeof e=="object"&&e.__type__==="translation_metadata"&&typeof e.key=="string"}function Bs(){return{...Object.fromEntries(Object.entries(Ds).map(([t,r])=>[t.split("/").pop().split(".")[0],{type:"lazy",data:r}])),en:{type:"static",data:nr}}}const ir=Bs(),Ft=Object.keys(ir),hu=Object.entries(ir).map(([e])=>[Hs[e]||e,e]);let At=!1,Pt;function Ns(e){const t=e.split(",").map(r=>r.includes(";")?r.split(";").slice(0,2):[r,1]);t.sort((r,n)=>parseFloat(n[1])-parseFloat(r[1]));for(const[r,n]of t)if(Ft.includes(r))return r;return null}async function pu(e,t){if(At&&!(At&&e!==Pt))return;const n=e??Pt??{};e!==void 0&&(Pt=e),Cs({processed_langs:ir,custom_translations:n});let i=null;const o=ts();if(t?i=Ns(t):i=o&&Ft.includes(o)?o:null,!i){const a=o?.split("-")[0];i=a&&Ft.includes(a)?a:"en"}await Xa({fallbackLocale:"en",initialLocale:i}),At=!0}function _u(e){se.set(e)}function du(e,t,r="en"){return e&&t.includes(e)?e:r}function Cs(e){if(e){try{for(const t in e.custom_translations)Ze(t,e.custom_translations[t]);for(const t in e.processed_langs)t==="en"&&e.processed_langs[t].type==="static"?Ze(t,nr):e.processed_langs[t].type==="lazy"&&Ua(t,e.processed_langs[t].data)}catch(t){console.error("Error loading translations:",t)}for(const t in Ur)Ze(t,{common:{loading:Ur[t]}})}}export{rr as $,iu as A,so as B,ye as C,pu as D,qs as E,Ce as F,su as G,Qs as H,Ys as I,Us as J,ou as K,No as L,au as M,Fs as N,se as O,hu as P,_u as Q,Ws as R,xe as S,ks as T,yo as U,nu as V,Vs as W,tu as X,fu as Y,en as Z,qe as _,q as a,Zs as a0,Ks as a1,Js as a2,Is as a3,eu as a4,du as a5,et as a6,cu as a7,Cs as a8,Bs as a9,Oe as b,js as c,Po as d,Oo as e,Kr as f,Xs as g,lu as h,_r as i,bo as j,Jt as k,zs as l,ao as m,Mr as n,ru as o,G as p,fo as q,$s as r,po as s,So as t,xr as u,Eo as v,uo as w,Tt as x,Gs as y,uu as z}; diff --git a/assets/iblCdfDebug.fragment-DWaCKFeF.js b/assets/iblCdfDebug.fragment-DWaCKFeF.js deleted file mode 100644 index c507788b8a5fa0730f10e8035aefa37498824f46..0000000000000000000000000000000000000000 --- a/assets/iblCdfDebug.fragment-DWaCKFeF.js +++ /dev/null @@ -1,34 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCdfDebugPixelShader",f=`#define PI 3.1415927 -varying vUV: vec2f;var cdfySampler: sampler;var cdfy: texture_2d;var cdfxSampler: sampler;var cdfx: texture_2d;var icdfSampler: sampler;var icdf: texture_2d; -#ifdef IBL_USE_CUBE_MAP -var iblSourceSampler: sampler;var iblSource: texture_cube; -#else -var iblSourceSampler: sampler;var iblSource: texture_2d; -#endif -var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#define cdfyVSize (0.8/3.0) -#define cdfxVSize 0.1 -#define cdfyHSize 0.5 -uniform sizeParams: vec4f; -#ifdef IBL_USE_CUBE_MAP -fn equirectangularToCubemapDirection(uv: vec2f)->vec3f {var longitude: f32=uv.x*2.0*PI-PI;var latitude: f32=PI*0.5-uv.y*PI;var direction: vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;} -#endif -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -var colour: vec3f= vec3f(0.0);var uv: vec2f = -vec2f((uniforms.sizeParams.x+input.vUV.x)*uniforms.sizeParams.z,(uniforms.sizeParams.y+input.vUV.y)*uniforms.sizeParams.w);var backgroundColour: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var cdfxWidth: u32=textureDimensions(cdfx,0).x;var cdfyHeight: u32=textureDimensions(cdfy,0).y;const iblStart: f32=1.0-cdfyVSize;const pdfStart: f32=1.0-2.0*cdfyVSize;const cdfyStart: f32=1.0-3.0*cdfyVSize;const cdfxStart: f32=1.0-3.0*cdfyVSize-cdfxVSize;const icdfxStart: f32=1.0-3.0*cdfyVSize-2.0*cdfxVSize; -#ifdef IBL_USE_CUBE_MAP -var direction: vec3f=equirectangularToCubemapDirection( -(uv- vec2f(0.0,iblStart))* vec2f(1.0,1.0/cdfyVSize));var iblColour: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb; -#else -var iblColour: vec3f=textureSample(iblSource,iblSourceSampler,(uv- vec2f(0.0,iblStart)) * -vec2f(1.0,1.0/cdfyVSize)) -.rgb; -#endif -var pdfColour: vec3f = -textureSample(icdf,icdfSampler,(uv- vec2f(0.0,pdfStart))* vec2f(1.0,1.0/cdfyVSize)).zzz;var cdfyColour: f32 = -textureSample(cdfy,cdfySampler,(uv- vec2f(0.0,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).r;var icdfyColour: f32 = -textureSample(icdf,icdfSampler,(uv- vec2f(0.5,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).g;var cdfxColour: f32 = -textureSample(cdfx,cdfxSampler,(uv- vec2f(0.0,cdfxStart))* vec2f(1.0,1.0/cdfxVSize)).r;var icdfxColour: f32=textureSample(icdf,icdfSampler,(uv- vec2f(0.0,icdfxStart)) * -vec2f(1.0,1.0/cdfxVSize)).r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>pdfStart) {colour+=pdfColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=cdfyColour/f32(cdfyHeight);} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=cdfxColour/f32(cdfxWidth);} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;} -fragmentOutputs.color =vec4(mix(colour,backgroundColour,0.5),1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=f);const i={name:e,shader:f};export{i as iblCdfDebugPixelShaderWGSL}; diff --git a/assets/iblCdfDebug.fragment-DmoKSy5-.js b/assets/iblCdfDebug.fragment-DmoKSy5-.js deleted file mode 100644 index 819560bc0d792c2a6e6b5518875a7424b5c11e3d..0000000000000000000000000000000000000000 --- a/assets/iblCdfDebug.fragment-DmoKSy5-.js +++ /dev/null @@ -1,42 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCdfDebugPixelShader",i=`precision highp samplerCube; -#define PI 3.1415927 -varying vec2 vUV;uniform sampler2D cdfy;uniform sampler2D cdfx;uniform sampler2D icdf;uniform sampler2D pdf; -#ifdef IBL_USE_CUBE_MAP -uniform samplerCube iblSource; -#else -uniform sampler2D iblSource; -#endif -uniform sampler2D textureSampler; -#define cdfyVSize (0.8/3.0) -#define cdfxVSize 0.1 -#define cdfyHSize 0.5 -uniform vec4 sizeParams; -#define offsetX sizeParams.x -#define offsetY sizeParams.y -#define widthScale sizeParams.z -#define heightScale sizeParams.w -#ifdef IBL_USE_CUBE_MAP -vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;} -#endif -void main(void) {vec3 colour=vec3(0.0);vec2 uv = -vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec3 backgroundColour=texture2D(textureSampler,vUV).rgb;int cdfxWidth=textureSize(cdfx,0).x;int cdfyHeight=textureSize(cdfy,0).y;const float iblStart=1.0-cdfyVSize;const float pdfStart=1.0-2.0*cdfyVSize;const float cdfyStart=1.0-3.0*cdfyVSize;const float cdfxStart=1.0-3.0*cdfyVSize-cdfxVSize;const float icdfxStart=1.0-3.0*cdfyVSize-2.0*cdfxVSize; -#ifdef IBL_USE_CUBE_MAP -vec3 direction=equirectangularToCubemapDirection( -(uv-vec2(0.0,iblStart))*vec2(1.0,1.0/cdfyVSize));vec3 iblColour=textureCubeLodEXT(iblSource,direction,0.0).rgb; -#else -vec3 iblColour=texture2D(iblSource,(uv-vec2(0.0,iblStart)) * -vec2(1.0,1.0/cdfyVSize)) -.rgb; -#endif -vec3 pdfColour=texture(icdf,(uv-vec2(0.0,pdfStart)) * -vec2(1.0,1.0/cdfyVSize)).zzz;float cdfyColour = -texture2D(cdfy,(uv-vec2(0.0,cdfyStart))*vec2(2.0,1.0/cdfyVSize)) -.r;float icdfyColour = -texture2D(icdf,(uv-vec2(0.5,cdfyStart))*vec2(2.0,1.0/cdfyVSize)) -.g;float cdfxColour = -texture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize)) -.r;float icdfxColour=texture2D(icdf,(uv-vec2(0.0,icdfxStart)) * -vec2(1.0,1.0/cdfxVSize)) -.r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>pdfStart) {colour+=pdfColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=cdfyColour/float(cdfyHeight);} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=cdfxColour/float(cdfxWidth);} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;} -gl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);} -`;r.ShadersStore[e]||(r.ShadersStore[e]=i);const c={name:e,shader:i};export{c as iblCdfDebugPixelShader}; diff --git a/assets/iblCdfGenerator-D-umVdZE.js b/assets/iblCdfGenerator-D-umVdZE.js deleted file mode 100644 index 97236c0d02b67abe6ba17f57d18ff1f391639e58..0000000000000000000000000000000000000000 --- a/assets/iblCdfGenerator-D-umVdZE.js +++ /dev/null @@ -1,9 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./procedural.vertex-DxrK4RVC.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./procedural.vertex-D1mTdBvt.js","./iblCdfx.fragment-Yo3OQ71b.js","./iblCdfy.fragment-CvxfNKgg.js","./iblScaledLuminance.fragment-DWUUFxHB.js","./helperFunctions-Wgh3PIP0.js","./iblCdfx.fragment-SybTQY90.js","./iblCdfy.fragment-BfCilJAR.js","./helperFunctions-tBt4f_K3.js","./iblScaledLuminance.fragment-dG8erDYw.js","./iblIcdf.fragment-BtFsC7v3.js","./iblDominantDirection.fragment-BQSy7LTI.js","./hdrFilteringFunctions-BDy1DXPD.js","./pbrBRDFFunctions-BKKbkltP.js","./iblIcdf.fragment-InRvGEK7.js","./iblDominantDirection.fragment-5W_WOG8r.js","./hdrFilteringFunctions-B6pmqAql.js","./pbrBRDFFunctions-DaHwCtNC.js","./iblCdfDebug.fragment-DWaCKFeF.js","./iblCdfDebug.fragment-DmoKSy5-.js"])))=>i.map(i=>d[i]); -import{af as a}from"./index-DydPgVMC.js";import{a as p,d as T,T as m,O as g,aq as b,bb as D,J as o,aL as x,o as E,_ as d,s as c,R as S,ai as I,L as C,bn as v,aA as W,bo as L,V as A,be as O}from"./index-GY9JDBGV.js";import{R}from"./rawTexture-BDsvmix4.js";class B{constructor(e){this.name=p.NAME_PROCEDURALTEXTURE,this.scene=e}register(){this.scene._beforeClearStage.registerStep(p.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)}rebuild(){}dispose(){}_beforeClear(){if(this.scene.proceduralTexturesEnabled){T.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(let e=0;e0)}}}class h extends m{get shaderLanguage(){return this._shaderLanguage}constructor(e,t,s,r,i=null,n=!0,u=!1,P=0){super(null,r,!n),this.isEnabled=!0,this.autoClear=!0,this.onGeneratedObservable=new g,this.onBeforeGenerationObservable=new g,this.nodeMaterialSource=null,this.defines="",this._textures={},this._currentRefreshId=-1,this._frameId=-1,this._refreshRate=1,this._vertexBuffers={},this._uniforms=new Array,this._samplers=new Array,this._floats={},this._ints={},this._floatsArrays={},this._colors3={},this._colors4={},this._vectors2={},this._vectors3={},this._vectors4={},this._matrices={},this._fallbackTextureUsed=!1,this._cachedDefines=null,this._contentUpdateId=-1,this._rtWrapper=null,i!==null&&!(i instanceof m)?(this._options=i,this._fallbackTexture=i.fallbackTexture??null):(this._options={},this._fallbackTexture=i),this._shaderLanguage=this._options.shaderLanguage??0,r=this.getScene()||b.LastCreatedScene;let l=r._getComponent(p.NAME_PROCEDURALTEXTURE);l||(l=new B(r),r._addComponent(l)),r.proceduralTextures.push(this),this._fullEngine=r.getEngine(),this.name=e,this.isRenderTarget=!0,this._size=t,this._textureType=P,this._generateMipMaps=n,this._drawWrapper=new D(this._fullEngine),this.setFragment(s);const y=this._createRtWrapper(u,t,n,P);this._texture=y.texture;const _=[];_.push(1,1),_.push(-1,1),_.push(-1,-1),_.push(1,-1),this._vertexBuffers[o.PositionKind]=new o(this._fullEngine,_,o.PositionKind,!1,!1,2),this._createIndexBuffer()}_createRtWrapper(e,t,s,r){return e?(this._rtWrapper=this._fullEngine.createRenderTargetCubeTexture(t,{generateMipMaps:s,generateDepthBuffer:!1,generateStencilBuffer:!1,type:r,...this._options}),this.setFloat("face",0)):(this._rtWrapper=this._fullEngine.createRenderTargetTexture(t,{generateMipMaps:s,generateDepthBuffer:!1,generateStencilBuffer:!1,type:r,...this._options}),this._rtWrapper.is3D&&(this.setFloat("layer",0),this.setInt("layerNum",0))),this._rtWrapper}getEffect(){return this._drawWrapper.effect}_setEffect(e){this._drawWrapper.effect=e}getContent(){return this._contentData&&this._frameId===this._contentUpdateId?this._contentData:(this._contentData?this._contentData.then(e=>{this._contentData=this.readPixels(0,0,e),this._contentUpdateId=this._frameId}):(this._contentData=this.readPixels(0,0),this._contentUpdateId=this._frameId),this._contentData)}_createIndexBuffer(){const e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){const e=this._vertexBuffers[o.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===x.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=x.REFRESHRATE_RENDER_ONCE)}reset(){this._drawWrapper.effect?.dispose(),this._drawWrapper.effect=null,this._cachedDefines=null}_getDefines(){return this.defines}executeWhenReady(e){if(this.isReady()){e(this);return}const t=this.getEffect();t&&t.executeWhenCompiled(()=>{e(this)})}isReady(){const e=this._fullEngine;if(this.nodeMaterialSource)return this._drawWrapper.effect.isReady();if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;if(!this._texture)return!1;const t=this._getDefines();if(this._drawWrapper.effect&&t===this._cachedDefines&&this._drawWrapper.effect.isReady())return!0;const s={vertex:"procedural",fragmentElement:this._fragment.fragmentElement,fragmentSource:this._fragment.fragmentSource,fragment:typeof this._fragment=="string"?this._fragment:void 0};return this._cachedDefines!==t&&(this._cachedDefines=t,this._drawWrapper.effect=e.createEffect(s,[o.PositionKind],this._uniforms,this._samplers,t,void 0,void 0,()=>{this._rtWrapper?.dispose(),this._rtWrapper=this._texture=null,this._fallbackTexture&&(this._texture=this._fallbackTexture._texture,this._texture&&this._texture.incrementReferences()),this._fallbackTextureUsed=!0},void 0,this._shaderLanguage,async()=>{this._options.extraInitializationsAsync?this.shaderLanguage===1?await Promise.all([a(()=>import("./procedural.vertex-DxrK4RVC.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this._options.extraInitializationsAsync()]):await Promise.all([a(()=>import("./procedural.vertex-D1mTdBvt.js"),__vite__mapDeps([4,1,2,3]),import.meta.url),this._options.extraInitializationsAsync()]):this.shaderLanguage===1?await a(()=>import("./procedural.vertex-DxrK4RVC.js"),__vite__mapDeps([0,1,2,3]),import.meta.url):await a(()=>import("./procedural.vertex-D1mTdBvt.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)})),this._drawWrapper.effect.isReady()}resetRefreshCounter(){this._currentRefreshId=-1}setFragment(e){this._fragment=e}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}_shouldRender(){return!this.isEnabled||!this.isReady()||!this._texture?(this._texture&&(this._texture.isReady=!1),!1):this._fallbackTextureUsed?!1:this._currentRefreshId===-1?(this._currentRefreshId=1,this._frameId++,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)}getRenderSize(){return this._size}resize(e,t){if(this._fallbackTextureUsed||!this._rtWrapper||!this._texture)return;const s=this._texture.isCube;this._rtWrapper.dispose();const r=this._createRtWrapper(s,e,t,this._textureType);this._texture=r.texture,this._size=e,this._generateMipMaps=t}_checkUniform(e){this._uniforms.indexOf(e)===-1&&this._uniforms.push(e)}setTexture(e,t){return this._samplers.indexOf(e)===-1&&this._samplers.push(e),this._textures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}render(e){const t=this.getScene();if(!t)return;const s=this._fullEngine;if(s.enableEffect(this._drawWrapper),this.onBeforeGenerationObservable.notifyObservers(this),s.setState(!1),!this.nodeMaterialSource){for(const i in this._textures)this._drawWrapper.effect.setTexture(i,this._textures[i]);for(const i in this._ints)this._drawWrapper.effect.setInt(i,this._ints[i]);for(const i in this._floats)this._drawWrapper.effect.setFloat(i,this._floats[i]);for(const i in this._floatsArrays)this._drawWrapper.effect.setArray(i,this._floatsArrays[i]);for(const i in this._colors3)this._drawWrapper.effect.setColor3(i,this._colors3[i]);for(const i in this._colors4){const n=this._colors4[i];this._drawWrapper.effect.setFloat4(i,n.r,n.g,n.b,n.a)}for(const i in this._vectors2)this._drawWrapper.effect.setVector2(i,this._vectors2[i]);for(const i in this._vectors3)this._drawWrapper.effect.setVector3(i,this._vectors3[i]);for(const i in this._vectors4)this._drawWrapper.effect.setVector4(i,this._vectors4[i]);for(const i in this._matrices)this._drawWrapper.effect.setMatrix(i,this._matrices[i])}if(!this._texture||!this._rtWrapper)return;s._enableGPUDebugMarkers&&(s.restoreDefaultFramebuffer(),s._debugPushGroup?.(`procedural texture generation for ${this.name}`));const r=s.currentViewport;if(this.isCube)for(let i=0;i<6;i++)s.bindFramebuffer(this._rtWrapper,i,void 0,void 0,!0),s.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._drawWrapper.effect.setFloat("face",i),this.autoClear&&s.clear(t.clearColor,!0,!1,!1),s.drawElementsType(E.TriangleFillMode,0,6),s.unBindFramebuffer(this._rtWrapper,!0);else{let i=1;this._rtWrapper.is3D?i=this._rtWrapper.depth:this._rtWrapper.is2DArray&&(i=this._rtWrapper.layers);for(let n=0;n=0&&e.proceduralTextures.splice(t,1);const s=this._vertexBuffers[o.PositionKind];s&&(s.dispose(),this._vertexBuffers[o.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),super.dispose()}}d([c()],h.prototype,"isEnabled",void 0);d([c()],h.prototype,"autoClear",void 0);d([c()],h.prototype,"_generateMipMaps",void 0);d([c()],h.prototype,"_size",void 0);d([c()],h.prototype,"refreshRate",null);S("BABYLON.ProceduralTexture",h);class f{get isSupported(){const e=b.LastCreatedEngine;return e?e.getCaps().texelFetch:!1}get iblSource(){return this._iblSource}set iblSource(e){this._iblSource!==e&&(this._disposeTextures(),this._iblSource=e,e&&(e.isCube?e.isReadyOrNotBlocking()?this._recreateAssetsFromNewIbl():e.onLoadObservable.addOnce(this._recreateAssetsFromNewIbl.bind(this,e)):e.isReadyOrNotBlocking()?this._recreateAssetsFromNewIbl():e.onLoadObservable.addOnce(this._recreateAssetsFromNewIbl.bind(this,e))))}_recreateAssetsFromNewIbl(){this._debugPass&&this._debugPass.dispose(),this._createTextures(),this._debugPass&&this._createDebugPass()}getIcdfTexture(){return this._icdfPT?this._icdfPT:this._dummyTexture}setDebugDisplayParams(e,t,s,r){this._debugSizeParams.set(e,t,s,r)}get debugPassName(){return this._debugPassName}getDebugPassPP(){return this._debugPass||this._createDebugPass(),this._debugPass}constructor(e){if(this._cachedDominantDirection=null,this.debugEnabled=!1,this._debugSizeParams=new I(0,0,1,1),this._debugPassName="CDF Debug",this.onGeneratedObservable=new g,e?f._IsScene(e)?this._scene=e:this._engine=e:this._scene=b.LastCreatedScene,this._scene&&(this._engine=this._scene.getEngine()),!this.isSupported){C.Warn("CDF renderer is not supported by the current engine.");return}const t=new Uint16Array([0,0,0,255]);this._dummyTexture=new R(t,1,1,v.TEXTUREFORMAT_RGBA,e,!1,!1,void 0,2),this._scene&&f._SceneComponentInitialization(this._scene)}_createTextures(){const e=this._iblSource?{width:this._iblSource.getSize().width,height:this._iblSource.getSize().height}:{width:1,height:1};this._iblSource||(this._iblSource=R.CreateRTexture(new Uint8Array([255]),1,1,this._engine,!1,!1,1,0),this._iblSource.name="Placeholder IBL Source"),this._iblSource.isCube&&(e.width*=4,e.height*=2,e.width=1<{t?await Promise.all([a(()=>import("./iblCdfx.fragment-Yo3OQ71b.js"),__vite__mapDeps([5,1,2,3]),import.meta.url),a(()=>import("./iblCdfy.fragment-CvxfNKgg.js"),__vite__mapDeps([6,1,2,3]),import.meta.url),a(()=>import("./iblScaledLuminance.fragment-DWUUFxHB.js"),__vite__mapDeps([7,1,2,3,8]),import.meta.url)]):await Promise.all([a(()=>import("./iblCdfx.fragment-SybTQY90.js"),__vite__mapDeps([9,1,2,3]),import.meta.url),a(()=>import("./iblCdfy.fragment-BfCilJAR.js"),__vite__mapDeps([10,1,2,3,11]),import.meta.url),a(()=>import("./iblScaledLuminance.fragment-dG8erDYw.js"),__vite__mapDeps([12,1,2,3,11]),import.meta.url)])}},r={generateDepthBuffer:!1,generateMipMaps:!1,format:5,type:2,samplingMode:1,shaderLanguage:t?1:0,gammaSpace:!1,extraInitializationsAsync:async()=>{t?await Promise.all([a(()=>import("./iblIcdf.fragment-BtFsC7v3.js"),__vite__mapDeps([13,1,2,3,8]),import.meta.url),a(()=>import("./iblDominantDirection.fragment-BQSy7LTI.js"),__vite__mapDeps([14,1,2,3,8,15,16]),import.meta.url)]):await Promise.all([a(()=>import("./iblIcdf.fragment-InRvGEK7.js"),__vite__mapDeps([17,1,2,3,11]),import.meta.url),a(()=>import("./iblDominantDirection.fragment-5W_WOG8r.js"),__vite__mapDeps([18,1,2,3,11,19,20]),import.meta.url)])}};this._cdfyPT=new h("cdfyTexture",{width:e.width,height:e.height+1},"iblCdfy",this._scene,s,!1,!1),this._cdfyPT.autoClear=!1,this._cdfyPT.setTexture("iblSource",this._iblSource),this._cdfyPT.setInt("iblHeight",e.height),this._cdfyPT.wrapV=0,this._cdfyPT.refreshRate=0,this._iblSource.isCube&&(this._cdfyPT.defines=`#define IBL_USE_CUBE_MAP -`),this._cdfxPT=new h("cdfxTexture",{width:e.width+1,height:1},"iblCdfx",this._scene,s,!1,!1),this._cdfxPT.autoClear=!1,this._cdfxPT.setTexture("cdfy",this._cdfyPT),this._cdfxPT.refreshRate=0,this._cdfxPT.wrapU=0,this._scaledLuminancePT=new h("iblScaledLuminance",{width:e.width,height:e.height},"iblScaledLuminance",this._scene,{...s,samplingMode:3,generateMipMaps:!0},!0,!1),this._scaledLuminancePT.autoClear=!1,this._scaledLuminancePT.setTexture("iblSource",this._iblSource),this._scaledLuminancePT.setInt("iblHeight",e.height),this._scaledLuminancePT.setInt("iblWidth",e.width),this._scaledLuminancePT.refreshRate=0,this._iblSource.isCube&&(this._scaledLuminancePT.defines=`#define IBL_USE_CUBE_MAP -`),this._icdfPT=new h("icdfTexture",{width:e.width,height:e.height},"iblIcdf",this._scene,r,!1,!1),this._icdfPT.autoClear=!1,this._icdfPT.setTexture("cdfy",this._cdfyPT),this._icdfPT.setTexture("cdfx",this._cdfxPT),this._icdfPT.setTexture("iblSource",this._iblSource),this._icdfPT.setTexture("scaledLuminanceSampler",this._scaledLuminancePT),this._icdfPT.refreshRate=0,this._icdfPT.wrapV=0,this._icdfPT.wrapU=0,this._iblSource.isCube&&(this._icdfPT.defines=`#define IBL_USE_CUBE_MAP -`),this._icdfPT.onGeneratedObservable.addOnce(()=>{this.onGeneratedObservable.notifyObservers()}),this._dominantDirectionPT=new h("iblDominantDirection",{width:1,height:1},"iblDominantDirection",this._scene,r,!1,!1),this._dominantDirectionPT.autoClear=!1,this._dominantDirectionPT.setTexture("icdfSampler",this._icdfPT),this._dominantDirectionPT.refreshRate=0,this._dominantDirectionPT.defines=`#define NUM_SAMPLES 32u -`}_disposeTextures(){this._cdfyPT?.dispose(),this._cdfxPT?.dispose(),this._icdfPT?.dispose(),this._scaledLuminancePT?.dispose(),this._dominantDirectionPT?.dispose()}_createDebugPass(){this._debugPass&&this._debugPass.dispose();const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),samplingMode:m.BILINEAR_SAMPLINGMODE,engine:this._engine,textureType:0,uniforms:["sizeParams"],samplers:["cdfy","icdf","cdfx","iblSource"],defines:this._iblSource?.isCube?`#define IBL_USE_CUBE_MAP -`:"",shaderLanguage:e?1:0,extraInitializations:(r,i)=>{r?i.push(a(()=>import("./iblCdfDebug.fragment-DWaCKFeF.js"),__vite__mapDeps([21,1,2,3]),import.meta.url)):i.push(a(()=>import("./iblCdfDebug.fragment-DmoKSy5-.js"),__vite__mapDeps([22,1,2,3]),import.meta.url))}};this._debugPass=new W(this._debugPassName,"iblCdfDebug",t);const s=this._debugPass.getEffect();s&&(s.defines=this._iblSource?.isCube?`#define IBL_USE_CUBE_MAP -`:""),this._iblSource?.isCube&&this._debugPass.updateEffect(`#define IBL_USE_CUBE_MAP -`),this._debugPass.onApplyObservable.add(r=>{r.setTexture("cdfy",this._cdfyPT),r.setTexture("icdf",this._icdfPT),r.setTexture("cdfx",this._cdfxPT),r.setTexture("iblSource",this._iblSource),r.setFloat4("sizeParams",this._debugSizeParams.x,this._debugSizeParams.y,this._debugSizeParams.z,this._debugSizeParams.w)})}isReady(){return this._iblSource&&this._iblSource.name!=="Placeholder IBL Source"&&this._iblSource.isReady()&&this._cdfyPT&&this._cdfyPT.isReady()&&this._icdfPT&&this._icdfPT.isReady()&&this._cdfxPT&&this._cdfxPT.isReady()&&this._scaledLuminancePT&&this._scaledLuminancePT.isReady()}renderWhenReady(){return this._cachedDominantDirection=null,new Promise((t,s)=>{L(()=>!!this._icdfPT,()=>t(void 0),()=>s(new Error("Waiting for _icdfPT creation failed")))}).then(()=>{this._icdfPT.onGeneratedObservable.addOnce(()=>{this.onGeneratedObservable.notifyObservers()});const t=[],s=[this._cdfyPT,this._cdfxPT,this._scaledLuminancePT,this._icdfPT];for(const r of s)t.push(new Promise(i=>{r.isReady()?i():r.getEffect().executeWhenCompiled(()=>{i()})}));return Promise.all(t).then(()=>{for(const r of s)r.render()})})}findDominantDirection(){return this._cachedDominantDirection?Promise.resolve(this._cachedDominantDirection):new Promise(e=>{this._dominantDirectionPT.onGeneratedObservable.addOnce(()=>{const t=new Float32Array(4);this._dominantDirectionPT.readPixels(0,0,t,!0).then(()=>{const s=new A(t[0],t[1],t[2]);this._cachedDominantDirection=s,e(s)})}),this.isReady()?this._dominantDirectionPT.isReady()?this._dominantDirectionPT.render():this._dominantDirectionPT.getEffect().executeWhenCompiled(()=>{this._dominantDirectionPT.render()}):this.onGeneratedObservable.addOnce(()=>{this._dominantDirectionPT.isReady()?this._dominantDirectionPT.render():this._dominantDirectionPT.getEffect().executeWhenCompiled(()=>{this._dominantDirectionPT.render()})})})}dispose(){this._disposeTextures(),this._dummyTexture.dispose(),this._debugPass&&this._debugPass.dispose(),this.onGeneratedObservable.clear()}static _IsScene(e){return e.getClassName()==="Scene"}}f._SceneComponentInitialization=w=>{throw O("IblCdfGeneratorSceneComponentSceneComponent")};const V=Object.freeze(Object.defineProperty({__proto__:null,IblCdfGenerator:f},Symbol.toStringTag,{value:"Module"}));export{f as I,h as P,V as i}; diff --git a/assets/iblCdfGeneratorSceneComponent-BEGjGKxj.js b/assets/iblCdfGeneratorSceneComponent-BEGjGKxj.js deleted file mode 100644 index 10119c765e8b9eab22ed33eae978b227a69fa21a..0000000000000000000000000000000000000000 --- a/assets/iblCdfGeneratorSceneComponent-BEGjGKxj.js +++ /dev/null @@ -1 +0,0 @@ -import{a as n,b as r}from"./index-GY9JDBGV.js";import{I as i}from"./iblCdfGenerator-D-umVdZE.js";import"./index-DydPgVMC.js";import"./rawTexture-BDsvmix4.js";Object.defineProperty(r.prototype,"iblCdfGenerator",{get:function(){return this._iblCdfGenerator},set:function(e){e&&(this._iblCdfGenerator=e)},enumerable:!0,configurable:!0});r.prototype.enableIblCdfGenerator=function(){return this._iblCdfGenerator?this._iblCdfGenerator:(this._iblCdfGenerator=new i(this),this._iblCdfGenerator.isSupported?(this.environmentTexture&&(this._iblCdfGenerator.iblSource=this.environmentTexture),this._iblCdfGenerator):(this._iblCdfGenerator=null,null))};r.prototype.disableIblCdfGenerator=function(){this._iblCdfGenerator&&(this._iblCdfGenerator.dispose(),this._iblCdfGenerator=null)};class o{constructor(t){this.name=n.NAME_IBLCDFGENERATOR,this._newIblObserver=null,this.scene=t}register(){this._updateIblSource(),this._newIblObserver=this.scene.onEnvironmentTextureChangedObservable.add(this._updateIblSource.bind(this))}rebuild(){}dispose(){this.scene.onEnvironmentTextureChangedObservable.remove(this._newIblObserver)}_updateIblSource(){this.scene.iblCdfGenerator&&this.scene.environmentTexture&&(this.scene.iblCdfGenerator.iblSource=this.scene.environmentTexture)}}i._SceneComponentInitialization=e=>{let t=e._getComponent(n.NAME_IBLCDFGENERATOR);t||(t=new o(e),e._addComponent(t))};export{o as IblCdfGeneratorSceneComponent}; diff --git a/assets/iblCdfx.fragment-SybTQY90.js b/assets/iblCdfx.fragment-SybTQY90.js deleted file mode 100644 index ffaf1642b8fc1b1c8db659df089c448c2f5d6b18..0000000000000000000000000000000000000000 --- a/assets/iblCdfx.fragment-SybTQY90.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCdfxPixelShader",i=`precision highp sampler2D; -#define PI 3.1415927 -varying vec2 vUV;uniform sampler2D cdfy;void main(void) {ivec2 cdfyRes=textureSize(cdfy,0);ivec2 currentPixel=ivec2(gl_FragCoord.xy);float cdfx=0.0;for (int x=1; x<=currentPixel.x; x++) {cdfx+=texelFetch(cdfy,ivec2(x-1,cdfyRes.y-1),0).x;} -gl_FragColor=vec4(vec3(cdfx),1.0);}`;r.ShadersStore[e]||(r.ShadersStore[e]=i);const o={name:e,shader:i};export{o as iblCdfxPixelShader}; diff --git a/assets/iblCdfx.fragment-Yo3OQ71b.js b/assets/iblCdfx.fragment-Yo3OQ71b.js deleted file mode 100644 index a7224b2d0726233239693ba29db76526b1fcae21..0000000000000000000000000000000000000000 --- a/assets/iblCdfx.fragment-Yo3OQ71b.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCdfxPixelShader",t=`#define PI 3.1415927 -varying vUV: vec2f;var cdfy: texture_2d;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var cdfyRes=textureDimensions(cdfy,0);var currentPixel=vec2u(fragmentInputs.position.xy);var cdfx: f32=0.0;for (var x: u32=1; x<=currentPixel.x; x++) {cdfx+=textureLoad(cdfy, vec2u(x-1,cdfyRes.y-1),0).x;} -fragmentOutputs.color= vec4f( vec3f(cdfx),1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const n={name:e,shader:t};export{n as iblCdfxPixelShaderWGSL}; diff --git a/assets/iblCdfy.fragment-BfCilJAR.js b/assets/iblCdfy.fragment-BfCilJAR.js deleted file mode 100644 index 5d1534f3f4afe60e01c84529ff0c35fcd636244d..0000000000000000000000000000000000000000 --- a/assets/iblCdfy.fragment-BfCilJAR.js +++ /dev/null @@ -1,24 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="iblCdfyPixelShader",i=`precision highp sampler2D;precision highp samplerCube; -#include -#define PI 3.1415927 -varying vec2 vUV; -#ifdef IBL_USE_CUBE_MAP -uniform samplerCube iblSource; -#else -uniform sampler2D iblSource; -#endif -uniform int iblHeight; -#ifdef IBL_USE_CUBE_MAP -float fetchCube(vec2 uv) {vec3 direction=equirectangularToCubemapDirection(uv);return sin(PI*uv.y)*dot(textureCubeLodEXT(iblSource,direction,0.0).rgb,LuminanceEncodeApprox);} -#else -float fetchPanoramic(ivec2 Coords,float envmapHeight) {return sin(PI*(float(Coords.y)+0.5)/envmapHeight) * -dot(texelFetch(iblSource,Coords,0).rgb,LuminanceEncodeApprox);} -#endif -void main(void) {ivec2 coords=ivec2(gl_FragCoord.x,gl_FragCoord.y);float cdfy=0.0;for (int y=1; y<=coords.y; y++) { -#ifdef IBL_USE_CUBE_MAP -vec2 uv=vec2(vUV.x,(float(y-1)+0.5)/float(iblHeight));cdfy+=fetchCube(uv); -#else -cdfy+=fetchPanoramic(ivec2(coords.x,y-1),float(iblHeight)); -#endif -} -gl_FragColor=vec4(cdfy,0.0,0.0,1.0);}`;o.ShadersStore[e]||(o.ShadersStore[e]=i);const n={name:e,shader:i};export{n as iblCdfyPixelShader}; diff --git a/assets/iblCdfy.fragment-CvxfNKgg.js b/assets/iblCdfy.fragment-CvxfNKgg.js deleted file mode 100644 index c47e36ab42510a44aaa41e9963de364612dbad28..0000000000000000000000000000000000000000 --- a/assets/iblCdfy.fragment-CvxfNKgg.js +++ /dev/null @@ -1,26 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCdfyPixelShader",i=`varying vUV : vec2f; -#include -#ifdef IBL_USE_CUBE_MAP -var iblSourceSampler: sampler;var iblSource: texture_cube; -#else -var iblSourceSampler: sampler;var iblSource: texture_2d; -#endif -uniform iblHeight: i32; -#ifdef IBL_USE_CUBE_MAP -fn fetchCube(uv: vec2f)->f32 {var direction: vec3f=equirectangularToCubemapDirection(uv);return sin(PI*uv.y) * -dot(textureSampleLevel(iblSource,iblSourceSampler,direction,0.0) -.rgb, -LuminanceEncodeApprox);} -#else -fn fetchPanoramic(Coords: vec2i,envmapHeight: f32)->f32 {return sin(PI*(f32(Coords.y)+0.5)/envmapHeight) * -dot(textureLoad(iblSource,Coords,0).rgb,LuminanceEncodeApprox);} -#endif -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var coords: vec2i= vec2i(fragmentInputs.position.xy);var cdfy: f32=0.0;for (var y: i32=1; y<=coords.y; y++) { -#ifdef IBL_USE_CUBE_MAP -var uv: vec2f= vec2f(input.vUV.x,( f32(y-1)+0.5)/ f32(uniforms.iblHeight));cdfy+=fetchCube(uv); -#else -cdfy+=fetchPanoramic( vec2i(coords.x,y-1), f32(uniforms.iblHeight)); -#endif -} -fragmentOutputs.color= vec4f(cdfy,0.0,0.0,1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=i);const f={name:e,shader:i};export{f as iblCdfyPixelShaderWGSL}; diff --git a/assets/iblCombineVoxelGrids.fragment-Dk6LvH09.js b/assets/iblCombineVoxelGrids.fragment-Dk6LvH09.js deleted file mode 100644 index dab59d5b59e361eb982a0e0d9a52922d50999d89..0000000000000000000000000000000000000000 --- a/assets/iblCombineVoxelGrids.fragment-Dk6LvH09.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCombineVoxelGridsPixelShader",a=`varying vUV: vec2f;var voxelXaxisSamplerSampler: sampler;var voxelXaxisSampler: texture_3d;var voxelYaxisSamplerSampler: sampler;var voxelYaxisSampler: texture_3d;var voxelZaxisSamplerSampler: sampler;var voxelZaxisSampler: texture_3d;uniform layer: f32;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var coordZ: vec3f= vec3f(fragmentInputs.vUV.x,fragmentInputs.vUV.y,uniforms.layer);var voxelZ: f32=textureSample(voxelZaxisSampler,voxelZaxisSamplerSampler,coordZ).r;var coordX: vec3f= vec3f(1.0-uniforms.layer,fragmentInputs.vUV.y,fragmentInputs.vUV.x);var voxelX: f32=textureSample(voxelXaxisSampler,voxelXaxisSamplerSampler,coordX).r;var coordY: vec3f= vec3f(uniforms.layer,fragmentInputs.vUV.x,fragmentInputs.vUV.y);var voxelY: f32=textureSample(voxelYaxisSampler,voxelYaxisSamplerSampler,coordY).r;var voxel=select(0.0,1.0,(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0));fragmentOutputs.color= vec4f( vec3f(voxel),1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const v={name:e,shader:a};export{v as iblCombineVoxelGridsPixelShaderWGSL}; diff --git a/assets/iblCombineVoxelGrids.fragment-iQq4wJGG.js b/assets/iblCombineVoxelGrids.fragment-iQq4wJGG.js deleted file mode 100644 index 19184a5e33b197b68e4ff7e02ad38378b0ed2240..0000000000000000000000000000000000000000 --- a/assets/iblCombineVoxelGrids.fragment-iQq4wJGG.js +++ /dev/null @@ -1 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblCombineVoxelGridsPixelShader",r="precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelXaxisSampler;uniform sampler3D voxelYaxisSampler;uniform sampler3D voxelZaxisSampler;uniform float layer;void main(void) {vec3 coordZ=vec3(vUV.x,vUV.y,layer);float voxelZ=texture(voxelZaxisSampler,coordZ).r;vec3 coordX=vec3(1.0-layer,vUV.y,vUV.x);float voxelX=texture(voxelXaxisSampler,coordX).r;vec3 coordY=vec3(layer,vUV.x,vUV.y);float voxelY=texture(voxelYaxisSampler,coordY).r;float voxel=(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0) ? 1.0 : 0.0;glFragColor=vec4(vec3(voxel),1.0);}";o.ShadersStore[e]||(o.ShadersStore[e]=r);const v={name:e,shader:r};export{v as iblCombineVoxelGridsPixelShader}; diff --git a/assets/iblDominantDirection.fragment-5W_WOG8r.js b/assets/iblDominantDirection.fragment-5W_WOG8r.js deleted file mode 100644 index 4a18679530f009140e1f8e009b18b29ada92e1a4..0000000000000000000000000000000000000000 --- a/assets/iblDominantDirection.fragment-5W_WOG8r.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./hdrFilteringFunctions-B6pmqAql.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./index-DydPgVMC.js";const i="iblDominantDirectionPixelShader",r=`precision highp sampler2D;precision highp samplerCube; -#include -#include -#include -#include -varying vec2 vUV;uniform sampler2D icdfSampler;void main(void) {vec3 lightDir=vec3(0.0,0.0,0.0);for(uint i=0u; i -#include -#include -#include -var icdfSamplerSampler: sampler;var icdfSampler: texture_2d;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var lightDir: vec3f=vec3f(0.0,0.0,0.0);for(var i: u32=0u; i0.0f ? 1u : 0u) -<< 0u | -uint(texelFetch(srcMip,Coords+ivec3(1,0,0),0).x>0.0f ? 1u : 0u) -<< 1u | -uint(texelFetch(srcMip,Coords+ivec3(0,1,0),0).x>0.0f ? 1u : 0u) -<< 2u | -uint(texelFetch(srcMip,Coords+ivec3(1,1,0),0).x>0.0f ? 1u : 0u) -<< 3u | -uint(texelFetch(srcMip,Coords+ivec3(0,0,1),0).x>0.0f ? 1u : 0u) -<< 4u | -uint(texelFetch(srcMip,Coords+ivec3(1,0,1),0).x>0.0f ? 1u : 0u) -<< 5u | -uint(texelFetch(srcMip,Coords+ivec3(0,1,1),0).x>0.0f ? 1u : 0u) -<< 6u | -uint(texelFetch(srcMip,Coords+ivec3(1,1,1),0).x>0.0f ? 1u : 0u) -<< 7u;glFragColor.rgb=vec3(float(tex)/255.0f,0.0f,0.0f);glFragColor.a=1.0;}`;i.ShadersStore[e]||(i.ShadersStore[e]=r);const u={name:e,shader:r};export{u as iblGenerateVoxelMipPixelShader}; diff --git a/assets/iblGenerateVoxelMip.fragment-DpLhGDkX.js b/assets/iblGenerateVoxelMip.fragment-DpLhGDkX.js deleted file mode 100644 index 1d87867355f4699c581942ea6d448f082b50aa4d..0000000000000000000000000000000000000000 --- a/assets/iblGenerateVoxelMip.fragment-DpLhGDkX.js +++ /dev/null @@ -1,18 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblGenerateVoxelMipPixelShader",t=`varying vUV: vec2f;var srcMip: texture_3d;uniform layerNum: i32;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var Coords=vec3i(2)*vec3i(vec2i(fragmentInputs.position.xy),uniforms.layerNum);var tex = -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,0),0).x>0.0f)) -<< 0u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,0),0).x>0.0f)) -<< 1u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,0),0).x>0.0f)) -<< 2u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,0),0).x>0.0f)) -<< 3u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,1),0).x>0.0f)) -<< 4u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,1),0).x>0.0f)) -<< 5u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,1),0).x>0.0f)) -<< 6u) | -(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,1),0).x>0.0f)) -<< 7u);fragmentOutputs.color=vec4f( f32(tex)/255.0f,0.0f,0.0f,1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const s={name:e,shader:t};export{s as iblGenerateVoxelMipPixelShaderWGSL}; diff --git a/assets/iblIcdf.fragment-BtFsC7v3.js b/assets/iblIcdf.fragment-BtFsC7v3.js deleted file mode 100644 index ecfd571270818a1b65690c508971902456f34b80..0000000000000000000000000000000000000000 --- a/assets/iblIcdf.fragment-BtFsC7v3.js +++ /dev/null @@ -1,34 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-Wgh3PIP0.js";import"./index-DydPgVMC.js";const e="iblIcdfPixelShader",t=`#include -varying vUV: vec2f; -#ifdef IBL_USE_CUBE_MAP -var iblSourceSampler: sampler;var iblSource: texture_cube; -#else -var iblSourceSampler: sampler;var iblSource: texture_2d; -#endif -var scaledLuminanceSamplerSampler : sampler;var scaledLuminanceSampler : texture_2d;var cdfx: texture_2d;var cdfy: texture_2d;fn fetchLuminance(coords: vec2f)->f32 { -#ifdef IBL_USE_CUBE_MAP -var direction: vec3f=equirectangularToCubemapDirection(coords);var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb; -#else -var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,coords,0.0).rgb; -#endif -return dot(color,LuminanceEncodeApprox);} -fn fetchCDFx(x: u32)->f32 {return textureLoad(cdfx, vec2u(x,0),0).x;} -fn bisectx(size: u32,targetValue: f32)->f32 -{var a: u32=0;var b=size-1;while (b-a>1) {var c: u32=(a+b)>>1;if (fetchCDFx(c)f32 {return textureLoad(cdfy, vec2u(invocationId,y),0).x;} -fn bisecty(size: u32,targetValue: f32,invocationId: u32)->f32 -{var a: u32=0;var b=size-1;while (b-a>1) {var c=(a+b)>>1;if (fetchCDFy(c,invocationId)FragmentOutputs {var cdfxSize: vec2u=textureDimensions(cdfx,0);var cdfWidth: u32=cdfxSize.x;var icdfWidth: u32=cdfWidth-1;var currentPixel: vec2u= vec2u(fragmentInputs.position.xy);var outputColor: vec3f=vec3f(1.0);if (currentPixel.x==0) -{outputColor.x= 0.0;} -else if (currentPixel.x==icdfWidth-1) {outputColor.x= 1.0;} else {var targetValue: f32=fetchCDFx(cdfWidth-1)*input.vUV.x;outputColor.x= bisectx(cdfWidth,targetValue);} -var cdfySize: vec2u=textureDimensions(cdfy,0);var cdfHeight: u32=cdfySize.y;if (currentPixel.y==0) {outputColor.y= 0.0;} -else if (currentPixel.y==cdfHeight-2) {outputColor.y= 1.0;} else {var targetValue: f32=fetchCDFy(cdfHeight-1,currentPixel.x)*input.vUV.y;outputColor.y= max(bisecty(cdfHeight,targetValue,currentPixel.x),0.0);} -var size : vec2f=vec2f(textureDimensions(scaledLuminanceSampler,0));var highestMip: f32=floor(log2(size.x));var normalization : f32=textureSampleLevel(scaledLuminanceSampler, -scaledLuminanceSamplerSampler, -input.vUV,highestMip) -.r;var pixelLuminance: f32=fetchLuminance(input.vUV);outputColor.z=pixelLuminance/(2.0*PI*normalization);fragmentOutputs.color=vec4( outputColor,1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const u={name:e,shader:t};export{u as iblIcdfPixelShaderWGSL}; diff --git a/assets/iblIcdf.fragment-InRvGEK7.js b/assets/iblIcdf.fragment-InRvGEK7.js deleted file mode 100644 index 143b87f1773226c3f40223cd4edcbeab2eb40ed6..0000000000000000000000000000000000000000 --- a/assets/iblIcdf.fragment-InRvGEK7.js +++ /dev/null @@ -1,34 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="iblIcdfPixelShader",i=`precision highp sampler2D; -#include -varying vec2 vUV; -#ifdef IBL_USE_CUBE_MAP -uniform samplerCube iblSource; -#else -uniform sampler2D iblSource; -#endif -uniform sampler2D scaledLuminanceSampler;uniform int iblWidth;uniform int iblHeight;uniform sampler2D cdfx;uniform sampler2D cdfy;float fetchLuminance(vec2 coords) { -#ifdef IBL_USE_CUBE_MAP -vec3 direction=equirectangularToCubemapDirection(coords);vec3 color=textureCubeLodEXT(iblSource,direction,0.0).rgb; -#else -vec3 color=textureLod(iblSource,coords,0.0).rgb; -#endif -return dot(color,LuminanceEncodeApprox);} -float fetchCDFx(int x) { return texelFetch(cdfx,ivec2(x,0),0).x; } -float bisectx(int size,float targetValue) {int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDFx(c)1) {int c=a+b>>1;if (fetchCDFy(c,invocationId) -#ifdef IBL_USE_CUBE_MAP -var iblSourceSampler: sampler;var iblSource: texture_cube; -#else -var iblSourceSampler: sampler;var iblSource: texture_2d; -#endif -uniform iblHeight: i32;uniform iblWidth: i32;fn fetchLuminance(coords: vec2f)->f32 { -#ifdef IBL_USE_CUBE_MAP -var direction: vec3f=equirectangularToCubemapDirection(coords);var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb; -#else -var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,coords,0.0).rgb; -#endif -return dot(color,LuminanceEncodeApprox);} -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var deform: f32=sin(input.vUV.y*PI);var luminance: f32=fetchLuminance(input.vUV);fragmentOutputs.color=vec4f(vec3f(deform*luminance),1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=i);const a={name:e,shader:i};export{a as iblScaledLuminancePixelShaderWGSL}; diff --git a/assets/iblScaledLuminance.fragment-dG8erDYw.js b/assets/iblScaledLuminance.fragment-dG8erDYw.js deleted file mode 100644 index 4034e9673081fd2dd412e474da6e6a16cd05566c..0000000000000000000000000000000000000000 --- a/assets/iblScaledLuminance.fragment-dG8erDYw.js +++ /dev/null @@ -1,16 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="iblScaledLuminancePixelShader",o=`precision highp sampler2D;precision highp samplerCube; -#include -varying vec2 vUV; -#ifdef IBL_USE_CUBE_MAP -uniform samplerCube iblSource; -#else -uniform sampler2D iblSource; -#endif -uniform int iblWidth;uniform int iblHeight;float fetchLuminance(vec2 coords) { -#ifdef IBL_USE_CUBE_MAP -vec3 direction=equirectangularToCubemapDirection(coords);vec3 color=textureCubeLodEXT(iblSource,direction,0.0).rgb; -#else -vec3 color=textureLod(iblSource,coords,0.0).rgb; -#endif -return dot(color,LuminanceEncodeApprox);} -void main(void) {float deform=sin(vUV.y*PI);float luminance=fetchLuminance(vUV);gl_FragColor=vec4(vec3(deform*luminance),1.0);}`;i.ShadersStore[e]||(i.ShadersStore[e]=o);const l={name:e,shader:o};export{l as iblScaledLuminancePixelShader}; diff --git a/assets/iblShadowAccumulation.fragment-BTOxV-El.js b/assets/iblShadowAccumulation.fragment-BTOxV-El.js deleted file mode 100644 index eae7852b5fc122d282d51d205d3f7d9075b7218e..0000000000000000000000000000000000000000 --- a/assets/iblShadowAccumulation.fragment-BTOxV-El.js +++ /dev/null @@ -1,17 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowAccumulationPixelShader",o=`#ifdef GL_ES -precision mediump float; -#endif -varying vec2 vUV;uniform vec4 accumulationParameters; -#define remanence accumulationParameters.x -#define resetb accumulationParameters.y -#define sceneSize accumulationParameters.z -uniform sampler2D motionSampler;uniform sampler2D positionSampler;uniform sampler2D spatialBlurSampler;uniform sampler2D oldAccumulationSampler;uniform sampler2D prevPositionSampler;vec2 max2(vec2 v,vec2 w) { return vec2(max(v.x,w.x),max(v.y,w.y)); } -void main(void) {bool reset=bool(resetb);vec2 gbufferRes=vec2(textureSize(motionSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(spatialBlurSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec4 LP=texelFetch(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {gl_FragColor=vec4(1.0,0.0,0.0,1.0);return;} -vec2 velocityColor=texelFetch(motionSampler,gbufferPixelCoord,0).xy;vec2 prevCoord=vUV+velocityColor;vec3 PrevLP=texture(prevPositionSampler,prevCoord).xyz;vec4 PrevShadows=texture(oldAccumulationSampler,prevCoord);vec3 newShadows=texelFetch(spatialBlurSampler,shadowPixelCoord,0).xyz;PrevShadows.a = -!reset && all(lessThan(abs(prevCoord-vec2(0.5)),vec2(0.5))) && -distance(LP.xyz,PrevLP)<5e-2*sceneSize -? max(PrevShadows.a/(1.0+PrevShadows.a),1.0-remanence) -: 1.0;PrevShadows=max(vec4(0.0),PrevShadows);gl_FragColor = -vec4(mix(PrevShadows.x,newShadows.x,PrevShadows.a), -mix(PrevShadows.y,newShadows.y,PrevShadows.a), -mix(PrevShadows.z,newShadows.z,PrevShadows.a),PrevShadows.a);}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const l={name:e,shader:o};export{l as iblShadowAccumulationPixelShader}; diff --git a/assets/iblShadowAccumulation.fragment-CZ1A4Oy_.js b/assets/iblShadowAccumulation.fragment-CZ1A4Oy_.js deleted file mode 100644 index 9c8fe2d9012514cabb5ad1441f784adc56fba599..0000000000000000000000000000000000000000 --- a/assets/iblShadowAccumulation.fragment-CZ1A4Oy_.js +++ /dev/null @@ -1,13 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowAccumulationPixelShader",a=`varying vUV: vec2f;uniform accumulationParameters: vec4f; -#define remanence uniforms.accumulationParameters.x -#define resetb uniforms.accumulationParameters.y -#define sceneSize uniforms.accumulationParameters.z -var motionSampler: texture_2d;var positionSampler: texture_2d;var spatialBlurSampler : texture_2d;var oldAccumulationSamplerSampler: sampler;var oldAccumulationSampler: texture_2d;var prevPositionSamplerSampler: sampler;var prevPositionSampler: texture_2d;fn max2(v: vec2f,w: vec2f)->vec2f { -return vec2f(max(v.x,w.x),max(v.y,w.y)); } -fn lessThan(x: vec2f,y: vec2f)->vec2 {return xFragmentOutputs {var reset: bool= bool(resetb);var gbufferRes : vec2f=vec2f(textureDimensions(positionSampler,0));var gbufferPixelCoord: vec2i= vec2i(input.vUV*gbufferRes);var shadowRes : vec2f=vec2f(textureDimensions(spatialBlurSampler,0));var shadowPixelCoord: vec2i= vec2i(input.vUV*shadowRes);var LP: vec4f=textureLoad(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {fragmentOutputs.color=vec4f(1.0,0.0,0.0,1.0);return fragmentOutputs;} -var velocityColor: vec2f=textureLoad(motionSampler,gbufferPixelCoord,0).xy;var prevCoord: vec2f=input.vUV+velocityColor;var PrevLP: vec3f=textureSampleLevel(prevPositionSampler,prevPositionSamplerSampler,prevCoord,0.0).xyz;var PrevShadows: vec4f=textureSampleLevel(oldAccumulationSampler,oldAccumulationSamplerSampler,prevCoord,0.0);var newShadows : vec3f=textureLoad(spatialBlurSampler,shadowPixelCoord,0).xyz;PrevShadows.a=select(1.0,max(PrevShadows.a/(1.0+PrevShadows.a),1.0-remanence),!reset && all(lessThan(abs(prevCoord- vec2f(0.5)), vec2f(0.5))) && -distance(LP.xyz,PrevLP)<5e-2*sceneSize);PrevShadows=max( vec4f(0.0),PrevShadows);fragmentOutputs.color= vec4f(mix(PrevShadows.x,newShadows.x,PrevShadows.a), -mix(PrevShadows.y,newShadows.y,PrevShadows.a), -mix(PrevShadows.z,newShadows.z,PrevShadows.a),PrevShadows.a);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const v={name:e,shader:a};export{v as iblShadowAccumulationPixelShaderWGSL}; diff --git a/assets/iblShadowDebug.fragment-BP-W9a1z.js b/assets/iblShadowDebug.fragment-BP-W9a1z.js deleted file mode 100644 index 72c727ffa5185d6ec7427cb07065f36b407c6697..0000000000000000000000000000000000000000 --- a/assets/iblShadowDebug.fragment-BP-W9a1z.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowDebugPixelShader",a=`#ifdef GL_ES -precision mediump float; -#endif -varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D debugSampler;uniform vec4 sizeParams; -#define offsetX sizeParams.x -#define offsetY sizeParams.y -#define widthScale sizeParams.z -#define heightScale sizeParams.w -void main(void) {vec2 uv = -vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 debugColour=texture2D(debugSampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {gl_FragColor.rgb=mix(debugColour.rgb,background.rgb,0.0);gl_FragColor.a=1.0;}}`;r.ShadersStore[e]||(r.ShadersStore[e]=a);const d={name:e,shader:a};export{d as iblShadowDebugPixelShader}; diff --git a/assets/iblShadowDebug.fragment-xXEFreX4.js b/assets/iblShadowDebug.fragment-xXEFreX4.js deleted file mode 100644 index e7781207862fe37a3d4199c9689590080a84fd61..0000000000000000000000000000000000000000 --- a/assets/iblShadowDebug.fragment-xXEFreX4.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowDebugPixelShader",a=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d;var debugSamplerSampler: sampler;var debugSampler: texture_2d;uniform sizeParams: vec4f; -#define offsetX uniforms.sizeParams.x -#define offsetY uniforms.sizeParams.y -#define widthScale uniforms.sizeParams.z -#define heightScale uniforms.sizeParams.w -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f = -vec2f((offsetX+fragmentInputs.vUV.x)*widthScale,(offsetY+fragmentInputs.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vUV);var debugColour: vec4f=textureSample(debugSampler,debugSamplerSampler,fragmentInputs.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {fragmentOutputs.color=vec4f(mix(debugColour.rgb,background.rgb,0.0),1.0);}}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const m={name:e,shader:a};export{m as iblShadowDebugPixelShaderWGSL}; diff --git a/assets/iblShadowGBufferDebug.fragment-B4QmwdVE.js b/assets/iblShadowGBufferDebug.fragment-B4QmwdVE.js deleted file mode 100644 index 39612b122d0e9337fa9baedfa28fe0b8054b95cf..0000000000000000000000000000000000000000 --- a/assets/iblShadowGBufferDebug.fragment-B4QmwdVE.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowGBufferDebugPixelShader",o=`#ifdef GL_ES -precision mediump float; -#endif -varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;uniform sampler2D velocitySampler;uniform vec4 sizeParams;uniform float maxDepth; -#define offsetX sizeParams.x -#define offsetY sizeParams.y -#define widthScale sizeParams.z -#define heightScale sizeParams.w -void main(void) {vec2 uv = -vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 backgroundColour=texture2D(textureSampler,vUV).rgba;vec4 depth=texture2D(depthSampler,vUV);vec4 worldNormal=texture2D(normalSampler,vUV);vec4 worldPosition=texture2D(positionSampler,vUV);vec4 velocityLinear=texture2D(velocitySampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=backgroundColour;} else {gl_FragColor.a=1.0;if (uv.x<=0.25) {gl_FragColor.rgb=depth.rgb;gl_FragColor.a=1.0;} else if (uv.x<=0.5) {velocityLinear.rg=velocityLinear.rg*0.5+0.5;gl_FragColor.rgb=velocityLinear.rgb;} else if (uv.x<=0.75) {gl_FragColor.rgb=worldPosition.rgb;} else {gl_FragColor.rgb=worldNormal.rgb;}}}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const i={name:e,shader:o};export{i as iblShadowGBufferDebugPixelShader}; diff --git a/assets/iblShadowGBufferDebug.fragment-CTpmCBpn.js b/assets/iblShadowGBufferDebug.fragment-CTpmCBpn.js deleted file mode 100644 index b75ea8c11c1a4efe763842a589ea78b5fc1298e6..0000000000000000000000000000000000000000 --- a/assets/iblShadowGBufferDebug.fragment-CTpmCBpn.js +++ /dev/null @@ -1,9 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowGBufferDebugPixelShader",a=`varying vUV : vec2f;var textureSamplerSampler : sampler;var textureSampler : texture_2d;var depthSamplerSampler : sampler;var depthSampler : texture_2d;var normalSamplerSampler : sampler;var normalSampler : texture_2d;var positionSamplerSampler : sampler;var positionSampler : texture_2d;var velocitySamplerSampler : sampler;var velocitySampler : texture_2d;uniform sizeParams : vec4f; -#define offsetX uniforms.sizeParams.x -#define offsetY uniforms.sizeParams.y -#define widthScale uniforms.sizeParams.z -#define heightScale uniforms.sizeParams.w -@fragment fn main(input : FragmentInputs)->FragmentOutputs {var uv : vec2f= -vec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var backgroundColour: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgba;var depth : vec4f=textureSample(depthSampler,depthSamplerSampler,input.vUV);var worldNormal: vec4f=textureSample(normalSampler,normalSamplerSampler,input.vUV);var worldPosition : vec4f=textureSample(positionSampler,positionSamplerSampler,input.vUV);var velocityLinear : vec4f=textureSample(velocitySampler,velocitySamplerSampler,input.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=backgroundColour;} else {if (uv.x<=0.25) {fragmentOutputs.color=vec4f(depth.rgb,1.0);} else if (uv.x<=0.5) {velocityLinear = -vec4f(velocityLinear.r*0.5+0.5,velocityLinear.g*0.5+0.5, -velocityLinear.b,velocityLinear.a);fragmentOutputs.color=vec4f(velocityLinear.rgb,1.0);} else if (uv.x<=0.75) {fragmentOutputs.color=vec4f(worldPosition.rgb,1.0);} else {fragmentOutputs.color=vec4f(worldNormal.rgb,1.0);}}}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const o={name:e,shader:a};export{o as iblShadowGBufferDebugPixelShaderWGSL}; diff --git a/assets/iblShadowSpatialBlur.fragment-AqpRDHpH.js b/assets/iblShadowSpatialBlur.fragment-AqpRDHpH.js deleted file mode 100644 index 5d28c8a49fcb504a481243cc5c022827bf1c5355..0000000000000000000000000000000000000000 --- a/assets/iblShadowSpatialBlur.fragment-AqpRDHpH.js +++ /dev/null @@ -1,13 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowSpatialBlurPixelShader",o=`precision highp sampler2D; -#define PI 3.1415927 -varying vec2 vUV;uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D voxelTracingSampler;uniform vec4 blurParameters; -#define stridef blurParameters.x -#define worldScale blurParameters.y -const float weights[5]=float[5](0.0625,0.25,0.375,0.25,0.0625);const int nbWeights=5;vec2 max2(vec2 v,vec2 w) {return vec2(max(v.x,w.x),max(v.y,w.y));} -void main(void) -{vec2 gbufferRes=vec2(textureSize(depthSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(voxelTracingSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec3 N=texelFetch(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;} -float depth=-texelFetch(depthSampler,gbufferPixelCoord,0).x;vec4 X=vec4(0.0);for(int y=0; y>1),y-(nbWeights>>1));ivec2 shadowCoords=shadowPixelCoord+int(stridef)*ivec2(x-(nbWeights>>1),y-(nbWeights>>1));vec4 T=texelFetch(voxelTracingSampler,shadowCoords,0);float ddepth=-texelFetch(depthSampler,gBufferCoords,0).x-depth;vec3 dN=texelFetch(worldNormalSampler,gBufferCoords,0).xyz-N;float w=weights[x]*weights[y] * -exp2(max(-1000.0/(worldScale*worldScale),-0.5) * -(ddepth*ddepth) - -1e1*dot(dN,dN));X+=vec4(w*T.x,w*T.y,w*T.z,w);}} -gl_FragColor=vec4(X.x/X.w,X.y/X.w,X.z/X.w,1.0);}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const i={name:e,shader:o};export{i as iblShadowSpatialBlurPixelShader}; diff --git a/assets/iblShadowSpatialBlur.fragment-DCYuT3v7.js b/assets/iblShadowSpatialBlur.fragment-DCYuT3v7.js deleted file mode 100644 index 540849045ae796797bb1fc9804feabfdf6ccb845..0000000000000000000000000000000000000000 --- a/assets/iblShadowSpatialBlur.fragment-DCYuT3v7.js +++ /dev/null @@ -1,12 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowSpatialBlurPixelShader",a=`#define PI 3.1415927 -varying vUV: vec2f;var depthSampler: texture_2d;var worldNormalSampler: texture_2d;var voxelTracingSampler : texture_2d;uniform blurParameters: vec4f; -#define stridef uniforms.blurParameters.x -#define worldScale uniforms.blurParameters.y -const weights=array(0.0625,0.25,0.375,0.25,0.0625);const nbWeights: i32=5;fn max2(v: vec2f,w: vec2f)->vec2f {return vec2f(max(v.x,w.x),max(v.y,w.y));} -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var gbufferRes=vec2f(textureDimensions(depthSampler,0));var gbufferPixelCoord= vec2i(fragmentInputs.vUV*gbufferRes);var shadowRes=vec2f(textureDimensions(voxelTracingSampler,0));var shadowPixelCoord= vec2i(fragmentInputs.vUV*shadowRes);var N: vec3f=textureLoad(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;} -var depth: f32=-textureLoad(depthSampler,gbufferPixelCoord,0).x;var X: vec4f= vec4f(0.0);for(var y: i32=0; y>1),y-(nbWeights>>1));var shadowCoords: vec2i=shadowPixelCoord+i32(stridef)*vec2i(x-(nbWeights>>1),y-(nbWeights>>1));var T : vec3f=textureLoad(voxelTracingSampler,shadowCoords,0).xyz;var ddepth: f32=-textureLoad(depthSampler,gBufferCoords,0).x-depth;var dN: vec3f=textureLoad(worldNormalSampler,gBufferCoords,0).xyz-N;var w: f32=weights[x]*weights[y] * -exp2(max(-1000.0/(worldScale*worldScale),-0.5) * -(ddepth*ddepth) - -1e1*dot(dN,dN));X+= vec4f(w*T.x,w*T.y,w*T.z,w);}} -fragmentOutputs.color= vec4f(X.x/X.w,X.y/X.w,X.z/X.w,1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const f={name:e,shader:a};export{f as iblShadowSpatialBlurPixelShaderWGSL}; diff --git a/assets/iblShadowVoxelTracing.fragment-BUnFIr20.js b/assets/iblShadowVoxelTracing.fragment-BUnFIr20.js deleted file mode 100644 index ee532ea1866a0800c72c5fbc98f2fe145908ccd3..0000000000000000000000000000000000000000 --- a/assets/iblShadowVoxelTracing.fragment-BUnFIr20.js +++ /dev/null @@ -1,179 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowVoxelTracingPixelShader",i=`precision highp sampler2D;precision highp sampler3D; -#define PI 3.1415927 -varying vec2 vUV; -#define DISABLE_UNIFORMITY_ANALYSIS -uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfSampler;uniform sampler3D voxelGridSampler; -#ifdef COLOR_SHADOWS -uniform samplerCube iblSampler; -#endif -uniform vec4 shadowParameters; -#define SHADOWdirs shadowParameters.x -#define SHADOWframe shadowParameters.y -#define SHADOWenvRot shadowParameters.w -uniform vec4 voxelBiasParameters; -#define highestMipLevel voxelBiasParameters.z -uniform vec4 sssParameters; -#define SSSsamples sssParameters.x -#define SSSstride sssParameters.y -#define SSSmaxDistance sssParameters.z -#define SSSthickness sssParameters.w -uniform vec4 shadowOpacity;uniform mat4 projMtx;uniform mat4 viewMtx;uniform mat4 invProjMtx;uniform mat4 invViewMtx;uniform mat4 wsNormalizationMtx;uniform mat4 invVPMtx; -#define PI 3.1415927 -#define GOLD 0.618034 -struct AABB3f {vec3 m_min;vec3 m_max;};struct Ray {vec3 orig;vec3 dir;vec3 dir_rcp;float t_min;float t_max;};Ray make_ray(const vec3 origin,const vec3 direction,const float tmin, -const float tmax) {Ray ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;} -bool ray_box_intersection(const in AABB3f aabb,const in Ray ray, -out float distance_near,out float distance_far) {vec3 tbot=ray.dir_rcp*(aabb.m_min-ray.orig);vec3 ttop=ray.dir_rcp*(aabb.m_max-ray.orig);vec3 tmin=min(ttop,tbot);vec3 tmax=max(ttop,tbot);distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return distance_near<=distance_far;} -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -struct VoxelMarchDiagnosticInfo {float heat;ivec3 voxel_intersect_coords;}; -#endif -uint hash(uint i) {i ^= i>>16u;i*=0x7FEB352Du;i ^= i>>15u;i*=0x846CA68Bu;i ^= i>>16u;return i;} -float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;} -vec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.0*PI;float phi=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;} -vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u), -uint2float(rstate*2447445414u));} -float goldenSequence(const uint rstate) {return uint2float(rstate*2654435769u);} -float distanceSquared(vec2 a,vec2 b) {vec2 diff=a-b;return dot(diff,diff);} -void genTB(const vec3 N,out vec3 T,out vec3 B) {float s=N.z<0.0 ? -1.0 : 1.0;float a=-1.0/(s+N.z);float b=N.x*N.y*a;T=vec3(1.0+s*N.x*N.x*a,s*b,-s*N.x);B=vec3(b,s+N.y*N.y*a,-N.y);} -int stack[24]; -#define PUSH(i) stack[stackLevel++]=i; -#define POP() stack[--stackLevel] -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -bool anyHitVoxels(const Ray ray_vs, -out VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) { -#else -bool anyHitVoxels(const Ray ray_vs) { -#endif -vec3 invD=ray_vs.dir_rcp;vec3 D=ray_vs.dir;vec3 O=ray_vs.orig;ivec3 negD=ivec3(lessThan(D,vec3(0,0,0)));int voxel0=negD.x | negD.y<<1 | negD.z<<2;vec3 t0=-O*invD,t1=(vec3(1.0)-O)*invD;int maxLod=int(highestMipLevel);int stackLevel=0; -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -uint steps=0u; -#endif -PUSH(maxLod<<24);while (stackLevel>0) {int elem=POP();ivec4 Coords = -ivec4(elem & 0xFF,elem>>8 & 0xFF,elem>>16 & 0xFF,elem>>24);if (Coords.w==0) { -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -voxel_march_diagnostic_info.heat=float(steps)/24.0; -#endif -return true;} -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -++steps; -#endif -float invRes=exp2(float(Coords.w-maxLod));vec3 bbmin=invRes*vec3(Coords.xyz+negD);vec3 bbmax=invRes*vec3(Coords.xyz-negD+ivec3(1));vec3 mint=mix(t0,t1,bbmin);vec3 maxt=mix(t0,t1,bbmax);vec3 midt=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);int nodeMask=int( -round(texelFetch(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;int voxelBit=voxel0;Coords.xyz=(Coords.xyz<<1)+negD;int packedCoords = -Coords.x | Coords.y<<8 | Coords.z<<16 | Coords.w<<24;if (max(mint.x,max(mint.y,mint.z))0.0 && stepCount0.0) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise=vec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u))); -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -VoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,voxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat; -#else -opacity = -max(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise)); -#endif -vec3 VL=(viewMtx*L).xyz; -#ifdef RIGHT_HANDED -float nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0); -float farPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0); -#else -float nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0); -float farPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0); -#endif -float ssShadow=shadowOpacity.y * -screenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ, -abs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow); -#ifdef COLOR_SHADOWS -vec3 light=pdf<1e-6 ? vec3(0.0) : vec3(cosNL)/vec3(pdf)*ibl;shadowedLight+=light*opacity;totalLight+=light; -#else -float rcos=(1.0-cosNL);shadowAccum+=(1.0-opacity*(1.0-pow(rcos,8.0)));sampleWeight+=1.0;vec3 VR=-(viewMtx*vec4(reflect(-L.xyz,N),0.0)).xyz;specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0); -#endif -} -noise.z=fract(noise.z+GOLD);} -#ifdef COLOR_SHADOWS -vec3 shadow=(totalLight-shadowedLight)/totalLight;float maxShadow=max(max(shadow.x,max(shadow.y,shadow.z)),1.0);glFragColor=vec4(shadow/maxShadow,1.0); -#else -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -gl_FragColor=vec4(shadowAccum/float(sampleWeight), -specShadowAccum/float(sampleWeight),heat/float(sampleWeight),1.0); -#else -gl_FragColor=vec4(shadowAccum/float(sampleWeight),specShadowAccum/float(sampleWeight),0.0,1.0); -#endif -#endif -}`;t.ShadersStore[e]||(t.ShadersStore[e]=i);const r={name:e,shader:i};export{r as iblShadowVoxelTracingPixelShader}; diff --git a/assets/iblShadowVoxelTracing.fragment-Dwywarfr.js b/assets/iblShadowVoxelTracing.fragment-Dwywarfr.js deleted file mode 100644 index 1ae0a4e0ee42f83a1b03d2048b941767cd959bf0..0000000000000000000000000000000000000000 --- a/assets/iblShadowVoxelTracing.fragment-Dwywarfr.js +++ /dev/null @@ -1,185 +0,0 @@ -import{S as a}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblShadowVoxelTracingPixelShader",r=`#define PI 3.1415927 -varying vUV: vec2f; -#define DISABLE_UNIFORMITY_ANALYSIS -var depthSampler: texture_2d;var worldNormalSampler : texture_2d;var blueNoiseSampler: texture_2d;var icdfSamplerSampler: sampler;var icdfSampler: texture_2d;var voxelGridSamplerSampler: sampler;var voxelGridSampler: texture_3d; -#ifdef COLOR_SHADOWS -var iblSamplerSampler: sampler;var iblSampler: texture_cube; -#endif -uniform shadowParameters: vec4f; -#define SHADOWdirs uniforms.shadowParameters.x -#define SHADOWframe uniforms.shadowParameters.y -#define SHADOWenvRot uniforms.shadowParameters.w -uniform voxelBiasParameters : vec4f; -#define highestMipLevel uniforms.voxelBiasParameters.z -uniform sssParameters: vec4f; -#define SSSsamples uniforms.sssParameters.x -#define SSSstride uniforms.sssParameters.y -#define SSSmaxDistance uniforms.sssParameters.z -#define SSSthickness uniforms.sssParameters.w -uniform shadowOpacity: vec4f;uniform projMtx: mat4x4f;uniform viewMtx: mat4x4f;uniform invProjMtx: mat4x4f;uniform invViewMtx: mat4x4f;uniform wsNormalizationMtx: mat4x4f;uniform invVPMtx: mat4x4f; -#define PI 3.1415927 -#define GOLD 0.618034 -struct AABB3f {m_min: vec3f, -m_max: vec3f,};struct Ray {orig: vec3f, -dir: vec3f, -dir_rcp: vec3f, -t_min: f32, -t_max: f32,};fn make_ray(origin: vec3f,direction: vec3f,tmin: f32, -tmax: f32)->Ray {var ray: Ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;} -fn ray_box_intersection(aabb: AABB3f,ray: Ray , -distance_near: ptr,distance_far: ptr)->bool{var tbot: vec3f=ray.dir_rcp*(aabb.m_min-ray.orig);var ttop: vec3f=ray.dir_rcp*(aabb.m_max-ray.orig);var tmin: vec3f=min(ttop,tbot);var tmax: vec3f=max(ttop,tbot);*distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));*distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return *distance_near<=*distance_far;} -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -struct VoxelMarchDiagnosticInfo {heat: f32, -voxel_intersect_coords: vec3i,}; -#endif -fn hash(i: u32)->u32 {var temp=i ^ (i>>16u);temp*=0x7FEB352Du;temp ^= temp>>15u;temp*=0x846CA68Bu;temp ^= temp>>16u;return temp;} -fn uintBitsToFloat(x: u32)->f32 {return bitcast(x);} -fn uint2float(i: u32)->f32 {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;} -fn uv_to_normal(uv: vec2f)->vec3f {var N: vec3f;var uvRange: vec2f=uv;var theta: f32=uvRange.x*2.0*PI;var phi: f32=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;} -fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u), -uint2float(rstate*2447445414u));} -fn goldenSequence(rstate: u32)->f32 {return uint2float(rstate*2654435769u);} -fn distanceSquared(a: vec2f,b: vec2f)->f32 {var diff: vec2f=a-b;return dot(diff,diff);} -fn genTB(N: vec3f,T: ptr,B: ptr) {var s: f32=select(1.0,-1.0,N.z<0.0);var a: f32=-1.0/(s+N.z);var b: f32=N.x*N.y*a;*T= vec3f(1.0+s*N.x*N.x*a,s*b,-s*N.x);*B= vec3f(b,s+N.y*N.y*a,-N.y);} -fn lessThan(x: vec3f,y: vec3f)->vec3 {return x)->bool { -#else -fn anyHitVoxels(ray_vs: Ray)->bool { -#endif -var stack=array(); -var invD: vec3f=ray_vs.dir_rcp;var D: vec3f=ray_vs.dir;var O: vec3f=ray_vs.orig;var negD=vec3i(lessThan(D, vec3f(0,0,0)));var voxel0: i32=negD.x | (negD.y<<1) | (negD.z<<2);var t0: vec3f=-O*invD;var t1=(vec3f(1.0)-O)*invD;var maxLod: i32= i32(highestMipLevel);var stackLevel: i32=0; -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -var steps: u32=0u; -#endif -stack[stackLevel]=maxLod<<24;stackLevel++;while (stackLevel>0) {stackLevel=stackLevel-1;var elem: i32=stack[stackLevel];var Coords: vec4i = -vec4i(elem & 0xFF,(elem>>8) & 0xFF,(elem>>16) & 0xFF,elem>>24);if (Coords.w==0) { -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -*voxel_march_diagnostic_info.heat= f32(steps)/24.0; -#endif -return true;} -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -++steps; -#endif -var invRes: f32=exp2(f32(Coords.w-maxLod));var bbmin: vec3f=invRes*vec3f(Coords.xyz+negD);var bbmax: vec3f=invRes*vec3f(Coords.xyz-negD+vec3i(1));var mint: vec3f=mix(t0,t1,bbmin);var maxt: vec3f=mix(t0,t1,bbmax);var midt: vec3f=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);var nodeMask: u32= u32( -round(textureLoad(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;var voxelBit: u32=u32(voxel0);Coords=vec4i((Coords.xyz<f32 {return (near*far)/(far-depth*(far-near));} -fn screenSpaceShadow(csOrigin: vec3f,csDirection: vec3f,csZBufferSize: vec2f, -nearPlaneZ: f32,farPlaneZ: f32,noise: f32)->f32 { -#ifdef RIGHT_HANDED -var csZDir : f32=-1.0; -#else -var csZDir : f32=1.0; -#endif -var ssSamples: f32=SSSsamples;var ssMaxDist: f32=SSSmaxDistance;var ssStride: f32=SSSstride;var ssThickness: f32=SSSthickness;var rayLength: f32 = -select(ssMaxDist,(nearPlaneZ-csOrigin.z)/csDirection.z, -csZDir*(csOrigin.z+ssMaxDist*csDirection.z)0.0 && stepCount)->f32 { -#else -fn voxelShadow(wsOrigin: vec3f,wsDirection: vec3f,wsNormal: vec3f, -DitherNoise: vec2f)->f32 { -#endif -var vxResolution: f32=f32(textureDimensions(voxelGridSampler,0).x);var T: vec3f;var B: vec3f;genTB(wsDirection,&T,&B);var DitherXY: vec2f=sqrt(DitherNoise.x)* vec2f(cos(2.0*PI*DitherNoise.y), -sin(2.0*PI*DitherNoise.y));var Dithering : vec3f=(uniforms.voxelBiasParameters.x*wsNormal + -uniforms.voxelBiasParameters.y*wsDirection + -DitherXY.x*T+DitherXY.y*B) / -vxResolution;var O: vec3f=0.5*wsOrigin+0.5+Dithering;var ray_vs=make_ray(O,wsDirection,0.0,10.0);var voxel_aabb: AABB3f;voxel_aabb.m_min=vec3f(0);voxel_aabb.m_max=vec3f(1);var near: f32=0;var far: f32=0;if (!ray_box_intersection(voxel_aabb,ray_vs,&near,&far)) {return 0.0;} -ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far); -#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -return select(0.0f,1.0f,anyHitVoxels(ray_vs,voxel_march_diagnostic_info)); -#else -return select(0.0f,1.0f,anyHitVoxels(ray_vs)); -#endif -} -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var nbDirs=u32(SHADOWdirs);var frameId=u32(SHADOWframe);var envRot: f32=SHADOWenvRot;var Resolution: vec2f= vec2f(textureDimensions(depthSampler,0));var currentPixel=vec2i(fragmentInputs.vUV*Resolution);var GlobalIndex = -(frameId*u32(Resolution.y)+u32(currentPixel.y))*u32(Resolution.x) + -u32(currentPixel.x);var N : vec3f=textureLoad(worldNormalSampler,currentPixel,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;} -var normalizedRotation: f32=envRot/(2.0*PI);var depth : f32=textureLoad(depthSampler,currentPixel,0).x; -#ifndef IS_NDC_HALF_ZRANGE -depth=depth*2.0-1.0; -#endif -var temp : vec2f=(vec2f(currentPixel)+vec2f(0.5))*2.0/Resolution - -vec2f(1.0);var VP : vec4f=uniforms.invProjMtx*vec4f(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);var noise : vec3f=textureLoad(blueNoiseSampler,currentPixel & vec2i(0xFF),0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs)); -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -var heat: f32=0.0f; -#endif -var shadowAccum: f32=0.001;var specShadowAccum: f32=0.001;var sampleWeight : f32=0.001; -#ifdef COLOR_SHADOWS -var totalLight: vec3f=vec3f(0.001);var shadowedLight: vec3f=vec3f(0.0); -#endif -for (var i: u32=0; i0.0) {var VP2: vec4f=VP;VP2.y*=-1.0;var unormWP : vec4f=uniforms.invViewMtx*VP2;var WP: vec3f=(uniforms.wsNormalizationMtx*unormWP).xyz;var vxNoise: vec2f=vec2f(uint2float(hash(dirId*2)),uint2float(hash(dirId*2+1))); -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -VoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity, -uniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise, -voxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat; -#else -opacity = -max(opacity,uniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise)); -#endif -var VL : vec3f=(uniforms.viewMtx*L).xyz; -#ifdef RIGHT_HANDED -var nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0); -var farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0); -#else -var nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0); -var farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0); -#endif -var ssShadow: f32=uniforms.shadowOpacity.y * -screenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ, -abs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow); -#ifdef COLOR_SHADOWS -var light: vec3f=select(vec3f(0.0),vec3f(cosNL)/vec3f(pdf)*ibl,pdf>1e-6);shadowedLight+=light*opacity;totalLight+=light; -#else -var rcos: f32=1.0-cosNL;shadowAccum+=(1.0-opacity*(1.0-pow(rcos,8.0)));sampleWeight+=1.0;var VR : vec3f=abs((uniforms.viewMtx*vec4f(reflect(-L.xyz,N),0.0)).xyz);specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0); -#endif -} -noise.z=fract(noise.z+GOLD);} -#ifdef COLOR_SHADOWS -var shadow: vec3f=(totalLight-shadowedLight)/totalLight;var maxShadow: f32=max(max(shadow.x,max(shadow.y,shadow.z)),1.0);fragmentOutputs.color=vec4f(shadow/maxShadow,1.0); -#else -#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION -fragmentOutputs.color = -vec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,heat/sampleWeight,1.0); -#else -fragmentOutputs.color=vec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,0.0,1.0); -#endif -#endif -}`;a.ShadersStoreWGSL[e]||(a.ShadersStoreWGSL[e]=r);const s={name:e,shader:r};export{s as iblShadowVoxelTracingPixelShaderWGSL}; diff --git a/assets/iblShadowsRenderPipeline-C1gmR1Lq.js b/assets/iblShadowsRenderPipeline-C1gmR1Lq.js deleted file mode 100644 index e4f5fb533c0103f316f8218e8d6cd17b4bc2b5b0..0000000000000000000000000000000000000000 --- a/assets/iblShadowsRenderPipeline-C1gmR1Lq.js +++ /dev/null @@ -1,136 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./iblVoxelGrid3dDebug.fragment-DHAXBFG8.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./iblVoxelGrid3dDebug.fragment-1MI8eJOo.js","./copyTexture3DLayerToTexture.fragment-CpKHumte.js","./copyTexture3DLayerToTexture.fragment-D0qr2EcB.js","./iblCombineVoxelGrids.fragment-Dk6LvH09.js","./iblCombineVoxelGrids.fragment-iQq4wJGG.js","./iblGenerateVoxelMip.fragment-DpLhGDkX.js","./iblGenerateVoxelMip.fragment-DMGE_mAY.js","./iblVoxelGrid.fragment-Cyq3RUoc.js","./iblVoxelGrid.vertex-BzQZ0wJX.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./iblVoxelGrid.fragment-Df8sQnC8.js","./iblVoxelGrid.vertex-s6WDBOtU.js","./bakedVertexAnimation-CaTOZtWZ.js","./instancesDeclaration-CYMjgQ6_.js","./morphTargetsVertex-CUt9TeiZ.js","./iblVoxelSlabDebug.fragment-MJ7dKEzp.js","./iblVoxelSlabDebug.vertex--Wmx0qoC.js","./iblVoxelSlabDebug.fragment-BSQWr77T.js","./iblVoxelSlabDebug.vertex-C61IsPYN.js","./iblShadowDebug.fragment-xXEFreX4.js","./iblShadowDebug.fragment-BP-W9a1z.js","./iblShadowVoxelTracing.fragment-Dwywarfr.js","./iblShadowVoxelTracing.fragment-BUnFIr20.js","./iblShadowSpatialBlur.fragment-DCYuT3v7.js","./iblShadowSpatialBlur.fragment-AqpRDHpH.js","./iblShadowAccumulation.fragment-CZ1A4Oy_.js","./iblShadowAccumulation.fragment-BTOxV-El.js","./pass.fragment-I5Wdwpz1.js","./pass.fragment-nyUGT5FF.js","./iblShadowGBufferDebug.fragment-CTpmCBpn.js","./iblShadowGBufferDebug.fragment-B4QmwdVE.js"])))=>i.map(i=>d[i]); -import{af as o}from"./index-DydPgVMC.js";import{aL as p,aA as w,b9 as B,O as R,M as b,ai as f,L as _,aD as L,aE as N,T as x,bz as F,bn as D,V as g,bC as U,bD as y,ac as H,_ as V,s as C,ae as X,R as Y,aq as k,ao as I,d as Z}from"./index-GY9JDBGV.js";import{ShaderMaterial as A}from"./shaderMaterial-BaU8T3Xh.js";import{P}from"./iblCdfGenerator-D-umVdZE.js";import{G as d}from"./geometryBufferRenderer-DviLW_b_.js";import{P as j,a as q}from"./postProcessRenderEffect-Bi0eHNy8.js";import{R as Q}from"./rawTexture-BDsvmix4.js";import{OpenPBRMaterial as M}from"./openpbrMaterial-D1CYjggx.js";import{S as J}from"./standardMaterial-Dw51Jj3C.js";import"./geometryBufferRendererSceneComponent-DhSOci2A.js";import"./iblCdfGeneratorSceneComponent-BEGjGKxj.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./bumpFragment-Dn7_UB6Q.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./bumpVertex-dKv8gF7O.js";class K{getVoxelGrid(){return this._engine.isWebGPU?this._voxelGrid:this._triPlanarVoxelization?this._combinedVoxelGridPT:this._voxelGridZaxis}getDebugPassPP(){return this._voxelDebugPass||this._createDebugPass(),this._voxelDebugPass}get triPlanarVoxelization(){return this._triPlanarVoxelization}set triPlanarVoxelization(e){if(this._engine.isWebGPU){this._triPlanarVoxelization=!0;return}this._triPlanarVoxelization!==e&&(this._triPlanarVoxelization=e,this._disposeVoxelTextures(),this._createTextures())}setWorldScaleMatrix(e){this._invWorldScaleMatrix=e}isVoxelizationInProgress(){return this._voxelizationInProgress}get voxelResolutionExp(){return this._voxelResolutionExp}set voxelResolutionExp(e){this._voxelResolutionExp===e&&this._voxelGridZaxis||(this._voxelResolutionExp=Math.round(Math.min(Math.max(e,3),9)),this._voxelResolution=Math.pow(2,this._voxelResolutionExp),this._disposeVoxelTextures(),this._createTextures())}set voxelDebugAxis(e){this._voxelDebugAxis=e}get voxelDebugAxis(){return this._voxelDebugAxis}setDebugDisplayParams(e,t,s,i){this._debugSizeParams.set(e,t,s,i)}setDebugMipNumber(e){this._debugMipNumber=e}get debugPassName(){return this._debugPassName}get voxelDebugEnabled(){return this._voxelDebugEnabled}set voxelDebugEnabled(e){this._voxelDebugEnabled!==e&&(this._voxelDebugEnabled=e,e&&(this._voxelSlabDebugRT=new p("voxelSlabDebug",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},this._scene,{generateDepthBuffer:!0,generateMipMaps:!1,type:0,format:5,samplingMode:1}),this._voxelSlabDebugRT.noPrePassRenderer=!0),this._voxelSlabDebugRT&&this._removeVoxelRTs([this._voxelSlabDebugRT]),this._voxelDebugEnabled?(this._addRTsForRender([this._voxelSlabDebugRT],this._includedMeshes,this._voxelDebugAxis,1,!0),this._setDebugBindingsBound=this._setDebugBindings.bind(this),this._scene.onBeforeRenderObservable.add(this._setDebugBindingsBound)):this._scene.onBeforeRenderObservable.removeCallback(this._setDebugBindingsBound))}_createDebugPass(){const e=this._engine.isWebGPU;if(!this._voxelDebugPass){const t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams","mipNumber"],samplers:["voxelTexture","voxelSlabTexture"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(s,i)=>{s?i.push(o(()=>import("./iblVoxelGrid3dDebug.fragment-DHAXBFG8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)):i.push(o(()=>import("./iblVoxelGrid3dDebug.fragment-1MI8eJOo.js"),__vite__mapDeps([4,1,2,3]),import.meta.url))}};this._voxelDebugPass=new w(this.debugPassName,"iblVoxelGrid3dDebug",t),this._voxelDebugPass.onApplyObservable.add(s=>{this._voxelDebugAxis===0?s.setTexture("voxelTexture",this._voxelGridXaxis):this._voxelDebugAxis===1?s.setTexture("voxelTexture",this._voxelGridYaxis):this._voxelDebugAxis===2?s.setTexture("voxelTexture",this._voxelGridZaxis):s.setTexture("voxelTexture",this.getVoxelGrid()),s.setTexture("voxelSlabTexture",this._voxelSlabDebugRT),s.setVector4("sizeParams",this._debugSizeParams),s.setFloat("mipNumber",this._debugMipNumber)})}}constructor(e,t,s=6,i=!0){this._voxelMrtsXaxis=[],this._voxelMrtsYaxis=[],this._voxelMrtsZaxis=[],this._voxelClearColor=new B(0,0,0,1),this.onVoxelizationCompleteObservable=new R,this._renderTargets=[],this._triPlanarVoxelization=!0,this._voxelizationInProgress=!1,this._invWorldScaleMatrix=b.Identity(),this._voxelResolution=64,this._voxelResolutionExp=6,this._mipArray=[],this._voxelDebugEnabled=!1,this._voxelDebugAxis=-1,this._debugSizeParams=new f(0,0,0,0),this._includedMeshes=[],this._debugMipNumber=0,this._debugPassName="Voxelization Debug Pass",this._scene=e,this._engine=e.getEngine(),this._triPlanarVoxelization=this._engine.isWebGPU||i,this._engine.getCaps().drawBuffersExtension||_.Error("Can't do voxel rendering without the draw buffers extension.");const n=this._engine.isWebGPU;this._maxDrawBuffers=this._engine.getCaps().maxDrawBuffers||0,this._copyMipEffectRenderer=new L(this._engine),this._copyMipEffectWrapper=new N({engine:this._engine,fragmentShader:"copyTexture3DLayerToTexture",useShaderStore:!0,uniformNames:["layerNum"],samplerNames:["textureSampler"],shaderLanguage:n?1:0,extraInitializationsAsync:async()=>{n?await o(()=>import("./copyTexture3DLayerToTexture.fragment-CpKHumte.js"),__vite__mapDeps([5,1,2,3]),import.meta.url):await o(()=>import("./copyTexture3DLayerToTexture.fragment-D0qr2EcB.js"),__vite__mapDeps([6,1,2,3]),import.meta.url)}}),this.voxelResolutionExp=s}_generateMipMaps(){const e=Math.ceil(Math.log2(this._voxelResolution));for(let t=1;t{e?await o(()=>import("./iblCombineVoxelGrids.fragment-Dk6LvH09.js"),__vite__mapDeps([7,1,2,3]),import.meta.url):await o(()=>import("./iblCombineVoxelGrids.fragment-iQq4wJGG.js"),__vite__mapDeps([8,1,2,3]),import.meta.url)}};this._engine.isWebGPU?(this._voxelGrid=new p("voxelGrid",t,this._scene,{...n,format:5,creationFlags:1}),this._voxelGridRT=new p("voxelGridRT",{width:Math.min(t.width*2,2048),height:Math.min(t.height*2,2048)},this._scene,s)):this._triPlanarVoxelization?(this._voxelGridXaxis=new p("voxelGridXaxis",t,this._scene,s),this._voxelGridYaxis=new p("voxelGridYaxis",t,this._scene,s),this._voxelGridZaxis=new p("voxelGridZaxis",t,this._scene,s),this._voxelMrtsXaxis=this._createVoxelMRTs("x_axis_",this._voxelGridXaxis,i),this._voxelMrtsYaxis=this._createVoxelMRTs("y_axis_",this._voxelGridYaxis,i),this._voxelMrtsZaxis=this._createVoxelMRTs("z_axis_",this._voxelGridZaxis,i),this._combinedVoxelGridPT=new P("combinedVoxelGrid",t,"iblCombineVoxelGrids",this._scene,n,!1),this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._combinedVoxelGridPT),1),this._combinedVoxelGridPT.setFloat("layer",0),this._combinedVoxelGridPT.setTexture("voxelXaxisSampler",this._voxelGridXaxis),this._combinedVoxelGridPT.setTexture("voxelYaxisSampler",this._voxelGridYaxis),this._combinedVoxelGridPT.setTexture("voxelZaxisSampler",this._voxelGridZaxis),this._combinedVoxelGridPT.autoClear=!1,this._combinedVoxelGridPT.wrapU=x.CLAMP_ADDRESSMODE,this._combinedVoxelGridPT.wrapV=x.CLAMP_ADDRESSMODE):(this._voxelGridZaxis=new p("voxelGridZaxis",t,this._scene,n),this._voxelMrtsZaxis=this._createVoxelMRTs("z_axis_",this._voxelGridZaxis,i));const a={generateDepthBuffer:!1,generateMipMaps:!1,type:0,format:6,samplingMode:1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await o(()=>import("./iblGenerateVoxelMip.fragment-DpLhGDkX.js"),__vite__mapDeps([9,1,2,3]),import.meta.url):await o(()=>import("./iblGenerateVoxelMip.fragment-DMGE_mAY.js"),__vite__mapDeps([10,1,2,3]),import.meta.url)}};this._mipArray=new Array(Math.ceil(Math.log2(this._voxelResolution)));for(let r=1;r<=this._mipArray.length;r++){const l=this._voxelResolution>>r,h={width:l,height:l,depth:l};this._mipArray[r-1]=new P("voxelMip"+r,h,"iblGenerateVoxelMip",this._scene,a,!1),this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._mipArray[r-1]),1);const u=this._mipArray[r-1];u.autoClear=!1,u.wrapU=x.CLAMP_ADDRESSMODE,u.wrapV=x.CLAMP_ADDRESSMODE,u.setTexture("srcMip",r>1?this._mipArray[r-2]:this.getVoxelGrid()),u.setInt("layerNum",0)}this._createVoxelMaterials()}_createVoxelMRTs(e,t,s){t.wrapU=x.CLAMP_ADDRESSMODE,t.wrapV=x.CLAMP_ADDRESSMODE,t.noPrePassRenderer=!0;const i=[],n=new Array(this._maxDrawBuffers).fill(32879);for(let a=0;aa*this._maxDrawBuffers+m);let l=new Array(this._maxDrawBuffers).fill("");l=l.map((u,m)=>"voxel_grid_"+e+(a*this._maxDrawBuffers+m));const h=new F("mrt_"+e+a,{width:this._voxelResolution,height:this._voxelResolution,depth:this._voxelResolution},this._maxDrawBuffers,this._scene,{types:new Array(this._maxDrawBuffers).fill(0),samplingModes:new Array(this._maxDrawBuffers).fill(3),generateMipMaps:!1,targetTypes:n,formats:new Array(this._maxDrawBuffers).fill(6),faceIndex:new Array(this._maxDrawBuffers).fill(0),layerIndex:r,layerCounts:new Array(this._maxDrawBuffers).fill(this._voxelResolution),generateDepthBuffer:!1,generateStencilBuffer:!1},l);h.clearColor=new B(0,0,0,1),h.noPrePassRenderer=!0;for(let u=0;u{e?await Promise.all([o(()=>import("./iblVoxelGrid.fragment-Cyq3RUoc.js"),__vite__mapDeps([11,1,2,3]),import.meta.url),o(()=>import("./iblVoxelGrid.vertex-BzQZ0wJX.js"),__vite__mapDeps([12,1,2,3,13,14,15]),import.meta.url)]):await Promise.all([o(()=>import("./iblVoxelGrid.fragment-Df8sQnC8.js"),__vite__mapDeps([16,1,2,3]),import.meta.url),o(()=>import("./iblVoxelGrid.vertex-s6WDBOtU.js"),__vite__mapDeps([17,1,2,3,18,19,20]),import.meta.url)])}}),this._voxelMaterial.cullBackFaces=!1,this._voxelMaterial.backFaceCulling=!1,this._voxelMaterial.depthFunction=D.ALWAYS,this._voxelSlabDebugMaterial=new A("voxelSlabDebug",this._scene,"iblVoxelSlabDebug",{uniforms:["world","viewMatrix","cameraViewMatrix","projection","invWorldScale","nearPlane","farPlane","stepSize"],defines:["MAX_DRAW_BUFFERS "+this._maxDrawBuffers],shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await Promise.all([o(()=>import("./iblVoxelSlabDebug.fragment-MJ7dKEzp.js"),__vite__mapDeps([21,1,2,3]),import.meta.url),o(()=>import("./iblVoxelSlabDebug.vertex--Wmx0qoC.js"),__vite__mapDeps([22,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./iblVoxelSlabDebug.fragment-BSQWr77T.js"),__vite__mapDeps([23,1,2,3]),import.meta.url),o(()=>import("./iblVoxelSlabDebug.vertex-C61IsPYN.js"),__vite__mapDeps([24,1,2,3]),import.meta.url)])}})}_setDebugBindings(){this._voxelSlabDebugMaterial.setMatrix("projection",this._scene.activeCamera.getProjectionMatrix()),this._voxelSlabDebugMaterial.setMatrix("cameraViewMatrix",this._scene.activeCamera.getViewMatrix())}isReady(){let e=this.getVoxelGrid().isReady();for(let t=0;ts===e[0]);if(t>=0)this._renderTargets.splice(t,e.length);else{const s=this._scene.customRenderTargets.findIndex(i=>i===e[0]);s>=0&&this._scene.customRenderTargets.splice(s,e.length)}}updateVoxelGrid(e){this._voxelizationInProgress||(this._stopVoxelization(),this._includedMeshes=e,this._voxelizationInProgress=!0,this._engine.isWebGPU?(this._voxelGridRT.renderList=e,this._addRTsForRender([this._voxelGridRT],e,0)):this._triPlanarVoxelization?(this._addRTsForRender(this._voxelMrtsXaxis,e,0),this._addRTsForRender(this._voxelMrtsYaxis,e,1),this._addRTsForRender(this._voxelMrtsZaxis,e,2)):this._addRTsForRender(this._voxelMrtsZaxis,e,2),this._voxelDebugEnabled&&this._addRTsForRender([this._voxelSlabDebugRT],e,this._voxelDebugAxis,1,!0),this._renderVoxelGridBound=this._renderVoxelGrid.bind(this),this._scene.onAfterRenderObservable.add(this._renderVoxelGridBound))}_renderVoxelGrid(){if(this._voxelizationInProgress){let e=this.getVoxelGrid().isReady();for(let t=0;t{this._copyMipMaps(),this._scene.onAfterRenderObservable.removeCallback(this._renderVoxelGridBound),this._voxelizationInProgress=!1,this.onVoxelizationCompleteObservable.notifyObservers()})}}}_addRTsForRender(e,t,s,i=0,n=!1){const a=1/this._computeNumberOfSlabs();let r;i===0?r=this._voxelMaterial:r=this._voxelSlabDebugMaterial;for(let l=0;l{r.setMatrix("viewMatrix",b.LookAtLH(z,E,O)),r.setMatrix("invWorldScale",this._invWorldScaleMatrix),r.setFloat("nearPlane",u),r.setFloat("farPlane",m),r.setFloat("stepSize",G),this._engine.isWebGPU&&(this._voxelMaterial.useVertexPulling=!0,this._voxelMaterial.setTexture("voxel_storage",this.getVoxelGrid()))}),t.length===0)return;for(const v of t)if(v){v.subMeshes&&v.subMeshes.length>0&&(h.renderList?.push(v),h.setMaterialForRendering(v,r));const W=v.getChildMeshes();for(const S of W)S.subMeshes&&S.subMeshes.length>0&&(h.renderList?.push(S),h.setMaterialForRendering(S,r))}}if(n)for(const l of e)this._scene.customRenderTargets.indexOf(l)===-1&&this._scene.customRenderTargets.push(l);else this._renderTargets=this._renderTargets.concat(e)}resize(){this._voxelSlabDebugRT?.resize({width:this._scene.getEngine().getRenderWidth(),height:this._scene.getEngine().getRenderHeight()})}dispose(){this._disposeVoxelTextures(),this._voxelSlabDebugRT&&(this._removeVoxelRTs([this._voxelSlabDebugRT]),this._voxelSlabDebugRT.dispose()),this._voxelDebugPass&&this._voxelDebugPass.dispose()}}class ${get voxelShadowOpacity(){return this._voxelShadowOpacity}set voxelShadowOpacity(e){this._voxelShadowOpacity=e}get ssShadowOpacity(){return this._ssShadowOpacity}set ssShadowOpacity(e){this._ssShadowOpacity=e}get sssSamples(){return this._sssSamples}set sssSamples(e){this._sssSamples=e}get sssStride(){return this._sssStride}set sssStride(e){this._sssStride=e}get sssMaxDist(){return this._sssMaxDist}set sssMaxDist(e){this._sssMaxDist=e}get sssThickness(){return this._sssThickness}set sssThickness(e){this._sssThickness=e}get voxelNormalBias(){return this._voxelNormalBias}set voxelNormalBias(e){this._voxelNormalBias=e}get voxelDirectionBias(){return this._voxelDirectionBias}set voxelDirectionBias(e){this._voxelDirectionBias=e}get sampleDirections(){return this._sampleDirections}set sampleDirections(e){this._sampleDirections=e}get envRotation(){return this._envRotation}set envRotation(e){this._envRotation=e}getOutputTexture(){return this._outputTexture}getDebugPassPP(){return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){return this._debugPassName}setWorldScaleMatrix(e){this._invWorldScaleMatrix=e}set coloredShadows(e){this._coloredShadows=e}get coloredShadows(){return this._coloredShadows}setDebugDisplayParams(e,t,s,i){this._debugSizeParams.set(e,t,s,i)}_createDebugPass(){const e=this._engine.isWebGPU;if(!this._debugPassPP){const t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!0,shaderLanguage:e?1:0,extraInitializations:(s,i)=>{s?i.push(o(()=>import("./iblShadowDebug.fragment-xXEFreX4.js"),__vite__mapDeps([25,1,2,3]),import.meta.url)):i.push(o(()=>import("./iblShadowDebug.fragment-BP-W9a1z.js"),__vite__mapDeps([26,1,2,3]),import.meta.url))}};this._debugPassPP=new w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(s=>{s.setTexture("debugSampler",this._outputTexture),s.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){this._voxelShadowOpacity=1,this._sssSamples=16,this._sssStride=8,this._sssMaxDist=.05,this._sssThickness=.5,this._ssShadowOpacity=1,this._cameraInvView=b.Identity(),this._cameraInvProj=b.Identity(),this._invWorldScaleMatrix=b.Identity(),this._frameId=0,this._sampleDirections=4,this._shadowParameters=new f(0,0,0,0),this._sssParameters=new f(0,0,0,0),this._opacityParameters=new f(0,0,0,0),this._voxelBiasParameters=new f(0,0,0,0),this._voxelNormalBias=1.4,this._voxelDirectionBias=1.75,this.enabled=!0,this.debugEnabled=!1,this._debugPassName="Voxel Tracing Debug Pass",this._envRotation=0,this._coloredShadows=!1,this._debugVoxelMarchEnabled=!1,this._debugSizeParams=new f(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){const e=this._createDefines(),t=this._engine.isWebGPU,s={type:0,format:5,samplingMode:1,generateDepthBuffer:!1,shaderLanguage:t?1:0,extraInitializationsAsync:async()=>{t?await Promise.all([o(()=>import("./iblShadowVoxelTracing.fragment-Dwywarfr.js"),__vite__mapDeps([27,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./iblShadowVoxelTracing.fragment-BUnFIr20.js"),__vite__mapDeps([28,1,2,3]),import.meta.url)])}};this._outputTexture=new P("voxelTracingPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowVoxelTracing",this._scene,s),this._outputTexture.refreshRate=-1,this._outputTexture.autoClear=!1,this._outputTexture.defines=e,this._setBindings(this._scene.activeCamera),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)})}_createDefines(){let e="";return this._scene.useRightHandedSystem&&(e+=`#define RIGHT_HANDED -`),this._debugVoxelMarchEnabled&&(e+=`#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u -`),this._coloredShadows&&(e+=`#define COLOR_SHADOWS 1u -`),e}_setBindings(e){this._outputTexture.defines=this._createDefines(),this._outputTexture.setMatrix("viewMtx",e.getViewMatrix()),this._outputTexture.setMatrix("projMtx",e.getProjectionMatrix()),e.getProjectionMatrix().invertToRef(this._cameraInvProj),e.getViewMatrix().invertToRef(this._cameraInvView),this._outputTexture.setMatrix("invProjMtx",this._cameraInvProj),this._outputTexture.setMatrix("invViewMtx",this._cameraInvView),this._outputTexture.setMatrix("wsNormalizationMtx",this._invWorldScaleMatrix),this._frameId++;let t=0;this._scene.environmentTexture&&(t=this._scene.environmentTexture.rotationY??0),t=this._scene.useRightHandedSystem?-(t+.5*Math.PI):t-.5*Math.PI,t=t%(2*Math.PI),this._shadowParameters.set(this._sampleDirections,this._frameId,1,t),this._outputTexture.setVector4("shadowParameters",this._shadowParameters);const s=this._renderPipeline._getVoxelGridTexture(),i=Math.floor(Math.log2(s.getSize().width));this._voxelBiasParameters.set(this._voxelNormalBias,this._voxelDirectionBias,i,0),this._outputTexture.setVector4("voxelBiasParameters",this._voxelBiasParameters),this._sssParameters.set(this._sssSamples,this._sssStride,this._sssMaxDist,this._sssThickness),this._outputTexture.setVector4("sssParameters",this._sssParameters),this._opacityParameters.set(this._voxelShadowOpacity,this._ssShadowOpacity,0,0),this._outputTexture.setVector4("shadowOpacity",this._opacityParameters),this._outputTexture.setTexture("voxelGridSampler",s),this._outputTexture.setTexture("blueNoiseSampler",this._renderPipeline._getNoiseTexture());const n=this._scene.iblCdfGenerator;if(!n)return _.Warn("IBLShadowsVoxelTracingPass: Can't bind for render because iblCdfGenerator is not enabled."),!1;this._outputTexture.setTexture("icdfSampler",n.getIcdfTexture()),this._coloredShadows&&this._scene.environmentTexture&&this._outputTexture.setTexture("iblSampler",this._scene.environmentTexture);const a=this._scene.geometryBufferRenderer;if(!a)return _.Warn("IBLShadowsVoxelTracingPass: Can't bind for render because GeometryBufferRenderer is not enabled."),!1;const r=a.getTextureIndex(d.SCREENSPACE_DEPTH_TEXTURE_TYPE);this._outputTexture.setTexture("depthSampler",a.getGBuffer().textures[r]);const l=a.getTextureIndex(d.NORMAL_TEXTURE_TYPE);return this._outputTexture.setTexture("worldNormalSampler",a.getGBuffer().textures[l]),!0}_render(){this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setBindings(this._scene.activeCamera)&&this._outputTexture.render()}resize(e=1){const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||this._outputTexture.resize(t,!1)}isReady(){return this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())&&this._scene.iblCdfGenerator&&this._scene.iblCdfGenerator.getIcdfTexture().isReady()&&this._renderPipeline._getVoxelGridTexture().isReady()}dispose(){this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady&&this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady),this._outputTexture.dispose(),this._debugPassPP&&this._debugPassPP.dispose()}}class ee{getOutputTexture(){return this._outputTexture}getDebugPassPP(){return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){return this._debugPassName}setWorldScale(e){this._worldScale=e}setDebugDisplayParams(e,t,s,i){this._debugSizeParams.set(e,t,s,i)}_createDebugPass(){if(!this._debugPassPP){const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(s,i)=>{s?i.push(o(()=>import("./iblShadowDebug.fragment-xXEFreX4.js"),__vite__mapDeps([25,1,2,3]),import.meta.url)):i.push(o(()=>import("./iblShadowDebug.fragment-BP-W9a1z.js"),__vite__mapDeps([26,1,2,3]),import.meta.url))}};this._debugPassPP=new w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(s=>{s.setTexture("debugSampler",this._outputTexture),s.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){this._worldScale=1,this._blurParameters=new f(0,0,0,0),this.enabled=!0,this._debugPassName="Spatial Blur Debug Pass",this.debugEnabled=!1,this._debugSizeParams=new f(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){const e=this._engine.isWebGPU,t={type:0,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await Promise.all([o(()=>import("./iblShadowSpatialBlur.fragment-DCYuT3v7.js"),__vite__mapDeps([29,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./iblShadowSpatialBlur.fragment-AqpRDHpH.js"),__vite__mapDeps([30,1,2,3]),import.meta.url)])}};this._outputTexture=new P("spatialBlurPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowSpatialBlur",this._scene,t,!1,!1,0),this._outputTexture.refreshRate=-1,this._outputTexture.autoClear=!1,this._setBindings(),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)})}_setBindings(){this._outputTexture.setTexture("voxelTracingSampler",this._renderPipeline._getVoxelTracingTexture()),this._blurParameters.set(1,this._worldScale,0,0),this._outputTexture.setVector4("blurParameters",this._blurParameters);const t=this._scene.geometryBufferRenderer;if(!t)return!1;const s=t.getTextureIndex(d.SCREENSPACE_DEPTH_TEXTURE_TYPE);this._outputTexture.setTexture("depthSampler",t.getGBuffer().textures[s]);const i=t.getTextureIndex(d.NORMAL_TEXTURE_TYPE);return this._outputTexture.setTexture("worldNormalSampler",t.getGBuffer().textures[i]),!0}_render(){this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setBindings()&&this._outputTexture.render()}resize(e=1){const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||this._outputTexture.resize(t,!1)}isReady(){return this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())}dispose(){this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady&&this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady),this._outputTexture.dispose(),this._debugPassPP&&this._debugPassPP.dispose()}}class te{getOutputTexture(){return this._outputTexture}getDebugPassPP(){return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){return this._debugPassName}get remanence(){return this._remanence}set remanence(e){this._remanence=e}get reset(){return this._reset}set reset(e){this._reset=e}set isMoving(e){this._isMoving=e}setDebugDisplayParams(e,t,s,i){this._debugSizeParams.set(e,t,s,i)}_createDebugPass(){if(!this._debugPassPP){const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(s,i)=>{s?i.push(o(()=>import("./iblShadowDebug.fragment-xXEFreX4.js"),__vite__mapDeps([25,1,2,3]),import.meta.url)):i.push(o(()=>import("./iblShadowDebug.fragment-BP-W9a1z.js"),__vite__mapDeps([26,1,2,3]),import.meta.url))}};this._debugPassPP=new w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(s=>{s.setTexture("debugSampler",this._outputTexture),s.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){this._accumulationParams=new f(0,0,0,0),this.debugEnabled=!1,this.enabled=!0,this.onReadyObservable=new R,this._debugPassName="Shadow Accumulation Debug Pass",this._remanence=.9,this._reset=!0,this._isMoving=!1,this._debugSizeParams=new f(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){const e=this._engine.isWebGPU,t={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await Promise.all([o(()=>import("./iblShadowAccumulation.fragment-CZ1A4Oy_.js"),__vite__mapDeps([31,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./iblShadowAccumulation.fragment-BTOxV-El.js"),__vite__mapDeps([32,1,2,3]),import.meta.url)])}};this._outputTexture=new P("shadowAccumulationPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowAccumulation",this._scene,t),this._outputTexture.refreshRate=1,this._outputTexture.autoClear=!1,this._outputTexture.onGeneratedObservable.addOnce(()=>{this.onReadyObservable.notifyObservers()}),this._setOutputTextureBindings(),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)});const s={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await Promise.all([o(()=>import("./pass.fragment-I5Wdwpz1.js"),__vite__mapDeps([33,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./pass.fragment-nyUGT5FF.js"),__vite__mapDeps([34,1,2,3]),import.meta.url)])}};this._oldAccumulationCopy=new P("oldAccumulationRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"pass",this._scene,s,!1),this._oldAccumulationCopy.autoClear=!1,this._oldAccumulationCopy.refreshRate=1,this._oldAccumulationCopy.onBeforeGenerationObservable.add(this._setAccumulationCopyBindings.bind(this)),this._setAccumulationCopyBindings();const i={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{e?await Promise.all([o(()=>import("./pass.fragment-I5Wdwpz1.js"),__vite__mapDeps([33,1,2,3]),import.meta.url)]):await Promise.all([o(()=>import("./pass.fragment-nyUGT5FF.js"),__vite__mapDeps([34,1,2,3]),import.meta.url)])}};this._oldPositionCopy=new P("oldLocalPositionRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"pass",this._scene,i,!1),this._updatePositionCopy(),this._oldPositionCopy.autoClear=!1,this._oldPositionCopy.refreshRate=1,this._oldPositionCopy.onBeforeGenerationObservable.add(this._updatePositionCopy.bind(this))}_setOutputTextureBindings(){const e=this._isMoving?this.remanence:.99;this._accumulationParams.set(e,this.reset?1:0,this._renderPipeline.voxelGridSize,0),this._outputTexture.setTexture("spatialBlurSampler",this._renderPipeline._getSpatialBlurTexture()),this._outputTexture.setVector4("accumulationParameters",this._accumulationParams),this._outputTexture.setTexture("oldAccumulationSampler",this._oldAccumulationCopy?this._oldAccumulationCopy:this._renderPipeline._dummyTexture2d),this._outputTexture.setTexture("prevPositionSampler",this._oldPositionCopy?this._oldPositionCopy:this._renderPipeline._dummyTexture2d);const t=this._scene.geometryBufferRenderer;if(!t)return!1;const s=t.getTextureIndex(d.VELOCITY_LINEAR_TEXTURE_TYPE);this._outputTexture.setTexture("motionSampler",t.getGBuffer().textures[s]);const i=t.getTextureIndex(d.POSITION_TEXTURE_TYPE);return this._outputTexture.setTexture("positionSampler",t.getGBuffer().textures[i]),this.reset=!1,this._isMoving=!1,!0}_updatePositionCopy(){const e=this._scene.geometryBufferRenderer,t=e.getTextureIndex(d.POSITION_TEXTURE_TYPE);this._oldPositionCopy.setTexture("textureSampler",e.getGBuffer().textures[t])}_setAccumulationCopyBindings(){this._oldAccumulationCopy.setTexture("textureSampler",this._outputTexture)}_render(){this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setOutputTextureBindings()&&this._outputTexture.render()}resize(e=1){const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||(this._outputTexture.resize(t,!1),this._oldAccumulationCopy.resize(t,!1),this._oldPositionCopy.resize({width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},!1),this.reset=!0)}_disposeTextures(){this._oldAccumulationCopy.dispose(),this._oldPositionCopy.dispose(),this._outputTexture.dispose()}isReady(){return this._oldAccumulationCopy&&this._oldAccumulationCopy.isReady()&&this._oldPositionCopy&&this._oldPositionCopy.isReady()&&this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())}dispose(){this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady&&this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady),this._disposeTextures(),this._debugPassPP&&this._debugPassPP.dispose(),this.onReadyObservable.clear()}}class se extends x{get width(){return this._texture?this._texture.width:0}get height(){return this._texture?this._texture.height:0}get depth(){return this._texture?this._texture.depth:0}constructor(e,t,s,i,n,a,r=!0,l=!1,h=x.TRILINEAR_SAMPLINGMODE,u=0,m){super(null,a,!r,l),this.format=n,this._texture=a.getEngine().createRawTexture3D(e,t,s,i,n,r,l,h,null,u,m),this.is3D=!0}update(e){this._texture&&this._getEngine().updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)}}class ie extends H{constructor(){super(...arguments),this.RENDER_WITH_IBL_SHADOWS=!1,this.COLORED_IBL_SHADOWS=!1}}class c extends U{get isColored(){return this._isColored}set isColored(e){this._isColored!==e&&(this._isColored=e,this._markAllSubMeshesAsTexturesDirty())}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e){super(e,c.Name,310,new ie),this.shadowOpacity=1,this._isEnabled=!1,this._isColored=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}prepareDefines(e){e.RENDER_WITH_IBL_SHADOWS=this._isEnabled,e.COLORED_IBL_SHADOWS=this.isColored}getClassName(){return"IBLShadowsPluginMaterial"}getUniforms(){return{ubo:[{name:"renderTargetSize",size:2,type:"vec2"},{name:"shadowOpacity",size:1,type:"float"}],fragment:`#ifdef RENDER_WITH_IBL_SHADOWS - uniform vec2 renderTargetSize; - uniform float shadowOpacity; - #endif`}}getSamplers(e){e.push("iblShadowsTexture")}bindForSubMesh(e){this._isEnabled&&(e.bindTexture("iblShadowsTexture",this.iblShadowsTexture),e.updateFloat2("renderTargetSize",this._material.getScene().getEngine().getRenderWidth(),this._material.getScene().getEngine().getRenderHeight()),e.updateFloat("shadowOpacity",this.shadowOpacity))}getCustomCode(e,t){let s;return t===1?(s={CUSTOM_FRAGMENT_DEFINITIONS:` - #ifdef RENDER_WITH_IBL_SHADOWS - var iblShadowsTextureSampler: sampler; - var iblShadowsTexture: texture_2d; - - #ifdef COLORED_IBL_SHADOWS - fn computeIndirectShadow() -> vec3f { - var uv = fragmentInputs.position.xy / uniforms.renderTargetSize; - var shadowValue: vec3f = textureSample(iblShadowsTexture, iblShadowsTextureSampler, uv).rgb; - return mix(shadowValue, vec3f(1.0), 1.0 - uniforms.shadowOpacity); - } - #else - fn computeIndirectShadow() -> vec2f { - var uv = fragmentInputs.position.xy / uniforms.renderTargetSize; - var shadowValue: vec2f = textureSample(iblShadowsTexture, iblShadowsTextureSampler, uv).rg; - return mix(shadowValue, vec2f(1.0), 1.0 - uniforms.shadowOpacity); - } - #endif - #endif - `},this._material instanceof y?s.CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifndef UNLIT - #ifdef REFLECTION - #ifdef COLORED_IBL_SHADOWS - var shadowValue: vec3f = computeIndirectShadow(); - finalIrradiance *= shadowValue; - finalRadianceScaled *= mix(vec3f(1.0), shadowValue, roughness); - #else - var shadowValue: vec2f = computeIndirectShadow(); - finalIrradiance *= vec3f(shadowValue.x); - finalRadianceScaled *= vec3f(mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness)); - #endif - #endif - #else - finalDiffuse *= computeIndirectShadow().x; - #endif - #endif - `:this._material instanceof M?s.CUSTOM_FRAGMENT_BEFORE_IBLLAYERCOMPOSITION=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifndef UNLIT - #ifdef REFLECTION - #ifdef COLORED_IBL_SHADOWS - var shadowValue: vec3f = computeIndirectShadow(); - slab_diffuse_ibl *= shadowValue; - slab_glossy_ibl *= mix(vec3f(1.0), shadowValue, specularAlphaG); - #else - var shadowValue: vec2f = computeIndirectShadow(); - slab_diffuse_ibl *= vec3f(shadowValue.x); - slab_glossy_ibl *= vec3f(mix(pow(shadowValue.y, 4.0), shadowValue.x, specularAlphaG)); - #endif - #endif - #else - slab_diffuse_ibl *= computeIndirectShadow().x; - #endif - #endif - `:s.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifdef COLORED_IBL_SHADOWS - var shadowValue: vec3f = computeIndirectShadow(); - color *= toGammaSpace(vec4f(shadowValue, 1.0f)); - #else - var shadowValue: vec2f = computeIndirectShadow(); - color *= toGammaSpace(vec4f(shadowValue.x, shadowValue.x, shadowValue.x, 1.0f)); - #endif - #endif - `):(s={CUSTOM_FRAGMENT_DEFINITIONS:` - #ifdef RENDER_WITH_IBL_SHADOWS - uniform sampler2D iblShadowsTexture; - #ifdef COLORED_IBL_SHADOWS - vec3 computeIndirectShadow() { - vec2 uv = gl_FragCoord.xy / renderTargetSize; - vec3 shadowValue = texture2D(iblShadowsTexture, uv).rgb; - return mix(shadowValue.rgb, vec3(1.0), 1.0 - shadowOpacity); - } - #else - vec2 computeIndirectShadow() { - vec2 uv = gl_FragCoord.xy / renderTargetSize; - vec2 shadowValue = texture2D(iblShadowsTexture, uv).rg; - return mix(shadowValue.rg, vec2(1.0), 1.0 - shadowOpacity); - } - #endif - #endif - `},this._material instanceof y?s.CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifndef UNLIT - #ifdef REFLECTION - #ifdef COLORED_IBL_SHADOWS - vec3 shadowValue = computeIndirectShadow(); - finalIrradiance.rgb *= shadowValue.rgb; - finalRadianceScaled *= mix(vec3(1.0), shadowValue.rgb, roughness); - #else - vec2 shadowValue = computeIndirectShadow(); - finalIrradiance *= shadowValue.x; - finalRadianceScaled *= mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness); - #endif - #endif - #else - finalDiffuse *= computeIndirectShadow().x; - #endif - #endif - `:this._material instanceof M?s.CUSTOM_FRAGMENT_BEFORE_IBLLAYERCOMPOSITION=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifndef UNLIT - #ifdef REFLECTION - #ifdef COLORED_IBL_SHADOWS - vec3 shadowValue = computeIndirectShadow(); - slab_diffuse_ibl.rgb *= shadowValue.rgb; - slab_glossy_ibl *= mix(vec3(1.0), shadowValue.rgb, specularAlphaG); - #else - vec2 shadowValue = computeIndirectShadow(); - slab_diffuse_ibl *= shadowValue.x; - slab_glossy_ibl *= mix(pow(shadowValue.y, 4.0), shadowValue.x, specularAlphaG); - #endif - #endif - #else - slab_diffuse_ibl *= computeIndirectShadow().x; - #endif - #endif - `:s.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR=` - #ifdef RENDER_WITH_IBL_SHADOWS - #ifdef COLORED_IBL_SHADOWS - vec3 shadowValue = computeIndirectShadow(); - color.rgb *= toGammaSpace(shadowValue.rgb); - #else - vec2 shadowValue = computeIndirectShadow(); - color.rgb *= toGammaSpace(shadowValue.x); - #endif - #endif - `),e==="vertex"?null:s}}c.Name="IBLShadowsPluginMaterial";V([C()],c.prototype,"shadowOpacity",void 0);V([C(),X("_markAllSubMeshesAsTexturesDirty")],c.prototype,"isEnabled",void 0);Y("BABYLON.IBLShadowsPluginMaterial",c);class we extends j{resetAccumulation(){this._accumulationPass.reset=!0}get shadowOpacity(){return this._shadowOpacity}set shadowOpacity(e){this._shadowOpacity=e,this._setPluginParameters()}get coloredShadows(){return this._coloredShadows}set coloredShadows(e){this._coloredShadows=e,this._voxelTracingPass.coloredShadows=e,this._setPluginParameters()}get shadowRenderSizeFactor(){return this._renderSizeFactor}set shadowRenderSizeFactor(e){this._renderSizeFactor=Math.max(Math.min(e,1),0),this._voxelTracingPass.resize(e),this._spatialBlurPass.resize(e),this._accumulationPass.resize(e),this._setPluginParameters()}get voxelShadowOpacity(){return this._voxelTracingPass?.voxelShadowOpacity}set voxelShadowOpacity(e){this._voxelTracingPass&&(this._voxelTracingPass.voxelShadowOpacity=e)}get ssShadowOpacity(){return this._voxelTracingPass?.ssShadowOpacity}set ssShadowOpacity(e){this._voxelTracingPass&&(this._voxelTracingPass.ssShadowOpacity=e)}get ssShadowSampleCount(){return this._voxelTracingPass?.sssSamples}set ssShadowSampleCount(e){this._voxelTracingPass&&(this._voxelTracingPass.sssSamples=e)}get ssShadowStride(){return this._voxelTracingPass?.sssStride}set ssShadowStride(e){this._voxelTracingPass&&(this._voxelTracingPass.sssStride=e)}get ssShadowDistanceScale(){return this._sssMaxDistScale}set ssShadowDistanceScale(e){this._sssMaxDistScale=e,this._updateSsShadowParams()}get ssShadowThicknessScale(){return this._sssThicknessScale}set ssShadowThicknessScale(e){this._sssThicknessScale=e,this._updateSsShadowParams()}_getVoxelGridTexture(){const e=this._voxelRenderer?.getVoxelGrid();return e&&e.isReady()?e:this._dummyTexture3d}_getNoiseTexture(){const e=this._noiseTexture;return e&&e.isReady()?e:this._dummyTexture2d}_getVoxelTracingTexture(){const e=this._voxelTracingPass?.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}_getSpatialBlurTexture(){const e=this._spatialBlurPass.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}_getAccumulatedTexture(){const e=this._accumulationPass?.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}get gbufferDebugEnabled(){return this._gbufferDebugEnabled}set gbufferDebugEnabled(e){if(e&&!this.allowDebugPasses){_.Warn("Can't enable G-Buffer debug view without setting allowDebugPasses to true.");return}this._gbufferDebugEnabled=e,e?this._enableEffect(this._getGBufferDebugPass().name,this.cameras):this._disableEffect(this._getGBufferDebugPass().name,this.cameras)}get cdfDebugEnabled(){return this.scene.iblCdfGenerator?this.scene.iblCdfGenerator.debugEnabled:!1}set cdfDebugEnabled(e){if(this.scene.iblCdfGenerator){if(e&&!this.allowDebugPasses){_.Warn("Can't enable importance sampling debug view without setting allowDebugPasses to true.");return}e!==this.scene.iblCdfGenerator.debugEnabled&&(this.scene.iblCdfGenerator.debugEnabled=e,e?this._enableEffect(this.scene.iblCdfGenerator.debugPassName,this.cameras):this._disableEffect(this.scene.iblCdfGenerator.debugPassName,this.cameras))}}get voxelDebugEnabled(){return this._voxelRenderer?.voxelDebugEnabled}set voxelDebugEnabled(e){if(this._voxelRenderer){if(e&&!this.allowDebugPasses){_.Warn("Can't enable voxel debug view without setting allowDebugPasses to true.");return}this._voxelRenderer.voxelDebugEnabled=e,e?this._enableEffect(this._voxelRenderer.debugPassName,this.cameras):this._disableEffect(this._voxelRenderer.debugPassName,this.cameras)}}get voxelDebugAxis(){return this._voxelRenderer?.voxelDebugAxis}set voxelDebugAxis(e){this._voxelRenderer&&(this._voxelRenderer.voxelDebugAxis=e)}set voxelDebugDisplayMip(e){this._voxelRenderer&&this._voxelRenderer.setDebugMipNumber(e)}get voxelTracingDebugEnabled(){return this._voxelTracingPass?.debugEnabled}set voxelTracingDebugEnabled(e){if(this._voxelTracingPass){if(e&&!this.allowDebugPasses){_.Warn("Can't enable voxel tracing debug view without setting allowDebugPasses to true.");return}e!==this._voxelTracingPass.debugEnabled&&(this._voxelTracingPass.debugEnabled=e,e?this._enableEffect(this._voxelTracingPass.debugPassName,this.cameras):this._disableEffect(this._voxelTracingPass.debugPassName,this.cameras))}}get spatialBlurPassDebugEnabled(){return this._spatialBlurPass.debugEnabled}set spatialBlurPassDebugEnabled(e){if(this._spatialBlurPass){if(e&&!this.allowDebugPasses){_.Warn("Can't enable spatial blur debug view without setting allowDebugPasses to true.");return}e!==this._spatialBlurPass.debugEnabled&&(this._spatialBlurPass.debugEnabled=e,e?this._enableEffect(this._spatialBlurPass.debugPassName,this.cameras):this._disableEffect(this._spatialBlurPass.debugPassName,this.cameras))}}get accumulationPassDebugEnabled(){return this._accumulationPass?.debugEnabled}set accumulationPassDebugEnabled(e){if(this._accumulationPass){if(e&&!this.allowDebugPasses){_.Warn("Can't enable accumulation pass debug view without setting allowDebugPasses to true.");return}e!==this._accumulationPass.debugEnabled&&(this._accumulationPass.debugEnabled=e,e?this._enableEffect(this._accumulationPass.debugPassName,this.cameras):this._disableEffect(this._accumulationPass.debugPassName,this.cameras))}}addShadowCastingMesh(e){if(Array.isArray(e))for(const t of e)t&&this._shadowCastingMeshes.indexOf(t)===-1&&this._shadowCastingMeshes.push(t);else e&&this._shadowCastingMeshes.indexOf(e)===-1&&this._shadowCastingMeshes.push(e)}removeShadowCastingMesh(e){if(Array.isArray(e))for(const t of e){const s=this._shadowCastingMeshes.indexOf(t);s!==-1&&this._shadowCastingMeshes.splice(s,1)}else{const t=this._shadowCastingMeshes.indexOf(e);t!==-1&&this._shadowCastingMeshes.splice(t,1)}}clearShadowCastingMeshes(){this._shadowCastingMeshes.length=0}get resolutionExp(){return this._voxelRenderer.voxelResolutionExp}set resolutionExp(e){if(e!==this._voxelRenderer.voxelResolutionExp){if(this._voxelRenderer.isVoxelizationInProgress()){_.Warn("Can't change the resolution of the voxel grid while voxelization is in progress.");return}this._voxelRenderer.voxelResolutionExp=Math.max(1,Math.min(e,8)),this._accumulationPass.reset=!0}}get sampleDirections(){return this._voxelTracingPass?.sampleDirections}set sampleDirections(e){this._voxelTracingPass&&(this._voxelTracingPass.sampleDirections=e)}get shadowRemanence(){return this._accumulationPass?.remanence}set shadowRemanence(e){this._accumulationPass&&(this._accumulationPass.remanence=e)}get envRotation(){return this._voxelTracingPass?.envRotation}set envRotation(e){this._voxelTracingPass&&(this._voxelTracingPass.envRotation=e,this._accumulationPass.reset=!0)}get allowDebugPasses(){return this._allowDebugPasses}set allowDebugPasses(e){this._allowDebugPasses!==e&&(this._allowDebugPasses=e,e&&this.scene.iblCdfGenerator?this.scene.iblCdfGenerator.isReady()?this._createDebugPasses():this.scene.iblCdfGenerator.onGeneratedObservable.addOnce(()=>{this._createDebugPasses()}):this._disposeDebugPasses())}static get IsSupported(){const e=k.LastCreatedEngine;return e?e._features.supportIBLShadows:!1}toggleShadow(e){this._enabled=e,this._voxelTracingPass.enabled=e,this._spatialBlurPass.enabled=e,this._accumulationPass.enabled=e;for(const t of this._materialsWithRenderPlugin)if(t.pluginManager){const s=t.pluginManager.getPlugin(c.Name);s.isEnabled=e}this._setPluginParameters()}updateVoxelization(){if(this._shadowCastingMeshes.length===0){_.Warn("IBL Shadows: updateVoxelization called with no shadow-casting meshes to voxelize.");return}this._voxelRenderer.updateVoxelGrid(this._shadowCastingMeshes),this._voxelRenderer.onVoxelizationCompleteObservable.addOnce(()=>{this.onVoxelizationCompleteObservable.notifyObservers()}),this._updateSsShadowParams()}updateSceneBounds(){const e={min:new g(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),max:new g(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)};for(const r of this._shadowCastingMeshes){const l=r.getHierarchyBoundingVectors(!0);e.min=g.Minimize(e.min,l.min),e.max=g.Maximize(e.max,l.max)}const t=e.max.subtract(e.min);if(this.voxelGridSize=Math.max(t.x,t.y,t.z),this._shadowCastingMeshes.length===0||!isFinite(this.voxelGridSize)||this.voxelGridSize===0){_.Warn("IBL Shadows: Scene size is invalid. Can't update bounds."),this.voxelGridSize=1;return}const s=this.voxelGridSize/2,i=e.max.add(e.min).multiplyByFloats(-.5,-.5,-.5),n=b.Compose(new g(1/s,1/s,1/s),new I,new g(0,0,0));b.Compose(new g(1,1,1),new I,i).multiplyToRef(n,n),this._voxelTracingPass.setWorldScaleMatrix(n),this._voxelRenderer.setWorldScaleMatrix(n),this._spatialBlurPass.setWorldScale(s*2),this._updateSsShadowParams()}constructor(e,t,s={},i){super(t.getEngine(),e),this._allowDebugPasses=!1,this._debugPasses=[],this._shadowCastingMeshes=[],this._shadowOpacity=.8,this._enabled=!0,this._coloredShadows=!1,this._materialsWithRenderPlugin=[],this.onShadowTextureReadyObservable=new R,this.onNewIblReadyObservable=new R,this.onVoxelizationCompleteObservable=new R,this.voxelGridSize=1,this._renderSizeFactor=1,this._gbufferDebugEnabled=!1,this._gBufferDebugSizeParams=new f(0,0,0,0),this.scene=t,this._cameras=i||[t.activeCamera];const n=new Uint8Array([0,0,0,255]);this._dummyTexture2d=new Q(n,1,1,D.TEXTUREFORMAT_RGBA,t,!1),this._dummyTexture3d=new se(n,1,1,1,D.TEXTUREFORMAT_RGBA,t,!1);const a={};a[d.SCREENSPACE_DEPTH_TEXTURE_TYPE]={textureFormat:6,textureType:1},a[d.VELOCITY_LINEAR_TEXTURE_TYPE]={textureFormat:7,textureType:2},a[d.POSITION_TEXTURE_TYPE]={textureFormat:5,textureType:2},a[d.NORMAL_TEXTURE_TYPE]={textureFormat:5,textureType:2};const r=t.enableGeometryBufferRenderer(void 0,14,a);if(!r){_.Error("Geometry buffer renderer is required for IBL shadows to work.");return}this._geometryBufferRenderer=r,this._geometryBufferRenderer.enableScreenspaceDepth=!0,this._geometryBufferRenderer.enableVelocityLinear=!0,this._geometryBufferRenderer.enablePosition=!0,this._geometryBufferRenderer.enableNormal=!0,this._geometryBufferRenderer.generateNormalsInWorldSpace=!0,this.scene.enableIblCdfGenerator(),this.shadowOpacity=s.shadowOpacity||.8,this._voxelRenderer=new K(this.scene,this,s?s.resolutionExp:6,s.triPlanarVoxelization!==void 0?s.triPlanarVoxelization:!0),this._voxelTracingPass=new $(this.scene,this),this._spatialBlurPass=new ee(this.scene,this),this._accumulationPass=new te(this.scene,this),this._accumulationPass.onReadyObservable.addOnce(()=>{this.onShadowTextureReadyObservable.notifyObservers()}),this.sampleDirections=s.sampleDirections||2,this.voxelShadowOpacity=s.voxelShadowOpacity??1,this.envRotation=s.envRotation??0,this.shadowRenderSizeFactor=s.shadowRenderSizeFactor||1,this.ssShadowOpacity=s.ssShadowsEnabled===void 0||s.ssShadowsEnabled?1:0,this.ssShadowDistanceScale=s.ssShadowDistanceScale||1.25,this.ssShadowSampleCount=s.ssShadowSampleCount||16,this.ssShadowStride=s.ssShadowStride||8,this.ssShadowThicknessScale=s.ssShadowThicknessScale||1,this.shadowRemanence=s.shadowRemanence??.75,this._noiseTexture=new x(Z.GetAssetUrl("https://assets.babylonjs.com/core/blue_noise/blue_noise_rgb.png"),this.scene,!1,!0,1),t.postProcessRenderPipelineManager.addPipeline(this),this.scene.onActiveCameraChanged.add(this._listenForCameraChanges.bind(this)),this.scene.onBeforeRenderObservable.add(this._updateBeforeRender.bind(this)),this._listenForCameraChanges(),this.scene.getEngine().onResizeObservable.add(this._handleResize.bind(this)),this.scene.iblCdfGenerator&&this.scene.iblCdfGenerator.onGeneratedObservable.add(()=>{this._setPluginParameters(),this.onNewIblReadyObservable.notifyObservers()})}_handleResize(){this._voxelRenderer.resize(),this._voxelTracingPass.resize(this.shadowRenderSizeFactor),this._spatialBlurPass.resize(this.shadowRenderSizeFactor),this._accumulationPass.resize(this.shadowRenderSizeFactor),this._setPluginParameters()}_getGBufferDebugPass(){if(this._gbufferDebugPass)return this._gbufferDebugPass;const e=this.engine.isWebGPU,t=["depthSampler","normalSampler","positionSampler","velocitySampler"],s={width:this.scene.getEngine().getRenderWidth(),height:this.scene.getEngine().getRenderHeight(),samplingMode:1,engine:this.scene.getEngine(),textureType:0,textureFormat:5,uniforms:["sizeParams"],samplers:t,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(i,n)=>{i?n.push(o(()=>import("./iblShadowGBufferDebug.fragment-CTpmCBpn.js"),__vite__mapDeps([35,1,2,3]),import.meta.url)):n.push(o(()=>import("./iblShadowGBufferDebug.fragment-B4QmwdVE.js"),__vite__mapDeps([36,1,2,3]),import.meta.url))}};return this._gbufferDebugPass=new w("iblShadowGBufferDebug","iblShadowGBufferDebug",s),this.engine.isWebGPU&&(this._gbufferDebugPass.samples=this.engine.currentSampleCount??1),this._gbufferDebugPass.autoClear=!1,this._gbufferDebugPass.onApplyObservable.add(i=>{const n=this._geometryBufferRenderer.getTextureIndex(d.SCREENSPACE_DEPTH_TEXTURE_TYPE);i.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[n]);const a=this._geometryBufferRenderer.getTextureIndex(d.NORMAL_TEXTURE_TYPE);i.setTexture("normalSampler",this._geometryBufferRenderer.getGBuffer().textures[a]);const r=this._geometryBufferRenderer.getTextureIndex(d.POSITION_TEXTURE_TYPE);i.setTexture("positionSampler",this._geometryBufferRenderer.getGBuffer().textures[r]);const l=this._geometryBufferRenderer.getTextureIndex(d.VELOCITY_LINEAR_TEXTURE_TYPE);i.setTexture("velocitySampler",this._geometryBufferRenderer.getGBuffer().textures[l]),i.setVector4("sizeParams",this._gBufferDebugSizeParams),this.scene.activeCamera&&i.setFloat("maxDepth",this.scene.activeCamera.maxZ)}),this._gbufferDebugPass}_createDebugPasses(){this.scene.iblCdfGenerator?this._debugPasses=[{pass:this.scene.iblCdfGenerator.getDebugPassPP(),enabled:this.cdfDebugEnabled}]:this._debugPasses=[],this._debugPasses.push({pass:this._voxelRenderer.getDebugPassPP(),enabled:this.voxelDebugEnabled},{pass:this._voxelTracingPass.getDebugPassPP(),enabled:this.voxelTracingDebugEnabled},{pass:this._spatialBlurPass.getDebugPassPP(),enabled:this.spatialBlurPassDebugEnabled},{pass:this._accumulationPass.getDebugPassPP(),enabled:this.accumulationPassDebugEnabled},{pass:this._getGBufferDebugPass(),enabled:this.gbufferDebugEnabled});for(let t=0;tthis._debugPasses[t].pass,!0));const e=this.cameras.slice();this.scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this.name,this.cameras),this.scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this.name,e);for(let t=0;t{this._accumulationPass.isMoving=!0})}isReady(){return this._noiseTexture.isReady()&&this._voxelRenderer.isReady()&&this.scene.iblCdfGenerator&&this.scene.iblCdfGenerator.isReady()&&(!this._voxelTracingPass||this._voxelTracingPass.isReady())&&(!this._spatialBlurPass||this._spatialBlurPass.isReady())&&(!this._accumulationPass||this._accumulationPass.isReady())}getClassName(){return"IBLShadowsRenderPipeline"}dispose(){const e=this._materialsWithRenderPlugin.splice(0);for(const t of e)this.removeShadowReceivingMaterial(t);this._disposeEffectPasses(),this._noiseTexture.dispose(),this._voxelRenderer.dispose(),this._voxelTracingPass.dispose(),this._spatialBlurPass.dispose(),this._accumulationPass.dispose(),this._dummyTexture2d.dispose(),this._dummyTexture3d.dispose(),this.onNewIblReadyObservable.clear(),this.onShadowTextureReadyObservable.clear(),this.onVoxelizationCompleteObservable.clear(),super.dispose()}}export{we as IblShadowsRenderPipeline}; diff --git a/assets/iblVoxelGrid.fragment-Cyq3RUoc.js b/assets/iblVoxelGrid.fragment-Cyq3RUoc.js deleted file mode 100644 index 30c7bbccc38f6f7b358f60e0bdcdef2b10eeb24e..0000000000000000000000000000000000000000 --- a/assets/iblVoxelGrid.fragment-Cyq3RUoc.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="iblVoxelGridPixelShader",r=`var voxel_storage: texture_storage_3d;varying vNormalizedPosition: vec3f;flat varying f_swizzle: i32;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var size: vec3f=vec3f(textureDimensions(voxel_storage));var normPos: vec3f=input.vNormalizedPosition.xyz;var outputColor: vec4f=vec4f(0.0,0.0,0.0,1.0);switch (input.f_swizzle) {case 0: {normPos=normPos.zxy; -outputColor=vec4f(1.0,1.0,0.0,1.0);break;} -case 1: {normPos=normPos.yzx;outputColor=vec4f(1.0,1.0,1.0,1.0);break;} -default: {normPos=normPos.xyz;outputColor=vec4f(1.0,1.0,0.0,1.0);break;}} -textureStore(voxel_storage,vec3(i32(normPos.x*size.x),i32(normPos.y*size.y),i32(normPos.z*size.z)),outputColor);fragmentOutputs.color=vec4(vec3(normPos),1.);}`;e.ShadersStoreWGSL[o]||(e.ShadersStoreWGSL[o]=r);const i={name:o,shader:r};export{i as iblVoxelGridPixelShaderWGSL}; diff --git a/assets/iblVoxelGrid.fragment-Df8sQnC8.js b/assets/iblVoxelGrid.fragment-Df8sQnC8.js deleted file mode 100644 index 1ee17d7015da40b0e8bc06858e6331b52bf064e7..0000000000000000000000000000000000000000 --- a/assets/iblVoxelGrid.fragment-Df8sQnC8.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as a}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblVoxelGridPixelShader",o=`precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.zfarPlane) {discard;} -glFragData[0]=normPos.z=nearPlane+stepSize && normPos.z=nearPlane+2.0*stepSize && normPos.z=nearPlane+3.0*stepSize && normPos.z4 -glFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z=nearPlane+5.0*stepSize && normPos.z=nearPlane+6.0*stepSize && normPos.z=nearPlane+7.0*stepSize && normPos.z -#include (attribute matricesIndices : vec4f;,,attribute matricesWeights : vec4f;,,attribute matricesIndicesExtra : vec4f;,,attribute matricesWeightsExtra : vec4f;,) -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef VERTEX_PULLING_USE_INDEX_BUFFER -var indices : array; -#endif -var position : array; -#if NUM_BONE_INFLUENCERS>0 -var matricesIndices : array;var matricesWeights : array;uniform vp_matricesIndices_info: vec3f;uniform vp_matricesWeights_info: vec3f; -#if NUM_BONE_INFLUENCERS>4 -var matricesIndicesExtra : array;var matricesWeightsExtra : array;uniform vp_matricesIndicesExtra_info: vec3f;uniform vp_matricesWeightsExtra_info: vec3f; -#endif -#endif -uniform world : mat4x4f;uniform invWorldScale: mat4x4f;varying vNormalizedPosition : vec3f;flat varying f_swizzle: i32;uniform vp_position_info: vec3f; -fn convertToFloat(word: u32,byteInWord: u32,dataType: u32)->f32 {switch (dataType) {case 5120u: { -let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;return f32(i32(value<<24u)>>24u)/127.0; } -case 5121u: { -let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;return f32(value)/255.0;} -case 5122u: { -let shift=(byteInWord & 0xFFFFFFFEu)*8u; -let value=(word>>shift) & 0xFFFFu;return f32(i32(value<<16u)>>16u);} -case 5123u: { -let shift=(byteInWord & 0xFFFFFFFEu)*8u; -let value=(word>>shift) & 0xFFFFu;return f32(value);} -case 5126u: { -return bitcast(word);} -default: {return 0.0;}}} -fn readPositionValue(byteOffset: u32,dataType: u32)->f32 {let wordOffset=byteOffset/4u;let byteInWord=byteOffset % 4u;let word: u32=bitcast(position[wordOffset]);return convertToFloat(word,byteInWord,dataType);} -fn readVertexPosition(info: vec3f,vertexIndex: u32)->vec3f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let offset=baseOffset+vertexIndex*stride;let componentSize=select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);return vec3f( -readPositionValue(offset,dataType), -readPositionValue(offset+componentSize,dataType), -readPositionValue(offset+componentSize*2u,dataType) -);} -#if NUM_BONE_INFLUENCERS>0 -fn readMatrixIndexValue(byteOffset: u32,dataType: u32)->f32 {let wordOffset=byteOffset/4u;let byteInWord=byteOffset % 4u;let word: u32=matricesIndices[wordOffset];return convertToFloat(word,byteInWord,dataType);} -fn readMatrixIndices(info: vec3f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let offset=baseOffset+vertexIndex*stride;let componentSize=select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);return vec4f( -readMatrixIndexValue(offset,dataType), -readMatrixIndexValue(offset+componentSize,dataType), -readMatrixIndexValue(offset+componentSize*2u,dataType), -readMatrixIndexValue(offset+componentSize*3u,dataType) -);} -fn readMatrixWeightValue(byteOffset: u32,dataType: u32)->f32 {let wordOffset=byteOffset/4u;let byteInWord=byteOffset % 4u;let word: u32=bitcast(matricesWeights[wordOffset]);return convertToFloat(word,byteInWord,dataType);} -fn readMatrixWeights(info: vec3f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let offset=baseOffset+vertexIndex*stride;let componentSize=select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);return vec4f( -readMatrixWeightValue(offset,dataType), -readMatrixWeightValue(offset+componentSize,dataType), -readMatrixWeightValue(offset+componentSize*2u,dataType), -readMatrixWeightValue(offset+componentSize*3u,dataType) -);} -#if NUM_BONE_INFLUENCERS>4 -fn readMatrixIndexExtraValue(byteOffset: u32,dataType: u32)->f32 {let wordOffset=byteOffset/4u;let byteInWord=byteOffset % 4u;let word: u32=bitcast(matricesIndicesExtra[wordOffset]);return convertToFloat(word,byteInWord,dataType);} -fn readMatrixIndicesExtra(info: vec3f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let offset=baseOffset+vertexIndex*stride;let componentSize=select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);return vec4f( -readMatrixIndexExtraValue(offset,dataType), -readMatrixIndexExtraValue(offset+componentSize,dataType), -readMatrixIndexExtraValue(offset+componentSize*2u,dataType), -readMatrixIndexExtraValue(offset+componentSize*3u,dataType) -);} -fn readMatrixWeightExtraValue(byteOffset: u32,dataType: u32)->f32 {let wordOffset=byteOffset/4u;let byteInWord=byteOffset % 4u;let word: u32=bitcast(matricesWeightsExtra[wordOffset]);return convertToFloat(word,byteInWord,dataType);} -fn readMatrixIndicesExtra(info: vec3f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let offset=baseOffset+vertexIndex*stride;let componentSize=select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);return vec4f( -readMatrixWeightExtraValue(offset,dataType), -readMatrixWeightExtraValue(offset+componentSize,dataType), -readMatrixWeightExtraValue(offset+componentSize*2u,dataType), -readMatrixWeightExtraValue(offset+componentSize*3u,dataType) -);} -#endif -#endif -fn readVertexIndex(index : u32)->u32 { -#ifndef VERTEX_PULLING_USE_INDEX_BUFFER -return index; -#else -#ifdef VERTEX_PULLING_INDEX_BUFFER_32BITS -return indices[index]; -#else -let u32_index=index/2u;let bit_offset=(index & 1u)*16u;return (indices[u32_index]>>bit_offset) & 0xFFFFu; -#endif -#endif -} -fn calculateTriangleNormal(v0 -: vec3,v1 -: vec3,v2 -: vec3) -->vec3 {let edge1=v1-v0;let edge2=v2-v0;let triangleNormal=cross(edge1,edge2);let normalizedTriangleNormal=normalize(triangleNormal);return normalizedTriangleNormal;} -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#include -var triPositions: array;var thisTriIndex : u32=input.vertexIndex; -for (var i: u32=0u; i<3u; i=i+1u) {var provokingVertNum : u32=input.vertexIndex/3*3;let vertIdx=readVertexIndex(provokingVertNum+i);if (provokingVertNum+i==input.vertexIndex) {thisTriIndex=i;} -var positionUpdated=readVertexPosition(uniforms.vp_position_info,vertIdx); -#include -let inputPosition: vec3f=positionUpdated; -#include (vertexInputs.position\\),inputPosition),vertexInputs.vertexIndex,vertIdx)[0..maxSimultaneousMorphTargets] -#if NUM_BONE_INFLUENCERS>0 -let matrixIndex=readMatrixIndices(uniforms.vp_matricesIndices_info,vertIdx);let matrixWeight=readMatrixWeights(uniforms.vp_matricesWeights_info,vertIdx); -#if NUM_BONE_INFLUENCERS>4 -let matrixIndexExtra=readMatrixIndicesExtra(uniforms.vp_matricesIndicesExtra_info,vertIdx);let matrixWeightExtra=readMatrixWeightsExtra(uniforms.vp_matricesWeightsExtra_info,vertIdx); -#endif -#endif -#include(vertexInputs.matricesIndices,matrixIndex,vertexInputs.matricesWeights,matrixWeight,vertexInputs.matricesIndicesExtra,matrixIndexExtra,vertexInputs.matricesWeightsExtra,matrixWeightExtra) -#include(vertexInputs.matricesIndices,matrixIndex,vertexInputs.matricesWeights,matrixWeight,vertexInputs.matricesIndicesExtra,matrixIndexExtra,vertexInputs.matricesWeightsExtra,matrixWeightExtra) -triPositions[i]=(finalWorld*vec4(positionUpdated,1.0)).xyz;} -var N : vec3=calculateTriangleNormal(triPositions[0],triPositions[1],triPositions[2]);let worldPos=triPositions[thisTriIndex];vertexOutputs.position=uniforms.invWorldScale*vec4(worldPos,1.0);N=abs(N);if (N.x>N.y && N.x>N.z) {vertexOutputs.f_swizzle=0;vertexOutputs.position=vec4f(vertexOutputs.position.yzx,1.0);} else if (N.y>N.z) {vertexOutputs.f_swizzle=1;vertexOutputs.position=vec4f(vertexOutputs.position.zxy,1.0);} else {vertexOutputs.f_swizzle=2;vertexOutputs.position=vec4f(vertexOutputs.position.xyz,1.0);} -vertexOutputs.vNormalizedPosition=vertexOutputs.position.xyz*0.5+0.5;vertexOutputs.position.z = -vertexOutputs.vNormalizedPosition.z; } -`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=r);const f={name:e,shader:r};export{f as iblVoxelGridVertexShaderWGSL}; diff --git a/assets/iblVoxelGrid.vertex-s6WDBOtU.js b/assets/iblVoxelGrid.vertex-s6WDBOtU.js deleted file mode 100644 index 7e3c644a00519ad279cbb00987e1d3fbad006103..0000000000000000000000000000000000000000 --- a/assets/iblVoxelGrid.vertex-s6WDBOtU.js +++ /dev/null @@ -1,17 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./index-DydPgVMC.js";const e="iblVoxelGridVertexShader",o=`attribute vec3 position;varying vec3 vNormalizedPosition; -#include -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -uniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {vec3 positionUpdated=position; -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);gl_Position=viewMatrix*invWorldScale*worldPos;vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5; -#ifdef IS_NDC_HALF_ZRANGE -gl_Position.z=gl_Position.z*0.5+0.5; -#endif -}`;i.ShadersStore[e]||(i.ShadersStore[e]=o);const d={name:e,shader:o};export{d as iblVoxelGridVertexShader}; diff --git a/assets/iblVoxelGrid3dDebug.fragment-1MI8eJOo.js b/assets/iblVoxelGrid3dDebug.fragment-1MI8eJOo.js deleted file mode 100644 index 7f2d089d2e49aa6024bc6e05a0aed0044b9aa24f..0000000000000000000000000000000000000000 --- a/assets/iblVoxelGrid3dDebug.fragment-1MI8eJOo.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblVoxelGrid3dDebugPixelShader",r=`precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelTexture;uniform sampler2D voxelSlabTexture;uniform sampler2D textureSampler;uniform vec4 sizeParams; -#define offsetX sizeParams.x -#define offsetY sizeParams.y -#define widthScale sizeParams.z -#define heightScale sizeParams.w -uniform float mipNumber;void main(void) {vec2 uv = -vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 voxelSlab=texture2D(voxelSlabTexture,vUV);ivec3 size=textureSize(voxelTexture,int(mipNumber));float dimension=ceil(sqrt(float(size.z)));vec2 samplePos=fract(uv.xy*vec2(dimension));int sampleIndex=int(floor(uv.x*float(dimension)) + -floor(uv.y*float(dimension))*dimension);float mip_separator=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;} -bool outBounds=sampleIndex>size.z-1 ? true : false;sampleIndex=clamp(sampleIndex,0,size.z-1);ivec2 samplePosInt=ivec2(samplePos.xy*vec2(size.xy));vec3 voxel=texelFetch(voxelTexture, -ivec3(samplePosInt.x,samplePosInt.y,sampleIndex), -int(mipNumber)) -.rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {if (outBounds) {voxel=vec3(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;} -voxel.r+=mip_separator;} -glFragColor.rgb=mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel;glFragColor.a=1.0;}}`;o.ShadersStore[e]||(o.ShadersStore[e]=r);const l={name:e,shader:r};export{l as iblVoxelGrid3dDebugPixelShader}; diff --git a/assets/iblVoxelGrid3dDebug.fragment-DHAXBFG8.js b/assets/iblVoxelGrid3dDebug.fragment-DHAXBFG8.js deleted file mode 100644 index 9452adcd5f4cbb5a14ddae599c4f4aa6b6534002..0000000000000000000000000000000000000000 --- a/assets/iblVoxelGrid3dDebug.fragment-DHAXBFG8.js +++ /dev/null @@ -1,13 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="iblVoxelGrid3dDebugPixelShader",a=`varying vUV: vec2f;var voxelTextureSampler: sampler;var voxelTexture: texture_3d;var voxelSlabTextureSampler: sampler;var voxelSlabTexture: texture_2d;var textureSamplerSampler: sampler;var textureSampler: texture_2d;uniform sizeParams: vec4f; -#define offsetX uniforms.sizeParams.x -#define offsetY uniforms.sizeParams.y -#define widthScale uniforms.sizeParams.z -#define heightScale uniforms.sizeParams.w -uniform mipNumber: f32;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f = -vec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var voxelSlab: vec4f=textureSample(voxelSlabTexture,voxelSlabTextureSampler,input.vUV);var size: vec3u=textureDimensions(voxelTexture, i32(uniforms.mipNumber));var dimension: f32=ceil(sqrt( f32(size.z)));var samplePos: vec2f=fract(uv.xy* vec2f(dimension));var sampleIndex: u32= u32(floor(uv.x* f32(dimension)) + -floor(uv.y* f32(dimension))*dimension);var mip_separator: f32=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;} -var outBounds: bool=select(false,true,sampleIndex>size.z-1);sampleIndex=clamp(sampleIndex,0,size.z-1);var samplePosInt: vec2i= vec2i(samplePos.xy* vec2f(size.xy));var voxel: vec3f=textureLoad(voxelTexture, -vec3i(i32(samplePosInt.x),i32(samplePosInt.y),i32(sampleIndex)), -i32(uniforms.mipNumber)).rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {if (outBounds) {voxel= vec3f(0.15,0.0,0.0);} else {voxel.r+=mip_separator;} -fragmentOutputs.color=vec4f(mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel,1.0);}}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=a);const i={name:e,shader:a};export{i as iblVoxelGrid3dDebugPixelShaderWGSL}; diff --git a/assets/iblVoxelSlabDebug.fragment-BSQWr77T.js b/assets/iblVoxelSlabDebug.fragment-BSQWr77T.js deleted file mode 100644 index 36ad1bd030365f397bcd95eb00159e74d1f322fa..0000000000000000000000000000000000000000 --- a/assets/iblVoxelSlabDebug.fragment-BSQWr77T.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="iblVoxelSlabDebugPixelShader",r=`precision highp float;varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;float chunkSize=stepSize*float(MAX_DRAW_BUFFERS);float numChunks=1.0/chunkSize;float positionInChunk=fract(normPos.z/chunkSize);float slab=floor(positionInChunk*float(MAX_DRAW_BUFFERS)) / -float(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 || -normPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {gl_FragColor=vec4(0.0,0.0,0.0,0.0);} else {gl_FragColor=vec4(slab,0.0,0.0,0.75);}}`;e.ShadersStore[o]||(e.ShadersStore[o]=r);const i={name:o,shader:r};export{i as iblVoxelSlabDebugPixelShader}; diff --git a/assets/iblVoxelSlabDebug.fragment-MJ7dKEzp.js b/assets/iblVoxelSlabDebug.fragment-MJ7dKEzp.js deleted file mode 100644 index 40e62b3b2446312f903926a9dac4996ad4aec691..0000000000000000000000000000000000000000 --- a/assets/iblVoxelSlabDebug.fragment-MJ7dKEzp.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="iblVoxelSlabDebugPixelShader",n=`varying vNormalizedPosition: vec3f;uniform nearPlane: f32;uniform farPlane: f32;uniform stepSize: f32;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var normPos: vec3f=input.vNormalizedPosition.xyz;var chunkSize: f32=uniforms.stepSize* f32(MAX_DRAW_BUFFERS);var numChunks: f32=1.0/chunkSize;var positionInChunk: f32=fract(normPos.z/chunkSize);var slab: f32=floor(positionInChunk* f32(MAX_DRAW_BUFFERS)) / -f32(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 || -normPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {fragmentOutputs.color= vec4f(0.0,0.0,0.0,0.0);} else {fragmentOutputs.color= vec4f(slab,0.0,0.0,0.75);}}`;r.ShadersStoreWGSL[o]||(r.ShadersStoreWGSL[o]=n);const i={name:o,shader:n};export{i as iblVoxelSlabDebugPixelShaderWGSL}; diff --git a/assets/iblVoxelSlabDebug.vertex--Wmx0qoC.js b/assets/iblVoxelSlabDebug.vertex--Wmx0qoC.js deleted file mode 100644 index 773feaad3363e0fd0e99682db0bd080c9c9657e9..0000000000000000000000000000000000000000 --- a/assets/iblVoxelSlabDebug.vertex--Wmx0qoC.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="iblVoxelSlabDebugVertexShader",r=`attribute position: vec3f;varying vNormalizedPosition: vec3f;uniform world: mat4x4f;uniform invWorldScale: mat4x4f;uniform cameraViewMatrix: mat4x4f;uniform projection: mat4x4f;uniform viewMatrix: mat4x4f;@vertex -fn main(input : VertexInputs)->FragmentInputs {var worldPosition: vec4f=(uniforms.world* vec4f(input.position,1.));vertexOutputs.position=uniforms.projection*uniforms.cameraViewMatrix*worldPosition;vertexOutputs.vNormalizedPosition=(uniforms.viewMatrix*uniforms.invWorldScale*worldPosition).rgb;vertexOutputs.vNormalizedPosition=vertexOutputs.vNormalizedPosition* vec3f(0.5)+ vec3f(0.5);}`;i.ShadersStoreWGSL[o]||(i.ShadersStoreWGSL[o]=r);const n={name:o,shader:r};export{n as iblVoxelSlabDebugVertexShaderWGSL}; diff --git a/assets/iblVoxelSlabDebug.vertex-C61IsPYN.js b/assets/iblVoxelSlabDebug.vertex-C61IsPYN.js deleted file mode 100644 index 1b81f1abff8145076b43fcbc2172cc3df86e74aa..0000000000000000000000000000000000000000 --- a/assets/iblVoxelSlabDebug.vertex-C61IsPYN.js +++ /dev/null @@ -1 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="iblVoxelSlabDebugVertexShader",r="attribute vec3 position;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 cameraViewMatrix;uniform mat4 projection;uniform mat4 viewMatrix;void main(void) {vec4 worldPosition=(world*vec4(position,1.));gl_Position=projection*cameraViewMatrix*worldPosition;vNormalizedPosition=(viewMatrix*invWorldScale*worldPosition).rgb;vNormalizedPosition.xyz=vNormalizedPosition.xyz*vec3(0.5)+vec3(0.5);}";i.ShadersStore[o]||(i.ShadersStore[o]=r);const a={name:o,shader:r};export{a as iblVoxelSlabDebugVertexShader}; diff --git a/assets/iesTextureLoader-BG598SO5.js b/assets/iesTextureLoader-BG598SO5.js deleted file mode 100644 index 7d936fe7806163851ccaa5c3a4d8c375d3498f65..0000000000000000000000000000000000000000 --- a/assets/iesTextureLoader-BG598SO5.js +++ /dev/null @@ -1,2 +0,0 @@ -import{bm as p}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";function O(t){return t.split(" ").filter(s=>s!=="").map(s=>parseFloat(s))}function x(t,s,o){for(;o.length!==s;){const n=O(t.lines[t.index++]);o.push(...n)}}function V(t,s,o){let n=0,e=0,i=0,u=0,f=0,h=0;for(let r=0;r0&&!n.lines[n.index].includes("TILT=");)n.index++;n.lines[n.index].includes("INCLUDE"),n.index++;const i=O(n.lines[n.index++]);e.numberOfLights=i[0],e.lumensPerLamp=i[1],e.candelaMultiplier=i[2],e.numberOfVerticalAngles=i[3],e.numberOfHorizontalAngles=i[4],e.photometricType=i[5],e.unitsType=i[6],e.width=i[7],e.length=i[8],e.height=i[9];const u=O(n.lines[n.index++]);e.ballastFactor=u[0],e.fileGenerationType=u[1],e.inputWatts=u[2];for(let l=0;l0)for(let l=0;l=d)&&(a%=d*2,a>d&&(a=d*2-a)),g[b+a*h]=V(e,b,a)}return{width:c/2,height:1,data:g}}class v{constructor(){this.supportCascades=!1}loadCubeData(){throw".ies not supported in Cube."}loadData(s,o,n){const e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength),i=z(e);n(i.width,i.height,!!o.useMipMaps,!1,()=>{const u=o.getEngine();o.type=1,o.format=6,o._gammaSpace=!1,u._uploadDataToTextureDirectly(o,i.data)})}}export{v as _IESTextureLoader}; diff --git a/assets/imageProcessing.fragment-CodCckBh.js b/assets/imageProcessing.fragment-CodCckBh.js deleted file mode 100644 index 5b4faa7d0bedb135be9bd988b08ca845546f704a..0000000000000000000000000000000000000000 --- a/assets/imageProcessing.fragment-CodCckBh.js +++ /dev/null @@ -1,18 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./imageProcessingFunctions-BwYIAaLN.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="imageProcessingPixelShader",i=`varying vec2 vUV;uniform sampler2D textureSampler; -#include -#include -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{vec4 result=texture2D(textureSampler,vUV);result.rgb=max(result.rgb,vec3(0.)); -#ifdef IMAGEPROCESSING -#ifndef FROMLINEARSPACE -result.rgb=toLinearSpace(result.rgb); -#endif -result=applyImageProcessing(result); -#else -#ifdef FROMLINEARSPACE -result=applyImageProcessing(result); -#endif -#endif -gl_FragColor=result;}`;r.ShadersStore[e]||(r.ShadersStore[e]=i);const o={name:e,shader:i};export{o as imageProcessingPixelShader}; diff --git a/assets/imageProcessing.fragment-d7XWWX5d.js b/assets/imageProcessing.fragment-d7XWWX5d.js deleted file mode 100644 index f5135961df40b153be80537a6a1822a851913482..0000000000000000000000000000000000000000 --- a/assets/imageProcessing.fragment-d7XWWX5d.js +++ /dev/null @@ -1,18 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./imageProcessingFunctions-DMSN1d-p.js";import"./helperFunctions-Wgh3PIP0.js";import"./index-DydPgVMC.js";const e="imageProcessingPixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#include -#include -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var result: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);result=vec4f(max(result.rgb,vec3f(0.)),result.a); -#ifdef IMAGEPROCESSING -#ifndef FROMLINEARSPACE -result=vec4f(toLinearSpaceVec3(result.rgb),result.a); -#endif -result=applyImageProcessing(result); -#else -#ifdef FROMLINEARSPACE -result=applyImageProcessing(result); -#endif -#endif -fragmentOutputs.color=result;}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const l={name:e,shader:t};export{l as imageProcessingPixelShaderWGSL}; diff --git a/assets/imageProcessingFunctions-BwYIAaLN.js b/assets/imageProcessingFunctions-BwYIAaLN.js deleted file mode 100644 index ca040725b14103a76604d9627784555b158940c9..0000000000000000000000000000000000000000 --- a/assets/imageProcessingFunctions-BwYIAaLN.js +++ /dev/null @@ -1,115 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="imageProcessingDeclaration",o=`#ifdef EXPOSURE -uniform float exposureLinear; -#endif -#ifdef CONTRAST -uniform float contrast; -#endif -#if defined(VIGNETTE) || defined(DITHER) -uniform vec2 vInverseScreenSize; -#endif -#ifdef VIGNETTE -uniform vec4 vignetteSettings1;uniform vec4 vignetteSettings2; -#endif -#ifdef COLORCURVES -uniform vec4 vCameraColorCurveNegative;uniform vec4 vCameraColorCurveNeutral;uniform vec4 vCameraColorCurvePositive; -#endif -#ifdef COLORGRADING -#ifdef COLORGRADING3D -uniform highp sampler3D txColorTransform; -#else -uniform sampler2D txColorTransform; -#endif -uniform vec4 colorTransformSettings; -#endif -#ifdef DITHER -uniform float ditherIntensity; -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=o);const t="imageProcessingFunctions",i=`#if defined(COLORGRADING) && !defined(COLORGRADING3D) -/** -* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL. -* sampler3dSetting.x=textureOffset (0.5/textureSize). -* sampler3dSetting.y=textureSize. -*/ -#define inline -vec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting) -{float sliceSize=2.0*sampler3dSetting.x; -#ifdef SAMPLER3DGREENDEPTH -float sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y; -#else -float sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y; -#endif -float sliceInteger=floor(sliceContinuous);float sliceFraction=sliceContinuous-sliceInteger; -#ifdef SAMPLER3DGREENDEPTH -vec2 sliceUV=color.rb; -#else -vec2 sliceUV=color.rg; -#endif -sliceUV.x*=sliceSize;sliceUV.x+=sliceInteger*sliceSize;sliceUV=saturate(sliceUV);vec4 slice0Color=texture2D(colorTransform,sliceUV);sliceUV.x+=sliceSize;sliceUV=saturate(sliceUV);vec4 slice1Color=texture2D(colorTransform,sliceUV);vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction); -#ifdef SAMPLER3DBGRMAP -color.rgb=result.rgb; -#else -color.rgb=result.bgr; -#endif -return color;} -#endif -#if TONEMAPPING==3 -const float PBRNeutralStartCompression=0.8-0.04;const float PBRNeutralDesaturation=0.15;vec3 PBRNeutralToneMapping( vec3 color ) {float x=min(color.r,min(color.g,color.b));float offset=x<0.08 ? x-6.25*x*x : 0.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if (peak; -#else -var txColorTransformSampler: sampler;var txColorTransform: texture_2d; -#endif -uniform colorTransformSettings: vec4f; -#endif -#ifdef DITHER -uniform ditherIntensity: f32; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=o);const t="imageProcessingFunctions",f=`#if TONEMAPPING==3 -const PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peakvec3f -{var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;} -fn ACESFitted(color: vec3f)->vec3f -{var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturateVec3(output);return output;} -#endif -#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS -fn applyImageProcessing(result: vec4f)->vec4f { -#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART -var rgb=result.rgb;; -#ifdef EXPOSURE -rgb*=uniforms.exposureLinear; -#endif -#ifdef VIGNETTE -var viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb; -#ifdef VIGNETTEBLENDMODEMULTIPLY -var vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier; -#endif -#ifdef VIGNETTEBLENDMODEOPAQUE -rgb=mix(vignetteColor,rgb,vignette); -#endif -#endif -#if TONEMAPPING==3 -rgb=PBRNeutralToneMapping(rgb); -#elif TONEMAPPING==2 -rgb=ACESFitted(rgb); -#elif TONEMAPPING==1 -const tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb); -#endif -rgb=toGammaSpaceVec3(rgb);rgb=saturateVec3(rgb); -#ifdef CONTRAST -var resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);} -rgb=max(rgb,vec3f(0.)); -#endif -#ifdef COLORGRADING -var colorTransformInput: vec3f=rgb*uniforms.colorTransformSettings.xxx+uniforms.colorTransformSettings.yyy; -#ifdef COLORGRADING3D -var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput).rgb; -#else -var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput,uniforms.colorTransformSettings.yz).rgb; -#endif -rgb=mix(rgb,colorTransformOutput,uniforms.colorTransformSettings.www); -#endif -#ifdef COLORCURVES -var luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a); -#endif -#ifdef DITHER -var rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturateVec3(rgb+ vec3f(dither)); -#endif -#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND -return vec4f(rgb,result.a);}`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=f); diff --git a/assets/index-5qCM2tFq.js b/assets/index-5qCM2tFq.js deleted file mode 100644 index 0b66005809bb85a9e5d4942a1c434529cb6810cb..0000000000000000000000000000000000000000 --- a/assets/index-5qCM2tFq.js +++ /dev/null @@ -1,3 +0,0 @@ -import{L as D,E as h,C as L}from"./index-CBtYSz1X.js";import{s as H,t as n,i as B,d as K,L as M,e as OO,g as eO,h as f,f as iO,c as aO,j as nO,I as rO,k as QO,l as d}from"./Code-Bhm2YgEI.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";const tO=1,Z=194,j=195,oO=196,x=197,dO=198,sO=199,lO=200,TO=2,E=3,u=201,SO=24,pO=25,qO=49,gO=50,PO=55,mO=56,$O=57,hO=59,cO=60,fO=61,XO=62,yO=63,zO=65,WO=238,vO=71,RO=241,kO=242,_O=243,xO=244,uO=245,UO=246,bO=247,VO=248,Y=72,GO=249,wO=250,ZO=251,jO=252,EO=253,YO=254,FO=255,CO=256,JO=73,AO=77,IO=263,NO=112,DO=130,LO=151,HO=152,BO=155,p=10,q=13,k=32,c=9,_=35,KO=40,MO=46,R=123,U=125,F=39,C=34,b=92,Oe=111,ee=120,ie=78,ae=117,ne=85,re=new Set([pO,qO,gO,IO,zO,DO,mO,$O,WO,XO,yO,Y,JO,AO,cO,fO,LO,HO,BO,NO]);function X(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qe=new h((O,e)=>{let i;if(O.next<0)O.acceptToken(sO);else if(e.context.flags&m)X(O.next)&&O.acceptToken(dO,1);else if(((i=O.peek(-1))<0||X(i))&&e.canShift(x)){let a=0;for(;O.next==k||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==_)&&O.acceptToken(x,-a)}else X(O.next)&&O.acceptToken(oO,1)},{contextual:!0}),te=new h((O,e)=>{let i=e.context;if(i.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,Q=0;for(;;){if(O.next==k)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),Q++}r!=i.indent&&O.next!=p&&O.next!=q&&O.next!=_&&(r[O,e|J])),se=new L({start:oe,reduce(O,e,i,a){return O.flags&m&&re.has(e)||(e==vO||e==Y)&&O.flags&J?O.parent:O},shift(O,e,i,a){return e==Z?new $(O,de(a.read(a.pos,i.pos)),0):e==j?O.parent:e==SO||e==PO||e==hO||e==E?new $(O,0,m):V.has(e)?new $(O,0,V.get(e)|O.flags&m):O},hash(O){return O.hash}}),le=new h(O=>{for(let e=0;e<5;e++){if(O.next!="print".charCodeAt(e))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let e=0;;e++){let i=O.peek(e);if(!(i==k||i==c)){i!=KO&&i!=MO&&i!=p&&i!=q&&i!=_&&O.acceptToken(tO);return}}}),Te=new h((O,e)=>{let{flags:i}=e.context,a=i&s?C:F,r=(i&l)>0,Q=!(i&T),t=(i&S)>0,o=O.pos;for(;!(O.next<0);)if(t&&O.next==R)if(O.peek(1)==R)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(Q&&O.next==b){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Se(O,g)),O.acceptToken(TO);return}break}else if(O.next==b&&!Q&&O.peek(1)>-1)O.advance(2);else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(u,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(u);return}break}else O.advance();O.pos>o&&O.acceptToken(lO)});function Se(O,e){if(e==Oe)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(e==ee)for(let i=0;i<2&&y(O.next);i++)O.advance();else if(e==ae)for(let i=0;i<4&&y(O.next);i++)O.advance();else if(e==ne)for(let i=0;i<8&&y(O.next);i++)O.advance();else if(e==ie&&O.next==R){for(O.advance();O.next>=0&&O.next!=U&&O.next!=F&&O.next!=C&&O.next!=p;)O.advance();O.next==U&&O.advance()}}const pe=H({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qe={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ge=D.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[le,te,Qe,Te,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qe[O]||-1}],tokenPrec:7668}),G=new nO,A=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function P(O){return(e,i,a)=>{if(a)return!1;let r=e.node.getChild("VariableName");return r&&i(r,O),!0}}const Pe={FunctionDefinition:P("function"),ClassDefinition:P("class"),ForStatement(O,e,i){if(i){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")e(a,"variable");else if(a.name=="in")break}},ImportStatement(O,e){var i,a;let{node:r}=O,Q=((i=r.firstChild)===null||i===void 0?void 0:i.name)=="from";for(let t=r.getChild("import");t;t=t.nextSibling)t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&e(t,Q?"variable":"namespace")},AssignStatement(O,e){for(let i=O.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name==":"||i.name=="AssignOp")break},ParamList(O,e){for(let i=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!i||!/\*|AssignOp/.test(i.name))&&e(a,"variable"),i=a},CapturePattern:P("variable"),AsPattern:P("variable"),__proto__:null};function I(O,e){let i=G.get(e);if(i)return i;let a=[],r=!0;function Q(t,o){let g=O.sliceString(t.from,t.to);a.push({label:g,type:o})}return e.cursor(rO.IncludeAnonymous).iterate(t=>{if(t.name){let o=Pe[t.name];if(o&&o(t,Q,r)||!r&&A.has(t.name))return!1;r=!1}else if(t.to-t.from>8192){for(let o of I(O,t.node))a.push(o);return!1}}),G.set(e,a),a}const w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,N=["String","FormatString","Comment","PropertyName"];function me(O){let e=K(O.state).resolveInner(O.pos,-1);if(N.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w.test(O.state.sliceDoc(e.from,e.to));if(!i&&!O.explicit)return null;let a=[];for(let r=e;r;r=r.parent)A.has(r.name)&&(a=a.concat(I(O.state.doc,r)));return{options:a,from:i?e.from:O.pos,validFor:w}}const $e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),he=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: - -`,{label:"if",detail:"block",type:"keyword"}),d("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),d("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),d("import ${module}",{label:"import",detail:"statement",type:"keyword"}),d("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ce=B(N,QO($e.concat(he)));function z(O){let{node:e,pos:i}=O,a=O.lineIndent(i,-1),r=null;for(;;){let Q=e.childBefore(i);if(Q)if(Q.name=="Comment")i=Q.from;else if(Q.name=="Body"||Q.name=="MatchBody")O.baseIndentFor(Q)+O.unit<=a&&(r=Q),e=Q;else if(Q.name=="MatchClause")e=Q;else if(Q.type.is("Statement"))e=Q;else break;else break}return r}function W(O,e){let i=O.baseIndentFor(e),a=O.lineAt(O.pos,-1),r=a.from+a.text.length;return/^\s*($|#)/.test(a.text)&&O.node.toi?null:i+O.unit}const v=OO.define({name:"python",parser:ge.configure({props:[eO.add({Body:O=>{var e;let i=/^\s*(#|$)/.test(O.textAfter)&&z(O)||O.node;return(e=W(O,i))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let i=z(O);return(e=W(O,i||O.node))!==null&&e!==void 0?e:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except[ :]|finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>/^\s*case /.test(O.textAfter)?O.baseIndent+O.unit:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":f({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":f({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":f({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var e;let i=z(O);return(e=i&&W(O,i))!==null&&e!==void 0?e:O.continue()}}),iO.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":aO,Body:(O,e)=>({from:O.from+1,to:O.to-(O.to==e.doc.length?0:1)}),"String FormatString":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function We(){return new M(v,[v.data.of({autocomplete:me}),v.data.of({autocomplete:ce})])}export{ce as globalCompletion,me as localCompletionSource,We as python,v as pythonLanguage}; diff --git a/assets/index-BhQi-Oea.js b/assets/index-BhQi-Oea.js deleted file mode 100644 index 6ef157688592286eeb62d3d21e162abfaa8fa63a..0000000000000000000000000000000000000000 --- a/assets/index-BhQi-Oea.js +++ /dev/null @@ -1 +0,0 @@ -import{L as s}from"./index-CBtYSz1X.js";import{s as n,t as r,L as o,e as P,g as Q,H as a,f as i,c}from"./Code-Bhm2YgEI.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";const g=n({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,", :":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),p=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[g],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),f=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=l(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function l(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const m=P.define({name:"json",parser:p.configure({props:[Q.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":c})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function h(){return new o(m)}export{h as json,m as jsonLanguage,f as jsonParseLinter}; diff --git a/assets/index-Bmu7HJDW.js b/assets/index-Bmu7HJDW.js deleted file mode 100644 index 4c4ec85c66550e2090ab6cd286393f91f8a17609..0000000000000000000000000000000000000000 --- a/assets/index-Bmu7HJDW.js +++ /dev/null @@ -1 +0,0 @@ -import{L as be,E as $,C as he}from"./index-CBtYSz1X.js";import{p as Te,s as Pe,t as b,r as xe,d as K,E as Ve,L as ye,e as we,g as ve,f as Xe,G as $e}from"./Code-Bhm2YgEI.js";import{cssLanguage as J,css as _e}from"./index-D-RUc-cS.js";import{typescriptLanguage as qe,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-eP3_EJ4x.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&so?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return l?.children||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=m?.attrs&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.fromme(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=we.define({name:"html",parser:St.configure({props:[ve.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function kt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new ye(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,_e().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=``;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Ve.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,kt as html,Ct as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage}; diff --git a/assets/index-CBtYSz1X.js b/assets/index-CBtYSz1X.js deleted file mode 100644 index 1b9a80647a794602d320c43c8aa6426d804fdec0..0000000000000000000000000000000000000000 --- a/assets/index-CBtYSz1X.js +++ /dev/null @@ -1 +0,0 @@ -import{P as L,N as $,a as E,D as j,b as y,T as S,I as G}from"./Code-Bhm2YgEI.js";var N={};class v{constructor(t,e,s,i,h,r,n,o,a,u=0,f){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=o,this.curContext=a,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new v(t,[],e,s,s,0,[],0,i?new R(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=this.reducePos=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&r.buffer[n-4]==0&&r.buffer[n-1]>-1){if(e==s)return;if(r.buffer[n-2]>=e){r.buffer[n-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let n=!1;for(let o=r;o>0&&this.buffer[o-2]>s;o-=4)if(this.buffer[o-1]>=0){n=!0;break}if(n)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let h=t,{parser:r}=this.p;this.pos=i,!r.stateFlag(h,1)&&(i>s||e<=r.maxNode)&&(this.reducePos=i),this.pushState(h,Math.min(s,this.reducePos)),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}else this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4)}apply(t,e,s,i){t&65536?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new v(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new U(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if((s&65536)==0)return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let h=0,r;ho&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i>19,i=e&65535,h=this.stack.length-s*3;if(h<0||t.getGoto(this.stack[h],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;e=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,h)=>{if(!e.includes(i))return e.push(i),t.allActions(i,r=>{if(!(r&393216))if(r&65536){let n=(r>>19)-h;if(n>1){let o=r&65535,a=this.stack.length-n*3;if(a>=0&&t.getGoto(this.stack[a],o,!1)>=0)return n<<19|65536|o}}else{let n=s(r,h+1);if(n!=null)return n}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class R{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class U{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new A(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}function x(l,t=Uint16Array){if(typeof l!="string")return l;let e=null;for(let s=0,i=0;s=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,n=!0),h+=o,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const z=new P;class H{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=z,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;hs.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e=this.chunk2Pos&&sn.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=z,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;O(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class W{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i=0;for(;;){let h=t.next<0,r=t.resolveOffset(1,1);if(O(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(h||i++,r==null)break;t.reset(r,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}W.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class Z{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function O(l,t,e,s,i,h){let r=0,n=1<0){let p=l[c];if(o.allows(p)&&(t.token.value==-1||t.token.value==p||q(p,t.token.value,i,h))){t.acceptToken(p);break}}let u=t.next,f=0,d=l[r+2];if(t.next<0&&d>f&&l[a+d*3-3]==65535){r=l[a+d*3-1];continue t}for(;f>1,p=a+c+(c<<1),b=l[p],M=l[p+1]||65536;if(u=M)f=c+1;else{r=l[p+2],t.advance();continue t}}break}}function I(l,t,e){for(let s=t,i;(i=l[s])!=65535;s++)if(i==e)return s-t;return-1}function q(l,t,e,s){let i=I(e,s,t);return i<0||I(e,s,l)t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(l.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:l.length}}class J{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?D(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?D(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=r,null;if(h instanceof S){if(r==t){if(r=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class K{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new P)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,o=0;for(let a=0;af.end+25&&(o=Math.max(f.lookAhead,o)),f.value!=0)){let d=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!u.extend&&(s=f,e>d))break}}for(;this.actions.length>e;)this.actions.pop();return o&&t.setLookAhead(o),!s&&t.pos==this.stream.end&&(s=new P,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new P,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r=0&&s.p.parser.dialect.allows(n>>1)){(n&1)==0?t.value=n>>1:t.extended=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;ht.bufferLength*4?new J(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;re)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let o=this.tokens.getMainToken(n);h.push(o.value,o.end)}}break}}if(!s.length){let r=i&&X(i);if(r)return g&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return g&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,o)=>o.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r500&&a.buffer.length>500)if((n.score-a.score||n.buffer.length-a.buffer.length)>0)s.splice(o--,1);else{s.splice(r--,1);continue t}}}s.length>12&&(s.sort((r,n)=>n.score-r.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,u=a?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?h.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!a||(f.prop(y.contextHash)||0)==u))return t.useNode(f,d),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(f.type.id)})`),!0;if(!(f instanceof S)||f.children.length==0||f.positions[0]>0)break;let c=f.children[0];if(c instanceof S&&f.positions[0]==0)f=c;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let o=this.tokens.getActions(t);for(let a=0;ai?e.push(p):s.push(p)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return B(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let f=n.split(),d=u;for(let c=0;c<10&&f.forceReduce()&&(g&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,s));c++)g&&(d=this.stackID(f)+" -> ");for(let c of n.recoverByInsert(o))g&&console.log(u+this.stackID(c)+" (via recover-insert)"),this.advanceFully(c,s);this.stream.end>n.pos?(a==n.pos&&(a++,o=0),n.recoverByDelete(o,a),g&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),B(n,s)):(!i||i.scorel;class _{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class w extends L{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nt.topRules[n][1]),i=[];for(let n=0;n=0)h(u,o,n[a++]);else{let f=n[a+-u];for(let d=-u;d>0;d--)h(n[a++],o,f);a++}}}this.nodeSet=new $(e.map((n,o)=>E.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[o],top:s.indexOf(o)>-1,error:o==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=j;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new Q(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,o=i[h++];if(n&&s)return o;for(let a=h+(r>>1);h0}validAction(t,e){return!!this.allActions(t,s=>s==e?!0:null)}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let h=this.stateSlot(t,1);i==null;h+=3){if(this.data[h]==65535)if(this.data[h+1]==1)h=k(this.data,h+2);else break;i=e(k(this.data,h+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if((this.data[s+2]&1)==0){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(w.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=F(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;hs)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.scorel.external(e,s)<<1|t}return l.get}export{_ as C,Z as E,w as L,W as a}; diff --git a/assets/index-CMKhGNWj.js b/assets/index-CMKhGNWj.js deleted file mode 100644 index 8eabe692adee4a747a55f8651d104c391cc472ee..0000000000000000000000000000000000000000 --- a/assets/index-CMKhGNWj.js +++ /dev/null @@ -1 +0,0 @@ -import{a1 as I,Y as A,a2 as f,a3 as k,a4 as L}from"./i18n-CPHyzK9b.js";import{E as $,Q as F,a5 as J,a6 as K,a7 as N,P as V,a8 as X,I as tt,H as st,a9 as et,D as it}from"./i18n-CPHyzK9b.js";import{aa as R,Z as U,$ as D,G as u}from"./index-DydPgVMC.js";import{d as W}from"./index-tFQomdd2.js";const j={walkthrough:"tabs",walkthroughstep:"tabitem"};function g(s){const t=new URL(s.root),e=t.pathname.endsWith("/")?t.pathname:t.pathname+"/",i=s.api_prefix.startsWith("/")?s.api_prefix:"/"+s.api_prefix;return new URL(e.slice(0,-1)+i,t.origin).toString()}class T{#p;#e;#i;reactive_formatter=t=>t;#t;client;#a=R();get root(){return U(this.#a)}set root(t){D(this.#a,t,!0)}root_untracked;#l=new Set;#c=new Set;#u=[];#h=new Map;#s=new Map;#r=new Map;#o;component_ids;initial_tabs={};components_to_register=new Set;ready;ready_resolve;resolved=!1;#n=new Set;constructor(t,e,i,r,n,o,p){this.ready=new Promise(l=>{this.ready_resolve=l}),this.reactive_formatter=o;const a=g(r);this.#t={...r,api_url:a},this.#p=t,this.#e=e,this.#i=i,this.#o=p,this.root=this.create_node({id:e.id,children:[]},new Map,!0);for(const l of t)l.props.visible!=!1&&this.components_to_register.add(l.id);this.client=n,this.prepare();const h=t.reduce((l,c)=>(l.set(c.id,c),l),new Map);this.root.children=this.#e.children.map(l=>this.traverse(l,c=>this.create_node(c,h,!1,this.reactive_formatter))),this.component_ids=t.map(l=>l.id),this.initial_tabs={},m(this.root,this.initial_tabs),this.postprocess(this.root),this.root_untracked=this.root}reload(t,e,i,r){this.#e=e,this.#p=t;const n=g(r);this.#t={...r,api_url:n},this.#i=i,this.root=this.create_node({id:e.id,children:[]},new Map,!0);for(const p of t)p.props.visible!=!1&&this.components_to_register.add(p.id);this.prepare();const o=t.reduce((p,a)=>(p.set(a.id,a),p),new Map);this.root.children=this.#e.children.map(p=>this.traverse(p,a=>this.create_node(a,o,!1,this.reactive_formatter))),this.component_ids=t.map(p=>p.id),this.initial_tabs={},m(this.root,this.initial_tabs),this.postprocess(this.root)}register_component(t,e,i){this.#s.set(t,e),this.#h.set(t,i),this.components_to_register.delete(t);const r=this.#r.get(t);r&&(this.#r.delete(t),u().then(()=>{const n=this.#s.get(t);n&&n(r)})),this.components_to_register.size===0&&!this.resolved&&(this.resolved=!0,this.ready_resolve())}prepare(){const[t,e]=I(this.#i);this.#l=t,this.#c=e}process(){}postprocess(t){this.root=this.traverse(t,[e=>M(e,this.#t.api_url),e=>B(e,this.components_to_register),e=>w(e,this.initial_tabs),e=>this.find_attached_events(e,this.#i),e=>C(e,this.components_to_register,this.#n)])}find_attached_events(t,e){const i=e.filter(r=>r.targets.find(([n])=>n===t.id)).map(r=>{const n=r.targets.find(([o])=>o===t.id);return n?n[1]:null}).filter(Boolean);return t.props.shared_props.attached_events=i,t}traverse(t,e){function i(r,n,o){const p=n(r);return"children"in r&&r.children.length>0&&(p.children=r.children?.map(a=>o(a,n))||[]),p}if(Array.isArray(e)){let r=t;for(const n of e)r=i(r,n,this.traverse.bind(this));return r}else return i(t,e,this.traverse.bind(this))}create_node(t,e,i=!1,r){let n;if(i?n={type:"column",id:t.id,props:{visible:!0,root:"",theme_mode:"light",scale:this.#t.fill_height?1:null},component_class_id:"column",key:null}:n=e.get(t.id),!n)throw new Error(`Component with ID ${t.id} not found`);r&&(n.props.i18n=r,n.props.i18n_store=A);const o=z(t.id,n.props,[this.#l,this.#c],this.client,this.#t.api_url,{...this.#t,register_component:this.register_component.bind(this),dispatcher:this.#o.bind(this)}),p=j[n.type]||n.type,a=o.shared_props.visible!==!1?f(n.type,n.component_class_id,this.#t.api_url||""):null;return{id:t.id,type:p,props:o,children:[],show_progress_on:null,component_class_id:n.component_class_id||n.type,component:o.shared_props.visible!==!1&&a?.component||null,runtime:a?.runtime||!1,key:n.key,rendered_in:n.rendered_in,documentation:n.documentation,original_visibility:o.shared_props.visible}}rerender(t,e){const i=t.reduce((p,a)=>(p.set(a.id,a),p),new Map),r=this.traverse(e,p=>this.create_node(p,i,!1,this.reactive_formatter));m(r,this.initial_tabs);const n=this.traverse(r,p=>w(p,this.initial_tabs)),o=_(this.root,n.id);if(!o)throw new Error("Rerender failed: root node not found in current tree");o.children=n.children}async update_state(t,e,i=!0){const r=_(this.root,t);let n=!1;if(i&&!r?.component){await u();const p=_(this.root,t);p&&"visible"in e&&(p.props.shared_props.visible=e.visible),v(this.root,this.#t.api_url),await u(),n=!0}const o=this.#s.get(t);if(o)o&&o(e);else{const p=r?.props.props.value,a=x(e);for(const c in a.shared_props)r.props.shared_props[c]=a.shared_props[c];for(const c in a.props)r.props.props[c]=a.props[c];const{loading_status:h,...l}=e;if(Object.keys(l).length>0){const c=this.#r.get(t)||{};this.#r.set(t,{...c,...l})}"value"in e&&!W(p,e.value)&&this.#o(t,"change",null),r?.type==="tabitem"&&this.#_(t,r)}!i||n||(await u(),await this.update_visibility(r,e))}async update_visibility(t,e){t.children.forEach(i=>{const r=this.#s.get(i.id);r&&r(e),this.update_visibility(i,e)})}#_(t,e){const i=S(this.root,t);if(!i||i.type!=="tabs")return;const r=i.props.props.initial_tabs;if(!r)return;const n=r.findIndex(c=>c.component_id===e.id);if(n===-1)return;const o=e.props.props.i18n,p=e.props.shared_props.label,a=e.original_visibility,h=a!==void 0?a:e.props.shared_props.visible;r[n]={label:o?o(p):p,id:e.props.props.id,elem_id:e.props.shared_props.elem_id,visible:h==="hidden"?!1:h,interactive:e.props.shared_props.interactive,scale:e.props.shared_props.scale||null,component_id:e.id},i.props.props.initial_tabs=[...r];const l=this.#s.get(i.id);l&&l({initial_tabs:i.props.props.initial_tabs})}async get_state(t){const e=this.#h.get(t),i=_(this.root,t);return!e&&!i?null:e?await e():i?Promise.resolve({value:i.props.props.value}):null}async render_previously_invisible_children(t){const e=_(this.root,t);e&&(!this.#n.has(e.id)&&!E(e,this.#n)||(b(e,this.#n,!0),v(e,this.#t.api_url)))}}function b(s,t,e=!1){if(s.props.shared_props.visible=t.has(s.id)?!0:s.props.shared_props.visible,s.type==="tabs"){const i=s.props.props.initial_tabs,r=s.props.props.selected??i?.[0]?.id;s.children.forEach(n=>{n.type==="tabitem"&&(n.props.props.id===r||n.id===r)&&b(n,t,!1)})}else s.type==="accordion"&&s.props.props.open===!1&&!e||s.children.forEach(i=>{b(i,t,!1)})}function E(s,t){for(const e of s.children)if(t.has(e.id)||E(e,t))return!0;return!1}function v(s,t){if(s.props.shared_props.visible&&!s.component){const e=f(s.type,s.component_class_id,t);s.component=e.component,s.runtime=e.runtime}s.children.forEach(e=>v(e,t))}function q(s,t,e){return t?t.reduce((i,r)=>(i[r]=async(...n)=>(n.length===1&&(n=n[0]),await e.component_server(s,r,n)),i),{}):{}}function x(s){const t={},e={};for(const i in s)if(i==="id"||i==="autoscroll")e[i]=s[i];else if(k.includes(i)){const r=i;t[r]=s[i]}else e[i]=s[i];return{shared_props:t,props:e}}function z(s,t,e,i,r,n={}){const{shared_props:o,props:p}=x(t);o.server=q(s,t.server_fns,i);for(const a in n)if(k.includes(a)){const h=a;o[h]=n[a]}else p[a]=n[a];return o.client=i,o.id=s,o.interactive=L(s,o.interactive,p.value,e),o.load_component=(a,h,l)=>f(a,l||"",r,h),o.visible=o.visible===void 0?!0:o.visible,o.loading_status={},{shared_props:o,props:p}}function M(s,t){if(s.props.shared_props.visible&&!s.component){const e=f(s.type,s.component_class_id,t),i={...s,component:e.component,children:[]};return s.children&&(i.children=s.children.map(r=>M(r,t))),i}else return s}function d(s,t){t.delete(s.id),s.children&&s.children.forEach(e=>d(e,t))}function B(s,t){return s.props.shared_props.visible!==!0&&d(s,t),s}function y(s,t){return s.props.shared_props.visible===!0&&(t.add(s.id),s.props.shared_props.visible=!1),s.children.forEach(e=>{y(e,t)}),s}function C(s,t,e){return s.type==="accordion"&&s.props.props.open===!1&&(d(s,t),s.children&&s.children.forEach(i=>{y(i,e)})),s.type==="tabs"&&s.children.forEach(i=>{i.type==="tabitem"&&i.props.props.id!==(s.props.props.selected??s.props.props.initial_tabs[0].id)&&(d(i,t),y(i,e))}),s}function w(s,t){if(s.type==="tabs"&&s.id in t){const e=t[s.id].sort((i,r)=>i.order-r.order);s.props.props.initial_tabs=e}else s.type==="tabitem"&&(s.props.props.component_id=s.id);return s}function P(s,t,e,i){if(e!==null&&s.type==="tabitem"){e in t||(t[e]=[]),s.props.props.id==null&&(s.props.props.id=s.id);const r=s.props.props.i18n,n=s.props.shared_props.label;t[e].push({label:r?r(n):n,id:s.props.props.id,elem_id:s.props.shared_props.elem_id,visible:s.props.shared_props.visible,interactive:s.props.shared_props.interactive,scale:s.props.shared_props.scale||null,component_id:s.id}),s.props.props.order=i}s.children&&s.children.forEach((r,n)=>{P(r,t,s.type==="tabs"?s.id:null,s.type==="tabs"?n:null)})}function m(s,t){function e(i){"children"in i&&i.children.length>0&&i.children?.forEach(r=>P(r,t,i.type==="tabs"?i.id:null,null))}return e(s)}function _(s,t){if(s.id===t)return s;if(s.children)for(const e of s.children){const i=_(e,t);if(i)return i}return null}function S(s,t){if(s.children)for(const e of s.children){if(e.id===t)return s;const i=S(e,t);if(i)return i}return null}export{T as AppTree,$ as Embed,F as changeLocale,J as get_initial_locale,K as i18n_marker,N as is_translation_metadata,V as language_choices,X as load_translations,tt as mount_css,st as prefix_css,et as process_langs,it as setupi18n}; diff --git a/assets/index-CeMVyRym.js b/assets/index-CeMVyRym.js deleted file mode 100644 index bcecc4e0478d9709bcd2973646f6b2be4fb47461..0000000000000000000000000000000000000000 --- a/assets/index-CeMVyRym.js +++ /dev/null @@ -1 +0,0 @@ -import{p as i,i as k,r as de,G as ce,g as re}from"./i18n-CPHyzK9b.js";import{M as se,ac as le,Z as a,N as p,$ as I,a as _,O as ie,a2 as u,aa as L,S as M,R as N,Q as D,T as F,a3 as x,t as _e,X as ae,G as pe}from"./index-DydPgVMC.js";import{k as ge}from"./key-CFGu0zzg.js";import{s as me}from"./snippet-BtHMuX3s.js";import{U as ve}from"./Upload-Bq9KuxCu.js";import{V as he,S as fe}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as be}from"./BlockLabel-BzVeVrtL.js";/* empty css *//* empty css */import{W as we}from"./Webcam-B-wg5Ly_.js";/* empty css */import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";/* empty css */import{p as ye}from"./Video-BOdhnjQz.js";import{l as ft,a as bt}from"./Video-BOdhnjQz.js";import{P as ke,V as xe}from"./VideoPreview-C1GJVo16.js";import{default as yt}from"./Example-Cpd2Jjnh.js";import{B as oe}from"./Block-WPcVj6Bq.js";import{U as Be}from"./UploadText-CYQRFBCv.js";import{S as ne}from"./index-CfM_uZQa.js";import"./actions-4RaHFoGI.js";import"./DropdownArrow-Cq3QAKSv.js";import"./Square-D8rV3Ea-.js";import"./Spinner-C4Ov0as9.js";import"./StreamingBar-CzgHaKX0.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./universal-C9tCO36V.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./ShareButton-Cuvs43xM.js";import"./Download-DWSaBiea.js";import"./IconButtonWrapper-PnNNNvqI.js";import"./Maximize-DWbY8BRa.js";import"./VolumeLevels-B3WBv7ou.js";import"./Play-CRvn2HoA.js";import"./Undo-B9SlrYtT.js";import"./ModifyUpload-BL388q45.js";import"./Clear-BR8cTgGu.js";import"./Edit-G5CCT_vc.js";var Ve=N('
                '),ze=N('
                ',1),Pe=N('
                ',1);function Se(H,t){se(t,!0);let l=i(t,"value",15,null),B=i(t,"subtitle",3,null),J=i(t,"sources",19,()=>["webcam","upload"]),e=i(t,"label",3,void 0),j=i(t,"show_download_button",3,!1),O=i(t,"show_label",3,!0),Q=i(t,"active_source",3,"webcam"),G=i(t,"handle_reset_value",3,()=>{}),U=i(t,"max_file_size",3,null),V=i(t,"uploading",15),R=i(t,"upload_promise",15),X=i(t,"playback_position",15);i(t,"buttons",3,null),i(t,"on_custom_button_click",3,null);let Z=L(!1),h=u(()=>Q()??"webcam");function K(o){l(o),t.onchange?.(o),o&&t.onupload?.(o)}function q(){l(null),t.onchange?.(null),t.onclear?.()}function Y(o){I(Z,!0),t.onchange?.(o)}function n({detail:o}){t.onchange?.(o)}let g=L(!1);le(()=>{t.ondrag?.(a(g))});var f=Pe(),z=p(f);{let o=u(()=>e()||"Video");be(z,{get show_label(){return O()},get Icon(){return he},get label(){return a(o)}})}var P=M(z,2),A=D(P);{var w=o=>{var r=Ve(),C=D(r);{var $=d=>{{let m=u(()=>t.i18n("video.drop_to_upload"));ve(d,{filetype:"video/x-m4v,video/*",onload:K,get max_file_size(){return U()},onerror:s=>t.onerror?.(s),get root(){return t.root},get upload(){return t.upload},get stream_handler(){return t.stream_handler},get aria_label(){return a(m)},get upload_promise(){return R()},set upload_promise(s){R(s)},get dragging(){return a(g)},set dragging(s){I(g,s,!0)},get uploading(){return V()},set uploading(s){V(s)},children:(s,S)=>{var c=x(),b=p(c);{var v=W=>{var E=x(),te=p(E);me(te,()=>t.children),_(W,E)};k(b,W=>{t.children&&W(v)})}_(s,c)},$$slots:{default:!0}})}},ee=d=>{var m=x(),s=p(m);{var S=c=>{we(c,{get root(){return t.root},get mirror_webcam(){return t.webcam_options.mirror},get webcam_constraints(){return t.webcam_options.constraints},get include_audio(){return t.include_audio},mode:"video",get i18n(){return t.i18n},get upload(){return t.upload},stream_every:1,$$events:{error:({detail:b})=>t.onerror?.(b),capture:n,start_recording:()=>t.onstart_recording?.(),stop_recording:()=>t.onstop_recording?.()}})};k(s,c=>{a(h)==="webcam"&&c(S)},!0)}_(d,m)};k(C,d=>{a(h)==="upload"?d($):d(ee,!1)})}F(r),_(o,r)},y=o=>{var r=x(),C=p(r);{var $=d=>{var m=x(),s=p(m);ge(s,()=>l()?.url,S=>{{let c=u(()=>B()?.url),b=u(()=>t.webcam_options.mirror&&a(h)==="webcam");ke(S,{get upload(){return t.upload},get root(){return t.root},interactive:!0,get autoplay(){return t.autoplay},get src(){return l().url},get subtitle(){return a(c)},is_stream:!1,onplay:()=>t.onplay?.(),onpause:()=>t.onpause?.(),onstop:()=>t.onstop?.(),onend:()=>t.onend?.(),onerror:v=>t.onerror?.(v),get mirror(){return a(b)},get label(){return e()},handle_change:Y,get handle_reset_value(){return G()},get loop(){return t.loop},get value(){return l()},get i18n(){return t.i18n},get show_download_button(){return j()},handle_clear:q,get has_change_history(){return a(Z)},get playback_position(){return X()},set playback_position(v){X(v)}})}}),_(d,m)},ee=d=>{var m=x(),s=p(m);{var S=c=>{var b=ze(),v=p(b),W=D(v,!0);F(v);var E=M(v,2),te=D(E,!0);F(E),_e(ue=>{ae(W,l().orig_name||l().url),ae(te,ue)},[()=>ye(l().size)]),_(c,b)};k(s,c=>{l().size&&c(S)},!0)}_(d,m)};k(C,d=>{l()?.url?d($):d(ee,!1)},!0)}_(o,r)};k(A,o=>{l()===null||l()?.url===void 0?o(w):o(y,!1)})}var T=M(A,2);fe(T,{get sources(){return J()},handle_clear:q,get active_source(){return a(h)},set active_source(o){I(h,o)}}),F(P),_(H,f),ie()}var Ie=N(" ",1),je=N(" ",1);function mt(H,t){se(t,!0);const l=de(t,["$$slots","$$events","$$legacy"]);let B=L(void 0);class J extends ce{async get_data(){return a(B)&&(await a(B),await pe()),await super.get_data()}}const e=new J(l);let j=e.props.value,O=!1,Q=L(!1),G=L(!1),U=u(()=>e.props.sources?e.props.sources[0]:void 0),V=e.props.value;le(()=>{if(!O){j=e.props.value,O=!0;return}j!=e.props.value&&(j=e.props.value,e.dispatch("change"))});const R=()=>{V===null||e.props.value===V||(e.props.value=V)};function X(n){n!=null?e.props.value=n:e.props.value=null}function Z(n){const[g,f]=n.includes("Invalid file type")?["warning","complete"]:["error","error"];e.shared.loading_status.status=f,e.shared.loading_status.message=n,e.dispatch(g,n)}var h=x(),K=p(h);{var q=n=>{{let g=u(()=>e.props.value===null&&a(U)==="upload"?"dashed":"solid"),f=u(()=>a(G)?"focus":"base"),z=u(()=>e.props.height||void 0);oe(n,{get visible(){return e.shared.visible},get variant(){return a(g)},get border_mode(){return a(f)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return a(z)},get width(){return e.props.width},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,children:(P,A)=>{var w=Ie(),y=p(w);ne(y,re({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var T=M(y,2);{let o=u(()=>e.props.buttons??["download","share"]);xe(T,{get value(){return e.props.value},get subtitle(){return e.props.subtitles},get label(){return e.shared.label},get show_label(){return e.shared.show_label},get autoplay(){return e.props.autoplay},get loop(){return e.props.loop},get buttons(){return a(o)},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},onplay:()=>e.dispatch("play"),onpause:()=>e.dispatch("pause"),onstop:()=>e.dispatch("stop"),onend:()=>e.dispatch("end"),onshare:r=>e.dispatch("share",r),onerror:r=>e.dispatch("error",r),get i18n(){return e.i18n},upload:(...r)=>e.shared.client.upload(...r),get playback_position(){return e.props.playback_position},set playback_position(r){e.props.playback_position=r}})}_(P,w)},$$slots:{default:!0}})}},Y=n=>{{let g=u(()=>e.props.value===null&&a(U)==="upload"?"dashed":"solid"),f=u(()=>a(G)?"focus":"base"),z=u(()=>e.props.height||void 0);oe(n,{get visible(){return e.shared.visible},get variant(){return a(g)},get border_mode(){return a(f)},padding:!1,get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get height(){return a(z)},get width(){return e.props.width},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},allow_overflow:!1,children:(P,A)=>{var w=je(),y=p(w);ne(y,re({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var T=M(y,2);{let o=u(()=>e.props.buttons??["download","share"]);Se(T,{get value(){return e.props.value},get subtitle(){return e.props.subtitles},onchange:X,ondrag:r=>I(G,r,!0),onerror:Z,get label(){return e.shared.label},get show_label(){return e.shared.show_label},get buttons(){return a(o)},on_custom_button_click:r=>{e.dispatch("custom_button_click",{id:r})},get sources(){return e.props.sources},get active_source(){return a(U)},get webcam_options(){return e.props.webcam_options},get include_audio(){return e.props.include_audio},get autoplay(){return e.props.autoplay},get root(){return e.shared.root},get loop(){return e.props.loop},handle_reset_value:R,onclear:()=>{e.props.value=null,e.dispatch("clear"),e.dispatch("input")},onplay:()=>e.dispatch("play"),onpause:()=>e.dispatch("pause"),onupload:()=>{e.dispatch("upload"),e.dispatch("input")},onstop:()=>e.dispatch("stop"),onend:()=>e.dispatch("end"),onstart_recording:()=>e.dispatch("start_recording"),onstop_recording:()=>e.dispatch("stop_recording"),get i18n(){return e.i18n},get max_file_size(){return e.shared.max_file_size},upload:(...r)=>e.shared.client.upload(...r),stream_handler:(...r)=>e.shared.client.stream(...r),get upload_promise(){return a(B)},set upload_promise(r){I(B,r,!0)},get uploading(){return a(Q)},set uploading(r){I(Q,r,!0)},get playback_position(){return e.props.playback_position},set playback_position(r){e.props.playback_position=r},children:(r,C)=>{Be(r,{get i18n(){return e.i18n},type:"video"})},$$slots:{default:!0}})}_(P,w)},$$slots:{default:!0}})}};k(K,n=>{e.shared.interactive?n(Y,!1):n(q)})}_(H,h),ie()}export{yt as BaseExample,Se as BaseInteractiveVideo,ke as BasePlayer,xe as BaseStaticVideo,mt as default,ft as loaded,bt as playable,ye as prettyBytes}; diff --git a/assets/index-CfM_uZQa.js b/assets/index-CfM_uZQa.js deleted file mode 100644 index f378f276151915a978bbebe26b73171a536c19e6..0000000000000000000000000000000000000000 --- a/assets/index-CfM_uZQa.js +++ /dev/null @@ -1,2 +0,0 @@ -import{F as jt,p as d,t as At,b as Te,f as ge,u as We,i as _,d as Bt,q as $e,w as et,s as tt}from"./i18n-CPHyzK9b.js";import{M as vt,ac as me,$ as i,t as h,a as r,O as _t,aa as Z,S as g,R as B,Z as t,Q as P,T as I,v as at,N as L,a2 as U,X as T,a3 as ee,G as Dt,a4 as E}from"./index-DydPgVMC.js";import{r as lt,l as Et}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{I as st}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{C as rt}from"./Clear-BR8cTgGu.js";function ze(a){let e=["","k","M","G","T","P","E","Z"],l=0;for(;a>1e3&&lAe(a,e[u],l[u],f[u]));if(typeof l=="object"){const p={};for(const u in l)p[u]=Ae(a,e[u],l[u],f[u]);return p}else throw new Error(`Cannot spring ${typeof l} values`)}}function it(a,e={}){const l=jt(a),{stiffness:f=.15,damping:p=.8,precision:u=.01}=e;let z,o,V,m=a,M=a,G=1,W=0,j=!1;function te(A,S={}){M=A;const he=V={};return a==null||S.hard||y.stiffness>=1&&y.damping>=1?(j=!0,z=lt.now(),m=A,l.set(a=M),Promise.resolve()):(S.soft&&(W=1/((S.soft===!0?.5:+S.soft)*60),G=0),o||(z=lt.now(),j=!1,o=Et(N=>{if(j)return j=!1,o=null,!1;G=Math.min(G+W,1);const le=Math.min(N-z,1e3/30),se={inv_mass:G,opts:y,settled:!0,dt:le*60/1e3},re=Ae(se,m,a,M);return z=N,m=a,l.set(a=re),se.settled&&(o=null),!se.settled})),new Promise(N=>{o.promise.then(()=>{he===V&&N()})}))}const y={set:te,update:(A,S)=>te(A(M,a),S),subscribe:l.subscribe,stiffness:f,damping:p,precision:u};return y}var Gt=B('
                ');function Nt(a,e){vt(e,!0);const l=()=>We(o,"$top",p),f=()=>We(V,"$bottom",p),[p,u]=At();let z=d(e,"margin",3,!0);const o=it([0,0]),V=it([0,0]);let m=Z(!1);async function M(){await Promise.all([o.set([125,140]),V.set([-125,-140])]),await Promise.all([o.set([-125,140]),V.set([125,-140])]),await Promise.all([o.set([-125,0]),V.set([125,-0])]),await Promise.all([o.set([125,0]),V.set([-125,0])])}async function G(){await M(),t(m)||G()}async function W(){await Promise.all([o.set([125,0]),V.set([-125,0])]),G()}me(()=>(W(),()=>{i(m,!0)}));var j=Gt();let te;var y=P(j),A=P(y),S=g(A);I(y),I(j),h(()=>{te=Te(j,1,"svelte-1qivxe4",null,te,{margin:z()}),ge(A,`transform: translate(${l()[0]??""}px, ${l()[1]??""}px);`),ge(S,`transform: translate(${f()[0]??""}px, ${f()[1]??""}px);`)}),r(a,j),_t(),u()}let Ce=[],je=!1;const Ot=typeof window<"u",dt=Ot?window.requestAnimationFrame:a=>{},ot=new Set;async function Rt(a,e=!0){if(!(window.__gradio_mode__==="website"||window.__gradio_mode__!=="app"&&e!==!0)){if(Ce.push(a),!je)je=!0;else return;await Dt(),dt(()=>{let l=[0,0];for(let f=0;f '),Yt=B('
                '),Qt=B(" ",1),Ht=B(" ",1),Jt=B('
                '),Kt=B('

                ',1),Ut=B("
                ",1),Wt=B('
                ',1),$t=B("
                "),ea=B('
                ',1);function na(a,e){vt(e,!0);let l=d(e,"eta",3,null),f=d(e,"component_id",3,null),p=d(e,"fn_index",3,null),u=d(e,"scroll_to_output",3,!1),z=d(e,"timer",3,!0),o=d(e,"show_progress",3,"full"),V=d(e,"message",3,null),m=d(e,"progress",3,null),M=d(e,"variant",3,"default"),G=d(e,"loading_text",3,"Loading..."),W=d(e,"absolute",3,!0),j=d(e,"translucent",3,!1),te=d(e,"border",3,!1),y=d(e,"validation_error",7,null),A=d(e,"show_validation_error",3,!0),S=d(e,"type",3,null),he=d(e,"used_cache",3,null),N=d(e,"cache_duration",3,null),le=d(e,"avg_time",3,null),se=d(e,"cache_event_id",3,null),re,be=!1,Ze=Z(0),we=Z(null),xe=Z(null),Be=Z(!1),ke=Z(null),Le=Z(!1),pe=Z(!1),De=Z(null),Ee=Z(null),Ge=Z("from cache"),Pe=Z(!1),ne=null,ie=null,Ne=null;function ut(){ne&&clearTimeout(ne),ie&&clearTimeout(ie),ne=null,ie=null,i(Le,!1),i(pe,!1)}const ct=U(()=>!(A()&&y())&&(S()==="input"||!e.status||e.status==="complete"||o()==="hidden"||e.status=="streaming"));let Ve=Z(0);const ft=U(()=>t(xe)===null||t(xe)<=0||!t(Ve)?0:Math.min(t(Ve)/t(xe),1)),mt=U(()=>t(Ve).toFixed(1));let gt=U(()=>m()==null),Me=U(()=>l()??t(we));function Oe(){dt(()=>{i(Ve,(performance.now()-t(Ze))/1e3),be&&Oe()})}let O=U(()=>{let s=null;m()!=null?s=m().map(b=>{if(b.index!=null&&b.length!=null)return b.index/b.length;if(b.progress!=null)return b.progress}):s=null;let c,F="";return s?(c=s[s.length-1],c===0?F="0":F="150ms"):c=void 0,{progress_level:s,last_progress_level:c,progress_bar_transition:F}});function ht(){be||(i(we,i(ke,null),!0),i(Ze,performance.now(),!0),be=!0,Oe())}function bt(){i(we,i(ke,null),!0),be&&(be=!1)}me(()=>{e.status==="pending"?ht():at(()=>{bt()})}),me(()=>{re&&u()&&(e.status==="pending"||e.status==="complete")&&Rt(re,e.autoscroll)}),me(()=>{t(Me)!=null&&t(we)!==t(Me)&&(i(xe,(performance.now()-t(Ze))/1e3+t(Me)),i(ke,t(xe).toFixed(1),!0),i(we,t(Me),!0))});function wt(){i(Be,!1)}me(()=>{at(()=>{wt()}),e.status==="error"&&V()&&i(Be,!0)}),me(()=>{if(e.status==="complete"&&S()==="output"&&he()&&N()!=null){const s=se()==null?null:`${f()??p()??"unknown"}:${p()??"unknown"}:${se()}`;if(s===Ne||s!=null&&ot.has(s))return;Ne=s,s!=null&&ot.add(s),i(De,N().toFixed(1),!0),i(Ge,he()==="full"?"from cache":"used cache",!0),i(Pe,le()!=null&&le()>N()&&le()>0,!0),i(Ee,t(Pe)?le().toFixed(1):null,!0),i(Le,!0),i(pe,!1),ne&&clearTimeout(ne),ie&&clearTimeout(ie),ne=setTimeout(()=>{i(pe,!0),ie=setTimeout(()=>{i(Le,!1),i(pe,!1)},500)},1750)}else S()==="output"&&!he()&&ut()});var Re=ea(),oe=L(Re);let Xe,Ye;var Qe=P(oe);{var xt=s=>{var c=Xt(),F=P(c),b=g(F),C=P(b);{let D=U(()=>e.i18n?e.i18n("common.clear"):"Clear");st(C,{get Icon(){return rt},get label(){return t(D)},disabled:!1,size:"x-small",background:"var(--background-fill-primary)",color:"var(--error-background-text)",border:"var(--border-color-primary)",onclick:()=>y(null)})}I(b),I(c),h(()=>T(F,`${y()??""} `)),r(s,c)};_(Qe,s=>{y()&&A()&&s(xt)})}var pt=g(Qe,2);{var qt=s=>{var c=Ut(),F=L(c);{var b=n=>{var v=Yt();let w;h(()=>w=ge(v,"",w,{transform:`translateX(${(t(ft)||0)*100-100}%)`})),r(n,v)};_(F,n=>{M()==="default"&&t(gt)&&o()==="full"&&n(b)})}var C=g(F,2);let D;var $=P(C);{var qe=n=>{var v=ee(),w=L(v);$e(w,17,m,et,(X,x)=>{var k=ee(),Y=L(k);{var de=Q=>{var H=Qt(),ue=L(H);{var Se=J=>{var ae=E();h((ye,Fe)=>T(ae,`${ye??""}/${Fe??""}`),[()=>ze(t(x).index||0),()=>ze(t(x).length)]),r(J,ae)},ce=J=>{var ae=E();h(ye=>T(ae,ye),[()=>ze(t(x).index||0)]),r(J,ae)};_(ue,J=>{t(x).length!=null?J(Se):J(ce,!1)})}var fe=g(ue);h(()=>T(fe,` ${t(x).unit??""} | `)),r(Q,H)};_(Y,Q=>{t(x).index!=null&&Q(de)})}r(X,k)}),r(n,v)},R=n=>{var v=ee(),w=L(v);{var X=k=>{var Y=E();h(()=>T(Y,`queue: ${e.queue_position+1}/${e.queue_size??""} |`)),r(k,Y)},x=k=>{var Y=ee(),de=L(Y);{var Q=H=>{var ue=E("processing |");r(H,ue)};_(de,H=>{e.queue_position===0&&H(Q)},!0)}r(k,Y)};_(w,k=>{e.queue_position!==null&&e.queue_size!==void 0&&e.queue_position>=0?k(X):k(x,!1)},!0)}r(n,v)};_($,n=>{m()?n(qe):n(R,!1)})}var ve=g($,2);{var Ie=n=>{var v=E();h(()=>T(v,`${t(mt)??""}${l()?`/${t(ke)}`:""}s`)),r(n,v)};_(ve,n=>{z()&&n(Ie)})}I(C);var _e=g(C,2);{var Lt=n=>{var v=Jt(),w=P(v),X=P(w);{var x=Q=>{var H=ee(),ue=L(H);$e(ue,17,m,et,(Se,ce,fe)=>{var J=ee(),ae=L(J);{var ye=Fe=>{var He=Ht(),Je=L(He);{var Tt=q=>{var K=E(" /");r(q,K)};_(Je,q=>{fe!==0&&q(Tt)})}var Ke=g(Je,2);{var Zt=q=>{var K=E();h(()=>T(K,t(ce).desc)),r(q,K)};_(Ke,q=>{t(ce).desc!=null&&q(Zt)})}var Ue=g(Ke,2);{var Pt=q=>{var K=E("-");r(q,K)};_(Ue,q=>{t(ce).desc!=null&&t(O).progress_level&&t(O).progress_level[fe]!=null&&q(Pt)})}var It=g(Ue,2);{var St=q=>{var K=E();h(zt=>T(K,`${zt??""}%`),[()=>(100*(t(O).progress_level[fe]||0)).toFixed(1)]),r(q,K)};_(It,q=>{t(O).progress_level!=null&&q(St)})}r(Fe,He)};_(ae,Fe=>{(t(ce).desc!=null||t(O).progress_level&&t(O).progress_level[fe]!=null)&&Fe(ye)})}r(Se,J)}),r(Q,H)};_(X,Q=>{m()!=null&&Q(x)})}I(w);var k=g(w,2),Y=P(k);let de;I(k),I(v),h(()=>de=ge(Y,"",de,{width:`${t(O).last_progress_level*100}%`,transition:t(O).progress_bar_transition})),r(n,v)},Vt=n=>{var v=ee(),w=L(v);{var X=x=>{{let k=U(()=>M()==="default");Nt(x,{get margin(){return t(k)}})}};_(w,x=>{o()==="full"&&x(X)},!0)}r(n,v)};_(_e,n=>{t(O).last_progress_level!=null?n(Lt):n(Vt,!1)})}var Mt=g(_e,2);{var Ct=n=>{var v=Kt(),w=L(v),X=P(w,!0);I(w);var x=g(w,2);tt(x,e,"additional-loading-text",{}),h(()=>T(X,G())),r(n,v)};_(Mt,n=>{z()||n(Ct)})}h(()=>D=Te(C,1,"progress-text svelte-1b3q1bp",null,D,{"meta-text-center":M()==="center","meta-text":M()==="default"})),r(s,c)},yt=s=>{var c=ee(),F=L(c);{var b=C=>{var D=Wt(),$=L(D),qe=P($);{let _e=U(()=>e.i18n("common.clear"));st(qe,{get Icon(){return rt},get label(){return t(_e)},disabled:!1,onclick:()=>{e.on_clear_status?.()}})}I($);var R=g($,2),ve=P(R,!0);I(R);var Ie=g(R,2);tt(Ie,e,"error",{}),h(_e=>T(ve,_e),[()=>e.i18n("common.error")]),r(C,D)};_(F,C=>{e.status==="error"&&C(b)},!0)}r(s,c)};_(pt,s=>{e.status==="pending"?s(qt):s(yt,!1)})}I(oe),Bt(oe,s=>re=s,()=>re);var Ft=g(oe,2);{var kt=s=>{var c=$t();let F,b;var C=P(c),D=g(C);{var $=R=>{var ve=E();h(()=>T(ve,`~${t(Ee)??""}s - → `)),r(R,ve)};_(D,R=>{t(Pe)&&R($)})}var qe=g(D);I(c),h(()=>{F=Te(c,1,"cache-indicator svelte-1b3q1bp",null,F,{"fade-out":t(pe)}),b=ge(c,"",b,{position:W()?"absolute":"static"}),T(C,`⚡ ${t(Ge)??""}: `),T(qe,`${t(De)??""}s`)}),r(s,c)};_(Ft,s=>{t(Le)&&s(kt)})}h(()=>{Xe=Te(oe,1,`wrap ${M()??""} ${o()??""}`,"svelte-1b3q1bp",Xe,{"no-click":y()&&A(),hide:t(ct),translucent:M()==="center"&&(e.status==="pending"||e.status==="error")||j()||o()==="minimal"||y(),generating:e.status==="generating"&&o()==="full",border:te()}),Ye=ge(oe,"",Ye,{position:W()?"absolute":"static",padding:W()?"0":"var(--size-8) 0"})}),r(a,Re),_t()}export{Nt as L,na as S,nt as i,it as s}; diff --git a/assets/index-D-RUc-cS.js b/assets/index-D-RUc-cS.js deleted file mode 100644 index 43f4fb188592182cc9b0c5037758b491ae6edc1b..0000000000000000000000000000000000000000 --- a/assets/index-D-RUc-cS.js +++ /dev/null @@ -1 +0,0 @@ -import{L as w,E as p,a as Y}from"./index-CBtYSz1X.js";import{s as x,t as r,L as q,e as j,g as G,H as R,f as T,c as E,d as _,j as C,I as U}from"./Code-Bhm2YgEI.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";const V=122,g=1,Z=123,W=124,b=2,N=125,I=3,F=4,X=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D=58,B=40,k=95,K=91,c=45,L=46,A=35,J=37,H=38,M=92,ee=10,Oe=42;function d(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function S(e){return e>=48&&e<=57}function h(e){return S(e)||e>=97&&e<=102||e>=65&&e<=70}const z=(e,t,i)=>(O,a)=>{for(let o=!1,l=0,Q=0;;Q++){let{next:s}=O;if(d(s)||s==c||s==k||o&&S(s))!o&&(s!=c||Q>0)&&(o=!0),l===Q&&s==c&&l++,O.advance();else if(s==M&&O.peek(1)!=ee){if(O.advance(),h(O.next)){do O.advance();while(h(O.next));O.next==32&&O.advance()}else O.next>-1&&O.advance();o=!0}else{o&&O.acceptToken(l==2&&a.canShift(b)?t:s==B?i:e);break}}},ae=new p(z(Z,b,W)),te=new p(z(N,I,F)),re=new p(e=>{if(X.includes(e.peek(-1))){let{next:t}=e;(d(t)||t==k||t==A||t==L||t==Oe||t==K||t==D&&d(e.peek(1))||t==c||t==H)&&e.acceptToken(V)}}),oe=new p(e=>{if(!X.includes(e.peek(-1))){let{next:t}=e;if(t==J&&(e.advance(),e.acceptToken(g)),d(t)){do e.advance();while(d(e.next)||S(e.next));e.acceptToken(g)}}}),le=x({"AtKeyword import charset namespace keyframes media supports":r.definitionKeyword,"from to selector":r.keyword,NamespaceName:r.namespace,KeyframeName:r.labelName,KeyframeRangeName:r.operatorKeyword,TagName:r.tagName,ClassName:r.className,PseudoClassName:r.constant(r.className),IdName:r.labelName,"FeatureName PropertyName":r.propertyName,AttributeName:r.attributeName,NumberLiteral:r.number,KeywordQuery:r.keyword,UnaryQueryOp:r.operatorKeyword,"CallTag ValueName":r.atom,VariableName:r.variableName,Callee:r.operatorKeyword,Unit:r.unit,"UniversalSelector NestingSelector":r.definitionOperator,"MatchOp CompareOp":r.compareOperator,"ChildOp SiblingOp, LogicOp":r.logicOperator,BinOp:r.arithmeticOperator,Important:r.modifier,Comment:r.blockComment,ColorLiteral:r.color,"ParenthesizedContent StringLiteral":r.string,":":r.punctuation,"PseudoOp #":r.derefOperator,"; ,":r.separator,"( )":r.paren,"[ ]":r.squareBracket,"{ }":r.brace}),ie={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Qe={__proto__:null,or:98,and:98,not:106,only:106,layer:170},se={__proto__:null,selector:112,layer:166},ne={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},de={__proto__:null,to:207},ce=w.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hie[e]||-1},{term:125,get:e=>Qe[e]||-1},{term:4,get:e=>se[e]||-1},{term:25,get:e=>ne[e]||-1},{term:123,get:e=>de[e]||-1}],tokenPrec:1963});let m=null;function u(){if(!m&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],i=new Set;for(let O in e)O!="cssText"&&O!="cssFloat"&&typeof e[O]=="string"&&(/[A-Z]/.test(O)&&(O=O.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),i.has(O)||(t.push(O),i.add(O)));m=t.sort().map(O=>({type:"property",label:O,apply:O+": "}))}return m||[]}const f=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),y=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),pe=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),me=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),n=/^(\w[\w-]*|-\w[\w-]*|)$/,ue=/^-(-[\w-]*)?$/;function Se(e,t){var i;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let O=(i=e.parent)===null||i===void 0?void 0:i.firstChild;return O?.name!="Callee"?!1:t.sliceString(O.from,O.to)=="var"}const $=new C,ge=["Declaration"];function he(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function v(e,t,i){if(t.to-t.from>4096){let O=$.get(t);if(O)return O;let a=[],o=new Set,l=t.cursor(U.IncludeAnonymous);if(l.firstChild())do for(let Q of v(e,l.node,i))o.has(Q.label)||(o.add(Q.label),a.push(Q));while(l.nextSibling());return $.set(t,a),a}else{let O=[],a=new Set;return t.cursor().iterate(o=>{var l;if(i(o)&&o.matchContext(ge)&&((l=o.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let Q=e.sliceString(o.from,o.to);a.has(Q)||(a.add(Q),O.push({label:Q,type:"variable"}))}}),O}}const fe=e=>t=>{let{state:i,pos:O}=t,a=_(i).resolveInner(O,-1),o=a.type.isError&&a.from==a.to-1&&i.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(o||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:u(),validFor:n};if(a.name=="ValueName")return{from:a.from,options:y,validFor:n};if(a.name=="PseudoClassName")return{from:a.from,options:f,validFor:n};if(e(a)||(t.explicit||o)&&Se(a,i.doc))return{from:e(a)||o?a.from:O,options:v(i.doc,he(a),e),validFor:ue};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:u(),validFor:n};return{from:a.from,options:pe,validFor:n}}if(a.name=="AtKeyword")return{from:a.from,options:me,validFor:n};if(!t.explicit)return null;let l=a.resolve(O),Q=l.childBefore(O);return Q&&Q.name==":"&&l.name=="PseudoClassSelector"?{from:O,options:f,validFor:n}:Q&&Q.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:O,options:y,validFor:n}:l.name=="Block"||l.name=="Styles"?{from:O,options:u(),validFor:n}:null},ye=fe(e=>e.name=="VariableName"),P=j.define({name:"css",parser:ce.configure({props:[G.add({Declaration:R()}),T.add({"Block KeyframeList":E})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ke(){return new q(P,P.data.of({autocomplete:ye}))}export{ke as css,ye as cssCompletionSource,P as cssLanguage,fe as defineCSSCompletionSource}; diff --git a/assets/index-DydPgVMC.js b/assets/index-DydPgVMC.js deleted file mode 100644 index 69df2775cbf68a68698b1b44eadbd68abc100e17..0000000000000000000000000000000000000000 --- a/assets/index-DydPgVMC.js +++ /dev/null @@ -1,43 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Index-BHiVKlHr.js","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./index-CfM_uZQa.js","./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js","./html-BZIV6tyB.js","./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js","./snippet-BtHMuX3s.js","./ScrollFade-FmR1tTNV.css","./index-B_pwUImq.js","./StreamingBar-C3YDZJTa.css","./Clear-BR8cTgGu.js","./Index-CI7BqPz-.css","./index-CMKhGNWj.js","./index-tFQomdd2.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const ps="modulepreload",vs=function(e,t){return new URL(e,t).href},qn={},ht=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let h=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");s=h(n.map(u=>{if(u=vs(u,r),u in qn)return;qn[u]=!0;const l=u.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(r)for(let v=o.length-1;v>=0;v--){const p=o[v];if(p.href===u&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":ps,l||(d.as="script"),d.crossOrigin="",d.href=u,c&&d.setAttribute("nonce",c),document.head.appendChild(d),l)return new Promise((v,p)=>{d.addEventListener("load",v),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},ms="host",lr="queue/data",gs="queue/join",Un="upload",ws="login",Nt="config",ys="info",bs="runtime",Es="sleeptime",Ss="heartbeat",ks="component_server",Ts="reset",As="cancel",xs="app_id",cr="This application is currently busy. Please try again. ",ke="Connection errored out. ",Se="Could not resolve app config. ",$s="Could not get space status. ",Os="Could not get API info. ",wn="Space metadata could not be loaded. ",Rs="Invalid URL. A full URL path is required.",Cs="Not authorized to access this space. ",ur="Invalid credentials. Could not login. ",Ns="Login credentials are required to access this space.",Ps="File system access is only available in Node.js environments",fr="Root URL not found in client config",Ls="Error uploading file";async function Fn(e,t,n){try{return(await(await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${t}`,...n?{Cookie:n}:{}}})).json()).token||!1}catch{return!1}}function Is(e){let t={};return e.forEach(({api_name:n,id:r})=>{n&&(t[n]=r)}),t}async function Ds(e){const t=this.options.token?{Authorization:`Bearer ${this.options.token}`}:{};if(typeof window<"u"&&window.gradio_config&&location.origin!=="http://localhost:9876"){if(window.gradio_config.current_page&&(e=e.substring(0,e.lastIndexOf("/"))),window.gradio_config.dev_mode||typeof window<"u"&&window?.BUILD_MODE==="dev"){let n=sn(e,this.deep_link?Nt+"?deep_link="+this.deep_link:Nt);const r=await this.fetch(n,{headers:t,credentials:"include"}),s=await zn(r,!!this.options.auth);s.root=e||s.root,window.gradio_config={...s,current_page:window.gradio_config.current_page}}return{...window.gradio_config}}else if(e){let n=sn(e,this.deep_link?Nt+"?deep_link="+this.deep_link:Nt);const r=await this.fetch(n,{headers:t,credentials:"include"}),s=await zn(r,!!this.options.auth);return s.root||(s.root=e),s}throw new Error(Se)}async function zn(e,t){if(e?.status===401&&!t){const r=(await e.json())?.detail?.auth_message;throw new Error(r||Ns)}else if(e?.status===401&&t)throw new Error(ur);if(e?.status===200){let n=await e.json();return n.dependencies?.forEach((r,s)=>{r.id===void 0&&(r.id=s)}),n}else if(e?.status===401)throw new Error(Cs);throw new Error(Se)}async function Ms(){const{http_protocol:e,host:t}=await bn(this.app_reference,this.options.token);try{if(this.options.auth){const n=await dr(e,t,this.options.auth,this.fetch,this.options.token);n&&this.set_cookies(n)}}catch(n){throw Error(n.message)}}async function dr(e,t,n,r,s){const i=new FormData;i.append("username",n?.[0]),i.append("password",n?.[1]);let o={};s&&(o.Authorization=`Bearer ${s}`);const a=await r(`${e}//${t}/${ws}`,{headers:o,method:"POST",body:i,credentials:"include"});if(a.status===200)return a.headers.get("set-cookie");throw a.status===401?new Error(ur):new Error(wn)}function en(e){if(e.startsWith("http")){const{protocol:t,host:n,pathname:r}=new URL(e);return{ws_protocol:t==="https:"?"wss":"ws",http_protocol:t,host:n+(r!=="/"?r:"")}}return{ws_protocol:"wss",http_protocol:"https:",host:new URL(e).host}}const hr=e=>{let t=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach(r=>{const[s,i]=r.split(";")[0].split("=");s&&i&&t.push(`${s.trim()}=${i.trim()}`)}),t},yn=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,js=/.*hf\.space\/{0,1}.*$/;async function bn(e,t){const n={};t&&(n.Authorization=`Bearer ${t}`);const r=e.trim().replace(/\/$/,"");if(yn.test(r))try{const i=(await(await fetch(`https://huggingface.co/api/spaces/${r}/${ms}`,{headers:n})).json()).host;return{space_id:e,...en(i)}}catch{throw new Error(wn)}if(js.test(r)){const{ws_protocol:s,http_protocol:i,host:o}=en(r);return{space_id:o.split("/")[0].replace(".hf.space",""),ws_protocol:s,http_protocol:i,host:o}}return{space_id:!1,...en(r)}}const sn=(...e)=>{try{return e.reduce((t,n)=>(t=t.replace(/\/+$/,""),n=n.replace(/^\/+/,""),new URL(n,t+"/").toString()))}catch{throw new Error(Rs)}};function qs(e,t,n){const r={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(s=>{(s==="named_endpoints"||s==="unnamed_endpoints")&&(r[s]={},Object.entries(e[s]).forEach(([i,{parameters:o,returns:a}])=>{const c=t.dependencies.find(l=>l.api_name===i||l.api_name===i.replace("/",""))?.id||n[i.replace("/","")]||-1,h=c!==-1?t.dependencies.find(l=>l.id==c)?.types:{generator:!1,cancel:!1};if(c!==-1&&t.dependencies.find(l=>l.id==c)?.inputs?.length!==o.length){const l=t.dependencies.find(f=>f.id==c).inputs.map(f=>t.components.find(d=>d.id===f)?.type);try{l.forEach((f,d)=>{if(f==="state"){const v={component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0};o.splice(d,0,v)}})}catch(f){console.error(f)}}const u=(l,f,d,v)=>({...l,description:Fs(l?.type,d),type:Us(l?.type,f,d,v)||""});r[s][i]={parameters:o.map(l=>u(l,l?.component,l?.serializer,"parameter")),returns:a.map(l=>u(l,l?.component,l?.serializer,"return")),type:h}}))}),r}function Us(e,t,n,r){if(t==="Api")return e.type;switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(n==="JSONSerializable"||n==="StringSerializable")return"any";if(n==="ListStringSerializable")return"string[]";if(t==="Image")return r==="parameter"?"Blob | File | Buffer":"string";if(n==="FileSerializable")return e?.type==="array"?r==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":r==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(n==="GallerySerializable")return r==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function Fs(e,t){return t==="GallerySerializable"?"array of [file, label] tuples":t==="ListStringSerializable"?"array of strings":t==="FileSerializable"?"array of files or single file":e?.description}function Bn(e,t){switch(e.msg){case"send_data":return{type:"data"};case"send_hash":return{type:"hash"};case"queue_full":return{type:"update",status:{queue:!0,message:cr,stage:"error",code:e.code,success:e.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:e.message,session_not_found:e.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:e.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:t||"pending",code:e.code,size:e.queue_size,position:e.rank,eta:e.rank_eta,success:e.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,progress_data:e.progress_data,success:e.success}};case"log":return{type:"log",data:e};case"process_generating":return{type:"generating",status:{queue:!0,message:e.success?null:e.output.error,stage:e.success?"generating":"error",code:e.code,progress_data:e.progress_data,eta:e.average_duration,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:e.output.error,stage:"streaming",time_limit:e.time_limit,code:e.code,progress_data:e.progress_data,eta:e.eta},data:e.output};case"process_completed":return"error"in e.output?{type:"update",status:{queue:!0,title:e.output.title??"Error",message:e.output.error??"An error occurred",visible:e.output.visible,duration:e.output.duration,stage:"error",code:e.code,success:e.success}}:{type:"complete",status:{queue:!0,message:e.success?void 0:e.output.error,stage:e.success?"complete":"error",code:e.code,progress_data:e.progress_data,changed_state_ids:e.success?e.output.changed_state_ids:void 0,used_cache:e.used_cache,cache_duration:e.cache_duration,avg_time:e.avg_time},data:e.success?e.output:null};case"process_starts":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,size:e.rank,position:0,success:e.success,eta:e.eta},original_msg:"process_starts"}}return{type:"none",status:{stage:"error",queue:!0}}}const zs=(e=[],t)=>{const n=t?t.parameters:[];if(Array.isArray(e))return t&&n.length>0&&e.length>n.length&&console.warn("Too many arguments provided for the endpoint."),e;const r=[],s=Object.keys(e);return n.forEach((i,o)=>{if(e.hasOwnProperty(i.parameter_name))r[o]=e[i.parameter_name];else if(i.parameter_has_default)r[o]=i.parameter_default;else throw new Error(`No value provided for required parameter: ${i.parameter_name}`)}),s.forEach(i=>{if(!n.some(o=>o.parameter_name===i))throw new Error(`Parameter \`${i}\` is not a valid keyword argument. Please refer to the API for usage.`)}),r.forEach((i,o)=>{if(i===void 0&&!n[o].parameter_has_default)throw new Error(`No value provided for required parameter: ${n[o].parameter_name}`)}),r};async function Bs(){if(this.api_info)return this.api_info;const{token:e}=this.options,{config:t}=this,n={};if(e&&(n.Authorization=`Bearer ${e}`),!!t)try{let r,s;if(typeof window<"u"&&window.gradio_api_info)s=window.gradio_api_info;else{const i=sn(t.root,this.api_prefix,ys);if(r=await this.fetch(i,{headers:n,credentials:"include"}),!r.ok)throw new Error(ke);s=await r.json()}return"api"in s&&(s=s.api),s.named_endpoints["/predict"]&&!s.unnamed_endpoints[0]&&(s.unnamed_endpoints[0]=s.named_endpoints["/predict"]),qs(s,t,this.api_map)}catch(r){throw new Error("Could not get API info. "+r.message)}}async function Gs(e,t,n){const r={};this?.options?.token&&(r.Authorization=`Bearer ${this.options.token}`);const s=1e3,i=[];let o;for(let a=0;a{h.append("files",l)});try{const l=n?`${e}${this.api_prefix}/${Un}?upload_id=${n}`:`${e}${this.api_prefix}/${Un}`;o=await this.fetch(l,{method:"POST",body:h,headers:r,credentials:"include"})}catch(l){throw new Error(ke+l.message)}if(!o.ok){const l=await o.text();return{error:`HTTP ${o.status}: ${l}`}}const u=await o.json();u&&i.push(...u)}return{files:i}}const Hs={radix:1e3,unit:["b","kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},Vs={radix:1024,unit:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"]},Ys={radix:1024,unit:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},Gn={si:Hs,iec:Vs,jedec:Ys};function Ws(e,t=1,n="jedec"){e=Math.abs(e);const{radix:r,unit:s}=Gn[n]||Gn.jedec;let i=0;for(;e>=r;)e/=r,++i;return`${e.toFixed(t)} ${s[i]}`}async function Ks(e,t,n,r){let s=(Array.isArray(e)?e:[e]).map(o=>o.blob);const i=s.filter(o=>o.size>(r??1/0));if(i.length)throw new Error(`File(s) exceed the maximum allowed size of ${Ws(r||1/0)}: ${i.map(o=>`"${o.name}"`).join(", ")}`);return await Promise.all(await this.upload_files(t,s,n).then(async o=>{if(o.error)throw new Error(o.error);return o.files?o.files.map((a,c)=>new Ft({...e[c],path:a,url:`${t}${this.api_prefix}/file=${a}`})):[]}))}async function sa(e,t){return e.map(n=>new Ft({path:n.name,orig_name:n.name,blob:n,size:n.size,mime_type:n.type,is_stream:t}))}class Ft{path;url;orig_name;size;blob;is_stream;mime_type;alt_text;b64;meta={_type:"gradio.FileData"};constructor({path:t,url:n,orig_name:r,size:s,blob:i,is_stream:o,mime_type:a,alt_text:c,b64:h}){this.path=t,this.url=n,this.orig_name=r,this.size=s,this.blob=n?void 0:i,this.is_stream=o,this.mime_type=a,this.alt_text=c,this.b64=h}}class Js{type;command;meta;fileData;constructor(t,n){this.type="command",this.command=t,this.meta=n}}typeof process<"u"&&process.versions&&process.versions.node;function Hn(e,t,n){for(;n.length>1;){const s=n.shift();if(typeof s=="string"||typeof s=="number")e=e[s];else throw new Error("Invalid key type")}const r=n.shift();if(typeof r=="string"||typeof r=="number")e[r]=t;else throw new Error("Invalid key type")}async function on(e,t=void 0,n=[],r=!1,s=void 0){if(Array.isArray(e)){let i=[];return await Promise.all(e.map(async(o,a)=>{let c=n.slice();c.push(String(a));const h=await on(e[a],r?s?.parameters[a]?.component||void 0:t,c,!1,s);i=i.concat(h)})),i}else{if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:n,blob:new Blob([e]),type:t}];if(typeof e=="object"&&e!==null){let i=[];for(const o of Object.keys(e)){const a=[...n,o],c=e[o];i=i.concat(await on(c,void 0,a,!1,s))}return i}}return[]}function Zs(e,t){let n=t?.dependencies?.find(r=>r.id==e)?.queue;return n!=null?!n:!t.enable_queue}function Xs(e,t){return new Promise((n,r)=>{const s=new MessageChannel;s.port1.onmessage=(({data:i})=>{s.port1.close(),n(i)}),window.parent.postMessage(e,t,[s.port2])})}function Pt(e,t,n,r,s=!1){if(r==="input"&&!s)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(r==="output"&&s)return e;let i=[],o=0;const a=r==="input"?t.inputs:t.outputs;for(let c=0;cl.id===h)?.type==="state"){if(s)if(e.length===a.length){const l=e[o];i.push(l),o++}else i.push(null);else{o++;continue}continue}else{const l=e[o];i.push(l),o++}}return i}async function Qs(e,t,n){const r=this;await ei(r,t);const s=await on(t,void 0,[],!0,n);return(await Promise.all(s.map(async({path:o,blob:a,type:c})=>{if(!a)return{path:o,type:c};const h=await r.upload_files(e,[a]),u=h.files&&h.files[0];return{path:o,file_url:u,type:c,name:typeof File<"u"&&a instanceof File?a?.name:void 0}}))).forEach(({path:o,file_url:a,type:c,name:h})=>{if(c==="Gallery")Hn(t,a,o);else if(a){const u=new Ft({path:a,orig_name:h});Hn(t,u,o)}}),t}async function ei(e,t){if(!(e.config?.root||e.config?.root_url))throw new Error(fr);await _r(e,t)}async function _r(e,t,n=[]){for(const r in t)t[r]instanceof Js?await ti(e,t,r):typeof t[r]=="object"&&t[r]!==null&&await _r(e,t[r],[...n,r])}async function ti(e,t,n){let r=t[n];const s=e.config?.root||e.config?.root_url;if(!s)throw new Error(fr);try{let i,o;if(typeof process<"u"&&process.versions&&process.versions.node){const u=await ht(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(f=>f._),[],import.meta.url);o=(await ht(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(f=>f._),[],import.meta.url)).resolve(process.cwd(),r.meta.path),i=await u.readFile(o)}else throw new Error(Ps);const a=new Blob([i],{type:"application/octet-stream"}),c=await e.upload_files(s,[a]),h=c.files&&c.files[0];if(h){const u=new Ft({path:h,orig_name:r.meta.name||""});t[n]=u}}catch(i){console.error(Ls,i)}}async function ni(e,t,n){const r={"Content-Type":"application/json"};this.options.token&&(r.Authorization=`Bearer ${this.options.token}`);try{var s=await this.fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,...n},credentials:"include"})}catch{return[{error:ke},500]}let i,o;try{i=await s.json(),o=s.status}catch(a){i={error:`Could not parse server response: ${a}`},o=500}return[i,o]}async function ri(e,t={}){let n=!1,r=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof e=="number")this.config.dependencies.find(s=>s.id==e);else{const s=e.replace(/^\//,"");this.config.dependencies.find(i=>i.id==this.api_map[s])}return new Promise(async(s,i)=>{const o=this.submit(e,t,null,null,!0);let a;for await(const c of o)c.type==="data"&&(r&&s(a),n=!0,a=c),c.type==="status"&&(c.stage==="error"&&i(c),c.stage==="complete"&&(r=!0,n&&s(a)))})}async function _t(e,t,n){let r=t==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,s,i;try{if(s=await fetch(r),i=s.status,i!==200)throw new Error;s=await s.json()}catch{n({status:"error",load_status:"error",message:$s,detail:"NOT_FOUND"});return}if(!s||i!==200)return;const{runtime:{stage:o},id:a}=s;switch(o){case"STOPPED":case"SLEEPING":n({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;case"PAUSED":n({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:o,discussions_enabled:await Vn(a)});break;case"RUNNING":case"RUNNING_BUILDING":n({status:"running",load_status:"complete",message:"Space is running.",detail:o});break;case"BUILDING":n({status:"building",load_status:"pending",message:"Space is building...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;case"APP_STARTING":n({status:"starting",load_status:"pending",message:"Space is starting...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;default:n({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:o,discussions_enabled:await Vn(a)});break}}const pr=async(e,t)=>{let n=0;const r=12,s=5e3;return new Promise(i=>{_t(e,yn.test(e)?"space_name":"subdomain",o=>{t(o),o.status==="running"||o.status==="error"||o.status==="paused"||o.status==="space_error"?i():(o.status==="sleeping"||o.status==="building")&&(n{pr(e,t).then(i)},s)):i())})})},si=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function Vn(e){try{const t=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),n=t.headers.get("x-error-message");return!(!t.ok||n&&si.test(n))}catch{return!1}}async function ii(e,t){const n={};t&&(n.Authorization=`Bearer ${t}`);try{const r=await fetch(`https://huggingface.co/api/spaces/${e}/${bs}`,{headers:n});if(r.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:s}=await r.json();return s.current}catch(r){throw new Error(r.message)}}async function oi(e,t,n){const r={};n&&(r.Authorization=`Bearer ${n}`);const s={seconds:t};try{const i=await fetch(`https://huggingface.co/api/spaces/${e}/${Es}`,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(s)});if(i.status!==200)throw new Error("Could not set sleep timeout on duplicated Space. Please visit *ADD HF LINK TO SETTINGS* to set a timeout manually to reduce billing charges.");return await i.json()}catch(i){throw new Error(i.message)}}const Yn=["cpu-basic","cpu-upgrade","cpu-xl","t4-small","t4-medium","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","zero-a10g","h100","h100x8"];async function ai(e,t){const{token:n,private:r,hardware:s,timeout:i,auth:o}=t;if(s&&!Yn.includes(s))throw new Error(`Invalid hardware type provided. Valid types are: ${Yn.map(m=>`"${m}"`).join(",")}.`);const{http_protocol:a,host:c}=await bn(e,n);let h=null;if(o){const m=await dr(a,c,o,fetch);m&&(h=hr(m))}const u={Authorization:`Bearer ${n}`,"Content-Type":"application/json",...h?{Cookie:h.join("; ")}:{}},l=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:u})).json()).name,f=e.split("/")[1],d={repository:`${l}/${f}`};r&&(d.private=!0);let v;try{s||(v=await ii(e,n))}catch(m){throw Error(wn+m.message)}const p=s||v||"cpu-basic";d.hardware=p;try{const m=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:u,body:JSON.stringify(d)});if(m.status===409)try{return await It.connect(`${l}/${f}`,t)}catch(Ce){throw console.error("Failed to connect Client instance:",Ce),Ce}else if(m.status!==200)throw new Error(m.statusText);const q=await m.json();return await oi(`${l}/${f}`,i||300,n),await It.connect(li(q.url),t)}catch(m){throw new Error(m)}}function li(e){const t=/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/,n=e.match(t);if(n)return n[1]}const Wn="supports-zerogpu-headers";let Kn=!1;function ci(){return typeof window<"u"&&typeof document<"u"&&typeof window.addEventListener=="function"}function vr(e){return e.includes(".dev.")?`https://moon-${e.split(".")[1]}.dev.spaces.huggingface.tech`:e.endsWith(".hf.space")?"https://huggingface.co":null}function ui(){if(!ci()||Kn)return;window.addEventListener("message",t=>{t.data===Wn&&(window.supports_zerogpu_headers=!0)}),Kn=!0;const e=vr(window.location.hostname);e&&window.parent!==window&&window.parent.postMessage(Wn,e)}class fi extends TransformStream{#e="";constructor(t={allowCR:!1}){super({transform:(n,r)=>{for(n=this.#e+n;;){const s=n.indexOf(` -`),i=t.allowCR?n.indexOf("\r"):-1;if(i!==-1&&i!==n.length-1&&(s===-1||s-1>i)){r.enqueue(n.slice(0,i)),n=n.slice(i+1);continue}if(s===-1)break;const o=n[s-1]==="\r"?s-1:s;r.enqueue(n.slice(0,o)),n=n.slice(s+1)}this.#e=n},flush:n=>{if(this.#e==="")return;const r=t.allowCR&&this.#e.endsWith("\r")?this.#e.slice(0,-1):this.#e;n.enqueue(r)}})}}function di(e){let t=new TextDecoderStream,n=new fi({allowCR:!0});return e.pipeThrough(t).pipeThrough(n)}function hi(e){let n=/[:]\s*/.exec(e),r=n&&n.index;if(r)return[e.substring(0,r),e.substring(r+n[0].length)]}function Jn(e,t,n){e.get(t)||e.set(t,n)}async function*_i(e,t){if(!e.body)return;let n=di(e.body),r,s=n.getReader(),i;for(;;){if(t&&t.aborted)return s.cancel();if(r=await s.read(),r.done)return;if(!r.value){i&&(yield i),i=void 0;continue}let[o,a]=hi(r.value)||[];o==="data"?(i||={},i[o]=i[o]?i[o]+` -`+a:a):o==="event"?(i||={},i[o]=a):o==="id"?(i||={},i[o]=String(+a)===a?+a:a):o==="retry"&&(i||={},i[o]=+a||void 0)}}async function pi(e,t){let n=new Request(e,t);Jn(n.headers,"Accept","text/event-stream"),Jn(n.headers,"Content-Type","application/json");let r=await fetch(n);if(!r.ok)throw r;return _i(r,n.signal)}async function vi(){let{event_callbacks:e,unclosed_events:t,pending_stream_messages:n,stream_status:r,config:s,jwt:i}=this;const o=this;if(!s)throw new Error("Could not resolve app config");r.open=!0;let a=null,c=new URLSearchParams({session_hash:this.session_hash}).toString(),h=new URL(`${s.root}${this.api_prefix}/${lr}?${c}`);if(i&&h.searchParams.set("__sign",i),a=this.stream(h),!a){console.warn("Cannot connect to SSE endpoint: "+h.toString());return}a.onmessage=async function(u){let l=JSON.parse(u.data);if(l.msg==="close_stream"){En(r,o.abort_controller);return}const f=l.event_id;if(!f)await Promise.all(Object.keys(e).map(d=>e[d](l)));else if(e[f]&&s){l.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(s.protocol)&&t.delete(f);let d=e[f];typeof window<"u"&&typeof document<"u"?setTimeout(d,0,l):d(l)}else n[f]||(n[f]=[]),n[f].push(l)},a.onerror=async function(u){console.error(u),await Promise.all(Object.keys(e).map(l=>e[l]({msg:"broken_connection",message:ke})))}}function En(e,t){e&&(e.open=!1,t?.abort())}function mi(e,t,n){!e[t]?(e[t]=[],n.data.forEach((s,i)=>{e[t][i]=s})):n.data.forEach((s,i)=>{let o=gi(e[t][i],s);e[t][i]=o,n.data[i]=o})}function gi(e,t){return t.forEach(([n,r,s])=>{e=wi(e,r,n,s)}),e}function wi(e,t,n,r){if(t.length===0){if(n==="replace")return r;if(n==="append")return e+r;throw new Error(`Unsupported action: ${n}`)}let s=e;for(let o=0;o{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:e.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return pi(e,t).then(async r=>{n.readyState=n.OPEN;try{for await(const s of r)n.onmessage&&n.onmessage(s);n.readyState=n.CLOSED}catch(s){n.onerror&&n.onerror(s),n.readyState=n.CLOSED}}).catch(r=>{console.error(r),n.onerror&&n.onerror(r),n.readyState=n.CLOSED}),n}function bi(e,t={},n,r,s,i){try{let o=function(E){(s||cs[E.type])&&u(E)},a=function(){for(Mn=!0;ut.length>0;)ut.shift()({value:void 0,done:!0})},c=function(E){ut.length>0?ut.shift()(E):Xt.push(E)},h=function(E){c(Ei(E)),a()},u=function(E){c({value:E,done:!1})},l=function(){return Xt.length>0?Promise.resolve(Xt.shift()):Mn?Promise.resolve({value:void 0,done:!0}):new Promise(E=>ut.push(E))};const{token:f}=this.options,{fetch:d,app_reference:v,config:p,session_hash:m,api_info:q,api_map:Ce,stream_status:Ge,pending_stream_messages:He,pending_diff_streams:Ne,event_callbacks:Jt,unclosed_events:os,post_data:Zt,options:Ot,api_prefix:ge}=this,Pn=i||{"x-gradio-user":"api"},as=this;if(!q)throw new Error("No API found");if(!p)throw new Error("Could not resolve app config");let{fn_index:b,endpoint_info:Ln,dependency:lt}=Si(q,e,Ce,p),ls=zs(t,Ln),Ve,we=p.protocol??"ws";if(we==="ws")throw new Error("WebSocket protocol is not supported in this version");let Ye="",ra=()=>Ye;const k=typeof e=="number"?"/predict":e;let Rt,P=null,ye=!1,In={},ct=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const cs=Ot?.events?.reduce((E,ae)=>(E[ae]=!0,E),{})||{};async function us(){let E={},ae={};E={event_id:P},ae={event_id:P,session_hash:m,fn_index:b};try{if(!p)throw new Error("Could not resolve app config");"event_id"in ae&&await d(`${p.root}${ge}/${As}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(ae)}),await d(`${p.root}${ge}/${Ts}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(E)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const fs=async E=>{await this._resolve_heartbeat(E)};async function Dn(E){if(!p)return;let ae=E.render_id;p.components=[...p.components.filter(I=>I.props.rendered_in!==ae),...E.components],p.dependencies=[...p.dependencies.filter(I=>I.rendered_in!==ae),...E.dependencies];const Ct=p.components.some(I=>I.type==="state"),O=p.dependencies.some(I=>I.targets.some(We=>We[1]==="unload"));p.connect_heartbeat=Ct||O,await fs(p),o({type:"render",data:E,endpoint:k,fn_index:b})}const ds=this.handle_blob(p.root,ls,Ln).then(async E=>{if(Rt={data:Pt(E,lt,p.components,"input",!0)||[],event_data:n,fn_index:b,trigger_id:r},Zs(b,p))o({type:"status",endpoint:k,stage:"pending",queue:!1,fn_index:b,time:new Date}),Zt(`${p.root}${ge}/run${k.startsWith("/")?k:`/${k}`}${ct?"?"+ct:""}`,{...Rt,session_hash:m},Pn).then(async([O,I])=>{const We=O.data;if(I==200)o({type:"data",endpoint:k,fn_index:b,data:Pt(We,lt,p.components,"output",Ot.with_null_state),time:new Date,event_data:n,trigger_id:r}),O.render_config&&await Dn(O.render_config),o({type:"status",endpoint:k,fn_index:b,stage:"complete",eta:O.average_duration,queue:!1,time:new Date});else{const le=O?.error===ke;o({type:"status",stage:"error",endpoint:k,fn_index:b,message:O.error,broken:le,queue:!1,time:new Date})}}).catch(O=>{o({type:"status",stage:"error",message:O.message,endpoint:k,fn_index:b,queue:!1,time:new Date})});else if(we=="sse"){o({type:"status",stage:"pending",queue:!0,endpoint:k,fn_index:b,time:new Date});var Ct=new URLSearchParams({fn_index:b.toString(),session_hash:m}).toString();let O=new URL(`${p.root}${ge}/${lr}?${ct?ct+"&":""}${Ct}`);if(this.jwt&&O.searchParams.set("__sign",this.jwt),Ve=this.stream(O),!Ve)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+O.toString()));Ve.onmessage=async function(I){const We=JSON.parse(I.data),{type:le,status:be,data:R}=Bn(We,In[b]);if(le==="update"&&be&&!ye)o({type:"status",endpoint:k,fn_index:b,time:new Date,...be}),be.stage==="error"&&(Ve?.close(),a());else if(le==="data"){let[Ke,Pe]=await Zt(`${p.root}${ge}/queue/data`,{...Rt,session_hash:m,event_id:P});Pe!==200&&(o({type:"status",stage:"error",message:ke,queue:!0,endpoint:k,fn_index:b,time:new Date}),Ve?.close(),a())}else le==="complete"?ye=be:le==="log"?o({type:"log",title:R.title,log:R.log,level:R.level,endpoint:k,duration:R.duration,visible:R.visible,fn_index:b}):(le==="generating"||le==="streaming")&&o({type:"status",time:new Date,...be,stage:be?.stage,queue:!0,endpoint:k,fn_index:b});R&&(o({type:"data",time:new Date,data:Pt(R.data,lt,p.components,"output",Ot.with_null_state),endpoint:k,fn_index:b,event_data:n,trigger_id:r}),ye&&(o({type:"status",time:new Date,...ye,stage:be?.stage,queue:!0,endpoint:k,fn_index:b}),Ve?.close(),a()))}}else if(we=="sse_v1"||we=="sse_v2"||we=="sse_v2.1"||we=="sse_v3"){o({type:"status",stage:"pending",queue:!0,endpoint:k,fn_index:b,time:new Date});let O="";typeof window<"u"&&typeof document<"u"&&(O=window?.location?.hostname);const I=vr(O);return(typeof window<"u"&&typeof document<"u"&&window.parent!=window&&!!I&&window.supports_zerogpu_headers?Xs("zerogpu-headers",I):Promise.resolve(null)).then(R=>{const Ke={...Pn,...R||{}};return Zt(`${p.root}${ge}/${gs}?${ct}`,{...Rt,session_hash:m},Ke)}).then(async([R,Ke])=>{if(R.event_id&&(Ye=R.event_id),Ke===503)o({type:"status",stage:"error",message:cr,queue:!0,endpoint:k,fn_index:b,time:new Date,visible:!0}),a();else if(Ke===422)o({type:"status",stage:"error",message:R.detail,queue:!0,endpoint:k,fn_index:b,code:"validation_error",time:new Date,visible:!0}),a();else if(Ke!==200){const Pe=R?.error===ke;o({type:"status",stage:"error",broken:Pe,message:Pe?ke:R.detail||R.error,queue:!0,endpoint:k,fn_index:b,time:new Date,visible:!0}),a()}else{P=R.event_id,Ye=P;let Pe=async function(Qt){try{const{type:H,status:V,data:Y,original_msg:hs}=Bn(Qt,In[b]);if(H=="heartbeat")return;if(H==="update"&&V&&!ye)o({type:"status",endpoint:k,fn_index:b,time:new Date,original_msg:hs,...V});else if(H==="complete")ye=V;else if(H=="unexpected_error"||H=="broken_connection"){console.error("Unexpected error",V?.message);const _s=H==="broken_connection";o({type:"status",stage:"error",message:V?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:k,broken:_s,session_not_found:V?.session_not_found,fn_index:b,time:new Date})}else if(H==="log"){o({type:"log",title:Y.title,log:Y.log,level:Y.level,endpoint:k,duration:Y.duration,visible:Y.visible,fn_index:b});return}else(H==="generating"||H==="streaming")&&(o({type:"status",time:new Date,...V,stage:V?.stage,queue:!0,endpoint:k,fn_index:b}),Y&<.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(we)&&mi(Ne,P,Y));Y&&(o({type:"data",time:new Date,data:Pt(Y.data,lt,p.components,"output",Ot.with_null_state),endpoint:k,fn_index:b}),Y.render_config&&await Dn(Y.render_config),ye&&(o({type:"status",time:new Date,...ye,stage:V?.stage,queue:!0,endpoint:k,fn_index:b}),a())),(V?.stage==="complete"||V?.stage==="error")&&(Jt[P]&&delete Jt[P],P in Ne&&delete Ne[P],a())}catch(H){console.error("Unexpected client exception",H),o({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:k,fn_index:b,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(we)&&(En(Ge,as.abort_controller),Ge.open=!1,a())}};P in He&&(He[P].forEach(Qt=>Pe(Qt)),delete He[P]),Jt[P]=Pe,os.add(P),Ge.open||await this.open_stream()}})}});let Mn=!1;const Xt=[],ut=[],jn={[Symbol.asyncIterator]:()=>jn,next:l,throw:async E=>(h(E),l()),return:async()=>(a(),{value:void 0,done:!0}),cancel:us,send_chunk:E=>{this.post_data(`${p.root}${ge}/stream/${Ye}`,{...E,session_hash:this.session_hash})},close_stream:()=>{this.post_data(`${p.root}${ge}/stream/${Ye}/close`,{}),a()},event_id:()=>Ye,wait_for_id:async()=>(await ds,P)};return jn}catch(o){throw console.error("Submit function encountered an error:",o),o}}function Ei(e){return{then:(t,n)=>n(e)}}function Si(e,t,n,r){let s,i,o;if(typeof t=="number")s=t,i=e.unnamed_endpoints[s],o=r.dependencies.find(a=>a.id==t);else{const a=t.replace(/^\//,"");s=n[a],i=e.named_endpoints[t.trim()],o=r.dependencies.find(c=>c.id==n[a])}if(typeof s!="number")throw new Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:s,endpoint_info:i,dependency:o}}class It{app_reference;options;deep_link=null;config;api_prefix="";api_info;api_map={};session_hash=Math.random().toString(36).substring(2);jwt=!1;last_status={};cookies=null;stream_status={open:!1};closed=!1;pending_stream_messages={};pending_diff_streams={};event_callbacks={};unclosed_events=new Set;heartbeat_event=null;abort_controller=null;stream_instance=null;current_payload;get_url_config(t=null){if(!this.config)throw new Error(Se);t===null&&(t=window.location.href);const n=o=>o.replace(/^\/+|\/+$/g,"");let r=n(new URL(this.config.root).pathname),s=n(new URL(t).pathname),i;return s.startsWith(r)?i=n(s.substring(r.length)):i="",this.get_page_config(i)}get_page_config(t){if(!this.config)throw new Error(Se);let n=this.config;return t in n.page||(t=""),{...n,current_page:t,layout:n.page[t].layout,components:n.components.filter(r=>n.page[t].components.includes(r.id)),dependencies:this.config.dependencies.filter(r=>n.page[t].dependencies.includes(r.id))}}fetch(t,n){const r=new Headers(n?.headers||{});return this&&this.cookies&&r.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((i,o)=>{r.append(o,i)}),fetch(t,{...n,headers:r})}stream(t){const n=new Headers;return this&&this.cookies&&n.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((s,i)=>{n.append(i,s)}),this&&this.options.token&&n.append("Authorization",`Bearer ${this.options.token}`),this.abort_controller=new AbortController,this.stream_instance=yi(t.toString(),{credentials:"include",headers:n,signal:this.abort_controller.signal}),this.stream_instance}view_api;upload_files;upload;handle_blob;post_data;submit;predict;open_stream;resolve_config;resolve_cookies;constructor(t,n={events:["data"]}){this.app_reference=t,this.deep_link=n.query_params?.deep_link||null,n.events||(n.events=["data"]),this.options=n,this.current_payload={},n.cookies&&(this.cookies=n.cookies),this.view_api=Bs.bind(this),this.upload_files=Gs.bind(this),this.handle_blob=Qs.bind(this),this.post_data=ni.bind(this),this.submit=bi.bind(this),this.predict=ri.bind(this),this.open_stream=vi.bind(this),this.resolve_config=Ds.bind(this),this.resolve_cookies=Ms.bind(this),this.upload=Ks.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}async init(){ui(),this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:t})=>this._resolve_heartbeat(t)),this.api_info=await this.view_api(),this.api_map=Is(this.config?.dependencies||[])}async _resolve_heartbeat(t){if(t&&(this.config=t,this.api_prefix=t.api_prefix||"",this.config&&this.config.connect_heartbeat&&this.config.space_id&&this.options.token&&(this.jwt=await Fn(this.config.space_id,this.options.token,this.cookies))),t.space_id&&this.options.token&&(this.jwt=await Fn(t.space_id,this.options.token)),this.config&&this.config.connect_heartbeat){const n=new URL(`${this.config.root}${this.api_prefix}/${Ss}/${this.session_hash}`);this.jwt&&n.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(n))}}static async connect(t,n={events:["data"]}){const r=new this(t,n);return n.session_hash&&(r.session_hash=n.session_hash),await r.init(),r}async reconnect(){const t=new URL(`${this.config.root}${this.api_prefix}/${xs}`);let n;try{const r=await this.fetch(t);if(!r.ok)throw new Error;n=(await r.json()).app_id}catch{return"broken"}return n!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,En(this.stream_status,this.abort_controller)}set_current_payload(t){this.current_payload=t}static async duplicate(t,n={events:["data"]}){return ai(t,n)}async _resolve_config(){const{http_protocol:t,host:n,space_id:r}=await bn(this.app_reference,this.options.token),{status_callback:s}=this.options;r&&s&&await pr(r,s);let i;try{let o=`${t}//${n}`;if(i=await this.resolve_config(o),!i)throw new Error(Se);return this.config_success(i)}catch(o){if(r&&s)_t(r,yn.test(r)?"space_name":"subdomain",this.handle_space_success);else throw s&&s({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(o)}}async config_success(t){if(this.config=t,this.api_prefix=t.api_prefix||"",this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(n){console.error(Os+n.message)}return this.prepare_return_obj()}async handle_space_success(t){if(!this)throw new Error(Se);const{status_callback:n}=this.options;if(n&&n(t),t.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=this?.config?.api_prefix||"",!this.config)throw new Error(Se);return await this.config_success(this.config)}catch(r){throw n&&n({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),r}}async component_server(t,n,r){if(!this.config)throw new Error(Se);const s={},{token:i}=this.options,{session_hash:o}=this;i&&(s.Authorization=`Bearer ${this.options.token}`);let a,c=this.config.components.find(u=>u.id===t);c?.props?.root_url?a=c.props.root_url:a=this.config.root;let h;if(typeof r=="object"&&r!==null&&"binary"in r){const u=r;h=new FormData;for(const l in u.data)l!=="binary"&&h.append(l,u.data[l]);h.set("component_id",t.toString()),h.set("fn_name",n),h.set("session_hash",o)}else h=JSON.stringify({data:r,component_id:t,fn_name:n,session_hash:o}),s["Content-Type"]="application/json";i&&(s.Authorization=`Bearer ${i}`);try{const u=await this.fetch(`${a}${this.api_prefix}/${ks}/`,{method:"POST",body:h,headers:s,credentials:"include"});if(!u.ok)throw new Error("Could not connect to component server: "+u.statusText);return await u.json()}catch(u){console.warn(u)}}set_cookies(t){this.cookies=hr(t).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}}const ki="production",_=!ki.toLowerCase().startsWith("prod");var mr=Array.isArray,Ti=Array.prototype.indexOf,Ai=Array.from,$e=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,xi=Object.getOwnPropertyDescriptors,$i=Object.prototype,Oi=Array.prototype,gr=Object.getPrototypeOf,Zn=Object.isExtensible;function ia(e){return typeof e=="function"}const oa=()=>{};function aa(e){return typeof e?.then=="function"}function la(e){return e()}function Ri(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ca(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const $=2,gt=4,et=8,Dt=1<<24,pe=16,ie=32,Be=64,zt=128,B=512,N=1024,L=2048,oe=4096,ne=8192,ue=16384,Et=32768,wt=65536,Mt=1<<17,yr=1<<18,it=1<<19,br=1<<20,ua=1<<25,Oe=32768,an=1<<21,Bt=1<<22,Te=1<<23,Ae=Symbol("$state"),fa=Symbol("legacy props"),da=Symbol(""),Er=Symbol("proxy path"),De=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},_a=1,Gt=3,St=8;function Ht(e){if(_){const t=new Error(`lifecycle_outside_component -\`${e}(...)\` can only be used during component initialisation -https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ci(){if(_){const e=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function pa(){if(_){const e=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function Ni(){if(_){const e=new Error(`derived_references_self -A derived value cannot reference itself recursively -https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function Pi(e){if(_){const t=new Error(`effect_in_teardown -\`${e}\` cannot be used inside an effect cleanup function -https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Li(){if(_){const e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ii(e){if(_){const t=new Error(`effect_orphan -\`${e}\` can only be used inside an effect (e.g. during component initialisation) -https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Di(){if(_){const e=new Error(`effect_update_depth_exceeded -Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state -https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function va(){if(_){const e=new Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invalid_snippet")}function ma(e){if(_){const t=new Error(`props_invalid_value -Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value -https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function ga(e){if(_){const t=new Error(`props_rest_readonly -Rest element properties of \`$props()\` such as \`${e}\` are readonly -https://svelte.dev/e/props_rest_readonly`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_rest_readonly")}function Mi(e){if(_){const t=new Error(`rune_outside_svelte -The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files -https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function ji(){if(_){const e=new Error("set_context_after_init\n`setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\nhttps://svelte.dev/e/set_context_after_init");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/set_context_after_init")}function qi(){if(_){const e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ui(){if(_){const e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Fi(){if(_){const e=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zi(){if(_){const e=new Error("svelte_boundary_reset_onerror\nA `` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const wa=1,ya=2,ba=4,Ea=8,Sa=16,ka=1,Ta=2,Aa=4,xa=8,$a=16,Oa=1,Ra=2,Ca=4,Sr=1,Bi=2,Gi="[",kr="[!",Tr="]",Vt={},C=Symbol(),Hi=Symbol("filename"),Na="http://www.w3.org/1999/xhtml",Pa="http://www.w3.org/2000/svg",La="@attach";var ve="font-weight: bold",me="font-weight: normal";function Ia(e,t,n){_?console.warn(`%c[svelte] hydration_attribute_changed -%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${n}\`, will be ignored in favour of the server value -https://svelte.dev/e/hydration_attribute_changed`,ve,me):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Da(e){_?console.warn(`%c[svelte] hydration_html_changed -%c${e?`The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"} -https://svelte.dev/e/hydration_html_changed`,ve,me):console.warn("https://svelte.dev/e/hydration_html_changed")}function Yt(e){_?console.warn(`%c[svelte] hydration_mismatch -%cHydration failed because the initial UI does not match what was rendered on the server -https://svelte.dev/e/hydration_mismatch`,ve,me):console.warn("https://svelte.dev/e/hydration_mismatch")}function Vi(){_?console.warn(`%c[svelte] lifecycle_double_unmount -%cTried to unmount a component that was not mounted -https://svelte.dev/e/lifecycle_double_unmount`,ve,me):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Ma(){_?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a ` - - - ${this.animations.length>1?ot``:""} - `),this.materialVariants.length>1&&e.push(ot` - - `),e.push(ot` - - `),this._hasHotSpots&&e.push(ot` -
                - - - -
                - `);const t=e.length,i=ot`
                `;e=e.reduce((s,r,n)=>n0?ot`
                ${e}
                `:ot``}_renderReloadButton(){return ot`${this._isFaulted?ot` - - `:""}`}_renderOverlay(){return ot` - - ${this._renderProgressBar()} - ${this._renderToolbar()} - ${this._renderReloadButton()} - `}_dispatchCustomEvent(e,t){this.dispatchEvent(t(e))}_onSelectedAnimationChanged(e){const t=e.target;this.selectedAnimation=Number(t.value)}_onAnimationSpeedChanged(e){const t=e.target;this.animationSpeed=Number(t.value)}_onAnimationTimelineChanged(e){if(this._viewerDetails){const t=e.target,i=Number(t.value);i!==this.animationProgress&&(this._viewerDetails.viewer.animationProgress=i)}}_onAnimationTimelinePointerDown(e){this._viewerDetails?.viewer.isAnimationPlaying&&(this._viewerDetails.viewer.pauseAnimation(),e.target.addEventListener("pointerup",()=>this._viewerDetails?.viewer.playAnimation(),{once:!0}))}_onMaterialVariantChanged(e){const t=e.target;this.selectedMaterialVariant=t.value}_onHotSpotsChanged(e){const t=e.target,i=t.value;t.value="",this.focusHotSpot(i)}_onAnimationSliderChanged(e){this._animationSliderResizeObserver?.disconnect(),e&&(this._animationSliderResizeObserver=new ResizeObserver(()=>{this._showAnimationSlider=e.clientWidth>=80}),this._animationSliderResizeObserver.observe(e))}_createPropertyBinding(e,t,i,s){return{property:e,onInitialized:r=>{t(r).add(()=>{s(r)}),i(r)},updateViewer:()=>{this._viewerDetails&&i(this._viewerDetails)}}}async _setupViewer(){await this._viewerLock.lockAsync(async()=>{if(this._canvasContainer||await this.updateComplete,this._canvasContainer&&!this._viewerDetails){const e=document.createElement("canvas");e.className="full-size canvas",e.setAttribute("touch-action","none"),this._canvasContainer.appendChild(e);{const i=new Vn,s=this,r=await this._createViewer(e,new Proxy(this._options,{get(o,h){switch(h){case"engine":return s.engine??o.engine;case"autoSuspendRendering":return!(s.hasAttribute("render-when-idle")||o.autoSuspendRendering===!1);case"source":return s.getAttribute("source")??o.source;case"environmentLighting":return s.getAttribute("environment-lighting")??s.getAttribute("environment")??o.environmentLighting;case"environmentSkybox":return s.getAttribute("environment-skybox")??s.getAttribute("environment")??o.environmentSkybox;case"environmentConfig":return{intensity:mi(s.getAttribute("environment-intensity"))??o.environmentConfig?.intensity,blur:mi(s.getAttribute("skybox-blur"))??o.environmentConfig?.blur,rotation:mi(s.getAttribute("environment-rotation"))??o.environmentConfig?.rotation};case"shadowConfig":return{quality:n_(s.getAttribute("shadow-quality"))??o.shadowConfig?.quality};case"cameraOrbit":return Tr(s.getAttribute("camera-orbit"))??o.cameraOrbit;case"cameraTarget":return Tr(s.getAttribute("camera-target"))??o.cameraTarget;case"cameraAutoOrbit":return{enabled:s.hasAttribute("camera-auto-orbit")||o.cameraAutoOrbit?.enabled,speed:mi(s.getAttribute("camera-auto-orbit-speed"))??o.cameraAutoOrbit?.speed,delay:mi(s.getAttribute("camera-auto-orbit-delay"))??o.cameraAutoOrbit?.delay};case"animationAutoPlay":return s.hasAttribute("animation-auto-play")||o.animationAutoPlay;case"animationSpeed":return mi(s.getAttribute("animation-speed"))??o.animationSpeed;case"selectedAnimation":return mi(s.getAttribute("selected-animation"))??o.selectedAnimation;case"postProcessing":return{toneMapping:r_(s.getAttribute("tone-mapping"))??o.postProcessing?.toneMapping,contrast:mi(s.getAttribute("contrast"))??o.postProcessing?.contrast,exposure:mi(s.getAttribute("exposure"))??o.postProcessing?.exposure,ssao:s.hasAttribute("ssao")||o.postProcessing?.ssao};case"selectedMaterialVariant":return s.getAttribute("material-variant")??o.selectedMaterialVariant;case"onInitialized":return l=>{o.onInitialized?.(l),i.resolve(l)};case"onFaulted":return l=>{s._isFaultedBacking=!0,o.onFaulted?.(l),s._tearDownViewer()};default:return o[h]}}})),n=await i.promise;this._viewerDetails=Object.assign(n,{viewer:r})}const t=this._viewerDetails;t.viewer.onEnvironmentChanged.add(()=>{this._dispatchCustomEvent("environmentchange",i=>new Event(i))}),t.viewer.onEnvironmentConfigurationChanged.add(()=>{this._dispatchCustomEvent("environmentconfigurationchange",i=>new Event(i))}),t.viewer.onEnvironmentError.add(i=>{this._dispatchCustomEvent("environmenterror",s=>new ErrorEvent(s,{error:i}))}),t.viewer.onShadowsConfigurationChanged.add(()=>{this._dispatchCustomEvent("shadowsconfigurationchange",i=>new Event(i))}),t.viewer.onModelChanged.add(i=>{this._animations=[...t.viewer.animations],this._dispatchCustomEvent("modelchange",s=>new CustomEvent(s,{detail:i}))}),t.viewer.onModelError.add(i=>{this._animations=[...t.viewer.animations],this._dispatchCustomEvent("modelerror",s=>new ErrorEvent(s,{error:i}))}),t.viewer.onLoadingProgressChanged.add(()=>{this._loadingProgress=t.viewer.loadingProgress,this._dispatchCustomEvent("loadingprogresschange",i=>new Event(i))}),t.viewer.onSelectedAnimationChanged.add(()=>{this._dispatchCustomEvent("selectedanimationchange",i=>new Event(i))}),t.viewer.onIsAnimationPlayingChanged.add(()=>{this._isAnimationPlaying=t.viewer.isAnimationPlaying??!1,this._dispatchCustomEvent("animationplayingchange",i=>new Event(i))}),t.viewer.onAnimationProgressChanged.add(()=>{this.animationProgress=t.viewer.animationProgress??0,this._dispatchCustomEvent("animationprogresschange",i=>new Event(i))}),t.viewer.onSelectedMaterialVariantChanged.add(()=>{this._dispatchCustomEvent("selectedmaterialvariantchange",i=>new Event(i))}),t.scene.onAfterRenderCameraObservable.add(()=>{this._dispatchCustomEvent("viewerrender",i=>new Event(i))}),this._propertyBindings.forEach(i=>i.onInitialized(t)),this._dispatchCustomEvent("viewerready",i=>new Event(i))}this._isFaultedBacking=!1})}async _createViewer(e,t){return await ul(e,Object.assign(t,{viewerClass:this._viewerClass}))}async _tearDownViewer(){await this._viewerLock.lockAsync(async()=>{this._viewerDetails&&(this._viewerDetails.viewer.dispose(),this._viewerDetails=void 0),this._loadingProgress=!1,this._canvasContainer&&this._canvasContainer.firstElementChild&&this._canvasContainer.removeChild(this._canvasContainer.firstElementChild)})}async _updateModel(){if(this._viewerDetails)try{this.source?await this._viewerDetails.viewer.loadModel(this.source,{pluginExtension:this.extension??void 0}):await this._viewerDetails.viewer.resetModel()}catch(e){e instanceof Ot||w.Error(e)}}async _updateEnv(e){if(this._viewerDetails)try{const t=[];e.lighting&&e.skybox&&this.environmentLighting===this.environmentSkybox?t.push([this.environmentLighting,{lighting:!0,skybox:!0}]):(e.lighting&&t.push([this.environmentLighting,{lighting:!0}]),e.skybox&&t.push([this.environmentSkybox,{skybox:!0}]));const i=t.map(async([s,r])=>{s?await this._viewerDetails?.viewer.loadEnvironment(s,r):await this._viewerDetails?.viewer.resetEnvironment(r)});await Promise.all(i)}catch(t){t instanceof Ot||w.Error(t)}}async _updateShadows(e){if(e)try{const t={quality:e};await this._viewerDetails?.viewer.updateShadows(t)}catch(t){t instanceof Ot||w.Error(t)}}}Se.styles=sl` - :host { - --ui-foreground-color: white; - --ui-background-hue: 233; - --ui-background-saturation: 8%; - --ui-background-lightness: 39%; - --ui-background-opacity: 0.75; - --ui-background-color: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), var(--ui-background-opacity)); - --ui-background-color-hover: hsla( - var(--ui-background-hue), - var(--ui-background-saturation), - calc(var(--ui-background-lightness) - 10%), - calc(var(--ui-background-opacity) - 0.1) - ); - all: inherit; - overflow: hidden; - } - - .full-size { - display: block; - position: relative; - width: 100%; - height: 100%; - } - - .canvas { - outline: none; - } - - .children-slot { - position: absolute; - top: 0; - background: transparent; - pointer-events: none; - } - - .reload-button { - position: absolute; - top: 50%; - left: 50%; - width: 25%; - transform: translate(-50%, -50%); - color: var(--ui-foreground-color); - background-color: var(--ui-background-color); - border: 1px solid transparent; - border-radius: 24px; - padding: 0; - cursor: pointer; - outline: none; - } - - .reload-button:hover { - background-color: var(--ui-background-color-hover); - } - - .bar { - position: absolute; - width: calc(100% - 24px); - min-width: 370px; - max-width: 1280px; - left: 50%; - transform: translateX(-50%); - background-color: var(--ui-background-color); - } - - .bar-min { - width: unset; - min-width: unset; - max-width: unset; - } - - .loading-progress-outer { - height: 4px; - border-radius: 4px; - border: 1px solid var(--ui-background-color); - outline: none; - top: 12px; - pointer-events: none; - transition: opacity 0.5s ease; - } - - .loading-progress-outer-inactive { - opacity: 0; - /* Set the background color to the foreground color while in the inactive state so that the color seen is correct while fading out the opacity. */ - background-color: var(--ui-foreground-color); - } - - .loading-progress-inner { - width: 0; - height: 100%; - border-radius: inherit; - background-color: var(--ui-foreground-color); - transition: width 0.3s linear; - } - - /* The right side of the inner progress bar starts aligned with the left side of the outer progress bar (container). - So, if the width is 30%, then the left side of the inner progress bar moves a total of 130% of the width of the container. - This is why the first keyframe is at 23% ((100/130)*30). - */ - @keyframes indeterminate { - 0% { - left: 0%; - width: 0%; - } - 23% { - left: 0%; - width: 30%; - } - 77% { - left: 70%; - width: 30%; - } - 100% { - left: 100%; - width: 0%; - } - } - - .loading-progress-inner-indeterminate { - position: absolute; - animation: indeterminate 1.5s infinite; - animation-timing-function: linear; - } - - .tool-bar { - display: flex; - flex-direction: row; - align-items: center; - border-radius: 12px; - border-color: var(--ui-foreground-color); - height: 48px; - bottom: 12px; - color: var(--ui-foreground-color); - -webkit-tap-highlight-color: transparent; - } - - .tool-bar * { - height: 100%; - min-width: 48px; - } - - .tool-bar .divider { - min-width: 1px; - margin: 0px 6px; - height: 66%; - background-color: var(--ui-foreground-color); - } - - .tool-bar select { - background: none; - min-width: 52px; - max-width: 128px; - border: 1px solid transparent; - border-radius: inherit; - color: inherit; - font-size: 14px; - padding: 0px 12px; - cursor: pointer; - outline: none; - appearance: none; /* Remove default styling */ - -webkit-appearance: none; /* Remove default styling for Safari */ - } - - .tool-bar .select-container { - position: relative; - display: flex; - border-radius: inherit; - border-width: 0; - padding: 0; - } - - .tool-bar .select-container select { - position: absolute; - min-width: 0; - width: 100%; - } - - .tool-bar .select-container button { - position: absolute; - border-width: 0; - } - - .tool-bar select:hover, - .tool-bar select:focus { - background-color: var(--ui-background-color-hover); - } - - .tool-bar select option { - background-color: var(--ui-background-color); - color: var(--ui-foreground-color); - } - - .tool-bar select:focus-visible { - border-color: inherit; - } - - .tool-bar button { - background: none; - border: 1px solid transparent; - border-radius: inherit; - color: inherit; - padding: 0; - cursor: pointer; - outline: none; - } - - .tool-bar button:hover { - background-color: var(--ui-background-color-hover); - } - - .tool-bar button:focus-visible { - border-color: inherit; - } - - .tool-bar button svg { - width: 32px; - height: 32px; - } - - .animation-timeline { - display: flex; - flex: 1; - position: relative; - overflow: hidden; - cursor: pointer; - align-items: center; - border-radius: inherit; - border-color: inherit; - } - - .animation-timeline-input { - -webkit-appearance: none; - cursor: pointer; - width: 100%; - height: 100%; - outline: none; - border: 1px solid transparent; - border-radius: inherit; - padding: 0 12px; - background-color: transparent; - } - - .animation-timeline-input:focus-visible { - border-color: inherit; - } - - /*Chrome -webkit */ - - .animation-timeline-input::-webkit-slider-thumb { - -webkit-appearance: none; - width: 20px; - height: 20px; - border: 2px solid; - color: var(--ui-foreground-color); - border-radius: 50%; - background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1); - margin-top: -10px; - } - - .animation-timeline-input::-webkit-slider-runnable-track { - height: 2px; - -webkit-appearance: none; - background-color: var(--ui-foreground-color); - } - - /** FireFox -moz */ - - .animation-timeline-input::-moz-range-progress { - height: 2px; - background-color: var(--ui-foreground-color); - } - - .animation-timeline-input::-moz-range-thumb { - width: 16px; - height: 16px; - border: 2px solid var(--ui-foreground-color); - border-radius: 50%; - background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1); - } - - .animation-timeline-input::-moz-range-track { - height: 2px; - background: var(--ui-foreground-color); - } - `;T([lr()],Se.prototype,"_isFaultedBacking",void 0);T([Be({converter:s_})],Se.prototype,"engine",void 0);T([Be({attribute:"render-when-idle",type:Boolean})],Se.prototype,"renderWhenIdle",void 0);T([Be()],Se.prototype,"source",void 0);T([Be()],Se.prototype,"extension",void 0);T([Be({hasChanged:(a,e)=>a.lighting!==e.lighting||a.skybox!==e.skybox})],Se.prototype,"environment",null);T([Be({attribute:"environment-lighting"})],Se.prototype,"environmentLighting",void 0);T([Be({attribute:"environment-skybox"})],Se.prototype,"environmentSkybox",void 0);T([Be({type:Number,attribute:"environment-intensity"})],Se.prototype,"environmentIntensity",void 0);T([Be({type:Number,attribute:"environment-rotation"})],Se.prototype,"environmentRotation",void 0);T([Be({attribute:"shadow-quality"})],Se.prototype,"shadowQuality",void 0);T([lr()],Se.prototype,"_loadingProgress",void 0);T([Be({attribute:"skybox-blur"})],Se.prototype,"skyboxBlur",void 0);T([Be({attribute:"tone-mapping",converter:a=>!a||!Jh(a)?"neutral":a})],Se.prototype,"toneMapping",void 0);T([Be()],Se.prototype,"contrast",void 0);T([Be()],Se.prototype,"exposure",void 0);T([Be({type:String})],Se.prototype,"ssao",void 0);T([Be({attribute:"clear-color",converter:{fromAttribute:i_,toAttribute:a=>a?a.toHexString():null}})],Se.prototype,"clearColor",void 0);T([Be({attribute:"camera-auto-orbit",type:Boolean})],Se.prototype,"cameraAutoOrbit",void 0);T([Be({attribute:"camera-auto-orbit-speed",type:Number})],Se.prototype,"cameraAutoOrbitSpeed",void 0);T([Be({attribute:"camera-auto-orbit-delay",type:Number})],Se.prototype,"cameraAutoOrbitDelay",void 0);T([Be({attribute:"hotspots",converter:a=>a?JSON.parse(a):{}})],Se.prototype,"hotSpots",void 0);T([Be({attribute:"animation-auto-play",type:Boolean})],Se.prototype,"animationAutoPlay",void 0);T([Be({attribute:"selected-animation",type:Number})],Se.prototype,"selectedAnimation",void 0);T([Be({attribute:"animation-speed"})],Se.prototype,"animationSpeed",void 0);T([Be({attribute:!1})],Se.prototype,"animationProgress",void 0);T([lr()],Se.prototype,"_animations",void 0);T([lr()],Se.prototype,"_isAnimationPlaying",void 0);T([lr()],Se.prototype,"_showAnimationSlider",void 0);T([Be({attribute:"material-variant"})],Se.prototype,"selectedMaterialVariant",void 0);T([Be({attribute:"cameras-as-hotspots",type:Boolean})],Se.prototype,"camerasAsHotSpots",void 0);T([Be({attribute:"reset-mode",converter:a_})],Se.prototype,"resetMode",void 0);T([ll("#canvasContainer")],Se.prototype,"_canvasContainer",void 0);T([ll("#hotSpotSelect")],Se.prototype,"_hotSpotSelect",void 0);let Nr=class extends Se{constructor(e){super(Yn,e)}};Nr=T([hl("babylon-viewer")],Nr);function o_(a,e){customElements.define(a,class extends Nr{constructor(){super(e)}})}let Js=class extends _s{constructor(){super(...arguments),this._internals=this.attachInternals(),this._mutationObserver=new MutationObserver(e=>{e.some(t=>t.type==="childList")&&this._sanitizeInnerHTML()}),this._viewerAttachment=null,this._connectingAbortController=null,this._updateAnnotation=null,this.hotSpot=""}connectedCallback(){super.connectedCallback(),this._internals.states?.add("invalid"),this._connectingAbortController?.abort(),this._connectingAbortController=new AbortController;const e=this._connectingAbortController.signal;(async()=>{if(this.parentElement?.matches(":not(:defined)")&&(await customElements.whenDefined(this.parentElement?.tagName.toLowerCase()),e.aborted))return;if(!(this.parentElement instanceof Se)){console.warn("The babylon-viewer-annotation element must be a child of a babylon-viewer element.");return}this._mutationObserver.observe(this,{childList:!0,characterData:!0}),this._sanitizeInnerHTML();const t=this.parentElement,i=new Kn,s=this._updateAnnotation=()=>{if(this.hotSpot)if(t.queryHotSpot(this.hotSpot,i)){const[r,n]=i.screenPosition;this.style.transform=`translate(${r}px, ${n}px)`,this._internals.states?.delete("invalid"),i.visibility<=0?this._internals.states?.add("back-facing"):this._internals.states?.delete("back-facing")}else this._internals.states?.add("invalid")};this._updateAnnotation(),t.addEventListener("viewerrender",s),this._viewerAttachment={dispose(){t.removeEventListener("viewerrender",s)}}})()}disconnectedCallback(){super.disconnectedCallback(),this._connectingAbortController?.abort(),this._connectingAbortController=null,this._viewerAttachment?.dispose(),this._viewerAttachment=null,this._internals.states?.add("invalid"),this._updateAnnotation=null}render(){return ot`
                ${this.hotSpot}
                `}update(e){super.update(e),e.has("hotSpot")&&this._updateAnnotation?.()}_sanitizeInnerHTML(){this.innerHTML.trim().length===0&&(this.innerHTML="")}};Js.styles=sl` - :host { - --annotation-foreground-color: black; - --annotation-background-color: white; - display: inline-block; - position: absolute; - transition: opacity 0.25s; - } - - :host([hidden]) { - display: none; - } - - :host(:state(back-facing)) { - opacity: 0.2; - } - - :host(:state(invalid)) { - display: none; - } - - .annotation { - transform: translate(-50%, -135%); - font-size: 14px; - padding: 0px 6px; - border-radius: 6px; - color: var(--annotation-foreground-color); - background-color: var(--annotation-background-color); - } - - .annotation::after { - content: ""; - position: absolute; - left: 50%; - height: 60%; - aspect-ratio: 1; - transform: translate(-50%, 110%) rotate(-45deg); - background-color: inherit; - clip-path: polygon(0 0, 100% 100%, 0 100%, 0 0); - } - `;T([Be({attribute:"hotspot"})],Js.prototype,"hotSpot",void 0);Js=T([hl("babylon-viewer-annotation")],Js);const L_=Object.freeze(Object.defineProperty({__proto__:null,ConfigureCustomViewerElement:o_,CreateHotSpotFromCamera:tl,CreateViewerForCanvas:ul,DefaultViewerOptions:Je,get HTML3DAnnotationElement(){return Js},get HTML3DElement(){return Nr},Viewer:Yn,ViewerElement:Se,ViewerHotSpotResult:Kn},Symbol.toStringTag,{value:"Module"}));export{sh as $,H as A,De as B,q as C,ss as D,vh as E,nh as F,Oi as G,oh as H,Et as I,b as J,ah as K,w as L,P as M,Jo as N,O,ka as P,qc as Q,nt as R,We as S,z as T,_h as U,_ as V,ue as W,gh as X,qo as Y,ph as Z,T as _,re as a,ua as a$,Ue as a0,th as a1,jo as a2,rh as a3,$o as a4,eh as a5,Zo as a6,U as a7,Dh as a8,Ih as a9,je as aA,be as aB,Mo as aC,$u as aD,rt as aE,yi as aF,rf as aG,ye as aH,me as aI,j as aJ,y as aK,Bi as aL,Vn as aM,M_ as aN,S_ as aO,Xr as aP,te as aQ,gu as aR,A_ as aS,E_ as aT,b_ as aU,_u as aV,T_ as aW,R_ as aX,xh as aY,ms as aZ,Me as a_,Ph as aa,Bd as ab,Si as ac,Oe as ad,B as ae,At as af,l_ as ag,Q as ah,ge as ai,Gh as aj,C_ as ak,ih as al,u_ as am,qe as an,W as ao,Ai as ap,Te as aq,Hr as ar,k as as,So as at,Dr as au,Lt as av,sf as aw,Ps as ax,js as ay,vl as az,tt as b,zt as b$,yh as b0,J as b1,Kc as b2,m_ as b3,p_ as b4,Yc as b5,gt as b6,hi as b7,co as b8,fe as b9,Ve as bA,Wr as bB,Qt as bC,ve as bD,Rn as bE,g_ as bF,Ks as bG,Xs as bH,sr as bI,Ru as bJ,et as bK,f_ as bL,ja as bM,gr as bN,Ln as bO,Li as bP,xs as bQ,P_ as bR,Kh as bS,Kd as bT,__ as bU,wn as bV,Ir as bW,Dc as bX,ze as bY,d_ as bZ,Eo as b_,ct as ba,kn as bb,Gc as bc,Gr as bd,ie as be,qa as bf,Ct as bg,ae as bh,Ae as bi,qs as bj,nr as bk,ii as bl,Ii as bm,V as bn,tr as bo,Tt as bp,Qa as bq,Rl as br,Au as bs,Eu as bt,bu,Tu as bv,mu as bw,pu as bx,vt as by,Ds as bz,v as c,Cc as c0,Mc as c1,y_ as c2,Un as c3,Za as c4,oi as c5,K as c6,ic as c7,na as c8,sc as c9,ir as ca,Zl as cb,Ac as cc,Ec as cd,Ti as ce,od as cf,sd as cg,bs as ch,gd as ci,nd as cj,Lo as ck,fd as cl,md as cm,pd as cn,Td as co,bd as cp,Uh as cq,Ed as cr,mh as cs,wo as ct,_d as cu,x_ as cv,I_ as cw,L_ as cx,se as d,le as e,qt as f,c_ as g,Bn as h,On as i,tf as j,ud as k,ne as l,$ as m,it as n,F as o,lh as p,fh as q,su as r,R as s,iu as t,It as u,Ne as v,ch as w,hh as x,uh as y,dh as z}; diff --git a/assets/index-XumPGXes.js b/assets/index-XumPGXes.js deleted file mode 100644 index 6b46b03b73f36444784d9689afa8a97096172e02..0000000000000000000000000000000000000000 --- a/assets/index-XumPGXes.js +++ /dev/null @@ -1,6 +0,0 @@ -import{P as st,a as Q,b as v,m as it,N as Ee,s as Ie,T as H,p as ot,t as m,d as X,E as P,n as z,L as fe,o as at,q as lt,r as ht,u as ft,v as ut,w as dt,x as pt,y as ct,z as mt,f as Me,g as gt,A as kt,B as ue,F as Lt}from"./Code-Bhm2YgEI.js";import{html as bt,htmlCompletionSource as wt}from"./index-Bmu7HJDW.js";import"./i18n-CPHyzK9b.js";import"./index-DydPgVMC.js";import"./index-CBtYSz1X.js";import"./index-D-RUc-cS.js";import"./index-eP3_EJ4x.js";class _{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new _(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return O(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(A(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function A(t){return t==32||t==9||t==10||t==13}function O(t,e=0){for(;er&&A(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||A(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||nt.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function Re(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(i)return t.append(k(u.Comment,r,r+1+i[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(k(u.ProcessingInstruction,r,r+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return a?t.append(k(u.HTMLTag,r,r+1+a[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let n=r+1;for(;t.char(n)==e;)n++;let s=t.slice(r-1,r),i=t.slice(n,n+1),o=F.test(s),a=F.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),p=!l&&(!o||h||a),d=f&&(e==42||!p||o),c=p&&(e==42||!f||a);return t.append(new C(e==95?_e:je,r,n,(d?1:0)|(c?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(k(u.HardBreak,r,r+2));if(e==32){let n=r+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=r+2)return t.append(k(u.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new C(M,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new C(j,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let s=t.parts[n];if(s instanceof C&&(s.type==M||s.type==j)){if(!s.side||t.skipSpace(s.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[n]=null,-1;let i=t.takeContent(n),o=t.parts[n]=Mt(t,i,s.type==M?u.Link:u.Image,s.from,r+1);if(s.type==M)for(let a=0;ae?k(u.URL,e+r,i+r):i==t.length?null:!1}}function Qe(t,e,r){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let s=n==40?41:n;for(let i=e+1,o=!1;i=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,n,s,i){return this.append(new C(e,r,n,(s?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let r=this.parts[e];if(r instanceof C&&(r.type==M||r.type==j))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;l--){let g=this.parts[l];if(g instanceof C&&g.side&1&&g.type==s.type&&!(i&&(s.side&1||g.side&2)&&(g.to-g.from+o)%3==0&&((g.to-g.from)%3||o%3))){a=g;break}}if(!a)continue;let h=s.type.resolve,f=[],p=a.from,d=s.to;if(i){let g=Math.min(2,a.to-a.from,o);p=a.to-g,d=s.from+g,h=g==1?"Emphasis":"StrongEmphasis"}a.type.mark&&f.push(this.elt(a.type.mark,p,a.to));for(let g=l+1;g=0;r--){let n=this.parts[r];if(n instanceof C&&n.type==e&&n.side&1)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}getDelimiterAt(e){let r=this.parts[e];return r instanceof C?r:null}skipSpace(e){return O(this.text,e-this.offset)+this.offset}elt(e,r,n,s){return typeof e=="string"?k(this.parser.getNodeType(e),r,n,s):new Ue(e,r)}}ae.linkStart=M;ae.imageStart=j;function re(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),n=0;for(let s of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let i=this.fragment.to;for(;i>0&&this.input.read(i-1,i)!=` -`;)i--;this.fragmentEnd=i?i-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let s=e+this.fragment.offset;for(;n.to<=s;)if(!n.parent())return!1;for(;;){if(n.from>=s)return this.fragment.from<=r;if(!n.childAfter(s))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(v.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,l=o,h=a;for(;;){if(r.to-n>s){if(r.type.isAnonymous&&r.firstChild())continue;break}let f=Ve(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,f);else{let p=new H(e.parser.nodeSet.types[u.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,r.tree),e.addNode(p,f)}if(r.type.is("Block")&&(Ht.indexOf(r.type.id)<0?(o=r.to-n,a=e.block.children.length):(o=l,a=h),l=r.to-n,h=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}}function Ve(t,e){let r=t;for(let n=1;n$[t]),Object.keys($).map(t=>De[t]),Object.keys($),Bt,He,Object.keys(G).map(t=>G[t]),Object.keys(G),[]);function yt(t,e,r){let n=[];for(let s=t.firstChild,i=e;;s=s.nextSibling){let o=s?s.from:r;if(o>i&&n.push({from:i,to:o}),!s)break;i=s.to}return n}function Rt(t){let{codeParser:e,htmlParser:r}=t;return{wrap:ot((s,i)=>{let o=s.type.id;if(e&&(o==u.CodeBlock||o==u.FencedCode)){let a="";if(o==u.FencedCode){let h=s.node.getChild(u.CodeInfo);h&&(a=i.read(h.from,h.to))}let l=e(a);if(l)return{parser:l,overlay:h=>h.type.id==u.CodeText,bracketed:o==u.FencedCode}}else if(r&&(o==u.HTMLBlock||o==u.HTMLTag||o==u.CommentBlock))return{parser:r,overlay:yt(s.node,s.from,s.to)};return null})}}const Ot={resolve:"Strikethrough",mark:"StrikethroughMark"},Tt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":m.strikethrough}},{name:"StrikethroughMark",style:m.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),s=t.slice(r+2,r+3),i=/\s|^$/.test(n),o=/\s|^$/.test(s),a=F.test(n),l=F.test(s);return t.addDelimiter(Ot,r,r+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function T(t,e,r=0,n,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{n.push(t.elt("TableCell",s+a,s+l,t.parser.parseInline(e.slice(a,l),s+a)))};for(let p=r;p-1)&&i++,o=!1,n&&(a>-1&&f(),n.push(t.elt("TableDelimiter",p+s,p+s+1))),a=l=-1):(h||d!=32&&d!=9)&&(a<0&&(a=p),l=p+1),h=!h&&d==92}return a>-1&&(i++,n&&f()),i}function ge(t,e){for(let r=e;rs instanceof ke)||!ge(e.text,e.basePos))return!1;let n=t.peekLine();return Ge.test(n)&&T(t,e.text,e.basePos)==T(t,n,e.basePos)},before:"SetextHeading"}]};class Dt{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Ft={defineNodes:[{name:"Task",block:!0,style:m.list},{name:"TaskMarker",style:m.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Dt:null},after:"SetextHeading"}]},Le=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,be=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Xt=/[\w-]+\.[\w-]+($|\/)/,we=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Se=/\/[a-zA-Z\d@.]+/gy;function Ce(t,e,r,n){let s=0;for(let i=e;i-1)return-1;let n=e+r[0].length;for(;;){let s=t[n-1],i;if(/[?!.,:*_~]/.test(s)||s==")"&&Ce(t,e,n,")")>Ce(t,e,n,"("))n--;else if(s==";"&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+i.index;else break}return n}function Ae(t,e){we.lastIndex=e;let r=we.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const Ut={parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;Le.lastIndex=n;let s=Le.exec(t.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=$t(t.text,n+s[0].length),i>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,i));i=n+o[0].length}}else s[3]?i=Ae(t.text,n):(i=Ae(t.text,n+s[0].length),i>-1&&s[0]=="xmpp:"&&(Se.lastIndex=i,s=Se.exec(t.text),s&&(i=s.index+s[0].length)));return i<0?-1:(t.addElement(t.elt("URL",r,i+t.offset)),i+t.offset)}}]},_t=[zt,Ft,Tt,Ut];function Ke(t,e,r){return(n,s,i)=>{if(s!=t||n.char(i+1)==t)return-1;let o=[n.elt(r,i,i+1)];for(let a=i+1;a"}}}),Ye=new v,We=Nt.configure({props:[Me.add(t=>!t.is("Block")||t.is("Document")||ne(t)!=null||Zt(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),Ye.add(ne),gt.add({Document:()=>null}),kt.add({Document:Je})]});function ne(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Zt(t){return t.name=="OrderedList"||t.name=="BulletList"}function Vt(t,e){let r=t;for(;;){let n=r.nextSibling,s;if(!n||(s=ne(n.type))!=null&&s<=e)break;r=n}return r.to}const Gt=dt.of((t,e,r)=>{for(let n=X(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:i}}return null});function le(t){return new ft(Je,t,[],"markdown")}const Kt=le(We),Jt=We.configure([_t,qt,jt,Qt,{props:[Me.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),q=le(Jt);function Yt(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=ue.matchLanguageName(t,r,!0),n instanceof ue)return n.support?n.support.language.parser:Lt.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class K{constructor(e,r,n,s,i,o,a){this.node=e,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=i,this.type=o,this.item=a}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+tt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function et(t,e){let r=[],n=[];for(let s=t;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let i=r[s],o,a=e.lineAt(i.from),l=i.from-a.from;if(i.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))n.push(new K(i,l,l+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let h=o[3],f=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),f-=4),n.push(new K(i.parent,l,l+f,o[1],h,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let h=o[4],f=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),f-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),n.push(new K(i.parent,l,l+f,o[1],h,p,i))}}return n}function tt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function J(t,e,r,n=0){for(let s=-1,i=t;;){if(i.name=="ListItem"){let a=tt(i,e),l=+a[2];if(s>=0){if(l!=s+1)return;r.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(s+2+n)})}s=l}let o=i.nextSibling;if(!o)break;i=o}}function he(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(ut)!=" ")return t;let n=z(t,4,r),s="";for(let i=n;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+t.slice(r)}const Wt=(t={})=>({state:e,dispatch:r})=>{let n=X(e),{doc:s}=e,i=null,o=e.changeByRange(a=>{if(!a.empty||!q.isActiveAt(e,a.from,-1)&&!q.isActiveAt(e,a.from,1))return i={range:a};let l=a.from,h=s.lineAt(l),f=et(n.resolveInner(l,-1),s);for(;f.length&&f[f.length-1].from>l-h.from;)f.pop();if(!f.length)return i={range:a};let p=f[f.length-1];if(p.to-p.spaceAfter.length>l-h.from)return i={range:a};let d=l>=p.to-p.spaceAfter.length&&!/\S/.test(h.text.slice(p.to));if(p.item&&d){let w=p.node.firstChild,S=p.node.getChild("ListItem","ListItem");if(w.to>=l||S&&S.to0&&!/[^\s>]/.test(s.lineAt(h.from-1).text)||t.nonTightLists===!1){let b=f.length>1?f[f.length-2]:null,E,I="";b&&b.item?(E=h.from+b.from,I=b.marker(s,1)):E=h.from+(b?b.to:0);let y=[{from:E,to:l,insert:I}];return p.node.name=="OrderedList"&&J(p.item,s,y,-2),b&&b.node.name=="OrderedList"&&J(b.item,s,y),{range:P.cursor(E+I.length),changes:y}}else{let b=Be(f,e,h);return{range:P.cursor(l+b.length+1),changes:{from:h.from,insert:b+e.lineBreak}}}}if(p.node.name=="Blockquote"&&d&&h.from){let w=s.lineAt(h.from-1),S=/>\s*$/.exec(w.text);if(S&&S.index==p.from){let b=e.changes([{from:w.from+S.index,to:w.to},{from:h.from+p.from,to:h.to}]);return{range:a.map(b),changes:b}}}let c=[];p.node.name=="OrderedList"&&J(p.item,s,c);let L=p.item&&p.item.from]*/.exec(h.text)[0].length>=p.to)for(let w=0,S=f.length-1;w<=S;w++)g+=w==S&&!L?f[w].marker(s,1):f[w].blank(wh.from&&/\s/.test(h.text.charAt(B-h.from-1));)B--;return g=he(g,e),tr(p.node,e.doc)&&(g=Be(f,e,h)+e.lineBreak+g),c.push({from:B,to:l,insert:e.lineBreak+g}),{range:P.cursor(B+g.length+1),changes:c}});return i?!1:(r(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},er=Wt();function xe(t){return t.name=="QuoteMark"||t.name=="ListMark"}function tr(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let s=e.lineAt(r.to),i=e.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1){let r=X(t),n=null,s=t.changeByRange(i=>{let o=i.from,{doc:a}=t;if(i.empty&&q.isActiveAt(t,i.from)){let l=a.lineAt(o),h=et(rr(r,o),a);if(h.length){let f=h[h.length-1],p=f.to-f.spaceAfter.length+(f.spaceAfter?1:0);if(o-l.from>p&&!/\S/.test(l.text.slice(p,o-l.from)))return{range:P.cursor(l.from+p),changes:{from:l.from+p,to:o}};if(o-l.from==p&&(!f.item||l.from<=f.item.from||!/\S/.test(l.text.slice(0,f.to)))){let d=l.from+f.from;if(f.item&&f.node.from{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let s=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!q.isActiveAt(e.state,n.from,1)))return!1;let i=X(e.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:a=>{(a.from>n.from||ar.test(a.name))&&(o=!0)},leave:a=>{a.to{let{next:Q}=O;(Q==R||Q==-1||a.context)&&O.acceptToken(ZO)},{contextual:!0,fallback:!0}),yO=new X((O,a)=>{let{next:Q}=O,e;d.indexOf(Q)>-1||Q==_&&((e=O.peek(1))==_||e==XO)||Q!=R&&Q!=SO&&Q!=-1&&!a.context&&O.acceptToken(rO)},{contextual:!0}),kO=new X((O,a)=>{O.next==dO&&!a.context&&O.acceptToken($O)},{contextual:!0}),wO=new X((O,a)=>{let{next:Q}=O;if(Q==gO||Q==mO){if(O.advance(),Q==O.next){O.advance();let e=!a.context&&a.canShift(b);O.acceptToken(e?b:tO)}}else Q==YO&&O.peek(1)==TO&&(O.advance(),O.advance(),(O.next<48||O.next>57)&&O.acceptToken(lO))},{contextual:!0});function Y(O,a){return O>=65&&O<=90||O>=97&&O<=122||O==95||O>=192||!a&&O>=48&&O<=57}const bO=new X((O,a)=>{if(O.next!=uO||!a.dialectEnabled(cO)||(O.advance(),O.next==_))return;let Q=0;for(;d.indexOf(O.next)>-1;)O.advance(),Q++;if(Y(O.next,!0)){for(O.advance(),Q++;Y(O.next,!1);)O.advance(),Q++;for(;d.indexOf(O.next)>-1;)O.advance(),Q++;if(O.next==xO)return;for(let e=0;;e++){if(e==7){if(!Y(O.next,!0))return;break}if(O.next!="extends".charCodeAt(e))break;O.advance(),Q++}}O.acceptToken(nO,-Q)}),zO=A({"get set async static":i.modifier,"for while do if else switch try catch finally return throw break continue default case defer":i.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":i.operatorKeyword,"let var const using function class extends":i.definitionKeyword,"import export from":i.moduleKeyword,"with debugger new":i.keyword,TemplateString:i.special(i.string),super:i.atom,BooleanLiteral:i.bool,this:i.self,null:i.null,Star:i.modifier,VariableName:i.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":i.function(i.variableName),VariableDefinition:i.definition(i.variableName),Label:i.labelName,PropertyName:i.propertyName,PrivatePropertyName:i.special(i.propertyName),"CallExpression/MemberExpression/PropertyName":i.function(i.propertyName),"FunctionDeclaration/VariableDefinition":i.function(i.definition(i.variableName)),"ClassDeclaration/VariableDefinition":i.definition(i.className),"NewExpression/VariableName":i.className,PropertyDefinition:i.definition(i.propertyName),PrivatePropertyDefinition:i.definition(i.special(i.propertyName)),UpdateOp:i.updateOperator,"LineComment Hashbang":i.lineComment,BlockComment:i.blockComment,Number:i.number,String:i.string,Escape:i.escape,ArithOp:i.arithmeticOperator,LogicOp:i.logicOperator,BitOp:i.bitwiseOperator,CompareOp:i.compareOperator,RegExp:i.regexp,Equals:i.definitionOperator,Arrow:i.function(i.punctuation),": Spread":i.punctuation,"( )":i.paren,"[ ]":i.squareBracket,"{ }":i.brace,"InterpolationStart InterpolationEnd":i.special(i.brace),".":i.derefOperator,", ;":i.separator,"@":i.meta,TypeName:i.typeName,TypeDefinition:i.definition(i.typeName),"type enum interface implements namespace module declare":i.definitionKeyword,"abstract global Privacy readonly override":i.modifier,"is keyof unique infer asserts":i.operatorKeyword,JSXAttributeValue:i.attributeValue,JSXText:i.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":i.angleBracket,"JSXIdentifier JSXNameSpacedName":i.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":i.attributeName,"JSXBuiltin/JSXIdentifier":i.standard(i.tagName)}),jO={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},qO={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},hO={__proto__:null,"<":193},RO=M.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_O,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[zO],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[yO,kO,wO,bO,2,3,4,5,6,7,8,9,10,11,12,13,14,fO,new w("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new w("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:O=>jO[O]||-1},{term:343,get:O=>qO[O]||-1},{term:95,get:O=>hO[O]||-1}],tokenPrec:15201}),W=[Z("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Z("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Z("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Z("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Z("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Z(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),Z("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Z(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),Z(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),Z('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Z('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],WO=W.concat([Z("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Z("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Z("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),z=new iO,v=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function S(O){return(a,Q)=>{let e=a.node.getChild("VariableDefinition");return e&&Q(e,O),!0}}const vO=["FunctionDeclaration"],GO={FunctionDeclaration:S("function"),ClassDeclaration:S("class"),ClassExpression:()=>!0,EnumDeclaration:S("constant"),TypeAliasDeclaration:S("type"),NamespaceDeclaration:S("namespace"),VariableDefinition(O,a){O.matchContext(vO)||a(O,"variable")},TypeDefinition(O,a){a(O,"type")},__proto__:null};function G(O,a){let Q=z.get(a);if(Q)return Q;let e=[],r=!0;function t($,l){let o=O.sliceString($.from,$.to);e.push({label:o,type:l})}return a.cursor(eO.IncludeAnonymous).iterate($=>{if(r)r=!1;else if($.name){let l=GO[$.name];if(l&&l($,t)||v.has($.name))return!1}else if($.to-$.from>8192){for(let l of G(O,$.node))e.push(l);return!1}}),z.set(a,e),e}const m=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,y=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function VO(O){let a=f(O.state).resolveInner(O.pos,-1);if(y.indexOf(a.name)>-1)return null;let Q=a.name=="VariableName"||a.to-a.from<20&&m.test(O.state.sliceDoc(a.from,a.to));if(!Q&&!O.explicit)return null;let e=[];for(let r=a;r;r=r.parent)v.has(r.name)&&(e=e.concat(G(O.state.doc,r)));return{options:e,from:Q?a.from:O.pos,validFor:m}}function T(O,a,Q){var e;let r=[];for(;;){let t=a.firstChild,$;if(t?.name=="VariableName")return r.push(O(t)),{path:r.reverse(),name:Q};if(t?.name=="MemberExpression"&&((e=$=t.lastChild)===null||e===void 0?void 0:e.name)=="PropertyName")r.push(O($)),a=t;else return null}}function UO(O){let a=e=>O.state.doc.sliceString(e.from,e.to),Q=f(O.state).resolveInner(O.pos,-1);return Q.name=="PropertyName"?T(a,Q.parent,a(Q)):(Q.name=="."||Q.name=="?.")&&Q.parent.name=="MemberExpression"?T(a,Q.parent,""):y.indexOf(Q.name)>-1?null:Q.name=="VariableName"||Q.to-Q.from<20&&m.test(a(Q))?{path:[],name:a(Q)}:Q.name=="MemberExpression"?T(a,Q,""):O.explicit?{path:[],name:""}:null}function LO(O,a){let Q=[],e=new Set;for(let r=0;;r++){for(let $ of(Object.getOwnPropertyNames||Object.keys)(O)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test($)||e.has($))continue;e.add($);let l;try{l=O[$]}catch{continue}Q.push({label:$,type:typeof l=="function"?/^[A-Z]/.test($)?"class":a?"function":"method":a?"variable":"property",boost:-r})}let t=Object.getPrototypeOf(O);if(!t)return Q;O=t}}function Oa(O){let a=new Map;return Q=>{let e=UO(Q);if(!e)return null;let r=O;for(let $ of e.path)if(r=r[$],!r)return null;let t=a.get(r);return t||a.set(r,t=LO(r,!e.path.length)),{from:Q.pos-e.name.length,options:t,validFor:m}}}const P=K.define({name:"javascript",parser:RO.configure({props:[B.add({IfStatement:x({except:/^\s*({|else\b)/}),TryStatement:x({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:F,SwitchBody:O=>{let a=O.textAfter,Q=/^\s*\}/.test(a),e=/^\s*(case|default)\b/.test(a);return O.baseIndent+(Q?0:e?1:2)*O.unit},Block:H({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":x({except:/^\s*{/}),JSXElement(O){let a=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(a?0:O.unit)},JSXEscape(O){let a=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(a?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),OO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":aO,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),V={test:O=>/^JSX/.test(O.name),facet:QO({commentTokens:{block:{open:"{/*",close:"*/}"}}})},MO=P.configure({dialect:"ts"},"typescript"),EO=P.configure({dialect:"jsx",props:[h.add(O=>O.isTop?[V]:void 0)]}),AO=P.configure({dialect:"jsx ts",props:[h.add(O=>O.isTop?[V]:void 0)]},"typescript");let U=O=>({label:O,type:"keyword"});const L="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(U),CO=L.concat(["declare","implements","private","protected","public"].map(U));function aa(O={}){let a=O.jsx?O.typescript?AO:EO:O.typescript?MO:P,Q=O.typescript?WO.concat(CO):W.concat(L);return new J(a,[P.data.of({autocomplete:D(y,N(Q))}),P.data.of({autocomplete:VO}),O.jsx?DO:[]])}function IO(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function j(O,a,Q=O.length){for(let e=a?.firstChild;e;e=e.nextSibling)if(e.name=="JSXIdentifier"||e.name=="JSXBuiltin"||e.name=="JSXNamespacedName"||e.name=="JSXMemberExpression")return O.sliceString(e.from,Math.min(e.to,Q));return""}const JO=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),DO=C.inputHandler.of((O,a,Q,e,r)=>{if((JO?O.composing:O.compositionStarted)||O.state.readOnly||a!=Q||e!=">"&&e!="/"||!P.isActiveAt(O.state,a,-1))return!1;let t=r(),{state:$}=t,l=$.changeByRange(o=>{var p;let{head:n}=o,s=f($).resolveInner(n-1,-1),g;if(s.name=="JSXStartTag"&&(s=s.parent),!($.doc.sliceString(n-1,n)!=e||s.name=="JSXAttributeValue"&&s.to>n)){if(e==">"&&s.name=="JSXFragmentTag")return{range:o,changes:{from:n,insert:""}};if(e=="/"&&s.name=="JSXStartCloseTag"){let c=s.parent,u=c.parent;if(u&&c.from==n-2&&((g=j($.doc,u.firstChild,n))||((p=u.firstChild)===null||p===void 0?void 0:p.name)=="JSXFragmentTag")){let k=`${g}>`;return{range:I.cursor(n+k.length,-1),changes:{from:n,insert:k}}}}else if(e==">"){let c=IO(s);if(c&&c.name=="JSXOpenTag"&&!/^\/?>|^<\//.test($.doc.sliceString(n,n+2))&&(g=j($.doc,c,n)))return{range:o,changes:{from:n,insert:``}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([t,$.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Qa(O,a){return a||(a={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},O.getRules().forEach((Q,e)=>{var r;!((r=Q.meta.docs)===null||r===void 0)&&r.recommended&&(a.rules[e]=2)})),Q=>{let{state:e}=Q,r=[];for(let{from:t,to:$}of P.findRegions(e)){let l=e.doc.lineAt(t),o={line:l.number-1,col:t-l.from,pos:t};for(let p of O.verify(e.sliceDoc(t,$),a))r.push(NO(p,e.doc,o))}return r}}function q(O,a,Q,e){return Q.line(O+e.line).from+a+(O==1?e.col-1:-1)}function NO(O,a,Q){let e=q(O.line,O.column,a,Q),r={from:e,to:O.endLine!=null&&O.endColumn!=1?q(O.endLine,O.endColumn,a,Q):e,message:O.message,source:O.ruleId?"eslint:"+O.ruleId:"eslint",severity:O.severity==1?"warning":"error"};if(O.fix){let{range:t,text:$}=O.fix,l=t[0]+Q.pos-e,o=t[1]+Q.pos-e;r.actions=[{name:"fix",apply(p,n){p.dispatch({changes:{from:n+l,to:n+o,insert:$},scrollIntoView:!0})}}]}return r}export{DO as autoCloseTags,UO as completionPath,Qa as esLint,aa as javascript,P as javascriptLanguage,EO as jsxLanguage,VO as localCompletionSource,Oa as scopeCompletionSource,W as snippets,AO as tsxLanguage,MO as typescriptLanguage,WO as typescriptSnippets}; diff --git a/assets/index-tDF4sm9q.js b/assets/index-tDF4sm9q.js deleted file mode 100644 index d55d0f133fd5af4621b5816615604629fa34563e..0000000000000000000000000000000000000000 --- a/assets/index-tDF4sm9q.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./module-C85Cvh0Z.js","./module-DoWOc2fJ.js","./module-B5lWqP2v.js"])))=>i.map(i=>d[i]); -import{p as l,i as z,q as Je,w as Ke,d as ie,b as Oe,M as Pe,f as st,j as lt,a as dt,A as ut,r as ct,G as _t,g as Ne}from"./i18n-CPHyzK9b.js";import{M as we,a7 as Se,Q as D,T as S,t as re,a as _,O as pe,X as te,a3 as oe,N as H,Z as r,R as C,ah as $e,aa as O,ab as De,ae as et,ac as ee,$ as p,S as R,aL as vt,a2 as N,af as Fe,as as mt,G as gt}from"./index-DydPgVMC.js";import{S as Ve}from"./index-CfM_uZQa.js";import"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{W as ft,A as ht,S as bt}from"./StaticAudio-BzxlNlBs.js";import{s as wt}from"./snippet-BtHMuX3s.js";import{U as pt}from"./Upload-Bq9KuxCu.js";import{M as qe}from"./ModifyUpload-BL388q45.js";import{S as yt}from"./ScrollFade.svelte_svelte_type_style_lang-DM1x-AZw.js";import{B as kt}from"./BlockLabel-BzVeVrtL.js";import{S as xt}from"./ShareButton-Cuvs43xM.js";import{M as Rt}from"./Music-CGJUBXWE.js";import{C as At}from"./IconButtonWrapper-PnNNNvqI.js";import{S as Pt}from"./StreamingBar-CzgHaKX0.js";import{s as Qe,u as We,p as Xe}from"./MinimalAudioPlayer-C59qi7fl.js";import{o as Ge}from"./record.esm-EHLfhwCm.js";import{P as Dt}from"./VolumeLevels-B3WBv7ou.js";import{S as St}from"./Spinner-C4Ov0as9.js";import{B as Ye}from"./Block-WPcVj6Bq.js";import{U as Bt}from"./UploadText-CYQRFBCv.js";import{default as Ur}from"./Example-DXbKzhJW.js";import"./Clear-BR8cTgGu.js";import"./html-BZIV6tyB.js";import"./index-B_pwUImq.js";import"./DownloadLink-DM2QmhDx.js";import"./Empty-B15ItVsj.js";import"./Download-DWSaBiea.js";import"./Play-CRvn2HoA.js";import"./Undo-B9SlrYtT.js";import"./actions-4RaHFoGI.js";import"./Edit-G5CCT_vc.js";var Et=C(""),Mt=C(""),Ct=C('');function tt(K,e){we(e,!0);let o=l(e,"micDevices",15);Se(()=>{if(typeof window<"u"&&navigator.mediaDevices){let d=[];Ge.getAvailableAudioDevices().then(a=>{o(a),a.forEach(i=>{i.deviceId&&d.push(i)}),o(d)}).catch(a=>{a instanceof DOMException&&a.name=="NotAllowedError"&&e.onerror?.(e.i18n("audio.allow_recording_access"))})}});var f=Ct(),J=D(f);{var t=d=>{var a=Et(),i=D(a,!0);S(a),a.value=a.__value="",re(A=>te(i,A),[()=>e.i18n("audio.no_microphone")]),_(d,a)},y=d=>{var a=oe(),i=H(a);Je(i,17,o,Ke,(A,m)=>{var h=Mt(),E=D(h,!0);S(h);var I={};re(()=>{te(E,r(m).label),I!==(I=r(m).deviceId)&&(h.value=(h.__value=r(m).deviceId)??"")}),_(A,h)}),_(d,a)};z(J,d=>{!o()||o().length===0?d(t):d(y,!1)})}S(f),re(()=>f.disabled=!o()||o().length===0),_(K,f),pe()}var It=C(''),Lt=C('
                ');function Ut(K,e){we(e,!0);let o=l(e,"recording",3,!1),f=l(e,"timing",3,!1),J=O(De([])),t,y,d,a,i,A=O(!1);const m=()=>{t.style.display="none",a.style.display="flex",y.style.display="block"},h=()=>{e.record.isPaused()&&(e.record.resumeRecording(),e.record.stopRecording()),e.record.stopMic(),t.style.display="flex",a.style.display="none",y.style.display="none",t.disabled=!1},E=()=>{y.style.display="none",d.style.display="block",a.style.display="none",i.style.display="flex"},I=()=>{y.style.display="block",d.style.display="none",t.style.display="none",a.style.display="flex",i.style.display="none"};Se(()=>{e.record.on("record-start",m),e.record.on("record-end",h),e.record.on("record-pause",E),e.record.on("record-resume",I)}),et(()=>{e.record.un("record-start",m),e.record.un("record-end",h),e.record.un("record-pause",E),e.record.un("record-resume",I)}),ee(()=>{o()&&!r(A)?e.record.startMic().then(()=>{e.record.startRecording(),p(A,!0)}):!o()&&r(A)&&(e.record.isPaused()&&e.record.resumeRecording(),e.record.stopRecording(),p(A,!1))});var F=Lt(),V=D(F),G=D(V);G.__click=()=>e.record.startRecording();var q=D(G,!0);S(G),ie(G,u=>t=u,()=>t);var s=R(G,2);s.__click=()=>{e.record.isPaused()&&(e.record.resumeRecording(),e.record.stopRecording()),e.record.stopRecording()};var B=D(s,!0);S(s),ie(s,u=>a=u,()=>a);var M=R(s,2);M.__click=()=>{e.record.isPaused()&&(e.record.resumeRecording(),e.record.stopRecording()),e.record.stopRecording()};var P=D(M,!0);S(M),ie(M,u=>i=u,()=>i);var L=R(M,2);L.__click=()=>e.record.pauseRecording();var T=D(L);Dt(T),S(L),ie(L,u=>y=u,()=>y);var k=R(L,2);k.__click=()=>e.record.resumeRecording();var g=D(k,!0);S(k),ie(k,u=>d=u,()=>d);var x=R(k,2);{var j=u=>{var $=It(),c=D($,!0);S($),re(()=>te(c,e.record_time)),_(u,$)};z(x,u=>{f()&&!e.show_recording_waveform&&u(j)})}S(V);var W=R(V,2);tt(W,{get i18n(){return e.i18n},get micDevices(){return r(J)},set micDevices(u){p(J,u,!0)}}),S(F),re((u,$,c,ue,se)=>{te(q,u),Oe(s,1,`stop-button ${$??""}`,"svelte-1dryk2m"),te(B,c),te(P,ue),te(g,se)},[()=>e.i18n("audio.record"),()=>e.record.isPaused()?"stop-button-paused":"",()=>e.i18n("audio.stop"),()=>e.i18n("audio.stop"),()=>e.i18n("audio.resume")]),_(K,F),pe()}$e(["click"]);var zt=C(''),Tt=C(''),jt=C(''),Wt=C('
                '),Ot=C('
                ');function Gt(K,e){we(e,!0);let o=l(e,"mode",15),f=l(e,"waveform_options",19,()=>({show_recording_waveform:!0})),J=l(e,"editable",3,!0),t=l(e,"recording",3,!1),y,d=O(void 0),a=O(!1),i,A,m=O(void 0),h=O(null),E,I,F=O(0),V=O(0),G,q=O(!1),s=O(0),B=O(!1);const M=()=>{clearInterval(G),G=setInterval(()=>{vt(V)},1e3)};function P(){if(M(),p(q,!0),e.onstartrecording?.(),f().show_recording_waveform){let n=A;n&&(n.style.display="block")}}async function L(n){p(V,0),p(q,!1),clearInterval(G);try{const b=await n.arrayBuffer(),ne=await new AudioContext({sampleRate:e.waveform_settings.sampleRate}).decodeAudioData(b);ne&&await Xe(ne).then(async le=>{await e.dispatch_blob([le],"change"),await e.dispatch_blob([le],"stop_recording")})}catch(b){console.error(b)}}ee(()=>{r(m)?.on("record-resume",()=>{M()})}),ee(()=>{r(d)?.on("decode",n=>{p(F,n,!0),I&&(I.textContent=Pe(n))})}),ee(()=>{r(d)?.on("timeupdate",n=>E&&(E.textContent=Pe(n)))}),ee(()=>{r(d)?.on("pause",()=>{e.onpause?.(),p(a,!1)})}),ee(()=>{r(d)?.on("play",()=>{e.onplay?.(),p(a,!0)})}),ee(()=>{r(d)?.on("finish",()=>{e.onstop?.(),p(a,!1)})});const T=()=>{A&&(A.innerHTML=""),y!==void 0&&y.destroy(),A&&(y=We.create({...e.waveform_settings,normalize:!1,container:A}),p(m,y.registerPlugin(Ge.create()),!0),r(m)?.on("record-end",L),r(m)?.on("record-start",P),r(m)?.on("record-pause",()=>{e.onpauserecording?.(),clearInterval(G)}),r(m)?.on("record-end",n=>{p(h,URL.createObjectURL(n),!0);const b=A,Q=i;b&&(b.style.display="none"),Q&&r(h)&&(Q.innerHTML="",k())}),p(B,!0))},k=()=>{let n=i;!r(h)||!n||p(d,We.create({container:n,url:r(h),...e.waveform_settings}),!0)},g=async(n,b)=>{o("edit");const Q=r(d)?.getDecodedData();Q&&await Xe(Q,n,b).then(async ne=>{await e.dispatch_blob([ne],"change"),await e.dispatch_blob([ne],"stop_recording"),r(d)?.destroy(),k()}),e.onedit?.()};Se(()=>{T(),window.addEventListener("keydown",n=>{if(!(i&&i.contains(document.activeElement)))return;const Q=r(d);Q&&(n.key==="ArrowRight"?Qe(Q,.1):n.key==="ArrowLeft"&&Qe(Q,-.1))})});var x=Ot(),j=D(x);ie(j,n=>A=n,()=>A);var W=R(j,2);ie(W,n=>i=n,()=>i);var u=R(W,2);{var $=n=>{var b=Wt(),Q=D(b);ie(Q,X=>E=X,()=>E);var ne=R(Q,2),le=D(ne);{var ye=X=>{var Y=zt(),de=D(Y,!0);S(Y),re(ge=>te(de,ge),[()=>Pe(r(s))]),_(X,Y)};z(le,X=>{o()==="edit"&&r(s)>0&&X(ye)})}var Ue=R(le,2);{var Be=X=>{var Y=Tt(),de=D(Y,!0);S(Y),re(ge=>te(de,ge),[()=>Pe(r(V))]),_(X,Y)},Ee=X=>{var Y=jt();ie(Y,de=>I=de,()=>I),_(X,Y)};z(Ue,X=>{r(q)?X(Be):X(Ee,!1)})}S(ne),S(b),_(n,b)};z(u,n=>{(r(q)||r(h))&&f().show_recording_waveform&&n($)})}var c=R(u,2);{var ue=n=>{{let b=N(()=>Pe(r(V)));Ut(n,{get record(){return r(m)},get i18n(){return e.i18n},get timing(){return r(q)},get recording(){return t()},get show_recording_waveform(){return f().show_recording_waveform},get record_time(){return r(b)}})}};z(c,n=>{r(B)&&!r(h)&&n(ue)})}var se=R(c,2);{var He=n=>{ft(n,{get waveform(){return r(d)},get container(){return i},get playing(){return r(a)},get audio_duration(){return r(F)},get i18n(){return e.i18n},get editable(){return J()},interactive:!0,handle_trim_audio:g,show_redo:!0,get handle_reset_value(){return e.handle_reset_value},get waveform_options(){return f()},get trimDuration(){return r(s)},set trimDuration(b){p(s,b,!0)},get mode(){return o()},set mode(b){o(b)}})};z(se,n=>{r(d)&&r(h)&&n(He)})}S(x),_(K,x),pe()}var Ht=C('
                '),Nt=C(''),Ft=C(''),Vt=C(''),qt=C('
                ');function Qt(K,e){we(e,!0);let o=l(e,"recording",3,!1),f=l(e,"paused_recording",3,!1),J=l(e,"waveform_options",19,()=>({show_recording_waveform:!0})),t=l(e,"waiting",3,!1),y,d,a,i=O(De([]));Se(()=>{A()});const A=()=>{y!==void 0&&y.destroy(),a&&(y=We.create({...e.waveform_settings,normalize:!1,container:a}),d=y.registerPlugin(Ge.create()))};var m=qt(),h=D(m);{var E=s=>{var B=Ht();let M;ie(B,P=>a=P,()=>a),re(()=>M=st(B,"",M,{display:o()?"block":"none"})),_(s,B)};z(h,s=>{J().show_recording_waveform&&s(E)})}var I=R(h,2),F=D(I);{var V=s=>{var B=Nt();B.__click=()=>{d?.stopMic(),e.stop()};var M=R(D(B));S(B),re(P=>{Oe(B,1,lt(f()?"stop-button-paused":"stop-button"),"svelte-1a2yrmr"),te(M,` ${P??""}`)},[()=>f()?e.i18n("audio.pause"):e.i18n("audio.stop")]),_(s,B)},G=s=>{var B=oe(),M=H(B);{var P=T=>{var k=Ft();k.__click=()=>{e.stop()};var g=D(k),x=D(g);St(x),S(g);var j=R(g);S(k),re(W=>te(j,` ${W??""}`),[()=>e.i18n("audio.waiting")]),_(T,k)},L=T=>{var k=Vt();k.__click=()=>{d?.startMic(),e.record()};var g=R(D(k));S(k),re(x=>te(g,` ${x??""}`),[()=>e.i18n("audio.record")]),_(T,k)};z(M,T=>{o()&&t()?T(P):T(L,!1)},!0)}_(s,B)};z(F,s=>{o()&&!t()?s(V):s(G,!1)})}var q=R(F,2);tt(q,{get i18n(){return e.i18n},get micDevices(){return r(i)},set micDevices(s){p(i,s,!0)}}),S(I),S(m),_(K,m),pe()}$e(["click"]);let Ze;async function Xt(){const{MediaRecorder:K,register:e}=await Fe(async()=>{const{MediaRecorder:f,register:J}=await import("./module-C85Cvh0Z.js");return{MediaRecorder:f,register:J}},__vite__mapDeps([0,1]),import.meta.url),{connect:o}=await Fe(async()=>{const{connect:f}=await import("./module-B5lWqP2v.js");return{connect:f}},__vite__mapDeps([2,1]),import.meta.url);return e(await o()),Ze=K,Ze}var Yt=C(" ",1),Zt=C(" ",1),Jt=C("
                ",1);function Kt(K,e){we(e,!0);let o=l(e,"value",15,null),f=l(e,"subtitles",3,null),J=l(e,"show_label",3,!0),t=l(e,"buttons",19,()=>["download","share"]),y=l(e,"on_custom_button_click",3,null),d=l(e,"sources",19,()=>["microphone","upload"]),a=l(e,"pending",3,!1),i=l(e,"streaming",3,!1),A=l(e,"trim_region_settings",19,()=>({})),m=l(e,"waveform_options",19,()=>({})),h=l(e,"dragging",15,!1),E=l(e,"active_source",15,"microphone"),I=l(e,"handle_reset_value",3,()=>{}),F=l(e,"editable",3,!0),V=l(e,"max_file_size",3,null),G=l(e,"stream_every",3,.1),q=l(e,"uploading",15,!1),s=l(e,"recording",15,!1),B=l(e,"class_name",3,""),M=l(e,"upload_promise",15),P=l(e,"initial_value",15),L=l(e,"playback_position",15),T=l(e,"time_limit",3,null),k=l(e,"stream_state",3,"closed");ee(()=>{e.ondrag?.(h())});let g,x=O(""),j,W=[],u=!1,$=!1,c;const ue=44;let se=[];typeof window<"u"&&i()&&Xt().then(v=>{c=v});const n=v=>v.map(w=>w instanceof Blob?w:w.slice()),b=async(v,w)=>{let ae=new File(n(v),"audio.wav",{type:"audio/wav"});if(ae.size===0)return;const ce=await mt([ae],w==="stream");P(o()),o((await e.upload(ce,e.root,void 0,V()||void 0))?.filter(Boolean)[0]),w==="stream"?e.onstream?.(o()):w==="change"?e.onchange?.(o()):w==="stop_recording"&&e.onstop_recording?.()};et(()=>{i()&&g&&g.state!=="inactive"&&g.stop()});async function Q(){let v;try{v=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(w){if(!navigator.mediaDevices){e.onerror?.(e.i18n("audio.no_device_support"));return}if(w instanceof DOMException&&w.name=="NotAllowedError"){e.onerror?.(e.i18n("audio.allow_recording_access"));return}throw w}v!=null&&(i()?(g=new c(v,{mimeType:"audio/wav"}),g.addEventListener("dataavailable",ne)):(g=new MediaRecorder(v),g.addEventListener("dataavailable",w=>{se.push(w.data)})),g.addEventListener("stop",async()=>{s(!1),g.stop(),await b(se,"change"),await b(se,"stop_recording"),se=[]}),$=!0)}async function ne(v){let w=await v.data.arrayBuffer(),ae=new Uint8Array(w);if(j||(j=new Uint8Array(w.slice(0,ue)),ae=new Uint8Array(w.slice(ue))),a())W.push(ae);else{let ce=[j].concat(W,[ae]);if(!s()||k()==="waiting")return;b(ce,"stream"),W=[]}}ee(()=>{if(u&&a()===!1&&(u=!1,j&&W)){let v=[j].concat(W);W=[],b(v,"stream")}});async function le(){s(!0),e.onstart_recording?.(),$||await Q(),j=void 0,i()&&g.state!="recording"&&g.start(G()*1e3)}function ye(){e.onchange?.(null),e.onclear?.(),p(x,""),o(null)}function Ue(v){o(v),e.onchange?.(v),e.onupload?.(v)}async function Be(){s(!1),i()&&(e.onclose_stream?.(),e.onstop_recording?.(),g.stop(),a()&&(u=!0),await b(se,"stop_recording"),e.onclear?.(),p(x,""))}ee(()=>{!s()&&g&&r(x)!==""&&Be()}),ee(()=>{s()&&g&&le()});var Ee=Jt(),X=H(Ee);{let v=N(()=>E()==="upload"&&o()===null),w=N(()=>e.label||e.i18n("audio.audio"));kt(X,{get show_label(){return J()},get Icon(){return Rt},get float(){return r(v)},get label(){return r(w)}})}var Y=R(X,2),de=D(Y);Pt(de,{get time_limit(){return T()}});var ge=R(de,2);{var rt=v=>{var w=oe(),ae=H(w);{var ce=Z=>{var fe=Yt(),_e=H(fe);qe(_e,{get i18n(){return e.i18n},onclear:ye});var xe=R(_e,2);{var ve=U=>{{let he=N(()=>k()==="waiting");Qt(U,{record:le,get recording(){return s()},stop:Be,get i18n(){return e.i18n},get waveform_settings(){return e.waveform_settings},get waveform_options(){return m()},get waiting(){return r(he)}})}},me=U=>{Gt(U,{get i18n(){return e.i18n},get editable(){return F()},get recording(){return s()},dispatch_blob:b,get waveform_settings(){return e.waveform_settings},get waveform_options(){return m()},get handle_reset_value(){return I()},onstartrecording:()=>e.onstart_recording?.(),onpauserecording:()=>e.onpause_recording?.(),onstoprecording:()=>e.onstop_recording?.(),get mode(){return r(x)},set mode(he){p(x,he,!0)}})};z(xe,U=>{i()?U(ve):U(me,!1)})}_(Z,fe)},ke=Z=>{var fe=oe(),_e=H(fe);{var xe=ve=>{{let me=N(()=>e.i18n("audio.drop_to_upload"));pt(ve,{filetype:"audio/aac,audio/midi,audio/mpeg,audio/ogg,audio/wav,audio/x-wav,audio/opus,audio/webm,audio/flac,audio/vnd.rn-realaudio,audio/x-ms-wma,audio/x-aiff,audio/amr,audio/*",onload:Ue,onerror:U=>e.onerror?.(U),get root(){return e.root},get max_file_size(){return V()},get upload(){return e.upload},get stream_handler(){return e.stream_handler},get aria_label(){return r(me)},get upload_promise(){return M()},set upload_promise(U){M(U)},get dragging(){return h()},set dragging(U){h(U)},get uploading(){return q()},set uploading(U){q(U)},children:(U,he)=>{var Me=oe(),Re=H(Me);{var Ce=Ae=>{var Ie=oe(),ze=H(Ie);wt(ze,()=>e.children),_(Ae,Ie)};z(Re,Ae=>{e.children&&Ae(Ce)})}_(U,Me)},$$slots:{default:!0}})}};z(_e,ve=>{E()==="upload"&&ve(xe)},!0)}_(Z,fe)};z(ae,Z=>{E()==="microphone"?Z(ce):Z(ke,!1)})}_(v,w)},at=v=>{var w=Zt(),ae=H(w);{let ke=N(()=>t()===null||t().some(Z=>typeof Z=="string"&&Z==="download")?o().url:null);qe(ae,{get i18n(){return e.i18n},onclear:ye,onedit:()=>{p(x,"edit"),e.onedit?.()},get download(){return r(ke)},children:(Z,fe)=>{var _e=oe(),xe=H(_e);{var ve=me=>{var U=oe(),he=H(U);Je(he,17,t,Ke,(Me,Re)=>{var Ce=oe(),Ae=H(Ce);{var Ie=be=>{var Le=oe(),nt=H(Le);{var it=Te=>{xt(Te,{get i18n(){return e.i18n},get onerror(){return e.onerror},onshare:()=>{},formatter:async je=>!je||!je.url?"":``,get value(){return o()}})};z(nt,Te=>{r(Re)==="share"&&Te(it)})}_(be,Le)},ze=be=>{At(be,{get button(){return r(Re)},on_click:Le=>{y()&&y()(Le)}})};z(Ae,be=>{typeof r(Re)=="string"?be(Ie):be(ze,!1)})}_(Me,Ce)}),_(me,U)};z(xe,me=>{o()!==null&&t()&&me(ve)})}_(Z,_e)},$$slots:{default:!0}})}var ce=R(ae,2);{let ke=N(()=>Array.isArray(f())?f():f()?.url);ht(ce,{get value(){return o()},get subtitles(){return r(ke)},get label(){return e.label},get i18n(){return e.i18n},dispatch_blob:b,get waveform_settings(){return e.waveform_settings},get waveform_options(){return m()},get trim_region_settings(){return A()},get handle_reset_value(){return I()},get editable(){return F()},get loop(){return e.loop},interactive:!0,get onstop(){return e.onstop},get onplay(){return e.onplay},get onpause(){return e.onpause},get onedit(){return e.onedit},get mode(){return r(x)},set mode(Z){p(x,Z,!0)},get playback_position(){return L()},set playback_position(Z){L(Z)}})}_(v,w)};z(ge,v=>{o()==null||i()?v(rt):v(at,!1)})}var ot=R(ge,2);yt(ot,{get sources(){return d()},handle_clear:ye,get active_source(){return E()},set active_source(v){E(v)}}),S(Y),re(()=>{Oe(Y,1,`audio-container ${B()??""}`,"svelte-1xhhk03"),dt(Y,"data-testid",e.label?"waveform-"+e.label:"unlabelled-audio")}),_(K,Ee),pe()}var $t=C(" ",1),er=C(" ",1);function Cr(K,e){we(e,!0);let o=ct(e,["$$slots","$$events","$$legacy"]),f=O(void 0);e.props.stream_every=.1;class J extends _t{async get_data(){return r(f)&&(await r(f),await gt()),await super.get_data()}}const t=new J(o);let y=N(()=>t.shared.label||t.i18n("audio.audio")),d=N(()=>e.minimal??t.props.minimal??!1),a=N(()=>t.props.sources?t.props.sources[0]:null),i=O(De(t.props.value));const A=()=>{r(i)===null||t.props.value===r(i)||(t.props.value=r(i))};let m=O(!1),h=O(De(t.props.recording??!1));ee(()=>{t.props.recording=r(h)});let E="darkorange",I=De({height:50,barWidth:2,barGap:3,cursorWidth:2,cursorColor:"#ddd5e9",autoplay:t.props.autoplay,barRadius:10,dragToSeek:!0,normalize:!0,minPxPerSec:20,waveColor:t.props.waveform_options.waveform_color||"#9ca3af",progressColor:t.props.waveform_options.waveform_progress_color||E,mediaControls:t.props.waveform_options.show_controls??!1,sampleRate:t.props.waveform_options.sample_rate||44100});const F={color:t.props.waveform_options.trim_region_color,drag:!0,resize:!0};function V(){document.documentElement.style.setProperty("--trim-region-color",F.color||E)}function G(P){const[L,T]=P.includes("Invalid file type")?["warning","complete"]:["error","error"];t.shared.loading_status&&(t.shared.loading_status.status=T,t.shared.loading_status.message=P),t.dispatch(L,P)}t.watch_for_change(),Se(()=>{V()});var q=oe(),s=H(q);{var B=P=>{{let L=N(()=>r(m)?"focus":"base");Ye(P,{variant:"solid",get border_mode(){return r(L)},padding:!1,allow_overflow:!1,get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get visible(){return t.shared.visible},get container(){return t.shared.container},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},children:(T,k)=>{var g=$t(),x=H(g);Ve(x,Ne({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}));var j=R(x,2);{let W=N(()=>t.props.buttons??["download","share"]);bt(j,{get i18n(){return t.i18n},get show_label(){return t.shared.show_label},get buttons(){return r(W)},get value(){return t.props.value},get subtitles(){return t.props.subtitles},get label(){return r(y)},get loop(){return t.props.loop},get waveform_settings(){return I},get waveform_options(){return t.props.waveform_options},get editable(){return t.props.editable},get minimal(){return r(d)},on_custom_button_click:u=>{t.dispatch("custom_button_click",{id:u})},onshare:u=>t.dispatch("share",u),onerror:u=>t.dispatch("error",u.detail),onplay:()=>t.dispatch("play"),onpause:()=>t.dispatch("pause"),onstop:()=>t.dispatch("stop"),get playback_position(){return t.props.playback_position},set playback_position(u){t.props.playback_position=u}})}_(T,g)},$$slots:{default:!0}})}},M=P=>{{let L=N(()=>t.props.value===null&&r(a)==="upload"?"dashed":"solid"),T=N(()=>r(m)?"focus":"base");Ye(P,{get variant(){return r(L)},get border_mode(){return r(T)},padding:!1,allow_overflow:!1,get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get visible(){return t.shared.visible},get container(){return t.shared.container},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},children:(k,g)=>{var x=er(),j=H(x);Ve(j,Ne({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}));var W=R(j,2);{let u=N(()=>t.props.buttons??[]),$=N(()=>r(a)||void 0);Kt(W,{get label(){return r(y)},get show_label(){return t.shared.show_label},get buttons(){return r(u)},on_custom_button_click:c=>{t.dispatch("custom_button_click",{id:c})},get value(){return t.props.value},get subtitles(){return t.props.subtitles},onchange:c=>t.props.value=c,onstream:c=>{t.props.value=c,t.dispatch("stream",t.props.value)},ondrag:c=>p(m,c,!0),get root(){return t.shared.root},get sources(){return t.props.sources},get active_source(){return r($)},get pending(){return t.shared.loading_status.pending},get streaming(){return t.props.streaming},get loop(){return t.props.loop},get max_file_size(){return t.shared.max_file_size},handle_reset_value:A,get editable(){return t.props.editable},onedit:()=>t.dispatch("edit"),onplay:()=>t.dispatch("play"),onpause:()=>t.dispatch("pause"),onstop:()=>t.dispatch("stop"),onstart_recording:()=>t.dispatch("start_recording"),onpause_recording:()=>t.dispatch("pause_recording"),onstop_recording:()=>{t.dispatch("stop_recording"),t.dispatch("input")},onupload:()=>{t.dispatch("upload"),t.dispatch("input")},onclear:()=>{t.dispatch("clear"),t.dispatch("input")},onerror:G,onclose_stream:()=>t.dispatch("close_stream","stream"),get i18n(){return t.i18n},get waveform_settings(){return I},get waveform_options(){return t.props.waveform_options},get trim_region_settings(){return F},get stream_every(){return t.props.stream_every},get stream_state(){return t.shared.loading_status.stream_state},upload:(...c)=>t.shared.client.upload(...c),stream_handler:(...c)=>t.shared.client.stream(...c),get time_limit(){return t.shared.loading_status.time_limit},get upload_promise(){return r(f)},set upload_promise(c){p(f,c,!0)},get initial_value(){return r(i)},set initial_value(c){p(i,c,!0)},get recording(){return r(h)},set recording(c){p(h,c,!0)},get dragging(){return r(m)},set dragging(c){p(m,c,!0)},get playback_position(){return t.props.playback_position},set playback_position(c){t.props.playback_position=c},children:(c,ue)=>{Bt(c,{get i18n(){return t.i18n},type:"audio"})},$$slots:{default:!0}})}_(k,x)},$$slots:{default:!0}})}};z(s,P=>{t.shared.interactive?P(M,!1):P(B)})}_(K,q),pe()}export{Ur as BaseExample,Kt as BaseInteractiveAudio,ht as BasePlayer,bt as BaseStaticAudio,Cr as default}; diff --git a/assets/infoDiagram-WHAUD3N6-Oq8a6cr3.js b/assets/infoDiagram-WHAUD3N6-Oq8a6cr3.js deleted file mode 100644 index 59cdf36799f896f8e8a6892cbec442146980ec25..0000000000000000000000000000000000000000 --- a/assets/infoDiagram-WHAUD3N6-Oq8a6cr3.js +++ /dev/null @@ -1,2 +0,0 @@ -import{_ as e,l as o,I as i,d as n,K as p}from"./mermaid.core-BcqUqpnI.js";import{p as g}from"./treemap-KMMF4GRG-BAURD4mW.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";var m={parse:e(async r=>{const a=await g("info",r);o.debug(a)},"parse")},d={version:p.version+""},v=e(()=>d.version,"getVersion"),c={getVersion:v},l=e((r,a,s)=>{o.debug(`rendering info diagram -`+r);const t=i(a);n(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${s}`)},"draw"),f={draw:l},F={parser:m,db:c,renderer:f};export{F as diagram}; diff --git a/assets/input-BtIxlP_B.js b/assets/input-BtIxlP_B.js deleted file mode 100644 index bc9dace17f00191408b4fa1d554e485f0c70eeb3..0000000000000000000000000000000000000000 --- a/assets/input-BtIxlP_B.js +++ /dev/null @@ -1 +0,0 @@ -import{z as t,D as m,A as y,B as s,G as A,v as E,w as u,I as C,J as x,K as D,L as V,h as b}from"./index-DydPgVMC.js";function B(e,r,c=r){var d=new WeakSet;t(e,"input",async l=>{m&&e.type==="checkbox"&&y();var f=l?e.defaultValue:e.value;if(f=k(e)?i(f):f,c(f),s!==null&&d.add(s),await A(),f!==(f=r())){var v=e.selectionStart,o=e.selectionEnd,h=e.value.length;if(e.value=f??"",o!==null){var a=e.value.length;v===o&&o===h&&a>h?(e.selectionStart=a,e.selectionEnd=a):(e.selectionStart=v,e.selectionEnd=Math.min(o,a))}}}),(b&&e.defaultValue!==e.value||E(r)==null&&e.value)&&(c(k(e)?i(e.value):e.value),s!==null&&d.add(s)),u(()=>{m&&e.type==="checkbox"&&y();var l=r();if(e===document.activeElement){var f=D??s;if(d.has(f))return}k(e)&&l===i(e.value)||e.type==="date"&&!l&&!e.value||l!==e.value&&(e.value=l??"")})}const n=new Set;function q(e,r,c,d,l=d){var f=c.getAttribute("type")==="checkbox",v=e;let o=!1;if(r!==null)for(var h of r)v=v[h]??=[];v.push(c),t(c,"change",()=>{var a=c.__value;f&&(a=S(v,a,c.checked)),l(a)},()=>l(f?[]:null)),u(()=>{var a=d();if(b&&c.defaultChecked!==c.checked){o=!0;return}f?(a=a||[],c.checked=a.includes(c.__value)):c.checked=V(c.__value,a)}),C(()=>{var a=v.indexOf(c);a!==-1&&v.splice(a,1)}),n.has(v)||(n.add(v),x(()=>{v.sort((a,_)=>a.compareDocumentPosition(_)===4?-1:1),n.delete(v)})),x(()=>{if(o){var a;if(f)a=S(v,a,c.checked);else{var _=v.find(w=>w.checked);a=_?.__value}l(a)}})}function z(e,r,c=r){t(e,"change",d=>{var l=d?e.defaultChecked:e.checked;c(l)}),(b&&e.defaultChecked!==e.checked||E(r)==null)&&c(e.checked),u(()=>{var d=r();e.checked=!!d})}function S(e,r,c){for(var d=new Set,l=0;l;attribute world1 : vec4;attribute world2 : vec4;attribute world3 : vec4; -#ifdef INSTANCESCOLOR -attribute instanceColor : vec4; -#endif -#if defined(THIN_INSTANCES) && !defined(WORLD_UBO) -uniform world : mat4x4; -#endif -#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -attribute previousWorld0 : vec4;attribute previousWorld1 : vec4;attribute previousWorld2 : vec4;attribute previousWorld3 : vec4; -#ifdef THIN_INSTANCES -uniform previousWorld : mat4x4; -#endif -#endif -#else -#if !defined(WORLD_UBO) -uniform world : mat4x4; -#endif -#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -uniform previousWorld : mat4x4; -#endif -#endif -`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=i); diff --git a/assets/instancesVertex-BZz8JvZy.js b/assets/instancesVertex-BZz8JvZy.js deleted file mode 100644 index e50cc782c5b3b326fd01f4ce2ecced3240fc4161..0000000000000000000000000000000000000000 --- a/assets/instancesVertex-BZz8JvZy.js +++ /dev/null @@ -1,36 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="bakedVertexAnimationDeclaration",i=`#ifdef BAKED_VERTEX_ANIMATION_TEXTURE -uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2;uniform bakedVertexAnimationSettings: vec4;var bakedVertexAnimationTexture : texture_2d; -#ifdef INSTANCES -attribute bakedVertexAnimationSettingsInstanced : vec4; -#endif -fn readMatrixFromRawSamplerVAT(smp : texture_2d,index : f32,frame : f32)->mat4x4 -{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2(offset+0,frameUV),0);let m1=textureLoad(smp,vec2(offset+1,frameUV),0);let m2=textureLoad(smp,vec2(offset+2,frameUV),0);let m3=textureLoad(smp,vec2(offset+3,frameUV),0);return mat4x4(m0,m1,m2,m3);} -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=i);const d="instancesVertex",f=`#ifdef INSTANCES -var finalWorld=mat4x4(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3); -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -var finalPreviousWorld=mat4x4( -vertexInputs.previousWorld0,vertexInputs.previousWorld1, -vertexInputs.previousWorld2,vertexInputs.previousWorld3); -#endif -#ifdef THIN_INSTANCES -#if !defined(WORLD_UBO) -finalWorld=uniforms.world*finalWorld; -#else -finalWorld=mesh.world*finalWorld; -#endif -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -finalPreviousWorld=uniforms.previousWorld*finalPreviousWorld; -#endif -#endif -#else -#if !defined(WORLD_UBO) -var finalWorld=uniforms.world; -#else -var finalWorld=mesh.world; -#endif -#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) -var finalPreviousWorld=uniforms.previousWorld; -#endif -#endif -`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=f); diff --git a/assets/journeyDiagram-XKPGCS4Q-B9TRQ9Y6.js b/assets/journeyDiagram-XKPGCS4Q-B9TRQ9Y6.js deleted file mode 100644 index 52b5d74925abec95e2550622c1c63e01f1dc169b..0000000000000000000000000000000000000000 --- a/assets/journeyDiagram-XKPGCS4Q-B9TRQ9Y6.js +++ /dev/null @@ -1,139 +0,0 @@ -import{a as gt,g as lt,f as mt,d as xt}from"./chunk-TZMSLE5B-xeQXGdbb.js";import{g as kt}from"./chunk-FMBD7UC4-Drrjy9J2.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as n,c as R,d as $t,y as Mt}from"./mermaid.core-BcqUqpnI.js";import{s as X}from"./select-BigU4G0v.js";import{d as et}from"./arc-Bt_eNeYl.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var U=(function(){var t=n(function(h,i,a,l){for(a=a||{},l=h.length;l--;a[h[l]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],s=[1,9],c=[1,10],r=[1,11],f=[1,12],u=[1,13],y=[1,14],g={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:n(function(i,a,l,d,p,o,b){var k=o.length-1;switch(p){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:d.addTask(o[k-1],o[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:n(function(i,a){if(a.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=a,l}},"parseError"),parse:n(function(i){var a=this,l=[0],d=[],p=[null],o=[],b=this.table,k="",C=0,K=0,dt=2,Q=1,yt=o.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(i,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;o.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,p.length=p.length-w,o.length=o.length-w}n(pt,"popStack");function D(){var w;return w=d.pop()||_.lex()||Q,typeof w!="number"&&(w instanceof Array&&(d=w,w=d.pop()),w=a.symbols_[w]||w),w}n(D,"lex");for(var v,A,T,q,F={},N,M,tt,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((v===null||typeof v>"u")&&(v=D()),T=b[A]&&b[A][v]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in b[A])this.terminals_[N]&&N>dt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: -`+_.showPosition()+` -Expecting `+z.join(", ")+", got '"+(this.terminals_[v]||v)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(v==Q?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+v);switch(T[0]){case 1:l.push(v),p.push(_.yytext),o.push(_.yylloc),l.push(T[1]),v=null,K=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=p[p.length-M],F._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column},ft&&(F._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]),q=this.performAction.apply(F,[k,K,C,I.yy,T[1],p,o].concat(yt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),p=p.slice(0,-1*M),o=o.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),p.push(F.$),o.push(F._$),tt=b[l[l.length-2]][l[l.length-1]],l.push(tt);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:n(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:n(function(i,a){return this.yy=a||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:n(function(i){var a=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(i){this.unput(this.match.slice(i))},"less"),pastInput:n(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+` -`+a+"^"},"showPosition"),test_match:n(function(i,a){var l,d,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),d=i[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var o in p)this[o]=p[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,l,d;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),o=0;oa[0].length)){if(a=l,d=o,this.options.backtrack_lexer){if(i=this.test_match(l,p[o]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,p[d]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var a=this.next();return a||this.lex()},"lex"),begin:n(function(a){this.conditionStack.push(a)},"begin"),popState:n(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:n(function(a){this.begin(a)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(a,l,d,p){switch(d){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return n(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",Z=[],L=[],B=[],Ct=n(function(){Z.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=n(function(t){V=t,Z.push(t)},"addSection"),It=n(function(){return Z},"getSections"),At=n(function(){let t=it();const e=100;let s=0;for(;!t&&s{s.people&&t.push(...s.people)}),[...new Set(t)].sort()},"updateActors"),Vt=n(function(t,e){const s=e.substr(1).split(":");let c=0,r=[];s.length===1?(c=Number(s[0]),r=[]):(c=Number(s[0]),r=s[1].split(","));const f=r.map(y=>y.trim()),u={section:V,type:V,people:f,task:t,score:c};B.push(u)},"addTask"),Rt=n(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),it=n(function(){const t=n(function(s){return B[s].processed},"compileTask");let e=!0;for(const[s,c]of B.entries())t(s),e=e&&c.processed;return e},"compileTasks"),Lt=n(function(){return Ft()},"getActors"),rt={getConfig:n(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=n(t=>`.label { - font-family: ${t.fontFamily}; - color: ${t.textColor}; - } - .mouth { - stroke: #666; - } - - line { - stroke: ${t.textColor} - } - - .legend { - fill: ${t.textColor}; - font-family: ${t.fontFamily}; - } - - .label text { - fill: #333; - } - .label { - color: ${t.textColor} - } - - .face { - ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; - stroke: #999; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${t.mainBkg}; - stroke: ${t.nodeBorder}; - stroke-width: 1px; - } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${t.arrowheadColor}; - } - - .edgePath .path { - stroke: ${t.lineColor}; - stroke-width: 1.5px; - } - - .flowchart-link { - stroke: ${t.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${t.edgeLabelBackground}; - rect { - opacity: 0.5; - } - text-align: center; - } - - .cluster rect { - } - - .cluster text { - fill: ${t.titleColor}; - } - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${t.fontFamily}; - font-size: 12px; - background: ${t.tertiaryColor}; - border: 1px solid ${t.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .task-type-0, .section-type-0 { - ${t.fillType0?`fill: ${t.fillType0}`:""}; - } - .task-type-1, .section-type-1 { - ${t.fillType0?`fill: ${t.fillType1}`:""}; - } - .task-type-2, .section-type-2 { - ${t.fillType0?`fill: ${t.fillType2}`:""}; - } - .task-type-3, .section-type-3 { - ${t.fillType0?`fill: ${t.fillType3}`:""}; - } - .task-type-4, .section-type-4 { - ${t.fillType0?`fill: ${t.fillType4}`:""}; - } - .task-type-5, .section-type-5 { - ${t.fillType0?`fill: ${t.fillType5}`:""}; - } - .task-type-6, .section-type-6 { - ${t.fillType0?`fill: ${t.fillType6}`:""}; - } - .task-type-7, .section-type-7 { - ${t.fillType0?`fill: ${t.fillType7}`:""}; - } - - .actor-0 { - ${t.actor0?`fill: ${t.actor0}`:""}; - } - .actor-1 { - ${t.actor1?`fill: ${t.actor1}`:""}; - } - .actor-2 { - ${t.actor2?`fill: ${t.actor2}`:""}; - } - .actor-3 { - ${t.actor3?`fill: ${t.actor3}`:""}; - } - .actor-4 { - ${t.actor4?`fill: ${t.actor4}`:""}; - } - .actor-5 { - ${t.actor5?`fill: ${t.actor5}`:""}; - } - ${kt()} -`,"getStyles"),jt=Bt,J=n(function(t,e){return xt(t,e)},"drawRect"),Nt=n(function(t,e){const c=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");r.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function f(g){const m=et().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}n(f,"smile");function u(g){const m=et().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}n(u,"sad");function y(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return n(y,"ambivalent"),e.score>3?f(r):e.score<3?u(r):y(r),c},"drawFace"),ot=n(function(t,e){const s=t.append("circle");return s.attr("cx",e.cx),s.attr("cy",e.cy),s.attr("class","actor-"+e.pos),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("r",e.r),s.class!==void 0&&s.attr("class",s.class),e.title!==void 0&&s.append("title").text(e.title),s},"drawCircle"),ct=n(function(t,e){return mt(t,e)},"drawText"),zt=n(function(t,e){function s(r,f,u,y,g){return r+","+f+" "+(r+u)+","+f+" "+(r+u)+","+(f+y-g)+" "+(r+u-g*1.2)+","+(f+y)+" "+r+","+(f+y)}n(s,"genPoints");const c=t.append("polygon");c.attr("points",s(e.x,e.y,50,20,7)),c.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=n(function(t,e,s){const c=t.append("g"),r=lt();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=s.width*e.taskCount+s.diagramMarginX*(e.taskCount-1),r.height=s.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,J(c,r),ht(s)(e.text,c,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},s,e.colour)},"drawSection"),nt=-1,Ot=n(function(t,e,s){const c=e.x+s.width/2,r=t.append("g");nt++,r.append("line").attr("id","task"+nt).attr("x1",c).attr("y1",e.y).attr("x2",c).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(r,{cx:c,cy:300+(5-e.score)*30,score:e.score});const u=lt();u.x=e.x,u.y=e.y,u.fill=e.fill,u.width=s.width,u.height=s.height,u.class="task task-type-"+e.num,u.rx=3,u.ry=3,J(r,u);let y=e.x+14;e.people.forEach(g=>{const m=e.actors[g].color,x={cx:y,cy:e.y,r:7,fill:m,stroke:"#000",title:g,pos:e.actors[g].position};ot(r,x),y+=10}),ht(s)(e.task,r,u.x,u.y,u.width,u.height,{class:"task"},s,e.colour)},"drawTask"),Yt=n(function(t,e){gt(t,e)},"drawBackgroundRect"),ht=(function(){function t(r,f,u,y,g,m,x,h){const i=f.append("text").attr("x",u+g/2).attr("y",y+m/2+5).style("font-color",h).style("text-anchor","middle").text(r);c(i,x)}n(t,"byText");function e(r,f,u,y,g,m,x,h,i){const{taskFontSize:a,taskFontFamily:l}=h,d=r.split(//gi);for(let p=0;p{const f=E[r].color,u={cx:20,cy:c,r:7,fill:f,stroke:"#000",pos:E[r].position};j.drawCircle(t,u);let y=t.append("text").attr("visibility","hidden").text(r);const g=y.node().getBoundingClientRect().width;y.remove();let m=[];if(g<=s)m=[r];else{const x=r.split(" ");let h="";y=t.append("text").attr("visibility","hidden"),x.forEach(i=>{const a=h?`${h} ${i}`:i;if(y.text(a),y.node().getBoundingClientRect().width>s){if(h&&m.push(h),h=i,y.text(i),y.node().getBoundingClientRect().width>s){let d="";for(const p of i)d+=p,y.text(d+"-"),y.node().getBoundingClientRect().width>s&&(m.push(d.slice(0,-1)+"-"),d=p);h=d}}else h=a}),h&&m.push(h),y.remove()}m.forEach((x,h)=>{const i={x:40,y:c+7+h*20,fill:"#666",text:x,textMargin:e.boxTextMargin??5},l=j.drawText(t,i).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),c+=Math.max(20,m.length*20)})}n(ut,"drawActorLegend");var $=R().journey,P=0,Xt=n(function(t,e,s,c){const r=R(),f=r.journey.titleColor,u=r.journey.titleFontSize,y=r.journey.titleFontFamily,g=r.securityLevel;let m;g==="sandbox"&&(m=X("#i"+e));const x=g==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body");S.init();const h=x.select("#"+e);j.initGraphics(h);const i=c.db.getTasks(),a=c.db.getDiagramTitle(),l=c.db.getActors();for(const C in E)delete E[C];let d=0;l.forEach(C=>{E[C]={color:$.actorColours[d%$.actorColours.length],position:d},d++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Gt(h,i,0);const p=S.getBounds();a&&h.append("text").text(a).attr("x",P).attr("font-size",u).attr("font-weight","bold").attr("y",25).attr("fill",f).attr("font-family",y);const o=p.stopy-p.starty+2*$.diagramMarginY,b=P+p.stopx+2*$.diagramMarginX;$t(h,o,b,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",b-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=a?70:0;h.attr("viewBox",`${p.startx} -25 ${b} ${o+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",o+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:n(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:n(function(t,e,s,c){t[e]===void 0?t[e]=s:t[e]=c(s,t[e])},"updateVal"),updateBounds:n(function(t,e,s,c){const r=R().journey,f=this;let u=0;function y(g){return n(function(x){u++;const h=f.sequenceItems.length-u+1;f.updateVal(x,"starty",e-h*r.boxMargin,Math.min),f.updateVal(x,"stopy",c+h*r.boxMargin,Math.max),f.updateVal(S.data,"startx",t-h*r.boxMargin,Math.min),f.updateVal(S.data,"stopx",s+h*r.boxMargin,Math.max),g!=="activation"&&(f.updateVal(x,"startx",t-h*r.boxMargin,Math.min),f.updateVal(x,"stopx",s+h*r.boxMargin,Math.max),f.updateVal(S.data,"starty",e-h*r.boxMargin,Math.min),f.updateVal(S.data,"stopy",c+h*r.boxMargin,Math.max))},"updateItemBounds")}n(y,"updateFn"),this.sequenceItems.forEach(y())},"updateBounds"),insert:n(function(t,e,s,c){const r=Math.min(t,s),f=Math.max(t,s),u=Math.min(e,c),y=Math.max(e,c);this.updateVal(S.data,"startx",r,Math.min),this.updateVal(S.data,"starty",u,Math.min),this.updateVal(S.data,"stopx",f,Math.max),this.updateVal(S.data,"stopy",y,Math.max),this.updateBounds(r,u,f,y)},"insert"),bumpVerticalPos:n(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:n(function(){return this.verticalPos},"getVerticalPos"),getBounds:n(function(){return this.data},"getBounds")},G=$.sectionFills,st=$.sectionColours,Gt=n(function(t,e,s){const c=R().journey;let r="";const f=c.height*2+c.diagramMarginY,u=s+f;let y=0,g="#CCC",m="black",x=0;for(const[h,i]of e.entries()){if(r!==i.section){g=G[y%G.length],x=y%G.length,m=st[y%st.length];let l=0;const d=i.section;for(let o=h;o(E[d]&&(l[d]=E[d]),l),{});i.x=h*c.taskMargin+h*c.width+P,i.y=u,i.width=c.diagramMarginX,i.height=c.diagramMarginY,i.colour=m,i.fill=g,i.num=x,i.actors=a,j.drawTask(t,i,c),S.insert(i.x,i.y,i.x+i.width+c.taskMargin,450)}},"drawTasks"),at={setConf:Ht,draw:Xt},re={parser:Et,db:rt,renderer:at,styles:jt,init:n(t=>{at.setConf(t.journey),rt.clear()},"init")};export{re as diagram}; diff --git a/assets/kanban-definition-3W4ZIXB7-CGGJDAWR.js b/assets/kanban-definition-3W4ZIXB7-CGGJDAWR.js deleted file mode 100644 index e4ddc8fb67c95436cf5dd11f59043c6b4a32fc72..0000000000000000000000000000000000000000 --- a/assets/kanban-definition-3W4ZIXB7-CGGJDAWR.js +++ /dev/null @@ -1,89 +0,0 @@ -import{_ as o,l as te,c as H,I as fe,$ as ye,a0 as me,a1 as be,T as _e,F as K,h as j,t as Ee,J as ke,V as Se,W as ce,X as le}from"./mermaid.core-BcqUqpnI.js";import{g as Ne}from"./chunk-FMBD7UC4-Drrjy9J2.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),u=[1,4],p=[1,13],s=[1,12],d=[1,15],E=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],_=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],b=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,h,t,U){var c=t.length-1;switch(h){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:u},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:u},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(_,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(_,[2,19]),e(_,[2,21],{15:30,24:G}),e(_,[2,22]),e(_,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(V,[2,14],{7:b,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(_,[2,16],{15:37,24:G}),e(_,[2,17]),e(_,[2,18]),e(_,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:b,11:A}),e(L,[2,11]),e(L,[2,12]),e(_,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],h=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),y=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);y.setInput(i,R.yy),R.yy.lexer=y,R.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var q=y.yylloc;t.push(q);var de=y.options&&y.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,h.length=h.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||y.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var k,P,x,Q,F={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((k===null||typeof k>"u")&&(k=ae()),x=U[P]&&U[P][k]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");y.showPosition?Z="Parse error on line "+(W+1)+`: -`+y.showPosition()+` -Expecting `+X.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(k==re?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Z,{text:y.match,token:this.terminals_[k]||k,line:y.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+k);switch(x[0]){case 1:r.push(k),h.push(y.yytext),t.push(y.yylloc),r.push(x[1]),k=null,se=y.yyleng,c=y.yytext,W=y.yylineno,q=y.yylloc;break;case 2:if(C=this.productions_[x[1]][1],F.$=h[h.length-C],F._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(F._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(F,[c,se,W,R.yy,x[1],h,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),h=h.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),h.push(F.$),t.push(F._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` -`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in h)this[t]=h[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),t=0;tn[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,h[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,h[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,h){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"
                "),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=Y;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const u=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===u&&!p&&(p=v[s]),v[s].levell.parentId===d.id);for(const l of m){const D={id:l.id,parentId:d.id,label:j(l.label??"",s),isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};u.push(D)}}return{nodes:u,edges:e,other:{},config:H()}},"getData"),Oe=o((e,u,p,s,d)=>{const E=H();let m=E.mindmap?.padding??K.mindmap.padding;switch(s){case f.ROUNDED_RECT:case f.RECT:case f.HEXAGON:m*=2}const l={id:j(u,E)||"kbn"+ee++,level:e,label:j(p,E),width:E.mindmap?.maxNodeWidth??K.mindmap.maxNodeWidth,padding:m,isGroup:!1};if(d!==void 0){let I;d.includes(` -`)?I=d+` -`:I=`{ -`+d+` -}`;const g=Ee(I,{schema:ke});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),f={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,u)=>{switch(te.debug("In get type",e,u),e){case"[":return f.RECT;case"(":return u===")"?f.ROUNDED_RECT:f.CLOUD;case"((":return f.CIRCLE;case")":return f.CLOUD;case"))":return f.BANG;case"{{":return f.HEXAGON;default:return f.DEFAULT}},"getType"),Ce=o((e,u)=>{ie[e]=u},"setElementForId"),we=o(e=>{if(!e)return;const u=H(),p=v[v.length-1];e.icon&&(p.icon=j(e.icon,u)),e.class&&(p.cssClasses=j(e.class,u))},"decorateNode"),Ae=o(e=>{switch(e){case f.DEFAULT:return"no-border";case f.RECT:return"rect";case f.ROUNDED_RECT:return"rounded-rect";case f.CIRCLE:return"circle";case f.CLOUD:return"cloud";case f.BANG:return"bang";case f.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:f,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,u,p,s)=>{te.debug(`Rendering kanban diagram -`+e);const E=s.db.getData(),m=H();m.htmlLabels=!1;const l=fe(u),D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=E.nodes.filter(b=>b.isGroup);let w=0;const _=10,G=[];let N=25;for(const b of g){const A=m?.kanban?.sectionWidth||200;w=w+1,b.x=A*w+(w-1)*_/2,b.width=A,b.y=0,b.height=A*3,b.rx=5,b.ry=5,b.cssClasses=b.cssClasses+" section-"+w;const L=await ye(D,b);N=Math.max(N,L?.labelBBox?.height),G.push(L)}let V=0;for(const b of g){const A=G[V];V=V+1;const L=m?.kanban?.sectionWidth||200,M=-L*3/2+N;let T=M;const Y=E.nodes.filter(i=>i.parentId===b.id);for(const i of Y){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=b.x,i.width=L-1.5*_;const r=(await me(I,i,{config:m})).node().getBBox();i.y=T+r.height/2,await be(i),T=i.y+r.height/2+_/2}const B=A.cluster.select("rect"),O=Math.max(T-M+3*_,50)+(N-25);B.attr("height",O)}_e(void 0,l,m.mindmap?.padding??K.kanban.padding,m.mindmap?.useMaxWidth??K.kanban.useMaxWidth)},"draw"),Fe={draw:Be},je=o(e=>{let u="";for(let s=0;se.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s` - .edge { - stroke-width: 3; - } - ${je(e)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${e.git0}; - } - .section-root text { - fill: ${e.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .cluster-label, .label { - color: ${e.textColor}; - fill: ${e.textColor}; - } - .kanban-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; - } - ${Ne()} -`,"getStyles"),Me=Ge,Je={db:Ve,renderer:Fe,parser:xe,styles:Me};export{Je as diagram}; diff --git a/assets/kernelBlur.fragment-B665N8h6.js b/assets/kernelBlur.fragment-B665N8h6.js deleted file mode 100644 index 46ed31e4a883b1424fa6dd025e7ff87747cc862a..0000000000000000000000000000000000000000 --- a/assets/kernelBlur.fragment-B665N8h6.js +++ /dev/null @@ -1,57 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./kernelBlurVaryingDeclaration-cHycnftE.js";import"./packingFunctions-Dod19T_v.js";import"./index-DydPgVMC.js";const t="kernelBlurFragment",l=`#ifdef DOF -factor=sampleCoC(fragmentInputs.sampleCoord{X}); -computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight; -#else -computedWeight=KERNEL_WEIGHT{X}; -#endif -#ifdef PACKEDFLOAT -blend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X}))*computedWeight; -#else -blend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X})*computedWeight; -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=l);const a="kernelBlurFragment2",m=`#ifdef DOF -factor=sampleCoC(fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight; -#else -computedWeight=KERNEL_DEP_WEIGHT{X}; -#endif -#ifdef PACKEDFLOAT -blend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X}))*computedWeight; -#else -blend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X})*computedWeight; -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=m);const r="kernelBlurPixelShader",n=`var textureSamplerSampler: sampler;var textureSampler: texture_2d;uniform delta: vec2f;varying sampleCenter: vec2f; -#ifdef DOF -var circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d;fn sampleCoC(offset: vec2f)->f32 {var coc: f32=textureSample(circleOfConfusionSampler,circleOfConfusionSamplerSampler,offset).r;return coc; } -#endif -#include[0..varyingCount] -#ifdef PACKEDFLOAT -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var computedWeight: f32=0.0; -#ifdef PACKEDFLOAT -var blend: f32=0.; -#else -var blend: vec4f= vec4f(0.); -#endif -#ifdef DOF -var sumOfWeights: f32=CENTER_WEIGHT; -var factor: f32=0.0; -#ifdef PACKEDFLOAT -blend+=unpack(textureSample(textureSampler,textureSamplerSampler,input.sampleCenter))*CENTER_WEIGHT; -#else -blend+=textureSample(textureSampler,textureSamplerSampler,input.sampleCenter)*CENTER_WEIGHT; -#endif -#endif -#include[0..varyingCount] -#include[0..depCount] -#ifdef PACKEDFLOAT -fragmentOutputs.color=pack(blend); -#else -fragmentOutputs.color=blend; -#endif -#ifdef DOF -fragmentOutputs.color/=sumOfWeights; -#endif -}`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=n);const i={name:r,shader:n};export{i as kernelBlurPixelShaderWGSL}; diff --git a/assets/kernelBlur.fragment-CrQJPqjK.js b/assets/kernelBlur.fragment-CrQJPqjK.js deleted file mode 100644 index a3184f03c73ed5efae7116ec329d31103f091c47..0000000000000000000000000000000000000000 --- a/assets/kernelBlur.fragment-CrQJPqjK.js +++ /dev/null @@ -1,57 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./kernelBlurVaryingDeclaration-IJzWV2x_.js";import"./packingFunctions-qIF0h5ys.js";import"./index-DydPgVMC.js";const r="kernelBlurFragment",o=`#ifdef DOF -factor=sampleCoC(sampleCoord{X}); -computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight; -#else -computedWeight=KERNEL_WEIGHT{X}; -#endif -#ifdef PACKEDFLOAT -blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight; -#else -blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight; -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=o);const l="kernelBlurFragment2",d=`#ifdef DOF -factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight; -#else -computedWeight=KERNEL_DEP_WEIGHT{X}; -#endif -#ifdef PACKEDFLOAT -blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight; -#else -blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight; -#endif -`;e.IncludesShadersStore[l]||(e.IncludesShadersStore[l]=d);const t="kernelBlurPixelShader",n=`uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter; -#ifdef DOF -uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; } -#endif -#include[0..varyingCount] -#ifdef PACKEDFLOAT -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{float computedWeight=0.0; -#ifdef PACKEDFLOAT -float blend=0.; -#else -vec4 blend=vec4(0.); -#endif -#ifdef DOF -float sumOfWeights=CENTER_WEIGHT; -float factor=0.0; -#ifdef PACKEDFLOAT -blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT; -#else -blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT; -#endif -#endif -#include[0..varyingCount] -#include[0..depCount] -#ifdef PACKEDFLOAT -gl_FragColor=pack(blend); -#else -gl_FragColor=blend; -#endif -#ifdef DOF -gl_FragColor/=sumOfWeights; -#endif -}`;e.ShadersStore[t]||(e.ShadersStore[t]=n);const s={name:t,shader:n};export{s as kernelBlurPixelShader}; diff --git a/assets/kernelBlur.vertex-D8toEb2h.js b/assets/kernelBlur.vertex-D8toEb2h.js deleted file mode 100644 index 60efca5be8fc46b90d34043333706c7badabbac4..0000000000000000000000000000000000000000 --- a/assets/kernelBlur.vertex-D8toEb2h.js +++ /dev/null @@ -1,11 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./kernelBlurVaryingDeclaration-IJzWV2x_.js";import"./index-DydPgVMC.js";const n="kernelBlurVertex",o="sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};";e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=o);const r="kernelBlurVertexShader",t=`attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter; -#include[0..varyingCount] -const vec2 madd=vec2(0.5,0.5); -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -sampleCenter=(position*madd+madd); -#include[0..varyingCount] -gl_Position=vec4(position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;e.ShadersStore[r]||(e.ShadersStore[r]=t);const s={name:r,shader:t};export{s as kernelBlurVertexShader}; diff --git a/assets/kernelBlur.vertex-DDIxG4P-.js b/assets/kernelBlur.vertex-DDIxG4P-.js deleted file mode 100644 index ba38d5e2752ddad36fefdd5dfa6eac25d6cbfb78..0000000000000000000000000000000000000000 --- a/assets/kernelBlur.vertex-DDIxG4P-.js +++ /dev/null @@ -1,11 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./kernelBlurVaryingDeclaration-cHycnftE.js";import"./index-DydPgVMC.js";const r="kernelBlurVertex",o="vertexOutputs.sampleCoord{X}=vertexOutputs.sampleCenter+uniforms.delta*KERNEL_OFFSET{X};";e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=o);const t="kernelBlurVertexShader",n=`attribute position: vec2f;uniform delta: vec2f;varying sampleCenter: vec2f; -#include[0..varyingCount] -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5); -#define CUSTOM_VERTEX_MAIN_BEGIN -vertexOutputs.sampleCenter=(input.position*madd+madd); -#include[0..varyingCount] -vertexOutputs.position= vec4f(input.position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;e.ShadersStoreWGSL[t]||(e.ShadersStoreWGSL[t]=n);const u={name:t,shader:n};export{u as kernelBlurVertexShaderWGSL}; diff --git a/assets/kernelBlurVaryingDeclaration-IJzWV2x_.js b/assets/kernelBlurVaryingDeclaration-IJzWV2x_.js deleted file mode 100644 index df2dcd4519b7834af3f0011d447bc481cccba29a..0000000000000000000000000000000000000000 --- a/assets/kernelBlurVaryingDeclaration-IJzWV2x_.js +++ /dev/null @@ -1 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="kernelBlurVaryingDeclaration",a="varying vec2 sampleCoord{X};";e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=a); diff --git a/assets/kernelBlurVaryingDeclaration-cHycnftE.js b/assets/kernelBlurVaryingDeclaration-cHycnftE.js deleted file mode 100644 index 42cfbd07f2edb00659ecc0cf08ec9a8f8a8cbc73..0000000000000000000000000000000000000000 --- a/assets/kernelBlurVaryingDeclaration-cHycnftE.js +++ /dev/null @@ -1 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="kernelBlurVaryingDeclaration",a="varying sampleCoord{X}: vec2f;";e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=a); diff --git a/assets/key-CFGu0zzg.js b/assets/key-CFGu0zzg.js deleted file mode 100644 index 4005ec78e4512d11cca672342783d949a57faeeb..0000000000000000000000000000000000000000 --- a/assets/key-CFGu0zzg.js +++ /dev/null @@ -1 +0,0 @@ -import{p as t,a6 as i,h as c,e as f}from"./index-DydPgVMC.js";import{B as y}from"./i18n-CPHyzK9b.js";function k(e,r,n){c&&f();var s=new y(e),o=!i();t(()=>{var a=r();o&&a!==null&&typeof a=="object"&&(a={}),s.ensure(a,n)})}export{k}; diff --git a/assets/ktxTextureLoader-QzpaI7Ap.js b/assets/ktxTextureLoader-QzpaI7Ap.js deleted file mode 100644 index 77d064ea9a1eac19b058fe99d37e1815af0b727e..0000000000000000000000000000000000000000 --- a/assets/ktxTextureLoader-QzpaI7Ap.js +++ /dev/null @@ -1 +0,0 @@ -import{L as n,d as _}from"./index-GY9JDBGV.js";import{A as u}from"./workerPool-CfMXSLnf.js";import"./index-DydPgVMC.js";class d{constructor(s,e){if(this.data=s,this.isInvalid=!1,!d.IsValid(s)){this.isInvalid=!0,n.Error("texture missing KTX identifier");return}const i=Uint32Array.BYTES_PER_ELEMENT,r=new DataView(this.data.buffer,this.data.byteOffset+12,13*i),a=r.getUint32(0,!0)===67305985;if(this.glType=r.getUint32(1*i,a),this.glTypeSize=r.getUint32(2*i,a),this.glFormat=r.getUint32(3*i,a),this.glInternalFormat=r.getUint32(4*i,a),this.glBaseInternalFormat=r.getUint32(5*i,a),this.pixelWidth=r.getUint32(6*i,a),this.pixelHeight=r.getUint32(7*i,a),this.pixelDepth=r.getUint32(8*i,a),this.numberOfArrayElements=r.getUint32(9*i,a),this.numberOfFaces=r.getUint32(10*i,a),this.numberOfMipmapLevels=r.getUint32(11*i,a),this.bytesOfKeyValueData=r.getUint32(12*i,a),this.glType!==0){n.Error("only compressed formats currently supported"),this.isInvalid=!0;return}else this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels);if(this.pixelHeight===0||this.pixelDepth!==0){n.Error("only 2D textures currently supported"),this.isInvalid=!0;return}if(this.numberOfArrayElements!==0){n.Error("texture arrays not currently supported"),this.isInvalid=!0;return}if(this.numberOfFaces!==e){n.Error("number of faces expected"+e+", but found "+this.numberOfFaces),this.isInvalid=!0;return}this.loadType=d.COMPRESSED_2D}uploadLevels(s,e){this.loadType===d.COMPRESSED_2D&&this._upload2DCompressedLevels(s,e)}_upload2DCompressedLevels(s,e){let i=d.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,c=this.pixelHeight;const a=e?this.numberOfMipmapLevels:1;for(let f=0;f=12){const e=new Uint8Array(s.buffer,s.byteOffset,12);if(e[0]===171&&e[1]===75&&e[2]===84&&e[3]===88&&e[4]===32&&e[5]===49&&e[6]===49&&e[7]===187&&e[8]===13&&e[9]===10&&e[10]===26&&e[11]===10)return!0}return!1}}d.HEADER_LEN=64;d.COMPRESSED_2D=0;d.COMPRESSED_3D=1;d.TEX_2D=2;d.TEX_3D=3;var h;(function(t){t[t.ETC1S=0]="ETC1S",t[t.UASTC4x4=1]="UASTC4x4"})(h||(h={}));var m;(function(t){t[t.ASTC_4X4_RGBA=0]="ASTC_4X4_RGBA",t[t.ASTC_4x4_RGBA=0]="ASTC_4x4_RGBA",t[t.BC7_RGBA=1]="BC7_RGBA",t[t.BC3_RGBA=2]="BC3_RGBA",t[t.BC1_RGB=3]="BC1_RGB",t[t.PVRTC1_4_RGBA=4]="PVRTC1_4_RGBA",t[t.PVRTC1_4_RGB=5]="PVRTC1_4_RGB",t[t.ETC2_RGBA=6]="ETC2_RGBA",t[t.ETC1_RGB=7]="ETC1_RGB",t[t.RGBA32=8]="RGBA32",t[t.R8=9]="R8",t[t.RG8=10]="RG8"})(m||(m={}));var U;(function(t){t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGBA_ASTC_4X4_KHR=37808]="COMPRESSED_RGBA_ASTC_4X4_KHR",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.RGBA8Format=32856]="RGBA8Format",t[t.R8Format=33321]="R8Format",t[t.RG8Format=33323]="RG8Format"})(U||(U={}));function A(t,s){const e=s?.jsDecoderModule||KTX2DECODER;t&&(t.wasmBaseUrl&&(e.Transcoder.WasmBaseUrl=t.wasmBaseUrl),t.wasmUASTCToASTC&&(e.LiteTranscoder_UASTC_ASTC.WasmModuleURL=t.wasmUASTCToASTC),t.wasmUASTCToBC7&&(e.LiteTranscoder_UASTC_BC7.WasmModuleURL=t.wasmUASTCToBC7),t.wasmUASTCToRGBA_UNORM&&(e.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL=t.wasmUASTCToRGBA_UNORM),t.wasmUASTCToRGBA_SRGB&&(e.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL=t.wasmUASTCToRGBA_SRGB),t.wasmUASTCToR8_UNORM&&(e.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL=t.wasmUASTCToR8_UNORM),t.wasmUASTCToRG8_UNORM&&(e.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL=t.wasmUASTCToRG8_UNORM),t.jsMSCTranscoder&&(e.MSCTranscoder.JSModuleURL=t.jsMSCTranscoder),t.wasmMSCTranscoder&&(e.MSCTranscoder.WasmModuleURL=t.wasmMSCTranscoder),t.wasmZSTDDecoder&&(e.ZSTDDecoder.WasmModuleURL=t.wasmZSTDDecoder)),s&&(s.wasmUASTCToASTC&&(e.LiteTranscoder_UASTC_ASTC.WasmBinary=s.wasmUASTCToASTC),s.wasmUASTCToBC7&&(e.LiteTranscoder_UASTC_BC7.WasmBinary=s.wasmUASTCToBC7),s.wasmUASTCToRGBA_UNORM&&(e.LiteTranscoder_UASTC_RGBA_UNORM.WasmBinary=s.wasmUASTCToRGBA_UNORM),s.wasmUASTCToRGBA_SRGB&&(e.LiteTranscoder_UASTC_RGBA_SRGB.WasmBinary=s.wasmUASTCToRGBA_SRGB),s.wasmUASTCToR8_UNORM&&(e.LiteTranscoder_UASTC_R8_UNORM.WasmBinary=s.wasmUASTCToR8_UNORM),s.wasmUASTCToRG8_UNORM&&(e.LiteTranscoder_UASTC_RG8_UNORM.WasmBinary=s.wasmUASTCToRG8_UNORM),s.jsMSCTranscoder&&(e.MSCTranscoder.JSModule=s.jsMSCTranscoder),s.wasmMSCTranscoder&&(e.MSCTranscoder.WasmBinary=s.wasmMSCTranscoder),s.wasmZSTDDecoder&&(e.ZSTDDecoder.WasmBinary=s.wasmZSTDDecoder))}function G(t){typeof t>"u"&&typeof KTX2DECODER<"u"&&(t=KTX2DECODER);let s;onmessage=e=>{if(e.data)switch(e.data.action){case"init":{const i=e.data.urls;i&&(i.jsDecoderModule&&typeof t>"u"&&(importScripts(i.jsDecoderModule),t=KTX2DECODER),A(i)),e.data.wasmBinaries&&A(void 0,{...e.data.wasmBinaries,jsDecoderModule:t}),s=new t.KTX2Decoder,postMessage({action:"init"});break}case"setDefaultDecoderOptions":{t.KTX2Decoder.DefaultDecoderOptions=e.data.options;break}case"decode":s.decode(e.data.data,e.data.caps,e.data.options).then(i=>{const r=[];for(let c=0;c{postMessage({action:"decoded",success:!1,msg:i})});break}}}async function M(t,s,e){return await new Promise((i,r)=>{const c=f=>{t.removeEventListener("error",c),t.removeEventListener("message",a),r(f)},a=f=>{f.data.action==="init"&&(t.removeEventListener("error",c),t.removeEventListener("message",a),i(t))};t.addEventListener("error",c),t.addEventListener("message",a),t.postMessage({action:"init",urls:e,wasmBinaries:s})})}class y{constructor(){this._isDirty=!0,this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC=!0,this._ktx2DecoderOptions={}}get isDirty(){return this._isDirty}get useRGBAIfASTCBC7NotAvailableWhenUASTC(){return this._useRGBAIfASTCBC7NotAvailableWhenUASTC}set useRGBAIfASTCBC7NotAvailableWhenUASTC(s){this._useRGBAIfASTCBC7NotAvailableWhenUASTC!==s&&(this._useRGBAIfASTCBC7NotAvailableWhenUASTC=s,this._isDirty=!0)}get useRGBAIfOnlyBC1BC3AvailableWhenUASTC(){return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC}set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(s){this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC!==s&&(this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC=s,this._isDirty=!0)}get forceRGBA(){return this._forceRGBA}set forceRGBA(s){this._forceRGBA!==s&&(this._forceRGBA=s,this._isDirty=!0)}get forceR8(){return this._forceR8}set forceR8(s){this._forceR8!==s&&(this._forceR8=s,this._isDirty=!0)}get forceRG8(){return this._forceRG8}set forceRG8(s){this._forceRG8!==s&&(this._forceRG8=s,this._isDirty=!0)}get bypassTranscoders(){return this._bypassTranscoders}set bypassTranscoders(s){this._bypassTranscoders!==s&&(this._bypassTranscoders=s,this._isDirty=!0)}_getKTX2DecoderOptions(){if(!this._isDirty)return this._ktx2DecoderOptions;this._isDirty=!1;const s={};return this._useRGBAIfASTCBC7NotAvailableWhenUASTC!==void 0&&(s.useRGBAIfASTCBC7NotAvailableWhenUASTC=this._useRGBAIfASTCBC7NotAvailableWhenUASTC),this._forceRGBA!==void 0&&(s.forceRGBA=this._forceRGBA),this._forceR8!==void 0&&(s.forceR8=this._forceR8),this._forceRG8!==void 0&&(s.forceRG8=this._forceRG8),this._bypassTranscoders!==void 0&&(s.bypassTranscoders=this._bypassTranscoders),this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC&&(s.transcodeFormatDecisionTree={UASTC:{transcodeFormat:[m.BC1_RGB,m.BC3_RGBA],yes:{transcodeFormat:m.RGBA32,engineFormat:32856,roundToMultiple4:!1}}}),this._ktx2DecoderOptions=s,s}}class o{static GetDefaultNumWorkers(){return typeof navigator!="object"||!navigator.hardwareConcurrency?1:Math.min(Math.floor(navigator.hardwareConcurrency*.5),4)}static _Initialize(s){if(o._WorkerPoolPromise||o._DecoderModulePromise)return;const e={wasmBaseUrl:_.ScriptBaseUrl,jsDecoderModule:_.GetBabylonScriptURL(this.URLConfig.jsDecoderModule,!0),wasmUASTCToASTC:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToASTC,!0),wasmUASTCToBC7:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToBC7,!0),wasmUASTCToRGBA_UNORM:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_UNORM,!0),wasmUASTCToRGBA_SRGB:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_SRGB,!0),wasmUASTCToR8_UNORM:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToR8_UNORM,!0),wasmUASTCToRG8_UNORM:_.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRG8_UNORM,!0),jsMSCTranscoder:_.GetBabylonScriptURL(this.URLConfig.jsMSCTranscoder,!0),wasmMSCTranscoder:_.GetBabylonScriptURL(this.URLConfig.wasmMSCTranscoder,!0),wasmZSTDDecoder:_.GetBabylonScriptURL(this.URLConfig.wasmZSTDDecoder,!0)};s&&typeof Worker=="function"&&typeof URL<"u"?o._WorkerPoolPromise=new Promise(i=>{const r=`${A}(${G})()`,c=URL.createObjectURL(new Blob([r],{type:"application/javascript"}));i(new u(s,async()=>await M(new Worker(c),void 0,e)))}):typeof o._KTX2DecoderModule>"u"?o._DecoderModulePromise=_.LoadBabylonScriptAsync(e.jsDecoderModule).then(()=>(o._KTX2DecoderModule=KTX2DECODER,o._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread=!1,o._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread=!0,A(e,o._KTX2DecoderModule),new o._KTX2DecoderModule.KTX2Decoder)):(o._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread=!1,o._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread=!0,o._DecoderModulePromise=Promise.resolve(new o._KTX2DecoderModule.KTX2Decoder))}constructor(s,e=o.DefaultNumWorkers){this._engine=s;const i=typeof e=="object"&&e.workerPool||o.WorkerPool;if(i)o._WorkerPoolPromise=Promise.resolve(i);else{typeof e=="object"?o._KTX2DecoderModule=e?.binariesAndModulesContainer?.jsDecoderModule:typeof KTX2DECODER<"u"&&(o._KTX2DecoderModule=KTX2DECODER);const r=typeof e=="number"?e:e.numWorkers??o.DefaultNumWorkers;o._Initialize(r)}}async _uploadAsync(s,e,i){const r=this._engine.getCaps(),c={astc:!!r.astc,bptc:!!r.bptc,s3tc:!!r.s3tc,pvrtc:!!r.pvrtc,etc2:!!r.etc2,etc1:!!r.etc1};if(o._WorkerPoolPromise){const a=await o._WorkerPoolPromise;return await new Promise((f,l)=>{a.push((R,T)=>{const C=S=>{R.removeEventListener("error",C),R.removeEventListener("message",p),l(S),T()},p=S=>{if(S.data.action==="decoded"){if(R.removeEventListener("error",C),R.removeEventListener("message",p),!S.data.success)l({message:S.data.msg});else try{this._createTexture(S.data.decodedData,e,i),f()}catch(D){l({message:D})}T()}};R.addEventListener("error",C),R.addEventListener("message",p),R.postMessage({action:"setDefaultDecoderOptions",options:o.DefaultDecoderOptions._getKTX2DecoderOptions()});const B=new Uint8Array(s.byteLength);B.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),R.postMessage({action:"decode",data:B,caps:c,options:i},[B.buffer])})})}else if(o._DecoderModulePromise){const a=await o._DecoderModulePromise;return o.DefaultDecoderOptions.isDirty&&(o._KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions=o.DefaultDecoderOptions._getKTX2DecoderOptions()),await new Promise((f,l)=>{a.decode(s,r).then(R=>{this._createTexture(R,e),f()}).catch(R=>{l({message:R})})})}throw new Error("KTX2 decoder module is not available")}_createTexture(s,e,i){this._engine._bindTextureDirectly(3553,e),i&&(i.transcodedFormat=s.transcodedFormat,i.isInGammaSpace=s.isInGammaSpace,i.hasAlpha=s.hasAlpha,i.transcoderName=s.transcoderName);let c=!0;switch(s.transcodedFormat){case 32856:e.type=0,e.format=5;break;case 33321:e.type=0,e.format=6;break;case 33323:e.type=0,e.format=7;break;default:e.format=s.transcodedFormat,c=!1;break}if(e._gammaSpace=s.isInGammaSpace,e.generateMipMaps=s.mipmaps.length>1,e.width=s.mipmaps[0].width,e.height=s.mipmaps[0].height,s.errors)throw new Error("KTX2 container - could not transcode the data. "+s.errors);for(let a=0;a=12){const e=new Uint8Array(s.buffer,s.byteOffset,12);if(e[0]===171&&e[1]===75&&e[2]===84&&e[3]===88&&e[4]===32&&e[5]===50&&e[6]===48&&e[7]===187&&e[8]===13&&e[9]===10&&e[10]===26&&e[11]===10)return!0}return!1}}o.URLConfig={jsDecoderModule:"https://cdn.babylonjs.com/babylon.ktx2Decoder.js",wasmUASTCToASTC:null,wasmUASTCToBC7:null,wasmUASTCToRGBA_UNORM:null,wasmUASTCToRGBA_SRGB:null,wasmUASTCToR8_UNORM:null,wasmUASTCToRG8_UNORM:null,jsMSCTranscoder:null,wasmMSCTranscoder:null,wasmZSTDDecoder:null};o.DefaultNumWorkers=o.GetDefaultNumWorkers();o.DefaultDecoderOptions=new y;function w(t){switch(t){case 35916:return 33776;case 35918:return 33778;case 35919:return 33779;case 37493:return 37492;case 37497:return 37496;case 37495:return 37494;case 37840:return 37808;case 36493:return 36492}return null}class L{constructor(){this.supportCascades=!1}loadCubeData(s,e,i,r){if(Array.isArray(s))return;e._invertVScale=!e.invertY;const c=e.getEngine(),a=new d(s,6),f=a.numberOfMipmapLevels>1&&e.generateMipMaps;c._unpackFlipY(!0),a.uploadLevels(e,e.generateMipMaps),e.width=a.pixelWidth,e.height=a.pixelHeight,c._setCubeMapTextureParams(e,f,a.numberOfMipmapLevels-1),e.isReady=!0,e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),r&&r()}loadData(s,e,i,r){if(d.IsValid(s)){e._invertVScale=!e.invertY;const c=new d(s,1),a=w(c.glInternalFormat);a?(e.format=a,e._useSRGBBuffer=e.getEngine()._getUseSRGBBuffer(!0,e.generateMipMaps),e._gammaSpace=!0):e.format=c.glInternalFormat,i(c.pixelWidth,c.pixelHeight,e.generateMipMaps,!0,()=>{c.uploadLevels(e,e.generateMipMaps)},c.isInvalid)}else o.IsValid(s)?new o(e.getEngine())._uploadAsync(s,e,r).then(()=>{i(e.width,e.height,e.generateMipMaps,!0,()=>{},!1)},a=>{n.Warn(`Failed to load KTX2 texture data: ${a.message}`),i(0,0,!1,!1,()=>{},!0)}):(n.Error("texture missing KTX identifier"),i(0,0,!1,!1,()=>{},!0))}}export{L as _KTXTextureLoader}; diff --git a/assets/layout-Blpw3L9v.js b/assets/layout-Blpw3L9v.js deleted file mode 100644 index 6f9c4844032b39d9d484b9776510c785f48f2ce6..0000000000000000000000000000000000000000 --- a/assets/layout-Blpw3L9v.js +++ /dev/null @@ -1 +0,0 @@ -import{b as Ge,G as g,i as m,v as E}from"./graph-CmFD0A_p.js";import{i as z,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as be,d as G,x as We,b as ze,y as Xe,n as f,m as I,r as B}from"./_baseUniq-BFKEI0vc.js";import{f as O,b as me,a as He,c as Ue,m as w,d as P}from"./min-Rtq3U8dQ.js";import{aD as M,b0 as Je,b1 as Ke,aK as ge,b2 as S,au as ye,aV as Ze,am as Qe,a_ as en,b3 as nn,ao as xe,aZ as rn,aJ as Ee,an as ke,aB as tn,aM as an,b4 as X}from"./mermaid.core-BcqUqpnI.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,ln=/^0o[0-7]+$/i,hn=parseInt;function vn(e){if(typeof e=="number")return e;if(z(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||ln.test(e)?hn(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function bn(e){return Je(Ke(e,void 0,O),e+"")}var mn=1,gn=4;function yn(e){return Ge(e,mn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var U=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function j(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?me(e,xe,_n):void 0}function J(e,n){return e&&e.length?me(e,C(n),He):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++in||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function Bn(e,n,r){n.length?n=G(n,function(o){return ke(o)?function(a){return be(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=G(n,tn(C));var i=Ue(e,function(o,a,u){var d=G(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return An(o,a,r)})}function jn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var A=bn(function(e,n){return e==null?{}:jn(e,n)}),Vn=Math.ceil,Gn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Gn(Vn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,ze(n),[])}),Dn=0;function K(e){var n=++Dn;return Xe(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,H(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,H(n,r,s)}),e.removeNode(t.v),o}function Kn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new zn}),a=t+1;return f(r.nodes(),function(u){H(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function H(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Zn(e){var n=e.graph().acyclicer==="greedy"?Un(e,r(e)):Qn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,K("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Qn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=K(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function V(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){m(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return J(s,function(c){return _(n,c)})}function Ae(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Q(e,n),xr(e,n)}function xr(e,n){var r=U(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=Z;function Nr(e){Z(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Be(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Be(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(l){Be(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return B(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),l=m(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=K("_root")););return n}function Mr(e,n){for(var r=0,t=1;t0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Ar(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=B(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Br(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return jr(t)}function jr(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Vr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return A(o,["vs","i","barycenter","weight"])})}function Vr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Gr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function je(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Ar(e,i);f(s,function(p){if(e.children(p.v).length){var b=je(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&Dr(p,b)}});var c=Br(s,r);$r(c,d);var l=Gr(c,t);if(a&&(l.vs=O([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=le(e,k(1,n+1),"inEdges"),t=le(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);he(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=V(e);var s=Mr(e,i);sa||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Hr(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Ur(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,l){var h=Kr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(o.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var L=e.node(b),ne=L.order;(nes)&&Ve(r,h,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(a,s,l,u,d),s=l,u=d)}t(a,s,a.length,d,o.length)}),a}return B(n,i),r}function Kr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Ve(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Zr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Qr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return a[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];o[s]===s&&d{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Zn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>zr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>hr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var lt=["nodesep","edgesep","ranksep","marginx","marginy"],ht={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},bt=["minlen","weight","width","height","labeloffset"],mt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(X({},ht,q(r,lt),A(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,X({},mt,q(i,bt),A(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=V(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return j(A(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Bt as l}; diff --git a/assets/lightFragment-CZjYZOQF.js b/assets/lightFragment-CZjYZOQF.js deleted file mode 100644 index 0e797d4e0160a6b0c2eae86941dca2dc4738553c..0000000000000000000000000000000000000000 --- a/assets/lightFragment-CZjYZOQF.js +++ /dev/null @@ -1,376 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="clusteredLightingFunctions",o=`struct ClusteredLight {vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;vec4 vLightDirection;vec4 vLightFalloff;}; -#define inline -ClusteredLight getClusteredLight(sampler2D lightDataTexture,int index) {return ClusteredLight( -texelFetch(lightDataTexture,ivec2(0,index),0), -texelFetch(lightDataTexture,ivec2(1,index),0), -texelFetch(lightDataTexture,ivec2(2,index),0), -texelFetch(lightDataTexture,ivec2(3,index),0), -texelFetch(lightDataTexture,ivec2(4,index),0) -);} -int getClusteredSliceIndex(vec2 sliceData,float viewDepth) {return int(log(viewDepth)*sliceData.x+sliceData.y);} -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=o);const t="lightFragment",n=`#ifdef LIGHT{X} -#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) -#else -vec4 diffuse{X}=light{X}.vLightDiffuse; -#define CUSTOM_LIGHT{X}_COLOR -#if defined(PBR) && defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting( -lightDataTexture{X}, -tileMaskTexture{X}, -light{X}.vLightData, -ivec2(light{X}.vSliceRanges[sliceIndex]), -viewDirectionW, -normalW, -vPositionW, -surfaceAlbedo, -reflectivityOut -#ifdef IRIDESCENCE -,iridescenceIntensity -#endif -#ifdef SS_TRANSLUCENCY -,subSurfaceOut -#endif -#ifdef SPECULARTERM -,AARoughnessFactors.x -#endif -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#ifdef SHEEN -,sheenOut -#endif -#ifdef CLEARCOAT -,clearcoatOut -#endif -);} -#elif defined(PBR) -#ifdef SPOTLIGHT{X} -preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW); -#elif defined(POINTLIGHT{X}) -preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW); -#elif defined(HEMILIGHT{X}) -preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); -#elif defined(DIRLIGHT{X}) -preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness); -#endif -preInfo.NdotV=NdotV; -#ifdef SPOTLIGHT{X} -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w); -#endif -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w); -#endif -#else -preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); -#else -preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#endif -#elif defined(POINTLIGHT{X}) -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); -#else -preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#endif -#else -preInfo.attenuation=1.0; -#endif -#if defined(HEMILIGHT{X}) -preInfo.roughness=roughness; -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo.roughness=roughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -preInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo; -#ifdef IRIDESCENCE -preInfo.iridescenceIntensity=iridescenceIntensity; -#endif -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission=vec3(0.0); -#endif -#ifdef HEMILIGHT{X} -info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -info.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb); -#elif defined(SS_TRANSLUCENCY) -#ifndef SS_TRANSLUCENCY_LEGACY -info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); -#else -info.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); -#endif -#else -info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb); -#endif -#ifdef SPECULARTERM -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -info.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#else -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -{vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);} -#else -coloredFresnel=fresnelSchlickGGX(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#endif -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -{float NdotH=dot(normalW,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);} -#endif -#ifdef ANISOTROPIC -info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); -#else -info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb); -#endif -#endif -#endif -#ifndef AREALIGHT{X} -#ifdef SHEEN -#ifdef SHEEN_LINKWITHALBEDO -preInfo.roughness=sheenOut.sheenIntensity; -#else -#ifdef HEMILIGHT{X} -preInfo.roughness=sheenOut.sheenRoughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -#endif -info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); -#endif -#ifdef CLEARCOAT -#ifdef HEMILIGHT{X} -preInfo.roughness=clearcoatOut.clearCoatRoughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb); -#ifdef CLEARCOAT_TINT -absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=absorption; -#endif -#ifdef SPECULARTERM -info.specular*=absorption; -#endif -#endif -info.diffuse*=info.clearCoat.w; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=info.clearCoat.w; -#endif -#ifdef SPECULARTERM -info.specular*=info.clearCoat.w; -#endif -#ifdef SHEEN -info.sheen*=info.clearCoat.w; -#endif -#endif -#endif -#else -#ifdef SPOTLIGHT{X} -#ifdef IESLIGHTTEXTURE{X} -info=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X}); -#else -info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); -#endif -#elif defined(HEMILIGHT{X}) -info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness); -#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X}) -info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -info=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb, -#ifdef AREALIGHTNOROUGHTNESS -0.5 -#else -vReflectionInfos.y -#endif -); -#elif defined(CLUSTLIGHT{X}) && CLUSTLIGHT_BATCH>0 -{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(lightDataTexture{X},tileMaskTexture{X},viewDirectionW,normalW,light{X}.vLightData,ivec2(light{X}.vSliceRanges[sliceIndex]),glossiness);} -#endif -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW); -#endif -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -for (int i=0; i=0.) {index{X}=i;break;}} -#ifdef SHADOWCSMUSESHADOWMAXZ{X} -if (index{X}>=0) -#endif -{ -#if defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#else -shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#endif -#else -shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#ifdef SHADOWCSMDEBUG{X} -shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}]; -#endif -#ifndef SHADOWCSMNOBLEND{X} -float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.) -{index{X}+=1;float nextShadow=0.; -#if defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#elif defined(SHADOWMEDIUMQUALITY{X}) -nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#else -nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); -#endif -#else -nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -shadow=mix(nextShadow,shadow,diffRatio); -#ifdef SHADOWCSMDEBUG{X} -shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio); -#endif -} -#endif -} -#elif defined(SHADOWCLOSEESM{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); -#else -shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWESM{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); -#else -shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPOISSON{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues); -#else -shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#else -#if defined(SHADOWCUBE{X}) -shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues); -#else -shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#endif -#ifdef SHADOWONLY -#ifndef SHADOWINUSE -#define SHADOWINUSE -#endif -globalShadow+=shadow;shadowLightCount+=1.0; -#endif -#else -shadow=1.; -#endif -aggShadow+=shadow;numLights+=1.0; -#ifndef SHADOWONLY -#ifdef CUSTOMUSERLIGHTING -diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow); -#ifdef SPECULARTERM -specularBase+=computeCustomSpecularLighting(info,specularBase,shadow); -#endif -#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) -diffuseBase+=lightmapColor.rgb*shadow; -#ifdef SPECULARTERM -#ifndef LIGHTMAPNOSPECULAR{X} -specularBase+=info.specular*shadow*lightmapColor.rgb; -#endif -#endif -#ifdef CLEARCOAT -#ifndef LIGHTMAPNOSPECULAR{X} -clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb; -#endif -#endif -#ifdef SHEEN -#ifndef LIGHTMAPNOSPECULAR{X} -sheenBase+=info.sheen.rgb*shadow; -#endif -#endif -#else -#ifdef SHADOWCSMDEBUG{X} -diffuseBase+=info.diffuse*shadowDebug{X}; -#else -diffuseBase+=info.diffuse*shadow; -#endif -#ifdef SS_TRANSLUCENCY -diffuseTransmissionBase+=info.diffuseTransmission*shadow; -#endif -#ifdef SPECULARTERM -specularBase+=info.specular*shadow; -#endif -#ifdef CLEARCOAT -clearCoatBase+=info.clearCoat.rgb*shadow; -#endif -#ifdef SHEEN -sheenBase+=info.sheen.rgb*shadow; -#endif -#endif -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=n); diff --git a/assets/lightFragment-Jwj6l9Y8.js b/assets/lightFragment-Jwj6l9Y8.js deleted file mode 100644 index dfee5c790d703fae97e5b9397cb08fcedcfefeb7..0000000000000000000000000000000000000000 --- a/assets/lightFragment-Jwj6l9Y8.js +++ /dev/null @@ -1,374 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="lightFragment",t=`#ifdef LIGHT{X} -#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) -#else -var diffuse{X}: vec4f=light{X}.vLightDiffuse; -#define CUSTOM_LIGHT{X}_COLOR -#if defined(PBR) && defined(CLUSTLIGHT{X}) -{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting( -lightDataTexture{X}, -&tileMaskBuffer{X}, -light{X}.vLightData, -vec2u(light{X}.vSliceRanges[sliceIndex].xy), -viewDirectionW, -normalW, -fragmentInputs.vPositionW, -surfaceAlbedo, -reflectivityOut, -#ifdef IRIDESCENCE -iridescenceIntensity, -#endif -#ifdef SS_TRANSLUCENCY -subSurfaceOut, -#endif -#ifdef SPECULARTERM -AARoughnessFactors.x, -#endif -#ifdef ANISOTROPIC -anisotropicOut, -#endif -#ifdef SHEEN -sheenOut, -#endif -#ifdef CLEARCOAT -clearcoatOut, -#endif -);} -#elif defined(PBR) -#ifdef SPOTLIGHT{X} -preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW); -#elif defined(POINTLIGHT{X}) -preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW); -#elif defined(HEMILIGHT{X}) -preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); -#elif defined(DIRLIGHT{X}) -preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC1SamplerSampler,areaLightsLTC2Sampler,areaLightsLTC2SamplerSampler,viewDirectionW,normalW,fragmentInputs.vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness); -#endif -preInfo.NdotV=NdotV; -#ifdef SPOTLIGHT{X} -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w); -#endif -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler); -#else -preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w); -#endif -#else -preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler); -#else -preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#endif -#elif defined(POINTLIGHT{X}) -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); -#else -preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#endif -#else -preInfo.attenuation=1.0; -#endif -#if defined(HEMILIGHT{X}) -preInfo.roughness=roughness; -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo.roughness=roughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -preInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo; -#ifdef IRIDESCENCE -preInfo.iridescenceIntensity=iridescenceIntensity; -#endif -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission=vec3f(0.0); -#endif -#ifdef HEMILIGHT{X} -info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -info.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb); -#elif defined(SS_TRANSLUCENCY) -#ifndef SS_TRANSLUCENCY_LEGACY -info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); -#else -info.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); -#endif -#else -info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb); -#endif -#ifdef SPECULARTERM -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -info.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#else -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -{let metalFresnel: vec3f=vec3f(reflectivityOut.specularWeight)*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricFresnel: vec3f=fresnelSchlickGGXVec3(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);} -#else -coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#endif -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -{let NdotH: f32=dot(normalW,preInfo.H);let fresnel: vec3f=fresnelSchlickGGXVec3(NdotH,vec3f(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3f(1.0)-fresnel);} -#endif -#ifdef ANISOTROPIC -info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); -#else -info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb); -#endif -#endif -#endif -#ifndef AREALIGHT{X} -#ifdef SHEEN -#ifdef SHEEN_LINKWITHALBEDO -preInfo.roughness=sheenOut.sheenIntensity; -#else -#ifdef HEMILIGHT{X} -preInfo.roughness=sheenOut.sheenRoughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -#endif -info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); -#endif -#ifdef CLEARCOAT -#ifdef HEMILIGHT{X} -preInfo.roughness=clearcoatOut.clearCoatRoughness; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); -#endif -info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb); -#ifdef CLEARCOAT_TINT -absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=absorption; -#endif -#ifdef SPECULARTERM -info.specular*=absorption; -#endif -#endif -info.diffuse*=info.clearCoat.w; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=info.clearCoat.w; -#endif -#ifdef SPECULARTERM -info.specular*=info.clearCoat.w; -#endif -#ifdef SHEEN -info.sheen*=info.clearCoat.w; -#endif -#endif -#endif -#else -#ifdef SPOTLIGHT{X} -#ifdef IESLIGHTTEXTURE{X} -info=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X},iesLightTexture{X}Sampler); -#else -info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); -#endif -#elif defined(HEMILIGHT{X}) -info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness); -#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X}) -info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); -#elif define(AREALIGHT{X}) && defined(AREALIGHTSUPPORTED) -info=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC1SamplerSampler,areaLightsLTC2Sampler,areaLightsLTC2SamplerSampler,viewDirectionW,normalW,fragmentInputs.vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,diffuse{X}.rgb,light{X}.vLightSpecular.rgb, -#ifdef AREALIGHTNOROUGHTNESS -0.5 -#else -uniforms.vReflectionInfos.y -#endif -); -#elif defined(CLUSTLIGHT{X}) -{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(lightDataTexture{X},&tileMaskBuffer{X},viewDirectionW,normalW,light{X}.vLightData,vec2u(light{X}.vSliceRanges[sliceIndex].xy),glossiness);} -#endif -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,uniforms.textureProjectionMatrix{X},fragmentInputs.vPositionW); -#endif -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSMDEBUG{X} -var shadowDebug{X}: vec3f; -#endif -#ifdef SHADOWCSM{X} -#ifdef SHADOWCSMUSESHADOWMAXZ{X} -var index{X}: i32=-1; -#else -var index{X}: i32=SHADOWCSMNUM_CASCADES{X}-1; -#endif -var diff{X}: f32=0.;vPositionFromLight{X}[0]=fragmentInputs.vPositionFromLight{X}_0;vPositionFromLight{X}[1]=fragmentInputs.vPositionFromLight{X}_1;vPositionFromLight{X}[2]=fragmentInputs.vPositionFromLight{X}_2;vPositionFromLight{X}[3]=fragmentInputs.vPositionFromLight{X}_3;vDepthMetric{X}[0]=fragmentInputs.vDepthMetric{X}_0;vDepthMetric{X}[1]=fragmentInputs.vDepthMetric{X}_1;vDepthMetric{X}[2]=fragmentInputs.vDepthMetric{X}_2;vDepthMetric{X}[3]=fragmentInputs.vDepthMetric{X}_3;for (var i:i32=0; i=0.) {index{X}=i;break;}} -#ifdef SHADOWCSMUSESHADOWMAXZ{X} -if (index{X}>=0) -#endif -{ -#if defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#else -shadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#endif -#else -shadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#ifdef SHADOWCSMDEBUG{X} -shadowDebug{X}=vec3f(shadow)*vCascadeColorsMultiplier{X}[index{X}]; -#endif -#ifndef SHADOWCSMNOBLEND{X} -var frustumLength:f32=uniforms.frustumLengths{X}[index{X}];var diffRatio:f32=clamp(diff{X}/frustumLength,0.,1.)*uniforms.cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.) -{index{X}+=1;var nextShadow: f32=0.; -#if defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -nextShadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -nextShadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -nextShadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -nextShadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#elif defined(SHADOWMEDIUMQUALITY{X}) -nextShadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#else -nextShadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X}); -#endif -#else -nextShadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -shadow=mix(nextShadow,shadow,diffRatio); -#ifdef SHADOWCSMDEBUG{X} -shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio); -#endif -} -#endif -} -#elif defined(SHADOWCLOSEESM{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithCloseESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); -#else -shadow=computeShadowWithCloseESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWESM{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); -#else -shadow=computeShadowWithESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPOISSON{X}) -#if defined(SHADOWCUBE{X}) -shadow=computeShadowWithPoissonSamplingCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues); -#else -shadow=computeShadowWithPoissonSampling(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCF{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithPCF1(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithPCF3(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithPCF5(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#elif defined(SHADOWPCSS{X}) -#if defined(SHADOWLOWQUALITY{X}) -shadow=computeShadowWithPCSS16(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#elif defined(SHADOWMEDIUMQUALITY{X}) -shadow=computeShadowWithPCSS32(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#else -shadow=computeShadowWithPCSS64(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#else -#if defined(SHADOWCUBE{X}) -shadow=computeShadowCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues); -#else -shadow=computeShadow(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); -#endif -#endif -#ifdef SHADOWONLY -#ifndef SHADOWINUSE -#define SHADOWINUSE -#endif -globalShadow+=shadow;shadowLightCount+=1.0; -#endif -#else -shadow=1.; -#endif -aggShadow+=shadow;numLights+=1.0; -#ifndef SHADOWONLY -#ifdef CUSTOMUSERLIGHTING -diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow); -#ifdef SPECULARTERM -specularBase+=computeCustomSpecularLighting(info,specularBase,shadow); -#endif -#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) -diffuseBase+=lightmapColor.rgb*shadow; -#ifdef SPECULARTERM -#ifndef LIGHTMAPNOSPECULAR{X} -specularBase+=info.specular*shadow*lightmapColor.rgb; -#endif -#endif -#ifdef CLEARCOAT -#ifndef LIGHTMAPNOSPECULAR{X} -clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb; -#endif -#endif -#ifdef SHEEN -#ifndef LIGHTMAPNOSPECULAR{X} -sheenBase+=info.sheen.rgb*shadow; -#endif -#endif -#else -#ifdef SHADOWCSMDEBUG{X} -diffuseBase+=info.diffuse*shadowDebug{X}; -#else -diffuseBase+=info.diffuse*shadow; -#endif -#ifdef SS_TRANSLUCENCY -diffuseTransmissionBase+=info.diffuseTransmission*shadow; -#endif -#ifdef SPECULARTERM -specularBase+=info.specular*shadow; -#endif -#ifdef CLEARCOAT -clearCoatBase+=info.clearCoat.rgb*shadow; -#endif -#ifdef SHEEN -sheenBase+=info.sheen.rgb*shadow; -#endif -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=t); diff --git a/assets/lightsFragmentFunctions-BGx5-0G-.js b/assets/lightsFragmentFunctions-BGx5-0G-.js deleted file mode 100644 index a0405bde4ea096c69ada280b755df6373488ba07..0000000000000000000000000000000000000000 --- a/assets/lightsFragmentFunctions-BGx5-0G-.js +++ /dev/null @@ -1,92 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./shadowsFragmentFunctions-CHKo52s6.js";const t="lightsFragmentFunctions",i=`struct lightingInfo -{diffuse: vec3f, -#ifdef SPECULARTERM -specular: vec3f, -#endif -#ifdef NDOTL -ndl: f32, -#endif -};fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.) -{var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);} -else -{lightVectorW=normalize(-lightData.xyz);} -var ndl: f32=max(0.,dot(vNormal,lightVectorW)); -#ifdef NDOTL -result.ndl=ndl; -#endif -result.diffuse=ndl*diffuseColor*attenuation; -#ifdef SPECULARTERM -var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation; -#endif -return result;} -fn getAttenuation(cosAngle: f32,exponent: f32)->f32 {return max(0.,pow(cosAngle,exponent));} -fn getIESAttenuation(cosAngle: f32,iesLightTexture: texture_2d,iesLightTextureSampler: sampler)->f32 {var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;} -fn computeBasicSpotLighting(viewDirectionW: vec3f,lightVectorW: vec3f,vNormal: vec3f,attenuation: f32,diffuseColor: vec3f,specularColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=max(0.,dot(vNormal,lightVectorW)); -#ifdef NDOTL -result.ndl=ndl; -#endif -result.diffuse=ndl*diffuseColor*attenuation; -#ifdef SPECULARTERM -var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation; -#endif -return result;} -fn computeIESSpotLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32,iesLightTexture: texture_2d,iesLightTextureSampler: sampler)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var dotProduct=dot(lightDirection.xyz,-lightVectorW);var cosAngle: f32=max(0.,dotProduct);if (cosAngle>=lightDirection.w) -{attenuation*=getIESAttenuation(dotProduct,iesLightTexture,iesLightTextureSampler);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);} -var result: lightingInfo;result.diffuse=vec3f(0.); -#ifdef SPECULARTERM -result.specular=vec3f(0.); -#endif -#ifdef NDOTL -result.ndl=0.; -#endif -return result;} -fn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w) -{attenuation*=getAttenuation(cosAngle,lightData.w);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);} -var result: lightingInfo;result.diffuse=vec3f(0.); -#ifdef SPECULARTERM -result.specular=vec3f(0.); -#endif -#ifdef NDOTL -result.ndl=0.; -#endif -return result;} -fn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=dot(vNormal,lightData.xyz)*0.5+0.5; -#ifdef NDOTL -result.ndl=ndl; -#endif -result.diffuse=mix(groundColor,diffuseColor,ndl); -#ifdef SPECULARTERM -var angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor; -#endif -return result;} -fn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -#include -var areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d;fn computeAreaLighting(ltc1: texture_2d,ltc1Sampler:sampler,ltc2:texture_2d,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightPosition:vec3f,halfWidth:vec3f, halfHeight:vec3f,diffuseColor:vec3f,specularColor:vec3f,roughness:f32 )->lightingInfo -{var result: lightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness); -#ifdef SPECULARTERM -var fresnel:vec3f=( specularColor*data.Fresnel.x+( vec3f( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular; -#endif -result.diffuse+=diffuseColor*data.Diffuse;return result;} -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#include -fn computeClusteredLighting( -lightDataTexture: texture_2d, -tileMaskBuffer: ptr>, -viewDirectionW: vec3f, -vNormal: vec3f, -lightData: vec4f, -sliceRange: vec2u, -glossiness: f32 -)->lightingInfo {var result: lightingInfo;let tilePosition=vec2u(fragmentInputs.position.xy*lightData.xy);let maskResolution=vec2u(lightData.zw);var tileIndex=(tilePosition.x*maskResolution.x+tilePosition.y)*maskResolution.y;let batchRange=sliceRange/CLUSTLIGHT_BATCH;var batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tileIndex+=batchRange.x;for (var i=batchRange.x; i<=batchRange.y; i+=1) {var mask=tileMaskBuffer[tileIndex];tileIndex+=1;let maskOffset=max(sliceRange.x,batchOffset)-batchOffset; -let maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while mask != 0 {let trailing=firstTrailingBit(mask);mask ^= 1u<=lightDirection.w) -{ -attenuation*=getIESAttenuation(dotProduct,iesLightSampler);return basicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);} -lightingInfo result;result.diffuse=vec3(0.); -#ifdef SPECULARTERM -result.specular=vec3(0.); -#endif -#ifdef NDOTL -result.ndl=0.; -#endif -return result;} -lightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w) -{ -attenuation*=getAttenuation(cosAngle,lightData.w);return basicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);} -lightingInfo result;result.diffuse=vec3(0.); -#ifdef SPECULARTERM -result.specular=vec3(0.); -#endif -#ifdef NDOTL -result.ndl=0.; -#endif -return result;} -lightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5; -#ifdef NDOTL -result.ndl=ndl; -#endif -result.diffuse=mix(groundColor,diffuseColor,ndl); -#ifdef SPECULARTERM -vec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor; -#endif -return result;} -#define inline -vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -#include -uniform sampler2D areaLightsLTC1Sampler;uniform sampler2D areaLightsLTC2Sampler; -#define inline -lightingInfo computeAreaLighting(sampler2D ltc1,sampler2D ltc2,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec3 lightPosition,vec3 halfWidth,vec3 halfHeight,vec3 diffuseColor,vec3 specularColor,float roughness) -{lightingInfo result;areaLightData data=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc2,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness); -#ifdef SPECULARTERM -vec3 fresnel=( specularColor*data.Fresnel.x+( vec3( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular; -#endif -result.diffuse+=diffuseColor*data.Diffuse;return result;} -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#include -#define inline -lightingInfo computeClusteredLighting( -sampler2D lightDataTexture, -sampler2D tileMaskTexture, -vec3 viewDirectionW, -vec3 vNormal, -vec4 lightData, -ivec2 sliceRange, -float glossiness -) {lightingInfo result;ivec2 tilePosition=ivec2(gl_FragCoord.xy*lightData.xy);int maskHeight=int(lightData.z);tilePosition.y=min(tilePosition.y,maskHeight-1);ivec2 batchRange=sliceRange/CLUSTLIGHT_BATCH;int batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tilePosition.y+=maskHeight*batchRange.x;for (int i=batchRange.x; i<=batchRange.y; i+=1) {uint mask=uint(texelFetch(tileMaskTexture,tilePosition,0).r);tilePosition.y+=maskHeight;int maskOffset=max(sliceRange.x-batchOffset,0);int maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while (mask != 0u) {uint bit=mask & -mask;mask ^= bit;int position=onlyBitPosition(bit);ClusteredLight light=getClusteredLight(lightDataTexture,batchOffset+maskOffset+position);lightingInfo info;if (light.vLightDirection.w<0.0) {info=computeLighting(viewDirectionW,vNormal,light.vLightData,light.vLightDiffuse.rgb,light.vLightSpecular.rgb,light.vLightDiffuse.a,glossiness);} else {info=computeSpotLighting(viewDirectionW,vNormal,light.vLightData,light.vLightDirection,light.vLightDiffuse.rgb,light.vLightSpecular.rgb,light.vLightDiffuse.a,glossiness);} -result.diffuse+=info.diffuse; -#ifdef SPECULARTERM -result.specular+=info.specular; -#endif -} -batchOffset+=CLUSTLIGHT_BATCH;} -return result;} -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=i); diff --git a/assets/logDepthDeclaration-CACrmPgQ.js b/assets/logDepthDeclaration-CACrmPgQ.js deleted file mode 100644 index 2e9217f0ddc219fc177a88deda0d38359729416e..0000000000000000000000000000000000000000 --- a/assets/logDepthDeclaration-CACrmPgQ.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="logDepthDeclaration",t=`#ifdef LOGARITHMICDEPTH -uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=t); diff --git a/assets/logDepthDeclaration-mFbnDVOm.js b/assets/logDepthDeclaration-mFbnDVOm.js deleted file mode 100644 index 81404045a62037ae9dcaf3d8963d5309329b2fc1..0000000000000000000000000000000000000000 --- a/assets/logDepthDeclaration-mFbnDVOm.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="logDepthDeclaration",a=`#ifdef LOGARITHMICDEPTH -uniform float logarithmicDepthConstant;varying float vFragmentDepth; -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=a); diff --git a/assets/logDepthVertex-CfHieHf5.js b/assets/logDepthVertex-CfHieHf5.js deleted file mode 100644 index 1dd329644ffb6ff4f56ac08659b06a6c3474ed83..0000000000000000000000000000000000000000 --- a/assets/logDepthVertex-CfHieHf5.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="fogVertexDeclaration",o=`#ifdef FOG -varying vFogDistance: vec3f; -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=o);const s="fogVertex",n=`#ifdef FOG -#ifdef SCENE_UBO -vertexOutputs.vFogDistance=(scene.view*worldPos).xyz; -#else -vertexOutputs.vFogDistance=(uniforms.view*worldPos).xyz; -#endif -#endif -`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=n);const r="logDepthVertex",i=`#ifdef LOGARITHMICDEPTH -vertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=i); diff --git a/assets/logDepthVertex-zXeqwUWs.js b/assets/logDepthVertex-zXeqwUWs.js deleted file mode 100644 index d012457844f98ae957cfbcf01b8d7141a0edd987..0000000000000000000000000000000000000000 --- a/assets/logDepthVertex-zXeqwUWs.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="fogVertexDeclaration",r=`#ifdef FOG -varying vec3 vFogDistance; -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=r);const o="fogVertex",s=`#ifdef FOG -vFogDistance=(view*worldPos).xyz; -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=s);const n="logDepthVertex",a=`#ifdef LOGARITHMICDEPTH -vFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant; -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=a); diff --git a/assets/mainUVVaryingDeclaration-Nm5IuqWV.js b/assets/mainUVVaryingDeclaration-Nm5IuqWV.js deleted file mode 100644 index 0b060d2aca9d07fa7e605ec1193af52832a0731a..0000000000000000000000000000000000000000 --- a/assets/mainUVVaryingDeclaration-Nm5IuqWV.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const a="mainUVVaryingDeclaration",r=`#ifdef MAINUV{X} -varying vMainUV{X}: vec2f; -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=r); diff --git a/assets/mainUVVaryingDeclaration-OlWPbGIv.js b/assets/mainUVVaryingDeclaration-OlWPbGIv.js deleted file mode 100644 index e0d6fced1caa5f9e83260f486fa2edeeb1bdac8f..0000000000000000000000000000000000000000 --- a/assets/mainUVVaryingDeclaration-OlWPbGIv.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const a="mainUVVaryingDeclaration",r=`#ifdef MAINUV{X} -varying vec2 vMainUV{X}; -#endif -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=r); diff --git a/assets/mermaid.core-BcqUqpnI.js b/assets/mermaid.core-BcqUqpnI.js deleted file mode 100644 index 2eb68e41126b3964149bfb1edd85457f7fc77c56..0000000000000000000000000000000000000000 --- a/assets/mermaid.core-BcqUqpnI.js +++ /dev/null @@ -1,250 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dagre-6UL2VRFP-Btl9zFEK.js","./graph-CmFD0A_p.js","./_baseUniq-BFKEI0vc.js","./layout-Blpw3L9v.js","./min-Rtq3U8dQ.js","./clone-BVbdztFw.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./i18n-CPHyzK9b.js","./i18n-CawRO-sx.css","./step-B-Gbak1k.js","./dispatch-kxCwF96_.js","./select-BigU4G0v.js","./cose-bilkent-S5V4N54A-AyIH2MZ_.js","./cytoscape.esm-5J0xJHOV.js","./c4Diagram-YG6GDRKO-CT6IHYx9.js","./chunk-TZMSLE5B-xeQXGdbb.js","./flowDiagram-NV44I4VS-DElR_B5J.js","./chunk-FMBD7UC4-Drrjy9J2.js","./chunk-55IACEB6-CzYB-Zls.js","./chunk-QN33PNHL-DUQNEUQT.js","./channel-Dg8q-JvW.js","./erDiagram-Q2GNP2WA-DqmHcY0h.js","./gitGraphDiagram-NY62KEGX-BnrtNi3E.js","./chunk-4BX2VUAB-BSrsJ5gp.js","./chunk-QZHKN3VN-CdTgv_Ss.js","./treemap-KMMF4GRG-BAURD4mW.js","./ganttDiagram-JELNMOA3-B-_v82D_.js","./time-BMaLdJ6b.js","./linear-8mDBZVC7.js","./init-Dmth1JHB.js","./defaultLocale-CzDG__Ur.js","./infoDiagram-WHAUD3N6-Oq8a6cr3.js","./pieDiagram-ADFJNKIX-Bo5-NHZs.js","./arc-Bt_eNeYl.js","./ordinal-BeghXfj9.js","./quadrantDiagram-AYHSOK5B-Cs64x-qg.js","./xychartDiagram-PRI3JC2R-Bu9EaIWj.js","./range-OtVwhkKS.js","./requirementDiagram-UZGBJVZJ-DBVFUt9Y.js","./sequenceDiagram-WL72ISMW-C17NbP5x.js","./classDiagram-2ON5EDUG-BXSbpGZa.js","./chunk-B4BG7PRW-C6IGDcdb.js","./classDiagram-v2-WZHVMYZB-BXSbpGZa.js","./stateDiagram-FKZM4ZOC-CHpWYG-h.js","./chunk-DI55MBZ5-CXTRmq1s.js","./stateDiagram-v2-4FDKWEC3-CWiaQQ2u.js","./journeyDiagram-XKPGCS4Q-B9TRQ9Y6.js","./timeline-definition-IT6M3QCI-DlFV8OnV.js","./mindmap-definition-VGOIOE7T-BIKD_8An.js","./kanban-definition-3W4ZIXB7-CGGJDAWR.js","./sankeyDiagram-TZEHDZUN-Cmk6HWvP.js","./colors-Cc3OSVma.js","./diagram-S2PKOQOG-DWalJcdR.js","./diagram-QEK2KX5R-CH0Hw6Ub.js","./blockDiagram-VD42YOAC-B07cvJHo.js","./architectureDiagram-VXUJARFQ-B1panAnW.js","./diagram-PSM6KHXK-Bwe0eN86.js","./index-BU4IRnz1.js"])))=>i.map(i=>d[i]); -import{af as pt}from"./index-DydPgVMC.js";import{L as jp}from"./i18n-CPHyzK9b.js";import{a4 as Yp,a6 as Up,q as Gp,r as Mo,u as Eo,v as Vp,a3 as Xp,a2 as Zp,a5 as Kp,D as Xl,E as Zl,F as Kl,G as Ql,I as Jl,H as tc,J as Qp,K as Bn,N as ec,L as Jp,M as tg,Q as rc,P as eg,O as rg,S as ig,T as ag,U as ng,k as qi,l as sg}from"./step-B-Gbak1k.js";import{d as og}from"./dispatch-kxCwF96_.js";import{n as ic,m as lg,a as cg,b as hg,c as La,d as li,s as ht}from"./select-BigU4G0v.js";var $o={name:"mermaid",version:"11.12.2",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},Hi={exports:{}},ug=Hi.exports,Fo;function dg(){return Fo||(Fo=1,(function(e,t){(function(r,i){e.exports=i()})(ug,(function(){var r=1e3,i=6e4,a=36e5,n="millisecond",s="second",o="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var A=["th","st","nd","rd"],_=B%100;return"["+B+(A[(_-20)%10]||A[_]||A[0])+"]"}},k=function(B,A,_){var $=String(B);return!$||$.length>=A?B:""+Array(A+1-$.length).join(_)+B},v={s:k,z:function(B){var A=-B.utcOffset(),_=Math.abs(A),$=Math.floor(_/60),M=_%60;return(A<=0?"+":"-")+k($,2,"0")+":"+k(M,2,"0")},m:function B(A,_){if(A.date()<_.date())return-B(_,A);var $=12*(_.year()-A.year())+(_.month()-A.month()),M=A.clone().add($,u),q=_-M<0,V=A.clone().add($+(q?-1:1),u);return+(-($+(_-M)/(q?M-V:V-M))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:u,y:f,w:h,d:c,D:g,h:l,m:o,s,ms:n,Q:d}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},w="en",L={};L[w]=b;var T="$isDayjsObject",D=function(B){return B instanceof N||!(!B||!B[T])},I=function B(A,_,$){var M;if(!A)return w;if(typeof A=="string"){var q=A.toLowerCase();L[q]&&(M=q),_&&(L[q]=_,M=q);var V=A.split("-");if(!M&&V.length>1)return B(V[0])}else{var K=A.name;L[K]=A,M=K}return!$&&M&&(w=M),M||!$&&w},O=function(B,A){if(D(B))return B.clone();var _=typeof A=="object"?A:{};return _.date=B,_.args=arguments,new N(_)},E=v;E.l=I,E.i=D,E.w=function(B,A){return O(B,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var N=(function(){function B(_){this.$L=I(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[T]=!0}var A=B.prototype;return A.parse=function(_){this.$d=(function($){var M=$.date,q=$.utc;if(M===null)return new Date(NaN);if(E.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var V=M.match(y);if(V){var K=V[2]-1||0,J=(V[7]||"0").substring(0,3);return q?new Date(Date.UTC(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,J)):new Date(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,J)}}return new Date(M)})(_),this.init()},A.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},A.$utils=function(){return E},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(_,$){var M=O(_);return this.startOf($)<=M&&M<=this.endOf($)},A.isAfter=function(_,$){return O(_)ac(e,"name",{value:t,configurable:!0}),gg=(e,t)=>{for(var r in t)ac(e,r,{get:t[r],enumerable:!0})},Te={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},F={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Cs=p(function(e="fatal"){let t=Te.fatal;typeof e=="string"?e.toLowerCase()in Te&&(t=Te[e]):typeof e=="number"&&(t=e),F.trace=()=>{},F.debug=()=>{},F.info=()=>{},F.warn=()=>{},F.error=()=>{},F.fatal=()=>{},t<=Te.fatal&&(F.fatal=console.error?console.error.bind(console,Kt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Kt("FATAL"))),t<=Te.error&&(F.error=console.error?console.error.bind(console,Kt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Kt("ERROR"))),t<=Te.warn&&(F.warn=console.warn?console.warn.bind(console,Kt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Kt("WARN"))),t<=Te.info&&(F.info=console.info?console.info.bind(console,Kt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Kt("INFO"))),t<=Te.debug&&(F.debug=console.debug?console.debug.bind(console,Kt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Kt("DEBUG"))),t<=Te.trace&&(F.trace=console.debug?console.debug.bind(console,Kt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Kt("TRACE")))},"setLogLevel"),Kt=p(e=>`%c${pg().format("ss.SSS")} : ${e} : `,"format");const ji={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const a=r<.5?r*(1+t):r+t-r*t,n=2*r-a;switch(i){case"r":return ji.hue2rgb(n,a,e+1/3)*255;case"g":return ji.hue2rgb(n,a,e)*255;case"b":return ji.hue2rgb(n,a,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const a=Math.max(e,t,r),n=Math.min(e,t,r),s=(a+n)/2;if(i==="l")return s*100;if(a===n)return 0;const o=a-n,l=s>.5?o/(2-a-n):o/(a+n);if(i==="s")return l*100;switch(a){case e:return((t-r)/o+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},yg={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},st={channel:ji,lang:mg,unit:yg},Re={};for(let e=0;e<=255;e++)Re[e]=st.unit.dec2hex(e);const Ft={ALL:0,RGB:1,HSL:2};class xg{constructor(){this.type=Ft.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ft.ALL}is(t){return this.type===t}}class bg{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new xg}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ft.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:a}=t;r===void 0&&(t.h=st.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=st.channel.rgb2hsl(t,"s")),a===void 0&&(t.l=st.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:a}=t;r===void 0&&(t.r=st.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=st.channel.hsl2rgb(t,"g")),a===void 0&&(t.b=st.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ft.HSL)&&r!==void 0?r:(this._ensureHSL(),st.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ft.HSL)&&r!==void 0?r:(this._ensureHSL(),st.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ft.HSL)&&r!==void 0?r:(this._ensureHSL(),st.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ft.RGB)&&r!==void 0?r:(this._ensureRGB(),st.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ft.RGB)&&r!==void 0?r:(this._ensureRGB(),st.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ft.RGB)&&r!==void 0?r:(this._ensureRGB(),st.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ft.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ft.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ft.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ft.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ft.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ft.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Aa=new bg({r:0,g:0,b:0,a:0},"transparent"),kr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(kr.re);if(!t)return;const r=t[1],i=parseInt(r,16),a=r.length,n=a%4===0,s=a>4,o=s?1:17,l=s?8:4,c=n?0:-1,h=s?255:15;return Aa.set({r:(i>>l*(c+3)&h)*o,g:(i>>l*(c+2)&h)*o,b:(i>>l*(c+1)&h)*o,a:n?(i&h)*o/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a<1?`#${Re[Math.round(t)]}${Re[Math.round(r)]}${Re[Math.round(i)]}${Re[Math.round(a*255)]}`:`#${Re[Math.round(t)]}${Re[Math.round(r)]}${Re[Math.round(i)]}`}},Ke={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Ke.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return st.channel.clamp.h(parseFloat(r)*.9);case"rad":return st.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return st.channel.clamp.h(parseFloat(r)*360)}}return st.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Ke.re);if(!r)return;const[,i,a,n,s,o]=r;return Aa.set({h:Ke._hue2deg(i),s:st.channel.clamp.s(parseFloat(a)),l:st.channel.clamp.l(parseFloat(n)),a:s?st.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a}=e;return a<1?`hsla(${st.lang.round(t)}, ${st.lang.round(r)}%, ${st.lang.round(i)}%, ${a})`:`hsl(${st.lang.round(t)}, ${st.lang.round(r)}%, ${st.lang.round(i)}%)`}},ri={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=ri.colors[e];if(t)return kr.parse(t)},stringify:e=>{const t=kr.stringify(e);for(const r in ri.colors)if(ri.colors[r]===t)return r}},Xr={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Xr.re);if(!r)return;const[,i,a,n,s,o,l,c,h]=r;return Aa.set({r:st.channel.clamp.r(a?parseFloat(i)*2.55:parseFloat(i)),g:st.channel.clamp.g(s?parseFloat(n)*2.55:parseFloat(n)),b:st.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:c?st.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a<1?`rgba(${st.lang.round(t)}, ${st.lang.round(r)}, ${st.lang.round(i)}, ${st.lang.round(a)})`:`rgb(${st.lang.round(t)}, ${st.lang.round(r)}, ${st.lang.round(i)})`}},xe={format:{keyword:ri,hex:kr,rgb:Xr,rgba:Xr,hsl:Ke,hsla:Ke},parse:e=>{if(typeof e!="string")return e;const t=kr.parse(e)||Xr.parse(e)||Ke.parse(e)||ri.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ft.HSL)||e.data.r===void 0?Ke.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Xr.stringify(e):kr.stringify(e)},nc=(e,t)=>{const r=xe.parse(e);for(const i in t)r[i]=st.channel.clamp[i](t[i]);return xe.stringify(r)},ii=(e,t,r=0,i=1)=>{if(typeof e!="number")return nc(e,{a:t});const a=Aa.set({r:st.channel.clamp.r(e),g:st.channel.clamp.g(t),b:st.channel.clamp.b(r),a:st.channel.clamp.a(i)});return xe.stringify(a)},Cg=e=>{const{r:t,g:r,b:i}=xe.parse(e),a=.2126*st.channel.toLinear(t)+.7152*st.channel.toLinear(r)+.0722*st.channel.toLinear(i);return st.lang.round(a)},kg=e=>Cg(e)>=.5,xi=e=>!kg(e),sc=(e,t,r)=>{const i=xe.parse(e),a=i[t],n=st.channel.clamp[t](a+r);return a!==n&&(i[t]=n),xe.stringify(i)},H=(e,t)=>sc(e,"l",t),et=(e,t)=>sc(e,"l",-t),S=(e,t)=>{const r=xe.parse(e),i={};for(const a in t)t[a]&&(i[a]=r[a]+t[a]);return nc(e,i)},wg=(e,t,r=50)=>{const{r:i,g:a,b:n,a:s}=xe.parse(e),{r:o,g:l,b:c,a:h}=xe.parse(t),u=r/100,d=u*2-1,f=s-h,m=((d*f===-1?d:(d+f)/(1+d*f))+1)/2,y=1-m,x=i*m+o*y,b=a*m+l*y,k=n*m+c*y,v=s*u+h*(1-u);return ii(x,b,k,v)},z=(e,t=100)=>{const r=xe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,wg(r,e,t)};const{entries:oc,setPrototypeOf:Do,isFrozen:vg,getPrototypeOf:Sg,getOwnPropertyDescriptor:Tg}=Object;let{freeze:jt,seal:Qt,create:Ln}=Object,{apply:An,construct:Mn}=typeof Reflect<"u"&&Reflect;jt||(jt=function(t){return t});Qt||(Qt=function(t){return t});An||(An=function(t,r){for(var i=arguments.length,a=new Array(i>2?i-2:0),n=2;n1?r-1:0),a=1;a1?r-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:Yi;Do&&Do(e,null);let i=t.length;for(;i--;){let a=t[i];if(typeof a=="string"){const n=r(a);n!==a&&(vg(t)||(t[i]=n),a=n)}e[a]=!0}return e}function Eg(e){for(let t=0;t/gm),Rg=Qt(/\$\{[\w\W]*/gm),Ig=Qt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Pg=Qt(/^aria-[\-\w]+$/),lc=Qt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ng=Qt(/^(?:\w+script|data):/i),zg=Qt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cc=Qt(/^html$/i),Wg=Qt(/^[a-z][.\w]*(-[.\w]+)+$/i);var zo=Object.freeze({__proto__:null,ARIA_ATTR:Pg,ATTR_WHITESPACE:zg,CUSTOM_ELEMENT:Wg,DATA_ATTR:Ig,DOCTYPE_NAME:cc,ERB_EXPR:Og,IS_ALLOWED_URI:lc,IS_SCRIPT_OR_DATA:Ng,MUSTACHE_EXPR:Dg,TMPLIT_EXPR:Rg});const qr={element:1,text:3,progressingInstruction:7,comment:8,document:9},qg=function(){return typeof window>"u"?null:window},Hg=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(i=r.getAttribute(a));const n="dompurify"+(i?"#"+i:"");try{return t.createPolicy(n,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},Wo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function hc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qg();const t=tt=>hc(tt);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==qr.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const i=r,a=i.currentScript,{DocumentFragment:n,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:c,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:d,trustedTypes:f}=e,g=l.prototype,m=Wr(g,"cloneNode"),y=Wr(g,"remove"),x=Wr(g,"nextSibling"),b=Wr(g,"childNodes"),k=Wr(g,"parentNode");if(typeof s=="function"){const tt=r.createElement("template");tt.content&&tt.content.ownerDocument&&(r=tt.content.ownerDocument)}let v,w="";const{implementation:L,createNodeIterator:T,createDocumentFragment:D,getElementsByTagName:I}=r,{importNode:O}=i;let E=Wo();t.isSupported=typeof oc=="function"&&typeof k=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:R,TMPLIT_EXPR:B,DATA_ATTR:A,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:q}=zo;let{IS_ALLOWED_URI:V}=zo,K=null;const J=ot({},[...Ro,...un,...dn,...fn,...Io]);let Z=null;const ct=ot({},[...Po,...pn,...No,...Di]);let nt=Object.seal(Ln(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ct=null,kt=null;const Nt=Object.seal(Ln(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ee=!0,xt=!0,re=!1,Oe=!0,ie=!1,_i=!0,Ue=!1,Qa=!1,Ja=!1,dr=!1,Bi=!1,Li=!1,fo=!0,po=!1;const Rp="user-content-";let tn=!0,Rr=!1,fr={},ue=null;const en=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let go=null;const mo=ot({},["audio","video","img","source","image","track"]);let rn=null;const yo=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ai="http://www.w3.org/1998/Math/MathML",Mi="http://www.w3.org/2000/svg",we="http://www.w3.org/1999/xhtml";let pr=we,an=!1,nn=null;const Ip=ot({},[Ai,Mi,we],cn);let Ei=ot({},["mi","mo","mn","ms","mtext"]),$i=ot({},["annotation-xml"]);const Pp=ot({},["title","style","font","a","script"]);let Ir=null;const Np=["application/xhtml+xml","text/html"],zp="text/html";let St=null,gr=null;const Wp=r.createElement("form"),xo=function(C){return C instanceof RegExp||C instanceof Function},sn=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(gr&&gr===C)){if((!C||typeof C!="object")&&(C={}),C=pe(C),Ir=Np.indexOf(C.PARSER_MEDIA_TYPE)===-1?zp:C.PARSER_MEDIA_TYPE,St=Ir==="application/xhtml+xml"?cn:Yi,K=ae(C,"ALLOWED_TAGS")?ot({},C.ALLOWED_TAGS,St):J,Z=ae(C,"ALLOWED_ATTR")?ot({},C.ALLOWED_ATTR,St):ct,nn=ae(C,"ALLOWED_NAMESPACES")?ot({},C.ALLOWED_NAMESPACES,cn):Ip,rn=ae(C,"ADD_URI_SAFE_ATTR")?ot(pe(yo),C.ADD_URI_SAFE_ATTR,St):yo,go=ae(C,"ADD_DATA_URI_TAGS")?ot(pe(mo),C.ADD_DATA_URI_TAGS,St):mo,ue=ae(C,"FORBID_CONTENTS")?ot({},C.FORBID_CONTENTS,St):en,Ct=ae(C,"FORBID_TAGS")?ot({},C.FORBID_TAGS,St):pe({}),kt=ae(C,"FORBID_ATTR")?ot({},C.FORBID_ATTR,St):pe({}),fr=ae(C,"USE_PROFILES")?C.USE_PROFILES:!1,ee=C.ALLOW_ARIA_ATTR!==!1,xt=C.ALLOW_DATA_ATTR!==!1,re=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=C.SAFE_FOR_TEMPLATES||!1,_i=C.SAFE_FOR_XML!==!1,Ue=C.WHOLE_DOCUMENT||!1,dr=C.RETURN_DOM||!1,Bi=C.RETURN_DOM_FRAGMENT||!1,Li=C.RETURN_TRUSTED_TYPE||!1,Ja=C.FORCE_BODY||!1,fo=C.SANITIZE_DOM!==!1,po=C.SANITIZE_NAMED_PROPS||!1,tn=C.KEEP_CONTENT!==!1,Rr=C.IN_PLACE||!1,V=C.ALLOWED_URI_REGEXP||lc,pr=C.NAMESPACE||we,Ei=C.MATHML_TEXT_INTEGRATION_POINTS||Ei,$i=C.HTML_INTEGRATION_POINTS||$i,nt=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&xo(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&xo(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ie&&(xt=!1),Bi&&(dr=!0),fr&&(K=ot({},Io),Z=[],fr.html===!0&&(ot(K,Ro),ot(Z,Po)),fr.svg===!0&&(ot(K,un),ot(Z,pn),ot(Z,Di)),fr.svgFilters===!0&&(ot(K,dn),ot(Z,pn),ot(Z,Di)),fr.mathMl===!0&&(ot(K,fn),ot(Z,No),ot(Z,Di))),C.ADD_TAGS&&(typeof C.ADD_TAGS=="function"?Nt.tagCheck=C.ADD_TAGS:(K===J&&(K=pe(K)),ot(K,C.ADD_TAGS,St))),C.ADD_ATTR&&(typeof C.ADD_ATTR=="function"?Nt.attributeCheck=C.ADD_ATTR:(Z===ct&&(Z=pe(Z)),ot(Z,C.ADD_ATTR,St))),C.ADD_URI_SAFE_ATTR&&ot(rn,C.ADD_URI_SAFE_ATTR,St),C.FORBID_CONTENTS&&(ue===en&&(ue=pe(ue)),ot(ue,C.FORBID_CONTENTS,St)),C.ADD_FORBID_CONTENTS&&(ue===en&&(ue=pe(ue)),ot(ue,C.ADD_FORBID_CONTENTS,St)),tn&&(K["#text"]=!0),Ue&&ot(K,["html","head","body"]),K.table&&(ot(K,["tbody"]),delete Ct.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=C.TRUSTED_TYPES_POLICY,w=v.createHTML("")}else v===void 0&&(v=Hg(f,a)),v!==null&&typeof w=="string"&&(w=v.createHTML(""));jt&&jt(C),gr=C}},bo=ot({},[...un,...dn,...$g]),Co=ot({},[...fn,...Fg]),qp=function(C){let P=k(C);(!P||!P.tagName)&&(P={namespaceURI:pr,tagName:"template"});const X=Yi(C.tagName),mt=Yi(P.tagName);return nn[C.namespaceURI]?C.namespaceURI===Mi?P.namespaceURI===we?X==="svg":P.namespaceURI===Ai?X==="svg"&&(mt==="annotation-xml"||Ei[mt]):!!bo[X]:C.namespaceURI===Ai?P.namespaceURI===we?X==="math":P.namespaceURI===Mi?X==="math"&&$i[mt]:!!Co[X]:C.namespaceURI===we?P.namespaceURI===Mi&&!$i[mt]||P.namespaceURI===Ai&&!Ei[mt]?!1:!Co[X]&&(Pp[X]||!bo[X]):!!(Ir==="application/xhtml+xml"&&nn[C.namespaceURI]):!1},de=function(C){Pr(t.removed,{element:C});try{k(C).removeChild(C)}catch{y(C)}},Ge=function(C,P){try{Pr(t.removed,{attribute:P.getAttributeNode(C),from:P})}catch{Pr(t.removed,{attribute:null,from:P})}if(P.removeAttribute(C),C==="is")if(dr||Bi)try{de(P)}catch{}else try{P.setAttribute(C,"")}catch{}},ko=function(C){let P=null,X=null;if(Ja)C=""+C;else{const wt=hn(C,/^[\r\n\t ]+/);X=wt&&wt[0]}Ir==="application/xhtml+xml"&&pr===we&&(C=''+C+"");const mt=v?v.createHTML(C):C;if(pr===we)try{P=new d().parseFromString(mt,Ir)}catch{}if(!P||!P.documentElement){P=L.createDocument(pr,"template",null);try{P.documentElement.innerHTML=an?w:mt}catch{}}const $t=P.body||P.documentElement;return C&&X&&$t.insertBefore(r.createTextNode(X),$t.childNodes[0]||null),pr===we?I.call(P,Ue?"html":"body")[0]:Ue?P.documentElement:$t},wo=function(C){return T.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},on=function(C){return C instanceof u&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof h)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},vo=function(C){return typeof o=="function"&&C instanceof o};function ve(tt,C,P){Fi(tt,X=>{X.call(t,C,P,gr)})}const So=function(C){let P=null;if(ve(E.beforeSanitizeElements,C,null),on(C))return de(C),!0;const X=St(C.nodeName);if(ve(E.uponSanitizeElement,C,{tagName:X,allowedTags:K}),_i&&C.hasChildNodes()&&!vo(C.firstElementChild)&&zt(/<[/\w!]/g,C.innerHTML)&&zt(/<[/\w!]/g,C.textContent)||C.nodeType===qr.progressingInstruction||_i&&C.nodeType===qr.comment&&zt(/<[/\w]/g,C.data))return de(C),!0;if(!(Nt.tagCheck instanceof Function&&Nt.tagCheck(X))&&(!K[X]||Ct[X])){if(!Ct[X]&&_o(X)&&(nt.tagNameCheck instanceof RegExp&&zt(nt.tagNameCheck,X)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(X)))return!1;if(tn&&!ue[X]){const mt=k(C)||C.parentNode,$t=b(C)||C.childNodes;if($t&&mt){const wt=$t.length;for(let Ut=wt-1;Ut>=0;--Ut){const Se=m($t[Ut],!0);Se.__removalCount=(C.__removalCount||0)+1,mt.insertBefore(Se,x(C))}}}return de(C),!0}return C instanceof l&&!qp(C)||(X==="noscript"||X==="noembed"||X==="noframes")&&zt(/<\/no(script|embed|frames)/i,C.innerHTML)?(de(C),!0):(ie&&C.nodeType===qr.text&&(P=C.textContent,Fi([N,R,B],mt=>{P=Nr(P,mt," ")}),C.textContent!==P&&(Pr(t.removed,{element:C.cloneNode()}),C.textContent=P)),ve(E.afterSanitizeElements,C,null),!1)},To=function(C,P,X){if(fo&&(P==="id"||P==="name")&&(X in r||X in Wp))return!1;if(!(xt&&!kt[P]&&zt(A,P))){if(!(ee&&zt(_,P))){if(!(Nt.attributeCheck instanceof Function&&Nt.attributeCheck(P,C))){if(!Z[P]||kt[P]){if(!(_o(C)&&(nt.tagNameCheck instanceof RegExp&&zt(nt.tagNameCheck,C)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(C))&&(nt.attributeNameCheck instanceof RegExp&&zt(nt.attributeNameCheck,P)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(P,C))||P==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&zt(nt.tagNameCheck,X)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(X))))return!1}else if(!rn[P]){if(!zt(V,Nr(X,M,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&C!=="script"&&Lg(X,"data:")===0&&go[C])){if(!(re&&!zt($,Nr(X,M,"")))){if(X)return!1}}}}}}}return!0},_o=function(C){return C!=="annotation-xml"&&hn(C,q)},Bo=function(C){ve(E.beforeSanitizeAttributes,C,null);const{attributes:P}=C;if(!P||on(C))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let mt=P.length;for(;mt--;){const $t=P[mt],{name:wt,namespaceURI:Ut,value:Se}=$t,mr=St(wt),ln=Se;let At=wt==="value"?ln:Ag(ln);if(X.attrName=mr,X.attrValue=At,X.keepAttr=!0,X.forceKeepAttr=void 0,ve(E.uponSanitizeAttribute,C,X),At=X.attrValue,po&&(mr==="id"||mr==="name")&&(Ge(wt,C),At=Rp+At),_i&&zt(/((--!?|])>)|<\/(style|title|textarea)/i,At)){Ge(wt,C);continue}if(mr==="attributename"&&hn(At,"href")){Ge(wt,C);continue}if(X.forceKeepAttr)continue;if(!X.keepAttr){Ge(wt,C);continue}if(!Oe&&zt(/\/>/i,At)){Ge(wt,C);continue}ie&&Fi([N,R,B],Ao=>{At=Nr(At,Ao," ")});const Lo=St(C.nodeName);if(!To(Lo,mr,At)){Ge(wt,C);continue}if(v&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ut)switch(f.getAttributeType(Lo,mr)){case"TrustedHTML":{At=v.createHTML(At);break}case"TrustedScriptURL":{At=v.createScriptURL(At);break}}if(At!==ln)try{Ut?C.setAttributeNS(Ut,wt,At):C.setAttribute(wt,At),on(C)?de(C):Oo(t.removed)}catch{Ge(wt,C)}}ve(E.afterSanitizeAttributes,C,null)},Hp=function tt(C){let P=null;const X=wo(C);for(ve(E.beforeSanitizeShadowDOM,C,null);P=X.nextNode();)ve(E.uponSanitizeShadowNode,P,null),So(P),Bo(P),P.content instanceof n&&tt(P.content);ve(E.afterSanitizeShadowDOM,C,null)};return t.sanitize=function(tt){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,X=null,mt=null,$t=null;if(an=!tt,an&&(tt=""),typeof tt!="string"&&!vo(tt))if(typeof tt.toString=="function"){if(tt=tt.toString(),typeof tt!="string")throw zr("dirty is not a string, aborting")}else throw zr("toString is not a function");if(!t.isSupported)return tt;if(Qa||sn(C),t.removed=[],typeof tt=="string"&&(Rr=!1),Rr){if(tt.nodeName){const Se=St(tt.nodeName);if(!K[Se]||Ct[Se])throw zr("root node is forbidden and cannot be sanitized in-place")}}else if(tt instanceof o)P=ko(""),X=P.ownerDocument.importNode(tt,!0),X.nodeType===qr.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?P=X:P.appendChild(X);else{if(!dr&&!ie&&!Ue&&tt.indexOf("<")===-1)return v&&Li?v.createHTML(tt):tt;if(P=ko(tt),!P)return dr?null:Li?w:""}P&&Ja&&de(P.firstChild);const wt=wo(Rr?tt:P);for(;mt=wt.nextNode();)So(mt),Bo(mt),mt.content instanceof n&&Hp(mt.content);if(Rr)return tt;if(dr){if(Bi)for($t=D.call(P.ownerDocument);P.firstChild;)$t.appendChild(P.firstChild);else $t=P;return(Z.shadowroot||Z.shadowrootmode)&&($t=O.call(i,$t,!0)),$t}let Ut=Ue?P.outerHTML:P.innerHTML;return Ue&&K["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&zt(cc,P.ownerDocument.doctype.name)&&(Ut=" -`+Ut),ie&&Fi([N,R,B],Se=>{Ut=Nr(Ut,Se," ")}),v&&Li?v.createHTML(Ut):Ut},t.setConfig=function(){let tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(tt),Qa=!0},t.clearConfig=function(){gr=null,Qa=!1},t.isValidAttribute=function(tt,C,P){gr||sn({});const X=St(tt),mt=St(C);return To(X,mt,P)},t.addHook=function(tt,C){typeof C=="function"&&Pr(E[tt],C)},t.removeHook=function(tt,C){if(C!==void 0){const P=_g(E[tt],C);return P===-1?void 0:Bg(E[tt],P,1)[0]}return Oo(E[tt])},t.removeHooks=function(tt){E[tt]=[]},t.removeAllHooks=function(){E=Wo()},t}var vr=hc(),uc=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ai=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,jg=/\s*%%.*\n/gm,dc=class extends Error{static{p(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},er={},ks=p(function(e,t){e=e.replace(uc,"").replace(ai,"").replace(jg,` -`);for(const[r,{detector:i}]of Object.entries(er))if(i(e,t))return r;throw new dc(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),En=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)fc(t,r,i)},"registerLazyLoadedDiagrams"),fc=p((e,t,r)=>{er[e]&&F.warn(`Detector with key ${e} already exists. Overwriting.`),er[e]={detector:t,loader:r},F.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),Yg=p(e=>er[e].loader,"getDiagramLoader"),$n=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const a={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(n=>$n(e,n,a)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(n=>{e.includes(n)||e.push(n)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(n=>{typeof t[n]=="object"&&(e[n]===void 0||typeof e[n]=="object")?(e[n]===void 0&&(e[n]=Array.isArray(t[n])?[]:{}),e[n]=$n(e[n],t[n],{depth:r-1,clobber:i})):(i||typeof e[n]!="object"&&typeof t[n]!="object")&&(e[n]=t[n])}),e)},"assignWithDepth"),_t=$n,Ma="#ffffff",Ea="#f2f2f2",Wt=p((e,t)=>t?S(e,{s:-40,l:10}):S(e,{s:-40,l:-10}),"mkBorder"),Ug=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||S(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||S(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Wt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Wt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Wt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Wt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||z(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||z(this.tertiaryColor),this.lineColor=this.lineColor||z(this.background),this.arrowheadColor=this.arrowheadColor||z(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||z(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||et(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||S(this.primaryColor,{h:30}),this.cScale4=this.cScale4||S(this.primaryColor,{h:60}),this.cScale5=this.cScale5||S(this.primaryColor,{h:90}),this.cScale6=this.cScale6||S(this.primaryColor,{h:120}),this.cScale7=this.cScale7||S(this.primaryColor,{h:150}),this.cScale8=this.cScale8||S(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||S(this.primaryColor,{h:270}),this.cScale10=this.cScale10||S(this.primaryColor,{h:300}),this.cScale11=this.cScale11||S(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Gg=p(e=>{const t=new Ug;return t.calculate(e),t},"getThemeVariables"),Vg=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=S(this.primaryColor,{h:-160}),this.primaryBorderColor=z(this.background),this.secondaryBorderColor=Wt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Wt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(z("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=ii(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=et("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=et(this.sectionBkgColor,10),this.taskBorderColor=ii(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=ii(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=H(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=H(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=H(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=S(this.primaryColor,{h:64}),this.fillType3=S(this.secondaryColor,{h:64}),this.fillType4=S(this.primaryColor,{h:-64}),this.fillType5=S(this.secondaryColor,{h:-64}),this.fillType6=S(this.primaryColor,{h:128}),this.fillType7=S(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||S(this.primaryColor,{h:30}),this.cScale4=this.cScale4||S(this.primaryColor,{h:60}),this.cScale5=this.cScale5||S(this.primaryColor,{h:90}),this.cScale6=this.cScale6||S(this.primaryColor,{h:120}),this.cScale7=this.cScale7||S(this.primaryColor,{h:150}),this.cScale8=this.cScale8||S(this.primaryColor,{h:210}),this.cScale9=this.cScale9||S(this.primaryColor,{h:270}),this.cScale10=this.cScale10||S(this.primaryColor,{h:300}),this.cScale11=this.cScale11||S(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Xg=p(e=>{const t=new Vg;return t.calculate(e),t},"getThemeVariables"),Zg=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=S(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=S(this.primaryColor,{h:-160}),this.primaryBorderColor=Wt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Wt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Wt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=ii(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||S(this.primaryColor,{h:30}),this.cScale4=this.cScale4||S(this.primaryColor,{h:60}),this.cScale5=this.cScale5||S(this.primaryColor,{h:90}),this.cScale6=this.cScale6||S(this.primaryColor,{h:120}),this.cScale7=this.cScale7||S(this.primaryColor,{h:150}),this.cScale8=this.cScale8||S(this.primaryColor,{h:210}),this.cScale9=this.cScale9||S(this.primaryColor,{h:270}),this.cScale10=this.cScale10||S(this.primaryColor,{h:300}),this.cScale11=this.cScale11||S(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let e=0;e{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Kg=p(e=>{const t=new Zg;return t.calculate(e),t},"getThemeVariables"),Qg=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=H("#cde498",10),this.primaryBorderColor=Wt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Wt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Wt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.primaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=et(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||S(this.primaryColor,{h:30}),this.cScale4=this.cScale4||S(this.primaryColor,{h:60}),this.cScale5=this.cScale5||S(this.primaryColor,{h:90}),this.cScale6=this.cScale6||S(this.primaryColor,{h:120}),this.cScale7=this.cScale7||S(this.primaryColor,{h:150}),this.cScale8=this.cScale8||S(this.primaryColor,{h:210}),this.cScale9=this.cScale9||S(this.primaryColor,{h:270}),this.cScale10=this.cScale10||S(this.primaryColor,{h:300}),this.cScale11=this.cScale11||S(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Jg=p(e=>{const t=new Qg;return t.calculate(e),t},"getThemeVariables"),tm=class{static{p(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=S(this.primaryColor,{h:-160}),this.primaryBorderColor=Wt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Wt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Wt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},em=p(e=>{const t=new tm;return t.calculate(e),t},"getThemeVariables"),Ae={base:{getThemeVariables:Gg},dark:{getThemeVariables:Xg},default:{getThemeVariables:Kg},forest:{getThemeVariables:Jg},neutral:{getThemeVariables:em}},fe={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},pc={...fe,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ae.default.getThemeVariables(),sequence:{...fe.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...fe.gantt,tickInterval:void 0,useWidth:void 0},c4:{...fe.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...fe.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...fe.pie,useWidth:984},xyChart:{...fe.xyChart,useWidth:void 0},requirement:{...fe.requirement,useWidth:void 0},packet:{...fe.packet},radar:{...fe.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},gc=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...gc(e[i],"")]:[...r,t+i],[]),"keyify"),rm=new Set(gc(pc,"")),mc=pc,ra=p(e=>{if(F.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ra(t));return}for(const t of Object.keys(e)){if(F.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!rm.has(t)||e[t]==null){F.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){F.debug("sanitizing object",t),ra(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(F.debug("sanitizing css option",t),e[t]=im(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}F.debug("After sanitization",e)}},"sanitizeDirective"),im=p(e=>{let t=0,r=0;for(const i of e){if(t{let r=_t({},e),i={};for(const a of t)bc(a),i=_t(i,a);if(r=_t(r,i),i.theme&&i.theme in Ae){const a=_t({},ia),n=_t(a.themeVariables||{},i.themeVariables);r.theme&&r.theme in Ae&&(r.themeVariables=Ae[r.theme].getThemeVariables(n))}return ni=r,Cc(ni),ni},"updateCurrentConfig"),am=p(e=>(Vt=_t({},Sr),Vt=_t(Vt,e),e.theme&&Ae[e.theme]&&(Vt.themeVariables=Ae[e.theme].getThemeVariables(e.themeVariables)),$a(Vt,rr),Vt),"setSiteConfig"),nm=p(e=>{ia=_t({},e)},"saveConfigFromInitialize"),sm=p(e=>(Vt=_t(Vt,e),$a(Vt,rr),Vt),"updateSiteConfig"),yc=p(()=>_t({},Vt),"getSiteConfig"),xc=p(e=>(Cc(e),_t(ni,e),Ot()),"setConfig"),Ot=p(()=>_t({},ni),"getConfig"),bc=p(e=>{e&&(["secure",...Vt.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(F.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&bc(e[t])}))},"sanitize"),om=p(e=>{ra(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),rr.push(e),$a(Vt,rr)},"addDirective"),aa=p((e=Vt)=>{rr=[],$a(e,rr)},"reset"),lm={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},qo={},cm=p(e=>{qo[e]||(F.warn(lm[e]),qo[e]=!0)},"issueWarning"),Cc=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&cm("LAZY_LOAD_DEPRECATED")},"checkConfig"),WS=p(()=>{let e={};ia&&(e=_t(e,ia));for(const t of rr)e=_t(e,t);return e},"getUserDefinedConfig"),bi=//gi,hm=p(e=>e?vc(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),um=(()=>{let e=!1;return()=>{e||(kc(),e=!0)}})();function kc(){const e="data-temp-href-target";vr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),vr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(kc,"setupDompurifyHooks");var wc=p(e=>(um(),vr.sanitize(e)),"removeScript"),Ho=p((e,t)=>{if(t.flowchart?.htmlLabels!==!1){const r=t.securityLevel;r==="antiscript"||r==="strict"?e=wc(e):r!=="loose"&&(e=vc(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=gm(e))}return e},"sanitizeMore"),Jt=p((e,t)=>e&&(t.dompurifyConfig?e=vr.sanitize(Ho(e,t),t.dompurifyConfig).toString():e=vr.sanitize(Ho(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),dm=p((e,t)=>typeof e=="string"?Jt(e,t):e.flat().map(r=>Jt(r,t)),"sanitizeTextOrArray"),fm=p(e=>bi.test(e),"hasBreaks"),pm=p(e=>e.split(bi),"splitBreaks"),gm=p(e=>e.replace(/#br#/g,"
                "),"placeholderToBreak"),vc=p(e=>e.replace(bi,"#br#"),"breakToPlaceholder"),mm=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Lt=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ym=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),xm=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),jo=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),bm=p((e,t)=>{const r=Fn(e,"~"),i=Fn(t,"~");return r===1&&i===1},"shouldCombineSets"),Cm=p(e=>{const t=Fn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let a=i.indexOf("~"),n=i.lastIndexOf("~");for(;a!==-1&&n!==-1&&a!==n;)i[a]="<",i[n]=">",a=i.indexOf("~"),n=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Yo=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Dn=/\$\$(.*)\$\$/g,Tr=p(e=>(e.match(Dn)?.length??0)>0,"hasKatex"),qS=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await ws(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const a={width:r.clientWidth,height:r.clientHeight};return r.remove(),a},"calculateMathMLDimensions"),km=p(async(e,t)=>{if(!Tr(e))return e;if(!(Yo()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Dn,"MathML is unsupported in this environment.");{const{default:r}=await pt(async()=>{const{default:a}=await import("./katex-XbL3y5x-.js");return{default:a}},[],import.meta.url),i=t.forceLegacyMathML||!Yo()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(bi).map(a=>Tr(a)?`
                ${a}
                `:`
                ${a}
                `).join("").replace(Dn,(a,n)=>r.renderToString(n,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),ws=p(async(e,t)=>Jt(await km(e,t),t),"renderKatexSanitized"),Mr={getRows:hm,sanitizeText:Jt,sanitizeTextOrArray:dm,hasBreaks:fm,splitBreaks:pm,lineBreakRegex:bi,removeScript:wc,getUrl:mm,evaluate:Lt,getMax:ym,getMin:xm},wm=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),vm=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Sc=p(function(e,t,r,i){const a=vm(t,r,i);wm(e,a)},"configureSvgSize"),Sm=p(function(e,t,r,i){const a=t.node().getBBox(),n=a.width,s=a.height;F.info(`SVG bounds: ${n}x${s}`,a);let o=0,l=0;F.info(`Graph bounds: ${o}x${l}`,e),o=n+r*2,l=s+r*2,F.info(`Calculated bounds: ${o}x${l}`),Sc(t,l,o,i);const c=`${a.x-r} ${a.y-r} ${a.width+2*r} ${a.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Ui={},Tm=p((e,t,r)=>{let i="";return e in Ui&&Ui[e]?i=Ui[e](r):F.warn(`No theme found for ${e}`),` & { - font-family: ${r.fontFamily}; - font-size: ${r.fontSize}; - fill: ${r.textColor} - } - @keyframes edge-animation-frame { - from { - stroke-dashoffset: 0; - } - } - @keyframes dash { - to { - stroke-dashoffset: 0; - } - } - & .edge-animation-slow { - stroke-dasharray: 9,5 !important; - stroke-dashoffset: 900; - animation: dash 50s linear infinite; - stroke-linecap: round; - } - & .edge-animation-fast { - stroke-dasharray: 9,5 !important; - stroke-dashoffset: 900; - animation: dash 20s linear infinite; - stroke-linecap: round; - } - /* Classes common for multiple diagrams */ - - & .error-icon { - fill: ${r.errorBkgColor}; - } - & .error-text { - fill: ${r.errorTextColor}; - stroke: ${r.errorTextColor}; - } - - & .edge-thickness-normal { - stroke-width: 1px; - } - & .edge-thickness-thick { - stroke-width: 3.5px - } - & .edge-pattern-solid { - stroke-dasharray: 0; - } - & .edge-thickness-invisible { - stroke-width: 0; - fill: none; - } - & .edge-pattern-dashed{ - stroke-dasharray: 3; - } - .edge-pattern-dotted { - stroke-dasharray: 2; - } - - & .marker { - fill: ${r.lineColor}; - stroke: ${r.lineColor}; - } - & .marker.cross { - stroke: ${r.lineColor}; - } - - & svg { - font-family: ${r.fontFamily}; - font-size: ${r.fontSize}; - } - & p { - margin: 0 - } - - ${i} - - ${t} -`},"getStyles"),_m=p((e,t)=>{t!==void 0&&(Ui[e]=t)},"addStylesForDiagram"),Bm=Tm,Tc={};gg(Tc,{clear:()=>Lm,getAccDescription:()=>$m,getAccTitle:()=>Mm,getDiagramTitle:()=>Dm,setAccDescription:()=>Em,setAccTitle:()=>Am,setDiagramTitle:()=>Fm});var vs="",Ss="",Ts="",_s=p(e=>Jt(e,Ot()),"sanitizeText"),Lm=p(()=>{vs="",Ts="",Ss=""},"clear"),Am=p(e=>{vs=_s(e).replace(/^\s+/g,"")},"setAccTitle"),Mm=p(()=>vs,"getAccTitle"),Em=p(e=>{Ts=_s(e).replace(/\n\s+/g,` -`)},"setAccDescription"),$m=p(()=>Ts,"getAccDescription"),Fm=p(e=>{Ss=_s(e)},"setDiagramTitle"),Dm=p(()=>Ss,"getDiagramTitle"),Uo=F,Om=Cs,dt=Ot,HS=xc,jS=Sr,Bs=p(e=>Jt(e,dt()),"sanitizeText"),Rm=Sm,Im=p(()=>Tc,"getCommonDb"),na={},sa=p((e,t,r)=>{na[e]&&Uo.warn(`Diagram with id ${e} already registered. Overwriting.`),na[e]=t,r&&fc(e,r),_m(e,t.styles),t.injectUtils?.(Uo,Om,dt,Bs,Rm,Im(),()=>{})},"registerDiagram"),On=p(e=>{if(e in na)return na[e];throw new Pm(e)},"getDiagram"),Pm=class extends Error{static{p(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}};function Go(e,t,r){var i=new Yp;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,r),i}var Nm=og("start","end","cancel","interrupt"),zm=[],_c=0,Vo=1,Rn=2,Gi=3,Xo=4,In=5,Vi=6;function Fa(e,t,r,i,a,n){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Wm(e,r,{name:t,index:i,group:a,on:Nm,tween:zm,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:_c})}function Ls(e,t){var r=he(e,t);if(r.state>_c)throw new Error("too late; already scheduled");return r}function Ce(e,t){var r=he(e,t);if(r.state>Gi)throw new Error("too late; already running");return r}function he(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Wm(e,t,r){var i=e.__transition,a;i[t]=r,r.timer=Up(n,0,r.time);function n(c){r.state=Vo,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,u,d,f;if(r.state!==Vo)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===Gi)return Go(s);f.state===Xo?(f.state=Vi,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+hRn&&i.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function xy(e,t,r){var i,a,n=yy(t)?Ls:Ce;return function(){var s=n(this,e),o=s.on;o!==i&&(a=(i=o).copy()).on(t,r),s.on=a}}function by(e,t){var r=this._id;return arguments.length<2?he(this.node(),r).on.on(e):this.each(xy(r,e,t))}function Cy(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function ky(){return this.on("end.remove",Cy(this._id))}function wy(e){var t=this._name,r=this._id;typeof e!="function"&&(e=cg(e));for(var i=this._groups,a=i.length,n=new Array(a),s=0;s{const{securityLevel:t}=dt();let r=ht("body");if(t==="sandbox"){const n=ht(`#i${e}`).node()?.contentDocument??document;r=ht(n.body)}return r.select(`#${e}`)},"selectSvgElement");function Ms(e){return typeof e>"u"||e===null}p(Ms,"isNothing");function Fc(e){return typeof e=="object"&&e!==null}p(Fc,"isObject");function Dc(e){return Array.isArray(e)?e:Ms(e)?[]:[e]}p(Dc,"toArray");function Oc(e,t){var r,i,a,n;if(t)for(n=Object.keys(t),r=0,i=n.length;ro&&(n=" ... ",t=i-o+n.length),r-i>o&&(s=" ...",r=i+o-s.length),{str:n+e.slice(t,r).replace(/\t/g,"→")+s,pos:i-t+n.length}}p(Xi,"getLine");function Zi(e,t){return Bt.repeat(" ",t-e.length)+e}p(Zi,"padStart");function Pc(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],a=[],n,s=-1;n=r.exec(e.buffer);)a.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var o="",l,c,h=Math.min(e.line+t.linesAfter,a.length).toString().length,u=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)c=Xi(e.buffer,i[s-l],a[s-l],e.position-(i[s]-i[s-l]),u),o=Bt.repeat(" ",t.indent)+Zi((e.line-l+1).toString(),h)+" | "+c.str+` -`+o;for(c=Xi(e.buffer,i[s],a[s],e.position,u),o+=Bt.repeat(" ",t.indent)+Zi((e.line+1).toString(),h)+" | "+c.str+` -`,o+=Bt.repeat("-",t.indent+h+3+c.pos)+`^ -`,l=1;l<=t.linesAfter&&!(s+l>=a.length);l++)c=Xi(e.buffer,i[s+l],a[s+l],e.position-(i[s]-i[s+l]),u),o+=Bt.repeat(" ",t.indent)+Zi((e.line+l+1).toString(),h)+" | "+c.str+` -`;return o.replace(/\n$/,"")}p(Pc,"makeSnippet");var t0=Pc,e0=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r0=["scalar","sequence","mapping"];function Nc(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(Nc,"compileStyleAliases");function zc(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(e0.indexOf(r)===-1)throw new Xt('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Nc(t.styleAliases||null),r0.indexOf(this.kind)===-1)throw new Xt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(zc,"Type$1");var Rt=zc;function Pn(e,t){var r=[];return e[t].forEach(function(i){var a=r.length;r.forEach(function(n,s){n.tag===i.tag&&n.kind===i.kind&&n.multi===i.multi&&(a=s)}),r[a]=i}),r}p(Pn,"compileList");function Wc(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(p(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),u0=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function th(e){return!(e===null||!u0.test(e)||e[e.length-1]==="_")}p(th,"resolveYamlFloat");function eh(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(eh,"constructYamlFloat");var d0=/^[-+]?[0-9]+e/;function rh(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Bt.isNegativeZero(e))return"-0.0";return r=e.toString(10),d0.test(r)?r.replace("e",".e"):r}p(rh,"representYamlFloat");function ih(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Bt.isNegativeZero(e))}p(ih,"isFloat");var f0=new Rt("tag:yaml.org,2002:float",{kind:"scalar",resolve:th,construct:eh,predicate:ih,represent:rh,defaultStyle:"lowercase"}),ah=o0.extend({implicit:[l0,c0,h0,f0]}),p0=ah,nh=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),sh=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function oh(e){return e===null?!1:nh.exec(e)!==null||sh.exec(e)!==null}p(oh,"resolveYamlTimestamp");function lh(e){var t,r,i,a,n,s,o,l=0,c=null,h,u,d;if(t=nh.exec(e),t===null&&(t=sh.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(r,i,a));if(n=+t[4],s=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],u=+(t[11]||0),c=(h*60+u)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(r,i,a,n,s,o,l)),c&&d.setTime(d.getTime()-c),d}p(lh,"constructYamlTimestamp");function ch(e){return e.toISOString()}p(ch,"representYamlTimestamp");var g0=new Rt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:oh,construct:lh,instanceOf:Date,represent:ch});function hh(e){return e==="<<"||e===null}p(hh,"resolveYamlMerge");var m0=new Rt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hh}),$s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function uh(e){if(e===null)return!1;var t,r,i=0,a=e.length,n=$s;for(r=0;r64)){if(t<0)return!1;i+=6}return i%8===0}p(uh,"resolveYamlBinary");function dh(e){var t,r,i=e.replace(/[\r\n=]/g,""),a=i.length,n=$s,s=0,o=[];for(t=0;t>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|n.indexOf(i.charAt(t));return r=a%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}p(dh,"constructYamlBinary");function fh(e){var t="",r=0,i,a,n=e.length,s=$s;for(i=0;i>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[i];return a=n%3,a===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):a===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):a===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}p(fh,"representYamlBinary");function ph(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(ph,"isBinary");var y0=new Rt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:uh,construct:dh,predicate:ph,represent:fh}),x0=Object.prototype.hasOwnProperty,b0=Object.prototype.toString;function gh(e){if(e===null)return!0;var t=[],r,i,a,n,s,o=e;for(r=0,i=o.length;r>10)+55296,(e-65536&1023)+56320)}p(Ah,"charFromCodepoint");var Mh=new Array(256),Eh=new Array(256);for(Ve=0;Ve<256;Ve++)Mh[Ve]=zn(Ve)?1:0,Eh[Ve]=zn(Ve);var Ve;function $h(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kh,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p($h,"State$1");function Fs(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=t0(r),new Xt(t,r)}p(Fs,"generateError");function Q(e,t){throw Fs(e,t)}p(Q,"throwError");function ci(e,t){e.onWarning&&e.onWarning.call(null,Fs(e,t))}p(ci,"throwWarning");var Ko={YAML:p(function(t,r,i){var a,n,s;t.version!==null&&Q(t,"duplication of %YAML directive"),i.length!==1&&Q(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),a===null&&Q(t,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),s=parseInt(a[2],10),n!==1&&Q(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&ci(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var a,n;i.length!==2&&Q(t,"TAG directive accepts exactly two arguments"),a=i[0],n=i[1],Sh.test(a)||Q(t,"ill-formed tag handle (first argument) of the TAG directive"),Ne.call(t.tagMap,a)&&Q(t,'there is a previously declared suffix for "'+a+'" tag handle'),Th.test(n)||Q(t,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{Q(t,"tag prefix is malformed: "+n)}t.tagMap[a]=n},"handleTagDirective")};function Me(e,t,r,i){var a,n,s,o;if(t1&&(e.result+=Bt.repeat(` -`,t-1))}p(Oa,"writeFoldedLines");function Fh(e,t,r){var i,a,n,s,o,l,c,h,u=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),qt(f)||Qe(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(a=e.input.charCodeAt(e.position+1),qt(a)||r&&Qe(a)))return!1;for(e.kind="scalar",e.result="",n=s=e.position,o=!1;f!==0;){if(f===58){if(a=e.input.charCodeAt(e.position+1),qt(a)||r&&Qe(a))break}else if(f===35){if(i=e.input.charCodeAt(e.position-1),qt(i))break}else{if(e.position===e.lineStart&&Ci(e)||r&&Qe(f))break;if(le(f))if(l=e.line,c=e.lineStart,h=e.lineIndent,bt(e,!1,-1),e.lineIndent>=t){o=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=c,e.lineIndent=h;break}}o&&(Me(e,n,s,!1),Oa(e,e.line-l),n=s=e.position,o=!1),Pe(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return Me(e,n,s,!1),e.result?!0:(e.kind=u,e.result=d,!1)}p(Fh,"readPlainScalar");function Dh(e,t){var r,i,a;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Me(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,a=e.position;else return!0;else le(r)?(Me(e,i,a,!0),Oa(e,bt(e,!1,t)),i=a=e.position):e.position===e.lineStart&&Ci(e)?Q(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Q(e,"unexpected end of the stream within a single quoted scalar")}p(Dh,"readSingleQuotedScalar");function Oh(e,t){var r,i,a,n,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Me(e,r,e.position,!0),e.position++,!0;if(o===92){if(Me(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),le(o))bt(e,!1,t);else if(o<256&&Mh[o])e.result+=Eh[o],e.position++;else if((s=Bh(o))>0){for(a=s,n=0;a>0;a--)o=e.input.charCodeAt(++e.position),(s=_h(o))>=0?n=(n<<4)+s:Q(e,"expected hexadecimal character");e.result+=Ah(n),e.position++}else Q(e,"unknown escape sequence");r=i=e.position}else le(o)?(Me(e,r,i,!0),Oa(e,bt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ci(e)?Q(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Q(e,"unexpected end of the stream within a double quoted scalar")}p(Oh,"readDoubleQuotedScalar");function Rh(e,t){var r=!0,i,a,n,s=e.tag,o,l=e.anchor,c,h,u,d,f,g=Object.create(null),m,y,x,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,f=!1,o=[];else if(b===123)h=125,f=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),b=e.input.charCodeAt(++e.position);b!==0;){if(bt(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=s,e.anchor=l,e.kind=f?"mapping":"sequence",e.result=o,!0;r?b===44&&Q(e,"expected the node content, but found ','"):Q(e,"missed comma between flow collection entries"),y=m=x=null,u=d=!1,b===63&&(c=e.input.charCodeAt(e.position+1),qt(c)&&(u=d=!0,e.position++,bt(e,!0,t))),i=e.line,a=e.lineStart,n=e.position,ir(e,t,la,!1,!0),y=e.tag,m=e.result,bt(e,!0,t),b=e.input.charCodeAt(e.position),(d||e.line===i)&&b===58&&(u=!0,b=e.input.charCodeAt(++e.position),bt(e,!0,t),ir(e,t,la,!1,!0),x=e.result),f?Je(e,o,g,y,m,x,i,a,n):u?o.push(Je(e,null,g,y,m,x,i,a,n)):o.push(m),bt(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}Q(e,"unexpected end of the stream within a flow collection")}p(Rh,"readFlowCollection");function Ih(e,t){var r,i,a=gn,n=!1,s=!1,o=t,l=0,c=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)gn===a?a=u===43?Zo:T0:Q(e,"repeat of a chomping mode identifier");else if((h=Lh(u))>=0)h===0?Q(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Q(e,"repeat of an indentation width identifier"):(o=t+h-1,s=!0);else break;if(Pe(u)){do u=e.input.charCodeAt(++e.position);while(Pe(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!le(u)&&u!==0)}for(;u!==0;){for(Da(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!s||e.lineIndento&&(o=e.lineIndent),le(u)){l++;continue}if(e.lineIndentt)&&l!==0)Q(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(s=e.line,o=e.lineStart,l=e.position),ir(e,t,ca,!0,a)&&(y?g=e.result:m=e.result),y||(Je(e,u,d,f,g,m,s,o,l),f=g=m=null),bt(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===n||e.lineIndent>t)&&b!==0)Q(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u"),e.result!==null&&g.kind!==e.kind&&Q(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Q(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(ir,"composeNode");function qh(e){var t=e.position,r,i,a,n=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(bt(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(n=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!qt(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),a=[],i.length<1&&Q(e,"directive name must not be less than one character in length");s!==0;){for(;Pe(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!le(s));break}if(le(s))break;for(r=e.position;s!==0&&!qt(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(r,e.position))}s!==0&&Da(e),Ne.call(Ko,i)?Ko[i](e,i,a):ci(e,'unknown document directive "'+i+'"')}if(bt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,bt(e,!0,-1)):n&&Q(e,"directives end mark is expected"),ir(e,e.lineIndent-1,ca,!1,!0),bt(e,!0,-1),e.checkLineBreaks&&B0.test(e.input.slice(t,e.position))&&ci(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ci(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,bt(e,!0,-1));return}if(e.position"u"&&(r=t,t=null);var i=Ds(e,r);if(typeof t!="function")return i;for(var a=0,n=i.length;a=55296&&r<=56319&&t+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(Cr,"codePointAt");function Rs(e){var t=/^\n* /;return t.test(e)}p(Rs,"needIndentIndicator");var iu=1,Gn=2,au=3,nu=4,xr=5;function su(e,t,r,i,a,n,s,o){var l,c=0,h=null,u=!1,d=!1,f=i!==-1,g=-1,m=eu(Cr(e,0))&&ru(Cr(e,e.length-1));if(t||s)for(l=0;l=65536?l+=2:l++){if(c=Cr(e,l),!Br(c))return xr;m=m&&Un(c,h,o),h=c}else{for(l=0;l=65536?l+=2:l++){if(c=Cr(e,l),c===hi)u=!0,f&&(d=d||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Br(c))return xr;m=m&&Un(c,h,o),h=c}d=d||f&&l-g-1>i&&e[g+1]!==" "}return!u&&!d?m&&!s&&!a(e)?iu:n===ui?xr:Gn:r>9&&Rs(e)?xr:s?n===ui?xr:Gn:d?nu:au}p(su,"chooseScalarStyle");function ou(e,t,r,i,a){e.dump=(function(){if(t.length===0)return e.quotingType===ui?'""':"''";if(!e.noCompatMode&&(V0.indexOf(t)!==-1||X0.test(t)))return e.quotingType===ui?'"'+t+'"':"'"+t+"'";var n=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-n),o=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return tu(e,c)}switch(p(l,"testAmbiguity"),su(t,o,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,a)){case iu:return t;case Gn:return"'"+t.replace(/'/g,"''")+"'";case au:return"|"+Vn(t,e.indent)+Xn(jn(t,n));case nu:return">"+Vn(t,e.indent)+Xn(jn(lu(t,s),n));case xr:return'"'+cu(t)+'"';default:throw new Xt("impossible error: invalid scalar style")}})()}p(ou,"writeScalar");function Vn(e,t){var r=Rs(e)?String(t):"",i=e[e.length-1]===` -`,a=i&&(e[e.length-2]===` -`||e===` -`),n=a?"+":i?"":"-";return r+n+` -`}p(Vn,"blockHeader");function Xn(e){return e[e.length-1]===` -`?e.slice(0,-1):e}p(Xn,"dropEndingNewline");function lu(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(` -`);return c=c!==-1?c:e.length,r.lastIndex=c,Zn(e.slice(0,c),t)})(),a=e[0]===` -`||e[0]===" ",n,s;s=r.exec(e);){var o=s[1],l=s[2];n=l[0]===" ",i+=o+(!a&&!n&&l!==""?` -`:"")+Zn(l,t),a=n}return i}p(lu,"foldString");function Zn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,a=0,n,s=0,o=0,l="";i=r.exec(e);)o=i.index,o-a>t&&(n=s>a?s:o,l+=` -`+e.slice(a,n),a=n+1),s=o;return l+=` -`,e.length-a>t&&s>a?l+=e.slice(a,s)+` -`+e.slice(s+1):l+=e.slice(a),l.slice(1)}p(Zn,"foldLine");function cu(e){for(var t="",r=0,i,a=0;a=65536?a+=2:a++)r=Cr(e,a),i=Pt[r],!i&&Br(r)?(t+=e[a],r>=65536&&(t+=e[a+1])):t+=i||Qh(r);return t}p(cu,"escapeString");function hu(e,t,r){var i="",a=e.tag,n,s,o;for(n=0,s=r.length;n"u"&&be(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}p(hu,"writeFlowSequence");function Kn(e,t,r,i){var a="",n=e.tag,s,o,l;for(s=0,o=r.length;s"u"&&be(e,t+1,null,!0,!0,!1,!0))&&((!i||a!=="")&&(a+=ua(e,t)),e.dump&&hi===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=n,e.dump=a||"[]"}p(Kn,"writeBlockSequence");function uu(e,t,r){var i="",a=e.tag,n=Object.keys(r),s,o,l,c,h;for(s=0,o=n.length;s1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),be(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=a,e.dump="{"+i+"}"}p(uu,"writeFlowMapping");function du(e,t,r,i){var a="",n=e.tag,s=Object.keys(r),o,l,c,h,u,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Xt("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,u&&(e.dump&&hi===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=ua(e,t)),be(e,t+1,h,!0,u)&&(e.dump&&hi===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,a+=d));e.tag=n,e.dump=a||"{}"}p(du,"writeBlockMapping");function Qn(e,t,r){var i,a,n,s,o,l;for(a=r?e.explicitTypes:e.implicitTypes,n=0,s=a.length;n tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(Qn,"detectType");function be(e,t,r,i,a,n,s){e.tag=null,e.dump=r,Qn(e,r,!1)||Qn(e,r,!0);var o=jh.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=o==="[object Object]"||o==="[object Array]",u,d;if(h&&(u=e.duplicates.indexOf(r),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(a=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")i&&Object.keys(e.dump).length!==0?(du(e,t,e.dump,a),d&&(e.dump="&ref_"+u+e.dump)):(uu(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Kn(e,t-1,e.dump,a):Kn(e,t,e.dump,a),d&&(e.dump="&ref_"+u+e.dump)):(hu(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&ou(e,e.dump,t,n,l);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Xt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(be,"writeNode");function fu(e,t){var r=[],i=[],a,n;for(da(e,r,i),a=0,n=i.length;aArray.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),ex=p(e=>({x:p(function(t,r,i){let a=0;const n=yt(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Dt,e.arrowTypeEnd)){const{angle:f,deltaX:g}=Kr(i[i.length-1],i[i.length-2]);a=Dt[e.arrowTypeEnd]*Math.cos(f)*(g>=0?1:-1)}const s=Math.abs(yt(t).x-yt(i[i.length-1]).x),o=Math.abs(yt(t).y-yt(i[i.length-1]).y),l=Math.abs(yt(t).x-yt(i[0]).x),c=Math.abs(yt(t).y-yt(i[0]).y),h=Dt[e.arrowTypeStart],u=Dt[e.arrowTypeEnd],d=1;if(s0&&o0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Dt,e.arrowTypeEnd)){const{angle:f,deltaY:g}=Kr(i[i.length-1],i[i.length-2]);a=Dt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(g>=0?1:-1)}const s=Math.abs(yt(t).y-yt(i[i.length-1]).y),o=Math.abs(yt(t).x-yt(i[i.length-1]).x),l=Math.abs(yt(t).y-yt(i[0]).y),c=Math.abs(yt(t).x-yt(i[0]).x),h=Dt[e.arrowTypeStart],u=Dt[e.arrowTypeEnd],d=1;if(s0&&o0&&c{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),rx=p(e=>{const{handDrawnSeed:t}=dt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Er=p(e=>{const t=ix([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),ix=p(e=>{const t=new Map;return e.forEach(r=>{const[i,a]=r.split(":");t.set(i.trim(),a?.trim())}),t},"styles2Map"),pu=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),U=p(e=>{const{stylesArray:t}=Er(e),r=[],i=[],a=[],n=[];return t.forEach(s=>{const o=s[0];pu(o)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),o.includes("stroke")&&a.push(s.join(":")+" !important"),o==="fill"&&n.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:a,backgroundStyles:n}},"styles2String"),Y=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=dt(),{nodeBorder:a,mainBkg:n}=r,{stylesMap:s}=Er(e);return Object.assign({roughness:.7,fill:s.get("fill")||n,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||a,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:ax(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),ax=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const a=isNaN(t[0])?0:t[0];return[a,a]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Hr={},Tt={},Jo;function nx(){return Jo||(Jo=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.BLANK_URL=Tt.relativeFirstCharacters=Tt.whitespaceEscapeCharsRegex=Tt.urlSchemeRegex=Tt.ctrlCharactersRegex=Tt.htmlCtrlEntityRegex=Tt.htmlEntitiesRegex=Tt.invalidProtocolRegex=void 0,Tt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Tt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Tt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Tt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Tt.urlSchemeRegex=/^.+(:|:)/gim,Tt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Tt.relativeFirstCharacters=[".","/"],Tt.BLANK_URL="about:blank"),Tt}var tl;function sx(){if(tl)return Hr;tl=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.sanitizeUrl=void 0;var e=nx();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(e.ctrlCharactersRegex,"");return o.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(s){return URL.canParse(s)}function a(s){try{return decodeURIComponent(s)}catch{return s}}function n(s){if(!s)return e.BLANK_URL;var o,l=a(s.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=a(l),o=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(d))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(d==="mailto:"||d.includes("://"))return f;if(d==="http:"||d==="https:"){if(!i(f))return e.BLANK_URL;var g=new URL(f);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return f}return Hr.sanitizeUrl=n,Hr}var ox=sx(),gu=typeof global=="object"&&global&&global.Object===Object&&global,lx=typeof self=="object"&&self&&self.Object===Object&&self,ke=gu||lx||Function("return this")(),fa=ke.Symbol,mu=Object.prototype,cx=mu.hasOwnProperty,hx=mu.toString,jr=fa?fa.toStringTag:void 0;function ux(e){var t=cx.call(e,jr),r=e[jr];try{e[jr]=void 0;var i=!0}catch{}var a=hx.call(e);return i&&(t?e[jr]=r:delete e[jr]),a}var dx=Object.prototype,fx=dx.toString;function px(e){return fx.call(e)}var gx="[object Null]",mx="[object Undefined]",el=fa?fa.toStringTag:void 0;function $r(e){return e==null?e===void 0?mx:gx:el&&el in Object(e)?ux(e):px(e)}function or(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var yx="[object AsyncFunction]",xx="[object Function]",bx="[object GeneratorFunction]",Cx="[object Proxy]";function Ps(e){if(!or(e))return!1;var t=$r(e);return t==xx||t==bx||t==yx||t==Cx}var mn=ke["__core-js_shared__"],rl=(function(){var e=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function kx(e){return!!rl&&rl in e}var wx=Function.prototype,vx=wx.toString;function lr(e){if(e!=null){try{return vx.call(e)}catch{}try{return e+""}catch{}}return""}var Sx=/[\\^$.*+?()[\]{}|]/g,Tx=/^\[object .+?Constructor\]$/,_x=Function.prototype,Bx=Object.prototype,Lx=_x.toString,Ax=Bx.hasOwnProperty,Mx=RegExp("^"+Lx.call(Ax).replace(Sx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ex(e){if(!or(e)||kx(e))return!1;var t=Ps(e)?Mx:Tx;return t.test(lr(e))}function $x(e,t){return e?.[t]}function cr(e,t){var r=$x(e,t);return Ex(r)?r:void 0}var fi=cr(Object,"create");function Fx(){this.__data__=fi?fi(null):{},this.size=0}function Dx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ox="__lodash_hash_undefined__",Rx=Object.prototype,Ix=Rx.hasOwnProperty;function Px(e){var t=this.__data__;if(fi){var r=t[e];return r===Ox?void 0:r}return Ix.call(t,e)?t[e]:void 0}var Nx=Object.prototype,zx=Nx.hasOwnProperty;function Wx(e){var t=this.__data__;return fi?t[e]!==void 0:zx.call(t,e)}var qx="__lodash_hash_undefined__";function Hx(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=fi&&t===void 0?qx:t,this}function ar(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}function Zx(e,t){var r=this.__data__,i=Ia(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function De(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=vb}function za(e){return e!=null&&ku(e.length)&&!Ps(e)}function Sb(e){return wi(e)&&za(e)}function Tb(){return!1}var wu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cl=wu&&typeof module=="object"&&module&&!module.nodeType&&module,_b=cl&&cl.exports===wu,hl=_b?ke.Buffer:void 0,Bb=hl?hl.isBuffer:void 0,zs=Bb||Tb,Lb="[object Object]",Ab=Function.prototype,Mb=Object.prototype,vu=Ab.toString,Eb=Mb.hasOwnProperty,$b=vu.call(Object);function Fb(e){if(!wi(e)||$r(e)!=Lb)return!1;var t=bu(e);if(t===null)return!0;var r=Eb.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&vu.call(r)==$b}var Db="[object Arguments]",Ob="[object Array]",Rb="[object Boolean]",Ib="[object Date]",Pb="[object Error]",Nb="[object Function]",zb="[object Map]",Wb="[object Number]",qb="[object Object]",Hb="[object RegExp]",jb="[object Set]",Yb="[object String]",Ub="[object WeakMap]",Gb="[object ArrayBuffer]",Vb="[object DataView]",Xb="[object Float32Array]",Zb="[object Float64Array]",Kb="[object Int8Array]",Qb="[object Int16Array]",Jb="[object Int32Array]",t1="[object Uint8Array]",e1="[object Uint8ClampedArray]",r1="[object Uint16Array]",i1="[object Uint32Array]",gt={};gt[Xb]=gt[Zb]=gt[Kb]=gt[Qb]=gt[Jb]=gt[t1]=gt[e1]=gt[r1]=gt[i1]=!0;gt[Db]=gt[Ob]=gt[Gb]=gt[Rb]=gt[Vb]=gt[Ib]=gt[Pb]=gt[Nb]=gt[zb]=gt[Wb]=gt[qb]=gt[Hb]=gt[jb]=gt[Yb]=gt[Ub]=!1;function a1(e){return wi(e)&&ku(e.length)&&!!gt[$r(e)]}function n1(e){return function(t){return e(t)}}var Su=typeof exports=="object"&&exports&&!exports.nodeType&&exports,si=Su&&typeof module=="object"&&module&&!module.nodeType&&module,s1=si&&si.exports===Su,yn=s1&&gu.process,ul=(function(){try{var e=si&&si.require&&si.require("util").types;return e||yn&&yn.binding&&yn.binding("util")}catch{}})(),dl=ul&&ul.isTypedArray,Ws=dl?n1(dl):a1;function ts(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var o1=Object.prototype,l1=o1.hasOwnProperty;function c1(e,t,r){var i=e[t];(!(l1.call(e,t)&&Ra(i,r))||r===void 0&&!(t in e))&&Ns(e,t,r)}function h1(e,t,r,i){var a=!r;r||(r={});for(var n=-1,s=t.length;++n-1&&e%1==0&&e0){if(++t>=B1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var E1=M1(_1);function $1(e,t){return E1(S1(e,t,Lu),e+"")}function F1(e,t,r){if(!or(r))return!1;var i=typeof t;return(i=="number"?za(r)&&Tu(t,r.length):i=="string"&&t in r)?Ra(r[t],e):!1}function D1(e){return $1(function(t,r){var i=-1,a=r.length,n=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(n=e.length>3&&typeof n=="function"?(a--,n):void 0,s&&F1(r[0],r[1],s)&&(n=a<3?void 0:n,a=1),t=Object(t);++io.args);ra(s),i=_t(i,[...s])}else i=r.args;if(!i)return;let a=ks(e,t);const n="config";return i[n]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[n],delete i[n]),i},"detectInit"),Au=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${P1.source})(?=[}][%]{2}).* -`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),F.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const a=[];for(;(i=ai.exec(e))!==null;)if(i.index===ai.lastIndex&&ai.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const n=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;a.push({type:n,args:s})}return a.length===0?{type:e,args:null}:a.length===1?a[0]:a}catch(r){return F.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),z1=p(function(e){return e.replace(ai,"")},"removeDirectives"),W1=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function qs(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return I1[r]??t}p(qs,"interpolateToCurve");function Mu(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?ox.sanitizeUrl(r):r}p(Mu,"formatUrl");var q1=p((e,...t)=>{const r=e.split("."),i=r.length-1,a=r[i];let n=window;for(let s=0;s{r+=Hs(a,t),t=a});const i=r/2;return js(e,i)}p(Eu,"traverseEdge");function $u(e){return e.length===1?e[0]:Eu(e)}p($u,"calcLabelPosition");var pl=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),js=p((e,t)=>{let r,i=t;for(const a of e){if(r){const n=Hs(a,r);if(n===0)return r;if(n=1)return{x:a.x,y:a.y};if(s>0&&s<1)return{x:pl((1-s)*r.x+s*a.x,5),y:pl((1-s)*r.y+s*a.y,5)}}}r=a}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),H1=p((e,t,r)=>{F.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const a=js(t,25),n=e?10:5,s=Math.atan2(t[0].y-a.y,t[0].x-a.x),o={x:0,y:0};return o.x=Math.sin(s)*n+(t[0].x+a.x)/2,o.y=-Math.cos(s)*n+(t[0].y+a.y)/2,o},"calcCardinalityPosition");function Fu(e,t,r){const i=structuredClone(r);F.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const a=25+e,n=js(i,a),s=10+e*.5,o=Math.atan2(i[0].y-n.y,i[0].x-n.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(i[0].x+n.x)/2,l.y=-Math.cos(o+Math.PI)*s+(i[0].y+n.y)/2):t==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(i[0].x+n.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(i[0].y+n.y)/2-5):t==="end_left"?(l.x=Math.sin(o)*s+(i[0].x+n.x)/2-5,l.y=-Math.cos(o)*s+(i[0].y+n.y)/2-5):(l.x=Math.sin(o)*s+(i[0].x+n.x)/2,l.y=-Math.cos(o)*s+(i[0].y+n.y)/2),l}p(Fu,"calcTerminalLabelPosition");function Du(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(Du,"getStylesFromArray");var gl=0,j1=p(()=>(gl++,"id-"+Math.random().toString(36).substr(2,12)+"-"+gl),"generateId");function Ou(e){let t="";const r="0123456789abcdef",i=r.length;for(let a=0;aOu(e.length),"random"),U1=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),G1=p(function(e,t){const r=t.text.replace(Mr.lineBreakRegex," "),[,i]=Wa(t.fontSize),a=e.append("text");a.attr("x",t.x),a.attr("y",t.y),a.style("text-anchor",t.anchor),a.style("font-family",t.fontFamily),a.style("font-size",i),a.style("font-weight",t.fontWeight),a.attr("fill",t.fill),t.class!==void 0&&a.attr("class",t.class);const n=a.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.attr("fill",t.fill),n.text(r),a},"drawSimpleText"),V1=ki((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
                "},r),Mr.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),a=[];let n="";return i.forEach((s,o)=>{const l=$e(`${s} `,r),c=$e(n,r);if(l>t){const{hyphenatedStrings:d,remainingWord:f}=X1(s,t,"-",r);a.push(n,...d),n=f}else c+l>=t?(a.push(n),n=s):n=[n,s].filter(Boolean).join(" ");o+1===i.length&&a.push(n)}),a.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),X1=ki((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const a=[...e],n=[];let s="";return a.forEach((o,l)=>{const c=`${s}${o}`;if($e(c,i)>=t){const u=l+1,d=a.length===u,f=`${c}${r}`;n.push(d?c:f),s=""}else s=c}),{hyphenatedStrings:n,remainingWord:s}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Ru(e,t){return Ys(e,t).height}p(Ru,"calculateTextHeight");function $e(e,t){return Ys(e,t).width}p($e,"calculateTextWidth");var Ys=ki((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=t;if(!e)return{width:0,height:0};const[,n]=Wa(r),s=["sans-serif",i],o=e.split(Mr.lineBreakRegex),l=[],c=ht("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const d of s){let f=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=U1();y.text=m||R1;const x=G1(h,y).style("font-size",n).style("font-weight",a).style("font-family",d),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),f=Math.round(b.height),g.height+=f,g.lineHeight=Math.round(Math.max(g.lineHeight,f))}l.push(g)}h.remove();const u=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[u]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Z1=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{p(this,"InitIDGenerator")}},Oi,K1=p(function(e){return Oi=Oi||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Oi.innerHTML=e,unescape(Oi.textContent)},"entityDecode");function Us(e){return"str"in e}p(Us,"isDetailedError");var Q1=p((e,t,r,i)=>{if(!i)return;const a=e.node()?.getBBox();a&&e.append("text").text(i).attr("text-anchor","middle").attr("x",a.x+a.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Wa=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Gs(e,t){return O1({},e,t)}p(Gs,"cleanAndMerge");var oe={assignWithDepth:_t,wrapLabel:V1,calculateTextHeight:Ru,calculateTextWidth:$e,calculateTextDimensions:Ys,cleanAndMerge:Gs,detectInit:N1,detectDirective:Au,isSubstringInArray:W1,interpolateToCurve:qs,calcLabelPosition:$u,calcCardinalityPosition:H1,calcTerminalLabelPosition:Fu,formatUrl:Mu,getStylesFromArray:Du,generateId:j1,random:Y1,runFunc:q1,entityDecode:K1,insertTitle:Q1,isLabelCoordinateInPath:Iu,parseFontSize:Wa,InitIDGenerator:Z1},J1=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),hr=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),YS=p((e,t,{counter:r=0,prefix:i,suffix:a},n)=>n||`${i?`${i}_`:""}${e}_${t}_${r}${a?`_${a}`:""}`,"getEdgeId");function It(e){return e??null}p(It,"handleUndefinedAttr");function Iu(e,t){const r=Math.round(e.x),i=Math.round(e.y),a=t.replace(/(\d+\.\d+)/g,n=>Math.round(parseFloat(n)).toString());return a.includes(r.toString())||a.includes(i.toString())}p(Iu,"isLabelCoordinateInPath");const tC=Object.freeze({left:0,top:0,width:16,height:16}),ya=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Pu=Object.freeze({...tC,...ya}),eC=Object.freeze({...Pu,body:"",hidden:!1}),rC=Object.freeze({width:null,height:null}),iC=Object.freeze({...rC,...ya}),aC=(e,t,r,i="")=>{const a=e.split(":");if(e.slice(0,1)==="@"){if(a.length<2||a.length>3)return null;i=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const o=a.pop(),l=a.pop(),c={provider:a.length>0?a[0]:i,prefix:l,name:o};return xn(c)?c:null}const n=a[0],s=n.split("-");if(s.length>1){const o={provider:i,prefix:s.shift(),name:s.join("-")};return xn(o)?o:null}if(r&&i===""){const o={provider:i,prefix:"",name:n};return xn(o,r)?o:null}return null},xn=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function nC(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function ml(e,t){const r=nC(e,t);for(const i in eC)i in ya?i in e&&!(i in r)&&(r[i]=ya[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function sC(e,t){const r=e.icons,i=e.aliases||Object.create(null),a=Object.create(null);function n(s){if(r[s])return a[s]=[];if(!(s in a)){a[s]=null;const o=i[s]&&i[s].parent,l=o&&n(o);l&&(a[s]=[o].concat(l))}return a[s]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(n),a}function yl(e,t,r){const i=e.icons,a=e.aliases||Object.create(null);let n={};function s(o){n=ml(i[o]||a[o],n)}return s(t),r.forEach(s),ml(e,n)}function oC(e,t){if(e.icons[t])return yl(e,t,[]);const r=sC(e,[t])[t];return r?yl(e,t,r):null}const lC=/(-?[0-9.]*[0-9]+[0-9.]*)/g,cC=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xl(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(lC);if(i===null||!i.length)return e;const a=[];let n=i.shift(),s=cC.test(n);for(;;){if(s){const o=parseFloat(n);isNaN(o)?a.push(n):a.push(Math.ceil(o*t*r)/r)}else a.push(n);if(n=i.shift(),n===void 0)return a.join("");s=!s}}function hC(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const a=e.indexOf(">",i),n=e.indexOf("",n);if(s===-1)break;r+=e.slice(a+1,n).trim(),e=e.slice(0,i).trim()+e.slice(s+1)}return{defs:r,content:e}}function uC(e,t){return e?""+e+""+t:t}function dC(e,t,r){const i=hC(e);return uC(i.defs,t+i.content+r)}const fC=e=>e==="unset"||e==="undefined"||e==="none";function pC(e,t){const r={...Pu,...e},i={...iC,...t},a={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,b=m.vFlip;let k=m.rotate;x?b?k+=2:(y.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),y.push("scale(-1 1)"),a.top=a.left=0):b&&(y.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),y.push("scale(1 -1)"),a.top=a.left=0);let v;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:v=a.height/2+a.top,y.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:y.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:v=a.width/2+a.left,y.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}k%2===1&&(a.left!==a.top&&(v=a.left,a.left=a.top,a.top=v),a.width!==a.height&&(v=a.width,a.width=a.height,a.height=v)),y.length&&(n=dC(n,'',""))});const s=i.width,o=i.height,l=a.width,c=a.height;let h,u;s===null?(u=o===null?"1em":o==="auto"?c:o,h=xl(u,l/c)):(h=s==="auto"?l:s,u=o===null?xl(h,c/l):o==="auto"?c:o);const d={},f=(m,y)=>{fC(y)||(d[m]=y.toString())};f("width",h),f("height",u);const g=[a.left,a.top,l,c];return d.viewBox=g.join(" "),{attributes:d,viewBox:g,body:n}}const gC=/\sid="(\S+)"/g,bl=new Map;function mC(e){e=e.replace(/[0-9]+$/,"")||"a";const t=bl.get(e)||0;return bl.set(e,t+1),t?`${e}${t}`:e}function yC(e){const t=[];let r;for(;r=gC.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(a=>{const n=mC(a),s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+n+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function xC(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}function Vs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ur=Vs();function Nu(e){ur=e}var oi={exec:()=>null};function ut(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(a,n)=>{let s=typeof n=="string"?n:n.source;return s=s.replace(Ht.caret,"$1"),r=r.replace(a,s),i},getRegex:()=>new RegExp(r,t)};return i}var bC=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},CC=/^(?:[ \t]*(?:\n|$))+/,kC=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wC=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vC=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xs=/(?:[*+-]|\d{1,9}[.)])/,zu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wu=ut(zu).replace(/bull/g,Xs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SC=ut(zu).replace(/bull/g,Xs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,TC=/^[^\n]+/,Ks=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_C=ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ks).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),BC=ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xs).getRegex(),qa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Qs=/|$))/,LC=ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Qs).replace("tag",qa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qu=ut(Zs).replace("hr",vi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qa).getRegex(),AC=ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qu).getRegex(),Js={blockquote:AC,code:kC,def:_C,fences:wC,heading:vC,hr:vi,html:LC,lheading:Wu,list:BC,newline:CC,paragraph:qu,table:oi,text:TC},Cl=ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qa).getRegex(),MC={...Js,lheading:SC,table:Cl,paragraph:ut(Zs).replace("hr",vi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qa).getRegex()},EC={...Js,html:ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:oi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ut(Zs).replace("hr",vi).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Wu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$C=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,FC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Hu=/^( {2,}|\\)\n(?!\s*$)/,DC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bC?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Uu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,NC=ut(Uu,"u").replace(/punct/g,Ha).getRegex(),zC=ut(Uu,"u").replace(/punct/g,Yu).getRegex(),Gu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",WC=ut(Gu,"gu").replace(/notPunctSpace/g,ju).replace(/punctSpace/g,to).replace(/punct/g,Ha).getRegex(),qC=ut(Gu,"gu").replace(/notPunctSpace/g,IC).replace(/punctSpace/g,RC).replace(/punct/g,Yu).getRegex(),HC=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ju).replace(/punctSpace/g,to).replace(/punct/g,Ha).getRegex(),jC=ut(/\\(punct)/,"gu").replace(/punct/g,Ha).getRegex(),YC=ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),UC=ut(Qs).replace("(?:-->|$)","-->").getRegex(),GC=ut("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",UC).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,VC=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",xa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vu=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",xa).replace("ref",Ks).getRegex(),Xu=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ks).getRegex(),XC=ut("reflink|nolink(?!\\()","g").replace("reflink",Vu).replace("nolink",Xu).getRegex(),kl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,eo={_backpedal:oi,anyPunctuation:jC,autolink:YC,blockSkip:PC,br:Hu,code:FC,del:oi,emStrongLDelim:NC,emStrongRDelimAst:WC,emStrongRDelimUnd:HC,escape:$C,link:VC,nolink:Xu,punctuation:OC,reflink:Vu,reflinkSearch:XC,tag:GC,text:DC,url:oi},ZC={...eo,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",xa).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xa).getRegex()},es={...eo,emStrongRDelimAst:qC,emStrongLDelim:zC,url:ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},wl=e=>QC[e];function ge(e,t){if(t){if(Ht.escapeTest.test(e))return e.replace(Ht.escapeReplace,wl)}else if(Ht.escapeTestNoEncode.test(e))return e.replace(Ht.escapeReplaceNoEncode,wl);return e}function vl(e){try{e=encodeURI(e).replace(Ht.percentDecode,"%")}catch{return null}return e}function Sl(e,t){let r=e.replace(Ht.findPipe,(n,s,o)=>{let l=!1,c=s;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(Ht.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Tl(e,t,r,i,a){let n=t.href,s=t.title||null,o=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:n,title:s,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}function t2(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(` -`).map(n=>{let s=n.match(r.other.beginningSpace);if(s===null)return n;let[o]=s;return o.length>=a.length?n.slice(a.length):n}).join(` -`)}var ba=class{options;rules;lexer;constructor(t){this.options=t||ur}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Ur(i,` -`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],a=t2(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:a}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let a=Ur(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Ur(r[0],` -`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Ur(r[0],` -`).split(` -`),a="",n="",s=[];for(;i.length>0;){let o=!1,l=[],c;for(c=0;c1,n={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let s=this.rules.other.listItemRegex(i),o=!1;for(;t;){let c=!1,h="",u="";if(!(r=s.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let d=r[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),f=t.split(` -`,1)[0],g=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=d.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(f)&&(h+=f+` -`,t=t.substring(f.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),v=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),L=this.rules.other.htmlBeginRegex(m);for(;t;){let T=t.split(` -`,1)[0],D;if(f=T,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),D=f):D=f.replace(this.rules.other.tabCharGlobal," "),v.test(f)||w.test(f)||L.test(f)||b.test(f)||k.test(f))break;if(D.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=` -`+D.slice(m);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(d)||w.test(d)||k.test(d))break;u+=` -`+f}!g&&!f.trim()&&(g=!0),h+=T+` -`,t=t.substring(T.length+1),d=D.slice(m)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(x=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:u,tokens:[]}),n.raw+=h}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;cd.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}if(n.loose)for(let c=0;c({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=Ur(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=JC(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let a=r[2],n="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),Tl(r,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=r[a.toLowerCase()];if(!n){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Tl(i,n,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!i||this.rules.inline.punctuation.exec(i))){let n=[...a[0]].length-1,s,o,l=n,c=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+n);(a=h.exec(r))!=null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(o=[...s].length,a[3]||a[4]){l+=o;continue}else if((a[5]||a[6])&&n%3&&!((n+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let u=[...a[0]][0].length,d=t.slice(0,n+a.index+u+o);if(Math.min(n,o)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(i),n=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&n&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,a;return r[2]==="@"?(i=r[1],a="mailto:"+i):(i=r[1],a=i),{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let n;do n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(n!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},ne=class rs{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ur,this.options.tokenizer=this.options.tokenizer||new ba,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ht,block:Ri.normal,inline:Yr.normal};this.options.pedantic?(r.block=Ri.pedantic,r.inline=Yr.pedantic):this.options.gfm&&(r.block=Ri.gfm,this.options.breaks?r.inline=Yr.breaks:r.inline=Yr.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ri,inline:Yr}}static lex(t,r){return new rs(r).lex(t)}static lexInline(t,r){return new rs(r).inlineTokens(t)}lex(t){t=t.replace(Ht.carriageReturn,` -`),this.blockTokens(t,this.tokens);for(let r=0;r(a=s.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let s=r.at(-1);a.raw.length===1&&s!==void 0?s.raw+=` -`:r.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` -`)?"":` -`)+a.raw,s.text+=` -`+a.text,this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` -`)?"":` -`)+a.raw,s.text+=` -`+a.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),r.push(a);continue}let n=t;if(this.options.extensions?.startBlock){let s=1/0,o=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},o),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(n=t.substring(0,s+1))}if(this.state.top&&(a=this.tokenizer.paragraph(n))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` -`)?"":` -`)+a.raw,s.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a),i=n.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` -`)?"":` -`)+a.raw,s.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,a=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)n=a[2]?a[2].length:0,i=i.slice(0,a.index+n)+"["+"a".repeat(a[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,o="";for(;t;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,o)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Ca=class{options;parser;constructor(t){this.options=t||ur}space(t){return""}code({text:t,lang:r,escaped:i}){let a=(r||"").match(Ht.notSpaceStart)?.[0],n=t.replace(Ht.endingNewline,"")+` -`;return a?'
                '+(i?n:ge(n,!0))+`
                -`:"
                "+(i?n:ge(n,!0))+`
                -`}blockquote({tokens:t}){return`
                -${this.parser.parse(t)}
                -`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} -`}hr(t){return`
                -`}list(t){let r=t.ordered,i=t.start,a="";for(let o=0;o -`+a+" -`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+ge(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
              • ${r}
              • -`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

                ${this.parser.parseInline(t)}

                -`}table(t){let r="",i="";for(let n=0;n${a}`),` - -`+r+` -`+a+`
                -`}tablerow({text:t}){return` -${t} -`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` -`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ge(t,!0)}`}br(t){return"
                "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let a=this.parser.parseInline(i),n=vl(t);if(n===null)return a;t=n;let s='
                ",s}image({href:t,title:r,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));let n=vl(t);if(n===null)return ge(i);t=n;let s=`${i}{let o=n[s].flat(1/0);i=i.concat(this.walkTokens(o,r))}):n.tokens&&(i=i.concat(this.walkTokens(n.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let s=r.renderers[n.name];s?r.renderers[n.name]=function(...o){let l=n.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&(n.level==="block"?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:n.level==="inline"&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),a.extensions=r),i.renderer){let n=this.defaults.renderer||new Ca(this.defaults);for(let s in i.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=i.renderer[o],c=n[o];n[o]=(...h)=>{let u=l.apply(n,h);return u===!1&&(u=c.apply(n,h)),u||""}}a.renderer=n}if(i.tokenizer){let n=this.defaults.tokenizer||new ba(this.defaults);for(let s in i.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=i.tokenizer[o],c=n[o];n[o]=(...h)=>{let u=l.apply(n,h);return u===!1&&(u=c.apply(n,h)),u}}a.tokenizer=n}if(i.hooks){let n=this.defaults.hooks||new Qr;for(let s in i.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=i.hooks[o],c=n[o];Qr.passThroughHooks.has(s)?n[o]=h=>{if(this.defaults.async&&Qr.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await l.call(n,h);return c.call(n,d)})();let u=l.call(n,h);return c.call(n,u)}:n[o]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(n,h);return d===!1&&(d=await c.apply(n,h)),d})();let u=l.apply(n,h);return u===!1&&(u=c.apply(n,h)),u}}a.hooks=n}if(i.walkTokens){let n=this.defaults.walkTokens,s=i.walkTokens;a.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),n&&(l=l.concat(n.call(this,o))),l}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ne.lex(t,r??this.defaults)}parser(t,r){return se.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let a={...i},n={...this.defaults,...a},s=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(r):r,l=await(n.hooks?await n.hooks.provideLexer():t?ne.lex:ne.lexInline)(o,n),c=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let h=await(n.hooks?await n.hooks.provideParser():t?se.parse:se.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(h):h})().catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));let o=(n.hooks?n.hooks.provideLexer():t?ne.lex:ne.lexInline)(r,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let l=(n.hooks?n.hooks.provideParser():t?se.parse:se.parseInline)(o,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(t,r){return i=>{if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,t){let a="

                An error occurred:

                "+ge(i.message+"",!0)+"
                ";return r?Promise.resolve(a):a}if(r)return Promise.reject(i);throw i}}},nr=new e2;function ft(e,t){return nr.parse(e,t)}ft.options=ft.setOptions=function(e){return nr.setOptions(e),ft.defaults=nr.defaults,Nu(ft.defaults),ft};ft.getDefaults=Vs;ft.defaults=ur;ft.use=function(...e){return nr.use(...e),ft.defaults=nr.defaults,Nu(ft.defaults),ft};ft.walkTokens=function(e,t){return nr.walkTokens(e,t)};ft.parseInline=nr.parseInline;ft.Parser=se;ft.parser=se.parse;ft.Renderer=Ca;ft.TextRenderer=ro;ft.Lexer=ne;ft.lexer=ne.lex;ft.Tokenizer=ba;ft.Hooks=Qr;ft.parse=ft;ft.options;ft.setOptions;ft.use;ft.walkTokens;ft.parseInline;se.parse;ne.lex;function Zu(e){for(var t=[],r=1;r?',height:80,width:80},as=new Map,Ku=new Map,i2=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(F.debug("Registering icon pack:",t.name),"loader"in t)Ku.set(t.name,t.loader);else if("icons"in t)as.set(t.name,t.icons);else throw F.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Qu=p(async(e,t)=>{const r=aC(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let a=as.get(i);if(!a){const s=Ku.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{a={...await s(),prefix:i},as.set(i,a)}catch(o){throw F.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const n=oC(a,r.name);if(!n)throw new Error(`Icon not found: ${e}`);return n},"getRegisteredIconData"),a2=p(async e=>{try{return await Qu(e),!0}catch{return!1}},"isIconAvailable"),Si=p(async(e,t,r)=>{let i;try{i=await Qu(e,t?.fallbackPrefix)}catch(s){F.error(s),i=r2}const a=pC(i,t),n=xC(yC(a.body),{...a.attributes,...r});return Jt(n,Ot())},"getIconSVG");function Ju(e,{markdownAutoWrap:t}){const i=e.replace(//g,` -`).replace(/\n{2,}/g,` -`),a=Zu(i);return t===!1?a.replace(/ /g," "):a}p(Ju,"preprocessMarkdown");function td(e,t={}){const r=Ju(e,t),i=ft.lexer(r),a=[[]];let n=0;function s(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,u)=>{u!==0&&(n++,a.push([])),h.split(" ").forEach(d=>{d=d.replace(/'/g,"'"),d&&a[n].push({content:d,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(c=>{s(c,o.type)}):o.type==="html"&&a[n].push({content:o.text,type:"normal"})}return p(s,"processNode"),i.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(l=>{s(l)}):o.type==="html"?a[n].push({content:o.text,type:"normal"}):a[n].push({content:o.raw,type:"normal"})}),a}p(td,"markdownToLines");function ed(e,{markdownAutoWrap:t}={}){const r=ft.lexer(e);function i(a){return a.type==="text"?t===!1?a.text.replace(/\n */g,"
                ").replace(/ /g," "):a.text.replace(/\n */g,"
                "):a.type==="strong"?`${a.tokens?.map(i).join("")}`:a.type==="em"?`${a.tokens?.map(i).join("")}`:a.type==="paragraph"?`

                ${a.tokens?.map(i).join("")}

                `:a.type==="space"?"":a.type==="html"?`${a.text}`:a.type==="escape"?a.text:(F.warn(`Unsupported markdown: ${a.type}`),a.raw)}return p(i,"output"),r.map(i).join("")}p(ed,"markdownToHTML");function rd(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(rd,"splitTextToChars");function id(e,t){const r=rd(t.content);return io(e,[],r,t.type)}p(id,"splitWordToFitWidth");function io(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[a,...n]=r,s=[...t,a];return e([{content:s.join(""),type:i}])?io(e,s,n,i):(t.length===0&&a&&(t.push(a),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(io,"splitWordToFitWidthRecursion");function ad(e,t){if(e.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return ka(e,t)}p(ad,"splitLineToFitWidth");function ka(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let a="";e[0].content===" "&&(a=" ",e.shift());const n=e.shift()??{content:" ",type:"normal"},s=[...i];if(a!==""&&s.push({content:a,type:"normal"}),s.push(n),t(s))return ka(e,t,r,s);if(i.length>0)r.push(i),e.unshift(n);else if(n.content){const[o,l]=id(t,n);r.push([o]),l.content&&e.unshift(l)}return ka(e,t,r)}p(ka,"splitLineToFitWidthRecursion");function ns(e,t){t&&e.attr("style",t)}p(ns,"applyStyle");async function nd(e,t,r,i,a=!1,n=Ot()){const s=e.append("foreignObject");s.attr("width",`${10*r}px`),s.attr("height",`${10*r}px`);const o=s.append("xhtml:div"),l=Tr(t.label)?await ws(t.label.replace(Mr.lineBreakRegex,` -`),n):Jt(t.label,n),c=t.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),ns(h,t.labelStyle),h.attr("class",`${c} ${i}`),ns(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&o.attr("class","labelBkg");let u=o.node().getBoundingClientRect();return u.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),u=o.node().getBoundingClientRect()),s.node()}p(nd,"addHtmlSpan");function ja(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}p(ja,"createTspan");function sd(e,t,r){const i=e.append("text"),a=ja(i,1,t);Ya(a,r);const n=a.node().getComputedTextLength();return i.remove(),n}p(sd,"computeWidthOfText");function n2(e,t,r){const i=e.append("text"),a=ja(i,1,t);Ya(a,[{content:r,type:"normal"}]);const n=a.node()?.getBoundingClientRect();return n&&i.remove(),n}p(n2,"computeDimensionOfText");function od(e,t,r,i=!1){const n=t.append("g"),s=n.insert("rect").attr("class","background").attr("style","stroke: none"),o=n.append("text").attr("y","-10.1");let l=0;for(const c of r){const h=p(d=>sd(n,1.1,d)<=e,"checkWidth"),u=h(c)?[c]:ad(c,h);for(const d of u){const f=ja(o,l,1.1);Ya(f,d),l++}}if(i){const c=o.node().getBBox(),h=2;return s.attr("x",c.x-h).attr("y",c.y-h).attr("width",c.width+2*h).attr("height",c.height+2*h),n.node()}else return o.node()}p(od,"createFormattedText");function Ya(e,t){e.text(""),t.forEach((r,i)=>{const a=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?a.text(r.content):a.text(" "+r.content)})}p(Ya,"updateTextContentAndStyles");async function ld(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(a,n,s)=>(r.push((async()=>{const o=`${n}:${s}`;return await a2(o)?await Si(o,void 0,{class:"label-icon"}):``})()),a));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(ld,"replaceIconSubstring");var He=p(async(e,t="",{style:r="",isTitle:i=!1,classes:a="",useHtmlLabels:n=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(F.debug("XYZ createText",t,r,i,a,n,s,"addSvgBackground: ",l),n){const h=ed(t,c),u=await ld(hr(h),c),d=t.replace(/\\\\/g,"\\"),f={isNode:s,label:Tr(t)?d:u,labelStyle:r.replace("fill:","color:")};return await nd(e,f,o,a,l,c)}else{const h=t.replace(//g,"
                "),u=td(h.replace("
                ","
                "),c),d=od(o,e,u,t?l:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(d).attr("style",f)}else{const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ht(d).select("rect").attr("style",f.replace(/background:/g,"fill:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(d).select("text").attr("style",g)}return d}},"createText");function bn(e,t,r){if(e&&e.length){const[i,a]=t,n=Math.PI/180*r,s=Math.cos(n),o=Math.sin(n);for(const l of e){const[c,h]=l;l[0]=(c-i)*s-(h-a)*o+i,l[1]=(c-i)*o+(h-a)*s+a}}}function s2(e,t){return e[0]===t[0]&&e[1]===t[1]}function o2(e,t,r,i=1){const a=r,n=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(a)for(const c of s)bn(c,o,a);const l=(function(c,h,u){const d=[];for(const b of c){const k=[...b];s2(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&d.push(k)}const f=[];h=Math.max(h,.1);const g=[];for(const b of d)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return f;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(u!==1||x%h==0)&&m.length>1)for(let b=0;b=m.length)break;const v=m[b].edge,w=m[k].edge;f.push([[Math.round(v.x),y],[Math.round(w.x),y]])}y+=u,m.forEach((b=>{b.edge.x=b.edge.x+u*b.edge.islope})),x++}return f})(s,n,i);if(a){for(const c of s)bn(c,o,-a);(function(c,h,u){const d=[];c.forEach((f=>d.push(...f))),bn(d,h,u)})(l,o,-a)}return l}function Ti(e,t){var r;const i=t.hachureAngle+90;let a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.round(Math.max(a,.1));let n=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(n=a),o2(e,a,i,n||1)}class ao{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ti(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const a of t)i.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],r));return i}}function Ua(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class l2 extends ao{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const a=Ti(t,Object.assign({},r,{hachureGap:i})),n=Math.PI/180*r.hachureAngle,s=[],o=.5*i*Math.cos(n),l=.5*i*Math.sin(n);for(const[c,h]of a)Ua([c,h])&&s.push([[c[0]-o,c[1]+l],[...h]],[[c[0]+o,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class c2 extends ao{fillPolygons(t,r){const i=this._fillPolygons(t,r),a=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),n=this._fillPolygons(t,a);return i.ops=i.ops.concat(n.ops),i}}class h2{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ti(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let a=r.hachureGap;a<0&&(a=4*r.strokeWidth),a=Math.max(a,.1);let n=r.fillWeight;n<0&&(n=r.strokeWidth/2);const s=a/4;for(const o of t){const l=Ua(o),c=l/a,h=Math.ceil(c)-1,u=l-h*a,d=(o[0][0]+o[1][0])/2-a/4,f=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Ua(s),l=Math.floor(o/(i+a)),c=(o+a-l*(i+a))/2;let h=s[0],u=s[1];h[0]>u[0]&&(h=s[1],u=s[0]);const d=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let f=0;f{const s=Ua(n),o=Math.round(s/(2*r));let l=n[0],c=n[1];l[0]>c[0]&&(l=n[1],c=n[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let u=0;uh%2?c+r:c+t));n.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":n.push({key:"Q",data:[...o]}),t=o[2],r=o[3];break;case"q":{const l=o.map(((c,h)=>h%2?c+r:c+t));n.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":n.push({key:"A",data:[...o]}),t=o[5],r=o[6];break;case"a":t+=o[5],r+=o[6],n.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,r]});break;case"H":n.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],n.push({key:"H",data:[t]});break;case"V":n.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],n.push({key:"V",data:[r]});break;case"S":n.push({key:"S",data:[...o]}),t=o[2],r=o[3];break;case"s":{const l=o.map(((c,h)=>h%2?c+r:c+t));n.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":n.push({key:"T",data:[...o]}),t=o[0],r=o[1];break;case"t":t+=o[0],r+=o[1],n.push({key:"T",data:[t,r]});break;case"Z":case"z":n.push({key:"Z",data:[]}),t=i,r=a}return n}function hd(e){const t=[];let r="",i=0,a=0,n=0,s=0,o=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,a]=h,[n,s]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],a=h[5],o=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,a]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,a]});break;case"V":a=h[0],t.push({key:"L",data:[i,a]});break;case"S":{let u=0,d=0;r==="C"||r==="S"?(u=i+(i-o),d=a+(a-l)):(u=i,d=a),t.push({key:"C",data:[u,d,...h]}),o=h[0],l=h[1],i=h[2],a=h[3];break}case"T":{const[u,d]=h;let f=0,g=0;r==="Q"||r==="T"?(f=i+(i-o),g=a+(a-l)):(f=i,g=a);const m=i+2*(f-i)/3,y=a+2*(g-a)/3,x=u+2*(f-u)/3,b=d+2*(g-d)/3;t.push({key:"C",data:[m,y,x,b,u,d]}),o=f,l=g,i=u,a=d;break}case"Q":{const[u,d,f,g]=h,m=i+2*(u-i)/3,y=a+2*(d-a)/3,x=f+2*(u-f)/3,b=g+2*(d-g)/3;t.push({key:"C",data:[m,y,x,b,f,g]}),o=u,l=d,i=f,a=g;break}case"A":{const u=Math.abs(h[0]),d=Math.abs(h[1]),f=h[2],g=h[3],m=h[4],y=h[5],x=h[6];u===0||d===0?(t.push({key:"C",data:[i,a,y,x,y,x]}),i=y,a=x):(i!==y||a!==x)&&(ud(i,a,y,x,u,d,f,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,a=x);break}case"Z":t.push({key:"Z",data:[]}),i=n,a=s}r=c}return t}function Gr(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function ud(e,t,r,i,a,n,s,o,l,c){const h=(u=s,Math.PI*u/180);var u;let d=[],f=0,g=0,m=0,y=0;if(c)[f,g,m,y]=c;else{[e,t]=Gr(e,t,-h),[r,i]=Gr(r,i,-h);const R=(e-r)/2,B=(t-i)/2;let A=R*R/(a*a)+B*B/(n*n);A>1&&(A=Math.sqrt(A),a*=A,n*=A);const _=a*a,$=n*n,M=_*$-_*B*B-$*R*R,q=_*B*B+$*R*R,V=(o===l?-1:1)*Math.sqrt(Math.abs(M/q));m=V*a*B/n+(e+r)/2,y=V*-n*R/a+(t+i)/2,f=Math.asin(parseFloat(((t-y)/n).toFixed(9))),g=Math.asin(parseFloat(((i-y)/n).toFixed(9))),eg&&(f-=2*Math.PI),!l&&g>f&&(g-=2*Math.PI)}let x=g-f;if(Math.abs(x)>120*Math.PI/180){const R=g,B=r,A=i;g=l&&g>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,d=ud(r=m+a*Math.cos(g),i=y+n*Math.sin(g),B,A,a,n,s,0,l,[g,R,m,y])}x=g-f;const b=Math.cos(f),k=Math.sin(f),v=Math.cos(g),w=Math.sin(g),L=Math.tan(x/4),T=4/3*a*L,D=4/3*n*L,I=[e,t],O=[e+T*k,t-D*b],E=[r+T*w,i-D*v],N=[r,i];if(O[0]=2*I[0]-O[0],O[1]=2*I[1]-O[1],c)return[O,E,N].concat(d);{d=[O,E,N].concat(d);const R=[];for(let B=0;B2){const a=[];for(let n=0;n2*Math.PI&&(f=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-f)/2),x=$l(y,c,h,u,d,f,g,1,l);if(!l.disableMultiStroke){const b=$l(y,c,h,u,d,f,g,1.5,l);x.push(...b)}return s&&(o?x.push(...ze(c,h,c+u*Math.cos(f),h+d*Math.sin(f),l),...ze(c,h,c+u*Math.cos(g),h+d*Math.sin(g),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(f),h+d*Math.sin(f)]})),{type:"path",ops:x}}function Al(e,t){const r=hd(cd(no(e))),i=[];let a=[0,0],n=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":n=[o[0],o[1]],a=[o[0],o[1]];break;case"L":i.push(...ze(n[0],n[1],o[0],o[1],t)),n=[o[0],o[1]];break;case"C":{const[l,c,h,u,d,f]=o;i.push(...y2(l,c,h,u,d,f,n,t)),n=[d,f];break}case"Z":i.push(...ze(n[0],n[1],a[0],a[1],t)),n=[a[0],a[1]]}return{type:"path",ops:i}}function wn(e,t){const r=[];for(const i of e)if(i.length){const a=t.maxRandomnessOffset||0,n=i.length;if(n>2){r.push({op:"move",data:[i[0][0]+at(a,t),i[0][1]+at(a,t)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=a.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const u=h/2,d=.2+.2*pd(a);let f=a.bowing*a.maxRandomnessOffset*(i-t)/200,g=a.bowing*a.maxRandomnessOffset*(e-r)/200;f=at(f,a,c),g=at(g,a,c);const m=[],y=()=>at(u,a,c),x=()=>at(h,a,c),b=a.preserveVertices;return s?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:at(h,a,c)),t+(b?0:at(h,a,c))]}),s?m.push({op:"bcurveTo",data:[f+e+(r-e)*d+y(),g+t+(i-t)*d+y(),f+e+2*(r-e)*d+y(),g+t+2*(i-t)*d+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[f+e+(r-e)*d+x(),g+t+(i-t)*d+x(),f+e+2*(r-e)*d+x(),g+t+2*(i-t)*d+x(),r+(b?0:x()),i+(b?0:x())]}),m}function Pi(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]),i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]);for(let a=1;a3){const n=[],s=1-r.curveTightness;a.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+21&&a.push(o)):a.push(o),a.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],u=e[t+3],d=Xe(l,c,.5),f=Xe(c,h,.5),g=Xe(h,u,.5),m=Xe(d,f,.5),y=Xe(f,g,.5),x=Xe(m,y,.5);ls([l,d,m,x],0,r,a),ls([x,y,g,u],0,r,a)}var n,s;return a}function b2(e,t){return Sa(e,0,e.length,t)}function Sa(e,t,r,i,a){const n=a||[],s=e[t],o=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=u,c=h)}return Math.sqrt(l)>i?(Sa(e,t,c+1,i,n),Sa(e,c,r,i,n)):(n.length||n.push(s),n.push(o)),n}function vn(e,t=.15,r){const i=[],a=(e.length-1)/3;for(let n=0;n0?Sa(i,0,i.length,r):i}const Zt="none";class Ta{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,a,n){const s=this._o(n);return this._d("line",[dd(t,r,i,a,s)],s)}rectangle(t,r,i,a,n){const s=this._o(n),o=[],l=m2(t,r,i,a,s);if(s.fill){const c=[[t,r],[t+i,r],[t+i,r+a],[t,r+a]];s.fillStyle==="solid"?o.push(wn([c],s)):o.push(yr([c],s))}return s.stroke!==Zt&&o.push(l),this._d("rectangle",o,s)}ellipse(t,r,i,a,n){const s=this._o(n),o=[],l=fd(i,a,s),c=ss(t,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=ss(t,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(yr([c.estimatedPoints],s));return s.stroke!==Zt&&o.push(c.opset),this._d("ellipse",o,s)}circle(t,r,i,a){const n=this.ellipse(t,r,i,i,a);return n.shape="circle",n}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Ki(t,!1,i)],i)}arc(t,r,i,a,n,s,o=!1,l){const c=this._o(l),h=[],u=Ll(t,r,i,a,n,s,o,!0,c);if(o&&c.fill)if(c.fillStyle==="solid"){const d=Object.assign({},c);d.disableMultiStroke=!0;const f=Ll(t,r,i,a,n,s,!0,!1,d);f.type="fillPath",h.push(f)}else h.push((function(d,f,g,m,y,x,b){const k=d,v=f;let w=Math.abs(g/2),L=Math.abs(m/2);w+=at(.01*w,b),L+=at(.01*L,b);let T=y,D=x;for(;T<0;)T+=2*Math.PI,D+=2*Math.PI;D-T>2*Math.PI&&(T=0,D=2*Math.PI);const I=(D-T)/b.curveStepCount,O=[];for(let E=T;E<=D;E+=I)O.push([k+w*Math.cos(E),v+L*Math.sin(E)]);return O.push([k+w*Math.cos(D),v+L*Math.sin(D)]),O.push([k,v]),yr([O],b)})(t,r,i,a,n,s,c));return c.stroke!==Zt&&h.push(u),this._d("arc",h,c)}curve(t,r){const i=this._o(r),a=[],n=Bl(t,i);if(i.fill&&i.fill!==Zt)if(i.fillStyle==="solid"){const s=Bl(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=t;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const c of l)c.length<3?s.push(...c):c.length===3?s.push(...vn(Fl([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):s.push(...vn(Fl(c),10,(1+i.roughness)/2))}s.length&&a.push(yr([s],i))}return i.stroke!==Zt&&a.push(n),this._d("curve",a,i)}polygon(t,r){const i=this._o(r),a=[],n=Ki(t,!0,i);return i.fill&&(i.fillStyle==="solid"?a.push(wn([t],i)):a.push(yr([t],i))),i.stroke!==Zt&&a.push(n),this._d("polygon",a,i)}path(t,r){const i=this._o(r),a=[];if(!t)return this._d("path",a,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const n=i.fill&&i.fill!=="transparent"&&i.fill!==Zt,s=i.stroke!==Zt,o=!!(i.simplification&&i.simplification<1),l=(function(h,u,d){const f=hd(cd(no(h))),g=[];let m=[],y=[0,0],x=[];const b=()=>{x.length>=4&&m.push(...vn(x,u)),x=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:w,data:L}of f)switch(w){case"M":k(),y=[L[0],L[1]],m.push(y);break;case"L":b(),m.push([L[0],L[1]]);break;case"C":if(!x.length){const T=m.length?m[m.length-1]:y;x.push([T[0],T[1]])}x.push([L[0],L[1]]),x.push([L[2],L[3]]),x.push([L[4],L[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!d)return g;const v=[];for(const w of g){const L=b2(w,d);L.length&&v.push(L)}return v})(t,1,o?4-4*(i.simplification||1):(1+i.roughness)/2),c=Al(t,i);if(n)if(i.fillStyle==="solid")if(l.length===1){const h=Al(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else a.push(wn(l,i));else a.push(yr(l,i));return s&&(o?l.forEach((h=>{a.push(Ki(h,!1,i))})):a.push(c)),this._d("path",a,i)}opsToPath(t,r){let i="";for(const a of t.ops){const n=typeof r=="number"&&r>=0?a.data.map((s=>+s.toFixed(r))):a.data;switch(a.op){case"move":i+=`M${n[0]} ${n[1]} `;break;case"bcurveTo":i+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case"lineTo":i+=`L${n[0]} ${n[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,a=[];for(const n of r){let s=null;switch(n.type){case"path":s={d:this.opsToPath(n),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Zt};break;case"fillPath":s={d:this.opsToPath(n),stroke:Zt,strokeWidth:0,fill:i.fill||Zt};break;case"fillSketch":s=this.fillSketch(n,i)}s&&a.push(s)}return a}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Zt,strokeWidth:i,fill:Zt}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class C2{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ta(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.ctx,n=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":a.save(),a.strokeStyle=i.stroke==="none"?"transparent":i.stroke,a.lineWidth=i.strokeWidth,i.strokeLineDash&&a.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(a.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(a,s,n),a.restore();break;case"fillPath":{a.save(),a.fillStyle=i.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,s,n,o),a.restore();break}case"fillSketch":this.fillSketch(a,s,i)}}fillSketch(t,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=a,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,a="nonzero"){t.beginPath();for(const n of r.ops){const s=typeof i=="number"&&i>=0?n.data.map((o=>+o.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(a):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,a,n){const s=this.gen.line(t,r,i,a,n);return this.draw(s),s}rectangle(t,r,i,a,n){const s=this.gen.rectangle(t,r,i,a,n);return this.draw(s),s}ellipse(t,r,i,a,n){const s=this.gen.ellipse(t,r,i,a,n);return this.draw(s),s}circle(t,r,i,a){const n=this.gen.circle(t,r,i,a);return this.draw(n),n}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,a,n,s,o=!1,l){const c=this.gen.arc(t,r,i,a,n,s,o,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Ni="http://www.w3.org/2000/svg";class k2{constructor(t,r){this.svg=t,this.gen=new Ta(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,n=a.createElementNS(Ni,"g"),s=t.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=a.createElementNS(Ni,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=a.createElementNS(Ni,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(a,o,i)}l&&n.appendChild(l)}return n}fillSketch(t,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2);const n=t.createElementNS(Ni,"path");return n.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),n.setAttribute("stroke",i.fill||""),n.setAttribute("stroke-width",a+""),n.setAttribute("fill","none"),i.fillLineDash&&n.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&n.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),n}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,a,n){const s=this.gen.line(t,r,i,a,n);return this.draw(s)}rectangle(t,r,i,a,n){const s=this.gen.rectangle(t,r,i,a,n);return this.draw(s)}ellipse(t,r,i,a,n){const s=this.gen.ellipse(t,r,i,a,n);return this.draw(s)}circle(t,r,i,a){const n=this.gen.circle(t,r,i,a);return this.draw(n)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,a,n,s,o=!1,l){const c=this.gen.arc(t,r,i,a,n,s,o,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var j={canvas:(e,t)=>new C2(e,t),svg:(e,t)=>new k2(e,t),generator:e=>new Ta(e),newSeed:()=>Ta.newSeed()},it=p(async(e,t,r)=>{let i;const a=t.useHtmlLabels||Lt(dt()?.htmlLabels);r?i=r:i="node default";const n=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=n.insert("g").attr("class","label").attr("style",It(t.labelStyle));let o;t.label===void 0?o="":o=typeof t.label=="string"?t.label:t.label[0];const l=await He(s,Jt(hr(o),dt()),{useHtmlLabels:a,width:t.width||dt().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let c=l.getBBox();const h=(t?.padding??0)/2;if(a){const u=l.children[0],d=ht(l),f=u.getElementsByTagName("img");if(f){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=dt().fontSize?dt().fontSize:window.getComputedStyle(document.body).fontSize,k=5,[v=mc.fontSize]=Wa(b),w=v*k+"px";m.style.minWidth=w,m.style.maxWidth=w}else m.style.width="100%";y(m)}p(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=u.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return a?s.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):s.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&s.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:n,bbox:c,halfPadding:h,label:s}},"labelHelper"),Sn=p(async(e,t,r)=>{const i=r.useHtmlLabels||Lt(dt()?.flowchart?.htmlLabels),a=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),n=await He(a,Jt(hr(t),dt()),{useHtmlLabels:i,width:r.width||dt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=n.getBBox();const o=r.padding/2;if(Lt(dt()?.flowchart?.htmlLabels)){const l=n.children[0],c=ht(n);s=l.getBoundingClientRect(),c.attr("width",s.width),c.attr("height",s.height)}return i?a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):a.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:o,label:a}},"insertLabel"),G=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),rt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function lt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(lt,"createPathFromPoints");function We(e,t,r,i,a,n){const s=[],l=r-e,c=i-t,h=l/n,u=2*Math.PI/h,d=t+c/2;for(let f=0;f<=50;f++){const g=f/50,m=e+g*l,y=d+a*Math.sin(u*(m-e));s.push({x:m,y})}return s}p(We,"generateFullSineWavePoints");function gi(e,t,r,i,a,n){const s=[],o=a*Math.PI/180,h=(n*Math.PI/180-o)/(i-1);for(let u=0;u{var r=e.x,i=e.y,a=t.x-r,n=t.y-i,s=e.width/2,o=e.height/2,l,c;return Math.abs(n)*s>Math.abs(a)*o?(n<0&&(o=-o),l=n===0?0:o*a/n,c=o):(a<0&&(s=-s),l=s,c=a===0?0:s*n/a),{x:r+l,y:i+c}},"intersectRect"),Dr=w2;function gd(e,t){t&&e.attr("style",t)}p(gd,"applyStyle");async function md(e){const t=ht(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),i=dt();let a=e.label;e.label&&Tr(e.label)&&(a=await ws(e.label.replace(Mr.lineBreakRegex,` -`),i));const s='"+a+"";return r.html(Jt(s,i)),gd(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}p(md,"addHtmlLabel");var v2=p(async(e,t,r,i)=>{let a=e||"";if(typeof a=="object"&&(a=a[0]),Lt(dt().flowchart.htmlLabels)){a=a.replace(/\\n|\n/g,"
                "),F.info("vertexText"+a);const n={isNode:i,label:hr(a).replace(/fa[blrs]?:fa-[\w-]+/g,o=>``),labelStyle:t&&t.replace("fill:","color:")};return await md(n)}else{const n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("style",t.replace("color:","fill:"));let s=[];typeof a=="string"?s=a.split(/\\n|\n|/gi):Array.isArray(a)?s=a:s=[];for(const o of s){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=o.trim(),n.appendChild(l)}return n}},"createLabel"),tr=v2,je=p((e,t,r,i,a)=>["M",e+a,t,"H",e+r-a,"A",a,a,0,0,1,e+r,t+a,"V",t+i-a,"A",a,a,0,0,1,e+r-a,t+i,"H",e+a,"A",a,a,0,0,1,e,t+i-a,"V",t+a,"A",a,a,0,0,1,e+a,t,"Z"].join(" "),"createRoundedRectPathD"),yd=p(async(e,t)=>{F.info("Creating subgraph rect for ",t.id,t);const r=dt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:n,clusterBorder:s}=i,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=U(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=Lt(r.flowchart.htmlLabels),f=u.insert("g").attr("class","cluster-label "),g=await He(f,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0});let m=g.getBBox();if(Lt(r.flowchart.htmlLabels)){const T=g.children[0],D=ht(g);m=T.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,b=t.x-y/2,k=t.y-x/2;F.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const T=j.svg(u),D=Y(t,{roughness:.7,fill:n,stroke:s,fillWeight:3,seed:a}),I=T.path(je(b,k,y,x,0),D);v=u.insert(()=>(F.debug("Rough node insert CXC",I),I),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=u.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:w}=Is(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),o){const T=f.select("span");T&&T.attr("style",o)}const L=v.node().getBBox();return t.offsetX=0,t.width=L.width,t.height=L.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return Dr(t,T)},{cluster:u,labelBBox:m}},"rect"),S2=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),i=r.insert("rect",":first-child"),a=0*t.padding,n=a/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-n).attr("y",t.y-t.height/2-n).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");const s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(o){return Dr(t,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),T2=p(async(e,t)=>{const r=dt(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:n,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const f=u.node().appendChild(await tr(t.label,t.labelStyle,void 0,!0));let g=f.getBBox();if(Lt(r.flowchart.htmlLabels)){const I=f.children[0],O=ht(f);g=I.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,k=t.height+m-g.height-6,v=t.x-x/2,w=t.y-b/2;t.width=x;const L=t.y-t.height/2-y+g.height+2;let T;if(t.look==="handDrawn"){const I=t.cssClasses.includes("statediagram-cluster-alt"),O=j.svg(c),E=t.rx||t.ry?O.path(je(v,w,x,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:a}):O.rectangle(v,w,x,b,{seed:a});T=c.insert(()=>E,":first-child");const N=O.rectangle(v,L,x,k,{fill:I?n:s,fillStyle:I?"hachure":"solid",stroke:l,seed:a});T=c.insert(()=>E,":first-child"),d=c.insert(()=>N)}else T=h.insert("rect",":first-child"),T.attr("class","outer").attr("x",v).attr("y",w).attr("width",x).attr("height",b).attr("data-look",t.look),d.attr("class","inner").attr("x",v).attr("y",L).attr("width",x).attr("height",k);u.attr("transform",`translate(${t.x-g.width/2}, ${w+1-(Lt(r.flowchart.htmlLabels)?0:3)})`);const D=T.node().getBBox();return t.height=D.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(I){return Dr(t,I)},{cluster:c,labelBBox:g}},"roundedWithTitle"),_2=p(async(e,t)=>{F.info("Creating subgraph rect for ",t.id,t);const r=dt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:n,clusterBorder:s}=i,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=U(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=Lt(r.flowchart.htmlLabels),f=u.insert("g").attr("class","cluster-label "),g=await He(f,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width});let m=g.getBBox();if(Lt(r.flowchart.htmlLabels)){const T=g.children[0],D=ht(g);m=T.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,b=t.x-y/2,k=t.y-x/2;F.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const T=j.svg(u),D=Y(t,{roughness:.7,fill:n,stroke:s,fillWeight:4,seed:a}),I=T.path(je(b,k,y,x,t.rx),D);v=u.insert(()=>(F.debug("Rough node insert CXC",I),I),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=u.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:w}=Is(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),o){const T=f.select("span");T&&T.attr("style",o)}const L=v.node().getBBox();return t.offsetX=0,t.width=L.width,t.height=L.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return Dr(t,T)},{cluster:u,labelBBox:m}},"kanbanSection"),B2=p((e,t)=>{const r=dt(),{themeVariables:i,handDrawnSeed:a}=r,{nodeBorder:n}=i,s=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),o=s.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,u=t.x-c/2,d=t.y-h/2;t.width=c;let f;if(t.look==="handDrawn"){const y=j.svg(s).rectangle(u,d,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:a});f=s.insert(()=>y,":first-child")}else f=o.insert("rect",":first-child"),f.attr("class","divider").attr("x",u).attr("y",d).attr("width",c).attr("height",h).attr("data-look",t.look);const g=f.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Dr(t,m)},{cluster:s,labelBBox:{}}},"divider"),L2=yd,A2={rect:yd,squareRect:L2,roundedWithTitle:T2,noteGroup:S2,divider:B2,kanbanSection:_2},xd=new Map,M2=p(async(e,t)=>{const r=t.shape||"rect",i=await A2[r](e,t);return xd.set(t.id,i),i},"insertCluster"),KS=p(()=>{xd=new Map},"clear");function bd(e,t){return e.intersect(t)}p(bd,"intersectNode");var E2=bd;function Cd(e,t,r,i){var a=e.x,n=e.y,s=a-i.x,o=n-i.y,l=Math.sqrt(t*t*o*o+r*r*s*s),c=Math.abs(t*r*s/l);i.x0}p(cs,"sameSign");var F2=vd;function Sd(e,t,r){let i=e.x,a=e.y,n=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,t.x),o=Math.min(o,t.y));let l=i-e.width/2-s,c=a-e.height/2-o;for(let h=0;h1&&n.sort(function(h,u){let d=h.x-r.x,f=h.y-r.y,g=Math.sqrt(d*d+f*f),m=u.x-r.x,y=u.y-r.y,x=Math.sqrt(m*m+y*y);return gh,":first-child");return u.attr("class","anchor").attr("style",It(o)),G(t,u),t.intersect=function(d){return F.info("Circle intersect",t,s,d),W.circle(t,s,d)},n}p(Td,"anchor");function hs(e,t,r,i,a,n,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,d=(i-t)/2,f=u/a,g=d/n,m=Math.sqrt(f**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*n*Math.sin(h)*(s?-1:1),b=c-y*a*Math.cos(h)*(s?-1:1),k=Math.atan2((t-b)/n,(e-x)/a);let w=Math.atan2((i-b)/n,(r-x)/a)-k;s&&w<0&&(w+=2*Math.PI),!s&&w>0&&(w-=2*Math.PI);const L=[];for(let T=0;T<20;T++){const D=T/19,I=k+D*w,O=x+a*Math.cos(I),E=b+n*Math.sin(I);L.push({x:O,y:E})}return L}p(hs,"generateArcPoints");async function _d(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.width+t.padding+20,o=n.height+t.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=t,u=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...hs(-s/2,-o/2,-s/2,o/2,c,l,!1),{x:s/2,y:o/2},...hs(s/2,o/2,s/2,-o/2,c,l,!0)],d=j.svg(a),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=lt(u),m=d.path(g,f),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(${c/2}, 0)`),G(t,y),t.intersect=function(x){return W.polygon(t,u,x)},a}p(_d,"bowTieRect");function Ye(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Ye,"insertPolygonShape");async function Bd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.height+t.padding,o=12,l=n.width+t.padding+o,c=0,h=l,u=-s,d=0,f=[{x:c+o,y:u},{x:h,y:u},{x:h,y:d},{x:c,y:d},{x:c,y:u+o},{x:c+o,y:u}];let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=j.svg(a),x=Y(t,{}),b=lt(f),k=y.path(b,x);g=a.insert(()=>k,":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),m&&g.attr("style",m)}else g=Ye(a,l,s,f);return i&&g.attr("style",i),G(t,g),t.intersect=function(y){return W.polygon(t,f,y)},a}p(Bd,"card");function Ld(e,t){const{nodeStyles:r}=U(t);t.label="";const i=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,n=Math.max(28,t.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],o=j.svg(i),l=Y(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=lt(s),h=o.path(c,l),u=i.insert(()=>h,":first-child");return a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(d){return W.polygon(t,s,d)},i}p(Ld,"choice");async function so(e,t,r){const{labelStyles:i,nodeStyles:a}=U(t);t.labelStyle=i;const{shapeSvg:n,bbox:s,halfPadding:o}=await it(e,t,rt(t)),l=r?.padding??o,c=s.width/2+l;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const d=j.svg(n),f=Y(t,{}),g=d.circle(0,0,c*2,f);h=n.insert(()=>g,":first-child"),h.attr("class","basic label-container").attr("style",It(u))}else h=n.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",c).attr("cx",0).attr("cy",0);return G(t,h),t.calcIntersect=function(d,f){const g=d.width/2;return W.circle(d,g,f)},t.intersect=function(d){return F.info("Circle intersect",t,c,d),W.circle(t,c,d)},n}p(so,"circle");function Ad(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,a={x:i/2*t,y:i/2*r},n={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},o={x:i/2*t,y:-(i/2)*r};return`M ${n.x},${n.y} L ${o.x},${o.y} - M ${a.x},${a.y} L ${s.x},${s.y}`}p(Ad,"createLine");function Md(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r,t.label="";const a=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),n=Math.max(30,t?.width??0),{cssStyles:s}=t,o=j.svg(a),l=Y(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,n*2,l),h=Ad(n),u=o.path(h,l),d=a.insert(()=>c,":first-child");return d.insert(()=>u),s&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),G(t,d),t.intersect=function(f){return F.info("crossedCircle intersect",t,{radius:n,point:f}),W.circle(t,n,f)},a}p(Md,"crossedCircle");function Be(e,t,r,i=100,a=0,n=180){const s=[],o=a*Math.PI/180,h=(n*Math.PI/180-o)/(i-1);for(let u=0;uk,":first-child").attr("stroke-opacity",0),v.insert(()=>x,":first-child"),v.attr("class","text"),h&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${c}, 0)`),s.attr("transform",`translate(${-o/2+c-(n.x-(n.left??0))},${-l/2+(t.padding??0)/2-(n.y-(n.top??0))})`),G(t,v),t.intersect=function(w){return W.polygon(t,d,w)},a}p(Ed,"curlyBraceLeft");function Le(e,t,r,i=100,a=0,n=180){const s=[],o=a*Math.PI/180,h=(n*Math.PI/180-o)/(i-1);for(let u=0;uk,":first-child").attr("stroke-opacity",0),v.insert(()=>x,":first-child"),v.attr("class","text"),h&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-c}, 0)`),s.attr("transform",`translate(${-o/2+(t.padding??0)/2-(n.x-(n.left??0))},${-l/2+(t.padding??0)/2-(n.y-(n.top??0))})`),G(t,v),t.intersect=function(w){return W.polygon(t,d,w)},a}p($d,"curlyBraceRight");function Mt(e,t,r,i=100,a=0,n=180){const s=[],o=a*Math.PI/180,h=(n*Math.PI/180-o)/(i-1);for(let u=0;uT,":first-child").attr("stroke-opacity",0),D.insert(()=>b,":first-child"),D.insert(()=>w,":first-child"),D.attr("class","text"),h&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(${c-c/4}, 0)`),s.attr("transform",`translate(${-o/2+(t.padding??0)/2-(n.x-(n.left??0))},${-l/2+(t.padding??0)/2-(n.y-(n.top??0))})`),G(t,D),t.intersect=function(I){return W.polygon(t,f,I)},a}p(Fd,"curlyBraces");async function Dd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=80,o=20,l=Math.max(s,(n.width+(t.padding??0)*2)*1.25,t?.width??0),c=Math.max(o,n.height+(t.padding??0)*2,t?.height??0),h=c/2,{cssStyles:u}=t,d=j.svg(a),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=l,m=c,y=g-h,x=m/4,b=[{x:y,y:0},{x,y:0},{x:0,y:m/2},{x,y:m},{x:y,y:m},...gi(-y,-m/2,h,50,270,90)],k=lt(b),v=d.path(k,f),w=a.insert(()=>v,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),w.attr("transform",`translate(${-l/2}, ${-c/2})`),G(t,w),t.intersect=function(L){return W.polygon(t,b,L)},a}p(Dd,"curvedTrapezoid");var O2=p((e,t,r,i,a,n)=>[`M${e},${t+n}`,`a${a},${n} 0,0,0 ${r},0`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),R2=p((e,t,r,i,a,n)=>[`M${e},${t+n}`,`M${e+r},${t+n}`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),I2=p((e,t,r,i,a,n)=>[`M${e-r/2},${-i/2}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Od(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+t.padding,t.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(n.height+c+t.padding,t.height??0);let u;const{cssStyles:d}=t;if(t.look==="handDrawn"){const f=j.svg(a),g=R2(0,0,o,h,l,c),m=I2(0,c,o,h,l,c),y=f.path(g,Y(t,{})),x=f.path(m,Y(t,{fill:"none"}));u=a.insert(()=>x,":first-child"),u=a.insert(()=>y,":first-child"),u.attr("class","basic label-container"),d&&u.attr("style",d)}else{const f=O2(0,0,o,h,l,c);u=a.insert("path",":first-child").attr("d",f).attr("class","basic label-container").attr("style",It(d)).attr("style",i)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),G(t,u),s.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+(t.padding??0)/1.5-(n.y-(n.top??0))})`),t.intersect=function(f){const g=W.rect(t,f),m=g.x-(t.x??0);if(l!=0&&(Math.abs(m)<(t.width??0)/2||Math.abs(m)==(t.width??0)/2&&Math.abs(g.y-(t.y??0))>(t.height??0)/2-c)){let y=c*c*(1-m*m/(l*l));y>0&&(y=Math.sqrt(y)),y=c-y,f.y-(t.y??0)>0&&(y=-y),g.y+=y}return g},a}p(Od,"cylinder");async function Rd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=n.width+t.padding,l=n.height+t.padding,c=l*.2,h=-o/2,u=-l/2-c/2,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],y=f.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),s.attr("transform",`translate(${h+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+c+(t.padding??0)/2-(n.y-(n.top??0))})`),G(t,x),t.intersect=function(b){return W.rect(t,b)},a}p(Rd,"dividedRectangle");async function Id(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,halfPadding:s}=await it(e,t,rt(t)),l=n.width/2+s+5,c=n.width/2+s;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const d=j.svg(a),f=Y(t,{roughness:.2,strokeWidth:2.5}),g=Y(t,{roughness:.2,strokeWidth:1.5}),m=d.circle(0,0,l*2,f),y=d.circle(0,0,c*2,g);h=a.insert("g",":first-child"),h.attr("class",It(t.cssClasses)).attr("style",It(u)),h.node()?.appendChild(m),h.node()?.appendChild(y)}else{h=a.insert("g",":first-child");const d=h.insert("circle",":first-child"),f=h.insert("circle");h.attr("class","basic label-container").attr("style",i),d.attr("class","outer-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0),f.attr("class","inner-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0)}return G(t,h),t.intersect=function(d){return F.info("DoubleCircle intersect",t,l,d),W.circle(t,l,d)},a}p(Id,"doublecircle");function Pd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=U(t);t.label="",t.labelStyle=i;const n=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),s=7,{cssStyles:o}=t,l=j.svg(n),{nodeBorder:c}=r,h=Y(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const u=l.circle(0,0,s*2,h),d=n.insert(()=>u,":first-child");return d.selectAll("path").attr("style",`fill: ${c} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),G(t,d),t.intersect=function(f){return F.info("filledCircle intersect",t,{radius:s,point:f}),W.circle(t,s,f)},n}p(Pd,"filledCircle");async function Nd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=n.width+(t.padding??0),l=o+n.height,c=o+n.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=t,d=j.svg(a),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=lt(h),m=d.path(g,f),y=a.insert(()=>m,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),t.width=o,t.height=l,G(t,y),s.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-l/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(x){return F.info("Triangle intersect",t,h,x),W.polygon(t,h,x)},a}p(Nd,"flippedTriangle");function zd(e,t,{dir:r,config:{state:i,themeVariables:a}}){const{nodeStyles:n}=U(t);t.label="";const s=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,u=-1*c/2,d=j.svg(s),f=Y(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=d.rectangle(h,u,l,c,f),m=s.insert(()=>g,":first-child");o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),G(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return W.rect(t,x)},s}p(zd,"forkJoin");async function Wd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const a=80,n=50,{shapeSvg:s,bbox:o}=await it(e,t,rt(t)),l=Math.max(a,o.width+(t.padding??0)*2,t?.width??0),c=Math.max(n,o.height+(t.padding??0)*2,t?.height??0),h=c/2,{cssStyles:u}=t,d=j.svg(s),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=[{x:-l/2,y:-c/2},{x:l/2-h,y:-c/2},...gi(-l/2+h,0,h,50,90,270),{x:l/2-h,y:c/2},{x:-l/2,y:c/2}],m=lt(g),y=d.path(m,f),x=s.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),G(t,x),t.intersect=function(b){return F.info("Pill intersect",t,{radius:h,point:b}),W.polygon(t,g,b)},s}p(Wd,"halfRoundedRectangle");async function qd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.height+(t.padding??0),o=n.width+(t.padding??0)*2.5,{cssStyles:l}=t,c=j.svg(a),h=Y(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let u=o/2;const d=u/6;u=u+d;const f=s/2,g=f/2,m=u-g,y=[{x:-m,y:-f},{x:0,y:-f},{x:m,y:-f},{x:u,y:0},{x:m,y:f},{x:0,y:f},{x:-m,y:f},{x:-u,y:0}],x=lt(y),b=c.path(x,h),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container"),l&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",l),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=o,t.height=s,G(t,k),t.intersect=function(v){return W.polygon(t,y,v)},a}p(qd,"hexagon");async function Hd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.label="",t.labelStyle=r;const{shapeSvg:a}=await it(e,t,rt(t)),n=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:o}=t,l=j.svg(a),c=Y(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:n,y:0},{x:0,y:s},{x:n,y:s}],u=lt(h),d=l.path(u,c),f=a.insert(()=>d,":first-child");return f.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",o),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-n/2}, ${-s/2})`),G(t,f),t.intersect=function(g){return F.info("Pill intersect",t,{points:h}),W.polygon(t,h,g)},a}p(Hd,"hourglass");async function jd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=U(t);t.labelStyle=a;const n=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(n,s),l=i?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await it(e,t,"icon-shape default"),d=t.pos==="t",f=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=Er(t),x=-g/2,b=-f/2,k=t.label?8:0,v=j.svg(c),w=Y(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const L=v.rectangle(x,b,g,f,w),T=Math.max(g,h.width),D=f+h.height+k,I=v.rectangle(-T/2,-D/2,T,D,{...w,fill:"transparent",stroke:"none"}),O=c.insert(()=>L,":first-child"),E=c.insert(()=>I);if(t.icon){const N=c.append("g");N.html(`${await Si(t.icon,{height:o,width:o,fallbackPrefix:""})}`);const R=N.node().getBBox(),B=R.width,A=R.height,_=R.x,$=R.y;N.attr("transform",`translate(${-B/2-_},${d?h.height/2+k/2-A/2-$:-h.height/2-k/2-A/2-$})`),N.attr("style",`color: ${y.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-D/2:D/2-h.height})`),O.attr("transform",`translate(0,${d?h.height/2+k/2:-h.height/2-k/2})`),G(t,E),t.intersect=function(N){if(F.info("iconSquare intersect",t,N),!t.label)return W.rect(t,N);const R=t.x??0,B=t.y??0,A=t.height??0;let _=[];return d?_=[{x:R-h.width/2,y:B-A/2},{x:R+h.width/2,y:B-A/2},{x:R+h.width/2,y:B-A/2+h.height+k},{x:R+g/2,y:B-A/2+h.height+k},{x:R+g/2,y:B+A/2},{x:R-g/2,y:B+A/2},{x:R-g/2,y:B-A/2+h.height+k},{x:R-h.width/2,y:B-A/2+h.height+k}]:_=[{x:R-g/2,y:B-A/2},{x:R+g/2,y:B-A/2},{x:R+g/2,y:B-A/2+f},{x:R+h.width/2,y:B-A/2+f},{x:R+h.width/2/2,y:B+A/2},{x:R-h.width/2,y:B+A/2},{x:R-h.width/2,y:B-A/2+f},{x:R-g/2,y:B-A/2+f}],W.polygon(t,_,N)},c}p(jd,"icon");async function Yd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=U(t);t.labelStyle=a;const n=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(n,s),l=i?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await it(e,t,"icon-shape default"),d=20,f=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Er(t),b=j.svg(c),k=Y(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=x.get("fill");k.stroke=v??y;const w=c.append("g");t.icon&&w.html(`${await Si(t.icon,{height:o,width:o,fallbackPrefix:""})}`);const L=w.node().getBBox(),T=L.width,D=L.height,I=L.x,O=L.y,E=Math.max(T,D)*Math.SQRT2+d*2,N=b.circle(0,0,E,k),R=Math.max(E,h.width),B=E+h.height+f,A=b.rectangle(-R/2,-B/2,R,B,{...k,fill:"transparent",stroke:"none"}),_=c.insert(()=>N,":first-child"),$=c.insert(()=>A);return w.attr("transform",`translate(${-T/2-I},${g?h.height/2+f/2-D/2-O:-h.height/2-f/2-D/2-O})`),w.attr("style",`color: ${x.get("stroke")??m};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-B/2:B/2-h.height})`),_.attr("transform",`translate(0,${g?h.height/2+f/2:-h.height/2-f/2})`),G(t,$),t.intersect=function(M){return F.info("iconSquare intersect",t,M),W.rect(t,M)},c}p(Yd,"iconCircle");async function Ud(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=U(t);t.labelStyle=a;const n=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(n,s),l=i?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await it(e,t,"icon-shape default"),f=t.pos==="t",g=o+u*2,m=o+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Er(t),k=-m/2,v=-g/2,w=t.label?8:0,L=j.svg(c),T=Y(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const D=b.get("fill");T.stroke=D??x;const I=L.path(je(k,v,m,g,5),T),O=Math.max(m,h.width),E=g+h.height+w,N=L.rectangle(-O/2,-E/2,O,E,{...T,fill:"transparent",stroke:"none"}),R=c.insert(()=>I,":first-child").attr("class","icon-shape2"),B=c.insert(()=>N);if(t.icon){const A=c.append("g");A.html(`${await Si(t.icon,{height:o,width:o,fallbackPrefix:""})}`);const _=A.node().getBBox(),$=_.width,M=_.height,q=_.x,V=_.y;A.attr("transform",`translate(${-$/2-q},${f?h.height/2+w/2-M/2-V:-h.height/2-w/2-M/2-V})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),G(t,B),t.intersect=function(A){if(F.info("iconSquare intersect",t,A),!t.label)return W.rect(t,A);const _=t.x??0,$=t.y??0,M=t.height??0;let q=[];return f?q=[{x:_-h.width/2,y:$-M/2},{x:_+h.width/2,y:$-M/2},{x:_+h.width/2,y:$-M/2+h.height+w},{x:_+m/2,y:$-M/2+h.height+w},{x:_+m/2,y:$+M/2},{x:_-m/2,y:$+M/2},{x:_-m/2,y:$-M/2+h.height+w},{x:_-h.width/2,y:$-M/2+h.height+w}]:q=[{x:_-m/2,y:$-M/2},{x:_+m/2,y:$-M/2},{x:_+m/2,y:$-M/2+g},{x:_+h.width/2,y:$-M/2+g},{x:_+h.width/2/2,y:$+M/2},{x:_-h.width/2,y:$+M/2},{x:_-h.width/2,y:$-M/2+g},{x:_-m/2,y:$-M/2+g}],W.polygon(t,q,A)},c}p(Ud,"iconRounded");async function Gd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=U(t);t.labelStyle=a;const n=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(n,s),l=i?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await it(e,t,"icon-shape default"),f=t.pos==="t",g=o+u*2,m=o+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Er(t),k=-m/2,v=-g/2,w=t.label?8:0,L=j.svg(c),T=Y(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const D=b.get("fill");T.stroke=D??x;const I=L.path(je(k,v,m,g,.1),T),O=Math.max(m,h.width),E=g+h.height+w,N=L.rectangle(-O/2,-E/2,O,E,{...T,fill:"transparent",stroke:"none"}),R=c.insert(()=>I,":first-child"),B=c.insert(()=>N);if(t.icon){const A=c.append("g");A.html(`${await Si(t.icon,{height:o,width:o,fallbackPrefix:""})}`);const _=A.node().getBBox(),$=_.width,M=_.height,q=_.x,V=_.y;A.attr("transform",`translate(${-$/2-q},${f?h.height/2+w/2-M/2-V:-h.height/2-w/2-M/2-V})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),G(t,B),t.intersect=function(A){if(F.info("iconSquare intersect",t,A),!t.label)return W.rect(t,A);const _=t.x??0,$=t.y??0,M=t.height??0;let q=[];return f?q=[{x:_-h.width/2,y:$-M/2},{x:_+h.width/2,y:$-M/2},{x:_+h.width/2,y:$-M/2+h.height+w},{x:_+m/2,y:$-M/2+h.height+w},{x:_+m/2,y:$+M/2},{x:_-m/2,y:$+M/2},{x:_-m/2,y:$-M/2+h.height+w},{x:_-h.width/2,y:$-M/2+h.height+w}]:q=[{x:_-m/2,y:$-M/2},{x:_+m/2,y:$-M/2},{x:_+m/2,y:$-M/2+g},{x:_+h.width/2,y:$-M/2+g},{x:_+h.width/2/2,y:$+M/2},{x:_-h.width/2,y:$+M/2},{x:_-h.width/2,y:$-M/2+g},{x:_-m/2,y:$-M/2+g}],W.polygon(t,q,A)},c}p(Gd,"iconSquare");async function Vd(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const a=Number(i.naturalWidth.toString().replace("px","")),n=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/n;const{labelStyles:s}=U(t);t.labelStyle=s;const o=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?o??0:0,t?.assetWidth??a),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??n;t.width=Math.max(c,o??0);const{shapeSvg:u,bbox:d,label:f}=await it(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,b=j.svg(u),k=Y(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=b.rectangle(m,y,c,h,k),w=Math.max(c,d.width),L=h+d.height+x,T=b.rectangle(-w/2,-L/2,w,L,{...k,fill:"none",stroke:"none"}),D=u.insert(()=>v,":first-child"),I=u.insert(()=>T);if(t.img){const O=u.append("image");O.attr("href",t.img),O.attr("width",c),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-c/2},${g?L/2-h:-L/2})`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-h/2-d.height/2-x/2:h/2-d.height/2+x/2})`),D.attr("transform",`translate(0,${g?d.height/2+x/2:-d.height/2-x/2})`),G(t,I),t.intersect=function(O){if(F.info("iconSquare intersect",t,O),!t.label)return W.rect(t,O);const E=t.x??0,N=t.y??0,R=t.height??0;let B=[];return g?B=[{x:E-d.width/2,y:N-R/2},{x:E+d.width/2,y:N-R/2},{x:E+d.width/2,y:N-R/2+d.height+x},{x:E+c/2,y:N-R/2+d.height+x},{x:E+c/2,y:N+R/2},{x:E-c/2,y:N+R/2},{x:E-c/2,y:N-R/2+d.height+x},{x:E-d.width/2,y:N-R/2+d.height+x}]:B=[{x:E-c/2,y:N-R/2},{x:E+c/2,y:N-R/2},{x:E+c/2,y:N-R/2+h},{x:E+d.width/2,y:N-R/2+h},{x:E+d.width/2/2,y:N+R/2},{x:E-d.width/2,y:N+R/2},{x:E-d.width/2,y:N-R/2+h},{x:E-c/2,y:N-R/2+h}],W.polygon(t,B,O)},u}p(Vd,"imageSquare");async function Xd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=Math.max(n.width+(t.padding??0)*2,t?.width??0),o=Math.max(n.height+(t.padding??0)*2,t?.height??0),l=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=j.svg(a),d=Y(t,{}),f=lt(l),g=u.path(f,d);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=Ye(a,s,o,l);return i&&c.attr("style",i),t.width=s,t.height=o,G(t,c),t.intersect=function(u){return W.polygon(t,l,u)},a}p(Xd,"inv_trapezoid");async function Ga(e,t,r){const{labelStyles:i,nodeStyles:a}=U(t);t.labelStyle=i;const{shapeSvg:n,bbox:s}=await it(e,t,rt(t)),o=Math.max(s.width+r.labelPaddingX*2,t?.width||0),l=Math.max(s.height+r.labelPaddingY*2,t?.height||0),c=-o/2,h=-l/2;let u,{rx:d,ry:f}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(d=r.rx,f=r.ry),t.look==="handDrawn"){const m=j.svg(n),y=Y(t,{}),x=d||f?m.path(je(c,h,o,l,d||0),y):m.rectangle(c,h,o,l,y);u=n.insert(()=>x,":first-child"),u.attr("class","basic label-container").attr("style",It(g))}else u=n.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",a).attr("rx",It(d)).attr("ry",It(f)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return G(t,u),t.calcIntersect=function(m,y){return W.rect(m,y)},t.intersect=function(m){return W.rect(t,m)},n}p(Ga,"drawRect");async function Zd(e,t){const{shapeSvg:r,bbox:i,label:a}=await it(e,t,"label"),n=r.insert("rect",":first-child");return n.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),G(t,n),t.intersect=function(l){return W.rect(t,l)},r}p(Zd,"labelRect");async function Kd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=Math.max(n.width+(t.padding??0),t?.width??0),o=Math.max(n.height+(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-(3*o)/6,y:-o}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=j.svg(a),d=Y(t,{}),f=lt(l),g=u.path(f,d);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=Ye(a,s,o,l);return i&&c.attr("style",i),t.width=s,t.height=o,G(t,c),t.intersect=function(u){return W.polygon(t,l,u)},a}p(Kd,"lean_left");async function Qd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=Math.max(n.width+(t.padding??0),t?.width??0),o=Math.max(n.height+(t.padding??0),t?.height??0),l=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=j.svg(a),d=Y(t,{}),f=lt(l),g=u.path(f,d);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=Ye(a,s,o,l);return i&&c.attr("style",i),t.width=s,t.height=o,G(t,c),t.intersect=function(u){return W.polygon(t,l,u)},a}p(Qd,"lean_right");function Jd(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.label="",t.labelStyle=r;const a=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,s=Math.max(35,t?.width??0),o=Math.max(35,t?.height??0),l=7,c=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=j.svg(a),u=Y(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=lt(c),f=h.path(d,u),g=a.insert(()=>f,":first-child");return n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${s/2},${-o})`),G(t,g),t.intersect=function(m){return F.info("lightningBolt intersect",t,m),W.polygon(t,c,m)},a}p(Jd,"lightningBolt");var P2=p((e,t,r,i,a,n,s)=>[`M${e},${t+n}`,`a${a},${n} 0,0,0 ${r},0`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+n+s}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),N2=p((e,t,r,i,a,n,s)=>[`M${e},${t+n}`,`M${e+r},${t+n}`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+n+s}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),z2=p((e,t,r,i,a,n)=>[`M${e-r/2},${-i/2}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function tf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0),t.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(n.height+c+(t.padding??0),t.height??0),u=h*.1;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=j.svg(a),m=N2(0,0,o,h,l,c,u),y=z2(0,c,o,h,l,c),x=Y(t,{}),b=g.path(m,x),k=g.path(y,x);a.insert(()=>k,":first-child").attr("class","line"),d=a.insert(()=>b,":first-child"),d.attr("class","basic label-container"),f&&d.attr("style",f)}else{const g=P2(0,0,o,h,l,c,u);d=a.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",It(f)).attr("style",i)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),G(t,d),s.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+c-(n.y-(n.top??0))})`),t.intersect=function(g){const m=W.rect(t,g),y=m.x-(t.x??0);if(l!=0&&(Math.abs(y)<(t.width??0)/2||Math.abs(y)==(t.width??0)/2&&Math.abs(m.y-(t.y??0))>(t.height??0)/2-c)){let x=c*c*(1-y*y/(l*l));x>0&&(x=Math.sqrt(x)),x=c-x,g.y-(t.y??0)>0&&(x=-x),m.y+=x}return m},a}p(tf,"linedCylinder");async function ef(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=l/4,h=l+c,{cssStyles:u}=t,d=j.svg(a),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...We(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],m=d.polygon(g.map(x=>[x.x,x.y]),f),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)+o/2*.1/2-(n.x-(n.left??0))},${-l/2+(t.padding??0)-c/2-(n.y-(n.top??0))})`),G(t,y),t.intersect=function(x){return W.polygon(t,g,x)},a}p(ef,"linedWaveEdgedRect");async function rf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=5,h=-o/2,u=-l/2,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{}),m=[{x:h-c,y:u+c},{x:h-c,y:u+l+c},{x:h+o-c,y:u+l+c},{x:h+o-c,y:u+l},{x:h+o,y:u+l},{x:h+o,y:u+l-c},{x:h+o+c,y:u+l-c},{x:h+o+c,y:u-c},{x:h+c,y:u-c},{x:h+c,y:u},{x:h,y:u},{x:h,y:u+c}],y=[{x:h,y:u+c},{x:h+o-c,y:u+c},{x:h+o-c,y:u+l},{x:h+o,y:u+l},{x:h+o,y:u},{x:h,y:u}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=lt(m),b=f.path(x,g),k=lt(y),v=f.path(k,{...g,fill:"none"}),w=a.insert(()=>v,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),s.attr("transform",`translate(${-(n.width/2)-c-(n.x-(n.left??0))}, ${-(n.height/2)+c-(n.y-(n.top??0))})`),G(t,w),t.intersect=function(L){return W.polygon(t,m,L)},a}p(rf,"multiRect");async function af(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=l/4,h=l+c,u=-o/2,d=-h/2,f=5,{cssStyles:g}=t,m=We(u-f,d+h+f,u+o-f,d+h+f,c,.8),y=m?.[m.length-1],x=[{x:u-f,y:d+f},{x:u-f,y:d+h+f},...m,{x:u+o-f,y:y.y-f},{x:u+o,y:y.y-f},{x:u+o,y:y.y-2*f},{x:u+o+f,y:y.y-2*f},{x:u+o+f,y:d-f},{x:u+f,y:d-f},{x:u+f,y:d},{x:u,y:d},{x:u,y:d+f}],b=[{x:u,y:d+f},{x:u+o-f,y:d+f},{x:u+o-f,y:y.y-f},{x:u+o,y:y.y-f},{x:u+o,y:d},{x:u,y:d}],k=j.svg(a),v=Y(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=lt(x),L=k.path(w,v),T=lt(b),D=k.path(T,v),I=a.insert(()=>L,":first-child");return I.insert(()=>D),I.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-(n.width/2)-f-(n.x-(n.left??0))}, ${-(n.height/2)+f-c/2-(n.y-(n.top??0))})`),G(t,I),t.intersect=function(O){return W.polygon(t,x,O)},a}p(af,"multiWaveEdgedRectangle");async function nf(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=U(t);t.labelStyle=i,t.useHtmlLabels||Ot().flowchart?.htmlLabels!==!1||(t.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await it(e,t,rt(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),h=Math.max(o.height+(t.padding??0)*2,t?.height??0),u=-c/2,d=-h/2,{cssStyles:f}=t,g=j.svg(s),m=Y(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(u,d,c,h,m),x=s.insert(()=>y,":first-child");return x.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),a&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",a),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),G(t,x),t.intersect=function(b){return W.rect(t,b)},s}p(nf,"note");var W2=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function sf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.width+t.padding,o=n.height+t.padding,l=s+o,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let u;const{cssStyles:d}=t;if(t.look==="handDrawn"){const f=j.svg(a),g=Y(t,{}),m=W2(0,0,l),y=f.path(m,g);u=a.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),d&&u.attr("style",d)}else u=Ye(a,l,l,h),u.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&u.attr("style",i),G(t,u),t.calcIntersect=function(f,g){const m=f.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=W.polygon(f,y,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},a}p(sf,"question");async function of(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0),t?.width??0),l=Math.max(n.height+(t.padding??0),t?.height??0),c=-o/2,h=-l/2,u=h/2,d=[{x:c+u,y:h},{x:c,y:0},{x:c+u,y:-h},{x:-c,y:-h},{x:-c,y:h}],{cssStyles:f}=t,g=j.svg(a),m=Y(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=lt(d),x=g.path(y,m),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-u/2},0)`),s.attr("transform",`translate(${-u/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),G(t,b),t.intersect=function(k){return W.polygon(t,d,k)},a}p(of,"rect_left_inv_arrow");async function lf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;let a;t.cssClasses?a="node "+t.cssClasses:a="node default";const n=e.insert("g").attr("class",a).attr("id",t.domId||t.id),s=n.insert("g"),o=n.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=o.node().appendChild(await tr(c,t.labelStyle,!0,!0));let u={width:0,height:0};if(Lt(dt()?.flowchart?.htmlLabels)){const D=h.children[0],I=ht(h);u=D.getBoundingClientRect(),I.attr("width",u.width),I.attr("height",u.height)}F.info("Text 2",l);const d=l||[],f=h.getBBox(),g=o.node().appendChild(await tr(d.join?d.join("
                "):d,t.labelStyle,!0,!0)),m=g.children[0],y=ht(g);u=m.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const x=(t.padding||0)/2;ht(g).attr("transform","translate( "+(u.width>f.width?0:(f.width-u.width)/2)+", "+(f.height+x+5)+")"),ht(h).attr("transform","translate( "+(u.width(F.debug("Rough node insert CXC",O),E),":first-child"),L=n.insert(()=>(F.debug("Rough node insert CXC",O),O),":first-child")}else L=s.insert("rect",":first-child"),T=s.insert("line"),L.attr("class","outer title-state").attr("style",i).attr("x",-u.width/2-x).attr("y",-u.height/2-x).attr("width",u.width+(t.padding||0)).attr("height",u.height+(t.padding||0)),T.attr("class","divider").attr("x1",-u.width/2-x).attr("x2",u.width/2+x).attr("y1",-u.height/2-x+f.height+x).attr("y2",-u.height/2-x+f.height+x);return G(t,L),t.intersect=function(D){return W.rect(t,D)},n}p(lf,"rectWithTitle");function Jr(e,t,r,i,a,n,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,d=(i-t)/2,f=u/a,g=d/n,m=Math.sqrt(f**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*n*Math.sin(h)*(s?-1:1),b=c-y*a*Math.cos(h)*(s?-1:1),k=Math.atan2((t-b)/n,(e-x)/a);let w=Math.atan2((i-b)/n,(r-x)/a)-k;s&&w<0&&(w+=2*Math.PI),!s&&w>0&&(w-=2*Math.PI);const L=[];for(let T=0;T<20;T++){const D=T/19,I=k+D*w,O=x+a*Math.cos(I),E=b+n*Math.sin(I);L.push({x:O,y:E})}return L}p(Jr,"generateArcPoints");async function cf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=t?.padding??0,o=t?.padding??0,l=(t?.width?t?.width:n.width)+s*2,c=(t?.height?t?.height:n.height)+o*2,h=t.radius||5,u=t.taper||5,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{});t.stroke&&(g.stroke=t.stroke),t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-l/2+u,y:-c/2},{x:l/2-u,y:-c/2},...Jr(l/2-u,-c/2,l/2,-c/2+u,h,h,!0),{x:l/2,y:-c/2+u},{x:l/2,y:c/2-u},...Jr(l/2,c/2-u,l/2-u,c/2,h,h,!0),{x:l/2-u,y:c/2},{x:-l/2+u,y:c/2},...Jr(-l/2+u,c/2,-l/2,c/2-u,h,h,!0),{x:-l/2,y:c/2-u},{x:-l/2,y:-c/2+u},...Jr(-l/2,-c/2+u,-l/2+u,-c/2,h,h,!0)],y=lt(m),x=f.path(y,g),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),G(t,b),t.intersect=function(k){return W.polygon(t,m,k)},a}p(cf,"roundedRect");async function hf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=t?.padding??0,l=Math.max(n.width+(t.padding??0)*2,t?.width??0),c=Math.max(n.height+(t.padding??0)*2,t?.height??0),h=-n.width/2-o,u=-n.height/2-o,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],y=f.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container").attr("style",It(d)),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),d&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),s.attr("transform",`translate(${-l/2+4+(t.padding??0)-(n.x-(n.left??0))},${-c/2+(t.padding??0)-(n.y-(n.top??0))})`),G(t,x),t.intersect=function(b){return W.rect(t,b)},a}p(hf,"shadedProcess");async function uf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=t,d=j.svg(a),f=Y(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],m=lt(g),y=d.path(m,f),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),x.attr("transform",`translate(0, ${l/4})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(n.x-(n.left??0))}, ${-l/4+(t.padding??0)-(n.y-(n.top??0))})`),G(t,x),t.intersect=function(b){return W.polygon(t,g,b)},a}p(uf,"slopedRect");async function df(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1};return Ga(e,t,r)}p(df,"squareRect");async function ff(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.height+t.padding,o=n.width+s/4+t.padding,l=s/2,{cssStyles:c}=t,h=j.svg(a),u=Y(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=[{x:-o/2+l,y:-s/2},{x:o/2-l,y:-s/2},...gi(-o/2+l,0,l,50,90,270),{x:o/2-l,y:s/2},...gi(o/2-l,0,l,50,270,450)],f=lt(d),g=h.path(f,u),m=a.insert(()=>g,":first-child");return m.attr("class","basic label-container outer-path"),c&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",c),i&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),G(t,m),t.intersect=function(y){return W.polygon(t,d,y)},a}p(ff,"stadium");async function pf(e,t){return Ga(e,t,{rx:5,ry:5})}p(pf,"state");function gf(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=U(t);t.labelStyle=i;const{cssStyles:n}=t,{lineColor:s,stateBorder:o,nodeBorder:l}=r,c=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),h=j.svg(c),u=Y(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=h.circle(0,0,14,{...u,stroke:s,strokeWidth:2}),f=o??l,g=h.circle(0,0,5,{...u,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),m=c.insert(()=>d,":first-child");return m.insert(()=>g),n&&m.selectAll("path").attr("style",n),a&&m.selectAll("path").attr("style",a),G(t,m),t.intersect=function(y){return W.circle(t,7,y)},c}p(gf,"stateEnd");function mf(e,t,{config:{themeVariables:r}}){const{lineColor:i}=r,a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let n;if(t.look==="handDrawn"){const o=j.svg(a).circle(0,0,14,rx(i));n=a.insert(()=>o),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else n=a.insert("circle",":first-child"),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return G(t,n),t.intersect=function(s){return W.circle(t,7,s)},a}p(mf,"stateStart");async function yf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=(t?.padding||0)/2,o=n.width+t.padding,l=n.height+t.padding,c=-n.width/2-s,h=-n.height/2-s,u=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(t.look==="handDrawn"){const d=j.svg(a),f=Y(t,{}),g=d.rectangle(c-8,h,o+16,l,f),m=d.line(c,h,c,h+l,f),y=d.line(c+o,h,c+o,h+l,f);a.insert(()=>m,":first-child"),a.insert(()=>y,":first-child");const x=a.insert(()=>g,":first-child"),{cssStyles:b}=t;x.attr("class","basic label-container").attr("style",It(b)),G(t,x)}else{const d=Ye(a,o,l,u);i&&d.attr("style",i),G(t,d)}return t.intersect=function(d){return W.polygon(t,u,d)},a}p(yf,"subroutine");async function xf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=Math.max(n.width+(t.padding??0)*2,t?.width??0),o=Math.max(n.height+(t.padding??0)*2,t?.height??0),l=-s/2,c=-o/2,h=.2*o,u=.2*o,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{}),m=[{x:l-h/2,y:c},{x:l+s+h/2,y:c},{x:l+s+h/2,y:c+o},{x:l-h/2,y:c+o}],y=[{x:l+s-h/2,y:c+o},{x:l+s+h/2,y:c+o},{x:l+s+h/2,y:c+o-u}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=lt(m),b=f.path(x,g),k=lt(y),v=f.path(k,{...g,fillStyle:"solid"}),w=a.insert(()=>v,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),G(t,w),t.intersect=function(L){return W.polygon(t,m,L)},a}p(xf,"taggedRect");async function bf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=l/4,h=.2*o,u=.2*l,d=l+c,{cssStyles:f}=t,g=j.svg(a),m=Y(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:d/2},...We(-o/2-o/2*.1,d/2,o/2+o/2*.1,d/2,c,.8),{x:o/2+o/2*.1,y:-d/2},{x:-o/2-o/2*.1,y:-d/2}],x=-o/2+o/2*.1,b=-d/2-u*.4,k=[{x:x+o-h,y:(b+l)*1.4},{x:x+o,y:b+l-u},{x:x+o,y:(b+l)*.9},...We(x+o,(b+l)*1.3,x+o-h,(b+l)*1.5,-l*.03,.5)],v=lt(y),w=g.path(v,m),L=lt(k),T=g.path(L,{...m,fillStyle:"solid"}),D=a.insert(()=>T,":first-child");return D.insert(()=>w,":first-child"),D.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(n.x-(n.left??0))},${-l/2+(t.padding??0)-c/2-(n.y-(n.top??0))})`),G(t,D),t.intersect=function(I){return W.polygon(t,y,I)},a}p(bf,"taggedWaveEdgedRectangle");async function Cf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=Math.max(n.width+t.padding,t?.width||0),o=Math.max(n.height+t.padding,t?.height||0),l=-s/2,c=-o/2,h=a.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",o),G(t,h),t.intersect=function(u){return W.rect(t,u)},a}p(Cf,"text");var q2=p((e,t,r,i,a,n)=>`M${e},${t} - a${a},${n} 0,0,1 0,${-i} - l${r},0 - a${a},${n} 0,0,1 0,${i} - M${r},${-i} - a${a},${n} 0,0,0 0,${i} - l${-r},0`,"createCylinderPathD"),H2=p((e,t,r,i,a,n)=>[`M${e},${t}`,`M${e+r},${t}`,`a${a},${n} 0,0,0 0,${-i}`,`l${-r},0`,`a${a},${n} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),j2=p((e,t,r,i,a,n)=>[`M${e+r/2},${-i/2}`,`a${a},${n} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function kf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s,halfPadding:o}=await it(e,t,rt(t)),l=t.look==="neo"?o*2:o,c=n.height+l,h=c/2,u=h/(2.5+c/50),d=n.width+u+l,{cssStyles:f}=t;let g;if(t.look==="handDrawn"){const m=j.svg(a),y=H2(0,0,d,c,u,h),x=j2(0,0,d,c,u,h),b=m.path(y,Y(t,{})),k=m.path(x,Y(t,{fill:"none"}));g=a.insert(()=>k,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),f&&g.attr("style",f)}else{const m=q2(0,0,d,c,u,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",It(f)).attr("style",i),g.attr("class","basic label-container"),f&&g.selectAll("path").attr("style",f),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-d/2}, ${c/2} )`),s.attr("transform",`translate(${-(n.width/2)-u-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),G(t,g),t.intersect=function(m){const y=W.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let b=u*u*(1-x*x/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(kf,"tiltedCylinder");async function wf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=n.width+t.padding,o=n.height+t.padding,l=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=j.svg(a),d=Y(t,{}),f=lt(l),g=u.path(f,d);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=Ye(a,s,o,l);return i&&c.attr("style",i),t.width=s,t.height=o,G(t,c),t.intersect=function(u){return W.polygon(t,l,u)},a}p(wf,"trapezoid");async function vf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=60,o=20,l=Math.max(s,n.width+(t.padding??0)*2,t?.width??0),c=Math.max(o,n.height+(t.padding??0)*2,t?.height??0),{cssStyles:h}=t,u=j.svg(a),d=Y(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{x:-l/2*.8,y:-c/2},{x:l/2*.8,y:-c/2},{x:l/2,y:-c/2*.6},{x:l/2,y:c/2},{x:-l/2,y:c/2},{x:-l/2,y:-c/2*.6}],g=lt(f),m=u.path(g,d),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),G(t,y),t.intersect=function(x){return W.polygon(t,f,x)},a}p(vf,"trapezoidalPentagon");async function Sf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Lt(dt().flowchart?.htmlLabels),l=n.width+(t.padding??0),c=l+n.height,h=l+n.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:d}=t,f=j.svg(a),g=Y(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=lt(u),y=f.path(m,g),x=a.insert(()=>y,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=l,t.height=c,G(t,x),s.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${c/2-(n.height+(t.padding??0)/(o?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(b){return F.info("Triangle intersect",t,u,b),W.polygon(t,u,b)},a}p(Sf,"triangle");async function Tf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=l/8,h=l+c,{cssStyles:u}=t,f=70-o,g=f>0?f/2:0,m=j.svg(a),y=Y(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-o/2-g,y:h/2},...We(-o/2-g,h/2,o/2+g,h/2,c,.8),{x:o/2+g,y:-h/2},{x:-o/2-g,y:-h/2}],b=lt(x),k=m.path(b,y),v=a.insert(()=>k,":first-child");return v.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(n.x-(n.left??0))},${-l/2+(t.padding??0)-c-(n.y-(n.top??0))})`),G(t,v),t.intersect=function(w){return W.polygon(t,x,w)},a}p(Tf,"waveEdgedRectangle");async function _f(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n}=await it(e,t,rt(t)),s=100,o=50,l=Math.max(n.width+(t.padding??0)*2,t?.width??0),c=Math.max(n.height+(t.padding??0)*2,t?.height??0),h=l/c;let u=l,d=c;u>d*h?d=u/h:u=d*h,u=Math.max(u,s),d=Math.max(d,o);const f=Math.min(d*.2,d/4),g=d+f*2,{cssStyles:m}=t,y=j.svg(a),x=Y(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-u/2,y:g/2},...We(-u/2,g/2,u/2,g/2,f,1),{x:u/2,y:-g/2},...We(u/2,-g/2,-u/2,-g/2,f,-1)],k=lt(b),v=y.path(k,x),w=a.insert(()=>v,":first-child");return w.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),G(t,w),t.intersect=function(L){return W.polygon(t,b,L)},a}p(_f,"waveRectangle");async function Bf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:s}=await it(e,t,rt(t)),o=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=5,h=-o/2,u=-l/2,{cssStyles:d}=t,f=j.svg(a),g=Y(t,{}),m=[{x:h-c,y:u-c},{x:h-c,y:u+l},{x:h+o,y:u+l},{x:h+o,y:u-c}],y=`M${h-c},${u-c} L${h+o},${u-c} L${h+o},${u+l} L${h-c},${u+l} L${h-c},${u-c} - M${h-c},${u} L${h+o},${u} - M${h},${u-c} L${h},${u+l}`;t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=f.path(y,g),b=a.insert(()=>x,":first-child");return b.attr("transform",`translate(${c/2}, ${c/2})`),b.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),s.attr("transform",`translate(${-(n.width/2)+c/2-(n.x-(n.left??0))}, ${-(n.height/2)+c/2-(n.y-(n.top??0))})`),G(t,b),t.intersect=function(k){return W.polygon(t,m,k)},a}p(Bf,"windowPane");async function oo(e,t){const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:J}=Ot(),{background:Z}=J,ct={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await oo(e,ct)}const i=Ot();t.useHtmlLabels=i.htmlLabels;let a=i.er?.diagramPadding??10,n=i.er?.entityPadding??6;const{cssStyles:s}=t,{labelStyles:o,nodeStyles:l}=U(t);if(r.attributes.length===0&&t.label){const J={rx:0,ry:0,labelPaddingX:a,labelPaddingY:a*1.5};$e(t.label,i)+J.labelPaddingX*20){const J=u.width+a*2-(m+y+x+b);m+=J/w,y+=J/w,x>0&&(x+=J/w),b>0&&(b+=J/w)}const T=m+y+x+b,D=j.svg(h),I=Y(t,{});t.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let O=0;g.length>0&&(O=g.reduce((J,Z)=>J+(Z?.rowHeight??0),0));const E=Math.max(L.width+a*2,t?.width||0,T),N=Math.max((O??0)+u.height,t?.height||0),R=-E/2,B=-N/2;h.selectAll("g:not(:first-child)").each((J,Z,ct)=>{const nt=ht(ct[Z]),Ct=nt.attr("transform");let kt=0,Nt=0;if(Ct){const xt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Ct);xt&&(kt=parseFloat(xt[1]),Nt=parseFloat(xt[2]),nt.attr("class").includes("attribute-name")?kt+=m:nt.attr("class").includes("attribute-keys")?kt+=m+y:nt.attr("class").includes("attribute-comment")&&(kt+=m+y+x))}nt.attr("transform",`translate(${R+a/2+kt}, ${Nt+B+u.height+n/2})`)}),h.select(".name").attr("transform","translate("+-u.width/2+", "+(B+n/2)+")");const A=D.rectangle(R,B,E,N,I),_=h.insert(()=>A,":first-child").attr("style",s.join("")),{themeVariables:$}=Ot(),{rowEven:M,rowOdd:q,nodeBorder:V}=$;f.push(0);for(const[J,Z]of g.entries()){const nt=(J+1)%2===0&&Z.yOffset!==0,Ct=D.rectangle(R,u.height+B+Z?.yOffset,E,Z?.rowHeight,{...I,fill:nt?M:q,stroke:V});h.insert(()=>Ct,"g.label").attr("style",s.join("")).attr("class",`row-rect-${nt?"even":"odd"}`)}let K=D.line(R,u.height+B,E+R,u.height+B,I);h.insert(()=>K).attr("class","divider"),K=D.line(m+R,u.height+B,m+R,N+B,I),h.insert(()=>K).attr("class","divider"),k&&(K=D.line(m+y+R,u.height+B,m+y+R,N+B,I),h.insert(()=>K).attr("class","divider")),v&&(K=D.line(m+y+x+R,u.height+B,m+y+x+R,N+B,I),h.insert(()=>K).attr("class","divider"));for(const J of f)K=D.line(R,u.height+B+J,E+R,u.height+B+J,I),h.insert(()=>K).attr("class","divider");if(G(t,_),l&&t.look!=="handDrawn"){const Z=l.split(";")?.filter(ct=>ct.includes("stroke"))?.map(ct=>`${ct}`).join("; ");h.selectAll("path").attr("style",Z??""),h.selectAll(".row-rect-even path").attr("style",l)}return t.intersect=function(J){return W.rect(t,J)},h}p(oo,"erBox");async function br(e,t,r,i=0,a=0,n=[],s=""){const o=e.insert("g").attr("class",`label ${n.join(" ")}`).attr("transform",`translate(${i}, ${a})`).attr("style",s);t!==jo(t)&&(t=jo(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await He(o,t,{width:$e(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Lt(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const u=ht(l);c=h.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}return c}p(br,"addText");async function Lf(e,t,r,i,a=r.class.padding??12){const n=i?0:3,s=e.insert("g").attr("class",rt(t)).attr("id",t.domId||t.id);let o=null,l=null,c=null,h=null,u=0,d=0,f=0;if(o=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await ti(o,{text:`«${b}»`},0),u=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await ti(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();d=g.height,c=s.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await ti(c,b,m,[b.parseClassifier()]);m+=k+n}f=c.node().getBBox().height,f<=0&&(f=a/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const k=await ti(h,b,y,[b.parseClassifier()]);y+=k+n}let x=s.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${u})`),x=s.node().getBBox(),c.attr("transform",`translate(0, ${u+d+a*2})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${u+d+(f?f+a*4:a*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}p(Lf,"textHelper");async function ti(e,t,r,i=[]){const a=e.insert("g").attr("class","label").attr("style",i.join("; ")),n=Ot();let s="useHtmlLabels"in t?t.useHtmlLabels:Lt(n.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Tr(o)&&(s=!0);const l=await He(a,Bs(hr(o)),{width:$e(o,n)+50,classes:"markdown-node-label",useHtmlLabels:s},n);let c,h=1;if(s){const u=l.children[0],d=ht(l);h=u.innerHTML.split("
                ").length,u.innerHTML.includes("")&&(h+=u.innerHTML.split("").length-1);const f=u.getElementsByTagName("img");if(f){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=n.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,v=parseInt(b,10)*5+"px";m.style.minWidth=v,m.style.maxWidth=v}else m.style.width="100%";y(m)}p(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=u.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ht(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const u=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(u.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(u.textContent=u.textContent[0]+" "+u.textContent.substring(1))),u.textContent==="undefined"&&(u.textContent=""),c=l.getBBox()}return a.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(ti,"addText");async function Af(e,t){const r=dt(),i=r.class.padding??12,a=i,n=t.useHtmlLabels??Lt(r.htmlLabels)??!0,s=t;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await Lf(e,t,r,n,a),{labelStyles:c,nodeStyles:h}=U(t);t.labelStyle=c,t.cssStyles=s.styles||"";const u=s.styles?.join(";")||h||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const d=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,f=j.svg(o),g=Y(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=l.width;let y=l.height;s.members.length===0&&s.methods.length===0?y+=a:s.members.length>0&&s.methods.length===0&&(y+=a*2);const x=-m/2,b=-y/2,k=f.rectangle(x-i,b-i-(d?i:s.members.length===0&&s.methods.length===0?-i/2:0),m+2*i,y+2*i+(d?i*2:s.members.length===0&&s.methods.length===0?-i:0),g),v=o.insert(()=>k,":first-child");v.attr("class","basic label-container");const w=v.node().getBBox();o.selectAll(".text").each((I,O,E)=>{const N=ht(E[O]),R=N.attr("transform");let B=0;if(R){const M=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);M&&(B=parseFloat(M[2]))}let A=B+b+i-(d?i:s.members.length===0&&s.methods.length===0?-i/2:0);n||(A-=4);let _=x;(N.attr("class").includes("label-group")||N.attr("class").includes("annotation-group"))&&(_=-N.node()?.getBBox().width/2||0,o.selectAll("text").each(function($,M,q){window.getComputedStyle(q[M]).textAnchor==="middle"&&(_=0)})),N.attr("transform",`translate(${_}, ${A})`)});const L=o.select(".annotation-group").node().getBBox().height-(d?i/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?i/2:0)||0,D=o.select(".members-group").node().getBBox().height-(d?i/2:0)||0;if(s.members.length>0||s.methods.length>0||d){const I=f.line(w.x,L+T+b+i,w.x+w.width,L+T+b+i,g);o.insert(()=>I).attr("class","divider").attr("style",u)}if(d||s.members.length>0||s.methods.length>0){const I=f.line(w.x,L+T+D+b+a*2+i,w.x+w.width,L+T+D+b+i+a*2,g);o.insert(()=>I).attr("class","divider").attr("style",u)}if(s.look!=="handDrawn"&&o.selectAll("path").attr("style",u),v.select(":nth-child(2)").attr("style",u),o.selectAll(".divider").select("path").attr("style",u),t.labelStyle?o.selectAll("span").attr("style",t.labelStyle):o.selectAll("span").attr("style",u),!n){const I=RegExp(/color\s*:\s*([^;]*)/),O=I.exec(u);if(O){const E=O[0].replace("color","fill");o.selectAll("tspan").attr("style",E)}else if(c){const E=I.exec(c);if(E){const N=E[0].replace("color","fill");o.selectAll("tspan").attr("style",N)}}}return G(t,v),t.intersect=function(I){return W.rect(t,I)},o}p(Af,"classBox");async function Mf(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const a=t,n=t,s=20,o=20,l="verifyMethod"in t,c=rt(t),h=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let u;l?u=await me(h,`<<${a.type}>>`,0,t.labelStyle):u=await me(h,"<<Element>>",0,t.labelStyle);let d=u;const f=await me(h,a.name,d,t.labelStyle+"; font-weight: bold;");if(d+=f+o,l){const L=await me(h,`${a.requirementId?`ID: ${a.requirementId}`:""}`,d,t.labelStyle);d+=L;const T=await me(h,`${a.text?`Text: ${a.text}`:""}`,d,t.labelStyle);d+=T;const D=await me(h,`${a.risk?`Risk: ${a.risk}`:""}`,d,t.labelStyle);d+=D,await me(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:""}`,d,t.labelStyle)}else{const L=await me(h,`${n.type?`Type: ${n.type}`:""}`,d,t.labelStyle);d+=L,await me(h,`${n.docRef?`Doc Ref: ${n.docRef}`:""}`,d,t.labelStyle)}const g=(h.node()?.getBBox().width??200)+s,m=(h.node()?.getBBox().height??200)+s,y=-g/2,x=-m/2,b=j.svg(h),k=Y(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=b.rectangle(y,x,g,m,k),w=h.insert(()=>v,":first-child");if(w.attr("class","basic label-container").attr("style",i),h.selectAll(".label").each((L,T,D)=>{const I=ht(D[T]),O=I.attr("transform");let E=0,N=0;if(O){const _=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);_&&(E=parseFloat(_[1]),N=parseFloat(_[2]))}const R=N-m/2;let B=y+s/2;(T===0||T===1)&&(B=E),I.attr("transform",`translate(${B}, ${R+s})`)}),d>u+f+o){const L=b.line(y,x+u+f+o,y+g,x+u+f+o,k);h.insert(()=>L).attr("style",i)}return G(t,w),t.intersect=function(L){return W.rect(t,L)},h}p(Mf,"requirementBox");async function me(e,t,r,i=""){if(t==="")return 0;const a=e.insert("g").attr("class","label").attr("style",i),n=dt(),s=n.htmlLabels??!0,o=await He(a,Bs(hr(t)),{width:$e(t,n)+50,classes:"markdown-node-label",useHtmlLabels:s,style:i},n);let l;if(s){const c=o.children[0],h=ht(o);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=o.children[0];for(const h of c.children)h.textContent=h.textContent.replaceAll(">",">").replaceAll("<","<"),i&&h.setAttribute("style",i);l=o.getBBox(),l.height+=6}return a.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(me,"addText");var Y2=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ef(e,t,{config:r}){const{labelStyles:i,nodeStyles:a}=U(t);t.labelStyle=i||"";const n=10,s=t.width;t.width=(t.width??200)-10;const{shapeSvg:o,bbox:l,label:c}=await it(e,t,rt(t)),h=t.padding||10;let u="",d;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(u=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),d=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;d?{label:g,bbox:m}=await Sn(d,"ticket"in t&&t.ticket||"",f):{label:g,bbox:m}=await Sn(o,"ticket"in t&&t.ticket||"",f);const{label:y,bbox:x}=await Sn(o,"assigned"in t&&t.assigned||"",f);t.width=s;const b=10,k=t?.width||0,v=Math.max(m.height,x.height)/2,w=Math.max(l.height+b*2,t?.height||0)+v,L=-k/2,T=-w/2;c.attr("transform","translate("+(h-k/2)+", "+(-v-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-v+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*n)+", "+(-v+l.height/2)+")");let D;const{rx:I,ry:O}=t,{cssStyles:E}=t;if(t.look==="handDrawn"){const N=j.svg(o),R=Y(t,{}),B=I||O?N.path(je(L,T,k,w,I||0),R):N.rectangle(L,T,k,w,R);D=o.insert(()=>B,":first-child"),D.attr("class","basic label-container").attr("style",E||null)}else{D=o.insert("rect",":first-child"),D.attr("class","basic label-container __APA__").attr("style",a).attr("rx",I??5).attr("ry",O??5).attr("x",L).attr("y",T).attr("width",k).attr("height",w);const N="priority"in t&&t.priority;if(N){const R=o.append("line"),B=L+2,A=T+Math.floor((I??0)/2),_=T+w-Math.floor((I??0)/2);R.attr("x1",B).attr("y1",A).attr("x2",B).attr("y2",_).attr("stroke-width","4").attr("stroke",Y2(N))}}return G(t,D),t.height=w,t.intersect=function(N){return W.rect(t,N)},o}p(Ef,"kanbanItem");async function $f(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await it(e,t,rt(t)),l=n.width+10*s,c=n.height+8*s,h=.15*l,{cssStyles:u}=t,d=n.width+20,f=n.height+20,g=Math.max(l,d),m=Math.max(c,f);o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`);let y;const x=`M0 0 - a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} - a${h},${h} 1 0,0 ${g*.25},0 - a${h},${h} 1 0,0 ${g*.25},0 - a${h},${h} 1 0,0 ${g*.25},${m*.1} - - a${h},${h} 1 0,0 ${g*.15},${m*.33} - a${h*.8},${h*.8} 1 0,0 0,${m*.34} - a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} - - a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} - a${h},${h} 1 0,0 ${-1*g*.25},0 - a${h},${h} 1 0,0 ${-1*g*.25},0 - a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} - - a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} - a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} - a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(t.look==="handDrawn"){const b=j.svg(a),k=Y(t,{}),v=b.path(x,k);y=a.insert(()=>v,":first-child"),y.attr("class","basic label-container").attr("style",It(u))}else y=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),G(t,y),t.calcIntersect=function(b,k){return W.rect(b,k)},t.intersect=function(b){return F.info("Bang intersect",t,b),W.rect(t,b)},a}p($f,"bang");async function Ff(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await it(e,t,rt(t)),l=n.width+2*s,c=n.height+2*s,h=.15*l,u=.25*l,d=.35*l,f=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 - a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} - a${d},${d} 1 0,1 ${l*.4},${-1*l*.1} - a${u},${u} 1 0,1 ${l*.35},${l*.2} - - a${h},${h} 1 0,1 ${l*.15},${c*.35} - a${f},${f} 1 0,1 ${-1*l*.15},${c*.65} - - a${u},${h} 1 0,1 ${-1*l*.25},${l*.15} - a${d},${d} 1 0,1 ${-1*l*.5},0 - a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} - - a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} - a${f},${f} 1 0,1 ${l*.1},${-1*c*.65} - H0 V0 Z`;if(t.look==="handDrawn"){const x=j.svg(a),b=Y(t,{}),k=x.path(y,b);m=a.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",It(g))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),G(t,m),t.calcIntersect=function(x,b){return W.rect(x,b)},t.intersect=function(x){return F.info("Cloud intersect",t,x),W.rect(t,x)},a}p(Ff,"cloud");async function Df(e,t){const{labelStyles:r,nodeStyles:i}=U(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await it(e,t,rt(t)),l=n.width+8*s,c=n.height+2*s,h=5,u=` - M${-l/2} ${c/2-h} - v${-c+2*h} - q0,-${h} ${h},-${h} - h${l-2*h} - q${h},0 ${h},${h} - v${c-2*h} - q0,${h} -${h},${h} - h${-l+2*h} - q-${h},0 -${h},-${h} - Z - `,d=a.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return a.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),a.append(()=>o.node()),G(t,d),t.calcIntersect=function(f,g){return W.rect(f,g)},t.intersect=function(f){return W.rect(t,f)},a}p(Df,"defaultMindmapNode");async function Of(e,t){const r={padding:t.padding??0};return so(e,t,r)}p(Of,"mindmapCircle");var U2=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:df},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:cf},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ff},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:yf},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Od},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:so},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:$f},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ff},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:sf},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:qd},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Qd},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Kd},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:wf},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Xd},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Id},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Cf},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Bd},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:hf},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:mf},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:gf},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:zd},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Hd},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Ed},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:$d},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Fd},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Jd},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Tf},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Wd},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:kf},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tf},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Dd},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Rd},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Sf},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Bf},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Pd},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:vf},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Nd},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:uf},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:af},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:rf},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:_d},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Md},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:bf},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:xf},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:_f},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:of},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ef}],G2=p(()=>{const t=[...Object.entries({state:pf,choice:Ld,note:nf,rectWithTitle:lf,labelRect:Zd,iconSquare:Gd,iconCircle:Yd,icon:jd,iconRounded:Ud,imageSquare:Vd,anchor:Td,kanbanItem:Ef,mindmapCircle:Of,defaultMindmapNode:Df,classBox:Af,erBox:oo,requirementBox:Mf}),...U2.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(a=>[a,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Rf=G2();function V2(e){return e in Rf}p(V2,"isValidShape");var Va=new Map;async function If(e,t,r){let i,a;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const n=t.shape?Rf[t.shape]:void 0;if(!n)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),a=await n(i,t,r)}else a=await n(e,t,r),i=a;return t.tooltip&&a.attr("title",t.tooltip),Va.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(If,"insertNode");var QS=p((e,t)=>{Va.set(t.id,e)},"setNodeElem"),JS=p(()=>{Va.clear()},"clear"),tT=p(e=>{const t=Va.get(e.id);F.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),X2=p((e,t,r,i,a,n)=>{t.arrowTypeStart&&Dl(e,"start",t.arrowTypeStart,r,i,a,n),t.arrowTypeEnd&&Dl(e,"end",t.arrowTypeEnd,r,i,a,n)},"addEdgeMarkers"),Z2={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Dl=p((e,t,r,i,a,n,s)=>{const o=Z2[r];if(!o){F.warn(`Unknown arrow type: ${r}`);return}const l=o.type,h=`${a}_${n}-${l}${t==="start"?"Start":"End"}`;if(s&&s.trim()!==""){const u=s.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${u}`;if(!document.getElementById(d)){const f=document.getElementById(h);if(f){const g=f.cloneNode(!0);g.id=d,g.querySelectorAll("path, circle, line").forEach(y=>{y.setAttribute("stroke",s),o.fill&&y.setAttribute("fill",s)}),f.parentNode?.appendChild(g)}}e.attr(`marker-${t}`,`url(${i}#${d})`)}else e.attr(`marker-${t}`,`url(${i}#${h})`)},"addEdgeMarker"),_a=new Map,Et=new Map,eT=p(()=>{_a.clear(),Et.clear()},"clear"),zi=p(e=>e?e.reduce((r,i)=>r+";"+i,""):"","getLabelStyles"),K2=p(async(e,t)=>{let r=Lt(dt().flowchart.htmlLabels);const{labelStyles:i}=U(t);t.labelStyle=i;const a=await He(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});F.info("abc82",t,t.labelType);const n=e.insert("g").attr("class","edgeLabel"),s=n.insert("g").attr("class","label").attr("data-id",t.id);s.node().appendChild(a);let o=a.getBBox();if(r){const c=a.children[0],h=ht(a);o=c.getBoundingClientRect(),h.attr("width",o.width),h.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),_a.set(t.id,n),t.width=o.width,t.height=o.height;let l;if(t.startLabelLeft){const c=await tr(t.startLabelLeft,zi(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),Et.get(t.id)||Et.set(t.id,{}),Et.get(t.id).startLeft=h,ei(l,t.startLabelLeft)}if(t.startLabelRight){const c=await tr(t.startLabelRight,zi(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=h.node().appendChild(c),u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),Et.get(t.id)||Et.set(t.id,{}),Et.get(t.id).startRight=h,ei(l,t.startLabelRight)}if(t.endLabelLeft){const c=await tr(t.endLabelLeft,zi(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(c),Et.get(t.id)||Et.set(t.id,{}),Et.get(t.id).endLeft=h,ei(l,t.endLabelLeft)}if(t.endLabelRight){const c=await tr(t.endLabelRight,zi(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(c),Et.get(t.id)||Et.set(t.id,{}),Et.get(t.id).endRight=h,ei(l,t.endLabelRight)}return a},"insertEdgeLabel");function ei(e,t){dt().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(ei,"setTerminalWidth");var Q2=p((e,t)=>{F.debug("Moving label abc88 ",e.id,e.label,_a.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=dt(),{subGraphTitleTotalMargin:a}=Is(i);if(e.label){const n=_a.get(e.id);let s=e.x,o=e.y;if(r){const l=oe.calcLabelPosition(r);F.debug("Moving label "+e.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(s=l.x,o=l.y)}n.attr("transform",`translate(${s}, ${o+a/2})`)}if(e.startLabelLeft){const n=Et.get(e.id).startLeft;let s=e.x,o=e.y;if(r){const l=oe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}n.attr("transform",`translate(${s}, ${o})`)}if(e.startLabelRight){const n=Et.get(e.id).startRight;let s=e.x,o=e.y;if(r){const l=oe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}n.attr("transform",`translate(${s}, ${o})`)}if(e.endLabelLeft){const n=Et.get(e.id).endLeft;let s=e.x,o=e.y;if(r){const l=oe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}n.attr("transform",`translate(${s}, ${o})`)}if(e.endLabelRight){const n=Et.get(e.id).endRight;let s=e.x,o=e.y;if(r){const l=oe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}n.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),J2=p((e,t)=>{const r=e.x,i=e.y,a=Math.abs(t.x-r),n=Math.abs(t.y-i),s=e.width/2,o=e.height/2;return a>=s||n>=o},"outsideNode"),tk=p((e,t,r)=>{F.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(t)} - insidePoint : ${JSON.stringify(r)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,a=e.y,n=Math.abs(i-r.x),s=e.width/2;let o=r.xMath.abs(i-t.x)*l){let u=r.y{F.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],a=!1;return e.forEach(n=>{if(F.info("abc88 checking point",n,t),!J2(t,n)&&!a){const s=tk(t,i,n);F.debug("abc88 inside",n,i,s),F.debug("abc88 intersection",s,t);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?F.warn("abc88 no intersect",s,r):r.push(s),a=!0}else F.warn("abc88 outside",n,i),i=n,a||r.push(n)}),F.debug("returning points",r),r},"cutPathAtIntersect");function Pf(e){const t=[],r=[];for(let i=1;i5&&Math.abs(n.y-a.y)>5||a.y===n.y&&n.x===s.x&&Math.abs(n.x-a.x)>5&&Math.abs(n.y-s.y)>5)&&(t.push(n),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(Pf,"extractCornerPoints");var Rl=p(function(e,t,r){const i=t.x-e.x,a=t.y-e.y,n=Math.sqrt(i*i+a*a),s=r/n;return{x:t.x-s*i,y:t.y-s*a}},"findAdjacentPoint"),ek=p(function(e){const{cornerPointPositions:t}=Pf(e),r=[];for(let i=0;i10&&Math.abs(n.y-a.y)>=10){F.debug("Corner point fixing",Math.abs(n.x-a.x),Math.abs(n.y-a.y));const f=5;s.x===o.x?d={x:c<0?o.x-f+u:o.x+f-u,y:h<0?o.y-u:o.y+u}:d={x:c<0?o.x-u:o.x+u,y:h<0?o.y-f+u:o.y+f-u}}else F.debug("Corner point skipping fixing",Math.abs(n.x-a.x),Math.abs(n.y-a.y));r.push(d,l)}else r.push(e[i]);return r},"fixCorners"),rk=p((e,t,r)=>{const i=e-t-r,a=2,n=2,s=a+n,o=Math.floor(i/s),l=Array(o).fill(`${a} ${n}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),ik=p(function(e,t,r,i,a,n,s,o=!1){const{handDrawnSeed:l}=dt();let c=t.points,h=!1;const u=a;var d=n;const f=[];for(const B in t.cssCompiledStyles)pu(B)||f.push(t.cssCompiledStyles[B]);F.debug("UIO intersect check",t.points,d.x,u.x),d.intersect&&u.intersect&&!o&&(c=c.slice(1,t.points.length-1),c.unshift(u.intersect(c[0])),F.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],d,d.intersect(c[c.length-1])),c.push(d.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(F.info("to cluster abc88",r.get(t.toCluster)),c=Ol(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(F.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=Ol(c.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let m=c.filter(B=>!Number.isNaN(B.y));m=ek(m);let y=qi;switch(y=Bn,t.curve){case"linear":y=Bn;break;case"basis":y=qi;break;case"cardinal":y=rc;break;case"bumpX":y=Ec;break;case"bumpY":y=$c;break;case"catmullRom":y=ec;break;case"monotoneX":y=tc;break;case"monotoneY":y=Jl;break;case"natural":y=Ql;break;case"step":y=Kl;break;case"stepAfter":y=Zl;break;case"stepBefore":y=Xl;break;default:y=qi}const{x,y:b}=ex(t),k=sg().x(x).y(b).curve(y);let v;switch(t.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-invisible";break;default:v="edge-thickness-normal"}switch(t.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break;default:v+=" edge-pattern-solid"}let w,L=t.curve==="rounded"?Nf(zf(m,t),5):k(m);const T=Array.isArray(t.style)?t.style:[t.style];let D=T.find(B=>B?.startsWith("stroke:")),I=!1;if(t.look==="handDrawn"){const B=j.svg(e);Object.assign([],m);const A=B.path(L,{roughness:.3,seed:l});v+=" transition",w=ht(A).select("path").attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")).attr("style",T?T.reduce(($,M)=>$+";"+M,""):"");let _=w.attr("d");w.attr("d",_),e.node().appendChild(w.node())}else{const B=f.join(";"),A=T?T.reduce((J,Z)=>J+Z+";",""):"";let _="";t.animate&&(_=" edge-animation-fast"),t.animation&&(_=" edge-animation-"+t.animation);const $=(B?B+";"+A+";":A)+";"+(T?T.reduce((J,Z)=>J+";"+Z,""):"");w=e.append("path").attr("d",L).attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")+(_??"")).attr("style",$),D=$.match(/stroke:([^;]+)/)?.[1],I=t.animate===!0||!!t.animation||B.includes("animation");const M=w.node(),q=typeof M.getTotalLength=="function"?M.getTotalLength():0,V=Qo[t.arrowTypeStart]||0,K=Qo[t.arrowTypeEnd]||0;if(t.look==="neo"&&!I){const Z=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?rk(q,V,K):`0 ${V} ${q-V-K} ${K}`}; stroke-dashoffset: 0;`;w.attr("style",Z+w.attr("style"))}}w.attr("data-edge",!0),w.attr("data-et","edge"),w.attr("data-id",t.id),w.attr("data-points",g),t.showPoints&&m.forEach(B=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",B.x).attr("cy",B.y)});let O="";(dt().flowchart.arrowMarkerAbsolute||dt().state.arrowMarkerAbsolute)&&(O=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,O=O.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),F.info("arrowTypeStart",t.arrowTypeStart),F.info("arrowTypeEnd",t.arrowTypeEnd),X2(w,t,O,s,i,D);const E=Math.floor(c.length/2),N=c[E];oe.isLabelCoordinateInPath(N,w.attr("d"))||(h=!0);let R={};return h&&(R.updatedPath=c),R.originalPath=t.points,R},"insertEdge");function Nf(e,t){if(e.length<2)return"";let r="";const i=e.length,a=1e-5;for(let n=0;n({...a}));if(e.length>=2&&Dt[t.arrowTypeStart]){const a=Dt[t.arrowTypeStart],n=e[0],s=e[1],{angle:o}=us(n,s),l=a*Math.cos(o),c=a*Math.sin(o);r[0].x=n.x+l,r[0].y=n.y+c}const i=e.length;if(i>=2&&Dt[t.arrowTypeEnd]){const a=Dt[t.arrowTypeEnd],n=e[i-1],s=e[i-2],{angle:o}=us(s,n),l=a*Math.cos(o),c=a*Math.sin(o);r[i-1].x=n.x-l,r[i-1].y=n.y-c}return r}p(zf,"applyMarkerOffsetsToPoints");var ak=p((e,t,r,i)=>{t.forEach(a=>{Ck[a](e,r,i)})},"insertMarkers"),nk=p((e,t,r)=>{F.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),sk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),ok=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),lk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),ck=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),hk=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),uk=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),dk=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),fk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),pk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),gk=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),a.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),mk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),yk=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),a.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),xk=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 - L20,10 - M20,10 - L0,20`)},"requirement_arrow"),bk=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Ck={extension:nk,composition:sk,aggregation:ok,dependency:lk,lollipop:ck,point:hk,circle:uk,cross:dk,barb:fk,only_one:pk,zero_or_one:gk,one_or_more:mk,zero_or_more:yk,requirement_arrow:xk,requirement_contains:bk},kk=ak,wk={common:Mr,getConfig:Ot,insertCluster:M2,insertEdge:ik,insertEdgeLabel:K2,insertMarkers:kk,insertNode:If,interpolateToCurve:qs,labelHelper:it,log:F,positionEdgeLabel:Q2},mi={},Wf=p(e=>{for(const t of e)mi[t.name]=t},"registerLayoutLoaders"),vk=p(()=>{Wf([{name:"dagre",loader:p(async()=>await pt(()=>import("./dagre-6UL2VRFP-Btl9zFEK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),"loader")},{name:"cose-bilkent",loader:p(async()=>await pt(()=>import("./cose-bilkent-S5V4N54A-AyIH2MZ_.js"),__vite__mapDeps([13,14,8,6,7,9,12,10,11]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");vk();var rT=p(async(e,t)=>{if(!(e.layoutAlgorithm in mi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=mi[e.layoutAlgorithm];return(await r.loader()).render(e,t,wk,{algorithm:r.algorithm})},"render"),iT=p((e="",{fallback:t="dagre"}={})=>{if(e in mi)return e;if(t in mi)return F.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),qf="comm",Hf="rule",jf="decl",Sk="@import",Tk="@namespace",_k="@keyframes",Bk="@layer",Yf=Math.abs,lo=String.fromCharCode;function Uf(e){return e.trim()}function Ji(e,t,r){return e.replace(t,r)}function Lk(e,t,r){return e.indexOf(t,r)}function wr(e,t){return e.charCodeAt(t)|0}function Lr(e,t,r){return e.slice(t,r)}function ye(e){return e.length}function Ak(e){return e.length}function Wi(e,t){return t.push(e),e}var Xa=1,Ar=1,Gf=0,te=0,vt=0,Or="";function co(e,t,r,i,a,n,s,o){return{value:e,root:t,parent:r,type:i,props:a,children:n,line:Xa,column:Ar,length:s,return:"",siblings:o}}function Mk(){return vt}function Ek(){return vt=te>0?wr(Or,--te):0,Ar--,vt===10&&(Ar=1,Xa--),vt}function ce(){return vt=te2||yi(vt)>3?"":" "}function Ok(e,t){for(;--t&&ce()&&!(vt<48||vt>102||vt>57&&vt<65||vt>70&&vt<97););return Za(e,ta()+(t<6&&Ie()==32&&ce()==32))}function ds(e){for(;ce();)switch(vt){case e:return te;case 34:case 39:e!==34&&e!==39&&ds(vt);break;case 40:e===41&&ds(e);break;case 92:ce();break}return te}function Rk(e,t){for(;ce()&&e+vt!==57;)if(e+vt===84&&Ie()===47)break;return"/*"+Za(t,te-1)+"*"+lo(e===47?e:ce())}function Ik(e){for(;!yi(Ie());)ce();return Za(e,te)}function Pk(e){return Fk(ea("",null,null,null,[""],e=$k(e),0,[0],e))}function ea(e,t,r,i,a,n,s,o,l){for(var c=0,h=0,u=s,d=0,f=0,g=0,m=1,y=1,x=1,b=0,k="",v=a,w=n,L=i,T=k;y;)switch(g=b,b=ce()){case 40:if(g!=108&&wr(T,u-1)==58){Lk(T+=Ji(Tn(b),"&","&\f"),"&\f",Yf(c?o[c-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:T+=Tn(b);break;case 9:case 10:case 13:case 32:T+=Dk(g);break;case 92:T+=Ok(ta()-1,7);continue;case 47:switch(Ie()){case 42:case 47:Wi(Nk(Rk(ce(),ta()),t,r,l),l),(yi(g||1)==5||yi(Ie()||1)==5)&&ye(T)&&Lr(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*m:o[c++]=ye(T)*x;case 125*m:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+h:x==-1&&(T=Ji(T,/\f/g,"")),f>0&&(ye(T)-u||m===0&&g===47)&&Wi(f>32?Pl(T+";",i,r,u-1,l):Pl(Ji(T," ","")+";",i,r,u-2,l),l);break;case 59:T+=";";default:if(Wi(L=Il(T,t,r,c,h,a,o,k,v=[],w=[],u,n),n),b===123)if(h===0)ea(T,t,L,L,v,n,u,o,w);else{switch(d){case 99:if(wr(T,3)===110)break;case 108:if(wr(T,2)===97)break;default:h=0;case 100:case 109:case 115:}h?ea(e,L,L,i&&Wi(Il(e,L,L,0,0,a,o,k,a,v=[],u,w),w),a,w,u,o,i?v:w):ea(T,L,L,L,[""],w,0,o,w)}}c=h=f=0,m=x=1,k=T="",u=s;break;case 58:u=1+ye(T),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Ek()==125)continue}switch(T+=lo(b),b*m){case 38:x=h>0?1:(T+="\f",-1);break;case 44:o[c++]=(ye(T)-1)*x,x=1;break;case 64:Ie()===45&&(T+=Tn(ce())),d=Ie(),h=u=ye(k=T+=Ik(ta())),b++;break;case 45:g===45&&ye(T)==2&&(m=0)}}return n}function Il(e,t,r,i,a,n,s,o,l,c,h,u){for(var d=a-1,f=a===0?n:[""],g=Ak(f),m=0,y=0,x=0;m0?f[b]+" "+k:Ji(k,/&\f/g,f[b])))&&(l[x++]=v);return co(e,t,r,a===0?Hf:o,l,c,h,u)}function Nk(e,t,r,i){return co(e,t,r,qf,lo(Mk()),Lr(e,2,-2),0,i)}function Pl(e,t,r,i,a){return co(e,t,r,jf,Lr(e,0,i),Lr(e,i+1,-1),i,a)}function fs(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),rw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-CT6IHYx9.js");return{diagram:t}},__vite__mapDeps([15,16,12,6,7,8,9,10,11]),import.meta.url);return{id:Vf,diagram:e}},"loader"),iw={id:Vf,detector:ew,loader:rw},aw=iw,Xf="flowchart",nw=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),sw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-DElR_B5J.js");return{diagram:t}},__vite__mapDeps([17,18,19,12,20,21,6,7,8,9,10,11]),import.meta.url);return{id:Xf,diagram:e}},"loader"),ow={id:Xf,detector:nw,loader:sw},lw=ow,Zf="flowchart-v2",cw=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),hw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-DElR_B5J.js");return{diagram:t}},__vite__mapDeps([17,18,19,12,20,21,6,7,8,9,10,11]),import.meta.url);return{id:Zf,diagram:e}},"loader"),uw={id:Zf,detector:cw,loader:hw},dw=uw,Kf="er",fw=p(e=>/^\s*erDiagram/.test(e),"detector"),pw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-DqmHcY0h.js");return{diagram:t}},__vite__mapDeps([22,19,12,20,21,6,7,8,9,10,11]),import.meta.url);return{id:Kf,diagram:e}},"loader"),gw={id:Kf,detector:fw,loader:pw},mw=gw,Qf="gitGraph",yw=p(e=>/^\s*gitGraph/.test(e),"detector"),xw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX-BnrtNi3E.js");return{diagram:t}},__vite__mapDeps([23,24,25,26,6,7,4,2,12,8,9,10,11]),import.meta.url);return{id:Qf,diagram:e}},"loader"),bw={id:Qf,detector:yw,loader:xw},Cw=bw,Jf="gantt",kw=p(e=>/^\s*gantt/.test(e),"detector"),ww=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-B-_v82D_.js");return{diagram:t}},__vite__mapDeps([27,8,6,7,9,28,10,29,30,31,12,11]),import.meta.url);return{id:Jf,diagram:e}},"loader"),vw={id:Jf,detector:kw,loader:ww},Sw=vw,tp="info",Tw=p(e=>/^\s*info/.test(e),"detector"),_w=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./infoDiagram-WHAUD3N6-Oq8a6cr3.js");return{diagram:t}},__vite__mapDeps([32,26,6,7,4,2,8,9,10,11,12]),import.meta.url);return{id:tp,diagram:e}},"loader"),Bw={id:tp,detector:Tw,loader:_w},ep="pie",Lw=p(e=>/^\s*pie/.test(e),"detector"),Aw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-Bo5-NHZs.js");return{diagram:t}},__vite__mapDeps([33,24,26,6,7,4,2,34,10,35,30,8,9,11,12]),import.meta.url);return{id:ep,diagram:e}},"loader"),Mw={id:ep,detector:Lw,loader:Aw},rp="quadrantChart",Ew=p(e=>/^\s*quadrantChart/.test(e),"detector"),$w=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-Cs64x-qg.js");return{diagram:t}},__vite__mapDeps([36,29,10,30,31,12,6,7,8,9,11]),import.meta.url);return{id:rp,diagram:e}},"loader"),Fw={id:rp,detector:Ew,loader:$w},Dw=Fw,ip="xychart",Ow=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Rw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-Bu9EaIWj.js");return{diagram:t}},__vite__mapDeps([37,30,35,38,29,10,31,6,7,8,9,11,12]),import.meta.url);return{id:ip,diagram:e}},"loader"),Iw={id:ip,detector:Ow,loader:Rw},Pw=Iw,ap="requirement",Nw=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),zw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-DBVFUt9Y.js");return{diagram:t}},__vite__mapDeps([39,19,12,20,6,7,8,9,10,11]),import.meta.url);return{id:ap,diagram:e}},"loader"),Ww={id:ap,detector:Nw,loader:zw},qw=Ww,np="sequence",Hw=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),jw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-C17NbP5x.js");return{diagram:t}},__vite__mapDeps([40,16,25,12,6,7,8,9,10,11]),import.meta.url);return{id:np,diagram:e}},"loader"),Yw={id:np,detector:Hw,loader:jw},Uw=Yw,sp="class",Gw=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Vw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BXSbpGZa.js");return{diagram:t}},__vite__mapDeps([41,42,18,19,12,20,6,7,8,9,10,11]),import.meta.url);return{id:sp,diagram:e}},"loader"),Xw={id:sp,detector:Gw,loader:Vw},Zw=Xw,op="classDiagram",Kw=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),Qw=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BXSbpGZa.js");return{diagram:t}},__vite__mapDeps([43,42,18,19,12,20,6,7,8,9,10,11]),import.meta.url);return{id:op,diagram:e}},"loader"),Jw={id:op,detector:Kw,loader:Qw},tv=Jw,lp="state",ev=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),rv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-CHpWYG-h.js");return{diagram:t}},__vite__mapDeps([44,45,19,12,20,1,2,3,4,10,6,7,8,9,11]),import.meta.url);return{id:lp,diagram:e}},"loader"),iv={id:lp,detector:ev,loader:rv},av=iv,cp="stateDiagram",nv=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-CWiaQQ2u.js");return{diagram:t}},__vite__mapDeps([46,45,19,12,20,6,7,8,9,10,11]),import.meta.url);return{id:cp,diagram:e}},"loader"),ov={id:cp,detector:nv,loader:sv},lv=ov,hp="journey",cv=p(e=>/^\s*journey/.test(e),"detector"),hv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-B9TRQ9Y6.js");return{diagram:t}},__vite__mapDeps([47,16,18,12,34,10,6,7,8,9,11]),import.meta.url);return{id:hp,diagram:e}},"loader"),uv={id:hp,detector:cv,loader:hv},dv=uv,fv=p((e,t,r)=>{F.debug(`rendering svg for syntax error -`);const i=Gy(t),a=i.append("g");i.attr("viewBox","0 0 2412 512"),Sc(i,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),up={draw:fv},pv=up,gv={db:{},renderer:up,parser:{parse:p(()=>{},"parse")}},mv=gv,dp="flowchart-elk",yv=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),xv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-DElR_B5J.js");return{diagram:t}},__vite__mapDeps([17,18,19,12,20,21,6,7,8,9,10,11]),import.meta.url);return{id:dp,diagram:e}},"loader"),bv={id:dp,detector:yv,loader:xv},Cv=bv,fp="timeline",kv=p(e=>/^\s*timeline/.test(e),"detector"),wv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-DlFV8OnV.js");return{diagram:t}},__vite__mapDeps([48,12,34,10,6,7,8,9,11]),import.meta.url);return{id:fp,diagram:e}},"loader"),vv={id:fp,detector:kv,loader:wv},Sv=vv,pp="mindmap",Tv=p(e=>/^\s*mindmap/.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-BIKD_8An.js");return{diagram:t}},__vite__mapDeps([49,19,12,20,6,7,8,9,10,11]),import.meta.url);return{id:pp,diagram:e}},"loader"),Bv={id:pp,detector:Tv,loader:_v},Lv=Bv,gp="kanban",Av=p(e=>/^\s*kanban/.test(e),"detector"),Mv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-CGGJDAWR.js");return{diagram:t}},__vite__mapDeps([50,18,6,7,8,9,10,11,12]),import.meta.url);return{id:gp,diagram:e}},"loader"),Ev={id:gp,detector:Av,loader:Mv},$v=Ev,mp="sankey",Fv=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Dv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-Cmk6HWvP.js");return{diagram:t}},__vite__mapDeps([51,35,30,52,12,6,7,8,9,10,11]),import.meta.url);return{id:mp,diagram:e}},"loader"),Ov={id:mp,detector:Fv,loader:Dv},Rv=Ov,yp="packet",Iv=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),Pv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-DWalJcdR.js");return{diagram:t}},__vite__mapDeps([53,24,26,6,7,4,2,8,9,10,11,12]),import.meta.url);return{id:yp,diagram:e}},"loader"),Nv={id:yp,detector:Iv,loader:Pv},xp="radar",zv=p(e=>/^\s*radar-beta/.test(e),"detector"),Wv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-CH0Hw6Ub.js");return{diagram:t}},__vite__mapDeps([54,24,26,6,7,4,2,8,9,10,11,12]),import.meta.url);return{id:xp,diagram:e}},"loader"),qv={id:xp,detector:zv,loader:Wv},bp="block",Hv=p(e=>/^\s*block(-beta)?/.test(e),"detector"),jv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-B07cvJHo.js");return{diagram:t}},__vite__mapDeps([55,18,5,1,2,21,12,10,6,7,8,9,11]),import.meta.url);return{id:bp,diagram:e}},"loader"),Yv={id:bp,detector:Hv,loader:jv},Uv=Yv,Cp="architecture",Gv=p(e=>/^\s*architecture/.test(e),"detector"),Vv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-B1panAnW.js");return{diagram:t}},__vite__mapDeps([56,24,26,6,7,4,2,14,8,9,12,10,11]),import.meta.url);return{id:Cp,diagram:e}},"loader"),Xv={id:Cp,detector:Gv,loader:Vv},Zv=Xv,kp="treemap",Kv=p(e=>/^\s*treemap/.test(e),"detector"),Qv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-Bwe0eN86.js");return{diagram:t}},__vite__mapDeps([57,20,24,26,6,7,4,2,31,35,30,58,12,8,9,10,11]),import.meta.url);return{id:kp,diagram:e}},"loader"),Jv={id:kp,detector:Kv,loader:Qv},Yl=!1,Ka=p(()=>{Yl||(Yl=!0,sa("error",mv,e=>e.toLowerCase().trim()==="error"),sa("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),En(Cv,Lv,Zv),En(aw,$v,tv,Zw,mw,Sw,Bw,Mw,qw,Uw,dw,lw,Sv,Cw,lv,av,dv,Dw,Rv,Nv,Pw,Uv,qv,Jv))},"addDiagrams"),tS=p(async()=>{F.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(er).map(async([r,{detector:i,loader:a}])=>{if(a)try{On(r)}catch{try{const{diagram:n,id:s}=await a();sa(s,n,i)}catch(n){throw F.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete er[r],n}}}))).filter(r=>r.status==="rejected");if(t.length>0){F.error(`Failed to load ${t.length} external diagrams`);for(const r of t)F.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),eS="graphics-document document";function wp(e,t){e.attr("role",eS),t!==""&&e.attr("aria-roledescription",t)}p(wp,"setA11yDiagramInfo");function vp(e,t,r,i){if(e.insert!==void 0){if(r){const a=`chart-desc-${i}`;e.attr("aria-describedby",a),e.insert("desc",":first-child").attr("id",a).text(r)}if(t){const a=`chart-title-${i}`;e.attr("aria-labelledby",a),e.insert("title",":first-child").attr("id",a).text(t)}}}p(vp,"addSVGa11yTitleDescription");var xs=class Sp{constructor(t,r,i,a,n){this.type=t,this.text=r,this.db=i,this.parser=a,this.renderer=n}static{p(this,"Diagram")}static async fromText(t,r={}){const i=Ot(),a=ks(t,i);t=J1(t)+` -`;try{On(a)}catch{const c=Yg(a);if(!c)throw new dc(`Diagram ${a} not found.`);const{id:h,diagram:u}=await c();sa(h,u)}const{db:n,parser:s,renderer:o,init:l}=On(a);return s.parser&&(s.parser.yy=n),n.clear?.(),l?.(i),r.title&&n.setDiagramTitle?.(r.title),await s.parse(t),new Sp(a,t,n,s,o)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},Ul=[],rS=p(()=>{Ul.forEach(e=>{e()}),Ul=[]},"attachFunctions"),iS=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Tp(e){const t=e.match(uc);if(!t)return{text:e,metadata:{}};let r=tx(t[1],{schema:J0})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}p(Tp,"extractFrontMatter");var aS=p(e=>e.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),nS=p(e=>{const{text:t,metadata:r}=Tp(e),{displayMode:i,title:a,config:n={}}=r;return i&&(n.gantt||(n.gantt={}),n.gantt.displayMode=i),{title:a,config:n,text:t}},"processFrontmatter"),sS=p(e=>{const t=oe.detectInit(e)??{},r=oe.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:z1(e),directive:t}},"processDirectives");function ho(e){const t=aS(e),r=nS(t),i=sS(r.text),a=Gs(r.config,i.directive);return e=iS(i.text),{code:e,title:r.title,config:a}}p(ho,"preprocessDiagram");function _p(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(_p,"toBase64");var oS=5e4,lS="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",cS="sandbox",hS="loose",uS="http://www.w3.org/2000/svg",dS="http://www.w3.org/1999/xlink",fS="http://www.w3.org/1999/xhtml",pS="100%",gS="100%",mS="border:0;margin:0;",yS="margin:0",xS="allow-top-navigation-by-user-activation allow-popups",bS='The "iframe" tag is not supported by your browser.',CS=["foreignobject"],kS=["dominant-baseline"];function uo(e){const t=ho(e);return aa(),om(t.config??{}),t}p(uo,"processAndSetConfigs");async function Bp(e,t){Ka();try{const{code:r,config:i}=uo(e);return{diagramType:(await Ap(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(Bp,"parse");var Gl=p((e,t,r=[])=>` -.${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),wS=p((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=` -${e.themeCSS}`),e.fontFamily!==void 0&&(r+=` -:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=` -:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const s=e.htmlLabels??e.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(o=>{jl(o.styles)||s.forEach(l=>{r+=Gl(o.id,l,o.styles)}),jl(o.textStyles)||(r+=Gl(o.id,"tspan",(o?.textStyles||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),vS=p((e,t,r,i)=>{const a=wS(e,r),n=Bm(t,a,e.themeVariables);return fs(Pk(`${i}{${n}}`),zk)},"createUserStyles"),SS=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=hr(i),i=i.replace(/
                /g,"
                "),i},"cleanUpSvgCode"),TS=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":gS,i=_p(`${e}`);return``},"putIntoIFrame"),Vl=p((e,t,r,i,a)=>{const n=e.append("div");n.attr("id",r),i&&n.attr("style",i);const s=n.append("svg").attr("id",t).attr("width","100%").attr("xmlns",uS);return a&&s.attr("xmlns:xlink",a),s.append("g"),e},"appendDivSvgG");function bs(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(bs,"sandboxedIframe");var _S=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),BS=p(async function(e,t,r){Ka();const i=uo(t);t=i.code;const a=Ot();F.debug(a),t.length>(a?.maxTextSize??oS)&&(t=lS);const n="#"+e,s="i"+e,o="#"+s,l="d"+e,c="#"+l,h=p(()=>{const R=ht(d?o:c).node();R&&"remove"in R&&R.remove()},"removeTempElements");let u=ht("body");const d=a.securityLevel===cS,f=a.securityLevel===hS,g=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),d){const N=bs(ht(r),s);u=ht(N.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ht(r);Vl(u,e,l,`font-family: ${g}`,dS)}else{if(_S(document,e,l,s),d){const N=bs(ht("body"),s);u=ht(N.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ht("body");Vl(u,e,l)}let m,y;try{m=await xs.fromText(t,{title:i.title})}catch(N){if(a.suppressErrorRendering)throw h(),N;m=await xs.fromText("error"),y=N}const x=u.select(c).node(),b=m.type,k=x.firstChild,v=k.firstChild,w=m.renderer.getClasses?.(t,m),L=vS(a,b,w,n),T=document.createElement("style");T.innerHTML=L,k.insertBefore(T,v);try{await m.renderer.draw(t,e,$o.version,m)}catch(N){throw a.suppressErrorRendering?h():pv.draw(t,e,$o.version),N}const D=u.select(`${c} svg`),I=m.db.getAccTitle?.(),O=m.db.getAccDescription?.();Mp(b,D,I,O),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",fS);let E=u.select(c).node().innerHTML;if(F.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),E=SS(E,d,Lt(a.arrowMarkerAbsolute)),d){const N=u.select(c+" svg").node();E=TS(E,N)}else f||(E=vr.sanitize(E,{ADD_TAGS:CS,ADD_ATTR:kS,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(rS(),y)throw y;return h(),{diagramType:b,svg:E,bindFunctions:m.db.bindFunctions}},"render");function Lp(e={}){const t=_t({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),nm(t),t?.theme&&t.theme in Ae?t.themeVariables=Ae[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Ae.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?am(t):yc();Cs(r.logLevel),Ka()}p(Lp,"initialize");var Ap=p((e,t={})=>{const{code:r}=ho(e);return xs.fromText(r,t)},"getDiagramFromText");function Mp(e,t,r,i){wp(t,e),vp(t,r,i,t.attr("id"))}p(Mp,"addA11yInfo");var sr=Object.freeze({render:BS,parse:Bp,getDiagramFromText:Ap,initialize:Lp,getConfig:Ot,setConfig:xc,getSiteConfig:yc,updateSiteConfig:sm,reset:p(()=>{aa()},"reset"),globalReset:p(()=>{aa(Sr)},"globalReset"),defaultConfig:Sr});Cs(Ot().logLevel);aa(Ot());var LS=p((e,t,r)=>{F.warn(e),Us(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Ep=p(async function(e={querySelector:".mermaid"}){try{await AS(e)}catch(t){if(Us(t)&&F.error(t.str),Fe.parseError&&Fe.parseError(t),!e.suppressErrors)throw F.error("Use the suppressErrors option to suppress these errors"),t}},"run"),AS=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=sr.getConfig();F.debug(`${e?"":"No "}Callback function found`);let a;if(r)a=r;else if(t)a=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");F.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(F.debug("Start On Load: "+i?.startOnLoad),sr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const n=new oe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const o=[];for(const l of Array.from(a)){if(F.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${n.next()}`;s=l.innerHTML,s=Zu(oe.entityDecode(s)).trim().replace(//gi,"
                ");const h=oe.detectInit(s);h&&F.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:d}=await Op(c,s,l);l.innerHTML=u,e&&await e(c),d&&d(l)}catch(u){LS(u,o,Fe.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),$p=p(function(e){sr.initialize(e)},"initialize"),MS=p(async function(e,t,r){F.warn("mermaid.init is deprecated. Please use run instead."),e&&$p(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Ep(i)},"init"),ES=p(async(e,{lazyLoad:t=!0}={})=>{Ka(),En(...e),t===!1&&await tS()},"registerExternalDiagrams"),Fp=p(function(){if(Fe.startOnLoad){const{startOnLoad:e}=sr.getConfig();e&&Fe.run().catch(t=>F.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Fp,!1);var $S=p(function(e){Fe.parseError=e},"setParseErrorHandler"),Ba=[],_n=!1,Dp=p(async()=>{if(!_n){for(_n=!0;Ba.length>0;){const e=Ba.shift();if(e)try{await e()}catch(t){F.error("Error executing queue",t)}}_n=!1}},"executeQueue"),FS=p(async(e,t)=>new Promise((r,i)=>{const a=p(()=>new Promise((n,s)=>{sr.parse(e,t).then(o=>{n(o),r(o)},o=>{F.error("Error parsing",o),Fe.parseError?.(o),s(o),i(o)})}),"performCall");Ba.push(a),Dp().catch(i)}),"parse"),Op=p((e,t,r)=>new Promise((i,a)=>{const n=p(()=>new Promise((s,o)=>{sr.render(e,t,r).then(l=>{s(l),i(l)},l=>{F.error("Error parsing",l),Fe.parseError?.(l),o(l),a(l)})}),"performCall");Ba.push(n),Dp().catch(a)}),"render"),DS=p(()=>Object.keys(er).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Fe={startOnLoad:!0,mermaidAPI:sr,parse:FS,render:Op,init:MS,run:Ep,registerExternalDiagrams:ES,registerLayoutLoaders:Wf,initialize:$p,parseError:void 0,contentLoaded:Fp,setParseErrorHandler:$S,detectType:ks,registerIconPacks:i2,getRegisteredDiagramsMetadata:DS},OS=Fe;const aT=Object.freeze(Object.defineProperty({__proto__:null,default:OS},Symbol.toStringTag,{value:"Module"}));export{M2 as $,ii as A,gg as B,xe as C,Rm as D,Gs as E,mc as F,Ot as G,Y1 as H,Gy as I,J0 as J,$o as K,Kg as L,Tr as M,qS as N,Wa as O,mm as P,ws as Q,jo as R,j1 as S,Sm as T,st as U,xi as V,H as W,et as X,Tc as Y,R1 as Z,p as _,Mm as a,ms as a$,If as a0,tT as a1,ex as a2,Lt as a3,He as a4,Is as a5,ld as a6,hr as a7,Du as a8,U as a9,Ze as aA,n1 as aB,ul as aC,or as aD,mb as aE,zs as aF,fb as aG,bb as aH,Fr as aI,c1 as aJ,$1 as aK,Sb as aL,T1 as aM,Ps as aN,jl as aO,$r as aP,m1 as aQ,jk as aR,ki as aS,ga as aT,qe as aU,Ra as aV,sl as aW,Ws as aX,ku as aY,Tu as aZ,ub as a_,pu as aa,n2 as ab,kk as ac,JS as ad,eT as ae,KS as af,G as ag,QS as ah,ik as ai,Q2 as aj,K2 as ak,WS as al,za as am,ma as an,Lu as ao,Si as ap,i2 as aq,r2 as ar,pg as as,h1 as at,_u as au,bu as av,pb as aw,fa as ax,gb as ay,wi as az,Am as b,E1 as b0,S1 as b1,F1 as b2,Ns as b3,O1 as b4,aT as b5,dt as c,Sc as d,_t as e,$e as f,$m as g,Jt as h,ox as i,Mr as j,Ru as k,F as l,bi as m,HS as n,iT as o,Fm as p,Dm as q,rT as r,Em as s,tx as t,oe as u,V2 as v,V1 as w,YS as x,Lm as y,jS as z}; diff --git a/assets/meshUboDeclaration-BeSl_gjF.js b/assets/meshUboDeclaration-BeSl_gjF.js deleted file mode 100644 index 9d7de07949fdf334a40775065ecacb714b1e0588..0000000000000000000000000000000000000000 --- a/assets/meshUboDeclaration-BeSl_gjF.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="meshUboDeclaration",s=`struct Mesh {world : mat4x4, -visibility : f32,};var mesh : Mesh; -#define WORLD_UBO -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=s); diff --git a/assets/meshUboDeclaration-D9O4n0us.js b/assets/meshUboDeclaration-D9O4n0us.js deleted file mode 100644 index 1da6699a434f13beff96e0389ab16454f216ea34..0000000000000000000000000000000000000000 --- a/assets/meshUboDeclaration-D9O4n0us.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";const e="meshUboDeclaration",i=`#ifdef WEBGL2 -uniform mat4 world;uniform float visibility; -#else -layout(std140,column_major) uniform;uniform Mesh -{mat4 world;float visibility;}; -#endif -#define WORLD_UBO -`;o.IncludesShadersStore[e]||(o.IncludesShadersStore[e]=i); diff --git a/assets/min-Rtq3U8dQ.js b/assets/min-Rtq3U8dQ.js deleted file mode 100644 index 375c581acf9692dff15d206eb861f20dcb7e8753..0000000000000000000000000000000000000000 --- a/assets/min-Rtq3U8dQ.js +++ /dev/null @@ -1 +0,0 @@ -import{b as m,a as b,c as d,d as h,i as l}from"./_baseUniq-BFKEI0vc.js";import{am as o,an as g,ao as p}from"./mermaid.core-BcqUqpnI.js";function M(a){var n=a==null?0:a.length;return n?m(a):[]}function v(a,n){var s=-1,t=o(a)?Array(a.length):[];return b(a,function(f,i,e){t[++s]=n(f,i,e)}),t}function k(a,n){var s=g(a)?h:v;return s(a,d(n))}function x(a,n){return a"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$=crypto.getRandomValues.bind(crypto)}return $(me)}const _e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:_e};function be(e,r,i){if(ie.randomUUID&&!e)return ie.randomUUID();e=e||{};const l=e.random??e.rng?.()??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,ye(l)}var W=(function(){var e=c(function(L,n,t,o){for(t=t||{},o=L.length;o--;t[L[o]]=n);return t},"o"),r=[1,4],i=[1,13],l=[1,12],p=[1,15],h=[1,16],f=[1,20],E=[1,19],u=[6,7,8],z=[1,26],X=[1,24],Y=[1,25],b=[6,7,11],q=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],I=[1,6,7,11,13,15,16,19,22],M={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:c(function(n,t,o,a,g,s,C){var d=s.length-1;switch(g){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",s[d].id),a.addNode(s[d-1].length,s[d].id,s[d].descr,s[d].type);break;case 16:a.getLogger().trace("Icon: ",s[d]),a.decorateNode({icon:s[d]});break;case 17:case 21:a.decorateNode({class:s[d]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",s[d].id),a.addNode(0,s[d].id,s[d].descr,s[d].type);break;case 20:a.decorateNode({icon:s[d]});break;case 25:a.getLogger().trace("node found ..",s[d-2]),this.$={id:s[d-1],descr:s[d-1],type:a.getType(s[d-2],s[d])};break;case 26:this.$={id:s[d],descr:s[d],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",s[d-3]),this.$={id:s[d-3],descr:s[d-1],type:a.getType(s[d-2],s[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:r},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:r},{6:i,7:[1,10],9:9,12:11,13:l,14:14,15:p,16:h,17:17,18:18,19:f,22:E},e(u,[2,3]),{1:[2,2]},e(u,[2,4]),e(u,[2,5]),{1:[2,6],6:i,12:21,13:l,14:14,15:p,16:h,17:17,18:18,19:f,22:E},{6:i,9:22,12:11,13:l,14:14,15:p,16:h,17:17,18:18,19:f,22:E},{6:z,7:X,10:23,11:Y},e(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:E}),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,23]),e(b,[2,24]),e(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:z,7:X,10:32,11:Y},{1:[2,7],6:i,12:21,13:l,14:14,15:p,16:h,17:17,18:18,19:f,22:E},e(q,[2,14],{7:J,11:K}),e(I,[2,8]),e(I,[2,9]),e(I,[2,10]),e(b,[2,15]),e(b,[2,16]),e(b,[2,17]),{20:[1,35]},{21:[1,36]},e(q,[2,13],{7:J,11:K}),e(I,[2,11]),e(I,[2,12]),{21:[1,37]},e(b,[2,25]),e(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(n,t){if(t.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=t,o}},"parseError"),parse:c(function(n){var t=this,o=[0],a=[],g=[null],s=[],C=this.table,d="",w=0,Q=0,se=2,Z=1,re=s.slice.call(arguments,1),y=Object.create(this.lexer),x={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(x.yy[F]=this.yy[F]);y.setInput(n,x.yy),x.yy.lexer=y,x.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var B=y.yylloc;s.push(B);var oe=y.options&&y.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(S){o.length=o.length-2*S,g.length=g.length-S,s.length=s.length-S}c(ae,"popStack");function ee(){var S;return S=a.pop()||y.lex()||Z,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=t.symbols_[S]||S),S}c(ee,"lex");for(var _,v,D,j,T={},A,N,te,U;;){if(v=o[o.length-1],this.defaultActions[v]?D=this.defaultActions[v]:((_===null||typeof _>"u")&&(_=ee()),D=C[v]&&C[v][_]),typeof D>"u"||!D.length||!D[0]){var G="";U=[];for(A in C[v])this.terminals_[A]&&A>se&&U.push("'"+this.terminals_[A]+"'");y.showPosition?G="Parse error on line "+(w+1)+`: -`+y.showPosition()+` -Expecting `+U.join(", ")+", got '"+(this.terminals_[_]||_)+"'":G="Parse error on line "+(w+1)+": Unexpected "+(_==Z?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(G,{text:y.match,token:this.terminals_[_]||_,line:y.yylineno,loc:B,expected:U})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+_);switch(D[0]){case 1:o.push(_),g.push(y.yytext),s.push(y.yylloc),o.push(D[1]),_=null,Q=y.yyleng,d=y.yytext,w=y.yylineno,B=y.yylloc;break;case 2:if(N=this.productions_[D[1]][1],T.$=g[g.length-N],T._$={first_line:s[s.length-(N||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(N||1)].first_column,last_column:s[s.length-1].last_column},oe&&(T._$.range=[s[s.length-(N||1)].range[0],s[s.length-1].range[1]]),j=this.performAction.apply(T,[d,Q,w,x.yy,D[1],g,s].concat(re)),typeof j<"u")return j;N&&(o=o.slice(0,-1*N*2),g=g.slice(0,-1*N),s=s.slice(0,-1*N)),o.push(this.productions_[D[1]][0]),g.push(T.$),s.push(T._$),te=C[o[o.length-2]][o[o.length-1]],o.push(te);break;case 3:return!0}}return!0},"parse")},ne=(function(){var L={EOF:1,parseError:c(function(t,o){if(this.yy.parser)this.yy.parser.parseError(t,o);else throw new Error(t)},"parseError"),setInput:c(function(n,t){return this.yy=t||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var t=n.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:c(function(n){var t=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===a.length?this.yylloc.first_column:0)+a[a.length-o.length].length-o[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(n){this.unput(this.match.slice(n))},"less"),pastInput:c(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+` -`+t+"^"},"showPosition"),test_match:c(function(n,t){var o,a,g;if(this.options.backtrack_lexer&&(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(g.yylloc.range=this.yylloc.range.slice(0))),a=n[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var s in g)this[s]=g[s];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,t,o,a;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),s=0;st[0].length)){if(t=o,a=s,this.options.backtrack_lexer){if(n=this.test_match(o,g[s]),n!==!1)return n;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(n=this.test_match(t,g[a]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var t=this.next();return t||this.lex()},"lex"),begin:c(function(t){this.conditionStack.push(t)},"begin"),popState:c(function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:c(function(t){this.begin(t)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(t,o,a,g){switch(a){case 0:return t.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 35:return t.getLogger().trace("Long description:",o.yytext),20;case 36:return t.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return L})();M.lexer=ne;function R(){this.yy={}}return c(R,"Parser"),R.prototype=M,M.Parser=R,new R})();W.parser=W;var Se=W,k={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},De=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=k,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{c(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,i,l){O.info("addNode",e,r,i,l);let p=!1;this.nodes.length===0?(this.baseLevel=e,e=0,p=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,p=!1);const h=H();let f=h.mindmap?.padding??V.mindmap.padding;switch(l){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}const E={id:this.count++,nodeId:P(r,h),level:e,descr:P(i,h),type:l,children:[],width:h.mindmap?.maxNodeWidth??V.mindmap.maxNodeWidth,padding:f,isRoot:p},u=this.getParent(e);if(u)u.children.push(E),this.nodes.push(E);else if(p)this.nodes.push(E);else throw new Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,r){switch(O.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=H(),i=this.nodes[this.nodes.length-1];e.icon&&(i.icon=P(e.icon,r)),e.class&&(i.class=P(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[i,l]of e.children.entries()){const p=e.level===0?i:r;this.assignSections(l,p)}}flattenNodes(e,r){const i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const l=i.join(" "),p=c(f=>{switch(f){case k.CIRCLE:return"mindmapCircle";case k.RECT:return"rect";case k.ROUNDED_RECT:return"rounded";case k.CLOUD:return"cloud";case k.BANG:return"bang";case k.HEXAGON:return"hexagon";case k.DEFAULT:return"defaultMindmapNode";case k.NO_BORDER:default:return"rect"}},"getShapeFromType"),h={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,isGroup:!1,shape:p(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:l,cssStyles:[],look:"default",icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(h),e.children)for(const f of e.children)this.flattenNodes(f,r)}generateEdges(e,r){if(e.children)for(const i of e.children){let l="edge";i.section!==void 0&&(l+=` section-edge-${i.section}`);const p=e.level+1;l+=` edge-depth-${p}`;const h={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:l,depth:e.level,section:i.section};r.push(h),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=H(),l=ge().layout!==void 0,p=r;if(l||(p.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:p};O.debug("getData: mindmapRoot",e,r),this.assignSections(e);const h=[],f=[];this.flattenNodes(e,h),this.generateEdges(e,f),O.debug(`getData: processed ${h.length} nodes and ${f.length} edges`);const E=new Map;for(const u of h)E.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:h,edges:f,config:p,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+be()}}getLogger(){return O}},Ne=c(async(e,r,i,l)=>{O.debug(`Rendering mindmap diagram -`+e);const p=l.db,h=p.getData(),f=ce(r,h.config.securityLevel);h.type=l.type,h.layoutAlgorithm=he(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=r,p.getMindmap()&&(h.nodes.forEach(u=>{u.shape==="rounded"?(u.radius=15,u.taper=15,u.stroke="none",u.width=0,u.padding=15):u.shape==="circle"?u.padding=10:u.shape==="rect"&&(u.width=0,u.padding=10)}),await de(h,f),le(f,h.config.mindmap?.padding??V.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??V.mindmap.useMaxWidth))},"draw"),ke={draw:Ne},Le=c(e=>{let r="";for(let i=0;i` - .edge { - stroke-width: 3; - } - ${Le(e)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${e.git0}; - } - .section-root text { - fill: ${e.gitBranchLabel0}; - } - .section-root span { - color: ${e.gitBranchLabel0}; - } - .section-2 span { - color: ${e.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .mindmap-node-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; - } -`,"getStyles"),ve=xe,Pe={get db(){return new De},renderer:ke,parser:Se,styles:ve};export{Pe as diagram}; diff --git a/assets/misc-Dkc5KZ-v.js b/assets/misc-Dkc5KZ-v.js deleted file mode 100644 index a65a951937abe7fc2c2409c195fc250f56b01fb2..0000000000000000000000000000000000000000 --- a/assets/misc-Dkc5KZ-v.js +++ /dev/null @@ -1 +0,0 @@ -import{W as t}from"./index-DydPgVMC.js";function b(e,r){var a=e.$$events?.[r.type],l=t(a)?a.slice():a==null?[]:[a];for(var s of l)s.call(this,r)}export{b}; diff --git a/assets/morphTargetsVertex-CUt9TeiZ.js b/assets/morphTargetsVertex-CUt9TeiZ.js deleted file mode 100644 index c091f2854e90205c5a29691d42d3abec021be640..0000000000000000000000000000000000000000 --- a/assets/morphTargetsVertex-CUt9TeiZ.js +++ /dev/null @@ -1,101 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="morphTargetsVertexGlobalDeclaration",T=`#ifdef MORPHTARGETS -uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS]; -#ifdef MORPHTARGETS_TEXTURE -uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex) -{ -float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;} -vec4 readVector4FromRawSampler(int targetIndex,float vertexIndex) -{ -float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV);} -#endif -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=T);const t="morphTargetsVertexDeclaration",o=`#ifdef MORPHTARGETS -#ifndef MORPHTARGETS_TEXTURE -#ifdef MORPHTARGETS_POSITION -attribute vec3 position{X}; -#endif -#ifdef MORPHTARGETS_NORMAL -attribute vec3 normal{X}; -#endif -#ifdef MORPHTARGETS_TANGENT -attribute vec3 tangent{X}; -#endif -#ifdef MORPHTARGETS_UV -attribute vec2 uv_{X}; -#endif -#ifdef MORPHTARGETS_UV2 -attribute vec2 uv2_{X}; -#endif -#ifdef MORPHTARGETS_COLOR -attribute vec4 color{X}; -#endif -#elif {X}==0 -uniform float morphTargetCount; -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=o);const f="morphTargetsVertexGlobal",a=`#ifdef MORPHTARGETS -#ifdef MORPHTARGETS_TEXTURE -float vertexID; -#endif -#endif -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=a);const n="morphTargetsVertex",d=`#ifdef MORPHTARGETS -#ifdef MORPHTARGETS_TEXTURE -#if {X}==0 -for (int i=0; i=morphTargetCount) break;vertexID=float(gl_VertexID)*morphTargetTextureInfo.x; -#ifdef MORPHTARGETS_POSITION -positionUpdated+=(readVector3FromRawSampler(i,vertexID)-position)*morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASPOSITIONS -vertexID+=1.0; -#endif -#ifdef MORPHTARGETS_NORMAL -normalUpdated+=(readVector3FromRawSampler(i,vertexID) -normal)*morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASNORMALS -vertexID+=1.0; -#endif -#ifdef MORPHTARGETS_UV -uvUpdated+=(readVector3FromRawSampler(i,vertexID).xy-uv)*morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASUVS -vertexID+=1.0; -#endif -#ifdef MORPHTARGETS_TANGENT -tangentUpdated.xyz+=(readVector3FromRawSampler(i,vertexID) -tangent.xyz)*morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASTANGENTS -vertexID+=1.0; -#endif -#ifdef MORPHTARGETS_UV2 -uv2Updated+=(readVector3FromRawSampler(i,vertexID).xy-uv2)*morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASUV2S -vertexID+=1.0; -#endif -#ifdef MORPHTARGETS_COLOR -colorUpdated+=(readVector4FromRawSampler(i,vertexID)-color)*morphTargetInfluences[i]; -#endif -} -#endif -#else -#ifdef MORPHTARGETS_POSITION -positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_NORMAL -normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_TANGENT -tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_UV -uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_UV2 -uv2Updated+=(uv2_{X}-uv2)*morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_COLOR -colorUpdated+=(color{X}-color)*morphTargetInfluences[{X}]; -#endif -#endif -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=d); diff --git a/assets/morphTargetsVertex-W8O8GW2p.js b/assets/morphTargetsVertex-W8O8GW2p.js deleted file mode 100644 index df72d36f25e8a0a6ef67104d7e772c7f7d12e5be..0000000000000000000000000000000000000000 --- a/assets/morphTargetsVertex-W8O8GW2p.js +++ /dev/null @@ -1,64 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="morphTargetsVertexGlobal",n=`#ifdef MORPHTARGETS -#ifdef MORPHTARGETS_TEXTURE -var vertexID : f32; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=n);const r="morphTargetsVertex",d=`#ifdef MORPHTARGETS -#ifdef MORPHTARGETS_TEXTURE -#if {X}==0 -for (var i=0; i=uniforms.morphTargetCount) {break;} -vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x; -#ifdef MORPHTARGETS_POSITION -positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASPOSITIONS -vertexID=vertexID+1.0; -#endif -#ifdef MORPHTARGETS_NORMAL -normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASNORMALS -vertexID=vertexID+1.0; -#endif -#ifdef MORPHTARGETS_UV -uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETTEXTURE_HASUVS -vertexID=vertexID+1.0; -#endif -#ifdef MORPHTARGETS_TANGENT -tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a); -#endif -#ifdef MORPHTARGETTEXTURE_HASTANGENTS -vertexID=vertexID+1.0; -#endif -#ifdef MORPHTARGETS_UV2 -uv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv2)*uniforms.morphTargetInfluences[i]; -#endif -#ifdef MORPHTARGETS_COLOR -colorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vertexInputs.color)*uniforms.morphTargetInfluences[i]; -#endif -} -#endif -#else -#ifdef MORPHTARGETS_POSITION -positionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_NORMAL -normalUpdated=normalUpdated+(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_TANGENT -tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a); -#endif -#ifdef MORPHTARGETS_UV -uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_UV2 -uv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vertexInputs.uv2)*uniforms.morphTargetInfluences[{X}]; -#endif -#ifdef MORPHTARGETS_COLOR -colorUpdated=colorUpdated+(vertexInputs.color{X}-vertexInputs.color)*uniforms.morphTargetInfluences[{X}]; -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=d); diff --git a/assets/morphTargetsVertexDeclaration-BFlkwWcP.js b/assets/morphTargetsVertexDeclaration-BFlkwWcP.js deleted file mode 100644 index db8dad80d251e7a5c054583e8424728996399754..0000000000000000000000000000000000000000 --- a/assets/morphTargetsVertexDeclaration-BFlkwWcP.js +++ /dev/null @@ -1,36 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="morphTargetsVertexGlobalDeclaration",f=`#ifdef MORPHTARGETS -uniform morphTargetInfluences : array; -#ifdef MORPHTARGETS_TEXTURE -uniform morphTargetTextureIndices : array;uniform morphTargetTextureInfo : vec3;var morphTargets : texture_2d_array;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3 -{ -let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;} -fn readVector4FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec4 -{ -let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0);} -#endif -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=f);const t="morphTargetsVertexDeclaration",o=`#ifdef MORPHTARGETS -#ifndef MORPHTARGETS_TEXTURE -#ifdef MORPHTARGETS_POSITION -attribute position{X} : vec3; -#endif -#ifdef MORPHTARGETS_NORMAL -attribute normal{X} : vec3; -#endif -#ifdef MORPHTARGETS_TANGENT -attribute tangent{X} : vec3; -#endif -#ifdef MORPHTARGETS_UV -attribute uv_{X} : vec2; -#endif -#ifdef MORPHTARGETS_UV2 -attribute uv2_{X} : vec2; -#endif -#ifdef MORPHTARGETS_COLOR -attribute color{X} : vec4; -#endif -#elif {X}==0 -uniform morphTargetCount: f32; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=o); diff --git a/assets/objFileLoader-19PyG2YL.js b/assets/objFileLoader-19PyG2YL.js deleted file mode 100644 index 9cc593134bc941ba5ce62a8fc97e224af4cf7918..0000000000000000000000000000000000000000 --- a/assets/objFileLoader-19PyG2YL.js +++ /dev/null @@ -1,3 +0,0 @@ -import{C as b,T as j,b9 as M,J as B,V as w,ah as V,L,bp as P,l as v,m as E,bq as C,d as x,ax as D}from"./index-GY9JDBGV.js";import{A}from"./assetContainer-X8dc1NDD.js";import{S as T}from"./standardMaterial-Dw51Jj3C.js";import"./index-DydPgVMC.js";class f{constructor(){this.materials=[]}parseMTL(t,n,i,o){if(n instanceof ArrayBuffer)return;const l=n.split(` -`),h=/\s+/;let _,a=null;for(let c=0;c=0?r.substring(0,s):r;e=e.toLowerCase();const p=s>=0?r.substring(s+1).trim():"";if(e==="newmtl")a&&this.materials.push(a),t._blockEntityCollection=!!o,a=new T(p,t),a._parentContainer=o,t._blockEntityCollection=!1;else if(e==="kd"&&a)_=p.split(h,3).map(parseFloat),a.diffuseColor=b.FromArray(_);else if(e==="ka"&&a)_=p.split(h,3).map(parseFloat),a.ambientColor=b.FromArray(_);else if(e==="ks"&&a)_=p.split(h,3).map(parseFloat),a.specularColor=b.FromArray(_);else if(e==="ke"&&a)_=p.split(h,3).map(parseFloat),a.emissiveColor=b.FromArray(_);else if(e==="ns"&&a)a.specularPower=parseFloat(p);else if(e==="d"&&a)a.alpha=parseFloat(p);else if(e==="map_ka"&&a)a.ambientTexture=f._GetTexture(i,p,t);else if(e==="map_kd"&&a)a.diffuseTexture=f._GetTexture(i,p,t);else if(e==="map_ks"&&a)a.specularTexture=f._GetTexture(i,p,t);else if(e!=="map_ns")if(e==="map_bump"&&a){const d=p.split(h),F=d.indexOf("-bm");let g=null;F>=0&&(g=d[F+1],d.splice(F,2)),a.bumpTexture=f._GetTexture(i,d.join(" "),t),a.bumpTexture&&g!==null&&(a.bumpTexture.level=parseFloat(g))}else e==="map_d"&&a&&(a.opacityTexture=f._GetTexture(i,p,t))}a&&this.materials.push(a)}static _GetTexture(t,n,i){if(!n)return null;let o=t;if(t==="file:"){let l=n.lastIndexOf("\\");l===-1&&(l=n.lastIndexOf("/")),l>-1?o+=n.substring(l+1):o+=n}else o+=n;return new j(o,i,!1,f.INVERT_TEXTURE_Y)}}f.INVERT_TEXTURE_Y=!0;class m{constructor(t,n,i){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new M(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=t,this._babylonMeshesArray=n,this._loadingOptions=i}_isInArray(t,n){t[n[0]]||(t[n[0]]={normals:[],idx:[]});const i=t[n[0]].normals.indexOf(n[1]);return i===-1?-1:t[n[0]].idx[i]}_isInArrayUV(t,n){t[n[0]]||(t[n[0]]={normals:[],idx:[],uv:[]});const i=t[n[0]].normals.indexOf(n[1]);return i!=1&&n[2]===t[n[0]].uv[i]?t[n[0]].idx[i]:-1}_setData(t){t.indiceUvsFromObj??(t.indiceUvsFromObj=-1),t.indiceNormalFromObj??(t.indiceNormalFromObj=-1);let n;this._loadingOptions.optimizeWithUV?n=this._isInArrayUV(this._tuplePosNorm,[t.indicePositionFromObj,t.indiceNormalFromObj,t.indiceUvsFromObj]):n=this._isInArray(this._tuplePosNorm,[t.indicePositionFromObj,t.indiceNormalFromObj]),n===-1?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(t.positionVectorFromOBJ),t.textureVectorFromOBJ!==void 0&&this._wrappedUvsForBabylon.push(t.textureVectorFromOBJ),t.normalsVectorFromOBJ!==void 0&&this._wrappedNormalsForBabylon.push(t.normalsVectorFromOBJ),t.positionColorsFromOBJ!==void 0&&this._wrappedColorsForBabylon.push(t.positionColorsFromOBJ),this._tuplePosNorm[t.indicePositionFromObj].normals.push(t.indiceNormalFromObj),this._tuplePosNorm[t.indicePositionFromObj].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[t.indicePositionFromObj].uv.push(t.indiceUvsFromObj)):this._indicesForBabylon.push(n)}_unwrapData(){try{for(let t=0;t0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice()),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon.slice()),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._handledMesh.hasLines=this._hasLineData,this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)}_optimizeNormals(t){const n=t.getVerticesData(B.PositionKind),i=t.getVerticesData(B.NormalKind),o={};if(!n||!i)return;for(let h=0;hthis._triangles.push(r[0],r[s],r[s+1]),this._handednessSign=1):i.useRightHandedSystem?(this._pushTriangle=(r,s)=>this._triangles.push(r[0],r[s+1],r[s]),this._handednessSign=1):(this._pushTriangle=(r,s)=>this._triangles.push(r[0],r[s],r[s+1]),this._handednessSign=-1);const h=n.split(` -`),_=[];let a=[];_.push(a);for(let r=0;r=7){const p=parseFloat(e[4]),d=parseFloat(e[5]),F=parseFloat(e[6]);this._colors.push(new M(p>1?p/255:p,d>1?d/255:d,F>1?F/255:F,e.length===7||e[7]===void 0?1:parseFloat(e[7])))}else this._colors.push(this._grayColor)}else if((e=m.NormalPattern.exec(s))!==null)this._normals.push(new w(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])));else if((e=m.UVPattern.exec(s))!==null)this._uvs.push(new V(parseFloat(e[1])*this._loadingOptions.UVScaling.x,parseFloat(e[2])*this._loadingOptions.UVScaling.y));else if((e=m.FacePattern3.exec(s))!==null)this._setDataForCurrentFaceWithPattern3(e[1].trim().split(" "),1);else if((e=m.FacePattern4.exec(s))!==null)this._setDataForCurrentFaceWithPattern4(e[1].trim().split(" "),1);else if((e=m.FacePattern5.exec(s))!==null)this._setDataForCurrentFaceWithPattern5(e[1].trim().split(" "),1);else if((e=m.FacePattern2.exec(s))!==null)this._setDataForCurrentFaceWithPattern2(e[1].trim().split(" "),1);else if((e=m.FacePattern1.exec(s))!==null)this._setDataForCurrentFaceWithPattern1(e[1].trim().split(" "),1);else if((e=m.LinePattern1.exec(s))!==null)this._setDataForCurrentFaceWithPattern1(e[1].trim().split(" "),0),this._hasLineData=!0;else if((e=m.LinePattern2.exec(s))!==null)this._setDataForCurrentFaceWithPattern2(e[1].trim().split(" "),0),this._hasLineData=!0;else if(e=m._GetZbrushMRGB(s,!this._loadingOptions.importVertexColors))for(const p of e)this._extColors.push(p);else if((e=m.LinePattern3.exec(s))!==null)this._setDataForCurrentFaceWithPattern3(e[1].trim().split(" "),0),this._hasLineData=!0;else if(m.GroupDescriptor.test(s)||m.ObjectDescriptor.test(s)){const p={name:s.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:m.ObjectDescriptor.test(s)};this._addPreviousObjMesh(),this._meshesFromObj.push(p),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(m.UseMtlDescriptor.test(s)){if(this._materialNameFromObj=s.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const p={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1};this._increment++,this._meshesFromObj.push(p),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else m.MtlLibGroupDescriptor.test(s)?l(s.substring(7).trim()):m.SmoothDescriptor.test(s)||L.Log("Unhandled expression at line : "+s)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon),this._handledMesh.hasLines=this._hasLineData),!this._hasMeshes){let r=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(const s of this._positions)this._unwrappedPositionsForBabylon.push(s.x,s.y,s.z);if(this._normals.length)for(const s of this._normals)this._unwrappedNormalsForBabylon.push(s.x,s.y,s.z);if(this._uvs.length)for(const s of this._uvs)this._unwrappedUVForBabylon.push(s.x,s.y);if(this._extColors.length)for(const s of this._extColors)this._unwrappedColorsForBabylon.push(s.r,s.g,s.b,s.a);else if(this._colors.length)for(const s of this._colors)this._unwrappedColorsForBabylon.push(s.r,s.g,s.b,s.a);this._materialNameFromObj||(r=new T(P.RandomId(),i),r.pointsCloud=!0,this._materialNameFromObj=r.name,this._normals.length||(r.disableLighting=!0,r.emissiveColor=b.White()))}this._meshesFromObj.push({name:P.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:r,isObject:!0,hasLines:this._hasLineData})}for(let r=0;r=0;--p)if(this._meshesFromObj[p].isObject&&this._meshesFromObj[p]._babylonMesh){s.parent=this._meshesFromObj[p]._babylonMesh;break}}if(this._materialToUse.push(this._meshesFromObj[r].materialName),this._handledMesh.hasLines&&(s._internalMetadata??(s._internalMetadata={}),s._internalMetadata._isLine=!0),this._handledMesh.positions?.length===0){this._babylonMeshesArray.push(s);continue}const e=new E;if(e.indices=this._handledMesh.indices,e.positions=this._handledMesh.positions,this._loadingOptions.computeNormals||!this._handledMesh.normals){const p=new Array;E.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,p),e.normals=p}else e.normals=this._handledMesh.normals;this._handledMesh.uvs&&(e.uvs=this._handledMesh.uvs),this._handledMesh.colors&&(e.colors=this._handledMesh.colors),e.applyToMesh(s),this._loadingOptions.invertY&&(s.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(s),this._babylonMeshesArray.push(s),this._handledMesh.directMaterial&&(s.material=this._handledMesh.directMaterial)}}}m.ObjectDescriptor=/^o/;m.GroupDescriptor=/^g/;m.MtlLibGroupDescriptor=/^mtllib /;m.UseMtlDescriptor=/^usemtl /;m.SmoothDescriptor=/^s /;m.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/;m.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;m.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;m.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/;m.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;m.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;m.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;m.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;m.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/;m.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;m.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;class u{static get INVERT_TEXTURE_Y(){return f.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(t){f.INVERT_TEXTURE_Y=t}constructor(t){this.name=C.name,this.extensions=C.extensions,this._assetContainer=null,this._loadingOptions={...u._DefaultLoadingOptions,...t??{}}}static get _DefaultLoadingOptions(){return{computeNormals:u.COMPUTE_NORMALS,optimizeNormals:u.OPTIMIZE_NORMALS,importVertexColors:u.IMPORT_VERTEX_COLORS,invertY:u.INVERT_Y,invertTextureY:u.INVERT_TEXTURE_Y,UVScaling:u.UV_SCALING,materialLoadingFailsSilently:u.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:u.OPTIMIZE_WITH_UV,skipMaterials:u.SKIP_MATERIALS,useLegacyBehavior:u.USE_LEGACY_BEHAVIOR}}_loadMTL(t,n,i,o){const l=n+t;x.LoadFile(l,i,void 0,void 0,!1,(h,_)=>{o(l,_)})}createPlugin(t){return new u(t[C.name])}canDirectLoad(){return!1}importMeshAsync(t,n,i,o){return this._parseSolidAsync(t,n,i,o).then(l=>({meshes:l,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}loadAsync(t,n,i){return this.importMeshAsync(null,t,n,i).then(()=>{})}loadAssetContainerAsync(t,n,i){const o=new A(t);return this._assetContainer=o,this.importMeshAsync(null,t,n,i).then(l=>(l.meshes.forEach(h=>o.meshes.push(h)),l.meshes.forEach(h=>{const _=h.material;_&&o.materials.indexOf(_)==-1&&(o.materials.push(_),_.getActiveTextures().forEach(c=>{o.textures.indexOf(c)==-1&&o.textures.push(c)}))}),this._assetContainer=null,o)).catch(l=>{throw this._assetContainer=null,l})}_parseSolidAsync(t,n,i,o){let l="";const h=new f,_=[],a=[];i=i.replace(/#.*$/gm,"").trim(),new m(_,a,this._loadingOptions).parse(t,i,n,this._assetContainer,s=>{l=s});const r=[];return l!==""&&!this._loadingOptions.skipMaterials&&r.push(new Promise((s,e)=>{this._loadMTL(l,o,p=>{try{h.parseMTL(n,p,o,this._assetContainer);for(let d=0;d-1;)g.push(y),F=y+1;if(y===-1&&g.length===0)h.materials[d].dispose();else for(let O=0;O{x.Warn(`Error downloading MTL file: '${l}'`),this._loadingOptions.materialLoadingFailsSilently?s():e(d)})})),Promise.all(r).then(()=>{const s=e=>!!(e._internalMetadata?._isLine??!1);return a.forEach(e=>{if(s(e)){let p=e.material??new T(e.name+"_line",n);p.getBindedMeshes().filter(F=>!s(F)).length>0&&(p=p.clone(p.name+"_line")??p),p.wireframe=!0,e.material=p,e._internalMetadata&&(e._internalMetadata._isLine=void 0)}}),a})}}u.OPTIMIZE_WITH_UV=!0;u.INVERT_Y=!1;u.IMPORT_VERTEX_COLORS=!1;u.COMPUTE_NORMALS=!1;u.OPTIMIZE_NORMALS=!1;u.UV_SCALING=new V(1,1);u.SKIP_MATERIALS=!1;u.MATERIAL_LOADING_FAILS_SILENTLY=!0;u.USE_LEGACY_BEHAVIOR=!1;D(new u);export{u as OBJFileLoader}; diff --git a/assets/objectModelMapping-CpTIXcMS.js b/assets/objectModelMapping-CpTIXcMS.js deleted file mode 100644 index a0b6b26c8e49af31dcf8b23b5952df9e0ef7e172..0000000000000000000000000000000000000000 --- a/assets/objectModelMapping-CpTIXcMS.js +++ /dev/null @@ -1 +0,0 @@ -import{bk as d,M as l,V as h,aI as L,T as P,an as j,_ as m,s as f,ad as C,R as N,ah as y,ao as b,b9 as R,aK as M}from"./index-GY9JDBGV.js";j.AddNodeConstructor("Light_Type_2",(e,t)=>()=>new a(e,h.Zero(),h.Zero(),0,0,t));class a extends d{get iesProfileTexture(){return this._iesProfileTexture}set iesProfileTexture(t){this._iesProfileTexture!==t&&(this._iesProfileTexture=t,this._iesProfileTexture&&a._IsTexture(this._iesProfileTexture)&&this._iesProfileTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()}))}get angle(){return this._angle}set angle(t){this._angle=t,this._cosHalfAngle=Math.cos(t*.5),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()}get innerAngle(){return this._innerAngle}set innerAngle(t){this._innerAngle=t,this._computeAngleValues()}get shadowAngleScale(){return this._shadowAngleScale}set shadowAngleScale(t){this._shadowAngleScale=t,this.forceProjectionMatrixCompute()}get projectionTextureMatrix(){return this._projectionTextureMatrix}get projectionTextureLightNear(){return this._projectionTextureLightNear}set projectionTextureLightNear(t){this._projectionTextureLightNear=t,this._projectionTextureProjectionLightDirty=!0}get projectionTextureLightFar(){return this._projectionTextureLightFar}set projectionTextureLightFar(t){this._projectionTextureLightFar=t,this._projectionTextureProjectionLightDirty=!0}get projectionTextureUpDirection(){return this._projectionTextureUpDirection}set projectionTextureUpDirection(t){this._projectionTextureUpDirection=t,this._projectionTextureProjectionLightDirty=!0}get projectionTexture(){return this._projectionTexture}set projectionTexture(t){this._projectionTexture!==t&&(this._projectionTexture=t,this._projectionTextureDirty=!0,this._projectionTexture&&!this._projectionTexture.isReady()&&(a._IsProceduralTexture(this._projectionTexture)?this._projectionTexture.getEffect().executeWhenCompiled(()=>{this._markMeshesAsLightDirty()}):a._IsTexture(this._projectionTexture)&&this._projectionTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()})))}static _IsProceduralTexture(t){return t.onGeneratedObservable!==void 0}static _IsTexture(t){return t.onLoadObservable!==void 0}get projectionTextureProjectionLightMatrix(){return this._projectionTextureProjectionLightMatrix}set projectionTextureProjectionLightMatrix(t){this._projectionTextureProjectionLightMatrix=t,this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0}constructor(t,r,i,n,s,u,_){super(t,u,_),this._innerAngle=0,this._iesProfileTexture=null,this._projectionTextureMatrix=l.Zero(),this._projectionTextureLightNear=1e-6,this._projectionTextureLightFar=1e3,this._projectionTextureUpDirection=h.Up(),this._projectionTextureViewLightDirty=!0,this._projectionTextureProjectionLightDirty=!0,this._projectionTextureDirty=!0,this._projectionTextureViewTargetVector=h.Zero(),this._projectionTextureViewLightMatrix=l.Zero(),this._projectionTextureProjectionLightMatrix=l.Zero(),this._projectionTextureScalingMatrix=l.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),this.position=r,this.direction=i,this.angle=n,this.exponent=s}getClassName(){return"SpotLight"}getTypeID(){return L.LIGHTTYPEID_SPOTLIGHT}_setDirection(t){super._setDirection(t),this._projectionTextureViewLightDirty=!0}_setPosition(t){super._setPosition(t),this._projectionTextureViewLightDirty=!0}_setDefaultShadowProjectionMatrix(t,r,i){const n=this.getScene().activeCamera;if(!n)return;this._shadowAngleScale=this._shadowAngleScale||1;const s=this._shadowAngleScale*this._angle,u=this.shadowMinZ!==void 0?this.shadowMinZ:n.minZ,_=this.shadowMaxZ!==void 0?this.shadowMaxZ:n.maxZ,c=this.getScene().getEngine().useReverseDepthBuffer;l.PerspectiveFovLHToRef(s,1,c?_:u,c?u:_,t,!0,this._scene.getEngine().isNDCHalfZRange,void 0,c)}_computeProjectionTextureViewLightMatrix(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.getAbsolutePosition().addToRef(this.getShadowDirection(),this._projectionTextureViewTargetVector),l.LookAtLHToRef(this.getAbsolutePosition(),this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)}_computeProjectionTextureProjectionLightMatrix(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;const t=this.projectionTextureLightFar,r=this.projectionTextureLightNear,i=t/(t-r),n=-i*r,s=1/Math.tan(this._angle/2);l.FromValuesToRef(s/1,0,0,0,0,s,0,0,0,0,i,1,0,0,n,0,this._projectionTextureProjectionLightMatrix)}_computeProjectionTextureMatrix(){if(this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTexture instanceof P){const t=this._projectionTexture.uScale/2,r=this._projectionTexture.vScale/2;l.FromValuesToRef(t,0,0,0,0,r,0,0,0,0,.5,0,.5,.5,.5,1,this._projectionTextureScalingMatrix)}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeAngleValues(){this._lightAngleScale=1/Math.max(.001,Math.cos(this._innerAngle*.5)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale}transferTexturesToEffect(t,r){return this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),t.setMatrix("textureProjectionMatrix"+r,this._projectionTextureMatrix),t.setTexture("projectionLightTexture"+r,this.projectionTexture)),this._iesProfileTexture&&this._iesProfileTexture.isReady()&&t.setTexture("iesLightTexture"+r,this._iesProfileTexture),this}transferToEffect(t,r){let i;const n=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-n.x,this.transformedPosition.y-n.y,this.transformedPosition.z-n.z,this.exponent,r),i=h.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-n.x,this.position.y-n.y,this.position.z-n.z,this.exponent,r),i=h.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",i.x,i.y,i.z,this._cosHalfAngle,r),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,r),this}transferToNodeMaterialEffect(t,r){let i;return this.computeTransformedInformation()?i=h.Normalize(this.transformedDirection):i=h.Normalize(this.direction),this.getScene().useRightHandedSystem?t.setFloat3(r,-i.x,-i.y,-i.z):t.setFloat3(r,i.x,i.y,i.z),this}dispose(){super.dispose(),this._projectionTexture&&this._projectionTexture.dispose(),this._iesProfileTexture&&(this._iesProfileTexture.dispose(),this._iesProfileTexture=null)}getDepthMinZ(t){const r=this._scene.getEngine(),i=this.shadowMinZ!==void 0?this.shadowMinZ:t?.minZ??0;return r.useReverseDepthBuffer&&r.isNDCHalfZRange?i:this._scene.getEngine().isNDCHalfZRange?0:i}getDepthMaxZ(t){const r=this._scene.getEngine(),i=this.shadowMaxZ!==void 0?this.shadowMaxZ:t?.maxZ??1e4;return r.useReverseDepthBuffer&&r.isNDCHalfZRange?0:i}prepareLightSpecificDefines(t,r){t["SPOTLIGHT"+r]=!0,t["PROJECTEDLIGHTTEXTURE"+r]=!!(this.projectionTexture&&this.projectionTexture.isReady()),t["IESLIGHTTEXTURE"+r]=!!(this._iesProfileTexture&&this._iesProfileTexture.isReady())}}m([f()],a.prototype,"angle",null);m([f()],a.prototype,"innerAngle",null);m([f()],a.prototype,"shadowAngleScale",null);m([f()],a.prototype,"exponent",void 0);m([f()],a.prototype,"projectionTextureLightNear",null);m([f()],a.prototype,"projectionTextureLightFar",null);m([f()],a.prototype,"projectionTextureUpDirection",null);m([C("projectedLightTexture")],a.prototype,"_projectionTexture",void 0);N("BABYLON.SpotLight",a);const D=[{regex:new RegExp("^/nodes/\\d+/extensions/")}];class S{constructor(t,r){this._gltf=t,this._infoTree=r}convert(t){let r=this._gltf,i=this._infoTree,n;if(!t.startsWith("/"))throw new Error("Path must start with a /");const s=t.split("/");if(s.shift(),s[s.length-1].includes(".length")){const c=s[s.length-1].split(".");s.pop(),s.push(...c)}let u=!1;for(const _ of s){const c=_==="length";if(c&&!i.__array__)throw new Error(`Path ${t} is invalid`);if(i.__ignoreObjectTree__&&(u=!0),i.__array__&&!c)i=i.__array__;else if(i=i[_],!i)throw new Error(`Path ${t} is invalid`);if(!u)if(r===void 0){if(!D.find(x=>x.regex.test(t)))throw new Error(`Path ${t} is invalid`)}else c||(r=r?.[_]);(i.__target__||c)&&(n=r)}return{object:n,info:i}}}const v={length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonTransformNode),getPropertyName:[()=>"length"]},__array__:{__target__:!0,translation:{type:"Vector3",get:e=>e._babylonTransformNode?.position,set:(e,t)=>t._babylonTransformNode?.position.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"position"]},rotation:{type:"Quaternion",get:e=>e._babylonTransformNode?.rotationQuaternion,set:(e,t)=>t._babylonTransformNode?.rotationQuaternion?.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"rotationQuaternion"]},scale:{type:"Vector3",get:e=>e._babylonTransformNode?.scaling,set:(e,t)=>t._babylonTransformNode?.scaling.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"scaling"]},weights:{length:{type:"number",get:e=>e._numMorphTargets,getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},__array__:{__target__:!0,type:"number",get:(e,t)=>t!==void 0?e._primitiveBabylonMeshes?.[0].morphTargetManager?.getTarget(t).influence:void 0,getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},type:"number[]",get:(e,t)=>[0],getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},matrix:{type:"Matrix",get:e=>l.Compose(e._babylonTransformNode?.scaling,e._babylonTransformNode?.rotationQuaternion,e._babylonTransformNode?.position),getTarget:e=>e._babylonTransformNode,isReadOnly:!0},globalMatrix:{type:"Matrix",get:e=>{const t=l.Identity();let r=e.parent;for(;r&&r.parent;)r=r.parent;const i=e._babylonTransformNode?.position._isDirty||e._babylonTransformNode?.rotationQuaternion?._isDirty||e._babylonTransformNode?.scaling._isDirty;if(r){const n=r._babylonTransformNode?.computeWorldMatrix(!0).invert();n&&e._babylonTransformNode?.computeWorldMatrix(i)?.multiplyToRef(n,t)}else e._babylonTransformNode&&t.copyFrom(e._babylonTransformNode.computeWorldMatrix(i));return t},getTarget:e=>e._babylonTransformNode,isReadOnly:!0},extensions:{EXT_lights_ies:{multiplier:{type:"number",get:e=>e._babylonTransformNode?.getChildren(t=>t instanceof a,!0)[0]?.intensity,getTarget:e=>e._babylonTransformNode?.getChildren(t=>t instanceof a,!0)[0],set:(e,t)=>{if(t._babylonTransformNode){const r=t._babylonTransformNode.getChildren(i=>i instanceof a,!0)[0];r&&(r.intensity=e)}}},color:{type:"Color3",get:e=>e._babylonTransformNode?.getChildren(t=>t instanceof a,!0)[0]?.diffuse,getTarget:e=>e._babylonTransformNode?.getChildren(t=>t instanceof a,!0)[0],set:(e,t)=>{if(t._babylonTransformNode){const r=t._babylonTransformNode.getChildren(i=>i instanceof a,!0)[0];r&&(r.diffuse=e)}}}},KHR_node_visibility:{visible:{type:"boolean",get:e=>e._primitiveBabylonMeshes?e._primitiveBabylonMeshes[0].isVisible:!1,getTarget:()=>{},set:(e,t)=>{t._primitiveBabylonMeshes&&t._primitiveBabylonMeshes.forEach(r=>r.isVisible=e)}}}}}},F={length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonAnimationGroup),getPropertyName:[()=>"length"]},__array__:{}},w={length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t.primitives[0]._instanceData?.babylonSourceMesh),getPropertyName:[()=>"length"]},__array__:{}},A={__array__:{__target__:!0,orthographic:{xmag:{componentsCount:2,type:"Vector2",get:e=>new y(e._babylonCamera?.orthoLeft??0,e._babylonCamera?.orthoRight??0),set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.orthoLeft=e.x,t._babylonCamera.orthoRight=e.y)},getTarget:e=>e,getPropertyName:[()=>"orthoLeft",()=>"orthoRight"]},ymag:{componentsCount:2,type:"Vector2",get:e=>new y(e._babylonCamera?.orthoBottom??0,e._babylonCamera?.orthoTop??0),set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.orthoBottom=e.x,t._babylonCamera.orthoTop=e.y)},getTarget:e=>e,getPropertyName:[()=>"orthoBottom",()=>"orthoTop"]},zfar:{type:"number",get:e=>e._babylonCamera?.maxZ,set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:e=>e,getPropertyName:[()=>"maxZ"]},znear:{type:"number",get:e=>e._babylonCamera?.minZ,set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:e=>e,getPropertyName:[()=>"minZ"]}},perspective:{aspectRatio:{type:"number",get:e=>e._babylonCamera?.getEngine().getAspectRatio(e._babylonCamera),getTarget:e=>e,getPropertyName:[()=>"aspectRatio"],isReadOnly:!0},yfov:{type:"number",get:e=>e._babylonCamera?.fov,set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.fov=e)},getTarget:e=>e,getPropertyName:[()=>"fov"]},zfar:{type:"number",get:e=>e._babylonCamera?.maxZ,set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:e=>e,getPropertyName:[()=>"maxZ"]},znear:{type:"number",get:e=>e._babylonCamera?.minZ,set:(e,t)=>{t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:e=>e,getPropertyName:[()=>"minZ"]}}}},H={__array__:{__target__:!0,emissiveFactor:{type:"Color3",get:(e,t,r)=>o(e,t,r).emissiveColor,set:(e,t,r,i)=>o(t,r,i).emissiveColor.copyFrom(e),getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"emissiveColor"]},emissiveTexture:{extensions:{KHR_texture_transform:g("emissiveTexture")}},normalTexture:{scale:{type:"number",get:(e,t,r)=>p(e,r,"bumpTexture")?.level,set:(e,t,r,i)=>{const n=p(t,i,"bumpTexture");n&&(n.level=e)},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"level"]},extensions:{KHR_texture_transform:g("bumpTexture")}},occlusionTexture:{strength:{type:"number",get:(e,t,r)=>o(e,t,r).ambientTextureStrength,set:(e,t,r,i)=>{const n=o(t,r,i);n&&(n.ambientTextureStrength=e)},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"ambientTextureStrength"]},extensions:{KHR_texture_transform:g("ambientTexture")}},pbrMetallicRoughness:{baseColorFactor:{type:"Color4",get:(e,t,r)=>{const i=o(e,t,r);return R.FromColor3(i.albedoColor,i.alpha)},set:(e,t,r,i)=>{const n=o(t,r,i);n.albedoColor.set(e.r,e.g,e.b),n.alpha=e.a},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"albedoColor",()=>"alpha"]},baseColorTexture:{extensions:{KHR_texture_transform:g("albedoTexture")}},metallicFactor:{type:"number",get:(e,t,r)=>o(e,t,r).metallic,set:(e,t,r,i)=>{const n=o(t,r,i);n&&(n.metallic=e)},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"metallic"]},roughnessFactor:{type:"number",get:(e,t,r)=>o(e,t,r).roughness,set:(e,t,r,i)=>{const n=o(t,r,i);n&&(n.roughness=e)},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"roughness"]},metallicRoughnessTexture:{extensions:{KHR_texture_transform:g("metallicTexture")}}},extensions:{KHR_materials_anisotropy:{anisotropyStrength:{type:"number",get:(e,t,r)=>o(e,t,r).anisotropy.intensity,set:(e,t,r,i)=>{o(t,r,i).anisotropy.intensity=e},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"anisotropy.intensity"]},anisotropyRotation:{type:"number",get:(e,t,r)=>o(e,t,r).anisotropy.angle,set:(e,t,r,i)=>{o(t,r,i).anisotropy.angle=e},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"anisotropy.angle"]},anisotropyTexture:{extensions:{KHR_texture_transform:g("anisotropy","texture")}}},KHR_materials_clearcoat:{clearcoatFactor:{type:"number",get:(e,t,r)=>o(e,t,r).clearCoat.intensity,set:(e,t,r,i)=>{o(t,r,i).clearCoat.intensity=e},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"clearCoat.intensity"]},clearcoatRoughnessFactor:{type:"number",get:(e,t,r)=>o(e,t,r).clearCoat.roughness,set:(e,t,r,i)=>{o(t,r,i).clearCoat.roughness=e},getTarget:(e,t,r)=>o(e,t,r),getPropertyName:[()=>"clearCoat.roughness"]},clearcoatTexture:{extensions:{KHR_texture_transform:g("clearCoat","texture")}},clearcoatNormalTexture:{scale:{type:"number",get:(e,t,r)=>o(e,t,r).clearCoat.bumpTexture?.level,getTarget:o,set:(e,t,r,i)=>o(t,r,i).clearCoat.bumpTexture.level=e},extensions:{KHR_texture_transform:g("clearCoat","bumpTexture")}},clearcoatRoughnessTexture:{extensions:{KHR_texture_transform:g("clearCoat","textureRoughness")}}},KHR_materials_dispersion:{dispersion:{type:"number",get:(e,t,r)=>o(e,t,r).subSurface.dispersion,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.dispersion=e}},KHR_materials_emissive_strength:{emissiveStrength:{type:"number",get:(e,t,r)=>o(e,t,r).emissiveIntensity,getTarget:o,set:(e,t,r,i)=>o(t,r,i).emissiveIntensity=e}},KHR_materials_ior:{ior:{type:"number",get:(e,t,r)=>o(e,t,r).indexOfRefraction,getTarget:o,set:(e,t,r,i)=>o(t,r,i).indexOfRefraction=e}},KHR_materials_iridescence:{iridescenceFactor:{type:"number",get:(e,t,r)=>o(e,t,r).iridescence.intensity,getTarget:o,set:(e,t,r,i)=>o(t,r,i).iridescence.intensity=e},iridescenceIor:{type:"number",get:(e,t,r)=>o(e,t,r).iridescence.indexOfRefraction,getTarget:o,set:(e,t,r,i)=>o(t,r,i).iridescence.indexOfRefraction=e},iridescenceTexture:{extensions:{KHR_texture_transform:g("iridescence","texture")}},iridescenceThicknessMaximum:{type:"number",get:(e,t,r)=>o(e,t,r).iridescence.maximumThickness,getTarget:o,set:(e,t,r,i)=>o(t,r,i).iridescence.maximumThickness=e},iridescenceThicknessMinimum:{type:"number",get:(e,t,r)=>o(e,t,r).iridescence.minimumThickness,getTarget:o,set:(e,t,r,i)=>o(t,r,i).iridescence.minimumThickness=e},iridescenceThicknessTexture:{extensions:{KHR_texture_transform:g("iridescence","thicknessTexture")}}},KHR_materials_sheen:{sheenColorFactor:{type:"Color3",get:(e,t,r)=>o(e,t,r).sheen.color,getTarget:o,set:(e,t,r,i)=>o(t,r,i).sheen.color.copyFrom(e)},sheenColorTexture:{extensions:{KHR_texture_transform:g("sheen","texture")}},sheenRoughnessFactor:{type:"number",get:(e,t,r)=>o(e,t,r).sheen.intensity,getTarget:o,set:(e,t,r,i)=>o(t,r,i).sheen.intensity=e},sheenRoughnessTexture:{extensions:{KHR_texture_transform:g("sheen","thicknessTexture")}}},KHR_materials_specular:{specularFactor:{type:"number",get:(e,t,r)=>o(e,t,r).metallicF0Factor,getTarget:o,set:(e,t,r,i)=>o(t,r,i).metallicF0Factor=e,getPropertyName:[()=>"metallicF0Factor"]},specularColorFactor:{type:"Color3",get:(e,t,r)=>o(e,t,r).metallicReflectanceColor,getTarget:o,set:(e,t,r,i)=>o(t,r,i).metallicReflectanceColor.copyFrom(e),getPropertyName:[()=>"metallicReflectanceColor"]},specularTexture:{extensions:{KHR_texture_transform:g("metallicReflectanceTexture")}},specularColorTexture:{extensions:{KHR_texture_transform:g("reflectanceTexture")}}},KHR_materials_transmission:{transmissionFactor:{type:"number",get:(e,t,r)=>o(e,t,r).subSurface.refractionIntensity,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.refractionIntensity=e,getPropertyName:[()=>"subSurface.refractionIntensity"]},transmissionTexture:{extensions:{KHR_texture_transform:g("subSurface","refractionIntensityTexture")}}},KHR_materials_diffuse_transmission:{diffuseTransmissionFactor:{type:"number",get:(e,t,r)=>o(e,t,r).subSurface.translucencyIntensity,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.translucencyIntensity=e},diffuseTransmissionTexture:{extensions:{KHR_texture_transform:g("subSurface","translucencyIntensityTexture")}},diffuseTransmissionColorFactor:{type:"Color3",get:(e,t,r)=>o(e,t,r).subSurface.translucencyColor,getTarget:o,set:(e,t,r,i)=>e&&o(t,r,i).subSurface.translucencyColor?.copyFrom(e)},diffuseTransmissionColorTexture:{extensions:{KHR_texture_transform:g("subSurface","translucencyColorTexture")}}},KHR_materials_volume:{attenuationColor:{type:"Color3",get:(e,t,r)=>o(e,t,r).subSurface.tintColor,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.tintColor.copyFrom(e)},attenuationDistance:{type:"number",get:(e,t,r)=>o(e,t,r).subSurface.tintColorAtDistance,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.tintColorAtDistance=e},thicknessFactor:{type:"number",get:(e,t,r)=>o(e,t,r).subSurface.maximumThickness,getTarget:o,set:(e,t,r,i)=>o(t,r,i).subSurface.maximumThickness=e},thicknessTexture:{extensions:{KHR_texture_transform:g("subSurface","thicknessTexture")}}}}}},Z={KHR_lights_punctual:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonLight),getPropertyName:[e=>"length"]},__array__:{__target__:!0,color:{type:"Color3",get:e=>e._babylonLight?.diffuse,set:(e,t)=>t._babylonLight?.diffuse.copyFrom(e),getTarget:e=>e._babylonLight,getPropertyName:[e=>"diffuse"]},intensity:{type:"number",get:e=>e._babylonLight?.intensity,set:(e,t)=>t._babylonLight?t._babylonLight.intensity=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"intensity"]},range:{type:"number",get:e=>e._babylonLight?.range,set:(e,t)=>t._babylonLight?t._babylonLight.range=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"range"]},spot:{innerConeAngle:{type:"number",get:e=>e._babylonLight?.innerAngle,set:(e,t)=>t._babylonLight?t._babylonLight.innerAngle=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"innerConeAngle"]},outerConeAngle:{type:"number",get:e=>e._babylonLight?.angle,set:(e,t)=>t._babylonLight?t._babylonLight.angle=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"outerConeAngle"]}}}}},EXT_lights_area:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonLight),getPropertyName:[e=>"length"]},__array__:{__target__:!0,color:{type:"Color3",get:e=>e._babylonLight?.diffuse,set:(e,t)=>t._babylonLight?.diffuse.copyFrom(e),getTarget:e=>e._babylonLight,getPropertyName:[e=>"diffuse"]},intensity:{type:"number",get:e=>e._babylonLight?.intensity,set:(e,t)=>t._babylonLight?t._babylonLight.intensity=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"intensity"]},size:{type:"number",get:e=>e._babylonLight?.height,set:(e,t)=>t._babylonLight?t._babylonLight.height=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"size"]},rect:{aspect:{type:"number",get:e=>e._babylonLight?.width/e._babylonLight?.height,set:(e,t)=>t._babylonLight?t._babylonLight.width=e*t._babylonLight.height:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"aspect"]}}}}},EXT_lights_ies:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonLight),getPropertyName:[e=>"length"]}}},EXT_lights_image_based:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(t=>t._babylonTexture),getPropertyName:[e=>"length"]},__array__:{__target__:!0,intensity:{type:"number",get:e=>e._babylonTexture?.level,set:(e,t)=>{t._babylonTexture&&(t._babylonTexture.level=e)},getTarget:e=>e._babylonTexture},rotation:{type:"Quaternion",get:e=>e._babylonTexture&&b.FromRotationMatrix(e._babylonTexture?.getReflectionTextureMatrix()),set:(e,t)=>{t._babylonTexture&&(t._babylonTexture.getScene()?.useRightHandedSystem||(e=b.Inverse(e)),l.FromQuaternionToRef(e,t._babylonTexture.getReflectionTextureMatrix()))},getTarget:e=>e._babylonTexture}}}}};function p(e,t,r,i){const n=o(e);return i?n[r][i]:n[r]}function o(e,t,r){return e._data?.[r?.fillMode??M.MATERIAL_TriangleFillMode]?.babylonMaterial}function g(e,t){return{offset:{componentsCount:2,type:"Vector2",get:(r,i,n)=>{const s=p(r,n,e,t);return new y(s?.uOffset,s?.vOffset)},getTarget:o,set:(r,i,n,s)=>{const u=p(i,s,e,t);u.uOffset=r.x,u.vOffset=r.y},getPropertyName:[()=>`${e}${t?"."+t:""}.uOffset`,()=>`${e}${t?"."+t:""}.vOffset`]},rotation:{type:"number",get:(r,i,n)=>p(r,n,e,t)?.wAng,getTarget:o,set:(r,i,n,s)=>p(i,s,e,t).wAng=r,getPropertyName:[()=>`${e}${t?"."+t:""}.wAng`]},scale:{componentsCount:2,type:"Vector2",get:(r,i,n)=>{const s=p(r,n,e,t);return new y(s?.uScale,s?.vScale)},getTarget:o,set:(r,i,n,s)=>{const u=p(i,s,e,t);u.uScale=r.x,u.vScale=r.y},getPropertyName:[()=>`${e}${t?"."+t:""}.uScale`,()=>`${e}${t?"."+t:""}.vScale`]}}}const T={cameras:A,nodes:v,materials:H,extensions:Z,animations:F,meshes:w};function E(e){return new S(e,T)}function B(e){const t=e.split("/").map(i=>i.replace(/{}/g,"__array__"));let r=T;for(const i of t)i&&(r=r[i]);if(r&&r.type&&r.get)return r}function k(e,t){const r=e.split("/").map(n=>n.replace(/{}/g,"__array__"));let i=T;for(const n of r)n&&(i=i[n]);i&&i.type&&i.get&&(i.interpolation=t)}function z(e,t){const r=e.split("/").map(n=>n.replace(/{}/g,"__array__"));let i=T;for(const n of r)if(n){if(!i[n]){if(n==="?"){i.__ignoreObjectTree__=!0;continue}i[n]={},n==="__array__"&&(i[n].__target__=!0)}i=i[n]}Object.assign(i,t)}export{z as A,E as G,k as S,a,B as b}; diff --git a/assets/oitBackBlend.fragment-CGWQGkUV.js b/assets/oitBackBlend.fragment-CGWQGkUV.js deleted file mode 100644 index 17a0234bf9b46e1a9217fb5b843573345081e457..0000000000000000000000000000000000000000 --- a/assets/oitBackBlend.fragment-CGWQGkUV.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const t="oitBackBlendPixelShader",e=`var uBackColor: texture_2d;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureLoad(uBackColor,vec2i(fragmentInputs.position.xy),0);if (fragmentOutputs.color.a==0.0) {discard;}} -`;r.ShadersStoreWGSL[t]||(r.ShadersStoreWGSL[t]=e);const n={name:t,shader:e};export{n as oitBackBlendPixelShaderWGSL}; diff --git a/assets/oitBackBlend.fragment-DTYrJeQx.js b/assets/oitBackBlend.fragment-DTYrJeQx.js deleted file mode 100644 index e2faea5202325bae2bd82e09a36144ffe4915f84..0000000000000000000000000000000000000000 --- a/assets/oitBackBlend.fragment-DTYrJeQx.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="oitBackBlendPixelShader",e=`precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { -discard;}}`;r.ShadersStore[o]||(r.ShadersStore[o]=e);const l={name:o,shader:e};export{l as oitBackBlendPixelShader}; diff --git a/assets/oitFinalSimpleBlend.fragment-J3A8bpbP.js b/assets/oitFinalSimpleBlend.fragment-J3A8bpbP.js deleted file mode 100644 index 266d518d7b13e63dfb55b980d37dba9c00352914..0000000000000000000000000000000000000000 --- a/assets/oitFinalSimpleBlend.fragment-J3A8bpbP.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const r="oitFinalSimpleBlendPixelShader",t=`var uFrontColor: texture_2d;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var frontColor: vec4f=textureLoad(uFrontColor,fragCoord,0);fragmentOutputs.color=frontColor;} -`;o.ShadersStoreWGSL[r]||(o.ShadersStoreWGSL[r]=t);const a={name:r,shader:t};export{a as oitFinalSimpleBlendPixelShaderWGSL}; diff --git a/assets/oitFinalSimpleBlend.fragment-Wu18asQB.js b/assets/oitFinalSimpleBlend.fragment-Wu18asQB.js deleted file mode 100644 index 8e36b2bf920f71dedcde3400f7f47d2581c729bb..0000000000000000000000000000000000000000 --- a/assets/oitFinalSimpleBlend.fragment-Wu18asQB.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const o="oitFinalSimpleBlendPixelShader",e=`precision highp float;uniform sampler2D uFrontColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);glFragColor=frontColor;} -`;r.ShadersStore[o]||(r.ShadersStore[o]=e);const t={name:o,shader:e};export{t as oitFinalSimpleBlendPixelShader}; diff --git a/assets/oitFragment-CXBNy3dk.js b/assets/oitFragment-CXBNy3dk.js deleted file mode 100644 index d38b6e2a8b527c1932a933d8f7c145f519f566c9..0000000000000000000000000000000000000000 --- a/assets/oitFragment-CXBNy3dk.js +++ /dev/null @@ -1,47 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="prePassDeclaration",o=`#ifdef PREPASS -#ifdef PREPASS_LOCAL_POSITION -varying vPosition : vec3f; -#endif -#ifdef PREPASS_DEPTH -varying vViewPos: vec3f; -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -varying vNormViewDepth: f32; -#endif -#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) -varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=o);const r="oitDeclaration",n=`#ifdef ORDER_INDEPENDENT_TRANSPARENCY -#define MAX_DEPTH 99999.0 -var oitDepthSamplerSampler: sampler;var oitDepthSampler: texture_2d;var oitFrontColorSamplerSampler: sampler;var oitFrontColorSampler: texture_2d; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=n);const a="depthPrePass",s=`#ifdef DEPTHPREPASS -fragmentOutputs.color= vec4f(0.,0.,0.,1.0);return fragmentOutputs; -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=s);const f="oitFragment",i=`#ifdef ORDER_INDEPENDENT_TRANSPARENCY -var fragDepth: f32=fragmentInputs.position.z; -#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS -var halfFloat: u32=pack2x16float( vec2f(fragDepth));var full: vec2f=unpack2x16float(halfFloat);fragDepth=full.x; -#endif -var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var lastDepth: vec2f=textureLoad(oitDepthSampler,fragCoord,0).rg;var lastFrontColor: vec4f=textureLoad(oitFrontColorSampler,fragCoord,0);fragmentOutputs.depth=vec2f(-MAX_DEPTH);fragmentOutputs.frontColor=lastFrontColor;fragmentOutputs.backColor= vec4f(0.0); -#ifdef USE_REVERSE_DEPTHBUFFER -var furthestDepth: f32=-lastDepth.x;var nearestDepth: f32=lastDepth.y; -#else -var nearestDepth: f32=-lastDepth.x;var furthestDepth: f32=lastDepth.y; -#endif -var alphaMultiplier: f32=1.0-lastFrontColor.a; -#ifdef USE_REVERSE_DEPTHBUFFER -if (fragDepth>nearestDepth || fragDepthfurthestDepth) { -#endif -return fragmentOutputs;} -#ifdef USE_REVERSE_DEPTHBUFFER -if (fragDepthfurthestDepth) { -#else -if (fragDepth>nearestDepth && fragDepthnearestDepth || fragDepthfurthestDepth) { -#endif -return;} -#ifdef USE_REVERSE_DEPTHBUFFER -if (fragDepthfurthestDepth) { -#else -if (fragDepth>nearestDepth && fragDepth(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor,_SAMPLERNAME_,baseColor) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness,_SAMPLERNAME_,baseMetalness) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight,_SAMPLERNAME_,specularWeight) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor,_SAMPLERNAME_,specularColor) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness,_SAMPLERNAME_,specularRoughness) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy,_SAMPLERNAME_,specularRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight,_SAMPLERNAME_,coatWeight) -#include(_DEFINENAME_,COAT_COLOR,_VARYINGNAME_,CoatColor,_SAMPLERNAME_,coatColor) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness,_SAMPLERNAME_,coatRoughness) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy,_SAMPLERNAME_,coatRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening,_SAMPLERNAME_,coatDarkening) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight,_SAMPLERNAME_,fuzzWeight) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor,_SAMPLERNAME_,fuzzColor) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness,_SAMPLERNAME_,fuzzRoughness) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity,_SAMPLERNAME_,geometryOpacity) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent,_SAMPLERNAME_,geometryTangent) -#include(_DEFINENAME_,GEOMETRY_COAT_TANGENT,_VARYINGNAME_,GeometryCoatTangent,_SAMPLERNAME_,geometryCoatTangent) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor,_SAMPLERNAME_,emissionColor) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight,_SAMPLERNAME_,thinFilmWeight) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness,_SAMPLERNAME_,thinFilmThickness) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion,_SAMPLERNAME_,ambientOcclusion) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube; -#ifdef LODBASEDMICROSFURACE -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube; -#endif -#ifdef USEIRRADIANCEMAP -var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube; -#endif -#else -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d; -#ifdef LODBASEDMICROSFURACE -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d; -#endif -#ifdef USEIRRADIANCEMAP -var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#endif -#endif -#ifdef ENVIRONMENTBRDF -var environmentBrdfSamplerSampler: sampler;var environmentBrdfSampler: texture_2d; -#endif -#ifdef FUZZENVIRONMENTBRDF -var environmentFuzzBrdfSamplerSampler: sampler;var environmentFuzzBrdfSampler: texture_2d; -#endif -#if defined(ANISOTROPIC) || defined(FUZZ) -var blueNoiseSamplerSampler: sampler;var blueNoiseSampler: texture_2d; -#endif -#ifdef IBL_CDF_FILTERING -var icdfSamplerSampler: sampler;var icdfSampler: texture_2d; -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=S);const n="openpbrNormalMapFragmentMainFunctions",h=`#if defined(GEOMETRY_NORMAL) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(FUZZ) || defined(DETAIL) -#if defined(TANGENT) && defined(NORMAL) -varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f; -#endif -#ifdef OBJECTSPACE_NORMALMAP -uniform normalMatrix: mat4x4f;fn toNormalMatrix(m: mat4x4f)->mat4x4f -{var a00=m[0][0];var a01=m[0][1];var a02=m[0][2];var a03=m[0][3];var a10=m[1][0];var a11=m[1][1];var a12=m[1][2];var a13=m[1][3];var a20=m[2][0]; -var a21=m[2][1];var a22=m[2][2];var a23=m[2][3];var a30=m[3][0]; -var a31=m[3][1];var a32=m[3][2];var a33=m[3][3];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;var mi=mat4x4( -(a11*b11-a12*b10+a13*b09)/det, -(a02*b10-a01*b11-a03*b09)/det, -(a31*b05-a32*b04+a33*b03)/det, -(a22*b04-a21*b05-a23*b03)/det, -(a12*b08-a10*b11-a13*b07)/det, -(a00*b11-a02*b08+a03*b07)/det, -(a32*b02-a30*b05-a33*b01)/det, -(a20*b05-a22*b02+a23*b01)/det, -(a10*b10-a11*b08+a13*b06)/det, -(a01*b08-a00*b10-a03*b06)/det, -(a30*b04-a31*b02+a33*b00)/det, -(a21*b02-a20*b04-a23*b00)/det, -(a11*b07-a10*b09-a12*b06)/det, -(a00*b09-a01*b07+a02*b06)/det, -(a31*b01-a30*b03-a32*b00)/det, -(a20*b03-a21*b01+a22*b00)/det);return mat4x4(mi[0][0],mi[1][0],mi[2][0],mi[3][0], -mi[0][1],mi[1][1],mi[2][1],mi[3][1], -mi[0][2],mi[1][2],mi[2][2],mi[3][2], -mi[0][3],mi[1][3],mi[2][3],mi[3][3]);} -#endif -fn perturbNormalBase(cotangentFrame: mat3x3f,normal: vec3f,scale: f32)->vec3f -{var output=normal; -#ifdef NORMALXYSCALE -output=normalize(output* vec3f(scale,scale,1.0)); -#endif -return normalize(cotangentFrame*output);} -fn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f -{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);} -fn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f -{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);} -#endif -`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=h);const i="openpbrNormalMapFragmentFunctions",R=`#if defined(GEOMETRY_NORMAL) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal,_SAMPLERNAME_,geometryNormal) -#endif -#if defined(GEOMETRY_COAT_NORMAL) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal,_SAMPLERNAME_,geometryCoatNormal) -#endif -#if defined(DETAIL) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail) -#endif -#if defined(GEOMETRY_NORMAL) && defined(PARALLAX) -const minSamples: f32=4.;const maxSamples: f32=15.;const iMaxSamples: i32=15;fn parallaxOcclusion(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32)->vec2f {var parallaxLimit: f32=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;var vOffsetDir: vec2f=normalize(vViewDirCoT.xy);var vMaxOffset: vec2f=vOffsetDir*parallaxLimit;var numSamples: f32=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));var stepSize: f32=1.0/numSamples;var currRayHeight: f32=1.0;var vCurrOffset: vec2f= vec2f(0,0);var vLastOffset: vec2f= vec2f(0,0);var lastSampledHeight: f32=1.0;var currSampledHeight: f32=1.0;var keepWorking: bool=true;for (var i: i32=0; icurrRayHeight) -{var delta1: f32=currSampledHeight-currRayHeight;var delta2: f32=(currRayHeight+stepSize)-lastSampledHeight;var ratio: f32=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;} -else -{currRayHeight-=stepSize;vLastOffset=vCurrOffset; -#ifdef PARALLAX_RHS -vCurrOffset-=stepSize*vMaxOffset; -#else -vCurrOffset+=stepSize*vMaxOffset; -#endif -lastSampledHeight=currSampledHeight;}} -return vCurrOffset;} -fn parallaxOffset(viewDir: vec3f,heightScale: f32)->vec2f -{var height: f32=textureSample(geometryNormalSampler,geometryNormalSamplerSampler,fragmentInputs.vGeometryNormalUV).w;var texCoordOffset: vec2f=heightScale*viewDir.xy*height; -#ifdef PARALLAX_RHS -return texCoordOffset; -#else -return -texCoordOffset; -#endif -} -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=R);const o="openpbrDielectricReflectance",N=`struct ReflectanceParams -{F0: f32, -F90: f32, -coloredF0: vec3f, -coloredF90: vec3f,}; -#define pbr_inline -fn dielectricReflectance( -insideIOR: f32,outsideIOR: f32,specularColor: vec3f,specularWeight: f32 -)->ReflectanceParams -{var outParams: ReflectanceParams;let dielectricF0=pow((insideIOR-outsideIOR)/(insideIOR+outsideIOR),2.0); -#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF -let maxF0=max(specularColor.r,max(specularColor.g,specularColor.b));outParams.F0=dielectricF0*maxF0*specularWeight; -#else -outParams.F0=dielectricF0*specularWeight; -#endif -let f90Scale=clamp(2.0f*abs(insideIOR-outsideIOR),0.0f,1.0f);outParams.F90=f90Scale*specularWeight;outParams.coloredF0=vec3f(dielectricF0*specularWeight)*specularColor.rgb; -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -let dielectricColorF90: vec3f=specularColor.rgb*vec3f(f90Scale)*specularWeight; -#else -let dielectricColorF90: vec3f=vec3f(f90Scale)*specularWeight; -#endif -outParams.coloredF90=dielectricColorF90;return outParams;} -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=N);const t="openpbrConductorReflectance",A=`#define pbr_inline -fn conductorReflectance(baseColor: vec3f,specularColor: vec3f,specularWeight: f32)->ReflectanceParams -{var outParams: ReflectanceParams; -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -outParams.coloredF0=baseColor*specularWeight;outParams.coloredF90=specularColor*specularWeight; -#else -outParams.coloredF0=baseColor;outParams.coloredF90=vec3f(1.0f); -#endif -outParams.F0=1.0f;outParams.F90=1.0f;return outParams;}`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=A);const f="openpbrBlockAmbientOcclusion",L=`struct ambientOcclusionOutParams -{ambientOcclusionColor: vec3f, -#if DEBUGMODE>0 && defined(AMBIENT_OCCLUSION) -ambientOcclusionColorMap: vec3f -#endif -}; -#define pbr_inline -fn ambientOcclusionBlock( -#ifdef AMBIENT_OCCLUSION -ambientOcclusionColorMap_: vec3f, -ambientInfos: vec2f -#endif -)->ambientOcclusionOutParams -{ -var outParams: ambientOcclusionOutParams;var ambientOcclusionColor: vec3f= vec3f(1.,1.,1.); -#ifdef AMBIENT_OCCLUSION -var ambientOcclusionColorMap: vec3f=ambientOcclusionColorMap_*ambientInfos.y; -#ifdef AMBIENTINGRAYSCALE -ambientOcclusionColorMap= vec3f(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r); -#endif -#if DEBUGMODE>0 -outParams.ambientOcclusionColorMap=ambientOcclusionColorMap; -#endif -#endif -outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;} -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=L);const l="openpbrGeometryInfo",T=`struct geometryInfoOutParams -{NdotV: f32, -NdotVUnclamped: f32, -environmentBrdf: vec3f, -horizonOcclusion: f32};struct geometryInfoAnisoOutParams -{NdotV: f32, -NdotVUnclamped: f32, -environmentBrdf: vec3f, -horizonOcclusion: f32, -anisotropy: f32, -anisotropicTangent: vec3f, -anisotropicBitangent: vec3f, -TBN: mat3x3};fn geometryInfo( -normalW: vec3f,viewDirectionW: vec3f,roughness: f32,geometricNormalW: vec3f -)->geometryInfoOutParams -{var outParams: geometryInfoOutParams;outParams.NdotVUnclamped=dot(normalW,viewDirectionW);outParams.NdotV=absEps(outParams.NdotVUnclamped); -#if defined(ENVIRONMENTBRDF) -outParams.environmentBrdf=getBRDFLookup(outParams.NdotV,roughness); -#else -outParams.environmentBrdf=vec3f(0.0); -#endif -outParams.horizonOcclusion=1.0f; -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -#ifdef HORIZONOCCLUSION -#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) -#ifdef REFLECTIONMAP_3D -outParams.horizonOcclusion=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW); -#endif -#endif -#endif -#endif -return outParams;} -fn geometryInfoAniso( -normalW: vec3f,viewDirectionW: vec3f,roughness: f32,geometricNormalW: vec3f -,vAnisotropy: vec3f,TBN: mat3x3 -)->geometryInfoAnisoOutParams -{let geoInfo: geometryInfoOutParams=geometryInfo(normalW,viewDirectionW,roughness,geometricNormalW);var outParams: geometryInfoAnisoOutParams;outParams.NdotV=geoInfo.NdotV;outParams.NdotVUnclamped=geoInfo.NdotVUnclamped;outParams.environmentBrdf=geoInfo.environmentBrdf;outParams.horizonOcclusion=geoInfo.horizonOcclusion;outParams.anisotropy=vAnisotropy.b;let anisotropyDirection: vec3f=vec3f(vAnisotropy.xy,0.);let anisoTBN: mat3x3=mat3x3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));outParams.anisotropicTangent=normalize(anisoTBN*anisotropyDirection);outParams.anisotropicBitangent=normalize(cross(anisoTBN[2],outParams.anisotropicTangent));outParams.TBN=TBN;return outParams;} -`;e.IncludesShadersStoreWGSL[l]||(e.IncludesShadersStoreWGSL[l]=T);const s="openpbrIblFunctions",F=`#ifdef REFLECTION -fn sampleIrradiance( -surfaceNormal: vec3f -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,vEnvironmentIrradianceSH: vec3f -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,iblMatrix: mat4x4f -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,irradianceSampler: texture_cube -,irradianceSamplerSampler: sampler -#else -,irradianceSampler: texture_2d -,irradianceSamplerSampler: sampler -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,reflectionDominantDirection: vec3f -#endif -#endif -#ifdef REALTIME_FILTERING -,reflectionFilteringInfo: vec2f -#ifdef IBL_CDF_FILTERING -,icdfSampler: texture_2d -,icdfSamplerSampler: sampler -#endif -#endif -,reflectionInfos: vec2f -,viewDirectionW: vec3f -,diffuseRoughness: f32 -,surfaceAlbedo: vec3f -)->vec3f {var environmentIrradiance=vec3f(0.,0.,0.); -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -var irradianceVector=(iblMatrix*vec4f(surfaceNormal,0.0f)).xyz;let irradianceView=(iblMatrix*vec4f(viewDirectionW,0.0f)).xyz; -#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -{let NdotV=max(dot(surfaceNormal,viewDirectionW),0.0f);irradianceVector=mix(irradianceVector,irradianceView,(0.5f*(1.0f-NdotV))*diffuseRoughness);} -#endif -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0f; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0f; -#endif -#endif -#ifdef USESPHERICALFROMREFLECTIONMAP -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -environmentIrradiance=vEnvironmentIrradianceSH; -#else -#if defined(REALTIME_FILTERING) -environmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,reflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView -#ifdef IBL_CDF_FILTERING -,icdfSampler -,icdfSamplerSampler -#endif -); -#else -environmentIrradiance=computeEnvironmentIrradiance(irradianceVector); -#endif -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -let environmentIrradianceFromTexture: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,irradianceVector); -#else -let environmentIrradianceFromTexture: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords); -#endif -environmentIrradiance=environmentIrradianceFromTexture.rgb; -#ifdef RGBDREFLECTION -environmentIrradiance.rgb=fromRGBD(environmentIrradianceFromTexture); -#endif -#ifdef GAMMAREFLECTION -environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb); -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -let Ls: vec3f=normalize(reflectionDominantDirection);let NoL: f32=dot(irradianceVector,Ls);let NoV: f32=dot(irradianceVector,irradianceView);var diffuseRoughnessTerm=vec3f(1.0f); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -let LoV: f32=dot (Ls,irradianceView);let mag: f32=length(reflectionDominantDirection)*2.0f;let clampedAlbedo: vec3f=clamp(surfaceAlbedo,vec3f(0.1f),vec3f(1.0f));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3f(1.0f),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0f,1.0f))); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -let H: vec3f=(irradianceView+Ls)*0.5f;let VoH: f32=dot(irradianceView,H);diffuseRoughnessTerm=vec3f(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -environmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm; -#endif -#endif -environmentIrradiance*=reflectionInfos.x;return environmentIrradiance;} -#ifdef REFLECTIONMAP_3D -fn createReflectionCoords(vPositionW: vec3f,normalW: vec3f)->vec3f -#else -fn createReflectionCoords(vPositionW: vec3f,normalW: vec3f)->vec2f -#endif -{var reflectionVector: vec3f=computeReflectionCoords(vec4f(vPositionW,1.0f),normalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -var reflectionCoords: vec3f=reflectionVector; -#else -var reflectionCoords: vec2f=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0f-reflectionCoords.y; -#endif -return reflectionCoords;} -fn sampleRadiance( -alphaG: f32 -,reflectionMicrosurfaceInfos: vec3f -,reflectionInfos: vec2f -,geoInfo: geometryInfoOutParams -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -,reflectionCoords: vec3f -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -,reflectionCoords: vec2f -#endif -#ifdef REALTIME_FILTERING -,reflectionFilteringInfo: vec2f -#endif -)->vec3f {var environmentRadiance: vec4f=vec4f(0.f,0.f,0.f,0.f); -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -var reflectionLOD: f32=getLodFromAlphaG(reflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -var reflectionLOD: f32=getLinearLodFromRoughness(reflectionMicrosurfaceInfos.x,roughness); -#else -var reflectionLOD: f32=getLodFromAlphaG(reflectionMicrosurfaceInfos.x,alphaG); -#endif -reflectionLOD=reflectionLOD*reflectionMicrosurfaceInfos.y+reflectionMicrosurfaceInfos.z; -#ifdef REALTIME_FILTERING -environmentRadiance=vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionFilteringInfo),1.0f); -#else -environmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD); -#endif -#ifdef RGBDREFLECTION -environmentRadiance.rgb=fromRGBD(environmentRadiance); -#endif -#ifdef GAMMAREFLECTION -environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb); -#endif -return environmentRadiance.rgb;} -#if defined(ANISOTROPIC) -fn sampleRadianceAnisotropic( -alphaG: f32 -,reflectionMicrosurfaceInfos: vec3f -,reflectionInfos: vec2f -,geoInfo: geometryInfoAnisoOutParams -,normalW: vec3f -,viewDirectionW: vec3f -,positionW: vec3f -,noise: vec3f -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -#endif -#ifdef REALTIME_FILTERING -,reflectionFilteringInfo: vec2f -#endif -)->vec3f {var environmentRadiance: vec4f=vec4f(0.f,0.f,0.f,0.f);let alphaT=alphaG*sqrt(2.0f/(1.0f+(1.0f-geoInfo.anisotropy)*(1.0f-geoInfo.anisotropy)));let alphaB=(1.0f-geoInfo.anisotropy)*alphaT;let modifiedAlphaG=alphaB; -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -var reflectionLOD: f32=getLodFromAlphaG(reflectionMicrosurfaceInfos.x,modifiedAlphaG,geoInfo.NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -var reflectionLOD: f32=getLinearLodFromRoughness(reflectionMicrosurfaceInfos.x,roughness); -#else -var reflectionLOD: f32=getLodFromAlphaG(reflectionMicrosurfaceInfos.x,modifiedAlphaG); -#endif -reflectionLOD=reflectionLOD*reflectionMicrosurfaceInfos.y+reflectionMicrosurfaceInfos.z; -#ifdef REALTIME_FILTERING -var view=(uniforms.reflectionMatrix*vec4f(viewDirectionW,0.0f)).xyz;var tangent=(uniforms.reflectionMatrix*vec4f(geoInfo.anisotropicTangent,0.0f)).xyz;var bitangent=(uniforms.reflectionMatrix*vec4f(geoInfo.anisotropicBitangent,0.0f)).xyz;var normal=(uniforms.reflectionMatrix*vec4f(normalW,0.0f)).xyz; -#ifdef REFLECTIONMAP_OPPOSITEZ -view.z*=-1.0f;tangent.z*=-1.0f;bitangent.z*=-1.0f;normal.z*=-1.0f; -#endif -environmentRadiance = -vec4f(radianceAnisotropic(alphaT,alphaB,reflectionSampler,reflectionSamplerSampler, -view,tangent, -bitangent,normal, -reflectionFilteringInfo,noise.xy), -1.0f); -#else -const samples: i32=16;var radianceSample=vec4f(0.0);var accumulatedRadiance=vec3f(0.0);var reflectionCoords=vec3f(0.0);var sample_weight=0.0f;var total_weight=0.0f;let step=1.0f/f32(max(samples-1,1));for (var i: i32=0; i0.0) {let blend: f32=t;bentNormal=normalize(mix(normalW,geoInfo.anisotropicTangent,blend));} else {bentNormal=normalW;} -reflectionCoords=createReflectionCoords(positionW,bentNormal);radianceSample=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD); -#ifdef RGBDREFLECTION -accumulatedRadiance+=vec3f(sample_weight)*fromRGBD(radianceSample); -#elif defined(GAMMAREFLECTION) -accumulatedRadiance+=vec3f(sample_weight)*toLinearSpace(radianceSample.rgb); -#else -accumulatedRadiance+=vec3f(sample_weight)*radianceSample.rgb; -#endif -total_weight+=sample_weight;} -environmentRadiance=vec4f(accumulatedRadiance/vec3f(total_weight),1.0f); -#endif -environmentRadiance=vec4f(environmentRadiance.rgb*reflectionInfos.xxx,environmentRadiance.a);return environmentRadiance.rgb;} -#endif -fn conductorIblFresnel(reflectance: ReflectanceParams,NdotV: f32,roughness: f32,environmentBrdf: vec3f)->vec3f -{ -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -let albedoF0: vec3f=mix(reflectance.coloredF0,pow(reflectance.coloredF0,vec3f(1.4f)),roughness);return getF82Specular(NdotV,albedoF0,reflectance.coloredF90,roughness); -#else -return getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90,environmentBrdf); -#endif -} -#endif -`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=F);const c="openpbrNormalMapFragment",O=`var uvOffset: vec2f= vec2f(0.0,0.0); -#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) || defined(PARALLAX) || defined(DETAIL) -#ifdef NORMALXYSCALE -var normalScale: f32=1.0; -#elif defined(GEOMETRY_NORMAL) -var normalScale: f32=uniforms.vGeometryNormalInfos.y; -#else -var normalScale: f32=1.0; -#endif -#if defined(TANGENT) && defined(NORMAL) -var TBN: mat3x3f=mat3x3(input.vTBN0,input.vTBN1,input.vTBN2); -#elif defined(GEOMETRY_NORMAL) -var TBNUV: vec2f=select(-fragmentInputs.vGeometryNormalUV,fragmentInputs.vGeometryNormalUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams); -#else -var TBNUV: vec2f=select(-fragmentInputs.vDetailUV,fragmentInputs.vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.)); -#endif -#elif defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -var TBN: mat3x3f=mat3x3(input.vTBN0,input.vTBN1,input.vTBN2); -#else -var TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.)); -#endif -#endif -#ifdef PARALLAX -var invTBN: mat3x3f=transposeMat3(TBN); -#ifdef PARALLAXOCCLUSION -#else -#endif -#endif -#ifdef DETAIL -var detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,fragmentInputs.vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB); -#endif -#ifdef GEOMETRY_COAT_NORMAL -coatNormalW=perturbNormal(TBN,textureSample(geometryCoatNormalSampler,geometryCoatNormalSamplerSampler,fragmentInputs.vGeometryCoatNormalUV+uvOffset).xyz,uniforms.vGeometryCoatNormalInfos.y); -#endif -#ifdef GEOMETRY_NORMAL -#ifdef OBJECTSPACE_NORMALMAP -#define CUSTOM_FRAGMENT_BUMP_FRAGMENT -normalW=normalize(textureSample(geometryNormalSampler,geometryNormalSamplerSampler,fragmentInputs.vGeometryNormalUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW); -#elif !defined(DETAIL) -normalW=perturbNormal(TBN,textureSample(geometryNormalSampler,geometryNormalSamplerSampler,fragmentInputs.vGeometryNormalUV+uvOffset).xyz,uniforms.vGeometryNormalInfos.y); -#else -var sampledNormal: vec3f=textureSample(geometryNormalSampler,geometryNormalSamplerSampler,fragmentInputs.vGeometryNormalUV+uvOffset).xyz*2.0-1.0; -#if DETAIL_NORMALBLENDMETHOD==0 -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);var blendedNormal: vec3f=normalize( vec3f(sampledNormal.xy+detailNormal.xy,sampledNormal.z*detailNormal.z)); -#elif DETAIL_NORMALBLENDMETHOD==1 -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);sampledNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=sampledNormal*dot(sampledNormal,detailNormal)/sampledNormal.z-detailNormal; -#endif -normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vGeometryNormalInfos.y); -#endif -#elif defined(DETAIL) -detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z); -#endif -`;e.IncludesShadersStoreWGSL[c]||(e.IncludesShadersStoreWGSL[c]=O);const m="openpbrBlockNormalFinal",b=`#if defined(FORCENORMALFORWARD) && defined(NORMAL) -var faceNormal: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))*scene.vEyePosition.w; -#if defined(TWOSIDEDLIGHTING) -faceNormal=select(-faceNormal,faceNormal,fragmentInputs.frontFacing); -#endif -normalW*=sign(dot(normalW,faceNormal));coatNormalW*=sign(dot(coatNormalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -#if defined(MIRRORED) -normalW=select(normalW,-normalW,fragmentInputs.frontFacing);coatNormalW=select(coatNormalW,-coatNormalW,fragmentInputs.frontFacing); -#else -normalW=select(-normalW,normalW,fragmentInputs.frontFacing);coatNormalW=select(-coatNormalW,coatNormalW,fragmentInputs.frontFacing); -#endif -#endif -`;e.IncludesShadersStoreWGSL[m]||(e.IncludesShadersStoreWGSL[m]=b);const d="openpbrBaseLayerData",C=`var base_color=vec3f(0.8);var base_metalness: f32=0.0;var base_diffuse_roughness: f32=0.0;var specular_weight: f32=1.0;var specular_roughness: f32=0.3;var specular_color: vec3f=vec3f(1.0);var specular_roughness_anisotropy: f32=0.0;var specular_ior: f32=1.5;var alpha: f32=1.0;var geometry_tangent: vec2f=vec2f(1.0,0.0); -#ifdef BASE_WEIGHT -let baseWeightFromTexture: vec4f=textureSample(baseWeightSampler,baseWeightSamplerSampler,fragmentInputs.vBaseWeightUV+uvOffset); -#endif -#ifdef BASE_COLOR -let baseColorFromTexture: vec4f=textureSample(baseColorSampler,baseColorSamplerSampler,fragmentInputs.vBaseColorUV+uvOffset); -#endif -#ifdef BASE_METALNESS -let metallicFromTexture: vec4f=textureSample(baseMetalnessSampler,baseMetalnessSamplerSampler,fragmentInputs.vBaseMetalnessUV+uvOffset); -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -let baseDiffuseRoughnessFromTexture: f32=textureSample(baseDiffuseRoughnessSampler,baseDiffuseRoughnessSamplerSampler,fragmentInputs.vBaseDiffuseRoughnessUV+uvOffset).r; -#endif -#ifdef GEOMETRY_TANGENT -let geometryTangentFromTexture: vec3f=textureSample(geometryTangentSampler,geometryTangentSamplerSampler,fragmentInputs.vGeometryTangentUV+uvOffset).rgb; -#endif -#ifdef SPECULAR_ROUGHNESS_ANISOTROPY -let anisotropyFromTexture: f32=textureSample(specularRoughnessAnisotropySampler,specularRoughnessAnisotropySamplerSampler,fragmentInputs.vSpecularRoughnessAnisotropyUV+uvOffset).r*uniforms.vSpecularRoughnessAnisotropyInfos.y; -#endif -#ifdef GEOMETRY_OPACITY -let opacityFromTexture: vec4f=textureSample(geometryOpacitySampler,geometryOpacitySamplerSampler,fragmentInputs.vGeometryOpacityUV+uvOffset); -#endif -#ifdef DECAL -let decalFromTexture: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset); -#endif -#ifdef SPECULAR_COLOR -let specularColorFromTexture: vec4f=textureSample(specularColorSampler,specularColorSamplerSampler,fragmentInputs.vSpecularColorUV+uvOffset); -#endif -#if defined(SPECULAR_WEIGHT) -#ifdef SPECULAR_WEIGHT_IN_ALPHA -let specularWeightFromTexture: f32=textureSample(specularWeightSampler,specularWeightSamplerSampler,fragmentInputs.vSpecularWeightUV+uvOffset).a; -#else -let specularWeightFromTexture: f32=textureSample(specularWeightSampler,specularWeightSamplerSampler,fragmentInputs.vSpecularWeightUV+uvOffset).r; -#endif -#endif -#if defined(ANISOTROPIC) || defined(FUZZ) -let noise=textureSample(blueNoiseSampler,blueNoiseSamplerSampler,fragmentInputs.position.xy/256.0).xyz; -#endif -#if defined(ROUGHNESSSTOREINMETALMAPGREEN) && defined(BASE_METALNESS) -let roughnessFromTexture: f32=metallicFromTexture.g; -#elif defined(SPECULAR_ROUGHNESS) -let roughnessFromTexture: f32=textureSample(specularRoughnessSampler,specularRoughnessSamplerSampler,fragmentInputs.vSpecularRoughnessUV+uvOffset).r; -#endif -base_color=uniforms.vBaseColor.rgb; -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -base_color*=fragmentInputs.vColor.rgb; -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=fragmentInputs.vColor.a; -#endif -base_color*=vec3(uniforms.vBaseWeight);alpha=uniforms.vBaseColor.a;base_metalness=uniforms.vReflectanceInfo.x;base_diffuse_roughness=uniforms.vBaseDiffuseRoughness;specular_roughness=uniforms.vReflectanceInfo.y;specular_color=uniforms.vSpecularColor.rgb;specular_weight=uniforms.vReflectanceInfo.a;specular_ior=uniforms.vReflectanceInfo.z;specular_roughness_anisotropy=uniforms.vSpecularAnisotropy.b;geometry_tangent=uniforms.vSpecularAnisotropy.rg; -#ifdef BASE_COLOR -#ifdef BASE_COLOR_GAMMA -base_color*=toLinearSpace(baseColorFromTexture.rgb); -#else -base_color*=baseColorFromTexture.rgb; -#endif -base_color*=uniforms.vBaseColorInfos.y; -#endif -#ifdef BASE_WEIGHT -base_color*=baseWeightFromTexture.r; -#endif -#if defined(BASE_COLOR) && defined(ALPHA_FROM_BASE_COLOR_TEXTURE) -alpha*=baseColorFromTexture.a; -#elif defined(GEOMETRY_OPACITY) -alpha*=opacityFromTexture.a;alpha*=uniforms.vGeometryOpacityInfos.y; -#endif -#ifdef ALPHATEST -#if DEBUGMODE != 88 -if (alpha0.0) { -#ifdef REFLECTIONMAP_3D -var reflectionCoords: vec3f=vec3f(0.f,0.f,0.f); -#else -var reflectionCoords: vec2f=vec2f(0.f,0.f); -#endif -reflectionCoords=createReflectionCoords(fragmentInputs.vPositionW,coatNormalW);var coatAlphaG: f32=coat_roughness*coat_roughness; -#ifdef ANISOTROPIC_COAT -coatEnvironmentLight=sampleRadianceAnisotropic(coatAlphaG,uniforms.vReflectionMicrosurfaceInfos.rgb,uniforms.vReflectionInfos -,coatGeoInfo -,coatNormalW -,viewDirectionW -,fragmentInputs.vPositionW -,noise -,reflectionSampler -,reflectionSamplerSampler -#ifdef REALTIME_FILTERING -,uniforms.vReflectionFilteringInfo -#endif -); -#else -coatEnvironmentLight=sampleRadiance(coatAlphaG,uniforms.vReflectionMicrosurfaceInfos.rgb,uniforms.vReflectionInfos -,coatGeoInfo -,reflectionSampler -,reflectionSamplerSampler -,reflectionCoords -#ifdef REALTIME_FILTERING -,uniforms.vReflectionFilteringInfo -#endif -); -#endif -} -#ifdef FUZZ -let modifiedFuzzRoughness: f32=clamp(fuzz_roughness*(1.0f-0.5f*environmentFuzzBrdf.y),0.0f,1.0f);var fuzzEnvironmentLight=vec3f(0.0f,0.0f,0.0f);var totalWeight=0.0f;let fuzzIblFresnel: f32=sqrt(environmentFuzzBrdf.z);for (var i: i32=0; i0.0) {coatIblFresnel=getReflectanceFromBRDFWithEnvLookup(vec3f(coatReflectance.F0),vec3f(coatReflectance.F90),coatGeoInfo.environmentBrdf).r;} -var slab_diffuse_ibl: vec3f=vec3f(0.,0.,0.);var slab_glossy_ibl: vec3f=vec3f(0.,0.,0.);var slab_metal_ibl: vec3f=vec3f(0.,0.,0.);var slab_coat_ibl: vec3f=vec3f(0.,0.,0.);slab_diffuse_ibl=baseDiffuseEnvironmentLight*uniforms.vLightingIntensity.z;slab_diffuse_ibl*=aoOut.ambientOcclusionColor;slab_glossy_ibl=baseSpecularEnvironmentLight*uniforms.vLightingIntensity.z;slab_metal_ibl=baseSpecularEnvironmentLight*conductorIblFresnel*uniforms.vLightingIntensity.z;var coatAbsorption=vec3f(1.0);if (coat_weight>0.0) {slab_coat_ibl=coatEnvironmentLight*uniforms.vLightingIntensity.z;let hemisphere_avg_fresnel: f32=coatReflectance.F0+0.5f*(1.0f-coatReflectance.F0);var averageReflectance: f32=(coatIblFresnel+hemisphere_avg_fresnel)*0.5f;let roughnessFactor=1.0f-coat_roughness*0.5f;averageReflectance*=roughnessFactor;var darkened_transmission: f32=(1.0f-averageReflectance)*(1.0f-averageReflectance);darkened_transmission=mix(1.0,darkened_transmission,coat_darkening);var sin2: f32=1.0f-coatGeoInfo.NdotV*coatGeoInfo.NdotV;sin2=sin2/(coat_ior*coat_ior);let cos_t: f32=sqrt(1.0f-sin2);let coatPathLength=1.0f/cos_t;let colored_transmission: vec3f=pow(coat_color,vec3f(coatPathLength));coatAbsorption=mix(vec3f(1.0f),colored_transmission*vec3f(darkened_transmission),coat_weight);} -#ifdef FUZZ -let slab_fuzz_ibl=fuzzEnvironmentLight*uniforms.vLightingIntensity.z; -#endif -var slab_subsurface_ibl: vec3f=vec3f(0.,0.,0.);var slab_translucent_base_ibl: vec3f=vec3f(0.,0.,0.);slab_diffuse_ibl*=base_color.rgb; -#define CUSTOM_FRAGMENT_BEFORE_IBLLAYERCOMPOSITION -let material_opaque_base_ibl: vec3f=mix(slab_diffuse_ibl,slab_subsurface_ibl,subsurface_weight);let material_dielectric_base_ibl: vec3f=mix(material_opaque_base_ibl,slab_translucent_base_ibl,transmission_weight);let material_dielectric_gloss_ibl: vec3f=material_dielectric_base_ibl*(1.0-dielectricIblFresnel)+slab_glossy_ibl*dielectricIblColoredFresnel;let material_base_substrate_ibl: vec3f=mix(material_dielectric_gloss_ibl,slab_metal_ibl,base_metalness);let material_coated_base_ibl: vec3f=layer(material_base_substrate_ibl,slab_coat_ibl,coatIblFresnel,coatAbsorption,vec3f(1.0f)); -#ifdef FUZZ -material_surface_ibl=layer(material_coated_base_ibl,slab_fuzz_ibl,fuzzIblFresnel*fuzz_weight,vec3(1.0),fuzz_color); -#else -material_surface_ibl=material_coated_base_ibl; -#endif -#endif -`;e.IncludesShadersStoreWGSL[g]||(e.IncludesShadersStoreWGSL[g]=x);const v="openpbrDirectLightingInit",P=`#ifdef LIGHT{X} -var preInfo{X}: preLightingInfo;var preInfoCoat{X}: preLightingInfo;let lightColor{X}: vec4f=light{X}.vLightDiffuse;var shadow{X}: f32=1.0f; -#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) -#else -#define CUSTOM_LIGHT{X}_COLOR -#ifdef SPOTLIGHT{X} -preInfo{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);preInfoCoat{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW,vPositionW); -#elif defined(POINTLIGHT{X}) -preInfo{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);preInfoCoat{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW,vPositionW); -#elif defined(HEMILIGHT{X}) -preInfo{X}=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);preInfoCoat{X}=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW); -#elif defined(DIRLIGHT{X}) -preInfo{X}=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);preInfoCoat{X}=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo{X}=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,specular_roughness);preInfoCoat{X}=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,coatNormalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,coat_roughness); -#endif -preInfo{X}.NdotV=baseGeoInfo.NdotV;preInfoCoat{X}.NdotV=coatGeoInfo.NdotV; -#ifdef SPOTLIGHT{X} -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo{X}.attenuation=computeDistanceLightFalloff_GLTF(preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Physical(preInfo{X}.lightDistanceSquared); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w); -#endif -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Standard(preInfo{X}.lightOffset,light{X}.vLightFalloff.x); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w,light{X}.vLightData.w); -#endif -#else -preInfo{X}.attenuation=computeDistanceLightFalloff(preInfo{X}.lightOffset,preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#endif -#elif defined(POINTLIGHT{X}) -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo{X}.attenuation=computeDistanceLightFalloff_GLTF(preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.y); -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Physical(preInfo{X}.lightDistanceSquared); -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Standard(preInfo{X}.lightOffset,light{X}.vLightFalloff.x); -#else -preInfo{X}.attenuation=computeDistanceLightFalloff(preInfo{X}.lightOffset,preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#endif -#else -preInfo{X}.attenuation=1.0f; -#endif -preInfoCoat{X}.attenuation=preInfo{X}.attenuation; -#if defined(HEMILIGHT{X}) -preInfo{X}.roughness=specular_roughness;preInfoCoat{X}.roughness=coat_roughness; -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo{X}.roughness=specular_roughness;preInfoCoat{X}.roughness=coat_roughness; -#else -preInfo{X}.roughness=adjustRoughnessFromLightProperties(specular_roughness,light{X}.vLightSpecular.a,preInfo{X}.lightDistance);preInfoCoat{X}.roughness=adjustRoughnessFromLightProperties(coat_roughness,light{X}.vLightSpecular.a,preInfoCoat{X}.lightDistance); -#endif -preInfo{X}.diffuseRoughness=base_diffuse_roughness;preInfo{X}.surfaceAlbedo=base_color.rgb; -#endif -#endif -`;e.IncludesShadersStoreWGSL[v]||(e.IncludesShadersStoreWGSL[v]=P);const I="openpbrDirectLighting",z=`#ifdef LIGHT{X} -{var slab_diffuse: vec3f=vec3f(0.f,0.f,0.f);var slab_subsurface: vec3f=vec3f(0.f,0.f,0.f);var slab_translucent: vec3f=vec3f(0.f,0.f,0.f);var slab_glossy: vec3f=vec3f(0.f,0.f,0.f);var specularFresnel: f32=0.0f;var specularColoredFresnel: vec3f=vec3f(0.f,0.f,0.f);var slab_metal: vec3f=vec3f(0.f,0.f,0.f);var slab_coat: vec3f=vec3f(0.f,0.f,0.f);var coatFresnel: f32=0.0f;var slab_fuzz: vec3f=vec3f(0.f,0.f,0.f);var fuzzFresnel: f32=0.0f; -#ifdef HEMILIGHT{X} -slab_diffuse=computeHemisphericDiffuseLighting(preInfo{X},lightColor{X}.rgb,light{X}.vLightGround); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_diffuse=computeAreaDiffuseLighting(preInfo{X},lightColor{X}.rgb); -#else -slab_diffuse=computeDiffuseLighting(preInfo{X},lightColor{X}.rgb); -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -slab_diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW); -#endif -numLights+=1.0f; -#ifdef FUZZ -let fuzzNdotH: f32=max(dot(fuzzNormalW,preInfo{X}.H),0.0f);let fuzzBrdf: vec3f=getFuzzBRDFLookup(fuzzNdotH,sqrt(fuzz_roughness)); -#endif -#ifdef THIN_FILM -let thin_film_desaturation_scale: f32=(thin_film_ior-1.0f)*sqrt(thin_film_thickness*0.001f); -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_glossy=computeAreaSpecularLighting(preInfo{X},light{X}.vLightSpecular.rgb,baseConductorReflectance.F0,baseConductorReflectance.F90); -#else -{ -#ifdef ANISOTROPIC_BASE -slab_glossy=computeAnisotropicSpecularLighting(preInfo{X},viewDirectionW,normalW, -baseGeoInfo.anisotropicTangent,baseGeoInfo.anisotropicBitangent,baseGeoInfo.anisotropy, -0.0f,lightColor{X}.rgb); -#else -slab_glossy=computeSpecularLighting(preInfo{X},normalW,vec3(1.0),vec3(1.0),specular_roughness,lightColor{X}.rgb); -#endif -let NdotH: f32=dot(normalW,preInfo{X}.H);specularFresnel=fresnelSchlickGGX(NdotH,baseDielectricReflectance.F0,baseDielectricReflectance.F90);specularColoredFresnel=specularFresnel*specular_color; -#ifdef THIN_FILM -let thinFilmIorScale: f32=clamp(2.0f*abs(thin_film_ior-1.0f),0.0f,1.0f);var thinFilmDielectricFresnel: vec3f=evalIridescence(thin_film_outside_ior,thin_film_ior,preInfo{X}.VdotH,thin_film_thickness,baseDielectricReflectance.coloredF0);thinFilmDielectricFresnel=mix(thinFilmDielectricFresnel,vec3f(dot(thinFilmDielectricFresnel,vec3f(0.3333f))),thin_film_desaturation_scale);specularColoredFresnel=mix(specularColoredFresnel,thinFilmDielectricFresnel*specular_color,thin_film_weight*thinFilmIorScale); -#endif -} -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_metal=computeAreaSpecularLighting(preInfo{X},light{X}.vLightSpecular.rgb,baseConductorReflectance.F0,baseConductorReflectance.F90); -#else -{ -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -var coloredFresnel: vec3f=getF82Specular(preInfo{X}.VdotH,baseConductorReflectance.coloredF0,baseConductorReflectance.coloredF90,specular_roughness); -#else -var coloredFresnel: vec3f=fresnelSchlickGGX(preInfo{X}.VdotH,baseConductorReflectance.coloredF0,baseConductorReflectance.coloredF90); -#endif -#ifdef THIN_FILM -let thinFilmIorScale: f32=clamp(2.0f*abs(thin_film_ior-1.0f),0.0f,1.0f);var thinFilmConductorFresnel=evalIridescence(thin_film_outside_ior,thin_film_ior,preInfo{X}.VdotH,thin_film_thickness,baseConductorReflectance.coloredF0);thinFilmConductorFresnel=mix(thinFilmConductorFresnel,vec3f(dot(thinFilmConductorFresnel,vec3f(0.3333f))),thin_film_desaturation_scale);coloredFresnel=mix(coloredFresnel,specular_weight*thinFilmIorScale*thinFilmConductorFresnel,thin_film_weight); -#endif -#ifdef ANISOTROPIC_BASE -slab_metal=computeAnisotropicSpecularLighting(preInfo{X},viewDirectionW,normalW,baseGeoInfo.anisotropicTangent,baseGeoInfo.anisotropicBitangent,baseGeoInfo.anisotropy,0.0,lightColor{X}.rgb); -#else -slab_metal=computeSpecularLighting(preInfo{X},normalW,vec3f(baseConductorReflectance.coloredF0),coloredFresnel,specular_roughness,lightColor{X}.rgb); -#endif -} -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_coat=computeAreaSpecularLighting(preInfoCoat{X},light{X}.vLightSpecular.rgb,coatReflectance.F0,coatReflectance.F90); -#else -{ -#ifdef ANISOTROPIC_COAT -slab_coat=computeAnisotropicSpecularLighting(preInfoCoat{X},viewDirectionW,coatNormalW, -coatGeoInfo.anisotropicTangent,coatGeoInfo.anisotropicBitangent,coatGeoInfo.anisotropy,0.0, -lightColor{X}.rgb); -#else -slab_coat=computeSpecularLighting(preInfoCoat{X},coatNormalW,vec3f(coatReflectance.F0),vec3f(1.0f),coat_roughness,lightColor{X}.rgb); -#endif -let NdotH: f32=dot(coatNormalW,preInfoCoat{X}.H);coatFresnel=fresnelSchlickGGX(NdotH,coatReflectance.F0,coatReflectance.F90);} -#endif -var coatAbsorption=vec3f(1.0f);if (coat_weight>0.0) {let cosTheta_view: f32=max(preInfoCoat{X}.NdotV,0.001f);let cosTheta_light: f32=max(preInfoCoat{X}.NdotL,0.001f);let fresnel_view: f32=coatReflectance.F0+(1.0f-coatReflectance.F0)*pow(1.0f-cosTheta_view,5.0);let fresnel_light: f32=coatReflectance.F0+(1.0f-coatReflectance.F0)*pow(1.0f-cosTheta_light,5.0);let averageReflectance: f32=(fresnel_view+fresnel_light)*0.5;var darkened_transmission: f32=(1.0f-averageReflectance)/(1.0f+averageReflectance);darkened_transmission=mix(1.0f,darkened_transmission,coat_darkening);var sin2: f32=1.0f-coatGeoInfo.NdotV*coatGeoInfo.NdotV;sin2=sin2/(coat_ior*coat_ior);let cos_t: f32=sqrt(1.0f-sin2);let coatPathLength=1.0f/cos_t;let colored_transmission: vec3f=pow(coat_color,vec3f(coatPathLength));coatAbsorption=mix(vec3f(1.0f),colored_transmission*vec3f(darkened_transmission),coat_weight);} -#ifdef FUZZ -fuzzFresnel=fuzzBrdf.z;let fuzzNormalW=mix(normalW,coatNormalW,coat_weight);let fuzzNdotV: f32=max(dot(fuzzNormalW,viewDirectionW.xyz),0.0f);let fuzzNdotL: f32=max(dot(fuzzNormalW,preInfo{X}.L),0.0);slab_fuzz=lightColor{X}.rgb*preInfo{X}.attenuation*evalFuzz(preInfo{X}.L,fuzzNdotL,fuzzNdotV,fuzzTangent,fuzzBitangent,fuzzBrdf); -#else -let fuzz_color=vec3f(0.0); -#endif -slab_diffuse*=base_color.rgb;let material_opaque_base: vec3f=mix(slab_diffuse,slab_subsurface,subsurface_weight);let material_dielectric_base: vec3f=mix(material_opaque_base,slab_translucent,transmission_weight);let material_dielectric_gloss: vec3f=material_dielectric_base*(1.0f-specularFresnel)+slab_glossy*specularColoredFresnel;let material_base_substrate: vec3f=mix(material_dielectric_gloss,slab_metal,base_metalness);let material_coated_base: vec3f=layer(material_base_substrate,slab_coat,coatFresnel,coatAbsorption,vec3f(1.0f));material_surface_direct+=layer(material_coated_base,slab_fuzz,fuzzFresnel*fuzz_weight,vec3f(1.0f),fuzz_color);} -#endif -`;e.IncludesShadersStoreWGSL[I]||(e.IncludesShadersStoreWGSL[I]=z);const r="openpbrPixelShader",E=`#define OPENPBR_FRAGMENT_SHADER -#define CUSTOM_FRAGMENT_BEGIN -#include[SCENE_MRT_COUNT] -#include -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE -#endif -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef REFLECTION -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -#include -#include -#include -#include -#include -fn layer(slab_bottom: vec3f,slab_top: vec3f,lerp_factor: f32,bottom_multiplier: vec3f,top_multiplier: vec3f)->vec3f {return mix(slab_bottom*bottom_multiplier,slab_top*top_multiplier,lerp_factor);} -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -#include -var coatNormalW: vec3f=normalW; -#include -#include -#include -#include -#include -#include -var subsurface_weight: f32=0.0f;var transmission_weight: f32=0.0f; -#define CUSTOM_FRAGMENT_UPDATE_ALPHA -#include -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -var aoOut: ambientOcclusionOutParams; -#ifdef AMBIENT_OCCLUSION -var ambientOcclusionFromTexture: vec3f=textureSample(ambientOcclusionSampler,ambientOcclusionSamplerSampler,fragmentInputs.vAmbientOcclusionUV+uvOffset).rgb; -#endif -aoOut=ambientOcclusionBlock( -#ifdef AMBIENT_OCCLUSION -ambientOcclusionFromTexture, -uniforms.vAmbientOcclusionInfos -#endif -); -#ifdef ANISOTROPIC_COAT -let coatGeoInfo: geometryInfoAnisoOutParams=geometryInfoAniso( -coatNormalW,viewDirectionW.xyz,coat_roughness,geometricNormalW -,vec3f(geometry_coat_tangent.x,geometry_coat_tangent.y,coat_roughness_anisotropy),TBN -); -#else -let coatGeoInfo: geometryInfoOutParams=geometryInfo( -coatNormalW,viewDirectionW.xyz,coat_roughness,geometricNormalW -); -#endif -specular_roughness=mix(specular_roughness,pow(min(1.0f,pow(specular_roughness,4.0f)+2.0f*pow(coat_roughness,4.0f)),0.25f),coat_weight); -#ifdef ANISOTROPIC_BASE -let baseGeoInfo: geometryInfoAnisoOutParams=geometryInfoAniso( -normalW,viewDirectionW.xyz,specular_roughness,geometricNormalW -,vec3f(geometry_tangent.x,geometry_tangent.y,specular_roughness_anisotropy),TBN -); -#else -let baseGeoInfo: geometryInfoOutParams=geometryInfo( -normalW,viewDirectionW.xyz,specular_roughness,geometricNormalW -); -#endif -#ifdef FUZZ -let fuzzNormalW=normalize(mix(normalW,coatNormalW,coat_weight));var fuzzTangent=normalize(TBN[0]);fuzzTangent=normalize(fuzzTangent-dot(fuzzTangent,fuzzNormalW)*fuzzNormalW);let fuzzBitangent=cross(fuzzNormalW,fuzzTangent);let fuzzGeoInfo: geometryInfoOutParams=geometryInfo( -fuzzNormalW,viewDirectionW.xyz,fuzz_roughness,geometricNormalW -); -#endif -let coatReflectance: ReflectanceParams=dielectricReflectance( -coat_ior -,1.0f -,vec3f(1.0f) -,coat_weight -); -#ifdef THIN_FILM -let thin_film_outside_ior: f32=mix(1.0f,coat_ior,coat_weight); -#endif -let baseDielectricReflectance: ReflectanceParams=dielectricReflectance( -specular_ior -,mix(1.0f,coat_ior,coat_weight) -,specular_color -,specular_weight -);let baseConductorReflectance: ReflectanceParams=conductorReflectance(base_color,specular_color,specular_weight);var material_surface_ibl: vec3f=vec3f(0.f,0.f,0.f); -#include -var material_surface_direct: vec3f=vec3f(0.f,0.f,0.f); -#if defined(LIGHT0) -var aggShadow: f32=0.f;var numLights: f32=0.f; -#include[0..maxSimultaneousLights] -#include[0..maxSimultaneousLights] -#endif -var material_surface_emission: vec3f=uniforms.vEmissionColor; -#ifdef EMISSION_COLOR -let emissionColorTex: vec3f=textureSample(emissionColorSampler,emissionColorSamplerSampler,uniforms.vEmissionColorUV+uvOffset).rgb; -#ifdef EMISSION_COLOR_GAMMA -material_surface_emission*=toLinearSpace(emissionColorTex.rgb); -#else -material_surface_emission*=emissionColorTex.rgb; -#endif -material_surface_emission*= uniforms.vEmissionColorInfos.y; -#endif -material_surface_emission*=uniforms.vLightingIntensity.y; -#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION -var finalColor: vec4f=vec4f(material_surface_ibl+material_surface_direct+material_surface_emission,alpha); -#define CUSTOM_FRAGMENT_BEFORE_FOG -finalColor=max(finalColor,vec4f(0.0)); -#include -#include(color,finalColor) -#include -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#include -#endif -#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY) -fragmentOutputs.color=finalColor; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+finalColor.rgb*finalColor.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-finalColor.a));} else {fragmentOutputs.backColor+=finalColor;} -#endif -#include -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=E);const re={name:r,shader:E};export{re as openpbrPixelShaderWGSL}; diff --git a/assets/openpbr.fragment-Dbeojf8B.js b/assets/openpbr.fragment-Dbeojf8B.js deleted file mode 100644 index b6e6392426477300fd951b71c359b3b92da33bbe..0000000000000000000000000000000000000000 --- a/assets/openpbr.fragment-Dbeojf8B.js +++ /dev/null @@ -1,1278 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./oitFragment-cUdAGBvC.js";import"./openpbrUboDeclaration-DYpAvMMQ.js";import"./pbrDebug-B24xpn-H.js";import"./shadowsFragmentFunctions-dMCKkVlT.js";import"./bumpFragment-Dn7_UB6Q.js";import"./imageProcessingFunctions-BwYIAaLN.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./fogFragment-M_o52SDz.js";import"./helperFunctions-tBt4f_K3.js";import"./hdrFilteringFunctions-B6pmqAql.js";import"./harmonicsFunctions-DgiK80M3.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";const i="openpbrFragmentDeclaration",h=`uniform vec4 vEyePosition;uniform float vBaseWeight;uniform vec4 vBaseColor;uniform float vBaseDiffuseRoughness;uniform vec4 vReflectanceInfo;uniform vec4 vSpecularColor;uniform vec3 vSpecularAnisotropy;uniform float vCoatWeight;uniform vec3 vCoatColor;uniform float vCoatRoughness;uniform float vCoatRoughnessAnisotropy;uniform float vCoatIor;uniform float vCoatDarkening;uniform float vFuzzWeight;uniform vec3 vFuzzColor;uniform float vFuzzRoughness;uniform vec2 vGeometryCoatTangent;uniform vec3 vEmissionColor;uniform float vThinFilmWeight;uniform vec2 vThinFilmThickness;uniform float vThinFilmIor;uniform vec4 vLightingIntensity;uniform float visibility; -#ifdef BASE_COLOR -uniform vec2 vBaseColorInfos; -#endif -#ifdef BASE_WEIGHT -uniform vec2 vBaseWeightInfos; -#endif -#ifdef BASE_METALNESS -uniform vec2 vBaseMetalnessInfos; -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -uniform vec2 vBaseDiffuseRoughnessInfos; -#endif -#ifdef SPECULAR_WEIGHT -uniform vec2 vSpecularWeightInfos; -#endif -#ifdef SPECULAR_COLOR -uniform vec2 vSpecularColorInfos; -#endif -#ifdef SPECULAR_ROUGHNESS -uniform vec2 vSpecularRoughnessInfos; -#endif -#ifdef SPECULAR_ROUGHNESS_ANISOTROPY -uniform vec2 vSpecularRoughnessAnisotropyInfos; -#endif -#ifdef SPECULAR_IOR -uniform vec2 vSpecularIorInfos; -#endif -#ifdef AMBIENT_OCCLUSION -uniform vec2 vAmbientOcclusionInfos; -#endif -#ifdef GEOMETRY_NORMAL -uniform vec2 vGeometryNormalInfos;uniform vec2 vTangentSpaceParams; -#endif -#ifdef GEOMETRY_TANGENT -uniform vec2 vGeometryTangentInfos; -#endif -#ifdef GEOMETRY_COAT_NORMAL -uniform vec2 vGeometryCoatNormalInfos; -#endif -#ifdef GEOMETRY_OPACITY -uniform vec2 vGeometryOpacityInfos; -#endif -#ifdef EMISSION_COLOR -uniform vec2 vEmissionColorInfos; -#endif -#ifdef COAT_WEIGHT -uniform vec2 vCoatWeightInfos; -#endif -#ifdef COAT_COLOR -uniform vec2 vCoatColorInfos; -#endif -#ifdef COAT_ROUGHNESS -uniform vec2 vCoatRoughnessInfos; -#endif -#ifdef COAT_ROUGHNESS_ANISOTROPY -uniform vec2 vCoatRoughnessAnisotropyInfos; -#endif -#ifdef COAT_IOR -uniform vec2 vCoatIorInfos; -#endif -#ifdef COAT_DARKENING -uniform vec2 vCoatDarkeningInfos; -#endif -#ifdef FUZZ_WEIGHT -uniform vec2 vFuzzWeightInfos; -#endif -#ifdef FUZZ_COLOR -uniform vec2 vFuzzColorInfos; -#endif -#ifdef FUZZ_ROUGHNESS -uniform vec2 vFuzzRoughnessInfos; -#endif -#ifdef GEOMETRY_COAT_TANGENT -uniform vec2 vGeometryCoatTangentInfos; -#endif -#ifdef THIN_FILM_WEIGHT -uniform vec2 vThinFilmWeightInfos; -#endif -#ifdef THIN_FILM_THICKNESS -uniform vec2 vThinFilmThicknessInfos; -#endif -#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS) -uniform mat4 view; -#endif -#ifdef REFLECTION -uniform vec2 vReflectionInfos; -#ifdef REALTIME_FILTERING -uniform vec2 vReflectionFilteringInfo; -#endif -uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos; -#if defined(USEIRRADIANCEMAP) && defined(USE_IRRADIANCE_DOMINANT_DIRECTION) -uniform vec3 vReflectionDominantDirection; -#endif -#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC) -uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; -#endif -#endif -#ifdef PREPASS -#ifdef SS_SCATTERING -uniform float scatteringDiffusionProfile; -#endif -#endif -#if DEBUGMODE>0 -uniform vec2 vDebugMode; -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos; -#endif -#include -#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22; -#else -uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX; -#endif -#endif -#define ADDITIONAL_FRAGMENT_DECLARATION -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=h);const n="openpbrFragmentSamplersDeclaration",N=`#include(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor,_SAMPLERNAME_,baseColor) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness,_SAMPLERNAME_,baseMetalness) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight,_SAMPLERNAME_,specularWeight) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor,_SAMPLERNAME_,specularColor) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness,_SAMPLERNAME_,specularRoughness) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy,_SAMPLERNAME_,specularRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight,_SAMPLERNAME_,coatWeight) -#include(_DEFINENAME_,COAT_COLOR,_VARYINGNAME_,CoatColor,_SAMPLERNAME_,coatColor) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness,_SAMPLERNAME_,coatRoughness) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy,_SAMPLERNAME_,coatRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening,_SAMPLERNAME_,coatDarkening) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight,_SAMPLERNAME_,fuzzWeight) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor,_SAMPLERNAME_,fuzzColor) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness,_SAMPLERNAME_,fuzzRoughness) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity,_SAMPLERNAME_,geometryOpacity) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent,_SAMPLERNAME_,geometryTangent) -#include(_DEFINENAME_,GEOMETRY_COAT_TANGENT,_VARYINGNAME_,GeometryCoatTangent,_SAMPLERNAME_,geometryCoatTangent) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor,_SAMPLERNAME_,emissionColor) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight,_SAMPLERNAME_,thinFilmWeight) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness,_SAMPLERNAME_,thinFilmThickness) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion,_SAMPLERNAME_,ambientOcclusion) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -#define sampleReflection(s,c) textureCube(s,c) -uniform samplerCube reflectionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l) -#else -uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh; -#endif -#ifdef USEIRRADIANCEMAP -uniform samplerCube irradianceSampler; -#endif -#else -#define sampleReflection(s,c) texture2D(s,c) -uniform sampler2D reflectionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l) -#else -uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh; -#endif -#ifdef USEIRRADIANCEMAP -uniform sampler2D irradianceSampler; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#endif -#endif -#ifdef ENVIRONMENTBRDF -uniform sampler2D environmentBrdfSampler; -#endif -#ifdef FUZZENVIRONMENTBRDF -uniform sampler2D environmentFuzzBrdfSampler; -#endif -#if defined(ANISOTROPIC) || defined(FUZZ) -uniform sampler2D blueNoiseSampler; -#endif -#ifdef IBL_CDF_FILTERING -uniform sampler2D icdfSampler; -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=N);const a="openpbrNormalMapFragmentMainFunctions",A=`#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) || defined(ANISOTROPIC) || defined(FUZZ) || defined(DETAIL) -#if defined(TANGENT) && defined(NORMAL) -varying mat3 vTBN; -#endif -#ifdef OBJECTSPACE_NORMALMAP -uniform mat4 normalMatrix; -#if defined(WEBGL2) || defined(WEBGPU) -mat4 toNormalMatrix(mat4 wMatrix) -{mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;} -#else -mat4 toNormalMatrix(mat4 m) -{float -a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3], -a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3], -a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3], -a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3], -b00=a00*a11-a01*a10, -b01=a00*a12-a02*a10, -b02=a00*a13-a03*a10, -b03=a01*a12-a02*a11, -b04=a01*a13-a03*a11, -b05=a02*a13-a03*a12, -b06=a20*a31-a21*a30, -b07=a20*a32-a22*a30, -b08=a20*a33-a23*a30, -b09=a21*a32-a22*a31, -b10=a21*a33-a23*a31, -b11=a22*a33-a23*a32, -det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4( -a11*b11-a12*b10+a13*b09, -a02*b10-a01*b11-a03*b09, -a31*b05-a32*b04+a33*b03, -a22*b04-a21*b05-a23*b03, -a12*b08-a10*b11-a13*b07, -a00*b11-a02*b08+a03*b07, -a32*b02-a30*b05-a33*b01, -a20*b05-a22*b02+a23*b01, -a10*b10-a11*b08+a13*b06, -a01*b08-a00*b10-a03*b06, -a30*b04-a31*b02+a33*b00, -a21*b02-a20*b04-a23*b00, -a11*b07-a10*b09-a12*b06, -a00*b09-a01*b07+a02*b06, -a31*b01-a30*b03-a32*b00, -a20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0], -mi[0][1],mi[1][1],mi[2][1],mi[3][1], -mi[0][2],mi[1][2],mi[2][2],mi[3][2], -mi[0][3],mi[1][3],mi[2][3],mi[3][3]);} -#endif -#endif -vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale) -{ -#ifdef NORMALXYSCALE -normal=normalize(normal*vec3(scale,scale,1.0)); -#endif -return normalize(cotangentFrame*normal);} -vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale) -{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);} -mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams) -{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);} -#endif -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=A);const t="openpbrNormalMapFragmentFunctions",S=`#if defined(GEOMETRY_NORMAL) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal,_SAMPLERNAME_,geometryNormal) -#endif -#if defined(GEOMETRY_COAT_NORMAL) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal,_SAMPLERNAME_,geometryCoatNormal) -#endif -#if defined(DETAIL) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail) -#endif -#if defined(GEOMETRY_NORMAL) && defined(PARALLAX) -const float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; icurrRayHeight) -{float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;} -else -{currRayHeight-=stepSize;vLastOffset=vCurrOffset; -#ifdef PARALLAX_RHS -vCurrOffset-=stepSize*vMaxOffset; -#else -vCurrOffset+=stepSize*vMaxOffset; -#endif -lastSampledHeight=currSampledHeight;}} -return vCurrOffset;} -vec2 parallaxOffset(vec3 viewDir,float heightScale) -{float height=texture2D(geometryNormalSampler,vGeometryNormalUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height; -#ifdef PARALLAX_RHS -return texCoordOffset; -#else -return -texCoordOffset; -#endif -} -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=S);const r="openpbrDielectricReflectance",F=`struct ReflectanceParams -{float F0;float F90;vec3 coloredF0;vec3 coloredF90;}; -#define pbr_inline -ReflectanceParams dielectricReflectance( -in float insideIOR,in float outsideIOR,in vec3 specularColor,in float specularWeight -) -{ReflectanceParams outParams;float dielectricF0=pow((insideIOR-outsideIOR)/(insideIOR+outsideIOR),2.0);float dielectricF0_NoSpec=pow((1.0-outsideIOR)/(1.0+outsideIOR),2.0);float f90Scale=clamp(2.0*abs(insideIOR-outsideIOR),0.0,1.0);float f90Scale_NoSpec=clamp(2.0*abs(1.0-outsideIOR),0.0,1.0); -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -vec3 dielectricColorF90=specularColor.rgb*vec3(f90Scale);vec3 dielectricColorF90_NoSpec=specularColor.rgb*vec3(f90Scale_NoSpec); -#else -vec3 dielectricColorF90=vec3(f90Scale);vec3 dielectricColorF90_NoSpec=vec3(f90Scale_NoSpec); -#endif -#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF -float maxF0=max(specularColor.r,max(specularColor.g,specularColor.b));outParams.F0=mix(dielectricF0_NoSpec,dielectricF0,specularWeight)*maxF0; -#else -outParams.F0=mix(dielectricF0_NoSpec,dielectricF0,specularWeight); -#endif -outParams.F90=mix(f90Scale_NoSpec,f90Scale,specularWeight);outParams.coloredF0=mix(vec3(dielectricF0_NoSpec),vec3(dielectricF0),specularWeight)*specularColor.rgb;outParams.coloredF90=mix(dielectricColorF90_NoSpec,dielectricColorF90,specularWeight);return outParams;} -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=F);const l="openpbrConductorReflectance",T=`#define pbr_inline -ReflectanceParams conductorReflectance(in vec3 baseColor,in vec3 specularColor,in float specularWeight) -{ReflectanceParams outParams; -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -outParams.coloredF0=baseColor*specularWeight;outParams.coloredF90=specularColor*specularWeight; -#else -outParams.coloredF0=baseColor;outParams.coloredF90=vec3(1.0); -#endif -outParams.F0=1.0;outParams.F90=1.0;return outParams;}`;e.IncludesShadersStore[l]||(e.IncludesShadersStore[l]=T);const f="openpbrBlockAmbientOcclusion",L=`struct ambientOcclusionOutParams -{vec3 ambientOcclusionColor; -#if DEBUGMODE>0 && defined(AMBIENT_OCCLUSION) -vec3 ambientOcclusionColorMap; -#endif -}; -#define pbr_inline -ambientOcclusionOutParams ambientOcclusionBlock( -#ifdef AMBIENT_OCCLUSION -in vec3 ambientOcclusionColorMap_, -in vec2 ambientInfos -#endif -) -{ambientOcclusionOutParams outParams;vec3 ambientOcclusionColor=vec3(1.,1.,1.); -#ifdef AMBIENT_OCCLUSION -vec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*ambientInfos.y; -#ifdef AMBIENTINGRAYSCALE -ambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r); -#endif -#if DEBUGMODE>0 -outParams.ambientOcclusionColorMap=ambientOcclusionColorMap; -#endif -#endif -outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;} -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=L);const c="openpbrGeometryInfo",O=`struct geometryInfoOutParams -{float NdotV;float NdotVUnclamped;vec3 environmentBrdf;float horizonOcclusion;};struct geometryInfoAnisoOutParams -{float NdotV;float NdotVUnclamped;vec3 environmentBrdf;float horizonOcclusion;float anisotropy;vec3 anisotropicTangent;vec3 anisotropicBitangent;mat3 TBN;}; -#define pbr_inline -geometryInfoOutParams geometryInfo( -in vec3 normalW,in vec3 viewDirectionW,in float roughness,in vec3 geometricNormalW -) -{geometryInfoOutParams outParams;outParams.NdotVUnclamped=dot(normalW,viewDirectionW);outParams.NdotV=absEps(outParams.NdotVUnclamped); -#if defined(ENVIRONMENTBRDF) -outParams.environmentBrdf=getBRDFLookup(outParams.NdotV,roughness); -#else -outParams.environmentBrdf=vec3(0.0); -#endif -outParams.horizonOcclusion=1.0; -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -#ifdef HORIZONOCCLUSION -#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) -#ifdef REFLECTIONMAP_3D -outParams.horizonOcclusion=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW); -#endif -#endif -#endif -#endif -return outParams;} -#define pbr_inline -geometryInfoAnisoOutParams geometryInfoAniso( -in vec3 normalW,in vec3 viewDirectionW,in float roughness,in vec3 geometricNormalW -,in vec3 vAnisotropy,in mat3 TBN -) -{geometryInfoOutParams geoInfo=geometryInfo(normalW,viewDirectionW,roughness,geometricNormalW);geometryInfoAnisoOutParams outParams;outParams.NdotV=geoInfo.NdotV;outParams.NdotVUnclamped=geoInfo.NdotVUnclamped;outParams.environmentBrdf=geoInfo.environmentBrdf;outParams.horizonOcclusion=geoInfo.horizonOcclusion;outParams.anisotropy=vAnisotropy.b;vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));outParams.anisotropicTangent=normalize(anisoTBN*anisotropyDirection);outParams.anisotropicBitangent=normalize(cross(anisoTBN[2],outParams.anisotropicTangent));outParams.TBN=TBN;return outParams;}`;e.IncludesShadersStore[c]||(e.IncludesShadersStore[c]=O);const s="openpbrIblFunctions",C=`#ifdef REFLECTION -vec3 sampleIrradiance( -in vec3 surfaceNormal -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,in vec3 vEnvironmentIrradianceSH -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,in mat4 iblMatrix -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,in samplerCube irradianceSampler -#else -,in sampler2D irradianceSampler -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,in vec3 reflectionDominantDirection -#endif -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,in sampler2D icdfSampler -#endif -#endif -,in vec2 vReflectionInfos -,in vec3 viewDirectionW -,in float diffuseRoughness -,in vec3 surfaceAlbedo -) {vec3 environmentIrradiance=vec3(0.,0.,0.); -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -vec3 irradianceVector=(iblMatrix*vec4(surfaceNormal,0)).xyz;vec3 irradianceView=(iblMatrix*vec4(viewDirectionW,0)).xyz; -#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -{float NdotV=max(dot(surfaceNormal,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness);} -#endif -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0; -#endif -#endif -#ifdef USESPHERICALFROMREFLECTIONMAP -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -environmentIrradiance=vEnvironmentIrradianceSH; -#else -#if defined(REALTIME_FILTERING) -environmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView -#ifdef IBL_CDF_FILTERING -,icdfSampler -#endif -); -#else -environmentIrradiance=computeEnvironmentIrradiance(irradianceVector); -#endif -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -vec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,irradianceVector); -#else -vec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,reflectionCoords); -#endif -environmentIrradiance=environmentIrradianceFromTexture.rgb; -#ifdef RGBDREFLECTION -environmentIrradiance.rgb=fromRGBD(environmentIrradianceFromTexture); -#endif -#ifdef GAMMAREFLECTION -environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb); -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -vec3 Ls=normalize(reflectionDominantDirection);float NoL=dot(irradianceVector,Ls);float NoV=dot(irradianceVector,irradianceView);vec3 diffuseRoughnessTerm=vec3(1.0); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -float LoV=dot (Ls,irradianceView);float mag=length(reflectionDominantDirection)*2.0;vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0))); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -vec3 H=(irradianceView+Ls)*0.5;float VoH=dot(irradianceView,H);diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -environmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm; -#endif -#endif -environmentIrradiance*=vReflectionInfos.x;return environmentIrradiance;} -#define pbr_inline -#ifdef REFLECTIONMAP_3D -vec3 createReflectionCoords( -#else -vec2 createReflectionCoords( -#endif -in vec3 vPositionW -,in vec3 normalW -) -{vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -vec3 reflectionCoords=reflectionVector; -#else -vec2 reflectionCoords=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0-reflectionCoords.y; -#endif -return reflectionCoords;} -#define pbr_inline -#define inline -vec3 sampleRadiance( -in float alphaG -,in vec3 vReflectionMicrosurfaceInfos -,in vec2 vReflectionInfos -,in geometryInfoOutParams geoInfo -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSampler -,const vec3 reflectionCoords -#else -,in sampler2D reflectionSampler -,const vec2 reflectionCoords -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#endif -) -{vec4 environmentRadiance=vec4(0.,0.,0.,0.); -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness); -#else -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG); -#endif -reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z; -#ifdef REALTIME_FILTERING -environmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0); -#else -environmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD); -#endif -#ifdef RGBDREFLECTION -environmentRadiance.rgb=fromRGBD(environmentRadiance); -#endif -#ifdef GAMMAREFLECTION -environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb); -#endif -environmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;} -#if defined(ANISOTROPIC) -#define pbr_inline -#define inline -vec3 sampleRadianceAnisotropic( -in float alphaG -,in vec3 vReflectionMicrosurfaceInfos -,in vec2 vReflectionInfos -,in geometryInfoAnisoOutParams geoInfo -,const vec3 normalW -,const vec3 viewDirectionW -,const vec3 positionW -,const vec3 noise -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSampler -#else -,in sampler2D reflectionSampler -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#endif -) -{vec4 environmentRadiance=vec4(0.,0.,0.,0.);float alphaT=alphaG*sqrt(2.0/(1.0+(1.0-geoInfo.anisotropy)*(1.0-geoInfo.anisotropy)));float alphaB=(1.0-geoInfo.anisotropy)*alphaT;alphaG=alphaB; -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness); -#else -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG); -#endif -reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z; -#ifdef REALTIME_FILTERING -vec3 view=(reflectionMatrix*vec4(viewDirectionW,0.0)).xyz;vec3 tangent=(reflectionMatrix*vec4(geoInfo.anisotropicTangent,0.0)).xyz;vec3 bitangent=(reflectionMatrix*vec4(geoInfo.anisotropicBitangent,0.0)).xyz;vec3 normal=(reflectionMatrix*vec4(normalW,0.0)).xyz; -#ifdef REFLECTIONMAP_OPPOSITEZ -view.z*=-1.0;tangent.z*=-1.0;bitangent.z*=-1.0;normal.z*=-1.0; -#endif -environmentRadiance = -vec4(radianceAnisotropic(alphaT,alphaB,reflectionSampler, -view,tangent, -bitangent,normal, -vReflectionFilteringInfo,noise.xy), -1.0); -#else -const int samples=16;vec4 radianceSample=vec4(0.0);vec3 reflectionCoords=vec3(0.0);float sample_weight=0.0;float total_weight=0.0;float step=1.0/float(max(samples-1,1));for (int i=0; i0.0) {float blend=t;bentNormal=normalize(mix(normalW,geoInfo.anisotropicTangent,blend));} else {bentNormal=normalW;} -reflectionCoords=createReflectionCoords(positionW,bentNormal);radianceSample=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD); -#ifdef RGBDREFLECTION -environmentRadiance.rgb+=sample_weight*fromRGBD(radianceSample); -#elif defined(GAMMAREFLECTION) -environmentRadiance.rgb+=sample_weight*toLinearSpace(radianceSample.rgb); -#else -environmentRadiance.rgb+=sample_weight*radianceSample.rgb; -#endif -total_weight+=sample_weight;} -environmentRadiance=vec4(environmentRadiance.xyz/float(total_weight),1.0); -#endif -environmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;} -#endif -#define pbr_inline -vec3 conductorIblFresnel(in ReflectanceParams reflectance,in float NdotV,in float roughness,in vec3 environmentBrdf) -{ -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -vec3 albedoF0=mix(reflectance.coloredF0,pow(reflectance.coloredF0,vec3(1.4)),roughness);return getF82Specular(NdotV,albedoF0,reflectance.coloredF90,roughness); -#else -return getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90,environmentBrdf); -#endif -} -#endif -`;e.IncludesShadersStore[s]||(e.IncludesShadersStore[s]=C);const d="openpbrNormalMapFragment",b=`vec2 uvOffset=vec2(0.0,0.0); -#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) || defined(PARALLAX) || defined(DETAIL) -#ifdef NORMALXYSCALE -float normalScale=1.0; -#elif defined(GEOMETRY_NORMAL) -float normalScale=vGeometryNormalInfos.y; -#else -float normalScale=1.0; -#endif -#if defined(TANGENT) && defined(NORMAL) -mat3 TBN=vTBN; -#elif defined(GEOMETRY_NORMAL) -vec2 TBNUV=gl_FrontFacing ? vGeometryNormalUV : -vGeometryNormalUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams); -#else -vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.)); -#endif -#elif defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -mat3 TBN=vTBN; -#else -vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.)); -#endif -#endif -#ifdef PARALLAX -mat3 invTBN=transposeMat3(TBN); -#ifdef PARALLAXOCCLUSION -#else -#endif -#endif -#ifdef DETAIL -vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB); -#endif -#ifdef GEOMETRY_COAT_NORMAL -coatNormalW=perturbNormal(TBN,texture2D(geometryCoatNormalSampler,vGeometryCoatNormalUV+uvOffset).xyz,vGeometryCoatNormalInfos.y); -#endif -#ifdef GEOMETRY_NORMAL -#ifdef OBJECTSPACE_NORMALMAP -#define CUSTOM_FRAGMENT_BUMP_FRAGMENT -normalW=normalize(texture2D(geometryNormalSampler,vGeometryNormalUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW); -#elif !defined(DETAIL) -normalW=perturbNormal(TBN,texture2D(geometryNormalSampler,vGeometryNormalUV+uvOffset).xyz,vGeometryNormalInfos.y); -#else -vec3 sampledNormal=texture2D(geometryNormalSampler,vGeometryNormalUV+uvOffset).xyz*2.0-1.0; -#if DETAIL_NORMALBLENDMETHOD==0 -detailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(sampledNormal.xy+detailNormal.xy,sampledNormal.z*detailNormal.z)); -#elif DETAIL_NORMALBLENDMETHOD==1 -detailNormal.xy*=vDetailInfos.z;sampledNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=sampledNormal*dot(sampledNormal,detailNormal)/sampledNormal.z-detailNormal; -#endif -normalW=perturbNormalBase(TBN,blendedNormal,vGeometryNormalInfos.y); -#endif -#elif defined(DETAIL) -detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z); -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=b);const m="openpbrBlockNormalFinal",D=`#if defined(FORCENORMALFORWARD) && defined(NORMAL) -vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w; -#if defined(TWOSIDEDLIGHTING) -faceNormal=gl_FrontFacing ? faceNormal : -faceNormal; -#endif -normalW*=sign(dot(normalW,faceNormal));coatNormalW*=sign(dot(coatNormalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -#if defined(MIRRORED) -normalW=gl_FrontFacing ? -normalW : normalW;coatNormalW=gl_FrontFacing ? -coatNormalW : coatNormalW; -#else -normalW=gl_FrontFacing ? normalW : -normalW;coatNormalW=gl_FrontFacing ? coatNormalW : -coatNormalW; -#endif -#endif -`;e.IncludesShadersStore[m]||(e.IncludesShadersStore[m]=D);const u="openpbrBaseLayerData",M=`vec3 base_color=vec3(0.8);float base_metalness=0.0;float base_diffuse_roughness=0.0;float specular_weight=1.0;float specular_roughness=0.3;vec3 specular_color=vec3(1.0);float specular_roughness_anisotropy=0.0;float specular_ior=1.5;float alpha=1.0;vec2 geometry_tangent=vec2(1.0,0.0); -#ifdef BASE_WEIGHT -vec4 baseWeightFromTexture=texture2D(baseWeightSampler,vBaseWeightUV+uvOffset); -#endif -#ifdef BASE_COLOR -vec4 baseColorFromTexture=texture2D(baseColorSampler,vBaseColorUV+uvOffset); -#endif -#ifdef BASE_METALNESS -vec4 metallicFromTexture=texture2D(baseMetalnessSampler,vBaseMetalnessUV+uvOffset); -#endif -#if defined(ROUGHNESSSTOREINMETALMAPGREEN) && defined(BASE_METALNESS) -float roughnessFromTexture=metallicFromTexture.g; -#elif defined(SPECULAR_ROUGHNESS) -float roughnessFromTexture=texture2D(specularRoughnessSampler,vSpecularRoughnessUV+uvOffset).r; -#endif -#ifdef GEOMETRY_TANGENT -vec3 geometryTangentFromTexture=texture2D(geometryTangentSampler,vGeometryTangentUV+uvOffset).rgb; -#endif -#ifdef SPECULAR_ROUGHNESS_ANISOTROPY -float anisotropyFromTexture=texture2D(specularRoughnessAnisotropySampler,vSpecularRoughnessAnisotropyUV+uvOffset).r*vSpecularRoughnessAnisotropyInfos.y; -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -float baseDiffuseRoughnessFromTexture=texture2D(baseDiffuseRoughnessSampler,vBaseDiffuseRoughnessUV+uvOffset).r; -#endif -#ifdef GEOMETRY_OPACITY -vec4 opacityFromTexture=texture2D(geometryOpacitySampler,vGeometryOpacityUV+uvOffset); -#endif -#ifdef DECAL -vec4 decalFromTexture=texture2D(decalSampler,vDecalUV+uvOffset); -#endif -#ifdef SPECULAR_COLOR -vec4 specularColorFromTexture=texture2D(specularColorSampler,vSpecularColorUV+uvOffset); -#endif -#ifdef SPECULAR_WEIGHT -#ifdef SPECULAR_WEIGHT_IN_ALPHA -float specularWeightFromTexture=texture2D(specularWeightSampler,vSpecularWeightUV+uvOffset).a; -#else -float specularWeightFromTexture=texture2D(specularWeightSampler,vSpecularWeightUV+uvOffset).r; -#endif -#endif -#if defined(ANISOTROPIC) || defined(FUZZ) -vec3 noise=texture2D(blueNoiseSampler,gl_FragCoord.xy/256.0).xyz; -#endif -base_color=vBaseColor.rgb; -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -base_color*=vColor.rgb; -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=vColor.a; -#endif -base_color*=vec3(vBaseWeight);alpha=vBaseColor.a;base_metalness=vReflectanceInfo.x;base_diffuse_roughness=vBaseDiffuseRoughness;specular_roughness=vReflectanceInfo.y;specular_color=vSpecularColor.rgb;specular_weight=vReflectanceInfo.a;specular_ior=vReflectanceInfo.z;specular_roughness_anisotropy=vSpecularAnisotropy.b;geometry_tangent=vSpecularAnisotropy.rg; -#ifdef BASE_COLOR -#ifdef BASE_COLOR_GAMMA -base_color*=toLinearSpace(baseColorFromTexture.rgb); -#else -base_color*=baseColorFromTexture.rgb; -#endif -base_color*=vBaseColorInfos.y; -#endif -#ifdef BASE_WEIGHT -base_color*=baseWeightFromTexture.r; -#endif -#if defined(BASE_COLOR) && defined(ALPHA_FROM_BASE_COLOR_TEXTURE) -alpha*=baseColorFromTexture.a; -#elif defined(GEOMETRY_OPACITY) -alpha*=opacityFromTexture.r;alpha*=vGeometryOpacityInfos.y; -#endif -#ifdef ALPHATEST -#if DEBUGMODE != 88 -if (alpha0.0) { -#ifdef REFLECTIONMAP_3D -vec3 reflectionCoords=vec3(0.,0.,0.); -#else -vec2 reflectionCoords=vec2(0.,0.); -#endif -reflectionCoords=createReflectionCoords(vPositionW,coatNormalW);float coatAlphaG=coat_roughness*coat_roughness; -#ifdef ANISOTROPIC_COAT -coatEnvironmentLight=sampleRadianceAnisotropic(coatAlphaG,vReflectionMicrosurfaceInfos.rgb,vReflectionInfos -,coatGeoInfo -,coatNormalW -,viewDirectionW -,vPositionW -,noise -,reflectionSampler -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -); -#else -coatEnvironmentLight=sampleRadiance(coatAlphaG,vReflectionMicrosurfaceInfos.rgb,vReflectionInfos -,coatGeoInfo -,reflectionSampler -,reflectionCoords -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -); -#endif -} -#ifdef FUZZ -float modifiedFuzzRoughness=clamp(fuzz_roughness*(1.0-0.5*environmentFuzzBrdf.y),0.0,1.0);vec3 fuzzEnvironmentLight=vec3(0.0);float totalWeight=0.0;float fuzzIblFresnel=sqrt(environmentFuzzBrdf.z);for (int i=0; i0.0) {coatIblFresnel=getReflectanceFromBRDFLookup(vec3(coatReflectance.F0),vec3(coatReflectance.F90),coatGeoInfo.environmentBrdf).r;} -vec3 slab_diffuse_ibl=vec3(0.,0.,0.);vec3 slab_glossy_ibl=vec3(0.,0.,0.);vec3 slab_metal_ibl=vec3(0.,0.,0.);vec3 slab_coat_ibl=vec3(0.,0.,0.);slab_diffuse_ibl=baseDiffuseEnvironmentLight*vLightingIntensity.z;slab_diffuse_ibl*=aoOut.ambientOcclusionColor;slab_glossy_ibl=baseSpecularEnvironmentLight*vLightingIntensity.z;slab_metal_ibl=baseSpecularEnvironmentLight*conductorIblFresnel*vLightingIntensity.z;vec3 coatAbsorption=vec3(1.0);if (coat_weight>0.0) {slab_coat_ibl=coatEnvironmentLight*vLightingIntensity.z;float hemisphere_avg_fresnel=coatReflectance.F0+0.5*(1.0-coatReflectance.F0);float averageReflectance=(coatIblFresnel+hemisphere_avg_fresnel)*0.5;float roughnessFactor=1.0-coat_roughness*0.5;averageReflectance*=roughnessFactor;float darkened_transmission=(1.0-averageReflectance)*(1.0-averageReflectance);darkened_transmission=mix(1.0,darkened_transmission,coat_darkening);float sin2=1.0-coatGeoInfo.NdotV*coatGeoInfo.NdotV;sin2=sin2/(coat_ior*coat_ior);float cos_t=sqrt(1.0-sin2);float coatPathLength=1.0/cos_t;vec3 colored_transmission=pow(coat_color,vec3(coatPathLength));coatAbsorption=mix(vec3(1.0),colored_transmission*darkened_transmission,coat_weight);} -#ifdef FUZZ -vec3 slab_fuzz_ibl=fuzzEnvironmentLight*vLightingIntensity.z; -#endif -vec3 slab_subsurface_ibl=vec3(0.,0.,0.);vec3 slab_translucent_base_ibl=vec3(0.,0.,0.);slab_diffuse_ibl*=base_color.rgb; -#define CUSTOM_FRAGMENT_BEFORE_IBLLAYERCOMPOSITION -vec3 material_opaque_base_ibl=mix(slab_diffuse_ibl,slab_subsurface_ibl,subsurface_weight);vec3 material_dielectric_base_ibl=mix(material_opaque_base_ibl,slab_translucent_base_ibl,transmission_weight);vec3 material_dielectric_gloss_ibl=material_dielectric_base_ibl*(1.0-dielectricIblFresnel)+slab_glossy_ibl*dielectricIblColoredFresnel;vec3 material_base_substrate_ibl=mix(material_dielectric_gloss_ibl,slab_metal_ibl,base_metalness);vec3 material_coated_base_ibl=layer(material_base_substrate_ibl,slab_coat_ibl,coatIblFresnel,coatAbsorption,vec3(1.0)); -#ifdef FUZZ -material_surface_ibl=layer(material_coated_base_ibl,slab_fuzz_ibl,fuzzIblFresnel*fuzz_weight,vec3(1.0),fuzz_color); -#else -material_surface_ibl=material_coated_base_ibl; -#endif -#endif -`;e.IncludesShadersStore[p]||(e.IncludesShadersStore[p]=x);const I="openpbrDirectLightingInit",y=`#ifdef LIGHT{X} -preLightingInfo preInfo{X};preLightingInfo preInfoCoat{X};vec4 lightColor{X}=light{X}.vLightDiffuse;float shadow{X}=1.; -#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) -#else -#define CUSTOM_LIGHT{X}_COLOR -#ifdef SPOTLIGHT{X} -preInfo{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);preInfoCoat{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW,vPositionW); -#elif defined(POINTLIGHT{X}) -preInfo{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);preInfoCoat{X}=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW,vPositionW); -#elif defined(HEMILIGHT{X}) -preInfo{X}=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);preInfoCoat{X}=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW); -#elif defined(DIRLIGHT{X}) -preInfo{X}=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);preInfoCoat{X}=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,coatNormalW); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo{X}=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,specular_roughness);preInfoCoat{X}=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,coatNormalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,coat_roughness); -#endif -preInfo{X}.NdotV=baseGeoInfo.NdotV;preInfoCoat{X}.NdotV=coatGeoInfo.NdotV; -#ifdef SPOTLIGHT{X} -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo{X}.attenuation=computeDistanceLightFalloff_GLTF(preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Physical(preInfo{X}.lightDistanceSquared); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w); -#endif -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Standard(preInfo{X}.lightOffset,light{X}.vLightFalloff.x); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w,light{X}.vLightData.w); -#endif -#else -preInfo{X}.attenuation=computeDistanceLightFalloff(preInfo{X}.lightOffset,preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#ifdef IESLIGHTTEXTURE{X} -preInfo{X}.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo{X}.L,iesLightTexture{X}); -#else -preInfo{X}.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo{X}.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); -#endif -#endif -#elif defined(POINTLIGHT{X}) -#ifdef LIGHT_FALLOFF_GLTF{X} -preInfo{X}.attenuation=computeDistanceLightFalloff_GLTF(preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.y); -#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Physical(preInfo{X}.lightDistanceSquared); -#elif defined(LIGHT_FALLOFF_STANDARD{X}) -preInfo{X}.attenuation=computeDistanceLightFalloff_Standard(preInfo{X}.lightOffset,light{X}.vLightFalloff.x); -#else -preInfo{X}.attenuation=computeDistanceLightFalloff(preInfo{X}.lightOffset,preInfo{X}.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); -#endif -#else -preInfo{X}.attenuation=1.0; -#endif -preInfoCoat{X}.attenuation=preInfo{X}.attenuation; -#if defined(HEMILIGHT{X}) -preInfo{X}.roughness=specular_roughness;preInfoCoat{X}.roughness=coat_roughness; -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -preInfo{X}.roughness=specular_roughness;preInfoCoat{X}.roughness=coat_roughness; -#else -preInfo{X}.roughness=adjustRoughnessFromLightProperties(specular_roughness,light{X}.vLightSpecular.a,preInfo{X}.lightDistance);preInfoCoat{X}.roughness=adjustRoughnessFromLightProperties(coat_roughness,light{X}.vLightSpecular.a,preInfoCoat{X}.lightDistance); -#endif -preInfo{X}.diffuseRoughness=base_diffuse_roughness;preInfo{X}.surfaceAlbedo=base_color.rgb; -#endif -#endif -`;e.IncludesShadersStore[I]||(e.IncludesShadersStore[I]=y);const v="openpbrDirectLighting",U=`#ifdef LIGHT{X} -{vec3 slab_diffuse=vec3(0.,0.,0.);vec3 slab_subsurface=vec3(0.,0.,0.);vec3 slab_translucent=vec3(0.,0.,0.);vec3 slab_glossy=vec3(0.,0.,0.);float specularFresnel=0.0;vec3 specularColoredFresnel=vec3(0.,0.,0.);vec3 slab_metal=vec3(0.,0.,0.);vec3 slab_coat=vec3(0.,0.,0.);float coatFresnel=0.0;vec3 slab_fuzz=vec3(0.,0.,0.);float fuzzFresnel=0.0; -#ifdef HEMILIGHT{X} -slab_diffuse=computeHemisphericDiffuseLighting(preInfo{X},lightColor{X}.rgb,light{X}.vLightGround); -#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_diffuse=computeAreaDiffuseLighting(preInfo{X},lightColor{X}.rgb); -#else -slab_diffuse=computeDiffuseLighting(preInfo{X},lightColor{X}.rgb); -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -slab_diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW); -#endif -numLights+=1.0; -#ifdef FUZZ -float fuzzNdotH=max(dot(fuzzNormalW,preInfo{X}.H),0.0);vec3 fuzzBrdf=getFuzzBRDFLookup(fuzzNdotH,sqrt(fuzz_roughness)); -#endif -#ifdef THIN_FILM -float thin_film_desaturation_scale=(thin_film_ior-1.0)*sqrt(thin_film_thickness*0.001); -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_glossy=computeAreaSpecularLighting(preInfo{X},light{X}.vLightSpecular.rgb,baseConductorReflectance.F0,baseConductorReflectance.F90); -#else -{ -#ifdef ANISOTROPIC_BASE -slab_glossy=computeAnisotropicSpecularLighting(preInfo{X},viewDirectionW,normalW, -baseGeoInfo.anisotropicTangent,baseGeoInfo.anisotropicBitangent,baseGeoInfo.anisotropy, -0.0,lightColor{X}.rgb); -#else -slab_glossy=computeSpecularLighting(preInfo{X},normalW,vec3(1.0),vec3(1.0),specular_roughness,lightColor{X}.rgb); -#endif -float NdotH=dot(normalW,preInfo{X}.H);specularFresnel=fresnelSchlickGGX(NdotH,baseDielectricReflectance.F0,baseDielectricReflectance.F90);specularColoredFresnel=specularFresnel*specular_color; -#ifdef THIN_FILM -float thinFilmIorScale=clamp(2.0*abs(thin_film_ior-1.0),0.0,1.0);vec3 thinFilmDielectricFresnel=evalIridescence(thin_film_outside_ior,thin_film_ior,preInfo{X}.VdotH,thin_film_thickness,baseDielectricReflectance.coloredF0);thinFilmDielectricFresnel=mix(thinFilmDielectricFresnel,vec3(dot(thinFilmDielectricFresnel,vec3(0.3333))),thin_film_desaturation_scale);specularColoredFresnel=mix(specularColoredFresnel,thinFilmDielectricFresnel*specular_color,thin_film_weight*thinFilmIorScale); -#endif -} -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_metal=computeAreaSpecularLighting(preInfo{X},light{X}.vLightSpecular.rgb,baseConductorReflectance.F0,baseConductorReflectance.F90); -#else -{ -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -vec3 coloredFresnel=getF82Specular(preInfo{X}.VdotH,baseConductorReflectance.coloredF0,baseConductorReflectance.coloredF90,specular_roughness); -#else -vec3 coloredFresnel=fresnelSchlickGGX(preInfo{X}.VdotH,baseConductorReflectance.coloredF0,baseConductorReflectance.coloredF90); -#endif -#ifdef THIN_FILM -float thinFilmIorScale=clamp(2.0*abs(thin_film_ior-1.0),0.0,1.0);vec3 thinFilmConductorFresnel=evalIridescence(thin_film_outside_ior,thin_film_ior,preInfo{X}.VdotH,thin_film_thickness,baseConductorReflectance.coloredF0);thinFilmConductorFresnel=mix(thinFilmConductorFresnel,vec3(dot(thinFilmConductorFresnel,vec3(0.3333))),thin_film_desaturation_scale);coloredFresnel=mix(coloredFresnel,specular_weight*thinFilmIorScale*thinFilmConductorFresnel,thin_film_weight); -#endif -#ifdef ANISOTROPIC_BASE -slab_metal=computeAnisotropicSpecularLighting(preInfo{X},viewDirectionW,normalW,baseGeoInfo.anisotropicTangent,baseGeoInfo.anisotropicBitangent,baseGeoInfo.anisotropy,0.0,lightColor{X}.rgb); -#else -slab_metal=computeSpecularLighting(preInfo{X},normalW,vec3(1.0),coloredFresnel,specular_roughness,lightColor{X}.rgb); -#endif -} -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -slab_coat=computeAreaSpecularLighting(preInfoCoat{X},light{X}.vLightSpecular.rgb,coatReflectance.F0,coatReflectance.F90); -#else -{ -#ifdef ANISOTROPIC_COAT -slab_coat=computeAnisotropicSpecularLighting(preInfoCoat{X},viewDirectionW,coatNormalW, -coatGeoInfo.anisotropicTangent,coatGeoInfo.anisotropicBitangent,coatGeoInfo.anisotropy, -0.0,lightColor{X}.rgb); -#else -slab_coat=computeSpecularLighting(preInfoCoat{X},coatNormalW,vec3(coatReflectance.F0),vec3(1.0),coat_roughness,lightColor{X}.rgb); -#endif -float NdotH=dot(coatNormalW,preInfoCoat{X}.H);coatFresnel=fresnelSchlickGGX(NdotH,coatReflectance.F0,coatReflectance.F90);} -#endif -vec3 coatAbsorption=vec3(1.0);if (coat_weight>0.0) {float cosTheta_view=max(preInfoCoat{X}.NdotV,0.001);float cosTheta_light=max(preInfoCoat{X}.NdotL,0.001);float fresnel_view=coatReflectance.F0+(1.0-coatReflectance.F0)*pow(1.0-cosTheta_view,5.0);float fresnel_light=coatReflectance.F0+(1.0-coatReflectance.F0)*pow(1.0-cosTheta_light,5.0);float averageReflectance=(fresnel_view+fresnel_light)*0.5;float darkened_transmission=(1.0-averageReflectance)/(1.0+averageReflectance);darkened_transmission=mix(1.0,darkened_transmission,coat_darkening);float sin2=1.0-cosTheta_view*cosTheta_view;sin2=sin2/(coat_ior*coat_ior);float cos_t=sqrt(1.0-sin2);float coatPathLength=1.0/cos_t;vec3 colored_transmission=pow(coat_color,vec3(coatPathLength));coatAbsorption=mix(vec3(1.0),colored_transmission*darkened_transmission,coat_weight);} -#ifdef FUZZ -fuzzFresnel=fuzzBrdf.z;vec3 fuzzNormalW=mix(normalW,coatNormalW,coat_weight);float fuzzNdotV=max(dot(fuzzNormalW,viewDirectionW.xyz),0.0);float fuzzNdotL=max(dot(fuzzNormalW,preInfo{X}.L),0.0);slab_fuzz=lightColor{X}.rgb*preInfo{X}.attenuation*evalFuzz(preInfo{X}.L,fuzzNdotL,fuzzNdotV,fuzzTangent,fuzzBitangent,fuzzBrdf); -#else -vec3 fuzz_color=vec3(0.0); -#endif -slab_diffuse*=base_color.rgb;vec3 material_opaque_base=mix(slab_diffuse,slab_subsurface,subsurface_weight);vec3 material_dielectric_base=mix(material_opaque_base,slab_translucent,transmission_weight);vec3 material_dielectric_gloss=material_dielectric_base*(1.0-specularFresnel)+slab_glossy*specularColoredFresnel;vec3 material_base_substrate=mix(material_dielectric_gloss,slab_metal,base_metalness);vec3 material_coated_base=layer(material_base_substrate,slab_coat,coatFresnel,coatAbsorption,vec3(1.0));material_surface_direct+=layer(material_coated_base,slab_fuzz,fuzzFresnel*fuzz_weight,vec3(1.0),fuzz_color);} -#endif -`;e.IncludesShadersStore[v]||(e.IncludesShadersStore[v]=U);const o="openpbrPixelShader",R=`#define OPENPBR_FRAGMENT_SHADER -#define CUSTOM_FRAGMENT_EXTENSION -#if defined(GEOMETRY_NORMAL) || defined(GEOMETRY_COAT_NORMAL) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) -#extension GL_OES_standard_derivatives : enable -#endif -#ifdef LODBASEDMICROSFURACE -#extension GL_EXT_shader_texture_lod : enable -#endif -#define CUSTOM_FRAGMENT_BEGIN -#ifdef LOGARITHMICDEPTH -#extension GL_EXT_frag_depth : enable -#endif -#include[SCENE_MRT_COUNT] -precision highp float; -#include -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE -#endif -#include<__decl__openpbrFragment> -#include -#include<__decl__lightFragment>[0..maxSimultaneousLights] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef REFLECTION -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -#include -#include -#include -#include -#include -vec3 layer(vec3 slab_bottom,vec3 slab_top,float lerp_factor,vec3 bottom_multiplier,vec3 top_multiplier) {return mix(slab_bottom*bottom_multiplier,slab_top*top_multiplier,lerp_factor);} -void main(void) { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -#include -vec3 coatNormalW=normalW; -#include -#include -#include -#include -#include -#include -float subsurface_weight=0.0;float transmission_weight=0.0; -#define CUSTOM_FRAGMENT_UPDATE_ALPHA -#include -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -ambientOcclusionOutParams aoOut; -#ifdef AMBIENT_OCCLUSION -vec3 ambientOcclusionFromTexture=texture2D(ambientOcclusionSampler,vAmbientOcclusionUV+uvOffset).rgb; -#endif -aoOut=ambientOcclusionBlock( -#ifdef AMBIENT_OCCLUSION -ambientOcclusionFromTexture, -vAmbientOcclusionInfos -#endif -); -#ifdef ANISOTROPIC_COAT -geometryInfoAnisoOutParams coatGeoInfo=geometryInfoAniso( -coatNormalW,viewDirectionW.xyz,coat_roughness,geometricNormalW -,vec3(geometry_coat_tangent.x,geometry_coat_tangent.y,coat_roughness_anisotropy),TBN -); -#else -geometryInfoOutParams coatGeoInfo=geometryInfo( -coatNormalW,viewDirectionW.xyz,coat_roughness,geometricNormalW -); -#endif -specular_roughness=mix(specular_roughness,pow(min(1.0,pow(specular_roughness,4.0)+2.0*pow(coat_roughness,4.0)),0.25),coat_weight); -#ifdef ANISOTROPIC_BASE -geometryInfoAnisoOutParams baseGeoInfo=geometryInfoAniso( -normalW,viewDirectionW.xyz,specular_roughness,geometricNormalW -,vec3(geometry_tangent.x,geometry_tangent.y,specular_roughness_anisotropy),TBN -); -#else -geometryInfoOutParams baseGeoInfo=geometryInfo( -normalW,viewDirectionW.xyz,specular_roughness,geometricNormalW -); -#endif -#ifdef FUZZ -vec3 fuzzNormalW=normalize(mix(normalW,coatNormalW,coat_weight));vec3 fuzzTangent=normalize(TBN[0]);fuzzTangent=normalize(fuzzTangent-dot(fuzzTangent,fuzzNormalW)*fuzzNormalW);vec3 fuzzBitangent=cross(fuzzNormalW,fuzzTangent);geometryInfoOutParams fuzzGeoInfo=geometryInfo( -fuzzNormalW,viewDirectionW.xyz,fuzz_roughness,geometricNormalW -); -#endif -ReflectanceParams coatReflectance;coatReflectance=dielectricReflectance( -coat_ior -,1.0 -,vec3(1.0) -,coat_weight -); -#ifdef THIN_FILM -float thin_film_outside_ior=mix(1.0,coat_ior,coat_weight); -#endif -ReflectanceParams baseDielectricReflectance;{float effectiveCoatIor=mix(1.0,coat_ior,coat_weight);baseDielectricReflectance=dielectricReflectance( -specular_ior -,effectiveCoatIor -,specular_color -,specular_weight -);} -ReflectanceParams baseConductorReflectance;baseConductorReflectance=conductorReflectance(base_color,specular_color,specular_weight);vec3 material_surface_ibl=vec3(0.,0.,0.); -#include -vec3 material_surface_direct=vec3(0.,0.,0.); -#if defined(LIGHT0) -float aggShadow=0.;float numLights=0.; -#include[0..maxSimultaneousLights] -#include[0..maxSimultaneousLights] -#endif -vec3 material_surface_emission=vEmissionColor; -#ifdef EMISSION_COLOR -vec3 emissionColorTex=texture2D(emissionColorSampler,vEmissionColorUV+uvOffset).rgb; -#ifdef EMISSION_COLOR_GAMMA -material_surface_emission*=toLinearSpace(emissionColorTex.rgb); -#else -material_surface_emission*=emissionColorTex.rgb; -#endif -material_surface_emission*= vEmissionColorInfos.y; -#endif -material_surface_emission*=vLightingIntensity.y; -#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION -vec4 finalColor=vec4(material_surface_ibl+material_surface_direct+material_surface_emission,alpha); -#define CUSTOM_FRAGMENT_BEFORE_FOG -finalColor=max(finalColor,0.0); -#include -#include(color,finalColor) -#include -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#include -#endif -#if !defined(PREPASS) || defined(WEBGL2) -gl_FragColor=finalColor; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);} else {backColor+=finalColor;} -#endif -#include -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStore[o]||(e.ShadersStore[o]=R);const ne={name:o,shader:R};export{ne as openpbrPixelShader}; diff --git a/assets/openpbr.vertex-BpmkRPRZ.js b/assets/openpbr.vertex-BpmkRPRZ.js deleted file mode 100644 index ef32772fa115ce6a0a6a42020186ccebd4c69651..0000000000000000000000000000000000000000 --- a/assets/openpbr.vertex-BpmkRPRZ.js +++ /dev/null @@ -1,205 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./openpbrUboDeclaration-cKzwVrP1.js";import"./vertexColorMixing-BV8k1N8l.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";import"./helperFunctions-Wgh3PIP0.js";import"./pbrBRDFFunctions-BKKbkltP.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./instancesDeclaration-ConO0l1b.js";import"./harmonicsFunctions-B8ViGQkZ.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./logDepthVertex-CfHieHf5.js";import"./shadowsVertex-DKtacRyL.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const t="openpbrNormalMapVertexDeclaration",o=`#if defined(GEOMETRY_NORMAL) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=o);const i="openpbrNormalMapVertex",E=`#if defined(GEOMETRY_NORMAL) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2]; -#endif -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=E);const n="openpbrVertexShader",r=`#define OPENPBR_VERTEX_SHADER -#include -#define CUSTOM_VERTEX_BEGIN -attribute position: vec3f; -#ifdef NORMAL -attribute normal: vec3f; -#endif -#ifdef TANGENT -attribute tangent: vec4f; -#endif -#ifdef UV1 -attribute uv: vec2f; -#endif -#include[2..7] -#include[1..7] -#ifdef VERTEXCOLOR -attribute color: vec4f; -#endif -#include -#include -#include -#include -#include -#include -#include(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight) -#include(_DEFINENAME_,COAT_COLOR,_VARYINGNAME_,CoatColor) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -varying vPositionW: vec3f; -#if DEBUGMODE>0 -varying vClipSpacePosition: vec4f; -#endif -#ifdef NORMAL -varying vNormalW: vec3f; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vEnvironmentIrradiance: vec3f; -#include -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vColor: vec4f; -#endif -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -var positionUpdated: vec3f=vertexInputs.position; -#ifdef NORMAL -var normalUpdated: vec3f=vertexInputs.normal; -#endif -#ifdef TANGENT -var tangentUpdated: vec4f=vertexInputs.tangent; -#endif -#ifdef UV1 -var uvUpdated: vec2f=vertexInputs.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=vertexInputs.uv2; -#endif -#ifdef VERTEXCOLOR -var colorUpdated: vec4f=vertexInputs.color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vertexOutputs.vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0); -#endif -#include -#include -var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPositionW= worldPos.xyz; -#ifdef PREPASS -#include -#endif -#ifdef NORMAL -var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated); -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-vertexOutputs.vPositionW);var NdotV: f32=max(dot(vertexOutputs.vNormalW,viewDirectionW),0.0);var roughNormal: vec3f=mix(vertexOutputs.vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*uniforms.vBaseDiffuseRoughness);var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(roughNormal,0)).xyz; -#else -var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(vertexOutputs.vNormalW,0)).xyz; -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -vertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;} -#else -vertexOutputs.position=scene.viewProjection*worldPos; -#endif -#if DEBUGMODE>0 -vertexOutputs.vClipSpacePosition=vertexOutputs.position; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(positionUpdated,0.0)).xyz); -#endif -#ifndef UV1 -var uvUpdated: vec2f= vec2f(0.,0.); -#endif -#ifdef MAINUV1 -vertexOutputs.vMainUV1=uvUpdated; -#endif -#ifndef UV2 -var uv2Updated: vec2f= vec2f(0.,0.); -#endif -#ifdef MAINUV2 -vertexOutputs.vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor,_MATRIXNAME_,baseColor,_INFONAME_,BaseColorInfos.x) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness,_MATRIXNAME_,baseMetalness,_INFONAME_,BaseMetalnessInfos.x) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight,_MATRIXNAME_,specularWeight,_INFONAME_,SpecularWeightInfos.x) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor,_MATRIXNAME_,specularColor,_INFONAME_,SpecularColorInfos.x) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness,_MATRIXNAME_,specularRoughness,_INFONAME_,SpecularRoughnessInfos.x) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy,_MATRIXNAME_,specularRoughnessAnisotropy,_INFONAME_,SpecularRoughnessAnisotropyInfos.x) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight,_MATRIXNAME_,coatWeight,_INFONAME_,CoatWeightInfos.x) -#include(_DEFINENAME_,COAT_COLOR,_VARYNAME_,CoatColor,_MATRIXNAME_,coatColor,_INFONAME_,CoatColorInfos.x) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness,_MATRIXNAME_,coatRoughness,_INFONAME_,CoatRoughnessInfos.x) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy,_MATRIXNAME_,coatRoughnessAnisotropy,_INFONAME_,CoatRoughnessAnisotropyInfos.x) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening,_MATRIXNAME_,coatDarkening,_INFONAME_,CoatDarkeningInfos.x) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight,_MATRIXNAME_,fuzzWeight,_INFONAME_,FuzzWeightInfos.x) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor,_MATRIXNAME_,fuzzColor,_INFONAME_,FuzzColorInfos.x) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness,_MATRIXNAME_,fuzzRoughness,_INFONAME_,FuzzRoughnessInfos.x) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal,_MATRIXNAME_,geometryNormal,_INFONAME_,GeometryNormalInfos.x) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent,_MATRIXNAME_,geometryTangent,_INFONAME_,GeometryTangentInfos.x) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal,_MATRIXNAME_,geometryCoatNormal,_INFONAME_,GeometryCoatNormalInfos.x) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity,_MATRIXNAME_,geometryOpacity,_INFONAME_,GeometryOpacityInfos.x) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor,_MATRIXNAME_,emissionColor,_INFONAME_,EmissionColorInfos.x) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight,_MATRIXNAME_,thinFilmWeight,_INFONAME_,ThinFilmWeightInfos.x) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness,_MATRIXNAME_,thinFilmThickness,_INFONAME_,ThinFilmThicknessInfos.x) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion,_MATRIXNAME_,ambientOcclusion,_INFONAME_,AmbientOcclusionInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#define CUSTOM_VERTEX_MAIN_END -}`;e.ShadersStoreWGSL[n]||(e.ShadersStoreWGSL[n]=r);const S={name:n,shader:r};export{S as openpbrVertexShaderWGSL}; diff --git a/assets/openpbr.vertex-CrhhV-GW.js b/assets/openpbr.vertex-CrhhV-GW.js deleted file mode 100644 index a637b061eee60b1f9b4240e3ab91692ecc0fe248..0000000000000000000000000000000000000000 --- a/assets/openpbr.vertex-CrhhV-GW.js +++ /dev/null @@ -1,320 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./vertexColorMixing-DoZiZfly.js";import"./openpbrUboDeclaration-DYpAvMMQ.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";import"./helperFunctions-tBt4f_K3.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./harmonicsFunctions-DgiK80M3.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./logDepthVertex-zXeqwUWs.js";import"./shadowsVertex-w5DW1avO.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const n="openpbrVertexDeclaration",a=`uniform mat4 view;uniform mat4 viewProjection;uniform vec4 vEyePosition; -#ifdef MULTIVIEW -mat4 viewProjectionR; -#endif -#ifdef BASE_COLOR -uniform vec2 vBaseColorInfos;uniform mat4 baseColorMatrix; -#endif -#ifdef BASE_WEIGHT -uniform mat4 baseWeightMatrix;uniform vec2 vBaseWeightInfos; -#endif -uniform float vBaseDiffuseRoughness; -#ifdef BASE_DIFFUSE_ROUGHNESS -uniform mat4 baseDiffuseRoughnessMatrix;uniform vec2 vBaseDiffuseRoughnessInfos; -#endif -#ifdef AMBIENT_OCCLUSION -uniform vec2 vAmbientOcclusionInfos;uniform mat4 ambientOcclusionMatrix; -#endif -#ifdef EMISSION_COLOR -uniform vec2 vEmissionColorInfos;uniform mat4 emissionColorMatrix; -#endif -#ifdef LIGHTMAP -uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix; -#endif -#ifdef BASE_METALNESS -uniform vec2 vBaseMetalnessInfos;uniform mat4 baseMetalnessMatrix; -#endif -#ifdef SPECULAR_WEIGHT -uniform vec2 vSpecularWeightInfos;uniform mat4 specularWeightMatrix; -#endif -#ifdef SPECULAR_COLOR -uniform vec2 vSpecularColorInfos;uniform mat4 specularColorMatrix; -#endif -#ifdef SPECULAR_ROUGHNESS -uniform vec2 vSpecularRoughnessInfos;uniform mat4 specularRoughnessMatrix; -#endif -#ifdef SPECULAR_ROUGHNESS_ANISOTROPY -uniform vec2 vSpecularRoughnessAnisotropyInfos;uniform mat4 specularRoughnessAnisotropyMatrix; -#endif -#ifdef COAT_WEIGHT -uniform vec2 vCoatWeightInfos;uniform mat4 coatWeightMatrix; -#endif -#ifdef COAT_COLOR -uniform vec2 vCoatColorInfos;uniform mat4 coatColorMatrix; -#endif -#ifdef COAT_ROUGHNESS -uniform vec2 vCoatRoughnessInfos;uniform mat4 coatRoughnessMatrix; -#endif -#ifdef COAT_ROUGHNESS_ANISOTROPY -uniform vec2 vCoatRoughnessAnisotropyInfos;uniform mat4 coatRoughnessAnisotropyMatrix; -#endif -#ifdef COAT_IOR -uniform vec2 vCoatIorInfos;uniform mat4 coatIorMatrix; -#endif -#ifdef COAT_DARKENING -uniform vec2 vCoatDarkeningInfos;uniform mat4 coatDarkeningMatrix; -#endif -#ifdef FUZZ_WEIGHT -uniform vec2 vFuzzWeightInfos;uniform mat4 fuzzWeightMatrix; -#endif -#ifdef FUZZ_COLOR -uniform vec2 vFuzzColorInfos;uniform mat4 fuzzColorMatrix; -#endif -#ifdef FUZZ_ROUGHNESS -uniform vec2 vFuzzRoughnessInfos;uniform mat4 fuzzRoughnessMatrix; -#endif -#ifdef GEOMETRY_NORMAL -uniform vec2 vGeometryNormalInfos;uniform mat4 geometryNormalMatrix; -#endif -#ifdef GEOMETRY_TANGENT -uniform vec2 vGeometryTangentInfos;uniform mat4 geometryTangentMatrix; -#endif -#ifdef GEOMETRY_COAT_NORMAL -uniform vec2 vGeometryCoatNormalInfos;uniform mat4 geometryCoatNormalMatrix; -#endif -#ifdef THIN_FILM_WEIGHT -uniform vec2 vThinFilmWeightInfos;uniform mat4 thinFilmWeightMatrix; -#endif -#ifdef THIN_FILM_THICKNESS -uniform vec2 vThinFilmThicknessInfos;uniform mat4 thinFilmThicknessMatrix; -#endif -#ifdef GEOMETRY_OPACITY -uniform mat4 geometryOpacityMatrix;uniform vec2 vGeometryOpacityInfos; -#endif -#ifdef POINTSIZE -uniform float pointSize; -#endif -uniform vec4 cameraInfo; -#ifdef REFLECTION -uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix; -#endif -#ifdef NORMAL -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22; -#else -uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX; -#endif -#endif -#endif -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos;uniform mat4 detailMatrix; -#endif -#include -#define ADDITIONAL_VERTEX_DECLARATION -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=a);const o="openpbrNormalMapVertexDeclaration",E=`#if defined(GEOMETRY_NORMAL) || defined(PARALLAX) || defined(GEOMETRY_COAT_NORMAL) || defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -varying mat3 vTBN; -#endif -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=E);const r="openpbrNormalMapVertex",_=`#if defined(GEOMETRY_NORMAL) || defined(PARALLAX) || defined(GEOMETRY_COAT_NORMAL) || defined(ANISOTROPIC) || defined(FUZZ) -#if defined(TANGENT) && defined(NORMAL) -vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal); -#endif -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=_);const i="openpbrVertexShader",t=`#define OPENPBR_VERTEX_SHADER -#define CUSTOM_VERTEX_EXTENSION -precision highp float; -#include<__decl__openpbrVertex> -#define CUSTOM_VERTEX_BEGIN -attribute vec3 position; -#ifdef NORMAL -attribute vec3 normal; -#endif -#ifdef TANGENT -attribute vec4 tangent; -#endif -#ifdef UV1 -attribute vec2 uv; -#endif -#include[2..7] -#include[1..7] -#ifdef VERTEXCOLOR -attribute vec4 color; -#endif -#include -#include -#include -#include -#include -#include -#include(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight) -#include(_DEFINENAME_,COAT_COLOR,_VARYINGNAME_,CoatColor) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -varying vec3 vPositionW; -#if DEBUGMODE>0 -varying vec4 vClipSpacePosition; -#endif -#ifdef NORMAL -varying vec3 vNormalW; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vec3 vEnvironmentIrradiance; -#include -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vec4 vColor; -#endif -#include -#include -#include -#include<__decl__lightVxFragment>[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -vec3 positionUpdated=position; -#ifdef NORMAL -vec3 normalUpdated=normal; -#endif -#ifdef TANGENT -vec4 tangentUpdated=tangent; -#endif -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#ifdef VERTEXCOLOR -vec4 colorUpdated=color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vPositionW=vec3(worldPos); -#ifdef PREPASS -#include -#endif -#ifdef NORMAL -mat3 normalWorld=mat3(finalWorld); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vNormalW=normalize(normalWorld*normalUpdated); -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); -#if !defined(NATIVE) && !defined(WEBGPU) -bool bbb=any(isnan(position));if (bbb) { } -#endif -float NdotV=max(dot(vNormalW,viewDirectionW),0.0);vec3 roughNormal=mix(vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*vBaseDiffuseRoughness);vec3 reflectionVector=vec3(reflectionMatrix*vec4(roughNormal,0)).xyz; -#else -vec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz; -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;} -#else -gl_Position=viewProjection*worldPos; -#endif -#if DEBUGMODE>0 -vClipSpacePosition=gl_Position; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0))); -#endif -#ifndef UV1 -vec2 uvUpdated=vec2(0.,0.); -#endif -#ifndef UV2 -vec2 uv2Updated=vec2(0.,0.); -#endif -#ifdef MAINUV1 -vMainUV1=uvUpdated; -#endif -#ifdef MAINUV2 -vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,BASE_COLOR,_VARYINGNAME_,BaseColor,_MATRIXNAME_,baseColor,_INFONAME_,BaseColorInfos.x) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x) -#include(_DEFINENAME_,BASE_METALNESS,_VARYINGNAME_,BaseMetalness,_MATRIXNAME_,baseMetalness,_INFONAME_,BaseMetalnessInfos.x) -#include(_DEFINENAME_,SPECULAR_WEIGHT,_VARYINGNAME_,SpecularWeight,_MATRIXNAME_,specularWeight,_INFONAME_,SpecularWeightInfos.x) -#include(_DEFINENAME_,SPECULAR_COLOR,_VARYINGNAME_,SpecularColor,_MATRIXNAME_,specularColor,_INFONAME_,SpecularColorInfos.x) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS,_VARYINGNAME_,SpecularRoughness,_MATRIXNAME_,specularRoughness,_INFONAME_,SpecularRoughnessInfos.x) -#include(_DEFINENAME_,SPECULAR_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,SpecularRoughnessAnisotropy,_MATRIXNAME_,specularRoughnessAnisotropy,_INFONAME_,SpecularRoughnessAnisotropyInfos.x) -#include(_DEFINENAME_,COAT_WEIGHT,_VARYINGNAME_,CoatWeight,_MATRIXNAME_,coatWeight,_INFONAME_,CoatWeightInfos.x) -#include(_DEFINENAME_,COAT_COLOR,_VARYINGNAME_,CoatColor,_MATRIXNAME_,coatColor,_INFONAME_,CoatColorInfos.x) -#include(_DEFINENAME_,COAT_ROUGHNESS,_VARYINGNAME_,CoatRoughness,_MATRIXNAME_,coatRoughness,_INFONAME_,CoatRoughnessInfos.x) -#include(_DEFINENAME_,COAT_ROUGHNESS_ANISOTROPY,_VARYINGNAME_,CoatRoughnessAnisotropy,_MATRIXNAME_,coatRoughnessAnisotropy,_INFONAME_,CoatRoughnessAnisotropyInfos.x) -#include(_DEFINENAME_,COAT_DARKENING,_VARYINGNAME_,CoatDarkening,_MATRIXNAME_,coatDarkening,_INFONAME_,CoatDarkeningInfos.x) -#include(_DEFINENAME_,FUZZ_WEIGHT,_VARYINGNAME_,FuzzWeight,_MATRIXNAME_,fuzzWeight,_INFONAME_,FuzzWeightInfos.x) -#include(_DEFINENAME_,FUZZ_COLOR,_VARYINGNAME_,FuzzColor,_MATRIXNAME_,fuzzColor,_INFONAME_,FuzzColorInfos.x) -#include(_DEFINENAME_,FUZZ_ROUGHNESS,_VARYINGNAME_,FuzzRoughness,_MATRIXNAME_,fuzzRoughness,_INFONAME_,FuzzRoughnessInfos.x) -#include(_DEFINENAME_,GEOMETRY_NORMAL,_VARYINGNAME_,GeometryNormal,_MATRIXNAME_,geometryNormal,_INFONAME_,GeometryNormalInfos.x) -#include(_DEFINENAME_,GEOMETRY_COAT_NORMAL,_VARYINGNAME_,GeometryCoatNormal,_MATRIXNAME_,geometryCoatNormal,_INFONAME_,GeometryCoatNormalInfos.x) -#include(_DEFINENAME_,GEOMETRY_OPACITY,_VARYINGNAME_,GeometryOpacity,_MATRIXNAME_,geometryOpacity,_INFONAME_,GeometryOpacityInfos.x) -#include(_DEFINENAME_,GEOMETRY_TANGENT,_VARYINGNAME_,GeometryTangent,_MATRIXNAME_,geometryTangent,_INFONAME_,GeometryTangentInfos.x) -#include(_DEFINENAME_,EMISSION_COLOR,_VARYINGNAME_,EmissionColor,_MATRIXNAME_,emissionColor,_INFONAME_,EmissionColorInfos.x) -#include(_DEFINENAME_,THIN_FILM_WEIGHT,_VARYINGNAME_,ThinFilmWeight,_MATRIXNAME_,thinFilmWeight,_INFONAME_,ThinFilmWeightInfos.x) -#include(_DEFINENAME_,THIN_FILM_THICKNESS,_VARYINGNAME_,ThinFilmThickness,_MATRIXNAME_,thinFilmThickness,_INFONAME_,ThinFilmThicknessInfos.x) -#include(_DEFINENAME_,AMBIENT_OCCLUSION,_VARYINGNAME_,AmbientOcclusion,_MATRIXNAME_,ambientOcclusion,_INFONAME_,AmbientOcclusionInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#if defined(POINTSIZE) && !defined(WEBGPU) -gl_PointSize=pointSize; -#endif -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=t);const V={name:i,shader:t};export{V as openpbrVertexShader}; diff --git a/assets/openpbrMaterial-D1CYjggx.js b/assets/openpbrMaterial-D1CYjggx.js deleted file mode 100644 index 177b3ea7d0dd56a297c60d382c339d2042bbdfcc..0000000000000000000000000000000000000000 --- a/assets/openpbrMaterial-D1CYjggx.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./openpbr.vertex-BpmkRPRZ.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./openpbrUboDeclaration-cKzwVrP1.js","./sceneUboDeclaration-mnAEeY6M.js","./meshUboDeclaration-BeSl_gjF.js","./vertexColorMixing-BV8k1N8l.js","./mainUVVaryingDeclaration-Nm5IuqWV.js","./helperFunctions-Wgh3PIP0.js","./pbrBRDFFunctions-BKKbkltP.js","./bonesDeclaration-DUXz5WB4.js","./instancesVertex-BZz8JvZy.js","./instancesDeclaration-ConO0l1b.js","./harmonicsFunctions-B8ViGQkZ.js","./clipPlaneVertex-D5g8dBQb.js","./logDepthVertex-CfHieHf5.js","./shadowsVertex-DKtacRyL.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./logDepthDeclaration-CACrmPgQ.js","./morphTargetsVertex-W8O8GW2p.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./openpbr.fragment-ClGdrIKD.js","./oitFragment-CXBNy3dk.js","./pbrDebug-C5bjipRB.js","./shadowsFragmentFunctions-CHKo52s6.js","./samplerFragmentDeclaration-Bn5G_87U.js","./imageProcessingFunctions-DMSN1d-p.js","./clipPlaneFragment-BmMK1U8A.js","./fogFragment-DjadYfQv.js","./hdrFilteringFunctions-BDy1DXPD.js","./openpbr.vertex-CrhhV-GW.js","./vertexColorMixing-DoZiZfly.js","./openpbrUboDeclaration-DYpAvMMQ.js","./sceneUboDeclaration-3A3jW23h.js","./meshUboDeclaration-D9O4n0us.js","./mainUVVaryingDeclaration-OlWPbGIv.js","./helperFunctions-tBt4f_K3.js","./pbrBRDFFunctions-DaHwCtNC.js","./bakedVertexAnimation-CaTOZtWZ.js","./instancesDeclaration-CYMjgQ6_.js","./harmonicsFunctions-DgiK80M3.js","./clipPlaneVertex-CThh3FEJ.js","./logDepthVertex-zXeqwUWs.js","./shadowsVertex-w5DW1avO.js","./morphTargetsVertex-CUt9TeiZ.js","./logDepthDeclaration-mFbnDVOm.js","./openpbr.fragment-Dbeojf8B.js","./oitFragment-cUdAGBvC.js","./pbrDebug-B24xpn-H.js","./shadowsFragmentFunctions-dMCKkVlT.js","./bumpFragment-Dn7_UB6Q.js","./imageProcessingFunctions-BwYIAaLN.js","./clipPlaneFragment-CmkC_xqs.js","./fogFragment-M_o52SDz.js","./hdrFilteringFunctions-B6pmqAql.js"])))=>i.map(i=>d[i]); -import{af as D}from"./index-DydPgVMC.js";import{ah as b,o as R,C as P,ai as Y,n as Z,L as C,T as K,d as j,a7 as O,aj as Q,ak as G,P as z,e as w,J as y,Z as $,u as U,$ as q,a0 as J,a1 as ee,c as F,al as te,a2 as se,a3 as ie,b as re,a4 as ae,a5 as oe,a6 as ne,E as le,H as he,F as ue,K as _e,N as Te,Q as Ae,U as fe,Y as ce,W as k,X as pe,p as me,q as Ee,r as Re,t as ge,v as Se,w as Le,x as Ie,y as Oe,z as ye,a8 as Fe,a9 as Pe,aa as de,ab as Ne,ac as Ce,_ as i,am as o,s as f,ae as c,R as xe}from"./index-GY9JDBGV.js";const d={effect:null,subMesh:null};class N{populateVectorFromLinkedProperties(t){const r=t.dimension[0];for(const e in this.linkedProperties){const a=this.linkedProperties[e],n=a.numComponents;if(rr-n){n==1?C.Error(`Float property ${a.name} has an offset that is too large.`):C.Error(`Vector${n} property ${a.name} won't fit in Vector${r} or has an offset that is too large.`);return}typeof a.value=="number"?N._tmpArray[a.targetUniformComponentOffset]=a.value:a.value.toArray(N._tmpArray,a.targetUniformComponentOffset)}t.fromArray(N._tmpArray)}constructor(t,r){this.linkedProperties={},this.name=t,this.numComponents=r}}N._tmpArray=[0,0,0,0];class A{constructor(t,r,e,a,n=0){this.targetUniformComponentNum=4,this.targetUniformComponentOffset=0,this.name=t,this.targetUniformName=e,this.defaultValue=r,this.value=r,this.targetUniformComponentNum=a,this.targetUniformComponentOffset=n}get numComponents(){return typeof this.defaultValue=="number"?1:this.defaultValue.dimension[0]}}class p{get samplerName(){return this.samplerPrefix+"Sampler"}get samplerInfoName(){return"v"+this.samplerPrefix.charAt(0).toUpperCase()+this.samplerPrefix.slice(1)+"Infos"}get samplerMatrixName(){return this.samplerPrefix+"Matrix"}constructor(t,r,e){this.value=null,this.samplerPrefix="",this.textureDefine="",this.name=t,this.samplerPrefix=r,this.textureDefine=e}}class Me extends Ne(Ce){}class V extends de(Me){constructor(t){super(t),this.NUM_SAMPLES="0",this.REALTIME_FILTERING=!1,this.IBL_CDF_FILTERING=!1,this.VERTEXCOLOR=!1,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.VERTEXALPHA=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHABLEND=!1,this.ALPHA_FROM_BASE_COLOR_TEXTURE=!1,this.ALPHATESTVALUE="0.5",this.PREMULTIPLYALPHA=!1,this.REFLECTIVITY_GAMMA=!1,this.REFLECTIVITYDIRECTUV=0,this.SPECULARTERM=!1,this.LODBASEDMICROSFURACE=!0,this.METALLICWORKFLOW=!0,this.ROUGHNESSSTOREINMETALMAPALPHA=!1,this.ROUGHNESSSTOREINMETALMAPGREEN=!1,this.METALLNESSSTOREINMETALMAPBLUE=!1,this.AOSTOREINMETALMAPRED=!1,this.SPECULAR_WEIGHT_IN_ALPHA=!1,this.SPECULAR_WEIGHT_FROM_SPECULAR_COLOR_TEXTURE=!1,this.SPECULAR_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=!1,this.COAT_ROUGHNESS_FROM_GREEN_CHANNEL=!1,this.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=!1,this.USE_GLTF_STYLE_ANISOTROPY=!1,this.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE=!1,this.FUZZ_ROUGHNESS_FROM_TEXTURE_ALPHA=!1,this.ENVIRONMENTBRDF=!1,this.ENVIRONMENTBRDF_RGBD=!1,this.FUZZENVIRONMENTBRDF=!1,this.NORMAL=!1,this.TANGENT=!1,this.OBJECTSPACE_NORMALMAP=!1,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.NORMALXYSCALE=!0,this.ANISOTROPIC=!1,this.ANISOTROPIC_OPENPBR=!0,this.ANISOTROPIC_BASE=!1,this.ANISOTROPIC_COAT=!1,this.FUZZ_IBL_SAMPLES=6,this.FUZZ=!1,this.THIN_FILM=!1,this.IRIDESCENCE=!1,this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.USESPHERICALFROMREFLECTIONMAP=!1,this.USEIRRADIANCEMAP=!1,this.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this.USESPHERICALINVERTEX=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1,this.RADIANCEOCCLUSION=!1,this.HORIZONOCCLUSION=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.NONUNIFORMSCALING=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.USEPHYSICALLIGHTFALLOFF=!1,this.USEGLTFLIGHTFALLOFF=!1,this.TWOSIDEDLIGHTING=!1,this.MIRRORED=!1,this.SHADOWFLOAT=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.LOGARITHMICDEPTH=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.FORCENORMALFORWARD=!1,this.SPECULARAA=!1,this.UNLIT=!1,this.DECAL_AFTER_DETAIL=!1,this.DEBUGMODE=0,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.BRDF_V_HEIGHT_CORRELATED=!0,this.MS_BRDF_ENERGY_CONSERVATION=!0,this.SPHERICAL_HARMONICS=!0,this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!0,this.MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,this.LEGACY_SPECULAR_ENERGY_CONSERVATION=!1,this.BASE_DIFFUSE_MODEL=0,this.DIELECTRIC_SPECULAR_MODEL=1,this.CONDUCTOR_SPECULAR_MODEL=1,this.rebuild()}reset(){super.reset(),this.ALPHATESTVALUE="0.5",this.NORMALXYSCALE=!0}}class De extends Fe(Pe){}class s extends De{get geometryTangentAngle(){return Math.atan2(this.geometryTangent.y,this.geometryTangent.x)}set geometryTangentAngle(t){this.geometryTangent=new b(Math.cos(t),Math.sin(t))}get geometryCoatTangentAngle(){return Math.atan2(this.geometryCoatTangent.y,this.geometryCoatTangent.x)}set geometryCoatTangentAngle(t){this.geometryCoatTangent=new b(Math.cos(t),Math.sin(t))}get usePhysicalLightFalloff(){return this._lightFalloff===R.LIGHTFALLOFF_PHYSICAL}set usePhysicalLightFalloff(t){t!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),t?this._lightFalloff=R.LIGHTFALLOFF_PHYSICAL:this._lightFalloff=R.LIGHTFALLOFF_STANDARD)}get useGLTFLightFalloff(){return this._lightFalloff===R.LIGHTFALLOFF_GLTF}set useGLTFLightFalloff(t){t!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),t?this._lightFalloff=R.LIGHTFALLOFF_GLTF:this._lightFalloff=R.LIGHTFALLOFF_STANDARD)}get realTimeFiltering(){return this._realTimeFiltering}set realTimeFiltering(t){this._realTimeFiltering=t,this.markAsDirty(1)}get realTimeFilteringQuality(){return this._realTimeFilteringQuality}set realTimeFilteringQuality(t){this._realTimeFilteringQuality=t,this.markAsDirty(1)}get fuzzSampleNumber(){return this._fuzzSampleNumber}set fuzzSampleNumber(t){this._fuzzSampleNumber=t,this.markAsDirty(1)}get canRenderToMRT(){return!0}constructor(t,r,e=!1){super(t,r,void 0,e||s.ForceGLSL),this._baseWeight=new A("base_weight",1,"vBaseWeight",1),this._baseWeightTexture=new p("base_weight","baseWeight","BASE_WEIGHT"),this._baseColor=new A("base_color",P.White(),"vBaseColor",4),this._baseColorTexture=new p("base_color","baseColor","BASE_COLOR"),this._baseDiffuseRoughness=new A("base_diffuse_roughness",0,"vBaseDiffuseRoughness",1),this._baseDiffuseRoughnessTexture=new p("base_diffuse_roughness","baseDiffuseRoughness","BASE_DIFFUSE_ROUGHNESS"),this._baseMetalness=new A("base_metalness",0,"vReflectanceInfo",4,0),this._baseMetalnessTexture=new p("base_metalness","baseMetalness","BASE_METALNESS"),this._specularWeight=new A("specular_weight",1,"vReflectanceInfo",4,3),this._specularWeightTexture=new p("specular_weight","specularWeight","SPECULAR_WEIGHT"),this._specularColor=new A("specular_color",P.White(),"vSpecularColor",4),this._specularColorTexture=new p("specular_color","specularColor","SPECULAR_COLOR"),this._specularRoughness=new A("specular_roughness",.3,"vReflectanceInfo",4,1),this._specularRoughnessTexture=new p("specular_roughness","specularRoughness","SPECULAR_ROUGHNESS"),this._specularRoughnessAnisotropy=new A("specular_roughness_anisotropy",0,"vSpecularAnisotropy",3,2),this._specularRoughnessAnisotropyTexture=new p("specular_roughness_anisotropy","specularRoughnessAnisotropy","SPECULAR_ROUGHNESS_ANISOTROPY"),this._specularIor=new A("specular_ior",1.5,"vReflectanceInfo",4,2),this._coatWeight=new A("coat_weight",0,"vCoatWeight",1,0),this._coatWeightTexture=new p("coat_weight","coatWeight","COAT_WEIGHT"),this._coatColor=new A("coat_color",P.White(),"vCoatColor",3,0),this._coatColorTexture=new p("coat_color","coatColor","COAT_COLOR"),this._coatRoughness=new A("coat_roughness",0,"vCoatRoughness",1,0),this._coatRoughnessTexture=new p("coat_roughness","coatRoughness","COAT_ROUGHNESS"),this._coatRoughnessAnisotropy=new A("coat_roughness_anisotropy",0,"vCoatRoughnessAnisotropy",1),this._coatRoughnessAnisotropyTexture=new p("coat_roughness_anisotropy","coatRoughnessAnisotropy","COAT_ROUGHNESS_ANISOTROPY"),this._coatIor=new A("coat_ior",1.5,"vCoatIor",1,0),this._coatDarkening=new A("coat_darkening",1,"vCoatDarkening",1,0),this._coatDarkeningTexture=new p("coat_darkening","coatDarkening","COAT_DARKENING"),this.useCoatRoughnessFromWeightTexture=!1,this._fuzzWeight=new A("fuzz_weight",0,"vFuzzWeight",1,0),this._fuzzWeightTexture=new p("fuzz_weight","fuzzWeight","FUZZ_WEIGHT"),this._fuzzColor=new A("fuzz_color",P.White(),"vFuzzColor",3,0),this._fuzzColorTexture=new p("fuzz_color","fuzzColor","FUZZ_COLOR"),this._fuzzRoughness=new A("fuzz_roughness",.5,"vFuzzRoughness",1,0),this._fuzzRoughnessTexture=new p("fuzz_roughness","fuzzRoughness","FUZZ_ROUGHNESS"),this._geometryNormalTexture=new p("geometry_normal","geometryNormal","GEOMETRY_NORMAL"),this._geometryTangent=new A("geometry_tangent",new b(1,0),"vSpecularAnisotropy",3,0),this._geometryTangentTexture=new p("geometry_tangent","geometryTangent","GEOMETRY_TANGENT"),this._geometryCoatNormalTexture=new p("geometry_coat_normal","geometryCoatNormal","GEOMETRY_COAT_NORMAL"),this._geometryCoatTangent=new A("geometry_coat_tangent",new b(1,0),"vGeometryCoatTangent",2,0),this._geometryCoatTangentTexture=new p("geometry_coat_tangent","geometryCoatTangent","GEOMETRY_COAT_TANGENT"),this._geometryOpacity=new A("geometry_opacity",1,"vBaseColor",4,3),this._geometryOpacityTexture=new p("geometry_opacity","geometryOpacity","GEOMETRY_OPACITY"),this._emissionLuminance=new A("emission_luminance",1,"vLightingIntensity",4,1),this._emissionColor=new A("emission_color",P.Black(),"vEmissionColor",3),this._emissionColorTexture=new p("emission_color","emissionColor","EMISSION_COLOR"),this._thinFilmWeight=new A("thin_film_weight",0,"vThinFilmWeight",1,0),this._thinFilmWeightTexture=new p("thin_film_weight","thinFilmWeight","THIN_FILM_WEIGHT"),this._thinFilmThickness=new A("thin_film_thickness",.5,"vThinFilmThickness",2,0),this._thinFilmThicknessMin=new A("thin_film_thickness_min",0,"vThinFilmThickness",2,1),this._thinFilmThicknessTexture=new p("thin_film_thickness","thinFilmThickness","THIN_FILM_THICKNESS"),this._thinFilmIor=new A("thin_film_ior",1.4,"vThinFilmIor",1,0),this._ambientOcclusionTexture=new p("ambient_occlusion","ambientOcclusion","AMBIENT_OCCLUSION"),this._uniformsList={},this._samplersList={},this._samplerDefines={},this.directIntensity=1,this.environmentIntensity=1,this.useSpecularWeightFromTextureAlpha=!1,this.forceAlphaTest=!1,this.alphaCutOff=.4,this.useAmbientOcclusionFromMetallicTextureRed=!1,this.useAmbientInGrayScale=!1,this.useObjectSpaceNormalMap=!1,this.useParallax=!1,this.useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this.disableLighting=!1,this.forceIrradianceInFragment=!1,this.maxSimultaneousLights=4,this.invertNormalMapX=!1,this.invertNormalMapY=!1,this.twoSidedLighting=!1,this.useAlphaFresnel=!1,this.useLinearAlphaFresnel=!1,this.environmentBRDFTexture=null,this.forceNormalForward=!1,this.enableSpecularAntiAliasing=!1,this.useHorizonOcclusion=!0,this.useRadianceOcclusion=!0,this.unlit=!1,this.applyDecalMapAfterDetailMap=!1,this._lightingInfos=new Y(this.directIntensity,1,this.environmentIntensity,1),this._radianceTexture=null,this._useSpecularWeightFromAlpha=!1,this._useSpecularWeightFromSpecularColorTexture=!1,this._useSpecularRoughnessAnisotropyFromTangentTexture=!1,this._useCoatRoughnessAnisotropyFromTangentTexture=!1,this._useCoatRoughnessFromGreenChannel=!1,this._useGltfStyleAnisotropy=!1,this._useFuzzRoughnessFromTextureAlpha=!1,this._useHorizonOcclusion=!0,this._useRadianceOcclusion=!0,this._useAlphaFromBaseColorTexture=!1,this._useAmbientOcclusionFromMetallicTextureRed=!1,this._useRoughnessFromMetallicTextureGreen=!1,this._useMetallicFromMetallicTextureBlue=!1,this._useThinFilmThicknessFromTextureGreen=!1,this._lightFalloff=R.LIGHTFALLOFF_PHYSICAL,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this._parallaxScaleBias=.05,this._disableLighting=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._alphaCutOff=.4,this._useAlphaFresnel=!1,this._useLinearAlphaFresnel=!1,this._environmentBRDFTexture=null,this._environmentFuzzBRDFTexture=null,this._forceIrradianceInFragment=!1,this._realTimeFiltering=!1,this._realTimeFilteringQuality=8,this._fuzzSampleNumber=4,this._forceNormalForward=!1,this._enableSpecularAntiAliasing=!1,this._renderTargets=new Z(16),this._unlit=!1,this._applyDecalMapAfterDetailMap=!1,this._debugMode=0,this._shadersLoaded=!1,this._breakShaderLoadedCheck=!1,this.debugMode=0,this.debugLimit=-1,this.debugFactor=1,this._cacheHasRenderTargetTextures=!1,this._transparencyMode=R.MATERIAL_OPAQUE,this.getScene()&&!this.getScene()?.getEngine().isWebGPU&&this.getScene().getEngine().webGLVersion<2&&C.Error("OpenPBRMaterial: WebGL 2.0 or above is required for this material."),s._noiseTextures[this.getScene().uniqueId]||(s._noiseTextures[this.getScene().uniqueId]=new K(j.GetAssetUrl("https://assets.babylonjs.com/core/blue_noise/blue_noise_rgb.png"),this.getScene(),!1,!0,1),this.getScene().onDisposeObservable.addOnce(()=>{s._noiseTextures[this.getScene().uniqueId]?.dispose(),delete s._noiseTextures[this.getScene().uniqueId]})),this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>(this._renderTargets.reset(),O.ReflectionTextureEnabled&&this._radianceTexture&&this._radianceTexture.isRenderTarget&&this._renderTargets.push(this._radianceTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets),this._environmentBRDFTexture=Q(this.getScene()),this._environmentFuzzBRDFTexture=G(this.getScene()),this.prePassConfiguration=new z,this._propertyList={};for(const n of Object.getOwnPropertyNames(this)){const u=this[n];u instanceof A&&(this._propertyList[n]=u)}Object.keys(this._propertyList).forEach(n=>{const u=this._propertyList[n];let T=this._uniformsList[u.targetUniformName];T?T.numComponents!==u.targetUniformComponentNum&&C.Error(`Uniform ${u.targetUniformName} already exists of size ${T.numComponents}, but trying to set it to ${u.targetUniformComponentNum}.`):(T=new N(u.targetUniformName,u.targetUniformComponentNum),this._uniformsList[u.targetUniformName]=T),T.linkedProperties[u.name]=u}),this._samplersList={};for(const n of Object.getOwnPropertyNames(this)){const u=this[n];u instanceof p&&(this._samplersList[n]=u)}for(const n in this._samplersList){const T=this._samplersList[n].textureDefine;this._samplerDefines[T]={type:"boolean",default:!1},this._samplerDefines[T+"DIRECTUV"]={type:"number",default:0},this._samplerDefines[T+"_GAMMA"]={type:"boolean",default:!1}}this._baseWeight,this._baseWeightTexture,this._baseColor,this._baseColorTexture,this._baseDiffuseRoughness,this._baseDiffuseRoughnessTexture,this._baseMetalness,this._baseMetalnessTexture,this._specularWeight,this._specularWeightTexture,this._specularColor,this._specularColorTexture,this._specularRoughness,this._specularIor,this._specularRoughnessTexture,this._specularRoughnessAnisotropy,this._specularRoughnessAnisotropyTexture,this._coatWeight,this._coatWeightTexture,this._coatColor,this._coatColorTexture,this._coatRoughness,this._coatRoughnessTexture,this._coatRoughnessAnisotropy,this._coatRoughnessAnisotropyTexture,this._coatIor,this._coatDarkening,this._coatDarkeningTexture,this._fuzzWeight,this._fuzzWeightTexture,this._fuzzColor,this._fuzzColorTexture,this._fuzzRoughness,this._fuzzRoughnessTexture,this._geometryNormalTexture,this._geometryTangent,this._geometryTangentTexture,this._geometryCoatNormalTexture,this._geometryCoatTangent,this._geometryCoatTangentTexture,this._geometryOpacity,this._geometryOpacityTexture,this._thinFilmWeight,this._thinFilmWeightTexture,this._thinFilmThickness,this._thinFilmThicknessMin,this._thinFilmThicknessTexture,this._thinFilmIor,this._emissionLuminance,this._emissionColor,this._emissionColorTexture,this._ambientOcclusionTexture}get hasRenderTargetTextures(){return O.ReflectionTextureEnabled&&this._radianceTexture&&this._radianceTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}get isPrePassCapable(){return!this.disableDepthWrite}getClassName(){return"OpenPBRMaterial"}get transparencyMode(){return this._transparencyMode}set transparencyMode(t){this._transparencyMode!==t&&(this._transparencyMode=t,this._markAllSubMeshesAsTexturesAndMiscDirty())}_shouldUseAlphaFromBaseColorTexture(){return this._hasAlphaChannel()&&this._transparencyMode!==R.MATERIAL_OPAQUE&&!this.geometryOpacityTexture}_hasAlphaChannel(){return this.baseColorTexture!=null&&this.baseColorTexture.hasAlpha&&this._useAlphaFromBaseColorTexture||this.geometryOpacityTexture!=null}clone(t,r=!0,e=""){const a=w.Clone(()=>new s(t,this.getScene()),this,{cloneTexturesOnlyOnce:r});return a.id=t,a.name=t,this.stencil.copyTo(a.stencil),this._clonePlugins(a,e),a}serialize(){const t=super.serialize();return t.customType="BABYLON.OpenPBRMaterial",t}static Parse(t,r,e){const a=w.Parse(()=>new s(t.name,r),t,r,e);return t.stencil&&a.stencil.parse(t.stencil,r,e),R._ParsePlugins(t,a,r,e),a}forceCompilation(t,r,e){const a={clipPlane:!1,useInstances:!1,...e};this._uniformBufferLayoutBuilt||this.buildUniformLayout(),this._callbackPluginEventGeneric(4,this._eventInfo),(()=>{if(this._breakShaderLoadedCheck)return;const u=new V({...this._eventInfo.defineNames||{},...this._samplerDefines||{}}),T=this._prepareEffect(t,t,u,void 0,void 0,a.useInstances,a.clipPlane);this._onEffectCreatedObservable&&(d.effect=T,d.subMesh=null,this._onEffectCreatedObservable.notifyObservers(d)),T.isReady()?r&&r(this):T.onCompileObservable.add(()=>{r&&r(this)})})()}isReadyForSubMesh(t,r,e){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const a=r._drawWrapper;if(a.effect&&this.isFrozen&&a._wasPreviouslyReady&&a._wasPreviouslyUsingInstances===e)return!0;r.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),r.materialDefines=new V({...this._eventInfo.defineNames||{},...this._samplerDefines||{}}));const n=r.materialDefines;if(this._isReadyForSubMesh(r))return!0;const u=this.getScene(),T=u.getEngine();if(n._areTexturesDirty&&(this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,u.texturesEnabled)){for(const m in this._samplersList){const E=this._samplersList[m];if(E.value&&!E.value.isReadyOrNotBlocking())return!1}const h=this._getRadianceTexture();if(h&&O.ReflectionTextureEnabled){if(!h.isReadyOrNotBlocking())return!1;if(h.irradianceTexture){if(!h.irradianceTexture.isReadyOrNotBlocking())return!1}else if(!h.sphericalPolynomial&&h.getInternalTexture()?._sphericalPolynomialPromise)return!1}if(this._environmentBRDFTexture&&O.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady()||this._environmentFuzzBRDFTexture&&O.ReflectionTextureEnabled&&!this._environmentFuzzBRDFTexture.isReady()||s._noiseTextures[u.uniqueId]&&!s._noiseTextures[u.uniqueId].isReady())return!1}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=n,this._eventInfo.subMesh=r,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh||n._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;if(n.AREALIGHTUSED){for(let h=0;h{t.addUniform(r.name,r.numComponents)}),Object.values(this._samplersList).forEach(r=>{t.addUniform(r.samplerInfoName,2),t.addUniform(r.samplerMatrixName,16)}),super.buildUniformLayout()}bindForSubMesh(t,r,e){const a=this.getScene(),n=e.materialDefines;if(!n)return;const u=e.effect;if(!u)return;this._activeEffect=u,r.getMeshUniformBuffer().bindToEffect(u,"Mesh"),r.transferToEffect(t);const T=a.getEngine();this._uniformBuffer.bindToEffect(u,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,a,r,t,this.isFrozen),U.Bind(T.currentRenderPassId,this._activeEffect,r,t,this);const g=a.activeCamera;g?this._uniformBuffer.updateFloat4("cameraInfo",g.minZ,g.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0),this._eventInfo.subMesh=e,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),n.OBJECTSPACE_NORMALMAP&&(t.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const S=this._mustRebind(a,u,e,r.visibility);q(r,this._activeEffect,this.prePassConfiguration);let _=null;const l=this._uniformBuffer;if(S){if(this.bindViewProjection(u),_=this._getRadianceTexture(),!l.useUbo||!this.isFrozen||!l.isSync||e._drawWrapper._forceRebindOnNextCall){if(a.texturesEnabled){for(const h in this._samplersList){const m=this._samplersList[h];m.value&&(l.updateFloat2(m.samplerInfoName,m.value.coordinatesIndex,m.value.level),J(m.value,l,m.samplerPrefix))}this.geometryNormalTexture&&(a._mirroredCameraPosition?l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),ee(a,n,l,P.White(),_,this.realTimeFiltering,!0,!0,!0,!0,!0)}this.pointsCloud&&l.updateFloat("pointSize",this.pointSize),Object.values(this._uniformsList).forEach(h=>{h.numComponents===4?(h.populateVectorFromLinkedProperties(F.Vector4[0]),l.updateVector4(h.name,F.Vector4[0])):h.numComponents===3?(h.populateVectorFromLinkedProperties(F.Vector3[0]),l.updateVector3(h.name,F.Vector3[0])):h.numComponents===2?(h.populateVectorFromLinkedProperties(F.Vector2[0]),l.updateFloat2(h.name,F.Vector2[0].x,F.Vector2[0].y)):h.numComponents===1&&l.updateFloat(h.name,h.linkedProperties[Object.keys(h.linkedProperties)[0]].value)}),this._lightingInfos.x=this.directIntensity,this._lightingInfos.y=this.emissionLuminance,this._lightingInfos.z=this.environmentIntensity*a.environmentIntensity,this._lightingInfos.w=1,l.updateVector4("vLightingIntensity",this._lightingInfos),l.updateFloat2("vDebugMode",this.debugLimit,this.debugFactor)}if(a.texturesEnabled){for(const h in this._samplersList){const m=this._samplersList[h];m.value&&l.setTexture(m.samplerName,m.value)}te(a,n,l,_,this.realTimeFiltering),n.ENVIRONMENTBRDF&&l.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),n.FUZZENVIRONMENTBRDF&&l.setTexture("environmentFuzzBrdfSampler",this._environmentFuzzBRDFTexture),(n.ANISOTROPIC||n.FUZZ)&&l.setTexture("blueNoiseSampler",s._noiseTextures[this.getScene().uniqueId])}this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(r)&&this.getScene().depthPeelingRenderer.bind(u),this._eventInfo.subMesh=e,this._callbackPluginEventBindForSubMesh(this._eventInfo),se(this._activeEffect,this,a),this.bindEyePosition(u)}else a.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(S||!this.isFrozen)&&(a.lightsEnabled&&!this._disableLighting&&ie(a,r,this._activeEffect,n,this._maxSimultaneousLights),(a.fogEnabled&&r.applyFog&&a.fogMode!==re.FOGMODE_NONE||_||r.receiveShadows||n.PREPASS)&&this.bindView(u),ae(a,r,this._activeEffect,!0),n.NUM_MORPH_INFLUENCERS&&oe(r,this._activeEffect),n.BAKED_VERTEX_ANIMATION_TEXTURE&&r.bakedVertexAnimationManager?.bind(u,n.INSTANCES),this._imageProcessingConfiguration.bind(this._activeEffect),ne(n,this._activeEffect,a)),this._afterBind(r,this._activeEffect,e),l.update()}getAnimatables(){const t=super.getAnimatables();for(const r in this._samplersList){const e=this._samplersList[r];e.value&&e.value.animations&&e.value.animations.length>0&&t.push(e.value)}return this._radianceTexture&&this._radianceTexture.animations&&this._radianceTexture.animations.length>0&&t.push(this._radianceTexture),t}getActiveTextures(){const t=super.getActiveTextures();for(const r in this._samplersList){const e=this._samplersList[r];e.value&&t.push(e.value)}return this._radianceTexture&&t.push(this._radianceTexture),t}hasTexture(t){if(super.hasTexture(t))return!0;for(const r in this._samplersList)if(this._samplersList[r].value===t)return!0;return this._radianceTexture===t}setPrePassRenderer(){return!1}dispose(t,r){if(this._breakShaderLoadedCheck=!0,r){this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._environmentFuzzBRDFTexture&&this.getScene().environmentFuzzBRDFTexture!==this._environmentFuzzBRDFTexture&&this._environmentFuzzBRDFTexture.dispose();for(const e in this._samplersList)this._samplersList[e].value?.dispose();this._radianceTexture?.dispose()}this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(t,r)}_getRadianceTexture(){return this._radianceTexture?this._radianceTexture:this.getScene().environmentTexture}_prepareEffect(t,r,e,a=null,n=null,u=null,T=null){if(this._prepareDefines(t,r,e,u,T),!e.isDirty)return null;e.markAsProcessed();const S=this.getScene().getEngine(),_=new le;let l=0;e.USESPHERICALINVERTEX&&_.addFallback(l++,"USESPHERICALINVERTEX"),e.FOG&&_.addFallback(l,"FOG"),e.SPECULARAA&&_.addFallback(l,"SPECULARAA"),e.POINTSIZE&&_.addFallback(l,"POINTSIZE"),e.LOGARITHMICDEPTH&&_.addFallback(l,"LOGARITHMICDEPTH"),e.PARALLAX&&_.addFallback(l,"PARALLAX"),e.PARALLAX_RHS&&_.addFallback(l,"PARALLAX_RHS"),e.PARALLAXOCCLUSION&&_.addFallback(l++,"PARALLAXOCCLUSION"),e.ENVIRONMENTBRDF&&_.addFallback(l++,"ENVIRONMENTBRDF"),e.TANGENT&&_.addFallback(l++,"TANGENT"),l=he(e,_,this._maxSimultaneousLights,l++),e.SPECULARTERM&&_.addFallback(l++,"SPECULARTERM"),e.USESPHERICALFROMREFLECTIONMAP&&_.addFallback(l++,"USESPHERICALFROMREFLECTIONMAP"),e.USEIRRADIANCEMAP&&_.addFallback(l++,"USEIRRADIANCEMAP"),e.NORMAL&&_.addFallback(l++,"NORMAL"),e.VERTEXCOLOR&&_.addFallback(l++,"VERTEXCOLOR"),e.MORPHTARGETS&&_.addFallback(l++,"MORPHTARGETS"),e.MULTIVIEW&&_.addFallback(0,"MULTIVIEW");const h=[y.PositionKind];e.NORMAL&&h.push(y.NormalKind),e.TANGENT&&h.push(y.TangentKind);for(let I=1;I<=6;++I)e["UV"+I]&&h.push(`uv${I===1?"":I}`);e.VERTEXCOLOR&&h.push(y.ColorKind),ue(h,t,e,_),_e(h,e),Te(h,t,e),Ae(h,t,e);let m="openpbr";const E=["world","view","viewProjection","vEyePosition","vLightsType","visibility","vFogInfos","vFogColor","pointSize","mBones","normalMatrix","vLightingIntensity","logarithmicDepthConstant","vTangentSpaceParams","boneTextureWidth","vDebugMode","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo"];for(const I in this._uniformsList)E.push(I);const L=["environmentBrdfSampler","blueNoiseSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];e.FUZZENVIRONMENTBRDF&&L.push("environmentFuzzBrdfSampler");for(const I in this._samplersList){const v=this._samplersList[I];L.push(v.samplerName),E.push(v.samplerInfoName),E.push(v.samplerMatrixName)}fe(E,L,!0);const M=["Material","Scene","Mesh"],H={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:e.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=_,this._eventInfo.fallbackRank=l,this._eventInfo.defines=e,this._eventInfo.uniforms=E,this._eventInfo.attributes=h,this._eventInfo.samplers=L,this._eventInfo.uniformBuffersNames=M,this._eventInfo.customCode=void 0,this._eventInfo.mesh=t,this._eventInfo.indexParameters=H,this._callbackPluginEventGeneric(128,this._eventInfo),U.AddUniformsAndSamplers(E,L),z.AddUniforms(E),ce(E),k&&(k.PrepareUniforms(E,e),k.PrepareSamplers(L,e)),pe({uniformsNames:E,uniformBuffersNames:M,samplers:L,defines:e,maxSimultaneousLights:this._maxSimultaneousLights});const B={};this.customShaderNameResolve&&(m=this.customShaderNameResolve(m,E,M,L,e,h,B));const W=e.toString(),X=S.createEffect(m,{attributes:h,uniformsNames:E,uniformBuffersNames:M,samplers:L,defines:W,fallbacks:_,onCompiled:a,onError:n,indexParameters:H,processFinalCode:B.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:e.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{this.shaderLanguage===1?await Promise.all([D(()=>import("./openpbr.vertex-BpmkRPRZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),D(()=>import("./openpbr.fragment-ClGdrIKD.js"),__vite__mapDeps([23,1,2,3,24,4,5,6,25,8,26,27,28,29,19,30,9,31,14,10]),import.meta.url)]):await Promise.all([D(()=>import("./openpbr.vertex-CrhhV-GW.js"),__vite__mapDeps([32,1,2,3,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]),import.meta.url),D(()=>import("./openpbr.fragment-Dbeojf8B.js"),__vite__mapDeps([48,1,2,3,49,34,35,36,50,37,51,52,53,54,47,55,38,56,42,39]),import.meta.url)]),this._shadersLoaded=!0}},S);return this._eventInfo.customCode=void 0,X}_prepareDefines(t,r,e,a=null,n=null){const u=r.hasThinInstances,T=this.getScene(),g=T.getEngine();me(T,t,e,!0,this._maxSimultaneousLights,this._disableLighting),e._needNormals=!0,Ee(T,e);const S=this.needAlphaBlendingForMesh(t)&&this.getScene().useOrderIndependentTransparency;if(Re(T,e,this.canRenderToMRT&&!S),ge(T,e,S),U.PrepareDefines(g.currentRenderPassId,t,e),e.METALLICWORKFLOW=!0,e._areTexturesDirty){e._needUVs=!1;for(let _=1;_<=6;++_)e["MAINUV"+_]=!1;if(T.texturesEnabled){for(const h in this._samplersList){const m=this._samplersList[h];m.value?(Se(m.value,e,m.textureDefine),e[m.textureDefine+"_GAMMA"]=m.value.gammaSpace):e[m.textureDefine]=!1}const _=this._getRadianceTexture(),l=this._forceIrradianceInFragment||this.realTimeFiltering||this._twoSidedLighting||g.getCaps().maxVaryingVectors<=8||this._baseDiffuseRoughnessTexture!=null;Le(T,_,e,this.realTimeFiltering,this.realTimeFilteringQuality,!l),this._baseMetalnessTexture&&(e.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed),e.SPECULAR_WEIGHT_IN_ALPHA=this._useSpecularWeightFromAlpha,e.SPECULAR_WEIGHT_FROM_SPECULAR_COLOR_TEXTURE=this._useSpecularWeightFromSpecularColorTexture,e.SPECULAR_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=this._useSpecularRoughnessAnisotropyFromTangentTexture,e.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=this._useCoatRoughnessAnisotropyFromTangentTexture,e.COAT_ROUGHNESS_FROM_GREEN_CHANNEL=this._useCoatRoughnessFromGreenChannel,e.ROUGHNESSSTOREINMETALMAPGREEN=this._useRoughnessFromMetallicTextureGreen,e.FUZZ_ROUGHNESS_FROM_TEXTURE_ALPHA=this._useFuzzRoughnessFromTextureAlpha,e.METALLNESSSTOREINMETALMAPBLUE=this._useMetallicFromMetallicTextureBlue,e.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE=this._useThinFilmThicknessFromTextureGreen,this.geometryNormalTexture?(this._useParallax&&this.baseColorTexture&&O.DiffuseTextureEnabled?(e.PARALLAX=!0,e.PARALLAX_RHS=T.useRightHandedSystem,e.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):e.PARALLAX=!1,e.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):(e.PARALLAX=!1,e.PARALLAX_RHS=!1,e.PARALLAXOCCLUSION=!1,e.OBJECTSPACE_NORMALMAP=!1),this._environmentBRDFTexture&&O.ReflectionTextureEnabled?(e.ENVIRONMENTBRDF=!0,e.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(e.ENVIRONMENTBRDF=!1,e.ENVIRONMENTBRDF_RGBD=!1),this._environmentFuzzBRDFTexture?e.FUZZENVIRONMENTBRDF=!0:e.FUZZENVIRONMENTBRDF=!1,this._shouldUseAlphaFromBaseColorTexture()?e.ALPHA_FROM_BASE_COLOR_TEXTURE=!0:e.ALPHA_FROM_BASE_COLOR_TEXTURE=!1}this._lightFalloff===R.LIGHTFALLOFF_STANDARD?(e.USEPHYSICALLIGHTFALLOFF=!1,e.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===R.LIGHTFALLOFF_GLTF?(e.USEPHYSICALLIGHTFALLOFF=!1,e.USEGLTFLIGHTFALLOFF=!0):(e.USEPHYSICALLIGHTFALLOFF=!0,e.USEGLTFLIGHTFALLOFF=!1),!this.backFaceCulling&&this._twoSidedLighting?e.TWOSIDEDLIGHTING=!0:e.TWOSIDEDLIGHTING=!1,e.MIRRORED=!!T._mirroredCameraPosition,e.SPECULARAA=g.getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(e._areTexturesDirty||e._areMiscDirty)&&(e.ALPHATESTVALUE=`${this._alphaCutOff}${this._alphaCutOff%1===0?".":""}`,e.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,e.ALPHABLEND=this.needAlphaBlendingForMesh(t)),e._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(e),e.FORCENORMALFORWARD=this._forceNormalForward,e.RADIANCEOCCLUSION=this._useRadianceOcclusion,e.HORIZONOCCLUSION=this._useHorizonOcclusion,(this.specularRoughnessAnisotropy>0||this.coatRoughnessAnisotropy>0)&&s._noiseTextures[T.uniqueId]&&O.ReflectionTextureEnabled?(e.ANISOTROPIC=!0,t.isVerticesDataPresent(y.TangentKind)||(e._needUVs=!0,e.MAINUV1=!0),this._useGltfStyleAnisotropy&&(e.USE_GLTF_STYLE_ANISOTROPY=!0),e.ANISOTROPIC_BASE=this.specularRoughnessAnisotropy>0,e.ANISOTROPIC_COAT=this.coatRoughnessAnisotropy>0):(e.ANISOTROPIC=!1,e.USE_GLTF_STYLE_ANISOTROPY=!1,e.ANISOTROPIC_BASE=!1,e.ANISOTROPIC_COAT=!1),e.THIN_FILM=this.thinFilmWeight>0,e.IRIDESCENCE=this.thinFilmWeight>0,e.FUZZ=this.fuzzWeight>0&&O.ReflectionTextureEnabled,e.FUZZ?(t.isVerticesDataPresent(y.TangentKind)||(e._needUVs=!0,e.MAINUV1=!0),this._environmentFuzzBRDFTexture=G(this.getScene()),e.FUZZ_IBL_SAMPLES=this.fuzzSampleNumber):(this._environmentFuzzBRDFTexture=null,e.FUZZENVIRONMENTBRDF=!1,e.FUZZ_IBL_SAMPLES=0),e._areMiscDirty&&(Ie(t,T,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(t),e,this._applyDecalMapAfterDetailMap,this._useVertexPulling,r,this._isVertexOutputInvariant),e.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!t.isVerticesDataPresent(y.NormalKind),e.DEBUGMODE=this._debugMode),Oe(T,g,this,e,!!a,n,u),this._eventInfo.defines=e,this._eventInfo.mesh=t,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),ye(t,e,!0,!0,!0,this._transparencyMode!==R.MATERIAL_OPAQUE),this._callbackPluginEventPrepareDefines(this._eventInfo)}}s._noiseTextures={};s.ForceGLSL=!1;i([o("_markAllSubMeshesAsTexturesDirty","baseWeight")],s.prototype,"_baseWeight",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseWeightTexture")],s.prototype,"_baseWeightTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseColor")],s.prototype,"_baseColor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseColorTexture")],s.prototype,"_baseColorTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseDiffuseRoughness")],s.prototype,"_baseDiffuseRoughness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseDiffuseRoughnessTexture")],s.prototype,"_baseDiffuseRoughnessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseMetalness")],s.prototype,"_baseMetalness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","baseMetalnessTexture")],s.prototype,"_baseMetalnessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularWeight")],s.prototype,"_specularWeight",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularWeightTexture")],s.prototype,"_specularWeightTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularColor")],s.prototype,"_specularColor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularColorTexture")],s.prototype,"_specularColorTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularRoughness")],s.prototype,"_specularRoughness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularRoughnessTexture")],s.prototype,"_specularRoughnessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularRoughnessAnisotropy")],s.prototype,"_specularRoughnessAnisotropy",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularRoughnessAnisotropyTexture")],s.prototype,"_specularRoughnessAnisotropyTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","specularIor")],s.prototype,"_specularIor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatWeight")],s.prototype,"_coatWeight",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatWeightTexture")],s.prototype,"_coatWeightTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatColor")],s.prototype,"_coatColor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatColorTexture")],s.prototype,"_coatColorTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatRoughness")],s.prototype,"_coatRoughness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatRoughnessTexture")],s.prototype,"_coatRoughnessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatRoughnessAnisotropy")],s.prototype,"_coatRoughnessAnisotropy",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatRoughnessAnisotropyTexture")],s.prototype,"_coatRoughnessAnisotropyTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatIor")],s.prototype,"_coatIor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatDarkening")],s.prototype,"_coatDarkening",void 0);i([o("_markAllSubMeshesAsTexturesDirty","coatDarkeningTexture")],s.prototype,"_coatDarkeningTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzWeight")],s.prototype,"_fuzzWeight",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzWeightTexture")],s.prototype,"_fuzzWeightTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzColor")],s.prototype,"_fuzzColor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzColorTexture")],s.prototype,"_fuzzColorTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzRoughness")],s.prototype,"_fuzzRoughness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","fuzzRoughnessTexture")],s.prototype,"_fuzzRoughnessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryNormalTexture")],s.prototype,"_geometryNormalTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryTangent")],s.prototype,"_geometryTangent",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryTangentTexture")],s.prototype,"_geometryTangentTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryCoatNormalTexture")],s.prototype,"_geometryCoatNormalTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryCoatTangent")],s.prototype,"_geometryCoatTangent",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryCoatTangentTexture")],s.prototype,"_geometryCoatTangentTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryOpacity")],s.prototype,"_geometryOpacity",void 0);i([o("_markAllSubMeshesAsTexturesDirty","geometryOpacityTexture")],s.prototype,"_geometryOpacityTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","emissionLuminance")],s.prototype,"_emissionLuminance",void 0);i([o("_markAllSubMeshesAsTexturesDirty","emissionColor")],s.prototype,"_emissionColor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","emissionColorTexture")],s.prototype,"_emissionColorTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmWeight")],s.prototype,"_thinFilmWeight",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmWeightTexture")],s.prototype,"_thinFilmWeightTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmThickness")],s.prototype,"_thinFilmThickness",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmThicknessMin")],s.prototype,"_thinFilmThicknessMin",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmThicknessTexture")],s.prototype,"_thinFilmThicknessTexture",void 0);i([o("_markAllSubMeshesAsTexturesDirty","thinFilmIor")],s.prototype,"_thinFilmIor",void 0);i([o("_markAllSubMeshesAsTexturesDirty","ambientOcclusionTexture")],s.prototype,"_ambientOcclusionTexture",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"directIntensity",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"environmentIntensity",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useSpecularWeightFromTextureAlpha",void 0);i([f(),c("_markAllSubMeshesAsTexturesAndMiscDirty")],s.prototype,"forceAlphaTest",void 0);i([f(),c("_markAllSubMeshesAsTexturesAndMiscDirty")],s.prototype,"alphaCutOff",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useAmbientInGrayScale",void 0);i([f()],s.prototype,"usePhysicalLightFalloff",null);i([f()],s.prototype,"useGLTFLightFalloff",null);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useObjectSpaceNormalMap",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useParallax",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useParallaxOcclusion",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"parallaxScaleBias",void 0);i([f(),c("_markAllSubMeshesAsLightsDirty")],s.prototype,"disableLighting",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"forceIrradianceInFragment",void 0);i([f(),c("_markAllSubMeshesAsLightsDirty")],s.prototype,"maxSimultaneousLights",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"invertNormalMapX",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"invertNormalMapY",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"twoSidedLighting",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useAlphaFresnel",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useLinearAlphaFresnel",void 0);i([c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"environmentBRDFTexture",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"forceNormalForward",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"enableSpecularAntiAliasing",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useHorizonOcclusion",void 0);i([f(),c("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useRadianceOcclusion",void 0);i([f(),c("_markAllSubMeshesAsMiscDirty")],s.prototype,"unlit",void 0);i([f(),c("_markAllSubMeshesAsMiscDirty")],s.prototype,"applyDecalMapAfterDetailMap",void 0);i([c("_markAllSubMeshesAsMiscDirty")],s.prototype,"debugMode",void 0);i([f()],s.prototype,"transparencyMode",null);xe("BABYLON.OpenPBRMaterial",s);export{s as OpenPBRMaterial,V as OpenPBRMaterialDefines}; diff --git a/assets/openpbrUboDeclaration-DYpAvMMQ.js b/assets/openpbrUboDeclaration-DYpAvMMQ.js deleted file mode 100644 index 92c7f144d8dd896457f884fda874ede38e094722..0000000000000000000000000000000000000000 --- a/assets/openpbrUboDeclaration-DYpAvMMQ.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const o="openpbrUboDeclaration",a=`layout(std140,column_major) uniform;uniform Material {vec2 vTangentSpaceParams;vec4 vLightingIntensity;float pointSize;vec2 vDebugMode;vec4 cameraInfo;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;float vBaseWeight;vec4 vBaseColor;float vBaseDiffuseRoughness;vec4 vReflectanceInfo;vec4 vSpecularColor;vec3 vSpecularAnisotropy;float vCoatWeight;vec3 vCoatColor;float vCoatRoughness;float vCoatRoughnessAnisotropy;float vCoatIor;float vCoatDarkening;float vFuzzWeight;vec3 vFuzzColor;float vFuzzRoughness;vec2 vGeometryCoatTangent;vec3 vEmissionColor;float vThinFilmWeight;vec2 vThinFilmThickness;float vThinFilmIor;vec2 vBaseWeightInfos;mat4 baseWeightMatrix;vec2 vBaseColorInfos;mat4 baseColorMatrix;vec2 vBaseDiffuseRoughnessInfos;mat4 baseDiffuseRoughnessMatrix;vec2 vBaseMetalnessInfos;mat4 baseMetalnessMatrix;vec2 vSpecularWeightInfos;mat4 specularWeightMatrix;vec2 vSpecularColorInfos;mat4 specularColorMatrix;vec2 vSpecularRoughnessInfos;mat4 specularRoughnessMatrix;vec2 vSpecularRoughnessAnisotropyInfos;mat4 specularRoughnessAnisotropyMatrix;vec2 vCoatWeightInfos;mat4 coatWeightMatrix;vec2 vCoatColorInfos;mat4 coatColorMatrix;vec2 vCoatRoughnessInfos;mat4 coatRoughnessMatrix;vec2 vCoatRoughnessAnisotropyInfos;mat4 coatRoughnessAnisotropyMatrix;vec2 vCoatDarkeningInfos;mat4 coatDarkeningMatrix;vec2 vFuzzWeightInfos;mat4 fuzzWeightMatrix;vec2 vFuzzColorInfos;mat4 fuzzColorMatrix;vec2 vFuzzRoughnessInfos;mat4 fuzzRoughnessMatrix;vec2 vGeometryNormalInfos;mat4 geometryNormalMatrix;vec2 vGeometryTangentInfos;mat4 geometryTangentMatrix;vec2 vGeometryCoatNormalInfos;mat4 geometryCoatNormalMatrix;vec2 vGeometryCoatTangentInfos;mat4 geometryCoatTangentMatrix;vec2 vGeometryOpacityInfos;mat4 geometryOpacityMatrix;vec2 vEmissionColorInfos;mat4 emissionColorMatrix;vec2 vThinFilmWeightInfos;mat4 thinFilmWeightMatrix;vec2 vThinFilmThicknessInfos;mat4 thinFilmThicknessMatrix;vec2 vAmbientOcclusionInfos;mat4 ambientOcclusionMatrix; -#define ADDITIONAL_UBO_DECLARATION -}; -#include -#include -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=a); diff --git a/assets/openpbrUboDeclaration-cKzwVrP1.js b/assets/openpbrUboDeclaration-cKzwVrP1.js deleted file mode 100644 index e8286ba2b9dd30ab09c31fbe79107cfc2c0e13d4..0000000000000000000000000000000000000000 --- a/assets/openpbrUboDeclaration-cKzwVrP1.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const f="openpbrUboDeclaration",i=`uniform vTangentSpaceParams: vec2f;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vDebugMode: vec2f;uniform cameraInfo: vec4f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionDominantDirection: vec3f;uniform vReflectionColor: vec3f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;uniform vBaseWeight: f32;uniform vBaseColor: vec4f;uniform vBaseDiffuseRoughness: f32;uniform vReflectanceInfo: vec4f;uniform vSpecularColor: vec4f;uniform vSpecularAnisotropy: vec3f;uniform vCoatWeight: f32;uniform vCoatColor: vec3f;uniform vCoatRoughness: f32;uniform vCoatRoughnessAnisotropy: f32;uniform vCoatIor: f32;uniform vCoatDarkening : f32;uniform vFuzzWeight: f32;uniform vFuzzColor: vec3f;uniform vFuzzRoughness: f32;uniform vGeometryCoatTangent: vec2f;uniform vEmissionColor: vec3f;uniform vThinFilmWeight: f32;uniform vThinFilmThickness: vec2f;uniform vThinFilmIor: f32;uniform vBaseWeightInfos: vec2f;uniform baseWeightMatrix: mat4x4f;uniform vBaseColorInfos: vec2f;uniform baseColorMatrix: mat4x4f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform vBaseMetalnessInfos: vec2f;uniform baseMetalnessMatrix: mat4x4f;uniform vSpecularWeightInfos: vec2f;uniform specularWeightMatrix: mat4x4f;uniform vSpecularColorInfos: vec2f;uniform specularColorMatrix: mat4x4f;uniform vSpecularRoughnessInfos: vec2f;uniform specularRoughnessMatrix: mat4x4f;uniform vSpecularRoughnessAnisotropyInfos: vec2f;uniform specularRoughnessAnisotropyMatrix: mat4x4f;uniform vCoatWeightInfos: vec2f;uniform coatWeightMatrix: mat4x4f;uniform vCoatColorInfos: vec2f;uniform coatColorMatrix: mat4x4f;uniform vCoatRoughnessInfos: vec2f;uniform coatRoughnessMatrix: mat4x4f;uniform vCoatRoughnessAnisotropyInfos: vec2f;uniform coatRoughnessAnisotropyMatrix: mat4x4f;uniform vCoatDarkeningInfos : vec2f;uniform coatDarkeningMatrix : mat4x4f;uniform vFuzzWeightInfos: vec2f;uniform fuzzWeightMatrix: mat4x4f;uniform vFuzzColorInfos: vec2f;uniform fuzzColorMatrix: mat4x4f;uniform vFuzzRoughnessInfos: vec2f;uniform fuzzRoughnessMatrix: mat4x4f;uniform vGeometryNormalInfos: vec2f;uniform geometryNormalMatrix: mat4x4f;uniform vGeometryTangentInfos: vec2f;uniform geometryTangentMatrix: mat4x4f;uniform vGeometryCoatNormalInfos: vec2f;uniform geometryCoatNormalMatrix: mat4x4f;uniform vGeometryCoatTangentInfos: vec2f;uniform geometryCoatTangentMatrix: mat4x4f;uniform vGeometryOpacityInfos: vec2f;uniform geometryOpacityMatrix: mat4x4f;uniform vEmissionInfos: vec2f;uniform emissionMatrix: mat4x4f;uniform vThinFilmWeightInfos: vec2f;uniform thinFilmWeightMatrix: mat4x4f;uniform vThinFilmThicknessInfos: vec2f;uniform thinFilmThicknessMatrix: mat4x4f;uniform vAmbientOcclusionInfos: vec2f;uniform ambientOcclusionMatrix: mat4x4f; -#define ADDITIONAL_UBO_DECLARATION -#include -#include -`;o.IncludesShadersStoreWGSL[f]||(o.IncludesShadersStoreWGSL[f]=i); diff --git a/assets/packingFunctions-Dod19T_v.js b/assets/packingFunctions-Dod19T_v.js deleted file mode 100644 index da84c1ee157e42c018a6d612dcd54dbbebbefd18..0000000000000000000000000000000000000000 --- a/assets/packingFunctions-Dod19T_v.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="packingFunctions",c=`fn pack(depth: f32)->vec4f -{const bit_shift: vec4f= vec4f(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const bit_mask: vec4f= vec4f(0.0,1.0/255.0,1.0/255.0,1.0/255.0);var res: vec4f=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} -fn unpack(color: vec4f)->f32 -{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=c); diff --git a/assets/packingFunctions-qIF0h5ys.js b/assets/packingFunctions-qIF0h5ys.js deleted file mode 100644 index 71af401971aac9d844014d568533a2cedd1805b1..0000000000000000000000000000000000000000 --- a/assets/packingFunctions-qIF0h5ys.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";const e="packingFunctions",c=`vec4 pack(float depth) -{const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} -float unpack(vec4 color) -{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;t.IncludesShadersStore[e]||(t.IncludesShadersStore[e]=c); diff --git a/assets/pass.fragment-I5Wdwpz1.js b/assets/pass.fragment-I5Wdwpz1.js deleted file mode 100644 index de3a00cad9682067c5a09fe57f8efe0e7655f47a..0000000000000000000000000000000000000000 --- a/assets/pass.fragment-I5Wdwpz1.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="passPixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const p={name:e,shader:t};export{p as passPixelShaderWGSL}; diff --git a/assets/pass.fragment-nyUGT5FF.js b/assets/pass.fragment-nyUGT5FF.js deleted file mode 100644 index 9516b7aaf0c3aa8fd5b20eef05baa419ba1756f2..0000000000000000000000000000000000000000 --- a/assets/pass.fragment-nyUGT5FF.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="passPixelShader",a=`varying vec2 vUV;uniform sampler2D textureSampler; -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{gl_FragColor=texture2D(textureSampler,vUV);}`;r.ShadersStore[e]||(r.ShadersStore[e]=a);const S={name:e,shader:a};export{S as passPixelShader}; diff --git a/assets/passCube.fragment-BKk9_j1-.js b/assets/passCube.fragment-BKk9_j1-.js deleted file mode 100644 index fcaa85106006a33639d1e576d2e09777efd4124e..0000000000000000000000000000000000000000 --- a/assets/passCube.fragment-BKk9_j1-.js +++ /dev/null @@ -1,23 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="passCubePixelShader",r=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube; -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f=input.vUV*2.0-1.0; -#ifdef POSITIVEX -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x)); -#endif -#ifdef NEGATIVEX -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x)); -#endif -#ifdef POSITIVEY -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x)); -#endif -#ifdef NEGATIVEY -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x)); -#endif -#ifdef POSITIVEZ -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,1.001)); -#endif -#ifdef NEGATIVEZ -fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,-1.001)); -#endif -}`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=r);const S={name:e,shader:r};export{S as passCubePixelShaderWGSL}; diff --git a/assets/passCube.fragment-C0agWgUQ.js b/assets/passCube.fragment-C0agWgUQ.js deleted file mode 100644 index c98d3fc4ae3b96b123b5bab281a52baab1a51bb6..0000000000000000000000000000000000000000 --- a/assets/passCube.fragment-C0agWgUQ.js +++ /dev/null @@ -1,23 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="passCubePixelShader",t=`varying vec2 vUV;uniform samplerCube textureSampler; -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{vec2 uv=vUV*2.0-1.0; -#ifdef POSITIVEX -gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x)); -#endif -#ifdef NEGATIVEX -gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x)); -#endif -#ifdef POSITIVEY -gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x)); -#endif -#ifdef NEGATIVEY -gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x)); -#endif -#ifdef POSITIVEZ -gl_FragColor=textureCube(textureSampler,vec3(uv,1.001)); -#endif -#ifdef NEGATIVEZ -gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001)); -#endif -}`;r.ShadersStore[e]||(r.ShadersStore[e]=t);const o={name:e,shader:t};export{o as passCubePixelShader}; diff --git a/assets/pbr.fragment-1wF50-MN.js b/assets/pbr.fragment-1wF50-MN.js deleted file mode 100644 index ed90005de10997b0e51410deef878d171cf8038c..0000000000000000000000000000000000000000 --- a/assets/pbr.fragment-1wF50-MN.js +++ /dev/null @@ -1,2657 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./oitFragment-cUdAGBvC.js";import"./pbrUboDeclaration-VU_3zv-q.js";import"./pbrDebug-B24xpn-H.js";import"./shadowsFragmentFunctions-dMCKkVlT.js";import"./bumpFragment-Dn7_UB6Q.js";import"./imageProcessingFunctions-BwYIAaLN.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./fogFragment-M_o52SDz.js";import"./helperFunctions-tBt4f_K3.js";import"./hdrFilteringFunctions-B6pmqAql.js";import"./harmonicsFunctions-DgiK80M3.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./decalFragment-1pWMlRR5.js";import"./lightFragment-CZjYZOQF.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";const n="pbrFragmentDeclaration",_=`uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform float baseWeight;uniform float baseDiffuseRoughness;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor; -#ifdef ALBEDO -uniform vec2 vAlbedoInfos; -#endif -#ifdef BASE_WEIGHT -uniform vec2 vBaseWeightInfos; -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -uniform vec2 vBaseDiffuseRoughnessInfos; -#endif -#ifdef AMBIENT -uniform vec4 vAmbientInfos; -#endif -#ifdef BUMP -uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams; -#endif -#ifdef OPACITY -uniform vec2 vOpacityInfos; -#endif -#ifdef EMISSIVE -uniform vec2 vEmissiveInfos; -#endif -#ifdef LIGHTMAP -uniform vec2 vLightmapInfos; -#endif -#ifdef REFLECTIVITY -uniform vec3 vReflectivityInfos; -#endif -#ifdef MICROSURFACEMAP -uniform vec2 vMicroSurfaceSamplerInfos; -#endif -#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS) -uniform mat4 view; -#endif -#ifdef REFLECTION -uniform vec2 vReflectionInfos; -#ifdef REALTIME_FILTERING -uniform vec2 vReflectionFilteringInfo; -#endif -uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos; -#if defined(USEIRRADIANCEMAP) && defined(USE_IRRADIANCE_DOMINANT_DIRECTION) -uniform vec3 vReflectionDominantDirection; -#endif -#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC) -uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; -#endif -#endif -#if defined(SS_REFRACTION) && defined(SS_USE_LOCAL_REFRACTIONMAP_CUBIC) -uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; -#endif -#ifdef CLEARCOAT -uniform vec2 vClearCoatParams;uniform vec4 vClearCoatRefractionParams; -#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS) -uniform vec4 vClearCoatInfos; -#endif -#ifdef CLEARCOAT_TEXTURE -uniform mat4 clearCoatMatrix; -#endif -#ifdef CLEARCOAT_TEXTURE_ROUGHNESS -uniform mat4 clearCoatRoughnessMatrix; -#endif -#ifdef CLEARCOAT_BUMP -uniform vec2 vClearCoatBumpInfos;uniform vec2 vClearCoatTangentSpaceParams;uniform mat4 clearCoatBumpMatrix; -#endif -#ifdef CLEARCOAT_TINT -uniform vec4 vClearCoatTintParams;uniform float clearCoatColorAtDistance; -#ifdef CLEARCOAT_TINT_TEXTURE -uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix; -#endif -#endif -#endif -#ifdef IRIDESCENCE -uniform vec4 vIridescenceParams; -#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE) -uniform vec4 vIridescenceInfos; -#endif -#ifdef IRIDESCENCE_TEXTURE -uniform mat4 iridescenceMatrix; -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -uniform mat4 iridescenceThicknessMatrix; -#endif -#endif -#ifdef ANISOTROPIC -uniform vec3 vAnisotropy; -#ifdef ANISOTROPIC_TEXTURE -uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix; -#endif -#endif -#ifdef SHEEN -uniform vec4 vSheenColor; -#ifdef SHEEN_ROUGHNESS -uniform float vSheenRoughness; -#endif -#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS) -uniform vec4 vSheenInfos; -#endif -#ifdef SHEEN_TEXTURE -uniform mat4 sheenMatrix; -#endif -#ifdef SHEEN_TEXTURE_ROUGHNESS -uniform mat4 sheenRoughnessMatrix; -#endif -#endif -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -uniform vec4 vRefractionMicrosurfaceInfos;uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix; -#ifdef REALTIME_FILTERING -uniform vec2 vRefractionFilteringInfo; -#endif -#ifdef SS_DISPERSION -uniform float dispersion; -#endif -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix; -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix; -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix; -#endif -uniform vec2 vThicknessParam;uniform vec3 vDiffusionDistance;uniform vec4 vTintColor;uniform vec3 vSubSurfaceIntensity;uniform vec4 vTranslucencyColor; -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -uniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix; -#endif -#endif -#ifdef PREPASS -#ifdef SS_SCATTERING -uniform float scatteringDiffusionProfile; -#endif -#endif -#if DEBUGMODE>0 -uniform vec2 vDebugMode; -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos; -#endif -#include -#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22; -#else -uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX; -#endif -#endif -#define ADDITIONAL_FRAGMENT_DECLARATION -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=_);const a="samplerFragmentAlternateDeclaration",M=`#ifdef _DEFINENAME_ -#if _DEFINENAME_DIRECTUV==1 -#define v_VARYINGNAME_UV vMainUV1 -#elif _DEFINENAME_DIRECTUV==2 -#define v_VARYINGNAME_UV vMainUV2 -#elif _DEFINENAME_DIRECTUV==3 -#define v_VARYINGNAME_UV vMainUV3 -#elif _DEFINENAME_DIRECTUV==4 -#define v_VARYINGNAME_UV vMainUV4 -#elif _DEFINENAME_DIRECTUV==5 -#define v_VARYINGNAME_UV vMainUV5 -#elif _DEFINENAME_DIRECTUV==6 -#define v_VARYINGNAME_UV vMainUV6 -#else -varying vec2 v_VARYINGNAME_UV; -#endif -#endif -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=M);const r="pbrFragmentSamplersDeclaration",D=`#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness) -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) -uniform sampler2D clearCoatRoughnessSampler; -#endif -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness) -#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) -uniform sampler2D sheenRoughnessSampler; -#endif -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy) -#endif -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -#define sampleReflection(s,c) textureCube(s,c) -uniform samplerCube reflectionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l) -#else -uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh; -#endif -#ifdef USEIRRADIANCEMAP -uniform samplerCube irradianceSampler; -#endif -#else -#define sampleReflection(s,c) texture2D(s,c) -uniform sampler2D reflectionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l) -#else -uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh; -#endif -#ifdef USEIRRADIANCEMAP -uniform sampler2D irradianceSampler; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#endif -#endif -#ifdef ENVIRONMENTBRDF -uniform sampler2D environmentBrdfSampler; -#endif -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -#ifdef SS_REFRACTIONMAP_3D -#define sampleRefraction(s,c) textureCube(s,c) -uniform samplerCube refractionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l) -#else -uniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh; -#endif -#else -#define sampleRefraction(s,c) texture2D(s,c) -uniform sampler2D refractionSampler; -#ifdef LODBASEDMICROSFURACE -#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l) -#else -uniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh; -#endif -#endif -#endif -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor) -#endif -#ifdef IBL_CDF_FILTERING -uniform sampler2D icdfSampler; -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=D);const f="pbrBlockAlbedoOpacity",h=`struct albedoOpacityOutParams -{vec3 surfaceAlbedo;float alpha;}; -#define pbr_inline -albedoOpacityOutParams albedoOpacityBlock( -in vec4 vAlbedoColor -#ifdef ALBEDO -,in vec4 albedoTexture -,in vec2 albedoInfos -#endif -,in float baseWeight -#ifdef BASE_WEIGHT -,in vec4 baseWeightTexture -,in vec2 vBaseWeightInfos -#endif -#ifdef OPACITY -,in vec4 opacityMap -,in vec2 vOpacityInfos -#endif -#ifdef DETAIL -,in vec4 detailColor -,in vec4 vDetailInfos -#endif -#ifdef DECAL -,in vec4 decalColor -,in vec4 vDecalInfos -#endif -) -{albedoOpacityOutParams outParams;vec3 surfaceAlbedo=vAlbedoColor.rgb;float alpha=vAlbedoColor.a; -#ifdef ALBEDO -#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST) -alpha*=albedoTexture.a; -#endif -#ifdef GAMMAALBEDO -surfaceAlbedo*=toLinearSpace(albedoTexture.rgb); -#else -surfaceAlbedo*=albedoTexture.rgb; -#endif -surfaceAlbedo*=albedoInfos.y; -#endif -#ifndef DECAL_AFTER_DETAIL -#include -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -surfaceAlbedo*=vColor.rgb; -#endif -#ifdef DETAIL -float detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; -#endif -#ifdef DECAL_AFTER_DETAIL -#include -#endif -#define CUSTOM_FRAGMENT_UPDATE_ALBEDO -surfaceAlbedo*=baseWeight; -#ifdef BASE_WEIGHT -surfaceAlbedo*=baseWeightTexture.r; -#endif -#ifdef OPACITY -#ifdef OPACITYRGB -alpha=getLuminance(opacityMap.rgb); -#else -alpha*=opacityMap.a; -#endif -alpha*=vOpacityInfos.y; -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=vColor.a; -#endif -#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL) -#ifdef ALPHATEST -#if DEBUGMODE != 88 -if (alpha0 -#ifdef METALLICWORKFLOW -#ifdef REFLECTIVITY -vec4 surfaceMetallicColorMap; -#endif -vec3 metallicF0; -#else -#ifdef REFLECTIVITY -vec4 surfaceReflectivityColorMap; -#endif -#endif -#endif -}; -#define pbr_inline -reflectivityOutParams reflectivityBlock( -in vec4 reflectivityColor -#ifdef METALLICWORKFLOW -,in vec3 surfaceAlbedo -,in vec4 metallicReflectanceFactors -#endif -,in float baseDiffuseRoughness -#ifdef BASE_DIFFUSE_ROUGHNESS -,in float baseDiffuseRoughnessTexture -,in vec2 baseDiffuseRoughnessInfos -#endif -#ifdef REFLECTIVITY -,in vec3 reflectivityInfos -,in vec4 surfaceMetallicOrReflectivityColorMap -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -,in vec3 ambientOcclusionColorIn -#endif -#ifdef MICROSURFACEMAP -,in vec4 microSurfaceTexel -#endif -#ifdef DETAIL -,in vec4 detailColor -,in vec4 vDetailInfos -#endif -) -{reflectivityOutParams outParams;float microSurface=reflectivityColor.a;vec3 surfaceReflectivityColor=reflectivityColor.rgb; -#ifdef METALLICWORKFLOW -vec2 metallicRoughness=surfaceReflectivityColor.rg;float ior=surfaceReflectivityColor.b; -#ifdef REFLECTIVITY -#if DEBUGMODE>0 -outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap; -#endif -#ifdef AOSTOREINMETALMAPRED -vec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z); -#endif -#ifdef METALLNESSSTOREINMETALMAPBLUE -metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b; -#else -metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r; -#endif -#ifdef ROUGHNESSSTOREINMETALMAPALPHA -metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a; -#else -#ifdef ROUGHNESSSTOREINMETALMAPGREEN -metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g; -#endif -#endif -#endif -#ifdef DETAIL -float detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);float loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);float hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5)); -#endif -#ifdef MICROSURFACEMAP -metallicRoughness.g*=microSurfaceTexel.r; -#endif -#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS -microSurface=1.0-metallicRoughness.g;vec3 baseColor=surfaceAlbedo;outParams.metallic=metallicRoughness.r;outParams.specularWeight=metallicReflectanceFactors.a;float dielectricF0=reflectivityColor.a*outParams.specularWeight;surfaceReflectivityColor=metallicReflectanceFactors.rgb; -#if DEBUGMODE>0 -outParams.metallicF0=vec3(dielectricF0)*surfaceReflectivityColor; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.surfaceAlbedo=baseColor.rgb*(vec3(1.0)-vec3(dielectricF0)*surfaceReflectivityColor)*(1.0-outParams.metallic); -#else -outParams.surfaceAlbedo=baseColor.rgb; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -{vec3 reflectivityColor=mix(dielectricF0*surfaceReflectivityColor,baseColor.rgb,outParams.metallic);outParams.reflectanceF0=max(reflectivityColor.r,max(reflectivityColor.g,reflectivityColor.b));} -#else -#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF -float maxF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF0=mix(dielectricF0*maxF0,1.0,outParams.metallic); -#else -outParams.reflectanceF0=mix(dielectricF0,1.0,outParams.metallic); -#endif -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.reflectanceF90=vec3(outParams.specularWeight);float f90Scale=1.0; -#else -float f90Scale=clamp(2.0*(ior-1.0),0.0,1.0);outParams.reflectanceF90=vec3(mix(outParams.specularWeight*f90Scale,1.0,outParams.metallic)); -#endif -outParams.dielectricColorF0=vec3(dielectricF0*surfaceReflectivityColor);vec3 metallicColorF0=baseColor.rgb;outParams.colorReflectanceF0=mix(outParams.dielectricColorF0,metallicColorF0,outParams.metallic); -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -vec3 dielectricColorF90=surfaceReflectivityColor*vec3(outParams.specularWeight)*vec3(f90Scale); -#else -vec3 dielectricColorF90=vec3(outParams.specularWeight*f90Scale); -#endif -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -vec3 conductorColorF90=surfaceReflectivityColor; -#else -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -vec3 conductorColorF90=outParams.reflectanceF90; -#else -vec3 conductorColorF90=vec3(1.0); -#endif -#endif -outParams.colorReflectanceF90=mix(dielectricColorF90,conductorColorF90,outParams.metallic); -#else -#ifdef REFLECTIVITY -surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb; -#if DEBUGMODE>0 -outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap; -#endif -#ifdef MICROSURFACEFROMREFLECTIVITYMAP -microSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z; -#else -#ifdef MICROSURFACEAUTOMATIC -microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor); -#endif -#ifdef MICROSURFACEMAP -microSurface*=microSurfaceTexel.r; -#endif -#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE -#endif -#endif -outParams.colorReflectanceF0=surfaceReflectivityColor;outParams.reflectanceF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF90=vec3(1.0); -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -outParams.colorReflectanceF90=surfaceReflectivityColor; -#else -outParams.colorReflectanceF90=vec3(1.0); -#endif -#endif -microSurface=saturate(microSurface);float roughness=1.-microSurface;float diffuseRoughness=baseDiffuseRoughness; -#ifdef BASE_DIFFUSE_ROUGHNESS -diffuseRoughness*=baseDiffuseRoughnessTexture*baseDiffuseRoughnessInfos.y; -#endif -outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.diffuseRoughness=diffuseRoughness;return outParams;} -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=F);const t="pbrBlockAmbientOcclusion",g=`struct ambientOcclusionOutParams -{vec3 ambientOcclusionColor; -#if DEBUGMODE>0 && defined(AMBIENT) -vec3 ambientOcclusionColorMap; -#endif -};ambientOcclusionOutParams ambientOcclusionBlock( -#ifdef AMBIENT -in vec3 ambientOcclusionColorMap_, -in vec4 vAmbientInfos -#endif -) -{ambientOcclusionOutParams outParams;vec3 ambientOcclusionColor=vec3(1.,1.,1.); -#ifdef AMBIENT -vec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y; -#ifdef AMBIENTINGRAYSCALE -ambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r); -#endif -ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z); -#if DEBUGMODE>0 -outParams.ambientOcclusionColorMap=ambientOcclusionColorMap; -#endif -#endif -outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;} -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=g);const c="pbrBlockAlphaFresnel",P=`#ifdef ALPHAFRESNEL -#if defined(ALPHATEST) || defined(ALPHABLEND) -struct alphaFresnelOutParams -{float alpha;}; -#define pbr_inline -alphaFresnelOutParams alphaFresnelBlock( -in vec3 normalW, -in vec3 viewDirectionW, -in float alpha, -in float microSurface -) -{alphaFresnelOutParams outParams;float opacityPerceptual=alpha; -#ifdef LINEARALPHAFRESNEL -float opacity0=opacityPerceptual; -#else -float opacity0=opacityPerceptual*opacityPerceptual; -#endif -float opacity90=fresnelGrazingReflectance(opacity0);vec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x; -#ifdef ALPHATEST -if (outParams.alpha0 && defined(ANISOTROPIC_TEXTURE) -vec3 anisotropyMapData; -#endif -}; -#define pbr_inline -anisotropicOutParams anisotropicBlock( -in vec3 vAnisotropy, -in float roughness, -#ifdef ANISOTROPIC_TEXTURE -in vec3 anisotropyMapData, -#endif -in mat3 TBN, -in vec3 normalW, -in vec3 viewDirectionW -) -{anisotropicOutParams outParams;float anisotropy=vAnisotropy.b;vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.); -#ifdef ANISOTROPIC_TEXTURE -anisotropy*=anisotropyMapData.b; -#if DEBUGMODE>0 -outParams.anisotropyMapData=anisotropyMapData; -#endif -anisotropyMapData.rg=anisotropyMapData.rg*2.0-1.0; -#ifdef ANISOTROPIC_LEGACY -anisotropyDirection.rg*=anisotropyMapData.rg; -#else -anisotropyDirection.xy=mat2(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(anisotropyMapData.rg); -#endif -#endif -mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;} -#endif -`;e.IncludesShadersStore[l]||(e.IncludesShadersStore[l]=U);const d="pbrBlockReflection",b=`#ifdef REFLECTION -struct reflectionOutParams -{vec4 environmentRadiance;vec3 environmentIrradiance; -#ifdef REFLECTIONMAP_3D -vec3 reflectionCoords; -#else -vec2 reflectionCoords; -#endif -#ifdef SS_TRANSLUCENCY -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -vec3 irradianceVector; -#endif -#endif -#endif -}; -#define pbr_inline -void createReflectionCoords( -in vec3 vPositionW, -in vec3 normalW, -#ifdef ANISOTROPIC -in anisotropicOutParams anisotropicOut, -#endif -#ifdef REFLECTIONMAP_3D -out vec3 reflectionCoords -#else -out vec2 reflectionCoords -#endif -) -{ -#ifdef ANISOTROPIC -vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal); -#else -vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW); -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -reflectionCoords=reflectionVector; -#else -reflectionCoords=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0-reflectionCoords.y; -#endif -} -#define pbr_inline -#define inline -void sampleReflectionTexture( -in float alphaG, -in vec3 vReflectionMicrosurfaceInfos, -in vec2 vReflectionInfos, -in vec3 vReflectionColor, -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -in float NdotVUnclamped, -#endif -#ifdef LINEARSPECULARREFLECTION -in float roughness, -#endif -#ifdef REFLECTIONMAP_3D -in samplerCube reflectionSampler, -const vec3 reflectionCoords, -#else -in sampler2D reflectionSampler, -const vec2 reflectionCoords, -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -in samplerCube reflectionSamplerLow, -in samplerCube reflectionSamplerHigh, -#else -in sampler2D reflectionSamplerLow, -in sampler2D reflectionSamplerHigh, -#endif -#endif -#ifdef REALTIME_FILTERING -in vec2 vReflectionFilteringInfo, -#endif -out vec4 environmentRadiance -) -{ -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness); -#else -float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG); -#endif -#ifdef LODBASEDMICROSFURACE -reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z; -#ifdef LODINREFLECTIONALPHA -float automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD); -#else -float requestedReflectionLOD=reflectionLOD; -#endif -#ifdef REALTIME_FILTERING -environmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0); -#else -environmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD); -#endif -#else -float lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix( -sampleReflection(reflectionSamplerHigh,reflectionCoords), -environmentMid, -lodReflectionNormalizedDoubled -);} else {environmentRadiance=mix( -environmentMid, -sampleReflection(reflectionSamplerLow,reflectionCoords), -lodReflectionNormalizedDoubled-1.0 -);} -#endif -#ifdef RGBDREFLECTION -environmentRadiance.rgb=fromRGBD(environmentRadiance); -#endif -#ifdef GAMMAREFLECTION -environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb); -#endif -environmentRadiance.rgb*=vReflectionInfos.x;environmentRadiance.rgb*=vReflectionColor.rgb;} -#define pbr_inline -#define inline -reflectionOutParams reflectionBlock( -in vec3 vPositionW -,in vec3 normalW -,in float alphaG -,in vec3 vReflectionMicrosurfaceInfos -,in vec2 vReflectionInfos -,in vec3 vReflectionColor -#ifdef ANISOTROPIC -,in anisotropicOutParams anisotropicOut -#endif -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,in float NdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,in float roughness -#endif -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSampler -#else -,in sampler2D reflectionSampler -#endif -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,in vec3 vEnvironmentIrradiance -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,in mat4 reflectionMatrix -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,in samplerCube irradianceSampler -#else -,in sampler2D irradianceSampler -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,in vec3 reflectionDominantDirection -#endif -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSamplerLow -,in samplerCube reflectionSamplerHigh -#else -,in sampler2D reflectionSamplerLow -,in sampler2D reflectionSamplerHigh -#endif -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,in sampler2D icdfSampler -#endif -#endif -,in vec3 viewDirectionW -,in float diffuseRoughness -,in vec3 surfaceAlbedo -) -{reflectionOutParams outParams;vec4 environmentRadiance=vec4(0.,0.,0.,0.); -#ifdef REFLECTIONMAP_3D -vec3 reflectionCoords=vec3(0.); -#else -vec2 reflectionCoords=vec2(0.); -#endif -createReflectionCoords( -vPositionW, -normalW, -#ifdef ANISOTROPIC -anisotropicOut, -#endif -reflectionCoords -);sampleReflectionTexture( -alphaG, -vReflectionMicrosurfaceInfos, -vReflectionInfos, -vReflectionColor, -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -NdotVUnclamped, -#endif -#ifdef LINEARSPECULARREFLECTION -roughness, -#endif -#ifdef REFLECTIONMAP_3D -reflectionSampler, -reflectionCoords, -#else -reflectionSampler, -reflectionCoords, -#endif -#ifndef LODBASEDMICROSFURACE -reflectionSamplerLow, -reflectionSamplerHigh, -#endif -#ifdef REALTIME_FILTERING -vReflectionFilteringInfo, -#endif -environmentRadiance -);vec3 environmentIrradiance=vec3(0.,0.,0.); -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -#ifdef ANISOTROPIC -vec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz; -#else -vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz; -#endif -vec3 irradianceView=vec3(reflectionMatrix*vec4(viewDirectionW,0)).xyz; -#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -float NdotV=max(dot(normalW,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness); -#endif -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0; -#endif -#endif -#ifdef USESPHERICALFROMREFLECTIONMAP -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -environmentIrradiance=vEnvironmentIrradiance; -#else -#if defined(REALTIME_FILTERING) -environmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView -#ifdef IBL_CDF_FILTERING -,icdfSampler -#endif -); -#else -environmentIrradiance=computeEnvironmentIrradiance(irradianceVector); -#endif -#ifdef SS_TRANSLUCENCY -outParams.irradianceVector=irradianceVector; -#endif -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -vec4 environmentIrradiance4=sampleReflection(irradianceSampler,irradianceVector); -#else -vec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords); -#endif -environmentIrradiance=environmentIrradiance4.rgb; -#ifdef RGBDREFLECTION -environmentIrradiance.rgb=fromRGBD(environmentIrradiance4); -#endif -#ifdef GAMMAREFLECTION -environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb); -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -vec3 Ls=normalize(reflectionDominantDirection);float NoL=dot(irradianceVector,Ls);float NoV=dot(irradianceVector,irradianceView);vec3 diffuseRoughnessTerm=vec3(1.0); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -float LoV=dot (Ls,irradianceView);float mag=length(reflectionDominantDirection)*2.0;vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0))); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -vec3 H=(irradianceView+Ls)*0.5;float VoH=dot(irradianceView,H);diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -environmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm; -#endif -#endif -environmentIrradiance*=vReflectionColor.rgb*vReflectionInfos.x; -#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE -outParams.environmentRadiance=vec4(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a); -#else -outParams.environmentRadiance=environmentRadiance; -#endif -outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;} -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=b);const s="pbrBlockSheen",y=`#ifdef SHEEN -struct sheenOutParams -{float sheenIntensity;vec3 sheenColor;float sheenRoughness; -#ifdef SHEEN_LINKWITHALBEDO -vec3 surfaceAlbedo; -#endif -#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -float sheenAlbedoScaling; -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -vec3 finalSheenRadianceScaled; -#endif -#if DEBUGMODE>0 -#ifdef SHEEN_TEXTURE -vec4 sheenMapData; -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -vec3 sheenEnvironmentReflectance; -#endif -#endif -}; -#define pbr_inline -#define inline -sheenOutParams sheenBlock( -in vec4 vSheenColor -#ifdef SHEEN_ROUGHNESS -,in float vSheenRoughness -#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -,in vec4 sheenMapRoughnessData -#endif -#endif -,in float roughness -#ifdef SHEEN_TEXTURE -,in vec4 sheenMapData -,in float sheenMapLevel -#endif -,in float reflectance -#ifdef SHEEN_LINKWITHALBEDO -,in vec3 baseColor -,in vec3 surfaceAlbedo -#endif -#ifdef ENVIRONMENTBRDF -,in float NdotV -,in vec3 environmentBrdf -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,in vec2 AARoughnessFactors -,in vec3 vReflectionMicrosurfaceInfos -,in vec2 vReflectionInfos -,in vec3 vReflectionColor -,in vec4 vLightingIntensity -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSampler -,in vec3 reflectionCoords -#else -,in sampler2D reflectionSampler -,in vec2 reflectionCoords -#endif -,in float NdotVUnclamped -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSamplerLow -,in samplerCube reflectionSamplerHigh -#else -,in sampler2D reflectionSamplerLow -,in sampler2D reflectionSamplerHigh -#endif -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -,in float seo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -,in float eho -#endif -#endif -) -{sheenOutParams outParams;float sheenIntensity=vSheenColor.a; -#ifdef SHEEN_TEXTURE -#if DEBUGMODE>0 -outParams.sheenMapData=sheenMapData; -#endif -#endif -#ifdef SHEEN_LINKWITHALBEDO -float sheenFactor=pow5(1.0-sheenIntensity);vec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);float sheenRoughness=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor; -#ifdef SHEEN_TEXTURE -sheenIntensity*=sheenMapData.a; -#endif -#else -vec3 sheenColor=vSheenColor.rgb; -#ifdef SHEEN_TEXTURE -#ifdef SHEEN_GAMMATEXTURE -sheenColor.rgb*=toLinearSpace(sheenMapData.rgb); -#else -sheenColor.rgb*=sheenMapData.rgb; -#endif -sheenColor.rgb*=sheenMapLevel; -#endif -#ifdef SHEEN_ROUGHNESS -float sheenRoughness=vSheenRoughness; -#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE -#if defined(SHEEN_TEXTURE) -sheenRoughness*=sheenMapData.a; -#endif -#elif defined(SHEEN_TEXTURE_ROUGHNESS) -sheenRoughness*=sheenMapRoughnessData.a; -#endif -#else -float sheenRoughness=roughness; -#ifdef SHEEN_TEXTURE -sheenIntensity*=sheenMapData.a; -#endif -#endif -#if !defined(SHEEN_ALBEDOSCALING) -sheenIntensity*=(1.-reflectance); -#endif -sheenColor*=sheenIntensity; -#endif -#ifdef ENVIRONMENTBRDF -/*#ifdef SHEEN_SOFTER -vec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness)); -#else*/ -#ifdef SHEEN_ROUGHNESS -vec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness); -#else -vec3 environmentSheenBrdf=environmentBrdf; -#endif -/*#endif*/ -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -float sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness); -#ifdef SPECULARAA -sheenAlphaG+=AARoughnessFactors.y; -#endif -vec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);sampleReflectionTexture( -sheenAlphaG, -vReflectionMicrosurfaceInfos, -vReflectionInfos, -vReflectionColor, -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -NdotVUnclamped, -#endif -#ifdef LINEARSPECULARREFLECTION -sheenRoughness, -#endif -reflectionSampler, -reflectionCoords, -#ifndef LODBASEDMICROSFURACE -reflectionSamplerLow, -reflectionSamplerHigh, -#endif -#ifdef REALTIME_FILTERING -vReflectionFilteringInfo, -#endif -environmentSheenRadiance -);vec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf); -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -sheenEnvironmentReflectance*=seo; -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -sheenEnvironmentReflectance*=eho; -#endif -#if DEBUGMODE>0 -outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance; -#endif -outParams.finalSheenRadianceScaled= -environmentSheenRadiance.rgb * -sheenEnvironmentReflectance * -vLightingIntensity.z; -#endif -#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b; -#endif -outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;} -#endif -`;e.IncludesShadersStore[s]||(e.IncludesShadersStore[s]=y);const E="pbrBlockClearcoat",B=`struct clearcoatOutParams -{vec3 specularEnvironmentR0;float conservationFactor;vec3 clearCoatNormalW;vec2 clearCoatAARoughnessFactors;float clearCoatIntensity;float clearCoatRoughness; -#ifdef REFLECTION -vec3 finalClearCoatRadianceScaled; -#endif -#ifdef CLEARCOAT_TINT -vec3 absorption;float clearCoatNdotVRefract;vec3 clearCoatColor;float clearCoatThickness; -#endif -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -vec3 energyConservationFactorClearCoat; -#endif -#if DEBUGMODE>0 -#ifdef CLEARCOAT_BUMP -mat3 TBNClearCoat; -#endif -#ifdef CLEARCOAT_TEXTURE -vec2 clearCoatMapData; -#endif -#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -vec4 clearCoatTintMapData; -#endif -#ifdef REFLECTION -vec4 environmentClearCoatRadiance;vec3 clearCoatEnvironmentReflectance; -#endif -float clearCoatNdotV; -#endif -}; -#ifdef CLEARCOAT -#define pbr_inline -#define inline -clearcoatOutParams clearcoatBlock( -in vec3 vPositionW -,in vec3 geometricNormalW -,in vec3 viewDirectionW -,in vec2 vClearCoatParams -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -,in vec4 clearCoatMapRoughnessData -#endif -,in vec3 specularEnvironmentR0 -#ifdef CLEARCOAT_TEXTURE -,in vec2 clearCoatMapData -#endif -#ifdef CLEARCOAT_TINT -,in vec4 vClearCoatTintParams -,in float clearCoatColorAtDistance -,in vec4 vClearCoatRefractionParams -#ifdef CLEARCOAT_TINT_TEXTURE -,in vec4 clearCoatTintMapData -#endif -#endif -#ifdef CLEARCOAT_BUMP -,in vec2 vClearCoatBumpInfos -,in vec4 clearCoatBumpMapData -,in vec2 vClearCoatBumpUV -#if defined(TANGENT) && defined(NORMAL) -,in mat3 vTBN -#else -,in vec2 vClearCoatTangentSpaceParams -#endif -#ifdef OBJECTSPACE_NORMALMAP -,in mat4 normalMatrix -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -,in vec3 faceNormal -#endif -#ifdef REFLECTION -,in vec3 vReflectionMicrosurfaceInfos -,in vec2 vReflectionInfos -,in vec3 vReflectionColor -,in vec4 vLightingIntensity -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSampler -#else -,in sampler2D reflectionSampler -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,in samplerCube reflectionSamplerLow -,in samplerCube reflectionSamplerHigh -#else -,in sampler2D reflectionSamplerLow -,in sampler2D reflectionSamplerHigh -#endif -#endif -#ifdef REALTIME_FILTERING -,in vec2 vReflectionFilteringInfo -#endif -#endif -#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING) -,in float frontFacingMultiplier -#endif -) -{clearcoatOutParams outParams;float clearCoatIntensity=vClearCoatParams.x;float clearCoatRoughness=vClearCoatParams.y; -#ifdef CLEARCOAT_TEXTURE -clearCoatIntensity*=clearCoatMapData.x; -#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE -clearCoatRoughness*=clearCoatMapData.y; -#endif -#if DEBUGMODE>0 -outParams.clearCoatMapData=clearCoatMapData; -#endif -#endif -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -clearCoatRoughness*=clearCoatMapRoughnessData.y; -#endif -outParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness; -#ifdef CLEARCOAT_TINT -vec3 clearCoatColor=vClearCoatTintParams.rgb;float clearCoatThickness=vClearCoatTintParams.a; -#ifdef CLEARCOAT_TINT_TEXTURE -#ifdef CLEARCOAT_TINT_GAMMATEXTURE -clearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb); -#else -clearCoatColor*=clearCoatTintMapData.rgb; -#endif -clearCoatThickness*=clearCoatTintMapData.a; -#if DEBUGMODE>0 -outParams.clearCoatTintMapData=clearCoatTintMapData; -#endif -#endif -outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness; -#endif -#ifdef CLEARCOAT_REMAP_F0 -vec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0); -#else -vec3 specularEnvironmentR0Updated=specularEnvironmentR0; -#endif -outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);vec3 clearCoatNormalW=geometricNormalW; -#ifdef CLEARCOAT_BUMP -#ifdef NORMALXYSCALE -float clearCoatNormalScale=1.0; -#else -float clearCoatNormalScale=vClearCoatBumpInfos.y; -#endif -#if defined(TANGENT) && defined(NORMAL) -mat3 TBNClearCoat=vTBN; -#else -vec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;mat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams); -#endif -#if DEBUGMODE>0 -outParams.TBNClearCoat=TBNClearCoat; -#endif -#ifdef OBJECTSPACE_NORMALMAP -clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW); -#else -clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y); -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier; -#endif -outParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);float clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);float clearCoatNdotV=absEps(clearCoatNdotVUnclamped); -#if DEBUGMODE>0 -outParams.clearCoatNdotV=clearCoatNdotV; -#endif -#ifdef CLEARCOAT_TINT -vec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract)); -#endif -#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION)) -vec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness); -#endif -#if defined(REFLECTION) -float clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness); -#ifdef SPECULARAA -clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y; -#endif -vec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);vec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -clearCoatReflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -vec3 clearCoatReflectionCoords=clearCoatReflectionVector; -#else -vec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -clearCoatReflectionCoords/=clearCoatReflectionVector.z; -#endif -clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y; -#endif -sampleReflectionTexture( -clearCoatAlphaG, -vReflectionMicrosurfaceInfos, -vReflectionInfos, -vReflectionColor, -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -clearCoatNdotVUnclamped, -#endif -#ifdef LINEARSPECULARREFLECTION -clearCoatRoughness, -#endif -reflectionSampler, -clearCoatReflectionCoords, -#ifndef LODBASEDMICROSFURACE -reflectionSamplerLow, -reflectionSamplerHigh, -#endif -#ifdef REALTIME_FILTERING -vReflectionFilteringInfo, -#endif -environmentClearCoatRadiance -); -#if DEBUGMODE>0 -outParams.environmentClearCoatRadiance=environmentClearCoatRadiance; -#endif -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -vec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf); -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -float clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho; -#endif -#endif -#endif -#else -vec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness)); -#endif -clearCoatEnvironmentReflectance*=clearCoatIntensity; -#if DEBUGMODE>0 -outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance; -#endif -outParams.finalClearCoatRadianceScaled= -environmentClearCoatRadiance.rgb * -clearCoatEnvironmentReflectance * -vLightingIntensity.z; -#endif -#if defined(CLEARCOAT_TINT) -outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity); -#endif -float fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat); -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf); -#endif -return outParams;} -#endif -`;e.IncludesShadersStore[E]||(e.IncludesShadersStore[E]=B);const R="pbrBlockIridescence",G=`struct iridescenceOutParams -{float iridescenceIntensity;float iridescenceIOR;float iridescenceThickness;vec3 specularEnvironmentR0;}; -#ifdef IRIDESCENCE -#define pbr_inline -#define inline -iridescenceOutParams iridescenceBlock( -in vec4 vIridescenceParams -,in float viewAngle -,in vec3 specularEnvironmentR0 -#ifdef IRIDESCENCE_TEXTURE -,in vec2 iridescenceMapData -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -,in vec2 iridescenceThicknessMapData -#endif -#ifdef CLEARCOAT -,in float NdotVUnclamped -,in vec2 vClearCoatParams -#ifdef CLEARCOAT_TEXTURE -,in vec2 clearCoatMapData -#endif -#endif -) -{iridescenceOutParams outParams;float iridescenceIntensity=vIridescenceParams.x;float iridescenceIOR=vIridescenceParams.y;float iridescenceThicknessMin=vIridescenceParams.z;float iridescenceThicknessMax=vIridescenceParams.w;float iridescenceThicknessWeight=1.; -#ifdef IRIDESCENCE_TEXTURE -iridescenceIntensity*=iridescenceMapData.x; -#endif -#if defined(IRIDESCENCE_THICKNESS_TEXTURE) -iridescenceThicknessWeight=iridescenceThicknessMapData.g; -#endif -float iridescenceThickness=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);float topIor=1.; -#ifdef CLEARCOAT -float clearCoatIntensity=vClearCoatParams.x; -#ifdef CLEARCOAT_TEXTURE -clearCoatIntensity*=clearCoatMapData.x; -#endif -topIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+square(1.0/topIor)*(square(NdotVUnclamped)-1.0)); -#endif -vec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;} -#endif -`;e.IncludesShadersStore[R]||(e.IncludesShadersStore[R]=G);const C="pbrBlockSubSurface",V=`struct subSurfaceOutParams -{vec3 specularEnvironmentReflectance; -#ifdef SS_REFRACTION -vec3 finalRefraction;vec3 surfaceAlbedo; -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -float alpha; -#endif -float refractionOpacity; -#endif -#ifdef SS_TRANSLUCENCY -vec3 transmittance;float translucencyIntensity; -#ifdef REFLECTION -vec3 refractionIrradiance; -#endif -#endif -#if DEBUGMODE>0 -#ifdef SS_THICKNESSANDMASK_TEXTURE -vec4 thicknessMap; -#endif -#ifdef SS_REFRACTION -vec4 environmentRefraction;vec3 refractionTransmittance; -#endif -#endif -}; -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -#define pbr_inline -#define inline -vec4 sampleEnvironmentRefraction( -in float ior -,in float thickness -,in float refractionLOD -,in vec3 normalW -,in vec3 vPositionW -,in vec3 viewDirectionW -,in mat4 view -,in vec4 vRefractionInfos -,in mat4 refractionMatrix -,in vec4 vRefractionMicrosurfaceInfos -,in float alphaG -#ifdef SS_REFRACTIONMAP_3D -,in samplerCube refractionSampler -#ifndef LODBASEDMICROSFURACE -,in samplerCube refractionSamplerLow -,in samplerCube refractionSamplerHigh -#endif -#else -,in sampler2D refractionSampler -#ifndef LODBASEDMICROSFURACE -,in sampler2D refractionSamplerLow -,in sampler2D refractionSamplerHigh -#endif -#endif -#ifdef ANISOTROPIC -,in anisotropicOutParams anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,in vec2 vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,in vec3 refractionPosition -,in vec3 refractionSize -#endif -) {vec4 environmentRefraction=vec4(0.,0.,0.,0.); -#ifdef ANISOTROPIC -vec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior); -#else -vec3 refractionVector=refract(-viewDirectionW,normalW,ior); -#endif -#ifdef SS_REFRACTIONMAP_OPPOSITEZ -refractionVector.z*=-1.0; -#endif -#ifdef SS_REFRACTIONMAP_3D -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition); -#endif -refractionVector.y=refractionVector.y*vRefractionInfos.w;vec3 refractionCoords=refractionVector;refractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0)); -#else -#ifdef SS_USE_THICKNESS_AS_DEPTH -vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0))); -#else -vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0))); -#endif -vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y; -#endif -#ifdef LODBASEDMICROSFURACE -refractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z; -#ifdef SS_LODINREFRACTIONALPHA -float automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);float requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD); -#else -float requestedRefractionLOD=refractionLOD; -#endif -#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D) -environmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0); -#else -environmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD); -#endif -#else -float lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));float lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;vec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix( -sampleRefraction(refractionSamplerHigh,refractionCoords), -environmentRefractionMid, -lodRefractionNormalizedDoubled -);} else {environmentRefraction=mix( -environmentRefractionMid, -sampleRefraction(refractionSamplerLow,refractionCoords), -lodRefractionNormalizedDoubled-1.0 -);} -#endif -#ifdef SS_RGBDREFRACTION -environmentRefraction.rgb=fromRGBD(environmentRefraction); -#endif -#ifdef SS_GAMMAREFRACTION -environmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb); -#endif -return environmentRefraction;} -#endif -#define pbr_inline -#define inline -subSurfaceOutParams subSurfaceBlock( -in vec3 vSubSurfaceIntensity -,in vec2 vThicknessParam -,in vec4 vTintColor -,in vec3 normalW -,in vec3 vSpecularEnvironmentReflectance -#ifdef SS_THICKNESSANDMASK_TEXTURE -,in vec4 thicknessMap -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -,in vec4 refractionIntensityMap -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -,in vec4 translucencyIntensityMap -#endif -#ifdef REFLECTION -#ifdef SS_TRANSLUCENCY -,in mat4 reflectionMatrix -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -,in vec3 irradianceVector_ -#endif -#if defined(REALTIME_FILTERING) -,in samplerCube reflectionSampler -,in vec2 vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,in sampler2D icdfSampler -#endif -#endif -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,in samplerCube irradianceSampler -#else -,in sampler2D irradianceSampler -#endif -#endif -#endif -#endif -#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY) -,in vec3 surfaceAlbedo -#endif -#ifdef SS_REFRACTION -,in vec3 vPositionW -,in vec3 viewDirectionW -,in mat4 view -,in vec4 vRefractionInfos -,in mat4 refractionMatrix -,in vec4 vRefractionMicrosurfaceInfos -,in vec4 vLightingIntensity -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -,in float alpha -#endif -#ifdef SS_LODINREFRACTIONALPHA -,in float NdotVUnclamped -#endif -#ifdef SS_LINEARSPECULARREFRACTION -,in float roughness -#endif -,in float alphaG -#ifdef SS_REFRACTIONMAP_3D -,in samplerCube refractionSampler -#ifndef LODBASEDMICROSFURACE -,in samplerCube refractionSamplerLow -,in samplerCube refractionSamplerHigh -#endif -#else -,in sampler2D refractionSampler -#ifndef LODBASEDMICROSFURACE -,in sampler2D refractionSamplerLow -,in sampler2D refractionSamplerHigh -#endif -#endif -#ifdef ANISOTROPIC -,in anisotropicOutParams anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,in vec2 vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,in vec3 refractionPosition -,in vec3 refractionSize -#endif -#ifdef SS_DISPERSION -,in float dispersion -#endif -#endif -#ifdef SS_TRANSLUCENCY -,in vec3 vDiffusionDistance -,in vec4 vTranslucencyColor -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -,in vec4 translucencyColorMap -#endif -#endif -) -{subSurfaceOutParams outParams;outParams.specularEnvironmentReflectance=vSpecularEnvironmentReflectance; -#ifdef SS_REFRACTION -float refractionIntensity=vSubSurfaceIntensity.x; -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -refractionIntensity*=(1.0-alpha);outParams.alpha=1.0; -#endif -#endif -#ifdef SS_TRANSLUCENCY -float translucencyIntensity=vSubSurfaceIntensity.y; -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -#ifdef SS_USE_GLTF_TEXTURES -float thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x; -#else -float thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x; -#endif -#if DEBUGMODE>0 -outParams.thicknessMap=thicknessMap; -#endif -#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS) -#ifdef SS_USE_GLTF_TEXTURES -refractionIntensity*=thicknessMap.r; -#else -refractionIntensity*=thicknessMap.g; -#endif -#endif -#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS) -#ifdef SS_USE_GLTF_TEXTURES -translucencyIntensity*=thicknessMap.a; -#else -translucencyIntensity*=thicknessMap.b; -#endif -#endif -#else -float thickness=vThicknessParam.y; -#endif -#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE) -#ifdef SS_USE_GLTF_TEXTURES -refractionIntensity*=refractionIntensityMap.r; -#else -refractionIntensity*=refractionIntensityMap.g; -#endif -#endif -#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE) -#ifdef SS_USE_GLTF_TEXTURES -translucencyIntensity*=translucencyIntensityMap.a; -#else -translucencyIntensity*=translucencyIntensityMap.b; -#endif -#endif -#ifdef SS_TRANSLUCENCY -thickness=maxEps(thickness);vec4 translucencyColor=vTranslucencyColor; -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -translucencyColor*=translucencyColorMap; -#endif -vec3 transmittance=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity; -#endif -#ifdef SS_REFRACTION -vec4 environmentRefraction=vec4(0.,0.,0.,0.); -#ifdef SS_HAS_THICKNESS -float ior=vRefractionInfos.y; -#else -float ior=vRefractionMicrosurfaceInfos.w; -#endif -#ifdef SS_LODINREFRACTIONALPHA -float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped); -#elif defined(SS_LINEARSPECULARREFRACTION) -float refractionRoughness=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness); -#else -float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG); -#endif -float refraction_ior=vRefractionInfos.y; -#ifdef SS_DISPERSION -float realIOR=1.0/refraction_ior;float iorDispersionSpread=0.04*dispersion*(realIOR-1.0);vec3 iors=vec3(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (int i=0; i<3; i++) {refraction_ior=iors[i]; -#endif -vec4 envSample=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG -#ifdef SS_REFRACTIONMAP_3D -,refractionSampler -#ifndef LODBASEDMICROSFURACE -,refractionSamplerLow -,refractionSamplerHigh -#endif -#else -,refractionSampler -#ifndef LODBASEDMICROSFURACE -,refractionSamplerLow -,refractionSamplerHigh -#endif -#endif -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,refractionPosition -,refractionSize -#endif -); -#ifdef SS_DISPERSION -environmentRefraction[i]=envSample[i];} -#else -environmentRefraction=envSample; -#endif -environmentRefraction.rgb*=vRefractionInfos.x; -#endif -#ifdef SS_REFRACTION -vec3 refractionTransmittance=vec3(refractionIntensity); -#ifdef SS_THICKNESSANDMASK_TEXTURE -vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,thickness); -#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY) -float maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);vec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);environmentRefraction.rgb*=volumeAlbedo; -#else -vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y); -#endif -#ifdef SS_ALBEDOFORREFRACTIONTINT -environmentRefraction.rgb*=surfaceAlbedo.rgb; -#endif -outParams.surfaceAlbedo=surfaceAlbedo;outParams.refractionOpacity=1.-refractionIntensity; -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.surfaceAlbedo*=outParams.refractionOpacity; -#endif -#ifdef UNUSED_MULTIPLEBOUNCES -vec3 bounceSpecularEnvironmentReflectance=(2.0*vSpecularEnvironmentReflectance)/(1.0+vSpecularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,vSpecularEnvironmentReflectance,refractionIntensity); -#endif -#if DEBUGMODE>0 -outParams.refractionTransmittance=refractionTransmittance; -#endif -outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;outParams.finalRefraction*=vec3(1.0)-vSpecularEnvironmentReflectance; -#if DEBUGMODE>0 -outParams.environmentRefraction=environmentRefraction; -#endif -#endif -#if defined(REFLECTION) && defined(SS_TRANSLUCENCY) -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP) -vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz; -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0; -#endif -#else -vec3 irradianceVector=irradianceVector_; -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) -#if defined(REALTIME_FILTERING) -vec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo,0.0,surfaceAlbedo,irradianceVector -#ifdef IBL_CDF_FILTERING -,icdfSampler -#endif -); -#else -vec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector); -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -vec3 irradianceCoords=irradianceVector; -#else -vec2 irradianceCoords=irradianceVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -irradianceCoords/=irradianceVector.z; -#endif -irradianceCoords.y=1.0-irradianceCoords.y; -#endif -vec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords); -#ifdef RGBDREFLECTION -refractionIrradiance.rgb=fromRGBD(refractionIrradiance); -#endif -#ifdef GAMMAREFLECTION -refractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb); -#endif -#else -vec4 refractionIrradiance=vec4(0.); -#endif -refractionIrradiance.rgb*=transmittance; -#ifdef SS_ALBEDOFORTRANSLUCENCYTINT -refractionIrradiance.rgb*=surfaceAlbedo.rgb; -#endif -outParams.refractionIrradiance=refractionIrradiance.rgb; -#endif -return outParams;} -#endif -`;e.IncludesShadersStore[C]||(e.IncludesShadersStore[C]=V);const u="pbrBlockReflectance0",H=`float reflectanceF0=reflectivityOut.reflectanceF0;vec3 specularEnvironmentR0=reflectivityOut.colorReflectanceF0;vec3 specularEnvironmentR90=reflectivityOut.colorReflectanceF90; -#ifdef ALPHAFRESNEL -float reflectance90=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90; -#endif -`;e.IncludesShadersStore[u]||(e.IncludesShadersStore[u]=H);const S="pbrClusteredLightingFunctions",x=`#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#include -#define inline -lightingInfo computeClusteredLighting( -sampler2D lightDataTexture, -sampler2D tileMaskTexture, -vec4 lightData, -ivec2 sliceRange, -vec3 V, -vec3 N, -vec3 posW, -vec3 surfaceAlbedo, -reflectivityOutParams reflectivityOut -#ifdef IRIDESCENCE -,float iridescenceIntensity -#endif -#ifdef SS_TRANSLUCENCY -,subSurfaceOutParams subSurfaceOut -#endif -#ifdef SPECULARTERM -,float AARoughnessFactor -#endif -#ifdef ANISOTROPIC -,anisotropicOutParams anisotropicOut -#endif -#ifdef SHEEN -,sheenOutParams sheenOut -#endif -#ifdef CLEARCOAT -,clearcoatOutParams clearcoatOut -#endif -) {float NdotV=absEps(dot(N,V)); -#include -#ifdef CLEARCOAT -specularEnvironmentR0=clearcoatOut.specularEnvironmentR0; -#endif -lightingInfo result;ivec2 tilePosition=ivec2(gl_FragCoord.xy*lightData.xy);int maskHeight=int(lightData.z);tilePosition.y=min(tilePosition.y,maskHeight-1);ivec2 batchRange=sliceRange/CLUSTLIGHT_BATCH;int batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tilePosition.y+=maskHeight*batchRange.x;for (int i=batchRange.x; i<=batchRange.y; i+=1) {uint mask=uint(texelFetch(tileMaskTexture,tilePosition,0).r);tilePosition.y+=maskHeight;int maskOffset=max(sliceRange.x-batchOffset,0);int maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while (mask != 0u) {uint bit=mask & -mask;mask ^= bit;int position=onlyBitPosition(bit);ClusteredLight light=getClusteredLight(lightDataTexture,batchOffset+maskOffset+position);preLightingInfo preInfo=computePointAndSpotPreLightingInfo(light.vLightData,V,N,posW);preInfo.NdotV=NdotV;preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light.vLightFalloff.x,light.vLightFalloff.y);if (light.vLightDirection.w>=0.0) {preInfo.attenuation*=computeDirectionalLightFalloff(light.vLightDirection.xyz,preInfo.L,light.vLightDirection.w,light.vLightData.w,light.vLightFalloff.z,light.vLightFalloff.w);} -preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo; -#ifdef IRIDESCENCE -preInfo.iridescenceIntensity=iridescenceIntensity; -#endif -lightingInfo info; -#ifdef SS_TRANSLUCENCY -#ifdef SS_TRANSLUCENCY_LEGACY -info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0); -#else -info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance); -#endif -#else -info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb); -#endif -#ifdef SPECULARTERM -#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR -vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);vec3 coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic); -#else -vec3 coloredFresnel=fresnelSchlickGGX(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#endif -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -float NdotH=dot(N,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel); -#endif -#ifdef ANISOTROPIC -info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb); -#else -info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb); -#endif -#endif -#ifdef SHEEN -#ifdef SHEEN_LINKWITHALBEDO -preInfo.roughness=sheenOut.sheenIntensity; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance); -#endif -info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb); -#endif -#ifdef CLEARCOAT -preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb); -#ifdef CLEARCOAT_TINT -float absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=absorption; -#endif -#ifdef SPECULARTERM -info.specular*=absorption; -#endif -#endif -info.diffuse*=info.clearCoat.w; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=info.clearCoat.w; -#endif -#ifdef SPECULARTERM -info.specular*=info.clearCoat.w; -#endif -#ifdef SHEEN -info.sheen*=info.clearCoat.w; -#endif -#endif -result.diffuse+=info.diffuse; -#ifdef SS_TRANSLUCENCY -result.diffuseTransmission+=info.diffuseTransmission; -#endif -#ifdef SPECULARTERM -result.specular+=info.specular; -#endif -#ifdef CLEARCOAT -result.clearCoat+=info.clearCoat; -#endif -#ifdef SHEEN -result.sheen+=info.sheen; -#endif -} -batchOffset+=CLUSTLIGHT_BATCH;} -return result;} -#endif -`;e.IncludesShadersStore[S]||(e.IncludesShadersStore[S]=x);const m="pbrBlockNormalFinal",W=`#if defined(FORCENORMALFORWARD) && defined(NORMAL) -vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w; -#if defined(TWOSIDEDLIGHTING) -faceNormal=gl_FrontFacing ? faceNormal : -faceNormal; -#endif -normalW*=sign(dot(normalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -#if defined(MIRRORED) -normalW=gl_FrontFacing ? -normalW : normalW; -#else -normalW=gl_FrontFacing ? normalW : -normalW; -#endif -#endif -`;e.IncludesShadersStore[m]||(e.IncludesShadersStore[m]=W);const A="pbrBlockLightmapInit",Y=`#ifdef LIGHTMAP -vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset); -#ifdef RGBDLIGHTMAP -lightmapColor.rgb=fromRGBD(lightmapColor); -#endif -#ifdef GAMMALIGHTMAP -lightmapColor.rgb=toLinearSpace(lightmapColor.rgb); -#endif -lightmapColor.rgb*=vLightmapInfos.y; -#endif -`;e.IncludesShadersStore[A]||(e.IncludesShadersStore[A]=Y);const I="pbrBlockGeometryInfo",k=`float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz); -#ifdef SPECULARAA -alphaG+=AARoughnessFactors.y; -#endif -#if defined(ENVIRONMENTBRDF) -vec3 environmentBrdf=getBRDFLookup(NdotV,roughness); -#endif -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -#ifdef RADIANCEOCCLUSION -#ifdef AMBIENTINGRAYSCALE -float ambientMonochrome=aoOut.ambientOcclusionColor.r; -#else -float ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor); -#endif -float seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped); -#endif -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -float eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW); -#endif -#endif -#endif -#endif -`;e.IncludesShadersStore[I]||(e.IncludesShadersStore[I]=k);const v="pbrBlockReflectance",X=`#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -vec3 baseSpecularEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(reflectanceF0),reflectivityOut.reflectanceF90,environmentBrdf); -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -vec3 metalEnvironmentReflectance=reflectivityOut.specularWeight*getF82Specular(NdotV,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricEnvironmentReflectance=getReflectanceFromBRDFLookup(reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90,environmentBrdf);vec3 colorSpecularEnvironmentReflectance=mix(dielectricEnvironmentReflectance,metalEnvironmentReflectance,reflectivityOut.metallic); -#else -vec3 colorSpecularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,environmentBrdf); -#endif -#ifdef RADIANCEOCCLUSION -colorSpecularEnvironmentReflectance*=seo; -#endif -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -colorSpecularEnvironmentReflectance*=eho; -#endif -#endif -#endif -#else -vec3 colorSpecularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));vec3 baseSpecularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,vec3(reflectanceF0),reflectivityOut.reflectanceF90,sqrt(microSurface)); -#endif -#ifdef CLEARCOAT -colorSpecularEnvironmentReflectance*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -colorSpecularEnvironmentReflectance*=clearcoatOut.absorption; -#endif -#endif -`;e.IncludesShadersStore[v]||(e.IncludesShadersStore[v]=X);const N="pbrBlockDirectLighting",w=`vec3 diffuseBase=vec3(0.,0.,0.); -#ifdef SS_TRANSLUCENCY -vec3 diffuseTransmissionBase=vec3(0.,0.,0.); -#endif -#ifdef SPECULARTERM -vec3 specularBase=vec3(0.,0.,0.); -#endif -#ifdef CLEARCOAT -vec3 clearCoatBase=vec3(0.,0.,0.); -#endif -#ifdef SHEEN -vec3 sheenBase=vec3(0.,0.,0.); -#endif -#if defined(SPECULARTERM) && defined(LIGHT0) -vec3 coloredFresnel; -#endif -preLightingInfo preInfo;lightingInfo info;float shadow=1.; -float aggShadow=0.;float numLights=0.; -#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT) -vec3 absorption=vec3(0.); -#endif -`;e.IncludesShadersStore[N]||(e.IncludesShadersStore[N]=w);const T="pbrBlockFinalLitComponents",K=`aggShadow=aggShadow/numLights; -#if defined(ENVIRONMENTBRDF) -#ifdef MS_BRDF_ENERGY_CONSERVATION -vec3 baseSpecularEnergyConservationFactor=getEnergyConservationFactor(vec3(reflectanceF0),environmentBrdf);vec3 coloredEnergyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf); -#endif -#endif -#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF) -surfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -#ifndef METALLICWORKFLOW -#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION -surfaceAlbedo.rgb=(1.-reflectanceF0)*surfaceAlbedo.rgb; -#endif -#endif -#endif -#ifdef REFLECTION -vec3 finalIrradiance=reflectionOut.environmentIrradiance; -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -#if defined(METALLICWORKFLOW) || defined(SPECULAR_GLOSSINESS_ENERGY_CONSERVATION) -vec3 baseSpecularEnergy=vec3(baseSpecularEnvironmentReflectance); -#if defined(ENVIRONMENTBRDF) -#ifdef MS_BRDF_ENERGY_CONSERVATION -baseSpecularEnergy*=baseSpecularEnergyConservationFactor; -#endif -#endif -finalIrradiance*=clamp(vec3(1.0)-baseSpecularEnergy,0.0,1.0); -#endif -#endif -#if defined(CLEARCOAT) -finalIrradiance*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -finalIrradiance*=clearcoatOut.absorption; -#endif -#endif -#ifndef SS_APPLY_ALBEDO_AFTER_SUBSURFACE -finalIrradiance*=surfaceAlbedo.rgb; -#endif -#if defined(SS_REFRACTION) -finalIrradiance*=subSurfaceOut.refractionOpacity; -#endif -#if defined(SS_TRANSLUCENCY) -finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance; -#endif -#ifdef SS_APPLY_ALBEDO_AFTER_SUBSURFACE -finalIrradiance*=surfaceAlbedo.rgb; -#endif -finalIrradiance*=vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor; -#endif -#ifdef SPECULARTERM -vec3 finalSpecular=specularBase;finalSpecular=max(finalSpecular,0.0);vec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalSpecularScaled*=coloredEnergyConservationFactor; -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -finalSpecularScaled*=sheenOut.sheenAlbedoScaling; -#endif -#endif -#ifdef REFLECTION -vec3 finalRadiance=reflectionOut.environmentRadiance.rgb;finalRadiance*=colorSpecularEnvironmentReflectance;vec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalRadianceScaled*=coloredEnergyConservationFactor; -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -finalRadianceScaled*=sheenOut.sheenAlbedoScaling; -#endif -#endif -#ifdef SHEEN -vec3 finalSheen=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,0.0);vec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w; -#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF) -sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption; -#endif -#endif -#endif -#ifdef CLEARCOAT -vec3 finalClearCoat=clearCoatBase;finalClearCoat=max(finalClearCoat,0.0);vec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat; -#endif -#ifdef SS_REFRACTION -subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor; -#ifdef CLEARCOAT_TINT -subSurfaceOut.finalRefraction*=clearcoatOut.absorption; -#endif -#endif -#endif -#ifdef ALPHABLEND -float luminanceOverAlpha=0.0; -#if defined(REFLECTION) && defined(RADIANCEOVERALPHA) -luminanceOverAlpha+=getLuminance(finalRadianceScaled); -#if defined(CLEARCOAT) -luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled); -#endif -#endif -#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA) -luminanceOverAlpha+=getLuminance(finalSpecularScaled); -#endif -#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA) -luminanceOverAlpha+=getLuminance(finalClearCoatScaled); -#endif -#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA) -alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha); -#endif -#endif -`;e.IncludesShadersStore[T]||(e.IncludesShadersStore[T]=K);const O="pbrBlockFinalUnlitComponents",z=`vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo; -#if defined(SS_REFRACTION) && !defined(UNLIT) && !defined(LEGACY_SPECULAR_ENERGY_CONSERVATION) -finalDiffuse*=subSurfaceOut.refractionOpacity; -#endif -#if defined(SS_TRANSLUCENCY) && !defined(UNLIT) -finalDiffuse+=diffuseTransmissionBase; -#endif -finalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor; -#ifdef EMISSIVE -vec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb; -#ifdef GAMMAEMISSIVE -finalEmissive*=toLinearSpace(emissiveColorTex.rgb); -#else -finalEmissive*=emissiveColorTex.rgb; -#endif -finalEmissive*= vEmissiveInfos.y; -#endif -finalEmissive*=vLightingIntensity.y; -#ifdef AMBIENT -vec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w); -#else -vec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor; -#endif -finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse; -`;e.IncludesShadersStore[O]||(e.IncludesShadersStore[O]=z);const p="pbrBlockFinalColorComposition",$=`vec4 finalColor=vec4( -#ifndef UNLIT -#ifdef REFLECTION -finalIrradiance + -#endif -#ifdef SPECULARTERM -finalSpecularScaled + -#endif -#ifdef SHEEN -finalSheenScaled + -#endif -#ifdef CLEARCOAT -finalClearCoatScaled + -#endif -#ifdef REFLECTION -finalRadianceScaled + -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) -sheenOut.finalSheenRadianceScaled + -#endif -#ifdef CLEARCOAT -clearcoatOut.finalClearCoatRadianceScaled + -#endif -#endif -#ifdef SS_REFRACTION -subSurfaceOut.finalRefraction + -#endif -#endif -finalAmbient + -finalDiffuse, -alpha); -#ifdef LIGHTMAP -#ifndef LIGHTMAPEXCLUDED -#ifdef USELIGHTMAPASSHADOWMAP -finalColor.rgb*=lightmapColor.rgb; -#else -finalColor.rgb+=lightmapColor.rgb; -#endif -#endif -#endif -finalColor.rgb+=finalEmissive; -#define CUSTOM_FRAGMENT_BEFORE_FOG -finalColor=max(finalColor,0.0); -`;e.IncludesShadersStore[p]||(e.IncludesShadersStore[p]=$);const i="pbrPixelShader",L=`#define PBR_FRAGMENT_SHADER -#define CUSTOM_FRAGMENT_EXTENSION -#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) -#extension GL_OES_standard_derivatives : enable -#endif -#ifdef LODBASEDMICROSFURACE -#extension GL_EXT_shader_texture_lod : enable -#endif -#define CUSTOM_FRAGMENT_BEGIN -#ifdef LOGARITHMICDEPTH -#extension GL_EXT_frag_depth : enable -#endif -#if SCENE_MRT_COUNT>0 -#include[SCENE_MRT_COUNT] -#endif -precision highp float; -#include -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE -#endif -#include<__decl__pbrFragment> -#include -#include<__decl__lightFragment>[0..maxSimultaneousLights] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef REFLECTION -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main(void) { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -#include -#include -#include -albedoOpacityOutParams albedoOpacityOut; -#ifdef ALBEDO -vec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset); -#endif -#ifdef BASE_WEIGHT -vec4 baseWeightTexture=texture2D(baseWeightSampler,vBaseWeightUV+uvOffset); -#endif -#ifdef OPACITY -vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset); -#endif -#ifdef DECAL -vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset); -#endif -albedoOpacityOut=albedoOpacityBlock( -vAlbedoColor -#ifdef ALBEDO -,albedoTexture -,vAlbedoInfos -#endif -,baseWeight -#ifdef BASE_WEIGHT -,baseWeightTexture -,vBaseWeightInfos -#endif -#ifdef OPACITY -,opacityMap -,vOpacityInfos -#endif -#ifdef DETAIL -,detailColor -,vDetailInfos -#endif -#ifdef DECAL -,decalColor -,vDecalInfos -#endif -);vec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;float alpha=albedoOpacityOut.alpha; -#define CUSTOM_FRAGMENT_UPDATE_ALPHA -#include -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -ambientOcclusionOutParams aoOut; -#ifdef AMBIENT -vec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb; -#endif -aoOut=ambientOcclusionBlock( -#ifdef AMBIENT -ambientOcclusionColorMap, -vAmbientInfos -#endif -); -#include -#ifdef UNLIT -vec3 diffuseBase=vec3(1.,1.,1.); -#else -vec3 baseColor=surfaceAlbedo;reflectivityOutParams reflectivityOut; -#if defined(REFLECTIVITY) -vec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);vec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap; -#ifndef METALLICWORKFLOW -#ifdef REFLECTIVITY_GAMMA -surfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap); -#endif -surfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y; -#endif -#endif -#if defined(MICROSURFACEMAP) -vec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y; -#endif -#ifdef METALLICWORKFLOW -vec4 metallicReflectanceFactors=vMetallicReflectanceFactors; -#ifdef REFLECTANCE -vec4 reflectanceFactorsMap=texture2D(reflectanceSampler,vReflectanceUV+uvOffset); -#ifdef REFLECTANCE_GAMMA -reflectanceFactorsMap=toLinearSpace(reflectanceFactorsMap); -#endif -metallicReflectanceFactors.rgb*=reflectanceFactorsMap.rgb; -#endif -#ifdef METALLIC_REFLECTANCE -vec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset); -#ifdef METALLIC_REFLECTANCE_GAMMA -metallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap); -#endif -#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY -metallicReflectanceFactors.rgb*=metallicReflectanceFactorsMap.rgb; -#endif -metallicReflectanceFactors.a*=metallicReflectanceFactorsMap.a; -#endif -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -float baseDiffuseRoughnessTexture=texture2D(baseDiffuseRoughnessSampler,vBaseDiffuseRoughnessUV+uvOffset).r; -#endif -reflectivityOut=reflectivityBlock( -vReflectivityColor -#ifdef METALLICWORKFLOW -,surfaceAlbedo -,metallicReflectanceFactors -#endif -,baseDiffuseRoughness -#ifdef BASE_DIFFUSE_ROUGHNESS -,baseDiffuseRoughnessTexture -,vBaseDiffuseRoughnessInfos -#endif -#ifdef REFLECTIVITY -,vReflectivityInfos -,surfaceMetallicOrReflectivityColorMap -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -,aoOut.ambientOcclusionColor -#endif -#ifdef MICROSURFACEMAP -,microSurfaceTexel -#endif -#ifdef DETAIL -,detailColor -,vDetailInfos -#endif -);float microSurface=reflectivityOut.microSurface;float roughness=reflectivityOut.roughness;float diffuseRoughness=reflectivityOut.diffuseRoughness; -#ifdef METALLICWORKFLOW -surfaceAlbedo=reflectivityOut.surfaceAlbedo; -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor; -#endif -#ifdef ALPHAFRESNEL -#if defined(ALPHATEST) || defined(ALPHABLEND) -alphaFresnelOutParams alphaFresnelOut;alphaFresnelOut=alphaFresnelBlock( -normalW, -viewDirectionW, -alpha, -microSurface -);alpha=alphaFresnelOut.alpha; -#endif -#endif -#include -#ifdef ANISOTROPIC -anisotropicOutParams anisotropicOut; -#ifdef ANISOTROPIC_TEXTURE -vec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y; -#endif -anisotropicOut=anisotropicBlock( -vAnisotropy, -roughness, -#ifdef ANISOTROPIC_TEXTURE -anisotropyMapData, -#endif -TBN, -normalW, -viewDirectionW -); -#endif -#ifdef REFLECTION -reflectionOutParams reflectionOut; -#ifndef USE_CUSTOM_REFLECTION -reflectionOut=reflectionBlock( -vPositionW -,normalW -,alphaG -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,roughness -#endif -,reflectionSampler -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,vEnvironmentIrradiance -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,reflectionMatrix -#endif -#ifdef USEIRRADIANCEMAP -,irradianceSampler -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,vReflectionDominantDirection -#endif -#endif -#ifndef LODBASEDMICROSFURACE -,reflectionSamplerLow -,reflectionSamplerHigh -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,icdfSampler -#endif -#endif -,viewDirectionW -,diffuseRoughness -,baseColor -); -#else -#define CUSTOM_REFLECTION -#endif -#endif -#include -#ifdef SHEEN -sheenOutParams sheenOut; -#ifdef SHEEN_TEXTURE -vec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset); -#endif -#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -vec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w; -#endif -sheenOut=sheenBlock( -vSheenColor -#ifdef SHEEN_ROUGHNESS -,vSheenRoughness -#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -,sheenMapRoughnessData -#endif -#endif -,roughness -#ifdef SHEEN_TEXTURE -,sheenMapData -,vSheenInfos.y -#endif -,reflectanceF0 -#ifdef SHEEN_LINKWITHALBEDO -,baseColor -,surfaceAlbedo -#endif -#ifdef ENVIRONMENTBRDF -,NdotV -,environmentBrdf -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,AARoughnessFactors -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -,vLightingIntensity -,reflectionSampler -,reflectionOut.reflectionCoords -,NdotVUnclamped -#ifndef LODBASEDMICROSFURACE -,reflectionSamplerLow -,reflectionSamplerHigh -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -,seo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -,eho -#endif -#endif -); -#ifdef SHEEN_LINKWITHALBEDO -surfaceAlbedo=sheenOut.surfaceAlbedo; -#endif -#endif -#ifdef CLEARCOAT -#ifdef CLEARCOAT_TEXTURE -vec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y; -#endif -#endif -#ifdef IRIDESCENCE -iridescenceOutParams iridescenceOut; -#ifdef IRIDESCENCE_TEXTURE -vec2 iridescenceMapData=texture2D(iridescenceSampler,vIridescenceUV+uvOffset).rg*vIridescenceInfos.y; -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -vec2 iridescenceThicknessMapData=texture2D(iridescenceThicknessSampler,vIridescenceThicknessUV+uvOffset).rg*vIridescenceInfos.w; -#endif -iridescenceOut=iridescenceBlock( -vIridescenceParams -,NdotV -,specularEnvironmentR0 -#ifdef IRIDESCENCE_TEXTURE -,iridescenceMapData -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -,iridescenceThicknessMapData -#endif -#ifdef CLEARCOAT -,NdotVUnclamped -,vClearCoatParams -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData -#endif -#endif -);float iridescenceIntensity=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0; -#endif -clearcoatOutParams clearcoatOut; -#ifdef CLEARCOAT -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -vec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w; -#endif -#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -vec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset); -#endif -#ifdef CLEARCOAT_BUMP -vec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset); -#endif -clearcoatOut=clearcoatBlock( -vPositionW -,geometricNormalW -,viewDirectionW -,vClearCoatParams -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -,clearCoatMapRoughnessData -#endif -,specularEnvironmentR0 -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData -#endif -#ifdef CLEARCOAT_TINT -,vClearCoatTintParams -,clearCoatColorAtDistance -,vClearCoatRefractionParams -#ifdef CLEARCOAT_TINT_TEXTURE -,clearCoatTintMapData -#endif -#endif -#ifdef CLEARCOAT_BUMP -,vClearCoatBumpInfos -,clearCoatBumpMapData -,vClearCoatBumpUV -#if defined(TANGENT) && defined(NORMAL) -,vTBN -#else -,vClearCoatTangentSpaceParams -#endif -#ifdef OBJECTSPACE_NORMALMAP -,normalMatrix -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -,faceNormal -#endif -#ifdef REFLECTION -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -,vLightingIntensity -,reflectionSampler -#ifndef LODBASEDMICROSFURACE -,reflectionSamplerLow -,reflectionSamplerHigh -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -#endif -#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING) -,(gl_FrontFacing ? 1. : -1.) -#endif -); -#else -clearcoatOut.specularEnvironmentR0=specularEnvironmentR0; -#endif -#include -subSurfaceOutParams subSurfaceOut; -#ifdef SUBSURFACE -#ifdef SS_THICKNESSANDMASK_TEXTURE -vec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset); -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -vec4 refractionIntensityMap=texture2D(refractionIntensitySampler,vRefractionIntensityUV+uvOffset); -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -vec4 translucencyIntensityMap=texture2D(translucencyIntensitySampler,vTranslucencyIntensityUV+uvOffset); -#endif -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -vec4 translucencyColorMap=texture2D(translucencyColorSampler,vTranslucencyColorUV+uvOffset); -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA -translucencyColorMap=toLinearSpace(translucencyColorMap); -#endif -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -vec3 vSpecularEnvironmentReflectance=vec3(max(colorSpecularEnvironmentReflectance.r,max(colorSpecularEnvironmentReflectance.g,colorSpecularEnvironmentReflectance.b))); -#endif -subSurfaceOut=subSurfaceBlock( -vSubSurfaceIntensity -,vThicknessParam -,vTintColor -,normalW -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -,vSpecularEnvironmentReflectance -#else -,baseSpecularEnvironmentReflectance -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -,thicknessMap -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -,refractionIntensityMap -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -,translucencyIntensityMap -#endif -#ifdef REFLECTION -#ifdef SS_TRANSLUCENCY -,reflectionMatrix -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -,reflectionOut.irradianceVector -#endif -#if defined(REALTIME_FILTERING) -,reflectionSampler -,vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,icdfSampler -#endif -#endif -#endif -#ifdef USEIRRADIANCEMAP -,irradianceSampler -#endif -#endif -#endif -#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY) -,surfaceAlbedo -#endif -#ifdef SS_REFRACTION -,vPositionW -,viewDirectionW -,view -,vRefractionInfos -,refractionMatrix -,vRefractionMicrosurfaceInfos -,vLightingIntensity -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -,alpha -#endif -#ifdef SS_LODINREFRACTIONALPHA -,NdotVUnclamped -#endif -#ifdef SS_LINEARSPECULARREFRACTION -,roughness -#endif -,alphaG -,refractionSampler -#ifndef LODBASEDMICROSFURACE -,refractionSamplerLow -,refractionSamplerHigh -#endif -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,vRefractionPosition -,vRefractionSize -#endif -#ifdef SS_DISPERSION -,dispersion -#endif -#endif -#ifdef SS_TRANSLUCENCY -,vDiffusionDistance -,vTranslucencyColor -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -,translucencyColorMap -#endif -#endif -); -#ifdef SS_REFRACTION -surfaceAlbedo=subSurfaceOut.surfaceAlbedo; -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -alpha=subSurfaceOut.alpha; -#endif -#endif -#else -subSurfaceOut.specularEnvironmentReflectance=colorSpecularEnvironmentReflectance; -#endif -#include -#include[0..maxSimultaneousLights] -#include -#endif -#include -#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION -#include -#include -#include(color,finalColor) -#include -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#include -#endif -#if !defined(PREPASS) || defined(WEBGL2) -gl_FragColor=finalColor; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);} else {backColor+=finalColor;} -#endif -#include -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=L);const ue={name:i,shader:L};export{ue as pbrPixelShader}; diff --git a/assets/pbr.fragment-kuqG-mSe.js b/assets/pbr.fragment-kuqG-mSe.js deleted file mode 100644 index 11bfb4ff96e1662278d6404cf133af2c98797965..0000000000000000000000000000000000000000 --- a/assets/pbr.fragment-kuqG-mSe.js +++ /dev/null @@ -1,2480 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./oitFragment-CXBNy3dk.js";import"./pbrUboDeclaration-Cq2mqEav.js";import"./pbrDebug-C5bjipRB.js";import"./shadowsFragmentFunctions-CHKo52s6.js";import"./samplerFragmentDeclaration-Bn5G_87U.js";import"./imageProcessingFunctions-DMSN1d-p.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./fogFragment-DjadYfQv.js";import"./helperFunctions-Wgh3PIP0.js";import"./hdrFilteringFunctions-BDy1DXPD.js";import"./harmonicsFunctions-B8ViGQkZ.js";import"./pbrBRDFFunctions-BKKbkltP.js";import"./bumpFragment-DEyymZuF.js";import"./decalFragment-zjU901jg.js";import"./lightFragment-Jwj6l9Y8.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";const i="samplerFragmentAlternateDeclaration",O=`#ifdef _DEFINENAME_ -#if _DEFINENAME_DIRECTUV==1 -#define v_VARYINGNAME_UV vMainUV1 -#elif _DEFINENAME_DIRECTUV==2 -#define v_VARYINGNAME_UV vMainUV2 -#elif _DEFINENAME_DIRECTUV==3 -#define v_VARYINGNAME_UV vMainUV3 -#elif _DEFINENAME_DIRECTUV==4 -#define v_VARYINGNAME_UV vMainUV4 -#elif _DEFINENAME_DIRECTUV==5 -#define v_VARYINGNAME_UV vMainUV5 -#elif _DEFINENAME_DIRECTUV==6 -#define v_VARYINGNAME_UV vMainUV6 -#else -varying v_VARYINGNAME_UV: vec2f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=O);const r="pbrFragmentSamplersDeclaration",T=`#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness) -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) -var clearCoatRoughnessSamplerSampler: sampler;var clearCoatRoughnessSampler: texture_2d; -#endif -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness) -#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) -var sheenRoughnessSamplerSampler: sampler;var sheenRoughnessSampler: texture_2d; -#endif -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy) -#endif -#ifdef REFLECTION -#ifdef REFLECTIONMAP_3D -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube; -#ifdef LODBASEDMICROSFURACE -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube; -#endif -#ifdef USEIRRADIANCEMAP -var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube; -#endif -#else -var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d; -#ifdef LODBASEDMICROSFURACE -#else -var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d; -#endif -#ifdef USEIRRADIANCEMAP -var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d; -#endif -#endif -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#else -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#endif -#endif -#ifdef ENVIRONMENTBRDF -var environmentBrdfSamplerSampler: sampler;var environmentBrdfSampler: texture_2d; -#endif -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -#ifdef SS_REFRACTIONMAP_3D -var refractionSamplerSampler: sampler;var refractionSampler: texture_cube; -#ifdef LODBASEDMICROSFURACE -#else -var refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_cube;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_cube; -#endif -#else -var refractionSamplerSampler: sampler;var refractionSampler: texture_2d; -#ifdef LODBASEDMICROSFURACE -#else -var refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_2d;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_2d; -#endif -#endif -#endif -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor) -#endif -#ifdef IBL_CDF_FILTERING -var icdfSamplerSampler: sampler;var icdfSampler: texture_2d; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=T);const n="pbrBlockAlbedoOpacity",L=`struct albedoOpacityOutParams -{surfaceAlbedo: vec3f, -alpha: f32}; -#define pbr_inline -fn albedoOpacityBlock( -vAlbedoColor: vec4f -#ifdef ALBEDO -,albedoTexture: vec4f -,albedoInfos: vec2f -#endif -,baseWeight: f32 -#ifdef BASE_WEIGHT -,baseWeightTexture: vec4f -,vBaseWeightInfos: vec2f -#endif -#ifdef OPACITY -,opacityMap: vec4f -,vOpacityInfos: vec2f -#endif -#ifdef DETAIL -,detailColor: vec4f -,vDetailInfos: vec4f -#endif -#ifdef DECAL -,decalColor: vec4f -,vDecalInfos: vec4f -#endif -)->albedoOpacityOutParams -{var outParams: albedoOpacityOutParams;var surfaceAlbedo: vec3f=vAlbedoColor.rgb;var alpha: f32=vAlbedoColor.a; -#ifdef ALBEDO -#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST) -alpha*=albedoTexture.a; -#endif -#ifdef GAMMAALBEDO -surfaceAlbedo*=toLinearSpaceVec3(albedoTexture.rgb); -#else -surfaceAlbedo*=albedoTexture.rgb; -#endif -surfaceAlbedo*=albedoInfos.y; -#endif -#ifndef DECAL_AFTER_DETAIL -#include -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -surfaceAlbedo*=fragmentInputs.vColor.rgb; -#endif -#ifdef DETAIL -var detailAlbedo: f32=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; -#endif -#ifdef DECAL_AFTER_DETAIL -#include -#endif -#define CUSTOM_FRAGMENT_UPDATE_ALBEDO -surfaceAlbedo*=baseWeight; -#ifdef BASE_WEIGHT -surfaceAlbedo*=baseWeightTexture.r; -#endif -#ifdef OPACITY -#ifdef OPACITYRGB -alpha=getLuminance(opacityMap.rgb); -#else -alpha*=opacityMap.a; -#endif -alpha*=vOpacityInfos.y; -#endif -#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) -alpha*=fragmentInputs.vColor.a; -#endif -#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL) -#ifdef ALPHATEST -#if DEBUGMODE != 88 -if (alpha0 -#ifdef METALLICWORKFLOW -#ifdef REFLECTIVITY -surfaceMetallicColorMap: vec4f, -#endif -metallicF0: vec3f, -#else -#ifdef REFLECTIVITY -surfaceReflectivityColorMap: vec4f, -#endif -#endif -#endif -}; -#define pbr_inline -fn reflectivityBlock( -reflectivityColor: vec4f -#ifdef METALLICWORKFLOW -,surfaceAlbedo: vec3f -,metallicReflectanceFactors: vec4f -#endif -,baseDiffuseRoughness: f32 -#ifdef BASE_DIFFUSE_ROUGHNESS -,baseDiffuseRoughnessTexture: f32 -,baseDiffuseRoughnessInfos: vec2f -#endif -#ifdef REFLECTIVITY -,reflectivityInfos: vec3f -,surfaceMetallicOrReflectivityColorMap: vec4f -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -,ambientOcclusionColorIn: vec3f -#endif -#ifdef MICROSURFACEMAP -,microSurfaceTexel: vec4f -#endif -#ifdef DETAIL -,detailColor: vec4f -,vDetailInfos: vec4f -#endif -)->reflectivityOutParams -{var outParams: reflectivityOutParams;var microSurface: f32=reflectivityColor.a;var surfaceReflectivityColor: vec3f=reflectivityColor.rgb; -#ifdef METALLICWORKFLOW -var metallicRoughness: vec2f=surfaceReflectivityColor.rg;var ior: f32=surfaceReflectivityColor.b; -#ifdef REFLECTIVITY -#if DEBUGMODE>0 -outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap; -#endif -#ifdef AOSTOREINMETALMAPRED -var aoStoreInMetalMap: vec3f= vec3f(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z); -#endif -#ifdef METALLNESSSTOREINMETALMAPBLUE -metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b; -#else -metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r; -#endif -#ifdef ROUGHNESSSTOREINMETALMAPALPHA -metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a; -#else -#ifdef ROUGHNESSSTOREINMETALMAPGREEN -metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g; -#endif -#endif -#endif -#ifdef DETAIL -var detailRoughness: f32=mix(0.5,detailColor.b,vDetailInfos.w);var loLerp: f32=mix(0.,metallicRoughness.g,detailRoughness*2.);var hiLerp: f32=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5)); -#endif -#ifdef MICROSURFACEMAP -metallicRoughness.g*=microSurfaceTexel.r; -#endif -#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS -microSurface=1.0-metallicRoughness.g;var baseColor: vec3f=surfaceAlbedo;outParams.metallic=metallicRoughness.r;outParams.specularWeight=metallicReflectanceFactors.a;var dielectricF0 : f32=reflectivityColor.a*outParams.specularWeight;surfaceReflectivityColor=metallicReflectanceFactors.rgb; -#if DEBUGMODE>0 -outParams.metallicF0=dielectricF0*surfaceReflectivityColor; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.surfaceAlbedo=baseColor.rgb*(vec3f(1.0)-vec3f(dielectricF0)*surfaceReflectivityColor)*(1.0-outParams.metallic); -#else -outParams.surfaceAlbedo=baseColor.rgb; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -{let reflectivityColor: vec3f=mix(dielectricF0*surfaceReflectivityColor,baseColor.rgb,outParams.metallic);outParams.reflectanceF0=max(reflectivityColor.r,max(reflectivityColor.g,reflectivityColor.b));} -#else -#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF -let maxF0: f32=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF0=mix(dielectricF0*maxF0,1.0f,outParams.metallic); -#else -outParams.reflectanceF0=mix(dielectricF0,1.0,outParams.metallic); -#endif -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.reflectanceF90=vec3(outParams.specularWeight);var f90Scale: f32=1.0; -#else -var f90Scale: f32=clamp(2.0*(ior-1.0),0.0,1.0);outParams.reflectanceF90=vec3(mix( -outParams.specularWeight*f90Scale,1.0,outParams.metallic)); -#endif -outParams.dielectricColorF0=vec3f(dielectricF0*surfaceReflectivityColor);var metallicColorF0: vec3f=baseColor.rgb;outParams.colorReflectanceF0=mix(outParams.dielectricColorF0,metallicColorF0,outParams.metallic); -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -let dielectricColorF90 -: vec3f=surfaceReflectivityColor * -vec3f(outParams.specularWeight*f90Scale); -#else -let dielectricColorF90 -: vec3f=vec3f(outParams.specularWeight*f90Scale); -#endif -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -let conductorColorF90: vec3f=surfaceReflectivityColor; -#else -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -let conductorColorF90: vec3f=outParams.reflectanceF90; -#else -let conductorColorF90: vec3f=vec3f(1.0f); -#endif -#endif -outParams.colorReflectanceF90=mix(dielectricColorF90,conductorColorF90,outParams.metallic); -#else -#ifdef REFLECTIVITY -surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb; -#if DEBUGMODE>0 -outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap; -#endif -#ifdef MICROSURFACEFROMREFLECTIVITYMAP -microSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z; -#else -#ifdef MICROSURFACEAUTOMATIC -microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor); -#endif -#ifdef MICROSURFACEMAP -microSurface*=microSurfaceTexel.r; -#endif -#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE -#endif -#endif -outParams.colorReflectanceF0=surfaceReflectivityColor;outParams.reflectanceF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF90=vec3f(1.0); -#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR) -outParams.colorReflectanceF90=surfaceReflectivityColor; -#else -outParams.colorReflectanceF90=vec3(1.0); -#endif -#endif -microSurface=saturate(microSurface);var roughness: f32=1.-microSurface;var diffuseRoughness: f32=baseDiffuseRoughness; -#ifdef BASE_DIFFUSE_ROUGHNESS -diffuseRoughness*=baseDiffuseRoughnessTexture*baseDiffuseRoughnessInfos.y; -#endif -outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.diffuseRoughness=diffuseRoughness;return outParams;} -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=_);const o="pbrBlockAmbientOcclusion",M=`struct ambientOcclusionOutParams -{ambientOcclusionColor: vec3f, -#if DEBUGMODE>0 && defined(AMBIENT) -ambientOcclusionColorMap: vec3f -#endif -}; -#define pbr_inline -fn ambientOcclusionBlock( -#ifdef AMBIENT -ambientOcclusionColorMap_: vec3f, -vAmbientInfos: vec4f -#endif -)->ambientOcclusionOutParams -{ -var outParams: ambientOcclusionOutParams;var ambientOcclusionColor: vec3f= vec3f(1.,1.,1.); -#ifdef AMBIENT -var ambientOcclusionColorMap: vec3f=ambientOcclusionColorMap_*vAmbientInfos.y; -#ifdef AMBIENTINGRAYSCALE -ambientOcclusionColorMap= vec3f(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r); -#endif -ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z); -#if DEBUGMODE>0 -outParams.ambientOcclusionColorMap=ambientOcclusionColorMap; -#endif -#endif -outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;} -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=M);const t="pbrBlockAlphaFresnel",F=`#ifdef ALPHAFRESNEL -#if defined(ALPHATEST) || defined(ALPHABLEND) -struct alphaFresnelOutParams -{alpha: f32};fn faceforward(N: vec3,I: vec3,Nref: vec3)->vec3 {return select(N,-N,dot(Nref,I)>0.0);} -#define pbr_inline -fn alphaFresnelBlock( -normalW: vec3f, -viewDirectionW: vec3f, -alpha: f32, -microSurface: f32 -)->alphaFresnelOutParams -{var outParams: alphaFresnelOutParams;var opacityPerceptual: f32=alpha; -#ifdef LINEARALPHAFRESNEL -var opacity0: f32=opacityPerceptual; -#else -var opacity0: f32=opacityPerceptual*opacityPerceptual; -#endif -var opacity90: f32=fresnelGrazingReflectance(opacity0);var normalForward: vec3f=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)), vec3f(opacity0), vec3f(opacity90),sqrt(microSurface)).x; -#ifdef ALPHATEST -if (outParams.alpha0 && defined(ANISOTROPIC_TEXTURE) -anisotropyMapData: vec3f -#endif -}; -#define pbr_inline -fn anisotropicBlock( -vAnisotropy: vec3f, -roughness: f32, -#ifdef ANISOTROPIC_TEXTURE -anisotropyMapData: vec3f, -#endif -TBN: mat3x3f, -normalW: vec3f, -viewDirectionW: vec3f -)->anisotropicOutParams -{ -var outParams: anisotropicOutParams;var anisotropy: f32=vAnisotropy.b;var anisotropyDirection: vec3f= vec3f(vAnisotropy.xy,0.); -#ifdef ANISOTROPIC_TEXTURE -var amd=anisotropyMapData.rg;anisotropy*=anisotropyMapData.b; -#if DEBUGMODE>0 -outParams.anisotropyMapData=anisotropyMapData; -#endif -amd=amd*2.0-1.0; -#ifdef ANISOTROPIC_LEGACY -anisotropyDirection=vec3f(anisotropyDirection.xy*amd,anisotropyDirection.z); -#else -anisotropyDirection=vec3f(mat2x2f(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(amd),anisotropyDirection.z); -#endif -#endif -var anisoTBN: mat3x3f= mat3x3f(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));var anisotropicTangent: vec3f=normalize(anisoTBN*anisotropyDirection);var anisotropicBitangent: vec3f=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[c]||(e.IncludesShadersStoreWGSL[c]=D);const l="pbrBlockReflection",h=`#ifdef REFLECTION -struct reflectionOutParams -{environmentRadiance: vec4f -,environmentIrradiance: vec3f -#ifdef REFLECTIONMAP_3D -,reflectionCoords: vec3f -#else -,reflectionCoords: vec2f -#endif -#ifdef SS_TRANSLUCENCY -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -,irradianceVector: vec3f -#endif -#endif -#endif -}; -#define pbr_inline -#ifdef REFLECTIONMAP_3D -fn createReflectionCoords( -vPositionW: vec3f, -normalW: vec3f, -#ifdef ANISOTROPIC -anisotropicOut: anisotropicOutParams, -#endif -)->vec3f -{var reflectionCoords: vec3f; -#else -fn createReflectionCoords( -vPositionW: vec3f, -normalW: vec3f, -#ifdef ANISOTROPIC -anisotropicOut: anisotropicOutParams, -#endif -)->vec2f -{ -var reflectionCoords: vec2f; -#endif -#ifdef ANISOTROPIC -var reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),anisotropicOut.anisotropicNormal); -#else -var reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),normalW); -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -reflectionCoords=reflectionVector; -#else -reflectionCoords=reflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -reflectionCoords/=reflectionVector.z; -#endif -reflectionCoords.y=1.0-reflectionCoords.y; -#endif -return reflectionCoords;} -#define pbr_inline -fn sampleReflectionTexture( -alphaG: f32 -,vReflectionMicrosurfaceInfos: vec3f -,vReflectionInfos: vec2f -,vReflectionColor: vec3f -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped: f32 -#endif -#ifdef LINEARSPECULARREFLECTION -,roughness: f32 -#endif -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -,reflectionCoords: vec3f -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -,reflectionCoords: vec2f -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,reflectionLowSampler: texture_cube -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_cube -,reflectionHighSamplerSampler: sampler -#else -,reflectionLowSampler: texture_2d -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_2d -,reflectionHighSamplerSampler: sampler -#endif -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo: vec2f -#endif -)->vec4f -{var environmentRadiance: vec4f; -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -var reflectionLOD: f32=getLodFromAlphaGNdotV(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped); -#elif defined(LINEARSPECULARREFLECTION) -var reflectionLOD: f32=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness); -#else -var reflectionLOD: f32=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG); -#endif -#ifdef LODBASEDMICROSFURACE -reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z; -#ifdef LODINREFLECTIONALPHA -var automaticReflectionLOD: f32=UNPACK_LOD(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords).a);var requestedReflectionLOD: f32=max(automaticReflectionLOD,reflectionLOD); -#else -var requestedReflectionLOD: f32=reflectionLOD; -#endif -#ifdef REALTIME_FILTERING -environmentRadiance= vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,vReflectionFilteringInfo),1.0); -#else -environmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD); -#endif -#else -var lodReflectionNormalized: f32=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var environmentMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix( -textureSample(reflectionHighSampler,reflectionHighSamplerSampler,reflectionCoords), -environmentMid, -lodReflectionNormalizedDoubled -);} else {environmentRadiance=mix( -environmentMid, -textureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords), -lodReflectionNormalizedDoubled-1.0 -);} -#endif -var envRadiance=environmentRadiance.rgb; -#ifdef RGBDREFLECTION -envRadiance=fromRGBD(environmentRadiance); -#endif -#ifdef GAMMAREFLECTION -envRadiance=toLinearSpaceVec3(environmentRadiance.rgb); -#endif -envRadiance*=vReflectionInfos.x;envRadiance*=vReflectionColor.rgb;return vec4f(envRadiance,environmentRadiance.a);} -#define pbr_inline -fn reflectionBlock( -vPositionW: vec3f -,normalW: vec3f -,alphaG: f32 -,vReflectionMicrosurfaceInfos: vec3f -,vReflectionInfos: vec2f -,vReflectionColor: vec3f -#ifdef ANISOTROPIC -,anisotropicOut: anisotropicOutParams -#endif -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped: f32 -#endif -#ifdef LINEARSPECULARREFLECTION -,roughness: f32 -#endif -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -#endif -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,vEnvironmentIrradiance: vec3f -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,reflectionMatrix: mat4x4f -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,irradianceSampler: texture_cube -,irradianceSamplerSampler: sampler -#else -,irradianceSampler: texture_2d -,irradianceSamplerSampler: sampler -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,reflectionDominantDirection: vec3f -#endif -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,reflectionLowSampler: texture_cube -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_cube -,reflectionHighSamplerSampler: sampler -#else -,reflectionLowSampler: texture_2d -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_2d -,reflectionHighSamplerSampler: sampler -#endif -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo: vec2f -#ifdef IBL_CDF_FILTERING -,icdfSampler: texture_2d -,icdfSamplerSampler: sampler -#endif -#endif -,viewDirectionW: vec3f -,diffuseRoughness: f32 -,surfaceAlbedo: vec3f -)->reflectionOutParams -{var outParams: reflectionOutParams;var environmentRadiance: vec4f= vec4f(0.,0.,0.,0.); -#ifdef REFLECTIONMAP_3D -var reflectionCoords: vec3f= vec3f(0.); -#else -var reflectionCoords: vec2f= vec2f(0.); -#endif -reflectionCoords=createReflectionCoords( -vPositionW, -normalW, -#ifdef ANISOTROPIC -anisotropicOut, -#endif -);environmentRadiance=sampleReflectionTexture( -alphaG -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,roughness -#endif -#ifdef REFLECTIONMAP_3D -,reflectionSampler -,reflectionSamplerSampler -,reflectionCoords -#else -,reflectionSampler -,reflectionSamplerSampler -,reflectionCoords -#endif -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -);var environmentIrradiance: vec3f= vec3f(0.,0.,0.); -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -#ifdef ANISOTROPIC -var irradianceVector: vec3f= (reflectionMatrix* vec4f(anisotropicOut.anisotropicNormal,0)).xyz; -#else -var irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz; -#endif -var irradianceView: vec3f= (reflectionMatrix* vec4f(viewDirectionW,0)).xyz; -#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -var NdotV: f32=max(dot(normalW,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness); -#endif -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0; -#endif -#endif -#ifdef USESPHERICALFROMREFLECTIONMAP -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -environmentIrradiance=vEnvironmentIrradiance; -#else -#if defined(REALTIME_FILTERING) -environmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView -#ifdef IBL_CDF_FILTERING -,icdfSampler -,icdfSamplerSampler -#endif -); -#else -environmentIrradiance=computeEnvironmentIrradiance(irradianceVector); -#endif -#ifdef SS_TRANSLUCENCY -outParams.irradianceVector=irradianceVector; -#endif -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -var environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,irradianceVector); -#else -var environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords); -#endif -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -var Ls: vec3f=normalize(reflectionDominantDirection);var NoL: f32=dot(irradianceVector,Ls);var NoV: f32=dot(irradianceVector,irradianceView);var diffuseRoughnessTerm: vec3f=vec3f(1.0); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -var LoV: f32=dot(Ls,irradianceView);var mag: f32=length(reflectionDominantDirection)*2.0f;var clampedAlbedo: vec3f=clamp(surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3f(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0f))); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -var H: vec3f=(irradianceView+Ls)*0.5f;var VoH: f32=dot(irradianceView,H);diffuseRoughnessTerm=vec3f(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI); -#endif -environmentIrradiance=environmentIrradiance4.rgb*diffuseRoughnessTerm; -#else -environmentIrradiance=environmentIrradiance4.rgb; -#endif -#ifdef RGBDREFLECTION -environmentIrradiance=fromRGBD(environmentIrradiance4); -#endif -#ifdef GAMMAREFLECTION -environmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb); -#endif -#endif -environmentIrradiance*=vReflectionColor.rgb*vReflectionInfos.x; -#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE -outParams.environmentRadiance=vec4f(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a); -#else -outParams.environmentRadiance=environmentRadiance; -#endif -outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[l]||(e.IncludesShadersStoreWGSL[l]=h);const d="pbrBlockSheen",g=`#ifdef SHEEN -struct sheenOutParams -{sheenIntensity: f32 -,sheenColor: vec3f -,sheenRoughness: f32 -#ifdef SHEEN_LINKWITHALBEDO -,surfaceAlbedo: vec3f -#endif -#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -,sheenAlbedoScaling: f32 -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,finalSheenRadianceScaled: vec3f -#endif -#if DEBUGMODE>0 -#ifdef SHEEN_TEXTURE -,sheenMapData: vec4f -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,sheenEnvironmentReflectance: vec3f -#endif -#endif -}; -#define pbr_inline -fn sheenBlock( -vSheenColor: vec4f -#ifdef SHEEN_ROUGHNESS -,vSheenRoughness: f32 -#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -,sheenMapRoughnessData: vec4f -#endif -#endif -,roughness: f32 -#ifdef SHEEN_TEXTURE -,sheenMapData: vec4f -,sheenMapLevel: f32 -#endif -,reflectance: f32 -#ifdef SHEEN_LINKWITHALBEDO -,baseColor: vec3f -,surfaceAlbedo: vec3f -#endif -#ifdef ENVIRONMENTBRDF -,NdotV: f32 -,environmentBrdf: vec3f -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,AARoughnessFactors: vec2f -,vReflectionMicrosurfaceInfos: vec3f -,vReflectionInfos: vec2f -,vReflectionColor: vec3f -,vLightingIntensity: vec4f -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -,reflectionCoords: vec3f -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -,reflectionCoords: vec2f -#endif -,NdotVUnclamped: f32 -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,reflectionLowSampler: texture_cube -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_cube -,reflectionHighSamplerSampler: sampler -#else -,reflectionLowSampler: texture_2d -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_2d -,reflectionHighSamplerSampler: sampler -#endif -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo: vec2f -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -,seo: f32 -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -,eho: f32 -#endif -#endif -)->sheenOutParams -{var outParams: sheenOutParams;var sheenIntensity: f32=vSheenColor.a; -#ifdef SHEEN_TEXTURE -#if DEBUGMODE>0 -outParams.sheenMapData=sheenMapData; -#endif -#endif -#ifdef SHEEN_LINKWITHALBEDO -var sheenFactor: f32=pow5(1.0-sheenIntensity);var sheenColor: vec3f=baseColor.rgb*(1.0-sheenFactor);var sheenRoughness: f32=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor; -#ifdef SHEEN_TEXTURE -sheenIntensity*=sheenMapData.a; -#endif -#else -var sheenColor: vec3f=vSheenColor.rgb; -#ifdef SHEEN_TEXTURE -#ifdef SHEEN_GAMMATEXTURE -sheenColor*=toLinearSpaceVec3(sheenMapData.rgb); -#else -sheenColor*=sheenMapData.rgb; -#endif -sheenColor*=sheenMapLevel; -#endif -#ifdef SHEEN_ROUGHNESS -var sheenRoughness: f32=vSheenRoughness; -#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE -#if defined(SHEEN_TEXTURE) -sheenRoughness*=sheenMapData.a; -#endif -#elif defined(SHEEN_TEXTURE_ROUGHNESS) -sheenRoughness*=sheenMapRoughnessData.a; -#endif -#else -var sheenRoughness: f32=roughness; -#ifdef SHEEN_TEXTURE -sheenIntensity*=sheenMapData.a; -#endif -#endif -#if !defined(SHEEN_ALBEDOSCALING) -sheenIntensity*=(1.-reflectance); -#endif -sheenColor*=sheenIntensity; -#endif -#ifdef ENVIRONMENTBRDF -/*#ifdef SHEEN_SOFTER -var environmentSheenBrdf: vec3f= vec3f(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness)); -#else*/ -#ifdef SHEEN_ROUGHNESS -var environmentSheenBrdf: vec3f=getBRDFLookup(NdotV,sheenRoughness); -#else -var environmentSheenBrdf: vec3f=environmentBrdf; -#endif -/*#endif*/ -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -var sheenAlphaG: f32=convertRoughnessToAverageSlope(sheenRoughness); -#ifdef SPECULARAA -sheenAlphaG+=AARoughnessFactors.y; -#endif -var environmentSheenRadiance: vec4f= vec4f(0.,0.,0.,0.);environmentSheenRadiance=sampleReflectionTexture( -sheenAlphaG -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,sheenRoughness -#endif -,reflectionSampler -,reflectionSamplerSampler -,reflectionCoords -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -);var sheenEnvironmentReflectance: vec3f=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf); -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -sheenEnvironmentReflectance*=seo; -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -sheenEnvironmentReflectance*=eho; -#endif -#if DEBUGMODE>0 -outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance; -#endif -outParams.finalSheenRadianceScaled= -environmentSheenRadiance.rgb * -sheenEnvironmentReflectance * -vLightingIntensity.z; -#endif -#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b; -#endif -outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=g);const s="pbrBlockClearcoat",P=`struct clearcoatOutParams -{specularEnvironmentR0: vec3f, -conservationFactor: f32, -clearCoatNormalW: vec3f, -clearCoatAARoughnessFactors: vec2f, -clearCoatIntensity: f32, -clearCoatRoughness: f32, -#ifdef REFLECTION -finalClearCoatRadianceScaled: vec3f, -#endif -#ifdef CLEARCOAT_TINT -absorption: vec3f, -clearCoatNdotVRefract: f32, -clearCoatColor: vec3f, -clearCoatThickness: f32, -#endif -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -energyConservationFactorClearCoat: vec3f, -#endif -#if DEBUGMODE>0 -#ifdef CLEARCOAT_BUMP -TBNClearCoat: mat3x3f, -#endif -#ifdef CLEARCOAT_TEXTURE -clearCoatMapData: vec2f, -#endif -#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -clearCoatTintMapData: vec4f, -#endif -#ifdef REFLECTION -environmentClearCoatRadiance: vec4f, -clearCoatEnvironmentReflectance: vec3f, -#endif -clearCoatNdotV: f32 -#endif -}; -#ifdef CLEARCOAT -#define pbr_inline -fn clearcoatBlock( -vPositionW: vec3f -,geometricNormalW: vec3f -,viewDirectionW: vec3f -,vClearCoatParams: vec2f -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -,clearCoatMapRoughnessData: vec4f -#endif -,specularEnvironmentR0: vec3f -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData: vec2f -#endif -#ifdef CLEARCOAT_TINT -,vClearCoatTintParams: vec4f -,clearCoatColorAtDistance: f32 -,vClearCoatRefractionParams: vec4f -#ifdef CLEARCOAT_TINT_TEXTURE -,clearCoatTintMapData: vec4f -#endif -#endif -#ifdef CLEARCOAT_BUMP -,vClearCoatBumpInfos: vec2f -,clearCoatBumpMapData: vec4f -,vClearCoatBumpUV: vec2f -#if defined(TANGENT) && defined(NORMAL) -,vTBN: mat3x3f -#else -,vClearCoatTangentSpaceParams: vec2f -#endif -#ifdef OBJECTSPACE_NORMALMAP -,normalMatrix: mat4x4f -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -,faceNormal: vec3f -#endif -#ifdef REFLECTION -,vReflectionMicrosurfaceInfos: vec3f -,vReflectionInfos: vec2f -,vReflectionColor: vec3f -,vLightingIntensity: vec4f -#ifdef REFLECTIONMAP_3D -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -#else -,reflectionSampler: texture_2d -,reflectionSamplerSampler: sampler -#endif -#ifndef LODBASEDMICROSFURACE -#ifdef REFLECTIONMAP_3D -,reflectionLowSampler: texture_cube -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_cube -,reflectionHighSamplerSampler: sampler -#else -,reflectionLowSampler: texture_2d -,reflectionLowSamplerSampler: sampler -,reflectionHighSampler: texture_2d -,reflectionHighSamplerSampler: sampler -#endif -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo: vec2f -#endif -#endif -#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING) -,frontFacingMultiplier: f32 -#endif -)->clearcoatOutParams -{var outParams: clearcoatOutParams;var clearCoatIntensity: f32=vClearCoatParams.x;var clearCoatRoughness: f32=vClearCoatParams.y; -#ifdef CLEARCOAT_TEXTURE -clearCoatIntensity*=clearCoatMapData.x; -#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE -clearCoatRoughness*=clearCoatMapData.y; -#endif -#if DEBUGMODE>0 -outParams.clearCoatMapData=clearCoatMapData; -#endif -#endif -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -clearCoatRoughness*=clearCoatMapRoughnessData.y; -#endif -outParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness; -#ifdef CLEARCOAT_TINT -var clearCoatColor: vec3f=vClearCoatTintParams.rgb;var clearCoatThickness: f32=vClearCoatTintParams.a; -#ifdef CLEARCOAT_TINT_TEXTURE -#ifdef CLEARCOAT_TINT_GAMMATEXTURE -clearCoatColor*=toLinearSpaceVec3(clearCoatTintMapData.rgb); -#else -clearCoatColor*=clearCoatTintMapData.rgb; -#endif -clearCoatThickness*=clearCoatTintMapData.a; -#if DEBUGMODE>0 -outParams.clearCoatTintMapData=clearCoatTintMapData; -#endif -#endif -outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness; -#endif -#ifdef CLEARCOAT_REMAP_F0 -var specularEnvironmentR0Updated: vec3f=getR0RemappedForClearCoat(specularEnvironmentR0); -#else -var specularEnvironmentR0Updated: vec3f=specularEnvironmentR0; -#endif -outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);var clearCoatNormalW: vec3f=geometricNormalW; -#ifdef CLEARCOAT_BUMP -#ifdef NORMALXYSCALE -var clearCoatNormalScale: f32=1.0; -#else -var clearCoatNormalScale: f32=vClearCoatBumpInfos.y; -#endif -#if defined(TANGENT) && defined(NORMAL) -var TBNClearCoat: mat3x3f=vTBN; -#else -var TBNClearCoatUV: vec2f=vClearCoatBumpUV*frontFacingMultiplier;var TBNClearCoat: mat3x3f=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams); -#endif -#if DEBUGMODE>0 -outParams.TBNClearCoat=TBNClearCoat; -#endif -#ifdef OBJECTSPACE_NORMALMAP -clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize( mat3x3f(normalMatrix[0].xyz,normalMatrix[1].xyz,normalMatrix[2].xyz)*clearCoatNormalW); -#else -clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y); -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier; -#endif -outParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);var clearCoatNdotVUnclamped: f32=dot(clearCoatNormalW,viewDirectionW);var clearCoatNdotV: f32=absEps(clearCoatNdotVUnclamped); -#if DEBUGMODE>0 -outParams.clearCoatNdotV=clearCoatNdotV; -#endif -#ifdef CLEARCOAT_TINT -var clearCoatVRefract: vec3f=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract)); -#endif -#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION)) -var environmentClearCoatBrdf: vec3f=getBRDFLookup(clearCoatNdotV,clearCoatRoughness); -#endif -#if defined(REFLECTION) -var clearCoatAlphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness); -#ifdef SPECULARAA -clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y; -#endif -var environmentClearCoatRadiance: vec4f= vec4f(0.,0.,0.,0.);var clearCoatReflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),clearCoatNormalW); -#ifdef REFLECTIONMAP_OPPOSITEZ -clearCoatReflectionVector.z*=-1.0; -#endif -#ifdef REFLECTIONMAP_3D -var clearCoatReflectionCoords: vec3f=clearCoatReflectionVector; -#else -var clearCoatReflectionCoords: vec2f=clearCoatReflectionVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -clearCoatReflectionCoords/=clearCoatReflectionVector.z; -#endif -clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y; -#endif -environmentClearCoatRadiance=sampleReflectionTexture( -clearCoatAlphaG -,vReflectionMicrosurfaceInfos -,vReflectionInfos -,vReflectionColor -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,clearCoatNdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,clearCoatRoughness -#endif -,reflectionSampler -,reflectionSamplerSampler -,clearCoatReflectionCoords -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,vReflectionFilteringInfo -#endif -); -#if DEBUGMODE>0 -outParams.environmentClearCoatRadiance=environmentClearCoatRadiance; -#endif -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -var clearCoatEnvironmentReflectance: vec3f=getReflectanceFromBRDFLookup(vec3f(uniforms.vClearCoatRefractionParams.x),environmentClearCoatBrdf); -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -var clearCoatEho: f32=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho; -#endif -#endif -#endif -#else -var clearCoatEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV, vec3f(1.), vec3f(1.),sqrt(1.-clearCoatRoughness)); -#endif -clearCoatEnvironmentReflectance*=clearCoatIntensity; -#if DEBUGMODE>0 -outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance; -#endif -outParams.finalClearCoatRadianceScaled= -environmentClearCoatRadiance.rgb * -clearCoatEnvironmentReflectance * -vLightingIntensity.z; -#endif -#if defined(CLEARCOAT_TINT) -outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity); -#endif -var fresnelIBLClearCoat: f32=fresnelSchlickGGX(clearCoatNdotV,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat); -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf); -#endif -return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=P);const E="pbrBlockIridescence",U=`struct iridescenceOutParams -{iridescenceIntensity: f32, -iridescenceIOR: f32, -iridescenceThickness: f32, -specularEnvironmentR0: vec3f}; -#ifdef IRIDESCENCE -fn iridescenceBlock( -vIridescenceParams: vec4f -,viewAngle_: f32 -,specularEnvironmentR0: vec3f -#ifdef IRIDESCENCE_TEXTURE -,iridescenceMapData: vec2f -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -,iridescenceThicknessMapData: vec2f -#endif -#ifdef CLEARCOAT -,NdotVUnclamped: f32 -,vClearCoatParams: vec2f -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData: vec2f -#endif -#endif -)->iridescenceOutParams -{var outParams: iridescenceOutParams;var iridescenceIntensity: f32=vIridescenceParams.x;var iridescenceIOR: f32=vIridescenceParams.y;var iridescenceThicknessMin: f32=vIridescenceParams.z;var iridescenceThicknessMax: f32=vIridescenceParams.w;var iridescenceThicknessWeight: f32=1.;var viewAngle=viewAngle_; -#ifdef IRIDESCENCE_TEXTURE -iridescenceIntensity*=iridescenceMapData.x; -#endif -#if defined(IRIDESCENCE_THICKNESS_TEXTURE) -iridescenceThicknessWeight=iridescenceThicknessMapData.g; -#endif -var iridescenceThickness: f32=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);var topIor: f32=1.; -#ifdef CLEARCOAT -var clearCoatIntensity: f32=vClearCoatParams.x; -#ifdef CLEARCOAT_TEXTURE -clearCoatIntensity*=clearCoatMapData.x; -#endif -topIor=mix(1.0,uniforms.vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+((1.0/topIor)*(1.0/topIor))*((NdotVUnclamped*NdotVUnclamped)-1.0)); -#endif -var iridescenceFresnel: vec3f=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[E]||(e.IncludesShadersStoreWGSL[E]=U);const R="pbrBlockSubSurface",b=`struct subSurfaceOutParams -{specularEnvironmentReflectance: vec3f, -#ifdef SS_REFRACTION -finalRefraction: vec3f, -surfaceAlbedo: vec3f, -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -alpha: f32, -#endif -refractionOpacity: f32, -#endif -#ifdef SS_TRANSLUCENCY -transmittance: vec3f, -translucencyIntensity: f32, -#ifdef REFLECTION -refractionIrradiance: vec3f, -#endif -#endif -#if DEBUGMODE>0 -#ifdef SS_THICKNESSANDMASK_TEXTURE -thicknessMap: vec4f, -#endif -#ifdef SS_REFRACTION -environmentRefraction: vec4f, -refractionTransmittance: vec3f -#endif -#endif -}; -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -#define pbr_inline -fn sampleEnvironmentRefraction( -ior: f32 -,thickness: f32 -,refractionLOD: f32 -,normalW: vec3f -,vPositionW: vec3f -,viewDirectionW: vec3f -,view: mat4x4f -,vRefractionInfos: vec4f -,refractionMatrix: mat4x4f -,vRefractionMicrosurfaceInfos: vec4f -,alphaG: f32 -#ifdef SS_REFRACTIONMAP_3D -,refractionSampler: texture_cube -,refractionSamplerSampler: sampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler: texture_cube -,refractionLowSamplerSampler: sampler -,refractionHighSampler: texture_cube -,refractionHighSamplerSampler: sampler -#endif -#else -,refractionSampler: texture_2d -,refractionSamplerSampler: sampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler: texture_2d -,refractionLowSamplerSampler: sampler -,refractionHighSampler: texture_2d -,refractionHighSamplerSampler: sampler -#endif -#endif -#ifdef ANISOTROPIC -,anisotropicOut: anisotropicOutParams -#endif -#ifdef REALTIME_FILTERING -,vRefractionFilteringInfo: vec2f -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,refractionPosition: vec3f -,refractionSize: vec3f -#endif -)->vec4f {var environmentRefraction: vec4f= vec4f(0.,0.,0.,0.); -#ifdef ANISOTROPIC -var refractionVector: vec3f=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior); -#else -var refractionVector: vec3f=refract(-viewDirectionW,normalW,ior); -#endif -#ifdef SS_REFRACTIONMAP_OPPOSITEZ -refractionVector.z*=-1.0; -#endif -#ifdef SS_REFRACTIONMAP_3D -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition); -#endif -refractionVector.y=refractionVector.y*vRefractionInfos.w;var refractionCoords: vec3f=refractionVector;refractionCoords= (refractionMatrix* vec4f(refractionCoords,0)).xyz; -#else -#ifdef SS_USE_THICKNESS_AS_DEPTH -var vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*thickness,1.0))).xyz; -#else -var vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*vRefractionInfos.z,1.0))).xyz; -#endif -var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y; -#endif -#ifdef LODBASEDMICROSFURACE -var lod=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z; -#ifdef SS_LODINREFRACTIONALPHA -var automaticRefractionLOD: f32=UNPACK_LOD(textureSample(refractionSampler,refractionSamplerSampler,refractionCoords).a);var requestedRefractionLOD: f32=max(automaticRefractionLOD,lod); -#else -var requestedRefractionLOD: f32=lod; -#endif -#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D) -environmentRefraction= vec4f(radiance(alphaG,refractionSampler,refractionSamplerSampler,refractionCoords,vRefractionFilteringInfo),1.0); -#else -environmentRefraction=textureSampleLevel(refractionSampler,refractionSamplerSampler,refractionCoords,requestedRefractionLOD); -#endif -#else -var lodRefractionNormalized: f32=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));var lodRefractionNormalizedDoubled: f32=lodRefractionNormalized*2.0;var environmentRefractionMid: vec4f=textureSample(refractionSampler,refractionSamplerSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix( -textureSample(refractionHighSampler,refractionHighSamplerSampler,refractionCoords), -environmentRefractionMid, -lodRefractionNormalizedDoubled -);} else {environmentRefraction=mix( -environmentRefractionMid, -textureSample(refractionLowSampler,refractionLowSamplerSampler,refractionCoords), -lodRefractionNormalizedDoubled-1.0 -);} -#endif -var refraction=environmentRefraction.rgb; -#ifdef SS_RGBDREFRACTION -refraction=fromRGBD(environmentRefraction); -#endif -#ifdef SS_GAMMAREFRACTION -refraction=toLinearSpaceVec3(environmentRefraction.rgb); -#endif -return vec4f(refraction,environmentRefraction.a);} -#endif -#define pbr_inline -fn subSurfaceBlock( -vSubSurfaceIntensity: vec3f -,vThicknessParam: vec2f -,vTintColor: vec4f -,normalW: vec3f -,specularEnvironmentReflectance: vec3f -#ifdef SS_THICKNESSANDMASK_TEXTURE -,thicknessMap: vec4f -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -,refractionIntensityMap: vec4f -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -,translucencyIntensityMap: vec4f -#endif -#ifdef REFLECTION -#ifdef SS_TRANSLUCENCY -,reflectionMatrix: mat4x4f -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -,irradianceVector_: vec3f -#endif -#if defined(REALTIME_FILTERING) -,reflectionSampler: texture_cube -,reflectionSamplerSampler: sampler -,vReflectionFilteringInfo: vec2f -#ifdef IBL_CDF_FILTERING -,icdfSampler: texture_2d -,icdfSamplerSampler: sampler -#endif -#endif -#endif -#ifdef USEIRRADIANCEMAP -#ifdef REFLECTIONMAP_3D -,irradianceSampler: texture_cube -,irradianceSamplerSampler: sampler -#else -,irradianceSampler: texture_2d -,irradianceSamplerSampler: sampler -#endif -#endif -#endif -#endif -#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY) -,surfaceAlbedo: vec3f -#endif -#ifdef SS_REFRACTION -,vPositionW: vec3f -,viewDirectionW: vec3f -,view: mat4x4f -,vRefractionInfos: vec4f -,refractionMatrix: mat4x4f -,vRefractionMicrosurfaceInfos: vec4f -,vLightingIntensity: vec4f -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -,alpha: f32 -#endif -#ifdef SS_LODINREFRACTIONALPHA -,NdotVUnclamped: f32 -#endif -#ifdef SS_LINEARSPECULARREFRACTION -,roughness: f32 -#endif -,alphaG: f32 -#ifdef SS_REFRACTIONMAP_3D -,refractionSampler: texture_cube -,refractionSamplerSampler: sampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler: texture_cube -,refractionLowSamplerSampler: sampler -,refractionHighSampler: texture_cube -,refractionHighSamplerSampler: sampler -#endif -#else -,refractionSampler: texture_2d -,refractionSamplerSampler: sampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler: texture_2d -,refractionLowSamplerSampler: sampler -,refractionHighSampler: texture_2d -,refractionHighSamplerSampler: sampler -#endif -#endif -#ifdef ANISOTROPIC -,anisotropicOut: anisotropicOutParams -#endif -#ifdef REALTIME_FILTERING -,vRefractionFilteringInfo: vec2f -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,refractionPosition: vec3f -,refractionSize: vec3f -#endif -#ifdef SS_DISPERSION -,dispersion: f32 -#endif -#endif -#ifdef SS_TRANSLUCENCY -,vDiffusionDistance: vec3f -,vTranslucencyColor: vec4f -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -,translucencyColorMap: vec4f -#endif -#endif -)->subSurfaceOutParams -{var outParams: subSurfaceOutParams;outParams.specularEnvironmentReflectance=specularEnvironmentReflectance; -#ifdef SS_REFRACTION -var refractionIntensity: f32=vSubSurfaceIntensity.x; -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -refractionIntensity*=(1.0-alpha);outParams.alpha=1.0; -#endif -#endif -#ifdef SS_TRANSLUCENCY -var translucencyIntensity: f32=vSubSurfaceIntensity.y; -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -#ifdef SS_USE_GLTF_TEXTURES -var thickness: f32=thicknessMap.g*vThicknessParam.y+vThicknessParam.x; -#else -var thickness: f32=thicknessMap.r*vThicknessParam.y+vThicknessParam.x; -#endif -#if DEBUGMODE>0 -outParams.thicknessMap=thicknessMap; -#endif -#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS) -#ifdef SS_USE_GLTF_TEXTURES -refractionIntensity*=thicknessMap.r; -#else -refractionIntensity*=thicknessMap.g; -#endif -#endif -#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS) -#ifdef SS_USE_GLTF_TEXTURES -translucencyIntensity*=thicknessMap.a; -#else -translucencyIntensity*=thicknessMap.b; -#endif -#endif -#else -var thickness: f32=vThicknessParam.y; -#endif -#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE) -#ifdef SS_USE_GLTF_TEXTURES -refractionIntensity*=refractionIntensityMap.r; -#else -refractionIntensity*=refractionIntensityMap.g; -#endif -#endif -#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE) -#ifdef SS_USE_GLTF_TEXTURES -translucencyIntensity*=translucencyIntensityMap.a; -#else -translucencyIntensity*=translucencyIntensityMap.b; -#endif -#endif -#ifdef SS_TRANSLUCENCY -thickness=maxEps(thickness);var translucencyColor: vec4f=vTranslucencyColor; -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -translucencyColor*=translucencyColorMap; -#endif -var transmittance: vec3f=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity; -#endif -#ifdef SS_REFRACTION -var environmentRefraction: vec4f= vec4f(0.,0.,0.,0.); -#ifdef SS_HAS_THICKNESS -var ior: f32=vRefractionInfos.y; -#else -var ior: f32=vRefractionMicrosurfaceInfos.w; -#endif -#ifdef SS_LODINREFRACTIONALPHA -var refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaGNdotV(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped); -#elif defined(SS_LINEARSPECULARREFRACTION) -var refractionRoughness: f32=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness); -#else -var refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG); -#endif -var refraction_ior: f32=vRefractionInfos.y; -#ifdef SS_DISPERSION -var realIOR: f32=1.0/refraction_ior;var iorDispersionSpread: f32=0.04*dispersion*(realIOR-1.0);var iors: vec3f= vec3f(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (var i: i32=0; i<3; i++) {refraction_ior=iors[i]; -#endif -var envSample: vec4f=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG -#ifdef SS_REFRACTIONMAP_3D -,refractionSampler -,refractionSamplerSampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler -,refractionLowSamplerSampler -,refractionHighSampler -,refractionHighSamplerSampler -#endif -#else -,refractionSampler -,refractionSamplerSampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler -,refractionLowSamplerSampler -,refractionHighSampler -,refractionHighSamplerSampler -#endif -#endif -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,refractionPosition -,refractionSize -#endif -); -#ifdef SS_DISPERSION -environmentRefraction[i]=envSample[i];} -#else -environmentRefraction=envSample; -#endif -environmentRefraction=vec4f(environmentRefraction.rgb*vRefractionInfos.x,environmentRefraction.a); -#endif -#ifdef SS_REFRACTION -var refractionTransmittance: vec3f= vec3f(refractionIntensity); -#ifdef SS_THICKNESSANDMASK_TEXTURE -var volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,thickness); -#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY) -var maxChannel: f32=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);var volumeAlbedo: vec3f=saturateVec3(maxChannel*surfaceAlbedo);environmentRefraction=vec4f(environmentRefraction.rgb*volumeAlbedo,environmentRefraction.a); -#else -var volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,vThicknessParam.y); -#endif -#ifdef SS_ALBEDOFORREFRACTIONTINT -environmentRefraction=vec4f(environmentRefraction.rgb*surfaceAlbedo.rgb,environmentRefraction.a); -#endif -outParams.surfaceAlbedo=surfaceAlbedo;outParams.refractionOpacity=1.-refractionIntensity; -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -outParams.surfaceAlbedo*=outParams.refractionOpacity; -#endif -#ifdef UNUSED_MULTIPLEBOUNCES -var bounceSpecularEnvironmentReflectance: vec3f=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity); -#endif -#if DEBUGMODE>0 -outParams.refractionTransmittance=refractionTransmittance; -#endif -outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;outParams.finalRefraction*=vec3f(1.0)-specularEnvironmentReflectance; -#if DEBUGMODE>0 -outParams.environmentRefraction=environmentRefraction; -#endif -#endif -#if defined(REFLECTION) && defined(SS_TRANSLUCENCY) -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP) -var irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz; -#ifdef REFLECTIONMAP_OPPOSITEZ -irradianceVector.z*=-1.0; -#endif -#ifdef INVERTCUBICMAP -irradianceVector.y*=-1.0; -#endif -#else -var irradianceVector: vec3f=irradianceVector_; -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) -#if defined(REALTIME_FILTERING) -var refractionIrradiance: vec3f=irradiance(reflectionSampler,reflectionSamplerSampler,-irradianceVector,vReflectionFilteringInfo,0.0,surfaceAlbedo,irradianceVector -#ifdef IBL_CDF_FILTERING -,icdfSampler -,icdfSamplerSampler -#endif -); -#else -var refractionIrradiance: vec3f=computeEnvironmentIrradiance(-irradianceVector); -#endif -#elif defined(USEIRRADIANCEMAP) -#ifdef REFLECTIONMAP_3D -var irradianceCoords: vec3f=irradianceVector; -#else -var irradianceCoords: vec2f=irradianceVector.xy; -#ifdef REFLECTIONMAP_PROJECTION -irradianceCoords/=irradianceVector.z; -#endif -irradianceCoords.y=1.0-irradianceCoords.y; -#endif -var temp: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,-irradianceCoords);var refractionIrradiance=temp.rgb; -#ifdef RGBDREFLECTION -refractionIrradiance=fromRGBD(temp).rgb; -#endif -#ifdef GAMMAREFLECTION -refractionIrradiance=toLinearSpaceVec3(refractionIrradiance); -#endif -#else -var refractionIrradiance: vec3f= vec3f(0.); -#endif -refractionIrradiance*=transmittance; -#ifdef SS_ALBEDOFORTRANSLUCENCYTINT -refractionIrradiance*=surfaceAlbedo.rgb; -#endif -outParams.refractionIrradiance=refractionIrradiance; -#endif -return outParams;} -#endif -`;e.IncludesShadersStoreWGSL[R]||(e.IncludesShadersStoreWGSL[R]=b);const m="pbrBlockNormalFinal",y=`#if defined(FORCENORMALFORWARD) && defined(NORMAL) -var faceNormal: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))*scene.vEyePosition.w; -#if defined(TWOSIDEDLIGHTING) -faceNormal=select(-faceNormal,faceNormal,fragmentInputs.frontFacing); -#endif -normalW*=sign(dot(normalW,faceNormal)); -#endif -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -#if defined(MIRRORED) -normalW=select(normalW,-normalW,fragmentInputs.frontFacing); -#else -normalW=select(-normalW,normalW,fragmentInputs.frontFacing); -#endif -#endif -`;e.IncludesShadersStoreWGSL[m]||(e.IncludesShadersStoreWGSL[m]=y);const S="pbrBlockLightmapInit",B=`#ifdef LIGHTMAP -var lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset); -#ifdef RGBDLIGHTMAP -lightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a); -#endif -#ifdef GAMMALIGHTMAP -lightmapColor=vec4f(toLinearSpaceVec3(lightmapColor.rgb),lightmapColor.a); -#endif -lightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a); -#endif -`;e.IncludesShadersStoreWGSL[S]||(e.IncludesShadersStoreWGSL[S]=B);const C="pbrBlockGeometryInfo",G=`var NdotVUnclamped: f32=dot(normalW,viewDirectionW);var NdotV: f32=absEps(NdotVUnclamped);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var AARoughnessFactors: vec2f=getAARoughnessFactors(normalW.xyz); -#ifdef SPECULARAA -alphaG+=AARoughnessFactors.y; -#endif -#if defined(ENVIRONMENTBRDF) -var environmentBrdf: vec3f=getBRDFLookup(NdotV,roughness); -#endif -#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -#ifdef RADIANCEOCCLUSION -#ifdef AMBIENTINGRAYSCALE -var ambientMonochrome: f32=aoOut.ambientOcclusionColor.r; -#else -var ambientMonochrome: f32=getLuminance(aoOut.ambientOcclusionColor); -#endif -var seo: f32=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped); -#endif -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -var eho: f32=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW); -#endif -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[C]||(e.IncludesShadersStoreWGSL[C]=G);const u="pbrBlockReflectance",V=`#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -var baseSpecularEnvironmentReflectance: vec3f=getReflectanceFromBRDFWithEnvLookup(vec3f(reflectanceF0),vec3f(reflectivityOut.reflectanceF90),environmentBrdf); -#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) -let metalEnvironmentReflectance: vec3f=vec3f(reflectivityOut.specularWeight)*getF82Specular(NdotV,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricEnvironmentReflectance=getReflectanceFromBRDFWithEnvLookup(reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90,environmentBrdf);var colorSpecularEnvironmentReflectance: vec3f=mix(dielectricEnvironmentReflectance,metalEnvironmentReflectance,reflectivityOut.metallic); -#else -var colorSpecularEnvironmentReflectance=getReflectanceFromBRDFWithEnvLookup(clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,environmentBrdf); -#endif -#ifdef RADIANCEOCCLUSION -colorSpecularEnvironmentReflectance*=seo; -#endif -#ifdef HORIZONOCCLUSION -#ifdef BUMP -#ifdef REFLECTIONMAP_3D -colorSpecularEnvironmentReflectance*=eho; -#endif -#endif -#endif -#else -var colorSpecularEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));var baseSpecularEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,vec3f(reflectanceF0),vec3f(reflectivityOut.reflectanceF90),sqrt(microSurface)); -#endif -#ifdef CLEARCOAT -colorSpecularEnvironmentReflectance*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -colorSpecularEnvironmentReflectance*=clearcoatOut.absorption; -#endif -#endif -`;e.IncludesShadersStoreWGSL[u]||(e.IncludesShadersStoreWGSL[u]=V);const v="pbrBlockDirectLighting",x=`var diffuseBase: vec3f=vec3f(0.,0.,0.); -#ifdef SS_TRANSLUCENCY -var diffuseTransmissionBase: vec3f=vec3f(0.,0.,0.); -#endif -#ifdef SPECULARTERM -var specularBase: vec3f=vec3f(0.,0.,0.); -#endif -#ifdef CLEARCOAT -var clearCoatBase: vec3f=vec3f(0.,0.,0.); -#endif -#ifdef SHEEN -var sheenBase: vec3f=vec3f(0.,0.,0.); -#endif -#if defined(SPECULARTERM) && defined(LIGHT0) -var coloredFresnel: vec3f=vec3f(0.,0.,0.); -#endif -var preInfo: preLightingInfo;var info: lightingInfo;var shadow: f32=1.; -var aggShadow: f32=0.;var numLights: f32=0.; -#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT) -var absorption: vec3f=vec3f(0.); -#endif -`;e.IncludesShadersStoreWGSL[v]||(e.IncludesShadersStoreWGSL[v]=x);const p="pbrBlockFinalLitComponents",H=`aggShadow=aggShadow/numLights; -#if defined(ENVIRONMENTBRDF) -#ifdef MS_BRDF_ENERGY_CONSERVATION -var baseSpecularEnergyConservationFactor: vec3f=getEnergyConservationFactor(vec3f(reflectanceF0),environmentBrdf);var coloredEnergyConservationFactor: vec3f=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf); -#endif -#endif -#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF) -surfaceAlbedo=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb; -#endif -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -#ifndef METALLICWORKFLOW -#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION -surfaceAlbedo=vec3f(1.-reflectanceF0)*surfaceAlbedo.rgb; -#endif -#endif -#endif -#ifdef REFLECTION -var finalIrradiance: vec3f=reflectionOut.environmentIrradiance; -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -#if defined(METALLICWORKFLOW) || defined(SPECULAR_GLOSSINESS_ENERGY_CONSERVATION) -var baseSpecularEnergy: vec3f=vec3f(baseSpecularEnvironmentReflectance); -#if defined(ENVIRONMENTBRDF) -#ifdef MS_BRDF_ENERGY_CONSERVATION -baseSpecularEnergy*=baseSpecularEnergyConservationFactor; -#endif -#endif -finalIrradiance*=clamp(vec3f(1.0)-baseSpecularEnergy,vec3f(0.0),vec3f(1.0)); -#endif -#endif -#if defined(CLEARCOAT) -finalIrradiance*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -finalIrradiance*=clearcoatOut.absorption; -#endif -#endif -#ifndef SS_APPLY_ALBEDO_AFTER_SUBSURFACE -finalIrradiance*=surfaceAlbedo.rgb; -#endif -#if defined(SS_REFRACTION) -finalIrradiance*=subSurfaceOut.refractionOpacity; -#endif -#if defined(SS_TRANSLUCENCY) -finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance; -#endif -#ifdef SS_APPLY_ALBEDO_AFTER_SUBSURFACE -finalIrradiance*=surfaceAlbedo.rgb; -#endif -finalIrradiance*=uniforms.vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor; -#endif -#ifdef SPECULARTERM -var finalSpecular: vec3f=specularBase;finalSpecular=max(finalSpecular,vec3f(0.0));var finalSpecularScaled: vec3f=finalSpecular*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalSpecularScaled*=coloredEnergyConservationFactor; -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -finalSpecularScaled*=sheenOut.sheenAlbedoScaling; -#endif -#endif -#ifdef REFLECTION -var finalRadiance: vec3f=reflectionOut.environmentRadiance.rgb;finalRadiance*=colorSpecularEnvironmentReflectance;;var finalRadianceScaled: vec3f=finalRadiance*uniforms.vLightingIntensity.z; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalRadianceScaled*=coloredEnergyConservationFactor; -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING) -finalRadianceScaled*=sheenOut.sheenAlbedoScaling; -#endif -#endif -#ifdef SHEEN -var finalSheen: vec3f=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,vec3f(0.0));var finalSheenScaled: vec3f=finalSheen*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w; -#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF) -sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor; -#if defined(CLEARCOAT_TINT) -sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption; -#endif -#endif -#endif -#ifdef CLEARCOAT -var finalClearCoat: vec3f=clearCoatBase;finalClearCoat=max(finalClearCoat,vec3f(0.0));var finalClearCoatScaled: vec3f=finalClearCoat*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w; -#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION) -finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat; -#endif -#ifdef SS_REFRACTION -subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor; -#ifdef CLEARCOAT_TINT -subSurfaceOut.finalRefraction*=clearcoatOut.absorption; -#endif -#endif -#endif -#ifdef ALPHABLEND -var luminanceOverAlpha: f32=0.0; -#if defined(REFLECTION) && defined(RADIANCEOVERALPHA) -luminanceOverAlpha+=getLuminance(finalRadianceScaled); -#if defined(CLEARCOAT) -luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled); -#endif -#endif -#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA) -luminanceOverAlpha+=getLuminance(finalSpecularScaled); -#endif -#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA) -luminanceOverAlpha+=getLuminance(finalClearCoatScaled); -#endif -#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA) -alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha); -#endif -#endif -`;e.IncludesShadersStoreWGSL[p]||(e.IncludesShadersStoreWGSL[p]=H);const A="pbrBlockFinalUnlitComponents",W=`var finalDiffuse: vec3f=diffuseBase;finalDiffuse*=surfaceAlbedo; -#if defined(SS_REFRACTION) && !defined(UNLIT) && !defined(LEGACY_SPECULAR_ENERGY_CONSERVATION) -finalDiffuse*=subSurfaceOut.refractionOpacity; -#endif -#if defined(SS_TRANSLUCENCY) && !defined(UNLIT) -finalDiffuse+=diffuseTransmissionBase; -#endif -finalDiffuse=max(finalDiffuse,vec3f(0.0));finalDiffuse*=uniforms.vLightingIntensity.x;var finalAmbient: vec3f=uniforms.vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;var finalEmissive: vec3f=uniforms.vEmissiveColor; -#ifdef EMISSIVE -var emissiveColorTex: vec3f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb; -#ifdef GAMMAEMISSIVE -finalEmissive*=toLinearSpaceVec3(emissiveColorTex.rgb); -#else -finalEmissive*=emissiveColorTex.rgb; -#endif -finalEmissive*= uniforms.vEmissiveInfos.y; -#endif -finalEmissive*=uniforms.vLightingIntensity.y; -#ifdef AMBIENT -var ambientOcclusionForDirectDiffuse: vec3f=mix( vec3f(1.),aoOut.ambientOcclusionColor,uniforms.vAmbientInfos.w); -#else -var ambientOcclusionForDirectDiffuse: vec3f=aoOut.ambientOcclusionColor; -#endif -finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse; -`;e.IncludesShadersStoreWGSL[A]||(e.IncludesShadersStoreWGSL[A]=W);const I="pbrBlockFinalColorComposition",Y=`var finalColor: vec4f= vec4f( -#ifndef UNLIT -#ifdef REFLECTION -finalIrradiance + -#endif -#ifdef SPECULARTERM -finalSpecularScaled + -#endif -#ifdef SHEEN -finalSheenScaled + -#endif -#ifdef CLEARCOAT -finalClearCoatScaled + -#endif -#ifdef REFLECTION -finalRadianceScaled + -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) -sheenOut.finalSheenRadianceScaled + -#endif -#ifdef CLEARCOAT -clearcoatOut.finalClearCoatRadianceScaled + -#endif -#endif -#ifdef SS_REFRACTION -subSurfaceOut.finalRefraction + -#endif -#endif -finalAmbient + -finalDiffuse, -alpha); -#ifdef LIGHTMAP -#ifndef LIGHTMAPEXCLUDED -#ifdef USELIGHTMAPASSHADOWMAP -finalColor=vec4f(finalColor.rgb*lightmapColor.rgb,finalColor.a); -#else -finalColor=vec4f(finalColor.rgb+lightmapColor.rgb,finalColor.a); -#endif -#endif -#endif -finalColor=vec4f(finalColor.rgb+finalEmissive,finalColor.a); -#define CUSTOM_FRAGMENT_BEFORE_FOG -finalColor=max(finalColor,vec4f(0.0)); -`;e.IncludesShadersStoreWGSL[I]||(e.IncludesShadersStoreWGSL[I]=Y);const a="pbrPixelShader",N=`#define PBR_FRAGMENT_SHADER -#define CUSTOM_FRAGMENT_BEGIN -#include[SCENE_MRT_COUNT] -#include -#ifndef FROMLINEARSPACE -#define FROMLINEARSPACE -#endif -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef REFLECTION -#include -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -#include -#include -#include -#include -var albedoOpacityOut: albedoOpacityOutParams; -#ifdef ALBEDO -var albedoTexture: vec4f=textureSample(albedoSampler,albedoSamplerSampler,fragmentInputs.vAlbedoUV+uvOffset); -#endif -#ifdef BASE_WEIGHT -var baseWeightTexture: vec4f=textureSample(baseWeightSampler,baseWeightSamplerSampler,fragmentInputs.vBaseWeightUV+uvOffset); -#endif -#ifdef OPACITY -var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset); -#endif -#ifdef DECAL -var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset); -#endif -albedoOpacityOut=albedoOpacityBlock( -uniforms.vAlbedoColor -#ifdef ALBEDO -,albedoTexture -,uniforms.vAlbedoInfos -#endif -,uniforms.baseWeight -#ifdef BASE_WEIGHT -,baseWeightTexture -,uniforms.vBaseWeightInfos -#endif -#ifdef OPACITY -,opacityMap -,uniforms.vOpacityInfos -#endif -#ifdef DETAIL -,detailColor -,uniforms.vDetailInfos -#endif -#ifdef DECAL -,decalColor -,uniforms.vDecalInfos -#endif -);var surfaceAlbedo: vec3f=albedoOpacityOut.surfaceAlbedo;var alpha: f32=albedoOpacityOut.alpha; -#define CUSTOM_FRAGMENT_UPDATE_ALPHA -#include -#define CUSTOM_FRAGMENT_BEFORE_LIGHTS -var aoOut: ambientOcclusionOutParams; -#ifdef AMBIENT -var ambientOcclusionColorMap: vec3f=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb; -#endif -aoOut=ambientOcclusionBlock( -#ifdef AMBIENT -ambientOcclusionColorMap, -uniforms.vAmbientInfos -#endif -); -#include -#ifdef UNLIT -var diffuseBase: vec3f= vec3f(1.,1.,1.); -#else -var baseColor: vec3f=surfaceAlbedo;var reflectivityOut: reflectivityOutParams; -#if defined(REFLECTIVITY) -var surfaceMetallicOrReflectivityColorMap: vec4f=textureSample(reflectivitySampler,reflectivitySamplerSampler,fragmentInputs.vReflectivityUV+uvOffset);var baseReflectivity: vec4f=surfaceMetallicOrReflectivityColorMap; -#ifndef METALLICWORKFLOW -#ifdef REFLECTIVITY_GAMMA -surfaceMetallicOrReflectivityColorMap=toLinearSpaceVec4(surfaceMetallicOrReflectivityColorMap); -#endif -surfaceMetallicOrReflectivityColorMap=vec4f(surfaceMetallicOrReflectivityColorMap.rgb*uniforms.vReflectivityInfos.y,surfaceMetallicOrReflectivityColorMap.a); -#endif -#endif -#if defined(MICROSURFACEMAP) -var microSurfaceTexel: vec4f=textureSample(microSurfaceSampler,microSurfaceSamplerSampler,fragmentInputs.vMicroSurfaceSamplerUV+uvOffset)*uniforms.vMicroSurfaceSamplerInfos.y; -#endif -#ifdef BASE_DIFFUSE_ROUGHNESS -var baseDiffuseRoughnessTexture: f32=textureSample(baseDiffuseRoughnessSampler,baseDiffuseRoughnessSamplerSampler,fragmentInputs.vBaseDiffuseRoughnessUV+uvOffset).x; -#endif -#ifdef METALLICWORKFLOW -var metallicReflectanceFactors: vec4f=uniforms.vMetallicReflectanceFactors; -#ifdef REFLECTANCE -var reflectanceFactorsMap: vec4f=textureSample(reflectanceSampler,reflectanceSamplerSampler,fragmentInputs.vReflectanceUV+uvOffset); -#ifdef REFLECTANCE_GAMMA -reflectanceFactorsMap=toLinearSpaceVec4(reflectanceFactorsMap); -#endif -metallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*reflectanceFactorsMap.rgb,metallicReflectanceFactors.a); -#endif -#ifdef METALLIC_REFLECTANCE -var metallicReflectanceFactorsMap: vec4f=textureSample(metallicReflectanceSampler,metallicReflectanceSamplerSampler,fragmentInputs.vMetallicReflectanceUV+uvOffset); -#ifdef METALLIC_REFLECTANCE_GAMMA -metallicReflectanceFactorsMap=toLinearSpaceVec4(metallicReflectanceFactorsMap); -#endif -#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY -metallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*metallicReflectanceFactorsMap.rgb,metallicReflectanceFactors.a); -#endif -metallicReflectanceFactors.a*=metallicReflectanceFactorsMap.a; -#endif -#endif -reflectivityOut=reflectivityBlock( -uniforms.vReflectivityColor -#ifdef METALLICWORKFLOW -,surfaceAlbedo -,metallicReflectanceFactors -#endif -,uniforms.baseDiffuseRoughness -#ifdef BASE_DIFFUSE_ROUGHNESS -,baseDiffuseRoughnessTexture -,uniforms.vBaseDiffuseRoughnessInfos -#endif -#ifdef REFLECTIVITY -,uniforms.vReflectivityInfos -,surfaceMetallicOrReflectivityColorMap -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -,aoOut.ambientOcclusionColor -#endif -#ifdef MICROSURFACEMAP -,microSurfaceTexel -#endif -#ifdef DETAIL -,detailColor -,uniforms.vDetailInfos -#endif -);var microSurface: f32=reflectivityOut.microSurface;var roughness: f32=reflectivityOut.roughness;var diffuseRoughness: f32=reflectivityOut.diffuseRoughness; -#ifdef METALLICWORKFLOW -surfaceAlbedo=reflectivityOut.surfaceAlbedo; -#endif -#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED) -aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor; -#endif -#ifdef ALPHAFRESNEL -#if defined(ALPHATEST) || defined(ALPHABLEND) -var alphaFresnelOut: alphaFresnelOutParams;alphaFresnelOut=alphaFresnelBlock( -normalW, -viewDirectionW, -alpha, -microSurface -);alpha=alphaFresnelOut.alpha; -#endif -#endif -#include -#ifdef ANISOTROPIC -var anisotropicOut: anisotropicOutParams; -#ifdef ANISOTROPIC_TEXTURE -var anisotropyMapData: vec3f=textureSample(anisotropySampler,anisotropySamplerSampler,fragmentInputs.vAnisotropyUV+uvOffset).rgb*uniforms.vAnisotropyInfos.y; -#endif -anisotropicOut=anisotropicBlock( -uniforms.vAnisotropy, -roughness, -#ifdef ANISOTROPIC_TEXTURE -anisotropyMapData, -#endif -TBN, -normalW, -viewDirectionW -); -#endif -#ifdef REFLECTION -var reflectionOut: reflectionOutParams; -#ifndef USE_CUSTOM_REFLECTION -reflectionOut=reflectionBlock( -fragmentInputs.vPositionW -,normalW -,alphaG -,uniforms.vReflectionMicrosurfaceInfos -,uniforms.vReflectionInfos -,uniforms.vReflectionColor -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX) -,NdotVUnclamped -#endif -#ifdef LINEARSPECULARREFLECTION -,roughness -#endif -,reflectionSampler -,reflectionSamplerSampler -#if defined(NORMAL) && defined(USESPHERICALINVERTEX) -,fragmentInputs.vEnvironmentIrradiance -#endif -#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D)) -,uniforms.reflectionMatrix -#endif -#ifdef USEIRRADIANCEMAP -,irradianceSampler -,irradianceSamplerSampler -#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION -,uniforms.vReflectionDominantDirection -#endif -#endif -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,uniforms.vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,icdfSampler -,icdfSamplerSampler -#endif -#endif -,viewDirectionW -,diffuseRoughness -,surfaceAlbedo -); -#else -#define CUSTOM_REFLECTION -#endif -#endif -#include -#ifdef SHEEN -var sheenOut: sheenOutParams; -#ifdef SHEEN_TEXTURE -var sheenMapData: vec4f=textureSample(sheenSampler,sheenSamplerSampler,fragmentInputs.vSheenUV+uvOffset); -#endif -#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -var sheenMapRoughnessData: vec4f=textureSample(sheenRoughnessSampler,sheenRoughnessSamplerSampler,fragmentInputs.vSheenRoughnessUV+uvOffset)*uniforms.vSheenInfos.w; -#endif -sheenOut=sheenBlock( -uniforms.vSheenColor -#ifdef SHEEN_ROUGHNESS -,uniforms.vSheenRoughness -#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) -,sheenMapRoughnessData -#endif -#endif -,roughness -#ifdef SHEEN_TEXTURE -,sheenMapData -,uniforms.vSheenInfos.y -#endif -,reflectanceF0 -#ifdef SHEEN_LINKWITHALBEDO -,baseColor -,surfaceAlbedo -#endif -#ifdef ENVIRONMENTBRDF -,NdotV -,environmentBrdf -#endif -#if defined(REFLECTION) && defined(ENVIRONMENTBRDF) -,AARoughnessFactors -,uniforms.vReflectionMicrosurfaceInfos -,uniforms.vReflectionInfos -,uniforms.vReflectionColor -,uniforms.vLightingIntensity -,reflectionSampler -,reflectionSamplerSampler -,reflectionOut.reflectionCoords -,NdotVUnclamped -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,uniforms.vReflectionFilteringInfo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION) -,seo -#endif -#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -,eho -#endif -#endif -); -#ifdef SHEEN_LINKWITHALBEDO -surfaceAlbedo=sheenOut.surfaceAlbedo; -#endif -#endif -#ifdef CLEARCOAT -#ifdef CLEARCOAT_TEXTURE -var clearCoatMapData: vec2f=textureSample(clearCoatSampler,clearCoatSamplerSampler,fragmentInputs.vClearCoatUV+uvOffset).rg*uniforms.vClearCoatInfos.y; -#endif -#endif -#ifdef IRIDESCENCE -var iridescenceOut: iridescenceOutParams; -#ifdef IRIDESCENCE_TEXTURE -var iridescenceMapData: vec2f=textureSample(iridescenceSampler,iridescenceSamplerSampler,fragmentInputs.vIridescenceUV+uvOffset).rg*uniforms.vIridescenceInfos.y; -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -var iridescenceThicknessMapData: vec2f=textureSample(iridescenceThicknessSampler,iridescenceThicknessSamplerSampler,fragmentInputs.vIridescenceThicknessUV+uvOffset).rg*uniforms.vIridescenceInfos.w; -#endif -iridescenceOut=iridescenceBlock( -uniforms.vIridescenceParams -,NdotV -,specularEnvironmentR0 -#ifdef IRIDESCENCE_TEXTURE -,iridescenceMapData -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -,iridescenceThicknessMapData -#endif -#ifdef CLEARCOAT -,NdotVUnclamped -,uniforms.vClearCoatParams -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData -#endif -#endif -);var iridescenceIntensity: f32=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0; -#endif -var clearcoatOut: clearcoatOutParams; -#ifdef CLEARCOAT -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -var clearCoatMapRoughnessData: vec4f=textureSample(clearCoatRoughnessSampler,clearCoatRoughnessSamplerSampler,fragmentInputs.vClearCoatRoughnessUV+uvOffset)*uniforms.vClearCoatInfos.w; -#endif -#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -var clearCoatTintMapData: vec4f=textureSample(clearCoatTintSampler,clearCoatTintSamplerSampler,fragmentInputs.vClearCoatTintUV+uvOffset); -#endif -#ifdef CLEARCOAT_BUMP -var clearCoatBumpMapData: vec4f=textureSample(clearCoatBumpSampler,clearCoatBumpSamplerSampler,fragmentInputs.vClearCoatBumpUV+uvOffset); -#endif -clearcoatOut=clearcoatBlock( -fragmentInputs.vPositionW -,geometricNormalW -,viewDirectionW -,uniforms.vClearCoatParams -#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) -,clearCoatMapRoughnessData -#endif -,specularEnvironmentR0 -#ifdef CLEARCOAT_TEXTURE -,clearCoatMapData -#endif -#ifdef CLEARCOAT_TINT -,uniforms.vClearCoatTintParams -,uniforms.clearCoatColorAtDistance -,uniforms.vClearCoatRefractionParams -#ifdef CLEARCOAT_TINT_TEXTURE -,clearCoatTintMapData -#endif -#endif -#ifdef CLEARCOAT_BUMP -,uniforms.vClearCoatBumpInfos -,clearCoatBumpMapData -,fragmentInputs.vClearCoatBumpUV -#if defined(TANGENT) && defined(NORMAL) -,mat3x3(input.vTBN0,input.vTBN1,input.vTBN2) -#else -,uniforms.vClearCoatTangentSpaceParams -#endif -#ifdef OBJECTSPACE_NORMALMAP -,uniforms.normalMatrix -#endif -#endif -#if defined(FORCENORMALFORWARD) && defined(NORMAL) -,faceNormal -#endif -#ifdef REFLECTION -,uniforms.vReflectionMicrosurfaceInfos -,uniforms.vReflectionInfos -,uniforms.vReflectionColor -,uniforms.vLightingIntensity -,reflectionSampler -,reflectionSamplerSampler -#ifndef LODBASEDMICROSFURACE -,reflectionLowSampler -,reflectionLowSamplerSampler -,reflectionHighSampler -,reflectionHighSamplerSampler -#endif -#ifdef REALTIME_FILTERING -,uniforms.vReflectionFilteringInfo -#endif -#endif -#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING) -,select(-1.,1.,fragmentInputs.frontFacing) -#endif -); -#else -clearcoatOut.specularEnvironmentR0=specularEnvironmentR0; -#endif -#include -var subSurfaceOut: subSurfaceOutParams; -#ifdef SUBSURFACE -#ifdef SS_THICKNESSANDMASK_TEXTURE -var thicknessMap: vec4f=textureSample(thicknessSampler,thicknessSamplerSampler,fragmentInputs.vThicknessUV+uvOffset); -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -var refractionIntensityMap: vec4f=textureSample(refractionIntensitySampler,refractionIntensitySamplerSampler,fragmentInputs.vRefractionIntensityUV+uvOffset); -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -var translucencyIntensityMap: vec4f=textureSample(translucencyIntensitySampler,translucencyIntensitySamplerSampler,fragmentInputs.vTranslucencyIntensityUV+uvOffset); -#endif -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -var translucencyColorMap: vec4f=textureSample(translucencyColorSampler,translucencyColorSamplerSampler,fragmentInputs.vTranslucencyColorUV+uvOffset); -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA -translucencyColorMap=toLinearSpaceVec4(translucencyColorMap); -#endif -#endif -subSurfaceOut=subSurfaceBlock( -uniforms.vSubSurfaceIntensity -,uniforms.vThicknessParam -,uniforms.vTintColor -,normalW -#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION -,vec3f(max(colorSpecularEnvironmentReflectance.r,max(colorSpecularEnvironmentReflectance.g,colorSpecularEnvironmentReflectance.b))) -#else -,baseSpecularEnvironmentReflectance -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -,thicknessMap -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -,refractionIntensityMap -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -,translucencyIntensityMap -#endif -#ifdef REFLECTION -#ifdef SS_TRANSLUCENCY -,uniforms.reflectionMatrix -#ifdef USESPHERICALFROMREFLECTIONMAP -#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX) -,reflectionOut.irradianceVector -#endif -#if defined(REALTIME_FILTERING) -,reflectionSampler -,reflectionSamplerSampler -,uniforms.vReflectionFilteringInfo -#ifdef IBL_CDF_FILTERING -,icdfSampler -,icdfSamplerSampler -#endif -#endif -#endif -#ifdef USEIRRADIANCEMAP -,irradianceSampler -,irradianceSamplerSampler -#endif -#endif -#endif -#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY) -,surfaceAlbedo -#endif -#ifdef SS_REFRACTION -,fragmentInputs.vPositionW -,viewDirectionW -,scene.view -,uniforms.vRefractionInfos -,uniforms.refractionMatrix -,uniforms.vRefractionMicrosurfaceInfos -,uniforms.vLightingIntensity -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -,alpha -#endif -#ifdef SS_LODINREFRACTIONALPHA -,NdotVUnclamped -#endif -#ifdef SS_LINEARSPECULARREFRACTION -,roughness -#endif -,alphaG -,refractionSampler -,refractionSamplerSampler -#ifndef LODBASEDMICROSFURACE -,refractionLowSampler -,refractionLowSamplerSampler -,refractionHighSampler -,refractionHighSamplerSampler -#endif -#ifdef ANISOTROPIC -,anisotropicOut -#endif -#ifdef REALTIME_FILTERING -,uniforms.vRefractionFilteringInfo -#endif -#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC -,uniforms.vRefractionPosition -,uniforms.vRefractionSize -#endif -#ifdef SS_DISPERSION -,uniforms.dispersion -#endif -#endif -#ifdef SS_TRANSLUCENCY -,uniforms.vDiffusionDistance -,uniforms.vTranslucencyColor -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -,translucencyColorMap -#endif -#endif -); -#ifdef SS_REFRACTION -surfaceAlbedo=subSurfaceOut.surfaceAlbedo; -#ifdef SS_LINKREFRACTIONTOTRANSPARENCY -alpha=subSurfaceOut.alpha; -#endif -#endif -#else -subSurfaceOut.specularEnvironmentReflectance=colorSpecularEnvironmentReflectance; -#endif -#include -#include[0..maxSimultaneousLights] -#include -#endif -#include -#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION -#include -#include -#include(color,finalColor) -#include -#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR -#ifdef PREPASS -#include -#endif -#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY) -fragmentOutputs.color=finalColor; -#endif -#include -#if ORDER_INDEPENDENT_TRANSPARENCY -if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+finalColor.rgb*finalColor.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-finalColor.a));} else {fragmentOutputs.backColor+=finalColor;} -#endif -#include -#define CUSTOM_FRAGMENT_MAIN_END -} -`;e.ShadersStoreWGSL[a]||(e.ShadersStoreWGSL[a]=N);const de={name:a,shader:N};export{de as pbrPixelShaderWGSL}; diff --git a/assets/pbr.vertex-CEbXYtEB.js b/assets/pbr.vertex-CEbXYtEB.js deleted file mode 100644 index 03e558852900ad07e6b95b5d890348ef05953170..0000000000000000000000000000000000000000 --- a/assets/pbr.vertex-CEbXYtEB.js +++ /dev/null @@ -1,357 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./vertexColorMixing-DoZiZfly.js";import"./pbrUboDeclaration-VU_3zv-q.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";import"./helperFunctions-tBt4f_K3.js";import"./pbrBRDFFunctions-DaHwCtNC.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./harmonicsFunctions-DgiK80M3.js";import"./bumpVertexDeclaration-DMtCfYrP.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./logDepthVertex-zXeqwUWs.js";import"./shadowsVertex-w5DW1avO.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./bumpVertex-dKv8gF7O.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const n="pbrVertexDeclaration",r=`uniform mat4 view;uniform mat4 viewProjection;uniform vec4 vEyePosition; -#ifdef MULTIVIEW -mat4 viewProjectionR; -#endif -#ifdef ALBEDO -uniform mat4 albedoMatrix;uniform vec2 vAlbedoInfos; -#endif -#ifdef BASE_WEIGHT -uniform mat4 baseWeightMatrix;uniform vec2 vBaseWeightInfos; -#endif -uniform float baseDiffuseRoughness; -#ifdef BASE_DIFFUSE_ROUGHNESS -uniform mat4 baseDiffuseRoughnessMatrix;uniform vec2 vBaseDiffuseRoughnessInfos; -#endif -#ifdef AMBIENT -uniform mat4 ambientMatrix;uniform vec4 vAmbientInfos; -#endif -#ifdef OPACITY -uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos; -#endif -#ifdef EMISSIVE -uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix; -#endif -#ifdef LIGHTMAP -uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix; -#endif -#ifdef REFLECTIVITY -uniform vec3 vReflectivityInfos;uniform mat4 reflectivityMatrix; -#endif -#ifdef METALLIC_REFLECTANCE -uniform vec2 vMetallicReflectanceInfos;uniform mat4 metallicReflectanceMatrix; -#endif -#ifdef REFLECTANCE -uniform vec2 vReflectanceInfos;uniform mat4 reflectanceMatrix; -#endif -#ifdef MICROSURFACEMAP -uniform vec2 vMicroSurfaceSamplerInfos;uniform mat4 microSurfaceSamplerMatrix; -#endif -#ifdef BUMP -uniform vec3 vBumpInfos;uniform mat4 bumpMatrix; -#endif -#ifdef POINTSIZE -uniform float pointSize; -#endif -uniform vec4 cameraInfo; -#ifdef REFLECTION -uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix; -#endif -#ifdef CLEARCOAT -#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS) -uniform vec4 vClearCoatInfos; -#endif -#ifdef CLEARCOAT_TEXTURE -uniform mat4 clearCoatMatrix; -#endif -#ifdef CLEARCOAT_TEXTURE_ROUGHNESS -uniform mat4 clearCoatRoughnessMatrix; -#endif -#ifdef CLEARCOAT_BUMP -uniform vec2 vClearCoatBumpInfos;uniform mat4 clearCoatBumpMatrix; -#endif -#ifdef CLEARCOAT_TINT_TEXTURE -uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix; -#endif -#endif -#ifdef IRIDESCENCE -#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE) -uniform vec4 vIridescenceInfos; -#endif -#ifdef IRIDESCENCE_TEXTURE -uniform mat4 iridescenceMatrix; -#endif -#ifdef IRIDESCENCE_THICKNESS_TEXTURE -uniform mat4 iridescenceThicknessMatrix; -#endif -#endif -#ifdef ANISOTROPIC -#ifdef ANISOTROPIC_TEXTURE -uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix; -#endif -#endif -#ifdef SHEEN -#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS) -uniform vec4 vSheenInfos; -#endif -#ifdef SHEEN_TEXTURE -uniform mat4 sheenMatrix; -#endif -#ifdef SHEEN_TEXTURE_ROUGHNESS -uniform mat4 sheenRoughnessMatrix; -#endif -#endif -#ifdef SUBSURFACE -#ifdef SS_REFRACTION -uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix; -#endif -#ifdef SS_THICKNESSANDMASK_TEXTURE -uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix; -#endif -#ifdef SS_REFRACTIONINTENSITY_TEXTURE -uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix; -#endif -#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE -uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix; -#endif -#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE -uniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix; -#endif -#endif -#ifdef NORMAL -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#ifdef USESPHERICALFROMREFLECTIONMAP -#ifdef SPHERICAL_HARMONICS -uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22; -#else -uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX; -#endif -#endif -#endif -#endif -#ifdef DETAIL -uniform vec4 vDetailInfos;uniform mat4 detailMatrix; -#endif -#include -#define ADDITIONAL_VERTEX_DECLARATION -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=r);const i="pbrVertexShader",E=`#define PBR_VERTEX_SHADER -#define CUSTOM_VERTEX_EXTENSION -precision highp float; -#include<__decl__pbrVertex> -#define CUSTOM_VERTEX_BEGIN -attribute vec3 position; -#ifdef NORMAL -attribute vec3 normal; -#endif -#ifdef TANGENT -attribute vec4 tangent; -#endif -#ifdef UV1 -attribute vec2 uv; -#endif -#include[2..7] -#include[1..7] -#ifdef VERTEXCOLOR -attribute vec4 color; -#endif -#include -#include -#include -#include -#include -#include -#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness) -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness) -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy) -#endif -#ifdef SUBSURFACE -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor) -#endif -varying vec3 vPositionW; -#if DEBUGMODE>0 -varying vec4 vClipSpacePosition; -#endif -#ifdef NORMAL -varying vec3 vNormalW; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vec3 vEnvironmentIrradiance; -#include -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vec4 vColor; -#endif -#include -#include -#include -#include<__decl__lightVxFragment>[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vec3 vPositionUVW; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vec3 vDirectionW; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying float vViewDepth; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -vec3 positionUpdated=position; -#ifdef NORMAL -vec3 normalUpdated=normal; -#endif -#ifdef TANGENT -vec4 tangentUpdated=tangent; -#endif -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#ifdef VERTEXCOLOR -vec4 colorUpdated=color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vPositionW=vec3(worldPos); -#ifdef PREPASS -#include -#endif -#ifdef NORMAL -mat3 normalWorld=mat3(finalWorld); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vNormalW=normalize(normalWorld*normalUpdated); -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float NdotV=max(dot(vNormalW,viewDirectionW),0.0);vec3 roughNormal=mix(vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*baseDiffuseRoughness);vec3 reflectionVector=vec3(reflectionMatrix*vec4(roughNormal,0)).xyz; -#else -vec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz; -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;} -#else -gl_Position=viewProjection*worldPos; -#endif -#if DEBUGMODE>0 -vClipSpacePosition=gl_Position; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0))); -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#ifdef RIGHT_HANDED -vViewDepth=-(view*worldPos).z; -#else -vViewDepth=(view*worldPos).z; -#endif -#endif -#ifndef UV1 -vec2 uvUpdated=vec2(0.,0.); -#endif -#ifndef UV2 -vec2 uv2Updated=vec2(0.,0.); -#endif -#ifdef MAINUV1 -vMainUV1=uvUpdated; -#endif -#ifdef MAINUV2 -vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z) -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z) -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x) -#endif -#ifdef SUBSURFACE -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x) -#endif -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#if defined(POINTSIZE) && !defined(WEBGPU) -gl_PointSize=pointSize; -#endif -#include -#define CUSTOM_VERTEX_MAIN_END -} -`;e.ShadersStore[i]||(e.ShadersStore[i]=E);const p={name:i,shader:E};export{p as pbrVertexShader}; diff --git a/assets/pbr.vertex-DdhHz9ju.js b/assets/pbr.vertex-DdhHz9ju.js deleted file mode 100644 index 218c912dea82e85b664e6f3b3dfe1cad57509fc8..0000000000000000000000000000000000000000 --- a/assets/pbr.vertex-DdhHz9ju.js +++ /dev/null @@ -1,227 +0,0 @@ -import{S as E}from"./index-GY9JDBGV.js";import"./pbrUboDeclaration-Cq2mqEav.js";import"./vertexColorMixing-BV8k1N8l.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";import"./helperFunctions-Wgh3PIP0.js";import"./pbrBRDFFunctions-BKKbkltP.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./instancesDeclaration-ConO0l1b.js";import"./harmonicsFunctions-B8ViGQkZ.js";import"./bumpVertexDeclaration-p9pSA1UA.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./logDepthVertex-CfHieHf5.js";import"./shadowsVertex-DKtacRyL.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./bumpVertex-DVPnlCbV.js";import"./index-DydPgVMC.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const e="pbrVertexShader",i=`#define PBR_VERTEX_SHADER -#include -#define CUSTOM_VERTEX_BEGIN -attribute position: vec3f; -#ifdef NORMAL -attribute normal: vec3f; -#endif -#ifdef TANGENT -attribute tangent: vec4f; -#endif -#ifdef UV1 -attribute uv: vec2f; -#endif -#include[2..7] -#include[1..7] -#ifdef VERTEXCOLOR -attribute color: vec4f; -#endif -#include -#include -#include -#include -#include -#include -#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness) -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness) -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy) -#endif -#ifdef SUBSURFACE -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor) -#endif -varying vPositionW: vec3f; -#if DEBUGMODE>0 -varying vClipSpacePosition: vec4f; -#endif -#ifdef NORMAL -varying vNormalW: vec3f; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vEnvironmentIrradiance: vec3f; -#include -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vColor: vec4f; -#endif -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -varying vPositionUVW: vec3f; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -varying vDirectionW: vec3f; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying vViewDepth: f32; -#endif -#include -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -var positionUpdated: vec3f=vertexInputs.position; -#ifdef NORMAL -var normalUpdated: vec3f=vertexInputs.normal; -#endif -#ifdef TANGENT -var tangentUpdated: vec4f=vertexInputs.tangent; -#endif -#ifdef UV1 -var uvUpdated: vec2f=vertexInputs.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=vertexInputs.uv2; -#endif -#ifdef VERTEXCOLOR -var colorUpdated: vec4f=vertexInputs.color; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef REFLECTIONMAP_SKYBOX -vertexOutputs.vPositionUVW=positionUpdated; -#endif -#define CUSTOM_VERTEX_UPDATE_POSITION -#define CUSTOM_VERTEX_UPDATE_NORMAL -#include -#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED) -vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0); -#endif -#include -#include -var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPositionW= worldPos.xyz; -#ifdef PREPASS -#include -#endif -#ifdef NORMAL -var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW); -#else -#ifdef NONUNIFORMSCALING -normalWorld=transposeMat3(inverseMat3(normalWorld)); -#endif -vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated); -#endif -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY -var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-vertexOutputs.vPositionW);var NdotV: f32=max(dot(vertexOutputs.vNormalW,viewDirectionW),0.0);var roughNormal: vec3f=mix(vertexOutputs.vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*uniforms.baseDiffuseRoughness);var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(roughNormal,0)).xyz; -#else -var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(vertexOutputs.vNormalW,0)).xyz; -#endif -#ifdef REFLECTIONMAP_OPPOSITEZ -reflectionVector.z*=-1.0; -#endif -vertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector); -#endif -#endif -#define CUSTOM_VERTEX_UPDATE_WORLDPOS -#ifdef MULTIVIEW -if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;} -#else -vertexOutputs.position=scene.viewProjection*worldPos; -#endif -#if DEBUGMODE>0 -vertexOutputs.vClipSpacePosition=vertexOutputs.position; -#endif -#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED) -vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(positionUpdated,0.0)).xyz); -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#ifdef RIGHT_HANDED -vertexOutputs.vViewDepth=-(scene.view*worldPos).z; -#else -vertexOutputs.vViewDepth=(scene.view*worldPos).z; -#endif -#endif -#ifndef UV1 -var uvUpdated: vec2f= vec2f(0.,0.); -#endif -#ifdef MAINUV1 -vertexOutputs.vMainUV1=uvUpdated; -#endif -#ifndef UV2 -var uv2Updated: vec2f= vec2f(0.,0.); -#endif -#ifdef MAINUV2 -vertexOutputs.vMainUV2=uv2Updated; -#endif -#include[3..7] -#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x) -#include(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x) -#include(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x) -#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x) -#include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x) -#include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x) -#include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x) -#include(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x) -#include(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x) -#include(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x) -#include(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x) -#include(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x) -#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x) -#include(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x) -#ifdef CLEARCOAT -#include(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x) -#include(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z) -#include(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x) -#include(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x) -#endif -#ifdef IRIDESCENCE -#include(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x) -#include(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z) -#endif -#ifdef SHEEN -#include(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x) -#include(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z) -#endif -#ifdef ANISOTROPIC -#include(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x) -#endif -#ifdef SUBSURFACE -#include(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x) -#include(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x) -#include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x) -#include(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x) -#endif -#include -#include -#include -#include[0..maxSimultaneousLights] -#include -#include -#define CUSTOM_VERTEX_MAIN_END -}`;E.ShadersStoreWGSL[e]||(E.ShadersStoreWGSL[e]=i);const C={name:e,shader:i};export{C as pbrVertexShaderWGSL}; diff --git a/assets/pbrBRDFFunctions-BKKbkltP.js b/assets/pbrBRDFFunctions-BKKbkltP.js deleted file mode 100644 index c9abdd406320e3e375762cd5090630b9e65803f1..0000000000000000000000000000000000000000 --- a/assets/pbrBRDFFunctions-BKKbkltP.js +++ /dev/null @@ -1,173 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const f="pbrBRDFFunctions",r=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 -#define BRDF_DIFFUSE_MODEL_EON 0 -#define BRDF_DIFFUSE_MODEL_BURLEY 1 -#define BRDF_DIFFUSE_MODEL_LAMBERT 2 -#define BRDF_DIFFUSE_MODEL_LEGACY 3 -#define DIELECTRIC_SPECULAR_MODEL_GLTF 0 -#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1 -#define CONDUCTOR_SPECULAR_MODEL_GLTF 0 -#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1 -#if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER) -#ifdef MS_BRDF_ENERGY_CONSERVATION -fn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);} -#endif -#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR -fn getF82Specular(NdotV: f32,F0: vec3f,edgeTint: vec3f,roughness: f32)->vec3f {const cos_theta_max: f32=0.142857143; -const one_minus_cos_theta_max_to_the_fifth: f32=0.462664366; -const one_minus_cos_theta_max_to_the_sixth: f32=0.396569457; -let white_minus_F0: vec3f=vec3f(1.0f)-F0;let b_numerator: vec3f=(F0+white_minus_F0*one_minus_cos_theta_max_to_the_fifth)*(vec3f(1.0)-edgeTint);const b_denominator: f32=cos_theta_max*one_minus_cos_theta_max_to_the_sixth;const b_denominator_reciprocal: f32=1.0f/b_denominator;let b: vec3f=b_numerator*b_denominator_reciprocal; -let cos_theta: f32=max(roughness,NdotV);let one_minus_cos_theta: f32=1.0-cos_theta;let offset_from_F0: vec3f=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0f);return clamp(F0+offset_from_F0,vec3f(0.0f),vec3f(1.0f));} -#endif -#ifdef FUZZENVIRONMENTBRDF -fn getFuzzBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {let UV: vec2f=vec2f(perceptualRoughness,NdotV);var brdfLookup: vec4f=textureSample(environmentFuzzBrdfSampler,environmentFuzzBrdfSamplerSampler,UV);const RiRange: vec2f=vec2f(0.0f,0.75f);const ARange: vec2f=vec2f(0.005f,0.88f);const BRange: vec2f=vec2f(-0.18f,0.002f);brdfLookup.r=mix(ARange.x, ARange.y, brdfLookup.r);brdfLookup.g=mix(BRange.x, BRange.y, brdfLookup.g);brdfLookup.b=mix(RiRange.x,RiRange.y,brdfLookup.b);return brdfLookup.rgb;} -#endif -#ifdef ENVIRONMENTBRDF -fn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV); -#ifdef ENVIRONMENTBRDF_RGBD -brdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a); -#endif -return brdfLookup.rgb;} -fn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f { -#ifdef BRDF_V_HEIGHT_CORRELATED -var reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y; -#else -var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y; -#endif -return reflectance;} -fn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f { -#ifdef BRDF_V_HEIGHT_CORRELATED -var reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0); -#else -var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y; -#endif -return reflectance;} -#endif -/* NOT USED -#if defined(SHEEN) && defined(SHEEN_SOFTER) -fn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32 -{var c: f32=1.0-NdotV;var c3: f32=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));} -#endif -*/ -#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL) -fn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f -{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));} -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) -/** -* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture. -* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table -*/ -fn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;} -#endif -fn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f -{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);} -fn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32 -{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);} -#ifdef CLEARCOAT -fn getR0RemappedForClearCoat(f0: vec3f)->vec3f { -#ifdef CLEARCOAT_DEFAULTIOR -#ifdef MOBILE -return saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256); -#else -return saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998); -#endif -#else -var s: vec3f=sqrt(f0);var t: vec3f=(uniforms.vClearCoatRefractionParams.z+uniforms.vClearCoatRefractionParams.w*s)/(uniforms.vClearCoatRefractionParams.w+uniforms.vClearCoatRefractionParams.z*s);return squareVec3(t); -#endif -} -#endif -#ifdef IRIDESCENCE -const XYZ_TO_REC709: mat3x3f= mat3x3f( -3.2404542,-0.9692660, 0.0556434, --1.5371385, 1.8760108,-0.2040259, --0.4985314, 0.0415560, 1.0572252 -);fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);} -fn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));} -fn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));} -fn evalSensitivity(opd: f32,shift: vec3f)->vec3f {var phase: f32=2.0*PI*opd*1.0e-9;const val: vec3f= vec3f(5.4856e-13,4.4201e-13,5.2481e-13);const pos: vec3f= vec3f(1.6810e+06,1.7953e+06,2.2084e+06);const vr: vec3f= vec3f(4.3278e+09,9.3046e+09,6.6121e+09);var xyz: vec3f=val*sqrt(2.0*PI*vr)*cos(pos*phase+shift)*exp(-square(phase)*vr);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;var srgb: vec3f=XYZ_TO_REC709*xyz;return srgb;} -fn evalIridescence(outsideIOR: f32,eta2: f32,cosTheta1: f32,thinFilmThickness: f32,baseF0: vec3f)->vec3f {var I: vec3f= vec3f(1.0);var iridescenceIOR: f32=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));var sinTheta2Sq: f32=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));var cosTheta2Sq: f32=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;} -var cosTheta2: f32=sqrt(cosTheta2Sq);var R0: f32=getR0fromIORs(iridescenceIOR,outsideIOR);var R12: f32=fresnelSchlickGGX(cosTheta1,R0,1.);var R21: f32=R12;var T121: f32=1.0-R12;var phi12: f32=0.0;if (iridescenceIORf32 -{var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);} -#ifdef SHEEN -fn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32 -{var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);} -#endif -#ifdef ANISOTROPIC -fn normalDistributionFunction_BurleyGGX_Anisotropic(NdotH: f32,TdotH: f32,BdotH: f32,alphaTB: vec2f)->f32 {var a2: f32=alphaTB.x*alphaTB.y;var v: vec3f= vec3f(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);var v2: f32=dot(v,v);var w2: f32=a2/v2;return a2*w2*w2*RECIPROCAL_PI;} -#endif -#ifdef BRDF_V_HEIGHT_CORRELATED -fn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 { -#ifdef MOBILE -var GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL); -#else -var a2: f32=alphaG*alphaG;var GGXV: f32=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);var GGXL: f32=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL); -#endif -} -#else -fn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32 -{ -#ifdef MOBILE -return 1.0/(dot+alphaG+(1.0-alphaG)*dot )); -#else -var alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot)); -#endif -} -fn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32 -{var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;} -#endif -#ifdef ANISOTROPIC -fn smithVisibility_GGXCorrelated_Anisotropic(NdotL: f32,NdotV: f32,TdotV: f32,BdotV: f32,TdotL: f32,BdotL: f32,alphaTB: vec2f)->f32 {var lambdaV: f32=NdotL*length( vec3f(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));var lambdaL: f32=NdotV*length( vec3f(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));var v: f32=0.5/(lambdaV+lambdaL);return v;} -#endif -#ifdef CLEARCOAT -fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); } -#endif -#ifdef SHEEN -fn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32 -{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));} -/* NOT USED -#ifdef SHEEN_SOFTER -fn l(x: f32,alphaG: f32)->f32 -{var oneMinusAlphaSq: f32=(1.0-alphaG)*(1.0-alphaG);var a: f32=mix(21.5473,25.3245,oneMinusAlphaSq);var b: f32=mix(3.82987,3.32435,oneMinusAlphaSq);var c: f32=mix(0.19823,0.16801,oneMinusAlphaSq);var d: f32=mix(-1.97760,-1.27393,oneMinusAlphaSq);var e: f32=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;} -fn lambdaSheen(cosTheta: f32,alphaG: f32)->f32 -{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));} -fn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32 -{var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);} -#endif -*/ -#endif -const constant1_FON: f32=0.5f-2.0f/(3.0f*PI);const constant2_FON: f32=2.0f/3.0f-28.0f/(15.0f*PI);fn E_FON_approx(mu: f32,roughness: f32)->f32 -{var sigma: f32=roughness; -var mucomp: f32=1.0f-mu;var mucomp2: f32=mucomp*mucomp;const Gcoeffs: mat2x2f=mat2x2f(0.0571085289f,-0.332181442f, -0.491881867f,0.0714429953f);var GoverPi: f32=dot(Gcoeffs*vec2f(mucomp,mucomp2),vec2f(1.0f,mucomp2));return (1.0f+sigma*GoverPi)/(1.0f+constant1_FON*sigma);} -fn diffuseBRDF_EON(albedo: vec3f,roughness: f32,NdotL: f32,NdotV: f32,LdotV: f32)->vec3f -{var rho: vec3f=albedo;var sigma: f32=roughness; -var mu_i: f32=NdotL; -var mu_o: f32=NdotV; -var s: f32=LdotV-mu_i*mu_o; -var sovertF: f32=select(s,s/max(mu_i,mu_o),s>0.0f); -var AF: f32=1.0f/(1.0f+constant1_FON*sigma); -var f_ss: vec3f=(rho*RECIPROCAL_PI)*AF*(1.0f+sigma*sovertF); -var EFo: f32=E_FON_approx(mu_o,sigma); -var EFi: f32=E_FON_approx(mu_i,sigma); -var avgEF: f32=AF*(1.0f+constant2_FON*sigma); -var rho_ms: vec3f=(rho*rho)*avgEF/(vec3f(1.0f)-rho*(1.0f-avgEF));const eps: f32=1.0e-7f;var f_ms: vec3f=(rho_ms*RECIPROCAL_PI)*max(eps,1.0f-EFo) -* max(eps,1.0f-EFi) -/ max(eps,1.0f-avgEF);return (f_ss+f_ms);} -fn diffuseBRDF_Burley(NdotL: f32,NdotV: f32,VdotH: f32,roughness: f32)->f32 {var diffuseFresnelNV: f32=pow5(saturateEps(1.0-NdotL));var diffuseFresnelNL: f32=pow5(saturateEps(1.0-NdotV));var diffuseFresnel90: f32=0.5+2.0*VdotH*VdotH*roughness;var fresnel: f32 = -(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) * -(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;} -#ifdef SS_TRANSLUCENCY -fn transmittanceBRDF_Burley(tintColor: vec3f,diffusionDistance: vec3f,thickness: f32)->vec3f {var S: vec3f=1./maxEpsVec3(diffusionDistance);var temp: vec3f=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);} -fn computeWrappedDiffuseNdotL(NdotL: f32,w: f32)->f32 {var t: f32=1.0+w;var invt2: f32=1.0/(t*t);return saturate((NdotL+w)*invt2);} -#endif -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=r); diff --git a/assets/pbrBRDFFunctions-DaHwCtNC.js b/assets/pbrBRDFFunctions-DaHwCtNC.js deleted file mode 100644 index 496b2e2f03869856bb9442be9eb011556fafcce5..0000000000000000000000000000000000000000 --- a/assets/pbrBRDFFunctions-DaHwCtNC.js +++ /dev/null @@ -1,169 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const t="pbrBRDFFunctions",o=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 -#define BRDF_DIFFUSE_MODEL_EON 0 -#define BRDF_DIFFUSE_MODEL_BURLEY 1 -#define BRDF_DIFFUSE_MODEL_LAMBERT 2 -#define BRDF_DIFFUSE_MODEL_LEGACY 3 -#define DIELECTRIC_SPECULAR_MODEL_GLTF 0 -#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1 -#define CONDUCTOR_SPECULAR_MODEL_GLTF 0 -#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1 -#if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER) -#ifdef MS_BRDF_ENERGY_CONSERVATION -vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);} -#endif -#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR -vec3 getF82Specular(float NdotV,vec3 F0,vec3 edgeTint,float roughness) {const float cos_theta_max=0.142857143; -const float one_minus_cos_theta_max_to_the_fifth=0.462664366; -const float one_minus_cos_theta_max_to_the_sixth=0.396569457; -vec3 white_minus_F0=vec3(1.0)-F0;vec3 b_numerator=(F0+white_minus_F0*one_minus_cos_theta_max_to_the_fifth)*(vec3(1.0)-edgeTint);const float b_denominator=cos_theta_max*one_minus_cos_theta_max_to_the_sixth;const float b_denominator_reciprocal=1.0/b_denominator;vec3 b=b_numerator*b_denominator_reciprocal; -float cos_theta=max(roughness,NdotV);float one_minus_cos_theta=1.0-cos_theta;vec3 offset_from_F0=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0);return clamp(F0+offset_from_F0,0.0,1.0);} -#endif -#ifdef FUZZENVIRONMENTBRDF -vec3 getFuzzBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(perceptualRoughness,NdotV);vec4 brdfLookup=texture2D(environmentFuzzBrdfSampler,UV);const vec2 RiRange=vec2(0.0,0.75);const vec2 ARange =vec2(0.005,0.88);const vec2 BRange =vec2(-0.18,0.002);brdfLookup.r=mix(ARange.x, ARange.y, brdfLookup.r);brdfLookup.g=mix(BRange.x, BRange.y, brdfLookup.g);brdfLookup.b=mix(RiRange.x,RiRange.y,brdfLookup.b);return brdfLookup.rgb;} -#endif -#ifdef ENVIRONMENTBRDF -vec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV); -#ifdef ENVIRONMENTBRDF_RGBD -brdfLookup.rgb=fromRGBD(brdfLookup.rgba); -#endif -return brdfLookup.rgb;} -vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) { -#ifdef BRDF_V_HEIGHT_CORRELATED -vec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y; -#else -vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y; -#endif -return reflectance;} -vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) { -#ifdef BRDF_V_HEIGHT_CORRELATED -vec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0); -#else -vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y; -#endif -return reflectance;} -#endif -/* NOT USED -#if defined(SHEEN) && defined(SHEEN_SOFTER) -float getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness) -{float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));} -#endif -*/ -#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL) -vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness) -{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));} -#endif -#if defined(SHEEN) && defined(ENVIRONMENTBRDF) -/** -* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture. -* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table -*/ -vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;} -#endif -vec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90) -{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);} -float fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90) -{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);} -#ifdef CLEARCOAT -vec3 getR0RemappedForClearCoat(vec3 f0) { -#ifdef CLEARCOAT_DEFAULTIOR -#ifdef MOBILE -return saturate(f0*(f0*0.526868+0.529324)-0.0482256); -#else -return saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998); -#endif -#else -vec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t); -#endif -} -#endif -#ifdef 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 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);} -vec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));} -float getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));} -vec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const 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(-square(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*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;} -vec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;} -float cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR0.0 ? s/max(mu_i,mu_o) : s; -float AF=1.0/(1.0+constant1_FON*sigma); -vec3 f_ss=(rho*RECIPROCAL_PI)*AF*(1.0+sigma*sovertF); -float EFo=E_FON_approx(mu_o,sigma); -float EFi=E_FON_approx(mu_i,sigma); -float avgEF=AF*(1.0+constant2_FON*sigma); -vec3 rho_ms=(rho*rho)*avgEF/(vec3(1.0)-rho*(1.0-avgEF));const float eps=1.0e-7;vec3 f_ms=(rho_ms*RECIPROCAL_PI)*max(eps,1.0-EFo) -* max(eps,1.0-EFi) -/ max(eps,1.0-avgEF);return (f_ss+f_ms);} -#ifdef SS_TRANSLUCENCY -vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);} -float computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);} -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=o); diff --git a/assets/pbrDebug-B24xpn-H.js b/assets/pbrDebug-B24xpn-H.js deleted file mode 100644 index 867705f48151315d5530b863f82a8d65a136740c..0000000000000000000000000000000000000000 --- a/assets/pbrDebug-B24xpn-H.js +++ /dev/null @@ -1,513 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./mainUVVaryingDeclaration-OlWPbGIv.js";import"./shadowsFragmentFunctions-dMCKkVlT.js";const o="pbrFragmentExtraDeclaration",g=`varying vec3 vPositionW; -#if DEBUGMODE>0 -varying vec4 vClipSpacePosition; -#endif -#include[1..7] -#ifdef NORMAL -varying vec3 vNormalW; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vec3 vEnvironmentIrradiance; -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vec4 vColor; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying float vViewDepth; -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=g);const t="subSurfaceScatteringFunctions",E=`bool testLightingForSSS(float diffusionProfile) -{return diffusionProfile<1.;}`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=E);const i="pbrHelperFunctions",u=`#define MINIMUMVARIANCE 0.0005 -float convertRoughnessToAverageSlope(float roughness) -{return square(roughness)+MINIMUMVARIANCE;} -float fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;} -vec2 getAARoughnessFactors(vec3 normalVector) { -#ifdef SPECULARAA -vec3 nDfdx=dFdx(normalVector.xyz);vec3 nDfdy=dFdy(normalVector.xyz);float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);float geometricAlphaGFactor=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2(geometricRoughnessFactor,geometricAlphaGFactor); -#else -return vec2(0.); -#endif -} -#ifdef ANISOTROPIC -#ifdef ANISOTROPIC_LEGACY -vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);} -vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 anisotropicFrameDirection;if (anisotropy>=0.0) {anisotropicFrameDirection=B;} else {anisotropicFrameDirection=T;} -vec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;} -#elif ANISOTROPIC_OPENPBR -vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=alphaG*sqrt(2.0/(1.0+(1.0-anisotropy)*(1.0-anisotropy)));float alphaB=max(alphaT*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);} -#else -vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG,MINIMUMVARIANCE);return vec2(alphaT,alphaB);} -vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 bentNormal=cross(B,V);bentNormal=normalize(cross(bentNormal,B));float a=square(square(1.0-anisotropy*(1.0-roughness)));bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;} -#endif -#endif -#if defined(CLEARCOAT) || defined(SS_REFRACTION) -vec3 cocaLambert(vec3 alpha,float distance) {return exp(-alpha*distance);} -vec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));} -vec3 computeColorAtDistanceInMedia(vec3 color,float distance) {return -log(color)/distance;} -vec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 clearCoatAbsorption=mix(vec3(1.0), -cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness), -clearCoatIntensity);return clearCoatAbsorption;} -#endif -#ifdef MICROSURFACEAUTOMATIC -float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor) -{const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;} -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=u);const r="pbrDirectLightingSetupFunctions",D=`struct preLightingInfo -{vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float LdotV;float roughness;float diffuseRoughness;vec3 surfaceAlbedo; -#ifdef IRIDESCENCE -float iridescenceIntensity; -#endif -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vec3 areaLightDiffuse; -#ifdef SPECULARTERM -vec3 areaLightSpecular;vec4 areaLightFresnel; -#endif -#endif -};preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N,vec3 posW) {preLightingInfo result;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;} -preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=dot(result.L,V);result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;} -preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL; -#ifdef SPECULARTERM -result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H)); -#endif -result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -#include -uniform sampler2D areaLightsLTC1Sampler;uniform sampler2D areaLightsLTC2Sampler;preLightingInfo computeAreaPreLightingInfo(sampler2D ltc1,sampler2D ltc2,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec4 lightData,vec3 halfWidth,vec3 halfHeight,float roughness ) -{preLightingInfo result;result.lightOffset=lightData.xyz-vPosition;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);areaLightData data=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc2,viewDirectionW,vNormal,vPosition,lightData.xyz,halfWidth,halfHeight,roughness); -#ifdef SPECULARTERM -result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular; -#endif -result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;} -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=D);const a="pbrDirectLightingFalloffFunctions",L=`float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range) -{return max(0.,1.0-length(lightOffset)/range);} -float computeDistanceLightFalloff_Physical(float lightDistanceSquared) -{return 1.0/maxEps(lightDistanceSquared);} -float computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange) -{float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);float factor=lightDistanceSquared*inverseSquaredRange;float attenuation=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;} -float computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange) -{ -#ifdef USEPHYSICALLIGHTFALLOFF -return computeDistanceLightFalloff_Physical(lightDistanceSquared); -#elif defined(USEGLTFLIGHTFALLOFF) -return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange); -#else -return computeDistanceLightFalloff_Standard(lightOffset,range); -#endif -} -float computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent) -{float falloff=0.0;float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle) -{falloff=max(0.,pow(cosAngle,exponent));} -return falloff;} -float computeDirectionalLightFalloff_IES(vec3 lightDirection,vec3 directionToLightCenterW,sampler2D iesLightSampler) -{float cosAngle=dot(-lightDirection,directionToLightCenterW);float angle=acos(cosAngle)/PI;return texture2D(iesLightSampler,vec2(angle,0.)).r;} -float computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle) -{const float kMinusLog2ConeAngleIntensityRatio=6.64385618977; -float concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;} -float computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset) -{float cd=dot(-lightDirection,directionToLightCenterW);float falloff=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;} -float computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset) -{ -#ifdef USEPHYSICALLIGHTFALLOFF -return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle); -#elif defined(USEGLTFLIGHTFALLOFF) -return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset); -#else -return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent); -#endif -}`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=L);const n="pbrDirectLightingFunctions",A=`#define CLEARCOATREFLECTANCE90 1.0 -struct lightingInfo -{vec3 diffuse; -#ifdef SS_TRANSLUCENCY -vec3 diffuseTransmission; -#endif -#ifdef SPECULARTERM -vec3 specular; -#endif -#ifdef CLEARCOAT -vec4 clearCoat; -#endif -#ifdef SHEEN -vec3 sheen; -#endif -};float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) { -#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF) -float lightRoughness=lightRadius/lightDistance;float totalRoughness=saturate(lightRoughness+roughness);return totalRoughness; -#else -return roughness; -#endif -} -vec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {return mix(groundColor,lightColor,info.NdotL);} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vec3 computeAreaDiffuseLighting(preLightingInfo info,vec3 lightColor) {return info.areaLightDiffuse*lightColor;} -#endif -vec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {vec3 diffuseTerm=vec3(1.0/PI); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY -diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -vec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo; -#endif -return diffuseTerm*info.attenuation*info.NdotL*lightColor;} -#define inline -vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return toLinearSpace(textureColor);} -#ifdef SS_TRANSLUCENCY -vec3 computeDiffuseTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {vec3 transmittanceNdotL=vec3(0.);float NdotL=absEps(info.NdotLUnclamped); -#ifndef SS_TRANSLUCENCY_LEGACY -if (info.NdotLUnclamped<0.0) { -#endif -float wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);float trAdapt=step(0.,info.NdotLUnclamped);transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt); -#ifndef SS_TRANSLUCENCY_LEGACY -} -vec3 diffuseTerm=vec3(1.0/PI); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY -diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -vec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo; -#endif -#else -float diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness); -#endif -return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;} -#endif -#ifdef SPECULARTERM -vec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 fresnel,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness); -#ifdef IRIDESCENCE -fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity); -#endif -float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG); -#ifdef BRDF_V_HEIGHT_CORRELATED -float smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG); -#else -float smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG); -#endif -vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vec3 computeAreaSpecularLighting(preLightingInfo info,vec3 specularColor,vec3 reflectance0,vec3 reflectance90) {vec3 fresnel=specularColor*info.areaLightFresnel.x*reflectance0+( vec3( 1.0 )-specularColor )*info.areaLightFresnel.y*reflectance90;return specularColor*fresnel*info.areaLightSpecular;} -#endif -#endif -#ifdef FUZZ -float evalFuzz(vec3 L,float NdotL,float NdotV,vec3 T,vec3 B,vec3 ltcLut) -{if (NdotL<=0.0 || NdotV<=0.0) -return 0.0;mat3 M=mat3( -vec3(ltcLut.r,0.0,0.0), -vec3(ltcLut.g,1.0,0.0), -vec3(0.0,0.0,1.0) -);vec3 Llocal=vec3(dot(L,T),dot(L,B),NdotL);vec3 Lwarp=normalize(M*Llocal);float cosThetaWarp=max(Lwarp.z,0.0);return cosThetaWarp*NdotL;} -#endif -#if defined(ANISOTROPIC) && defined(ANISOTROPIC_OPENPBR) -vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=vec3(distribution*smithVisibility);return specTerm*info.attenuation*info.NdotL*lightColor;} -#elif defined(ANISOTROPIC) -vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90); -#ifdef IRIDESCENCE -fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity); -#endif -float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;} -#endif -#ifdef CLEARCOAT -vec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {float NccdotL=saturateEps(dot(Ncc,info.L));float NccdotH=saturateEps(dot(Ncc,info.H));float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);float kelemenVisibility=visibility_Kelemen(info.VdotH);float clearCoatTerm=fresnel*distribution*kelemenVisibility;return vec4( -clearCoatTerm*info.attenuation*NccdotL*lightColor, -1.0-fresnel -);} -vec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);float NdotLRefract=saturateEps(dot(Ncc,LRefract));vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;} -#endif -#ifdef SHEEN -vec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);float fresnel=1.;float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER -float visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG); -#else */ -float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */ -float sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;} -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=A);const l="pbrIBLFunctions",h=`#if defined(REFLECTION) || defined(SS_REFRACTION) -float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;} -float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;} -#endif -#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION) -float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);} -#endif -#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION) -float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);} -#endif -#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA) -#define UNPACK_LOD(x) (1.0-x)*255.0 -float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);} -#endif -`;e.IncludesShadersStore[l]||(e.IncludesShadersStore[l]=h);const f="pbrBlockNormalGeometric",C=`vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); -#ifdef NORMAL -vec3 normalW=normalize(vNormalW); -#else -vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w; -#endif -vec3 geometricNormalW=normalW; -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW; -#endif -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=C);const c="pbrBlockImageProcessing",S=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING) -#if !defined(SKIPFINALCOLORCLAMP) -finalColor.rgb=clamp(finalColor.rgb,0.,30.0); -#endif -#else -finalColor=applyImageProcessing(finalColor); -#endif -finalColor.a*=visibility; -#ifdef PREMULTIPLYALPHA -finalColor.rgb*=finalColor.a; -#endif -`;e.IncludesShadersStore[c]||(e.IncludesShadersStore[c]=S);const s="pbrBlockPrePass",v=`#if SCENE_MRT_COUNT>0 -float writeGeometryInfo=finalColor.a>ALPHATESTVALUE ? 1.0 : 0.0; -#ifdef PREPASS_POSITION -gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo); -#endif -#ifdef PREPASS_LOCAL_POSITION -gl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo); -#endif -#if defined(PREPASS_VELOCITY) -vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo); -#elif defined(PREPASS_VELOCITY_LINEAR) -vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO -gl_FragData[PREPASS_ALBEDO_INDEX]=vec4(surfaceAlbedo,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -vec3 sqAlbedo=sqrt(surfaceAlbedo); -#endif -#ifdef PREPASS_IRRADIANCE -vec3 irradiance=finalDiffuse; -#ifndef UNLIT -#ifdef REFLECTION -irradiance+=finalIrradiance; -#endif -#endif -#ifdef SS_SCATTERING -#ifdef PREPASS_COLOR -gl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb-irradiance,finalColor.a); -#endif -irradiance/=sqAlbedo; -#else -#ifdef PREPASS_COLOR -gl_FragData[PREPASS_COLOR_INDEX]=finalColor; -#endif -float scatteringDiffusionProfile=255.; -#endif -gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); -#elif defined(PREPASS_COLOR) -gl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb,finalColor.a); -#endif -#ifdef PREPASS_DEPTH -gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_SCREENSPACE_DEPTH -gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -gl_FragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4(vNormViewDepth,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMAL -#ifdef PREPASS_NORMAL_WORLDSPACE -gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo); -#else -gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); -#endif -#endif -#ifdef PREPASS_WORLD_NORMAL -gl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); -#endif -#ifdef PREPASS_REFLECTIVITY -#ifndef UNLIT -gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularEnvironmentR0,microSurface)*writeGeometryInfo; -#else -gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo; -#endif -#endif -#endif -`;e.IncludesShadersStore[s]||(e.IncludesShadersStore[s]=v);const d="pbrDebug",O=`#if DEBUGMODE>0 -if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) { -#if DEBUGMODE==1 -gl_FragColor.rgb=vPositionW.rgb; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==2 && defined(NORMAL) -gl_FragColor.rgb=vNormalW.rgb; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC) -gl_FragColor.rgb=TBN[0]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC) -gl_FragColor.rgb=TBN[1]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==5 -gl_FragColor.rgb=normalW; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==6 && defined(MAINUV1) -gl_FragColor.rgb=vec3(vMainUV1,0.0); -#elif DEBUGMODE==7 && defined(MAINUV2) -gl_FragColor.rgb=vec3(vMainUV2,0.0); -#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP) -gl_FragColor.rgb=clearcoatOut.TBNClearCoat[0]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP) -gl_FragColor.rgb=clearcoatOut.TBNClearCoat[1]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==10 && defined(CLEARCOAT) -gl_FragColor.rgb=clearcoatOut.clearCoatNormalW; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==11 && defined(ANISOTROPIC) -gl_FragColor.rgb=anisotropicOut.anisotropicNormal; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==12 && defined(ANISOTROPIC) -gl_FragColor.rgb=anisotropicOut.anisotropicTangent; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==13 && defined(ANISOTROPIC) -gl_FragColor.rgb=anisotropicOut.anisotropicBitangent; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==20 && defined(ALBEDO) -gl_FragColor.rgb=albedoTexture.rgb; -#ifndef GAMMAALBEDO -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==21 && defined(AMBIENT) -gl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb; -#elif DEBUGMODE==22 && defined(OPACITY) -gl_FragColor.rgb=opacityMap.rgb; -#elif DEBUGMODE==23 && defined(EMISSIVE) -gl_FragColor.rgb=emissiveColorTex.rgb; -#ifndef GAMMAEMISSIVE -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==24 && defined(LIGHTMAP) -gl_FragColor.rgb=lightmapColor.rgb; -#ifndef GAMMALIGHTMAP -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW) -gl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb; -#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW) -gl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE) -gl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0); -#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -gl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb; -#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE) -gl_FragColor.rgb=sheenOut.sheenMapData.rgb; -#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE) -gl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb; -#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE) -gl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb; -#elif DEBUGMODE==32 && defined(BUMP) -gl_FragColor.rgb=texture2D(bumpSampler,vBumpUV).rgb; -#elif DEBUGMODE==40 && defined(SS_REFRACTION) -gl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==41 && defined(REFLECTION) -gl_FragColor.rgb=reflectionOut.environmentRadiance.rgb; -#ifndef GAMMAREFLECTION -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION) -gl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==50 -gl_FragColor.rgb=diffuseBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==51 && defined(SPECULARTERM) -gl_FragColor.rgb=specularBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==52 && defined(CLEARCOAT) -gl_FragColor.rgb=clearCoatBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==53 && defined(SHEEN) -gl_FragColor.rgb=sheenBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==54 && defined(REFLECTION) -gl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb; -#ifndef GAMMAREFLECTION -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==60 -gl_FragColor.rgb=surfaceAlbedo.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==61 -gl_FragColor.rgb=clearcoatOut.specularEnvironmentR0; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==62 && defined(METALLICWORKFLOW) -gl_FragColor.rgb=vec3(reflectivityOut.metallic); -#elif DEBUGMODE==71 && defined(METALLICWORKFLOW) -gl_FragColor.rgb=reflectivityOut.metallicF0; -#elif DEBUGMODE==63 -gl_FragColor.rgb=vec3(roughness); -#elif DEBUGMODE==64 -gl_FragColor.rgb=vec3(alphaG); -#elif DEBUGMODE==65 -gl_FragColor.rgb=vec3(NdotV); -#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) -gl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==67 && defined(CLEARCOAT) -gl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness); -#elif DEBUGMODE==68 && defined(CLEARCOAT) -gl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV); -#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY) -gl_FragColor.rgb=subSurfaceOut.transmittance; -#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION) -gl_FragColor.rgb=subSurfaceOut.refractionTransmittance; -#elif DEBUGMODE==72 -gl_FragColor.rgb=vec3(microSurface); -#elif DEBUGMODE==73 -gl_FragColor.rgb=vAlbedoColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW) -gl_FragColor.rgb=vReflectivityColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==75 -gl_FragColor.rgb=vEmissiveColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION) -gl_FragColor.rgb=vec3(seo); -#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -gl_FragColor.rgb=vec3(eho); -#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION) -gl_FragColor.rgb=vec3(energyConservationFactor); -#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -gl_FragColor.rgb=baseSpecularEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -gl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION) -gl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==86 && defined(ALPHABLEND) -gl_FragColor.rgb=vec3(luminanceOverAlpha); -#elif DEBUGMODE==87 -gl_FragColor.rgb=vec3(alpha); -#elif DEBUGMODE==88 && defined(ALBEDO) -gl_FragColor.rgb=vec3(albedoTexture.a); -#elif DEBUGMODE==89 -gl_FragColor.rgb=aoOut.ambientOcclusionColor.rgb; -#else -float stripeWidth=30.;float stripePos=floor(gl_FragCoord.x/stripeWidth);float whichColor=mod(stripePos,2.);vec3 color1=vec3(.6,.2,.2);vec3 color2=vec3(.3,.1,.1);gl_FragColor.rgb=mix(color1,color2,whichColor); -#endif -gl_FragColor.rgb*=vDebugMode.y; -#ifdef DEBUGMODE_NORMALIZE -gl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5; -#endif -#ifdef DEBUGMODE_GAMMA -gl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb); -#endif -gl_FragColor.a=1.0; -#ifdef PREPASS -gl_FragData[0]=toLinearSpace(gl_FragColor); -gl_FragData[1]=vec4(0.,0.,0.,0.); -#endif -#ifdef DEBUGMODE_FORCERETURN -return; -#endif -} -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=O); diff --git a/assets/pbrDebug-C5bjipRB.js b/assets/pbrDebug-C5bjipRB.js deleted file mode 100644 index 4dc0062f26a3147fe8fa757dd695b627d73afdc7..0000000000000000000000000000000000000000 --- a/assets/pbrDebug-C5bjipRB.js +++ /dev/null @@ -1,669 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./mainUVVaryingDeclaration-Nm5IuqWV.js";import"./shadowsFragmentFunctions-CHKo52s6.js";const i="pbrFragmentExtraDeclaration",E=`varying vPositionW: vec3f; -#if DEBUGMODE>0 -varying vClipSpacePosition: vec4f; -#endif -#include[1..7] -#ifdef NORMAL -varying vNormalW: vec3f; -#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX) -varying vEnvironmentIrradiance: vec3f; -#endif -#endif -#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -varying vColor: vec4f; -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -varying vViewDepth: f32; -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=E);const t="subSurfaceScatteringFunctions",g=`fn testLightingForSSS(diffusionProfile: f32)->bool -{return diffusionProfile<1.;}`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=g);const f="pbrHelperFunctions",v=`#define MINIMUMVARIANCE 0.0005 -fn convertRoughnessToAverageSlope(roughness: f32)->f32 -{return roughness*roughness+MINIMUMVARIANCE;} -fn fresnelGrazingReflectance(reflectance0: f32)->f32 {var reflectance90: f32=saturate(reflectance0*25.0);return reflectance90;} -fn getAARoughnessFactors(normalVector: vec3f)->vec2f { -#ifdef SPECULARAA -var nDfdx: vec3f=dpdx(normalVector.xyz);var nDfdy: vec3f=dpdy(normalVector.xyz);var slopeSquare: f32=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));var geometricRoughnessFactor: f32=pow(saturate(slopeSquare),0.333);var geometricAlphaGFactor: f32=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2f(geometricRoughnessFactor,geometricAlphaGFactor); -#else -return vec2f(0.); -#endif -} -#ifdef ANISOTROPIC -#ifdef ANISOTROPIC_LEGACY -fn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2f(alphaT,alphaB);} -fn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var anisotropicFrameDirection: vec3f=select(T,B,anisotropy>=0.0);var anisotropicFrameTangent: vec3f=cross(normalize(anisotropicFrameDirection),V);var anisotropicFrameNormal: vec3f=cross(anisotropicFrameTangent,anisotropicFrameDirection);var anisotropicNormal: vec3f=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;} -#elif ANISOTROPIC_OPENPBR -fn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=alphaG*sqrt(2.0/(1.0+(1.0-anisotropy)*(1.0-anisotropy)));var alphaB: f32=max(alphaT*(1.0-anisotropy),MINIMUMVARIANCE);return vec2f(alphaT,alphaB);} -#else -fn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG,MINIMUMVARIANCE);return vec2f(alphaT,alphaB);} -fn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var bentNormal: vec3f=cross(B,V);bentNormal=normalize(cross(bentNormal,B));var sq=1.0-anisotropy*(1.0-roughness);var a: f32=sq*sq*sq*sq;bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;} -#endif -#endif -#if defined(CLEARCOAT) || defined(SS_REFRACTION) -fn cocaLambertVec3(alpha: vec3f,distance: f32)->vec3f {return exp(-alpha*distance);} -fn cocaLambert(NdotVRefract: f32,NdotLRefract: f32,alpha: vec3f,thickness: f32)->vec3f {return cocaLambertVec3(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));} -fn computeColorAtDistanceInMedia(color: vec3f,distance: f32)->vec3f {return -log(color)/distance;} -fn computeClearCoatAbsorption(NdotVRefract: f32,NdotLRefract: f32,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var clearCoatAbsorption: vec3f=mix( vec3f(1.0), -cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness), -clearCoatIntensity);return clearCoatAbsorption;} -#endif -#ifdef MICROSURFACEAUTOMATIC -fn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32 -{const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;} -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=v);const r="pbrDirectLightingSetupFunctions",L=`struct preLightingInfo -{lightOffset: vec3f, -lightDistanceSquared: f32, -lightDistance: f32, -attenuation: f32, -L: vec3f, -H: vec3f, -NdotV: f32, -NdotLUnclamped: f32, -NdotL: f32, -VdotH: f32, -LdotV: f32, -roughness: f32, -diffuseRoughness: f32, -surfaceAlbedo: vec3f, -#ifdef IRIDESCENCE -iridescenceIntensity: f32 -#endif -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -areaLightDiffuse: vec3f, -#ifdef SPECULARTERM -areaLightSpecular: vec3f, -areaLightFresnel: vec4f -#endif -#endif -};fn computePointAndSpotPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f,posW: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;} -fn computeDirectionalPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=dot(result.L,V);return result;} -fn computeHemisphericPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL; -#ifdef SPECULARTERM -result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H)); -#endif -return result;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -#include -var areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d;fn computeAreaPreLightingInfo(ltc1: texture_2d,ltc1Sampler:sampler,ltc2:texture_2d,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightCenter:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->preLightingInfo {var result: preLightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightCenter,halfWidth,halfHeight,roughness); -#ifdef SPECULARTERM -result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular; -#endif -result.areaLightDiffuse+=data.Diffuse;return result;} -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=L);const o="pbrDirectLightingFalloffFunctions",h=`fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32 -{return max(0.,1.0-length(lightOffset)/range);} -fn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32 -{return 1.0/maxEps(lightDistanceSquared);} -fn computeDistanceLightFalloff_GLTF(lightDistanceSquared: f32,inverseSquaredRange: f32)->f32 -{var lightDistanceFalloff: f32=1.0/maxEps(lightDistanceSquared);var factor: f32=lightDistanceSquared*inverseSquaredRange;var attenuation: f32=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;} -fn computeDirectionalLightFalloff_IES(lightDirection: vec3f,directionToLightCenterW: vec3f,iesLightTexture: texture_2d,iesLightTextureSampler: sampler)->f32 -{var cosAngle: f32=dot(-lightDirection,directionToLightCenterW);var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;} -fn computeDistanceLightFalloff(lightOffset: vec3f,lightDistanceSquared: f32,range: f32,inverseSquaredRange: f32)->f32 -{ -#ifdef USEPHYSICALLIGHTFALLOFF -return computeDistanceLightFalloff_Physical(lightDistanceSquared); -#elif defined(USEGLTFLIGHTFALLOFF) -return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange); -#else -return computeDistanceLightFalloff_Standard(lightOffset,range); -#endif -} -fn computeDirectionalLightFalloff_Standard(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32)->f32 -{var falloff: f32=0.0;var cosAngle: f32=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle) -{falloff=max(0.,pow(cosAngle,exponent));} -return falloff;} -fn computeDirectionalLightFalloff_Physical(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32)->f32 -{const kMinusLog2ConeAngleIntensityRatio: f32=6.64385618977; -var concentrationKappa: f32=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);var lightDirectionSpreadSG: vec4f= vec4f(-lightDirection*concentrationKappa,-concentrationKappa);var falloff: f32=exp2(dot( vec4f(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;} -fn computeDirectionalLightFalloff_GLTF(lightDirection: vec3f,directionToLightCenterW: vec3f,lightAngleScale: f32,lightAngleOffset: f32)->f32 -{var cd: f32=dot(-lightDirection,directionToLightCenterW);var falloff: f32=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;} -fn computeDirectionalLightFalloff(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32,lightAngleScale: f32,lightAngleOffset: f32)->f32 -{ -#ifdef USEPHYSICALLIGHTFALLOFF -return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle); -#elif defined(USEGLTFLIGHTFALLOFF) -return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset); -#else -return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent); -#endif -}`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=h);const n="pbrBlockReflectance0",p=`var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90; -#ifdef ALPHAFRESNEL -var reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90; -#endif -`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=p);const a="pbrDirectLightingFunctions",D=`#define CLEARCOATREFLECTANCE90 1.0 -struct lightingInfo -{diffuse: vec3f, -#ifdef SS_TRANSLUCENCY -diffuseTransmission: vec3f, -#endif -#ifdef SPECULARTERM -specular: vec3f, -#endif -#ifdef CLEARCOAT -clearCoat: vec4f, -#endif -#ifdef SHEEN -sheen: vec3f -#endif -};fn adjustRoughnessFromLightProperties(roughness: f32,lightRadius: f32,lightDistance: f32)->f32 { -#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF) -var lightRoughness: f32=lightRadius/lightDistance;var totalRoughness: f32=saturate(lightRoughness+roughness);return totalRoughness; -#else -return roughness; -#endif -} -fn computeHemisphericDiffuseLighting(info: preLightingInfo,lightColor: vec3f,groundColor: vec3f)->vec3f {return mix(groundColor,lightColor,info.NdotL);} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -fn computeAreaDiffuseLighting(info: preLightingInfo,lightColor: vec3f)->vec3f {return info.areaLightDiffuse*lightColor;} -#endif -fn computeDiffuseLighting(info: preLightingInfo,lightColor: vec3f)->vec3f {var diffuseTerm: vec3f=vec3f(1.0/PI); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY -diffuseTerm=vec3f(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseTerm=vec3f(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -var clampedAlbedo: vec3f=clamp(info.surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo; -#endif -return diffuseTerm*info.attenuation*info.NdotL*lightColor;} -fn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f{var strq: vec4f=textureProjectionMatrix* vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return toLinearSpaceVec3(textureColor);} -#ifdef SS_TRANSLUCENCY -fn computeDiffuseTransmittedLighting(info: preLightingInfo,lightColor: vec3f,transmittance: vec3f)->vec3f {var transmittanceNdotL=vec3f(0.0);var NdotL: f32=absEps(info.NdotLUnclamped); -#ifndef SS_TRANSLUCENCY_LEGACY -if (info.NdotLUnclamped<0.0) { -#endif -var wrapNdotL: f32=computeWrappedDiffuseNdotL(NdotL,0.02);var trAdapt: f32=step(0.,info.NdotLUnclamped);transmittanceNdotL=mix(transmittance*wrapNdotL, vec3f(wrapNdotL),trAdapt); -#ifndef SS_TRANSLUCENCY_LEGACY -} -var diffuseTerm : vec3f=vec3f(1.0/PI); -#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY -diffuseTerm=vec3f(diffuseBRDF_Burley( -info.NdotL,info.NdotV,info.VdotH,info.roughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY -diffuseTerm=vec3f(diffuseBRDF_Burley( -info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness)); -#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON -var clampedAlbedo: vec3f=clamp(info.surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness, -info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo; -#endif -return (transmittanceNdotL*diffuseTerm)*info.attenuation*lightColor; -#else -let diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor; -#endif -} -#endif -#ifdef SPECULARTERM -fn computeSpecularLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,fresnel: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var modifiedFresnel: vec3f=fresnel; -#ifdef IRIDESCENCE -modifiedFresnel=mix(fresnel,reflectance0,info.iridescenceIntensity); -#endif -var distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG); -#ifdef BRDF_V_HEIGHT_CORRELATED -var smithVisibility: f32=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG); -#else -var smithVisibility: f32=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG); -#endif -var specTerm: vec3f=modifiedFresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;} -#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -fn computeAreaSpecularLighting(info: preLightingInfo,specularColor: vec3f,reflectance0: vec3f,reflectance90: vec3f)->vec3f {var fresnel:vec3f =reflectance0*specularColor*info.areaLightFresnel.x+( vec3f( 1.0 )-specularColor )*info.areaLightFresnel.y*reflectance90;return specularColor*fresnel*info.areaLightSpecular;} -#endif -#endif -#ifdef FUZZ -fn evalFuzz(L: vec3f,NdotL: f32,NdotV: f32,T: vec3f,B: vec3f,ltcLut: vec3f)->f32 -{if (NdotL<=0.0f || NdotV<=0.0f) {return 0.0f;} -let M=mat3x3f( -vec3f(ltcLut.r,0.0f,0.0f), -vec3f(ltcLut.g,1.0f,0.0f), -vec3f(0.0f,0.0f,1.0f) -);let Llocal: vec3f=vec3f(dot(L,T),dot(L,B),NdotL);let Lwarp: vec3f=normalize(M*Llocal);let cosThetaWarp: f32=max(Lwarp.z,0.0f);return cosThetaWarp*NdotL;} -#endif -#if defined(ANISOTROPIC) && defined(ANISOTROPIC_OPENPBR) -fn computeAnisotropicSpecularLighting(info: preLightingInfo,V: vec3f,N: vec3f,T: vec3f,B: vec3f,anisotropy: f32,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var TdotH: f32=dot(T,info.H);var BdotH: f32=dot(B,info.H);var TdotV: f32=dot(T,V);var BdotV: f32=dot(B,V);var TdotL: f32=dot(T,info.L);var BdotL: f32=dot(B,info.L);var alphaG: f32=convertRoughnessToAverageSlope(info.roughness);var alphaTB: vec2f=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,vec2f(geometricRoughnessFactor*geometricRoughnessFactor));var distribution: f32=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);var smithVisibility: f32=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);var specTerm: vec3f=vec3f(distribution*smithVisibility);return specTerm*info.attenuation*info.NdotL*lightColor;} -#elif defined(ANISOTROPIC) -fn computeAnisotropicSpecularLighting(info: preLightingInfo,V: vec3f,N: vec3f,T: vec3f,B: vec3f,anisotropy: f32,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var TdotH: f32=dot(T,info.H);var BdotH: f32=dot(B,info.H);var TdotV: f32=dot(T,V);var BdotV: f32=dot(B,V);var TdotL: f32=dot(T,info.L);var BdotL: f32=dot(B,info.L);var alphaG: f32=convertRoughnessToAverageSlope(info.roughness);var alphaTB: vec2f=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,vec2f(geometricRoughnessFactor*geometricRoughnessFactor));var fresnel: vec3f=fresnelSchlickGGXVec3(info.VdotH,reflectance0,reflectance90); -#ifdef IRIDESCENCE -fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity); -#endif -var distribution: f32=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);var smithVisibility: f32=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);var specTerm: vec3f=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;} -#endif -#ifdef CLEARCOAT -fn computeClearCoatLighting(info: preLightingInfo,Ncc: vec3f,geometricRoughnessFactor: f32,clearCoatIntensity: f32,lightColor: vec3f)->vec4f {var NccdotL: f32=saturateEps(dot(Ncc,info.L));var NccdotH: f32=saturateEps(dot(Ncc,info.H));var clearCoatRoughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness);var fresnel: f32=fresnelSchlickGGX(info.VdotH,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;var distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);var kelemenVisibility: f32=visibility_Kelemen(info.VdotH);var clearCoatTerm: f32=fresnel*distribution*kelemenVisibility;return vec4f( -clearCoatTerm*info.attenuation*NccdotL*lightColor, -1.0-fresnel -);} -fn computeClearCoatLightingAbsorption(NdotVRefract: f32,L: vec3f,Ncc: vec3f,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var LRefract: vec3f=-refract(L,Ncc,uniforms.vClearCoatRefractionParams.y);var NdotLRefract: f32=saturateEps(dot(Ncc,LRefract));var absorption: vec3f=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;} -#endif -#ifdef SHEEN -fn computeSheenLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var fresnel: f32=1.;var distribution: f32=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER -var visibility: f32=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG); -#else */ -var visibility: f32=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */ -var sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;} -#endif -#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 -#include -fn computeClusteredLighting( -lightDataTexture: texture_2d, -tileMaskBuffer: ptr>, -lightData: vec4f, -sliceRange: vec2u, -V: vec3f, -N: vec3f, -posW: vec3f, -surfaceAlbedo: vec3f, -reflectivityOut: reflectivityOutParams, -#ifdef IRIDESCENCE -iridescenceIntensity: f32, -#endif -#ifdef SS_TRANSLUCENCY -subSurfaceOut: subSurfaceOutParams, -#endif -#ifdef SPECULARTERM -AARoughnessFactor: f32, -#endif -#ifdef ANISOTROPIC -anisotropicOut: anisotropicOutParams, -#endif -#ifdef SHEEN -sheenOut: sheenOutParams, -#endif -#ifdef CLEARCOAT -clearcoatOut: clearcoatOutParams, -#endif -)->lightingInfo {let NdotV=absEps(dot(N,V)); -#include -#ifdef CLEARCOAT -specularEnvironmentR0=clearcoatOut.specularEnvironmentR0; -#endif -var result: lightingInfo;let tilePosition=vec2u(fragmentInputs.position.xy*lightData.xy);let maskResolution=vec2u(lightData.zw);var tileIndex=(tilePosition.x*maskResolution.x+tilePosition.y)*maskResolution.y;let batchRange=sliceRange/CLUSTLIGHT_BATCH;var batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tileIndex+=batchRange.x;for (var i=batchRange.x; i<=batchRange.y; i+=1) {var mask=tileMaskBuffer[tileIndex];tileIndex+=1;let maskOffset=max(sliceRange.x,batchOffset)-batchOffset; -let maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while mask != 0 {let trailing=firstTrailingBit(mask);mask ^= 1u<=0.0 {preInfo.attenuation*=computeDirectionalLightFalloff(light.vLightDirection.xyz,preInfo.L,light.vLightDirection.w,light.vLightData.w,light.vLightFalloff.z,light.vLightFalloff.w);} -preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo; -#ifdef IRIDESCENCE -preInfo.iridescenceIntensity=iridescenceIntensity; -#endif -var info: lightingInfo; -#ifdef SS_TRANSLUCENCY -#ifdef SS_TRANSLUCENCY_LEGACY -info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0); -#else -info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance); -#endif -#else -info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb); -#endif -#ifdef SPECULARTERM -#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR -let metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);let coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic); -#else -let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90); -#endif -#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION -let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel); -#endif -#ifdef ANISOTROPIC -info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb); -#else -info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb); -#endif -#endif -#ifdef SHEEN -#ifdef SHEEN_LINKWITHALBEDO -preInfo.roughness=sheenOut.sheenIntensity; -#else -preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance); -#endif -info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb); -#endif -#ifdef CLEARCOAT -preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb); -#ifdef CLEARCOAT_TINT -let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=absorption; -#endif -#ifdef SPECULARTERM -info.specular*=absorption; -#endif -#endif -info.diffuse*=info.clearCoat.w; -#ifdef SS_TRANSLUCENCY -info.diffuseTransmission*=info.clearCoat.w; -#endif -#ifdef SPECULARTERM -info.specular*=info.clearCoat.w; -#endif -#ifdef SHEEN -info.sheen*=info.clearCoat.w; -#endif -#endif -result.diffuse+=info.diffuse; -#ifdef SS_TRANSLUCENCY -result.diffuseTransmission+=info.diffuseTransmission; -#endif -#ifdef SPECULARTERM -result.specular+=info.specular; -#endif -#ifdef CLEARCOAT -result.clearCoat+=info.clearCoat; -#endif -#ifdef SHEEN -result.sheen+=info.sheen; -#endif -} -batchOffset+=CLUSTLIGHT_BATCH;} -return result;} -#endif -`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=D);const c="pbrIBLFunctions",S=`#if defined(REFLECTION) || defined(SS_REFRACTION) -fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;} -fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;} -#endif -#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION) -fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);} -#endif -#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION) -fn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;} -#endif -#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA) -fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;} -fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);} -#endif -`;e.IncludesShadersStoreWGSL[c]||(e.IncludesShadersStoreWGSL[c]=S);const l="pbrBlockNormalGeometric",m=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW); -#ifdef NORMAL -var normalW: vec3f=normalize(input.vNormalW); -#else -var normalW: vec3f=normalize(cross(dpdx(input.vPositionW),dpdy(input.vPositionW)))*scene.vEyePosition.w; -#endif -var geometricNormalW: vec3f=normalW; -#if defined(TWOSIDEDLIGHTING) && defined(NORMAL) -geometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing); -#endif -`;e.IncludesShadersStoreWGSL[l]||(e.IncludesShadersStoreWGSL[l]=m);const s="pbrBlockImageProcessing",A=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING) -#if !defined(SKIPFINALCOLORCLAMP) -finalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a); -#endif -#else -finalColor=applyImageProcessing(finalColor); -#endif -finalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility); -#ifdef PREMULTIPLYALPHA -finalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);; -#endif -`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=A);const d="pbrBlockPrePass",O=`#if SCENE_MRT_COUNT>0 -var writeGeometryInfo: f32=select(0.0,1.0,finalColor.a>ALPHATESTVALUE);var fragData: array,SCENE_MRT_COUNT>; -#ifdef PREPASS_POSITION -fragData[PREPASS_POSITION_INDEX]= vec4f(fragmentInputs.vPositionW,writeGeometryInfo); -#endif -#ifdef PREPASS_LOCAL_POSITION -fragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo); -#endif -#ifdef PREPASS_VELOCITY -var a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo); -#elif defined(PREPASS_VELOCITY_LINEAR) -var velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) - -(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO -fragData[PREPASS_ALBEDO_INDEX]=vec4f(surfaceAlbedo,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -var sqAlbedo : vec3f=sqrt(surfaceAlbedo); -#endif -#ifdef PREPASS_IRRADIANCE -var irradiance : vec3f=finalDiffuse; -#ifndef UNLIT -#ifdef REFLECTION -irradiance+=finalIrradiance; -#endif -#endif -#ifdef SS_SCATTERING -#ifdef PREPASS_COLOR -fragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb-irradiance,finalColor.a); -#endif -irradiance/=sqAlbedo;fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo*uniforms.scatteringDiffusionProfile/255.); -#else -#ifdef PREPASS_COLOR -fragData[PREPASS_COLOR_INDEX]=finalColor; -#endif -fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo); -#endif -#elif defined(PREPASS_COLOR) -fragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb,finalColor.a); -#endif -#ifdef PREPASS_DEPTH -fragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_SCREENSPACE_DEPTH -fragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -fragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo); -#endif -#ifdef PREPASS_NORMAL -#ifdef PREPASS_NORMAL_WORLDSPACE -fragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo); -#else -fragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo); -#endif -#endif -#ifdef PREPASS_WORLD_NORMAL -fragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo); -#endif -#ifdef PREPASS_ALBEDO_SQRT -fragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqAlbedo,writeGeometryInfo); -#endif -#ifdef PREPASS_REFLECTIVITY -#ifndef UNLIT -fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(specularEnvironmentR0,microSurface)*writeGeometryInfo; -#else -fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(0.0,0.0,0.0,1.0)*writeGeometryInfo; -#endif -#endif -#if SCENE_MRT_COUNT>0 -fragmentOutputs.fragData0=fragData[0]; -#endif -#if SCENE_MRT_COUNT>1 -fragmentOutputs.fragData1=fragData[1]; -#endif -#if SCENE_MRT_COUNT>2 -fragmentOutputs.fragData2=fragData[2]; -#endif -#if SCENE_MRT_COUNT>3 -fragmentOutputs.fragData3=fragData[3]; -#endif -#if SCENE_MRT_COUNT>4 -fragmentOutputs.fragData4=fragData[4]; -#endif -#if SCENE_MRT_COUNT>5 -fragmentOutputs.fragData5=fragData[5]; -#endif -#if SCENE_MRT_COUNT>6 -fragmentOutputs.fragData6=fragData[6]; -#endif -#if SCENE_MRT_COUNT>7 -fragmentOutputs.fragData7=fragData[7]; -#endif -#endif -`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=O);const u="pbrDebug",C=`#if DEBUGMODE>0 -if (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f; -#if DEBUGMODE==1 -color=fragmentInputs.vPositionW.rgb; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==2 && defined(NORMAL) -color=fragmentInputs.vNormalW.rgb; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC) -color=TBN[0]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC) -color=TBN[1]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==5 -color=normalW; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==6 && defined(MAINUV1) -color= vec3f(input.vMainUV1,0.0); -#elif DEBUGMODE==7 && defined(MAINUV2) -color= vec3f(input.vMainUV2,0.0); -#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP) -color=clearcoatOut.TBNClearCoat[0]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP) -color=clearcoatOut.TBNClearCoat[1]; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==10 && defined(CLEARCOAT) -color=clearcoatOut.clearCoatNormalW; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==11 && defined(ANISOTROPIC) -color=anisotropicOut.anisotropicNormal; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==12 && defined(ANISOTROPIC) -color=anisotropicOut.anisotropicTangent; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==13 && defined(ANISOTROPIC) -color=anisotropicOut.anisotropicBitangent; -#define DEBUGMODE_NORMALIZE -#elif DEBUGMODE==20 && defined(ALBEDO) -color=albedoTexture.rgb; -#ifndef GAMMAALBEDO -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==21 && defined(AMBIENT) -color=aoOut.ambientOcclusionColorMap.rgb; -#elif DEBUGMODE==22 && defined(OPACITY) -color=opacityMap.rgb; -#elif DEBUGMODE==23 && defined(EMISSIVE) -color=emissiveColorTex.rgb; -#ifndef GAMMAEMISSIVE -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==24 && defined(LIGHTMAP) -color=lightmapColor; -#ifndef GAMMALIGHTMAP -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW) -color=reflectivityOut.surfaceMetallicColorMap.rgb; -#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW) -color=reflectivityOut.surfaceReflectivityColorMap.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE) -color= vec3f(clearcoatOut.clearCoatMapData.rg,0.0); -#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE) -color=clearcoatOut.clearCoatTintMapData.rgb; -#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE) -color=sheenOut.sheenMapData.rgb; -#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE) -color=anisotropicOut.anisotropyMapData.rgb; -#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE) -color=subSurfaceOut.thicknessMap.rgb; -#elif DEBUGMODE==32 && defined(BUMP) -color=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).rgb; -#elif DEBUGMODE==40 && defined(SS_REFRACTION) -color=subSurfaceOut.environmentRefraction.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==41 && defined(REFLECTION) -color=reflectionOut.environmentRadiance.rgb; -#ifndef GAMMAREFLECTION -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION) -color=clearcoatOut.environmentClearCoatRadiance.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==50 -color=diffuseBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==51 && defined(SPECULARTERM) -color=specularBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==52 && defined(CLEARCOAT) -color=clearCoatBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==53 && defined(SHEEN) -color=sheenBase.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==54 && defined(REFLECTION) -color=reflectionOut.environmentIrradiance.rgb; -#ifndef GAMMAREFLECTION -#define DEBUGMODE_GAMMA -#endif -#elif DEBUGMODE==60 -color=surfaceAlbedo.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==61 -color=clearcoatOut.specularEnvironmentR0; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==62 && defined(METALLICWORKFLOW) -color= vec3f(reflectivityOut.metallic); -#elif DEBUGMODE==71 && defined(METALLICWORKFLOW) -color=reflectivityOut.metallicF0; -#elif DEBUGMODE==63 -color= vec3f(roughness); -#elif DEBUGMODE==64 -color= vec3f(alphaG); -#elif DEBUGMODE==65 -color= vec3f(NdotV); -#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) -color=clearcoatOut.clearCoatColor; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==67 && defined(CLEARCOAT) -color= vec3f(clearcoatOut.clearCoatRoughness); -#elif DEBUGMODE==68 && defined(CLEARCOAT) -color= vec3f(clearcoatOut.clearCoatNdotV); -#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY) -color=subSurfaceOut.transmittance; -#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION) -color=subSurfaceOut.refractionTransmittance; -#elif DEBUGMODE==72 -color= vec3f(microSurface); -#elif DEBUGMODE==73 -color=uniforms.vAlbedoColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW) -color=uniforms.vReflectivityColor.rgb; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==75 -color=uniforms.vEmissiveColor; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION) -color= vec3f(seo); -#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D) -color= vec3f(eho); -#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION) -color= vec3f(energyConservationFactor); -#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -color=baseSpecularEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) -color=clearcoatOut.clearCoatEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION) -color=sheenOut.sheenEnvironmentReflectance; -#define DEBUGMODE_GAMMA -#elif DEBUGMODE==86 && defined(ALPHABLEND) -color= vec3f(luminanceOverAlpha); -#elif DEBUGMODE==87 -color= vec3f(alpha); -#elif DEBUGMODE==88 && defined(ALBEDO) -color= vec3f(albedoTexture.a); -#elif DEBUGMODE==89 -color=aoOut.ambientOcclusionColor; -#else -var stripeWidth: f32=30.;var stripePos: f32=abs(floor(input.position.x/stripeWidth));var whichColor: f32=((stripePos)%(2.));var color1: vec3f= vec3f(.6,.2,.2);var color2: vec3f= vec3f(.3,.1,.1);color=mix(color1,color2,whichColor); -#endif -color*=uniforms.vDebugMode.y; -#ifdef DEBUGMODE_NORMALIZE -color=normalize(color)*0.5+0.5; -#endif -#ifdef DEBUGMODE_GAMMA -color=toGammaSpaceVec3(color); -#endif -fragmentOutputs.color=vec4f(color,1.0); -#ifdef PREPASS -fragmentOutputs.fragData0=toLinearSpaceVec3(color); -fragmentOutputs.fragData1=vec4f(0.,0.,0.,0.); -#endif -#ifdef DEBUGMODE_FORCERETURN -return fragmentOutputs; -#endif -} -#endif -`;e.IncludesShadersStoreWGSL[u]||(e.IncludesShadersStoreWGSL[u]=C); diff --git a/assets/pbrMaterialLoadingAdapter-DhdH9hHA.js b/assets/pbrMaterialLoadingAdapter-DhdH9hHA.js deleted file mode 100644 index 5b752be4af98fd44aeb0840f4826886116242821..0000000000000000000000000000000000000000 --- a/assets/pbrMaterialLoadingAdapter-DhdH9hHA.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as t,C as i}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";class u{constructor(e){this._material=e,this._material.enableSpecularAntiAliasing=!0}get material(){return this._material}get isUnlit(){return this._material.unlit}set isUnlit(e){this._material.unlit=e}set backFaceCulling(e){this._material.backFaceCulling=e}get backFaceCulling(){return this._material.backFaceCulling}set twoSidedLighting(e){this._material.twoSidedLighting=e}get twoSidedLighting(){return this._material.twoSidedLighting}set alphaCutOff(e){this._material.alphaCutOff=e}get alphaCutOff(){return this._material.alphaCutOff}set useAlphaFromBaseColorTexture(e){this._material.useAlphaFromAlbedoTexture=e}get useAlphaFromBaseColorTexture(){return this._material.useAlphaFromAlbedoTexture}get transparencyAsAlphaCoverage(){return this._material.useRadianceOverAlpha||this._material.useSpecularOverAlpha}set transparencyAsAlphaCoverage(e){this._material.useRadianceOverAlpha=!e,this._material.useSpecularOverAlpha=!e}set baseColor(e){this._material.albedoColor=e}get baseColor(){return this._material.albedoColor}set baseColorTexture(e){this._material.albedoTexture=e}get baseColorTexture(){return this._material.albedoTexture}set baseDiffuseRoughness(e){this._material.baseDiffuseRoughness=e,e>0&&(this._material.brdf.baseDiffuseModel=t.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR)}get baseDiffuseRoughness(){return this._material.baseDiffuseRoughness??0}set baseDiffuseRoughnessTexture(e){this._material.baseDiffuseRoughnessTexture=e}get baseDiffuseRoughnessTexture(){return this._material.baseDiffuseRoughnessTexture}set baseMetalness(e){this._material.metallic=e}get baseMetalness(){return this._material.metallic??1}set baseMetalnessTexture(e){this._material.metallicTexture=e}get baseMetalnessTexture(){return this._material.metallicTexture}set useRoughnessFromMetallicTextureGreen(e){this._material.useRoughnessFromMetallicTextureGreen=e,this._material.useRoughnessFromMetallicTextureAlpha=!e}set useMetallicFromMetallicTextureBlue(e){this._material.useMetallnessFromMetallicTextureBlue=e}enableSpecularEdgeColor(e=!1){e&&(this._material.brdf.dielectricSpecularModel=t.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR,this._material.brdf.conductorSpecularModel=t.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR)}set specularWeight(e){this._material.metallicF0Factor=e}get specularWeight(){return this._material.metallicF0Factor??1}set specularWeightTexture(e){e?(this._material.metallicReflectanceTexture=e,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!0):(this._material.metallicReflectanceTexture=null,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!1)}get specularWeightTexture(){return this._material.metallicReflectanceTexture}set specularColor(e){this._material.metallicReflectanceColor=e}get specularColor(){return this._material.metallicReflectanceColor}set specularColorTexture(e){this._material.reflectanceTexture=e}get specularColorTexture(){return this._material.reflectanceTexture}set specularRoughness(e){this._material.roughness=e}get specularRoughness(){return this._material.roughness??1}set specularRoughnessTexture(e){this.baseMetalnessTexture||(this._material.metallicTexture=e)}get specularRoughnessTexture(){return this._material.metallicTexture}set specularIor(e){this._material.indexOfRefraction=e}get specularIor(){return this._material.indexOfRefraction}set emissionColor(e){this._material.emissiveColor=e}get emissionColor(){return this._material.emissiveColor}set emissionLuminance(e){this._material.emissiveIntensity=e}get emissionLuminance(){return this._material.emissiveIntensity}set emissionColorTexture(e){this._material.emissiveTexture=e}get emissionColorTexture(){return this._material.emissiveTexture}set ambientOcclusionTexture(e){this._material.ambientTexture=e,e&&(this._material.useAmbientInGrayScale=!0)}get ambientOcclusionTexture(){return this._material.ambientTexture}set ambientOcclusionTextureStrength(e){this._material.ambientTextureStrength=e}get ambientOcclusionTextureStrength(){return this._material.ambientTextureStrength??1}configureCoat(){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.remapF0OnInterfaceChange=!1}set coatWeight(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.intensity=e}get coatWeight(){return this._material.clearCoat.intensity}set coatWeightTexture(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.texture=e}get coatWeightTexture(){return this._material.clearCoat.texture}set coatColor(e){this._material.clearCoat.isTintEnabled=e!=i.White(),this._material.clearCoat.tintColor=e}set coatColorTexture(e){this._material.clearCoat.tintTexture=e}set coatRoughness(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.roughness=e}get coatRoughness(){return this._material.clearCoat.roughness??0}set coatRoughnessTexture(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.textureRoughness=e}get coatRoughnessTexture(){return this._material.clearCoat.textureRoughness}set coatIor(e){this._material.clearCoat.indexOfRefraction=e}set coatDarkening(e){}set coatDarkeningTexture(e){}set coatRoughnessAnisotropy(e){}get coatRoughnessAnisotropy(){return 0}set geometryCoatTangentAngle(e){}set geometryCoatTangentTexture(e){}get geometryCoatTangentTexture(){return null}set transmissionWeight(e){this._material.subSurface.isRefractionEnabled=e>0,this._material.subSurface.refractionIntensity=e}get transmissionWeight(){return this._material.subSurface.refractionIntensity}set transmissionWeightTexture(e){this._material.subSurface.isRefractionEnabled=!0,this._material.subSurface.refractionIntensityTexture=e,this._material.subSurface.useGltfStyleTextures=!0}set transmissionDepth(e){this._material.subSurface.tintColorAtDistance=e}set transmissionColor(e){this._material.subSurface.tintColor=e}set transmissionDispersionAbbeNumber(e){e>0?(this._material.subSurface.isDispersionEnabled=!0,this._material.subSurface.dispersion=20/e):(this._material.subSurface.isDispersionEnabled=!1,this._material.subSurface.dispersion=0)}configureTransmission(){this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.useAlbedoToTintRefraction=!0,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0}set volumeThicknessTexture(e){this._material.subSurface.thicknessTexture=e,this._material.subSurface.useGltfStyleTextures=!0}set volumeThickness(e){this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=e,this._material.subSurface.useThicknessAsDepth=!0,e>0&&(this._material.subSurface.volumeIndexOfRefraction=this._material.indexOfRefraction)}configureSubsurface(){this._material.subSurface.useGltfStyleTextures=!0,this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0,this._material.subSurface.useAlbedoToTintTranslucency=!1}set subsurfaceWeight(e){this._material.subSurface.isTranslucencyEnabled=e>0,this._material.subSurface.translucencyIntensity=e}get subsurfaceWeight(){return this._material.subSurface.isTranslucencyEnabled?this._material.subSurface.translucencyIntensity:0}set subsurfaceWeightTexture(e){this._material.subSurface.translucencyIntensityTexture=e}set subsurfaceColor(e){this._material.subSurface.tintColor=e}set subsurfaceColorTexture(e){this._material.subSurface.translucencyColorTexture=e}configureFuzz(){this._material.sheen.isEnabled=!0,this._material.sheen.useRoughnessFromMainTexture=!1,this._material.sheen.albedoScaling=!0}set fuzzWeight(e){this._material.sheen.isEnabled=!0,this._material.sheen.intensity=e}set fuzzWeightTexture(e){this._material.sheen.texture||(this._material.sheen.texture=e)}set fuzzColor(e){this._material.sheen.isEnabled=!0,this._material.sheen.color=e}set fuzzColorTexture(e){this._material.sheen.texture=e}set fuzzRoughness(e){this._material.sheen.isEnabled=!0,this._material.sheen.roughness=e}set fuzzRoughnessTexture(e){this._material.sheen.isEnabled=!0,this._material.sheen.textureRoughness=e}set specularRoughnessAnisotropy(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.intensity=e}get specularRoughnessAnisotropy(){return this._material.anisotropy.intensity}set geometryTangentAngle(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.angle=e}set geometryTangentTexture(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.texture=e}get geometryTangentTexture(){return this._material.anisotropy.texture}configureGltfStyleAnisotropy(e=!0){}set thinFilmWeight(e){this._material.iridescence.isEnabled=e>0,this._material.iridescence.intensity=e}set thinFilmIor(e){this._material.iridescence.indexOfRefraction=e}set thinFilmThicknessMinimum(e){this._material.iridescence.minimumThickness=e}set thinFilmThicknessMaximum(e){this._material.iridescence.maximumThickness=e}set thinFilmWeightTexture(e){this._material.iridescence.texture=e}set thinFilmThicknessTexture(e){this._material.iridescence.thicknessTexture=e}set transmissionDispersion(e){this._material._dispersion=e}set unlit(e){this._material.unlit=e}set geometryOpacity(e){this._material.alpha=e}get geometryOpacity(){return this._material.alpha}set geometryNormalTexture(e){this._material.bumpTexture=e,this._material.forceIrradianceInFragment=!0}get geometryNormalTexture(){return this._material.bumpTexture}setNormalMapInversions(e,a){this._material.invertNormalMapX=e,this._material.invertNormalMapY=a}set geometryCoatNormalTexture(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.bumpTexture=e}get geometryCoatNormalTexture(){return this._material.clearCoat.bumpTexture}set geometryCoatNormalTextureScale(e){this._material.clearCoat.bumpTexture&&(this._material.clearCoat.bumpTexture.level=e)}}export{u as PBRMaterialLoadingAdapter}; diff --git a/assets/pbrUboDeclaration-Cq2mqEav.js b/assets/pbrUboDeclaration-Cq2mqEav.js deleted file mode 100644 index 98395173b2ac4e6c2fe05b99372ec275820e84d6..0000000000000000000000000000000000000000 --- a/assets/pbrUboDeclaration-Cq2mqEav.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as f}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";const e="pbrUboDeclaration",i=`uniform vAlbedoInfos: vec2f;uniform vBaseWeightInfos: vec2f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform vAmbientInfos: vec4f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vReflectivityInfos: vec3f;uniform vMicroSurfaceSamplerInfos: vec2f;uniform vBumpInfos: vec3f;uniform albedoMatrix: mat4x4f;uniform baseWeightMatrix: mat4x4f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform reflectivityMatrix: mat4x4f;uniform microSurfaceSamplerMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform vAlbedoColor: vec4f;uniform baseWeight: f32;uniform baseDiffuseRoughness: f32;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vReflectivityColor: vec4f;uniform vEmissiveColor: vec3f;uniform vAmbientColor: vec3f;uniform vDebugMode: vec2f;uniform vMetallicReflectanceFactors: vec4f;uniform vMetallicReflectanceInfos: vec2f;uniform metallicReflectanceMatrix: mat4x4f;uniform vReflectanceInfos: vec2f;uniform reflectanceMatrix: mat4x4f;uniform cameraInfo: vec4f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionDominantDirection: vec3f;uniform vReflectionColor: vec3f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f; -#define ADDITIONAL_UBO_DECLARATION -#include -#include -`;f.IncludesShadersStoreWGSL[e]||(f.IncludesShadersStoreWGSL[e]=i); diff --git a/assets/pbrUboDeclaration-VU_3zv-q.js b/assets/pbrUboDeclaration-VU_3zv-q.js deleted file mode 100644 index 6529544b65fc3306e0710154e8bdd22baf879e83..0000000000000000000000000000000000000000 --- a/assets/pbrUboDeclaration-VU_3zv-q.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";const c="pbrUboDeclaration",v=`layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec2 vBaseWeightInfos;vec2 vBaseDiffuseRoughnessInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec3 vBumpInfos;mat4 albedoMatrix;mat4 baseWeightMatrix;mat4 baseDiffuseRoughnessMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;vec4 vAlbedoColor;float baseWeight;float baseDiffuseRoughness;vec4 vLightingIntensity;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec4 cameraInfo;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX; -#define ADDITIONAL_UBO_DECLARATION -}; -#include -#include -`;e.IncludesShadersStore[c]||(e.IncludesShadersStore[c]=v); diff --git a/assets/pieDiagram-ADFJNKIX-Bo5-NHZs.js b/assets/pieDiagram-ADFJNKIX-Bo5-NHZs.js deleted file mode 100644 index 7b99bf3e0fe81c1bf808418d5f9c114030a95309..0000000000000000000000000000000000000000 --- a/assets/pieDiagram-ADFJNKIX-Bo5-NHZs.js +++ /dev/null @@ -1,30 +0,0 @@ -import{g as j,s as q,a as Z,b as H,q as J,p as K,_ as u,l as z,c as Q,E as X,I as Y,O as ee,d as te,y as ae,F as re}from"./mermaid.core-BcqUqpnI.js";import{p as ne}from"./chunk-4BX2VUAB-BSrsJ5gp.js";import{p as ie}from"./treemap-KMMF4GRG-BAURD4mW.js";import{d as R}from"./arc-Bt_eNeYl.js";import{o as se}from"./ordinal-BeghXfj9.js";import{a as S,t as F,n as oe}from"./step-B-Gbak1k.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./min-Rtq3U8dQ.js";import"./_baseUniq-BFKEI0vc.js";import"./init-Dmth1JHB.js";function le(e,a){return ae?1:a>=e?0:NaN}function ce(e){return e}function pe(){var e=ce,a=le,f=null,y=S(0),s=S(F),l=S(0);function o(t){var n,c=(t=oe(t)).length,d,x,h=0,p=new Array(c),i=new Array(c),v=+y.apply(this,arguments),w=Math.min(F,Math.max(-F,s.apply(this,arguments)-v)),m,C=Math.min(Math.abs(w)/c,l.apply(this,arguments)),$=C*(w<0?-1:1),g;for(n=0;n0&&(h+=g);for(a!=null?p.sort(function(A,D){return a(i[A],i[D])}):f!=null&&p.sort(function(A,D){return f(t[A],t[D])}),n=0,x=h?(w-c*$)/h:0;n0?g*x:0)+$,i[d]={data:t[d],index:n,value:g,startAngle:v,endAngle:m,padAngle:C};return i}return o.value=function(t){return arguments.length?(e=typeof t=="function"?t:S(+t),o):e},o.sortValues=function(t){return arguments.length?(a=t,f=null,o):a},o.sort=function(t){return arguments.length?(f=t,a=null,o):f},o.startAngle=function(t){return arguments.length?(y=typeof t=="function"?t:S(+t),o):y},o.endAngle=function(t){return arguments.length?(s=typeof t=="function"?t:S(+t),o):s},o.padAngle=function(t){return arguments.length?(l=typeof t=="function"?t:S(+t),o):l},o}var ue=re.pie,G={sections:new Map,showData:!1},T=G.sections,N=G.showData,de=structuredClone(ue),ge=u(()=>structuredClone(de),"getConfig"),fe=u(()=>{T=new Map,N=G.showData,ae()},"clear"),me=u(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,a),z.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),he=u(()=>T,"getSections"),ve=u(e=>{N=e},"setShowData"),Se=u(()=>N,"getShowData"),L={getConfig:ge,clear:fe,setDiagramTitle:K,getDiagramTitle:J,setAccTitle:H,getAccTitle:Z,setAccDescription:q,getAccDescription:j,addSection:me,getSections:he,setShowData:ve,getShowData:Se},ye=u((e,a)=>{ne(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),xe={parse:u(async e=>{const a=await ie("pie",e);z.debug(a),ye(a,L)},"parse")},we=u(e=>` - .pieCircle{ - stroke: ${e.pieStrokeColor}; - stroke-width : ${e.pieStrokeWidth}; - opacity : ${e.pieOpacity}; - } - .pieOuterCircle{ - stroke: ${e.pieOuterStrokeColor}; - stroke-width: ${e.pieOuterStrokeWidth}; - fill: none; - } - .pieTitleText { - text-anchor: middle; - font-size: ${e.pieTitleTextSize}; - fill: ${e.pieTitleTextColor}; - font-family: ${e.fontFamily}; - } - .slice { - font-family: ${e.fontFamily}; - fill: ${e.pieSectionTextColor}; - font-size:${e.pieSectionTextSize}; - // fill: white; - } - .legend text { - fill: ${e.pieLegendTextColor}; - font-family: ${e.fontFamily}; - font-size: ${e.pieLegendTextSize}; - } -`,"getStyles"),Ae=we,De=u(e=>{const a=[...e.values()].reduce((s,l)=>s+l,0),f=[...e.entries()].map(([s,l])=>({label:s,value:l})).filter(s=>s.value/a*100>=1).sort((s,l)=>l.value-s.value);return pe().value(s=>s.value)(f)},"createPieArcs"),Ce=u((e,a,f,y)=>{z.debug(`rendering pie chart -`+e);const s=y.db,l=Q(),o=X(s.getConfig(),l.pie),t=40,n=18,c=4,d=450,x=d,h=Y(a),p=h.append("g");p.attr("transform","translate("+x/2+","+d/2+")");const{themeVariables:i}=l;let[v]=ee(i.pieOuterStrokeWidth);v??=2;const w=o.textPosition,m=Math.min(x,d)/2-t,C=R().innerRadius(0).outerRadius(m),$=R().innerRadius(m*w).outerRadius(m*w);p.append("circle").attr("cx",0).attr("cy",0).attr("r",m+v/2).attr("class","pieOuterCircle");const g=s.getSections(),A=De(g),D=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let E=0;g.forEach(r=>{E+=r});const O=A.filter(r=>(r.data.value/E*100).toFixed(0)!=="0"),b=se(D);p.selectAll("mySlices").data(O).enter().append("path").attr("d",C).attr("fill",r=>b(r.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(O).enter().append("text").text(r=>(r.data.value/E*100).toFixed(0)+"%").attr("transform",r=>"translate("+$.centroid(r)+")").style("text-anchor","middle").attr("class","slice"),p.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText");const W=[...g.entries()].map(([r,M])=>({label:r,value:M})),k=p.selectAll(".legend").data(W).enter().append("g").attr("class","legend").attr("transform",(r,M)=>{const P=n+c,B=P*W.length/2,V=12*n,U=M*P-B;return"translate("+V+","+U+")"});k.append("rect").attr("width",n).attr("height",n).style("fill",r=>b(r.label)).style("stroke",r=>b(r.label)),k.append("text").attr("x",n+c).attr("y",n-c).text(r=>s.getShowData()?`${r.label} [${r.value}]`:r.label);const _=Math.max(...k.selectAll("text").nodes().map(r=>r?.getBoundingClientRect().width??0)),I=x+t+n+c+_;h.attr("viewBox",`0 0 ${I} ${d}`),te(h,d,I,o.useMaxWidth)},"draw"),$e={draw:Ce},Re={parser:xe,db:L,renderer:$e,styles:Ae};export{Re as diagram}; diff --git a/assets/pointCloudVertex-wpVdAlmJ.js b/assets/pointCloudVertex-wpVdAlmJ.js deleted file mode 100644 index c2ce00e2634ebae10bcb0112863b308adc92160a..0000000000000000000000000000000000000000 --- a/assets/pointCloudVertex-wpVdAlmJ.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const d="pointCloudVertex",i=`#if defined(POINTSIZE) && !defined(WEBGPU) -gl_PointSize=pointSize; -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=i); diff --git a/assets/postProcessRenderEffect-Bi0eHNy8.js b/assets/postProcessRenderEffect-Bi0eHNy8.js deleted file mode 100644 index 114568c550fd84e88586baa79bb1682b59fccbe2..0000000000000000000000000000000000000000 --- a/assets/postProcessRenderEffect-Bi0eHNy8.js +++ /dev/null @@ -1 +0,0 @@ -import{aY as _,d as i,_ as d,s as m}from"./index-GY9JDBGV.js";class p{get name(){return this._name}get cameras(){return this._cameras}get engine(){return this._engine}constructor(t,s){this._engine=t,this.uniqueId=_.UniqueId,this._name=s,this._renderEffects={},this._renderEffectsForIsolatedPass=new Array,this._cameras=[]}getClassName(){return"PostProcessRenderPipeline"}get isSupported(){for(const t in this._renderEffects)if(Object.prototype.hasOwnProperty.call(this._renderEffects,t)&&!this._renderEffects[t].isSupported)return!1;return!0}addEffect(t){this._renderEffects[t._name]=t}_rebuild(){}_enableEffect(t,s){const e=this._renderEffects[t];e&&e._enable(i.MakeArray(s||this._cameras))}_disableEffect(t,s){const e=this._renderEffects[t];e&&e._disable(i.MakeArray(s||this._cameras))}_attachCameras(t,s){const e=i.MakeArray(t||this._cameras);if(!e)return;const a=[];let r;for(r=0;r0){const e=this._renderEffects[s[0]].getPostProcesses();e&&(e[0].samples=t)}return!0}_adaptPostProcessesToViewPort(){const t=Object.keys(this._renderEffects);for(const s of t){const e=this._renderEffects[s].getPostProcesses();if(e)for(const a of e)a.adaptScaleToCurrentViewport=!0}}setPrePassRenderer(t){return!1}dispose(){}}d([m()],p.prototype,"_name",void 0);class P{constructor(t,s,e,a=!0){this._name=s,this._singleInstance=a,this._getPostProcesses=e,this._cameras={},this._indicesForCamera={},this._postProcesses={}}get isSupported(){for(const t in this._postProcesses)if(Object.prototype.hasOwnProperty.call(this._postProcesses,t)){const s=this._postProcesses[t];for(let e=0;e;uniform scale: vec2;varying vUV: vec2;const madd=vec2(0.5,0.5); -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -vertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -} -`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=r);const n={name:e,shader:r};export{n as postprocessVertexShaderWGSL}; diff --git a/assets/prePassRendererSceneComponent-teSXjTtT.js b/assets/prePassRendererSceneComponent-teSXjTtT.js deleted file mode 100644 index a68ec1cdffc4e138cc8771e771dc27816e8b1831..0000000000000000000000000000000000000000 --- a/assets/prePassRendererSceneComponent-teSXjTtT.js +++ /dev/null @@ -1,6 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageProcessing.fragment-d7XWWX5d.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./imageProcessingFunctions-DMSN1d-p.js","./helperFunctions-Wgh3PIP0.js","./imageProcessing.fragment-CodCckBh.js","./imageProcessingFunctions-BwYIAaLN.js","./helperFunctions-tBt4f_K3.js"])))=>i.map(i=>d[i]); -import{aE as C,aq as T,W as f,bn as E,_ as R,s as b,aA as y,bz as S,b9 as p,o as v,be as x,a,b as _,L as F}from"./index-GY9JDBGV.js";import{af as d}from"./index-DydPgVMC.js";import{G as h}from"./geometryBufferRenderer-DviLW_b_.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./bumpFragment-Dn7_UB6Q.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./bumpVertex-dKv8gF7O.js";class c extends C{_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(d(()=>import("./imageProcessing.fragment-d7XWWX5d.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))):t.push(d(()=>import("./imageProcessing.fragment-CodCckBh.js"),__vite__mapDeps([6,1,2,3,7,8]),import.meta.url))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){e.applyByPostProcess=!0,this._attachImageProcessingConfiguration(e)}_attachImageProcessingConfiguration(e,t=!1){if(e!==this._imageProcessingConfiguration){if(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e)this._imageProcessingConfiguration=e;else{let s=this.options.scene;if(!s){const r=this.options.engine;if(r&&r.scenes){const i=r.scenes;s=i[i.length-1]}else s=T.LastCreatedScene}s?this._imageProcessingConfiguration=s.imageProcessingConfiguration:this._imageProcessingConfiguration=new f}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{this._updateParameters()})),t||this._updateParameters()}}get colorCurves(){return this.imageProcessingConfiguration.colorCurves}set colorCurves(e){this.imageProcessingConfiguration.colorCurves=e}get colorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set colorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get colorGradingTexture(){return this.imageProcessingConfiguration.colorGradingTexture}set colorGradingTexture(e){this.imageProcessingConfiguration.colorGradingTexture=e}get colorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set colorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get exposure(){return this.imageProcessingConfiguration.exposure}set exposure(e){this.imageProcessingConfiguration.exposure=e}get toneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set toneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get toneMappingType(){return this._imageProcessingConfiguration.toneMappingType}set toneMappingType(e){this._imageProcessingConfiguration.toneMappingType=e}get contrast(){return this.imageProcessingConfiguration.contrast}set contrast(e){this.imageProcessingConfiguration.contrast=e}get vignetteStretch(){return this.imageProcessingConfiguration.vignetteStretch}set vignetteStretch(e){this.imageProcessingConfiguration.vignetteStretch=e}get vignetteCentreX(){return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCentreX(e){this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteCentreY(){return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCentreY(e){this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterY(){return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCenterY(e){this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterX(){return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCenterX(e){this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteWeight(){return this.imageProcessingConfiguration.vignetteWeight}set vignetteWeight(e){this.imageProcessingConfiguration.vignetteWeight=e}get vignetteColor(){return this.imageProcessingConfiguration.vignetteColor}set vignetteColor(e){this.imageProcessingConfiguration.vignetteColor=e}get vignetteCameraFov(){return this.imageProcessingConfiguration.vignetteCameraFov}set vignetteCameraFov(e){this.imageProcessingConfiguration.vignetteCameraFov=e}get vignetteBlendMode(){return this.imageProcessingConfiguration.vignetteBlendMode}set vignetteBlendMode(e){this.imageProcessingConfiguration.vignetteBlendMode=e}get vignetteEnabled(){return this.imageProcessingConfiguration.vignetteEnabled}set vignetteEnabled(e){this.imageProcessingConfiguration.vignetteEnabled=e}get ditheringIntensity(){return this.imageProcessingConfiguration.ditheringIntensity}set ditheringIntensity(e){this.imageProcessingConfiguration.ditheringIntensity=e}get ditheringEnabled(){return this.imageProcessingConfiguration.ditheringEnabled}set ditheringEnabled(e){this.imageProcessingConfiguration.ditheringEnabled=e}get fromLinearSpace(){return this._fromLinearSpace}set fromLinearSpace(e){this._fromLinearSpace!==e&&(this._fromLinearSpace=e,this._updateParameters())}get outputTextureWidth(){return this.imageProcessingConfiguration.outputTextureWidth}set outputTextureWidth(e){this.imageProcessingConfiguration.outputTextureWidth=e}get outputTextureHeight(){return this.imageProcessingConfiguration.outputTextureHeight}set outputTextureHeight(e){this.imageProcessingConfiguration.outputTextureHeight=e}constructor(e,t=null,s){super({...s,name:e,engine:t||E.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:c.FragmentUrl}),this._fromLinearSpace=!0,this._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:0,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,DITHER:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1,SKIPFINALCOLORCLAMP:!1};const r=s?.imageProcessingConfiguration;r?(r.applyByPostProcess=!0,this._attachImageProcessingConfiguration(r,!0),this._updateParameters()):(this._attachImageProcessingConfiguration(null,!0),this.imageProcessingConfiguration.applyByPostProcess=!0)}_updateParameters(){this._defines.FROMLINEARSPACE=this._fromLinearSpace,this.imageProcessingConfiguration.prepareDefines(this._defines,!0);let e="";for(const r in this._defines){const i=this._defines[r];switch(typeof i){case"number":case"string":e+=`#define ${r} ${i}; -`;break;default:i&&(e+=`#define ${r}; -`);break}}const t=["textureSampler"],s=["scale"];f&&(f.PrepareSamplers(t,this._defines),f.PrepareUniforms(s,this._defines)),this.updateEffect(e,s,t)}bind(e=!1){super.bind(e),this.imageProcessingConfiguration.bind(this.effect,this.overrideAspectRatio)}dispose(){super.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)}}c.FragmentUrl="imageProcessing";class P extends y{get _imageProcessingConfiguration(){return this._effectWrapper.imageProcessingConfiguration}get imageProcessingConfiguration(){return this._effectWrapper.imageProcessingConfiguration}set imageProcessingConfiguration(e){this._effectWrapper.imageProcessingConfiguration=e}get isSupported(){const e=this.getEffect();return!e||e.isSupported}get colorCurves(){return this.imageProcessingConfiguration.colorCurves}set colorCurves(e){this.imageProcessingConfiguration.colorCurves=e}get colorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set colorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get colorGradingTexture(){return this.imageProcessingConfiguration.colorGradingTexture}set colorGradingTexture(e){this.imageProcessingConfiguration.colorGradingTexture=e}get colorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set colorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get exposure(){return this.imageProcessingConfiguration.exposure}set exposure(e){this.imageProcessingConfiguration.exposure=e}get toneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set toneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get toneMappingType(){return this._imageProcessingConfiguration.toneMappingType}set toneMappingType(e){this._imageProcessingConfiguration.toneMappingType=e}get contrast(){return this.imageProcessingConfiguration.contrast}set contrast(e){this.imageProcessingConfiguration.contrast=e}get vignetteStretch(){return this.imageProcessingConfiguration.vignetteStretch}set vignetteStretch(e){this.imageProcessingConfiguration.vignetteStretch=e}get vignetteCentreX(){return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCentreX(e){this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteCentreY(){return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCentreY(e){this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterY(){return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCenterY(e){this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterX(){return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCenterX(e){this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteWeight(){return this.imageProcessingConfiguration.vignetteWeight}set vignetteWeight(e){this.imageProcessingConfiguration.vignetteWeight=e}get vignetteColor(){return this.imageProcessingConfiguration.vignetteColor}set vignetteColor(e){this.imageProcessingConfiguration.vignetteColor=e}get vignetteCameraFov(){return this.imageProcessingConfiguration.vignetteCameraFov}set vignetteCameraFov(e){this.imageProcessingConfiguration.vignetteCameraFov=e}get vignetteBlendMode(){return this.imageProcessingConfiguration.vignetteBlendMode}set vignetteBlendMode(e){this.imageProcessingConfiguration.vignetteBlendMode=e}get vignetteEnabled(){return this.imageProcessingConfiguration.vignetteEnabled}set vignetteEnabled(e){this.imageProcessingConfiguration.vignetteEnabled=e}get ditheringIntensity(){return this.imageProcessingConfiguration.ditheringIntensity}set ditheringIntensity(e){this.imageProcessingConfiguration.ditheringIntensity=e}get ditheringEnabled(){return this.imageProcessingConfiguration.ditheringEnabled}set ditheringEnabled(e){this.imageProcessingConfiguration.ditheringEnabled=e}get fromLinearSpace(){return this._effectWrapper.fromLinearSpace}set fromLinearSpace(e){this._effectWrapper.fromLinearSpace=e}constructor(e,t,s=null,r,i,g,u=0,l){const m={size:typeof t=="number"?t:void 0,camera:s,samplingMode:r,engine:i,reusable:g,textureType:u,imageProcessingConfiguration:l,scene:s?.getScene(),...t,blockCompilation:!0};super(e,c.FragmentUrl,{effectWrapper:typeof t=="number"||!t.effectWrapper?new c(e,i,m):void 0,...m}),this.onApply=()=>{this._effectWrapper.overrideAspectRatio=this.aspectRatio}}getClassName(){return"ImageProcessingPostProcess"}_updateParameters(){this._effectWrapper._updateParameters()}dispose(e){super.dispose(e),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)}}R([b()],P.prototype,"fromLinearSpace",null);class A extends S{constructor(e,t,s,r,i,g){super(e,s,r,i,g),this._beforeCompositionPostProcesses=[],this._internalTextureDirty=!1,this.enabled=!1,this.renderTargetTexture=null,this.renderTargetTexture=t}_createCompositionEffect(){this.imageProcessingPostProcess=new P("prePassComposition",1,null,void 0,this._engine),this.imageProcessingPostProcess._updateParameters()}_checkSize(){const e=this._engine.getRenderWidth(!0),t=this._engine.getRenderHeight(!0),s=this.getRenderWidth(),r=this.getRenderHeight();(s!==e||r!==t)&&(this.resize({width:e,height:t}),this._internalTextureDirty=!0)}updateCount(e,t,s){super.updateCount(e,t,s),this._internalTextureDirty=!0}_resetPostProcessChain(){this._beforeCompositionPostProcesses.length=0}dispose(){const e=this._scene;if(super.dispose(),e&&e.prePassRenderer){const t=e.prePassRenderer.renderTargets.indexOf(this);t!==-1&&e.prePassRenderer.renderTargets.splice(t,1)}this.imageProcessingPostProcess&&this.imageProcessingPostProcess.dispose(),this.renderTargetTexture&&(this.renderTargetTexture._prePassRenderTarget=null),this._outputPostProcess&&(this._outputPostProcess.autoClear=!0,this._outputPostProcess.restoreDefaultInputTexture())}}class n{get generateNormalsInWorldSpace(){return this._generateNormalsInWorldSpace}set generateNormalsInWorldSpace(e){this._generateNormalsInWorldSpace!==e&&(this._generateNormalsInWorldSpace=e,this._markAllMaterialsAsPrePassDirty())}getIndex(e){return this._textureIndices[e]}get samples(){return this.defaultRT.samples}set samples(e){this.defaultRT.samples=e}get useSpecificClearForDepthTexture(){return this._useSpecificClearForDepthTexture}set useSpecificClearForDepthTexture(e){this._useSpecificClearForDepthTexture!==e&&(this._useSpecificClearForDepthTexture=e,this._isDirty=!0)}getRenderTarget(){return this._currentTarget}_setRenderTarget(e){e?this._currentTarget=e:(this._currentTarget=this.defaultRT,this._engine.currentRenderPassId=this._scene.activeCamera?.renderPassId??this._currentTarget.renderPassId)}get currentRTisSceneRT(){return this._currentTarget===this.defaultRT}_refreshGeometryBufferRendererLink(){if(this.doNotUseGeometryRendererFallback)this._geometryBuffer&&this._geometryBuffer._unlinkPrePassRenderer(),this._geometryBuffer=null,this._scene.disableGeometryBufferRenderer();else{if(this._geometryBuffer=this._scene.enableGeometryBufferRenderer(),!this._geometryBuffer){this.doNotUseGeometryRendererFallback=!0;return}this._geometryBuffer._linkPrePassRenderer(this)}}get enabled(){return this._enabled}constructor(e){this.excludedSkinnedMesh=[],this.excludedMaterials=[],this.mrtCount=0,this._mrtTypes=[],this._mrtFormats=[],this._mrtLayout=[],this._mrtNames=[],this._textureIndices=[],this._generateNormalsInWorldSpace=!1,this._useSpecificClearForDepthTexture=!1,this._isDirty=!0,this._effectConfigurations=[],this.doNotUseGeometryRendererFallback=!0,this.renderTargets=[],this._clearColor=new p(0,0,0,0),this._clearDepthColor=new p(0,0,0,1),this._enabled=!1,this._needsCompositionForThisPass=!1,this.disableGammaTransform=!1,this._scene=e,this._engine=e.getEngine();let t=0;this._engine._caps.textureFloat&&this._engine._caps.textureFloatLinearFiltering?t=1:this._engine._caps.textureHalfFloat&&this._engine._caps.textureHalfFloatLinearFiltering&&(t=2);for(let s=0;s0&&(this._useSpecificClearForDepthTexture&&this._mrtLayout[i]===5?(t.push(!1),s.push(!0)):(t.push(!0),s.push(!1)),r.push(!1));this._multiRenderAttachments=this._engine.buildTextureLayout(e),this._clearAttachments=this._engine.buildTextureLayout(t),this._clearDepthAttachments=this._engine.buildTextureLayout(s),this._defaultAttachments=this._engine.buildTextureLayout(r)}_resetLayout(){for(let e=0;el!=null),this._scene.autoClear=!0;const r=this._hasImageProcessing(this._postProcessesSourceForThisPass);this._needsCompositionForThisPass=!r&&!this.disableGammaTransform&&this._needsImageProcessing()&&!s;const i=this._getFirstPostProcess(this._postProcessesSourceForThisPass),g=e._beforeCompositionPostProcesses&&e._beforeCompositionPostProcesses[0];let u=null;this._scene.imageProcessingConfiguration.applyByPostProcess=this._needsCompositionForThisPass||r,this._needsCompositionForThisPass&&!e.imageProcessingPostProcess&&e._createCompositionEffect(),g?u=g:this._needsCompositionForThisPass?u=e.imageProcessingPostProcess:i&&(u=i),this._bindFrameBuffer(),this._linkInternalTexture(e,u)}_linkInternalTexture(e,t){t&&(t.autoClear=!1,t.inputTexture=e.renderTarget),e._outputPostProcess!==t&&(e._outputPostProcess&&this._unlinkInternalTexture(e),e._outputPostProcess=t),e._internalTextureDirty&&(this._updateGeometryBufferLayout(),e._internalTextureDirty=!1)}_unlinkInternalTexture(e){e._outputPostProcess&&(e._outputPostProcess.autoClear=!0,e._outputPostProcess.restoreDefaultInputTexture(),e._outputPostProcess=null)}_needsImageProcessing(){for(let e=0;e0?this._scene.activeCameras[0]:this._scene.activeCamera;if(!r)continue;t=r._postProcesses}if(t&&(t=t.filter(r=>r!=null),t)){for(let r=0;r=0;e--)this.renderTargets[e].dispose();for(let e=0;e{throw x("PrePassRendererSceneComponent")};n.TextureFormats=[{purpose:0,type:2,format:5,name:"prePass_Irradiance"},{purpose:1,type:2,format:5,name:"prePass_Position"},{purpose:2,type:0,format:5,name:"prePass_Velocity"},{purpose:3,type:0,format:5,name:"prePass_Reflectivity"},{purpose:4,type:2,format:5,name:"prePass_Color"},{purpose:5,type:1,format:6,name:"prePass_Depth"},{purpose:6,type:2,format:5,name:"prePass_Normal"},{purpose:7,type:0,format:5,name:"prePass_Albedo"},{purpose:8,type:0,format:5,name:"prePass_WorldNormal"},{purpose:9,type:2,format:5,name:"prePass_LocalPosition"},{purpose:10,type:1,format:6,name:"prePass_ScreenDepth"},{purpose:11,type:2,format:5,name:"prePass_VelocityLinear"}];Object.defineProperty(_.prototype,"prePassRenderer",{get:function(){return this._prePassRenderer},set:function(o){o&&o.isSupported&&(this._prePassRenderer=o)},enumerable:!0,configurable:!0});_.prototype.enablePrePassRenderer=function(){return this._prePassRenderer?this._prePassRenderer:(this._prePassRenderer=new n(this),this._prePassRenderer.isSupported||(this._prePassRenderer=null,F.Error(`PrePassRenderer needs WebGL 2 support. -Maybe you tried to use the following features that need the PrePassRenderer : - + Subsurface Scattering`)),this._prePassRenderer)};_.prototype.disablePrePassRenderer=function(){this._prePassRenderer&&(this._prePassRenderer.dispose(),this._prePassRenderer=null)};class I{constructor(e){this.name=a.NAME_PREPASSRENDERER,this.scene=e}register(){this.scene._beforeCameraDrawStage.registerStep(a.STEP_BEFORECAMERADRAW_PREPASS,this,this._beforeCameraDraw),this.scene._afterCameraDrawStage.registerStep(a.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterCameraDraw),this.scene._beforeRenderTargetDrawStage.registerStep(a.STEP_BEFORERENDERTARGETDRAW_PREPASS,this,this._beforeRenderTargetDraw),this.scene._afterRenderTargetDrawStage.registerStep(a.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterRenderTargetDraw),this.scene._beforeClearStage.registerStep(a.STEP_BEFORECLEAR_PREPASS,this,this._beforeClearStage),this.scene._beforeRenderTargetClearStage.registerStep(a.STEP_BEFORERENDERTARGETCLEAR_PREPASS,this,this._beforeRenderTargetClearStage),this.scene._beforeRenderingMeshStage.registerStep(a.STEP_BEFORERENDERINGMESH_PREPASS,this,this._beforeRenderingMeshStage),this.scene._afterRenderingMeshStage.registerStep(a.STEP_AFTERRENDERINGMESH_PREPASS,this,this._afterRenderingMeshStage)}_beforeRenderTargetDraw(e,t,s){this.scene.prePassRenderer&&!e.noPrePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget),this.scene.prePassRenderer._beforeDraw(void 0,t,s))}_afterRenderTargetDraw(e,t,s){this.scene.prePassRenderer&&!e.noPrePassRenderer&&this.scene.prePassRenderer._afterDraw(t,s)}_beforeRenderTargetClearStage(e){this.scene.prePassRenderer&&!e.noPrePassRenderer&&(e._prePassRenderTarget||(e._prePassRenderTarget=this.scene.prePassRenderer._createRenderTarget(e.name+"_prePassRTT",e)),this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget),this.scene.prePassRenderer._clear())}_beforeCameraDraw(e){this.scene.prePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(null),this.scene.prePassRenderer._beforeDraw(e))}_afterCameraDraw(){this.scene.prePassRenderer&&this.scene.prePassRenderer._afterDraw()}_beforeClearStage(){this.scene.prePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(null),this.scene.prePassRenderer._clear())}_beforeRenderingMeshStage(e,t,s,r){if(!r)return;const i=e.getScene();i.prePassRenderer&&i.prePassRenderer.bindAttachmentsForEffect(r,t)}_afterRenderingMeshStage(e){const t=e.getScene();t.prePassRenderer&&t.prePassRenderer.restoreAttachments()}rebuild(){}dispose(){this.scene.disablePrePassRenderer()}}n._SceneComponentInitialization=o=>{let e=o._getComponent(a.NAME_PREPASSRENDERER);e||(e=new I(o),o._addComponent(e))};export{I as PrePassRendererSceneComponent}; diff --git a/assets/prism-python-BGiTAEDL.js b/assets/prism-python-BGiTAEDL.js deleted file mode 100644 index 66edc82a45a8b734fe5b850cf52695538a29605a..0000000000000000000000000000000000000000 --- a/assets/prism-python-BGiTAEDL.js +++ /dev/null @@ -1,2 +0,0 @@ -import{R as W,L as te}from"./i18n-CPHyzK9b.js";var q={exports:{}},X;function ae(){return X||(X=1,(function(G){var N=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var i=(function(g){var h=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,y=0,F={},s={manual:g.Prism&&g.Prism.manual,disableWorkerMessageHandler:g.Prism&&g.Prism.disableWorkerMessageHandler,util:{encode:function t(e){return e instanceof b?new b(e.type,t(e.content),e.alias):Array.isArray(e)?e.map(t):e.replace(/&/g,"&").replace(/"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(n){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(n.stack)||[])[1];if(t){var e=document.getElementsByTagName("script");for(var a in e)if(e[a].src==t)return e[a]}return null}},isActive:function(t,e,a){for(var n="no-"+e;t;){var r=t.classList;if(r.contains(e))return!0;if(r.contains(n))return!1;t=t.parentElement}return!!a}},languages:{plain:F,plaintext:F,text:F,txt:F,extend:function(t,e){var a=s.util.clone(s.languages[t]);for(var n in e)a[n]=e[n];return a},insertBefore:function(t,e,a,n){n=n||s.languages;var r=n[t],l={};for(var o in r)if(r.hasOwnProperty(o)){if(o==e)for(var u in a)a.hasOwnProperty(u)&&(l[u]=a[u]);a.hasOwnProperty(o)||(l[o]=r[o])}var d=n[t];return n[t]=l,s.languages.DFS(s.languages,function(m,A){A===d&&m!=t&&(this[m]=l)}),l},DFS:function t(e,a,n,r){r=r||{};var l=s.util.objId;for(var o in e)if(e.hasOwnProperty(o)){a.call(e,o,e[o],n||o);var u=e[o],d=s.util.type(u);d==="Object"&&!r[l(u)]?(r[l(u)]=!0,t(u,a,null,r)):d==="Array"&&!r[l(u)]&&(r[l(u)]=!0,t(u,a,o,r))}}},plugins:{},highlightAll:function(t,e){s.highlightAllUnder(document,t,e)},highlightAllUnder:function(t,e,a){var n={callback:a,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};s.hooks.run("before-highlightall",n),n.elements=Array.prototype.slice.apply(n.container.querySelectorAll(n.selector)),s.hooks.run("before-all-elements-highlight",n);for(var r=0,l;l=n.elements[r++];)s.highlightElement(l,e===!0,n.callback)},highlightElement:function(t,e,a){var n=s.util.getLanguage(t),r=s.languages[n];s.util.setLanguage(t,n);var l=t.parentElement;l&&l.nodeName.toLowerCase()==="pre"&&s.util.setLanguage(l,n);var o=t.textContent,u={element:t,language:n,grammar:r,code:o};function d(A){u.highlightedCode=A,s.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,s.hooks.run("after-highlight",u),s.hooks.run("complete",u),a&&a.call(u.element)}if(s.hooks.run("before-sanity-check",u),l=u.element.parentElement,l&&l.nodeName.toLowerCase()==="pre"&&!l.hasAttribute("tabindex")&&l.setAttribute("tabindex","0"),!u.code){s.hooks.run("complete",u),a&&a.call(u.element);return}if(s.hooks.run("before-highlight",u),!u.grammar){d(s.util.encode(u.code));return}if(e&&g.Worker){var m=new Worker(s.filename);m.onmessage=function(A){d(A.data)},m.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else d(s.highlight(u.code,u.grammar,u.language))},highlight:function(t,e,a){var n={code:t,grammar:e,language:a};if(s.hooks.run("before-tokenize",n),!n.grammar)throw new Error('The language "'+n.language+'" has no grammar.');return n.tokens=s.tokenize(n.code,n.grammar),s.hooks.run("after-tokenize",n),b.stringify(s.util.encode(n.tokens),n.language)},tokenize:function(t,e){var a=e.rest;if(a){for(var n in a)e[n]=a[n];delete e.rest}var r=new _;return S(r,r.head,t),T(t,r,e,r.head,0),C(r)},hooks:{all:{},add:function(t,e){var a=s.hooks.all;a[t]=a[t]||[],a[t].push(e)},run:function(t,e){var a=s.hooks.all[t];if(!(!a||!a.length))for(var n=0,r;r=a[n++];)r(e)}},Token:b};g.Prism=s;function b(t,e,a,n){this.type=t,this.content=e,this.alias=a,this.length=(n||"").length|0}b.stringify=function t(e,a){if(typeof e=="string")return e;if(Array.isArray(e)){var n="";return e.forEach(function(d){n+=t(d,a)}),n}var r={type:e.type,content:t(e.content,a),tag:"span",classes:["token",e.type],attributes:{},language:a},l=e.alias;l&&(Array.isArray(l)?Array.prototype.push.apply(r.classes,l):r.classes.push(l)),s.hooks.run("wrap",r);var o="";for(var u in r.attributes)o+=" "+u+'="'+(r.attributes[u]||"").replace(/"/g,""")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+o+">"+r.content+""};function E(t,e,a,n){t.lastIndex=e;var r=t.exec(a);if(r&&n&&r[1]){var l=r[1].length;r.index+=l,r[0]=r[0].slice(l)}return r}function T(t,e,a,n,r,l){for(var o in a)if(!(!a.hasOwnProperty(o)||!a[o])){var u=a[o];u=Array.isArray(u)?u:[u];for(var d=0;d=l.reach);w+=v.value.length,v=v.next){var $=v.value;if(e.length>t.length)return;if(!($ instanceof b)){var z=1,x;if(Z){if(x=E(B,w,t,H),!x||x.index>=t.length)break;var L=x.index,V=x.index+x[0].length,k=w;for(k+=v.value.length;L>=k;)v=v.next,k+=v.value.length;if(k-=v.value.length,w=k,v.value instanceof b)continue;for(var P=v;P!==e.tail&&(kl.reach&&(l.reach=M);var D=v.prev;j&&(D=S(e,D,j),w+=j.length),R(e,D,z);var ee=new b(o,A?s.tokenize(I,A):I,K,I);if(v=S(e,D,ee),U&&S(e,v,U),z>1){var O={cause:o+","+d,reach:M};T(t,e,a,v.prev,w,O),l&&O.reach>l.reach&&(l.reach=O.reach)}}}}}}function _(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function S(t,e,a){var n=e.next,r={value:a,prev:e,next:n};return e.next=r,n.prev=r,t.length++,r}function R(t,e,a){for(var n=e.next,r=0;r/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",function(g){g.type==="entity"&&(g.attributes.title=g.content.replace(/&/,"&"))}),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(h,y){var F={};F["language-"+y]={pattern:/(^$)/i,lookbehind:!0,inside:i.languages[y]},F.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:F}};s["language-"+y]={pattern:/[\s\S]+/,inside:i.languages[y]};var b={};b[h]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return h}),"i"),lookbehind:!0,greedy:!0,inside:s},i.languages.insertBefore("markup","cdata",b)}}),Object.defineProperty(i.languages.markup.tag,"addAttribute",{value:function(g,h){i.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+g+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[h,"language-"+h],inside:i.languages[h]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.languages.xml,(function(g){var h=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;g.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+h.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+h.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+h.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+h.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:h,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},g.languages.css.atrule.inside.rest=g.languages.css;var y=g.languages.markup;y&&(y.tag.addInlined("style","css"),y.tag.addAttribute("style","css"))})(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:i.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),i.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),i.languages.markup&&(i.languages.markup.tag.addInlined("script","javascript"),i.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),i.languages.js=i.languages.javascript,(function(){if(typeof i>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var g="Loading…",h=function(p,c){return"✖ Error "+p+" while fetching file: "+c},y="✖ Error: File does not exist or is empty",F={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},s="data-src-status",b="loading",E="loaded",T="failed",_="pre[data-src]:not(["+s+'="'+E+'"]):not(['+s+'="'+b+'"])';function S(p,c,f){var t=new XMLHttpRequest;t.open("GET",p,!0),t.onreadystatechange=function(){t.readyState==4&&(t.status<400&&t.responseText?c(t.responseText):t.status>=400?f(h(t.status,t.statusText)):f(y))},t.send(null)}function R(p){var c=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(c){var f=Number(c[1]),t=c[2],e=c[3];return t?e?[f,Number(e)]:[f,void 0]:[f,f]}}i.hooks.add("before-highlightall",function(p){p.selector+=", "+_}),i.hooks.add("before-sanity-check",function(p){var c=p.element;if(c.matches(_)){p.code="",c.setAttribute(s,b);var f=c.appendChild(document.createElement("CODE"));f.textContent=g;var t=c.getAttribute("data-src"),e=p.language;if(e==="none"){var a=(/\.(\w+)$/.exec(t)||[,"none"])[1];e=F[a]||a}i.util.setLanguage(f,e),i.util.setLanguage(c,e);var n=i.plugins.autoloader;n&&n.loadLanguages(e),S(t,function(r){c.setAttribute(s,E);var l=R(c.getAttribute("data-range"));if(l){var o=r.split(/\r\n?|\n/g),u=l[0],d=l[1]==null?o.length:l[1];u<0&&(u+=o.length),u=Math.max(0,Math.min(u-1,o.length)),d<0&&(d+=o.length),d=Math.max(0,Math.min(d,o.length)),r=o.slice(u,d).join(` -`),c.hasAttribute("data-start")||c.setAttribute("data-start",String(u+1))}f.textContent=r,i.highlightElement(f)},function(r){c.setAttribute(s,T),f.textContent=r})}}),i.plugins.fileHighlight={highlight:function(c){for(var f=(c||document).querySelectorAll(_),t=0,e;e=f[t++];)i.highlightElement(e)}};var C=!1;i.fileHighlight=function(){C||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),C=!0),i.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(q)),q.exports}var ne=ae();const se=te(ne);var Y={},J;function re(){return J||(J=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Y}re();export{se as P,ne as p}; diff --git a/assets/procedural.vertex-D1mTdBvt.js b/assets/procedural.vertex-D1mTdBvt.js deleted file mode 100644 index ec4cb42b2f97d6d2c29c9f9175d5dde51c74a065..0000000000000000000000000000000000000000 --- a/assets/procedural.vertex-D1mTdBvt.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="proceduralVertexShader",i=`attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) { -#define CUSTOM_VERTEX_MAIN_BEGIN -vPosition=position;vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;o.ShadersStore[e]||(o.ShadersStore[e]=i);const d={name:e,shader:i};export{d as proceduralVertexShader}; diff --git a/assets/procedural.vertex-DxrK4RVC.js b/assets/procedural.vertex-DxrK4RVC.js deleted file mode 100644 index c34475a1360b2483f3a069b84a9c8ab2ba1b49c5..0000000000000000000000000000000000000000 --- a/assets/procedural.vertex-DxrK4RVC.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as t}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="proceduralVertexShader",i=`attribute position: vec2f;varying vPosition: vec2f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5); -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -vertexOutputs.vPosition=input.position;vertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position= vec4f(input.position,0.0,1.0); -#define CUSTOM_VERTEX_MAIN_END -}`;t.ShadersStoreWGSL[e]||(t.ShadersStoreWGSL[e]=i);const n={name:e,shader:i};export{n as proceduralVertexShaderWGSL}; diff --git a/assets/quadrantDiagram-AYHSOK5B-Cs64x-qg.js b/assets/quadrantDiagram-AYHSOK5B-Cs64x-qg.js deleted file mode 100644 index ecce5fa54a6ff86fc9949666f315462ea015742a..0000000000000000000000000000000000000000 --- a/assets/quadrantDiagram-AYHSOK5B-Cs64x-qg.js +++ /dev/null @@ -1,7 +0,0 @@ -import{s as be,g as Se,q as te,p as _e,a as Ae,b as ke,_ as r,c as Et,l as mt,d as Fe,y as Pe,F as D,h as ve,L as Ce}from"./mermaid.core-BcqUqpnI.js";import{l as $t}from"./linear-8mDBZVC7.js";import{s as vt}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./defaultLocale-CzDG__Ur.js";var Ct=(function(){var t=r(function(M,s,l,u){for(l=l||{},u=M.length;u--;l[M[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],q=[1,37],b=[1,36],y=[1,38],T=[1,35],m=[1,43],g=[1,41],rt=[1,14],ct=[1,23],dt=[1,18],ut=[1,19],xt=[1,20],ot=[1,21],bt=[1,22],lt=[1,24],i=[1,25],Dt=[1,26],zt=[1,27],Vt=[1,28],It=[1,29],W=[1,32],U=[1,33],k=[1,34],F=[1,39],P=[1,40],v=[1,42],C=[1,44],O=[1,62],H=[1,61],L=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],wt=[1,65],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Ht=[1,73],Xt=[1,74],Mt=[1,75],Yt=[1,76],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],G=[1,90],K=[1,91],Z=[1,92],J=[1,99],$=[1,93],tt=[1,96],et=[1,94],it=[1,95],at=[1,97],nt=[1,98],St=[1,102],jt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:q,5:b,10:y,12:T,13:m,14:g,18:rt,25:ct,35:dt,37:ut,39:xt,41:ot,42:bt,48:lt,50:i,51:Dt,52:zt,53:Vt,54:It,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(_,[2,34]),{27:45,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:q,5:b,10:y,12:T,13:m,14:g,18:rt,25:ct,35:dt,37:ut,39:xt,41:ot,42:bt,48:lt,50:i,51:Dt,52:zt,53:Vt,54:It,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(c,[2,45]),t(c,[2,46]),{18:[1,50]},{4:q,5:b,10:y,12:T,13:m,14:g,43:51,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,10:y,12:T,13:m,14:g,43:52,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,10:y,12:T,13:m,14:g,43:53,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,10:y,12:T,13:m,14:g,43:54,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,10:y,12:T,13:m,14:g,43:55,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,10:y,12:T,13:m,14:g,43:56,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,44:[1,57],47:[1,58],58:60,59:59,63:k,64:F,65:P,66:v,67:C},t(L,[2,64]),t(L,[2,66]),t(L,[2,67]),t(L,[2,70]),t(L,[2,71]),t(L,[2,72]),t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(L,[2,80]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:64,4:wt,5:Bt,6:Rt,7:Nt,8:Wt,9:Ut,10:Qt,11:Ot,12:Ht,13:Xt,14:Mt,15:Yt,21:63},t(c,[2,53],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,49:[1,77],63:k,64:F,65:P,66:v,67:C}),t(c,[2,56],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,49:[1,78],63:k,64:F,65:P,66:v,67:C}),t(c,[2,57],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(c,[2,58],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(c,[2,59],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(c,[2,60],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),{45:[1,79]},{44:[1,80]},t(L,[2,65]),t(L,[2,81]),t(L,[2,82]),t(L,[2,83]),{3:82,4:wt,5:Bt,6:Rt,7:Nt,8:Wt,9:Ut,10:Qt,11:Ot,12:Ht,13:Xt,14:Mt,15:Yt,18:[1,81]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(c,[2,52],{58:31,43:83,4:q,5:b,10:y,12:T,13:m,14:g,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(c,[2,55],{58:31,43:84,4:q,5:b,10:y,12:T,13:m,14:g,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),{46:[1,85]},{45:[1,86]},{4:G,5:K,6:Z,8:J,11:$,13:tt,16:89,17:et,18:it,19:at,20:nt,22:88,23:87},t(I,[2,24]),t(c,[2,51],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(c,[2,54],{59:59,58:60,4:q,5:b,8:O,10:y,12:T,13:m,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(c,[2,47],{22:88,16:89,23:100,4:G,5:K,6:Z,8:J,11:$,13:tt,17:et,18:it,19:at,20:nt}),{46:[1,101]},t(c,[2,29],{10:St}),t(jt,[2,27],{16:103,4:G,5:K,6:Z,8:J,11:$,13:tt,17:et,18:it,19:at,20:nt}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:88,16:89,23:104,4:G,5:K,6:Z,8:J,11:$,13:tt,17:et,18:it,19:at,20:nt}),{4:G,5:K,6:Z,8:J,11:$,13:tt,16:89,17:et,18:it,19:at,20:nt,22:105},t(R,[2,26]),t(c,[2,50],{10:St}),t(jt,[2,28],{16:103,4:G,5:K,6:Z,8:J,11:$,13:tt,17:et,18:it,19:at,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Gt=0,ye=2,Kt=1,Te=e.slice.call(arguments,1),E=Object.create(this.lexer),Y={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(Y.yy[At]=this.yy[At]);E.setInput(s,Y.yy),Y.yy.lexer=E,Y.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var kt=E.yylloc;e.push(kt);var me=E.options&&E.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qe(B){u.length=u.length-2*B,A.length=A.length-B,e.length=e.length-B}r(qe,"popStack");function Zt(){var B;return B=d.pop()||E.lex()||Kt,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=l.symbols_[B]||B),B}r(Zt,"lex");for(var w,j,N,Ft,st={},pt,X,Jt,yt;;){if(j=u[u.length-1],this.defaultActions[j]?N=this.defaultActions[j]:((w===null||typeof w>"u")&&(w=Zt()),N=ht[j]&&ht[j][w]),typeof N>"u"||!N.length||!N[0]){var Pt="";yt=[];for(pt in ht[j])this.terminals_[pt]&&pt>ye&&yt.push("'"+this.terminals_[pt]+"'");E.showPosition?Pt="Parse error on line "+(gt+1)+`: -`+E.showPosition()+` -Expecting `+yt.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Pt="Parse error on line "+(gt+1)+": Unexpected "+(w==Kt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Pt,{text:E.match,token:this.terminals_[w]||w,line:E.yylineno,loc:kt,expected:yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+w);switch(N[0]){case 1:u.push(w),A.push(E.yytext),e.push(E.yylloc),u.push(N[1]),w=null,Gt=E.yyleng,n=E.yytext,gt=E.yylineno,kt=E.yylloc;break;case 2:if(X=this.productions_[N[1]][1],st.$=A[A.length-X],st._$={first_line:e[e.length-(X||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(X||1)].first_column,last_column:e[e.length-1].last_column},me&&(st._$.range=[e[e.length-(X||1)].range[0],e[e.length-1].range[1]]),Ft=this.performAction.apply(st,[n,Gt,gt,Y.yy,N[1],A,e].concat(Te)),typeof Ft<"u")return Ft;X&&(u=u.slice(0,-1*X*2),A=A.slice(0,-1*X),e=e.slice(0,-1*X)),u.push(this.productions_[N[1]][0]),A.push(st.$),e.push(st._$),Jt=ht[u[u.length-2]][u[u.length-1]],u.push(Jt);break;case 3:return!0}}return!0},"parse")},pe=(function(){var M={EOF:1,parseError:r(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:r(function(s,l){return this.yy=l||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var l=s.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r(function(s){var l=s.length,u=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),l=new Array(s.length+1).join("-");return s+this.upcomingInput()+` -`+l+"^"},"showPosition"),test_match:r(function(s,l){var u,d,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),d=s[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in A)this[e]=A[e];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),e=0;el[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(s=this.test_match(u,A[e]),s!==!1)return s;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(s=this.test_match(l,A[d]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){var l=this.next();return l||this.lex()},"lex"),begin:r(function(l){this.conditionStack.push(l)},"begin"),popState:r(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:r(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:r(function(l){this.begin(l)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(l,u,d,A){switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return M})();_t.lexer=pe;function ft(){this.yy={}}return r(ft,"Parser"),ft.prototype=_t,_t.Parser=ft,new ft})();Ct.parser=Ct;var Le=Ct,V=Ce(),Ee=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{r(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:D.quadrantChart?.chartWidth||500,chartWidth:D.quadrantChart?.chartHeight||500,titlePadding:D.quadrantChart?.titlePadding||10,titleFontSize:D.quadrantChart?.titleFontSize||20,quadrantPadding:D.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:D.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:D.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:D.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:D.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:D.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:D.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:D.quadrantChart?.pointTextPadding||5,pointLabelFontSize:D.quadrantChart?.pointLabelFontSize||12,pointRadius:D.quadrantChart?.pointRadius||5,xAxisPosition:D.quadrantChart?.xAxisPosition||"top",yAxisPosition:D.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:D.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:D.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:V.quadrant1Fill,quadrant2Fill:V.quadrant2Fill,quadrant3Fill:V.quadrant3Fill,quadrant4Fill:V.quadrant4Fill,quadrant1TextFill:V.quadrant1TextFill,quadrant2TextFill:V.quadrant2TextFill,quadrant3TextFill:V.quadrant3TextFill,quadrant4TextFill:V.quadrant4TextFill,quadrantPointFill:V.quadrantPointFill,quadrantPointTextFill:V.quadrantPointTextFill,quadrantXAxisTextFill:V.quadrantXAxisTextFill,quadrantYAxisTextFill:V.quadrantYAxisTextFill,quadrantTitleFill:V.quadrantTitleFill,quadrantInternalBorderStrokeFill:V.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:V.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,mt.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){mt.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){mt.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){const o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,S={top:f?c:0},q=this.config.quadrantPadding+h.left,b=this.config.quadrantPadding+x.top+S.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,T=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-S.top,m=y/2,g=T/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:S,quadrantSpace:{quadrantLeft:q,quadrantTop:b,quadrantWidth:y,quadrantHalfWidth:m,quadrantHeight:T,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){const{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:S,quadrantTop:q,quadrantWidth:b}=o,y=!!this.data.xAxisRightText,T=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&a&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+q+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+S+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+q+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:q+h-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:q+_-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(t){const{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x,width:o,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(const h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){const{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=$t().domain([0,1]).range([f,x+f]),h=$t().domain([0,1]).range([p+o,o]);return this.data.points.map(S=>{const q=this.classes.get(S.className);return q&&(S={...q,...S}),{x:_(S.x),y:h(S.y),fill:S.color??this.themeConfig.quadrantPointFill,radius:S.radius??this.config.pointRadius,text:{text:S.text,fill:this.themeConfig.quadrantPointTextFill,x:_(S.x),y:h(S.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:S.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:S.strokeWidth??"0px"}})}getBorders(t){const a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},Tt=class extends Error{static{r(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Lt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}r(Lt,"validateHexCode");function ee(t){return!/^\d+$/.test(t)}r(ee,"validateNumber");function ie(t){return!/^\d+px$/.test(t)}r(ie,"validateSizeInPixels");var De=Et();function Q(t){return ve(t.trim(),De)}r(Q,"textSanitizer");var z=new Ee;function ae(t){z.setData({quadrant1Text:Q(t.text)})}r(ae,"setQuadrant1Text");function ne(t){z.setData({quadrant2Text:Q(t.text)})}r(ne,"setQuadrant2Text");function se(t){z.setData({quadrant3Text:Q(t.text)})}r(se,"setQuadrant3Text");function re(t){z.setData({quadrant4Text:Q(t.text)})}r(re,"setQuadrant4Text");function oe(t){z.setData({xAxisLeftText:Q(t.text)})}r(oe,"setXAxisLeftText");function le(t){z.setData({xAxisRightText:Q(t.text)})}r(le,"setXAxisRightText");function he(t){z.setData({yAxisTopText:Q(t.text)})}r(he,"setYAxisTopText");function ce(t){z.setData({yAxisBottomText:Q(t.text)})}r(ce,"setYAxisBottomText");function qt(t){const a={};for(const p of t){const[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(ee(o))throw new Tt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Lt(o))throw new Tt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Lt(o))throw new Tt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(ie(o))throw new Tt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}r(qt,"parseStyles");function de(t,a,p,f,o){const x=qt(o);z.addPoints([{x:p,y:f,text:Q(t.text),className:a,...x}])}r(de,"addPoint");function ue(t,a){z.addClass(t,qt(a))}r(ue,"addClass");function xe(t){z.setConfig({chartWidth:t})}r(xe,"setWidth");function fe(t){z.setConfig({chartHeight:t})}r(fe,"setHeight");function ge(){const t=Et(),{themeVariables:a,quadrantChart:p}=t;return p&&z.setConfig(p),z.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),z.setData({titleText:te()}),z.build()}r(ge,"getQuadrantData");var ze=r(function(){z.clear(),Pe()},"clear"),Ve={setWidth:xe,setHeight:fe,setQuadrant1Text:ae,setQuadrant2Text:ne,setQuadrant3Text:se,setQuadrant4Text:re,setXAxisLeftText:oe,setXAxisRightText:le,setYAxisTopText:he,setYAxisBottomText:ce,parseStyles:qt,addPoint:de,addClass:ue,getQuadrantData:ge,clear:ze,setAccTitle:ke,getAccTitle:Ae,setDiagramTitle:_e,getDiagramTitle:te,getAccDescription:Se,setAccDescription:be},Ie=r((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}r(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}r(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}r(_,"getTransformation");const h=Et();mt.debug(`Rendering quadrant chart -`+t);const c=h.securityLevel;let S;c==="sandbox"&&(S=vt("#i"+a));const b=(c==="sandbox"?vt(S.nodes()[0].contentDocument.body):vt("body")).select(`[id="${a}"]`),y=b.append("g").attr("class","main"),T=h.quadrantChart?.chartWidth??500,m=h.quadrantChart?.chartHeight??500;Fe(b,m,T,h.quadrantChart?.useMaxWidth??!0),b.attr("viewBox","0 0 "+T+" "+m),f.db.setHeight(m),f.db.setWidth(T);const g=f.db.getQuadrantData(),rt=y.append("g").attr("class","quadrants"),ct=y.append("g").attr("class","border"),dt=y.append("g").attr("class","data-points"),ut=y.append("g").attr("class","labels"),xt=y.append("g").attr("class","title");g.title&&xt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&ct.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ot=rt.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),ut.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));const lt=dt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),we={draw:Ie},Me={parser:Le,db:Ve,renderer:we,styles:r(()=>"","styles")};export{Me as diagram}; diff --git a/assets/rawTexture-BDsvmix4.js b/assets/rawTexture-BDsvmix4.js deleted file mode 100644 index a9e2b93b3a9db55e46330906e507b2301c9510f2..0000000000000000000000000000000000000000 --- a/assets/rawTexture-BDsvmix4.js +++ /dev/null @@ -1 +0,0 @@ -import{T as c}from"./index-GY9JDBGV.js";class f extends c{constructor(e,n,s,t,u,r=!0,i=!1,a=3,h=0,l,_,x){super(null,u,!r,i,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,l),this.format=t,this._engine&&(!this._engine._caps.textureFloatLinearFiltering&&h===1&&(a=1),!this._engine._caps.textureHalfFloatLinearFiltering&&h===2&&(a=1),this._texture=this._engine.createRawTexture(e,n,s,t,r,i,a,null,h,l??0,_??!1),this.wrapU=c.CLAMP_ADDRESSMODE,this.wrapV=c.CLAMP_ADDRESSMODE,this._waitingForData=!!x&&!e)}update(e){this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type,this._texture._useSRGBBuffer),this._waitingForData=!1}clone(){if(!this._texture)return super.clone();const e=new f(null,this.getSize().width,this.getSize().height,this.format,this.getScene(),this._texture.generateMipMaps,this._invertY,this.samplingMode,this._texture.type,this._texture._creationFlags,this._useSRGBBuffer);return e._texture=this._texture,this._texture.incrementReferences(),e}isReady(){return super.isReady()&&!this._waitingForData}static CreateLuminanceTexture(e,n,s,t,u=!0,r=!1,i=3){return new f(e,n,s,1,t,u,r,i)}static CreateLuminanceAlphaTexture(e,n,s,t,u=!0,r=!1,i=3){return new f(e,n,s,2,t,u,r,i)}static CreateAlphaTexture(e,n,s,t,u=!0,r=!1,i=3){return new f(e,n,s,0,t,u,r,i)}static CreateRGBTexture(e,n,s,t,u=!0,r=!1,i=3,a=0,h=0,l=!1){return new f(e,n,s,4,t,u,r,i,a,h,l)}static CreateRGBATexture(e,n,s,t,u=!0,r=!1,i=3,a=0,h=0,l=!1,_=!1){return new f(e,n,s,5,t,u,r,i,a,h,l,_)}static CreateRGBAStorageTexture(e,n,s,t,u=!0,r=!1,i=3,a=0,h=!1){return new f(e,n,s,5,t,u,r,i,a,1,h)}static CreateRTexture(e,n,s,t,u=!0,r=!1,i=c.TRILINEAR_SAMPLINGMODE,a=1){return new f(e,n,s,6,t,u,r,i,a)}static CreateRStorageTexture(e,n,s,t,u=!0,r=!1,i=c.TRILINEAR_SAMPLINGMODE,a=1){return new f(e,n,s,6,t,u,r,i,a,1)}}export{f as R}; diff --git a/assets/ray-D2Rlocdw.js b/assets/ray-D2Rlocdw.js deleted file mode 100644 index 03210235dcd506a011ada1404e07d070119b3fdd..0000000000000000000000000000000000000000 --- a/assets/ray-D2Rlocdw.js +++ /dev/null @@ -1 +0,0 @@ -import{aZ as w,M,c as R,V as m,a_ as N,a$ as A,aq as H,ap as q,b0 as G,b1 as U,b as I}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const D={internalPickerForMesh:void 0};class h{constructor(i,e,t=Number.MAX_VALUE,r=N){this.origin=i,this.direction=e,this.length=t,this.epsilon=r}clone(){return new h(this.origin.clone(),this.direction.clone(),this.length)}intersectsBoxMinMax(i,e,t=0){const r=h._TmpVector3[0].copyFromFloats(i.x-t,i.y-t,i.z-t),o=h._TmpVector3[1].copyFromFloats(e.x+t,e.y+t,e.z+t);let s=0,l=Number.MAX_VALUE,f,a,c,u;if(Math.abs(this.direction.x)<1e-7){if(this.origin.xo.x)return!1}else if(f=1/this.direction.x,a=(r.x-this.origin.x)*f,c=(o.x-this.origin.x)*f,c===-1/0&&(c=1/0),a>c&&(u=a,a=c,c=u),s=Math.max(a,s),l=Math.min(c,l),s>l)return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.yo.y)return!1}else if(f=1/this.direction.y,a=(r.y-this.origin.y)*f,c=(o.y-this.origin.y)*f,c===-1/0&&(c=1/0),a>c&&(u=a,a=c,c=u),s=Math.max(a,s),l=Math.min(c,l),s>l)return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.zo.z)return!1}else if(f=1/this.direction.z,a=(r.z-this.origin.z)*f,c=(o.z-this.origin.z)*f,c===-1/0&&(c=1/0),a>c&&(u=a,a=c,c=u),s=Math.max(a,s),l=Math.min(c,l),s>l)return!1;return!0}intersectsBox(i,e=0){return this.intersectsBoxMinMax(i.minimum,i.maximum,e)}intersectsSphere(i,e=0){const t=i.center.x-this.origin.x,r=i.center.y-this.origin.y,o=i.center.z-this.origin.z,s=t*t+r*r+o*o,l=i.radius+e,f=l*l;if(s<=f)return!0;const a=t*this.direction.x+r*this.direction.y+o*this.direction.z;return a<0?!1:s-a*a<=f}intersectsTriangle(i,e,t){const r=h._TmpVector3[0],o=h._TmpVector3[1],s=h._TmpVector3[2],l=h._TmpVector3[3],f=h._TmpVector3[4];e.subtractToRef(i,r),t.subtractToRef(i,o),m.CrossToRef(this.direction,o,s);const a=m.Dot(r,s);if(a===0)return null;const c=1/a;this.origin.subtractToRef(i,l);const u=m.Dot(l,s)*c;if(u<-this.epsilon||u>1+this.epsilon)return null;m.CrossToRef(l,r,f);const d=m.Dot(this.direction,f)*c;if(d<-this.epsilon||u+d>1+this.epsilon)return null;const p=m.Dot(o,f)*c;return p>this.length||p<0?null:new A(1-u-d,u,p)}intersectsPlane(i){let e;const t=m.Dot(i.normal,this.direction);if(Math.abs(t)<999999997475243e-21)return null;{const r=m.Dot(i.normal,this.origin);return e=(-i.d-r)/t,e<0?e<-999999997475243e-21?null:0:e}}intersectsAxis(i,e=0){switch(i){case"y":{const t=(this.origin.y-e)/this.direction.y;return t>0?null:new m(this.origin.x+this.direction.x*-t,e,this.origin.z+this.direction.z*-t)}case"x":{const t=(this.origin.x-e)/this.direction.x;return t>0?null:new m(e,this.origin.y+this.direction.y*-t,this.origin.z+this.direction.z*-t)}case"z":{const t=(this.origin.z-e)/this.direction.z;return t>0?null:new m(this.origin.x+this.direction.x*-t,this.origin.y+this.direction.y*-t,e)}default:return null}}intersectsMesh(i,e,t,r=!1,o,s=!1){const l=R.Matrix[0];return i.getWorldMatrix().invertToRef(l),this._tmpRay?h.TransformToRef(this,l,this._tmpRay):this._tmpRay=h.Transform(this,l),i.intersects(this._tmpRay,e,t,r,o,s)}intersectsMeshes(i,e,t){t?t.length=0:t=[];for(let r=0;re.distance?1:0}intersectionSegment(i,e,t){const r=this.origin,o=R.Vector3[0],s=R.Vector3[1],l=R.Vector3[2],f=R.Vector3[3];e.subtractToRef(i,o),this.direction.scaleToRef(h._Rayl,l),r.addToRef(l,s),i.subtractToRef(r,f);const a=m.Dot(o,o),c=m.Dot(o,l),u=m.Dot(l,l),d=m.Dot(o,f),p=m.Dot(l,f),T=a*u-c*c;let g,x=T,y,k=T;Tx&&(g=x,y=p+c,k=u)),y<0?(y=0,-d<0?g=0:-d>a?g=x:(g=-d,x=a)):y>k&&(y=k,-d+c<0?g=0:-d+c>a?g=x:(g=-d+c,x=a));const P=Math.abs(g)0&&C<=this.length&&W.lengthSquared()=n.distance?null:a}function z(n,i,e,t,r,o){let s=null;const l=!!(n.activeCameras&&n.activeCameras.length>1&&n.cameraToUseForPointers!==n.activeCamera),f=n.cameraToUseForPointers||n.activeCamera,a=D.internalPickerForMesh||Z;for(let c=0;c1&&n.cameraToUseForPointers!==n.activeCamera),s=n.cameraToUseForPointers||n.activeCamera,l=D.internalPickerForMesh||Z;for(let f=0;f(n._tempPickingRay||(n._tempPickingRay=h.Zero()),V(n,i,e,l,n._tempPickingRay,o||null),n._tempPickingRay),t,r,!0);return s&&(s.ray=b(n,i,e,M.Identity(),o||null)),s}function j(n,i,e,t,r,o,s,l=!1){const f=z(n,(a,c)=>(n._tempPickingRay||(n._tempPickingRay=h.Zero()),V(n,i,e,a,n._tempPickingRay,o||null,!1,c),n._tempPickingRay),t,r,!1,s);return f&&(f.ray=b(n,i,e,M.Identity(),o||null)),f}function B(n,i,e,t,r){const o=z(n,s=>(n._pickWithRayInverseMatrix||(n._pickWithRayInverseMatrix=M.Identity()),s.invertToRef(n._pickWithRayInverseMatrix),n._cachedRayForTransform||(n._cachedRayForTransform=h.Zero()),h.TransformToRef(i,n._pickWithRayInverseMatrix,n._cachedRayForTransform),n._cachedRayForTransform),e,t,!1,r);return o&&(o.ray=i),o}function X(n,i,e,t,r,o){return E(n,s=>b(n,i,e,s,r||null),t,o)}function $(n,i,e,t){return E(n,r=>(n._pickWithRayInverseMatrix||(n._pickWithRayInverseMatrix=M.Identity()),r.invertToRef(n._pickWithRayInverseMatrix),n._cachedRayForTransform||(n._cachedRayForTransform=h.Zero()),h.TransformToRef(i,n._pickWithRayInverseMatrix,n._cachedRayForTransform),n._cachedRayForTransform),e,t)}function tt(n,i=100,e,t){return F(n,new h(m.Zero(),m.Zero(),i),i,e,t)}function F(n,i,e=100,t,r){t||(t=n.getWorldMatrix()),i.length=e,r?i.origin.copyFrom(r):i.origin.copyFrom(n.position);const o=R.Vector3[2];o.set(0,0,n._scene.useRightHandedSystem?-1:1);const s=R.Vector3[3];return m.TransformNormalToRef(o,t,s),m.NormalizeToRef(s,i.direction),i}function J(n,i){i&&(i.prototype.getForwardRay=function(e=100,t,r){return F(this,new h(m.Zero(),m.Zero(),e),e,t,r)},i.prototype.getForwardRayToRef=function(e,t=100,r,o){return F(this,e,t,r,o)}),n&&(G._IsPickingAvailable=!0,n.prototype.createPickingRay=function(e,t,r,o,s=!1){return b(this,e,t,r,o,s)})}J(I,U);I.prototype.createPickingRayToRef=function(n,i,e,t,r,o=!1,s=!1){return V(this,n,i,e,t,r,o,s)};I.prototype.createPickingRayInCameraSpace=function(n,i,e){return L(this,n,i,e)};I.prototype.createPickingRayInCameraSpaceToRef=function(n,i,e,t){return S(this,n,i,e,t)};I.prototype.pickWithBoundingInfo=function(n,i,e,t,r){return O(this,n,i,e,t,r)};I.prototype.pick=function(n,i,e,t,r,o,s=!1){return j(this,n,i,e,t,r,o,s)};I.prototype.pickWithRay=function(n,i,e,t){return B(this,n,i,e,t)};I.prototype.multiPick=function(n,i,e,t,r){return X(this,n,i,e,t,r)};I.prototype.multiPickWithRay=function(n,i,e){return $(this,n,i,e)};export{J as AddRayExtensions,b as CreatePickingRay,L as CreatePickingRayInCameraSpace,S as CreatePickingRayInCameraSpaceToRef,V as CreatePickingRayToRef,tt as GetForwardRay,F as GetForwardRayToRef,X as MultiPick,$ as MultiPickWithRay,j as Pick,O as PickWithBoundingInfo,B as PickWithRay,D as PickingCustomization,h as Ray}; diff --git a/assets/requirementDiagram-UZGBJVZJ-DBVFUt9Y.js b/assets/requirementDiagram-UZGBJVZJ-DBVFUt9Y.js deleted file mode 100644 index 8fe032dba6237504cf69a1ceede83955d31c4418..0000000000000000000000000000000000000000 --- a/assets/requirementDiagram-UZGBJVZJ-DBVFUt9Y.js +++ /dev/null @@ -1,64 +0,0 @@ -import{g as je}from"./chunk-55IACEB6-CzYB-Zls.js";import{s as Ge}from"./chunk-QN33PNHL-DUQNEUQT.js";import{_ as o,b as ze,a as Xe,s as Je,g as Ze,p as et,q as tt,c as ke,l as Ne,y as st,B as it,o as rt,r as nt,u as at}from"./mermaid.core-BcqUqpnI.js";import"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var qe=(function(){var e=o(function(P,i,a,c){for(a=a||{},c=P.length;c--;a[P[c]]=i);return a},"o"),u=[1,3],h=[1,4],r=[1,5],n=[1,6],E=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],g=[1,22],R=[2,7],_=[1,26],b=[1,27],N=[1,28],q=[1,29],A=[1,33],C=[1,34],V=[1,35],v=[1,36],x=[1,37],L=[1,38],D=[1,24],O=[1,31],w=[1,32],M=[1,30],d=[1,39],p=[1,40],m=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],$=[1,61],X=[89,90],Ae=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ce=[1,70],Ve=[1,71],ve=[1,72],xe=[1,73],Le=[1,74],De=[1,75],Oe=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],de=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],we=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:o(function(i,a,c,s,f,t,me){var l=t.length-1;switch(f){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:h,11:r,13:n},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:h,11:r,13:n},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(E,[2,6]),{3:12,4:2,6:u,9:h,11:r,13:n},{1:[2,2]},{4:17,5:g,7:13,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},e(E,[2,4]),e(E,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:g,7:42,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:43,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:44,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:45,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:46,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:47,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:48,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:49,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{4:17,5:g,7:50,8:R,9:h,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:_,22:b,23:N,24:q,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:d,90:p},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(m,[2,17]),e(m,[2,18]),e(m,[2,19]),e(m,[2,20]),{30:60,33:62,75:$,89:d,90:p},{30:63,33:62,75:$,89:d,90:p},{30:64,33:62,75:$,89:d,90:p},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ae,[2,81]),e(Ae,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ce,66:Ve,67:ve,68:xe,69:Le,70:De,71:Oe},{62:77,65:Ce,66:Ve,67:ve,68:xe,69:Le,70:De,71:Oe},{30:78,33:62,75:$,89:d,90:p},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(de,[2,60]),e(de,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:$,76:U,89:d,90:p},{5:[1,95]},{30:96,33:62,75:$,89:d,90:p},{5:[1,97]},{30:98,33:62,75:$,89:d,90:p},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(m,[2,59],{76:U}),e(m,[2,64],{76:we}),{33:103,75:[1,102],89:d,90:p},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(m,[2,57],{76:we}),e(m,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:d,90:p},{33:120,89:d,90:p},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(de,[2,61]),e(de,[2,63]),e(T,[2,68]),e(m,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(m,[2,28]),{5:[1,127]},e(m,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(m,[2,47]),{5:[1,131]},e(m,[2,48]),e(m,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:d,90:p},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(m,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(m,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(m,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(m,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(m,[2,26]),e(m,[2,44]),e(m,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:o(function(i,a){if(a.recoverable)this.trace(i);else{var c=new Error(i);throw c.hash=a,c}},"parseError"),parse:o(function(i){var a=this,c=[0],s=[],f=[null],t=[],me=this.table,l="",Re=0,Fe=0,Qe=2,Pe=1,He=t.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(G.yy[Se]=this.yy[Se]);y.setInput(i,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var Ie=y.yylloc;t.push(Ie);var Ke=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function We(I){c.length=c.length-2*I,f.length=f.length-I,t.length=t.length-I}o(We,"popStack");function $e(){var I;return I=s.pop()||y.lex()||Pe,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=a.symbols_[I]||I),I}o($e,"lex");for(var S,z,k,be,J={},ye,F,Ue,ge;;){if(z=c[c.length-1],this.defaultActions[z]?k=this.defaultActions[z]:((S===null||typeof S>"u")&&(S=$e()),k=me[z]&&me[z][S]),typeof k>"u"||!k.length||!k[0]){var Te="";ge=[];for(ye in me[z])this.terminals_[ye]&&ye>Qe&&ge.push("'"+this.terminals_[ye]+"'");y.showPosition?Te="Parse error on line "+(Re+1)+`: -`+y.showPosition()+` -Expecting `+ge.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Te="Parse error on line "+(Re+1)+": Unexpected "+(S==Pe?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Te,{text:y.match,token:this.terminals_[S]||S,line:y.yylineno,loc:Ie,expected:ge})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+S);switch(k[0]){case 1:c.push(S),f.push(y.yytext),t.push(y.yylloc),c.push(k[1]),S=null,Fe=y.yyleng,l=y.yytext,Re=y.yylineno,Ie=y.yylloc;break;case 2:if(F=this.productions_[k[1]][1],J.$=f[f.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},Ke&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),be=this.performAction.apply(J,[l,Fe,Re,G.yy,k[1],f,t].concat(He)),typeof be<"u")return be;F&&(c=c.slice(0,-1*F*2),f=f.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[k[1]][0]),f.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Be=(function(){var P={EOF:1,parseError:o(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:o(function(i,a){return this.yy=a||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var a=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===s.length?this.yylloc.first_column:0)+s[s.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+` -`+a+"^"},"showPosition"),test_match:o(function(i,a){var c,s,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),s=i[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,c,s;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;ta[0].length)){if(a=c,s=t,this.options.backtrack_lexer){if(i=this.test_match(c,f[t]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,f[s]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var a=this.next();return a||this.lex()},"lex"),begin:o(function(a){this.conditionStack.push(a)},"begin"),popState:o(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:o(function(a){this.begin(a)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(a,c,s,f){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return c.yytext=c.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return P})();_e.lexer=Be;function pe(){this.yy={}}return o(pe,"Parser"),pe.prototype=_e,_e.Parser=pe,new pe})();qe.parser=qe;var lt=qe,ct=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=ze,this.getAccTitle=Xe,this.setAccDescription=Je,this.getAccDescription=Ze,this.setDiagramTitle=et,this.getDiagramTitle=tt,this.getConfig=o(()=>ke().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{o(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,u){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),Ne.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,u,h){this.relations.push({type:e,src:u,dst:h})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,st()}setCssStyle(e,u){for(const h of e){const r=this.requirements.get(h)??this.elements.get(h);if(!u||!r)return;for(const n of u)n.includes(",")?r.cssStyles.push(...n.split(",")):r.cssStyles.push(n)}}setClass(e,u){for(const h of e){const r=this.requirements.get(h)??this.elements.get(h);if(r)for(const n of u){r.classes.push(n);const E=this.classes.get(n)?.styles;E&&r.cssStyles.push(...E)}}}defineClass(e,u){for(const h of e){let r=this.classes.get(h);r===void 0&&(r={id:h,styles:[],textStyles:[]},this.classes.set(h,r)),u&&u.forEach(function(n){if(/color/.exec(n)){const E=n.replace("fill","bgFill");r.textStyles.push(E)}r.styles.push(n)}),this.requirements.forEach(n=>{n.classes.includes(h)&&n.cssStyles.push(...u.flatMap(E=>E.split(",")))}),this.elements.forEach(n=>{n.classes.includes(h)&&n.cssStyles.push(...u.flatMap(E=>E.split(",")))})}}getClasses(){return this.classes}getData(){const e=ke(),u=[],h=[];for(const r of this.requirements.values()){const n=r;n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),n.shape="requirementBox",n.look=e.look,u.push(n)}for(const r of this.elements.values()){const n=r;n.shape="requirementBox",n.look=e.look,n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),u.push(n)}for(const r of this.relations){let n=0;const E=r.type===this.Relationships.CONTAINS,g={id:`${r.src}-${r.dst}-${n}`,start:this.requirements.get(r.src)?.name??this.elements.get(r.src)?.name,end:this.requirements.get(r.dst)?.name??this.elements.get(r.dst)?.name,label:`<<${r.type}>>`,classes:"relationshipLine",style:["fill:none",E?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:E?"normal":"dashed",arrowTypeStart:E?"requirement_contains":"",arrowTypeEnd:E?"":"requirement_arrow",look:e.look};h.push(g),n++}return{nodes:u,edges:h,other:{},config:e,direction:this.getDirection()}}},ot=o(e=>` - - marker { - fill: ${e.relationColor}; - stroke: ${e.relationColor}; - } - - marker.cross { - stroke: ${e.lineColor}; - } - - svg { - font-family: ${e.fontFamily}; - font-size: ${e.fontSize}; - } - - .reqBox { - fill: ${e.requirementBackground}; - fill-opacity: 1.0; - stroke: ${e.requirementBorderColor}; - stroke-width: ${e.requirementBorderSize}; - } - - .reqTitle, .reqLabel{ - fill: ${e.requirementTextColor}; - } - .reqLabelBox { - fill: ${e.relationLabelBackground}; - fill-opacity: 1.0; - } - - .req-title-line { - stroke: ${e.requirementBorderColor}; - stroke-width: ${e.requirementBorderSize}; - } - .relationshipLine { - stroke: ${e.relationColor}; - stroke-width: 1; - } - .relationshipLabel { - fill: ${e.relationLabelColor}; - } - .divider { - stroke: ${e.nodeBorder}; - stroke-width: 1; - } - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - .labelBkg { - background-color: ${e.edgeLabelBackground}; - } - -`,"getStyles"),ht=ot,Ye={};it(Ye,{draw:()=>ut});var ut=o(async function(e,u,h,r){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:n,state:E,layout:g}=ke(),R=r.db.getData(),_=je(u,n);R.type=r.type,R.layoutAlgorithm=rt(g),R.nodeSpacing=E?.nodeSpacing??50,R.rankSpacing=E?.rankSpacing??50,R.markers=["requirement_contains","requirement_arrow"],R.diagramId=u,await nt(R,_);const b=8;at.insertTitle(_,"requirementDiagramTitleText",E?.titleTopMargin??25,r.db.getDiagramTitle()),Ge(_,b,"requirementDiagram",E?.useMaxWidth??!0)},"draw"),_t={parser:lt,get db(){return new ct},renderer:Ye,styles:ht};export{_t as diagram}; diff --git a/assets/rgbdDecode.fragment-BVeFs8hQ.js b/assets/rgbdDecode.fragment-BVeFs8hQ.js deleted file mode 100644 index 4cfc7c50e39639675c6823ad06ced38205a857e3..0000000000000000000000000000000000000000 --- a/assets/rgbdDecode.fragment-BVeFs8hQ.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="rgbdDecodePixelShader",o=`varying vec2 vUV;uniform sampler2D textureSampler; -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const i={name:e,shader:o};export{i as rgbdDecodePixelShader}; diff --git a/assets/rgbdDecode.fragment-Bwx0l1La.js b/assets/rgbdDecode.fragment-Bwx0l1La.js deleted file mode 100644 index 066aadcc1b062ee1f880b42204ef67068c5ca452..0000000000000000000000000000000000000000 --- a/assets/rgbdDecode.fragment-Bwx0l1La.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-Wgh3PIP0.js";import"./index-DydPgVMC.js";const e="rgbdDecodePixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=vec4f(fromRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV)),1.0);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const n={name:e,shader:t};export{n as rgbdDecodePixelShaderWGSL}; diff --git a/assets/rgbdEncode.fragment-BhXqHHTO.js b/assets/rgbdEncode.fragment-BhXqHHTO.js deleted file mode 100644 index d63ab79cb4bf842c3ef0cbadae33400fa6e6fc5a..0000000000000000000000000000000000000000 --- a/assets/rgbdEncode.fragment-BhXqHHTO.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-tBt4f_K3.js";import"./index-DydPgVMC.js";const e="rgbdEncodePixelShader",o=`varying vec2 vUV;uniform sampler2D textureSampler; -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);}`;r.ShadersStore[e]||(r.ShadersStore[e]=o);const i={name:e,shader:o};export{i as rgbdEncodePixelShader}; diff --git a/assets/rgbdEncode.fragment-CBosLrtw.js b/assets/rgbdEncode.fragment-CBosLrtw.js deleted file mode 100644 index 0091d4f25cb87806e14c3074e864bfce4b0ed78f..0000000000000000000000000000000000000000 --- a/assets/rgbdEncode.fragment-CBosLrtw.js +++ /dev/null @@ -1,5 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./helperFunctions-Wgh3PIP0.js";import"./index-DydPgVMC.js";const e="rgbdEncodePixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=toRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb);}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const m={name:e,shader:t};export{m as rgbdEncodePixelShaderWGSL}; diff --git a/assets/samplerFragmentDeclaration-Bn5G_87U.js b/assets/samplerFragmentDeclaration-Bn5G_87U.js deleted file mode 100644 index aba3dddaef63e6ca7dc8b2472fd13c689c69d665..0000000000000000000000000000000000000000 --- a/assets/samplerFragmentDeclaration-Bn5G_87U.js +++ /dev/null @@ -1,19 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const E="samplerFragmentDeclaration",_=`#ifdef _DEFINENAME_ -#if _DEFINENAME_DIRECTUV==1 -#define v_VARYINGNAME_UV vMainUV1 -#elif _DEFINENAME_DIRECTUV==2 -#define v_VARYINGNAME_UV vMainUV2 -#elif _DEFINENAME_DIRECTUV==3 -#define v_VARYINGNAME_UV vMainUV3 -#elif _DEFINENAME_DIRECTUV==4 -#define v_VARYINGNAME_UV vMainUV4 -#elif _DEFINENAME_DIRECTUV==5 -#define v_VARYINGNAME_UV vMainUV5 -#elif _DEFINENAME_DIRECTUV==6 -#define v_VARYINGNAME_UV vMainUV6 -#else -varying v_VARYINGNAME_UV: vec2f; -#endif -var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d; -#endif -`;e.IncludesShadersStoreWGSL[E]||(e.IncludesShadersStoreWGSL[E]=_); diff --git a/assets/sankeyDiagram-TZEHDZUN-Cmk6HWvP.js b/assets/sankeyDiagram-TZEHDZUN-Cmk6HWvP.js deleted file mode 100644 index 303990733cc3be1eb1ed6d6a47d2cb38c4fba455..0000000000000000000000000000000000000000 --- a/assets/sankeyDiagram-TZEHDZUN-Cmk6HWvP.js +++ /dev/null @@ -1,10 +0,0 @@ -import{p as mt,q as kt,s as _t,g as xt,b as vt,a as bt,_ as p,c as ot,z as St,T as wt,y as Lt,j as Et}from"./mermaid.core-BcqUqpnI.js";import{o as At}from"./ordinal-BeghXfj9.js";import{c as Tt}from"./colors-Cc3OSVma.js";import{s as G}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";const Mt=Tt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function at(t,n){let s;if(n===void 0)for(const c of t)c!=null&&(s=c)&&(s=c);else{let c=-1;for(let h of t)(h=n(h,++c,t))!=null&&(s=h)&&(s=h)}return s}function dt(t,n){let s;if(n===void 0)for(const c of t)c!=null&&(s>c||s===void 0&&c>=c)&&(s=c);else{let c=-1;for(let h of t)(h=n(h,++c,t))!=null&&(s>h||s===void 0&&h>=h)&&(s=h)}return s}function J(t,n){let s=0;if(n===void 0)for(let c of t)(c=+c)&&(s+=c);else{let c=-1;for(let h of t)(h=+n(h,++c,t))&&(s+=h)}return s}function Nt(t){return t.target.depth}function It(t){return t.depth}function Pt(t,n){return n-1-t.height}function pt(t,n){return t.sourceLinks.length?t.depth:n-1}function Ct(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,n){return q(t.source,n.source)||t.index-n.index}function ct(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function tt(t){return t.value}function Ot(t){return t.index}function zt(t){return t.nodes}function Dt(t){return t.links}function ut(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function ht({nodes:t}){for(const n of t){let s=n.y0,c=s;for(const h of n.sourceLinks)h.y0=s+h.width/2,s+=h.width;for(const h of n.targetLinks)h.y1=c+h.width/2,c+=h.width}}function $t(){let t=0,n=0,s=1,c=1,h=24,b=8,g,k=Ot,i=pt,o,a,_=zt,x=Dt,y=6;function v(){const e={nodes:_.apply(null,arguments),links:x.apply(null,arguments)};return M(e),T(e),N(e),C(e),w(e),ht(e),e}v.update=function(e){return ht(e),e},v.nodeId=function(e){return arguments.length?(k=typeof e=="function"?e:Y(e),v):k},v.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:Y(e),v):i},v.nodeSort=function(e){return arguments.length?(o=e,v):o},v.nodeWidth=function(e){return arguments.length?(h=+e,v):h},v.nodePadding=function(e){return arguments.length?(b=g=+e,v):b},v.nodes=function(e){return arguments.length?(_=typeof e=="function"?e:Y(e),v):_},v.links=function(e){return arguments.length?(x=typeof e=="function"?e:Y(e),v):x},v.linkSort=function(e){return arguments.length?(a=e,v):a},v.size=function(e){return arguments.length?(t=n=0,s=+e[0],c=+e[1],v):[s-t,c-n]},v.extent=function(e){return arguments.length?(t=+e[0][0],s=+e[1][0],n=+e[0][1],c=+e[1][1],v):[[t,n],[s,c]]},v.iterations=function(e){return arguments.length?(y=+e,v):y};function M({nodes:e,links:f}){for(const[l,r]of e.entries())r.index=l,r.sourceLinks=[],r.targetLinks=[];const u=new Map(e.map((l,r)=>[k(l,r,e),l]));for(const[l,r]of f.entries()){r.index=l;let{source:m,target:S}=r;typeof m!="object"&&(m=r.source=ut(u,m)),typeof S!="object"&&(S=r.target=ut(u,S)),m.sourceLinks.push(r),S.targetLinks.push(r)}if(a!=null)for(const{sourceLinks:l,targetLinks:r}of e)l.sort(a),r.sort(a)}function T({nodes:e}){for(const f of e)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function N({nodes:e}){const f=e.length;let u=new Set(e),l=new Set,r=0;for(;u.size;){for(const m of u){m.depth=r;for(const{target:S}of m.sourceLinks)l.add(S)}if(++r>f)throw new Error("circular link");u=l,l=new Set}}function C({nodes:e}){const f=e.length;let u=new Set(e),l=new Set,r=0;for(;u.size;){for(const m of u){m.height=r;for(const{source:S}of m.targetLinks)l.add(S)}if(++r>f)throw new Error("circular link");u=l,l=new Set}}function D({nodes:e}){const f=at(e,r=>r.depth)+1,u=(s-t-h)/(f-1),l=new Array(f);for(const r of e){const m=Math.max(0,Math.min(f-1,Math.floor(i.call(null,r,f))));r.layer=m,r.x0=t+m*u,r.x1=r.x0+h,l[m]?l[m].push(r):l[m]=[r]}if(o)for(const r of l)r.sort(o);return l}function B(e){const f=dt(e,u=>(c-n-(u.length-1)*g)/J(u,tt));for(const u of e){let l=n;for(const r of u){r.y0=l,r.y1=l+r.value*f,l=r.y1+g;for(const m of r.sourceLinks)m.width=m.value*f}l=(c-l+g)/(u.length+1);for(let r=0;ru.length)-1)),B(f);for(let u=0;u0))continue;let V=(L/R-S.y0)*f;S.y0+=V,S.y1+=V,E(S)}o===void 0&&m.sort(q),O(m,u)}}function j(e,f,u){for(let l=e.length,r=l-2;r>=0;--r){const m=e[r];for(const S of m){let L=0,R=0;for(const{target:U,value:Z}of S.sourceLinks){let W=Z*(U.layer-S.layer);L+=I(S,U)*W,R+=W}if(!(R>0))continue;let V=(L/R-S.y0)*f;S.y0+=V,S.y1+=V,E(S)}o===void 0&&m.sort(q),O(m,u)}}function O(e,f){const u=e.length>>1,l=e[u];d(e,l.y0-g,u-1,f),z(e,l.y1+g,u+1,f),d(e,c,e.length-1,f),z(e,n,0,f)}function z(e,f,u,l){for(;u1e-6&&(r.y0+=m,r.y1+=m),f=r.y1+g}}function d(e,f,u,l){for(;u>=0;--u){const r=e[u],m=(r.y1-f)*l;m>1e-6&&(r.y0-=m,r.y1-=m),f=r.y0-g}}function E({sourceLinks:e,targetLinks:f}){if(a===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ct);for(const{target:{targetLinks:u}}of e)u.sort(lt)}}function A(e){if(a===void 0)for(const{sourceLinks:f,targetLinks:u}of e)f.sort(ct),u.sort(lt)}function $(e,f){let u=e.y0-(e.sourceLinks.length-1)*g/2;for(const{target:l,width:r}of e.sourceLinks){if(l===f)break;u+=r+g}for(const{source:l,width:r}of f.targetLinks){if(l===e)break;u-=r}return u}function I(e,f){let u=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:l,width:r}of f.targetLinks){if(l===e)break;u+=r+g}for(const{target:l,width:r}of e.sourceLinks){if(l===f)break;u-=r}return u}return v}var et=Math.PI,nt=2*et,F=1e-6,jt=nt-F;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function gt(){return new it}it.prototype=gt.prototype={constructor:it,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,c){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+c)},bezierCurveTo:function(t,n,s,c,h,b){this._+="C"+ +t+","+ +n+","+ +s+","+ +c+","+(this._x1=+h)+","+(this._y1=+b)},arcTo:function(t,n,s,c,h){t=+t,n=+n,s=+s,c=+c,h=+h;var b=this._x1,g=this._y1,k=s-t,i=c-n,o=b-t,a=g-n,_=o*o+a*a;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(_>F)if(!(Math.abs(a*k-i*o)>F)||!h)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var x=s-b,y=c-g,v=k*k+i*i,M=x*x+y*y,T=Math.sqrt(v),N=Math.sqrt(_),C=h*Math.tan((et-Math.acos((v+_-M)/(2*T*N)))/2),D=C/N,B=C/T;Math.abs(D-1)>F&&(this._+="L"+(t+D*o)+","+(n+D*a)),this._+="A"+h+","+h+",0,0,"+ +(a*x>o*y)+","+(this._x1=t+B*k)+","+(this._y1=n+B*i)}},arc:function(t,n,s,c,h,b){t=+t,n=+n,s=+s,b=!!b;var g=s*Math.cos(c),k=s*Math.sin(c),i=t+g,o=n+k,a=1^b,_=b?c-h:h-c;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>F||Math.abs(this._y1-o)>F)&&(this._+="L"+i+","+o),s&&(_<0&&(_=_%nt+nt),_>jt?this._+="A"+s+","+s+",0,1,"+a+","+(t-g)+","+(n-k)+"A"+s+","+s+",0,1,"+a+","+(this._x1=i)+","+(this._y1=o):_>F&&(this._+="A"+s+","+s+",0,"+ +(_>=et)+","+a+","+(this._x1=t+s*Math.cos(h))+","+(this._y1=n+s*Math.sin(h))))},rect:function(t,n,s,c){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +c+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Rt(t){return t[1]}var Ft=Array.prototype.slice;function Vt(t){return t.source}function Ut(t){return t.target}function Wt(t){var n=Vt,s=Ut,c=Bt,h=Rt,b=null;function g(){var k,i=Ft.call(arguments),o=n.apply(this,i),a=s.apply(this,i);if(b||(b=k=gt()),t(b,+c.apply(this,(i[0]=o,i)),+h.apply(this,i),+c.apply(this,(i[0]=a,i)),+h.apply(this,i)),k)return b=null,k+""||null}return g.source=function(k){return arguments.length?(n=k,g):n},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(c=typeof k=="function"?k:ft(+k),g):c},g.y=function(k){return arguments.length?(h=typeof k=="function"?k:ft(+k),g):h},g.context=function(k){return arguments.length?(b=k??null,g):b},g}function Gt(t,n,s,c,h){t.moveTo(n,s),t.bezierCurveTo(n=(n+c)/2,s,n,h,c,h)}function Yt(){return Wt(Gt)}function qt(t){return[t.source.x1,t.y0]}function Ht(t){return[t.target.x0,t.y1]}function Xt(){return Yt().source(qt).target(Ht)}var st=(function(){var t=p(function(k,i,o,a){for(o=o||{},a=k.length;a--;o[k[a]]=i);return o},"o"),n=[1,9],s=[1,10],c=[1,5,10,12],h={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(i,o,a,_,x,y,v){var M=y.length-1;switch(x){case 7:const T=_.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=_.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());_.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(c,[2,8]),t(c,[2,9]),{19:[1,16]},t(c,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(c,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(i,o){if(o.recoverable)this.trace(i);else{var a=new Error(i);throw a.hash=o,a}},"parseError"),parse:p(function(i){var o=this,a=[0],_=[],x=[null],y=[],v=this.table,M="",T=0,N=0,C=2,D=1,B=y.slice.call(arguments,1),w=Object.create(this.lexer),P={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(P.yy[j]=this.yy[j]);w.setInput(i,P.yy),P.yy.lexer=w,P.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var O=w.yylloc;y.push(O);var z=w.options&&w.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(L){a.length=a.length-2*L,x.length=x.length-L,y.length=y.length-L}p(d,"popStack");function E(){var L;return L=_.pop()||w.lex()||D,typeof L!="number"&&(L instanceof Array&&(_=L,L=_.pop()),L=o.symbols_[L]||L),L}p(E,"lex");for(var A,$,I,e,f={},u,l,r,m;;){if($=a[a.length-1],this.defaultActions[$]?I=this.defaultActions[$]:((A===null||typeof A>"u")&&(A=E()),I=v[$]&&v[$][A]),typeof I>"u"||!I.length||!I[0]){var S="";m=[];for(u in v[$])this.terminals_[u]&&u>C&&m.push("'"+this.terminals_[u]+"'");w.showPosition?S="Parse error on line "+(T+1)+`: -`+w.showPosition()+` -Expecting `+m.join(", ")+", got '"+(this.terminals_[A]||A)+"'":S="Parse error on line "+(T+1)+": Unexpected "+(A==D?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(S,{text:w.match,token:this.terminals_[A]||A,line:w.yylineno,loc:O,expected:m})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+A);switch(I[0]){case 1:a.push(A),x.push(w.yytext),y.push(w.yylloc),a.push(I[1]),A=null,N=w.yyleng,M=w.yytext,T=w.yylineno,O=w.yylloc;break;case 2:if(l=this.productions_[I[1]][1],f.$=x[x.length-l],f._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},z&&(f._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),e=this.performAction.apply(f,[M,N,T,P.yy,I[1],x,y].concat(B)),typeof e<"u")return e;l&&(a=a.slice(0,-1*l*2),x=x.slice(0,-1*l),y=y.slice(0,-1*l)),a.push(this.productions_[I[1]][0]),x.push(f.$),y.push(f._$),r=v[a[a.length-2]][a[a.length-1]],a.push(r);break;case 3:return!0}}return!0},"parse")},b=(function(){var k={EOF:1,parseError:p(function(o,a){if(this.yy.parser)this.yy.parser.parseError(o,a);else throw new Error(o)},"parseError"),setInput:p(function(i,o){return this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:p(function(i){var o=i.length,a=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===_.length?this.yylloc.first_column:0)+_[_.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(i){this.unput(this.match.slice(i))},"less"),pastInput:p(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+` -`+o+"^"},"showPosition"),test_match:p(function(i,o){var a,_,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),_=i[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],a=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var y in x)this[y]=x[y];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,a,_;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),y=0;yo[0].length)){if(o=a,_=y,this.options.backtrack_lexer){if(i=this.test_match(a,x[y]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,x[_]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(o,a,_,x){switch(_){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();h.lexer=b;function g(){this.yy={}}return p(g,"Parser"),g.prototype=h,h.Parser=g,new g})();st.parser=st;var H=st,Q=[],K=[],X=new Map,Qt=p(()=>{Q=[],K=[],X=new Map,Lt()},"clear"),Kt=class{constructor(t,n,s=0){this.source=t,this.target=n,this.value=s}static{p(this,"SankeyLink")}},Zt=p((t,n,s)=>{Q.push(new Kt(t,n,s))},"addLink"),Jt=class{constructor(t){this.ID=t}static{p(this,"SankeyNode")}},te=p(t=>{t=Et.sanitizeText(t,ot());let n=X.get(t);return n===void 0&&(n=new Jt(t),X.set(t,n),K.push(n)),n},"findOrCreateNode"),ee=p(()=>K,"getNodes"),ne=p(()=>Q,"getLinks"),ie=p(()=>({nodes:K.map(t=>({id:t.ID})),links:Q.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),se={nodesMap:X,getConfig:p(()=>ot().sankey,"getConfig"),getNodes:ee,getLinks:ne,getGraph:ie,addLink:Zt,findOrCreateNode:te,getAccTitle:bt,setAccTitle:vt,getAccDescription:xt,setAccDescription:_t,getDiagramTitle:kt,setDiagramTitle:mt,clear:Qt},yt=class rt{static{p(this,"Uid")}static{this.count=0}static next(n){return new rt(n+ ++rt.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}},re={left:It,right:Pt,center:Ct,justify:pt},oe=p(function(t,n,s,c){const{securityLevel:h,sankey:b}=ot(),g=St.sankey;let k;h==="sandbox"&&(k=G("#i"+n));const i=h==="sandbox"?G(k.nodes()[0].contentDocument.body):G("body"),o=h==="sandbox"?i.select(`[id="${n}"]`):G(`[id="${n}"]`),a=b?.width??g.width,_=b?.height??g.width,x=b?.useMaxWidth??g.useMaxWidth,y=b?.nodeAlignment??g.nodeAlignment,v=b?.prefix??g.prefix,M=b?.suffix??g.suffix,T=b?.showValues??g.showValues,N=c.db.getGraph(),C=re[y];$t().nodeId(d=>d.id).nodeWidth(10).nodePadding(10+(T?15:0)).nodeAlign(C).extent([[0,0],[a,_]])(N);const w=At(Mt);o.append("g").attr("class","nodes").selectAll(".node").data(N.nodes).join("g").attr("class","node").attr("id",d=>(d.uid=yt.next("node-")).id).attr("transform",function(d){return"translate("+d.x0+","+d.y0+")"}).attr("x",d=>d.x0).attr("y",d=>d.y0).append("rect").attr("height",d=>d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",d=>w(d.id));const P=p(({id:d,value:E})=>T?`${d} -${v}${Math.round(E*100)/100}${M}`:d,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(N.nodes).join("text").attr("x",d=>d.x0
                (d.y1+d.y0)/2).attr("dy",`${T?"0":"0.35"}em`).attr("text-anchor",d=>d.x0(E.uid=yt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",E=>E.source.x1).attr("x2",E=>E.target.x0);d.append("stop").attr("offset","0%").attr("stop-color",E=>w(E.source.id)),d.append("stop").attr("offset","100%").attr("stop-color",E=>w(E.target.id))}let z;switch(O){case"gradient":z=p(d=>d.uid,"coloring");break;case"source":z=p(d=>w(d.source.id),"coloring");break;case"target":z=p(d=>w(d.target.id),"coloring");break;default:z=O}j.append("path").attr("d",Xt()).attr("stroke",z).attr("stroke-width",d=>Math.max(1,d.width)),wt(void 0,o,0,x)},"draw"),ae={draw:oe},le=p(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),ce=p(t=>`.label { - font-family: ${t.fontFamily}; - }`,"getStyles"),ue=ce,he=H.parse.bind(H);H.parse=t=>he(le(t));var ve={styles:ue,parser:H,db:se,renderer:ae};export{ve as diagram}; diff --git a/assets/sceneUboDeclaration-3A3jW23h.js b/assets/sceneUboDeclaration-3A3jW23h.js deleted file mode 100644 index 196ac88a17ebadfa0e58e98900982c8755726270..0000000000000000000000000000000000000000 --- a/assets/sceneUboDeclaration-3A3jW23h.js +++ /dev/null @@ -1,6 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const o="sceneUboDeclaration",t=`layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection; -#ifdef MULTIVIEW -mat4 viewProjectionR; -#endif -mat4 view;mat4 projection;vec4 vEyePosition;}; -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=t); diff --git a/assets/sceneUboDeclaration-mnAEeY6M.js b/assets/sceneUboDeclaration-mnAEeY6M.js deleted file mode 100644 index b60d7b99f4dd0adcbb55e95cd82bd752e851f72e..0000000000000000000000000000000000000000 --- a/assets/sceneUboDeclaration-mnAEeY6M.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const o="sceneUboDeclaration",n=`struct Scene {viewProjection : mat4x4, -#ifdef MULTIVIEW -viewProjectionR : mat4x4, -#endif -view : mat4x4, -projection : mat4x4, -vEyePosition : vec4,}; -#define SCENE_UBO -var scene : Scene; -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=n); diff --git a/assets/sequenceDiagram-WL72ISMW-C17NbP5x.js b/assets/sequenceDiagram-WL72ISMW-C17NbP5x.js deleted file mode 100644 index 892e697c919b7aebb799c07b189d58c1783787a6..0000000000000000000000000000000000000000 --- a/assets/sequenceDiagram-WL72ISMW-C17NbP5x.js +++ /dev/null @@ -1,145 +0,0 @@ -import{a as me,b as Kt,g as ct,d as we,c as Xt,e as Jt}from"./chunk-TZMSLE5B-xeQXGdbb.js";import{_ as f,n as ve,c as st,l as Q,i as ae,d as Ie,e as Le,j as I,b as ee,s as _e,p as Ae,a as ke,g as Pe,q as Ne,t as Se,J as Me,y as Re,h as Nt,u as W,M as z,N as Lt,O as re,Z as De,P as Ce,Q as ie,G as zt}from"./mermaid.core-BcqUqpnI.js";import{I as Oe}from"./chunk-QZHKN3VN-CdTgv_Ss.js";import{s as St}from"./select-BigU4G0v.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var Ht=(function(){var e=f(function(pt,v,A,L){for(A=A||{},L=pt.length;L--;A[pt[L]]=v);return A},"o"),t=[1,2],n=[1,3],s=[1,4],r=[2,4],i=[1,9],c=[1,11],h=[1,13],o=[1,14],a=[1,16],p=[1,17],g=[1,18],x=[1,24],y=[1,25],m=[1,26],w=[1,27],k=[1,28],N=[1,29],S=[1,30],O=[1,31],B=[1,32],q=[1,33],H=[1,34],Z=[1,35],at=[1,36],U=[1,37],G=[1,38],F=[1,39],D=[1,41],$=[1,42],K=[1,43],j=[1,44],rt=[1,45],R=[1,46],E=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],_=[2,71],X=[4,5,16,50,52,53],tt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],M=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],Bt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],Qt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],ot=[69,70,71],lt=[1,127],Vt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:f(function(v,A,L,b,C,d,vt){var u=d.length-1;switch(C){case 3:return b.apply(d[u]),d[u];case 4:case 9:this.$=[];break;case 5:case 10:d[u-1].push(d[u]),this.$=d[u-1];break;case 6:case 7:case 11:case 12:this.$=d[u];break;case 8:case 13:this.$=[];break;case 15:d[u].type="createParticipant",this.$=d[u];break;case 16:d[u-1].unshift({type:"boxStart",boxData:b.parseBoxData(d[u-2])}),d[u-1].push({type:"boxEnd",boxText:d[u-2]}),this.$=d[u-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(d[u-2]),sequenceIndexStep:Number(d[u-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(d[u-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:d[u-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:d[u-1].actor};break;case 29:b.setDiagramTitle(d[u].substring(6)),this.$=d[u].substring(6);break;case 30:b.setDiagramTitle(d[u].substring(7)),this.$=d[u].substring(7);break;case 31:this.$=d[u].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=d[u].trim(),b.setAccDescription(this.$);break;case 34:d[u-1].unshift({type:"loopStart",loopText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.LOOP_START}),d[u-1].push({type:"loopEnd",loopText:d[u-2],signalType:b.LINETYPE.LOOP_END}),this.$=d[u-1];break;case 35:d[u-1].unshift({type:"rectStart",color:b.parseMessage(d[u-2]),signalType:b.LINETYPE.RECT_START}),d[u-1].push({type:"rectEnd",color:b.parseMessage(d[u-2]),signalType:b.LINETYPE.RECT_END}),this.$=d[u-1];break;case 36:d[u-1].unshift({type:"optStart",optText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.OPT_START}),d[u-1].push({type:"optEnd",optText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.OPT_END}),this.$=d[u-1];break;case 37:d[u-1].unshift({type:"altStart",altText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.ALT_START}),d[u-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=d[u-1];break;case 38:d[u-1].unshift({type:"parStart",parText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.PAR_START}),d[u-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=d[u-1];break;case 39:d[u-1].unshift({type:"parStart",parText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.PAR_OVER_START}),d[u-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=d[u-1];break;case 40:d[u-1].unshift({type:"criticalStart",criticalText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.CRITICAL_START}),d[u-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=d[u-1];break;case 41:d[u-1].unshift({type:"breakStart",breakText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.BREAK_START}),d[u-1].push({type:"breakEnd",optText:b.parseMessage(d[u-2]),signalType:b.LINETYPE.BREAK_END}),this.$=d[u-1];break;case 43:this.$=d[u-3].concat([{type:"option",optionText:b.parseMessage(d[u-1]),signalType:b.LINETYPE.CRITICAL_OPTION},d[u]]);break;case 45:this.$=d[u-3].concat([{type:"and",parText:b.parseMessage(d[u-1]),signalType:b.LINETYPE.PAR_AND},d[u]]);break;case 47:this.$=d[u-3].concat([{type:"else",altText:b.parseMessage(d[u-1]),signalType:b.LINETYPE.ALT_ELSE},d[u]]);break;case 48:d[u-3].draw="participant",d[u-3].type="addParticipant",d[u-3].description=b.parseMessage(d[u-1]),this.$=d[u-3];break;case 49:d[u-1].draw="participant",d[u-1].type="addParticipant",this.$=d[u-1];break;case 50:d[u-3].draw="actor",d[u-3].type="addParticipant",d[u-3].description=b.parseMessage(d[u-1]),this.$=d[u-3];break;case 51:d[u-1].draw="actor",d[u-1].type="addParticipant",this.$=d[u-1];break;case 52:d[u-1].type="destroyParticipant",this.$=d[u-1];break;case 53:d[u-1].draw="participant",d[u-1].type="addParticipant",this.$=d[u-1];break;case 54:this.$=[d[u-1],{type:"addNote",placement:d[u-2],actor:d[u-1].actor,text:d[u]}];break;case 55:d[u-2]=[].concat(d[u-1],d[u-1]).slice(0,2),d[u-2][0]=d[u-2][0].actor,d[u-2][1]=d[u-2][1].actor,this.$=[d[u-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:d[u-2].slice(0,2),text:d[u]}];break;case 56:this.$=[d[u-1],{type:"addLinks",actor:d[u-1].actor,text:d[u]}];break;case 57:this.$=[d[u-1],{type:"addALink",actor:d[u-1].actor,text:d[u]}];break;case 58:this.$=[d[u-1],{type:"addProperties",actor:d[u-1].actor,text:d[u]}];break;case 59:this.$=[d[u-1],{type:"addDetails",actor:d[u-1].actor,text:d[u]}];break;case 62:this.$=[d[u-2],d[u]];break;case 63:this.$=d[u];break;case 64:this.$=b.PLACEMENT.LEFTOF;break;case 65:this.$=b.PLACEMENT.RIGHTOF;break;case 66:this.$=[d[u-4],d[u-1],{type:"addMessage",from:d[u-4].actor,to:d[u-1].actor,signalType:d[u-3],msg:d[u],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:d[u-1].actor}];break;case 67:this.$=[d[u-4],d[u-1],{type:"addMessage",from:d[u-4].actor,to:d[u-1].actor,signalType:d[u-3],msg:d[u]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:d[u-4].actor}];break;case 68:this.$=[d[u-3],d[u-1],{type:"addMessage",from:d[u-3].actor,to:d[u-1].actor,signalType:d[u-2],msg:d[u]}];break;case 69:this.$={type:"addParticipant",actor:d[u-1],config:d[u]};break;case 70:this.$=d[u-1].trim();break;case 71:this.$={type:"addParticipant",actor:d[u]};break;case 72:this.$=b.LINETYPE.SOLID_OPEN;break;case 73:this.$=b.LINETYPE.DOTTED_OPEN;break;case 74:this.$=b.LINETYPE.SOLID;break;case 75:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=b.LINETYPE.DOTTED;break;case 77:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=b.LINETYPE.SOLID_CROSS;break;case 79:this.$=b.LINETYPE.DOTTED_CROSS;break;case 80:this.$=b.LINETYPE.SOLID_POINT;break;case 81:this.$=b.LINETYPE.DOTTED_POINT;break;case 82:this.$=b.parseMessage(d[u].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:n,6:s},{1:[3]},{3:5,4:t,5:n,6:s},{3:6,4:t,5:n,6:s},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:c,8:8,9:10,12:12,13:h,14:o,17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},e(E,[2,5]),{9:47,12:12,13:h,14:o,17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},e(E,[2,7]),e(E,[2,8]),e(E,[2,14]),{12:48,50:U,52:G,53:F},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:R},{22:55,71:R},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(E,[2,29]),e(E,[2,30]),{32:[1,61]},{34:[1,62]},e(E,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:R},{22:75,71:R},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:R},{22:92,71:R},{22:93,71:R},{22:94,71:R},e([5,51,65,76,77,78,79,80,81,82,83,84,85,86],_),e(E,[2,6]),e(E,[2,15]),e(X,[2,9],{10:95}),e(E,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},e(E,[2,21]),{5:[1,99]},{5:[1,100]},e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,27]),e(E,[2,28]),e(E,[2,31]),e(E,[2,32]),e(tt,r,{7:101}),e(tt,r,{7:102}),e(tt,r,{7:103}),e(M,r,{40:104,7:105}),e(Bt,r,{42:106,7:107}),e(Bt,r,{7:107,42:108}),e(Qt,r,{45:109,7:110}),e(tt,r,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},e([5,51],_,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:R},e(ot,[2,72]),e(ot,[2,73]),e(ot,[2,74]),e(ot,[2,75]),e(ot,[2,76]),e(ot,[2,77]),e(ot,[2,78]),e(ot,[2,79]),e(ot,[2,80]),e(ot,[2,81]),{22:123,71:R},{22:125,59:124,71:R},{71:[2,64]},{71:[2,65]},{57:126,86:lt},{57:128,86:lt},{57:129,86:lt},{57:130,86:lt},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:U,52:G,53:F},{5:[1,136]},e(E,[2,19]),e(E,[2,20]),e(E,[2,22]),e(E,[2,23]),{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[1,137],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[1,138],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[1,139],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{16:[1,140]},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[2,46],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,49:[1,141],50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{16:[1,142]},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[2,44],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,48:[1,143],50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{16:[1,144]},{16:[1,145]},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[2,42],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,47:[1,146],50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{4:i,5:c,8:8,9:10,12:12,13:h,14:o,16:[1,147],17:15,18:a,21:p,22:40,23:g,24:19,25:20,26:21,27:22,28:23,29:x,30:y,31:m,33:w,35:k,36:N,37:S,38:O,39:B,41:q,43:H,44:Z,46:at,50:U,52:G,53:F,55:D,60:$,61:K,62:j,63:rt,71:R},{15:[1,148]},e(E,[2,49]),e(E,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},e(E,[2,51]),e(E,[2,52]),{22:151,71:R},{22:152,71:R},{57:153,86:lt},{57:154,86:lt},{57:155,86:lt},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},e(E,[2,16]),e(X,[2,10]),{12:157,50:U,52:G,53:F},e(X,[2,12]),e(X,[2,13]),e(E,[2,18]),e(E,[2,34]),e(E,[2,35]),e(E,[2,36]),e(E,[2,37]),{15:[1,158]},e(E,[2,38]),{15:[1,159]},e(E,[2,39]),e(E,[2,40]),{15:[1,160]},e(E,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:lt},{57:165,86:lt},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:R},e(X,[2,11]),e(M,r,{7:105,40:167}),e(Bt,r,{7:107,42:168}),e(Qt,r,{7:110,45:169}),e(E,[2,48]),{5:[2,70]},e(E,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:f(function(v,A){if(A.recoverable)this.trace(v);else{var L=new Error(v);throw L.hash=A,L}},"parseError"),parse:f(function(v){var A=this,L=[0],b=[],C=[null],d=[],vt=this.table,u="",At=0,Zt=0,ye=2,$t=1,Te=d.slice.call(arguments,1),Y=Object.create(this.lexer),ft={yy:{}};for(var Yt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Yt)&&(ft.yy[Yt]=this.yy[Yt]);Y.setInput(v,ft.yy),ft.yy.lexer=Y,ft.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Wt=Y.yylloc;d.push(Wt);var Ee=Y.options&&Y.options.ranges;typeof ft.yy.parseError=="function"?this.parseError=ft.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(et){L.length=L.length-2*et,C.length=C.length-et,d.length=d.length-et}f(be,"popStack");function jt(){var et;return et=b.pop()||Y.lex()||$t,typeof et!="number"&&(et instanceof Array&&(b=et,et=b.pop()),et=A.symbols_[et]||et),et}f(jt,"lex");for(var J,yt,it,Ft,bt={},kt,ht,te,Pt;;){if(yt=L[L.length-1],this.defaultActions[yt]?it=this.defaultActions[yt]:((J===null||typeof J>"u")&&(J=jt()),it=vt[yt]&&vt[yt][J]),typeof it>"u"||!it.length||!it[0]){var qt="";Pt=[];for(kt in vt[yt])this.terminals_[kt]&&kt>ye&&Pt.push("'"+this.terminals_[kt]+"'");Y.showPosition?qt="Parse error on line "+(At+1)+`: -`+Y.showPosition()+` -Expecting `+Pt.join(", ")+", got '"+(this.terminals_[J]||J)+"'":qt="Parse error on line "+(At+1)+": Unexpected "+(J==$t?"end of input":"'"+(this.terminals_[J]||J)+"'"),this.parseError(qt,{text:Y.match,token:this.terminals_[J]||J,line:Y.yylineno,loc:Wt,expected:Pt})}if(it[0]instanceof Array&&it.length>1)throw new Error("Parse Error: multiple actions possible at state: "+yt+", token: "+J);switch(it[0]){case 1:L.push(J),C.push(Y.yytext),d.push(Y.yylloc),L.push(it[1]),J=null,Zt=Y.yyleng,u=Y.yytext,At=Y.yylineno,Wt=Y.yylloc;break;case 2:if(ht=this.productions_[it[1]][1],bt.$=C[C.length-ht],bt._$={first_line:d[d.length-(ht||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(ht||1)].first_column,last_column:d[d.length-1].last_column},Ee&&(bt._$.range=[d[d.length-(ht||1)].range[0],d[d.length-1].range[1]]),Ft=this.performAction.apply(bt,[u,Zt,At,ft.yy,it[1],C,d].concat(Te)),typeof Ft<"u")return Ft;ht&&(L=L.slice(0,-1*ht*2),C=C.slice(0,-1*ht),d=d.slice(0,-1*ht)),L.push(this.productions_[it[1]][0]),C.push(bt.$),d.push(bt._$),te=vt[L[L.length-2]][L[L.length-1]],L.push(te);break;case 3:return!0}}return!0},"parse")},fe=(function(){var pt={EOF:1,parseError:f(function(A,L){if(this.yy.parser)this.yy.parser.parseError(A,L);else throw new Error(A)},"parseError"),setInput:f(function(v,A){return this.yy=A||this.yy||{},this._input=v,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var v=this._input[0];this.yytext+=v,this.yyleng++,this.offset++,this.match+=v,this.matched+=v;var A=v.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),v},"input"),unput:f(function(v){var A=v.length,L=v.split(/(?:\r\n?|\n)/g);this._input=v+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),L.length-1&&(this.yylineno-=L.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:L?(L.length===b.length?this.yylloc.first_column:0)+b[b.length-L.length].length-L[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(v){this.unput(this.match.slice(v))},"less"),pastInput:f(function(){var v=this.matched.substr(0,this.matched.length-this.match.length);return(v.length>20?"...":"")+v.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var v=this.match;return v.length<20&&(v+=this._input.substr(0,20-v.length)),(v.substr(0,20)+(v.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var v=this.pastInput(),A=new Array(v.length+1).join("-");return v+this.upcomingInput()+` -`+A+"^"},"showPosition"),test_match:f(function(v,A){var L,b,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),b=v[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+v[0].length},this.yytext+=v[0],this.match+=v[0],this.matches=v,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(v[0].length),this.matched+=v[0],L=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),L)return L;if(this._backtrack){for(var d in C)this[d]=C[d];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var v,A,L,b;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),d=0;dA[0].length)){if(A=L,b=d,this.options.backtrack_lexer){if(v=this.test_match(L,C[d]),v!==!1)return v;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(v=this.test_match(A,C[b]),v!==!1?v:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var A=this.next();return A||this.lex()},"lex"),begin:f(function(A){this.conditionStack.push(A)},"begin"),popState:f(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:f(function(A){this.begin(A)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(A,L,b,C){switch(b){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:return L.yytext=L.yytext.trim(),71;case 11:return L.yytext=L.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 17:return L.yytext=L.yytext.trim(),this.begin("ALIAS"),71;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 56:return 5;case 57:return L.yytext=L.yytext.trim(),71;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:return 86;case 69:return 86;case 70:return 69;case 71:return 70;case 72:return 5;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};return pt})();Vt.lexer=fe;function _t(){this.yy={}}return f(_t,"Parser"),_t.prototype=Vt,Vt.Parser=_t,new _t})();Ht.parser=Ht;var Be=Ht,Ve={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},Ye={FILLED:0,OPEN:1},We={LEFTOF:0,RIGHTOF:1,OVER:2},Mt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Fe=class{constructor(){this.state=new Oe(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ee,this.setAccDescription=_e,this.setDiagramTitle=Ae,this.getAccTitle=ke,this.getAccDescription=Pe,this.getDiagramTitle=Ne,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(st().wrap),this.LINETYPE=Ve,this.ARROWTYPE=Ye,this.PLACEMENT=We}static{f(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,s,r){let i=this.state.records.currentBox,c;if(r!==void 0){let o;r.includes(` -`)?o=r+` -`:o=`{ -`+r+` -}`,c=Se(o,{schema:Me})}s=c?.type??s;const h=this.state.records.actors.get(e);if(h){if(this.state.records.currentBox&&h.box&&this.state.records.currentBox!==h.box)throw new Error(`A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=h.box?h.box:this.state.records.currentBox,h.box=i,h&&t===h.name&&n==null)return}if(n?.text==null&&(n={text:t,type:s}),(s==null||n.text==null)&&(n={text:t,type:s}),this.state.records.actors.set(e,{box:i,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:s??"participant"}),this.state.records.prevActor){const o=this.state.records.actors.get(this.state.records.prevActor);o&&(o.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},c}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??"",wrap:n?.wrap??this.autoWrap(),type:s,activate:r}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:st().sequence?.wrap??!1}clear(){this.state.reset(),Re()}parseMessage(e){const t=e.trim(),{wrap:n,cleanedText:s}=this.extractWrap(t),r={text:s,wrap:n};return Q.debug(`parseMessage: ${JSON.stringify(r)}`),r}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=t?.[1]?t[1].trim():"transparent",s=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",n)||(n="transparent",s=e.trim());else{const c=new Option().style;c.color=n,c.color!==n&&(n="transparent",s=e.trim())}const{wrap:r,cleanedText:i}=this.extractWrap(s);return{text:i?Nt(i,st()):void 0,color:n,wrap:r}}addNote(e,t,n){const s={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},r=[].concat(e,e);this.state.records.notes.push(s),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:r[0],to:r[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const n=this.getActor(e);try{let s=Nt(t.text,st());s=s.replace(/=/g,"="),s=s.replace(/&/g,"&");const r=JSON.parse(s);this.insertLinks(n,r)}catch(s){Q.error("error while parsing actor link text",s)}}addALink(e,t){const n=this.getActor(e);try{const s={};let r=Nt(t.text,st());const i=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const c=r.slice(0,i-1).trim(),h=r.slice(i+1).trim();s[c]=h,this.insertLinks(n,s)}catch(s){Q.error("error while parsing actor link text",s)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(const n in t)e.links[n]=t[n]}addProperties(e,t){const n=this.getActor(e);try{const s=Nt(t.text,st()),r=JSON.parse(s);this.insertProperties(n,r)}catch(s){Q.error("error while parsing actor properties text",s)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(const n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const n=this.getActor(e),s=document.getElementById(t.text);try{const r=s.innerHTML,i=JSON.parse(r);i.properties&&this.insertProperties(n,i.properties),i.links&&this.insertLinks(n,i.links)}catch(r){Q.error("error while parsing actor details text",r)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":ee(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return st().sequence}},qe=f(e=>`.actor { - stroke: ${e.actorBorder}; - fill: ${e.actorBkg}; - } - - text.actor > tspan { - fill: ${e.actorTextColor}; - stroke: none; - } - - .actor-line { - stroke: ${e.actorLineColor}; - } - - .innerArc { - stroke-width: 1.5; - stroke-dasharray: none; - } - - .messageLine0 { - stroke-width: 1.5; - stroke-dasharray: none; - stroke: ${e.signalColor}; - } - - .messageLine1 { - stroke-width: 1.5; - stroke-dasharray: 2, 2; - stroke: ${e.signalColor}; - } - - #arrowhead path { - fill: ${e.signalColor}; - stroke: ${e.signalColor}; - } - - .sequenceNumber { - fill: ${e.sequenceNumberColor}; - } - - #sequencenumber { - fill: ${e.signalColor}; - } - - #crosshead path { - fill: ${e.signalColor}; - stroke: ${e.signalColor}; - } - - .messageText { - fill: ${e.signalTextColor}; - stroke: none; - } - - .labelBox { - stroke: ${e.labelBoxBorderColor}; - fill: ${e.labelBoxBkgColor}; - } - - .labelText, .labelText > tspan { - fill: ${e.labelTextColor}; - stroke: none; - } - - .loopText, .loopText > tspan { - fill: ${e.loopTextColor}; - stroke: none; - } - - .loopLine { - stroke-width: 2px; - stroke-dasharray: 2, 2; - stroke: ${e.labelBoxBorderColor}; - fill: ${e.labelBoxBorderColor}; - } - - .note { - //stroke: #decc93; - stroke: ${e.noteBorderColor}; - fill: ${e.noteBkgColor}; - } - - .noteText, .noteText > tspan { - fill: ${e.noteTextColor}; - stroke: none; - } - - .activation0 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .activation1 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .activation2 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .actorPopupMenu { - position: absolute; - } - - .actorPopupMenuPanel { - position: absolute; - fill: ${e.actorBkg}; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); -} - .actor-man line { - stroke: ${e.actorBorder}; - fill: ${e.actorBkg}; - } - .actor-man circle, line { - stroke: ${e.actorBorder}; - fill: ${e.actorBkg}; - stroke-width: 2px; - } - -`,"getStyles"),ze=qe,Tt=36,gt="actor-top",xt="actor-bottom",Dt="actor-box",ut="actor-man",It=f(function(e,t){return we(e,t)},"drawRect"),He=f(function(e,t,n,s,r){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const i=t.links,c=t.actorCnt,h=t.rectData;var o="none";r&&(o="block !important");const a=e.append("g");a.attr("id","actor"+c+"_popup"),a.attr("class","actorPopupMenu"),a.attr("display",o);var p="";h.class!==void 0&&(p=" "+h.class);let g=h.width>n?h.width:n;const x=a.append("rect");if(x.attr("class","actorPopupMenuPanel"+p),x.attr("x",h.x),x.attr("y",h.height),x.attr("fill",h.fill),x.attr("stroke",h.stroke),x.attr("width",g),x.attr("height",h.height),x.attr("rx",h.rx),x.attr("ry",h.ry),i!=null){var y=20;for(let k in i){var m=a.append("a"),w=ae.sanitizeUrl(i[k]);m.attr("xlink:href",w),m.attr("target","_blank"),ps(s)(k,m,h.x+10,h.height+y,g,20,{class:"actor"},s),y+=30}}return x.attr("height",y),{height:h.height+y,width:g}},"drawPopup"),Ct=f(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Rt=f(async function(e,t,n=null){let s=e.append("foreignObject");const r=await ie(t.text,zt()),c=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(s.attr("height",Math.round(c.height)).attr("width",Math.round(c.width)),t.class==="noteText"){const h=e.node().firstChild;h.setAttribute("height",c.height+2*t.textMargin);const o=h.getBBox();s.attr("x",Math.round(o.x+o.width/2-c.width/2)).attr("y",Math.round(o.y+o.height/2-c.height/2))}else if(n){let{startx:h,stopx:o,starty:a}=n;if(h>o){const p=h;h=o,o=p}s.attr("x",Math.round(h+Math.abs(h-o)/2-c.width/2)),t.class==="loopText"?s.attr("y",Math.round(a)):s.attr("y",Math.round(a-c.height))}return[s]},"drawKatex"),wt=f(function(e,t){let n=0,s=0;const r=t.text.split(I.lineBreakRegex),[i,c]=re(t.fontSize);let h=[],o=0,a=f(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":a=f(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":a=f(()=>Math.round(t.y+(n+s+t.textMargin)/2),"yfunc");break;case"bottom":case"end":a=f(()=>Math.round(t.y+(n+s+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,g]of r.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(o=p*i);const x=e.append("text");x.attr("x",t.x),x.attr("y",a()),t.anchor!==void 0&&x.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&x.style("font-family",t.fontFamily),c!==void 0&&x.style("font-size",c),t.fontWeight!==void 0&&x.style("font-weight",t.fontWeight),t.fill!==void 0&&x.attr("fill",t.fill),t.class!==void 0&&x.attr("class",t.class),t.dy!==void 0?x.attr("dy",t.dy):o!==0&&x.attr("dy",o);const y=g||De;if(t.tspan){const m=x.append("tspan");m.attr("x",t.x),t.fill!==void 0&&m.attr("fill",t.fill),m.text(y)}else x.text(y);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(s+=(x._groups||x)[0][0].getBBox().height,n=s),h.push(x)}return h},"drawText"),ne=f(function(e,t){function n(r,i,c,h,o){return r+","+i+" "+(r+c)+","+i+" "+(r+c)+","+(i+h-o)+" "+(r+c-o*1.2)+","+(i+h)+" "+r+","+(i+h)}f(n,"genPoints");const s=e.append("polygon");return s.attr("points",n(t.x,t.y,t.width,t.height,7)),s.attr("class","labelBox"),t.y=t.y+t.height/2,wt(e,t),s},"drawLabel"),P=-1,oe=f((e,t,n,s)=>{e.select&&n.forEach(r=>{const i=t.get(r),c=e.select("#actor"+i.actorCnt);!s.mirrorActors&&i.stopy?c.attr("y2",i.stopy+i.height/2):s.mirrorActors&&c.attr("y2",i.stopy)})},"fixLifeLineHeights"),Ue=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+t.height,h=e.append("g").lower();var o=h;s||(P++,Object.keys(t.links||{}).length&&!n.forceMenus&&o.attr("onclick",Ct(`actor${P}_popup`)).attr("cursor","pointer"),o.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),o=h.append("g"),t.actorCnt=P,t.links!=null&&o.attr("id","root-"+P));const a=ct();var p="actor";t.properties?.class?p=t.properties.class:a.fill="#eaeaea",s?p+=` ${xt}`:p+=` ${gt}`,a.x=t.x,a.y=r,a.width=t.width,a.height=t.height,a.class=p,a.rx=3,a.ry=3,a.name=t.name;const g=It(o,a);if(t.rectData=a,t.properties?.icon){const y=t.properties.icon.trim();y.charAt(0)==="@"?Xt(o,a.x+a.width-20,a.y+10,y.substr(1)):Jt(o,a.x+a.width-20,a.y+10,y)}dt(n,z(t.description))(t.description,o,a.x,a.y,a.width,a.height,{class:`actor ${Dt}`},n);let x=t.height;if(g.node){const y=g.node().getBBox();t.height=y.height,x=y.height}return x},"drawActorTypeParticipant"),Ge=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+t.height,h=e.append("g").lower();var o=h;s||(P++,Object.keys(t.links||{}).length&&!n.forceMenus&&o.attr("onclick",Ct(`actor${P}_popup`)).attr("cursor","pointer"),o.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),o=h.append("g"),t.actorCnt=P,t.links!=null&&o.attr("id","root-"+P));const a=ct();var p="actor";t.properties?.class?p=t.properties.class:a.fill="#eaeaea",s?p+=` ${xt}`:p+=` ${gt}`,a.x=t.x,a.y=r,a.width=t.width,a.height=t.height,a.class=p,a.name=t.name;const g=6,x={...a,x:a.x+-g,y:a.y+ +g,class:"actor"},y=It(o,a);if(It(o,x),t.rectData=a,t.properties?.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?Xt(o,a.x+a.width-20,a.y+10,w.substr(1)):Jt(o,a.x+a.width-20,a.y+10,w)}dt(n,z(t.description))(t.description,o,a.x-g,a.y+g,a.width,a.height,{class:`actor ${Dt}`},n);let m=t.height;if(y.node){const w=y.node().getBBox();t.height=w.height,m=w.height}return m},"drawActorTypeCollections"),Ke=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+t.height,h=e.append("g").lower();let o=h;s||(P++,Object.keys(t.links||{}).length&&!n.forceMenus&&o.attr("onclick",Ct(`actor${P}_popup`)).attr("cursor","pointer"),o.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),o=h.append("g"),t.actorCnt=P,t.links!=null&&o.attr("id","root-"+P));const a=ct();let p="actor";t.properties?.class?p=t.properties.class:a.fill="#eaeaea",s?p+=` ${xt}`:p+=` ${gt}`,a.x=t.x,a.y=r,a.width=t.width,a.height=t.height,a.class=p,a.name=t.name;const g=a.height/2,x=g/(2.5+a.height/50),y=o.append("g"),m=o.append("g");if(y.append("path").attr("d",`M ${a.x},${a.y+g} - a ${x},${g} 0 0 0 0,${a.height} - h ${a.width-2*x} - a ${x},${g} 0 0 0 0,-${a.height} - Z - `).attr("class",p),m.append("path").attr("d",`M ${a.x},${a.y+g} - a ${x},${g} 0 0 0 0,${a.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",p),y.attr("transform",`translate(${x}, ${-(a.height/2)})`),m.attr("transform",`translate(${a.width-x}, ${-a.height/2})`),t.rectData=a,t.properties?.icon){const N=t.properties.icon.trim(),S=a.x+a.width-20,O=a.y+10;N.charAt(0)==="@"?Xt(o,S,O,N.substr(1)):Jt(o,S,O,N)}dt(n,z(t.description))(t.description,o,a.x,a.y,a.width,a.height,{class:`actor ${Dt}`},n);let w=t.height;const k=y.select("path:last-child");if(k.node()){const N=k.node().getBBox();t.height=N.height,w=N.height}return w},"drawActorTypeQueue"),Xe=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+75,h=e.append("g").lower();s||(P++,h.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=P);const o=e.append("g");let a=ut;s?a+=` ${xt}`:a+=` ${gt}`,o.attr("class",a),o.attr("name",t.name);const p=ct();p.x=t.x,p.y=r,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor";const g=t.x+t.width/2,x=r+30,y=18;o.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),o.append("circle").attr("cx",g).attr("cy",x).attr("r",y).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),o.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${g}, ${x-y})`);const m=o.node().getBBox();return t.height=m.height+2*(n?.sequence?.labelBoxHeight??0),dt(n,z(t.description))(t.description,o,p.x,p.y+y+(s?5:10),p.width,p.height,{class:`actor ${ut}`},n),t.height},"drawActorTypeControl"),Je=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+75,h=e.append("g").lower(),o=e.append("g");let a=ut;s?a+=` ${xt}`:a+=` ${gt}`,o.attr("class",a),o.attr("name",t.name);const p=ct();p.x=t.x,p.y=r,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor";const g=t.x+t.width/2,x=r+(s?10:25),y=18;o.append("circle").attr("cx",g).attr("cy",x).attr("r",y).attr("width",t.width).attr("height",t.height),o.append("line").attr("x1",g-y).attr("x2",g+y).attr("y1",x+y).attr("y2",x+y).attr("stroke","#333").attr("stroke-width",2);const m=o.node().getBBox();return t.height=m.height+(n?.sequence?.labelBoxHeight??0),s||(P++,h.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=P),dt(n,z(t.description))(t.description,o,p.x,p.y+(s?(x-r+y-5)/2:(x+y-r)/2),p.width,p.height,{class:`actor ${ut}`},n),s?o.attr("transform",`translate(0, ${y/2})`):o.attr("transform",`translate(0, ${y/2})`),t.height},"drawActorTypeEntity"),Qe=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+t.height+2*n.boxTextMargin,h=e.append("g").lower();let o=h;s||(P++,Object.keys(t.links||{}).length&&!n.forceMenus&&o.attr("onclick",Ct(`actor${P}_popup`)).attr("cursor","pointer"),o.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),o=h.append("g"),t.actorCnt=P,t.links!=null&&o.attr("id","root-"+P));const a=ct();let p="actor";t.properties?.class?p=t.properties.class:a.fill="#eaeaea",s?p+=` ${xt}`:p+=` ${gt}`,a.x=t.x,a.y=r,a.width=t.width,a.height=t.height,a.class=p,a.name=t.name,a.x=t.x,a.y=r;const g=a.width/4,x=a.width/4,y=g/2,m=y/(2.5+g/50),w=o.append("g"),k=` - M ${a.x},${a.y+m} - a ${y},${m} 0 0 0 ${g},0 - a ${y},${m} 0 0 0 -${g},0 - l 0,${x-2*m} - a ${y},${m} 0 0 0 ${g},0 - l 0,-${x-2*m} -`;w.append("path").attr("d",k).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",p),s?w.attr("transform",`translate(${g*1.5}, ${a.height/4-2*m})`):w.attr("transform",`translate(${g*1.5}, ${(a.height+m)/4})`),t.rectData=a,dt(n,z(t.description))(t.description,o,a.x,a.y+(s?(a.height+x)/4:(a.height+m)/2),a.width,a.height,{class:`actor ${Dt}`},n);const N=w.select("path:last-child");if(N.node()){const S=N.node().getBBox();t.height=S.height+(n.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Ze=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+80,h=30,o=e.append("g").lower();s||(P++,o.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=P);const a=e.append("g");let p=ut;s?p+=` ${xt}`:p+=` ${gt}`,a.attr("class",p),a.attr("name",t.name);const g=ct();g.x=t.x,g.y=r,g.fill="#eaeaea",g.width=t.width,g.height=t.height,g.class="actor",a.append("line").attr("id","actor-man-torso"+P).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+10).attr("x2",t.x+t.width/2-15).attr("y2",r+10),a.append("line").attr("id","actor-man-arms"+P).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+0).attr("x2",t.x+t.width/2-h*2.5).attr("y2",r+20),a.append("circle").attr("cx",t.x+t.width/2).attr("cy",r+10).attr("r",h);const x=a.node().getBBox();return t.height=x.height+(n.sequence.labelBoxHeight??0),dt(n,z(t.description))(t.description,a,g.x,g.y+(s?h/2-4:h/2+3),g.width,g.height,{class:`actor ${ut}`},n),s?a.attr("transform",`translate(0,${h/2+7})`):a.attr("transform",`translate(0,${h/2+7})`),t.height},"drawActorTypeBoundary"),$e=f(function(e,t,n,s){const r=s?t.stopy:t.starty,i=t.x+t.width/2,c=r+80,h=e.append("g").lower();s||(P++,h.append("line").attr("id","actor"+P).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=P);const o=e.append("g");let a=ut;s?a+=` ${xt}`:a+=` ${gt}`,o.attr("class",a),o.attr("name",t.name);const p=ct();p.x=t.x,p.y=r,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor",p.rx=3,p.ry=3,o.append("line").attr("id","actor-man-torso"+P).attr("x1",i).attr("y1",r+25).attr("x2",i).attr("y2",r+45),o.append("line").attr("id","actor-man-arms"+P).attr("x1",i-Tt/2).attr("y1",r+33).attr("x2",i+Tt/2).attr("y2",r+33),o.append("line").attr("x1",i-Tt/2).attr("y1",r+60).attr("x2",i).attr("y2",r+45),o.append("line").attr("x1",i).attr("y1",r+45).attr("x2",i+Tt/2-2).attr("y2",r+60);const g=o.append("circle");g.attr("cx",t.x+t.width/2),g.attr("cy",r+10),g.attr("r",15),g.attr("width",t.width),g.attr("height",t.height);const x=o.node().getBBox();return t.height=x.height,dt(n,z(t.description))(t.description,o,p.x,p.y+35,p.width,p.height,{class:`actor ${ut}`},n),t.height},"drawActorTypeActor"),je=f(async function(e,t,n,s){switch(t.type){case"actor":return await $e(e,t,n,s);case"participant":return await Ue(e,t,n,s);case"boundary":return await Ze(e,t,n,s);case"control":return await Xe(e,t,n,s);case"entity":return await Je(e,t,n,s);case"database":return await Qe(e,t,n,s);case"collections":return await Ge(e,t,n,s);case"queue":return await Ke(e,t,n,s)}},"drawActor"),ts=f(function(e,t,n){const r=e.append("g");ce(r,t),t.name&&dt(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},n),r.lower()},"drawBox"),es=f(function(e){return e.append("g")},"anchorElement"),ss=f(function(e,t,n,s,r){const i=ct(),c=t.anchored;i.x=t.startx,i.y=t.starty,i.class="activation"+r%3,i.width=t.stopx-t.startx,i.height=n-t.starty,It(c,i)},"drawActivation"),as=f(async function(e,t,n,s){const{boxMargin:r,boxTextMargin:i,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:o,messageFontSize:a,messageFontWeight:p}=s,g=e.append("g"),x=f(function(w,k,N,S){return g.append("line").attr("x1",w).attr("y1",k).attr("x2",N).attr("y2",S).attr("class","loopLine")},"drawLoopLine");x(t.startx,t.starty,t.stopx,t.starty),x(t.stopx,t.starty,t.stopx,t.stopy),x(t.startx,t.stopy,t.stopx,t.stopy),x(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(w){x(t.startx,w.y,t.stopx,w.y).style("stroke-dasharray","3, 3")});let y=Kt();y.text=n,y.x=t.startx,y.y=t.starty,y.fontFamily=o,y.fontSize=a,y.fontWeight=p,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=h||50,y.height=c||20,y.textMargin=i,y.class="labelText",ne(g,y),y=le(),y.text=t.title,y.x=t.startx+h/2+(t.stopx-t.startx)/2,y.y=t.starty+r+i,y.anchor="middle",y.valign="middle",y.textMargin=i,y.class="loopText",y.fontFamily=o,y.fontSize=a,y.fontWeight=p,y.wrap=!0;let m=z(y.text)?await Rt(g,y,t):wt(g,y);if(t.sectionTitles!==void 0){for(const[w,k]of Object.entries(t.sectionTitles))if(k.message){y.text=k.message,y.x=t.startx+(t.stopx-t.startx)/2,y.y=t.sections[w].y+r+i,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=o,y.fontSize=a,y.fontWeight=p,y.wrap=t.wrap,z(y.text)?(t.starty=t.sections[w].y,await Rt(g,y,t)):wt(g,y);let N=Math.round(m.map(S=>(S._groups||S)[0][0].getBBox().height).reduce((S,O)=>S+O));t.sections[w].height+=N-(r+i)}}return t.height=Math.round(t.stopy-t.starty),g},"drawLoop"),ce=f(function(e,t){me(e,t)},"drawBackgroundRect"),rs=f(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),is=f(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),ns=f(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),os=f(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),cs=f(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),ls=f(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),hs=f(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),le=f(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),ds=f(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),dt=(function(){function e(i,c,h,o,a,p,g){const x=c.append("text").attr("x",h+a/2).attr("y",o+p/2+5).style("text-anchor","middle").text(i);r(x,g)}f(e,"byText");function t(i,c,h,o,a,p,g,x){const{actorFontSize:y,actorFontFamily:m,actorFontWeight:w}=x,[k,N]=re(y),S=i.split(I.lineBreakRegex);for(let O=0;Oe.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:f(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:f(function(e){this.boxes.push(e)},"addBox"),addActor:f(function(e){this.actors.push(e)},"addActor"),addLoop:f(function(e){this.loops.push(e)},"addLoop"),addMessage:f(function(e){this.messages.push(e)},"addMessage"),addNote:f(function(e){this.notes.push(e)},"addNote"),lastActor:f(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:f(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:f(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:f(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:f(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,pe(st())},"init"),updateVal:f(function(e,t,n,s){e[t]===void 0?e[t]=n:e[t]=s(n,e[t])},"updateVal"),updateBounds:f(function(e,t,n,s){const r=this;let i=0;function c(h){return f(function(a){i++;const p=r.sequenceItems.length-i+1;r.updateVal(a,"starty",t-p*l.boxMargin,Math.min),r.updateVal(a,"stopy",s+p*l.boxMargin,Math.max),r.updateVal(T.data,"startx",e-p*l.boxMargin,Math.min),r.updateVal(T.data,"stopx",n+p*l.boxMargin,Math.max),h!=="activation"&&(r.updateVal(a,"startx",e-p*l.boxMargin,Math.min),r.updateVal(a,"stopx",n+p*l.boxMargin,Math.max),r.updateVal(T.data,"starty",t-p*l.boxMargin,Math.min),r.updateVal(T.data,"stopy",s+p*l.boxMargin,Math.max))},"updateItemBounds")}f(c,"updateFn"),this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},"updateBounds"),insert:f(function(e,t,n,s){const r=I.getMin(e,n),i=I.getMax(e,n),c=I.getMin(t,s),h=I.getMax(t,s);this.updateVal(T.data,"startx",r,Math.min),this.updateVal(T.data,"starty",c,Math.min),this.updateVal(T.data,"stopx",i,Math.max),this.updateVal(T.data,"stopy",h,Math.max),this.updateBounds(r,c,i,h)},"insert"),newActivation:f(function(e,t,n){const s=n.get(e.from),r=Ot(e.from).length||0,i=s.x+s.width/2+(r-1)*l.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+l.activationWidth,stopy:void 0,actor:e.from,anchored:V.anchorElement(t)})},"newActivation"),endActivation:f(function(e){const t=this.activations.map(function(n){return n.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:f(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:f(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:f(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:f(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:f(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:T.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:f(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:f(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:f(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=I.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:f(function(){return this.verticalPos},"getVerticalPos"),getBounds:f(function(){return{bounds:this.data,models:this.models}},"getBounds")},us=f(async function(e,t){T.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=T.getVerticalPos();const n=ct();n.x=t.startx,n.y=t.starty,n.width=t.width||l.width,n.class="note";const s=e.append("g"),r=V.drawRect(s,n),i=Kt();i.x=t.startx,i.y=t.starty,i.width=n.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=l.noteFontFamily,i.fontSize=l.noteFontSize,i.fontWeight=l.noteFontWeight,i.anchor=l.noteAlign,i.textMargin=l.noteMargin,i.valign="center";const c=z(i.text)?await Rt(s,i):wt(s,i),h=Math.round(c.map(o=>(o._groups||o)[0][0].getBBox().height).reduce((o,a)=>o+a));r.attr("height",h+2*l.noteMargin),t.height+=h+2*l.noteMargin,T.bumpVerticalPos(h+2*l.noteMargin),t.stopy=t.starty+h+2*l.noteMargin,t.stopx=t.startx+n.width,T.insert(t.startx,t.starty,t.stopx,t.stopy),T.models.addNote(t)},"drawNote"),Et=f(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),mt=f(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Ut=f(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function he(e,t){T.bumpVerticalPos(10);const{startx:n,stopx:s,message:r}=t,i=I.splitBreaks(r).length,c=z(r),h=c?await Lt(r,st()):W.calculateTextDimensions(r,Et(l));if(!c){const g=h.height/i;t.height+=g,T.bumpVerticalPos(g)}let o,a=h.height-10;const p=h.width;if(n===s){o=T.getVerticalPos()+a,l.rightAngles||(a+=l.boxMargin,o=T.getVerticalPos()+a),a+=30;const g=I.getMax(p/2,l.width/2);T.insert(n-g,T.getVerticalPos()-10+a,s+g,T.getVerticalPos()+30+a)}else a+=l.boxMargin,o=T.getVerticalPos()+a,T.insert(n,o-10,s,o);return T.bumpVerticalPos(a),t.height+=a,t.stopy=t.starty+t.height,T.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),o}f(he,"boundMessage");var gs=f(async function(e,t,n,s){const{startx:r,stopx:i,starty:c,message:h,type:o,sequenceIndex:a,sequenceVisible:p}=t,g=W.calculateTextDimensions(h,Et(l)),x=Kt();x.x=r,x.y=c+10,x.width=i-r,x.class="messageText",x.dy="1em",x.text=h,x.fontFamily=l.messageFontFamily,x.fontSize=l.messageFontSize,x.fontWeight=l.messageFontWeight,x.anchor=l.messageAlign,x.valign="center",x.textMargin=l.wrapPadding,x.tspan=!1,z(x.text)?await Rt(e,x,{startx:r,stopx:i,starty:n}):wt(e,x);const y=g.width;let m;r===i?l.rightAngles?m=e.append("path").attr("d",`M ${r},${n} H ${r+I.getMax(l.width/2,y/2)} V ${n+25} H ${r}`):m=e.append("path").attr("d","M "+r+","+n+" C "+(r+60)+","+(n-10)+" "+(r+60)+","+(n+30)+" "+r+","+(n+20)):(m=e.append("line"),m.attr("x1",r),m.attr("y1",n),m.attr("x2",i),m.attr("y2",n)),o===s.db.LINETYPE.DOTTED||o===s.db.LINETYPE.DOTTED_CROSS||o===s.db.LINETYPE.DOTTED_POINT||o===s.db.LINETYPE.DOTTED_OPEN||o===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let w="";l.arrowMarkerAbsolute&&(w=Ce(!0)),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(o===s.db.LINETYPE.SOLID||o===s.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+w+"#arrowhead)"),(o===s.db.LINETYPE.BIDIRECTIONAL_SOLID||o===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+w+"#arrowhead)"),m.attr("marker-end","url("+w+"#arrowhead)")),(o===s.db.LINETYPE.SOLID_POINT||o===s.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+w+"#filled-head)"),(o===s.db.LINETYPE.SOLID_CROSS||o===s.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+w+"#crosshead)"),(p||l.showSequenceNumbers)&&((o===s.db.LINETYPE.BIDIRECTIONAL_SOLID||o===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(rr&&(r=a.height),a.width+h.x>i&&(i=a.width+h.x)}return{maxHeight:r,maxWidth:i}},"drawActorsPopup"),pe=f(function(e){Le(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),Ot=f(function(e){return T.activations.filter(function(t){return t.actor===e})},"actorActivations"),se=f(function(e,t){const n=t.get(e),s=Ot(e),r=s.reduce(function(c,h){return I.getMin(c,h.startx)},n.x+n.width/2-1),i=s.reduce(function(c,h){return I.getMax(c,h.stopx)},n.x+n.width/2+1);return[r,i]},"activationBounds");function nt(e,t,n,s,r){T.bumpVerticalPos(n);let i=s;if(t.id&&t.message&&e[t.id]){const c=e[t.id].width,h=Et(l);t.message=W.wrapLabel(`[${t.message}]`,c-2*l.wrapPadding,h),t.width=c,t.wrap=!0;const o=W.calculateTextDimensions(t.message,h),a=I.getMax(o.height,l.labelBoxHeight);i=s+a,Q.debug(`${a} - ${t.message}`)}r(t),T.bumpVerticalPos(i)}f(nt,"adjustLoopHeightForWrap");function ue(e,t,n,s,r,i,c){function h(p,g){p.x{E.add(_.from),E.add(_.to)}),m=m.filter(_=>E.has(_))}xs(a,p,g,m,0,w,!1);const B=await bs(w,p,O,s);V.insertArrowHead(a),V.insertArrowCrossHead(a),V.insertArrowFilledHead(a),V.insertSequenceNumber(a);function q(E,_){const X=T.endActivation(E);X.starty+18>_&&(X.starty=_-6,_+=12),V.drawActivation(a,X,_,l,Ot(E.from).length),T.insert(X.startx,_-10,X.stopx,_)}f(q,"activeEnd");let H=1,Z=1;const at=[],U=[];let G=0;for(const E of w){let _,X,tt;switch(E.type){case s.db.LINETYPE.NOTE:T.resetVerticalPos(),X=E.noteModel,await us(a,X);break;case s.db.LINETYPE.ACTIVE_START:T.newActivation(E,a,p);break;case s.db.LINETYPE.ACTIVE_END:q(E,T.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M));break;case s.db.LINETYPE.LOOP_END:_=T.endLoop(),await V.drawLoop(a,_,"loop",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;case s.db.LINETYPE.RECT_START:nt(B,E,l.boxMargin,l.boxMargin,M=>T.newLoop(void 0,M.message));break;case s.db.LINETYPE.RECT_END:_=T.endLoop(),U.push(_),T.models.addLoop(_),T.bumpVerticalPos(_.stopy-T.getVerticalPos());break;case s.db.LINETYPE.OPT_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M));break;case s.db.LINETYPE.OPT_END:_=T.endLoop(),await V.drawLoop(a,_,"opt",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;case s.db.LINETYPE.ALT_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M));break;case s.db.LINETYPE.ALT_ELSE:nt(B,E,l.boxMargin+l.boxTextMargin,l.boxMargin,M=>T.addSectionToLoop(M));break;case s.db.LINETYPE.ALT_END:_=T.endLoop(),await V.drawLoop(a,_,"alt",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M)),T.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:nt(B,E,l.boxMargin+l.boxTextMargin,l.boxMargin,M=>T.addSectionToLoop(M));break;case s.db.LINETYPE.PAR_END:_=T.endLoop(),await V.drawLoop(a,_,"par",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;case s.db.LINETYPE.AUTONUMBER:H=E.message.start||H,Z=E.message.step||Z,E.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M));break;case s.db.LINETYPE.CRITICAL_OPTION:nt(B,E,l.boxMargin+l.boxTextMargin,l.boxMargin,M=>T.addSectionToLoop(M));break;case s.db.LINETYPE.CRITICAL_END:_=T.endLoop(),await V.drawLoop(a,_,"critical",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;case s.db.LINETYPE.BREAK_START:nt(B,E,l.boxMargin,l.boxMargin+l.boxTextMargin,M=>T.newLoop(M));break;case s.db.LINETYPE.BREAK_END:_=T.endLoop(),await V.drawLoop(a,_,"break",l),T.bumpVerticalPos(_.stopy-T.getVerticalPos()),T.models.addLoop(_);break;default:try{tt=E.msgModel,tt.starty=T.getVerticalPos(),tt.sequenceIndex=H,tt.sequenceVisible=s.db.showSequenceNumbers();const M=await he(a,tt);ue(E,tt,M,G,p,g,x),at.push({messageModel:tt,lineStartY:M}),T.models.addMessage(tt)}catch(M){Q.error("error while drawing message",M)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(E.type)&&(H=H+Z),G++}Q.debug("createdActors",g),Q.debug("destroyedActors",x),await Gt(a,p,m,!1);for(const E of at)await gs(a,E.messageModel,E.lineStartY,s);l.mirrorActors&&await Gt(a,p,m,!0),U.forEach(E=>V.drawBackgroundRect(a,E)),oe(a,p,m,l);for(const E of T.models.boxes){E.height=T.getVerticalPos()-E.y,T.insert(E.x,E.y,E.x+E.width,E.height);const _=l.boxMargin*2;E.startx=E.x-_,E.starty=E.y-_*.25,E.stopx=E.startx+E.width+2*_,E.stopy=E.starty+E.height+_*.75,E.stroke="rgb(0,0,0, 0.5)",V.drawBox(a,E,l)}N&&T.bumpVerticalPos(l.boxMargin);const F=de(a,p,m,o),{bounds:D}=T.getBounds();D.startx===void 0&&(D.startx=0),D.starty===void 0&&(D.starty=0),D.stopx===void 0&&(D.stopx=0),D.stopy===void 0&&(D.stopy=0);let $=D.stopy-D.starty;${const c=Et(l);let h=i.actorKeys.reduce((g,x)=>g+=e.get(x).width+(e.get(x).margin||0),0);const o=l.boxMargin*8;h+=o,h-=2*l.boxTextMargin,i.wrap&&(i.name=W.wrapLabel(i.name,h-2*l.wrapPadding,c));const a=W.calculateTextDimensions(i.name,c);r=I.getMax(a.height,r);const p=I.getMax(h,a.width+2*l.wrapPadding);if(i.margin=l.boxTextMargin,hi.textMaxHeight=r),I.getMax(s,l.height)}f(xe,"calculateActorMargins");var Ts=f(async function(e,t,n){const s=t.get(e.from),r=t.get(e.to),i=s.x,c=r.x,h=e.wrap&&e.message;let o=z(e.message)?await Lt(e.message,st()):W.calculateTextDimensions(h?W.wrapLabel(e.message,l.width,mt(l)):e.message,mt(l));const a={width:h?l.width:I.getMax(l.width,o.width+2*l.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===n.db.PLACEMENT.RIGHTOF?(a.width=h?I.getMax(l.width,o.width):I.getMax(s.width/2+r.width/2,o.width+2*l.noteMargin),a.startx=i+(s.width+l.actorMargin)/2):e.placement===n.db.PLACEMENT.LEFTOF?(a.width=h?I.getMax(l.width,o.width+2*l.noteMargin):I.getMax(s.width/2+r.width/2,o.width+2*l.noteMargin),a.startx=i-a.width+(s.width-l.actorMargin)/2):e.to===e.from?(o=W.calculateTextDimensions(h?W.wrapLabel(e.message,I.getMax(l.width,s.width),mt(l)):e.message,mt(l)),a.width=h?I.getMax(l.width,s.width):I.getMax(s.width,l.width,o.width+2*l.noteMargin),a.startx=i+(s.width-a.width)/2):(a.width=Math.abs(i+s.width/2-(c+r.width/2))+l.actorMargin,a.startx=i2,g=f(w=>h?-w:w,"adjustValue");e.from===e.to?a=o:(e.activate&&!p&&(a+=g(l.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(a+=g(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(o-=g(3)));const x=[s,r,i,c],y=Math.abs(o-a);e.wrap&&e.message&&(e.message=W.wrapLabel(e.message,I.getMax(y+2*l.wrapPadding,l.width),Et(l)));const m=W.calculateTextDimensions(e.message,Et(l));return{width:I.getMax(e.wrap?0:m.width+2*l.wrapPadding,y+2*l.wrapPadding,l.width),height:0,startx:o,stopx:a,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,x),toBounds:Math.max.apply(null,x)}},"buildMessageModel"),bs=f(async function(e,t,n,s){const r={},i=[];let c,h,o;for(const a of e){switch(a.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:i.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:a.message&&(c=i.pop(),r[c.id]=c,r[a.id]=c,i.push(c));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:c=i.pop(),r[c.id]=c;break;case s.db.LINETYPE.ACTIVE_START:{const g=t.get(a.from?a.from:a.to.actor),x=Ot(a.from?a.from:a.to.actor).length,y=g.x+g.width/2+(x-1)*l.activationWidth/2,m={startx:y,stopx:y+l.activationWidth,actor:a.from,enabled:!0};T.activations.push(m)}break;case s.db.LINETYPE.ACTIVE_END:{const g=T.activations.map(x=>x.actor).lastIndexOf(a.from);T.activations.splice(g,1).splice(0,1)}break}a.placement!==void 0?(h=await Ts(a,t,s),a.noteModel=h,i.forEach(g=>{c=g,c.from=I.getMin(c.from,h.startx),c.to=I.getMax(c.to,h.startx+h.width),c.width=I.getMax(c.width,Math.abs(c.from-c.to))-l.labelBoxWidth})):(o=Es(a,t,s),a.msgModel=o,o.startx&&o.stopx&&i.length>0&&i.forEach(g=>{if(c=g,o.startx===o.stopx){const x=t.get(a.from),y=t.get(a.to);c.from=I.getMin(x.x-o.width/2,x.x-x.width/2,c.from),c.to=I.getMax(y.x+o.width/2,y.x+x.width/2,c.to),c.width=I.getMax(c.width,Math.abs(c.to-c.from))-l.labelBoxWidth}else c.from=I.getMin(o.startx,c.from),c.to=I.getMax(o.stopx,c.to),c.width=I.getMax(c.width,o.width)-l.labelBoxWidth}))}return T.activations=[],Q.debug("Loop type widths:",r),r},"calculateLoopBounds"),ms={bounds:T,drawActors:Gt,drawActorsPopup:de,setConf:pe,draw:fs},Ns={parser:Be,get db(){return new Fe},renderer:ms,styles:ze,init:f(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,ve({sequence:{wrap:e.wrap}}))},"init")};export{Ns as diagram}; diff --git a/assets/shaderMaterial-BaU8T3Xh.js b/assets/shaderMaterial-BaU8T3Xh.js deleted file mode 100644 index 4cae1b0d453d328dab88078bae689f0e159c0abd..0000000000000000000000000000000000000000 --- a/assets/shaderMaterial-BaU8T3Xh.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a9 as N,M as E,J as _,b2 as F,b3 as R,Y as q,b4 as j,b as L,b5 as W,$ as z,a2 as D,a6 as G,a4 as K,a5 as X,e as O,T as B,ao as H,b6 as w,aq as U,E as Q,R as J}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const C=new WeakMap;function $(v){const t=v.getVertexBuffers();if(!t)return null;let e=C.get(v);if(!e)e=new Map,C.set(v,e);else{let o=!1;for(const s in t)if(!e.has(s)){o=!0;break}if(!o)return e}for(const o in t){const s=t[o];if(s){const i=s.byteOffset,n=s.byteStride,a=s.type;e.set(o,{offset:i,stride:n,type:a})}}return e}function Y(v,t){t.forEach((e,o)=>{const s=`vp_${o}_info`;v.setFloat3(s,e.offset,e.stride,e.type)})}const P={effect:null,subMesh:null};class p extends N{constructor(t,e,o,s={},i=!0){super(t,e,i),this._textures={},this._internalTextures={},this._textureArrays={},this._externalTextures={},this._floats={},this._ints={},this._uints={},this._floatsArrays={},this._colors3={},this._colors3Arrays={},this._colors4={},this._colors4Arrays={},this._vectors2={},this._vectors3={},this._vectors4={},this._quaternions={},this._quaternionsArrays={},this._matrices={},this._matrixArrays={},this._matrices3x3={},this._matrices2x2={},this._vectors2Arrays={},this._vectors3Arrays={},this._vectors4Arrays={},this._uniformBuffers={},this._textureSamplers={},this._storageBuffers={},this._cachedWorldViewMatrix=new E,this._cachedWorldViewProjectionMatrix=new E,this._multiview=!1,this._vertexPullingMetadata=null,this._materialHelperNeedsPreviousMatrices=!1,this._shaderPath=o,this._options={needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],externalTextures:[],samplerObjects:[],storageBuffers:[],defines:[],useClipPlane:!1,...s}}get shaderPath(){return this._shaderPath}set shaderPath(t){this._shaderPath=t}get options(){return this._options}get isMultiview(){return this._multiview}getClassName(){return"ShaderMaterial"}needAlphaBlending(){return this.alpha<1||this._options.needAlphaBlending}needAlphaTesting(){return this._options.needAlphaTesting}_checkUniform(t){this._options.uniforms.indexOf(t)===-1&&this._options.uniforms.push(t)}setTexture(t,e){return this._options.samplers.indexOf(t)===-1&&this._options.samplers.push(t),this._textures[t]=e,this}setInternalTexture(t,e){return this._options.samplers.indexOf(t)===-1&&this._options.samplers.push(t),this._internalTextures[t]=e,this}removeTexture(t){delete this._textures[t]}setTextureArray(t,e){return this._options.samplers.indexOf(t)===-1&&this._options.samplers.push(t),this._checkUniform(t),this._textureArrays[t]=e,this}setExternalTexture(t,e){return this._options.externalTextures.indexOf(t)===-1&&this._options.externalTextures.push(t),this._externalTextures[t]=e,this}setFloat(t,e){return this._checkUniform(t),this._floats[t]=e,this}setInt(t,e){return this._checkUniform(t),this._ints[t]=e,this}setUInt(t,e){return this._checkUniform(t),this._uints[t]=e,this}setFloats(t,e){return this._checkUniform(t),this._floatsArrays[t]=e,this}setColor3(t,e){return this._checkUniform(t),this._colors3[t]=e,this}setColor3Array(t,e){return this._checkUniform(t),this._colors3Arrays[t]=e.reduce((o,s)=>(o.push(s.r,s.g,s.b),o),[]),this}setColor4(t,e){return this._checkUniform(t),this._colors4[t]=e,this}setColor4Array(t,e){return this._checkUniform(t),this._colors4Arrays[t]=e.reduce((o,s)=>(o.push(s.r,s.g,s.b,s.a),o),[]),this}setVector2(t,e){return this._checkUniform(t),this._vectors2[t]=e,this}setVector3(t,e){return this._checkUniform(t),this._vectors3[t]=e,this}setVector4(t,e){return this._checkUniform(t),this._vectors4[t]=e,this}setQuaternion(t,e){return this._checkUniform(t),this._quaternions[t]=e,this}setQuaternionArray(t,e){return this._checkUniform(t),this._quaternionsArrays[t]=e.reduce((o,s)=>(s.toArray(o,o.length),o),[]),this}setMatrix(t,e){return this._checkUniform(t),this._matrices[t]=e,this}setMatrices(t,e){this._checkUniform(t);const o=new Float32Array(e.length*16);for(let s=0;si===t||i.startsWith(o));return s>=0&&this.options.defines.splice(s,1),(typeof e!="boolean"||e)&&this.options.defines.push(o+e),this}isReadyForSubMesh(t,e,o){return this.isReady(t,o,e)}isReady(t,e,o){const s=o&&this._storeEffectOnSubMeshes;if(this.isFrozen){const h=s?o._drawWrapper:this._drawWrapper;if(h.effect&&h._wasPreviouslyReady&&h._wasPreviouslyUsingInstances===e)return!0}const i=this.getScene(),n=i.getEngine(),a=[],f=[];let c=null,T=this._shaderPath,r=this._options.uniforms,u=this._options.uniformBuffers,x=this._options.samplers;n.getCaps().multiview&&i.activeCamera&&i.activeCamera.outputRenderTarget&&i.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,a.push("#define MULTIVIEW"),r.indexOf("viewProjection")!==-1&&r.indexOf("viewProjectionR")===-1&&r.push("viewProjectionR"));for(let h=0;h4&&(f.push(_.MatricesIndicesExtraKind),f.push(_.MatricesWeightsExtraKind));const h=t.skeleton;a.push("#define NUM_BONE_INFLUENCERS "+t.numBoneInfluencers),c=new Q,c.addCPUSkinningFallback(0,t),h.isUsingTextureForMatrices?(a.push("#define BONETEXTURE"),r.indexOf("boneTextureWidth")===-1&&r.push("boneTextureWidth"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(a.push("#define BonesPerMesh "+(h.bones.length+1)),r.indexOf("mBones")===-1&&r.push("mBones"))}else a.push("#define NUM_BONE_INFLUENCERS 0");let d=0;const y=t?t.morphTargetManager:null;if(y){const h=a.indexOf("#define UV1")!==-1,g=a.indexOf("#define UV2")!==-1,k=a.indexOf("#define TANGENT")!==-1,M=a.indexOf("#define NORMAL")!==-1,I=a.indexOf("#define VERTEXCOLOR")!==-1;d=R(y,a,f,t,!0,M,k,h,g,I),y.isUsingTextureForTargets&&(r.indexOf("morphTargetTextureIndices")===-1&&r.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),d>0&&(r=r.slice(),r.push("morphTargetInfluences"),r.push("morphTargetCount"),r.push("morphTargetTextureInfo"),r.push("morphTargetTextureIndices"))}else a.push("#define NUM_MORPH_INFLUENCERS 0");if(t){const h=t.bakedVertexAnimationManager;h&&h.isEnabled&&(a.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),r.indexOf("bakedVertexAnimationSettings")===-1&&r.push("bakedVertexAnimationSettings"),r.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&r.push("bakedVertexAnimationTextureSizeInverted"),r.indexOf("bakedVertexAnimationTime")===-1&&r.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture"),e&&f.push("bakedVertexAnimationSettingsInstanced"))}for(const h in this._textures)if(!this._textures[h].isReady())return!1;for(const h in this._internalTextures)if(!this._internalTextures[h].isReady)return!1;t&&this.needAlphaTestingForMesh(t)&&a.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(q(r),j(this,i,a)),i.fogEnabled&&t?.applyFog&&i.fogMode!==L.FOGMODE_NONE&&(a.push("#define FOG"),r.indexOf("view")===-1&&r.push("view"),r.indexOf("vFogInfos")===-1&&r.push("vFogInfos"),r.indexOf("vFogColor")===-1&&r.push("vFogColor")),this._useLogarithmicDepth&&(a.push("#define LOGARITHMICDEPTH"),r.indexOf("logarithmicDepthConstant")===-1&&r.push("logarithmicDepthConstant"));const l=o?o.getRenderingMesh():t;if(l&&this.useVertexPulling){const h=l.geometry;h&&(this._vertexPullingMetadata=$(h),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((k,M)=>{r.push(`vp_${M}_info`)})),a.push("#define USE_VERTEX_PULLING");const g=l.geometry?.getIndexBuffer();g&&!l.isUnIndexed&&(a.push("#define VERTEX_PULLING_USE_INDEX_BUFFER"),g.is32Bits&&a.push("#define VERTEX_PULLING_INDEX_BUFFER_32BITS"))}this.customShaderNameResolve&&(r=r.slice(),u=u.slice(),x=x.slice(),T=this.customShaderNameResolve(this.name,r,u,x,a,f));const A=s?o._getDrawWrapper(void 0,!0):this._drawWrapper,S=A?.effect??null,V=A?.defines??null,b=a.join(` -`);let m=S;return V!==b&&(m=n.createEffect(T,{attributes:f,uniformsNames:r,uniformBuffersNames:u,samplers:x,defines:b,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:d},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},n),s?o.setEffect(m,b,this._materialContext):A&&A.setEffect(m,b),this._onEffectCreatedObservable&&(P.effect=m,P.subMesh=o??t?.subMeshes[0]??null,this._onEffectCreatedObservable.notifyObservers(P))),A._wasPreviouslyUsingInstances=!!e,m?.isReady()?(S!==m&&i.resetCachedMaterial(),A._wasPreviouslyReady=!0,!0):!1}bindOnlyWorldMatrix(t,e){const o=e??this.getEffect();if(!o)return;const s=this._options.uniforms;s.indexOf("world")!==-1&&o.setMatrix("world",t);const i=this.getScene();s.indexOf("worldView")!==-1&&(t.multiplyToRef(i.getViewMatrix(),this._cachedWorldViewMatrix),o.setMatrix("worldView",this._cachedWorldViewMatrix)),s.indexOf("worldViewProjection")!==-1&&(t.multiplyToRef(i.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),o.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),s.indexOf("view")!==-1&&o.setMatrix("view",i.getViewMatrix())}bindForSubMesh(t,e,o){this.bind(t,e,o._drawWrapperOverride?.effect,o)}bind(t,e,o,s){const i=s&&this._storeEffectOnSubMeshes,n=o??(i?s.effect:this.getEffect());if(!n)return;const a=this.getScene();this._activeEffect=n,this.bindOnlyWorldMatrix(t,o);const f=this._options.uniformBuffers;let c=!1;if(n&&f&&f.length>0&&a.getEngine().supportsUniformBuffers)for(let r=0;rnew p(t,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);e.name=t,e.id=t,typeof e._shaderPath=="object"&&(e._shaderPath={...e._shaderPath}),this._options={...this._options};const o=Object.keys(this._options);for(const s of o){const i=this._options[s];Array.isArray(i)&&(this._options[s]=i.slice(0))}this.stencil.copyTo(e.stencil);for(const s in this._textures)e.setTexture(s,this._textures[s]);for(const s in this._internalTextures)e.setInternalTexture(s,this._internalTextures[s]);for(const s in this._textureArrays)e.setTextureArray(s,this._textureArrays[s]);for(const s in this._externalTextures)e.setExternalTexture(s,this._externalTextures[s]);for(const s in this._ints)e.setInt(s,this._ints[s]);for(const s in this._uints)e.setUInt(s,this._uints[s]);for(const s in this._floats)e.setFloat(s,this._floats[s]);for(const s in this._floatsArrays)e.setFloats(s,this._floatsArrays[s]);for(const s in this._colors3)e.setColor3(s,this._colors3[s]);for(const s in this._colors3Arrays)e._colors3Arrays[s]=this._colors3Arrays[s];for(const s in this._colors4)e.setColor4(s,this._colors4[s]);for(const s in this._colors4Arrays)e._colors4Arrays[s]=this._colors4Arrays[s];for(const s in this._vectors2)e.setVector2(s,this._vectors2[s]);for(const s in this._vectors3)e.setVector3(s,this._vectors3[s]);for(const s in this._vectors4)e.setVector4(s,this._vectors4[s]);for(const s in this._quaternions)e.setQuaternion(s,this._quaternions[s]);for(const s in this._quaternionsArrays)e._quaternionsArrays[s]=this._quaternionsArrays[s];for(const s in this._matrices)e.setMatrix(s,this._matrices[s]);for(const s in this._matrixArrays)e._matrixArrays[s]=this._matrixArrays[s].slice();for(const s in this._matrices3x3)e.setMatrix3x3(s,this._matrices3x3[s]);for(const s in this._matrices2x2)e.setMatrix2x2(s,this._matrices2x2[s]);for(const s in this._vectors2Arrays)e.setArray2(s,this._vectors2Arrays[s]);for(const s in this._vectors3Arrays)e.setArray3(s,this._vectors3Arrays[s]);for(const s in this._vectors4Arrays)e.setArray4(s,this._vectors4Arrays[s]);for(const s in this._uniformBuffers)e.setUniformBuffer(s,this._uniformBuffers[s]);for(const s in this._textureSamplers)e.setTextureSampler(s,this._textureSamplers[s]);for(const s in this._storageBuffers)e.setStorageBuffer(s,this._storageBuffers[s]);return e}dispose(t,e,o){if(e){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._internalTextures)this._internalTextures[s].dispose();for(s in this._textureArrays){const i=this._textureArrays[s];for(let n=0;nnew p(t.name,e,t.shaderPath,t.options,t.storeEffectOnSubMeshes),t,e,o);let i;t.stencil&&s.stencil.parse(t.stencil,e,o);for(i in t.textures)s.setTexture(i,B.Parse(t.textures[i],e,o));for(i in t.textureArrays){const n=t.textureArrays[i],a=[];for(let f=0;f(c%3===0?a.push([f]):a[a.length-1].push(f),a),[]).map(a=>({r:a[0],g:a[1],b:a[2]}));s.setColor3Array(i,n)}for(i in t.colors4){const n=t.colors4[i];s.setColor4(i,{r:n[0],g:n[1],b:n[2],a:n[3]})}for(i in t.colors4Arrays){const n=t.colors4Arrays[i].reduce((a,f,c)=>(c%4===0?a.push([f]):a[a.length-1].push(f),a),[]).map(a=>({r:a[0],g:a[1],b:a[2],a:a[3]}));s.setColor4Array(i,n)}for(i in t.vectors2){const n=t.vectors2[i];s.setVector2(i,{x:n[0],y:n[1]})}for(i in t.vectors3){const n=t.vectors3[i];s.setVector3(i,{x:n[0],y:n[1],z:n[2]})}for(i in t.vectors4){const n=t.vectors4[i];s.setVector4(i,{x:n[0],y:n[1],z:n[2],w:n[3]})}for(i in t.quaternions)s.setQuaternion(i,H.FromArray(t.quaternions[i]));for(i in t.matrices)s.setMatrix(i,E.FromArray(t.matrices[i]));for(i in t.matrixArray)s._matrixArrays[i]=new Float32Array(t.matrixArray[i]);for(i in t.matrices3x3)s.setMatrix3x3(i,t.matrices3x3[i]);for(i in t.matrices2x2)s.setMatrix2x2(i,t.matrices2x2[i]);for(i in t.vectors2Arrays)s.setArray2(i,t.vectors2Arrays[i]);for(i in t.vectors3Arrays)s.setArray3(i,t.vectors3Arrays[i]);for(i in t.vectors4Arrays)s.setArray4(i,t.vectors4Arrays[i]);for(i in t.quaternionsArrays)s.setArray4(i,t.quaternionsArrays[i]);return s}static async ParseFromFileAsync(t,e,o,s=""){return await new Promise((i,n)=>{const a=new w;a.addEventListener("readystatechange",()=>{if(a.readyState==4)if(a.status==200){const f=JSON.parse(a.responseText),c=this.Parse(f,o||U.LastCreatedScene,s);t&&(c.name=t),i(c)}else n("Unable to load the ShaderMaterial")}),a.open("GET",e),a.send()})}static async ParseFromSnippetAsync(t,e,o=""){return await new Promise((s,i)=>{const n=new w;n.addEventListener("readystatechange",()=>{if(n.readyState==4)if(n.status==200){const a=JSON.parse(JSON.parse(n.responseText).jsonPayload),f=JSON.parse(a.shaderMaterial),c=this.Parse(f,e||U.LastCreatedScene,o);c.snippetId=t,s(c)}else i("Unable to load the snippet "+t)}),n.open("GET",this.SnippetUrl+"/"+t.replace(/#/g,"/")),n.send()})}}p.SnippetUrl="https://snippet.babylonjs.com";p.CreateFromSnippetAsync=p.ParseFromSnippetAsync;J("BABYLON.ShaderMaterial",p);export{p as ShaderMaterial}; diff --git a/assets/shadowGenerator-DTWbYxFR.js b/assets/shadowGenerator-DTWbYxFR.js deleted file mode 100644 index 274a056ba4a1e90fa19363bec6456ddf712757f4..0000000000000000000000000000000000000000 --- a/assets/shadowGenerator-DTWbYxFR.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./shadowMap.fragment-u8ldEWvj.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./packingFunctions-Dod19T_v.js","./clipPlaneFragment-BmMK1U8A.js","./shadowMap.vertex-DKOXb-vE.js","./bonesDeclaration-DUXz5WB4.js","./instancesVertex-BZz8JvZy.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./helperFunctions-Wgh3PIP0.js","./sceneUboDeclaration-mnAEeY6M.js","./meshUboDeclaration-BeSl_gjF.js","./clipPlaneVertex-D5g8dBQb.js","./morphTargetsVertex-W8O8GW2p.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./depthBoxBlur.fragment-CZANnozR.js","./shadowMapFragmentSoftTransparentShadow-XpK5Xvlm.js","./shadowMap.fragment-CW3H6DYO.js","./packingFunctions-qIF0h5ys.js","./clipPlaneFragment-CmkC_xqs.js","./shadowMap.vertex-pnrMo0rk.js","./bakedVertexAnimation-CaTOZtWZ.js","./morphTargetsVertex-CUt9TeiZ.js","./helperFunctions-tBt4f_K3.js","./sceneUboDeclaration-3A3jW23h.js","./meshUboDeclaration-D9O4n0us.js","./clipPlaneVertex-CThh3FEJ.js","./depthBoxBlur.fragment-n0OjllU-.js","./shadowMapFragmentSoftTransparentShadow-zlL3abIO.js"])))=>i.map(i=>d[i]); -import{af as L}from"./index-DydPgVMC.js";import{aA as v,T as S,b7 as B,e as K,_ as C,b8 as Y,s as z,R as Q,O as F,V as O,M as b,aL as D,b9 as U,ba as y,ah as k,bb as j,aI as H,c as W,a5 as Z,a2 as q,b5 as $,J as M,E as J,b3 as G,b4 as ee,b2 as te,Y as se,bc as ie,bd as V,be as re}from"./index-GY9JDBGV.js";class P extends v{get direction(){return this._effectWrapper.direction}set direction(e){this._effectWrapper.direction=e}set kernel(e){this._effectWrapper.kernel=e}get kernel(){return this._effectWrapper.kernel}set packedFloat(e){this._effectWrapper.packedFloat=e}get packedFloat(){return this._effectWrapper.packedFloat}getClassName(){return"BlurPostProcess"}constructor(e,t,s,i,a=null,r=S.BILINEAR_SAMPLINGMODE,h,o,d=0,f="",l=!1,g=5){const c=typeof i=="number"?l:!!i.blockCompilation,_={uniforms:B.Uniforms,samplers:B.Samplers,size:typeof i=="number"?i:void 0,camera:a,samplingMode:r,engine:h,reusable:o,textureType:d,vertexUrl:B.VertexUrl,indexParameters:{varyingCount:0,depCount:0},textureFormat:g,defines:f,...i,blockCompilation:!0};super(e,B.FragmentUrl,{effectWrapper:typeof i=="number"||!i.effectWrapper?new B(e,h,void 0,void 0,_):void 0,..._}),this._effectWrapper.options.blockCompilation=c,this.direction=t,this.onApplyObservable.add(()=>{this._effectWrapper.textureWidth=this._outputTexture?this._outputTexture.width:this.width,this._effectWrapper.textureHeight=this._outputTexture?this._outputTexture.height:this.height}),this.kernel=s}updateEffect(e=null,t=null,s=null,i,a,r){this._effectWrapper._updateParameters(a,r)}static _Parse(e,t,s,i){return K.Parse(()=>new P(e.name,e.direction,e.kernel,e.options,t,e.renderTargetSamplingMode,s.getEngine(),e.reusable,e.textureType,void 0,!1),e,s,i)}}C([Y()],P.prototype,"direction",null);C([z()],P.prototype,"kernel",null);C([z()],P.prototype,"packedFloat",null);Q("BABYLON.BlurPostProcess",P);class n{get bias(){return this._bias}set bias(e){this._bias=e}get normalBias(){return this._normalBias}set normalBias(e){this._normalBias=e}get blurBoxOffset(){return this._blurBoxOffset}set blurBoxOffset(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())}get blurScale(){return this._blurScale}set blurScale(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())}get blurKernel(){return this._blurKernel}set blurKernel(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())}get useKernelBlur(){return this._useKernelBlur}set useKernelBlur(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())}get depthScale(){return this._depthScale!==void 0?this._depthScale:this._light.getDepthScale()}set depthScale(e){this._depthScale=e}_validateFilter(e){return e}get filter(){return this._filter}set filter(e){if(e=this._validateFilter(e),this._light.needCube()){if(e===n.FILTER_BLUREXPONENTIALSHADOWMAP){this.useExponentialShadowMap=!0;return}else if(e===n.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP){this.useCloseExponentialShadowMap=!0;return}else if(e===n.FILTER_PCF||e===n.FILTER_PCSS){this.usePoissonSampling=!0;return}}if((e===n.FILTER_PCF||e===n.FILTER_PCSS)&&!this._scene.getEngine()._features.supportShadowSamplers){this.usePoissonSampling=!0;return}this._filter!==e&&(this._filter=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty())}get usePoissonSampling(){return this.filter===n.FILTER_POISSONSAMPLING}set usePoissonSampling(e){const t=this._validateFilter(n.FILTER_POISSONSAMPLING);!e&&this.filter!==n.FILTER_POISSONSAMPLING||(this.filter=e?t:n.FILTER_NONE)}get useExponentialShadowMap(){return this.filter===n.FILTER_EXPONENTIALSHADOWMAP}set useExponentialShadowMap(e){const t=this._validateFilter(n.FILTER_EXPONENTIALSHADOWMAP);!e&&this.filter!==n.FILTER_EXPONENTIALSHADOWMAP||(this.filter=e?t:n.FILTER_NONE)}get useBlurExponentialShadowMap(){return this.filter===n.FILTER_BLUREXPONENTIALSHADOWMAP}set useBlurExponentialShadowMap(e){const t=this._validateFilter(n.FILTER_BLUREXPONENTIALSHADOWMAP);!e&&this.filter!==n.FILTER_BLUREXPONENTIALSHADOWMAP||(this.filter=e?t:n.FILTER_NONE)}get useCloseExponentialShadowMap(){return this.filter===n.FILTER_CLOSEEXPONENTIALSHADOWMAP}set useCloseExponentialShadowMap(e){const t=this._validateFilter(n.FILTER_CLOSEEXPONENTIALSHADOWMAP);!e&&this.filter!==n.FILTER_CLOSEEXPONENTIALSHADOWMAP||(this.filter=e?t:n.FILTER_NONE)}get useBlurCloseExponentialShadowMap(){return this.filter===n.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP}set useBlurCloseExponentialShadowMap(e){const t=this._validateFilter(n.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);!e&&this.filter!==n.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP||(this.filter=e?t:n.FILTER_NONE)}get usePercentageCloserFiltering(){return this.filter===n.FILTER_PCF}set usePercentageCloserFiltering(e){const t=this._validateFilter(n.FILTER_PCF);!e&&this.filter!==n.FILTER_PCF||(this.filter=e?t:n.FILTER_NONE)}get filteringQuality(){return this._filteringQuality}set filteringQuality(e){this._filteringQuality!==e&&(this._filteringQuality=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty())}get useContactHardeningShadow(){return this.filter===n.FILTER_PCSS}set useContactHardeningShadow(e){const t=this._validateFilter(n.FILTER_PCSS);!e&&this.filter!==n.FILTER_PCSS||(this.filter=e?t:n.FILTER_NONE)}get contactHardeningLightSizeUVRatio(){return this._contactHardeningLightSizeUVRatio}set contactHardeningLightSizeUVRatio(e){this._contactHardeningLightSizeUVRatio=e}get darkness(){return this._darkness}set darkness(e){this.setDarkness(e)}getDarkness(){return this._darkness}setDarkness(e){return e>=1?this._darkness=1:e<=0?this._darkness=0:this._darkness=e,this}get transparencyShadow(){return this._transparencyShadow}set transparencyShadow(e){this.setTransparencyShadow(e)}setTransparencyShadow(e){return this._transparencyShadow=e,this}getShadowMap(){return this._shadowMap}getShadowMapForRendering(){return this._shadowMap2?this._shadowMap2:this._shadowMap}getClassName(){return n.CLASSNAME}addShadowCaster(e,t=!0){if(!this._shadowMap)return this;if(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.indexOf(e)===-1&&this._shadowMap.renderList.push(e),t)for(const s of e.getChildMeshes())this._shadowMap.renderList.indexOf(s)===-1&&this._shadowMap.renderList.push(s);return this}removeShadowCaster(e,t=!0){if(!this._shadowMap||!this._shadowMap.renderList)return this;const s=this._shadowMap.renderList.indexOf(e);if(s!==-1&&this._shadowMap.renderList.splice(s,1),t)for(const i of e.getChildren())this.removeShadowCaster(i);return this}getLight(){return this._light}get shaderLanguage(){return this._shaderLanguage}_getCamera(){return this._camera??this._scene.activeCamera}get mapSize(){return this._mapSize}set mapSize(e){this._mapSize=e,this._light._markMeshesAsLightDirty(),this.recreateShadowMap()}constructor(e,t,s,i,a,r=!1){this.onBeforeShadowMapRenderObservable=new F,this.onAfterShadowMapRenderObservable=new F,this.onBeforeShadowMapRenderMeshObservable=new F,this.onAfterShadowMapRenderMeshObservable=new F,this.doNotSerialize=!1,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=n.FILTER_NONE,this._filteringQuality=n.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.enableSoftTransparentShadow=!1,this.useOpacityTextureForTransparentShadow=!1,this.frustumEdgeFalloff=0,this._shaderLanguage=0,this.forceBackFacesOnly=!1,this._lightDirection=O.Zero(),this._viewMatrix=b.Zero(),this._projectionMatrix=b.Zero(),this._transformMatrix=b.Zero(),this._cachedPosition=new O(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new O(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=b.Identity(),this._shadersLoaded=!1,this._mapSize=e,this._light=t,this._scene=t.getScene(),this._camera=i??null,this._useRedTextureType=!!a,this._initShaderSourceAsync(r);let h=t._shadowGenerators;h||(h=t._shadowGenerators=new Map),h.set(this._camera,this),this.id=t.id,this._useUBO=this._scene.getEngine().supportsUniformBuffers,this._useUBO&&(this._sceneUBOs=[],this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light "${this._light.name}")`))),n._SceneComponentInitialization(this._scene);const o=this._scene.getEngine().getCaps();s?o.textureFloatRender&&o.textureFloatLinearFiltering?this._textureType=1:o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?this._textureType=2:this._textureType=0:o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?this._textureType=2:o.textureFloatRender&&o.textureFloatLinearFiltering?this._textureType=1:this._textureType=0,this._initializeGenerator(),this._applyFilterValues()}_initializeGenerator(){this._light._markMeshesAsLightDirty(),this._initializeShadowMap()}_createTargetRenderTexture(){const e=this._scene.getEngine();this._shadowMap?.dispose(),e._features.supportDepthStencilTexture?(this._shadowMap=new D(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1,void 0,this._useRedTextureType?6:5),this._shadowMap.createDepthStencilTexture(e.useReverseDepthBuffer?516:513,!0,void 0,void 0,void 0,`DepthStencilForShadowGenerator-${this._light.name}`)):this._shadowMap=new D(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube()),this._shadowMap.noPrePassRenderer=!0}_initializeShadowMap(){if(this._createTargetRenderTexture(),this._shadowMap===null)return;this._shadowMap.wrapU=S.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=S.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(S.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._storedUniqueId&&(this._shadowMap.uniqueId=this._storedUniqueId),this._shadowMap.customRenderFunction=(i,a,r,h)=>this._renderForShadowMap(i,a,r,h),this._shadowMap.customIsReadyFunction=(i,a,r)=>{if(!r||!i.subMeshes)return!0;let h=!0;for(const o of i.subMeshes){const d=o.getRenderingMesh(),l=this._scene.getEngine(),g=o.getMaterial();if(!g||o.verticesCount===0||this.customAllowRendering&&!this.customAllowRendering(o))continue;const c=d._getInstancesRenderList(o._id,!!o.getReplacementMesh());if(c.mustReturn)continue;const _=l.getCaps().instancedArrays&&(c.visibleInstances[o._id]!==null&&c.visibleInstances[o._id]!==void 0||d.hasThinInstances),x=g.needAlphaBlendingForMesh(d);h=this.isReady(o,_,x)&&h}return h};const e=this._scene.getEngine();this._shadowMap.onBeforeBindObservable.add(()=>{this._currentSceneUBO=this._scene.getSceneUniformBuffer(),e._enableGPUDebugMarkers&&(e.restoreDefaultFramebuffer(),e._debugPushGroup?.(`Shadow map generation for pass id ${e.currentRenderPassId}`))}),this._shadowMap.onBeforeRenderObservable.add(i=>{this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._sceneUBOs[0]),this._currentFaceIndex=i,this._filter===n.FILTER_PCF&&e.setColorWrite(!1),this.getTransformMatrix(),V.eyeAtCamera=!1,this._scene.setTransformMatrix(this._viewMatrix,this._projectionMatrix),this._useUBO&&(this._scene.getSceneUniformBuffer().unbindEffect(),this._scene.finalizeSceneUbo())}),this._shadowMap.onAfterUnbindObservable.add(()=>{if(this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._currentSceneUBO),V.eyeAtCamera=!0,this._scene.updateTransformMatrix(),this._filter===n.FILTER_PCF&&e.setColorWrite(!0),!this.useBlurExponentialShadowMap&&!this.useBlurCloseExponentialShadowMap){e._debugPopGroup?.();return}const i=this.getShadowMapForRendering();i&&(this._scene.postProcessManager.directRender(this._blurPostProcesses,i.renderTarget,!0),e.unBindFramebuffer(i.renderTarget,!0)),e._enableGPUDebugMarkers&&e._debugPopGroup?.()});const t=new U(0,0,0,0),s=new U(1,1,1,1);this._shadowMap.onClearObservable.add(i=>{this._filter===n.FILTER_PCF?i.clear(s,!1,!0,!1):this.useExponentialShadowMap||this.useBlurExponentialShadowMap?i.clear(t,!0,!0,!1):i.clear(s,!0,!0,!1)}),this._shadowMap.onResizeObservable.add(i=>{this._storedUniqueId=this._shadowMap.uniqueId,this._mapSize=i.getRenderSize(),this._light._markMeshesAsLightDirty(),this.recreateShadowMap()});for(let i=y.MIN_RENDERINGGROUPS;iimport("./shadowMap.fragment-u8ldEWvj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),L(()=>import("./shadowMap.vertex-DKOXb-vE.js"),__vite__mapDeps([6,1,2,3,7,8,9,10,11,12,13,14,15,16]),import.meta.url),L(()=>import("./depthBoxBlur.fragment-CZANnozR.js"),__vite__mapDeps([17,1,2,3]),import.meta.url),L(()=>import("./shadowMapFragmentSoftTransparentShadow-XpK5Xvlm.js"),__vite__mapDeps([18,1,2,3]),import.meta.url)])):await Promise.all([L(()=>import("./shadowMap.fragment-CW3H6DYO.js"),__vite__mapDeps([19,1,2,3,20,21]),import.meta.url),L(()=>import("./shadowMap.vertex-pnrMo0rk.js"),__vite__mapDeps([22,1,2,3,23,24,25,26,27,28]),import.meta.url),L(()=>import("./depthBoxBlur.fragment-n0OjllU-.js"),__vite__mapDeps([29,1,2,3]),import.meta.url),L(()=>import("./shadowMapFragmentSoftTransparentShadow-zlL3abIO.js"),__vite__mapDeps([30,1,2,3]),import.meta.url)]),this._shadersLoaded=!0}_initializeBlurRTTAndPostProcesses(){const e=this._scene.getEngine(),t=this._mapSize/this.blurScale;(!this.useKernelBlur||this.blurScale!==1)&&(this._shadowMap2=new D(this._light.name+"_shadowMap2",t,this._scene,!1,!0,this._textureType,void 0,void 0,!1),this._shadowMap2.wrapU=S.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=S.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(S.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new P(this._light.name+"KernelBlurX",new k(1,0),this.blurKernel,1,null,S.BILINEAR_SAMPLINGMODE,e,!1,this._textureType),this._kernelBlurXPostprocess.width=t,this._kernelBlurXPostprocess.height=t,this._kernelBlurXPostprocess.externalTextureSamplerBinding=!0,this._kernelBlurXPostprocess.onApplyObservable.add(s=>{s.setTexture("textureSampler",this._shadowMap)}),this._kernelBlurYPostprocess=new P(this._light.name+"KernelBlurY",new k(0,1),this.blurKernel,1,null,S.BILINEAR_SAMPLINGMODE,e,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,this._textureType===0&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new v(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,S.BILINEAR_SAMPLINGMODE,e,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType,void 0,void 0,void 0,void 0,this._shaderLanguage),this._boxBlurPostprocess.externalTextureSamplerBinding=!0,this._boxBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",t,t),s.setTexture("textureSampler",this._shadowMap)}),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])}_renderForShadowMap(e,t,s,i){let a;if(i.length)for(a=0;a{i!==s&&!m?(s.getMeshUniformBuffer().bindToEffect(u,"Mesh"),s.transferToEffect(E)):(i.getMeshUniformBuffer().bindToEffect(u,"Mesh"),i.transferToEffect(m?E:I))}),this.forceBackFacesOnly&&r.setState(!0,0,!1,!1,h.cullBackFaces),this.onAfterShadowMapRenderObservable.notifyObservers(u),this.onAfterShadowMapRenderMeshObservable.notifyObservers(s)}else this._shadowMap&&this._shadowMap.resetRefreshCounter()}_applyFilterValues(){this._shadowMap&&(this.filter===n.FILTER_NONE||this.filter===n.FILTER_PCSS?this._shadowMap.updateSamplingMode(S.NEAREST_SAMPLINGMODE):this._shadowMap.updateSamplingMode(S.BILINEAR_SAMPLINGMODE))}forceCompilation(e,t){const s={useInstances:!1,...t},i=this.getShadowMap();if(!i){e&&e(this);return}const a=i.renderList;if(!a){e&&e(this);return}const r=[];for(const d of a)r.push(...d.subMeshes);if(r.length===0){e&&e(this);return}let h=0;const o=()=>{if(!(!this._scene||!this._scene.getEngine())){for(;this.isReady(r[h],s.useInstances,r[h].getMaterial()?.needAlphaBlendingForMesh(r[h].getMesh())??!1);)if(h++,h>=r.length){e&&e(this);return}setTimeout(o,16)}};o()}async forceCompilationAsync(e){return await new Promise(t=>{this.forceCompilation(()=>{t()},e)})}_isReadyCustomDefines(e,t,s){}_prepareShadowDefines(e,t,s,i){s.push("#define SM_LIGHTTYPE_"+this._light.getClassName().toUpperCase()),s.push("#define SM_FLOAT "+(this._textureType!==0?"1":"0")),s.push("#define SM_ESM "+(this.useExponentialShadowMap||this.useBlurExponentialShadowMap?"1":"0")),s.push("#define SM_DEPTHTEXTURE "+(this.usePercentageCloserFiltering||this.useContactHardeningShadow?"1":"0"));const a=e.getMesh();return s.push("#define SM_NORMALBIAS "+(this.normalBias&&a.isVerticesDataPresent(M.NormalKind)?"1":"0")),s.push("#define SM_DIRECTIONINLIGHTDATA "+(this.getLight().getTypeID()===H.LIGHTTYPEID_DIRECTIONALLIGHT?"1":"0")),s.push("#define SM_USEDISTANCE "+(this._light.needCube()?"1":"0")),s.push("#define SM_SOFTTRANSPARENTSHADOW "+(this.enableSoftTransparentShadow&&i?"1":"0")),this._isReadyCustomDefines(s,e,t),s}isReady(e,t,s){if(!this._shadersLoaded)return!1;const i=e.getMaterial(),a=i?.shadowDepthWrapper;if(this._opacityTexture=null,!i)return!1;const r=[];if(this._prepareShadowDefines(e,t,r,s),a){if(!a.isReadyForSubMesh(e,r,this,t,this._scene.getEngine().currentRenderPassId))return!1}else{const h=e._getDrawWrapper(void 0,!0);let o=h.effect,d=h.defines;const f=[M.PositionKind],l=e.getMesh();let g=!1,c=!1,_=!1;const x=!1;this.normalBias&&l.isVerticesDataPresent(M.NormalKind)&&(f.push(M.NormalKind),r.push("#define NORMAL"),g=!0,l.nonUniformScaling&&r.push("#define NONUNIFORMSCALING"));const u=i.needAlphaTestingForMesh(l);if((u||i.needAlphaBlendingForMesh(l))&&(this.useOpacityTextureForTransparentShadow?this._opacityTexture=i.opacityTexture:this._opacityTexture=i.getAlphaTestTexture(),this._opacityTexture)){if(!this._opacityTexture.isReady())return!1;const p=i.alphaCutOff??n.DEFAULT_ALPHA_CUTOFF;r.push("#define ALPHATEXTURE"),u&&r.push(`#define ALPHATESTVALUE ${p}${p%1===0?".":""}`),l.isVerticesDataPresent(M.UVKind)&&(f.push(M.UVKind),r.push("#define UV1"),c=!0),l.isVerticesDataPresent(M.UV2Kind)&&this._opacityTexture.coordinatesIndex===1&&(f.push(M.UV2Kind),r.push("#define UV2"),_=!0)}const A=new J;if(l.useBones&&l.computeBonesUsingShaders&&l.skeleton){f.push(M.MatricesIndicesKind),f.push(M.MatricesWeightsKind),l.numBoneInfluencers>4&&(f.push(M.MatricesIndicesExtraKind),f.push(M.MatricesWeightsExtraKind));const p=l.skeleton;r.push("#define NUM_BONE_INFLUENCERS "+l.numBoneInfluencers),l.numBoneInfluencers>0&&A.addCPUSkinningFallback(0,l),p.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(p.bones.length+1))}else r.push("#define NUM_BONE_INFLUENCERS 0");const I=l.morphTargetManager?G(l.morphTargetManager,r,f,l,!0,g,!1,c,_,x):0;if(ee(i,this._scene,r),t&&(r.push("#define INSTANCES"),te(f),e.getRenderingMesh().hasThinInstances&&r.push("#define THIN_INSTANCES")),this.customShaderOptions&&this.customShaderOptions.defines)for(const p of this.customShaderOptions.defines)r.indexOf(p)===-1&&r.push(p);const m=l.bakedVertexAnimationManager;m&&m.isEnabled&&(r.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&f.push("bakedVertexAnimationSettingsInstanced"));const E=r.join(` -`);if(d!==E){d=E;let p="shadowMap";const R=["world","mBones","viewProjection","diffuseMatrix","lightDataSM","depthValuesSM","biasAndScaleSM","morphTargetInfluences","morphTargetCount","boneTextureWidth","softTransparentShadowSM","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],w=["diffuseSampler","boneSampler","morphTargets","bakedVertexAnimationTexture"],X=["Scene","Mesh"];if(se(R),this.customShaderOptions){if(p=this.customShaderOptions.shaderName,this.customShaderOptions.attributes)for(const T of this.customShaderOptions.attributes)f.indexOf(T)===-1&&f.push(T);if(this.customShaderOptions.uniforms)for(const T of this.customShaderOptions.uniforms)R.indexOf(T)===-1&&R.push(T);if(this.customShaderOptions.samplers)for(const T of this.customShaderOptions.samplers)w.indexOf(T)===-1&&w.push(T)}const N=this._scene.getEngine();o=N.createEffect(p,{attributes:f,uniformsNames:R,uniformBuffersNames:X,samplers:w,defines:E,fallbacks:A,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:I},shaderLanguage:this._shaderLanguage},N),h.setEffect(o,d)}if(!o.isReady())return!1}return(this.useBlurExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(!this._blurPostProcesses||!this._blurPostProcesses.length)&&this._initializeBlurRTTAndPostProcesses(),!(this._kernelBlurXPostprocess&&!this._kernelBlurXPostprocess.isReady()||this._kernelBlurYPostprocess&&!this._kernelBlurYPostprocess.isReady()||this._boxBlurPostprocess&&!this._boxBlurPostprocess.isReady())}prepareDefines(e,t){const s=this._scene,i=this._light;!s.shadowsEnabled||!i.shadowEnabled||(e["SHADOW"+t]=!0,this.useContactHardeningShadow?(e["SHADOWPCSS"+t]=!0,this._filteringQuality===n.QUALITY_LOW?e["SHADOWLOWQUALITY"+t]=!0:this._filteringQuality===n.QUALITY_MEDIUM&&(e["SHADOWMEDIUMQUALITY"+t]=!0)):this.usePercentageCloserFiltering?(e["SHADOWPCF"+t]=!0,this._filteringQuality===n.QUALITY_LOW?e["SHADOWLOWQUALITY"+t]=!0:this._filteringQuality===n.QUALITY_MEDIUM&&(e["SHADOWMEDIUMQUALITY"+t]=!0)):this.usePoissonSampling?e["SHADOWPOISSON"+t]=!0:this.useExponentialShadowMap||this.useBlurExponentialShadowMap?e["SHADOWESM"+t]=!0:(this.useCloseExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(e["SHADOWCLOSEESM"+t]=!0),i.needCube()&&(e["SHADOWCUBE"+t]=!0))}bindShadowLight(e,t){const s=this._light,i=this._scene;if(!i.shadowsEnabled||!s.shadowEnabled)return;const a=this._getCamera(),r=this.getShadowMap();if(!r)return;if(!s.needCube()){const o=i.floatingOriginOffset,d=this.getTransformMatrix(),f=i.floatingOriginMode?ie(o,this._viewMatrix,this._projectionMatrix,W.Matrix[0]):d;t.setMatrix("lightMatrix"+e,f)}const h=this.getShadowMapForRendering();this._filter===n.FILTER_PCF?(t.setDepthStencilTexture("shadowTexture"+e,h),s._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),r.getSize().width,1/r.getSize().width,this.frustumEdgeFalloff,e)):this._filter===n.FILTER_PCSS?(t.setDepthStencilTexture("shadowTexture"+e,h),t.setTexture("depthTexture"+e,h),s._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/r.getSize().width,this._contactHardeningLightSizeUVRatio*r.getSize().width,this.frustumEdgeFalloff,e)):(t.setTexture("shadowTexture"+e,h),s._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),this.blurScale/r.getSize().width,this.depthScale,this.frustumEdgeFalloff,e)),s._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(a),this.getLight().getDepthMinZ(a)+this.getLight().getDepthMaxZ(a),e)}get viewMatrix(){return this._viewMatrix}get projectionMatrix(){return this._projectionMatrix}getTransformMatrix(){const e=this._scene;if(this._currentRenderId===e.getRenderId()&&this._currentFaceIndexCache===this._currentFaceIndex)return this._transformMatrix;this._currentRenderId=e.getRenderId(),this._currentFaceIndexCache=this._currentFaceIndex;let t=this._light.position;if(this._light.computeTransformedInformation()&&(t=this._light.transformedPosition),O.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex),this._lightDirection),Math.abs(O.Dot(this._lightDirection,O.Up()))===1&&(this._lightDirection.z=1e-13),this._light.needProjectionMatrixCompute()||!this._cachedPosition||!this._cachedDirection||!t.equals(this._cachedPosition)||!this._lightDirection.equals(this._cachedDirection)){this._cachedPosition.copyFrom(t),this._cachedDirection.copyFrom(this._lightDirection),b.LookAtLHToRef(t,t.add(this._lightDirection),O.Up(),this._viewMatrix);const s=this.getShadowMap();if(s){const i=s.renderList;i&&this._light.setShadowProjectionMatrix(this._projectionMatrix,this._viewMatrix,i)}this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix)}return this._transformMatrix}recreateShadowMap(){const e=this._shadowMap;if(!e)return;const t=e.renderList;if(this._disposeRTTandPostProcesses(),this._initializeGenerator(),this.filter=this._filter,this._applyFilterValues(),t){this._shadowMap.renderList||(this._shadowMap.renderList=[]);for(const s of t)this._shadowMap.renderList.push(s)}else this._shadowMap.renderList=null}_disposeBlurPostProcesses(){this._shadowMap2&&(this._shadowMap2.dispose(),this._shadowMap2=null),this._boxBlurPostprocess&&(this._boxBlurPostprocess.dispose(),this._boxBlurPostprocess=null),this._kernelBlurXPostprocess&&(this._kernelBlurXPostprocess.dispose(),this._kernelBlurXPostprocess=null),this._kernelBlurYPostprocess&&(this._kernelBlurYPostprocess.dispose(),this._kernelBlurYPostprocess=null),this._blurPostProcesses=[]}_disposeRTTandPostProcesses(){this._shadowMap&&(this._shadowMap.dispose(),this._shadowMap=null),this._disposeBlurPostProcesses()}_disposeSceneUBOs(){if(this._sceneUBOs){for(const e of this._sceneUBOs)e.dispose();this._sceneUBOs=[]}}dispose(){if(this._disposeRTTandPostProcesses(),this._disposeSceneUBOs(),this._light){if(this._light._shadowGenerators){const e=this._light._shadowGenerators.entries();for(let t=e.next();t.done!==!0;t=e.next()){const[s,i]=t.value;i===this&&this._light._shadowGenerators.delete(s)}this._light._shadowGenerators.size===0&&(this._light._shadowGenerators=null)}this._light._markMeshesAsLightDirty()}this.onBeforeShadowMapRenderMeshObservable.clear(),this.onBeforeShadowMapRenderObservable.clear(),this.onAfterShadowMapRenderMeshObservable.clear(),this.onAfterShadowMapRenderObservable.clear()}serialize(){const e={},t=this.getShadowMap();if(!t)return e;if(e.className=this.getClassName(),e.lightId=this._light.id,e.cameraId=this._camera?.id,e.id=this.id,e.mapSize=t.getRenderSize(),e.forceBackFacesOnly=this.forceBackFacesOnly,e.darkness=this.getDarkness(),e.transparencyShadow=this._transparencyShadow,e.frustumEdgeFalloff=this.frustumEdgeFalloff,e.bias=this.bias,e.normalBias=this.normalBias,e.usePercentageCloserFiltering=this.usePercentageCloserFiltering,e.useContactHardeningShadow=this.useContactHardeningShadow,e.contactHardeningLightSizeUVRatio=this.contactHardeningLightSizeUVRatio,e.filteringQuality=this.filteringQuality,e.useExponentialShadowMap=this.useExponentialShadowMap,e.useBlurExponentialShadowMap=this.useBlurExponentialShadowMap,e.useCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.useBlurCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.usePoissonSampling=this.usePoissonSampling,e.depthScale=this.depthScale,e.blurBoxOffset=this.blurBoxOffset,e.blurKernel=this.blurKernel,e.blurScale=this.blurScale,e.useKernelBlur=this.useKernelBlur,e.renderList=[],t.renderList)for(let s=0;s{throw re("ShadowGeneratorSceneComponent")};export{n as ShadowGenerator}; diff --git a/assets/shadowGeneratorSceneComponent-BXvrlafB.js b/assets/shadowGeneratorSceneComponent-BXvrlafB.js deleted file mode 100644 index 3cd498c698336ae1b685dfecdc4fb39ce8519c90..0000000000000000000000000000000000000000 --- a/assets/shadowGeneratorSceneComponent-BXvrlafB.js +++ /dev/null @@ -1,164 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./depth.vertex-BAaQWRpW.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./bonesDeclaration-DUXz5WB4.js","./instancesVertex-BZz8JvZy.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./clipPlaneVertex-D5g8dBQb.js","./instancesDeclaration-ConO0l1b.js","./morphTargetsVertex-W8O8GW2p.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./depth.fragment-CTRWe7YE.js","./clipPlaneFragment-BmMK1U8A.js","./packingFunctions-Dod19T_v.js"])))=>i.map(i=>d[i]); -import{ShadowGenerator as v}from"./shadowGenerator-DTWbYxFR.js";import{S as R,T as F,b9 as J,aL as se,J as A,E as de,b3 as ce,b2 as ue,b4 as fe,Y as le,b1 as _e,$ as me,a2 as pe,a5 as ge,be as ie,aE as xe,bn as j,O as Me,bE as Se,aA as Ce,V as f,M as T,L as q,aq as ve,av as Ee,bd as be,bF as Re,a as X}from"./index-GY9JDBGV.js";import{af as I}from"./index-DydPgVMC.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./packingFunctions-qIF0h5ys.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./pointCloudVertex-wpVdAlmJ.js";const G="depthPixelShader",re=`#ifdef ALPHATEST -varying vec2 vUV;uniform sampler2D diffuseSampler; -#endif -#include -varying float vDepthMetric; -#ifdef PACKED -#include -#endif -#ifdef STORE_CAMERASPACE_Z -varying vec4 vViewPos; -#endif -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{ -#include -#ifdef ALPHATEST -if (texture2D(diffuseSampler,vUV).a<0.4) -discard; -#endif -#ifdef STORE_CAMERASPACE_Z -#ifdef PACKED -gl_FragColor=pack(vViewPos.z); -#else -gl_FragColor=vec4(vViewPos.z,0.0,0.0,1.0); -#endif -#else -#ifdef NONLINEARDEPTH -#ifdef PACKED -gl_FragColor=pack(gl_FragCoord.z); -#else -gl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0); -#endif -#else -#ifdef PACKED -gl_FragColor=pack(vDepthMetric); -#else -gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0); -#endif -#endif -#endif -}`;R.ShadersStore[G]||(R.ShadersStore[G]=re);const De={name:G,shader:re},Ae=Object.freeze(Object.defineProperty({__proto__:null,depthPixelShader:De},Symbol.toStringTag,{value:"Module"})),Q="pointCloudVertexDeclaration",Te=`#ifdef POINTSIZE -uniform float pointSize; -#endif -`;R.IncludesShadersStore[Q]||(R.IncludesShadersStore[Q]=Te);const K="depthVertexShader",ne=`attribute vec3 position; -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -uniform mat4 viewProjection;uniform vec2 depthValues; -#if defined(ALPHATEST) || defined(NEED_UV) -varying vec2 vUV;uniform mat4 diffuseMatrix; -#ifdef UV1 -attribute vec2 uv; -#endif -#ifdef UV2 -attribute vec2 uv2; -#endif -#endif -#ifdef STORE_CAMERASPACE_Z -uniform mat4 view;varying vec4 vViewPos; -#endif -#include -varying float vDepthMetric; -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) -{vec3 positionUpdated=position; -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0); -#include -gl_Position=viewProjection*worldPos; -#ifdef STORE_CAMERASPACE_Z -vViewPos=view*worldPos; -#else -#ifdef USE_REVERSE_DEPTHBUFFER -vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y)); -#else -vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y)); -#endif -#endif -#if defined(ALPHATEST) || defined(BASIC_RENDER) -#ifdef UV1 -vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#ifdef UV2 -vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#endif -#include -} -`;R.ShadersStore[K]||(R.ShadersStore[K]=ne);const Pe={name:K,shader:ne},we=Object.freeze(Object.defineProperty({__proto__:null,depthVertexShader:Pe},Symbol.toStringTag,{value:"Module"}));class B{get shaderLanguage(){return this._shaderLanguage}setMaterialForRendering(e,t){this._depthMap.setMaterialForRendering(e,t)}constructor(e,t=1,i=null,s=!1,r=F.TRILINEAR_SAMPLINGMODE,n=!1,o,h){this._shaderLanguage=0,this.enabled=!0,this.forceDepthWriteTransparentMeshes=!1,this.useOnlyInActiveCamera=!1,this.reverseCulling=!1,this._shadersLoaded=!1,this._scene=e,this._storeNonLinearDepth=s,this._storeCameraSpaceZ=n,this.isPacked=t===0,this.isPacked?this.clearColor=new J(1,1,1,1):this.clearColor=new J(n?0:1,0,0,1),this._initShaderSourceAsync(),B._SceneComponentInitialization(this._scene);const d=e.getEngine();this._camera=i,r!==F.NEAREST_SAMPLINGMODE&&(t===1&&!d._caps.textureFloatLinearFiltering&&(r=F.NEAREST_SAMPLINGMODE),t===2&&!d._caps.textureHalfFloatLinearFiltering&&(r=F.NEAREST_SAMPLINGMODE));const c=this.isPacked||!d._features.supportExtendedTextureFormats?5:6;this._depthMap=h??new se(o??"DepthRenderer",{width:d.getRenderWidth(),height:d.getRenderHeight()},this._scene,!1,!0,t,!1,r,void 0,void 0,void 0,c),this._depthMap.wrapU=F.CLAMP_ADDRESSMODE,this._depthMap.wrapV=F.CLAMP_ADDRESSMODE,this._depthMap.refreshRate=1,this._depthMap.renderParticles=!1,this._depthMap.renderList=null,this._depthMap.noPrePassRenderer=!0,this._depthMap.activeCamera=this._camera,this._depthMap.ignoreCameraViewport=!0,this._depthMap.useCameraPostProcesses=!1,this._depthMap.onClearObservable.add(u=>{u.clear(this.clearColor,!0,!0,!0)}),this._depthMap.onBeforeBindObservable.add(()=>{d._enableGPUDebugMarkers&&(d.restoreDefaultFramebuffer(),d._debugPushGroup?.("Depth renderer"))}),this._depthMap.onAfterUnbindObservable.add(()=>{d._enableGPUDebugMarkers&&d._debugPopGroup?.()}),this._depthMap.customIsReadyFunction=(u,p,l)=>{if((l||p===0)&&u.subMeshes)for(let m=0;m{const p=u.getRenderingMesh(),l=u.getEffectiveMesh(),m=this._scene,a=m.getEngine(),M=u.getMaterial();if(l._internalAbstractMeshDataInfo._isActiveIntermediate=!1,!M||l.infiniteDistance||M.disableDepthWrite||u.verticesCount===0||u._renderId===m.getRenderId())return;const P=l._getWorldMatrixDeterminant()<0;let E=M._getEffectiveOrientation(p);P&&(E=E===0?1:0);const k=E===0;a.setState(M.backFaceCulling,0,!1,k,this.reverseCulling?!M.cullBackFaces:M.cullBackFaces);const y=p._getInstancesRenderList(u._id,!!u.getReplacementMesh());if(y.mustReturn)return;const N=a.getCaps().instancedArrays&&(y.visibleInstances[u._id]!==null&&y.visibleInstances[u._id]!==void 0||p.hasThinInstances),O=this._camera||m.activeCamera;if(this.isReady(u,N)&&O){u._renderId=m.getRenderId();let D=l._internalAbstractMeshDataInfo._materialForRenderPass?.[a.currentRenderPassId];if(D===void 0&&l.getClassName()==="GaussianSplattingMesh"&&(D=l.material.makeDepthRenderingMaterial(this._scene,this._shaderLanguage),this.setMaterialForRendering(l,D),!D.isReady()))return;let L=u._getDrawWrapper();!L&&D&&(L=D._getDrawWrapper());const he=O.mode===_e.ORTHOGRAPHIC_CAMERA;if(!L)return;const C=L.effect;a.enableEffect(L),N||p._bind(u,C,M.fillMode),D?D.bindForSubMesh(l.getWorldMatrix(),l,u):(C.setMatrix("viewProjection",m.getTransformMatrix()),C.setMatrix("world",l.getWorldMatrix()),this._storeCameraSpaceZ&&C.setMatrix("view",m.getViewMatrix()));let W,H;if(he?(W=!a.useReverseDepthBuffer&&a.isNDCHalfZRange?0:1,H=a.useReverseDepthBuffer&&a.isNDCHalfZRange?0:1):(W=a.useReverseDepthBuffer&&a.isNDCHalfZRange?O.minZ:a.isNDCHalfZRange?0:O.minZ,H=a.useReverseDepthBuffer&&a.isNDCHalfZRange?0:O.maxZ),C.setFloat2("depthValues",W,W+H),!D){if(M.needAlphaTestingForMesh(l)){const V=M.getAlphaTestTexture();V&&(C.setTexture("diffuseSampler",V),C.setMatrix("diffuseMatrix",V.getTextureMatrix()))}me(p,C),pe(C,M,m),ge(p,C),p.morphTargetManager&&p.morphTargetManager.isUsingTextureForTargets&&p.morphTargetManager._bind(C);const U=u.getMesh().bakedVertexAnimationManager;U&&U.isEnabled&&U.bind(C,N),M.pointsCloud&&C.setFloat("pointSize",M.pointSize)}p._processRendering(l,u,C,M.fillMode,y,N,(U,V)=>C.setMatrix("world",V))}};this._depthMap.customRenderFunction=(u,p,l,m)=>{let a;if(m.length)for(a=0;aimport("./depth.vertex-BAaQWRpW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),I(()=>import("./depth.fragment-CTRWe7YE.js"),__vite__mapDeps([12,1,2,3,13,14]),import.meta.url)])):await Promise.all([I(()=>Promise.resolve().then(()=>we),void 0,import.meta.url),I(()=>Promise.resolve().then(()=>Ae),void 0,import.meta.url)]),this._shadersLoaded=!0}isReady(e,t){if(!this._shadersLoaded)return!1;const i=this._scene.getEngine(),s=e.getMesh(),r=s.getScene(),n=s._internalAbstractMeshDataInfo._materialForRenderPass?.[i.currentRenderPassId];if(n)return n.isReadyForSubMesh(s,e,t);const o=e.getMaterial();if(!o||o.disableDepthWrite)return!1;const h=[],d=[A.PositionKind];let c=!1,g=!1;const u=!1;o.needAlphaTestingForMesh(s)&&o.getAlphaTestTexture()&&(h.push("#define ALPHATEST"),s.isVerticesDataPresent(A.UVKind)&&(d.push(A.UVKind),h.push("#define UV1"),c=!0),s.isVerticesDataPresent(A.UV2Kind)&&(d.push(A.UV2Kind),h.push("#define UV2"),g=!0));const p=new de;if(s.useBones&&s.computeBonesUsingShaders&&s.skeleton){d.push(A.MatricesIndicesKind),d.push(A.MatricesWeightsKind),s.numBoneInfluencers>4&&(d.push(A.MatricesIndicesExtraKind),d.push(A.MatricesWeightsExtraKind)),h.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),s.numBoneInfluencers>0&&p.addCPUSkinningFallback(0,s);const E=s.skeleton;E.isUsingTextureForMatrices?h.push("#define BONETEXTURE"):h.push("#define BonesPerMesh "+(E.bones.length+1))}else h.push("#define NUM_BONE_INFLUENCERS 0");const l=s.morphTargetManager?ce(s.morphTargetManager,h,d,s,!0,!1,!1,c,g,u):0;o.pointsCloud&&h.push("#define POINTSIZE"),t&&(h.push("#define INSTANCES"),ue(d),e.getRenderingMesh().hasThinInstances&&h.push("#define THIN_INSTANCES"));const m=s.bakedVertexAnimationManager;m&&m.isEnabled&&(h.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&d.push("bakedVertexAnimationSettingsInstanced")),this._storeNonLinearDepth&&h.push("#define NONLINEARDEPTH"),this._storeCameraSpaceZ&&h.push("#define STORE_CAMERASPACE_Z"),this.isPacked&&h.push("#define PACKED"),fe(o,r,h);const a=e._getDrawWrapper(void 0,!0),M=a.defines,P=h.join(` -`);if(M!==P){const E=["world","mBones","boneTextureWidth","pointSize","viewProjection","view","diffuseMatrix","depthValues","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],k=["diffuseSampler","morphTargets","boneSampler","bakedVertexAnimationTexture"];le(E),a.setEffect(i.createEffect("depth",{attributes:d,uniformsNames:E,uniformBuffersNames:[],samplers:k,defines:P,fallbacks:p,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:l},shaderLanguage:this._shaderLanguage},i),P)}return a.effect.isReady()}getDepthMap(){return this._depthMap}dispose(){const e=[];for(const t in this._scene._depthRenderer)this._scene._depthRenderer[t]===this&&e.push(t);if(e.length>0){this._depthMap.dispose();for(const t of e)delete this._scene._depthRenderer[t]}}}B.ForceGLSL=!1;B._SceneComponentInitialization=S=>{throw ie("DepthRendererSceneComponent")};var ee;(function(S){S[S.NormalizedViewDepth=0]="NormalizedViewDepth",S[S.ViewDepth=1]="ViewDepth",S[S.ScreenDepth=2]="ScreenDepth"})(ee||(ee={}));class w extends xe{_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(I(()=>Promise.resolve().then(()=>Ue),void 0,import.meta.url))):t.push(I(()=>Promise.resolve().then(()=>Oe),void 0,import.meta.url))}constructor(e,t=null,i="",s){super({...s,name:e,engine:t||j.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:w.FragmentUrl,uniforms:w.Uniforms,defines:i}),this.textureWidth=0,this.textureHeight=0}bind(e=!1){super.bind(e);const t=this.drawWrapper.effect;this.textureWidth===1||this.textureHeight===1?t.setInt2("texSize",this.textureWidth,this.textureHeight):t.setFloat2("texSize",this.textureWidth,this.textureHeight)}}w.FragmentUrl="minmaxRedux";w.Uniforms=["texSize"];const Fe=new Float32Array(4),ze=new Uint8Array(4),b={min:0,max:0};class Ie{get depthRedux(){return this._depthRedux}set depthRedux(e){this._depthRedux!==e&&(this._depthRedux=e,this._recreatePostProcesses())}get textureWidth(){return this._textureWidth}get textureHeight(){return this._textureHeight}constructor(e,t=!0){this.onAfterReductionPerformed=new Me,this._textureWidth=0,this._textureHeight=0,this._scene=e,this._depthRedux=t,this.reductionSteps=[]}setTextureDimensions(e,t,i=0){return e===this._textureWidth&&t===this._textureHeight&&i===this._depthTextureType?!1:(this._textureWidth=e,this._textureHeight=t,this._depthTextureType=i,this._recreatePostProcesses(),!0)}readMinMax(e){const t=e.type===j.TEXTURETYPE_FLOAT||e.type===j.TEXTURETYPE_HALF_FLOAT,i=t?Fe:ze;this._scene.getEngine()._readTexturePixels(e,1,1,-1,0,i,!1),b.min=i[0],b.max=i[1],t||(b.min=b.min/255,b.max=b.max/255),b.min>=b.max&&(b.min=0,b.max=1),this.onAfterReductionPerformed.notifyObservers(b)}dispose(e=!0){e&&(this.onAfterReductionPerformed.clear(),this._textureWidth=0,this._textureHeight=0);for(let t=0;t1||i>1;){t=Math.max(Math.round(t/2),1),i=Math.max(Math.round(i/2),1);const n=new w("Reduction phase "+r,e.getEngine(),"#define "+(t==1&&i==1?"LAST":t==1||i==1?"ONEBEFORELAST":"MAIN"));n.textureWidth=t,n.textureHeight=i,this.reductionSteps.push(n),r++}}}const $="minmaxReduxPixelShader",ae=`varying vec2 vUV;uniform sampler2D textureSampler; -#if defined(INITIAL) -uniform vec2 texSize;void main(void) -{ivec2 coord=ivec2(vUV*(texSize-1.0));float f1=texelFetch(textureSampler,coord,0).r;float f2=texelFetch(textureSampler,coord+ivec2(1,0),0).r;float f3=texelFetch(textureSampler,coord+ivec2(1,1),0).r;float f4=texelFetch(textureSampler,coord+ivec2(0,1),0).r; -#ifdef DEPTH_REDUX -#ifdef VIEW_DEPTH -float minz=3.4e38;if (f1 != 0.0) { minz=f1; } -if (f2 != 0.0) { minz=min(minz,f2); } -if (f3 != 0.0) { minz=min(minz,f3); } -if (f4 != 0.0) { minz=min(minz,f4); } -float maxz=max(max(max(f1,f2),f3),f4); -#else -float minz=min(min(min(f1,f2),f3),f4);float maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4); -#endif -#else -float minz=min(min(min(f1,f2),f3),f4);float maxz=max(max(max(f1,f2),f3),f4); -#endif -glFragColor=vec4(minz,maxz,0.,0.);} -#elif defined(MAIN) -uniform vec2 texSize;void main(void) -{ivec2 coord=ivec2(vUV*(texSize-1.0));vec2 f1=texelFetch(textureSampler,coord,0).rg;vec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;vec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;vec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);} -#elif defined(ONEBEFORELAST) -uniform ivec2 texSize;void main(void) -{ivec2 coord=ivec2(vUV*vec2(texSize-1));vec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;vec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;vec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;vec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);} -#elif defined(LAST) -void main(void) -{glFragColor=vec4(0.);if (true) { -discard;}} -#endif -`;R.ShadersStore[$]||(R.ShadersStore[$]=ae);const Be={name:$,shader:ae},Oe=Object.freeze(Object.defineProperty({__proto__:null,minmaxReduxPixelShader:Be},Symbol.toStringTag,{value:"Module"})),Y="minmaxReduxPixelShader",oe=`varying vUV: vec2f;var textureSampler: texture_2d; -#if defined(INITIAL) -uniform texSize: vec2f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*(uniforms.texSize-1.0));let f1=textureLoad(textureSampler,coord,0).r;let f2=textureLoad(textureSampler,coord+vec2i(1,0),0).r;let f3=textureLoad(textureSampler,coord+vec2i(1,1),0).r;let f4=textureLoad(textureSampler,coord+vec2i(0,1),0).r; -#ifdef DEPTH_REDUX -#ifdef VIEW_DEPTH -var minz=3.4e38;if (f1 != 0.0) { minz=f1; } -if (f2 != 0.0) { minz=min(minz,f2); } -if (f3 != 0.0) { minz=min(minz,f3); } -if (f4 != 0.0) { minz=min(minz,f4); } -let maxz=max(max(max(f1,f2),f3),f4); -#else -let minz=min(min(min(f1,f2),f3),f4);let maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4); -#endif -#else -let minz=min(min(min(f1,f2),f3),f4);let maxz=max(max(max(f1,f2),f3),f4); -#endif -fragmentOutputs.color=vec4f(minz,maxz,0.,0.);} -#elif defined(MAIN) -uniform texSize: vec2f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*(uniforms.texSize-1.0));let f1=textureLoad(textureSampler,coord,0).rg;let f2=textureLoad(textureSampler,coord+vec2i(1,0),0).rg;let f3=textureLoad(textureSampler,coord+vec2i(1,1),0).rg;let f4=textureLoad(textureSampler,coord+vec2i(0,1),0).rg;let minz=min(min(min(f1.x,f2.x),f3.x),f4.x);let maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);fragmentOutputs.color=vec4(minz,maxz,0.,0.);} -#elif defined(ONEBEFORELAST) -uniform texSize: vec2i;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*vec2f(uniforms.texSize-1));let f1=textureLoad(textureSampler,coord % uniforms.texSize,0).rg;let f2=textureLoad(textureSampler,(coord+vec2i(1,0)) % uniforms.texSize,0).rg;let f3=textureLoad(textureSampler,(coord+vec2i(1,1)) % uniforms.texSize,0).rg;let f4=textureLoad(textureSampler,(coord+vec2i(0,1)) % uniforms.texSize,0).rg;let minz=min(min(min(f1.x,f2.x),f3.x),f4.x);let maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);fragmentOutputs.color=vec4(minz,maxz,0.,0.);} -#elif defined(LAST) -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=vec4f(0.);if (true) { -discard;}} -#endif -`;R.ShadersStoreWGSL[Y]||(R.ShadersStoreWGSL[Y]=oe);const Le={name:Y,shader:oe},Ue=Object.freeze(Object.defineProperty({__proto__:null,minmaxReduxPixelShaderWGSL:Le},Symbol.toStringTag,{value:"Module"}));class Ve{get onAfterReductionPerformed(){return this._thinMinMaxReducer.onAfterReductionPerformed}constructor(e){this._onAfterUnbindObserver=null,this._forceFullscreenViewport=!0,this._activated=!1,this._camera=e,this._postProcessManager=new Se(e.getScene()),this._thinMinMaxReducer=new Ie(e.getScene()),this._reductionSteps=[],this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{this._postProcessManager._rebuild()})}get sourceTexture(){return this._sourceTexture}setSourceTexture(e,t,i=2,s=!0){if(e!==this._sourceTexture&&(this._thinMinMaxReducer.depthRedux=t,this.deactivate(),this._sourceTexture=e,this._forceFullscreenViewport=s,this._thinMinMaxReducer.setTextureDimensions(e.getRenderWidth(),e.getRenderHeight()))){this._disposePostProcesses();const r=this._thinMinMaxReducer.reductionSteps;for(let n=0;n{d.setTexture("textureSampler",this._sourceTexture)})),n===r.length-1&&this._reductionSteps[n-1].onAfterRenderObservable.add(()=>{this._thinMinMaxReducer.readMinMax(h.inputTexture.texture)})}}}get refreshRate(){return this._sourceTexture?this._sourceTexture.refreshRate:-1}set refreshRate(e){this._sourceTexture&&(this._sourceTexture.refreshRate=e)}get activated(){return this._activated}activate(){this._onAfterUnbindObserver||!this._sourceTexture||(this._onAfterUnbindObserver=this._sourceTexture.onAfterUnbindObservable.add(()=>{const e=this._camera.getScene().getEngine();e._debugPushGroup?.("min max reduction"),this._reductionSteps[0].activate(this._camera),this._postProcessManager.directRender(this._reductionSteps,this._reductionSteps[0].inputTexture,this._forceFullscreenViewport,0,0,!0,this._reductionSteps.length-1),e.unBindFramebuffer(this._reductionSteps[this._reductionSteps.length-1].inputTexture,!1),e._debugPopGroup?.()}),this._activated=!0)}deactivate(){!this._onAfterUnbindObserver||!this._sourceTexture||(this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=null,this._activated=!1)}dispose(e=!0){e&&(this.onAfterReductionPerformed.clear(),this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=void 0,this._disposePostProcesses(),this._postProcessManager.dispose(),this._postProcessManager=void 0,this._thinMinMaxReducer.dispose(),this._thinMinMaxReducer=void 0,this._sourceTexture=null)}_disposePostProcesses(){for(let e=0;ethis._computeShadowCastersBoundingInfo())),this._freezeShadowCastersBoundingInfo=e,e&&this._computeShadowCastersBoundingInfo()}_computeShadowCastersBoundingInfo(){if(this._scbiMin.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._scbiMax.copyFromFloats(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this._shadowMap&&this._shadowMap.renderList){const e=this._shadowMap.renderList;for(let t=0;tt&&(e=0,t=1),e<0&&(e=0),t>1&&(t=1),this._minDistance=e,this._maxDistance=t,this._breaksAreDirty=!0)}get minDistance(){return this._minDistance}get maxDistance(){return this._maxDistance}getClassName(){return x.CLASSNAME}getCascadeMinExtents(e){return e>=0&&e=0&&et.maxZ&&t.maxZ!==0||(this._shadowMaxZ=e,this._light._markMeshesAsLightDirty(),this._breaksAreDirty=!0)}get debug(){return this._debug}set debug(e){this._debug=e,this._light._markMeshesAsLightDirty()}get depthClamp(){return this._depthClamp}set depthClamp(e){this._depthClamp=e}get cascadeBlendPercentage(){return this._cascadeBlendPercentage}set cascadeBlendPercentage(e){this._cascadeBlendPercentage=e,this._light._markMeshesAsLightDirty()}get lambda(){return this._lambda}set lambda(e){const t=Math.min(Math.max(e,0),1);this._lambda!=t&&(this._lambda=t,this._breaksAreDirty=!0)}getCascadeViewMatrix(e){return e>=0&&e=0&&e=0&&e{let s=i.min,r=i.max;s>=r&&(s=0,r=1),(s!=this._minDistance||r!=this._maxDistance)&&this.setMinMaxDistance(s,r)}),this._depthReducer.setDepthRenderer(this._depthRenderer)),this._depthReducer.activate()}}get autoCalcDepthBoundsRefreshRate(){return this._depthReducer?.depthRenderer?.getDepthMap().refreshRate??-1}set autoCalcDepthBoundsRefreshRate(e){this._depthReducer?.depthRenderer&&(this._depthReducer.depthRenderer.getDepthMap().refreshRate=e)}splitFrustum(){this._breaksAreDirty=!0}_splitFrustum(){const e=this._getCamera();if(!e)return;const t=e.minZ,i=e.maxZ||this._shadowMaxZ,s=i-t,r=this._minDistance,n=this._shadowMaxZ=t?Math.min((this._shadowMaxZ-t)/(i-t),this._maxDistance):this._maxDistance,o=t+r*s,h=t+n*s,d=h-o,c=h/o;for(let g=0;gn||(!this._depthClamp||this.filter===v.FILTER_PCSS?(r=Math.min(r,h),this.filter!==v.FILTER_PCSS&&(n=Math.min(n,d))):(n=Math.min(n,d),r=Math.max(r,h),n=Math.max(r+1,n))),T.OrthoOffCenterLHToRef(this._cascadeMinExtents[s].x,this._cascadeMaxExtents[s].x,this._cascadeMinExtents[s].y,this._cascadeMaxExtents[s].y,i?n:r,i?r:n,this._projectionMatrices[s],e.getEngine().isNDCHalfZRange),this._cascadeMinExtents[s].z=r,this._cascadeMaxExtents[s].z=n,this._viewMatrices[s].multiplyToRef(this._projectionMatrices[s],this._transformMatrices[s]),f.TransformCoordinatesToRef(Ne,this._transformMatrices[s],_),_.scaleInPlace(this._mapSize/2),z.copyFromFloats(Math.round(_.x),Math.round(_.y),Math.round(_.z)),z.subtractInPlace(_).scaleInPlace(2/this._mapSize),T.TranslationToRef(z.x,z.y,0,Z),this._projectionMatrices[s].multiplyToRef(Z,this._projectionMatrices[s]),this._viewMatrices[s].multiplyToRef(this._projectionMatrices[s],this._transformMatrices[s]),this._transformMatrices[s].copyToArray(this._transformMatricesAsArray,s*16)}}_computeFrustumInWorldSpace(e){const t=this._getCamera();if(!t)return;const i=this._cascades[e].prevBreakDistance,s=this._cascades[e].breakDistance,r=this._scene.getEngine().isNDCHalfZRange;t.getViewMatrix();const n=t.maxZ===0,o=t.maxZ;n&&(t.maxZ=this._shadowMaxZ,t.getProjectionMatrix(!0));const h=T.Invert(t.getTransformationMatrix());n&&(t.maxZ=o,t.getProjectionMatrix(!0));const d=this._scene.getEngine().useReverseDepthBuffer?4:0;for(let c=0;c{this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._sceneUBOs[t]),this._currentLayer=t,this._filter===v.FILTER_PCF&&e.setColorWrite(!1),be.eyeAtCamera=!1,this._scene.setTransformMatrix(this.getCascadeViewMatrix(t),this.getCascadeProjectionMatrix(t)),this._useUBO&&(this._scene.getSceneUniformBuffer().unbindEffect(),this._scene.finalizeSceneUbo())}),this._shadowMap.onBeforeBindObservable.add(()=>{this._currentSceneUBO=this._scene.getSceneUniformBuffer(),e._enableGPUDebugMarkers&&(e.restoreDefaultFramebuffer(),e._debugPushGroup?.(`Cascaded shadow map generation for pass id ${e.currentRenderPassId}`)),this._breaksAreDirty&&this._splitFrustum(),this._computeMatrices()}),this._splitFrustum()}_bindCustomEffectForRenderSubMeshForShadowMap(e,t){t.setMatrix("viewProjection",this.getCascadeTransformMatrix(this._currentLayer))}_isReadyCustomDefines(e){e.push("#define SM_DEPTHCLAMP "+(this._depthClamp&&this._filter!==v.FILTER_PCSS?"1":"0"))}prepareDefines(e,t){super.prepareDefines(e,t);const i=this._scene,s=this._light;if(!i.shadowsEnabled||!s.shadowEnabled)return;e["SHADOWCSM"+t]=!0,e["SHADOWCSMDEBUG"+t]=this.debug,e["SHADOWCSMNUM_CASCADES"+t]=this.numCascades,e["SHADOWCSM_RIGHTHANDED"+t]=i.useRightHandedSystem;const r=this._getCamera();r&&this._shadowMaxZ<=(r.maxZ||this._shadowMaxZ)&&(e["SHADOWCSMUSESHADOWMAXZ"+t]=!0),this.cascadeBlendPercentage===0&&(e["SHADOWCSMNOBLEND"+t]=!0)}bindShadowLight(e,t){const i=this._light,s=this._scene;if(!s.shadowsEnabled||!i.shadowEnabled)return;const r=this._getCamera();if(!r)return;const n=this.getShadowMap();if(!n)return;const o=n.getSize().width,h=this._transformMatricesAsArray,d=s.floatingOriginMode?Re(this._scene.floatingOriginOffset,this._viewMatrices,this._projectionMatrices,this._numCascades,this._tempTransformMatricesAsArray):h;if(t.setMatrices("lightMatrix"+e,d),t.setArray("viewFrustumZ"+e,this._viewSpaceFrustumsZ),t.setFloat("cascadeBlendFactor"+e,this.cascadeBlendPercentage===0?1e4:1/this.cascadeBlendPercentage),t.setArray("frustumLengths"+e,this._frustumLengths),this._filter===v.FILTER_PCF)t.setDepthStencilTexture("shadowTexture"+e,n),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),o,1/o,this.frustumEdgeFalloff,e);else if(this._filter===v.FILTER_PCSS){for(let c=0;cnew x(s,r,void 0,n));return e.numCascades!==void 0&&(i.numCascades=e.numCascades),e.debug!==void 0&&(i.debug=e.debug),e.stabilizeCascades!==void 0&&(i.stabilizeCascades=e.stabilizeCascades),e.lambda!==void 0&&(i.lambda=e.lambda),e.cascadeBlendPercentage!==void 0&&(i.cascadeBlendPercentage=e.cascadeBlendPercentage),e.depthClamp!==void 0&&(i.depthClamp=e.depthClamp),e.autoCalcDepthBounds!==void 0&&(i.autoCalcDepthBounds=e.autoCalcDepthBounds),e.shadowMaxZ!==void 0&&(i.shadowMaxZ=e.shadowMaxZ),e.penumbraDarkness!==void 0&&(i.penumbraDarkness=e.penumbraDarkness),e.freezeShadowCastersBoundingInfo!==void 0&&(i.freezeShadowCastersBoundingInfo=e.freezeShadowCastersBoundingInfo),e.minDistance!==void 0&&e.maxDistance!==void 0&&i.setMinMaxDistance(e.minDistance,e.maxDistance),i}}x._FrustumCornersNdcSpace=[new f(-1,1,-1),new f(1,1,-1),new f(1,-1,-1),new f(-1,-1,-1),new f(-1,1,1),new f(1,1,1),new f(1,-1,1),new f(-1,-1,1)];x.CLASSNAME="CascadedShadowGenerator";x.DEFAULT_CASCADES_COUNT=4;x.MIN_CASCADES_COUNT=2;x.MAX_CASCADES_COUNT=4;x._SceneComponentInitialization=S=>{throw ie("ShadowGeneratorSceneComponent")};class We{constructor(e){this.name=X.NAME_SHADOWGENERATOR,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(X.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)}rebuild(){}serialize(e){e.shadowGenerators=[];const t=this.scene.lights;for(const i of t){if(i.doNotSerialize)continue;const s=i.getShadowGenerators();if(s){const r=s.values();for(let n=r.next();n.done!==!0;n=r.next()){const o=n.value;o.doNotSerialize||e.shadowGenerators.push(o.serialize())}}}}addFromContainer(e){}removeFromContainer(e,t){}dispose(){}_gatherRenderTargets(e){const t=this.scene;if(this.scene.shadowsEnabled)for(let i=0;i{let e=S._getComponent(X.NAME_SHADOWGENERATOR);e||(e=new We(S),S._addComponent(e))};export{We as ShadowGeneratorSceneComponent}; diff --git a/assets/shadowMap.fragment-CW3H6DYO.js b/assets/shadowMap.fragment-CW3H6DYO.js deleted file mode 100644 index 277881f894161c8d97f943a79c3e5599902a6812..0000000000000000000000000000000000000000 --- a/assets/shadowMap.fragment-CW3H6DYO.js +++ /dev/null @@ -1,79 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./packingFunctions-qIF0h5ys.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./index-DydPgVMC.js";const r="bayerDitherFunctions",d=`float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);} -float bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0); -vec2 P2=floor(0.5*mod(_P,4.0)); -return 4.0*bayerDither2(P1)+bayerDither2(P2);} -float bayerDither8(vec2 _P) {vec2 P1=mod(_P,2.0); -vec2 P2=floor(0.5 *mod(_P,4.0)); -vec2 P4=floor(0.25*mod(_P,8.0)); -return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);} -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=d);const t="shadowMapFragmentExtraDeclaration",o=`#if SM_FLOAT==0 -#include -#endif -#if SM_SOFTTRANSPARENTSHADOW==1 -#include -uniform vec2 softTransparentShadowSM; -#endif -varying float vDepthMetricSM; -#if SM_USEDISTANCE==1 -uniform vec3 lightDataSM;varying vec3 vPositionWSM; -#endif -uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM; -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -varying float zSM; -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=o);const i="shadowMapFragment",n=`float depthSM=vDepthMetricSM; -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -#if SM_USEDISTANCE==1 -depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#else -#ifdef USE_REVERSE_DEPTHBUFFER -depthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#else -depthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#endif -#endif -depthSM=clamp(depthSM,0.0,1.0); -#ifdef USE_REVERSE_DEPTHBUFFER -gl_FragDepth=clamp(1.0-depthSM,0.0,1.0); -#else -gl_FragDepth=clamp(depthSM,0.0,1.0); -#endif -#elif SM_USEDISTANCE==1 -depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#endif -#if SM_ESM==1 -depthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.); -#endif -#if SM_FLOAT==1 -gl_FragColor=vec4(depthSM,1.0,1.0,1.0); -#else -gl_FragColor=pack(depthSM); -#endif -return;`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=n);const a="shadowMapPixelShader",S=`#include -#ifdef ALPHATEXTURE -varying vec2 vUV;uniform sampler2D diffuseSampler; -#endif -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) -{ -#include -#ifdef ALPHATEXTURE -vec4 opacityMap=texture2D(diffuseSampler,vUV);float alphaFromAlphaTexture=opacityMap.a; -#if SM_SOFTTRANSPARENTSHADOW==1 -if (softTransparentShadowSM.y==1.0) {opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;} -#endif -#ifdef ALPHATESTVALUE -if (alphaFromAlphaTexture=softTransparentShadowSM.x*alphaFromAlphaTexture) discard; -#else -if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x) discard; -#endif -#endif -#include -}`;e.ShadersStore[a]||(e.ShadersStore[a]=S);const p={name:a,shader:S};export{p as shadowMapPixelShader}; diff --git a/assets/shadowMap.fragment-u8ldEWvj.js b/assets/shadowMap.fragment-u8ldEWvj.js deleted file mode 100644 index 43a78d037ec265cc31bd623400577697068d9b6d..0000000000000000000000000000000000000000 --- a/assets/shadowMap.fragment-u8ldEWvj.js +++ /dev/null @@ -1,78 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./packingFunctions-Dod19T_v.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./index-DydPgVMC.js";const r="bayerDitherFunctions",f=`fn bayerDither2(_P: vec2f)->f32 {return ((2.0*_P.y+_P.x+1.0)%(4.0));} -fn bayerDither4(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); -var P2: vec2f=floor(0.5*((_P)%(4.0))); -return 4.0*bayerDither2(P1)+bayerDither2(P2);} -fn bayerDither8(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); -var P2: vec2f=floor(0.5 *((_P)%(4.0))); -var P4: vec2f=floor(0.25*((_P)%(8.0))); -return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);} -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=f);const t="shadowMapFragmentExtraDeclaration",S=`#if SM_FLOAT==0 -#include -#endif -#if SM_SOFTTRANSPARENTSHADOW==1 -#include -uniform softTransparentShadowSM: vec2f; -#endif -varying vDepthMetricSM: f32; -#if SM_USEDISTANCE==1 -uniform lightDataSM: vec3f;varying vPositionWSM: vec3f; -#endif -uniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f; -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -varying zSM: f32; -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=S);const n="shadowMapFragment",s=`var depthSM: f32=fragmentInputs.vDepthMetricSM; -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -#if SM_USEDISTANCE==1 -depthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#else -#ifdef USE_REVERSE_DEPTHBUFFER -depthSM=(-fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#else -depthSM=(fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#endif -#endif -depthSM=clamp(depthSM,0.0,1.0); -#ifdef USE_REVERSE_DEPTHBUFFER -fragmentOutputs.fragDepth=clamp(1.0-depthSM,0.0,1.0); -#else -fragmentOutputs.fragDepth=clamp(depthSM,0.0,1.0); -#endif -#elif SM_USEDISTANCE==1 -depthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#endif -#if SM_ESM==1 -depthSM=clamp(exp(-min(87.,uniforms.biasAndScaleSM.z*depthSM)),0.,1.); -#endif -#if SM_FLOAT==1 -fragmentOutputs.color= vec4f(depthSM,1.0,1.0,1.0); -#else -fragmentOutputs.color=pack(depthSM); -#endif -`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=s);const a="shadowMapPixelShader",i=`#include -#ifdef ALPHATEXTURE -varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d; -#endif -#include -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#include -#ifdef ALPHATEXTURE -var opacityMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV);var alphaFromAlphaTexture: f32=opacityMap.a; -#if SM_SOFTTRANSPARENTSHADOW==1 -if (uniforms.softTransparentShadowSM.y==1.0) {opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;} -#endif -#ifdef ALPHATESTVALUE -if (alphaFromAlphaTexture=uniforms.softTransparentShadowSM.x*alphaFromAlphaTexture) {discard;} -#else -if ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x) {discard;} -#endif -#endif -#include -}`;e.ShadersStoreWGSL[a]||(e.ShadersStoreWGSL[a]=i);const M={name:a,shader:i};export{M as shadowMapPixelShaderWGSL}; diff --git a/assets/shadowMap.vertex-DKOXb-vE.js b/assets/shadowMap.vertex-DKOXb-vE.js deleted file mode 100644 index 868af126a13faee635f3d6338dcd6f86eb2c8a02..0000000000000000000000000000000000000000 --- a/assets/shadowMap.vertex-DKOXb-vE.js +++ /dev/null @@ -1,109 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./bonesDeclaration-DUXz5WB4.js";import"./instancesVertex-BZz8JvZy.js";import"./morphTargetsVertexDeclaration-BFlkwWcP.js";import"./helperFunctions-Wgh3PIP0.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./morphTargetsVertex-W8O8GW2p.js";import"./bonesVertex-W7KXt3j6.js";import"./bakedVertexAnimation-Bs9it648.js";import"./index-DydPgVMC.js";const r="shadowMapVertexExtraDeclaration",a=`#if SM_NORMALBIAS==1 -uniform lightDataSM: vec3f; -#endif -uniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f;varying vDepthMetricSM: f32; -#if SM_USEDISTANCE==1 -varying vPositionWSM: vec3f; -#endif -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -varying zSM: f32; -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=a);const t="shadowMapVertexNormalBias",d=`#if SM_NORMALBIAS==1 -#if SM_DIRECTIONINLIGHTDATA==1 -var worldLightDirSM: vec3f=normalize(-uniforms.lightDataSM.xyz); -#else -var directionToLightSM: vec3f=uniforms.lightDataSM.xyz-worldPos.xyz;var worldLightDirSM: vec3f=normalize(directionToLightSM); -#endif -var ndlSM: f32=dot(vNormalW,worldLightDirSM);var sinNLSM: f32=sqrt(1.0-ndlSM*ndlSM);var normalBiasSM: f32=uniforms.biasAndScaleSM.y*sinNLSM;worldPos=vec4f(worldPos.xyz-vNormalW*normalBiasSM,worldPos.w); -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=d);const o="shadowMapVertexMetric",f=`#if SM_USEDISTANCE==1 -vertexOutputs.vPositionWSM=worldPos.xyz; -#endif -#if SM_DEPTHTEXTURE==1 -#ifdef IS_NDC_HALF_ZRANGE -#define BIASFACTOR 0.5 -#else -#define BIASFACTOR 1.0 -#endif -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.position.z-=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR; -#else -vertexOutputs.position.z+=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR; -#endif -#endif -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -vertexOutputs.zSM=vertexOutputs.position.z;vertexOutputs.position.z=0.0; -#elif SM_USEDISTANCE==0 -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetricSM=(-vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#else -vertexOutputs.vDepthMetricSM=(vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x; -#endif -#endif -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=f);const i="shadowMapVertexShader",n=`attribute position: vec3f; -#ifdef NORMAL -attribute normal: vec3f; -#endif -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef INSTANCES -attribute world0: vec4f;attribute world1: vec4f;attribute world2: vec4f;attribute world3: vec4f; -#endif -#include -#include -#include -#ifdef ALPHATEXTURE -varying vUV: vec2f;uniform diffuseMatrix: mat4x4f; -#ifdef UV1 -attribute uv: vec2f; -#endif -#ifdef UV2 -attribute uv2: vec2f; -#endif -#endif -#include -#include -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position; -#ifdef UV1 -var uvUpdated: vec2f=input.uv; -#endif -#ifdef UV2 -var uv2Updated: vec2f=input.uv2; -#endif -#ifdef NORMAL -var normalUpdated: vec3f=input.normal; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0); -#ifdef NORMAL -var normWorldSM: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -var vNormalW: vec3f=normalUpdated/ vec3f(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW); -#else -#ifdef NONUNIFORMSCALING -normWorldSM=transposeMat3(inverseMat3(normWorldSM)); -#endif -var vNormalW: vec3f=normalize(normWorldSM*normalUpdated); -#endif -#endif -#include -vertexOutputs.position=scene.viewProjection*worldPos; -#include -#ifdef ALPHATEXTURE -#ifdef UV1 -vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy; -#endif -#ifdef UV2 -vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy; -#endif -#endif -#include -}`;e.ShadersStoreWGSL[i]||(e.ShadersStoreWGSL[i]=n);const E={name:i,shader:n};export{E as shadowMapVertexShaderWGSL}; diff --git a/assets/shadowMap.vertex-pnrMo0rk.js b/assets/shadowMap.vertex-pnrMo0rk.js deleted file mode 100644 index 74b14c82bf20b09e63fa51914da9ae76c69773d7..0000000000000000000000000000000000000000 --- a/assets/shadowMap.vertex-pnrMo0rk.js +++ /dev/null @@ -1,119 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./helperFunctions-tBt4f_K3.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./index-DydPgVMC.js";const o="sceneVertexDeclaration",S=`uniform mat4 viewProjection; -#ifdef MULTIVIEW -uniform mat4 viewProjectionR; -#endif -uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition; -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=S);const r="meshVertexDeclaration",c=`uniform mat4 world;uniform float visibility; -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=c);const t="shadowMapVertexDeclaration",f=`#include -#include -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=f);const a="shadowMapUboDeclaration",M=`layout(std140,column_major) uniform; -#include -#include -`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=M);const n="shadowMapVertexExtraDeclaration",m=`#if SM_NORMALBIAS==1 -uniform vec3 lightDataSM; -#endif -uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;varying float vDepthMetricSM; -#if SM_USEDISTANCE==1 -varying vec3 vPositionWSM; -#endif -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -varying float zSM; -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=m);const d="shadowMapVertexNormalBias",u=`#if SM_NORMALBIAS==1 -#if SM_DIRECTIONINLIGHTDATA==1 -vec3 worldLightDirSM=normalize(-lightDataSM.xyz); -#else -vec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;vec3 worldLightDirSM=normalize(directionToLightSM); -#endif -float ndlSM=dot(vNormalW,worldLightDirSM);float sinNLSM=sqrt(1.0-ndlSM*ndlSM);float normalBiasSM=biasAndScaleSM.y*sinNLSM;worldPos.xyz-=vNormalW*normalBiasSM; -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=u);const l="shadowMapVertexMetric",v=`#if SM_USEDISTANCE==1 -vPositionWSM=worldPos.xyz; -#endif -#if SM_DEPTHTEXTURE==1 -#ifdef IS_NDC_HALF_ZRANGE -#define BIASFACTOR 0.5 -#else -#define BIASFACTOR 1.0 -#endif -#ifdef USE_REVERSE_DEPTHBUFFER -gl_Position.z-=biasAndScaleSM.x*gl_Position.w*BIASFACTOR; -#else -gl_Position.z+=biasAndScaleSM.x*gl_Position.w*BIASFACTOR; -#endif -#endif -#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 -zSM=gl_Position.z;gl_Position.z=0.0; -#elif SM_USEDISTANCE==0 -#ifdef USE_REVERSE_DEPTHBUFFER -vDepthMetricSM=(-gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#else -vDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; -#endif -#endif -`;e.IncludesShadersStore[l]||(e.IncludesShadersStore[l]=v);const i="shadowMapVertexShader",s=`attribute vec3 position; -#ifdef NORMAL -attribute vec3 normal; -#endif -#include -#include -#include -#include[0..maxSimultaneousMorphTargets] -#ifdef INSTANCES -attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3; -#endif -#include -#include<__decl__shadowMapVertex> -#ifdef ALPHATEXTURE -varying vec2 vUV;uniform mat4 diffuseMatrix; -#ifdef UV1 -attribute vec2 uv; -#endif -#ifdef UV2 -attribute vec2 uv2; -#endif -#endif -#include -#include -#define CUSTOM_VERTEX_DEFINITIONS -void main(void) -{vec3 positionUpdated=position; -#ifdef UV1 -vec2 uvUpdated=uv; -#endif -#ifdef UV2 -vec2 uv2Updated=uv2; -#endif -#ifdef NORMAL -vec3 normalUpdated=normal; -#endif -#include -#include[0..maxSimultaneousMorphTargets] -#include -#include -#include -vec4 worldPos=finalWorld*vec4(positionUpdated,1.0); -#ifdef NORMAL -mat3 normWorldSM=mat3(finalWorld); -#if defined(INSTANCES) && defined(THIN_INSTANCES) -vec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW); -#else -#ifdef NONUNIFORMSCALING -normWorldSM=transposeMat3(inverseMat3(normWorldSM)); -#endif -vec3 vNormalW=normalize(normWorldSM*normalUpdated); -#endif -#endif -#include -gl_Position=viewProjection*worldPos; -#include -#ifdef ALPHATEXTURE -#ifdef UV1 -vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0)); -#endif -#ifdef UV2 -vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0)); -#endif -#endif -#include -}`;e.ShadersStore[i]||(e.ShadersStore[i]=s);const D={name:i,shader:s};export{D as shadowMapVertexShader}; diff --git a/assets/shadowMapFragmentSoftTransparentShadow-XpK5Xvlm.js b/assets/shadowMapFragmentSoftTransparentShadow-XpK5Xvlm.js deleted file mode 100644 index 8f3180ec5add5197d7eb59b75cdcc615cc2c669a..0000000000000000000000000000000000000000 --- a/assets/shadowMapFragmentSoftTransparentShadow-XpK5Xvlm.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const a="shadowMapFragmentSoftTransparentShadow",o=`#if SM_SOFTTRANSPARENTSHADOW==1 -if ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x*alpha) {discard;} -#endif -`;r.IncludesShadersStoreWGSL[a]||(r.IncludesShadersStoreWGSL[a]=o);const S={name:a,shader:o};export{S as shadowMapFragmentSoftTransparentShadowWGSL}; diff --git a/assets/shadowMapFragmentSoftTransparentShadow-zlL3abIO.js b/assets/shadowMapFragmentSoftTransparentShadow-zlL3abIO.js deleted file mode 100644 index 169d956a2c14ac1652960af5846d18dfd5384708..0000000000000000000000000000000000000000 --- a/assets/shadowMapFragmentSoftTransparentShadow-zlL3abIO.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const a="shadowMapFragmentSoftTransparentShadow",o=`#if SM_SOFTTRANSPARENTSHADOW==1 -if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x*alpha) discard; -#endif -`;r.IncludesShadersStore[a]||(r.IncludesShadersStore[a]=o);const S={name:a,shader:o};export{S as shadowMapFragmentSoftTransparentShadow}; diff --git a/assets/shadowsFragmentFunctions-CHKo52s6.js b/assets/shadowsFragmentFunctions-CHKo52s6.js deleted file mode 100644 index ebb2d91138244a63ea060ae8ff8d712da44ff8b0..0000000000000000000000000000000000000000 --- a/assets/shadowsFragmentFunctions-CHKo52s6.js +++ /dev/null @@ -1,470 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const r="reflectionFunction",s=`fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f -{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); } -fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f -{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); } -fn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f -{var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);} -fn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f -{var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);} -fn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f -{var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;} -fn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f -{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz; -#ifdef INVERTCUBICMAP -coords.y*=-1.0; -#endif -return coords;} -fn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f -{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz; -#ifdef INVERTCUBICMAP -coords.y*=-1.0; -#endif -return coords;} -fn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f -{return (reflectionMatrix*(view*worldPos)).xyz;} -fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f -{return (reflectionMatrix* vec4f(positionW,1.)).xyz;} -#ifdef REFLECTION -fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f -{ -#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED -var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction); -#endif -#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED -var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction); -#endif -#ifdef REFLECTIONMAP_EQUIRECTANGULAR -return computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_SPHERICAL -return computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_PLANAR -return computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_CUBIC -#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC -return computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition); -#else -return computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix); -#endif -#endif -#ifdef REFLECTIONMAP_PROJECTION -return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix); -#endif -#ifndef REFLECTIONMAP_CUBIC -#ifdef REFLECTIONMAP_SKYBOX -return computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix); -#endif -#endif -#ifdef REFLECTIONMAP_EXPLICIT -return vec3f(0,0,0); -#endif -} -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=s);const t="lightUboDeclaration",v=`#ifdef LIGHT{X} -struct Light{X} -{vLightData: vec4f, -vLightDiffuse: vec4f, -vLightSpecular: vec4f, -#ifdef SPOTLIGHT{X} -vLightDirection: vec4f, -vLightFalloff: vec4f, -#elif defined(POINTLIGHT{X}) -vLightFalloff: vec4f, -#elif defined(HEMILIGHT{X}) -vLightGround: vec3f, -#elif defined(CLUSTLIGHT{X}) -vSliceData: vec2f, -vSliceRanges: array, -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vLightWidth: vec4f, -vLightHeight: vec4f, -#endif -shadowsInfo: vec4f, -depthValues: vec2f} ;var light{X} : Light{X}; -#ifdef IESLIGHTTEXTURE{X} -var iesLightTexture{X}Sampler: sampler;var iesLightTexture{X}: texture_2d; -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -uniform textureProjectionMatrix{X}: mat4x4f;var projectionLightTexture{X}Sampler: sampler;var projectionLightTexture{X}: texture_2d; -#endif -#ifdef CLUSTLIGHT{X} -var lightDataTexture{X}: texture_2d;var tileMaskBuffer{X}: array; -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform lightMatrix{X}: array;uniform viewFrustumZ{X}: array;uniform frustumLengths{X}: array;uniform cascadeBlendFactor{X}: f32;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;var vPositionFromLight{X}: array;var vDepthMetric{X} : array; -#if defined(SHADOWPCSS{X}) -var shadowTexture{X}Sampler: sampler_comparison; -var shadowTexture{X}: texture_depth_2d_array;var depthTexture{X}Sampler: sampler;var depthTexture{X}: texture_2d_array;uniform lightSizeUVCorrection{X}: array;uniform depthCorrection{X}: array;uniform penumbraDarkness{X}: f32; -#elif defined(SHADOWPCF{X}) -var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d_array; -#else -var shadowTexture{X}Sampler: sampler; -var shadowTexture{X}: texture_2d_array; -#endif -#ifdef SHADOWCSMDEBUG{X} -const vCascadeColorsMultiplier{X}: array=array -( -vec3f ( 1.5,0.0,0.0 ), -vec3f ( 0.0,1.5,0.0 ), -vec3f ( 0.0,0.0,5.5 ), -vec3f ( 1.5,0.0,5.5 ), -vec3f ( 1.5,1.5,0.0 ), -vec3f ( 1.0,1.0,1.0 ), -vec3f ( 0.0,1.0,5.5 ), -vec3f ( 0.5,3.5,0.75 ) -); -#endif -#elif defined(SHADOWCUBE{X}) -var shadowTexture{X}Sampler: sampler;var shadowTexture{X}: texture_cube; -#else -varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32; -#if defined(SHADOWPCSS{X}) -var shadowTexture{X}Sampler: sampler_comparison; -var shadowTexture{X}: texture_depth_2d;var depthTexture{X}Sampler: sampler; -var depthTexture{X}: texture_2d; -#elif defined(SHADOWPCF{X}) -var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d; -#else -var shadowTexture{X}Sampler: sampler; -var shadowTexture{X}: texture_2d; -#endif -uniform lightMatrix{X}: mat4x4f; -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=v);const a="ltcHelperFunctions",f=`fn LTCUv(N: vec3f,V: vec3f,roughness: f32)->vec2f {var LUTSIZE: f32=64.0;var LUTSCALE: f32=( LUTSIZE-1.0 )/LUTSIZE;var LUTBIAS:f32=0.5/LUTSIZE;var dotNV:f32=saturate( dot( N,V ) );var uv:vec2f=vec2f( roughness,sqrt( 1.0-dotNV ) );uv=uv*LUTSCALE+LUTBIAS;return uv;} -fn LTCClippedSphereFormFactor( f:vec3f )->f32 {var l: f32=length( f );return max( ( l*l+f.z )/( l+1.0 ),0.0 );} -fn LTCEdgeVectorFormFactor( v1:vec3f,v2:vec3f )->vec3f {var x:f32=dot( v1,v2 );var y:f32=abs( x );var a:f32=0.8543985+( 0.4965155+0.0145206*y )*y;var b:f32=3.4175940+( 4.1616724+y )*y;var v:f32=a/b;var thetaSintheta:f32=0.0;if( x>0.0 ) -{thetaSintheta=v;} -else -{thetaSintheta=0.5*inverseSqrt( max( 1.0-x*x,0.00000001 ) )-v;} -return cross( v1,v2 )*thetaSintheta;} -fn LTCEvaluate( N:vec3f,V:vec3f,P:vec3f,mInv: mat3x3,rectCoords0:vec3f,rectCoords1:vec3f,rectCoords2:vec3f,rectCoords3:vec3f )->vec3f {var v1:vec3f=rectCoords1-rectCoords0;var v2:vec3f=rectCoords3-rectCoords0;var lightNormal:vec3f=cross( v1,v2 );if( dot( lightNormal,P-rectCoords0 )<0.0 ){return vec3f( 0.0 );} -var T1:vec3f=normalize( V-N*dot( V,N ) );var T2:vec3f=- cross( N,T1 ); -var mat: mat3x3=mInv*transposeMat3( mat3x3( T1,T2,N ) );var coords0: vec3f=mat*( rectCoords0-P );var coords1: vec3f=mat*( rectCoords1-P );var coords2: vec3f=mat*( rectCoords2-P );var coords3: vec3f=mat*( rectCoords3-P );coords0=normalize( coords0 );coords1=normalize( coords1 );coords2=normalize( coords2 );coords3=normalize( coords3 );var vectorFormFactor:vec3f=vec3( 0.0 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords0,coords1 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords1,coords2 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords2,coords3 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords3,coords0 );var result:f32=LTCClippedSphereFormFactor( vectorFormFactor );return vec3f( result );} -struct areaLightData -{Diffuse: vec3f, -Specular: vec3f, -Fresnel: vec4f};fn computeAreaLightSpecularDiffuseFresnel(ltc1: texture_2d,ltc1Sampler:sampler,ltc2:texture_2d,ltc2Sampler:sampler,viewDir: vec3f,normal:vec3f,position:vec3f,lightPos:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->areaLightData {var result: areaLightData;var rectCoords0:vec3f=lightPos+halfWidth-halfHeight; -var rectCoords1:vec3f=lightPos-halfWidth-halfHeight;var rectCoords2:vec3f=lightPos-halfWidth+halfHeight;var rectCoords3:vec3f=lightPos+halfWidth+halfHeight; -#ifdef SPECULARTERM -var uv:vec2f=LTCUv( normal,viewDir,roughness );var t1:vec4f=textureSample( ltc1,ltc1Sampler,uv );var t2:vec4f=textureSample( ltc2,ltc2Sampler,uv );var mInv:mat3x3=mat3x3( -vec3f( t1.x,0,t1.y ), -vec3f( 0,1, 0 ), -vec3f( t1.z,0,t1.w ) -);result.Fresnel=t2;result.Specular=LTCEvaluate( normal,viewDir,position,mInv,rectCoords0,rectCoords1,rectCoords2,rectCoords3 ); -#endif -var mInvEmpty:mat3x3=mat3x3( -vec3f( 1,0,0 ), -vec3f( 0,1,0 ), -vec3f( 0,0,1 ) -);result.Diffuse+=LTCEvaluate( normal,viewDir,position,mInvEmpty,rectCoords0,rectCoords1,rectCoords2,rectCoords3 );return result;}`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=f);const o="clusteredLightingFunctions",c=`struct ClusteredLight {vLightData: vec4f, -vLightDiffuse: vec4f, -vLightSpecular: vec4f, -vLightDirection: vec4f, -vLightFalloff: vec4f,} -fn getClusteredLight(lightDataTexture: texture_2d,index: u32)->ClusteredLight {return ClusteredLight( -textureLoad(lightDataTexture,vec2u(0,index),0), -textureLoad(lightDataTexture,vec2u(1,index),0), -textureLoad(lightDataTexture,vec2u(2,index),0), -textureLoad(lightDataTexture,vec2u(3,index),0), -textureLoad(lightDataTexture,vec2u(4,index),0) -);} -fn getClusteredSliceIndex(sliceData: vec2f,viewDepth: f32)->i32 {return i32(log(viewDepth)*sliceData.x+sliceData.y);} -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=c);const i="shadowsFragmentFunctions",d=`#ifdef SHADOWS -#ifndef SHADOWFLOAT -fn unpack(color: vec4f)->f32 -{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);} -#endif -fn computeFallOff(value: f32,clipSpace: vec2f,frustumEdgeFalloff: f32)->f32 -{var mask: f32=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);} -fn computeShadowCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,darkness: f32,depthValues: vec2f)->f32 -{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y; -#ifndef SHADOWFLOAT -var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight)); -#else -var shadow: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x; -#endif -return select(1.0,darkness,depth>shadow);} -fn computeShadowWithPoissonSamplingCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,mapSize: f32,darkness: f32,depthValues: vec2f)->f32 -{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;var visibility: f32=1.;var poissonDisk: array;poissonDisk[0]= vec3f(-1.0,1.0,-1.0);poissonDisk[1]= vec3f(1.0,-1.0,-1.0);poissonDisk[2]= vec3f(-1.0,-1.0,-1.0);poissonDisk[3]= vec3f(1.0,-1.0,1.0); -#ifndef SHADOWFLOAT -if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize)),shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32 -{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y; -#ifndef SHADOWFLOAT -var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight)); -#else -var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x; -#endif -var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;} -fn computeShadowWithCloseESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32 -{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y; -#ifndef SHADOWFLOAT -var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight)); -#else -var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x; -#endif -var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;} -fn computeShadowCSM(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d_array,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,uv,layer)); -#else -var shadow: f32=textureSample(shadowTexture,shadowSampler,uv,layer).x; -#endif -return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );} -fn computeShadow(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -var shadow: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.)); -#else -var shadow: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x; -#endif -return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}} -fn computeShadowWithPoissonSampling(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,mapSize: f32,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);var visibility: f32=1.;var poissonDisk: array;poissonDisk[0]= vec2f(-0.94201624,-0.39906216);poissonDisk[1]= vec2f(0.94558609,-0.76890725);poissonDisk[2]= vec2f(-0.094184101,-0.92938870);poissonDisk[3]= vec2f(0.34495938,0.29387760); -#ifndef SHADOWFLOAT -if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.)),shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.)); -#else -var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x; -#endif -var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}} -fn computeShadowWithCloseESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.)); -#else -var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x; -#endif -var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}} -fn getZInClip(clipSpace: vec3f,uvDepth: vec3f)->f32 -{ -#ifdef IS_NDC_HALF_ZRANGE -return clipSpace.z; -#else -return uvDepth.z; -#endif -} -const GREATEST_LESS_THAN_ONE: f32=0.99999994; -#define DISABLE_UNIFORMITY_ANALYSIS -fn computeShadowWithCSMPCF1(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var shadow: f32=textureSampleCompare(shadowTexture,shadowSampler,uvDepth.xy,layer,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -fn computeShadowWithCSMPCF3(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -var st: vec2f=fract(uv); -var base_uv: vec2f=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -fn computeShadowWithCSMPCF5(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -var st: vec2f=fract(uv); -var base_uv: vec2f=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),layer,uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),layer,uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),layer,uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),layer,uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -fn computeShadowWithPCF1(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var shadow: f32=textureSampleCompareLevel(shadowTexture,shadowSampler,uvDepth.xy,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -fn computeShadowWithPCF3(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -var st: vec2f=fract(uv); -var base_uv: vec2f=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -fn computeShadowWithPCF5(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -var st: vec2f=fract(uv); -var base_uv: vec2f=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -const PoissonSamplers32: array=array ( -vec3f(0.06407013,0.05409927,0.), -vec3f(0.7366577,0.5789394,0.), -vec3f(-0.6270542,-0.5320278,0.), -vec3f(-0.4096107,0.8411095,0.), -vec3f(0.6849564,-0.4990818,0.), -vec3f(-0.874181,-0.04579735,0.), -vec3f(0.9989998,0.0009880066,0.), -vec3f(-0.004920578,-0.9151649,0.), -vec3f(0.1805763,0.9747483,0.), -vec3f(-0.2138451,0.2635818,0.), -vec3f(0.109845,0.3884785,0.), -vec3f(0.06876755,-0.3581074,0.), -vec3f(0.374073,-0.7661266,0.), -vec3f(0.3079132,-0.1216763,0.), -vec3f(-0.3794335,-0.8271583,0.), -vec3f(-0.203878,-0.07715034,0.), -vec3f(0.5912697,0.1469799,0.), -vec3f(-0.88069,0.3031784,0.), -vec3f(0.5040108,0.8283722,0.), -vec3f(-0.5844124,0.5494877,0.), -vec3f(0.6017799,-0.1726654,0.), -vec3f(-0.5554981,0.1559997,0.), -vec3f(-0.3016369,-0.3900928,0.), -vec3f(-0.5550632,-0.1723762,0.), -vec3f(0.925029,0.2995041,0.), -vec3f(-0.2473137,0.5538505,0.), -vec3f(0.9183037,-0.2862392,0.), -vec3f(0.2469421,0.6718712,0.), -vec3f(0.3916397,-0.4328209,0.), -vec3f(-0.03576927,-0.6220032,0.), -vec3f(-0.04661255,0.7995201,0.), -vec3f(0.4402924,0.3640312,0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.), -vec3f(0.) -);const PoissonSamplers64: array=array ( -vec3f(-0.613392,0.617481,0.), -vec3f(0.170019,-0.040254,0.), -vec3f(-0.299417,0.791925,0.), -vec3f(0.645680,0.493210,0.), -vec3f(-0.651784,0.717887,0.), -vec3f(0.421003,0.027070,0.), -vec3f(-0.817194,-0.271096,0.), -vec3f(-0.705374,-0.668203,0.), -vec3f(0.977050,-0.108615,0.), -vec3f(0.063326,0.142369,0.), -vec3f(0.203528,0.214331,0.), -vec3f(-0.667531,0.326090,0.), -vec3f(-0.098422,-0.295755,0.), -vec3f(-0.885922,0.215369,0.), -vec3f(0.566637,0.605213,0.), -vec3f(0.039766,-0.396100,0.), -vec3f(0.751946,0.453352,0.), -vec3f(0.078707,-0.715323,0.), -vec3f(-0.075838,-0.529344,0.), -vec3f(0.724479,-0.580798,0.), -vec3f(0.222999,-0.215125,0.), -vec3f(-0.467574,-0.405438,0.), -vec3f(-0.248268,-0.814753,0.), -vec3f(0.354411,-0.887570,0.), -vec3f(0.175817,0.382366,0.), -vec3f(0.487472,-0.063082,0.), -vec3f(-0.084078,0.898312,0.), -vec3f(0.488876,-0.783441,0.), -vec3f(0.470016,0.217933,0.), -vec3f(-0.696890,-0.549791,0.), -vec3f(-0.149693,0.605762,0.), -vec3f(0.034211,0.979980,0.), -vec3f(0.503098,-0.308878,0.), -vec3f(-0.016205,-0.872921,0.), -vec3f(0.385784,-0.393902,0.), -vec3f(-0.146886,-0.859249,0.), -vec3f(0.643361,0.164098,0.), -vec3f(0.634388,-0.049471,0.), -vec3f(-0.688894,0.007843,0.), -vec3f(0.464034,-0.188818,0.), -vec3f(-0.440840,0.137486,0.), -vec3f(0.364483,0.511704,0.), -vec3f(0.034028,0.325968,0.), -vec3f(0.099094,-0.308023,0.), -vec3f(0.693960,-0.366253,0.), -vec3f(0.678884,-0.204688,0.), -vec3f(0.001801,0.780328,0.), -vec3f(0.145177,-0.898984,0.), -vec3f(0.062655,-0.611866,0.), -vec3f(0.315226,-0.604297,0.), -vec3f(-0.780145,0.486251,0.), -vec3f(-0.371868,0.882138,0.), -vec3f(0.200476,0.494430,0.), -vec3f(-0.494552,-0.711051,0.), -vec3f(0.612476,0.705252,0.), -vec3f(-0.578845,-0.768792,0.), -vec3f(-0.772454,-0.090976,0.), -vec3f(0.504440,0.372295,0.), -vec3f(0.155736,0.065157,0.), -vec3f(0.391522,0.849605,0.), -vec3f(-0.620106,-0.328104,0.), -vec3f(0.789239,-0.419965,0.), -vec3f(-0.545396,0.538133,0.), -vec3f(-0.178564,-0.596057,0.) -);fn computeShadowWithCSMPCSS(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uvDepthLayer: vec4f= vec4f(uvDepth.x,uvDepth.y,f32(layer),uvDepth.z);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array)->f32 -{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} -var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32 -{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);} -fn computeShadowWithPCSS32(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32 -{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);} -fn computeShadowWithPCSS64(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32 -{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);} -fn computeShadowWithCSMPCSS16(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32 -{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);} -fn computeShadowWithCSMPCSS32(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32 -{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);} -fn computeShadowWithCSMPCSS64(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32 -{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);} -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=d); diff --git a/assets/shadowsFragmentFunctions-dMCKkVlT.js b/assets/shadowsFragmentFunctions-dMCKkVlT.js deleted file mode 100644 index 6fb239c2bc7e5238db58ab5e3cf6fe7582e071c2..0000000000000000000000000000000000000000 --- a/assets/shadowsFragmentFunctions-dMCKkVlT.js +++ /dev/null @@ -1,568 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const o="reflectionFunction",s=`vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction) -{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); } -vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction) -{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); } -vec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix) -{vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);vec3 r=normalize(reflect(cameraToVertex,worldNormal));r=vec3(reflectionMatrix*vec4(r,0));float lon=atan(r.z,r.x);float lat=acos(r.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0);} -vec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix) -{vec3 viewDir=normalize(vec3(view*worldPos));vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));vec3 r=reflect(viewDir,viewNormal);r=vec3(reflectionMatrix*vec4(r,0));r.z=r.z-1.0;float m=2.0*length(r);return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);} -vec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix) -{vec3 viewDir=worldPos.xyz-eyePosition;vec3 coords=normalize(reflect(viewDir,worldNormal));return vec3(reflectionMatrix*vec4(coords,1));} -vec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix) -{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=vec3(reflectionMatrix*vec4(coords,0)); -#ifdef INVERTCUBICMAP -coords.y*=-1.0; -#endif -return coords;} -vec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition) -{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=vec3(reflectionMatrix*vec4(coords,0)); -#ifdef INVERTCUBICMAP -coords.y*=-1.0; -#endif -return coords;} -vec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix) -{return vec3(reflectionMatrix*(view*worldPos));} -vec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix) -{return vec3(reflectionMatrix*vec4(positionW,1.));} -#ifdef REFLECTION -vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal) -{ -#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED -vec3 direction=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction); -#endif -#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED -vec3 direction=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction); -#endif -#ifdef REFLECTIONMAP_EQUIRECTANGULAR -return computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_SPHERICAL -return computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_PLANAR -return computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_CUBIC -#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC -return computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition); -#else -return computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix); -#endif -#endif -#ifdef REFLECTIONMAP_PROJECTION -return computeProjectionCoords(worldPos,view,reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_SKYBOX -return computeSkyBoxCoords(vPositionUVW,reflectionMatrix); -#endif -#ifdef REFLECTIONMAP_EXPLICIT -return vec3(0,0,0); -#endif -} -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=s);const t="lightFragmentDeclaration",c=`#ifdef LIGHT{X} -uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X}; -#ifdef SPECULARTERM -uniform vec4 vLightSpecular{X}; -#else -vec4 vLightSpecular{X}=vec4(0.); -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X}; -#if defined(SHADOWPCSS{X}) -uniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X}; -#elif defined(SHADOWPCF{X}) -uniform highp sampler2DArrayShadow shadowTexture{X}; -#else -uniform highp sampler2DArray shadowTexture{X}; -#endif -#ifdef SHADOWCSMDEBUG{X} -const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8] -( -vec3 ( 1.5,0.0,0.0 ), -vec3 ( 0.0,1.5,0.0 ), -vec3 ( 0.0,0.0,5.5 ), -vec3 ( 1.5,0.0,5.5 ), -vec3 ( 1.5,1.5,0.0 ), -vec3 ( 1.0,1.0,1.0 ), -vec3 ( 0.0,1.0,5.5 ), -vec3 ( 0.5,3.5,0.75 ) -);vec3 shadowDebug{X}; -#endif -#ifdef SHADOWCSMUSESHADOWMAXZ{X} -int index{X}=-1; -#else -int index{X}=SHADOWCSMNUM_CASCADES{X}-1; -#endif -float diff{X}=0.; -#elif defined(SHADOWCUBE{X}) -uniform samplerCube shadowTexture{X}; -#else -varying vec4 vPositionFromLight{X};varying float vDepthMetric{X}; -#if defined(SHADOWPCSS{X}) -uniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X}; -#elif defined(SHADOWPCF{X}) -uniform highp sampler2DShadow shadowTexture{X}; -#else -uniform sampler2D shadowTexture{X}; -#endif -uniform mat4 lightMatrix{X}; -#endif -uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X}; -#endif -#ifdef SPOTLIGHT{X} -uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X}; -#elif defined(POINTLIGHT{X}) -uniform vec4 vLightFalloff{X}; -#elif defined(HEMILIGHT{X}) -uniform vec3 vLightGround{X}; -#endif -#ifdef AREALIGHT{X} -uniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X}; -#endif -#ifdef IESLIGHTTEXTURE{X} -uniform sampler2D iesLightTexture{X}; -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X}; -#endif -#ifdef CLUSTLIGHT{X} -uniform vec2 vSliceData{X};uniform vec2 vSliceRanges{X}[CLUSTLIGHT_SLICES];uniform sampler2D lightDataTexture{X};uniform highp sampler2D tileMaskTexture{X}; -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=c);const i="lightUboDeclaration",l=`#ifdef LIGHT{X} -uniform Light{X} -{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular; -#ifdef SPOTLIGHT{X} -vec4 vLightDirection;vec4 vLightFalloff; -#elif defined(POINTLIGHT{X}) -vec4 vLightFalloff; -#elif defined(HEMILIGHT{X}) -vec3 vLightGround; -#elif defined(CLUSTLIGHT{X}) -vec2 vSliceData;vec2 vSliceRanges[CLUSTLIGHT_SLICES]; -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vec4 vLightWidth;vec4 vLightHeight; -#endif -vec4 shadowsInfo;vec2 depthValues;} light{X}; -#ifdef IESLIGHTTEXTURE{X} -uniform sampler2D iesLightTexture{X}; -#endif -#ifdef PROJECTEDLIGHTTEXTURE{X} -uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X}; -#endif -#ifdef CLUSTLIGHT{X} -uniform sampler2D lightDataTexture{X};uniform highp sampler2D tileMaskTexture{X}; -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X}; -#if defined(SHADOWPCSS{X}) -uniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X}; -#elif defined(SHADOWPCF{X}) -uniform highp sampler2DArrayShadow shadowTexture{X}; -#else -uniform highp sampler2DArray shadowTexture{X}; -#endif -#ifdef SHADOWCSMDEBUG{X} -const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8] -( -vec3 ( 1.5,0.0,0.0 ), -vec3 ( 0.0,1.5,0.0 ), -vec3 ( 0.0,0.0,5.5 ), -vec3 ( 1.5,0.0,5.5 ), -vec3 ( 1.5,1.5,0.0 ), -vec3 ( 1.0,1.0,1.0 ), -vec3 ( 0.0,1.0,5.5 ), -vec3 ( 0.5,3.5,0.75 ) -);vec3 shadowDebug{X}; -#endif -#ifdef SHADOWCSMUSESHADOWMAXZ{X} -int index{X}=-1; -#else -int index{X}=SHADOWCSMNUM_CASCADES{X}-1; -#endif -float diff{X}=0.; -#elif defined(SHADOWCUBE{X}) -uniform samplerCube shadowTexture{X}; -#else -varying vec4 vPositionFromLight{X};varying float vDepthMetric{X}; -#if defined(SHADOWPCSS{X}) -uniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X}; -#elif defined(SHADOWPCF{X}) -uniform highp sampler2DShadow shadowTexture{X}; -#else -uniform sampler2D shadowTexture{X}; -#endif -uniform mat4 lightMatrix{X}; -#endif -#endif -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=l);const a="ltcHelperFunctions",v=`vec2 LTCUv( const in vec3 N,const in vec3 V,const in float roughness ) {const float LUTSIZE=64.0;const float LUTSCALE=( LUTSIZE-1.0 )/LUTSIZE;const float LUTBIAS=0.5/LUTSIZE;float dotNV=saturate( dot( N,V ) );vec2 uv=vec2( roughness,sqrt( 1.0-dotNV ) );uv=uv*LUTSCALE+LUTBIAS;return uv;} -float LTCClippedSphereFormFactor( const in vec3 f ) {float l=length( f );return max( ( l*l+f.z )/( l+1.0 ),0.0 );} -vec3 LTCEdgeVectorFormFactor( 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 thetaSintheta=0.0;if( x>0.0 ) -{thetaSintheta=v;} -else -{thetaSintheta=0.5*inversesqrt( max( 1.0-x*x,1e-7 ) )-v;} -return cross( v1,v2 )*thetaSintheta;} -vec3 LTCEvaluate( 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+=LTCEdgeVectorFormFactor( coords[ 0 ],coords[ 1 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 1 ],coords[ 2 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 2 ],coords[ 3 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 3 ],coords[ 0 ] );float result=LTCClippedSphereFormFactor( vectorFormFactor );return vec3( result );} -struct areaLightData -{vec3 Diffuse;vec3 Specular;vec4 Fresnel;}; -#define inline -areaLightData computeAreaLightSpecularDiffuseFresnel(const in sampler2D ltc1,const in sampler2D ltc2,const in vec3 viewDir,const in vec3 normal,const in vec3 position,const in vec3 lightPos,const in vec3 halfWidth,const in vec3 halfHeight,const in float roughness) -{areaLightData result;vec3 rectCoords[ 4 ];rectCoords[ 0 ]=lightPos+halfWidth-halfHeight; -rectCoords[ 1 ]=lightPos-halfWidth-halfHeight;rectCoords[ 2 ]=lightPos-halfWidth+halfHeight;rectCoords[ 3 ]=lightPos+halfWidth+halfHeight; -#ifdef SPECULARTERM -vec2 uv=LTCUv( normal,viewDir,roughness );vec4 t1=texture2D( ltc1,uv );vec4 t2=texture2D( ltc2,uv );mat3 mInv=mat3( -vec3( t1.x,0,t1.y ), -vec3( 0,1, 0 ), -vec3( t1.z,0,t1.w ) -);result.Specular=LTCEvaluate( normal,viewDir,position,mInv,rectCoords );result.Fresnel=t2; -#endif -result.Diffuse=LTCEvaluate( normal,viewDir,position,mat3( 1.0 ),rectCoords );return result;}`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=v);const r="shadowsFragmentFunctions",d=`#ifdef SHADOWS -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l) -#else -#define TEXTUREFUNC(s,c,b) texture2D(s,c,b) -#endif -#ifndef SHADOWFLOAT -float unpack(vec4 color) -{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);} -#endif -float computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff) -{float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);} -#define inline -float computeShadowCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues) -{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y; -#ifndef SHADOWFLOAT -float shadow=unpack(textureCube(shadowSampler,directionToLight)); -#else -float shadow=textureCube(shadowSampler,directionToLight).x; -#endif -return depth>shadow ? darkness : 1.0;} -#define inline -float computeShadowWithPoissonSamplingCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues) -{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;float visibility=1.;vec3 poissonDisk[4];poissonDisk[0]=vec3(-1.0,1.0,-1.0);poissonDisk[1]=vec3(1.0,-1.0,-1.0);poissonDisk[2]=vec3(-1.0,-1.0,-1.0);poissonDisk[3]=vec3(1.0,-1.0,1.0); -#ifndef SHADOWFLOAT -if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;} -#endif -#define inline -float computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{float shadowPixelDepth=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -float shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.)); -#else -float shadow=TEXTUREFUNC(shadowSampler,uv,0.).x; -#endif -return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}} -#define inline -float computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{float shadowPixelDepth=clamp(depthMetric,0.,1.0);float visibility=1.;vec2 poissonDisk[4];poissonDisk[0]=vec2(-0.94201624,-0.39906216);poissonDisk[1]=vec2(0.94558609,-0.76890725);poissonDisk[2]=vec2(-0.094184101,-0.92938870);poissonDisk[3]=vec2(0.34495938,0.29387760); -#ifndef SHADOWFLOAT -if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{float shadowPixelDepth=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.)); -#else -float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x; -#endif -float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}} -#define inline -float computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0) -{return 1.0;} -else -{float shadowPixelDepth=clamp(depthMetric,0.,1.0); -#ifndef SHADOWFLOAT -float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.)); -#else -float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x; -#endif -float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}} -#ifdef IS_NDC_HALF_ZRANGE -#define ZINCLIP clipSpace.z -#else -#define ZINCLIP uvDepth.z -#endif -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -#define SMALLEST_ABOVE_ZERO 1.1754943508e-38 -#define GREATEST_LESS_THAN_ONE 0.99999994 -#define DISABLE_UNIFORMITY_ANALYSIS -#define inline -float computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5)); -#ifdef USE_REVERSE_DEPTHBUFFER -uvDepth.z=clamp(ZINCLIP,SMALLEST_ABOVE_ZERO,1.); -#else -uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE); -#endif -vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float shadow=texture2D(shadowSampler,uvDepthLayer);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -#define inline -float computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5)); -#ifdef USE_REVERSE_DEPTHBUFFER -uvDepth.z=clamp(ZINCLIP,SMALLEST_ABOVE_ZERO,1.); -#else -uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE); -#endif -vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -vec2 st=fract(uv); -vec2 base_uv=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -#define inline -float computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5)); -#ifdef USE_REVERSE_DEPTHBUFFER -uvDepth.z=clamp(ZINCLIP,SMALLEST_ABOVE_ZERO,1.); -#else -uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE); -#endif -vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -vec2 st=fract(uv); -vec2 base_uv=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);} -#define inline -float computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -#define inline -float computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -vec2 st=fract(uv); -vec2 base_uv=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -#define inline -float computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; -uv+=0.5; -vec2 st=fract(uv); -vec2 base_uv=floor(uv)-0.5; -base_uv*=shadowMapSizeAndInverse.y; -vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}} -const vec3 PoissonSamplers32[64]=vec3[64]( -vec3(0.06407013,0.05409927,0.), -vec3(0.7366577,0.5789394,0.), -vec3(-0.6270542,-0.5320278,0.), -vec3(-0.4096107,0.8411095,0.), -vec3(0.6849564,-0.4990818,0.), -vec3(-0.874181,-0.04579735,0.), -vec3(0.9989998,0.0009880066,0.), -vec3(-0.004920578,-0.9151649,0.), -vec3(0.1805763,0.9747483,0.), -vec3(-0.2138451,0.2635818,0.), -vec3(0.109845,0.3884785,0.), -vec3(0.06876755,-0.3581074,0.), -vec3(0.374073,-0.7661266,0.), -vec3(0.3079132,-0.1216763,0.), -vec3(-0.3794335,-0.8271583,0.), -vec3(-0.203878,-0.07715034,0.), -vec3(0.5912697,0.1469799,0.), -vec3(-0.88069,0.3031784,0.), -vec3(0.5040108,0.8283722,0.), -vec3(-0.5844124,0.5494877,0.), -vec3(0.6017799,-0.1726654,0.), -vec3(-0.5554981,0.1559997,0.), -vec3(-0.3016369,-0.3900928,0.), -vec3(-0.5550632,-0.1723762,0.), -vec3(0.925029,0.2995041,0.), -vec3(-0.2473137,0.5538505,0.), -vec3(0.9183037,-0.2862392,0.), -vec3(0.2469421,0.6718712,0.), -vec3(0.3916397,-0.4328209,0.), -vec3(-0.03576927,-0.6220032,0.), -vec3(-0.04661255,0.7995201,0.), -vec3(0.4402924,0.3640312,0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.), -vec3(0.) -);const vec3 PoissonSamplers64[64]=vec3[64]( -vec3(-0.613392,0.617481,0.), -vec3(0.170019,-0.040254,0.), -vec3(-0.299417,0.791925,0.), -vec3(0.645680,0.493210,0.), -vec3(-0.651784,0.717887,0.), -vec3(0.421003,0.027070,0.), -vec3(-0.817194,-0.271096,0.), -vec3(-0.705374,-0.668203,0.), -vec3(0.977050,-0.108615,0.), -vec3(0.063326,0.142369,0.), -vec3(0.203528,0.214331,0.), -vec3(-0.667531,0.326090,0.), -vec3(-0.098422,-0.295755,0.), -vec3(-0.885922,0.215369,0.), -vec3(0.566637,0.605213,0.), -vec3(0.039766,-0.396100,0.), -vec3(0.751946,0.453352,0.), -vec3(0.078707,-0.715323,0.), -vec3(-0.075838,-0.529344,0.), -vec3(0.724479,-0.580798,0.), -vec3(0.222999,-0.215125,0.), -vec3(-0.467574,-0.405438,0.), -vec3(-0.248268,-0.814753,0.), -vec3(0.354411,-0.887570,0.), -vec3(0.175817,0.382366,0.), -vec3(0.487472,-0.063082,0.), -vec3(-0.084078,0.898312,0.), -vec3(0.488876,-0.783441,0.), -vec3(0.470016,0.217933,0.), -vec3(-0.696890,-0.549791,0.), -vec3(-0.149693,0.605762,0.), -vec3(0.034211,0.979980,0.), -vec3(0.503098,-0.308878,0.), -vec3(-0.016205,-0.872921,0.), -vec3(0.385784,-0.393902,0.), -vec3(-0.146886,-0.859249,0.), -vec3(0.643361,0.164098,0.), -vec3(0.634388,-0.049471,0.), -vec3(-0.688894,0.007843,0.), -vec3(0.464034,-0.188818,0.), -vec3(-0.440840,0.137486,0.), -vec3(0.364483,0.511704,0.), -vec3(0.034028,0.325968,0.), -vec3(0.099094,-0.308023,0.), -vec3(0.693960,-0.366253,0.), -vec3(0.678884,-0.204688,0.), -vec3(0.001801,0.780328,0.), -vec3(0.145177,-0.898984,0.), -vec3(0.062655,-0.611866,0.), -vec3(0.315226,-0.604297,0.), -vec3(-0.780145,0.486251,0.), -vec3(-0.371868,0.882138,0.), -vec3(0.200476,0.494430,0.), -vec3(-0.494552,-0.711051,0.), -vec3(0.612476,0.705252,0.), -vec3(-0.578845,-0.768792,0.), -vec3(-0.772454,-0.090976,0.), -vec3(0.504440,0.372295,0.), -vec3(0.155736,0.065157,0.), -vec3(0.391522,0.849605,0.), -vec3(-0.620106,-0.328104,0.), -vec3(0.789239,-0.419965,0.), -vec3(-0.545396,0.538133,0.), -vec3(-0.178564,-0.596057,0.) -); -#define inline -float computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness) -{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5)); -#ifdef USE_REVERSE_DEPTHBUFFER -uvDepth.z=clamp(ZINCLIP,SMALLEST_ABOVE_ZERO,1.); -#else -uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE); -#endif -vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i, -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vLightWidth: vec4f, -vLightHeight: vec4f, -#endif -shadowsInfo: vec4f, -depthValues: vec2f} ;var light{X} : Light{X}; -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform lightMatrix{X}: array;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f; -#elif defined(SHADOWCUBE{X}) -#else -varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f; -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=r);const i="shadowsVertex",s=`#ifdef SHADOWS -#if defined(SHADOWCSM{X}) -vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos; -#if SHADOWCSMNUM_CASCADES{X}>0 -vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos; -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#else -vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#endif -#endif -#if SHADOWCSMNUM_CASCADES{X}>1 -vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos; -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#else -vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#endif -#endif -#if SHADOWCSMNUM_CASCADES{X}>2 -vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos; -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#else -vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#endif -#endif -#if SHADOWCSMNUM_CASCADES{X}>3 -vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos; -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#else -vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#endif -#endif -#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X}) -vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos; -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#else -vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; -#endif -#endif -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=s); diff --git a/assets/shadowsVertex-w5DW1avO.js b/assets/shadowsVertex-w5DW1avO.js deleted file mode 100644 index 15678e0e03d51c776e34c53dfd1364e7601e4d20..0000000000000000000000000000000000000000 --- a/assets/shadowsVertex-w5DW1avO.js +++ /dev/null @@ -1,71 +0,0 @@ -import{S as i}from"./index-GY9JDBGV.js";const e="lightVxFragmentDeclaration",o=`#ifdef LIGHT{X} -uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X}; -#ifdef SPECULARTERM -uniform vec4 vLightSpecular{X}; -#else -vec4 vLightSpecular{X}=vec4(0.); -#endif -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X}; -#elif defined(SHADOWCUBE{X}) -#else -varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X}; -#endif -uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X}; -#endif -#ifdef SPOTLIGHT{X} -uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X}; -#elif defined(POINTLIGHT{X}) -uniform vec4 vLightFalloff{X}; -#elif defined(HEMILIGHT{X}) -uniform vec3 vLightGround{X}; -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -uniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X}; -#endif -#endif -`;i.IncludesShadersStore[e]||(i.IncludesShadersStore[e]=o);const t="lightVxUboDeclaration",n=`#ifdef LIGHT{X} -uniform Light{X} -{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular; -#ifdef SPOTLIGHT{X} -vec4 vLightDirection;vec4 vLightFalloff; -#elif defined(POINTLIGHT{X}) -vec4 vLightFalloff; -#elif defined(HEMILIGHT{X}) -vec3 vLightGround; -#elif defined(CLUSTLIGHT{X}) -vec2 vSliceData;vec2 vSliceRanges[CLUSTLIGHT_SLICES]; -#endif -#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) -vec4 vLightWidth;vec4 vLightHeight; -#endif -vec4 shadowsInfo;vec2 depthValues;} light{X}; -#ifdef SHADOW{X} -#ifdef SHADOWCSM{X} -uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X}; -#elif defined(SHADOWCUBE{X}) -#else -varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X}; -#endif -#endif -#endif -`;i.IncludesShadersStore[t]||(i.IncludesShadersStore[t]=n);const f="shadowsVertex",d=`#ifdef SHADOWS -#if defined(SHADOWCSM{X}) -vPositionFromCamera{X}=view*worldPos;for (int i=0; i{var o=this.#r.get(r);o.delete(s),o.size===0&&(this.#r.delete(r),this.#s.unobserve(r))}}#t(){return this.#s??(this.#s=new ResizeObserver(r=>{for(var s of r){i.entries.set(s.target,s);for(var e of this.#r.get(s.target)||[])e(s)}}))}}var v=new i({box:"border-box"});function n(t,r,s){var e=v.observe(t,()=>s(t[r]));a(()=>(b(()=>s(t[r])),e))}export{n as b}; diff --git a/assets/skeleton-CQeK9qOO.js b/assets/skeleton-CQeK9qOO.js deleted file mode 100644 index 286fea197a5e9dafb3925421fb8088da447a71f2..0000000000000000000000000000000000000000 --- a/assets/skeleton-CQeK9qOO.js +++ /dev/null @@ -1 +0,0 @@ -import{B as c}from"./bone-CnpD8dWY.js";import{M as f,O as p,aq as A,ar as _,L as x,as as b,c as M,at as B,V as R}from"./index-GY9JDBGV.js";import{R as T}from"./rawTexture-BDsvmix4.js";class u{get useTextureToStoreBoneMatrices(){return this._useTextureToStoreBoneMatrices}set useTextureToStoreBoneMatrices(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}get isUsingTextureForMatrices(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones}get uniqueId(){return this._uniqueId}constructor(e,t,n){this.name=e,this.id=t,this.bones=[],this.needInitialSkinMatrix=!1,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=f.Identity(),this._currentRenderId=-1,this._ranges={},this._absoluteTransformIsDirty=!0,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._parentContainer=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new p,this.metadata=null,this.bones=[],this._scene=n||A.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;const i=this._scene.getEngine().getCaps();this._canUseTextureForBones=i.textureFloat&&i.maxVertexTextureImageUnits>0}getClassName(){return"Skeleton"}getChildren(){return this.bones.filter(e=>!e.getParent())}getTransformMatrices(e){if(this.needInitialSkinMatrix){if(!e)throw new Error("getTransformMatrices: When using the needInitialSkinMatrix flag, a mesh must be provided");return e._bonesTransformMatrices||this.prepare(!0),e._bonesTransformMatrices}return(!this._transformMatrices||this._isDirty)&&this.prepare(!this._transformMatrices),this._transformMatrices}getTransformMatrixTexture(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture}getScene(){return this._scene}toString(e){let t=`Name: ${this.name}, nBones: ${this.bones.length}`;if(t+=`, nAnimationRanges: ${this._ranges?Object.keys(this._ranges).length:"none"}`,e){t+=", Ranges: {";let n=!0;for(const i in this._ranges)n&&(t+=", ",n=!1),t+=i;t+="}"}return t}getBoneIndexByName(e){for(let t=0,n=this.bones.length;t-1&&this._meshesWithPoseMatrix.splice(t,1)}_computeTransformMatrices(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(let n=0;n0){for(const t of this.bones)if(t._linkedTransformNode){const n=t._linkedTransformNode;t.position=n.position,n.rotationQuaternion?t.rotationQuaternion=n.rotationQuaternion:t.rotation=n.rotation,t.scaling=n.scaling}}if(this.needInitialSkinMatrix)for(const t of this._meshesWithPoseMatrix){const n=t.getPoseMatrix();let i=this._isDirty;if((!t._bonesTransformMatrices||t._bonesTransformMatrices.length!==16*(this.bones.length+1))&&(t._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1)),i=!0),!!i){if(this._synchronizedWithMesh!==t){this._synchronizedWithMesh=t;for(const s of this.bones)s.getParent()||(s.getBindMatrix().multiplyToRef(n,M.Matrix[1]),s._updateAbsoluteBindMatrices(M.Matrix[1]));if(this.isUsingTextureForMatrices){const s=(this.bones.length+1)*4;(!t._transformMatrixTexture||t._transformMatrixTexture.getSize().width!==s)&&(t._transformMatrixTexture&&t._transformMatrixTexture.dispose(),t._transformMatrixTexture=T.CreateRGBATexture(t._bonesTransformMatrices,(this.bones.length+1)*4,1,this._scene,!1,!1,1,1))}}this._computeTransformMatrices(t._bonesTransformMatrices,n),this.isUsingTextureForMatrices&&t._transformMatrixTexture&&t._transformMatrixTexture.update(t._bonesTransformMatrices)}}else{if(!this._isDirty)return;(!this._transformMatrices||this._transformMatrices.length!==16*(this.bones.length+1))&&(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=T.CreateRGBATexture(this._transformMatrices,(this.bones.length+1)*4,1,this._scene,!1,!1,1,1))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices)}this._isDirty=!1}getAnimatables(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(let e=0;e-1&&this._parentContainer.skeletons.splice(e,1),this._parentContainer=null}this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)}serialize(){const e={};e.name=this.name,e.id=this.id,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix,this.metadata&&(e.metadata=this.metadata);for(let t=0;t0&&(s.animation=n.animations[0].serialize()),e.ranges=[];for(const h in this._ranges){const o=this._ranges[h];if(!o)continue;const r={};r.name=h,r.from=o.from,r.to=o.to,e.ranges.push(r)}}return e}static Parse(e,t){const n=new u(e.name,e.id,t);e.dimensionsAtRest&&(n.dimensionsAtRest=R.FromArray(e.dimensionsAtRest)),n.needInitialSkinMatrix=e.needInitialSkinMatrix,e.metadata&&(n.metadata=e.metadata);let i;for(i=0;i-1&&(o=n.bones[s.parentBoneIndex]);const r=s.rest?f.FromArray(s.rest):null,a=new c(s.name,n,o,f.FromArray(s.matrix),r,null,h);s.id!==void 0&&s.id!==null&&(a.id=s.id),s.length&&(a.length=s.length),s.metadata&&(a.metadata=s.metadata),s.animation&&a.animations.push(b.Parse(s.animation)),s.linkedTransformNodeId!==void 0&&s.linkedTransformNodeId!==null&&(n._hasWaitingData=!0,a._waitingTransformNodeId=s.linkedTransformNodeId)}if(e.ranges)for(i=0;i0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e}sortBones(){const e=[],t=new Array(this.bones.length);for(let n=0;n{const n=a()??null;t&&n==null&&l(),r.ensure(n,n&&(e=>n(e,...p)))},o)}export{m as s}; diff --git a/assets/spatialWebAudio-D-sfHE2Z.js b/assets/spatialWebAudio-D-sfHE2Z.js deleted file mode 100644 index db7a326687c771fe4529cda81262ab307d53402b..0000000000000000000000000000000000000000 --- a/assets/spatialWebAudio-D-sfHE2Z.js +++ /dev/null @@ -1 +0,0 @@ -import{a as S,_ as O,b as x}from"./webAudioBaseSubGraph-CgvRUdPi.js";import{ao as p,V as r,M as N}from"./index-GY9JDBGV.js";import{c as M,b as d,d as D}from"./audioEngine-D1fuR8_P.js";const i={coneInnerAngle:6.28318530718,coneOuterAngle:6.28318530718,coneOuterVolume:0,distanceModel:"linear",maxDistance:1e4,minDistance:1,orientation:r.Right(),panningModel:"equalpower",position:r.Zero(),rolloffFactor:1,rotation:r.Zero(),rotationQuaternion:new p};function C(e){return e.spatialEnabled||e.spatialAutoUpdate!==void 0||e.spatialConeInnerAngle!==void 0||e.spatialConeOuterAngle!==void 0||e.spatialConeOuterVolume!==void 0||e.spatialDistanceModel!==void 0||e.spatialMaxDistance!==void 0||e.spatialMinDistance!==void 0||e.spatialMinUpdateTime!==void 0||e.spatialOrientation!==void 0||e.spatialPanningModel!==void 0||e.spatialPosition!==void 0||e.spatialRolloffFactor!==void 0||e.spatialRotation!==void 0||e.spatialRotationQuaternion!==void 0}class w{}const b={pan:0};function Q(e){return e.stereoEnabled||e.stereoPan!==void 0}class y{}class F extends S{constructor(t){super("Stereo",t)}setOptions(t){this.pan=t.stereoPan??b.pan}}function f(e){return e.getSubNode("Stereo")}function R(e,t,n){e.callOnSubNode("Stereo",o=>{o[t]=n})}class U extends y{constructor(t){super(),this._pan=b.pan,this._subGraph=t}get pan(){return this._pan}set pan(t){this._pan=t,R(this._subGraph,"pan",t)}}class V extends S{constructor(t){super("Spatial",t),this._attacherComponent=null}get isAttached(){return this._attacherComponent!==null&&this._attacherComponent.isAttached}attach(t,n,o){this.detach(),this._attacherComponent||(this._attacherComponent=new M(this)),this._attacherComponent.attach(t,n,o)}detach(){this._attacherComponent?.detach()}dispose(){super.dispose(),this._attacherComponent?.dispose(),this._attacherComponent=null}setOptions(t){this.coneInnerAngle=t.spatialConeInnerAngle??i.coneInnerAngle,this.coneOuterAngle=t.spatialConeOuterAngle??i.coneOuterAngle,this.coneOuterVolume=t.spatialConeOuterVolume??i.coneOuterVolume,this.distanceModel=t.spatialDistanceModel??i.distanceModel,this.maxDistance=t.spatialMaxDistance??i.maxDistance,this.minDistance=t.spatialMinDistance??i.minDistance,this.orientation=t.spatialOrientation??i.orientation,this.panningModel=t.spatialPanningModel??i.panningModel,this.rolloffFactor=t.spatialRolloffFactor??i.rolloffFactor,t.spatialPosition&&(this.position=t.spatialPosition.clone()),t.spatialRotationQuaternion?this.rotationQuaternion=t.spatialRotationQuaternion.clone():t.spatialRotation?this.rotation=t.spatialRotation.clone():this.rotationQuaternion=i.rotationQuaternion.clone(),this.update()}update(){this.isAttached?this._attacherComponent?.update():(this._updatePosition(),this._updateRotation())}}function s(e){return e.getSubNode("Spatial")}function a(e,t,n){e.callOnSubNode("Spatial",o=>{o[t]=n})}const m=N.Zero(),_=new p;function A(e){return e*Math.PI/180}function g(e){return e*180/Math.PI}async function G(e){return new P(e)}class P extends V{constructor(t){super(t),this._lastOrientation=r.Zero(),this._lastPosition=r.Zero(),this._lastRotation=r.Zero(),this._lastRotationQuaternion=new p,this.orientation=i.orientation.clone(),this.position=i.position.clone(),this.rotation=i.rotation.clone(),this.rotationQuaternion=i.rotationQuaternion.clone(),this.node=new PannerNode(t._audioContext),this._orientationX=new d(t,this.node.orientationX),this._orientationY=new d(t,this.node.orientationY),this._orientationZ=new d(t,this.node.orientationZ),this._positionX=new d(t,this.node.positionX),this._positionY=new d(t,this.node.positionY),this._positionZ=new d(t,this.node.positionZ)}dispose(){super.dispose(),this._orientationX.dispose(),this._orientationY.dispose(),this._orientationZ.dispose(),this._positionX.dispose(),this._positionY.dispose(),this._positionZ.dispose(),this.node.disconnect()}get coneInnerAngle(){return A(this.node.coneInnerAngle)}set coneInnerAngle(t){this.node.coneInnerAngle=g(t)}get coneOuterAngle(){return A(this.node.coneOuterAngle)}set coneOuterAngle(t){this.node.coneOuterAngle=g(t)}get coneOuterVolume(){return this.node.coneOuterGain}set coneOuterVolume(t){this.node.coneOuterGain=t}get distanceModel(){return this.node.distanceModel}set distanceModel(t){this.node.distanceModel=t;const n=this.node.maxDistance;this.node.maxDistance=n+.001,this.node.maxDistance=n}get minDistance(){return this.node.refDistance}set minDistance(t){this.node.refDistance=t}get maxDistance(){return this.node.maxDistance}set maxDistance(t){this.node.maxDistance=t}get panningModel(){return this.node.panningModel}set panningModel(t){this.node.panningModel=t}get rolloffFactor(){return this.node.rolloffFactor}set rolloffFactor(t){this.node.rolloffFactor=t}get _inNode(){return this.node}get _outNode(){return this.node}_updatePosition(){this._lastPosition.equalsWithEpsilon(this.position)||(this._positionX.targetValue=this.position.x,this._positionY.targetValue=this.position.y,this._positionZ.targetValue=this.position.z,this._lastPosition.copyFrom(this.position))}_updateRotation(){let t=!1;if(!this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion))_.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion),t=!0;else if(!this._lastRotation.equalsWithEpsilon(this.rotation))p.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,_),this._lastRotation.copyFrom(this.rotation),t=!0;else if(this._lastOrientation.equalsWithEpsilon(this.orientation))return;t&&(N.FromQuaternionToRef(_,m),r.TransformNormalToRef(r.RightReadOnly,m,this.orientation)),this._orientationX.targetValue=this.orientation.x,this._orientationY.targetValue=this.orientation.y,this._orientationZ.targetValue=this.orientation.z}_connect(t){return super._connect(t)?(t._inNode&&this.node.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this.node.disconnect(t._inNode),!0):!1}getClassName(){return"_SpatialWebAudioSubNode"}}async function W(e){return new I(e)}class I extends F{constructor(t){super(t),this.node=new StereoPannerNode(t._audioContext),this._pan=new d(t,this.node.pan)}dispose(){super.dispose(),this._pan.dispose()}get pan(){return this._pan.targetValue}set pan(t){this._pan.targetValue=t}get _inNode(){return this.node}get _outNode(){return this.node}getClassName(){return"_StereoWebAudioSubNode"}_connect(t){return super._connect(t)?(t._inNode&&this.node.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this.node.disconnect(t._inNode),!0):!1}}class X extends O{constructor(){super(...arguments),this._rootNode=null,this._inputNode=null}async initAsync(t){await super.initAsync(t);let n=!1,o=!1;(n=C(t))&&await this.createAndAddSubNodeAsync("Spatial"),(o=Q(t))&&await this.createAndAddSubNodeAsync("Stereo"),await this._createSubNodePromisesResolvedAsync(),n&&s(this)?.setOptions(t),o&&f(this)?.setOptions(t)}get _inNode(){return this._inputNode}_createSubNode(t){try{return super._createSubNode(t)}catch{}switch(t){case"Spatial":return G(this._owner.engine);case"Stereo":return W(this._owner.engine);default:throw new Error(`Unknown subnode name: ${t}`)}}_onSubNodesChanged(){super._onSubNodesChanged();const t=s(this),n=f(this),o=x(this);if(t&&t.getClassName()!=="_SpatialWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(n&&n.getClassName()!=="_StereoWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(o&&o.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");t&&(t.disconnectAll(),o&&t.connect(o)),n&&(n.disconnectAll(),o&&n.connect(o)),t&&n?(this._rootNode=new GainNode(this._owner.engine._audioContext),this._rootNode.connect(t._outNode),this._rootNode.connect(n._outNode)):(this._rootNode?.disconnect(),this._rootNode=null);let l=null,c=null;if(this._rootNode?c=this._rootNode:(t?l=t:n?l=n:o&&(l=o),c=l?.node??null),this._inputNode!==c){if(this._inputNode&&this._upstreamNodes){const h=this._upstreamNodes.values();for(let u=h.next();!u.done;u=h.next())u.value._outNode?.disconnect(this._inputNode)}if(this._inputNode=c,c&&this._upstreamNodes){const h=this._upstreamNodes.values();for(let u=h.next();!u.done;u=h.next())u.value._outNode?.connect(c)}}}}class E extends w{constructor(t){super(),this._coneInnerAngle=i.coneInnerAngle,this._coneOuterAngle=i.coneOuterAngle,this._coneOuterVolume=i.coneOuterVolume,this._distanceModel=i.distanceModel,this._maxDistance=i.maxDistance,this._minDistance=i.minDistance,this._panningModel=i.panningModel,this._rolloffFactor=i.rolloffFactor;const n=s(t);n?(this._orientation=n.orientation.clone(),this._position=n.position.clone(),this._rotation=n.rotation.clone(),this._rotationQuaternion=n.rotationQuaternion.clone()):(this._orientation=i.orientation.clone(),this._position=i.position.clone(),this._rotation=i.rotation.clone(),this._rotationQuaternion=i.rotationQuaternion.clone(),t.createAndAddSubNodeAsync("Spatial")),this._subGraph=t}dispose(){this._subGraph.removeSubNodeAsync(s(this._subGraph))}get coneInnerAngle(){return this._coneInnerAngle}set coneInnerAngle(t){this._coneInnerAngle=t,a(this._subGraph,"coneInnerAngle",t)}get coneOuterAngle(){return this._coneOuterAngle}set coneOuterAngle(t){this._coneOuterAngle=t,a(this._subGraph,"coneOuterAngle",t)}get coneOuterVolume(){return this._coneOuterVolume}set coneOuterVolume(t){this._coneOuterVolume=t,a(this._subGraph,"coneOuterVolume",t)}get distanceModel(){return this._distanceModel}set distanceModel(t){this._distanceModel=t,a(this._subGraph,"distanceModel",t)}get isAttached(){return this._subGraph.getSubNode("Spatial")?.isAttached??!1}get maxDistance(){return this._maxDistance}set maxDistance(t){t<=0&&(t=1e-6),this._maxDistance=t,a(this._subGraph,"maxDistance",t)}get minDistance(){return this._minDistance}set minDistance(t){this._minDistance=t,a(this._subGraph,"minDistance",t)}get orientation(){return this._orientation}set orientation(t){this._orientation=t,this._updateRotation()}get panningModel(){return this._panningModel}set panningModel(t){this._panningModel=t,a(this._subGraph,"panningModel",t)}get position(){return this._position}set position(t){this._position=t,this._updatePosition()}get rolloffFactor(){return this._rolloffFactor}set rolloffFactor(t){this._rolloffFactor=t,a(this._subGraph,"rolloffFactor",t)}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this._updateRotation()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(t){this._rotationQuaternion=t,this._updateRotation()}attach(t,n=!1,o=3){s(this._subGraph)?.attach(t,n,o)}detach(){s(this._subGraph)?.detach()}update(){const t=s(this._subGraph);t&&(t.isAttached?t.update():(this._updatePosition(t),this._updateRotation(t)))}_updatePosition(t=null){if(!t&&(t=s(this._subGraph),!t))return;t.position.equalsWithEpsilon(this._position)||(t.position.copyFrom(this._position),t._updatePosition())}_updateRotation(t=null){!t&&(t=s(this._subGraph),!t)||(t.rotationQuaternion.equalsWithEpsilon(this._rotationQuaternion)?t.rotation.equalsWithEpsilon(this._rotation)?t.orientation.equalsWithEpsilon(this._orientation)||(t.orientation.copyFrom(this._orientation),t._updateRotation(),this._rotation.copyFrom(t.rotation),this._rotationQuaternion.copyFrom(t.rotationQuaternion)):(t.rotation.copyFrom(this._rotation),t._updateRotation(),this._orientation.copyFrom(t.orientation),this._rotationQuaternion.copyFrom(t.rotationQuaternion)):(t.rotationQuaternion.copyFrom(this._rotationQuaternion),t._updateRotation(),this._orientation.copyFrom(t.orientation),this._rotation.copyFrom(t.rotation)))}}class Y extends E{constructor(t,n,o){super(t),this._updaterComponent=new D(this,n,o)}get minUpdateTime(){return this._updaterComponent.minUpdateTime}set minUpdateTime(t){this._updaterComponent.minUpdateTime=t}dispose(){super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}}export{C as _,U as a,Y as b,X as c,i as d}; diff --git a/assets/splatFileLoader-BZRx-6v3.js b/assets/splatFileLoader-BZRx-6v3.js deleted file mode 100644 index 3ae77f064e81d1b57db9d34ffc1b4f27ce2cd585..0000000000000000000000000000000000000000 --- a/assets/splatFileLoader-BZRx-6v3.js +++ /dev/null @@ -1,446 +0,0 @@ -import{aq as be,bb as pt,h as Pt,bY as Nt,S as N,a9 as Wt,x as Vt,y as Zt,z as jt,K as Xt,X as Gt,Y as $t,b1 as _t,a2 as qt,a4 as Kt,a6 as Jt,e as mt,ac as Qt,J as q,R as Lt,bZ as Yt,b_ as es,l as Ie,V as T,m as Ne,M as Ce,b$ as ts,c as J,L as de,c0 as He,c1 as ke,c2 as ss,aO as $,c3 as rs,ah as ne,b9 as L,ao as ns,C as Se,ai as he,bA as re,B as os,c4 as Re,d as as,ax as is}from"./index-GY9JDBGV.js";import{af as ye}from"./index-DydPgVMC.js";import{ShaderMaterial as xt}from"./shaderMaterial-BaU8T3Xh.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./logDepthDeclaration-mFbnDVOm.js";import"./fogFragment-M_o52SDz.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./meshUboDeclaration-D9O4n0us.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./logDepthVertex-zXeqwUWs.js";import"./helperFunctions-tBt4f_K3.js";import"./clipPlaneFragment-BmMK1U8A.js";import"./logDepthDeclaration-CACrmPgQ.js";import"./fogFragment-DjadYfQv.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./meshUboDeclaration-BeSl_gjF.js";import"./helperFunctions-Wgh3PIP0.js";import"./clipPlaneVertex-D5g8dBQb.js";import"./logDepthVertex-CfHieHf5.js";import{R as we}from"./rawTexture-BDsvmix4.js";import"./thinInstanceMesh-B_Va_jLC.js";import{A as cs}from"./assetContainer-X8dc1NDD.js";import{Ray as ls}from"./ray-D2Rlocdw.js";import{S as hs}from"./standardMaterial-Dw51Jj3C.js";class fs{constructor(){this.mm=new Map}get(e,t){const s=this.mm.get(e);if(s!==void 0)return s.get(t)}set(e,t,s){let o=this.mm.get(e);o===void 0&&this.mm.set(e,o=new Map),o.set(t,s)}}class us{get standalone(){return this._options?.standalone??!1}get baseMaterial(){return this._baseMaterial}get doNotInjectCode(){return this._options?.doNotInjectCode??!1}constructor(e,t,s){this._baseMaterial=e,this._scene=t??be.LastCreatedScene,this._options=s,this._subMeshToEffect=new Map,this._subMeshToDepthWrapper=new fs,this._meshes=new Map,this._onEffectCreatedObserver=this._baseMaterial.onEffectCreatedObservable.add(o=>{const n=o.subMesh?.getMesh();n&&!this._meshes.has(n)&&this._meshes.set(n,n.onDisposeObservable.add(a=>{const l=this._subMeshToEffect.keys();for(let h=l.next();h.done!==!0;h=l.next()){const i=h.value;i?.getMesh()===a&&(this._subMeshToEffect.delete(i),this._deleteDepthWrapperEffect(i))}})),this._subMeshToEffect.get(o.subMesh)?.[0]!==o.effect&&(this._subMeshToEffect.set(o.subMesh,[o.effect,this._scene.getEngine().currentRenderPassId]),this._deleteDepthWrapperEffect(o.subMesh))})}_deleteDepthWrapperEffect(e){const t=this._subMeshToDepthWrapper.mm.get(e);t&&(t.forEach(s=>{s.mainDrawWrapper.effect?.dispose()}),this._subMeshToDepthWrapper.mm.delete(e))}getEffect(e,t,s){const o=this._subMeshToDepthWrapper.mm.get(e)?.get(t);if(!o)return null;let n=o.drawWrapper[s];return n||(n=o.drawWrapper[s]=new pt(this._scene.getEngine()),n.setEffect(o.mainDrawWrapper.effect,o.mainDrawWrapper.defines)),n}isReadyForSubMesh(e,t,s,o,n){return this.standalone&&!this._baseMaterial.isReadyForSubMesh(e.getMesh(),e,o)?!1:this._makeEffect(e,t,s,n)?.isReady()??!1}dispose(){this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver),this._onEffectCreatedObserver=null;const e=this._meshes.entries();for(let t=e.next();t.done!==!0;t=e.next()){const[s,o]=t.value;s.onDisposeObservable.remove(o)}}_makeEffect(e,t,s,o){const n=this._scene.getEngine(),a=this._subMeshToEffect.get(e);if(!a)return null;const[l,h]=a;if(!l.isReady())return null;let i=this._subMeshToDepthWrapper.get(e,s);if(!i){const m=new pt(n);m.defines=e._getDrawWrapper(h)?.defines??null,i={drawWrapper:[],mainDrawWrapper:m,depthDefines:"",token:Pt()},i.drawWrapper[o]=m,this._subMeshToDepthWrapper.set(e,s,i)}const _=t.join(` -`);if(i.mainDrawWrapper.effect&&_===i.depthDefines)return i.mainDrawWrapper.effect;i.depthDefines=_;const u=l.getUniformNames().slice();let f=l.vertexSourceCodeBeforeMigration,p=l.fragmentSourceCodeBeforeMigration;if(!f&&!p)return null;if(!this.doNotInjectCode){const m=this._options&&this._options.remappedVariables?`#include(${this._options.remappedVariables.join(",")})`:"#include",C=this._options&&this._options.remappedVariables?`#include(${this._options.remappedVariables.join(",")})`:"#include",E=this._options&&this._options.remappedVariables?`#include(${this._options.remappedVariables.join(",")})`:"#include",c="#include",g="#include";l.shaderLanguage===0?f=f.replace(/void\s+?main/g,` -${g} -void main`):f=f.replace(/@vertex/g,` -${g} -@vertex`),f=f.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g,m),f.indexOf("#define SHADOWDEPTH_METRIC")!==-1?f=f.replace(/#define SHADOWDEPTH_METRIC/g,C):f=f.replace(/}\s*$/g,C+` -}`),f=f.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");const S=p.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW")>=0||p.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG")>=0,w=p.indexOf("#define SHADOWDEPTH_FRAGMENT")!==-1;let x="";S?p=p.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g,E):x=E+` -`,p=p.replace(/void\s+?main/g,Nt.IncludesShadersStore.shadowMapFragmentExtraDeclaration+` -void main`),w?p=p.replace(/#define SHADOWDEPTH_FRAGMENT/g,c):x+=c+` -`,x&&(p=p.replace(/}\s*$/g,x+"}")),u.push("biasAndScaleSM","depthValuesSM","lightDataSM","softTransparentShadowSM")}i.mainDrawWrapper.effect=n.createEffect({vertexSource:f,fragmentSource:p,vertexToken:i.token,fragmentToken:i.token},{attributes:l.getAttributesNames(),uniformsNames:u,uniformBuffersNames:l.getUniformBuffersNames(),samplers:l.getSamplers(),defines:_+` -`+l.defines.replace("#define SHADOWS","").replace(/#define SHADOW\d/g,""),indexParameters:l.getIndexParameters(),shaderLanguage:l.shaderLanguage},n);for(let m=0;m -vec3 color=inColor.rgb; -#ifdef FOG -#include -#endif -return vec4(color,B);} -`;N.IncludesShadersStore[vt]||(N.IncludesShadersStore[vt]=ds);const Fe="gaussianSplattingPixelShader",Ot=`#include -#include -#include -varying vec4 vColor;varying vec2 vPosition; -#include -void main () { -#include -gl_FragColor=gaussianColor(vColor);} -`;N.ShadersStore[Fe]||(N.ShadersStore[Fe]=Ot);const ps={name:Fe,shader:Ot},_s=Object.freeze(Object.defineProperty({__proto__:null,gaussianSplattingPixelShader:ps},Symbol.toStringTag,{value:"Module"})),gt="gaussianSplattingVertexDeclaration",ms="attribute vec3 position;attribute vec4 splatIndex0;attribute vec4 splatIndex1;attribute vec4 splatIndex2;attribute vec4 splatIndex3;uniform mat4 view;uniform mat4 projection;uniform mat4 world;uniform vec4 vEyePosition;";N.IncludesShadersStore[gt]||(N.IncludesShadersStore[gt]=ms);const St="gaussianSplattingUboDeclaration",xs=`#include -#include -attribute vec3 position;attribute vec4 splatIndex0;attribute vec4 splatIndex1;attribute vec4 splatIndex2;attribute vec4 splatIndex3; -`;N.IncludesShadersStore[St]||(N.IncludesShadersStore[St]=xs);const yt="gaussianSplatting",vs=`#if !defined(WEBGL2) && !defined(WEBGPU) && !defined(NATIVE) -mat3 transpose(mat3 matrix) {return mat3(matrix[0][0],matrix[1][0],matrix[2][0], -matrix[0][1],matrix[1][1],matrix[2][1], -matrix[0][2],matrix[1][2],matrix[2][2]);} -#endif -vec2 getDataUV(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return vec2((x+0.5)/textureSize.x,(y+0.5)/textureSize.y);} -#if SH_DEGREE>0 -ivec2 getDataUVint(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return ivec2(uint(x+0.5),uint(y+0.5));} -#endif -struct Splat {vec4 center;vec4 color;vec4 covA;vec4 covB; -#if SH_DEGREE>0 -uvec4 sh0; -#endif -#if SH_DEGREE>1 -uvec4 sh1; -#endif -#if SH_DEGREE>2 -uvec4 sh2; -#endif -};float getSplatIndex(int localIndex) -{float splatIndex;switch (localIndex) -{case 0: splatIndex=splatIndex0.x; break;case 1: splatIndex=splatIndex0.y; break;case 2: splatIndex=splatIndex0.z; break;case 3: splatIndex=splatIndex0.w; break;case 4: splatIndex=splatIndex1.x; break;case 5: splatIndex=splatIndex1.y; break;case 6: splatIndex=splatIndex1.z; break;case 7: splatIndex=splatIndex1.w; break;case 8: splatIndex=splatIndex2.x; break;case 9: splatIndex=splatIndex2.y; break;case 10: splatIndex=splatIndex2.z; break;case 11: splatIndex=splatIndex2.w; break;case 12: splatIndex=splatIndex3.x; break;case 13: splatIndex=splatIndex3.y; break;case 14: splatIndex=splatIndex3.z; break;case 15: splatIndex=splatIndex3.w; break;} -return splatIndex;} -Splat readSplat(float splatIndex) -{Splat splat;vec2 splatUV=getDataUV(splatIndex,dataTextureSize);splat.center=texture2D(centersTexture,splatUV);splat.color=texture2D(colorsTexture,splatUV);splat.covA=texture2D(covariancesATexture,splatUV)*splat.center.w;splat.covB=texture2D(covariancesBTexture,splatUV)*splat.center.w; -#if SH_DEGREE>0 -ivec2 splatUVint=getDataUVint(splatIndex,dataTextureSize);splat.sh0=texelFetch(shTexture0,splatUVint,0); -#endif -#if SH_DEGREE>1 -splat.sh1=texelFetch(shTexture1,splatUVint,0); -#endif -#if SH_DEGREE>2 -splat.sh2=texelFetch(shTexture2,splatUVint,0); -#endif -return splat;} -#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) -vec3 computeColorFromSHDegree(vec3 dir,const vec3 sh[16]) -{const float SH_C0=0.28209479;const float SH_C1=0.48860251;float SH_C2[5];SH_C2[0]=1.092548430;SH_C2[1]=-1.09254843;SH_C2[2]=0.315391565;SH_C2[3]=-1.09254843;SH_C2[4]=0.546274215;float SH_C3[7];SH_C3[0]=-0.59004358;SH_C3[1]=2.890611442;SH_C3[2]=-0.45704579;SH_C3[3]=0.373176332;SH_C3[4]=-0.45704579;SH_C3[5]=1.445305721;SH_C3[6]=-0.59004358;vec3 result=/*SH_C0**/sh[0]; -#if SH_DEGREE>0 -float x=dir.x;float y=dir.y;float z=dir.z;result+=- SH_C1*y*sh[1]+SH_C1*z*sh[2]-SH_C1*x*sh[3]; -#if SH_DEGREE>1 -float xx=x*x,yy=y*y,zz=z*z;float xy=x*y,yz=y*z,xz=x*z;result+= -SH_C2[0]*xy*sh[4] + -SH_C2[1]*yz*sh[5] + -SH_C2[2]*(2.0*zz-xx-yy)*sh[6] + -SH_C2[3]*xz*sh[7] + -SH_C2[4]*(xx-yy)*sh[8]; -#if SH_DEGREE>2 -result+= -SH_C3[0]*y*(3.0*xx-yy)*sh[9] + -SH_C3[1]*xy*z*sh[10] + -SH_C3[2]*y*(4.0*zz-xx-yy)*sh[11] + -SH_C3[3]*z*(2.0*zz-3.0*xx-3.0*yy)*sh[12] + -SH_C3[4]*x*(4.0*zz-xx-yy)*sh[13] + -SH_C3[5]*z*(xx-yy)*sh[14] + -SH_C3[6]*x*(xx-3.0*yy)*sh[15]; -#endif -#endif -#endif -return result;} -vec4 decompose(uint value) -{vec4 components=vec4( -float((value ) & 255u), -float((value>>uint( 8)) & 255u), -float((value>>uint(16)) & 255u), -float((value>>uint(24)) & 255u));return components*vec4(2./255.)-vec4(1.);} -vec3 computeSH(Splat splat,vec3 dir) -{vec3 sh[16];sh[0]=vec3(0.,0.,0.); -#if SH_DEGREE>0 -vec4 sh00=decompose(splat.sh0.x);vec4 sh01=decompose(splat.sh0.y);vec4 sh02=decompose(splat.sh0.z);sh[1]=vec3(sh00.x,sh00.y,sh00.z);sh[2]=vec3(sh00.w,sh01.x,sh01.y);sh[3]=vec3(sh01.z,sh01.w,sh02.x); -#endif -#if SH_DEGREE>1 -vec4 sh03=decompose(splat.sh0.w);vec4 sh04=decompose(splat.sh1.x);vec4 sh05=decompose(splat.sh1.y);sh[4]=vec3(sh02.y,sh02.z,sh02.w);sh[5]=vec3(sh03.x,sh03.y,sh03.z);sh[6]=vec3(sh03.w,sh04.x,sh04.y);sh[7]=vec3(sh04.z,sh04.w,sh05.x);sh[8]=vec3(sh05.y,sh05.z,sh05.w); -#endif -#if SH_DEGREE>2 -vec4 sh06=decompose(splat.sh1.z);vec4 sh07=decompose(splat.sh1.w);vec4 sh08=decompose(splat.sh2.x);vec4 sh09=decompose(splat.sh2.y);vec4 sh10=decompose(splat.sh2.z);vec4 sh11=decompose(splat.sh2.w);sh[9]=vec3(sh06.x,sh06.y,sh06.z);sh[10]=vec3(sh06.w,sh07.x,sh07.y);sh[11]=vec3(sh07.z,sh07.w,sh08.x);sh[12]=vec3(sh08.y,sh08.z,sh08.w);sh[13]=vec3(sh09.x,sh09.y,sh09.z);sh[14]=vec3(sh09.w,sh10.x,sh10.y);sh[15]=vec3(sh10.z,sh10.w,sh11.x); -#endif -return computeColorFromSHDegree(dir,sh);} -#else -vec3 computeSH(Splat splat,vec3 dir) -{return vec3(0.,0.,0.);} -#endif -vec4 gaussianSplatting(vec2 meshPos,vec3 worldPos,vec2 scale,vec3 covA,vec3 covB,mat4 worldMatrix,mat4 viewMatrix,mat4 projectionMatrix) -{mat4 modelView=viewMatrix*worldMatrix;vec4 camspace=viewMatrix*vec4(worldPos,1.);vec4 pos2d=projectionMatrix*camspace;float bounds=1.2*pos2d.w;if (pos2d.z<-pos2d.w || pos2d.x<-bounds || pos2d.x>bounds -|| pos2d.y<-bounds || pos2d.y>bounds) {return vec4(0.0,0.0,2.0,1.0);} -mat3 Vrk=mat3( -covA.x,covA.y,covA.z, -covA.y,covB.x,covB.y, -covA.z,covB.y,covB.z -);bool isOrtho=abs(projectionMatrix[3][3]-1.0)<0.001;mat3 J;if (isOrtho) {J=mat3( -focal.x,0.,0., -0.,focal.y,0., -0.,0.,0. -);} else {J=mat3( -focal.x/camspace.z,0.,-(focal.x*camspace.x)/(camspace.z*camspace.z), -0.,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z), -0.,0.,0. -);} -mat3 T=transpose(mat3(modelView))*J;mat3 cov2d=transpose(T)*Vrk*T; -#if COMPENSATION -float c00=cov2d[0][0];float c11=cov2d[1][1];float c01=cov2d[0][1];float detOrig=c00*c11-c01*c01; -#endif -cov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize; -#if COMPENSATION -vec3 c2d=vec3(cov2d[0][0],c01,cov2d[1][1]);float detBlur=c2d.x*c2d.z-c2d.y*c2d.y;float compensation=sqrt(max(0.,detOrig/detBlur));vColor.w*=compensation; -#endif -float mid=(cov2d[0][0]+cov2d[1][1])/2.0;float radius=length(vec2((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));float epsilon=0.0001;float lambda1=mid+radius+epsilon,lambda2=mid-radius+epsilon;if (lambda2<0.0) -{return vec4(0.0,0.0,2.0,1.0);} -vec2 diagonalVector=normalize(vec2(cov2d[0][1],lambda1-cov2d[0][0]));vec2 majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;vec2 minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2(diagonalVector.y,-diagonalVector.x);vec2 vCenter=vec2(pos2d);float scaleFactor=isOrtho ? 1.0 : pos2d.w;return vec4( -vCenter -+ ((meshPos.x*majorAxis -+ meshPos.y*minorAxis)*invViewport*scaleFactor)*scale,pos2d.zw);}`;N.IncludesShadersStore[yt]||(N.IncludesShadersStore[yt]=vs);const Be="gaussianSplattingVertexShader",Ft=`#include<__decl__gaussianSplattingVertex> -#ifdef LOGARITHMICDEPTH -#extension GL_EXT_frag_depth : enable -#endif -#include -#include -#include -#include -uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform vec3 eyePosition;uniform float alpha;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture; -#if SH_DEGREE>0 -uniform highp usampler2D shTexture0; -#endif -#if SH_DEGREE>1 -uniform highp usampler2D shTexture1; -#endif -#if SH_DEGREE>2 -uniform highp usampler2D shTexture2; -#endif -varying vec4 vColor;varying vec2 vPosition; -#include -void main () {float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position.xy; -#if SH_DEGREE>0 -mat3 worldRot=mat3(world);mat3 normWorldRot=inverseMat3(worldRot);vec3 eyeToSplatLocalSpace=normalize(normWorldRot*(worldPos.xyz-eyePosition));vColor.xyz=splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace); -#endif -vColor.w*=alpha;gl_Position=gaussianSplatting(position.xy,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection); -#include -#include -#include -} -`;N.ShadersStore[Be]||(N.ShadersStore[Be]=Ft);const gs={name:Be,shader:Ft},Ss=Object.freeze(Object.defineProperty({__proto__:null,gaussianSplattingVertexShader:gs},Symbol.toStringTag,{value:"Module"})),wt="gaussianSplattingFragmentDeclaration",ys=`fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f -{var A : f32=-dot(inPosition,inPosition);if (A>-4.0) -{var B: f32=exp(A)*inColor.a; -#include -var color: vec3f=inColor.rgb; -#ifdef FOG -#include -#endif -return vec4f(color,B);} else {return vec4f(0.0);}} -`;N.IncludesShadersStoreWGSL[wt]||(N.IncludesShadersStoreWGSL[wt]=ys);const Ue="gaussianSplattingPixelShader",Bt=`#include -#include -#include -varying vColor: vec4f;varying vPosition: vec2f; -#include -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#include -fragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);} -`;N.ShadersStoreWGSL[Ue]||(N.ShadersStoreWGSL[Ue]=Bt);const ws={name:Ue,shader:Bt},Cs=Object.freeze(Object.defineProperty({__proto__:null,gaussianSplattingPixelShaderWGSL:ws},Symbol.toStringTag,{value:"Module"})),Ct="gaussianSplatting",bs=`fn getDataUV(index: f32,dataTextureSize: vec2f)->vec2 {let y: f32=floor(index/dataTextureSize.x);let x: f32=index-y*dataTextureSize.x;return vec2f((x+0.5),(y+0.5));} -struct Splat {center: vec4f, -color: vec4f, -covA: vec4f, -covB: vec4f, -#if SH_DEGREE>0 -sh0: vec4, -#endif -#if SH_DEGREE>1 -sh1: vec4, -#endif -#if SH_DEGREE>2 -sh2: vec4, -#endif -};fn getSplatIndex(localIndex: i32,splatIndex0: vec4f,splatIndex1: vec4f,splatIndex2: vec4f,splatIndex3: vec4f)->f32 {var splatIndex: f32;switch (localIndex) -{case 0: -{splatIndex=splatIndex0.x;break;} -case 1: -{splatIndex=splatIndex0.y;break;} -case 2: -{splatIndex=splatIndex0.z;break;} -case 3: -{splatIndex=splatIndex0.w;break;} -case 4: -{splatIndex=splatIndex1.x;break;} -case 5: -{splatIndex=splatIndex1.y;break;} -case 6: -{splatIndex=splatIndex1.z;break;} -case 7: -{splatIndex=splatIndex1.w;break;} -case 8: -{splatIndex=splatIndex2.x;break;} -case 9: -{splatIndex=splatIndex2.y;break;} -case 10: -{splatIndex=splatIndex2.z;break;} -case 11: -{splatIndex=splatIndex2.w;break;} -case 12: -{splatIndex=splatIndex3.x;break;} -case 13: -{splatIndex=splatIndex3.y;break;} -case 14: -{splatIndex=splatIndex3.z;break;} -default: -{splatIndex=splatIndex3.w;break;}} -return splatIndex;} -fn readSplat(splatIndex: f32,dataTextureSize: vec2f)->Splat {var splat: Splat;let splatUV=getDataUV(splatIndex,dataTextureSize);let splatUVi32=vec2(i32(splatUV.x),i32(splatUV.y));splat.center=textureLoad(centersTexture,splatUVi32,0);splat.color=textureLoad(colorsTexture,splatUVi32,0);splat.covA=textureLoad(covariancesATexture,splatUVi32,0)*splat.center.w;splat.covB=textureLoad(covariancesBTexture,splatUVi32,0)*splat.center.w; -#if SH_DEGREE>0 -splat.sh0=textureLoad(shTexture0,splatUVi32,0); -#endif -#if SH_DEGREE>1 -splat.sh1=textureLoad(shTexture1,splatUVi32,0); -#endif -#if SH_DEGREE>2 -splat.sh2=textureLoad(shTexture2,splatUVi32,0); -#endif -return splat;} -fn computeColorFromSHDegree(dir: vec3f,sh: array,16>)->vec3f -{let SH_C0: f32=0.28209479;let SH_C1: f32=0.48860251;var SH_C2: array=array( -1.092548430, --1.09254843, -0.315391565, --1.09254843, -0.546274215 -);var SH_C3: array=array( --0.59004358, -2.890611442, --0.45704579, -0.373176332, --0.45704579, -1.445305721, --0.59004358 -);var result: vec3f=/*SH_C0**/sh[0]; -#if SH_DEGREE>0 -let x: f32=dir.x;let y: f32=dir.y;let z: f32=dir.z;result+=-SH_C1*y*sh[1]+SH_C1*z*sh[2]-SH_C1*x*sh[3]; -#if SH_DEGREE>1 -let xx: f32=x*x;let yy: f32=y*y;let zz: f32=z*z;let xy: f32=x*y;let yz: f32=y*z;let xz: f32=x*z;result+= -SH_C2[0]*xy*sh[4] + -SH_C2[1]*yz*sh[5] + -SH_C2[2]*(2.0f*zz-xx-yy)*sh[6] + -SH_C2[3]*xz*sh[7] + -SH_C2[4]*(xx-yy)*sh[8]; -#if SH_DEGREE>2 -result+= -SH_C3[0]*y*(3.0f*xx-yy)*sh[9] + -SH_C3[1]*xy*z*sh[10] + -SH_C3[2]*y*(4.0f*zz-xx-yy)*sh[11] + -SH_C3[3]*z*(2.0f*zz-3.0f*xx-3.0f*yy)*sh[12] + -SH_C3[4]*x*(4.0f*zz-xx-yy)*sh[13] + -SH_C3[5]*z*(xx-yy)*sh[14] + -SH_C3[6]*x*(xx-3.0f*yy)*sh[15]; -#endif -#endif -#endif -return result;} -fn decompose(value: u32)->vec4f -{let components : vec4f=vec4f( -f32((value ) & 255u), -f32((value>>u32( 8)) & 255u), -f32((value>>u32(16)) & 255u), -f32((value>>u32(24)) & 255u));return components*vec4f(2./255.)-vec4f(1.);} -fn computeSH(splat: Splat,dir: vec3f)->vec3f -{var sh: array,16>;sh[0]=vec3f(0.,0.,0.); -#if SH_DEGREE>0 -let sh00: vec4f=decompose(splat.sh0.x);let sh01: vec4f=decompose(splat.sh0.y);let sh02: vec4f=decompose(splat.sh0.z);sh[1]=vec3f(sh00.x,sh00.y,sh00.z);sh[2]=vec3f(sh00.w,sh01.x,sh01.y);sh[3]=vec3f(sh01.z,sh01.w,sh02.x); -#endif -#if SH_DEGREE>1 -let sh03: vec4f=decompose(splat.sh0.w);let sh04: vec4f=decompose(splat.sh1.x);let sh05: vec4f=decompose(splat.sh1.y);sh[4]=vec3f(sh02.y,sh02.z,sh02.w);sh[5]=vec3f(sh03.x,sh03.y,sh03.z);sh[6]=vec3f(sh03.w,sh04.x,sh04.y);sh[7]=vec3f(sh04.z,sh04.w,sh05.x);sh[8]=vec3f(sh05.y,sh05.z,sh05.w); -#endif -#if SH_DEGREE>2 -let sh06: vec4f=decompose(splat.sh1.z);let sh07: vec4f=decompose(splat.sh1.w);let sh08: vec4f=decompose(splat.sh2.x);let sh09: vec4f=decompose(splat.sh2.y);let sh10: vec4f=decompose(splat.sh2.z);let sh11: vec4f=decompose(splat.sh2.w);sh[9]=vec3f(sh06.x,sh06.y,sh06.z);sh[10]=vec3f(sh06.w,sh07.x,sh07.y);sh[11]=vec3f(sh07.z,sh07.w,sh08.x);sh[12]=vec3f(sh08.y,sh08.z,sh08.w);sh[13]=vec3f(sh09.x,sh09.y,sh09.z);sh[14]=vec3f(sh09.w,sh10.x,sh10.y);sh[15]=vec3f(sh10.z,sh10.w,sh11.x); -#endif -return computeColorFromSHDegree(dir,sh);} -fn gaussianSplatting( -meshPos: vec2, -worldPos: vec3, -scale: vec2, -covA: vec3, -covB: vec3, -worldMatrix: mat4x4, -viewMatrix: mat4x4, -projectionMatrix: mat4x4, -focal: vec2f, -invViewport: vec2f, -kernelSize: f32 -)->vec4f {let modelView=viewMatrix*worldMatrix;let camspace=viewMatrix*vec4f(worldPos,1.0);let pos2d=projectionMatrix*camspace;let bounds=1.2*pos2d.w;if (pos2d.z<0. || pos2d.x<-bounds || pos2d.x>bounds || pos2d.y<-bounds || pos2d.y>bounds) {return vec4f(0.0,0.0,2.0,1.0);} -let Vrk=mat3x3( -covA.x,covA.y,covA.z, -covA.y,covB.x,covB.y, -covA.z,covB.y,covB.z -);let isOrtho=abs(projectionMatrix[3][3]-1.0)<0.001;var J: mat3x3;if (isOrtho) {J=mat3x3( -focal.x,0.0,0.0, -0.0,focal.y,0.0, -0.0,0.0,0.0 -);} else {J=mat3x3( -focal.x/camspace.z,0.0,-(focal.x*camspace.x)/(camspace.z*camspace.z), -0.0,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z), -0.0,0.0,0.0 -);} -let T=transpose(mat3x3( -modelView[0].xyz, -modelView[1].xyz, -modelView[2].xyz))*J;var cov2d=transpose(T)*Vrk*T; -#if COMPENSATION -let c00: f32=cov2d[0][0];let c11: f32=cov2d[1][1];let c01: f32=cov2d[0][1];let detOrig: f32=c00*c11-c01*c01; -#endif -cov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize; -#if COMPENSATION -let c2d: vec3f=vec3f(cov2d[0][0],c01,cov2d[1][1]);let detBlur: f32=c2d.x*c2d.z-c2d.y*c2d.y;let compensation: f32=sqrt(max(0.,detOrig/detBlur));vertexOutputs.vColor.w*=compensation; -#endif -let mid=(cov2d[0][0]+cov2d[1][1])/2.0;let radius=length(vec2((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));let lambda1=mid+radius;let lambda2=mid-radius;if (lambda2<0.0) {return vec4f(0.0,0.0,2.0,1.0);} -let diagonalVector=normalize(vec2(cov2d[0][1],lambda1-cov2d[0][0]));let majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;let minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2(diagonalVector.y,-diagonalVector.x);let vCenter=vec2(pos2d.x,pos2d.y);let scaleFactor=select(pos2d.w,1.0,isOrtho);return vec4f( -vCenter+((meshPos.x*majorAxis+meshPos.y*minorAxis)*invViewport*scaleFactor)*scale, -pos2d.z, -pos2d.w -);}`;N.IncludesShadersStoreWGSL[Ct]||(N.IncludesShadersStoreWGSL[Ct]=bs);const Pe="gaussianSplattingVertexShader",Ut=`#include -#include -#include -#include -#include -#include -attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;var covariancesATexture: texture_2d;var covariancesBTexture: texture_2d;var centersTexture: texture_2d;var colorsTexture: texture_2d; -#if SH_DEGREE>0 -var shTexture0: texture_2d; -#endif -#if SH_DEGREE>1 -var shTexture1: texture_2d; -#endif -#if SH_DEGREE>2 -var shTexture2: texture_2d; -#endif -varying vColor: vec4f;varying vPosition: vec2f; -#include -@vertex -fn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy; -#if SH_DEGREE>0 -let worldRot: mat3x3f= mat3x3f(mesh.world[0].xyz,mesh.world[1].xyz,mesh.world[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha); -#else -vertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha); -#endif -vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize); -#include -#include -#include -} -`;N.ShadersStoreWGSL[Pe]||(N.ShadersStoreWGSL[Pe]=Ut);const Is={name:Pe,shader:Ut},Es=Object.freeze(Object.defineProperty({__proto__:null,gaussianSplattingVertexShaderWGSL:Is},Symbol.toStringTag,{value:"Module"})),bt="gaussianSplattingDepthPixelShader",Ts=`precision highp float;varying vec2 vPosition;varying vec4 vColor; -#ifdef DEPTH_RENDER -varying float vDepthMetric; -#endif -void main(void) {float A=-dot(vPosition,vPosition); -#if defined(SM_SOFTTRANSPARENTSHADOW) && SM_SOFTTRANSPARENTSHADOW==1 -float alpha=exp(A)*vColor.a;if (A<-4.) discard; -#else -if (A<-vColor.a) discard; -#endif -#ifdef DEPTH_RENDER -gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0); -#endif -}`;N.ShadersStore[bt]||(N.ShadersStore[bt]=Ts);const It="gaussianSplattingDepthVertexShader",As=`#include<__decl__gaussianSplattingVertex> -uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform float alpha;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;varying vec2 vPosition;varying vec4 vColor; -#include -#ifdef DEPTH_RENDER -uniform vec2 depthValues;varying float vDepthMetric; -#endif -void main(void) {float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPosGS=world*vec4(splat.center.xyz,1.0);vPosition=position.xy;vColor=splat.color;vColor.w*=alpha;gl_Position=gaussianSplatting(position.xy,worldPosGS.xyz,vec2(1.,1.),covA,covB,world,view,projection); -#ifdef DEPTH_RENDER -#ifdef USE_REVERSE_DEPTHBUFFER -vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y)); -#else -vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y)); -#endif -#endif -}`;N.ShadersStore[It]||(N.ShadersStore[It]=As);const Et="gaussianSplattingDepthPixelShader",Ds=`#include -varying vPosition: vec2f;varying vColor: vec4f; -#ifdef DEPTH_RENDER -varying vDepthMetric: f32; -#endif -fn checkDiscard(inPosition: vec2f,inColor: vec4f)->vec4f {var A : f32=-dot(inPosition,inPosition);var alpha : f32=exp(A)*inColor.a; -#if defined(SM_SOFTTRANSPARENTSHADOW) && SM_SOFTTRANSPARENTSHADOW==1 -if (A<-4.) {discard;} -#else -if (A<-inColor.a) {discard;} -#endif -#ifdef DEPTH_RENDER -return vec4f(fragmentInputs.vDepthMetric,0.0,0.0,1.0); -#else -return vec4f(inColor.rgb,alpha); -#endif -} -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=checkDiscard(fragmentInputs.vPosition,fragmentInputs.vColor); -#if defined(SM_SOFTTRANSPARENTSHADOW) && SM_SOFTTRANSPARENTSHADOW==1 -var alpha : f32=fragmentOutputs.color.a; -#endif -} -`;N.ShadersStoreWGSL[Et]||(N.ShadersStoreWGSL[Et]=Ds);const Tt="gaussianSplattingDepthVertexShader",Ms=`#include -#include -attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform alpha: f32;var covariancesATexture: texture_2d;var covariancesBTexture: texture_2d;var centersTexture: texture_2d;var colorsTexture: texture_2d;varying vPosition: vec2f;varying vColor: vec4f; -#ifdef DEPTH_RENDER -uniform depthValues: vec2f;varying vDepthMetric: f32; -#endif -#include -@vertex -fn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;vertexOutputs.vColor=splat.color;vertexOutputs.vColor.w*=uniforms.alpha;vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize); -#ifdef DEPTH_RENDER -#ifdef USE_REVERSE_DEPTHBUFFER -vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y)); -#else -vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y)); -#endif -#endif -}`;N.ShadersStoreWGSL[Tt]||(N.ShadersStoreWGSL[Tt]=Ms);class zs extends Qt{constructor(){super(),this.FOG=!1,this.THIN_INSTANCES=!0,this.LOGARITHMICDEPTH=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.SH_DEGREE=0,this.COMPENSATION=!1,this.rebuild()}}class M extends Wt{constructor(e,t){super(e,t),this.kernelSize=M.KernelSize,this._compensation=M.Compensation,this._isDirty=!1,this._sourceMesh=null,this.backFaceCulling=!1,this.shadowDepthWrapper=M._MakeGaussianSplattingShadowDepthWrapper(t,this.shaderLanguage)}set compensation(e){this._isDirty=this._isDirty!=e,this._compensation=e}get compensation(){return this._compensation}get hasRenderTargetTextures(){return!1}needAlphaTesting(){return!1}needAlphaBlending(){return!0}isReadyForSubMesh(e,t){const o=t._drawWrapper;let n=t.materialDefines;if(n&&this._isDirty&&n.markAsUnprocessed(),o.effect&&this.isFrozen&&o._wasPreviouslyReady&&o._wasPreviouslyUsingInstances===!0)return!0;t.materialDefines||(n=t.materialDefines=new zs);const a=this.getScene();if(this._isReadyForSubMesh(t))return!0;if(!this._sourceMesh)return!1;const l=a.getEngine(),h=this._sourceMesh;Vt(e,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,!1,n,void 0,void 0,void 0,this._isVertexOutputInvariant),Zt(a,l,this,n,!0,null,!0),jt(e,n,!1,!1),(l.version>1||l.isWebGPU)&&(n.SH_DEGREE=h.shDegree);const i=h.material;if(n.COMPENSATION=i&&i.compensation?i.compensation:M.Compensation,n.isDirty){n.markAsProcessed(),a.resetCachedMaterial(),Xt(M._Attribs,n),Gt({uniformsNames:M._Uniforms,uniformBuffersNames:M._UniformBuffers,samplers:M._Samplers,defines:n}),$t(M._Uniforms);const _=n.toString(),u=a.getEngine().createEffect("gaussianSplatting",{attributes:M._Attribs,uniformsNames:M._Uniforms,uniformBuffersNames:M._UniformBuffers,samplers:M._Samplers,defines:_,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{this._shaderLanguage===1?await Promise.all([ye(()=>Promise.resolve().then(()=>Cs),void 0,import.meta.url),ye(()=>Promise.resolve().then(()=>Es),void 0,import.meta.url)]):await Promise.all([ye(()=>Promise.resolve().then(()=>_s),void 0,import.meta.url),ye(()=>Promise.resolve().then(()=>Ss),void 0,import.meta.url)])}},l);t.setEffect(u,n,this._materialContext)}return!t.effect||!t.effect.isReady()?!1:(n._renderId=a.getRenderId(),o._wasPreviouslyReady=!0,o._wasPreviouslyUsingInstances=!0,this._isDirty=!1,!0)}setSourceMesh(e){this._sourceMesh=e}static BindEffect(e,t,s){const o=s.getEngine(),n=s.activeCamera,a=o.getRenderWidth()*n.viewport.width,l=o.getRenderHeight()*n.viewport.height,h=e.material;if(!h._sourceMesh)return;const i=h._sourceMesh,_=n?.rigParent?.rigCameras.length||1;t.setFloat2("invViewport",1/(a/_),1/l);let u=1e3;if(n){const f=n.getProjectionMatrix().m[5];n.fovMode==_t.FOVMODE_VERTICAL_FIXED?u=l*f/2:u=a*f/2}if(t.setFloat2("focal",u,u),t.setFloat("kernelSize",h&&h.kernelSize?h.kernelSize:M.KernelSize),t.setFloat("alpha",h.alpha),s.bindEyePosition(t,"eyePosition",!0),i.covariancesATexture){const f=i.covariancesATexture.getSize();if(t.setFloat2("dataTextureSize",f.width,f.height),t.setTexture("covariancesATexture",i.covariancesATexture),t.setTexture("covariancesBTexture",i.covariancesBTexture),t.setTexture("centersTexture",i.centersTexture),t.setTexture("colorsTexture",i.colorsTexture),i.shTextures)for(let p=0;p{const n=o.material,a=o;M._BindEffectUniforms(a,n,s,e)}),s}static _MakeGaussianSplattingShadowDepthWrapper(e,t){const s=new xt("gaussianSplattingDepth",e,{vertex:"gaussianSplattingDepth",fragment:"gaussianSplattingDepth"},{attributes:M._Attribs,uniforms:M._Uniforms,samplers:M._Samplers,uniformBuffers:M._UniformBuffers,shaderLanguage:t}),o=new us(s,e,{standalone:!0});return s.onBindObservable.add(n=>{const a=n.material,l=n;M._BindEffectUniforms(l,a,s,e)}),o}clone(e){return mt.Clone(()=>new M(e,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.GaussianSplattingMaterial",e}getClassName(){return"GaussianSplattingMaterial"}static Parse(e,t,s){return mt.Parse(()=>new M(e.name,t),e,t,s)}}M.KernelSize=.3;M.Compensation=!1;M._Attribs=[q.PositionKind,"splatIndex0","splatIndex1","splatIndex2","splatIndex3"];M._Samplers=["covariancesATexture","covariancesBTexture","centersTexture","colorsTexture","shTexture0","shTexture1","shTexture2"];M._UniformBuffers=["Scene","Mesh"];M._Uniforms=["world","view","projection","vFogInfos","vFogColor","logarithmicDepthConstant","invViewport","dataTextureSize","focal","eyePosition","kernelSize","alpha","depthValues"];Lt("BABYLON.GaussianSplattingMaterial",M);const Hs=es,X={...Yt,TwoPi:Math.PI*2,Sign:Math.sign,Log2:Math.log2,HCF:Hs},Q=(r,e)=>{const t=(1<{e.x=Q(r>>>21,11),e.y=Q(r>>>11,10),e.z=Q(r,11)},ks=(r,e)=>{e[0]=Q(r>>>24,8)*255,e[1]=Q(r>>>16,8)*255,e[2]=Q(r>>>8,8)*255,e[3]=Q(r,8)*255},Rs=(r,e)=>{const t=1/(Math.sqrt(2)*.5),s=(Q(r>>>20,10)-.5)*t,o=(Q(r>>>10,10)-.5)*t,n=(Q(r,10)-.5)*t,a=Math.sqrt(1-(s*s+o*o+n*n));switch(r>>>30){case 0:e.set(a,s,o,n);break;case 1:e.set(s,a,o,n);break;case 2:e.set(s,o,a,n);break;case 3:e.set(s,o,n,a);break}};var Dt;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r[r.DOUBLE=3]="DOUBLE",r[r.UCHAR=4]="UCHAR",r[r.UNDEFINED=5]="UNDEFINED"})(Dt||(Dt={}));var Mt;(function(r){r[r.MIN_X=0]="MIN_X",r[r.MIN_Y=1]="MIN_Y",r[r.MIN_Z=2]="MIN_Z",r[r.MAX_X=3]="MAX_X",r[r.MAX_Y=4]="MAX_Y",r[r.MAX_Z=5]="MAX_Z",r[r.MIN_SCALE_X=6]="MIN_SCALE_X",r[r.MIN_SCALE_Y=7]="MIN_SCALE_Y",r[r.MIN_SCALE_Z=8]="MIN_SCALE_Z",r[r.MAX_SCALE_X=9]="MAX_SCALE_X",r[r.MAX_SCALE_Y=10]="MAX_SCALE_Y",r[r.MAX_SCALE_Z=11]="MAX_SCALE_Z",r[r.PACKED_POSITION=12]="PACKED_POSITION",r[r.PACKED_ROTATION=13]="PACKED_ROTATION",r[r.PACKED_SCALE=14]="PACKED_SCALE",r[r.PACKED_COLOR=15]="PACKED_COLOR",r[r.X=16]="X",r[r.Y=17]="Y",r[r.Z=18]="Z",r[r.SCALE_0=19]="SCALE_0",r[r.SCALE_1=20]="SCALE_1",r[r.SCALE_2=21]="SCALE_2",r[r.DIFFUSE_RED=22]="DIFFUSE_RED",r[r.DIFFUSE_GREEN=23]="DIFFUSE_GREEN",r[r.DIFFUSE_BLUE=24]="DIFFUSE_BLUE",r[r.OPACITY=25]="OPACITY",r[r.F_DC_0=26]="F_DC_0",r[r.F_DC_1=27]="F_DC_1",r[r.F_DC_2=28]="F_DC_2",r[r.F_DC_3=29]="F_DC_3",r[r.ROT_0=30]="ROT_0",r[r.ROT_1=31]="ROT_1",r[r.ROT_2=32]="ROT_2",r[r.ROT_3=33]="ROT_3",r[r.MIN_COLOR_R=34]="MIN_COLOR_R",r[r.MIN_COLOR_G=35]="MIN_COLOR_G",r[r.MIN_COLOR_B=36]="MIN_COLOR_B",r[r.MAX_COLOR_R=37]="MAX_COLOR_R",r[r.MAX_COLOR_G=38]="MAX_COLOR_G",r[r.MAX_COLOR_B=39]="MAX_COLOR_B",r[r.SH_0=40]="SH_0",r[r.SH_1=41]="SH_1",r[r.SH_2=42]="SH_2",r[r.SH_3=43]="SH_3",r[r.SH_4=44]="SH_4",r[r.SH_5=45]="SH_5",r[r.SH_6=46]="SH_6",r[r.SH_7=47]="SH_7",r[r.SH_8=48]="SH_8",r[r.SH_9=49]="SH_9",r[r.SH_10=50]="SH_10",r[r.SH_11=51]="SH_11",r[r.SH_12=52]="SH_12",r[r.SH_13=53]="SH_13",r[r.SH_14=54]="SH_14",r[r.SH_15=55]="SH_15",r[r.SH_16=56]="SH_16",r[r.SH_17=57]="SH_17",r[r.SH_18=58]="SH_18",r[r.SH_19=59]="SH_19",r[r.SH_20=60]="SH_20",r[r.SH_21=61]="SH_21",r[r.SH_22=62]="SH_22",r[r.SH_23=63]="SH_23",r[r.SH_24=64]="SH_24",r[r.SH_25=65]="SH_25",r[r.SH_26=66]="SH_26",r[r.SH_27=67]="SH_27",r[r.SH_28=68]="SH_28",r[r.SH_29=69]="SH_29",r[r.SH_30=70]="SH_30",r[r.SH_31=71]="SH_31",r[r.SH_32=72]="SH_32",r[r.SH_33=73]="SH_33",r[r.SH_34=74]="SH_34",r[r.SH_35=75]="SH_35",r[r.SH_36=76]="SH_36",r[r.SH_37=77]="SH_37",r[r.SH_38=78]="SH_38",r[r.SH_39=79]="SH_39",r[r.SH_40=80]="SH_40",r[r.SH_41=81]="SH_41",r[r.SH_42=82]="SH_42",r[r.SH_43=83]="SH_43",r[r.SH_44=84]="SH_44",r[r.UNDEFINED=85]="UNDEFINED"})(Mt||(Mt={}));class D extends Ie{get disableDepthSort(){return this._disableDepthSort}set disableDepthSort(e){!this._disableDepthSort&&e?(this._worker?.terminate(),this._worker=null,this._disableDepthSort=!0):this._disableDepthSort&&!e&&(this._disableDepthSort=!1,this._sortIsDirty=!0,this._instanciateWorker())}get viewDirectionFactor(){return T.OneReadOnly}get shDegree(){return this._shDegree}get splatCount(){return this._splatIndex?.length}get splatsData(){return this._splatsData}get covariancesATexture(){return this._covariancesATexture}get covariancesBTexture(){return this._covariancesBTexture}get centersTexture(){return this._centersTexture}get colorsTexture(){return this._colorsTexture}get shTextures(){return this._shTextures}get kernelSize(){return this._material instanceof M?this._material.kernelSize:0}get compensation(){return this._material instanceof M?this._material.compensation:!1}set material(e){this._material=e,this._material.backFaceCulling=!1,this._material.cullBackFaces=!1,e.resetDrawCache()}get material(){return this._material}static _MakeSplatGeometryForMesh(e){const t=new Ne,s=[-2,-2,0,2,-2,0,2,2,0,-2,2,0],o=[0,1,2,0,2,3],n=[],a=[];for(let l=0;lh+l*4))}t.positions=n,t.indices=a.flat(),t.applyToMesh(e)}constructor(e,t=null,s=null,o=!1){super(e,s),this._vertexCount=0,this._worker=null,this._modelViewMatrix=Ce.Identity(),this._canPostToWorker=!0,this._readyToDisplay=!1,this._covariancesATexture=null,this._covariancesBTexture=null,this._centersTexture=null,this._colorsTexture=null,this._splatPositions=null,this._splatIndex=null,this._shTextures=null,this._splatsData=null,this._keepInRam=!1,this._delayedTextureUpdate=null,this._useRGBACovariants=!1,this._material=null,this._tmpCovariances=[0,0,0,0,0,0],this._sortIsDirty=!1,this._shDegree=0,this._cameraViewInfos=new Map,this._disableDepthSort=!1,this._loadingPromise=null,this.subMeshes=[],new ts(0,0,4*D._BatchSize,0,6*D._BatchSize,this),this.setEnabled(!1),this._useRGBACovariants=!this.getEngine().isWebGPU&&this.getEngine().version===1,this._keepInRam=o,t&&(this._loadingPromise=this.loadFileAsync(t));const n=new M(this.name+"_material",this._scene);n.setSourceMesh(this),this._material=n,this._scene.onCameraRemovedObservable.add(a=>{const l=a.uniqueId;this._cameraViewInfos.has(l)&&(this._cameraViewInfos.get(l)?.mesh.dispose(),this._cameraViewInfos.delete(l))})}getLoadingPromise(){return this._loadingPromise}getClassName(){return"GaussianSplattingMesh"}getTotalVertices(){return this._vertexCount}isReady(e=!1){return super.isReady(e,!0)?this._readyToDisplay?!0:(this._postToWorker(!0),!1):!1}_getCameraDirection(e){const t=e.getViewMatrix();this.getWorldMatrix().multiplyToRef(t,this._modelViewMatrix);const s=J.Vector3[1];return s.set(this._modelViewMatrix.m[2],this._modelViewMatrix.m[6],this._modelViewMatrix.m[10]),s.normalize(),s}_postToWorker(e=!1){const s=this._scene.getFrameId();let o=!1;this._cameraViewInfos.forEach(h=>{h.frameIdLastUpdate!==s&&(o=!0)});const n=this._scene.activeCameras?.length?this._scene.activeCameras:[this._scene.activeCamera],a=[];n.forEach(h=>{if(!h)return;const i=h.uniqueId,_=this._cameraViewInfos.get(i);if(_)a.push(_);else{const u=new Ie(this.name+"_cameraMesh_"+i,this._scene);u.reservedDataStore={hidden:!0},u.setEnabled(!1),u.material=this.material,D._MakeSplatGeometryForMesh(u);const f={camera:h,cameraDirection:new T(0,0,0),mesh:u,frameIdLastUpdate:s,splatIndexBufferSet:!1};a.push(f),this._cameraViewInfos.set(i,f)}}),a.sort((h,i)=>h.frameIdLastUpdate-i.frameIdLastUpdate);const l=this._worker||_native&&_native.sortSplats||this._disableDepthSort;(e||o)&&l&&(this._scene.activeCameras?.length||this._scene.activeCamera)&&this._canPostToWorker?a.forEach(h=>{const i=h.camera,_=this._getCameraDirection(i),u=h.cameraDirection,f=T.Dot(_,u);(e||Math.abs(f-1)>=.01)&&this._canPostToWorker&&(h.cameraDirection.copyFrom(_),h.frameIdLastUpdate=s,this._canPostToWorker=!1,this._worker?this._worker.postMessage({view:this._modelViewMatrix.m,depthMix:this._depthMix,useRightHandedSystem:this._scene.useRightHandedSystem,cameraId:i.uniqueId},[this._depthMix.buffer]):_native&&_native.sortSplats&&(_native.sortSplats(this._modelViewMatrix,this._splatPositions,this._splatIndex,this._scene.useRightHandedSystem),h.splatIndexBufferSet?h.mesh.thinInstanceBufferUpdated("splatIndex"):(h.mesh.thinInstanceSetBuffer("splatIndex",this._splatIndex,16,!1),h.splatIndexBufferSet=!0),this._canPostToWorker=!0,this._readyToDisplay=!0))}):this._disableDepthSort&&(a.forEach(h=>{h.splatIndexBufferSet||(h.mesh.thinInstanceSetBuffer("splatIndex",this._splatIndex,16,!1),h.splatIndexBufferSet=!0)}),this._canPostToWorker=!0,this._readyToDisplay=!0)}render(e,t,s){this._postToWorker(),!this._geometry&&this._cameraViewInfos.size&&(this._geometry=this._cameraViewInfos.values().next().value.mesh.geometry);const o=this._scene.activeCamera.uniqueId,n=this._cameraViewInfos.get(o);if(!n||!n.splatIndexBufferSet)return this;const a=n.mesh;return a.getWorldMatrix().copyFrom(this.getWorldMatrix()),a.render(e,t,s)}static _TypeNameToEnum(e){switch(e){case"float":return 0;case"int":return 1;case"uint":return 2;case"double":return 3;case"uchar":return 4}return 5}static _ValueNameToEnum(e){switch(e){case"min_x":return 0;case"min_y":return 1;case"min_z":return 2;case"max_x":return 3;case"max_y":return 4;case"max_z":return 5;case"min_scale_x":return 6;case"min_scale_y":return 7;case"min_scale_z":return 8;case"max_scale_x":return 9;case"max_scale_y":return 10;case"max_scale_z":return 11;case"packed_position":return 12;case"packed_rotation":return 13;case"packed_scale":return 14;case"packed_color":return 15;case"x":return 16;case"y":return 17;case"z":return 18;case"scale_0":return 19;case"scale_1":return 20;case"scale_2":return 21;case"diffuse_red":case"red":return 22;case"diffuse_green":case"green":return 23;case"diffuse_blue":case"blue":return 24;case"f_dc_0":return 26;case"f_dc_1":return 27;case"f_dc_2":return 28;case"f_dc_3":return 29;case"opacity":return 25;case"rot_0":return 30;case"rot_1":return 31;case"rot_2":return 32;case"rot_3":return 33;case"min_r":return 34;case"min_g":return 35;case"min_b":return 36;case"max_r":return 37;case"max_g":return 38;case"max_b":return 39;case"f_rest_0":return 40;case"f_rest_1":return 41;case"f_rest_2":return 42;case"f_rest_3":return 43;case"f_rest_4":return 44;case"f_rest_5":return 45;case"f_rest_6":return 46;case"f_rest_7":return 47;case"f_rest_8":return 48;case"f_rest_9":return 49;case"f_rest_10":return 50;case"f_rest_11":return 51;case"f_rest_12":return 52;case"f_rest_13":return 53;case"f_rest_14":return 54;case"f_rest_15":return 55;case"f_rest_16":return 56;case"f_rest_17":return 57;case"f_rest_18":return 58;case"f_rest_19":return 59;case"f_rest_20":return 60;case"f_rest_21":return 61;case"f_rest_22":return 62;case"f_rest_23":return 63;case"f_rest_24":return 64;case"f_rest_25":return 65;case"f_rest_26":return 66;case"f_rest_27":return 67;case"f_rest_28":return 68;case"f_rest_29":return 69;case"f_rest_30":return 70;case"f_rest_31":return 71;case"f_rest_32":return 72;case"f_rest_33":return 73;case"f_rest_34":return 74;case"f_rest_35":return 75;case"f_rest_36":return 76;case"f_rest_37":return 77;case"f_rest_38":return 78;case"f_rest_39":return 79;case"f_rest_40":return 80;case"f_rest_41":return 81;case"f_rest_42":return 82;case"f_rest_43":return 83;case"f_rest_44":return 84}return 85}static ParseHeader(e){const t=new Uint8Array(e),s=new TextDecoder().decode(t.slice(0,1024*10)),o=`end_header -`,n=s.indexOf(o);if(n<0||!s)return null;const a=parseInt(/element vertex (\d+)\n/.exec(s)[1]),l=/element chunk (\d+)\n/.exec(s);let h=0;l&&(h=parseInt(l[1]));let i=0,_=0;const u={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0};let f;(function(v){v[v.Vertex=0]="Vertex",v[v.Chunk=1]="Chunk",v[v.SH=2]="SH",v[v.Unused=3]="Unused"})(f||(f={}));let p=1;const m=[],C=[],E=s.slice(0,n).split(` -`);let c=0;for(const v of E)if(v.startsWith("property ")){const[,d,y]=v.split(" "),A=D._ValueNameToEnum(y);A!=85&&(A>=84?c=3:A>=64?c=Math.max(c,2):A>=48&&(c=Math.max(c,1)));const H=D._TypeNameToEnum(d);p==1?(C.push({value:A,type:H,offset:_}),_+=u[d]):p==0?(m.push({value:A,type:H,offset:i}),i+=u[d]):p==2&&m.push({value:A,type:H,offset:i}),u[d]||de.Warn(`Unsupported property type: ${d}.`)}else if(v.startsWith("element ")){const[,d]=v.split(" ");d=="chunk"?p=1:d=="vertex"?p=0:d=="sh"?p=2:p=3}const g=new DataView(e,n+o.length),S=new ArrayBuffer(D._RowOutputLength*a);let w=null,x=0;return c&&(x=((c+1)*(c+1)-1)*3,w=new ArrayBuffer(x*a)),{vertexCount:a,chunkCount:h,rowVertexLength:i,rowChunkLength:_,vertexProperties:m,chunkProperties:C,dataView:g,buffer:S,shDegree:c,shCoefficientCount:x,shBuffer:w}}static _GetCompressedChunks(e,t){if(!e.chunkCount)return null;const s=e.dataView,o=new Array(e.chunkCount);for(let n=0;n>8;let E=255,c=0,g=0,S=0;const w=[];for(let x=0;x=40&&v.value<=84){const y=v.value-40;if(v.type==4&&e.chunkCount){const A=i.getUint8(e.rowChunkLength*e.chunkCount+e.vertexCount*e.rowVertexLength+t*e.shCoefficientCount+y);w[y]=(A*(8/255)-4)*127.5+127.5}else{const A=X.Clamp(d*127.5+127.5,0,255);w[y]=A}}}if(m){const x=e.shDegree==1?3:e.shDegree==2?8:15;for(let v=0;v{t.mesh.dispose()}),super.dispose(e,!0)}_copyTextures(e){if(this._covariancesATexture=e.covariancesATexture?.clone(),this._covariancesBTexture=e.covariancesBTexture?.clone(),this._centersTexture=e.centersTexture?.clone(),this._colorsTexture=e.colorsTexture?.clone(),e._shTextures){this._shTextures=[];for(const t of this._shTextures)this._shTextures?.push(t.clone())}}clone(e=""){const t=new D(e,void 0,this.getScene());t._copySource(this),t.makeGeometryUnique(),t._vertexCount=this._vertexCount,t._copyTextures(this),t._modelViewMatrix=Ce.Identity(),t._splatPositions=this._splatPositions,t._readyToDisplay=!1,t._disableDepthSort=this._disableDepthSort,t._instanciateWorker();const s=this.getBoundingInfo();return t.getBoundingInfo().reConstruct(s.minimum,s.maximum,this.getWorldMatrix()),t.forcedInstanceCount=this.forcedInstanceCount,t.setEnabled(!0),t}_makeEmptySplat(e,t,s,o){const n=this._useRGBACovariants?4:2;this._splatPositions[4*e+0]=0,this._splatPositions[4*e+1]=0,this._splatPositions[4*e+2]=0,t[e*4+0]=$(0),t[e*4+1]=$(0),t[e*4+2]=$(0),t[e*4+3]=$(0),s[e*n+0]=$(0),s[e*n+1]=$(0),o[e*4+3]=0}_makeSplat(e,t,s,o,n,a,l,h,i){const _=J.Matrix[0],u=J.Matrix[1],f=J.Quaternion[0],p=this._useRGBACovariants?4:2,m=t[8*e+0],C=t[8*e+1]*(i.flipY?-1:1),E=t[8*e+2];this._splatPositions[4*e+0]=m,this._splatPositions[4*e+1]=C,this._splatPositions[4*e+2]=E,l.minimizeInPlaceFromFloats(m,C,E),h.maximizeInPlaceFromFloats(m,C,E),f.set((s[32*e+28+1]-127.5)/127.5,(s[32*e+28+2]-127.5)/127.5,(s[32*e+28+3]-127.5)/127.5,-(s[32*e+28+0]-127.5)/127.5),f.normalize(),f.toRotationMatrix(_),Ce.ScalingToRef(t[8*e+3+0]*2,t[8*e+3+1]*2,t[8*e+3+2]*2,u);const c=_.multiplyToRef(u,J.Matrix[0]).m,g=this._tmpCovariances;g[0]=c[0]*c[0]+c[1]*c[1]+c[2]*c[2],g[1]=c[0]*c[4]+c[1]*c[5]+c[2]*c[6],g[2]=c[0]*c[8]+c[1]*c[9]+c[2]*c[10],g[3]=c[4]*c[4]+c[5]*c[5]+c[6]*c[6],g[4]=c[4]*c[8]+c[5]*c[9]+c[6]*c[10],g[5]=c[8]*c[8]+c[9]*c[9]+c[10]*c[10];let S=-1e4;for(let x=0;x<6;x++)S=Math.max(S,Math.abs(g[x]));this._splatPositions[4*e+3]=S;const w=S;o[e*4+0]=$(g[0]/w),o[e*4+1]=$(g[1]/w),o[e*4+2]=$(g[2]/w),o[e*4+3]=$(g[3]/w),n[e*p+0]=$(g[4]/w),n[e*p+1]=$(g[5]/w),a[e*4+0]=s[32*e+24+0],a[e*4+1]=s[32*e+24+1],a[e*4+2]=s[32*e+24+2],a[e*4+3]=s[32*e+24+3]}_updateTextures(e,t,s,o){const n=this._getTextureSize(this._vertexCount),a=(_,u,f,p)=>new we(_,u,f,p,this._scene,!1,!1,2,1),l=(_,u,f,p)=>new we(_,u,f,p,this._scene,!1,!1,2,0),h=(_,u,f,p)=>new we(_,u,f,p,this._scene,!1,!1,1,7),i=(_,u,f,p)=>new we(_,u,f,p,this._scene,!1,!1,2,2);if(this._covariancesATexture){this._delayedTextureUpdate={covA:e,covB:t,colors:s,centers:this._splatPositions,sh:o};const _=Float32Array.from(this._splatPositions),u=this._vertexCount;this._worker&&this._worker.postMessage({positions:_,vertexCount:u},[_.buffer]),this._postToWorker(!0)}else{if(this._covariancesATexture=i(e,n.x,n.y,5),this._covariancesBTexture=i(t,n.x,n.y,this._useRGBACovariants?5:7),this._centersTexture=a(this._splatPositions,n.x,n.y,5),this._colorsTexture=l(s,n.x,n.y,5),o){this._shTextures=[];for(const _ of o){const u=new Uint32Array(_.buffer),f=h(u,n.x,n.y,11);f.wrapU=0,f.wrapV=0,this._shTextures.push(f)}}this._instanciateWorker()}}*_updateData(e,t,s,o={flipY:!1}){this._covariancesATexture||(this._readyToDisplay=!1);const n=new Uint8Array(e),a=new Float32Array(n.buffer);this._keepInRam&&(this._splatsData=e);const l=n.length/D._RowOutputLength;l!=this._vertexCount&&this._updateSplatIndexBuffer(l),this._vertexCount=l,this._shDegree=s?s.length:0;const h=this._getTextureSize(l),i=h.x*h.y,_=D.ProgressiveUpdateAmount??h.y,u=h.x*_;this._splatPositions=new Float32Array(4*i);const f=new Uint16Array(i*4),p=new Uint16Array((this._useRGBACovariants?4:2)*i),m=new Uint8Array(i*4),C=new T(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),E=new T(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(D.ProgressiveUpdateAmount){this._updateTextures(f,p,m,s),this.setEnabled(!0);const c=Math.ceil(h.y/_);for(let w=0;wthis._splatIndex.length){this._splatIndex=new Float32Array(t);for(let s=0;s{s.mesh.thinInstanceSetBuffer("splatIndex",this._splatIndex,16,!1)})}this.forcedInstanceCount=t>>4}_updateSubTextures(e,t,s,o,n,a,l){const h=(c,g,S,w,x)=>{this.getEngine().updateTextureData(c.getInternalTexture(),g,0,w,S,x,0,0,!1)},i=this._getTextureSize(this._vertexCount),_=this._useRGBACovariants?4:2,u=n*i.x,f=a*i.x,p=new Uint16Array(t.buffer,u*4*Uint16Array.BYTES_PER_ELEMENT,f*4),m=new Uint16Array(s.buffer,u*_*Uint16Array.BYTES_PER_ELEMENT,f*_),C=new Uint8Array(o.buffer,u*4,f*4),E=new Float32Array(e.buffer,u*4*Float32Array.BYTES_PER_ELEMENT,f*4);if(h(this._covariancesATexture,p,i.x,n,a),h(this._covariancesBTexture,m,i.x,n,a),h(this._centersTexture,E,i.x,n,a),h(this._colorsTexture,C,i.x,n,a),l)for(let c=0;c{this._depthMix=s.data.depthMix;const o=s.data.cameraId,n=new Uint32Array(s.data.depthMix.buffer);if(this._splatIndex)for(let l=0;ls&&(de.Error("GaussianSplatting texture size: ("+s+", "+o+"), maxTextureSize: "+s),o=s),new ne(s,o)}}D._RowOutputLength=32;D._SH_C0=.28209479177387814;D._SplatBatchSize=327680;D._PlyConversionBatchSize=32768;D._BatchSize=16;D.ProgressiveUpdateAmount=0;D._CreateWorker=function(r){let e,t,s,o;r.onmessage=n=>{if(n.data.positions)e=n.data.positions;else{const a=n.data.cameraId,l=n.data.view,h=e.length/4+15&-16;if(!e||!l)throw new Error("positions or view is not defined!");t=n.data.depthMix,s=new Uint32Array(t.buffer),o=new Float32Array(t.buffer);for(let _=0;_0&&t.set(this._uvs32,q.UVKind);let s=0;this._colors32.length>0&&(s=1,t.set(this._colors32,q.ColorKind));const o=new Ie(this.name,this._scene);t.applyToMesh(o,this._updatable),this.mesh=o,this._positions=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0);let n=e;return n||(n=new hs("point cloud material",this._scene),n.emissiveColor=new Se(s,s,s),n.disableLighting=!0,n.pointsCloud=!0,n.pointSize=this._size),o.material=n,o}_addParticle(e,t,s,o){const n=new Os(e,t,s,o,this);return this.particles.push(n),n}_randomUnitVector(e){e.position=new T(Math.random(),Math.random(),Math.random()),e.color=new L(1,1,1,1)}_getColorIndicesForCoord(e,t,s,o){const n=e._groupImageData,a=s*(o*4)+t*4,l=[a,a+1,a+2,a+3],h=l[0],i=l[1],_=l[2],u=l[3],f=n[h],p=n[i],m=n[_],C=n[u];return new L(f/255,p/255,m/255,C)}_setPointsColorOrUV(e,t,s,o,n,a,l,h){h=h??0,s&&e.updateFacetData();const _=2*e.getBoundingInfo().boundingSphere.radius;let u=e.getVerticesData(q.PositionKind);const f=e.getIndices(),p=e.getVerticesData(q.UVKind+(h?h+1:"")),m=e.getVerticesData(q.ColorKind),C=T.Zero();e.computeWorldMatrix();const E=e.getWorldMatrix();if(!E.isIdentity()){u=u.slice(0);for(let j=0;j1&&(ie=1),ce<0&&(ce=0),ce>1&&(ce=1),Se.HSVtoRGBToRef(ut,ie,ce,ge),P.set(ge.r,ge.g,ge.b,1)):P=fe.set(Math.random(),Math.random(),Math.random(),1),G.color=new L(P.x,P.y,P.z,P.w),this._colors.push(P.x,P.y,P.z,P.w))}}_colorFromTexture(e,t,s){if(e.material===null){de.Warn(e.name+"has no material."),t._groupImageData=null,this._setPointsColorOrUV(e,t,s,!0,!1);return}const n=e.material.getActiveTextures();if(n.length===0){de.Warn(e.name+"has no usable texture."),t._groupImageData=null,this._setPointsColorOrUV(e,t,s,!0,!1);return}const a=e.clone();a.setEnabled(!1),this._promises.push(new Promise(l=>{os.WhenAllReady(n,()=>{let h=t._textureNb;h<0&&(h=0),h>n.length-1&&(h=n.length-1);const i=()=>{t._groupImgWidth=n[h].getSize().width,t._groupImgHeight=n[h].getSize().height,this._setPointsColorOrUV(a,t,s,!0,!0,void 0,void 0,n[h].coordinatesIndex),a.dispose(),l()};t._groupImageData=null;const _=n[h].readPixels();_?_.then(u=>{t._groupImageData=u,i()}):i()})}))}_calculateDensity(e,t,s){let o,n,a,l,h,i,_,u,f,p,m,C;const E=T.Zero(),c=T.Zero(),g=T.Zero(),S=T.Zero(),w=T.Zero(),x=T.Zero();let v;const d=[];let y=0;const A=s.length/3;for(let b=0;b0;b--){const U=d[b];if(U===0)H[b]=0;else{const z=(U-d[b-1])/U*B,R=Math.floor(z),V=z-R,k=+(Math.random()3)&&(a=0);const l=e.getVerticesData(q.PositionKind),h=e.getIndices();this._groups.push(this._groupCounter);const i=new Oe(this._groupCounter,null);switch(i._groupDensity=this._calculateDensity(t,l,h),a===2?i._textureNb=o||0:o=o||new L(1,1,1,1),a){case 2:this._colorFromTexture(e,i,!1);break;case 1:this._setPointsColorOrUV(e,i,!1,!1,!1);break;case 0:this._setPointsColorOrUV(e,i,!1);break;case 3:this._setPointsColorOrUV(e,i,!1,void 0,void 0,o,n);break}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1}addVolumePoints(e,t,s,o,n){let a=s||0;(isNaN(a)||a<0||a>3)&&(a=0);const l=e.getVerticesData(q.PositionKind),h=e.getIndices();this._groups.push(this._groupCounter);const i=new Oe(this._groupCounter,null);switch(i._groupDensity=this._calculateDensity(t,l,h),a===2?i._textureNb=o||0:o=o||new L(1,1,1,1),a){case 2:this._colorFromTexture(e,i,!0);break;case 1:this._setPointsColorOrUV(e,i,!0,!1,!1);break;case 0:this._setPointsColorOrUV(e,i,!0);break;case 3:this._setPointsColorOrUV(e,i,!0,void 0,void 0,o,n);break}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1}setParticles(e=0,t=this.nbParticles-1,s=!0){if(!this._updatable||!this._isReady)return this;this.beforeUpdateParticles(e,t,s);const o=J.Matrix[0],n=this.mesh,a=this._colors32,l=this._positions32,h=this._uvs32,i=J.Vector3,_=i[5].copyFromFloats(1,0,0),u=i[6].copyFromFloats(0,1,0),f=i[7].copyFromFloats(0,0,1),p=i[8].setAll(Number.MAX_VALUE),m=i[9].setAll(-Number.MAX_VALUE);Ce.IdentityToRef(o);let C=0;if(this.mesh?.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(e!=0||t!=this.nbParticles-1)){const S=this.mesh?.getBoundingInfo();S&&(p.copyFrom(S.minimum),m.copyFrom(S.maximum))}C=0;let E=0,c=0,g=0;for(let S=e;S<=t;S++){const w=this.particles[S];C=w.idx,E=3*C,c=4*C,g=2*C,this.updateParticle(w);const x=w._rotationMatrix,v=w.position,d=w._globalPosition;if(this._computeParticleRotation&&w.getRotationMatrix(o),w.parentId!==null){const O=this.particles[w.parentId],I=O._rotationMatrix,K=O._globalPosition,Y=v.x*I[1]+v.y*I[4]+v.z*I[7],oe=v.x*I[0]+v.y*I[3]+v.z*I[6],te=v.x*I[2]+v.y*I[5]+v.z*I[8];if(d.x=K.x+oe,d.y=K.y+Y,d.z=K.z+te,this._computeParticleRotation){const F=o.m;x[0]=F[0]*I[0]+F[1]*I[3]+F[2]*I[6],x[1]=F[0]*I[1]+F[1]*I[4]+F[2]*I[7],x[2]=F[0]*I[2]+F[1]*I[5]+F[2]*I[8],x[3]=F[4]*I[0]+F[5]*I[3]+F[6]*I[6],x[4]=F[4]*I[1]+F[5]*I[4]+F[6]*I[7],x[5]=F[4]*I[2]+F[5]*I[5]+F[6]*I[8],x[6]=F[8]*I[0]+F[9]*I[3]+F[10]*I[6],x[7]=F[8]*I[1]+F[9]*I[4]+F[10]*I[7],x[8]=F[8]*I[2]+F[9]*I[5]+F[10]*I[8]}}else if(d.x=0,d.y=0,d.z=0,this._computeParticleRotation){const O=o.m;x[0]=O[0],x[1]=O[1],x[2]=O[2],x[3]=O[4],x[4]=O[5],x[5]=O[6],x[6]=O[8],x[7]=O[9],x[8]=O[10]}const A=i[11];w.translateFromPivot?A.setAll(0):A.copyFrom(w.pivot);const H=i[0];H.copyFrom(w.position);const B=H.x-w.pivot.x,b=H.y-w.pivot.y,U=H.z-w.pivot.z;let W=B*x[0]+b*x[3]+U*x[6],z=B*x[1]+b*x[4]+U*x[7],R=B*x[2]+b*x[5]+U*x[8];W+=A.x,z+=A.y,R+=A.z;const V=l[E]=d.x+_.x*W+u.x*z+f.x*R,k=l[E+1]=d.y+_.y*W+u.y*z+f.y*R,Z=l[E+2]=d.z+_.z*W+u.z*z+f.z*R;if(this._computeBoundingBox&&(p.minimizeInPlaceFromFloats(V,k,Z),m.maximizeInPlaceFromFloats(V,k,Z)),this._computeParticleColor&&w.color){const O=w.color,I=this._colors32;I[c]=O.r,I[c+1]=O.g,I[c+2]=O.b,I[c+3]=O.a}if(this._computeParticleTexture&&w.uv){const O=w.uv,I=this._uvs32;I[g]=O.x,I[g+1]=O.y}}return n&&(s&&(this._computeParticleColor&&n.updateVerticesData(q.ColorKind,a,!1,!1),this._computeParticleTexture&&n.updateVerticesData(q.UVKind,h,!1,!1),n.updateVerticesData(q.PositionKind,l,!1,!1)),this._computeBoundingBox&&(n.hasBoundingInfo?n.getBoundingInfo().reConstruct(p,m,n._worldMatrix):n.buildBoundingInfo(p,m,n._worldMatrix))),this.afterUpdateParticles(e,t,s),this}dispose(){this.mesh?.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._uvs32=null,this._colors32=null}refreshVisibleSize(){return this._isVisibilityBoxLocked||this.mesh?.refreshBoundingInfo(),this}setVisibilityBox(e){if(!this.mesh)return;const t=e/2;this.mesh.buildBoundingInfo(new T(-t,-t,-t),new T(t,t,t))}get isAlwaysVisible(){return this._alwaysVisible}set isAlwaysVisible(e){this.mesh&&(this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e)}set computeParticleRotation(e){this._computeParticleRotation=e}set computeParticleColor(e){this._computeParticleColor=e}set computeParticleTexture(e){this._computeParticleTexture=e}get computeParticleColor(){return this._computeParticleColor}get computeParticleTexture(){return this._computeParticleTexture}set computeBoundingBox(e){this._computeBoundingBox=e}get computeBoundingBox(){return this._computeBoundingBox}initParticles(){}recycleParticle(e){return e}updateParticle(e){return e}beforeUpdateParticles(e,t,s){}afterUpdateParticles(e,t,s){}}function Bs(r,e,t){const s=new Uint8Array(r),o=new Uint32Array(r.slice(0,12)),n=o[2],a=s[12],l=s[13],h=s[14],i=s[15],_=o[1];if(i||o[0]!=1347635022||_!=2&&_!=3)return new Promise(d=>{d({mode:3,data:f,hasVertexColors:!1})});const u=32,f=new ArrayBuffer(u*n),p=1/(1<=3){const d=Math.SQRT1_2;for(let y=0;y>>30;let W=H,z=0;for(let k=3;k>=0;--k)if(k!==U){const Z=W&B,O=W>>>9&1;W=W>>>10,b[k]=d*(Z/B),O===1&&(b[k]=-b[k]),z+=b[k]*b[k]}const R=1-z;b[U]=Math.sqrt(Math.max(R,0));const V=[3,0,1,2];for(let k=0;k<4;k++)x[y*32+28+k]=Math.round(127.5+b[V[k]]*127.5);c+=4}}else for(let d=0;d{z({mode:0,data:f,hasVertexColors:!1,sh:B,trainedWithAntialiasing:!!h})})}return new Promise(d=>{d({mode:0,data:f,hasVertexColors:!1,trainedWithAntialiasing:!!h})})}const Ht=.28209479177387814;async function kt(r,e,t){return await new Promise((o,n)=>{const a=t.createCanvasImage();if(!a)throw new Error("Failed to create ImageBitmap");a.onload=()=>{try{const h=t.createCanvas(a.width,a.height);if(!h)throw new Error("Failed to create canvas");const i=h.getContext("2d");if(!i)throw new Error("Failed to get 2D context");i.drawImage(a,0,0);const _=i.getImageData(0,0,h.width,h.height);o({bits:new Uint8Array(_.data.buffer),width:_.width})}catch(h){n(`Error loading image ${a.src} with exception: ${h}`)}},a.onerror=h=>{n(`Error loading image ${a.src} with exception: ${h}`)},a.crossOrigin="anonymous";let l;if(typeof r=="string"){if(!e)throw new Error("filename is required when using a URL");a.src=r+e}else{const h=new Blob([r],{type:"image/webp"});l=URL.createObjectURL(h),a.src=l}})}async function Us(r,e,t){const s=r.count?r.count:r.means.shape[0],o=32,n=new ArrayBuffer(o*s),a=new Float32Array(n),l=new Float32Array(n),h=new Uint8ClampedArray(n),i=new Uint8ClampedArray(n),_=c=>Math.sign(c)*(Math.exp(Math.abs(c))-1),u=e[0].bits,f=e[1].bits;if(!Array.isArray(r.means.mins)||!Array.isArray(r.means.maxs))throw new Error("Missing arrays in SOG data.");for(let c=0;c(c/255-.5)*2/Math.SQRT2,E=e[3].bits;for(let c=0;c{b({mode:0,data:n,hasVertexColors:!1,sh:y})})}return await new Promise(c=>{c({mode:0,data:n,hasVertexColors:!1})})}async function Rt(r,e,t){let s,o;if(r instanceof Map){o=r;const l=o.get("meta.json");if(!l)throw new Error("meta.json not found in files Map");s=JSON.parse(new TextDecoder().decode(l))}else s=r;const n=[...s.means.files,...s.scales.files,...s.quats.files,...s.sh0.files];s.shN&&n.push(...s.shN.files);const a=await Promise.all(n.map(async l=>{if(o&&o.has(l)){const h=o.get(l);return await kt(h,l,t.getEngine())}else return await kt(e,l,t.getEngine())}));return await Us(s,a,t)}class ee{constructor(e=ee._DefaultLoadingOptions){this.name=Re.name,this._assetContainer=null,this.extensions=Re.extensions,this._loadingOptions=e}createPlugin(e){return new ee(e[Re.name])}async importMeshAsync(e,t,s,o,n,a){return await this._parseAsync(e,t,s,o).then(l=>({meshes:l,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}static _BuildPointCloud(e,t){if(!t.byteLength)return!1;const s=new Uint8Array(t),o=new Float32Array(t),n=32,a=s.length/n,l=function(h,i){const _=o[8*i+0],u=o[8*i+1],f=o[8*i+2];h.position=new T(_,u,f);const p=s[n*i+24+0]/255,m=s[n*i+24+1]/255,C=s[n*i+24+2]/255;h.color=new L(p,m,C,1)};return e.addPoints(a,l),!0}static _BuildMesh(e,t){const s=new Ie("PLYMesh",e),o=new Uint8Array(t.data),n=new Float32Array(t.data),a=32,l=o.length/a,h=[],i=new Ne;for(let _=0;_"u"&&await as.LoadScriptAsync(this._loadingOptions.deflateURL??"https://unpkg.com/fflate/umd/index.js"),t=window.fflate);const{unzipSync:s}=t,o=s(e),n=new Map;for(const[a,l]of Object.entries(o))n.set(a,l);return n}_parseAsync(e,t,s,o){const n=[],a=u=>{t._blockEntityCollection=!!this._assetContainer;const f=this._loadingOptions.gaussianSplattingMesh??new D("GaussianSplatting",null,t,this._loadingOptions.keepInRam);f._parentContainer=this._assetContainer,n.push(f),f.updateData(u.data,u.sh,{flipY:!1}),f.scaling.y*=-1,f.computeWorldMatrix(!0),t._blockEntityCollection=!1};if(typeof s=="string"){const u=JSON.parse(s);if(u&&u.means&&u.scales&&u.quats&&u.sh0)return new Promise(f=>{Rt(u,o,t).then(p=>{a(p),f(n)}).catch(()=>{throw new Error("Failed to parse SOG data.")})})}const l=s instanceof ArrayBuffer?new Uint8Array(s):s;if(l[0]===80&&l[1]===75)return new Promise(u=>{this._unzipWithFFlateAsync(l).then(f=>{Rt(f,o,t).then(p=>{a(p),u(n)}).catch(()=>{throw new Error("Failed to parse SOG zip data.")})})});const h=new ReadableStream({start(u){u.enqueue(new Uint8Array(s)),u.close()}}),i=new DecompressionStream("gzip"),_=h.pipeThrough(i);return new Promise(u=>{new Response(_).arrayBuffer().then(f=>{Bs(f,t,this._loadingOptions).then(p=>{t._blockEntityCollection=!!this._assetContainer;const m=this._loadingOptions.gaussianSplattingMesh??new D("GaussianSplatting",null,t,this._loadingOptions.keepInRam);if(p.trainedWithAntialiasing){const C=m.material;C.kernelSize=.1,C.compensation=!0}m._parentContainer=this._assetContainer,n.push(m),m.updateData(p.data,p.sh,{flipY:!1}),this._loadingOptions.flipY||(m.scaling.y*=-1,m.computeWorldMatrix(!0)),t._blockEntityCollection=!1,this.applyAutoCameraLimits(p,t),u(n)})}).catch(()=>{ee._ConvertPLYToSplat(s).then(async f=>{switch(t._blockEntityCollection=!!this._assetContainer,f.mode){case 0:{const p=this._loadingOptions.gaussianSplattingMesh??new D("GaussianSplatting",null,t,this._loadingOptions.keepInRam);switch(p._parentContainer=this._assetContainer,n.push(p),p.updateData(f.data,f.sh,{flipY:!1}),p.scaling.y*=-1,f.chirality==="RightHanded"&&(p.scaling.y*=-1),f.upAxis){case"X":p.rotation=new T(0,0,Math.PI/2);break;case"Y":p.rotation=new T(0,0,Math.PI);break;case"Z":p.rotation=new T(-Math.PI/2,Math.PI,0);break}p.computeWorldMatrix(!0)}break;case 1:{const p=new Fs("PointCloud",1,t);ee._BuildPointCloud(p,f.data)?await p.buildMeshAsync().then(m=>{n.push(m)}):p.dispose()}break;case 2:if(f.faces)n.push(ee._BuildMesh(t,f));else throw new Error("PLY mesh doesn't contain face informations.");break;default:throw new Error("Unsupported Splat mode")}t._blockEntityCollection=!1,this.applyAutoCameraLimits(f,t),u(n)})})})}applyAutoCameraLimits(e,t){if(!this._loadingOptions.disableAutoCameraLimits&&(e.safeOrbitCameraRadiusMin!==void 0||e.safeOrbitCameraElevationMinMax!==void 0)&&t.activeCamera?.getClassName()==="ArcRotateCamera"){const s=t.activeCamera;e.safeOrbitCameraElevationMinMax&&(s.lowerBetaLimit=Math.PI*.5-e.safeOrbitCameraElevationMinMax[1],s.upperBetaLimit=Math.PI*.5-e.safeOrbitCameraElevationMinMax[0]),e.safeOrbitCameraRadiusMin&&(s.lowerRadiusLimit=e.safeOrbitCameraRadiusMin)}}loadAssetContainerAsync(e,t,s){const o=new cs(e);return this._assetContainer=o,this.importMeshAsync(null,e,t,s).then(n=>{for(const a of n.meshes)o.meshes.push(a);return this._assetContainer=null,o}).catch(n=>{throw this._assetContainer=null,n})}loadAsync(e,t,s){return this.importMeshAsync(null,e,t,s).then(()=>{})}static _ConvertPLYToSplat(e){const t=new Uint8Array(e),s=new TextDecoder().decode(t.slice(0,1024*10)),o=`end_header -`,n=s.indexOf(o);if(n<0||!s)return new Promise(x=>{x({mode:0,data:e,rawSplat:!0})});const a=parseInt(/element vertex (\d+)\n/.exec(s)[1]),l=/element face (\d+)\n/.exec(s);let h=0;l&&(h=parseInt(l[1]));const i=/element chunk (\d+)\n/.exec(s);let _=0;i&&(_=parseInt(i[1]));let u=0,f=0;const p={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0},m={Vertex:0,Chunk:1,SH:2,Float_Tuple:3,Float:4,Uchar:5};let C=m.Chunk;const E=[],c=s.slice(0,n).split(` -`),g={};for(const x of c)if(x.startsWith("property ")){const[,v,d]=x.split(" ");if(C==m.Chunk)f+=p[v];else if(C==m.Vertex)E.push({name:d,type:v,offset:u}),u+=p[v];else if(C==m.SH)E.push({name:d,type:v,offset:u});else if(C==m.Float_Tuple){const y=new DataView(e,f,p.float*2);g.safeOrbitCameraElevationMinMax=[y.getFloat32(0,!0),y.getFloat32(4,!0)]}else if(C==m.Float){const y=new DataView(e,f,p.float);g.safeOrbitCameraRadiusMin=y.getFloat32(0,!0)}else if(C==m.Uchar){const y=new DataView(e,f,p.uchar);d=="up_axis"?g.upAxis=y.getUint8(0)==0?"X":y.getUint8(0)==1?"Y":"Z":d=="chirality"&&(g.chirality=y.getUint8(0)==0?"LeftHanded":"RightHanded")}p[v]||de.Warn(`Unsupported property type: ${v}.`)}else if(x.startsWith("element ")){const[,v]=x.split(" ");v=="chunk"?C=m.Chunk:v=="vertex"?C=m.Vertex:v=="sh"?C=m.SH:v=="safe_orbit_camera_elevation_min_max_radians"?C=m.Float_Tuple:v=="safe_orbit_camera_radius_min"?C=m.Float:(v=="up_axis"||v=="chirality")&&(C=m.Uchar)}const S=u,w=f;return D.ConvertPLYWithSHToSplatAsync(e).then(async x=>{const v=new DataView(e,n+o.length);let d=w*_+S*a;const y=[];if(h)for(let z=0;z{z({mode:0,data:x.buffer,sh:x.sh,faces:y,hasVertexColors:!1,compressed:!0,rawSplat:!1})});let A=0,H=0;const B=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],b=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"];for(let z=0;z{z({...g,mode:W,data:x.buffer,sh:x.sh,faces:y,hasVertexColors:!!H,compressed:!1,rawSplat:!1})})})}}ee._DefaultLoadingOptions={keepInRam:!1,flipY:!1};is(new ee);export{ee as SPLATFileLoader}; diff --git a/assets/ssao2.fragment-BDAuZkgJ.js b/assets/ssao2.fragment-BDAuZkgJ.js deleted file mode 100644 index a6f0026f2f3a4e9c6c043c4a280318ec6e669036..0000000000000000000000000000000000000000 --- a/assets/ssao2.fragment-BDAuZkgJ.js +++ /dev/null @@ -1,68 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="ssao2PixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d; -#ifdef SSAO -const scales: array=array( -0.1, -0.11406250000000001, -0.131640625, -0.15625, -0.187890625, -0.2265625, -0.272265625, -0.325, -0.384765625, -0.4515625, -0.525390625, -0.60625, -0.694140625, -0.7890625, -0.891015625, -1.0 -);uniform near: f32;uniform radius: f32;var depthSamplerSampler: sampler;var depthSampler: texture_2d;var randomSamplerSampler: sampler;var randomSampler: texture_2d;var normalSamplerSampler: sampler;var normalSampler: texture_2d;uniform randTextureTiles: f32;uniform samplesFactor: f32;uniform sampleSphere: array;uniform totalStrength: f32;uniform base: f32; -#ifdef ORTHOGRAPHIC_CAMERA -uniform viewport: vec4f; -#else -uniform xViewport: f32;uniform yViewport: f32; -#endif -uniform depthProjection: mat3x3f;uniform maxZ: f32;uniform minZAspect: f32;uniform texelSize: vec2f;uniform projection: mat4x4f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var random: vec3f=textureSampleLevel(randomSampler,randomSamplerSampler,input.vUV*uniforms.randTextureTiles,0.0).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r;var depthSign: f32=sign(depth);depth=depth*depthSign;var normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.0).rgb;var occlusion: f32=0.0;var correctedRadius: f32=min(uniforms.radius,uniforms.minZAspect*depth/uniforms.near); -#ifdef ORTHOGRAPHIC_CAMERA -var vViewRay: vec3f= vec3f(mix(uniforms.viewport.x,uniforms.viewport.y,input.vUV.x),mix(uniforms.viewport.z,uniforms.viewport.w,input.vUV.y),depthSign); -#else -var vViewRay: vec3f= vec3f((input.vUV.x*2.0-1.0)*uniforms.xViewport,(input.vUV.y*2.0-1.0)*uniforms.yViewport,depthSign); -#endif -var vDepthFactor: vec3f=uniforms.depthProjection* vec3f(1.0,1.0,depth);var origin: vec3f=vViewRay*vDepthFactor;var rvec: vec3f=random*2.0-1.0;rvec.z=0.0;var dotProduct: f32=dot(rvec,normal);rvec=select( vec3f(-rvec.y,0.0,rvec.x),rvec,1.0-abs(dotProduct)>1e-2);var tangent: vec3f=normalize(rvec-normal*dot(rvec,normal));var bitangent: vec3f=cross(normal,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,normal);var difference: f32;for (var i: i32=0; i1.0 || offset.y>1.0) {continue;} -var sampleDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;var rangeCheck: f32=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;} -occlusion=occlusion*(1.0-smoothstep(uniforms.maxZ*0.75,uniforms.maxZ,depth));var ao: f32=1.0-uniforms.totalStrength*occlusion*uniforms.samplesFactor;var result: f32=clamp(ao+uniforms.base,0.0,1.0);fragmentOutputs.color= vec4f( vec3f(result),1.0);} -#else -#ifdef BLUR -uniform outSize: f32;uniform soften: f32;uniform tolerance: f32;uniform samples: i32; -#ifndef BLUR_BYPASS -var depthSamplerSampler: sampler;var depthSampler: texture_2d; -#ifdef BLUR_LEGACY -fn blur13Bilateral(image: texture_2d,imageSampler: sampler,uv: vec2f,step: vec2f)->f32 {var result: f32=0.0;var off1: vec2f= vec2f(1.411764705882353)*step;var off2: vec2f= vec2f(3.2941176470588234)*step;var off3: vec2f= vec2f(5.176470588235294)*step;var compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv,0.0).r);var sampleDepth: f32;var weight: f32;var weightSum: f32=30.0;result+=textureSampleLevel(image,imageSampler,uv,0.0).r*30.0;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv+off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv-off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off3,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off3,0.0).r*weight;return result/weightSum;} -#endif -#endif -@fragment -fn main(input: FragmentInputs)->FragmentOutputs {var result: f32=0.0; -#ifdef BLUR_BYPASS -result=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0).r; -#else -#ifdef BLUR_H -var step: vec2f= vec2f(1.0/uniforms.outSize,0.0); -#else -var step: vec2f= vec2f(0.0,1.0/uniforms.outSize); -#endif -#ifdef BLUR_LEGACY -result=blur13Bilateral(textureSampler,textureSamplerSampler,input.vUV,step); -#else -var compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r);var weightSum: f32=0.0;for (var i: i32=-uniforms.samples; i1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);vec3 tangent=normalize(rvec-normal*dot(rvec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float difference;for (int i=0; i1.0 || offset.y>1.0) {continue;} -float sampleDepth=abs(textureLod(depthSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;float rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;} -occlusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor=vec4(vec3(result),1.0);} -#endif -#ifdef BLUR -uniform float outSize;uniform float soften;uniform float tolerance;uniform int samples; -#ifndef BLUR_BYPASS -uniform sampler2D depthSampler; -#ifdef BLUR_LEGACY -#define inline -float blur13Bilateral(sampler2D image,vec2 uv,vec2 step) {float result=0.0;vec2 off1=vec2(1.411764705882353)*step;vec2 off2=vec2(3.2941176470588234)*step;vec2 off3=vec2(5.176470588235294)*step;float compareDepth=abs(textureLod(depthSampler,uv,0.0).r);float sampleDepth;float weight;float weightSum=30.0;result+=textureLod(image,uv,0.0).r*30.0;sampleDepth=abs(textureLod(depthSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv+off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv-off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off3,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off3,0.0).r*weight;return result/weightSum;} -#endif -#endif -void main() -{float result=0.0; -#ifdef BLUR_BYPASS -result=textureLod(textureSampler,vUV,0.0).r; -#else -#ifdef BLUR_H -vec2 step=vec2(1.0/outSize,0.0); -#else -vec2 step=vec2(0.0,1.0/outSize); -#endif -#ifdef BLUR_LEGACY -result=blur13Bilateral(textureSampler,vUV,step); -#else -float compareDepth=abs(textureLod(depthSampler,vUV,0.0).r);float weightSum=0.0;for (int i=-samples; ii.map(i=>d[i]); -import{aE as b,b1 as f,bA as x,T as R,V as C,ah as T,bn as E,c as B,aq as w,L as g,bB as F,aA as S,e as A,_ as n,s as a,R as I}from"./index-GY9JDBGV.js";import{P as v,a as d}from"./postProcessRenderEffect-Bi0eHNy8.js";import{G as V}from"./geometryBufferRenderer-DviLW_b_.js";import"./postProcessRenderPipelineManagerSceneComponent-C7LDCSPo.js";import{af as P}from"./index-DydPgVMC.js";import{R as H}from"./rawTexture-BDsvmix4.js";import"./clipPlaneFragment-CmkC_xqs.js";import"./bumpFragment-Dn7_UB6Q.js";import"./helperFunctions-tBt4f_K3.js";import"./bakedVertexAnimation-CaTOZtWZ.js";import"./morphTargetsVertex-CUt9TeiZ.js";import"./instancesDeclaration-CYMjgQ6_.js";import"./sceneUboDeclaration-3A3jW23h.js";import"./clipPlaneVertex-CThh3FEJ.js";import"./bumpVertex-dKv8gF7O.js";class M{constructor(){this.enabled=!1,this.name="ssao2",this.texturesRequired=[6,5]}}class l extends b{_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(P(()=>import("./ssao2.fragment-BDAuZkgJ.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))):t.push(P(()=>import("./ssao2.fragment-DonR0Tmk.js"),__vite__mapDeps([4,1,2,3]),import.meta.url))}get textureWidth(){return this._textureWidth}set textureWidth(e){this._textureWidth!==e&&(this._textureWidth=e)}get textureHeight(){return this._textureHeight}set textureHeight(e){this._textureHeight!==e&&(this._textureHeight=e)}set samples(e){this._samples=e,this.updateEffect(),this._sampleSphere=this._generateHemisphere()}get samples(){return this._samples}set epsilon(e){this._epsilon=e,this.updateEffect()}get epsilon(){return this._epsilon}updateEffect(){super.updateEffect(this._getDefinesForSSAO())}constructor(e,t,s){super({...s,name:e,engine:t.getEngine(),useShaderStore:!0,useAsPostProcess:!0,fragmentShader:l.FragmentUrl,uniforms:l.Uniforms,samplers:l.Samplers,defines:`#define SSAO -#define SAMPLES 8 -#define EPSILON 0.0001`,shaderLanguage:t.getEngine().isWebGPU?1:0}),this.camera=null,this._textureWidth=0,this._textureHeight=0,this._samples=8,this.totalStrength=1,this.radius=2,this.maxZ=100,this.minZAspect=.2,this.base=0,this._epsilon=.02,this._bits=new Uint32Array(1),this._scene=t,this._createRandomTexture(),this.updateEffect(),this._sampleSphere=this._generateHemisphere()}bind(e=!1){super.bind(e);const t=this._drawWrapper.effect,s=this.camera;if(!s)return;const r=s.getProjectionMatrix();if(t.setArray3("sampleSphere",this._sampleSphere),t.setFloat("randTextureTiles",32),t.setFloat("samplesFactor",1/this.samples),t.setFloat("totalStrength",this.totalStrength),t.setFloat2("texelSize",1/this.textureWidth,1/this.textureHeight),t.setFloat("radius",this.radius),t.setFloat("maxZ",this.maxZ),t.setFloat("minZAspect",this.minZAspect),t.setFloat("base",this.base),t.setFloat("near",s.minZ),s.mode===f.PERSPECTIVE_CAMERA){t.setMatrix3x3("depthProjection",l.PERSPECTIVE_DEPTH_PROJECTION);const i=Math.tan(s.fov/2);s.fovMode===f.FOVMODE_VERTICAL_FIXED?(t.setFloat("xViewport",i*this._scene.getEngine().getAspectRatio(s,!0)),t.setFloat("yViewport",i)):(t.setFloat("xViewport",i),t.setFloat("yViewport",i/this._scene.getEngine().getAspectRatio(s,!0)))}else{const i=this._scene.getEngine().getRenderWidth()/2,h=this._scene.getEngine().getRenderHeight()/2,m=s.orthoLeft??-i,u=s.orthoRight??i,_=s.orthoBottom??-h,y=s.orthoTop??h;t.setMatrix3x3("depthProjection",l.ORTHO_DEPTH_PROJECTION),t.setFloat4("viewport",m,u,_,y)}t.setMatrix("projection",r),t.setTexture("randomSampler",this._randomTexture)}dispose(){this._randomTexture.dispose(),super.dispose()}_createRandomTexture(){const t=new Uint8Array(65536),s=T.Zero();for(let i=0;i>16)>>>0,this._bits[0]=(this._bits[0]&1431655765)<<1|(this._bits[0]&2863311530)>>>1>>>0,this._bits[0]=(this._bits[0]&858993459)<<2|(this._bits[0]&3435973836)>>>2>>>0,this._bits[0]=(this._bits[0]&252645135)<<4|(this._bits[0]&4042322160)>>>4>>>0,this._bits[0]=(this._bits[0]&16711935)<<8|(this._bits[0]&4278255360)>>>8>>>0,this._bits[0]*23283064365386963e-26}_hammersley(e,t){return[e/t,this._radicalInverseVdC(e)]}_hemisphereSampleUniform(e,t){const s=t*2*Math.PI,r=1-e*.85,i=Math.sqrt(1-r*r);return new C(Math.cos(s)*i,Math.sin(s)*i,r)}_generateHemisphere(){const e=this.samples,t=[];let s,r=0;for(;rimport("./ssao2.fragment-BDAuZkgJ.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))):t.push(P(()=>import("./ssao2.fragment-DonR0Tmk.js"),__vite__mapDeps([4,1,2,3]),import.meta.url))}constructor(e,t=null,s,r){super({...r,name:e,engine:t||E.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:p.FragmentUrl,uniforms:p.Uniforms,samplers:p.Samplers,defines:`#define BLUR -`+(s?`#define BLUR_H -`:"")}),this._bypassBlur=!1,this.textureSize=0,this.bilateralSamples=16,this.bilateralSoften=0,this.bilateralTolerance=0,this._expensiveBlur=!0,this._isHorizontal=s;const i=this._getDefinesForBlur(this.expensiveBlur,this.bypassBlur),h=this._getSamplersForBlur(this.bypassBlur);this.updateEffect(i,null,h)}set bypassBlur(e){const t=this._getDefinesForBlur(this.expensiveBlur,e),s=this._getSamplersForBlur(e);this.updateEffect(t,null,s),this._bypassBlur=e}get bypassBlur(){return this._bypassBlur}set expensiveBlur(e){const t=this._getDefinesForBlur(e,this._bypassBlur);this.updateEffect(t),this._expensiveBlur=e}get expensiveBlur(){return this._expensiveBlur}bind(e=!1){super.bind(e);const t=this._drawWrapper.effect;t.setFloat("outSize",this.textureSize),t.setInt("samples",this.bilateralSamples),t.setFloat("soften",this.bilateralSoften),t.setFloat("tolerance",this.bilateralTolerance)}_getSamplersForBlur(e){return e?["textureSampler"]:["textureSampler","depthSampler"]}_getDefinesForBlur(e,t){let s=`#define BLUR -`;return t&&(s+=`#define BLUR_BYPASS -`),e||(s+=`#define BLUR_LEGACY -`),this._isHorizontal?s+`#define BLUR_H -`:s}}p.FragmentUrl="ssao2";p.Uniforms=["outSize","samples","soften","tolerance"];p.Samplers=["textureSampler","depthSampler"];class c extends b{_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(P(()=>import("./ssaoCombine.fragment-DSe15RT-.js"),__vite__mapDeps([5,1,2,3]),import.meta.url))):t.push(P(()=>import("./ssaoCombine.fragment-CRlXf3-b.js"),__vite__mapDeps([6,1,2,3]),import.meta.url))}constructor(e,t=null,s){super({...s,name:e,engine:t||E.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:c.FragmentUrl,uniforms:c.Uniforms,samplers:c.Samplers}),this.camera=null,this.useViewportInCombineStage=!0}bind(e=!1){super.bind(e);const t=this._drawWrapper.effect;if(this.camera){const s=this.camera.viewport;this.useViewportInCombineStage?t.setVector4("viewport",B.Vector4[0].copyFromFloats(s.x,s.y,s.width,s.height)):t.setVector4("viewport",B.Vector4[0].copyFromFloats(0,0,1,1))}}}c.FragmentUrl="ssaoCombine";c.Uniforms=["viewport"];c.Samplers=["originalColor"];class U{get camera(){return this._ssaoPostProcess.camera}set camera(e){this._ssaoPostProcess.camera=e,this._ssaoCombinePostProcess.camera=e}set samples(e){this._ssaoPostProcess.samples=e}get samples(){return this._ssaoPostProcess.samples}get totalStrength(){return this._ssaoPostProcess.totalStrength}set totalStrength(e){this._ssaoPostProcess.totalStrength=e}get radius(){return this._ssaoPostProcess.radius}set radius(e){this._ssaoPostProcess.radius=e}get maxZ(){return this._ssaoPostProcess.maxZ}set maxZ(e){this._ssaoPostProcess.maxZ=e}get minZAspect(){return this._ssaoPostProcess.minZAspect}set minZAspect(e){this._ssaoPostProcess.minZAspect=e}get base(){return this._ssaoPostProcess.base}set base(e){this._ssaoPostProcess.base=e}get epsilon(){return this._ssaoPostProcess.epsilon}set epsilon(e){this._ssaoPostProcess.epsilon=e}set bypassBlur(e){this._ssaoBlurXPostProcess.bypassBlur=e,this._ssaoBlurYPostProcess.bypassBlur=e}get bypassBlur(){return this._ssaoBlurXPostProcess.bypassBlur}set expensiveBlur(e){this._ssaoBlurXPostProcess.expensiveBlur=e,this._ssaoBlurYPostProcess.expensiveBlur=e}get expensiveBlur(){return this._ssaoBlurXPostProcess.expensiveBlur}get bilateralSamples(){return this._ssaoBlurXPostProcess.bilateralSamples}set bilateralSamples(e){this._ssaoBlurXPostProcess.bilateralSamples=e,this._ssaoBlurYPostProcess.bilateralSamples=e}get bilateralSoften(){return this._ssaoBlurXPostProcess.bilateralSoften}set bilateralSoften(e){this._ssaoBlurXPostProcess.bilateralSoften=e,this._ssaoBlurYPostProcess.bilateralSoften=e}get bilateralTolerance(){return this._ssaoBlurXPostProcess.bilateralTolerance}set bilateralTolerance(e){this._ssaoBlurXPostProcess.bilateralTolerance=e,this._ssaoBlurYPostProcess.bilateralTolerance=e}get useViewportInCombineStage(){return this._ssaoCombinePostProcess.useViewportInCombineStage}set useViewportInCombineStage(e){this._ssaoCombinePostProcess.useViewportInCombineStage=e}isReady(){return this._ssaoPostProcess.isReady()&&this._ssaoBlurXPostProcess.isReady()&&this._ssaoBlurYPostProcess.isReady()&&this._ssaoCombinePostProcess.isReady()}constructor(e,t){this.name=e,this._scene=t,this._ssaoPostProcess=new l(this.name,this._scene),this._ssaoBlurXPostProcess=new p(this.name+" BlurX",this._scene.getEngine(),!0),this._ssaoBlurYPostProcess=new p(this.name+" BlurY",this._scene.getEngine(),!1),this._ssaoCombinePostProcess=new c(this.name+" Combiner",this._scene.getEngine())}dispose(){this._ssaoPostProcess?.dispose(),this._ssaoBlurXPostProcess?.dispose(),this._ssaoBlurYPostProcess?.dispose(),this._ssaoCombinePostProcess?.dispose()}}class o extends v{get totalStrength(){return this._thinSSAORenderingPipeline.totalStrength}set totalStrength(e){this._thinSSAORenderingPipeline.totalStrength=e}get maxZ(){return this._thinSSAORenderingPipeline.maxZ}set maxZ(e){this._thinSSAORenderingPipeline.maxZ=e}get minZAspect(){return this._thinSSAORenderingPipeline.minZAspect}set minZAspect(e){this._thinSSAORenderingPipeline.minZAspect=e}set epsilon(e){this._thinSSAORenderingPipeline.epsilon=e}get epsilon(){return this._thinSSAORenderingPipeline.epsilon}set samples(e){this._thinSSAORenderingPipeline.samples=e}get samples(){return this._thinSSAORenderingPipeline.samples}set textureSamples(e){this._textureSamples=e,this._prePassRenderer?this._prePassRenderer.samples=e:this._originalColorPostProcess.samples=e}get textureSamples(){return this._textureSamples}get _geometryBufferRenderer(){return this._forceGeometryBuffer?this._forcedGeometryBuffer??this._scene.geometryBufferRenderer:null}get _prePassRenderer(){return this._forceGeometryBuffer?null:this._scene.prePassRenderer}get radius(){return this._thinSSAORenderingPipeline.radius}set radius(e){this._thinSSAORenderingPipeline.radius=e}get base(){return this._thinSSAORenderingPipeline.base}set base(e){this._thinSSAORenderingPipeline.base=e}set bypassBlur(e){this._thinSSAORenderingPipeline.bypassBlur=e}get bypassBlur(){return this._thinSSAORenderingPipeline.bypassBlur}set expensiveBlur(e){this._thinSSAORenderingPipeline.expensiveBlur=e}get expensiveBlur(){return this._thinSSAORenderingPipeline.expensiveBlur}get bilateralSamples(){return this._thinSSAORenderingPipeline.bilateralSamples}set bilateralSamples(e){this._thinSSAORenderingPipeline.bilateralSamples=e}get bilateralSoften(){return this._thinSSAORenderingPipeline.bilateralSoften}set bilateralSoften(e){this._thinSSAORenderingPipeline.bilateralSoften=e}get bilateralTolerance(){return this._thinSSAORenderingPipeline.bilateralTolerance}set bilateralTolerance(e){this._thinSSAORenderingPipeline.bilateralTolerance=e}static get IsSupported(){const e=w.LastCreatedEngine;return e?e._features.supportSSAO2:!1}get useViewportInCombineStage(){return this._thinSSAORenderingPipeline.useViewportInCombineStage}set useViewportInCombineStage(e){this._thinSSAORenderingPipeline.useViewportInCombineStage=e}get scene(){return this._scene}constructor(e,t,s,r,i=!1,h=0){if(super(t.getEngine(),e),this.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",this.SSAORenderEffect="SSAORenderEffect",this.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",this.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",this.SSAOCombineRenderEffect="SSAOCombineRenderEffect",this._textureSamples=1,this._forcedGeometryBuffer=null,this._forceGeometryBuffer=!1,this._currentCameraMode=-1,this._thinSSAORenderingPipeline=new U(e,t),this._scene=t,this._ratio=s,this._textureType=h,i instanceof V?(this._forceGeometryBuffer=!0,this._forcedGeometryBuffer=i):this._forceGeometryBuffer=i,!this.isSupported){g.Error("The current engine does not support SSAO 2.");return}const m=this._ratio.ssaoRatio||s,u=this._ratio.blurRatio||s;this._forceGeometryBuffer?(this._forcedGeometryBuffer||t.enableGeometryBufferRenderer(),t.geometryBufferRenderer?.generateNormalsInWorldSpace&&g.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!")):(t.enablePrePassRenderer(),t.prePassRenderer?.generateNormalsInWorldSpace&&g.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!")),this._originalColorPostProcess=new F("SSAOOriginalSceneColor",1,null,R.BILINEAR_SAMPLINGMODE,t.getEngine(),void 0,this._textureType),this._originalColorPostProcess.onBeforeRenderObservable.add(()=>{const _=this._scene.activeCamera;this._thinSSAORenderingPipeline._ssaoPostProcess.camera=_,_&&this._currentCameraMode!==_.mode&&(this._currentCameraMode=_.mode,this._thinSSAORenderingPipeline._ssaoPostProcess.updateEffect())}),this._originalColorPostProcess.samples=this.textureSamples,this._createSSAOPostProcess(1,h),this._createBlurPostProcess(m,u,this._textureType),this._createSSAOCombinePostProcess(u,this._textureType),this.addEffect(new d(t.getEngine(),this.SSAOOriginalSceneColorEffect,()=>this._originalColorPostProcess,!0)),this.addEffect(new d(t.getEngine(),this.SSAORenderEffect,()=>this._ssaoPostProcess,!0)),this.addEffect(new d(t.getEngine(),this.SSAOBlurHRenderEffect,()=>this._blurHPostProcess,!0)),this.addEffect(new d(t.getEngine(),this.SSAOBlurVRenderEffect,()=>this._blurVPostProcess,!0)),this.addEffect(new d(t.getEngine(),this.SSAOCombineRenderEffect,()=>this._ssaoCombinePostProcess,!0)),t.postProcessRenderPipelineManager.addPipeline(this),r&&t.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e,r)}getClassName(){return"SSAO2RenderingPipeline"}dispose(e=!1){for(let t=0;t{const m=this._ratio.blurRatio||this._ratio,u=r?this._originalColorPostProcess.width*m:this._originalColorPostProcess.height*m,_=r?this._originalColorPostProcess.width:this._originalColorPostProcess.height;this._thinSSAORenderingPipeline._ssaoBlurXPostProcess.textureSize=u>0?u:_,this._thinSSAORenderingPipeline._ssaoBlurYPostProcess.textureSize=u>0?u:_,this._geometryBufferRenderer?h.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[0]):this._prePassRenderer&&h.setTexture("depthSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)])},i.samples=this.textureSamples,i.autoClear=!1,i}_getTextureSize(){const e=this._scene.getEngine(),t=this._prePassRenderer;let s={width:e.getRenderWidth(),height:e.getRenderHeight()};if(t&&this._scene.activeCamera?._getFirstPostProcess()===this._ssaoPostProcess){const r=t.getRenderTarget();r&&r.textures&&(s=r.textures[t.getIndex(4)].getSize())}else this._ssaoPostProcess.inputTexture&&(s.width=this._ssaoPostProcess.inputTexture.width,s.height=this._ssaoPostProcess.inputTexture.height);return s}_createSSAOPostProcess(e,t){this._ssaoPostProcess=new S("ssao",l.FragmentUrl,{size:e,samplingMode:2,engine:this._scene.getEngine(),textureType:t,effectWrapper:this._thinSSAORenderingPipeline._ssaoPostProcess}),this._ssaoPostProcess.autoClear=!1,this._ssaoPostProcess.onApply=s=>{this._geometryBufferRenderer?(s.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[0]),s.setTexture("normalSampler",this._geometryBufferRenderer.getGBuffer().textures[1])):this._prePassRenderer&&(s.setTexture("depthSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]),s.setTexture("normalSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)]));const r=this._getTextureSize();this._thinSSAORenderingPipeline._ssaoPostProcess.textureWidth=r.width,this._thinSSAORenderingPipeline._ssaoPostProcess.textureHeight=r.height},this._ssaoPostProcess.samples=this.textureSamples,this._forceGeometryBuffer||(this._ssaoPostProcess._prePassEffectConfiguration=new M)}_createSSAOCombinePostProcess(e,t){this._ssaoCombinePostProcess=new S("ssaoCombine",c.FragmentUrl,{size:e,samplingMode:2,engine:this._scene.getEngine(),textureType:t,effectWrapper:this._thinSSAORenderingPipeline._ssaoCombinePostProcess}),this._ssaoCombinePostProcess.onApply=s=>{this._thinSSAORenderingPipeline._ssaoCombinePostProcess.camera=this._scene.activeCamera,s.setTextureFromPostProcessOutput("originalColor",this._originalColorPostProcess)},this._ssaoCombinePostProcess.autoClear=!1,this._ssaoCombinePostProcess.samples=this.textureSamples}serialize(){const e=A.Serialize(this);return e.customType="SSAO2RenderingPipeline",e}static Parse(e,t,s){return A.Parse(()=>new o(e._name,t,e._ratio,void 0,e._forceGeometryBuffer,e._textureType),e,t,s)}}n([a()],o.prototype,"totalStrength",null);n([a()],o.prototype,"maxZ",null);n([a()],o.prototype,"minZAspect",null);n([a("epsilon")],o.prototype,"epsilon",null);n([a("samples")],o.prototype,"samples",null);n([a("textureSamples")],o.prototype,"_textureSamples",void 0);n([a()],o.prototype,"_forceGeometryBuffer",void 0);n([a()],o.prototype,"_ratio",void 0);n([a()],o.prototype,"_textureType",void 0);n([a()],o.prototype,"radius",null);n([a()],o.prototype,"base",null);n([a("bypassBlur")],o.prototype,"bypassBlur",null);n([a("expensiveBlur")],o.prototype,"expensiveBlur",null);n([a()],o.prototype,"bilateralSamples",null);n([a()],o.prototype,"bilateralSoften",null);n([a()],o.prototype,"bilateralTolerance",null);I("BABYLON.SSAO2RenderingPipeline",o);export{o as SSAO2RenderingPipeline}; diff --git a/assets/ssaoCombine.fragment-CRlXf3-b.js b/assets/ssaoCombine.fragment-CRlXf3-b.js deleted file mode 100644 index 85435f7329dedf1093e049855a9bb2d24f6831c8..0000000000000000000000000000000000000000 --- a/assets/ssaoCombine.fragment-CRlXf3-b.js +++ /dev/null @@ -1,8 +0,0 @@ -import{S as o}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="ssaoCombinePixelShader",r=`uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV; -#define CUSTOM_FRAGMENT_DEFINITIONS -void main(void) { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -vec2 uv=viewport.xy+vUV*viewport.zw;vec4 ssaoColor=texture2D(textureSampler,uv);vec4 sceneColor=texture2D(originalColor,uv);gl_FragColor=sceneColor*ssaoColor; -#define CUSTOM_FRAGMENT_MAIN_END -} -`;o.ShadersStore[e]||(o.ShadersStore[e]=r);const t={name:e,shader:r};export{t as ssaoCombinePixelShader}; diff --git a/assets/ssaoCombine.fragment-DSe15RT-.js b/assets/ssaoCombine.fragment-DSe15RT-.js deleted file mode 100644 index d413cee48e321383ff660f82a91b79fb6504707b..0000000000000000000000000000000000000000 --- a/assets/ssaoCombine.fragment-DSe15RT-.js +++ /dev/null @@ -1,9 +0,0 @@ -import{S as r}from"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";const e="ssaoCombinePixelShader",o=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d;var originalColorSampler: sampler;var originalColor: texture_2d;uniform viewport: vec4f; -#define CUSTOM_FRAGMENT_DEFINITIONS -@fragment -fn main(input: FragmentInputs)->FragmentOutputs { -#define CUSTOM_FRAGMENT_MAIN_BEGIN -var uv: vec2f=uniforms.viewport.xy+input.vUV*uniforms.viewport.zw;var ssaoColor: vec4f=textureSample(textureSampler,textureSamplerSampler,uv);var sceneColor: vec4f=textureSample(originalColor,originalColorSampler,uv);fragmentOutputs.color=sceneColor*ssaoColor; -#define CUSTOM_FRAGMENT_MAIN_END -} -`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=o);const i={name:e,shader:o};export{i as ssaoCombinePixelShaderWGSL}; diff --git a/assets/standardMaterial-Dw51Jj3C.js b/assets/standardMaterial-Dw51Jj3C.js deleted file mode 100644 index 0a247c89769b8ab056d2bfe55182b38413b956e6..0000000000000000000000000000000000000000 --- a/assets/standardMaterial-Dw51Jj3C.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./default.vertex-Ck1DuK1F.js","./index-GY9JDBGV.js","./index-DydPgVMC.js","./index-BSZrXtnz.css","./defaultUboDeclaration-D9mC3D5S.js","./sceneUboDeclaration-mnAEeY6M.js","./meshUboDeclaration-BeSl_gjF.js","./vertexColorMixing-BV8k1N8l.js","./helperFunctions-Wgh3PIP0.js","./bonesDeclaration-DUXz5WB4.js","./instancesVertex-BZz8JvZy.js","./instancesDeclaration-ConO0l1b.js","./mainUVVaryingDeclaration-Nm5IuqWV.js","./bumpVertexDeclaration-p9pSA1UA.js","./clipPlaneVertex-D5g8dBQb.js","./logDepthVertex-CfHieHf5.js","./shadowsVertex-DKtacRyL.js","./morphTargetsVertexDeclaration-BFlkwWcP.js","./logDepthDeclaration-CACrmPgQ.js","./morphTargetsVertex-W8O8GW2p.js","./bonesVertex-W7KXt3j6.js","./bakedVertexAnimation-Bs9it648.js","./bumpVertex-DVPnlCbV.js","./default.fragment-75ZDpbcd.js","./oitFragment-CXBNy3dk.js","./shadowsFragmentFunctions-CHKo52s6.js","./lightsFragmentFunctions-BGx5-0G-.js","./samplerFragmentDeclaration-Bn5G_87U.js","./fresnelFunction-xm2bLg9t.js","./imageProcessingFunctions-DMSN1d-p.js","./bumpFragment-DEyymZuF.js","./clipPlaneFragment-BmMK1U8A.js","./fogFragment-DjadYfQv.js","./decalFragment-zjU901jg.js","./lightFragment-Jwj6l9Y8.js","./default.vertex-BJO2DRWc.js","./vertexColorMixing-DoZiZfly.js","./defaultUboDeclaration-D-KK91Cl.js","./sceneUboDeclaration-3A3jW23h.js","./meshUboDeclaration-D9O4n0us.js","./helperFunctions-tBt4f_K3.js","./bakedVertexAnimation-CaTOZtWZ.js","./instancesDeclaration-CYMjgQ6_.js","./mainUVVaryingDeclaration-OlWPbGIv.js","./bumpVertexDeclaration-DMtCfYrP.js","./clipPlaneVertex-CThh3FEJ.js","./logDepthVertex-zXeqwUWs.js","./shadowsVertex-w5DW1avO.js","./morphTargetsVertex-CUt9TeiZ.js","./logDepthDeclaration-mFbnDVOm.js","./bumpVertex-dKv8gF7O.js","./pointCloudVertex-wpVdAlmJ.js","./default.fragment-DCtdE8mC.js","./oitFragment-cUdAGBvC.js","./shadowsFragmentFunctions-dMCKkVlT.js","./lightsFragmentFunctions-BfknEtlf.js","./lightFragment-CZjYZOQF.js","./bumpFragment-Dn7_UB6Q.js","./imageProcessingFunctions-BwYIAaLN.js","./clipPlaneFragment-CmkC_xqs.js","./fogFragment-M_o52SDz.js","./decalFragment-1pWMlRR5.js"])))=>i.map(i=>d[i]); -import{af as b}from"./index-DydPgVMC.js";import{C as m,n as w,D as Y,P as k,o as N,p as W,q as z,r as K,t as Z,u as y,v as x,w as j,x as Q,y as J,z as $,E as q,H as ee,F as te,J as v,K as se,N as ie,Q as re,U as ae,W as M,X as oe,Y as ne,Z as le,$ as ue,a0 as R,a1 as fe,a2 as he,a3 as Te,b as V,a4 as pe,a5 as Ee,a6 as de,e as G,a7 as f,a8 as _e,a9 as me,aa as ce,ab as Ae,ac as xe,_ as i,ad as _,ae as n,af as F,s as h,ag as L,R as Re}from"./index-GY9JDBGV.js";const D={effect:null,subMesh:null};class Pe extends Ae(xe){}class Se extends ce(Pe){constructor(t){super(t),this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.USE_VERTEX_PULLING=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.DECAL_AFTER_DETAIL=!1,this.rebuild()}}class Ie extends _e(me){}class s extends Ie{get isPrePassCapable(){return!this.disableDepthWrite}get canRenderToMRT(){return!0}constructor(t,a,T=!1){super(t,a,void 0,T||s.ForceGLSL),this._diffuseTexture=null,this._ambientTexture=null,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._specularTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._refractionTexture=null,this.ambientColor=new m(0,0,0),this.diffuseColor=new m(1,1,1),this.specularColor=new m(1,1,1),this.emissiveColor=new m(0,0,0),this.specularPower=64,this._useAlphaFromDiffuseTexture=!1,this._useEmissiveAsIllumination=!1,this._linkEmissiveWithDiffuse=!1,this._useSpecularOverAlpha=!1,this._useReflectionOverAlpha=!1,this._disableLighting=!1,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this._roughness=0,this.indexOfRefraction=.98,this.invertRefractionY=!0,this.alphaCutOff=.4,this._useLightmapAsShadowmap=!1,this._useReflectionFresnelFromSpecular=!1,this._useGlossinessFromSpecularMapAlpha=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._applyDecalMapAfterDetailMap=!1,this._shadersLoaded=!1,this._renderTargets=new w(16),this._globalAmbientColor=new m(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new Y(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new k,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),s.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),s.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return s.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||s.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===N.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==N.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(t,a,T=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const o=a._drawWrapper;if(o.effect&&this.isFrozen&&o._wasPreviouslyReady&&o._wasPreviouslyUsingInstances===T)return!0;a.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),a.materialDefines=new Se(this._eventInfo.defineNames));const l=this.getScene(),e=a.materialDefines;if(this._isReadyForSubMesh(a))return!0;const c=l.getEngine();e._needNormals=W(l,t,e,!0,this._maxSimultaneousLights,this._disableLighting),z(l,e);const P=this.needAlphaBlendingForMesh(t)&&this.getScene().useOrderIndependentTransparency;if(K(l,e,this.canRenderToMRT&&!P),Z(l,e,P),y.PrepareDefines(c.currentRenderPassId,t,e),e._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,e._needUVs=!1;for(let p=1;p<=6;++p)e["MAINUV"+p]=!1;if(l.texturesEnabled){if(e.DIFFUSEDIRECTUV=0,e.BUMPDIRECTUV=0,e.AMBIENTDIRECTUV=0,e.OPACITYDIRECTUV=0,e.EMISSIVEDIRECTUV=0,e.SPECULARDIRECTUV=0,e.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&s.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())x(this._diffuseTexture,e,"DIFFUSE");else return!1;else e.DIFFUSE=!1;if(this._ambientTexture&&s.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())x(this._ambientTexture,e,"AMBIENT");else return!1;else e.AMBIENT=!1;if(this._opacityTexture&&s.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())x(this._opacityTexture,e,"OPACITY"),e.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else e.OPACITY=!1;if(this._reflectionTexture&&s.ReflectionTextureEnabled?(e.ROUGHNESS=this._roughness>0,e.REFLECTIONOVERALPHA=this._useReflectionOverAlpha):(e.ROUGHNESS=!1,e.REFLECTIONOVERALPHA=!1),!j(l,this._reflectionTexture,e))return!1;if(this._emissiveTexture&&s.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())x(this._emissiveTexture,e,"EMISSIVE");else return!1;else e.EMISSIVE=!1;if(this._lightmapTexture&&s.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())x(this._lightmapTexture,e,"LIGHTMAP"),e.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,e.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else e.LIGHTMAP=!1;if(this._specularTexture&&s.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())x(this._specularTexture,e,"SPECULAR"),e.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else e.SPECULAR=!1;if(l.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&s.BumpTextureEnabled){if(this._bumpTexture.isReady())x(this._bumpTexture,e,"BUMP"),e.PARALLAX=this._useParallax,e.PARALLAX_RHS=l.useRightHandedSystem,e.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;e.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else e.BUMP=!1,e.PARALLAX=!1,e.PARALLAX_RHS=!1,e.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&s.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())e._needUVs=!0,e.REFRACTION=!0,e.REFRACTIONMAP_3D=this._refractionTexture.isCube,e.RGBDREFRACTION=this._refractionTexture.isRGBD,e.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else e.REFRACTION=!1;e.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else e.DIFFUSE=!1,e.AMBIENT=!1,e.OPACITY=!1,e.REFLECTION=!1,e.EMISSIVE=!1,e.LIGHTMAP=!1,e.BUMP=!1,e.REFRACTION=!1;e.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),e.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,e.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,e.SPECULAROVERALPHA=this._useSpecularOverAlpha,e.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,e.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,e.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(t)}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=e,this._eventInfo.subMesh=a,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(e._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(e),e.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,e.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}if(e._areFresnelDirty&&(s.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(e.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,e.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,e.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,e.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,e.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,e.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,e._needNormals=!0,e.FRESNEL=!0):e.FRESNEL=!1),e.AREALIGHTUSED||e.CLUSTLIGHT_BATCH){for(let p=0;p{this._shaderLanguage===1?await Promise.all([b(()=>import("./default.vertex-Ck1DuK1F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),b(()=>import("./default.fragment-75ZDpbcd.js"),__vite__mapDeps([23,1,2,3,4,5,6,24,12,8,25,26,27,28,29,30,31,18,32,33,34]),import.meta.url)]):await Promise.all([b(()=>import("./default.vertex-BJO2DRWc.js"),__vite__mapDeps([35,1,2,3,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]),import.meta.url),b(()=>import("./default.fragment-DCtdE8mC.js"),__vite__mapDeps([52,1,2,3,53,37,38,39,43,40,54,55,56,57,58,59,49,60,61]),import.meta.url)]),this._shadersLoaded=!0}},c);if(this._eventInfo.customCode=void 0,S)if(this._onEffectCreatedObservable&&(D.effect=S,D.subMesh=a,this._onEffectCreatedObservable.notifyObservers(D)),this.allowShaderHotSwapping&&H&&!S.isReady()){if(S=H,e.markAsUnprocessed(),r=this.isFrozen,p)return e._areLightsDisposed=!0,!1}else l.resetCachedMaterial(),a.setEffect(S,e,this._materialContext)}return!a.effect||!a.effect.isReady()?!1:(e._renderId=l.getRenderId(),o._wasPreviouslyReady=!r,o._wasPreviouslyUsingInstances=T,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const t=this._uniformBuffer;t.addUniform("diffuseLeftColor",4),t.addUniform("diffuseRightColor",4),t.addUniform("opacityParts",4),t.addUniform("reflectionLeftColor",4),t.addUniform("reflectionRightColor",4),t.addUniform("refractionLeftColor",4),t.addUniform("refractionRightColor",4),t.addUniform("emissiveLeftColor",4),t.addUniform("emissiveRightColor",4),t.addUniform("vDiffuseInfos",2),t.addUniform("vAmbientInfos",2),t.addUniform("vOpacityInfos",2),t.addUniform("vEmissiveInfos",2),t.addUniform("vLightmapInfos",2),t.addUniform("vSpecularInfos",2),t.addUniform("vBumpInfos",3),t.addUniform("diffuseMatrix",16),t.addUniform("ambientMatrix",16),t.addUniform("opacityMatrix",16),t.addUniform("emissiveMatrix",16),t.addUniform("lightmapMatrix",16),t.addUniform("specularMatrix",16),t.addUniform("bumpMatrix",16),t.addUniform("vTangentSpaceParams",2),t.addUniform("pointSize",1),t.addUniform("alphaCutOff",1),t.addUniform("refractionMatrix",16),t.addUniform("vRefractionInfos",4),t.addUniform("vRefractionPosition",3),t.addUniform("vRefractionSize",3),t.addUniform("vSpecularColor",4),t.addUniform("vEmissiveColor",3),t.addUniform("vDiffuseColor",4),t.addUniform("vAmbientColor",3),t.addUniform("cameraInfo",4),le(t,!1,!0),super.buildUniformLayout()}bindForSubMesh(t,a,T){const o=this.getScene(),l=T.materialDefines;if(!l)return;const e=T.effect;if(!e)return;this._activeEffect=e,a.getMeshUniformBuffer().bindToEffect(e,"Mesh"),a.transferToEffect(t),this._uniformBuffer.bindToEffect(e,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,o,a,t,this.isFrozen),y.Bind(o.getEngine().currentRenderPassId,this._activeEffect,a,t,this);const c=o.activeCamera;c?this._uniformBuffer.updateFloat4("cameraInfo",c.minZ,c.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0),this._eventInfo.subMesh=T,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),l.OBJECTSPACE_NORMALMAP&&(t.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const P=this._mustRebind(o,e,T,a.visibility);ue(a,e);const r=this._uniformBuffer;if(P){if(this.bindViewProjection(e),!r.useUbo||!this.isFrozen||!r.isSync||T._drawWrapper._forceRebindOnNextCall){if(s.FresnelEnabled&&l.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(r.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),r.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&r.updateColor4("opacityParts",new m(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(r.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),r.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(r.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),r.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(r.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),r.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),o.texturesEnabled&&(this._diffuseTexture&&s.DiffuseTextureEnabled&&(r.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),R(this._diffuseTexture,r,"diffuse")),this._ambientTexture&&s.AmbientTextureEnabled&&(r.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),R(this._ambientTexture,r,"ambient")),this._opacityTexture&&s.OpacityTextureEnabled&&(r.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),R(this._opacityTexture,r,"opacity")),this._hasAlphaChannel()&&r.updateFloat("alphaCutOff",this.alphaCutOff),fe(o,l,r,m.White(),this._reflectionTexture,!1,!1,!0,!1,!1,!1,this.roughness),(!this._reflectionTexture||!s.ReflectionTextureEnabled)&&r.updateFloat2("vReflectionInfos",0,this.roughness),this._emissiveTexture&&s.EmissiveTextureEnabled&&(r.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),R(this._emissiveTexture,r,"emissive")),this._lightmapTexture&&s.LightmapTextureEnabled&&(r.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),R(this._lightmapTexture,r,"lightmap")),this._specularTexture&&s.SpecularTextureEnabled&&(r.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),R(this._specularTexture,r,"specular")),this._bumpTexture&&o.getEngine().getCaps().standardDerivatives&&s.BumpTextureEnabled&&(r.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),R(this._bumpTexture,r,"bump"),o._mirroredCameraPosition?r.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):r.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&s.RefractionTextureEnabled)){let p=1;if(this._refractionTexture.isCube||(r.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(p=this._refractionTexture.depth)),r.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,p,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const u=this._refractionTexture;r.updateVector3("vRefractionPosition",u.boundingBoxPosition),r.updateVector3("vRefractionSize",u.boundingBoxSize)}}this.pointsCloud&&r.updateFloat("pointSize",this.pointSize),r.updateColor4("vSpecularColor",this.specularColor,this.specularPower),r.updateColor3("vEmissiveColor",s.EmissiveTextureEnabled?this.emissiveColor:m.BlackReadOnly),r.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),o.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),r.updateColor3("vAmbientColor",this._globalAmbientColor)}o.texturesEnabled&&(this._diffuseTexture&&s.DiffuseTextureEnabled&&e.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&s.AmbientTextureEnabled&&e.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&s.OpacityTextureEnabled&&e.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&s.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?e.setTexture("reflectionCubeSampler",this._reflectionTexture):e.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&s.EmissiveTextureEnabled&&e.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&s.LightmapTextureEnabled&&e.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&s.SpecularTextureEnabled&&e.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&o.getEngine().getCaps().standardDerivatives&&s.BumpTextureEnabled&&e.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&s.RefractionTextureEnabled&&(this._refractionTexture.isCube?e.setTexture("refractionCubeSampler",this._refractionTexture):e.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(a)&&this.getScene().depthPeelingRenderer.bind(e),this._eventInfo.subMesh=T,this._callbackPluginEventBindForSubMesh(this._eventInfo),he(e,this,o),this.bindEyePosition(e)}else o.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(P||!this.isFrozen)&&(o.lightsEnabled&&!this._disableLighting&&Te(o,a,e,l,this._maxSimultaneousLights),(o.fogEnabled&&a.applyFog&&o.fogMode!==V.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||a.receiveShadows||l.PREPASS||l.CLUSTLIGHT_BATCH)&&this.bindView(e),pe(o,a,e),l.NUM_MORPH_INFLUENCERS&&Ee(a,e),l.BAKED_VERTEX_ANIMATION_TEXTURE&&a.bakedVertexAnimationManager?.bind(e,l.INSTANCES),this.useLogarithmicDepth&&de(l,e,o),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(a,this._activeEffect,T),r.update()}getAnimatables(){const t=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&t.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&t.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&t.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&t.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&t.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&t.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&t.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&t.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&t.push(this._refractionTexture),t}getActiveTextures(){const t=super.getActiveTextures();return this._diffuseTexture&&t.push(this._diffuseTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._specularTexture&&t.push(this._specularTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),t}hasTexture(t){return!!(super.hasTexture(t)||this._diffuseTexture===t||this._ambientTexture===t||this._opacityTexture===t||this._reflectionTexture===t||this._emissiveTexture===t||this._specularTexture===t||this._bumpTexture===t||this._lightmapTexture===t||this._refractionTexture===t)}dispose(t,a){a&&(this._diffuseTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._specularTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._refractionTexture?.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(t,a)}clone(t,a=!0,T=""){const o=G.Clone(()=>new s(t,this.getScene()),this,{cloneTexturesOnlyOnce:a});return o.name=t,o.id=t,this.stencil.copyTo(o.stencil),this._clonePlugins(o,T),o}static Parse(t,a,T){const o=G.Parse(()=>new s(t.name,a),t,a,T);return t.stencil&&o.stencil.parse(t.stencil,a,T),N._ParsePlugins(t,o,a,T),o}static get DiffuseTextureEnabled(){return f.DiffuseTextureEnabled}static set DiffuseTextureEnabled(t){f.DiffuseTextureEnabled=t}static get DetailTextureEnabled(){return f.DetailTextureEnabled}static set DetailTextureEnabled(t){f.DetailTextureEnabled=t}static get AmbientTextureEnabled(){return f.AmbientTextureEnabled}static set AmbientTextureEnabled(t){f.AmbientTextureEnabled=t}static get OpacityTextureEnabled(){return f.OpacityTextureEnabled}static set OpacityTextureEnabled(t){f.OpacityTextureEnabled=t}static get ReflectionTextureEnabled(){return f.ReflectionTextureEnabled}static set ReflectionTextureEnabled(t){f.ReflectionTextureEnabled=t}static get EmissiveTextureEnabled(){return f.EmissiveTextureEnabled}static set EmissiveTextureEnabled(t){f.EmissiveTextureEnabled=t}static get SpecularTextureEnabled(){return f.SpecularTextureEnabled}static set SpecularTextureEnabled(t){f.SpecularTextureEnabled=t}static get BumpTextureEnabled(){return f.BumpTextureEnabled}static set BumpTextureEnabled(t){f.BumpTextureEnabled=t}static get LightmapTextureEnabled(){return f.LightmapTextureEnabled}static set LightmapTextureEnabled(t){f.LightmapTextureEnabled=t}static get RefractionTextureEnabled(){return f.RefractionTextureEnabled}static set RefractionTextureEnabled(t){f.RefractionTextureEnabled=t}static get ColorGradingTextureEnabled(){return f.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(t){f.ColorGradingTextureEnabled=t}static get FresnelEnabled(){return f.FresnelEnabled}static set FresnelEnabled(t){f.FresnelEnabled=t}}s.ForceGLSL=!1;i([_("diffuseTexture")],s.prototype,"_diffuseTexture",void 0);i([n("_markAllSubMeshesAsTexturesAndMiscDirty")],s.prototype,"diffuseTexture",void 0);i([_("ambientTexture")],s.prototype,"_ambientTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"ambientTexture",void 0);i([_("opacityTexture")],s.prototype,"_opacityTexture",void 0);i([n("_markAllSubMeshesAsTexturesAndMiscDirty")],s.prototype,"opacityTexture",void 0);i([_("reflectionTexture")],s.prototype,"_reflectionTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"reflectionTexture",void 0);i([_("emissiveTexture")],s.prototype,"_emissiveTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"emissiveTexture",void 0);i([_("specularTexture")],s.prototype,"_specularTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"specularTexture",void 0);i([_("bumpTexture")],s.prototype,"_bumpTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"bumpTexture",void 0);i([_("lightmapTexture")],s.prototype,"_lightmapTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"lightmapTexture",void 0);i([_("refractionTexture")],s.prototype,"_refractionTexture",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"refractionTexture",void 0);i([F("ambient")],s.prototype,"ambientColor",void 0);i([F("diffuse")],s.prototype,"diffuseColor",void 0);i([F("specular")],s.prototype,"specularColor",void 0);i([F("emissive")],s.prototype,"emissiveColor",void 0);i([h()],s.prototype,"specularPower",void 0);i([h("useAlphaFromDiffuseTexture")],s.prototype,"_useAlphaFromDiffuseTexture",void 0);i([n("_markAllSubMeshesAsTexturesAndMiscDirty")],s.prototype,"useAlphaFromDiffuseTexture",void 0);i([h("useEmissiveAsIllumination")],s.prototype,"_useEmissiveAsIllumination",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useEmissiveAsIllumination",void 0);i([h("linkEmissiveWithDiffuse")],s.prototype,"_linkEmissiveWithDiffuse",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"linkEmissiveWithDiffuse",void 0);i([h("useSpecularOverAlpha")],s.prototype,"_useSpecularOverAlpha",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useSpecularOverAlpha",void 0);i([h("useReflectionOverAlpha")],s.prototype,"_useReflectionOverAlpha",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useReflectionOverAlpha",void 0);i([h("disableLighting")],s.prototype,"_disableLighting",void 0);i([n("_markAllSubMeshesAsLightsDirty")],s.prototype,"disableLighting",void 0);i([h("useObjectSpaceNormalMap")],s.prototype,"_useObjectSpaceNormalMap",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useObjectSpaceNormalMap",void 0);i([h("useParallax")],s.prototype,"_useParallax",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useParallax",void 0);i([h("useParallaxOcclusion")],s.prototype,"_useParallaxOcclusion",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useParallaxOcclusion",void 0);i([h()],s.prototype,"parallaxScaleBias",void 0);i([h("roughness")],s.prototype,"_roughness",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"roughness",void 0);i([h()],s.prototype,"indexOfRefraction",void 0);i([h()],s.prototype,"invertRefractionY",void 0);i([h()],s.prototype,"alphaCutOff",void 0);i([h("useLightmapAsShadowmap")],s.prototype,"_useLightmapAsShadowmap",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useLightmapAsShadowmap",void 0);i([L("diffuseFresnelParameters")],s.prototype,"_diffuseFresnelParameters",void 0);i([n("_markAllSubMeshesAsFresnelDirty")],s.prototype,"diffuseFresnelParameters",void 0);i([L("opacityFresnelParameters")],s.prototype,"_opacityFresnelParameters",void 0);i([n("_markAllSubMeshesAsFresnelAndMiscDirty")],s.prototype,"opacityFresnelParameters",void 0);i([L("reflectionFresnelParameters")],s.prototype,"_reflectionFresnelParameters",void 0);i([n("_markAllSubMeshesAsFresnelDirty")],s.prototype,"reflectionFresnelParameters",void 0);i([L("refractionFresnelParameters")],s.prototype,"_refractionFresnelParameters",void 0);i([n("_markAllSubMeshesAsFresnelDirty")],s.prototype,"refractionFresnelParameters",void 0);i([L("emissiveFresnelParameters")],s.prototype,"_emissiveFresnelParameters",void 0);i([n("_markAllSubMeshesAsFresnelDirty")],s.prototype,"emissiveFresnelParameters",void 0);i([h("useReflectionFresnelFromSpecular")],s.prototype,"_useReflectionFresnelFromSpecular",void 0);i([n("_markAllSubMeshesAsFresnelDirty")],s.prototype,"useReflectionFresnelFromSpecular",void 0);i([h("useGlossinessFromSpecularMapAlpha")],s.prototype,"_useGlossinessFromSpecularMapAlpha",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"useGlossinessFromSpecularMapAlpha",void 0);i([h("maxSimultaneousLights")],s.prototype,"_maxSimultaneousLights",void 0);i([n("_markAllSubMeshesAsLightsDirty")],s.prototype,"maxSimultaneousLights",void 0);i([h("invertNormalMapX")],s.prototype,"_invertNormalMapX",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"invertNormalMapX",void 0);i([h("invertNormalMapY")],s.prototype,"_invertNormalMapY",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"invertNormalMapY",void 0);i([h("twoSidedLighting")],s.prototype,"_twoSidedLighting",void 0);i([n("_markAllSubMeshesAsTexturesDirty")],s.prototype,"twoSidedLighting",void 0);i([h("applyDecalMapAfterDetailMap")],s.prototype,"_applyDecalMapAfterDetailMap",void 0);i([n("_markAllSubMeshesAsMiscDirty")],s.prototype,"applyDecalMapAfterDetailMap",void 0);Re("BABYLON.StandardMaterial",s);V.DefaultMaterialFactory=C=>new s("default material",C);export{s as S}; diff --git a/assets/state.svelte-DpHZj3x1.js b/assets/state.svelte-DpHZj3x1.js deleted file mode 100644 index 1bde135db3fe2e9660bf1d52d39ee875ff90c7de..0000000000000000000000000000000000000000 --- a/assets/state.svelte-DpHZj3x1.js +++ /dev/null @@ -1 +0,0 @@ -import{p as M,q as z,t as E,f as F,u as L}from"./i18n-CPHyzK9b.js";import{M as O,aa as j,ab as A,ac as T,$ as q,t as C,a as $,O as N,Z as g,R as k,Q as P,T as b}from"./index-DydPgVMC.js";import{T as Q}from"./StreamingBar.svelte_svelte_type_style_lang-BMYtrUWr.js";import{s as R}from"./index-CfM_uZQa.js";var S=k('
                '),Z=k('
                ');function K(w,t){O(t,!0);const a=()=>L(_,"$top",u),[u,i]=E();let r=M(t,"messages",19,()=>[]);const _=R(0,{stiffness:.4,damping:.5});let p=j(A([]));T(()=>{h(r())}),T(()=>{q(p,d(r()),!0)});function d(s){const e=new Map;return s.forEach(n=>{const o=n.type;e.has(o)||e.set(o,{type:n.type,messages:[],expanded:!0}),e.get(o).messages.push(n)}),Array.from(e.values())}function h(s){s.length>0&&"parentIFrame"in window&&window.parentIFrame?.getPageInfo(e=>{e.scrollTope.type===s?{...e,expanded:!e.expanded}:e),!0)}var l=Z();z(l,21,()=>g(p),s=>s.type,(s,e)=>{var n=S(),o=P(n);Q(o,{get type(){return g(e).type},get messages(){return g(e).messages},get expanded(){return g(e).expanded},ontoggle:()=>m(g(e).type),onclose:f=>t.on_close(f)}),b(n),$(s,n)}),b(l),C(()=>F(l,`--toast-top: ${a()??""}px;`)),$(w,l),N(),i()}class U{current={};fn_outputs={};fn_inputs={};pending_outputs=new Map;fn_status={};show_progress={};cache_event_id=0;register(t,a,u,i){this.fn_outputs[t]=a,this.fn_inputs[t]=u,this.show_progress[t]=i}clear(t){t in this.current&&(this.current[t]={})}update(t){for(const[i,r]of Object.entries(this.current))r.fn_index!==t.fn_index&&(this.current[i]={...r,used_cache:null,cache_duration:null,avg_time:null,cache_event_id:null});const a=t.used_cache?++this.cache_event_id:null;this.resolve_args(t).forEach(({id:i,queue_position:r,queue_size:_,eta:p,status:d,message:h,progress:m,stream_state:l,time_limit:s,type:e,used_cache:n,cache_duration:o,avg_time:f})=>{this.current[i]={queue:t.queue||!1,queue_size:_,queue_position:r,eta:p,component_id:Number(i),stream_state:l,message:h,progress:m||void 0,status:d,fn_index:t.fn_index,time_limit:s,type:e,show_progress:this.show_progress[t.fn_index],used_cache:n,cache_duration:o,avg_time:f,cache_event_id:a}})}set_status(t,a){this.current[t].status=a}resolve_args(t){const{fn_index:a,status:u,size:i=void 0,position:r=null,eta:_=null,message:p=null,stream_state:d=null,time_limit:h=null,progress_data:m=null,used_cache:l=null,cache_duration:s=null,avg_time:e=null}=t,n=this.fn_outputs[a],o=this.fn_status[a],f=this.fn_inputs[a];return n.concat(f).map(c=>{let v;const y=this.pending_outputs.get(c)||0;if(o==="pending"&&u!=="pending"){let x=y-1;this.pending_outputs.set(c,x<0?0:x),v=x>0?"pending":u}else o==="pending"&&u==="pending"?v="pending":o!=="pending"&&u==="pending"?(v="pending",this.pending_outputs.set(c,y+1)):v=u;const I=f.includes(c)&&d?"input":n.includes(c)?"output":"skip";return{id:c,queue_position:r,queue_size:i,eta:_,status:v,message:p,progress:m,stream_state:d,time_limit:h,type:I,used_cache:l,cache_duration:s,avg_time:e}}).filter(c=>c.type!=="skip")}}export{U as L,K as T}; diff --git a/assets/stateDiagram-FKZM4ZOC-CHpWYG-h.js b/assets/stateDiagram-FKZM4ZOC-CHpWYG-h.js deleted file mode 100644 index 02ca82b05bfec04d12969d6c661a1cef3951470e..0000000000000000000000000000000000000000 --- a/assets/stateDiagram-FKZM4ZOC-CHpWYG-h.js +++ /dev/null @@ -1 +0,0 @@ -import{s as P,a as R,S as N}from"./chunk-DI55MBZ5-CXTRmq1s.js";import{_ as f,c as t,l as S,d as W,j as z,P as _,u as U}from"./mermaid.core-BcqUqpnI.js";import{G as C}from"./graph-CmFD0A_p.js";import{l as F}from"./layout-Blpw3L9v.js";import{s as H}from"./select-BigU4G0v.js";import{l as O,k as J}from"./step-B-Gbak1k.js";import"./chunk-55IACEB6-CzYB-Zls.js";import"./chunk-QN33PNHL-DUQNEUQT.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./dispatch-kxCwF96_.js";import"./_baseUniq-BFKEI0vc.js";import"./min-Rtq3U8dQ.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,B,m){const E=g.append("tspan").attr("x",2*t().state.padding).text(B);m||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const B=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-B.x)x&&(g=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"
                ");x=x.replace(/\n/g,"
                ");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&j(n),(i.type==="fork"||i.type==="join")&&q(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=O().x(function(s){return s.x}).y(function(s){return s.y}).curve(J),x=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=_(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=U.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const B=[];let m=0,E=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();m=Math.max(m,y.width),E=Math.min(E,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),B.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;B.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-m/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();G(w,s,void 0,!1,x,a,c);const p=b.padding,o=s.node().getBBox(),g=o.width+p*2,B=o.height+p*2,m=g*1.75;W(s,B,m,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+g+" "+B)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,x)=>{const a=new C({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s{const y=h.parentElement;let v=0,M=0;y&&(y.parentElement&&(v=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=m.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},yt={parser:R,get db(){return new N(1)},renderer:it,styles:P,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{yt as diagram}; diff --git a/assets/stateDiagram-v2-4FDKWEC3-CWiaQQ2u.js b/assets/stateDiagram-v2-4FDKWEC3-CWiaQQ2u.js deleted file mode 100644 index 4118ce2e4a50bfe2a580f2d4e27cfca52563113c..0000000000000000000000000000000000000000 --- a/assets/stateDiagram-v2-4FDKWEC3-CWiaQQ2u.js +++ /dev/null @@ -1 +0,0 @@ -import{s as r,b as e,a,S as i}from"./chunk-DI55MBZ5-CXTRmq1s.js";import{_ as s}from"./mermaid.core-BcqUqpnI.js";import"./chunk-55IACEB6-CzYB-Zls.js";import"./select-BigU4G0v.js";import"./chunk-QN33PNHL-DUQNEUQT.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./step-B-Gbak1k.js";import"./dispatch-kxCwF96_.js";var f={parser:a,get db(){return new i(2)},renderer:e,styles:r,init:s(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/assets/stlFileLoader-NjlSVF7a.js b/assets/stlFileLoader-NjlSVF7a.js deleted file mode 100644 index 1bc8e5ad76935e21fc72690b0bcbf6ba76a0dbef..0000000000000000000000000000000000000000 --- a/assets/stlFileLoader-NjlSVF7a.js +++ /dev/null @@ -1 +0,0 @@ -import{aw as O,l as g,d as N,J as d,ax as I}from"./index-GY9JDBGV.js";import{A as b}from"./assetContainer-X8dc1NDD.js";import"./standardMaterial-Dw51Jj3C.js";import"./index-DydPgVMC.js";class f{constructor(){this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.name=O.name,this.extensions=O.extensions}importMesh(r,o,t,i,c){let s;if(typeof t!="string"){if(this._isBinary(t)){const e=new g("stlmesh",o);return this._parseBinary(e,t),c&&c.push(e),!0}t=new TextDecoder().decode(new Uint8Array(t))}for(;s=this.solidPattern.exec(t);){let e=s[1];const u=s[3];if(u&&e!=u)return N.Error("Error in STL, solid name != endsolid name"),!1;if(r&&e){if(r instanceof Array){if(!r.indexOf(e))continue}else if(e!==r)continue}e=e||"stlmesh";const a=new g(e,o);this._parseASCII(a,s[2]),c&&c.push(a)}return!0}load(r,o,t){return this.importMesh(null,r,o,t,null)}loadAssetContainer(r,o,t){const i=new b(r);return r._blockEntityCollection=!0,this.importMesh(null,r,o,t,i.meshes),r._blockEntityCollection=!1,i}_isBinary(r){const o=new DataView(r);if(o.byteLength<=80)return!1;const t=32/8*3+32/8*3*3+16/8,i=o.getUint32(80,!0);if(80+32/8+i*t===o.byteLength)return!0;const c=[115,111,108,105,100];for(let s=0;s<5;s++)if(o.getUint8(s)!==c[s])return!0;return!1}_parseBinary(r,o){const t=new DataView(o),i=t.getUint32(80,!0),c=84,s=50;let e=0;const u=new Float32Array(i*3*3),a=new Float32Array(i*3*3),l=new Uint32Array(i*3);let n=0;for(let E=0;En.length){A.Error("Unable to load TGA file - Not enough data");return}c+=r.id_length;let _=!1,f=!1,p=!1;switch(r.image_type){case L:_=!0;case U:f=!0;break;case O:_=!0;case d:break;case Y:_=!0;case N:p=!0;break}let m;const u=r.pixel_size>>3,g=r.width*r.height*u;let s;if(f&&(s=n.subarray(c,c+=r.colormap_length*(r.colormap_size>>3))),_){m=new Uint8Array(g);let I,y,w,b=0;const T=new Uint8Array(u);for(;c>z){default:case C:h=0,i=1,l=r.width,a=0,t=1,e=r.height;break;case P:h=0,i=1,l=r.width,a=r.height-1,t=-1,e=-1;break;case M:h=r.width-1,i=-1,l=-1,a=0,t=1,e=r.height;break;case B:h=r.width-1,i=-1,l=-1,a=r.height-1,t=-1,e=-1;break}const x="_getImageData"+(p?"Grey":"")+r.pixel_size+"bits",D=j[x](r,s,m,a,t,e,h,i,l);o.getEngine()._uploadDataToTextureDirectly(o,D)}function H(o,n,c,r,_,f,p,m,u){const g=c,s=n,h=o.width,a=o.height;let i,t=0,e,l;const x=new Uint8Array(h*a*4);for(l=r;l!==f;l+=_)for(e=p;e!==u;e+=m,t++)i=g[t],x[(e+h*l)*4+3]=255,x[(e+h*l)*4+2]=s[i*3+0],x[(e+h*l)*4+1]=s[i*3+1],x[(e+h*l)*4+0]=s[i*3+2];return x}function S(o,n,c,r,_,f,p,m,u){const g=c,s=o.width,h=o.height;let a,i=0,t,e;const l=new Uint8Array(s*h*4);for(e=r;e!==f;e+=_)for(t=p;t!==u;t+=m,i+=2){a=g[i+0]+(g[i+1]<<8);const x=((a&31744)>>10)*255/31|0,D=((a&992)>>5)*255/31|0,E=(a&31)*255/31|0;l[(t+s*e)*4+0]=x,l[(t+s*e)*4+1]=D,l[(t+s*e)*4+2]=E,l[(t+s*e)*4+3]=a&32768?0:255}return l}function X(o,n,c,r,_,f,p,m,u){const g=c,s=o.width,h=o.height;let a=0,i,t;const e=new Uint8Array(s*h*4);for(t=r;t!==f;t+=_)for(i=p;i!==u;i+=m,a+=3)e[(i+s*t)*4+3]=255,e[(i+s*t)*4+2]=g[a+0],e[(i+s*t)*4+1]=g[a+1],e[(i+s*t)*4+0]=g[a+2];return e}function v(o,n,c,r,_,f,p,m,u){const g=c,s=o.width,h=o.height;let a=0,i,t;const e=new Uint8Array(s*h*4);for(t=r;t!==f;t+=_)for(i=p;i!==u;i+=m,a+=4)e[(i+s*t)*4+2]=g[a+0],e[(i+s*t)*4+1]=g[a+1],e[(i+s*t)*4+0]=g[a+2],e[(i+s*t)*4+3]=g[a+3];return e}function F(o,n,c,r,_,f,p,m,u){const g=c,s=o.width,h=o.height;let a,i=0,t,e;const l=new Uint8Array(s*h*4);for(e=r;e!==f;e+=_)for(t=p;t!==u;t+=m,i++)a=g[i],l[(t+s*e)*4+0]=a,l[(t+s*e)*4+1]=a,l[(t+s*e)*4+2]=a,l[(t+s*e)*4+3]=255;return l}function K(o,n,c,r,_,f,p,m,u){const g=c,s=o.width,h=o.height;let a=0,i,t;const e=new Uint8Array(s*h*4);for(t=r;t!==f;t+=_)for(i=p;i!==u;i+=m,a+=2)e[(i+s*t)*4+0]=g[a+0],e[(i+s*t)*4+1]=g[a+0],e[(i+s*t)*4+2]=g[a+0],e[(i+s*t)*4+3]=g[a+1];return e}const j={GetTGAHeader:G,UploadContent:R,_getImageData8bits:H,_getImageData16bits:S,_getImageData24bits:X,_getImageData32bits:v,_getImageDataGrey8bits:F,_getImageDataGrey16bits:K};class Q{constructor(){this.supportCascades=!1}loadCubeData(){throw".env not supported in Cube."}loadData(n,c,r){const _=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),f=G(_);r(f.width,f.height,c.generateMipMaps,!1,()=>{R(c,_)})}}export{Q as _TGATextureLoader}; diff --git a/assets/thinInstanceMesh-B_Va_jLC.js b/assets/thinInstanceMesh-B_Va_jLC.js deleted file mode 100644 index 968baadee172ea4c3905a67799c002d0cf08caeb..0000000000000000000000000000000000000000 --- a/assets/thinInstanceMesh-B_Va_jLC.js +++ /dev/null @@ -1 +0,0 @@ -import{l as i,L as S,M as c,J as s,au as g,av as _,c as u,V as B}from"./index-GY9JDBGV.js";i.prototype.thinInstanceAdd=function(t,e=!0){if(!this.getScene().getEngine().getCaps().instancedArrays)return S.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(t)?t.length:1);const a=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(t))for(let n=0;n=this._thinInstanceDataStorage.instancesCount)return!1;const n=this._thinInstanceDataStorage.matrixData;return e.copyToArray(n,t*16),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[t]=e),a&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0};i.prototype.thinInstanceSetAttributeAt=function(t,e,a,n=!0){return t===s.ColorKind&&(t=s.ColorInstanceKind),!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[t]||e>=this._thinInstanceDataStorage.instancesCount?!1:(this._thinInstanceUpdateBufferSize(t,0),this._userThinInstanceBuffersStorage.data[t].set(a,e*this._userThinInstanceBuffersStorage.strides[t]),n&&this.thinInstanceBufferUpdated(t),!0)};Object.defineProperty(i.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(t){const e=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData,a=e?e.length/16:0;t<=a&&(this._thinInstanceDataStorage.instancesCount=t)},enumerable:!0,configurable:!0});i.prototype._thinInstanceCreateMatrixBuffer=function(t,e,a=!0){const n=new g(this.getEngine(),e,!a,16,!1,!0);for(let o=0;o<4;o++)this.setVerticesBuffer(n.createVertexBuffer(t+o,o*4,4));return n};i.prototype.thinInstanceSetBuffer=function(t,e,a=0,n=!0){if(a=a||16,t==="matrix")this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*a,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,e!==null?(this._thinInstanceDataStorage.instancesCount=e.length/a,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,n),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo());else if(t==="previousMatrix")this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,e!==null&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,n));else if(t==="splatIndex"&&e){this._thinInstanceInitializeUserStorage(),this._thinInstanceDataStorage.instancesCount=e.length/a,this._userThinInstanceBuffersStorage.data[t]=e,this._userThinInstanceBuffersStorage.strides[t]=a,this._userThinInstanceBuffersStorage.sizes[t]=e.length;const o=new g(this.getEngine(),e,!0,16,!1,!0);this._thinInstanceDataStorage.matrixBuffer=o;for(let r=0;r<4;r++)this.setVerticesBuffer(o.createVertexBuffer(t+r,r*4,4))}else t===s.ColorKind&&(t=s.ColorInstanceKind),e===null?this._userThinInstanceBuffersStorage?.data[t]&&(this.removeVerticesData(t),delete this._userThinInstanceBuffersStorage.data[t],delete this._userThinInstanceBuffersStorage.strides[t],delete this._userThinInstanceBuffersStorage.sizes[t],delete this._userThinInstanceBuffersStorage.vertexBuffers[t]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[t]=e,this._userThinInstanceBuffersStorage.strides[t]=a,this._userThinInstanceBuffersStorage.sizes[t]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[t]=new s(this.getEngine(),e,t,!n,!1,a,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))};i.prototype.thinInstanceBufferUpdated=function(t){t==="matrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):t==="previousMatrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):t==="splatIndex"?this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._userThinInstanceBuffersStorage.data[t],0,this._thinInstanceDataStorage.instancesCount):(t===s.ColorKind&&(t=s.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[t].isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(this._userThinInstanceBuffersStorage.data[t],0)))};i.prototype.thinInstancePartialBufferUpdate=function(t,e,a){t==="matrix"?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,a):(t===s.ColorKind&&(t=s.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]&&this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(e,a))};i.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const t=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let e=0;e"u"&&(g.yylloc={});var M=g.yylloc;o.push(M);var z=g.options&&g.options.ranges;typeof b.yy.parseError=="function"?this.parseError=b.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(T){c.length=c.length-2*T,y.length=y.length-T,o.length=o.length-T}s(Z,"popStack");function tt(){var T;return T=u.pop()||g.lex()||U,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=a.symbols_[T]||T),T}s(tt,"lex");for(var S,A,I,J,R={},B,$,et,O;;){if(A=c[c.length-1],this.defaultActions[A]?I=this.defaultActions[A]:((S===null||typeof S>"u")&&(S=tt()),I=w[A]&&w[A][S]),typeof I>"u"||!I.length||!I[0]){var K="";O=[];for(B in w[A])this.terminals_[B]&&B>W&&O.push("'"+this.terminals_[B]+"'");g.showPosition?K="Parse error on line "+(N+1)+`: -`+g.showPosition()+` -Expecting `+O.join(", ")+", got '"+(this.terminals_[S]||S)+"'":K="Parse error on line "+(N+1)+": Unexpected "+(S==U?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(K,{text:g.match,token:this.terminals_[S]||S,line:g.yylineno,loc:M,expected:O})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+S);switch(I[0]){case 1:c.push(S),y.push(g.yytext),o.push(g.yylloc),c.push(I[1]),S=null,P=g.yyleng,v=g.yytext,N=g.yylineno,M=g.yylloc;break;case 2:if($=this.productions_[I[1]][1],R.$=y[y.length-$],R._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},z&&(R._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),J=this.performAction.apply(R,[v,P,N,b.yy,I[1],y,o].concat(H)),typeof J<"u")return J;$&&(c=c.slice(0,-1*$*2),y=y.slice(0,-1*$),o=o.slice(0,-1*$)),c.push(this.productions_[I[1]][0]),y.push(R.$),o.push(R._$),et=w[c[c.length-2]][c[c.length-1]],c.push(et);break;case 3:return!0}}return!0},"parse")},k=(function(){var x={EOF:1,parseError:s(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:s(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+` -`+a+"^"},"showPosition"),test_match:s(function(r,a){var c,u,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),u=r[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var o in y)this[o]=y[o];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,c,u;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),o=0;oa[0].length)){if(a=c,u=o,this.options.backtrack_lexer){if(r=this.test_match(c,y[o]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,y[u]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var a=this.next();return a||this.lex()},"lex"),begin:s(function(a){this.conditionStack.push(a)},"begin"),popState:s(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:s(function(a){this.begin(a)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(a,c,u,y){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return x})();p.lexer=k;function _(){this.yy={}}return s(_,"Parser"),_.prototype=p,p.Parser=_,new _})();Q.parser=Q;var Tt=Q,at={};wt(at,{addEvent:()=>yt,addSection:()=>ht,addTask:()=>pt,addTaskOrg:()=>gt,clear:()=>ct,default:()=>It,getCommonDb:()=>ot,getSections:()=>dt,getTasks:()=>ut});var F="",lt=0,X=[],G=[],V=[],ot=s(()=>St,"getCommonDb"),ct=s(function(){X.length=0,G.length=0,F="",V.length=0,Et()},"clear"),ht=s(function(n){F=n,X.push(n)},"addSection"),dt=s(function(){return X},"getSections"),ut=s(function(){let n=it();const t=100;let e=0;for(;!n&&ee.id===lt-1).events.push(n)},"addEvent"),gt=s(function(n){const t={section:F,type:F,description:n,task:n,classes:[]};G.push(t)},"addTaskOrg"),it=s(function(){const n=s(function(e){return V[e].processed},"compileTask");let t=!0;for(const[e,l]of V.entries())n(e),t=t&&l.processed;return t},"compileTasks"),It={clear:ct,getCommonDb:ot,addSection:ht,getSections:dt,getTasks:ut,addTask:pt,addTaskOrg:gt,addEvent:yt},Nt=12,q=s(function(n,t){const e=n.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),Lt=s(function(n,t){const l=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=n.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function d(m){const p=nt().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);m.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}s(d,"smile");function h(m){const p=nt().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);m.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}s(h,"sad");function f(m){m.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(f,"ambivalent"),t.score>3?d(i):t.score<3?h(i):f(i),l},"drawFace"),Mt=s(function(n,t){const e=n.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),ft=s(function(n,t){const e=t.text.replace(//gi," "),l=n.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);const i=l.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(e),l},"drawText"),$t=s(function(n,t){function e(i,d,h,f,m){return i+","+d+" "+(i+h)+","+d+" "+(i+h)+","+(d+f-m)+" "+(i+h-m*1.2)+","+(d+f)+" "+i+","+(d+f)}s(e,"genPoints");const l=n.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,ft(n,t)},"drawLabel"),Ht=s(function(n,t,e){const l=n.append("g"),i=Y();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=e.width,i.height=e.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,q(l,i),mt(e)(t.text,l,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),rt=-1,Pt=s(function(n,t,e){const l=t.x+e.width/2,i=n.append("g");rt++,i.append("line").attr("id","task"+rt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Lt(i,{cx:l,cy:300+(5-t.score)*30,score:t.score});const h=Y();h.x=t.x,h.y=t.y,h.fill=t.fill,h.width=e.width,h.height=e.height,h.class="task task-type-"+t.num,h.rx=3,h.ry=3,q(i,h),mt(e)(t.task,i,h.x,h.y,h.width,h.height,{class:"task"},e,t.colour)},"drawTask"),At=s(function(n,t){q(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Ct=s(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Y=s(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),mt=(function(){function n(i,d,h,f,m,p,k,_){const x=d.append("text").attr("x",h+m/2).attr("y",f+p/2+5).style("font-color",_).style("text-anchor","middle").text(i);l(x,k)}s(n,"byText");function t(i,d,h,f,m,p,k,_,x){const{taskFontSize:r,taskFontFamily:a}=_,c=i.split(//gi);for(let u=0;u)/).reverse(),i,d=[],h=1.1,f=e.attr("y"),m=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",m+"em");for(let k=0;kt||i==="
                ")&&(d.pop(),p.text(d.join(" ").trim()),i==="
                "?d=[""]:d=[i],p=e.append("tspan").attr("x",0).attr("y",f).attr("dy",h+"em").text(i))})}s(D,"wrap");var Ft=s(function(n,t,e,l){const i=e%Nt-1,d=n.append("g");t.section=i,d.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+i));const h=d.append("g"),f=d.append("g"),p=f.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(D,t.width).node().getBBox(),k=l.fontSize?.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+k*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,f.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),Wt(h,t,i,l),t},"drawNode"),Vt=s(function(n,t,e){const l=n.append("g"),d=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(D,t.width).node().getBBox(),h=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),d.height+h*1.1*.5+t.padding},"getVirtualNodeHeight"),Wt=s(function(n,t,e){n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),C={drawRect:q,drawCircle:Mt,drawSection:Ht,drawText:ft,drawLabel:$t,drawTask:Pt,drawBackgroundRect:At,getTextObj:Ct,getNoteRect:Y,initGraphics:Rt,drawNode:Ft,getVirtualNodeHeight:Vt},zt=s(function(n,t,e,l){const i=xt(),d=i.timeline?.leftMargin??50;E.debug("timeline",l.db);const h=i.securityLevel;let f;h==="sandbox"&&(f=j("#i"+t));const p=(h==="sandbox"?j(f.nodes()[0].contentDocument.body):j("body")).select("#"+t);p.append("g");const k=l.db.getTasks(),_=l.db.getCommonDb().getDiagramTitle();E.debug("task",k),C.initGraphics(p);const x=l.db.getSections();E.debug("sections",x);let r=0,a=0,c=0,u=0,y=50+d,o=50;u=50;let w=0,v=!0;x.forEach(function(H){const g={number:w,descr:H,section:w,width:150,padding:20,maxHeight:r},b=C.getVirtualNodeHeight(p,g,i);E.debug("sectionHeight before draw",b),r=Math.max(r,b+20)});let N=0,P=0;E.debug("tasks.length",k.length);for(const[H,g]of k.entries()){const b={number:H,descr:g,section:g.section,width:150,padding:20,maxHeight:a},L=C.getVirtualNodeHeight(p,b,i);E.debug("taskHeight before draw",L),a=Math.max(a,L+20),N=Math.max(N,g.events.length);let M=0;for(const z of g.events){const Z={descr:z,section:g.section,number:g.section,width:150,padding:20,maxHeight:50};M+=C.getVirtualNodeHeight(p,Z,i)}g.events.length>0&&(M+=(g.events.length-1)*10),P=Math.max(P,M)}E.debug("maxSectionHeight before draw",r),E.debug("maxTaskHeight before draw",a),x&&x.length>0?x.forEach(H=>{const g=k.filter(z=>z.section===H),b={number:w,descr:H,section:w,width:200*Math.max(g.length,1)-50,padding:20,maxHeight:r};E.debug("sectionNode",b);const L=p.append("g"),M=C.drawNode(L,b,w,i);E.debug("sectionNode output",M),L.attr("transform",`translate(${y}, ${u})`),o+=r+50,g.length>0&&st(p,g,w,y,o,a,i,N,P,r,!1),y+=200*Math.max(g.length,1),o=u,w++}):(v=!1,st(p,k,w,y,o,a,i,N,P,r,!0));const W=p.node().getBBox();E.debug("bounds",W),_&&p.append("text").text(_).attr("x",W.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=v?r+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",c).attr("x2",W.width+3*d).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),kt(void 0,p,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),st=s(function(n,t,e,l,i,d,h,f,m,p,k){for(const _ of t){const x={descr:_.task,section:e,number:e,width:150,padding:20,maxHeight:d};E.debug("taskNode",x);const r=n.append("g").attr("class","taskWrapper"),c=C.drawNode(r,x,e,h).height;if(E.debug("taskHeight after draw",c),r.attr("transform",`translate(${l}, ${i})`),d=Math.max(d,c),_.events){const u=n.append("g").attr("class","lineWrapper");let y=d;i+=100,y=y+Bt(n,_.events,e,l,i,h),i-=100,u.append("line").attr("x1",l+190/2).attr("y1",i+d).attr("x2",l+190/2).attr("y2",i+d+100+m+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,k&&!h.timeline?.disableMulticolor&&e++}i=i-10},"drawTasks"),Bt=s(function(n,t,e,l,i,d){let h=0;const f=i;i=i+100;for(const m of t){const p={descr:m,section:e,number:e,width:150,padding:20,maxHeight:50};E.debug("eventNode",p);const k=n.append("g").attr("class","eventWrapper"),x=C.drawNode(k,p,e,d).height;h=h+x,k.attr("transform",`translate(${l}, ${i})`),i=i+10+x}return i=f,h},"drawEvents"),Ot={setConf:s(()=>{},"setConf"),draw:zt},jt=s(n=>{let t="";for(let e=0;e` - .edge { - stroke-width: 3; - } - ${jt(n)} - .section-root rect, .section-root path, .section-root circle { - fill: ${n.git0}; - } - .section-root text { - fill: ${n.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .eventWrapper { - filter: brightness(120%); - } -`,"getStyles"),qt=Gt,Dt={db:at,renderer:Ot,parser:Tt,styles:qt};export{Dt as diagram}; diff --git a/assets/tinycolor-D4ULLcDx.js b/assets/tinycolor-D4ULLcDx.js deleted file mode 100644 index f5f42a8a32f8a5b584a9b7d4f051064826031d7b..0000000000000000000000000000000000000000 --- a/assets/tinycolor-D4ULLcDx.js +++ /dev/null @@ -1 +0,0 @@ -import"./i18n-CPHyzK9b.js";import{a as T,f as C}from"./index-DydPgVMC.js";var E=C('');function it(t){var r=E();T(t,r)}function _(t){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_(t)}var I=/^\s+/,P=/\s+$/;function s(t,r){if(t=t||"",r=r||{},t instanceof s)return t;if(!(this instanceof s))return new s(t,r);var e=N(t);this._originalInput=t,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=r.format||e.format,this._gradientType=r.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var r=this.toRgb();return(r.r*299+r.g*587+r.b*114)/1e3},getLuminance:function(){var r=this.toRgb(),e,a,i,n,h,f;return e=r.r/255,a=r.g/255,i=r.b/255,e<=.03928?n=e/12.92:n=Math.pow((e+.055)/1.055,2.4),a<=.03928?h=a/12.92:h=Math.pow((a+.055)/1.055,2.4),i<=.03928?f=i/12.92:f=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*h+.0722*f},setAlpha:function(r){return this._a=R(r),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var r=A(this._r,this._g,this._b);return{h:r.h*360,s:r.s,v:r.v,a:this._a}},toHsvString:function(){var r=A(this._r,this._g,this._b),e=Math.round(r.h*360),a=Math.round(r.s*100),i=Math.round(r.v*100);return this._a==1?"hsv("+e+", "+a+"%, "+i+"%)":"hsva("+e+", "+a+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var r=x(this._r,this._g,this._b);return{h:r.h*360,s:r.s,l:r.l,a:this._a}},toHslString:function(){var r=x(this._r,this._g,this._b),e=Math.round(r.h*360),a=Math.round(r.s*100),i=Math.round(r.l*100);return this._a==1?"hsl("+e+", "+a+"%, "+i+"%)":"hsla("+e+", "+a+"%, "+i+"%, "+this._roundA+")"},toHex:function(r){return S(this._r,this._g,this._b,r)},toHexString:function(r){return"#"+this.toHex(r)},toHex8:function(r){return G(this._r,this._g,this._b,this._a,r)},toHex8String:function(r){return"#"+this.toHex8(r)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(u(this._r,255)*100)+"%",g:Math.round(u(this._g,255)*100)+"%",b:Math.round(u(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(u(this._r,255)*100)+"%, "+Math.round(u(this._g,255)*100)+"%, "+Math.round(u(this._b,255)*100)+"%)":"rgba("+Math.round(u(this._r,255)*100)+"%, "+Math.round(u(this._g,255)*100)+"%, "+Math.round(u(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K[S(this._r,this._g,this._b,!0)]||!1},toFilter:function(r){var e="#"+k(this._r,this._g,this._b,this._a),a=e,i=this._gradientType?"GradientType = 1, ":"";if(r){var n=s(r);a="#"+k(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+a+")"},toString:function(r){var e=!!r;r=r||this._format;var a=!1,i=this._a<1&&this._a>=0,n=!e&&i&&(r==="hex"||r==="hex6"||r==="hex3"||r==="hex4"||r==="hex8"||r==="name");return n?r==="name"&&this._a===0?this.toName():this.toRgbString():(r==="rgb"&&(a=this.toRgbString()),r==="prgb"&&(a=this.toPercentageRgbString()),(r==="hex"||r==="hex6")&&(a=this.toHexString()),r==="hex3"&&(a=this.toHexString(!0)),r==="hex4"&&(a=this.toHex8String(!0)),r==="hex8"&&(a=this.toHex8String()),r==="name"&&(a=this.toName()),r==="hsl"&&(a=this.toHslString()),r==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},clone:function(){return s(this.toString())},_applyModification:function(r,e){var a=r.apply(null,[this].concat([].slice.call(e)));return this._r=a._r,this._g=a._g,this._b=a._b,this.setAlpha(a._a),this},lighten:function(){return this._applyModification(U,arguments)},brighten:function(){return this._applyModification(V,arguments)},darken:function(){return this._applyModification($,arguments)},desaturate:function(){return this._applyModification(O,arguments)},saturate:function(){return this._applyModification(q,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(j,arguments)},_applyCombination:function(r,e){return r.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(X,arguments)},complement:function(){return this._applyCombination(Z,arguments)},monochromatic:function(){return this._applyCombination(J,arguments)},splitcomplement:function(){return this._applyCombination(W,arguments)},triad:function(){return this._applyCombination(w,[3])},tetrad:function(){return this._applyCombination(w,[4])}};s.fromRatio=function(t,r){if(_(t)=="object"){var e={};for(var a in t)t.hasOwnProperty(a)&&(a==="a"?e[a]=t[a]:e[a]=m(t[a]));t=e}return s(t,r)};function N(t){var r={r:0,g:0,b:0},e=1,a=null,i=null,n=null,h=!1,f=!1;return typeof t=="string"&&(t=et(t)),_(t)=="object"&&(p(t.r)&&p(t.g)&&p(t.b)?(r=L(t.r,t.g,t.b),h=!0,f=String(t.r).substr(-1)==="%"?"prgb":"rgb"):p(t.h)&&p(t.s)&&p(t.v)?(a=m(t.s),i=m(t.v),r=z(t.h,a,i),h=!0,f="hsv"):p(t.h)&&p(t.s)&&p(t.l)&&(a=m(t.s),n=m(t.l),r=B(t.h,a,n),h=!0,f="hsl"),t.hasOwnProperty("a")&&(e=t.a)),e=R(e),{ok:h,format:t.format||f,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:e}}function L(t,r,e){return{r:u(t,255)*255,g:u(r,255)*255,b:u(e,255)*255}}function x(t,r,e){t=u(t,255),r=u(r,255),e=u(e,255);var a=Math.max(t,r,e),i=Math.min(t,r,e),n,h,f=(a+i)/2;if(a==i)n=h=0;else{var o=a-i;switch(h=f>.5?o/(2-a-i):o/(a+i),a){case t:n=(r-e)/o+(r1&&(d-=1),d<1/6?g+(v-g)*6*d:d<1/2?v:d<2/3?g+(v-g)*(2/3-d)*6:g}if(r===0)a=i=n=e;else{var f=e<.5?e*(1+r):e+r-e*r,o=2*e-f;a=h(o,f,t+1/3),i=h(o,f,t),n=h(o,f,t-1/3)}return{r:a*255,g:i*255,b:n*255}}function A(t,r,e){t=u(t,255),r=u(r,255),e=u(e,255);var a=Math.max(t,r,e),i=Math.min(t,r,e),n,h,f=a,o=a-i;if(h=a===0?0:o/a,a==i)n=0;else{switch(a){case t:n=(r-e)/o+(r>1)+720)%360;--r;)a.h=(a.h+i)%360,n.push(s(a));return n}function J(t,r){r=r||6;for(var e=s(t).toHsv(),a=e.h,i=e.s,n=e.v,h=[],f=1/r;r--;)h.push(s({h:a,s:i,v:n})),n=(n+f)%1;return h}s.mix=function(t,r,e){e=e===0?0:e||50;var a=s(t).toRgb(),i=s(r).toRgb(),n=e/100,h={r:(i.r-a.r)*n+a.r,g:(i.g-a.g)*n+a.g,b:(i.b-a.b)*n+a.b,a:(i.a-a.a)*n+a.a};return s(h)};s.readability=function(t,r){var e=s(t),a=s(r);return(Math.max(e.getLuminance(),a.getLuminance())+.05)/(Math.min(e.getLuminance(),a.getLuminance())+.05)};s.isReadable=function(t,r,e){var a=s.readability(t,r),i,n;switch(n=!1,i=rt(e),i.level+i.size){case"AAsmall":case"AAAlarge":n=a>=4.5;break;case"AAlarge":n=a>=3;break;case"AAAsmall":n=a>=7;break}return n};s.mostReadable=function(t,r,e){var a=null,i=0,n,h,f,o;e=e||{},h=e.includeFallbackColors,f=e.level,o=e.size;for(var g=0;gi&&(i=n,a=s(r[g]));return s.isReadable(t,a,{level:f,size:o})||!h?a:(e.includeFallbackColors=!1,s.mostReadable(t,["#fff","#000"],e))};var M=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K=s.hexNames=Q(M);function Q(t){var r={};for(var e in t)t.hasOwnProperty(e)&&(r[t[e]]=e);return r}function R(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function u(t,r){Y(t)&&(t="100%");var e=tt(t);return t=Math.min(r,Math.max(0,parseFloat(t))),e&&(t=parseInt(t*r,10)/100),Math.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function y(t){return Math.min(1,Math.max(0,t))}function l(t){return parseInt(t,16)}function Y(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function tt(t){return typeof t=="string"&&t.indexOf("%")!=-1}function b(t){return t.length==1?"0"+t:""+t}function m(t){return t<=1&&(t=t*100+"%"),t}function F(t){return Math.round(parseFloat(t)*255).toString(16)}function H(t){return l(t)/255}var c=(function(){var t="[-\\+]?\\d+%?",r="[-\\+]?\\d*\\.\\d+%?",e="(?:"+r+")|(?:"+t+")",a="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+a),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+a),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+a),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function p(t){return!!c.CSS_UNIT.exec(t)}function et(t){t=t.replace(I,"").replace(P,"").toLowerCase();var r=!1;if(M[t])t=M[t],r=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=c.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=c.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=c.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=c.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=c.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=c.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=c.hex8.exec(t))?{r:l(e[1]),g:l(e[2]),b:l(e[3]),a:H(e[4]),format:r?"name":"hex8"}:(e=c.hex6.exec(t))?{r:l(e[1]),g:l(e[2]),b:l(e[3]),format:r?"name":"hex"}:(e=c.hex4.exec(t))?{r:l(e[1]+""+e[1]),g:l(e[2]+""+e[2]),b:l(e[3]+""+e[3]),a:H(e[4]+""+e[4]),format:r?"name":"hex8"}:(e=c.hex3.exec(t))?{r:l(e[1]+""+e[1]),g:l(e[2]+""+e[2]),b:l(e[3]+""+e[3]),format:r?"name":"hex"}:!1}function rt(t){var r,e;return t=t||{level:"AA",size:"small"},r=(t.level||"AA").toUpperCase(),e=(t.size||"small").toLowerCase(),r!=="AA"&&r!=="AAA"&&(r="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:r,size:e}}export{it as E,s as t}; diff --git a/assets/treemap-KMMF4GRG-BAURD4mW.js b/assets/treemap-KMMF4GRG-BAURD4mW.js deleted file mode 100644 index b9f771478746a560153c28f7bd49257457a2096c..0000000000000000000000000000000000000000 --- a/assets/treemap-KMMF4GRG-BAURD4mW.js +++ /dev/null @@ -1,128 +0,0 @@ -import{af as wt}from"./index-DydPgVMC.js";import{m as st,f as $d,d as Sd}from"./min-Rtq3U8dQ.js";import{b as xd,l as kd,c as Id,m as Cd,r as fo,n as rs}from"./_baseUniq-BFKEI0vc.js";import{aO as wd}from"./mermaid.core-BcqUqpnI.js";function _d(t,e){return xd(st(t,e))}function Nd(t,e){return t&&t.length?kd(t,Id(e)):[]}function le(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ze(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function bd(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Kr(t){return typeof t=="object"&&t!==null&&le(t.container)&&ze(t.reference)&&typeof t.message=="string"}class Yu{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return le(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function tr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Xu(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Ju(t){return tr(t)&&typeof t.fullText=="string"}class ne{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new ne(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Ae})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Od(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new ne(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Ae:{done:!1,value:e(i)}})}filter(e){return new ne(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Ae})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new ne(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(si(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Ae})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new ne(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(si(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Ae})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new ne(()=>{const n=this.startFn();for(let r=0;r({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Ae:this.nextFn(n.state)))}distinct(e){return new ne(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Ae})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Od(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function si(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Ld=new ne(()=>{},()=>Ae),Ae=Object.freeze({done:!0,value:void 0});function re(...t){if(t.length===1){const e=t[0];if(e instanceof ne)return e;if(si(e))return new ne(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new ne(()=>({index:0}),n=>n.index1?new ne(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return Ae})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Ps;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(Ps||(Ps={}));function Ms(t){return new Aa(t,e=>tr(e)?e.content:[],{includeRoot:!0})}function Pd(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ds(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ai(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var rt;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(rt||(rt={}));function Md(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return rt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.linert.After}const Fd=/^[\w\p{L}]$/u;function Gd(t,e){if(t){const n=Ud(t,!0);if(n&&ho(n,e))return n;if(Ju(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(ho(s,e))return s}}}}function ho(t,e){return Xu(t)&&e.includes(t.tokenType.name)}function Ud(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class Zu extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function lr(t){throw new Error("Error! The input value was not handled.")}const Rr="AbstractRule",Ar="AbstractType",is="Condition",po="TypeDefinition",ss="ValueLiteral",yn="AbstractElement";function Bd(t){return F.isInstance(t,yn)}const Er="ArrayLiteral",$r="ArrayType",Tn="BooleanLiteral";function jd(t){return F.isInstance(t,Tn)}const vn="Conjunction";function Kd(t){return F.isInstance(t,vn)}const Rn="Disjunction";function Hd(t){return F.isInstance(t,Rn)}const Sr="Grammar",as="GrammarImport",An="InferredType";function Qu(t){return F.isInstance(t,An)}const En="Interface";function ec(t){return F.isInstance(t,En)}const os="NamedArgument",$n="Negation";function Vd(t){return F.isInstance(t,$n)}const xr="NumberLiteral",kr="Parameter",Sn="ParameterReference";function Wd(t){return F.isInstance(t,Sn)}const xn="ParserRule";function Ne(t){return F.isInstance(t,xn)}const Ir="ReferenceType",Hr="ReturnType";function zd(t){return F.isInstance(t,Hr)}const kn="SimpleType";function qd(t){return F.isInstance(t,kn)}const Cr="StringLiteral",Yt="TerminalRule";function Ut(t){return F.isInstance(t,Yt)}const In="Type";function tc(t){return F.isInstance(t,In)}const ls="TypeAttribute",wr="UnionType",Cn="Action";function _i(t){return F.isInstance(t,Cn)}const wn="Alternatives";function nc(t){return F.isInstance(t,wn)}const _n="Assignment";function Ot(t){return F.isInstance(t,_n)}const Nn="CharacterRange";function Yd(t){return F.isInstance(t,Nn)}const bn="CrossReference";function Ea(t){return F.isInstance(t,bn)}const On="EndOfFile";function Xd(t){return F.isInstance(t,On)}const Ln="Group";function $a(t){return F.isInstance(t,Ln)}const Pn="Keyword";function Lt(t){return F.isInstance(t,Pn)}const Mn="NegatedToken";function Jd(t){return F.isInstance(t,Mn)}const Dn="RegexToken";function Zd(t){return F.isInstance(t,Dn)}const Fn="RuleCall";function Pt(t){return F.isInstance(t,Fn)}const Gn="TerminalAlternatives";function Qd(t){return F.isInstance(t,Gn)}const Un="TerminalGroup";function eh(t){return F.isInstance(t,Un)}const Bn="TerminalRuleCall";function th(t){return F.isInstance(t,Bn)}const jn="UnorderedGroup";function rc(t){return F.isInstance(t,jn)}const Kn="UntilToken";function nh(t){return F.isInstance(t,Kn)}const Hn="Wildcard";function rh(t){return F.isInstance(t,Hn)}class ic extends Yu{getAllTypes(){return[yn,Rr,Ar,Cn,wn,Er,$r,_n,Tn,Nn,is,vn,bn,Rn,On,Sr,as,Ln,An,En,Pn,os,Mn,$n,xr,kr,Sn,xn,Ir,Dn,Hr,Fn,kn,Cr,Gn,Un,Yt,Bn,In,ls,po,wr,jn,Kn,ss,Hn]}computeIsSubtype(e,n){switch(e){case Cn:case wn:case _n:case Nn:case bn:case On:case Ln:case Pn:case Mn:case Dn:case Fn:case Gn:case Un:case Bn:case jn:case Kn:case Hn:return this.isSubtype(yn,n);case Er:case xr:case Cr:return this.isSubtype(ss,n);case $r:case Ir:case kn:case wr:return this.isSubtype(po,n);case Tn:return this.isSubtype(is,n)||this.isSubtype(ss,n);case vn:case Rn:case $n:case Sn:return this.isSubtype(is,n);case An:case En:case In:return this.isSubtype(Ar,n);case xn:return this.isSubtype(Rr,n)||this.isSubtype(Ar,n);case Yt:return this.isSubtype(Rr,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Ar;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Rr;case"Grammar:usedGrammars":return Sr;case"NamedArgument:parameter":case"ParameterReference:parameter":return kr;case"TerminalRuleCall:rule":return Yt;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case yn:return{name:yn,properties:[{name:"cardinality"},{name:"lookahead"}]};case Er:return{name:Er,properties:[{name:"elements",defaultValue:[]}]};case $r:return{name:$r,properties:[{name:"elementType"}]};case Tn:return{name:Tn,properties:[{name:"true",defaultValue:!1}]};case vn:return{name:vn,properties:[{name:"left"},{name:"right"}]};case Rn:return{name:Rn,properties:[{name:"left"},{name:"right"}]};case Sr:return{name:Sr,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case as:return{name:as,properties:[{name:"path"}]};case An:return{name:An,properties:[{name:"name"}]};case En:return{name:En,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case os:return{name:os,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case $n:return{name:$n,properties:[{name:"value"}]};case xr:return{name:xr,properties:[{name:"value"}]};case kr:return{name:kr,properties:[{name:"name"}]};case Sn:return{name:Sn,properties:[{name:"parameter"}]};case xn:return{name:xn,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Ir:return{name:Ir,properties:[{name:"referenceType"}]};case Hr:return{name:Hr,properties:[{name:"name"}]};case kn:return{name:kn,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Cr:return{name:Cr,properties:[{name:"value"}]};case Yt:return{name:Yt,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case In:return{name:In,properties:[{name:"name"},{name:"type"}]};case ls:return{name:ls,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case wr:return{name:wr,properties:[{name:"types",defaultValue:[]}]};case Cn:return{name:Cn,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case wn:return{name:wn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case _n:return{name:_n,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Nn:return{name:Nn,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case bn:return{name:bn,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case On:return{name:On,properties:[{name:"cardinality"},{name:"lookahead"}]};case Ln:return{name:Ln,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Pn:return{name:Pn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Mn:return{name:Mn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Dn:return{name:Dn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Fn:return{name:Fn,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Gn:return{name:Gn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Un:return{name:Un,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Bn:return{name:Bn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case jn:return{name:jn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Kn:return{name:Kn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Hn:return{name:Hn,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const F=new ic;function ih(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{le(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):le(n)&&(n.$container=t,n.$containerProperty=e))}function Ni(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function pt(t){const n=Fs(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Fs(t){for(;t.$container;)t=t.$container;return t}function Sa(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndexSa(n,e))}function Jt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Aa(t,n=>Sa(n,e),{includeRoot:!0})}function mo(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Dd(r,e):!1}function sc(t){return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class bi{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const uh=/\r?\n/gm,ch=new oc;class fh extends bi{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===` -`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Oi(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!` -`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const cs=new fh;function dh(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),cs.reset(t),cs.visit(ch.pattern(t)),cs.multiline}catch{return!1}}const hh=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function Gs(t){const e=typeof t=="string"?new RegExp(t):t;return hh.some(n=>e.test(n))}function Oi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ph(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Oi(e)).join("")}function mh(t,e){const n=gh(t),r=e.match(n);return!!r&&r[0].length>0}function gh(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(u){s+=n.substr(r,u),r+=u}function l(u){s+="(?:"+n.substr(r,u)+"|$)",r+=u}for(;r",r)-r+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):l(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:l(1);break}return s}return new RegExp(i(),t.flags)}function yh(t){return t.rules.find(e=>Ne(e)&&e.entry)}function Th(t){return t.rules.filter(e=>Ut(e)&&e.hidden)}function lc(t,e){const n=new Set,r=yh(t);if(!r)return new Set(t.rules);const i=[r].concat(Th(t));for(const a of i)uc(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||Ut(a)&&a.hidden)&&s.add(a);return s}function uc(t,e,n){e.add(t.name),ur(t).forEach(r=>{if(Pt(r)||n){const i=r.rule.ref;i&&!e.has(i.name)&&uc(i,e,n)}})}function vh(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=fc(t.type.ref);return e?.terminal}}function Rh(t){return t.hidden&&!Gs(Ca(t))}function Ah(t,e){return!t||!e?[]:xa(t,e,t.astNode,!0)}function cc(t,e,n){if(!t||!e)return;const r=xa(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function xa(t,e,n,r){if(!r){const i=Ni(t.grammarSource,Ot);if(i&&i.feature===e)return[t]}return tr(t)&&t.astNode===n?t.content.flatMap(i=>xa(i,e,n,!1)):[]}function Eh(t,e,n){if(!t)return;const r=$h(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function $h(t,e,n){if(t.astNode!==n)return[];if(Lt(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Ms(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?Lt(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function Sh(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=Ni(t.grammarSource,Ot);if(r)return r;t=t.container}}function fc(t){let e=t;return Qu(e)&&(_i(e.$container)?e=e.$container.$container:Ne(e.$container)?e=e.$container:lr(e.$container)),dc(t,e,new Map)}function dc(t,e,n){var r;function i(s,a){let o;return Ni(s,Ot)||(o=dc(a,a,n)),n.set(t,o),o}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of ur(e)){if(Ot(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Pt(s)&&Ne(s.rule.ref))return i(s,s.rule.ref);if(qd(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function hc(t){return pc(t,new Set)}function pc(t,e){if(e.has(t))return!0;e.add(t);for(const n of ur(t))if(Pt(n)){if(!n.rule.ref||Ne(n.rule.ref)&&!pc(n.rule.ref,e))return!1}else{if(Ot(n))return!1;if(_i(n))return!1}return!!t.definition}function ka(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(Ne(e))return e.name;if(ec(e)||tc(e))return e.name}}}function Ia(t){var e;if(Ne(t))return hc(t)?t.name:(e=ka(t))!==null&&e!==void 0?e:t.name;if(ec(t)||tc(t)||zd(t))return t.name;if(_i(t)){const n=xh(t);if(n)return n}else if(Qu(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function xh(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Ia(t.type.ref)}function kh(t){var e,n,r;return Ut(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=ka(t))!==null&&r!==void 0?r:t.name}function Ca(t){const e={s:!1,i:!1,u:!1},n=un(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const wa=/[\s\S]/.source;function un(t,e){if(Qd(t))return Ih(t);if(eh(t))return Ch(t);if(Yd(t))return Nh(t);if(th(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return at(un(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(Jd(t))return _h(t);if(nh(t))return wh(t);if(Zd(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),at(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(rh(t))return at(wa,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function Ih(t){return at(t.elements.map(e=>un(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function Ch(t){return at(t.elements.map(e=>un(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function wh(t){return at(`${wa}*?${un(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function _h(t){return at(`(?!${un(t.terminal)})${wa}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function Nh(t){return t.right?at(`[${fs(t.left)}-${fs(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):at(fs(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function fs(t){return Oi(t.value)}function at(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function bh(t){const e=[],n=t.Grammar;for(const r of n.rules)Ut(r)&&Rh(r)&&dh(Ca(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Fd}}var mc=typeof global=="object"&&global&&global.Object===Object&&global,Oh=typeof self=="object"&&self&&self.Object===Object&&self,Ye=mc||Oh||Function("return this")(),be=Ye.Symbol,gc=Object.prototype,Lh=gc.hasOwnProperty,Ph=gc.toString,pn=be?be.toStringTag:void 0;function Mh(t){var e=Lh.call(t,pn),n=t[pn];try{t[pn]=void 0;var r=!0}catch{}var i=Ph.call(t);return r&&(e?t[pn]=n:delete t[pn]),i}var Dh=Object.prototype,Fh=Dh.toString;function Gh(t){return Fh.call(t)}var Uh="[object Null]",Bh="[object Undefined]",To=be?be.toStringTag:void 0;function Rt(t){return t==null?t===void 0?Bh:Uh:To&&To in Object(t)?Mh(t):Gh(t)}function Be(t){return t!=null&&typeof t=="object"}var jh="[object Symbol]";function Li(t){return typeof t=="symbol"||Be(t)&&Rt(t)==jh}function Pi(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n0){if(++e>=vp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $p(t){return function(){return t}}var ui=(function(){try{var t=jt(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Sp=ui?function(t,e){return ui(t,"toString",{configurable:!0,enumerable:!1,value:$p(e),writable:!0})}:en,xp=Ep(Sp);function Tc(t,e){for(var n=-1,r=t==null?0:t.length;++n-1}var Cp=9007199254740991,wp=/^(?:0|[1-9]\d*)$/;function Di(t,e){var n=typeof t;return e=e??Cp,!!e&&(n=="number"||n!="symbol"&&wp.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Op}function Xe(t){return t!=null&&Oa(t.length)&&!ct(t)}function Ac(t,e,n){if(!Oe(n))return!1;var r=typeof e;return(r=="number"?Xe(n)&&Di(e,n.length):r=="string"&&e in n)?cr(n[e],t):!1}function Lp(t){return ba(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&Ac(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r-1}function Vm(t,e){var n=this.__data__,r=Bi(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ft(t){var e=-1,n=t==null?0:t.length;for(this.clear();++ei?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++ro))return!1;var u=s.get(t),c=s.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,h=n&By?new tn:void 0;for(s.set(t,e),s.set(e,t);++f2?e[2]:void 0;for(i&&Ac(e[0],e[1],i)&&(r=1);++n=NT&&(s=Ka,a=!1,e=new tn(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}var DT=Math.max;function FT(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Mi(n);return i<0&&(i=DT(r+i,0)),vc(t,Je(e),i)}var rn=MT(FT);function je(t){return t&&t.length?t[0]:void 0}function GT(t,e){var n=-1,r=Xe(t)?Array(t.length):[];return Kt(t,function(i,s,a){r[++n]=e(i,s,a)}),r}function I(t,e){var n=P(t)?Pi:GT;return n(t,Je(e))}function _e(t,e){return Ua(I(t,e))}var UT=Object.prototype,BT=UT.hasOwnProperty,jT=wT(function(t,e,n){BT.call(t,n)?t[n].push(e):Na(t,n,[e])}),KT=Object.prototype,HT=KT.hasOwnProperty;function VT(t,e){return t!=null&&HT.call(t,e)}function C(t,e){return t!=null&&Bc(t,e,VT)}var WT="[object String]";function pe(t){return typeof t=="string"||!P(t)&&Be(t)&&Rt(t)==WT}function zT(t,e){return Pi(e,function(n){return t[n]})}function J(t){return t==null?[]:zT(t,Le(t))}var qT=Math.max;function de(t,e,n,r){t=Xe(t)?t:J(t),n=n?Mi(n):0;var i=t.length;return n<0&&(n=qT(i+n,0)),pe(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&_a(t,e,n)>-1}function Yo(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return _a(t,e,i)}var YT="[object Map]",XT="[object Set]",JT=Object.prototype,ZT=JT.hasOwnProperty;function U(t){if(t==null)return!0;if(Xe(t)&&(P(t)||typeof t=="string"||typeof t.splice=="function"||nr(t)||La(t)||Gi(t)))return!t.length;var e=we(t);if(e==YT||e==XT)return!t.size;if(dr(t))return!Ic(t).length;for(var n in t)if(ZT.call(t,n))return!1;return!0}var QT="[object RegExp]";function ev(t){return Be(t)&&Rt(t)==QT}var Xo=mt&&mt.isRegExp,ot=Xo?Ui(Xo):ev;function lt(t){return t===void 0}var tv="Expected a function";function nv(t){if(typeof t!="function")throw new TypeError(tv);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function rv(t,e,n,r){if(!Oe(t))return t;e=Ki(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=uv){var u=lv(t);if(u)return Ha(u);a=!1,i=Ka,l=new tn}else l=o;e:for(;++r{n.accept(e)})}}class ce extends Ze{constructor(e){super([]),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class cn extends Ze{constructor(e){super(e.definition),this.orgText="",$e(this,Ke(e,n=>n!==void 0))}}class me extends Ze{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,$e(this,Ke(e,n=>n!==void 0))}}let ie=class extends Ze{constructor(e){super(e.definition),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}};class xe extends Ze{constructor(e){super(e.definition),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}}class ke extends Ze{constructor(e){super(e.definition),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}}class z extends Ze{constructor(e){super(e.definition),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}}class ge extends Ze{constructor(e){super(e.definition),this.idx=1,$e(this,Ke(e,n=>n!==void 0))}}class ye extends Ze{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,$e(this,Ke(e,n=>n!==void 0))}}class j{constructor(e){this.idx=1,$e(this,Ke(e,n=>n!==void 0))}accept(e){e.visit(this)}}function hv(t){return I(t,Wr)}function Wr(t){function e(n){return I(n,Wr)}if(t instanceof ce){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return pe(t.label)&&(n.label=t.label),n}else{if(t instanceof me)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ie)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof xe)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ke)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Wr(new j({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ge)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Wr(new j({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof z)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ye)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof j){const n={type:"Terminal",name:t.terminalType.name,label:fv(t.terminalType),idx:t.idx};pe(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=ot(r)?r.source:r),n}else{if(t instanceof cn)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class fn{visit(e){const n=e;switch(n.constructor){case ce:return this.visitNonTerminal(n);case me:return this.visitAlternative(n);case ie:return this.visitOption(n);case xe:return this.visitRepetitionMandatory(n);case ke:return this.visitRepetitionMandatoryWithSeparator(n);case ge:return this.visitRepetitionWithSeparator(n);case z:return this.visitRepetition(n);case ye:return this.visitAlternation(n);case j:return this.visitTerminal(n);case cn:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function pv(t){return t instanceof me||t instanceof ie||t instanceof z||t instanceof xe||t instanceof ke||t instanceof ge||t instanceof j||t instanceof cn}function fi(t,e=[]){return t instanceof ie||t instanceof z||t instanceof ge?!0:t instanceof ye?Hc(t.definition,r=>fi(r,e)):t instanceof ce&&de(e,t)?!1:t instanceof Ze?(t instanceof ce&&e.push(t),Ue(t.definition,r=>fi(r,e))):!1}function mv(t){return t instanceof ye}function We(t){if(t instanceof ce)return"SUBRULE";if(t instanceof ie)return"OPTION";if(t instanceof ye)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof ke)return"AT_LEAST_ONE_SEP";if(t instanceof ge)return"MANY_SEP";if(t instanceof z)return"MANY";if(t instanceof j)return"CONSUME";throw Error("non exhaustive match")}class Wi{walk(e,n=[]){w(e.definition,(r,i)=>{const s=te(e.definition,i+1);if(r instanceof ce)this.walkProdRef(r,s,n);else if(r instanceof j)this.walkTerminal(r,s,n);else if(r instanceof me)this.walkFlat(r,s,n);else if(r instanceof ie)this.walkOption(r,s,n);else if(r instanceof xe)this.walkAtLeastOne(r,s,n);else if(r instanceof ke)this.walkAtLeastOneSep(r,s,n);else if(r instanceof ge)this.walkManySep(r,s,n);else if(r instanceof z)this.walkMany(r,s,n);else if(r instanceof ye)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new ie({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=Jo(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new ie({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=Jo(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);w(e.definition,s=>{const a=new me({definition:[s]});this.walk(a,i)})}}function Jo(t,e,n){return[new ie({definition:[new j({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function mr(t){if(t instanceof ce)return mr(t.referencedRule);if(t instanceof j)return Tv(t);if(pv(t))return gv(t);if(mv(t))return yv(t);throw Error("non exhaustive match")}function gv(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=fi(s),e=e.concat(mr(s)),r=r+1,i=n.length>r;return za(e)}function yv(t){const e=I(t.definition,n=>mr(n));return za(Ge(e))}function Tv(t){return[t.terminalType]}const qc="_~IN~_";class vv extends Wi{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=Av(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new me({definition:s}),o=mr(a);this.follows[i]=o}}function Rv(t){const e={};return w(t,n=>{const r=new vv(n).startWalking();$e(e,r)}),e}function Av(t,e){return t.name+e+qc}let zr={};const Ev=new oc;function zi(t){const e=t.toString();if(zr.hasOwnProperty(e))return zr[e];{const n=Ev.pattern(e);return zr[e]=n,n}}function $v(){zr={}}const Yc="Complement Sets are not supported for first char optimization",di=`Unable to use "first char" lexer optimizations: -`;function Sv(t,e=!1){try{const n=zi(t);return Vs(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===Yc)e&&Vc(`${di} Unable to optimize: < ${t.toString()} > - Complement Sets cannot be automatically optimized. - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=` - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Hs(`${di} - Failed parsing: < ${t.toString()} > - Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Vs(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")br(l,e,n);else{const u=l;if(n===!0)for(let c=u.from;c<=u.to;c++)br(c,e,n);else{for(let c=u.from;c<=u.to&&c=Wn){const c=u.from>=Wn?u.from:Wn,f=u.to,d=gt(c),h=gt(f);for(let m=d;m<=h;m++)e[m]=m}}}});break;case"Group":Vs(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Ws(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return J(e)}function br(t,e,n){const r=gt(t);e[r]=r,n===!0&&xv(t,e)}function xv(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=gt(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=gt(i.charCodeAt(0));e[s]=s}}}function Zo(t,e){return rn(t.value,n=>{if(typeof n=="number")return de(e,n);{const r=n;return rn(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Ws(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?P(t.value)?Ue(t.value,Ws):Ws(t.value):!1}class kv extends bi{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){de(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Zo(e,this.targetCharCodes)===void 0&&(this.found=!0):Zo(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function qa(t,e){if(e instanceof RegExp){const n=zi(e),r=new kv(t);return r.visit(n),r.found}else return rn(e,n=>de(t,n.charCodeAt(0)))!==void 0}const Dt="PATTERN",Vn="defaultMode",Or="modes";let Xc=typeof new RegExp("(?:)").sticky=="boolean";function Iv(t,e){e=Wa(e,{useSticky:Xc,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:(E,v)=>v()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{Xv()});let r;n("Reject Lexer.NA",()=>{r=Vi(t,E=>E[Dt]===he.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=I(r,E=>{const v=E[Dt];if(ot(v)){const x=v.source;return x.length===1&&x!=="^"&&x!=="$"&&x!=="."&&!v.ignoreCase?x:x.length===2&&x[0]==="\\"&&!de(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],x[1])?x[1]:e.useSticky?el(v):Qo(v)}else{if(ct(v))return i=!0,{exec:v};if(typeof v=="object")return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;{const x=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),M=new RegExp(x);return e.useSticky?el(M):Qo(M)}}else throw Error("non exhaustive match")}})});let a,o,l,u,c;n("misc mapping",()=>{a=I(r,E=>E.tokenTypeIdx),o=I(r,E=>{const v=E.GROUP;if(v!==he.SKIPPED){if(pe(v))return v;if(lt(v))return!1;throw Error("non exhaustive match")}}),l=I(r,E=>{const v=E.LONGER_ALT;if(v)return P(v)?I(v,M=>Yo(r,M)):[Yo(r,v)]}),u=I(r,E=>E.PUSH_MODE),c=I(r,E=>C(E,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{const E=Qc(e.lineTerminatorCharacters);f=I(r,v=>!1),e.positionTracking!=="onlyOffset"&&(f=I(r,v=>C(v,"LINE_BREAKS")?!!v.LINE_BREAKS:Zc(v,E)===!1&&qa(E,v.PATTERN)))});let d,h,m,g;n("Misc Mapping #2",()=>{d=I(r,Jc),h=I(s,zv),m=Se(r,(E,v)=>{const x=v.GROUP;return pe(x)&&x!==he.SKIPPED&&(E[x]=[]),E},{}),g=I(s,(E,v)=>({pattern:s[v],longerAlt:l[v],canLineTerminator:f[v],isCustom:d[v],short:h[v],group:o[v],push:u[v],pop:c[v],tokenTypeIdx:a[v],tokenType:r[v]}))});let R=!0,y=[];return e.safeMode||n("First Char Optimization",()=>{y=Se(r,(E,v,x)=>{if(typeof v.PATTERN=="string"){const M=v.PATTERN.charCodeAt(0),ae=gt(M);ms(E,ae,g[x])}else if(P(v.START_CHARS_HINT)){let M;w(v.START_CHARS_HINT,ae=>{const Me=typeof ae=="string"?ae.charCodeAt(0):ae,Te=gt(Me);M!==Te&&(M=Te,ms(E,Te,g[x]))})}else if(ot(v.PATTERN))if(v.PATTERN.unicode)R=!1,e.ensureOptimizations&&Hs(`${di} Unable to analyze < ${v.PATTERN.toString()} > pattern. - The regexp unicode flag is not currently supported by the regexp-to-ast library. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const M=Sv(v.PATTERN,e.ensureOptimizations);U(M)&&(R=!1),w(M,ae=>{ms(E,ae,g[x])})}else e.ensureOptimizations&&Hs(`${di} TokenType: <${v.name}> is using a custom token pattern without providing parameter. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),R=!1;return E},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:R}}function Cv(t,e){let n=[];const r=_v(t);n=n.concat(r.errors);const i=Nv(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(wv(s)),n=n.concat(Gv(s)),n=n.concat(Uv(s,e)),n=n.concat(Bv(s)),n}function wv(t){let e=[];const n=Pe(t,r=>ot(r[Dt]));return e=e.concat(Ov(n)),e=e.concat(Mv(n)),e=e.concat(Dv(n)),e=e.concat(Fv(n)),e=e.concat(Lv(n)),e}function _v(t){const e=Pe(t,i=>!C(i,Dt)),n=I(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:q.MISSING_PATTERN,tokenTypes:[i]})),r=Hi(t,e);return{errors:n,valid:r}}function Nv(t){const e=Pe(t,i=>{const s=i[Dt];return!ot(s)&&!ct(s)&&!C(s,"exec")&&!pe(s)}),n=I(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:q.INVALID_PATTERN,tokenTypes:[i]})),r=Hi(t,e);return{errors:n,valid:r}}const bv=/[^\\][$]/;function Ov(t){class e extends bi{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Pe(t,i=>{const s=i.PATTERN;try{const a=zi(s),o=new e;return o.visit(a),o.found}catch{return bv.test(s.source)}});return I(n,i=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Lv(t){const e=Pe(t,r=>r.PATTERN.test(""));return I(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:q.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const Pv=/[^\\[][\^]|^\^/;function Mv(t){class e extends bi{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Pe(t,i=>{const s=i.PATTERN;try{const a=zi(s),o=new e;return o.visit(a),o.found}catch{return Pv.test(s.source)}});return I(n,i=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Dv(t){const e=Pe(t,r=>{const i=r[Dt];return i instanceof RegExp&&(i.multiline||i.global)});return I(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:q.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function Fv(t){const e=[];let n=I(t,s=>Se(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!de(e,o)&&o.PATTERN!==he.NA&&(e.push(o),a.push(o)),a),[]));n=pr(n);const r=Pe(n,s=>s.length>1);return I(r,s=>{const a=I(s,l=>l.name);return{message:`The same RegExp pattern ->${je(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:q.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function Gv(t){const e=Pe(t,r=>{if(!C(r,"GROUP"))return!1;const i=r.GROUP;return i!==he.SKIPPED&&i!==he.NA&&!pe(i)});return I(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:q.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function Uv(t,e){const n=Pe(t,i=>i.PUSH_MODE!==void 0&&!de(e,i.PUSH_MODE));return I(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:q.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function Bv(t){const e=[],n=Se(t,(r,i,s)=>{const a=i.PATTERN;return a===he.NA||(pe(a)?r.push({str:a,idx:s,tokenType:i}):ot(a)&&Kv(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return w(t,(r,i)=>{w(n,({str:s,idx:a,tokenType:o})=>{if(i${o.name}<- can never be matched. -Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:q.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function jv(t,e){if(ot(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ct(e))return e(t,0,[],{});if(C(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function Kv(t){return rn([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function Qo(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function el(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function Hv(t,e,n){const r=[];return C(t,Vn)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Vn+`> property in its definition -`,type:q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),C(t,Or)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Or+`> property in its definition -`,type:q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),C(t,Or)&&C(t,Vn)&&!C(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Vn}: <${t.defaultMode}>which does not exist -`,type:q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),C(t,Or)&&w(t.modes,(i,s)=>{w(i,(a,o)=>{if(lt(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}> -`,type:q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(C(a,"LONGER_ALT")){const l=P(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];w(l,u=>{!lt(u)&&!de(i,u)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${s}> -`,type:q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function Vv(t,e,n){const r=[];let i=!1;const s=pr(Ge(J(t.modes))),a=Vi(s,l=>l[Dt]===he.NA),o=Qc(n);return e&&w(a,l=>{const u=Zc(l,o);if(u!==!1){const f={message:Yv(l,u),type:u.issue,tokenType:l};r.push(f)}else C(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):qa(o,l.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found. - This Lexer has been defined to track line and column information, - But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:q.NO_LINE_BREAKS_FLAGS}),r}function Wv(t){const e={},n=Le(t);return w(n,r=>{const i=t[r];if(P(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Jc(t){const e=t.PATTERN;if(ot(e))return!1;if(ct(e))return!0;if(C(e,"exec"))return!0;if(pe(e))return!1;throw Error("non exhaustive match")}function zv(t){return pe(t)&&t.length===1?t.charCodeAt(0):!1}const qv={test:function(t){const e=t.length;for(let n=this.lastIndex;n Token Type - Root cause: ${e.errMsg}. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===q.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. - The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Qc(t){return I(t,n=>pe(n)?n.charCodeAt(0):n)}function ms(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Wn=256;let qr=[];function gt(t){return t255?255+~~(t/255):t}}function gr(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function hi(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let tl=1;const ef={};function yr(t){const e=Jv(t);Zv(e),eR(e),Qv(e),w(e,n=>{n.isParent=n.categoryMatches.length>0})}function Jv(t){let e=se(t),n=t,r=!0;for(;r;){n=pr(Ge(I(n,s=>s.CATEGORIES)));const i=Hi(n,e);e=e.concat(i),U(i)?r=!1:n=i}return e}function Zv(t){w(t,e=>{nf(e)||(ef[tl]=e,e.tokenTypeIdx=tl++),nl(e)&&!P(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),nl(e)||(e.CATEGORIES=[]),tR(e)||(e.categoryMatches=[]),nR(e)||(e.categoryMatchesMap={})})}function Qv(t){w(t,e=>{e.categoryMatches=[],w(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(ef[r].tokenTypeIdx)})})}function eR(t){w(t,e=>{tf([],e)})}function tf(t,e){w(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),w(e.CATEGORIES,n=>{const r=t.concat(e);de(r,n)||tf(r,n)})}function nf(t){return C(t,"tokenTypeIdx")}function nl(t){return C(t,"CATEGORIES")}function tR(t){return C(t,"categoryMatches")}function nR(t){return C(t,"categoryMatchesMap")}function rR(t){return C(t,"tokenTypeIdx")}const zs={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var q;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(q||(q={}));const zn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:zs,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(zn);class he{constructor(e,n=zn){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=Wc(s),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=$e({},zn,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===zn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=qv;else if(this.config.lineTerminatorCharacters===zn.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),P(e)?i={modes:{defaultMode:se(e)},defaultMode:Vn}:(s=!1,i=se(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Hv(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Vv(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},w(i.modes,(o,l)=>{i.modes[l]=Vi(o,u=>lt(u))});const a=Le(i.modes);if(w(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Cv(o,a))}),U(this.lexerDefinitionErrors)){yr(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Iv(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=$e({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!U(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=I(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- -`);throw new Error(`Errors detected in definition of Lexer: -`+l)}w(this.lexerDefinitionWarning,o=>{Vc(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Xc?(this.chopInput=en,this.match=this.matchWithTest):(this.updateLastIndex=X,this.match=this.matchWithExec),s&&(this.handleModes=X),this.trackStartLines===!1&&(this.computeNewColumn=en),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=X),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Se(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(n.ensureOptimizations&&!U(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. - Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{$v()}),this.TRACE_INIT("toFastProperties",()=>{zc(this)})})}tokenize(e,n=this.defaultMode){if(!U(this.lexerDefinitionErrors)){const i=I(this.lexerDefinitionErrors,s=>s.message).join(`----------------------- -`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,l,u,c,f,d,h,m,g,R,y;const E=e,v=E.length;let x=0,M=0;const ae=this.hasCustom?0:Math.floor(e.length/10),Me=new Array(ae),Te=[];let Ve=this.trackStartLines?1:void 0,Ie=this.trackStartLines?1:void 0;const $=Wv(this.emptyGroups),T=this.trackStartLines,k=this.config.lineTerminatorsPattern;let S=0,O=[],b=[];const N=[],ve=[];Object.freeze(ve);let Z;function W(){return O}function It(oe){const Ce=gt(oe),zt=b[Ce];return zt===void 0?ve:zt}const Ed=oe=>{if(N.length===1&&oe.tokenType.PUSH_MODE===void 0){const Ce=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(oe);Te.push({offset:oe.startOffset,line:oe.startLine,column:oe.startColumn,length:oe.image.length,message:Ce})}else{N.pop();const Ce=nn(N);O=this.patternIdxToConfig[Ce],b=this.charCodeToPatternIdxToConfig[Ce],S=O.length;const zt=this.canModeBeOptimized[Ce]&&this.config.safeMode===!1;b&&zt?Z=It:Z=W}};function lo(oe){N.push(oe),b=this.charCodeToPatternIdxToConfig[oe],O=this.patternIdxToConfig[oe],S=O.length,S=O.length;const Ce=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;b&&Ce?Z=It:Z=W}lo.call(this,n);let De;const uo=this.config.recoveryEnabled;for(;xl.length){l=a,u=c,De=et;break}}}break}}if(l!==null){if(f=l.length,d=De.group,d!==void 0&&(h=De.tokenTypeIdx,m=this.createTokenInstance(l,x,h,De.tokenType,Ve,Ie,f),this.handlePayload(m,u),d===!1?M=this.addToken(Me,M,m):$[d].push(m)),e=this.chopInput(e,f),x=x+f,Ie=this.computeNewColumn(Ie,f),T===!0&&De.canLineTerminator===!0){let Re=0,Qe,ht;k.lastIndex=0;do Qe=k.test(l),Qe===!0&&(ht=k.lastIndex-1,Re++);while(Qe===!0);Re!==0&&(Ve=Ve+Re,Ie=f-ht,this.updateTokenEndLineColumnLocation(m,d,ht,Re,Ve,Ie,f))}this.handleModes(De,Ed,lo,m)}else{const Re=x,Qe=Ve,ht=Ie;let et=uo===!1;for(;et===!1&&x ${Qt(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=` -but found: '`+je(e).image+"'";if(r)return s+r+o;{const l=Se(t,(d,h)=>d.concat(h),[]),u=I(l,d=>`[${I(d,h=>Qt(h)).join(", ")}]`),f=`one of these possible Token sequences: -${I(u,(d,h)=>` ${h+1}. ${d}`).join(` -`)}`;return s+f+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=` -but found: '`+je(e).image+"'";if(n)return i+n+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${I(t,u=>`[${I(u,c=>Qt(c)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(Xt);const aR={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+t.name+"<-"}},bt={buildDuplicateFoundError(t,e){function n(c){return c instanceof j?c.terminalType.name:c instanceof ce?c.nonTerminalName:""}const r=t.name,i=je(e),s=i.idx,a=We(i),o=n(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""} - appears more than once (${e.length} times) in the top level rule: ->${r}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES - `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` -`),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. -The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. -To resolve this make sure each Terminal and Non-Terminal names are unique -This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=I(t.prefixPath,i=>Qt(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix -in inside <${t.topLevelRule.name}> Rule, -<${e}> may appears as a prefix path in all these alternatives. -See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX -For Further details.`},buildAlternationAmbiguityError(t){const e=I(t.prefixPath,i=>Qt(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, -<${e}> may appears as a prefix path in all these alternatives. -`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,r},buildEmptyRepetitionError(t){let e=We(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. -This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. -Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: - inside <${t.topLevelRule.name}> Rule. - has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=I(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. -rule: <${e}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: - ${r} - To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof cn?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function oR(t,e){const n=new lR(t,e);return n.resolveRefs(),n.errors}class lR extends fn{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){w(J(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:fe.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class uR extends Wi{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=se(this.path.ruleStack).reverse(),this.occurrenceStack=se(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){U(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class cR extends uR{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new me({definition:i});this.possibleTokTypes=mr(s),this.found=!0}}}class qi extends Wi{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class fR extends qi{walkMany(e,n,r){if(e.idx===this.occurrence){const i=je(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof j&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class fl extends qi{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=je(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof j&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class dR extends qi{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=je(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof j&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class dl extends qi{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=je(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof j&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function qs(t,e,n=[]){n=se(n);let r=[],i=0;function s(o){return o.concat(te(t,i+1))}function a(o){const l=qs(s(o),e,n);return r.concat(l)}for(;n.length{U(l.definition)===!1&&(r=a(l.definition))}),r;if(o instanceof j)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:te(t,i)}),r}function of(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-r-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!U(f);){const d=f.pop();if(d===a){o&&nn(f).idx<=u&&f.pop();continue}const h=d.def,m=d.idx,g=d.ruleStack,R=d.occurrenceStack;if(U(h))continue;const y=h[0];if(y===i){const E={idx:m,def:te(h),ruleStack:sr(g),occurrenceStack:sr(R)};f.push(E)}else if(y instanceof j)if(m=0;E--){const v=y.definition[E],x={idx:m,def:v.definition.concat(te(h)),ruleStack:g,occurrenceStack:R};f.push(x),f.push(a)}else if(y instanceof me)f.push({idx:m,def:y.definition.concat(te(h)),ruleStack:g,occurrenceStack:R});else if(y instanceof cn)f.push(hR(y,m,g,R));else throw Error("non exhaustive match")}return c}function hR(t,e,n,r){const i=se(n);i.push(t.name);const s=se(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var H;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(H||(H={}));function Xa(t){if(t instanceof ie||t==="Option")return H.OPTION;if(t instanceof z||t==="Repetition")return H.REPETITION;if(t instanceof xe||t==="RepetitionMandatory")return H.REPETITION_MANDATORY;if(t instanceof ke||t==="RepetitionMandatoryWithSeparator")return H.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ge||t==="RepetitionWithSeparator")return H.REPETITION_WITH_SEPARATOR;if(t instanceof ye||t==="Alternation")return H.ALTERNATION;throw Error("non exhaustive match")}function hl(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Xa(r);return s===H.ALTERNATION?Yi(e,n,i):Xi(e,n,s,i)}function pR(t,e,n,r,i,s){const a=Yi(t,e,n),o=cf(a)?hi:gr;return s(a,r,o,i)}function mR(t,e,n,r,i,s){const a=Xi(t,e,i,n),o=cf(a)?hi:gr;return s(a[0],o,r)}function gR(t,e,n,r){const i=t.length,s=Ue(t,a=>Ue(a,o=>o.length===1));if(e)return function(a){const o=I(a,l=>l.GATE);for(let l=0;lGe(l)),o=Se(a,(l,u,c)=>(w(u,f=>{C(l,f.tokenTypeIdx)||(l[f.tokenTypeIdx]=c),w(f.categoryMatches,d=>{C(l,d)||(l[d]=c)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;as.length===1),i=t.length;if(r&&!n){const s=Ge(t);if(s.length===1&&U(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Se(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,w(l.categoryMatches,c=>{o[c]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sqs([a],1)),r=pl(n.length),i=I(n,a=>{const o={};return w(a,l=>{const u=gs(l.partialPath);w(u,c=>{o[c]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=pl(o.length);for(let l=0;l{const y=gs(R.partialPath);w(y,E=>{i[l][E]=!0})})}}}}return r}function Yi(t,e,n,r){const i=new lf(t,H.ALTERNATION,r);return e.accept(i),uf(i.result,n)}function Xi(t,e,n,r){const i=new lf(t,n);e.accept(i);const s=i.result,o=new TR(e,t,n).startWalking(),l=new me({definition:s}),u=new me({definition:o});return uf([l,u],r)}function Ys(t,e){e:for(let n=0;n{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function cf(t){return Ue(t,e=>Ue(e,n=>Ue(n,r=>U(r.categoryMatches))))}function AR(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return I(e,n=>Object.assign({type:fe.CUSTOM_LOOKAHEAD_VALIDATION},n))}function ER(t,e,n,r){const i=_e(t,l=>$R(l,n)),s=PR(t,e,n),a=_e(t,l=>NR(l,n)),o=_e(t,l=>kR(l,t,r,n));return i.concat(s,a,o)}function $R(t,e){const n=new xR;t.accept(n);const r=n.allProductions,i=jT(r,SR),s=Ke(i,o=>o.length>1);return I(J(s),o=>{const l=je(o),u=e.buildDuplicateFoundError(t,o),c=We(l),f={message:u,type:fe.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:l.idx},d=ff(l);return d&&(f.parameter=d),f})}function SR(t){return`${We(t)}_#_${t.idx}_#_${ff(t)}`}function ff(t){return t instanceof j?t.terminalType.name:t instanceof ce?t.nonTerminalName:""}class xR extends fn{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function kR(t,e,n,r){const i=[];if(Se(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:fe.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function IR(t,e,n){const r=[];let i;return de(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:fe.INVALID_RULE_OVERRIDE,ruleName:t})),r}function df(t,e,n,r=[]){const i=[],s=Yr(e.definition);if(U(s))return[];{const a=t.name;de(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:fe.LEFT_RECURSION,ruleName:a});const l=Hi(s,r.concat([t])),u=_e(l,c=>{const f=se(r);return f.push(c),df(t,c,n,f)});return i.concat(u)}}function Yr(t){let e=[];if(U(t))return e;const n=je(t);if(n instanceof ce)e.push(n.referencedRule);else if(n instanceof me||n instanceof ie||n instanceof xe||n instanceof ke||n instanceof ge||n instanceof z)e=e.concat(Yr(n.definition));else if(n instanceof ye)e=Ge(I(n.definition,s=>Yr(s.definition)));else if(!(n instanceof j))throw Error("non exhaustive match");const r=fi(n),i=t.length>1;if(r&&i){const s=te(t);return e.concat(Yr(s))}else return e}class Ja extends fn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function CR(t,e){const n=new Ja;t.accept(n);const r=n.alternations;return _e(r,s=>{const a=sr(s.definition);return _e(a,(o,l)=>{const u=of([o],[],gr,1);return U(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:fe.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}function wR(t,e,n){const r=new Ja;t.accept(r);let i=r.alternations;return i=Vi(i,a=>a.ignoreAmbiguities===!0),_e(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=Yi(o,t,l,a),c=OR(u,a,t,n),f=LR(u,a,t,n);return c.concat(f)})}class _R extends fn{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function NR(t,e){const n=new Ja;t.accept(n);const r=n.alternations;return _e(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:fe.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function bR(t,e,n){const r=[];return w(t,i=>{const s=new _R;i.accept(s);const a=s.allProductions;w(a,o=>{const l=Xa(o),u=o.maxLookahead||e,c=o.idx,d=Xi(c,i,l,u)[0];if(U(Ge(d))){const h=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:h,type:fe.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function OR(t,e,n,r){const i=[],s=Se(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||w(l,c=>{const f=[u];w(t,(d,h)=>{u!==h&&Ys(d,c)&&e.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!Ys(i,c)&&(i.push(c),o.push({alts:f,path:c}))}),o),[]);return I(s,o=>{const l=I(o.alts,c=>c+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:fe.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function LR(t,e,n,r){const i=Se(t,(a,o,l)=>{const u=I(o,c=>({idx:l,path:c}));return a.concat(u)},[]);return pr(_e(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,c=Pe(i,d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx{const h=[d.idx+1,l+1],m=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:h,prefixPath:d.path}),type:fe.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:m,alternatives:h}})}))}function PR(t,e,n){const r=[],i=I(e,s=>s.name);return w(t,s=>{const a=s.name;if(de(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:fe.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function MR(t){const e=Wa(t,{errMsgProvider:aR}),n={};return w(t.rules,r=>{n[r.name]=r}),oR(n,e.errMsgProvider)}function DR(t){return t=Wa(t,{errMsgProvider:bt}),ER(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const hf="MismatchedTokenException",pf="NoViableAltException",mf="EarlyExitException",gf="NotAllInputParsedException",yf=[hf,pf,mf,gf];Object.freeze(yf);function pi(t){return de(yf,t.name)}class Ji extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Tf extends Ji{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=hf}}class FR extends Ji{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=pf}}class GR extends Ji{constructor(e,n){super(e,n),this.name=gf}}class UR extends Ji{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=mf}}const ys={},vf="InRuleRecoveryException";class BR extends Error{constructor(e){super(e),this.name=vf}}class jR{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=C(e,"recoveryEnabled")?e.recoveryEnabled:ut.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=KR)}getTokenToInsert(e){const n=Ya(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=()=>{const d=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:d,ruleName:this.getCurrRuleFullName()}),m=new Tf(h,u,this.LA(0));m.resyncedTokens=sr(o),this.SAVE_ERROR(m)};for(;!l;)if(this.tokenMatcher(c,i)){f();return}else if(r.call(this)){f(),e.apply(this,n);return}else this.tokenMatcher(c,s)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new BR("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||U(n))return!1;const r=this.LA(1);return rn(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return de(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=rn(e,s=>af(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return ys;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return I(e,(r,i)=>i===0?ys:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=I(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Ge(e)}getFollowSetFromFollowKey(e){if(e===ys)return[yt];const n=e.ruleName+e.idxInCallingRule+qc+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,yt)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return sr(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=se(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return I(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function KR(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(l===void 0){const d=this.getCurrRuleFullName(),h=this.getGAstProductions()[d];l=new s(h,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,c=l.occurrence;const f=l.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=yt,c=1),!(u===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,c,a)&&this.tryInRepetitionRecovery(t,e,n,u)}const HR=4,At=8,Rf=1<df(n,n,bt))}validateEmptyOrAlternatives(e){return _e(e,n=>CR(n,bt))}validateAmbiguousAlternationAlternatives(e,n){return _e(e,r=>wR(r,n,bt))}validateSomeNonEmptyLookaheadPath(e,n){return bR(e,n,bt)}buildLookaheadForAlternation(e){return pR(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,gR)}buildLookaheadForOptional(e){return mR(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Xa(e.prodType),yR)}}class VR{initLooksAhead(e){this.dynamicTokensEnabled=C(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ut.dynamicTokensEnabled,this.maxLookahead=C(e,"maxLookahead")?e.maxLookahead:ut.maxLookahead,this.lookaheadStrategy=C(e,"lookaheadStrategy")?e.lookaheadStrategy:new Za({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){w(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=zR(n);w(r,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${We(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Ts(this.fullRuleNameToShort[n.name],Rf,u.idx);this.setLaFuncCache(d,f)})}),w(i,u=>{this.computeLookaheadFunc(n,u.idx,Xs,"Repetition",u.maxLookahead,We(u))}),w(s,u=>{this.computeLookaheadFunc(n,u.idx,Af,"Option",u.maxLookahead,We(u))}),w(a,u=>{this.computeLookaheadFunc(n,u.idx,Js,"RepetitionMandatory",u.maxLookahead,We(u))}),w(o,u=>{this.computeLookaheadFunc(n,u.idx,Xr,"RepetitionMandatoryWithSeparator",u.maxLookahead,We(u))}),w(l,u=>{this.computeLookaheadFunc(n,u.idx,Zs,"RepetitionWithSeparator",u.maxLookahead,We(u))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Ts(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return Ts(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class WR extends fn{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Lr=new WR;function zR(t){Lr.reset(),t.accept(Lr);const e=Lr.dslMethods;return Lr.reset(),e}function ml(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: - ${s.join(` - -`).replace(/\n/g,` - `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function QR(t,e,n){const r=function(){};Ef(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return w(e,s=>{i[s]=JR}),r.prototype=i,r.prototype.constructor=r,r}var Qs;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Qs||(Qs={}));function eA(t,e){return tA(t,e)}function tA(t,e){const n=Pe(e,i=>ct(t[i])===!1),r=I(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Qs.MISSING_METHOD,methodName:i}));return pr(r)}class nA{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=C(e,"nodeLocationTracking")?e.nodeLocationTracking:ut.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=X,this.cstFinallyStateUpdate=X,this.cstPostTerminal=X,this.cstPostNonTerminal=X,this.cstPostRule=X;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gl,this.setNodeLocationFromNode=gl,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ml,this.setNodeLocationFromNode=ml,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=X,this.setInitialNodeLocation=X;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];qR(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];YR(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(lt(this.baseCstVisitorConstructor)){const e=ZR(this.className,Le(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(lt(this.baseCstVisitorWithDefaultsConstructor)){const e=QR(this.className,Le(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class rA{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):gi}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?gi:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class iA{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=yi){if(de(this.definedRulesNames,e)){const a={message:bt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:fe.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=yi){const i=IR(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(pi(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return hv(J(this.gastProductionsCache))}}class sA{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=hi,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},C(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if(P(e)){if(U(e))throw Error(`A Token Vocabulary cannot be empty. - Note that the first argument for the parser constructor - is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(P(e))this.tokensMap=Se(e,(s,a)=>(s[a.name]=a,s),{});else if(C(e,"modes")&&Ue(Ge(J(e.modes)),rR)){const s=Ge(J(e.modes)),a=za(s);this.tokensMap=Se(a,(o,l)=>(o[l.name]=l,o),{})}else if(Oe(e))this.tokensMap=se(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=yt;const r=C(e,"modes")?Ge(J(e.modes)):J(e),i=Ue(r,s=>U(s.categoryMatches));this.tokenMatcher=i?hi:gr,yr(J(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=C(r,"resyncEnabled")?r.resyncEnabled:yi.resyncEnabled,s=C(r,"recoveryValueFunc")?r.recoveryValueFunc:yi.recoveryValueFunc,a=this.ruleShortNameIdx<a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Js,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,H.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Js,e,dR)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Xr,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,dl],o,Xr,e,dl)}else throw this.raiseEarlyExitException(e,H.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(Xs,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,Xs,e,fR,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Zs,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,fl],o,Zs,e,fl)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Xr,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(Rf,n),i=P(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new GR(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw pi(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Tf(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===vf?r:s}}else throw r}saveRecogState(){const e=this.errors,n=se(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),yt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class aA{initErrorHandler(e){this._errors=[],this.errorMessageProvider=C(e,"errorMessageProvider")?e.errorMessageProvider:ut.errorMessageProvider}SAVE_ERROR(e){if(pi(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:se(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return se(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Xi(e,s,n,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new UR(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Yi(e,i,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new FR(l,this.LA(1),o))}}class oA{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(lt(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return of([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=je(e.ruleStack),i=this.getGAstProductions()[n];return new cR(i,e).startWalking()}}const Zi={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Zi);const yl=!0,Tl=Math.pow(2,At)-1,$f=sf({name:"RECORDING_PHASE_TOKEN",pattern:he.NA});yr([$f]);const Sf=Ya($f,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Sf);const lA={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class uA{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return gi}topLevelRuleRecord(e,n){try{const r=new cn({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` - This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return mn.call(this,ie,e,n)}atLeastOneInternalRecord(e,n){mn.call(this,xe,n,e)}atLeastOneSepFirstInternalRecord(e,n){mn.call(this,ke,n,e,yl)}manyInternalRecord(e,n){mn.call(this,z,n,e)}manySepFirstInternalRecord(e,n){mn.call(this,ge,n,e,yl)}orInternalRecord(e,n){return cA.call(this,e,n)}subruleInternalRecord(e,n,r){if(mi(n),!e||C(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=nn(this.recordingProdStack),s=e.ruleName,a=new ce({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?lA:Zi}consumeInternalRecord(e,n,r){if(mi(n),!nf(e)){const a=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=nn(this.recordingProdStack),s=new j({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),Sf}}function mn(t,e,n,r=!1){mi(n);const i=nn(this.recordingProdStack),s=ct(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),C(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),Zi}function cA(t,e){mi(e);const n=nn(this.recordingProdStack),r=P(t)===!1,i=r===!1?t:t.DEF,s=new ye({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});C(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=Hc(i,o=>ct(o.GATE));return s.hasPredicates=a,n.definition.push(s),w(i,o=>{const l=new me({definition:[]});s.definition.push(l),C(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:C(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Zi}function vl(t){return t===0?"":`${t}`}function mi(t){if(t<0||t>Tl){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${Tl+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class fA{initPerformanceTracer(e){if(C(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=ut.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:s}=Wc(n),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function dA(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const gi=Ya(yt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(gi);const ut=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Xt,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),yi=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var fe;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(fe||(fe={}));function Rl(t=void 0){return function(){return t}}class Tr{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{zc(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),w(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=MR({rules:J(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(U(r)&&this.skipValidations===!1){const i=DR({rules:J(this.gastProductionsCache),tokenTypes:J(this.tokensMap),errMsgProvider:bt,grammarName:n}),s=AR({lookaheadStrategy:this.lookaheadStrategy,rules:J(this.gastProductionsCache),tokenTypes:J(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),U(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Rv(J(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:J(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(J(this.gastProductionsCache))})),!Tr.DEFER_DEFINITION_ERRORS_HANDLING&&!U(this.definitionErrors))throw e=I(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: - ${e.join(` -------------------------------- -`)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),C(n,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. - Please use the flag on the relevant DSL method instead. - See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=C(n,"skipValidations")?n.skipValidations:ut.skipValidations}}Tr.DEFER_DEFINITION_ERRORS_HANDLING=!1;dA(Tr,[jR,VR,nA,rA,sA,iA,aA,oA,uA,fA]);class hA extends Tr{constructor(e,n=ut){const r=se(n);r.outputCst=!1,super(e,r)}}function sn(t,e,n){return`${t.name}_${e}_${n}`}const Tt=1,pA=2,xf=4,kf=5,vr=7,mA=8,gA=9,yA=10,TA=11,If=12;class Qa{constructor(e){this.target=e}isEpsilon(){return!1}}class eo extends Qa{constructor(e,n){super(e),this.tokenType=n}}class Cf extends Qa{constructor(e){super(e)}isEpsilon(){return!0}}class to extends Qa{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function vA(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};RA(e,t);const n=t.length;for(let r=0;rwf(t,e,a));return dn(t,e,r,n,...i)}function kA(t,e,n){const r=Q(t,e,n,{type:Tt});Et(t,r);const i=dn(t,e,r,n,Ht(t,e,n));return IA(t,e,n,i)}function Ht(t,e,n){const r=Cd(st(n.definition,i=>wf(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:wA(t,r)}function _f(t,e,n,r,i){const s=r.left,a=r.right,o=Q(t,e,n,{type:TA});Et(t,o);const l=Q(t,e,n,{type:If});return s.loopback=o,l.loopback=o,t.decisionMap[sn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,Y(a,o),i===void 0?(Y(o,s),Y(o,l)):(Y(o,l),Y(o,i.left),Y(i.right,s)),{left:s,right:l}}function Nf(t,e,n,r,i){const s=r.left,a=r.right,o=Q(t,e,n,{type:yA});Et(t,o);const l=Q(t,e,n,{type:If}),u=Q(t,e,n,{type:gA});return o.loopback=u,l.loopback=u,Y(o,s),Y(o,l),Y(a,u),i!==void 0?(Y(u,l),Y(u,i.left),Y(i.right,s)):Y(u,o),t.decisionMap[sn(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:l}}function IA(t,e,n,r){const i=r.left,s=r.right;return Y(i,s),t.decisionMap[sn(e,"Option",n.idx)]=i,r}function Et(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function dn(t,e,n,r,...i){const s=Q(t,e,r,{type:mA,start:n});n.end=s;for(const o of i)o!==void 0?(Y(n,o.left),Y(o.right,s)):Y(n,s);const a={left:n,right:s};return t.decisionMap[sn(e,CA(r),r.idx)]=n,a}function CA(t){if(t instanceof ye)return"Alternation";if(t instanceof ie)return"Option";if(t instanceof z)return"Repetition";if(t instanceof ge)return"RepetitionWithSeparator";if(t instanceof xe)return"RepetitionMandatory";if(t instanceof ke)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function wA(t,e){const n=e.length;for(let s=0;se.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function bf(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function OA(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class Of{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=vA(e.rules),this.dfas=PA(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=sn(r,"Alternation",n),c=this.atn.decisionMap[l].decision,f=st(hl({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),d=>st(d,h=>h[0]));if(El(f,!1)&&!s){const d=fo(f,(h,m,g)=>(rs(m,R=>{R&&(h[R.tokenTypeIdx]=g,rs(R.categoryMatches,y=>{h[y]=g}))}),h),{});return i?function(h){var m;const g=this.LA(1),R=d[g.tokenTypeIdx];if(h!==void 0&&R!==void 0){const y=(m=h[R])===null||m===void 0?void 0:m.GATE;if(y!==void 0&&y.call(this)===!1)return}return R}:function(){const h=this.LA(1);return d[h.tokenTypeIdx]}}else return i?function(d){const h=new Of,m=d===void 0?0:d.length;for(let R=0;Rst(d,h=>h[0]));if(El(f)&&f[0][0]&&!s){const d=f[0],h=$d(d);if(h.length===1&&wd(h[0].categoryMatches)){const g=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}else{const m=fo(h,(g,R)=>(R!==void 0&&(g[R.tokenTypeIdx]=!0,rs(R.categoryMatches,y=>{g[y]=!0})),g),{});return function(){const g=this.LA(1);return m[g.tokenTypeIdx]===!0}}}return function(){const d=vs.call(this,a,c,Al,o);return typeof d=="object"?!1:d===0}}}function El(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function PA(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;rQt(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${UA(t.production)}${n}> inside <${t.topLevelRule.name}> Rule, -<${e}> may appears as a prefix path in all these alternatives. -`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,r}function UA(t){if(t instanceof ce)return"SUBRULE";if(t instanceof ie)return"OPTION";if(t instanceof ye)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof ke)return"AT_LEAST_ONE_SEP";if(t instanceof ge)return"MANY_SEP";if(t instanceof z)return"MANY";if(t instanceof j)return"CONSUME";throw Error("non exhaustive match")}function BA(t,e,n){const r=_d(e.configs.elements,s=>s.state.transitions),i=Nd(r.filter(s=>s instanceof eo).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function jA(t,e){return t.edges[e.tokenTypeIdx]}function KA(t,e,n){const r=new ea,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===vr){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!qA(s))for(const a of i)s.add(a);return s}function HA(t,e){if(t instanceof eo&&af(e,t.tokenType))return t.target}function VA(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Lf(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function $l(t,e,n,r){return r=Pf(t,r),e.edges[n.tokenTypeIdx]=r,r}function Pf(t,e){if(e===Ti)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function WA(t){const e=new ea,n=t.transitions.length;for(let r=0;r0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};vi(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i1)return!0;return!1}function QA(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Sl;(function(t){function e(n){return typeof n=="string"}t.is=e})(Sl||(Sl={}));var ta;(function(t){function e(n){return typeof n=="string"}t.is=e})(ta||(ta={}));var xl;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(xl||(xl={}));var Ri;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Ri||(Ri={}));var D;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Ri.MAX_VALUE),i===Number.MAX_VALUE&&(i=Ri.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return p.objectLiteral(i)&&p.uinteger(i.line)&&p.uinteger(i.character)}t.is=n})(D||(D={}));var L;(function(t){function e(r,i,s,a){if(p.uinteger(r)&&p.uinteger(i)&&p.uinteger(s)&&p.uinteger(a))return{start:D.create(r,i),end:D.create(s,a)};if(D.is(r)&&D.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return p.objectLiteral(i)&&D.is(i.start)&&D.is(i.end)}t.is=n})(L||(L={}));var Ai;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(p.string(i.uri)||p.undefined(i.uri))}t.is=n})(Ai||(Ai={}));var kl;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return p.objectLiteral(i)&&L.is(i.targetRange)&&p.string(i.targetUri)&&L.is(i.targetSelectionRange)&&(L.is(i.originSelectionRange)||p.undefined(i.originSelectionRange))}t.is=n})(kl||(kl={}));var na;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&p.numberRange(i.red,0,1)&&p.numberRange(i.green,0,1)&&p.numberRange(i.blue,0,1)&&p.numberRange(i.alpha,0,1)}t.is=n})(na||(na={}));var Il;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&L.is(i.range)&&na.is(i.color)}t.is=n})(Il||(Il={}));var Cl;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.undefined(i.textEdit)||on.is(i))&&(p.undefined(i.additionalTextEdits)||p.typedArray(i.additionalTextEdits,on.is))}t.is=n})(Cl||(Cl={}));var wl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(wl||(wl={}));var _l;(function(t){function e(r,i,s,a,o,l){const u={startLine:r,endLine:i};return p.defined(s)&&(u.startCharacter=s),p.defined(a)&&(u.endCharacter=a),p.defined(o)&&(u.kind=o),p.defined(l)&&(u.collapsedText=l),u}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&p.uinteger(i.startLine)&&p.uinteger(i.startLine)&&(p.undefined(i.startCharacter)||p.uinteger(i.startCharacter))&&(p.undefined(i.endCharacter)||p.uinteger(i.endCharacter))&&(p.undefined(i.kind)||p.string(i.kind))}t.is=n})(_l||(_l={}));var ra;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return p.defined(i)&&Ai.is(i.location)&&p.string(i.message)}t.is=n})(ra||(ra={}));var Nl;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Nl||(Nl={}));var bl;(function(t){t.Unnecessary=1,t.Deprecated=2})(bl||(bl={}));var Ol;(function(t){function e(n){const r=n;return p.objectLiteral(r)&&p.string(r.href)}t.is=e})(Ol||(Ol={}));var Ei;(function(t){function e(r,i,s,a,o,l){let u={range:r,message:i};return p.defined(s)&&(u.severity=s),p.defined(a)&&(u.code=a),p.defined(o)&&(u.source=o),p.defined(l)&&(u.relatedInformation=l),u}t.create=e;function n(r){var i;let s=r;return p.defined(s)&&L.is(s.range)&&p.string(s.message)&&(p.number(s.severity)||p.undefined(s.severity))&&(p.integer(s.code)||p.string(s.code)||p.undefined(s.code))&&(p.undefined(s.codeDescription)||p.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(p.string(s.source)||p.undefined(s.source))&&(p.undefined(s.relatedInformation)||p.typedArray(s.relatedInformation,ra.is))}t.is=n})(Ei||(Ei={}));var an;(function(t){function e(r,i,...s){let a={title:r,command:i};return p.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return p.defined(i)&&p.string(i.title)&&p.string(i.command)}t.is=n})(an||(an={}));var on;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return p.objectLiteral(a)&&p.string(a.newText)&&L.is(a.range)}t.is=i})(on||(on={}));var ia;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(p.string(i.description)||i.description===void 0)}t.is=n})(ia||(ia={}));var ln;(function(t){function e(n){const r=n;return p.string(r)}t.is=e})(ln||(ln={}));var Ll;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return on.is(a)&&(ia.is(a.annotationId)||ln.is(a.annotationId))}t.is=i})(Ll||(Ll={}));var sa;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return p.defined(i)&&ca.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(sa||(sa={}));var aa;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&p.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ln.is(i.annotationId))}t.is=n})(aa||(aa={}));var oa;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&p.string(i.oldUri)&&p.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ln.is(i.annotationId))}t.is=n})(oa||(oa={}));var la;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&p.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||p.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||p.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ln.is(i.annotationId))}t.is=n})(la||(la={}));var ua;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>p.string(i.kind)?aa.is(i)||oa.is(i)||la.is(i):sa.is(i)))}t.is=e})(ua||(ua={}));var Pl;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return p.defined(i)&&p.string(i.uri)}t.is=n})(Pl||(Pl={}));var Ml;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.integer(i.version)}t.is=n})(Ml||(Ml={}));var ca;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return p.defined(i)&&p.string(i.uri)&&(i.version===null||p.integer(i.version))}t.is=n})(ca||(ca={}));var Dl;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.string(i.languageId)&&p.integer(i.version)&&p.string(i.text)}t.is=n})(Dl||(Dl={}));var fa;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(fa||(fa={}));var ar;(function(t){function e(n){const r=n;return p.objectLiteral(n)&&fa.is(r.kind)&&p.string(r.value)}t.is=e})(ar||(ar={}));var Fl;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Fl||(Fl={}));var Gl;(function(t){t.PlainText=1,t.Snippet=2})(Gl||(Gl={}));var Ul;(function(t){t.Deprecated=1})(Ul||(Ul={}));var Bl;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&p.string(i.newText)&&L.is(i.insert)&&L.is(i.replace)}t.is=n})(Bl||(Bl={}));var jl;(function(t){t.asIs=1,t.adjustIndentation=2})(jl||(jl={}));var Kl;(function(t){function e(n){const r=n;return r&&(p.string(r.detail)||r.detail===void 0)&&(p.string(r.description)||r.description===void 0)}t.is=e})(Kl||(Kl={}));var Hl;(function(t){function e(n){return{label:n}}t.create=e})(Hl||(Hl={}));var Vl;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(Vl||(Vl={}));var $i;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return p.string(i)||p.objectLiteral(i)&&p.string(i.language)&&p.string(i.value)}t.is=n})($i||($i={}));var Wl;(function(t){function e(n){let r=n;return!!r&&p.objectLiteral(r)&&(ar.is(r.contents)||$i.is(r.contents)||p.typedArray(r.contents,$i.is))&&(n.range===void 0||L.is(n.range))}t.is=e})(Wl||(Wl={}));var zl;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(zl||(zl={}));var ql;(function(t){function e(n,r,...i){let s={label:n};return p.defined(r)&&(s.documentation=r),p.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(ql||(ql={}));var Yl;(function(t){t.Text=1,t.Read=2,t.Write=3})(Yl||(Yl={}));var Xl;(function(t){function e(n,r){let i={range:n};return p.number(r)&&(i.kind=r),i}t.create=e})(Xl||(Xl={}));var Jl;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Jl||(Jl={}));var Zl;(function(t){t.Deprecated=1})(Zl||(Zl={}));var Ql;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(Ql||(Ql={}));var eu;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(eu||(eu={}));var tu;(function(t){function e(r,i,s,a,o,l){let u={name:r,detail:i,kind:s,range:a,selectionRange:o};return l!==void 0&&(u.children=l),u}t.create=e;function n(r){let i=r;return i&&p.string(i.name)&&p.number(i.kind)&&L.is(i.range)&&L.is(i.selectionRange)&&(i.detail===void 0||p.string(i.detail))&&(i.deprecated===void 0||p.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(tu||(tu={}));var nu;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(nu||(nu={}));var Si;(function(t){t.Invoked=1,t.Automatic=2})(Si||(Si={}));var ru;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return p.defined(i)&&p.typedArray(i.diagnostics,Ei.is)&&(i.only===void 0||p.typedArray(i.only,p.string))&&(i.triggerKind===void 0||i.triggerKind===Si.Invoked||i.triggerKind===Si.Automatic)}t.is=n})(ru||(ru={}));var iu;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):an.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&p.string(i.title)&&(i.diagnostics===void 0||p.typedArray(i.diagnostics,Ei.is))&&(i.kind===void 0||p.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||an.is(i.command))&&(i.isPreferred===void 0||p.boolean(i.isPreferred))&&(i.edit===void 0||ua.is(i.edit))}t.is=n})(iu||(iu={}));var su;(function(t){function e(r,i){let s={range:r};return p.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.command)||an.is(i.command))}t.is=n})(su||(su={}));var au;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return p.defined(i)&&p.uinteger(i.tabSize)&&p.boolean(i.insertSpaces)}t.is=n})(au||(au={}));var ou;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.target)||p.string(i.target))}t.is=n})(ou||(ou={}));var lu;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(lu||(lu={}));var uu;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(uu||(uu={}));var cu;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(cu||(cu={}));var fu;(function(t){function e(n){const r=n;return p.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(fu||(fu={}));var du;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&L.is(i.range)&&p.string(i.text)}t.is=n})(du||(du={}));var hu;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&L.is(i.range)&&p.boolean(i.caseSensitiveLookup)&&(p.string(i.variableName)||i.variableName===void 0)}t.is=n})(hu||(hu={}));var pu;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&L.is(i.range)&&(p.string(i.expression)||i.expression===void 0)}t.is=n})(pu||(pu={}));var mu;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return p.defined(i)&&L.is(r.stoppedLocation)}t.is=n})(mu||(mu={}));var da;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(da||(da={}));var ha;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&(i.tooltip===void 0||p.string(i.tooltip)||ar.is(i.tooltip))&&(i.location===void 0||Ai.is(i.location))&&(i.command===void 0||an.is(i.command))}t.is=n})(ha||(ha={}));var gu;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return p.objectLiteral(i)&&D.is(i.position)&&(p.string(i.label)||p.typedArray(i.label,ha.is))&&(i.kind===void 0||da.is(i.kind))&&i.textEdits===void 0||p.typedArray(i.textEdits,on.is)&&(i.tooltip===void 0||p.string(i.tooltip)||ar.is(i.tooltip))&&(i.paddingLeft===void 0||p.boolean(i.paddingLeft))&&(i.paddingRight===void 0||p.boolean(i.paddingRight))}t.is=n})(gu||(gu={}));var yu;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(yu||(yu={}));var Tu;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(Tu||(Tu={}));var vu;(function(t){function e(n){return{items:n}}t.create=e})(vu||(vu={}));var Ru;(function(t){t.Invoked=0,t.Automatic=1})(Ru||(Ru={}));var Au;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(Au||(Au={}));var Eu;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(Eu||(Eu={}));var $u;(function(t){function e(n){const r=n;return p.objectLiteral(r)&&ta.is(r.uri)&&p.string(r.name)}t.is=e})($u||($u={}));var Su;(function(t){function e(s,a,o,l){return new eE(s,a,o,l)}t.create=e;function n(s){let a=s;return!!(p.defined(a)&&p.string(a.uri)&&(p.undefined(a.languageId)||p.string(a.languageId))&&p.uinteger(a.lineCount)&&p.func(a.getText)&&p.func(a.positionAt)&&p.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),l=i(a,(c,f)=>{let d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d}),u=o.length;for(let c=l.length-1;c>=0;c--){let f=l[c],d=s.offsetAt(f.range.start),h=s.offsetAt(f.range.end);if(h<=u)o=o.substring(0,d)+f.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");u=d}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,l=s.slice(0,o),u=s.slice(o);i(l,a),i(u,a);let c=0,f=0,d=0;for(;c0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return D.create(0,e);for(;re?i=a:r=a+1}let s=r-1;return D.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function a(h){return e.call(h)==="[object Number]"}t.number=a;function o(h,m,g){return e.call(h)==="[object Number]"&&m<=h&&h<=g}t.numberRange=o;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=l;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=u;function c(h){return e.call(h)==="[object Function]"}t.func=c;function f(h){return h!==null&&typeof h=="object"}t.objectLiteral=f;function d(h,m){return Array.isArray(h)&&h.every(m)}t.typedArray=d})(p||(p={}));class tE{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Df(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new io;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new pa(e.startOffset,e.image.length,Ds(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new pa(s.startOffset,s.image.length,Ds(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class Mf{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class pa extends Mf{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class io extends Mf{constructor(){super(...arguments),this.content=new so(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class so extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,so.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class Df extends io{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const ma=Symbol("Datatype");function Rs(t){return t.$type===ma}const xu="​",Ff=t=>t.endsWith(xu)?t:t+xu;class Gf{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new aE(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class nE extends Gf{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new tE,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(Ff(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(hc(e))return ma;{const n=ka(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const a={$type:e};this.stack.push(a),e===ma&&(a.value="")}let s;try{s=n(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;ir)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:l}=this.getAssignment(r),u=this.current;if(o){const c=Lt(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,c,a,l)}else if(Rs(u)){let c=i.image;Lt(r)||(c=this.converter.convert(c,a).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,n,s);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,i,a)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(Rs(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(l)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return ih(e),this.nodeBuilder.construct(e),this.stack.pop(),Rs(e)?this.converter.convert(e.value,e.$cstNode):(sh(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Ni(e,Ot);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?Ea(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class rE{buildMismatchTokenMessage(e){return Xt.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Xt.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Xt.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Xt.buildEarlyExitMessage(e)}}class Uf extends rE{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class iE extends Gf{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(Ff(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const sE={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Uf};class aE extends hA{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},sE),{lookaheadStrategy:r?new Za({maxLookahead:n.maxLookahead}):new LA({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function Bf(t,e,n){return oE({parser:e,tokens:n,ruleNames:new Map},t),e}function oE(t,e){const n=lc(e,!1),r=re(e.rules).filter(Ne).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,Ft(s,i.definition))}}function Ft(t,e,n=!1){let r;if(Lt(e))r=pE(t,e);else if(_i(e))r=lE(t,e);else if(Ot(e))r=Ft(t,e.terminal);else if(Ea(e))r=jf(t,e);else if(Pt(e))r=uE(t,e);else if(nc(e))r=fE(t,e);else if(rc(e))r=dE(t,e);else if($a(e))r=hE(t,e);else if(Xd(e)){const i=t.consume++;r=()=>t.parser.consume(i,yt,e)}else throw new Zu(e.$cstNode,`Unexpected element type: ${e.$type}`);return Kf(t,n?void 0:xi(e),r,e.cardinality)}function lE(t,e){const n=Ia(e);return()=>t.parser.action(n,e)}function uE(t,e){const n=e.rule.ref;if(Ne(n)){const r=t.subrule++,i=n.fragment,s=e.arguments.length>0?cE(n,e.arguments):()=>({});return a=>t.parser.subrule(r,Hf(t,n),i,e,s(a))}else if(Ut(n)){const r=t.consume++,i=ga(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)lr();else throw new Zu(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function cE(t,e){const n=e.map(r=>it(r.value));return r=>{const i={};for(let s=0;se(r)||n(r)}else if(Kd(t)){const e=it(t.left),n=it(t.right);return r=>e(r)&&n(r)}else if(Vd(t)){const e=it(t.value);return n=>!e(n)}else if(Wd(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(jd(t)){const e=!!t.true;return()=>e}lr()}function fE(t,e){if(e.elements.length===1)return Ft(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Ft(t,i,!0)},a=xi(i);a&&(s.GATE=it(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function dE(t,e){if(e.elements.length===1)return Ft(t,e.elements[0]);const n=[];for(const o of e.elements){const l={ALT:Ft(t,o,!0)},u=xi(o);u&&(l.GATE=it(u)),n.push(l)}const r=t.or++,i=(o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},s=o=>t.parser.alternatives(r,n.map((l,u)=>{const c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(l.ALT(o),!f.isRecording()){const h=i(r,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);const m=f.unorderedGroups.get(h);typeof m?.[u]>"u"&&(m[u]=!0)}};const d=l.GATE;return d?c.GATE=()=>d(o):c.GATE=()=>{const h=f.unorderedGroups.get(i(r,f));return!h?.[u]},c})),a=Kf(t,xi(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function hE(t,e){const n=e.elements.map(r=>Ft(t,r));return r=>n.forEach(i=>i(r))}function xi(t){if($a(t))return t.guardCondition}function jf(t,e,n=e.terminal){if(n)if(Pt(n)&&Ne(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,Hf(t,r),!1,e,s)}else if(Pt(n)&&Ut(n.rule.ref)){const r=t.consume++,i=ga(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Lt(n)){const r=t.consume++,i=ga(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=fc(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Ia(e.type.ref));return jf(t,e,i)}}function pE(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function Kf(t,e,n,r){const i=e&&it(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:Rl(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:Rl(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else lr()}function Hf(t,e){const n=mE(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function mE(t,e){if(Ne(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Ne(r);)($a(r)||nc(r)||rc(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function ga(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function gE(t){const e=t.Grammar,n=t.parser.Lexer,r=new iE(t);return Bf(e,r,n.definition),r.finalize(),r}function yE(t){const e=TE(t);return e.finalize(),e}function TE(t){const e=t.Grammar,n=t.parser.Lexer,r=new nE(t);return Bf(e,r,n.definition)}class Vf{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=re(lc(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(a=>{const o=a.PATTERN;typeof o=="object"&&o&&"test"in o&&Gs(o)?s.unshift(a):s.push(a)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Ut).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Ca(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Gs(n)?he.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(Ne).flatMap(i=>ur(i).filter(Lt)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(ph(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&mh("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Wf{convert(e,n){let r=n.grammarSource;if(Ea(r)&&(r=vh(r)),Pt(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return tt.convertInt(n);case"STRING":return tt.convertString(n);case"ID":return tt.convertID(n)}switch((i=kh(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return tt.convertNumber(n);case"boolean":return tt.convertBoolean(n);case"bigint":return tt.convertBigint(n);case"date":return tt.convertDate(n);default:return n}}}var tt;(function(t){function e(u){let c="";for(let f=1;fe(l))}return ee.stringArray=a,ee}var Nt={},Cu;function qf(){if(Cu)return Nt;Cu=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Emitter=Nt.Event=void 0;const t=zf();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Nt.Event=e={}));class n{add(s,a=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(a),Array.isArray(o)&&o.push({dispose:()=>this.remove(s,a)})}remove(s,a=null){if(!this._callbacks)return;let o=!1;for(let l=0,u=this._callbacks.length;l{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),l.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Nt.Emitter=r,r._noop=function(){},Nt}var wu;function RE(){if(wu)return _t;wu=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.CancellationTokenSource=_t.CancellationToken=void 0;const t=zf(),e=vE(),n=qf();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function l(u){const c=u;return c&&(c===o.None||c===o.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}o.is=l})(r||(_t.CancellationToken=r={}));const i=Object.freeze(function(o,l){const u=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){u.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class a{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return _t.CancellationTokenSource=a,_t}var V=RE();function AE(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Jr=0,EE=10;function $E(){return Jr=performance.now(),new V.CancellationTokenSource}const ki=Symbol("OperationCancelled");function Qi(t){return t===ki}async function Ee(t){if(t===V.CancellationToken.None)return;const e=performance.now();if(e-Jr>=EE&&(Jr=e,await AE(),Jr=performance.now()),t.isCancellationRequested)throw ki}class ao{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class or{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(or.isIncremental(r)){const i=Xf(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const c=_u(r.text,!1,s);if(l-o===c.length)for(let d=0,h=c.length;de?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1n&&Yf(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var ya;(function(t){function e(i,s,a,o){return new or(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof or)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const a=i.getText(),o=Ta(s.map(SE),(c,f)=>{const d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d});let l=0;const u=[];for(const c of o){const f=i.offsetAt(c.range.start);if(fl&&u.push(a.substring(l,f)),c.newText.length&&u.push(c.newText),l=i.offsetAt(c.range.end)}return u.push(a.substr(l)),u.join("")}t.applyEdits=r})(ya||(ya={}));function Ta(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Ta(r,e),Ta(i,e);let s=0,a=0,o=0;for(;sn.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function SE(t){const e=Xf(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Jf;(()=>{var t={470:i=>{function s(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function a(l,u){for(var c,f="",d=0,h=-1,m=0,g=0;g<=l.length;++g){if(g2){var R=f.lastIndexOf("/");if(R!==f.length-1){R===-1?(f="",d=0):d=(f=f.slice(0,R)).length-1-f.lastIndexOf("/"),h=g,m=0;continue}}else if(f.length===2||f.length===1){f="",d=0,h=g,m=0;continue}}u&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+l.slice(h+1,g):f=l.slice(h+1,g),d=g-h-1;h=g,m=0}else c===46&&m!==-1?++m:m=-1}return f}var o={resolve:function(){for(var l,u="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var d;f>=0?d=arguments[f]:(l===void 0&&(l=process.cwd()),d=l),s(d),d.length!==0&&(u=d+"/"+u,c=d.charCodeAt(0)===47)}return u=a(u,!c),c?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(l){if(s(l),l.length===0)return".";var u=l.charCodeAt(0)===47,c=l.charCodeAt(l.length-1)===47;return(l=a(l,!u)).length!==0||u||(l="."),l.length>0&&c&&(l+="/"),u?"/"+l:l},isAbsolute:function(l){return s(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,u=0;u0&&(l===void 0?l=c:l+="/"+c)}return l===void 0?".":o.normalize(l)},relative:function(l,u){if(s(l),s(u),l===u||(l=o.resolve(l))===(u=o.resolve(u)))return"";for(var c=1;cg){if(u.charCodeAt(h+y)===47)return u.slice(h+y+1);if(y===0)return u.slice(h+y)}else d>g&&(l.charCodeAt(c+y)===47?R=y:y===0&&(R=0));break}var E=l.charCodeAt(c+y);if(E!==u.charCodeAt(h+y))break;E===47&&(R=y)}var v="";for(y=c+R+1;y<=f;++y)y!==f&&l.charCodeAt(y)!==47||(v.length===0?v+="..":v+="/..");return v.length>0?v+u.slice(h+R):(h+=R,u.charCodeAt(h)===47&&++h,u.slice(h))},_makeLong:function(l){return l},dirname:function(l){if(s(l),l.length===0)return".";for(var u=l.charCodeAt(0),c=u===47,f=-1,d=!0,h=l.length-1;h>=1;--h)if((u=l.charCodeAt(h))===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":l.slice(0,f)},basename:function(l,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(l);var c,f=0,d=-1,h=!0;if(u!==void 0&&u.length>0&&u.length<=l.length){if(u.length===l.length&&u===l)return"";var m=u.length-1,g=-1;for(c=l.length-1;c>=0;--c){var R=l.charCodeAt(c);if(R===47){if(!h){f=c+1;break}}else g===-1&&(h=!1,g=c+1),m>=0&&(R===u.charCodeAt(m)?--m==-1&&(d=c):(m=-1,d=g))}return f===d?d=g:d===-1&&(d=l.length),l.slice(f,d)}for(c=l.length-1;c>=0;--c)if(l.charCodeAt(c)===47){if(!h){f=c+1;break}}else d===-1&&(h=!1,d=c+1);return d===-1?"":l.slice(f,d)},extname:function(l){s(l);for(var u=-1,c=0,f=-1,d=!0,h=0,m=l.length-1;m>=0;--m){var g=l.charCodeAt(m);if(g!==47)f===-1&&(d=!1,f=m+1),g===46?u===-1?u=m:h!==1&&(h=1):u!==-1&&(h=-1);else if(!d){c=m+1;break}}return u===-1||f===-1||h===0||h===1&&u===f-1&&u===c+1?"":l.slice(u,f)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return(function(u,c){var f=c.dir||c.root,d=c.base||(c.name||"")+(c.ext||"");return f?f===c.root?f+d:f+"/"+d:d})(0,l)},parse:function(l){s(l);var u={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return u;var c,f=l.charCodeAt(0),d=f===47;d?(u.root="/",c=1):c=0;for(var h=-1,m=0,g=-1,R=!0,y=l.length-1,E=0;y>=c;--y)if((f=l.charCodeAt(y))!==47)g===-1&&(R=!1,g=y+1),f===46?h===-1?h=y:E!==1&&(E=1):h!==-1&&(E=-1);else if(!R){m=y+1;break}return h===-1||g===-1||E===0||E===1&&h===g-1&&h===m+1?g!==-1&&(u.base=u.name=m===0&&d?l.slice(1,g):l.slice(m,g)):(m===0&&d?(u.name=l.slice(1,h),u.base=l.slice(1,g)):(u.name=l.slice(m,h),u.base=l.slice(m,g)),u.ext=l.slice(h,g)),m>0?u.dir=l.slice(0,m-1):d&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>Ie}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l($,T){if(!$.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${$.authority}", path: "${$.path}", query: "${$.query}", fragment: "${$.fragment}"}`);if($.scheme&&!s.test($.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if($.path){if($.authority){if(!a.test($.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test($.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",c="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{static isUri(T){return T instanceof d||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,k,S,O,b,N=!1){typeof T=="object"?(this.scheme=T.scheme||u,this.authority=T.authority||u,this.path=T.path||u,this.query=T.query||u,this.fragment=T.fragment||u):(this.scheme=(function(ve,Z){return ve||Z?ve:"file"})(T,N),this.authority=k||u,this.path=(function(ve,Z){switch(ve){case"https":case"http":case"file":Z?Z[0]!==c&&(Z=c+Z):Z=c}return Z})(this.scheme,S||u),this.query=O||u,this.fragment=b||u,l(this,N))}get fsPath(){return E(this)}with(T){if(!T)return this;let{scheme:k,authority:S,path:O,query:b,fragment:N}=T;return k===void 0?k=this.scheme:k===null&&(k=u),S===void 0?S=this.authority:S===null&&(S=u),O===void 0?O=this.path:O===null&&(O=u),b===void 0?b=this.query:b===null&&(b=u),N===void 0?N=this.fragment:N===null&&(N=u),k===this.scheme&&S===this.authority&&O===this.path&&b===this.query&&N===this.fragment?this:new m(k,S,O,b,N)}static parse(T,k=!1){const S=f.exec(T);return S?new m(S[2]||u,ae(S[4]||u),ae(S[5]||u),ae(S[7]||u),ae(S[9]||u),k):new m(u,u,u,u,u)}static file(T){let k=u;if(i&&(T=T.replace(/\\/g,c)),T[0]===c&&T[1]===c){const S=T.indexOf(c,2);S===-1?(k=T.substring(2),T=c):(k=T.substring(2,S),T=T.substring(S)||c)}return new m("file",k,T,u,u)}static from(T){const k=new m(T.scheme,T.authority,T.path,T.query,T.fragment);return l(k,!0),k}toString(T=!1){return v(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof d)return T;{const k=new m(T);return k._formatted=T.external,k._fsPath=T._sep===h?T.fsPath:null,k}}return T}}const h=i?1:void 0;class m extends d{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=E(this)),this._fsPath}toString(T=!1){return T?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=h),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function R($,T,k){let S,O=-1;for(let b=0;b<$.length;b++){const N=$.charCodeAt(b);if(N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===45||N===46||N===95||N===126||T&&N===47||k&&N===91||k&&N===93||k&&N===58)O!==-1&&(S+=encodeURIComponent($.substring(O,b)),O=-1),S!==void 0&&(S+=$.charAt(b));else{S===void 0&&(S=$.substr(0,b));const ve=g[N];ve!==void 0?(O!==-1&&(S+=encodeURIComponent($.substring(O,b)),O=-1),S+=ve):O===-1&&(O=b)}}return O!==-1&&(S+=encodeURIComponent($.substring(O))),S!==void 0?S:$}function y($){let T;for(let k=0;k<$.length;k++){const S=$.charCodeAt(k);S===35||S===63?(T===void 0&&(T=$.substr(0,k)),T+=g[S]):T!==void 0&&(T+=$[k])}return T!==void 0?T:$}function E($,T){let k;return k=$.authority&&$.path.length>1&&$.scheme==="file"?`//${$.authority}${$.path}`:$.path.charCodeAt(0)===47&&($.path.charCodeAt(1)>=65&&$.path.charCodeAt(1)<=90||$.path.charCodeAt(1)>=97&&$.path.charCodeAt(1)<=122)&&$.path.charCodeAt(2)===58?$.path[1].toLowerCase()+$.path.substr(2):$.path,i&&(k=k.replace(/\//g,"\\")),k}function v($,T){const k=T?y:R;let S="",{scheme:O,authority:b,path:N,query:ve,fragment:Z}=$;if(O&&(S+=O,S+=":"),(b||O==="file")&&(S+=c,S+=c),b){let W=b.indexOf("@");if(W!==-1){const It=b.substr(0,W);b=b.substr(W+1),W=It.lastIndexOf(":"),W===-1?S+=k(It,!1,!1):(S+=k(It.substr(0,W),!1,!1),S+=":",S+=k(It.substr(W+1),!1,!0)),S+="@"}b=b.toLowerCase(),W=b.lastIndexOf(":"),W===-1?S+=k(b,!1,!0):(S+=k(b.substr(0,W),!1,!0),S+=b.substr(W))}if(N){if(N.length>=3&&N.charCodeAt(0)===47&&N.charCodeAt(2)===58){const W=N.charCodeAt(1);W>=65&&W<=90&&(N=`/${String.fromCharCode(W+32)}:${N.substr(3)}`)}else if(N.length>=2&&N.charCodeAt(1)===58){const W=N.charCodeAt(0);W>=65&&W<=90&&(N=`${String.fromCharCode(W+32)}:${N.substr(2)}`)}S+=k(N,!0,!1)}return ve&&(S+="?",S+=k(ve,!1,!1)),Z&&(S+="#",S+=T?Z:R(Z,!1,!1)),S}function x($){try{return decodeURIComponent($)}catch{return $.length>3?$.substr(0,3)+x($.substr(3)):$}}const M=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ae($){return $.match(M)?$.replace(M,(T=>x(T))):$}var Me=n(470);const Te=Me.posix||Me,Ve="/";var Ie;(function($){$.joinPath=function(T,...k){return T.with({path:Te.join(T.path,...k)})},$.resolvePath=function(T,...k){let S=T.path,O=!1;S[0]!==Ve&&(S=Ve+S,O=!0);let b=Te.resolve(S,...k);return O&&b[0]===Ve&&!T.authority&&(b=b.substring(1)),T.with({path:b})},$.dirname=function(T){if(T.path.length===0||T.path===Ve)return T;let k=Te.dirname(T.path);return k.length===1&&k.charCodeAt(0)===46&&(k=""),T.with({path:k})},$.basename=function(T){return Te.basename(T.path)},$.extname=function(T){return Te.extname(T.path)}})(Ie||(Ie={}))})(),Jf=r})();const{URI:Gt,Utils:gn}=Jf;var vt;(function(t){t.basename=gn.basename,t.dirname=gn.dirname,t.extname=gn.extname,t.joinPath=gn.joinPath,t.resolvePath=gn.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const a=typeof i=="string"?i:i.path,o=typeof s=="string"?s:s.path,l=a.split("/").filter(h=>h.length>0),u=o.split("/").filter(h=>h.length>0);let c=0;for(;ci??(i=ya.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class kE{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return re(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=K.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=K.Changed,this.documentMap.delete(n)),r}}const As=Symbol("ref_resolving");class IE{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=V.CancellationToken.None){for(const r of Jt(e.parseResult.value))await Ee(n),sc(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=As;try{const s=this.getCandidate(e);if(Kr(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const a=this.loadAstNode(s);i._ref=a??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const a=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${a}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,get ref(){var o;if(le(this._ref))return this._ref;if(bd(this._nodeDescription)){const l=s.loadAstNode(this._nodeDescription);this._ref=l??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=As;const l=Fs(e).$document,u=s.getLinkedNode({reference:a,container:e,property:n});if(u.error&&l&&l.state=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||Pd(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>vt.equals(s.sourceUri,n.documentUri))),r.push(...i),re(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=pt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:ai(n),local:!0}}}}class Ii{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Ps.sum(re(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return re(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return re(this.map.keys())}values(){return re(this.map.values()).flat()}entriesGroupedByKey(){return re(this.map.entries())}}class Nu{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class NE{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=V.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=Sa,i=V.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const a of r(e))await Ee(i),this.exportNode(a,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=V.CancellationToken.None){const r=e.parseResult.value,i=new Ii;for(const s of ur(r))await Ee(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class bu{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class bE{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=re(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Zf{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class OE extends Zf{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class LE extends Zf{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class PE extends OE{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class ME{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new PE(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=pt(e.container).precomputedScopes;if(i){let a=e.container;do{const o=i.get(a);o.length>0&&n.push(re(o).filter(l=>this.reflection.isSubtype(l.type,r))),a=a.$container}while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new bu(re(e),n,r)}createScopeForNodes(e,n,r){const i=re(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new bu(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new bE(this.indexManager.allElements(e)))}}function DE(t){return typeof t.$comment=="string"}function Ou(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class FE{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(o,l)=>this.replacer(o,l,r),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=pt(e),JSON.stringify(e,a,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var l,u,c,f;if(!this.ignoreProperties.has(e))if(ze(n)){const d=n.ref,h=r?n.$refText:void 0;if(d){const m=pt(d);let g="";this.currentDocument&&this.currentDocument!==m&&(o?g=o(m.uri,n):g=m.uri.toString());const R=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${R}`,$refText:h}}else return{$error:(u=(l=n.error)===null||l===void 0?void 0:l.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:h}}else if(le(n)){let d;if(s&&(d=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&d?.$textRegion&&(d.$textRegion.documentURI=(c=this.currentDocument)===null||c===void 0?void 0:c.uri.toString())),i&&!e&&(d??(d=Object.assign({},n)),d.$sourceText=(f=n.$cstNode)===null||f===void 0?void 0:f.text),a){d??(d=Object.assign({},n));const h=this.commentProvider.getComment(n);h&&(d.$comment=h.replace(/\r/g,""))}return d??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=Ah(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Qi(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=re(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class BE{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=V.CancellationToken.None){const i=e.parseResult,s=[];if(await Ee(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Fe.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Fe.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Fe.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(Qi(a))throw a;console.error("An error occurred during validation:",a)}return await Ee(r),s}processLexingErrors(e,n,r){var i,s,a;const o=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const l of o){const u=(a=l.severity)!==null&&a!==void 0?a:"error",c={severity:Es(u),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:KE(u),source:this.getSource()};n.push(c)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Ds(i.token);if(s){const a={severity:Es("error"),range:s,message:i.message,data:qn(Fe.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.container,property:s.property,index:s.index,data:{code:Fe.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,n,r=V.CancellationToken.None){const i=[],s=(a,o,l)=>{i.push(this.toDiagnostic(a,o,l))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=V.CancellationToken.None){var s;const a=this.validationRegistry.checksBefore;for(const o of a)await Ee(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=V.CancellationToken.None){await Promise.all(Jt(e).map(async s=>{await Ee(i);const a=this.validationRegistry.getChecks(s.$type,n.categories);for(const o of a)await o(s,r,i)}))}async validateAstAfter(e,n,r,i=V.CancellationToken.None){var s;const a=this.validationRegistry.checksAfter;for(const o of a)await Ee(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:jE(r),severity:Es(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function jE(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=cc(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Eh(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Es(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function KE(t){switch(t){case"error":return qn(Fe.LexingError);case"warning":return qn(Fe.LexingWarning);case"info":return qn(Fe.LexingInfo);case"hint":return qn(Fe.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Fe;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Fe||(Fe={}));class HE{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??pt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>{var l;return a??(a=ai((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:n,get nameSegment(){return o()},selectionSegment:ai(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class VE{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=V.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Jt(i))await Ee(n),sc(s).filter(a=>!Kr(a)).forEach(a=>{const o=this.createDescription(a);o&&r.push(o)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=pt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:ai(r),local:vt.equals(n.documentUri,i)}}}class WE{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),l=parseInt(s.substring(a+1)),u=i[o];return u?.[l]}return i[s]},e)}}var zE=qf();class qE{constructor(e){this._ready=new ao,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new zE.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var er;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(er||(er={}));class YE{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ii,this.documentPhaseListeners=new Ii,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=K.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=V.CancellationToken.None){var i,s;for(const a of e){const o=a.uri.toString();if(a.state===K.Validated){if(typeof n.validation=="boolean"&&n.validation)a.state=K.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(o);else if(typeof n.validation=="object"){const l=this.buildState.get(o),u=(i=l?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const f=((s=n.validation.categories)!==null&&s!==void 0?s:Ci.all).filter(d=>!u.includes(d));f.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:f})},result:l.result}),a.state=K.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=K.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=V.CancellationToken.None){this.currentState=K.Changed;for(const a of n)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(const a of e){if(!this.langiumDocuments.invalidateDocument(a)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);l.state=K.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(a.toString())}const i=re(e).concat(n).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,K.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,n),await Ee(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(a=>{var o;return a.stater(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n=0&&!this.hasTextDocument(e[r]);)r--;nr.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),er.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,K.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,K.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,K.ComputedScopes,r,async s=>{const a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,r)}),await this.runCancelable(e,K.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,K.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,K.Validated,r,s=>this.validate(s,r));for(const s of e){const a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(o=>o.stateo.state===n);await this.notifyBuildPhase(a,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),er.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),er.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=V.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(ki):new Promise((s,a)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(ki)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await a(e,r)}catch(o){if(!Qi(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await Ee(r),await a(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o=typeof a=="object"?a:void 0,l=await s.validateDocument(e,o,n);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const u=this.buildState.get(e.uri.toString());if(u){(r=u.result)!==null&&r!==void 0||(u.result={});const c=(i=o?.categories)!==null&&i!==void 0?i:Ci.all;u.result.validationChecks?u.result.validationChecks.push(...c):u.result.validationChecks=[...c]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class XE{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new LE,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=pt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{vt.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),re(i)}allElements(e,n){let r=re(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(o=>this.astReflection.isSubtype(o.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=V.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=V.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class JE{constructor(e){this.initialBuildOptions={},this._ready=new ao,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=V.CancellationToken.None){const r=await this.performStartup(e);await Ee(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Gt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,r)){if(a.isDirectory)await this.traverseFolder(e,a.uri,r,i);else if(a.isFile){const o=await this.langiumDocuments.getOrCreateDocument(a.uri);i(o)}}}))}includeEntry(e,n,r){const i=vt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=vt.extname(n.uri);return r.includes(s)}return!1}}class ZE{buildUnexpectedCharactersMessage(e,n,r,i,s){return zs.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return zs.buildUnableToPopLexerModeMessage(e)}}const QE={mode:"full"};class e${constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=Lu(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new he(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=QE){var r,i,s;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:(r=a.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(Lu(e))return e;const n=Qf(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function t$(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function Qf(t){return t&&"modes"in t&&"defaultMode"in t}function Lu(t){return!t$(t)&&!Qf(t)}function n$(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=D.create(0,0));const s=ed(t),a=oo(r),o=s$({lines:s,position:i,options:a});return c$({index:0,tokens:o,position:i})}function r$(t,e){const n=oo(e),r=ed(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!a?.exec(i)&&!!o?.exec(s)}function ed(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(uh)}const Pu=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,i$=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function s$(t){var e,n,r;const i=[];let s=t.position.line,a=t.position.character;for(let o=0;o=c.length){if(i.length>0){const h=D.create(s,a);i.push({type:"break",content:"",range:L.create(h,h)})}}else{Pu.lastIndex=f;const h=Pu.exec(c);if(h){const m=h[0],g=h[1],R=D.create(s,a+f),y=D.create(s,a+f+m.length);i.push({type:"tag",content:g,range:L.create(R,y)}),f+=m.length,f=va(c,f)}if(f0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function a$(t,e,n,r){const i=[];if(t.length===0){const s=D.create(n,r),a=D.create(n,r+e.length);i.push({type:"text",content:e,range:L.create(s,a)})}else{let s=0;for(const o of t){const l=o.index,u=e.substring(s,l);u.length>0&&i.push({type:"text",content:e.substring(s,l),range:L.create(D.create(n,s+r),D.create(n,l+r))});let c=u.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:L.create(D.create(n,s+c+r),D.create(n,s+c+f.length+r))}),c+=f.length,o.length===4){c+=o[2].length;const d=o[3];i.push({type:"text",content:d,range:L.create(D.create(n,s+c+r),D.create(n,s+c+d.length+r))})}else i.push({type:"text",content:"",range:L.create(D.create(n,s+c+r),D.create(n,s+c+r))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:L.create(D.create(n,s+r),D.create(n,s+r+a.length))})}return i}const o$=/\S/,l$=/\s*$/;function va(t,e){const n=t.substring(e).match(o$);return n?e+n.index:t.length}function u$(t){const e=t.match(l$);if(e&&typeof e.index=="number")return e.index}function c$(t){var e,n,r,i;const s=D.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Mu([],L.create(s,s));const a=[];for(;t.indexn.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=Du(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=Du(n)+i}return n.trim()}}class Ss{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e} -${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=p$(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} — ${n}`:this.content.inlines.length>1&&(i=`${i} -${n}`),this.inline?`{${i}}`:i}}function p$(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let a=e;if(s>0){const l=va(e,s);a=e.substring(l),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(a=`\`${a}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,a))!==null&&i!==void 0?i:m$(e,a)}}function m$(t,e){try{return Gt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Ra{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;nr.range.start.line&&(e+=` -`)}return e}toMarkdown(e){let n="";for(let r=0;ri.range.start.line&&(n+=` -`)}return n}}class id{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function Du(t){return t.endsWith(` -`)?` -`:` - -`}class g${constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&r$(n))return n$(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const a=s.nameSegment.range.start.line+1,o=s.nameSegment.range.start.character+1,l=s.documentUri.with({fragment:`L${a},${o}`});return`[${r}](${l.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=pt(e).precomputedScopes;if(!i)return;let s=e;do{const o=i.get(s).find(l=>l.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class y${constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return DE(e)?e.$comment:(n=Gd(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class T${constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class v${constructor(){this.previousTokenSource=new V.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=$E();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=V.CancellationToken.None){const i=new ao,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Qi(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class R${constructor(e){this.grammarElementIdMap=new Nu,this.tokenTypeIdMap=new Nu,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Jt(e))n.set(i,{});if(e.$cstNode)for(const i of Ms(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)le(o)?a.push(this.dehydrateAstNode(o,n)):ze(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else le(s)?r[i]=this.dehydrateAstNode(s,n):ze(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return Ju(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),tr(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):Xu(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Jt(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Ms(e.$cstNode)){let a;"fullText"in s?(a=new Df(s.fullText),i=a):"content"in s?a=new io:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)le(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):ze(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else le(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):ze(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),tr(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new pa(r,i,{start:{line:s,character:a},end:{line:o,character:l}},n,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Jt(this.grammar))Bd(n)&&this.grammarElementIdMap.set(n,e++)}}function $t(t){return{documentation:{CommentProvider:e=>new y$(e),DocumentationProvider:e=>new g$(e)},parser:{AsyncParser:e=>new T$(e),GrammarConfig:e=>bh(e),LangiumParser:e=>yE(e),CompletionParser:e=>gE(e),ValueConverter:()=>new Wf,TokenBuilder:()=>new Vf,Lexer:e=>new e$(e),ParserErrorMessageProvider:()=>new Uf,LexerErrorMessageProvider:()=>new ZE},workspace:{AstNodeLocator:()=>new WE,AstNodeDescriptionProvider:e=>new HE(e),ReferenceDescriptionProvider:e=>new VE(e)},references:{Linker:e=>new IE(e),NameProvider:()=>new wE,ScopeProvider:e=>new ME(e),ScopeComputation:e=>new NE(e),References:e=>new _E(e)},serializer:{Hydrator:e=>new R$(e),JsonSerializer:e=>new FE(e)},validation:{DocumentValidator:e=>new BE(e),ValidationRegistry:e=>new UE(e)},shared:()=>t.shared}}function St(t){return{ServiceRegistry:e=>new GE(e),workspace:{LangiumDocuments:e=>new kE(e),LangiumDocumentFactory:e=>new xE(e),DocumentBuilder:e=>new YE(e),IndexManager:e=>new XE(e),WorkspaceManager:e=>new JE(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new v$,ConfigurationProvider:e=>new qE(e)}}}var Fu;(function(t){t.merge=(e,n)=>wi(wi({},e),n)})(Fu||(Fu={}));function ue(t,e,n,r,i,s,a,o,l){const u=[t,e,n,r,i,s,a,o,l].reduce(wi,{});return sd(u)}const A$=Symbol("isProxy");function sd(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===A$?!0:Uu(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(Uu(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const Gu=Symbol();function Uu(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===Gu)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=Gu;try{t[e]=typeof i=="function"?i(r):sd(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function wi(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=wi(i,r):t[n]=r}}return t}class E${readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const xt={fileSystemProvider:()=>new E$},$$={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},S$={AstReflection:()=>new ic};function x$(){const t=ue(St(xt),S$),e=ue($t({shared:t}),$$);return t.ServiceRegistry.register(e),e}function Vt(t){var e;const n=x$(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Gt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var k$=Object.defineProperty,A=(t,e)=>k$(t,"name",{value:e,configurable:!0}),Bu="Statement",Zr="Architecture";function I$(t){return He.isInstance(t,Zr)}A(I$,"isArchitecture");var Mr="Axis",Yn="Branch";function C$(t){return He.isInstance(t,Yn)}A(C$,"isBranch");var Dr="Checkout",Fr="CherryPicking",xs="ClassDefStatement",Xn="Commit";function w$(t){return He.isInstance(t,Xn)}A(w$,"isCommit");var ks="Curve",Is="Edge",Cs="Entry",Jn="GitGraph";function _$(t){return He.isInstance(t,Jn)}A(_$,"isGitGraph");var ws="Group",Qr="Info";function N$(t){return He.isInstance(t,Qr)}A(N$,"isInfo");var Gr="Item",_s="Junction",Zn="Merge";function b$(t){return He.isInstance(t,Zn)}A(b$,"isMerge");var Ns="Option",ei="Packet";function O$(t){return He.isInstance(t,ei)}A(O$,"isPacket");var ti="PacketBlock";function L$(t){return He.isInstance(t,ti)}A(L$,"isPacketBlock");var ni="Pie";function P$(t){return He.isInstance(t,ni)}A(P$,"isPie");var ri="PieSection";function M$(t){return He.isInstance(t,ri)}A(M$,"isPieSection");var bs="Radar",Os="Service",ii="Treemap";function D$(t){return He.isInstance(t,ii)}A(D$,"isTreemap");var Ls="TreemapRow",Ur="Direction",Br="Leaf",jr="Section",ad=class extends Yu{static{A(this,"MermaidAstReflection")}getAllTypes(){return[Zr,Mr,Yn,Dr,Fr,xs,Xn,ks,Ur,Is,Cs,Jn,ws,Qr,Gr,_s,Br,Zn,Ns,ei,ti,ni,ri,bs,jr,Os,Bu,ii,Ls]}computeIsSubtype(t,e){switch(t){case Yn:case Dr:case Fr:case Xn:case Zn:return this.isSubtype(Bu,e);case Ur:return this.isSubtype(Jn,e);case Br:case jr:return this.isSubtype(Gr,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;if(e==="Entry:axis")return Mr;throw new Error(`${e} is not a valid reference id.`)}getTypeMetaData(t){switch(t){case Zr:return{name:Zr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case Mr:return{name:Mr,properties:[{name:"label"},{name:"name"}]};case Yn:return{name:Yn,properties:[{name:"name"},{name:"order"}]};case Dr:return{name:Dr,properties:[{name:"branch"}]};case Fr:return{name:Fr,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case xs:return{name:xs,properties:[{name:"className"},{name:"styleText"}]};case Xn:return{name:Xn,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case ks:return{name:ks,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case Is:return{name:Is,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case Cs:return{name:Cs,properties:[{name:"axis"},{name:"value"}]};case Jn:return{name:Jn,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case ws:return{name:ws,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Qr:return{name:Qr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case Gr:return{name:Gr,properties:[{name:"classSelector"},{name:"name"}]};case _s:return{name:_s,properties:[{name:"id"},{name:"in"}]};case Zn:return{name:Zn,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case Ns:return{name:Ns,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case ei:return{name:ei,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case ti:return{name:ti,properties:[{name:"bits"},{name:"end"},{name:"label"},{name:"start"}]};case ni:return{name:ni,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case ri:return{name:ri,properties:[{name:"label"},{name:"value"}]};case bs:return{name:bs,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case Os:return{name:Os,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case ii:return{name:ii,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"},{name:"TreemapRows",defaultValue:[]}]};case Ls:return{name:Ls,properties:[{name:"indent"},{name:"item"}]};case Ur:return{name:Ur,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};case Br:return{name:Br,properties:[{name:"classSelector"},{name:"name"},{name:"value"}]};case jr:return{name:jr,properties:[{name:"classSelector"},{name:"name"}]};default:return{name:t,properties:[]}}}},He=new ad,ju,F$=A(()=>ju??(ju=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"InfoGrammar"),Ku,G$=A(()=>Ku??(Ku=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),Hu,U$=A(()=>Hu??(Hu=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PieGrammar"),Vu,B$=A(()=>Vu??(Vu=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"ArchitectureGrammar"),Wu,j$=A(()=>Wu??(Wu=Vt(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),zu,K$=A(()=>zu??(zu=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Radar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),qu,H$=A(()=>qu??(qu=Vt(`{"$type":"Grammar","isDeclared":true,"name":"Treemap","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","}},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammar"),V$={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},W$={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},z$={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},q$={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Y$={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},X$={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},J$={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wt={AstReflection:A(()=>new ad,"AstReflection")},Z$={Grammar:A(()=>F$(),"Grammar"),LanguageMetaData:A(()=>V$,"LanguageMetaData"),parser:{}},Q$={Grammar:A(()=>G$(),"Grammar"),LanguageMetaData:A(()=>W$,"LanguageMetaData"),parser:{}},eS={Grammar:A(()=>U$(),"Grammar"),LanguageMetaData:A(()=>z$,"LanguageMetaData"),parser:{}},tS={Grammar:A(()=>B$(),"Grammar"),LanguageMetaData:A(()=>q$,"LanguageMetaData"),parser:{}},nS={Grammar:A(()=>j$(),"Grammar"),LanguageMetaData:A(()=>Y$,"LanguageMetaData"),parser:{}},rS={Grammar:A(()=>K$(),"Grammar"),LanguageMetaData:A(()=>X$,"LanguageMetaData"),parser:{}},iS={Grammar:A(()=>H$(),"Grammar"),LanguageMetaData:A(()=>J$,"LanguageMetaData"),parser:{}},sS=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,aS=/accTitle[\t ]*:([^\n\r]*)/,oS=/title([\t ][^\n\r]*|)/,lS={ACC_DESCR:sS,ACC_TITLE:aS,TITLE:oS},es=class extends Wf{static{A(this,"AbstractMermaidValueConverter")}runConverter(t,e,n){let r=this.runCommonConverter(t,e,n);return r===void 0&&(r=this.runCustomConverter(t,e,n)),r===void 0?super.runConverter(t,e,n):r}runCommonConverter(t,e,n){const r=lS[t.name];if(r===void 0)return;const i=r.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},ts=class extends es{static{A(this,"CommonValueConverter")}runCustomConverter(t,e,n){}},kt=class extends Vf{static{A(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,n){const r=super.buildKeywordTokens(t,e,n);return r.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),r}};(class extends kt{static{A(this,"CommonTokenBuilder")}});var uS=class extends kt{static{A(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},od={parser:{TokenBuilder:A(()=>new uS,"TokenBuilder"),ValueConverter:A(()=>new ts,"ValueConverter")}};function ld(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),nS,od);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}A(ld,"createGitGraphServices");var cS=class extends kt{static{A(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},ud={parser:{TokenBuilder:A(()=>new cS,"TokenBuilder"),ValueConverter:A(()=>new ts,"ValueConverter")}};function cd(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),Z$,ud);return e.ServiceRegistry.register(n),{shared:e,Info:n}}A(cd,"createInfoServices");var fS=class extends kt{static{A(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},fd={parser:{TokenBuilder:A(()=>new fS,"TokenBuilder"),ValueConverter:A(()=>new ts,"ValueConverter")}};function dd(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),Q$,fd);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}A(dd,"createPacketServices");var dS=class extends kt{static{A(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},hS=class extends es{static{A(this,"PieValueConverter")}runCustomConverter(t,e,n){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},hd={parser:{TokenBuilder:A(()=>new dS,"TokenBuilder"),ValueConverter:A(()=>new hS,"ValueConverter")}};function pd(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),eS,hd);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}A(pd,"createPieServices");var pS=class extends kt{static{A(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},mS=class extends es{static{A(this,"ArchitectureValueConverter")}runCustomConverter(t,e,n){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},md={parser:{TokenBuilder:A(()=>new pS,"TokenBuilder"),ValueConverter:A(()=>new mS,"ValueConverter")}};function gd(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),tS,md);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}A(gd,"createArchitectureServices");var gS=class extends kt{static{A(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},yd={parser:{TokenBuilder:A(()=>new gS,"TokenBuilder"),ValueConverter:A(()=>new ts,"ValueConverter")}};function Td(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),rS,yd);return e.ServiceRegistry.register(n),{shared:e,Radar:n}}A(Td,"createRadarServices");var yS=class extends kt{static{A(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},TS=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,vS=class extends es{static{A(this,"TreemapValueConverter")}runCustomConverter(t,e,n){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR")return e.substring(1,e.length-1);if(t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const r=TS.exec(e);if(r)return{$type:"ClassDefStatement",className:r[1],styleText:r[2]||void 0}}}};function vd(t){const e=t.validation.TreemapValidator,n=t.validation.ValidationRegistry;if(n){const r={Treemap:e.checkSingleRoot.bind(e)};n.register(r,e)}}A(vd,"registerValidationChecks");var RS=class{static{A(this,"TreemapValidator")}checkSingleRoot(t,e){let n;for(const r of t.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:r.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}):n!==void 0&&n>=parseInt(r.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}))}},Rd={parser:{TokenBuilder:A(()=>new yS,"TokenBuilder"),ValueConverter:A(()=>new vS,"ValueConverter")},validation:{TreemapValidator:A(()=>new RS,"TreemapValidator")}};function Ad(t=xt){const e=ue(St(t),Wt),n=ue($t({shared:e}),iS,Rd);return e.ServiceRegistry.register(n),vd(n),{shared:e,Treemap:n}}A(Ad,"createTreemapServices");var nt={},AS={info:A(async()=>{const{createInfoServices:t}=await wt(async()=>{const{createInfoServices:n}=await Promise.resolve().then(()=>SS);return{createInfoServices:n}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;nt.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await wt(async()=>{const{createPacketServices:n}=await Promise.resolve().then(()=>xS);return{createPacketServices:n}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;nt.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await wt(async()=>{const{createPieServices:n}=await Promise.resolve().then(()=>kS);return{createPieServices:n}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;nt.pie=e},"pie"),architecture:A(async()=>{const{createArchitectureServices:t}=await wt(async()=>{const{createArchitectureServices:n}=await Promise.resolve().then(()=>IS);return{createArchitectureServices:n}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;nt.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await wt(async()=>{const{createGitGraphServices:n}=await Promise.resolve().then(()=>CS);return{createGitGraphServices:n}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;nt.gitGraph=e},"gitGraph"),radar:A(async()=>{const{createRadarServices:t}=await wt(async()=>{const{createRadarServices:n}=await Promise.resolve().then(()=>wS);return{createRadarServices:n}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;nt.radar=e},"radar"),treemap:A(async()=>{const{createTreemapServices:t}=await wt(async()=>{const{createTreemapServices:n}=await Promise.resolve().then(()=>_S);return{createTreemapServices:n}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;nt.treemap=e},"treemap")};async function ES(t,e){const n=AS[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);nt[t]||await n();const i=nt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new $S(i);return i.value}A(ES,"parse");var $S=class extends Error{constructor(t){const e=t.lexerErrors.map(r=>r.message).join(` -`),n=t.parserErrors.map(r=>r.message).join(` -`);super(`Parsing failed: ${e} ${n}`),this.result=t}static{A(this,"MermaidParseError")}};const SS=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:ud,createInfoServices:cd},Symbol.toStringTag,{value:"Module"})),xS=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:fd,createPacketServices:dd},Symbol.toStringTag,{value:"Module"})),kS=Object.freeze(Object.defineProperty({__proto__:null,PieModule:hd,createPieServices:pd},Symbol.toStringTag,{value:"Module"})),IS=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:md,createArchitectureServices:gd},Symbol.toStringTag,{value:"Module"})),CS=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:od,createGitGraphServices:ld},Symbol.toStringTag,{value:"Module"})),wS=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:yd,createRadarServices:Td},Symbol.toStringTag,{value:"Module"})),_S=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Rd,createTreemapServices:Ad},Symbol.toStringTag,{value:"Module"}));export{ES as p}; diff --git a/assets/universal-C9tCO36V.js b/assets/universal-C9tCO36V.js deleted file mode 100644 index 8d7d4c7bb6196d6bd7f2fa33741dc6b655bcd372..0000000000000000000000000000000000000000 --- a/assets/universal-C9tCO36V.js +++ /dev/null @@ -1 +0,0 @@ -import{w as s,I as n}from"./index-DydPgVMC.js";function w(o,i,r,f,a){var d=()=>{f(r[o])};r.addEventListener(i,d),a?s(()=>{r[o]=a()}):d(),(r===document.body||r===window||r===document)&&n(()=>{r.removeEventListener(i,d)})}export{w as b}; diff --git a/assets/vertexColorMixing-BV8k1N8l.js b/assets/vertexColorMixing-BV8k1N8l.js deleted file mode 100644 index d25d6858db866c8c5942d2082878f18169c9d993..0000000000000000000000000000000000000000 --- a/assets/vertexColorMixing-BV8k1N8l.js +++ /dev/null @@ -1,105 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="uvAttributeDeclaration",u=`#ifdef UV{X} -attribute uv{X}: vec2f; -#endif -`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=u);const r="prePassVertexDeclaration",v=`#ifdef PREPASS -#ifdef PREPASS_LOCAL_POSITION -varying vPosition : vec3f; -#endif -#ifdef PREPASS_DEPTH -varying vViewPos: vec3f; -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -varying vNormViewDepth: f32; -#endif -#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) -uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f; -#endif -#endif -`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=v);const s="samplerVertexDeclaration",d=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 -varying v_VARYINGNAME_UV: vec2f; -#endif -`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=d);const t="prePassVertex",I=`#ifdef PREPASS_DEPTH -vertexOutputs.vViewPos=(scene.view*worldPos).rgb; -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -vertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x); -#endif -#ifdef PREPASS_LOCAL_POSITION -vertexOutputs.vPosition=positionUpdated.xyz; -#endif -#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED) -vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos; -#if NUM_BONE_INFLUENCERS>0 -var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3]; -#endif -vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0); -#else -vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0); -#endif -#endif -`;e.IncludesShadersStoreWGSL[t]||(e.IncludesShadersStoreWGSL[t]=I);const n="uvVariableDeclaration",a=`#ifdef MAINUV{X} -#if !defined(UV{X}) -var uv{X}: vec2f=vec2f(0.,0.); -#else -var uv{X}: vec2f=vertexInputs.uv{X}; -#endif -vertexOutputs.vMainUV{X}=uv{X}; -#endif -`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=a);const f="samplerVertexImplementation",E=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 -if (uniforms.v_INFONAME_==0.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;} -#ifdef UV2 -else if (uniforms.v_INFONAME_==1.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;} -#endif -#ifdef UV3 -else if (uniforms.v_INFONAME_==2.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;} -#endif -#ifdef UV4 -else if (uniforms.v_INFONAME_==3.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;} -#endif -#ifdef UV5 -else if (uniforms.v_INFONAME_==4.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;} -#endif -#ifdef UV6 -else if (uniforms.v_INFONAME_==5.) -{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;} -#endif -#endif -`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=E);const o="vertexColorMixing",c=`#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -vertexOutputs.vColor=vec4f(1.0); -#ifdef VERTEXCOLOR -#ifdef VERTEXALPHA -vertexOutputs.vColor*=vertexInputs.color; -#else -vertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*vertexInputs.color.rgb,vertexOutputs.vColor.a); -#endif -#endif -#ifdef INSTANCESCOLOR -vertexOutputs.vColor*=vertexInputs.instanceColor; -#endif -#endif -`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=c); diff --git a/assets/vertexColorMixing-DoZiZfly.js b/assets/vertexColorMixing-DoZiZfly.js deleted file mode 100644 index d26a359f0d448eae18efb9c343d577c0ed96691f..0000000000000000000000000000000000000000 --- a/assets/vertexColorMixing-DoZiZfly.js +++ /dev/null @@ -1,106 +0,0 @@ -import{S as e}from"./index-GY9JDBGV.js";const i="decalVertexDeclaration",a=`#ifdef DECAL -uniform vec4 vDecalInfos;uniform mat4 decalMatrix; -#endif -`;e.IncludesShadersStore[i]||(e.IncludesShadersStore[i]=a);const n="uvAttributeDeclaration",c=`#ifdef UV{X} -attribute vec2 uv{X}; -#endif -`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=c);const r="prePassVertexDeclaration",E=`#ifdef PREPASS -#ifdef PREPASS_LOCAL_POSITION -varying vec3 vPosition; -#endif -#ifdef PREPASS_DEPTH -varying vec3 vViewPos; -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -varying float vNormViewDepth; -#endif -#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) -uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition; -#endif -#endif -`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=E);const s="samplerVertexDeclaration",v=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 -varying vec2 v_VARYINGNAME_UV; -#endif -`;e.IncludesShadersStore[s]||(e.IncludesShadersStore[s]=v);const d="prePassVertex",I=`#ifdef PREPASS_DEPTH -vViewPos=(view*worldPos).rgb; -#endif -#ifdef PREPASS_NORMALIZED_VIEW_DEPTH -vNormViewDepth=((view*worldPos).z-cameraInfo.x)/(cameraInfo.y-cameraInfo.x); -#endif -#ifdef PREPASS_LOCAL_POSITION -vPosition=positionUpdated.xyz; -#endif -#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED) -vCurrentPosition=viewProjection*worldPos; -#if NUM_BONE_INFLUENCERS>0 -mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0]; -#if NUM_BONE_INFLUENCERS>1 -previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1]; -#endif -#if NUM_BONE_INFLUENCERS>2 -previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2]; -#endif -#if NUM_BONE_INFLUENCERS>3 -previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3]; -#endif -#if NUM_BONE_INFLUENCERS>4 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0]; -#endif -#if NUM_BONE_INFLUENCERS>5 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1]; -#endif -#if NUM_BONE_INFLUENCERS>6 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2]; -#endif -#if NUM_BONE_INFLUENCERS>7 -previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3]; -#endif -vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0); -#else -vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0); -#endif -#endif -`;e.IncludesShadersStore[d]||(e.IncludesShadersStore[d]=I);const o="uvVariableDeclaration",N=`#if !defined(UV{X}) && defined(MAINUV{X}) -vec2 uv{X}=vec2(0.,0.); -#endif -#ifdef MAINUV{X} -vMainUV{X}=uv{X}; -#endif -`;e.IncludesShadersStore[o]||(e.IncludesShadersStore[o]=N);const t="samplerVertexImplementation",_=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 -if (v_INFONAME_==0.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));} -#ifdef UV2 -else if (v_INFONAME_==1.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2Updated,1.0,0.0));} -#endif -#ifdef UV3 -else if (v_INFONAME_==2.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));} -#endif -#ifdef UV4 -else if (v_INFONAME_==3.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));} -#endif -#ifdef UV5 -else if (v_INFONAME_==4.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));} -#endif -#ifdef UV6 -else if (v_INFONAME_==5.) -{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));} -#endif -#endif -`;e.IncludesShadersStore[t]||(e.IncludesShadersStore[t]=_);const f="vertexColorMixing",S=`#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) -vColor=vec4(1.0); -#ifdef VERTEXCOLOR -#ifdef VERTEXALPHA -vColor*=colorUpdated; -#else -vColor.rgb*=colorUpdated.rgb; -#endif -#endif -#ifdef INSTANCESCOLOR -vColor*=instanceColor; -#endif -#endif -`;e.IncludesShadersStore[f]||(e.IncludesShadersStore[f]=S); diff --git a/assets/webAudioBaseSubGraph-CgvRUdPi.js b/assets/webAudioBaseSubGraph-CgvRUdPi.js deleted file mode 100644 index adc0e630d24df567dd5118e711d684f47f40e1f9..0000000000000000000000000000000000000000 --- a/assets/webAudioBaseSubGraph-CgvRUdPi.js +++ /dev/null @@ -1 +0,0 @@ -import{e as b,b as A}from"./audioEngine-D1fuR8_P.js";import{L as _}from"./index-GY9JDBGV.js";class y extends b{constructor(e,t){super(e,t,3)}connect(e){if(!this._connect(e))throw new Error("Connect failed")}disconnect(e){if(!this._disconnect(e))throw new Error("Disconnect failed")}disconnectAll(){if(!this._downstreamNodes)throw new Error("Disconnect failed");const e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next())if(!this._disconnect(t.value))throw new Error("Disconnect failed")}}const N={volume:1};class z extends y{constructor(e){super("Volume",e)}setOptions(e){this.setVolume(e.volume??N.volume,{shape:"none"})}}function u(s){return s.getSubNode("Volume")}function D(s,e){return u(s)?.[e]??N[e]}const i={fftSize:2048,minDecibels:-100,maxDecibels:-30,smoothing:.8};function S(s){return s.analyzerEnabled||s.analyzerFFTSize!==void 0||s.analyzerMinDecibels!==void 0||s.analyzerMaxDecibels!==void 0||s.analyzerSmoothing!==void 0}class p{get frequencyBinCount(){return this.fftSize/2}}class g extends y{constructor(e){super("Analyzer",e)}setOptions(e){this.fftSize=e.analyzerFFTSize??i.fftSize,this.minDecibels=e.analyzerMinDecibels??i.minDecibels,this.maxDecibels=e.analyzerMaxDecibels??i.maxDecibels,this.smoothing=e.analyzerSmoothing??i.smoothing}}function r(s){return s.getSubNode("Analyzer")}function d(s,e,t){s.callOnSubNode("Analyzer",n=>{n[e]=t})}let c=null,l=null;function m(){return c||(c=new Uint8Array),c}function f(){return l||(l=new Float32Array),l}class w extends p{constructor(e){super(),this._fftSize=i.fftSize,this._maxDecibels=i.maxDecibels,this._minDecibels=i.minDecibels,this._smoothing=i.smoothing,this._subGraph=e}get fftSize(){return this._fftSize}set fftSize(e){this._fftSize=e,d(this._subGraph,"fftSize",e)}get isEnabled(){return r(this._subGraph)!==null}get minDecibels(){return this._minDecibels}set minDecibels(e){this._minDecibels=e,d(this._subGraph,"minDecibels",e)}get maxDecibels(){return this._maxDecibels}set maxDecibels(e){this._maxDecibels=e,d(this._subGraph,"maxDecibels",e)}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,d(this._subGraph,"smoothing",e)}dispose(){const e=r(this._subGraph);e&&(this._subGraph.removeSubNodeAsync(e),e.dispose())}async enableAsync(){r(this._subGraph)||await this._subGraph.createAndAddSubNodeAsync("Analyzer")}getByteFrequencyData(){const e=r(this._subGraph);return e?e.getByteFrequencyData():(_.Warn("AudioAnalyzer not enabled"),this.enableAsync(),m())}getFloatFrequencyData(){const e=r(this._subGraph);return e?e.getFloatFrequencyData():(_.Warn("AudioAnalyzer not enabled"),this.enableAsync(),f())}}class E extends b{constructor(e,t,n){super(e,t,n),this._analyzer=null}get analyzer(){return this._analyzer??(this._analyzer=new w(this._subGraph))}get volume(){return D(this._subGraph,"volume")}set volume(e){const t=u(this._subGraph);if(!t)throw new Error("No volume subnode");t.volume=e}dispose(){super.dispose(),this._analyzer?.dispose(),this._analyzer=null,this._subGraph.dispose()}setVolume(e,t=null){const n=u(this._subGraph);if(!n)throw new Error("No volume subnode");n.setVolume(e,t)}}class F{constructor(){this._createSubNodePromises={},this._isDisposed=!1,this._subNodes={},this._onSubNodeDisposed=e=>{const t=e;delete this._subNodes[t.name],this._onSubNodesChanged()}}callOnSubNode(e,t){const n=this.getSubNode(e);if(n){t(n);return}this._createSubNodePromisesResolvedAsync().then(()=>{const o=this.getSubNode(e);if(o){t(o);return}this.createAndAddSubNodeAsync(e).then(a=>{t(a)})})}createAndAddSubNodeAsync(e){var t;return(t=this._createSubNodePromises)[e]||(t[e]=this._createSubNode(e).then(n=>(this._addSubNode(n),n))),this._createSubNodePromises[e]}dispose(){this._isDisposed=!0;const e=Object.values(this._subNodes);for(const t of e)t.dispose();this._subNodes={},this._createSubNodePromises={}}getSubNode(e){return this._subNodes[e]??null}async removeSubNodeAsync(e){if(!e)return;await this._createSubNodePromisesResolvedAsync();const t=e.name;this._subNodes[t]&&delete this._subNodes[t],delete this._createSubNodePromises[t],this._onSubNodesChanged()}async _createSubNodePromisesResolvedAsync(){return await Promise.all(Object.values(this._createSubNodePromises))}_addSubNode(e){if(this._isDisposed){e.dispose();return}this._subNodes[e.name]=e,e.onDisposeObservable.addOnce(this._onSubNodeDisposed),this._onSubNodesChanged()}}async function x(s){return new q(s)}class q extends z{constructor(e){super(e);const t=this.node=new GainNode(e._audioContext);this._volume=new A(e,t.gain)}dispose(){super.dispose(),this._volume.dispose()}get volume(){return this._volume.value}set volume(e){this.setVolume(e)}get _inNode(){return this.node}get _outNode(){return this.node}setVolume(e,t=null){this._volume.setTargetValue(e,t)}_connect(e){return super._connect(e)?(e._inNode&&this.node.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this.node.disconnect(e._inNode),!0):!1}getClassName(){return"_VolumeWebAudioSubNode"}}async function v(s){return new G(s)}class G extends g{constructor(e){super(e),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode=new AnalyserNode(e._audioContext)}get fftSize(){return this._analyzerNode.fftSize}set fftSize(e){e!==this._analyzerNode.fftSize&&(this._analyzerNode.fftSize=e,this._clearArrays())}get _inNode(){return this._analyzerNode}get minDecibels(){return this._analyzerNode.minDecibels}set minDecibels(e){this._analyzerNode.minDecibels=e}get maxDecibels(){return this._analyzerNode.maxDecibels}set maxDecibels(e){this._analyzerNode.maxDecibels=e}get smoothing(){return this._analyzerNode.smoothingTimeConstant}set smoothing(e){this._analyzerNode.smoothingTimeConstant=e}dispose(){super.dispose(),this._clearArrays(),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode.disconnect()}getClassName(){return"_WebAudioAnalyzerSubNode"}getByteFrequencyData(){return(!this._byteFrequencyData||this._byteFrequencyData.length===0)&&(this._byteFrequencyData=new Uint8Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getByteFrequencyData(this._byteFrequencyData),this._byteFrequencyData}getFloatFrequencyData(){return(!this._floatFrequencyData||this._floatFrequencyData.length===0)&&(this._floatFrequencyData=new Float32Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getFloatFrequencyData(this._floatFrequencyData),this._floatFrequencyData}_clearArrays(){this._byteFrequencyData?.set(m()),this._floatFrequencyData?.set(f())}}class P extends F{constructor(e){super(),this._outputNode=null,this._owner=e}async initAsync(e){const t=S(e);if(t&&await this.createAndAddSubNodeAsync("Analyzer"),await this.createAndAddSubNodeAsync("Volume"),await this._createSubNodePromisesResolvedAsync(),t){const o=r(this);if(!o)throw new Error("No analyzer subnode.");o.setOptions(e)}const n=u(this);if(!n)throw new Error("No volume subnode.");if(n.setOptions(e),n.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(this._outputNode=n.node,this._outputNode&&this._downstreamNodes){const o=this._downstreamNodes.values();for(let a=o.next();!a.done;a=o.next()){const h=a.value._inNode;h&&this._outputNode.connect(h)}}}get _inNode(){return this._outputNode}get _outNode(){return this._outputNode}_createSubNode(e){switch(e){case"Analyzer":return v(this._owner.engine);case"Volume":return x(this._owner.engine);default:throw new Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){const e=r(this),t=u(this);e&&t&&t.connect(e)}}export{E as A,P as _,y as a,u as b}; diff --git a/assets/webAudioBus-Q_viYsTX.js b/assets/webAudioBus-Q_viYsTX.js deleted file mode 100644 index 9071488de4960d8edbad481b8069dee06230a37e..0000000000000000000000000000000000000000 --- a/assets/webAudioBus-Q_viYsTX.js +++ /dev/null @@ -1 +0,0 @@ -import{A as u}from"./abstractAudioBus-BwRA3WE-.js";import{_ as a,a as o,b as r,c as n}from"./spatialWebAudio-D-sfHE2Z.js";import"./webAudioBaseSubGraph-CgvRUdPi.js";import"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";import"./index-GY9JDBGV.js";class _ extends u{constructor(t,s,e){super(t,s),this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._outBus=null,this._spatial=null,this._onOutBusDisposed=()=>{this.outBus=this.engine.defaultMainBus},typeof e.spatialAutoUpdate=="boolean"&&(this._spatialAutoUpdate=e.spatialAutoUpdate),typeof e.spatialMinUpdateTime=="number"&&(this._spatialMinUpdateTime=e.spatialMinUpdateTime)}get outBus(){return this._outBus}set outBus(t){if(this._outBus!==t){if(this._outBus&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),!this._disconnect(this._outBus)))throw new Error("Disconnect failed");if(this._outBus=t,this._outBus&&(this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}get spatial(){return this._spatial?this._spatial:this._initSpatialProperty()}dispose(){super.dispose(),this._spatial?.dispose(),this._spatial=null,this._outBus=null}_initSpatialProperty(){return this._spatial=this._createSpatialProperty(this._spatialAutoUpdate,this._spatialMinUpdateTime)}}class i extends _{constructor(t,s,e){super(t,s,e),this._stereo=null,this._subGraph=new i._SubGraph(this)}async _initAsync(t){t.outBus?this.outBus=t.outBus:(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),a(t)&&this._initSpatialProperty(),this.engine._addNode(this)}dispose(){super.dispose(),this._stereo=null,this.engine._removeNode(this)}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new o(this._subGraph))}getClassName(){return"_WebAudioBus"}_createSpatialProperty(t,s){return new r(this._subGraph,t,s)}_connect(t){return super._connect(t)?(t._inNode&&this._outNode?.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this._outNode?.disconnect(t._inNode),!0):!1}}i._SubGraph=class extends n{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};export{i as _WebAudioBus}; diff --git a/assets/webAudioMainBus-C6O3d5Ad.js b/assets/webAudioMainBus-C6O3d5Ad.js deleted file mode 100644 index 449f56ad815db9980ca1a3626f5855a031b2db20..0000000000000000000000000000000000000000 --- a/assets/webAudioMainBus-C6O3d5Ad.js +++ /dev/null @@ -1 +0,0 @@ -import{A as s}from"./abstractAudioBus-BwRA3WE-.js";import{_ as i}from"./webAudioBaseSubGraph-CgvRUdPi.js";import"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";import"./index-GY9JDBGV.js";class r extends s{constructor(e,t){super(e,t)}}class n extends r{constructor(e,t){super(e,t),this._subGraph=new n._SubGraph(this)}async _initAsync(e){if(await this._subGraph.initAsync(e),this.engine.mainOut&&!this._connect(this.engine.mainOut))throw new Error("Connect failed");this.engine._addMainBus(this)}dispose(){super.dispose(),this.engine._removeMainBus(this)}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}getClassName(){return"_WebAudioMainBus"}}n._SubGraph=class extends i{get _downstreamNodes(){return this._owner._downstreamNodes??null}};export{n as _WebAudioMainBus}; diff --git a/assets/webAudioSoundSource-3sgwHR9P.js b/assets/webAudioSoundSource-3sgwHR9P.js deleted file mode 100644 index 3d8de9adaf1af767402af5b243b767caa809ebb5..0000000000000000000000000000000000000000 --- a/assets/webAudioSoundSource-3sgwHR9P.js +++ /dev/null @@ -1 +0,0 @@ -import{A as n}from"./abstractSoundSource-Dkzp9Tp9.js";import{_ as r,a as u,b as _,c as d}from"./spatialWebAudio-D-sfHE2Z.js";import"./webAudioBaseSubGraph-CgvRUdPi.js";import"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";import"./index-GY9JDBGV.js";class s extends n{constructor(e,t,i,o){super(e,i,o),this._stereo=null,this._audioContext=this.engine._audioContext,this._webAudioNode=t,this._subGraph=new s._SubGraph(this)}async _initAsync(e){e.outBus?this.outBus=e.outBus:e.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),r(e)&&this._initSpatialProperty(),this.engine._addNode(this)}get _inNode(){return this._webAudioNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new u(this._subGraph))}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){return"_WebAudioSoundSource"}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_createSpatialProperty(e,t){return new _(this._subGraph,e,t)}}s._SubGraph=class extends d{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}_onSubNodesChanged(){super._onSubNodesChanged(),this._owner._inNode.disconnect(),this._owner._subGraph._inNode&&this._owner._inNode.connect(this._owner._subGraph._inNode)}};export{s as _WebAudioSoundSource}; diff --git a/assets/webAudioStaticSound-BEsC4sEN.js b/assets/webAudioStaticSound-BEsC4sEN.js deleted file mode 100644 index ff429aaa7b8e66a046933354b8a7912c188901be..0000000000000000000000000000000000000000 --- a/assets/webAudioStaticSound-BEsC4sEN.js +++ /dev/null @@ -1 +0,0 @@ -import{A as h,_ as d}from"./abstractSoundInstance-Bnv14BnJ.js";import{_,a as c,b as f,c as l}from"./spatialWebAudio-D-sfHE2Z.js";import{_ as p,a as m,b as u}from"./audioEngine-D1fuR8_P.js";import"./index-GY9JDBGV.js";import"./index-DydPgVMC.js";import"./abstractSoundSource-Dkzp9Tp9.js";import"./webAudioBaseSubGraph-CgvRUdPi.js";class g extends h{constructor(t,e,i){super(t,e,i)}get duration(){return this._options.duration}set duration(t){this._options.duration=t}get loopStart(){return this._options.loopStart}set loopStart(t){this._options.loopStart=t}get loopEnd(){return this._options.loopEnd}set loopEnd(t){this._options.loopEnd=t}get pitch(){return this._options.pitch}set pitch(t){this._options.pitch=t;const e=this._instances.values();for(let i=e.next();!i.done;i=e.next())i.value.pitch=t}get playbackRate(){return this._options.playbackRate}set playbackRate(t){this._options.playbackRate=t;const e=this._instances.values();for(let i=e.next();!i.done;i=e.next())i.value.playbackRate=t}play(t={}){if(this.state===5){this.resume();return}t.duration??(t.duration=this.duration),t.loop??(t.loop=this.loop),t.loopStart??(t.loopStart=this.loopStart),t.loopEnd??(t.loopEnd=this.loopEnd),t.startOffset??(t.startOffset=this.startOffset),t.volume??(t.volume=1),t.waitTime??(t.waitTime=0);const e=this._createInstance();this._beforePlay(e),e.play(t),this._afterPlay(e),this._stopExcessInstances()}stop(t={}){if(t.waitTime&&0{this._enginePlayTime=0,this._state!==5&&this.onEndedObservable.notifyObservers(this),this._deinitSourceNode()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._options=e,this._volumeNode=new GainNode(t._audioContext),this._initSourceNode()}dispose(){super.dispose(),this._pitch?.dispose(),this._playbackRate?.dispose(),this._sourceNode=null,this.stop(),this._deinitSourceNode(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}get currentTime(){if(this._state===1)return 0;const t=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+t+this._options.startOffset}set currentTime(t){const e=this._state===2||this._state===3;if(e){const i=this._sourceNode;this._deinitSourceNode(),i?.stop(),this._state=1}this.state===5&&(this._enginePauseTime=0),this._options.startOffset=t,e&&this.play()}get _outNode(){return this._volumeNode}set pitch(t){this._pitch?.setTargetValue(t)}set playbackRate(t){this._playbackRate?.setTargetValue(t)}get startTime(){return this._state===1?0:this._enginePlayTime}getClassName(){return"_WebAudioStaticSoundInstance"}play(t={}){if(this._state===3)return;t.duration!==void 0&&(this._options.duration=t.duration),t.loop!==void 0&&(this._options.loop=t.loop),t.loopStart!==void 0&&(this._options.loopStart=t.loopStart),t.loopEnd!==void 0&&(this._options.loopEnd=t.loopEnd),t.startOffset!==void 0&&(this._options.startOffset=t.startOffset);let e=this._options.startOffset;this._state===5&&(e+=this._enginePauseTime,e%=this._sound.buffer.duration),this._enginePlayTime=this.engine.currentTime+(t.waitTime??0),this._volumeNode.gain.value=t.volume??1,this._initSourceNode(),this.engine.state==="running"?(this._setState(3),this._sourceNode?.start(this._enginePlayTime,e,this._options.duration>0?this._options.duration:void 0)):this._options.loop&&(this._setState(2),this.engine.stateChangedObservable.add(this._onEngineStateChanged))}pause(){this._state!==5&&(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._state===3?this._sourceNode?.stop():this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this._deinitSourceNode())}resume(){this._state===5&&this.play()}stop(t={}){if(this._state!==1){if(this._state===3){const e=this.engine.currentTime+(t.waitTime??0);this._sourceNode?.stop(e)}(t.waitTime===void 0||t.waitTime<=0)&&(this._setState(1),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))}}_connect(t){return super._connect(t)?(t instanceof a&&t._inNode&&(this._outNode?.connect(t._inNode),this._isConnected=!0),!0):!1}_disconnect(t){return super._disconnect(t)?(t instanceof a&&t._inNode&&(this._outNode?.disconnect(t._inNode),this._isConnected=!1),!0):!1}_deinitSourceNode(){if(this._sourceNode){if(this._isConnected&&!this._disconnect(this._sound))throw new Error("Disconnect failed");this._sourceNode.disconnect(this._volumeNode),this._sourceNode.removeEventListener("ended",this._onEnded),this._sourceNode=null}}_initSourceNode(){if(!this._sourceNode){if(this._sourceNode=new AudioBufferSourceNode(this._sound._audioContext,{buffer:this._sound.buffer._audioBuffer}),this._sourceNode.addEventListener("ended",this._onEnded,{once:!0}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._pitch=new u(this.engine,this._sourceNode.detune),this._playbackRate=new u(this.engine,this._sourceNode.playbackRate)}const t=this._sourceNode;t.detune.value=this._sound.pitch,t.loop=this._options.loop,t.loopEnd=this._options.loopEnd,t.loopStart=this._options.loopStart,t.playbackRate.value=this._sound.playbackRate}}export{a as _WebAudioStaticSound,r as _WebAudioStaticSoundBuffer}; diff --git a/assets/webAudioStreamingSound-C_Kgt28o.js b/assets/webAudioStreamingSound-C_Kgt28o.js deleted file mode 100644 index b366f62a7530f39bf78a0956b558a5ed0378514e..0000000000000000000000000000000000000000 --- a/assets/webAudioStreamingSound-C_Kgt28o.js +++ /dev/null @@ -1 +0,0 @@ -import{O as o,d as h,L as d}from"./index-GY9JDBGV.js";import{A as _,_ as l}from"./abstractSoundInstance-Bnv14BnJ.js";import{_ as u,a as c,b as p,c as f}from"./spatialWebAudio-D-sfHE2Z.js";import{_ as a}from"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";import"./abstractSoundSource-Dkzp9Tp9.js";import"./webAudioBaseSubGraph-CgvRUdPi.js";class m extends _{constructor(e,t,s){super(e,t,s),this._preloadedInstances=new Array}get preloadCount(){return this._options.preloadCount??1}get preloadCompletedCount(){return this._preloadedInstances.length}preloadInstanceAsync(){const e=this._createInstance();return this._addPreloadedInstance(e),e.preloadedPromise}async preloadInstancesAsync(e){for(let t=0;tawait t.preloadedPromise))}play(e={}){if(this.state===5){this.resume();return}let t;this.preloadCompletedCount>0?(t=this._preloadedInstances[0],t.startOffset=this.startOffset,this._removePreloadedInstance(t)):t=this._createInstance();const s=()=>{t.state===3&&(this._stopExcessInstances(),t.onStateChangedObservable.removeCallback(s))};t.onStateChangedObservable.add(s),e.startOffset??(e.startOffset=this.startOffset),e.loop??(e.loop=this.loop),e.volume??(e.volume=1),this._beforePlay(t),t.play(e),this._afterPlay(t)}stop(){if(this._setState(1),!!this._instances)for(const e of Array.from(this._instances))e.stop()}_addPreloadedInstance(e){this._preloadedInstances.includes(e)||this._preloadedInstances.push(e)}_removePreloadedInstance(e){const t=this._preloadedInstances.indexOf(e);t!==-1&&this._preloadedInstances.splice(t,1)}}class g extends l{constructor(e){super(e),this.onReadyObservable=new o,this.preloadedPromise=new Promise((t,s)=>{this._rejectPreloadedProimse=s,this._resolvePreloadedPromise=t}),this.onErrorObservable.add(this._rejectPreloadedProimse),this.onReadyObservable.add(this._resolvePreloadedPromise)}set startOffset(e){this._options.startOffset=e}dispose(){super.dispose(),this.onErrorObservable.clear(),this.onReadyObservable.clear(),this._resolvePreloadedPromise()}}class i extends m{constructor(e,t,s){super(e,t,s),this._stereo=null,this._options={autoplay:s.autoplay??!1,loop:s.loop??!1,maxInstances:s.maxInstances??1/0,preloadCount:s.preloadCount??1,startOffset:s.startOffset??0},this._subGraph=new i._SubGraph(this)}async _initAsync(e,t){const s=this.engine._audioContext;if(!(s instanceof AudioContext))throw new Error("Unsupported audio context type.");this._audioContext=s,this._source=e,t.outBus?this.outBus=t.outBus:t.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),u(t)&&this._initSpatialProperty(),this.preloadCount&&await this.preloadInstancesAsync(this.preloadCount),t.autoplay&&this.play(t),this.engine._addSound(this)}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new c(this._subGraph))}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeSound(this)}getClassName(){return"_WebAudioStreamingSound"}_createInstance(){return new y(this,this._options)}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_createSpatialProperty(e,t){return new p(this._subGraph,e,t)}_getOptions(){return this._options}}i._SubGraph=class extends f{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};class y extends g{constructor(e,t){if(super(e),this._currentTimeChangedWhilePaused=!1,this._enginePlayTime=1/0,this._enginePauseTime=0,this._isReady=!1,this._isReadyPromise=new Promise((s,n)=>{this._resolveIsReadyPromise=s,this._rejectIsReadyPromise=n}),this._onCanPlayThrough=()=>{this._isReady=!0,this._resolveIsReadyPromise(this._mediaElement),this.onReadyObservable.notifyObservers(this)},this._onEnded=()=>{this.onEndedObservable.notifyObservers(this),this.dispose()},this._onError=s=>{this._setState(4),this.onErrorObservable.notifyObservers(s),this._rejectIsReadyPromise(s),this.dispose()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._onUserGesture=()=>{this.play()},this._options=t,this._volumeNode=new GainNode(e._audioContext),typeof e._source=="string")this._initFromUrl(e._source);else if(Array.isArray(e._source))this._initFromUrls(e._source);else if(e._source instanceof HTMLMediaElement)this._initFromMediaElement(e._source);else throw new Error(`Invalid streaming sound source (${e._source}).`)}get currentTime(){if(this._state===1)return 0;const e=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+e+this._options.startOffset}set currentTime(e){const t=this._state===2||this._state===3;t&&(this._mediaElement.pause(),this._state=1),this._options.startOffset=e,t?this.play({startOffset:e}):this._state===5&&(this._currentTimeChangedWhilePaused=!0)}get _outNode(){return this._volumeNode}get startTime(){return this._state===1?0:this._enginePlayTime}dispose(){super.dispose(),this.stop(),this._sourceNode?.disconnect(this._volumeNode),this._sourceNode=null,this._mediaElement.removeEventListener("error",this._onError),this._mediaElement.removeEventListener("ended",this._onEnded),this._mediaElement.removeEventListener("canplaythrough",this._onCanPlayThrough);for(const e of Array.from(this._mediaElement.children))this._mediaElement.removeChild(e);this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this.engine.userGestureObservable.removeCallback(this._onUserGesture)}play(e={}){if(this._state===3)return;e.loop!==void 0&&(this._options.loop=e.loop),this._mediaElement.loop=this._options.loop;let t=e.startOffset;this._currentTimeChangedWhilePaused?(t=this._options.startOffset,this._currentTimeChangedWhilePaused=!1):this._state===5&&(t=this.currentTime+this._options.startOffset),t&&t>0&&(this._mediaElement.currentTime=t),this._volumeNode.gain.value=e.volume??1,this._play()}pause(){this._state!==2&&this._state!==3||(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._mediaElement.pause())}resume(){this._state===5?this.play():this._currentTimeChangedWhilePaused&&this.play()}stop(){this._state!==1&&this._stop()}getClassName(){return"_WebAudioStreamingSoundInstance"}_connect(e){return super._connect(e)?(e instanceof i&&e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e instanceof i&&e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_initFromMediaElement(e){if(h.SetCorsBehavior(e.currentSrc,e),e.controls=!1,e.loop=this._options.loop,e.preload="auto",e.addEventListener("canplaythrough",this._onCanPlayThrough,{once:!0}),e.addEventListener("ended",this._onEnded,{once:!0}),e.addEventListener("error",this._onError,{once:!0}),e.load(),this._sourceNode=new MediaElementAudioSourceNode(this._sound._audioContext,{mediaElement:e}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._mediaElement=e}_initFromUrl(e){const t=new Audio(a(e));this._initFromMediaElement(t)}_initFromUrls(e){const t=new Audio;for(const s of e){const n=document.createElement("source");n.src=a(s),t.appendChild(n)}this._initFromMediaElement(t)}_play(){if(this._setState(2),!this._isReady){this._playWhenReady();return}if(this._state===2)if(this.engine.state==="running"){const e=this._mediaElement.play();this._enginePlayTime=this.engine.currentTime,this._setState(3),e.catch(()=>{this._setState(4),this._options.loop&&this.engine.userGestureObservable.addOnce(this._onUserGesture)})}else this._options.loop?this.engine.stateChangedObservable.add(this._onEngineStateChanged):(this.stop(),this._setState(4))}_playWhenReady(){this._isReadyPromise.then(()=>{this._play()}).catch(()=>{d.Error("Streaming sound instance failed to play"),this._setState(4)})}_stop(){this._mediaElement.pause(),this._setState(1),this._onEnded(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}}export{i as _WebAudioStreamingSound}; diff --git a/assets/webgpuEngine-deh0dULk.js b/assets/webgpuEngine-deh0dULk.js deleted file mode 100644 index 36f9244d11bea265a3a4cd3072fba421b777cf10..0000000000000000000000000000000000000000 --- a/assets/webgpuEngine-deh0dULk.js +++ /dev/null @@ -1,316 +0,0 @@ -import{az as It,c5 as _e,A as Q,L as S,c6 as re,c7 as At,c8 as Te,c9 as Mt,ca as Ft,aN as Pt,cb as Be,J as w,cc as Lt,cd as Et,I as q,S as ne,d as H,ce as Ot,au as Gt,cf as Ut,cg as Nt,ch as $t,bg as N,ci as Vt,cj as kt,ck as Wt,b9 as de,cl as qt,cm as Qt,cn as Ht,co as Yt,cp as zt,cq as jt,cr as Kt,bY as Xt,cs as Jt,ct as Zt,cu as er,ay as tr}from"./index-GY9JDBGV.js";import"./instancesVertex-BZz8JvZy.js";import"./bakedVertexAnimation-Bs9it648.js";import"./instancesDeclaration-ConO0l1b.js";import"./helperFunctions-Wgh3PIP0.js";import"./fresnelFunction-xm2bLg9t.js";import"./meshUboDeclaration-BeSl_gjF.js";import"./sceneUboDeclaration-mnAEeY6M.js";import"./decalFragment-zjU901jg.js";import"./audioEngine-D1fuR8_P.js";import"./index-DydPgVMC.js";class I{static ComputeNumMipmapLevels(e,t){return It(Math.max(e,t))+1}static GetTextureTypeFromFormat(e){switch(e){case"r8unorm":case"r8uint":case"rg8unorm":case"rg8uint":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8uint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb10a2uint":case"rgb10a2unorm":case"rgb9e5ufloat":case"rg11b10ufloat":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc5-rg-unorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc4-r-unorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-rg11unorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":case"stencil8":return 0;case"r8snorm":case"r8sint":case"rg8snorm":case"rg8sint":case"rgba8snorm":case"rgba8sint":case"bc6h-rgb-float":case"bc5-rg-snorm":case"bc4-r-snorm":case"eac-r11snorm":case"eac-rg11snorm":return 3;case"r16uint":case"r16unorm":case"rg16unorm":case"rgba16unorm":case"rg16uint":case"rgba16uint":case"depth16unorm":return 5;case"r16sint":case"r16snorm":case"rg16snorm":case"rgba16snorm":case"rg16sint":case"rgba16sint":return 4;case"r16float":case"rg16float":case"rgba16float":return 2;case"r32uint":case"rg32uint":case"rgba32uint":return 7;case"r32sint":case"rg32sint":case"rgba32sint":return 7;case"r32float":case"rg32float":case"rgba32float":case"depth32float":case"depth32float-stencil8":case"depth24plus":case"depth24plus-stencil8":return 1}return 0}static GetBlockInformationFromFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16unorm":case"r16snorm":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rg16unorm":case"rg16snorm":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2uint":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba16unorm":case"rgba16snorm":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw"No fixed size for Stencil8 format!";case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw"No fixed size for Depth24Plus format!";case"depth24plus-stencil8":throw"No fixed size for Depth24PlusStencil8 format!";case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc5-rg-unorm":case"bc5-rg-snorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":return{width:4,height:4,length:8};case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-rg11unorm":case"eac-rg11snorm":return{width:4,height:4,length:16};case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":return{width:4,height:4,length:16};case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":return{width:5,height:4,length:16};case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":return{width:5,height:5,length:16};case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":return{width:6,height:5,length:16};case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":return{width:6,height:6,length:16};case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":return{width:8,height:5,length:16};case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":return{width:8,height:6,length:16};case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":return{width:8,height:8,length:16};case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":return{width:10,height:5,length:16};case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":return{width:10,height:6,length:16};case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":return{width:10,height:8,length:16};case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":return{width:10,height:10,length:16};case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":return{width:12,height:10,length:16};case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return{width:12,height:12,length:16}}return{width:1,height:1,length:4}}static IsHardwareTexture(e){return!!e.release}static IsInternalTexture(e){return!!e.dispose}static IsImageBitmap(e){return e.close!==void 0}static IsImageBitmapArray(e){return Array.isArray(e)&&e[0].close!==void 0}static IsCompressedFormat(e){switch(e){case"bc7-rgba-unorm-srgb":case"bc7-rgba-unorm":case"bc6h-rgb-float":case"bc6h-rgb-ufloat":case"bc5-rg-snorm":case"bc5-rg-unorm":case"bc4-r-snorm":case"bc4-r-unorm":case"bc3-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc1-rgba-unorm-srgb":case"bc1-rgba-unorm":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return!0}return!1}static GetWebGPUTextureFormat(e,t,r=!1){switch(t){case 15:return"depth16unorm";case 16:return"depth24plus";case 13:return"depth24plus-stencil8";case 14:return"depth32float";case 18:return"depth32float-stencil8";case 19:return"stencil8";case 36492:return r?"bc7-rgba-unorm-srgb":"bc7-rgba-unorm";case 36495:return"bc6h-rgb-ufloat";case 36494:return"bc6h-rgb-float";case 33779:return r?"bc3-rgba-unorm-srgb":"bc3-rgba-unorm";case 33778:return r?"bc2-rgba-unorm-srgb":"bc2-rgba-unorm";case 33777:case 33776:return r?"bc1-rgba-unorm-srgb":"bc1-rgba-unorm";case 37808:return r?"astc-4x4-unorm-srgb":"astc-4x4-unorm";case 36196:case 37492:return r?"etc2-rgb8unorm-srgb":"etc2-rgb8unorm";case 37496:return r?"etc2-rgba8unorm-srgb":"etc2-rgba8unorm"}switch(e){case 3:switch(t){case 6:return"r8snorm";case 7:return"rg8snorm";case 4:throw"RGB format not supported in WebGPU";case 8:return"r8sint";case 9:return"rg8sint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8sint";default:return"rgba8snorm"}case 0:switch(t){case 6:return"r8unorm";case 7:return"rg8unorm";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return r?"rgba8unorm-srgb":"rgba8unorm";case 12:return r?"bgra8unorm-srgb":"bgra8unorm";case 8:return"r8uint";case 9:return"rg8uint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8uint";case 0:throw"TEXTUREFORMAT_ALPHA format not supported in WebGPU";case 1:throw"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";case 2:throw"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";default:return"rgba8unorm"}case 4:switch(t){case 8:return"r16sint";case 9:return"rg16sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16sint";default:return"rgba16sint"}case 5:switch(t){case 8:return"r16uint";case 9:return"rg16uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16uint";default:return"rgba16uint"}case 6:switch(t){case 8:return"r32sint";case 9:return"rg32sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32sint";default:return"rgba32sint"}case 7:switch(t){case 8:return"r32uint";case 9:return"rg32uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32uint";default:return"rgba32uint"}case 1:switch(t){case 6:return"r32float";case 7:return"rg32float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba32float";default:return"rgba32float"}case 2:switch(t){case 6:return"r16float";case 7:return"rg16float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba16float";default:return"rgba16float"}case 10:throw"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:switch(t){case 5:return"rg11b10ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";default:return"rg11b10ufloat"}case 14:switch(t){case 5:return"rgb9e5ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";default:return"rgb9e5ufloat"}case 8:throw"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";case 9:throw"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";case 11:switch(t){case 5:return"rgb10a2unorm";case 11:return"rgb10a2uint";default:return"rgb10a2unorm"}}return r?"rgba8unorm-srgb":"rgba8unorm"}static GetNumChannelsFromWebGPUTextureFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":case"bc4-r-unorm":case"bc4-r-snorm":case"r16uint":case"r16sint":case"depth16unorm":case"r16float":case"r16unorm":case"r16snorm":case"r32uint":case"r32sint":case"r32float":case"depth32float":case"stencil8":case"depth24plus":case"eac-r11unorm":case"eac-r11snorm":return 1;case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth32float-stencil8":case"bc5-rg-unorm":case"bc5-rg-snorm":case"rg16uint":case"rg16sint":case"rg16float":case"rg16unorm":case"rg16snorm":case"rg32uint":case"rg32sint":case"rg32float":case"depth24plus-stencil8":case"eac-rg11unorm":case"eac-rg11snorm":return 2;case"rgb9e5ufloat":case"rg11b10ufloat":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":return 3;case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgba16unorm":case"rgba16snorm":case"rgb10a2uint":case"rgb10a2unorm":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba32uint":case"rgba32sint":case"rgba32float":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return 4}throw`Unknown format ${e}!`}static HasStencilAspect(e){switch(e){case"stencil8":case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static HasDepthAspect(e){switch(e){case"depth16unorm":case"depth24plus":case"depth24plus-stencil8":case"depth32float":case"depth32float-stencil8":return!0}return!1}static HasDepthAndStencilAspects(e){switch(e){case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static GetDepthFormatOnly(e){switch(e){case"depth16unorm":return"depth16unorm";case"depth24plus":return"depth24plus";case"depth24plus-stencil8":return"depth24plus";case"depth32float":return"depth32float";case"depth32float-stencil8":return"depth32float"}return e}static GetSample(e){return e>1?4:1}}class Ct{constructor(){this._gpuTimeInFrameId=-1,this.counter=new _e}_addDuration(e,t){e=0&&(d.push(o[h]),p.push(_))}this.shaderProcessingContext.attributeNamesFromEffect=d,this.shaderProcessingContext.attributeLocationsFromEffect=p}buildUniformLayout(){if(this.shaderProcessingContext.leftOverUniforms.length){this.uniformBuffer?.dispose(),this.uniformBuffer=new re(this.engine,void 0,void 0,"leftOver-"+this._name);for(const e of this.shaderProcessingContext.leftOverUniforms){const t=e.type.replace(/^(.*?)(<.*>)?$/,"$1"),r=P.UniformSizes[t];this.uniformBuffer.addUniform(e.name,r,e.length),this._leftOverUniformsByName[e.name]=e.type}this.uniformBuffer.create()}}setEngine(e){this.engine=e}dispose(){this.uniformBuffer&&this.uniformBuffer.dispose()}setInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt(e,t)}setInt2(e,t,r){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt2(e,t,r)}setInt3(e,t,r,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt3(e,t,r,n)}setInt4(e,t,r,n,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt4(e,t,r,n,i)}setIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateIntArray(e,t)}setIntArray2(e,t){this.setIntArray(e,t)}setIntArray3(e,t){this.setIntArray(e,t)}setIntArray4(e,t){this.setIntArray(e,t)}setUInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt(e,t)}setUInt2(e,t,r){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt2(e,t,r)}setUInt3(e,t,r,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt3(e,t,r,n)}setUInt4(e,t,r,n,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt4(e,t,r,n,i)}setUIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUIntArray(e,t)}setUIntArray2(e,t){this.setUIntArray(e,t)}setUIntArray3(e,t){this.setUIntArray(e,t)}setUIntArray4(e,t){this.setUIntArray(e,t)}setArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateArray(e,t)}setArray2(e,t){this.setArray(e,t)}setArray3(e,t){this.setArray(e,t)}setArray4(e,t){this.setArray(e,t)}setMatrices(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrices(e,t)}setMatrix(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix(e,t)}setMatrix3x3(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix3x3(e,t)}setMatrix2x2(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix2x2(e,t)}setFloat(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat(e,t)}setVector2(e,t){this.setFloat2(e,t.x,t.y)}setFloat2(e,t,r){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat2(e,t,r)}setVector3(e,t){this.setFloat3(e,t.x,t.y,t.z)}setFloat3(e,t,r,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat3(e,t,r,n)}setVector4(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setQuaternion(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setFloat4(e,t,r,n,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat4(e,t,r,n,i)}setColor3(e,t){this.setFloat3(e,t.r,t.g,t.b)}setColor4(e,t,r){this.setFloat4(e,t.r,t.g,t.b,r)}setDirectColor4(e,t){this.setFloat4(e,t.r,t.g,t.b,t.a)}_getVertexShaderCode(){return this.sources?.vertex}_getFragmentShaderCode(){return this.sources?.fragment}}const sr=4,nr=65536,pt={mat2:2,mat3:3,mat4:4,mat2x2:2,mat3x3:3,mat4x4:4};class O{static get KnownUBOs(){return O._SimplifiedKnownBindings?O._SimplifiedKnownUBOs:O._KnownUBOs}constructor(e,t=!1){this.vertexBufferKindToNumberOfComponents={},this.shaderLanguage=e,this._attributeNextLocation=0,this._varyingNextLocation=0,this.freeGroupIndex=0,this.freeBindingIndex=0,this.availableVaryings={},this.availableAttributes={},this.availableBuffers={},this.availableTextures={},this.availableSamplers={},this.orderedAttributes=[],this.bindGroupLayoutEntries=[],this.bindGroupLayoutEntryInfo=[],this.bindGroupEntries=[],this.bufferNames=[],this.textureNames=[],this.samplerNames=[],this.leftOverUniforms=[],t||this._findStartingGroupBinding()}_findStartingGroupBinding(){const e=O.KnownUBOs,t=[];for(const r in e){const n=e[r].binding;n.groupIndex!==-1&&(t[n.groupIndex]===void 0?t[n.groupIndex]=n.bindingIndex:t[n.groupIndex]=Math.max(t[n.groupIndex],n.bindingIndex))}this.freeGroupIndex=t.length-1,this.freeGroupIndex===0?(this.freeGroupIndex++,this.freeBindingIndex=0):this.freeBindingIndex=t[t.length-1]+1}getAttributeNextLocation(e,t=0){const r=this._attributeNextLocation;return this._attributeNextLocation+=(pt[e]??1)*(t||1),r}getVaryingNextLocation(e,t=0){const r=this._varyingNextLocation;return this._varyingNextLocation+=(pt[e]??1)*(t||1),r}getNextFreeUBOBinding(){return this._getNextFreeBinding(1)}_getNextFreeBinding(e){if(this.freeBindingIndex>nr-e&&(this.freeGroupIndex++,this.freeBindingIndex=0),this.freeGroupIndex===sr)throw"Too many textures or UBOs have been declared and it is not supported in WebGPU.";const t={groupIndex:this.freeGroupIndex,bindingIndex:this.freeBindingIndex};return this.freeBindingIndex+=e,t}}O._SimplifiedKnownBindings=!0;O._SimplifiedKnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:-1,bindingIndex:-1}},Light1:{binding:{groupIndex:-1,bindingIndex:-1}},Light2:{binding:{groupIndex:-1,bindingIndex:-1}},Light3:{binding:{groupIndex:-1,bindingIndex:-1}},Light4:{binding:{groupIndex:-1,bindingIndex:-1}},Light5:{binding:{groupIndex:-1,bindingIndex:-1}},Light6:{binding:{groupIndex:-1,bindingIndex:-1}},Light7:{binding:{groupIndex:-1,bindingIndex:-1}},Light8:{binding:{groupIndex:-1,bindingIndex:-1}},Light9:{binding:{groupIndex:-1,bindingIndex:-1}},Light10:{binding:{groupIndex:-1,bindingIndex:-1}},Light11:{binding:{groupIndex:-1,bindingIndex:-1}},Light12:{binding:{groupIndex:-1,bindingIndex:-1}},Light13:{binding:{groupIndex:-1,bindingIndex:-1}},Light14:{binding:{groupIndex:-1,bindingIndex:-1}},Light15:{binding:{groupIndex:-1,bindingIndex:-1}},Light16:{binding:{groupIndex:-1,bindingIndex:-1}},Light17:{binding:{groupIndex:-1,bindingIndex:-1}},Light18:{binding:{groupIndex:-1,bindingIndex:-1}},Light19:{binding:{groupIndex:-1,bindingIndex:-1}},Light20:{binding:{groupIndex:-1,bindingIndex:-1}},Light21:{binding:{groupIndex:-1,bindingIndex:-1}},Light22:{binding:{groupIndex:-1,bindingIndex:-1}},Light23:{binding:{groupIndex:-1,bindingIndex:-1}},Light24:{binding:{groupIndex:-1,bindingIndex:-1}},Light25:{binding:{groupIndex:-1,bindingIndex:-1}},Light26:{binding:{groupIndex:-1,bindingIndex:-1}},Light27:{binding:{groupIndex:-1,bindingIndex:-1}},Light28:{binding:{groupIndex:-1,bindingIndex:-1}},Light29:{binding:{groupIndex:-1,bindingIndex:-1}},Light30:{binding:{groupIndex:-1,bindingIndex:-1}},Light31:{binding:{groupIndex:-1,bindingIndex:-1}},Material:{binding:{groupIndex:-1,bindingIndex:-1}},Mesh:{binding:{groupIndex:-1,bindingIndex:-1}},Internals:{binding:{groupIndex:-1,bindingIndex:-1}}};O._KnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:1,bindingIndex:0}},Light1:{binding:{groupIndex:1,bindingIndex:1}},Light2:{binding:{groupIndex:1,bindingIndex:2}},Light3:{binding:{groupIndex:1,bindingIndex:3}},Light4:{binding:{groupIndex:1,bindingIndex:4}},Light5:{binding:{groupIndex:1,bindingIndex:5}},Light6:{binding:{groupIndex:1,bindingIndex:6}},Light7:{binding:{groupIndex:1,bindingIndex:7}},Light8:{binding:{groupIndex:1,bindingIndex:8}},Light9:{binding:{groupIndex:1,bindingIndex:9}},Light10:{binding:{groupIndex:1,bindingIndex:10}},Light11:{binding:{groupIndex:1,bindingIndex:11}},Light12:{binding:{groupIndex:1,bindingIndex:12}},Light13:{binding:{groupIndex:1,bindingIndex:13}},Light14:{binding:{groupIndex:1,bindingIndex:14}},Light15:{binding:{groupIndex:1,bindingIndex:15}},Light16:{binding:{groupIndex:1,bindingIndex:16}},Light17:{binding:{groupIndex:1,bindingIndex:17}},Light18:{binding:{groupIndex:1,bindingIndex:18}},Light19:{binding:{groupIndex:1,bindingIndex:19}},Light20:{binding:{groupIndex:1,bindingIndex:20}},Light21:{binding:{groupIndex:1,bindingIndex:21}},Light22:{binding:{groupIndex:1,bindingIndex:22}},Light23:{binding:{groupIndex:1,bindingIndex:23}},Light24:{binding:{groupIndex:1,bindingIndex:24}},Light25:{binding:{groupIndex:1,bindingIndex:25}},Light26:{binding:{groupIndex:1,bindingIndex:26}},Light27:{binding:{groupIndex:1,bindingIndex:27}},Light28:{binding:{groupIndex:1,bindingIndex:28}},Light29:{binding:{groupIndex:1,bindingIndex:29}},Light30:{binding:{groupIndex:1,bindingIndex:30}},Light31:{binding:{groupIndex:1,bindingIndex:31}},Material:{binding:{groupIndex:2,bindingIndex:0}},Mesh:{binding:{groupIndex:2,bindingIndex:1}},Internals:{binding:{groupIndex:2,bindingIndex:2}}};function ee(s,e,t,r){let n=r,i=0,a="";for(;n=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e==95}function fe(s){let e=0,t="",r=!1;const n=[];for(;e=0&&s.charAt(e)!==t&&s.charAt(e)!==r;)e--;return e}function ar(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pe(s,e,t,r){let n=s.indexOf(e);if(n<0)return s;if(t){for(;n++0&&a>0){const o=e.substring(i+1,a);n=+o,isNaN(n)&&(n=+r[o.trim()]),e=e.substring(0,i)}return[e,t,n]}initializeShaders(e){this._webgpuProcessingContext=e,this._missingVaryings.length=0,this._textureArrayProcessing.length=0,this.attributeKeywordName=void 0,this.varyingVertexKeywordName=void 0,this.varyingFragmentKeywordName=void 0}preProcessShaderCode(e,t){const r=`// Internals UBO -uniform ${P.InternalsUBOName} { -float yFactor_; -float textureOutputHeight_; -}; -`,n=e.indexOf("// Internals UBO")!==-1;return t?(this._fragmentIsGLES3=e.indexOf("#version 3")!==-1,this._fragmentIsGLES3&&(this.varyingFragmentKeywordName="in"),n?e:r+`##INJECTCODE## -`+e):(this._vertexIsGLES3=e.indexOf("#version 3")!==-1,this._vertexIsGLES3&&(this.attributeKeywordName="in",this.varyingVertexKeywordName="out"),n?e:r+e)}varyingCheck(e,t){const r=/(flat\s)?\s*\bout\b/,n=/(flat\s)?\s*\bin\b/,i=/(flat\s)?\s*\bvarying\b/;return(t&&this._fragmentIsGLES3?n:!t&&this._vertexIsGLES3?r:i).test(e)}varyingProcessor(e,t,r){this._preProcessors=r;const n=/\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,i=/\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,a=/\s*(flat)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,u=(t&&this._fragmentIsGLES3?i:!t&&this._vertexIsGLES3?n:a).exec(e);if(u!==null){const c=u[1]??"",l=u[2],h=u[3];let d;t?(d=this._webgpuProcessingContext.availableVaryings[h],this._missingVaryings[d]="",d===void 0&&S.Warn(`Invalid fragment shader: The varying named "${h}" is not declared in the vertex shader! This declaration will be ignored.`)):(d=this._webgpuProcessingContext.getVaryingNextLocation(l,this._getArraySize(h,l,r)[2]),this._webgpuProcessingContext.availableVaryings[h]=d,this._missingVaryings[d]=`layout(location = ${d}) ${c} in ${l} ${h};`),e=e.replace(u[0],d===void 0?"":`layout(location = ${d}) ${c} ${t?"in":"out"} ${l} ${h};`)}return e}attributeProcessor(e,t){this._preProcessors=t;const r=/\s*in\s+(\S+)\s+(\S+)\s*;/gm,n=/\s*attribute\s+(\S+)\s+(\S+)\s*;/gm,a=(this._vertexIsGLES3?r:n).exec(e);if(a!==null){const o=a[1],u=a[2],c=this._webgpuProcessingContext.getAttributeNextLocation(o,this._getArraySize(u,o,t)[2]);this._webgpuProcessingContext.availableAttributes[u]=c,this._webgpuProcessingContext.orderedAttributes[c]=u;const l=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[u];if(l!==void 0){const h=l<0?l===-1?"int":"ivec"+-l:l===1?"uint":"uvec"+l,d=`_int_${u}_`;e=e.replace(a[0],`layout(location = ${c}) in ${h} ${d}; ${o} ${u} = ${o}(${d});`)}else e=e.replace(a[0],`layout(location = ${c}) in ${o} ${u};`)}return e}uniformProcessor(e,t,r){this._preProcessors=r;const i=/\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);if(i!==null){let a=i[1],o=i[2];if(a.indexOf("sampler")===0||a.indexOf("sampler")===1){let u=0;[o,a,u]=this._getArraySize(o,a,r);let c=this._webgpuProcessingContext.availableTextures[o];if(!c){c={autoBindSampler:!0,isTextureArray:u>0,isStorageTexture:!1,textures:[],sampleType:"float"};for(let R=0;R<(u||1);++R)c.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}const l=P._SamplerTypeByWebGLSamplerType[a]??"sampler",h=!!P._IsComparisonSamplerByWebGPUSamplerType[l],d=h?"comparison":"filtering",p=o+"Sampler";let _=this._webgpuProcessingContext.availableSamplers[p];_||(_={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:d});const g=a.charAt(0)==="u"?"u":a.charAt(0)==="i"?"i":"";g&&(a=a.substring(1));const f=h?"depth":g==="u"?"uint":g==="i"?"sint":"float";c.sampleType=f;const m=u>0,b=_.binding.groupIndex,x=_.binding.bindingIndex,B=P._SamplerFunctionByWebGLSamplerType[a],y=P._TextureTypeByWebGLSamplerType[a],M=P._GpuTextureViewDimensionByWebGPUTextureType[y];if(!m)u=1,e=`layout(set = ${b}, binding = ${x}) uniform ${l} ${p}; - layout(set = ${c.textures[0].groupIndex}, binding = ${c.textures[0].bindingIndex}) uniform ${g}${y} ${o}Texture; - #define ${o} ${g}${B}(${o}Texture, ${p})`;else{const R=[];R.push(`layout(set = ${b}, binding = ${x}) uniform ${g}${l} ${p};`),e=` -`;for(let v=0;v0?` -`:""}#define ${o}${v} ${g}${B}(${o}Texture${v}, ${p})`}e=R.join(` -`)+e,this._textureArrayProcessing.push(o)}this._webgpuProcessingContext.availableTextures[o]=c,this._webgpuProcessingContext.availableSamplers[p]=_,this._addSamplerBindingDescription(p,_,!t);for(let R=0;R=0,l=` - glFragCoord_ = gl_FragCoord; - if (yFactor_ == 1.) { - glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y; - } - `,h=c?`vec4 glFragCoord_; -`:"",d=e.search(/layout *\(location *= *0\) *out/g)!==-1;if(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/gl_FragCoord/g,"glFragCoord_"),!this._fragmentIsGLES3)e=e.replace(/void\s+?main\s*\(/g,(o||d?"":`layout(location = 0) out vec4 glFragColor; -`)+"void main(");else{const p=/^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);p!==null&&(e=e.substring(0,p.index)+"layout(location = 0) "+e.substring(p.index))}e=e.replace(/dFdy/g,"(-yFactor_)*dFdy"),e=e.replace("##INJECTCODE##",h),c&&(e=pe(e,"void main",l))}else if("VERTEXOUTPUT_INVARIANT"in a&&(e=`invariant gl_Position; -`+e),e=e.replace(/gl_InstanceID/g,"gl_InstanceIndex"),e=e.replace(/gl_VertexID/g,"gl_VertexIndex"),t.indexOf("#define MULTIVIEW")!==-1)return`#extension GL_OVR_multiview2 : require -layout (num_views = 2) in; -`+e;if(!r){const c=e.lastIndexOf("}");e=e.substring(0,c),e+=`gl_Position.y *= yFactor_; -`,e+="}"}return e}_applyTextureArrayProcessing(e,t){const r=new RegExp(t+"\\s*\\[(.+)?\\]","gm");let n=r.exec(e);for(;n!==null;){const i=n[1];let a=+i;this._preProcessors&&isNaN(a)&&(a=+this._preProcessors[i.trim()]),e=e.replace(n[0],t+a),n=r.exec(e)}return e}_generateLeftOverUBOCode(e,t){let r=`layout(set = ${t.binding.groupIndex}, binding = ${t.binding.bindingIndex}) uniform ${e} { - `;for(const n of this._webgpuProcessingContext.leftOverUniforms)n.length>0?r+=` ${n.type} ${n.name}[${n.length}]; -`:r+=` ${n.type} ${n.name}; -`;return r+=`}; - -`,r}finalizeShaders(e,t){for(let n=0;n0&&(t=i+` -`+t)}const r=this._buildLeftOverUBO();return e=r+e,t=r+t,this._collectBindingNames(),this._preCreateBindGroupEntries(),this._preProcessors=null,this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}}const _t="fragmentOutputs.fragDepth",ur="uniforms",cr="internals",lr={texture_1d:"1d",texture_2d:"2d",texture_2d_array:"2d-array",texture_3d:"3d",texture_cube:"cube",texture_cube_array:"cube-array",texture_multisampled_2d:"2d",texture_depth_2d:"2d",texture_depth_2d_array:"2d-array",texture_depth_cube:"cube",texture_depth_cube_array:"cube-array",texture_depth_multisampled_2d:"2d",texture_storage_1d:"1d",texture_storage_2d:"2d",texture_storage_2d_array:"2d-array",texture_storage_3d:"3d",texture_external:null};class hr extends P{constructor(){super(...arguments),this.shaderLanguage=1,this.uniformRegexp=/uniform\s+(\w+)\s*:\s*(.+)\s*;/,this.textureRegexp=/var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/,this.noPrecision=!0,this.pureMode=!1}_getArraySize(e,t,r){let n=0;const i=t.lastIndexOf(">");if(t.indexOf("array")>=0&&i>0){let a=i;for(;a>0&&t.charAt(a)!==" "&&t.charAt(a)!==",";)a--;const o=t.substring(a+1,i);for(n=+o,isNaN(n)&&(n=+r[o.trim()]);a>0&&(t.charAt(a)===" "||t.charAt(a)===",");)a--;t=t.substring(t.indexOf("<")+1,a+1)}return[e,t,n]}initializeShaders(e){this._webgpuProcessingContext=e,this._attributesInputWGSL=[],this._attributesWGSL=[],this._attributesConversionCodeWGSL=[],this._hasNonFloatAttribute=!1,this._varyingsWGSL=[],this._varyingNamesWGSL=[],this._stridedUniformArrays=[]}preProcessShaderCode(e){const t=this.pureMode?"":`struct ${P.InternalsUBOName} { - yFactor_: f32, - textureOutputHeight_: f32, -}; -var ${cr} : ${P.InternalsUBOName}; -`;return e.indexOf(t)!==-1?e:t+fe(e)}varyingCheck(e){return/(flat|linear|perspective)?\s*(center|centroid|sample)?\s*\bvarying\b/.test(e)}varyingProcessor(e,t,r){const i=/\s*(flat|linear|perspective)?\s*(center|centroid|sample)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(i!==null){const a=i[1]??"perspective",o=i[2]??"center",u=i[4],c=i[3],l=a==="flat"?`@interpolate(${a})`:`@interpolate(${a}, ${o})`;let h;t?(h=this._webgpuProcessingContext.availableVaryings[c],h===void 0&&S.Warn(`Invalid fragment shader: The varying named "${c}" is not declared in the vertex shader! This declaration will be ignored.`)):(h=this._webgpuProcessingContext.getVaryingNextLocation(u,this._getArraySize(c,u,r)[2]),this._webgpuProcessingContext.availableVaryings[c]=h,this._varyingsWGSL.push(` @location(${h}) ${l} ${c} : ${u},`),this._varyingNamesWGSL.push(c)),e=""}return e}attributeProcessor(e,t){const n=/\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(n!==null){const i=n[2],a=n[1],o=this._webgpuProcessingContext.getAttributeNextLocation(i,this._getArraySize(a,i,t)[2]);this._webgpuProcessingContext.availableAttributes[a]=o,this._webgpuProcessingContext.orderedAttributes[o]=a;const u=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[a];if(u!==void 0){const c=u<0?u===-1?"i32":"vec"+-u+"":u===1?"u32":"vec"+u+"",l=`_int_${a}_`;this._attributesInputWGSL.push(`@location(${o}) ${l} : ${c},`),this._attributesWGSL.push(`${a} : ${i},`),this._attributesConversionCodeWGSL.push(`vertexInputs.${a} = ${i}(vertexInputs_.${l});`),this._hasNonFloatAttribute=!0}else this._attributesInputWGSL.push(`@location(${o}) ${a} : ${i},`),this._attributesWGSL.push(`${a} : ${i},`),this._attributesConversionCodeWGSL.push(`vertexInputs.${a} = vertexInputs_.${a};`);e=""}return e}uniformProcessor(e,t,r){const n=this.uniformRegexp.exec(e);if(n!==null){const i=n[2],a=n[1];this._addUniformToLeftOverUBO(a,i,r),e=""}return e}textureProcessor(e,t,r){const n=this.textureRegexp.exec(e);if(n!==null){const i=n[1],a=n[2],o=!!n[3],u=n[4],c=u.indexOf("storage")>0,l=n[6],h=c?l.substring(0,l.indexOf(",")).trim():null;let d=o?this._getArraySize(i,a,r)[2]:0,p=this._webgpuProcessingContext.availableTextures[i];if(p)d=p.textures.length;else{p={isTextureArray:d>0,isStorageTexture:c,textures:[],sampleType:"float"},d=d||1;for(let m=0;m0,g=lr[u],f=_?"depth":l==="u32"?"uint":l==="i32"?"sint":"float";if(p.sampleType=f,g===void 0)throw`Can't get the texture dimension corresponding to the texture function "${u}"!`;for(let m=0;mc.length-l.length>0?-1:c.length===l.length?0:1);for(const c of u){const l=e.indexOf("#define "+c);let h=e.indexOf(` -`,l);h===-1&&(h=e.length);const d=e.substring(l+8+c.length+1,h);e=e.replace(new RegExp(c,"g"),d)}return e=this._convertDefinesToConst(a)+e,"VERTEXOUTPUT_INVARIANT"in a&&(e=`#define VERTEXOUTPUT_INVARIANT -`+e),e}finalizeShaders(e,t){const r=[],n=t.indexOf("fragmentInputs.position")>=0&&!this.pureMode?` - if (internals.yFactor_ == 1.) { - fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y; - } - `:"";e=this._processSamplers(e,!0),t=this._processSamplers(t,!1),e=this._processCustomBuffers(e,!0),t=this._processCustomBuffers(t,!1);const i=this._buildLeftOverUBO();e=i+e,t=i+t,e=e.replace(/#define /g,"//#define "),e=this._processStridedUniformArrays(e);let a=`struct VertexInputs { - @builtin(vertex_index) vertexIndex : u32, - @builtin(instance_index) instanceIndex : u32, -`;this._attributesInputWGSL.length>0&&(a+=this._attributesInputWGSL.join(` -`)),a+=` -}; -var vertexInputs`+(this._hasNonFloatAttribute?"_":"")+` : VertexInputs; -`,this._hasNonFloatAttribute&&(a+=`struct VertexInputs_ { - vertexIndex : u32, instanceIndex : u32, -`,a+=this._attributesWGSL.join(` -`),a+=` -}; -var vertexInputs : VertexInputs_; -`);let o=`struct FragmentInputs { - @builtin(position)`+(e.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0?" @invariant":"")+` position : vec4, -`;this._varyingsWGSL.length>0&&(o+=this._varyingsWGSL.join(` -`)),o+=` -}; -var vertexOutputs : FragmentInputs; -`,e=a+o+e;let u=` - vertexInputs${this._hasNonFloatAttribute?"_":""} = input; -`;this._hasNonFloatAttribute&&(u+=`vertexInputs.vertexIndex = vertexInputs_.vertexIndex; -vertexInputs.instanceIndex = vertexInputs_.instanceIndex; -`,u+=this._attributesConversionCodeWGSL.join(` -`),u+=` -`);const c=this.pureMode?" return vertexOutputs;":` vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_; - return vertexOutputs;`;let l=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1;e=(l?`diagnostic(off, derivative_uniformity); -`:"")+`diagnostic(off, chromium.unreachable_code); -`+pe(e,"fn main",u,c),t=t.replace(/#define /g,"//#define "),t=this._processStridedUniformArrays(t),this.pureMode||(t=t.replace(/dpdy/g,"(-internals.yFactor_)*dpdy"));let h=`struct FragmentInputs { - @builtin(position) position : vec4, - @builtin(front_facing) frontFacing : bool, -`;this._varyingsWGSL.length>0&&(h+=this._varyingsWGSL.join(` -`)),h+=` -}; -var fragmentInputs : FragmentInputs; -`;let d=`struct FragmentOutputs { -`;const p="fragmentOutputs\\.fragData";let _=t.match(new RegExp(p+"0","g")),g=0;if(_){d+=` @location(${g}) fragData0 : vec4, -`,g++;for(let y=1;y<8;y++)_=t.match(new RegExp(p+y,"g")),_&&(d+=` @location(${g}) fragData${g} : vec4, -`,g++);t.indexOf("MRT_AND_COLOR")!==-1&&(d+=` @location(${g}) color : vec4, -`,g++)}const f=/oitDepthSampler/;_=t.match(f),_&&(d+=` @location(${g++}) depth : vec2, -`,d+=` @location(${g++}) frontColor : vec4, -`,d+=` @location(${g++}) backColor : vec4, -`),g===0&&(t.indexOf("DUAL_SOURCE_BLENDING")!==-1?(r.push("dual_source_blending"),d+=` @location(0) @blend_src(0) color : vec4, -`,d+=` @location(0) @blend_src(1) color2 : vec4, -`):d+=` @location(0) color : vec4, -`,g++);let m=!1,b=0;for(;!m&&(b=t.indexOf(_t,b),!(b<0));){const y=b;for(m=!0;b>1&&t.charAt(b)!==` -`;){if(t.charAt(b)==="/"&&t.charAt(b-1)==="/"){m=!1;break}b--}b=y+_t.length}m&&(d+=` @builtin(frag_depth) fragDepth: f32, -`),d+=`}; -var fragmentOutputs : FragmentOutputs; -`,t=h+d+t;const x=` fragmentInputs = input; - `+n,B=" return fragmentOutputs;";return l=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1,r.length>0&&(t="enable "+r.join(`; -enable `)+`; -`+t),t=(l?`diagnostic(off, derivative_uniformity); -`:"")+`diagnostic(off, chromium.unreachable_code); -`+pe(t,"fn main",x,B),this._collectBindingNames(),this._preCreateBindGroupEntries(),this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}_generateLeftOverUBOCode(e,t){let r="",n=`struct ${e} { -`;for(const i of this._webgpuProcessingContext.leftOverUniforms){const a=i.type.replace(/^(.*?)(<.*>)?$/,"$1"),o=P.UniformSizes[a];if(i.length>0)if(o<=2){const u=`${e}_${this._stridedUniformArrays.length}_strided_arr`;r+=`struct ${u} { - @size(16) - el: ${a}, - }`,this._stridedUniformArrays.push(i.name),n+=` @align(16) ${i.name} : array<${u}, ${i.length}>, -`}else n+=` ${i.name} : array<${i.type}, ${i.length}>, -`;else n+=` ${i.name} : ${i.type}, -`}return n+=`}; -`,n=`${r} -${n}`,n+=`@group(${t.binding.groupIndex}) @binding(${t.binding.bindingIndex}) var ${ur} : ${e}; -`,n}_processSamplers(e,t){const r=/var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;for(;;){const n=r.exec(e);if(n===null)break;const i=n[1],a=n[2],o=i.length-7,u=i.lastIndexOf("Sampler")===o?i.substring(0,o):null,c=a==="sampler_comparison"?"comparison":"filtering";if(u){const _=this._webgpuProcessingContext.availableTextures[u];_&&(_.autoBindSampler=!0)}let l=this._webgpuProcessingContext.availableSamplers[i];l||(l={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:c},this._webgpuProcessingContext.availableSamplers[i]=l),this._addSamplerBindingDescription(i,l,t);const h=e.substring(0,n.index),d=`@group(${l.binding.groupIndex}) @binding(${l.binding.bindingIndex}) `,p=e.substring(n.index);e=h+d+p,r.lastIndex+=d.length}return e}_processCustomBuffers(e,t){const r=/var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;for(;;){const n=r.exec(e);if(n===null)break;const i=n[1],a=n[3];let o=n[4];const u=n[5];let c=this._webgpuProcessingContext.availableBuffers[o];if(!c){const g=i==="uniform"?O.KnownUBOs[u]:null;let f;g?(o=u,f=g.binding,f.groupIndex===-1&&(f=this._webgpuProcessingContext.availableBuffers[o]?.binding,f||(f=this._webgpuProcessingContext.getNextFreeUBOBinding()))):f=this._webgpuProcessingContext.getNextFreeUBOBinding(),c={binding:f},this._webgpuProcessingContext.availableBuffers[o]=c}this._addBufferBindingDescription(o,this._webgpuProcessingContext.availableBuffers[o],a==="read_write"?"storage":i==="storage"?"read-only-storage":"uniform",t);const l=c.binding.groupIndex,h=c.binding.bindingIndex,d=e.substring(0,n.index),p=`@group(${l}) @binding(${h}) `,_=e.substring(n.index);e=d+p+_,r.lastIndex+=p.length}return e}_processStridedUniformArrays(e){for(const t of this._stridedUniformArrays)e=e.replace(new RegExp(`${t}\\s*\\[(.*?)\\]`,"g"),`${t}[$1].el`);return e}}class se{get underlyingResource(){return this._webgpuTexture}getMSAATexture(e,t=0){return this._webgpuMSAATexture[t]||this._createMSAATexture(e,t),this._webgpuMSAATexture[t]}releaseMSAATextures(){for(const e of this._webgpuMSAATexture)e&&this._engine._textureHelper.releaseTexture(e);this._webgpuMSAATexture.length=0}constructor(e,t=null){this._engine=e,this._originalFormatIsRGB=!1,this.format="rgba8unorm",this.originalFormat="rgba8unorm",this.textureUsages=0,this.textureAdditionalUsages=0,this._webgpuTexture=t,this._webgpuMSAATexture=[],this.view=null,this.viewForWriting=null}set(e){this._webgpuTexture=e}setUsage(e,t,r,n,i,a,o,u){let c="2d",l=1;n?(c=r?"cube-array":"cube",l=6*(u||1)):i?(c="3d",l=1):r&&(c="2d-array",l=u);const h=I.GetDepthFormatOnly(this.format),d=I.HasDepthAndStencilAspects(this.format)?"depth-only":"all";this.createView({label:`TextureView${i?"3D":n?"Cube":"2D"}${r?"_Array"+l:""}_${a}x${o}_${t?"wmips":"womips"}_${this.format}_${c}`,format:h,dimension:c,mipLevelCount:t?It(Math.max(a,o))+1:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:l,aspect:d})}createView(e,t=!1){if(this.view=this._webgpuTexture.createView(e),t&&e){const r=e.mipLevelCount;e.mipLevelCount=1,this.viewForWriting=this._webgpuTexture.createView(e),e.mipLevelCount=r}}reset(){this._webgpuTexture=null,this._webgpuMSAATexture.length=0,this.view=null,this.viewForWriting=null}release(){this._webgpuTexture?.destroy(),this.releaseMSAATextures(),this._copyInvertYTempTexture?.destroy(),this.reset()}_createMSAATexture(e,t){if(!this._webgpuTexture)throw new Error("Cannot create GPU MSAA texture because underlying GPU texture is not created yet.");this._webgpuMSAATexture||(this._webgpuMSAATexture=[]),this._webgpuMSAATexture[t]=this._engine._textureHelper.createMSAATexture(this._webgpuTexture,this.originalFormat,e)}}const dr=` - const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f)); - const tex = array, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f)); - - varying vTex: vec2f; - - @vertex - fn main(input : VertexInputs) -> FragmentInputs { - vertexOutputs.vTex = tex[input.vertexIndex]; - vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0); - } - `,fr=` - var imgSampler: sampler; - var img: texture_2d; - - varying vTex: vec2f; - - @fragment - fn main(input: FragmentInputs) -> FragmentOutputs { - fragmentOutputs.color = textureSample(img, imgSampler, input.vTex); - } - `,vt=` - const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f)); - const tex = array, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f)); - - var img: texture_2d; - - #ifdef INVERTY - varying vTextureSize: vec2f; - #endif - - @vertex - fn main(input : VertexInputs) -> FragmentInputs { - #ifdef INVERTY - vertexOutputs.vTextureSize = vec2f(textureDimensions(img, 0)); - #endif - vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0); - } - `,pr=` - var img: texture_2d; - - #ifdef INVERTY - varying vTextureSize: vec2f; - #endif - - @fragment - fn main(input: FragmentInputs) -> FragmentOutputs { - #ifdef INVERTY - var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(input.vTextureSize.y - input.position.y)), 0); - #else - var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0); - #endif - #ifdef PREMULTIPLYALPHA - color = vec4f(color.rgb * color.a, color.a); - #endif - fragmentOutputs.color = color; - } - `,gr=vt,_r=` - var img: texture_2d; - uniform ofstX: f32; - uniform ofstY: f32; - uniform width: f32; - uniform height: f32; - - #ifdef INVERTY - varying vTextureSize: vec2f; - #endif - - @fragment - fn main(input: FragmentInputs) -> FragmentOutputs { - if (input.position.x < uniforms.ofstX || input.position.x >= uniforms.ofstX + uniforms.width) { - discard; - } - if (input.position.y < uniforms.ofstY || input.position.y >= uniforms.ofstY + uniforms.height) { - discard; - } - #ifdef INVERTY - var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(uniforms.ofstY + uniforms.height - (input.position.y - uniforms.ofstY))), 0); - #else - var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0); - #endif - #ifdef PREMULTIPLYALPHA - color = vec4f(color.rgb * color.a, color.a); - #endif - fragmentOutputs.color = color; - } - `,mr=` - const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f)); - - @vertex - fn main(input : VertexInputs) -> FragmentInputs { - vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0); - } - `,br=` - uniform color: vec4f; - - @fragment - fn main(input: FragmentInputs) -> FragmentOutputs { - fragmentOutputs.color = uniforms.color; - } - `,xr=` - struct VertexOutput { - @builtin(position) Position : vec4, - @location(0) fragUV : vec2 - } - - @vertex - fn main( - @builtin(vertex_index) VertexIndex : u32 - ) -> VertexOutput { - var pos = array, 4>( - vec2(-1.0, 1.0), - vec2( 1.0, 1.0), - vec2(-1.0, -1.0), - vec2( 1.0, -1.0) - ); - var tex = array, 4>( - vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(1.0, 1.0) - ); - - var output: VertexOutput; - - output.Position = vec4(pos[VertexIndex], 0.0, 1.0); - output.fragUV = tex[VertexIndex]; - - return output; - } - `,yr=` - @group(0) @binding(0) var videoSampler: sampler; - @group(0) @binding(1) var videoTexture: texture_external; - - @fragment - fn main( - @location(0) fragUV: vec2 - ) -> @location(0) vec4 { - return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV); - } - `,Sr=` - @group(0) @binding(0) var videoSampler: sampler; - @group(0) @binding(1) var videoTexture: texture_external; - - @fragment - fn main( - @location(0) fragUV: vec2 - ) -> @location(0) vec4 { - return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2(fragUV.x, 1.0 - fragUV.y)); - } - `,wr=` - const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f)); - - @vertex - fn main(input : VertexInputs) -> FragmentInputs { - vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0); - } - `,Ir=` - var msaaDepthTexture: texture_depth_multisampled_2d; - - @fragment - fn main(input: FragmentInputs) -> FragmentOutputs { - #ifdef USE_MIN - let numSamples = textureNumSamples(msaaDepthTexture); - var depth = 1.0; - - for (var i = 0u; i < numSamples; i = i + 1u) { - depth = min(depth, textureLoad(msaaDepthTexture, vec2u(input.position.xy), i)); - } - - fragmentOutputs.color = vec4f(depth); - #else - fragmentOutputs.color = vec4f(textureLoad(msaaDepthTexture, vec2u(input.position.xy), 0)); // do like WebGL, take the first sample - #endif - } - `;var U;(function(s){s[s.MipMap=0]="MipMap",s[s.InvertYPremultiplyAlpha=1]="InvertYPremultiplyAlpha",s[s.Clear=2]="Clear",s[s.InvertYPremultiplyAlphaWithOfst=3]="InvertYPremultiplyAlphaWithOfst",s[s.ResolveDepth=4]="ResolveDepth"})(U||(U={}));var j;(function(s){s[s.DontInvertY=0]="DontInvertY",s[s.InvertY=1]="InvertY"})(j||(j={}));const mt=[{vertex:dr,fragment:fr},{vertex:vt,fragment:pr},{vertex:mr,fragment:br},{vertex:gr,fragment:_r},{vertex:wr,fragment:Ir}],W={"":0,r8unorm:1,r8uint:2,r8sint:3,r16uint:4,r16sint:5,r16float:6,rg8unorm:7,rg8uint:8,rg8sint:9,r32uint:10,r32sint:11,r32float:12,rg16uint:13,rg16sint:14,rg16float:15,rgba8unorm:16,"rgba8unorm-srgb":17,rgba8uint:18,rgba8sint:19,bgra8unorm:20,"bgra8unorm-srgb":21,rgb10a2uint:22,rgb10a2unorm:23,rg32uint:24,rg32sint:25,rg32float:26,rgba16uint:27,rgba16sint:28,rgba16float:29,rgba32uint:30,rgba32sint:31,rgba32float:32,stencil8:33,depth16unorm:34,depth24plus:35,"depth24plus-stencil8":36,depth32float:37,"depth32float-stencil8":38,r16unorm:39,rg16unorm:40,rgba16unorm:41,r16snorm:42,rg16snorm:43,rgba16snorm:44};class Cr{constructor(e,t,r,n){if(this._pipelines={},this._compiledShaders=[],this._videoPipelines={},this._videoCompiledShaders=[],this._deferredReleaseTextures=[],this._engine=e,this._device=t,this._bufferManager=r,n.indexOf("rg11b10ufloat-renderable")!==-1){const i=Object.keys(W);W.rg11b10ufloat=W[i[i.length-1]]+1}this._mipmapSampler=t.createSampler({minFilter:"linear"}),this._videoSampler=t.createSampler({minFilter:"linear"}),this._ubCopyWithOfst=this._bufferManager.createBuffer(16,C.Uniform|C.CopyDst,"UBCopyWithOffset").underlyingResource,this._getPipeline("rgba8unorm"),this._getVideoPipeline("rgba8unorm")}_getPipeline(e,t=U.MipMap,r){const n=t===U.MipMap?1:t===U.InvertYPremultiplyAlpha?((r.invertY?1:0)<<1)+((r.premultiplyAlpha?1:0)<<2):t===U.Clear?8:t===U.InvertYPremultiplyAlphaWithOfst?((r.invertY?1:0)<<4)+((r.premultiplyAlpha?1:0)<<5):t===U.ResolveDepth?64:0;this._pipelines[e]||(this._pipelines[e]=[]);let i=this._pipelines[e][n];if(!i){let a="";(t===U.InvertYPremultiplyAlpha||t===U.InvertYPremultiplyAlphaWithOfst)&&(r.invertY&&(a+=`#define INVERTY -`),r.premultiplyAlpha&&(a+=`#define PREMULTIPLYALPHA -`));let o=this._compiledShaders[n];if(!o){let c=mt[t].vertex,l=mt[t].fragment;const h={defines:a.split(` -`),indexParameters:null,isFragment:!1,shouldUseHighPrecisionShader:!0,processor:this._engine._getShaderProcessor(1),supportsUniformBuffers:!0,shadersRepository:"",includesShadersStore:{},version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._engine._getShaderProcessingContext(1,!0),isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer};At(h),h.processor.pureMode=!0,Te(c,h,g=>{c=g},this._engine),h.isFragment=!0,Te(l,h,g=>{l=g},this._engine);const d=Mt(c,l,h);h.processor.pureMode=!1;const p=this._device.createShaderModule({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalVertexShader_${n}`,code:d.vertexCode}),_=this._device.createShaderModule({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalFragmentShader_${n}`,code:d.fragmentCode});o=this._compiledShaders[n]=[p,_]}const u=this._device.createRenderPipeline({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalPipeline_${e}_${n}`,layout:"auto",vertex:{module:o[0],entryPoint:"main"},fragment:{module:o[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});i=this._pipelines[e][n]=[u,u.getBindGroupLayout(0)]}return i}_getVideoPipeline(e,t=j.DontInvertY){const r=t===j.InvertY?1:0;this._videoPipelines[e]||(this._videoPipelines[e]=[]);let n=this._videoPipelines[e][r];if(!n){let i=this._videoCompiledShaders[r];if(!i){const o=this._device.createShaderModule({code:xr,label:`BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_VertexShader`}),u=this._device.createShaderModule({code:r===0?yr:Sr,label:`BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_FragmentShader_${r===0?"DontInvertY":"InvertY"}`});i=this._videoCompiledShaders[r]=[o,u]}const a=this._device.createRenderPipeline({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalVideoPipeline_${e}_${r===0?"DontInvertY":"InvertY"}`,layout:"auto",vertex:{module:i[0],entryPoint:"main"},fragment:{module:i[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});n=this._videoPipelines[e][r]=[a,a.getBindGroupLayout(0)]}return n}setCommandEncoder(e){this._commandEncoderForCreation=e}copyVideoToTexture(e,t,r,n=!1,i){const a=i===void 0,[o,u]=this._getVideoPipeline(r,n?j.InvertY:j.DontInvertY);a&&(i=this._device.createCommandEncoder({})),i.pushDebugGroup(`copy video to texture (invertY=${n})`);const c=t._hardwareTexture,l={label:`BabylonWebGPUDevice${this._engine.uniqueId}_copyVideoToTexture_${r}_${n?"InvertY":"DontInvertY"}${t.label?"_"+t.label:""}`,colorAttachments:[{view:c.underlyingResource.createView({format:r,dimension:"2d",mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:"all"}),loadOp:"load",storeOp:"store"}]},h=i.beginRenderPass(l),d={layout:u,entries:[{binding:0,resource:this._videoSampler},{binding:1,resource:this._device.importExternalTexture({source:e.underlyingResource})}]},p=this._device.createBindGroup(d);h.setPipeline(o),h.setBindGroup(0,p),h.draw(4,1,0,0),h.end(),i.popDebugGroup(),a&&(this._device.queue.submit([i.finish()]),i=null)}invertYPreMultiplyAlpha(e,t,r,n,i=!1,a=!1,o=0,u=0,c=1,l=0,h=0,d=0,p=0,_,g){const f=d!==0,m=_===void 0,[b,x]=this._getPipeline(n,f?U.InvertYPremultiplyAlphaWithOfst:U.InvertYPremultiplyAlpha,{invertY:i,premultiplyAlpha:a});o=Math.max(o,0),m&&(_=this._device.createCommandEncoder({}));let B;if(I.IsHardwareTexture(e)?(B=e.underlyingResource,i&&!a&&c===1&&o===0||(e=void 0)):(B=e,e=void 0),!B)return;_.pushDebugGroup(`internal process texture "${B.label}" (invertY=${i} premultiplyAlpha=${a})`),f&&this._bufferManager.setRawData(this._ubCopyWithOfst,0,new Float32Array([l,h,d,p]),0,16);const y=e,M=y?._copyInvertYTempTexture??this.createTexture({width:t,height:r,layers:1},!1,!1,!1,!1,!1,n,1,_,21,void 0,"TempTextureForCopyWithInvertY"),R=y?._copyInvertYRenderPassDescr??{label:`BabylonWebGPUDevice${this._engine.uniqueId}_invertYPreMultiplyAlpha_${n}_${i?"InvertY":"DontInvertY"}_${a?"PremultiplyAlpha":"DontPremultiplyAlpha"}`,colorAttachments:[{view:M.createView({format:n,dimension:"2d",baseMipLevel:0,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:0}),loadOp:"load",storeOp:"store"}]},v=_.beginRenderPass(R);let L=f?y?._copyInvertYBindGroupWithOfst:y?._copyInvertYBindGroup;if(!L){const G={layout:x,entries:[{binding:0,resource:B.createView({format:n,dimension:"2d",baseMipLevel:u,mipLevelCount:1,arrayLayerCount:c,baseArrayLayer:o})}]};f&&G.entries.push({binding:1,resource:{buffer:this._ubCopyWithOfst}}),L=this._device.createBindGroup(G)}v.setPipeline(b),v.setBindGroup(0,L),v.draw(4,1,0,0),v.end(),_.copyTextureToTexture({texture:M},{texture:B,mipLevel:u,origin:{x:0,y:0,z:o}},{width:d||t,height:p||r,depthOrArrayLayers:1}),y?(y._copyInvertYTempTexture=M,y._copyInvertYRenderPassDescr=R,f?y._copyInvertYBindGroupWithOfst=L:y._copyInvertYBindGroup=L):this._deferredReleaseTextures.push([M,null]),_.popDebugGroup(),m&&(this._device.queue.submit([_.finish()]),_=null)}createTexture(e,t=!1,r=!1,n=!1,i=!1,a=!1,o="rgba8unorm",u=1,c,l=-1,h=0,d){u=I.GetSample(u);const p=e.layers||1,_={width:e.width,height:e.height,depthOrArrayLayers:p},g=W[o]?16:0,f=I.IsCompressedFormat(o),m=t?I.ComputeNumMipmapLevels(e.width,e.height):1,b=l>=0?l:7;h|=t&&!f?1|g:0,!f&&!a&&(h|=g|2);const x=this._device.createTexture({label:`BabylonWebGPUDevice${this._engine.uniqueId}_Texture${a?"3D":"2D"}_${d?d+"_":""}${_.width}x${_.height}x${_.depthOrArrayLayers}_${t?"wmips":"womips"}_${o}_samples${u}`,size:_,dimension:a?"3d":"2d",format:o,usage:b|h,sampleCount:u,mipLevelCount:m});return I.IsImageBitmap(e)&&(this.updateTexture(e,x,e.width,e.height,p,o,0,0,n,i,0,0),t&&r&&this.generateMipmaps(x,m,0,c)),x}createCubeTexture(e,t=!1,r=!1,n=!1,i=!1,a="rgba8unorm",o=1,u,c=-1,l=0,h){o=I.GetSample(o);const d=I.IsImageBitmapArray(e)?e[0].width:e.width,p=I.IsImageBitmapArray(e)?e[0].height:e.height,_=I.IsImageBitmapArray(e)?1:e.layers,g=W[a]?16:0,f=I.IsCompressedFormat(a),m=t?I.ComputeNumMipmapLevels(d,p):1,b=c>=0?c:7;l|=t&&!f?1|g:0,f||(l|=g|2);const x=this._device.createTexture({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureCube_${h?h+"_":""}${d}x${p}x${_}_${t?"wmips":"womips"}_${a}_samples${o}`,size:{width:d,height:p,depthOrArrayLayers:6*_},dimension:"2d",format:a,usage:b|l,sampleCount:o,mipLevelCount:m});return I.IsImageBitmapArray(e)&&(this.updateCubeTextures(e,x,d,p,a,n,i,0,0),t&&r&&this.generateCubeMipmaps(x,m,u)),x}generateCubeMipmaps(e,t,r){const n=r===void 0,i=I.IsHardwareTexture(e)?e.underlyingResource:e;n&&(r=this._device.createCommandEncoder({})),r.pushDebugGroup(`create cube mipmaps for "${i.label}" (${t} levels)`);for(let a=0;a1)switch(a.format){case"depth16unorm":a.format="r16unorm";break;case"depth24plus":case"depth24plus-stencil8":case"depth32float":case"depth32float-stencil8":a.format="r32float";break}a.textureUsages=e._source===5||e.source===6?21:e._source===12?20:-1,a.textureAdditionalUsages=o?8:0;const u=e.generateMipMaps,c=n||1;let l;if(e._maxLodLevel!==null?l=e._maxLodLevel:l=u?I.ComputeNumMipmapLevels(t,r):1,e.isCube){const h=this.createCubeTexture({width:t,height:r,layers:c},e.generateMipMaps,e.generateMipMaps,e.invertY,!1,a.format,1,this._commandEncoderForCreation,a.textureUsages,a.textureAdditionalUsages,e.label);a.set(h);const d=I.GetDepthFormatOnly(a.format),p=I.HasDepthAndStencilAspects(a.format)?"depth-only":"all",_=e.is2DArray?"cube-array":"cube";a.createView({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureViewCube${e.is2DArray?"_Array"+c:""}_${t}x${r}_${u?"wmips":"womips"}_${d}_${_}_${p}_${e.label??"noname"}`,format:d,dimension:_,mipLevelCount:l,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:6*c,aspect:p},o)}else{const h=this.createTexture({width:t,height:r,layers:c},e.generateMipMaps,e.generateMipMaps,e.invertY,!1,e.is3D,a.format,1,this._commandEncoderForCreation,a.textureUsages,a.textureAdditionalUsages,e.label);a.set(h);const d=e.is3D?1:c,p=I.GetDepthFormatOnly(a.format),_=I.HasDepthAndStencilAspects(a.format)?"depth-only":"all",g=e.is2DArray?"2d-array":e.is3D?"3d":"2d";a.createView({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureView${e.is3D?"3D":"2D"}${e.is2DArray?"_Array"+d:""}_${t}x${r}${e.is3D?"x"+c:""}_${u?"wmips":"womips"}_${p}_${g}_${_}_${e.label??"noname"}`,format:p,dimension:g,mipLevelCount:l,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:d,aspect:_},o)}return a}createMSAATexture(e,t,r){return this.createTexture({width:e.width,height:e.height,layers:1},!1,!1,!1,!1,!1,t,r,this._commandEncoderForCreation,20,0,e.label?e.label+" (MSAA)":"MSAA")}resolveMSAADepthTexture(e,t,r){const n=t.format,i=r===void 0,[a,o]=this._getPipeline(n,U.ResolveDepth);i&&(r=this._device.createCommandEncoder({})),r.pushDebugGroup(`resolve MSAA Depth texture "${e.label}" to "${t.label}"`);const u={label:`BabylonWebGPUDevice${this._engine.uniqueId}_resolveMSAADepthTexture${e.label?"_"+e.label:""}`,colorAttachments:[{view:t,loadOp:"load",storeOp:"store"}]},c=r.beginRenderPass(u),l={layout:o,entries:[{binding:0,resource:e.createView({format:I.GetDepthFormatOnly(e.format),dimension:"2d",mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:"depth-only"})}]},h=this._device.createBindGroup(l);c.setPipeline(a),c.setBindGroup(0,h),c.draw(4,1,0,0),c.end(),r.popDebugGroup(),i&&(this._device.queue.submit([r.finish()]),r=null)}updateCubeTextures(e,t,r,n,i,a=!1,o=!1,u=0,c=0){const l=[0,3,1,4,2,5];for(let h=0;h{e.mapAsync(1,u,t).then(()=>{const f=e.getMappedRange(u,t);let m=c;if(h)m===null?m=Be(o,t,!0,f):m=Be(o,m.buffer,void 0,f);else if(m===null)switch(d){case 0:m=new Uint8Array(t),m.set(new Uint8Array(f));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,f);break;case 2:m=new Float32Array(t/4),m.set(new Float32Array(f));break}else switch(d){case 0:m=new Uint8Array(m.buffer),m.set(new Uint8Array(f,0,Math.min(m.byteLength,t)));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,f,c);break;case 2:m=new Float32Array(m.buffer),m.set(new Float32Array(f,0,m.byteLength/4));break}if(i!==a){d===1&&!h&&(i*=2,a*=2);const b=new Uint8Array(m.buffer);let x=i,B=0;for(let y=1;y{this._engine.isDisposed||this._engine.uniqueId!==p?_(new Uint8Array):g(f)})})}releaseBuffer(e){return ie._IsGPUBuffer(e)?(this._deferredReleaseBuffers.push(e),!0):(e.references--,e.references===0?(this._deferredReleaseBuffers.push(e.underlyingResource),!0):!1)}destroyDeferredBuffers(){for(let e=0;e1?i="linear":(i="nearest",a=o=0);break;case 12:r="linear",n="nearest",i="nearest",a=o=0;break;default:r="nearest",n="nearest",i="nearest",a=o=0;break}return t>1&&(a!==0||o!==0)?{magFilter:"linear",minFilter:"linear",mipmapFilter:"linear",anisotropyEnabled:!0}:{magFilter:r,minFilter:n,mipmapFilter:i,lodMinClamp:a,lodMaxClamp:o}}static _GetWrappingMode(e){switch(e){case 1:return"repeat";case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"}static _GetSamplerWrappingDescriptor(e){return{addressModeU:this._GetWrappingMode(e._cachedWrapU),addressModeV:this._GetWrappingMode(e._cachedWrapV),addressModeW:this._GetWrappingMode(e._cachedWrapR)}}static _GetSamplerDescriptor(e,t){let r=(e.useMipMaps||e.samplingMode===2)&&e._cachedAnisotropicFilteringLevel?e._cachedAnisotropicFilteringLevel:1;e.samplingMode!==11&&e.samplingMode!==3&&e.samplingMode!==2&&(r=1);const n=this._GetSamplerFilterDescriptor(e,r);return{label:t,...n,...this._GetSamplerWrappingDescriptor(e),compare:e._comparisonFunction?z.GetCompareFunction(e._comparisonFunction):void 0,maxAnisotropy:n.anisotropyEnabled?r:1}}static GetCompareFunction(e){switch(e){case 519:return"always";case 514:return"equal";case 516:return"greater";case 518:return"greater-equal";case 513:return"less";case 515:return"less-equal";case 512:return"never";case 517:return"not-equal";default:return"less"}}getSampler(e,t=!1,r=0,n){if(this.disabled)return this._device.createSampler(z._GetSamplerDescriptor(e,n));t?r=0:r===0&&(r=z.GetSamplerHashCode(e));let i=t?void 0:this._samplers[r];return i||(i=this._device.createSampler(z._GetSamplerDescriptor(e,n)),t||(this._samplers[r]=i)),i}}const Rr={[w.PositionKind]:!0,[w.NormalKind]:!0,[w.TangentKind]:!0,[w.UVKind]:!0,[w.UV2Kind]:!0,[w.UV3Kind]:!0,[w.UV4Kind]:!0,[w.UV5Kind]:!0,[w.UV6Kind]:!0,[w.ColorKind]:!0,[w.ColorInstanceKind]:!0,[w.MatricesIndicesKind]:!0,[w.MatricesWeightsKind]:!0,[w.MatricesIndicesExtraKind]:!0,[w.MatricesWeightsExtraKind]:!0};function Ar(s){switch(s){case w.BYTE:case w.SHORT:case w.INT:case w.FLOAT:return!0;case w.UNSIGNED_BYTE:case w.UNSIGNED_SHORT:case w.UNSIGNED_INT:return!1;default:throw new Error(`Invalid type '${s}'`)}}function Mr(s,e){const t=e.getEngine(),r=e._pipelineContext;if(!r?.vertexBufferKindToType)return;let n=null;for(const i in s){const a=s[i];if(!a||!Rr[i])continue;const o=a.normalized?w.FLOAT:a.type,u=r.vertexBufferKindToType[i];(o!==w.FLOAT&&u===void 0||u!==void 0&&u!==o)&&(n||(n=t._getShaderProcessingContext(e.shaderLanguage,!1)),r.vertexBufferKindToType[i]=o,o!==w.FLOAT&&(n.vertexBufferKindToNumberOfComponents[i]=w.DeduceStride(i),Ar(o)&&(n.vertexBufferKindToNumberOfComponents[i]*=-1)))}if(n){const i=t._caps.parallelShaderCompile;t._caps.parallelShaderCompile=void 0,e._processShaderCodeAsync(null,t._features._checkNonFloatVertexBuffersDontRecreatePipelineContext,n),t._caps.parallelShaderCompile=i}}var F;(function(s){s[s.StencilReadMask=0]="StencilReadMask",s[s.StencilWriteMask=1]="StencilWriteMask",s[s.DepthBias=2]="DepthBias",s[s.DepthBiasSlopeScale=3]="DepthBiasSlopeScale",s[s.DepthStencilState=4]="DepthStencilState",s[s.MRTAttachments=5]="MRTAttachments",s[s.RasterizationState=6]="RasterizationState",s[s.ColorStates1=7]="ColorStates1",s[s.ColorStates2=8]="ColorStates2",s[s.ColorStates3=9]="ColorStates3",s[s.ColorStates4=10]="ColorStates4",s[s.ShaderStage=11]="ShaderStage",s[s.TextureStage=12]="TextureStage",s[s.VertexState=13]="VertexState",s[s.NumStates=14]="NumStates"})(F||(F={}));const te={0:1,1:2,768:3,769:4,770:5,771:6,772:7,773:8,774:9,775:10,776:11,32769:12,32770:13,32771:14,32772:15,35065:16,35066:17,34185:18,35067:19},bt={32774:0,32775:1,32776:2,32778:3,32779:4},$={0:0,7680:1,7681:2,7682:3,7683:4,5386:5,34055:6,34056:7},Y=[0,0,0,0];class D{constructor(e,t){this.mrtTextureCount=0,this._device=e,this._useTextureStage=!0,this._states=new Array(30),this._statesLength=0,this._stateDirtyLowestIndex=0,this._emptyVertexBuffer=t,this._mrtFormats=[],this._parameter={token:void 0,pipeline:null},this.disabled=!1,this.vertexBuffers=[],this._kMaxVertexBufferStride=e.limits.maxVertexBufferArrayStride||2048,this.reset()}reset(){this._isDirty=!0,this.vertexBuffers.length=0,this.setAlphaToCoverage(!1),this.resetDepthCullingState(),this.setClampDepth(!1),this.setDepthBias(0),this._webgpuColorFormat=["bgra8unorm"],this.setColorFormat("bgra8unorm"),this.setMRT([]),this.setAlphaBlendEnabled([!1],1),this.setAlphaBlendFactors([null,null,null,null],[null,null]),this.setWriteMask(15),this.setDepthStencilFormat("depth24plus-stencil8"),this.setStencilEnabled(!1),this.resetStencilState(),this.setBuffers(null,null,null),this._setTextureState(0)}get colorFormats(){return this._mrtAttachments>0?this._mrtFormats:this._webgpuColorFormat}getRenderPipeline(e,t,r,n=0){if(r=I.GetSample(r),this.disabled){const a=D._GetTopology(e);return this._setVertexState(t),this._setTextureState(n),this._parameter.pipeline=this._createRenderPipeline(t,a,r),D.NumCacheMiss++,D._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}if(this._setShaderStage(t.uniqueId),this._setRasterizationState(e,r),this._setColorStates(),this._setDepthStencilState(),this._setVertexState(t),this._setTextureState(n),this.lastStateDirtyLowestIndex=this._stateDirtyLowestIndex,!this._isDirty&&this._parameter.pipeline)return this._stateDirtyLowestIndex=this._statesLength,D.NumCacheHitWithoutHash++,this._parameter.pipeline;if(this._getRenderPipeline(this._parameter),this._isDirty=!1,this._stateDirtyLowestIndex=this._statesLength,this._parameter.pipeline)return D.NumCacheHitWithHash++,this._parameter.pipeline;const i=D._GetTopology(e);return this._parameter.pipeline=this._createRenderPipeline(t,i,r),this._setRenderPipeline(this._parameter),D.NumCacheMiss++,D._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}endFrame(){D.NumPipelineCreationLastFrame=D._NumPipelineCreationCurrentFrame,D._NumPipelineCreationCurrentFrame=0}setAlphaToCoverage(e){this._alphaToCoverageEnabled=e}setFrontFace(e){this._frontFace=e}setCullEnabled(e){this._cullEnabled=e}setCullFace(e){this._cullFace=e}setClampDepth(e){this._clampDepth=e}resetDepthCullingState(){this.setDepthCullingState(!1,2,1,0,0,!0,!0,519)}setDepthCullingState(e,t,r,n,i,a,o,u){this._depthWriteEnabled=o,this._depthTestEnabled=a,this._depthCompare=(u??519)-512,this._cullFace=r,this._cullEnabled=e,this._frontFace=t,this.setDepthBiasSlopeScale(n),this.setDepthBias(i)}setDepthBias(e){this._depthBias!==e&&(this._depthBias=e,this._states[F.DepthBias]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,F.DepthBias))}setDepthBiasSlopeScale(e){this._depthBiasSlopeScale!==e&&(this._depthBiasSlopeScale=e,this._states[F.DepthBiasSlopeScale]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,F.DepthBiasSlopeScale))}setColorFormat(e){this._webgpuColorFormat[0]=e,this._colorFormat=W[e??""]}setMRTAttachments(e){this.mrtAttachments=e;let t=0;for(let r=0;r8)throw new Error("Can't handle more than 8 attachments for a MRT in cache render pipeline!");this.mrtTextureArray=e,this.mrtTextureCount=t,this._mrtEnabledMask=65535;let r=0,n=0;for(let i=0;i0)for(let p=0;p=this._video.HAVE_CURRENT_DATA}dispose(){}}class oe{get forceBindGroupCreation(){return this._numExternalTextures>0}get hasFloatOrDepthTextures(){return this._numFloatOrDepthTextures>0}constructor(){this.useVertexPulling=!1,this.uniqueId=oe._Counter++,this.updateId=0,this.textureState=0,this.reset()}reset(){this.samplers={},this.textures={},this.isDirty=!0,this._numFloatOrDepthTextures=0,this._numExternalTextures=0}setSampler(e,t){let r=this.samplers[e],n=-1;r?n=r.hashCode:this.samplers[e]=r={sampler:t,hashCode:0},r.sampler=t,r.hashCode=t?z.GetSamplerHashCode(t):0;const i=n!==r.hashCode;i&&this.updateId++,this.isDirty||(this.isDirty=i)}setTexture(e,t){let r=this.textures[e],n=-1;r?n=r.texture?.uniqueId??-1:this.textures[e]=r={texture:t,isFloatOrDepthTexture:!1,isExternalTexture:!1},r.isExternalTexture&&this._numExternalTextures--,r.isFloatOrDepthTexture&&this._numFloatOrDepthTextures--,t?(r.isFloatOrDepthTexture=t.type===1||t.format>=13&&t.format<=18,r.isExternalTexture=Tt.IsExternalTexture(t),r.isFloatOrDepthTexture&&this._numFloatOrDepthTextures++,r.isExternalTexture&&this._numExternalTextures++):(r.isFloatOrDepthTexture=!1,r.isExternalTexture=!1),r.texture=t;const i=n!==(t?.uniqueId??-1);i&&this.updateId++,this.isDirty||(this.isDirty=i)}}oe._Counter=0;class ue{isDirty(e){return this._isDirty||this._materialContextUpdateId!==e}resetIsDirty(e){this._isDirty=!1,this._materialContextUpdateId=e}get enableIndirectDraw(){return this._enableIndirectDraw}set enableIndirectDraw(e){this._enableIndirectDrawInCompatMode=!0,this._enableIndirectDraw!==e&&(this._enableIndirectDraw=e,!e&&!this._useInstancing&&this.indirectDrawBuffer?(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0):e&&!this.indirectDrawBuffer&&(this.indirectDrawBuffer=this._bufferManager.createRawBuffer(20,C.CopyDst|C.Indirect|C.Storage,void 0,"IndirectDrawBuffer"),this._indirectDrawData=new Uint32Array(5),this._indirectDrawData[3]=0,this._indirectDrawData[4]=0))}get useInstancing(){return this._useInstancing}set useInstancing(e){if(this._useInstancing===e)return;this._useInstancing=e,this._currentInstanceCount=-1;const t=this._enableIndirectDrawInCompatMode;this.enableIndirectDraw=e,this._enableIndirectDrawInCompatMode=t}constructor(e,t){this._dummyIndexBuffer=t,this._enableIndirectDrawInCompatMode=!1,this._bufferManager=e,this.uniqueId=ue._Counter++,this._useInstancing=!1,this._currentInstanceCount=0,this._enableIndirectDraw=!1,this._vertexPullingEnabled=!1,this.reset()}reset(){this.buffers={},this._isDirty=!0,this._materialContextUpdateId=0,this.fastBundle=void 0,this.bindGroups=void 0,this._vertexPullingEnabled=!1}setBuffer(e,t){this._isDirty||(this._isDirty=t?.uniqueId!==this.buffers[e]?.uniqueId),this.buffers[e]=t}setIndirectData(e,t,r,n=!1){!n&&t===this._currentInstanceCount||!this.indirectDrawBuffer||!this._indirectDrawData||(this._currentInstanceCount=t,this._indirectDrawData[0]=e,this._indirectDrawData[1]=t,this._indirectDrawData[2]=r,this._bufferManager.setRawData(this.indirectDrawBuffer,0,this._indirectDrawData,0,20))}setVertexPulling(e,t,r,n,i){if(this._vertexPullingEnabled===e)return;this._vertexPullingEnabled=e,this._isDirty=!0;const a=t.shaderProcessingContext.bufferNames;if(i)for(const o in i){const u=i[o];if(!u||a.indexOf(o)===-1)continue;const c=u.effectiveBuffer;this.setBuffer(o,e?c:null)}for(const o in r){if(i&&o in i)continue;const u=r[o];if(!u||a.indexOf(o)===-1)continue;const c=u.effectiveBuffer;this.setBuffer(o,e?c:null)}a.indexOf("indices")!==-1&&this.setBuffer("indices",e?n??this._dummyIndexBuffer:null)}dispose(){this.indirectDrawBuffer&&(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this.fastBundle=void 0,this.bindGroups=void 0,this.buffers=void 0,this._enableIndirectDraw=!1}}ue._Counter=0;const Lr=1<<20,Er=2**35;class J{constructor(){this.values={}}}class T{static get Statistics(){return{totalCreated:T.NumBindGroupsCreatedTotal,lastFrameCreated:T.NumBindGroupsCreatedLastFrame,lookupLastFrame:T.NumBindGroupsLookupLastFrame,noLookupLastFrame:T.NumBindGroupsNoLookupLastFrame}}static ResetCache(){T._Cache=new J,T.NumBindGroupsCreatedTotal=0,T.NumBindGroupsCreatedLastFrame=0,T.NumBindGroupsLookupLastFrame=0,T.NumBindGroupsNoLookupLastFrame=0,T._NumBindGroupsCreatedCurrentFrame=0,T._NumBindGroupsLookupCurrentFrame=0,T._NumBindGroupsNoLookupCurrentFrame=0}constructor(e,t,r){this.disabled=!1,this._device=e,this._cacheSampler=t,this._engine=r}endFrame(){T.NumBindGroupsCreatedLastFrame=T._NumBindGroupsCreatedCurrentFrame,T.NumBindGroupsLookupLastFrame=T._NumBindGroupsLookupCurrentFrame,T.NumBindGroupsNoLookupLastFrame=T._NumBindGroupsNoLookupCurrentFrame,T._NumBindGroupsCreatedCurrentFrame=0,T._NumBindGroupsLookupCurrentFrame=0,T._NumBindGroupsNoLookupCurrentFrame=0}getBindGroups(e,t,r){let n,i=T._Cache;const a=this.disabled||r.forceBindGroupCreation;if(!a){if(!t.isDirty(r.updateId)&&!r.isDirty)return T._NumBindGroupsNoLookupCurrentFrame++,t.bindGroups;for(const u of e.shaderProcessingContext.bufferNames){const c=(t.buffers[u]?.uniqueId??0)+Lr;let l=i.values[c];l||(l=new J,i.values[c]=l),i=l}for(const u of e.shaderProcessingContext.samplerNames){const c=r.samplers[u]?.hashCode??0;let l=i.values[c];l||(l=new J,i.values[c]=l),i=l}for(const u of e.shaderProcessingContext.textureNames){const c=(r.textures[u]?.texture?.uniqueId??0)+Er;let l=i.values[c];l||(l=new J,i.values[c]=l),i=l}n=i.bindGroups}if(t.resetIsDirty(r.updateId),r.isDirty=!1,n)return t.bindGroups=n,T._NumBindGroupsLookupCurrentFrame++,n;n=[],t.bindGroups=n,a||(i.bindGroups=n),T.NumBindGroupsCreatedTotal++,T._NumBindGroupsCreatedCurrentFrame++;const o=e.bindGroupLayouts[r.textureState];for(let u=0;ub==="texture"?"":x)}, materialContext.uniqueId=${r.uniqueId}`,50);continue}l[d].resource=this._cacheSampler.getSampler(m,!1,f.hashCode,m.label)}else S.Error(`Sampler "${g}" not found in the material context. Make sure you bound it. entry=${JSON.stringify(p)}, materialContext=${JSON.stringify(r,(m,b)=>m==="texture"||m==="sampler"?"":b)}`,50)}else if(p.texture||p.storageTexture){const f=r.textures[g];if(f){if(this._engine.dbgSanityChecks&&f.texture===null){S.Error(`Trying to bind a null texture! name="${g}", entry=${JSON.stringify(p)}, bindingInfo=${JSON.stringify(f,(b,x)=>b==="texture"?"":x)}, materialContext.uniqueId=${r.uniqueId}`,50);continue}const m=f.texture._hardwareTexture;if(this._engine.dbgSanityChecks&&(!m||p.texture&&!m.view||p.storageTexture&&!m.viewForWriting)){S.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(p)}, name=${g}, bindingInfo=${JSON.stringify(f,(b,x)=>b==="texture"?"":x)}, isReady=${f.texture?.isReady}, materialContext.uniqueId=${r.uniqueId}`,50);continue}l[d].resource=p.storageTexture?m.viewForWriting:m.view}else S.Error(`Texture "${g}" not found in the material context. Make sure you bound it (something like effect.setTexture("${g}", texture)). entry=${JSON.stringify(p)}, materialContext=${JSON.stringify(r,(m,b)=>m==="texture"||m==="sampler"?"":b)}`,50)}else if(p.externalTexture){const f=r.textures[g];if(f){if(this._engine.dbgSanityChecks&&f.texture===null){S.Error(`Trying to bind a null external texture! entry=${JSON.stringify(p)}, name=${g}, bindingInfo=${JSON.stringify(f,(b,x)=>b==="texture"?"":x)}, materialContext.uniqueId=${r.uniqueId}`,50);continue}const m=f.texture.underlyingResource;if(this._engine.dbgSanityChecks&&!m){S.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(p)}, name=${g}, bindingInfo=${JSON.stringify(f,(b,x)=>b==="texture"?"":x)}, isReady=${f.texture?.isReady}, materialContext.uniqueId=${r.uniqueId}`,50);continue}l[d].resource=this._device.importExternalTexture({source:m})}else S.Error(`External texture "${g}" not found in the material context. Make sure you bound it. entry=${JSON.stringify(p)}, materialContext=${JSON.stringify(r,(m,b)=>m==="texture"||m==="sampler"?"":b)}`,50)}else if(p.buffer){const f=t.buffers[g];if(f){const m=f.underlyingResource;l[d].resource.buffer=m,l[d].resource.size=f.capacity}else S.Error(`Can't find buffer "${g}" in the draw context. Make sure you bound it. entry=${JSON.stringify(p)}, buffers=${JSON.stringify(t.buffers)}, drawContext.uniqueId=${t.uniqueId}`,50)}}const h=o[u];n[u]=this._device.createBindGroup({layout:h,entries:l})}return n}}T.NumBindGroupsCreatedTotal=0;T.NumBindGroupsCreatedLastFrame=0;T.NumBindGroupsLookupLastFrame=0;T.NumBindGroupsNoLookupLastFrame=0;T._Cache=new J;T._NumBindGroupsCreatedCurrentFrame=0;T._NumBindGroupsLookupCurrentFrame=0;T._NumBindGroupsNoLookupCurrentFrame=0;const xt="clearQuadVertexShader",Or=`uniform depthValue: f32;const pos=array( -vec2f(-1.0,1.0), -vec2f(1.0,1.0), -vec2f(-1.0,-1.0), -vec2f(1.0,-1.0) -); -#define CUSTOM_VERTEX_DEFINITIONS -@vertex -fn main(input : VertexInputs)->FragmentInputs { -#define CUSTOM_VERTEX_MAIN_BEGIN -vertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0); -#define CUSTOM_VERTEX_MAIN_END -} -`;ne.ShadersStoreWGSL[xt]||(ne.ShadersStoreWGSL[xt]=Or);const yt="clearQuadPixelShader",Gr=`uniform color: vec4f;@fragment -fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;} -`;ne.ShadersStoreWGSL[yt]||(ne.ShadersStoreWGSL[yt]=Gr);class Ur{setDepthStencilFormat(e){this._depthTextureFormat=e,this._cacheRenderPipeline.setDepthStencilFormat(e)}setColorFormat(e){this._cacheRenderPipeline.setColorFormat(e)}setMRTAttachments(e,t,r){this._cacheRenderPipeline.setMRT(t,r),this._cacheRenderPipeline.setMRTAttachments(e)}constructor(e,t,r){this._bindGroups={},this._bundleCache={},this._keyTemp=[],this._device=e,this._engine=t,this._cacheRenderPipeline=new k(this._device,r),this._cacheRenderPipeline.setDepthTestEnabled(!1),this._cacheRenderPipeline.setStencilReadMask(255),this._effect=t.createEffect("clearQuad",[],["color","depthValue"],void 0,void 0,void 0,void 0,void 0,void 0,1)}clear(e,t,r,n,i=1){let a,o=null,u;const c=!!this._engine._currentRenderTarget;if(e)a=e;else{let f=0;this._keyTemp.length=0;for(let b=0;b1?2**36:0)+m*2**37,u=this._keyTemp.join("_"),o=this._bundleCache[u],o)return o;a=this._device.createRenderBundleEncoder({label:"clearQuadRenderBundle",colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:I.GetSample(i)})}this._cacheRenderPipeline.setDepthWriteEnabled(!!r),this._cacheRenderPipeline.setStencilEnabled(!!n&&!!this._depthTextureFormat&&I.HasStencilAspect(this._depthTextureFormat)),this._cacheRenderPipeline.setStencilWriteMask(n?255:0),this._cacheRenderPipeline.setStencilCompare(n?519:512),this._cacheRenderPipeline.setStencilPassOp(n?7681:7680),this._cacheRenderPipeline.setWriteMask(t?15:0);const l=this._cacheRenderPipeline.getRenderPipeline(7,this._effect,i),h=this._effect._pipelineContext;t&&this._effect.setDirectColor4("color",t),this._effect.setFloat("depthValue",this._engine.useReverseDepthBuffer?this._engine._clearReverseDepthValue:this._engine._clearDepthValue),h.uniformBuffer.update();const d=c?this._engine._ubInvertY:this._engine._ubDontInvertY,p=h.uniformBuffer.getBuffer(),_=p.uniqueId+"-"+d.uniqueId;let g=this._bindGroups[_];if(!g){const f=h.bindGroupLayouts[0];g=this._bindGroups[_]=[],g.push(this._device.createBindGroup({label:`clearQuadBindGroup0-${_}`,layout:f[0],entries:[]})),O._SimplifiedKnownBindings||g.push(this._device.createBindGroup({label:`clearQuadBindGroup1-${_}`,layout:f[1],entries:[]})),g.push(this._device.createBindGroup({label:`clearQuadBindGroup${O._SimplifiedKnownBindings?1:2}-${_}`,layout:f[O._SimplifiedKnownBindings?1:2],entries:[{binding:0,resource:{buffer:d.underlyingResource,size:d.capacity}},{binding:1,resource:{buffer:p.underlyingResource,size:p.capacity}}]}))}a.setPipeline(l);for(let f=0;f{t!==null&&t>=0&&(this._gpuFrameTimeCounter.fetchNewFrame(),this._gpuFrameTimeCounter.addCount(t,!0)),this._measureDurationState=0}))}startPass(e,t){this._enabled?this._measureDuration.startPass(e,t):e.timestampWrites=void 0}endPass(e,t){if(!this._enabled||!t)return;const r=this._engine.frameId;this._measureDuration.stopPass(e).then(n=>{t._addDuration(r,n!==null&&n>0?n:0)})}dispose(){this._measureDuration?.dispose()}}class $r{constructor(e,t,r,n=2,i){this._count=n,this._querySet=new Bt(e,n,"timestamp",t,r,!0,i)}start(e){e.writeTimestamp?.(this._querySet.querySet,0)}async stop(e){return e.writeTimestamp?.(this._querySet.querySet,1),e.writeTimestamp?await this._querySet.readTwoValuesAndSubtract(0):0}startPass(e,t){if(t+3>this._count)throw new Error("WebGPUDurationMeasure: index out of range ("+t+")");e.timestampWrites={querySet:this._querySet.querySet,beginningOfPassWriteIndex:t+2,endOfPassWriteIndex:t+3}}async stopPass(e){return await this._querySet.readTwoValuesAndSubtract(e+2)}dispose(){this._querySet.dispose()}}class Vr{get querySet(){return this._querySet.querySet}get hasQueries(){return this._currentTotalIndices!==this._availableIndices.length}canBeginQuery(e){if(this._frameQuerySetIsDirty===this._engine.frameId||this._queryFrameId[e]===this._engine.frameId)return!1;const t=this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet!==void 0;return t&&(this._queryFrameId[e]=this._engine.frameId),t}constructor(e,t,r,n=50,i=100){this._availableIndices=[],this._frameQuerySetIsDirty=-1,this._queryFrameId=[],this._engine=e,this._device=t,this._bufferManager=r,this._frameLastBuffer=-1,this._currentTotalIndices=0,this._countIncrement=i,this._allocateNewIndices(n)}createQuery(){this._availableIndices.length===0&&this._allocateNewIndices();const e=this._availableIndices[this._availableIndices.length-1];return this._availableIndices.length--,e}deleteQuery(e){this._availableIndices[this._availableIndices.length]=e}isQueryResultAvailable(e){return this._retrieveQueryBuffer(),!!this._lastBuffer&&e{this._lastBuffer=e}))}_allocateNewIndices(e){e=e??this._countIncrement,this._delayQuerySetDispose();for(let t=0;te.dispose,1e3)}dispose(){this._querySet?.dispose(),this._availableIndices.length=0}}class ce{get code(){return this._sourceCode}constructor(e,t=20){this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}processCode(){this.debug&&S.Log(`Start inlining process (code size=${this._sourceCode.length})...`),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&S.Log("End of inlining process.")}_collectFunctions(){let e=0;for(;e=0&&p.push(m.substring(b+1))}i!=="void"&&p.push("return"),this._functionDescr.push({name:a,type:i,parameters:p,body:h,callIndex:0}),e=l+1;const _=t>0?this._sourceCode.substring(0,t):"",g=l+1=0&&this._replaceFunctionCallsByCode(););return this.debug&&S.Log(`numMaxIterations is ${e} after inlining process`),e>=0}_replaceFunctionCallsByCode(){let e=!1;for(const t of this._functionDescr){const{name:r,type:n,parameters:i,body:a}=t;let o=0;for(;o{const B=[];let y=0,M=0;for(;y0?this._sourceCode.substring(0,u):"";const b=l+1{const l=c[0];return he(e.charAt(l-1))||he(e.charAt(l+a))?t[n]:o})}return e}}ce._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/;class E{async initTwgsl(e){if(!E._Twgsl){if(e=e||{},e={...E._TwgslDefaultOptions,...e},e.twgsl){E._Twgsl=e.twgsl;return}if(e.jsPath&&e.wasmPath&&await H.LoadBabylonScriptAsync(e.jsPath),self.twgsl){E._Twgsl=await self.twgsl(H.GetBabylonScriptURL(e.wasmPath));return}throw new Error("twgsl is not available.")}}convertSpirV2WGSL(e,t=!1){const r=E._Twgsl.convertSpirV2WGSL(e,E.DisableUniformityAnalysis||t);return E.ShowWGSLShaderCode&&(S.Log(r),S.Log("***********************************************")),E.DisableUniformityAnalysis||t?`diagnostic(off, derivative_uniformity); -`+r:r}}E._TwgslDefaultOptions={jsPath:`${H._DefaultCdnUrl}/twgsl/twgsl.js`,wasmPath:`${H._DefaultCdnUrl}/twgsl/twgsl.wasm`};E.ShowWGSLShaderCode=!1;E.DisableUniformityAnalysis=!1;E._Twgsl=null;class kr{constructor(e,t,r){this._record=!1,this._play=!1,this._playBundleListIndex=0,this._allBundleLists=[],this._enabled=!1,this.showDebugLogs=!1,this._engine=e,this._mode=t,this._bundleList=r}get enabled(){return this._enabled}get play(){return this._play}get record(){return this._record}set enabled(e){this._log("enabled",`activate=${e}, mode=${this._mode}`),this._allBundleLists.length=0,this._record=this._enabled=e,this._play=!1,e&&(this._modeSaved=this._mode,this._mode=0)}get mode(){return this._mode}set mode(e){this._record?this._modeSaved=e:this._mode=e}endRenderPass(e){if(!this._record&&!this._play)return!1;let t=null;return this._record?(t=this._bundleList.clone(),this._allBundleLists.push(t),this._bundleList.reset(),this._log("endRenderPass",`bundleList recorded at position #${this._allBundleLists.length-1}`)):this._playBundleListIndex>=this._allBundleLists.length?this._log("endRenderPass",`empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`):(this._log("endRenderPass",`run bundleList #${this._playBundleListIndex}`),t=this._allBundleLists[this._playBundleListIndex++]),t&&(t.run(e),this._mode===1&&this._engine._reportDrawCall(t.numDrawCalls)),!0}endFrame(){this._record&&(this._record=!1,this._play=!0,this._mode=this._modeSaved,this._log("endFrame","bundles recorded, switching to play mode")),this._playBundleListIndex=0}reset(){this._log("reset","called"),this._record&&(this._mode=this._modeSaved),this.enabled=!1,this.enabled=!0}_log(e,t){this.showDebugLogs&&S.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${e} - ${t}`)}}const X=(()=>{const s=new Uint8Array(4),e=new Uint32Array(s.buffer);return!!((e[0]=1)&s[0])})();Object.defineProperty(w.prototype,"effectiveByteStride",{get:function(){return this._alignedBuffer&&this._alignedBuffer.byteStride||this.byteStride},enumerable:!0,configurable:!0});Object.defineProperty(w.prototype,"effectiveByteOffset",{get:function(){return this._alignedBuffer?0:this.byteOffset},enumerable:!0,configurable:!0});Object.defineProperty(w.prototype,"effectiveBuffer",{get:function(){return this._alignedBuffer&&this._alignedBuffer.getBuffer()||this._buffer.getBuffer()},enumerable:!0,configurable:!0});w.prototype._rebuild=function(){this._buffer?._rebuild(),this._alignedBuffer?._rebuild()};w.prototype.dispose=function(){this._ownsBuffer&&this._buffer.dispose(),this._alignedBuffer?.dispose(),this._alignedBuffer=void 0,this._isDisposed=!0};w.prototype.getWrapperBuffer=function(){return this._alignedBuffer||this._buffer};w.prototype._alignBuffer=function(){const s=this._buffer.getData();if(!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes||this.byteStride%4===0&&this.byteOffset%4===0||!s)return;const e=Ot(this.type),t=this.byteStride+3&-4,r=t/e,n=this._maxVerticesCount,a=n*t/e;let o;if(Array.isArray(s)){const h=new Float32Array(s);o=new DataView(h.buffer,h.byteOffset,h.byteLength)}else s instanceof ArrayBuffer?o=new DataView(s,0,s.byteLength):o=new DataView(s.buffer,s.byteOffset,s.byteLength);let u;this.type===w.BYTE?u=new Int8Array(a):this.type===w.UNSIGNED_BYTE?u=new Uint8Array(a):this.type===w.SHORT?u=new Int16Array(a):this.type===w.UNSIGNED_SHORT?u=new Uint16Array(a):this.type===w.INT?u=new Int32Array(a):this.type===w.UNSIGNED_INT?u=new Uint32Array(a):u=new Float32Array(a);const c=this.getSize();let l=this.byteOffset;for(let h=0;h{e?.removePendingData(d),c&&g&&c(g.status+" "+g.statusText,f)},_=async g=>{const f=a(g);if(!f)return;const m=f instanceof Promise?await f:f,b=d.width;if(o){const x=r===4,B=o(m),y=d._hardwareTexture,M=[0,1,2,3,4,5];for(let R=0;R>R,L=[];for(let G=0;G<6;G++){let V=B[R][M[G]];x&&(V=Z(V,v,v,n)),L.push(new Uint8Array(V.buffer,V.byteOffset,V.byteLength))}this._textureHelper.updateCubeTextures(L,y.underlyingResource,v,v,y.format,h,!1,0,0)}}else this.updateRawCubeTexture(d,m,r,n,h);d.isReady=!0,e?.removePendingData(d),u&&u()};return this._loadFile(s,g=>{_(g).catch(f=>{p(void 0,f)})},void 0,e?.offlineProvider,!0,p),d};A.prototype.createRawTexture3D=function(s,e,t,r,n,i,a,o,u=null,c=0,l=0){const d=new q(this,10);return d.baseWidth=e,d.baseHeight=t,d.baseDepth=r,d.width=e,d.height=t,d.depth=r,d.format=n,d.type=c,d.generateMipMaps=i,d.samplingMode=o,d.is3D=!0,d._creationFlags=l,this._doNotHandleContextLost||(d._bufferView=s),this._textureHelper.createGPUTextureForInternalTexture(d,e,t,void 0,l),this.updateRawTexture3D(d,s,n,a,u,c),this._internalTexturesCache.push(d),d};A.prototype.updateRawTexture3D=function(s,e,t,r,n=null,i=0){if(this._doNotHandleContextLost||(s._bufferView=e,s.format=t,s.invertY=r,s._compression=n),e){const a=s._hardwareTexture;t===4&&(e=Z(e,s.width,s.height,i));const u=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(u,s,s.width,s.height,s.depth,a.format,0,0,r,!1,0,0),s.generateMipMaps&&this._generateMipmaps(s,this._uploadEncoder)}s.isReady=!0};A.prototype.createRawTexture2DArray=function(s,e,t,r,n,i,a,o,u=null,c=0,l=0){const d=new q(this,11);return d.baseWidth=e,d.baseHeight=t,d.baseDepth=r,d.width=e,d.height=t,d.depth=r,d.format=n,d.type=c,d.generateMipMaps=i,d.samplingMode=o,d.is2DArray=!0,d._creationFlags=l,this._doNotHandleContextLost||(d._bufferView=s),this._textureHelper.createGPUTextureForInternalTexture(d,e,t,r,l),this.updateRawTexture2DArray(d,s,n,a,u,c),this._internalTexturesCache.push(d),d};A.prototype.updateRawTexture2DArray=function(s,e,t,r,n=null,i=0){if(this._doNotHandleContextLost||(s._bufferView=e,s.format=t,s.invertY=r,s._compression=n),e){const a=s._hardwareTexture;t===4&&(e=Z(e,s.width,s.height,i));const u=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(u,s,s.width,s.height,s.depth,a.format,0,0,r,!1,0,0),s.generateMipMaps&&this._generateMipmaps(s,this._uploadEncoder)}s.isReady=!0};function Z(s,e,t,r){let n,i=1;r===1?n=new Float32Array(e*t*4):r===2?(n=new Uint16Array(e*t*4),i=15360):r===7?n=new Uint32Array(e*t*4):n=new Uint8Array(e*t*4);for(let a=0;a{const m=f,b=m[0].width,x=b;this._setCubeMapTextureParams(g,!r),g.format=a??-1;const B=this._textureHelper.createGPUTextureForInternalTexture(g,b,x);this._textureHelper.updateCubeTextures(m,B.underlyingResource,b,x,B.format,!1,!1,0,0),r||this._generateMipmaps(g,this._uploadEncoder),g.isReady=!0,g.onLoadedObservable.notifyObservers(g),g.onLoadedObservable.clear(),n&&n()},!!p,_)};A.prototype._setCubeMapTextureParams=function(s,e,t){s.samplingMode=e?3:2,s._cachedWrapU=0,s._cachedWrapV=0,t&&(s._maxLodLevel=t)};A.prototype.generateMipMapsForCubemap=function(s){s.generateMipMaps&&(s._hardwareTexture?.underlyingResource||this._textureHelper.createGPUTextureForInternalTexture(s),this._generateMipmaps(s))};class qr extends Ut{constructor(e,t,r,n,i){super(e,t,r,n,i),n.enableGPUTimingMeasurements&&(this.gpuTimeInFrame=new Ct)}}A.prototype._createHardwareRenderTargetWrapper=function(s,e,t){const r=new qr(s,e,t,this);return this._renderTargetWrapperCache.push(r),r};A.prototype.createRenderTargetTexture=function(s,e){const t=this._createHardwareRenderTargetWrapper(!1,!1,s),r={};e!==void 0&&typeof e=="object"?(r.generateMipMaps=e.generateMipMaps,r.generateDepthBuffer=e.generateDepthBuffer===void 0?!0:e.generateDepthBuffer,r.generateStencilBuffer=r.generateDepthBuffer&&e.generateStencilBuffer,r.samplingMode=e.samplingMode===void 0?3:e.samplingMode,r.creationFlags=e.creationFlags??0,r.noColorAttachment=!!e.noColorAttachment,r.colorAttachment=e.colorAttachment,r.samples=e.samples,r.label=e.label,r.format=e.format,r.type=e.type):(r.generateMipMaps=e,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.samplingMode=3,r.creationFlags=0,r.noColorAttachment=!1);const n=r.colorAttachment||(r.noColorAttachment?null:this._createInternalTexture(s,r,!0,5));return t.label=r.label??"RenderTargetWrapper",t._samples=r.colorAttachment?.samples??r.samples??1,t._generateDepthBuffer=r.generateDepthBuffer,t._generateStencilBuffer=!!r.generateStencilBuffer,t.setTextures(n),(t._generateDepthBuffer||t._generateStencilBuffer)&&t.createDepthStencilTexture(0,!1,t._generateStencilBuffer,t.samples,r.generateStencilBuffer?13:14,r.label?r.label+"-DepthStencil":void 0),n&&!r.colorAttachment&&(e!==void 0&&typeof e=="object"&&e.createMipMaps&&!r.generateMipMaps&&(n.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(n,void 0,void 0,void 0,r.creationFlags),e!==void 0&&typeof e=="object"&&e.createMipMaps&&!r.generateMipMaps&&(n.generateMipMaps=!1)),t};A.prototype._createDepthStencilTexture=function(s,e,t){const r={bilinearFiltering:!1,comparisonFunction:0,samples:1,depthTextureFormat:e.generateStencil?13:14,...e},n=$t(r.depthTextureFormat);t._depthStencilTextureWithStencil=n;const i=new q(this,n?12:14);return i.label=e.label,i.format=r.depthTextureFormat,i.type=Nt(i.format),this._setupDepthStencilTexture(i,s,r.bilinearFiltering,r.comparisonFunction,r.samples),this._textureHelper.createGPUTextureForInternalTexture(i),this._internalTexturesCache.push(i),i};A.prototype._setupDepthStencilTexture=function(s,e,t,r,n=1){const i=e.width??e,a=e.height??e,o=e.layers||0,u=e.depth||0;s.baseWidth=i,s.baseHeight=a,s.width=i,s.height=a,s.is2DArray=o>0,s.is3D=u>0,s.depth=o||u,s.isReady=!0,s.samples=n,s.generateMipMaps=!1,s.samplingMode=t?2:1,s.type=1,s._comparisonFunction=r,s._cachedWrapU=0,s._cachedWrapV=0};A.prototype.updateRenderTargetTextureSampleCount=function(s,e){return!s||!s.texture||s.samples===e||(e=Math.min(e,this.getCaps().maxMSAASamples),s.texture._hardwareTexture?.releaseMSAATextures(),s._depthStencilTexture&&(s._depthStencilTexture._hardwareTexture?.releaseMSAATextures(),s._depthStencilTexture.samples=e),s._samples=e,s.texture.samples=e),e};A.prototype.setDepthStencilTexture=function(s,e,t,r){!t||!t.depthStencilTexture?this._setTexture(s,null,void 0,void 0,r):this._setTexture(s,t,!1,!0,r)};A.prototype.createRenderTargetCubeTexture=function(s,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,s),r={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,samples:1,...e};r.generateStencilBuffer=r.generateDepthBuffer&&r.generateStencilBuffer,t.label=r.label??"RenderTargetWrapper",t._generateDepthBuffer=r.generateDepthBuffer,t._generateStencilBuffer=r.generateStencilBuffer;const n=new q(this,5);return n.width=s,n.height=s,n.depth=0,n.isReady=!0,n.isCube=!0,n.samples=r.samples,n.generateMipMaps=r.generateMipMaps,n.samplingMode=r.samplingMode,n.type=r.type,n.format=r.format,this._internalTexturesCache.push(n),t.setTextures(n),(t._generateDepthBuffer||t._generateStencilBuffer)&&t.createDepthStencilTexture(0,r.samplingMode===void 0||r.samplingMode===2||r.samplingMode===2||r.samplingMode===3||r.samplingMode===3||r.samplingMode===5||r.samplingMode===6||r.samplingMode===7||r.samplingMode===11,t._generateStencilBuffer,t.samples),e&&e.createMipMaps&&!r.generateMipMaps&&(n.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(n),e&&e.createMipMaps&&!r.generateMipMaps&&(n.generateMipMaps=!1),t};class Qr{constructor(){this.occlusionInternalRetryCounter=0,this.isOcclusionQueryInProgress=!1,this.isOccluded=!1,this.occlusionRetryCount=-1,this.occlusionType=N.OCCLUSION_TYPE_NONE,this.occlusionQueryAlgorithmType=N.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE,this.forceRenderingWhenOccluded=!1}}Q.prototype.createQuery=function(){return null};Q.prototype.deleteQuery=function(s){return this};Q.prototype.isQueryResultAvailable=function(s){return!1};Q.prototype.getQueryResult=function(s){return 0};Q.prototype.beginOcclusionQuery=function(s,e){return!1};Q.prototype.endOcclusionQuery=function(s){return this};Object.defineProperty(N.prototype,"isOcclusionQueryInProgress",{get:function(){return this._occlusionDataStorage.isOcclusionQueryInProgress},set:function(s){this._occlusionDataStorage.isOcclusionQueryInProgress=s},enumerable:!1,configurable:!0});Object.defineProperty(N.prototype,"_occlusionDataStorage",{get:function(){return this.__occlusionDataStorage||(this.__occlusionDataStorage=new Qr),this.__occlusionDataStorage},enumerable:!1,configurable:!0});Object.defineProperty(N.prototype,"isOccluded",{get:function(){return this._occlusionDataStorage.isOccluded},set:function(s){this._occlusionDataStorage.isOccluded=s},enumerable:!0,configurable:!0});Object.defineProperty(N.prototype,"occlusionQueryAlgorithmType",{get:function(){return this._occlusionDataStorage.occlusionQueryAlgorithmType},set:function(s){this._occlusionDataStorage.occlusionQueryAlgorithmType=s},enumerable:!0,configurable:!0});Object.defineProperty(N.prototype,"occlusionType",{get:function(){return this._occlusionDataStorage.occlusionType},set:function(s){this._occlusionDataStorage.occlusionType=s},enumerable:!0,configurable:!0});Object.defineProperty(N.prototype,"occlusionRetryCount",{get:function(){return this._occlusionDataStorage.occlusionRetryCount},set:function(s){this._occlusionDataStorage.occlusionRetryCount=s},enumerable:!0,configurable:!0});Object.defineProperty(N.prototype,"forceRenderingWhenOccluded",{get:function(){return this._occlusionDataStorage.forceRenderingWhenOccluded},set:function(s){this._occlusionDataStorage.forceRenderingWhenOccluded=s},enumerable:!0,configurable:!0});N.prototype._checkOcclusionQuery=function(){const s=this._occlusionDataStorage;if(s.occlusionType===N.OCCLUSION_TYPE_NONE)return s.isOccluded=!1,!1;const e=this.getEngine();if(!e.getCaps().supportOcclusionQuery||!e.isQueryResultAvailable)return s.isOccluded=!1,!1;if(this.isOcclusionQueryInProgress&&this._occlusionQuery!==null&&this._occlusionQuery!==void 0)if(e.isQueryResultAvailable(this._occlusionQuery)){const n=e.getQueryResult(this._occlusionQuery);s.isOcclusionQueryInProgress=!1,s.occlusionInternalRetryCounter=0,s.isOccluded=!(n>0)}else if(s.occlusionInternalRetryCounter++,s.occlusionRetryCount!==-1&&s.occlusionInternalRetryCounter>s.occlusionRetryCount)s.isOcclusionQueryInProgress=!1,s.occlusionInternalRetryCounter=0,s.isOccluded=s.occlusionType===N.OCCLUSION_TYPE_OPTIMISTIC?!1:s.isOccluded;else return s.occlusionType===N.OCCLUSION_TYPE_OPTIMISTIC?!1:s.isOccluded;const t=this.getScene();if(t.getBoundingBoxRenderer){const r=t.getBoundingBoxRenderer();this._occlusionQuery===null&&(this._occlusionQuery=e.createQuery()),this._occlusionQuery&&e.beginOcclusionQuery(s.occlusionQueryAlgorithmType,this._occlusionQuery)&&(r.renderOcclusionBoundingBox(this),e.endOcclusionQuery(s.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0)}return s.isOccluded};A.prototype.getGPUFrameTimeCounter=function(){return this._timestampQuery.gpuFrameTimeCounter};A.prototype.captureGPUFrameTime=function(s){this._timestampQuery.enable=s&&!!this._caps.timerQuery};A.prototype.createQuery=function(){return this._occlusionQuery.createQuery()};A.prototype.deleteQuery=function(s){return this._occlusionQuery.deleteQuery(s),this};A.prototype.isQueryResultAvailable=function(s){return this._occlusionQuery.isQueryResultAvailable(s)};A.prototype.getQueryResult=function(s){return this._occlusionQuery.getQueryResult(s)};A.prototype.beginOcclusionQuery=function(s,e){if(this.compatibilityMode){if(this._occlusionQuery.canBeginQuery(e))return this._currentRenderPass?.beginOcclusionQuery(e),!0}else return this._bundleList.addItem(new ye(e)),!0;return!1};A.prototype.endOcclusionQuery=function(){return this.compatibilityMode?this._currentRenderPass?.endOcclusionQuery():this._bundleList.addItem(new Se),this};const St={label:"TextureView_SwapChain_ResolveTarget",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},wt={label:"TextureView_SwapChain",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},Hr=new de;class K extends A{get snapshotRenderingMode(){return this._snapshotRendering.mode}set snapshotRenderingMode(e){this._snapshotRendering.mode=e}snapshotRenderingReset(){this._snapshotRendering.reset()}get snapshotRendering(){return this._snapshotRendering.enabled}set snapshotRendering(e){this._snapshotRendering.enabled=e}get disableCacheSamplers(){return this._cacheSampler?this._cacheSampler.disabled:!1}set disableCacheSamplers(e){this._cacheSampler&&(this._cacheSampler.disabled=e)}get disableCacheRenderPipelines(){return this._cacheRenderPipeline?this._cacheRenderPipeline.disabled:!1}set disableCacheRenderPipelines(e){this._cacheRenderPipeline&&(this._cacheRenderPipeline.disabled=e)}get disableCacheBindGroups(){return this._cacheBindGroups?this._cacheBindGroups.disabled:!1}set disableCacheBindGroups(e){this._cacheBindGroups&&(this._cacheBindGroups.disabled=e)}areAllEffectsReady(){return!0}getFontOffset(e){return Vt(e)}static get IsSupportedAsync(){return navigator.gpu?navigator.gpu.requestAdapter().then(e=>!!e,()=>!1).catch(()=>!1):Promise.resolve(!1)}static get IsSupported(){return S.Warn("You must call IsSupportedAsync for WebGPU!"),!1}get supportsUniformBuffers(){return!0}get supportedExtensions(){return this._adapterSupportedExtensions}get enabledExtensions(){return this._deviceEnabledExtensions}get supportedLimits(){return this._adapterSupportedLimits}get currentLimits(){return this._deviceLimits}get description(){return this.name+this.version}get version(){return 1}getInfo(){return{vendor:this._adapterInfo.vendor||"unknown vendor",renderer:this._adapterInfo.architecture||"unknown renderer",version:this._adapterInfo.description||"unknown version"}}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=e}get currentSampleCount(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._mainPassSampleCount}static CreateAsync(e,t={}){const r=new K(e,t);return new Promise(n=>{r.initAsync(t.glslangOptions,t.twgslOptions).then(()=>n(r))})}constructor(e,t={}){if(super(t.antialias??!0,t),this.uniqueId=-1,this._uploadEncoderDescriptor={label:"upload"},this._renderEncoderDescriptor={label:"render"},this._clearDepthValue=1,this._clearReverseDepthValue=0,this._clearStencilValue=0,this._defaultSampleCount=4,this._glslang=null,this._tintWASM=null,this._glslangAndTintAreFullyLoaded=!1,this._adapterInfo={vendor:"",architecture:"",device:"",description:"",subgroupMinSize:0,subgroupMaxSize:0,isFallbackAdapter:!1},this._compiledComputeEffects={},this._counters={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.countersLastFrame={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.numMaxUncapturedErrors=20,this.scenes=[],this._virtualScenes=new Array,this._commandBuffers=[null,null],this._mainRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._rttRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._currentVertexBuffers={},this._currentOverrideVertexBuffers=null,this._currentIndexBuffer=null,this._colorWriteLocal=!0,this._forceEnableEffect=!1,this.isNDCHalfZRange=!0,this.hasOriginBottomLeft=!1,this._workingGlslangAndTintPromise=null,this._viewportsCurrent={x:0,y:0,w:0,h:0},this._scissorsCurrent={x:0,y:0,w:0,h:0},this._scissorCached={x:0,y:0,z:0,w:0},this._stencilRefsCurrent=-1,this._blendColorsCurrent=[null,null,null,null],this._performanceMonitor=new kt,this._name="WebGPU",this._drawCalls=new _e,t.deviceDescriptor=t.deviceDescriptor||{},t.enableGPUDebugMarkers=t.enableGPUDebugMarkers??!1,this._enableGPUDebugMarkers=t.enableGPUDebugMarkers,S.Log(`Babylon.js v${Q.Version} - ${this.description} engine`),!navigator.gpu){S.Error("WebGPU is not supported by your browser.");return}t.swapChainFormat=t.swapChainFormat||navigator.gpu.getPreferredCanvasFormat(),this._isWebGPU=!0,this._shaderPlatformName="WEBGPU",this._renderingCanvas=e,this._options=t,this._mainPassSampleCount=t.antialias?this._defaultSampleCount:1,navigator&&navigator.userAgent&&this._setupMobileChecks(),this._sharedInit(this._renderingCanvas),this._shaderProcessor=new or,this._shaderProcessorWGSL=new hr}prepareGlslangAndTintAsync(){return this._workingGlslangAndTintPromise||(this._workingGlslangAndTintPromise=new Promise(e=>{this._initGlslangAsync(this._glslangOptions??this._options?.glslangOptions).then(t=>{this._glslang=t,this._tintWASM=new E,this._tintWASM.initTwgsl(this._twgslOptions??this._options?.twgslOptions).then(()=>{this._glslangAndTintAreFullyLoaded=!0,e()})})})),this._workingGlslangAndTintPromise}initAsync(e,t){return this.uniqueId=K._InstanceId++,this._glslangOptions=e,this._twgslOptions=t,navigator.gpu.requestAdapter(this._options).then(async r=>{if(r){this._adapter=r,this._adapterSupportedExtensions=[],this._adapter.features?.forEach(a=>{this._adapterSupportedExtensions.push(a)}),this._adapterSupportedLimits=this._adapter.limits,this._adapterInfo=this._adapter.info;const n=this._options.deviceDescriptor??{},i=n?.requiredFeatures??(this._options.enableAllFeatures?this._adapterSupportedExtensions:void 0);if(i){const a=i,o=[];for(const u of a)this._adapterSupportedExtensions.indexOf(u)!==-1&&o.push(u);n.requiredFeatures=o}if(this._options.setMaximumLimits&&!n.requiredLimits){n.requiredLimits={};for(const a in this._adapterSupportedLimits)a==="minSubgroupSize"||a==="maxSubgroupSize"||(n.requiredLimits[a]=this._adapterSupportedLimits[a])}return n.label=`BabylonWebGPUDevice${this.uniqueId}`,await this._adapter.requestDevice(n)}else throw"Could not retrieve a WebGPU adapter (adapter is null)."}).then(r=>{this._device=r,this._deviceEnabledExtensions=[],this._device.features?.forEach(i=>{this._deviceEnabledExtensions.push(i)}),this._deviceLimits=r.limits;let n=-1;this._device.addEventListener("uncapturederror",i=>{++n{this._isDisposed||(this._contextWasLost=!0,S.Warn("WebGPU context lost. "+i),this.onContextLostObservable.notifyObservers(this),this._restoreEngineAfterContextLost(async()=>{const a=this.snapshotRenderingMode,o=this.snapshotRendering,u=this.disableCacheSamplers,c=this.disableCacheRenderPipelines,l=this.disableCacheBindGroups,h=this.enableGPUTimingMeasurements;await this.initAsync(this._glslangOptions??this._options?.glslangOptions,this._twgslOptions??this._options?.twgslOptions),this.snapshotRenderingMode=a,this.snapshotRendering=o,this.disableCacheSamplers=u,this.disableCacheRenderPipelines=c,this.disableCacheBindGroups=l,this.enableGPUTimingMeasurements=h,this._currentRenderPass=null}))})}).then(()=>{this._initializeLimits(),this._bufferManager=new ie(this,this._device),this._textureHelper=new Cr(this,this._device,this._bufferManager,this._deviceEnabledExtensions),this._cacheSampler=new z(this._device),this._cacheBindGroups=new T(this._device,this._cacheSampler,this),this._timestampQuery=new Nr(this,this._device,this._bufferManager),this._occlusionQuery=this._device.createQuerySet?new Vr(this,this._device,this._bufferManager):void 0,this._bundleList=new Ie(this._device),this._snapshotRendering=new kr(this,this._snapshotRenderingMode,this._bundleList),this._ubInvertY=this._bufferManager.createBuffer(new Float32Array([-1,0]),C.Uniform|C.CopyDst,"UBInvertY"),this._ubDontInvertY=this._bufferManager.createBuffer(new Float32Array([1,0]),C.Uniform|C.CopyDst,"UBDontInvertY"),this.dbgVerboseLogsForFirstFrames&&this._count===void 0&&(this._count=0,S.Log(["%c frame #"+this._count+" - begin","background: #ffff00"])),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._emptyVertexBuffer=new w(this,[0],"",{stride:1,offset:0,size:1,label:"EmptyVertexBuffer"}),this._dummyIndexBuffer=this._bufferManager.createBuffer(new Uint16Array([0,0,0,0]),C.Storage|C.CopyDst,"DummyIndices"),this._cacheRenderPipeline=new k(this._device,this._emptyVertexBuffer),this._depthCullingState=new Pr(this._cacheRenderPipeline),this._stencilStateComposer=new Fr(this._cacheRenderPipeline),this._stencilStateComposer.stencilGlobal=this._stencilState,this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=515,this._depthCullingState.depthMask=!0,this._textureHelper.setCommandEncoder(this._uploadEncoder),this._clearQuad=new Ur(this._device,this,this._emptyVertexBuffer),this._defaultDrawContext=this.createDrawContext(),this._currentDrawContext=this._defaultDrawContext,this._defaultMaterialContext=this.createMaterialContext(),this._currentMaterialContext=this._defaultMaterialContext,this._initializeContextAndSwapChain(),this._initializeMainAttachments(),this.resize()}).catch(r=>{throw S.Error("A fatal error occurred during WebGPU creation/initialization."),r})}_initGlslangAsync(e){if(e=e||{},e={...K._GlslangDefaultOptions,...e},e.glslang)return e.glslang;if(self.glslang)return self.glslang(e.wasmPath);if(e.jsPath&&e.wasmPath)return H.LoadBabylonScriptAsync(e.jsPath).then(()=>self.glslang(H.GetBabylonScriptURL(e.wasmPath)));throw new Error("glslang is not available")}_initializeLimits(){const e=this._deviceEnabledExtensions.indexOf("texture-formats-tier1")>=0;this._caps={maxTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxVertexTextureImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxCombinedTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage*2,maxTextureSize:this._deviceLimits.maxTextureDimension2D,maxCubemapTextureSize:this._deviceLimits.maxTextureDimension2D,maxRenderTextureSize:this._deviceLimits.maxTextureDimension2D,maxVertexAttribs:this._deviceLimits.maxVertexAttributes,maxDrawBuffers:8,maxVaryingVectors:this._deviceLimits.maxInterStageShaderVariables,maxFragmentUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),maxVertexUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),shaderFloatPrecision:23,standardDerivatives:!0,astc:this._deviceEnabledExtensions.indexOf("texture-compression-astc")>=0?!0:void 0,s3tc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,pvrtc:null,etc1:null,etc2:this._deviceEnabledExtensions.indexOf("texture-compression-etc2")>=0?!0:void 0,bptc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!0,highPrecisionShaderSupported:!0,colorBufferFloat:!0,blendFloat:this._deviceEnabledExtensions.indexOf("float32-blendable")>=0,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:this._deviceEnabledExtensions.indexOf("rg11b10ufloat-renderable")>=0,textureFloat:!0,textureFloatLinearFiltering:this._deviceEnabledExtensions.indexOf("float32-filterable")>=0,textureFloatRender:!0,textureHalfFloat:!0,textureHalfFloatLinearFiltering:!0,textureHalfFloatRender:!0,textureLOD:!0,texelFetch:!0,drawBuffersExtension:!0,depthTextureExtension:!0,vertexArrayObject:!1,instancedArrays:!0,timerQuery:typeof BigUint64Array<"u"&&this._deviceEnabledExtensions.indexOf("timestamp-query")!==-1?!0:void 0,supportOcclusionQuery:typeof BigUint64Array<"u",canUseTimestampForTimerQuery:!0,multiview:!1,oculusMultiview:!1,parallelShaderCompile:void 0,blendMinMax:!0,maxMSAASamples:4,canUseGLInstanceID:!0,canUseGLVertexID:!0,supportComputeShaders:!0,supportSRGBBuffers:!0,supportTransformFeedbacks:!1,textureMaxLevel:!0,texture2DArrayMaxLayerCount:this._deviceLimits.maxTextureArrayLayers,disableMorphTargetTexture:!1,textureNorm16:e,blendParametersPerTarget:!0,dualSourceBlending:!0},this._features={forceBitmapOverHTMLImageElement:!0,supportRenderAndCopyToLodForFloatTextures:!0,supportDepthStencilTexture:!0,supportShadowSamplers:!0,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!0,trackUbosInFrame:!0,checkUbosContentBeforeUpload:!0,supportCSM:!0,basisNeedsPOT:!1,support3DTextures:!0,needTypeSuffixInShaderConstants:!0,supportMSAA:!0,supportSSAO2:!0,supportIBLShadows:!0,supportExtendedTextureFormats:!0,supportSwitchCaseInShader:!0,supportSyncTextureRead:!1,needsInvertingBitmap:!1,useUBOBindingCache:!1,needShaderCodeInlining:!0,needToAlwaysBindUniformBuffers:!0,supportRenderPasses:!0,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!0,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!0,_collectUbosUpdatedInFrame:!1},this._alphaState=new Wt(this._caps.blendParametersPerTarget)}_initializeContextAndSwapChain(){if(!this._renderingCanvas)throw"The rendering canvas has not been set!";this._context=this._renderingCanvas.getContext("webgpu"),this._configureContext(),this._colorFormat=this._options.swapChainFormat,this._mainRenderPassWrapper.colorAttachmentGPUTextures=[new se(this)],this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format=this._colorFormat,this._setColorFormat(this._mainRenderPassWrapper)}_initializeMainAttachments(){if(!this._bufferManager)return;this.flushFramebuffer(),this._mainTextureExtends={width:this.getRenderWidth(!0),height:this.getRenderHeight(!0),depthOrArrayLayers:1};const e=new Float32Array([this.getRenderHeight(!0)]);this._bufferManager.setSubData(this._ubInvertY,4,e),this._bufferManager.setSubData(this._ubDontInvertY,4,e);let t;if(this._options.antialias){const i={label:`Texture_MainColor_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}_antialiasing`,size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._options.swapChainFormat,usage:16};this._mainTexture&&this._textureHelper.releaseTexture(this._mainTexture),this._mainTexture=this._device.createTexture(i),t=[{view:this._mainTexture.createView({label:"TextureView_MainColor_antialiasing",dimension:"2d",format:this._options.swapChainFormat,mipLevelCount:1,arrayLayerCount:1}),clearValue:new de(0,0,0,1),loadOp:"clear",storeOp:"store"}]}else t=[{view:void 0,clearValue:new de(0,0,0,1),loadOp:"clear",storeOp:"store"}];this._mainRenderPassWrapper.depthTextureFormat=this.isStencilEnable?"depth24plus-stencil8":"depth32float",this._setDepthTextureFormat(this._mainRenderPassWrapper),this._setColorFormat(this._mainRenderPassWrapper);const r={label:`Texture_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._mainRenderPassWrapper.depthTextureFormat,usage:16};this._depthTexture&&this._textureHelper.releaseTexture(this._depthTexture),this._depthTexture=this._device.createTexture(r);const n={view:this._depthTexture.createView({label:`TextureView_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,dimension:"2d",format:this._depthTexture.format,mipLevelCount:1,arrayLayerCount:1}),depthClearValue:this._clearDepthValue,depthLoadOp:"clear",depthStoreOp:"store",stencilClearValue:this._clearStencilValue,stencilLoadOp:this.isStencilEnable?"clear":void 0,stencilStoreOp:this.isStencilEnable?"store":void 0};this._mainRenderPassWrapper.renderPassDescriptor={label:"MainRenderPass",colorAttachments:t,depthStencilAttachment:n},this.beginFrame(),this._startMainRenderPass(!0,null,!0,!1),this._endCurrentRenderPass(),this.endFrame(),this._frameId--}_sharedInit(e){super._sharedInit(e),qt(this,e,this._creationOptions)}_configureContext(){this._context.configure({device:this._device,format:this._options.swapChainFormat,usage:17,alphaMode:this.premultipliedAlpha?"premultiplied":"opaque"})}resizeImageBitmap(e,t,r){return Qt(this,e,t,r)}async _createImageBitmapFromSource(e,t){return await Ht(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&Yt(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&zt()}enterPointerlock(){this._renderingCanvas&&jt(this._renderingCanvas)}exitPointerlock(){Kt()}_rebuildBuffers(){super._rebuildBuffers();for(const e of this._storageBuffers)e.getBuffer().engineId!==this.uniqueId&&e._rebuild()}_restoreEngineAfterContextLost(e){k.ResetCache(),T.ResetCache();const t=n=>{for(const i of n){for(const a of i.meshes){const o=a.subMeshes;if(o)for(const u of o)u._drawWrappers=[]}for(const a of i.materials)a._materialContext?.reset()}};t(this.scenes),t(this._virtualScenes);const r=[];for(const n of this._uniformBuffers)n.name.indexOf("leftOver")<0&&r.push(n);this._uniformBuffers=r,super._restoreEngineAfterContextLost(e)}setSize(e,t,r=!1){return super.setSize(e,t,r)?(this.dbgVerboseLogsForFirstFrames&&(this._count===void 0&&(this._count=0),(!this._count||this._count=0,i=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,a=r===0?this._compileRawShaderToSpirV(e,"vertex"):e,o=r===0?this._compileRawShaderToSpirV(t,"fragment"):t;return this._createPipelineStageDescriptor(a,o,r,n,i)}_compilePipelineStageDescriptor(e,t,r,n){this.onBeforeShaderCompilationObservable.notifyObservers(this);const i=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,a=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,o=`#version 450 -`,u=n===0?this._compileShaderToSpirV(e,"vertex",r,o):this._getWGSLShader(e,"vertex",r),c=n===0?this._compileShaderToSpirV(t,"fragment",r,o):this._getWGSLShader(t,"fragment",r),l=this._createPipelineStageDescriptor(u,c,n,i,a);return this.onAfterShaderCompilationObservable.notifyObservers(this),l}createRawShaderProgram(){throw"Not available on WebGPU"}createShaderProgram(){throw"Not available on WebGPU"}inlineShaderCode(e){const t=new ce(e);return t.debug=!1,t.processCode(),t.code}createPipelineContext(e){return new rr(e,this)}createMaterialContext(){return new oe}createDrawContext(){return new ue(this._bufferManager,this._dummyIndexBuffer)}async _preparePipelineContextAsync(e,t,r,n,i,a,o,u,c,l,h){const d=e,p=d.shaderProcessingContext.shaderLanguage;p===0&&!this._glslangAndTintAreFullyLoaded&&await this.prepareGlslangAndTintAsync(),this.dbgShowShaderCode&&(S.Log(["defines",u]),S.Log(t),S.Log(r),S.Log("***********************************************")),d.sources={fragment:r,vertex:t,rawVertex:i,rawFragment:a},n?d.stages=this._compileRawPipelineStageDescriptor(t,r,p):d.stages=this._compilePipelineStageDescriptor(t,r,u,p),h()}getAttributes(e,t){const r=new Array(t.length),n=e;for(let i=0;i0,a.is3D=c>0,a.isCube=i.isCube,a._cachedWrapU=0,a._cachedWrapV=0,a._useSRGBBuffer=i.useSRGBBuffer,a.label=i.label,this._internalTexturesCache.push(a),!r){const h=!i.generateMipMaps&&i.createMipMaps;h&&(a.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(a,o,u,a.depth||1,i.creationFlags),h&&(a.generateMipMaps=!1)}return a}createTexture(e,t,r,n,i=3,a=null,o=null,u=null,c=null,l=null,h=null,d,p,_,g){return this._createTextureBase(e,t,r,n,i,a,o,(f,m,b,x,B,y,M,R)=>{const v=x;if(f.baseWidth=v.width,f.baseHeight=v.height,f.width=v.width,f.height=v.height,f.format=f.format!==-1?f.format:l??5,f.type=f.type!==-1?f.type:0,f._creationFlags=_??0,R(f.width,f.height,v,m,f,()=>{}),f._hardwareTexture?.underlyingResource)!y&&!M&&this._generateMipmaps(f,this._uploadEncoder);else{const L=this._textureHelper.createGPUTextureForInternalTexture(f,v.width,v.height,void 0,_);I.IsImageBitmap(v)&&(this._textureHelper.updateTexture(v,f,v.width,v.height,f.depth,L.format,0,0,B,!1,0,0),!y&&!M&&this._generateMipmaps(f,this._uploadEncoder))}b&&b.removePendingData(f),f.isReady=!0,f.onLoadedObservable.notifyObservers(f),f.onLoadedObservable.clear()},()=>!1,u,c,l,h,d,p,g)}wrapWebGPUTexture(e){const t=new se(this,e),r=new q(this,0,!0);return r._hardwareTexture=t,r.isReady=!0,r}wrapWebGLTexture(){throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.")}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers}_unpackFlipY(e){}updateTextureSamplingMode(e,t,r=!1){r&&(t.generateMipMaps=!0,this._generateMipmaps(t)),t.samplingMode=e}updateTextureWrappingMode(e,t,r=null,n=null){t!==null&&(e._cachedWrapU=t),r!==null&&(e._cachedWrapV=r),(e.is2DArray||e.is3D)&&n!==null&&(e._cachedWrapR=n)}updateTextureDimensions(e,t,r,n=1){if(!e._hardwareTexture||e.width===t&&e.height===r&&e.depth===n)return;const i=e._hardwareTexture.textureAdditionalUsages;e._hardwareTexture.release(),this._textureHelper.createGPUTextureForInternalTexture(e,t,r,n,i)}_setInternalTexture(e,t,r){if(r=r??e,this._currentEffect){const i=this._currentEffect._pipelineContext.shaderProcessingContext.availableTextures[r];if(this._currentMaterialContext.setTexture(e,t),i&&i.autoBindSampler){const a=r+"Sampler";this._currentMaterialContext.setSampler(a,t)}}}createPrefilteredCubeTexture(e,t,r,n,i=null,a=null,o,u=null,c=!0){const l=h=>{if(!h){i&&i(null);return}const d=h.texture;c?h.info.sphericalPolynomial&&(d._sphericalPolynomial=h.info.sphericalPolynomial):d._sphericalPolynomial=d._sphericalPolynomial??new tr,d._source=9,i&&i(d)};return this.createCubeTexture(e,t,null,!1,l,a,o,u,c,r,n)}setTexture(e,t,r,n){this._setTexture(e,r,!1,!1,n,n)}setTextureArray(e,t,r,n){for(let i=0;i1,c=a._depthStencilTexture,l=c?._hardwareTexture,h=l?.underlyingResource;let d,p;if(u){const y=l?.getMSAATexture(o);d=y?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor),p=y?.format}!d&&h&&(d=h.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor)),!p&&l&&(p=l.format);const _=p?I.HasStencilAspect(p):!1,g=p?I.HasDepthAspect(p):!1,f=[];this.useReverseDepthBuffer&&this.setDepthFunctionToGreaterOrEqual();const m=Hr;r&&(m.r=r.r*255,m.g=r.g*255,m.b=r.b*255,m.a=r.a*255);const b=t&&r,x=t&&n,B=t&&i;if(a._attachments&&a.isMulti){(!this._mrtAttachments||this._mrtAttachments.length===0)&&(this._mrtAttachments=a._defaultAttachments);for(let y=0;y{const o=()=>{e.mapAsync(1,0,t).then(()=>{const u=e.getMappedRange(0,t);let c=r;if(c===void 0)c=new Uint8Array(t),c.set(new Uint8Array(u));else{const l=c.constructor;c=new l(c.buffer),c.set(new l(u))}e.unmap(),this._bufferManager.releaseBuffer(e),i(c)},u=>{this.isDisposed?i(new Uint8Array):a(u)})};n?(this.flushFramebuffer(),o()):this.onEndFrameObservable.addOnce(()=>{o()})})}readFromStorageBuffer(e,t,r,n,i){r=r||e.capacity;const a=this._bufferManager.createRawBuffer(r,C.MapRead|C.CopyDst,void 0,"TempReadFromStorageBuffer");return this._renderEncoder.copyBufferToBuffer(e.underlyingResource,t??0,a,0,r),this._readFromGPUBuffer(a,r,n,i)}readFromMultipleStorageBuffers(e,t,r,n,i){r=r||e[0].capacity;const a=this._bufferManager.createRawBuffer(r*e.length,C.MapRead|C.CopyDst,void 0,"TempReadFromMultipleStorageBuffers");for(let o=0;o{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:i}=this._resizeTo;t=n,r=i}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Ee.extension=p.Application;class Ve{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ht.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?de.shared:new de,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ve.extension=p.Application;var Rt=`in vec2 aPosition; -out vec2 vTextureCoord; - -uniform vec4 uInputSize; -uniform vec4 uOutputFrame; -uniform vec4 uOutputTexture; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - - position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - - return vec4(position, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aPosition * (uOutputFrame.zw * uInputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); -} -`,Ut=`in vec2 vTextureCoord; -out vec4 finalColor; -uniform sampler2D uTexture; -void main() { - finalColor = texture(uTexture, vTextureCoord); -} -`,me=`struct GlobalFilterUniforms { - uInputSize: vec4, - uInputPixel: vec4, - uInputClamp: vec4, - uOutputFrame: vec4, - uGlobalFrame: vec4, - uOutputTexture: vec4, -}; - -@group(0) @binding(0) var gfu: GlobalFilterUniforms; -@group(0) @binding(1) var uTexture: texture_2d; -@group(0) @binding(2) var uSampler: sampler; - -struct VSOutput { - @builtin(position) position: vec4, - @location(0) uv: vec2 -}; - -fn filterVertexPosition(aPosition: vec2) -> vec4 -{ - var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - - position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - - return vec4(position, 0.0, 1.0); -} - -fn filterTextureCoord(aPosition: vec2) -> vec2 -{ - return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); -} - -@vertex -fn mainVertex( - @location(0) aPosition: vec2, -) -> VSOutput { - return VSOutput( - filterVertexPosition(aPosition), - filterTextureCoord(aPosition) - ); -} - -@fragment -fn mainFragment( - @location(0) uv: vec2, -) -> @location(0) vec4 { - return textureSample(uTexture, uSampler, uv); -} -`;class Bt extends ft{constructor(){const e=Re.from({vertex:{source:me,entryPoint:"mainVertex"},fragment:{source:me,entryPoint:"mainFragment"},name:"passthrough-filter"}),t=Ue.from({vertex:Rt,fragment:Ut,name:"passthrough-filter"});super({gpuProgram:e,glProgram:t})}}class We{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}We.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"filter"};const ge=new P;function Mt(o,e){e.clear();const t=e.matrix;for(let r=0;r"},uInputPixel:{value:new Float32Array(4),type:"vec4"},uInputClamp:{value:new Float32Array(4),type:"vec4"},uOutputFrame:{value:new Float32Array(4),type:"vec4"},uGlobalFrame:{value:new Float32Array(4),type:"vec4"},uOutputTexture:{value:new Float32Array(4),type:"vec4"}}),this._globalFilterBindGroup=new Be({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters,n=this._pushFilterData();n.skip=!1,n.filters=r,n.container=e.container,n.outputRenderSurface=t.renderTarget.renderSurface;const i=t.renderTarget.renderTarget.colorTexture.source,s=i.resolution,a=i.antialias;if(r.every(f=>!f.enabled)){n.skip=!0;return}const l=n.bounds;if(this._calculateFilterArea(e,l),this._calculateFilterBounds(n,t.renderTarget.rootViewPort,a,s,1),n.skip)return;const u=this._getPreviousFilterData(),h=this._findFilterResolution(s);let c=0,d=0;u&&(c=u.bounds.minX,d=u.bounds.minY),this._calculateGlobalFrame(n,c,d,h,i.width,i.height),this._setupFilterTextures(n,l,t,u)}generateFilteredTexture({texture:e,filters:t}){const r=this._pushFilterData();this._activeFilterData=r,r.skip=!1,r.filters=t;const n=e.source,i=n.resolution,s=n.antialias;if(t.every(f=>!f.enabled))return r.skip=!0,e;const a=r.bounds;if(a.addRect(e.frame),this._calculateFilterBounds(r,a.rectangle,s,i,0),r.skip)return e;const l=i;this._calculateGlobalFrame(r,0,0,l,n.width,n.height),r.outputRenderSurface=w.getOptimalTexture(a.width,a.height,r.resolution,r.antialias),r.backTexture=R.EMPTY,r.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(r,!0);const d=r.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){const e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,!1),t.blendRequired&&w.returnTexture(t.backTexture),w.returnTexture(t.inputTexture))}getBackTexture(e,t,r){const n=e.colorTexture.source._resolution,i=w.getOptimalTexture(t.width,t.height,n,!1);let s=t.minX,a=t.minY;r&&(s-=r.minX,a-=r.minY),s=Math.floor(s*n),a=Math.floor(a*n);const l=Math.ceil(t.width*n),u=Math.ceil(t.height*n);return this.renderer.renderTarget.copyToTexture(e,i,{x:s,y:a},{width:l,height:u},{x:0,y:0}),i}applyFilter(e,t,r,n){const i=this.renderer,s=this._activeFilterData,l=s.outputRenderSurface===r,u=i.renderTarget.rootRenderTarget.colorTexture.source._resolution,h=this._findFilterResolution(u);let c=0,d=0;if(l){const m=this._findPreviousFilterOffset();c=m.x,d=m.y}this._updateFilterUniforms(t,r,s,c,d,h,l,n);const f=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(f,t,i)}calculateSpriteMatrix(e,t){const r=this._activeFilterData,n=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),i=t.worldTransform.copyTo(P.shared),s=t.renderGroup||t.parentRenderGroup;return s&&s.cacheToLocalTransform&&i.prepend(s.cacheToLocalTransform),i.invert(),n.prepend(i),n.scale(1/t.texture.orig.width,1/t.texture.orig.height),n.translate(t.anchor.x,t.anchor.y),n}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new Bt),this._passthroughFilter}_setupBindGroupsAndRender(e,t,r){if(r.renderPipes.uniformBatch){const n=r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(n,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,r.encoder.draw({geometry:Gt,shader:e,state:e._state,topology:"triangle-list"}),r.type===ne.WEBGL&&r.renderTarget.finishRenderPass()}_setupFilterTextures(e,t,r,n){if(e.backTexture=R.EMPTY,e.inputTexture=w.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){r.renderTarget.finishRenderPass();const i=r.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(i,t,n?.bounds)}r.renderTarget.bind(e.inputTexture,!0),r.globalUniforms.push({offset:t})}_calculateGlobalFrame(e,t,r,n,i,s){const a=e.globalFrame;a.x=t*n,a.y=r*n,a.width=i*n,a.height=s*n}_updateFilterUniforms(e,t,r,n,i,s,a,l){const u=this._filterGlobalUniforms.uniforms,h=u.uOutputFrame,c=u.uInputSize,d=u.uInputPixel,f=u.uInputClamp,m=u.uGlobalFrame,x=u.uOutputTexture;a?(h[0]=r.bounds.minX-n,h[1]=r.bounds.minY-i):(h[0]=0,h[1]=0),h[2]=e.frame.width,h[3]=e.frame.height,c[0]=e.source.width,c[1]=e.source.height,c[2]=1/c[0],c[3]=1/c[1],d[0]=e.source.pixelWidth,d[1]=e.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],f[0]=.5*d[2],f[1]=.5*d[3],f[2]=e.frame.width*c[2]-.5*d[2],f[3]=e.frame.height*c[3]-.5*d[3];const g=this.renderer.renderTarget.rootRenderTarget.colorTexture;m[0]=n*s,m[1]=i*s,m[2]=g.source.width*s,m[3]=g.source.height*s,t instanceof R&&(t.source.resource=null);const _=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!l),t instanceof R?(x[0]=t.frame.width,x[1]=t.frame.height):(x[0]=_.width,x[1]=_.height),x[2]=_.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,r=this._filterStackIndex;for(;r>0;){r--;const n=this._filterStack[r];if(!n.skip){e=n.bounds.minX,t=n.bounds.minY;break}}return{x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?Mt(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){const n=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;n&&t.applyMatrix(n)}}_applyFiltersToTexture(e,t){const r=e.inputTexture,n=e.bounds,i=e.filters,s=e.firstEnabledIndex,a=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),s===a)i[s].apply(this,r,e.outputRenderSurface,t);else{let l=e.inputTexture;const u=w.getOptimalTexture(n.width,n.height,l.source._resolution,!1);let h=u;for(let c=s;c0&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new Dt),this._filterStackIndex++,e}}Le.extension={type:[p.WebGLSystem,p.WebGPUSystem],name:"filter"};const Ye=class He extends re{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(I(Ge,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...He.defaultOptions,...t};const r=t.positions||new Float32Array([0,0,1,0,1,1,0,1]);let n=t.uvs;n||(t.positions?n=new Float32Array(r.length):n=new Float32Array([0,0,1,0,1,1,0,1]));const i=t.indices||new Uint32Array([0,1,2,0,2,3]),s=t.shrinkBuffersToFit,a=new A({data:r,label:"attribute-mesh-positions",shrinkToFit:s,usage:C.VERTEX|C.COPY_DST}),l=new A({data:n,label:"attribute-mesh-uvs",shrinkToFit:s,usage:C.VERTEX|C.COPY_DST}),u=new A({data:i,label:"index-mesh-buffer",shrinkToFit:s,usage:C.INDEX|C.COPY_DST});super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:8,offset:0},aUV:{buffer:l,format:"float32x2",stride:8,offset:0}},indexBuffer:u,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};Ye.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let ae=Ye,U=null,S=null;function At(o,e){U||(U=L.get().createCanvas(256,128),S=U.getContext("2d",{willReadFrequently:!0}),S.globalCompositeOperation="copy",S.globalAlpha=1),(U.width${e.cssStyle};
                ${o}
                `,n.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(i.textContent=t),document.body.appendChild(s);const a=n.getBoundingClientRect();s.remove();const l=e.padding*2;return{width:a.width-l,height:a.height-l}}class It{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{W.return(e)}),this.batches.length=0}}class Ke{constructor(e,t){this.state=V.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this),this._managedGraphics=new B({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const t=e.context,r=!!e._gpuData,n=this.renderer.graphicsContext.updateGpuContext(t);return!!(n.isBatchable||r!==n.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const r=this._getGpuDataForRenderable(e).batches;for(let n=0;n{const a=W.get(mt);return s.copyTo(a),a.renderable=e,a.roundPixels=i,a})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}Ke.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"graphics"};const $e=class je extends ae{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(I(Ge,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...je.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,r=[],n=[],i=[],s=this.verticesX-1,a=this.verticesY-1,l=this.width/s,u=this.height/a;for(let c=0;c"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Be({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,n=e.batched;if(t.batched=n,r!==n)return!0;if(n){const i=e._geometry;if(i.indices.length!==t.indexSize||i.positions.length!==t.vertexSize)return t.indexSize=i.indices.length,t.vertexSize=i.positions.length,!0;const s=this._getBatchableMesh(e);return s.texture.uid!==e._texture.uid&&(s._textureMatrixUpdateId=-1),!s._batcher.checkAndUpdateTexture(s,e._texture)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,n=this._getMeshData(e);if(e.didViewUpdate&&(n.indexSize=e._geometry.indices?.length,n.vertexSize=e._geometry.positions?.length),n.batched){const i=this._getBatchableMesh(e);i.setTexture(e._texture),i.geometry=e._geometry,r.addToBatch(i,t)}else r.break(t),t.add(e)}updateRenderable(e){if(e.batched){const t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t)}}execute(e){if(!e.isRenderable)return;e.state.blendMode=ie(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Y(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){var t,r;return(t=e._gpuData)[r=this.renderer.uid]||(t[r]=new we),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,r;return(t=e._gpuData)[r=this.renderer.uid]||(t[r]=new we),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=new oe;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}Ne.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"mesh"};class Vt{execute(e,t){const r=e.state,n=e.renderer,i=t.shader||e.defaultShader;i.resources.uTexture=t.texture._source,i.resources.uniforms=e.localUniforms;const s=n.gl,a=e.getBuffers(t);n.shader.bind(i),n.state.set(r),n.geometry.bind(a.geometry,i.glProgram);const u=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;s.drawElements(s.TRIANGLES,t.particleChildren.length*6,u,0)}}class Wt{execute(e,t){const r=e.renderer,n=t.shader||e.defaultShader;n.groups[0]=r.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,!0),n.groups[1]=r.texture.getTextureBindGroup(t.texture);const i=e.state,s=e.getBuffers(t);r.encoder.draw({geometry:s.geometry,shader:t.shader||e.defaultShader,state:i,size:t.particleChildren.length*6})}}function Ce(o,e=null){const t=o*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let r=0,n=0;rthis._size&&(t=!0,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new k(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new k(this._size*this._dynamicStride*4*4),this.indexBuffer=Ce(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const r=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,r.float32View,r.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,!0),t){const n=this.staticAttributeBuffer;this._staticUpload(e,n.float32View,n.uint32View),this._staticBuffer.setDataWithSize(n.float32View,e.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}function Ht(o){const e=[];for(const t in o){const r=o[t];e.push(t,r.code,r.dynamic?"d":"s")}return e.join("_")}var Xt=`varying vec2 vUV; -varying vec4 vColor; - -uniform sampler2D uTexture; - -void main(void){ - vec4 color = texture2D(uTexture, vUV) * vColor; - gl_FragColor = color; -}`,Kt=`attribute vec2 aVertex; -attribute vec2 aUV; -attribute vec4 aColor; - -attribute vec2 aPosition; -attribute float aRotation; - -uniform mat3 uTranslationMatrix; -uniform float uRound; -uniform vec2 uResolution; -uniform vec4 uColor; - -varying vec2 vUV; -varying vec4 vColor; - -vec2 roundPixels(vec2 position, vec2 targetSize) -{ - return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; -} - -void main(void){ - float cosRotation = cos(aRotation); - float sinRotation = sin(aRotation); - float x = aVertex.x * cosRotation - aVertex.y * sinRotation; - float y = aVertex.x * sinRotation + aVertex.y * cosRotation; - - vec2 v = vec2(x, y); - v = v + aPosition; - - gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0); - - if(uRound == 1.0) - { - gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - } - - vUV = aUV; - vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor; -} -`,Se=` -struct ParticleUniforms { - uTranslationMatrix:mat3x3, - uColor:vec4, - uRound:f32, - uResolution:vec2, -}; - -fn roundPixels(position: vec2, targetSize: vec2) -> vec2 -{ - return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; -} - -@group(0) @binding(0) var uniforms: ParticleUniforms; - -@group(1) @binding(0) var uTexture: texture_2d; -@group(1) @binding(1) var uSampler : sampler; - -struct VSOutput { - @builtin(position) position: vec4, - @location(0) uv : vec2, - @location(1) color : vec4, - }; -@vertex -fn mainVertex( - @location(0) aVertex: vec2, - @location(1) aPosition: vec2, - @location(2) aUV: vec2, - @location(3) aColor: vec4, - @location(4) aRotation: f32, -) -> VSOutput { - - let v = vec2( - aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation), - aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation) - ) + aPosition; - - var position = vec4((uniforms.uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0); - - if(uniforms.uRound == 1.0) { - position = vec4(roundPixels(position.xy, uniforms.uResolution), position.zw); - } - - let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor; - - return VSOutput( - position, - aUV, - vColor, - ); -} - -@fragment -fn mainFragment( - @location(0) uv: vec2, - @location(1) color: vec4, - @builtin(position) position: vec4, -) -> @location(0) vec4 { - - var sample = textureSample(uTexture, uSampler, uv) * color; - - return sample; -}`;class $t extends se{constructor(){const e=Ue.from({vertex:Kt,fragment:Xt}),t=Re.from({fragment:{source:Se,entryPoint:"mainFragment"},vertex:{source:Se,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:R.WHITE.source,uSampler:new Z({}),uniforms:{uTranslationMatrix:{value:new P,type:"mat3x3"},uColor:{value:new De(16777215),type:"vec4"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2"}}}})}}class qe{constructor(e,t){this.state=V.for2d(),this.localUniforms=new G({uTranslationMatrix:{value:new P,type:"mat3x3"},uColor:{value:new Float32Array(4),type:"vec4"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new $t,this.state=V.for2d(),this._managedContainers=new B({renderer:e,type:"renderable",name:"particleContainer"})}validateRenderable(e){return!1}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e)}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Yt({size:e.particleChildren.length,properties:e._properties}),this._managedContainers.add(e),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){const t=e.particleChildren;if(t.length===0)return;const r=this.renderer,n=this.getBuffers(e);e.texture||(e.texture=t[0].texture);const i=this.state;n.update(t,e._childrenDirty),e._childrenDirty=!1,i.blendMode=ie(e.blendMode,e.texture._source);const s=this.localUniforms.uniforms,a=s.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(r.globalUniforms.globalUniformData.projectionMatrix),s.uResolution=r.globalUniforms.globalUniformData.resolution,s.uRound=r._roundPixels|e._roundPixels,Y(e.groupColorAlpha,s.uColor,0),this.adaptor.execute(this,e)}destroy(){this._managedContainers.destroy(),this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class Qe extends qe{constructor(e){super(e,new Vt)}}Qe.extension={type:[p.WebGLPipes],name:"particle"};class Je extends qe{constructor(e){super(e,new Wt)}}Je.extension={type:[p.WebGPUPipes],name:"particle"};const Ze=class et extends Et{constructor(e={}){e={...et.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=e.anchor?.x,this._anchorY=e.anchor?.y,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,{width:t,height:r,_leftWidth:n,_rightWidth:i,_topHeight:s,_bottomHeight:a,_anchorX:l,_anchorY:u}=this,h=n+i,c=t>h?1:t/h,d=s+a,f=r>d?1:r/d,m=Math.min(c,f),x=l*t,g=u*r;e[0]=e[8]=e[16]=e[24]=-x,e[2]=e[10]=e[18]=e[26]=n*m-x,e[4]=e[12]=e[20]=e[28]=t-i*m-x,e[6]=e[14]=e[22]=e[30]=t-x,e[1]=e[3]=e[5]=e[7]=-g,e[9]=e[11]=e[13]=e[15]=s*m-g,e[17]=e[19]=e[21]=e[23]=r-a*m-g,e[25]=e[27]=e[29]=e[31]=r-g,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};Ze.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let jt=Ze;class Nt extends oe{constructor(){super(),this.geometry=new jt}destroy(){this.geometry.destroy()}}class tt{constructor(e){this._renderer=e,this._managedSprites=new B({renderer:e,type:"renderable",name:"nineSliceSprite"})}addRenderable(e,t){const r=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture)}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=e._gpuData[this._renderer.uid]=new Nt,r=t;return r.renderable=e,r.transform=e.groupTransform,r.texture=e._texture,r.roundPixels=this._renderer._roundPixels|e._roundPixels,this._managedSprites.add(e),e.didViewUpdate||this._updateBatchableSprite(e,r),t}destroy(){this._managedSprites.destroy(),this._renderer=null}}tt.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"nineSliceSprite"};const qt={name:"tiling-bit",vertex:{header:` - struct TilingUniforms { - uMapCoord:mat3x3, - uClampFrame:vec4, - uClampOffset:vec2, - uTextureTransform:mat3x3, - uSizeAnchor:vec4 - }; - - @group(2) @binding(0) var tilingUniforms: TilingUniforms; - @group(2) @binding(1) var uTexture: texture_2d; - @group(2) @binding(2) var uSampler: sampler; - `,main:` - uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy; - - position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy; - `},fragment:{header:` - struct TilingUniforms { - uMapCoord:mat3x3, - uClampFrame:vec4, - uClampOffset:vec2, - uTextureTransform:mat3x3, - uSizeAnchor:vec4 - }; - - @group(2) @binding(0) var tilingUniforms: TilingUniforms; - @group(2) @binding(1) var uTexture: texture_2d; - @group(2) @binding(2) var uSampler: sampler; - `,main:` - - var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV); - coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy; - var unclamped = coord; - coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw); - - var bias = 0.; - - if(unclamped.x == coord.x && unclamped.y == coord.y) - { - bias = -32.; - } - - outColor = textureSampleBias(uTexture, uSampler, coord, bias); - `}},Qt={name:"tiling-bit",vertex:{header:` - uniform mat3 uTextureTransform; - uniform vec4 uSizeAnchor; - - `,main:` - uv = (uTextureTransform * vec3(aUV, 1.0)).xy; - - position = (position - uSizeAnchor.zw) * uSizeAnchor.xy; - `},fragment:{header:` - uniform sampler2D uTexture; - uniform mat3 uMapCoord; - uniform vec4 uClampFrame; - uniform vec2 uClampOffset; - `,main:` - - vec2 coord = vUV + ceil(uClampOffset - vUV); - coord = (uMapCoord * vec3(coord, 1.0)).xy; - vec2 unclamped = coord; - coord = clamp(coord, uClampFrame.xy, uClampFrame.zw); - - outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0 - - `}};let X,K;class Jt extends se{constructor(){X??(X=Ae({name:"tiling-sprite-shader",bits:[St,qt,ze]})),K??(K=ke({name:"tiling-sprite-shader",bits:[Ft,Qt,Oe]}));const e=new G({uMapCoord:{value:new P,type:"mat3x3"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2"},uTextureTransform:{value:new P,type:"mat3x3"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4"}});super({glProgram:K,gpuProgram:X,resources:{localUniforms:new G({uTransformMatrix:{value:new P,type:"mat3x3"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:R.EMPTY.source,uSampler:R.EMPTY.source.style}})}updateUniforms(e,t,r,n,i,s){const a=this.resources.tilingUniforms,l=s.width,u=s.height,h=s.textureMatrix,c=a.uniforms.uTextureTransform;c.set(r.a*l/e,r.b*l/t,r.c*u/e,r.d*u/t,r.tx/e,r.ty/t),c.invert(),a.uniforms.uMapCoord=h.mapCoord,a.uniforms.uClampFrame=h.uClampFrame,a.uniforms.uClampOffset=h.uClampOffset,a.uniforms.uTextureTransform=c,a.uniforms.uSizeAnchor[0]=e,a.uniforms.uSizeAnchor[1]=t,a.uniforms.uSizeAnchor[2]=n,a.uniforms.uSizeAnchor[3]=i,s&&(this.resources.uTexture=s.source,this.resources.uSampler=s.source.style)}}class Zt extends ae{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function er(o,e){const t=o.anchor.x,r=o.anchor.y;e[0]=-t*o.width,e[1]=-r*o.height,e[2]=(1-t)*o.width,e[3]=-r*o.height,e[4]=(1-t)*o.width,e[5]=(1-r)*o.height,e[6]=-t*o.width,e[7]=(1-r)*o.height}function tr(o,e,t,r){let n=0;const i=o.length/e,s=r.a,a=r.b,l=r.c,u=r.d,h=r.tx,c=r.ty;for(t*=e;n, - uTransformMatrix:mat3x3, - uDistance: f32, - uRound:f32, - } - - @group(2) @binding(0) var localUniforms : LocalUniforms; - `,main:` - vColor *= localUniforms.uColor; - modelMatrix *= localUniforms.uTransformMatrix; - `,end:` - if(localUniforms.uRound == 1) - { - vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - } - `},fragment:{header:` - struct LocalUniforms { - uColor:vec4, - uTransformMatrix:mat3x3, - uDistance: f32 - } - - @group(2) @binding(0) var localUniforms : LocalUniforms; - `,main:` - outColor = vec4(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance)); - `}},sr={name:"local-uniform-msdf-bit",vertex:{header:` - uniform mat3 uTransformMatrix; - uniform vec4 uColor; - uniform float uRound; - `,main:` - vColor *= uColor; - modelMatrix *= uTransformMatrix; - `,end:` - if(uRound == 1.) - { - gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - } - `},fragment:{header:` - uniform float uDistance; - `,main:` - outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance)); - `}},ar={name:"msdf-bit",fragment:{header:` - fn calculateMSDFAlpha(msdfColor:vec4, shapeColor:vec4, distance:f32) -> f32 { - - // MSDF - var median = msdfColor.r + msdfColor.g + msdfColor.b - - min(msdfColor.r, min(msdfColor.g, msdfColor.b)) - - max(msdfColor.r, max(msdfColor.g, msdfColor.b)); - - // SDF - median = min(median, msdfColor.a); - - var screenPxDistance = distance * (median - 0.5); - var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0); - if (median < 0.01) { - alpha = 0.0; - } else if (median > 0.99) { - alpha = 1.0; - } - - // Gamma correction for coverage-like alpha - var luma: f32 = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114)); - var gamma: f32 = mix(1.0, 1.0 / 2.2, luma); - var coverage: f32 = pow(shapeColor.a * alpha, gamma); - - return coverage; - - } - `}},or={name:"msdf-bit",fragment:{header:` - float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) { - - // MSDF - float median = msdfColor.r + msdfColor.g + msdfColor.b - - min(msdfColor.r, min(msdfColor.g, msdfColor.b)) - - max(msdfColor.r, max(msdfColor.g, msdfColor.b)); - - // SDF - median = min(median, msdfColor.a); - - float screenPxDistance = distance * (median - 0.5); - float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0); - - if (median < 0.01) { - alpha = 0.0; - } else if (median > 0.99) { - alpha = 1.0; - } - - // Gamma correction for coverage-like alpha - float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114)); - float gamma = mix(1.0, 1.0 / 2.2, luma); - float coverage = pow(shapeColor.a * alpha, gamma); - - return coverage; - } - `}};let $,j;class ur extends se{constructor(e){const t=new G({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uTransformMatrix:{value:new P,type:"mat3x3"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});$??($=Ae({name:"sdf-shader",bits:[gt,xt(e),ir,ar,ze]})),j??(j=ke({name:"sdf-shader",bits:[_t,bt(e),sr,or,Oe]})),super({glProgram:j,gpuProgram:$,resources:{localUniforms:t,batchSamplers:vt(e)}})}}class lr extends wt{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}}class nt{constructor(e){this._renderer=e,this._managedBitmapTexts=new B({renderer:e,type:"renderable",priority:-2,name:"bitmapText"})}validateRenderable(e){const t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);Fe(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}updateRenderable(e){const t=this._getGpuBitmapText(e);Fe(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,n=yt.getFont(e.text,e._style);r.clear(),n.distanceField.type!=="none"&&(r.customShader||(r.customShader=new ur(this._renderer.limits.maxBatchableTextures)));const i=M.graphemeSegmenter(e.text),s=e._style;let a=n.baseLineOffset;const l=Tt(i,s,n,!0),u=s.padding,h=l.scale;let c=l.width,d=l.height+l.offsetY;s._stroke&&(c+=s._stroke.width/h,d+=s._stroke.width/h),r.translate(-e._anchor._x*c-u,-e._anchor._y*d-u).scale(h,h);const f=n.applyFillAsTint?s._fill.color:16777215;let m=n.fontMetrics.fontSize,x=n.lineHeight;s.lineHeight&&(m=s.fontSize/h,x=s.lineHeight/h);let g=(x-m)/2;g-n.baseLineOffset<0&&(g=0);for(let _=0;_{console.error(i)}),e._didTextUpdate=!1,te(r,e)}this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=t.texturePromise;t.texturePromise=null,t.generatingTexture=!0,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let n=this._renderer.htmlText.getTexturePromise(e);r&&(n=n.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(t.currentKey),this._renderer.htmlText.returnTexturePromise(r)})),t.texturePromise=n,t.currentKey=e.styleKey,t.texture=await n;const i=e.renderGroup||e.parentRenderGroup;i&&(i.structureDidChange=!0),t.generatingTexture=!1,te(t,e)}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new cr;return t.renderable=e,t.transform=e.groupTransform,t.texture=R.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,this._managedTexts.add(e),t}onTextUnload(e){const t=e._gpuData[this._renderer.uid];if(!t)return;const{htmlText:r}=this._renderer;r.getReferenceCount(t.currentKey)===null?r.returnTexturePromise(t.texturePromise):r.decreaseReferenceCount(t.currentKey)}destroy(){this._managedTexts.destroy(),this._renderer=null}}it.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"htmlText"};function dr(){const{userAgent:o}=L.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(o)}const hr=new Me;function st(o,e,t,r){const n=hr;n.minX=0,n.minY=0,n.maxX=o.width/r|0,n.maxY=o.height/r|0;const i=w.getOptimalTexture(n.width,n.height,r,!1);return i.source.uploadMethodId="image",i.source.resource=o,i.source.alphaMode="premultiply-alpha-on-upload",i.frame.width=e/r,i.frame.height=t/r,i.source.emit("update",i.source),i.updateUvs(),i}function fr(o,e){const t=e.fontFamily,r=[],n={},i=/font-family:([^;"\s]+)/g,s=o.match(i);function a(l){n[l]||(r.push(l),n[l]=!0)}if(Array.isArray(t))for(let l=0;l{const u=l.split(":")[1].trim();a(u)});for(const l in e.tagStyles){const u=e.tagStyles[l].fontFamily;a(u)}return r}async function pr(o){const t=await(await L.get().fetch(o)).blob(),r=new FileReader;return await new Promise((i,s)=>{r.onloadend=()=>i(r.result),r.onerror=s,r.readAsDataURL(t)})}async function mr(o,e){const t=await pr(e);return`@font-face { - font-family: "${o.fontFamily}"; - font-weight: ${o.fontWeight}; - font-style: ${o.fontStyle}; - src: url('${t}'); - }`}const N=new Map;async function gr(o){const e=o.filter(t=>ee.has(`${t}-and-url`)).map(t=>{if(!N.has(t)){const{entries:r}=ee.get(`${t}-and-url`),n=[];r.forEach(i=>{const s=i.url,l=i.faces.map(u=>({weight:u.weight,style:u.style}));n.push(...l.map(u=>mr({fontWeight:u.weight,fontStyle:u.style,fontFamily:t},s)))}),N.set(t,Promise.all(n).then(i=>i.join(` -`)))}return N.get(t)});return(await Promise.all(e)).join(` -`)}function xr(o,e,t,r,n){const{domElement:i,styleElement:s,svgRoot:a}=n;i.innerHTML=`
                ${o}
                `,i.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),s.textContent=r;const{width:l,height:u}=n.image;return a.setAttribute("width",l.toString()),a.setAttribute("height",u.toString()),new XMLSerializer().serializeToString(a)}function _r(o,e){const t=E.getOptimalCanvasAndContext(o.width,o.height,e),{context:r}=t;return r.clearRect(0,0,o.width,o.height),r.drawImage(o,0,0),t}function br(o,e,t){return new Promise(async r=>{t&&await new Promise(n=>setTimeout(n,100)),o.onload=()=>{r()},o.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,o.crossOrigin="anonymous"})}class at{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===ne.WEBGPU}getTexture(e){return this.getTexturePromise(e)}getManagedTexture(e){const t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].promise;const r=this._buildTexturePromise(e).then(n=>(this._activeTextures[t].texture=n,n));return this._activeTextures[t]={texture:null,promise:r,usageCount:1},r}getReferenceCount(e){return this._activeTextures[e]?.usageCount??null}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t.texture):t.promise.then(r=>{t.texture=r,this._cleanUp(t.texture)}).catch(()=>{q("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){const{text:t,style:r,resolution:n,textureStyle:i}=e,s=W.get(Xe),a=fr(t,r),l=await gr(a),u=Ot(t,r,l,s),h=Math.ceil(Math.ceil(Math.max(1,u.width)+r.padding*2)*n),c=Math.ceil(Math.ceil(Math.max(1,u.height)+r.padding*2)*n),d=s.image,f=2;d.width=(h|0)+f,d.height=(c|0)+f;const m=xr(t,r,n,l,s);await br(d,m,dr()&&a.length>0);const x=d;let g;this._createCanvas&&(g=_r(d,n));const _=st(g?g.canvas:x,d.width-f,d.height-f,n);return i&&(_.source.style=i),this._createCanvas&&(this._renderer.texture.initSource(_.source),E.returnCanvasAndContext(g)),W.return(s),_}returnTexturePromise(e){e.then(t=>{this._cleanUp(t)}).catch(()=>{q("HTMLTextSystem: Failed to clean texture")})}_cleanUp(e){w.returnTexture(e,!0),e.source.resource=null,e.source.uploadMethodId="unknown"}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexturePromise(this._activeTextures[e].promise);this._activeTextures=null}}at.extension={type:[p.WebGLSystem,p.WebGPUSystem,p.CanvasSystem],name:"htmlText"};class vr extends Ie{}class ot{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new B({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const e in this._managedTexts.items){const t=this._managedTexts.items[e];t?._autoResolution&&t.onViewUpdate()}}validateRenderable(e){const t=this._getGpuText(e),r=e.styleKey;return t.currentKey!==r?!0:e._didTextUpdate}addRenderable(e,t){const r=this._getGpuText(e);if(e._didTextUpdate){const n=e._autoResolution?this._renderer.resolution:e.resolution;(r.currentKey!==e.styleKey||e.resolution!==n)&&this._updateGpuText(e),e._didTextUpdate=!1,te(r,e)}this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}_updateGpuText(e){const t=this._getGpuText(e);t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e.styleKey}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new vr;return t.currentKey="--",t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,this._managedTexts.add(e),t}onTextUnload(e){const t=e._gpuData[this._renderer.uid];if(!t)return;const{canvasText:r}=this._renderer;r.getReferenceCount(t.currentKey)>0?r.decreaseReferenceCount(t.currentKey):t.texture&&r.returnTexture(t.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}ot.extension={type:[p.WebGLPipes,p.WebGPUPipes,p.CanvasPipes],name:"text"};class ut{constructor(e){this._activeTextures={},this._renderer=e}getTexture(e,t,r,n){typeof e=="string"&&(I("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof pe||(e.style=new pe(e.style)),e.textureStyle instanceof Z||(e.textureStyle=new Z(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:i,style:s,textureStyle:a}=e,l=e.resolution??this._renderer.resolution,{frame:u,canvasAndContext:h}=H.getCanvasAndContext({text:i,style:s,resolution:l}),c=st(h.canvas,u.width,u.height,l);if(a&&(c.source.style=a),s.trim&&(u.pad(s.padding),c.frame.copyFrom(u),c.frame.scale(1/l),c.updateUvs()),s.filters){const d=this._applyFilters(c,s.filters);return this.returnTexture(c),H.returnCanvasAndContext(h),d}return this._renderer.texture.initSource(c._source),H.returnCanvasAndContext(h),c}returnTexture(e){const t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",w.returnTexture(e,!0)}renderTextToCanvas(){I("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const r=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle});return this._activeTextures[t]={texture:r,usageCount:1},r}decreaseReferenceCount(e){const t=this._activeTextures[e];t.usageCount--,t.usageCount===0&&(this.returnTexture(t.texture),this._activeTextures[e]=null)}getReferenceCount(e){return this._activeTextures[e]?.usageCount??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}_applyFilters(e,t){const r=this._renderer.renderTarget.renderTarget,n=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(r,!1),n}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null}}ut.extension={type:[p.WebGLSystem,p.WebGPUSystem,p.CanvasSystem],name:"canvasText"};y.add(Ee);y.add(Ve);y.add(Ke);y.add(Pt);y.add(Ne);y.add(Qe);y.add(Je);y.add(ut);y.add(ot);y.add(nt);y.add(at);y.add(it);y.add(rt);y.add(tt);y.add(Le);y.add(We); diff --git a/assets/window-D5YXrKnH.js b/assets/window-D5YXrKnH.js deleted file mode 100644 index 811af58dcd95259080e14db4c73dd05626416f65..0000000000000000000000000000000000000000 --- a/assets/window-D5YXrKnH.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as t,a9 as e}from"./index-DydPgVMC.js";function w(i,o){t(window,["resize"],()=>e(()=>o(window[i])))}export{w as b}; diff --git a/assets/xychartDiagram-PRI3JC2R-Bu9EaIWj.js b/assets/xychartDiagram-PRI3JC2R-Bu9EaIWj.js deleted file mode 100644 index 7a20f0a73a27ebd36b308c125a5acd41053b8a3c..0000000000000000000000000000000000000000 --- a/assets/xychartDiagram-PRI3JC2R-Bu9EaIWj.js +++ /dev/null @@ -1,7 +0,0 @@ -import{s as ei,g as si,q as Lt,p as ni,a as ai,b as oi,_ as a,l as Et,I as ri,d as hi,y as li,G as xt,h as ci,E as It,F as ui,L as gi,ab as xi}from"./mermaid.core-BcqUqpnI.js";import{i as di}from"./init-Dmth1JHB.js";import{o as pi}from"./ordinal-BeghXfj9.js";import{r as fi}from"./range-OtVwhkKS.js";import{l as Tt}from"./linear-8mDBZVC7.js";import{l as Dt}from"./step-B-Gbak1k.js";import"./index-DydPgVMC.js";import"./i18n-CPHyzK9b.js";import"./dispatch-kxCwF96_.js";import"./select-BigU4G0v.js";import"./defaultLocale-CzDG__Ur.js";function ht(){var t=pi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,d,g,m=!1,S=0,D=0,v=.5;delete t.unknown;function w(){var y=i().length,E=n"u"&&(R.yylloc={});var at=R.yylloc;o.push(at);var ti=R.options&&R.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(V){u.length=u.length-2*V,A.length=A.length-V,o.length=o.length-V}a(ii,"popStack");function kt(){var V;return V=x.pop()||R.lex()||_t,typeof V!="number"&&(V instanceof Array&&(x=V,V=x.pop()),V=c.symbols_[V]||V),V}a(kt,"lex");for(var M,H,B,ot,q={},tt,O,Rt,it;;){if(H=u[u.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((M===null||typeof M>"u")&&(M=kt()),B=j[H]&&j[H][M]),typeof B>"u"||!B.length||!B[0]){var rt="";it=[];for(tt in j[H])this.terminals_[tt]&&tt>Zt&&it.push("'"+this.terminals_[tt]+"'");R.showPosition?rt="Parse error on line "+(J+1)+`: -`+R.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[M]||M)+"'":rt="Parse error on line "+(J+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(rt,{text:R.match,token:this.terminals_[M]||M,line:R.yylineno,loc:at,expected:it})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+M);switch(B[0]){case 1:u.push(M),A.push(R.yytext),o.push(R.yylloc),u.push(B[1]),M=null,St=R.yyleng,p=R.yytext,J=R.yylineno,at=R.yylloc;break;case 2:if(O=this.productions_[B[1]][1],q.$=A[A.length-O],q._$={first_line:o[o.length-(O||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(O||1)].first_column,last_column:o[o.length-1].last_column},ti&&(q._$.range=[o[o.length-(O||1)].range[0],o[o.length-1].range[1]]),ot=this.performAction.apply(q,[p,St,J,Y.yy,B[1],A,o].concat(Jt)),typeof ot<"u")return ot;O&&(u=u.slice(0,-1*O*2),A=A.slice(0,-1*O),o=o.slice(0,-1*O)),u.push(this.productions_[B[1]][0]),A.push(q.$),o.push(q._$),Rt=j[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},Ct=(function(){var F={EOF:1,parseError:a(function(c,u){if(this.yy.parser)this.yy.parser.parseError(c,u);else throw new Error(c)},"parseError"),setInput:a(function(r,c){return this.yy=c||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a(function(r){var c=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:a(function(r,c){var u,x,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],u=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var o in A)this[o]=A[o];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,c,u,x;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),o=0;oc[0].length)){if(c=u,x=o,this.options.backtrack_lexer){if(r=this.test_match(u,A[o]),r!==!1)return r;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(r=this.test_match(c,A[x]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var c=this.next();return c||this.lex()},"lex"),begin:a(function(c){this.conditionStack.push(c)},"begin"),popState:a(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:a(function(c){this.begin(c)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(c,u,x,A){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();$.lexer=Ct;function N(){this.yy={}}return a(N,"Parser"),N.prototype=$,$.Parser=N,new N})();lt.parser=lt;var mi=lt;function ct(t){return t.type==="bar"}a(ct,"isBarPlot");function dt(t){return t.type==="band"}a(dt,"isBandAxisData");function G(t){return t.type==="linear"}a(G,"isLinearAxisData");var Mt=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((n,d)=>Math.max(d.length,n),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const d=xi(s,1,n),g=d?d.width:n.length*i,m=d?d.height:i;e.width=Math.max(e.width,g),e.height=Math.max(e.height,m)}return s.remove(),e}},vt=.7,Pt=.2,Vt=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{a(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){vt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(vt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+this.axisConfig.labelPadding*2;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},yi=class extends Vt{static{a(this,"BandAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=ht().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=ht().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Et.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},bi=class extends Vt{static{a(this,"LinearAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=Tt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Tt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function ut(t,i,e,s){const n=new Mt(s);return dt(t)?new yi(i,e,t.categories,t.title,n):new bi(i,e,[t.min,t.max],t.title,n)}a(ut,"getAxis");var Ai=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{a(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Bt(t,i,e,s){const n=new Mt(s);return new Ai(n,t,i,e)}a(Bt,"getChartTitleComponent");var wi=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}static{a(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=Dt().y(e=>e[0]).x(e=>e[1])(t):i=Dt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Ci=class{constructor(t,i,e,s,n,d){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=d}static{a(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:e,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:e,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Si=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{a(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new wi(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Ci(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}return t}};function Wt(t,i,e){return new Si(t,i,e)}a(Wt,"getPlotComponent");var _i=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Bt(t,i,e,s),plot:Wt(t,i,e),xAxis:ut(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:ut(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{a(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),d=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:n,height:d});t-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("bottom"),g=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=g.height,this.componentStore.yAxis.setAxisPosition("left"),g=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=g.width,t-=g.width,t>0&&(n+=t,t=0),i>0&&(d+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:d}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+d}),this.componentStore.yAxis.setRange([s,s+d]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(m=>ct(m))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,d=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:d,height:g});t-=m.width,i-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=m.height,i-=m.height,this.componentStore.xAxis.setAxisPosition("left"),m=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=m.width,s=m.width,this.componentStore.yAxis.setAxisPosition("top"),m=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=m.height,n=e+m.height,t>0&&(d+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:d,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+d]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+g]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(S=>ct(S))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},ki=class{static{a(this,"XYChartBuilder")}static build(t,i,e,s){return new _i(t,i,e,s).getDrawableElement()}},Q=0,zt,K=mt(),Z=ft(),b=yt(),gt=Z.plotColorPalette.split(",").map(t=>t.trim()),et=!1,pt=!1;function ft(){const t=gi(),i=xt();return It(t.xyChart,i.themeVariables.xyChart)}a(ft,"getChartDefaultThemeConfig");function mt(){const t=xt();return It(ui.xyChart,t.xyChart)}a(mt,"getChartDefaultConfig");function yt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(yt,"getChartDefaultData");function st(t){const i=xt();return ci(t.trim(),i)}a(st,"textSanitizer");function Ft(t){zt=t}a(Ft,"setTmpSVGG");function Ot(t){t==="horizontal"?K.chartOrientation="horizontal":K.chartOrientation="vertical"}a(Ot,"setOrientation");function Xt(t){b.xAxis.title=st(t.text)}a(Xt,"setXAxisTitle");function bt(t,i){b.xAxis={type:"linear",title:b.xAxis.title,min:t,max:i},et=!0}a(bt,"setXAxisRangeData");function Nt(t){b.xAxis={type:"band",title:b.xAxis.title,categories:t.map(i=>st(i.text))},et=!0}a(Nt,"setXAxisBand");function Yt(t){b.yAxis.title=st(t.text)}a(Yt,"setYAxisTitle");function Ht(t,i){b.yAxis={type:"linear",title:b.yAxis.title,min:t,max:i},pt=!0}a(Ht,"setYAxisRangeData");function Ut(t){const i=Math.min(...t),e=Math.max(...t),s=G(b.yAxis)?b.yAxis.min:1/0,n=G(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}a(Ut,"setYAxisRangeFromPlotData");function At(t){let i=[];if(t.length===0)return i;if(!et){const e=G(b.xAxis)?b.xAxis.min:1/0,s=G(b.xAxis)?b.xAxis.max:-1/0;bt(Math.min(e,1),Math.max(s,t.length))}if(pt||Ut(t),dt(b.xAxis)&&(i=b.xAxis.categories.map((e,s)=>[e,t[s]])),G(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,n=(s-e)/(t.length-1),d=[];for(let g=e;g<=s;g+=n)d.push(`${g}`);i=d.map((g,m)=>[g,t[m]])}return i}a(At,"transformDataWithoutCategory");function wt(t){return gt[t===0?0:t%gt.length]}a(wt,"getPlotColorFromPalette");function $t(t,i){const e=At(i);b.plots.push({type:"line",strokeFill:wt(Q),strokeWidth:2,data:e}),Q++}a($t,"setLineData");function qt(t,i){const e=At(i);b.plots.push({type:"bar",fill:wt(Q),data:e}),Q++}a(qt,"setBarData");function Gt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=Lt(),ki.build(K,b,Z,zt)}a(Gt,"getDrawableElem");function jt(){return Z}a(jt,"getChartThemeConfig");function Qt(){return K}a(Qt,"getChartConfig");function Kt(){return b}a(Kt,"getXYChartData");var Ri=a(function(){li(),Q=0,K=mt(),b=yt(),Z=ft(),gt=Z.plotColorPalette.split(",").map(t=>t.trim()),et=!1,pt=!1},"clear"),Ti={getDrawableElem:Gt,clear:Ri,setAccTitle:oi,getAccTitle:ai,setDiagramTitle:ni,getDiagramTitle:Lt,getAccDescription:si,setAccDescription:ei,setOrientation:Ot,setXAxisTitle:Xt,setXAxisRangeData:bt,setXAxisBand:Nt,setYAxisTitle:Yt,setYAxisRangeData:Ht,setLineData:$t,setBarData:qt,setTmpSVGG:Ft,getChartThemeConfig:jt,getChartConfig:Qt,getXYChartData:Kt},Di=a((t,i,e,s)=>{const n=s.db,d=n.getChartThemeConfig(),g=n.getChartConfig(),m=n.getXYChartData().plots[0].data.map(f=>f[1]);function S(f){return f==="top"?"text-before-edge":"middle"}a(S,"getDominantBaseLine");function D(f){return f==="left"?"start":f==="right"?"end":"middle"}a(D,"getTextAnchor");function v(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}a(v,"getTextTransformation"),Et.debug(`Rendering xychart chart -`+t);const w=ri(i),y=w.append("g").attr("class","main"),E=y.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");hi(w,g.height,g.width,!0),w.attr("viewBox",`0 0 ${g.width} ${g.height}`),E.attr("fill",d.backgroundColor),n.setTmpSVGG(w.append("g").attr("class","mermaid-tmp-group"));const T=n.getDrawableElem(),P={};function I(f){let _=y,l="";for(const[W]of f.entries()){let z=y;W>0&&P[l]&&(z=P[l]),l+=f[W],_=P[l],_||(_=P[l]=z.append("g").attr("class",f[W]))}return _}a(I,"getGroup");for(const f of T){if(f.data.length===0)continue;const _=I(f.groupTexts);switch(f.type){case"rect":if(_.selectAll("rect").data(f.data).enter().append("rect").attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height).attr("fill",l=>l.fill).attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth),g.showDataLabel)if(g.chartOrientation==="horizontal"){let l=function(h,L){const{data:C,label:k}=h;return L*k.length*W<=C.width-10};a(l,"fitsHorizontally");const W=.7,z=f.data.map((h,L)=>({data:h,label:m[L].toString()})).filter(h=>h.data.width>0&&h.data.height>0),U=z.map(h=>{const{data:L}=h;let C=L.height*.7;for(;!l(h,C)&&C>0;)C-=1;return C}),X=Math.floor(Math.min(...U));_.selectAll("text").data(z).enter().append("text").attr("x",h=>h.data.x+h.data.width-10).attr("y",h=>h.data.y+h.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${X}px`).text(h=>h.label)}else{let l=function(h,L,C){const{data:k,label:$}=h,N=L*$.length*.7,F=k.x+k.width/2,r=F-N/2,c=F+N/2,u=r>=k.x&&c<=k.x+k.width,x=k.y+C+L<=k.y+k.height;return u&&x};a(l,"fitsInBar");const W=10,z=f.data.map((h,L)=>({data:h,label:m[L].toString()})).filter(h=>h.data.width>0&&h.data.height>0),U=z.map(h=>{const{data:L,label:C}=h;let k=L.width/(C.length*.7);for(;!l(h,k,W)&&k>0;)k-=1;return k}),X=Math.floor(Math.min(...U));_.selectAll("text").data(z).enter().append("text").attr("x",h=>h.data.x+h.data.width/2).attr("y",h=>h.data.y+W).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${X}px`).text(h=>h.label)}break;case"text":_.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",l=>l.fill).attr("font-size",l=>l.fontSize).attr("dominant-baseline",l=>S(l.verticalPos)).attr("text-anchor",l=>D(l.horizontalPos)).attr("transform",l=>v(l)).text(l=>l.text);break;case"path":_.selectAll("path").data(f.data).enter().append("path").attr("d",l=>l.path).attr("fill",l=>l.fill?l.fill:"none").attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth);break}}},"draw"),vi={draw:Di},Xi={parser:mi,db:Ti,renderer:vi};export{Xi as diagram}; diff --git a/style.css b/style.css deleted file mode 100644 index 114adf441e9032febb46bc056b2a8bb651075f0d..0000000000000000000000000000000000000000 --- a/style.css +++ /dev/null @@ -1,28 +0,0 @@ -body { - padding: 2rem; - font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif; -} - -h1 { - font-size: 16px; - margin-top: 0; -} - -p { - color: rgb(107, 114, 128); - font-size: 15px; - margin-bottom: 10px; - margin-top: 5px; -} - -.card { - max-width: 620px; - margin: 0 auto; - padding: 16px; - border: 1px solid lightgray; - border-radius: 16px; -} - -.card p:last-child { - margin-bottom: 0; -}